@vanwei-wcs/video-player-v2 0.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +24 -0
- package/package.json +54 -0
- package/video-player-v2/demo.html +1 -0
- package/video-player-v2/video-player-v2.common.js +17679 -0
- package/video-player-v2/video-player-v2.common.js.map +1 -0
- package/video-player-v2/video-player-v2.css +1 -0
- package/video-player-v2/video-player-v2.umd.js +17690 -0
- package/video-player-v2/video-player-v2.umd.js.map +1 -0
- package/video-player-v2/video-player-v2.umd.min.js +156 -0
- package/video-player-v2/video-player-v2.umd.min.js.map +1 -0
|
@@ -0,0 +1,156 @@
|
|
|
1
|
+
(function(e,t){"object"===typeof exports&&"object"===typeof module?module.exports=t():"function"===typeof define&&define.amd?define([],t):"object"===typeof exports?exports["video-player-v2"]=t():e["video-player-v2"]=t()})("undefined"!==typeof self?self:this,(function(){return function(){var __webpack_modules__={34:function(e,t,r){"use strict";var n=r(4901);e.exports=function(e){return"object"==typeof e?null!==e:n(e)}},81:function(e,t,r){"use strict";var n=r(9565),i=r(9306),o=r(8551),s=r(6823),a=r(851),u=TypeError;e.exports=function(e,t){var r=arguments.length<2?a(e):t;if(i(r))return o(n(r,e));throw new u(s(e)+" is not iterable")}},283:function(e,t,r){"use strict";var n=r(9504),i=r(9039),o=r(4901),s=r(9297),a=r(3724),u=r(350).CONFIGURABLE,l=r(3706),c=r(1181),h=c.enforce,f=c.get,d=String,p=Object.defineProperty,y=n("".slice),v=n("".replace),m=n([].join),g=a&&!i((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),_=e.exports=function(e,t,r){"Symbol("===y(d(t),0,7)&&(t="["+v(d(t),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),r&&r.getter&&(t="get "+t),r&&r.setter&&(t="set "+t),(!s(e,"name")||u&&e.name!==t)&&(a?p(e,"name",{value:t,configurable:!0}):e.name=t),g&&r&&s(r,"arity")&&e.length!==r.arity&&p(e,"length",{value:r.arity});try{r&&s(r,"constructor")&&r.constructor?a&&p(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(i){}var n=h(e);return s(n,"source")||(n.source=m(b,"string"==typeof t?t:"")),e};Function.prototype.toString=_((function(){return o(this)&&f(this).source||l(this)}),"toString")},309:function(e,t){
|
|
2
|
+
/*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
3
|
+
t.read=function(e,t,r,n,i){var o,s,a=8*i-n-1,u=(1<<a)-1,l=u>>1,c=-7,h=r?i-1:0,f=r?-1:1,d=e[t+h];for(h+=f,o=d&(1<<-c)-1,d>>=-c,c+=a;c>0;o=256*o+e[t+h],h+=f,c-=8);for(s=o&(1<<-c)-1,o>>=-c,c+=n;c>0;s=256*s+e[t+h],h+=f,c-=8);if(0===o)o=1-l;else{if(o===u)return s?NaN:1/0*(d?-1:1);s+=Math.pow(2,n),o-=l}return(d?-1:1)*s*Math.pow(2,o-n)},t.write=function(e,t,r,n,i,o){var s,a,u,l=8*o-i-1,c=(1<<l)-1,h=c>>1,f=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,d=n?0:o-1,p=n?1:-1,y=t<0||0===t&&1/t<0?1:0;for(t=Math.abs(t),isNaN(t)||t===1/0?(a=isNaN(t)?1:0,s=c):(s=Math.floor(Math.log(t)/Math.LN2),t*(u=Math.pow(2,-s))<1&&(s--,u*=2),t+=s+h>=1?f/u:f*Math.pow(2,1-h),t*u>=2&&(s++,u/=2),s+h>=c?(a=0,s=c):s+h>=1?(a=(t*u-1)*Math.pow(2,i),s+=h):(a=t*Math.pow(2,h-1)*Math.pow(2,i),s=0));i>=8;e[r+d]=255&a,d+=p,a/=256,i-=8);for(s=s<<i|a,l+=i;l>0;e[r+d]=255&s,d+=p,s/=256,l-=8);e[r+d-p]|=128*y}},328:function(module,__unused_webpack_exports,__webpack_require__){module=__webpack_require__.nmd(module),__webpack_require__(4114),__webpack_require__(8111),__webpack_require__(2489),__webpack_require__(1701),__webpack_require__(8237),__webpack_require__(4979),function(e,t){module.exports=t(__webpack_require__(2432))}(0,(function(require$$0){"use strict";function _interopDefaultLegacy(e){return e&&"object"==typeof e&&"default"in e?e:{default:e}}var require$$0__default=_interopDefaultLegacy(require$$0),extendStatics=function(e,t){return extendStatics=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])},extendStatics(e,t)};function __extends(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}extendStatics(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}var __assign$1=function(){return __assign$1=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign$1.apply(this,arguments)};function __awaiter(e,t,r,n){return new(r||(r=Promise))((function(i,o){function s(e){try{u(n.next(e))}catch(e){o(e)}}function a(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(s,a)}u((n=n.apply(e,t||[])).next())}))}function __generator(e,t){var r,n,i,o={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]},s=Object.create(("function"==typeof Iterator?Iterator:Object).prototype);return s.next=a(0),s.throw=a(1),s.return=a(2),"function"==typeof Symbol&&(s[Symbol.iterator]=function(){return this}),s;function a(a){return function(u){return function(a){if(r)throw new TypeError("Generator is already executing.");for(;s&&(s=0,a[0]&&(o=0)),o;)try{if(r=1,n&&(i=2&a[0]?n.return:a[0]?n.throw||((i=n.return)&&i.call(n),0):n.next)&&!(i=i.call(n,a[1])).done)return i;switch(n=0,i&&(a=[2&a[0],i.value]),a[0]){case 0:case 1:i=a;break;case 4:return o.label++,{value:a[1],done:!1};case 5:o.label++,n=a[1],a=[0];continue;case 7:a=o.ops.pop(),o.trys.pop();continue;default:if(i=o.trys,!((i=i.length>0&&i[i.length-1])||6!==a[0]&&2!==a[0])){o=0;continue}if(3===a[0]&&(!i||a[1]>i[0]&&a[1]<i[3])){o.label=a[1];break}if(6===a[0]&&o.label<i[1]){o.label=i[1],i=a;break}if(i&&o.label<i[2]){o.label=i[2],o.ops.push(a);break}i[2]&&o.ops.pop(),o.trys.pop();continue}a=t.call(e,o)}catch(e){a=[6,e],n=0}finally{r=i=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}([a,u])}}}function __read$1(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function __spread$1(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read$1(arguments[t]));return e}
|
|
4
|
+
/*!
|
|
5
|
+
* znu-event v0.0.10
|
|
6
|
+
* (c) 2020-2020 chenwuai
|
|
7
|
+
* https://github.com/chenchenwuai/znu-event.git
|
|
8
|
+
* Released under the MIT License.
|
|
9
|
+
*/
|
|
10
|
+
/*! *****************************************************************************
|
|
11
|
+
Copyright (c) Microsoft Corporation.
|
|
12
|
+
|
|
13
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
14
|
+
purpose with or without fee is hereby granted.
|
|
15
|
+
|
|
16
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
17
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
18
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
19
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
20
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
21
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
22
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
23
|
+
***************************************************************************** */function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=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 __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read(arguments[t]));return e}"function"==typeof SuppressedError&&SuppressedError;var ZnuEvent=function(){function e(){this._listenersMap={}}return e.prototype.on=function(e,t){return void 0===this._listenersMap[e]&&(this._listenersMap[e]=[]),this._listenersMap[e].push(t),this},e.prototype.once=function(e,t){return t.isOnce=!0,this.on(e,t),this},e.prototype.off=function(e,t){var r=this._listenersMap[e];if(void 0!==r)if(void 0===t)delete this._listenersMap[e];else{var n=r.findIndex((function(e){return e===t}));r.splice(n,1)}return this},e.prototype.offAll=function(){this._listenersMap={}},e.prototype.emit=function(e){for(var t,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this._listenersMap[e];if(void 0!==o&&o.length>0){try{for(var s=__values(o.entries()),a=s.next();!a.done;a=s.next()){var u=__read(a.value,2),l=u[0],c=u[1];if(c.isOnce){var h=c;o.splice(l,1),h.apply(void 0,__spread(n))}else c.apply(void 0,__spread(n))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return!0}return!1},e.prototype.has=function(e){return void 0!==this._listenersMap[e]&&this._listenersMap[e].length>0},e.prototype.eventNames=function(){var e=[];for(var t in this._listenersMap)e.push(t);return e},e.prototype.destroy=function(){this.offAll()},e}(),commonjsGlobal="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof __webpack_require__.g?__webpack_require__.g:"undefined"!=typeof self?self:{},wwavIo_umd={exports:{}};
|
|
24
|
+
/*!
|
|
25
|
+
* wwav-player
|
|
26
|
+
* (c) 2022-2024 chenwuai
|
|
27
|
+
* Released under the MIT License.
|
|
28
|
+
*/(function(module,exports){!function(e,t){module.exports=t()}(0,(function(){
|
|
29
|
+
/*!
|
|
30
|
+
* znu-event v0.0.10
|
|
31
|
+
* (c) 2020-2020 chenwuai
|
|
32
|
+
* https://github.com/chenchenwuai/znu-event.git
|
|
33
|
+
* Released under the MIT License.
|
|
34
|
+
*/
|
|
35
|
+
/*! *****************************************************************************
|
|
36
|
+
Copyright (c) Microsoft Corporation.
|
|
37
|
+
|
|
38
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
39
|
+
purpose with or without fee is hereby granted.
|
|
40
|
+
|
|
41
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
42
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
43
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
44
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
45
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
46
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
47
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
48
|
+
***************************************************************************** */
|
|
49
|
+
function __values(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=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 __read$1(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function __spread(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(__read$1(arguments[t]));return e}var ZnuEvent=function(){function e(){this._listenersMap={}}return e.prototype.on=function(e,t){return void 0===this._listenersMap[e]&&(this._listenersMap[e]=[]),this._listenersMap[e].push(t),this},e.prototype.once=function(e,t){return t.isOnce=!0,this.on(e,t),this},e.prototype.off=function(e,t){var r=this._listenersMap[e];if(void 0!==r)if(void 0===t)delete this._listenersMap[e];else{var n=r.findIndex((function(e){return e===t}));r.splice(n,1)}return this},e.prototype.offAll=function(){this._listenersMap={}},e.prototype.emit=function(e){for(var t,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this._listenersMap[e];if(void 0!==o&&o.length>0){try{for(var s=__values(o.entries()),a=s.next();!a.done;a=s.next()){var u=__read$1(a.value,2),l=u[0],c=u[1];if(c.isOnce){var h=c;o.splice(l,1),h.apply(void 0,__spread(n))}else c.apply(void 0,__spread(n))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return!0}return!1},e.prototype.has=function(e){return void 0!==this._listenersMap[e]&&this._listenersMap[e].length>0},e.prototype.eventNames=function(){var e=[];for(var t in this._listenersMap)e.push(t);return e},e.prototype.destroy=function(){this.offAll()},e}(),PROTOCOL="WWAV/1.0",Delimiter="\r\n",MessageErrors={OK:"OK",UNAUTHORIZED:"Unauthorized",AUTHORIZE_FAILED:"Authorize failed",NOT_EXISTING:"Not Existing"};function __read(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}"function"==typeof SuppressedError&&SuppressedError;var commonjsGlobal$1="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:void 0!==commonjsGlobal?commonjsGlobal:"undefined"!=typeof self?self:{},md5$1={exports:{}};
|
|
50
|
+
/**
|
|
51
|
+
* [js-md5]{@link https://github.com/emn178/js-md5}
|
|
52
|
+
*
|
|
53
|
+
* @namespace md5
|
|
54
|
+
* @version 0.7.3
|
|
55
|
+
* @author Chen, Yi-Cyuan [emn178@gmail.com]
|
|
56
|
+
* @copyright Chen, Yi-Cyuan 2014-2017
|
|
57
|
+
* @license MIT
|
|
58
|
+
*/(function(module){(function(){var ERROR="input is invalid type",WINDOW="object"==typeof window,root=WINDOW?window:{};root.JS_MD5_NO_WINDOW&&(WINDOW=!1);var WEB_WORKER=!WINDOW&&"object"==typeof self,NODE_JS=!root.JS_MD5_NO_NODE_JS&&"object"==typeof process&&process.versions&&process.versions.node;NODE_JS?root=commonjsGlobal$1:WEB_WORKER&&(root=self);var COMMON_JS=!root.JS_MD5_NO_COMMON_JS&&module.exports,ARRAY_BUFFER=!root.JS_MD5_NO_ARRAY_BUFFER&&"undefined"!=typeof ArrayBuffer,HEX_CHARS="0123456789abcdef".split(""),EXTRA=[128,32768,8388608,-2147483648],SHIFT=[0,8,16,24],OUTPUT_TYPES=["hex","array","digest","buffer","arrayBuffer","base64"],BASE64_ENCODE_CHAR="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split(""),blocks=[],buffer8;if(ARRAY_BUFFER){var buffer=new ArrayBuffer(68);buffer8=new Uint8Array(buffer),blocks=new Uint32Array(buffer)}!root.JS_MD5_NO_NODE_JS&&Array.isArray||(Array.isArray=function(e){return"[object Array]"===Object.prototype.toString.call(e)}),!ARRAY_BUFFER||!root.JS_MD5_NO_ARRAY_BUFFER_IS_VIEW&&ArrayBuffer.isView||(ArrayBuffer.isView=function(e){return"object"==typeof e&&e.buffer&&e.buffer.constructor===ArrayBuffer});var createOutputMethod=function(e){return function(t){return new Md5(!0).update(t)[e]()}},createMethod=function(){var e=createOutputMethod("hex");NODE_JS&&(e=nodeWrap(e)),e.create=function(){return new Md5},e.update=function(t){return e.create().update(t)};for(var t=0;t<OUTPUT_TYPES.length;++t){var r=OUTPUT_TYPES[t];e[r]=createOutputMethod(r)}return e},nodeWrap=function(method){var crypto=eval("require('crypto')"),Buffer=eval("require('buffer').Buffer"),nodeMethod=function(e){if("string"==typeof e)return crypto.createHash("md5").update(e,"utf8").digest("hex");if(null==e)throw ERROR;return e.constructor===ArrayBuffer&&(e=new Uint8Array(e)),Array.isArray(e)||ArrayBuffer.isView(e)||e.constructor===Buffer?crypto.createHash("md5").update(new Buffer(e)).digest("hex"):method(e)};return nodeMethod};function Md5(e){if(e)blocks[0]=blocks[16]=blocks[1]=blocks[2]=blocks[3]=blocks[4]=blocks[5]=blocks[6]=blocks[7]=blocks[8]=blocks[9]=blocks[10]=blocks[11]=blocks[12]=blocks[13]=blocks[14]=blocks[15]=0,this.blocks=blocks,this.buffer8=buffer8;else if(ARRAY_BUFFER){var t=new ArrayBuffer(68);this.buffer8=new Uint8Array(t),this.blocks=new Uint32Array(t)}else this.blocks=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0];this.h0=this.h1=this.h2=this.h3=this.start=this.bytes=this.hBytes=0,this.finalized=this.hashed=!1,this.first=!0}Md5.prototype.update=function(e){if(!this.finalized){var t,r=typeof e;if("string"!==r){if("object"!==r)throw ERROR;if(null===e)throw ERROR;if(ARRAY_BUFFER&&e.constructor===ArrayBuffer)e=new Uint8Array(e);else if(!(Array.isArray(e)||ARRAY_BUFFER&&ArrayBuffer.isView(e)))throw ERROR;t=!0}for(var n,i,o=0,s=e.length,a=this.blocks,u=this.buffer8;o<s;){if(this.hashed&&(this.hashed=!1,a[0]=a[16],a[16]=a[1]=a[2]=a[3]=a[4]=a[5]=a[6]=a[7]=a[8]=a[9]=a[10]=a[11]=a[12]=a[13]=a[14]=a[15]=0),t)if(ARRAY_BUFFER)for(i=this.start;o<s&&i<64;++o)u[i++]=e[o];else for(i=this.start;o<s&&i<64;++o)a[i>>2]|=e[o]<<SHIFT[3&i++];else if(ARRAY_BUFFER)for(i=this.start;o<s&&i<64;++o)(n=e.charCodeAt(o))<128?u[i++]=n:n<2048?(u[i++]=192|n>>6,u[i++]=128|63&n):n<55296||n>=57344?(u[i++]=224|n>>12,u[i++]=128|n>>6&63,u[i++]=128|63&n):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),u[i++]=240|n>>18,u[i++]=128|n>>12&63,u[i++]=128|n>>6&63,u[i++]=128|63&n);else for(i=this.start;o<s&&i<64;++o)(n=e.charCodeAt(o))<128?a[i>>2]|=n<<SHIFT[3&i++]:n<2048?(a[i>>2]|=(192|n>>6)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]):n<55296||n>=57344?(a[i>>2]|=(224|n>>12)<<SHIFT[3&i++],a[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]):(n=65536+((1023&n)<<10|1023&e.charCodeAt(++o)),a[i>>2]|=(240|n>>18)<<SHIFT[3&i++],a[i>>2]|=(128|n>>12&63)<<SHIFT[3&i++],a[i>>2]|=(128|n>>6&63)<<SHIFT[3&i++],a[i>>2]|=(128|63&n)<<SHIFT[3&i++]);this.lastByteIndex=i,this.bytes+=i-this.start,i>=64?(this.start=i-64,this.hash(),this.hashed=!0):this.start=i}return this.bytes>4294967295&&(this.hBytes+=this.bytes/4294967296|0,this.bytes=this.bytes%4294967296),this}},Md5.prototype.finalize=function(){if(!this.finalized){this.finalized=!0;var e=this.blocks,t=this.lastByteIndex;e[t>>2]|=EXTRA[3&t],t>=56&&(this.hashed||this.hash(),e[0]=e[16],e[16]=e[1]=e[2]=e[3]=e[4]=e[5]=e[6]=e[7]=e[8]=e[9]=e[10]=e[11]=e[12]=e[13]=e[14]=e[15]=0),e[14]=this.bytes<<3,e[15]=this.hBytes<<3|this.bytes>>>29,this.hash()}},Md5.prototype.hash=function(){var e,t,r,n,i,o,s=this.blocks;this.first?t=((t=((e=((e=s[0]-680876937)<<7|e>>>25)-271733879|0)^(r=((r=(-271733879^(n=((n=(-1732584194^2004318071&e)+s[1]-117830708)<<12|n>>>20)+e|0)&(-271733879^e))+s[2]-1126478375)<<17|r>>>15)+n|0)&(n^e))+s[3]-1316259209)<<22|t>>>10)+r|0:(e=this.h0,t=this.h1,r=this.h2,t=((t+=((e=((e+=((n=this.h3)^t&(r^n))+s[0]-680876936)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+s[1]-389564586)<<12|n>>>20)+e|0)&(e^t))+s[2]+606105819)<<17|r>>>15)+n|0)&(n^e))+s[3]-1044525330)<<22|t>>>10)+r|0),t=((t+=((e=((e+=(n^t&(r^n))+s[4]-176418897)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+s[5]+1200080426)<<12|n>>>20)+e|0)&(e^t))+s[6]-1473231341)<<17|r>>>15)+n|0)&(n^e))+s[7]-45705983)<<22|t>>>10)+r|0,t=((t+=((e=((e+=(n^t&(r^n))+s[8]+1770035416)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+s[9]-1958414417)<<12|n>>>20)+e|0)&(e^t))+s[10]-42063)<<17|r>>>15)+n|0)&(n^e))+s[11]-1990404162)<<22|t>>>10)+r|0,t=((t+=((e=((e+=(n^t&(r^n))+s[12]+1804603682)<<7|e>>>25)+t|0)^(r=((r+=(t^(n=((n+=(r^e&(t^r))+s[13]-40341101)<<12|n>>>20)+e|0)&(e^t))+s[14]-1502002290)<<17|r>>>15)+n|0)&(n^e))+s[15]+1236535329)<<22|t>>>10)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+s[1]-165796510)<<5|e>>>27)+t|0)^t))+s[6]-1069501632)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+s[11]+643717713)<<14|r>>>18)+n|0)^n))+s[0]-373897302)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+s[5]-701558691)<<5|e>>>27)+t|0)^t))+s[10]+38016083)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+s[15]-660478335)<<14|r>>>18)+n|0)^n))+s[4]-405537848)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+s[9]+568446438)<<5|e>>>27)+t|0)^t))+s[14]-1019803690)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+s[3]-187363961)<<14|r>>>18)+n|0)^n))+s[8]+1163531501)<<20|t>>>12)+r|0,t=((t+=((n=((n+=(t^r&((e=((e+=(r^n&(t^r))+s[13]-1444681467)<<5|e>>>27)+t|0)^t))+s[2]-51403784)<<9|n>>>23)+e|0)^e&((r=((r+=(e^t&(n^e))+s[7]+1735328473)<<14|r>>>18)+n|0)^n))+s[12]-1926607734)<<20|t>>>12)+r|0,t=((t+=((o=(n=((n+=((i=t^r)^(e=((e+=(i^n)+s[5]-378558)<<4|e>>>28)+t|0))+s[8]-2022574463)<<11|n>>>21)+e|0)^e)^(r=((r+=(o^t)+s[11]+1839030562)<<16|r>>>16)+n|0))+s[14]-35309556)<<23|t>>>9)+r|0,t=((t+=((o=(n=((n+=((i=t^r)^(e=((e+=(i^n)+s[1]-1530992060)<<4|e>>>28)+t|0))+s[4]+1272893353)<<11|n>>>21)+e|0)^e)^(r=((r+=(o^t)+s[7]-155497632)<<16|r>>>16)+n|0))+s[10]-1094730640)<<23|t>>>9)+r|0,t=((t+=((o=(n=((n+=((i=t^r)^(e=((e+=(i^n)+s[13]+681279174)<<4|e>>>28)+t|0))+s[0]-358537222)<<11|n>>>21)+e|0)^e)^(r=((r+=(o^t)+s[3]-722521979)<<16|r>>>16)+n|0))+s[6]+76029189)<<23|t>>>9)+r|0,t=((t+=((o=(n=((n+=((i=t^r)^(e=((e+=(i^n)+s[9]-640364487)<<4|e>>>28)+t|0))+s[12]-421815835)<<11|n>>>21)+e|0)^e)^(r=((r+=(o^t)+s[15]+530742520)<<16|r>>>16)+n|0))+s[2]-995338651)<<23|t>>>9)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+s[0]-198630844)<<6|e>>>26)+t|0)|~r))+s[7]+1126891415)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+s[14]-1416354905)<<15|r>>>17)+n|0)|~e))+s[5]-57434055)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+s[12]+1700485571)<<6|e>>>26)+t|0)|~r))+s[3]-1894986606)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+s[10]-1051523)<<15|r>>>17)+n|0)|~e))+s[1]-2054922799)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+s[8]+1873313359)<<6|e>>>26)+t|0)|~r))+s[15]-30611744)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+s[6]-1560198380)<<15|r>>>17)+n|0)|~e))+s[13]+1309151649)<<21|t>>>11)+r|0,t=((t+=((n=((n+=(t^((e=((e+=(r^(t|~n))+s[4]-145523070)<<6|e>>>26)+t|0)|~r))+s[11]-1120210379)<<10|n>>>22)+e|0)^((r=((r+=(e^(n|~t))+s[2]+718787259)<<15|r>>>17)+n|0)|~e))+s[9]-343485551)<<21|t>>>11)+r|0,this.first?(this.h0=e+1732584193|0,this.h1=t-271733879|0,this.h2=r-1732584194|0,this.h3=n+271733878|0,this.first=!1):(this.h0=this.h0+e|0,this.h1=this.h1+t|0,this.h2=this.h2+r|0,this.h3=this.h3+n|0)},Md5.prototype.hex=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return HEX_CHARS[e>>4&15]+HEX_CHARS[15&e]+HEX_CHARS[e>>12&15]+HEX_CHARS[e>>8&15]+HEX_CHARS[e>>20&15]+HEX_CHARS[e>>16&15]+HEX_CHARS[e>>28&15]+HEX_CHARS[e>>24&15]+HEX_CHARS[t>>4&15]+HEX_CHARS[15&t]+HEX_CHARS[t>>12&15]+HEX_CHARS[t>>8&15]+HEX_CHARS[t>>20&15]+HEX_CHARS[t>>16&15]+HEX_CHARS[t>>28&15]+HEX_CHARS[t>>24&15]+HEX_CHARS[r>>4&15]+HEX_CHARS[15&r]+HEX_CHARS[r>>12&15]+HEX_CHARS[r>>8&15]+HEX_CHARS[r>>20&15]+HEX_CHARS[r>>16&15]+HEX_CHARS[r>>28&15]+HEX_CHARS[r>>24&15]+HEX_CHARS[n>>4&15]+HEX_CHARS[15&n]+HEX_CHARS[n>>12&15]+HEX_CHARS[n>>8&15]+HEX_CHARS[n>>20&15]+HEX_CHARS[n>>16&15]+HEX_CHARS[n>>28&15]+HEX_CHARS[n>>24&15]},Md5.prototype.toString=Md5.prototype.hex,Md5.prototype.digest=function(){this.finalize();var e=this.h0,t=this.h1,r=this.h2,n=this.h3;return[255&e,e>>8&255,e>>16&255,e>>24&255,255&t,t>>8&255,t>>16&255,t>>24&255,255&r,r>>8&255,r>>16&255,r>>24&255,255&n,n>>8&255,n>>16&255,n>>24&255]},Md5.prototype.array=Md5.prototype.digest,Md5.prototype.arrayBuffer=function(){this.finalize();var e=new ArrayBuffer(16),t=new Uint32Array(e);return t[0]=this.h0,t[1]=this.h1,t[2]=this.h2,t[3]=this.h3,e},Md5.prototype.buffer=Md5.prototype.arrayBuffer,Md5.prototype.base64=function(){for(var e,t,r,n="",i=this.array(),o=0;o<15;)e=i[o++],t=i[o++],r=i[o++],n+=BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[63&(e<<4|t>>>4)]+BASE64_ENCODE_CHAR[63&(t<<2|r>>>6)]+BASE64_ENCODE_CHAR[63&r];return e=i[o],n+(BASE64_ENCODE_CHAR[e>>>2]+BASE64_ENCODE_CHAR[e<<4&63]+"==")};var exports=createMethod();COMMON_JS?module.exports=exports:root.md5=exports})()})(md5$1);var md5=md5$1.exports;function buildOpenMessage(e){return["PLAY "+e+" WWAV/1.0","User-Agent: WWAV WEB-Client/1.0","CSeq: 1"].join(Delimiter)}function parseMessage(e){try{var t=e.split(Delimiter)[0].replace(new RegExp(PROTOCOL),"");return{code:+t.slice(1,4),content:t.slice(5)}}catch(e){return{}}}function buildAuthMessage(e,t,r){return void 0===r&&(r=""),["PLAY "+t+" WWAV/1.0","User-Agent: WWAV WEB-Client/1.0","CSeq: 2",buildAuthorization(parseKeyValue(e.split(Delimiter).filter((function(e){return-1!==e.indexOf("WWW-Authenticate: Digest")}))[0].replace("WWW-Authenticate: Digest","")),t,r)].join(Delimiter)}function buildAuthorization(e,t,r){var n=md5("admin:wwav:"+r),i=md5("PLAY:"+t),o="00000001",s=md5(n+":"+e.nonce+":00000001:"+o+":auth:"+i);return"Authorization: Digest "+['username="admin"','realm="wwav"','nonce="'+e.nonce+'"','uri="'+t+'"','algorithm="MD5"',"qop=auth","nc=00000001",'cnonce="'+o+'"','response="'+s+'"','opaque="'+e.opaque+'"'].join(", ")}function parseKeyValue(e){var t=e.trim().match(/\w+=(".*?"|[^",]+)(?=,|$)/g);if(!t)throw new Error("invalid str");return t.map((function(e){return e.split("=")})).reduce((function(e,t){var r=__read(t,2),n=r[0],i=r[1];return e[n]=i.replace(/^"(.+(?="$))"$/,"$1"),e}),{})}var WWAVIO=function(){function e(e,t){this._emitter=new ZnuEvent,this._ws=null,this._token="",this._binaryType="arraybuffer",this._isAuth=!1,this._token=null!=t?t:"",(this._ws=new WebSocket(e)).binaryType=this._binaryType,this._addEventListeners()}return Object.defineProperty(e.prototype,"ws",{get:function(){return this._ws},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"url",{get:function(){return this._ws?this._ws.url:""},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"binaryType",{get:function(){return this._ws?this._ws.binaryType:this._binaryType},set:function(e){this._binaryType=e,this._ws&&(this._ws.binaryType=e)},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"readyState",{get:function(){return this._ws?this._ws.readyState:WebSocket.CLOSED},enumerable:!1,configurable:!0}),e.prototype.send=function(e,t){this._ws&&(this._ws.readyState!==WebSocket.OPEN||t)&&this._ws.send(e)},e.prototype.close=function(e,t){var r;this._ws&&this._ws.readyState!==WebSocket.CLOSED&&(this._ws.close(e,t),this._removeListeners()),this._ws=null,null===(r=this._emitter)||void 0===r||r.destroy(),this._emitter=null,this._token=""},e.prototype.on=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.on(e,t)},e.prototype.off=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.off(e,t)},e.prototype._addEventListeners=function(){this._ws&&(this._ws.addEventListener("open",this._onOpen.bind(this)),this._ws.addEventListener("message",this._onMessage.bind(this)),this._ws.addEventListener("close",this._onClose.bind(this)),this._ws.addEventListener("error",this._onError.bind(this)))},e.prototype._removeListeners=function(){this._ws&&(this._ws.removeEventListener("open",this._onOpen.bind(this)),this._ws.removeEventListener("message",this._onMessage.bind(this)),this._ws.removeEventListener("close",this._onClose.bind(this)),this._ws.removeEventListener("error",this._onError.bind(this)))},e.prototype._onOpen=function(e){var t,r,n=buildOpenMessage(this.url);null===(t=this.ws)||void 0===t||t.send(n),null===(r=this._emitter)||void 0===r||r.emit("open",e)},e.prototype._onClose=function(e){var t;this._isAuth=!1,null===(t=this._emitter)||void 0===t||t.emit("close",e)},e.prototype._onMessage=function(e){var t;null===(t=this._emitter)||void 0===t||t.emit("message",e),"string"==typeof e.data?this._onStringMessage(e.data):this._onStreamMessage(e.data)},e.prototype._onError=function(e){var t;this._isAuth=!1,null===(t=this._emitter)||void 0===t||t.emit("error",e)},e.prototype._onStringMessage=function(e){var t,r,n,i,o=parseMessage(e),s=o.code,a=o.content;if(401===s){if(a===MessageErrors.AUTHORIZE_FAILED)return this._isAuth=!1,void(null===(t=this._emitter)||void 0===t||t.emit("authentication",{authentication:!1,code:s,message:a}));var u=buildAuthMessage(e,this.url,this._token);null===(r=this.ws)||void 0===r||r.send(u)}else 404===s?(this._isAuth=!1,null===(n=this._emitter)||void 0===n||n.emit("authentication",{authentication:!1,code:s,message:a})):200===s&&(this._isAuth=!0,null===(i=this._emitter)||void 0===i||i.emit("authentication",{authentication:!0,code:s,message:a}))},e.prototype._onStreamMessage=function(e){this._emitter&&this._isAuth&&this._emitter.emit("stream",e)},e.protocol=PROTOCOL,e}();return WWAVIO}))})(wwavIo_umd);var WWAVIO=wwavIo_umd.exports,PlayerEvents={TALK_ERROR:"talk_error",ERROR:"error",PLAY:"play",PAUSE:"pause",MEDIA_INFO:"media_info"},IOEvents={IO_AUTH_SUCCESS:"io_auth_success",IO_STREAM:"io_stream"},ErrorTypes={TALK_NETWORK_ERROR:"talk_network_error",NETWORK_ERROR:"network_error",MEDIA_ERROR:"media_error",OTHER_ERROR:"other_error"},ErrorDetails={NETWORK_AUTH_FAILED:"network_auth_failed",NETWORK_ON_CLOSE:"network_close",NETWORK_ON_ERROR:"network_error",MEDIA_INVALID_ELEMENT:"media_invalid_element"},__assign=function(){return __assign=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(e[i]=t[i]);return e},__assign.apply(this,arguments)},StreamType,AudioSampleDefaultRate,AudioSampleIncodeTypes,VideoSampleIncodeTypes,VideoSampleFrames,logger,warnLogger,errorLogger;function IsUint8Array(e){var t;return"Uint8Array"===(null===(t=null==e?void 0:e.constructor)||void 0===t?void 0:t.name)}function IsStream(e){return IsUint8Array(e)&&e.length>=4&&e[0]===e[1]&&e[0]===StreamType.W&&0===e[2]&&e[3]in StreamType}function IsVideoStream(e){return IsStream(e)&&e[3]===StreamType.V}function IsAudioStream(e){return IsStream(e)&&e[3]===StreamType.A}function GetStreamType(e){return IsStream(e)?StreamType[e[3]]:"Unknown"}function GetStreamBaseInfo(e){if(e.length<14)return!1;var t=new Uint8Array(e),r={timestamp:0,hasFrameSpread:!1,hasOtherSpread:!1,realDataIndex:0},n=t.slice(10,14),i=new DataView(n.buffer);r.timestamp=i.getUint32(0);var o=0;if(r.hasFrameSpread=!!(1&t[9]),o=r.hasFrameSpread?20:14,r.hasOtherSpread=!!(t[9]>>1&1),r.hasOtherSpread){var s=t[o];o++,r.otherSpreadBytes=t.slice(o,s),o+=s}return r.realDataIndex=o,r}function GetVideoStreamInfo(e){var t=new Uint8Array(e),r=GetStreamBaseInfo(t);if(!r)return!1;var n=__assign(__assign({},r),{frame:""}),i=t[9]>>4&15;if(n.frame=VideoSampleFrames[i]||"",n.hasFrameSpread){n.incodeType=VideoSampleIncodeTypes[t[14]]||t[14],n.frameRate=t[15];var o=new DataView(t.buffer);n.width=o.getUint16(9),n.height=o.getUint16(10)}return{info:__assign({},n),type:"video",data:t.slice(n.realDataIndex)}}function GetAudioStreamInfo(e){var t=new Uint8Array(e),r=GetStreamBaseInfo(t);if(!r)return!1;var n=__assign({},r);if(n.hasFrameSpread){n.incodeType=AudioSampleIncodeTypes[t[14]]||t[14];var i=t[19]+256*t[18]+256*t[17]*256;0===i&&(i=AudioSampleDefaultRate[n.incodeType]||16e3),n.sampleRate=i,n.channelNum=0===t[15]?1:t[15],n.bitDepth=0===t[16]?16:t[16]}return{info:n,type:"audio",data:t.slice(n.realDataIndex)}}function GetMediaStreamInfo(e){return IsVideoStream(e)?GetVideoStreamInfo(e):IsAudioStream(e)?GetAudioStreamInfo(e):null}function setLogger(){logger=console.log,warnLogger=console.warn,errorLogger=console.error}function log(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];logger&&logger.apply(void 0,__spread$1([e],t))}function warn(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];warnLogger&&warnLogger.apply(void 0,__spread$1([e],t))}function error(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];errorLogger&&errorLogger.apply(void 0,__spread$1([e],t))}!function(e){e[e.A=65]="A",e[e.V=86]="V",e[e.W=87]="W"}(StreamType||(StreamType={})),function(e){e[e.G711A=8e3]="G711A",e[e.G711U=8e3]="G711U",e[e.G722=16e3]="G722",e[e.G723=8e3]="G723",e[e.G726=8e3]="G726"}(AudioSampleDefaultRate||(AudioSampleDefaultRate={})),function(e){e[e.G711A=1]="G711A",e[e.G711U=2]="G711U",e[e["G722.1"]=3]="G722.1",e[e.G726=4]="G726",e[e.AAC=5]="AAC",e[e.PCM=6]="PCM",e[e.SVAC=7]="SVAC",e[e.ADPCM=8]="ADPCM"}(AudioSampleIncodeTypes||(AudioSampleIncodeTypes={})),function(e){e[e.MPEG4=1]="MPEG4",e[e.H264=2]="H264",e[e.H265=3]="H265"}(VideoSampleIncodeTypes||(VideoSampleIncodeTypes={})),function(e){e[e.I=1]="I",e[e.P=2]="P",e[e.B=3]="B"}(VideoSampleFrames||(VideoSampleFrames={}));var IOController=function(){function e(e,t){this.TAG="IOController",this._io=null,this._emitter=new ZnuEvent,this.bufferCacheV=[],this.analyticStateV=!1,this.bufferCacheA=[],this.analyticStateA=!1,log("WebSocket Connecting, url:",e),this._io=new WWAVIO(e,t),this._io.binaryType="arraybuffer",this._io.on("authentication",this._onIOAuth.bind(this)),this._io.on("stream",this._onIOStream.bind(this)),this._io.on("close",this._onIOClose.bind(this)),this._io.on("error",this._onIOError.bind(this))}return e.prototype._onIOAuth=function(e){var t,r,n;e.authentication?(log("WebSocket authentication success!"),null===(n=this._emitter)||void 0===n||n.emit(IOEvents.IO_AUTH_SUCCESS)):(error("WebSocket authentication error",e),null===(t=this._emitter)||void 0===t||t.emit(ErrorTypes.NETWORK_ERROR,ErrorDetails.NETWORK_AUTH_FAILED,e),null===(r=this._io)||void 0===r||r.close())},e.prototype.send=function(e,t){var r;null===(r=this._io)||void 0===r||r.send(e,t)},e.prototype._onIOStream=function(e){var t,r;if(e instanceof ArrayBuffer){var n=new Uint8Array(e),i=GetStreamType(n);"V"===i?null===(r=this._emitter)||void 0===r||r.emit(IOEvents.IO_STREAM,GetVideoStreamInfo(n)):"A"===i?((t=this.bufferCacheA).push.apply(t,__spread$1(n)),this.streamExtraction(this.bufferCacheA,this.analyticStateA)):log("receive unknown stream")}},e.prototype.streamExtraction=function(e,t,r){var n;if(void 0===r&&(r=!1),!t||r){for(t=!0;e.length>8&&e.length>=e[7];){var i=parseInt(e[6].toString(16).padStart(2,"0")+e[7].toString(16).padStart(2,"0"),16)+8,o=GetMediaStreamInfo(new Uint8Array(e.splice(0,i)));null===(n=this._emitter)||void 0===n||n.emit(IOEvents.IO_STREAM,o),this.streamExtraction(t,e,!0)}t=!1}},e.prototype._onIOClose=function(e){var t;null===(t=this._emitter)||void 0===t||t.emit(ErrorTypes.NETWORK_ERROR,ErrorDetails.NETWORK_ON_CLOSE,{code:e.code,message:e.message,event:e})},e.prototype._onIOError=function(e){var t;null===(t=this._emitter)||void 0===t||t.emit(ErrorTypes.NETWORK_ERROR,ErrorDetails.NETWORK_ON_ERROR,{code:e.code,message:e.message,event:e})},e.prototype.on=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.on(e,t)},e.prototype.off=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.off(e,t)},e.prototype.destroy=function(){var e;this._io&&this._io.close(),this._io=null,null===(e=this._emitter)||void 0===e||e.destroy(),this._emitter=null,log("Destroyed WebSocket")},e}(),BasePlayer=function(){function e(){this._emitter=new ZnuEvent}return e.prototype.on=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.on(e,t)},e.prototype.emit=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];null===(t=this._emitter)||void 0===t||t.emit.apply(t,__spread$1([e],r))},e.prototype._onPlay=function(e){this.emit("play",e)},e.prototype._onPause=function(e){this.emit("pause",e)},e.prototype._onSize=function(e){this.emit("size",e)},e.prototype._cleanEmitter=function(){var e;null===(e=this._emitter)||void 0===e||e.destroy(),this._emitter=null},e}(),jmuxer_min={exports:{}};!function(e,t){e.exports=function(e){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)}function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function n(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,n.key,n)}}function i(e,t,r){return t&&n(e.prototype,t),r&&n(e,r),e}function o(e,t,r){return t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(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}}),t&&u(e,t)}function a(e){return a=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)},a(e)}function u(e,t){return u=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e},u(e,t)}function l(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function c(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return l(e)}function h(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=a(e);if(t){var i=a(this).constructor;r=Reflect.construct(n,arguments,i)}else r=n.apply(this,arguments);return c(this,r)}}function f(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=[],s=!0,a=!1;try{for(r=r.call(e);!(s=(n=r.next()).done)&&(o.push(n.value),!t||o.length!==t);s=!0);}catch(e){a=!0,i=e}finally{try{s||null==r.return||r.return()}finally{if(a)throw i}}return o}}(e,t)||d(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 d(e,t){if(e){if("string"==typeof e)return p(e,t);var r=Object.prototype.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)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var r=0,n=new Array(t);r<t;r++)n[r]=e[r];return n}function y(e,t){var r="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!r){if(Array.isArray(e)||(r=d(e))||t&&e&&"number"==typeof e.length){r&&(e=r);var n=0,i=function(){};return{s:i,n:function(){return n>=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,s=!0,a=!1;return{s:function(){r=r.call(e)},n:function(){var e=r.next();return s=e.done,e},e:function(e){a=!0,o=e},f:function(){try{s||null==r.return||r.return()}finally{if(a)throw o}}}}var v,m;function g(e){if(v){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];v.apply(void 0,[e].concat(r))}}function b(e){if(m){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];m.apply(void 0,[e].concat(r))}}var _=function(){function e(t){r(this,e),this.payload=t,this.nri=(96&this.payload[0])>>5,this.ntype=31&this.payload[0],this.isvcl=1==this.ntype||5==this.ntype,this.stype="",this.isfmb=!1}return i(e,[{key:"toString",value:function(){return"".concat(e.type(this),": NRI: ").concat(this.getNri())}},{key:"getNri",value:function(){return this.nri}},{key:"type",value:function(){return this.ntype}},{key:"isKeyframe",value:function(){return this.ntype===e.IDR}},{key:"getPayload",value:function(){return this.payload}},{key:"getPayloadSize",value:function(){return this.payload.byteLength}},{key:"getSize",value:function(){return 4+this.getPayloadSize()}},{key:"getData",value:function(){var e=new Uint8Array(this.getSize());return new DataView(e.buffer).setUint32(0,this.getSize()-4),e.set(this.getPayload(),4),e}}],[{key:"NDR",get:function(){return 1}},{key:"IDR",get:function(){return 5}},{key:"SEI",get:function(){return 6}},{key:"SPS",get:function(){return 7}},{key:"PPS",get:function(){return 8}},{key:"AUD",get:function(){return 9}},{key:"TYPES",get:function(){var t;return o(t={},e.IDR,"IDR"),o(t,e.SEI,"SEI"),o(t,e.SPS,"SPS"),o(t,e.PPS,"PPS"),o(t,e.NDR,"NDR"),o(t,e.AUD,"AUD"),t}},{key:"type",value:function(t){return t.ntype in e.TYPES?e.TYPES[t.ntype]:"UNKNOWN"}}]),e}();function w(e,t){var r=new Uint8Array((0|e.byteLength)+(0|t.byteLength));return r.set(e,0),r.set(t,0|e.byteLength),r}var S,E=function(){function e(t){r(this,e),this.data=t,this.index=0,this.bitLength=8*t.byteLength}return i(e,[{key:"setData",value:function(e){this.data=e,this.index=0,this.bitLength=8*e.byteLength}},{key:"bitsAvailable",get:function(){return this.bitLength-this.index}},{key:"skipBits",value:function(e){if(this.bitsAvailable<e)return!1;this.index+=e}},{key:"readBits",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];return this.getBits(e,this.index,t)}},{key:"getBits",value:function(e,t){var r=!(arguments.length>2&&void 0!==arguments[2])||arguments[2];if(this.bitsAvailable<e)return 0;var n=t%8,i=this.data[t/8|0]&255>>>n,o=8-n;if(o>=e)return r&&(this.index+=e),i>>o-e;r&&(this.index+=o);var s=e-o;return i<<s|this.getBits(s,t+o,r)}},{key:"skipLZ",value:function(){var e;for(e=0;e<this.bitLength-this.index;++e)if(0!==this.getBits(1,this.index+e,!1))return this.index+=e,e;return e}},{key:"skipUEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"skipEG",value:function(){this.skipBits(1+this.skipLZ())}},{key:"readUEG",value:function(){var e=this.skipLZ();return this.readBits(e+1)-1}},{key:"readEG",value:function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}},{key:"readBoolean",value:function(){return 1===this.readBits(1)}},{key:"readUByte",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:1;return this.readBits(8*e)}},{key:"readUShort",value:function(){return this.readBits(16)}},{key:"readUInt",value:function(){return this.readBits(32)}}]),e}(),A=function(){function e(t){r(this,e),this.remuxer=t,this.track=t.mp4track}return i(e,[{key:"parseSPS",value:function(t){var r=e.readSPS(new Uint8Array(t));this.track.fps=r.fps,this.track.width=r.width,this.track.height=r.height,this.track.sps=[new Uint8Array(t)],this.track.codec="avc1.";for(var n=new DataView(t.buffer,t.byteOffset+1,4),i=0;i<3;++i){var o=n.getUint8(i).toString(16);o.length<2&&(o="0"+o),this.track.codec+=o}}},{key:"parsePPS",value:function(e){this.track.pps=[new Uint8Array(e)]}},{key:"parseNAL",value:function(e){if(!e)return!1;var t=!1;switch(e.type()){case _.IDR:case _.NDR:t=!0;break;case _.PPS:this.track.pps||(this.parsePPS(e.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),t=!0;break;case _.SPS:this.track.sps||(this.parseSPS(e.getPayload()),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0)),t=!0;break;case _.AUD:g("AUD - ignoing");break;case _.SEI:g("SEI - ignoing")}return t}}],[{key:"extractNALu",value:function(e){for(var t,r,n=0,i=e.byteLength,o=0,s=[],a=0;n<i;)switch(t=e[n++],o){case 0:0===t&&(o=1);break;case 1:o=0===t?2:0;break;case 2:case 3:0===t?o=3:1===t&&n<i?(a!=n-o-1&&s.push(e.subarray(a,n-o-1)),a=n,o=0):o=0}return a<i&&(r=e.subarray(a,i)),[s,r]}},{key:"skipScalingList",value:function(e,t){for(var r=8,n=8,i=0;i<t;i++)0!==n&&(n=(r+e.readEG()+256)%256),r=0===n?r:n}},{key:"readSPS",value:function(t){var r,n,i,o,s,a,u=new E(t),l=0,c=0,h=0,f=0,d=1,p=0;u.readUByte();for(var y=[],v=t.byteLength,m=1;m<v;m++)m+2<v&&3===u.readBits(24,!1)?(y.push(u.readBits(8)),y.push(u.readBits(8)),m+=2,u.readBits(8)):y.push(u.readBits(8));if(u.setData(new Uint8Array(y)),r=u.readUByte(),u.readBits(5),u.skipBits(3),u.readUByte(),u.skipUEG(),100===r||110===r||122===r||244===r||44===r||83===r||86===r||118===r||128===r){var g=u.readUEG();if(3===g&&u.skipBits(1),u.skipUEG(),u.skipUEG(),u.skipBits(1),u.readBoolean()){a=3!==g?8:12;for(var b=0;b<a;++b)u.readBoolean()&&(b<6?e.skipScalingList(u,16):e.skipScalingList(u,64))}}u.skipUEG();var _=u.readUEG();if(0===_)u.readUEG();else if(1===_){u.skipBits(1),u.skipEG(),u.skipEG(),n=u.readUEG();for(var w=0;w<n;++w)u.skipEG()}if(u.skipUEG(),u.skipBits(1),i=u.readUEG(),o=u.readUEG(),0===(s=u.readBits(1))&&u.skipBits(1),u.skipBits(1),u.readBoolean()&&(l=u.readUEG(),c=u.readUEG(),h=u.readUEG(),f=u.readUEG()),u.readBoolean()){if(u.readBoolean()){var S;switch(u.readUByte()){case 1:S=[1,1];break;case 2:S=[12,11];break;case 3:S=[10,11];break;case 4:S=[16,11];break;case 5:S=[40,33];break;case 6:S=[24,11];break;case 7:S=[20,11];break;case 8:S=[32,11];break;case 9:S=[80,33];break;case 10:S=[18,11];break;case 11:S=[15,11];break;case 12:S=[64,33];break;case 13:S=[160,99];break;case 14:S=[4,3];break;case 15:S=[3,2];break;case 16:S=[2,1];break;case 255:S=[u.readUByte()<<8|u.readUByte(),u.readUByte()<<8|u.readUByte()]}S&&S[0]>0&&S[1]>0&&(d=S[0]/S[1])}if(u.readBoolean()&&u.skipBits(1),u.readBoolean()&&(u.skipBits(4),u.readBoolean()&&u.skipBits(24)),u.readBoolean()&&(u.skipUEG(),u.skipUEG()),u.readBoolean()){var A=u.readUInt(),k=u.readUInt();u.readBoolean()&&(p=k/(2*A))}}return{fps:p>0?p:void 0,width:Math.ceil((16*(i+1)-2*l-2*c)*d),height:(2-s)*(o+1)*16-(s?2:4)*(h+f)}}},{key:"parseHeader",value:function(e){var t=new E(e.getPayload());t.readUByte(),e.isfmb=0===t.readUEG(),e.stype=t.readUEG()}}]),e}(),k=function(){function e(t){r(this,e),this.remuxer=t,this.track=t.mp4track}return i(e,[{key:"setAACConfig",value:function(){var t,r,n,i=new Uint8Array(2),o=e.getAACHeaderData;o&&(t=1+((192&o[2])>>>6),r=(60&o[2])>>>2,n=(1&o[2])<<2,n|=(192&o[3])>>>6,i[0]=t<<3,i[0]|=(14&r)>>1,i[1]|=(1&r)<<7,i[1]|=n<<3,this.track.codec="mp4a.40."+t,this.track.channelCount=n,this.track.config=i,this.remuxer.readyToDecode=!0)}}],[{key:"samplingRateMap",get:function(){return[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350]}},{key:"getAACHeaderData",get:function(){return S}},{key:"getHeaderLength",value:function(e){return 1&e[1]?7:9}},{key:"getFrameLength",value:function(e){return(3&e[3])<<11|e[4]<<3|(224&e[5])>>>5}},{key:"isAACPattern",value:function(e){return!(255!==e[0]||240&~e[1]||6&e[1])}},{key:"extractAAC",value:function(t){var r,n,i=0,o=t.byteLength,s=[];if(!e.isAACPattern(t))return b("Invalid ADTS audio format"),s;for(r=e.getHeaderLength(t),S||(S=t.subarray(0,r));i<o;)n=e.getFrameLength(t),s.push(t.subarray(r,n)),t=t.slice(n),i+=n;return s}}]),e}(),x=function(){function e(t){r(this,e),this.listener={},this.type=""|t}return i(e,[{key:"on",value:function(e,t){return this.listener[e]||(this.listener[e]=[]),this.listener[e].push(t),!0}},{key:"off",value:function(e,t){if(this.listener[e]){var r=this.listener[e].indexOf(t);return r>-1&&this.listener[e].splice(r,1),!0}return!1}},{key:"offAll",value:function(){this.listener={}}},{key:"dispatch",value:function(e,t){return!!this.listener[e]&&(this.listener[e].map((function(e){e.apply(null,[t])})),!0)}}]),e}(),R=function(){function e(){r(this,e)}return i(e,null,[{key:"init",value:function(){var t;for(t in e.types={avc1:[],avcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],mvex:[],mvhd:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]},e.types)e.types.hasOwnProperty(t)&&(e.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var r=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),n=new Uint8Array([0,0,0,0,0,0,0,0,115,111,117,110,0,0,0,0,0,0,0,0,0,0,0,0,83,111,117,110,100,72,97,110,100,108,101,114,0]);e.HDLR_TYPES={video:r,audio:n};var i=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),o=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=o,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var s=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),u=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,s,u,s,a),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,i))}},{key:"box",value:function(e){for(var t=arguments.length,r=new Array(t>1?t-1:0),n=1;n<t;n++)r[n-1]=arguments[n];for(var i,o=8,s=r.length,a=s;s--;)o+=r[s].byteLength;for((i=new Uint8Array(o))[0]=o>>24&255,i[1]=o>>16&255,i[2]=o>>8&255,i[3]=255&o,i.set(e,4),s=0,o=8;s<a;++s)i.set(r[s],o),o+=r[s].byteLength;return i}},{key:"hdlr",value:function(t){return e.box(e.types.hdlr,e.HDLR_TYPES[t])}},{key:"mdat",value:function(t){return e.box(e.types.mdat,t)}},{key:"mdhd",value:function(t,r){return e.box(e.types.mdhd,new Uint8Array([0,0,0,0,0,0,0,2,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24,r>>16&255,r>>8&255,255&r,85,196,0,0]))}},{key:"mdia",value:function(t){return e.box(e.types.mdia,e.mdhd(t.timescale,t.duration),e.hdlr(t.type),e.minf(t))}},{key:"mfhd",value:function(t){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}},{key:"minf",value:function(t){return"audio"===t.type?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(t)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(t))}},{key:"moof",value:function(t,r,n){return e.box(e.types.moof,e.mfhd(t),e.traf(n,r))}},{key:"moov",value:function(t,r,n){for(var i=t.length,o=[];i--;)o[i]=e.trak(t[i]);return e.box.apply(null,[e.types.moov,e.mvhd(n,r)].concat(o).concat(e.mvex(t)))}},{key:"mvex",value:function(t){for(var r=t.length,n=[];r--;)n[r]=e.trex(t[r]);return e.box.apply(null,[e.types.mvex].concat(n))}},{key:"mvhd",value:function(t,r){var n=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,2,t>>24&255,t>>16&255,t>>8&255,255&t,r>>24&255,r>>16&255,r>>8&255,255&r,0,1,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,255,255,255,255]);return e.box(e.types.mvhd,n)}},{key:"sdtp",value:function(t){var r,n,i=t.samples||[],o=new Uint8Array(4+i.length);for(n=0;n<i.length;n++)r=i[n].flags,o[n+4]=r.dependsOn<<4|r.isDependedOn<<2|r.hasRedundancy;return e.box(e.types.sdtp,o)}},{key:"stbl",value:function(t){return e.box(e.types.stbl,e.stsd(t),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))}},{key:"avc1",value:function(t){var r,n,i,o=[],s=[];for(r=0;r<t.sps.length;r++)i=(n=t.sps[r]).byteLength,o.push(i>>>8&255),o.push(255&i),o=o.concat(Array.prototype.slice.call(n));for(r=0;r<t.pps.length;r++)i=(n=t.pps[r]).byteLength,s.push(i>>>8&255),s.push(255&i),s=s.concat(Array.prototype.slice.call(n));var a=e.box(e.types.avcC,new Uint8Array([1,o[3],o[4],o[5],255,224|t.sps.length].concat(o).concat([t.pps.length]).concat(s))),u=t.width,l=t.height;return e.box(e.types.avc1,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,u>>8&255,255&u,l>>8&255,255&l,0,72,0,0,0,72,0,0,0,0,0,0,0,1,18,98,105,110,101,108,112,114,111,46,114,117,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,24,17,17]),a,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}},{key:"esds",value:function(e){var t=e.config.byteLength,r=new Uint8Array(26+t+3);return r.set([0,0,0,0,3,23+t,0,1,0,4,15+t,64,21,0,0,0,0,0,0,0,0,0,0,0,5,t]),r.set(e.config,26),r.set([6,1,2],26+t),r}},{key:"mp4a",value:function(t){var r=t.audiosamplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,t.channelCount,0,16,0,0,0,0,r>>8&255,255&r,0,0]),e.box(e.types.esds,e.esds(t)))}},{key:"stsd",value:function(t){return"audio"===t.type?e.box(e.types.stsd,e.STSD,e.mp4a(t)):e.box(e.types.stsd,e.STSD,e.avc1(t))}},{key:"tkhd",value:function(t){var r=t.id,n=t.duration,i=t.width,o=t.height,s=t.volume;return e.box(e.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,r>>24&255,r>>16&255,r>>8&255,255&r,0,0,0,0,n>>24,n>>16&255,n>>8&255,255&n,0,0,0,0,0,0,0,0,0,0,0,0,255&s,s%1*10&255,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,64,0,0,0,i>>8&255,255&i,0,0,o>>8&255,255&o,0,0]))}},{key:"traf",value:function(t,r){var n=e.sdtp(t),i=t.id;return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i])),e.box(e.types.tfdt,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),e.trun(t,n.length+16+16+8+16+8+8),n)}},{key:"trak",value:function(t){return t.duration=t.duration||4294967295,e.box(e.types.trak,e.tkhd(t),e.mdia(t))}},{key:"trex",value:function(t){var r=t.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}},{key:"trun",value:function(t,r){var n,i,o,s,a,u,l=t.samples||[],c=l.length,h=12+16*c,f=new Uint8Array(h);for(r+=8+h,f.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,r>>>24&255,r>>>16&255,r>>>8&255,255&r],0),n=0;n<c;n++)o=(i=l[n]).duration,s=i.size,a=i.flags,u=i.cts,f.set([o>>>24&255,o>>>16&255,o>>>8&255,255&o,s>>>24&255,s>>>16&255,s>>>8&255,255&s,a.isLeading<<2|a.dependsOn,a.isDependedOn<<6|a.hasRedundancy<<4|a.paddingValue<<1|a.isNonSync,61440&a.degradPrio,15&a.degradPrio,u>>>24&255,u>>>16&255,u>>>8&255,255&u],12+16*n);return e.box(e.types.trun,f)}},{key:"initSegment",value:function(t,r,n){e.types||e.init();var i,o=e.moov(t,r,n);return(i=new Uint8Array(e.FTYP.byteLength+o.byteLength)).set(e.FTYP),i.set(o,e.FTYP.byteLength),i}}]),e}(),T=1,C=function(){function e(){r(this,e)}return i(e,[{key:"flush",value:function(){this.mp4track.len=0,this.mp4track.samples=[]}},{key:"isReady",value:function(){return!(!this.readyToDecode||!this.samples.length)||null}}],[{key:"getTrackID",value:function(){return T++}}]),e}(),M=function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),(i=t.call(this)).readyToDecode=!1,i.nextDts=0,i.dts=0,i.mp4track={id:C.getTrackID(),type:"audio",channelCount:0,len:0,fragmented:!0,timescale:e,duration:e,samples:[],config:"",codec:""},i.samples=[],i.aac=new k(l(i)),i}return i(n,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.codec="",this.mp4track.channelCount="",this.mp4track.config="",this.mp4track.timescale=this.timescale,this.nextDts=0,this.dts=0}},{key:"remux",value:function(e){if(e.length>0)for(var t=0;t<e.length;t++){var r=e[t],n=r.units,i=n.byteLength;this.samples.push({units:n,size:i,duration:r.duration}),this.mp4track.len+=i,this.readyToDecode||this.aac.setAACConfig()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var e,t,r=new Uint8Array(this.mp4track.len),n=0,i=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var o=this.samples.shift();o.units,(t=o.duration)<=0?(g("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(t)),this.mp4track.len-=o.size):(this.nextDts+=t,e={size:o.size,duration:t,cts:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},r.set(o.units,n),n+=o.size,i.push(e))}return i.length?new Uint8Array(r.buffer,0,this.mp4track.len):null}}]),n}(C),P=function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),(i=t.call(this)).readyToDecode=!1,i.nextDts=0,i.dts=0,i.mp4track={id:C.getTrackID(),type:"video",len:0,fragmented:!0,sps:"",pps:"",fps:30,width:0,height:0,timescale:e,duration:e,samples:[]},i.samples=[],i.h264=new A(l(i)),i}return i(n,[{key:"resetTrack",value:function(){this.readyToDecode=!1,this.mp4track.sps="",this.mp4track.pps="",this.nextDts=0,this.dts=0}},{key:"remux",value:function(e){var t,r=y(e);try{for(r.s();!(t=r.n()).done;){var n,i=t.value,o=[],s=0,a=y(i.units);try{for(a.s();!(n=a.n()).done;){var u=n.value;this.h264.parseNAL(u)&&(o.push(u),s+=u.getSize())}}catch(e){a.e(e)}finally{a.f()}o.length>0&&this.readyToDecode&&(this.mp4track.len+=s,this.samples.push({units:o,size:s,keyFrame:i.keyFrame,duration:i.duration}))}}catch(e){r.e(e)}finally{r.f()}}},{key:"getPayload",value:function(){if(!this.isReady())return null;var e,t,r=new Uint8Array(this.mp4track.len),n=0,i=this.mp4track.samples;for(this.dts=this.nextDts;this.samples.length;){var o=this.samples.shift(),s=o.units;if((t=o.duration)<=0)g("remuxer: invalid sample duration at DTS: ".concat(this.nextDts," :").concat(t)),this.mp4track.len-=o.size;else{this.nextDts+=t,e={size:o.size,duration:t,cts:0,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,isNonSync:o.keyFrame?0:1,dependsOn:o.keyFrame?2:1}};var a,u=y(s);try{for(u.s();!(a=u.n()).done;){var l=a.value;r.set(l.getData(),n),n+=l.getSize()}}catch(e){u.e(e)}finally{u.f()}i.push(e)}}return i.length?new Uint8Array(r.buffer,0,this.mp4track.len):null}}]),n}(C),L=function(e){s(n,e);var t=h(n);function n(e){var i;return r(this,n),(i=t.call(this,"remuxer")).initialized=!1,i.trackTypes=[],i.tracks={},i.seq=1,i.env=e,i.timescale=1e3,i.mediaDuration=0,i}return i(n,[{key:"addTrack",value:function(e){"video"!==e&&"both"!==e||(this.tracks.video=new P(this.timescale),this.trackTypes.push("video")),"audio"!==e&&"both"!==e||(this.tracks.audio=new M(this.timescale),this.trackTypes.push("audio"))}},{key:"reset",value:function(){var e,t=y(this.trackTypes);try{for(t.s();!(e=t.n()).done;){var r=e.value;this.tracks[r].resetTrack()}}catch(e){t.e(e)}finally{t.f()}this.initialized=!1}},{key:"destroy",value:function(){this.tracks={},this.offAll()}},{key:"flush",value:function(){if(this.initialized){var e,t=y(this.trackTypes);try{for(t.s();!(e=t.n()).done;){var r=e.value,n=this.tracks[r],i=n.getPayload();if(i&&i.byteLength){var o={type:r,payload:w(R.moof(this.seq,n.dts,n.mp4track),R.mdat(i)),dts:n.dts};"video"===r&&(o.fps=n.mp4track.fps),this.dispatch("buffer",o);var s=(a=n.dts/this.timescale,u=void 0,l=void 0,c=void 0,h=void 0,h="",u=Math.floor(a),(l=parseInt(u/3600,10)%24)>0&&(h+=(l<10?"0"+l:l)+":"),h+=((c=parseInt(u/60,10)%60)<10?"0"+c:c)+":"+((u=u<0?0:u%60)<10?"0"+u:u));g("put segment (".concat(r,"): dts: ").concat(n.dts," frames: ").concat(n.mp4track.samples.length," second: ").concat(s)),n.flush(),this.seq++}}}catch(e){t.e(e)}finally{t.f()}}else this.isReady()&&(this.dispatch("ready"),this.initSegment(),this.initialized=!0,this.flush());var a,u,l,c,h}},{key:"initSegment",value:function(){var e,t=[],r=y(this.trackTypes);try{for(r.s();!(e=r.n()).done;){var n=e.value,i=this.tracks[n];if("browser"==this.env){var o={type:n,payload:R.initSegment([i.mp4track],this.mediaDuration,this.timescale)};this.dispatch("buffer",o)}else t.push(i.mp4track)}}catch(e){r.e(e)}finally{r.f()}if("node"==this.env){var s={type:"all",payload:R.initSegment(t,this.mediaDuration,this.timescale)};this.dispatch("buffer",s)}g("Initial segment generated.")}},{key:"isReady",value:function(){var e,t=y(this.trackTypes);try{for(t.s();!(e=t.n()).done;){var r=e.value;if(!this.tracks[r].readyToDecode||!this.tracks[r].samples.length)return!1}}catch(e){t.e(e)}finally{t.f()}return!0}},{key:"remux",value:function(e){var t,r=y(this.trackTypes);try{for(r.s();!(t=r.n()).done;){var n=t.value,i=e[n];"audio"===n&&this.tracks.video&&!this.tracks.video.readyToDecode||i.length>0&&this.tracks[n].remux(i)}}catch(e){r.e(e)}finally{r.f()}this.flush()}}]),n}(x),O=function(e){s(n,e);var t=h(n);function n(e,i){var o;return r(this,n),(o=t.call(this,"buffer")).type=i,o.queue=new Uint8Array,o.cleaning=!1,o.pendingCleaning=0,o.cleanOffset=30,o.cleanRanges=[],o.sourceBuffer=e,o.sourceBuffer.addEventListener("updateend",(function(){o.pendingCleaning>0&&(o.initCleanup(o.pendingCleaning),o.pendingCleaning=0),o.cleaning=!1,o.cleanRanges.length&&o.doCleanup()})),o.sourceBuffer.addEventListener("error",(function(){o.dispatch("error",{type:o.type,name:"buffer",error:"buffer error"})})),o}return i(n,[{key:"destroy",value:function(){this.queue=null,this.sourceBuffer=null,this.offAll()}},{key:"doCleanup",value:function(){if(this.cleanRanges.length){var e=this.cleanRanges.shift();g("".concat(this.type," remove range [").concat(e[0]," - ").concat(e[1],")")),this.cleaning=!0,this.sourceBuffer.remove(e[0],e[1])}else this.cleaning=!1}},{key:"initCleanup",value:function(e){try{if(this.sourceBuffer.updating)return void(this.pendingCleaning=e);if(this.sourceBuffer.buffered&&this.sourceBuffer.buffered.length&&!this.cleaning){for(var t=0;t<this.sourceBuffer.buffered.length;++t){var r=this.sourceBuffer.buffered.start(t),n=this.sourceBuffer.buffered.end(t);e-r>this.cleanOffset&&r<(n=e-this.cleanOffset)&&this.cleanRanges.push([r,n])}this.doCleanup()}}catch(e){b("Error occured while cleaning ".concat(this.type," buffer - ").concat(e.name,": ").concat(e.message))}}},{key:"doAppend",value:function(){if(this.queue.length&&this.sourceBuffer&&!this.sourceBuffer.updating)try{this.sourceBuffer.appendBuffer(this.queue),this.queue=new Uint8Array}catch(t){var e="unexpectedError";"QuotaExceededError"===t.name?(g("".concat(this.type," buffer quota full")),e="QuotaExceeded"):(b("Error occured while appending ".concat(this.type," buffer - ").concat(t.name,": ").concat(t.message)),e="InvalidStateError"),this.dispatch("error",{type:this.type,name:e,error:"buffer error"})}}},{key:"feed",value:function(e){this.queue=w(this.queue,e)}}]),n}(x);return function(n){s(a,n);var o=h(a);function a(e){var n;return r(this,a),(n=o.call(this,"jmuxer")).isReset=!1,n.options=Object.assign({},{node:"",mode:"both",flushingTime:500,maxDelay:500,clearBuffer:!0,fps:30,readFpsFromTrack:!1,debug:!1,onReady:function(){},onError:function(){}},e),n.env="object"===("undefined"==typeof process?"undefined":t(process))&&"undefined"==typeof window?"node":"browser",n.options.debug&&(v=console.log,m=console.error),n.options.fps||(n.options.fps=30),n.frameDuration=1e3/n.options.fps|0,n.remuxController=new L(n.env),n.remuxController.addTrack(n.options.mode),n.initData(),n.remuxController.on("buffer",n.onBuffer.bind(l(n))),"browser"==n.env&&(n.remuxController.on("ready",n.createBuffer.bind(l(n))),n.initBrowser()),n}return i(a,[{key:"initData",value:function(){this.lastCleaningTime=Date.now(),this.kfPosition=[],this.kfCounter=0,this.pendingUnits={},this.remainingData=new Uint8Array,this.startInterval()}},{key:"initBrowser",value:function(){"string"==typeof this.options.node&&""==this.options.node&&b("no video element were found to render, provide a valid video element"),this.node="string"==typeof this.options.node?document.getElementById(this.options.node):this.options.node,this.mseReady=!1,this.setupMSE()}},{key:"createStream",value:function(){var t=this.feed.bind(this),r=this.destroy.bind(this);return this.stream=new e.Duplex({writableObjectMode:!0,read:function(e){},write:function(e,r,n){t(e),n()},final:function(e){r(),e()}}),this.stream}},{key:"setupMSE",value:function(){if(window.MediaSource=window.MediaSource||window.WebKitMediaSource,!window.MediaSource)throw"Oops! Browser does not support media source extension.";this.isMSESupported=!!window.MediaSource,this.mediaSource=new MediaSource,this.url=URL.createObjectURL(this.mediaSource),this.node.src=this.url,this.mseEnded=!1,this.mediaSource.addEventListener("sourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("sourceclose",this.onMSEClose.bind(this)),this.mediaSource.addEventListener("webkitsourceopen",this.onMSEOpen.bind(this)),this.mediaSource.addEventListener("webkitsourceclose",this.onMSEClose.bind(this))}},{key:"endMSE",value:function(){if(!this.mseEnded)try{this.mseEnded=!0,this.mediaSource.endOfStream()}catch(e){b("mediasource is not available to end")}}},{key:"feed",value:function(e){var t,r,n,i=!1,o={video:[],audio:[]};if(e&&this.remuxController){if(n=e.duration?parseInt(e.duration):0,e.video){e.video=w(this.remainingData,e.video);var s=f(A.extractNALu(e.video),2);if(t=s[0],r=s[1],this.remainingData=r||new Uint8Array,!(t.length>0))return void b("Failed to extract any NAL units from video data:",r);o.video=this.getVideoFrames(t,n),i=!0}if(e.audio){if(!((t=k.extractAAC(e.audio)).length>0))return void b("Failed to extract audio data from:",e.audio);o.audio=this.getAudioFrames(t,n),i=!0}i?this.remuxController.remux(o):b("Input object must have video and/or audio property. Make sure it is a valid typed array")}}},{key:"getVideoFrames",value:function(e,t){var r,n=this,i=[],o=[],s=0,a=!1,u=!1;this.pendingUnits.units&&(i=this.pendingUnits.units,u=this.pendingUnits.vcl,a=this.pendingUnits.keyFrame,this.pendingUnits={});var l,c=y(e);try{for(c.s();!(l=c.n()).done;){var h=l.value,f=new _(h);f.type()!==_.IDR&&f.type()!==_.NDR||A.parseHeader(f),i.length&&u&&(f.isfmb||!f.isvcl)&&(o.push({units:i,keyFrame:a}),i=[],a=!1,u=!1),i.push(f),a=a||f.isKeyframe(),u=u||f.isvcl}}catch(e){c.e(e)}finally{c.f()}if(i.length)if(t)if(u)o.push({units:i,keyFrame:a});else{var d=o.length-1;d>=0&&(o[d].units=o[d].units.concat(i))}else this.pendingUnits={units:i,keyFrame:a,vcl:u};return r=t?t/o.length|0:this.frameDuration,s=t?t-r*o.length:0,o.map((function(e){e.duration=r,s>0&&(e.duration++,s--),n.kfCounter++,e.keyFrame&&n.options.clearBuffer&&n.kfPosition.push(n.kfCounter*r/1e3)})),g("jmuxer: No. of frames of the last chunk: ".concat(o.length)),o}},{key:"getAudioFrames",value:function(e,t){var r,n,i=[],o=0,s=y(e);try{for(s.s();!(n=s.n()).done;){var a=n.value;i.push({units:a})}}catch(e){s.e(e)}finally{s.f()}return r=t?t/i.length|0:this.frameDuration,o=t?t-r*i.length:0,i.map((function(e){e.duration=r,o>0&&(e.duration++,o--)})),i}},{key:"destroy",value:function(){if(this.stopInterval(),this.stream&&(this.remuxController.flush(),this.stream.push(null),this.stream=null),this.remuxController&&(this.remuxController.destroy(),this.remuxController=null),this.bufferControllers){for(var e in this.bufferControllers)this.bufferControllers[e].destroy();this.bufferControllers=null,this.endMSE()}this.node=!1,this.mseReady=!1,this.videoStarted=!1,this.mediaSource=null}},{key:"reset",value:function(){if(this.stopInterval(),this.isReset=!0,this.node.pause(),this.remuxController&&this.remuxController.reset(),this.bufferControllers){for(var e in this.bufferControllers)this.bufferControllers[e].destroy();this.bufferControllers=null,this.endMSE()}this.initData(),"browser"==this.env&&this.initBrowser(),g("JMuxer was reset")}},{key:"createBuffer",value:function(){if(this.mseReady&&this.remuxController&&this.remuxController.isReady()&&!this.bufferControllers)for(var e in this.bufferControllers={},this.remuxController.tracks){var t=this.remuxController.tracks[e];if(!a.isSupported("".concat(e,'/mp4; codecs="').concat(t.mp4track.codec,'"')))return b("Browser does not support codec"),!1;var r=this.mediaSource.addSourceBuffer("".concat(e,'/mp4; codecs="').concat(t.mp4track.codec,'"'));this.bufferControllers[e]=new O(r,e),this.bufferControllers[e].on("error",this.onBufferError.bind(this))}}},{key:"startInterval",value:function(){var e=this;this.interval=setInterval((function(){e.options.flushingTime?e.applyAndClearBuffer():e.bufferControllers&&e.cancelDelay()}),this.options.flushingTime||1e3)}},{key:"stopInterval",value:function(){this.interval&&clearInterval(this.interval)}},{key:"cancelDelay",value:function(){if(this.node.buffered&&this.node.buffered.length>0&&!this.node.seeking){var e=this.node.buffered.end(0);e-this.node.currentTime>this.options.maxDelay/1e3&&(console.log("delay"),this.node.currentTime=e-.001)}}},{key:"releaseBuffer",value:function(){for(var e in this.bufferControllers)this.bufferControllers[e].doAppend()}},{key:"applyAndClearBuffer",value:function(){this.bufferControllers&&(this.releaseBuffer(),this.clearBuffer())}},{key:"getSafeClearOffsetOfBuffer",value:function(e){for(var t,r="audio"===this.options.mode&&e||0,n=0;n<this.kfPosition.length&&!(this.kfPosition[n]>=e);n++)t=this.kfPosition[n];return t&&(this.kfPosition=this.kfPosition.filter((function(e){return e<t&&(r=e),e>=t}))),r}},{key:"clearBuffer",value:function(){if(this.options.clearBuffer&&Date.now()-this.lastCleaningTime>1e4){for(var e in this.bufferControllers){var t=this.getSafeClearOffsetOfBuffer(this.node.currentTime);this.bufferControllers[e].initCleanup(t)}this.lastCleaningTime=Date.now()}}},{key:"onBuffer",value:function(e){this.options.readFpsFromTrack&&void 0!==e.fps&&this.options.fps!=e.fps&&(this.options.fps=e.fps,this.frameDuration=Math.ceil(1e3/e.fps),g("JMuxer changed FPS to ".concat(e.fps," from track data"))),"browser"==this.env?this.bufferControllers&&this.bufferControllers[e.type]&&this.bufferControllers[e.type].feed(e.payload):this.stream&&this.stream.push(e.payload),0===this.options.flushingTime&&this.applyAndClearBuffer()}},{key:"onMSEOpen",value:function(){this.mseReady=!0,URL.revokeObjectURL(this.url),"function"==typeof this.options.onReady&&this.options.onReady.call(null,this.isReset)}},{key:"onMSEClose",value:function(){this.mseReady=!1,this.videoStarted=!1}},{key:"onBufferError",value:function(e){if("QuotaExceeded"==e.name)return g("JMuxer cleaning ".concat(e.type," buffer due to QuotaExceeded error")),void this.bufferControllers[e.type].initCleanup(this.node.currentTime);"InvalidStateError"==e.name?(g("JMuxer is reseting due to InvalidStateError"),this.reset()):this.endMSE(),"function"==typeof this.options.onError&&this.options.onError.call(null,e)}}],[{key:"isSupported",value:function(e){return window.MediaSource&&window.MediaSource.isTypeSupported(e)}}]),a}(x)}(require$$0__default.default)}(jmuxer_min);var JMuxer=jmuxer_min.exports,H264Player=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this)||this;n._player=null,n._videoMedia=null,n._videoWidth=0,n._videoHeight=0,n._lastVideoTimestamp=0,n._lastVideoDuration=40,n._lastAudioTimestamp=0,n._lastAudioDuration=120,n._videoMedia=t;var i=r.mode,o=void 0===i?"video":i,s=r.flushingTime,a=void 0===s?500:s,u=r.maxDelay,l=void 0===u?500:u;return n._player=new JMuxer({node:t,mode:o,flushingTime:a,maxDelay:l,clearBuffer:!0,debug:!!r.debug}),t.addEventListener("play",n._onPlay.bind(n)),t.addEventListener("pause",n._onPause.bind(n)),t.addEventListener("progress",n._onProgress.bind(n)),log("Created H264 Player"),n}return __extends(t,e),t.prototype.feed=function(e,t,r){this._player&&("video"===r?this._player.feed({video:e,duration:this._getVideoDuration(t)}):"audio"===r&&this._player.feed({audio:e,duration:this._getAudioDuration(t)}))},t.prototype.play=function(){this._videoMedia&&this._videoMedia.play()},t.prototype.pause=function(){this._videoMedia&&this._videoMedia.pause()},t.prototype.destroy=function(){this._cleanEmitter(),this._player&&this._player.destroy(),this._player=null,this._videoMedia=null,this._videoWidth=0,this._videoHeight=0,this._lastAudioDuration=0,this._lastAudioTimestamp=0,this._lastVideoDuration=40,this._lastVideoTimestamp=0,log("Destroyed H264 Player")},t.prototype._onProgress=function(){if(this._videoMedia){var e=this._videoMedia,t=e.videoWidth,r=e.videoHeight;this._videoWidth===t&&this._videoHeight===r||(this._videoWidth=t,this._videoHeight=r,this.emit("size",{width:t,height:r}))}},t.prototype._getVideoDuration=function(e){var t=e-this._lastVideoTimestamp;return this._lastVideoTimestamp=e,t>1e3?t=0:t<0?t=this._lastVideoDuration:this._lastVideoDuration=t,t},t.prototype._getAudioDuration=function(e){var t=e-this._lastAudioTimestamp;return this._lastAudioTimestamp=e,t>1e3?t=0:t<0?t=this._lastAudioDuration:this._lastAudioDuration=t,t},t}(BasePlayer);
|
|
59
|
+
/*!
|
|
60
|
+
* h265-player
|
|
61
|
+
* (c) 2020-2026 chenwuai
|
|
62
|
+
* https://github.com/chenchenwuai/H265Player
|
|
63
|
+
* Released under the MIT License.
|
|
64
|
+
*/const e$3={Idle:0,Initializing:1,Ready:2,Finished:3},t$3=0,i$3=1,r$3=2,o$2=3,n$2=0,l=1,s$3=3,a$2=4,c=5,d=6,u=0,h=1,b=4,p=5,y=6,Z=7,m=8,R=9,G=10,v=11,f=12,g=13;function X(e){this.gl=e,this.texture=e.createTexture(),e.bindTexture(e.TEXTURE_2D,this.texture),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MAG_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_MIN_FILTER,e.LINEAR),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_S,e.CLAMP_TO_EDGE),e.texParameteri(e.TEXTURE_2D,e.TEXTURE_WRAP_T,e.CLAMP_TO_EDGE)}function x(e,t){this.canvas=e,this.gl=e.getContext("webgl")||e.getContext("experimental-webgl"),this.initGL(t)}function V(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function W(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(V(arguments[t]));return e}X.prototype.bind=function(e,t,r){var n=this.gl;n.activeTexture([n.TEXTURE0,n.TEXTURE1,n.TEXTURE2][e]),n.bindTexture(n.TEXTURE_2D,this.texture),n.uniform1i(n.getUniformLocation(t,r),e)},X.prototype.fill=function(e,t,r){var n=this.gl;n.bindTexture(n.TEXTURE_2D,this.texture),n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,e,t,0,n.LUMINANCE,n.UNSIGNED_BYTE,r)},x.prototype.initGL=function(e){if(this.gl){var t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,1);var r=t.createProgram(),n=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {"," gl_Position = aVertexPosition;"," vTextureCoord = aTextureCoord;","}"].join("\n"),i=t.createShader(t.VERTEX_SHADER);t.shaderSource(i,n),t.compileShader(i);var o=["precision highp float;","varying lowp vec2 vTextureCoord;","uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;","const mat4 YUV2RGB = mat4","("," 1.1643828125, 0, 1.59602734375, -.87078515625,"," 1.1643828125, -.39176171875, -.81296875, .52959375,"," 1.1643828125, 2.017234375, 0, -1.081390625,"," 0, 0, 0, 1",");","void main(void) {"," gl_FragColor = vec4( texture2D(YTexture, vTextureCoord).x, texture2D(UTexture, vTextureCoord).x, texture2D(VTexture, vTextureCoord).x, 1) * YUV2RGB;","}"].join("\n"),s=t.createShader(t.FRAGMENT_SHADER);t.shaderSource(s,o),t.compileShader(s),t.attachShader(r,i),t.attachShader(r,s),t.linkProgram(r),t.useProgram(r),t.getProgramParameter(r,t.LINK_STATUS)||console.log("[ER] Shader link failed.");var a=t.getAttribLocation(r,"aVertexPosition");t.enableVertexAttribArray(a);var u=t.getAttribLocation(r,"aTextureCoord");t.enableVertexAttribArray(u);var l=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,l),t.bufferData(t.ARRAY_BUFFER,new Float32Array([1,1,0,-1,1,0,1,-1,0,-1,-1,0]),t.STATIC_DRAW),t.vertexAttribPointer(a,3,t.FLOAT,!1,0,0);var c=t.createBuffer();t.bindBuffer(t.ARRAY_BUFFER,c),t.bufferData(t.ARRAY_BUFFER,new Float32Array([1,0,0,0,1,1,0,1]),t.STATIC_DRAW),t.vertexAttribPointer(u,2,t.FLOAT,!1,0,0),t.y=new X(t),t.u=new X(t),t.v=new X(t),t.y.bind(0,r,"YTexture"),t.u.bind(1,r,"UTexture"),t.v.bind(2,r,"VTexture")}else console.log("[ER] WebGL not supported.")},x.prototype.renderFrame=function(e,t,r,n,i){if(this.gl){var o=this.gl;o.viewport(0,0,o.canvas.width,o.canvas.height),o.clearColor(0,0,0,0),o.clear(o.COLOR_BUFFER_BIT),o.y.fill(t,r,e.subarray(0,n)),o.u.fill(t>>1,r>>1,e.subarray(n,n+i)),o.v.fill(t>>1,r>>1,e.subarray(n+i,e.length)),o.drawArrays(o.TRIANGLE_STRIP,0,4)}else console.log("[ER] Render frame failed due to WebGL not supported.")},x.prototype.fullscreen=function(){var e=this.canvas;e.RequestFullScreen?e.RequestFullScreen():e.webkitRequestFullScreen?e.webkitRequestFullScreen():e.mozRequestFullScreen?e.mozRequestFullScreen():e.msRequestFullscreen?e.msRequestFullscreen():alert("This browser doesn't supporter fullscreen")},x.prototype.exitfullscreen=function(){document.exitFullscreen?document.exitFullscreen():document.webkitExitFullscreen?document.webkitExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.msExitFullscreen?document.msExitFullscreen():alert("Exit fullscreen doesn't work")};var S=function(){function e(){this._listenersMap={}}return e.prototype.on=function(e,t){return void 0===this._listenersMap[e]&&(this._listenersMap[e]=[]),this._listenersMap[e].push(t),this},e.prototype.once=function(e,t){return t.isOnce=!0,this.on(e,t),this},e.prototype.off=function(e,t){var r=this._listenersMap[e];if(void 0!==r)if(void 0===t)delete this._listenersMap[e];else{var n=r.findIndex((function(e){return e===t}));r.splice(n,1)}return this},e.prototype.offAll=function(){this._listenersMap={}},e.prototype.emit=function(e){for(var t,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this._listenersMap[e];if(void 0!==o&&o.length>0){try{for(var s=
|
|
65
|
+
/*!
|
|
66
|
+
* znu-event v0.0.10
|
|
67
|
+
* (c) 2020-2020 chenwuai
|
|
68
|
+
* https://github.com/chenchenwuai/znu-event.git
|
|
69
|
+
* Released under the MIT License.
|
|
70
|
+
*/
|
|
71
|
+
/*! *****************************************************************************
|
|
72
|
+
Copyright (c) Microsoft Corporation.
|
|
73
|
+
|
|
74
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
75
|
+
purpose with or without fee is hereby granted.
|
|
76
|
+
|
|
77
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
78
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
79
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
80
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
81
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
82
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
83
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
84
|
+
***************************************************************************** */
|
|
85
|
+
function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o.entries()),a=s.next();!a.done;a=s.next()){var u=V(a.value,2),l=u[0],c=u[1];if(c.isOnce){var h=c;o.splice(l,1),h.apply(void 0,W(n))}else c.apply(void 0,W(n))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return!0}return!1},e.prototype.has=function(e){return void 0!==this._listenersMap[e]&&this._listenersMap[e].length>0},e.prototype.eventNames=function(){var e=[];for(var t in this._listenersMap)e.push(t);return e},e.prototype.destroy=function(){this.offAll()},e}(),L=null;try{var T="function"==typeof module.require&&__webpack_require__(Object(function(){var e=new Error("Cannot find module 'worker_threads'");throw e.code="MODULE_NOT_FOUND",e}()))||"function"==typeof require&&require("worker_threads")||__webpack_require__(Object(function(){var e=new Error("Cannot find module 'worker_threads'");throw e.code="MODULE_NOT_FOUND",e}()));L=T.Worker}catch(e){}function Y(e,t,r){var n=void 0===t?null:t,i=function(e,t){return Buffer.from(e,"base64").toString(t?"utf16":"utf8")}(e,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:"");return function(e){return new L(s,Object.assign({},e,{eval:!0}))}}function I(e,t,r){var n=void 0===t?null:t,i=function(e,t){var r=atob(e);if(t){for(var n=new Uint8Array(r.length),i=0,o=r.length;i<o;++i)n[i]=r.charCodeAt(i);return new TextDecoder("utf-16le").decode(new Uint16Array(n.buffer))}return r}(e,void 0!==r&&r),o=i.indexOf("\n",10)+1,s=i.substring(o)+(n?"//# sourceMappingURL="+n:""),a=new Blob([s],{type:"application/javascript"});return URL.createObjectURL(a)}var k="[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0);function N(e,t,r){return k?Y(e,t,r):function(e,t,r){var n;return function(i){return n=n||I(e,t,r),new Worker(n,i)}}(e,t,r)}var F=N("Lyogcm9sbHVwLXBsdWdpbi13ZWItd29ya2VyLWxvYWRlciAqLwohZnVuY3Rpb24oKXsidXNlIHN0cmljdCI7Y29uc3QgZT0wLHQ9MixvPTQscz01LGk9NixyPTAsZD0xLGE9NCxuPTUsYz02LGw9NyxoPTgsdT05LHA9MTAsZz0xMSxmPTEyLHk9MTM7bGV0IEQ9bG9jYXRpb24ub3JpZ2luO2Z1bmN0aW9uIF8oKXt0aGlzLlRBRz0iSDI2NURlY29kZXIiLHRoaXMuZGVjb2RlclN0YXR1cz1lLHRoaXMud2FzbUxvYWRlZD0hMSx0aGlzLmVuYWJsZURlY29kZT0hMSx0aGlzLmFjY3VyYXRlU2Vlaz0hMCx0aGlzLmNhY2hlQnVmZmVyPW51bGwsdGhpcy5kZWNvZGVUaW1lcj1udWxsLHRoaXMudmlkZW9DYWxsYmFjaz1udWxsLHRoaXMuX2xhc3RUaW1lc3RhbXA9MCx0aGlzLl9sYXN0RHVyYXRpb249NDAsdGhpcy5kZWJ1Zz0hMSx0aGlzLmNvcmVMb2dMZXZlbD0wfXNlbGYuTW9kdWxlPXtvblJ1bnRpbWVJbml0aWFsaXplZDpmdW5jdGlvbigpe3NlbGYuaDI2NV9kZWNvZGVyP3NlbGYuaDI2NV9kZWNvZGVyLm9uV2FzbUxvYWRlZCgpOmNvbnNvbGUuZXJyb3IoIk5vIGRlY29kZXIhIil9LGxvY2F0ZUZpbGU6ZnVuY3Rpb24oZSl7cmV0dXJuIEQrZX19LHNlbGYub25lcnJvcj1mdW5jdGlvbihlKXtzZWxmLnBvc3RNZXNzYWdlKHt0eXBlOm4sZGF0YTplfSl9LHNlbGYuaDI2NV9kZWNvZGVyPW5ldyBfLHNlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6cn0pLHNlbGYub25tZXNzYWdlPWZ1bmN0aW9uKGUpe3ZhciB0PWUuZGF0YTtzZWxmLmgyNjVfZGVjb2Rlcj9zZWxmLmgyNjVfZGVjb2Rlci5vbm1lc3NhZ2UodCk6Y29uc29sZS5lcnJvcigiSDI2NURlY29kZXIgbm90IGluaXRpYWxpemVkISIpfSxfLnByb3RvdHlwZS5pbml0RGVjb2Rlcj1mdW5jdGlvbihlKXt0aGlzLl9sb2coImluaXQgZGVjb2RlciIpLHRoaXMuZGVidWc9ISFlLmRlYnVnLHRoaXMuY29yZUxvZ0xldmVsPXZvaWQgMCE9PWUubG9nTGV2ZWw/ZS5sb2dMZXZlbDowLHRoaXMuZGVjb2RlclN0YXR1cz10LHRoaXMuX2xvZygiaW5pdGVkIGRlY29kZXIiLCJ3YXNtTG9hZGVkIix0aGlzLndhc21Mb2FkZWQsImNvcmVMb2dMZXZlbCIsdGhpcy5jb3JlTG9nTGV2ZWwpLEQ9L15odHRwcz86XC9cL1tcdy1dKyhcLltcdy1dKykrKFtcdy4sQD9ePSUmOi9+KyMtXSpbXHdAP149JSYvfisjLV0pPyQvLnRlc3QoZS5iYXNlTGliUGF0aCk/ZS5iYXNlTGliUGF0aDpsb2NhdGlvbi5vcmlnaW4rZS5iYXNlTGliUGF0aCxzZWxmLmltcG9ydFNjcmlwdHMoRCsibGliZmZtcGVnXzI2NS5qcyIpLHRoaXMud2FzbUxvYWRlZCYmdGhpcy5vcGVuRGVjb2RlcigpfSxfLnByb3RvdHlwZS5vcGVuRGVjb2Rlcj1mdW5jdGlvbigpe2lmKHRoaXMub3BlbmVkRGVjb2RlcilyZXR1cm47dGhpcy5vcGVuZWREZWNvZGVyPSEwLHRoaXMuX2xvZygiT3BlbiBkZWNvZGVyIik7Y29uc3QgZT1Nb2R1bGUuYWRkRnVuY3Rpb24oZnVuY3Rpb24oZSx0LG8scyxpLHIsZCxhLG4pe2NvbnN0IGM9bmV3IFVpbnQ4QXJyYXkoZCphK2QvMiooYS8yKStkLzIqKGEvMikpO2xldCBsPTA7Zm9yKGxldCB0PTA7dDxhO3QrKyl7Y29uc3Qgbz1lK3QqcztsZXQgaT1IRUFQVTguc3ViYXJyYXkobyxvK2QpO2k9bmV3IFVpbnQ4QXJyYXkoaSksYy5zZXQoaSxsKSxsKz1pLmxlbmd0aH1mb3IobGV0IGU9MDtlPGEvMjtlKyspe2NvbnN0IG89dCtlKmk7bGV0IHM9SEVBUFU4LnN1YmFycmF5KG8sbytkLzIpO3M9bmV3IFVpbnQ4QXJyYXkocyksYy5zZXQocyxsKSxsKz1zLmxlbmd0aH1mb3IobGV0IGU9MDtlPGEvMjtlKyspe2NvbnN0IHQ9bytlKnI7bGV0IHM9SEVBUFU4LnN1YmFycmF5KHQsdCtkLzIpO3M9bmV3IFVpbnQ4QXJyYXkocyksYy5zZXQocyxsKSxsKz1zLmxlbmd0aH1zZWxmLnBvc3RNZXNzYWdlKHt0eXBlOnksZGF0YTp7ZGF0YTpjLmJ1ZmZlcix3aWR0aDpkLGhlaWdodDphLHB0czpufX0sW2MuYnVmZmVyXSl9KSx0PU1vZHVsZS5fb3BlbkRlY29kZXIoMSxlLHRoaXMuY29yZUxvZ0xldmVsKTtpZigwIT09dClyZXR1cm4gc2VsZi5wb3N0TWVzc2FnZSh7dHlwZTpuLGRhdGE6e3JldDp0fX0pLHZvaWQgdGhpcy5fbG9nKCJvcGVuIGRlY29kZXIgZmFpbGVkIHdpdGggZXJyb3IiLHQpO3RoaXMuX2xvZygiT3BlbmVkIGRlY29kZXIiKSxzZWxmLnBvc3RNZXNzYWdlKHt0eXBlOmF9KSx0aGlzLnN0YXJ0RGVjb2RpbmcoKX0sXy5wcm90b3R5cGUuc3RhcnREZWNvZGluZz1mdW5jdGlvbigpe3RoaXMuX2xvZygiU3RhcnQgZGVjb2RpbmcuIiksdGhpcy5kZWNvZGVyU3RhdHVzIT09aT8odGhpcy5lbmFibGVEZWNvZGU9ITAsdGhpcy5kZWNvZGVyU3RhdHVzPW8sc2VsZi5wb3N0TWVzc2FnZSh7dHlwZTpsfSkpOnRoaXMuX2xvZygiU3RhcnQgZGVjb2RpbmcgZXJyb3IuIGRlY29kZXIgYWxyZWFkeSBjbG9zZWQiKX0sXy5wcm90b3R5cGUucGF1c2VEZWNvZGluZz1mdW5jdGlvbigpe3RoaXMuX2xvZygiUGF1c2UgZGVjb2RpbmcuIiksdGhpcy5kZWNvZGVyU3RhdHVzIT09aT8odGhpcy5lbmFibGVEZWNvZGU9ITEsdGhpcy5kZWNvZGVyU3RhdHVzPXMsc2VsZi5wb3N0TWVzc2FnZSh7dHlwZTp1fSkpOnRoaXMuX2xvZygiUGF1c2UgZGVjb2RpbmcgZXJyb3IuIGRlY29kZXIgYWxyZWFkeSBjbG9zZWQiKX0sXy5wcm90b3R5cGUuY2xvc2VEZWNvZGVyPWZ1bmN0aW9uKCl7dGhpcy5fbG9nKCJjbG9zZURlY29kZXIuIiksdGhpcy5lbmFibGVEZWNvZGU9ITE7Y29uc3QgZT1Nb2R1bGUuX2Nsb3NlRGVjb2RlcigpO3RoaXMuZGVjb2RlclN0YXR1cz1pLHRoaXMuX2xvZygiQ2xvc2UgZmZtcGVnIGRlY29kZXIgcmV0dXJuICIrZSsiLiIpLHNlbGYucG9zdE1lc3NhZ2Uoe3R5cGU6Z30pfSxfLnByb3RvdHlwZS5kZWNvZGU9ZnVuY3Rpb24oZSx0KXt2YXIgbz1uZXcgVWludDhBcnJheShlKSxzPW8ubGVuZ3RoLGk9TW9kdWxlLl9tYWxsb2Mocyk7TW9kdWxlLkhFQVBVOC5zZXQobyxpKTt2YXIgcj10aGlzLmdldFBUUyh0KTtNb2R1bGUuX2RlY29kZURhdGEoaSxzLHIpLG51bGwhPWkmJihNb2R1bGUuX2ZyZWUoaSksaT1udWxsKX0sXy5wcm90b3R5cGUucmVjZWl2ZUJ1ZmZlcj1mdW5jdGlvbihlLHQpe3RoaXMuZW5hYmxlRGVjb2RlJiZ0aGlzLmRlY29kZShlLHQpfSxfLnByb3RvdHlwZS5nZXRQVFM9ZnVuY3Rpb24oZSl7bGV0IHQ9ZS10aGlzLl9sYXN0VGltZXN0YW1wO3JldHVybiB0aGlzLl9sYXN0VGltZXN0YW1wPWUsdD4xZTM/dD0wOnQ8MD90PXRoaXMuX2xhc3REdXJhdGlvbjp0aGlzLl9sYXN0RHVyYXRpb249dCx0fSxfLnByb3RvdHlwZS5vbm1lc3NhZ2U9ZnVuY3Rpb24oZSl7c3dpdGNoKGUudHlwZSl7Y2FzZSBkOnRoaXMuaW5pdERlY29kZXIoZS5jb25maWcpO2JyZWFrO2Nhc2UgYzp0aGlzLnN0YXJ0RGVjb2RpbmcoKTticmVhaztjYXNlIGg6dGhpcy5wYXVzZURlY29kaW5nKCk7YnJlYWs7Y2FzZSBwOnRoaXMuY2xvc2VEZWNvZGVyKCk7YnJlYWs7Y2FzZSBmOnRoaXMucmVjZWl2ZUJ1ZmZlcihlLmRhdGEsZS50aW1lc3RhbXApO2JyZWFrO2RlZmF1bHQ6Y29uc29sZS5lcnJvcigiVW5zdXBwb3J0IG1lc3NzYWdlICIrZS50eXBlKX19LF8ucHJvdG90eXBlLm9uV2FzbUxvYWRlZD1mdW5jdGlvbigpe3RoaXMuX2xvZygiV2FzbSBsb2FkZWQuIiksdGhpcy53YXNtTG9hZGVkPSEwLHRoaXMuZGVjb2RlclN0YXR1cz09PXQmJnRoaXMub3BlbkRlY29kZXIoKX0sXy5wcm90b3R5cGUuX2xvZz1mdW5jdGlvbigpe2lmKHRoaXMuZGVidWcpe3ZhciBlPW5ldyBEYXRlKERhdGUubm93KCkpLHQ9ZS5nZXRIb3VycygpKyI6IitlLmdldE1pbnV0ZXMoKSsiOiIrZS5nZXRTZWNvbmRzKCkrIjoiK2UuZ2V0TWlsbGlzZWNvbmRzKCk7Y29uc29sZS5sb2coYFske3R9XVsgJHt0aGlzLlRBR30gXSA6IGAsLi4uYXJndW1lbnRzKX19fSgpOwoK",null,!1);class U{constructor(e,t){this.TAG="H265Player",this.CLASS_ID=function(){const e=+new Date+"";return(+(parseInt(65536*(1+Math.random()))+""+e)).toString(32)}(),this.playerStatus=t$3,this.frameBuffer=[],this.webglPlayer=null,this.isFull=!1,this.videoWidth=0,this.videoHeight=0,this.decodeWorker=null,this.decoderStatus=n$2,this.event=new S,this.config={baseLibPath:"/lib/",decoderLogLevel:0,debug:!1},t&&(this.config=Object.assign({},this.config,t)),this.requestAnimationFrameId=null,this._receiveFirstRenderProgress=!1,this.initDecodeWorker(),this.initWebglPlayer(e),this._onVisibilityChange=()=>{!function(){const e=["webkit","moz","mos","o"];if("hidden"in document)return document.hidden;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return document[`${e[t]}Hidden`];return null}()?this.playerStatus===o$2&&this.play():this.playerStatus===r$3&&this.pause()},document.addEventListener("visibilitychange",this._onVisibilityChange,!1)}initDecodeWorker(){this._log("init decoder");var e=this;this.decodeWorker=new F,this.decodeWorker.onmessage=function(t){const{type:r,data:n={}}=t.data;switch(r){case u:e._initDecoder();break;case b:e._onDecoderReady();break;case Z:e._onStartDecoding();break;case R:e._onPauseDecoding();break;case v:e._onCloseDecoding();break;case p:e._onDecoderOpenError(n);break;case g:e._onVideoFrame(n)}}}_initDecoder(){this.decoderStatus=l,this._log("decoder initiailizing"),this.decodeWorker.postMessage({type:h,config:{debug:!!this.config.debug,baseLibPath:this.config.baseLibPath,logLevel:this.config.decoderLogLevel}})}_onDecoderReady(){this.decoderStatus=s$3,this._log("decoder ready"),this.webglPlayer&&this.playerStatus===t$3&&this._onPlayerReady()}_onDecoderOpenError(e){this._log("decoder open error: ",e),this.decoderStatus=e$3.Closed,this.emit("error",new Error(e))}_onPlayerReady(){this.playerStatus=i$3,this._log("player ready"),this.emit("ready")}start(){this.playerStatus===i$3?(this._displayLoop(),this.playerStatus=r$3):this._log("player not ready")}initWebglPlayer(e){this._log("init webgl player"),e?(this.canvas=e,this.webglPlayer=new x(e,{preserveDrawingBuffer:!1}),this.decoderStatus===s$3&&this.playerStatus===t$3&&this._onPlayerReady()):this.emit("error",new Error("Not Valid Canvas"))}startDecoding(){this.decodeWorker.postMessage({type:y}),this.playerStatus=r$3}_onStartDecoding(){this.decoderStatus=a$2}pauseDecoding(){this.decodeWorker.postMessage({type:m}),this.playerStatus=o$2}_onPauseDecoding(){this.decoderStatus=c}closeDecoding(){this.decodeWorker.postMessage({type:G}),this.playerStatus=o$2}_onCloseDecoding(){this.decoderStatus=d}play(){this.startDecoding(),this.emit("play")}pause(){this.pauseDecoding(),this.emit("pause")}feed(e,t,r){try{if(this.isFull){if("I"!==r.frame)return;if(this.frameBuffer.length>50)return;this.isFull=!1}else if(this.frameBuffer.length>50)return void(this.isFull=!0);this.decoderStatus===a$2?(this._log(`Decode Buffer, timestamp:${t}`),this.decodeWorker.postMessage({type:f,data:e,timestamp:t},[e])):this._log(`ignore decode buffer, timestamp:${t}, decoder open:${this.decoderStatus===a$2}`)}catch(e){console.error(e)}}_onVideoFrame(e){this.frameBuffer.push(e)}_displayLoop(){if(this.playerStatus!==t$3&&(this.requestAnimationFrameId=requestAnimationFrame(this._displayLoop.bind(this))),this.playerStatus===r$3&&0!==this.frameBuffer.length)for(let t=0;t<2;++t){var e=this.frameBuffer.shift();if(this.displayVideoFrame(e),0===this.frameBuffer.length)break}}_cleanDisplayLoop(){this.requestAnimationFrameId&&window.cancelAnimationFrame(this.requestAnimationFrameId)}displayVideoFrame(e){if(this.playerStatus!==r$3)return!1;var t=e.width,r=e.height;this.videoWidth===t&&this.videoHeight===r||this.emit("size",{width:t,height:r}),this.videoWidth=t,this.videoHeight=r,this.yLength=t*r,this.uvLength=t/2*(r/2);var n=new Uint8Array(e.data);return this.renderVideoFrame(n),!0}renderVideoFrame(e){this.webglPlayer.renderFrame(e,this.videoWidth,this.videoHeight,this.yLength,this.uvLength),this._receiveFirstRenderProgress||(this._receiveFirstRenderProgress=!0,this.emit("play"))}fullscreen(){this.webglPlayer&&this.webglPlayer.fullscreen()}async clean(){this.cleaning||this.pauseDecoding(),this._cleanDisplayLoop(),this.canvas=null,this.webglPlayer=null,this.callback=null,this.decoderStatus=e$3.Idle,this.playerStatus=t$3,this.decoding=!1,this.frameBuffer=[],this._receiveFirstRenderProgress=!1,this.emit("pause"),this.decodeWorker&&this.decodeWorker.terminate(),this.event&&await this.event.offAll()}async destroy(){document.removeEventListener("visibilitychange",this._onVisibilityChange,!1),this.closeDecoding(),this.cleaning=!0,await this.clean()}on(e,t){this.event.on(e,t)}off(e,t){this.event.off(e,t)}emit(){this.event.emit(...arguments)}_log(){this.config.debug&&function(e,t,...r){const n=new Date(Date.now());var i=n.getHours()+":"+n.getMinutes()+":"+n.getSeconds()+":"+n.getMilliseconds();console.log(`[${i}]-[ ${e}|${t} ] : `,...r)}(this.TAG,this.CLASS_ID,...arguments)}static isSupported(){try{return void 0!==self.Worker&&void 0!==self.WebGLRenderingContext}catch(e){return!1}}}
|
|
86
|
+
/*!
|
|
87
|
+
* h265-player
|
|
88
|
+
* (c) 2020-2026 chenwuai
|
|
89
|
+
* https://github.com/chenchenwuai/H265Player
|
|
90
|
+
* Released under the MIT License.
|
|
91
|
+
*/
|
|
92
|
+
/*!
|
|
93
|
+
* znu-event v0.0.10
|
|
94
|
+
* (c) 2020-2020 chenwuai
|
|
95
|
+
* https://github.com/chenchenwuai/znu-event.git
|
|
96
|
+
* Released under the MIT License.
|
|
97
|
+
*/
|
|
98
|
+
/*! *****************************************************************************
|
|
99
|
+
Copyright (c) Microsoft Corporation.
|
|
100
|
+
|
|
101
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
102
|
+
purpose with or without fee is hereby granted.
|
|
103
|
+
|
|
104
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
105
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
106
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
107
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
108
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
109
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
110
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
111
|
+
***************************************************************************** */function e$2(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function t$2(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(e$2(arguments[t]));return e}window&&(window.H265Player=U);var i$2=function(){function e(){this._listenersMap={}}return e.prototype.on=function(e,t){return void 0===this._listenersMap[e]&&(this._listenersMap[e]=[]),this._listenersMap[e].push(t),this},e.prototype.once=function(e,t){return t.isOnce=!0,this.on(e,t),this},e.prototype.off=function(e,t){var r=this._listenersMap[e];if(void 0!==r)if(void 0===t)delete this._listenersMap[e];else{var n=r.findIndex((function(e){return e===t}));r.splice(n,1)}return this},e.prototype.offAll=function(){this._listenersMap={}},e.prototype.emit=function(e){for(var t,r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this._listenersMap[e];if(void 0!==o&&o.length>0){try{for(var s=function(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}(o.entries()),a=s.next();!a.done;a=s.next()){var u=e$2(a.value,2),l=u[0],c=u[1];if(c.isOnce){var h=c;o.splice(l,1),h.apply(void 0,t$2(n))}else c.apply(void 0,t$2(n))}}catch(e){t={error:e}}finally{try{a&&!a.done&&(r=s.return)&&r.call(s)}finally{if(t)throw t.error}}return!0}return!1},e.prototype.has=function(e){return void 0!==this._listenersMap[e]&&this._listenersMap[e].length>0},e.prototype.eventNames=function(){var e=[];for(var t in this._listenersMap)e.push(t);return e},e.prototype.destroy=function(){this.offAll()},e}();const n$1=0,s$2=2,r$2=3;class o$1{constructor(e){this.isFull=!1,this.TAG="H265Player",this.CLASS_ID=function(){const e=+new Date+"";return(+(parseInt(65536*(1+Math.random()))+""+e)).toString(32)}(),this.ctx=null,this.decoder=null,this.pendingFrames=[],this.underflow=!0,this.playerStatus=n$1,this.event=new i$2,this.baseTime=0,this.speed=0,this.initCanvas(e),this.initVideoDecoder(),this._onVisibilityChange=()=>{!function(){const e=["webkit","moz","mos","o"];if("hidden"in document)return document.hidden;for(let t=0;t<e.length;t++)if(`${e[t]}Hidden`in document)return document[`${e[t]}Hidden`];return null}()?this.playerStatus===r$2&&this.play():this.playerStatus===s$2&&this.pause()},document.addEventListener("visibilitychange",this._onVisibilityChange,!1)}initCanvas(e){this.ctx=e.getContext("2d")}async initVideoDecoder(){const e={output:this.handleFrame.bind(this),error:e=>{console.log(e,e.message)}},t={codec:"hvc1.1.6.L150.b0",hardwareAcceleration:"prefer-hardware",codedWidth:640,codedHeight:480},{supported:r}=await VideoDecoder.isConfigSupported(t);r&&(this.decoder=new VideoDecoder(e),this.decoder.configure(t))}async createChunk(e,t,r){const n=new EncodedVideoChunk({timestamp:1e3*t,type:"I"===r?"key":"delta",codedWidth:700,codedHeight:480,data:e});"closed"===this.decoder.state&&this.initVideoDecoder(),queueMicrotask((()=>{try{this.decoder.decode(n)}catch(e){console.log(e)}}))}handleFrame(e){this.pendingFrames.push(e),this.underflow&&setTimeout(this.renderFrame.bind(this),0)}async renderFrame(){if(this.underflow=0===this.pendingFrames.length,this.underflow)return;const e=this.pendingFrames.shift(),{clientWidth:t,clientHeight:r}=this.ctx.canvas;this.emit("size",{width:e.codedWidth,height:e.codedHeight,mode:"硬解码"});const n=this.calculateTimeUntilNextFrame(e.timestamp);await new Promise((e=>{setTimeout(e,0===this.speed?0:n/this.speed)})),this.ctx.drawImage(e,0,0,e.codedWidth,e.codedHeight,0,0,t,r),this.playerStatus!==s$2&&this.play(),e.close(),setTimeout(this.renderFrame.bind(this),0)}changeSpeed(e=0){this.speed=e<=0||e>=1?0:e}calculateTimeUntilNextFrame(e){if(0===this.baseTime)return this.baseTime=e,0;{const t=(e-this.baseTime)/1e3;return this.baseTime=e,t>500?0:t}}play(){this.playerStatus=s$2,this.emit("play")}pause(){this.playerStatus=r$2,this.emit("pause")}feed(e,t,r){if(this.isFull){if("I"!==r.frame)return;if(this.pendingFrames.length>50)return;this.isFull=!1}else if(this.pendingFrames.length>50)return void(this.isFull=!0);this.createChunk(e,t,r.frame)}clean(){this.decoder.close(),this.ctx=null,this.decoder=null,this.pendingFrames=[],this.underflow=!0}async destroy(){document.removeEventListener("visibilitychange",this._onVisibilityChange,!1),await this.clean()}on(e,t){this.event.on(e,t)}off(e,t){this.event.off(e,t)}emit(){this.event.emit(...arguments)}}window&&(window.H265Player=o$1);var H265Player=function(e){function t(t,r){void 0===r&&(r={});var n=e.call(this)||this;n._player=null,n._canvasMedia=null,n._config={baseLibPath:"/lib/",decoderLogLevel:0,debug:!1},n._canvasMedia=t;var i,o=Object.assign({},n._config,r);return"VideoEncoder"in window?n.judgeHardDecoding(t,i,o):(console.log("webcodecs is not supported."),i=n._player=new U(t,o),n.mount(i)),n}return __extends(t,e),t.prototype.judgeHardDecoding=function(e,t,r){return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(n){switch(n.label){case 0:return n.trys.push([0,2,,3]),[4,VideoDecoder.isConfigSupported({codec:"hvc1.1.6.L150.b0"})];case 1:return n.sent().supported?(console.log("webcodecs is supported."),t=this._player=new o$1(e,r),this.mount(t)):(console.log("codec is not supported"),t=this._player=new U(e,r),this.mount(t)),[3,3];case 2:return n.sent(),console.log("webcodecs is not supported"),t=this._player=new U(e,r),this.mount(t),[3,3];case 3:return[2]}}))}))},t.prototype.mount=function(e){var t=this;log("Created H265 Player"),e.on("ready",this._onPlayerReady.bind(this)),e.on("play",this._onPlay.bind(this)),e.on("pause",this._onPause.bind(this)),e.on("size",(function(e){t.emit("size",e)}))},t.prototype.feed=function(e,t,r,n){this._player&&"video"===r&&this._player.feed(new Uint8Array(e).buffer,t,n)},t.prototype.play=function(){var e;null===(e=this._player)||void 0===e||e.play()},t.prototype.pause=function(){var e;null===(e=this._player)||void 0===e||e.pause()},t.prototype._onPlayerReady=function(){this._player.start()},t.prototype.destroy=function(){this._cleanEmitter(),this._player&&this._player.destroy(),this._player=null,this._canvasMedia=null,log("Destroyed H265 Player")},t}(BasePlayer);
|
|
112
|
+
/*!
|
|
113
|
+
* h265-player
|
|
114
|
+
* (c) 2020-2024 Lowrie
|
|
115
|
+
* Released under the MIT License.
|
|
116
|
+
*/
|
|
117
|
+
/*!
|
|
118
|
+
* h265-player
|
|
119
|
+
* (c) 2020-2023 chenwuai
|
|
120
|
+
* https://github.com/chenchenwuai/H265Player
|
|
121
|
+
* Released under the MIT License.
|
|
122
|
+
*/class e$1{constructor(){this.audioElement=null,this.mediaSource=new MediaSource,this.sourceBuffer=null,this.ready=!1,this.playerStatus=t$1.Idle,this.init()}init(){this.mediaSource.addEventListener("sourceopen",(()=>{this.sourceBuffer=this.mediaSource.addSourceBuffer("audio/aac"),this.ready=!0})),this.audioElement=document.createElement("audio"),this.audioElement.src=URL.createObjectURL(this.mediaSource),this.audioElement.autoplay=!0,this.audioElement.muted=!0,document.body.appendChild(this.audioElement)}play(){this.playerStatus=t$1.Playing,this.audioElement.play()}pause(){this.playerStatus=t$1.Pause,this.audioElement.pause()}feed(e){if(this.ready)try{this.sourceBuffer.appendBuffer(e.buffer)}catch(e){}else this.init()}muted(e=!1){this.audioElement.muted=e}clean(){this.sourceBuffer.remove(0,this.sourceBuffer.buffered.end(0))}destroy(){this.playerStatus=t$1.Destroyed,this.audioElement.pause(),this.audioElement.src="",this.audioElement.load(),this.audioElement.remove(),this.mediaSource=null,this.sourceBuffer=null,this.audioElement=null}}const t$1={Idle:0,Ready:1,Playing:2,Pause:3,Destroyed:4};window&&(window.AccStreamPlayer=e$1);var i$1={getArrayBuffer:function(e){if(null==e)return console.error("input array_buffer is empty/undefined",e),!1;if(ArrayBuffer.isView(e))e=e.buffer;else if(!e instanceof ArrayBuffer)return console.error("input array_buffer type is not valid",e),!1;return e},compressSampleRate:function(e,t,r){if(!(e=i$1.getArrayBuffer(e)))return!1;for(var n=new Float32Array(e),i=parseInt(t/r),o=n.length/i,s=new Float32Array(o),a=0,u=0;a<o;)s[a]=n[u],u+=i,a++;return s.buffer},changeSampleBits:function(e,t){if(!(e=i$1.getArrayBuffer(e)))return!1;var r=e.byteLength/(t/8),n=new ArrayBuffer(r),i=new DataView(n);return 16===t?function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t+=2){var i=Math.max(-1,Math.min(1,r[n]));e.setInt16(t,i<0?32768*i:32767*i,!0)}}(i,0,e):8===t?function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t++){var i=Math.max(-1,Math.min(1,r[n]));e.setInt8(t,i<0?128*i:127*i,!0)}}(i,0,e):function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t+=4){var i=Math.max(-1,Math.min(1,r[n]));e.setInt32(t,i<0?2147483648*i:2147483647*i,!0)}}(i,0,e),i.buffer},PCMToWAV:function(e,t,r,n){var i=e.byteLength,o=new ArrayBuffer(44+i),s=new DataView(o);function a(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))}var u=0;a(s,u,"RIFF"),u+=4,s.setUint32(u,36+i,!0),a(s,u+=4,"WAVE"),a(s,u+=4,"fmt "),u+=4,s.setUint32(u,16,!0),u+=4,s.setUint16(u,1,!0),u+=2,s.setUint16(u,n,!0),u+=2,s.setUint32(u,t,!0),u+=4,s.setUint32(u,t*n*(r/8),!0),u+=4,s.setUint16(u,n*(r/8),!0),u+=2,s.setUint16(u,r,!0),a(s,u+=2,"data"),u+=4,s.setUint32(u,i,!0),u+=4;var l=new Uint8Array(o);return l.set(new Uint8Array(e),u),l.buffer}};i$1.G711U={_base_buffer:[-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,-15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,-11900,-11388,-10876,-10364,-9852,-9340,-8828,-8316,-7932,-7676,-7420,-7164,-6908,-6652,-6396,-6140,-5884,-5628,-5372,-5116,-4860,-4604,-4348,-4092,-3900,-3772,-3644,-3516,-3388,-3260,-3132,-3004,-2876,-2748,-2620,-2492,-2364,-2236,-2108,-1980,-1884,-1820,-1756,-1692,-1628,-1564,-1500,-1436,-1372,-1308,-1244,-1180,-1116,-1052,-988,-924,-876,-844,-812,-780,-748,-716,-684,-652,-620,-588,-556,-524,-492,-460,-428,-396,-372,-356,-340,-324,-308,-292,-276,-260,-244,-228,-212,-196,-180,-164,-148,-132,-120,-112,-104,-96,-88,-80,-72,-64,-56,-48,-40,-32,-24,-16,-8,-2,32124,31100,30076,29052,28028,27004,25980,24956,23932,22908,21884,20860,19836,18812,17788,16764,15996,15484,14972,14460,13948,13436,12924,12412,11900,11388,10876,10364,9852,9340,8828,8316,7932,7676,7420,7164,6908,6652,6396,6140,5884,5628,5372,5116,4860,4604,4348,4092,3900,3772,3644,3516,3388,3260,3132,3004,2876,2748,2620,2492,2364,2236,2108,1980,1884,1820,1756,1692,1628,1564,1500,1436,1372,1308,1244,1180,1116,1052,988,924,876,844,812,780,748,716,684,652,620,588,556,524,492,460,428,396,372,356,340,324,308,292,276,260,244,228,212,196,180,164,148,132,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,2],toPCM:function(e){if(!(e=i$1.getArrayBuffer(e)))return!1;const t=new Uint8Array(e);for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i]=this._base_buffer[t[i]];return new Int16Array(n).buffer}},i$1.G711A={_base_buffer:[-5504,-5248,-6016,-5760,-4480,-4224,-4992,-4736,-7552,-7296,-8064,-7808,-6528,-6272,-7040,-6784,-2752,-2624,-3008,-2880,-2240,-2112,-2496,-2368,-3776,-3648,-4032,-3904,-3264,-3136,-3520,-3392,-22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944,-30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136,-11008,-10496,-12032,-11520,-8960,-8448,-9984,-9472,-15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568,-344,-328,-376,-360,-280,-264,-312,-296,-472,-456,-504,-488,-408,-392,-440,-424,-88,-72,-120,-104,-24,-8,-56,-40,-216,-200,-248,-232,-152,-136,-184,-168,-1376,-1312,-1504,-1440,-1120,-1056,-1248,-1184,-1888,-1824,-2016,-1952,-1632,-1568,-1760,-1696,-688,-656,-752,-720,-560,-528,-624,-592,-944,-912,-1008,-976,-816,-784,-880,-848,5504,5248,6016,5760,4480,4224,4992,4736,7552,7296,8064,7808,6528,6272,7040,6784,2752,2624,3008,2880,2240,2112,2496,2368,3776,3648,4032,3904,3264,3136,3520,3392,22016,20992,24064,23040,17920,16896,19968,18944,30208,29184,32256,31232,26112,25088,28160,27136,11008,10496,12032,11520,8960,8448,9984,9472,15104,14592,16128,15616,13056,12544,14080,13568,344,328,376,360,280,264,312,296,472,456,504,488,408,392,440,424,88,72,120,104,24,8,56,40,216,200,248,232,152,136,184,168,1376,1312,1504,1440,1120,1056,1248,1184,1888,1824,2016,1952,1632,1568,1760,1696,688,656,752,720,560,528,624,592,944,912,1008,976,816,784,880,848],toPCM:function(e){if(console.log(e,"array_buffer"),!(e=i$1.getArrayBuffer(e)))return!1;const t=new Uint8Array(e);for(var r=e.byteLength,n=[],i=0;i<r;i++)n[i]=this._base_buffer[t[i]];return new Int16Array(n).buffer}};var s$1=i$1;class r$1{constructor(){this.is_first_get_audio_stream=!0,this.get_stream_audio_info=null,this.is_first_send_audio_stream=!0,this.send_stream_audio_info=null,this.audioContext=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext),this.buffer=[],this.size=0,this.per_buffer_length=1280,this.frame_num_cache=5,this.buffer_cache_size=0,this.is_first_get_audio_stream=!0,this.get_stream_audio_info=null,this.playerStatus=a$1.Idle,this.audio=new e$1,this.gainNode=this.audioContext.createGain(),this.gainNode.gain.value=0}handleAudio(e,t){this.is_first_get_audio_stream&&(this.get_stream_audio_info=t,this.is_first_get_audio_stream=!1),this.combine_buffer(e)}combine_buffer(e){if(0===this.buffer_cache_size&&(this.per_buffer_length=e.byteLength||1280,this.buffer_cache_size=this.per_buffer_length*this.frame_num_cache,this.buffer_cache_size=this.buffer_cache_size<3200?3200:this.buffer_cache_size,this.buffer_cache_size=this.buffer_cache_size>12800?12800:this.buffer_cache_size,this.buffer_cache_size=3200),this.size<=this.buffer_cache_size){let t=new Uint8Array(e);if(this.size+e.byteLength<this.buffer_cache_size)this.buffer.push(t),this.size+=e.byteLength;else{let r=0,n=null;if(this.size+e.byteLength===this.buffer_cache_size)this.buffer.push(t),this.size+=e.byteLength;else{const e=this.buffer_cache_size-this.size;this.buffer.push(t.slice(0,e)),this.size+=e,r=t.length-e,n=t.slice(e)}let i=this.get_merge_buffer();this.play_pcm_audio(i,this.get_stream_audio_info),e=null,this.buffer=[],this.size=0,null!==n&&0!==r&&(r<=this.buffer_cache_size?(this.buffer.push(n),this.size+=r):(this.buffer_cache_size=2*r,this.buffer.push(n),this.size+=r)),r=null,n=null,i=null}t=null}else this.buffer=[],this.size=0}play_pcm_audio(e,t){let r=s$1.PCMToWAV(e,t.sampleRate,t.bitDepth,t.channelNum);r&&this.playAudio(r),r=null}get_merge_buffer(){const e=new Uint8Array(this.size);let t=0;for(let r=0;r<this.buffer.length;r++)e.set(this.buffer[r],t),t+=this.buffer[r].length;return new Uint8Array(e).buffer}playAudio(e){if(this.audioContext){var t=this;try{this.audioContext.decodeAudioData(e,(function(e){t._visualize(e)}),(function(e){console.log("decode audio data error",e)}))}catch(e){console.error("play error",e)}}else console.error("audioContext is null",this.audioContext)}_visualize(e){var t=this.audioContext.createBufferSource();t.buffer=e,t.connect(this.gainNode),this.gainNode.connect(this.audioContext.destination),t.start||(t.start=t.noteOn,t.stop=t.noteOff),t.start(0)}feed(e){if(this.is_first_get_audio_stream&&(this.get_stream_audio_info=e.info,console.log("音频类型: ",e.info.incodeType),this.is_first_get_audio_stream=!1),e.data&&e.data.length>0){let t=null;if("G711U"===this.get_stream_audio_info.incodeType)t=s$1.G711U.toPCM(e.data);else if("G711A"===this.get_stream_audio_info.incodeType)t=s$1.G711A.toPCM(e.data);else{if("PCM"!==this.get_stream_audio_info.incodeType)return"AAC"===this.get_stream_audio_info.incodeType?void this.audio.feed(e.data):void console.error("暂不支持的音频格式",this.get_stream_audio_info);t=e.data.buffer}this.handleAudio(t,this.get_stream_audio_info)}}play(){this.playerStatus=a$1.Playing,this.audio.play()}pause(){this.playerStatus=a$1.Pause,this.audio.pause()}muted(e=!1){this.audio.muted(e),this.gainNode.gain.value=e?0:1}destroy(){this.playerStatus=a$1.Destroyed,this.audio.destroy(),this.gainNode.disconnect(),this.gainNode=null,this.audio=null,this.audio_utils=null}}const a$1={Idle:0,Ready:1,Playing:2,Pause:3,Destroyed:4};window&&(window.AudioStreamPlayer=r$1);var PlayerController=function(){function e(e){void 0===e&&(e={}),this._emitter=new ZnuEvent,this._ignoreNonIFrame=!0,this._streamFormat="",this._startFeedBuffer=!1,this._documentHidden=!1,this._videoMedia=null,this._h264Player=null,this._canvasMedia=null,this._h265Player=null,this._rgbPlayer=null,this._rgb244Player=null,this.AudioStreamPlayer=null,this.isTalk=!1,this._config={},this._config=e,this.AudioStreamPlayer=new r$1}return e.prototype.attachVideoElement=function(e,t){void 0===t&&(t={}),this._videoMedia=e,this._h264Player=new H264Player(e,t),this._h264Player.on("play",this._onPlay.bind(this)),this._h264Player.on("pause",this._onPause.bind(this)),this._h264Player.on("size",this._onSize.bind(this)),log("attached video element")},e.prototype.attachCanvasElement=function(e,t){void 0===t&&(t={}),this._canvasMedia=e,this._h265Player=new H265Player(e,t),this._h265Player.on("play",this._onPlay.bind(this)),this._h265Player.on("pause",this._onPause.bind(this)),this._h265Player.on("size",this._onSize.bind(this)),log("attached canvas element")},e.prototype.receiveBuffer=function(e){var t,r=e.type,n=e.info,i=e.data,o=n.incodeType,s=n.timestamp,a=n.frame;if(!this._streamFormat&&("H264"===o||"H265"===o||"242"===o||242===o||"244"===o||244===o)){if(log("Incode Type:"+o),"H264"===o&&!this._h264Player||"H265"===o&&!this._h265Player||("242"===o||242===o)&&!this._h265Player||("244"===o||244===o)&&!this._h265Player)return error("Please attach correct HTMLElement!"),null===(t=this._emitter)||void 0===t||t.emit(ErrorTypes.MEDIA_ERROR,ErrorDetails.MEDIA_INVALID_ELEMENT,{}),void(this._startFeedBuffer=!1);this._streamFormat=o,this._startFeedBuffer=!0,this._videoMedia&&(this._videoMedia.style.display="H264"===this._streamFormat?"":"none"),this._canvasMedia&&(this._canvasMedia.style.display="H264"===this._streamFormat?"none":"")}this._startFeedBuffer&&(log("Buffer info: type:"+r+", frame:"+a+", ts:"+s),this._ignoreNonIFrame&&"I"!==a?warn("ignore frame:",r,a,s):document.hidden?this._ignoreNonIFrame=!0:("I"===a&&(this._ignoreNonIFrame=!1),this._feedBuffer(i,s,r,n)))},e.prototype.receiveTalkBuffer=function(e){var t=e.type,r=e.info,n=e.data;document.hidden?this._ignoreNonIFrame=!0:this.isTalk&&this.AudioStreamPlayer.feed({type:t,info:r,data:n})},e.prototype.play=function(){var e,t;this.AudioStreamPlayer.play(),"H264"===this._streamFormat?null===(e=this._h264Player)||void 0===e||e.play():"H265"===this._streamFormat&&(null===(t=this._h265Player)||void 0===t||t.play())},e.prototype.muted=function(e){this.AudioStreamPlayer.muted(e)},e.prototype.pause=function(){var e,t;this.AudioStreamPlayer.pause(),"H264"===this._streamFormat?null===(e=this._h264Player)||void 0===e||e.pause():"H265"===this._streamFormat&&(null===(t=this._h265Player)||void 0===t||t.pause())},e.prototype.controlTalk=function(e){void 0===e&&(e=!1),this.isTalk=e},e.prototype.on=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.on(e,t)},e.prototype.emit=function(e){for(var t,r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];null===(t=this._emitter)||void 0===t||t.emit.apply(t,__spread$1([e],r))},e.prototype.destroy=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return this.AudioStreamPlayer.destroy(),null===(e=this._emitter)||void 0===e||e.destroy(),this._emitter=null,this._h264Player?[4,this._h264Player.destroy()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this._h264Player=null,this._videoMedia=null,this._h265Player?[4,this._h265Player.destroy()]:[3,4];case 3:t.sent(),t.label=4;case 4:return this._h265Player=null,this._canvasMedia=null,this._ignoreNonIFrame=!0,this._streamFormat="",log("Destroyed PlayerController"),[2]}}))}))},Object.defineProperty(e.prototype,"documentHidden",{get:function(){return this._documentHidden},set:function(e){this._documentHidden=e,e?(this._ignoreNonIFrame=!0,this.pause()):this.play()},enumerable:!1,configurable:!0}),e.prototype._feedBuffer=function(e,t,r,n){var i,o;"audio"!==r||this.isTalk?"H264"===this._streamFormat?null===(i=this._h264Player)||void 0===i||i.feed(e,t,r):("H265"===this._streamFormat||"string"==typeof this._streamFormat&&"242"===this._streamFormat||"number"==typeof this._streamFormat&&242===this._streamFormat||"string"==typeof this._streamFormat&&"244"===this._streamFormat||"number"==typeof this._streamFormat&&244===this._streamFormat)&&(null===(o=this._h265Player)||void 0===o||o.feed(e,t,r,n)):this.AudioStreamPlayer.feed({data:e,info:n,timestamp:t})},e.prototype._onPlay=function(e){this.emit("play",e)},e.prototype._onPause=function(e){this.emit("pause",e)},e.prototype._onSize=function(e){this.emit(PlayerEvents.MEDIA_INFO,__assign$1(__assign$1({},e),{format:this._streamFormat}))},e}();function getHiddenProp(){var e=["webkit","moz","mos","o"];if("hidden"in document)return document.hidden;for(var t=0;t<e.length;t++)if(e[t]+"Hidden"in document)return document[e[t]+"Hidden"];return!1}var RuntimeException=function(){function e(e){this._message="",this._message=e}return Object.defineProperty(e.prototype,"name",{get:function(){return"RuntimeException"},enumerable:!1,configurable:!0}),Object.defineProperty(e.prototype,"message",{get:function(){return this._message},enumerable:!1,configurable:!0}),e.prototype.toString=function(){return this.name+": "+this.message},e}(),t={getArrayBuffer:function(e){if(null==e)return console.error("input array_buffer is empty/undefined",e),!1;if(ArrayBuffer.isView(e))e=e.buffer;else if(!e instanceof ArrayBuffer)return console.error("input array_buffer type is not valid",e),!1;return e},compressSampleRate:function(e,r,n){if(!(e=t.getArrayBuffer(e)))return!1;for(var i=new Float32Array(e),o=parseInt(r/n),s=i.length/o,a=new Float32Array(s),u=0,l=0;u<s;)a[u]=i[l],l+=o,u++;return a.buffer},changeSampleBits:function(e,r){if(!(e=t.getArrayBuffer(e)))return!1;var n=e.byteLength/(r/8),i=new ArrayBuffer(n),o=new DataView(i);return 16===r?function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t+=2){var i=Math.max(-1,Math.min(1,r[n]));e.setInt16(t,i<0?32768*i:32767*i,!0)}}(o,0,e):8===r?function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t++){var i=Math.max(-1,Math.min(1,r[n]));e.setInt8(t,i<0?128*i:127*i,!0)}}(o,0,e):function(e,t,r){r=new Float32Array(r);for(var n=0;n<r.length;n++,t+=4){var i=Math.max(-1,Math.min(1,r[n]));e.setInt32(t,i<0?2147483648*i:2147483647*i,!0)}}(o,0,e),o.buffer},PCMToWAV:function(e,t,r,n){var i=e.byteLength,o=new ArrayBuffer(44+i),s=new DataView(o);function a(e,t,r){for(var n=0;n<r.length;n++)e.setUint8(t+n,r.charCodeAt(n))}var u=0;a(s,u,"RIFF"),u+=4,s.setUint32(u,36+i,!0),a(s,u+=4,"WAVE"),a(s,u+=4,"fmt "),u+=4,s.setUint32(u,16,!0),u+=4,s.setUint16(u,1,!0),u+=2,s.setUint16(u,n,!0),u+=2,s.setUint32(u,t,!0),u+=4,s.setUint32(u,t*n*(r/8),!0),u+=4,s.setUint16(u,n*(r/8),!0),u+=2,s.setUint16(u,r,!0),a(s,u+=2,"data"),u+=4,s.setUint32(u,i,!0),u+=4;var l=new Uint8Array(o);return l.set(new Uint8Array(e),u),l.buffer}};
|
|
123
|
+
/*!
|
|
124
|
+
* h265-player
|
|
125
|
+
* (c) 2020-2024 Lowrie
|
|
126
|
+
* Released under the MIT License.
|
|
127
|
+
*/t.G711U={_base_buffer:[-32124,-31100,-30076,-29052,-28028,-27004,-25980,-24956,-23932,-22908,-21884,-20860,-19836,-18812,-17788,-16764,-15996,-15484,-14972,-14460,-13948,-13436,-12924,-12412,-11900,-11388,-10876,-10364,-9852,-9340,-8828,-8316,-7932,-7676,-7420,-7164,-6908,-6652,-6396,-6140,-5884,-5628,-5372,-5116,-4860,-4604,-4348,-4092,-3900,-3772,-3644,-3516,-3388,-3260,-3132,-3004,-2876,-2748,-2620,-2492,-2364,-2236,-2108,-1980,-1884,-1820,-1756,-1692,-1628,-1564,-1500,-1436,-1372,-1308,-1244,-1180,-1116,-1052,-988,-924,-876,-844,-812,-780,-748,-716,-684,-652,-620,-588,-556,-524,-492,-460,-428,-396,-372,-356,-340,-324,-308,-292,-276,-260,-244,-228,-212,-196,-180,-164,-148,-132,-120,-112,-104,-96,-88,-80,-72,-64,-56,-48,-40,-32,-24,-16,-8,-2,32124,31100,30076,29052,28028,27004,25980,24956,23932,22908,21884,20860,19836,18812,17788,16764,15996,15484,14972,14460,13948,13436,12924,12412,11900,11388,10876,10364,9852,9340,8828,8316,7932,7676,7420,7164,6908,6652,6396,6140,5884,5628,5372,5116,4860,4604,4348,4092,3900,3772,3644,3516,3388,3260,3132,3004,2876,2748,2620,2492,2364,2236,2108,1980,1884,1820,1756,1692,1628,1564,1500,1436,1372,1308,1244,1180,1116,1052,988,924,876,844,812,780,748,716,684,652,620,588,556,524,492,460,428,396,372,356,340,324,308,292,276,260,244,228,212,196,180,164,148,132,120,112,104,96,88,80,72,64,56,48,40,32,24,16,8,2],toPCM:function(e){if(!(e=t.getArrayBuffer(e)))return!1;const r=new Uint8Array(e);for(var n=e.byteLength,i=[],o=0;o<n;o++)i[o]=this._base_buffer[r[o]];return new Int16Array(i).buffer}},t.G711A={_base_buffer:[-5504,-5248,-6016,-5760,-4480,-4224,-4992,-4736,-7552,-7296,-8064,-7808,-6528,-6272,-7040,-6784,-2752,-2624,-3008,-2880,-2240,-2112,-2496,-2368,-3776,-3648,-4032,-3904,-3264,-3136,-3520,-3392,-22016,-20992,-24064,-23040,-17920,-16896,-19968,-18944,-30208,-29184,-32256,-31232,-26112,-25088,-28160,-27136,-11008,-10496,-12032,-11520,-8960,-8448,-9984,-9472,-15104,-14592,-16128,-15616,-13056,-12544,-14080,-13568,-344,-328,-376,-360,-280,-264,-312,-296,-472,-456,-504,-488,-408,-392,-440,-424,-88,-72,-120,-104,-24,-8,-56,-40,-216,-200,-248,-232,-152,-136,-184,-168,-1376,-1312,-1504,-1440,-1120,-1056,-1248,-1184,-1888,-1824,-2016,-1952,-1632,-1568,-1760,-1696,-688,-656,-752,-720,-560,-528,-624,-592,-944,-912,-1008,-976,-816,-784,-880,-848,5504,5248,6016,5760,4480,4224,4992,4736,7552,7296,8064,7808,6528,6272,7040,6784,2752,2624,3008,2880,2240,2112,2496,2368,3776,3648,4032,3904,3264,3136,3520,3392,22016,20992,24064,23040,17920,16896,19968,18944,30208,29184,32256,31232,26112,25088,28160,27136,11008,10496,12032,11520,8960,8448,9984,9472,15104,14592,16128,15616,13056,12544,14080,13568,344,328,376,360,280,264,312,296,472,456,504,488,408,392,440,424,88,72,120,104,24,8,56,40,216,200,248,232,152,136,184,168,1376,1312,1504,1440,1120,1056,1248,1184,1888,1824,2016,1952,1632,1568,1760,1696,688,656,752,720,560,528,624,592,944,912,1008,976,816,784,880,848],toPCM:function(e){if(console.log(e,"array_buffer"),!(e=t.getArrayBuffer(e)))return!1;const r=new Uint8Array(e);for(var n=e.byteLength,i=[],o=0;o<n;o++)i[o]=this._base_buffer[r[o]];return new Int16Array(i).buffer}};var e=t;
|
|
128
|
+
/*!
|
|
129
|
+
* znu-event v0.0.10
|
|
130
|
+
* (c) 2020-2020 chenwuai
|
|
131
|
+
* https://github.com/chenchenwuai/znu-event.git
|
|
132
|
+
* Released under the MIT License.
|
|
133
|
+
*/
|
|
134
|
+
/*! *****************************************************************************
|
|
135
|
+
Copyright (c) Microsoft Corporation.
|
|
136
|
+
|
|
137
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
138
|
+
purpose with or without fee is hereby granted.
|
|
139
|
+
|
|
140
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
141
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
142
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
143
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
144
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
145
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
146
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
147
|
+
***************************************************************************** */function r(e){var t="function"==typeof Symbol&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&"number"==typeof e.length)return{next:function(){return e&&n>=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 n(e,t){var r="function"==typeof Symbol&&e[Symbol.iterator];if(!r)return e;var n,i,o=r.call(e),s=[];try{for(;(void 0===t||t-- >0)&&!(n=o.next()).done;)s.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 s}function i(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(n(arguments[t]));return e}var o=function(){function e(){this._listenersMap={}}return e.prototype.on=function(e,t){return void 0===this._listenersMap[e]&&(this._listenersMap[e]=[]),this._listenersMap[e].push(t),this},e.prototype.once=function(e,t){return t.isOnce=!0,this.on(e,t),this},e.prototype.off=function(e,t){var r=this._listenersMap[e];if(void 0!==r)if(void 0===t)delete this._listenersMap[e];else{var n=r.findIndex((function(e){return e===t}));r.splice(n,1)}return this},e.prototype.offAll=function(){this._listenersMap={}},e.prototype.emit=function(e){for(var t,o,s=[],a=1;a<arguments.length;a++)s[a-1]=arguments[a];var u=this._listenersMap[e];if(void 0!==u&&u.length>0){try{for(var l=r(u.entries()),c=l.next();!c.done;c=l.next()){var h=n(c.value,2),f=h[0],d=h[1];if(d.isOnce){var p=d;u.splice(f,1),p.apply(void 0,i(s))}else d.apply(void 0,i(s))}}catch(e){t={error:e}}finally{try{c&&!c.done&&(o=l.return)&&o.call(l)}finally{if(t)throw t.error}}return!0}return!1},e.prototype.has=function(e){return void 0!==this._listenersMap[e]&&this._listenersMap[e].length>0},e.prototype.eventNames=function(){var e=[];for(var t in this._listenersMap)e.push(t);return e},e.prototype.destroy=function(){this.offAll()},e}();class s{constructor(){this._emitter=new o,this.is_first_get_audio_stream=!0,this.send_stream_audio_info={},this.is_first_send_audio_stream=!0,this.get_stream_audio_info={},this.buffer=[],this.size=0,this.per_buffer_length=1280,this.frame_num_cache=5,this.buffer_cache_size=0,this.audioContext=new(window.AudioContext||window.webkitAudioContext||window.mozAudioContext||window.msAudioContext),this.gRcorder=null,this.is_full_duplex=!0,this.is_talk=!1,this.is_send_noise=!1,this.init()}init(){if(!navigator.getUserMedia)return alert("抱歉您的设备无法语音聊天,请使用现代浏览器,或者检查一下是否是https协议的域名"),!1;this.gRecorder&&(this.gRecorder=null);const e=this;navigator.getUserMedia&&navigator.getUserMedia({audio:!0},(function(t){e.gRecorder=new a(t),e.gRecorder.onaudioprocess=e.send_audio.bind(e),e.startTalk()}),(function(t){console.log("error"),e.$root.appendGlobalErrMsg("对讲初始化过程中发生错误:"+t+",按F12查看详情"),alert("对讲初始化过程中发生错误:"+t+",按F12查看详情")}))}startTalk(){this.gRecorder&&(this.is_first_get_audio_stream=!0,this.is_first_send_audio_stream=!0,this.gRecorder.start())}stopTalk(){this.gRecorder&&(this.gRecorder.stop(),this.is_talk=!1)}changeDuplex(e){this.gRecorder&&(this.is_full_duplex=e)}changeNoise(e){this.gRecorder&&(this.is_send_noise=e)}changeTalk(e){this.gRecorder&&(this.is_talk=e)}send_audio(e,t,r){if(this.is_full_duplex){if(this.is_send_noise){const t=new Array(85).fill(5),r=new Array(85).fill(15),n=new Array(85).fill(45),i=new Array(85).fill(85),o=t.concat(r.concat(n.concat(i)));e=new Uint8Array(o).buffer}}else if(this.is_talk){if(this.is_send_noise){const t=new Array(85).fill(5),r=new Array(85).fill(15),n=new Array(85).fill(45),i=new Array(85).fill(85),o=t.concat(r.concat(n.concat(i)));e=new Uint8Array(o).buffer}}else{const t=e.byteLength;e=new Uint8Array(new Array(t).fill(0))}e?this.is_first_send_audio_stream?(this.send_stream_audio_info=r||this.send_stream_audio_info,this.handelAudio(e,t,this.send_stream_audio_info),this.is_first_send_audio_stream=!1):this.handelAudio(e,t):console.log("send audio error",e.length)}handelAudio(e,t,r){let n;console.log(e,t,r,111111),n=(r=r||null)?new Uint8Array([87,87,0,65,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0]):new Uint8Array([87,87,0,65,0,0,0,0,0,0,0,0,0,0]);const i=n.length+e.byteLength-8;n[4]=i>>24,n[5]=i>>16,n[6]=i>>8,n[7]=i,n[9]=r?1:0;const o=new Float32Array([t]),s=new Uint8Array(o.buffer);if(n.set(s,10),r){const e=new Uint8Array([6,0,0,0,0,0]);e[1]=r.channelNum?r.channelNum>2?1:r.channelNum:1,e[2]=r.bitDepth?r.bitDepth>16?16:r.bitDepth:16;const t=r.sampleRate?r.sampleRate:16e3;e[3]=t>>16,e[4]=t>>8,e[5]=t,n.set(e,14)}const a=this.combine_buffer(n,e);this._emitter.emit("audio_stream",a)}combine_buffer(e,t){e=new Uint8Array(e),t=new Uint8Array(t);const r=new Uint8Array(e.length+t.length);let n=0;for(let i=0;i<e.length;i++)r[n]=e[i],n++;for(let i=0;i<t.length;i++)r[n]=t[i],n++;return r}on(e,t){this._emitter.on(e,t)}off(e,t){this._emitter.off(e,t)}offAll(){this._emitter.offAll()}destroy(){this._emitter.destroy(),this.audioContext&&this.audioContext.close(),this.gRecorder&&(this.gRecorder.stop(),this.gRecorder=null)}}const a=function(t){const r=16,n=8e3,i=1024,o=new AudioContext,s=o.createMediaStreamSource(t),a=o.createScriptProcessor(i,1,1);let u=!0;const l={size:0,buffer:[],inputSampleRate:o.sampleRate,inputSampleBits:16,outputSampleRate:n,oututSampleBits:r,clear:function(){this.buffer=[],this.size=0},input:function(e){if(ArrayBuffer.isView(e))e=e.buffer;else if(!e instanceof ArrayBuffer)return;e=new Uint8Array(e),this.buffer.push(new Uint8Array(e))},getBlob:function(){if(0===this.buffer.length)return;const e=new Blob(this.buffer,{type:"application/octet-stream"}),t=window.URL.createObjectURL(e),r=document.createElement("a");r.href=t,r.download="test.pcm",r.click(),window.URL.revokeObjectURL(e)},compress:function(t){return e.compressSampleRate(t,this.inputSampleRate,this.outputSampleRate)},change_sample_bits:function(t){return e.changeSampleBits(t,this.oututSampleBits)},convert_buffer:function(e){return e=this.compress(e),this.change_sample_bits(e)}};this.start=function(){s.connect(a),a.connect(o.destination),u=!1},this.stop=function(){a.disconnect(),u=!0},this.getBlob=function(){l.getBlob()},this.clear=function(){l.clear()},this.getAudioInfo=function(){return{sampleRate:n,bitDepth:r,channelNum:1}},this.onaudioprocess=function(e,t,r){console.log("recorder.onaudioprocess",e,t,r)};const c=this;a.onaudioprocess=function(e){if(u)return void console.error("is stop");let t=e.inputBuffer.getChannelData(0).buffer;t=l.convert_buffer(t);const i=e.timeStamp,o={sampleRate:n,bitDepth:r,channelNum:1};c.onaudioprocess(t,i,o)}};window&&(window.TalkbackStream=s);var WWAVPlayer=function(){function e(e){var t=this;void 0===e&&(e={}),this.TAG="WWAVPlayer",this._emitter=new ZnuEvent,this._ioctl=null,this._ioctl_talk=null,this._playctl=null,this._videoMedia=null,this._canvasMedia=null,this.TalkStreamPlayer=null,this._config={debug:!1},this._onVisibilityChange=function(){var e=getHiddenProp();t._documentHidden=e,t._playctl&&(t._playctl.documentHidden=e)},this._documentHidden=!1,this.onStream=null,this._config=Object.assign({},this._config,e),this._config.debug&&setLogger(),log("Created WWAVPlayer",JSON.stringify(e));var r=this._playctl=new PlayerController(this._config);r.on(ErrorTypes.MEDIA_ERROR,(function(e,r){var n;null===(n=t._emitter)||void 0===n||n.emit(PlayerEvents.ERROR,ErrorTypes.MEDIA_ERROR,e,r),e===ErrorDetails.MEDIA_INVALID_ELEMENT&&t.destroy()})),r.on(PlayerEvents.PLAY,(function(e){var r;null===(r=t._emitter)||void 0===r||r.emit(PlayerEvents.PLAY,e)})),r.on(PlayerEvents.PAUSE,(function(e){var r;null===(r=t._emitter)||void 0===r||r.emit(PlayerEvents.PAUSE,e)})),r.on(PlayerEvents.MEDIA_INFO,(function(e){var r;null===(r=t._emitter)||void 0===r||r.emit(PlayerEvents.MEDIA_INFO,e)})),document.addEventListener("visibilitychange",this._onVisibilityChange,!1)}return e.prototype.attachVideoElement=function(e,t){var r;if(void 0===t&&(t={}),!(e instanceof HTMLVideoElement))throw error("attachVideoElement need a HTMLVideoElement!"),new RuntimeException("invalid media element");null===(r=this._playctl)||void 0===r||r.attachVideoElement(e,t),this._videoMedia=e},e.prototype.attachCanvasElement=function(e,t){var r;if(void 0===t&&(t={}),!(e instanceof HTMLCanvasElement))throw error("attachCanvasElement need a HTMLCanvasElement!"),new RuntimeException("invalid media element");null===(r=this._playctl)||void 0===r||r.attachCanvasElement(e,t),this._canvasMedia=e},e.prototype.open=function(e,t){var r=this;if(!this._videoMedia&&!this._canvasMedia)throw new RuntimeException("Please attach a HTMLVideoElement or HTMLCanvasElement before open()!");if(!/^wss?:\/\//.test(e))throw new RuntimeException("Please provide a standard WebSocket URL!");var n=this._ioctl=new IOController(e,t);n.on(ErrorTypes.NETWORK_ERROR,(function(e,t){var n;null===(n=r._emitter)||void 0===n||n.emit(PlayerEvents.ERROR,ErrorTypes.NETWORK_ERROR,e,t)})),n.on(IOEvents.IO_STREAM,this._onStream.bind(this))},e.prototype.openTalk=function(e,t){var r=this;if(!this._ioctl_talk){if(!this._videoMedia&&!this._canvasMedia)throw new RuntimeException("Please attach a HTMLVideoElement or HTMLCanvasElement before open()!");if(!/^wss?:\/\//.test(e))throw new RuntimeException("Please provide a standard WebSocket URL!");var n=this._ioctl_talk=new IOController(e,t);n.on(ErrorTypes.TALK_NETWORK_ERROR,(function(e,t){var n;null===(n=r._emitter)||void 0===n||n.emit(PlayerEvents.TALK_ERROR,ErrorTypes.TALK_NETWORK_ERROR,e,t)})),n.on(IOEvents.IO_STREAM,this._onTalkStream.bind(this)),n.on(IOEvents.IO_AUTH_SUCCESS,(function(){var e;null===(e=r._playctl)||void 0===e||e.controlTalk(!0),r.TalkStreamPlayer=new s,r.TalkStreamPlayer.on("audio_stream",(function(e){log("send audio stream",e),n.send(e,!0)}))}))}},e.prototype.play=function(){var e;null===(e=this._playctl)||void 0===e||e.play()},e.prototype.pause=function(){var e;null===(e=this._playctl)||void 0===e||e.pause()},e.prototype.muted=function(e){var t;null===(t=this._playctl)||void 0===t||t.muted(e)},e.prototype.closeTalk=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return null===(e=this._playctl)||void 0===e||e.controlTalk(!1),this.TalkStreamPlayer&&(this.TalkStreamPlayer.destroy(),this.TalkStreamPlayer=null),this._ioctl_talk?[4,this._ioctl_talk.destroy()]:[3,2];case 1:t.sent(),this._ioctl_talk=null,t.label=2;case 2:return[2]}}))}))},e.prototype._onStream=function(e){var t;!this._documentHidden&&e&&(null===(t=this._playctl)||void 0===t||t.receiveBuffer(e),this.onStream&&"function"==typeof this.onStream&&this.onStream(e))},e.prototype._onTalkStream=function(e){var t;!this._documentHidden&&e&&(null===(t=this._playctl)||void 0===t||t.receiveTalkBuffer(e))},e.prototype.on=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.on(e,t)},e.prototype.off=function(e,t){var r;null===(r=this._emitter)||void 0===r||r.off(e,t)},e.prototype.offAll=function(){var e;null===(e=this._emitter)||void 0===e||e.offAll()},e.prototype.destroy=function(){var e;return __awaiter(this,void 0,void 0,(function(){return __generator(this,(function(t){switch(t.label){case 0:return document.removeEventListener("visibilitychange",this._onVisibilityChange,!1),this._ioctl?[4,this._ioctl.destroy()]:[3,2];case 1:t.sent(),t.label=2;case 2:return this._ioctl_talk?[4,this._ioctl_talk.destroy()]:[3,4];case 3:t.sent(),this._ioctl_talk=null,t.label=4;case 4:return this._playctl?[4,this._playctl.destroy()]:[3,6];case 5:t.sent(),t.label=6;case 6:return this.TalkStreamPlayer&&(this.TalkStreamPlayer.destroy(),this.TalkStreamPlayer=null),null===(e=this._emitter)||void 0===e||e.destroy(),this._emitter=null,log("Destoryed WWAVPlayer"),[2]}}))}))},e.isSupported=function(){if(!self.MediaSource)return!1;try{return void 0!==self.Worker&&void 0!==self.WebGLRenderingContext}catch(e){return!1}},e.PlayerEvents=PlayerEvents,e.IOEvents=IOEvents,e.ErrorTypes=ErrorTypes,e.ErrorDetails=ErrorDetails,e}();return WWAVPlayer}))},350:function(e,t,r){"use strict";var n=r(3724),i=r(9297),o=Function.prototype,s=n&&Object.getOwnPropertyDescriptor,a=i(o,"name"),u=a&&"something"===function(){}.name,l=a&&(!n||n&&s(o,"name").configurable);e.exports={EXISTS:a,PROPER:u,CONFIGURABLE:l}},397:function(e,t,r){"use strict";var n=r(7751);e.exports=n("document","documentElement")},421:function(e){"use strict";e.exports={}},435:function(e){"use strict";var t=e.exports={};t.isIE=function(e){function t(){var e=navigator.userAgent.toLowerCase();return-1!==e.indexOf("msie")||-1!==e.indexOf("trident")||-1!==e.indexOf(" edge/")}if(!t())return!1;if(!e)return!0;var r=function(){var e,t=3,r=document.createElement("div"),n=r.getElementsByTagName("i");do{r.innerHTML="\x3c!--[if gt IE "+ ++t+"]><i></i><![endif]--\x3e"}while(n[0]);return t>4?t:e}();return e===r},t.isLegacyOpera=function(){return!!window.opera}},465:function(e,t,r){"use strict";r(4114),r(8111),r(7588);var n=r(6758).forEach;e.exports=function(e){e=e||{};var t=e.reporter,r=e.batchProcessor,i=e.stateHandler.getState,o=(e.stateHandler.hasState,e.idHandler);if(!r)throw new Error("Missing required dependency: batchProcessor");if(!t)throw new Error("Missing required dependency: reporter.");var s=h(),a="erd_scroll_detection_scrollbar_style",u="erd_scroll_detection_container";function l(e){f(e,a,u)}function c(t){var r=e.important?" !important; ":"; ";return(t.join(r)+r).trim()}function h(){var e=500,t=500,r=document.createElement("div");r.style.cssText=c(["position: absolute","width: "+2*e+"px","height: "+2*t+"px","visibility: hidden","margin: 0","padding: 0"]);var n=document.createElement("div");n.style.cssText=c(["position: absolute","width: "+e+"px","height: "+t+"px","overflow: scroll","visibility: none","top: "+3*-e+"px","left: "+3*-t+"px","visibility: hidden","margin: 0","padding: 0"]),n.appendChild(r),document.body.insertBefore(n,document.body.firstChild);var i=e-n.clientWidth,o=t-n.clientHeight;return document.body.removeChild(n),{width:i,height:o}}function f(e,t,r){function n(r,n){n=n||function(t){e.head.appendChild(t)};var i=e.createElement("style");return i.innerHTML=r,i.id=t,n(i),i}if(!e.getElementById(t)){var i=r+"_animation",o=r+"_animation_active",s="/* Created by the element-resize-detector library. */\n";s+="."+r+" > div::-webkit-scrollbar { "+c(["display: none"])+" }\n\n",s+="."+o+" { "+c(["-webkit-animation-duration: 0.1s","animation-duration: 0.1s","-webkit-animation-name: "+i,"animation-name: "+i])+" }\n",s+="@-webkit-keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }\n",s+="@keyframes "+i+" { 0% { opacity: 1; } 50% { opacity: 0; } 100% { opacity: 1; } }",n(s)}}function d(e){e.className+=" "+u+"_animation_active"}function p(e,r,n){if(e.addEventListener)e.addEventListener(r,n);else{if(!e.attachEvent)return t.error("[scroll] Don't know how to add event listeners.");e.attachEvent("on"+r,n)}}function y(e,r,n){if(e.removeEventListener)e.removeEventListener(r,n);else{if(!e.detachEvent)return t.error("[scroll] Don't know how to remove event listeners.");e.detachEvent("on"+r,n)}}function v(e){return i(e).container.childNodes[0].childNodes[0].childNodes[0]}function m(e){return i(e).container.childNodes[0].childNodes[0].childNodes[1]}function g(e,t){var r=i(e).listeners;if(!r.push)throw new Error("Cannot add listener to an element that is not detectable.");i(e).listeners.push(t)}function b(e,a,l){function h(){if(e.debug){var r=Array.prototype.slice.call(arguments);if(r.unshift(o.get(a),"Scroll: "),t.log.apply)t.log.apply(null,r);else for(var n=0;n<r.length;n++)t.log(r[n])}}function f(e){function t(e){var t=e.getRootNode&&e.getRootNode().contains(e);return e===e.ownerDocument.body||e.ownerDocument.body.contains(e)||t}return!t(e)||null===window.getComputedStyle(e)}function y(e){var t=i(e).container.childNodes[0],r=window.getComputedStyle(t);return!r.width||-1===r.width.indexOf("px")}function g(){var e=window.getComputedStyle(a),t={};return t.position=e.position,t.width=a.offsetWidth,t.height=a.offsetHeight,t.top=e.top,t.right=e.right,t.bottom=e.bottom,t.left=e.left,t.widthCSS=e.width,t.heightCSS=e.height,t}function b(){var e=g();i(a).startSize={width:e.width,height:e.height},h("Element start size",i(a).startSize)}function _(){i(a).listeners=[]}function w(){if(h("storeStyle invoked."),i(a)){var e=g();i(a).style=e}else h("Aborting because element has been uninstalled")}function S(e,t,r){i(e).lastWidth=t,i(e).lastHeight=r}function E(e){return v(e).childNodes[0]}function A(){return 2*s.width+1}function k(){return 2*s.height+1}function x(e){return e+10+A()}function R(e){return e+10+k()}function T(e){return 2*e+A()}function C(e){return 2*e+k()}function M(e,t,r){var n=v(e),i=m(e),o=x(t),s=R(r),a=T(t),u=C(r);n.scrollLeft=o,n.scrollTop=s,i.scrollLeft=a,i.scrollTop=u}function P(){var e=i(a).container;if(!e){e=document.createElement("div"),e.className=u,e.style.cssText=c(["visibility: hidden","display: inline","width: 0px","height: 0px","z-index: -1","overflow: hidden","margin: 0","padding: 0"]),i(a).container=e,d(e),a.appendChild(e);var t=function(){i(a).onRendered&&i(a).onRendered()};p(e,"animationstart",t),i(a).onAnimationStart=t}return e}function L(){function r(){var r=i(a).style;if("static"===r.position){a.style.setProperty("position","relative",e.important?"important":"");var n=function(e,t,r,n){function i(e){return e.replace(/[^-\d\.]/g,"")}var o=r[n];"auto"!==o&&"0"!==i(o)&&(e.warn("An element that is positioned static has style."+n+"="+o+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+n+" will be set to 0. Element: ",t),t.style[n]=0)};n(t,a,r,"top"),n(t,a,r,"right"),n(t,a,r,"bottom"),n(t,a,r,"left")}}function n(e,t,r,n){return e=e?e+"px":"0",t=t?t+"px":"0",r=r?r+"px":"0",n=n?n+"px":"0",["left: "+e,"top: "+t,"right: "+n,"bottom: "+r]}if(h("Injecting elements"),i(a)){r();var o=i(a).container;o||(o=P());var l=s.width,f=s.height,d=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden","width: 100%","height: 100%","left: 0px","top: 0px"]),y=c(["position: absolute","flex: none","overflow: hidden","z-index: -1","visibility: hidden"].concat(n(-(1+l),-(1+f),-f,-l))),v=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),m=c(["position: absolute","flex: none","overflow: scroll","z-index: -1","visibility: hidden","width: 100%","height: 100%"]),g=c(["position: absolute","left: 0","top: 0"]),b=c(["position: absolute","width: 200%","height: 200%"]),_=document.createElement("div"),w=document.createElement("div"),S=document.createElement("div"),E=document.createElement("div"),A=document.createElement("div"),k=document.createElement("div");_.dir="ltr",_.style.cssText=d,_.className=u,w.className=u,w.style.cssText=y,S.style.cssText=v,E.style.cssText=g,A.style.cssText=m,k.style.cssText=b,S.appendChild(E),A.appendChild(k),w.appendChild(S),w.appendChild(A),_.appendChild(w),o.appendChild(_),p(S,"scroll",x),p(A,"scroll",R),i(a).onExpandScroll=x,i(a).onShrinkScroll=R}else h("Aborting because element has been uninstalled");function x(){var e=i(a);e&&e.onExpand?e.onExpand():h("Aborting expand scroll handler: element has been uninstalled")}function R(){var e=i(a);e&&e.onShrink?e.onShrink():h("Aborting shrink scroll handler: element has been uninstalled")}}function O(){function s(t,r,n){var i=E(t),o=x(r),s=R(n);i.style.setProperty("width",o+"px",e.important?"important":""),i.style.setProperty("height",s+"px",e.important?"important":"")}function u(n){var u=a.offsetWidth,c=a.offsetHeight,f=u!==i(a).lastWidth||c!==i(a).lastHeight;h("Storing current size",u,c),S(a,u,c),r.add(0,(function(){if(f)if(i(a))if(l()){if(e.debug){var r=a.offsetWidth,n=a.offsetHeight;r===u&&n===c||t.warn(o.get(a),"Scroll: Size changed before updating detector elements.")}s(a,u,c)}else h("Aborting because element container has not been initialized");else h("Aborting because element has been uninstalled")})),r.add(1,(function(){i(a)?l()?M(a,u,c):h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")})),f&&n&&r.add(2,(function(){i(a)?l()?n():h("Aborting because element container has not been initialized"):h("Aborting because element has been uninstalled")}))}function l(){return!!i(a).container}function c(){function e(){return void 0===i(a).lastNotifiedWidth}h("notifyListenersIfNeeded invoked");var t=i(a);return e()&&t.lastWidth===t.startSize.width&&t.lastHeight===t.startSize.height?h("Not notifying: Size is the same as the start size, and there has been no notification yet."):t.lastWidth===t.lastNotifiedWidth&&t.lastHeight===t.lastNotifiedHeight?h("Not notifying: Size already notified"):(h("Current size not notified, notifying..."),t.lastNotifiedWidth=t.lastWidth,t.lastNotifiedHeight=t.lastHeight,void n(i(a).listeners,(function(e){e(a)})))}function f(){if(h("startanimation triggered."),y(a))h("Ignoring since element is still unrendered...");else{h("Element rendered.");var e=v(a),t=m(a);0!==e.scrollLeft&&0!==e.scrollTop&&0!==t.scrollLeft&&0!==t.scrollTop||(h("Scrollbars out of sync. Updating detector elements..."),u(c))}}function d(){h("Scroll detected."),y(a)?h("Scroll event fired while unrendered. Ignoring..."):u(c)}if(h("registerListenersAndPositionElements invoked."),i(a)){i(a).onRendered=f,i(a).onExpand=d,i(a).onShrink=d;var p=i(a).style;s(a,p.width,p.height)}else h("Aborting because element has been uninstalled")}function I(){if(h("finalizeDomMutation invoked."),i(a)){var e=i(a).style;S(a,e.width,e.height),M(a,e.width,e.height)}else h("Aborting because element has been uninstalled")}function B(){l(a)}function D(){h("Installing..."),_(),b(),r.add(0,w),r.add(1,L),r.add(2,O),r.add(3,I),r.add(4,B)}l||(l=a,a=e,e=null),e=e||{},h("Making detectable..."),f(a)?(h("Element is detached"),P(),h("Waiting until element is attached..."),i(a).onRendered=function(){h("Element is now attached"),D()}):D()}function _(e){var t=i(e);t&&(t.onExpandScroll&&y(v(e),"scroll",t.onExpandScroll),t.onShrinkScroll&&y(m(e),"scroll",t.onShrinkScroll),t.onAnimationStart&&y(t.container,"animationstart",t.onAnimationStart),t.container&&e.removeChild(t.container))}return l(window.document),{makeDetectable:b,addListener:g,uninstall:_,initDocument:l}}},616:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")}))},655:function(e,t,r){"use strict";var n=r(6955),i=String;e.exports=function(e){if("Symbol"===n(e))throw new TypeError("Cannot convert a Symbol value to a string");return i(e)}},679:function(e,t,r){"use strict";var n=r(1625),i=TypeError;e.exports=function(e,t){if(n(t,e))return e;throw new i("Incorrect invocation")}},741:function(e){"use strict";var t=Math.ceil,r=Math.floor;e.exports=Math.trunc||function(e){var n=+e;return(n>0?r:t)(n)}},757:function(e,t,r){"use strict";var n=r(7751),i=r(4901),o=r(1625),s=r(7040),a=Object;e.exports=s?function(e){return"symbol"==typeof e}:function(e){var t=n("Symbol");return i(t)&&o(t.prototype,a(e))}},792:function(e,t,r){"use strict";r(4114),t.byteLength=c,t.toByteArray=f,t.fromByteArray=y;for(var n=[],i=[],o="undefined"!==typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],i[s.charCodeAt(a)]=a;function l(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("=");-1===r&&(r=t);var n=r===t?0:4-r%4;return[r,n]}function c(e){var t=l(e),r=t[0],n=t[1];return 3*(r+n)/4-n}function h(e,t,r){return 3*(t+r)/4-r}function f(e){var t,r,n=l(e),s=n[0],a=n[1],u=new o(h(e,s,a)),c=0,f=a>0?s-4:s;for(r=0;r<f;r+=4)t=i[e.charCodeAt(r)]<<18|i[e.charCodeAt(r+1)]<<12|i[e.charCodeAt(r+2)]<<6|i[e.charCodeAt(r+3)],u[c++]=t>>16&255,u[c++]=t>>8&255,u[c++]=255&t;return 2===a&&(t=i[e.charCodeAt(r)]<<2|i[e.charCodeAt(r+1)]>>4,u[c++]=255&t),1===a&&(t=i[e.charCodeAt(r)]<<10|i[e.charCodeAt(r+1)]<<4|i[e.charCodeAt(r+2)]>>2,u[c++]=t>>8&255,u[c++]=255&t),u}function d(e){return n[e>>18&63]+n[e>>12&63]+n[e>>6&63]+n[63&e]}function p(e,t,r){for(var n,i=[],o=t;o<r;o+=3)n=(e[o]<<16&16711680)+(e[o+1]<<8&65280)+(255&e[o+2]),i.push(d(n));return i.join("")}function y(e){for(var t,r=e.length,i=r%3,o=[],s=16383,a=0,u=r-i;a<u;a+=s)o.push(p(e,a,a+s>u?u:a+s));return 1===i?(t=e[r-1],o.push(n[t>>2]+n[t<<4&63]+"==")):2===i&&(t=(e[r-2]<<8)+e[r-1],o.push(n[t>>10]+n[t>>4&63]+n[t<<2&63]+"=")),o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},851:function(e,t,r){"use strict";var n=r(6955),i=r(5966),o=r(4117),s=r(6269),a=r(8227),u=a("iterator");e.exports=function(e){if(!o(e))return i(e,u)||i(e,"@@iterator")||s[n(e)]}},1004:function(e){"use strict";e.exports=function(e){var t=e.stateHandler.getState;function r(e){var r=t(e);return r&&!!r.isDetectable}function n(e){t(e).isDetectable=!0}function i(e){return!!t(e).busy}function o(e,r){t(e).busy=!!r}return{isDetectable:r,markAsDetectable:n,isBusy:i,markBusy:o}}},1072:function(e,t,r){"use strict";var n=r(1828),i=r(8727);e.exports=Object.keys||function(e){return n(e,i)}},1181:function(e,t,r){"use strict";var n,i,o,s=r(8622),a=r(4576),u=r(34),l=r(6699),c=r(9297),h=r(7629),f=r(6119),d=r(421),p="Object already initialized",y=a.TypeError,v=a.WeakMap,m=function(e){return o(e)?i(e):n(e,{})},g=function(e){return function(t){var r;if(!u(t)||(r=i(t)).type!==e)throw new y("Incompatible receiver, "+e+" required");return r}};if(s||h.state){var b=h.state||(h.state=new v);b.get=b.get,b.has=b.has,b.set=b.set,n=function(e,t){if(b.has(e))throw new y(p);return t.facade=e,b.set(e,t),t},i=function(e){return b.get(e)||{}},o=function(e){return b.has(e)}}else{var _=f("state");d[_]=!0,n=function(e,t){if(c(e,_))throw new y(p);return t.facade=e,l(e,_,t),t},i=function(e){return c(e,_)?e[_]:{}},o=function(e){return c(e,_)}}e.exports={set:n,get:i,has:o,enforce:m,getterFor:g}},1291:function(e,t,r){"use strict";var n=r(741);e.exports=function(e){var t=+e;return t!==t||0===t?0:n(t)}},1625:function(e,t,r){"use strict";var n=r(9504);e.exports=n({}.isPrototypeOf)},1701:function(e,t,r){"use strict";var n=r(6518),i=r(9565),o=r(9306),s=r(8551),a=r(1767),u=r(9462),l=r(6319),c=r(9539),h=r(4549),f=r(6395),d=!f&&h("map",TypeError),p=u((function(){var e=this.iterator,t=s(i(this.next,e)),r=this.done=!!t.done;if(!r)return l(e,this.mapper,[t.value,this.counter++],!0)}));n({target:"Iterator",proto:!0,real:!0,forced:f||d},{map:function(e){s(this);try{o(e)}catch(t){c(this,"throw",t)}return d?i(d,this,e):new p(a(this),{mapper:e})}})},1767:function(e){"use strict";e.exports=function(e){return{iterator:e,next:e.next,done:!1}}},1828:function(e,t,r){"use strict";var n=r(9504),i=r(9297),o=r(5397),s=r(9617).indexOf,a=r(421),u=n([].push);e.exports=function(e,t){var r,n=o(e),l=0,c=[];for(r in n)!i(a,r)&&i(n,r)&&u(c,r);while(t.length>l)i(n,r=t[l++])&&(~s(c,r)||u(c,r));return c}},1860:function(e,t,r){"use strict";r(4114);var n=Object.keys||function(e){var t=[];for(var r in e)t.push(r);return t};e.exports=l;var i=r(5322),o=r(4126);r(8392)(l,i);for(var s=n(o.prototype),a=0;a<s.length;a++){var u=s[a];l.prototype[u]||(l.prototype[u]=o.prototype[u])}function l(e){if(!(this instanceof l))return new l(e);i.call(this,e),o.call(this,e),this.allowHalfOpen=!0,e&&(!1===e.readable&&(this.readable=!1),!1===e.writable&&(this.writable=!1),!1===e.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",c)))}function c(){this._writableState.ended||process.nextTick(h,this)}function h(e){e.end()}Object.defineProperty(l.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(l.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(l.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(l.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed&&this._writableState.destroyed)},set:function(e){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=e,this._writableState.destroyed=e)}})},2106:function(e,t,r){"use strict";var n=r(283),i=r(4913);e.exports=function(e,t,r){return r.get&&n(r.get,t,{getter:!0}),r.set&&n(r.set,t,{setter:!0}),i.f(e,t,r)}},2140:function(e,t,r){"use strict";var n=r(8227),i=n("toStringTag"),o={};o[i]="z",e.exports="[object z]"===String(o)},2195:function(e,t,r){"use strict";var n=r(9504),i=n({}.toString),o=n("".slice);e.exports=function(e){return o(i(e),8,-1)}},2211:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype}))},2360:function(e,t,r){"use strict";var n,i=r(8551),o=r(6801),s=r(8727),a=r(421),u=r(397),l=r(4055),c=r(6119),h=">",f="<",d="prototype",p="script",y=c("IE_PROTO"),v=function(){},m=function(e){return f+p+h+e+f+"/"+p+h},g=function(e){e.write(m("")),e.close();var t=e.parentWindow.Object;return e=null,t},b=function(){var e,t=l("iframe"),r="java"+p+":";return t.style.display="none",u.appendChild(t),t.src=String(r),e=t.contentWindow.document,e.open(),e.write(m("document.F=Object")),e.close(),e.F},_=function(){try{n=new ActiveXObject("htmlfile")}catch(t){}_="undefined"!=typeof document?document.domain&&n?g(n):b():g(n);var e=s.length;while(e--)delete _[d][s[e]];return _()};a[y]=!0,e.exports=Object.create||function(e,t){var r;return null!==e?(v[d]=i(e),r=new v,v[d]=null,r[y]=e):r=_(),void 0===t?r:o.f(r,t)}},2432:function(e,t,r){e.exports=o;var n=r(6369).EventEmitter,i=r(8392);function o(){n.call(this)}i(o,n),o.Readable=r(5322),o.Writable=r(4126),o.Duplex=r(1860),o.Transform=r(6692),o.PassThrough=r(7438),o.finished=r(7568),o.pipeline=r(5180),o.Stream=o,o.prototype.pipe=function(e,t){var r=this;function i(t){e.writable&&!1===e.write(t)&&r.pause&&r.pause()}function o(){r.readable&&r.resume&&r.resume()}r.on("data",i),e.on("drain",o),e._isStdio||t&&!1===t.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,e.end())}function u(){s||(s=!0,"function"===typeof e.destroy&&e.destroy())}function l(e){if(c(),0===n.listenerCount(this,"error"))throw e}function c(){r.removeListener("data",i),e.removeListener("drain",o),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",l),e.removeListener("error",l),r.removeListener("end",c),r.removeListener("close",c),e.removeListener("close",c)}return r.on("error",l),e.on("error",l),r.on("end",c),r.on("close",c),e.on("close",c),e.emit("pipe",r),e}},2489:function(e,t,r){"use strict";var n=r(6518),i=r(9565),o=r(9306),s=r(8551),a=r(1767),u=r(9462),l=r(6319),c=r(6395),h=r(9539),f=r(4549),d=!c&&f("filter",TypeError),p=u((function(){var e,t,r,n=this.iterator,o=this.predicate,a=this.next;while(1){if(e=s(i(a,n)),t=this.done=!!e.done,t)return;if(r=e.value,l(n,o,[r,this.counter++],!0))return r}}));n({target:"Iterator",proto:!0,real:!0,forced:c||d},{filter:function(e){s(this);try{o(e)}catch(t){h(this,"throw",t)}return d?i(d,this,e):new p(a(this),{predicate:e})}})},2529:function(e){"use strict";e.exports=function(e,t){return{value:e,done:t}}},2603:function(e,t,r){"use strict";var n=r(655);e.exports=function(e,t){return void 0===e?arguments.length<2?"":t:n(e)}},2652:function(e,t,r){"use strict";var n=r(6080),i=r(9565),o=r(8551),s=r(6823),a=r(4209),u=r(6198),l=r(1625),c=r(81),h=r(851),f=r(9539),d=TypeError,p=function(e,t){this.stopped=e,this.result=t},y=p.prototype;e.exports=function(e,t,r){var v,m,g,b,_,w,S,E=r&&r.that,A=!(!r||!r.AS_ENTRIES),k=!(!r||!r.IS_RECORD),x=!(!r||!r.IS_ITERATOR),R=!(!r||!r.INTERRUPTED),T=n(t,E),C=function(e){return v&&f(v,"normal",e),new p(!0,e)},M=function(e){return A?(o(e),R?T(e[0],e[1],C):T(e[0],e[1])):R?T(e,C):T(e)};if(k)v=e.iterator;else if(x)v=e;else{if(m=h(e),!m)throw new d(s(e)+" is not iterable");if(a(m)){for(g=0,b=u(e);b>g;g++)if(_=M(e[g]),_&&l(y,_))return _;return new p(!1)}v=c(e,m)}w=k?e.next:v.next;while(!(S=i(w,v)).done){try{_=M(S.value)}catch(P){f(v,"throw",P)}if("object"==typeof _&&_&&l(y,_))return _}return new p(!1)}},2777:function(e,t,r){"use strict";var n=r(9565),i=r(34),o=r(757),s=r(5966),a=r(4270),u=r(8227),l=TypeError,c=u("toPrimitive");e.exports=function(e,t){if(!i(e)||o(e))return e;var r,u=s(e,c);if(u){if(void 0===t&&(t="default"),r=n(u,e,t),!i(r)||o(r))return r;throw new l("Can't convert object to primitive value")}return void 0===t&&(t="number"),a(e,t)}},2787:function(e,t,r){"use strict";var n=r(9297),i=r(4901),o=r(8981),s=r(6119),a=r(2211),u=s("IE_PROTO"),l=Object,c=l.prototype;e.exports=a?l.getPrototypeOf:function(e){var t=o(e);if(n(t,u))return t[u];var r=t.constructor;return i(r)&&t instanceof r?r.prototype:t instanceof l?c:null}},2796:function(e,t,r){"use strict";var n=r(9039),i=r(4901),o=/#|\.prototype\./,s=function(e,t){var r=u[a(e)];return r===c||r!==l&&(i(t)?n(t):!!t)},a=s.normalize=function(e){return String(e).replace(o,".").toLowerCase()},u=s.data={},l=s.NATIVE="N",c=s.POLYFILL="P";e.exports=s},2839:function(e,t,r){"use strict";var n=r(4576),i=n.navigator,o=i&&i.userAgent;e.exports=o?String(o):""},2907:function(e,t,r){
|
|
148
|
+
/*! safe-buffer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
|
|
149
|
+
var n=r(7209),i=n.Buffer;function o(e,t){for(var r in e)t[r]=e[r]}function s(e,t,r){return i(e,t,r)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?e.exports=n:(o(n,t),t.Buffer=s),s.prototype=Object.create(i.prototype),o(i,s),s.from=function(e,t,r){if("number"===typeof e)throw new TypeError("Argument must not be a number");return i(e,t,r)},s.alloc=function(e,t,r){if("number"!==typeof e)throw new TypeError("Argument must be a number");var n=i(e);return void 0!==t?"string"===typeof r?n.fill(t,r):n.fill(t):n.fill(0),n},s.allocUnsafe=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return i(e)},s.allocUnsafeSlow=function(e){if("number"!==typeof e)throw new TypeError("Argument must be a number");return n.SlowBuffer(e)}},2967:function(e,t,r){"use strict";var n=r(6706),i=r(34),o=r(7750),s=r(3506);e.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,r={};try{e=n(Object.prototype,"__proto__","set"),e(r,[]),t=r instanceof Array}catch(a){}return function(r,n){return o(r),s(n),i(r)?(t?e(r,n):r.__proto__=n,r):r}}():void 0)},2992:function(e,t,r){"use strict";r(4114),r(8111),r(7588);var n=r(6758).forEach,i=r(1004),o=r(8899),s=r(6167),a=r(9606),u=r(7475),l=r(435),c=r(5916),h=r(3712),f=r(8155),d=r(465);function p(e){return Array.isArray(e)||void 0!==e.length}function y(e){if(Array.isArray(e))return e;var t=[];return n(e,(function(e){t.push(e)})),t}function v(e){return e&&1===e.nodeType}function m(e,t,r){var n=e[t];return void 0!==n&&null!==n||void 0===r?n:r}e.exports=function(e){var t;if(e=e||{},e.idHandler)t={get:function(t){return e.idHandler.get(t,!0)},set:e.idHandler.set};else{var r=s(),g=a({idGenerator:r,stateHandler:h});t=g}var b=e.reporter;if(!b){var _=!1===b;b=u(_)}var w=m(e,"batchProcessor",c({reporter:b})),S={};S.callOnAdd=!!m(e,"callOnAdd",!0),S.debug=!!m(e,"debug",!1);var E,A=o(t),k=i({stateHandler:h}),x=m(e,"strategy","object"),R=m(e,"important",!1),T={reporter:b,batchProcessor:w,stateHandler:h,idHandler:t,important:R};if("scroll"===x&&(l.isLegacyOpera()?(b.warn("Scroll strategy is not supported on legacy Opera. Changing to object strategy."),x="object"):l.isIE(9)&&(b.warn("Scroll strategy is not supported on IE9. Changing to object strategy."),x="object")),"scroll"===x)E=d(T);else{if("object"!==x)throw new Error("Invalid strategy name: "+x);E=f(T)}var C={};function M(e,r,i){function o(e){var t=A.get(e);n(t,(function(t){t(e)}))}function s(e,t,r){A.add(t,r),e&&r(t)}if(i||(i=r,r=e,e={}),!r)throw new Error("At least one element required.");if(!i)throw new Error("Listener required.");if(v(r))r=[r];else{if(!p(r))return b.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");r=y(r)}var a=0,u=m(e,"callOnAdd",S.callOnAdd),l=m(e,"onReady",(function(){})),c=m(e,"debug",S.debug);n(r,(function(e){h.getState(e)||(h.initState(e),t.set(e));var f=t.get(e);if(c&&b.log("Attaching listener to element",f,e),!k.isDetectable(e))return c&&b.log(f,"Not detectable."),k.isBusy(e)?(c&&b.log(f,"System busy making it detectable"),s(u,e,i),C[f]=C[f]||[],void C[f].push((function(){a++,a===r.length&&l()}))):(c&&b.log(f,"Making detectable..."),k.markBusy(e,!0),E.makeDetectable({debug:c,important:R},e,(function(e){if(c&&b.log(f,"onElementDetectable"),h.getState(e)){k.markAsDetectable(e),k.markBusy(e,!1),E.addListener(e,o),s(u,e,i);var t=h.getState(e);if(t&&t.startSize){var d=e.offsetWidth,p=e.offsetHeight;t.startSize.width===d&&t.startSize.height===p||o(e)}C[f]&&n(C[f],(function(e){e()}))}else c&&b.log(f,"Element uninstalled before being detectable.");delete C[f],a++,a===r.length&&l()})));c&&b.log(f,"Already detecable, adding listener."),s(u,e,i),a++})),a===r.length&&l()}function P(e){if(!e)return b.error("At least one element is required.");if(v(e))e=[e];else{if(!p(e))return b.error("Invalid arguments. Must be a DOM element or a collection of DOM elements.");e=y(e)}n(e,(function(e){A.removeAllListeners(e),E.uninstall(e),h.cleanState(e)}))}function L(e){E.initDocument&&E.initDocument(e)}return{listenTo:M,removeListener:A.removeListener,removeAllListeners:A.removeAllListeners,uninstall:P,initDocument:L}}},3143:function(e,t,r){"use strict";var n=r(2907).Buffer,i=n.isEncoding||function(e){switch(e=""+e,e&&e.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function o(e){if(!e)return"utf8";var t;while(1)switch(e){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return e;default:if(t)return;e=(""+e).toLowerCase(),t=!0}}function s(e){var t=o(e);if("string"!==typeof t&&(n.isEncoding===i||!i(e)))throw new Error("Unknown encoding: "+e);return t||e}function a(e){var t;switch(this.encoding=s(e),this.encoding){case"utf16le":this.text=p,this.end=y,t=4;break;case"utf8":this.fillLast=h,t=4;break;case"base64":this.text=v,this.end=m,t=3;break;default:return this.write=g,void(this.end=b)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(t)}function u(e){return e<=127?0:e>>5===6?2:e>>4===14?3:e>>3===30?4:e>>6===2?-1:-2}function l(e,t,r){var n=t.length-1;if(n<r)return 0;var i=u(t[n]);return i>=0?(i>0&&(e.lastNeed=i-1),i):--n<r||-2===i?0:(i=u(t[n]),i>=0?(i>0&&(e.lastNeed=i-2),i):--n<r||-2===i?0:(i=u(t[n]),i>=0?(i>0&&(2===i?i=0:e.lastNeed=i-3),i):0))}function c(e,t,r){if(128!==(192&t[0]))return e.lastNeed=0,"�";if(e.lastNeed>1&&t.length>1){if(128!==(192&t[1]))return e.lastNeed=1,"�";if(e.lastNeed>2&&t.length>2&&128!==(192&t[2]))return e.lastNeed=2,"�"}}function h(e){var t=this.lastTotal-this.lastNeed,r=c(this,e,t);return void 0!==r?r:this.lastNeed<=e.length?(e.copy(this.lastChar,t,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(e.copy(this.lastChar,t,0,e.length),void(this.lastNeed-=e.length))}function f(e,t){var r=l(this,e,t);if(!this.lastNeed)return e.toString("utf8",t);this.lastTotal=r;var n=e.length-(r-this.lastNeed);return e.copy(this.lastChar,0,n),e.toString("utf8",t,n)}function d(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+"�":t}function p(e,t){if((e.length-t)%2===0){var r=e.toString("utf16le",t);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=e[e.length-1],e.toString("utf16le",t,e.length-1)}function y(e){var t=e&&e.length?this.write(e):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return t+this.lastChar.toString("utf16le",0,r)}return t}function v(e,t){var r=(e.length-t)%3;return 0===r?e.toString("base64",t):(this.lastNeed=3-r,this.lastTotal=3,1===r?this.lastChar[0]=e[e.length-1]:(this.lastChar[0]=e[e.length-2],this.lastChar[1]=e[e.length-1]),e.toString("base64",t,e.length-r))}function m(e){var t=e&&e.length?this.write(e):"";return this.lastNeed?t+this.lastChar.toString("base64",0,3-this.lastNeed):t}function g(e){return e.toString(this.encoding)}function b(e){return e&&e.length?this.write(e):""}t.I=a,a.prototype.write=function(e){if(0===e.length)return"";var t,r;if(this.lastNeed){if(t=this.fillLast(e),void 0===t)return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<e.length?t?t+this.text(e,r):this.text(e,r):t||""},a.prototype.end=d,a.prototype.text=f,a.prototype.fillLast=function(e){if(this.lastNeed<=e.length)return e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);e.copy(this.lastChar,this.lastTotal-this.lastNeed,0,e.length),this.lastNeed-=e.length}},3167:function(e,t,r){"use strict";var n=r(4901),i=r(34),o=r(2967);e.exports=function(e,t,r){var s,a;return o&&n(s=t.constructor)&&s!==r&&i(a=s.prototype)&&a!==r.prototype&&o(e,a),e}},3392:function(e,t,r){"use strict";var n=r(9504),i=0,o=Math.random(),s=n(1..toString);e.exports=function(e){return"Symbol("+(void 0===e?"":e)+")_"+s(++i+o,36)}},3503: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;t<arguments.length;t++){var r=null!=arguments[t]?arguments[t]:{};t%2?n(Object(r),!0).forEach((function(t){o(e,t,r[t])})):Object.getOwnPropertyDescriptors?Object.defineProperties(e,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach((function(t){Object.defineProperty(e,t,Object.getOwnPropertyDescriptor(r,t))}))}return e}function o(e,t,r){return t=l(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function s(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function a(e,t){for(var r=0;r<t.length;r++){var n=t[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(e,l(n.key),n)}}function u(e,t,r){return t&&a(e.prototype,t),r&&a(e,r),Object.defineProperty(e,"prototype",{writable:!1}),e}function l(e){var t=c(e,"string");return"symbol"===typeof t?t:String(t)}function c(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}r(4114),r(8111),r(2489),r(7588);var h=r(7209),f=h.Buffer,d=r(5340),p=d.inspect,y=p&&p.custom||"inspect";function v(e,t,r){f.prototype.copy.call(e,t,r)}e.exports=function(){function e(){s(this,e),this.head=null,this.tail=null,this.length=0}return u(e,[{key:"push",value:function(e){var t={data:e,next:null};this.length>0?this.tail.next=t:this.head=t,this.tail=t,++this.length}},{key:"unshift",value:function(e){var t={data:e,next:this.head};0===this.length&&(this.tail=t),this.head=t,++this.length}},{key:"shift",value:function(){if(0!==this.length){var e=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,e}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(e){if(0===this.length)return"";var t=this.head,r=""+t.data;while(t=t.next)r+=e+t.data;return r}},{key:"concat",value:function(e){if(0===this.length)return f.alloc(0);var t=f.allocUnsafe(e>>>0),r=this.head,n=0;while(r)v(r.data,t,n),n+=r.data.length,r=r.next;return t}},{key:"consume",value:function(e,t){var r;return e<this.head.data.length?(r=this.head.data.slice(0,e),this.head.data=this.head.data.slice(e)):r=e===this.head.data.length?this.shift():t?this._getString(e):this._getBuffer(e),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(e){var t=this.head,r=1,n=t.data;e-=n.length;while(t=t.next){var i=t.data,o=e>i.length?i.length:e;if(o===i.length?n+=i:n+=i.slice(0,e),e-=o,0===e){o===i.length?(++r,t.next?this.head=t.next:this.head=this.tail=null):(this.head=t,t.data=i.slice(o));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(e){var t=f.allocUnsafe(e),r=this.head,n=1;r.data.copy(t),e-=r.data.length;while(r=r.next){var i=r.data,o=e>i.length?i.length:e;if(i.copy(t,t.length-e,0,o),e-=o,0===e){o===i.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=i.slice(o));break}++n}return this.length-=n,t}},{key:y,value:function(e,t){return p(this,i(i({},t),{},{depth:0,customInspect:!1}))}}]),e}()},3506:function(e,t,r){"use strict";var n=r(3925),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o("Can't set "+i(e)+" as a prototype")}},3706:function(e,t,r){"use strict";var n=r(9504),i=r(4901),o=r(7629),s=n(Function.toString);i(o.inspectSource)||(o.inspectSource=function(e){return s(e)}),e.exports=o.inspectSource},3712:function(e){"use strict";var t="_erd";function r(e){return e[t]={},n(e)}function n(e){return e[t]}function i(e){delete e[t]}e.exports={initState:r,getState:n,cleanState:i}},3717:function(e,t){"use strict";t.f=Object.getOwnPropertySymbols},3724:function(e,t,r){"use strict";var n=r(9039);e.exports=!n((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},3912:function(e){"use strict";var t=e.exports={};function r(e,t,r){var n=e[t];return void 0!==n&&null!==n||void 0===r?n:r}t.getOption=r},3925:function(e,t,r){"use strict";var n=r(34);e.exports=function(e){return n(e)||null===e}},4055:function(e,t,r){"use strict";var n=r(4576),i=r(34),o=n.document,s=i(o)&&i(o.createElement);e.exports=function(e){return s?o.createElement(e):{}}},4114:function(e,t,r){"use strict";var n=r(6518),i=r(8981),o=r(6198),s=r(4527),a=r(6837),u=r(9039),l=u((function(){return 4294967297!==[].push.call({length:4294967296},1)})),c=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(e){return e instanceof TypeError}},h=l||!c();n({target:"Array",proto:!0,arity:1,forced:h},{push:function(e){var t=i(this),r=o(t),n=arguments.length;a(r+n);for(var u=0;u<n;u++)t[r]=arguments[u],r++;return s(t,r),r}})},4117:function(e){"use strict";e.exports=function(e){return null===e||void 0===e}},4126:function(e,t,r){"use strict";function n(e){var t=this;this.next=null,this.entry=null,this.finish=function(){Z(t,e)}}var i;r(4114),e.exports=R,R.WritableState=x;var o={deprecate:r(4241)},s=r(6275),a=r(7209).Buffer,u=("undefined"!==typeof r.g?r.g:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};function l(e){return a.from(e)}function c(e){return a.isBuffer(e)||e instanceof u}var h,f=r(4218),d=r(4885),p=d.getHighWaterMark,y=r(5842).F,v=y.ERR_INVALID_ARG_TYPE,m=y.ERR_METHOD_NOT_IMPLEMENTED,g=y.ERR_MULTIPLE_CALLBACK,b=y.ERR_STREAM_CANNOT_PIPE,_=y.ERR_STREAM_DESTROYED,w=y.ERR_STREAM_NULL_VALUES,S=y.ERR_STREAM_WRITE_AFTER_END,E=y.ERR_UNKNOWN_ENCODING,A=f.errorOrDestroy;function k(){}function x(e,t,o){i=i||r(1860),e=e||{},"boolean"!==typeof o&&(o=t instanceof i),this.objectMode=!!e.objectMode,o&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=p(this,e,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(e){B(t,e)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new n(this)}function R(e){i=i||r(1860);var t=this instanceof i;if(!t&&!h.call(R,this))return new R(e);this._writableState=new x(e,this,t),this.writable=!0,e&&("function"===typeof e.write&&(this._write=e.write),"function"===typeof e.writev&&(this._writev=e.writev),"function"===typeof e.destroy&&(this._destroy=e.destroy),"function"===typeof e.final&&(this._final=e.final)),s.call(this)}function T(e,t){var r=new S;A(e,r),process.nextTick(t,r)}function C(e,t,r,n){var i;return null===r?i=new w:"string"===typeof r||t.objectMode||(i=new v("chunk",["string","Buffer"],r)),!i||(A(e,i),process.nextTick(n,i),!1)}function M(e,t,r){return e.objectMode||!1===e.decodeStrings||"string"!==typeof t||(t=a.from(t,r)),t}function P(e,t,r,n,i,o){if(!r){var s=M(t,n,i);n!==s&&(r=!0,i="buffer",n=s)}var a=t.objectMode?1:n.length;t.length+=a;var u=t.length<t.highWaterMark;if(u||(t.needDrain=!0),t.writing||t.corked){var l=t.lastBufferedRequest;t.lastBufferedRequest={chunk:n,encoding:i,isBuf:r,callback:o,next:null},l?l.next=t.lastBufferedRequest:t.bufferedRequest=t.lastBufferedRequest,t.bufferedRequestCount+=1}else L(e,t,!1,a,n,i,o);return u}function L(e,t,r,n,i,o,s){t.writelen=n,t.writecb=s,t.writing=!0,t.sync=!0,t.destroyed?t.onwrite(new _("write")):r?e._writev(i,t.onwrite):e._write(i,o,t.onwrite),t.sync=!1}function O(e,t,r,n,i){--t.pendingcb,r?(process.nextTick(i,n),process.nextTick(V,e,t),e._writableState.errorEmitted=!0,A(e,n)):(i(n),e._writableState.errorEmitted=!0,A(e,n),V(e,t))}function I(e){e.writing=!1,e.writecb=null,e.length-=e.writelen,e.writelen=0}function B(e,t){var r=e._writableState,n=r.sync,i=r.writecb;if("function"!==typeof i)throw new g;if(I(r),t)O(e,r,n,t,i);else{var o=F(r)||e.destroyed;o||r.corked||r.bufferProcessing||!r.bufferedRequest||N(e,r),n?process.nextTick(D,e,r,o,i):D(e,r,o,i)}}function D(e,t,r,n){r||U(e,t),t.pendingcb--,n(),V(e,t)}function U(e,t){0===t.length&&t.needDrain&&(t.needDrain=!1,e.emit("drain"))}function N(e,t){t.bufferProcessing=!0;var r=t.bufferedRequest;if(e._writev&&r&&r.next){var i=t.bufferedRequestCount,o=new Array(i),s=t.corkedRequestsFree;s.entry=r;var a=0,u=!0;while(r)o[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;o.allBuffers=u,L(e,t,!0,t.length,o,"",s.finish),t.pendingcb++,t.lastBufferedRequest=null,s.next?(t.corkedRequestsFree=s.next,s.next=null):t.corkedRequestsFree=new n(t),t.bufferedRequestCount=0}else{while(r){var l=r.chunk,c=r.encoding,h=r.callback,f=t.objectMode?1:l.length;if(L(e,t,!1,f,l,c,h),r=r.next,t.bufferedRequestCount--,t.writing)break}null===r&&(t.lastBufferedRequest=null)}t.bufferedRequest=r,t.bufferProcessing=!1}function F(e){return e.ending&&0===e.length&&null===e.bufferedRequest&&!e.finished&&!e.writing}function H(e,t){e._final((function(r){t.pendingcb--,r&&A(e,r),t.prefinished=!0,e.emit("prefinish"),V(e,t)}))}function W(e,t){t.prefinished||t.finalCalled||("function"!==typeof e._final||t.destroyed?(t.prefinished=!0,e.emit("prefinish")):(t.pendingcb++,t.finalCalled=!0,process.nextTick(H,e,t)))}function V(e,t){var r=F(t);if(r&&(W(e,t),0===t.pendingcb&&(t.finished=!0,e.emit("finish"),t.autoDestroy))){var n=e._readableState;(!n||n.autoDestroy&&n.endEmitted)&&e.destroy()}return r}function G(e,t,r){t.ending=!0,V(e,t),r&&(t.finished?process.nextTick(r):e.once("finish",r)),t.ended=!0,e.writable=!1}function Z(e,t,r){var n=e.entry;e.entry=null;while(n){var i=n.callback;t.pendingcb--,i(r),n=n.next}t.corkedRequestsFree.next=e}r(8392)(R,s),x.prototype.getBuffer=function(){var e=this.bufferedRequest,t=[];while(e)t.push(e),e=e.next;return t},function(){try{Object.defineProperty(x.prototype,"buffer",{get:o.deprecate((function(){return this.getBuffer()}),"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(e){}}(),"function"===typeof Symbol&&Symbol.hasInstance&&"function"===typeof Function.prototype[Symbol.hasInstance]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(R,Symbol.hasInstance,{value:function(e){return!!h.call(this,e)||this===R&&(e&&e._writableState instanceof x)}})):h=function(e){return e instanceof this},R.prototype.pipe=function(){A(this,new b)},R.prototype.write=function(e,t,r){var n=this._writableState,i=!1,o=!n.objectMode&&c(e);return o&&!a.isBuffer(e)&&(e=l(e)),"function"===typeof t&&(r=t,t=null),o?t="buffer":t||(t=n.defaultEncoding),"function"!==typeof r&&(r=k),n.ending?T(this,r):(o||C(this,n,e,r))&&(n.pendingcb++,i=P(this,n,o,e,t,r)),i},R.prototype.cork=function(){this._writableState.corked++},R.prototype.uncork=function(){var e=this._writableState;e.corked&&(e.corked--,e.writing||e.corked||e.bufferProcessing||!e.bufferedRequest||N(this,e))},R.prototype.setDefaultEncoding=function(e){if("string"===typeof e&&(e=e.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((e+"").toLowerCase())>-1))throw new E(e);return this._writableState.defaultEncoding=e,this},Object.defineProperty(R.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(R.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),R.prototype._write=function(e,t,r){r(new m("_write()"))},R.prototype._writev=null,R.prototype.end=function(e,t,r){var n=this._writableState;return"function"===typeof e?(r=e,e=null,t=null):"function"===typeof t&&(r=t,t=null),null!==e&&void 0!==e&&this.write(e,t),n.corked&&(n.corked=1,this.uncork()),n.ending||G(this,n,r),this},Object.defineProperty(R.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(R.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(e){this._writableState&&(this._writableState.destroyed=e)}}),R.prototype.destroy=f.destroy,R.prototype._undestroy=f.undestroy,R.prototype._destroy=function(e,t){t(e)}},4209:function(e,t,r){"use strict";var n=r(8227),i=r(6269),o=n("iterator"),s=Array.prototype;e.exports=function(e){return void 0!==e&&(i.Array===e||s[o]===e)}},4218:function(e){"use strict";function t(e,t){var i=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(t?t(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,process.nextTick(o,this,e)):process.nextTick(o,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,(function(e){!t&&e?i._writableState?i._writableState.errorEmitted?process.nextTick(n,i):(i._writableState.errorEmitted=!0,process.nextTick(r,i,e)):process.nextTick(r,i,e):t?(process.nextTick(n,i),t(e)):process.nextTick(n,i)})),this)}function r(e,t){o(e,t),n(e)}function n(e){e._writableState&&!e._writableState.emitClose||e._readableState&&!e._readableState.emitClose||e.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function o(e,t){e.emit("error",t)}function s(e,t){var r=e._readableState,n=e._writableState;r&&r.autoDestroy||n&&n.autoDestroy?e.destroy(t):e.emit("error",t)}e.exports={destroy:t,undestroy:i,errorOrDestroy:s}},4241:function(e,t,r){function n(e,t){if(i("noDeprecation"))return e;var r=!1;function n(){if(!r){if(i("throwDeprecation"))throw new Error(t);i("traceDeprecation")?console.trace(t):console.warn(t),r=!0}return e.apply(this,arguments)}return n}function i(e){try{if(!r.g.localStorage)return!1}catch(n){return!1}var t=r.g.localStorage[e];return null!=t&&"true"===String(t).toLowerCase()}e.exports=n},4270:function(e,t,r){"use strict";var n=r(9565),i=r(4901),o=r(34),s=TypeError;e.exports=function(e,t){var r,a;if("string"===t&&i(r=e.toString)&&!o(a=n(r,e)))return a;if(i(r=e.valueOf)&&!o(a=n(r,e)))return a;if("string"!==t&&i(r=e.toString)&&!o(a=n(r,e)))return a;throw new s("Can't convert object to primitive value")}},4376:function(e,t,r){"use strict";var n=r(2195);e.exports=Array.isArray||function(e){return"Array"===n(e)}},4495:function(e,t,r){"use strict";var n=r(9519),i=r(9039),o=r(4576),s=o.String;e.exports=!!Object.getOwnPropertySymbols&&!i((function(){var e=Symbol("symbol detection");return!s(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&n&&n<41}))},4527:function(e,t,r){"use strict";var n=r(3724),i=r(4376),o=TypeError,s=Object.getOwnPropertyDescriptor,a=n&&!function(){if(void 0!==this)return!0;try{Object.defineProperty([],"length",{writable:!1}).length=1}catch(e){return e instanceof TypeError}}();e.exports=a?function(e,t){if(i(e)&&!s(e,"length").writable)throw new o("Cannot set read only .length");return e.length=t}:function(e,t){return e.length=t}},4549:function(e,t,r){"use strict";var n=r(4576);e.exports=function(e,t){var r=n.Iterator,i=r&&r.prototype,o=i&&i[e],s=!1;if(o)try{o.call({next:function(){return{done:!0}},return:function(){s=!0}},-1)}catch(a){a instanceof t||(s=!1)}if(!s)return o}},4576:function(e,t,r){"use strict";var n=function(e){return e&&e.Math===Math&&e};e.exports=n("object"==typeof globalThis&&globalThis)||n("object"==typeof window&&window)||n("object"==typeof self&&self)||n("object"==typeof r.g&&r.g)||n("object"==typeof this&&this)||function(){return this}()||Function("return this")()},4659:function(e,t,r){"use strict";var n=r(3724),i=r(4913),o=r(6980);e.exports=function(e,t,r){n?i.f(e,t,o(0,r)):e[t]=r}},4835:function(e){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},4885:function(e,t,r){"use strict";var n=r(5842).F.ERR_INVALID_OPT_VALUE;function i(e,t,r){return null!=e.highWaterMark?e.highWaterMark:t?e[r]:null}function o(e,t,r,o){var s=i(t,o,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0){var a=o?r:"highWaterMark";throw new n(a,s)}return Math.floor(s)}return e.objectMode?16:16384}e.exports={getHighWaterMark:o}},4901:function(e){"use strict";var t="object"==typeof document&&document.all;e.exports="undefined"==typeof t&&void 0!==t?function(e){return"function"==typeof e||e===t}:function(e){return"function"==typeof e}},4913:function(e,t,r){"use strict";var n=r(3724),i=r(5917),o=r(8686),s=r(8551),a=r(6969),u=TypeError,l=Object.defineProperty,c=Object.getOwnPropertyDescriptor,h="enumerable",f="configurable",d="writable";t.f=n?o?function(e,t,r){if(s(e),t=a(t),s(r),"function"===typeof e&&"prototype"===t&&"value"in r&&d in r&&!r[d]){var n=c(e,t);n&&n[d]&&(e[t]=r.value,r={configurable:f in r?r[f]:n[f],enumerable:h in r?r[h]:n[h],writable:!1})}return l(e,t,r)}:l:function(e,t,r){if(s(e),t=a(t),s(r),i)try{return l(e,t,r)}catch(n){}if("get"in r||"set"in r)throw new u("Accessors not supported");return"value"in r&&(e[t]=r.value),e}},4979:function(e,t,r){"use strict";var n=r(6518),i=r(4576),o=r(7751),s=r(6980),a=r(4913).f,u=r(9297),l=r(679),c=r(3167),h=r(2603),f=r(5002),d=r(6193),p=r(3724),y=r(6395),v="DOMException",m=o("Error"),g=o(v),b=function(){l(this,_);var e=arguments.length,t=h(e<1?void 0:arguments[0]),r=h(e<2?void 0:arguments[1],"Error"),n=new g(t,r),i=new m(t);return i.name=v,a(n,"stack",s(1,d(i.stack,1))),c(n,this,b),n},_=b.prototype=g.prototype,w="stack"in new m(v),S="stack"in new g(1,2),E=g&&p&&Object.getOwnPropertyDescriptor(i,v),A=!!E&&!(E.writable&&E.configurable),k=w&&!A&&!S;n({global:!0,constructor:!0,forced:y||k},{DOMException:k?b:g});var x=o(v),R=x.prototype;if(R.constructor!==x)for(var T in y||a(R,"constructor",s(1,x)),f)if(u(f,T)){var C=f[T],M=C.s;u(x,M)||a(x,M,s(6,C.c))}},5002:function(e){"use strict";e.exports={IndexSizeError:{s:"INDEX_SIZE_ERR",c:1,m:1},DOMStringSizeError:{s:"DOMSTRING_SIZE_ERR",c:2,m:0},HierarchyRequestError:{s:"HIERARCHY_REQUEST_ERR",c:3,m:1},WrongDocumentError:{s:"WRONG_DOCUMENT_ERR",c:4,m:1},InvalidCharacterError:{s:"INVALID_CHARACTER_ERR",c:5,m:1},NoDataAllowedError:{s:"NO_DATA_ALLOWED_ERR",c:6,m:0},NoModificationAllowedError:{s:"NO_MODIFICATION_ALLOWED_ERR",c:7,m:1},NotFoundError:{s:"NOT_FOUND_ERR",c:8,m:1},NotSupportedError:{s:"NOT_SUPPORTED_ERR",c:9,m:1},InUseAttributeError:{s:"INUSE_ATTRIBUTE_ERR",c:10,m:1},InvalidStateError:{s:"INVALID_STATE_ERR",c:11,m:1},SyntaxError:{s:"SYNTAX_ERR",c:12,m:1},InvalidModificationError:{s:"INVALID_MODIFICATION_ERR",c:13,m:1},NamespaceError:{s:"NAMESPACE_ERR",c:14,m:1},InvalidAccessError:{s:"INVALID_ACCESS_ERR",c:15,m:1},ValidationError:{s:"VALIDATION_ERR",c:16,m:0},TypeMismatchError:{s:"TYPE_MISMATCH_ERR",c:17,m:1},SecurityError:{s:"SECURITY_ERR",c:18,m:1},NetworkError:{s:"NETWORK_ERR",c:19,m:1},AbortError:{s:"ABORT_ERR",c:20,m:1},URLMismatchError:{s:"URL_MISMATCH_ERR",c:21,m:1},QuotaExceededError:{s:"QUOTA_EXCEEDED_ERR",c:22,m:1},TimeoutError:{s:"TIMEOUT_ERR",c:23,m:1},InvalidNodeTypeError:{s:"INVALID_NODE_TYPE_ERR",c:24,m:1},DataCloneError:{s:"DATA_CLONE_ERR",c:25,m:1}}},5031:function(e,t,r){"use strict";var n=r(7751),i=r(9504),o=r(8480),s=r(3717),a=r(8551),u=i([].concat);e.exports=n("Reflect","ownKeys")||function(e){var t=o.f(a(e)),r=s.f;return r?u(t,r(e)):t}},5180:function(e,t,r){"use strict";var n;function i(e){var t=!1;return function(){t||(t=!0,e.apply(void 0,arguments))}}r(8111),r(7588),r(1701),r(8237);var o=r(5842).F,s=o.ERR_MISSING_ARGS,a=o.ERR_STREAM_DESTROYED;function u(e){if(e)throw e}function l(e){return e.setHeader&&"function"===typeof e.abort}function c(e,t,o,s){s=i(s);var u=!1;e.on("close",(function(){u=!0})),void 0===n&&(n=r(7568)),n(e,{readable:t,writable:o},(function(e){if(e)return s(e);u=!0,s()}));var c=!1;return function(t){if(!u&&!c)return c=!0,l(e)?e.abort():"function"===typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}function h(e){e()}function f(e,t){return e.pipe(t)}function d(e){return e.length?"function"!==typeof e[e.length-1]?u:e.pop():u}function p(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var n,i=d(t);if(Array.isArray(t[0])&&(t=t[0]),t.length<2)throw new s("streams");var o=t.map((function(e,r){var s=r<t.length-1,a=r>0;return c(e,s,a,(function(e){n||(n=e),e&&o.forEach(h),s||(o.forEach(h),i(n))}))}));return t.reduce(f)}e.exports=p},5322:function(e,t,r){"use strict";var n;r(4114),e.exports=T,T.ReadableState=R;r(6369).EventEmitter;var i=function(e,t){return e.listeners(t).length},o=r(6275),s=r(7209).Buffer,a=("undefined"!==typeof r.g?r.g:"undefined"!==typeof window?window:"undefined"!==typeof self?self:{}).Uint8Array||function(){};function u(e){return s.from(e)}function l(e){return s.isBuffer(e)||e instanceof a}var c,h=r(9838);c=h&&h.debuglog?h.debuglog("stream"):function(){};var f,d,p,y=r(3503),v=r(4218),m=r(4885),g=m.getHighWaterMark,b=r(5842).F,_=b.ERR_INVALID_ARG_TYPE,w=b.ERR_STREAM_PUSH_AFTER_EOF,S=b.ERR_METHOD_NOT_IMPLEMENTED,E=b.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;r(8392)(T,o);var A=v.errorOrDestroy,k=["error","close","destroy","pause","resume"];function x(e,t,r){if("function"===typeof e.prependListener)return e.prependListener(t,r);e._events&&e._events[t]?Array.isArray(e._events[t])?e._events[t].unshift(r):e._events[t]=[r,e._events[t]]:e.on(t,r)}function R(e,t,i){n=n||r(1860),e=e||{},"boolean"!==typeof i&&(i=t instanceof n),this.objectMode=!!e.objectMode,i&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=g(this,e,"readableHighWaterMark",i),this.buffer=new y,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(f||(f=r(3143).I),this.decoder=new f(e.encoding),this.encoding=e.encoding)}function T(e){if(n=n||r(1860),!(this instanceof T))return new T(e);var t=this instanceof n;this._readableState=new R(e,this,t),this.readable=!0,e&&("function"===typeof e.read&&(this._read=e.read),"function"===typeof e.destroy&&(this._destroy=e.destroy)),o.call(this)}function C(e,t,r,n,i){c("readableAddChunk",t);var o,a=e._readableState;if(null===t)a.reading=!1,B(e,a);else if(i||(o=P(a,t)),o)A(e,o);else if(a.objectMode||t&&t.length>0)if("string"===typeof t||a.objectMode||Object.getPrototypeOf(t)===s.prototype||(t=u(t)),n)a.endEmitted?A(e,new E):M(e,a,t,!0);else if(a.ended)A(e,new w);else{if(a.destroyed)return!1;a.reading=!1,a.decoder&&!r?(t=a.decoder.write(t),a.objectMode||0!==t.length?M(e,a,t,!1):N(e,a)):M(e,a,t,!1)}else n||(a.reading=!1,N(e,a));return!a.ended&&(a.length<a.highWaterMark||0===a.length)}function M(e,t,r,n){t.flowing&&0===t.length&&!t.sync?(t.awaitDrain=0,e.emit("data",r)):(t.length+=t.objectMode?1:r.length,n?t.buffer.unshift(r):t.buffer.push(r),t.needReadable&&D(e)),N(e,t)}function P(e,t){var r;return l(t)||"string"===typeof t||void 0===t||e.objectMode||(r=new _("chunk",["string","Buffer","Uint8Array"],t)),r}Object.defineProperty(T.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(e){this._readableState&&(this._readableState.destroyed=e)}}),T.prototype.destroy=v.destroy,T.prototype._undestroy=v.undestroy,T.prototype._destroy=function(e,t){t(e)},T.prototype.push=function(e,t){var r,n=this._readableState;return n.objectMode?r=!0:"string"===typeof e&&(t=t||n.defaultEncoding,t!==n.encoding&&(e=s.from(e,t),t=""),r=!0),C(this,e,t,!1,r)},T.prototype.unshift=function(e){return C(this,e,null,!0,!1)},T.prototype.isPaused=function(){return!1===this._readableState.flowing},T.prototype.setEncoding=function(e){f||(f=r(3143).I);var t=new f(e);this._readableState.decoder=t,this._readableState.encoding=this._readableState.decoder.encoding;var n=this._readableState.buffer.head,i="";while(null!==n)i+=t.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var L=1073741824;function O(e){return e>=L?e=L:(e--,e|=e>>>1,e|=e>>>2,e|=e>>>4,e|=e>>>8,e|=e>>>16,e++),e}function I(e,t){return e<=0||0===t.length&&t.ended?0:t.objectMode?1:e!==e?t.flowing&&t.length?t.buffer.head.data.length:t.length:(e>t.highWaterMark&&(t.highWaterMark=O(e)),e<=t.length?e:t.ended?t.length:(t.needReadable=!0,0))}function B(e,t){if(c("onEofChunk"),!t.ended){if(t.decoder){var r=t.decoder.end();r&&r.length&&(t.buffer.push(r),t.length+=t.objectMode?1:r.length)}t.ended=!0,t.sync?D(e):(t.needReadable=!1,t.emittedReadable||(t.emittedReadable=!0,U(e)))}}function D(e){var t=e._readableState;c("emitReadable",t.needReadable,t.emittedReadable),t.needReadable=!1,t.emittedReadable||(c("emitReadable",t.flowing),t.emittedReadable=!0,process.nextTick(U,e))}function U(e){var t=e._readableState;c("emitReadable_",t.destroyed,t.length,t.ended),t.destroyed||!t.length&&!t.ended||(e.emit("readable"),t.emittedReadable=!1),t.needReadable=!t.flowing&&!t.ended&&t.length<=t.highWaterMark,j(e)}function N(e,t){t.readingMore||(t.readingMore=!0,process.nextTick(F,e,t))}function F(e,t){while(!t.reading&&!t.ended&&(t.length<t.highWaterMark||t.flowing&&0===t.length)){var r=t.length;if(c("maybeReadMore read 0"),e.read(0),r===t.length)break}t.readingMore=!1}function H(e){return function(){var t=e._readableState;c("pipeOnDrain",t.awaitDrain),t.awaitDrain&&t.awaitDrain--,0===t.awaitDrain&&i(e,"data")&&(t.flowing=!0,j(e))}}function W(e){var t=e._readableState;t.readableListening=e.listenerCount("readable")>0,t.resumeScheduled&&!t.paused?t.flowing=!0:e.listenerCount("data")>0&&e.resume()}function V(e){c("readable nexttick read 0"),e.read(0)}function G(e,t){t.resumeScheduled||(t.resumeScheduled=!0,process.nextTick(Z,e,t))}function Z(e,t){c("resume",t.reading),t.reading||e.read(0),t.resumeScheduled=!1,e.emit("resume"),j(e),t.flowing&&!t.reading&&e.read(0)}function j(e){var t=e._readableState;c("flow",t.flowing);while(t.flowing&&null!==e.read());}function z(e,t){return 0===t.length?null:(t.objectMode?r=t.buffer.shift():!e||e>=t.length?(r=t.decoder?t.buffer.join(""):1===t.buffer.length?t.buffer.first():t.buffer.concat(t.length),t.buffer.clear()):r=t.buffer.consume(e,t.decoder),r);var r}function X(e){var t=e._readableState;c("endReadable",t.endEmitted),t.endEmitted||(t.ended=!0,process.nextTick(Y,t,e))}function Y(e,t){if(c("endReadableNT",e.endEmitted,e.length),!e.endEmitted&&0===e.length&&(e.endEmitted=!0,t.readable=!1,t.emit("end"),e.autoDestroy)){var r=t._writableState;(!r||r.autoDestroy&&r.finished)&&t.destroy()}}function q(e,t){for(var r=0,n=e.length;r<n;r++)if(e[r]===t)return r;return-1}T.prototype.read=function(e){c("read",e),e=parseInt(e,10);var t=this._readableState,r=e;if(0!==e&&(t.emittedReadable=!1),0===e&&t.needReadable&&((0!==t.highWaterMark?t.length>=t.highWaterMark:t.length>0)||t.ended))return c("read: emitReadable",t.length,t.ended),0===t.length&&t.ended?X(this):D(this),null;if(e=I(e,t),0===e&&t.ended)return 0===t.length&&X(this),null;var n,i=t.needReadable;return c("need readable",i),(0===t.length||t.length-e<t.highWaterMark)&&(i=!0,c("length less than watermark",i)),t.ended||t.reading?(i=!1,c("reading or ended",i)):i&&(c("do read"),t.reading=!0,t.sync=!0,0===t.length&&(t.needReadable=!0),this._read(t.highWaterMark),t.sync=!1,t.reading||(e=I(r,t))),n=e>0?z(e,t):null,null===n?(t.needReadable=t.length<=t.highWaterMark,e=0):(t.length-=e,t.awaitDrain=0),0===t.length&&(t.ended||(t.needReadable=!0),r!==e&&t.ended&&X(this)),null!==n&&this.emit("data",n),n},T.prototype._read=function(e){A(this,new S("_read()"))},T.prototype.pipe=function(e,t){var r=this,n=this._readableState;switch(n.pipesCount){case 0:n.pipes=e;break;case 1:n.pipes=[n.pipes,e];break;default:n.pipes.push(e);break}n.pipesCount+=1,c("pipe count=%d opts=%j",n.pipesCount,t);var o=(!t||!1!==t.end)&&e!==process.stdout&&e!==process.stderr,s=o?u:m;function a(e,t){c("onunpipe"),e===r&&t&&!1===t.hasUnpiped&&(t.hasUnpiped=!0,f())}function u(){c("onend"),e.end()}n.endEmitted?process.nextTick(s):r.once("end",s),e.on("unpipe",a);var l=H(r);e.on("drain",l);var h=!1;function f(){c("cleanup"),e.removeListener("close",y),e.removeListener("finish",v),e.removeListener("drain",l),e.removeListener("error",p),e.removeListener("unpipe",a),r.removeListener("end",u),r.removeListener("end",m),r.removeListener("data",d),h=!0,!n.awaitDrain||e._writableState&&!e._writableState.needDrain||l()}function d(t){c("ondata");var i=e.write(t);c("dest.write",i),!1===i&&((1===n.pipesCount&&n.pipes===e||n.pipesCount>1&&-1!==q(n.pipes,e))&&!h&&(c("false write response, pause",n.awaitDrain),n.awaitDrain++),r.pause())}function p(t){c("onerror",t),m(),e.removeListener("error",p),0===i(e,"error")&&A(e,t)}function y(){e.removeListener("finish",v),m()}function v(){c("onfinish"),e.removeListener("close",y),m()}function m(){c("unpipe"),r.unpipe(e)}return r.on("data",d),x(e,"error",p),e.once("close",y),e.once("finish",v),e.emit("pipe",r),n.flowing||(c("pipe resume"),r.resume()),e},T.prototype.unpipe=function(e){var t=this._readableState,r={hasUnpiped:!1};if(0===t.pipesCount)return this;if(1===t.pipesCount)return e&&e!==t.pipes||(e||(e=t.pipes),t.pipes=null,t.pipesCount=0,t.flowing=!1,e&&e.emit("unpipe",this,r)),this;if(!e){var n=t.pipes,i=t.pipesCount;t.pipes=null,t.pipesCount=0,t.flowing=!1;for(var o=0;o<i;o++)n[o].emit("unpipe",this,{hasUnpiped:!1});return this}var s=q(t.pipes,e);return-1===s||(t.pipes.splice(s,1),t.pipesCount-=1,1===t.pipesCount&&(t.pipes=t.pipes[0]),e.emit("unpipe",this,r)),this},T.prototype.on=function(e,t){var r=o.prototype.on.call(this,e,t),n=this._readableState;return"data"===e?(n.readableListening=this.listenerCount("readable")>0,!1!==n.flowing&&this.resume()):"readable"===e&&(n.endEmitted||n.readableListening||(n.readableListening=n.needReadable=!0,n.flowing=!1,n.emittedReadable=!1,c("on readable",n.length,n.reading),n.length?D(this):n.reading||process.nextTick(V,this))),r},T.prototype.addListener=T.prototype.on,T.prototype.removeListener=function(e,t){var r=o.prototype.removeListener.call(this,e,t);return"readable"===e&&process.nextTick(W,this),r},T.prototype.removeAllListeners=function(e){var t=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==e&&void 0!==e||process.nextTick(W,this),t},T.prototype.resume=function(){var e=this._readableState;return e.flowing||(c("resume"),e.flowing=!e.readableListening,G(this,e)),e.paused=!1,this},T.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},T.prototype.wrap=function(e){var t=this,r=this._readableState,n=!1;for(var i in e.on("end",(function(){if(c("wrapped end"),r.decoder&&!r.ended){var e=r.decoder.end();e&&e.length&&t.push(e)}t.push(null)})),e.on("data",(function(i){if(c("wrapped data"),r.decoder&&(i=r.decoder.write(i)),(!r.objectMode||null!==i&&void 0!==i)&&(r.objectMode||i&&i.length)){var o=t.push(i);o||(n=!0,e.pause())}})),e)void 0===this[i]&&"function"===typeof e[i]&&(this[i]=function(t){return function(){return e[t].apply(e,arguments)}}(i));for(var o=0;o<k.length;o++)e.on(k[o],this.emit.bind(this,k[o]));return this._read=function(t){c("wrapped _read",t),n&&(n=!1,e.resume())},this},"function"===typeof Symbol&&(T.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=r(6225)),d(this)}),Object.defineProperty(T.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(T.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(T.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(e){this._readableState&&(this._readableState.flowing=e)}}),T._fromList=z,Object.defineProperty(T.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"===typeof Symbol&&(T.from=function(e,t){return void 0===p&&(p=r(4835)),p(T,e,t)})},5340:function(){},5397:function(e,t,r){"use strict";var n=r(7055),i=r(7750);e.exports=function(e){return n(i(e))}},5610:function(e,t,r){"use strict";var n=r(1291),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)}},5745:function(e,t,r){"use strict";var n=r(7629);e.exports=function(e,t){return n[e]||(n[e]=t||{})}},5842:function(e,t,r){"use strict";function n(e,t){e.prototype=Object.create(t.prototype),e.prototype.constructor=e,e.__proto__=t}r(8111),r(1701);var i={};function o(e,t,r){function o(e,r,n){return"string"===typeof t?t:t(e,r,n)}r||(r=Error);var s=function(e){function t(t,r,n){return e.call(this,o(t,r,n))||this}return n(t,e),t}(r);s.prototype.name=r.name,s.prototype.code=e,i[e]=s}function s(e,t){if(Array.isArray(e)){var r=e.length;return e=e.map((function(e){return String(e)})),r>2?"one of ".concat(t," ").concat(e.slice(0,r-1).join(", "),", or ")+e[r-1]:2===r?"one of ".concat(t," ").concat(e[0]," or ").concat(e[1]):"of ".concat(t," ").concat(e[0])}return"of ".concat(t," ").concat(String(e))}function a(e,t,r){return e.substr(!r||r<0?0:+r,t.length)===t}function u(e,t,r){return(void 0===r||r>e.length)&&(r=e.length),e.substring(r-t.length,r)===t}function l(e,t,r){return"number"!==typeof r&&(r=0),!(r+t.length>e.length)&&-1!==e.indexOf(t,r)}o("ERR_INVALID_OPT_VALUE",(function(e,t){return'The value "'+t+'" is invalid for option "'+e+'"'}),TypeError),o("ERR_INVALID_ARG_TYPE",(function(e,t,r){var n,i;if("string"===typeof t&&a(t,"not ")?(n="must not be",t=t.replace(/^not /,"")):n="must be",u(e," argument"))i="The ".concat(e," ").concat(n," ").concat(s(t,"type"));else{var o=l(e,".")?"property":"argument";i='The "'.concat(e,'" ').concat(o," ").concat(n," ").concat(s(t,"type"))}return i+=". Received type ".concat(typeof r),i}),TypeError),o("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),o("ERR_METHOD_NOT_IMPLEMENTED",(function(e){return"The "+e+" method is not implemented"})),o("ERR_STREAM_PREMATURE_CLOSE","Premature close"),o("ERR_STREAM_DESTROYED",(function(e){return"Cannot call "+e+" after a stream was destroyed"})),o("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),o("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),o("ERR_STREAM_WRITE_AFTER_END","write after end"),o("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),o("ERR_UNKNOWN_ENCODING",(function(e){return"Unknown encoding: "+e}),TypeError),o("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.F=i},5916:function(e,t,r){"use strict";r(4114);var n=r(3912);function i(){var e={},t=0,r=0,n=0;function i(i,o){o||(o=i,i=0),i>r?r=i:i<n&&(n=i),e[i]||(e[i]=[]),e[i].push(o),t++}function o(){for(var t=n;t<=r;t++)for(var i=e[t],o=0;o<i.length;o++){var s=i[o];s()}}function s(){return t}return{add:i,process:o,size:s}}e.exports=function(e){e=e||{};var t=e.reporter,r=n.getOption(e,"async",!0),o=n.getOption(e,"auto",!0);o&&!r&&(t&&t.warn("Invalid options combination. auto=true and async=false is invalid. Setting async=true."),r=!0);var s,a=i(),u=!1;function l(e,t){!u&&o&&r&&0===a.size()&&f(),a.add(e,t)}function c(){u=!0;while(a.size()){var e=a;a=i(),e.process()}u=!1}function h(e){u||(void 0===e&&(e=r),s&&(d(s),s=null),e?f():c())}function f(){s=p(c)}function d(e){var t=clearTimeout;return t(e)}function p(e){var t=function(e){return setTimeout(e,0)};return t(e)}return{add:l,force:h}}},5917:function(e,t,r){"use strict";var n=r(3724),i=r(9039),o=r(4055);e.exports=!n&&!i((function(){return 7!==Object.defineProperty(o("div"),"a",{get:function(){return 7}}).a}))},5966:function(e,t,r){"use strict";var n=r(9306),i=r(4117);e.exports=function(e,t){var r=e[t];return i(r)?void 0:n(r)}},6080:function(e,t,r){"use strict";var n=r(7476),i=r(9306),o=r(616),s=n(n.bind);e.exports=function(e,t){return i(e),void 0===t?e:o?s(e,t):function(){return e.apply(t,arguments)}}},6119:function(e,t,r){"use strict";var n=r(5745),i=r(3392),o=n("keys");e.exports=function(e){return o[e]||(o[e]=i(e))}},6167:function(e){"use strict";e.exports=function(){var e=1;function t(){return e++}return{generate:t}}},6193:function(e,t,r){"use strict";var n=r(9504),i=Error,o=n("".replace),s=function(e){return String(new i(e).stack)}("zxcasd"),a=/\n\s*at [^:]*:[^\n]*/,u=a.test(s);e.exports=function(e,t){if(u&&"string"==typeof e&&!i.prepareStackTrace)while(t--)e=o(e,a,"");return e}},6198:function(e,t,r){"use strict";var n=r(8014);e.exports=function(e){return n(e.length)}},6225:function(e,t,r){"use strict";var n;function i(e,t,r){return t=o(t),t in e?Object.defineProperty(e,t,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[t]=r,e}function o(e){var t=s(e,"string");return"symbol"===typeof t?t:String(t)}function s(e,t){if("object"!==typeof e||null===e)return e;var r=e[Symbol.toPrimitive];if(void 0!==r){var n=r.call(e,t||"default");if("object"!==typeof n)return n;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===t?String:Number)(e)}var a=r(7568),u=Symbol("lastResolve"),l=Symbol("lastReject"),c=Symbol("error"),h=Symbol("ended"),f=Symbol("lastPromise"),d=Symbol("handlePromise"),p=Symbol("stream");function y(e,t){return{value:e,done:t}}function v(e){var t=e[u];if(null!==t){var r=e[p].read();null!==r&&(e[f]=null,e[u]=null,e[l]=null,t(y(r,!1)))}}function m(e){process.nextTick(v,e)}function g(e,t){return function(r,n){e.then((function(){t[h]?r(y(void 0,!0)):t[d](r,n)}),n)}}var b=Object.getPrototypeOf((function(){})),_=Object.setPrototypeOf((n={get stream(){return this[p]},next:function(){var e=this,t=this[c];if(null!==t)return Promise.reject(t);if(this[h])return Promise.resolve(y(void 0,!0));if(this[p].destroyed)return new Promise((function(t,r){process.nextTick((function(){e[c]?r(e[c]):t(y(void 0,!0))}))}));var r,n=this[f];if(n)r=new Promise(g(n,this));else{var i=this[p].read();if(null!==i)return Promise.resolve(y(i,!1));r=new Promise(this[d])}return this[f]=r,r}},i(n,Symbol.asyncIterator,(function(){return this})),i(n,"return",(function(){var e=this;return new Promise((function(t,r){e[p].destroy(null,(function(e){e?r(e):t(y(void 0,!0))}))}))})),n),b),w=function(e){var t,r=Object.create(_,(t={},i(t,p,{value:e,writable:!0}),i(t,u,{value:null,writable:!0}),i(t,l,{value:null,writable:!0}),i(t,c,{value:null,writable:!0}),i(t,h,{value:e._readableState.endEmitted,writable:!0}),i(t,d,{value:function(e,t){var n=r[p].read();n?(r[f]=null,r[u]=null,r[l]=null,e(y(n,!1))):(r[u]=e,r[l]=t)},writable:!0}),t));return r[f]=null,a(e,(function(e){if(e&&"ERR_STREAM_PREMATURE_CLOSE"!==e.code){var t=r[l];return null!==t&&(r[f]=null,r[u]=null,r[l]=null,t(e)),void(r[c]=e)}var n=r[u];null!==n&&(r[f]=null,r[u]=null,r[l]=null,n(y(void 0,!0))),r[h]=!0})),e.on("readable",m.bind(null,r)),r};e.exports=w},6269:function(e){"use strict";e.exports={}},6275:function(e,t,r){e.exports=r(6369).EventEmitter},6279:function(e,t,r){"use strict";var n=r(6840);e.exports=function(e,t,r){for(var i in t)n(e,i,t[i],r);return e}},6319:function(e,t,r){"use strict";var n=r(8551),i=r(9539);e.exports=function(e,t,r,o){try{return o?t(n(r)[0],r[1]):t(r)}catch(s){i(e,"throw",s)}}},6369:function(e,t,r){"use strict";r(4114);var n,i="object"===typeof Reflect?Reflect:null,o=i&&"function"===typeof i.apply?i.apply:function(e,t,r){return Function.prototype.apply.call(e,t,r)};function s(e){console&&console.warn&&console.warn(e)}n=i&&"function"===typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(e){return Object.getOwnPropertyNames(e).concat(Object.getOwnPropertySymbols(e))}:function(e){return Object.getOwnPropertyNames(e)};var a=Number.isNaN||function(e){return e!==e};function u(){u.init.call(this)}e.exports=u,e.exports.once=_,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var l=10;function c(e){if("function"!==typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e)}function h(e){return void 0===e._maxListeners?u.defaultMaxListeners:e._maxListeners}function f(e,t,r,n){var i,o,a;if(c(r),o=e._events,void 0===o?(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=h(e),i>0&&a.length>i&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(t)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=e,u.type=t,u.count=a.length,s(u)}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 p(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 y(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?b(i):m(i,i.length)}function v(e){var t=this._events;if(void 0!==t){var r=t[e];if("function"===typeof r)return 1;if(void 0!==r)return r.length}return 0}function m(e,t){for(var r=new Array(t),n=0;n<t;++n)r[n]=e[n];return r}function g(e,t){for(;t+1<e.length;t++)e[t]=e[t+1];e.pop()}function b(e){for(var t=new Array(e.length),r=0;r<t.length;++r)t[r]=e[r].listener||e[r];return t}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))}S(e,t,o,{once:!0}),"error"!==t&&w(e,i,{once:!0})}))}function w(e,t,r){"function"===typeof e.on&&S(e,"error",t,r)}function S(e,t,r,n){if("function"===typeof e.on)n.once?e.once(t,r):e.on(t,r);else{if("function"!==typeof e.addEventListener)throw new TypeError('The "emitter" argument must be of type EventEmitter. Received type '+typeof e);e.addEventListener(t,(function i(o){n.once&&e.removeEventListener(t,i),r(o)}))}}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return l},set:function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+e+".");l=e}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(e){if("number"!==typeof e||e<0||a(e))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+e+".");return this._maxListeners=e,this},u.prototype.getMaxListeners=function(){return h(this)},u.prototype.emit=function(e){for(var t=[],r=1;r<arguments.length;r++)t.push(arguments[r]);var n="error"===e,i=this._events;if(void 0!==i)n=n&&void 0===i.error;else if(!n)return!1;if(n){var s;if(t.length>0&&(s=t[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=i[e];if(void 0===u)return!1;if("function"===typeof u)o(u,this,t);else{var l=u.length,c=m(u,l);for(r=0;r<l;++r)o(c[r],this,t)}return!0},u.prototype.addListener=function(e,t){return f(this,e,t,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(e,t){return f(this,e,t,!0)},u.prototype.once=function(e,t){return c(t),this.on(e,p(this,e,t)),this},u.prototype.prependOnceListener=function(e,t){return c(t),this.prependListener(e,p(this,e,t)),this},u.prototype.removeListener=function(e,t){var r,n,i,o,s;if(c(t),n=this._events,void 0===n)return this;if(r=n[e],void 0===r)return this;if(r===t||r.listener===t)0===--this._eventsCount?this._events=Object.create(null):(delete n[e],n.removeListener&&this.emit("removeListener",e,r.listener||t));else if("function"!==typeof r){for(i=-1,o=r.length-1;o>=0;o--)if(r[o]===t||r[o].listener===t){s=r[o].listener,i=o;break}if(i<0)return this;0===i?r.shift():g(r,i),1===r.length&&(n[e]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",e,s||t)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(e){var t,r,n;if(r=this._events,void 0===r)return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[e]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[e]),this;if(0===arguments.length){var i,o=Object.keys(r);for(n=0;n<o.length;++n)i=o[n],"removeListener"!==i&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if(t=r[e],"function"===typeof t)this.removeListener(e,t);else if(void 0!==t)for(n=t.length-1;n>=0;n--)this.removeListener(e,t[n]);return this},u.prototype.listeners=function(e){return y(this,e,!0)},u.prototype.rawListeners=function(e){return y(this,e,!1)},u.listenerCount=function(e,t){return"function"===typeof e.listenerCount?e.listenerCount(t):v.call(e,t)},u.prototype.listenerCount=v,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},6395:function(e){"use strict";e.exports=!1},6518:function(e,t,r){"use strict";var n=r(4576),i=r(7347).f,o=r(6699),s=r(6840),a=r(9433),u=r(7740),l=r(2796);e.exports=function(e,t){var r,c,h,f,d,p,y=e.target,v=e.global,m=e.stat;if(c=v?n:m?n[y]||a(y,{}):n[y]&&n[y].prototype,c)for(h in t){if(d=t[h],e.dontCallGetSet?(p=i(c,h),f=p&&p.value):f=c[h],r=l(v?h:y+(m?".":"#")+h,e.forced),!r&&void 0!==f){if(typeof d==typeof f)continue;u(d,f)}(e.sham||f&&f.sham)&&o(d,"sham",!0),s(c,h,d,e)}}},6692:function(e,t,r){"use strict";r(4114),e.exports=c;var n=r(5842).F,i=n.ERR_METHOD_NOT_IMPLEMENTED,o=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=r(1860);function l(e,t){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new o);r.writechunk=null,r.writecb=null,null!=t&&this.push(t),n(e);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function c(e){if(!(this instanceof c))return new c(e);u.call(this,e),this._transformState={afterTransform:l.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,e&&("function"===typeof e.transform&&(this._transform=e.transform),"function"===typeof e.flush&&(this._flush=e.flush)),this.on("prefinish",h)}function h(){var e=this;"function"!==typeof this._flush||this._readableState.destroyed?f(this,null,null):this._flush((function(t,r){f(e,t,r)}))}function f(e,t,r){if(t)return e.emit("error",t);if(null!=r&&e.push(r),e._writableState.length)throw new a;if(e._transformState.transforming)throw new s;return e.push(null)}r(8392)(c,u),c.prototype.push=function(e,t){return this._transformState.needTransform=!1,u.prototype.push.call(this,e,t)},c.prototype._transform=function(e,t,r){r(new i("_transform()"))},c.prototype._write=function(e,t,r){var n=this._transformState;if(n.writecb=r,n.writechunk=e,n.writeencoding=t,!n.transforming){var i=this._readableState;(n.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},c.prototype._read=function(e){var t=this._transformState;null===t.writechunk||t.transforming?t.needTransform=!0:(t.transforming=!0,this._transform(t.writechunk,t.writeencoding,t.afterTransform))},c.prototype._destroy=function(e,t){u.prototype._destroy.call(this,e,(function(e){t(e)}))}},6699:function(e,t,r){"use strict";var n=r(3724),i=r(4913),o=r(6980);e.exports=n?function(e,t,r){return i.f(e,t,o(1,r))}:function(e,t,r){return e[t]=r,e}},6706:function(e,t,r){"use strict";var n=r(9504),i=r(9306);e.exports=function(e,t,r){try{return n(i(Object.getOwnPropertyDescriptor(e,t)[r]))}catch(o){}}},6758:function(e,t,r){"use strict";r(8111),r(7588);var n=e.exports={};n.forEach=function(e,t){for(var r=0;r<e.length;r++){var n=t(e[r]);if(n)return n}}},6801:function(e,t,r){"use strict";var n=r(3724),i=r(8686),o=r(4913),s=r(8551),a=r(5397),u=r(1072);t.f=n&&!i?Object.defineProperties:function(e,t){s(e);var r,n=a(t),i=u(t),l=i.length,c=0;while(l>c)o.f(e,r=i[c++],n[r]);return e}},6823:function(e){"use strict";var t=String;e.exports=function(e){try{return t(e)}catch(r){return"Object"}}},6837:function(e){"use strict";var t=TypeError,r=9007199254740991;e.exports=function(e){if(e>r)throw t("Maximum allowed index exceeded");return e}},6840:function(e,t,r){"use strict";var n=r(4901),i=r(4913),o=r(283),s=r(9433);e.exports=function(e,t,r,a){a||(a={});var u=a.enumerable,l=void 0!==a.name?a.name:t;if(n(r)&&o(r,l,a),a.global)u?e[t]=r:s(t,r);else{try{a.unsafe?e[t]&&(u=!0):delete e[t]}catch(c){}u?e[t]=r:i.f(e,t,{value:r,enumerable:!1,configurable:!a.nonConfigurable,writable:!a.nonWritable})}return e}},6955:function(e,t,r){"use strict";var n=r(2140),i=r(4901),o=r(2195),s=r(8227),a=s("toStringTag"),u=Object,l="Arguments"===o(function(){return arguments}()),c=function(e,t){try{return e[t]}catch(r){}};e.exports=n?o:function(e){var t,r,n;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(r=c(t=u(e),a))?r:l?o(t):"Object"===(n=o(t))&&i(t.callee)?"Arguments":n}},6969:function(e,t,r){"use strict";var n=r(2777),i=r(757);e.exports=function(e){var t=n(e,"string");return i(t)?t:t+""}},6980:function(e){"use strict";e.exports=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}}},7040:function(e,t,r){"use strict";var n=r(4495);e.exports=n&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},7055:function(e,t,r){"use strict";var n=r(9504),i=r(9039),o=r(2195),s=Object,a=n("".split);e.exports=i((function(){return!s("z").propertyIsEnumerable(0)}))?function(e){return"String"===o(e)?a(e,""):s(e)}:s},7209:function(e,t,r){"use strict";
|
|
150
|
+
/*!
|
|
151
|
+
* The buffer module from node.js, for the browser.
|
|
152
|
+
*
|
|
153
|
+
* @author Feross Aboukhadijeh <https://feross.org>
|
|
154
|
+
* @license MIT
|
|
155
|
+
*/r(4114);var n=r(792),i=r(309),o="function"===typeof Symbol&&"function"===typeof Symbol["for"]?Symbol["for"]("nodejs.util.inspect.custom"):null;t.Buffer=l,t.SlowBuffer=_,t.INSPECT_MAX_BYTES=50;var s=2147483647;function a(){try{var e=new Uint8Array(1),t={foo:function(){return 42}};return Object.setPrototypeOf(t,Uint8Array.prototype),Object.setPrototypeOf(e,t),42===e.foo()}catch(r){return!1}}function u(e){if(e>s)throw new RangeError('The value "'+e+'" is invalid for option "size"');var t=new Uint8Array(e);return Object.setPrototypeOf(t,l.prototype),t}function l(e,t,r){if("number"===typeof e){if("string"===typeof t)throw new TypeError('The "string" argument must be of type string. Received type number');return d(e)}return c(e,t,r)}function c(e,t,r){if("string"===typeof e)return p(e,t);if(ArrayBuffer.isView(e))return v(e);if(null==e)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e);if($(e,ArrayBuffer)||e&&$(e.buffer,ArrayBuffer))return m(e,t,r);if("undefined"!==typeof SharedArrayBuffer&&($(e,SharedArrayBuffer)||e&&$(e.buffer,SharedArrayBuffer)))return m(e,t,r);if("number"===typeof e)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=e.valueOf&&e.valueOf();if(null!=n&&n!==e)return l.from(n,t,r);var i=g(e);if(i)return i;if("undefined"!==typeof Symbol&&null!=Symbol.toPrimitive&&"function"===typeof e[Symbol.toPrimitive])return l.from(e[Symbol.toPrimitive]("string"),t,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof e)}function h(e){if("number"!==typeof e)throw new TypeError('"size" argument must be of type number');if(e<0)throw new RangeError('The value "'+e+'" is invalid for option "size"')}function f(e,t,r){return h(e),e<=0?u(e):void 0!==t?"string"===typeof r?u(e).fill(t,r):u(e).fill(t):u(e)}function d(e){return h(e),u(e<0?0:0|b(e))}function p(e,t){if("string"===typeof t&&""!==t||(t="utf8"),!l.isEncoding(t))throw new TypeError("Unknown encoding: "+t);var r=0|w(e,t),n=u(r),i=n.write(e,t);return i!==r&&(n=n.slice(0,i)),n}function y(e){for(var t=e.length<0?0:0|b(e.length),r=u(t),n=0;n<t;n+=1)r[n]=255&e[n];return r}function v(e){if($(e,Uint8Array)){var t=new Uint8Array(e);return m(t.buffer,t.byteOffset,t.byteLength)}return y(e)}function m(e,t,r){if(t<0||e.byteLength<t)throw new RangeError('"offset" is outside of buffer bounds');if(e.byteLength<t+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return n=void 0===t&&void 0===r?new Uint8Array(e):void 0===r?new Uint8Array(e,t):new Uint8Array(e,t,r),Object.setPrototypeOf(n,l.prototype),n}function g(e){if(l.isBuffer(e)){var t=0|b(e.length),r=u(t);return 0===r.length||e.copy(r,0,0,t),r}return void 0!==e.length?"number"!==typeof e.length||J(e.length)?u(0):y(e):"Buffer"===e.type&&Array.isArray(e.data)?y(e.data):void 0}function b(e){if(e>=s)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+s.toString(16)+" bytes");return 0|e}function _(e){return+e!=e&&(e=0),l.alloc(+e)}function w(e,t){if(l.isBuffer(e))return e.length;if(ArrayBuffer.isView(e)||$(e,ArrayBuffer))return e.byteLength;if("string"!==typeof e)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof e);var r=e.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var i=!1;;)switch(t){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return z(e).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return q(e).length;default:if(i)return n?-1:z(e).length;t=(""+t).toLowerCase(),i=!0}}function S(e,t,r){var n=!1;if((void 0===t||t<0)&&(t=0),t>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if(r>>>=0,t>>>=0,r<=t)return"";e||(e="utf8");while(1)switch(e){case"hex":return U(this,t,r);case"utf8":case"utf-8":return L(this,t,r);case"ascii":return B(this,t,r);case"latin1":case"binary":return D(this,t,r);case"base64":return P(this,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return N(this,t,r);default:if(n)throw new TypeError("Unknown encoding: "+e);e=(e+"").toLowerCase(),n=!0}}function E(e,t,r){var n=e[t];e[t]=e[r],e[r]=n}function A(e,t,r,n,i){if(0===e.length)return-1;if("string"===typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),r=+r,J(r)&&(r=i?0:e.length-1),r<0&&(r=e.length+r),r>=e.length){if(i)return-1;r=e.length-1}else if(r<0){if(!i)return-1;r=0}if("string"===typeof t&&(t=l.from(t,n)),l.isBuffer(t))return 0===t.length?-1:k(e,t,r,n,i);if("number"===typeof t)return t&=255,"function"===typeof Uint8Array.prototype.indexOf?i?Uint8Array.prototype.indexOf.call(e,t,r):Uint8Array.prototype.lastIndexOf.call(e,t,r):k(e,[t],r,n,i);throw new TypeError("val must be string, number or Buffer")}function k(e,t,r,n,i){var o,s=1,a=e.length,u=t.length;if(void 0!==n&&(n=String(n).toLowerCase(),"ucs2"===n||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(e.length<2||t.length<2)return-1;s=2,a/=2,u/=2,r/=2}function l(e,t){return 1===s?e[t]:e.readUInt16BE(t*s)}if(i){var c=-1;for(o=r;o<a;o++)if(l(e,o)===l(t,-1===c?0:o-c)){if(-1===c&&(c=o),o-c+1===u)return c*s}else-1!==c&&(o-=o-c),c=-1}else for(r+u>a&&(r=a-u),o=r;o>=0;o--){for(var h=!0,f=0;f<u;f++)if(l(e,o+f)!==l(t,f)){h=!1;break}if(h)return o}return-1}function x(e,t,r,n){r=Number(r)||0;var i=e.length-r;n?(n=Number(n),n>i&&(n=i)):n=i;var o=t.length;n>o/2&&(n=o/2);for(var s=0;s<n;++s){var a=parseInt(t.substr(2*s,2),16);if(J(a))return s;e[r+s]=a}return s}function R(e,t,r,n){return K(z(t,e.length-r),e,r,n)}function T(e,t,r,n){return K(X(t),e,r,n)}function C(e,t,r,n){return K(q(t),e,r,n)}function M(e,t,r,n){return K(Y(t,e.length-r),e,r,n)}function P(e,t,r){return 0===t&&r===e.length?n.fromByteArray(e):n.fromByteArray(e.slice(t,r))}function L(e,t,r){r=Math.min(e.length,r);var n=[],i=t;while(i<r){var o,s,a,u,l=e[i],c=null,h=l>239?4:l>223?3:l>191?2:1;if(i+h<=r)switch(h){case 1:l<128&&(c=l);break;case 2:o=e[i+1],128===(192&o)&&(u=(31&l)<<6|63&o,u>127&&(c=u));break;case 3:o=e[i+1],s=e[i+2],128===(192&o)&&128===(192&s)&&(u=(15&l)<<12|(63&o)<<6|63&s,u>2047&&(u<55296||u>57343)&&(c=u));break;case 4:o=e[i+1],s=e[i+2],a=e[i+3],128===(192&o)&&128===(192&s)&&128===(192&a)&&(u=(15&l)<<18|(63&o)<<12|(63&s)<<6|63&a,u>65535&&u<1114112&&(c=u))}null===c?(c=65533,h=1):c>65535&&(c-=65536,n.push(c>>>10&1023|55296),c=56320|1023&c),n.push(c),i+=h}return I(n)}t.kMaxLength=s,l.TYPED_ARRAY_SUPPORT=a(),l.TYPED_ARRAY_SUPPORT||"undefined"===typeof console||"function"!==typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(l.prototype,"parent",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.buffer}}),Object.defineProperty(l.prototype,"offset",{enumerable:!0,get:function(){if(l.isBuffer(this))return this.byteOffset}}),l.poolSize=8192,l.from=function(e,t,r){return c(e,t,r)},Object.setPrototypeOf(l.prototype,Uint8Array.prototype),Object.setPrototypeOf(l,Uint8Array),l.alloc=function(e,t,r){return f(e,t,r)},l.allocUnsafe=function(e){return d(e)},l.allocUnsafeSlow=function(e){return d(e)},l.isBuffer=function(e){return null!=e&&!0===e._isBuffer&&e!==l.prototype},l.compare=function(e,t){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),$(t,Uint8Array)&&(t=l.from(t,t.offset,t.byteLength)),!l.isBuffer(e)||!l.isBuffer(t))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(e===t)return 0;for(var r=e.length,n=t.length,i=0,o=Math.min(r,n);i<o;++i)if(e[i]!==t[i]){r=e[i],n=t[i];break}return r<n?-1:n<r?1:0},l.isEncoding=function(e){switch(String(e).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},l.concat=function(e,t){if(!Array.isArray(e))throw new TypeError('"list" argument must be an Array of Buffers');if(0===e.length)return l.alloc(0);var r;if(void 0===t)for(t=0,r=0;r<e.length;++r)t+=e[r].length;var n=l.allocUnsafe(t),i=0;for(r=0;r<e.length;++r){var o=e[r];if($(o,Uint8Array))i+o.length>n.length?l.from(o).copy(n,i):Uint8Array.prototype.set.call(n,o,i);else{if(!l.isBuffer(o))throw new TypeError('"list" argument must be an Array of Buffers');o.copy(n,i)}i+=o.length}return n},l.byteLength=w,l.prototype._isBuffer=!0,l.prototype.swap16=function(){var e=this.length;if(e%2!==0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var t=0;t<e;t+=2)E(this,t,t+1);return this},l.prototype.swap32=function(){var e=this.length;if(e%4!==0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var t=0;t<e;t+=4)E(this,t,t+3),E(this,t+1,t+2);return this},l.prototype.swap64=function(){var e=this.length;if(e%8!==0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var t=0;t<e;t+=8)E(this,t,t+7),E(this,t+1,t+6),E(this,t+2,t+5),E(this,t+3,t+4);return this},l.prototype.toString=function(){var e=this.length;return 0===e?"":0===arguments.length?L(this,0,e):S.apply(this,arguments)},l.prototype.toLocaleString=l.prototype.toString,l.prototype.equals=function(e){if(!l.isBuffer(e))throw new TypeError("Argument must be a Buffer");return this===e||0===l.compare(this,e)},l.prototype.inspect=function(){var e="",r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},o&&(l.prototype[o]=l.prototype.inspect),l.prototype.compare=function(e,t,r,n,i){if($(e,Uint8Array)&&(e=l.from(e,e.offset,e.byteLength)),!l.isBuffer(e))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof e);if(void 0===t&&(t=0),void 0===r&&(r=e?e.length:0),void 0===n&&(n=0),void 0===i&&(i=this.length),t<0||r>e.length||n<0||i>this.length)throw new RangeError("out of range index");if(n>=i&&t>=r)return 0;if(n>=i)return-1;if(t>=r)return 1;if(t>>>=0,r>>>=0,n>>>=0,i>>>=0,this===e)return 0;for(var o=i-n,s=r-t,a=Math.min(o,s),u=this.slice(n,i),c=e.slice(t,r),h=0;h<a;++h)if(u[h]!==c[h]){o=u[h],s=c[h];break}return o<s?-1:s<o?1:0},l.prototype.includes=function(e,t,r){return-1!==this.indexOf(e,t,r)},l.prototype.indexOf=function(e,t,r){return A(this,e,t,r,!0)},l.prototype.lastIndexOf=function(e,t,r){return A(this,e,t,r,!1)},l.prototype.write=function(e,t,r,n){if(void 0===t)n="utf8",r=this.length,t=0;else if(void 0===r&&"string"===typeof t)n=t,r=this.length,t=0;else{if(!isFinite(t))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");t>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var i=this.length-t;if((void 0===r||r>i)&&(r=i),e.length>0&&(r<0||t<0)||t>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var o=!1;;)switch(n){case"hex":return x(this,e,t,r);case"utf8":case"utf-8":return R(this,e,t,r);case"ascii":case"latin1":case"binary":return T(this,e,t,r);case"base64":return C(this,e,t,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return M(this,e,t,r);default:if(o)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),o=!0}},l.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function I(e){var t=e.length;if(t<=O)return String.fromCharCode.apply(String,e);var r="",n=0;while(n<t)r+=String.fromCharCode.apply(String,e.slice(n,n+=O));return r}function B(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(127&e[i]);return n}function D(e,t,r){var n="";r=Math.min(e.length,r);for(var i=t;i<r;++i)n+=String.fromCharCode(e[i]);return n}function U(e,t,r){var n=e.length;(!t||t<0)&&(t=0),(!r||r<0||r>n)&&(r=n);for(var i="",o=t;o<r;++o)i+=Q[e[o]];return i}function N(e,t,r){for(var n=e.slice(t,r),i="",o=0;o<n.length-1;o+=2)i+=String.fromCharCode(n[o]+256*n[o+1]);return i}function F(e,t,r){if(e%1!==0||e<0)throw new RangeError("offset is not uint");if(e+t>r)throw new RangeError("Trying to access beyond buffer length")}function H(e,t,r,n,i,o){if(!l.isBuffer(e))throw new TypeError('"buffer" argument must be a Buffer instance');if(t>i||t<o)throw new RangeError('"value" argument is out of bounds');if(r+n>e.length)throw new RangeError("Index out of range")}function W(e,t,r,n,i,o){if(r+n>e.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function V(e,t,r,n,o){return t=+t,r>>>=0,o||W(e,t,r,4,34028234663852886e22,-34028234663852886e22),i.write(e,t,r,n,23,4),r+4}function G(e,t,r,n,o){return t=+t,r>>>=0,o||W(e,t,r,8,17976931348623157e292,-17976931348623157e292),i.write(e,t,r,n,52,8),r+8}l.prototype.slice=function(e,t){var r=this.length;e=~~e,t=void 0===t?r:~~t,e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),t<e&&(t=e);var n=this.subarray(e,t);return Object.setPrototypeOf(n,l.prototype),n},l.prototype.readUintLE=l.prototype.readUIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var n=this[e],i=1,o=0;while(++o<t&&(i*=256))n+=this[e+o]*i;return n},l.prototype.readUintBE=l.prototype.readUIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var n=this[e+--t],i=1;while(t>0&&(i*=256))n+=this[e+--t]*i;return n},l.prototype.readUint8=l.prototype.readUInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),this[e]},l.prototype.readUint16LE=l.prototype.readUInt16LE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]|this[e+1]<<8},l.prototype.readUint16BE=l.prototype.readUInt16BE=function(e,t){return e>>>=0,t||F(e,2,this.length),this[e]<<8|this[e+1]},l.prototype.readUint32LE=l.prototype.readUInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),(this[e]|this[e+1]<<8|this[e+2]<<16)+16777216*this[e+3]},l.prototype.readUint32BE=l.prototype.readUInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),16777216*this[e]+(this[e+1]<<16|this[e+2]<<8|this[e+3])},l.prototype.readIntLE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var n=this[e],i=1,o=0;while(++o<t&&(i*=256))n+=this[e+o]*i;return i*=128,n>=i&&(n-=Math.pow(2,8*t)),n},l.prototype.readIntBE=function(e,t,r){e>>>=0,t>>>=0,r||F(e,t,this.length);var n=t,i=1,o=this[e+--n];while(n>0&&(i*=256))o+=this[e+--n]*i;return i*=128,o>=i&&(o-=Math.pow(2,8*t)),o},l.prototype.readInt8=function(e,t){return e>>>=0,t||F(e,1,this.length),128&this[e]?-1*(255-this[e]+1):this[e]},l.prototype.readInt16LE=function(e,t){e>>>=0,t||F(e,2,this.length);var r=this[e]|this[e+1]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt16BE=function(e,t){e>>>=0,t||F(e,2,this.length);var r=this[e+1]|this[e]<<8;return 32768&r?4294901760|r:r},l.prototype.readInt32LE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]|this[e+1]<<8|this[e+2]<<16|this[e+3]<<24},l.prototype.readInt32BE=function(e,t){return e>>>=0,t||F(e,4,this.length),this[e]<<24|this[e+1]<<16|this[e+2]<<8|this[e+3]},l.prototype.readFloatLE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!0,23,4)},l.prototype.readFloatBE=function(e,t){return e>>>=0,t||F(e,4,this.length),i.read(this,e,!1,23,4)},l.prototype.readDoubleLE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!0,52,8)},l.prototype.readDoubleBE=function(e,t){return e>>>=0,t||F(e,8,this.length),i.read(this,e,!1,52,8)},l.prototype.writeUintLE=l.prototype.writeUIntLE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;H(this,e,t,r,i,0)}var o=1,s=0;this[t]=255&e;while(++s<r&&(o*=256))this[t+s]=e/o&255;return t+r},l.prototype.writeUintBE=l.prototype.writeUIntBE=function(e,t,r,n){if(e=+e,t>>>=0,r>>>=0,!n){var i=Math.pow(2,8*r)-1;H(this,e,t,r,i,0)}var o=r-1,s=1;this[t+o]=255&e;while(--o>=0&&(s*=256))this[t+o]=e/s&255;return t+r},l.prototype.writeUint8=l.prototype.writeUInt8=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,1,255,0),this[t]=255&e,t+1},l.prototype.writeUint16LE=l.prototype.writeUInt16LE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,2,65535,0),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeUint16BE=l.prototype.writeUInt16BE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,2,65535,0),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeUint32LE=l.prototype.writeUInt32LE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,4,4294967295,0),this[t+3]=e>>>24,this[t+2]=e>>>16,this[t+1]=e>>>8,this[t]=255&e,t+4},l.prototype.writeUint32BE=l.prototype.writeUInt32BE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,4,4294967295,0),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeIntLE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);H(this,e,t,r,i-1,-i)}var o=0,s=1,a=0;this[t]=255&e;while(++o<r&&(s*=256))e<0&&0===a&&0!==this[t+o-1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeIntBE=function(e,t,r,n){if(e=+e,t>>>=0,!n){var i=Math.pow(2,8*r-1);H(this,e,t,r,i-1,-i)}var o=r-1,s=1,a=0;this[t+o]=255&e;while(--o>=0&&(s*=256))e<0&&0===a&&0!==this[t+o+1]&&(a=1),this[t+o]=(e/s|0)-a&255;return t+r},l.prototype.writeInt8=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,1,127,-128),e<0&&(e=255+e+1),this[t]=255&e,t+1},l.prototype.writeInt16LE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,2,32767,-32768),this[t]=255&e,this[t+1]=e>>>8,t+2},l.prototype.writeInt16BE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,2,32767,-32768),this[t]=e>>>8,this[t+1]=255&e,t+2},l.prototype.writeInt32LE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,4,2147483647,-2147483648),this[t]=255&e,this[t+1]=e>>>8,this[t+2]=e>>>16,this[t+3]=e>>>24,t+4},l.prototype.writeInt32BE=function(e,t,r){return e=+e,t>>>=0,r||H(this,e,t,4,2147483647,-2147483648),e<0&&(e=4294967295+e+1),this[t]=e>>>24,this[t+1]=e>>>16,this[t+2]=e>>>8,this[t+3]=255&e,t+4},l.prototype.writeFloatLE=function(e,t,r){return V(this,e,t,!0,r)},l.prototype.writeFloatBE=function(e,t,r){return V(this,e,t,!1,r)},l.prototype.writeDoubleLE=function(e,t,r){return G(this,e,t,!0,r)},l.prototype.writeDoubleBE=function(e,t,r){return G(this,e,t,!1,r)},l.prototype.copy=function(e,t,r,n){if(!l.isBuffer(e))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),t>=e.length&&(t=e.length),t||(t=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===e.length||0===this.length)return 0;if(t<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),e.length-t<n-r&&(n=e.length-t+r);var i=n-r;return this===e&&"function"===typeof Uint8Array.prototype.copyWithin?this.copyWithin(t,r,n):Uint8Array.prototype.set.call(e,this.subarray(r,n),t),i},l.prototype.fill=function(e,t,r,n){if("string"===typeof e){if("string"===typeof t?(n=t,t=0,r=this.length):"string"===typeof r&&(n=r,r=this.length),void 0!==n&&"string"!==typeof n)throw new TypeError("encoding must be a string");if("string"===typeof n&&!l.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===e.length){var i=e.charCodeAt(0);("utf8"===n&&i<128||"latin1"===n)&&(e=i)}}else"number"===typeof e?e&=255:"boolean"===typeof e&&(e=Number(e));if(t<0||this.length<t||this.length<r)throw new RangeError("Out of range index");if(r<=t)return this;var o;if(t>>>=0,r=void 0===r?this.length:r>>>0,e||(e=0),"number"===typeof e)for(o=t;o<r;++o)this[o]=e;else{var s=l.isBuffer(e)?e:l.from(e,n),a=s.length;if(0===a)throw new TypeError('The value "'+e+'" is invalid for argument "value"');for(o=0;o<r-t;++o)this[o+t]=s[o%a]}return this};var Z=/[^+/0-9A-Za-z-_]/g;function j(e){if(e=e.split("=")[0],e=e.trim().replace(Z,""),e.length<2)return"";while(e.length%4!==0)e+="=";return e}function z(e,t){var r;t=t||1/0;for(var n=e.length,i=null,o=[],s=0;s<n;++s){if(r=e.charCodeAt(s),r>55295&&r<57344){if(!i){if(r>56319){(t-=3)>-1&&o.push(239,191,189);continue}if(s+1===n){(t-=3)>-1&&o.push(239,191,189);continue}i=r;continue}if(r<56320){(t-=3)>-1&&o.push(239,191,189),i=r;continue}r=65536+(i-55296<<10|r-56320)}else i&&(t-=3)>-1&&o.push(239,191,189);if(i=null,r<128){if((t-=1)<0)break;o.push(r)}else if(r<2048){if((t-=2)<0)break;o.push(r>>6|192,63&r|128)}else if(r<65536){if((t-=3)<0)break;o.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((t-=4)<0)break;o.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return o}function X(e){for(var t=[],r=0;r<e.length;++r)t.push(255&e.charCodeAt(r));return t}function Y(e,t){for(var r,n,i,o=[],s=0;s<e.length;++s){if((t-=2)<0)break;r=e.charCodeAt(s),n=r>>8,i=r%256,o.push(i),o.push(n)}return o}function q(e){return n.toByteArray(j(e))}function K(e,t,r,n){for(var i=0;i<n;++i){if(i+r>=t.length||i>=e.length)break;t[i+r]=e[i]}return i}function $(e,t){return e instanceof t||null!=e&&null!=e.constructor&&null!=e.constructor.name&&e.constructor.name===t.name}function J(e){return e!==e}var Q=function(){for(var e="0123456789abcdef",t=new Array(256),r=0;r<16;++r)for(var n=16*r,i=0;i<16;++i)t[n+i]=e[r]+e[i];return t}()},7347:function(e,t,r){"use strict";var n=r(3724),i=r(9565),o=r(8773),s=r(6980),a=r(5397),u=r(6969),l=r(9297),c=r(5917),h=Object.getOwnPropertyDescriptor;t.f=n?h:function(e,t){if(e=a(e),t=u(t),c)try{return h(e,t)}catch(r){}if(l(e,t))return s(!i(o.f,e,t),e[t])}},7438:function(e,t,r){"use strict";e.exports=i;var n=r(6692);function i(e){if(!(this instanceof i))return new i(e);n.call(this,e)}r(8392)(i,n),i.prototype._transform=function(e,t,r){r(null,e)}},7475:function(e){"use strict";e.exports=function(e){function t(){}var r={log:t,warn:t,error:t};if(!e&&window.console){var n=function(e,t){e[t]=function(){var e=console[t];if(e.apply)e.apply(console,arguments);else for(var r=0;r<arguments.length;r++)e(arguments[r])}};n(r,"log"),n(r,"warn"),n(r,"error")}return r}},7476:function(e,t,r){"use strict";var n=r(2195),i=r(9504);e.exports=function(e){if("Function"===n(e))return i(e)}},7568:function(e,t,r){"use strict";var n=r(5842).F.ERR_STREAM_PREMATURE_CLOSE;function i(e){var t=!1;return function(){if(!t){t=!0;for(var r=arguments.length,n=new Array(r),i=0;i<r;i++)n[i]=arguments[i];e.apply(this,n)}}}function o(){}function s(e){return e.setHeader&&"function"===typeof e.abort}function a(e,t,r){if("function"===typeof t)return a(e,null,t);t||(t={}),r=i(r||o);var u=t.readable||!1!==t.readable&&e.readable,l=t.writable||!1!==t.writable&&e.writable,c=function(){e.writable||f()},h=e._writableState&&e._writableState.finished,f=function(){l=!1,h=!0,u||r.call(e)},d=e._readableState&&e._readableState.endEmitted,p=function(){u=!1,d=!0,l||r.call(e)},y=function(t){r.call(e,t)},v=function(){var t;return u&&!d?(e._readableState&&e._readableState.ended||(t=new n),r.call(e,t)):l&&!h?(e._writableState&&e._writableState.ended||(t=new n),r.call(e,t)):void 0},m=function(){e.req.on("finish",f)};return s(e)?(e.on("complete",f),e.on("abort",v),e.req?m():e.on("request",m)):l&&!e._writableState&&(e.on("end",c),e.on("close",c)),e.on("end",p),e.on("finish",f),!1!==t.error&&e.on("error",y),e.on("close",v),function(){e.removeListener("complete",f),e.removeListener("abort",v),e.removeListener("request",m),e.req&&e.req.removeListener("finish",f),e.removeListener("end",c),e.removeListener("close",c),e.removeListener("finish",f),e.removeListener("end",p),e.removeListener("error",y),e.removeListener("close",v)}}e.exports=a},7588:function(e,t,r){"use strict";var n=r(6518),i=r(9565),o=r(2652),s=r(9306),a=r(8551),u=r(1767),l=r(9539),c=r(4549),h=c("forEach",TypeError);n({target:"Iterator",proto:!0,real:!0,forced:h},{forEach:function(e){a(this);try{s(e)}catch(n){l(this,"throw",n)}if(h)return i(h,this,e);var t=u(this),r=0;o(t,(function(t){e(t,r++)}),{IS_RECORD:!0})}})},7629:function(e,t,r){"use strict";var n=r(6395),i=r(4576),o=r(9433),s="__core-js_shared__",a=e.exports=i[s]||o(s,{});(a.versions||(a.versions=[])).push({version:"3.42.0",mode:n?"pure":"global",copyright:"© 2014-2025 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.42.0/LICENSE",source:"https://github.com/zloirock/core-js"})},7657:function(e,t,r){"use strict";var n,i,o,s=r(9039),a=r(4901),u=r(34),l=r(2360),c=r(2787),h=r(6840),f=r(8227),d=r(6395),p=f("iterator"),y=!1;[].keys&&(o=[].keys(),"next"in o?(i=c(c(o)),i!==Object.prototype&&(n=i)):y=!0);var v=!u(n)||s((function(){var e={};return n[p].call(e)!==e}));v?n={}:d&&(n=l(n)),a(n[p])||h(n,p,(function(){return this})),e.exports={IteratorPrototype:n,BUGGY_SAFARI_ITERATORS:y}},7740:function(e,t,r){"use strict";var n=r(9297),i=r(5031),o=r(7347),s=r(4913);e.exports=function(e,t,r){for(var a=i(t),u=s.f,l=o.f,c=0;c<a.length;c++){var h=a[c];n(e,h)||r&&n(r,h)||u(e,h,l(t,h))}}},7750:function(e,t,r){"use strict";var n=r(4117),i=TypeError;e.exports=function(e){if(n(e))throw new i("Can't call method on "+e);return e}},7751:function(e,t,r){"use strict";var n=r(4576),i=r(4901),o=function(e){return i(e)?e:void 0};e.exports=function(e,t){return arguments.length<2?o(n[e]):n[e]&&n[e][t]}},8014:function(e,t,r){"use strict";var n=r(1291),i=Math.min;e.exports=function(e){var t=n(e);return t>0?i(t,9007199254740991):0}},8111:function(e,t,r){"use strict";var n=r(6518),i=r(4576),o=r(679),s=r(8551),a=r(4901),u=r(2787),l=r(2106),c=r(4659),h=r(9039),f=r(9297),d=r(8227),p=r(7657).IteratorPrototype,y=r(3724),v=r(6395),m="constructor",g="Iterator",b=d("toStringTag"),_=TypeError,w=i[g],S=v||!a(w)||w.prototype!==p||!h((function(){w({})})),E=function(){if(o(this,p),u(this)===p)throw new _("Abstract class Iterator not directly constructable")},A=function(e,t){y?l(p,e,{configurable:!0,get:function(){return t},set:function(t){if(s(this),this===p)throw new _("You can't redefine this property");f(this,e)?this[e]=t:c(this,e,t)}}):p[e]=t};f(p,b)||A(b,g),!S&&f(p,m)&&p[m]!==Object||A(m,E),E.prototype=p,n({global:!0,constructor:!0,forced:S},{Iterator:E})},8155:function(e,t,r){"use strict";var n=r(435);e.exports=function(e){e=e||{};var t=e.reporter,r=e.batchProcessor,i=e.stateHandler.getState;if(!t)throw new Error("Missing required dependency: reporter.");function o(e,t){function r(){t(e)}if(n.isIE(8))i(e).object={proxy:r},e.attachEvent("onresize",r);else{var o=u(e);if(!o)throw new Error("Element is not detectable by this strategy.");o.contentDocument.defaultView.addEventListener("resize",r)}}function s(t){var r=e.important?" !important; ":"; ";return(t.join(r)+r).trim()}function a(e,o,a){a||(a=o,o=e,e=null),e=e||{};e.debug;function u(o,a){var u=s(["display: block","position: absolute","top: 0","left: 0","width: 100%","height: 100%","border: none","padding: 0","margin: 0","opacity: 0","z-index: -1000","pointer-events: none"]),l=!1,c=window.getComputedStyle(o),h=o.offsetWidth,f=o.offsetHeight;function d(){function r(){if("static"===c.position){o.style.setProperty("position","relative",e.important?"important":"");var r=function(t,r,n,i){function o(e){return e.replace(/[^-\d\.]/g,"")}var s=n[i];"auto"!==s&&"0"!==o(s)&&(t.warn("An element that is positioned static has style."+i+"="+s+" which is ignored due to the static positioning. The element will need to be positioned relative, so the style."+i+" will be set to 0. Element: ",r),r.style.setProperty(i,"0",e.important?"important":""))};r(t,o,c,"top"),r(t,o,c,"right"),r(t,o,c,"bottom"),r(t,o,c,"left")}}function s(){function e(t,r){if(!t.contentDocument){var n=i(t);return n.checkForObjectDocumentTimeoutId&&window.clearTimeout(n.checkForObjectDocumentTimeoutId),void(n.checkForObjectDocumentTimeoutId=setTimeout((function(){n.checkForObjectDocumentTimeoutId=0,e(t,r)}),100))}r(t.contentDocument)}l||r();var t=this;e(t,(function(e){a(o)}))}""!==c.position&&(r(c),l=!0);var h=document.createElement("object");h.style.cssText=u,h.tabIndex=-1,h.type="text/html",h.setAttribute("aria-hidden","true"),h.onload=s,n.isIE()||(h.data="about:blank"),i(o)&&(o.appendChild(h),i(o).object=h,n.isIE()&&(h.data="about:blank"))}i(o).startSize={width:h,height:f},r?r.add(d):d()}n.isIE(8)?a(o):u(o,a)}function u(e){return i(e).object}function l(e){if(i(e)){var t=u(e);t&&(n.isIE(8)?e.detachEvent("onresize",t.proxy):e.removeChild(t),i(e).checkForObjectDocumentTimeoutId&&window.clearTimeout(i(e).checkForObjectDocumentTimeoutId),delete i(e).object)}}return{makeDetectable:a,addListener:o,uninstall:l}}},8227:function(e,t,r){"use strict";var n=r(4576),i=r(5745),o=r(9297),s=r(3392),a=r(4495),u=r(7040),l=n.Symbol,c=i("wks"),h=u?l["for"]||l:l&&l.withoutSetter||s;e.exports=function(e){return o(c,e)||(c[e]=a&&o(l,e)?l[e]:h("Symbol."+e)),c[e]}},8237:function(e,t,r){"use strict";var n=r(6518),i=r(2652),o=r(9306),s=r(8551),a=r(1767),u=r(9539),l=r(4549),c=r(8745),h=r(9039),f=TypeError,d=h((function(){[].keys().reduce((function(){}),void 0)})),p=!d&&l("reduce",f);n({target:"Iterator",proto:!0,real:!0,forced:d||p},{reduce:function(e){s(this);try{o(e)}catch(h){u(this,"throw",h)}var t=arguments.length<2,r=t?void 0:arguments[1];if(p)return c(p,this,t?[e]:[e,r]);var n=a(this),l=0;if(i(n,(function(n){t?(t=!1,r=n):r=e(r,n,l),l++}),{IS_RECORD:!0}),t)throw new f("Reduce of empty iterator with no initial value");return r}})},8392:function(e){"function"===typeof Object.create?e.exports=function(e,t){t&&(e.super_=t,e.prototype=Object.create(t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(e,t){if(t){e.super_=t;var r=function(){};r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e}}},8480:function(e,t,r){"use strict";var n=r(1828),i=r(8727),o=i.concat("length","prototype");t.f=Object.getOwnPropertyNames||function(e){return n(e,o)}},8551:function(e,t,r){"use strict";var n=r(34),i=String,o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not an object")}},8622:function(e,t,r){"use strict";var n=r(4576),i=r(4901),o=n.WeakMap;e.exports=i(o)&&/native code/.test(String(o))},8686:function(e,t,r){"use strict";var n=r(3724),i=r(9039);e.exports=n&&i((function(){return 42!==Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype}))},8727:function(e){"use strict";e.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},8745:function(e,t,r){"use strict";var n=r(616),i=Function.prototype,o=i.apply,s=i.call;e.exports="object"==typeof Reflect&&Reflect.apply||(n?s.bind(o):function(){return s.apply(o,arguments)})},8773: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},8899:function(e,t,r){"use strict";r(4114),e.exports=function(e){var t={};function r(r){var n=e.get(r);return void 0===n?[]:t[n]||[]}function n(r,n){var i=e.get(r);t[i]||(t[i]=[]),t[i].push(n)}function i(e,t){for(var n=r(e),i=0,o=n.length;i<o;++i)if(n[i]===t){n.splice(i,1);break}}function o(e){var t=r(e);t&&(t.length=0)}return{get:r,add:n,removeListener:i,removeAllListeners:o}}},8981:function(e,t,r){"use strict";var n=r(7750),i=Object;e.exports=function(e){return i(n(e))}},9039:function(e){"use strict";e.exports=function(e){try{return!!e()}catch(t){return!0}}},9297:function(e,t,r){"use strict";var n=r(9504),i=r(8981),o=n({}.hasOwnProperty);e.exports=Object.hasOwn||function(e,t){return o(i(e),t)}},9306:function(e,t,r){"use strict";var n=r(4901),i=r(6823),o=TypeError;e.exports=function(e){if(n(e))return e;throw new o(i(e)+" is not a function")}},9433:function(e,t,r){"use strict";var n=r(4576),i=Object.defineProperty;e.exports=function(e,t){try{i(n,e,{value:t,configurable:!0,writable:!0})}catch(r){n[e]=t}return t}},9462:function(e,t,r){"use strict";var n=r(9565),i=r(2360),o=r(6699),s=r(6279),a=r(8227),u=r(1181),l=r(5966),c=r(7657).IteratorPrototype,h=r(2529),f=r(9539),d=a("toStringTag"),p="IteratorHelper",y="WrapForValidIterator",v=u.set,m=function(e){var t=u.getterFor(e?y:p);return s(i(c),{next:function(){var r=t(this);if(e)return r.nextHandler();if(r.done)return h(void 0,!0);try{var n=r.nextHandler();return r.returnHandlerResult?n:h(n,r.done)}catch(i){throw r.done=!0,i}},return:function(){var r=t(this),i=r.iterator;if(r.done=!0,e){var o=l(i,"return");return o?n(o,i):h(void 0,!0)}if(r.inner)try{f(r.inner.iterator,"normal")}catch(s){return f(i,"throw",s)}return i&&f(i,"normal"),h(void 0,!0)}})},g=m(!0),b=m(!1);o(b,d,"Iterator Helper"),e.exports=function(e,t,r){var n=function(n,i){i?(i.iterator=n.iterator,i.next=n.next):i=n,i.type=t?y:p,i.returnHandlerResult=!!r,i.nextHandler=e,i.counter=0,i.done=!1,v(this,i)};return n.prototype=t?g:b,n}},9504:function(e,t,r){"use strict";var n=r(616),i=Function.prototype,o=i.call,s=n&&i.bind.bind(o,o);e.exports=n?s:function(e){return function(){return o.apply(e,arguments)}}},9519:function(e,t,r){"use strict";var n,i,o=r(4576),s=r(2839),a=o.process,u=o.Deno,l=a&&a.versions||u&&u.version,c=l&&l.v8;c&&(n=c.split("."),i=n[0]>0&&n[0]<4?1:+(n[0]+n[1])),!i&&s&&(n=s.match(/Edge\/(\d+)/),(!n||n[1]>=74)&&(n=s.match(/Chrome\/(\d+)/),n&&(i=+n[1]))),e.exports=i},9539:function(e,t,r){"use strict";var n=r(9565),i=r(8551),o=r(5966);e.exports=function(e,t,r){var s,a;i(e);try{if(s=o(e,"return"),!s){if("throw"===t)throw r;return r}s=n(s,e)}catch(u){a=!0,s=u}if("throw"===t)throw r;if(a)throw s;return i(s),r}},9565:function(e,t,r){"use strict";var n=r(616),i=Function.prototype.call;e.exports=n?i.bind(i):function(){return i.apply(i,arguments)}},9606:function(e){"use strict";e.exports=function(e){var t=e.idGenerator,r=e.stateHandler.getState;function n(e){var t=r(e);return t&&void 0!==t.id?t.id:null}function i(e){var n=r(e);if(!n)throw new Error("setId required the element to have a resize detection state.");var i=t.generate();return n.id=i,i}return{get:n,set:i}}},9617:function(e,t,r){"use strict";var n=r(5397),i=r(5610),o=r(6198),s=function(e){return function(t,r,s){var a=n(t),u=o(a);if(0===u)return!e&&-1;var l,c=i(s,u);if(e&&r!==r){while(u>c)if(l=a[c++],l!==l)return!0}else for(;u>c;c++)if((e||c in a)&&a[c]===r)return e||c||0;return!e&&-1}};e.exports={includes:s(!0),indexOf:s(!1)}},9838:function(){}},__webpack_module_cache__={};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}!function(){__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}}(),function(){__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]})}}(),function(){__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}}()}(),function(){__webpack_require__.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)}}(),function(){__webpack_require__.r=function(e){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})}}(),function(){__webpack_require__.nmd=function(e){return e.paths=[],e.children||(e.children=[]),e}}(),function(){__webpack_require__.p=""}();var __webpack_exports__={};return function(){"use strict";if(__webpack_require__.r(__webpack_exports__),__webpack_require__.d(__webpack_exports__,{default:function(){return Ie},videoPlayerV2:function(){return Me}}),"undefined"!==typeof window){var e=window.document.currentScript,t=e&&e.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);t&&(__webpack_require__.p=t[1])}var r=function(){var e=this,t=e._self._c;return t("div",{ref:"mediaContentBoxRef",staticClass:"base-content wwav-player"},[t("div",{ref:"mediaBoxRef",staticClass:"wcs-wwav-base-video"}),t("controller",{directives:[{name:"show",rawName:"v-show",value:e.showController,expression:"showController"}],ref:"controllerRef",attrs:{features:e.features,"stream-working":e.streamWorking,"media-info":e.mediaInfo,"stream-info":e.streamOptions,"stream-type":e.streamType,"is-live":e.isLive,"is-closed":e.isClosedVideo,videoStatus:e.videoStatus},on:{fullscreen:e.fullScreen,"change-ptz-switch":e.changePTZSwitch,"stop-video":e.stopVideo,"lock-ptz":e.lockPTZ,"control-talk":e.controlTalk,"control-sound":e.controlVideoSound,"change-quality":e.changeQuality,"change-play-speed":e.changePlaySpeed,"change-play-status":e.changePlayStatus,"capture-video":e.captureVideo}}),e.enablePTZ&&e.isLive&&e.isFullscreen?t("PTZControl",{ref:"ptzControl",attrs:{"is-fullscreen":e.isFullscreen},on:{"move-to-direction":e.moveToDirection,"do-zoom":e.doZoom}}):e._e()],1)},n=[];__webpack_require__(8111),__webpack_require__(7588),__webpack_require__(4979);const i={vConnect:0,vStart:1,vPlay:2,vPause:3,vStop:4};function o(e){e=parseInt(e);let t=0,r="B/s";return e>=1073741824?(t=(e/1073741824).toFixed(2),r="GB/s"):e>=1048576?(t=(e/1048576).toFixed(2),+t>=10&&(t=(+t).toFixed(1)),r="MB/s"):e>=1024?(t=Math.floor(e/1024),r="KB/s"):e>=0&&(t=e,r="B/s"),t+r}function s(e,t,r){let n,i,o,s,a;t=t||200;const u=function(){const l=+new Date-s;l<t&&l>0?n=setTimeout(u,t-l):(n=null,r||(a=e.apply(o,i),n||(o=i=null)))};return function(){o=this,i=arguments,s=+new Date;const l=r&&!n;return n||(n=setTimeout(u,t)),l&&(a=e.apply(o,i),o=i=null),a}}function a(e,t=200,r=800){let n=null,i=new Date;return function(){const o=this,s=arguments,a=new Date;clearTimeout(n),a-i>=r?(e.apply(o,s),i=a):n=setTimeout((function(){e.apply(o,s)}),t)}}function u(){const e=+new Date+"",t=parseInt(65536*(1+Math.random()))+"";return(+(t+e)).toString(32)}function l(e,t,r){const n=window.URL.createObjectURL(new Blob([e])),i=document.createElement("a");i.style.display="none",i.href=n,t=t||"file-no-name";const o=t+"_"+u()+r;i.setAttribute("download",o),document.body.appendChild(i),i.click(),document.body.removeChild(i)}function c(e){const t=e.split(";base64,"),r=t[0].split(":")[1],n=window.atob(t[1]),i=n.length,o=new Uint8Array(i);for(let s=0;s<i;++s)o[s]=n.charCodeAt(s);return new Blob([o],{type:r})}var h=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wwav-player__footer"},[t("span",{staticClass:"wwav-player__common-icon wwav-player__footer--stop",attrs:{title:"关闭"},on:{click:function(t){return t.stopPropagation(),e.stopVideo.apply(null,arguments)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8926",width:"13",height:"13"}},[t("path",{attrs:{d:"M788.842733 146.596542a485.068578 485.068578 0 0 1 86.347229 78.14224 510.614455 510.614455 0 0 1 64.763128 94.31408 465.389593 465.389593 0 0 1 41.014123 107.249385 475.088367 475.088367 0 0 1 14.071881 114.794079q0 100.245919-38.318816 188.097757t-103.62317 153.058773Q787.76028 947.470614 699.789372 985.735307t-188.346721 38.264693q-99.304185 0-187.264269-38.264693t-153.816489-103.471627Q104.516313 817.045922 66.738723 729.204908T28.961134 541.107151a468.701898 468.701898 0 0 1 13.487357-112.098773 497.495132 497.495132 0 0 1 38.318816-104.554079 461.005661 461.005661 0 0 1 61.526595-92.701225 524.231707 524.231707 0 0 1 82.039069-77.611839c15.825454-11.495645 32.841606-15.305877 51.264947-12.989429 11.906977 1.537082 24.192812 12.480676 25.253615 25.71907 1.786046 22.168626-13.963636 39.726004-31.726681 53.256659Q189.164092 278.525843 146.634536 363.487533T104.12663 546.086432q0 83.684397 31.72668 157.864861t86.942579 129.34224q55.205073 55.205073 129.461309 87.494629t158.038053 32.332854q83.770993 0 158.038054-32.332854t129.461309-87.494629q55.205073-55.205073 87.570401-129.34224T917.654571 546.086432a400.669763 400.669763 0 0 0-45.668668-187.036954q-45.690317-88.133276-128.184016-145.200167c-18.618182-12.675518-32.278731-30.655053-30.02723-52.845327 1.60203-15.749683 11.008541-23.911374 23.251078-25.71907 18.780549-2.781903 35.980718 0.541226 51.806173 11.311628z","p-id":"8927"}}),t("path",{attrs:{d:"M501.245949 0.000011A42.930063 42.930063 0 0 1 544.208486 42.930074v429.354752a42.935475 42.935475 0 0 1-85.870951 0V42.930074A42.930063 42.930063 0 0 1 501.245949 0.000011z","p-id":"8928"}})])]),t("div",{staticClass:"wwav-player__footer--left"},[t("span",{staticClass:"wwav-player__common-span wwav-player__footer--net-speed"},[t("span",[e._v(e._s(e.formatNetSpeed(e.netSpeed)))])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.streamWorking,expression:"streamWorking"}],staticClass:"wwav-player__common-span wwav-player__footer--info"},[t("span",{attrs:{title:"视频信息"},on:{click:function(t){e.showInfoPop=!e.showInfoPop}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8059",width:"13",height:"13"}},[t("path",{attrs:{d:"M512 2q139 1 255 68.5T953 257q69 121 69 255t-69 255q-70 119-186 186.5T512 1022q-217-6-360.5-149.5T2 512q6-217 149.5-360.5T512 2z m76 313q30 0 49-17.5t19-47.5-19-47.5-48.5-17.5-48.5 17.5-19 47.5 19 47.5 48 17.5z m14 410q0-7 1-18.5t0-21.5l-60 69q-10 10-19.5 16t-15.5 4q-11-5-9-17l99-315q6-31-10-54t-52-27q-39 1-86 33.5T368 476l-1 18q0 12 1 21l59-69q10-10 19.5-15.5t15-3.5 8 7 0.5 11l-99 313q-8 29 8 51.5t55 29.5q57-1 96-32.5t72-81.5z","p-id":"8060"}})])]),t("ul",{staticClass:"wwav-player__footer__pop wwav-player__footer--info-pop",class:{show:e.showInfoPop}},[t("li",{staticClass:"wwav-player__footer--info-pop--item",attrs:{title:e.mediaInfo.format}},[e._v(" 流类型: "+e._s(e.mediaInfo.format)+" ")]),t("li",{staticClass:"wwav-player__footer--info-pop--item",attrs:{title:e.mediaInfo.format}},[e._v(" 解码方式: "+e._s(e.isH265?e.mediaInfo.mode||"软解码":"硬解码")+" ")]),t("li",{staticClass:"wwav-player__footer--info-pop--item"},[e._v(" 分辨率: "+e._s(`${e.mediaInfo.width}x${e.mediaInfo.height}`)+" ")]),t("li",{staticClass:"wwav-player__footer--info-pop--item"},[e._v(" 实时帧率: "+e._s(`${e.streamInfo.fps}`)+" ")])])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.streamWorking,expression:"streamWorking"}],staticClass:"wwav-player__common-span wwav-player__footer--info"},[e.muted?t("span",{attrs:{title:"静音"},on:{click:function(t){return e.controlSound(!1)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{t:"1701137543703",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3869",width:"200",height:"200"}},[t("path",{attrs:{d:"M553.948279 55.153116a48.580465 48.580465 0 0 0-30.684279 11.121117L258.714791 294.816744H73.013581c-40.20986 0-72.489674 32.279814-72.489674 71.953861L0 679.995535c0 39.685953 32.803721 72.477767 73.013581 72.477767H261.35814l260.834232 205.288186a46.734884 46.734884 0 0 0 30.684279 11.097303c25.373767 0 48.663814-19.57507 48.663814-48.128l1.047814-817.413954c0.559628-28.600558-23.242419-48.163721-48.64-48.163721z m-24.349767 816.354233L305.806884 695.331721a71.930047 71.930047 0 0 0-44.436837-15.336186H71.95386l1.059721-312.689116 185.70121-0.512c17.467535 0 33.863442-6.370233 47.092093-17.467535l224.851349-194.16707-1.059721 716.347535z m0 0",fill:"#a6b0b3","p-id":"3870"}}),t("path",{attrs:{d:"M1012.950326 624.568558c14.57414 14.57414 14.764651 38.018977 0.416744 52.366884-14.347907 14.347907-37.792744 14.169302-52.366884-0.404837L683.901023 399.431442c-14.57414-14.57414-14.764651-38.018977-0.416744-52.366884 14.347907-14.347907 37.792744-14.157395 52.366884 0.416744l277.099163 277.087256z m0 0",fill:"#a6b0b3","p-id":"3871"}}),t("path",{attrs:{d:"M960.988279 347.481302c14.57414-14.57414 38.018977-14.764651 52.366884-0.416744 14.347907 14.347907 14.157395 37.792744-0.416744 52.366884L735.851163 676.518698c-14.57414 14.57414-38.018977 14.764651-52.366884 0.404837-14.347907-14.347907-14.169302-37.792744 0.404837-52.366884l277.099163-277.075349z m0 0",fill:"#a6b0b3","p-id":"3872"}})])]):t("span",{attrs:{title:"播放"},on:{click:function(t){return e.controlSound(!0)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{t:"1701137473691",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3694",width:"200",height:"200"}},[t("path",{attrs:{d:"M536.873674 69.227163c-10.251907 0-21.039628 3.584-29.743627 10.775814L250.749023 301.520372H70.763163c-38.971535 0-70.251163 31.279628-70.251163 69.739163L0 674.816c0 38.459535 31.791628 70.239256 70.763163 70.239256h182.54586l252.797024 198.953674a45.353674 45.353674 0 0 0 29.743627 10.763907c24.587907 0 47.163535-18.967814 47.163535-46.651535l1.024-792.21879c0.523907-27.707535-22.551814-46.675349-47.163535-46.675349z m-23.599627 791.19479l-216.885582-170.746046a69.774884 69.774884 0 0 0-43.067535-14.859907H69.739163l1.035907-303.056372 179.973953-0.500093c16.931721 0 32.815628-6.167814 45.639442-16.931721l217.921488-188.189767-1.035906 694.283906z m207.169488-578.393302c-15.907721-10.752-37.959442-6.144-48.211349 9.751814-10.752 15.883907-6.144 37.935628 9.751814 48.199442 54.343442 36.411535 87.170977 96.398884 87.170977 160.49414 0 62.035349-30.767628 120.498605-82.03907 156.898232a34.685023 34.685023 0 0 0-8.215814 48.711442c6.667907 9.751814 17.419907 14.883721 28.719628 14.883721 7.168 0 14.336-2.059907 19.991814-6.667907 69.75107-49.735442 111.270698-129.738419 111.270698-214.349395 0-87.170977-44.091535-168.68614-118.438698-217.921489z m0 0",fill:"#a6b0b3","p-id":"3695"}}),t("path",{attrs:{d:"M868.62586 154.362047c-14.359814-12.823814-36.411535-11.799814-49.235348 2.56-12.811907 14.359814-11.776 36.399628 2.56 49.211534 84.110884 75.394977 132.298419 182.557767 132.298418 294.340466 0 109.222698-44.079628 210.741581-124.082604 286.124651-13.835907 13.323907-14.859907 35.375628-1.536 49.211535 6.667907 7.191814 15.895814 10.775814 25.635721 10.775814a33.696744 33.696744 0 0 0 24.09972-9.751814C972.204651 747.615256 1024 628.140651 1024 499.95014c0.500093-130.750512-55.903256-256.881116-155.37414-345.588093z m0 0",fill:"#a6b0b3","p-id":"3696"}})])])]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.isLive&&e.streamWorking,expression:"isLive && streamWorking"}],staticClass:"wwav-player__common-span wwav-player__footer--info"},[e.talk?t("span",{attrs:{title:"打开"},on:{click:function(t){return e.controlTalk(!1)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{t:"1715247665991",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2650",width:"200",height:"200"}},[t("path",{attrs:{d:"M512 53.312a245.312 245.312 0 0 0-245.312 245.376v170.624a245.312 245.312 0 1 0 490.624 0V298.688A245.312 245.312 0 0 0 512 53.312zM330.688 298.688a181.312 181.312 0 1 1 362.624 0v170.624a181.312 181.312 0 1 1-362.624 0V298.688z",fill:"#a6b0b3","p-id":"2651"}}),t("path",{attrs:{d:"M202.688 469.312a32 32 0 0 0-64 0A373.376 373.376 0 0 0 480 841.344v65.28H384a32 32 0 1 0 0 64h256a32 32 0 0 0 0-64H544v-65.28a373.376 373.376 0 0 0 341.312-372.032 32 32 0 1 0-64 0 309.312 309.312 0 1 1-618.624 0z",fill:"#a6b0b3","p-id":"2652"}})])]):t("span",{attrs:{title:"关闭"},on:{click:function(t){return e.controlTalk(!0)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{t:"1715247713318",viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2844",width:"200",height:"200"}},[t("path",{attrs:{d:"M62.72 62.72a32 32 0 0 1 45.248 0l212.864 212.8 0.96 1.024 340.224 340.224a35.84 35.84 0 0 1 1.216 1.216l89.92 89.92a35.712 35.712 0 0 1 1.088 1.088l207.04 207.04a32 32 0 1 1-45.248 45.248l-187.648-187.648a371.456 371.456 0 0 1-184.32 67.648v65.408H640a32 32 0 1 1 0 64H384a32 32 0 0 1 0-64h96v-65.344a373.376 373.376 0 0 1-341.376-372.032 32 32 0 0 1 64 0 309.312 309.312 0 0 0 479.68 258.304l-46.464-46.464a245.312 245.312 0 0 1-369.216-211.84v-157.44L62.72 108.032a32 32 0 0 1 0-45.248z m267.968 406.592a181.312 181.312 0 0 0 257.856 164.48l-257.92-257.92v93.44zM512 117.312c-66.944 0-125.44 36.288-156.928 90.432a32 32 0 1 1-55.296-32.192 245.312 245.312 0 0 1 457.6 123.072v170.688c0 40.128-9.664 78.08-26.816 111.552a32 32 0 0 1-56.96-29.12 180.48 180.48 0 0 0 19.712-82.432V298.688A181.312 181.312 0 0 0 512 117.312zM885.312 469.312a32 32 0 1 0-64 0c0 63.936-19.328 123.2-52.48 172.48a32 32 0 1 0 53.12 35.712c40-59.52 63.36-131.2 63.36-208.192z",fill:"#a6b0b3","p-id":"2845"}})])])])]),t("div",{staticClass:"wwav-player__footer--right"},[!e.isLive&&e.streamWorking?t("span",{staticClass:"wwav-player__common-icon wwav-player__footer--play"},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.isPausing,expression:"isPausing"}],attrs:{title:"播放"},on:{click:function(t){return e.changePlayStatus(e.VideoStatus.vPlay)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3537",width:"13",height:"13"}},[t("path",{attrs:{d:"M701.44 539.648L440.32 711.475a32.973 32.973 0 0 1-45.67-9.42 31.949 31.949 0 0 1-5.53-18.228V340.173a32.973 32.973 0 0 1 32.973-32.973 33.792 33.792 0 0 1 18.227 5.325l261.12 171.827a33.178 33.178 0 0 1 9.42 45.875 37.478 37.478 0 0 1-9.42 9.421z","p-id":"3538"}}),t("path",{attrs:{d:"M512 1024a512 512 0 1 1 512-512 512 512 0 0 1-512 512z m0-57.958A454.042 454.042 0 1 0 57.958 512 454.246 454.246 0 0 0 512 966.042z","p-id":"3539"}})])]),t("span",{directives:[{name:"show",rawName:"v-show",value:e.isPlaying,expression:"isPlaying"}],attrs:{title:"暂停"},on:{click:function(t){return e.changePlayStatus(e.VideoStatus.vPause)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"4431",width:"13",height:"13"}},[t("path",{attrs:{d:"M512 8.858C234.496 8.858 8.858 234.496 8.858 512S234.548 1015.142 512 1015.142c277.504 0 503.142-225.69 503.142-503.142C1015.142 234.496 789.504 8.858 512 8.858z m0 937.984A434.79 434.79 0 0 1 77.158 512 434.79 434.79 0 0 1 512 77.158 434.79 434.79 0 0 1 946.842 512 434.79 434.79 0 0 1 512 946.842zM408.474 304.947a45.978 45.978 0 0 0-45.568 45.568v320.922c0 24.832 20.736 45.568 45.568 45.568s45.568-20.736 45.568-45.568V350.515a45.978 45.978 0 0 0-45.568-45.568z m207.052 0a45.978 45.978 0 0 0-45.568 45.568v320.922c0 24.832 20.736 45.568 45.568 45.568s45.568-20.736 45.568-45.568V350.515a45.978 45.978 0 0 0-45.568-45.568z","p-id":"4432"}})])])]):e._e(),t("div",{directives:[{name:"show",rawName:"v-show",value:!e.isLive&&e.streamWorking&&(e.isH265&&e.ableH265capture||!e.isH265),expression:"!isLive && streamWorking && (isH265 && ableH265capture || !isH265)"}],staticClass:"wwav-player__common-span wwav-player__footer--speed"},[t("div",{attrs:{title:"播放速度"},on:{click:function(t){e.showSpeedPop=!e.showSpeedPop}}},[t("span",[e._v(e._s(1===e.playSpeed?"倍速":e.playSpeedText))])]),t("ul",{staticClass:"wwav-player__footer__pop wwav-player__footer--speed-pop",class:{show:e.showSpeedPop}},[t("li",{staticClass:"wwav-player__footer--speed-pop--item"},[t("i",{staticClass:"wwav-player__common-icon",on:{click:function(t){return e.speedChange("minus")}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"7641",width:"13",height:"13"}},[t("path",{attrs:{d:"M512 1024c-69.11 0-136.16-13.54-199.3-40.25-60.97-25.79-115.72-62.7-162.74-109.71-47.01-47.01-83.92-101.76-109.71-162.74C13.54 648.16 0 581.11 0 512s13.54-136.16 40.25-199.3c25.79-60.97 62.7-115.72 109.71-162.74 47.01-47.01 101.76-83.92 162.74-109.71C375.84 13.54 442.89 0 512 0s136.16 13.54 199.3 40.25c60.97 25.79 115.72 62.7 162.74 109.71 47.01 47.01 83.92 101.76 109.71 162.74C1010.46 375.84 1024 442.9 1024 512s-13.54 136.16-40.25 199.3c-25.79 60.97-62.7 115.72-109.71 162.74-47.01 47.01-101.76 83.92-162.74 109.71C648.16 1010.46 581.11 1024 512 1024z m0-960c-60.49 0-119.16 11.84-174.37 35.19-53.34 22.56-101.26 54.87-142.41 96.02-41.15 41.15-73.46 89.07-96.02 142.41C75.84 392.84 64 451.51 64 512s11.84 119.16 35.19 174.37c22.56 53.34 54.87 101.26 96.02 142.41 41.15 41.15 89.07 73.46 142.41 96.02C392.84 948.16 451.51 960 512 960c60.49 0 119.16-11.84 174.37-35.19 53.34-22.56 101.26-54.87 142.41-96.02 41.15-41.15 73.46-89.07 96.02-142.41C948.16 631.16 960 572.49 960 512s-11.84-119.16-35.19-174.37c-22.56-53.34-54.87-101.26-96.02-142.41-41.15-41.15-89.07-73.46-142.41-96.02C631.16 75.84 572.49 64 512 64z","p-id":"7642"}}),t("path",{attrs:{d:"M707.45 544h-390.9c-17.67 0-32-14.33-32-32s14.33-32 32-32h390.9c17.67 0 32 14.33 32 32s-14.33 32-32 32z","p-id":"7643"}})])]),t("span",{staticClass:"speed-text"},[e._v(e._s(e.playSpeedText))]),t("i",{staticClass:"wwav-player__common-icon",on:{click:function(t){return e.speedChange("plus")}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"8501",width:"13",height:"13"}},[t("path",{attrs:{d:"M512 1008.211454c-133.07489 0-257.127753-51.876652-349.603524-144.352423C67.665198 769.127753 15.788546 645.07489 15.788546 512S67.665198 254.872247 160.140969 160.140969C252.61674 65.409692 378.92511 15.788546 509.744493 15.788546S769.127753 67.665198 861.603524 160.140969c94.731278 94.731278 144.352423 218.784141 144.352423 351.859031s-51.876652 257.127753-144.352423 351.859031c-92.475771 92.475771-218.784141 144.352423-349.603524 144.352423z m0-922.502203c-112.77533 0-221.039648 45.110132-299.982379 124.052864-81.198238 81.198238-124.052863 187.207048-124.052863 299.982378s45.110132 221.039648 124.052863 299.982379c81.198238 81.198238 187.207048 124.052863 299.982379 124.052864s221.039648-45.110132 299.982379-124.052864c81.198238-81.198238 124.052863-187.207048 124.052863-299.982379s-45.110132-221.039648-124.052863-299.982378c-81.198238-78.942731-187.207048-124.052863-299.982379-124.052864z m248.105727 390.202643h-212.017621v-214.273127c0-20.299559-15.788546-36.088106-36.088106-36.088106s-36.088106 15.788546-36.088106 36.088106v214.273127h-212.017621c-20.299559 0-36.088106 15.788546-36.088106 36.088106 0 20.299559 15.788546 36.088106 36.088106 36.088106h212.017621v214.273127c0 20.299559 15.788546 36.088106 36.088106 36.088106s36.088106-15.788546 36.088106-36.088106v-214.273127h212.017621c20.299559 0 36.088106-15.788546 36.088106-36.088106-2.255507-20.299559-18.044053-36.088106-36.088106-36.088106z","p-id":"8502"}})])])])])]),t("span",{directives:[{name:"show",rawName:"v-show",value:(e.isPlaying||e.isPausing)&&(e.isH265&&e.ableH265capture||!e.isH265),expression:"(isPlaying || isPausing) && (isH265 && ableH265capture || !isH265)"}],staticClass:"wwav-player__common-icon wwav-player__footer--capture",attrs:{title:"截屏"},on:{click:function(t){return t.stopPropagation(),e.captureVideo.apply(null,arguments)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1132 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2202",width:"13",height:"13"}},[t("path",{attrs:{d:"M987.332085 0H146.998468C66.647149 0 1.437957 64.27234 1.437957 143.468936v678.410894a42.550468 42.550468 0 0 0 0 21.830808v36.820426C1.41617 959.72766 66.625362 1024 147.020255 1024h840.333617C1067.726979 1024 1132.93617 959.72766 1132.93617 880.531064V143.468936C1132.93617 64.27234 1067.726979 0 987.332085 0zM146.998468 87.345021h840.333617c31.35183 0 56.973617 25.273191 56.973617 56.123915v544.898724c-32.898723-43.966638-72.769362-92.007489-114.252255-130.069788-24.684936-22.745872-55.383149-32.114383-88.93549-27.430127-52.85583 7.494809-110.788085 50.851404-176.91234 132.24851a1004.456851 1004.456851 0 0 0-41.787915 55.208851c-58.237277-79.218383-172.81634-225.497872-269.987404-292.885787-28.802723-19.957106-61.091404-24.619574-94.011915-14.030979-35.752851 11.547234-70.590638 41.482894-106.016681 91.397447-20.567149 28.693787-41.461106 64.250553-62.681872 106.038468V143.468936a56.799319 56.799319 0 0 1 57.300425-56.123915z","p-id":"2203"}}),t("path",{attrs:{d:"M697.191489 337.702128a76.255319 76.255319 0 1 0 152.510639 0 76.255319 76.255319 0 1 0-152.510639 0z","p-id":"2204"}})])]),e.isLive&&!e.isClosed?t("div",{staticClass:"wwav-player__common-span wwav-player__footer--quality"},[t("span",{on:{click:function(t){e.showQualityPop=!e.showQualityPop}}},[e._v(e._s(e.videoQualityText))]),t("ul",{staticClass:"wwav-player__footer__pop wwav-player__footer--quality-select",class:{show:e.showQualityPop}},e._l(["高清","标清","流畅"],(function(r,n){return t("li",{key:r,staticClass:"wwav-player__footer--quality-select--item",class:{active:n===e.videoQuality},on:{click:function(t){return e.changeQuality(n)}}},[e._v(" "+e._s(r)+" ")])})),0)]):e._e(),0!==e.features.length?t("div",{staticClass:"wwav-player__common-span wwav-player__footer--setting"},[t("span",{attrs:{title:"其他设置"},on:{click:function(t){e.showSettingPop=!e.showSettingPop}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"6778",width:"16",height:"16"}},[t("path",{attrs:{d:"M962.496 448.96c-3.584-19.84-22.656-39.808-42.304-44.288l-14.72-3.392c-34.624-10.432-65.536-33.536-84.992-67.328-19.648-33.984-24.128-72.576-15.616-107.968 0 0 0 0 0 0l4.288-13.824c5.952-19.264-1.792-45.76-17.216-58.816 0 0-13.824-11.712-52.992-34.304-39.168-22.592-56.128-28.736-56.128-28.736-19.008-6.848-45.76-0.32-59.52 14.464L612.928 115.84C586.56 140.672 551.104 155.904 512 155.904c-39.232 0-74.88-15.36-101.248-40.384L400.832 104.832C387.136 90.048 360.32 83.52 341.312 90.368c0 0-17.024 6.144-56.256 28.736C245.952 141.696 232.128 153.344 232.128 153.344 216.768 166.4 209.024 192.832 214.976 212.16l4.288 14.016c8.448 35.328 3.904 73.856-15.68 107.776C184 367.872 152.896 391.04 118.08 401.408L103.808 404.672c-19.648 4.48-38.72 24.448-42.304 44.288 0 0-3.2 17.792-3.2 63.04 0 45.248 3.2 62.976 3.2 62.976 3.584 19.84 22.656 39.808 42.304 44.288l13.952 3.2c0 0 0 0 0 0 34.944 10.304 66.112 33.536 85.824 67.584 19.648 33.984 24.128 72.576 15.616 107.968 0 0 0 0 0 0l-4.224 13.76c-5.952 19.264 1.792 45.76 17.216 58.816 0 0 13.824 11.712 52.992 34.304 39.168 22.592 56.128 28.736 56.128 28.736 19.008 6.848 45.76 0.32 59.52-14.464l9.792-10.56c26.432-25.024 62.08-40.448 101.376-40.448 39.296 0 75.008 15.424 101.44 40.512 0 0 0 0 0.064 0l9.728 10.496c13.76 14.784 40.512 21.312 59.52 14.464 0 0 17.024-6.144 56.256-28.736 39.168-22.592 52.928-34.304 52.928-34.304 15.424-13.056 23.168-39.488 17.216-58.816l-4.352-14.208c-8.32-35.264-3.84-73.664 15.744-107.52 19.648-34.048 50.88-57.216 85.824-67.584 0 0 0-0.064 0-0.064l13.952-3.2c19.648-4.48 38.72-24.448 42.304-44.288 0 0 3.2-17.792 3.2-63.04C965.696 466.752 962.496 448.96 962.496 448.96zM512 692.928c-99.904 0-180.928-81.024-180.928-180.928S412.096 331.136 512 331.136s180.928 81.024 180.928 180.928S611.904 692.928 512 692.928z","p-id":"6779"}})])]),t("ul",{staticClass:"wwav-player__footer__pop wwav-player__footer--setting-pop",class:{show:e.showSettingPop}},[-1!==e.features.indexOf("PTZ")?t("li",{staticClass:"wwav-player__footer--setting-pop--item"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.PTZSwitch,expression:"PTZSwitch"}],staticClass:"styled-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.PTZSwitch)?e._i(e.PTZSwitch,null)>-1:e.PTZSwitch},on:{change:[function(t){var r=e.PTZSwitch,n=t.target,i=!!n.checked;if(Array.isArray(r)){var o=null,s=e._i(r,o);n.checked?s<0&&(e.PTZSwitch=r.concat([o])):s>-1&&(e.PTZSwitch=r.slice(0,s).concat(r.slice(s+1)))}else e.PTZSwitch=i},e.changePTZSwitch]}}),t("label",[e._v("云台(需全屏)")])]):e._e(),-1!==e.features.indexOf("AI")?t("li",{staticClass:"wwav-player__footer--setting-pop--item"},[t("input",{directives:[{name:"model",rawName:"v-model",value:e.AISwitch,expression:"AISwitch"}],staticClass:"styled-checkbox",attrs:{type:"checkbox"},domProps:{checked:Array.isArray(e.AISwitch)?e._i(e.AISwitch,null)>-1:e.AISwitch},on:{change:function(t){var r=e.AISwitch,n=t.target,i=!!n.checked;if(Array.isArray(r)){var o=null,s=e._i(r,o);n.checked?s<0&&(e.AISwitch=r.concat([o])):s>-1&&(e.AISwitch=r.slice(0,s).concat(r.slice(s+1)))}else e.AISwitch=i}}}),t("label",[e._v("智能识别")])]):e._e()])]):e._e()]),t("span",{staticClass:"wwav-player__common-icon wwav-player__footer--fullscreen",attrs:{title:"全屏"},on:{click:function(t){return t.stopPropagation(),e.fullScreen.apply(null,arguments)}}},[t("svg",{staticClass:"wwav-player__svg-icon",attrs:{viewBox:"0 0 1097 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"10458",width:"13",height:"13"}},[t("path",{attrs:{d:"M51.2 658.285714c29.257143 0 43.885714 21.942857 51.2 43.885715v219.428571h241.371429c29.257143 0 51.2 21.942857 51.2 51.2 0 29.257143-21.942857 43.885714-43.885715 51.2H0V709.485714c0-29.257143 21.942857-51.2 51.2-51.2z m950.857143 0c29.257143 0 51.2 21.942857 51.2 51.2V1024H709.485714c-29.257143 0-51.2-21.942857-51.2-51.2s21.942857-51.2 51.2-51.2H950.857143V709.485714c0-29.257143 21.942857-51.2 51.2-51.2z m-658.285714-658.285714c29.257143 0 51.2 21.942857 51.2 51.2s-21.942857 51.2-51.2 51.2H102.4v212.114286c0 29.257143-21.942857 51.2-51.2 51.2S0 343.771429 0 314.514286V0h343.771429z m709.485714 0v314.514286c0 29.257143-21.942857 51.2-51.2 51.2-29.257143 0-43.885714-21.942857-51.2-43.885715v-219.428571H709.485714c-29.257143 0-51.2-21.942857-51.2-51.2 0-29.257143 21.942857-43.885714 43.885715-51.2h351.085714z","p-id":"10459"}})])])])},f=[],d={props:{isLive:Boolean,streamWorking:Boolean,isClosed:Boolean,videoStatus:{type:Number,default:i.vStop},videoQuality:{default:1,type:Number},mediaInfo:{type:Object,default:()=>({format:"H264",width:0,height:0})},streamInfo:{type:Object,default:()=>({speed:0,fps:0})},features:{type:Array,default:()=>[]},enableAI:Boolean,devicePath:{type:String,default:""}},data(){return{showQualityPop:!1,showInfoPop:!1,showSettingPop:!1,showSpeedPop:!1,speedList:[{label:"16X",value:16},{label:"8X",value:8},{label:"4X",value:4},{label:"2X",value:2},{label:"1X",value:1},{label:"1/2X",value:.5},{label:"1/4X",value:.25},{label:"1/8X",value:.125},{label:"1/16X",value:.0625}],VideoStatus:i,muted:!0,talk:!1,isFavorite:!1,favoritesList:[],PTZSwitch:!1,playSpeed:1}},computed:{AISwitch:{get(){return this.enableAI},set(e){this.$emit("update:enableAI",e)}},isPlaying:function(){return this.videoStatus===i.vPlay},isPausing:function(){return this.videoStatus===i.vPause},isStop:function(){return this.videoStatus===i.vStop},isH265:function(){return"H265"===this.mediaInfo.format},ableH265capture:function(){return"H265"===this.mediaInfo.format&&"硬解码"===this.mediaInfo.mode},videoQualityText:function(){return 0===this.videoQuality?"高清":1===this.videoQuality?"标清":2===this.videoQuality?"流畅":"标清"},playSpeedText:function(){const e=this.speedList.findIndex((e=>e.value===this.playSpeed));return-1!==e?this.speedList[e].label:"1"},netSpeed:function(){return this.streamInfo?.speed||0}},watch:{isClosed(e){}},mounted(){},methods:{fullScreen(){this.$emit("fullscreen")},stopVideo(){console.log("清空"),this.muted=!0,this.talk=!1,this.$emit("stop-video")},captureVideo(){this.$emit("capture-video")},changeQuality(e){e=parseInt(e),(e<0||e>2)&&(e=1),this.$emit("quality-change",e),this.showQualityPop=!1},changePlayStatus(e){this.$emit("change-play-status",e)},speedChange:a((function(e){let t=this.playSpeed;"plus"===e?(t*=2,t>this.speedList[0].value&&(t=this.speedList[0].value)):(t/=2,t<this.speedList[this.speedList.length-1].value&&(t=this.speedList[this.speedList.length-1].value)),this.playSpeed=t,this.$emit("change-play-speed",t)}),1e3),handleSpeedOutsideClick(){setTimeout((()=>{this.showSpeedPop=!1}),16)},handleInfoOutsideClick(){setTimeout((()=>{this.showInfoPop=!1}),16)},handleSettingOutsideClick(){setTimeout((()=>{this.showSettingPop=!1}),16)},handleQualityOutsideClick(){setTimeout((()=>{this.showQualityPop=!1}),16)},changeMouseControlPTZStatus(){this.$emit("change-mouse-ptz-status",!this.enableMouseControlPTZ)},changeAIStatus(){this.$emit("change-ai-status",!this.enableAI)},formatNetSpeed(e){return o(1024*e)},controlSound(e){this.muted=e,this.$emit("control-sound",this.muted)},controlTalk(e){this.talk=e,this.$emit("control-talk",this.talk)},changePTZSwitch(){this.$emit("change-ptz-switch",this.PTZSwitch)}}},p=d;function y(e,t,r,n,i,o,s,a){var u,l="function"===typeof e?e.options:e;if(t&&(l.render=t,l.staticRenderFns=r,l._compiled=!0),n&&(l.functional=!0),o&&(l._scopeId="data-v-"+o),s?(u=function(e){e=e||this.$vnode&&this.$vnode.ssrContext||this.parent&&this.parent.$vnode&&this.parent.$vnode.ssrContext,e||"undefined"===typeof __VUE_SSR_CONTEXT__||(e=__VUE_SSR_CONTEXT__),i&&i.call(this,e),e&&e._registeredComponents&&e._registeredComponents.add(s)},l._ssrRegister=u):i&&(u=a?function(){i.call(this,(l.functional?this.parent:this).$root.$options.shadowRoot)}:i),u)if(l.functional){l._injectStyles=u;var c=l.render;l.render=function(e,t){return u.call(t),c(e,t)}}else{var h=l.beforeCreate;l.beforeCreate=h?[].concat(h,u):[u]}return{exports:e,options:l}}var v=y(p,h,f,!1,null,"3741a406",null),m=v.exports,g=function(){var e=this,t=e._self._c;return t("div",{ref:"videoContainer",staticClass:"wwav-player__ptz",on:{mousedown:function(t){return t.target!==t.currentTarget?null:e.onMouseDown.apply(null,arguments)},mousemove:function(t){return t.target!==t.currentTarget?null:e.onMouseMove.apply(null,arguments)},wheel:function(t){return t.target!==t.currentTarget?null:(t.preventDefault(),e.onWheel.apply(null,arguments))},mouseleave:e.onMouseLeave}},[t("span",{directives:[{name:"show",rawName:"v-show",value:e.isFullscreen,expression:"isFullscreen"}],staticClass:"wwav-player__ptz-status-label"},[e._v("可操控: "+e._s(e.isLockedByOther?"否":"是"))]),t("div",{directives:[{name:"show",rawName:"v-show",value:e.showSelectionBox,expression:"showSelectionBox"}],style:e.selectionBoxStyle}),t("Direction",{directives:[{name:"show",rawName:"v-show",value:e.isFullscreen,expression:"isFullscreen"}],attrs:{"current-direction":e.currentDirection,"stop-all-command":e.stopAllCommand,"is-inside":e.isInside,"is-fullscreen":e.isFullscreen},on:{"move-to-direction":e.moveToDirection,"do-zoom":e.doZoom}}),t("Operation",{directives:[{name:"show",rawName:"v-show",value:e.isFullscreen,expression:"isFullscreen"}],attrs:{step:e.step,"is-locked":e.isLocked,"is-locked-by-other":e.isLockedByOther,"stop-all-command":e.stopAllCommand},on:{"update:step":function(t){e.step=t},"do-zoom":e.doZoom,"lock-ptz":e.lockPTZ}}),t("PTZMessage",{ref:"message"})],1)},b=[],_={data(){return{enableMouse:!0,mouseX:0,mouseY:0,wheelStopTimer:null}},beforeDestroy(){document.removeEventListener("mouseup",this.onMouseUp,!1),clearTimeout(this.wheelStopTimer)},mounted(){document.addEventListener("mouseup",this.onMouseUp,!1)},methods:{onMouseDown:s((function(e){}),200),onMouseUp:s((function(e){}),200),onMouseMove:s((function(e){}),50),onMouseLeave:s((function(e){this.isInside=!1,this.stopAllCommand()}),300),onWheel(e){if(clearTimeout(this.wheelStopTimer),!this.isZooming){this.isZooming=!0;const t=e.deltaY>0?"zoom_out":"zoom_in";this.doZoom(t)}this.wheelStopTimer=setTimeout((()=>{this.stopAllCommand(),this.isZooming=!1}),500)},_calculateDirectionAndExecute(e,t){let r="";const[n,i]=e,[o,s]=t;if(n===o){if(i===s)return;r=i<s?"tilt_down":"tilt_up"}else{const e=((i-s)/(o-n)).toFixed(2);r=e>-1.4&&e<-.7?n<o?"down_right":"up_left":e>=-.7&&e<=.7?n<o?"pan_right":"pan_left":e>.7&&e<1.4?n<o?"up_right":"down_left":i<s?"tilt_down":"tilt_up"}this.moveToDirection(r)}}},w={data(){return{isLocked:!1,lockToken:null,isLockedByOther:!1,unlockTimerId:0,idle_timeout:10}},mounted(){this.initPTZ()},methods:{initPTZ(){this.checkLockStatus()},lockPTZCB(e){if(e&&200===e.reply)this.lockToken=e.content.token,this.isLocked=!0,this.isLockedByOther=!1,this.showMessage({type:"success",message:"云台已锁定为仅有你可操作"}),clearInterval(this.unlockTimerId),this.unlockTimerId=window.setInterval((()=>{this.checkLockStatus()}),1e3*(this.idle_timeout+3));else{const t=e.err_msg+"("+e.reply+")";this.showMessage({type:"error",message:"锁定云台失败:"+t}),this.isLocked=!1,this.lockToken=null}},unlockPTZCB(e){if(e&&200===e.reply)this.resetLock(),this.showMessage({type:"success",message:"云台已解锁"});else{const t=e.err_msg+"("+e.reply+")";this.showMessage({type:"error",message:"解锁云台失败:"+t})}},checkLockStatus(){this.sendOtherCommand("get_lock_status",{},{cb:this.checkLockStatusCB.bind(this)})},checkLockStatusCB(e){if(e&&200===e.reply)if("unlocked"===e.content.status)this.resetLock();else if("locked"===e.content.status){const t=e.content.remain_time;t<=0?this.resetLock():(this.lockToken?(this.isLocked=!0,this.isLockedByOther=!1):(this.isLockedByOther=!0,this.isLocked=!1),clearInterval(this.unlockTimerId),this.unlockTimerId=window.setInterval((()=>{this.checkLockStatus()}),1e3*(t+3)))}},resetLock(){clearInterval(this.unlockTimerId),this.unlockTimerId=0,this.lockToken=null,this.isLocked=!1,this.isLockedByOther=!1}}},S=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wwav-player__ptz__direction",on:{mouseup:e.stopCommand,mouseleave:function(t){return t.stopPropagation(),e.stopCommand.apply(null,arguments)}}},[t("div",{staticClass:"wwav-player-center-middle wwav-player__ptz__direction-content"},e._l(e.commands,(function(r){return t("div",{key:r,class:{"wwav-player__ptz__direction-triangle":!0,active:r==e.currentDirection},on:{mousedown:function(t){return t.stopPropagation(),e.moveToDirection(r)}}})})),0),t("div",{staticClass:"wwav-player-center-middle wwav-player__ptz__direction-circle-border"}),t("div",{staticClass:"wwav-player-center-middle wwav-player__ptz__direction-circle"})])},E=[],A={name:"WCSPlayerPTZDirection",props:{currentDirection:{type:String,default:""},isInside:{type:Boolean,default:!1},isFullscreen:{type:Boolean,default:!1},stopAllCommand:{type:Function,required:!0}},data(){return{isKeydowning:!1,isBinding:!1,commands:["tilt_up","up_right","pan_right","down_right","tilt_down","down_left","pan_left","up_left"],keyCodeMap:new Map([[45,"zoom_in"],[46,"zoom_out"],[36,"focus_out"],[35,"focus_in"],[33,"iris_down"],[34,"iris_up"],[37,"pan_left"],[38,"tilt_up"],[39,"pan_right"],[40,"tilt_down"]])}},mounted(){this.bindKeyboard()},beforeDestroy(){this.unbindKeboard()},methods:{bindKeyboard(){document.addEventListener("keydown",this.keyDown,!1),document.addEventListener("keyup",this.keyUp,!1),this.isBinding=!0},unbindKeboard(){try{document.removeEventListener("keydown",this.keyDown,!1),document.removeEventListener("keyup",this.keyUp,!1),this.stopCommand(),this.isBinding=!1}catch(e){}},keyDown(e){if(!this.isFullscreen||this.isKeydowning||!this.isInside)return;this.isKeydowning=!0;const t=this.keyCodeMap.get(e.keyCode);t&&(-1!==[37,38,39,40].indexOf(e.keyCode)?this.$emit("move-to-direction",t):this.$emit("do-zoom",t))},keyUp(e){if(!this.isFullscreen||!this.isInside)return;const t=this.keyCodeMap.get(e.keyCode);t&&(this.isKeydowning=!1,this.stopCommand())},moveToDirection(e){this.$emit("move-to-direction",e)},stopCommand(){this.stopAllCommand()}}},k=A,x=y(k,S,E,!1,null,null,null),R=x.exports,T=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wwav-player__ptz__operation",on:{mouseup:e.stopCommand,mouseleave:function(t){return t.stopPropagation(),e.stopCommand.apply(null,arguments)}}},[t("operation-button",{attrs:{"is-locked-by-other":e.isLockedByOther,type:"Multiple",title:"变倍",command1:"zoom_in",command2:"zoom_out"},on:{"do-zoom":e.doZoom}}),t("operation-button",{attrs:{"is-locked-by-other":e.isLockedByOther,type:"Focus",title:"聚焦",command1:"focus_in",command2:"focus_out"},on:{"do-zoom":e.doZoom}}),t("operation-button",{attrs:{"is-locked-by-other":e.isLockedByOther,type:"Aperature",title:"光圈",command1:"iris_down",command2:"iris_up"},on:{"do-zoom":e.doZoom}}),t("div",{staticClass:"wwav-player__ptz__operation-button",attrs:{title:"速度"},on:{mouseup:()=>{}}},[t("div",{staticClass:"image",on:{click:function(t){e.isShowSpeed=!e.isShowSpeed}}},[t("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAADAUlEQVRIS+2WXcifcxjHPx89lBUrMwdbMtrBkHaA1oZGZLUozjgQQmPZMEeKnVhKqWENIaWkOJKXxCiUl81L0xoRaSnJyxJlXsZX17P7XvezPc//vp95tBPXyfPU/ftdn+v6Xi+/vxwm87/kJlmofjEZY1rgJCcAS4GFwHFAgN3Al8BW9dsWkuQ84Bd1+yGBk8wCrgWuAc4Epgr2Z+B49c8kc4D71aumUnRkxkluADYAlelvwCvAm8CnwA/A38Bc4FRgTL2vQEleAB5Tn58WOMmxwFPApcBPwL3AI2r9P9KS3ArcWMGoVYpJ7aCMG5leBxYDLwLXqd/1AZtMqxRvA7epDyc5uiQH7lS/7/qYAG4OlpRnAxuB20dF3XWU5BjgI2A2cJK6J8n1JXk1HnC+WuUatwPBDwE3AY+rVd/BluRp4ErgbnV9p7sLXAFsVm8+CJykxqRk+hhYov4xlNrJbA+woFuaJEcB24AzgHPU9yZknGQLcCGwrP04BJzk9MZxjd2j6qoD7yVZArwLvKZevB+cZBHwCbBFXTEE2DRTwSqbgv9Vf9XPJruf5FXgImCR+vl4jZPcAdwDXKE+Mw1wW7+68px6+VR3k1T9qw/uUje04FoMFc1ctVZgr3UctWerRCXnpJakVmwtnXG5W/DXJZW6oJe4T6Ha1R8CtWjK3lAv6LubZBdwhHpiC/61ulmtzh5pSY4E3gHO6hxcoVYN++6WIovVWS14b42SunzA5VqJtVxa+0CthdNrSd5qpmasBf8IfKPWrPVFXWNX/dDaJepLfffqe5IdwDx1Tgt+vxnw2ervo5w0TfUkUJIPqm0DHQPq6RwvaQveDKwGzlVre/VlfRpwGfBE9/HvCXhZsxk3quta8Eqg5HpQvaUPfCjfkzwArAVWqi+34JLhK6BemFOGzvLQAJoZLv8l9cnq3v2vU5I1lTGwSa3IZsw62a5VN5XjLriyrpdjp3r1jFH3dfOzwHxgeWU7ATyToCG+pvXzdojDoWf+Bw9V6l+fO2xS/wMInjMueg7JWQAAAABJRU5ErkJggg==",alt:""}})]),t("ButtonPopper",{staticStyle:{top:"-103px"},attrs:{show:e.isShowSpeed},on:{plus:function(t){return e.changeSpeed("plus")},minus:function(t){return e.changeSpeed("minus")}}},[t("span",{attrs:{slot:"center"},slot:"center"},[e._v(e._s(e.step))])])],1),t("lock-button",{attrs:{"is-locked":e.isLocked,"is-locked-by-other":e.isLockedByOther},on:{"lock-ptz":e.lockPTZ,"unlock-ptz":e.unlockPTZ}})],1)},C=[],M=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wwav-player__ptz__operation-button",attrs:{title:e.title}},[t("div",{staticClass:"image",on:{click:function(t){t.stopPropagation(),e.show=!e.show}}},["Multiple"===e.type?t("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAADQElEQVRIS8WWWehVVRSHv08oCINsehC1KKHZ0hKMZrWHKKRBc8IgCIPooR580kKorAhKoh6Kwop6aICSKKKSkApBRWyejCbFSqEHSbRxxYp95Xo9+57zF8r9eM5e69t77bV+a8khWh4iLp3AEXEqsAC4BDgNOA74E/gZ+Ah4G3hR3dH1IkPBBfgAMAv+PeR3wIfATmAUMB44txxkL/AksFz9pe0AVXBE3AI8VBw8ATymfjboMCLyABcDtwNXlygsUNcOgzeCI+IeYBmwAVikbmm7Qf6PiJnAMyUC89XVNbsDwBFxK/Ao8CowT80Qdl4RMQ5YA5wEXKqubzLeDxwRpwObgQ+K0W+diX0bI+IEYBOwCzhL3TPoZxD8GpDhmqR+fTDQnk1EzAVeyCdT762Cy20/BR5RbxsGjYiJwG71p5Z9G4G8/Xj1j/69+24cEXcBdwJnqJ/XHBboV8AOdWwL+KZSYleob9bA75aTndzibCqQN9mrHtGyNw+2HbhPXVoDp+qsU69pchYRZwJjinKlUPwOzCh7f1C3VuzS7/vqdTVwSuBT6uIGkTgR+KaoVZP/beqECjjzZqd6WQ2c9fq8emMD+CjgPeBY4DDg+NQL4Meyd/3gjfqy+0tgq3p5DZzl872a5VRdETGSN87k/RV4Wb2hBn4FmJ5yp2bYG9cIwecUMVqiPlgD3ww8DlypvjEEfDTwVnYq9fqW6NwN3FEE6ZMaODM2M3NDW7iHwfre9siSkN+q0wZtBiVzBZD1Nld9qQtgSGRWllY5S00p3m8NgkeXN8nsvaip/3Y5TETMKTq9Wp3dZNPUFs8upbMbuErNbtV5RcR84GngcOB8NXv6Aas2CFxY+nFK4nLgYTWValiZZZSyC6UA9fymXE5XU9vroe7/ExGp2c8CFwDbUtWA13Pm6g0HEZHCkomTMrsIyIR6DliVtQtkBSR8hppCsm+1DXv5fyGwBJhcrP4uopCzVoJy/VVK7H41m02OQeeVb8cUhUv4Fz1yp/G2OMrppDfeprOE5Xj7MfBOU2+OiJxAc/TtwWf2Wm5ncOfsGtgYEVPKDJbwLeopueU/B5do5TPl8LhJvfZ/A3cup4MN60js/gFMSkEuKKvOXwAAAABJRU5ErkJggg==",alt:""}}):"Focus"===e.type?t("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAADJUlEQVRIS8WX2cuNaxjGf5chJ4QynMk8lESGkE04QDhQlF3YMjuhRPwHiH0gDsyKzQEnFE6UTGWToWwZM6SkbcyhxK3r87x61/rW8K4vH3etVu9az3Nf93xfr/hNoiK4EeFzk4CZwDhgANAV8O8fgMfAVeAMcFHS13p6awJHRDtgCbAR6At8Af4D7gFTgLbAOWAIMCw9PwW2Agck+XxFqQocEYOBY8CIBLQDOCHJHhIRl4EOksakZ0dgLrAGGArcBhZIspHNpCJwREw3SPJwQ7K+JHzlwJnmlBZHaRvQHpgvySkokWbAETEDOAk4ZLMkPalkcTXgnAG9U85dD3PKwUuAI2IQcAN4CUyQ9LZajuoBp/B3Ay4ANmJMPuw/gCOiDXAtVezIap7mPDroUEpaWKuCI6IPcAt4BozOCi4PvBTYD6yUtLdeOzTyf0Q45weA1ZJ2+24TcCqIR8BnV2SRPmwQ2Dh3gI5AP+vPgCe68VvD21xqlgH7gKmSzmfAfwNrgR6S3jfiTdGzEdEFeA3skrQuA74EdJLkYdFqEhE3nU5JYzPgVy57SX+2Gur3WvoHmCapewbsovIofFEG/LilxiQQj9289PJykdQ+D/wGKJ9STyQtbkkUIsJ97qmVl35AT0ltf3Woj6ZQd8uA3UqdJQ1viXdF70SEJ9gnSeMy4C3A+hSGd0UVNXIuIrw23U47JK3PgCcA3q8/RlojSoucjYgVwB5gsqQL+ZH5IO3f1hqZd00cXHCSmrhUk0SEq/cQsEqSLftpEhHLAS+e5ZK8iL4viQTstfgv4N4bJclLo6pExOG0FmsOnYjon3a8CeHYZmsxgbvvTAT+B/6Q5O+KUpAIdE9EwIPDzjzMlFWiPuZbp4DnwOxqntcDTp6eBkwETH3O5j2oRvamAcdTKja5Gsupag2y55SZVGxP9032SkBLclwez4gYCBwxVwKc7502RpJ7sRK9dVjnJXpr7nYd+EuSu6WZ1CP0tn4RYK+tLBLHvm8ymAi8p54JvT8+byM3A4drMZlCrzDJw/Gmu7lXGC92y8cE5o44I+lKkT4sDFxEWSNnvgEeKk4uGlQWRgAAAABJRU5ErkJggg==",alt:""}}):t("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAAEV0lEQVRIS8WXe8jecxjGP5fDiJrkMGxamM00lENGXo0Jmy2iWBabkjHJaWYlc2gx5qyktTlMi5xCDkMZw6hJ/DGHHOcwTZtohDlcuh7f39vvefY+7+Hxh7vef37v9/u97vu6D9f9iP/J1B9c21sA44CTgCOA4cDOwB/AT8CXwFvAc8Brkv7u691egW1vCZwLXA58DDwJvA3MBA4BTge+A/YGuoDTgBHArcBiSX+1c6AtsO0xwBLgPWCepM9tDwaeKBHOlJSIm8z2PsA1wP7ANEmrewLvEdh2KL0bOF/SS7loewjwArBUUiLq1WyfCNwTdiQtaz28GbDtk4H5yWeiLKBDgThwc6H8MGA0sHt8An4AvgI+AFZKWlvuhfbk/RJJcbrbmoBth54cHCdpTbm8A/BmKaY/C/XJcygMQN7YCTgauAL4Hvi2sPM4sBF4GZgo6aMKuRu4FNI7wGxJOdgw208DqdIHgWWSfmvHse2pwNVJEXAgcCawXWFjN+DwquDqwDOAexOZpA0FNN8mSDqlr5zWHJ0I3AYcG8pt7wucB5wDzJG0KGcbwKVPQ8OvaR9Jq2ynT1cVL0Nfv832FOCy0F8xZLvK9+j0eQU8HrgY+AR4X9IS22kJSbq234i1g7ZvAgZJurTGxvPAAknLK+A7StFkQqXAUiSfFo9TKAM224MSBHCqpA8LsxlGIyXNroBXAmcD25f8XAVcJ+mEASM2R30WMF7S9AK8H7BI0lEV8Ddl/qYnM3cfADZIuvM/Am8NfA2MkbTe9lbAGklDK+C1kvYoXj0DZEBMlpT26thsp5UiIhdJSsekkNdJGtITcATgdmCwpN87Rv0XJEqWIfKupMkFuBFkE9Vpbtu7lKIY3pMIDMQR27PKAMk82LO0b6geVgFnJE6XlHaKp1GlFyUtHQhQ61nbr5QOuSV0F/1OcXVVwFGb1ZLuK8ARgGjvQZI2dQJuOzWzXNIo2xGXCEiKbYSkKyvgYyL2kibVmj153pRDHQLPA36RdKPttOoB5W++pFfrIzNNHgX5rES9LbAihSbp4YGAl2jfAA6W9KPtscDCTLLIqSTXRSKDPDocFVqYaVMeSJ5mSXq2P+B2482Mxkck5a3UzK7AuqIDi/OtVRYjChH0CH+099GiuxkkN0h6qB247Uy9pCq0bpQUoWiY7XyfC4ytFsF2i8DxQBa9M8pmmT1qx9LfoT8bR+6mgDLbQ2UKMlRmOeiS9HMBHZkOKfK6+SJQ8y56msKaVGuvUHVoRh+wV3EiV0JfqrUhn8AFwHGSGjJqO6DZaLJ3dS8XTVTXKbQdcciIu1BS8tWr2Z4TFSrFub5G713AjFbQtsA1bzNAIo9zq+hbHNymOJhpNyX02h4FXF+YmdrTvV6BC3jyPK1Mny+Ap0qLxZlhwGPA68D9wJFAVqT8yliQnbyjhb4lshRStsgJBSB5zvaZxSGFljU4m2dW2BXp077S06/fTn090sn//wGEVdYusNmj3QAAAABJRU5ErkJggg==",alt:""}})]),e.isLockedByOther?t("div",{staticClass:"wwav-player__ptz__operation-disable",class:{"wwav-player__ptz__operation-popper-show":e.show}},[e._v(" 不可操作 ")]):t("ButtonPopper",{attrs:{show:e.show},on:{plus:function(t){return e.doZoom(e.command1)},minus:function(t){return e.doZoom(e.command2)}}})],1)},P=[],L=function(){var e=this,t=e._self._c;return t("div",{staticClass:"wwav-player__ptz__operation-popper",class:{"wwav-player__ptz__operation-popper-show":e.show}},[t("div",{staticClass:"wwav-player__ptz__operation-popper-icon",on:{mousedown:function(t){return t.stopPropagation(),e.plus.apply(null,arguments)}}},[t("svg",{attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"2566",width:"16",height:"16"}},[t("path",{attrs:{d:"M832 464H560V192a48 48 0 1 0-96 0v272H192a48 48 0 1 0 0 96h272v272a48 48 0 1 0 96 0V560h272a48 48 0 1 0 0-96z","p-id":"2567"}})])]),e._t("center"),t("div",{staticClass:"wwav-player__ptz__operation-popper-icon",on:{mousedown:function(t){return t.stopPropagation(),e.minus.apply(null,arguments)}}},[t("svg",{attrs:{viewBox:"0 0 1024 1024",version:"1.1",xmlns:"http://www.w3.org/2000/svg","p-id":"3411",width:"16",height:"16"}},[t("path",{attrs:{d:"M853.333333 554.666667H170.666667c-23.466667 0-42.666667-19.2-42.666667-42.666667s19.2-42.666667 42.666667-42.666667h682.666666c23.466667 0 42.666667 19.2 42.666667 42.666667s-19.2 42.666667-42.666667 42.666667z","p-id":"3412"}})])])],2)},O=[],I={props:{show:Boolean},methods:{plus(){this.$emit("plus")},minus(){this.$emit("minus")}}},B=I,D=y(B,L,O,!1,null,null,null),U=D.exports,N={components:{ButtonPopper:U},props:{type:{type:String,default:"Multiple"},title:{type:String,default:""},command1:{type:String,required:!0},command2:{type:String,required:!0},isLockedByOther:{type:Boolean,default:!1}},data(){return{show:!1}},methods:{doZoom(e){this.$emit("do-zoom",e)}}},F=N,H=y(F,M,P,!1,null,null,null),W=H.exports,V=function(){var e=this,t=e._self._c;return t("div",{class:{"wwav-player__ptz__operation-button":!0,isLocked:e.isLocked},attrs:{title:"锁定"},on:{mousedown:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)},mousemove:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)},mouseup:function(e){return e.stopPropagation(),(()=>{}).apply(null,arguments)}}},[t("div",{staticClass:"image",on:{click:e.handleLockPTZ}},[(e.isLocked,t("img",{attrs:{src:"data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAB4AAAAeCAYAAAA7MK6iAAACAklEQVRIS+2WMUiWURSGn7eIEhqiCArcTAzNhiAIGwMxijBsSmgMsgZxaonAySVqscC1oCUSQiGquXQKK7MiR0OQoqEhIX3jwBf82u9/r34/idBZ7vCde5573vvd916xSaFN4rIusO09wDXgPNBWLPodMAoMS/qe20g22HYH8Ag4CCwBn4uxBdgOfAF6JE3kwLPAtg8Dk8Bu4A4wJGkhALb3A9eBfuAHcFzSpxQ8F/wCOAUMSLpdrajtAeAW8FxSZ2mw7UNAdDAFHJPkNcDRxGvgKNAsabYWPNmx7V7gATAo6WatYrYHgRvARUkPy4KvAHeBq5JiXDNs98XfDfRJulcvcLKY7T+LTObmSJ1dbOuCbYchxNndBVwozulQYSC1tm517k/gg6QwnBXxl9S2W4EnQFPqLGZ+D4c7J2mmMr8a+BVwAvgKjAGLmYDVaaHWWWAv8FLSyRT4V+HBbZJitRuOwnymgW2SdqTA4UzTko5smFgx0XaAWyWtULea1AF+Kymsr3TYfgO0b32w7ftxK0q6lLDR+nZsez6Akg78B1cqUPefy/ZcsceN/1rqrmKPn9YT/FFSXBKlw3Y8m+IplDSQuFHC3k5LelaGbDsefaHIoqSGlGXG47wbWAbel7gkdoZVhk8DjyX1pMD7gBHgDBCTy0SoNw5clvStJrgMZT1zfwNkdRIu4LPeUgAAAABJRU5ErkJggg==",alt:""}}))]),e.isLockedByOther?t("div",{staticClass:"wwav-player__ptz__operation-disable",class:{"wwav-player__ptz__operation-popper-show":e.show}},[e._v(" 不可操作 ")]):e._e()])},G=[],Z={name:"WCSPlayerPTZOperationButton",props:{isLockedByOther:{type:Boolean,default:!1}},data(){return{processing:!1,show:!1,isLocked:!1}},beforeDestroy(){this.$emit("unlock-ptz")},methods:{handleLockPTZ(){this.processing||(this.isLockedByOther?this.show=!0:(this.processing=!0,this.$emit("lock-ptz",!this.isLocked),setTimeout((()=>{this.processing=!1,this.isLocked=!this.isLocked}),1e3)))}}},j=Z,z=y(j,V,G,!1,null,null,null),X=z.exports,Y={name:"WCSPlayerPTZOperation",components:{OperationButton:W,LockButton:X,ButtonPopper:U},props:{step:{type:Number,default:4},isLocked:{type:Boolean,default:!1},isLockedByOther:{type:Boolean,default:!1},stopAllCommand:{type:Function,required:!0}},data(){return{isShowSpeed:!1}},methods:{changeSpeed(e){"plus"===e&&this.step<7?this.$emit("update:step",this.step+1):"minus"===e&&this.step>1&&this.$emit("update:step",this.step-1)},doZoom(e){this.$emit("do-zoom",e)},lockPTZ(){this.$emit("lock-ptz")},unlockPTZ(){this.$emit("unlock-ptz")},stopCommand(){this.stopAllCommand()}}},q=Y,K=y(q,T,C,!1,null,null,null),$=K.exports,J=function(){var e=this,t=e._self._c;return t("div",{directives:[{name:"show",rawName:"v-show",value:e.show,expression:"show"}],staticClass:"wwav-player__ptz__message",class:e.type},[t("span",[e._v(e._s(e.message))])])},Q=[],ee={data(){return{show:!1,message:"",type:"",closeTimer:0}},beforeDestroy(){this.close()},methods:{showMessage(e){this.show=!0,this.message=e.message,this.type=e.type,clearTimeout(this.closeTimer),this.closeTimer=setTimeout(this.close,3e3)},close(){this.message="",this.type="",this.show=!1,clearTimeout(this.closeTimer)}}},te=ee,re=y(te,J,Q,!1,null,null,null),ne=re.exports,ie={name:"WCSPlayerPTZ",components:{Direction:R,Operation:$,PTZMessage:ne},mixins:[_,w],props:{devicePath:{type:String,default:""},isFullscreen:{type:Boolean,default:!1},sendMessage:{type:Function,required:!1}},data(){return{enableKeyboard:!0,step:4,isInside:!1,isClicking:!1,isMoving:!1,isZooming:!1,currentDirection:"",isMouseDown:!1,startPoint:{x:0,y:0},endPoint:{x:0,y:0},showSelectionBox:!1,selectionBoxStyle:{left:"0px",top:"0px",width:"0px",height:"0px",border:"2px dashed #ff0000",position:"absolute",display:"none"}}},beforeDestroy(){this.resetLock()},methods:{moveToDirection(e){this.currentDirection=e,this.$emit("move-to-direction",e)},doZoom(e){this.$emit("do-zoom",e)},stopAllCommand:a((function(){const e=this._packageMessage("stop_all",{});this.currentDirection="",e&&this.sendMessage(e,{params:{command:"stop_all"}})}),200),sendOtherCommand(e,t,r,n=null){},showMessage(e){this.$refs?.message?.showMessage(e)},_packageMessage(e,t=null,r){return!1},onMouseDown(e){if(0===e.button){this.isMouseDown=!0;const t=this.$refs.videoContainer.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;this.startPoint.x=r,this.startPoint.y=n,this.showSelectionBox=!0,this.selectionBoxStyle.left=`${r}px`,this.selectionBoxStyle.top=`${n}px`,this.selectionBoxStyle.width="0px",this.selectionBoxStyle.height="0px"}},onMouseUp(e){if(0===e.button&&this.isMouseDown){this.isMouseDown=!1;const t=this.$refs.videoContainer.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top;this.endPoint.x=r,this.endPoint.y=n;const i=this.endPoint.x-this.startPoint.x,o=this.endPoint.y-this.startPoint.y,s=Math.abs(i),a=Math.abs(o);this.selectionBoxStyle.width=`${s}px`,this.selectionBoxStyle.height=`${a}px`,this.showSelectionBox=!1;const u=document.querySelector(".wwav-player__ptz"),l=u.clientWidth,c=u.clientHeight;if(0!==s&&0!==a){console.log(i,o);let e="drag_zoomin";i<0&&(e="drag_zoomout");this.lockToken,this.devicePath}}},onMouseMove(e){if(this.isMouseDown){const t=this.$refs.videoContainer.getBoundingClientRect(),r=e.clientX-t.left,n=e.clientY-t.top,i=Math.min(this.startPoint.x,r),o=Math.min(this.startPoint.y,n),s=Math.max(this.startPoint.x,r),a=Math.max(this.startPoint.y,n);this.selectionBoxStyle.left=`${i}px`,this.selectionBoxStyle.top=`${o}px`,this.selectionBoxStyle.width=s-i+"px",this.selectionBoxStyle.height=a-o+"px"}},onMouseLeave(){this.isMouseDown&&(this.isMouseDown=!1,this.showSelectionBox=!1)},lockPTZ(e){this.$emit("lock-ptz",e)}}},oe=ie,se=y(oe,g,b,!1,null,"6e2bc0f0",null),ae=se.exports;const ue=[["requestFullscreen","exitFullscreen","fullscreenElement","fullscreenEnabled","fullscreenchange","fullscreenerror"],["webkitRequestFullscreen","webkitExitFullscreen","webkitFullscreenElement","webkitFullscreenEnabled","webkitfullscreenchange","webkitfullscreenerror"],["webkitRequestFullScreen","webkitCancelFullScreen","webkitCurrentFullScreenElement","webkitCancelFullScreen","webkitfullscreenchange","webkitfullscreenerror"],["mozRequestFullScreen","mozCancelFullScreen","mozFullScreenElement","mozFullScreenEnabled","mozfullscreenchange","mozfullscreenerror"],["msRequestFullscreen","msExitFullscreen","msFullscreenElement","msFullscreenEnabled","MSFullscreenChange","MSFullscreenError"]],le=(()=>{if("undefined"===typeof document)return!1;const e=ue[0],t={};for(const r of ue){const n=r?.[1];if(n in document){for(const[n,i]of r.entries())t[e[n]]=i;return t}}return!1})(),ce={change:le.fullscreenchange,error:le.fullscreenerror};let he={request(e=document.documentElement,t){return new Promise(((r,n)=>{const i=()=>{he.off("change",i),r()};he.on("change",i);const o=e[le.requestFullscreen](t);o instanceof Promise&&o.then(i).catch(n)}))},exit(){return new Promise(((e,t)=>{if(!he.isFullscreen)return void e();const r=()=>{he.off("change",r),e()};he.on("change",r);const n=document[le.exitFullscreen]();n instanceof Promise&&n.then(r).catch(t)}))},toggle(e,t){return he.isFullscreen?he.exit():he.request(e,t)},onchange(e){he.on("change",e)},onerror(e){he.on("error",e)},on(e,t){const r=ce[e];r&&document.addEventListener(r,t,!1)},off(e,t){const r=ce[e];r&&document.removeEventListener(r,t,!1)},raw:le};Object.defineProperties(he,{isFullscreen:{get:()=>Boolean(document[le.fullscreenElement])},element:{enumerable:!0,get:()=>document[le.fullscreenElement]??void 0},isEnabled:{enumerable:!0,get:()=>Boolean(document[le.fullscreenEnabled])}}),le||(he={isEnabled:!1});var fe=he,de=__webpack_require__(328),pe=__webpack_require__.n(de),ye={data(){return{player:null,playerCreated:!1,attachedElement:!1,streamType:"H264"}},methods:{async _createPlayer(){const e=this.player=new(pe())({debug:!1});e.on("error",this.onPlayerError.bind(this)),e.on("media_info",this.onPlayerMediaInfo.bind(this)),e.on("play",this.onPlayerPlay.bind(this)),e.on("pause",this.onPlayerPause.bind(this)),e.onStream=this.onStream.bind(this),this.playerCreated=!0,this.attachedElement||this.attachElement()},open(e){try{this.player?(this.player.open(e.url,e.token),this._startStaticsInfoTimer(),this.videoStatus=i.vPlay):setTimeout((()=>{this.open(e)}),200)}catch(t){this.$emit("error",t)}},openTalk(e){this.player.openTalk(e.url,e.token)},controlSound(e){this.player&&this.player.muted(e)},closeTalk(){this.player&&this.player.closeTalk()},attachElement(){this.player&&!this.attachedElement&&(this.videoMedia&&this.player.attachVideoElement(this.videoMedia,this.options),this.canvasMedia&&this.player.attachCanvasElement(this.canvasMedia,this.options),this.attachedElement=!0),this.attachedElement=!1},onPlayerError(e,t,r){this.emitVideoStatus(i.vStop),this.$emit("error",e,t,r)},onPlayerMediaInfo(e){this.mediaInfo=e,this.streamType=e.format,this.showController=!0,this.$nextTick((()=>{this._changeDomDisplay()}))},onPlayerPlay(){this.emitVideoStatus(i.vPlay)},onPlayerPause(){this.emitVideoStatus(i.vPause)},_changePlayStatus(e){try{this.player&&(e===i.vPlay?this.player.play():e===i.vPause&&this.player.pause())}catch(t){this.$emit("error",t)}},async _destroyPlayer(){this._clearStaticsInfoTimer(),this.player&&await this.player.destroy(),this.videoStatus=i.vStop,this.player=null,this.playerCreated=!1,this.attachedElement=!1,this.showController=!1}}};const ve=__webpack_require__(2992);var me={data(){return{Erd:null,mediaBox:null,mediaBoxWidth:0,mediaBoxHeight:0,domForceType:"both",videoMedia:null,canvasMedia:null,domCreated:!1,videoMediaDelay:.8,videoMediaPlaySpeed:1}},mounted(){this.mediaBox=this.$refs.mediaBoxRef,this.Erd=ve(),this.Erd.listenTo(this.mediaBox,this._mediaBoxResize),this.$nextTick((()=>{this._createMediaDom()}))},beforeDestroy(){this.Erd&&this.Erd.uninstall(this.mediaBox),this.Erd=null},methods:{async _createMediaDom(){this.mediaBox?("canvas"!==this.domForceType&&(this.videoMedia=document.createElement("video"),this.videoMedia.autoplay=!0,this.videoMedia.classList="wcs-wwav-base-video__content",this._addVideoListener(),this.mediaBox.appendChild(this.videoMedia)),"video"!==this.domForceType&&(this.canvasMedia=document.createElement("canvas"),this.canvasMedia.width=this.mediaBoxWidth,this.canvasMedia.height=this.mediaBoxHeight,"canvas"===this.domForceType&&(this.canvasMedia.style.display="block"),this.mediaBox.appendChild(this.canvasMedia)),this.domCreated=!0):this.domCreated=!1},async _clearMediaDom(){this.player||(this.mediaBox&&(this.videoMedia&&(this._removeVideoListener(),this.videoMedia.remove()),this.canvasMedia&&this.canvasMedia.remove(),this.videoMedia=null,this.canvasMedia=null),this.domCreated=!1)},_changeDomDisplay(){this.streamType&&("H265"===this.streamType?(this.videoMedia&&(this.videoMedia.style.display="none"),this.canvasMedia&&(this.canvasMedia.style.display="block")):(this.videoMedia&&(this.videoMedia.style.display="block"),this.canvasMedia&&(this.canvasMedia.style.display="none")))},_changePlaybackRate(e){"H264"===this.streamType&&this.videoMedia&&(this.videoMedia.playbackRate=e)},_mediaBoxResize(e){const{offsetWidth:t,offsetHeight:r}=e;this.mediaBoxWidth=t,this.mediaBoxHeight=r,this.canvasMedia&&(this.canvasMedia.width=t,this.canvasMedia.height=r)},_addVideoListener(){this.videoMedia.addEventListener("progress",this._videoProgressEvent)},_removeVideoListener(){this.videoMedia.removeEventListener("progress",this._videoProgressEvent)},_videoProgressEvent(e){if(this.videoMedia&&this.isLive){const e=this.videoMedia.buffered;if(e.length>0){const t=e.end(0),r=parseFloat(this.videoMediaDelay*this.videoMediaPlaySpeed),n=+(t-this.videoMedia.currentTime).toFixed(3);let i=1;n<r/2?i=.8:n<r?i=1:n<2*r?i=1.2:n<3*r?i=1.4:(this.videoMedia.currentTime=t-.8*r,i=1);const o=this.videoMediaPlaySpeed*i>16?16:this.videoMediaPlaySpeed*i;this.videoMedia.playbackRate=o}}}}},ge={data(){return{_videoStatus:i.vStop,_videoPlaybackRate:1}},methods:{async capture(e={download:!0}){if(!([i.vPlay,i.vPause].indexOf(this._videoStatus)>-1&&this.videoMedia))return Promise.reject({reply:400,err_msg:"未打开视频,无法截图"});try{let t;"H265"===this.streamType?t=this.canvasMedia:(t=document.createElement("canvas"),t.width=this.videoMedia.videoWidth,t.height=this.videoMedia.videoHeight,t.getContext("2d").drawImage(this.videoMedia,0,0,t.width,t.height));const r=await t.toDataURL();if("data:,"===r)return t=null,Promise.reject({reply:400,err_msg:"没有视频流,无法截图"});if(e?.download){const e=await c(r);return await l(e,"capture",".png"),Promise.resolve()}return Promise.resolve(r)}catch(t){return Promise.reject({reply:400,err_msg:"截图失败"+t.message})}},emitVideoStatus(e){this._videoStatus=e,this.$emit("video-status-change",e)}}};function be(e,t){return"H264"===t?_e(e):"H265"===t&&we(e)}function _e(e){const t=new Uint8Array(e),r=31&t[4];return 6===r&&Se(t.slice(6))}function we(e){const t=new Uint8Array(e),r=(126&t[4])>>1;return 39===r&&Se(t.slice(7))}function Se(e){const{size:t,index:r}=Ae(e),n=r+1+16,i=r+t,o=e.slice(n,i),s=o[0];switch(s){case 1:return Ee(o);default:return!1}}function Ee(e){const t=e.slice(4),r=ke(t);try{return JSON.parse(r)}catch(n){return!1}}function Ae(e,t=0,r=0){const n=255===e[t];return r+=e[t],n?Ae(e,t+1,r):{size:r,index:t}}function ke(e){const t=[];let r=0,n=0;while(r<e.length){const i=e[r++];if(i<128)t[n++]=String.fromCharCode(i);else if(i>191&&i<224){const o=e[r++];t[n++]=String.fromCharCode((31&i)<<6|63&o)}else if(i>239&&i<365){const o=e[r++],s=e[r++],a=e[r++],u=((7&i)<<18|(63&o)<<12|(63&s)<<6|63&a)-65536;t[n++]=String.fromCharCode(55296+(u>>10)),t[n++]=String.fromCharCode(56320+(1023&u))}else{const o=e[r++],s=e[r++];t[n++]=String.fromCharCode((15&i)<<12|(63&o)<<6|63&s)}}return t.join("")}var xe={props:{enableAI:Boolean},data(){return{streamOptions:{_staticsInfoTimer:null,_timeDiff:1e3,_BPS:0,_FPS:0,speed:0,fps:0}}},methods:{onStream(e){"video"===e.type&&(this.streamOptions._BPS+=e.data.length,this.streamOptions._FPS++,this.enableAI&&this._videoStatus===i.vPlay&&this._parseStreamSEI(e.data))},_parseStreamSEI(e){const t=be(e,this.streamType);t&&"AI"===t?.type&&t?.objects.length>0&&this.$emit("sei-info",t.objects)},_startStaticsInfoTimer(){clearInterval(this.streamOptions._staticsInfoTimer),this.streamOptions._staticsInfoTimer=setInterval((()=>{const e=this.streamOptions._BPS;this.streamOptions.speed=Math.floor(e/1024),this.streamOptions.fps=this.streamOptions._FPS,this.streamOptions._BPS=0,this.streamOptions._FPS=0}),this.streamOptions._timeDiff)},_clearStaticsInfoTimer(){clearInterval(this.streamOptions._staticsInfoTimer),this.streamOptions._BPS=0,this.streamOptions._FPS=0,this.$emit("stream-info-change",{speed:0,fps:0})}}},Re={name:"BaseVideoPlayer",components:{controller:m,PTZControl:ae},mixins:[ye,xe,ge,me],props:{debug:Boolean,isLive:{type:Boolean,default:!0},options:{type:Object,default:()=>({debug:!1,mode:"video",baseLibPath:"/lib/",decoderLogLevel:0})}},data(){return{isClosedVideo:!0,domCreated:!1,playerCreated:null,mediaBoxRef:null,erd:null,mediaBox:null,domForceType:"both",videoMedia:null,canvasMedia:null,mediaBoxWidth:0,mediaBoxHeight:0,streamType:"H264",features:["PTZ"],enablePTZ:!1,isFullscreen:!1,sendMessage:!1,videoStatus:i.vStop,streamWorking:!1,mediaInfo:{},showController:!1}},mounted(){this.$nextTick((()=>{fe.isEnabled&&fe.on("change",this.handleFullScreenChange)}))},methods:{async openVideo(e){this.isClosedVideo||await this.closeVideo(),this.domCreated||await this._createMediaDom(),this.playerCreated||await this._createPlayer(),this.open(e),this.streamWorking=!0,this.isClosedVideo=!1},mediaBoxResize(e){const{offsetWidth:t,offsetHeight:r}=e;this.mediaBoxWidth=t,this.mediaBoxHeight=r,this.canvasMedia&&(this.canvasMedia.width=t,this.canvasMedia.height=r)},async closeVideo(){this.playerCreated&&(this.playerCreated.close(),this.playerCreated=null),this.isClosedVideo=!0,this.streamWorking=!1},async createMediaDom(){this.$refs.mediaBoxRef?("canvas"!==this.domForceType&&(this.videoMedia=document.createElement("video"),this.videoMedia.autoplay=!0,this.videoMedia.classList.add("wcs-wwav-base-video__content"),this.$refs.mediaBoxRef.appendChild(this.videoMedia)),"video"!==this.domForceType&&(this.canvasMedia=document.createElement("canvas"),this.canvasMedia.width=this.mediaBoxWidth,this.canvasMedia.height=this.mediaBoxHeight,"canvas"===this.domForceType&&(this.canvasMedia.style.display="block"),this.$refs.mediaBoxRef.appendChild(this.canvasMedia)),this.domCreated=!0):this.domCreated=!1},changeDomDisplay(){this.streamType&&("H265"===this.streamType?(this.videoMedia&&(this.videoMedia.style.display="none"),this.canvasMedia&&(this.canvasMedia.style.display="block")):(this.videoMedia&&(this.videoMedia.style.display="block"),this.canvasMedia&&(this.canvasMedia.style.display="none")))},changePlaybackRate(e){"H264"===this.streamType&&this.videoMedia&&(this.videoMedia.playbackRate=e)},addVideoListener(){this.videoMedia&&this.videoMedia.addEventListener("progress",this.videoProgressEvent)},removeVideoListener(){this.videoMedia&&this.videoMedia.removeEventListener("progress",this.videoProgressEvent)},videoProgressEvent(){if(this.videoMedia&&this.isLive){const e=this.videoMedia.buffered;if(e.length>0){const t=e.end(0),r=parseFloat(0),n=+(t-this.videoMedia.currentTime).toFixed(3);let i=1;n<r/2?i=.8:n<r?i=1:n<2*r?i=1.2:n<3*r?i=1.4:(this.videoMedia.currentTime=t-.8*r,i=1);const o=1*i>16?16:1*i;this.videoMedia.playbackRate=o}}},fullScreen(){this.isFullscreen=!this.isFullscreen,fe.toggle(this.$refs.mediaContentBoxRef)},changePTZSwitch(e){this.enablePTZ=e},handleFullScreenChange(){fe.isFullscreen||(this.isFullscreen=!1)},async stopVideo(){this.$emit("stop-video"),await this._destroyPlayer(),await this._clearMediaDom(),this.streamOptions={_staticsInfoTimer:null,_timeDiff:1e3,_BPS:0,_FPS:0,speed:0,fps:0},this.isClosedVideo=!0,this.streamWorking=!1},moveToDirection(e){this.$emit("move-to-direction",e)},doZoom(e){this.$emit("do-zoom",e)},lockPTZ(e){this.$emit("lock-ptz",e)},controlTalk(e){this.talk=e,this.$emit("control-talk",this.talk)},controlVideoSound(e){this.controlSound(e)},changeQuality(e){this.$emit("quality-change",e)},changePlaySpeed(e){this.$emit("change-play-speed",e)},changePlayStatus(e){this._changePlayStatus(e)},captureVideo(){this.capture()}}},Te=Re,Ce=y(Te,r,n,!1,null,"8da47702",null),Me=Ce.exports;const Pe=[Me],Le=e=>{Le.installed||Pe.forEach((t=>{e.component(t.name,t)}))};"undefined"!==typeof window&&window.Vue&&Le(window.Vue);var Oe={install:Le,videoPlayerV2:Me},Ie=Oe}(),__webpack_exports__}()}));
|
|
156
|
+
//# sourceMappingURL=video-player-v2.umd.min.js.map
|