(function(t,e){"object"===typeof exports&&"object"===typeof module?module.exports=e():"function"===typeof define&&define.amd?define([],e):"object"===typeof exports?exports["tums-player"]=e():t["tums-player"]=e()})("undefined"!==typeof self?self:this,(function(){return function(t){var e={};function i(r){if(e[r])return e[r].exports;var n=e[r]={i:r,l:!1,exports:{}};return t[r].call(n.exports,n,n.exports,i),n.l=!0,n.exports}return i.m=t,i.c=e,i.d=function(t,e,r){i.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:r})},i.r=function(t){"undefined"!==typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},i.t=function(t,e){if(1&e&&(t=i(t)),8&e)return t;if(4&e&&"object"===typeof t&&t&&t.__esModule)return t;var r=Object.create(null);if(i.r(r),Object.defineProperty(r,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var n in t)i.d(r,n,function(e){return t[e]}.bind(null,n));return r},i.n=function(t){var e=t&&t.__esModule?function(){return t["default"]}:function(){return t};return i.d(e,"a",e),e},i.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},i.p="",i(i.s="fb15")}({0:function(t,e){},"0094":function(t,e,i){"use strict";var r,n=i("bb2f"),s=i("cfe9"),a=i("e330"),o=i("6964"),h=i("f183"),c=i("6d61"),u=i("acac"),l=i("861d"),d=i("69f3").enforce,f=i("d039"),p=i("cdce"),g=Object,m=Array.isArray,v=g.isExtensible,y=g.isFrozen,b=g.isSealed,_=g.freeze,T=g.seal,S=!s.ActiveXObject&&"ActiveXObject"in s,w=function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}},E=c("WeakMap",w,u),x=E.prototype,A=a(x.set),C=function(){return n&&f((function(){var t=_([]);return A(new E,t,1),!y(t)}))};if(p)if(S){r=u.getConstructor(w,"WeakMap",!0),h.enable();var R=a(x["delete"]),P=a(x.has),I=a(x.get);o(x,{delete:function(t){if(l(t)&&!v(t)){var e=d(this);return e.frozen||(e.frozen=new r),R(this,t)||e.frozen["delete"](t)}return R(this,t)},has:function(t){if(l(t)&&!v(t)){var e=d(this);return e.frozen||(e.frozen=new r),P(this,t)||e.frozen.has(t)}return P(this,t)},get:function(t){if(l(t)&&!v(t)){var e=d(this);return e.frozen||(e.frozen=new r),P(this,t)?I(this,t):e.frozen.get(t)}return I(this,t)},set:function(t,e){if(l(t)&&!v(t)){var i=d(this);i.frozen||(i.frozen=new r),P(this,t)?A(this,t,e):i.frozen.set(t,e)}else A(this,t,e);return this}})}else C()&&o(x,{set:function(t,e){var i;return m(t)&&(y(t)?i=_:b(t)&&(i=T)),A(this,t,e),i&&i(t),this}})},"00b4":function(t,e,i){"use strict";i("ac1f");var r=i("23e7"),n=i("c65b"),s=i("1626"),a=i("825a"),o=i("577e"),h=function(){var t=!1,e=/[ac]/;return e.exec=function(){return t=!0,/./.exec.apply(this,arguments)},!0===e.test("abc")&&t}(),c=/./.test;r({target:"RegExp",proto:!0,forced:!h},{test:function(t){var e=a(this),i=o(t),r=e.exec;if(!s(r))return n(c,e,i);var h=n(r,e,i);return null!==h&&(a(h),!0)}})},"00bb":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.mode.CFB=function(){var e=t.lib.BlockCipherMode.extend();function i(t,e,i,r){var n,s=this._iv;s?(n=s.slice(0),this._iv=void 0):n=this._prevBlock,r.encryptBlock(n,0);for(var a=0;a=i)e|=1&t,t>>=1;return t+e}function s(t,e,i,r){var n=e+1;if(n===i)return 1;if(r(t[n++],t[e])<0){while(n=0)n++;return n-e}function a(t,e,i){i--;while(e>>1,n(a,t[s])<0?h=s:o=s+1;var c=r-o;switch(c){case 3:t[o+3]=t[o+2];case 2:t[o+2]=t[o+1];case 1:t[o+1]=t[o];break;default:while(c>0)t[o+c]=t[o+c-1],c--}t[o]=a}}function h(t,e,i,r,n,s){var a=0,o=0,h=1;if(s(t,e[i+n])>0){o=r-n;while(h0)a=h,h=1+(h<<1),h<=0&&(h=o);h>o&&(h=o),a+=n,h+=n}else{o=n+1;while(ho&&(h=o);var c=a;a=n-h,h=n-c}a++;while(a>>1);s(t,e[i+u])>0?a=u+1:h=u}return h}function c(t,e,i,r,n,s){var a=0,o=0,h=1;if(s(t,e[i+n])<0){o=n+1;while(ho&&(h=o);var c=a;a=n-h,h=n-c}else{o=r-n;while(h=0)a=h,h=1+(h<<1),h<=0&&(h=o);h>o&&(h=o),a+=n,h+=n}a++;while(a>>1);s(t,e[i+u])<0?h=u:a=u+1}return h}function u(t,e){var i,n,s=r,a=0,o=0;a=t.length;var u=[];function l(t,e){i[o]=t,n[o]=e,o+=1}function d(){while(o>1){var t=o-2;if(t>=1&&n[t-1]<=n[t]+n[t+1]||t>=2&&n[t-2]<=n[t]+n[t-1])n[t-1]n[t+1])break;p(t)}}function f(){while(o>1){var t=o-2;t>0&&n[t-1]=r||m>=r);if(v)break;y<0&&(y=0),y+=2}if(s=y,s<1&&(s=1),1===n){for(l=0;l=0;l--)t[m+l]=t[g+l];if(0===n){_=!0;break}}if(t[p--]=u[f--],1===--o){_=!0;break}if(b=o-h(t[d],u,0,o,o-1,e),0!==b){for(p-=b,f-=b,o-=b,m=p+1,g=f+1,l=0;l=r||b>=r);if(_)break;v<0&&(v=0),v+=2}if(s=v,s<1&&(s=1),1===o){for(p-=n,d-=n,m=p+1,g=d+1,l=n-1;l>=0;l--)t[m+l]=t[g+l];t[p]=u[f]}else{if(0===o)throw new Error;for(g=p-(o-1),l=0;l=0;l--)t[m+l]=t[g+l];t[p]=u[f]}else for(g=p-(o-1),l=0;ld&&(f=d),o(t,r,r+f,r+c,e),c=f}l.pushRun(r,c),l.mergeRuns(),h-=c,r+=c}while(0!==h);l.forceMergeRuns()}}t.exports=l},"04f8":function(t,e,i){"use strict";var r=i("1212"),n=i("d039"),s=i("cfe9"),a=s.String;t.exports=!!Object.getOwnPropertySymbols&&!n((function(){var t=Symbol("symbol detection");return!a(t)||!(Object(t)instanceof Symbol)||!Symbol.sham&&r&&r<41}))},"0538":function(t,e,i){"use strict";var r=i("e330"),n=i("59ed"),s=i("861d"),a=i("1a2d"),o=i("f36a"),h=i("40d5"),c=Function,u=r([].concat),l=r([].join),d={},f=function(t,e,i){if(!a(d,e)){for(var r=[],n=0;n.5?e:t}function d(t,e,i,r,n){var s=t.length;if(1===n)for(var a=0;an;if(s)t.length=n;else for(var a=r;a=0;i--)if(R[i]<=e)break;i=Math.min(i,T-2)}else{for(i=H;ie)break;i=Math.min(i-1,T-2)}H=i,j=e;var r=R[i+1]-R[i];if(0!==r)if(L=(e-R[i])/r,_)if(z=P[i],U=P[0===i?i:i-1],F=P[i>T-2?T-1:i+1],W=P[i>T-3?T-1:i+2],E)g(U,z,F,W,L,L*L,L*L*L,c(t,o),C);else{if(x)n=g(U,z,F,W,L,L*L,L*L*L,V,1),n=y(V);else{if(A)return l(z,F,L);n=m(U,z,F,W,L,L*L,L*L*L)}v(t,o,n)}else if(E)d(P[i],P[i+1],L,c(t,o),C);else{var n;if(x)d(P[i],P[i+1],L,V,1),n=y(V);else{if(A)return l(P[i],P[i+1],L);n=u(P[i],P[i+1],L)}v(t,o,n)}},G=new r({target:t._target,life:S,loop:t._loop,delay:t._delay,onframe:q,ondestroy:i});return e&&"spline"!==e&&(G.easing=e),G}}}var T=function(t,e,i,r){this._tracks={},this._target=t,this._loop=e||!1,this._getter=i||h,this._setter=r||c,this._clipCount=0,this._delay=0,this._doneList=[],this._onframeList=[],this._clipList=[]};T.prototype={when:function(t,e){var i=this._tracks;for(var r in e)if(e.hasOwnProperty(r)){if(!i[r]){i[r]=[];var n=this._getter(this._target,r);if(null==n)continue;0!==t&&i[r].push({time:0,value:v(n)})}i[r].push({time:t,value:e[r]})}return this},during:function(t){return this._onframeList.push(t),this},pause:function(){for(var t=0;t1?arguments[1]:void 0),r=new h;return o(e,(function(t,n){c(r,n,i(t,n,e))})),r}})},"0a00":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("8a96"),a=i("6b37"),o=i("2005"),h=i("015d");n.Uint8Array&&r({target:"Uint8Array",proto:!0},{setFromHex:function(t){a(this),s(t),o(this.buffer);var e=h(t,this).read;return{read:e,written:e/2}}})},"0a06":function(t,e,i){"use strict";var r=i("c532"),n=i("30b5"),s=i("f6b4"),a=i("5270"),o=i("4a7b"),h=i("848b"),c=h.validators;function u(t){this.defaults=t,this.interceptors={request:new s,response:new s}}u.prototype.request=function(t){"string"===typeof t?(t=arguments[1]||{},t.url=arguments[0]):t=t||{},t=o(this.defaults,t),t.method?t.method=t.method.toLowerCase():this.defaults.method?t.method=this.defaults.method.toLowerCase():t.method="get";var e=t.transitional;void 0!==e&&h.assertOptions(e,{silentJSONParsing:c.transitional(c.boolean),forcedJSONParsing:c.transitional(c.boolean),clarifyTimeoutError:c.transitional(c.boolean)},!1);var i=[],r=!0;this.interceptors.request.forEach((function(e){"function"===typeof e.runWhen&&!1===e.runWhen(t)||(r=r&&e.synchronous,i.unshift(e.fulfilled,e.rejected))}));var n,s=[];if(this.interceptors.response.forEach((function(t){s.push(t.fulfilled,t.rejected)})),!r){var u=[a,void 0];Array.prototype.unshift.apply(u,i),u=u.concat(s),n=Promise.resolve(t);while(u.length)n=n.then(u.shift(),u.shift());return n}var l=t;while(i.length){var d=i.shift(),f=i.shift();try{l=d(l)}catch(p){f(p);break}}try{n=a(l)}catch(p){return Promise.reject(p)}while(s.length)n=n.then(s.shift(),s.shift());return n},u.prototype.getUri=function(t){return t=o(this.defaults,t),n(t.url,t.params,t.paramsSerializer).replace(/^\?/,"")},r.forEach(["delete","get","head","options"],(function(t){u.prototype[t]=function(e,i){return this.request(o(i||{},{method:t,url:e,data:(i||{}).data}))}})),r.forEach(["post","put","patch"],(function(t){u.prototype[t]=function(e,i,r){return this.request(o(r||{},{method:t,url:e,data:i}))}})),t.exports=u},"0a8d":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("395e");r({target:"Set",proto:!0,real:!0,forced:!0},{isSupersetOf:function(t){return n(a,this,s(t))}})},"0a90":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("d039"),a=s((function(){return 120!==new Date(16e11).getYear()})),o=n(Date.prototype.getFullYear);r({target:"Date",proto:!0,forced:a},{getYear:function(){return o(this)-1900}})},"0ac8":function(t,e,i){"use strict";var r=i("23e7"),n=i("8eb5");r({target:"Math",stat:!0,forced:n!==Math.expm1},{expm1:n})},"0b25":function(t,e,i){"use strict";var r=i("5926"),n=i("50c4"),s=RangeError;t.exports=function(t){if(void 0===t)return 0;var e=r(t),i=n(e);if(e!==i)throw new s("Wrong length or index");return i}},"0b42":function(t,e,i){"use strict";var r=i("e8b5"),n=i("68ee"),s=i("861d"),a=i("b622"),o=a("species"),h=Array;t.exports=function(t){var e;return r(t)&&(e=t.constructor,n(e)&&(e===h||r(e.prototype))?e=void 0:s(e)&&(e=e[o],null===e&&(e=void 0))),void 0===e?h:e}},"0b43":function(t,e,i){"use strict";var r=i("04f8");t.exports=r&&!!Symbol["for"]&&!!Symbol.keyFor},"0b44":function(t,e,i){var r=i("607d"),n=function(){this._track=[]};function s(t){var e=t[1][0]-t[0][0],i=t[1][1]-t[0][1];return Math.sqrt(e*e+i*i)}function a(t){return[(t[0][0]+t[1][0])/2,(t[0][1]+t[1][1])/2]}n.prototype={constructor:n,recognize:function(t,e,i){return this._doTrack(t,e,i),this._recognize(t)},clear:function(){return this._track.length=0,this},_doTrack:function(t,e,i){var n=t.touches;if(n){for(var s={points:[],touches:[],target:e,event:t},a=0,o=n.length;a1&&r&&r.length>1){var o=s(r)/s(n);!isFinite(o)&&(o=1),e.pinchScale=o;var h=a(r);return e.pinchX=h[0],e.pinchY=h[1],{type:"pinch",target:t[0].target,event:e}}}}},h=n;t.exports=h},"0b52":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("b4bc");r({target:"Set",proto:!0,real:!0,forced:!0},{isDisjointFrom:function(t){return n(a,this,s(t))}})},"0c12":function(t,e){function i(){}function r(t,e,i,r){for(var n=0,s=e.length,a=0,o=0;n=a&&l+1>=o){for(var d=[],f=0;f=a&&f+1>=o)return r(s,c.components,e,t);u[i]=c}else u[i]=void 0}h++}while(h<=c){var g=p();if(g)return g}},pushComponent:function(t,e,i){var r=t[t.length-1];r&&r.added===e&&r.removed===i?t[t.length-1]={count:r.count+1,added:e,removed:i}:t.push({count:1,added:e,removed:i})},extractCommon:function(t,e,i,r){var n=e.length,s=i.length,a=t.newPos,o=a-r,h=0;while(a+1]*>)/g,u=/\$([$&'`]|\d{1,2})/g;t.exports=function(t,e,i,r,l,d){var f=i+t.length,p=r.length,g=u;return void 0!==l&&(l=n(l),g=c),o(d,g,(function(n,o){var c;switch(a(o,0)){case"$":return"$";case"&":return t;case"`":return h(e,0,i);case"'":return h(e,f);case"<":c=l[h(o,1,-1)];break;default:var u=+o;if(0===u)return n;if(u>p){var d=s(u/10);return 0===d?n:d<=p?void 0===r[d-1]?a(o,1):r[d-1]+a(o,1):n}c=r[u-1]}return void 0===c?"":c}))}},"0ccb":function(t,e,i){"use strict";var r=i("e330"),n=i("50c4"),s=i("577e"),a=i("1148"),o=i("1d80"),h=r(a),c=r("".slice),u=Math.ceil,l=function(t){return function(e,i,r){var a,l,d=s(o(e)),f=n(i),p=d.length,g=void 0===r?" ":s(r);return f<=p||""===g?d:(a=f-p,l=h(g,u(a/g.length)),l.length>a&&(l=c(l,0,a)),t?d+l:l+d)}};t.exports={start:l(!1),end:l(!0)}},"0cde":function(t,e,i){var r=i("1687"),n=i("401b"),s=r.identity,a=5e-5;function o(t){return t>a||t<-a}var h=function(t){t=t||{},t.position||(this.position=[0,0]),null==t.rotation&&(this.rotation=0),t.scale||(this.scale=[1,1]),this.origin=this.origin||null},c=h.prototype;c.transform=null,c.needLocalTransform=function(){return o(this.rotation)||o(this.position[0])||o(this.position[1])||o(this.scale[0]-1)||o(this.scale[1]-1)};var u=[];c.updateTransform=function(){var t=this.parent,e=t&&t.transform,i=this.needLocalTransform(),n=this.transform;if(i||e){n=n||r.create(),i?this.getLocalTransform(n):s(n),e&&(i?r.mul(n,t.transform,n):r.copy(n,t.transform)),this.transform=n;var a=this.globalScaleRatio;if(null!=a&&1!==a){this.getGlobalScale(u);var o=u[0]<0?-1:1,h=u[1]<0?-1:1,c=((u[0]-o)*a+o)/u[0]||0,l=((u[1]-h)*a+h)/u[1]||0;n[0]*=c,n[1]*=c,n[2]*=l,n[3]*=l}this.invTransform=this.invTransform||r.create(),r.invert(this.invTransform,n)}else n&&s(n)},c.getLocalTransform=function(t){return h.getLocalTransform(this,t)},c.setTransform=function(t){var e=this.transform,i=t.dpr||1;e?t.setTransform(i*e[0],i*e[1],i*e[2],i*e[3],i*e[4],i*e[5]):t.setTransform(i,0,0,i,0,0)},c.restoreTransform=function(t){var e=t.dpr||1;t.setTransform(e,0,0,e,0,0)};var l=[],d=r.create();c.setLocalTransform=function(t){if(t){var e=t[0]*t[0]+t[1]*t[1],i=t[2]*t[2]+t[3]*t[3],r=this.position,n=this.scale;o(e-1)&&(e=Math.sqrt(e)),o(i-1)&&(i=Math.sqrt(i)),t[0]<0&&(e=-e),t[3]<0&&(i=-i),r[0]=t[4],r[1]=t[5],n[0]=e,n[1]=i,this.rotation=Math.atan2(-t[1]/i,t[0]/e)}},c.decomposeTransform=function(){if(this.transform){var t=this.parent,e=this.transform;t&&t.transform&&(r.mul(l,t.invTransform,e),e=l);var i=this.origin;i&&(i[0]||i[1])&&(d[4]=i[0],d[5]=i[1],r.mul(l,e,d),l[4]-=i[0],l[5]-=i[1],e=l),this.setLocalTransform(e)}},c.getGlobalScale=function(t){var e=this.transform;return t=t||[],e?(t[0]=Math.sqrt(e[0]*e[0]+e[1]*e[1]),t[1]=Math.sqrt(e[2]*e[2]+e[3]*e[3]),e[0]<0&&(t[0]=-t[0]),e[3]<0&&(t[1]=-t[1]),t):(t[0]=1,t[1]=1,t)},c.transformCoordToLocal=function(t,e){var i=[t,e],r=this.invTransform;return r&&n.applyTransform(i,i,r),i},c.transformCoordToGlobal=function(t,e){var i=[t,e],r=this.transform;return r&&n.applyTransform(i,i,r),i},h.getLocalTransform=function(t,e){e=e||[],s(e);var i=t.origin,n=t.scale||[1,1],a=t.rotation||0,o=t.position||[0,0];return i&&(e[4]-=i[0],e[5]-=i[1]),r.scale(e,e,n),a&&r.rotate(e,e,a),i&&(e[4]+=i[0],e[5]+=i[1]),e[4]+=o[0],e[5]+=o[1],e};var f=h;t.exports=f},"0ce4":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("825a"),a=i("46c4"),o=i("abc1"),h=i("f8cd"),c=i("d195"),u=i("4754"),l=i("c430"),d=c((function(t){var e=this;return new t((function(i,r){var a=function(t){e.done=!0,r(t)},o=function(){try{t.resolve(s(n(e.next,e.iterator))).then((function(t){try{s(t).done?(e.done=!0,i(u(void 0,!0))):e.remaining?(e.remaining--,o()):i(u(t.value,!1))}catch(r){a(r)}}),a)}catch(r){a(r)}};o()}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:l},{drop:function(t){s(this);var e=h(o(+t));return new d(a(this),{remaining:e})}})},"0cfb":function(t,e,i){"use strict";var r=i("83ab"),n=i("d039"),s=i("cc12");t.exports=!r&&!n((function(){return 7!==Object.defineProperty(s("div"),"a",{get:function(){return 7}}).a}))},"0d03":function(t,e,i){"use strict";var r=i("e330"),n=i("cb2d"),s=Date.prototype,a="Invalid Date",o="toString",h=r(s[o]),c=r(s.getTime);String(new Date(NaN))!==a&&n(s,o,(function(){var t=c(this);return t===t?h(this):a}))},"0d26":function(t,e,i){"use strict";var r=i("e330"),n=Error,s=r("".replace),a=function(t){return String(new n(t).stack)}("zxcasd"),o=/\n\s*at [^:]*:[^\n]*/,h=o.test(a);t.exports=function(t,e){if(h&&"string"==typeof t&&!n.prepareStackTrace)while(e--)t=s(t,o,"");return t}},"0d51":function(t,e,i){"use strict";var r=String;t.exports=function(t){try{return r(t)}catch(e){return"Object"}}},"0da8":function(t,e,i){var r=i("19eb"),n=i("9850"),s=i("6d8b"),a=i("5e76");function o(t){r.call(this,t)}o.prototype={constructor:o,type:"image",brush:function(t,e){var i=this.style,r=i.image;i.bind(t,this,e);var n=this._image=a.createOrUpdateImage(r,this._image,this,this.onload);if(n&&a.isImageReady(n)){var s=i.x||0,o=i.y||0,h=i.width,c=i.height,u=n.width/n.height;if(null==h&&null!=c?h=c*u:null==c&&null!=h?c=h/u:null==h&&null==c&&(h=n.width,c=n.height),this.setTransform(t),i.sWidth&&i.sHeight){var l=i.sx||0,d=i.sy||0;t.drawImage(n,l,d,i.sWidth,i.sHeight,s,o,h,c)}else if(i.sx&&i.sy){l=i.sx,d=i.sy;var f=h-l,p=c-d;t.drawImage(n,l,d,f,p,s,o,h,c)}else t.drawImage(n,s,o,h,c);null!=i.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))}},getBoundingRect:function(){var t=this.style;return this._rect||(this._rect=new n(t.x||0,t.y||0,t.width||0,t.height||0)),this._rect}},s.inherits(o,r);var h=o;t.exports=h},"0df6":function(t,e,i){"use strict";t.exports=function(t){return function(e){return t.apply(null,e)}}},"0e13":function(t,e,i){"use strict";i("a1f0")},"0eb6":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("2a07"),a=i("d039"),o=i("7c73"),h=i("5c6c"),c=i("9bf2").f,u=i("cb2d"),l=i("edd0"),d=i("1a2d"),f=i("19aa"),p=i("825a"),g=i("aa1f"),m=i("e391"),v=i("cf98"),y=i("0d26"),b=i("69f3"),_=i("83ab"),T=i("c430"),S="DOMException",w="DATA_CLONE_ERR",E=n("Error"),x=n(S)||function(){try{var t=n("MessageChannel")||s("worker_threads").MessageChannel;(new t).port1.postMessage(new WeakMap)}catch(e){if(e.name===w&&25===e.code)return e.constructor}}(),A=x&&x.prototype,C=E.prototype,R=b.set,P=b.getterFor(S),I="stack"in new E(S),k=function(t){return d(v,t)&&v[t].m?v[t].c:0},D=function(){f(this,O);var t=arguments.length,e=m(t<1?void 0:arguments[0]),i=m(t<2?void 0:arguments[1],"Error"),r=k(i);if(R(this,{type:S,name:i,message:e,code:r}),_||(this.name=i,this.message=e,this.code=r),I){var n=new E(e);n.name=S,c(this,"stack",h(1,y(n.stack,1)))}},O=D.prototype=o(C),M=function(t){return{enumerable:!0,configurable:!0,get:t}},N=function(t){return M((function(){return P(this)[t]}))};_&&(l(O,"code",N("code")),l(O,"message",N("message")),l(O,"name",N("name"))),c(O,"constructor",h(1,D));var B=a((function(){return!(new x instanceof E)})),L=B||a((function(){return C.toString!==g||"2: 1"!==String(new x(1,2))})),U=B||a((function(){return 25!==new x(1,"DataCloneError").code})),z=B||25!==x[w]||25!==A[w],F=T?L||U||z:B;r({global:!0,constructor:!0,forced:F},{DOMException:F?D:x});var W=n(S),H=W.prototype;for(var j in L&&(T||x===W)&&u(H,"toString",g),U&&_&&x===W&&l(H,"code",M((function(){return k(p(this).name)}))),v)if(d(v,j)){var V=v[j],q=V.s,G=h(6,V.c);d(W,q)||c(W,q,G),d(H,q)||c(H,q,G)}},"0ebb":function(t,e,i){"use strict";i("dbfa")},1034:function(t,e,i){"use strict";var r=i("23e7"),n=i("a799"),s=i("d066"),a=i("2ba4");r({global:!0,forced:!0},{compositeSymbol:function(){return 1===arguments.length&&"string"==typeof arguments[0]?s("Symbol")["for"](arguments[0]):a(n,null,arguments).get("symbol",s("Symbol"))}})},"107c":function(t,e,i){"use strict";var r=i("d039"),n=i("cfe9"),s=n.RegExp;t.exports=r((function(){var t=s("(?b)","g");return"b"!==t.exec("b").groups.a||"bc"!=="b".replace(t,"$c")}))},"109c":function(t,e,i){"use strict";i("249d")},"10b7":function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){ /** @preserve (c) 2012 by Cédric Mesnil. All rights reserved. Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: - Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer. - Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. */ return function(e){var i=t,r=i.lib,n=r.WordArray,s=r.Hasher,a=i.algo,o=n.create([0,1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,7,4,13,1,10,6,15,3,12,0,9,5,2,14,11,8,3,10,14,4,9,15,8,1,2,7,0,6,13,11,5,12,1,9,11,10,0,8,12,4,13,3,7,15,14,5,6,2,4,0,5,9,7,12,2,10,14,1,3,8,11,6,15,13]),h=n.create([5,14,7,0,9,2,11,4,13,6,15,8,1,10,3,12,6,11,3,7,0,13,5,10,14,15,8,12,4,9,1,2,15,5,1,3,7,14,6,9,11,8,12,2,10,0,4,13,8,6,4,1,3,11,15,0,5,12,2,13,9,7,10,14,12,15,10,4,1,5,8,7,6,2,13,14,0,3,9,11]),c=n.create([11,14,15,12,5,8,7,9,11,13,14,15,6,7,9,8,7,6,8,13,11,9,7,15,7,12,15,9,11,7,13,12,11,13,6,7,14,9,13,15,14,8,13,6,5,12,7,5,11,12,14,15,14,15,9,8,9,14,5,6,8,6,5,12,9,15,5,11,6,8,13,12,5,12,13,14,11,8,5,6]),u=n.create([8,9,9,11,13,15,15,5,7,7,8,11,14,14,12,6,9,13,15,7,12,8,9,11,7,7,12,7,6,15,13,11,9,7,15,11,8,6,6,14,12,13,5,14,13,13,7,5,15,5,8,11,14,14,6,14,6,9,12,9,12,5,15,8,8,5,12,9,12,5,14,6,8,13,6,5,15,13,11,11]),l=n.create([0,1518500249,1859775393,2400959708,2840853838]),d=n.create([1352829926,1548603684,1836072691,2053994217,0]),f=a.RIPEMD160=s.extend({_doReset:function(){this._hash=n.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,n=t[r];t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var s,a,f,_,T,S,w,E,x,A,C,R=this._hash.words,P=l.words,I=d.words,k=o.words,D=h.words,O=c.words,M=u.words;S=s=R[0],w=a=R[1],E=f=R[2],x=_=R[3],A=T=R[4];for(i=0;i<80;i+=1)C=s+t[e+k[i]]|0,C+=i<16?p(a,f,_)+P[0]:i<32?g(a,f,_)+P[1]:i<48?m(a,f,_)+P[2]:i<64?v(a,f,_)+P[3]:y(a,f,_)+P[4],C|=0,C=b(C,O[i]),C=C+T|0,s=T,T=_,_=b(f,10),f=a,a=C,C=S+t[e+D[i]]|0,C+=i<16?y(w,E,x)+I[0]:i<32?v(w,E,x)+I[1]:i<48?m(w,E,x)+I[2]:i<64?g(w,E,x)+I[3]:p(w,E,x)+I[4],C|=0,C=b(C,M[i]),C=C+A|0,S=A,A=x,x=b(E,10),E=w,w=C;C=R[1]+f+x|0,R[1]=R[2]+_+A|0,R[2]=R[3]+T+S|0,R[3]=R[4]+s+w|0,R[4]=R[0]+a+E|0,R[0]=C},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8),t.sigBytes=4*(e.length+1),this._process();for(var n=this._hash,s=n.words,a=0;a<5;a++){var o=s[a];s[a]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8)}return n},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});function p(t,e,i){return t^e^i}function g(t,e,i){return t&e|~t&i}function m(t,e,i){return(t|~e)^i}function v(t,e,i){return t&i|e&~i}function y(t,e,i){return t^(e|~i)}function b(t,e){return t<>>32-e}i.RIPEMD160=s._createHelper(f),i.HmacRIPEMD160=s._createHmacHelper(f)}(Math),t.RIPEMD160}))},"10d1":function(t,e,i){"use strict";i("0094")},"10d3":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i("20a2"),n=i("3eb5"),s=i("1c35"),a=i("1434"),o=i("66c3");function h(t){return e.ebmlBlock(new e.Buffer(t))}function c(t,i,r){return void 0===r&&(r=!1),w([t,r?new e.Buffer("01ffffffffffffff","hex"):e.writeVint(i.length),i])}function u(t){return l(t).reduce((function(t,i){var r=e.ebmlBlock(i.data);return r.frames.reduce((function(t,e){var i=d(e),r=new Blob([i],{type:"image/webp"});return t.concat(r)}),t)}),[])}function l(t){return t.reduce((function(t,i){if("b"!==i.type)return t;if("SimpleBlock"!==i.name)return t;var r=e.ebmlBlock(i.data),n=r.frames.some((function(t){var e=t.slice(3,6).toString("hex");return"9d012a"===e}));return n?t.concat(i):t}),[])}function d(t){var i=f("VP8 ",t),r=w([new e.Buffer("WEBP","ascii"),i]);return f("RIFF",r)}function f(t,i){var r=new e.Buffer(4);return r.writeUInt32LE(i.byteLength,0),w([new e.Buffer(t.substr(0,4),"ascii"),r,i,new e.Buffer(i.byteLength%2===0?0:1)])}function p(t,i,r){var s=m("EBML",t),a=y(s),o=a+12,h=t[t.length-1].dataEnd-o,c=m("Info",t);g("Duration",c),c.splice(1,0,{name:"Duration",type:"f",data:C(i,8)});for(var u=y(c),l=m("Tracks",t),d=y(l),f=47,p=[],v=5+15*r.length,b=[],_=-1,T=10,S=function(t){var i=f,n=i+u,s=n+d,a=s+v,c=a-h;if(p=[],p.push({name:"SeekHead",type:"m",isEnd:!1}),p.push({name:"Seek",type:"m",isEnd:!1}),p.push({name:"SeekID",type:"b",data:new e.Buffer([21,73,169,102])}),p.push({name:"SeekPosition",type:"u",data:x(i)}),p.push({name:"Seek",type:"m",isEnd:!0}),p.push({name:"Seek",type:"m",isEnd:!1}),p.push({name:"SeekID",type:"b",data:new e.Buffer([22,84,174,107])}),p.push({name:"SeekPosition",type:"u",data:x(n)}),p.push({name:"Seek",type:"m",isEnd:!0}),p.push({name:"Seek",type:"m",isEnd:!1}),p.push({name:"SeekID",type:"b",data:new e.Buffer([28,83,187,107])}),p.push({name:"SeekPosition",type:"u",data:x(s)}),p.push({name:"Seek",type:"m",isEnd:!0}),p.push({name:"SeekHead",type:"m",isEnd:!0}),f=y(p),b=[],b.push({name:"Cues",type:"m",isEnd:!1}),r.forEach((function(t){var e=t.CueTrack,i=t.CueClusterPosition,r=t.CueTime;b.push({name:"CuePoint",type:"m",isEnd:!1}),b.push({name:"CueTime",type:"u",data:x(r)}),b.push({name:"CueTrackPositions",type:"m",isEnd:!1}),b.push({name:"CueTrack",type:"u",data:x(e)}),i-=o,i+=c,b.push({name:"CueClusterPosition",type:"u",data:x(i)}),b.push({name:"CueTrackPositions",type:"m",isEnd:!0}),b.push({name:"CuePoint",type:"m",isEnd:!0})})),b.push({name:"Cues",type:"m",isEnd:!0}),v=y(b),_===c)return"break";if(_=c,t===T-1)throw new Error("Failed to converge to a stable metadata size")},w=0;w0))throw new Error("metadata dataEnd has wrong number");var h,c=s[s.length-1].dataEnd,u=r[r.length-1].dataEnd,l=(new n.default).encode(r).byteLength,d=l-u,f=c-s[0].tagStart,p=(s[0].tagStart,s[0].tagStart,new e.Buffer([24,83,128,103])),g=new e.Buffer("01ffffffffffffff","hex"),m=p.byteLength+g.byteLength,v=f;for(h=1;h<20;h++){var y=u+m+v,_=y-c,T=d+_,S=b(s,T,i),w=(new n.default).encode(S).byteLength;if(w===v)return(new n.default).encode([].concat(r,[{type:"m",name:"Segment",isEnd:!1,unknownSize:!0}],S));v=w}throw new Error("unable to refine metadata, stable size could not be found in "+h+" iterations!")}function y(t){var e=new n.default;return t.reduce((function(t,i){return t.concat(e.encode([i]))}),[]).reduce((function(t,e){return t+e.byteLength}),0)}function b(t,e,i){var r=i.duration,n=i.clusterPtrs,s=i.cues,a=t.slice(0);if("number"===typeof r){var o=!1;a.forEach((function(t){"f"===t.type&&"Duration"===t.name&&(o=!0,t.data=C(r,8))})),o||S(a,"Info",[{name:"Duration",type:"f",data:C(r,8)}])}Array.isArray(s)&&S(a,"Cues",T(s,e));var h=[];return Array.isArray(n)&&(console.warn("append cluster pointers to seekhead is deprecated. please use cues"),h=_(n,e)),S(a,"SeekHead",h,!0),a}function _(t,i){var r=[];return t.forEach((function(t){r.push({name:"Seek",type:"m",isEnd:!1}),r.push({name:"SeekID",type:"b",data:new e.Buffer([31,67,182,117])}),r.push({name:"SeekPosition",type:"u",data:x(t+i)}),r.push({name:"Seek",type:"m",isEnd:!0})})),r}function T(t,e){var i=[];return t.forEach((function(t){var r=t.CueTrack,n=t.CueClusterPosition,s=t.CueTime;i.push({name:"CuePoint",type:"m",isEnd:!1}),i.push({name:"CueTime",type:"u",data:x(s)}),i.push({name:"CueTrackPositions",type:"m",isEnd:!1}),i.push({name:"CueTrack",type:"u",data:x(r)}),i.push({name:"CueClusterPosition",type:"u",data:x(n+e)}),i.push({name:"CueTrackPositions",type:"m",isEnd:!0}),i.push({name:"CuePoint",type:"m",isEnd:!0})})),i}function S(t,e,i,r){void 0===r&&(r=!1);for(var n=-1,s=0;s=0?Array.prototype.splice.apply(t,[n+1,0].concat(i)):r?[].concat([{name:e,type:"m",isEnd:!1}],i,[{name:e,type:"m",isEnd:!0}]).reverse().forEach((function(e){t.unshift(e)})):(t.push({name:e,type:"m",isEnd:!1}),i.forEach((function(e){t.push(e)})),t.push({name:e,type:"m",isEnd:!0}))}function w(t){for(var i=0,r=0;i=Math.pow(2,8*i);i++);if(i>=7)return console.warn("7bit or more bigger uint not supported."),new r.Uint64BE(t).toBuffer();var n=new e.Buffer(i);return n.writeUIntBE(t,0,i),n}function A(t){for(var i=1;t>=Math.pow(2,8*i);i++);if(i>=7)return console.warn("7bit or more bigger uint not supported."),new r.Int64BE(t).toBuffer();var n=new e.Buffer(i);return n.writeIntBE(t,0,i),n}function C(t,i){if(void 0===i&&(i=8),8===i){var r=new e.Buffer(8);return r.writeDoubleBE(t,0),r}if(4===i){r=new e.Buffer(4);return r.writeFloatBE(t,0),r}throw new Error("float type bits must 4bytes or 8bytes")}function R(t){return t instanceof Date?t:new Date(new Date("2001-01-01T00:00:00.000Z").getTime()+Number(t)/1e3/1e3)}e.Buffer=s.Buffer,e.readVint=a.readVint,e.writeVint=a.writeVint,e.ebmlBlock=o,e.readBlock=h,e.encodeTag=c,e.WebPFrameFilter=u,e.WebPBlockFilter=l,e.VP8BitStreamToRiffWebPBuffer=d,e.createRIFFChunk=f,e.makeMetadataSeekable=p,e.removeElement=g,e.extractElement=m,e.putRefinedMetaData=v,e.concat=w,e.encodeValueToBuffer=E,e.createUIntBuffer=x,e.createIntBuffer=A,e.createFloatBuffer=C,e.convertEBMLDateToJSDate=R},1132:function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.WordArray,n=e.enc;n.Base64={stringify:function(t){var e=t.words,i=t.sigBytes,r=this._map;t.clamp();for(var n=[],s=0;s>>2]>>>24-s%4*8&255,o=e[s+1>>>2]>>>24-(s+1)%4*8&255,h=e[s+2>>>2]>>>24-(s+2)%4*8&255,c=a<<16|o<<8|h,u=0;u<4&&s+.75*u>>6*(3-u)&63));var l=r.charAt(64);if(l)while(n.length%4)n.push(l);return n.join("")},parse:function(t){var e=t.length,i=this._map,r=this._reverseMap;if(!r){r=this._reverseMap=[];for(var n=0;n>>6-a%4*2,c=o|h;n[s>>>2]|=c<<24-s%4*8,s++}return r.create(n,s)}}(),t.enc.Base64}))},1148:function(t,e,i){"use strict";var r=i("5926"),n=i("577e"),s=i("1d80"),a=RangeError;t.exports=function(t){var e=n(s(this)),i="",o=r(t);if(o<0||o===1/0)throw new a("Wrong number of repetitions");for(;o>0;(o>>>=1)&&(e+=e))1&o&&(i+=e);return i}},1212:function(t,e,i){"use strict";var r,n,s=i("cfe9"),a=i("b5db"),o=s.process,h=s.Deno,c=o&&o.versions||h&&h.version,u=c&&c.v8;u&&(r=u.split("."),n=r[0]>0&&r[0]<4?1:+(r[0]+r[1])),!n&&a&&(r=a.match(/Edge\/(\d+)/),(!r||r[1]>=74)&&(r=a.match(/Chrome\/(\d+)/),r&&(n=+r[1]))),t.exports=n},1276:function(t,e,i){"use strict";var r=i("c65b"),n=i("e330"),s=i("d784"),a=i("825a"),o=i("7234"),h=i("1d80"),c=i("4840"),u=i("8aa5"),l=i("50c4"),d=i("577e"),f=i("dc4a"),p=i("14c3"),g=i("9f7f"),m=i("d039"),v=g.UNSUPPORTED_Y,y=4294967295,b=Math.min,_=n([].push),T=n("".slice),S=!m((function(){var t=/(?:)/,e=t.exec;t.exec=function(){return e.apply(this,arguments)};var i="ab".split(t);return 2!==i.length||"a"!==i[0]||"b"!==i[1]})),w="c"==="abbc".split(/(b)*/)[1]||4!=="test".split(/(?:)/,-1).length||2!=="ab".split(/(?:ab)*/).length||4!==".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length;s("split",(function(t,e,i){var n="0".split(void 0,0).length?function(t,i){return void 0===t&&0===i?[]:r(e,this,t,i)}:e;return[function(e,i){var s=h(this),a=o(e)?void 0:f(e,t);return a?r(a,e,s,i):r(n,d(s),e,i)},function(t,r){var s=a(this),o=d(t);if(!w){var h=i(n,s,o,r,n!==e);if(h.done)return h.value}var f=c(s,RegExp),g=s.unicode,m=(s.ignoreCase?"i":"")+(s.multiline?"m":"")+(s.unicode?"u":"")+(v?"g":"y"),S=new f(v?"^(?:"+s.source+")":s,m),E=void 0===r?y:r>>>0;if(0===E)return[];if(0===o.length)return null===p(S,o)?[o]:[];var x=0,A=0,C=[];while(A>>24)|4278255360&(t[i]<<24|t[i]>>>8);var r=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],n=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)n[i]^=r[i+4&7];if(e){var s=e.words,a=s[0],o=s[1],h=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=h>>>16|4294901760&u,d=u<<16|65535&h;n[0]^=h,n[1]^=l,n[2]^=u,n[3]^=d,n[4]^=h,n[5]^=l,n[6]^=u,n[7]^=d;for(i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),t[e+r]^=s[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)a[i]=e[i];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(i=0;i<8;i++){var r=t[i]+e[i],n=65535&r,s=r>>>16,h=((n*n>>>17)+n*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);o[i]=h^c}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.Rabbit=r._createHelper(h)}(),t.Rabbit}))},1393:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("big")},{big:function(){return n(this,"big","","")}})},"13a6":function(t,e,i){"use strict";var r=Math.round;t.exports=function(t){var e=r(t);return e<0?0:e>255?255:255&e}},"13d2":function(t,e,i){"use strict";var r=i("e330"),n=i("d039"),s=i("1626"),a=i("1a2d"),o=i("83ab"),h=i("5e77").CONFIGURABLE,c=i("8925"),u=i("69f3"),l=u.enforce,d=u.get,f=String,p=Object.defineProperty,g=r("".slice),m=r("".replace),v=r([].join),y=o&&!n((function(){return 8!==p((function(){}),"length",{value:8}).length})),b=String(String).split("String"),_=t.exports=function(t,e,i){"Symbol("===g(f(e),0,7)&&(e="["+m(f(e),/^Symbol\(([^)]*)\).*$/,"$1")+"]"),i&&i.getter&&(e="get "+e),i&&i.setter&&(e="set "+e),(!a(t,"name")||h&&t.name!==e)&&(o?p(t,"name",{value:e,configurable:!0}):t.name=e),y&&i&&a(i,"arity")&&t.length!==i.arity&&p(t,"length",{value:i.arity});try{i&&a(i,"constructor")&&i.constructor?o&&p(t,"prototype",{writable:!1}):t.prototype&&(t.prototype=void 0)}catch(n){}var r=l(t);return a(r,"source")||(r.source=v(b,"string"==typeof e?e:"")),t};Function.prototype.toString=_((function(){return s(this)&&d(this).source||c(this)}),"toString")},"13d5":function(t,e,i){"use strict";var r=i("23e7"),n=i("d58f").left,s=i("a640"),a=i("1212"),o=i("9adc"),h=!o&&a>79&&a<83,c=h||!s("reduce");r({target:"Array",proto:!0,forced:c},{reduce:function(t){var e=arguments.length;return n(this,t,e,e>1?arguments[1]:void 0)}})},1434:function(t,e,i){(function(e){var i={readVint:function(t,e){e=e||0;for(var i=1;i<=8;i++)if(t[e]>=Math.pow(2,8-i))break;if(i>8)throw new Error("Unrepresentable length: "+i+" "+t.toString("hex",e,e+i));if(e+i>t.length)return null;for(var r=t[e]&(1<<8-i)-1,n=1;n=Math.pow(2,45)&&t[e+7]>0)return{length:i,value:-1};r*=Math.pow(2,8),r+=t[e+n]}return{length:i,value:r}},writeVint:function(t){if(t<0||t>Math.pow(2,53))throw new Error("Unrepresentable value: "+t);for(var i=1;i<=8;i++)if(t2?arguments[2]:void 0,d=o((void 0===l?h:n(l,h))-u,h-c),f=1;u0)u in i?i[c]=i[u]:a(i,c),c+=f,u+=f;return i}},"14be":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("d6d6"),a=i("577e"),o=i("f354"),h=n("URL");r({target:"URL",stat:!0,forced:!o},{parse:function(t){var e=s(arguments.length,1),i=a(t),r=e<2||void 0===arguments[1]?void 0:a(arguments[1]);try{return new h(i,r)}catch(n){return null}}})},"14c3":function(t,e,i){"use strict";var r=i("c65b"),n=i("825a"),s=i("1626"),a=i("c6b6"),o=i("9263"),h=TypeError;t.exports=function(t,e){var i=t.exec;if(s(i)){var c=r(i,t,e);return null!==c&&n(c),c}if("RegExp"===a(t))return r(o,t,e);throw new h("RegExp#exec called on incompatible receiver")}},"14d9":function(t,e,i){"use strict";var r=i("23e7"),n=i("7b0b"),s=i("07fa"),a=i("3a34"),o=i("3511"),h=i("d039"),c=h((function(){return 4294967297!==[].push.call({length:4294967296},1)})),u=function(){try{Object.defineProperty([],"length",{writable:!1}).push()}catch(t){return t instanceof TypeError}},l=c||!u();r({target:"Array",proto:!0,arity:1,forced:l},{push:function(t){var e=n(this),i=s(e),r=arguments.length;o(i+r);for(var h=0;h0)throw new w(N);e[1]=""}if(f){if(1===e.length||I(O,e[e.length-1]))throw new w(B);e[e.length-2]="",e[e.length-1]=""}for(var p=2;p1?arguments[1]:void 0)}},"17e1":function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(){if("function"==typeof ArrayBuffer){var e=t,i=e.lib,r=i.WordArray,n=r.init,s=r.init=function(t){if(t instanceof ArrayBuffer&&(t=new Uint8Array(t)),(t instanceof Int8Array||"undefined"!==typeof Uint8ClampedArray&&t instanceof Uint8ClampedArray||t instanceof Int16Array||t instanceof Uint16Array||t instanceof Int32Array||t instanceof Uint32Array||t instanceof Float32Array||t instanceof Float64Array)&&(t=new Uint8Array(t.buffer,t.byteOffset,t.byteLength)),t instanceof Uint8Array){for(var e=t.byteLength,i=[],r=0;r>>2]|=t[r]<<24-r%4*8;n.call(this,i,e)}else n.apply(this,arguments)};s.prototype=r}}(),t.lib.WordArray}))},"182d":function(t,e,i){"use strict";var r=i("f8cd"),n=RangeError;t.exports=function(t,e){var i=r(t);if(i%e)throw new n("Wrong offset");return i}},"18a5":function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("anchor")},{anchor:function(t){return n(this,"a","name",t)}})},"18d5":function(t,e,i){"use strict";var r=i("d066"),n=i("5087"),s=i("a95f"),a=i("ebb5"),o=i("dfb9"),h=a.aTypedArrayConstructor,c=a.exportTypedArrayStaticMethod;c("fromAsync",(function(t){var e=this,i=arguments.length,a=i>1?arguments[1]:void 0,c=i>2?arguments[2]:void 0;return new(r("Promise"))((function(i){n(e),i(s(t,a,c))})).then((function(t){return o(h(e),t)}))}),!0)},1913:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("fontsize")},{fontsize:function(t){return n(this,"font","size",t)}})},"191b":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("94f8"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.WordArray,n=e.algo,s=n.SHA256,a=n.SHA224=s.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var t=s._doFinalize.call(this);return t.sigBytes-=4,t}});e.SHA224=s._createHelper(a),e.HmacSHA224=s._createHmacHelper(a)}(),t.SHA224}))},"197b":function(t,e,i){"use strict";var r=i("e065");r("species")},"19aa":function(t,e,i){"use strict";var r=i("3a9b"),n=TypeError;t.exports=function(t,e){if(r(e,t))return t;throw new n("Incorrect invocation")}},"19eb":function(t,e,i){var r=i("6d8b"),n=i("2b61"),s=i("d5b7"),a=i("9e2e");function o(t){for(var e in t=t||{},s.call(this,t),t)t.hasOwnProperty(e)&&"style"!==e&&(this[e]=t[e]);this.style=new n(t.style,this),this._rect=null,this.__clipPaths=null}o.prototype={constructor:o,type:"displayable",__dirty:!0,invisible:!1,z:0,z2:0,zlevel:0,draggable:!1,dragging:!1,silent:!1,culling:!1,cursor:"pointer",rectHover:!1,progressive:!1,incremental:!1,globalScaleRatio:1,beforeBrush:function(t){},afterBrush:function(t){},brush:function(t,e){},getBoundingRect:function(){},contain:function(t,e){return this.rectContain(t,e)},traverse:function(t,e){t.call(e,this)},rectContain:function(t,e){var i=this.transformCoordToLocal(t,e),r=this.getBoundingRect();return r.contain(i[0],i[1])},dirty:function(){this.__dirty=this.__dirtyText=!0,this._rect=null,this.__zr&&this.__zr.refresh()},animateStyle:function(t){return this.animate("style",t)},attrKV:function(t,e){"style"!==t?s.prototype.attrKV.call(this,t,e):this.style.set(e)},setStyle:function(t,e){return this.style.set(t,e),this.dirty(!1),this},useStyle:function(t){return this.style=new n(t,this),this.dirty(!1),this},calculateTextPosition:null},r.inherits(o,s),r.mixin(o,a);var h=o;t.exports=h},"1a2d":function(t,e,i){"use strict";var r=i("e330"),n=i("7b0b"),s=r({}.hasOwnProperty);t.exports=Object.hasOwn||function(t,e){return s(n(t),e)}},"1a50":function(t,e,i){var r=i("6d8b");e.util=r;var n=i("1687");e.matrix=n;var s=i("401b");e.vector=s;var a=i("41ef");e.color=a;var o=i("342d");e.path=o;var h=i("3041");h.parseSVG;e.parseSVG=h.parseSVG;var c=i("e1fc");e.Group=c;var u=i("cbe5");e.Path=u;var l=i("0da8");e.Image=l;var d=i("d4c6");e.CompoundPath=d;var f=i("76a5");e.Text=f;var p=i("392f");e.IncrementalDisplayable=p;var g=i("8d32");e.Arc=g;var m=i("ac0f");e.BezierCurve=m;var v=i("d9fc");e.Circle=v;var y=i("62da");e.Droplet=y;var b=i("ae69");e.Ellipse=b;var _=i("fc7b");e.Heart=_;var T=i("c004");e.Isogon=T;var S=i("cb11");e.Line=S;var w=i("87b1");e.Polygon=w;var E=i("d498");e.Polyline=E;var x=i("c7a2");e.Rect=x;var A=i("4573");e.Ring=A;var C=i("bb11");e.Rose=C;var R=i("4aa2");e.Sector=R;var P=i("4d03");e.Star=P;var I=i("4e13");e.Trochoid=I;var k=i("48a9");e.LinearGradient=k;var D=i("dded");e.RadialGradient=D;var O=i("dc2f");e.Pattern=O;var M=i("9850");e.BoundingRect=M},"1b22":function(t,e,i){"use strict";var r=i("23e7"),n=i("dd2f").toArray;r({target:"AsyncIterator",proto:!0,real:!0},{toArray:function(){return n(this,void 0,[])}})},"1b29":function(t,e,i){"use strict";var r={128:{name:"ChapterDisplay",level:4,type:"m",multiple:!0,webm:!0,description:"Contains all possible strings to use for the chapter display."},131:{name:"TrackType",level:3,type:"u",mandatory:!0,description:"The `TrackType` defines the type of each frame found in the Track. The value **SHOULD** be stored on 1 octet."},133:{name:"ChapString",cppname:"ChapterString",level:5,type:"8",mandatory:!0,webm:!0,description:"Contains the string to use as the chapter atom."},134:{name:"CodecID",level:3,type:"s",mandatory:!0,description:"An ID corresponding to the codec, see [@!MatroskaCodec] for more info."},136:{name:"FlagDefault",cppname:"TrackFlagDefault",level:3,type:"u",mandatory:!0,default:"1",range:"0-1",description:"Set if that track (audio, video or subs) **SHOULD** be eligible for automatic selection by the player; see (#default-track-selection) for more details."},137:{name:"ChapterTrackUID",cppname:"ChapterTrackNumber",level:5,type:"u",mandatory:!0,multiple:!0,range:"not 0",description:"UID of the Track to apply this chapter to. In the absence of a control track, choosing this chapter will select the listed Tracks and deselect unlisted tracks. Absence of this Element indicates that the Chapter **SHOULD** be applied to any currently used Tracks."},142:{name:"Slices",level:3,type:"m",maxver:0,description:"Contains slices description."},143:{name:"ChapterTrack",level:4,type:"m",description:"List of tracks on which the chapter applies. If this Element is not present, all tracks apply"},145:{name:"ChapterTimeStart",level:4,type:"u",mandatory:!0,webm:!0,description:"Timestamp of the start of Chapter, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks)."},146:{name:"ChapterTimeEnd",level:4,type:"u",webm:!0,description:"Timestamp of the end of Chapter timestamp excluded, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks). The value **MUST** be greater than or equal to the `ChapterTimeStart` of the same `ChapterAtom`."},150:{name:"CueRefTime",level:5,type:"u",mandatory:!0,minver:2,description:"Timestamp of the referenced Block, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks)."},151:{name:"CueRefCluster",level:5,type:"u",mandatory:!0,minver:0,maxver:0,description:"The Segment Position of the Cluster containing the referenced Block."},152:{name:"ChapterFlagHidden",level:4,type:"u",mandatory:!0,default:"0",range:"0-1",description:"Set to 1 if a chapter is hidden. Hidden chapters **SHOULD NOT** be available to the user interface (but still to Control Tracks; see (#chapterflaghidden) on Chapter flags)."},154:{name:"FlagInterlaced",cppname:"VideoFlagInterlaced",level:4,type:"u",mandatory:!0,minver:2,webm:!0,default:"0",description:"Specify whether the video frames in this track are interlaced or not."},155:{name:"BlockDuration",level:3,type:"u",description:"The duration of the Block, expressed in Track Ticks; see (#timestamp-ticks). The BlockDuration Element can be useful at the end of a Track to define the duration of the last frame (as there is no subsequent Block available), or when there is a break in a track like for subtitle tracks."},156:{name:"FlagLacing",cppname:"TrackFlagLacing",level:3,type:"u",mandatory:!0,default:"1",range:"0-1",description:"Set to 1 if the track **MAY** contain blocks using lacing. When set to 0 all blocks **MUST** have their lacing flags set to No lacing; see (#block-lacing) on Block Lacing."},157:{name:"FieldOrder",cppname:"VideoFieldOrder",level:4,type:"u",mandatory:!0,minver:4,default:"2",description:"Specify the field ordering of video frames in this track."},159:{name:"Channels",cppname:"AudioChannels",level:4,type:"u",mandatory:!0,default:"1",range:"not 0",description:"Numbers of channels in the track."},160:{name:"BlockGroup",level:2,type:"m",multiple:!0,description:"Basic container of information containing a single Block and information specific to that Block."},161:{name:"Block",level:3,type:"b",mandatory:!0,description:"Block containing the actual data to be rendered and a timestamp relative to the Cluster Timestamp; see (#block-structure) on Block Structure."},162:{name:"BlockVirtual",level:3,type:"b",minver:0,maxver:0,description:"A Block with no data. It **MUST** be stored in the stream at the place the real Block would be in display order. "},163:{name:"SimpleBlock",level:2,type:"b",multiple:!0,minver:2,webm:!0,divx:!0,description:"Similar to Block, see (#block-structure), but without all the extra information, mostly used to reduced overhead when no extra feature is needed; see (#simpleblock-structure) on SimpleBlock Structure."},164:{name:"CodecState",level:3,type:"b",minver:2,description:"The new codec state to use. Data interpretation is private to the codec. This information **SHOULD** always be referenced by a seek entry."},165:{name:"BlockAdditional",level:5,type:"b",mandatory:!0,webm:!0,description:"Interpreted by the codec as it wishes (using the BlockAddID)."},166:{name:"BlockMore",level:4,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"Contain the BlockAdditional and some parameters."},167:{name:"Position",cppname:"ClusterPosition",level:2,type:"u",description:"The Segment Position of the Cluster in the Segment (0 in live streams). It might help to resynchronise offset on damaged streams."},170:{name:"CodecDecodeAll",level:3,type:"u",mandatory:!0,maxver:0,default:"1",range:"0-1",description:"Set to 1 if the codec can decode potentially damaged data."},171:{name:"PrevSize",cppname:"ClusterPrevSize",level:2,type:"u",description:"Size of the previous Cluster, in octets. Can be useful for backward playing."},174:{name:"TrackEntry",level:2,type:"m",mandatory:!0,multiple:!0,description:"Describes a track with all Elements."},175:{name:"EncryptedBlock",level:2,type:"b",multiple:!0,minver:0,maxver:0,description:"Similar to SimpleBlock, see (#simpleblock-structure), but the data inside the Block are Transformed (encrypt and/or signed)."},176:{name:"PixelWidth",cppname:"VideoPixelWidth",level:4,type:"u",mandatory:!0,range:"not 0",description:"Width of the encoded video frames in pixels."},178:{name:"CueDuration",level:4,type:"u",minver:4,webm:!0,description:"The duration of the block, expressed in Segment Ticks which is based on TimestampScale; see (#timestamp-ticks). If missing, the track's DefaultDuration does not apply and no duration information is available in terms of the cues."},179:{name:"CueTime",level:3,type:"u",mandatory:!0,description:"Absolute timestamp of the seek point, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks)."},181:{name:"SamplingFrequency",cppname:"AudioSamplingFreq",level:4,type:"f",mandatory:!0,default:"0x1.f4p+12",range:"> 0x0p+0",description:"Sampling frequency in Hz."},182:{name:"ChapterAtom",level:3,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"Contains the atom information to use as the chapter atom (apply to all tracks)."},183:{name:"CueTrackPositions",level:3,type:"m",mandatory:!0,multiple:!0,description:"Contain positions for different tracks corresponding to the timestamp."},185:{name:"FlagEnabled",cppname:"TrackFlagEnabled",level:3,type:"u",mandatory:!0,minver:2,webm:!0,default:"1",range:"0-1",description:"Set to 1 if the track is usable. It is possible to turn a not usable track into a usable track using chapter codecs or control tracks."},186:{name:"PixelHeight",cppname:"VideoPixelHeight",level:4,type:"u",mandatory:!0,range:"not 0",description:"Height of the encoded video frames in pixels."},187:{name:"CuePoint",level:2,type:"m",mandatory:!0,multiple:!0,description:"Contains all information relative to a seek point in the Segment."},191:{name:"CRC-32",level:-1,type:"b",minver:1,webm:!1,description:"The CRC is computed on all the data of the Master element it's in. The CRC element should be the first in it's parent master for easier reading. All level 1 elements should include a CRC-32. The CRC in use is the IEEE CRC32 Little Endian.",crc:!0},192:{name:"TrickTrackUID",level:3,type:"u",minver:0,maxver:0,divx:!0,description:"The TrackUID of the Smooth FF/RW video in the paired EBML structure corresponding to this video track. See [@?DivXTrickTrack]."},193:{name:"TrickTrackSegmentUID",level:3,type:"b",minver:0,maxver:0,divx:!0,description:"The SegmentUID of the Segment containing the track identified by TrickTrackUID. See [@?DivXTrickTrack]."},196:{name:"TrickMasterTrackSegmentUID",level:3,type:"b",minver:0,maxver:0,divx:!0,description:"The SegmentUID of the Segment containing the track identified by MasterTrackUID. See [@?DivXTrickTrack]."},198:{name:"TrickTrackFlag",level:3,type:"u",minver:0,maxver:0,divx:!0,default:"0",description:"Set to 1 if this video track is a Smooth FF/RW track. If set to 1, MasterTrackUID and MasterTrackSegUID should must be present and BlockGroups for this track must contain ReferenceFrame structures. Otherwise, TrickTrackUID and TrickTrackSegUID must be present if this track has a corresponding Smooth FF/RW track. See [@?DivXTrickTrack]."},199:{name:"TrickMasterTrackUID",level:3,type:"u",minver:0,maxver:0,divx:!0,description:"The TrackUID of the video track in the paired EBML structure that corresponds to this Smooth FF/RW track. See [@?DivXTrickTrack]."},200:{name:"ReferenceFrame",level:3,type:"m",minver:0,maxver:0,divx:!0,description:"Contains information about the last reference frame. See [@?DivXTrickTrack]."},201:{name:"ReferenceOffset",level:4,type:"u",mandatory:!0,minver:0,maxver:0,divx:!0,description:"The relative offset, in bytes, from the previous BlockGroup element for this Smooth FF/RW video track to the containing BlockGroup element. See [@?DivXTrickTrack]."},202:{name:"ReferenceTimestamp",cppname:"ReferenceTimeCode",level:4,type:"u",mandatory:!0,minver:0,maxver:0,divx:!0,description:"The timestamp of the BlockGroup pointed to by ReferenceOffset, expressed in Track Ticks; see (#timestamp-ticks). See [@?DivXTrickTrack]."},203:{name:"BlockAdditionID",cppname:"SliceBlockAddID",level:5,type:"u",minver:0,maxver:0,default:"0",description:"The ID of the BlockAdditional Element (0 is the main Block)."},204:{name:"LaceNumber",cppname:"SliceLaceNumber",level:5,type:"u",minver:0,maxver:0,description:"The reverse number of the frame in the lace (0 is the last frame, 1 is the next to last, etc). Being able to interpret this Element is not **REQUIRED** for playback."},205:{name:"FrameNumber",cppname:"SliceFrameNumber",level:5,type:"u",minver:0,maxver:0,default:"0",description:"The number of the frame to generate from this lace with this delay (allow you to generate many frames from the same Block/Frame)."},206:{name:"Delay",cppname:"SliceDelay",level:5,type:"u",minver:0,maxver:0,default:"0",description:"The delay to apply to the Element, expressed in Track Ticks; see (#timestamp-ticks)."},207:{name:"SliceDuration",level:5,type:"u",minver:0,maxver:0,default:"0",description:"The duration to apply to the Element, expressed in Track Ticks; see (#timestamp-ticks)."},215:{name:"TrackNumber",level:3,type:"u",mandatory:!0,range:"not 0",description:"The track number as used in the Block Header (using more than 127 tracks is not encouraged, though the design allows an unlimited number)."},219:{name:"CueReference",level:4,type:"m",multiple:!0,minver:2,description:"The Clusters containing the referenced Blocks."},224:{name:"Video",cppname:"TrackVideo",level:3,type:"m",description:"Video settings."},225:{name:"Audio",cppname:"TrackAudio",level:3,type:"m",description:"Audio settings."},226:{name:"TrackOperation",level:3,type:"m",minver:3,description:"Operation that needs to be applied on tracks to create this virtual track. For more details look at (#track-operation)."},227:{name:"TrackCombinePlanes",level:4,type:"m",minver:3,description:"Contains the list of all video plane tracks that need to be combined to create this 3D track"},228:{name:"TrackPlane",level:5,type:"m",mandatory:!0,multiple:!0,minver:3,description:"Contains a video plane track that need to be combined to create this 3D track"},229:{name:"TrackPlaneUID",level:6,type:"u",mandatory:!0,minver:3,range:"not 0",description:"The trackUID number of the track representing the plane."},230:{name:"TrackPlaneType",level:6,type:"u",mandatory:!0,minver:3,description:"The kind of plane this track corresponds to."},231:{name:"Timestamp",cppname:"ClusterTimecode",level:2,type:"u",mandatory:!0,description:"Absolute timestamp of the cluster, expressed in Segment Ticks which is based on TimestampScale; see (#timestamp-ticks)."},232:{name:"TimeSlice",level:4,type:"m",multiple:!0,minver:0,maxver:0,description:"Contains extra time information about the data contained in the Block. Being able to interpret this Element is not **REQUIRED** for playback."},233:{name:"TrackJoinBlocks",level:4,type:"m",minver:3,description:"Contains the list of all tracks whose Blocks need to be combined to create this virtual track"},234:{name:"CueCodecState",level:4,type:"u",mandatory:!0,minver:2,default:"0",description:"The Segment Position of the Codec State corresponding to this Cue Element. 0 means that the data is taken from the initial Track Entry."},235:{name:"CueRefCodecState",level:5,type:"u",minver:0,maxver:0,default:"0",description:"The Segment Position of the Codec State corresponding to this referenced Element. 0 means that the data is taken from the initial Track Entry."},236:{name:"Void",level:-1,type:"b",minver:1,description:"Used to void damaged data, to avoid unexpected behaviors when using damaged data. The content is discarded. Also used to reserve space in a sub-element for later use."},237:{name:"TrackJoinUID",level:5,type:"u",mandatory:!0,multiple:!0,minver:3,range:"not 0",description:"The trackUID number of a track whose blocks are used to create this virtual track."},238:{name:"BlockAddID",level:5,type:"u",mandatory:!0,webm:!0,default:"1",range:"not 0",description:"An ID to identify the BlockAdditional level. If BlockAddIDType of the corresponding block is 0, this value is also the value of BlockAddIDType for the meaning of the content of BlockAdditional."},240:{name:"CueRelativePosition",level:4,type:"u",minver:4,webm:!0,description:"The relative position inside the Cluster of the referenced SimpleBlock or BlockGroup with 0 being the first possible position for an Element inside that Cluster."},241:{name:"CueClusterPosition",level:4,type:"u",mandatory:!0,description:"The Segment Position of the Cluster containing the associated Block."},247:{name:"CueTrack",level:4,type:"u",mandatory:!0,range:"not 0",description:"The track for which a position is given."},250:{name:"ReferencePriority",level:3,type:"u",mandatory:!0,default:"0",description:"This frame is referenced and has the specified cache priority. In cache only a frame of the same or higher priority can replace this frame. A value of 0 means the frame is not referenced."},251:{name:"ReferenceBlock",level:3,type:"i",multiple:!0,description:"A timestamp value, relative to the timestamp of the Block in this BlockGroup, expressed in Track Ticks; see (#timestamp-ticks). This is used to reference other frames necessary to decode this frame. The relative value **SHOULD** correspond to a valid `Block` this `Block` depends on. Historically Matroska Writer didn't write the actual `Block(s)` this `Block` depends on, but *some* `Block` in the past. The value \"0\" **MAY** also be used to signify this `Block` cannot be decoded on its own, but without knownledge of which `Block` is necessary. In this case, other `ReferenceBlock` **MUST NOT** be found in the same `BlockGroup`. If the `BlockGroup` doesn't have any `ReferenceBlock` element, then the `Block` it contains can be decoded without using any other `Block` data."},253:{name:"ReferenceVirtual",level:3,type:"i",minver:0,maxver:0,description:"The Segment Position of the data that would otherwise be in position of the virtual block."},16804:{name:"BlockAddIDName",level:4,type:"s",minver:4,description:"A human-friendly name describing the type of BlockAdditional data, as defined by the associated Block Additional Mapping."},16868:{name:"BlockAdditionMapping",level:3,type:"m",multiple:!0,minver:4,description:"Contains elements that extend the track format, by adding content either to each frame, with BlockAddID ((#blockaddid-element)), or to the track as a whole with BlockAddIDExtraData."},16871:{name:"BlockAddIDType",level:4,type:"u",mandatory:!0,minver:4,default:"0",description:"Stores the registered identifier of the Block Additional Mapping to define how the BlockAdditional data should be handled."},16877:{name:"BlockAddIDExtraData",level:4,type:"b",minver:4,description:"Extra binary data that the BlockAddIDType can use to interpret the BlockAdditional data. The interpretation of the binary data depends on the BlockAddIDType value and the corresponding Block Additional Mapping."},16880:{name:"BlockAddIDValue",level:4,type:"u",minver:4,range:">=2",description:"If the track format extension needs content beside frames, the value refers to the BlockAddID ((#blockaddid-element)), value being described. To keep MaxBlockAdditionID as low as possible, small values **SHOULD** be used."},16980:{name:"ContentCompAlgo",level:6,type:"u",mandatory:!0,default:"0",description:"The compression algorithm used."},16981:{name:"ContentCompSettings",level:6,type:"b",description:"Settings that might be needed by the decompressor. For Header Stripping (`ContentCompAlgo`=3), the bytes that were removed from the beginning of each frames of the track."},17026:{name:"DocType",level:1,type:"s",mandatory:!0,default:"matroska",minver:1,description:"A string that describes the type of document that follows this EBML header. 'matroska' in our case or 'webm' for webm files."},17029:{name:"DocTypeReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum DocType version an interpreter has to support to read this file."},17030:{name:"EBMLVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of EBML parser used to create the file."},17031:{name:"DocTypeVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The version of DocType interpreter used to create the file."},17138:{name:"EBMLMaxIDLength",level:1,type:"u",mandatory:!0,default:"4",range:">=4"},17139:{name:"EBMLMaxSizeLength",level:1,type:"u",mandatory:!0,default:"8",range:"not 0"},17143:{name:"EBMLReadVersion",level:1,type:"u",mandatory:!0,default:1,minver:1,description:"The minimum EBML version a parser has to support to read this file."},17276:{name:"ChapLanguage",cppname:"ChapterLanguage",level:5,type:"s",mandatory:!0,multiple:!0,webm:!0,default:"eng",description:"A language corresponding to the string, in the bibliographic ISO-639-2 form [@!ISO639-2]. This Element **MUST** be ignored if a ChapLanguageIETF Element is used within the same ChapterDisplay Element."},17277:{name:"ChapLanguageIETF",level:5,type:"s",multiple:!0,minver:4,description:"Specifies a language corresponding to the ChapString in the format defined in [@!BCP47] and using the IANA Language Subtag Registry [@!IANALangRegistry]. If a ChapLanguageIETF Element is used, then any ChapLanguage and ChapCountry Elements used in the same ChapterDisplay **MUST** be ignored."},17278:{name:"ChapCountry",cppname:"ChapterCountry",level:5,type:"s",multiple:!0,webm:!0,description:"A country corresponding to the string, using the same 2 octets country-codes as in Internet domains [@!IANADomains] based on [@!ISO3166-1] alpha-2 codes. This Element **MUST** be ignored if a ChapLanguageIETF Element is used within the same ChapterDisplay Element."},17476:{name:"SegmentFamily",level:2,type:"b",multiple:!0,description:"A randomly generated unique ID that all Segments of a Linked Segment **MUST** share (128 bits)."},17505:{name:"DateUTC",level:2,type:"d",description:"The date and time that the Segment was created by the muxing application or library."},17530:{name:"TagLanguage",cppname:"TagLangue",level:4,type:"s",mandatory:!0,webm:!0,default:"und",description:"Specifies the language of the tag specified, in the Matroska languages form; see (#language-codes) on language codes. This Element **MUST** be ignored if the TagLanguageIETF Element is used within the same SimpleTag Element."},17531:{name:"TagLanguageIETF",level:4,type:"s",minver:4,description:"Specifies the language used in the TagString according to [@!BCP47] and using the IANA Language Subtag Registry [@!IANALangRegistry]. If this Element is used, then any TagLanguage Elements used in the same SimpleTag **MUST** be ignored."},17540:{name:"TagDefault",level:4,type:"u",mandatory:!0,webm:!0,default:"1",range:"0-1",description:"A boolean value to indicate if this is the default/original language to use for the given tag."},17541:{name:"TagBinary",level:4,type:"b",webm:!0,description:"The values of the Tag, if it is binary. Note that this cannot be used in the same SimpleTag as TagString."},17543:{name:"TagString",level:4,type:"8",webm:!0,description:"The value of the Tag."},17545:{name:"Duration",level:2,type:"f",range:"> 0x0p+0",description:"Duration of the Segment, expressed in Segment Ticks which is based on TimestampScale; see (#timestamp-ticks)."},17588:{name:"TagDefaultBogus",level:4,type:"u",mandatory:!0,minver:0,maxver:0,default:"1",range:"0-1",description:"A variant of the TagDefault element with a bogus Element ID; see (#tagdefault-element)."},17677:{name:"ChapProcessPrivate",cppname:"ChapterProcessPrivate",level:5,type:"b",description:'Some optional data attached to the ChapProcessCodecID information. For ChapProcessCodecID = 1, it is the "DVD level" equivalent; see (#menu-features) on DVD menus.'},17816:{name:"ChapterFlagEnabled",level:4,type:"u",mandatory:!0,default:"1",range:"0-1",description:"Set to 1 if the chapter is enabled. It can be enabled/disabled by a Control Track. When disabled, the movie **SHOULD** skip all the content between the TimeStart and TimeEnd of this chapter; see (#chapter-flags) on Chapter flags."},17827:{name:"TagName",level:4,type:"8",mandatory:!0,webm:!0,description:"The name of the Tag that is going to be stored."},17849:{name:"EditionEntry",level:2,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"Contains all information about a Segment edition."},17852:{name:"EditionUID",level:3,type:"u",range:"not 0",description:"A unique ID to identify the edition. It's useful for tagging an edition."},17853:{name:"EditionFlagHidden",level:3,type:"u",mandatory:!0,default:"0",range:"0-1",description:"Set to 1 if an edition is hidden. Hidden editions **SHOULD NOT** be available to the user interface (but still to Control Tracks; see (#chapter-flags) on Chapter flags)."},17883:{name:"EditionFlagDefault",level:3,type:"u",mandatory:!0,default:"0",range:"0-1",description:"Set to 1 if the edition **SHOULD** be used as the default one."},17885:{name:"EditionFlagOrdered",level:3,type:"u",mandatory:!0,default:"0",range:"0-1",description:"Set to 1 if the chapters can be defined multiple times and the order to play them is enforced; see (#editionflagordered)."},18012:{name:"FileData",level:3,type:"b",mandatory:!0,description:"The data of the file."},18016:{name:"FileMimeType",cppname:"MimeType",level:3,type:"s",mandatory:!0,description:"MIME type of the file."},18017:{name:"FileUsedStartTime",level:3,type:"u",minver:0,maxver:0,divx:!0,description:"The timestamp at which this optimized font attachment comes into context, expressed in Segment Ticks which is based on TimestampScale. See [@?DivXWorldFonts]."},18018:{name:"FileUsedEndTime",level:3,type:"u",minver:0,maxver:0,divx:!0,description:"The timestamp at which this optimized font attachment goes out of context, expressed in Segment Ticks which is based on TimestampScale. See [@?DivXWorldFonts]."},18030:{name:"FileName",level:3,type:"8",mandatory:!0,description:"Filename of the attached file."},18037:{name:"FileReferral",level:3,type:"b",minver:0,maxver:0,description:"A binary value that a track/codec can refer to when the attachment is needed."},18046:{name:"FileDescription",level:3,type:"8",description:"A human-friendly name for the attached file."},18094:{name:"FileUID",level:3,type:"u",mandatory:!0,range:"not 0",description:"Unique ID representing the file, as random as possible."},18401:{name:"ContentEncAlgo",level:6,type:"u",mandatory:!0,webm:!0,default:"0",description:'The encryption algorithm used. The value "0" means that the contents have not been encrypted.'},18402:{name:"ContentEncKeyID",level:6,type:"b",webm:!0,description:"For public key algorithms this is the ID of the public key the the data was encrypted with."},18403:{name:"ContentSignature",level:6,type:"b",maxver:0,description:"A cryptographic signature of the contents."},18404:{name:"ContentSigKeyID",level:6,type:"b",maxver:0,description:"This is the ID of the private key the data was signed with."},18405:{name:"ContentSigAlgo",level:6,type:"u",maxver:0,default:"0",description:"The algorithm used for the signature."},18406:{name:"ContentSigHashAlgo",level:6,type:"u",maxver:0,default:"0",description:"The hash algorithm used for the signature."},18407:{name:"ContentEncAESSettings",level:6,type:"m",minver:4,webm:!0,description:"Settings describing the encryption algorithm used. If `ContentEncAlgo` != 5 this **MUST** be ignored."},18408:{name:"AESSettingsCipherMode",level:7,type:"u",mandatory:!0,minver:4,webm:!0,description:"The AES cipher mode used in the encryption."},19840:{name:"MuxingApp",level:2,type:"8",mandatory:!0,description:'Muxing application or library (example: "libmatroska-0.4.3").'},19899:{name:"Seek",level:2,type:"m",mandatory:!0,multiple:!0,description:"Contains a single seek entry to an EBML Element."},20529:{name:"ContentEncodingOrder",level:5,type:"u",mandatory:!0,webm:!0,default:"0",description:"Tells when this modification was used during encoding/muxing starting with 0 and counting upwards. The decoder/demuxer has to start with the highest order number it finds and work its way down. This value has to be unique over all ContentEncodingOrder Elements in the TrackEntry that contains this ContentEncodingOrder element."},20530:{name:"ContentEncodingScope",level:5,type:"u",mandatory:!0,webm:!0,default:"1",description:"A bit field that describes which Elements have been modified in this way. Values (big-endian) can be OR'ed."},20531:{name:"ContentEncodingType",level:5,type:"u",mandatory:!0,webm:!0,default:"0",description:"A value describing what kind of transformation is applied."},20532:{name:"ContentCompression",level:5,type:"m",description:"Settings describing the compression used. This Element **MUST** be present if the value of ContentEncodingType is 0 and absent otherwise. Each block **MUST** be decompressable even if no previous block is available in order not to prevent seeking."},20533:{name:"ContentEncryption",level:5,type:"m",webm:!0,description:"Settings describing the encryption used. This Element **MUST** be present if the value of `ContentEncodingType` is 1 (encryption) and **MUST** be ignored otherwise."},21343:{name:"CueRefNumber",level:5,type:"u",minver:0,maxver:0,default:"1",range:"not 0",description:"Number of the referenced Block of Track X in the specified Cluster."},21358:{name:"Name",cppname:"TrackName",level:3,type:"8",description:"A human-readable track name."},21368:{name:"CueBlockNumber",level:4,type:"u",range:"not 0",description:"Number of the Block in the specified Cluster."},21375:{name:"TrackOffset",level:3,type:"i",minver:0,maxver:0,default:"0",description:"A value to add to the Block's Timestamp, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks). This can be used to adjust the playback offset of a track."},21419:{name:"SeekID",level:3,type:"b",mandatory:!0,description:"The binary ID corresponding to the Element name."},21420:{name:"SeekPosition",level:3,type:"u",mandatory:!0,description:"The Segment Position of the Element."},21432:{name:"StereoMode",cppname:"VideoStereoMode",level:4,type:"u",mandatory:!0,minver:3,webm:!0,default:"0",description:"Stereo-3D video mode. There are some more details in (#multi-planar-and-3d-videos)."},21433:{name:"OldStereoMode",level:4,type:"u",maxver:0,description:"DEPRECATED, DO NOT USE. Bogus StereoMode value used in old versions of libmatroska."},21440:{name:"AlphaMode",cppname:"VideoAlphaMode",level:4,type:"u",mandatory:!0,minver:3,webm:!0,default:"0",description:'Indicate whether the BlockAdditional Element with BlockAddID of "1" contains Alpha data, as defined by to the Codec Mapping for the `CodecID`. Undefined values **SHOULD NOT** be used as the behavior of known implementations is different (considered either as 0 or 1).'},21674:{name:"PixelCropBottom",cppname:"VideoPixelCropBottom",level:4,type:"u",mandatory:!0,default:"0",description:"The number of video pixels to remove at the bottom of the image."},21680:{name:"DisplayWidth",cppname:"VideoDisplayWidth",level:4,type:"u",range:"not 0",description:"Width of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements)."},21682:{name:"DisplayUnit",cppname:"VideoDisplayUnit",level:4,type:"u",mandatory:!0,default:"0",description:"How DisplayWidth & DisplayHeight are interpreted."},21683:{name:"AspectRatioType",cppname:"VideoAspectRatio",level:4,type:"u",minver:0,maxver:0,default:"0",description:"Specify the possible modifications to the aspect ratio."},21690:{name:"DisplayHeight",cppname:"VideoDisplayHeight",level:4,type:"u",range:"not 0",description:"Height of the video frames to display. Applies to the video frame after cropping (PixelCrop* Elements)."},21691:{name:"PixelCropTop",cppname:"VideoPixelCropTop",level:4,type:"u",mandatory:!0,default:"0",description:"The number of video pixels to remove at the top of the image."},21708:{name:"PixelCropLeft",cppname:"VideoPixelCropLeft",level:4,type:"u",mandatory:!0,default:"0",description:"The number of video pixels to remove on the left of the image."},21725:{name:"PixelCropRight",cppname:"VideoPixelCropRight",level:4,type:"u",mandatory:!0,default:"0",description:"The number of video pixels to remove on the right of the image."},21930:{name:"FlagForced",cppname:"TrackFlagForced",level:3,type:"u",mandatory:!0,default:"0",range:"0-1",description:"Applies only to subtitles. Set if that track **SHOULD** be eligible for automatic selection by the player if it matches the user's language preference, even if the user's preferences would normally not enable subtitles with the selected audio track; this can be used for tracks containing only translations of foreign-language audio or onscreen text. See (#default-track-selection) for more details."},21931:{name:"FlagHearingImpaired",level:3,type:"u",minver:4,range:"0-1",description:"Set to 1 if that track is suitable for users with hearing impairments, set to 0 if it is unsuitable for users with hearing impairments."},21932:{name:"FlagVisualImpaired",level:3,type:"u",minver:4,range:"0-1",description:"Set to 1 if that track is suitable for users with visual impairments, set to 0 if it is unsuitable for users with visual impairments."},21933:{name:"FlagTextDescriptions",level:3,type:"u",minver:4,range:"0-1",description:"Set to 1 if that track contains textual descriptions of video content, set to 0 if that track does not contain textual descriptions of video content."},21934:{name:"FlagOriginal",level:3,type:"u",minver:4,range:"0-1",description:"Set to 1 if that track is in the content's original language, set to 0 if it is a translation."},21935:{name:"FlagCommentary",level:3,type:"u",minver:4,range:"0-1",description:"Set to 1 if that track contains commentary, set to 0 if it does not contain commentary."},21936:{name:"Colour",cppname:"VideoColour",level:4,type:"m",minver:4,webm:!0,description:"Settings describing the colour format."},21937:{name:"MatrixCoefficients",cppname:"VideoColourMatrix",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"2",description:"The Matrix Coefficients of the video used to derive luma and chroma values from red, green, and blue color primaries. For clarity, the value and meanings for MatrixCoefficients are adopted from Table 4 of ISO/IEC 23001-8:2016 or ITU-T H.273."},21938:{name:"BitsPerChannel",cppname:"VideoBitsPerChannel",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"Number of decoded bits per channel. A value of 0 indicates that the BitsPerChannel is unspecified."},21939:{name:"ChromaSubsamplingHorz",cppname:"VideoChromaSubsampHorz",level:5,type:"u",minver:4,webm:!0,description:"The amount of pixels to remove in the Cr and Cb channels for every pixel not removed horizontally. Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingHorz **SHOULD** be set to 1."},21940:{name:"ChromaSubsamplingVert",cppname:"VideoChromaSubsampVert",level:5,type:"u",minver:4,webm:!0,description:"The amount of pixels to remove in the Cr and Cb channels for every pixel not removed vertically. Example: For video with 4:2:0 chroma subsampling, the ChromaSubsamplingVert **SHOULD** be set to 1."},21941:{name:"CbSubsamplingHorz",cppname:"VideoCbSubsampHorz",level:5,type:"u",minver:4,webm:!0,description:"The amount of pixels to remove in the Cb channel for every pixel not removed horizontally. This is additive with ChromaSubsamplingHorz. Example: For video with 4:2:1 chroma subsampling, the ChromaSubsamplingHorz **SHOULD** be set to 1 and CbSubsamplingHorz **SHOULD** be set to 1."},21942:{name:"CbSubsamplingVert",cppname:"VideoCbSubsampVert",level:5,type:"u",minver:4,webm:!0,description:"The amount of pixels to remove in the Cb channel for every pixel not removed vertically. This is additive with ChromaSubsamplingVert."},21943:{name:"ChromaSitingHorz",cppname:"VideoChromaSitHorz",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"How chroma is subsampled horizontally."},21944:{name:"ChromaSitingVert",cppname:"VideoChromaSitVert",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"How chroma is subsampled vertically."},21945:{name:"Range",cppname:"VideoColourRange",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"Clipping of the color ranges."},21946:{name:"TransferCharacteristics",cppname:"VideoColourTransferCharacter",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"2",description:"The transfer characteristics of the video. For clarity, the value and meanings for TransferCharacteristics are adopted from Table 3 of ISO/IEC 23091-4 or ITU-T H.273."},21947:{name:"Primaries",cppname:"VideoColourPrimaries",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"2",description:"The colour primaries of the video. For clarity, the value and meanings for Primaries are adopted from Table 2 of ISO/IEC 23091-4 or ITU-T H.273."},21948:{name:"MaxCLL",cppname:"VideoColourMaxCLL",level:5,type:"u",minver:4,webm:!0,description:"Maximum brightness of a single pixel (Maximum Content Light Level) in candelas per square meter (cd/m^2^)."},21949:{name:"MaxFALL",cppname:"VideoColourMaxFALL",level:5,type:"u",minver:4,webm:!0,description:"Maximum brightness of a single full frame (Maximum Frame-Average Light Level) in candelas per square meter (cd/m^2^)."},21968:{name:"MasteringMetadata",cppname:"VideoColourMasterMeta",level:5,type:"m",minver:4,webm:!0,description:"SMPTE 2086 mastering data."},21969:{name:"PrimaryRChromaticityX",cppname:"VideoRChromaX",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Red X chromaticity coordinate, as defined by CIE 1931."},21970:{name:"PrimaryRChromaticityY",cppname:"VideoRChromaY",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Red Y chromaticity coordinate, as defined by CIE 1931."},21971:{name:"PrimaryGChromaticityX",cppname:"VideoGChromaX",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Green X chromaticity coordinate, as defined by CIE 1931."},21972:{name:"PrimaryGChromaticityY",cppname:"VideoGChromaY",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Green Y chromaticity coordinate, as defined by CIE 1931."},21973:{name:"PrimaryBChromaticityX",cppname:"VideoBChromaX",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Blue X chromaticity coordinate, as defined by CIE 1931."},21974:{name:"PrimaryBChromaticityY",cppname:"VideoBChromaY",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"Blue Y chromaticity coordinate, as defined by CIE 1931."},21975:{name:"WhitePointChromaticityX",cppname:"VideoWhitePointChromaX",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"White X chromaticity coordinate, as defined by CIE 1931."},21976:{name:"WhitePointChromaticityY",cppname:"VideoWhitePointChromaY",level:6,type:"f",minver:4,webm:!0,range:"0-1",description:"White Y chromaticity coordinate, as defined by CIE 1931."},21977:{name:"LuminanceMax",cppname:"VideoLuminanceMax",level:6,type:"f",minver:4,webm:!0,range:">= 0x0p+0",description:"Maximum luminance. Represented in candelas per square meter (cd/m^2^)."},21978:{name:"LuminanceMin",cppname:"VideoLuminanceMin",level:6,type:"f",minver:4,webm:!0,range:">= 0x0p+0",description:"Minimum luminance. Represented in candelas per square meter (cd/m^2^)."},21998:{name:"MaxBlockAdditionID",level:3,type:"u",mandatory:!0,default:"0",description:"The maximum value of BlockAddID ((#blockaddid-element)). A value 0 means there is no BlockAdditions ((#blockadditions-element)) for this track."},22100:{name:"ChapterStringUID",level:4,type:"8",minver:3,webm:!0,description:"A unique string ID to identify the Chapter. Use for WebVTT cue identifier storage [@!WebVTT]."},22186:{name:"CodecDelay",level:3,type:"u",mandatory:!0,minver:4,webm:!0,description:"CodecDelay is The codec-built-in delay, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks). It represents the amount of codec samples that will be discarded by the decoder during playback. This timestamp value **MUST** be subtracted from each frame timestamp in order to get the timestamp that will be actually played. The value **SHOULD** be small so the muxing of tracks with the same actual timestamp are in the same Cluster."},22203:{name:"SeekPreRoll",level:3,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"After a discontinuity, SeekPreRoll is the duration of the data the decoder **MUST** decode before the decoded data is valid, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks)."},22337:{name:"WritingApp",level:2,type:"8",mandatory:!0,description:'Writing application (example: "mkvmerge-0.3.3").'},22612:{name:"SilentTracks",cppname:"ClusterSilentTracks",level:2,type:"m",minver:0,maxver:0,description:"The list of tracks that are not used in that part of the stream. It is useful when using overlay tracks on seeking or to decide what track to use."},22743:{name:"SilentTrackNumber",cppname:"ClusterSilentTrackNumber",level:3,type:"u",multiple:!0,minver:0,maxver:0,description:"One of the track number that are not used from now on in the stream. It could change later if not specified as silent in a further Cluster."},24999:{name:"AttachedFile",cppname:"Attached",level:2,type:"m",mandatory:!0,multiple:!0,description:"An attached file."},25152:{name:"ContentEncoding",level:4,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"Settings for one content encoding like compression or encryption."},25188:{name:"BitDepth",cppname:"AudioBitDepth",level:4,type:"u",range:"not 0",description:"Bits per sample, mostly used for PCM."},25506:{name:"CodecPrivate",level:3,type:"b",description:"Private data only known to the codec."},25536:{name:"Targets",cppname:"TagTargets",level:3,type:"m",mandatory:!0,webm:!0,description:"Specifies which other elements the metadata represented by the Tag applies to. If empty or not present, then the Tag describes everything in the Segment."},25539:{name:"ChapterPhysicalEquiv",level:4,type:"u",description:'Specify the physical equivalent of this ChapterAtom like "DVD" (60) or "SIDE" (50); see (#physical-types) for a complete list of values.'},25540:{name:"TagChapterUID",level:4,type:"u",multiple:!0,default:"0",description:"A unique ID to identify the Chapter(s) the tags belong to."},25541:{name:"TagTrackUID",level:4,type:"u",multiple:!0,webm:!0,default:"0",description:"A unique ID to identify the Track(s) the tags belong to."},25542:{name:"TagAttachmentUID",level:4,type:"u",multiple:!0,default:"0",description:"A unique ID to identify the Attachment(s) the tags belong to."},25545:{name:"TagEditionUID",level:4,type:"u",multiple:!0,default:"0",description:"A unique ID to identify the EditionEntry(s) the tags belong to."},25546:{name:"TargetType",cppname:"TagTargetType",level:4,type:"s",webm:!0,description:'An informational string that can be used to display the logical level of the target like "ALBUM", "TRACK", "MOVIE", "CHAPTER", etc ; see Section 6.4 of [@!MatroskaTags].'},25906:{name:"SignedElement",level:2,type:"b",multiple:!0,webm:!1,description:"An element ID whose data will be used to compute the signature."},26148:{name:"TrackTranslate",level:3,type:"m",multiple:!0,description:"The mapping between this `TrackEntry` and a track value in the given Chapter Codec."},26277:{name:"TrackTranslateTrackID",level:4,type:"b",mandatory:!0,description:"The binary value used to represent this `TrackEntry` in the chapter codec data. The format depends on the `ChapProcessCodecID` used; see (#chapprocesscodecid-element)."},26303:{name:"TrackTranslateCodec",level:4,type:"u",mandatory:!0,description:"This `TrackTranslate` applies to this chapter codec of the given chapter edition(s); see (#chapprocesscodecid-element)."},26364:{name:"TrackTranslateEditionUID",level:4,type:"u",multiple:!0,description:"Specify a chapter edition UID on which this `TrackTranslate` applies."},26568:{name:"SimpleTag",cppname:"TagSimple",level:3,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"Contains general information about the target."},26826:{name:"TargetTypeValue",cppname:"TagTargetTypeValue",level:4,type:"u",mandatory:!0,webm:!0,default:"50",description:"A number to indicate the logical level of the target."},26897:{name:"ChapProcessCommand",cppname:"ChapterProcessCommand",level:5,type:"m",multiple:!0,description:"Contains all the commands associated to the Atom."},26914:{name:"ChapProcessTime",cppname:"ChapterProcessTime",level:6,type:"u",mandatory:!0,description:"Defines when the process command **SHOULD** be handled"},26916:{name:"ChapterTranslate",level:2,type:"m",multiple:!0,description:"The mapping between this `Segment` and a segment value in the given Chapter Codec."},26931:{name:"ChapProcessData",cppname:"ChapterProcessData",level:6,type:"b",mandatory:!0,description:"Contains the command information. The data **SHOULD** be interpreted depending on the ChapProcessCodecID value. For ChapProcessCodecID = 1, the data correspond to the binary DVD cell pre/post commands; see (#menu-features) on DVD menus."},26948:{name:"ChapProcess",cppname:"ChapterProcess",level:4,type:"m",multiple:!0,description:"Contains all the commands associated to the Atom."},26965:{name:"ChapProcessCodecID",cppname:"ChapterProcessCodecID",level:5,type:"u",mandatory:!0,default:"0",description:"Contains the type of the codec used for the processing. A value of 0 means native Matroska processing (to be defined), a value of 1 means the DVD command set is used; see (#menu-features) on DVD menus. More codec IDs can be added later."},27045:{name:"ChapterTranslateID",level:3,type:"b",mandatory:!0,description:"The binary value used to represent this Segment in the chapter codec data. The format depends on the ChapProcessCodecID used; see (#chapprocesscodecid-element)."},27071:{name:"ChapterTranslateCodec",level:3,type:"u",mandatory:!0,description:"This `ChapterTranslate` applies to this chapter codec of the given chapter edition(s); see (#chapprocesscodecid-element)."},27132:{name:"ChapterTranslateEditionUID",level:3,type:"u",multiple:!0,description:"Specify a chapter edition UID on which this `ChapterTranslate` applies."},28032:{name:"ContentEncodings",level:3,type:"m",webm:!0,description:"Settings for several content encoding mechanisms like compression or encryption."},28135:{name:"MinCache",cppname:"TrackMinCache",level:3,type:"u",mandatory:!0,default:"0",description:"The minimum number of frames a player **SHOULD** be able to cache during playback. If set to 0, the reference pseudo-cache system is not used."},28152:{name:"MaxCache",cppname:"TrackMaxCache",level:3,type:"u",description:"The maximum cache size necessary to store referenced frames in and the current frame. 0 means no cache is needed."},28263:{name:"ChapterSegmentUID",level:4,type:"b",range:">0",description:"The SegmentUID of another Segment to play during this chapter."},28348:{name:"ChapterSegmentEditionUID",level:4,type:"u",range:"not 0",description:"The EditionUID to play from the Segment linked in ChapterSegmentUID. If ChapterSegmentEditionUID is undeclared, then no Edition of the linked Segment is used; see (#medium-linking) on medium-linking Segments."},28587:{name:"TrackOverlay",level:3,type:"u",multiple:!0,description:"Specify that this track is an overlay track for the Track specified (in the u-integer). That means when this track has a gap, see (#silenttracks-element) on SilentTracks, the overlay track **SHOULD** be used instead. The order of multiple TrackOverlay matters, the first one is the one that **SHOULD** be used. If not found it **SHOULD** be the second, etc."},29555:{name:"Tag",level:2,type:"m",mandatory:!0,multiple:!0,webm:!0,description:"A single metadata descriptor."},29572:{name:"SegmentFilename",level:2,type:"8",description:"A filename corresponding to this Segment."},29604:{name:"SegmentUID",level:2,type:"b",range:"not 0",description:"A randomly generated unique ID to identify the Segment amongst many others (128 bits)."},29636:{name:"ChapterUID",level:4,type:"u",mandatory:!0,webm:!0,range:"not 0",description:"A unique ID to identify the Chapter."},29637:{name:"TrackUID",level:3,type:"u",mandatory:!0,range:"not 0",description:"A unique ID to identify the Track."},29766:{name:"AttachmentLink",cppname:"TrackAttachmentLink",level:3,type:"u",maxver:3,range:"not 0",description:"The UID of an attachment that is used by this codec."},30113:{name:"BlockAdditions",level:3,type:"m",webm:!0,description:"Contain additional blocks to complete the main one. An EBML parser that has no knowledge of the Block structure could still see and use/skip these data."},30114:{name:"DiscardPadding",level:3,type:"i",minver:4,webm:!0,description:"Duration of the silent data added to the Block, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks) (padding at the end of the Block for positive value, at the beginning of the Block for negative value). The duration of DiscardPadding is not calculated in the duration of the TrackEntry and **SHOULD** be discarded during playback."},30320:{name:"Projection",cppname:"VideoProjection",level:4,type:"m",minver:4,webm:!0,description:"Describes the video projection details. Used to render spherical, VR videos or flipping videos horizontally/vertically."},30321:{name:"ProjectionType",cppname:"VideoProjectionType",level:5,type:"u",mandatory:!0,minver:4,webm:!0,default:"0",description:"Describes the projection used for this video track."},30322:{name:"ProjectionPrivate",cppname:"VideoProjectionPrivate",level:5,type:"b",minver:4,webm:!0,description:"Private data that only applies to a specific projection. * If `ProjectionType` equals 0 (Rectangular), then this element must not be present. * If `ProjectionType` equals 1 (Equirectangular), then this element must be present and contain the same binary data that would be stored inside an ISOBMFF Equirectangular Projection Box ('equi'). * If `ProjectionType` equals 2 (Cubemap), then this element must be present and contain the same binary data that would be stored inside an ISOBMFF Cubemap Projection Box ('cbmp'). * If `ProjectionType` equals 3 (Mesh), then this element must be present and contain the same binary data that would be stored inside an ISOBMFF Mesh Projection Box ('mshp')."},30323:{name:"ProjectionPoseYaw",cppname:"VideoProjectionPoseYaw",level:5,type:"f",mandatory:!0,minver:4,webm:!0,default:"0x0p+0",range:">= -0xB4p+0, <= 0xB4p+0",description:"Specifies a yaw rotation to the projection. Value represents a clockwise rotation, in degrees, around the up vector. This rotation must be applied before any `ProjectionPosePitch` or `ProjectionPoseRoll` rotations. The value of this element **MUST** be in the -180 to 180 degree range, both included. Setting `ProjectionPoseYaw` to 180 or -180 degrees, with the `ProjectionPoseRoll` and `ProjectionPosePitch` set to 0 degrees flips the image horizontally."},30324:{name:"ProjectionPosePitch",cppname:"VideoProjectionPosePitch",level:5,type:"f",mandatory:!0,minver:4,webm:!0,default:"0x0p+0",range:">= -0x5Ap+0, <= 0x5Ap+0",description:"Specifies a pitch rotation to the projection. Value represents a counter-clockwise rotation, in degrees, around the right vector. This rotation must be applied after the `ProjectionPoseYaw` rotation and before the `ProjectionPoseRoll` rotation. The value of this element **MUST** be in the -90 to 90 degree range, both included."},30325:{name:"ProjectionPoseRoll",cppname:"VideoProjectionPoseRoll",level:5,type:"f",mandatory:!0,minver:4,webm:!0,default:"0x0p+0",range:">= -0xB4p+0, <= 0xB4p+0",description:"Specifies a roll rotation to the projection. Value represents a counter-clockwise rotation, in degrees, around the forward vector. This rotation must be applied after the `ProjectionPoseYaw` and `ProjectionPosePitch` rotations. The value of this element **MUST** be in the -180 to 180 degree range, both included. Setting `ProjectionPoseRoll` to 180 or -180 degrees, the `ProjectionPoseYaw` to 180 or -180 degrees with `ProjectionPosePitch` set to 0 degrees flips the image vertically. Setting `ProjectionPoseRoll` to 180 or -180 degrees, with the `ProjectionPoseYaw` and `ProjectionPosePitch` set to 0 degrees flips the image horizontally and vertically."},30901:{name:"OutputSamplingFrequency",cppname:"AudioOutputSamplingFreq",level:4,type:"f",range:"> 0x0p+0",description:"Real output sampling frequency in Hz (used for SBR techniques)."},31657:{name:"Title",level:2,type:"8",webm:!0,description:"General name of the Segment."},32123:{name:"ChannelPositions",cppname:"AudioPosition",level:4,type:"b",minver:0,maxver:0,description:"Table of horizontal angles for each successive channel."},32347:{name:"SignatureElements",level:1,type:"m",webm:!1,description:"Contains elements that will be used to compute the signature."},32379:{name:"SignatureElementList",level:2,type:"m",multiple:!0,webm:!1,i:"Cluster|Block|BlockAdditional",description:"A list consists of a number of consecutive elements that represent one case where data is used in signature. Ex: means that the BlockAdditional of all Blocks in all Clusters is used for encryption."},32394:{name:"SignatureAlgo",level:2,type:"u",webm:!1,description:"Signature algorithm used (1=RSA, 2=elliptic)."},32410:{name:"SignatureHash",level:2,type:"u",webm:!1,description:"Hash algorithm used (1=SHA1-160, 2=MD5)."},32421:{name:"SignaturePublicKey",level:2,type:"b",webm:!1,description:"The public key to use with the algorithm (in the case of a PKI-based signature)."},32437:{name:"Signature",level:2,type:"b",webm:!1,description:"The signature of the data (until a new."},2274716:{name:"Language",cppname:"TrackLanguage",level:3,type:"s",mandatory:!0,default:"eng",description:"Specifies the language of the track in the Matroska languages form; see (#language-codes) on language codes. This Element **MUST** be ignored if the LanguageIETF Element is used in the same TrackEntry."},2274717:{name:"LanguageIETF",level:3,type:"s",minver:4,description:"Specifies the language of the track according to [@!BCP47] and using the IANA Language Subtag Registry [@!IANALangRegistry]. If this Element is used, then any Language Elements used in the same TrackEntry **MUST** be ignored."},2306383:{name:"TrackTimestampScale",cppname:"TrackTimecodeScale",level:3,type:"f",mandatory:!0,maxver:3,default:"0x1p+0",range:"> 0x0p+0",description:"DEPRECATED, DO NOT USE. The scale to apply on this track to work at normal speed in relation with other tracks (mostly used to adjust video speed when the audio length differs)."},2313850:{name:"DefaultDecodedFieldDuration",cppname:"TrackDefaultDecodedFieldDuration",level:3,type:"u",minver:4,range:"not 0",description:"The period between two successive fields at the output of the decoding process, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks). see (#defaultdecodedfieldduration) for more information"},2327523:{name:"FrameRate",cppname:"VideoFrameRate",level:4,type:"f",minver:0,maxver:0,range:"> 0x0p+0",description:"Number of frames per second. This value is Informational only. It is intended for constant frame rate streams, and **SHOULD NOT** be used for a variable frame rate TrackEntry."},2352003:{name:"DefaultDuration",cppname:"TrackDefaultDuration",level:3,type:"u",range:"not 0",description:"Number of nanoseconds per frame, expressed in Matroska Ticks -- ie in nanoseconds; see (#timestamp-ticks) (frame in the Matroska sense -- one Element put into a (Simple)Block)."},2459272:{name:"CodecName",level:3,type:"8",description:"A human-readable string specifying the codec."},2536e3:{name:"CodecDownloadURL",level:3,type:"s",multiple:!0,minver:0,maxver:0,description:"A URL to download about the codec used."},2807729:{name:"TimestampScale",cppname:"TimecodeScale",level:2,type:"u",mandatory:!0,default:"1000000",range:"not 0",description:"Base unit for Segment Ticks and Track Ticks, in nanoseconds. A TimestampScale value of 1.000.000 means scaled timestamps in the Segment are expressed in milliseconds; see (#timestamps) on how to interpret timestamps."},2807730:{name:"TimecodeScaleDenominator",level:2,type:"u",mandatory:!0,minver:4,default:"1000000000",description:"Timestamp scale numerator, see TimecodeScale."},3061028:{name:"UncompressedFourCC",cppname:"VideoColourSpace",level:4,type:"b",description:"Specify the uncompressed pixel format used for the Track's data as a FourCC. This value is similar in scope to the biCompression value of AVI's `BITMAPINFO` [@?AVIFormat]. See the YUV video formats [@?FourCC-YUV] and RGB video formats [@?FourCC-RGB] for common values."},3126563:{name:"GammaValue",cppname:"VideoGamma",level:4,type:"f",minver:0,maxver:0,range:"> 0x0p+0",description:"Gamma Value."},3839639:{name:"CodecSettings",level:3,type:"8",minver:0,maxver:0,description:"A string describing the encoding setting used."},3883072:{name:"CodecInfoURL",level:3,type:"s",multiple:!0,minver:0,maxver:0,description:"A URL to find information about the codec used."},3965867:{name:"PrevFilename",level:2,type:"8",description:"A filename corresponding to the file of the previous Linked Segment."},3979555:{name:"PrevUID",level:2,type:"b",description:"A unique ID to identify the previous Segment of a Linked Segment (128 bits)."},4096955:{name:"NextFilename",level:2,type:"8",description:"A filename corresponding to the file of the next Linked Segment."},4110627:{name:"NextUID",level:2,type:"b",description:"A unique ID to identify the next Segment of a Linked Segment (128 bits)."},272869232:{name:"Chapters",level:1,type:"m",webm:!0,description:"A system to define basic menus and partition data. For more detailed information, look at the Chapters explanation in (#chapters)."},290298740:{name:"SeekHead",level:1,type:"m",multiple:!0,description:"Contains the Segment Position of other Top-Level Elements."},307544935:{name:"Tags",level:1,type:"m",multiple:!0,webm:!0,description:"Element containing metadata describing Tracks, Editions, Chapters, Attachments, or the Segment as a whole. A list of valid tags can be found in [@!MatroskaTags]."},357149030:{name:"Info",level:1,type:"m",mandatory:!0,description:"Contains general information about the Segment."},374648427:{name:"Tracks",level:1,type:"m",description:"A Top-Level Element of information with many tracks described."},408125543:{name:"Segment",level:0,type:"m",mandatory:!0,description:"The Root Element that contains all other Top-Level Elements (Elements defined only at Level 1). A Matroska file is composed of 1 Segment."},423732329:{name:"Attachments",level:1,type:"m",description:"Contain attached files."},440786851:{name:"EBML",level:"0",type:"m",mandatory:!0,multiple:!1,minver:1,description:"Set the EBML characteristics of the data to follow. Each EBML document has to start with this."},458458727:{name:"SignatureSlot",level:1,type:"m",multiple:!0,webm:!1,description:"Contain signature of some (coming) elements in the stream."},475249515:{name:"Cues",level:1,type:"m",description:"A Top-Level Element to speed seeking access. All entries are local to the Segment."},524531317:{name:"Cluster",level:1,type:"m",multiple:!0,description:"The Top-Level Element containing the (monolithic) Block structure."}},n={},s={byEbmlID:r,byName:n};for(var a in r){var o=r[a];n[o.name.replace("-","_")]=parseInt(a,10)}t.exports=s},"1b3b":function(t,e,i){"use strict";i("6ce5")},"1be4":function(t,e,i){"use strict";var r=i("d066");t.exports=r("document","documentElement")},"1bf2":function(t,e,i){"use strict";var r=i("23e7"),n=i("56ef");r({target:"Reflect",stat:!0},{ownKeys:n})},"1c35":function(t,e,i){"use strict";(function(t){ /*! * The buffer module from node.js, for the browser. * * @author Feross Aboukhadijeh * @license MIT */ var r=i("1fb5"),n=i("9152"),s=i("e3db");function a(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()&&"function"===typeof t.subarray&&0===t.subarray(1,1).byteLength}catch(e){return!1}}function o(){return c.TYPED_ARRAY_SUPPORT?2147483647:1073741823}function h(t,e){if(o()=o())throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o().toString(16)+" bytes");return 0|t}function b(t){return+t!=t&&(t=0),c.alloc(+t)}function _(t,e){if(c.isBuffer(t))return t.length;if("undefined"!==typeof ArrayBuffer&&"function"===typeof ArrayBuffer.isView&&(ArrayBuffer.isView(t)||t instanceof ArrayBuffer))return t.byteLength;"string"!==typeof t&&(t=""+t);var i=t.length;if(0===i)return 0;for(var r=!1;;)switch(e){case"ascii":case"latin1":case"binary":return i;case"utf8":case"utf-8":case void 0:return Q(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*i;case"hex":return i>>>1;case"base64":return J(t).length;default:if(r)return Q(t).length;e=(""+e).toLowerCase(),r=!0}}function T(t,e,i){var r=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===i||i>this.length)&&(i=this.length),i<=0)return"";if(i>>>=0,e>>>=0,i<=e)return"";t||(t="utf8");while(1)switch(t){case"hex":return L(this,e,i);case"utf8":case"utf-8":return D(this,e,i);case"ascii":return N(this,e,i);case"latin1":case"binary":return B(this,e,i);case"base64":return k(this,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return U(this,e,i);default:if(r)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),r=!0}}function S(t,e,i){var r=t[e];t[e]=t[i],t[i]=r}function w(t,e,i,r,n){if(0===t.length)return-1;if("string"===typeof i?(r=i,i=0):i>2147483647?i=2147483647:i<-2147483648&&(i=-2147483648),i=+i,isNaN(i)&&(i=n?0:t.length-1),i<0&&(i=t.length+i),i>=t.length){if(n)return-1;i=t.length-1}else if(i<0){if(!n)return-1;i=0}if("string"===typeof e&&(e=c.from(e,r)),c.isBuffer(e))return 0===e.length?-1:E(t,e,i,r,n);if("number"===typeof e)return e&=255,c.TYPED_ARRAY_SUPPORT&&"function"===typeof Uint8Array.prototype.indexOf?n?Uint8Array.prototype.indexOf.call(t,e,i):Uint8Array.prototype.lastIndexOf.call(t,e,i):E(t,[e],i,r,n);throw new TypeError("val must be string, number or Buffer")}function E(t,e,i,r,n){var s,a=1,o=t.length,h=e.length;if(void 0!==r&&(r=String(r).toLowerCase(),"ucs2"===r||"ucs-2"===r||"utf16le"===r||"utf-16le"===r)){if(t.length<2||e.length<2)return-1;a=2,o/=2,h/=2,i/=2}function c(t,e){return 1===a?t[e]:t.readUInt16BE(e*a)}if(n){var u=-1;for(s=i;so&&(i=o-h),s=i;s>=0;s--){for(var l=!0,d=0;dn&&(r=n)):r=n;var s=e.length;if(s%2!==0)throw new TypeError("Invalid hex string");r>s/2&&(r=s/2);for(var a=0;a239?4:c>223?3:c>191?2:1;if(n+l<=i)switch(l){case 1:c<128&&(u=c);break;case 2:s=t[n+1],128===(192&s)&&(h=(31&c)<<6|63&s,h>127&&(u=h));break;case 3:s=t[n+1],a=t[n+2],128===(192&s)&&128===(192&a)&&(h=(15&c)<<12|(63&s)<<6|63&a,h>2047&&(h<55296||h>57343)&&(u=h));break;case 4:s=t[n+1],a=t[n+2],o=t[n+3],128===(192&s)&&128===(192&a)&&128===(192&o)&&(h=(15&c)<<18|(63&s)<<12|(63&a)<<6|63&o,h>65535&&h<1114112&&(u=h))}null===u?(u=65533,l=1):u>65535&&(u-=65536,r.push(u>>>10&1023|55296),u=56320|1023&u),r.push(u),n+=l}return M(r)}e.Buffer=c,e.SlowBuffer=b,e.INSPECT_MAX_BYTES=50,c.TYPED_ARRAY_SUPPORT=void 0!==t.TYPED_ARRAY_SUPPORT?t.TYPED_ARRAY_SUPPORT:a(),e.kMaxLength=o(),c.poolSize=8192,c._augment=function(t){return t.__proto__=c.prototype,t},c.from=function(t,e,i){return u(null,t,e,i)},c.TYPED_ARRAY_SUPPORT&&(c.prototype.__proto__=Uint8Array.prototype,c.__proto__=Uint8Array,"undefined"!==typeof Symbol&&Symbol.species&&c[Symbol.species]===c&&Object.defineProperty(c,Symbol.species,{value:null,configurable:!0})),c.alloc=function(t,e,i){return d(null,t,e,i)},c.allocUnsafe=function(t){return f(null,t)},c.allocUnsafeSlow=function(t){return f(null,t)},c.isBuffer=function(t){return!(null==t||!t._isBuffer)},c.compare=function(t,e){if(!c.isBuffer(t)||!c.isBuffer(e))throw new TypeError("Arguments must be Buffers");if(t===e)return 0;for(var i=t.length,r=e.length,n=0,s=Math.min(i,r);n0&&(t=this.toString("hex",0,i).match(/.{2}/g).join(" "),this.length>i&&(t+=" ... ")),""},c.prototype.compare=function(t,e,i,r,n){if(!c.isBuffer(t))throw new TypeError("Argument must be a Buffer");if(void 0===e&&(e=0),void 0===i&&(i=t?t.length:0),void 0===r&&(r=0),void 0===n&&(n=this.length),e<0||i>t.length||r<0||n>this.length)throw new RangeError("out of range index");if(r>=n&&e>=i)return 0;if(r>=n)return-1;if(e>=i)return 1;if(e>>>=0,i>>>=0,r>>>=0,n>>>=0,this===t)return 0;for(var s=n-r,a=i-e,o=Math.min(s,a),h=this.slice(r,n),u=t.slice(e,i),l=0;ln)&&(i=n),t.length>0&&(i<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");r||(r="utf8");for(var s=!1;;)switch(r){case"hex":return x(this,t,e,i);case"utf8":case"utf-8":return A(this,t,e,i);case"ascii":return C(this,t,e,i);case"latin1":case"binary":return R(this,t,e,i);case"base64":return P(this,t,e,i);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return I(this,t,e,i);default:if(s)throw new TypeError("Unknown encoding: "+r);r=(""+r).toLowerCase(),s=!0}},c.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var O=4096;function M(t){var e=t.length;if(e<=O)return String.fromCharCode.apply(String,t);var i="",r=0;while(rr)&&(i=r);for(var n="",s=e;si)throw new RangeError("Trying to access beyond buffer length")}function F(t,e,i,r,n,s){if(!c.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>n||et.length)throw new RangeError("Index out of range")}function W(t,e,i,r){e<0&&(e=65535+e+1);for(var n=0,s=Math.min(t.length-i,2);n>>8*(r?n:1-n)}function H(t,e,i,r){e<0&&(e=4294967295+e+1);for(var n=0,s=Math.min(t.length-i,4);n>>8*(r?n:3-n)&255}function j(t,e,i,r,n,s){if(i+r>t.length)throw new RangeError("Index out of range");if(i<0)throw new RangeError("Index out of range")}function V(t,e,i,r,s){return s||j(t,e,i,4,34028234663852886e22,-34028234663852886e22),n.write(t,e,i,r,23,4),i+4}function q(t,e,i,r,s){return s||j(t,e,i,8,17976931348623157e292,-17976931348623157e292),n.write(t,e,i,r,52,8),i+8}c.prototype.slice=function(t,e){var i,r=this.length;if(t=~~t,e=void 0===e?r:~~e,t<0?(t+=r,t<0&&(t=0)):t>r&&(t=r),e<0?(e+=r,e<0&&(e=0)):e>r&&(e=r),e0&&(n*=256))r+=this[t+--e]*n;return r},c.prototype.readUInt8=function(t,e){return e||z(t,1,this.length),this[t]},c.prototype.readUInt16LE=function(t,e){return e||z(t,2,this.length),this[t]|this[t+1]<<8},c.prototype.readUInt16BE=function(t,e){return e||z(t,2,this.length),this[t]<<8|this[t+1]},c.prototype.readUInt32LE=function(t,e){return e||z(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},c.prototype.readUInt32BE=function(t,e){return e||z(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},c.prototype.readIntLE=function(t,e,i){t|=0,e|=0,i||z(t,e,this.length);var r=this[t],n=1,s=0;while(++s=n&&(r-=Math.pow(2,8*e)),r},c.prototype.readIntBE=function(t,e,i){t|=0,e|=0,i||z(t,e,this.length);var r=e,n=1,s=this[t+--r];while(r>0&&(n*=256))s+=this[t+--r]*n;return n*=128,s>=n&&(s-=Math.pow(2,8*e)),s},c.prototype.readInt8=function(t,e){return e||z(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},c.prototype.readInt16LE=function(t,e){e||z(t,2,this.length);var i=this[t]|this[t+1]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt16BE=function(t,e){e||z(t,2,this.length);var i=this[t+1]|this[t]<<8;return 32768&i?4294901760|i:i},c.prototype.readInt32LE=function(t,e){return e||z(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},c.prototype.readInt32BE=function(t,e){return e||z(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},c.prototype.readFloatLE=function(t,e){return e||z(t,4,this.length),n.read(this,t,!0,23,4)},c.prototype.readFloatBE=function(t,e){return e||z(t,4,this.length),n.read(this,t,!1,23,4)},c.prototype.readDoubleLE=function(t,e){return e||z(t,8,this.length),n.read(this,t,!0,52,8)},c.prototype.readDoubleBE=function(t,e){return e||z(t,8,this.length),n.read(this,t,!1,52,8)},c.prototype.writeUIntLE=function(t,e,i,r){if(t=+t,e|=0,i|=0,!r){var n=Math.pow(2,8*i)-1;F(this,t,e,i,n,0)}var s=1,a=0;this[e]=255&t;while(++a=0&&(a*=256))this[e+s]=t/a&255;return e+i},c.prototype.writeUInt8=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,1,255,0),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),this[e]=255&t,e+1},c.prototype.writeUInt16LE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},c.prototype.writeUInt16BE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,2,65535,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},c.prototype.writeUInt32LE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t):H(this,t,e,!0),e+4},c.prototype.writeUInt32BE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,4,4294967295,0),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},c.prototype.writeIntLE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);F(this,t,e,i,n-1,-n)}var s=0,a=1,o=0;this[e]=255&t;while(++s>0)-o&255;return e+i},c.prototype.writeIntBE=function(t,e,i,r){if(t=+t,e|=0,!r){var n=Math.pow(2,8*i-1);F(this,t,e,i,n-1,-n)}var s=i-1,a=1,o=0;this[e+s]=255&t;while(--s>=0&&(a*=256))t<0&&0===o&&0!==this[e+s+1]&&(o=1),this[e+s]=(t/a>>0)-o&255;return e+i},c.prototype.writeInt8=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,1,127,-128),c.TYPED_ARRAY_SUPPORT||(t=Math.floor(t)),t<0&&(t=255+t+1),this[e]=255&t,e+1},c.prototype.writeInt16LE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8):W(this,t,e,!0),e+2},c.prototype.writeInt16BE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,2,32767,-32768),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>8,this[e+1]=255&t):W(this,t,e,!1),e+2},c.prototype.writeInt32LE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,4,2147483647,-2147483648),c.TYPED_ARRAY_SUPPORT?(this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24):H(this,t,e,!0),e+4},c.prototype.writeInt32BE=function(t,e,i){return t=+t,e|=0,i||F(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),c.TYPED_ARRAY_SUPPORT?(this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t):H(this,t,e,!1),e+4},c.prototype.writeFloatLE=function(t,e,i){return V(this,t,e,!0,i)},c.prototype.writeFloatBE=function(t,e,i){return V(this,t,e,!1,i)},c.prototype.writeDoubleLE=function(t,e,i){return q(this,t,e,!0,i)},c.prototype.writeDoubleBE=function(t,e,i){return q(this,t,e,!1,i)},c.prototype.copy=function(t,e,i,r){if(i||(i=0),r||0===r||(r=this.length),e>=t.length&&(e=t.length),e||(e=0),r>0&&r=this.length)throw new RangeError("sourceStart out of bounds");if(r<0)throw new RangeError("sourceEnd out of bounds");r>this.length&&(r=this.length),t.length-e=0;--n)t[n+e]=this[n+i];else if(s<1e3||!c.TYPED_ARRAY_SUPPORT)for(n=0;n>>=0,i=void 0===i?this.length:i>>>0,t||(t=0),"number"===typeof t)for(s=e;s55295&&i<57344){if(!n){if(i>56319){(e-=3)>-1&&s.push(239,191,189);continue}if(a+1===r){(e-=3)>-1&&s.push(239,191,189);continue}n=i;continue}if(i<56320){(e-=3)>-1&&s.push(239,191,189),n=i;continue}i=65536+(n-55296<<10|i-56320)}else n&&(e-=3)>-1&&s.push(239,191,189);if(n=null,i<128){if((e-=1)<0)break;s.push(i)}else if(i<2048){if((e-=2)<0)break;s.push(i>>6|192,63&i|128)}else if(i<65536){if((e-=3)<0)break;s.push(i>>12|224,i>>6&63|128,63&i|128)}else{if(!(i<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;s.push(i>>18|240,i>>12&63|128,i>>6&63|128,63&i|128)}}return s}function K(t){for(var e=[],i=0;i>8,n=i%256,s.push(n),s.push(r)}return s}function J(t){return r.toByteArray(Y(t))}function tt(t,e,i,r){for(var n=0;n=e.length||n>=t.length)break;e[n+i]=t[n]}return n}function et(t){return t!==t}}).call(this,i("c8ba"))},"1c59":function(t,e,i){"use strict";var r=i("6d61"),n=i("6566");r("Set",(function(t){return function(){return t(this,arguments.length?arguments[0]:void 0)}}),n)},"1c7e":function(t,e,i){"use strict";var r=i("b622"),n=r("iterator"),s=!1;try{var a=0,o={next:function(){return{done:!!a++}},return:function(){s=!0}};o[n]=function(){return this},Array.from(o,(function(){throw 2}))}catch(h){}t.exports=function(t,e){try{if(!e&&!s)return!1}catch(h){return!1}var i=!1;try{var r={};r[n]=function(){return{next:function(){return{done:i=!0}}}},t(r)}catch(h){}return i}},"1d02":function(t,e,i){"use strict";var r=i("ebb5"),n=i("a258").findLastIndex,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("findLastIndex",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},"1d10":function(t,e,i){"use strict";var r=i("23e7"),n=i("dd2f").some;r({target:"AsyncIterator",proto:!0,real:!0},{some:function(t){return n(this,t)}})},"1d1c":function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("37e8").f;r({target:"Object",stat:!0,forced:Object.defineProperties!==s,sham:!n},{defineProperties:s})},"1d2b":function(t,e,i){"use strict";t.exports=function(t,e){return function(){for(var i=new Array(arguments.length),r=0;r=51||!r((function(){var e=[],i=e.constructor={};return i[a]=function(){return{foo:1}},1!==e[t](Boolean).foo}))}},"1e25":function(t,e,i){"use strict";i("cad8");var r=i("23e7"),n=i("cb4c");r({target:"String",proto:!0,name:"trimEnd",forced:"".trimEnd!==n},{trimEnd:n})},"1e5a":function(t,e,i){"use strict";var r=i("23e7"),n=i("9961"),s=i("dad2");r({target:"Set",proto:!0,real:!0,forced:!s("symmetricDifference")},{symmetricDifference:n})},"1e70":function(t,e,i){"use strict";var r=i("23e7"),n=i("a5f7"),s=i("dad2"),a=!s("difference",(function(t){return 0===t.size}));r({target:"Set",proto:!0,real:!0,forced:a},{difference:n})},"1ebf":function(t,e,i){"use strict";var r=TypeError;t.exports=function(t){if("number"==typeof t)return t;throw new r("Argument is not a number")}},"1ec1":function(t,e,i){"use strict";var r=Math.log;t.exports=Math.log1p||function(t){var e=+t;return e>-1e-8&&e<1e-8?e-e*e/2:r(1+e)}},"1f68":function(t,e,i){"use strict";var r=i("83ab"),n=i("edd0"),s=i("861d"),a=i("1787"),o=i("7b0b"),h=i("1d80"),c=Object.getPrototypeOf,u=Object.setPrototypeOf,l=Object.prototype,d="__proto__";if(r&&c&&u&&!(d in l))try{n(l,d,{configurable:!0,get:function(){return c(o(this))},set:function(t){var e=h(this);a(t)&&s(e)&&u(e,t)}})}catch(f){}},"1fab":function(t,e){var i=Array.prototype.slice,r=function(t){this._$handlers={},this._$eventProcessor=t};function n(t,e){var i=t._$eventProcessor;return null!=e&&i&&i.normalizeQuery&&(e=i.normalizeQuery(e)),e}function s(t,e,i,r,s,a){var o=t._$handlers;if("function"===typeof i&&(s=r,r=i,i=null),!r||!e)return t;i=n(t,i),o[e]||(o[e]=[]);for(var h=0;h3&&(n=i.call(n,1));for(var a=e.length,o=0;o4&&(n=i.call(n,1,n.length-1));for(var a=n[n.length-1],o=e.length,h=0;h0)throw new Error("Invalid string. Length must be a multiple of 4");var i=t.indexOf("=");-1===i&&(i=e);var r=i===e?0:4-i%4;return[i,r]}function u(t){var e=c(t),i=e[0],r=e[1];return 3*(i+r)/4-r}function l(t,e,i){return 3*(e+i)/4-i}function d(t){var e,i,r=c(t),a=r[0],o=r[1],h=new s(l(t,a,o)),u=0,d=o>0?a-4:a;for(i=0;i>16&255,h[u++]=e>>8&255,h[u++]=255&e;return 2===o&&(e=n[t.charCodeAt(i)]<<2|n[t.charCodeAt(i+1)]>>4,h[u++]=255&e),1===o&&(e=n[t.charCodeAt(i)]<<10|n[t.charCodeAt(i+1)]<<4|n[t.charCodeAt(i+2)]>>2,h[u++]=e>>8&255,h[u++]=255&e),h}function f(t){return r[t>>18&63]+r[t>>12&63]+r[t>>6&63]+r[63&t]}function p(t,e,i){for(var r,n=[],s=e;sh?h:o+a));return 1===n?(e=t[i-1],s.push(r[e>>2]+r[e<<4&63]+"==")):2===n&&(e=(t[i-2]<<8)+t[i-1],s.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"=")),s.join("")}n["-".charCodeAt(0)]=62,n["_".charCodeAt(0)]=63},"1fe2":function(t,e,i){"use strict";i("7276")},2005:function(t,e,i){"use strict";var r=i("75bd"),n=TypeError;t.exports=function(t){if(r(t))throw new n("ArrayBuffer is detached");return t}},20059:function(t,e,i){"use strict";var r=i("d066"),n=i("e330"),s=r("Symbol"),a=s.keyFor,o=n(s.prototype.valueOf);t.exports=s.isRegisteredSymbol||function(t){try{return void 0!==a(o(t))}catch(e){return!1}}},"20a2":function(t,e,i){(function(t){!function(e){var i,r="undefined",n=r!==typeof t&&t,s=r!==typeof Uint8Array&&Uint8Array,a=r!==typeof ArrayBuffer&&ArrayBuffer,o=[0,0,0,0,0,0,0,0],h=Array.isArray||S,c=4294967296,u=16777216;function l(t,h,l){var S=h?0:4,w=h?4:0,E=h?0:3,x=h?1:2,A=h?2:1,C=h?3:0,R=h?y:_,P=h?b:T,I=O.prototype,k="is"+t,D="_"+k;return I.buffer=void 0,I.offset=0,I[D]=!0,I.toNumber=L,I.toString=U,I.toJSON=L,I.toArray=d,n&&(I.toBuffer=f),s&&(I.toArrayBuffer=p),O[k]=M,e[t]=O,O;function O(t,e,i,r){return this instanceof O?N(this,t,e,i,r):new O(t,e,i,r)}function M(t){return!(!t||!t[D])}function N(t,e,n,h,c){if(s&&a&&(e instanceof a&&(e=new s(e)),h instanceof a&&(h=new s(h))),e||n||h||i){if(!g(e,n)){var u=i||Array;c=n,h=e,n=0,e=new u(8)}t.buffer=e,t.offset=n|=0,r!==typeof h&&("string"===typeof h?B(e,n,h,c||10):g(h,c)?m(e,n,h,c):"number"===typeof c?(z(e,n+S,h),z(e,n+w,c)):h>0?R(e,n,h):h<0?P(e,n,h):m(e,n,o,0))}else t.buffer=v(o,0)}function B(t,e,i,r){var n=0,s=i.length,a=0,o=0;"-"===i[0]&&n++;var h=n;while(n=0))break;o=o*r+u,a=a*r+Math.floor(o/c),o%=c}h&&(a=~a,o?o=c-o:a++),z(t,e+S,a),z(t,e+w,o)}function L(){var t=this.buffer,e=this.offset,i=F(t,e+S),r=F(t,e+w);return l||(i|=0),i?i*c+r:r}function U(t){var e=this.buffer,i=this.offset,r=F(e,i+S),n=F(e,i+w),s="",a=!l&&2147483648&r;a&&(r=~r,n=c-n),t=t||10;while(1){var o=r%t*c+n;if(r=Math.floor(r/t),n=Math.floor(o/t),s=(o%t).toString(t)+s,!r&&!n)break}return a&&(s="-"+s),s}function z(t,e,i){t[e+C]=255&i,i>>=8,t[e+A]=255&i,i>>=8,t[e+x]=255&i,i>>=8,t[e+E]=255&i}function F(t,e){return t[e+E]*u+(t[e+x]<<16)+(t[e+A]<<8)+t[e+C]}}function d(t){var e=this.buffer,r=this.offset;return i=null,!1!==t&&0===r&&8===e.length&&h(e)?e:v(e,r)}function f(e){var r=this.buffer,s=this.offset;if(i=n,!1!==e&&0===s&&8===r.length&&t.isBuffer(r))return r;var a=new n(8);return m(a,0,r,s),a}function p(t){var e=this.buffer,r=this.offset,n=e.buffer;if(i=s,!1!==t&&0===r&&n instanceof a&&8===n.byteLength)return n;var o=new s(8);return m(o,0,e,r),o.buffer}function g(t,e){var i=t&&t.length;return e|=0,i&&e+8<=i&&"string"!==typeof t[e]}function m(t,e,i,r){e|=0,r|=0;for(var n=0;n<8;n++)t[e++]=255&i[r++]}function v(t,e){return Array.prototype.slice.call(t,e,e+8)}function y(t,e,i){var r=e+8;while(r>e)t[--r]=255&i,i/=256}function b(t,e,i){var r=e+8;i++;while(r>e)t[--r]=255&-i^255,i/=256}function _(t,e,i){var r=e+8;while(ethis._ux||b(e-this._yi)>this._uy||this._len<5;return this.addData(c.L,t,e),this._ctx&&i&&(this._needsDash()?this._dashedLineTo(t,e):this._ctx.lineTo(t,e)),i&&(this._xi=t,this._yi=e),this},bezierCurveTo:function(t,e,i,r,n,s){return this.addData(c.C,t,e,i,r,n,s),this._ctx&&(this._needsDash()?this._dashedBezierTo(t,e,i,r,n,s):this._ctx.bezierCurveTo(t,e,i,r,n,s)),this._xi=n,this._yi=s,this},quadraticCurveTo:function(t,e,i,r){return this.addData(c.Q,t,e,i,r),this._ctx&&(this._needsDash()?this._dashedQuadraticTo(t,e,i,r):this._ctx.quadraticCurveTo(t,e,i,r)),this._xi=i,this._yi=r,this},arc:function(t,e,i,r,n,s){return this.addData(c.A,t,e,i,i,r,n-r,0,s?0:1),this._ctx&&this._ctx.arc(t,e,i,r,n,s),this._xi=m(n)*i+t,this._yi=v(n)*i+e,this},arcTo:function(t,e,i,r,n){return this._ctx&&this._ctx.arcTo(t,e,i,r,n),this},rect:function(t,e,i,r){return this._ctx&&this._ctx.rect(t,e,i,r),this.addData(c.R,t,e,i,r),this},closePath:function(){this.addData(c.Z);var t=this._ctx,e=this._x0,i=this._y0;return t&&(this._needsDash()&&this._dashedLineTo(e,i),t.closePath()),this._xi=e,this._yi=i,this},fill:function(t){t&&t.fill(),this.toStatic()},stroke:function(t){t&&t.stroke(),this.toStatic()},setLineDash:function(t){if(t instanceof Array){this._lineDash=t,this._dashIdx=0;for(var e=0,i=0;ie.length&&(this._expandData(),e=this.data);for(var i=0;i0&&f<=t||u<0&&f>=t||0===u&&(l>0&&m<=e||l<0&&m>=e))r=this._dashIdx,i=a[r],f+=u*i,m+=l*i,this._dashIdx=(r+1)%v,u>0&&fh||l>0&&mc||o[r%2?"moveTo":"lineTo"](u>=0?p(f,t):g(f,t),l>=0?p(m,e):g(m,e));u=f-t,l=m-e,this._dashOffset=-y(u*u+l*l)},_dashedBezierTo:function(t,e,i,n,s,a){var o,h,c,u,l,d=this._dashSum,f=this._dashOffset,p=this._lineDash,g=this._ctx,m=this._xi,v=this._yi,b=r.cubicAt,_=0,T=this._dashIdx,S=p.length,w=0;for(f<0&&(f=d+f),f%=d,o=0;o<1;o+=.1)h=b(m,t,i,s,o+.1)-b(m,t,i,s,o),c=b(v,e,n,a,o+.1)-b(v,e,n,a,o),_+=y(h*h+c*c);for(;Tf)break;o=(w-f)/_;while(o<=1)u=b(m,t,i,s,o),l=b(v,e,n,a,o),T%2?g.moveTo(u,l):g.lineTo(u,l),o+=p[T]/_,T=(T+1)%S;T%2!==0&&g.lineTo(s,a),h=s-u,c=a-l,this._dashOffset=-y(h*h+c*c)},_dashedQuadraticTo:function(t,e,i,r){var n=i,s=r;i=(i+2*t)/3,r=(r+2*e)/3,t=(this._xi+2*t)/3,e=(this._yi+2*e)/3,this._dashedBezierTo(t,e,i,r,n,s)},toStatic:function(){var t=this.data;t instanceof Array&&(t.length=this._len,_&&(this.data=new Float32Array(t)))},getBoundingRect:function(){u[0]=u[1]=d[0]=d[1]=Number.MAX_VALUE,l[0]=l[1]=f[0]=f[1]=-Number.MAX_VALUE;for(var t=this.data,e=0,i=0,r=0,o=0,h=0;hh||b(a-n)>u||d===l-1)&&(t.lineTo(s,a),r=s,n=a);break;case c.C:t.bezierCurveTo(o[d++],o[d++],o[d++],o[d++],o[d++],o[d++]),r=o[d-2],n=o[d-1];break;case c.Q:t.quadraticCurveTo(o[d++],o[d++],o[d++],o[d++]),r=o[d-2],n=o[d-1];break;case c.A:var p=o[d++],g=o[d++],y=o[d++],_=o[d++],T=o[d++],S=o[d++],w=o[d++],E=o[d++],x=y>_?y:_,A=y>_?1:y/_,C=y>_?_/y:1,R=Math.abs(y-_)>.001,P=T+S;R?(t.translate(p,g),t.rotate(w),t.scale(A,C),t.arc(0,0,x,T,P,1-E),t.scale(1/A,1/C),t.rotate(-w),t.translate(-p,-g)):t.arc(p,g,x,T,P,1-E),1===d&&(e=m(T)*y+p,i=v(T)*_+g),r=m(P)*y+p,n=v(P)*_+g;break;case c.R:e=r=o[d],i=n=o[d+1],t.rect(o[d++],o[d++],o[d++],o[d++]);break;case c.Z:t.closePath(),r=e,n=i}}}},T.CMD=c;var S=T;t.exports=S},"20cc":function(t,e,i){"use strict";var r=i("cfe9"),n=i("2ba4"),s=i("1626"),a=i("8558"),o=i("b5db"),h=i("f36a"),c=i("d6d6"),u=r.Function,l=/MSIE .\./.test(o)||"BUN"===a&&function(){var t=r.Bun.version.split(".");return t.length<3||"0"===t[0]&&(t[1]<3||"3"===t[1]&&"0"===t[2])}();t.exports=function(t,e){var i=e?2:1;return l?function(r,a){var o=c(arguments.length,1)>i,l=s(r)?r:u(r),d=o?h(arguments,i):[],f=o?function(){n(l,this,d)}:l;return e?t(f,a):t(f)}:t}},"219c":function(t,e,i){"use strict";var r=i("cfe9"),n=i("4625"),s=i("d039"),a=i("59ed"),o=i("addb"),h=i("ebb5"),c=i("3f7e"),u=i("99f4"),l=i("1212"),d=i("ea83"),f=h.aTypedArray,p=h.exportTypedArrayMethod,g=r.Uint16Array,m=g&&n(g.prototype.sort),v=!!m&&!(s((function(){m(new g(2),null)}))&&s((function(){m(new g(2),{})}))),y=!!m&&!s((function(){if(l)return l<74;if(c)return c<67;if(u)return!0;if(d)return d<602;var t,e,i=new g(516),r=Array(516);for(t=0;t<516;t++)e=t%4,i[t]=515-t,r[t]=t-2*e+3;for(m(i,(function(t,e){return(t/4|0)-(e/4|0)})),t=0;t<516;t++)if(i[t]!==r[t])return!0})),b=function(t){return function(e,i){return void 0!==t?+t(e,i)||0:i!==i?-1:e!==e?1:0===e&&0===i?1/e>0&&1/i<0?1:-1:e>i}};p("sort",(function(t){return void 0!==t&&a(t),y?m(this,t):o(f(this),b(t))}),!y||v)},"21bf":function(t,e,i){(function(e){(function(e,i){t.exports=i()})(0,(function(){var t=t||function(t,r){var n;if("undefined"!==typeof window&&window.crypto&&(n=window.crypto),"undefined"!==typeof self&&self.crypto&&(n=self.crypto),"undefined"!==typeof globalThis&&globalThis.crypto&&(n=globalThis.crypto),!n&&"undefined"!==typeof window&&window.msCrypto&&(n=window.msCrypto),!n&&"undefined"!==typeof e&&e.crypto&&(n=e.crypto),!n)try{n=i(0)}catch(v){}var s=function(){if(n){if("function"===typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(v){}if("function"===typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(v){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function t(){}return function(e){var i;return t.prototype=e,i=new t,t.prototype=null,i}}(),o={},h=o.lib={},c=h.Base=function(){return{extend:function(t){var e=a(this);return t&&e.mixIn(t),e.hasOwnProperty("init")&&this.init!==e.init||(e.init=function(){e.$super.init.apply(this,arguments)}),e.init.prototype=e,e.$super=this,e},create:function(){var t=this.extend();return t.init.apply(t,arguments),t},init:function(){},mixIn:function(t){for(var e in t)t.hasOwnProperty(e)&&(this[e]=t[e]);t.hasOwnProperty("toString")&&(this.toString=t.toString)},clone:function(){return this.init.prototype.extend(this)}}}(),u=h.WordArray=c.extend({init:function(t,e){t=this.words=t||[],this.sigBytes=e!=r?e:4*t.length},toString:function(t){return(t||d).stringify(this)},concat:function(t){var e=this.words,i=t.words,r=this.sigBytes,n=t.sigBytes;if(this.clamp(),r%4)for(var s=0;s>>2]>>>24-s%4*8&255;e[r+s>>>2]|=a<<24-(r+s)%4*8}else for(var o=0;o>>2]=i[o>>>2];return this.sigBytes+=n,this},clamp:function(){var e=this.words,i=this.sigBytes;e[i>>>2]&=4294967295<<32-i%4*8,e.length=t.ceil(i/4)},clone:function(){var t=c.clone.call(this);return t.words=this.words.slice(0),t},random:function(t){for(var e=[],i=0;i>>2]>>>24-n%4*8&255;r.push((s>>>4).toString(16)),r.push((15&s).toString(16))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>3]|=parseInt(t.substr(r,2),16)<<24-r%8*4;return new u.init(i,e/2)}},f=l.Latin1={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>24-n%4*8&255;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,i=[],r=0;r>>2]|=(255&t.charCodeAt(r))<<24-r%4*8;return new u.init(i,e)}},p=l.Utf8={stringify:function(t){try{return decodeURIComponent(escape(f.stringify(t)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(t){return f.parse(unescape(encodeURIComponent(t)))}},g=h.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new u.init,this._nDataBytes=0},_append:function(t){"string"==typeof t&&(t=p.parse(t)),this._data.concat(t),this._nDataBytes+=t.sigBytes},_process:function(e){var i,r=this._data,n=r.words,s=r.sigBytes,a=this.blockSize,o=4*a,h=s/o;h=e?t.ceil(h):t.max((0|h)-this._minBufferSize,0);var c=h*a,l=t.min(4*c,s);if(c){for(var d=0;dy;y++)if(_=I(t[y]),_&&c(g,_))return _;return new p(!1)}m=u(t,v)}T=x?t.next:m.next;while(!(S=n(T,m)).done){try{_=I(S.value)}catch(k){d(m,"throw",k)}if("object"==typeof _&&_&&c(g,_))return _}return new p(!1)}},"22d1":function(t,e){var i={};i="object"===typeof wx&&"function"===typeof wx.getSystemInfoSync?{browser:{},os:{},node:!1,wxa:!0,canvasSupported:!0,svgSupported:!1,touchEventsSupported:!0,domSupported:!1}:"undefined"===typeof document&&"undefined"!==typeof self?{browser:{},os:{},node:!1,worker:!0,canvasSupported:!0,domSupported:!1}:"undefined"===typeof navigator?{browser:{},os:{},node:!0,worker:!1,canvasSupported:!0,svgSupported:!0,domSupported:!1}:n(navigator.userAgent);var r=i;function n(t){var e={},i={},r=t.match(/Firefox\/([\d.]+)/),n=t.match(/MSIE\s([\d.]+)/)||t.match(/Trident\/.+?rv:(([\d.]+))/),s=t.match(/Edge\/([\d.]+)/),a=/micromessenger/i.test(t);return r&&(i.firefox=!0,i.version=r[1]),n&&(i.ie=!0,i.version=n[1]),s&&(i.edge=!0,i.version=s[1]),a&&(i.weChat=!0),{browser:i,os:e,node:!1,canvasSupported:!!document.createElement("canvas").getContext,svgSupported:"undefined"!==typeof SVGRect,touchEventsSupported:"ontouchstart"in window&&!i.ie&&!i.edge,pointerEventsSupported:"onpointerdown"in window&&(i.edge||i.ie&&i.version>=11),domSupported:"undefined"!==typeof document}}t.exports=r},"22e5":function(t,e,i){"use strict";i("8b00")},2315:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("strike")},{strike:function(){return n(this,"strike","","")}})},2351:function(t,e,i){"use strict";var r=i("e065");r("split")},2382:function(t,e,i){"use strict";i("910d")},"23cb":function(t,e,i){"use strict";var r=i("5926"),n=Math.max,s=Math.min;t.exports=function(t,e){var i=r(t);return i<0?n(i+e,0):s(i,e)}},"23dc":function(t,e,i){"use strict";var r=i("d44e");r(Math,"Math",!0)},"23e7":function(t,e,i){"use strict";var r=i("cfe9"),n=i("06cf").f,s=i("9112"),a=i("cb2d"),o=i("6374"),h=i("e893"),c=i("94ca");t.exports=function(t,e){var i,u,l,d,f,p,g=t.target,m=t.global,v=t.stat;if(u=m?r:v?r[g]||o(g,{}):r[g]&&r[g].prototype,u)for(l in e){if(f=e[l],t.dontCallGetSet?(p=n(u,l),d=p&&p.value):d=u[l],i=c(m?l:g+(v?".":"#")+l,t.forced),!i&&void 0!==d){if(typeof f==typeof d)continue;h(f,d)}(t.sham||d&&d.sham)&&s(f,"sham",!0),a(u,l,f,t)}}},"241c":function(t,e,i){"use strict";var r=i("ca84"),n=i("7839"),s=n.concat("length","prototype");e.f=Object.getOwnPropertyNames||function(t){return r(t,s)}},2444:function(t,e,i){"use strict";(function(e){var r=i("c532"),n=i("c8af"),s=i("387f"),a={"Content-Type":"application/x-www-form-urlencoded"};function o(t,e){!r.isUndefined(t)&&r.isUndefined(t["Content-Type"])&&(t["Content-Type"]=e)}function h(){var t;return("undefined"!==typeof XMLHttpRequest||"undefined"!==typeof e&&"[object process]"===Object.prototype.toString.call(e))&&(t=i("b50d")),t}function c(t,e,i){if(r.isString(t))try{return(e||JSON.parse)(t),r.trim(t)}catch(n){if("SyntaxError"!==n.name)throw n}return(i||JSON.stringify)(t)}var u={transitional:{silentJSONParsing:!0,forcedJSONParsing:!0,clarifyTimeoutError:!1},adapter:h(),transformRequest:[function(t,e){return n(e,"Accept"),n(e,"Content-Type"),r.isFormData(t)||r.isArrayBuffer(t)||r.isBuffer(t)||r.isStream(t)||r.isFile(t)||r.isBlob(t)?t:r.isArrayBufferView(t)?t.buffer:r.isURLSearchParams(t)?(o(e,"application/x-www-form-urlencoded;charset=utf-8"),t.toString()):r.isObject(t)||e&&"application/json"===e["Content-Type"]?(o(e,"application/json"),c(t)):t}],transformResponse:[function(t){var e=this.transitional||u.transitional,i=e&&e.silentJSONParsing,n=e&&e.forcedJSONParsing,a=!i&&"json"===this.responseType;if(a||n&&r.isString(t)&&t.length)try{return JSON.parse(t)}catch(o){if(a){if("SyntaxError"===o.name)throw s(o,this,"E_JSON_PARSE");throw o}}return t}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,maxBodyLength:-1,validateStatus:function(t){return t>=200&&t<300},headers:{common:{Accept:"application/json, text/plain, */*"}}};r.forEach(["delete","get","head"],(function(t){u.headers[t]={}})),r.forEach(["post","put","patch"],(function(t){u.headers[t]=r.merge(a)})),t.exports=u}).call(this,i("4362"))},"249d":function(t,e,i){"use strict";var r=i("23e7"),n=i("41f6");n&&r({target:"ArrayBuffer",proto:!0},{transfer:function(){return n(this,arguments.length?arguments[0]:void 0,!0)}})},2532:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("5a34"),a=i("1d80"),o=i("577e"),h=i("ab13"),c=n("".indexOf);r({target:"String",proto:!0,forced:!h("includes")},{includes:function(t){return!!~c(o(a(this)),o(s(t)),arguments.length>1?arguments[1]:void 0)}})},"25a1":function(t,e,i){"use strict";var r=i("ebb5"),n=i("d58f").right,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("reduceRight",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},"25eb":function(t,e,i){"use strict";var r=i("23e7"),n=i("c20d");r({target:"Number",stat:!0,forced:Number.parseInt!==n},{parseInt:n})},"25f0":function(t,e,i){"use strict";var r=i("5e77").PROPER,n=i("cb2d"),s=i("825a"),a=i("577e"),o=i("d039"),h=i("90d8"),c="toString",u=RegExp.prototype,l=u[c],d=o((function(){return"/a/b"!==l.call({source:"a",flags:"b"})})),f=r&&l.name!==c;(d||f)&&n(u,c,(function(){var t=s(this),e=a(t.source),i=a(h(t));return"/"+e+"/"+i}),{unsafe:!0})},2626:function(t,e,i){"use strict";var r=i("d066"),n=i("edd0"),s=i("b622"),a=i("83ab"),o=s("species");t.exports=function(t){var e=r(t);a&&e&&!e[o]&&n(e,o,{configurable:!0,get:function(){return this}})}},"26ad":function(t,e,i){"use strict";var r=i("23e7"),n=i("dd2f").forEach;r({target:"AsyncIterator",proto:!0,real:!0},{forEach:function(t){return n(this,t)}})},"26e9":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("e8b5"),a=n([].reverse),o=[1,2];r({target:"Array",proto:!0,forced:String(o)===String(o.reverse())},{reverse:function(){return s(this)&&(this.length=this.length),a(this)}})},2705:function(t,e,i){"use strict";var r=i("23e7"),n=i("59ed"),s=i("dc19"),a=i("384f"),o=TypeError;r({target:"Set",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),i=arguments.length<2,r=i?void 0:arguments[1];if(n(t),a(e,(function(n){i?(i=!1,r=n):r=t(r,n,n,e)})),i)throw new o("Reduce of empty set with no initial value");return r}})},"271a":function(t,e,i){"use strict";var r=i("cb2d"),n=i("e330"),s=i("577e"),a=i("d6d6"),o=URLSearchParams,h=o.prototype,c=n(h.getAll),u=n(h.has),l=new o("a=1");!l.has("a",2)&&l.has("a",void 0)||r(h,"has",(function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return u(this,t);var r=c(this,t);a(e,1);var n=s(i),o=0;while(on)c[n]=i[n++];return c}),c)},"2a07":function(t,e,i){"use strict";var r=i("cfe9"),n=i("9adc");t.exports=function(t){if(n){try{return r.process.getBuiltinModule(t)}catch(e){}try{return Function('return require("'+t+'")')()}catch(e){}}}},"2a1b":function(t,e,i){"use strict";var r=i("e065");r("match")},"2a62":function(t,e,i){"use strict";var r=i("c65b"),n=i("825a"),s=i("dc4a");t.exports=function(t,e,i){var a,o;n(t);try{if(a=s(t,"return"),!a){if("throw"===e)throw i;return i}a=r(a,t)}catch(h){o=!0,a=h}if("throw"===e)throw i;if(o)throw a;return n(a),i}},"2a66":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.pad.ZeroPadding={pad:function(t,e){var i=4*e;t.clamp(),t.sigBytes+=i-(t.sigBytes%i||i)},unpad:function(t){var e=t.words,i=t.sigBytes-1;for(i=t.sigBytes-1;i>=0;i--)if(e[i>>>2]>>>24-i%4*8&255){t.sigBytes=i+1;break}}},t.pad.ZeroPadding}))},"2abc":function(t,e,i){"use strict";var r=i("23e7"),n=180/Math.PI;r({target:"Math",stat:!0,forced:!0},{degrees:function(t){return t*n}})},"2af1":function(t,e,i){"use strict";var r=i("23e7"),n=i("f748");r({target:"Math",stat:!0},{sign:n})},"2b19":function(t,e,i){"use strict";var r=i("23e7"),n=i("129f");r({target:"Object",stat:!0},{is:n})},"2b3d":function(t,e,i){"use strict";i("4002")},"2b61":function(t,e,i){var r=i("7d6d"),n=i("82eb"),s=n.ContextCachedBy,a=[["shadowBlur",0],["shadowOffsetX",0],["shadowOffsetY",0],["shadowColor","#000"],["lineCap","butt"],["lineJoin","miter"],["miterLimit",10]],o=function(t){this.extendFrom(t,!1)};function h(t,e,i){var r=null==e.x?0:e.x,n=null==e.x2?1:e.x2,s=null==e.y?0:e.y,a=null==e.y2?0:e.y2;e.global||(r=r*i.width+i.x,n=n*i.width+i.x,s=s*i.height+i.y,a=a*i.height+i.y),r=isNaN(r)?0:r,n=isNaN(n)?1:n,s=isNaN(s)?0:s,a=isNaN(a)?0:a;var o=t.createLinearGradient(r,s,n,a);return o}function c(t,e,i){var r=i.width,n=i.height,s=Math.min(r,n),a=null==e.x?.5:e.x,o=null==e.y?.5:e.y,h=null==e.r?.5:e.r;e.global||(a=a*r+i.x,o=o*n+i.y,h*=s);var c=t.createRadialGradient(a,o,0,a,o,h);return c}o.prototype={constructor:o,fill:"#000",stroke:null,opacity:1,fillOpacity:null,strokeOpacity:null,lineDash:null,lineDashOffset:0,shadowBlur:0,shadowOffsetX:0,shadowOffsetY:0,lineWidth:1,strokeNoScale:!1,text:null,font:null,textFont:null,fontStyle:null,fontWeight:null,fontSize:null,fontFamily:null,textTag:null,textFill:"#000",textStroke:null,textWidth:null,textHeight:null,textStrokeWidth:0,textLineHeight:null,textPosition:"inside",textRect:null,textOffset:null,textAlign:null,textVerticalAlign:null,textDistance:5,textShadowColor:"transparent",textShadowBlur:0,textShadowOffsetX:0,textShadowOffsetY:0,textBoxShadowColor:"transparent",textBoxShadowBlur:0,textBoxShadowOffsetX:0,textBoxShadowOffsetY:0,transformText:!1,textRotation:0,textOrigin:null,textBackgroundColor:null,textBorderColor:null,textBorderWidth:0,textBorderRadius:0,textPadding:null,rich:null,truncate:null,blend:null,bind:function(t,e,i){var n=this,o=i&&i.style,h=!o||t.__attrCachedBy!==s.STYLE_BIND;t.__attrCachedBy=s.STYLE_BIND;for(var c=0;c0},extendFrom:function(t,e){if(t)for(var i in t)!t.hasOwnProperty(i)||!0!==e&&(!1===e?this.hasOwnProperty(i):null==t[i])||(this[i]=t[i])},set:function(t,e){"string"===typeof t?this[t]=e:this.extendFrom(t,!0)},clone:function(){var t=new this.constructor;return t.extendFrom(this,!0),t},getGradient:function(t,e,i){for(var r="radial"===e.type?c:h,n=r(t,e,i),s=e.colorStops,a=0;a1?arguments[1]:void 0,e.length)),r=o(t);return d(e,i,i+r.length)===r}})},"2ca8":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("20cc"),a=s(n.setInterval,!0);r({global:!0,bind:!0,forced:n.setInterval!==a},{setInterval:a})},"2cf4":function(t,e){var i=1;"undefined"!==typeof window&&(i=Math.max(window.devicePixelRatio||1,1));var r=0,n=i;e.debugMode=r,e.devicePixelRatio=n},"2cf49":function(t,e,i){"use strict";var r,n,s,a,o=i("cfe9"),h=i("2ba4"),c=i("0366"),u=i("1626"),l=i("1a2d"),d=i("d039"),f=i("1be4"),p=i("f36a"),g=i("cc12"),m=i("d6d6"),v=i("52c8"),y=i("9adc"),b=o.setImmediate,_=o.clearImmediate,T=o.process,S=o.Dispatch,w=o.Function,E=o.MessageChannel,x=o.String,A=0,C={},R="onreadystatechange";d((function(){r=o.location}));var P=function(t){if(l(C,t)){var e=C[t];delete C[t],e()}},I=function(t){return function(){P(t)}},k=function(t){P(t.data)},D=function(t){o.postMessage(x(t),r.protocol+"//"+r.host)};b&&_||(b=function(t){m(arguments.length,1);var e=u(t)?t:w(t),i=p(arguments,1);return C[++A]=function(){h(e,void 0,i)},n(A),A},_=function(t){delete C[t]},y?n=function(t){T.nextTick(I(t))}:S&&S.now?n=function(t){S.now(I(t))}:E&&!v?(s=new E,a=s.port2,s.port1.onmessage=k,n=c(a.postMessage,a)):o.addEventListener&&u(o.postMessage)&&!o.importScripts&&r&&"file:"!==r.protocol&&!d(D)?(n=D,o.addEventListener("message",k,!1)):n=R in g("script")?function(t){f.appendChild(g("script"))[R]=function(){f.removeChild(this),P(t)}}:function(t){setTimeout(I(t),0)}),t.exports={set:b,clear:_}},"2d83":function(t,e,i){"use strict";var r=i("387f");t.exports=function(t,e,i,n,s){var a=new Error(t);return r(a,e,i,n,s)}},"2e67":function(t,e,i){"use strict";t.exports=function(t){return!(!t||!t.__CANCEL__)}},3041:function(t,e,i){var r=i("e1fc"),n=i("0da8"),s=i("76a5"),a=i("d9fc"),o=i("c7a2"),h=i("ae69"),c=i("cb11"),u=i("cbe5"),l=i("87b1"),d=i("d498"),f=i("48a9"),p=i("2b61"),g=i("1687"),m=i("342d"),v=m.createFromString,y=i("6d8b"),b=y.isString,_=y.extend,T=y.defaults,S=y.trim,w=y.each,E=/[\s,]+/;function x(t){if(b(t)){var e=new DOMParser;t=e.parseFromString(t,"text/xml")}9===t.nodeType&&(t=t.firstChild);while("svg"!==t.nodeName.toLowerCase()||1!==t.nodeType)t=t.nextSibling;return t}function A(){this._defs={},this._root=null,this._isDefine=!1,this._isText=!1}A.prototype.parse=function(t,e){e=e||{};var i=x(t);if(!i)throw new Error("Illegal svg");var n=new r;this._root=n;var s=i.getAttribute("viewBox")||"",a=parseFloat(i.getAttribute("width")||e.width),h=parseFloat(i.getAttribute("height")||e.height);isNaN(a)&&(a=null),isNaN(h)&&(h=null),O(i,n,null,!0);var c,u,l=i.firstChild;while(l)this._parseNode(l,n),l=l.nextSibling;if(s){var d=S(s).split(E);d.length>=4&&(c={x:parseFloat(d[0]||0),y:parseFloat(d[1]||0),width:parseFloat(d[2]),height:parseFloat(d[3])})}if(c&&null!=a&&null!=h&&(u=F(c,a,h),!e.ignoreViewBox)){var f=n;n=new r,n.add(f),f.scale=u.scale.slice(),f.position=u.position.slice()}return e.ignoreRootClip||null==a||null==h||n.setClipPath(new o({shape:{x:0,y:0,width:a,height:h}})),{root:n,width:a,height:h,viewBoxRect:c,viewBoxTransform:u}},A.prototype._parseNode=function(t,e){var i,r=t.nodeName.toLowerCase();if("defs"===r?this._isDefine=!0:"text"===r&&(this._isText=!0),this._isDefine){var n=R[r];if(n){var s=n.call(this,t),a=t.getAttribute("id");a&&(this._defs[a]=s)}}else{n=C[r];n&&(i=n.call(this,t,e),e.add(i))}var o=t.firstChild;while(o)1===o.nodeType&&this._parseNode(o,i),3===o.nodeType&&this._isText&&this._parseText(o,i),o=o.nextSibling;"defs"===r?this._isDefine=!1:"text"===r&&(this._isText=!1)},A.prototype._parseText=function(t,e){if(1===t.nodeType){var i=t.getAttribute("dx")||0,r=t.getAttribute("dy")||0;this._textX+=parseFloat(i),this._textY+=parseFloat(r)}var n=new s({style:{text:t.textContent,transformText:!0},position:[this._textX||0,this._textY||0]});I(e,n),O(t,n,this._defs);var a=n.style.fontSize;a&&a<9&&(n.style.fontSize=9,n.scale=n.scale||[1,1],n.scale[0]*=a/9,n.scale[1]*=a/9);var o=n.getBoundingRect();return this._textX+=o.width,e.add(n),n};var C={g:function(t,e){var i=new r;return I(e,i),O(t,i,this._defs),i},rect:function(t,e){var i=new o;return I(e,i),O(t,i,this._defs),i.setShape({x:parseFloat(t.getAttribute("x")||0),y:parseFloat(t.getAttribute("y")||0),width:parseFloat(t.getAttribute("width")||0),height:parseFloat(t.getAttribute("height")||0)}),i},circle:function(t,e){var i=new a;return I(e,i),O(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),r:parseFloat(t.getAttribute("r")||0)}),i},line:function(t,e){var i=new c;return I(e,i),O(t,i,this._defs),i.setShape({x1:parseFloat(t.getAttribute("x1")||0),y1:parseFloat(t.getAttribute("y1")||0),x2:parseFloat(t.getAttribute("x2")||0),y2:parseFloat(t.getAttribute("y2")||0)}),i},ellipse:function(t,e){var i=new h;return I(e,i),O(t,i,this._defs),i.setShape({cx:parseFloat(t.getAttribute("cx")||0),cy:parseFloat(t.getAttribute("cy")||0),rx:parseFloat(t.getAttribute("rx")||0),ry:parseFloat(t.getAttribute("ry")||0)}),i},polygon:function(t,e){var i=t.getAttribute("points");i&&(i=k(i));var r=new l({shape:{points:i||[]}});return I(e,r),O(t,r,this._defs),r},polyline:function(t,e){var i=new u;I(e,i),O(t,i,this._defs);var r=t.getAttribute("points");r&&(r=k(r));var n=new d({shape:{points:r||[]}});return n},image:function(t,e){var i=new n;return I(e,i),O(t,i,this._defs),i.setStyle({image:t.getAttribute("xlink:href"),x:t.getAttribute("x"),y:t.getAttribute("y"),width:t.getAttribute("width"),height:t.getAttribute("height")}),i},text:function(t,e){var i=t.getAttribute("x")||0,n=t.getAttribute("y")||0,s=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0;this._textX=parseFloat(i)+parseFloat(s),this._textY=parseFloat(n)+parseFloat(a);var o=new r;return I(e,o),O(t,o,this._defs),o},tspan:function(t,e){var i=t.getAttribute("x"),n=t.getAttribute("y");null!=i&&(this._textX=parseFloat(i)),null!=n&&(this._textY=parseFloat(n));var s=t.getAttribute("dx")||0,a=t.getAttribute("dy")||0,o=new r;return I(e,o),O(t,o,this._defs),this._textX+=s,this._textY+=a,o},path:function(t,e){var i=t.getAttribute("d")||"",r=v(i);return I(e,r),O(t,r,this._defs),r}},R={lineargradient:function(t){var e=parseInt(t.getAttribute("x1")||0,10),i=parseInt(t.getAttribute("y1")||0,10),r=parseInt(t.getAttribute("x2")||10,10),n=parseInt(t.getAttribute("y2")||0,10),s=new f(e,i,r,n);return P(t,s),s},radialgradient:function(t){}};function P(t,e){var i=t.firstChild;while(i){if(1===i.nodeType){var r=i.getAttribute("offset");r=r.indexOf("%")>0?parseInt(r,10)/100:r?parseFloat(r):0;var n=i.getAttribute("stop-color")||"#000000";e.addColorStop(r,n)}i=i.nextSibling}}function I(t,e){t&&t.__inheritedStyle&&(e.__inheritedStyle||(e.__inheritedStyle={}),T(e.__inheritedStyle,t.__inheritedStyle))}function k(t){for(var e=S(t).split(E),i=[],r=0;r0;s-=2){var a=n[s],o=n[s-1];switch(r=r||g.create(),o){case"translate":a=S(a).split(E),g.translate(r,r,[parseFloat(a[0]),parseFloat(a[1]||0)]);break;case"scale":a=S(a).split(E),g.scale(r,r,[parseFloat(a[0]),parseFloat(a[1]||a[0])]);break;case"rotate":a=S(a).split(E),g.rotate(r,r,parseFloat(a[0]));break;case"skew":a=S(a).split(E),console.warn("Skew transform is not supported yet");break;case"matrix":a=S(a).split(E);r[0]=parseFloat(a[0]),r[1]=parseFloat(a[1]),r[2]=parseFloat(a[2]),r[3]=parseFloat(a[3]),r[4]=parseFloat(a[4]),r[5]=parseFloat(a[5]);break}}e.setLocalTransform(r)}}var U=/([^\s:;]+)\s*:\s*([^:;]+)/g;function z(t){var e=t.getAttribute("style"),i={};if(!e)return i;var r,n={};U.lastIndex=0;while(null!=(r=U.exec(e)))n[r[1]]=r[2];for(var s in D)D.hasOwnProperty(s)&&null!=n[s]&&(i[D[s]]=n[s]);return i}function F(t,e,i){var r=e/t.width,n=i/t.height,s=Math.min(r,n),a=[s,s],o=[-(t.x+t.width/2)*s+e/2,-(t.y+t.height/2)*s+i/2];return{scale:a,position:o}}function W(t,e){var i=new A;return i.parse(t,e)}e.parseXML=x,e.makeViewBoxTransform=F,e.parseSVG=W},"30a3":function(t,e,i){var r=i("6d8b"),n=i("607d"),s=n.Dispatcher,a=i("98b7"),o=i("06ad"),h=function(t){t=t||{},this.stage=t.stage||{},this.onframe=t.onframe||function(){},this._clips=[],this._running=!1,this._time,this._pausedTime,this._pauseStart,this._paused=!1,s.call(this)};h.prototype={constructor:h,addClip:function(t){this._clips.push(t)},addAnimator:function(t){t.animation=this;for(var e=t.getClips(),i=0;i=0&&this._clips.splice(e,1)},removeAnimator:function(t){for(var e=t.getClips(),i=0;i1?arguments[1]:void 0,complete:e>2?arguments[2]:void 0}:d(t)?t:{},A(this).subscriber)}}),p(O,_,(function(){return this})),r({global:!0,constructor:!0,forced:!0},{Observable:D}),a(T)},"313d":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("d066"),a=i("e330"),o=i("c65b"),h=i("d039"),c=i("577e"),u=i("d6d6"),l=i("b917").i2c,d=s("btoa"),f=a("".charAt),p=a("".charCodeAt),g=!!d&&!h((function(){return"aGk="!==d("hi")})),m=g&&!h((function(){d()})),v=g&&h((function(){return"bnVsbA=="!==d(null)})),y=g&&1!==d.length;r({global:!0,bind:!0,enumerable:!0,forced:!g||m||v||y},{btoa:function(t){if(u(arguments.length,1),g)return o(d,n,c(t));var e,i,r=c(t),a="",h=0,m=l;while(f(r,h)||(m="=",h%1)){if(i=p(r,h+=3/4),i>255)throw new(s("DOMException"))("The string contains characters outside of the Latin1 range","InvalidCharacterError");e=e<<8|i,a+=f(m,63&e>>8-h%1*8)}return a}})},3252:function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(e){var i=t,r=i.lib,n=r.Base,s=r.WordArray,a=i.x64={};a.Word=n.extend({init:function(t,e){this.high=t,this.low=e}}),a.WordArray=n.extend({init:function(t,i){t=this.words=t||[],this.sigBytes=i!=e?i:8*t.length},toX32:function(){for(var t=this.words,e=t.length,i=[],r=0;r1?[t,arguments[1]]:[t])}))},3393:function(t,e,i){"use strict";var r=i("23e7"),n=i("fd81");r({target:"Number",stat:!0,forced:!0},{range:function(t,e,i){return new n(t,e,i,"number",0,1)}})},"33d1":function(t,e,i){"use strict";var r=i("23e7"),n=i("7b0b"),s=i("07fa"),a=i("5926"),o=i("44d2");r({target:"Array",proto:!0},{at:function(t){var e=n(this),i=s(e),r=a(t),o=r>=0?r:i+r;return o<0||o>=i?void 0:e[o]}}),o("at")},3410:function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("7b0b"),a=i("e163"),o=i("e177"),h=n((function(){a(1)}));r({target:"Object",stat:!0,forced:h,sham:!o},{getPrototypeOf:function(t){return a(s(t))}})},"342d":function(t,e,i){var r=i("cbe5"),n=i("20c8"),s=i("ee84"),a=Math.sqrt,o=Math.sin,h=Math.cos,c=Math.PI,u=function(t){return Math.sqrt(t[0]*t[0]+t[1]*t[1])},l=function(t,e){return(t[0]*e[0]+t[1]*e[1])/(u(t)*u(e))},d=function(t,e){return(t[0]*e[1]1&&(u*=a(_),f*=a(_));var T=(n===s?-1:1)*a((u*u*(f*f)-u*u*(b*b)-f*f*(y*y))/(u*u*(b*b)+f*f*(y*y)))||0,S=T*u*b/f,w=T*-f*y/u,E=(t+i)/2+h(v)*S-o(v)*w,x=(e+r)/2+o(v)*S+h(v)*w,A=d([1,0],[(y-S)/u,(b-w)/f]),C=[(y-S)/u,(b-w)/f],R=[(-1*y-S)/u,(-1*b-w)/f],P=d(C,R);l(C,R)<=-1&&(P=c),l(C,R)>=1&&(P=0),0===s&&P>0&&(P-=2*c),1===s&&P<0&&(P+=2*c),m.addData(g,E,x,u,f,A,P,v,s)}var p=/([mlvhzcqtsa])([^mlvhzcqtsa]*)/gi,g=/-?([0-9]*\.)?[0-9]+([eE]-?[0-9]+)?/g;function m(t){if(!t)return new n;for(var e,i=0,r=0,s=i,a=r,o=new n,h=n.CMD,c=t.match(p),u=0;u1?arguments[1]:void 0)}}),s("filterReject")},"34e1":function(t,e,i){"use strict";var r=i("c65b"),n=i("825a"),s=i("46c4"),a=i("35a1");t.exports=function(t,e){e&&"string"===typeof t||n(t);var i=a(t);return s(n(void 0!==i?r(i,t):t))}},3511:function(t,e,i){"use strict";var r=TypeError,n=9007199254740991;t.exports=function(t){if(t>n)throw r("Maximum allowed index exceeded");return t}},3529:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("f069"),o=i("e667"),h=i("2266"),c=i("5eed");r({target:"Promise",stat:!0,forced:c},{race:function(t){var e=this,i=a.f(e),r=i.reject,c=o((function(){var a=s(e.resolve);h(t,(function(t){n(a,e,t).then(i.resolve,r)}))}));return c.error&&r(c.value),i.promise}})},"355d":function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("e285"),a=i("dcc3"),o=i("4754"),h=i("69f3"),c="Seeded Random",u=c+" Generator",l='Math.seededPRNG() argument should have a "seed" field with a finite value.',d=h.set,f=h.getterFor(u),p=TypeError,g=a((function(t){d(this,{type:u,seed:t%2147483647})}),c,(function(){var t=f(this),e=t.seed=(1103515245*t.seed+12345)%2147483647;return o((1073741823&e)/1073741823,!1)}));r({target:"Math",stat:!0,forced:!0},{seededPRNG:function(t){var e=n(t).seed;if(!s(e))throw new p(l);return new g(e)}})},"35a1":function(t,e,i){"use strict";var r=i("f5df"),n=i("dc4a"),s=i("7234"),a=i("3f8c"),o=i("b622"),h=o("iterator");t.exports=function(t){if(!s(t))return n(t,h)||n(t,"@@iterator")||a[r(t)]}},"35b3":function(t,e,i){"use strict";var r=i("23e7");r({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{EPSILON:Math.pow(2,-52)})},"36a4":function(t,e,i){"use strict";var r=i("23e7");r({target:"Math",stat:!0,forced:!0},{isubh:function(t,e,i,r){var n=t>>>0,s=e>>>0,a=i>>>0;return s-(r>>>0)-((~n&a|~(n^a)&n-a>>>0)>>>31)|0}})},"36f2":function(t,e,i){"use strict";var r,n,s,a,o=i("cfe9"),h=i("2a07"),c=i("dbe5"),u=o.structuredClone,l=o.ArrayBuffer,d=o.MessageChannel,f=!1;if(c)f=function(t){u(t,{transfer:[t]})};else if(l)try{d||(r=h("worker_threads"),r&&(d=r.MessageChannel)),d&&(n=new d,s=new l(2),a=function(t){n.port1.postMessage(null,[t])},2===s.byteLength&&(a(s),0===s.byteLength&&(f=a)))}catch(p){}t.exports=f},"37e8":function(t,e,i){"use strict";var r=i("83ab"),n=i("aed9"),s=i("9bf2"),a=i("825a"),o=i("fc6a"),h=i("df75");e.f=r&&!n?Object.defineProperties:function(t,e){a(t);var i,r=o(e),n=h(e),c=n.length,u=0;while(c>u)s.f(t,i=n[u++],r[i]);return t}},"384f":function(t,e,i){"use strict";var r=i("e330"),n=i("5388"),s=i("cb27"),a=s.Set,o=s.proto,h=r(o.forEach),c=r(o.keys),u=c(new a).next;t.exports=function(t,e,i){return i?n({iterator:c(t),next:u},e):h(t,e)}},"385f":function(t,e,i){"use strict";var r=i("e065");r("metadataKey")},"387f":function(t,e,i){"use strict";t.exports=function(t,e,i,r,n){return t.config=e,i&&(t.code=i),t.request=r,t.response=n,t.isAxiosError=!0,t.toJSON=function(){return{message:this.message,name:this.name,description:this.description,number:this.number,fileName:this.fileName,lineNumber:this.lineNumber,columnNumber:this.columnNumber,stack:this.stack,config:this.config,code:this.code,status:this.response&&this.response.status?this.response.status:null}},t}},"38ba":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("2b79"))})(0,(function(t){t.lib.Cipher||function(e){var i=t,r=i.lib,n=r.Base,s=r.WordArray,a=r.BufferedBlockAlgorithm,o=i.enc,h=(o.Utf8,o.Base64),c=i.algo,u=c.EvpKDF,l=r.Cipher=a.extend({cfg:n.extend(),createEncryptor:function(t,e){return this.create(this._ENC_XFORM_MODE,t,e)},createDecryptor:function(t,e){return this.create(this._DEC_XFORM_MODE,t,e)},init:function(t,e,i){this.cfg=this.cfg.extend(i),this._xformMode=t,this._key=e,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(t){return this._append(t),this._process()},finalize:function(t){t&&this._append(t);var e=this._doFinalize();return e},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function t(t){return"string"==typeof t?w:_}return function(e){return{encrypt:function(i,r,n){return t(r).encrypt(e,i,r,n)},decrypt:function(i,r,n){return t(r).decrypt(e,i,r,n)}}}}()}),d=(r.StreamCipher=l.extend({_doFinalize:function(){var t=this._process(!0);return t},blockSize:1}),i.mode={}),f=r.BlockCipherMode=n.extend({createEncryptor:function(t,e){return this.Encryptor.create(t,e)},createDecryptor:function(t,e){return this.Decryptor.create(t,e)},init:function(t,e){this._cipher=t,this._iv=e}}),p=d.CBC=function(){var t=f.extend();function i(t,i,r){var n,s=this._iv;s?(n=s,this._iv=e):n=this._prevBlock;for(var a=0;a>>2];t.sigBytes-=e}},v=(r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:p,padding:m}),reset:function(){var t;l.reset.call(this);var e=this.cfg,i=e.iv,r=e.mode;this._xformMode==this._ENC_XFORM_MODE?t=r.createEncryptor:(t=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==t?this._mode.init(this,i&&i.words):(this._mode=t.call(r,this,i&&i.words),this._mode.__creator=t)},_doProcessBlock:function(t,e){this._mode.processBlock(t,e)},_doFinalize:function(){var t,e=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(e.pad(this._data,this.blockSize),t=this._process(!0)):(t=this._process(!0),e.unpad(t)),t},blockSize:4}),r.CipherParams=n.extend({init:function(t){this.mixIn(t)},toString:function(t){return(t||this.formatter).stringify(this)}})),y=i.format={},b=y.OpenSSL={stringify:function(t){var e,i=t.ciphertext,r=t.salt;return e=r?s.create([1398893684,1701076831]).concat(r).concat(i):i,e.toString(h)},parse:function(t){var e,i=h.parse(t),r=i.words;return 1398893684==r[0]&&1701076831==r[1]&&(e=s.create(r.slice(2,4)),r.splice(0,4),i.sigBytes-=16),v.create({ciphertext:i,salt:e})}},_=r.SerializableCipher=n.extend({cfg:n.extend({format:b}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var n=t.createEncryptor(i,r),s=n.finalize(e),a=n.cfg;return v.create({ciphertext:s,key:i,iv:a.iv,algorithm:t,mode:a.mode,padding:a.padding,blockSize:t.blockSize,formatter:r.format})},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var n=t.createDecryptor(i,r).finalize(e.ciphertext);return n},_parse:function(t,e){return"string"==typeof t?e.parse(t,this):t}}),T=i.kdf={},S=T.OpenSSL={execute:function(t,e,i,r,n){if(r||(r=s.random(8)),n)a=u.create({keySize:e+i,hasher:n}).compute(t,r);else var a=u.create({keySize:e+i}).compute(t,r);var o=s.create(a.words.slice(e),4*i);return a.sigBytes=4*e,v.create({key:a,iv:o,salt:r})}},w=r.PasswordBasedCipher=_.extend({cfg:_.cfg.extend({kdf:S}),encrypt:function(t,e,i,r){r=this.cfg.extend(r);var n=r.kdf.execute(i,t.keySize,t.ivSize,r.salt,r.hasher);r.iv=n.iv;var s=_.encrypt.call(this,t,e,n.key,r);return s.mixIn(n),s},decrypt:function(t,e,i,r){r=this.cfg.extend(r),e=this._parse(e,r.format);var n=r.kdf.execute(i,t.keySize,t.ivSize,e.salt,r.hasher);r.iv=n.iv;var s=_.decrypt.call(this,t,e,n.key,r);return s}})}()}))},"38cf":function(t,e,i){"use strict";var r=i("23e7"),n=i("1148");r({target:"String",proto:!0},{repeat:n})},"392f":function(t,e,i){var r=i("6d8b"),n=r.inherits,s=i("19eb"),a=i("9850");function o(t){s.call(this,t),this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.notClear=!0}o.prototype.incremental=!0,o.prototype.clearDisplaybles=function(){this._displayables=[],this._temporaryDisplayables=[],this._cursor=0,this.dirty(),this.notClear=!1},o.prototype.addDisplayable=function(t,e){e?this._temporaryDisplayables.push(t):this._displayables.push(t),this.dirty()},o.prototype.addDisplayables=function(t,e){e=e||!1;for(var i=0;i1?arguments[1]:void 0)}))},"3a9b":function(t,e,i){"use strict";var r=i("e330");t.exports=r({}.isPrototypeOf)},"3bbe":function(t,e,i){"use strict";var r=i("1787"),n=String,s=TypeError;t.exports=function(t){if(r(t))return t;throw new s("Can't set "+n(t)+" as a prototype")}},"3c5d":function(t,e,i){"use strict";var r=i("cfe9"),n=i("c65b"),s=i("ebb5"),a=i("07fa"),o=i("182d"),h=i("7b0b"),c=i("d039"),u=r.RangeError,l=r.Int8Array,d=l&&l.prototype,f=d&&d.set,p=s.aTypedArray,g=s.exportTypedArrayMethod,m=!c((function(){var t=new Uint8ClampedArray(2);return n(f,t,{length:1,0:3},1),3!==t[1]})),v=m&&s.NATIVE_ARRAY_BUFFER_VIEWS&&c((function(){var t=new l(2);return t.set(1),t.set("2",1),0!==t[0]||2!==t[1]}));g("set",(function(t){p(this);var e=o(arguments.length>1?arguments[1]:void 0,1),i=h(t);if(m)return n(f,this,i,e);var r=this.length,s=a(i),c=0;if(s+e>r)throw new u("Wrong length");while(c=i.length?o(void 0,!0):(t=r(i,n),e.index+=t.length,o(t,!1))}))},"3ce9":function(t,e,i){"use strict";var r=i("23e7"),n=i("20059");r({target:"Symbol",stat:!0},{isRegisteredSymbol:n})},"3d5a":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("1132"),i("72fe"),i("2b79"),i("38ba"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.StreamCipher,n=e.algo,s=[],a=[],o=[],h=n.RabbitLegacy=r.extend({_doReset:function(){var t=this._key.words,e=this.cfg.iv,i=this._X=[t[0],t[3]<<16|t[2]>>>16,t[1],t[0]<<16|t[3]>>>16,t[2],t[1]<<16|t[0]>>>16,t[3],t[2]<<16|t[1]>>>16],r=this._C=[t[2]<<16|t[2]>>>16,4294901760&t[0]|65535&t[1],t[3]<<16|t[3]>>>16,4294901760&t[1]|65535&t[2],t[0]<<16|t[0]>>>16,4294901760&t[2]|65535&t[3],t[1]<<16|t[1]>>>16,4294901760&t[3]|65535&t[0]];this._b=0;for(var n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)r[n]^=i[n+4&7];if(e){var s=e.words,a=s[0],o=s[1],h=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),u=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),l=h>>>16|4294901760&u,d=u<<16|65535&h;r[0]^=h,r[1]^=l,r[2]^=u,r[3]^=d,r[4]^=h,r[5]^=l,r[6]^=u,r[7]^=d;for(n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(t,e){var i=this._X;c.call(this),s[0]=i[0]^i[5]>>>16^i[3]<<16,s[1]=i[2]^i[7]>>>16^i[5]<<16,s[2]=i[4]^i[1]>>>16^i[7]<<16,s[3]=i[6]^i[3]>>>16^i[1]<<16;for(var r=0;r<4;r++)s[r]=16711935&(s[r]<<8|s[r]>>>24)|4278255360&(s[r]<<24|s[r]>>>8),t[e+r]^=s[r]},blockSize:4,ivSize:2});function c(){for(var t=this._X,e=this._C,i=0;i<8;i++)a[i]=e[i];e[0]=e[0]+1295307597+this._b|0,e[1]=e[1]+3545052371+(e[0]>>>0>>0?1:0)|0,e[2]=e[2]+886263092+(e[1]>>>0>>0?1:0)|0,e[3]=e[3]+1295307597+(e[2]>>>0>>0?1:0)|0,e[4]=e[4]+3545052371+(e[3]>>>0>>0?1:0)|0,e[5]=e[5]+886263092+(e[4]>>>0>>0?1:0)|0,e[6]=e[6]+1295307597+(e[5]>>>0>>0?1:0)|0,e[7]=e[7]+3545052371+(e[6]>>>0>>0?1:0)|0,this._b=e[7]>>>0>>0?1:0;for(i=0;i<8;i++){var r=t[i]+e[i],n=65535&r,s=r>>>16,h=((n*n>>>17)+n*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);o[i]=h^c}t[0]=o[0]+(o[7]<<16|o[7]>>>16)+(o[6]<<16|o[6]>>>16)|0,t[1]=o[1]+(o[0]<<8|o[0]>>>24)+o[7]|0,t[2]=o[2]+(o[1]<<16|o[1]>>>16)+(o[0]<<16|o[0]>>>16)|0,t[3]=o[3]+(o[2]<<8|o[2]>>>24)+o[1]|0,t[4]=o[4]+(o[3]<<16|o[3]>>>16)+(o[2]<<16|o[2]>>>16)|0,t[5]=o[5]+(o[4]<<8|o[4]>>>24)+o[3]|0,t[6]=o[6]+(o[5]<<16|o[5]>>>16)+(o[4]<<16|o[4]>>>16)|0,t[7]=o[7]+(o[6]<<8|o[6]>>>24)+o[5]|0}e.RabbitLegacy=r._createHelper(h)}(),t.RabbitLegacy}))},"3d71":function(t,e,i){"use strict";i("2834")},"3e16":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("861d"),a=i("f5df"),o=i("d039"),h="Error",c="DOMException",u=Object.setPrototypeOf||{}.__proto__,l=n(c),d=Error,f=d.isError,p=!f||!u||o((function(){return l&&!f(new l(c))||!f(new d(h,{cause:function(){}}))||f(n("Object","create")(d.prototype))}));r({target:"Error",stat:!0,sham:!0,forced:p},{isError:function(t){if(!s(t))return!1;var e=a(t);return e===h||e===c}})},"3ea3":function(t,e,i){"use strict";var r=i("23e7"),n=i("f748"),s=Math.abs,a=Math.pow;r({target:"Math",stat:!0},{cbrt:function(t){var e=+t;return n(e)*a(s(e),1/3)}})},"3eb5":function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i("10d3"),n=i("10d3"),s=i("1b29"),a=s.byEbmlID,o=function(){function t(){this._schema=a,this._buffers=[],this._stack=[]}return t.prototype.encode=function(t){var e=this;return r.concat(t.reduce((function(t,i){return t.concat(e.encodeChunk(i))}),[])).buffer},t.prototype.encodeChunk=function(t){return"m"===t.type?t.isEnd?this.endTag(t):this.startTag(t):this.writeTag(t),this.flush()},t.prototype.flush=function(){var t=this._buffers;return this._buffers=[],t},t.prototype.getSchemaInfo=function(t){for(var e=Object.keys(this._schema).map(Number),i=0;i0){var a=this._stack[this._stack.length-1];a.children.push({tagId:i,elm:t,children:[],data:s})}else this._buffers=this._buffers.concat(s)},t.prototype.startTag=function(t){var e=t.name,i=this.getSchemaInfo(e);if(null==i)throw new Error("No schema entry found for "+e);if(t.unknownSize){var s=r.encodeTag(i,new n.Buffer(0),t.unknownSize);this._buffers=this._buffers.concat(s)}else{var a={tagId:i,elm:t,children:[],data:null};this._stack.length>0&&this._stack[this._stack.length-1].children.push(a),this._stack.push(a)}},t.prototype.endTag=function(t){t.name;var e=this._stack.pop();if(null==e)throw new Error("EBML structure is broken");if(e.elm.name!==t.name)throw new Error("EBML structure is broken");var i=e.children.reduce((function(t,e){if(null===e.data)throw new Error("EBML structure is broken");return t.concat(e.data)}),[]),n=r.concat(i);"m"===e.elm.type?e.data=r.encodeTag(e.tagId,n,e.elm.unknownSize):e.data=r.encodeTag(e.tagId,n),this._stack.length<1&&(this._buffers=this._buffers.concat(e.data))},t}();e.default=o},"3f1c":function(t,e,i){"use strict";var r=i("23e7"),n=i("44d2"),s=i("3511"),a=i("07fa"),o=i("23cb"),h=i("fc6a"),c=i("5926"),u=Array,l=Math.max,d=Math.min;r({target:"Array",proto:!0},{toSpliced:function(t,e){var i,r,n,f,p=h(this),g=a(p),m=o(t,g),v=arguments.length,y=0;for(0===v?i=r=0:1===v?(i=0,r=g-m):(i=v-2,r=d(l(c(e),0),g-m)),n=s(g+i-r),f=u(n);y-_}function w(t,e){var i=e?t.textFill:t.fill;return null!=i&&i!==f}function E(t,e){var i=e?t.textStroke:t.stroke;return null!=i&&i!==f}function x(t,e){e&&A(t,"transform","matrix("+d.call(e,",")+")")}function A(t,e,i){(!i||"linear"!==i.type&&"radial"!==i.type)&&t.setAttribute(e,i)}function C(t,e,i){t.setAttributeNS("http://www.w3.org/1999/xlink",e,i)}function R(t,e,i,r){if(w(e,i)){var n=i?e.textFill:e.fill;n="transparent"===n?f:n,A(t,"fill",n),A(t,"fill-opacity",null!=e.fillOpacity?e.fillOpacity*e.opacity:e.opacity)}else A(t,"fill",f);if(E(e,i)){var s=i?e.textStroke:e.stroke;s="transparent"===s?f:s,A(t,"stroke",s);var a=i?e.textStrokeWidth:e.lineWidth,o=!i&&e.strokeNoScale?r.getLineScale():1;A(t,"stroke-width",a/o),A(t,"paint-order",i?"stroke":"fill"),A(t,"stroke-opacity",null!=e.strokeOpacity?e.strokeOpacity:e.opacity);var h=e.lineDash;h?(A(t,"stroke-dasharray",e.lineDash.join(",")),A(t,"stroke-dashoffset",p(e.lineDashOffset||0))):A(t,"stroke-dasharray",""),e.lineCap&&A(t,"stroke-linecap",e.lineCap),e.lineJoin&&A(t,"stroke-linejoin",e.lineJoin),e.miterLimit&&A(t,"stroke-miterlimit",e.miterLimit)}else A(t,"stroke",f)}function P(t){for(var e=[],i=t.data,r=t.len(),n=0;n=y:-_>=y),C=_>0?_%y:_%y+y,R=!1;R=!!A||!S(x)&&C>=v===!!E;var P=T(h+u*m(f)),I=T(c+d*g(f));A&&(_=E?y-1e-4:1e-4-y,R=!0,9===n&&e.push("M",P,I));var k=T(h+u*m(f+_)),D=T(c+d*g(f+_));e.push("A",T(u),T(d),p(w*b),+R,+E,k,D);break;case l.Z:a="Z";break;case l.R:k=T(i[n++]),D=T(i[n++]);var O=T(i[n++]),M=T(i[n++]);e.push("M",k,D,"L",k+O,D,"L",k+O,D+M,"L",k,D+M,"L",k,D);break}a&&e.push(a);for(var N=0;ND){for(;I1?arguments[1]:void 0,(function(t,e){return new(a(t))(e)}))}))},"3fd0":function(t,e,i){"use strict";i("ce74")},"3fde":function(t,e,i){"use strict";var r=i("825a");t.exports=function(t,e,i){return function(){for(var n=new t,s=arguments.length,a=0;a?@[\\\]^|]/,rt=/[\0\t\n\r #/:<>?@[\\\]^|]/,nt=/^[\u0000-\u0020]+/,st=/(^|[^\u0000-\u0020])[\u0000-\u0020]+$/,at=/[\t\n\r]/g,ot=function(t){var e,i,r,n,s,a,o,h=W(t,".");if(h.length&&""===h[h.length-1]&&h.length--,e=h.length,e>4)return t;for(i=[],r=0;r1&&"0"===O(n,0)&&(s=M(Z,n)?16:8,n=H(n,8===s?1:2)),""===n)a=0;else{if(!M(10===s?tt:8===s?J:et,n))return t;a=I(n,s)}U(i,a)}for(r=0;r=D(256,5-e))return null}else if(a>255)return null;for(o=L(i),r=0;r6)return;r=0;while(d()){if(n=null,r>0){if(!("."===d()&&r<4))return;l++}if(!M(K,d()))return;while(M(K,d())){if(s=I(d(),10),null===n)n=s;else{if(0===n)return;n=10*n+s}if(n>255)return;l++}h[c]=256*h[c]+n,r++,2!==r&&4!==r||c++}if(4!==r)return;break}if(":"===d()){if(l++,!d())return}else if(d())return;h[c++]=e}else{if(null!==u)return;l++,c++,u=c}}if(null!==u){a=c-u,c=7;while(0!==c&&a>0)o=h[c],h[c--]=h[u+a-1],h[u+--a]=o}else if(8!==c)return;return h},ct=function(t){for(var e=null,i=1,r=null,n=0,s=0;s<8;s++)0!==t[s]?(n>i&&(e=r,i=n),r=null,n=0):(null===r&&(r=s),++n);return n>i?r:e},ut=function(t){var e,i,r,n;if("number"==typeof t){for(e=[],i=0;i<4;i++)V(e,t%256),t=k(t/256);return N(e,".")}if("object"==typeof t){for(e="",r=ct(t),i=0;i<8;i++)n&&0===t[i]||(n&&(n=!1),r===i?(e+=i?":":"::",n=!0):(e+=B(t[i],16),i<7&&(e+=":")));return"["+e+"]"}return t},lt={},dt=p({},lt,{" ":1,'"':1,"<":1,">":1,"`":1}),ft=p({},dt,{"#":1,"?":1,"{":1,"}":1}),pt=p({},ft,{"/":1,":":1,";":1,"=":1,"@":1,"[":1,"\\":1,"]":1,"^":1,"|":1}),gt=function(t,e){var i=v(t,0);return i>32&&i<127&&!f(e,t)?t:encodeURIComponent(t)},mt={ftp:21,file:null,http:80,https:443,ws:80,wss:443},vt=function(t,e){var i;return 2===t.length&&M(X,O(t,0))&&(":"===(i=O(t,1))||!e&&"|"===i)},yt=function(t){var e;return t.length>1&&vt(H(t,0,2))&&(2===t.length||"/"===(e=O(t,2))||"\\"===e||"?"===e||"#"===e)},bt=function(t){return"."===t||"%2e"===j(t)},_t=function(t){return t=j(t),".."===t||"%2e."===t||".%2e"===t||"%2e%2e"===t},Tt={},St={},wt={},Et={},xt={},At={},Ct={},Rt={},Pt={},It={},kt={},Dt={},Ot={},Mt={},Nt={},Bt={},Lt={},Ut={},zt={},Ft={},Wt={},Ht=function(t,e,i){var r,n,s,a=b(t);if(e){if(n=this.parse(a),n)throw new P(n);this.searchParams=null}else{if(void 0!==i&&(r=new Ht(i,!0)),n=this.parse(a,null,r),n)throw new P(n);s=C(new A),s.bindURL(this),this.searchParams=s}};Ht.prototype={type:"URL",parse:function(t,e,i){var n,s,a,o,h=this,c=e||Tt,u=0,l="",d=!1,p=!1,v=!1;t=b(t),e||(h.scheme="",h.username="",h.password="",h.host=null,h.port=null,h.path=[],h.query=null,h.fragment=null,h.cannotBeABaseURL=!1,t=z(t,nt,""),t=z(t,st,"$1")),t=z(t,at,""),n=g(t);while(u<=n.length){switch(s=n[u],c){case Tt:if(!s||!M(X,s)){if(e)return G;c=wt;continue}l+=j(s),c=St;break;case St:if(s&&(M(Q,s)||"+"===s||"-"===s||"."===s))l+=j(s);else{if(":"!==s){if(e)return G;l="",c=wt,u=0;continue}if(e&&(h.isSpecial()!==f(mt,l)||"file"===l&&(h.includesCredentials()||null!==h.port)||"file"===h.scheme&&!h.host))return;if(h.scheme=l,e)return void(h.isSpecial()&&mt[h.scheme]===h.port&&(h.port=null));l="","file"===h.scheme?c=Mt:h.isSpecial()&&i&&i.scheme===h.scheme?c=Et:h.isSpecial()?c=Rt:"/"===n[u+1]?(c=xt,u++):(h.cannotBeABaseURL=!0,U(h.path,""),c=zt)}break;case wt:if(!i||i.cannotBeABaseURL&&"#"!==s)return G;if(i.cannotBeABaseURL&&"#"===s){h.scheme=i.scheme,h.path=m(i.path),h.query=i.query,h.fragment="",h.cannotBeABaseURL=!0,c=Wt;break}c="file"===i.scheme?Mt:At;continue;case Et:if("/"!==s||"/"!==n[u+1]){c=At;continue}c=Pt,u++;break;case xt:if("/"===s){c=It;break}c=Ut;continue;case At:if(h.scheme=i.scheme,s===r)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=m(i.path),h.query=i.query;else if("/"===s||"\\"===s&&h.isSpecial())c=Ct;else if("?"===s)h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=m(i.path),h.query="",c=Ft;else{if("#"!==s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=m(i.path),h.path.length--,c=Ut;continue}h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,h.path=m(i.path),h.query=i.query,h.fragment="",c=Wt}break;case Ct:if(!h.isSpecial()||"/"!==s&&"\\"!==s){if("/"!==s){h.username=i.username,h.password=i.password,h.host=i.host,h.port=i.port,c=Ut;continue}c=It}else c=Pt;break;case Rt:if(c=Pt,"/"!==s||"/"!==O(l,u+1))continue;u++;break;case Pt:if("/"!==s&&"\\"!==s){c=It;continue}break;case It:if("@"===s){d&&(l="%40"+l),d=!0,a=g(l);for(var y=0;y65535)return $;h.port=h.isSpecial()&&S===mt[h.scheme]?null:S,l=""}if(e)return;c=Lt;continue}return $}l+=s;break;case Mt:if(h.scheme="file","/"===s||"\\"===s)c=Nt;else{if(!i||"file"!==i.scheme){c=Ut;continue}switch(s){case r:h.host=i.host,h.path=m(i.path),h.query=i.query;break;case"?":h.host=i.host,h.path=m(i.path),h.query="",c=Ft;break;case"#":h.host=i.host,h.path=m(i.path),h.query=i.query,h.fragment="",c=Wt;break;default:yt(N(m(n,u),""))||(h.host=i.host,h.path=m(i.path),h.shortenPath()),c=Ut;continue}}break;case Nt:if("/"===s||"\\"===s){c=Bt;break}i&&"file"===i.scheme&&!yt(N(m(n,u),""))&&(vt(i.path[0],!0)?U(h.path,i.path[0]):h.host=i.host),c=Ut;continue;case Bt:if(s===r||"/"===s||"\\"===s||"?"===s||"#"===s){if(!e&&vt(l))c=Ut;else if(""===l){if(h.host="",e)return;c=Lt}else{if(o=h.parseHost(l),o)return o;if("localhost"===h.host&&(h.host=""),e)return;l="",c=Lt}continue}l+=s;break;case Lt:if(h.isSpecial()){if(c=Ut,"/"!==s&&"\\"!==s)continue}else if(e||"?"!==s)if(e||"#"!==s){if(s!==r&&(c=Ut,"/"!==s))continue}else h.fragment="",c=Wt;else h.query="",c=Ft;break;case Ut:if(s===r||"/"===s||"\\"===s&&h.isSpecial()||!e&&("?"===s||"#"===s)){if(_t(l)?(h.shortenPath(),"/"===s||"\\"===s&&h.isSpecial()||U(h.path,"")):bt(l)?"/"===s||"\\"===s&&h.isSpecial()||U(h.path,""):("file"===h.scheme&&!h.path.length&&vt(l)&&(h.host&&(h.host=""),l=O(l,0)+":"),U(h.path,l)),l="","file"===h.scheme&&(s===r||"?"===s||"#"===s))while(h.path.length>1&&""===h.path[0])F(h.path);"?"===s?(h.query="",c=Ft):"#"===s&&(h.fragment="",c=Wt)}else l+=gt(s,ft);break;case zt:"?"===s?(h.query="",c=Ft):"#"===s?(h.fragment="",c=Wt):s!==r&&(h.path[0]+=gt(s,lt));break;case Ft:e||"#"!==s?s!==r&&("'"===s&&h.isSpecial()?h.query+="%27":h.query+="#"===s?"%23":gt(s,lt)):(h.fragment="",c=Wt);break;case Wt:s!==r&&(h.fragment+=gt(s,dt));break}u++}},parseHost:function(t){var e,i,r;if("["===O(t,0)){if("]"!==O(t,t.length-1))return Y;if(e=ht(H(t,1,-1)),!e)return Y;this.host=e}else if(this.isSpecial()){if(t=y(t),M(it,t))return Y;if(e=ot(t),null===e)return Y;this.host=e}else{if(M(rt,t))return Y;for(e="",i=g(t),r=0;r1?arguments[1]:void 0,r=E(e,new Ht(t,!1,i));s||(e.href=r.serialize(),e.origin=r.getOrigin(),e.protocol=r.getProtocol(),e.username=r.getUsername(),e.password=r.getPassword(),e.host=r.getHost(),e.hostname=r.getHostname(),e.port=r.getPort(),e.pathname=r.getPathname(),e.search=r.getSearch(),e.searchParams=r.getSearchParams(),e.hash=r.getHash())},Vt=jt.prototype,qt=function(t,e){return{get:function(){return x(this)[t]()},set:e&&function(t){return x(this)[e](t)},configurable:!0,enumerable:!0}};if(s&&(l(Vt,"href",qt("serialize","setHref")),l(Vt,"origin",qt("getOrigin")),l(Vt,"protocol",qt("getProtocol","setProtocol")),l(Vt,"username",qt("getUsername","setUsername")),l(Vt,"password",qt("getPassword","setPassword")),l(Vt,"host",qt("getHost","setHost")),l(Vt,"hostname",qt("getHostname","setHostname")),l(Vt,"port",qt("getPort","setPort")),l(Vt,"pathname",qt("getPathname","setPathname")),l(Vt,"search",qt("getSearch","setSearch")),l(Vt,"searchParams",qt("getSearchParams")),l(Vt,"hash",qt("getHash","setHash"))),u(Vt,"toJSON",(function(){return x(this).serialize()}),{enumerable:!0}),u(Vt,"toString",(function(){return x(this).serialize()}),{enumerable:!0}),R){var Gt=R.createObjectURL,Yt=R.revokeObjectURL;Gt&&u(jt,"createObjectURL",h(Gt,R)),Yt&&u(jt,"revokeObjectURL",h(Yt,R))}_(jt,"URL"),n({global:!0,constructor:!0,forced:!a,sham:!s},{URL:jt})},"401b":function(t,e){var i="undefined"===typeof Float32Array?Array:Float32Array;function r(t,e){var r=new i(2);return null==t&&(t=0),null==e&&(e=0),r[0]=t,r[1]=e,r}function n(t,e){return t[0]=e[0],t[1]=e[1],t}function s(t){var e=new i(2);return e[0]=t[0],e[1]=t[1],e}function a(t,e,i){return t[0]=e,t[1]=i,t}function o(t,e,i){return t[0]=e[0]+i[0],t[1]=e[1]+i[1],t}function h(t,e,i,r){return t[0]=e[0]+i[0]*r,t[1]=e[1]+i[1]*r,t}function c(t,e,i){return t[0]=e[0]-i[0],t[1]=e[1]-i[1],t}function u(t){return Math.sqrt(d(t))}var l=u;function d(t){return t[0]*t[0]+t[1]*t[1]}var f=d;function p(t,e,i){return t[0]=e[0]*i[0],t[1]=e[1]*i[1],t}function g(t,e,i){return t[0]=e[0]/i[0],t[1]=e[1]/i[1],t}function m(t,e){return t[0]*e[0]+t[1]*e[1]}function v(t,e,i){return t[0]=e[0]*i,t[1]=e[1]*i,t}function y(t,e){var i=u(e);return 0===i?(t[0]=0,t[1]=0):(t[0]=e[0]/i,t[1]=e[1]/i),t}function b(t,e){return Math.sqrt((t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1]))}var _=b;function T(t,e){return(t[0]-e[0])*(t[0]-e[0])+(t[1]-e[1])*(t[1]-e[1])}var S=T;function w(t,e){return t[0]=-e[0],t[1]=-e[1],t}function E(t,e,i,r){return t[0]=e[0]+r*(i[0]-e[0]),t[1]=e[1]+r*(i[1]-e[1]),t}function x(t,e,i){var r=e[0],n=e[1];return t[0]=i[0]*r+i[2]*n+i[4],t[1]=i[1]*r+i[3]*n+i[5],t}function A(t,e,i){return t[0]=Math.min(e[0],i[0]),t[1]=Math.min(e[1],i[1]),t}function C(t,e,i){return t[0]=Math.max(e[0],i[0]),t[1]=Math.max(e[1],i[1]),t}e.create=r,e.copy=n,e.clone=s,e.set=a,e.add=o,e.scaleAndAdd=h,e.sub=c,e.len=u,e.length=l,e.lenSquare=d,e.lengthSquare=f,e.mul=p,e.div=g,e.dot=m,e.scale=v,e.normalize=y,e.distance=b,e.dist=_,e.distanceSquare=T,e.distSquare=S,e.negate=w,e.lerp=E,e.applyTransform=x,e.min=A,e.max=C},4057:function(t,e,i){"use strict";var r=i("23e7"),n=Math.hypot,s=Math.abs,a=Math.sqrt,o=!!n&&n(1/0,NaN)!==1/0;r({target:"Math",stat:!0,arity:2,forced:o},{hypot:function(t,e){var i,r,n=0,o=0,h=arguments.length,c=0;while(o0?(r=i/c,n+=r*r):n+=i;return c===1/0?1/0:c*a(n)}})},4069:function(t,e,i){"use strict";var r=i("44d2");r("flat")},"408a":function(t,e,i){"use strict";var r=i("e330");t.exports=r(1..valueOf)},"40bb":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("8a96"),a=i("015d");n.Uint8Array&&r({target:"Uint8Array",stat:!0},{fromHex:function(t){return a(s(t)).bytes}})},"40d5":function(t,e,i){"use strict";var r=i("d039");t.exports=!r((function(){var t=function(){}.bind();return"function"!=typeof t||t.hasOwnProperty("prototype")}))},"40d9":function(t,e,i){"use strict";var r=i("23e7"),n=Math.floor,s=Math.log,a=Math.LOG2E;r({target:"Math",stat:!0},{clz32:function(t){var e=t>>>0;return e?31-n(s(e+.5)*a):32}})},"40e9":function(t,e,i){"use strict";var r=i("23e7"),n=i("41f6");n&&r({target:"ArrayBuffer",proto:!0},{transferToFixedLength:function(){return n(this,arguments.length?arguments[0]:void 0,!1)}})},4160:function(t,e,i){"use strict";var r=i("23e7"),n=i("17c2");r({target:"Array",proto:!0,forced:[].forEach!==n},{forEach:n})},"41ef":function(t,e,i){var r=i("d51b"),n={transparent:[0,0,0,0],aliceblue:[240,248,255,1],antiquewhite:[250,235,215,1],aqua:[0,255,255,1],aquamarine:[127,255,212,1],azure:[240,255,255,1],beige:[245,245,220,1],bisque:[255,228,196,1],black:[0,0,0,1],blanchedalmond:[255,235,205,1],blue:[0,0,255,1],blueviolet:[138,43,226,1],brown:[165,42,42,1],burlywood:[222,184,135,1],cadetblue:[95,158,160,1],chartreuse:[127,255,0,1],chocolate:[210,105,30,1],coral:[255,127,80,1],cornflowerblue:[100,149,237,1],cornsilk:[255,248,220,1],crimson:[220,20,60,1],cyan:[0,255,255,1],darkblue:[0,0,139,1],darkcyan:[0,139,139,1],darkgoldenrod:[184,134,11,1],darkgray:[169,169,169,1],darkgreen:[0,100,0,1],darkgrey:[169,169,169,1],darkkhaki:[189,183,107,1],darkmagenta:[139,0,139,1],darkolivegreen:[85,107,47,1],darkorange:[255,140,0,1],darkorchid:[153,50,204,1],darkred:[139,0,0,1],darksalmon:[233,150,122,1],darkseagreen:[143,188,143,1],darkslateblue:[72,61,139,1],darkslategray:[47,79,79,1],darkslategrey:[47,79,79,1],darkturquoise:[0,206,209,1],darkviolet:[148,0,211,1],deeppink:[255,20,147,1],deepskyblue:[0,191,255,1],dimgray:[105,105,105,1],dimgrey:[105,105,105,1],dodgerblue:[30,144,255,1],firebrick:[178,34,34,1],floralwhite:[255,250,240,1],forestgreen:[34,139,34,1],fuchsia:[255,0,255,1],gainsboro:[220,220,220,1],ghostwhite:[248,248,255,1],gold:[255,215,0,1],goldenrod:[218,165,32,1],gray:[128,128,128,1],green:[0,128,0,1],greenyellow:[173,255,47,1],grey:[128,128,128,1],honeydew:[240,255,240,1],hotpink:[255,105,180,1],indianred:[205,92,92,1],indigo:[75,0,130,1],ivory:[255,255,240,1],khaki:[240,230,140,1],lavender:[230,230,250,1],lavenderblush:[255,240,245,1],lawngreen:[124,252,0,1],lemonchiffon:[255,250,205,1],lightblue:[173,216,230,1],lightcoral:[240,128,128,1],lightcyan:[224,255,255,1],lightgoldenrodyellow:[250,250,210,1],lightgray:[211,211,211,1],lightgreen:[144,238,144,1],lightgrey:[211,211,211,1],lightpink:[255,182,193,1],lightsalmon:[255,160,122,1],lightseagreen:[32,178,170,1],lightskyblue:[135,206,250,1],lightslategray:[119,136,153,1],lightslategrey:[119,136,153,1],lightsteelblue:[176,196,222,1],lightyellow:[255,255,224,1],lime:[0,255,0,1],limegreen:[50,205,50,1],linen:[250,240,230,1],magenta:[255,0,255,1],maroon:[128,0,0,1],mediumaquamarine:[102,205,170,1],mediumblue:[0,0,205,1],mediumorchid:[186,85,211,1],mediumpurple:[147,112,219,1],mediumseagreen:[60,179,113,1],mediumslateblue:[123,104,238,1],mediumspringgreen:[0,250,154,1],mediumturquoise:[72,209,204,1],mediumvioletred:[199,21,133,1],midnightblue:[25,25,112,1],mintcream:[245,255,250,1],mistyrose:[255,228,225,1],moccasin:[255,228,181,1],navajowhite:[255,222,173,1],navy:[0,0,128,1],oldlace:[253,245,230,1],olive:[128,128,0,1],olivedrab:[107,142,35,1],orange:[255,165,0,1],orangered:[255,69,0,1],orchid:[218,112,214,1],palegoldenrod:[238,232,170,1],palegreen:[152,251,152,1],paleturquoise:[175,238,238,1],palevioletred:[219,112,147,1],papayawhip:[255,239,213,1],peachpuff:[255,218,185,1],peru:[205,133,63,1],pink:[255,192,203,1],plum:[221,160,221,1],powderblue:[176,224,230,1],purple:[128,0,128,1],red:[255,0,0,1],rosybrown:[188,143,143,1],royalblue:[65,105,225,1],saddlebrown:[139,69,19,1],salmon:[250,128,114,1],sandybrown:[244,164,96,1],seagreen:[46,139,87,1],seashell:[255,245,238,1],sienna:[160,82,45,1],silver:[192,192,192,1],skyblue:[135,206,235,1],slateblue:[106,90,205,1],slategray:[112,128,144,1],slategrey:[112,128,144,1],snow:[255,250,250,1],springgreen:[0,255,127,1],steelblue:[70,130,180,1],tan:[210,180,140,1],teal:[0,128,128,1],thistle:[216,191,216,1],tomato:[255,99,71,1],turquoise:[64,224,208,1],violet:[238,130,238,1],wheat:[245,222,179,1],white:[255,255,255,1],whitesmoke:[245,245,245,1],yellow:[255,255,0,1],yellowgreen:[154,205,50,1]};function s(t){return t=Math.round(t),t<0?0:t>255?255:t}function a(t){return t=Math.round(t),t<0?0:t>360?360:t}function o(t){return t<0?0:t>1?1:t}function h(t){return t.length&&"%"===t.charAt(t.length-1)?s(parseFloat(t)/100*255):s(parseInt(t,10))}function c(t){return t.length&&"%"===t.charAt(t.length-1)?o(parseFloat(t)/100):o(parseFloat(t))}function u(t,e,i){return i<0?i+=1:i>1&&(i-=1),6*i<1?t+(e-t)*i*6:2*i<1?e:3*i<2?t+(e-t)*(2/3-i)*6:t}function l(t,e,i){return t+(e-t)*i}function d(t,e,i,r,n){return t[0]=e,t[1]=i,t[2]=r,t[3]=n,t}function f(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t}var p=new r(20),g=null;function m(t,e){g&&f(g,e),g=p.put(t,g||e.slice())}function v(t,e){if(t){e=e||[];var i=p.get(t);if(i)return f(e,i);t+="";var r=t.replace(/ /g,"").toLowerCase();if(r in n)return f(e,n[r]),m(t,e),e;if("#"!==r.charAt(0)){var s=r.indexOf("("),a=r.indexOf(")");if(-1!==s&&a+1===r.length){var o=r.substr(0,s),u=r.substr(s+1,a-(s+1)).split(","),l=1;switch(o){case"rgba":if(4!==u.length)return void d(e,0,0,0,1);l=c(u.pop());case"rgb":return 3!==u.length?void d(e,0,0,0,1):(d(e,h(u[0]),h(u[1]),h(u[2]),l),m(t,e),e);case"hsla":return 4!==u.length?void d(e,0,0,0,1):(u[3]=c(u[3]),y(u,e),m(t,e),e);case"hsl":return 3!==u.length?void d(e,0,0,0,1):(y(u,e),m(t,e),e);default:return}}d(e,0,0,0,1)}else{if(4===r.length){var g=parseInt(r.substr(1),16);return g>=0&&g<=4095?(d(e,(3840&g)>>4|(3840&g)>>8,240&g|(240&g)>>4,15&g|(15&g)<<4,1),m(t,e),e):void d(e,0,0,0,1)}if(7===r.length){g=parseInt(r.substr(1),16);return g>=0&&g<=16777215?(d(e,(16711680&g)>>16,(65280&g)>>8,255&g,1),m(t,e),e):void d(e,0,0,0,1)}}}}function y(t,e){var i=(parseFloat(t[0])%360+360)%360/360,r=c(t[1]),n=c(t[2]),a=n<=.5?n*(r+1):n+r-n*r,o=2*n-a;return e=e||[],d(e,s(255*u(o,a,i+1/3)),s(255*u(o,a,i)),s(255*u(o,a,i-1/3)),1),4===t.length&&(e[3]=t[3]),e}function b(t){if(t){var e,i,r=t[0]/255,n=t[1]/255,s=t[2]/255,a=Math.min(r,n,s),o=Math.max(r,n,s),h=o-a,c=(o+a)/2;if(0===h)e=0,i=0;else{i=c<.5?h/(o+a):h/(2-o-a);var u=((o-r)/6+h/2)/h,l=((o-n)/6+h/2)/h,d=((o-s)/6+h/2)/h;r===o?e=d-l:n===o?e=1/3+u-d:s===o&&(e=2/3+l-u),e<0&&(e+=1),e>1&&(e-=1)}var f=[360*e,i,c];return null!=t[3]&&f.push(t[3]),f}}function _(t,e){var i=v(t);if(i){for(var r=0;r<3;r++)i[r]=e<0?i[r]*(1-e)|0:(255-i[r])*e+i[r]|0,i[r]>255?i[r]=255:t[r]<0&&(i[r]=0);return R(i,4===i.length?"rgba":"rgb")}}function T(t){var e=v(t);if(e)return((1<<24)+(e[0]<<16)+(e[1]<<8)+ +e[2]).toString(16).slice(1)}function S(t,e,i){if(e&&e.length&&t>=0&&t<=1){i=i||[];var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),h=e[n],c=e[a],u=r-n;return i[0]=s(l(h[0],c[0],u)),i[1]=s(l(h[1],c[1],u)),i[2]=s(l(h[2],c[2],u)),i[3]=o(l(h[3],c[3],u)),i}}var w=S;function E(t,e,i){if(e&&e.length&&t>=0&&t<=1){var r=t*(e.length-1),n=Math.floor(r),a=Math.ceil(r),h=v(e[n]),c=v(e[a]),u=r-n,d=R([s(l(h[0],c[0],u)),s(l(h[1],c[1],u)),s(l(h[2],c[2],u)),o(l(h[3],c[3],u))],"rgba");return i?{color:d,leftIndex:n,rightIndex:a,value:r}:d}}var x=E;function A(t,e,i,r){if(t=v(t),t)return t=b(t),null!=e&&(t[0]=a(e)),null!=i&&(t[1]=c(i)),null!=r&&(t[2]=c(r)),R(y(t),"rgba")}function C(t,e){if(t=v(t),t&&null!=e)return t[3]=o(e),R(t,"rgba")}function R(t,e){if(t&&t.length){var i=t[0]+","+t[1]+","+t[2];return"rgba"!==e&&"hsva"!==e&&"hsla"!==e||(i+=","+t[3]),e+"("+i+")"}}e.parse=v,e.lift=_,e.toHex=T,e.fastLerp=S,e.fastMapToColor=w,e.lerp=E,e.mapToColor=x,e.modifyHSL=A,e.modifyAlpha=C,e.stringify=R},"41f6":function(t,e,i){"use strict";var r=i("cfe9"),n=i("e330"),s=i("7282"),a=i("0b25"),o=i("2005"),h=i("b620"),c=i("36f2"),u=i("dbe5"),l=r.structuredClone,d=r.ArrayBuffer,f=r.DataView,p=Math.min,g=d.prototype,m=f.prototype,v=n(g.slice),y=s(g,"resizable","get"),b=s(g,"maxByteLength","get"),_=n(m.getInt8),T=n(m.setInt8);t.exports=(u||c)&&function(t,e,i){var r,n=h(t),s=void 0===e?n:a(e),g=!y||!y(t);if(o(t),u&&(t=l(t,{transfer:[t]}),n===s&&(i||g)))return t;if(n>=s&&(!i||g))r=v(t,0,s);else{var m=i&&!g&&b?{maxByteLength:b(t)}:void 0;r=new d(s,m);for(var S=new f(t),w=new f(r),E=p(s,n),x=0;x1?arguments[1]:void 0)}})},4625:function(t,e,i){"use strict";var r=i("c6b6"),n=i("e330");t.exports=function(t){if("Function"===r(t))return n(t)}},"466d":function(t,e,i){"use strict";var r=i("c65b"),n=i("d784"),s=i("825a"),a=i("7234"),o=i("50c4"),h=i("577e"),c=i("1d80"),u=i("dc4a"),l=i("8aa5"),d=i("14c3");n("match",(function(t,e,i){return[function(e){var i=c(this),n=a(e)?void 0:u(e,t);return n?r(n,e,i):new RegExp(e)[t](h(i))},function(t){var r=s(this),n=h(t),a=i(e,r,n);if(a.done)return a.value;if(!r.global)return d(r,n);var c=r.unicode;r.lastIndex=0;var u,f=[],p=0;while(null!==(u=d(r,n))){var g=h(u[0]);f[p]=g,""===g&&(r.lastIndex=l(n,o(r.lastIndex),c)),p++}return 0===p?null:f}]}))},4673:function(t,e,i){"use strict";var r=i("e330"),n=i("59ed"),s=i("7234"),a=i("07fa"),o=i("7b0b"),h=i("094a"),c=i("f29f"),u=h.Map,l=h.has,d=h.set,f=r([].push);t.exports=function(t){var e,i,r,h=o(this),p=a(h),g=[],m=new u,v=s(t)?function(t){return t}:n(t);for(e=0;e1?arguments[1]:void 0);return!1!==a(e,(function(t,r){if(!i(t,r,e))return!1}),!0)}})},4795:function(t,e,i){"use strict";i("2ca8"),i("1d57")},4801:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("e330"),a=i("6b37"),o=i("2005"),h=s(1..toString);n.Uint8Array&&r({target:"Uint8Array",proto:!0},{toHex:function(){a(this),o(this.buffer);for(var t="",e=0,i=this.length;e1?arguments[1]:void 0),g=new c,m=o(h),v=0;m>v;v++)i=h[v],e=p(i,v,n),l(g,e)?f(u(g,e),i):d(g,e,[i]);return g}},4942:function(t,e,i){var r=i("2cf4"),n=r.debugMode,s=function(){};1===n&&(s=console.error);var a=s;t.exports=a},"498a":function(t,e,i){"use strict";var r=i("23e7"),n=i("58a8").trim,s=i("c8d2");r({target:"String",proto:!0,forced:s("trim")},{trim:function(){return n(this)}})},"4a2e":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("9961");r({target:"Set",proto:!0,real:!0,forced:!0},{symmetricDifference:function(t){return n(a,this,s(t))}})},"4a3f":function(t,e,i){var r=i("401b"),n=r.create,s=r.distSquare,a=Math.pow,o=Math.sqrt,h=1e-8,c=1e-4,u=o(3),l=1/3,d=n(),f=n(),p=n();function g(t){return t>-h&&th||t<-h}function v(t,e,i,r,n){var s=1-n;return s*s*(s*t+3*n*e)+n*n*(n*r+3*s*i)}function y(t,e,i,r,n){var s=1-n;return 3*(((e-t)*s+2*(i-e)*n)*s+(r-i)*n*n)}function b(t,e,i,r,n,s){var h=r+3*(e-i)-t,c=3*(i-2*e+t),d=3*(e-t),f=t-n,p=c*c-3*h*d,m=c*d-9*h*f,v=d*d-3*c*f,y=0;if(g(p)&&g(m))if(g(c))s[0]=0;else{var b=-d/c;b>=0&&b<=1&&(s[y++]=b)}else{var _=m*m-4*p*v;if(g(_)){var T=m/p,S=(b=-c/h+T,-T/2);b>=0&&b<=1&&(s[y++]=b),S>=0&&S<=1&&(s[y++]=S)}else if(_>0){var w=o(_),E=p*c+1.5*h*(-m+w),x=p*c+1.5*h*(-m-w);E=E<0?-a(-E,l):a(E,l),x=x<0?-a(-x,l):a(x,l);b=(-c-(E+x))/(3*h);b>=0&&b<=1&&(s[y++]=b)}else{var A=(2*p*c-3*h*m)/(2*o(p*p*p)),C=Math.acos(A)/3,R=o(p),P=Math.cos(C),I=(b=(-c-2*R*P)/(3*h),S=(-c+R*(P+u*Math.sin(C)))/(3*h),(-c+R*(P-u*Math.sin(C)))/(3*h));b>=0&&b<=1&&(s[y++]=b),S>=0&&S<=1&&(s[y++]=S),I>=0&&I<=1&&(s[y++]=I)}}return y}function _(t,e,i,r,n){var s=6*i-12*e+6*t,a=9*e+3*r-3*t-9*i,h=3*e-3*t,c=0;if(g(a)){if(m(s)){var u=-h/s;u>=0&&u<=1&&(n[c++]=u)}}else{var l=s*s-4*a*h;if(g(l))n[0]=-s/(2*a);else if(l>0){var d=o(l),f=(u=(-s+d)/(2*a),(-s-d)/(2*a));u>=0&&u<=1&&(n[c++]=u),f>=0&&f<=1&&(n[c++]=f)}}return c}function T(t,e,i,r,n,s){var a=(e-t)*n+t,o=(i-e)*n+e,h=(r-i)*n+i,c=(o-a)*n+a,u=(h-o)*n+o,l=(u-c)*n+c;s[0]=t,s[1]=a,s[2]=c,s[3]=l,s[4]=l,s[5]=u,s[6]=h,s[7]=r}function S(t,e,i,r,n,a,h,u,l,g,m){var y,b,_,T,S,w=.005,E=1/0;d[0]=l,d[1]=g;for(var x=0;x<1;x+=.05)f[0]=v(t,i,n,h,x),f[1]=v(e,r,a,u,x),T=s(d,f),T=0&&T=0&&u<=1&&(n[c++]=u)}}else{var l=a*a-4*s*h;if(g(l)){u=-a/(2*s);u>=0&&u<=1&&(n[c++]=u)}else if(l>0){var d=o(l),f=(u=(-a+d)/(2*s),(-a-d)/(2*s));u>=0&&u<=1&&(n[c++]=u),f>=0&&f<=1&&(n[c++]=f)}}return c}function A(t,e,i){var r=t+i-2*e;return 0===r?.5:(t-e)/r}function C(t,e,i,r,n){var s=(e-t)*r+t,a=(i-e)*r+e,o=(a-s)*r+s;n[0]=t,n[1]=s,n[2]=o,n[3]=o,n[4]=a,n[5]=i}function R(t,e,i,r,n,a,h,u,l){var g,m=.005,v=1/0;d[0]=h,d[1]=u;for(var y=0;y<1;y+=.05){f[0]=w(t,i,n,y),f[1]=w(e,r,a,y);var b=s(d,f);b=0&&b=0;--r)if(e[r]===t)return!0;return!1}),i):null:i[0]},g.prototype.update=function(t,e){if(t){var i=this.getDefs(!1);if(t[this._domName]&&i.contains(t[this._domName]))"function"===typeof e&&e(t);else{var r=this.add(t);r&&(t[this._domName]=r)}}},g.prototype.addDom=function(t){var e=this.getDefs(!0);e.appendChild(t)},g.prototype.removeDom=function(t){var e=this.getDefs(!1);e&&t[this._domName]&&(e.removeChild(t[this._domName]),t[this._domName]=null)},g.prototype.getDoms=function(){var t=this.getDefs(!1);if(!t)return[];var e=[];return s.each(this._tagNames,(function(i){var r=t.getElementsByTagName(i);e=e.concat([].slice.call(r))})),e},g.prototype.markAllUnused=function(){var t=this.getDoms(),e=this;s.each(t,(function(t){t[e._markLabel]=f}))},g.prototype.markUsed=function(t){t&&(t[this._markLabel]=p)},g.prototype.removeUnused=function(){var t=this.getDefs(!1);if(t){var e=this.getDoms(),i=this;s.each(e,(function(e){e[i._markLabel]!==p&&t.removeChild(e)}))}},g.prototype.getSvgProxy=function(t){return t instanceof a?u:t instanceof o?l:t instanceof h?d:u},g.prototype.getTextSvgElement=function(t){return t.__textSvgEl},g.prototype.getSvgElement=function(t){return t.__svgEl};var m=g;t.exports=m},"4ae1":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("2ba4"),a=i("0538"),o=i("5087"),h=i("825a"),c=i("861d"),u=i("7c73"),l=i("d039"),d=n("Reflect","construct"),f=Object.prototype,p=[].push,g=l((function(){function t(){}return!(d((function(){}),[],t)instanceof t)})),m=!l((function(){d((function(){}))})),v=g||m;r({target:"Reflect",stat:!0,forced:v,sham:v},{construct:function(t,e){o(t),h(e);var i=arguments.length<3?t:o(arguments[2]);if(m&&!g)return d(t,e,i);if(t===i){switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3])}var r=[null];return s(p,r,e),new(s(a,t,r))}var n=i.prototype,l=u(c(n)?n:f),v=s(t,l,e);return c(v)?v:l}})},"4b11":function(t,e,i){"use strict";t.exports="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView},"4ba9":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.mode.OFB=function(){var e=t.lib.BlockCipherMode.extend(),i=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,n=this._iv,s=this._keystream;n&&(s=this._keystream=n.slice(0),this._iv=void 0),i.encryptBlock(s,0);for(var a=0;a4?h*s(2*n/i)/s(n/i):h/3);var u=n/i,l=-n/2,d=r+h*s(l),f=o+h*a(l);l+=u,t.moveTo(d,f);for(var p,g=0,m=2*i-1;g@^][^\s!#%&*+<=>@^]*>/,N=/a/g,B=/a/g,L=new A(N)!==N,U=g.MISSED_STICKY,z=g.UNSUPPORTED_Y,F=r&&(!L||U||w||E||y((function(){return B[x]=!1,A(N)!==N||A(B)===B||"/a/i"!==String(A(N,"i"))}))),W=function(t){for(var e,i=t.length,r=0,n="",s=!1;r<=i;r++)e=I(t,r),"\\"!==e?s||"."!==e?("["===e?s=!0:"]"===e&&(s=!1),n+=e):n+="[\\s\\S]":n+=e+I(t,++r);return n},H=function(t){for(var e,i=t.length,r=0,n="",s=[],a=c(null),o=!1,h=!1,u=0,l="";r<=i;r++){if(e=I(t,r),"\\"===e)e+=I(t,++r);else if("]"===e)o=!1;else if(!o)switch(!0){case"["===e:o=!0;break;case"("===e:if(n+=e,"?:"===O(t,r+1,r+3))continue;P(M,O(t,r+1))&&(r+=2,h=!0),u++;continue;case">"===e&&h:if(""===l||b(a,l))throw new R("Invalid capture group name");a[l]=!0,s[s.length]=[l,u],h=!1,l="";continue}h?l+=e:n+=e}return[n,s]};if(a("RegExp",F)){for(var j=function(t,e){var i,r,n,s,a,c,u=l(C,this),g=d(t),m=void 0===e,v=[],y=t;if(!u&&g&&m&&t.constructor===j)return t;if((g||l(C,t))&&(t=t.source,m&&(e=p(y))),t=void 0===t?"":f(t),e=void 0===e?"":f(e),y=t,w&&"dotAll"in N&&(r=!!e&&D(e,"s")>-1,r&&(e=k(e,/s/g,""))),i=e,U&&"sticky"in N&&(n=!!e&&D(e,"y")>-1,n&&z&&(e=k(e,/y/g,""))),E&&(s=H(t),t=s[0],v=s[1]),a=o(A(t,e),u?this:C,j),(r||n||v.length)&&(c=_(a),r&&(c.dotAll=!0,c.raw=j(W(t),i)),n&&(c.sticky=!0),v.length&&(c.groups=v)),t!==y)try{h(a,"source",""===y?"(?:)":y)}catch(b){}return a},V=u(A),q=0;V.length>q;)m(j,A,V[q++]);C.constructor=j,j.prototype=C,v(n,"RegExp",j,{constructor:!0})}T("RegExp")},"4d64":function(t,e,i){"use strict";var r=i("fc6a"),n=i("23cb"),s=i("07fa"),a=function(t){return function(e,i,a){var o=r(e),h=s(o);if(0===h)return!t&&-1;var c,u=n(a,h);if(t&&i!==i){while(h>u)if(c=o[u++],c!==c)return!0}else for(;h>u;u++)if((t||u in o)&&o[u]===i)return t||u||0;return!t&&-1}};t.exports={includes:a(!0),indexOf:a(!1)}},"4d90":function(t,e,i){"use strict";var r=i("23e7"),n=i("0ccb").start,s=i("9a0c");r({target:"String",proto:!0,forced:s},{padStart:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},"4de4":function(t,e,i){"use strict";var r=i("23e7"),n=i("b727").filter,s=i("1dde"),a=s("filter");r({target:"Array",proto:!0,forced:!a},{filter:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},"4df4":function(t,e,i){"use strict";var r=i("0366"),n=i("c65b"),s=i("7b0b"),a=i("9bdd"),o=i("e95a"),h=i("68ee"),c=i("07fa"),u=i("8418"),l=i("9a1f"),d=i("35a1"),f=Array;t.exports=function(t){var e=s(t),i=h(this),p=arguments.length,g=p>1?arguments[1]:void 0,m=void 0!==g;m&&(g=r(g,p>2?arguments[2]:void 0));var v,y,b,_,T,S,w=d(e),E=0;if(!w||this===f&&o(w))for(v=c(e),y=i?new this(v):f(v);v>E;E++)S=m?g(e[E],E):e[E],u(y,E,S);else for(y=i?new this:[],_=l(e,w),T=_.next;!(b=n(T,_)).done;E++)S=m?a(_,g,[b.value,E],!0):b.value,u(y,E,S);return y.length=E,y}},"4e13":function(t,e,i){var r=i("cbe5"),n=Math.cos,s=Math.sin,a=r.extend({type:"trochoid",shape:{cx:0,cy:0,r:0,r0:0,d:0,location:"out"},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,a,o,h=e.r,c=e.r0,u=e.d,l=e.cx,d=e.cy,f="out"===e.location?1:-1;if(!(e.location&&h<=c)){var p,g=0,m=1;i=(h+f*c)*n(0)-f*u*n(0)+l,r=(h+f*c)*s(0)-u*s(0)+d,t.moveTo(i,r);do{g++}while(c*g%(h+f*c)!==0);do{p=Math.PI/180*m,a=(h+f*c)*n(p)-f*u*n((h/c+f)*p)+l,o=(h+f*c)*s(p)-u*s((h/c+f)*p)+d,t.lineTo(a,o),m++}while(m<=c*g/(h+f*c)*360)}}});t.exports=a},"4e16":function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("db82"),a=i("f29f");r({target:"Map",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0);return!0===a(e,(function(t,r){if(i(t,r,e))return!0}),!0)}})},"4e3e":function(t,e,i){"use strict";i("7d54")},"4e82":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("59ed"),a=i("7b0b"),o=i("07fa"),h=i("083a"),c=i("577e"),u=i("d039"),l=i("addb"),d=i("a640"),f=i("3f7e"),p=i("99f4"),g=i("1212"),m=i("ea83"),v=[],y=n(v.sort),b=n(v.push),_=u((function(){v.sort(void 0)})),T=u((function(){v.sort(null)})),S=d("sort"),w=!u((function(){if(g)return g<70;if(!(f&&f>3)){if(p)return!0;if(m)return m<603;var t,e,i,r,n="";for(t=65;t<76;t++){switch(e=String.fromCharCode(t),t){case 66:case 69:case 70:case 72:i=3;break;case 68:case 71:i=4;break;default:i=2}for(r=0;r<47;r++)v.push({k:e+r,v:i})}for(v.sort((function(t,e){return e.v-t.v})),r=0;rc(i)?1:-1}};r({target:"Array",proto:!0,forced:E},{sort:function(t){void 0!==t&&s(t);var e=a(this);if(w)return void 0===t?y(e):y(e,t);var i,r,n=[],c=o(e);for(r=0;r=2){if(a&&"spline"!==a){var o=n(s,a,i,e.smoothConstraint);t.moveTo(s[0][0],s[0][1]);for(var h=s.length,c=0;c<(i?h:h-1);c++){var u=o[2*c],l=o[2*c+1],d=s[(c+1)%h];t.bezierCurveTo(u[0],u[1],l[0],l[1],d[0],d[1])}}else{"spline"===a&&(s=r(s,i)),t.moveTo(s[0][0],s[0][1]);c=1;for(var f=s.length;c0?n(e,9007199254740991):0}},"512a":function(t,e,i){"use strict";var r=this&&this.__extends||function(){var t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var i in e)e.hasOwnProperty(i)&&(t[i]=e[i])};return function(e,i){function r(){this.constructor=e}t(e,i),e.prototype=null===i?Object.create(i):(r.prototype=i.prototype,new r)}}();Object.defineProperty(e,"__esModule",{value:!0});var n=i("7e25"),s=i("10d3"),a=function(t){function e(){var e=t.call(this)||this;return e.logGroup="",e.hasLoggingStarted=!1,e.metadataloaded=!1,e.chunks=[],e.stack=[],e.segmentOffset=0,e.last2SimpleBlockVideoTrackTimecode=[0,0],e.last2SimpleBlockAudioTrackTimecode=[0,0],e.lastClusterTimecode=0,e.lastClusterPosition=0,e.timecodeScale=1e6,e.metadataSize=0,e.metadatas=[],e.cues=[],e.firstVideoBlockRead=!1,e.firstAudioBlockRead=!1,e.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null},e.trackTypes=[],e.trackDefaultDuration=[],e.trackCodecDelay=[],e.trackInfo={type:"nothing"},e.ended=!1,e.logging=!1,e.use_duration_every_simpleblock=!1,e.use_webp=!1,e.use_segment_info=!0,e.drop_default_duration=!0,e}return r(e,t),e.prototype.stop=function(){this.ended=!0,this.emit_segment_info();while(this.stack.length)this.stack.pop(),this.logging&&console.groupEnd();this.logging&&this.hasLoggingStarted&&this.logGroup&&console.groupEnd()},e.prototype.emit_segment_info=function(){var t=this.chunks;if(this.chunks=[],this.metadataloaded){if(!this.use_segment_info)return;var e=this.lastClusterTimecode,i=this.duration,r=this.timecodeScale;this.emit("cluster",{timecode:e,data:t}),this.emit("duration",{timecodeScale:r,duration:i})}else{this.metadataloaded=!0,this.metadatas=t;var n=this.trackTypes.indexOf(1),s=this.trackTypes.indexOf(2);if(this.trackInfo=n>=0&&s>=0?{type:"both",trackNumber:n}:n>=0?{type:"video",trackNumber:n}:s>=0?{type:"audio",trackNumber:s}:{type:"nothing"},!this.use_segment_info)return;this.emit("metadata",{data:t,metadataSize:this.metadataSize})}},e.prototype.read=function(t){var e=this,i=!1;if(!this.ended){if("m"===t.type)if(t.isEnd)this.stack.pop();else{var r=this.stack[this.stack.length-1];if(null!=r&&r.level>=t.level){this.stack.pop(),this.logging&&console.groupEnd(),r.dataEnd=t.dataEnd,r.dataSize=t.dataEnd-r.dataStart,r.unknownSize=!1;var n=Object.assign({},r,{name:r.name,type:r.type,isEnd:!0});this.chunks.push(n)}this.stack.push(t)}if("m"===t.type&&"Segment"==t.name)0!=this.segmentOffset&&console.warn("Multiple segments detected!"),this.segmentOffset=t.dataStart,this.emit("segment_offset",this.segmentOffset);else if("b"===t.type&&"SimpleBlock"===t.name){var a=s.ebmlBlock(t.data),o=a.timecode,h=a.trackNumber,c=a.frames;if(1===this.trackTypes[h]){if(!this.firstVideoBlockRead&&(this.firstVideoBlockRead=!0,"both"===this.trackInfo.type||"video"===this.trackInfo.type)){var u=this.lastClusterTimecode+o;this.cues.push({CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit("cue_info",{CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockVideoTrackTimecode=[this.last2SimpleBlockVideoTrackTimecode[1],o]}else if(2===this.trackTypes[h]){if(!this.firstAudioBlockRead&&(this.firstAudioBlockRead=!0,"audio"===this.trackInfo.type)){u=this.lastClusterTimecode+o;this.cues.push({CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:u}),this.emit("cue_info",{CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:this.lastClusterTimecode}),this.emit("cue",{CueTrack:h,CueClusterPosition:this.lastClusterPosition,CueTime:u})}this.last2SimpleBlockAudioTrackTimecode=[this.last2SimpleBlockAudioTrackTimecode[1],o]}this.use_duration_every_simpleblock&&this.emit("duration",{timecodeScale:this.timecodeScale,duration:this.duration}),this.use_webp&&c.forEach((function(t){var i=t.slice(3,6).toString("hex");if("9d012a"===i){var r=s.VP8BitStreamToRiffWebPBuffer(t),n=new Blob([r],{type:"image/webp"}),a=e.duration;e.emit("webp",{currentTime:a,webp:n})}}))}else"m"===t.type&&"Cluster"===t.name&&!1===t.isEnd?(this.firstVideoBlockRead=!1,this.firstAudioBlockRead=!1,this.emit_segment_info(),this.emit("cluster_ptr",t.tagStart),this.lastClusterPosition=t.tagStart):"u"===t.type&&"Timecode"===t.name?this.lastClusterTimecode=t.value:"u"===t.type&&"TimecodeScale"===t.name?this.timecodeScale=t.value:"m"===t.type&&"TrackEntry"===t.name?t.isEnd?(this.trackTypes[this.currentTrack.TrackNumber]=this.currentTrack.TrackType,this.trackDefaultDuration[this.currentTrack.TrackNumber]=this.currentTrack.DefaultDuration,this.trackCodecDelay[this.currentTrack.TrackNumber]=this.currentTrack.CodecDelay):this.currentTrack={TrackNumber:-1,TrackType:-1,DefaultDuration:null,CodecDelay:null}:"u"===t.type&&"TrackType"===t.name?this.currentTrack.TrackType=t.value:"u"===t.type&&"TrackNumber"===t.name?this.currentTrack.TrackNumber=t.value:"u"===t.type&&"CodecDelay"===t.name?this.currentTrack.CodecDelay=t.value:"u"===t.type&&"DefaultDuration"===t.name?this.drop_default_duration?(console.warn("DefaultDuration detected!, remove it"),i=!0):this.currentTrack.DefaultDuration=t.value:"unknown"===t.name&&console.warn(t);!this.metadataloaded&&t.dataEnd>0&&(this.metadataSize=t.dataEnd),i||this.chunks.push(t),this.logging&&this.put(t)}},Object.defineProperty(e.prototype,"duration",{get:function(){if("nothing"===this.trackInfo.type)return console.warn("no video, no audio track"),0;var t=0,e=0,i=0,r=this.trackDefaultDuration[this.trackInfo.trackNumber];if("number"===typeof r)t=r;else if("both"===this.trackInfo.type)if(this.last2SimpleBlockAudioTrackTimecode[1]>this.last2SimpleBlockVideoTrackTimecode[1]){t=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;var n=this.trackCodecDelay[this.trackTypes.indexOf(2)];"number"===typeof n&&(e=n),i=this.last2SimpleBlockAudioTrackTimecode[1]}else{t=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;n=this.trackCodecDelay[this.trackTypes.indexOf(1)];"number"===typeof n&&(e=n),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if("video"===this.trackInfo.type){t=(this.last2SimpleBlockVideoTrackTimecode[1]-this.last2SimpleBlockVideoTrackTimecode[0])*this.timecodeScale;n=this.trackCodecDelay[this.trackInfo.trackNumber];"number"===typeof n&&(e=n),i=this.last2SimpleBlockVideoTrackTimecode[1]}else if("audio"===this.trackInfo.type){t=(this.last2SimpleBlockAudioTrackTimecode[1]-this.last2SimpleBlockAudioTrackTimecode[0])*this.timecodeScale;n=this.trackCodecDelay[this.trackInfo.trackNumber];"number"===typeof n&&(e=n),i=this.last2SimpleBlockAudioTrackTimecode[1]}var s=(this.lastClusterTimecode+i)*this.timecodeScale+t-e,a=s/this.timecodeScale;return Math.floor(a)},enumerable:!0,configurable:!0}),e.prototype.addListener=function(e,i){return t.prototype.addListener.call(this,e,i)},e.prototype.put=function(t){this.hasLoggingStarted||(this.hasLoggingStarted=!0,this.logging&&this.logGroup&&console.groupCollapsed(this.logGroup)),"m"===t.type?t.isEnd?console.groupEnd():console.group(t.name+":"+t.tagStart):"b"===t.type?console.log(t.name,t.type):console.log(t.name,t.tagStart,t.type,t.value)},e}(n.EventEmitter);e.default=a},"51eb":function(t,e,i){"use strict";var r=i("825a"),n=i("485a"),s=TypeError;t.exports=function(t){if(r(this),"string"===t||"default"===t)t="string";else if("number"!==t)throw new s("Incorrect hint");return n(this,t)}},5270:function(t,e,i){"use strict";var r=i("c532"),n=i("c401"),s=i("2e67"),a=i("2444"),o=i("7a77");function h(t){if(t.cancelToken&&t.cancelToken.throwIfRequested(),t.signal&&t.signal.aborted)throw new o("canceled")}t.exports=function(t){h(t),t.headers=t.headers||{},t.data=n.call(t,t.data,t.headers,t.transformRequest),t.headers=r.merge(t.headers.common||{},t.headers[t.method]||{},t.headers),r.forEach(["delete","get","head","post","put","patch","common"],(function(e){delete t.headers[e]}));var e=t.adapter||a.adapter;return e(t).then((function(e){return h(t),e.data=n.call(t,e.data,e.headers,t.transformResponse),e}),(function(e){return s(e)||(h(t),e&&e.response&&(e.response.data=n.call(t,e.response.data,e.response.headers,t.transformResponse))),Promise.reject(e)}))}},"52c8":function(t,e,i){"use strict";var r=i("b5db");t.exports=/(?:ipad|iphone|ipod).*applewebkit/i.test(r)},5319:function(t,e,i){"use strict";var r=i("2ba4"),n=i("c65b"),s=i("e330"),a=i("d784"),o=i("d039"),h=i("825a"),c=i("1626"),u=i("7234"),l=i("5926"),d=i("50c4"),f=i("577e"),p=i("1d80"),g=i("8aa5"),m=i("dc4a"),v=i("0cb2"),y=i("14c3"),b=i("b622"),_=b("replace"),T=Math.max,S=Math.min,w=s([].concat),E=s([].push),x=s("".indexOf),A=s("".slice),C=function(t){return void 0===t?t:String(t)},R=function(){return"$0"==="a".replace(/./,"$0")}(),P=function(){return!!/./[_]&&""===/./[_]("a","$0")}(),I=!o((function(){var t=/./;return t.exec=function(){var t=[];return t.groups={a:"7"},t},"7"!=="".replace(t,"$")}));a("replace",(function(t,e,i){var s=P?"$":"$0";return[function(t,i){var r=p(this),s=u(t)?void 0:m(t,_);return s?n(s,t,r,i):n(e,f(r),t,i)},function(t,n){var a=h(this),o=f(t);if("string"==typeof n&&-1===x(n,s)&&-1===x(n,"$<")){var u=i(e,a,o,n);if(u.done)return u.value}var p=c(n);p||(n=f(n));var m,b=a.global;b&&(m=a.unicode,a.lastIndex=0);var _,R=[];while(1){if(_=y(a,o),null===_)break;if(E(R,_),!b)break;var P=f(_[0]);""===P&&(a.lastIndex=g(o,d(a.lastIndex),m))}for(var I="",k=0,D=0;D=k&&(I+=A(o,k,N)+O,k=N+M.length)}return I+A(o,k)}]}),!I||!R||P)},5327:function(t,e,i){"use strict";var r=i("23e7"),n=i("1ec1"),s=Math.acosh,a=Math.log,o=Math.sqrt,h=Math.LN2,c=!s||710!==Math.floor(s(Number.MAX_VALUE))||s(1/0)!==1/0;r({target:"Math",stat:!0,forced:c},{acosh:function(t){var e=+t;return e<1?NaN:e>94906265.62425156?a(e)+h:n(e-1+o(e-1)*o(e+1))}})},5333:function(t,e,i){"use strict";var r=i("23e7"),n=i("dcc3"),s=i("4754"),a=i("1d80"),o=i("577e"),h=i("69f3"),c=i("6547"),u=c.codeAt,l=c.charAt,d="String Iterator",f=h.set,p=h.getterFor(d),g=n((function(t){f(this,{type:d,string:t,index:0})}),"String",(function(){var t,e=p(this),i=e.string,r=e.index;return r>=i.length?s(void 0,!0):(t=l(i,r),e.index+=t.length,s({codePoint:u(t,0),position:r},!1))}));r({target:"String",proto:!0,forced:!0},{codePoints:function(){return new g(o(a(this)))}})},5352:function(t,e,i){"use strict";i("e260"),i("f6d6");var r=i("23e7"),n=i("cfe9"),s=i("157a"),a=i("d066"),o=i("c65b"),h=i("e330"),c=i("83ab"),u=i("f354"),l=i("cb2d"),d=i("edd0"),f=i("6964"),p=i("d44e"),g=i("dcc3"),m=i("69f3"),v=i("19aa"),y=i("1626"),b=i("1a2d"),_=i("0366"),T=i("f5df"),S=i("825a"),w=i("861d"),E=i("577e"),x=i("7c73"),A=i("5c6c"),C=i("9a1f"),R=i("35a1"),P=i("4754"),I=i("d6d6"),k=i("b622"),D=i("addb"),O=k("iterator"),M="URLSearchParams",N=M+"Iterator",B=m.set,L=m.getterFor(M),U=m.getterFor(N),z=s("fetch"),F=s("Request"),W=s("Headers"),H=F&&F.prototype,j=W&&W.prototype,V=n.TypeError,q=n.encodeURIComponent,G=String.fromCharCode,Y=a("String","fromCodePoint"),$=parseInt,X=h("".charAt),Q=h([].join),K=h([].push),Z=h("".replace),J=h([].shift),tt=h([].splice),et=h("".split),it=h("".slice),rt=h(/./.exec),nt=/\+/g,st="�",at=/^[0-9a-f]+$/i,ot=function(t,e){var i=it(t,e,e+2);return rt(at,i)?$(i,16):NaN},ht=function(t){for(var e=0,i=128;i>0&&0!==(t&i);i>>=1)e++;return e},ct=function(t){var e=null;switch(t.length){case 1:e=t[0];break;case 2:e=(31&t[0])<<6|63&t[1];break;case 3:e=(15&t[0])<<12|(63&t[1])<<6|63&t[2];break;case 4:e=(7&t[0])<<18|(63&t[1])<<12|(63&t[2])<<6|63&t[3];break}return e>1114111?null:e},ut=function(t){t=Z(t,nt," ");var e=t.length,i="",r=0;while(re){i+="%",r++;continue}var s=ot(t,r+1);if(s!==s){i+=n,r++;continue}r+=2;var a=ht(s);if(0===a)n=G(s);else{if(1===a||a>4){i+=st,r++;continue}var o=[s],h=1;while(he||"%"!==X(t,r))break;var c=ot(t,r+1);if(c!==c){r+=3;break}if(c>191||c<128)break;K(o,c),r+=2,h++}if(o.length!==a){i+=st;continue}var u=ct(o);null===u?i+=st:n=Y(u)}}i+=n,r++}return i},lt=/[!'()~]|%20/g,dt={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+"},ft=function(t){return dt[t]},pt=function(t){return Z(q(t),lt,ft)},gt=g((function(t,e){B(this,{type:N,target:L(t).entries,index:0,kind:e})}),M,(function(){var t=U(this),e=t.target,i=t.index++;if(!e||i>=e.length)return t.target=null,P(void 0,!0);var r=e[i];switch(t.kind){case"keys":return P(r.key,!1);case"values":return P(r.value,!1)}return P([r.key,r.value],!1)}),!0),mt=function(t){this.entries=[],this.url=null,void 0!==t&&(w(t)?this.parseObject(t):this.parseQuery("string"==typeof t?"?"===X(t,0)?it(t,1):t:E(t)))};mt.prototype={type:M,bindURL:function(t){this.url=t,this.update()},parseObject:function(t){var e,i,r,n,s,a,h,c=this.entries,u=R(t);if(u){e=C(t,u),i=e.next;while(!(r=o(i,e)).done){if(n=C(S(r.value)),s=n.next,(a=o(s,n)).done||(h=o(s,n)).done||!o(s,n).done)throw new V("Expected sequence with length 2");K(c,{key:E(a.value),value:E(h.value)})}}else for(var l in t)b(t,l)&&K(c,{key:l,value:E(t[l])})},parseQuery:function(t){if(t){var e,i,r=this.entries,n=et(t,"&"),s=0;while(s0?arguments[0]:void 0,e=B(this,new mt(t));c||(this.size=e.entries.length)},yt=vt.prototype;if(f(yt,{append:function(t,e){var i=L(this);I(arguments.length,2),K(i.entries,{key:E(t),value:E(e)}),c||this.length++,i.updateURL()},delete:function(t){var e=L(this),i=I(arguments.length,1),r=e.entries,n=E(t),s=i<2?void 0:arguments[1],a=void 0===s?s:E(s),o=0;while(oe.key?1:-1})),t.updateURL()},forEach:function(t){var e,i=L(this).entries,r=_(t,arguments.length>1?arguments[1]:void 0),n=0;while(n1?Tt(arguments[1]):{})}}),y(F)){var St=function(t){return v(this,H),new F(t,arguments.length>1?Tt(arguments[1]):{})};H.constructor=St,St.prototype=H,r({global:!0,constructor:!0,dontCallGetSet:!0,forced:!0},{Request:St})}}t.exports={URLSearchParams:vt,getState:L}},5377:function(t,e,i){"use strict";var r=i("cfe9"),n=i("83ab"),s=i("edd0"),a=i("ad6d"),o=i("d039"),h=r.RegExp,c=h.prototype,u=n&&o((function(){var t=!0;try{h(".","d")}catch(u){t=!1}var e={},i="",r=t?"dgimsy":"gimsy",n=function(t,r){Object.defineProperty(e,t,{get:function(){return i+=r,!0}})},s={dotAll:"s",global:"g",ignoreCase:"i",multiline:"m",sticky:"y"};for(var a in t&&(s.hasIndices="d"),s)n(a,s[a]);var o=Object.getOwnPropertyDescriptor(c,"flags").get.call(e);return o!==r||i!==r}));u&&s(c,"flags",{configurable:!0,get:a})},5388:function(t,e,i){"use strict";var r=i("c65b");t.exports=function(t,e,i){var n,s,a=i?t:t.iterator,o=t.next;while(!(n=r(o,a)).done)if(s=e(n.value),void 0!==s)return s}},"542d":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("d039"),a=i("408a"),o=n(1..toPrecision),h=s((function(){return"1"!==o(1,void 0)}))||!s((function(){o({})}));r({target:"Number",proto:!0,forced:h},{toPrecision:function(t){return void 0===t?o(a(this)):o(a(this),t)}})},"548f":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("68ee"),a=n("Array");r({target:"Observable",stat:!0,forced:!0},{of:function(){var t=s(this)?this:n("Observable"),e=arguments.length,i=a(e),r=0;while(r1?arguments[1]:void 0)}}),s("filterOut")},"54ec":function(t,e,i){"use strict";var r=i("23e7"),n=i("59ed"),s=i("db82"),a=i("f29f"),o=TypeError;r({target:"Map",proto:!0,real:!0,forced:!0},{reduce:function(t){var e=s(this),i=arguments.length<2,r=i?void 0:arguments[1];if(n(t),a(e,(function(n,s){i?(i=!1,r=n):r=t(r,n,s,e)})),i)throw new o("Reduce of empty map with no initial value");return r}})},5585:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=i("e1db");e.Decoder=r.default;var n=i("3eb5");e.Encoder=n.default;var s=i("512a");e.Reader=s.default;var a=i("10d3");e.tools=a;var o=i("67c0").version;e.version=o},"567a":function(t,e,i){"use strict";var r=i("23e7"),n=i("db82"),s=i("f29f");r({target:"Map",proto:!0,real:!0,forced:!0},{keyOf:function(t){var e=s(n(this),(function(e,i){if(e===t)return{key:i}}),!0);return e&&e.key}})},5692:function(t,e,i){"use strict";var r=i("c6cd");t.exports=function(t,e){return r[t]||(r[t]=e||{})}},5693:function(t,e){function i(t,e){var i,r,n,s,a,o=e.x,h=e.y,c=e.width,u=e.height,l=e.r;c<0&&(o+=c,c=-c),u<0&&(h+=u,u=-u),"number"===typeof l?i=r=n=s=l:l instanceof Array?1===l.length?i=r=n=s=l[0]:2===l.length?(i=n=l[0],r=s=l[1]):3===l.length?(i=l[0],r=s=l[1],n=l[2]):(i=l[0],r=l[1],n=l[2],s=l[3]):i=r=n=s=0,i+r>c&&(a=i+r,i*=c/a,r*=c/a),n+s>c&&(a=n+s,n*=c/a,s*=c/a),r+n>u&&(a=r+n,r*=u/a,n*=u/a),i+s>u&&(a=i+s,i*=u/a,s*=u/a),t.moveTo(o+i,h),t.lineTo(o+c-r,h),0!==r&&t.arc(o+c-r,h+r,r,-Math.PI/2,0),t.lineTo(o+c,h+u-n),0!==n&&t.arc(o+c-n,h+u-n,n,0,Math.PI/2),t.lineTo(o+s,h+u),0!==s&&t.arc(o+s,h+u-s,s,Math.PI/2,Math.PI),t.lineTo(o,h+i),0!==i&&t.arc(o+i,h+i,i,Math.PI,1.5*Math.PI)}e.buildPath=i},"56ef":function(t,e,i){"use strict";var r=i("d066"),n=i("e330"),s=i("241c"),a=i("7418"),o=i("825a"),h=n([].concat);t.exports=r("Reflect","ownKeys")||function(t){var e=s.f(o(t)),i=a.f;return i?h(e,i(t)):e}},"577e":function(t,e,i){"use strict";var r=i("f5df"),n=String;t.exports=function(t){if("Symbol"===r(t))throw new TypeError("Cannot convert a Symbol value to a string");return n(t)}},"57b9":function(t,e,i){"use strict";var r=i("c65b"),n=i("d066"),s=i("b622"),a=i("cb2d");t.exports=function(){var t=n("Symbol"),e=t&&t.prototype,i=e&&e.valueOf,o=s("toPrimitive");e&&!e[o]&&a(e,o,(function(t){return r(i,this)}),{arity:1})}},"583b":function(t,e,i){"use strict";var r=i("23e7"),n=i("eac5"),s=Math.abs;r({target:"Number",stat:!0},{isSafeInteger:function(t){return n(t)&&s(t)<=9007199254740991}})},5899:function(t,e,i){"use strict";t.exports="\t\n\v\f\r                 \u2028\u2029\ufeff"},"58a8":function(t,e,i){"use strict";var r=i("e330"),n=i("1d80"),s=i("577e"),a=i("5899"),o=r("".replace),h=RegExp("^["+a+"]+"),c=RegExp("(^|[^"+a+"])["+a+"]+$"),u=function(t){return function(e){var i=s(n(e));return 1&t&&(i=o(i,h,"")),2&t&&(i=o(i,c,"$1")),i}};t.exports={start:u(1),end:u(2),trim:u(3)}},"58fc":function(t,e,i){"use strict";var r=i("23e7"),n=i("be8c");r({target:"Math",stat:!0,forced:!0},{scale:n})},5926:function(t,e,i){"use strict";var r=i("b42e");t.exports=function(t){var e=+t;return e!==e||0===e?0:r(e)}},5980:function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){(function(){var e=t,i=e.lib,r=i.Base,n=e.enc,s=n.Utf8,a=e.algo;a.HMAC=r.extend({init:function(t,e){t=this._hasher=new t.init,"string"==typeof e&&(e=s.parse(e));var i=t.blockSize,r=4*i;e.sigBytes>r&&(e=t.finalize(e)),e.clamp();for(var n=this._oKey=e.clone(),a=this._iKey=e.clone(),o=n.words,h=a.words,c=0;cp.length?-1:y(p,S,A+x);return P1?arguments[1]:void 0,null,9007199254740991);return s(o,e.bytes)}})},"5c6c":function(t,e,i){"use strict";t.exports=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}}},"5cc6":function(t,e,i){"use strict";var r=i("74e8");r("Uint8",(function(t){return function(e,i,r){return t(this,e,i,r)}}))},"5cce":function(t,e){t.exports={version:"0.24.0"}},"5d15":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("1d80"),a=i("577e"),o=n("".charCodeAt);r({target:"String",proto:!0},{isWellFormed:function(){for(var t=a(s(this)),e=t.length,i=0;i=56320||++i>=e||56320!==(64512&o(t,i))))return!1}return!0}})},"5d41":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("861d"),a=i("825a"),o=i("c60d"),h=i("06cf"),c=i("e163");function u(t,e){var i,r,l=arguments.length<3?t:arguments[2];return a(t)===l?t[e]:(i=h.f(t,e),i?o(i)?i.value:void 0===i.get?void 0:n(i.get,l):s(r=c(t))?u(r,e,l):void 0)}r({target:"Reflect",stat:!0},{get:u})},"5db7":function(t,e,i){"use strict";var r=i("23e7"),n=i("a2bf"),s=i("59ed"),a=i("7b0b"),o=i("07fa"),h=i("65f0");r({target:"Array",proto:!0},{flatMap:function(t){var e,i=a(this),r=o(i);return s(t),e=h(i,0),e.length=n(e,i,i,r,0,1,t,arguments.length>1?arguments[1]:void 0),e}})},"5ded":function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("68ee"),a=i("8418"),o=Array,h=n((function(){function t(){}return!(o.of.call(t)instanceof t)}));r({target:"Array",stat:!0,forced:h},{of:function(){var t=0,e=arguments.length,i=new(s(this)?this:o)(e);while(e>t)a(i,t,arguments[t++]);return i.length=e,i}})},"5dfc":function(t,e,i){"use strict";var r=i("ebb5"),n=i("07fa"),s=i("bcbf"),a=i("23cb"),o=i("f495"),h=i("5926"),c=r.aTypedArray,u=r.getTypedArrayConstructor,l=r.exportTypedArrayMethod,d=Math.max,f=Math.min;l("toSpliced",(function(t,e){var i,r,l,p,g,m,v,y=c(this),b=u(y),_=n(y),T=a(t,_),S=arguments.length,w=0;if(0===S)i=r=0;else if(1===S)i=0,r=_-T;else if(r=f(d(h(e),0),_-T),i=S-2,i){p=new b(i),l=s(p);for(var E=2;E=55296&&n<=56319&&i>1,t+=b(t/e);while(t>m*o>>1)t=b(t/m),r+=s;return b(r+(m+1)*t/(t+h))},I=function(t){var e=[];t=C(t);var i,r,h=t.length,c=l,f=0,p=u;for(i=0;i=c&&rb((n-f)/E))throw new v(g);for(f+=(T-c)*E,c=T,i=0;in)throw new v(g);if(r===c){var x=f,A=s;while(1){var I=A<=p?a:A>=p+o?o:A-p;if(x=0;if(n){var s="touchend"!==r?e.targetTouches[0]:e.changedTouches[0];s&&l(t,s,e,i)}else l(t,e,e,i),e.zrDelta=e.wheelDelta?e.wheelDelta/120:-(e.detail||0)/3;var a=e.button;return null==e.which&&void 0!==a&&c.test(e.type)&&(e.which=1&a?1:2&a?3:4&a?2:0),e}function g(t,e,i,r){h?t.addEventListener(e,i,r):t.attachEvent("on"+e,i)}function m(t,e,i,r){h?t.removeEventListener(e,i,r):t.detachEvent("on"+e,i)}var v=h?function(t){t.preventDefault(),t.stopPropagation(),t.cancelBubble=!0}:function(t){t.returnValue=!1,t.cancelBubble=!0};function y(t){return 2===t.which||3===t.which}function b(t){return t.which>1}e.clientToLocal=l,e.getNativeEvent=f,e.normalizeEvent=p,e.addEventListener=g,e.removeEventListener=m,e.stop=v,e.isMiddleOrRightButtonOnMouseUpDown=y,e.notLeftMouse=b},"60bd":function(t,e,i){"use strict";var r=i("cfe9"),n=i("d039"),s=i("e330"),a=i("ebb5"),o=i("e260"),h=i("b622"),c=h("iterator"),u=r.Uint8Array,l=s(o.values),d=s(o.keys),f=s(o.entries),p=a.aTypedArray,g=a.exportTypedArrayMethod,m=u&&u.prototype,v=!n((function(){m[c].call([1])})),y=!!m&&m.values&&m[c]===m.values&&"values"===m.values.name,b=function(){return l(p(this))};g("entries",(function(){return f(p(this))}),v),g("keys",(function(){return d(p(this))}),v),g("values",b,v||!y,{name:"values"}),g(c,b,v||!y,{name:"values"})},"60da":function(t,e,i){"use strict";var r=i("83ab"),n=i("e330"),s=i("c65b"),a=i("d039"),o=i("df75"),h=i("7418"),c=i("d1e7"),u=i("7b0b"),l=i("44ad"),d=Object.assign,f=Object.defineProperty,p=n([].concat);t.exports=!d||a((function(){if(r&&1!==d({b:1},d(f({},"a",{enumerable:!0,get:function(){f(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var t={},e={},i=Symbol("assign detection"),n="abcdefghijklmnopqrst";return t[i]=7,n.split("").forEach((function(t){e[t]=t})),7!==d({},t)[i]||o(d({},e)).join("")!==n}))?function(t,e){var i=u(t),n=arguments.length,a=1,d=h.f,f=c.f;while(n>a){var g,m=l(arguments[a++]),v=d?p(o(m),d(m)):o(m),y=v.length,b=0;while(y>b)g=v[b++],r&&!s(f,m,g)||(i[g]=m[g])}return i}:d},"61ae":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("7192"),a=i("6b37"),o=n.Uint8Array;o&&r({target:"Uint8Array",proto:!0},{setFromBase64:function(t){a(this);var e=s(t,arguments.length>1?arguments[1]:void 0,this,this.length);return{read:e.read,written:e.written}}})},"620b":function(t,e,i){var r=i("401b"),n=r.distance;function s(t,e,i,r,n,s,a){var o=.5*(i-t),h=.5*(r-e);return(2*(e-i)+o+h)*a+(-3*(e-i)-2*o-h)*s+o*n+e}function a(t,e){for(var i=t.length,r=[],a=0,o=1;oi-2?i-1:f+1],l=t[f>i-3?i-1:f+2]);var m=p*p,v=p*m;r.push([s(c[0],g[0],u[0],l[0],p,m,v),s(c[1],g[1],u[1],l[1],p,m,v)])}return r}t.exports=a},"621a":function(t,e,i){"use strict";var r=i("cfe9"),n=i("e330"),s=i("83ab"),a=i("4b11"),o=i("5e77"),h=i("9112"),c=i("edd0"),u=i("6964"),l=i("d039"),d=i("19aa"),f=i("5926"),p=i("50c4"),g=i("0b25"),m=i("be8e"),v=i("77a7"),y=i("e163"),b=i("d2bb"),_=i("81d5"),T=i("f36a"),S=i("7156"),w=i("e893"),E=i("d44e"),x=i("69f3"),A=o.PROPER,C=o.CONFIGURABLE,R="ArrayBuffer",P="DataView",I="prototype",k="Wrong length",D="Wrong index",O=x.getterFor(R),M=x.getterFor(P),N=x.set,B=r[R],L=B,U=L&&L[I],z=r[P],F=z&&z[I],W=Object.prototype,H=r.Array,j=r.RangeError,V=n(_),q=n([].reverse),G=v.pack,Y=v.unpack,$=function(t){return[255&t]},X=function(t){return[255&t,t>>8&255]},Q=function(t){return[255&t,t>>8&255,t>>16&255,t>>24&255]},K=function(t){return t[3]<<24|t[2]<<16|t[1]<<8|t[0]},Z=function(t){return G(m(t),23,4)},J=function(t){return G(t,52,8)},tt=function(t,e,i){c(t[I],e,{configurable:!0,get:function(){return i(this)[e]}})},et=function(t,e,i,r){var n=M(t),s=g(i),a=!!r;if(s+e>n.byteLength)throw new j(D);var o=n.bytes,h=s+n.byteOffset,c=T(o,h,h+e);return a?c:q(c)},it=function(t,e,i,r,n,s){var a=M(t),o=g(i),h=r(+n),c=!!s;if(o+e>a.byteLength)throw new j(D);for(var u=a.bytes,l=o+a.byteOffset,d=0;d>24)},setUint8:function(t,e){st(this,t,e<<24>>24)}},{unsafe:!0})}else L=function(t){d(this,U);var e=g(t);N(this,{type:R,bytes:V(H(e),0),byteLength:e}),s||(this.byteLength=e,this.detached=!1)},U=L[I],z=function(t,e,i){d(this,F),d(t,U);var r=O(t),n=r.byteLength,a=f(e);if(a<0||a>n)throw new j("Wrong offset");if(i=void 0===i?n-a:p(i),a+i>n)throw new j(k);N(this,{type:P,buffer:t,byteLength:i,byteOffset:a,bytes:r.bytes}),s||(this.buffer=t,this.byteLength=i,this.byteOffset=a)},F=z[I],s&&(tt(L,"byteLength",O),tt(z,"buffer",M),tt(z,"byteLength",M),tt(z,"byteOffset",M)),u(F,{getInt8:function(t){return et(this,1,t)[0]<<24>>24},getUint8:function(t){return et(this,1,t)[0]},getInt16:function(t){var e=et(this,2,t,arguments.length>1&&arguments[1]);return(e[1]<<8|e[0])<<16>>16},getUint16:function(t){var e=et(this,2,t,arguments.length>1&&arguments[1]);return e[1]<<8|e[0]},getInt32:function(t){return K(et(this,4,t,arguments.length>1&&arguments[1]))},getUint32:function(t){return K(et(this,4,t,arguments.length>1&&arguments[1]))>>>0},getFloat32:function(t){return Y(et(this,4,t,arguments.length>1&&arguments[1]),23)},getFloat64:function(t){return Y(et(this,8,t,arguments.length>1&&arguments[1]),52)},setInt8:function(t,e){it(this,1,t,$,e)},setUint8:function(t,e){it(this,1,t,$,e)},setInt16:function(t,e){it(this,2,t,X,e,arguments.length>2&&arguments[2])},setUint16:function(t,e){it(this,2,t,X,e,arguments.length>2&&arguments[2])},setInt32:function(t,e){it(this,4,t,Q,e,arguments.length>2&&arguments[2])},setUint32:function(t,e){it(this,4,t,Q,e,arguments.length>2&&arguments[2])},setFloat32:function(t,e){it(this,4,t,Z,e,arguments.length>2&&arguments[2])},setFloat64:function(t,e){it(this,8,t,J,e,arguments.length>2&&arguments[2])}});E(L,R),E(z,P),t.exports={ArrayBuffer:L,DataView:z}},"62da":function(t,e,i){var r=i("cbe5"),n=r.extend({type:"droplet",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=e.width,s=e.height;t.moveTo(i,r+n),t.bezierCurveTo(i+n,r+n,i+3*n/2,r-n/3,i,r-s),t.bezierCurveTo(i-3*n/2,r-n/3,i-n,r+n,i,r+n),t.closePath()}});t.exports=n},6374:function(t,e,i){"use strict";var r=i("cfe9"),n=Object.defineProperty;t.exports=function(t,e){try{n(r,t,{value:e,configurable:!0,writable:!0})}catch(i){r[t]=e}return e}},6380:function(t,e,i){"use strict";var r=i("23e7"),n=i("783c"),s=i("825a"),a=n.toKey,o=n.getMap,h=n.store;r({target:"Reflect",stat:!0},{deleteMetadata:function(t,e){var i=arguments.length<3?void 0:a(arguments[2]),r=o(s(e),i,!1);if(void 0===r||!r["delete"](t))return!1;if(r.size)return!0;var n=h.get(e);return n["delete"](i),!!n.size||h["delete"](e)}})},"63fa":function(t,e,i){"use strict";var r=i("c65b"),n=i("825a"),s=i("7c73"),a=i("dc4a"),o=i("6964"),h=i("69f3"),c=i("d066"),u=i("a91f"),l=i("4754"),d=c("Promise"),f="AsyncFromSyncIterator",p=h.set,g=h.getterFor(f),m=function(t,e,i){var r=t.done;d.resolve(t.value).then((function(t){e(l(t,r))}),i)},v=function(t){t.type=f,p(this,t)};v.prototype=o(s(u),{next:function(){var t=g(this);return new d((function(e,i){var s=n(r(t.next,t.iterator));m(s,e,i)}))},return:function(){var t=g(this).iterator;return new d((function(e,i){var s=a(t,"return");if(void 0===s)return e(l(void 0,!0));var o=n(r(s,t));m(o,e,i)}))}}),t.exports=v},"649e":function(t,e,i){"use strict";var r=i("ebb5"),n=i("b727").some,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("some",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},"64e5":function(t,e,i){"use strict";var r=i("e330"),n=i("d039"),s=i("0ccb").start,a=RangeError,o=isFinite,h=Math.abs,c=Date.prototype,u=c.toISOString,l=r(c.getTime),d=r(c.getUTCDate),f=r(c.getUTCFullYear),p=r(c.getUTCHours),g=r(c.getUTCMilliseconds),m=r(c.getUTCMinutes),v=r(c.getUTCMonth),y=r(c.getUTCSeconds);t.exports=n((function(){return"0385-07-25T07:06:39.999Z"!==u.call(new Date(-50000000000001))}))||!n((function(){u.call(new Date(NaN))}))?function(){if(!o(l(this)))throw new a("Invalid time value");var t=this,e=f(t),i=g(t),r=e<0?"-":e>9999?"+":"";return r+s(h(e),r?6:4,0)+"-"+s(v(t)+1,2,0)+"-"+s(d(t),2,0)+"T"+s(p(t),2,0)+":"+s(m(t),2,0)+":"+s(y(t),2,0)+"."+s(i,3,0)+"Z"}:u},6547:function(t,e,i){"use strict";var r=i("e330"),n=i("5926"),s=i("577e"),a=i("1d80"),o=r("".charAt),h=r("".charCodeAt),c=r("".slice),u=function(t){return function(e,i){var r,u,l=s(a(e)),d=n(i),f=l.length;return d<0||d>=f?t?"":void 0:(r=h(l,d),r<55296||r>56319||d+1===f||(u=h(l,d+1))<56320||u>57343?t?o(l,d):r:t?c(l,d,d+2):u-56320+(r-55296<<10)+65536)}};t.exports={codeAt:u(!1),charAt:u(!0)}},6566:function(t,e,i){"use strict";var r=i("7c73"),n=i("edd0"),s=i("6964"),a=i("0366"),o=i("19aa"),h=i("7234"),c=i("2266"),u=i("c6d2"),l=i("4754"),d=i("2626"),f=i("83ab"),p=i("f183").fastKey,g=i("69f3"),m=g.set,v=g.getterFor;t.exports={getConstructor:function(t,e,i,u){var l=t((function(t,n){o(t,d),m(t,{type:e,index:r(null),first:null,last:null,size:0}),f||(t.size=0),h(n)||c(n,t[u],{that:t,AS_ENTRIES:i})})),d=l.prototype,g=v(e),y=function(t,e,i){var r,n,s=g(t),a=b(t,e);return a?a.value=i:(s.last=a={index:n=p(e,!0),key:e,value:i,previous:r=s.last,next:null,removed:!1},s.first||(s.first=a),r&&(r.next=a),f?s.size++:t.size++,"F"!==n&&(s.index[n]=a)),t},b=function(t,e){var i,r=g(t),n=p(e);if("F"!==n)return r.index[n];for(i=r.first;i;i=i.next)if(i.key===e)return i};return s(d,{clear:function(){var t=this,e=g(t),i=e.first;while(i)i.removed=!0,i.previous&&(i.previous=i.previous.next=null),i=i.next;e.first=e.last=null,e.index=r(null),f?e.size=0:t.size=0},delete:function(t){var e=this,i=g(e),r=b(e,t);if(r){var n=r.next,s=r.previous;delete i.index[r.index],r.removed=!0,s&&(s.next=n),n&&(n.previous=s),i.first===r&&(i.first=n),i.last===r&&(i.last=s),f?i.size--:e.size--}return!!r},forEach:function(t){var e,i=g(this),r=a(t,arguments.length>1?arguments[1]:void 0);while(e=e?e.next:i.first){r(e.value,e.key,this);while(e&&e.removed)e=e.previous}},has:function(t){return!!b(this,t)}}),s(d,i?{get:function(t){var e=b(this,t);return e&&e.value},set:function(t,e){return y(this,0===t?0:t,e)}}:{add:function(t){return y(this,t=0===t?0:t,t)}}),f&&n(d,"size",{configurable:!0,get:function(){return g(this).size}}),l},setStrong:function(t,e,i){var r=e+" Iterator",n=v(e),s=v(r);u(t,e,(function(t,e){m(this,{type:r,target:t,state:n(t),kind:e,last:null})}),(function(){var t=s(this),e=t.kind,i=t.last;while(i&&i.removed)i=i.previous;return t.target&&(t.last=i=i?i.next:t.state.first)?l("keys"===e?i.key:"values"===e?i.value:[i.key,i.value],!1):(t.target=null,l(void 0,!0))}),i?"entries":"values",!i,!0),d(e)}}},"658e":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("953b");r({target:"Set",proto:!0,real:!0,forced:!0},{intersection:function(t){return n(a,this,s(t))}})},"65ed":function(t,e,i){var r=i("22d1"),n=i("84ec"),s=n.buildTransformer,a="___zrEVENTSAVED",o=[];function h(t,e,i,r,n){return c(o,e,r,n,!0)&&c(t,i,o[0],o[1])}function c(t,e,i,n,s){if(e.getBoundingClientRect&&r.domSupported&&!d(e)){var o=e[a]||(e[a]={}),h=u(e,o),c=l(h,o,s);if(c)return c(t,i,n),!0}return!1}function u(t,e){var i=e.markers;if(i)return i;i=e.markers=[];for(var r=["left","right"],n=["top","bottom"],s=0;s<4;s++){var a=document.createElement("div"),o=a.style,h=s%2,c=(s>>1)%2;o.cssText=["position: absolute","visibility: hidden","padding: 0","margin: 0","border-width: 0","user-select: none","width:0","height:0",r[h]+":0",n[c]+":0",r[1-h]+":auto",n[1-c]+":auto",""].join("!important;"),t.appendChild(a),i.push(a)}return i}function l(t,e,i){for(var r=i?"invTrans":"trans",n=e[r],a=e.srcCoords,o=!0,h=[],c=[],u=0;u<4;u++){var l=t[u].getBoundingClientRect(),d=2*u,f=l.left,p=l.top;h.push(f,p),o=o&&a&&f===a[d]&&p===a[d+1],c.push(t[u].offsetLeft,t[u].offsetTop)}return o&&n?n:(e.srcCoords=h,e[r]=i?s(c,h):s(h,c))}function d(t){return"CANVAS"===t.nodeName.toUpperCase()}e.transformLocalCoord=h,e.transformCoordWithViewport=c,e.isCanvasEl=d},"65f0":function(t,e,i){"use strict";var r=i("0b42");t.exports=function(t,e){return new(r(t))(0===e?0:e)}},"660e":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("825a"),a=i("46c4"),o=i("abc1"),h=i("f8cd"),c=i("d195"),u=i("4754"),l=i("c430"),d=c((function(t){var e,i=this,r=i.iterator;if(!i.remaining--){var a=u(void 0,!0);return i.done=!0,e=r["return"],void 0!==e?t.resolve(n(e,r,void 0)).then((function(){return a})):a}return t.resolve(n(i.next,r)).then((function(t){return s(t).done?(i.done=!0,u(void 0,!0)):u(t.value,!1)})).then(null,(function(t){throw i.done=!0,t}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:l},{take:function(t){s(this);var e=h(o(+t));return new d(a(this),{remaining:e})}})},"664f":function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("sup")},{sup:function(){return n(this,"sup","","")}})},"669d":function(t,e,i){"use strict";i("2c66")},"66c1":function(t,e,i){"use strict";var r=i("23e7"),n=i("783c"),s=i("825a"),a=i("e163"),o=n.has,h=n.get,c=n.toKey,u=function(t,e,i){var r=o(t,e,i);if(r)return h(t,e,i);var n=a(e);return null!==n?u(t,n,i):void 0};r({target:"Reflect",stat:!0},{getMetadata:function(t,e){var i=arguments.length<3?void 0:c(arguments[2]);return u(t,s(e),i)}})},"66c3":function(t,e,i){var r=i("8104"),n=1,s=3,a=2;function o(t,e){if(!e)return[t.nextBuffer()];var i,r,o=[],h=t.nextUInt8()+1;if(e===a){if(t.length%h!==0)throw new Error("Fixed-Size Lacing Error");for(r=t.length/h,i=0;i>1;return e.frames=o(i,s),e}},"66e5":function(t,e,i){"use strict";var r=i("c65b"),n=i("a542"),s=function(t,e){return[e,t]};t.exports=function(){return r(n,this,s)}},6720:function(t,e,i){"use strict";i("8c77")},6789:function(t,e,i){"use strict";var r=i("23e7"),n=i("98ce"),s=i("4c1f").add;r({target:"WeakSet",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,i=arguments.length;e/dev/null","reset":"rm -rf node_modules","setup":"npm install -g http-server;","start":"http-server . -s & tsc -w -p .& watchify lib/example_seekable.js -o test/example_seekable.js","stop":"killall -- node */tsc -w -p","test":"tsc; espower lib/test.js > lib/test.tmp; mv -f lib/test.tmp lib/test.js; browserify lib/test.js -o test/test.js","update":"npm run reset; npm update","watchify":"watchify lib/index.js --standalone EBML -o dist/EBMl.js -v"},"typings":"./lib/index.d.ts","version":"2.0.2"}')},6807:function(t,e,i){"use strict";var r=i("23e7"),n=i("0255");r({target:"Symbol",stat:!0,forced:!0},{isWellKnownSymbol:n})},6899:function(t,e,i){"use strict";var r=i("ebb5"),n=i("b727").filterReject,s=i("30f2"),a=r.aTypedArray,o=r.exportTypedArrayMethod;o("filterReject",(function(t){var e=n(a(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}),!0)},"68ab":function(t,e,i){var r=i("4a3f"),n=r.quadraticProjectPoint;function s(t,e,i,r,s,a,o,h,c){if(0===o)return!1;var u=o;if(c>e+u&&c>r+u&&c>a+u||ct+u&&h>i+u&&h>s+u||hi.size)&&!1!==s(e,(function(t){if(!i.includes(t))return!1}),!0)}},"68ee":function(t,e,i){"use strict";var r=i("e330"),n=i("d039"),s=i("1626"),a=i("f5df"),o=i("d066"),h=i("8925"),c=function(){},u=o("Reflect","construct"),l=/^\s*(?:class|function)\b/,d=r(l.exec),f=!l.test(c),p=function(t){if(!s(t))return!1;try{return u(c,[],t),!0}catch(e){return!1}},g=function(t){if(!s(t))return!1;switch(a(t)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return f||!!d(l,h(t))}catch(e){return!0}};g.sham=!0,t.exports=!u||n((function(){var t;return p(p.call)||!p(Object)||!p((function(){t=!0}))||t}))?g:p},6964:function(t,e,i){"use strict";var r=i("cb2d");t.exports=function(t,e,i){for(var n in e)r(t,n,e[n],i);return t}},"697e":function(t,e,i){var r=i("de00"),n=i("22d1"),s=i("6d8b"),a=i("d2cf"),o=i("afa0"),h=i("ed21"),c=i("30a3"),u=i("cdaa"),l=!n.canvasSupported,d={canvas:h},f={},p="4.3.3";function g(t,e){var i=new _(r(),t,e);return f[i.id]=i,i}function m(t){if(t)t.dispose();else{for(var e in f)f.hasOwnProperty(e)&&f[e].dispose();f={}}return this}function v(t){return f[t]}function y(t,e){d[t]=e}function b(t){delete f[t]}var _=function(t,e,i){i=i||{},this.dom=e,this.id=t;var r=this,h=new o,f=i.renderer;if(l){if(!d.vml)throw new Error("You need to require 'zrender/vml/vml' to support IE8");f="vml"}else f&&d[f]||(f="canvas");var p=new d[f](e,h,i,t);this.storage=h,this.painter=p;var g=n.node||n.worker?null:new u(p.getViewportRoot(),p.root);this.handler=new a(h,p,g,p.root),this.animation=new c({stage:{update:s.bind(this.flush,this)}}),this.animation.start(),this._needsRefresh;var m=h.delFromStorage,v=h.addToStorage;h.delFromStorage=function(t){m.call(h,t),t&&t.removeSelfFromZr(r)},h.addToStorage=function(t){v.call(h,t),t.addSelfToZr(r)}};_.prototype={constructor:_,getId:function(){return this.id},add:function(t){this.storage.addRoot(t),this._needsRefresh=!0},remove:function(t){this.storage.delRoot(t),this._needsRefresh=!0},configLayer:function(t,e){this.painter.configLayer&&this.painter.configLayer(t,e),this._needsRefresh=!0},setBackgroundColor:function(t){this.painter.setBackgroundColor&&this.painter.setBackgroundColor(t),this._needsRefresh=!0},refreshImmediately:function(){this._needsRefresh=this._needsRefreshHover=!1,this.painter.refresh(),this._needsRefresh=this._needsRefreshHover=!1},refresh:function(){this._needsRefresh=!0},flush:function(){var t;this._needsRefresh&&(t=!0,this.refreshImmediately()),this._needsRefreshHover&&(t=!0,this.refreshHoverImmediately()),t&&this.trigger("rendered")},addHover:function(t,e){if(this.painter.addHover){var i=this.painter.addHover(t,e);return this.refreshHover(),i}},removeHover:function(t){this.painter.removeHover&&(this.painter.removeHover(t),this.refreshHover())},clearHover:function(){this.painter.clearHover&&(this.painter.clearHover(),this.refreshHover())},refreshHover:function(){this._needsRefreshHover=!0},refreshHoverImmediately:function(){this._needsRefreshHover=!1,this.painter.refreshHover&&this.painter.refreshHover()},resize:function(t){t=t||{},this.painter.resize(t.width,t.height),this.handler.resize()},clearAnimation:function(){this.animation.clear()},getWidth:function(){return this.painter.getWidth()},getHeight:function(){return this.painter.getHeight()},pathToImage:function(t,e){return this.painter.pathToImage(t,e)},setCursorStyle:function(t){this.handler.setCursorStyle(t)},findHover:function(t,e){return this.handler.findHover(t,e)},on:function(t,e,i){this.handler.on(t,e,i)},off:function(t,e){this.handler.off(t,e)},trigger:function(t,e){this.handler.trigger(t,e)},clear:function(){this.storage.delRoot(),this.painter.clear()},dispose:function(){this.animation.stop(),this.clear(),this.storage.dispose(),this.painter.dispose(),this.handler.dispose(),this.animation=this.storage=this.painter=this.handler=null,b(this.id)}},e.version=p,e.init=g,e.dispose=m,e.getInstance=v,e.registerPainter=y},"69f3":function(t,e,i){"use strict";var r,n,s,a=i("cdce"),o=i("cfe9"),h=i("861d"),c=i("9112"),u=i("1a2d"),l=i("c6cd"),d=i("f772"),f=i("d012"),p="Object already initialized",g=o.TypeError,m=o.WeakMap,v=function(t){return s(t)?n(t):r(t,{})},y=function(t){return function(e){var i;if(!h(e)||(i=n(e)).type!==t)throw new g("Incompatible receiver, "+t+" required");return i}};if(a||l.state){var b=l.state||(l.state=new m);b.get=b.get,b.has=b.has,b.set=b.set,r=function(t,e){if(b.has(t))throw new g(p);return e.facade=t,b.set(t,e),e},n=function(t){return b.get(t)||{}},s=function(t){return b.has(t)}}else{var _=d("state");f[_]=!0,r=function(t,e){if(u(t,_))throw new g(p);return e.facade=t,c(t,_,e),e},n=function(t){return u(t,_)?t[_]:{}},s=function(t){return u(t,_)}}t.exports={set:r,get:n,has:s,enforce:v,getterFor:y}},"6a29":function(t,e,i){"use strict";var r=i("6d3e").has;t.exports=function(t){return r(t),t}},"6a86":function(t,e,i){"use strict";var r=i("e330"),n=i("ebb5"),s=i("dfb9"),a=i("4673"),o=n.aTypedArray,h=n.getTypedArrayConstructor,c=n.exportTypedArrayMethod,u=r(a);c("uniqueBy",(function(t){return o(this),s(h(this),u(this,t))}),!0)},"6a8a":function(t,e,i){"use strict";var r=i("23e7"),n=i("f069");r({target:"Promise",stat:!0},{withResolvers:function(){var t=n.f(this);return{promise:t.promise,resolve:t.resolve,reject:t.reject}}})},"6a90":function(t,e,i){"use strict";var r=i("cfe9"),n=i("e065"),s=i("9bf2").f,a=i("06cf").f,o=r.Symbol;if(n("dispose"),o){var h=a(o,"dispose");h.enumerable&&h.configurable&&h.writable&&s(o,"dispose",{value:h.value,enumerable:!1,configurable:!1,writable:!1})}},"6b37":function(t,e,i){"use strict";var r=i("f5df"),n=TypeError;t.exports=function(t){if("Uint8Array"===r(t))return t;throw new n("Argument is not an Uint8Array")}},"6b93":function(t,e,i){"use strict";var r=i("23e7"),n=i("867a");r({target:"Math",stat:!0},{log10:n})},"6b99":function(t,e,i){"use strict";var r=i("23e7"),n=i("1d6f");r({target:"Iterator",proto:!0,real:!0,forced:!0},{indexed:n})},"6b9e":function(t,e,i){"use strict";var r=i("e065");r("search")},"6b9f":function(t,e,i){"use strict";var r=i("23e7");r({target:"Math",stat:!0,forced:!0},{umulh:function(t,e){var i=65535,r=+t,n=+e,s=r&i,a=n&i,o=r>>>16,h=n>>>16,c=(o*a>>>0)+(s*a>>>16);return o*h+(c>>>16)+((s*h>>>0)+(c&i)>>>16)}})},"6c57":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9");r({global:!0,forced:n.globalThis!==n},{globalThis:n})},"6ce5":function(t,e,i){"use strict";var r=i("df7e"),n=i("ebb5"),s=n.aTypedArray,a=n.exportTypedArrayMethod,o=n.getTypedArrayConstructor;a("toReversed",(function(){return r(s(this),o(this))}))},"6d08":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return function(e){var i=t,r=i.lib,n=r.CipherParams,s=i.enc,a=s.Hex,o=i.format;o.Hex={stringify:function(t){return t.ciphertext.toString(a)},parse:function(t){var e=a.parse(t);return n.create({ciphertext:e})}}}(),t.format.Hex}))},"6d3e":function(t,e,i){"use strict";var r=i("e330"),n=WeakMap.prototype;t.exports={WeakMap:WeakMap,set:r(n.set),get:r(n.get),has:r(n.has),remove:r(n["delete"])}},"6d54":function(t,e,i){"use strict";i("cb9e")},"6d61":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("e330"),a=i("94ca"),o=i("cb2d"),h=i("f183"),c=i("2266"),u=i("19aa"),l=i("1626"),d=i("7234"),f=i("861d"),p=i("d039"),g=i("1c7e"),m=i("d44e"),v=i("7156");t.exports=function(t,e,i){var y=-1!==t.indexOf("Map"),b=-1!==t.indexOf("Weak"),_=y?"set":"add",T=n[t],S=T&&T.prototype,w=T,E={},x=function(t){var e=s(S[t]);o(S,t,"add"===t?function(t){return e(this,0===t?0:t),this}:"delete"===t?function(t){return!(b&&!f(t))&&e(this,0===t?0:t)}:"get"===t?function(t){return b&&!f(t)?void 0:e(this,0===t?0:t)}:"has"===t?function(t){return!(b&&!f(t))&&e(this,0===t?0:t)}:function(t,i){return e(this,0===t?0:t,i),this})},A=a(t,!l(T)||!(b||S.forEach&&!p((function(){(new T).entries().next()}))));if(A)w=i.getConstructor(e,t,y,_),h.enable();else if(a(t,!0)){var C=new w,R=C[_](b?{}:-0,1)!==C,P=p((function(){C.has(1)})),I=g((function(t){new T(t)})),k=!b&&p((function(){var t=new T,e=5;while(e--)t[_](e,e);return!t.has(-0)}));I||(w=e((function(t,e){u(t,S);var i=v(new T,t,w);return d(e)||c(e,i[_],{that:i,AS_ENTRIES:y}),i})),w.prototype=S,S.constructor=w),(P||k)&&(x("delete"),x("has"),y&&x("get")),(k||R)&&x(_),b&&S.clear&&delete S.clear}return E[t]=w,r({global:!0,constructor:!0,forced:w!==T},E),m(w,t),b||i.setStrong(w,t,y),w}},"6d8b":function(t,e){var i={"[object Function]":1,"[object RegExp]":1,"[object Date]":1,"[object Error]":1,"[object CanvasGradient]":1,"[object CanvasPattern]":1,"[object Image]":1,"[object Canvas]":1},r={"[object Int8Array]":1,"[object Uint8Array]":1,"[object Uint8ClampedArray]":1,"[object Int16Array]":1,"[object Uint16Array]":1,"[object Int32Array]":1,"[object Uint32Array]":1,"[object Float32Array]":1,"[object Float64Array]":1},n=Object.prototype.toString,s=Array.prototype,a=s.forEach,o=s.filter,h=s.slice,c=s.map,u=s.reduce,l="__proto__",d={};function f(t,e){"createCanvas"===t&&(b=null),d[t]=e}function p(t){if(null==t||"object"!==typeof t)return t;var e=t,s=n.call(t);if("[object Array]"===s){if(!Q(t)){e=[];for(var a=0,o=t.length;ap)i=s[p++],r&&!(c?i in n:u(n,i))||l(g,t?[i,n[i]]:n[i]);return g}};t.exports={entries:f(!0),values:f(!1)}},"6fb5":function(t,e,i){"use strict";var r=i("e330"),n=i("59ed");t.exports=function(){return r(n(this))}},7039:function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("057f").f,a=n((function(){return!Object.getOwnPropertyNames(1)}));r({target:"Object",stat:!0,forced:a},{getOwnPropertyNames:s})},"70cc":function(t,e,i){"use strict";i("79a4")},"70e3":function(t,e,i){"use strict";var r=i("23e7"),n=i("1ebf"),s=i("abc1"),a=i("129f"),o=RangeError,h=Math.min,c=Math.max;r({target:"Math",stat:!0,forced:!0},{clamp:function(t,e,i){if(n(t),s(n(e)),s(n(i)),a(e,0)&&a(i,-0)||e>i)throw new o("`min` should be smaller than `max`");return h(i,c(e,t))}})},7149:function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("c430"),a=i("d256"),o=i("4738").CONSTRUCTOR,h=i("cdf9"),c=n("Promise"),u=s&&!o;r({target:"Promise",stat:!0,forced:s||o},{resolve:function(t){return h(u&&this===c?a:this,t)}})},7156:function(t,e,i){"use strict";var r=i("1626"),n=i("861d"),s=i("d2bb");t.exports=function(t,e,i){var a,o;return s&&r(a=e.constructor)&&a!==i&&n(o=a.prototype)&&o!==i.prototype&&s(t,o),t}},7192:function(t,e,i){"use strict";var r=i("cfe9"),n=i("e330"),s=i("f69d"),a=i("8a96"),o=i("1a2d"),h=i("b917"),c=i("da63"),u=i("2005"),l=h.c2i,d=h.c2iUrl,f=r.SyntaxError,p=r.TypeError,g=n("".charAt),m=function(t,e){for(var i=t.length;e>16&255,n>>8&255,255&n];if(2===r){if(i&&0!==s[1])throw new f("Extra bits");return[s[0]]}if(3===r){if(i&&0!==s[2])throw new f("Extra bits");return[s[0],s[1]]}return s},y=function(t,e,i){for(var r=e.length,n=0;n0){if("stop-before-partial"===h)break;if("loose"!==h)throw new f("Missing padding");if(1===S.length)throw new f("Malformed padding: exactly one additional character");_=y(b,v(S,n,!1),_)}T=t.length;break}var E=g(t,w);if(++w,"="===E){if(S.length<2)throw new f("Padding is too early");if(w=m(t,w),2===S.length){if(w===t.length){if("stop-before-partial"===h)break;throw new f("Malformed padding: only one =")}"="===g(t,w)&&(++w,w=m(t,w))}if(w1?arguments[1]:void 0)}}),s("findLastIndex")},"71f8":function(t,e,i){"use strict";var r=i("23e7"),n=i("6a29"),s=i("6d3e").remove;r({target:"WeakMap",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),i=!0,r=0,a=arguments.length;r1?arguments[1]:void 0),r=new h;return o(e,(function(t){c(r,i(t,t,e))})),r}})},"72f7":function(t,e,i){"use strict";var r=i("ebb5").exportTypedArrayMethod,n=i("d039"),s=i("cfe9"),a=i("e330"),o=s.Uint8Array,h=o&&o.prototype||{},c=[].toString,u=a([].join);n((function(){c.call({})}))&&(c=function(){return u(this)});var l=h.toString!==c;r("toString",c,l)},"72fe":function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(e){var i=t,r=i.lib,n=r.WordArray,s=r.Hasher,a=i.algo,o=[];(function(){for(var t=0;t<64;t++)o[t]=4294967296*e.abs(e.sin(t+1))|0})();var h=a.MD5=s.extend({_doReset:function(){this._hash=new n.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(t,e){for(var i=0;i<16;i++){var r=e+i,n=t[r];t[r]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8)}var s=this._hash.words,a=t[e+0],h=t[e+1],f=t[e+2],p=t[e+3],g=t[e+4],m=t[e+5],v=t[e+6],y=t[e+7],b=t[e+8],_=t[e+9],T=t[e+10],S=t[e+11],w=t[e+12],E=t[e+13],x=t[e+14],A=t[e+15],C=s[0],R=s[1],P=s[2],I=s[3];C=c(C,R,P,I,a,7,o[0]),I=c(I,C,R,P,h,12,o[1]),P=c(P,I,C,R,f,17,o[2]),R=c(R,P,I,C,p,22,o[3]),C=c(C,R,P,I,g,7,o[4]),I=c(I,C,R,P,m,12,o[5]),P=c(P,I,C,R,v,17,o[6]),R=c(R,P,I,C,y,22,o[7]),C=c(C,R,P,I,b,7,o[8]),I=c(I,C,R,P,_,12,o[9]),P=c(P,I,C,R,T,17,o[10]),R=c(R,P,I,C,S,22,o[11]),C=c(C,R,P,I,w,7,o[12]),I=c(I,C,R,P,E,12,o[13]),P=c(P,I,C,R,x,17,o[14]),R=c(R,P,I,C,A,22,o[15]),C=u(C,R,P,I,h,5,o[16]),I=u(I,C,R,P,v,9,o[17]),P=u(P,I,C,R,S,14,o[18]),R=u(R,P,I,C,a,20,o[19]),C=u(C,R,P,I,m,5,o[20]),I=u(I,C,R,P,T,9,o[21]),P=u(P,I,C,R,A,14,o[22]),R=u(R,P,I,C,g,20,o[23]),C=u(C,R,P,I,_,5,o[24]),I=u(I,C,R,P,x,9,o[25]),P=u(P,I,C,R,p,14,o[26]),R=u(R,P,I,C,b,20,o[27]),C=u(C,R,P,I,E,5,o[28]),I=u(I,C,R,P,f,9,o[29]),P=u(P,I,C,R,y,14,o[30]),R=u(R,P,I,C,w,20,o[31]),C=l(C,R,P,I,m,4,o[32]),I=l(I,C,R,P,b,11,o[33]),P=l(P,I,C,R,S,16,o[34]),R=l(R,P,I,C,x,23,o[35]),C=l(C,R,P,I,h,4,o[36]),I=l(I,C,R,P,g,11,o[37]),P=l(P,I,C,R,y,16,o[38]),R=l(R,P,I,C,T,23,o[39]),C=l(C,R,P,I,E,4,o[40]),I=l(I,C,R,P,a,11,o[41]),P=l(P,I,C,R,p,16,o[42]),R=l(R,P,I,C,v,23,o[43]),C=l(C,R,P,I,_,4,o[44]),I=l(I,C,R,P,w,11,o[45]),P=l(P,I,C,R,A,16,o[46]),R=l(R,P,I,C,f,23,o[47]),C=d(C,R,P,I,a,6,o[48]),I=d(I,C,R,P,y,10,o[49]),P=d(P,I,C,R,x,15,o[50]),R=d(R,P,I,C,m,21,o[51]),C=d(C,R,P,I,w,6,o[52]),I=d(I,C,R,P,p,10,o[53]),P=d(P,I,C,R,T,15,o[54]),R=d(R,P,I,C,h,21,o[55]),C=d(C,R,P,I,b,6,o[56]),I=d(I,C,R,P,A,10,o[57]),P=d(P,I,C,R,v,15,o[58]),R=d(R,P,I,C,E,21,o[59]),C=d(C,R,P,I,g,6,o[60]),I=d(I,C,R,P,S,10,o[61]),P=d(P,I,C,R,f,15,o[62]),R=d(R,P,I,C,_,21,o[63]),s[0]=s[0]+C|0,s[1]=s[1]+R|0,s[2]=s[2]+P|0,s[3]=s[3]+I|0},_doFinalize:function(){var t=this._data,i=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;i[n>>>5]|=128<<24-n%32;var s=e.floor(r/4294967296),a=r;i[15+(n+64>>>9<<4)]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),i[14+(n+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(i.length+1),this._process();for(var o=this._hash,h=o.words,c=0;c<4;c++){var u=h[c];h[c]=16711935&(u<<8|u>>>24)|4278255360&(u<<24|u>>>8)}return o},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});function c(t,e,i,r,n,s,a){var o=t+(e&i|~e&r)+n+a;return(o<>>32-s)+e}function u(t,e,i,r,n,s,a){var o=t+(e&r|i&~r)+n+a;return(o<>>32-s)+e}function l(t,e,i,r,n,s,a){var o=t+(e^i^r)+n+a;return(o<>>32-s)+e}function d(t,e,i,r,n,s,a){var o=t+(i^(e|~r))+n+a;return(o<>>32-s)+e}i.MD5=s._createHelper(h),i.HmacMD5=s._createHmacHelper(h)}(Math),t.MD5}))},"735e":function(t,e,i){"use strict";var r=i("ebb5"),n=i("81d5"),s=i("f495"),a=i("f5df"),o=i("c65b"),h=i("e330"),c=i("d039"),u=r.aTypedArray,l=r.exportTypedArrayMethod,d=h("".slice),f=c((function(){var t=0;return new Int8Array(2).fill({valueOf:function(){return t++}}),1!==t}));l("fill",(function(t){var e=arguments.length;u(this);var i="Big"===d(a(this),0,3)?s(t):+t;return o(n,this,i,e>1?arguments[1]:void 0,e>2?arguments[2]:void 0)}),f)},"73d9":function(t,e,i){"use strict";var r=i("44d2");r("flatMap")},7418:function(t,e,i){"use strict";e.f=Object.getOwnPropertySymbols},"74cb":function(t,e){var i={linear:function(t){return t},quadraticIn:function(t){return t*t},quadraticOut:function(t){return t*(2-t)},quadraticInOut:function(t){return(t*=2)<1?.5*t*t:-.5*(--t*(t-2)-1)},cubicIn:function(t){return t*t*t},cubicOut:function(t){return--t*t*t+1},cubicInOut:function(t){return(t*=2)<1?.5*t*t*t:.5*((t-=2)*t*t+2)},quarticIn:function(t){return t*t*t*t},quarticOut:function(t){return 1- --t*t*t*t},quarticInOut:function(t){return(t*=2)<1?.5*t*t*t*t:-.5*((t-=2)*t*t*t-2)},quinticIn:function(t){return t*t*t*t*t},quinticOut:function(t){return--t*t*t*t*t+1},quinticInOut:function(t){return(t*=2)<1?.5*t*t*t*t*t:.5*((t-=2)*t*t*t*t+2)},sinusoidalIn:function(t){return 1-Math.cos(t*Math.PI/2)},sinusoidalOut:function(t){return Math.sin(t*Math.PI/2)},sinusoidalInOut:function(t){return.5*(1-Math.cos(Math.PI*t))},exponentialIn:function(t){return 0===t?0:Math.pow(1024,t-1)},exponentialOut:function(t){return 1===t?1:1-Math.pow(2,-10*t)},exponentialInOut:function(t){return 0===t?0:1===t?1:(t*=2)<1?.5*Math.pow(1024,t-1):.5*(2-Math.pow(2,-10*(t-1)))},circularIn:function(t){return 1-Math.sqrt(1-t*t)},circularOut:function(t){return Math.sqrt(1- --t*t)},circularInOut:function(t){return(t*=2)<1?-.5*(Math.sqrt(1-t*t)-1):.5*(Math.sqrt(1-(t-=2)*t)+1)},elasticIn:function(t){var e,i=.1,r=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=r/4):e=r*Math.asin(1/i)/(2*Math.PI),-i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r))},elasticOut:function(t){var e,i=.1,r=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=r/4):e=r*Math.asin(1/i)/(2*Math.PI),i*Math.pow(2,-10*t)*Math.sin((t-e)*(2*Math.PI)/r)+1)},elasticInOut:function(t){var e,i=.1,r=.4;return 0===t?0:1===t?1:(!i||i<1?(i=1,e=r/4):e=r*Math.asin(1/i)/(2*Math.PI),(t*=2)<1?i*Math.pow(2,10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*-.5:i*Math.pow(2,-10*(t-=1))*Math.sin((t-e)*(2*Math.PI)/r)*.5+1)},backIn:function(t){var e=1.70158;return t*t*((e+1)*t-e)},backOut:function(t){var e=1.70158;return--t*t*((e+1)*t+e)+1},backInOut:function(t){var e=2.5949095;return(t*=2)<1?t*t*((e+1)*t-e)*.5:.5*((t-=2)*t*((e+1)*t+e)+2)},bounceIn:function(t){return 1-i.bounceOut(1-t)},bounceOut:function(t){return t<1/2.75?7.5625*t*t:t<2/2.75?7.5625*(t-=1.5/2.75)*t+.75:t<2.5/2.75?7.5625*(t-=2.25/2.75)*t+.9375:7.5625*(t-=2.625/2.75)*t+.984375},bounceInOut:function(t){return t<.5?.5*i.bounceIn(2*t):.5*i.bounceOut(2*t-1)+.5}},r=i;t.exports=r},"74d4":function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("dc19"),a=i("384f");r({target:"Set",proto:!0,real:!0,forced:!0},{every:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0);return!1!==a(e,(function(t){if(!i(t,t,e))return!1}),!0)}})},"74e8":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("c65b"),a=i("83ab"),o=i("8aa7"),h=i("ebb5"),c=i("621a"),u=i("19aa"),l=i("5c6c"),d=i("9112"),f=i("eac5"),p=i("50c4"),g=i("0b25"),m=i("182d"),v=i("13a6"),y=i("a04b"),b=i("1a2d"),_=i("f5df"),T=i("861d"),S=i("d9b5"),w=i("7c73"),E=i("3a9b"),x=i("d2bb"),A=i("241c").f,C=i("a078"),R=i("b727").forEach,P=i("2626"),I=i("edd0"),k=i("9bf2"),D=i("06cf"),O=i("dfb9"),M=i("69f3"),N=i("7156"),B=M.get,L=M.set,U=M.enforce,z=k.f,F=D.f,W=n.RangeError,H=c.ArrayBuffer,j=H.prototype,V=c.DataView,q=h.NATIVE_ARRAY_BUFFER_VIEWS,G=h.TYPED_ARRAY_TAG,Y=h.TypedArray,$=h.TypedArrayPrototype,X=h.isTypedArray,Q="BYTES_PER_ELEMENT",K="Wrong length",Z=function(t,e){I(t,e,{configurable:!0,get:function(){return B(this)[e]}})},J=function(t){var e;return E(j,t)||"ArrayBuffer"===(e=_(t))||"SharedArrayBuffer"===e},tt=function(t,e){return X(t)&&!S(e)&&e in t&&f(+e)&&e>=0},et=function(t,e){return e=y(e),tt(t,e)?l(2,t[e]):F(t,e)},it=function(t,e,i){return e=y(e),!(tt(t,e)&&T(i)&&b(i,"value"))||b(i,"get")||b(i,"set")||i.configurable||b(i,"writable")&&!i.writable||b(i,"enumerable")&&!i.enumerable?z(t,e,i):(t[e]=i.value,t)};a?(q||(D.f=et,k.f=it,Z($,"buffer"),Z($,"byteOffset"),Z($,"byteLength"),Z($,"length")),r({target:"Object",stat:!0,forced:!q},{getOwnPropertyDescriptor:et,defineProperty:it}),t.exports=function(t,e,i){var a=t.match(/\d+/)[0]/8,h=t+(i?"Clamped":"")+"Array",c="get"+t,l="set"+t,f=n[h],y=f,b=y&&y.prototype,_={},S=function(t,e){var i=B(t);return i.view[c](e*a+i.byteOffset,!0)},E=function(t,e,r){var n=B(t);n.view[l](e*a+n.byteOffset,i?v(r):r,!0)},I=function(t,e){z(t,e,{get:function(){return S(this,e)},set:function(t){return E(this,e,t)},enumerable:!0})};q?o&&(y=e((function(t,e,i,r){return u(t,b),N(function(){return T(e)?J(e)?void 0!==r?new f(e,m(i,a),r):void 0!==i?new f(e,m(i,a)):new f(e):X(e)?O(y,e):s(C,y,e):new f(g(e))}(),t,y)})),x&&x(y,Y),R(A(f),(function(t){t in y||d(y,t,f[t])})),y.prototype=b):(y=e((function(t,e,i,r){u(t,b);var n,o,h,c=0,l=0;if(T(e)){if(!J(e))return X(e)?O(y,e):s(C,y,e);n=e,l=m(i,a);var d=e.byteLength;if(void 0===r){if(d%a)throw new W(K);if(o=d-l,o<0)throw new W(K)}else if(o=p(r)*a,o+l>d)throw new W(K);h=o/a}else h=g(e),o=h*a,n=new H(o);L(t,{buffer:n,byteOffset:l,byteLength:o,length:h,view:new V(n)});while(cT;T++)g=v[T],p=o(y(g,T,m)),p in b?d(b[p],g):b[p]=[g];if(n&&(f=n(m),f!==l))for(p in b)b[p]=u(f,b[p]);return b}},7709:function(t,e,i){"use strict";var r=i("f5df"),n=TypeError;t.exports=function(t){if("DataView"===r(t))return t;throw new n("Argument is not a DataView")}},"77a7":function(t,e,i){"use strict";var r=Array,n=Math.abs,s=Math.pow,a=Math.floor,o=Math.log,h=Math.LN2,c=function(t,e,i){var c,u,l,d=r(i),f=8*i-e-1,p=(1<>1,m=23===e?s(2,-24)-s(2,-77):0,v=t<0||0===t&&1/t<0?1:0,y=0;t=n(t),t!==t||t===1/0?(u=t!==t?1:0,c=p):(c=a(o(t)/h),l=s(2,-c),t*l<1&&(c--,l*=2),t+=c+g>=1?m/l:m*s(2,1-g),t*l>=2&&(c++,l/=2),c+g>=p?(u=0,c=p):c+g>=1?(u=(t*l-1)*s(2,e),c+=g):(u=t*s(2,g-1)*s(2,e),c=0));while(e>=8)d[y++]=255&u,u/=256,e-=8;c=c<0)d[y++]=255&c,c/=256,f-=8;return d[y-1]|=128*v,d},u=function(t,e){var i,r=t.length,n=8*r-e-1,a=(1<>1,h=n-7,c=r-1,u=t[c--],l=127&u;u>>=7;while(h>0)l=256*l+t[c--],h-=8;i=l&(1<<-h)-1,l>>=-h,h+=e;while(h>0)i=256*i+t[c--],h-=8;if(0===l)l=1-o;else{if(l===a)return i?NaN:u?-1/0:1/0;i+=s(2,e),l-=o}return(u?-1:1)*i*s(2,l-e)};t.exports={pack:c,unpack:u}},"77d9":function(t,e,i){"use strict";i("1d02")},7839:function(t,e,i){"use strict";t.exports=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"]},"783c":function(t,e,i){"use strict";i("4ec9"),i("10d1");var r=i("d066"),n=i("e330"),s=i("5692"),a=r("Map"),o=r("WeakMap"),h=n([].push),c=s("metadata"),u=c.store||(c.store=new o),l=function(t,e,i){var r=u.get(t);if(!r){if(!i)return;u.set(t,r=new a)}var n=r.get(e);if(!n){if(!i)return;r.set(e,n=new a)}return n},d=function(t,e,i){var r=l(e,i,!1);return void 0!==r&&r.has(t)},f=function(t,e,i){var r=l(e,i,!1);return void 0===r?void 0:r.get(t)},p=function(t,e,i,r){l(i,r,!0).set(t,e)},g=function(t,e){var i=l(t,e,!1),r=[];return i&&i.forEach((function(t,e){h(r,e)})),r},m=function(t){return void 0===t||"symbol"==typeof t?t:String(t)};t.exports={store:u,getMap:l,has:d,get:f,set:p,keys:g,toKey:m}},"785a":function(t,e,i){"use strict";var r=i("cc12"),n=r("span").classList,s=n&&n.constructor&&n.constructor.prototype;t.exports=s===Object.prototype?void 0:s},7898:function(t,e,i){"use strict";var r=i("23e7"),n=i("8eb5"),s=Math.exp;r({target:"Math",stat:!0},{tanh:function(t){var e=+t,i=n(e),r=n(-e);return i===1/0?1:r===1/0?-1:(i-r)/(s(e)+s(-e))}})},"78ed":function(t,e,i){"use strict";var r=i("23e7");r({target:"Math",stat:!0,forced:!0},{imulh:function(t,e){var i=65535,r=+t,n=+e,s=r&i,a=n&i,o=r>>16,h=n>>16,c=(o*a>>>0)+(s*a>>>16);return o*h+(c>>16)+((s*h>>>0)+(c&i)>>16)}})},"796d":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("825a"),o=i("46c4"),h=i("34e1"),c=i("c5cc"),u=i("2a62"),l=i("c430"),d=c((function(){var t,e,i=this.iterator,r=this.mapper;while(1){if(e=this.inner)try{if(t=a(n(e.next,e.iterator)),!t.done)return t.value;this.inner=null}catch(s){u(i,"throw",s)}if(t=a(n(this.next,i)),this.done=!!t.done)return;try{this.inner=h(r(t.value,this.counter++),!1)}catch(s){u(i,"throw",s)}}}));r({target:"Iterator",proto:!0,real:!0,forced:l},{flatMap:function(t){return a(this),s(t),new d(o(this),{mapper:t,inner:null})}})},"79a4":function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("953b"),a=i("dad2"),o=!a("intersection",(function(t){return 2===t.size&&t.has(1)&&t.has(2)}))||n((function(){return"3,2"!==String(Array.from(new Set([1,2,3]).intersection(new Set([3,2]))))}));r({target:"Set",proto:!0,real:!0,forced:o},{intersection:s})},"79a8":function(t,e,i){"use strict";var r=i("23e7"),n=Math.asinh,s=Math.log,a=Math.sqrt;function o(t){var e=+t;return isFinite(e)&&0!==e?e<0?-o(-e):s(e+a(e*e+1)):e}var h=!(n&&1/n(0)>0);r({target:"Math",stat:!0,forced:h},{asinh:o})},"7a5b":function(t,e,i){"use strict";var r=i("23e7"),n=i("68ee");r({target:"Function",stat:!0,forced:!0},{isConstructor:n})},"7a77":function(t,e,i){"use strict";function r(t){this.message=t}r.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},r.prototype.__CANCEL__=!0,t.exports=r},"7a82":function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("9bf2").f;r({target:"Object",stat:!0,forced:Object.defineProperty!==s,sham:!n},{defineProperty:s})},"7aac":function(t,e,i){"use strict";var r=i("c532");t.exports=r.isStandardBrowserEnv()?function(){return{write:function(t,e,i,n,s,a){var o=[];o.push(t+"="+encodeURIComponent(e)),r.isNumber(i)&&o.push("expires="+new Date(i).toGMTString()),r.isString(n)&&o.push("path="+n),r.isString(s)&&o.push("domain="+s),!0===a&&o.push("secure"),document.cookie=o.join("; ")},read:function(t){var e=document.cookie.match(new RegExp("(^|;\\s*)("+t+")=([^;]*)"));return e?decodeURIComponent(e[3]):null},remove:function(t){this.write(t,"",Date.now()-864e5)}}}():function(){return{write:function(){},read:function(){return null},remove:function(){}}}()},"7b0b":function(t,e,i){"use strict";var r=i("1d80"),n=Object;t.exports=function(t){return n(r(t))}},"7b8b":function(t,e,i){"use strict";var r=i("23e7"),n=i("a542"),s=i("c430");r({target:"AsyncIterator",proto:!0,real:!0,forced:s},{map:n})},"7bbc":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("94f8"),i("5980"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.Base,n=i.WordArray,s=e.algo,a=s.SHA256,o=s.HMAC,h=s.PBKDF2=r.extend({cfg:r.extend({keySize:4,hasher:a,iterations:25e4}),init:function(t){this.cfg=this.cfg.extend(t)},compute:function(t,e){var i=this.cfg,r=o.create(i.hasher,t),s=n.create(),a=n.create([1]),h=s.words,c=a.words,u=i.keySize,l=i.iterations;while(h.length",d="<",f="prototype",p="script",g=u("IE_PROTO"),m=function(){},v=function(t){return d+p+l+t+d+"/"+p+l},y=function(t){t.write(v("")),t.close();var e=t.parentWindow.Object;return t=null,e},b=function(){var t,e=c("iframe"),i="java"+p+":";return e.style.display="none",h.appendChild(e),e.src=String(i),t=e.contentWindow.document,t.open(),t.write(v("document.F=Object")),t.close(),t.F},_=function(){try{r=new ActiveXObject("htmlfile")}catch(e){}_="undefined"!=typeof document?document.domain&&r?y(r):b():y(r);var t=a.length;while(t--)delete _[f][a[t]];return _()};o[g]=!0,t.exports=Object.create||function(t,e){var i;return null!==t?(m[f]=n(t),i=new m,m[f]=null,i[g]=t):i=_(),void 0===e?i:s.f(i,e)}},"7cdf":function(t,e,i){"use strict";var r=i("23e7"),n=i("6547").charAt,s=i("1d80"),a=i("5926"),o=i("577e");r({target:"String",proto:!0,forced:!0},{at:function(t){var e=o(s(this)),i=e.length,r=a(t),h=r>=0?r:i+r;return h<0||h>=i?void 0:n(e,h)}})},"7d4a":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("e330"),a=i("1d80"),o=i("577e"),h=i("d039"),c=Array,u=s("".charAt),l=s("".charCodeAt),d=s([].join),f="".toWellFormed,p="�",g=f&&h((function(){return"1"!==n(f,1)}));r({target:"String",proto:!0,forced:g},{toWellFormed:function(){var t=o(a(this));if(g)return n(f,t);for(var e=t.length,i=c(e),r=0;r=56320||r+1>=e||56320!==(64512&l(t,r+1))?i[r]=p:(i[r]=u(t,r),i[++r]=u(t,r))}return d(i,"")}})},"7d54":function(t,e,i){"use strict";var r=i("23e7"),n=i("2266"),s=i("59ed"),a=i("825a"),o=i("46c4");r({target:"Iterator",proto:!0,real:!0},{forEach:function(t){a(this),s(t);var e=o(this),i=0;n(e,(function(e){t(e,i++)}),{IS_RECORD:!0})}})},"7d6d":function(t,e){var i={shadowBlur:1,shadowOffsetX:1,shadowOffsetY:1,textShadowBlur:1,textShadowOffsetX:1,textShadowOffsetY:1,textBoxShadowBlur:1,textBoxShadowOffsetX:1,textBoxShadowOffsetY:1};function r(t,e,r){return i.hasOwnProperty(e)?r*t.dpr:r}t.exports=r},"7db0":function(t,e,i){"use strict";var r=i("23e7"),n=i("b727").find,s=i("44d2"),a="find",o=!0;a in[]&&Array(1)[a]((function(){o=!1})),r({target:"Array",proto:!0,forced:o},{find:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s(a)},"7e12":function(t,e,i){"use strict";var r=i("cfe9"),n=i("d039"),s=i("e330"),a=i("577e"),o=i("58a8").trim,h=i("5899"),c=s("".charAt),u=r.parseFloat,l=r.Symbol,d=l&&l.iterator,f=1/u(h+"-0")!==-1/0||d&&!n((function(){u(Object(d))}));t.exports=f?function(t){var e=o(a(t)),i=u(e);return 0===i&&"-"===c(e,0)?-0:i}:u},"7e25":function(t,e,i){"use strict";var r,n="object"===typeof Reflect?Reflect:null,s=n&&"function"===typeof n.apply?n.apply:function(t,e,i){return Function.prototype.apply.call(t,e,i)};function a(t){console&&console.warn&&console.warn(t)}r=n&&"function"===typeof n.ownKeys?n.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!==t};function h(){h.init.call(this)}t.exports=h,t.exports.once=_,h.EventEmitter=h,h.prototype._events=void 0,h.prototype._eventsCount=0,h.prototype._maxListeners=void 0;var c=10;function u(t){if("function"!==typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?h.defaultMaxListeners:t._maxListeners}function d(t,e,i,r){var n,s,o;if(u(i),s=t._events,void 0===s?(s=t._events=Object.create(null),t._eventsCount=0):(void 0!==s.newListener&&(t.emit("newListener",e,i.listener?i.listener:i),s=t._events),o=s[e]),void 0===o)o=s[e]=i,++t._eventsCount;else if("function"===typeof o?o=s[e]=r?[i,o]:[o,i]:r?o.unshift(i):o.push(i),n=l(t),n>0&&o.length>n&&!o.warned){o.warned=!0;var h=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");h.name="MaxListenersExceededWarning",h.emitter=t,h.type=e,h.count=o.length,a(h)}return t}function f(){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(t,e,i){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:i},n=f.bind(r);return n.listener=i,r.wrapFn=n,n}function g(t,e,i){var r=t._events;if(void 0===r)return[];var n=r[e];return void 0===n?[]:"function"===typeof n?i?[n.listener||n]:[n]:i?b(n):v(n,n.length)}function m(t){var e=this._events;if(void 0!==e){var i=e[t];if("function"===typeof i)return 1;if(void 0!==i)return i.length}return 0}function v(t,e){for(var i=new Array(e),r=0;r0&&(a=e[0]),a instanceof Error)throw a;var o=new Error("Unhandled error."+(a?" ("+a.message+")":""));throw o.context=a,o}var h=n[t];if(void 0===h)return!1;if("function"===typeof h)s(h,this,e);else{var c=h.length,u=v(h,c);for(i=0;i=0;s--)if(i[s]===e||i[s].listener===e){a=i[s].listener,n=s;break}if(n<0)return this;0===n?i.shift():y(i,n),1===i.length&&(r[t]=i[0]),void 0!==r.removeListener&&this.emit("removeListener",t,a||e)}return this},h.prototype.off=h.prototype.removeListener,h.prototype.removeAllListeners=function(t){var e,i,r;if(i=this._events,void 0===i)return this;if(void 0===i.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==i[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete i[t]),this;if(0===arguments.length){var n,s=Object.keys(i);for(r=0;r=0;r--)this.removeListener(t,e[r]);return this},h.prototype.listeners=function(t){return g(this,t,!0)},h.prototype.rawListeners=function(t){return g(this,t,!1)},h.listenerCount=function(t,e){return"function"===typeof t.listenerCount?t.listenerCount(e):m.call(t,e)},h.prototype.listenerCount=m,h.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},"7ed3":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("825a"),a=i("861d"),o=i("c60d"),h=i("d039"),c=i("9bf2"),u=i("06cf"),l=i("e163"),d=i("5c6c");function f(t,e,i){var r,h,p,g=arguments.length<4?t:arguments[3],m=u.f(s(t),e);if(!m){if(a(h=l(t)))return f(h,e,i,g);m=d(0)}if(o(m)){if(!1===m.writable||!a(g))return!1;if(r=u.f(g,e)){if(r.get||r.set||!1===r.writable)return!1;r.value=i,c.f(g,e,r)}else c.f(g,e,d(0,i))}else{if(p=m.set,void 0===p)return!1;n(p,g,i)}return!0}var p=h((function(){var t=function(){},e=c.f(new t,"a",{configurable:!0});return!1!==Reflect.set(t.prototype,"a",1,e)}));r({target:"Reflect",stat:!0,forced:p},{set:f})},"7f65":function(t,e,i){"use strict";var r=i("59ed"),n=i("825a"),s=i("c65b"),a=i("5926"),o=i("46c4"),h="Invalid size",c=RangeError,u=TypeError,l=Math.max,d=function(t,e){this.set=t,this.size=l(e,0),this.has=r(t.has),this.keys=r(t.keys)};d.prototype={getIterator:function(){return o(n(s(this.keys,this.set)))},includes:function(t){return s(this.has,this.set,t)}},t.exports=function(t){n(t);var e=+t.size;if(e!==e)throw new u(h);var i=a(e);if(i<0)throw new c(h);return new d(t,i)}},"7f78":function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("e163"),a=i("e177");r({target:"Reflect",stat:!0,sham:!a},{getPrototypeOf:function(t){return s(n(t))}})},"7fc3":function(t,e,i){"use strict";i("c8d1")},8009:function(t,e,i){"use strict";var r=i("e065");r("replaceAll")},"802d":function(t,e,i){"use strict";var r=i("23e7"),n=i("a8d7");r({target:"String",stat:!0,forced:!0},{cooked:n})},"80e0":function(t,e,i){"use strict";var r=i("e065");r("replace")},8104:function(t,e,i){var r=i("ea85");function n(t){this.buffer=t,this.offset=0}n.prototype.nextInt16BE=function(){var t=this.buffer.readInt16BE(this.offset);return this.offset+=2,t},n.prototype.nextUInt8=function(){var t=this.buffer.readUInt8(this.offset);return this.offset+=1,t},n.prototype.nextUIntV=function(){var t=r(this.buffer,this.offset);return this.offset+=t.length,t.value},n.prototype.nextIntV=function(){var t=r(this.buffer,this.offset,!0);return this.offset+=t.length,t.value},n.prototype.nextBuffer=function(t){var e=t?this.buffer.slice(this.offset,this.offset+t):this.buffer.slice(this.offset);return this.offset+=t||this.length,e},Object.defineProperty(n.prototype,"length",{get:function(){return this.buffer.length-this.offset}}),t.exports=n},8172:function(t,e,i){"use strict";var r=i("e065"),n=i("57b9");r("toPrimitive"),n()},8182:function(t,e,i){"use strict";var r=i("23e7"),n=i("2ba4"),s=i("a799"),a=i("d066"),o=i("7c73"),h=Object,c=function(){var t=a("Object","freeze");return t?t(o(null)):o(null)};r({global:!0,forced:!0},{compositeKey:function(){return n(s,h,arguments).get("object",c)}})},"81ae":function(t,e,i){"use strict";var r=i("23e7"),n=i("6fb5");r({target:"Function",proto:!0,forced:!0},{demethodize:n})},"81b2":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("d066"),a=i("e330"),o=i("c65b"),h=i("d039"),c=i("577e"),u=i("d6d6"),l=i("b917").c2i,d=/[^\d+/a-z]/i,f=/[\t\n\f\r ]+/g,p=/[=]{1,2}$/,g=s("atob"),m=String.fromCharCode,v=a("".charAt),y=a("".replace),b=a(d.exec),_=!!g&&!h((function(){return"hi"!==g("aGk=")})),T=_&&h((function(){return""!==g(" ")})),S=_&&!h((function(){g("a")})),w=_&&!h((function(){g()})),E=_&&1!==g.length,x=!_||T||S||w||E;r({global:!0,bind:!0,enumerable:!0,forced:x},{atob:function(t){if(u(arguments.length,1),_&&!T&&!S)return o(g,n,t);var e,i,r,a=y(c(t),f,""),h="",w=0,E=0;if(a.length%4===0&&(a=y(a,p,"")),e=a.length,e%4===1||b(d,a))throw new(s("DOMException"))("The string is not correctly encoded","InvalidCharacterError");while(w>(-2*E&6)));return h}})},"81b8":function(t,e,i){"use strict";var r=i("e065");r("unscopables")},"81bc":function(t,e,i){"use strict";var r=i("c65b"),n=i("cb2d"),s=i("dc4a"),a=i("1a2d"),o=i("b622"),h=i("ae93").IteratorPrototype,c=o("dispose");a(h,c)||n(h,c,(function(){var t=s(this,"return");t&&r(t,this)}))},"81bf":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.mode.ECB=function(){var e=t.lib.BlockCipherMode.extend();return e.Encryptor=e.extend({processBlock:function(t,e){this._cipher.encryptBlock(t,e)}}),e.Decryptor=e.extend({processBlock:function(t,e){this._cipher.decryptBlock(t,e)}}),e}(),t.mode.ECB}))},"81d5":function(t,e,i){"use strict";var r=i("7b0b"),n=i("23cb"),s=i("07fa");t.exports=function(t){var e=r(this),i=s(e),a=arguments.length,o=n(a>1?arguments[1]:void 0,i),h=a>2?arguments[2]:void 0,c=void 0===h?i:n(h,i);while(c>o)e[o++]=t;return e}},"820e":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("f069"),o=i("e667"),h=i("2266"),c=i("5eed");r({target:"Promise",stat:!0,forced:c},{allSettled:function(t){var e=this,i=a.f(e),r=i.resolve,c=i.reject,u=o((function(){var i=s(e.resolve),a=[],o=0,c=1;h(t,(function(t){var s=o++,h=!1;c++,n(i,e,t).then((function(t){h||(h=!0,a[s]={status:"fulfilled",value:t},--c||r(a))}),(function(t){h||(h=!0,a[s]={status:"rejected",reason:t},--c||r(a))}))})),--c||r(a)}));return u.error&&c(u.value),i.promise}})},"825a":function(t,e,i){"use strict";var r=i("861d"),n=String,s=TypeError;t.exports=function(t){if(r(t))return t;throw new s(n(t)+" is not an object")}},8260:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("825a"),o=i("861d"),h=i("d066"),c=i("46c4"),u=i("3436"),l=h("Promise"),d=TypeError;r({target:"AsyncIterator",proto:!0,real:!0},{reduce:function(t){a(this),s(t);var e=c(this),i=e.iterator,r=e.next,h=arguments.length<2,f=h?void 0:arguments[1],p=0;return new l((function(e,s){var c=function(t){u(i,s,t,s)},g=function(){try{l.resolve(a(n(r,i))).then((function(i){try{if(a(i).done)h?s(new d("Reduce of empty iterator with no initial value")):e(f);else{var r=i.value;if(h)h=!1,f=r,g();else try{var n=t(f,r,p),u=function(t){f=t,g()};o(n)?l.resolve(n).then(u,c):u(n)}catch(m){c(m)}}p++}catch(v){s(v)}}),s)}catch(u){s(u)}};g()}))}})},"82da":function(t,e,i){"use strict";var r=i("23e7"),n=i("ebb5"),s=n.NATIVE_ARRAY_BUFFER_VIEWS;r({target:"ArrayBuffer",stat:!0,forced:!s},{isView:n.isView})},"82e3":function(t,e,i){"use strict";var r=2220446049250313e-31,n=1/r;t.exports=function(t){return t+n-n}},"82eb":function(t,e){var i={NONE:0,STYLE_BIND:1,PLAIN_TEXT:2},r=9;e.ContextCachedBy=i,e.WILL_BE_RESTORED=r},"82f8":function(t,e,i){"use strict";var r=i("ebb5"),n=i("4d64").includes,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("includes",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},8306:function(t,e,i){"use strict";i("72c3")},"83ab":function(t,e,i){"use strict";var r=i("d039");t.exports=!r((function(){return 7!==Object.defineProperty({},1,{get:function(){return 7}})[1]}))},"83b9":function(t,e,i){"use strict";var r=i("cb27"),n=i("384f"),s=r.Set,a=r.add;t.exports=function(t){var e=new s;return n(t,(function(t){a(e,t)})),e}},"83b9e":function(t,e,i){"use strict";var r=i("d925"),n=i("e683");t.exports=function(t,e){return t&&!r(e)?n(t,e):e}},"83e6":function(t,e,i){"use strict";var r=i("23e7"),n=i("e8b5"),s=Object.isFrozen,a=function(t,e){if(!s||!n(t)||!s(t))return!1;var i,r=0,a=t.length;while(r1?arguments[1]:void 0;return n(this,t,e)}}),a("groupBy")},8418:function(t,e,i){"use strict";var r=i("83ab"),n=i("9bf2"),s=i("5c6c");t.exports=function(t,e,i){r?n.f(t,e,s(0,i)):t[e]=i}},"841c":function(t,e,i){"use strict";var r=i("c65b"),n=i("d784"),s=i("825a"),a=i("7234"),o=i("1d80"),h=i("129f"),c=i("577e"),u=i("dc4a"),l=i("14c3");n("search",(function(t,e,i){return[function(e){var i=o(this),n=a(e)?void 0:u(e,t);return n?r(n,e,i):new RegExp(e)[t](c(i))},function(t){var r=s(this),n=c(t),a=i(e,r,n);if(a.done)return a.value;var o=r.lastIndex;h(o,0)||(r.lastIndex=0);var u=l(r,n);return h(r.lastIndex,o)||(r.lastIndex=o),null===u?-1:u.index}]}))},"843c":function(t,e,i){"use strict";var r=i("23e7"),n=i("0ccb").end,s=i("9a0c");r({target:"String",proto:!0,forced:s},{padEnd:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},"848b":function(t,e,i){"use strict";var r=i("5cce").version,n={};["object","boolean","number","function","string","symbol"].forEach((function(t,e){n[t]=function(i){return typeof i===t||"a"+(e<1?"n ":" ")+t}}));var s={};function a(t,e,i){if("object"!==typeof t)throw new TypeError("options must be an object");var r=Object.keys(t),n=r.length;while(n-- >0){var s=r[n],a=e[s];if(a){var o=t[s],h=void 0===o||a(o,s,t);if(!0!==h)throw new TypeError("option "+s+" must be "+h)}else if(!0!==i)throw Error("Unknown option "+s)}}n.transitional=function(t,e,i){function n(t,e){return"[Axios v"+r+"] Transitional option '"+t+"'"+e+(i?". "+i:"")}return function(i,r,a){if(!1===t)throw new Error(n(r," has been removed"+(e?" in "+e:"")));return e&&!s[r]&&(s[r]=!0,console.warn(n(r," has been deprecated since v"+e+" and will be removed in the near future"))),!t||t(i,r,a)}},t.exports={assertOptions:a,validators:n}},"84c3":function(t,e,i){"use strict";var r=i("74e8");r("Uint16",(function(t){return function(e,i,r){return t(this,e,i,r)}}))},"84ec":function(t,e){var i=Math.log(2);function r(t,e,n,s,a,o){var h=s+"-"+a,c=t.length;if(o.hasOwnProperty(h))return o[h];if(1===e){var u=Math.round(Math.log((1<"+h+""}},"857d":function(t,e){var i=2*Math.PI;function r(t){return t%=i,t<0&&(t+=i),t}e.normalizeRadian=r},"85ca":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("a5f7");r({target:"Set",proto:!0,real:!0,forced:!0},{difference:function(t){return n(a,this,s(t))}})},"861d":function(t,e,i){"use strict";var r=i("1626");t.exports=function(t){return"object"==typeof t?null!==t:r(t)}},"867a":function(t,e,i){"use strict";var r=Math.log,n=Math.LOG10E;t.exports=Math.log10||function(t){return r(t)*n}},8727:function(t,e){var i="http://www.w3.org/2000/svg";function r(t){return document.createElementNS(i,t)}e.createElement=r},8728:function(t,e){function i(t,e,i,r,n,s){if(s>e&&s>r||sn?a:0}t.exports=i},"87b1":function(t,e,i){var r=i("cbe5"),n=i("4fac"),s=r.extend({type:"polygon",shape:{points:null,smooth:!1,smoothConstraint:null},buildPath:function(t,e){n.buildPath(t,e,!0)}});t.exports=s},8883:function(t,e,i){"use strict";var r=i("83ab"),n=i("44d2"),s=i("7b0b"),a=i("07fa"),o=i("edd0");r&&(o(Array.prototype,"lastIndex",{configurable:!0,get:function(){var t=s(this),e=a(t);return 0===e?0:e-1}}),n("lastIndex"))},"88a7":function(t,e,i){"use strict";var r=i("cb2d"),n=i("e330"),s=i("577e"),a=i("d6d6"),o=URLSearchParams,h=o.prototype,c=n(h.append),u=n(h["delete"]),l=n(h.forEach),d=n([].push),f=new o("a=1&a=2&b=3");f["delete"]("a",1),f["delete"]("b",void 0),f+""!=="a=2"&&r(h,"delete",(function(t){var e=arguments.length,i=e<2?void 0:arguments[1];if(e&&void 0===i)return u(this,t);var r=[];l(this,(function(t,e){d(r,{key:e,value:t})})),a(e,1);var n,o=s(t),h=s(i),f=0,p=0,g=!1,m=r.length;while(f=11?function(){var e,i=this.__clipPaths,r=this.style;if(i)for(var s=0;s1?arguments[1]:void 0,r=e.length,n=void 0===i?r:f(a(i),r),s=o(t);return d(e,n-s.length,n)===s}})},"8a96":function(t,e,i){"use strict";var r=TypeError;t.exports=function(t){if("string"==typeof t)return t;throw new r("Argument is not a string")}},"8aa5":function(t,e,i){"use strict";var r=i("6547").charAt;t.exports=function(t,e,i){return e+(i?r(t,e).length:1)}},"8aa7":function(t,e,i){"use strict";var r=i("cfe9"),n=i("d039"),s=i("1c7e"),a=i("ebb5").NATIVE_ARRAY_BUFFER_VIEWS,o=r.ArrayBuffer,h=r.Int8Array;t.exports=!a||!n((function(){h(1)}))||!n((function(){new h(-1)}))||!s((function(t){new h,new h(null),new h(1.5),new h(t)}),!0)||n((function(){return 1!==new h(new o(2),1,void 0).length}))},"8b00":function(t,e,i){"use strict";var r=i("23e7"),n=i("68df"),s=i("dad2"),a=!s("isSubsetOf",(function(t){return t}));r({target:"Set",proto:!0,real:!0,forced:a},{isSubsetOf:n})},"8b09":function(t,e,i){"use strict";var r=i("74e8");r("Int16",(function(t){return function(e,i,r){return t(this,e,i,r)}}))},"8b85":function(t,e,i){"use strict";t.exports=function(t,e){return t===e||t!==t&&e!==e}},"8b9a":function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("3bbe"),a=i("d2bb");a&&r({target:"Reflect",stat:!0},{setPrototypeOf:function(t,e){n(t),s(e);try{return a(t,e),!0}catch(i){return!1}}})},"8ba4":function(t,e,i){"use strict";var r=i("23e7"),n=i("eac5");r({target:"Number",stat:!0},{isInteger:n})},"8bb3":function(t,e,i){"use strict";i("b431")},"8bd4":function(t,e,i){"use strict";var r=i("d066"),n=i("d44e"),s="DOMException";n(r(s),s)},"8bd5":function(t,e,i){"use strict";var r=i("23e7"),n=i("a258").findLast,s=i("44d2");r({target:"Array",proto:!0},{findLast:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),s("findLast")},"8c59":function(t,e,i){"use strict";i("6a8a")},"8c77":function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("59ed"),a=i("fc6a"),o=i("dfb9"),h=i("44c4"),c=i("44d2"),u=Array,l=n(h("Array","sort"));r({target:"Array",proto:!0},{toSorted:function(t){void 0!==t&&s(t);var e=a(this),i=o(u,e);return l(i,t)}}),c("toSorted")},"8ced":function(t,e,i){"use strict";var r=i("f5df"),n=i("1a2d"),s=i("7234"),a=i("b622"),o=i("3f8c"),h=a("iterator"),c=Object;t.exports=function(t){if(s(t))return!1;var e=c(t);return void 0!==e[h]||"@@iterator"in e||n(o,r(e))}},"8cef":function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.pad.Iso97971={pad:function(e,i){e.concat(t.lib.WordArray.create([2147483648],1)),t.pad.ZeroPadding.pad(e,i)},unpad:function(e){t.pad.ZeroPadding.unpad(e),e.sigBytes--}},t.pad.Iso97971}))},"8d32":function(t,e,i){var r=i("cbe5"),n=r.extend({type:"arc",shape:{cx:0,cy:0,r:0,startAngle:0,endAngle:2*Math.PI,clockwise:!0},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.cx,r=e.cy,n=Math.max(e.r,0),s=e.startAngle,a=e.endAngle,o=e.clockwise,h=Math.cos(s),c=Math.sin(s);t.moveTo(h*n+i,c*n+r),t.arc(i,r,n,s,a,!o)}});t.exports=n},"8df4":function(t,e,i){"use strict";var r=i("7a77");function n(t){if("function"!==typeof t)throw new TypeError("executor must be a function.");var e;this.promise=new Promise((function(t){e=t}));var i=this;this.promise.then((function(t){if(i._listeners){var e,r=i._listeners.length;for(e=0;e22025.465794806718||r(10)<22025.465794806718||-2e-17!==r(-2e-17)?function(t){var e=+t;return 0===e?e:e>-1e-6&&e<1e-6?e+e*e/2:n(e)-1}:r},"8edd":function(t,e,i){"use strict";var r=i("e065");r("matchAll")},"8ee0":function(t,e,i){i("3f8e");var r=i("697e"),n=r.registerPainter,s=i("dc20");n("svg",s)},"8f40":function(t,e,i){"use strict";i("33d1")},"8fe5":function(t,e,i){"use strict";i("6c57")},9013:function(t,e,i){"use strict";var r=i("23e7"),n=i("19aa"),s=i("e163"),a=i("9112"),o=i("1a2d"),h=i("b622"),c=i("a91f"),u=i("c430"),l=h("toStringTag"),d=TypeError,f=function(){if(n(this,c),s(this)===c)throw new d("Abstract class AsyncIterator not directly constructable")};f.prototype=c,o(c,l)||a(c,l,"AsyncIterator"),!u&&o(c,"constructor")&&c.constructor!==Object||a(c,"constructor",f),r({global:!0,constructor:!0,forced:u},{AsyncIterator:f})},9029:function(t,e,i){"use strict";i("e283")},"907a":function(t,e,i){"use strict";var r=i("ebb5"),n=i("07fa"),s=i("5926"),a=r.aTypedArray,o=r.exportTypedArrayMethod;o("at",(function(t){var e=a(this),i=n(e),r=s(t),o=r>=0?r:i+r;return o<0||o>=i?void 0:e[o]}))},"90d7":function(t,e,i){"use strict";var r=i("23e7"),n=i("4ff9");r({target:"Math",stat:!0},{log2:n})},"90d8":function(t,e,i){"use strict";var r=i("c65b"),n=i("1a2d"),s=i("3a9b"),a=i("ad6d"),o=RegExp.prototype;t.exports=function(t){var e=t.flags;return void 0!==e||"flags"in o||n(t,"flags")||!s(o,t)?e:r(a,t)}},"90e3":function(t,e,i){"use strict";var r=i("e330"),n=0,s=Math.random(),a=r(1..toString);t.exports=function(t){return"Symbol("+(void 0===t?"":t)+")_"+a(++n+s,36)}},"910d":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("825a"),o=i("46c4"),h=i("c5cc"),c=i("9bdd"),u=i("c430"),l=h((function(){var t,e,i,r=this.iterator,s=this.predicate,o=this.next;while(1){if(t=a(n(o,r)),e=this.done=!!t.done,e)return;if(i=t.value,c(r,s,[i,this.counter++],!0))return i}}));r({target:"Iterator",proto:!0,real:!0,forced:u},{filter:function(t){return a(this),s(t),new l(o(this),{predicate:t})}})},9112:function(t,e,i){"use strict";var r=i("83ab"),n=i("9bf2"),s=i("5c6c");t.exports=r?function(t,e,i){return n.f(t,e,s(1,i))}:function(t,e,i){return t[e]=i,t}},9129:function(t,e,i){"use strict";var r=i("23e7");r({target:"Number",stat:!0},{isNaN:function(t){return t!==t}})},9152:function(t,e){ /*! ieee754. BSD-3-Clause License. Feross Aboukhadijeh */ e.read=function(t,e,i,r,n){var s,a,o=8*n-r-1,h=(1<>1,u=-7,l=i?n-1:0,d=i?-1:1,f=t[e+l];for(l+=d,s=f&(1<<-u)-1,f>>=-u,u+=o;u>0;s=256*s+t[e+l],l+=d,u-=8);for(a=s&(1<<-u)-1,s>>=-u,u+=r;u>0;a=256*a+t[e+l],l+=d,u-=8);if(0===s)s=1-c;else{if(s===h)return a?NaN:1/0*(f?-1:1);a+=Math.pow(2,r),s-=c}return(f?-1:1)*a*Math.pow(2,s-r)},e.write=function(t,e,i,r,n,s){var a,o,h,c=8*s-n-1,u=(1<>1,d=23===n?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:s-1,p=r?1:-1,g=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(o=isNaN(e)?1:0,a=u):(a=Math.floor(Math.log(e)/Math.LN2),e*(h=Math.pow(2,-a))<1&&(a--,h*=2),e+=a+l>=1?d/h:d*Math.pow(2,1-l),e*h>=2&&(a++,h/=2),a+l>=u?(o=0,a=u):a+l>=1?(o=(e*h-1)*Math.pow(2,n),a+=l):(o=e*Math.pow(2,l-1)*Math.pow(2,n),a=0));n>=8;t[i+f]=255&o,f+=p,o/=256,n-=8);for(a=a<0;t[i+f]=255&a,f+=p,a/=256,c-=8);t[i+f-p]|=128*g}},9224:function(t){t.exports=JSON.parse('{"name":"@tpcomponents/tums-player","version":"2.0.19","description":"A SDK Library.","author":"TP-Link","main":"dist/SMBCloudSDK_Web/tums-player/tums-player.umd.min.js","scripts":{"serve":"vue-cli-service serve example/server/main.js","local":"vue-cli-service serve example/local/main.js","local-with-file":"cross-env VUE_APP_FILE=yes vue-cli-service serve example/local/main.js","device":"vue-cli-service serve example/device/main.js","build":"cross-env BUILD_ENV=SDK vue-cli-service build --target lib --name tums-player src/extendAbility.js --dest dist/temp && node build/build.js","build:reduce":"cross-env BUILD_ENV=SDK vue-cli-service build --target lib --name tums-player src/index.js --dest dist/temp && node build/build.js","build:tums":"node build/buildTums.js","build:serve":"vue-cli-service build example/server/main.js --dest dist/tums-player-serve && node build/buildTest.js && node build/copyPublicDemo.js","build:doc":"node build/copyDoc.js","build:local":"vue-cli-service build example/local/main.js --dest dist/tums-player-serve && node build/buildTest.js && node build/copyPrivateDemo.js","build:local-with-file":"cross-env VUE_APP_FILE=yes npm run build:local","build:webgl":"vue-cli-service build --target lib --name webgl src/player/webglPlayer/webgl.js --dest dist/temp && node build/buildWebgl.js","lint":"vue-cli-service lint"},"publishConfig":{"registry":"https://rdregistry.tp-link.com.cn/repository/tpcomponents_releases"},"files":["dist"],"dependencies":{"axios":"0.24.0","core-js":"3.41.0","crypto-js":"4.2.0","localforage":"1.10.0","ts-ebml":"2.0.2","video.js":"7.21.7","vue":"2.7.16","vue-router":"3.4.9","vuedraggable":"2.24.3","vuex":"3.5.1","zrender":"4.3.3"},"devDependencies":{"@vue/cli-plugin-babel":"4.5.19","@vue/cli-plugin-eslint":"4.5.19","@vue/cli-service":"4.5.19","add-asset-html-webpack-plugin":"3.2.2","babel-eslint":"10.1.0","copy-webpack-plugin":"5.1.2","cross-env":"7.0.3","eslint":"6.8.0","eslint-config-standard":"16.0.3","eslint-plugin-vue":"6.2.2","html-webpack-plugin":"3.2.0","sass":"1.53.0","sass-loader":"7.3.1","vconsole":"3.15.1","vue-template-compiler":"2.7.16","worker-loader":"3.0.8"},"eslintConfig":{"root":true,"env":{"node":true},"extends":["plugin:vue/essential","eslint:recommended"],"parserOptions":{"parser":"babel-eslint"},"rules":{}},"browserslist":["> 1%","last 2 versions","not dead"]}')},9257:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("577e"),a=String.fromCharCode,o=n("".charAt),h=n(/./.exec),c=n("".slice),u=/^[\da-f]{2}$/i,l=/^[\da-f]{4}$/i;r({global:!0},{unescape:function(t){var e,i,r=s(t),n="",d=r.length,f=0;while(f0&&(!w.multiline||w.multiline&&"\n"!==m(x,w.lastIndex-1))&&(I="(?: "+I+")",D=" "+D,k++),i=new RegExp("^(?:"+I+")",P)),S&&(i=new RegExp("^"+I+"$(?!\\s)",P)),_&&(n=w.lastIndex),o=r(p,R?i:w,D),R?o?(o.input=b(o.input,k),o[0]=b(o[0],k),o.index=w.lastIndex,w.lastIndex+=o[0].length):w.lastIndex=0:_&&o&&(w.lastIndex=w.global?o.index+o[0].length:n),S&&o&&o.length>1&&r(f,o[0],i,(function(){for(h=1;h=0&&e<=99?e+1900:e;return h(this,i)}})},"944a":function(t,e,i){"use strict";var r=i("d066"),n=i("e065"),s=i("d44e");n("toStringTag"),s(r("Symbol"),"Symbol")},9485:function(t,e,i){"use strict";var r=i("23e7"),n=i("2266"),s=i("59ed"),a=i("825a"),o=i("46c4"),h=TypeError;r({target:"Iterator",proto:!0,real:!0},{reduce:function(t){a(this),s(t);var e=o(this),i=arguments.length<2,r=i?void 0:arguments[1],c=0;if(n(e,(function(e){i?(i=!1,r=e):r=t(r,e,c),c++}),{IS_RECORD:!0}),i)throw new h("Reduce of empty iterator with no initial value");return r}})},"94ca":function(t,e,i){"use strict";var r=i("d039"),n=i("1626"),s=/#|\.prototype\./,a=function(t,e){var i=h[o(t)];return i===u||i!==c&&(n(e)?r(e):!!e)},o=a.normalize=function(t){return String(t).replace(s,".").toLowerCase()},h=a.data={},c=a.NATIVE="N",u=a.POLYFILL="P";t.exports=a},"94f8":function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(e){var i=t,r=i.lib,n=r.WordArray,s=r.Hasher,a=i.algo,o=[],h=[];(function(){function t(t){for(var i=e.sqrt(t),r=2;r<=i;r++)if(!(t%r))return!1;return!0}function i(t){return 4294967296*(t-(0|t))|0}var r=2,n=0;while(n<64)t(r)&&(n<8&&(o[n]=i(e.pow(r,.5))),h[n]=i(e.pow(r,1/3)),n++),r++})();var c=[],u=a.SHA256=s.extend({_doReset:function(){this._hash=new n.init(o.slice(0))},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],n=i[1],s=i[2],a=i[3],o=i[4],u=i[5],l=i[6],d=i[7],f=0;f<64;f++){if(f<16)c[f]=0|t[e+f];else{var p=c[f-15],g=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,m=c[f-2],v=(m<<15|m>>>17)^(m<<13|m>>>19)^m>>>10;c[f]=g+c[f-7]+v+c[f-16]}var y=o&u^~o&l,b=r&n^r&s^n&s,_=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),T=(o<<26|o>>>6)^(o<<21|o>>>11)^(o<<7|o>>>25),S=d+T+y+h[f]+c[f],w=_+b;d=l,l=u,u=o,o=a+S|0,a=s,s=n,n=r,r=S+w|0}i[0]=i[0]+r|0,i[1]=i[1]+n|0,i[2]=i[2]+s|0,i[3]=i[3]+a|0,i[4]=i[4]+o|0,i[5]=i[5]+u|0,i[6]=i[6]+l|0,i[7]=i[7]+d|0},_doFinalize:function(){var t=this._data,i=t.words,r=8*this._nDataBytes,n=8*t.sigBytes;return i[n>>>5]|=128<<24-n%32,i[14+(n+64>>>9<<4)]=e.floor(r/4294967296),i[15+(n+64>>>9<<4)]=r,t.sigBytes=4*i.length,this._process(),this._hash},clone:function(){var t=s.clone.call(this);return t._hash=this._hash.clone(),t}});i.SHA256=s._createHelper(u),i.HmacSHA256=s._createHmacHelper(u)}(Math),t.SHA256}))},"953b":function(t,e,i){"use strict";var r=i("dc19"),n=i("cb27"),s=i("8e16"),a=i("7f65"),o=i("384f"),h=i("5388"),c=n.Set,u=n.add,l=n.has;t.exports=function(t){var e=r(this),i=a(t),n=new c;return s(e)>i.size?h(i.getIterator(),(function(t){l(e,t)&&u(n,t)})):o(e,(function(t){i.includes(t)&&u(n,t)})),n}},9547:function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("2266"),a=i("46c4"),o=[].push;r({target:"Iterator",proto:!0,real:!0},{toArray:function(){var t=[];return s(a(n(this)),o,{that:t,IS_RECORD:!0}),t}})},"95c0":function(t,e,i){var r=i("697e");(function(){for(var t in r){if(null==r||!r.hasOwnProperty(t)||"default"===t||"__esModule"===t)return;e[t]=r[t]}})();var n=i("1a50");(function(){for(var t in n){if(null==n||!n.hasOwnProperty(t)||"default"===t||"__esModule"===t)return;e[t]=n[t]}})(),i("8ee0"),i("f170")},"95e8":function(t,e,i){"use strict";var r=i("23e7");r({target:"Math",stat:!0,forced:!0},{iaddh:function(t,e,i,r){var n=t>>>0,s=e>>>0,a=i>>>0;return s+(r>>>0)+((n&a|(n|a)&~(n+a>>>0))>>>31)|0}})},9661:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("ebe8"),a=i("68df");r({target:"Set",proto:!0,real:!0,forced:!0},{isSubsetOf:function(t){return n(a,this,s(t))}})},"967a":function(t,e,i){"use strict";i("bb56")},9680:function(t,e){function i(t,e,i,r,n,s,a){if(0===n)return!1;var o=n,h=0,c=t;if(a>e+o&&a>r+o||at+o&&s>i+o||s1?arguments[1]:void 0),r=new h;return o(e,(function(t,n){i(t,n,e)&&c(r,n,t)})),r}})},9850:function(t,e,i){var r=i("401b"),n=i("1687"),s=r.applyTransform,a=Math.min,o=Math.max;function h(t,e,i,r){i<0&&(t+=i,i=-i),r<0&&(e+=r,r=-r),this.x=t,this.y=e,this.width=i,this.height=r}h.prototype={constructor:h,union:function(t){var e=a(t.x,this.x),i=a(t.y,this.y);this.width=o(t.x+t.width,this.x+this.width)-e,this.height=o(t.y+t.height,this.y+this.height)-i,this.x=e,this.y=i},applyTransform:function(){var t=[],e=[],i=[],r=[];return function(n){if(n){t[0]=i[0]=this.x,t[1]=r[1]=this.y,e[0]=r[0]=this.x+this.width,e[1]=i[1]=this.y+this.height,s(t,t,n),s(e,e,n),s(i,i,n),s(r,r,n),this.x=a(t[0],e[0],i[0],r[0]),this.y=a(t[1],e[1],i[1],r[1]);var h=o(t[0],e[0],i[0],r[0]),c=o(t[1],e[1],i[1],r[1]);this.width=h-this.x,this.height=c-this.y}}}(),calculateTransform:function(t){var e=this,i=t.width/e.width,r=t.height/e.height,s=n.create();return n.translate(s,s,[-e.x,-e.y]),n.scale(s,s,[i,r]),n.translate(s,s,[t.x,t.y]),s},intersect:function(t){if(!t)return!1;t instanceof h||(t=h.create(t));var e=this,i=e.x,r=e.x+e.width,n=e.y,s=e.y+e.height,a=t.x,o=t.x+t.width,c=t.y,u=t.y+t.height;return!(r=i.x&&t<=i.x+i.width&&e>=i.y&&e<=i.y+i.height},clone:function(){return new h(this.x,this.y,this.width,this.height)},copy:function(t){this.x=t.x,this.y=t.y,this.width=t.width,this.height=t.height},plain:function(){return{x:this.x,y:this.y,width:this.width,height:this.height}}},h.create=function(t){return new h(t.x,t.y,t.width,t.height)};var c=h;t.exports=c},9861:function(t,e,i){"use strict";i("5352")},"986a":function(t,e,i){"use strict";var r=i("ebb5"),n=i("a258").findLast,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("findLast",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},"98b7":function(t,e){var i="undefined"!==typeof window&&(window.requestAnimationFrame&&window.requestAnimationFrame.bind(window)||window.msRequestAnimationFrame&&window.msRequestAnimationFrame.bind(window)||window.mozRequestAnimationFrame||window.webkitRequestAnimationFrame)||function(t){setTimeout(t,16)};t.exports=i},"98ce":function(t,e,i){"use strict";var r=i("4c1f").has;t.exports=function(t){return r(t),t}},9911:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("link")},{link:function(t){return n(this,"a","href",t)}})},9961:function(t,e,i){"use strict";var r=i("dc19"),n=i("cb27"),s=i("83b9"),a=i("7f65"),o=i("5388"),h=n.add,c=n.has,u=n.remove;t.exports=function(t){var e=r(this),i=a(t).getIterator(),n=s(e);return o(i,(function(t){c(e,t)?u(n,t):h(n,t)})),n}},"99af":function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("e8b5"),a=i("861d"),o=i("7b0b"),h=i("07fa"),c=i("3511"),u=i("8418"),l=i("65f0"),d=i("1dde"),f=i("b622"),p=i("1212"),g=f("isConcatSpreadable"),m=p>=51||!n((function(){var t=[];return t[g]=!1,t.concat()[0]!==t})),v=function(t){if(!a(t))return!1;var e=t[g];return void 0!==e?!!e:s(t)},y=!m||!d("concat");r({target:"Array",proto:!0,arity:1,forced:y},{concat:function(t){var e,i,r,n,s,a=o(this),d=l(a,0),f=0;for(e=-1,r=arguments.length;e2?arguments[2]:void 0)}))},"9a9a":function(t,e,i){"use strict";i("a732")},"9adc":function(t,e,i){"use strict";var r=i("8558");t.exports="NODE"===r},"9bdd":function(t,e,i){"use strict";var r=i("825a"),n=i("2a62");t.exports=function(t,e,i,s){try{return s?e(r(i)[0],i[1]):e(i)}catch(a){n(t,"throw",a)}}},"9bf2":function(t,e,i){"use strict";var r=i("83ab"),n=i("0cfb"),s=i("aed9"),a=i("825a"),o=i("a04b"),h=TypeError,c=Object.defineProperty,u=Object.getOwnPropertyDescriptor,l="enumerable",d="configurable",f="writable";e.f=r?s?function(t,e,i){if(a(t),e=o(e),a(i),"function"===typeof t&&"prototype"===e&&"value"in i&&f in i&&!i[f]){var r=u(t,e);r&&r[f]&&(t[e]=i.value,i={configurable:d in i?i[d]:r[d],enumerable:l in i?i[l]:r[l],writable:!1})}return c(t,e,i)}:c:function(t,e,i){if(a(t),e=o(e),a(i),n)try{return c(t,e,i)}catch(r){}if("get"in i||"set"in i)throw new h("Accessors not supported");return"value"in i&&(t[e]=i.value),t}},"9c2c":function(t,e,i){var r=i("401b"),n=r.min,s=r.max,a=r.scale,o=r.distance,h=r.add,c=r.clone,u=r.sub;function l(t,e,i,r){var l,d,f,p,g=[],m=[],v=[],y=[];if(r){f=[1/0,1/0],p=[-1/0,-1/0];for(var b=0,_=t.length;b<_;b++)n(f,f,t[b]),s(p,p,t[b]);n(f,f,r[0]),s(p,p,r[1])}for(b=0,_=t.length;b<_;b++){var T=t[b];if(i)l=t[b?b-1:_-1],d=t[(b+1)%_];else{if(0===b||b===_-1){g.push(c(t[b]));continue}l=t[b-1],d=t[b+1]}u(m,d,l),a(m,m,e);var S=o(T,l),w=o(T,d),E=S+w;0!==E&&(S/=E,w/=E),a(v,m,-S),a(y,m,w);var x=h([],T,v),A=h([],T,y);r&&(s(x,x,f),n(x,x,p),s(A,A,f),n(A,A,p)),g.push(x),g.push(A)}return i&&g.push(g.shift()),g}t.exports=l},"9c87":function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("db82"),a=i("094a"),o=i("f29f"),h=a.Map,c=a.set;r({target:"Map",proto:!0,real:!0,forced:!0},{mapKeys:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0),r=new h;return o(e,(function(t,n){c(r,i(t,n,e),t)})),r}})},"9cf7":function(t,e,i){"use strict";var r=i("d039");t.exports=!r((function(){var t="9007199254740993",e=JSON.rawJSON(t);return!JSON.isRawJSON(e)||JSON.stringify(e)!==t}))},"9cf9":function(t,e){var i=Math.round;function r(t,e,r){if(e){var n=e.x1,a=e.x2,o=e.y1,h=e.y2;t.x1=n,t.x2=a,t.y1=o,t.y2=h;var c=r&&r.lineWidth;c&&(i(2*n)===i(2*a)&&(t.x1=t.x2=s(n,c,!0)),i(2*o)===i(2*h)&&(t.y1=t.y2=s(o,c,!0)))}}function n(t,e,i){if(e){var r=e.x,n=e.y,a=e.width,o=e.height;t.x=r,t.y=n,t.width=a,t.height=o;var h=i&&i.lineWidth;h&&(t.x=s(r,h,!0),t.y=s(n,h,!0),t.width=Math.max(s(r+a,h,!1)-t.x,0===a?0:1),t.height=Math.max(s(n+o,h,!1)-t.y,0===o?0:1))}}function s(t,e,r){if(!e)return t;var n=i(2*t);return(n+i(e))%2===0?n/2:(n+(r?1:-1))/2}e.subPixelOptimizeLine=r,e.subPixelOptimizeRect=n,e.subPixelOptimize=s},"9d3f":function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("825a"),o=i("35a1"),h=i("c5cc"),c=i("4754"),u=Array,l=h((function(){while(1){var t=this.iterator;if(!t){var e=this.nextIterableIndex++,i=this.iterables;if(e>=i.length)return this.done=!0,c(void 0,!0);var r=i[e];this.iterables[e]=null,t=this.iterator=n(r.method,r.iterable),this.next=t.next}var s=a(n(this.next,t));if(!s.done)return s;this.iterator=null,this.next=null}}),!1,!0);r({target:"Iterator",stat:!0,forced:!0},{concat:function(){for(var t=arguments.length,e=u(t),i=0;ii||d+la&&(a+=s);var p=Math.atan2(u,c);return p<0&&(p+=s),p>=r&&p<=a||p+s>=r&&p+s<=a}e.containStroke=a},"9f7f":function(t,e,i){"use strict";var r=i("d039"),n=i("cfe9"),s=n.RegExp,a=r((function(){var t=s("a","y");return t.lastIndex=2,null!==t.exec("abcd")})),o=a||r((function(){return!s("a","y").sticky})),h=a||r((function(){var t=s("^r","gy");return t.lastIndex=2,null!==t.exec("str")}));t.exports={BROKEN_CARET:h,MISSED_STICKY:o,UNSUPPORTED_Y:a}},"9f96":function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("b575"),a=i("59ed"),o=i("d6d6"),h=i("d039"),c=i("83ab"),u=h((function(){return c&&1!==Object.getOwnPropertyDescriptor(n,"queueMicrotask").value.length}));r({global:!0,enumerable:!0,dontCallGetSet:!0,forced:u},{queueMicrotask:function(t){o(arguments.length,1),s(a(t))}})},"9f9a":function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("db82"),a=i("f29f");r({target:"Map",proto:!0,real:!0,forced:!0},{findKey:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0),r=a(e,(function(t,r){if(i(t,r,e))return{key:r}}),!0);return r&&r.key}})},"9fa3":function(t,e,i){var r=i("4ab1"),n=i("6d8b"),s=i("1687");function a(t,e){r.call(this,t,e,"clipPath","__clippath_in_use__")}n.inherits(a,r),a.prototype.update=function(t){var e=this.getSvgElement(t);e&&this.updateDom(e,t.__clipPaths,!1);var i=this.getTextSvgElement(t);i&&this.updateDom(i,t.__clipPaths,!0),this.markUsed(t)},a.prototype.updateDom=function(t,e,i){if(e&&e.length>0){var r,n,a=this.getDefs(!0),o=e[0],h=i?"_textDom":"_dom";o[h]?(n=o[h].getAttribute("id"),r=o[h],a.contains(r)||a.appendChild(r)):(n="zr"+this._zrId+"-clip-"+this.nextId,++this.nextId,r=this.createElement("clipPath"),r.setAttribute("id",n),a.appendChild(r),o[h]=r);var c=this.getSvgProxy(o);if(o.transform&&o.parent.invTransform&&!i){var u=Array.prototype.slice.call(o.transform);s.mul(o.transform,o.parent.invTransform,o.transform),c.brush(o),o.transform=u}else c.brush(o);var l=this.getSvgElement(o);r.innerHTML="",r.appendChild(l.cloneNode()),t.setAttribute("clip-path","url(#"+n+")"),e.length>1&&this.updateDom(r,e.slice(1),i)}else t&&t.setAttribute("clip-path","none")},a.prototype.markUsed=function(t){var e=this;t.__clipPaths&&n.each(t.__clipPaths,(function(t){t._dom&&r.prototype.markUsed.call(e,t._dom),t._textDom&&r.prototype.markUsed.call(e,t._textDom)}))};var o=a;t.exports=o},"9fbf":function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("2ba4"),a=i("d039"),o=i("e5cb"),h="AggregateError",c=n(h),u=!a((function(){return 1!==c([1]).errors[0]}))&&a((function(){return 7!==c([1],h,{cause:7}).cause}));r({global:!0,constructor:!0,arity:2,forced:u},{AggregateError:o(h,(function(t){return function(e,i){return s(t,this,arguments)}}),u,!0)})},"9ff9":function(t,e,i){"use strict";var r=i("23e7"),n=Math.atanh,s=Math.log,a=!(n&&1/n(-0)<0);r({target:"Math",stat:!0,forced:a},{atanh:function(t){var e=+t;return 0===e?e:s((1+e)/(1-e))/2}})},a002:function(t,e,i){(function(e){var i; /*! localForage -- Offline Storage, Improved Version 1.10.0 https://localforage.github.io/localForage (c) 2013-2017 Mozilla, Apache License 2.0 */ (function(e){t.exports=e()})((function(){return function t(e,r,n){function s(o,h){if(!r[o]){if(!e[o]){var c="function"==typeof i&&i;if(!h&&c)return i(o,!0);if(a)return a(o,!0);var u=new Error("Cannot find module '"+o+"'");throw u.code="MODULE_NOT_FOUND",u}var l=r[o]={exports:{}};e[o][0].call(l.exports,(function(t){var i=e[o][1][t];return s(i||t)}),l,l.exports,t,e,r,n)}return r[o].exports}for(var a="function"==typeof i&&i,o=0;o=43)}}))["catch"]((function(){return!1}))}function S(t){return"boolean"===typeof g?c.resolve(g):T(t).then((function(t){return g=t,g}))}function w(t){var e=m[t.name],i={};i.promise=new c((function(t,e){i.resolve=t,i.reject=e})),e.deferredOperations.push(i),e.dbReady?e.dbReady=e.dbReady.then((function(){return i.promise})):e.dbReady=i.promise}function E(t){var e=m[t.name],i=e.deferredOperations.pop();if(i)return i.resolve(),i.promise}function x(t,e){var i=m[t.name],r=i.deferredOperations.pop();if(r)return r.reject(e),r.promise}function A(t,e){return new c((function(i,r){if(m[t.name]=m[t.name]||B(),t.db){if(!e)return i(t.db);w(t),t.db.close()}var n=[t.name];e&&n.push(t.version);var s=a.open.apply(a,n);e&&(s.onupgradeneeded=function(e){var i=s.result;try{i.createObjectStore(t.storeName),e.oldVersion<=1&&i.createObjectStore(p)}catch(r){if("ConstraintError"!==r.name)throw r;console.warn('The database "'+t.name+'" has been upgraded from version '+e.oldVersion+" to version "+e.newVersion+', but the storage "'+t.storeName+'" already exists.')}}),s.onerror=function(t){t.preventDefault(),r(s.error)},s.onsuccess=function(){var e=s.result;e.onversionchange=function(t){t.target.close()},i(e),E(t)}}))}function C(t){return A(t,!1)}function R(t){return A(t,!0)}function P(t,e){if(!t.db)return!0;var i=!t.db.objectStoreNames.contains(t.storeName),r=t.versiont.db.version;if(r&&(t.version!==e&&console.warn('The database "'+t.name+"\" can't be downgraded from version "+t.db.version+" to version "+t.version+"."),t.version=t.db.version),n||i){if(i){var s=t.db.version+1;s>t.version&&(t.version=s)}return!0}return!1}function I(t){return new c((function(e,i){var r=new FileReader;r.onerror=i,r.onloadend=function(i){var r=btoa(i.target.result||"");e({__local_forage_encoded_blob:!0,data:r,type:t.type})},r.readAsBinaryString(t)}))}function k(t){var e=_(atob(t.data));return h([e],{type:t.type})}function D(t){return t&&t.__local_forage_encoded_blob}function O(t){var e=this,i=e._initReady().then((function(){var t=m[e._dbInfo.name];if(t&&t.dbReady)return t.dbReady}));return l(i,t,t),i}function M(t){w(t);for(var e=m[t.name],i=e.forages,r=0;r0&&(!t.db||"InvalidStateError"===s.name||"NotFoundError"===s.name))return c.resolve().then((function(){if(!t.db||"NotFoundError"===s.name&&!t.db.objectStoreNames.contains(t.storeName)&&t.version<=t.db.version)return t.db&&(t.version=t.db.version+1),R(t)})).then((function(){return M(t).then((function(){N(t,e,i,r-1)}))}))["catch"](i);i(s)}}function B(){return{forages:[],db:null,dbReady:null,deferredOperations:[]}}function L(t){var e=this,i={db:null};if(t)for(var r in t)i[r]=t[r];var n=m[i.name];n||(n=B(),m[i.name]=n),n.forages.push(e),e._initReady||(e._initReady=e.ready,e.ready=O);var s=[];function a(){return c.resolve()}for(var o=0;o>4,u[h++]=(15&r)<<4|n>>2,u[h++]=(3&n)<<6|63&s;return c}function pt(t){var e,i=new Uint8Array(t),r="";for(e=0;e>2],r+=X[(3&i[e])<<4|i[e+1]>>4],r+=X[(15&i[e+1])<<2|i[e+2]>>6],r+=X[63&i[e+2]];return i.length%3===2?r=r.substring(0,r.length-1)+"=":i.length%3===1&&(r=r.substring(0,r.length-2)+"=="),r}function gt(t,e){var i="";if(t&&(i=dt.call(t)),t&&("[object ArrayBuffer]"===i||t.buffer&&"[object ArrayBuffer]"===dt.call(t.buffer))){var r,n=Z;t instanceof ArrayBuffer?(r=t,n+=tt):(r=t.buffer,"[object Int8Array]"===i?n+=it:"[object Uint8Array]"===i?n+=rt:"[object Uint8ClampedArray]"===i?n+=nt:"[object Int16Array]"===i?n+=st:"[object Uint16Array]"===i?n+=ot:"[object Int32Array]"===i?n+=at:"[object Uint32Array]"===i?n+=ht:"[object Float32Array]"===i?n+=ct:"[object Float64Array]"===i?n+=ut:e(new Error("Failed to get type for BinaryArray"))),e(n+pt(r))}else if("[object Blob]"===i){var s=new FileReader;s.onload=function(){var i=Q+t.type+"~"+pt(this.result);e(Z+et+i)},s.readAsArrayBuffer(t)}else try{e(JSON.stringify(t))}catch(a){console.error("Couldn't convert value into a JSON string: ",t),e(null,a)}}function mt(t){if(t.substring(0,J)!==Z)return JSON.parse(t);var e,i=t.substring(lt),r=t.substring(J,lt);if(r===et&&K.test(i)){var n=i.match(K);e=n[1],i=i.substring(n[0].length)}var s=ft(i);switch(r){case tt:return s;case et:return h([s],{type:e});case it:return new Int8Array(s);case rt:return new Uint8Array(s);case nt:return new Uint8ClampedArray(s);case st:return new Int16Array(s);case ot:return new Uint16Array(s);case at:return new Int32Array(s);case ht:return new Uint32Array(s);case ct:return new Float32Array(s);case ut:return new Float64Array(s);default:throw new Error("Unkown type: "+r)}}var vt={serialize:gt,deserialize:mt,stringToBuffer:ft,bufferToString:pt};function yt(t,e,i,r){t.executeSql("CREATE TABLE IF NOT EXISTS "+e.storeName+" (id INTEGER PRIMARY KEY, key unique, value)",[],i,r)}function bt(t){var e=this,i={db:null};if(t)for(var r in t)i[r]="string"!==typeof t[r]?t[r].toString():t[r];var n=new c((function(t,r){try{i.db=openDatabase(i.name,String(i.version),i.description,i.size)}catch(n){return r(n)}i.db.transaction((function(n){yt(n,i,(function(){e._dbInfo=i,t()}),(function(t,e){r(e)}))}),r)}));return i.serializer=vt,n}function _t(t,e,i,r,n,s){t.executeSql(i,r,n,(function(t,a){a.code===a.SYNTAX_ERR?t.executeSql("SELECT name FROM sqlite_master WHERE type='table' AND name = ?",[e.storeName],(function(t,o){o.rows.length?s(t,a):yt(t,e,(function(){t.executeSql(i,r,n,s)}),s)}),s):s(t,a)}),s)}function Tt(t,e){var i=this;t=d(t);var r=new c((function(e,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){_t(i,n,"SELECT * FROM "+n.storeName+" WHERE key = ? LIMIT 1",[t],(function(t,i){var r=i.rows.length?i.rows.item(0).value:null;r&&(r=n.serializer.deserialize(r)),e(r)}),(function(t,e){r(e)}))}))}))["catch"](r)}));return u(r,e),r}function St(t,e){var i=this,r=new c((function(e,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){_t(i,n,"SELECT * FROM "+n.storeName,[],(function(i,r){for(var s=r.rows,a=s.length,o=0;o0)return void s(wt.apply(n,[t,o,i,r-1]));a(e)}}))}))}))["catch"](a)}));return u(s,i),s}function Et(t,e,i){return wt.apply(this,[t,e,i,1])}function xt(t,e){var i=this;t=d(t);var r=new c((function(e,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){_t(i,n,"DELETE FROM "+n.storeName+" WHERE key = ?",[t],(function(){e()}),(function(t,e){r(e)}))}))}))["catch"](r)}));return u(r,e),r}function At(t){var e=this,i=new c((function(t,i){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){_t(e,r,"DELETE FROM "+r.storeName,[],(function(){t()}),(function(t,e){i(e)}))}))}))["catch"](i)}));return u(i,t),i}function Ct(t){var e=this,i=new c((function(t,i){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){_t(e,r,"SELECT COUNT(key) as c FROM "+r.storeName,[],(function(e,i){var r=i.rows.item(0).c;t(r)}),(function(t,e){i(e)}))}))}))["catch"](i)}));return u(i,t),i}function Rt(t,e){var i=this,r=new c((function(e,r){i.ready().then((function(){var n=i._dbInfo;n.db.transaction((function(i){_t(i,n,"SELECT key FROM "+n.storeName+" WHERE id = ? LIMIT 1",[t+1],(function(t,i){var r=i.rows.length?i.rows.item(0).key:null;e(r)}),(function(t,e){r(e)}))}))}))["catch"](r)}));return u(r,e),r}function Pt(t){var e=this,i=new c((function(t,i){e.ready().then((function(){var r=e._dbInfo;r.db.transaction((function(e){_t(e,r,"SELECT key FROM "+r.storeName,[],(function(e,i){for(var r=[],n=0;n '__WebKitDatabaseInfoTable__'",[],(function(i,r){for(var n=[],s=0;s0}function Lt(t){var e=this,i={};if(t)for(var r in t)i[r]=t[r];return i.keyPrefix=Mt(t,e._defaultConfig),Bt()?(e._dbInfo=i,i.serializer=vt,c.resolve()):c.reject()}function Ut(t){var e=this,i=e.ready().then((function(){for(var t=e._dbInfo.keyPrefix,i=localStorage.length-1;i>=0;i--){var r=localStorage.key(i);0===r.indexOf(t)&&localStorage.removeItem(r)}}));return u(i,t),i}function zt(t,e){var i=this;t=d(t);var r=i.ready().then((function(){var e=i._dbInfo,r=localStorage.getItem(e.keyPrefix+t);return r&&(r=e.serializer.deserialize(r)),r}));return u(r,e),r}function Ft(t,e){var i=this,r=i.ready().then((function(){for(var e=i._dbInfo,r=e.keyPrefix,n=r.length,s=localStorage.length,a=1,o=0;o=0;e--){var i=localStorage.key(e);0===i.indexOf(t)&&localStorage.removeItem(i)}})):c.reject("Invalid arguments"),u(r,e),r}var Yt={_driver:"localStorageWrapper",_initStorage:Lt,_support:Ot(),iterate:Ft,getItem:zt,setItem:qt,removeItem:Vt,clear:Ut,length:jt,key:Wt,keys:Ht,dropInstance:Gt},$t=function(t,e){return t===e||"number"===typeof t&&"number"===typeof e&&isNaN(t)&&isNaN(e)},Xt=function(t,e){var i=t.length,r=0;while(r1?arguments[1]:void 0,E=void 0!==w,x=c(T);if(x&&!u(x)){y=h(T,x),b=y.next,T=[];while(!(v=n(b,y)).done)T.push(v.value)}for(E&&S>2&&(w=r(w,arguments[2])),i=o(T),p=new(d(_))(i),g=l(p),e=0;i>e;e++)m=E?w(T[e],e):T[e],p[e]=g?f(m):+m;return p}},a093:function(t,e,i){"use strict";i("f250")},a11b:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.pad.Iso10126={pad:function(e,i){var r=4*i,n=r-e.sigBytes%r;e.concat(t.lib.WordArray.random(n-1)).concat(t.lib.WordArray.create([n<<24],1))},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Iso10126}))},a149:function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("d039"),a=i("d6d6"),o=i("577e"),h=i("f354"),c=n("URL"),u=h&&s((function(){c.canParse()})),l=s((function(){return 1!==c.canParse.length}));r({target:"URL",stat:!0,forced:!u||l},{canParse:function(t){var e=a(arguments.length,1),i=o(t),r=e<2||void 0===arguments[1]?void 0:o(arguments[1]);try{return!!new c(i,r)}catch(n){return!1}}})},a15b:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("44ad"),a=i("fc6a"),o=i("a640"),h=n([].join),c=s!==Object,u=c||!o("join",",");r({target:"Array",proto:!0,forced:u},{join:function(t){return h(a(this),void 0===t?",":t)}})},a1ac:function(t,e,i){"use strict";var r=i("23e7"),n=i("9cf7"),s=i("f748b");r({target:"JSON",stat:!0,forced:!n},{isRawJSON:s})},a1b3:function(t,e,i){"use strict";var r=i("c65b"),n=i("63fa"),s=i("825a"),a=i("9a1f"),o=i("46c4"),h=i("dc4a"),c=i("b622"),u=c("asyncIterator");t.exports=function(t,e){var i=arguments.length<2?h(t,u):e;return i?s(r(i,t)):new n(o(a(t)))}},a1f0:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("4625"),a=i("dcc3"),o=i("4754"),h=i("1d80"),c=i("50c4"),u=i("577e"),l=i("825a"),d=i("7234"),f=i("c6b6"),p=i("44e7"),g=i("90d8"),m=i("dc4a"),v=i("cb2d"),y=i("d039"),b=i("b622"),_=i("4840"),T=i("8aa5"),S=i("14c3"),w=i("69f3"),E=i("c430"),x=b("matchAll"),A="RegExp String",C=A+" Iterator",R=w.set,P=w.getterFor(C),I=RegExp.prototype,k=TypeError,D=s("".indexOf),O=s("".matchAll),M=!!O&&!y((function(){O("a",/./)})),N=a((function(t,e,i,r){R(this,{type:C,regexp:t,string:e,global:i,unicode:r,done:!1})}),A,(function(){var t=P(this);if(t.done)return o(void 0,!0);var e=t.regexp,i=t.string,r=S(e,i);return null===r?(t.done=!0,o(void 0,!0)):t.global?(""===u(r[0])&&(e.lastIndex=T(i,c(e.lastIndex),t.unicode)),o(r,!1)):(t.done=!0,o(r,!1))})),B=function(t){var e,i,r,n=l(this),s=u(t),a=_(n,RegExp),o=u(g(n));return e=new a(a===RegExp?n.source:n,o),i=!!~D(o,"g"),r=!!~D(o,"u"),e.lastIndex=c(n.lastIndex),new N(e,s,i,r)};r({target:"String",proto:!0,forced:M},{matchAll:function(t){var e,i,r,s,a=h(this);if(d(t)){if(M)return O(a,t)}else{if(p(t)&&(e=u(h(g(t))),!~D(e,"g")))throw new k("`.matchAll` does not allow non-global regexes");if(M)return O(a,t);if(r=m(t,x),void 0===r&&E&&"RegExp"===f(t)&&(r=B),r)return n(r,t,a)}return i=u(a),s=new RegExp(t,"g"),E?n(B,s,i):s[x](i)}}),E||x in I||v(I,x,B)},a258:function(t,e,i){"use strict";var r=i("0366"),n=i("44ad"),s=i("7b0b"),a=i("07fa"),o=function(t){var e=1===t;return function(i,o,h){var c,u,l=s(i),d=n(l),f=a(d),p=r(o,h);while(f-- >0)if(c=d[f],u=p(c,f,l),u)switch(t){case 0:return c;case 1:return f}return e?-1:void 0}};t.exports={findLast:o(0),findLastIndex:o(1)}},a267:function(t,e,i){"use strict";var r=i("23e7"),n=i("fd81"),s=TypeError;r({target:"Iterator",stat:!0,forced:!0},{range:function(t,e,i){if("number"==typeof t)return new n(t,e,i,"number",0,1);if("bigint"==typeof t)return new n(t,e,i,"bigint",BigInt(0),BigInt(1));throw new s("Incorrect Iterator.range arguments")}})},a282:function(t,e,i){"use strict";var r=i("c65b"),n=i("1626"),s=i("825a"),a=i("46c4"),o=i("35a1"),h=i("dc4a"),c=i("b622"),u=i("63fa"),l=c("asyncIterator");t.exports=function(t){var e,i=s(t),c=!0,d=h(i,l);return n(d)||(d=o(i),c=!1),void 0!==d?e=r(d,i):(e=i,c=!0),s(e),a(c?e:new u(a(e)))}},a2bf:function(t,e,i){"use strict";var r=i("e8b5"),n=i("07fa"),s=i("3511"),a=i("0366"),o=function(t,e,i,h,c,u,l,d){var f,p,g=c,m=0,v=!!l&&a(l,d);while(m0&&r(f)?(p=n(f),g=o(t,e,f,p,g,u-1)-1):(s(g+1),t[g]=f),g++),m++;return g};t.exports=o},a3a2:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("5926"),a=i("408a"),o=i("1148"),h=i("867a"),c=i("d039"),u=RangeError,l=String,d=isFinite,f=Math.abs,p=Math.floor,g=Math.pow,m=Math.round,v=n(1..toExponential),y=n(o),b=n("".slice),_="-6.9000e-11"===v(-69e-12,4)&&"1.25e+0"===v(1.255,2)&&"1.235e+4"===v(12345,3)&&"3e+1"===v(25,0),T=function(){return c((function(){v(1,1/0)}))&&c((function(){v(1,-1/0)}))},S=function(){return!c((function(){v(1/0,1/0),v(NaN,1/0)}))},w=!_||!T()||!S();r({target:"Number",proto:!0,forced:w},{toExponential:function(t){var e=a(this);if(void 0===t)return v(e);var i=s(t);if(!d(e))return String(e);if(i<0||i>20)throw new u("Incorrect fraction digits");if(_)return v(e,i);var r,n,o,c,T="";if(e<0&&(T="-",e=-e),0===e)n=0,r=y("0",i+1);else{var S=h(e);n=p(S);var w=g(10,n-i),E=m(e/w);2*e>=(2*E+1)*w&&(E+=1),E>=g(10,i+1)&&(E/=10,n+=1),r=l(E)}return 0!==i&&(r=b(r,0,1)+"."+b(r,1)),0===n?(o="+",c="0"):(o=n>0?"+":"-",c=l(f(n))),r+="e"+o+c,T+r}})},a3cd:function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("e330"),a=i("59ed"),o=i("1d80"),h=i("a04b"),c=i("2266"),u=i("d039"),l=Object.groupBy,d=n("Object","create"),f=s([].push),p=!l||u((function(){return 1!==l("ab",(function(t){return t})).a.length}));r({target:"Object",stat:!0,forced:p},{groupBy:function(t,e){o(t),a(e);var i=d(null),r=0;return c(t,(function(t){var n=h(e(t,r++));n in i?f(i[n],t):i[n]=[t]})),i}})},a40e:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("1132"),i("72fe"),i("2b79"),i("38ba"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.WordArray,n=i.BlockCipher,s=e.algo,a=[57,49,41,33,25,17,9,1,58,50,42,34,26,18,10,2,59,51,43,35,27,19,11,3,60,52,44,36,63,55,47,39,31,23,15,7,62,54,46,38,30,22,14,6,61,53,45,37,29,21,13,5,28,20,12,4],o=[14,17,11,24,1,5,3,28,15,6,21,10,23,19,12,4,26,8,16,7,27,20,13,2,41,52,31,37,47,55,30,40,51,45,33,48,44,49,39,56,34,53,46,42,50,36,29,32],h=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],u=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],l=s.DES=n.extend({_doReset:function(){for(var t=this._key,e=t.words,i=[],r=0;r<56;r++){var n=a[r]-1;i[r]=e[n>>>5]>>>31-n%32&1}for(var s=this._subKeys=[],c=0;c<16;c++){var u=s[c]=[],l=h[c];for(r=0;r<24;r++)u[r/6|0]|=i[(o[r]-1+l)%28]<<31-r%6,u[4+(r/6|0)]|=i[28+(o[r+24]-1+l)%28]<<31-r%6;u[0]=u[0]<<1|u[0]>>>31;for(r=1;r<7;r++)u[r]=u[r]>>>4*(r-1)+3;u[7]=u[7]<<5|u[7]>>>27}var d=this._invSubKeys=[];for(r=0;r<16;r++)d[r]=s[15-r]},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._subKeys)},decryptBlock:function(t,e){this._doCryptBlock(t,e,this._invSubKeys)},_doCryptBlock:function(t,e,i){this._lBlock=t[e],this._rBlock=t[e+1],d.call(this,4,252645135),d.call(this,16,65535),f.call(this,2,858993459),f.call(this,8,16711935),d.call(this,1,1431655765);for(var r=0;r<16;r++){for(var n=i[r],s=this._lBlock,a=this._rBlock,o=0,h=0;h<8;h++)o|=c[h][((a^n[h])&u[h])>>>0];this._lBlock=a,this._rBlock=s^o}var l=this._lBlock;this._lBlock=this._rBlock,this._rBlock=l,d.call(this,1,1431655765),f.call(this,8,16711935),f.call(this,2,858993459),d.call(this,16,65535),d.call(this,4,252645135),t[e]=this._lBlock,t[e+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(t,e){var i=(this._lBlock>>>t^this._rBlock)&e;this._rBlock^=i,this._lBlock^=i<>>t^this._lBlock)&e;this._lBlock^=i,this._rBlock^=i<192.");var i=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),s=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=l.createEncryptor(r.create(i)),this._des2=l.createEncryptor(r.create(n)),this._des3=l.createEncryptor(r.create(s))},encryptBlock:function(t,e){this._des1.encryptBlock(t,e),this._des2.decryptBlock(t,e),this._des3.encryptBlock(t,e)},decryptBlock:function(t,e){this._des3.decryptBlock(t,e),this._des2.encryptBlock(t,e),this._des1.decryptBlock(t,e)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=n._createHelper(p)}(),t.TripleDES}))},a434:function(t,e,i){"use strict";var r=i("23e7"),n=i("7b0b"),s=i("23cb"),a=i("5926"),o=i("07fa"),h=i("3a34"),c=i("3511"),u=i("65f0"),l=i("8418"),d=i("083a"),f=i("1dde"),p=f("splice"),g=Math.max,m=Math.min;r({target:"Array",proto:!0,forced:!p},{splice:function(t,e){var i,r,f,p,v,y,b=n(this),_=o(b),T=s(t,_),S=arguments.length;for(0===S?i=r=0:1===S?(i=0,r=_-T):(i=S-2,r=m(g(a(e),0),_-T)),c(_+i-r),f=u(b,r),p=0;p_-r+i;p--)d(b,p-1)}else if(i>r)for(p=_-r;p>T;p--)v=p+r-1,y=p+i-1,v in b?b[y]=b[v]:d(b,y);for(p=0;p1?arguments[1]:void 0);return s(this,e)}),!0)},a542:function(t,e,i){"use strict";var r=i("c65b"),n=i("59ed"),s=i("825a"),a=i("861d"),o=i("46c4"),h=i("d195"),c=i("4754"),u=i("3436"),l=h((function(t){var e=this,i=e.iterator,n=e.mapper;return new t((function(o,h){var l=function(t){e.done=!0,h(t)},d=function(t){u(i,l,t,l)};t.resolve(s(r(e.next,i))).then((function(i){try{if(s(i).done)e.done=!0,o(c(void 0,!0));else{var r=i.value;try{var h=n(r,e.counter++),u=function(t){o(c(t,!1))};a(h)?t.resolve(h).then(u,d):u(h)}catch(f){d(f)}}}catch(p){l(p)}}),l)}))}));t.exports=function(t){return s(this),n(t),new l(o(this),{mapper:t})}},a573:function(t,e,i){"use strict";i("ab43")},a5eb:function(t,e,i){"use strict";i("313a"),i("855c"),i("548f")},a5f7:function(t,e,i){"use strict";var r=i("dc19"),n=i("cb27"),s=i("83b9"),a=i("8e16"),o=i("7f65"),h=i("384f"),c=i("5388"),u=n.has,l=n.remove;t.exports=function(t){var e=r(this),i=o(t),n=s(e);return a(e)<=i.size?h(e,(function(t){i.includes(t)&&l(n,t)})):c(i.getIterator(),(function(t){u(e,t)&&l(n,t)})),n}},a623:function(t,e,i){"use strict";var r=i("23e7"),n=i("b727").every,s=i("a640"),a=s("every");r({target:"Array",proto:!0,forced:!a},{every:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}})},a630:function(t,e,i){"use strict";var r=i("23e7"),n=i("4df4"),s=i("1c7e"),a=!s((function(t){Array.from(t)}));r({target:"Array",stat:!0,forced:a},{from:n})},a640:function(t,e,i){"use strict";var r=i("d039");t.exports=function(t,e){var i=[][t];return!!i&&r((function(){i.call(null,e||function(){return 1},1)}))}},a6fd:function(t,e,i){"use strict";var r=i("23e7"),n=i("2ba4"),s=i("59ed"),a=i("825a"),o=i("d039"),h=!o((function(){Reflect.apply((function(){}))}));r({target:"Reflect",stat:!0,forced:h},{apply:function(t,e,i){return n(s(t),e,a(i))}})},a732:function(t,e,i){"use strict";var r=i("23e7"),n=i("2266"),s=i("59ed"),a=i("825a"),o=i("46c4");r({target:"Iterator",proto:!0,real:!0},{some:function(t){a(this),s(t);var e=o(this),i=0;return n(e,(function(e,r){if(t(e,i++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},a73c:function(t,e,i){var r=i("6d8b"),n=r.retrieve2,s=r.retrieve3,a=r.each,o=r.normalizeCssArray,h=r.isString,c=r.isObject,u=i("e86a"),l=i("5693"),d=i("5e76"),f=i("7d6d"),p=i("82eb"),g=p.ContextCachedBy,m=p.WILL_BE_RESTORED,v=u.DEFAULT_FONT,y={left:1,right:1,center:1},b={top:1,bottom:1,middle:1},_=[["textShadowBlur","shadowBlur",0],["textShadowOffsetX","shadowOffsetX",0],["textShadowOffsetY","shadowOffsetY",0],["textShadowColor","shadowColor","transparent"]],T={},S={};function w(t){return E(t),a(t.rich,E),t}function E(t){if(t){t.font=u.makeFont(t);var e=t.textAlign;"middle"===e&&(e="center"),t.textAlign=null==e||y[e]?e:"left";var i=t.textVerticalAlign||t.textBaseline;"center"===i&&(i="middle"),t.textVerticalAlign=null==i||b[i]?i:"top";var r=t.textPadding;r&&(t.textPadding=o(t.textPadding))}}function x(t,e,i,r,n,s){r.rich?C(t,e,i,r,n,s):A(t,e,i,r,n,s)}function A(t,e,i,r,n,s){"use strict";var a,o=k(r),h=!1,c=e.__attrCachedBy===g.PLAIN_TEXT;s!==m?(s&&(a=s.style,h=!o&&c&&a),e.__attrCachedBy=o?g.NONE:g.PLAIN_TEXT):c&&(e.__attrCachedBy=g.NONE);var l=r.font||v;h&&l===(a.font||v)||(e.font=l);var d=t.__computedFont;t.__styleFont!==l&&(t.__styleFont=l,d=t.__computedFont=e.font);var p=r.textPadding,y=r.textLineHeight,b=t.__textCotentBlock;b&&!t.__dirtyText||(b=t.__textCotentBlock=u.parsePlainText(i,d,p,y,r.truncate));var T=b.outerHeight,w=b.lines,E=b.lineHeight,x=M(S,t,r,n),A=x.baseX,C=x.baseY,R=x.textAlign||"left",I=x.textVerticalAlign;P(e,r,n,A,C);var O=u.adjustTextY(C,T,I),N=A,U=O;if(o||p){var F=u.getWidth(i,d),W=F;p&&(W+=p[1]+p[3]);var H=u.adjustTextX(A,W,R);o&&D(t,e,r,H,O,W,T),p&&(N=z(A,R,p),U+=p[0])}e.textAlign=R,e.textBaseline="middle",e.globalAlpha=r.opacity||1;for(var j=0;j<_.length;j++){var V=_[j],q=V[0],G=V[1],Y=r[q];h&&Y===a[q]||(e[G]=f(e,G,Y||V[2]))}U+=E/2;var $=r.textStrokeWidth,X=h?a.textStrokeWidth:null,Q=!h||$!==X,K=!h||Q||r.textStroke!==a.textStroke,Z=B(r.textStroke,$),J=L(r.textFill);if(Z&&(Q&&(e.lineWidth=$),K&&(e.strokeStyle=Z)),J&&(h&&r.textFill===a.textFill||(e.fillStyle=J)),1===w.length)Z&&e.strokeText(w[0],N,U),J&&e.fillText(w[0],N,U);else for(j=0;j=0&&(T=E[B],"right"===T.textAlign))I(t,e,T,r,A,y,N,"right"),C-=T.width,N-=T.width,B--;O+=(s-(O-v)-(b-N)-C)/2;while(R<=B)T=E[R],I(t,e,T,r,A,y,O+T.width/2,"center"),O+=T.width,R++;y+=A}}function P(t,e,i,r,n){if(i&&e.textRotation){var s=e.textOrigin;"center"===s?(r=i.width/2+i.x,n=i.height/2+i.y):s&&(r=s[0]+i.x,n=s[1]+i.y),t.translate(r,n),t.rotate(-e.textRotation),t.translate(-r,-n)}}function I(t,e,i,r,a,o,h,c){var u=r.rich[i.styleName]||{};u.text=i.text;var l=i.textVerticalAlign,d=o+a/2;"top"===l?d=o+i.height/2:"bottom"===l&&(d=o+a-i.height/2),!i.isLineHolder&&k(u)&&D(t,e,u,"right"===c?h-i.width:"center"===c?h-i.width/2:h,d-i.height/2,i.width,i.height);var f=i.textPadding;f&&(h=z(h,c,f),d-=i.height/2-f[2]-i.textHeight/2),N(e,"shadowBlur",s(u.textShadowBlur,r.textShadowBlur,0)),N(e,"shadowColor",u.textShadowColor||r.textShadowColor||"transparent"),N(e,"shadowOffsetX",s(u.textShadowOffsetX,r.textShadowOffsetX,0)),N(e,"shadowOffsetY",s(u.textShadowOffsetY,r.textShadowOffsetY,0)),N(e,"textAlign",c),N(e,"textBaseline","middle"),N(e,"font",i.font||v);var p=B(u.textStroke||r.textStroke,m),g=L(u.textFill||r.textFill),m=n(u.textStrokeWidth,r.textStrokeWidth);p&&(N(e,"lineWidth",m),N(e,"strokeStyle",p),e.strokeText(i.text,h,d)),g&&(N(e,"fillStyle",g),e.fillText(i.text,h,d))}function k(t){return!!(t.textBackgroundColor||t.textBorderWidth&&t.textBorderColor)}function D(t,e,i,r,n,s,a){var o=i.textBackgroundColor,u=i.textBorderWidth,f=i.textBorderColor,p=h(o);if(N(e,"shadowBlur",i.textBoxShadowBlur||0),N(e,"shadowColor",i.textBoxShadowColor||"transparent"),N(e,"shadowOffsetX",i.textBoxShadowOffsetX||0),N(e,"shadowOffsetY",i.textBoxShadowOffsetY||0),p||u&&f){e.beginPath();var g=i.textBorderRadius;g?l.buildPath(e,{x:r,y:n,width:s,height:a,r:g}):e.rect(r,n,s,a),e.closePath()}if(p)if(N(e,"fillStyle",o),null!=i.fillOpacity){var m=e.globalAlpha;e.globalAlpha=i.fillOpacity*i.opacity,e.fill(),e.globalAlpha=m}else e.fill();else if(c(o)){var v=o.image;v=d.createOrUpdateImage(v,null,t,O,o),v&&d.isImageReady(v)&&e.drawImage(v,r,n,s,a)}if(u&&f)if(N(e,"lineWidth",u),N(e,"strokeStyle",f),null!=i.strokeOpacity){m=e.globalAlpha;e.globalAlpha=i.strokeOpacity*i.opacity,e.stroke(),e.globalAlpha=m}else e.stroke()}function O(t,e){e.image=t}function M(t,e,i,r){var n=i.x||0,s=i.y||0,a=i.textAlign,o=i.textVerticalAlign;if(r){var h=i.textPosition;if(h instanceof Array)n=r.x+U(h[0],r.width),s=r.y+U(h[1],r.height);else{var c=e&&e.calculateTextPosition?e.calculateTextPosition(T,i,r):u.calculateTextPosition(T,i,r);n=c.x,s=c.y,a=a||c.textAlign,o=o||c.textVerticalAlign}var l=i.textOffset;l&&(n+=l[0],s+=l[1])}return t=t||{},t.baseX=n,t.baseY=s,t.textAlign=a,t.textVerticalAlign=o,t}function N(t,e,i){return t[e]=f(t,e,i),t[e]}function B(t,e){return null==t||e<=0||"transparent"===t||"none"===t?null:t.image||t.colorStops?"#000":t}function L(t){return null==t||"none"===t?null:t.image||t.colorStops?"#000":t}function U(t,e){return"string"===typeof t?t.lastIndexOf("%")>=0?parseFloat(t)/100*e:parseFloat(t):t}function z(t,e,i){return"right"===e?t-i[1]:"center"===e?t+i[3]/2-i[1]/2:t+i[3]}function F(t,e){return null!=t&&(t||e.textBackgroundColor||e.textBorderWidth&&e.textBorderColor||e.textPadding)}e.normalizeTextStyle=w,e.renderText=x,e.getBoxPosition=M,e.getStroke=B,e.getFill=L,e.parsePercent=U,e.needDrawText=F},a799:function(t,e,i){"use strict";i("4ec9"),i("10d1");var r=i("d066"),n=i("7c73"),s=i("861d"),a=Object,o=TypeError,h=r("Map"),c=r("WeakMap"),u=function(){this.object=null,this.symbol=null,this.primitives=null,this.objectsByIndex=n(null)};u.prototype.get=function(t,e){return this[t]||(this[t]=e())},u.prototype.next=function(t,e,i){var r=i?this.objectsByIndex[t]||(this.objectsByIndex[t]=new c):this.primitives||(this.primitives=new h),n=r.get(e);return n||r.set(e,n=new u),n};var l=new u;t.exports=function(){var t,e,i=l,r=arguments.length;for(t=0;t>>2]|=n<<24-s%4*8,t.sigBytes+=n},unpad:function(t){var e=255&t.words[t.sigBytes-1>>>2];t.sigBytes-=e}},t.pad.Ansix923}))},a866:function(t,e,i){"use strict";var r=i("d066"),n=i("e330"),s=String.fromCharCode,a=r("String","fromCodePoint"),o=n("".charAt),h=n("".charCodeAt),c=n("".indexOf),u=n("".slice),l=48,d=57,f=97,p=102,g=65,m=70,v=function(t,e){var i=h(t,e);return i>=l&&i<=d},y=function(t,e,i){if(i>=t.length)return-1;for(var r=0;e=l&&t<=d?t-l:t>=f&&t<=p?t-f+10:t>=g&&t<=m?t-g+10:-1};t.exports=function(t){var e,i="",r=0,n=0;while((n=c(t,"\\",n))>-1){if(i+=u(t,r,n),++n===t.length)return;var h=o(t,n++);switch(h){case"b":i+="\b";break;case"t":i+="\t";break;case"n":i+="\n";break;case"v":i+="\v";break;case"f":i+="\f";break;case"r":i+="\r";break;case"\r":n1114111)return;i+=a(e);break;default:if(v(h,0))return;i+=h}r=n}return i+u(t,r)}},a874:function(t,e,i){"use strict";var r=i("23e7"),n=i("145e"),s=i("44d2");r({target:"Array",proto:!0},{copyWithin:n}),s("copyWithin")},a87d:function(t,e,i){var r=i("22d1"),n=i("401b"),s=n.applyTransform,a=i("9850"),o=i("41ef"),h=i("e86a"),c=i("a73c"),u=i("9e2e"),l=i("19eb"),d=i("0da8"),f=i("76a5"),p=i("cbe5"),g=i("20c8"),m=i("42e5"),v=i("d3a4"),y=g.CMD,b=Math.round,_=Math.sqrt,T=Math.abs,S=Math.cos,w=Math.sin,E=Math.max;if(!r.canvasSupported){var x=",",A="progid:DXImageTransform.Microsoft",C=21600,R=C/2,P=1e5,I=1e3,k=function(t){t.style.cssText="position:absolute;left:0;top:0;width:1px;height:1px;",t.coordsize=C+","+C,t.coordorigin="0,0"},D=function(t){return String(t).replace(/&/g,"&").replace(/"/g,""")},O=function(t,e,i){return"rgb("+[t,e,i].join(",")+")"},M=function(t,e){e&&t&&e.parentNode!==t&&t.appendChild(e)},N=function(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)},B=function(t,e,i){return(parseFloat(t)||0)*P+(parseFloat(e)||0)*I+i},L=c.parsePercent,U=function(t,e,i){var r=o.parse(e);i=+i,isNaN(i)&&(i=1),r&&(t.color=O(r[0],r[1],r[2]),t.opacity=i*r[3])},z=function(t){var e=o.parse(t);return[O(e[0],e[1],e[2]),e[3]]},F=function(t,e,i){var r=e.fill;if(null!=r)if(r instanceof m){var n,a=0,o=[0,0],h=0,c=1,u=i.getBoundingRect(),l=u.width,d=u.height;if("linear"===r.type){n="gradient";var f=i.transform,p=[r.x*l,r.y*d],g=[r.x2*l,r.y2*d];f&&(s(p,p,f),s(g,g,f));var v=g[0]-p[0],y=g[1]-p[1];a=180*Math.atan2(v,y)/Math.PI,a<0&&(a+=360),a<1e-6&&(a=0)}else{n="gradientradial";p=[r.x*l,r.y*d],f=i.transform;var b=i.scale,_=l,T=d;o=[(p[0]-u.x)/_,(p[1]-u.y)/T],f&&s(p,p,f),_/=b[0]*C,T/=b[1]*C;var S=E(_,T);h=0/S,c=2*r.r/S-h}var w=r.colorStops.slice();w.sort((function(t,e){return t.offset-e.offset}));for(var x=w.length,A=[],R=[],P=0;P=2){var D=A[0][0],O=A[1][0],M=A[0][1]*e.opacity,N=A[1][1]*e.opacity;t.type=n,t.method="none",t.focus="100%",t.angle=a,t.color=D,t.color2=O,t.colors=R.join(","),t.opacity=N,t.opacity2=M}"radial"===n&&(t.focusposition=o.join(","))}else U(t,r,e.opacity)},W=function(t,e){e.lineDash&&(t.dashstyle=e.lineDash.join(" ")),null==e.stroke||e.stroke instanceof m||U(t,e.stroke,e.opacity)},H=function(t,e,i,r){var n="fill"===e,s=t.getElementsByTagName(e)[0];null!=i[e]&&"none"!==i[e]&&(n||!n&&i.lineWidth)?(t[n?"filled":"stroked"]="true",i[e]instanceof m&&N(t,s),s||(s=v.createNode(e)),n?F(s,i,r):W(s,i),M(t,s)):(t[n?"filled":"stroked"]="false",N(t,s))},j=[[],[],[]],V=function(t,e){var i,r,n,a,o,h,c=y.M,u=y.C,l=y.L,d=y.A,f=y.Q,p=[],g=t.data,m=t.len();for(a=0;a.01?H&&(V+=270/C):Math.abs(q-L)<1e-4?H&&VB?A-=270/C:A+=270/C:H&&qL?E+=270/C:E-=270/C),p.push(G,b(((B-U)*O+k)*C-R),x,b(((L-z)*M+D)*C-R),x,b(((B+U)*O+k)*C-R),x,b(((L+z)*M+D)*C-R),x,b((V*O+k)*C-R),x,b((q*M+D)*C-R),x,b((E*O+k)*C-R),x,b((A*M+D)*C-R)),o=E,h=A;break;case y.R:var Y=j[0],$=j[1];Y[0]=g[a++],Y[1]=g[a++],$[0]=Y[0]+g[a++],$[1]=Y[1]+g[a++],e&&(s(Y,Y,e),s($,$,e)),Y[0]=b(Y[0]*C-R),$[0]=b($[0]*C-R),Y[1]=b(Y[1]*C-R),$[1]=b($[1]*C-R),p.push(" m ",Y[0],x,Y[1]," l ",$[0],x,Y[1]," l ",$[0],x,$[1]," l ",Y[0],x,$[1]);break;case y.Z:p.push(" x ")}if(i>0){p.push(r);for(var X=0;XQ&&(X=0,$={});var i,r=K.style;try{r.font=t,i=r.fontFamily.split(",")[0]}catch(n){}e={style:r.fontStyle||Y,variant:r.fontVariant||Y,weight:r.fontWeight||Y,size:0|parseFloat(r.fontSize||12),family:i||"Microsoft YaHei"},$[t]=e,X++}return e};h.$override("measureText",(function(t,e){var i=v.doc;G||(G=i.createElement("div"),G.style.cssText="position:absolute;top:-20000px;left:0;padding:0;margin:0;border:none;white-space:pre;",v.doc.body.appendChild(G));try{G.style.font=e}catch(r){}return G.innerHTML="",G.appendChild(i.createTextNode(t)),{width:G.offsetWidth}}));for(var J=new a,tt=function(t,e,i,r){var n=this.style;this.__dirty&&c.normalizeTextStyle(n,!0);var a=n.text;if(null!=a&&(a+=""),a){if(n.rich){var o=h.parseRichText(a,n);a=[];for(var u=0;u>>2]>>>16-n%4*8&65535;r.push(String.fromCharCode(s))}return r.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>1]|=t.charCodeAt(n)<<16-n%2*16;return r.create(i,2*e)}};function s(t){return t<<8&4278255360|t>>>8&16711935}n.Utf16LE={stringify:function(t){for(var e=t.words,i=t.sigBytes,r=[],n=0;n>>2]>>>16-n%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(t){for(var e=t.length,i=[],n=0;n>>1]|=s(t.charCodeAt(n)<<16-n%2*16);return r.create(i,2*e)}}}(),t.enc.Utf16}))},a8d7:function(t,e,i){"use strict";var r=i("e330"),n=i("fc6a"),s=i("577e"),a=i("07fa"),o=TypeError,h=r([].push),c=r([].join);t.exports=function(t){var e=n(t),i=a(e);if(!i)return"";var r=arguments.length,u=[],l=0;while(1){var d=e[l++];if(void 0===d)throw new o("Incorrect template");if(h(u,s(d)),l===i)return c(u,"");l1?arguments[1]:void 0,f=i>2?arguments[2]:void 0;return new(d("Promise"))((function(i){var d=s(t);void 0!==n&&(n=r(n,f));var p=l(d,v),y=p?void 0:u(d)||_,b=a(e)?new e:[],T=p?o(d,p):new g(c(h(d,y)));i(m(T,n,b))}))}},a975:function(t,e,i){"use strict";var r=i("ebb5"),n=i("b727").every,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("every",(function(t){return n(s(this),t,arguments.length>1?arguments[1]:void 0)}))},a98e:function(t,e,i){"use strict";var r=i("0366"),n=i("825a"),s=i("7b0b"),a=i("2266");t.exports=function(t,e,i){return function(o){var h=s(o),c=arguments.length,u=c>1?arguments[1]:void 0,l=void 0!==u,d=l?r(u,c>2?arguments[2]:void 0):void 0,f=new t,p=0;return a(h,(function(t){var r=l?d(t,p++):t;i?e(f,n(r)[0],r[1]):e(f,r)})),f}}},a9a1:function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("dc19"),a=i("384f");r({target:"Set",proto:!0,real:!0,forced:!0},{some:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0);return!0===a(e,(function(t){if(i(t,t,e))return!0}),!0)}})},a9cd:function(t,e,i){"use strict";var r=i("23e7"),n=i("db82"),s=i("2266"),a=i("094a").set;r({target:"Map",proto:!0,real:!0,arity:1,forced:!0},{merge:function(t){var e=n(this),i=arguments.length,r=0;while(r2)if(c=_(c),e=C(c,0),43===e||45===e){if(i=C(c,2),88===i||120===i)return NaN}else if(48===e){switch(C(c,1)){case 66:case 98:r=2,n=49;break;case 79:case 111:r=8,n=55;break;default:return+c}for(s=A(c,2),a=s.length,o=0;on)return NaN;return parseInt(s,r)}return+c},I=c(T,!S(" 0o1")||!S("0b1")||S("+0x1")),k=function(t){return d(E,t)&&g((function(){b(t)}))},D=function(t){var e=arguments.length<1?0:S(R(t));return k(this)?l(Object(e),this,D):e};D.prototype=E,I&&!n&&(E.constructor=D),r({global:!0,constructor:!0,wrap:!0,forced:I},{Number:D});var O=function(t,e){for(var i,r=s?m(e):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,isFinite,isInteger,isNaN,isSafeInteger,parseFloat,parseInt,fromString,range".split(","),n=0;r.length>n;n++)u(e,i=r[n])&&!u(t,i)&&y(t,i,v(e,i))};n&&w&&O(o[T],w),(I||n)&&O(o[T],S)},aa01:function(t,e,i){"use strict";var r=i("23e7"),n=i("783c"),s=i("825a"),a=n.toKey,o=n.set;r({target:"Reflect",stat:!0},{metadata:function(t,e){return function(i,r){o(t,e,s(i),a(r))}}})},aa1f:function(t,e,i){"use strict";var r=i("83ab"),n=i("d039"),s=i("825a"),a=i("e391"),o=Error.prototype.toString,h=n((function(){if(r){var t=Object.create(Object.defineProperty({},"name",{get:function(){return this===t}}));if("true"!==o.call(t))return!0}return"2: 1"!==o.call({message:1,name:2})||"Error"!==o.call({})}));t.exports=h?function(){var t=s(this),e=a(t.name,"Error"),i=a(t.message);return e?i?e+": "+i:e:i}:o},aaef:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){ /** @preserve * Counter block mode compatible with Dr Brian Gladman fileenc.c * derived from CryptoJS.mode.CTR * Jan Hruby jhruby.web@gmail.com */ return t.mode.CTRGladman=function(){var e=t.lib.BlockCipherMode.extend();function i(t){if(255===(t>>24&255)){var e=t>>16&255,i=t>>8&255,r=255&t;255===e?(e=0,255===i?(i=0,255===r?r=0:++r):++i):++e,t=0,t+=e<<16,t+=i<<8,t+=r}else t+=1<<24;return t}function r(t){return 0===(t[0]=i(t[0]))&&(t[1]=i(t[1])),t}var n=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,n=i.blockSize,s=this._iv,a=this._counter;s&&(a=this._counter=s.slice(0),this._iv=void 0),r(a);var o=a.slice(0);i.encryptBlock(o,0);for(var h=0;h=u)return e<<15|31744;if(t2&&arguments[2])}})},ab36:function(t,e,i){"use strict";var r=i("861d"),n=i("9112");t.exports=function(t,e){r(e)&&"cause"in e&&n(t,"cause",e.cause)}},ab3c:function(t,e,i){"use strict";i("db9b")},ab43:function(t,e,i){"use strict";var r=i("23e7"),n=i("d024"),s=i("c430");r({target:"Iterator",proto:!0,real:!0,forced:s},{map:n})},abc1:function(t,e,i){"use strict";var r=RangeError;t.exports=function(t){if(t===t)return t;throw new r("NaN is not allowed")}},ac0f:function(t,e,i){var r=i("cbe5"),n=i("401b"),s=i("4a3f"),a=s.quadraticSubdivide,o=s.cubicSubdivide,h=s.quadraticAt,c=s.cubicAt,u=s.quadraticDerivativeAt,l=s.cubicDerivativeAt,d=[];function f(t,e,i){var r=t.cpx2,n=t.cpy2;return null===r||null===n?[(i?l:c)(t.x1,t.cpx1,t.cpx2,t.x2,e),(i?l:c)(t.y1,t.cpy1,t.cpy2,t.y2,e)]:[(i?u:h)(t.x1,t.cpx1,t.x2,e),(i?u:h)(t.y1,t.cpy1,t.y2,e)]}var p=r.extend({type:"bezier-curve",shape:{x1:0,y1:0,x2:0,y2:0,cpx1:0,cpy1:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i=e.x1,r=e.y1,n=e.x2,s=e.y2,h=e.cpx1,c=e.cpy1,u=e.cpx2,l=e.cpy2,f=e.percent;0!==f&&(t.moveTo(i,r),null==u||null==l?(f<1&&(a(i,h,n,f,d),h=d[1],n=d[2],a(r,c,s,f,d),c=d[1],s=d[2]),t.quadraticCurveTo(h,c,n,s)):(f<1&&(o(i,h,u,n,f,d),h=d[1],u=d[2],n=d[3],o(r,c,l,s,f,d),c=d[1],l=d[2],s=d[3]),t.bezierCurveTo(h,c,u,l,n,s)))},pointAt:function(t){return f(this.shape,t,!1)},tangentAt:function(t){var e=f(this.shape,t,!0);return n.normalize(e,e)}});t.exports=p},ac16:function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("06cf").f;r({target:"Reflect",stat:!0},{deleteProperty:function(t,e){var i=s(n(t),e);return!(i&&!i.configurable)&&delete t[e]}})},ac1f:function(t,e,i){"use strict";var r=i("23e7"),n=i("9263");r({target:"RegExp",proto:!0,forced:/./.exec!==n},{exec:n})},acac:function(t,e,i){"use strict";var r=i("e330"),n=i("6964"),s=i("f183").getWeakData,a=i("19aa"),o=i("825a"),h=i("7234"),c=i("861d"),u=i("2266"),l=i("b727"),d=i("1a2d"),f=i("69f3"),p=f.set,g=f.getterFor,m=l.find,v=l.findIndex,y=r([].splice),b=0,_=function(t){return t.frozen||(t.frozen=new T)},T=function(){this.entries=[]},S=function(t,e){return m(t.entries,(function(t){return t[0]===e}))};T.prototype={get:function(t){var e=S(this,t);if(e)return e[1]},has:function(t){return!!S(this,t)},set:function(t,e){var i=S(this,t);i?i[1]=e:this.entries.push([t,e])},delete:function(t){var e=v(this.entries,(function(e){return e[0]===t}));return~e&&y(this.entries,e,1),!!~e}},t.exports={getConstructor:function(t,e,i,r){var l=t((function(t,n){a(t,f),p(t,{type:e,id:b++,frozen:null}),h(n)||u(n,t[r],{that:t,AS_ENTRIES:i})})),f=l.prototype,m=g(e),v=function(t,e,i){var r=m(t),n=s(o(e),!0);return!0===n?_(r).set(e,i):n[r.id]=i,t};return n(f,{delete:function(t){var e=m(this);if(!c(t))return!1;var i=s(t);return!0===i?_(e)["delete"](t):i&&d(i,e.id)&&delete i[e.id]},has:function(t){var e=m(this);if(!c(t))return!1;var i=s(t);return!0===i?_(e).has(t):i&&d(i,e.id)}}),n(f,i?{get:function(t){var e=m(this);if(c(t)){var i=s(t);if(!0===i)return _(e).get(t);if(i)return i[e.id]}},set:function(t,e){return v(this,t,e)}}:{add:function(t){return v(this,t,!0)}}),l}}},accc:function(t,e,i){"use strict";var r=i("23e7"),n=i("64e5");r({target:"Date",proto:!0,forced:Date.prototype.toISOString!==n},{toISOString:n})},acd8:function(t,e,i){"use strict";var r=i("23e7"),n=i("7e12");r({global:!0,forced:parseFloat!==n},{parseFloat:n})},ace4:function(t,e,i){"use strict";var r=i("23e7"),n=i("4625"),s=i("d039"),a=i("621a"),o=i("825a"),h=i("23cb"),c=i("50c4"),u=a.ArrayBuffer,l=a.DataView,d=l.prototype,f=n(u.prototype.slice),p=n(d.getUint8),g=n(d.setUint8),m=s((function(){return!new u(2).slice(1,void 0).byteLength}));r({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:m},{slice:function(t,e){if(f&&void 0===e)return f(o(this),t);var i=o(this).byteLength,r=h(t,i),n=h(void 0===e?i:e,i),s=new u(c(n-r)),a=new l(this),d=new l(s),m=0;while(r1&&!d(arguments[1])?m(arguments[1]):void 0,n=r?r.transfer:void 0;void 0!==n&&(e=new L,i=ft(n,e));var s=dt(t,e);return i&&pt(i),s}})},ad6d:function(t,e,i){"use strict";var r=i("825a");t.exports=function(){var t=r(this),e="";return t.hasIndices&&(e+="d"),t.global&&(e+="g"),t.ignoreCase&&(e+="i"),t.multiline&&(e+="m"),t.dotAll&&(e+="s"),t.unicode&&(e+="u"),t.unicodeSets&&(e+="v"),t.sticky&&(e+="y"),e}},ad9d:function(t,e,i){"use strict";i("5b81")},adbd:function(t,e,i){"use strict";var r=i("23e7"),n=i("4c1f"),s=i("3fde");r({target:"WeakSet",stat:!0,forced:!0},{of:s(n.WeakSet,n.add,!1)})},addb:function(t,e,i){"use strict";var r=i("f36a"),n=Math.floor,s=function(t,e){var i=t.length;if(i<8){var a,o,h=1;while(h0)t[o]=t[--o];o!==h++&&(t[o]=a)}}else{var c=n(i/2),u=s(r(t,0,c),e),l=s(r(t,c),e),d=u.length,f=l.length,p=0,g=0;while(p1?arguments[1]:void 0;return n(this,t,e)}}),s("group")},af03:function(t,e,i){"use strict";var r=i("d039");t.exports=function(t){return r((function(){var e=""[t]('"');return e!==e.toLowerCase()||e.split('"').length>3}))}},af5b:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("1132"),i("72fe"),i("2b79"),i("38ba"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.BlockCipher,n=e.algo;const s=16,a=[608135816,2242054355,320440878,57701188,2752067618,698298832,137296536,3964562569,1160258022,953160567,3193202383,887688300,3232508343,3380367581,1065670069,3041331479,2450970073,2306472731],o=[[3509652390,2564797868,805139163,3491422135,3101798381,1780907670,3128725573,4046225305,614570311,3012652279,134345442,2240740374,1667834072,1901547113,2757295779,4103290238,227898511,1921955416,1904987480,2182433518,2069144605,3260701109,2620446009,720527379,3318853667,677414384,3393288472,3101374703,2390351024,1614419982,1822297739,2954791486,3608508353,3174124327,2024746970,1432378464,3864339955,2857741204,1464375394,1676153920,1439316330,715854006,3033291828,289532110,2706671279,2087905683,3018724369,1668267050,732546397,1947742710,3462151702,2609353502,2950085171,1814351708,2050118529,680887927,999245976,1800124847,3300911131,1713906067,1641548236,4213287313,1216130144,1575780402,4018429277,3917837745,3693486850,3949271944,596196993,3549867205,258830323,2213823033,772490370,2760122372,1774776394,2652871518,566650946,4142492826,1728879713,2882767088,1783734482,3629395816,2517608232,2874225571,1861159788,326777828,3124490320,2130389656,2716951837,967770486,1724537150,2185432712,2364442137,1164943284,2105845187,998989502,3765401048,2244026483,1075463327,1455516326,1322494562,910128902,469688178,1117454909,936433444,3490320968,3675253459,1240580251,122909385,2157517691,634681816,4142456567,3825094682,3061402683,2540495037,79693498,3249098678,1084186820,1583128258,426386531,1761308591,1047286709,322548459,995290223,1845252383,2603652396,3431023940,2942221577,3202600964,3727903485,1712269319,422464435,3234572375,1170764815,3523960633,3117677531,1434042557,442511882,3600875718,1076654713,1738483198,4213154764,2393238008,3677496056,1014306527,4251020053,793779912,2902807211,842905082,4246964064,1395751752,1040244610,2656851899,3396308128,445077038,3742853595,3577915638,679411651,2892444358,2354009459,1767581616,3150600392,3791627101,3102740896,284835224,4246832056,1258075500,768725851,2589189241,3069724005,3532540348,1274779536,3789419226,2764799539,1660621633,3471099624,4011903706,913787905,3497959166,737222580,2514213453,2928710040,3937242737,1804850592,3499020752,2949064160,2386320175,2390070455,2415321851,4061277028,2290661394,2416832540,1336762016,1754252060,3520065937,3014181293,791618072,3188594551,3933548030,2332172193,3852520463,3043980520,413987798,3465142937,3030929376,4245938359,2093235073,3534596313,375366246,2157278981,2479649556,555357303,3870105701,2008414854,3344188149,4221384143,3956125452,2067696032,3594591187,2921233993,2428461,544322398,577241275,1471733935,610547355,4027169054,1432588573,1507829418,2025931657,3646575487,545086370,48609733,2200306550,1653985193,298326376,1316178497,3007786442,2064951626,458293330,2589141269,3591329599,3164325604,727753846,2179363840,146436021,1461446943,4069977195,705550613,3059967265,3887724982,4281599278,3313849956,1404054877,2845806497,146425753,1854211946],[1266315497,3048417604,3681880366,3289982499,290971e4,1235738493,2632868024,2414719590,3970600049,1771706367,1449415276,3266420449,422970021,1963543593,2690192192,3826793022,1062508698,1531092325,1804592342,2583117782,2714934279,4024971509,1294809318,4028980673,1289560198,2221992742,1669523910,35572830,157838143,1052438473,1016535060,1802137761,1753167236,1386275462,3080475397,2857371447,1040679964,2145300060,2390574316,1461121720,2956646967,4031777805,4028374788,33600511,2920084762,1018524850,629373528,3691585981,3515945977,2091462646,2486323059,586499841,988145025,935516892,3367335476,2599673255,2839830854,265290510,3972581182,2759138881,3795373465,1005194799,847297441,406762289,1314163512,1332590856,1866599683,4127851711,750260880,613907577,1450815602,3165620655,3734664991,3650291728,3012275730,3704569646,1427272223,778793252,1343938022,2676280711,2052605720,1946737175,3164576444,3914038668,3967478842,3682934266,1661551462,3294938066,4011595847,840292616,3712170807,616741398,312560963,711312465,1351876610,322626781,1910503582,271666773,2175563734,1594956187,70604529,3617834859,1007753275,1495573769,4069517037,2549218298,2663038764,504708206,2263041392,3941167025,2249088522,1514023603,1998579484,1312622330,694541497,2582060303,2151582166,1382467621,776784248,2618340202,3323268794,2497899128,2784771155,503983604,4076293799,907881277,423175695,432175456,1378068232,4145222326,3954048622,3938656102,3820766613,2793130115,2977904593,26017576,3274890735,3194772133,1700274565,1756076034,4006520079,3677328699,720338349,1533947780,354530856,688349552,3973924725,1637815568,332179504,3949051286,53804574,2852348879,3044236432,1282449977,3583942155,3416972820,4006381244,1617046695,2628476075,3002303598,1686838959,431878346,2686675385,1700445008,1080580658,1009431731,832498133,3223435511,2605976345,2271191193,2516031870,1648197032,4164389018,2548247927,300782431,375919233,238389289,3353747414,2531188641,2019080857,1475708069,455242339,2609103871,448939670,3451063019,1395535956,2413381860,1841049896,1491858159,885456874,4264095073,4001119347,1565136089,3898914787,1108368660,540939232,1173283510,2745871338,3681308437,4207628240,3343053890,4016749493,1699691293,1103962373,3625875870,2256883143,3830138730,1031889488,3479347698,1535977030,4236805024,3251091107,2132092099,1774941330,1199868427,1452454533,157007616,2904115357,342012276,595725824,1480756522,206960106,497939518,591360097,863170706,2375253569,3596610801,1814182875,2094937945,3421402208,1082520231,3463918190,2785509508,435703966,3908032597,1641649973,2842273706,3305899714,1510255612,2148256476,2655287854,3276092548,4258621189,236887753,3681803219,274041037,1734335097,3815195456,3317970021,1899903192,1026095262,4050517792,356393447,2410691914,3873677099,3682840055],[3913112168,2491498743,4132185628,2489919796,1091903735,1979897079,3170134830,3567386728,3557303409,857797738,1136121015,1342202287,507115054,2535736646,337727348,3213592640,1301675037,2528481711,1895095763,1721773893,3216771564,62756741,2142006736,835421444,2531993523,1442658625,3659876326,2882144922,676362277,1392781812,170690266,3921047035,1759253602,3611846912,1745797284,664899054,1329594018,3901205900,3045908486,2062866102,2865634940,3543621612,3464012697,1080764994,553557557,3656615353,3996768171,991055499,499776247,1265440854,648242737,3940784050,980351604,3713745714,1749149687,3396870395,4211799374,3640570775,1161844396,3125318951,1431517754,545492359,4268468663,3499529547,1437099964,2702547544,3433638243,2581715763,2787789398,1060185593,1593081372,2418618748,4260947970,69676912,2159744348,86519011,2512459080,3838209314,1220612927,3339683548,133810670,1090789135,1078426020,1569222167,845107691,3583754449,4072456591,1091646820,628848692,1613405280,3757631651,526609435,236106946,48312990,2942717905,3402727701,1797494240,859738849,992217954,4005476642,2243076622,3870952857,3732016268,765654824,3490871365,2511836413,1685915746,3888969200,1414112111,2273134842,3281911079,4080962846,172450625,2569994100,980381355,4109958455,2819808352,2716589560,2568741196,3681446669,3329971472,1835478071,660984891,3704678404,4045999559,3422617507,3040415634,1762651403,1719377915,3470491036,2693910283,3642056355,3138596744,1364962596,2073328063,1983633131,926494387,3423689081,2150032023,4096667949,1749200295,3328846651,309677260,2016342300,1779581495,3079819751,111262694,1274766160,443224088,298511866,1025883608,3806446537,1145181785,168956806,3641502830,3584813610,1689216846,3666258015,3200248200,1692713982,2646376535,4042768518,1618508792,1610833997,3523052358,4130873264,2001055236,3610705100,2202168115,4028541809,2961195399,1006657119,2006996926,3186142756,1430667929,3210227297,1314452623,4074634658,4101304120,2273951170,1399257539,3367210612,3027628629,1190975929,2062231137,2333990788,2221543033,2438960610,1181637006,548689776,2362791313,3372408396,3104550113,3145860560,296247880,1970579870,3078560182,3769228297,1714227617,3291629107,3898220290,166772364,1251581989,493813264,448347421,195405023,2709975567,677966185,3703036547,1463355134,2715995803,1338867538,1343315457,2802222074,2684532164,233230375,2599980071,2000651841,3277868038,1638401717,4028070440,3237316320,6314154,819756386,300326615,590932579,1405279636,3267499572,3150704214,2428286686,3959192993,3461946742,1862657033,1266418056,963775037,2089974820,2263052895,1917689273,448879540,3550394620,3981727096,150775221,3627908307,1303187396,508620638,2975983352,2726630617,1817252668,1876281319,1457606340,908771278,3720792119,3617206836,2455994898,1729034894,1080033504],[976866871,3556439503,2881648439,1522871579,1555064734,1336096578,3548522304,2579274686,3574697629,3205460757,3593280638,3338716283,3079412587,564236357,2993598910,1781952180,1464380207,3163844217,3332601554,1699332808,1393555694,1183702653,3581086237,1288719814,691649499,2847557200,2895455976,3193889540,2717570544,1781354906,1676643554,2592534050,3230253752,1126444790,2770207658,2633158820,2210423226,2615765581,2414155088,3127139286,673620729,2805611233,1269405062,4015350505,3341807571,4149409754,1057255273,2012875353,2162469141,2276492801,2601117357,993977747,3918593370,2654263191,753973209,36408145,2530585658,25011837,3520020182,2088578344,530523599,2918365339,1524020338,1518925132,3760827505,3759777254,1202760957,3985898139,3906192525,674977740,4174734889,2031300136,2019492241,3983892565,4153806404,3822280332,352677332,2297720250,60907813,90501309,3286998549,1016092578,2535922412,2839152426,457141659,509813237,4120667899,652014361,1966332200,2975202805,55981186,2327461051,676427537,3255491064,2882294119,3433927263,1307055953,942726286,933058658,2468411793,3933900994,4215176142,1361170020,2001714738,2830558078,3274259782,1222529897,1679025792,2729314320,3714953764,1770335741,151462246,3013232138,1682292957,1483529935,471910574,1539241949,458788160,3436315007,1807016891,3718408830,978976581,1043663428,3165965781,1927990952,4200891579,2372276910,3208408903,3533431907,1412390302,2931980059,4132332400,1947078029,3881505623,4168226417,2941484381,1077988104,1320477388,886195818,18198404,3786409e3,2509781533,112762804,3463356488,1866414978,891333506,18488651,661792760,1628790961,3885187036,3141171499,876946877,2693282273,1372485963,791857591,2686433993,3759982718,3167212022,3472953795,2716379847,445679433,3561995674,3504004811,3574258232,54117162,3331405415,2381918588,3769707343,4154350007,1140177722,4074052095,668550556,3214352940,367459370,261225585,2610173221,4209349473,3468074219,3265815641,314222801,3066103646,3808782860,282218597,3406013506,3773591054,379116347,1285071038,846784868,2669647154,3771962079,3550491691,2305946142,453669953,1268987020,3317592352,3279303384,3744833421,2610507566,3859509063,266596637,3847019092,517658769,3462560207,3443424879,370717030,4247526661,2224018117,4143653529,4112773975,2788324899,2477274417,1456262402,2901442914,1517677493,1846949527,2295493580,3734397586,2176403920,1280348187,1908823572,3871786941,846861322,1172426758,3287448474,3383383037,1655181056,3139813346,901632758,1897031941,2986607138,3066810236,3447102507,1393639104,373351379,950779232,625454576,3124240540,4148612726,2007998917,544563296,2244738638,2330496472,2058025392,1291430526,424198748,50039436,29584100,3605783033,2429876329,2791104160,1057563949,3255363231,3075367218,3463963227,1469046755,985887462]];var h={pbox:[],sbox:[]};function c(t,e){let i=e>>24&255,r=e>>16&255,n=e>>8&255,s=255&e,a=t.sbox[0][i]+t.sbox[1][r];return a^=t.sbox[2][n],a+=t.sbox[3][s],a}function u(t,e,i){let r,n=e,a=i;for(let o=0;o1;--o)n^=t.pbox[o],a=c(t,n)^a,r=n,n=a,a=r;return r=n,n=a,a=r,a^=t.pbox[1],n^=t.pbox[0],{left:n,right:a}}function d(t,e,i){for(let s=0;s<4;s++){t.sbox[s]=[];for(let e=0;e<256;e++)t.sbox[s][e]=o[s][e]}let r=0;for(let o=0;o=i&&(r=0);let n=0,h=0,c=0;for(let a=0;a=0&&(this.delFromStorage(t),this._roots.splice(a,1),t instanceof s&&t.delChildrenFromStorage(this))}},addToStorage:function(t){return t&&(t.__storage=this,t.dirty(!1)),this},delFromStorage:function(t){return t&&(t.__storage=null),this},dispose:function(){this._renderList=this._roots=null},displayableSortFunc:o};var c=h;t.exports=c},aff5:function(t,e,i){"use strict";var r=i("23e7");r({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MAX_SAFE_INTEGER:9007199254740991})},b041:function(t,e,i){"use strict";var r=i("00ee"),n=i("f5df");t.exports=r?{}.toString:function(){return"[object "+n(this)+"]"}},b0c0:function(t,e,i){"use strict";var r=i("83ab"),n=i("5e77").EXISTS,s=i("e330"),a=i("edd0"),o=Function.prototype,h=s(o.toString),c=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,u=s(c.exec),l="name";r&&!n&&a(o,l,{configurable:!0,get:function(){try{return u(c,h(this))[1]}catch(t){return""}}})},b10f:function(t,e,i){"use strict";var r=i("23e7"),n=i("783c"),s=i("825a"),a=n.keys,o=n.toKey;r({target:"Reflect",stat:!0},{getOwnMetadataKeys:function(t){var e=arguments.length<2?void 0:o(arguments[1]);return a(s(t),e)}})},b16f:function(t,e,i){var r=i("4ab1"),n=i("6d8b"),s=i("4942"),a=i("41ef");function o(t,e){r.call(this,t,e,["linearGradient","radialGradient"],"__gradient_in_use__")}n.inherits(o,r),o.prototype.addWithoutUpdate=function(t,e){if(e&&e.style){var i=this;n.each(["fill","stroke"],(function(r){if(e.style[r]&&("linear"===e.style[r].type||"radial"===e.style[r].type)){var n,s=e.style[r],a=i.getDefs(!0);s._dom?(n=s._dom,a.contains(s._dom)||i.addDom(n)):n=i.add(s),i.markUsed(e);var o=n.getAttribute("id");t.setAttribute(r,"url(#"+o+")")}}))}},o.prototype.add=function(t){var e;if("linear"===t.type)e=this.createElement("linearGradient");else{if("radial"!==t.type)return s("Illegal gradient type."),null;e=this.createElement("radialGradient")}return t.id=t.id||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-gradient-"+t.id),this.updateDom(t,e),this.addDom(e),e},o.prototype.update=function(t){var e=this;r.prototype.update.call(this,t,(function(){var i=t.type,r=t._dom.tagName;"linear"===i&&"linearGradient"===r||"radial"===i&&"radialGradient"===r?e.updateDom(t,t._dom):(e.removeDom(t),e.add(t))}))},o.prototype.updateDom=function(t,e){if("linear"===t.type)e.setAttribute("x1",t.x),e.setAttribute("y1",t.y),e.setAttribute("x2",t.x2),e.setAttribute("y2",t.y2);else{if("radial"!==t.type)return void s("Illegal gradient type.");e.setAttribute("cx",t.x),e.setAttribute("cy",t.y),e.setAttribute("r",t.r)}t.global?e.setAttribute("gradientUnits","userSpaceOnUse"):e.setAttribute("gradientUnits","objectBoundingBox"),e.innerHTML="";for(var i=t.colorStops,r=0,n=i.length;r-1){var c=a.parse(h)[3],u=a.toHex(h);o.setAttribute("stop-color","#"+u),o.setAttribute("stop-opacity",c)}else o.setAttribute("stop-color",i[r].color);e.appendChild(o)}t._dom=e},o.prototype.markUsed=function(t){if(t.style){var e=t.style.fill;e&&e._dom&&r.prototype.markUsed.call(this,e._dom),e=t.style.stroke,e&&e._dom&&r.prototype.markUsed.call(this,e._dom)}};var h=o;t.exports=h},b24c:function(t,e,i){"use strict";var r=i("23e7"),n=i("1d6f");r({target:"Iterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:n})},b294:function(t,e,i){"use strict";var r=i("23e7"),n=i("4c1f"),s=i("a98e");r({target:"WeakSet",stat:!0,forced:!0},{from:s(n.WeakSet,n.add,!1)})},b2c1:function(t,e,i){"use strict";i("40e9")},b2ff:function(t,e,i){"use strict";var r=i("23e7"),n=i("6fb5");r({target:"Function",proto:!0,forced:!0,name:"demethodize"},{unThis:n})},b37e:function(t,e,i){"use strict";var r=i("b622"),n=i("9bf2").f,s=r("metadata"),a=Function.prototype;void 0===a[s]&&n(a,s,{value:null})},b38e:function(t,e,i){"use strict";var r=i("23e7"),n=i("a640"),s=i("44d2"),a=i("48d1"),o=i("c430");r({target:"Array",proto:!0,name:"groupToMap",forced:o||!n("groupByToMap")},{groupByToMap:a}),s("groupByToMap")},b39a:function(t,e,i){"use strict";var r=i("cfe9"),n=i("2ba4"),s=i("ebb5"),a=i("d039"),o=i("f36a"),h=r.Int8Array,c=s.aTypedArray,u=s.exportTypedArrayMethod,l=[].toLocaleString,d=!!h&&a((function(){l.call(new h(1))})),f=a((function(){return[1,2].toLocaleString()!==new h([1,2]).toLocaleString()}))||!a((function(){h.prototype.toLocaleString.call([1,2])}));u("toLocaleString",(function(){return n(l,d?o(c(this)):c(this),o(arguments))}),f)},b420:function(t,e,i){"use strict";i("4d20")},b423:function(t,e,i){"use strict";var r=i("23e7"),n=i("e9e0");r({target:"Map",proto:!0,real:!0,name:"upsert",forced:!0},{updateOrInsert:n})},b42e:function(t,e,i){"use strict";var r=Math.ceil,n=Math.floor;t.exports=Math.trunc||function(t){var e=+t;return(e>0?n:r)(e)}},b431:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=Math.pow,a=31,o=1023,h=s(2,-24),c=.0009765625,u=function(t){var e=t>>>15,i=t>>>10&a,r=t&o;return i===a?0===r?0===e?1/0:-1/0:NaN:0===i?r*(0===e?h:-h):s(2,i-15)*(0===e?1+r*c:-1-r*c)},l=n(DataView.prototype.getUint16);r({target:"DataView",proto:!0},{getFloat16:function(t){var e=l(this,t,arguments.length>1&&arguments[1]);return u(e)}})},b4bc:function(t,e,i){"use strict";var r=i("dc19"),n=i("cb27").has,s=i("8e16"),a=i("7f65"),o=i("384f"),h=i("5388"),c=i("2a62");t.exports=function(t){var e=r(this),i=a(t);if(s(e)<=i.size)return!1!==o(e,(function(t){if(i.includes(t))return!1}),!0);var u=i.getIterator();return!1!==h(u,(function(t){if(n(e,t))return c(u,"normal",!1)}))}},b4f8:function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("1a2d"),a=i("577e"),o=i("5692"),h=i("0b43"),c=o("string-to-symbol-registry"),u=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!h},{for:function(t){var e=a(t);if(s(c,e))return c[e];var i=n("Symbol")(e);return c[e]=i,u[i]=e,i}})},b50d:function(t,e,i){"use strict";var r=i("c532"),n=i("467f"),s=i("7aac"),a=i("30b5"),o=i("83b9e"),h=i("c345"),c=i("3934"),u=i("2d83"),l=i("2444"),d=i("7a77");t.exports=function(t){return new Promise((function(e,i){var f,p=t.data,g=t.headers,m=t.responseType;function v(){t.cancelToken&&t.cancelToken.unsubscribe(f),t.signal&&t.signal.removeEventListener("abort",f)}r.isFormData(p)&&delete g["Content-Type"];var y=new XMLHttpRequest;if(t.auth){var b=t.auth.username||"",_=t.auth.password?unescape(encodeURIComponent(t.auth.password)):"";g.Authorization="Basic "+btoa(b+":"+_)}var T=o(t.baseURL,t.url);function S(){if(y){var r="getAllResponseHeaders"in y?h(y.getAllResponseHeaders()):null,s=m&&"text"!==m&&"json"!==m?y.response:y.responseText,a={data:s,status:y.status,statusText:y.statusText,headers:r,config:t,request:y};n((function(t){e(t),v()}),(function(t){i(t),v()}),a),y=null}}if(y.open(t.method.toUpperCase(),a(T,t.params,t.paramsSerializer),!0),y.timeout=t.timeout,"onloadend"in y?y.onloadend=S:y.onreadystatechange=function(){y&&4===y.readyState&&(0!==y.status||y.responseURL&&0===y.responseURL.indexOf("file:"))&&setTimeout(S)},y.onabort=function(){y&&(i(u("Request aborted",t,"ECONNABORTED",y)),y=null)},y.onerror=function(){i(u("Network Error",t,null,y)),y=null},y.ontimeout=function(){var e=t.timeout?"timeout of "+t.timeout+"ms exceeded":"timeout exceeded",r=t.transitional||l.transitional;t.timeoutErrorMessage&&(e=t.timeoutErrorMessage),i(u(e,t,r.clarifyTimeoutError?"ETIMEDOUT":"ECONNABORTED",y)),y=null},r.isStandardBrowserEnv()){var w=(t.withCredentials||c(T))&&t.xsrfCookieName?s.read(t.xsrfCookieName):void 0;w&&(g[t.xsrfHeaderName]=w)}"setRequestHeader"in y&&r.forEach(g,(function(t,e){"undefined"===typeof p&&"content-type"===e.toLowerCase()?delete g[e]:y.setRequestHeader(e,t)})),r.isUndefined(t.withCredentials)||(y.withCredentials=!!t.withCredentials),m&&"json"!==m&&(y.responseType=t.responseType),"function"===typeof t.onDownloadProgress&&y.addEventListener("progress",t.onDownloadProgress),"function"===typeof t.onUploadProgress&&y.upload&&y.upload.addEventListener("progress",t.onUploadProgress),(t.cancelToken||t.signal)&&(f=function(t){y&&(i(!t||t&&t.type?new d("canceled"):t),y.abort(),y=null)},t.cancelToken&&t.cancelToken.subscribe(f),t.signal&&(t.signal.aborted?f():t.signal.addEventListener("abort",f))),p||(p=null),y.send(p)}))}},b56e:function(t,e,i){"use strict";var r=i("1626"),n=i("861d"),s=i("9bf2"),a=i("3a9b"),o=i("b622"),h=i("13d2"),c=o("hasInstance"),u=Function.prototype;c in u||s.f(u,c,{value:h((function(t){if(!r(this)||!n(t))return!1;var e=this.prototype;return n(e)?a(e,t):t instanceof this}),c)})},b575:function(t,e,i){"use strict";var r,n,s,a,o,h=i("cfe9"),c=i("157a"),u=i("0366"),l=i("2cf49").set,d=i("01b4"),f=i("52c8"),p=i("ebc1"),g=i("ec87"),m=i("9adc"),v=h.MutationObserver||h.WebKitMutationObserver,y=h.document,b=h.process,_=h.Promise,T=c("queueMicrotask");if(!T){var S=new d,w=function(){var t,e;m&&(t=b.domain)&&t.exit();while(e=S.get())try{e()}catch(i){throw S.head&&r(),i}t&&t.enter()};f||m||g||!v||!y?!p&&_&&_.resolve?(a=_.resolve(void 0),a.constructor=_,o=u(a.then,a),r=function(){o(w)}):m?r=function(){b.nextTick(w)}:(l=u(l,h),r=function(){l(w)}):(n=!0,s=y.createTextNode(""),new v(w).observe(s,{characterData:!0}),r=function(){s.data=n=!n}),T=function(t){S.head||r(),S.add(t)}}t.exports=T},b5db:function(t,e,i){"use strict";var r=i("cfe9"),n=r.navigator,s=n&&n.userAgent;t.exports=s?String(s):""},b620:function(t,e,i){"use strict";var r=i("cfe9"),n=i("7282"),s=i("c6b6"),a=r.ArrayBuffer,o=r.TypeError;t.exports=a&&n(a.prototype,"byteLength","get")||function(t){if("ArrayBuffer"!==s(t))throw new o("ArrayBuffer expected");return t.byteLength}},b622:function(t,e,i){"use strict";var r=i("cfe9"),n=i("5692"),s=i("1a2d"),a=i("90e3"),o=i("04f8"),h=i("fdbf"),c=r.Symbol,u=n("wks"),l=h?c["for"]||c:c&&c.withoutSetter||a;t.exports=function(t){return s(u,t)||(u[t]=o&&s(c,t)?c[t]:l("Symbol."+t)),u[t]}},b628:function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("dc19"),a=i("384f");r({target:"Set",proto:!0,real:!0,forced:!0},{find:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0),r=a(e,(function(t){if(i(t,t,e))return{value:t}}),!0);return r&&r.value}})},b636:function(t,e,i){"use strict";var r=i("e065");r("asyncIterator")},b64b:function(t,e,i){"use strict";var r=i("23e7"),n=i("7b0b"),s=i("df75"),a=i("d039"),o=a((function(){s(1)}));r({target:"Object",stat:!0,forced:o},{keys:function(t){return s(n(t))}})},b65f:function(t,e,i){"use strict";var r=i("23e7"),n=i("b42e");r({target:"Math",stat:!0},{trunc:n})},b680:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("5926"),a=i("408a"),o=i("1148"),h=i("d039"),c=RangeError,u=String,l=Math.floor,d=n(o),f=n("".slice),p=n(1..toFixed),g=function(t,e,i){return 0===e?i:e%2===1?g(t,e-1,i*t):g(t*t,e/2,i)},m=function(t){var e=0,i=t;while(i>=4096)e+=12,i/=4096;while(i>=2)e+=1,i/=2;return e},v=function(t,e,i){var r=-1,n=i;while(++r<6)n+=e*t[r],t[r]=n%1e7,n=l(n/1e7)},y=function(t,e){var i=6,r=0;while(--i>=0)r+=t[i],t[i]=l(r/e),r=r%e*1e7},b=function(t){var e=6,i="";while(--e>=0)if(""!==i||0===e||0!==t[e]){var r=u(t[e]);i=""===i?r:i+d("0",7-r.length)+r}return i},_=h((function(){return"0.000"!==p(8e-5,3)||"1"!==p(.9,0)||"1.25"!==p(1.255,2)||"1000000000000000128"!==p(0xde0b6b3a7640080,0)}))||!h((function(){p({})}));r({target:"Number",proto:!0,forced:_},{toFixed:function(t){var e,i,r,n,o=a(this),h=s(t),l=[0,0,0,0,0,0],p="",_="0";if(h<0||h>20)throw new c("Incorrect fraction digits");if(o!==o)return"NaN";if(o<=-1e21||o>=1e21)return u(o);if(o<0&&(p="-",o=-o),o>1e-21)if(e=m(o*g(2,69,1))-69,i=e<0?o*g(2,-e,1):o/g(2,e,1),i*=4503599627370496,e=52-e,e>0){v(l,0,i),r=h;while(r>=7)v(l,1e7,0),r-=7;v(l,g(10,r,1),0),r=e-1;while(r>=23)y(l,1<<23),r-=23;y(l,1<0?(n=_.length,_=p+(n<=h?"0."+d("0",h-n)+_:f(_,0,n-h)+"."+f(_,n-h))):_=p+_,_}})},b6f3:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("e330"),a=i("f69d"),o=i("6b37"),h=i("2005"),c=i("b917"),u=i("da63"),l=c.i2c,d=c.i2cUrl,f=s("".charAt);n.Uint8Array&&r({target:"Uint8Array",proto:!0},{toBase64:function(){var t=o(this),e=arguments.length?a(arguments[0]):void 0,i="base64"===u(e)?l:d,r=!!e&&!!e.omitPadding;h(this.buffer);for(var n,s="",c=0,p=t.length,g=function(t){return f(i,n>>6*t&63)};c+2E;E++)if((f||E in T)&&(y=T[E],b=w(y,E,_),t))if(e)A[E]=b;else if(b)switch(t){case 3:return!0;case 5:return y;case 6:return E;case 2:c(A,y)}else switch(t){case 4:return!1;case 7:c(A,y)}return l?-1:n||u?u:A}};t.exports={forEach:u(0),map:u(1),filter:u(2),some:u(3),every:u(4),find:u(5),findIndex:u(6),filterReject:u(7)}},b7ef:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("d066"),a=i("5c6c"),o=i("9bf2").f,h=i("1a2d"),c=i("19aa"),u=i("7156"),l=i("e391"),d=i("cf98"),f=i("0d26"),p=i("83ab"),g=i("c430"),m="DOMException",v=s("Error"),y=s(m),b=function(){c(this,_);var t=arguments.length,e=l(t<1?void 0:arguments[0]),i=l(t<2?void 0:arguments[1],"Error"),r=new y(e,i),n=new v(e);return n.name=m,o(r,"stack",a(1,f(n.stack,1))),u(r,this,b),r},_=b.prototype=y.prototype,T="stack"in new v(m),S="stack"in new y(1,2),w=y&&p&&Object.getOwnPropertyDescriptor(n,m),E=!!w&&!(w.writable&&w.configurable),x=T&&!E&&!S;r({global:!0,constructor:!0,forced:g||x},{DOMException:x?b:y});var A=s(m),C=A.prototype;if(C.constructor!==A)for(var R in g||o(C,"constructor",a(1,A)),d)if(h(d,R)){var P=d[R],I=P.s;h(A,I)||o(A,I,a(6,P.c))}},b86b:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("3252"),i("d6e6"))})(0,(function(t){return function(){var e=t,i=e.x64,r=i.Word,n=i.WordArray,s=e.algo,a=s.SHA512,o=s.SHA384=a.extend({_doReset:function(){this._hash=new n.init([new r.init(3418070365,3238371032),new r.init(1654270250,914150663),new r.init(2438529370,812702999),new r.init(355462360,4144912697),new r.init(1731405415,4290775857),new r.init(2394180231,1750603025),new r.init(3675008525,1694076839),new r.init(1203062813,3204075428)])},_doFinalize:function(){var t=a._doFinalize.call(this);return t.sigBytes-=16,t}});e.SHA384=a._createHelper(o),e.HmacSHA384=a._createHmacHelper(o)}(),t.SHA384}))},b86c:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.pad.NoPadding={pad:function(){},unpad:function(){}},t.pad.NoPadding}))},b881:function(t,e,i){"use strict";var r=i("23e7"),n=i("e9e0");r({target:"Map",proto:!0,real:!0,forced:!0},{upsert:n})},b8bf:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("7c73");r({target:"Object",stat:!0,sham:!n},{create:s})},b917:function(t,e,i){"use strict";var r="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",n=r+"+/",s=r+"-_",a=function(t){for(var e={},i=0;i<64;i++)e[t.charAt(i)]=i;return e};t.exports={i2c:n,c2i:a(n),i2cUrl:s,c2iUrl:a(s)}},b968:function(t,e,i){"use strict";var r=i("23e7"),n=Math.PI/180;r({target:"Math",stat:!0,forced:!0},{radians:function(t){return t*n}})},b980:function(t,e,i){"use strict";var r=i("d039"),n=i("5c6c");t.exports=!r((function(){var t=new Error("a");return!("stack"in t)||(Object.defineProperty(t,"stack",n(1,7)),7!==t.stack)}))},ba74:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("2266"),a=i("1626"),o=i("59ed"),h=i("094a").Map;r({target:"Map",stat:!0,forced:!0},{keyBy:function(t,e){var i=a(this)?this:h,r=new i;o(e);var c=o(r.set);return s(t,(function(t){n(c,r,e(t),t)})),r}})},baa5:function(t,e,i){"use strict";var r=i("23e7"),n=i("e58c");r({target:"Array",proto:!0,forced:n!==[].lastIndexOf},{lastIndexOf:n})},bb11:function(t,e,i){var r=i("cbe5"),n=Math.sin,s=Math.cos,a=Math.PI/180,o=r.extend({type:"rose",shape:{cx:0,cy:0,r:[],k:0,n:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,o,h=e.r,c=e.k,u=e.n,l=e.cx,d=e.cy;t.moveTo(l,d);for(var f=0,p=h.length;f2&&l(i,arguments[2]);var o=[];return f(t,y,{that:o}),c(i,"errors",o),i};a?a(b,v):o(b,v,{name:!0});var _=b.prototype=h(v.prototype,{constructor:u(1,b),message:u(1,""),name:u(1,"AggregateError")});r({global:!0,constructor:!0,arity:2},{AggregateError:b})},bbc6:function(t,e,i){"use strict";i("a4d3"),i("e01a"),i("b636"),i("dc8d"),i("efe9"),i("d28b"),i("2a1b"),i("8edd"),i("80e0"),i("6b9e"),i("197b"),i("2351"),i("8172"),i("944a"),i("81b8"),i("d9e2"),i("d401"),i("967a"),i("9fbf"),i("33d1"),i("99af"),i("a874"),i("a623"),i("cb29"),i("4de4"),i("7db0"),i("c740"),i("8bd5"),i("71b4"),i("0481"),i("5db7"),i("4160"),i("a630"),i("caad"),i("c975"),i("277d"),i("e260"),i("a15b"),i("baa5"),i("d81d"),i("5ded"),i("14d9"),i("13d5"),i("f4dd"),i("26e9"),i("fb6a"),i("45fc"),i("4e82"),i("f785"),i("a434"),i("0611"),i("8c77"),i("3f1c"),i("4069"),i("73d9"),i("3c65"),i("cb9e"),i("c19f"),i("82da"),i("ace4"),i("b420"),i("b431"),i("ab23"),i("2c66"),i("249d"),i("40e9"),i("0a90"),i("6eba"),i("9321"),i("d1ba"),i("accc"),i("f4b3"),i("efec"),i("0d03"),i("4d12"),i("c0b6"),i("b56e"),i("b0c0"),i("6c57"),i("e9f5"),i("db9b"),i("d866"),i("910d"),i("f665"),i("796d"),i("7d54"),i("f250"),i("ab43"),i("9485"),i("a732"),i("c5b2"),i("9547"),i("e9c4"),i("0c47"),i("4ec9"),i("cdfc"),i("5327"),i("79a8"),i("9ff9"),i("3ea3"),i("40d9"),i("ff9c"),i("0ac8"),i("f664"),i("ce74"),i("4057"),i("bc01"),i("6b93"),i("ca21"),i("90d7"),i("2af1"),i("0261"),i("7898"),i("23dc"),i("b65f"),i("a9e3"),i("35b3"),i("f00c"),i("8ba4"),i("9129"),i("583b"),i("aff5"),i("e6e1"),i("c35a"),i("25eb"),i("a3a2"),i("b680"),i("542d"),i("cca6"),i("b8bf"),i("12a8"),i("1d1c"),i("7a82"),i("e71b"),i("4fadc"),i("dca8"),i("c1f9"),i("e439"),i("dbb4"),i("7039"),i("3410"),i("a3cd"),i("0541"),i("2b19"),i("c906"),i("e21d"),i("e43e"),i("b64b"),i("bf96"),i("5bf7"),i("cee8"),i("1f68"),i("af93"),i("131a"),i("d3b7"),i("07ac"),i("acd8"),i("e25e"),i("e6cf"),i("820e"),i("dbfa"),i("a79d"),i("e283"),i("6a8a"),i("a6fd"),i("4ae1"),i("3f3a"),i("ac16"),i("5d41"),i("9e4a"),i("7f78"),i("c760"),i("db96"),i("1bf2"),i("d6dd"),i("7ed3"),i("8b9a"),i("f8c9"),i("4d63"),i("c8d1"),i("c607"),i("ac1f"),i("5377"),i("2c3e"),i("00b4"),i("25f0"),i("6062"),i("1e70"),i("79a4"),i("c1a1"),i("8b00"),i("a4e7"),i("1e5a"),i("72c3"),i("ea98"),i("f5b2"),i("8a79"),i("f6d6"),i("2532"),i("5d15"),i("3ca3"),i("466d"),i("a1f0"),i("843c"),i("4d90"),i("d80f"),i("38cf"),i("5319"),i("5b81"),i("841c"),i("1276"),i("2ca0"),i("e323"),i("7d4a"),i("498a"),i("1e25"),i("eee7"),i("18a5"),i("1393"),i("04d3"),i("cc71"),i("c7cd"),i("9767"),i("1913"),i("c5d0"),i("9911"),i("c96a"),i("2315"),i("4c53"),i("664f"),i("cfc3"),i("4a9b"),i("fd87"),i("8b09"),i("143c"),i("5cc6"),i("8a59"),i("84c3"),i("fb2c"),i("907a"),i("9a8c"),i("a975"),i("735e"),i("c1ac"),i("d139"),i("3a7b"),i("986a"),i("1d02"),i("d5d6"),i("20bf"),i("82f8"),i("e91f"),i("60bd"),i("5f96"),i("3280"),i("3fcc"),i("ec97"),i("ca91"),i("25a1"),i("cd26"),i("3c5d"),i("2954"),i("649e"),i("219c"),i("170b"),i("b39a"),i("6ce5"),i("2834"),i("72f7"),i("4ea1"),i("9257"),i("10d1"),i("1fe2"),i("eba5"),i("f731"),i("3ff8"),i("8f40"),i("54c8"),i("34a3"),i("c2bc"),i("dc56"),i("aef8"),i("83f2"),i("b38e"),i("4417"),i("83e6"),i("8883"),i("dad3"),i("978f"),i("6720"),i("72ba"),i("143e"),i("6d54"),i("669d"),i("109c"),i("b2c1"),i("471f"),i("9013"),i("dab0"),i("eade"),i("0ce4"),i("f93b"),i("ddd7"),i("f646"),i("45e3"),i("26ad"),i("7245"),i("bf3e"),i("7b8b"),i("8260"),i("1d10"),i("660e"),i("1b22"),i("dfa4"),i("8182"),i("1034"),i("8bb3"),i("2825"),i("064e"),i("beda"),i("e6675"),i("3e16"),i("81ae"),i("e74c"),i("7a5b"),i("b37e"),i("b2ff"),i("8fe5"),i("0643"),i("b24c"),i("9d3f"),i("81bc"),i("ab3c"),i("76d6"),i("2382"),i("fffc"),i("cd1a"),i("4e3e"),i("a093"),i("6b99"),i("a573"),i("a267"),i("9d4a"),i("9a9a"),i("4417a"),i("cbc8"),i("39c3"),i("a1ac"),i("5087e"),i("9a61"),i("c206"),i("bffa"),i("477f"),i("97fb"),i("d2af"),i("9f9a"),i("ceef"),i("d437"),i("ef42"),i("8a1a"),i("43b3"),i("ba74"),i("567a"),i("9c87"),i("094c"),i("a9cd"),i("e7dd"),i("54ec"),i("4e16"),i("f43e"),i("b423"),i("b881"),i("70e3"),i("bdd4"),i("2abc"),i("48be"),i("3fd0"),i("95e8"),i("78ed"),i("36a4"),i("c3bb"),i("b968"),i("58fc"),i("355d"),i("9f2f"),i("efe4"),i("6b9f"),i("bf3c"),i("3393"),i("daf2"),i("ce8c"),i("c877"),i("a454"),i("c13d"),i("a5eb"),i("f20a"),i("0ebb"),i("9029"),i("8c59"),i("fbec"),i("6380"),i("66c1"),i("bd98"),i("e6bd"),i("b10f"),i("6dd7"),i("0308"),i("aa01"),i("7fc3"),i("e3df"),i("015a"),i("88e6"),i("85ca"),i("74d4"),i("dee5"),i("b628"),i("d644"),i("70cc"),i("658e"),i("eb03"),i("0b52"),i("22e5"),i("9661"),i("c01e"),i("0a8d"),i("e495"),i("72d0"),i("f2be"),i("2705"),i("a9a1"),i("fa76"),i("4a2e"),i("8306"),i("0466"),i("7cdf"),i("802d"),i("5333"),i("164a"),i("8a0e"),i("0e13"),i("ad9d"),i("fe38"),i("a7f4"),i("8e3c"),i("6a90"),i("3ce9"),i("5012"),i("6807"),i("e297"),i("020f"),i("e8eb"),i("385f"),i("e176"),i("e95e"),i("8009"),i("18d5"),i("acef"),i("a529"),i("6899"),i("fa9e"),i("77d9"),i("cd7c"),i("1b3b"),i("3d71"),i("5dfc"),i("6a86"),i("c6e3"),i("5c45"),i("40bb"),i("61ae"),i("0a00"),i("b6f3"),i("4801"),i("71f8"),i("ef4d"),i("4c9e"),i("9e6b"),i("3fea"),i("c144"),i("e555"),i("6789"),i("f124"),i("b294"),i("adbd"),i("81b2"),i("313d"),i("159b"),i("ddb0"),i("0eb6"),i("b7ef"),i("8bd4"),i("130f"),i("9f96"),i("c73d"),i("ad1f"),i("4795"),i("2b3d"),i("a149"),i("14be"),i("bf19"),i("9861"),i("88a7"),i("271a"),i("5494"),t.exports=i("428f")},bc01:function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=Math.imul,a=n((function(){return-5!==s(4294967295,5)||2!==s.length}));r({target:"Math",stat:!0,forced:a},{imul:function(t,e){var i=65535,r=+t,n=+e,s=i&r,a=i&n;return 0|s*a+((i&r>>>16)*a+s*(i&n>>>16)<<16>>>0)}})},bc3a:function(t,e,i){t.exports=i("cee4")},bcaa:function(t,e,i){var r=i("4ab1"),n=i("6d8b");function s(t,e){r.call(this,t,e,["filter"],"__filter_in_use__","_shadowDom")}function a(t){return t&&(t.shadowBlur||t.shadowOffsetX||t.shadowOffsetY||t.textShadowBlur||t.textShadowOffsetX||t.textShadowOffsetY)}n.inherits(s,r),s.prototype.addWithoutUpdate=function(t,e){if(e&&a(e.style)){var i;if(e._shadowDom){i=e._shadowDom;var r=this.getDefs(!0);r.contains(e._shadowDom)||this.addDom(i)}else i=this.add(e);this.markUsed(e);var n=i.getAttribute("id");t.style.filter="url(#"+n+")"}},s.prototype.add=function(t){var e=this.createElement("filter");return t._shadowDomId=t._shadowDomId||this.nextId++,e.setAttribute("id","zr"+this._zrId+"-shadow-"+t._shadowDomId),this.updateDom(t,e),this.addDom(e),e},s.prototype.update=function(t,e){var i=e.style;if(a(i)){var n=this;r.prototype.update.call(this,e,(function(){n.updateDom(e,e._shadowDom)}))}else this.remove(t,e)},s.prototype.remove=function(t,e){null!=e._shadowDomId&&(this.removeDom(t),t.style.filter="")},s.prototype.updateDom=function(t,e){var i=e.getElementsByTagName("feDropShadow");i=0===i.length?this.createElement("feDropShadow"):i[0];var r,n,s,a,o=t.style,h=t.scale&&t.scale[0]||1,c=t.scale&&t.scale[1]||1;if(o.shadowBlur||o.shadowOffsetX||o.shadowOffsetY)r=o.shadowOffsetX||0,n=o.shadowOffsetY||0,s=o.shadowBlur,a=o.shadowColor;else{if(!o.textShadowBlur)return void this.removeDom(e,o);r=o.textShadowOffsetX||0,n=o.textShadowOffsetY||0,s=o.textShadowBlur,a=o.textShadowColor}i.setAttribute("dx",r/h),i.setAttribute("dy",n/c),i.setAttribute("flood-color",a);var u=s/2/h,l=s/2/c,d=u+" "+l;i.setAttribute("stdDeviation",d),e.setAttribute("x","-100%"),e.setAttribute("y","-100%"),e.setAttribute("width",Math.ceil(s/2*200)+"%"),e.setAttribute("height",Math.ceil(s/2*200)+"%"),e.appendChild(i),t._shadowDom=e},s.prototype.markUsed=function(t){t._shadowDom&&r.prototype.markUsed.call(this,t._shadowDom)};var o=s;t.exports=o},bcbf:function(t,e,i){"use strict";var r=i("f5df");t.exports=function(t){var e=r(t);return"BigInt64Array"===e||"BigUint64Array"===e}},bd6b:function(t,e,i){var r=i("06ad"),n=i("4942"),s=i("6d8b"),a=s.isString,o=s.isFunction,h=s.isObject,c=s.isArrayLike,u=s.indexOf,l=function(){this.animators=[]};function d(t,e,i,r,n,s,h,c){a(r)?(s=n,n=r,r=0):o(n)?(s=n,n="linear",r=0):o(r)?(s=r,r=0):o(i)?(s=i,i=500):i||(i=500),t.stopAnimation(),f(t,"",t,e,i,r,c);var u=t.animators.slice(),l=u.length;function d(){l--,l||s&&s()}l||s&&s();for(var p=0;p0&&t.animate(e,!1).when(null==n?500:n,o).delay(s||0)}function p(t,e,i,r){if(e){var n={};n[e]={},n[e][i]=r,t.attr(n)}else t.attr(i,r)}l.prototype={constructor:l,animate:function(t,e){var i,s=!1,a=this,o=this.__zr;if(t){var h=t.split("."),c=a;s="shape"===h[0];for(var l=0,d=h.length;l36)throw new h(o);if(!g(f,t))throw new c(a);var n=y(t,"."),b=l(n[0],r);if(n.length>1&&(b+=l(n[1],r)/d(r,n[1].length)),10===r&&m(b,r)!==t)throw new c(a);return i*b}})},bf3e:function(t,e,i){"use strict";var r=i("23e7"),n=i("66e5");r({target:"AsyncIterator",proto:!0,real:!0,forced:!0},{indexed:n})},bf96:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("eb1d"),a=i("7b0b"),o=i("a04b"),h=i("e163"),c=i("06cf").f;n&&r({target:"Object",proto:!0,forced:s},{__lookupGetter__:function(t){var e,i=a(this),r=o(t);do{if(e=c(i,r))return e.get}while(i=h(i))}})},bffa:function(t,e,i){"use strict";var r=i("23e7"),n=i("db82"),s=i("094a"),a=s.get,o=s.has,h=s.set;r({target:"Map",proto:!0,real:!0,forced:!0},{emplace:function(t,e){var i,r,s=n(this);return o(s,t)?(i=a(s,t),"update"in e&&(i=e.update(i,t,s),h(s,t,i)),i):(r=e.insert(t,s),h(s,t,r),r)}})},c004:function(t,e,i){var r=i("cbe5"),n=Math.PI,s=Math.sin,a=Math.cos,o=r.extend({type:"isogon",shape:{x:0,y:0,r:0,n:0},buildPath:function(t,e){var i=e.n;if(i&&!(i<2)){var r=e.x,o=e.y,h=e.r,c=2*n/i,u=-n/2;t.moveTo(r+h*a(u),o+h*s(u));for(var l=0,d=i-1;l>>8^255&n^99,s[i]=n,a[n]=i;var g=t[i],m=t[g],v=t[m],y=257*t[n]^16843008*n;o[i]=y<<24|y>>>8,h[i]=y<<16|y>>>16,c[i]=y<<8|y>>>24,u[i]=y;y=16843009*v^65537*m^257*g^16843008*i;l[n]=y<<24|y>>>8,d[n]=y<<16|y>>>16,f[n]=y<<8|y>>>24,p[n]=y,i?(i=g^t[t[t[v^g]]],r^=t[t[r]]):i=r=1}})();var g=[0,1,2,4,8,16,32,64,128,27,54],m=n.AES=r.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var t=this._keyPriorReset=this._key,e=t.words,i=t.sigBytes/4,r=this._nRounds=i+6,n=4*(r+1),a=this._keySchedule=[],o=0;o6&&o%i==4&&(u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u]):(u=u<<8|u>>>24,u=s[u>>>24]<<24|s[u>>>16&255]<<16|s[u>>>8&255]<<8|s[255&u],u^=g[o/i|0]<<24),a[o]=a[o-i]^u);for(var h=this._invKeySchedule=[],c=0;c>>24]]^d[s[u>>>16&255]]^f[s[u>>>8&255]]^p[s[255&u]]}}},encryptBlock:function(t,e){this._doCryptBlock(t,e,this._keySchedule,o,h,c,u,s)},decryptBlock:function(t,e){var i=t[e+1];t[e+1]=t[e+3],t[e+3]=i,this._doCryptBlock(t,e,this._invKeySchedule,l,d,f,p,a);i=t[e+1];t[e+1]=t[e+3],t[e+3]=i},_doCryptBlock:function(t,e,i,r,n,s,a,o){for(var h=this._nRounds,c=t[e]^i[0],u=t[e+1]^i[1],l=t[e+2]^i[2],d=t[e+3]^i[3],f=4,p=1;p>>24]^n[u>>>16&255]^s[l>>>8&255]^a[255&d]^i[f++],m=r[u>>>24]^n[l>>>16&255]^s[d>>>8&255]^a[255&c]^i[f++],v=r[l>>>24]^n[d>>>16&255]^s[c>>>8&255]^a[255&u]^i[f++],y=r[d>>>24]^n[c>>>16&255]^s[u>>>8&255]^a[255&l]^i[f++];c=g,u=m,l=v,d=y}g=(o[c>>>24]<<24|o[u>>>16&255]<<16|o[l>>>8&255]<<8|o[255&d])^i[f++],m=(o[u>>>24]<<24|o[l>>>16&255]<<16|o[d>>>8&255]<<8|o[255&c])^i[f++],v=(o[l>>>24]<<24|o[d>>>16&255]<<16|o[c>>>8&255]<<8|o[255&u])^i[f++],y=(o[d>>>24]<<24|o[c>>>16&255]<<16|o[u>>>8&255]<<8|o[255&l])^i[f++];t[e]=g,t[e+1]=m,t[e+2]=v,t[e+3]=y},keySize:8});e.AES=r._createHelper(m)}(),t.AES}))},c19f:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("621a"),a=i("2626"),o="ArrayBuffer",h=s[o],c=n[o];r({global:!0,constructor:!0,forced:c!==h},{ArrayBuffer:h}),a(o)},c1a1:function(t,e,i){"use strict";var r=i("23e7"),n=i("b4bc"),s=i("dad2"),a=!s("isDisjointFrom",(function(t){return!t}));r({target:"Set",proto:!0,real:!0,forced:a},{isDisjointFrom:n})},c1ac:function(t,e,i){"use strict";var r=i("ebb5"),n=i("b727").filter,s=i("30f2"),a=r.aTypedArray,o=r.exportTypedArrayMethod;o("filter",(function(t){var e=n(a(this),t,arguments.length>1?arguments[1]:void 0);return s(this,e)}))},c1bc:function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.WordArray,n=e.enc;n.Base64url={stringify:function(t,e){void 0===e&&(e=!0);var i=t.words,r=t.sigBytes,n=e?this._safe_map:this._map;t.clamp();for(var s=[],a=0;a>>2]>>>24-a%4*8&255,h=i[a+1>>>2]>>>24-(a+1)%4*8&255,c=i[a+2>>>2]>>>24-(a+2)%4*8&255,u=o<<16|h<<8|c,l=0;l<4&&a+.75*l>>6*(3-l)&63));var d=n.charAt(64);if(d)while(s.length%4)s.push(d);return s.join("")},parse:function(t,e){void 0===e&&(e=!0);var i=t.length,r=e?this._safe_map:this._map,n=this._reverseMap;if(!n){n=this._reverseMap=[];for(var a=0;a>>6-a%4*2,c=o|h;n[s>>>2]|=c<<24-s%4*8,s++}return r.create(n,s)}}(),t.enc.Base64url}))},c1f9:function(t,e,i){"use strict";var r=i("23e7"),n=i("2266"),s=i("8418");r({target:"Object",stat:!0},{fromEntries:function(t){var e={};return n(t,(function(t,i){s(e,t,i)}),{AS_ENTRIES:!0}),e}})},c206:function(t,e,i){"use strict";var r=i("23e7"),n=i("db82"),s=i("094a").remove;r({target:"Map",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),i=!0,r=0,a=arguments.length;r>>0||(f(d,i)?16:10))}:c},c2bc:function(t,e,i){"use strict";i("8bd5")},c345:function(t,e,i){"use strict";var r=i("c532"),n=["age","authorization","content-length","content-type","etag","expires","from","host","if-modified-since","if-unmodified-since","last-modified","location","max-forwards","proxy-authorization","referer","retry-after","user-agent"];t.exports=function(t){var e,i,s,a={};return t?(r.forEach(t.split("\n"),(function(t){if(s=t.indexOf(":"),e=r.trim(t.substr(0,s)).toLowerCase(),i=r.trim(t.substr(s+1)),e){if(a[e]&&n.indexOf(e)>=0)return;a[e]="set-cookie"===e?(a[e]?a[e]:[]).concat([i]):a[e]?a[e]+", "+i:i}})),a):a}},c35a:function(t,e,i){"use strict";var r=i("23e7"),n=i("7e12");r({target:"Number",stat:!0,forced:Number.parseFloat!==n},{parseFloat:n})},c3b6:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("1132"),i("72fe"),i("2b79"),i("38ba"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.StreamCipher,n=e.algo,s=n.RC4=r.extend({_doReset:function(){for(var t=this._key,e=t.words,i=t.sigBytes,r=this._S=[],n=0;n<256;n++)r[n]=n;n=0;for(var s=0;n<256;n++){var a=n%i,o=e[a>>>2]>>>24-a%4*8&255;s=(s+r[n]+o)%256;var h=r[n];r[n]=r[s],r[s]=h}this._i=this._j=0},_doProcessBlock:function(t,e){t[e]^=a.call(this)},keySize:8,ivSize:0});function a(){for(var t=this._S,e=this._i,i=this._j,r=0,n=0;n<4;n++){e=(e+1)%256,i=(i+t[e])%256;var s=t[e];t[e]=t[i],t[i]=s,r|=t[(t[e]+t[i])%256]<<24-8*n}return this._i=e,this._j=i,r}e.RC4=r._createHelper(s);var o=n.RC4Drop=s.extend({cfg:s.cfg.extend({drop:192}),_doReset:function(){s._doReset.call(this);for(var t=this.cfg.drop;t>0;t--)a.call(this)}});e.RC4Drop=r._createHelper(o)}(),t.RC4}))},c3bb:function(t,e,i){"use strict";var r=i("23e7");r({target:"Math",stat:!0,nonConfigurable:!0,nonWritable:!0},{RAD_PER_DEG:180/Math.PI})},c401:function(t,e,i){"use strict";var r=i("c532"),n=i("2444");t.exports=function(t,e,i){var s=this||n;return r.forEach(i,(function(i){t=i.call(s,t,e)})),t}},c430:function(t,e,i){"use strict";t.exports=!1},c513:function(t,e,i){"use strict";var r=i("23e7"),n=i("1a2d"),s=i("d9b5"),a=i("0d51"),o=i("5692"),h=i("0b43"),c=o("symbol-to-string-registry");r({target:"Symbol",stat:!0,forced:!h},{keyFor:function(t){if(!s(t))throw new TypeError(a(t)+" is not a symbol");if(n(c,t))return c[t]}})},c532:function(t,e,i){"use strict";var r=i("1d2b"),n=Object.prototype.toString;function s(t){return"[object Array]"===n.call(t)}function a(t){return"undefined"===typeof t}function o(t){return null!==t&&!a(t)&&null!==t.constructor&&!a(t.constructor)&&"function"===typeof t.constructor.isBuffer&&t.constructor.isBuffer(t)}function h(t){return"[object ArrayBuffer]"===n.call(t)}function c(t){return"undefined"!==typeof FormData&&t instanceof FormData}function u(t){var e;return e="undefined"!==typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(t):t&&t.buffer&&t.buffer instanceof ArrayBuffer,e}function l(t){return"string"===typeof t}function d(t){return"number"===typeof t}function f(t){return null!==t&&"object"===typeof t}function p(t){if("[object Object]"!==n.call(t))return!1;var e=Object.getPrototypeOf(t);return null===e||e===Object.prototype}function g(t){return"[object Date]"===n.call(t)}function m(t){return"[object File]"===n.call(t)}function v(t){return"[object Blob]"===n.call(t)}function y(t){return"[object Function]"===n.call(t)}function b(t){return f(t)&&y(t.pipe)}function _(t){return"undefined"!==typeof URLSearchParams&&t instanceof URLSearchParams}function T(t){return t.trim?t.trim():t.replace(/^\s+|\s+$/g,"")}function S(){return("undefined"===typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!==typeof window&&"undefined"!==typeof document)}function w(t,e){if(null!==t&&"undefined"!==typeof t)if("object"!==typeof t&&(t=[t]),s(t))for(var i=0,r=t.length;i1?arguments[1]:void 0)}}),s(a)},c760:function(t,e,i){"use strict";var r=i("23e7");r({target:"Reflect",stat:!0},{has:function(t,e){return e in t}})},c7a2:function(t,e,i){var r=i("cbe5"),n=i("5693"),s=i("9cf9"),a=s.subPixelOptimizeRect,o={},h=r.extend({type:"rect",shape:{r:0,x:0,y:0,width:0,height:0},buildPath:function(t,e){var i,r,s,h;this.subPixelOptimize?(a(o,e,this.style),i=o.x,r=o.y,s=o.width,h=o.height,o.r=e.r,e=o):(i=e.x,r=e.y,s=e.width,h=e.height),e.r?n.buildPath(t,e):t.rect(i,r,s,h),t.closePath()}});t.exports=h},c7cd:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("fixed")},{fixed:function(){return n(this,"tt","","")}})},c877:function(t,e,i){"use strict";var r=i("23e7"),n=i("c885");r({target:"Object",stat:!0,forced:!0},{iterateKeys:function(t){return new n(t,"keys")}})},c885:function(t,e,i){"use strict";var r=i("69f3"),n=i("dcc3"),s=i("4754"),a=i("1a2d"),o=i("df75"),h=i("7b0b"),c="Object Iterator",u=r.set,l=r.getterFor(c);t.exports=n((function(t,e){var i=h(t);u(this,{type:c,mode:e,object:i,keys:o(i),index:0})}),"Object",(function(){var t=l(this),e=t.keys;while(1){if(null===e||t.index>=e.length)return t.object=t.keys=null,s(void 0,!0);var i=e[t.index++],r=t.object;if(a(r,i)){switch(t.mode){case"keys":return s(i,!1);case"values":return s(r[i],!1)}return s([i,r[i]],!1)}}}))},c8af:function(t,e,i){"use strict";var r=i("c532");t.exports=function(t,e){r.forEach(t,(function(i,r){r!==e&&r.toUpperCase()===e.toUpperCase()&&(t[e]=i,delete t[r])}))}},c8ba:function(t,e){var i;i=function(){return this}();try{i=i||new Function("return this")()}catch(r){"object"===typeof window&&(i=window)}t.exports=i},c8d1:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("8a96"),a=i("1a2d"),o=i("0ccb").start,h=i("5899"),c=Array,u=RegExp.escape,l=n("".charAt),d=n("".charCodeAt),f=n(1.1.toString),p=n([].join),g=/^[0-9a-z]/i,m=/^[$()*+./?[\\\]^{|}]/,v=RegExp("^[!\"#%&',\\-:;<=>@`~"+h+"]"),y=n(g.exec),b={"\t":"t","\n":"n","\v":"v","\f":"f","\r":"r"},_=function(t){var e=f(d(t,0),16);return e.length<3?"\\x"+o(e,2,"0"):"\\u"+o(e,4,"0")},T=!u||"\\x61b"!==u("ab");r({target:"RegExp",stat:!0,forced:T},{escape:function(t){s(t);for(var e=t.length,i=c(e),r=0;r=56320||r+1>=e||56320!==(64512&d(t,r+1))?i[r]=_(n):(i[r]=n,i[++r]=l(t,r))}}return p(i,"")}})},c8d2:function(t,e,i){"use strict";var r=i("5e77").PROPER,n=i("d039"),s=i("5899"),a="​…᠎";t.exports=function(t){return n((function(){return!!s[t]()||a[t]()!==a||r&&s[t].name!==t}))}},c906:function(t,e,i){"use strict";var r=i("23e7"),n=i("4fad");r({target:"Object",stat:!0,forced:Object.isExtensible!==n},{isExtensible:n})},c96a:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("small")},{small:function(){return n(this,"small","","")}})},c975:function(t,e,i){"use strict";var r=i("23e7"),n=i("4625"),s=i("4d64").indexOf,a=i("a640"),o=n([].indexOf),h=!!o&&1/o([1],1,-0)<0,c=h||!a("indexOf");r({target:"Array",proto:!0,forced:c},{indexOf:function(t){var e=arguments.length>1?arguments[1]:void 0;return h?o(this,t,e)||0:s(this,t,e)}})},ca21:function(t,e,i){"use strict";var r=i("23e7"),n=i("1ec1");r({target:"Math",stat:!0},{log1p:n})},ca84:function(t,e,i){"use strict";var r=i("e330"),n=i("1a2d"),s=i("fc6a"),a=i("4d64").indexOf,o=i("d012"),h=r([].push);t.exports=function(t,e){var i,r=s(t),c=0,u=[];for(i in r)!n(o,i)&&n(r,i)&&h(u,i);while(e.length>c)n(r,i=e[c++])&&(~a(u,i)||h(u,i));return u}},ca91:function(t,e,i){"use strict";var r=i("ebb5"),n=i("d58f").left,s=r.aTypedArray,a=r.exportTypedArrayMethod;a("reduce",(function(t){var e=arguments.length;return n(s(this),t,e,e>1?arguments[1]:void 0)}))},caad:function(t,e,i){"use strict";var r=i("23e7"),n=i("4d64").includes,s=i("d039"),a=i("44d2"),o=s((function(){return!Array(1).includes()}));r({target:"Array",proto:!0,forced:o},{includes:function(t){return n(this,t,arguments.length>1?arguments[1]:void 0)}}),a("includes")},cad8:function(t,e,i){"use strict";var r=i("23e7"),n=i("cb4c");r({target:"String",proto:!0,name:"trimEnd",forced:"".trimRight!==n},{trimRight:n})},cb11:function(t,e,i){var r=i("cbe5"),n=i("9cf9"),s=n.subPixelOptimizeLine,a={},o=r.extend({type:"line",shape:{x1:0,y1:0,x2:0,y2:0,percent:1},style:{stroke:"#000",fill:null},buildPath:function(t,e){var i,r,n,o;this.subPixelOptimize?(s(a,e,this.style),i=a.x1,r=a.y1,n=a.x2,o=a.y2):(i=e.x1,r=e.y1,n=e.x2,o=e.y2);var h=e.percent;0!==h&&(t.moveTo(i,r),h<1&&(n=i*(1-h)+n*h,o=r*(1-h)+o*h),t.lineTo(n,o))},pointAt:function(t){var e=this.shape;return[e.x1*(1-t)+e.x2*t,e.y1*(1-t)+e.y2*t]}});t.exports=o},cb27:function(t,e,i){"use strict";var r=i("e330"),n=Set.prototype;t.exports={Set:Set,add:r(n.add),has:r(n.has),remove:r(n["delete"]),proto:n}},cb29:function(t,e,i){"use strict";var r=i("23e7"),n=i("81d5"),s=i("44d2");r({target:"Array",proto:!0},{fill:n}),s("fill")},cb2d:function(t,e,i){"use strict";var r=i("1626"),n=i("9bf2"),s=i("13d2"),a=i("6374");t.exports=function(t,e,i,o){o||(o={});var h=o.enumerable,c=void 0!==o.name?o.name:e;if(r(i)&&s(i,c,o),o.global)h?t[e]=i:a(e,i);else{try{o.unsafe?t[e]&&(h=!0):delete t[e]}catch(u){}h?t[e]=i:n.f(t,e,{value:i,enumerable:!1,configurable:!o.nonConfigurable,writable:!o.nonWritable})}return t}},cb4c:function(t,e,i){"use strict";var r=i("58a8").end,n=i("c8d2");t.exports=n("trimEnd")?function(){return r(this)}:"".trimEnd},cb6d:function(t,e){function i(){this.on("mousedown",this._dragStart,this),this.on("mousemove",this._drag,this),this.on("mouseup",this._dragEnd,this)}function r(t,e){return{target:t,topTarget:e&&e.topTarget}}i.prototype={constructor:i,_dragStart:function(t){var e=t.target;while(e&&!e.draggable)e=e.parent;e&&(this._draggingTarget=e,e.dragging=!0,this._x=t.offsetX,this._y=t.offsetY,this.dispatchToElement(r(e,t),"dragstart",t.event))},_drag:function(t){var e=this._draggingTarget;if(e){var i=t.offsetX,n=t.offsetY,s=i-this._x,a=n-this._y;this._x=i,this._y=n,e.drift(s,a,t),this.dispatchToElement(r(e,t),"drag",t.event);var o=this.findHover(i,n,e).target,h=this._dropTarget;this._dropTarget=o,e!==o&&(h&&o!==h&&this.dispatchToElement(r(h,t),"dragleave",t.event),o&&o!==h&&this.dispatchToElement(r(o,t),"dragenter",t.event))}},_dragEnd:function(t){var e=this._draggingTarget;e&&(e.dragging=!1),this.dispatchToElement(r(e,t),"dragend",t.event),this._dropTarget&&this.dispatchToElement(r(this._dropTarget,t),"drop",t.event),this._draggingTarget=null,this._dropTarget=null}};var n=i;t.exports=n},cb9e:function(t,e,i){"use strict";var r=i("23e7"),n=i("d429"),s=i("fc6a"),a=Array;r({target:"Array",proto:!0},{with:function(t,e){return n(s(this),a,t,e)}})},cbc8:function(t,e,i){"use strict";i("9547")},cbe5:function(t,e,i){var r=i("19eb"),n=i("6d8b"),s=i("20c8"),a=i("d833"),o=i("dc2f"),h=o.prototype.getCanvasPattern,c=Math.abs,u=new s(!0);function l(t){r.call(this,t),this.path=null}l.prototype={constructor:l,type:"path",__dirtyPath:!0,strokeContainThreshold:5,segmentIgnoreThreshold:0,subPixelOptimize:!1,brush:function(t,e){var i,r=this.style,n=this.path||u,s=r.hasStroke(),a=r.hasFill(),o=r.fill,c=r.stroke,l=a&&!!o.colorStops,d=s&&!!c.colorStops,f=a&&!!o.image,p=s&&!!c.image;(r.bind(t,this,e),this.setTransform(t),this.__dirty)&&(l&&(i=i||this.getBoundingRect(),this._fillGradient=r.getGradient(t,o,i)),d&&(i=i||this.getBoundingRect(),this._strokeGradient=r.getGradient(t,c,i)));l?t.fillStyle=this._fillGradient:f&&(t.fillStyle=h.call(o,t)),d?t.strokeStyle=this._strokeGradient:p&&(t.strokeStyle=h.call(c,t));var g=r.lineDash,m=r.lineDashOffset,v=!!t.setLineDash,y=this.getGlobalScale();if(n.setScale(y[0],y[1],this.segmentIgnoreThreshold),this.__dirtyPath||g&&!v&&s?(n.beginPath(t),g&&!v&&(n.setLineDash(g),n.setLineDashOffset(m)),this.buildPath(n,this.shape,!1),this.path&&(this.__dirtyPath=!1)):(t.beginPath(),this.path.rebuildPath(t)),a)if(null!=r.fillOpacity){var b=t.globalAlpha;t.globalAlpha=r.fillOpacity*r.opacity,n.fill(t),t.globalAlpha=b}else n.fill(t);if(g&&v&&(t.setLineDash(g),t.lineDashOffset=m),s)if(null!=r.strokeOpacity){b=t.globalAlpha;t.globalAlpha=r.strokeOpacity*r.opacity,n.stroke(t),t.globalAlpha=b}else n.stroke(t);g&&v&&t.setLineDash([]),null!=r.text&&(this.restoreTransform(t),this.drawRectText(t,this.getBoundingRect()))},buildPath:function(t,e,i){},createPathProxy:function(){this.path=new s},getBoundingRect:function(){var t=this._rect,e=this.style,i=!t;if(i){var r=this.path;r||(r=this.path=new s),this.__dirtyPath&&(r.beginPath(),this.buildPath(r,this.shape,!1)),t=r.getBoundingRect()}if(this._rect=t,e.hasStroke()){var n=this._rectWithStroke||(this._rectWithStroke=t.clone());if(this.__dirty||i){n.copy(t);var a=e.lineWidth,o=e.strokeNoScale?this.getLineScale():1;e.hasFill()||(a=Math.max(a,this.strokeContainThreshold||4)),o>1e-10&&(n.width+=a/o,n.height+=a/o,n.x-=a/o/2,n.y-=a/o/2)}return n}return t},contain:function(t,e){var i=this.transformCoordToLocal(t,e),r=this.getBoundingRect(),n=this.style;if(t=i[0],e=i[1],r.contain(t,e)){var s=this.path.data;if(n.hasStroke()){var o=n.lineWidth,h=n.strokeNoScale?this.getLineScale():1;if(h>1e-10&&(n.hasFill()||(o=Math.max(o,this.strokeContainThreshold)),a.containStroke(s,o/h,t,e)))return!0}if(n.hasFill())return a.contain(s,t,e)}return!1},dirty:function(t){null==t&&(t=!0),t&&(this.__dirtyPath=t,this._rect=null),this.__dirty=this.__dirtyText=!0,this.__zr&&this.__zr.refresh(),this.__clipTarget&&this.__clipTarget.dirty()},animateShape:function(t){return this.animate("shape",t)},attrKV:function(t,e){"shape"===t?(this.setShape(e),this.__dirtyPath=!0,this._rect=null):r.prototype.attrKV.call(this,t,e)},setShape:function(t,e){var i=this.shape;if(i){if(n.isObject(t))for(var r in t)t.hasOwnProperty(r)&&(i[r]=t[r]);else i[t]=e;this.dirty(!0)}return this},getLineScale:function(){var t=this.transform;return t&&c(t[0]-1)>1e-10&&c(t[3]-1)>1e-10?Math.sqrt(c(t[0]*t[3]-t[2]*t[1])):1}},l.extend=function(t){var e=function(e){l.call(this,e),t.style&&this.style.extendFrom(t.style,!1);var i=t.shape;if(i){this.shape=this.shape||{};var r=this.shape;for(var n in i)!r.hasOwnProperty(n)&&i.hasOwnProperty(n)&&(r[n]=i[n])}t.init&&t.init.call(this,e)};for(var i in n.inherits(e,l),t)"style"!==i&&"shape"!==i&&(e.prototype[i]=t[i]);return e},n.inherits(l,r);var d=l;t.exports=d},cc12:function(t,e,i){"use strict";var r=i("cfe9"),n=i("861d"),s=r.document,a=n(s)&&n(s.createElement);t.exports=function(t){return a?s.createElement(t):{}}},cc71:function(t,e,i){"use strict";var r=i("23e7"),n=i("857a"),s=i("af03");r({target:"String",proto:!0,forced:s("bold")},{bold:function(){return n(this,"b","","")}})},cc98:function(t,e,i){"use strict";var r=i("23e7"),n=i("c430"),s=i("4738").CONSTRUCTOR,a=i("d256"),o=i("d066"),h=i("1626"),c=i("cb2d"),u=a&&a.prototype;if(r({target:"Promise",proto:!0,forced:s,real:!0},{catch:function(t){return this.then(void 0,t)}}),!n&&h(a)){var l=o("Promise").prototype["catch"];u["catch"]!==l&&c(u,"catch",l,{unsafe:!0})}},cca6:function(t,e,i){"use strict";var r=i("23e7"),n=i("60da");r({target:"Object",stat:!0,arity:2,forced:Object.assign!==n},{assign:n})},cd1a:function(t,e,i){"use strict";i("796d")},cd26:function(t,e,i){"use strict";var r=i("ebb5"),n=r.aTypedArray,s=r.exportTypedArrayMethod,a=Math.floor;s("reverse",(function(){var t,e=this,i=n(e).length,r=a(i/2),s=0;while(s1?arguments[1]:void 0;return n(s(this),t,e,a)}),!0)},cdaa:function(t,e,i){var r=i("607d"),n=r.addEventListener,s=r.removeEventListener,a=r.normalizeEvent,o=r.getNativeEvent,h=i("6d8b"),c=i("1fab"),u=i("22d1"),l=300,d=u.domSupported,f=function(){var t=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],e=["touchstart","touchend","touchmove"],i={pointerdown:1,pointerup:1,pointermove:1,pointerout:1},r=h.map(t,(function(t){var e=t.replace("mouse","pointer");return i.hasOwnProperty(e)?e:t}));return{mouse:t,touch:e,pointer:r}}(),p={mouse:["mousemove","mouseup"],pointer:["pointermove","pointerup"]};function g(t){return"mousewheel"===t&&u.browser.firefox?"DOMMouseScroll":t}function m(t){var e=t.pointerType;return"pen"===e||"touch"===e}function v(t){t.touching=!0,null!=t.touchTimer&&(clearTimeout(t.touchTimer),t.touchTimer=null),t.touchTimer=setTimeout((function(){t.touching=!1,t.touchTimer=null}),700)}function y(t){t&&(t.zrByTouch=!0)}function b(t,e){return a(t.dom,new T(t,e),!0)}function _(t,e){var i=e,r=!1;while(i&&9!==i.nodeType&&!(r=i.domBelongToZr||i!==e&&i===t.painterRoot))i=i.parentNode;return r}function T(t,e){this.type=e.type,this.target=this.currentTarget=t.dom,this.pointerType=e.pointerType,this.clientX=e.clientX,this.clientY=e.clientY}var S=T.prototype;S.stopPropagation=S.stopImmediatePropagation=S.preventDefault=h.noop;var w={mousedown:function(t){t=a(this.dom,t),this._mayPointerCapture=[t.zrX,t.zrY],this.trigger("mousedown",t)},mousemove:function(t){t=a(this.dom,t);var e=this._mayPointerCapture;!e||t.zrX===e[0]&&t.zrY===e[1]||P(this,!0),this.trigger("mousemove",t)},mouseup:function(t){t=a(this.dom,t),P(this,!1),this.trigger("mouseup",t)},mouseout:function(t){t=a(this.dom,t),this._pointerCapturing&&(t.zrEventControl="no_globalout");var e=t.toElement||t.relatedTarget;t.zrIsToLocalDOM=_(this,e),this.trigger("mouseout",t)},touchstart:function(t){t=a(this.dom,t),y(t),this._lastTouchMoment=new Date,this.handler.processGesture(t,"start"),w.mousemove.call(this,t),w.mousedown.call(this,t)},touchmove:function(t){t=a(this.dom,t),y(t),this.handler.processGesture(t,"change"),w.mousemove.call(this,t)},touchend:function(t){t=a(this.dom,t),y(t),this.handler.processGesture(t,"end"),w.mouseup.call(this,t),+new Date-this._lastTouchMoment1?arguments[1]:void 0)}))},d195:function(t,e,i){"use strict";var r=i("c65b"),n=i("e667"),s=i("825a"),a=i("7c73"),o=i("9112"),h=i("6964"),c=i("b622"),u=i("69f3"),l=i("d066"),d=i("dc4a"),f=i("a91f"),p=i("4754"),g=i("2a62"),m=l("Promise"),v=c("toStringTag"),y="AsyncIteratorHelper",b="WrapForValidAsyncIterator",_=u.set,T=function(t){var e=!t,i=u.getterFor(t?b:y),o=function(t){var r=n((function(){return i(t)})),s=r.error,a=r.value;return s||e&&a.done?{exit:!0,value:s?m.reject(a):m.resolve(p(void 0,!0))}:{exit:!1,value:a}};return h(a(f),{next:function(){var t=o(this),e=t.value;if(t.exit)return e;var i=n((function(){return s(e.nextHandler(m))})),r=i.error,a=i.value;return r&&(e.done=!0),r?m.reject(a):m.resolve(a)},return:function(){var e=o(this),i=e.value;if(e.exit)return i;i.done=!0;var a,h,c=i.iterator,u=n((function(){if(i.inner)try{g(i.inner.iterator,"normal")}catch(t){return g(c,"throw",t)}return d(c,"return")}));return a=h=u.value,u.error?m.reject(h):void 0===a?m.resolve(p(void 0,!0)):(u=n((function(){return r(a,c)})),h=u.value,u.error?m.reject(h):t?m.resolve(h):m.resolve(h).then((function(t){return s(t),p(void 0,!0)})))}})},S=T(!0),w=T(!1);o(w,v,"Async Iterator Helper"),t.exports=function(t,e){var i=function(i,r){r?(r.iterator=i.iterator,r.next=i.next):r=i,r.type=e?b:y,r.nextHandler=t,r.counter=0,r.done=!1,_(this,r)};return i.prototype=e?S:w,i}},d1ba:function(t,e,i){"use strict";var r=i("23e7");r({target:"Date",proto:!0},{toGMTString:Date.prototype.toUTCString})},d1e7:function(t,e,i){"use strict";var r={}.propertyIsEnumerable,n=Object.getOwnPropertyDescriptor,s=n&&!r.call({1:2},1);e.f=s?function(t){var e=n(this,t);return!!e&&e.enumerable}:r},d24a:function(t,e,i){"use strict";var r=i("e330"),n=i("1a2d"),s=SyntaxError,a=parseInt,o=String.fromCharCode,h=r("".charAt),c=r("".slice),u=r(/./.exec),l={'\\"':'"',"\\\\":"\\","\\/":"/","\\b":"\b","\\f":"\f","\\n":"\n","\\r":"\r","\\t":"\t"},d=/^[\da-f]{4}$/i,f=/^[\u0000-\u001F]$/;t.exports=function(t,e){var i=!0,r="";while(e1?arguments[1]:void 0),r=a(e,(function(t,r){if(i(t,r,e))return{value:t}}),!0);return r&&r.value}})},d2bb:function(t,e,i){"use strict";var r=i("7282"),n=i("861d"),s=i("1d80"),a=i("3bbe");t.exports=Object.setPrototypeOf||("__proto__"in{}?function(){var t,e=!1,i={};try{t=r(Object.prototype,"__proto__","set"),t(i,[]),e=i instanceof Array}catch(o){}return function(i,r){return s(i),a(r),n(i)?(e?t(i,r):i.__proto__=r,i):i}}():void 0)},d2cf:function(t,e,i){var r=i("6d8b"),n=i("401b"),s=i("cb6d"),a=i("1fab"),o=i("607d"),h=i("0b44"),c="silent";function u(t,e,i){return{type:t,event:i,target:e.target,topTarget:e.topTarget,cancelBubble:!1,offsetX:i.zrX,offsetY:i.zrY,gestureEvent:i.gestureEvent,pinchX:i.pinchX,pinchY:i.pinchY,pinchScale:i.pinchScale,wheelDelta:i.zrDelta,zrByTouch:i.zrByTouch,which:i.which,stop:l}}function l(){o.stop(this.event)}function d(){}d.prototype.dispose=function(){};var f=["click","dblclick","mousewheel","mouseout","mouseup","mousedown","mousemove","contextmenu"],p=function(t,e,i,r){a.call(this),this.storage=t,this.painter=e,this.painterRoot=r,i=i||new d,this.proxy=null,this._hovered={},this._lastTouchMoment,this._lastX,this._lastY,this._gestureMgr,s.call(this),this.setHandlerProxy(i)};function g(t,e,i){if(t[t.rectHover?"rectContain":"contain"](e,i)){var r,n=t;while(n){if(n.clipPath&&!n.clipPath.contain(e,i))return!1;n.silent&&(r=!0),n=n.parent}return!r||c}return!1}function m(t,e,i){var r=t.painter;return e<0||e>r.getWidth()||i<0||i>r.getHeight()}p.prototype={constructor:p,setHandlerProxy:function(t){this.proxy&&this.proxy.dispose(),t&&(r.each(f,(function(e){t.on&&t.on(e,this[e],this)}),this),t.handler=this),this.proxy=t},mousemove:function(t){var e=t.zrX,i=t.zrY,r=m(this,e,i),n=this._hovered,s=n.target;s&&!s.__zr&&(n=this.findHover(n.x,n.y),s=n.target);var a=this._hovered=r?{x:e,y:i}:this.findHover(e,i),o=a.target,h=this.proxy;h.setCursor&&h.setCursor(o?o.cursor:"default"),s&&o!==s&&this.dispatchToElement(n,"mouseout",t),this.dispatchToElement(a,"mousemove",t),o&&o!==s&&this.dispatchToElement(a,"mouseover",t)},mouseout:function(t){var e=t.zrEventControl,i=t.zrIsToLocalDOM;"only_globalout"!==e&&this.dispatchToElement(this._hovered,"mouseout",t),"no_globalout"!==e&&!i&&this.trigger("globalout",{type:"globalout",event:t})},resize:function(t){this._hovered={}},dispatch:function(t,e){var i=this[t];i&&i.call(this,e)},dispose:function(){this.proxy.dispose(),this.storage=this.proxy=this.painter=null},setCursorStyle:function(t){var e=this.proxy;e.setCursor&&e.setCursor(t)},dispatchToElement:function(t,e,i){t=t||{};var r=t.target;if(!r||!r.silent){var n="on"+e,s=u(e,t,i);while(r)if(r[n]&&(s.cancelBubble=r[n].call(r,s)),r.trigger(e,s),r=r.parent,s.cancelBubble)break;s.cancelBubble||(this.trigger(e,s),this.painter&&this.painter.eachOtherLayer((function(t){"function"===typeof t[n]&&t[n].call(t,s),t.trigger&&t.trigger(e,s)})))}},findHover:function(t,e,i){for(var r=this.storage.getDisplayList(),n={x:t,y:e},s=r.length-1;s>=0;s--){var a;if(r[s]!==i&&!r[s].ignore&&(a=g(r[s],t,e))&&(!n.topTarget&&(n.topTarget=r[s]),a!==c)){n.target=r[s];break}}return n},processGesture:function(t,e){this._gestureMgr||(this._gestureMgr=new h);var i=this._gestureMgr;"start"===e&&i.clear();var r=i.recognize(t,this.findHover(t.zrX,t.zrY,null).target,this.proxy.dom);if("end"===e&&i.clear(),r){var n=r.type;t.gestureEvent=n,this.dispatchToElement({target:r.target},n,r.event)}}},r.each(["click","mousedown","mouseup","mousewheel","dblclick","contextmenu"],(function(t){p.prototype[t]=function(e){var i,r,s=e.zrX,a=e.zrY,o=m(this,s,a);if("mouseup"===t&&o||(i=this.findHover(s,a),r=i.target),"mousedown"===t)this._downEl=r,this._downPoint=[e.zrX,e.zrY],this._upEl=r;else if("mouseup"===t)this._upEl=r;else if("click"===t){if(this._downEl!==this._upEl||!this._downPoint||n.dist(this._downPoint,[e.zrX,e.zrY])>4)return;this._downPoint=null}this.dispatchToElement(i,t,e)}})),r.mixin(p,a),r.mixin(p,s);var v=p;t.exports=v},d3a4:function(t,e,i){var r,n=i("22d1"),s="urn:schemas-microsoft-com:vml",a="undefined"===typeof window?null:window,o=!1,h=a&&a.document;function c(t){return r(t)}if(h&&!n.canvasSupported)try{!h.namespaces.zrvml&&h.namespaces.add("zrvml",s),r=function(t){return h.createElement("')}}catch(l){r=function(t){return h.createElement("<"+t+' xmlns="'+s+'" class="zrvml">')}}function u(){if(!o&&h){o=!0;var t=h.styleSheets;t.length<31?h.createStyleSheet().addRule(".zrvml","behavior:url(#default#VML)"):t[0].addRule(".zrvml","behavior:url(#default#VML)")}}e.doc=h,e.createNode=c,e.initVML=u},d3b7:function(t,e,i){"use strict";var r=i("00ee"),n=i("cb2d"),s=i("b041");r||n(Object.prototype,"toString",s,{unsafe:!0})},d401:function(t,e,i){"use strict";var r=i("cb2d"),n=i("aa1f"),s=Error.prototype;s.toString!==n&&r(s,"toString",n)},d429:function(t,e,i){"use strict";var r=i("07fa"),n=i("5926"),s=RangeError;t.exports=function(t,e,i,a){var o=r(t),h=n(i),c=h<0?o+h:h;if(c>=o||c<0)throw new s("Incorrect index");for(var u=new e(o),l=0;l=this._maxSize&&a>0){var h=i.head;i.remove(h),delete r[h.key],s=h.value,this._lastRemovedEntry=h}o?o.value=e:o=new n(e),o.key=t,i.insertEntry(o),r[t]=o}return s},a.get=function(t){var e=this._map[t],i=this._list;if(null!=e)return e!==i.tail&&(i.remove(e),i.insertEntry(e)),e.value},a.clear=function(){this._list.clear(),this._map={}};var o=s;t.exports=o},d58f:function(t,e,i){"use strict";var r=i("59ed"),n=i("7b0b"),s=i("44ad"),a=i("07fa"),o=TypeError,h="Reduce of empty array with no initial value",c=function(t){return function(e,i,c,u){var l=n(e),d=s(l),f=a(l);if(r(i),0===f&&c<2)throw new o(h);var p=t?f-1:0,g=t?-1:1;if(c<2)while(1){if(p in d){u=d[p],p+=g;break}if(p+=g,t?p<0:f<=p)throw new o(h)}for(;t?p>=0:f>p;p+=g)p in d&&(u=i(u,d[p],p,l));return u}};t.exports={left:c(!1),right:c(!0)}},d5b7:function(t,e,i){var r=i("de00"),n=i("1fab"),s=i("0cde"),a=i("bd6b"),o=i("6d8b"),h=function(t){s.call(this,t),n.call(this,t),a.call(this,t),this.id=t.id||r()};h.prototype={type:"element",name:"",__zr:null,ignore:!1,clipPath:null,isGroup:!1,drift:function(t,e){switch(this.draggable){case"horizontal":e=0;break;case"vertical":t=0;break}var i=this.transform;i||(i=this.transform=[1,0,0,1,0,0]),i[4]+=t,i[5]+=e,this.decomposeTransform(),this.dirty(!1)},beforeUpdate:function(){},afterUpdate:function(){},update:function(){this.updateTransform()},traverse:function(t,e){},attrKV:function(t,e){if("position"===t||"scale"===t||"origin"===t){if(e){var i=this[t];i||(i=this[t]=[]),i[0]=e[0],i[1]=e[1]}}else this[t]=e},hide:function(){this.ignore=!0,this.__zr&&this.__zr.refresh()},show:function(){this.ignore=!1,this.__zr&&this.__zr.refresh()},attr:function(t,e){if("string"===typeof t)this.attrKV(t,e);else if(o.isObject(t))for(var i in t)t.hasOwnProperty(i)&&this.attrKV(i,t[i]);return this.dirty(!1),this},setClipPath:function(t){var e=this.__zr;e&&t.addSelfToZr(e),this.clipPath&&this.clipPath!==t&&this.removeClipPath(),this.clipPath=t,t.__zr=e,t.__clipTarget=this,this.dirty(!1)},removeClipPath:function(){var t=this.clipPath;t&&(t.__zr&&t.removeSelfFromZr(t.__zr),t.__zr=null,t.__clipTarget=null,this.clipPath=null,this.dirty(!1))},addSelfToZr:function(t){this.__zr=t;var e=this.animators;if(e)for(var i=0;i1?arguments[1]:void 0)}))},d644:function(t,e,i){"use strict";var r=i("23e7"),n=i("cb27"),s=i("a98e");r({target:"Set",stat:!0,forced:!0},{from:s(n.Set,n.add,!1)})},d6d6:function(t,e,i){"use strict";var r=TypeError;t.exports=function(t,e){if(t>>1|K<<31)^(Q>>>8|K<<24)^Q>>>7,J=(K>>>1|Q<<31)^(K>>>8|Q<<24)^(K>>>7|Q<<25),tt=u[q-2],et=tt.high,it=tt.low,rt=(et>>>19|it<<13)^(et<<3|it>>>29)^et>>>6,nt=(it>>>19|et<<13)^(it<<3|et>>>29)^(it>>>6|et<<26),st=u[q-7],at=st.high,ot=st.low,ht=u[q-16],ct=ht.high,ut=ht.low;G=J+ot,Y=Z+at+(G>>>0>>0?1:0),G+=nt,Y=Y+rt+(G>>>0>>0?1:0),G+=ut,Y=Y+ct+(G>>>0>>0?1:0),$.high=Y,$.low=G}var lt=L&z^~L&W,dt=U&F^~U&H,ft=P&k^P&O^k&O,pt=I&D^I&M^D&M,gt=(P>>>28|I<<4)^(P<<30|I>>>2)^(P<<25|I>>>7),mt=(I>>>28|P<<4)^(I<<30|P>>>2)^(I<<25|P>>>7),vt=(L>>>14|U<<18)^(L>>>18|U<<14)^(L<<23|U>>>9),yt=(U>>>14|L<<18)^(U>>>18|L<<14)^(U<<23|L>>>9),bt=c[q],_t=bt.high,Tt=bt.low,St=V+yt,wt=j+vt+(St>>>0>>0?1:0),Et=(St=St+dt,wt=wt+lt+(St>>>0
>>0?1:0),St=St+Tt,wt=wt+_t+(St>>>0>>0?1:0),St=St+G,wt=wt+Y+(St>>>0>>0?1:0),mt+pt),xt=gt+ft+(Et>>>0>>0?1:0);j=W,V=H,W=z,H=F,z=L,F=U,U=B+St|0,L=N+wt+(U>>>0>>0?1:0)|0,N=O,B=M,O=k,M=D,k=P,D=I,I=St+Et|0,P=wt+xt+(I>>>0>>0?1:0)|0}p=r.low=p+I,r.high=f+P+(p>>>0>>0?1:0),m=n.low=m+D,n.high=g+k+(m>>>0>>0?1:0),y=s.low=y+M,s.high=v+O+(y>>>0>>0?1:0),_=a.low=_+B,a.high=b+N+(_>>>0>>0?1:0),S=o.low=S+U,o.high=T+L+(S>>>0>>0?1:0),E=h.low=E+F,h.high=w+z+(E>>>0>>0?1:0),A=l.low=A+H,l.high=x+W+(A>>>0>>0?1:0),R=d.low=R+V,d.high=C+j+(R>>>0>>0?1:0)},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;e[r>>>5]|=128<<24-r%32,e[30+(r+128>>>10<<5)]=Math.floor(i/4294967296),e[31+(r+128>>>10<<5)]=i,t.sigBytes=4*e.length,this._process();var n=this._hash.toX32();return n},clone:function(){var t=r.clone.call(this);return t._hash=this._hash.clone(),t},blockSize:32});e.SHA512=r._createHelper(l),e.HmacSHA512=r._createHmacHelper(l)}(),t.SHA512}))},d784:function(t,e,i){"use strict";i("ac1f");var r=i("c65b"),n=i("cb2d"),s=i("9263"),a=i("d039"),o=i("b622"),h=i("9112"),c=o("species"),u=RegExp.prototype;t.exports=function(t,e,i,l){var d=o(t),f=!a((function(){var e={};return e[d]=function(){return 7},7!==""[t](e)})),p=f&&!a((function(){var e=!1,i=/a/;return"split"===t&&(i={},i.constructor={},i.constructor[c]=function(){return i},i.flags="",i[d]=/./[d]),i.exec=function(){return e=!0,null},i[d](""),!e}));if(!f||!p||i){var g=/./[d],m=e(d,""[t],(function(t,e,i,n,a){var o=e.exec;return o===s||o===u.exec?f&&!a?{done:!0,value:r(g,e,i,n)}:{done:!0,value:r(t,i,e,n)}:{done:!1}}));n(String.prototype,t,m[0]),n(u,d,m[1])}l&&h(u[d],"sham",!0)}},d80f:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("fc6a"),a=i("7b0b"),o=i("577e"),h=i("07fa"),c=n([].push),u=n([].join);r({target:"String",stat:!0},{raw:function(t){var e=s(a(t).raw),i=h(e);if(!i)return"";var r=arguments.length,n=[],l=0;while(1){if(c(n,o(e[l++])),l===i)return u(n,"");l1?arguments[1]:void 0)}})},d833:function(t,e,i){var r=i("20c8"),n=i("9680"),s=i("e7d2"),a=i("68ab"),o=i("9f51"),h=i("857d"),c=h.normalizeRadian,u=i("4a3f"),l=i("8728"),d=r.CMD,f=2*Math.PI,p=1e-4;function g(t,e){return Math.abs(t-e)e&&c>r&&c>s&&c>o||c1&&y(),d=u.cubicAt(e,r,s,o,v[0]),g>1&&(f=u.cubicAt(e,r,s,o,v[1]))),2===g?_e&&o>r&&o>s||o=0&&c<=1){for(var l=0,d=u.quadraticAt(e,r,s,c),f=0;fi||o<-i)return 0;var h=Math.sqrt(i*i-o*o);m[0]=-h,m[1]=h;var u=Math.abs(r-n);if(u<1e-4)return 0;if(u%f<1e-4){r=0,n=f;var l=s?1:-1;return a>=m[0]+t&&a<=m[1]+t?l:0}if(s){h=r;r=c(n),n=c(h)}else r=c(r),n=c(n);r>n&&(n+=f);for(var d=0,p=0;p<2;p++){var g=m[p];if(g+t>a){var v=Math.atan2(o,g);l=s?1:-1;v<0&&(v=f+v),(v>=r&&v<=n||v+f>=r&&v+f<=n)&&(v>Math.PI/2&&v<1.5*Math.PI&&(l=-l),d+=l)}}return d}function S(t,e,i,r,h){for(var c=0,u=0,f=0,p=0,m=0,v=0;v1&&(i||(c+=l(u,f,p,m,r,h))),1===v&&(u=t[v],f=t[v+1],p=u,m=f),y){case d.M:p=t[v++],m=t[v++],u=p,f=m;break;case d.L:if(i){if(n.containStroke(u,f,t[v],t[v+1],e,r,h))return!0}else c+=l(u,f,t[v],t[v+1],r,h)||0;u=t[v++],f=t[v++];break;case d.C:if(i){if(s.containStroke(u,f,t[v++],t[v++],t[v++],t[v++],t[v],t[v+1],e,r,h))return!0}else c+=b(u,f,t[v++],t[v++],t[v++],t[v++],t[v],t[v+1],r,h)||0;u=t[v++],f=t[v++];break;case d.Q:if(i){if(a.containStroke(u,f,t[v++],t[v++],t[v],t[v+1],e,r,h))return!0}else c+=_(u,f,t[v++],t[v++],t[v],t[v+1],r,h)||0;u=t[v++],f=t[v++];break;case d.A:var S=t[v++],w=t[v++],E=t[v++],x=t[v++],A=t[v++],C=t[v++];v+=1;var R=1-t[v++],P=Math.cos(A)*E+S,I=Math.sin(A)*x+w;v>1?c+=l(u,f,P,I,r,h):(p=P,m=I);var k=(r-S)*x/E+S;if(i){if(o.containStroke(S,w,x,A,A+C,R,e,k,h))return!0}else c+=T(S,w,x,A,A+C,R,k,h);u=Math.cos(A+C)*E+S,f=Math.sin(A+C)*x+w;break;case d.R:p=u=t[v++],m=f=t[v++];var D=t[v++],O=t[v++];P=p+D,I=m+O;if(i){if(n.containStroke(p,m,P,m,e,r,h)||n.containStroke(P,m,P,I,e,r,h)||n.containStroke(P,I,p,I,e,r,h)||n.containStroke(p,I,p,m,e,r,h))return!0}else c+=l(P,m,P,I,r,h),c+=l(p,I,p,m,r,h);break;case d.Z:if(i){if(n.containStroke(u,f,p,m,e,r,h))return!0}else c+=l(u,f,p,m,r,h);u=p,f=m;break}}return i||g(f,m)||(c+=l(u,f,p,m,r,h)||0),0!==c}function w(t,e,i){return S(t,0,!1,e,i)}function E(t,e,i,r){return S(t,e,!0,i,r)}e.contain=w,e.containStroke=E},d866:function(t,e,i){"use strict";var r=i("23e7"),n=i("2266"),s=i("59ed"),a=i("825a"),o=i("46c4");r({target:"Iterator",proto:!0,real:!0},{every:function(t){a(this),s(t);var e=o(this),i=0;return!n(e,(function(e,r){if(!t(e,i++))return r()}),{IS_RECORD:!0,INTERRUPTED:!0}).stopped}})},d86b:function(t,e,i){"use strict";var r=i("d039");t.exports=r((function(){if("function"==typeof ArrayBuffer){var t=new ArrayBuffer(8);Object.isExtensible(t)&&Object.defineProperty(t,"a",{value:8})}}))},d925:function(t,e,i){"use strict";t.exports=function(t){return/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(t)}},d9b5:function(t,e,i){"use strict";var r=i("d066"),n=i("1626"),s=i("3a9b"),a=i("fdbf"),o=Object;t.exports=a?function(t){return"symbol"==typeof t}:function(t){var e=r("Symbol");return n(e)&&s(e.prototype,o(t))}},d9e2:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("2ba4"),a=i("e5cb"),o="WebAssembly",h=n[o],c=7!==new Error("e",{cause:7}).cause,u=function(t,e){var i={};i[t]=a(t,e,c),r({global:!0,constructor:!0,arity:1,forced:c},i)},l=function(t,e){if(h&&h[t]){var i={};i[t]=a(o+"."+t,e,c),r({target:o,stat:!0,constructor:!0,arity:1,forced:c},i)}};u("Error",(function(t){return function(e){return s(t,this,arguments)}})),u("EvalError",(function(t){return function(e){return s(t,this,arguments)}})),u("RangeError",(function(t){return function(e){return s(t,this,arguments)}})),u("ReferenceError",(function(t){return function(e){return s(t,this,arguments)}})),u("SyntaxError",(function(t){return function(e){return s(t,this,arguments)}})),u("TypeError",(function(t){return function(e){return s(t,this,arguments)}})),u("URIError",(function(t){return function(e){return s(t,this,arguments)}})),l("CompileError",(function(t){return function(e){return s(t,this,arguments)}})),l("LinkError",(function(t){return function(e){return s(t,this,arguments)}})),l("RuntimeError",(function(t){return function(e){return s(t,this,arguments)}}))},d9f5:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("c65b"),a=i("e330"),o=i("c430"),h=i("83ab"),c=i("04f8"),u=i("d039"),l=i("1a2d"),d=i("3a9b"),f=i("825a"),p=i("fc6a"),g=i("a04b"),m=i("577e"),v=i("5c6c"),y=i("7c73"),b=i("df75"),_=i("241c"),T=i("057f"),S=i("7418"),w=i("06cf"),E=i("9bf2"),x=i("37e8"),A=i("d1e7"),C=i("cb2d"),R=i("edd0"),P=i("5692"),I=i("f772"),k=i("d012"),D=i("90e3"),O=i("b622"),M=i("e538"),N=i("e065"),B=i("57b9"),L=i("d44e"),U=i("69f3"),z=i("b727").forEach,F=I("hidden"),W="Symbol",H="prototype",j=U.set,V=U.getterFor(W),q=Object[H],G=n.Symbol,Y=G&&G[H],$=n.RangeError,X=n.TypeError,Q=n.QObject,K=w.f,Z=E.f,J=T.f,tt=A.f,et=a([].push),it=P("symbols"),rt=P("op-symbols"),nt=P("wks"),st=!Q||!Q[H]||!Q[H].findChild,at=function(t,e,i){var r=K(q,e);r&&delete q[e],Z(t,e,i),r&&t!==q&&Z(q,e,r)},ot=h&&u((function(){return 7!==y(Z({},"a",{get:function(){return Z(this,"a",{value:7}).a}})).a}))?at:Z,ht=function(t,e){var i=it[t]=y(Y);return j(i,{type:W,tag:t,description:e}),h||(i.description=e),i},ct=function(t,e,i){t===q&&ct(rt,e,i),f(t);var r=g(e);return f(i),l(it,r)?(i.enumerable?(l(t,F)&&t[F][r]&&(t[F][r]=!1),i=y(i,{enumerable:v(0,!1)})):(l(t,F)||Z(t,F,v(1,y(null))),t[F][r]=!0),ot(t,r,i)):Z(t,r,i)},ut=function(t,e){f(t);var i=p(e),r=b(i).concat(gt(i));return z(r,(function(e){h&&!s(dt,i,e)||ct(t,e,i[e])})),t},lt=function(t,e){return void 0===e?y(t):ut(y(t),e)},dt=function(t){var e=g(t),i=s(tt,this,e);return!(this===q&&l(it,e)&&!l(rt,e))&&(!(i||!l(this,e)||!l(it,e)||l(this,F)&&this[F][e])||i)},ft=function(t,e){var i=p(t),r=g(e);if(i!==q||!l(it,r)||l(rt,r)){var n=K(i,r);return!n||!l(it,r)||l(i,F)&&i[F][r]||(n.enumerable=!0),n}},pt=function(t){var e=J(p(t)),i=[];return z(e,(function(t){l(it,t)||l(k,t)||et(i,t)})),i},gt=function(t){var e=t===q,i=J(e?rt:p(t)),r=[];return z(i,(function(t){!l(it,t)||e&&!l(q,t)||et(r,it[t])})),r};c||(G=function(){if(d(Y,this))throw new X("Symbol is not a constructor");var t=arguments.length&&void 0!==arguments[0]?m(arguments[0]):void 0,e=D(t),i=function(t){var r=void 0===this?n:this;r===q&&s(i,rt,t),l(r,F)&&l(r[F],e)&&(r[F][e]=!1);var a=v(1,t);try{ot(r,e,a)}catch(o){if(!(o instanceof $))throw o;at(r,e,a)}};return h&&st&&ot(q,e,{configurable:!0,set:i}),ht(e,t)},Y=G[H],C(Y,"toString",(function(){return V(this).tag})),C(G,"withoutSetter",(function(t){return ht(D(t),t)})),A.f=dt,E.f=ct,x.f=ut,w.f=ft,_.f=T.f=pt,S.f=gt,M.f=function(t){return ht(O(t),t)},h&&(R(Y,"description",{configurable:!0,get:function(){return V(this).description}}),o||C(q,"propertyIsEnumerable",dt,{unsafe:!0}))),r({global:!0,constructor:!0,wrap:!0,forced:!c,sham:!c},{Symbol:G}),z(b(nt),(function(t){N(t)})),r({target:W,stat:!0,forced:!c},{useSetter:function(){st=!0},useSimple:function(){st=!1}}),r({target:"Object",stat:!0,forced:!c,sham:!h},{create:lt,defineProperty:ct,defineProperties:ut,getOwnPropertyDescriptor:ft}),r({target:"Object",stat:!0,forced:!c},{getOwnPropertyNames:pt}),B(),L(G,W),k[F]=!0},d9fc:function(t,e,i){var r=i("cbe5"),n=r.extend({type:"circle",shape:{cx:0,cy:0,r:0},buildPath:function(t,e,i){i&&t.moveTo(e.cx+e.r,e.cy),t.arc(e.cx,e.cy,e.r,0,2*Math.PI,!0)}});t.exports=n},da63:function(t,e,i){"use strict";var r=TypeError;t.exports=function(t){var e=t&&t.alphabet;if(void 0===e||"base64"===e||"base64url"===e)return e||"base64";throw new r("Incorrect `alphabet` option")}},dab0:function(t,e,i){"use strict";var r=i("23e7"),n=i("66e5");r({target:"AsyncIterator",name:"indexed",proto:!0,real:!0,forced:!0},{asIndexedPairs:n})},dad2:function(t,e,i){"use strict";var r=i("d066"),n=function(t){return{size:t,has:function(){return!1},keys:function(){return{next:function(){return{done:!0}}}}}},s=function(t){return{size:t,has:function(){return!0},keys:function(){throw new Error("e")}}};t.exports=function(t,e){var i=r("Set");try{(new i)[t](n(0));try{return(new i)[t](n(-1)),!1}catch(o){if(!e)return!0;try{return(new i)[t](s(-1/0)),!1}catch(h){var a=new i;return a.add(1),a.add(2),e(a[t](s(1/0)))}}}catch(h){return!1}}},dad3:function(t,e,i){"use strict";var r=i("83ab"),n=i("44d2"),s=i("7b0b"),a=i("07fa"),o=i("edd0");r&&(o(Array.prototype,"lastItem",{configurable:!0,get:function(){var t=s(this),e=a(t);return 0===e?void 0:t[e-1]},set:function(t){var e=s(this),i=a(e);return e[0===i?0:i-1]=t}}),n("lastItem"))},daf2:function(t,e,i){"use strict";i("0541")},db82:function(t,e,i){"use strict";var r=i("094a").has;t.exports=function(t){return r(t),t}},db96:function(t,e,i){"use strict";var r=i("23e7"),n=i("825a"),s=i("4fad");r({target:"Reflect",stat:!0},{isExtensible:function(t){return n(t),s(t)}})},db9b:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("825a"),a=i("46c4"),o=i("abc1"),h=i("f8cd"),c=i("c5cc"),u=i("c430"),l=c((function(){var t,e,i=this.iterator,r=this.next;while(this.remaining)if(this.remaining--,t=s(n(r,i)),e=this.done=!!t.done,e)return;if(t=s(n(r,i)),e=this.done=!!t.done,!e)return t.value}));r({target:"Iterator",proto:!0,real:!0,forced:u},{drop:function(t){s(this);var e=h(o(+t));return new l(a(this),{remaining:e})}})},dbb4:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("56ef"),a=i("fc6a"),o=i("06cf"),h=i("8418");r({target:"Object",stat:!0,sham:!n},{getOwnPropertyDescriptors:function(t){var e,i,r=a(t),n=o.f,c=s(r),u={},l=0;while(c.length>l)i=n(r,e=c[l++]),void 0!==i&&h(u,e,i);return u}})},dbe5:function(t,e,i){"use strict";var r=i("cfe9"),n=i("d039"),s=i("1212"),a=i("8558"),o=r.structuredClone;t.exports=!!o&&!n((function(){if("DENO"===a&&s>92||"NODE"===a&&s>94||"BROWSER"===a&&s>97)return!1;var t=new ArrayBuffer(8),e=o(t,{transfer:[t]});return 0!==t.byteLength||8!==e.byteLength}))},dbfa:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("d066"),o=i("f069"),h=i("e667"),c=i("2266"),u=i("5eed"),l="No one promise resolved";r({target:"Promise",stat:!0,forced:u},{any:function(t){var e=this,i=a("AggregateError"),r=o.f(e),u=r.resolve,d=r.reject,f=h((function(){var r=s(e.resolve),a=[],o=0,h=1,f=!1;c(t,(function(t){var s=o++,c=!1;h++,n(r,e,t).then((function(t){c||f||(f=!0,u(t))}),(function(t){c||f||(c=!0,a[s]=t,--h||d(new i(a,l)))}))})),--h||d(new i(a,l))}));return f.error&&d(f.value),r.promise}})},dc19:function(t,e,i){"use strict";var r=i("cb27").has;t.exports=function(t){return r(t),t}},dc20:function(t,e,i){var r=i("8727"),n=r.createElement,s=i("6d8b"),a=i("4942"),o=i("cbe5"),h=i("0da8"),c=i("76a5"),u=i("0c12"),l=i("b16f"),d=i("9fa3"),f=i("bcaa"),p=i("3f8e"),g=p.path,m=p.image,v=p.text;function y(t){return parseInt(t,10)}function b(t){return t instanceof o?g:t instanceof h?m:t instanceof c?v:g}function _(t,e){return e&&t&&e.parentNode!==t}function T(t,e,i){if(_(t,e)&&i){var r=i.nextSibling;r?t.insertBefore(e,r):t.appendChild(e)}}function S(t,e){if(_(t,e)){var i=t.firstChild;i?t.insertBefore(e,i):t.appendChild(e)}}function w(t,e){e&&t&&e.parentNode===t&&t.removeChild(e)}function E(t){return t.__textSvgEl}function x(t){return t.__svgEl}var A=function(t,e,i,r){this.root=t,this.storage=e,this._opts=i=s.extend({},i||{});var a=n("svg");a.setAttribute("xmlns","http://www.w3.org/2000/svg"),a.setAttribute("version","1.1"),a.setAttribute("baseProfile","full"),a.style.cssText="user-select:none;position:absolute;left:0;top:0;";var o=n("g");a.appendChild(o);var h=n("g");a.appendChild(h),this.gradientManager=new l(r,h),this.clipPathManager=new d(r,h),this.shadowManager=new f(r,h);var c=document.createElement("div");c.style.cssText="overflow:hidden;position:relative",this._svgDom=a,this._svgRoot=h,this._backgroundRoot=o,this._viewport=c,t.appendChild(c),c.appendChild(a),this.resize(i.width,i.height),this._visibleList=[]};function C(t){return function(){a('In SVG mode painter not support method "'+t+'"')}}A.prototype={constructor:A,getType:function(){return"svg"},getViewportRoot:function(){return this._viewport},getSvgDom:function(){return this._svgDom},getSvgRoot:function(){return this._svgRoot},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0);this._paintList(t)},setBackgroundColor:function(t){this._backgroundRoot&&this._backgroundNode&&this._backgroundRoot.removeChild(this._backgroundNode);var e=n("rect");e.setAttribute("width",this.getWidth()),e.setAttribute("height",this.getHeight()),e.setAttribute("x",0),e.setAttribute("y",0),e.setAttribute("id",0),e.style.fill=t,this._backgroundRoot.appendChild(e),this._backgroundNode=e},_paintList:function(t){this.gradientManager.markAllUnused(),this.clipPathManager.markAllUnused(),this.shadowManager.markAllUnused();var e,i=this._svgRoot,r=this._visibleList,n=t.length,s=[];for(e=0;e=0;--r)if(e[r]===t)return!0;return!1}),i}return null}return i[0]},resize:function(t,e){var i=this._viewport;i.style.display="none";var r=this._opts;if(null!=t&&(r.width=t),null!=e&&(r.height=e),t=this._getSize(0),e=this._getSize(1),i.style.display="",this._width!==t||this._height!==e){this._width=t,this._height=e;var n=i.style;n.width=t+"px",n.height=e+"px";var s=this._svgDom;s.setAttribute("width",t),s.setAttribute("height",e)}this._backgroundNode&&(this._backgroundNode.setAttribute("width",t),this._backgroundNode.setAttribute("height",e))},getWidth:function(){return this._width},getHeight:function(){return this._height},_getSize:function(t){var e=this._opts,i=["width","height"][t],r=["clientWidth","clientHeight"][t],n=["paddingLeft","paddingTop"][t],s=["paddingRight","paddingBottom"][t];if(null!=e[i]&&"auto"!==e[i])return parseFloat(e[i]);var a=this.root,o=document.defaultView.getComputedStyle(a);return(a[r]||y(o[i])||y(a.style[i]))-(y(o[n])||0)-(y(o[s])||0)|0},dispose:function(){this.root.innerHTML="",this._svgRoot=this._backgroundRoot=this._svgDom=this._backgroundNode=this._viewport=this.storage=null},clear:function(){this._viewport&&this.root.removeChild(this._viewport)},toDataURL:function(){this.refresh();var t=encodeURIComponent(this._svgDom.outerHTML.replace(/>\n\r<"));return"data:image/svg+xml;charset=UTF-8,"+t}},s.each(["getLayer","insertLayer","eachLayer","eachBuiltinLayer","eachOtherLayer","getLayers","modLayer","delLayer","clearLayer","pathToImage"],(function(t){A.prototype[t]=C(t)}));var R=A;t.exports=R},dc2f:function(t,e){var i=function(t,e){this.image=t,this.repeat=e,this.type="pattern"};i.prototype.getCanvasPattern=function(t){return t.createPattern(this.image,this.repeat||"repeat")};var r=i;t.exports=r},dc4a:function(t,e,i){"use strict";var r=i("59ed"),n=i("7234");t.exports=function(t,e){var i=t[e];return n(i)?void 0:r(i)}},dc56:function(t,e,i){"use strict";i("71b4")},dc8d:function(t,e,i){"use strict";var r=i("e065");r("hasInstance")},dca8:function(t,e,i){"use strict";var r=i("23e7"),n=i("bb2f"),s=i("d039"),a=i("861d"),o=i("f183").onFreeze,h=Object.freeze,c=s((function(){h(1)}));r({target:"Object",stat:!0,forced:c,sham:!n},{freeze:function(t){return h&&a(t)?h(o(t)):t}})},dcc3:function(t,e,i){"use strict";var r=i("ae93").IteratorPrototype,n=i("7c73"),s=i("5c6c"),a=i("d44e"),o=i("3f8c"),h=function(){return this};t.exports=function(t,e,i,c){var u=e+" Iterator";return t.prototype=n(r,{next:s(+!c,i)}),a(t,u,!1,!0),o[u]=h,t}},dd2f:function(t,e,i){"use strict";var r=i("c65b"),n=i("59ed"),s=i("825a"),a=i("861d"),o=i("3511"),h=i("d066"),c=i("46c4"),u=i("3436"),l=function(t){var e=0===t,i=1===t,l=2===t,d=3===t;return function(t,f,p){s(t);var g=void 0!==f;!g&&e||n(f);var m=c(t),v=h("Promise"),y=m.iterator,b=m.next,_=0;return new v((function(t,n){var h=function(t){u(y,n,t,n)},c=function(){try{if(g)try{o(_)}catch(m){h(m)}v.resolve(s(r(b,y))).then((function(r){try{if(s(r).done)e?(p.length=_,t(p)):t(!d&&(l||void 0));else{var o=r.value;try{if(g){var m=f(o,_),b=function(r){if(i)c();else if(l)r?c():u(y,t,!1,n);else if(e)try{p[_++]=r,c()}catch(s){h(s)}else r?u(y,t,d||o,n):c()};a(m)?v.resolve(m).then(b,h):b(m)}else p[_++]=o,c()}catch(T){h(T)}}}catch(S){n(S)}}),n)}catch(T){n(T)}};c()}))}};t.exports={toArray:l(0),forEach:l(1),every:l(2),some:l(3),find:l(4)}},ddb0:function(t,e,i){"use strict";var r=i("cfe9"),n=i("fdbc"),s=i("785a"),a=i("e260"),o=i("9112"),h=i("d44e"),c=i("b622"),u=c("iterator"),l=a.values,d=function(t,e){if(t){if(t[u]!==l)try{o(t,u,l)}catch(r){t[u]=l}if(h(t,e,!0),n[e])for(var i in a)if(t[i]!==a[i])try{o(t,i,a[i])}catch(r){t[i]=a[i]}}};for(var f in n)d(r[f]&&r[f].prototype,f);d(s,"DOMTokenList")},ddd7:function(t,e,i){"use strict";var r=i("23e7"),n=i("c65b"),s=i("59ed"),a=i("825a"),o=i("861d"),h=i("46c4"),c=i("d195"),u=i("4754"),l=i("3436"),d=i("c430"),f=c((function(t){var e=this,i=e.iterator,r=e.predicate;return new t((function(s,h){var c=function(t){e.done=!0,h(t)},d=function(t){l(i,c,t,c)},f=function(){try{t.resolve(a(n(e.next,i))).then((function(i){try{if(a(i).done)e.done=!0,s(u(void 0,!0));else{var n=i.value;try{var h=r(n,e.counter++),l=function(t){t?s(u(n,!1)):f()};o(h)?t.resolve(h).then(l,d):l(h)}catch(p){d(p)}}}catch(g){c(g)}}),c)}catch(h){c(h)}};f()}))}));r({target:"AsyncIterator",proto:!0,real:!0,forced:d},{filter:function(t){return a(this),s(t),new f(h(this),{predicate:t})}})},dded:function(t,e,i){var r=i("6d8b"),n=i("42e5"),s=function(t,e,i,r,s){this.x=null==t?.5:t,this.y=null==e?.5:e,this.r=null==i?.5:i,this.type="radial",this.global=s||!1,n.call(this,r)};s.prototype={constructor:s},r.inherits(s,n);var a=s;t.exports=a},de00:function(t,e){var i=2311;function r(){return i++}t.exports=r},dee5:function(t,e,i){"use strict";var r=i("23e7"),n=i("0366"),s=i("dc19"),a=i("cb27"),o=i("384f"),h=a.Set,c=a.add;r({target:"Set",proto:!0,real:!0,forced:!0},{filter:function(t){var e=s(this),i=n(t,arguments.length>1?arguments[1]:void 0),r=new h;return o(e,(function(t){i(t,t,e)&&c(r,t)})),r}})},df2f:function(t,e,i){(function(e,r){t.exports=r(i("21bf"))})(0,(function(t){return function(){var e=t,i=e.lib,r=i.WordArray,n=i.Hasher,s=e.algo,a=[],o=s.SHA1=n.extend({_doReset:function(){this._hash=new r.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(t,e){for(var i=this._hash.words,r=i[0],n=i[1],s=i[2],o=i[3],h=i[4],c=0;c<80;c++){if(c<16)a[c]=0|t[e+c];else{var u=a[c-3]^a[c-8]^a[c-14]^a[c-16];a[c]=u<<1|u>>>31}var l=(r<<5|r>>>27)+h+a[c];l+=c<20?1518500249+(n&s|~n&o):c<40?1859775393+(n^s^o):c<60?(n&s|n&o|s&o)-1894007588:(n^s^o)-899497514,h=o,o=s,s=n<<30|n>>>2,n=r,r=l}i[0]=i[0]+r|0,i[1]=i[1]+n|0,i[2]=i[2]+s|0,i[3]=i[3]+o|0,i[4]=i[4]+h|0},_doFinalize:function(){var t=this._data,e=t.words,i=8*this._nDataBytes,r=8*t.sigBytes;return e[r>>>5]|=128<<24-r%32,e[14+(r+64>>>9<<4)]=Math.floor(i/4294967296),e[15+(r+64>>>9<<4)]=i,t.sigBytes=4*e.length,this._process(),this._hash},clone:function(){var t=n.clone.call(this);return t._hash=this._hash.clone(),t}});e.SHA1=n._createHelper(o),e.HmacSHA1=n._createHmacHelper(o)}(),t.SHA1}))},df75:function(t,e,i){"use strict";var r=i("ca84"),n=i("7839");t.exports=Object.keys||function(t){return r(t,n)}},df7c:function(t,e,i){(function(t){function i(t,e){for(var i=0,r=t.length-1;r>=0;r--){var n=t[r];"."===n?t.splice(r,1):".."===n?(t.splice(r,1),i++):i&&(t.splice(r,1),i--)}if(e)for(;i--;i)t.unshift("..");return t}function r(t){"string"!==typeof t&&(t+="");var e,i=0,r=-1,n=!0;for(e=t.length-1;e>=0;--e)if(47===t.charCodeAt(e)){if(!n){i=e+1;break}}else-1===r&&(n=!1,r=e+1);return-1===r?"":t.slice(i,r)}function n(t,e){if(t.filter)return t.filter(e);for(var i=[],r=0;r=-1&&!r;s--){var a=s>=0?arguments[s]:t.cwd();if("string"!==typeof a)throw new TypeError("Arguments to path.resolve must be strings");a&&(e=a+"/"+e,r="/"===a.charAt(0))}return e=i(n(e.split("/"),(function(t){return!!t})),!r).join("/"),(r?"/":"")+e||"."},e.normalize=function(t){var r=e.isAbsolute(t),a="/"===s(t,-1);return t=i(n(t.split("/"),(function(t){return!!t})),!r).join("/"),t||r||(t="."),t&&a&&(t+="/"),(r?"/":"")+t},e.isAbsolute=function(t){return"/"===t.charAt(0)},e.join=function(){var t=Array.prototype.slice.call(arguments,0);return e.normalize(n(t,(function(t,e){if("string"!==typeof t)throw new TypeError("Arguments to path.join must be strings");return t})).join("/"))},e.relative=function(t,i){function r(t){for(var e=0;e=0;i--)if(""!==t[i])break;return e>i?[]:t.slice(e,i-e+1)}t=e.resolve(t).substr(1),i=e.resolve(i).substr(1);for(var n=r(t.split("/")),s=r(i.split("/")),a=Math.min(n.length,s.length),o=a,h=0;h=1;--s)if(e=t.charCodeAt(s),47===e){if(!n){r=s;break}}else n=!1;return-1===r?i?"/":".":i&&1===r?"/":t.slice(0,r)},e.basename=function(t,e){var i=r(t);return e&&i.substr(-1*e.length)===e&&(i=i.substr(0,i.length-e.length)),i},e.extname=function(t){"string"!==typeof t&&(t+="");for(var e=-1,i=0,r=-1,n=!0,s=0,a=t.length-1;a>=0;--a){var o=t.charCodeAt(a);if(47!==o)-1===r&&(n=!1,r=a+1),46===o?-1===e?e=a:1!==s&&(s=1):-1!==e&&(s=-1);else if(!n){i=a+1;break}}return-1===e||-1===r||0===s||1===s&&e===r-1&&e===i+1?"":t.slice(e,r)};var s="b"==="ab".substr(-1)?function(t,e,i){return t.substr(e,i)}:function(t,e,i){return e<0&&(e=t.length+e),t.substr(e,i)}}).call(this,i("4362"))},df7e:function(t,e,i){"use strict";var r=i("07fa");t.exports=function(t,e){for(var i=r(t),n=new e(i),s=0;s2?i:r(e),a=new t(s);while(s>n)a[n]=e[n++];return a}},e01a:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("cfe9"),a=i("e330"),o=i("1a2d"),h=i("1626"),c=i("3a9b"),u=i("577e"),l=i("edd0"),d=i("e893"),f=s.Symbol,p=f&&f.prototype;if(n&&h(f)&&(!("description"in p)||void 0!==f().description)){var g={},m=function(){var t=arguments.length<1||void 0===arguments[0]?void 0:u(arguments[0]),e=c(p,this)?new f(t):void 0===t?f():f(t);return""===t&&(g[e]=!0),e};d(m,f),m.prototype=p,p.constructor=m;var v="Symbol(description detection)"===String(f("description detection")),y=a(p.valueOf),b=a(p.toString),_=/^Symbol\((.*)\)[^)]+$/,T=a("".replace),S=a("".slice);l(p,"description",{configurable:!0,get:function(){var t=y(this);if(o(g,t))return"";var e=b(t),i=v?S(e,7,-1):T(e,_,"$1");return""===i?void 0:i}}),r({global:!0,constructor:!0,forced:!0},{Symbol:m})}},e065:function(t,e,i){"use strict";var r=i("428f"),n=i("1a2d"),s=i("e538"),a=i("9bf2").f;t.exports=function(t){var e=r.Symbol||(r.Symbol={});n(e,t)||a(e,t,{value:s.f(t)})}},e163:function(t,e,i){"use strict";var r=i("1a2d"),n=i("1626"),s=i("7b0b"),a=i("f772"),o=i("e177"),h=a("IE_PROTO"),c=Object,u=c.prototype;t.exports=o?c.getPrototypeOf:function(t){var e=s(t);if(r(e,h))return e[h];var i=e.constructor;return n(i)&&e instanceof i?i.prototype:e instanceof c?u:null}},e176:function(t,e,i){"use strict";var r=i("e065");r("observable")},e177:function(t,e,i){"use strict";var r=i("d039");t.exports=!r((function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype}))},e1db:function(t,e,i){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r,n=i("10d3"),s=i("20a2"),a=i("10d3"),o=i("1b29"),h=o.byEbmlID;(function(t){t[t["STATE_TAG"]=1]="STATE_TAG",t[t["STATE_SIZE"]=2]="STATE_SIZE",t[t["STATE_CONTENT"]=3]="STATE_CONTENT"})(r||(r={}));var c=function(){function t(){this._buffer=new n.Buffer(0),this._tag_stack=[],this._state=r.STATE_TAG,this._cursor=0,this._total=0,this._schema=h,this._result=[]}return t.prototype.decode=function(t){this.readChunk(t);var e=this._result;return this._result=[],e},t.prototype.readChunk=function(t){this._buffer=a.concat([this._buffer,new n.Buffer(t)]);while(this._cursor=this._buffer.length)return!1;var t=n.readVint(this._buffer,this._cursor);if(null==t)return!1;var e=this._buffer.slice(this._cursor,this._cursor+t.length),i=e.reduce((function(t,e,i,r){return t+e*Math.pow(16,2*(r.length-1-i))}),0),s=this.getSchemaInfo(i),a={EBML_ID:i.toString(16),schema:s,type:s.type,name:s.name,level:s.level,tagStart:this._total,tagEnd:this._total+t.length,sizeStart:this._total+t.length,sizeEnd:null,dataStart:null,dataEnd:null,dataSize:null,data:null};return this._tag_stack.push(a),this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_SIZE,!0},t.prototype.readSize=function(){if(this._cursor>=this._buffer.length)return!1;var t=n.readVint(this._buffer,this._cursor);if(null==t)return!1;var e=this._tag_stack[this._tag_stack.length-1];return e.sizeEnd=e.sizeStart+t.length,e.dataStart=e.sizeEnd,e.dataSize=t.value,-1===t.value?(e.dataEnd=-1,"m"===e.type&&(e.unknownSize=!0)):e.dataEnd=e.sizeEnd+t.value,this._cursor+=t.length,this._total+=t.length,this._state=r.STATE_CONTENT,!0},t.prototype.readContent=function(){var t=this._tag_stack[this._tag_stack.length-1];if("m"===t.type){if(t.isEnd=!1,this._result.push(t),this._state=r.STATE_TAG,0===t.dataSize){var e=Object.assign({},t,{isEnd:!0});this._result.push(e),this._tag_stack.pop()}return!0}if(this._buffer.length0){var a=this._tag_stack[this._tag_stack.length-1];if(a.dataEnd<0)return this._tag_stack.pop(),!0;if(this._total=0&&(i.splice(r,0,t),this._doAdd(t))}return this},_doAdd:function(t){t.parent&&t.parent.remove(t),t.parent=this;var e=this.__storage,i=this.__zr;e&&e!==t.__storage&&(e.addToStorage(t),t instanceof a&&t.addChildrenToStorage(e)),i&&i.refresh()},remove:function(t){var e=this.__zr,i=this.__storage,n=this._children,s=r.indexOf(n,t);return s<0||(n.splice(s,1),t.parent=null,i&&(i.delFromStorage(t),t instanceof a&&t.delChildrenFromStorage(i)),e&&e.refresh()),this},removeAll:function(){var t,e,i=this._children,r=this.__storage;for(e=0;e=e.length)return t.target=null,c(void 0,!0);switch(t.kind){case"keys":return c(i,!1);case"values":return c(e[i],!1)}return c([i,e[i]],!1)}),"values");var g=s.Arguments=s.Array;if(n("keys"),n("values"),n("entries"),!u&&l&&"values"!==g.name)try{o(g,"name",{value:"values"})}catch(m){}},e263:function(t,e,i){var r=i("401b"),n=i("4a3f"),s=Math.min,a=Math.max,o=Math.sin,h=Math.cos,c=2*Math.PI,u=r.create(),l=r.create(),d=r.create();function f(t,e,i){if(0!==t.length){var r,n=t[0],o=n[0],h=n[0],c=n[1],u=n[1];for(r=1;r1e-4)return p[0]=t-i,p[1]=e-n,g[0]=t+i,void(g[1]=e+n);if(u[0]=h(s)*i+t,u[1]=o(s)*n+e,l[0]=h(a)*i+t,l[1]=o(a)*n+e,m(p,u,l),v(g,u,l),s%=c,s<0&&(s+=c),a%=c,a<0&&(a+=c),s>a&&!f?a+=c:ss&&(d[0]=h(_)*i+t,d[1]=o(_)*n+e,m(p,d,p),v(g,d,g))}e.fromPoints=f,e.fromLine=p,e.fromCubic=v,e.fromQuadratic=y,e.fromArc=b},e267:function(t,e,i){"use strict";var r=i("e330"),n=i("e8b5"),s=i("1626"),a=i("c6b6"),o=i("577e"),h=r([].push);t.exports=function(t){if(s(t))return t;if(n(t)){for(var e=t.length,i=[],r=0;r1?a(arguments,1):[],i=o.f(this),r=c((function(){return s(h(t),void 0,e)}));return(r.error?i.reject:i.resolve)(r.value),i.promise}})},e285:function(t,e,i){"use strict";var r=i("cfe9"),n=r.isFinite;t.exports=Number.isFinite||function(t){return"number"==typeof t&&n(t)}},e297:function(t,e,i){"use strict";var r=i("23e7"),n=i("0255");r({target:"Symbol",stat:!0,name:"isWellKnownSymbol",forced:!0},{isWellKnown:n})},e323:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("1d80"),a=i("5926"),o=i("577e"),h=n("".slice),c=Math.max,u=Math.min,l=!"".substr||"b"!=="ab".substr(-1);r({target:"String",proto:!0,forced:l},{substr:function(t,e){var i,r,n=o(s(this)),l=n.length,d=a(t);return d===1/0&&(d=0),d<0&&(d=c(l+d,0)),i=void 0===e?l:a(e),i<=0||i===1/0?"":(r=u(d+i,l),d>=r?"":h(n,d,r))}})},e330:function(t,e,i){"use strict";var r=i("40d5"),n=Function.prototype,s=n.call,a=r&&n.bind.bind(s,s);t.exports=r?a:function(t){return function(){return s.apply(t,arguments)}}},e391:function(t,e,i){"use strict";var r=i("577e");t.exports=function(t,e){return void 0===t?arguments.length<2?"":e:r(t)}},e3db:function(t,e){var i={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==i.call(t)}},e3df:function(t,e,i){"use strict";var r=i("23e7"),n=i("dc19"),s=i("cb27").add;r({target:"Set",proto:!0,real:!0,forced:!0},{addAll:function(){for(var t=n(this),e=0,i=arguments.length;e1&&(o=h(o,s(arguments[1]))),o<0&&(o=i+o);o>=0;o--)if(o in e&&e[o]===t)return o||0;return-1}:c},e5cb:function(t,e,i){"use strict";var r=i("d066"),n=i("1a2d"),s=i("9112"),a=i("3a9b"),o=i("d2bb"),h=i("e893"),c=i("aeb0"),u=i("7156"),l=i("e391"),d=i("ab36"),f=i("6f19"),p=i("83ab"),g=i("c430");t.exports=function(t,e,i,m){var v="stackTraceLimit",y=m?2:1,b=t.split("."),_=b[b.length-1],T=r.apply(null,b);if(T){var S=T.prototype;if(!g&&n(S,"cause")&&delete S.cause,!i)return T;var w=r("Error"),E=e((function(t,e){var i=l(m?e:t,void 0),r=m?new T(t):new T;return void 0!==i&&s(r,"message",i),f(r,E,r.stack,2),this&&a(S,this)&&u(r,this,E),arguments.length>y&&d(r,arguments[y]),r}));if(E.prototype=S,"Error"!==_?o?o(E,w):h(E,w,{name:!0}):p&&v in T&&(c(E,T,v),c(E,T,"prepareStackTrace")),h(E,T),!g)try{S.name!==_&&s(S,"name",_),S.constructor=E}catch(x){}return E}}},e61b:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("3252"))})(0,(function(t){return function(e){var i=t,r=i.lib,n=r.WordArray,s=r.Hasher,a=i.x64,o=a.Word,h=i.algo,c=[],u=[],l=[];(function(){for(var t=1,e=0,i=0;i<24;i++){c[t+5*e]=(i+1)*(i+2)/2%64;var r=e%5,n=(2*t+3*e)%5;t=r,e=n}for(t=0;t<5;t++)for(e=0;e<5;e++)u[t+5*e]=e+(2*t+3*e)%5*5;for(var s=1,a=0;a<24;a++){for(var h=0,d=0,f=0;f<7;f++){if(1&s){var p=(1<>>24)|4278255360&(s<<24|s>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8);var o=i[n];o.high^=a,o.low^=s}for(var h=0;h<24;h++){for(var f=0;f<5;f++){for(var p=0,g=0,m=0;m<5;m++){o=i[f+5*m];p^=o.high,g^=o.low}var v=d[f];v.high=p,v.low=g}for(f=0;f<5;f++){var y=d[(f+4)%5],b=d[(f+1)%5],_=b.high,T=b.low;for(p=y.high^(_<<1|T>>>31),g=y.low^(T<<1|_>>>31),m=0;m<5;m++){o=i[f+5*m];o.high^=p,o.low^=g}}for(var S=1;S<25;S++){o=i[S];var w=o.high,E=o.low,x=c[S];x<32?(p=w<>>32-x,g=E<>>32-x):(p=E<>>64-x,g=w<>>64-x);var A=d[u[S]];A.high=p,A.low=g}var C=d[0],R=i[0];C.high=R.high,C.low=R.low;for(f=0;f<5;f++)for(m=0;m<5;m++){S=f+5*m,o=i[S];var P=d[S],I=d[(f+1)%5+5*m],k=d[(f+2)%5+5*m];o.high=P.high^~I.high&k.high,o.low=P.low^~I.low&k.low}o=i[0];var D=l[h];o.high^=D.high,o.low^=D.low}},_doFinalize:function(){var t=this._data,i=t.words,r=(this._nDataBytes,8*t.sigBytes),s=32*this.blockSize;i[r>>>5]|=1<<24-r%32,i[(e.ceil((r+1)/s)*s>>>5)-1]|=128,t.sigBytes=4*i.length,this._process();for(var a=this._state,o=this.cfg.outputLength/8,h=o/8,c=[],u=0;u>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),c.push(f),c.push(d)}return new n.init(c,o)},clone:function(){for(var t=s.clone.call(this),e=t._state=this._state.slice(0),i=0;i<25;i++)e[i]=e[i].clone();return t}});i.SHA3=s._createHelper(f),i.HmacSHA3=s._createHmacHelper(f)}(Math),t.SHA3}))},e667:function(t,e,i){"use strict";t.exports=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}}},e6675:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("d066"),a=i("59ed"),o=i("19aa"),h=i("cb2d"),c=i("6964"),u=i("edd0"),l=i("b622"),d=i("69f3"),f=i("2bdf"),p=s("SuppressedError"),g=ReferenceError,m=l("dispose"),v=l("toStringTag"),y="DisposableStack",b=d.set,_=d.getterFor(y),T="sync-dispose",S="disposed",w="pending",E=function(t){var e=_(t);if(e.state===S)throw new g(y+" already disposed");return e},x=function(){b(o(this,A),{type:y,state:w,stack:[]}),n||(this.disposed=!1)},A=x.prototype;c(A,{dispose:function(){var t=_(this);if(t.state!==S){t.state=S,n||(this.disposed=!0);var e,i=t.stack,r=i.length,s=!1;while(r){var a=i[--r];i[r]=null;try{a()}catch(o){s?e=new p(o,e):(s=!0,e=o)}}if(t.stack=null,s)throw e}},use:function(t){return f(E(this),t,T),t},adopt:function(t,e){var i=E(this);return a(e),f(i,void 0,T,(function(){e(t)})),t},defer:function(t){var e=E(this);a(t),f(e,void 0,T,t)},move:function(){var t=E(this),e=new x;return _(e).stack=t.stack,t.stack=[],t.state=S,n||(this.disposed=!0),e}}),n&&u(A,"disposed",{configurable:!0,get:function(){return _(this).state===S}}),h(A,m,A.dispose,{name:"dispose"}),h(A,v,y,{nonWritable:!0}),r({global:!0,constructor:!0},{DisposableStack:x})},e683:function(t,e,i){"use strict";t.exports=function(t,e){return e?t.replace(/\/+$/,"")+"/"+e.replace(/^\/+/,""):t}},e6bd:function(t,e,i){"use strict";var r=i("23e7"),n=i("783c"),s=i("825a"),a=n.get,o=n.toKey;r({target:"Reflect",stat:!0},{getOwnMetadata:function(t,e){var i=arguments.length<3?void 0:o(arguments[2]);return a(t,s(e),i)}})},e6cf:function(t,e,i){"use strict";i("5e7e"),i("14e5"),i("cc98"),i("3529"),i("f22b"),i("7149")},e6e1:function(t,e,i){"use strict";var r=i("23e7");r({target:"Number",stat:!0,nonConfigurable:!0,nonWritable:!0},{MIN_SAFE_INTEGER:-9007199254740991})},e71b:function(t,e,i){"use strict";var r=i("23e7"),n=i("83ab"),s=i("eb1d"),a=i("59ed"),o=i("7b0b"),h=i("9bf2");n&&r({target:"Object",proto:!0,forced:s},{__defineSetter__:function(t,e){h.f(o(this),t,{set:a(e),enumerable:!0,configurable:!0})}})},e74c:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("1626"),a=i("8925"),o=i("1a2d"),h=i("83ab"),c=Object.getOwnPropertyDescriptor,u=/^\s*class\b/,l=n(u.exec),d=function(t){try{if(!h||!l(u,a(t)))return!1}catch(i){}var e=c(t,"prototype");return!!e&&o(e,"writable")&&!e.writable};r({target:"Function",stat:!0,sham:!0,forced:!0},{isCallable:function(t){return s(t)&&!d(t)}})},e7d2:function(t,e,i){var r=i("4a3f");function n(t,e,i,n,s,a,o,h,c,u,l){if(0===c)return!1;var d=c;if(l>e+d&&l>n+d&&l>a+d&&l>h+d||lt+d&&u>i+d&&u>s+d&&u>o+d||uf&&(d=0,l={}),d++,l[i]=n,n}function b(t,e,i,r,n,s,a,o){return a?T(t,e,i,r,n,s,a,o):_(t,e,i,r,n,s,o)}function _(t,e,i,n,s,a,o){var h=D(t,e,s,a,o),c=y(t,e);s&&(c+=s[1]+s[3]);var u=h.outerHeight,l=S(0,c,i),d=w(0,u,n),f=new r(l,d,c,u);return f.lineHeight=h.lineHeight,f}function T(t,e,i,n,s,a,o,h){var c=O(t,{rich:o,truncate:h,font:e,textAlign:i,textPadding:s,textLineHeight:a}),u=c.outerWidth,l=c.outerHeight,d=S(0,u,i),f=w(0,l,n);return new r(d,f,u,l)}function S(t,e,i){return"right"===i?t-=e:"center"===i&&(t-=e/2),t}function w(t,e,i){return"middle"===i?t-=e/2:"bottom"===i&&(t-=e),t}function E(t,e,i){var r=e.textPosition,n=e.textDistance,s=i.x,a=i.y;n=n||0;var o=i.height,h=i.width,c=o/2,u="left",l="top";switch(r){case"left":s-=n,a+=c,u="right",l="middle";break;case"right":s+=n+h,a+=c,l="middle";break;case"top":s+=h/2,a-=n,u="center",l="bottom";break;case"bottom":s+=h/2,a+=o+n,u="center";break;case"inside":s+=h/2,a+=c,u="center",l="middle";break;case"insideLeft":s+=n,a+=c,l="middle";break;case"insideRight":s+=h-n,a+=c,u="right",l="middle";break;case"insideTop":s+=h/2,a+=n,u="center";break;case"insideBottom":s+=h/2,a+=o-n,u="center",l="bottom";break;case"insideTopLeft":s+=n,a+=n;break;case"insideTopRight":s+=h-n,a+=n,u="right";break;case"insideBottomLeft":s+=n,a+=o-n,l="bottom";break;case"insideBottomRight":s+=h-n,a+=o-n,u="right",l="bottom";break}return t=t||{},t.x=s,t.y=a,t.textAlign=u,t.textVerticalAlign=l,t}function x(t,e,i){var r={textPosition:t,textDistance:i};return E({},r,e)}function A(t,e,i,r,n){if(!e)return"";var s=(t+"").split("\n");n=C(e,i,r,n);for(var a=0,o=s.length;a=s;c++)a-=s;var u=y(i,e);return u>a&&(i="",u=0),a=t-u,r.ellipsis=i,r.ellipsisWidth=u,r.contentWidth=a,r.containerWidth=t,r}function R(t,e){var i=e.containerWidth,r=e.font,n=e.contentWidth;if(!i)return"";var s=y(t,r);if(s<=i)return t;for(var a=0;;a++){if(s<=n||a>=e.maxIterations){t+=e.ellipsis;break}var o=0===a?P(t,n,e.ascCharWidth,e.cnCharWidth):s>0?Math.floor(t.length*n/s):0;t=t.substr(0,o),s=y(t,r)}return""===t&&(t=e.placeholder),t}function P(t,e,i,r){for(var n=0,s=0,a=t.length;sl)t="",a=[];else if(null!=d)for(var f=C(d-(i?i[1]+i[3]:0),e,n.ellipsis,{minChar:n.minChar,placeholder:n.placeholder}),p=0,g=a.length;ps&&M(i,t.substring(s,a)),M(i,r[2],r[1]),s=p.lastIndex}sv)return{lines:[],width:0,height:0};E.textWidth=y(E.text,R);var k=x.textWidth,D=null==k||"auto"===k;if("string"===typeof k&&"%"===k.charAt(k.length-1))E.percentWidth=k,d.push(E),k=0;else{if(D){k=E.textWidth;var O=x.textBackgroundColor,N=O&&O.image;N&&(N=n.findExistImage(N),n.isImageReady(N)&&(k=Math.max(k,N.width*P/N.height)))}var B=C?C[1]+C[3]:0;k+=B;var L=null!=m?m-S:null;null!=L&&L1?arguments[1]:void 0)}))},e95a:function(t,e,i){"use strict";var r=i("b622"),n=i("3f8c"),s=r("iterator"),a=Array.prototype;t.exports=function(t){return void 0!==t&&(n.Array===t||a[s]===t)}},e95e:function(t,e,i){"use strict";var r=i("e065");r("patternMatch")},e9bc:function(t,e,i){"use strict";var r=i("dc19"),n=i("cb27").add,s=i("83b9"),a=i("7f65"),o=i("5388");t.exports=function(t){var e=r(this),i=a(t).getIterator(),h=s(e);return o(i,(function(t){n(h,t)})),h}},e9c4:function(t,e,i){"use strict";var r=i("23e7"),n=i("d066"),s=i("2ba4"),a=i("c65b"),o=i("e330"),h=i("d039"),c=i("1626"),u=i("d9b5"),l=i("f36a"),d=i("e267"),f=i("04f8"),p=String,g=n("JSON","stringify"),m=o(/./.exec),v=o("".charAt),y=o("".charCodeAt),b=o("".replace),_=o(1..toString),T=/[\uD800-\uDFFF]/g,S=/^[\uD800-\uDBFF]$/,w=/^[\uDC00-\uDFFF]$/,E=!f||h((function(){var t=n("Symbol")("stringify detection");return"[null]"!==g([t])||"{}"!==g({a:t})||"{}"!==g(Object(t))})),x=h((function(){return'"\\udf06\\ud834"'!==g("\udf06\ud834")||'"\\udead"'!==g("\udead")})),A=function(t,e){var i=l(arguments),r=d(e);if(c(r)||void 0!==t&&!u(t))return i[1]=function(t,e){if(c(r)&&(e=a(r,this,p(t),e)),!u(e))return e},s(g,null,i)},C=function(t,e,i){var r=v(i,e-1),n=v(i,e+1);return m(S,t)&&!m(w,n)||m(w,t)&&!m(S,r)?"\\u"+_(y(t,0),16):t};g&&r({target:"JSON",stat:!0,arity:3,forced:E||x},{stringify:function(t,e,i){var r=l(arguments),n=s(E?A:g,null,r);return x&&"string"==typeof n?b(n,T,C):n}})},e9e0:function(t,e,i){"use strict";var r=i("c65b"),n=i("59ed"),s=i("1626"),a=i("825a"),o=TypeError;t.exports=function(t,e){var i,h=a(this),c=n(h.get),u=n(h.has),l=n(h.set),d=arguments.length>2?arguments[2]:void 0;if(!s(e)&&!s(d))throw new o("At least one callback required");return r(u,h,t)?(i=r(c,h,t),s(e)&&(i=e(i),r(l,h,t,i))):s(d)&&(i=d(),r(l,h,t,i)),i}},e9f5:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("19aa"),a=i("825a"),o=i("1626"),h=i("e163"),c=i("edd0"),u=i("8418"),l=i("d039"),d=i("1a2d"),f=i("b622"),p=i("ae93").IteratorPrototype,g=i("83ab"),m=i("c430"),v="constructor",y="Iterator",b=f("toStringTag"),_=TypeError,T=n[y],S=m||!o(T)||T.prototype!==p||!l((function(){T({})})),w=function(){if(s(this,p),h(this)===p)throw new _("Abstract class Iterator not directly constructable")},E=function(t,e){g?c(p,t,{configurable:!0,get:function(){return e},set:function(e){if(a(this),this===p)throw new _("You can't redefine this property");d(this,t)?this[t]=e:u(this,t,e)}}):p[t]=e};d(p,b)||E(b,y),!S&&d(p,v)&&p[v]!==Object||E(v,w),w.prototype=p,r({global:!0,constructor:!0,forced:S},{Iterator:w})},e9f9:function(t,e,i){var r=i("4942"),n=i("d3a4"),s=i("6d8b"),a=s.each;function o(t){return parseInt(t,10)}function h(t,e){n.initVML(),this.root=t,this.storage=e;var i=document.createElement("div"),r=document.createElement("div");i.style.cssText="display:inline-block;overflow:hidden;position:relative;width:300px;height:150px;",r.style.cssText="position:absolute;left:0;top:0;",t.appendChild(i),this._vmlRoot=r,this._vmlViewport=i,this.resize();var s=e.delFromStorage,a=e.addToStorage;e.delFromStorage=function(t){s.call(e,t),t&&t.onRemove&&t.onRemove(r)},e.addToStorage=function(t){t.onAdd&&t.onAdd(r),a.call(e,t)},this._firstPaint=!0}function c(t){return function(){r('In IE8.0 VML mode painter not support method "'+t+'"')}}h.prototype={constructor:h,getType:function(){return"vml"},getViewportRoot:function(){return this._vmlViewport},getViewportRootOffset:function(){var t=this.getViewportRoot();if(t)return{offsetLeft:t.offsetLeft||0,offsetTop:t.offsetTop||0}},refresh:function(){var t=this.storage.getDisplayList(!0,!0);this._paintList(t)},_paintList:function(t){for(var e=this._vmlRoot,i=0;i=Math.pow(2,8-r))break;if(r>8)throw new Error("Unrepresentable length: "+r+" "+t.toString("hex",e,e+r));if(e+r>t.length)return null;var n,s=t[e]&(1<<8-r)-1;for(n=1;n=Math.pow(2,45)&&t[e+7]>0)return{length:r,value:-1};s*=Math.pow(2,8),s+=t[e+n]}return i&&(s-=Math.pow(2,7*r-1)-1),{length:r,value:s}}},ea98:function(t,e,i){"use strict";var r=i("23e7"),n=i("e330"),s=i("1d80"),a=i("5926"),o=i("577e"),h=i("d039"),c=n("".charAt),u=h((function(){return"\ud842"!=="𠮷".at(-2)}));r({target:"String",proto:!0,forced:u},{at:function(t){var e=o(s(this)),i=e.length,r=a(t),n=r>=0?r:i+r;return n<0||n>=i?void 0:c(e,n)}})},eac5:function(t,e,i){"use strict";var r=i("861d"),n=Math.floor;t.exports=Number.isInteger||function(t){return!r(t)&&isFinite(t)&&n(t)===t}},eade:function(t,e,i){"use strict";var r=i("c65b"),n=i("cb2d"),s=i("d066"),a=i("dc4a"),o=i("1a2d"),h=i("b622"),c=i("a91f"),u=h("asyncDispose"),l=s("Promise");o(c,u)||n(c,u,(function(){var t=this;return new l((function(e,i){var n=a(t,"return");n?l.resolve(r(n,t)).then((function(){e(void 0)}),i):e(void 0)}))}))},eb03:function(t,e,i){"use strict";i("c1a1")},eb1d:function(t,e,i){"use strict";var r=i("c430"),n=i("cfe9"),s=i("d039"),a=i("ea83");t.exports=r||!s((function(){if(!(a&&a<535)){var t=Math.random();__defineSetter__.call(null,t,(function(){})),delete n[t]}}))},eba5:function(t,e,i){"use strict";i("967a")},ebb5:function(t,e,i){"use strict";var r,n,s,a=i("4b11"),o=i("83ab"),h=i("cfe9"),c=i("1626"),u=i("861d"),l=i("1a2d"),d=i("f5df"),f=i("0d51"),p=i("9112"),g=i("cb2d"),m=i("edd0"),v=i("3a9b"),y=i("e163"),b=i("d2bb"),_=i("b622"),T=i("90e3"),S=i("69f3"),w=S.enforce,E=S.get,x=h.Int8Array,A=x&&x.prototype,C=h.Uint8ClampedArray,R=C&&C.prototype,P=x&&y(x),I=A&&y(A),k=Object.prototype,D=h.TypeError,O=_("toStringTag"),M=T("TYPED_ARRAY_TAG"),N="TypedArrayConstructor",B=a&&!!b&&"Opera"!==d(h.opera),L=!1,U={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},z={BigInt64Array:8,BigUint64Array:8},F=function(t){if(!u(t))return!1;var e=d(t);return"DataView"===e||l(U,e)||l(z,e)},W=function(t){var e=y(t);if(u(e)){var i=E(e);return i&&l(i,N)?i[N]:W(e)}},H=function(t){if(!u(t))return!1;var e=d(t);return l(U,e)||l(z,e)},j=function(t){if(H(t))return t;throw new D("Target is not a typed array")},V=function(t){if(c(t)&&(!b||v(P,t)))return t;throw new D(f(t)+" is not a typed array constructor")},q=function(t,e,i,r){if(o){if(i)for(var n in U){var s=h[n];if(s&&l(s.prototype,t))try{delete s.prototype[t]}catch(a){try{s.prototype[t]=e}catch(c){}}}I[t]&&!i||g(I,t,i?e:B&&A[t]||e,r)}},G=function(t,e,i){var r,n;if(o){if(b){if(i)for(r in U)if(n=h[r],n&&l(n,t))try{delete n[t]}catch(s){}if(P[t]&&!i)return;try{return g(P,t,i?e:B&&P[t]||e)}catch(s){}}for(r in U)n=h[r],!n||n[t]&&!i||g(n,t,e)}};for(r in U)n=h[r],s=n&&n.prototype,s?w(s)[N]=n:B=!1;for(r in z)n=h[r],s=n&&n.prototype,s&&(w(s)[N]=n);if((!B||!c(P)||P===Function.prototype)&&(P=function(){throw new D("Incorrect invocation")},B))for(r in U)h[r]&&b(h[r],P);if((!B||!I||I===k)&&(I=P.prototype,B))for(r in U)h[r]&&b(h[r].prototype,I);if(B&&y(R)!==I&&b(R,I),o&&!l(I,O))for(r in L=!0,m(I,O,{configurable:!0,get:function(){return u(this)?this[M]:void 0}}),U)h[r]&&p(h[r],M,r);t.exports={NATIVE_ARRAY_BUFFER_VIEWS:B,TYPED_ARRAY_TAG:L&&M,aTypedArray:j,aTypedArrayConstructor:V,exportTypedArrayMethod:q,exportTypedArrayStaticMethod:G,getTypedArrayConstructor:W,isView:F,isTypedArray:H,TypedArray:P,TypedArrayPrototype:I}},ebc1:function(t,e,i){"use strict";var r=i("b5db");t.exports=/ipad|iphone|ipod/i.test(r)&&"undefined"!=typeof Pebble},ebe8:function(t,e,i){"use strict";var r=i("d066"),n=i("1626"),s=i("8ced"),a=i("861d"),o=r("Set"),h=function(t){return a(t)&&"number"==typeof t.size&&n(t.has)&&n(t.keys)};t.exports=function(t){return h(t)?t:s(t)?new o(t):t}},ec87:function(t,e,i){"use strict";var r=i("b5db");t.exports=/web0s(?!.*chrome)/i.test(r)},ec97:function(t,e,i){"use strict";var r=i("ebb5"),n=i("8aa7"),s=r.aTypedArrayConstructor,a=r.exportTypedArrayStaticMethod;a("of",(function(){var t=0,e=arguments.length,i=new(s(this))(e);while(e>t)i[t]=arguments[t++];return i}),n)},ed21:function(t,e,i){var r=i("2cf4"),n=r.devicePixelRatio,s=i("6d8b"),a=i("4942"),o=i("9850"),h=i("04f6"),c=i("5e68"),u=i("98b7"),l=i("0da8"),d=i("22d1"),f=1e5,p=314159,g=.01,m=.001;function v(t){return parseInt(t,10)}function y(t){return!!t&&(!!t.__builtin__||"function"===typeof t.resize&&"function"===typeof t.refresh)}var b=new o(0,0,0,0),_=new o(0,0,0,0);function T(t,e,i){return b.copy(t.getBoundingRect()),t.transform&&b.applyTransform(t.transform),_.width=e,_.height=i,!b.intersect(_)}function S(t,e){if(t===e)return!1;if(!t||!e||t.length!==e.length)return!0;for(var i=0;i=0&&i.splice(r,1),t.__hoverMir=null},clearHover:function(t){for(var e=this._hoverElements,i=0;i15)break}}a.__drawIndex=v,a.__drawIndex0&&t>r[0]){for(o=0;ot)break;s=i[r[o]]}if(r.splice(o+1,0,t),i[t]=e,!e.virtual)if(s){var c=s.dom;c.nextSibling?h.insertBefore(e.dom,c.nextSibling):h.appendChild(e.dom)}else h.firstChild?h.insertBefore(e.dom,h.firstChild):h.appendChild(e.dom)}else a("Layer of zlevel "+t+" is not valid")},eachLayer:function(t,e){var i,r,n=this._zlevelList;for(r=0;r0?g:0),this._needsManuallyCompositing),h.__builtin__||a("ZLevel "+c+" has been used by unkown layer "+h.id),h!==s&&(h.__used=!0,h.__startIndex!==i&&(h.__dirty=!0),h.__startIndex=i,h.incremental?h.__drawIndex=-1:h.__drawIndex=i,e(i),s=h),r.__dirty&&(h.__dirty=!0,h.incremental&&h.__drawIndex<0&&(h.__drawIndex=i))}e(i),this.eachBuiltinLayer((function(t,e){!t.__used&&t.getElementCount()>0&&(t.__dirty=!0,t.__startIndex=t.__endIndex=t.__drawIndex=0),t.__dirty&&t.__drawIndex<0&&(t.__drawIndex=t.__startIndex)}))},clear:function(){return this.eachBuiltinLayer(this._clearLayer),this},_clearLayer:function(t){t.clear()},setBackgroundColor:function(t){this._backgroundColor=t},configLayer:function(t,e){if(e){var i=this._layerConfig;i[t]?s.merge(i[t],e,!0):i[t]=e;for(var r=0;r=p)throw new a("Maximum allowed index exceeded");if("number"!=typeof t)throw new o("Value is not a number");r!==v&&(t!==t?r=v:t===h?r=r===y?v:b:t===-h?r=r===b?v:y:0===t&&1/t!==h||r!==_&&r!==T||(r=T,d(e,t)))})),r){case v:return c;case y:return-h;case b:return h;case _:return-0}for(var n,l,w,E,x,A,C=[],R=0,P=0;P=0?C[O]:0;if(O--,u(R)>1||R>0&&M>0||R<0&&M<0)return R>0?h:-h;if(w=S(R*f,M/2),E=w.hi,x=w.lo,x*=2,u(2*E)===h)return E>0?E===f&&x===-m/2&&O>=0&&C[O]<0?g:h:E===-f&&x===m/2&&O>=0&&C[O]>0?-g:-h;0!==x&&(C[++O]=x,x=0),E*=2}while(O>=0)if(w=S(E,C[O--]),E=w.hi,x=w.lo,0!==x)break;return O>=0&&(x<0&&C[O]<0||x>0&&C[O]>0)&&(l=2*x,n=E+l,l===n-E&&(E=n)),E}})},efe9:function(t,e,i){"use strict";var r=i("e065");r("isConcatSpreadable")},efec:function(t,e,i){"use strict";var r=i("1a2d"),n=i("cb2d"),s=i("51eb"),a=i("b622"),o=a("toPrimitive"),h=Date.prototype;r(h,o)||n(h,o,s)},f00c:function(t,e,i){"use strict";var r=i("23e7"),n=i("e285");r({target:"Number",stat:!0},{isFinite:n})},f069:function(t,e,i){"use strict";var r=i("59ed"),n=TypeError,s=function(t){var e,i;this.promise=new t((function(t,r){if(void 0!==e||void 0!==i)throw new n("Bad Promise constructor");e=t,i=r})),this.resolve=r(e),this.reject=r(i)};t.exports.f=function(t){return new s(t)}},f124:function(t,e,i){"use strict";var r=i("23e7"),n=i("98ce"),s=i("4c1f").remove;r({target:"WeakSet",proto:!0,real:!0,forced:!0},{deleteAll:function(){for(var t,e=n(this),i=!0,r=0,a=arguments.length;r2?arguments[2]:void 0)(t,i);return u(i,t,e(l,t,i)),i}})},f495:function(t,e,i){"use strict";var r=i("c04e"),n=TypeError;t.exports=function(t){var e=r(t,"number");if("number"==typeof e)throw new n("Can't convert number to bigint");return BigInt(e)}},f4b3:function(t,e,i){"use strict";var r=i("23e7"),n=i("d039"),s=i("7b0b"),a=i("c04e"),o=n((function(){return null!==new Date(NaN).toJSON()||1!==Date.prototype.toJSON.call({toISOString:function(){return 1}})}));r({target:"Date",proto:!0,arity:1,forced:o},{toJSON:function(t){var e=s(this),i=a(e,"number");return"number"!=typeof i||isFinite(i)?e.toISOString():null}})},f4dd:function(t,e,i){"use strict";var r=i("23e7"),n=i("d58f").right,s=i("a640"),a=i("1212"),o=i("9adc"),h=!o&&a>79&&a<83,c=h||!s("reduceRight");r({target:"Array",proto:!0,forced:c},{reduceRight:function(t){return n(this,t,arguments.length,arguments.length>1?arguments[1]:void 0)}})},f4ea:function(t,e,i){(function(e,r,n){t.exports=r(i("21bf"),i("38ba"))})(0,(function(t){return t.mode.CTR=function(){var e=t.lib.BlockCipherMode.extend(),i=e.Encryptor=e.extend({processBlock:function(t,e){var i=this._cipher,r=i.blockSize,n=this._iv,s=this._counter;n&&(s=this._counter=n.slice(0),this._iv=void 0);var a=s.slice(0);i.encryptBlock(a,0),s[r-1]=s[r-1]+1|0;for(var o=0;on){if(e=+arguments[n++],s(e,1114111)!==e)throw new a(e+" is not a valid code point");i[n]=e<65536?o(e):o(55296+((e-=65536)>>10),e%1024+56320)}return c(i,"")}})},f731:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("3a9b"),a=i("e163"),o=i("d2bb"),h=i("e893"),c=i("7c73"),u=i("9112"),l=i("5c6c"),d=i("6f19"),f=i("e391"),p=i("b622"),g=i("d039"),m=i("c430"),v=n.SuppressedError,y=p("toStringTag"),b=Error,_=!!v&&3!==v.length,T=!!v&&g((function(){return 4===new v(1,2,3,{cause:4}).cause})),S=_||T,w=function(t,e,i){var r,n=s(E,this);return o?r=!S||n&&a(this)!==E?o(new b,n?a(this):E):new v:(r=n?this:c(E),u(r,y,"Error")),void 0!==i&&u(r,"message",f(i)),d(r,w,r.stack,1),u(r,"error",t),u(r,"suppressed",e),r};o?o(w,b):h(w,b,{name:!0});var E=w.prototype=S?v.prototype:c(b.prototype,{constructor:l(1,w),message:l(1,""),name:l(1,"SuppressedError")});S&&!m&&(E.constructor=w),r({global:!0,constructor:!0,arity:3,forced:S},{SuppressedError:w})},f748:function(t,e,i){"use strict";t.exports=Math.sign||function(t){var e=+t;return 0===e||e!==e?e:e<0?-1:1}},f748b:function(t,e,i){"use strict";var r=i("861d"),n=i("69f3").get;t.exports=function(t){if(!r(t))return!1;var e=n(t);return!!e&&"RawJSON"===e.type}},f772:function(t,e,i){"use strict";var r=i("5692"),n=i("90e3"),s=r("keys");t.exports=function(t){return s[t]||(s[t]=n(t))}},f785:function(t,e,i){"use strict";var r=i("2626");r("Array")},f8c9:function(t,e,i){"use strict";var r=i("23e7"),n=i("cfe9"),s=i("d44e");r({global:!0},{Reflect:{}}),s(n.Reflect,"Reflect",!0)},f8cd:function(t,e,i){"use strict";var r=i("5926"),n=RangeError;t.exports=function(t){var e=r(t);if(e<0)throw new n("The argument can't be less than 0");return e}},f93b:function(t,e,i){"use strict";var r=i("23e7"),n=i("dd2f").every;r({target:"AsyncIterator",proto:!0,real:!0},{every:function(t){return n(this,t)}})},fa76:function(t,e,i){"use strict";i("1e5a")},fa9e:function(t,e,i){"use strict";i("986a")},fb15:function(t,e,i){"use strict";if(i.r(e),"undefined"!==typeof window){var r=window.document.currentScript,n=r&&r.src.match(/(.+\/)[^/]+\.js(\?.*)?$/);n&&(i.p=n[1])}const s=()=>navigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),a=t=>"string"===typeof t?document.querySelector(t):t,o="\n .__is_full__ {\n position: absolute;\n touch-action: none;\n overflow: hidden;\n width: 100%!important;\n height: 100%!important;\n margin: 0;\n }\n ",h=()=>{const t=document.createElement("style");t.appendChild(document.createTextNode(o));const e=document.getElementsByTagName("head")[0];return e.appendChild(t),t},c=t=>{const e=e;function i(t){e&&e.classList.contains("__is_full__")&&t.preventDefault()}return t.addEventListener("touchmove",i,{passive:!1}),()=>{t.removeEventListener("touchmove",i)}},u="\n position: fixed;\n z-index: 999;\n left: 0;\n height: 100%;\n width: 100%;\n top: 0;\n display: flex;\n align-items: center;\n justify-content: center;\n background: #000;\n ",l=t=>`\n position: fixed;\n z-index: 999;\n left: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ${t.offsetWidth}px;\n width: ${t.offsetHeight}px;\n top: 0px;\n transform: rotate(90deg);\n transform-origin: 0 0;\n margin-left: ${t.offsetWidth}px;\n background: #000;\n `,d=()=>(window.orientation,window.orientation),f=()=>{const t=d();return`\n position: fixed;\n z-index: 999;\n left: 0px;\n display: flex;\n align-items: center;\n justify-content: center;\n height: ${window.innerWidth}px;\n width: ${window.innerHeight}px;\n top: 0px;\n transform: rotate(${90==t?-90:90}deg);\n transform-origin: ${90==t?"right":0} 0;\n margin-left: ${90==t?-window.innerHeight:window.innerWidth}px;\n background: #000;\n `},p=t=>t.requestFullscreen?(t.requestFullscreen(),!0):t.msRequestFullscreen?(t.msRequestFullscreen(),!0):t.mozRequestFullScreen?(t.mozRequestFullScreen(),!0):!!t.webkitRequestFullScreen&&(t.webkitRequestFullScreen(),!0),g=()=>{document.exitFullscreen?document.exitFullscreen():document.msExitFullscreen?document.msExitFullscreen():document.mozCancelFullScreen?document.mozCancelFullScreen():document.webkitCancelFullScreen&&document.webkitCancelFullScreen()},m=document.body;class v{constructor(t){if(this.$el=a(t.el),!(this.$el instanceof HTMLElement))throw"el must be Element or Selector!";if(t.toggle&&(this.$toggle=a(t.toggle),!(this.$toggle instanceof HTMLElement)))throw"toggle must be Element or Selector!";this.cssText=this.$el.style.cssText,this.config=t,this.is_full=!1,this.__style__=h(),this.isNative=t.nativeFirst&&document.fullscreenEnabled,this.disableScroll&&(this.__un_bind_touchmove__=c(this.$el)),this.__need3__()&&this.__setCss__(3);let e=()=>{m&&!m.classList.contains("__is_full__")?this.requestFullscreen():this.exitFullScreen()};this.toggle=e.bind(this),this.$toggle instanceof HTMLElement&&this.$toggle.addEventListener("click",e,!1);var i=window.matchMedia("(orientation: landscape)");let r=e=>{if(e.matches){if(this.isLock)return void("landscape"===this.lockOr?this.__setCss__(3):this.__setCss__(4));this.is_full?this.isNative?this.__setCss__(1):this.__setCss__(3):t.autoRotate&&s()&&this.__setCss__(3)}else{if(this.isLock)return void("landscape"===this.lockOr?this.__setCss__(4):this.__setCss__(3));this.is_full?t.forceRotate&&(this.isNative?this.__setCss__(1):this.__setCss__(2)):t.autoRotate&&s()&&this.__setCss__(1)}};i.addEventListener("change",r);let n=()=>{document.fullscreenElement?(m&&m.classList.add("__is_full__"),this.is_full=!0):(m&&m.classList.remove("__is_full__"),this.is_full=!1)};this.$el.addEventListener("fullscreenchange",n),this.__destroy__=()=>{i.removeEventListener("change",r),this.$toggle&&this.$toggle.removeEventListener("click",e),this.$el.removeEventListener("fullscreenchange",n),this.toggle=null,this.$toggle=null,this.$el=null,this.__destroy__=null,this.__style__.parentNode.removeChild(this.__style__),this.__style__=null,e=null,r=null,n=null}}canLock(){return s()}lock(t){s()&&(this.isLock||(t||(t=window.innerWidth>window.innerHeight?"landscape":"portrait"),this.isLock=!0,this.lockOr=t,this.config.nativeFirst&&screen.orientation&&document.fullscreenEnabled?(document.fullscreenElement||(this.__lock_need_exit=!0,this.requestFullscreen()),screen.orientation.lock(t+"-primary")):"portrait"===t&&this.__setCss__(3)))}unlock(){s()&&this.isLock&&(this.isLock=!1,this.config.nativeFirst&&screen.orientation&&document.fullscreenElement?(this.__lock_need_exit&&(this.exitFullScreen(),this.__lock_need_exit=!1),screen.orientation.unlock()):(this.is_full=!1,m&&m.classList.remove("__is_full__"),this.__need3__()?this.__setCss__(3):this.__setCss__(1)))}requestFullscreen(){if(m&&m.classList.add("__is_full__"),this.is_full=!0,this.isNative)p(this.$el),this.config.forceRotate&&s()&&screen.orientation&&screen.orientation.lock("landscape-primary");else{if(this.__full__)return;this.$el.style.cssText=this.config.forceRotate&&window.innerHeight>window.innerWidth?l(m):u,this.onUpdate&&this.onUpdate()}}exitFullScreen(){m&&m.classList.remove("__is_full__"),this.is_full=!1,this.isLock=!1,this.isNative?(g(),this.__need3__()&&this.__setCss__(3)):this.__need3__()?this.__setCss__(3):this.__setCss__(1)}__need3__(){return this.config.autoRotate&&s()&&window.innerHeight{const i="video/"+t;e.forEach(t=>{const e=[`${i};codecs=${t}`,`${i};codecs:${t}`,""+i];e.forEach(t=>{MediaRecorder.isTypeSupported(t)&&T.push(t)})})}),T}const w="video/mp4",E=6e5,x=10;function A(t){return new Promise((e,i)=>{const r=new FileReader;r.readAsArrayBuffer(t),r.onloadend=()=>{e(r.result)},r.onerror=()=>{i(r.error)}})}function C(){return!!navigator.userAgent.match(/\(i[^;]+;( U;)? CPU.+Mac OS X/)}const R=!C();class P{constructor(t,e,i){let r=S();this.videoMineTypeIndex=0;let n=R?r[this.videoMineTypeIndex]:w;this.client=i,this.recordChunks=new Blob([],{type:n}),this.lastRecordSize=null,this.tolerance=x,this.listener=null,this.recordStartTime=0,this.stopTime=0,this.tasks=Promise.resolve(),R&&(this.decoder=new b["Decoder"],this.reader=new b["Reader"]),this.combinedStream=new MediaStream([...t.getTracks(),...e.getTracks()]),this.initRecordParams(n),window.addEventListener("beforeunload",t=>{this.recorder&&"inactive"!==this.recorder.state&&(this.stopAndblobDownload(),t.preventDefault(),t.returnValue="")}),window.document.addEventListener("visibilitychange",()=>{"hidden"===document.visibilityState&&this.stopAndblobDownload()})}initRecordParams(t){this.recorder=new MediaRecorder(this.combinedStream,{mimeType:t}),this.recorder.ondataavailable=e=>{const i=e.data;if(this.recordChunks=new Blob([this.recordChunks,i],{type:t}),R){const t=async()=>{const t=await A(i),e=this.decoder.decode(t);e.forEach(t=>{this.reader.read(t)})};this.tasks=this.tasks.then(()=>t())}Date.now()-this.recordStartTime-this.stopTime>E&&this.stopAndblobDownload()}}startRecord(t=10){if("recording"!==this.recorder.state){try{this.recorder.start(t)}catch(e){if(console.log("start record error",e),R){let e=S();if(++this.videoMineTypeIndex,this.videoMineTypeIndexthis.listenRecord(),500)}}async stopRecord(){await this.tasks,this.recorder.stop(),R&&this.reader.stop(),clearInterval(this.timer),this.tolerance=x}resumeRecord(){this.recorder&&"paused"===this.recorder.state&&(this.recorder.resume(),clearInterval(this.stopTimer))}pauseRecord(){this.recorder&&"paused"!==this.recorder.state&&(this.recorder.pause(),this.stopTimer=setInterval(()=>{this.stopTime+=500},500))}getState(){return this.recorder.state}listenRecord(){this.recorder&&"inactive"!==this.recorder.state&&(this.recordChunks.size===this.lastRecordSize?0===this.tolerance?this.stopAndblobDownload():this.tolerance--:this.tolerance=x,this.lastRecordSize=this.recordChunks.size)}getRecordInfo(){return this.recorder&&"inactive"!==this.recorder.state?{size:Math.floor(this.recordChunks.size/1e3),time:Date.now()-this.recordStartTime-this.stopTime}:{size:0,time:0}}async stopAndblobDownload(t="record",e=!0){if(!this.recorder||"inactive"===this.recorder.state)return;if(R&&!this.reader.metadatas)return;await this.stopRecord();const{recordChunks:i}=this,r=Date.now();if(R){const{reader:n}=this,s=b["tools"].makeMetadataSeekable(n.metadatas,Date.now()-this.recordStartTime-this.stopTime,n.cues),a=await A(i),o=a.slice(n.metadataSize),h=new Blob([s,o],{type:i.type});return e&&_(h,`${t}_${r}.webm`),this.client.eventSource.dispatchEvent("videoRecordFinished",h),this.recordChunks=new Blob([]),h}const n=new Blob([i],{type:i.type});return e&&_(n,`${t}_${r}.mp4`),this.client.eventSource.dispatchEvent("videoRecordFinished",n),this.recordChunks=new Blob([]),n}}i("f665");var I=i("95c0"),k=i.n(I);const D="line",O="rect",M="polygon",N="text",B="motion",L="cover",U="lineCrossing",z="invasion",F="dot",W="netRect",H=5,j=5;i("d9e2"),i("910d");const V=/([:\-_]+(.))/g,q=/^moz([A-Z])/,G=Number(document.documentMode),Y=function(t){return t.replace(V,(function(t,e,i,r){return r?i.toUpperCase():i})).replace(q,"Moz$1")};(function(){document.addEventListener})(),function(){document.removeEventListener}();function $(t,e,i){if(t&&e)if(t.length)for(let n of t)$(n,e,i);else if("object"===typeof e)for(var r in e)e.hasOwnProperty(r)&&$(t,r,e[r]);else e=Y(e),"opacity"===e&&G<9?t.style.filter=isNaN(i)?"":"alpha(opacity="+100*i+")":t.style[e]=i}const X=()=>{const t=()=>(65536*(1+Math.random())|0).toString(16).substring(1);return t()+t()+"-"+t()+"-"+t()+"-"+t()+"-"+t()+t()+t()};i("1e70"),i("79a4"),i("c1a1"),i("8b00"),i("a4e7"),i("1e5a"),i("72c3");const Q=Symbol("event_listener"),K=Symbol("event_listeners");class Z{constructor(t){this[Q]=t,this[K]=new Map}clear(){if(this[K])for(let t of this[K])for(let e of t[1])this[Q].removeEventListener(t[0],e);this[K].clear()}destroy(){this.clear(),this[K]=null}on(t,e,i){return void 0==i&&(i=e,e=null),e?this.addEventListener(t,t=>{t.target.matches(e)&&i(t)}):this.addEventListener(t,i)}addEventListener(t,e){return this[K].has(t)||this[K].set(t,new Set),this[K].get(t).add(e),this[Q].addEventListener(t,e,!1),e}removeEventListener(t,e){if(this[Q].removeEventListener(t,e,!1),this[K].has(t)){let i=this[K].get(t);i.delete(e),i.size||this[K].delete(t)}}dispatchEvent(t){this[Q]&&this[Q].dispatchEvent(t)}}class J{constructor(t=null){this[Q]=new Z(t||document.createElement("div"))}clear(){this[Q]&&this[Q].clear()}destroy(){this[Q]&&(this[Q].destroy(),this[Q]=null)}on(t,e,i){return this[Q]?this[Q].on(t,e,i):null}addEventListener(t,e){return this[Q]?this[Q].addEventListener(t,e,!1):null}removeEventListener(t,e){this[Q]&&this[Q].removeEventListener(t,e,!1)}dispatchEvent(t,e){this[Q]&&this[Q].dispatchEvent(new CustomEvent(t,{detail:e}))}}class tt{constructor(t){this.eventSource=t,this[K]=new Map}on(t,e,i){this[K].has(t)||this[K].set(t,new Set);let r=this.eventSource.on(t,e,i);r&&this[K].get(t).add(r)}off(t,e){this.eventSource.removeEventListener(t,e)}clear(){this.eventSource.clear(),this[K].clear()}destroy(){this.eventSource.clear(),this[K]=null,this.eventSource=null}}function et(t,e,i,r){return ti-H&&(t=i-H),er-j&&(e=r-j),{x:t,y:e}}function it(t,e,i,r,n,s){return tn-H&&(i-=t-n+H,t=n-H),i>n-H&&(t-=i-n+H,i=n-H),es-j&&(r-=e-s+j,e=s-j),r>s-j&&(e-=r-s+j,r=s-j),{x1:t,y1:e,x2:i,y2:r}}function rt(t,e,i,r,n,s){return tn-H&&(t-=i-n+H),es-j&&(e-=r-s+j),{x:t,y:e}}function nt(t,e,i,r){return!(ti-H||e>r-j)}function st(t,e=!1,i=!1){if(e){for(let e=0;e0||ct(e,s,a)>0&&r<0))return!1;if(!i&&(ct(e,s,a)<0&&r>0||ct(e,s,a)>0&&r<0||pt(e,s,a)))return!1;r=ct(e,s,a)?ct(e,s,a):r}return!0}function at(t){let e=[t[0][0]-t[1][0],t[0][1]-t[1][1]],i=[t[2][0]-t[1][0],t[2][1]-t[1][1]],r=ft(e,i);r<0&&t.reverse();let n,s=k.a.util.clone(t),a=0,o=0;if(t.length<4)return t;t.forEach((t,e)=>{0===a||a[0]>t[0]?(0!==a&&(o=a),a=[...t,e]):(0===o||o[0]>t[0])&&(o=[...t,e])}),a[1]>o[1]&&(a=o),n=a;for(let h=0;h=n||r>=s)}function ct(t,e,i){let r=[t[0]-i[0],t[1]-i[1]],n=[t[0]-e[0],t[1]-e[1]];return ft(r,n)}function ut(t,e,i){let r=[t[0]-e[0],t[1]-e[1]],n=[i[0]-e[0],i[1]-e[1]],s=ft(r,n);return Math.abs(s/k.a.vector.len(n))}function lt(t,e,i){let r=[t[0]-e[0],t[1]-e[1]],n=[i[0]-e[0],i[1]-e[1]],s=[i[0]-t[0],i[1]-t[1]];return e===i?k.a.vector.len(r):k.a.vector.dot(r,n)<0||k.a.vector.dot(n,s)<0?-1:ut(t,e,i)}function dt(t,e,i){let r=[t[0]-e[0],t[1]-e[1]],n=[i[0]-e[0],i[1]-e[1]],s=[i[0]-t[0],i[1]-t[1]];if(e===i)return e;if(k.a.vector.dot(r,n)<0)return-1;if(k.a.vector.dot(n,s)<0)return-1;let a=k.a.vector.dot(r,n)/k.a.vector.lenSquare(n);return[e[0]+a*n[0],e[1]+a*n[1]]}function ft(t,e){return t[0]*e[1]-t[1]*e[0]}let pt=(t,e,i)=>{let r=(i[1]-t[1])*(e[0]-t[0]),n=(e[1]-t[1])*(i[0]-t[0]);return Math.abs(n-r)<.01};var gt=function(t,e,i,r){let n=[t[0]-i[0],t[1]-i[1]],s=[e[0]-i[0],e[1]-i[1]],a=[i[0]-r[0],i[1]-r[1]],o=ft(n,a)*ft(s,a);return n=[i[0]-t[0],i[1]-t[1]],s=[r[0]-t[0],r[1]-t[1]],a=[e[0]-t[0],e[1]-t[1]],o<=0&&ft(n,a)*ft(s,a)<=0};let mt=t=>{let e,i;if(t.length<4)return!0;let r=t[t.length-1],n=t[t.length-2];if(r[0]===n[0]&&r[1]===n[1])return!0;for(e=0;e{t.destroy()}),this.graphList=[],this.zr.refresh()}removeCurrentNode(){let t=this.graphList.findIndex(t=>t.id===this.zr.selectNode.id);this.graphList.splice(t,1),this.typeGroup.remove(this.zr.selectNode.graphGroup),this.zr.selectNode.destroy(),this.zr.selectNode=null,this.zr.status="idle"}changeDrawStatus(t){this.drawStatus=t,this.typeGroup&&(this.typeGroup.silent=!t)}isGraphLimit(){let t={code:2001,message:"图形数量超出限制"};return(-1!==this.zr.graphLimit&&this.zr.graphLimit<=this.zr.graphNum||this.typeGroup.children().length>=this.graphLimit)&&(this.eventSource.dispatchEvent("error",t),!0)}getEnableGraphCount(){return-1!==this.zr.graphLimit?Math.min(this.graphLimit-this.graphList.length,this.zr.graphLimit-this.zr.graphNum):this.graphLimit-this.graphList.length}getGraphCount(){return this.graphList.length}scaleGraphs(){this.graphList.forEach(t=>{t.scaleGraph()})}changeStatus(t){"idle"===t&&(this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=null),this.zr.status=t}_updateCursor(){"focus"===this.zr.status&&this.zr.selectNode&&"focus"!==this.zr.selectNode.status&&"create"!==this.zr.selectNode.status&&(this.zr.dom.lastChild.style.cursor=this.zr.selectNode.cursor),"draw"===this.zr.status&&(this.zr.dom.lastChild.style.cursor="crosshair")}_getIndexAndId(t,e){if(this.style.isFixedId)return{index:this.graphList.length,id:this.graphList.length+1};if(-1===e){this.graphList.length||(e=1,t=0);for(let i=0;i{t.updateText(e)})}changeGraphLimit(t){this.graphLimit=t}setStyle(t){let e=(t,i)=>{Object.keys(t).forEach(r=>{"object"===typeof t[r]?(i.hasOwnProperty(r)||(i[r]={}),e(t[r],i[r])):i[r]=t[r]})};e(t,this.style)}}class yt{constructor(t){this.zr=t.zr,this.group=t.group,this.eventSource=t.eventSource,this.id=null,this.graph=null,this.graphInfo=null,this.endpointGroup=new k.a.Group,this.graphGroup=new k.a.Group,this.status="create"}_mousedown(){this.graph.on("mousedown",t=>{let e=!!t.target;this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e}),"idle"===this.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"))})}_mouseover(){this.graph.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.graph.on("mouseup",t=>{"create"===this.status&&this.changeStatus("idle")})}_mouseout(){this.graph.on("mouseout",t=>{"idle"===this.status&&this.changeStyle("idle")})}_checkTextPosition(t,e,i,r,n){for(let s=0;s{e instanceof k.a.Group?e.children().forEach(e=>{e.attr({z:t})}):e.attr({z:t})})}updateText(t){this.style.text&&(this.style.text.text=this.style.text.text.replace(this.id,t+1)),this.id=t+1,this.text.attr({style:{text:this.style.text.text}})}destroy(){if(this.zr.graphNum-=1,this.text){let t=this.zr.textList.findIndex(t=>t.id===this.text.id);this.zr.textList.splice(t,1)}}}const bt={default:{style:{fill:"rgba(23,133,230,0.4)",stroke:"#1785e6",lineWidth:2,textFill:"#9dd0fd"},cursor:"move"},mouseover:{style:{stroke:"#FFF",textFill:"#FFF"}},mousedown:{style:{stroke:"#FFF",textFill:"#FFF"}},endpoint:{style:{fill:"rgba(23,133,230,1)"},shape:{width:6,height:6}},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:"区域"},cursor:{left:"w-resize",right:"e-resize",top:"n-resize",bottom:"s-resize",topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize"},fixedRatio:!1,defaultRatio:0,allowNegativeWidth:!1},_t={default:{style:{fill:"rgba(23,133,230,0.4)",stroke:"rgb(23,133,230)",lineWidth:2},cursor:"move"},mouseover:{style:{stroke:"#FFF"}},mousedown:{style:{stroke:"#FFF"}},endpoint:{style:{fill:"rgba(23,133,230,1)",opacity:0},shape:{width:6,height:6}},cursor:{left:"w-resize",right:"e-resize",top:"n-resize",bottom:"s-resize",topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize"}},Tt={default:{style:{fill:"#000",stroke:"rgb(23,133,230)",lineWidth:2},cursor:"move"},mouseover:{style:{stroke:"#FFF"},cursor:"move"},mousedown:{style:{stroke:"#FFF"},cursor:"move"},endpoint:{style:{fill:"#000",opacity:0},shape:{width:6,height:6}},cursor:{left:"w-resize",right:"e-resize",top:"n-resize",bottom:"s-resize",topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize"}},St=8;class wt extends vt{constructor(t){super(t),this.type=t.canvasType,this.style=t.style||k.a.util.clone(bt),this._initRectCanvas()}_initRectCanvas(){this.typeGroup=new k.a.Group,this.typeGroup.type=this.type,this.group.add(this.typeGroup),"motion"===this.type&&(this.style=_t),"cover"===this.type&&(this.style=Tt),this._initStyle()}_initStyle(){this.style.default||(this.style.default=bt.default),this.style.mousedown||(this.style.mousedown=this.style.default),this.style.mouseover||(this.style.mouseover=this.style.default),this.style.endpoint||(this.style.endpoint=bt.endpoint)}initCanvasEvent(){this.zr.on("mousemove",this._mousemove,this),this.zr.on("mousedown",this._mousedown,this),this.zr.on("mouseup",this._mouseup,this),this.zr.on("mousemove",this._updateCursor,this)}initGraphEvent(){this.zr.on("mousemove",this._resizeRect,this),this.zr.on("mouseup",this._resizeRectEnd,this)}offCanvasEvent(){this.zr.off("mousedown",this._mousedown),this.zr.off("mousemove",this._mousemove),this.zr.off("mouseup",this._mouseup),this.zr.off("mousemove",this._updateCursor)}_mousemove(t){if("create"===this.zr.status){let e=t.offsetX-this.newGraphStartPoint[0],i=t.offsetY-this.newGraphStartPoint[1];this.zr.selectNode=this.drawRect("create",this.newGraphStartPoint[0],this.newGraphStartPoint[1],e,i),this.zr.status="draw"}if("draw"===this.zr.status&&nt(t.offsetX,t.offsetY,this.zr.getWidth(),this.zr.getHeight())){let e=t.offsetX-this.zr.selectNode.graph.position[0],i=t.offsetY-this.zr.selectNode.graph.position[1];if(this.style.fixedRatio&&this.style.defaultRatio){let t=this.zr.getHeight()-2*j,r=this.zr.getWidth()-2*H,n=r/t,s=this.zr.selectNode.graph.position[0],a=this.zr.selectNode.graph.position[1];if(i=e/(this.style.defaultRatio*n),!nt(s,a,r,t)||!nt(s+e,a+i,r,t))return}this.drawRect("reshape",this.zr.selectNode.graph.position[0],this.zr.selectNode.graph.position[1],e,i)}}_resizeRect(t){if("focus"===this.zr.status&&"resize"===this.zr.selectNode.status){if(this.zr.selectNode.pos.length<=1&&this.style.fixedRatio)return;this.zr.selectNode.pos.forEach(e=>{this.zr.selectNode.resize(t.offsetX,t.offsetY,e)}),this.zr.selectNode.style.text&&this.zr.selectNode.reshapeText()}}_resizeRectEnd(){"focus"===this.zr.status&&"resize"===this.zr.selectNode.status&&(this.zr.selectNode.changeStatus("focus"),this.zr.selectNode.cursor=this.zr.selectNode.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.zr.selectNode.getRectInfo()))}_mousedown(t){if(1===t.which){if("idle"===this.zr.status&&!t.target&&nt(t.offsetX,t.offsetY,this.zr.getWidth(),this.zr.getHeight())){if(this.isGraphLimit()||!this.drawStatus)return;this.zr.status="create",this.newGraphStartPoint=[t.offsetX,t.offsetY]}"focus"===this.zr.status&&(t.target||(this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=null,this.zr.status="idle"))}}_mouseup(t){if(1===t.which)if("create"===this.zr.status||"draw"===this.zr.status)if(""!==this.zr.dom.lastChild.style.cursor&&(this.zr.dom.lastChild.style.cursor=""),"draw"===this.zr.status)this.eventSource.dispatchEvent("add",this.zr.selectNode.getRectInfo()),this.zr.status="idle";else{this.zr.selectNode=null,this.zr.status="idle";let e=!!t.target;this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e})}else{let e=!!t.target;this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e})}}drawRect(t,e,i,r,n,s=-1){let a=-1;({index:a,id:s}=this._getIndexAndId(a,s));const o={zr:this.zr,group:this.typeGroup,shape:{x:e,y:i,width:r,height:n},ratio:n/r,style:this.style,type:this.typeGroup.type,id:s,eventSource:this.eventSource};if("create"===t){if(this.isGraphLimit())return null;let t=new Et(o);return-1!==a?this.graphList.splice(a,0,t):this.graphList.push(t),t}"reshape"===t&&(this.zr.selectNode.reshape(e,i,r,n),this.zr.selectNode.reshapeEndpoint(e,i,r,n))}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getRectInfo())}),t}getGraphInfo(t){return this.graphList[t].getRectInfo()}getCurrentNode(){let t=this.zr.selectNode;return t.getRectInfo()}}class Et extends yt{constructor(t){super(t),this.zr=t.zr,this.group=t.group,this.type=t.type,this.style=k.a.util.clone(t.style||bt),this.ratio=t.ratio,this.canvasRatio=(this.zr.getHeight()-2*j)/(this.zr.getWidth()-2*j),this.fixedRatio=this.style.fixedRatio,this.cursor=this.style.default.cursor||"pointer",this.graph=null,this.graphGroup=new k.a.Group,this.endpointGroup=new k.a.Group,this.id=t.id,this.position=[0,0],this.status="create",this.pos=[],this._initRect(t)}_initRect(t){this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1;let e=t.shape.x,i=t.shape.y,r=t.shape.width,n=t.shape.height;if(this.graph=new k.a.Rect({shape:{width:r,height:n},style:this.style.default.style,position:[e,i],draggable:!1}),this._getNormalizedCoor(),this._initEndpoint(),this._onDrag(),this._mousemove(),this._mousedown(),this._mouseover(),this._mouseout(),this._mouseup(),this.graphGroup.add(this.graph),this.group.add(this.graphGroup),this.style.text&&this._initText(),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initText(){this.text=new k.a.Text({position:[this.graph.position[0]+this.style.text.textPosition[0],this.graph.position[1]+this.style.text.textPosition[1]],style:{fontSize:this.style.text.fontSize,fontFamily:this.style.text.fontFamily,text:this.style.text.text,textFill:this.style.default.style.textFill||"fff"}}),this.text.silent=!0,this.reshapeText(),this.graphGroup.add(this.text),this.zr.textList.push(this.text)}_initEndpoint(){let t,e;for(let i=0;i<4;i++){0===i&&(t=this.graph.position[0],e=this.graph.position[1]),1===i&&(t=this.graph.position[0]+this.graph.shape.width-this.style.endpoint.shape.width,e=this.graph.position[1]),2===i&&(t=this.graph.position[0],e=this.graph.position[1]+this.graph.shape.height-this.style.endpoint.shape.height),3===i&&(t=this.graph.position[0]+this.graph.shape.width-this.style.endpoint.shape.width,e=this.graph.position[1]+this.graph.shape.height-this.style.endpoint.shape.height);let r=new k.a.Rect({shape:this.style.endpoint.shape,style:this.style.endpoint.style,position:[t,e],draggable:!1});this.endpointGroup.add(r)}this.endpointGroup.silent=!0}reshape(t,e,i,r,n=1){this.graph.attr({shape:{width:i,height:r},position:[t,e]}),this._getNormalizedCoor(),this.text&&n&&this.reshapeText()}reshapeEndpoint(){let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.position[0]+this.graph.shape.width-this.style.endpoint.shape.width,r=this.graph.position[1]+this.graph.shape.height-this.style.endpoint.shape.height;this.endpointGroup.children().forEach((n,s)=>{let a,o;0===s&&(a=this.graph.shape.width>0?t:i+this.style.endpoint.shape.width,o=this.graph.shape.height>0?e:r+this.style.endpoint.shape.height),1===s&&(a=this.graph.shape.width>0?i:t-this.style.endpoint.shape.width,o=this.graph.shape.height>0?e:r+this.style.endpoint.shape.height),2===s&&(a=this.graph.shape.width>0?t:i+this.style.endpoint.shape.height,o=this.graph.shape.height>0?r:e-this.style.endpoint.shape.height),3===s&&(a=this.graph.shape.width>0?i:t-this.style.endpoint.shape.height,o=this.graph.shape.height>0?r:e-this.style.endpoint.shape.height),n.attr({position:[a,o]})})}reshapeText(){let t=this.graph.position[0]+this.style.text.textPosition[0],e=this.graph.position[1]+this.style.text.textPosition[1];this.style.allowNegativeWidth&&(this.graph.shape.width<0&&(t=this.graph.position[0]+this.style.text.textPosition[0]+this.graph.shape.width),this.graph.shape.height<0&&(e=this.graph.position[1]+this.style.text.textPosition[1]+this.graph.shape.height));let i=this.text.getBoundingRect();({x:t,y:e}=rt(t,e,t+i.width,e+i.height,this.zr.getWidth(),this.zr.getHeight())),({x:t,y:e}=this._checkTextPosition(t,e,t+i.width,e+i.height,this.text)),this.text.attr("position",[t,e])}resize(t,e,i){let r,n,s,a,o=this.zr.getWidth(),h=this.zr.getHeight();if(r=this.graph.position[0],n=this.graph.position[1],s=this.graph.position[0]+this.graph.shape.width,a=this.graph.position[1]+this.graph.shape.height,"left"===i&&(r=t,nt(r,n,o,h)&&nt(s,a,o,h)&&this.graph.attr({shape:{width:s-r},position:[r,n]})),"right"===i&&(s=t,nt(r,n,o,h)&&nt(s,a,o,h)&&this.graph.attr({shape:{width:s-r}})),"top"===i){if(n=e,this.fixedRatio){let t=this.ratio*this.graph.shape.width;n=a-t}nt(r,n,o,h)&&nt(s,a,o,h)?this.graph.attr({shape:{height:a-n},position:[r,n]}):this.fixedRatio&&this.graph.attr({shape:{width:this.graph.shape.height/this.ratio}})}if("bottom"===i){if(a=e,this.fixedRatio){let t=this.ratio*this.graph.shape.width;a=n+t}nt(r,n,o,h)&&nt(s,a,o,h)?this.graph.attr({shape:{height:a-n}}):this.fixedRatio&&this.graph.attr({shape:{width:this.graph.shape.height/this.ratio}})}this._getNormalizedCoor(),this.reshapeEndpoint()}_onDrag(){this.graph.on("drag",()=>{let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.position[0]+this.graph.shape.width,r=this.graph.position[1]+this.graph.shape.height,n=this.zr.getWidth(),s=this.zr.getHeight();if(!nt(t,e,n,s)||!nt(i,r,n,s)){let{x1:a,y1:o,x2:h,y2:c}=it(t,e,i,r,n,s);this.graph.attr({shape:{width:h-a,height:c-o},position:[a,o]})}if(this.style.allowNegativeWidth){let t=this.graph.shape.width,e=this.graph.shape.height,i=this.graph.position[0],r=this.graph.position[1];this.graphInfo.width<0&&t>0&&(i+=t,t=-t),this.graphInfo.height<0&&e>0&&(r+=e,e=-e),this.graph.attr({shape:{width:t,height:e},position:[i,r]})}this._getNormalizedCoor(),this.text&&this.reshapeText(),this.reshapeEndpoint()}),this.graph.on("dragstart",()=>{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("drag")}),this.graph.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("focus"),this.eventSource.dispatchEvent("drag",this.getRectInfo())})}_mousedown(){this.graph.on("mousedown",t=>{1===t.which&&("focus"===this.status&&(this.judgeMousePosition(t.offsetX,t.offsetY),this.pos.length&&this.changeStatus("resize")),"idle"===this.status&&this.changeStatus("focus"))})}_mousemove(){this.graph.on("mousemove",t=>{"focus"===this.status&&(this.judgeMousePosition(t.offsetX,t.offsetY),this._judegeCursorStyle(),this.zr.dom.lastChild.style.cursor=this.cursor)})}_mouseover(){this.graph.on("mouseover",()=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.graph.on("mouseup",t=>{1===t.which&&("create"===this.status&&this.changeStatus("idle"),"resize"===this.status&&(this.eventSource.dispatchEvent("drag",this.getRectInfo()),this.changeStatus("focus")))})}_mouseout(){this.graph.on("mouseout",()=>{"idle"===this.status&&this.changeStyle("idle")})}_judegeCursorStyle(){if(this.pos.length)if(1===this.pos.length){if(this.fixedRatio)return void(this.cursor=this.style.default.cursor||"pointer");"top"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.top),"bottom"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.bottom),"left"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.left),"right"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.right)}else"left"===this.zr.selectNode.pos[0]&&("top"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.topLeft),"bottom"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.bottomLeft)),"right"===this.zr.selectNode.pos[0]&&("top"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.topRight),"bottom"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.bottomRight));else this.cursor=this.style.default.cursor||"pointer"}_getNormalizedCoor(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j;this.graphInfo={x:Math.round(1e4*(this.graph.position[0]-H)/t),y:Math.round(1e4*(this.graph.position[1]-j)/e),width:Math.round(1e4*this.graph.shape.width/t),height:Math.round(1e4*this.graph.shape.height/e)}}changeStatus(t){if("focus"===this.status&&"idle"===t){this.graphGroup.remove(this.endpointGroup);let t=this.style.default.style.z||0;this._setGraphZIndex(t)}if("focus"===t&&("idle"===this.status&&(this.eventSource.dispatchEvent("select",this.getRectInfo()),this.group.remove(this.graphGroup),this.group.add(this.graphGroup),this.graphGroup.add(this.endpointGroup),this._setGraphZIndex(100)),this.zr.selectNode&&"focus"!==this.status&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus"),"resize"===this.status){let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.shape.width,r=this.graph.shape.height,{x:n,y:s,width:a,height:o}=ot(t,e,i,r);this.graph.attr({shape:{width:a,height:o},position:[n,s],draggable:!0}),this.text&&this.reshapeText(),this.reshapeEndpoint()}if("resize"===t&&this.graph.attr({draggable:!1}),"create"===this.status){let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.shape.width,r=this.graph.shape.height,{x:n,y:s,width:a,height:o}=ot(t,e,i,r);this.graph.attr({shape:{width:a,height:o},position:[n,s]}),this.text&&this.reshapeText(),this.ratio=o/a,this.reshapeEndpoint()}this.status=t,this.changeStyle(t)}changeStyle(t){let e=this.style.default;"focus"!==t&&"resize"!==t&&"drag"!==t||(e=this.style.mousedown||this.style.default),"mouseover"===t&&(e=this.style.mouseover||this.style.default),this.graph.attr({style:e.style,cursor:e.cursor||this.style.default.cursor,draggable:"create"!==this.status&&"resize"!==this.status}),this.text&&this.text.attr({style:{textFill:e.style.textFill||"#FFF"}})}judgeMousePosition(t,e){this.pos=[],Math.abs(t-this.graph.position[0]){t.push(e.getTextInfo())}),t}getCurrentNode(){let t=this.zr.selectNode;if(!t)return 0;let e=t.getTextInfo();return e}}class Rt extends yt{constructor(t){super(t),this.zr=t.zr,this.group=t.group,this.style=k.a.util.clone(Object.assign({},At,t.style)),this.cursor=this.style.default.cursor||"pointer",this.graphGroup=new k.a.Group,this.graph=null,this.text=null,this.rich=null,this.display=!0,this.id=t.id,this.status="create",this._initText(t)}_initText(t){this.zr.graphNum+=1,"string"!==typeof t.text?(this.text=t.text.formatter,this.rich=t.text.rich):this.text=t.text;let e=[...t.position];if(this.graph=new k.a.Text({style:{...this.style.default.style,text:this.text,rich:this.rich},rotation:t.rotation,position:e,draggable:t.draggable}),this._reshapeText(),this._getNormalizedCoor(),this._onDrag(),this._mousedown(),this._mouseover(),this._mouseout(),this.graphGroup.add(this.graph),this.group.add(this.graphGroup),this.zr.textList.push(this.graph),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_onDrag(){this.graph.on("drag",()=>{this._reshapeText(),this._getNormalizedCoor()}),this.graph.on("dragstart",()=>{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("drag")}),this.graph.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.getTextInfo()),this.changeStatus("focus")})}_mousedown(){this.graph.on("mousedown",t=>{"idle"===this.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"))})}_mouseover(){this.graph.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseout(){this.graph.on("mouseout",t=>{"idle"===this.status&&this.changeStyle("idle")})}_getNormalizedCoor(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j;this.graphInfo={x:Math.round(1e4*(this.graph.position[0]-H)/t),y:Math.round(1e4*(this.graph.position[1]-j)/e)}}setText(t){"string"!==typeof t?(this.text=t.formatter,this.rich=t.rich):this.text=t}setStyle(t){Object.keys(t).forEach(e=>{Object.assign(this.style[e],t[e])})}setTextInfo(t,e=!0){let i=this.zr.getWidth()-2*H,r=this.zr.getHeight()-2*j,n=t.x||"0"===t.x||0===t.x?t.x*i/1e4+H:this.graph.position[0],s=t.y||"0"===t.y||0===t.y?t.y*r/1e4+j:this.graph.position[1];this.setText(t.text),this.graph.attr({style:{...this.style.default.style,text:this.text,rich:this.rich},position:[n,s]}),!e&&this.display?this.group.remove(this.graphGroup):e&&!this.display&&this.group.add(this.graphGroup),this._getNormalizedCoor(),this.display=e}_reshapeText(){let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.getBoundingRect();({x:t,y:e}=rt(t,e,t+i.width,e+i.height,this.zr.getWidth(),this.zr.getHeight())),this.graph.attr({position:[t,e]})}changeStatus(t){"idle"===this.status&&"focus"===t&&this.eventSource.dispatchEvent("select",this.getTextInfo()),this.status=t;let e=this.style.default.style.z||0,i="focus"===t?100:e;this._setGraphZIndex(i),this.changeStyle(t)}changeStyle(t){let e=this.style.default.style;"focus"!==t&&"drag"!==t||(e=this.style.mousedown.style||this.style.default.style),"mouseover"===t&&(e=this.style.mouseover.style||this.style.default.style),this.graph.attr({style:{...e}})}getTextInfo(){let t={id:this.id,x:this.graphInfo.x,y:this.graphInfo.y,text:this.text,rich:this.rich};return t}scaleGraph(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j,i=this.graphInfo.x*t/1e4+H,r=this.graphInfo.y*e/1e4+j,n=this.graph.getBoundingRect();({x:i,y:r}=rt(i,r,i+n.width,r+n.height,this.zr.getWidth(),this.zr.getHeight())),this.graph.attr("position",[i,r])}destroy(){this.zr.graphNum-=1;let t=this.zr.textList.findIndex(t=>t.id===this.graph.id);this.zr.textList.splice(t,1)}}var Pt=Ct;let It={default:{style:{stroke:"#000",lineWidth:5,textFill:"#9dd0fd"}},mouseover:{style:{stroke:"#FFF",textFill:"#FFF"}},mousedown:{style:{stroke:"#FFF",textFill:"#FFF"}},endpoint:{type:"circle",style:{fill:"#000"},shape:{r:6},cursor:"ne-resize"},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:"线段"}};class kt extends vt{constructor(t){super(t),this.canvasType="Line",this.style=t.style||k.a.util.clone(It),this._initLineCanvas()}_initLineCanvas(){this.typeGroup=new k.a.Group,this.typeGroup.type="line",this.group.add(this.typeGroup),this._initStyle()}_initStyle(){this.style.default||(this.style.default=It.default),this.style.mousedown||(this.style.mousedown=this.style.default),this.style.mouseover||(this.style.mouseover=this.style.default),this.style.endpoint||(this.style.endpoint=It.endpoint)}initCanvasEvent(){this.zr.on("mousemove",this._mousemove,this),this.zr.on("mousedown",this._mousedown,this),this.zr.on("mouseup",this._mouseup,this),this.zr.on("mousemove",this._updateCursor,this)}offCanvasEvent(){this.zr.off("mousedown",this._mousedown),this.zr.off("mousemove",this._mousemove),this.zr.off("mouseup",this._mouseup),this.zr.off("mousemove",this._updateCursor)}drawLine(t,e,i,r,n,s=-1){let a=-1;({index:a,id:s}=this._getIndexAndId(a,s));const o={zr:this.zr,group:this.typeGroup,shape:{x1:e,y1:i,x2:r,y2:n},id:s,style:this.style,eventSource:this.eventSource};if("create"===t){if(this.isGraphLimit())return null;let t=new Dt(o);return-1!==a?this.graphList.splice(a,0,t):this.graphList.push(t),t}"reshape"===t&&(this.zr.selectNode.reshape(e,i,r,n),this.zr.selectNode.text&&this.zr.selectNode.reshapeText(),this.zr.selectNode.reshapeEndpoint(e,i,r,n))}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getLineInfo())}),t}getCurrentNode(){let t=this.zr.selectNode;if(!t)return 0;let e=t.getLineInfo();return e}}class Dt extends yt{constructor(t){super(t),this.style=k.a.util.clone(t.style||It),this.cursor=this.style.default.cursor||"pointer",this._initLine(t)}_initLine(t){this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1,this.id=t.id;let e=t.shape.x2-t.shape.x1,i=t.shape.y2-t.shape.y1,r=[t.shape.x1,t.shape.y1];if(this.graph=new k.a.Line({shape:{x2:e,y2:i},position:r,style:this.style.default.style,draggable:!0}),this.graph.silent=!0,this._getNormalizedCoor(),this._initEndpoint(r[0],r[1],e+r[0],i+r[1]),this._onDrag(),this._mousedown(),this._mouseover(),this._mouseout(),this._mouseup(),this.graphGroup.add(this.graph),this.group.add(this.graphGroup),this.style.text&&this._initText(),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initText(){this.text=new k.a.Text({position:[this.graph.position[0]+this.style.text.textPosition[0],this.graph.position[1]+this.style.text.textPosition[1]],style:{fontSize:this.style.text.fontSize||It.text.fontSize,fontFamily:this.style.text.fontFamily||It.text.fontFamily,text:this.style.text.text||"线段",textFill:this.style.default.style.textFill||It.default.style.textFill}}),this.text.silent=!0,this.reshapeText(),this.graphGroup.add(this.text),this.zr.textList.push(this.text)}_initEndpoint(t,e,i,r){this.endpointType="rect",this.style.endpoint&&this.style.endpoint.type&&(this.endpointType=this.style.endpoint.type);for(let n=0;n<2;n++){let s,a,o;if("circle"===this.endpointType){let a=0===n?t:i,o=0===n?e:r,h=this.style.endpoint.shape.r;s=new k.a.Circle({shape:{r:h},position:[a,o],style:this.style.endpoint.style,cursor:this.style.endpoint.cursor,draggable:!0})}else{a=this.style.endpoint.shape.width,o=this.style.endpoint.shape.height;let h=0===n?t-a/2:i-a/2,c=0===n?e-o/2:r-o/2;s=new k.a.Rect({shape:{width:a,height:o},position:[h,c],style:this.style.endpoint.style,cursor:this.style.endpoint.cursor,draggable:!0})}s.on("drag",()=>{let t="rect"===this.endpointType?s.position[0]+a/2:s.position[0],e="rect"===this.endpointType?s.position[1]+o/2:s.position[1],i=this.zr.getWidth(),r=this.zr.getHeight(),{x:h,y:c}=et(t,e,i,r);"rect"===this.endpointType?s.attr("position",[h-a/2,c-o/2]):s.attr("position",[h,c]),0===n?(this.reshape(h,c,this.graph.position[0]+this.graph.shape.x2,this.graph.position[1]+this.graph.shape.y2),this.reshapeText()):this.reshape(this.graph.position[0],this.graph.position[1],h,c)}),s.on("dragstart",()=>{this.cursor=this.style.endpoint.cursor||"",this.changeStatus("resizeEndpoint")}),s.on("dragend",()=>{this.cursor=this.style.default.cursor||"",this.eventSource.dispatchEvent("drag",this.getLineInfo()),this.changeStatus("focus")}),this.endpointGroup.add(s)}}reshape(t,e,i,r,n=1){this.graph.attr({shape:{x2:i-t,y2:r-e},position:[t,e]}),this.text&&n&&this.reshapeText(),this._getNormalizedCoor()}reshapeEndpoint(t,e,i,r){"rect"===this.endpointType?(this.endpointGroup.children()[0].attr("position",[t-this.style.endpoint.shape.width/2,e-this.style.endpoint.shape.height/2]),this.endpointGroup.children()[1].attr("position",[i-this.style.endpoint.shape.width/2,r-this.style.endpoint.shape.height/2])):(this.endpointGroup.children()[0].attr("position",[t,e]),this.endpointGroup.children()[1].attr("position",[i,r]))}reshapeText(){let t=this.graph.position[0]+this.style.text.textPosition[0],e=this.graph.position[1]+this.style.text.textPosition[1],i=this.text.getBoundingRect();({x:t,y:e}=rt(t,e,t+i.width,e+i.height,this.zr.getWidth(),this.zr.getHeight())),({x:t,y:e}=this._checkTextPosition(t,e,t+i.width,e+i.height,this.text)),this.text.attr("position",[t,e])}_onDrag(){this.graph.on("drag",()=>{let t=this.graph.position[0],e=this.graph.position[1],i=this.graph.position[0]+this.graph.shape.x2,r=this.graph.position[1]+this.graph.shape.y2,n=this.zr.getWidth(),s=this.zr.getHeight();if(!nt(t,e,n,s)||!nt(i,r,n,s)){let a=it(t,e,i,r,n,s);return this.reshape(a.x1,a.y1,a.x2,a.y2),void this.reshapeEndpoint(a.x1,a.y1,a.x2,a.y2)}this.text&&this.reshapeText(),this.reshapeEndpoint(t,e,i,r),this._getNormalizedCoor()}),this.graph.on("dragstart",()=>{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("drag")}),this.graph.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.getLineInfo()),this.changeStatus("focus")})}_mousedown(){this.graph.on("mousedown",t=>{"idle"===this.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"))})}_mouseover(){this.graph.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.graph.on("mouseup",t=>{"create"===this.status&&this.changeStatus("idle")})}_mouseout(){this.graph.on("mouseout",t=>{"idle"===this.status&&this.changeStyle("idle")})}_getNormalizedCoor(){let t=[this.graph.position[0]-H,this.graph.position[1]-j],e=[t[0]+this.graph.shape.x2,t[1]+this.graph.shape.y2],i=this.zr.getWidth()-2*H,r=this.zr.getHeight()-2*j;this.graphInfo={x1:Math.round(1e4*t[0]/i),y1:Math.round(1e4*t[1]/r),x2:Math.round(1e4*e[0]/i),y2:Math.round(1e4*e[1]/r)}}changeStatus(t){if("create"===this.status&&"idle"===t&&(this.graph.silent=!1),"idle"===t&&"focus"===this.status){this.graphGroup.remove(this.endpointGroup);let t=this.style.default.style.z||0;this._setGraphZIndex(t)}"focus"===t&&"idle"===this.status&&(this.eventSource.dispatchEvent("select",this.getLineInfo()),this.graphGroup.add(this.endpointGroup),this.group.remove(this.graphGroup),this.group.add(this.graphGroup),this._setGraphZIndex(100)),this.status=t,this.changeStyle(t)}changeStyle(t){let e=this.style.default.style;"focus"!==t&&"drag"!==t&&"resizeEndpoint"!==t||(e=this.style.mousedown.style),"mouseover"===t&&(e=this.style.mouseover.style),this.graph.attr({style:e}),this.text&&this.text.attr({style:{textFill:e.textFill}})}getLineInfo(){let t={id:this.id+"",x1:this.graphInfo.x1,y1:this.graphInfo.y1,x2:this.graphInfo.x2,y2:this.graphInfo.y2};return t}scaleGraph(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j,i=this.graphInfo.x1*t/1e4+H,r=this.graphInfo.x2*t/1e4+H,n=this.graphInfo.y1*e/1e4+j,s=this.graphInfo.y2*e/1e4+j;if(this.reshape(i,n,r,s,0),this.reshapeEndpoint(i,n,r,s),this.text){let t=this.text.position[0]*this.zr.getWidth()/this.zr.currentWidth,e=this.text.position[1]*this.zr.getHeight()/this.zr.currentHeight;this.text.attr("position",[t,e])}}}var Ot=kt;const Mt=250,Nt=3,Bt={default:{style:{fill:"rgba(23,133,230,0.4)",stroke:"rgb(23,133,230)",textFill:"#9dd0fd"},cursor:"move"},mouseover:{style:{stroke:"#FFF",textFill:"#ffffff"}},mousedown:{style:{stroke:"#FFF",textFill:"#ffffff"}},endpoint:{type:"rect",style:{fill:"#FFF",stroke:"rgb(23,133,230)"},cursor:["nw-resize","ne-resize","se-resize","sw-resize"],shape:{width:6,height:6}},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:"区域"},flexibleEndpoint:!1,pointCount:4,minEndPointsNum:Nt,drawMethod:"cloud",allowConcave:!1},Lt={default:{style:{fill:"rgba(23,133,230,0.4)",stroke:"rgb(23,133,230)",textFill:"#9dd0fd"},cursor:"move"},mouseover:{style:{stroke:"#FFF",textFill:"#ffffff"}},mousedown:{style:{stroke:"#FFF",textFill:"#ffffff"}},endpoint:{type:"rect",style:{fill:"rgba(23,133,230,1)"},cursor:["nw-resize","ne-resize","se-resize","sw-resize"],shape:{width:6,height:6}},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:"区域$id"},flexibleEndpoint:!1,pointCount:4},Ut={ipc:"ipc",cloud:"cloud"};class zt extends vt{constructor(t){super(t),this.type=t.canvasType,this.style=t.style||k.a.util.clone(Bt),this.flexibleEndpoint=this.style.flexibleEndpoint,this.timeoutFlag=!1,this.timeoutEvent=null,this._initPolygonCanvas()}_initPolygonCanvas(){this.typeGroup=new k.a.Group,this.typeGroup.type=this.type,this.group.add(this.typeGroup),"invasion"===this.type&&(this.style=Lt,this.flexibleEndpoint=this.style.flexibleEndpoint),this._initStyle()}_initStyle(){this.style.default||(this.style.default=Bt.default),this.style.mousedown||(this.style.mousedown=this.style.default),this.style.mouseover||(this.style.mouseover=this.style.default),this.style.endpoint||(this.style.endpoint=Bt.endpoint)}initCanvasEvent(){this.zr.on("mousemove",this._mousemove,this),this.zr.on("mousedown",this._mousedown,this),this.zr.on("mousemove",this._updateCursor,this)}offCanvasEvent(){this.zr.off("mousedown",this._mousedown),this.zr.off("mousemove",this._mousemove),this.zr.off("mousemove",this._updateCursor)}_mousedown(t){let e=!!t.target;if(this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e}),3===t.which&&this.style.drawMethod===Ut.cloud){if("draw"!==this.zr.status)return;this.removeCurrentNode()}if(3===t.which&&this.style.drawMethod===Ut.ipc){if("draw"!==this.zr.status)return;if(this.zr.selectNode.graph.shape.points.length>=(this.style.minEndPointsNum||Nt)){if(!this.zr.selectNode.checkEndPoints())return;this.eventSource.dispatchEvent("add",this.zr.selectNode.getPolygonInfo()),this.timeoutEvent=null,this.changeStatus("idle")}else this.removeCurrentNode()}if("draw"===this.zr.status&&nt(t.offsetX,t.offsetY,this.zr.getWidth(),this.zr.getHeight())){let e=[t.offsetX,t.offsetY];if(this.flexibleEndpoint&&this.style.drawMethod===Ut.cloud)if(this.timeoutEvent){if(this.zr.selectNode.graph.shape.points.length>=(this.style.minEndPointsNum||Nt)){if(clearTimeout(this.timeoutEvent),!this.zr.selectNode.checkEndPoints()&&this.style.drawMethod===Ut.ipc)return;this.eventSource.dispatchEvent("add",this.zr.selectNode.getPolygonInfo()),this.timeoutEvent=null,this.changeStatus("idle")}}else this.timeoutEvent=setTimeout(()=>{if(this.timeoutEvent=null,this.zr.selectNode.graph.shape.points.length===this.style.pointCount){if(!this.zr.selectNode.checkEndPoints()&&this.style.drawMethod===Ut.ipc)return;return this.eventSource.dispatchEvent("add",this.zr.selectNode.getPolygonInfo()),void this.changeStatus("idle")}this.drawPolygon("reshapeNewPoint",e)},Mt);else{if(!this.zr.selectNode.checkEndPoints())return;if(this.zr.selectNode.graph.shape.points.length===this.style.pointCount)return this.eventSource.dispatchEvent("add",this.zr.selectNode.getPolygonInfo()),void this.changeStatus("idle");this.drawPolygon("reshapeNewPoint",e)}}else{if("idle"===this.zr.status&&!t.target&&nt(t.offsetX,t.offsetY,this.zr.getWidth(),this.zr.getHeight())){if(this.isGraphLimit()||!this.drawStatus)return;this.zr.status="create",this.newGraphStartPoint=[t.offsetX,t.offsetY]}"focus"===this.zr.status&&(t.target||this.changeStatus("idle"))}}_mousemove(t){"create"===this.zr.status&&(this.zr.selectNode=this.drawPolygon("create",[[...this.newGraphStartPoint],[t.offsetX,t.offsetY]]),this.zr.status="draw"),"draw"===this.zr.status&&!this.timeoutEvent&&nt(t.offsetX,t.offsetY,this.zr.getWidth(),this.zr.getHeight())&&this.drawPolygon("reshapeCurrentPoint",[t.offsetX,t.offsetY])}drawPolygon(t,e,i=-1,r=-1){({index:i,id:r}=this._getIndexAndId(i,r));const n={zr:this.zr,group:this.typeGroup,shape:{points:e},type:this.type,id:r,pointCount:this.style.pointCount,flexibleEndpoint:this.flexibleEndpoint,style:this.style,eventSource:this.eventSource};if("create"===t){if(this.isGraphLimit())return null;let t=new Ft(n);return-1!==i?this.graphList.splice(i,0,t):this.graphList.push(t),t}"reshapeCurrentPoint"!==t&&"reshapeNewPoint"!==t||this.zr.selectNode.reshape(t,e)}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getPolygonInfo())}),t}getGraphInfo(t,e){let i=null,r=null;return"undefined"!==typeof e?r=this.graphList.find(t=>t.id===e):"undefined"!==typeof t&&t=0&&(r=this.graphList[t]),r?(i=r.getPolygonInfo(),i):null}getCurrentNode(){let t=this.zr.selectNode;if(!t)return 0;let e=t.getPolygonInfo();return e}}class Ft extends yt{constructor(t){super(t),this.zr=t.zr,this.group=t.group,this.style=k.a.util.clone(Object.assign({},Bt,t.style)),this.cursor=this.style.default.cursor||"",this.graph=null,this.id=t.id,this.type=t.type,this.graphGroup=new k.a.Group,this.endpointGroup=new k.a.Group,this.pointCount=t.pointCount,this.flexibleEndpoint=t.flexibleEndpoint,this.pointPosition=[],this.endpointPosition=[],this.status="create",this.style.endpoint&&this.style.endpoint.type&&(this.endpointType=this.style.endpoint.type),this._initPolygon(t)}_initPolygon(t){this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1;let e=t.shape.points,i=[...e[0]];if(e.forEach(t=>{t[0]-=i[0],t[1]-=i[1]}),this.graph=new k.a.Polygon({shape:{points:e},style:{...this.style.default.style},position:i,draggable:!1}),this.graph.attr({style:{fill:"rgba(0, 0, 0, 0)"}}),this._getNormalizedCoor(),this.pointPosition=k.a.util.clone(this.graph.shape.points),this._initEndpoints(),this._onDrag(),this._mousedown(),this._mousemove(),this._mouseover(),this._mouseout(),this.graphGroup.add(this.graph),this.graphGroup.add(this.endpointGroup),this.group.add(this.graphGroup),this.style.text&&this._initText(),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initText(){this.style.text&&this.style.text.text&&(this.text=new k.a.Text({position:[this.graph.shape.points[0][0]+this.graph.position[0]+this.style.text.textPosition[0],this.graph.position[1]+this.graph.shape.points[0][1]+this.style.text.textPosition[1]],style:{fontSize:this.style.text.fontSize||Bt.text.fontSize,fontFamily:this.style.text.fontFamily||Bt.text.fontFamily,text:this.style.text.text||Bt.text.text,textFill:this.style.default.style.textFill||"#FFF"}}),this.text.silent=!0,this.reshapeText(),this.graphGroup.add(this.text),this.zr.textList.push(this.text))}_initEndpoints(){this.graph.shape.points.forEach((t,e)=>{let i,r;"rect"===this.endpointType?(i=this.graph.position[0]+t[0]-this.style.endpoint.shape.width/2,r=this.graph.position[1]+t[1]-this.style.endpoint.shape.height/2,this.endpointGroup.add(new k.a.Rect({shape:{width:this.style.endpoint.shape.width,height:this.style.endpoint.shape.height},position:[i,r],style:{...this.style.endpoint.style,z:this.style.default.style.z||0},cursor:this.style.endpoint.cursor[e]||"ne-resize",draggable:!0}))):(i=this.graph.position[0]+t[0],r=this.graph.position[1]+t[1],this.endpointGroup.add(new k.a.Circle({shape:{r:this.style.endpoint.shape.r},position:[i,r],style:{...this.style.endpoint.style,z:this.style.default.style.z||0},cursor:this.style.endpoint.cursor[e]||"ne-resize",draggable:!0})))});let t=this.endpointGroup.children();if("create"!==this.status)for(let e=0;e{this.status="resizeEndpoint",this.cursor=this.style.endpoint.cursor[e]||"ne-resize"}),t[e].on("dragend",()=>{let t=this.graph.shape.points.slice();t=at(t),this.graph.attr({shape:{points:t}}),this.reshapeEndpoint(),this.reshapeText(),this.status="focus",this.cursor=this.style.default.cursor||"",this.eventSource.dispatchEvent("drag",this.getPolygonInfo())}),t[e].on("drag",()=>{let i,r,n=this.style.endpoint.shape.width,s=this.style.endpoint.shape.height;"rect"===this.endpointType?(i=t[e].position[0]+n/2,r=t[e].position[1]+s/2):(i=t[e].position[0],r=t[e].position[1]);let a=this.zr.getWidth(),o=this.zr.getHeight(),{x:h,y:c}=et(i,r,a,o),u=[h-this.graph.position[0],c-this.graph.position[1]];t[e].attr("position",[h-n/2,c-s/2]);let l=this.graph.shape.points.slice();l[e]=[...u],st(l,this.style.allowConcave)||(l=this.pointPosition),this.graph.attr({shape:{points:k.a.util.clone(l)}}),this.pointPosition=k.a.util.clone(this.graph.shape.points),this._getNormalizedCoor(),this.reshapeEndpoint(),this.reshapeText()})}_onDrag(){this.graph.on("drag",()=>{let t=this.graph.getBoundingRect();t.x+=.5*this.graph.style.lineWidth||.5,t.y+=.5*this.graph.style.lineWidth||.5,t.width-=this.graph.style.lineWidth||1,t.height-=this.graph.style.lineWidth||1;let e=t.x+this.graph.position[0],i=t.y+this.graph.position[1],r=t.x+this.graph.position[0]+t.width,n=t.y+this.graph.position[1]+t.height;({x1:e,y1:i}=it(e,i,r,n,this.zr.getWidth(),this.zr.getHeight())),this.graph.attr({position:[e-t.x,i-t.y]}),this.reshapeEndpoint(),this.reshapeText(),this._getNormalizedCoor()}),this.graph.on("dragstart",()=>{this.cursor=this.style.default.cursor||"",this.changeStatus("drag")}),this.graph.on("dragend",()=>{this.cursor=this.style.default.cursor||"",this.changeStatus("focus"),this.eventSource.dispatchEvent("drag",this.getPolygonInfo())})}_mousedown(){this.graph.on("mousedown",t=>{if("idle"===this.status&&"draw"!==this.zr.status&&"create"!==this.zr.status)return this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",void this.changeStatus("focus");if("focus"===this.status&&this.pointCount!==this.graph.shape.points.length&&this.flexibleEndpoint){let e=[t.offsetX,t.offsetY],i=this._judgeMousePosition(e);if(-1!==i){let t=this.graph.shape.points[i],r=this.graph.shape.points.length-1===i?this.graph.shape.points[0]:this.graph.shape.points[i+1],n=dt(e,t,r);if(-1===n)return;let s=k.a.util.clone(this.graph.shape.points);i===s.length-1?s.push(n):s.splice(i+1,0,n),this.graph.attr({shape:{points:s}}),this.pointPosition=k.a.util.clone(this.graph.shape.points),this._getNormalizedCoor(),this.endpointGroup.removeAll(),this._initEndpoints()}}})}_mousemove(){this.graph.on("mousemove",t=>{if("focus"===this.status&&this.pointCount!==this.graph.shape.points.length&&this.flexibleEndpoint){let e=this._judgeMousePosition([t.offsetX,t.offsetY]);-1!==e&&(this.zr.dom.lastChild.style.cursor="pointer")}})}_mouseover(){this.graph.on("mouseover",()=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseout(){this.graph.on("mouseout",()=>{"idle"===this.status&&this.changeStyle("idle")})}_getNormalizedCoor(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j;this.graphInfo=k.a.util.clone(this.graph.shape.points),this.graphInfo.forEach(i=>{i[0]=Math.round(1e4*(i[0]+this.graph.position[0]-H)/t),i[1]=Math.round(1e4*(i[1]+this.graph.position[1]-j)/e)})}checkEndPoints(){let t=k.a.util.clone(this.graph.shape.points),e=t[t.length-1],i=t[t.length-2];if(t.length>=(this.style.minEndPointsNum||Nt)&&!st(t,this.style.allowConcave)||e[0]===i[0]&&e[1]===i[1]){let t={code:2002,message:"多边形只能为凸多边形,无法创建该端点"};return this.eventSource.dispatchEvent("error",t),!1}return!0}reshape(t,e){e[0]-=this.graph.position[0],e[1]-=this.graph.position[1];let i=[];if("reshapeNewPoint"===t){if(i=k.a.util.clone(this.graph.shape.points),i=i.concat([e]),i.length>=(this.style.minEndPointsNum||Nt)&&!st(i,this.style.allowConcave,!0)){let t={code:2002,message:"多边形只能为凸多边形,无法创建该端点"};this.eventSource.dispatchEvent("error",t),i=this.graph.shape.points}if(i.length>=(this.style.minEndPointsNum||Nt)&&!st(i,this.style.allowConcave,!0)){let t={code:2003,message:"多边形端点数量小于最小限制"};this.eventSource.dispatchEvent("error",t),i=this.graph.shape.points}this.graph.attr({shape:{points:i}}),this._initEndpoints()}"reshapeCurrentPoint"===t&&(i=k.a.util.clone(this.graph.shape.points),i.pop(),i.push(e),i.length>=(this.style.minEndPointsNum||Nt)&&!st(i,this.style.allowConcave)&&this.style.drawMethod===Ut.cloud&&(i=this.graph.shape.points),this.graph.attr({shape:{points:i}}),this.endpointGroup.removeAll(),this._initEndpoints()),this.pointPosition=k.a.util.clone(this.graph.shape.points),this._getNormalizedCoor()}reshapeEndpoint(){let t=this.endpointGroup.children();for(let e=0;e{t[0]=(t[0]-e[0])*i/1e4,t[1]=(t[1]-e[1])*r/1e4}),e[0]=e[0]*i/1e4+H,e[1]=e[1]*r/1e4+j,this.pointPosition=k.a.util.clone(t),this.graph.attr({position:e,shape:{points:t}}),this.reshapeEndpoint(),this.text){let t=this.text.position[0]*this.zr.getWidth()/this.zr.currentWidth,e=this.text.position[1]*this.zr.getHeight()/this.zr.currentHeight;this.text.attr("position",[t,e])}}_judgeMousePosition(t){t[0]-=this.graph.position[0],t[1]-=this.graph.position[1];let e=k.a.util.clone(this.graph.shape.points);for(let i=0;it.id===e):"undefined"!==typeof t&&t=this.graphList.length)return;let i=this.graphList[t];i.changeBorderDetectionDirection(e)}deleteBorderDetection(t){if(-1===t)this.graphList=[],this.typeGroup.removeAll();else if(this.selectNode){let t=this.graphList.find(t=>t.id===this.selectNode.id);this.graphList.splice(t,1),this.typeGroup.remove(this.selectNode.graphGroup)}}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getBorderDetection())}),t}getCurrentNode(){return this.zr.selectNode?this.zr.selectNode.getBorderDetection():0}}class Gt extends yt{constructor(t){super(t),this.zr=t.zr,this.group=t.group,this.style=k.a.util.clone(t.style||Ht),this.cursor=this.style.default.cursor||"pointer",this.dir=t.direction,this.id=t.id,this.line=null,this.arrow=null,this.dirTextA=null,this.dirTextB=null,this.idText=null,this.graphGroup=new k.a.Group,this.endpointGroup=new k.a.Group,this.lineCrossing=new k.a.Group,this.status="create",this._initLineCrossing(t)}_initLineCrossing(t){this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1;let e=0,i=0,r=t.shape.x2-t.shape.x1,n=t.shape.y2-t.shape.y1,s=[t.shape.x1,t.shape.y1];if(this.lineCrossing.attr("position",[...s]),this.line=new k.a.Line({shape:{x2:r,y2:n},style:{...this.style.default.style,lineWidth:4},draggable:!1}),this._getNormalizedCoor(),this._initArrowLine(e,i,r,n),this._initEndpoint(s[0],s[1],r+s[0],n+s[1]),this._initText(e,i,r,n),this._onDrag(),this._mousedown(),this._mouseover(),this._mouseout(),this._mouseup(),this.lineCrossing.add(this.line),this.lineCrossing.add(this.arrow),this.graphGroup.add(this.dirTextA),this.graphGroup.add(this.dirTextB),this.graphGroup.add(this.idText),this.graphGroup.add(this.lineCrossing),this.group.add(this.graphGroup),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initArrowLine(t,e,i,r){let n=k.a.Path.extend({type:"arrow",shape:{x1:0,y1:0,x2:0,y2:0,dir:"both"},buildPath:(t,e)=>{var i=e.x1,r=e.x2,n=e.y1,s=e.y2,a=e.dir,{arrowX:o,arrowY:h,midX:c,midY:u,botX:l,botY:d}=Vt(i,n,r,s);"both"!=a&&"AtoB"!=a||jt(t,c,u,o,h),o=c+l,h=u+d,"both"!=a&&"BtoA"!=a||jt(t,c,u,o,h),t.closePath()}});this.arrow=new n({shape:{x1:t,y1:e,x2:i,y2:r,dir:this.dir},style:{...this.style.default.style,lineWidth:2}})}_initText(t,e,i,r){let{arrowX:n,arrowY:s,midX:a,midY:o,botX:h,botY:c,angle1:u}=Vt(t,e,i,r),l=this.lineCrossing.position[0],d=this.lineCrossing.position[1];this.dirTextB=new k.a.Text({position:[l+n-5+10*Math.cos(u)+10*Math.sin(u),s+d],style:{fontSize:"14",text:"B",textFill:this.style.default.style.textFill},silent:!0}),n=a+h,s=o+c,this.dirTextA=new k.a.Text({position:[l+n-5-10*Math.cos(u)-10*Math.sin(u),s+d],style:{fontSize:"14",text:"A",textFill:this.style.default.style.textFill},silent:!0});let f=l+a-80+20*Math.abs(Math.sin(u)),p=d+s;this.idText=new k.a.Text({position:[f,p],style:{fontSize:this.style.text?this.style.text.fontSize:"14",text:this.style.text?this.style.text.text:"界线"+this.id,textFill:this.style.default.style.textFill},silent:!0}),this.zr.textList.push(this.idText),this.zr.textList.push(this.dirTextA),this.zr.textList.push(this.dirTextB)}_initEndpoint(t,e,i,r){for(let n=0;n<2;n++){let s=this.style.endpoint.shape.width,a=this.style.endpoint.shape.height,o=i-s/2,h=r-a/2;0===n&&(o=t-s/2,h=e-a/2);let c=new k.a.Rect({shape:{width:s,height:a},position:[o,h],draggable:!0,style:this.style.endpoint.style,cursor:this.style.endpoint.cursor});c.on("drag",()=>{let t=c.position[0]+s/2,e=c.position[1]+a/2,i=this.zr.getWidth(),r=this.zr.getHeight(),{x:o,y:h}=et(t,e,i,r);c.attr("position",[o-s/2,h-a/2]),0===n?(this.reshape(o,h,this.lineCrossing.position[0]+this.line.shape.x2,this.lineCrossing.position[1]+this.line.shape.y2),this.reshapeText(o,h,this.lineCrossing.position[0]+this.line.shape.x2,this.lineCrossing.position[1]+this.line.shape.y2)):(this.reshape(this.lineCrossing.position[0],this.lineCrossing.position[1],o,h),this.reshapeText(this.lineCrossing.position[0],this.lineCrossing.position[1],o,h))}),c.on("dragstart",()=>{this.cursor=this.style.endpoint.cursor||"",this.changeStatus("resizeEndpoint")}),c.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.getBorderDetection()),this.changeStatus("focus")}),this.endpointGroup.add(c)}}reshape(t,e,i,r){this.lineCrossing.attr("position",[t,e]),this.line.attr({shape:{x2:i-t,y2:r-e}}),this.arrow.attr({shape:{x2:i-t,y2:r-e}}),this._getNormalizedCoor()}reshapeText(t,e,i,r,n=1){let s=this.lineCrossing.position[0],a=this.lineCrossing.position[1],{arrowX:o,arrowY:h,midX:c,midY:u,botX:l,botY:d,angle1:f}=Vt(0,0,i-t,r-e);this.dirTextB.attr("position",[s+o-5+10*Math.cos(f)+10*Math.sin(f),h+a]),o=c+l,h=u+d,this.dirTextA.attr("position",[s+o-5-10*Math.cos(f)-10*Math.sin(f),h+a]);let p=this.lineCrossing.position[0]+c-80+20*Math.abs(Math.sin(f)),g=this.lineCrossing.position[1]+h,m=this.idText.getBoundingRect();({x:p,y:g}=rt(p,g,p+m.width,g+m.height,this.zr.getWidth(),this.zr.getHeight())),1===n&&({x:p,y:g}=this._checkTextPosition(p,g,p+m.width,g+m.height,this.idText)),this.idText.attr("position",[p,g])}reshapeEndpoint(t,e,i,r){this.endpointGroup.children()[0].attr("position",[t-this.style.endpoint.shape.width/2,e-this.style.endpoint.shape.height/2]),this.endpointGroup.children()[1].attr("position",[i-this.style.endpoint.shape.width/2,r-this.style.endpoint.shape.height/2])}_onDrag(){this.lineCrossing.on("drag",()=>{let t=this.lineCrossing.position[0],e=this.lineCrossing.position[1],i=this.lineCrossing.position[0]+this.line.shape.x2,r=this.lineCrossing.position[1]+this.line.shape.y2,n=this.zr.getWidth(),s=this.zr.getHeight();if(!nt(t,e,n,s)||!nt(i,r,n,s)){let a=it(t,e,i,r,n,s);return this.reshape(a.x1,a.y1,a.x2,a.y2),this.reshapeText(t,e,i,r),void this.reshapeEndpoint(a.x1,a.y1,a.x2,a.y2)}this.reshapeEndpoint(t,e,i,r),this.reshapeText(t,e,i,r),this._getNormalizedCoor()}),this.lineCrossing.on("dragstart",()=>{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("drag")}),this.lineCrossing.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.getBorderDetection()),this.changeStatus("focus")})}_mousedown(){this.lineCrossing.on("mousedown",t=>{"idle"===this.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"))})}_mouseover(){this.lineCrossing.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.lineCrossing.on("mouseup",t=>{"create"===this.status&&this.changeStatus("idle")})}_mouseout(){this.lineCrossing.on("mouseout",t=>{"idle"===this.status&&this.changeStyle("idle")})}_getNormalizedCoor(){let t=[this.lineCrossing.position[0]-H,this.lineCrossing.position[1]-j],e=[t[0]+this.line.shape.x2,t[1]+this.line.shape.y2],i=this.zr.getWidth()-2*H,r=this.zr.getHeight()-2*j;this.graphInfo={x1:Math.round(1e4*t[0]/i),y1:Math.round(1e4*t[1]/r),x2:Math.round(1e4*e[0]/i),y2:Math.round(1e4*e[1]/r)}}changeStatus(t){if("create"===this.status&&"idle"===t&&this.lineCrossing.attr({draggable:!0}),"idle"===t&&"focus"===this.status){this.graphGroup.remove(this.endpointGroup);let t=this.style.default.style.z||0;this._setGraphZIndex(t)}"focus"===t&&"idle"===this.status&&(this.eventSource.dispatchEvent("select",this.getBorderDetection()),this.graphGroup.add(this.endpointGroup),this.group.remove(this.graphGroup),this.group.add(this.graphGroup),this._setGraphZIndex(100)),this.status=t,this.changeStyle(t)}changeStyle(t){let e=this.style.default;"focus"!==t&&"drag"!==t&&"resizeEndpoint"!==t||(e=this.style.mousedown),"mouseover"===t&&(e=this.style.mouseover),this.line.attr({style:{...e.style,lineWidth:4},cursor:e.cursor||this.style.default.cursor}),this.arrow.attr({style:{...e.style,lineWidth:2},cursor:e.cursor||this.style.default.cursor}),this.dirTextA.attr({style:{textFill:e.style.textFill}}),this.dirTextB.attr({style:{textFill:e.style.textFill}}),this.idText.attr({style:{textFill:e.style.textFill}})}getBorderDetection(){let t;return t={id:this.id+"",direction:this.dir,pt1_x:this.graphInfo.x1.toString(),pt1_y:this.graphInfo.y1.toString(),pt2_x:this.graphInfo.x2.toString(),pt2_y:this.graphInfo.y2.toString()},t}changeBorderDetectionDirection(t){this.dir=t,this.arrow.attr({shape:{dir:this.dir}})}scaleGraph(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j,i=this.graphInfo.x1*t/1e4+H,r=this.graphInfo.x2*t/1e4+H,n=this.graphInfo.y1*e/1e4+j,s=this.graphInfo.y2*e/1e4+j;this.reshape(i,n,r,s),this.reshapeEndpoint(i,n,r,s),this.reshapeText(i,n,r,s,0)}destroy(){this.zr.graphNum-=1;let t=this.zr.textList.findIndex(t=>t.id===this.idText.id);this.zr.textList.splice(t,1),t=this.zr.textList.findIndex(t=>t.id===this.dirTextA.id),this.zr.textList.splice(t,1),t=this.zr.textList.findIndex(t=>t.id===this.dirTextB.id),this.zr.textList.splice(t,1)}}var Yt=qt;let $t={default:{style:{stroke:"#4096FF",textFill:"#9dd0fd",lineWidth:3}},mouseover:{style:{stroke:"#FFF",textFill:"#FFF",lineWidth:3}},mousedown:{style:{stroke:"#FFF",textFill:"#FFF",lineWidth:3}},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:"$id"},supportManualDraw:!1};const Xt=10;class Qt extends vt{constructor(t){super(t),this.canvasType="Dot",this.style=t.style||k.a.util.clone($t),this._initDotCanvas()}_initDotCanvas(){this.typeGroup=new k.a.Group,this.typeGroup.type="dot",this.group.add(this.typeGroup),this._initStyle()}_initStyle(){this.style.default||(this.style.default=$t.default),this.style.mousedown||(this.style.mousedown=this.style.default),this.style.mouseover||(this.style.mouseover=this.style.default),this.style.endpoint||(this.style.endpoint=$t.endpoint)}initCanvasEvent(){this.zr.on("mousedown",this._mousedown,this),this.zr.on("mousemove",this._updateCursor,this),this.zr.on("dblclick",this._dblClick,this)}offCanvasEvent(){this.zr.off("mousedown",this._mousedown),this.zr.off("mousemove",this._mousemove),this.zr.off("mousemove",this._updateCursor),this.zr.off("dblclick",this._dblClick,this)}_dblClick(t){if(this.style.supportManualDraw&&!t.target){if(this.isGraphLimit()||!this.drawStatus)return;this.newGraphStartPoint=[t.offsetX,t.offsetY],this.zr.selectNode&&this.zr.selectNode.changeStatus("idle");let e=this.zr.getHeight()-Xt,i=this.zr.getWidth()-Xt;if(t.offsetXi||t.offsetYe)return;let r=this.drawDot("create",this.newGraphStartPoint[0],this.newGraphStartPoint[1]);this.zr.selectNode=r,""!==this.zr.dom.lastChild.style.cursor&&(this.zr.dom.lastChild.style.cursor=""),this.eventSource.dispatchEvent("add",this.zr.selectNode.getDotInfo)}}_mousedown(t){let e=!!t.target;this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e}),!this.isGraphLimit()&&this.drawStatus&&t.which}drawDot(t,e,i,r=-1){let n=-1;({index:n,id:r}=this._getIndexAndId(n,r));const s={zr:this.zr,group:this.typeGroup,shape:{x:e,y:i},id:r,style:this.style,eventSource:this.eventSource};if("create"===t){if(this.isGraphLimit())return null;let t=new Kt(s);return-1!==n?this.graphList.splice(n,0,t):this.graphList.push(t),this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=t,this.zr.selectNode.changeStatus("focus"),t}"reshape"===t&&(this.zr.selectNode.reshape(e,i),this.zr.selectNode.text&&this.zr.selectNode.reshapeText())}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getDotInfo())}),t}getCurrentNode(){let t=this.zr.selectNode;if(!t)return 0;let e=t.getDotInfo();return e}}class Kt extends yt{constructor(t){super(t),this.style=k.a.util.clone(t.style||$t),this.cursor=this.style.default.cursor||"pointer",this.graphList=[],this.graphGroup=new k.a.Group,this._initDot(t)}_initDot(t){this.id=t.id,this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1;let e=t.shape.x,i=t.shape.y,r=[e,i];this.graphGroup.attr({position:[...r],draggable:!0});for(let n=0;n<4;n++){let t,e;0===n&&(t=-Xt,e=0),1===n&&(t=Xt,e=0),2===n&&(t=0,e=-Xt),3===n&&(t=0,e=Xt);let i=new k.a.Line({shape:{x2:t,y2:e},style:this.style.default.style,draggable:!1});this.graphList.push(i),this.graphGroup.add(i)}if(this._getNormalizedCoor(),this._onDrag(),this._mousedown(),this._mouseover(),this._mouseout(),this._mouseup(),this.group.add(this.graphGroup),this.style.text&&this._initText(),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initText(){this.text=new k.a.Text({position:[this.style.text.textPosition[0],this.style.text.textPosition[1]],style:{fontSize:this.style.text.fontSize||$t.text.fontSize,fontFamily:this.style.text.fontFamily||$t.text.fontFamily,text:this.style.text.text||"",textFill:this.style.default.style.textFill||$t.default.style.textFill}}),this.text.silent=!0,this.graphGroup.add(this.text),this.zr.textList.push(this.text)}reshape(t,e,i=1){this.graphGroup.attr("position",[t,e]),this._getNormalizedCoor()}_onDrag(){this.graphGroup.on("drag",()=>{let t=this.graphGroup.position[0],e=this.graphGroup.position[1],i=this.zr.getWidth(),r=this.zr.getHeight();if(!nt(t,e,i-Xt,r-Xt)||t{this.cursor=this.style.default.cursor||"pointer",this.changeStatus("drag")}),this.graphGroup.on("dragend",()=>{this.cursor=this.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.getDotInfo()),this.changeStatus("focus")})}_mousedown(){this.graphGroup.on("mousedown",t=>{"idle"===this.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"))})}_mouseover(){this.graphGroup.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.graphGroup.on("mouseup",t=>{})}_mouseout(){this.graphGroup.on("mouseout",t=>{"idle"===this.status&&this.changeStyle("idle")})}_getNormalizedCoor(){let t=[this.graphGroup.position[0]-H,this.graphGroup.position[1]-j],e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;this.graphInfo={x:Math.round(1e4*t[0]/e),y:Math.round(1e4*t[1]/i)}}changeStatus(t){if("idle"===t&&"focus"===this.status){let t=this.style.default.style.z||0;this._setGraphZIndex(t)}"focus"===t&&"idle"===this.status&&(this.eventSource.dispatchEvent("select",this.getDotInfo()),this._setGraphZIndex(100)),this.status=t,this.changeStyle(t)}changeStyle(t){let e=this.style.default.style;"focus"!==t&&"drag"!==t&&"resizeEndpoint"!==t||(e=this.style.mousedown.style),"mouseover"===t&&(e=this.style.mouseover.style),this.graphList.forEach(t=>{t.attr({style:e})}),this.text&&this.text.attr({style:{textFill:e.textFill}})}getDotInfo(){let t={id:this.id+"",x:this.graphInfo.x,y:this.graphInfo.y};return t}scaleGraph(){let t=this.zr.getWidth()-2*H,e=this.zr.getHeight()-2*j,i=this.graphInfo.x*t/1e4+H,r=this.graphInfo.y*e/1e4+j;this.reshape(i,r,0)}}var Zt=Qt;const Jt=5,te=8,ee={default:{style:{stroke:"#1994FF",textFill:"#9dd0fd",lineWidth:4,fill:"rgba(0, 0, 0, 0)"},cursor:"move"},mouseover:{style:{stroke:"#FFF",textFill:"#FFF"}},mousedown:{style:{stroke:"#FFF",textFill:"#FFF"}},endpoint:{type:"rect",style:{fill:"#1994FF",stroke:"#FFF"},shape:{width:6,height:6}},cursor:{left:"w-resize",right:"e-resize",top:"n-resize",bottom:"s-resize",topLeft:"nw-resize",topRight:"ne-resize",bottomLeft:"sw-resize",bottomRight:"se-resize"},text:{fontSize:"14",fontFamily:"微软雅黑",textPosition:[-60,0],text:""},rectLevel:[Jt,Jt]};class ie extends vt{constructor(t){super(t),this.style=t.style||k.a.util.clone(ee),t.style&&Object.keys(t.style).forEach(e=>{this.style[e]&&Object.assign(this.style[e],t.style[e])}),this.dirList=[],this._initNetRectCanvas()}_initNetRectCanvas(){this.typeGroup=new k.a.Group,this.typeGroup.type="netRect",this.style.rectLevel=[...this.style.rectLevel],this.group.add(this.typeGroup);for(let t=0;t{this.zr.selectNode.resize(t.offsetX,t.offsetY,e)}),this.zr.selectNode.style.text&&this.zr.selectNode.reshapeText()),this.zr.selectNode&&"drag"===this.zr.selectNode.status&&this.zr.selectNode.onDrag(t)}_mousedown(t){if(1!==t.which)return;let e=!!t.target;if(this.eventSource.dispatchEvent("clickCanvas",{position:[parseInt(t.offsetX/this.zr.getWidth()*1e4),parseInt(t.offsetY/this.zr.getHeight()*1e4)],hasTarget:e}),"idle"===this.zr.status&&!t.target){if(this.isGraphLimit()||!this.drawStatus)return;this.zr.status="create",this.newGraphStartPoint=[t.offsetX,t.offsetY]}"focus"===this.zr.status&&(t.target||(this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=null,this.zr.status="idle"))}_mouseup(t){"create"!==this.zr.status&&"draw"!==this.zr.status||(""!==this.zr.dom.lastChild.style.cursor&&(this.zr.dom.lastChild.style.cursor=""),"draw"===this.zr.status&&(this.eventSource.dispatchEvent("add",this.zr.selectNode.getNetRectInfo()),this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=null),this.zr.status="idle"),"focus"===this.zr.status&&(!this.zr.selectNode||"resize"!==this.zr.selectNode.status&&"drag"!==this.zr.selectNode.status||(this.zr.selectNode.changeStatus("idle"),this.zr.status="idle",this.zr.selectNode.cursor=this.zr.selectNode.style.default.cursor||"pointer",this.eventSource.dispatchEvent("drag",this.zr.selectNode.getNetRectInfo())))}drawNetRect(t,e,i,r,n,s=-1,a=-1){if("create"===t){({index:s,id:a}=this._getIndexAndId(s,a));const t={zr:this.zr,group:this.typeGroup,id:a,style:this.style,shape:{x:e,y:i,width:r,height:n},eventSource:this.eventSource};if(this.isGraphLimit())return null;let o=new re(t);return-1!==s&&st.id===this.selectNode.id);this.graphList.splice(t,1),this.typeGroup.remove(this.selectNode.graphGroup)}}getGraphsInfo(){let t=[];return this.graphList.forEach(e=>{t.push(e.getNetRectInfo())}),t}getCurrentNode(){return this.zr.selectNode?this.zr.selectNode.getNetRectInfo():0}_getNetRectCoor(t,e,i,r){let n=this.zr.getWidth()-2*H,s=this.zr.getHeight()-2*j,a=parseInt(t/n*this.style.rectLevel[0]),o=parseInt(e/s*this.style.rectLevel[1]),h=parseInt(i/n*this.style.rectLevel[0])-a,c=parseInt(r/s*this.style.rectLevel[1])-o;return{x:a<0?0:a+h>this.style.rectLevel[0]?this.style.rectLevel[0]-h:a,y:o<0?0:o+c>this.style.rectLevel[1]?this.style.rectLevel[1]-c:o,width:h<1?1:h,height:c<1?1:c}}}class re extends yt{constructor(t){super(t),this.zr=t.zr,this.group=t.group,this.style=k.a.util.clone(t.style||ee),this.cursor=this.style.default.cursor||"",this.dir=t.direction,this.id=t.id,this.text=null,this.graphGroup=new k.a.Group,this.netRectInfo=null,this.positionRect=null,this.rectLevel=[...this.style.rectLevel],this.dragStartPosition=[0,0],this.dragStartRectPosition=[0,0],this.pos=[],this.netRect=new k.a.Group,this.status="create",this._initNetRect(t)}_initNetRect(t){this.style.text&&-1!==this.style.text.text.indexOf("$id")&&(this.style.text.text=this.style.text.text.replace("$id",this.id)),this.zr.graphNum+=1;let e=[t.shape.x,t.shape.y];if(e[0]=e[0]*(this.zr.getWidth()-2*H)/this.rectLevel[0]+H,e[1]=e[1]*(this.zr.getHeight()-2*j)/this.rectLevel[1]+j,this.netRect.attr("position",[...e]),this.netRect.attr("draggable",!1),this.netRect.attr("cursor",this.cursor),this.netRectInfo={x:t.shape.x,y:t.shape.y,width:t.shape.width,height:t.shape.height},this._initRect(0,0,t.shape.width,t.shape.height),this._getNormalizedCoor(),this._initText(),this._mousedown(),this._mouseover(),this._mousemove(),this._mouseout(),this._mouseup(),this.graphGroup.add(this.text),this.graphGroup.add(this.netRect),this.group.add(this.graphGroup),this.style.default.style.z){let t=this.style.default.style.z;this._setGraphZIndex(t)}}_initRect(t,e,i,r){let n=this.zr.getWidth()-2*H,s=this.zr.getHeight()-2*j;for(let a=0;a{"focus"===this.status&&(this.pos.length?(this.judgeMousePosition(t.offsetX,t.offsetY),this.changeStatus("resize")):(this.changeStatus("drag"),this.dragStartPosition=[t.offsetX,t.offsetY],this.dragStartRectPosition=[this.netRect.position[0],this.netRect.position[1]]))})}_mousemove(){this.netRect.on("mousemove",t=>{"idle"===this.zr.status&&(this.zr.selectNode&&this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=this,this.zr.status="focus",this.changeStatus("focus"),this.dragStartPosition=[t.offsetX,t.offsetY]),"drag"!==this.status&&"resize"!==this.status?(this.judgeMousePosition(t.offsetX,t.offsetY),this._judegeCursorStyle()):"drag"===this.status&&this.onDrag(t),this.zr.dom.lastChild.style.cursor=this.cursor})}onDrag(t){let e=t.offsetX-this.dragStartPosition[0],i=t.offsetY-this.dragStartPosition[1],r=this.dragStartRectPosition[0]+e,n=this.dragStartRectPosition[1]+i,s=this._getNetRectCoor(r,n,this.positionRect.shape.width,this.positionRect.shape.height);this.reshape(s.x,s.y,s.width,s.height),this.reshapeText(),this.dragStartPosition[0]+=this.netRect.position[0]-this.dragStartRectPosition[0],this.dragStartPosition[1]+=this.netRect.position[1]-this.dragStartRectPosition[1],this.dragStartRectPosition=[this.netRect.position[0],this.netRect.position[1]]}_mouseover(){this.netRect.on("mouseover",t=>{"idle"===this.zr.status&&this.changeStyle("mouseover")})}_mouseup(){this.netRect.on("mouseup",t=>{"create"===this.status&&this.changeStatus("idle"),"drag"===this.status&&(this.changeStatus("idle"),this.zr.status="idle",this.eventSource.dispatchEvent("drag",this.zr.selectNode.getNetRectInfo()))})}_mouseout(){this.netRect.on("mouseout",t=>{"idle"===this.status&&(this.changeStyle("idle"),""!==this.zr.dom.lastChild.style.cursor&&(this.zr.dom.lastChild.style.cursor="")),"focus"===this.status&&(this.changeStatus("idle"),this.zr.status="idle")})}_judegeCursorStyle(){this.pos.length?1===this.pos.length?("top"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.top),"bottom"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.bottom),"left"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.left),"right"===this.zr.selectNode.pos[0]&&(this.cursor=this.style.cursor.right)):("left"===this.zr.selectNode.pos[0]&&("top"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.topLeft),"bottom"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.bottomLeft)),"right"===this.zr.selectNode.pos[0]&&("top"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.topRight),"bottom"===this.zr.selectNode.pos[1]&&(this.cursor=this.style.cursor.bottomRight))):this.cursor=this.style.default.cursor||"pointer"}judgeMousePosition(t,e){this.pos=[],Math.abs(t-this.netRect.position[0])t.id===this.text.id);this.zr.textList.splice(t,1)}_getNetRectCoor(t,e,i,r,n=!0){let s=this.zr.getWidth()-2*H,a=this.zr.getHeight()-2*j,o=Math.round(t/s*this.rectLevel[0]),h=Math.round(e/a*this.rectLevel[1]),c=Math.round(i/s*this.rectLevel[0]),u=Math.round(r/a*this.rectLevel[1]);return o=o<0?0:o,h=h<0?0:h,c=c<1?1:c,u=u<1?1:u,n?{x:o+c>this.rectLevel[0]?this.rectLevel[0]-c:o,y:h+u>this.rectLevel[1]?this.rectLevel[1]-u:h,width:c,height:u}:{x:o,y:h,width:o+c>this.rectLevel[0]?this.rectLevel[0]-o:c,height:h+u>this.rectLevel[1]?this.rectLevel[1]-h:u}}}var ne=ie;class se{constructor(t){this.options=t,this.canvasHandle={},this.resetCanvas=t.resetCanvas||!1,this.operateOtherType=t.operateOtherType||!1,this.graphLimit=t.graphLimit||4,this.wrapper=t.wrapper,this.drawingBoardWrapper=null,this.zr=null,this.group=null,this.cover=t.cover,this.videoId=t.videoId,this.staticImg=t.staticImg,this.videoHeight=1920,this.videoWidth=1080,this.canvasWidth="100%",this.canvasHeight="100%",this.startWidth=0,this.startHeight=0,this.style={},this.eventSource=new J,this.eventSource.on("delete",()=>{this.canvasHandle[this.zr.canvasType].updateId()}),this._isDisposed=!1,this._initDrawingBoardWrapper(),this._initDrawingBoard(t)}static get CANVAS_TYPE(){return{line:"line",rect:"rect",polygon:"polygon",text:"text",invasion:"invasion",motion:"motion",cover:"cover",lineCrossing:"lineCrossing",dot:"dot"}}static get ENDPOINT_TYPE(){return{rect:"rect",circle:"circle"}}static get ERROR_CODE(){return{GRAPH_LIMIT:2001,POLYGON_ERROR:2002}}_initDrawingBoardWrapper(){this.drawingBoardWrapper=document.createElement("div"),$(this.drawingBoardWrapper,{position:"absolute",zIndex:"10",top:"0",left:"0",width:"100%",height:"100%",background:"rgba(0, 0, 0, 0)"}),this.wrapper.appendChild(this.drawingBoardWrapper),this.videoCanvas=this.videoId?document.getElementById(this.videoId):{width:this.wrapper.clientWidth,height:this.wrapper.clientHeight},this.videoWidth=this.videoCanvas.width,this.videoHeight=this.videoCanvas.height,this._resize()}_resize(){let t=this.wrapper.clientHeight,e=this.wrapper.clientWidth,i=e+2*H+"px",r=Math.floor(e*this.videoHeight/this.videoWidth)+2*j+"px";parseInt(r)>t&&(r=t+2*H+"px",i=Math.floor(t*this.videoWidth/this.videoHeight)+2*H+"px"),this.cover&&(i=e+2*H+"px",r=t+2*j+"px"),this.drawingBoardWrapper.style.height=r,this.drawingBoardWrapper.style.width=i,this.canvasWidth=i,this.canvasHeight=r,this.drawingBoardWrapper.style.top=(t-parseInt(this.drawingBoardWrapper.style.height))/2+"px",this.drawingBoardWrapper.style.left=(e-parseInt(this.drawingBoardWrapper.style.width))/2+"px"}_resizeGraphs(){for(let t of Object.keys(this.canvasHandle))this.canvasHandle[t].scaleGraphs()}_initDrawingBoard(t){this.zr=k.a.init(this.drawingBoardWrapper),this.zr.eventSource=this.eventSource,this.zr.selectNode=null,this.zr.status="idle",this.zr.canvasType=t.canvasType,this.zr.textList=[],this.zr.graphLimit="number"===typeof this.graphLimit?this.graphLimit:-1,this.zr.graphNum=0,this.zr.currentWidth=parseInt(this.canvasWidth),this.zr.currentHeight=parseInt(this.canvasHeight),this.group=new k.a.Group,this.zr.add(this.group),this.createCanvasHandle(this.zr.canvasType),this.canvasHandle[this.zr.canvasType].initCanvasEvent(),this.frame=this.videoCanvas.nextSibling,!this.staticImg&&this.frame||(this.frame=document.createElement("iframe"),$(this.frame,{opacity:0,position:"absolute",zIndex:-1111,left:0,top:0,width:"100%",height:"100%"}),this.wrapper.appendChild(this.frame)),this.frame.contentWindow.addEventListener("resize",()=>{this.videoWidth=this.videoCanvas.width,this.videoHeight=this.videoCanvas.height,this._resize(),this.zr.resize({width:this.canvasWidth,height:this.canvasHeight}),this._resizeGraphs(),this.zr.currentWidth=parseInt(this.canvasWidth),this.zr.currentHeight=parseInt(this.canvasHeight)});let e=setTimeout(()=>{clearTimeout(e),this.videoWidth=this.videoCanvas.width,this.videoHeight=this.videoCanvas.height,this._resize(),this.zr.resize({width:this.canvasWidth,height:this.canvasHeight}),this._resizeGraphs(),this.zr.currentWidth=parseInt(this.canvasWidth),this.zr.currentHeight=parseInt(this.canvasHeight)},500)}clearCanvas(){this.canvasHandle[this.zr.canvasType].clearCanvas()}clearAll(){for(let t of Object.keys(this.canvasHandle))this.canvasHandle[t].clearCanvas()}removeCurrentNode(){if(!this.zr.selectNode)return 0;this.canvasHandle[this.zr.selectNode.graphGroup.parent.type].removeCurrentNode(),this.eventSource.dispatchEvent("delete",this.getCurrentNode())}setCurrentNode(t,e){this.zr.selectNode&&this.zr.selectNode.changeStatus("idle");let i=this.canvasHandle[t],r=i.graphList||[];this.zr.selectNode=r[e]||null,this.zr.selectNode&&(this.zr.status="focus",this.zr.selectNode.changeStatus("focus"))}setCurrentNodeById(t,e){this.zr.selectNode&&this.zr.selectNode.changeStatus("idle");let i=this.canvasHandle[t];if(!i)return;let r=i.graphList||[],n=r.find(t=>t.id==e);this.zr.selectNode=n||null,this.zr.selectNode&&(this.zr.status="focus",this.zr.selectNode.changeStatus("focus"))}getCurrentNode(){return this.zr.selectNode?this.canvasHandle[this.zr.selectNode.graphGroup.parent.type].getCurrentNode():null}destroy(){this._isDisposed||(this.wrapper.removeChild(this.drawingBoardWrapper),this.frame.parentNode===this.wrapper&&this.wrapper.removeChild(this.frame),this.zr.dispose(),this._isDisposed=!0)}setStyle(t,e){this.style[t]=e,this.canvasHandle[t]&&this.canvasHandle[t].setStyle(e)}changeCanvasType(t){t!==this.zr.canvasType&&(this.zr.selectNode&&"create"===this.zr.selectNode.status&&this.removeCurrentNode(),this.canvasHandle[this.zr.canvasType].offCanvasEvent(),this.resetCanvas&&(this.zr.selectNode&&(this.zr.selectNode.changeStatus("idle"),this.zr.selectNode=null),this.zr.status="idle",this.group.removeAll(),this.zr.graphNum=0,this.canvasHandle={}),this.operateOtherType||(this.zr.selectNode&&(this.zr.selectNode.changeStatus("idle"),this.zr.status="idle",this.zr.selectNode=null),this.resetCanvas||(this.canvasHandle[this.zr.canvasType].typeGroup.silent=!0)),this.zr.canvasType=t,this.canvasHandle[t]?(this.group.remove(this.canvasHandle[t].typeGroup),this.group.add(this.canvasHandle[t].typeGroup),this.canvasHandle[t].typeGroup.silent=!1,this.canvasHandle[t].initCanvasEvent()):(this.createCanvasHandle(t),this.canvasHandle[t].initCanvasEvent()))}createCanvasHandle(t){const e={zr:this.zr,group:this.group,graphLimit:"number"===typeof this.graphLimit?this.graphLimit:this.graphLimit[t],canvasType:t,style:this.style[t]||null,eventSource:this.eventSource};switch(t){case D:this.canvasHandle.line=new Ot(e);break;case O:this.canvasHandle.rect=new xt(e),this.canvasHandle.rect.initGraphEvent();break;case M:this.canvasHandle.polygon=new Wt(e);break;case N:this.canvasHandle.text=new Pt(e);break;case B:this.canvasHandle.motion=new xt(e),this.canvasHandle.motion.initGraphEvent();break;case L:this.canvasHandle.cover=new xt(e),this.canvasHandle.cover.initGraphEvent();break;case U:this.canvasHandle.lineCrossing=new Yt(e);break;case z:this.canvasHandle.invasion=new Wt(e);break;case F:this.canvasHandle.dot=new Zt(e);break;case W:this.canvasHandle.netRect=new ne(e)}this.operateOtherType||this.resetCanvas||this.zr.canvasType===t||(this.canvasHandle[t].typeGroup.silent=!0),this.zr.canvasType!==t&&(this.group.remove(this.canvasHandle[this.zr.canvasType].typeGroup),this.group.add(this.canvasHandle[this.zr.canvasType].typeGroup))}toggleDrawStatus(t){this.canvasHandle[this.zr.canvasType].changeDrawStatus(t)}drawGraphs(t,e,i=!0,r=0){switch(t){case D:this.drawLine(e);break;case O:this.drawRect(e);break;case M:this.drawPolygon(e);break;case N:this.drawText(e,i,r);break;case F:this.drawDot(e);break;case U:this.drawLineCrossing(e);break;case W:this.drawNetRect(e);break}}getGraphsInfo(t){return this.canvasHandle[t].getGraphsInfo()}drawFullScreen(){switch(this.zr.canvasType){case"rect":this.canvasHandle[this.zr.canvasType].clearCanvas(),this.drawRect([{x:0,y:0,width:1e4,height:1e4}]);break;case"polygon":this.canvasHandle[this.zr.canvasType].clearCanvas(),this.drawPolygon([{points:[[0,0],[1e4,0],[1e4,1e4],[0,1e4]]}]);break;case"invasion":this.canvasHandle[this.zr.canvasType].clearCanvas(),this.addRegionInvasion(0,0,0,1e4,0,1e4,1e4,0,1e4,"1");break}}getGraphCount(){return this.canvasHandle[this.zr.canvasType].getGraphCount()}getEnableGraphCount(){return this.canvasHandle[this.zr.canvasType].getEnableGraphCount()}changeLimit(t,e){this.canvasHandle[t]&&this.canvasHandle[t].changeGraphLimit(e)}drawLine(t){this.canvasHandle["line"]||this.createCanvasHandle("line");let e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;t.forEach(t=>{let r=t.x1/1e4*e+H,n=t.y1/1e4*i+j,s=t.x2/1e4*e+H,a=t.y2/1e4*i+j,o=this.canvasHandle["line"].drawLine("create",r,n,s,a,t.id);null!==o&&o.changeStatus("idle")})}drawRect(t){this.canvasHandle["rect"]||this.createCanvasHandle("rect");let e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;t.forEach(t=>{let r=t.x/1e4*e+H,n=t.y/1e4*i+j,s=t.width/1e4*e,a=t.height/1e4*i,o=this.canvasHandle["rect"].drawRect("create",r,n,s,a,t.id);null!==o&&o.changeStatus("idle")})}drawText(t,e,i){this.canvasHandle["text"]||this.createCanvasHandle("text");let r=this.zr.getWidth()-2*H,n=this.zr.getHeight()-2*j;t.forEach(t=>{let s=t.x/1e4*r+H,a=t.y/1e4*n+j,o=this.canvasHandle["text"].drawText(s,a,t.text,t.id,e,i);null!==o&&o.changeStatus("idle")})}drawPolygon(t){this.canvasHandle["polygon"]||this.createCanvasHandle("polygon");let e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;t.forEach(t=>{let r=k.a.util.clone(t.points);r.forEach(t=>{t[0]=t[0]/1e4*e+H,t[1]=t[1]/1e4*i+j});let n=this.canvasHandle["polygon"].drawPolygon("create",r,-1,t.id);null!==n&&n.changeStatus("idle")})}drawDot(t){this.canvasHandle["dot"]||this.createCanvasHandle("dot");let e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;t.forEach(t=>{let r=t.x/1e4*e+H,n=t.y/1e4*i+j,s=this.canvasHandle["dot"].drawDot("create",r,n,t.id);null!==s&&s.changeStatus("idle")})}drawLineCrossing(t){this.canvasHandle["lineCrossing"]||this.createCanvasHandle("lineCrossing");let e=this.zr.getWidth()-2*H,i=this.zr.getHeight()-2*j;t.forEach(t=>{let{pt1_x:r,pt1_y:n,pt2_x:s,pt2_y:a,direction:o,index:h,id:c}=t;r=r/1e4*e+H,n=n/1e4*i+j,s=s/1e4*e+H,a=a/1e4*i+j;let u=this.canvasHandle["lineCrossing"].drawLineCrossing("create",r,n,s,a,o,h,c);u&&u.changeStatus("idle")})}drawNetRect(t){this.canvasHandle["netRect"]||this.createCanvasHandle("netRect");let e=this.canvasHandle["netRect"].style.rectLevel||[5,5];t.forEach(t=>{if(t.x>e[0]||t.y>e[1]||t.width>e[0]||t.height>e[1])return;let i=this.canvasHandle["netRect"].drawNetRect("create",t.x,t.y,t.width,t.height);null!==i&&i.changeStatus("idle")})}toggleRegionCover(t){1===t&&this.changeCanvasType("cover"),this.canvasHandle["cover"].changeDrawStatus(t)}setRegionCoverParams(t,e,i,r){this.canvasHandle["cover"]||this.createCanvasHandle("cover");let n=this.zr.getWidth()-2*H,s=this.zr.getHeight()-2*j;t=t/1e4*n+H,e=e/1e4*s+j,i=i/1e4*n+H,r=r/1e4*s+j;let a=this.canvasHandle["cover"].drawRect("create",t,e,i,r);a&&a.changeStatus("idle")}getRegionCoverParams(t){return this.canvasHandle["cover"]?this.canvasHandle["cover"].getGraphInfo(t):null}maxRegionCoverCount(){return this.canvasHandle["cover"]?this.canvasHandle["cover"].getGraphCount():0}deleteRegionCover(t){t<0?this.clearCanvas():this.removeCurrentNode()}toggleMotionDetection(t){1===t&&this.changeCanvasType("motion"),this.canvasHandle["motion"].changeDrawStatus(t)}setMotionDetectionParams(t,e,i,r){this.canvasHandle["motion"]||this.createCanvasHandle("motion");let n=this.zr.getWidth()-2*H,s=this.zr.getHeight()-2*j;t=t/1e4*n+H,e=e/1e4*s+j,i=i/1e4*n+H,r=r/1e4*s+j;let a=this.canvasHandle["motion"].drawRect("create",t,e,i,r);a&&a.changeStatus("idle")}getMotionDetectionParams(t){return this.canvasHandle["motion"]?this.canvasHandle["motion"].getGraphInfo(t):null}deleteMotionDetection(t){t<0?this.clearCanvas():this.removeCurrentNode()}maxMotionDetectionCount(){return this.canvasHandle["motion"]?this.canvasHandle["motion"].getGraphCount():0}toggleBorderDetection(t){1===t&&this.changeCanvasType("lineCrossing"),this.canvasHandle["lineCrossing"].changeDrawStatus(t)}deleteBorderDetection(t){-1===t?this.clearCanvas():this.removeCurrentNode()}addBorderDetection(t,e,i,r,n,s,a){this.canvasHandle["lineCrossing"]||this.createCanvasHandle("lineCrossing");let o=this.zr.getWidth()-2*H,h=this.zr.getHeight()-2*j;e=e/1e4*o+H,i=i/1e4*h+j,r=r/1e4*o+H,n=n/1e4*h+j;let c=this.canvasHandle["lineCrossing"].drawLineCrossing("create",e,i,r,n,s,t,a);c&&c.changeStatus("idle")}getBorderDetection(t,e){return this.canvasHandle["lineCrossing"].getBorderDetection(t,e)}changeBorderDetectionDirection(t,e){this.canvasHandle["lineCrossing"].changeBorderDetectionDirection(t,e)}toggleRegionInvasion(t){1===t&&this.changeCanvasType("invasion"),this.canvasHandle["invasion"].changeDrawStatus(t)}deleteRegionInvasion(t){-1===t?this.clearCanvas():this.removeCurrentNode()}addRegionInvasion(t,e,i,r,n,s,a,o,h,c){this.canvasHandle["invasion"]||this.createCanvasHandle("invasion");let u=[[e,i],[r,n],[s,a],[o,h]],l=this.zr.getWidth()-2*H,d=this.zr.getHeight()-2*j;u.forEach(t=>{t[0]=t[0]/1e4*l+H,t[1]=t[1]/1e4*d+j});let f=this.canvasHandle["invasion"].drawPolygon("create",u,t,c);f&&f.changeStatus("idle")}getRegionInvasion(t,e){return this.canvasHandle["invasion"]?this.canvasHandle["invasion"].getGraphInfo(t,e):null}changeTextStyle(t,e,i,r=!0){if(!this.canvasHandle["text"])return;let n=this.canvasHandle["text"].graphList.find(e=>e.id===t);n&&(n.setStyle(e),n.setTextInfo(i,r))}on(t,e){this.eventSource.addEventListener(t,e)}off(t,e){this.eventSource.removeEventListener(t,e)}}var ae=se;i("2c66"),i("249d"),i("40e9"),i("d866"),i("907a"),i("986a"),i("1d02"),i("3c5d"),i("6ce5"),i("2834"),i("4ea1"),i("b7ef");function oe(t,e){let i=new Uint8Array((0|t.byteLength)+(0|e.byteLength));return i.set(t,0),i.set(e,0|t.byteLength),i}function he(t){var e=window.atob(t),i=e.length,r=new Uint8Array(i);for(let n=0;n>1;for(var i=new Uint8Array(e),r=0;r>>3,a=(i>>>3)-1,o=7&e,h=8-o,c=8-i&7;for(let u=0;u>h,u==a-1&&c<8&&(e>>=c,e<<=c)),n[u]=t[s+u]<0;--i)e=(0|e)<<1|(0|this.byte)>>8-++this.bitpos&1,(0|this.bitpos)>=8&&(this.byte=this.src.getUint8(++this.bytepos),this.bitpos&=7);return e}skipBits(t){return this.bitpos+=7&(0|t),this.bytepos+=(0|t)>>>3,this.bitpos>7&&(this.bitpos&=7,++this.bytepos),this.finished()?this.bytepos-this.src.byteLength-this.src.bitpos:(this.byte=this.src.getUint8(this.bytepos),0)}finished(){return this.bytepos>=this.src.byteLength}}function fe(t,e){const i=[0,79764919,159529838,222504665,319059676,398814059,445009330,507990021,638119352,583659535,797628118,726387553,890018660,835552979,1015980042,944750013,1276238704,1221641927,1167319070,1095957929,1595256236,1540665371,1452775106,1381403509,1780037320,1859660671,1671105958,1733955601,2031960084,2111593891,1889500026,1952343757,2552477408,2632100695,2443283854,2506133561,2334638140,2414271883,2191915858,2254759653,3190512472,3135915759,3081330742,3009969537,2905550212,2850959411,2762807018,2691435357,3560074640,3505614887,3719321342,3648080713,3342211916,3287746299,3467911202,3396681109,4063920168,4143685023,4223187782,4286162673,3779000052,3858754371,3904687514,3967668269,881225847,809987520,1023691545,969234094,662832811,591600412,771767749,717299826,311336399,374308984,453813921,533576470,25881363,88864420,134795389,214552010,2023205639,2086057648,1897238633,1976864222,1804852699,1867694188,1645340341,1724971778,1587496639,1516133128,1461550545,1406951526,1302016099,1230646740,1142491917,1087903418,2896545431,2825181984,2770861561,2716262478,3215044683,3143675388,3055782693,3001194130,2326604591,2389456536,2200899649,2280525302,2578013683,2640855108,2418763421,2498394922,3769900519,3832873040,3912640137,3992402750,4088425275,4151408268,4197601365,4277358050,3334271071,3263032808,3476998961,3422541446,3585640067,3514407732,3694837229,3640369242,1762451694,1842216281,1619975040,1682949687,2047383090,2127137669,1938468188,2001449195,1325665622,1271206113,1183200824,1111960463,1543535498,1489069629,1434599652,1363369299,622672798,568075817,748617968,677256519,907627842,853037301,1067152940,995781531,51762726,131386257,177728840,240578815,269590778,349224269,429104020,491947555,4046411278,4126034873,4172115296,4234965207,3794477266,3874110821,3953728444,4016571915,3609705398,3555108353,3735388376,3664026991,3290680682,3236090077,3449943556,3378572211,3174993278,3120533705,3032266256,2961025959,2923101090,2868635157,2813903052,2742672763,2604032198,2683796849,2461293480,2524268063,2284983834,2364738477,2175806836,2238787779,1569362073,1498123566,1409854455,1355396672,1317987909,1246755826,1192025387,1137557660,2072149281,2135122070,1912620623,1992383480,1753615357,1816598090,1627664531,1707420964,295390185,358241886,404320391,483945776,43990325,106832002,186451547,266083308,932423249,861060070,1041341759,986742920,613929101,542559546,756411363,701822548,3316196985,3244833742,3425377559,3370778784,3601682597,3530312978,3744426955,3689838204,3819031489,3881883254,3928223919,4007849240,4037393693,4100235434,4180117107,4259748804,2310601993,2373574846,2151335527,2231098320,2596047829,2659030626,2470359227,2550115596,2947551409,2876312838,2788305887,2733848168,3165939309,3094707162,3040238851,2985771188];let r,n=4294967295;for(r=0;r>24^t[r])];return n}function pe(t,e,i=!1){const r=t.getUint32(e,i),n=t.getUint32(e+4,i),s=i?r+2**32*n:2**32*r+n;return s}class ge{static get PCMU(){return 0}static get H264(){return 1}static get AAC(){return 2}static get H265(){return 3}static get G711A(){return 4}static get PCMA_W(){return 5}static get G726(){return 6}static get ADPCM(){return 7}static get map(){return{[ge.H264]:"video",[ge.H265]:"video",[ge.AAC]:"audio",[ge.G711A]:"audio",[ge.PCMA_W]:"audio",[ge.PCMA]:"audio",[ge.PCMU]:"audio",[ge.G726]:"audio",[ge.ADPCM]:"audio"}}static get string_map(){return{H264:ge.H264,H265:ge.H265,AAC:ge.AAC,PCMA:ge.G711A,"MP4A-LATM":ge.AAC,"MPEG4-GENERIC":ge.AAC,"mpeg4-generic":ge.AAC,G711alaw:ge.G711A,PCMA_W:ge.PCMA_W,PCMU:ge.PCMU,G711ulaw:ge.PCMU,G726:ge.G726,ADPCM:ge.ADPCM}}}var me=ge;const ve=[0,0,0,1];class ye{static get NDR(){return 1}static get IDR(){return 5}static get SEI(){return 6}static get SPS(){return 7}static get PPS(){return 8}static get STAP_A(){return 24}static get STAP_B(){return 25}static get FU_A(){return 28}static get FU_B(){return 29}static get VPS(){return 32}static get HEVC_SPS(){return 33}static get HEVC_PPS(){return 34}static get TYPES(){return{[ye.IDR]:"IDR",[ye.SEI]:"SEI",[ye.SPS]:"SPS",[ye.PPS]:"PPS",[ye.NDR]:"NDR",[ye.VPS]:"VPS",[ye.HEVC_SPS]:"SPS",[ye.HEVC_PPS]:"PPS"}}static type(t){return t.ntype in ye.TYPES?ye.TYPES[t.ntype]:"UNKNOWN"}constructor(t,e,i,r,n,s){this.data=new Uint8Array(ve.length+e.length),this.data.set(ve,0),this.data.set(e,ve.length),this.dts=i,this.pts=r||this.dts,this.ntype=t,this.nri=n,this.payloadType=s,this.isVirtualI=!1,this.isDecodeOnlyI=!1}appendData(t){this.data=oe(this.data,t)}toString(){return`${ye.type(this)}(${this.data.byteLength}): NRI: ${this.getNri()}, PTS: ${this.pts}, DTS: ${this.dts}`}getNri(){return this.nri>>5}type(){return this.ntype}isKeyframe(){return this.payloadType===me.H264?this.ntype==ye.IDR:this.ntype>=16&&this.ntype<=20}isNormalDataFrame(){return this.payloadType===me.H264?this.ntype>=1&&this.ntype<=5:this.ntype<=31}isParameterSet(){return this.payloadType===me.H264?this.ntype===ye.SPS||this.ntype===ye.PPS:this.ntype===ye.VPS||this.ntype===ye.HEVC_SPS||this.ntype===ye.HEVC_PPS}isStartSlice(){let t=!0;return this.payloadType===me.H265?this.ntype<=31&&(t=(128&this.data[6])>0):this.ntype<=5&&this.ntype>=1&&(t=(128&this.data[5])>0),t}getSize(){return 5+this.data.byteLength}getData(){let t=new Uint8Array(5+this.data.byteLength),e=new DataView(t.buffer);return e.setUint32(0,this.data.byteLength+1),e.setUint8(4,0|96&this.nri|31&this.ntype),t.set(this.data,5),t}}i("ab43");class be{constructor(t){this.data=t,this.bytesAvailable=this.data.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){let t=this.data.byteLength-this.bytesAvailable,e=new Uint8Array(4),i=Math.min(4,this.bytesAvailable);if(0===i)throw new Error("no bytes available");e.set(this.data.subarray(t,t+i)),this.word=new DataView(e.buffer,e.byteOffset,e.byteLength).getUint32(0),this.bitsAvailable=8*i,this.bytesAvailable-=i}skipBits(t){let e;this.bitsAvailable>t?(this.word<<=t,this.bitsAvailable-=t):(t-=this.bitsAvailable,e=t>>3,t-=e<<3,this.bytesAvailable-=e,this.loadWord(),this.word<<=t,this.bitsAvailable-=t)}readBits(t){let e=Math.min(this.bitsAvailable,t),i=this.word>>>32-e;return t>32&&Log$3.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=e,this.bitsAvailable>0?this.word<<=e:this.bytesAvailable>0&&this.loadWord(),e=t-e,e>0?i<>>t))return this.word<<=t,this.bitsAvailable-=t,t;return this.loadWord(),t+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){let t=this.skipLZ();return this.readBits(t+1)-1}readEG(){let t=this.readUEG();return 1&t?1+t>>>1:-1*(t>>>1)}readBoolean(){return 1===this.readBits(1)}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}destroy(){}}const _e={0:1,1:2,2:1,3:6,4:5},Te=67;class Se{constructor(t={}){this.remuxer=t,this.track=t.mp4track||{},this.firstFound=!1,this.resetParams()}resetParams(){this.ifCheckPOC=!0,this.sps_id=-1,this.pps_id=-1,this.log2_max_frame_num=0,this.poc_type=0,this.log2_max_poc_lsb=0,this.frame_mbs_only_flag=0,this.poc_cycle_length=0,this.offset_for_non_ref_pic=0,this.offset_for_top_to_bottom_field=0,this.offset_for_ref_frame=[],this.delta_pic_order_always_zero_flag=0,this.chroma_format_idc=0,this.pic_order_present=0,this.redundant_pic_cnt_present=0,this.ref_count0=0,this.ref_count1=0,this.weighted_pred=0,this.weighted_bipred_idc=0,this.prev_frame_num_offset=0,this.prev_frame_num=0,this.prev_poc_lsb=0,this.prev_poc_msb=0}msToScaled(t){return(t-this.remuxer.timeOffset)*this.remuxer.scaleFactor}parseSPS(t){const e=this.readSPS(new Uint8Array(t));this.track.width=e.width,this.track.height=e.height,this.track.sps=[new Uint8Array(t)],this.track.codec="avc1.";let i=new DataView(t.buffer,t.byteOffset+1,4);for(let r=0;r<3;++r){let t=i.getUint8(r).toString(16);t.length<2&&(t="0"+t),this.track.codec+=t}}parsePPS(t){this.track.pps=[new Uint8Array(t)];let e=this.ebsp2rbsp(t),i=new be(e);i.readUByte(),this.pps_id=i.readUEG();let r=i.readUEG();r===this.sps_id?(i.readBits(1),this.pic_order_present=i.readBits(1),i.readUEG(),this.ref_count0=i.readUEG()+1,this.ref_count1=i.readUEG()+1,this.weighted_pred=i.readBits(1),this.weighted_bipred_idc=i.readBits(2),i.readEG(),i.readEG(),i.readEG(),i.readBits(1),i.readBits(1),this.redundant_pic_cnt_present=i.readBits(1)):this.ifCheckPOC=!1}parseNAL(t){if(!t)return!1;let e,i,r,n,s,a,o=null;switch(t.type()){case ye.NDR:case ye.IDR:t.sliceType=Se.parceSliceHeader(t.data),t.isKeyframe()&&!this.firstFound&&(this.firstFound=!0),o=!!this.firstFound;break;case ye.PPS:o=!1,this.track.pps||(this.parsePPS(t.getData().subarray(4)),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0));break;case ye.SPS:o=!1,this.firstFound||navigator.vendor.match(/apple/i)||navigator.platform.match(/linux/i)||(this.firstFound=!0,o=!0),this.track.sps||(this.parseSPS(t.getData().subarray(4)),!this.remuxer.readyToDecode&&this.track.pps&&this.track.sps&&(this.remuxer.readyToDecode=!0));break;case ye.SEI:o=!1,e=new DataView(t.data.buffer,t.data.byteOffset,t.data.byteLength),i=0,r=e.getUint8(i),++i,n=0,a=e.getUint8(i),++i;while(255===a)n+=a,a=e.getUint8(i),++i;n+=a,s=t.data.subarray(i,i+16),i+=16,console.log(`PT: ${r}, PS: ${n}, UUID: ${Array.from(s).map((function(t){return("0"+t.toString(16)).slice(-2)})).join("")}`);break;case ye.EOSEQ:case ye.EOSTR:o=!1;default:}return null===o&&t.getNri()>0&&(o=!0),o}static parceSliceHeader(t){let e=new be(t);e.readUEG();let i=e.readUEG();return e.readUEG(),e.readUByte(),i}static skipScalingList(t,e){let i,r=8,n=8;for(let s=0;s=2&&3===e[s]&&0===e[s-1]&&0===e[s-2]||(r[n]=e[s],n++);return new Uint8Array(r.buffer,0,n)}getPOC(t){if(!this.ifCheckPOC)return-2;let e=128;t.length<128&&(e=t.length);let i=this.ebsp2rbsp(t.subarray(0,e)),r=new be(i);r.readBits(1);let n=r.readBits(2),s=r.readBits(5);5===s&&(this.prev_frame_num=0,this.prev_frame_num_offset=0,this.prev_poc_msb=0,this.prev_poc_lsb=0);let a=r.readUEG();if(0!==a)return-2;let o=r.readUEG(),h=_e[o%5];if(2===h)return this.ifCheckPOC=!1,-2;let c=3&h,u=r.readUEG();if(u>=256)return-1;if(this.pps_id!==u)return-1;let l=r.readBits(this.log2_max_frame_num),d=3;if(!this.frame_mbs_only_flag){let t=r.readBits(1);t&&(d=1+r.readBits(1))}5===s&&r.readUEG();let f=0,p=0,g=0,m=0;0===this.poc_type?(f=r.readBits(this.log2_max_poc_lsb),3===d&&1===this.pic_order_present&&(m=r.readEG())):1!==this.poc_type||this.delta_pic_order_always_zero_flag||(p=r.readEG(),1===this.pic_order_present&&3===d&&(g=r.readEG()));let v=1<=t/2?this.prev_poc_msb+t:f>this.prev_poc_lsb&&this.prev_poc_lsb-f<-t/2?this.prev_poc_msb-t:this.prev_poc_msb,y=b=T+f,3===d&&(b+=m)}else if(1===this.poc_type){let t,e,i,r;for(t=0!==this.poc_cycle_length?_+l:0,0===n&&t>0&&t--,e=0,r=0;r0&&this.poc_cycle_length>0){let n=(t-1)/this.poc_cycle_length,s=(t-1)%this.poc_cycle_length;for(i=n*e,r=0;r<=s;r++){if(this.offset_for_ref_frame.length<=r)return-1;i+=this.offset_for_ref_frame[r]}}else i=0;0===n&&(i+=this.offset_for_non_ref_pic),y=i+p,b=y+this.offset_for_top_to_bottom_field,3===d&&(b+=g)}else{let t=2*(_+l);n||t--,y=t,b=t}let S=2147483647,w=2147483647;2!==d&&(S=y),1!==d&&(w=b);let E=S;S>w&&(E=w);let x=0;if(n&&5!==s){this.redundant_pic_cnt_present&&r.readUEG(),3===c&&r.readBits(1);let t=0,e=0,i=0;if(1!==c){let n,s;t=this.ref_count0,e=this.ref_count1,n=s=3===d?15:31;let a=r.readBits(1);if(a&&(t=r.readUEG()+1,e=3===c?r.readUEG()+1:1),i=3===c?2:1,t-1>n||2==i&&e-1>s)return-1;e-1>s&&(e=0);for(let o=0;o3)return-1;break}if(r.readUEG(),0===i&&i>=t)return-1;if(1===i&&i>=e)return-1}}}if(this.weighted_pred&&2===c||1==this.weighted_bipred_idc&&3===c){let i,n;for(r.readUEG(),this.chroma_format_idc&&r.readUEG(),i=0;i<2;i++){let s=0===i?t:e;for(n=0;n=128||e>=128)return-1}if(this.chroma_format_idc&&(t=r.readBits(1),t)){let t;for(t=0;t<2;t++){let t=r.readEG(),e=r.readEG();if(t>=128||e>=128)return-1}}}if(3!==c)break}}let n=r.readBits(1);if(n){let t;for(t=0;t6)return-1;if(0===t){x=0;break}if(5===t){x=1;break}1!==t&&3!==t||r.readUEG(),3!==t&&2!==t&&6!==t&&4!==t||r.readUEG()}}}return this.prev_frame_num_offset=x?0:_,this.prev_frame_num=x?0:l,0!==n&&(x?(this.prev_poc_msb=0,this.prev_poc_lsb=2===d?0:y):(this.prev_poc_msb=T,this.prev_poc_lsb=f)),E}}class we{constructor(t={}){this.remuxer=t,this.track=t.mp4track||{},this.resetParams()}resetParams(){this.vps_id=-1,this.sps_id=-1,this.pps_id=-1,this.ifCheckPOC=!0,this.separate_colour_plane_flag=0,this.log2_max_pic_order_cnt_lsb=0,this.output_flag_present_flag=0,this.num_extra_slice_header_bits=0,this.pocTid0=0}parseVPS(t){this.vps_id=(240&t[3])>>4}parseSPS(t){const e=this.readSPS(t);this.track={width:e.codec_size.width,height:e.codec_size.height,codec:`hvc1.${e.profile_idc}.1.L${e.level_idc}.B0`}}readSPS(t){let e=this.ebsp2rbsp(t),i=new be(e),r={};i.readBits(16);i.readBits(4);let n=i.readBits(3);i.readBits(1),this._hvcc_parse_ptl(i,r,n),this.sps_id=i.readUEG(),this.separate_colour_plane_flag=0;let s=i.readUEG();3==s&&(this.separate_colour_plane_flag=i.readBits(1)),r.sar_width=r.sar_height=1,r.conf_win_left_offset=r.conf_win_right_offset=r.conf_win_top_offset=r.conf_win_bottom_offset=0,r.def_disp_win_left_offset=r.def_disp_win_right_offset=r.def_disp_win_top_offset=r.def_disp_win_bottom_offset=0;let a=i.readUEG(),o=i.readUEG(),h=0,c=0,u=0,l=0,d=i.readBits(1);d&&(r.conf_win_left_offset=i.readUEG(),r.conf_win_right_offset=i.readUEG(),r.conf_win_top_offset=i.readUEG(),r.conf_win_bottom_offset=i.readUEG(),1===r.default_display_window_flag&&(h=r.conf_win_left_offset+r.def_disp_win_left_offset,c=r.conf_win_right_offset+r.def_disp_win_right_offset,u=r.conf_win_top_offset+r.def_disp_win_top_offset,l=r.conf_win_bottom_offset+r.def_disp_win_bottom_offset));let f=i.readUEG()+8;i.readUEG(),this.log2_max_pic_order_cnt_lsb=i.readUEG()+4;let p=i.readBits(1)?0:n;for(;p<=n;p++)this._skip_sub_layer_ordering_info(i);i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readUEG(),i.readBits(1)&&i.readBits(1)&&this._skip_scaling_list_data(i),i.readBits(1),i.readBits(1),i.readBits(1)&&(i.readBits(4),i.readBits(4),i.readUEG(),i.readUEG(),i.readBits(1));let g=[],m=i.readUEG();for(let A=0;A32){let e=t/32,r=t%32;for(let t=0;t=64)return void(this.ifCheckPOC=!1);let r=i.readUEG();r>=16?this.ifCheckPOC=!1:this.sps_id===r?(i.readBits(1),this.output_flag_present_flag=i.readBits(1),this.num_extra_slice_header_bits=i.readBits(3)):this.ifCheckPOC=!1}ebsp2rbsp(t){let e=t,i=e.byteLength,r=new Uint8Array(i),n=0;for(let s=0;s=2&&3===e[s]&&0===e[s-1]&&0===e[s-2]||(r[n]=e[s],n++);return new Uint8Array(r.buffer,0,n)}_hvcc_parse_ptl(t,e,i){t.readBits(2);let r=t.readBits(1),n=t.readBits(5);t.readBits(32),t.readBits(32),t.readBits(16);let s=t.readByte();void 0===e.tier_flag||void 0===e.level_idc||e.tier_flag0)for(let h=i;h<8;h++)t.readBits(2);for(let h=0;h=i)return-1;t.readBits(1),t.readUEG(),r[e]=0;for(let i=0;i<=r[e-1];i++){let i=0,n=t.readBits(1);n||(i=t.readBits(1)),(n||i)&&r[e]++}}else{let i=t.readUEG(),n=t.readUEG();r[e]=i+n;for(let e=0;e0&&(e.fps=e.fps_num/e.fps_den);let i=0;t.readBits(1)&&(i=t.readUEG(),i>=0&&(e.fps/=i+1))}_skip_hrd_parameters(t,e,i,r){let n=0,s=0,a=0;if(i&&(s=t.readBits(1),a=t.readBits(1),s||a)){let e=t.readBits(1);e&&t.readBits(19),t.readByte(),e&&t.readBits(4),t.readBits(15)}for(let o=0;o<=r;o++){let i=0,r=0,o=0,h=t.readBits(1);e.fps_fixed=h,h||(o=t.readBits(1)),o?t.readUEG():r=t.readBits(1),r||(i=t.readUEG(t)),s&&this._skip_sub_layer_hrd_parameters(t,i,n),a&&this._skip_sub_layer_hrd_parameters(t,i,n)}}_skip_sub_layer_hrd_parameters(t,e,i){for(let r=0;r<=e;r++)t.readUEG(),t.readUEG(),i&&(t.readUEG(),t.readUEG()),t.readBits(1)}getProfileString(t){switch(t){case 1:return"Main";case 2:return"Main10";case 3:return"MainSP";case 4:return"Rext";case 9:return"SCC";default:return"Unknown"}}getLevelString(t){return(t/30).toFixed(1)}getChromaFormatString(t){switch(t){case 0:return"4:0:0";case 1:return"4:2:0";case 2:return"4:2:2";case 3:return"4:4:4";default:return"Unknown"}}getPOC(t){if(!this.ifCheckPOC)return-2;let e=128;t.length<128&&(e=t.length);let i=this.ebsp2rbsp(t.subarray(0,e)),r=new be(i);r.readBits(1);let n=r.readBits(6);r.readBits(6);let s=r.readBits(3)-1,a=r.readBits(1);if(!a)return-2;n>=16&&n<=23&&r.readBits(1);let o=r.readUEG();if(o>=64||o!==this.pps_id)return-1;this.num_extra_slice_header_bits>=0&&r.readBits(this.num_extra_slice_header_bits);let h=r.readUEG();if(0===h)return this.ifCheckPOC=!1,-2;if(2!==h&&1!==h&&0!==h)return-1;this.output_flag_present_flag&&r.readBits(1),this.separate_colour_plane_flag&&r.readBits(2);let c=0,u=0;if(19!==n&&20!==n){u=r.readBits(this.log2_max_pic_order_cnt_lsb);let t=1<=t/2?i+t:u>e&&u-e>t/2?i-t:i,16!==n&&17!==n&&18!==n||(s=0),c=s+u}return 0===s&&0!==n&&2!==n&&4!==n&&6!==n&&8!==n&&7!==n&&9!==n&&(this.pocTid0=c),c}}const Ee=100;class xe{static get isSupported(){return!(!window.AudioContext&&!window.webkitAudioContext)}constructor(t){this.channels=t.channels||1,this.audioCtx=new(window.AudioContext||window.webkitAudioContext),this.gainNode=this.audioCtx.createGain(),this.volume=t.volume||0,this.gainNode.gain.value=(this.volume/100).toFixed(2),this.gainNode.connect(this.audioCtx.destination),this.startTime=this.audioCtx.currentTime,this.sampleQueue=[],this.playingList=[]}static shortToFloatData(t){let e=t.length,i=new Float32Array(e);for(let r=0;r!=e;++r)i[r]=t[r]/32768;return i}play(t,e,i){let r=xe.shortToFloatData(t);this.feed(r,e,i)}addData(t,e,i){let r=xe.shortToFloatData(t);this.appendData(r,e,i)}setVolume(t){this.volume=t,this.gainNode.gain.value=(t/100).toFixed(2)}setFakeSlience(){this.gainNode.gain.value=0}getVolume(){return this.volume}pause(){"running"===this.audioCtx.state&&this.audioCtx.suspend()}resume(){"suspended"===this.audioCtx.state&&this.audioCtx.resume()}playing(){return"running"===this.audioCtx.state&&this.playingList.length>0}ifPlayListFull(){return this.playingList.length>8}getCacheDuration(){let t=0;for(let e in this.playingList)t+=this.playingList[e].duration,0===e&&(t-=1e3*(this.audioCtx.currentTime-this.playingList[0].startTime));return t}close(){this.audioCtx&&(this.audioCtx.close(),this.audioCtx=null),this.sampleQueue=[]}getTimestamp(){return this.playingList.length>0?this.playingList[0].timestamp+1e3*(this.audioCtx.currentTime-this.playingList[0].startTime):0}appendData(t,e,i){let r=1e3*t.length/(i*this.channels);if(this.sampleQueue.length>0&&this.sampleQueue[0].samplerate===i&&this.sampleQueue[0].duration0){if(1===this.sampleQueue.length&&this.sampleQueue[0].duration=i-51&&(e[r]=e[r]*a--/50),n+=this.channels}e.buffer=r,e.onended=()=>{this.playingList.length>0&&this.playingList.shift(),this.flush()},e.connect(this.gainNode),this.startTime{Oe[t]=Oe.errorTypes[t],Oe.prototype[t]=Oe.errorTypes[t]});var Me=Oe;const Ne="ORIGIN",Be="FISHEYE_CYLINDER",Le="FISHEYE_360D",Ue="FISHEYE_180D",ze="FISHEYE_LONGITUDE",Fe="FISHEYE_LATITUDE",We="FISHEYE_CALIB",He="FISHEYE_WIN_PLANE_TOP_QUAD",je="FISHEYE_WIN_PLANE_TOP",Ve="FISHEYE_WIN_PLANE_WALL",qe="YUV_FRAME",Ge="VIDEO_FRAME",Ye=(Math.PI,1),$e=(Math.PI,Math.PI,Math.PI,.002),Xe=[1,1,0,-1,1,0,1,-1,0,-1,-1,0],Qe=[1,0,0,0,1,1,0,1],Ke=Math.PI/2,Ze=1,Je=-.9,ti=[0,Math.PI/2,Math.PI,3*Math.PI/2],ei=.8,ii=.4,ri=0,ni=0,si=Ye,ai=Ye,oi=0,hi=1,ci=["attribute highp vec4 aVertexPosition;","attribute vec2 aTextureCoord;","varying highp vec2 vTextureCoord;","void main(void) {","gl_Position = aVertexPosition;","vTextureCoord = aTextureCoord;","}"].join("\n"),ui=["precision highp float;","varying lowp vec2 vTextureCoord;"].join("\n"),li=["uniform sampler2D YTexture;","uniform sampler2D UTexture;","uniform sampler2D VTexture;"].join("\n"),di="uniform sampler2D videoTexture;\n",fi="uniform float fAngle;\n",pi=["uniform float fAngle;","uniform float unfoldPara;","uniform float heightOverWidthOfScreen;"].join("\n"),gi=["uniform float heightOverWidthOfVideo;","uniform float unfoldPara;","uniform int projMode;","uniform float coefficient;"].join("\n"),mi=["uniform float heightOverWidthOfVideo;","uniform float unfoldPara;","uniform int projMode;","uniform float coefficient;"].join("\n"),vi=["uniform float alpha;","uniform float beta;","uniform float sizeOverPointZ;","uniform float viewPointZ;","uniform float heightOverWidthOfScreen;","uniform float heightOverWidthOfVideo;","uniform int projMode;","uniform float coefficient;"].join("\n"),yi=["uniform float hazermA;","uniform int hazermWidth;","uniform int hazermHeight;"].join("\n"),bi=["vec2 cylinder(in vec2 tc, in float fAngle, in float unfoldPara, in float heightOverWidthOfScreen){","vec2 tcOut = vec2(-1.0, -1.0);","float fInclineAngle = 0.18 * (2.0 - unfoldPara);","float x1 = (tc.x - (1.0 - heightOverWidthOfScreen * unfoldPara * (0.6 * unfoldPara + 0.4)) / 2.0) / (heightOverWidthOfScreen * unfoldPara * (0.6 * unfoldPara + 0.4));","float y1 = 1.0 - tc.y;","float x2, y2;","float x3, y3;","if(y1 >= fInclineAngle + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && y1 <= (1.0- fInclineAngle) + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && ((x1>=0.0 && x1<=(1.0/unfoldPara-0.5)) || (x1 >=(1.5-1.0/unfoldPara) && x1<=1.0))){","x2 = x1;","y2 = (y1 - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle - fInclineAngle) / (1.0 - 2.0 * fInclineAngle);","if(x2 < (1.0 / unfoldPara - 0.5)){","x3 = 0.0 - ((asin((x2 - (1.0 / unfoldPara - 0.5)) / (1.0 / unfoldPara - 0.5)) * 2.0 / 3.1415926) * (1.0 - 0.5 * unfoldPara) / 2.0);","y3 = y2;","}else{","x3 = 1.0 - (asin((x2 - (1.5 - 1.0 / unfoldPara)) / (1.0 / unfoldPara - 0.5)) * 2.0 / 3.1415926) * (1.0 - 0.5 * unfoldPara) / 2.0;","y3 = y2;","}","tcOut.x = (1.0 + (y3 * 0.8 + 0.2) * cos(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","tcOut.y = (1.0 + (y3 * 0.8 + 0.2) * sin(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","}","if(y1 >= fInclineAngle - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && y1 <= (1.0- fInclineAngle) - sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle && x1>=0.0 && x1<=1.0){","x2 = x1;","y2 = (y1 + sqrt(x1 - x1 * x1) * 2.0 * fInclineAngle - fInclineAngle) / (1.0 - 2.0 * fInclineAngle);","x3 = (asin((x2 - 0.5) / 0.5) * 2.0 / 3.1415926 * 0.25 * unfoldPara + 0.5) * (2.0 - unfoldPara) + x2 * (unfoldPara - 1.0);","y3 = y2;","tcOut.x = (1.0 + (y3 * 0.8 + 0.2) * cos(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","tcOut.y = (1.0 + (y3 * 0.8 + 0.2) * sin(x3 * 2.0 * 3.1415926 + fAngle)) / 2.0;","}","return tcOut;","}"].join("\n"),_i=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos(tc.x * 2.0 * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin(tc.x * 2.0 * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),Ti=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos(tc.x * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin(tc.x * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),Si=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","tcOut.x = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * cos((tc.x / 2.0 + 0.5) * 2.0 * 3.1415926 + fAngle);","tcOut.y = 0.5 + (1.0 - tc.y * 0.8) / 2.0 * sin((tc.x / 2.0 + 0.5) * 2.0 * 3.1415926 + fAngle);","return tcOut;","}"].join("\n"),wi=["vec2 longitude(in vec2 tc, in float heightOverWidthOfVideo, in float unfoldPara, in int projMode, in float coefficient){","vec2 tcOut;","float cutFactor;","if (heightOverWidthOfVideo > 0.75)","cutFactor = 0.5 - 0.5 * 9.0 / 16.0 / heightOverWidthOfVideo;","else","cutFactor = 0.05 / heightOverWidthOfVideo;","cutFactor = unfoldPara*cutFactor;","tc.y = (1.0-2.0*cutFactor)*tc.y+cutFactor;","tc.y = tc.y * heightOverWidthOfVideo + 0.5 - 0.5 * heightOverWidthOfVideo;","tcOut.x = 0.5 + (tc.x - 0.5) * sqrt(0.25 - (tc.y - 0.5)*(tc.y-0.5)*(1.0+(unfoldPara-1.0)*(unfoldPara-1.0)*(unfoldPara-1.0)))/0.5;","tcOut.y = tc.y;","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / heightOverWidthOfVideo;","tcOut = winplane(tcOut, 0.0, 0.0, 2.0, 1.0, heightOverWidthOfVideo, heightOverWidthOfVideo, projMode, coefficient);","return tcOut;","}"].join("\n"),Ei=["vec2 latitude(in vec2 tc, in float heightOverWidthOfVideo, in float unfoldPara, in int projMode, in float coefficient){","vec2 tcOut;","float cutFactor;","if (heightOverWidthOfVideo < 1.33)","cutFactor = 0.5 - 0.5 * 9.0 / 16.0 * heightOverWidthOfVideo;","else","cutFactor = 0.05 * heightOverWidthOfVideo;","cutFactor = unfoldPara*cutFactor;","tc.x = (1.0-2.0*cutFactor)*tc.x+cutFactor;","tc.x = tc.x / heightOverWidthOfVideo + 0.5 - 0.5 / heightOverWidthOfVideo;","tcOut.y = 0.5 + (tc.y - 0.5) * sqrt(0.25 - (tc.x - 0.5)*(tc.x-0.5)*(1.0+(unfoldPara-1.0)*(unfoldPara-1.0)*(unfoldPara-1.0)))/0.5;","tcOut.x = tc.x;","tcOut.x = (tcOut.x - 0.5 + 0.5 / heightOverWidthOfVideo) * heightOverWidthOfVideo;","tcOut = winplane(tcOut, 0.0, 0.0, 2.0, 1.0, heightOverWidthOfVideo, heightOverWidthOfVideo, projMode, coefficient);","return tcOut;","}"].join("\n"),xi=["vec2 fishEye(in vec2 tc, in float fAngle){","vec2 tcOut;","float fFactorx = 1.2;","float fFactory = 1.2;","float fFocalx = 0.331095;","float fCenterx = 0.538893;","float fFocaly = 0.331699;","float fCentery = 0.476102;","float fK1 = -0.00712683;","float fK2 = -0.00954012;","float fK3 = 0.00416203;","float fK4 = -0.00246566;","float fCamx = (tc.x - fCenterx) / fFocalx;","float fCamy = (tc.y - fCentery) / fFocaly;","if(fCamx * fCamx + fCamy * fCamy < 0.0001){","tcOut.x = fFactorx * (tc.x - fCenterx) + fCenterx;","tcOut.y = fFactory * (tc.y - fCentery) + fCentery;","return tcOut;","}","float fTheta = atan(sqrt(fCamx * fCamx + fCamy * fCamy));","float fThetad = fTheta + fK1 * fTheta * fTheta * fTheta;","fThetad += fK2 * fTheta * fTheta * fTheta * fTheta * fTheta;","fThetad += fK3 * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta;","fThetad += fK4 * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta * fTheta;","float fCameraX = fThetad * fCamx / sqrt(fCamx * fCamx + fCamy * fCamy);","float fCameraY = fThetad * fCamy / sqrt(fCamx * fCamx + fCamy * fCamy);","tcOut.x = fCameraX * fFocalx * fFactorx + fCenterx;","tcOut.y = fCameraY * fFocaly * fFactory + fCentery;","return tcOut;","}"].join("\n"),Ai=["vec2 winplane(in vec2 tc, in float alpha, in float beta, in float sizeOverPointZ,in float viewPointZ,in float heightOverWidthOfScreen, in float heightOverWidthOfVideo, in int projMode, in float coefficient) {","vec2 tcOut = vec2(-1.0, -1.0);","int boxingMode = 0;","int baseOnHeight = 1;","if (boxingMode == 0){","if (heightOverWidthOfScreen > heightOverWidthOfVideo)","baseOnHeight = 0;","}","else if (boxingMode == 2) {","baseOnHeight = 0;","}","float x1, y1;","if (baseOnHeight == 1) {","x1=(tc.x-0.5)*sizeOverPointZ*heightOverWidthOfVideo/heightOverWidthOfScreen;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfVideo;","}","else {","x1=(tc.x-0.5)*sizeOverPointZ;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfScreen;","}","float a,b,c,delta,t,fTmp;","a=x1*x1+y1*y1+1.0;","c=1.0-1.0/(viewPointZ*viewPointZ);","delta = 1.0 - a * c;","if(delta >= 0.0){","float x2,y2,z2;","t= (1.0 + sqrt(delta)) / a;","x2 = t * x1;","y2 = t * y1;","z2 = (1.0 - t);","float x3,y3,z3,x4,y4,z4;","x3 = x2;","y3 = y2 * cos(alpha) - z2 * sin(alpha);","z3 = y2 * sin(alpha) + z2 * cos(alpha);","x4 = x3 * cos(beta) - y3 * sin(beta);","y4 = x3 * sin(beta) + y3 * cos(beta);","z4 = z3;","if(z4<0.0){","float s,t,fSinThita,fThita,x5,y5;","s=x4*x4+y4*y4;","fSinThita=sqrt(s);","fThita=asin(fSinThita*viewPointZ);","x5 = x4 / fSinThita;","y5 = y4 / fSinThita;","if (projMode == 0) ","t = 0.63662 * fThita;","else if (projMode == 1)","t = sin(fThita);","else if (projMode == 2)","t = sqrt(2.0) * sin(fThita / 2.0);","else if (projMode == 3)","t = tan(fThita / 2.0);","else if (projMode == 4)","t = 0.63662 * fThita * coefficient + tan(fThita / 2.0) * (1.0 - coefficient);","else if (projMode == 5)","t = 0.63662 * fThita * coefficient + sin(fThita) * (1.0 - coefficient);","else ","t = 0.63662 * fThita;","x5 = t*x5;","y5 = t*y5;","tcOut.x=(x5+1.0)/2.0;","tcOut.y=(y5+1.0)/2.0;","if(tcOut.y < 0.5 - 0.5 * heightOverWidthOfVideo || tcOut.y > 0.5 + 0.5 * heightOverWidthOfVideo)","{","tcOut.x = -1.0;","tcOut.y = -1.0;","}","else","{","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / (heightOverWidthOfVideo);","}","}","}","return tcOut;","}"].join("\n"),Ci=["vec2 winplane(in vec2 tc, in float alpha, in float beta, in float sizeOverPointZ,in float viewPointZ,in float heightOverWidthOfScreen, in float heightOverWidthOfVideo, in int projMode, in float coefficient) {","vec2 tcOut = vec2(-1.0, -1.0);","int boxingMode = 0;","int baseOnHeight = 1;","if (boxingMode == 0){","if (heightOverWidthOfScreen > heightOverWidthOfVideo)","baseOnHeight = 0;","}","else if (boxingMode == 2) {","baseOnHeight = 0;","}","float x1, y1;","if (baseOnHeight == 1) {","x1=(tc.x-0.5)*sizeOverPointZ*heightOverWidthOfVideo/heightOverWidthOfScreen;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfVideo;","}","else {","x1=(tc.x-0.5)*sizeOverPointZ;","y1=(tc.y-0.5)*sizeOverPointZ*heightOverWidthOfScreen;","}","float a,b,c,delta,t,fTmp;","a=x1*x1+y1*y1+1.0;","c=1.0-1.0/(viewPointZ*viewPointZ);","delta = 1.0 - a * c;","if(delta >= 0.0){","float x2,y2,z2;","t= (1.0 + sqrt(delta)) / a;","x2 = t * x1;","y2 = t * y1;","z2 = (1.0 - t);","float x3,y3,z3,x4,y4,z4;","x3 = x2;","y3 = y2 * cos(alpha) - z2 * sin(alpha);","z3 = y2 * sin(alpha) + z2 * cos(alpha);","x4 = x3 * cos(beta) - z3 * sin(beta);","y4 = y3;","z4 = x3 * sin(beta) + z3 * cos(beta);","if(z4<0.0){","float s,t,fSinThita,fThita,x5,y5;","s=x4*x4+y4*y4;","fSinThita=sqrt(s);","fThita=asin(fSinThita*viewPointZ);","x5 = x4 / fSinThita;","y5 = y4 / fSinThita;","if (projMode == 0) ","t = 0.63662 * fThita;","else if (projMode == 1)","t = sin(fThita);","else if (projMode == 2)","t = sqrt(2.0) * sin(fThita / 2.0);","else if (projMode == 3)","t = tan(fThita / 2.0);","else if (projMode == 4)","t = 0.63662 * fThita * coefficient + tan(fThita / 2.0) * (1.0 - coefficient);","else if (projMode == 5)","t = 0.63662 * fThita * coefficient + sin(fThita) * (1.0 - coefficient);","else ","t = 0.63662 * fThita;","x5 = t*x5;","y5 = t*y5;","tcOut.x=(x5+1.0)/2.0;","tcOut.y=(y5+1.0)/2.0;","if(tcOut.y < 0.5 - 0.5 * heightOverWidthOfVideo || tcOut.y > 0.5 + 0.5 * heightOverWidthOfVideo)","{","tcOut.x = -1.0;","tcOut.y = -1.0;","}","else","{","tcOut.y = (tcOut.y - 0.5 + 0.5 * heightOverWidthOfVideo) / (heightOverWidthOfVideo);","}","}","}","return tcOut;","}"].join("\n"),Ri=["const mat4 YUV2RGB = mat4","("," 1, 0, 1.5748, -0.7874,"," 1, -0.1868, -0.4680, 0.3274,"," 1, 1.856, 0, -0.928,"," 0, 0, 0, 1",");"].join("\n"),Pi=["void main() {","vec2 tc = vTextureCoord;"].join("\n"),Ii="tc.y = 1.0 - tc.y;\n",ki="tc.x = 1.0 - tc.x;\n",Di="tc = dewrap(tc);\n",Oi="tc = fishEye(tc, fAngle);\n",Mi="tc = cylinder(tc, fAngle, unfoldPara + 1.0, heightOverWidthOfScreen);\n",Ni="tc = longitude(tc, heightOverWidthOfVideo, unfoldPara, projMode, coefficient);\n",Bi="tc = latitude(tc, heightOverWidthOfVideo, unfoldPara, projMode, coefficient);\n",Li="tc = winplane(tc, alpha, beta, sizeOverPointZ, viewPointZ, heightOverWidthOfScreen, heightOverWidthOfVideo, projMode, coefficient);\n",Ui=["vec3 yuv;","yuv.x = texture2D(YTexture, tc).x;","yuv.y = texture2D(UTexture, tc).x;","yuv.z = texture2D(VTexture, tc).x;"].join("\n"),zi=["vec2 tc1;","float stepW = 1.0 / float(hazermWidth);","float stepH = 1.0 / float(hazermHeight);","int x,y;","float tx;","float tMin = 0.15;","float sqr_tMin_minus_half = (tMin - 0.5) * (tMin - 0.5);","int winSize= 5;","float sumY = 0.0;","float scaleConMax = 2.0;","float scaleSatMax = 3.0;","float scaleCon;","float scaleSat;","if (hazermA > 0.0) {","tx = ((0.5 - tMin) * 9.0 * pow(yuv.x - hazermA, 2.0) / (hazermA * hazermA) + tMin);","tx = min(1.0, tx);","tx *= pow(abs(yuv.y) + abs(yuv.z), 2.0) / 0.03125 + 0.5;","tx = clamp(tx, tMin, 1.0);","for (y = -winSize / 2; y <= winSize / 2; y++) {","for (x = -winSize / 2; x <= winSize / 2; x++) {","tc1 = tc + vec2(float(x) * stepW, float(y) * stepH);","sumY += texture2D(YTexture, tc1).x;","}}","scaleCon = scaleConMax * (1.0 - pow(tx - 0.5, 2.0) / sqr_tMin_minus_half);","scaleCon = max(0.0, scaleCon);","yuv.x = yuv.x + (yuv.x - sumY / float(winSize * winSize)) * scaleCon;","yuv.x = clamp(yuv.x, 0.0, 1.0);","scaleSat = scaleSatMax + (1.0 - scaleSatMax) * pow(tx - 0.5, 2.0) / sqr_tMin_minus_half;","scaleSat = max(1.0, scaleSat);","yuv.y *= scaleSat;","yuv.z *= scaleSat;","yuv.y = clamp(yuv.y, -0.5, 0.5);","yuv.z = clamp(yuv.z, -0.5, 0.5);","}"].join("\n"),Fi="gl_FragColor = vec4(yuv, 1) * YUV2RGB;\n",Wi="gl_FragColor = texture2D(videoTexture, tc);\n",Hi=t=>["mediump vec2 dewarp(in vec2 tc){",`mediump vec4 k = vec4(${t.fK1},${t.fK2},${t.fK3},${t.fK4});`,`mediump vec2 center1 = vec2(${t.fCenter1x},${t.fCenter1y});`,`mediump vec2 focal1 = vec2(${t.fFocal1x},${t.fFocal1y});`,`mediump vec2 center2 = vec2(${t.fCenter2x},${t.fCenter2y});`,`mediump vec2 focal2 = vec2(${t.fFocal2x},${t.fFocal2y});`,"mediump vec2 tc1 = (tc - center2) / focal2;","float r = sqrt(dot(tc1, tc1));","float theta = atan(r);","float theta2 = theta * theta;","float theta4 = theta2 * theta2;","float theta6 = theta4 * theta2;","float theta8 = theta4 * theta4;","float theta_d = theta * (1.0 + k.x * theta2 + k.y * theta4 + k.z * theta6 + k.w * theta8);","float scale = 1.0;","if (r > 0.0001) scale = theta_d / r;","mediump vec2 tc2 = scale * focal1 * tc1 + center1;","return tc2;","}"].join("\n"),ji="}";class Vi{constructor(t,e){this.gl=t,this.options=e,this.programHandle=null,this.vertexPositionHandle=-1,this.textureCoordsHandle=-1,this.vertextAttribNeedUpdate=0,this.heightOverWidthOfScreenHandle=null,this.heightOverWidthOfScreenNeedUpdate=0,this.fAngleHandle=null,this.fishEyeAngleNeedUpdate=0,this.unfoldParaHandle=null,this.unfoldParaNeedUpdate=0,this.heightOverWidthOfVideoHandle=null,this.fishEyeHeightOverWidthOfVideoNeedUpdate=0,this.winPlaneAlphaHandle=null,this.winPlaneBetaHandle=null,this.winPlaneSizeOverPointZHandle=null,this.winPlaneViewPointZHandle=null,this.winPlaneProjModeHandle=null,this.winPlaneCoefficientHandle=null,this.fishEyeWinPlaneParamsNeedUpdate=0}initProgram(){this.vertextAttribNeedUpdate=1,this.heightOverWidthOfScreenNeedUpdate=1,this.fishEyeAngleNeedUpdate=1,this.unfoldParaNeedUpdate=1,this.fishEyeHeightOverWidthOfVideoNeedUpdate=1,this.fishEyeWinPlaneParamsNeedUpdate=1;let{programIndex:t=0}=this.options,e=this.getVertexShaderSource(),i=this.getFragmentShaderSource(t);this.programHandle=this.createProgram(e,i),this.getBaseHandles()}getVertexShaderSource(){return ci}getFragmentShaderSource(t=0){let{options:e}=this,[i,r,n,s,a,o,h,c,u,l,d,f,p,g,m]=[...new Array(15).fill("")];switch(e.verticalMirror&&(r=Ii),e.horizontalMirror&&(n=ki),e.dewarp&&(s=Hi(e.dewarpParameter),a=Di),e.displayMode){case Be:u=bi,h=pi,l=Mi;break;case Le:u=_i;break;case Ue:u=0==t?Ti:Si;break;case ze:case Fe:c=Ci,e.displayMode==ze?(u=wi,h=gi,l=Ni):(u=Ei,d=mi,l=Bi);break;case We:u=xi;break;case He:case je:u=Ai,h=vi,l=Li;break;case Ve:u=Ci,h=vi,l=Li;break;case Ne:default:break}""!==u&&(h=h||fi,l=l||Oi),e.hazerm&&(d=yi,f=zi),e.frameType===qe?(i=li,p=Ri,g=Ui,m=Fi):(i=di,m=Wi);let v=[ui,i,h,d,s,o,c,u,p,Pi,r,n,a,l,g,f,m,ji].filter(t=>!!t).join("\n");return v}createProgram(t,e){let{gl:i}=this;const r=i.createProgram(),n=this.loadShader(i.VERTEX_SHADER,t),s=this.loadShader(i.FRAGMENT_SHADER,e);return i.attachShader(r,n),i.attachShader(r,s),i.linkProgram(r),i.useProgram(r),r}loadShader(t,e){let{gl:i}=this;const r=i.createShader(t);return i.shaderSource(r,e),i.compileShader(r),i.getShaderParameter(r,i.COMPILE_STATUS)?r:(console.log("An error occurred compiling the shaders: "+i.getShaderInfoLog(r)),i.deleteShader(r),null)}getBaseHandles(){let{gl:t,programHandle:e}=this;this.vertexPositionHandle=t.getAttribLocation(e,"aVertexPosition"),this.textureCoordsHandle=t.getAttribLocation(e,"aTextureCoord"),this.heightOverWidthOfScreenHandle=t.getUniformLocation(e,"heightOverWidthOfScreen"),this.heightOverWidthOfVideoHandle=t.getUniformLocation(e,"heightOverWidthOfVideo"),this.fAngleHandle=t.getUniformLocation(e,"fAngle"),this.unfoldParaHandle=t.getUniformLocation(e,"unfoldPara"),this.winPlaneAlphaHandle=t.getUniformLocation(e,"alpha"),this.winPlaneBetaHandle=t.getUniformLocation(e,"beta"),this.winPlaneSizeOverPointZHandle=t.getUniformLocation(e,"sizeOverPointZ"),this.winPlaneViewPointZHandle=t.getUniformLocation(e,"viewPointZ"),this.winPlaneProjModeHandle=t.getUniformLocation(e,"projMode"),this.winPlaneCoefficientHandle=t.getUniformLocation(e,"coefficient")}setVertexAttribData(t,e,i){let{gl:r}=this,n=r.createBuffer();return r.bindBuffer(r.ARRAY_BUFFER,n),r.bufferData(r.ARRAY_BUFFER,new Float32Array(e),r.STATIC_DRAW),r.vertexAttribPointer(t,i,r.FLOAT,!1,0,0),r.enableVertexAttribArray(t),n}deleteProgram(){this.programHandle&&(this.gl.deleteProgram(this.programHandle),this.programHandle=void 0)}}const qi={vertexPosition:Xe,textureCoord:Qe,fAngle:Ke,fUnfoldPara:Ze,fWinPlaneAlpha:ri,fWinPlaneBeta:ni,fWinPlaneSizeOverPointZ:si,fWinPlaneViewPointZ:ai,fWinPlaneProjMode:oi,fWinPlaneCoefficient:hi};class Gi{constructor(t){this.gl=t,this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE)}bind(t,e,i){let r=this.gl;r.activeTexture([r.TEXTURE0,r.TEXTURE1,r.TEXTURE2][t]),r.bindTexture(r.TEXTURE_2D,this.texture),r.uniform1i(r.getUniformLocation(e,i),t)}fill(t,e,i,r){let n=this.gl;n.bindTexture(n.TEXTURE_2D,this.texture),r===Ge?n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,i):n.texImage2D(n.TEXTURE_2D,0,n.LUMINANCE,t,e,0,n.LUMINANCE,n.UNSIGNED_BYTE,i)}delete(){this.gl.deleteTexture(this.texture)}}class Yi{constructor(t,e){this.canvas=t,this.gl=t.getContext("webgl",{preserveDrawingBuffer:e.preserveDrawingBuffer}),this.programNum=1,this.glPrograms=[],this.zoomBeans=[],this.fDisplayRatio=1,this.fVerticalOffset=0,this.fScreenRatio=1,this.fVideoRatio=1,this.displayMode=e.displayMode||Ne,this.frameType=e.frameType||this.frameType,this.initGL()}initGL(){if(!this.gl)return void console.log("[ER] WebGL not supported.");switch(this.displayMode){case Ue:this.programNum=2;break;case He:this.programNum=4;break;default:this.programNum=1;break}let t=this.gl;t.pixelStorei(t.UNPACK_ALIGNMENT,1);for(let e=0;e0&&(this.maxTextureSize{let u=o[c];s.useProgram(h.programHandle),h.vertextAttribNeedUpdate?(h.vBuffer=h.setVertexAttribData(h.vertexPositionHandle,u.vertexPosition,3),h.fBuffer=h.setVertexAttribData(h.textureCoordsHandle,u.textureCoord,2),h.vertextAttribNeedUpdate=0):a.length>1&&(s.bindBuffer(s.ARRAY_BUFFER,h.vBuffer),s.vertexAttribPointer(h.vertexPositionHandle,3,s.FLOAT,!1,0,0),s.enableVertexAttribArray(h.vertexPositionHandle),s.bindBuffer(s.ARRAY_BUFFER,h.fBuffer),s.vertexAttribPointer(h.textureCoordsHandle,2,s.FLOAT,!1,0,0),s.enableVertexAttribArray(h.textureCoordsHandle)),h.heightOverWidthOfScreenNeedUpdate&&null!==h.heightOverWidthOfScreenHandle&&(s.uniform1f(h.heightOverWidthOfScreenHandle,this.fScreenRatio),h.heightOverWidthOfScreenNeedUpdate=0),h.fishEyeHeightOverWidthOfVideoNeedUpdate&&null!==h.heightOverWidthOfVideoHandle&&(s.uniform1f(h.heightOverWidthOfVideoHandle,this.fVideoRatio),h.fishEyeHeightOverWidthOfVideoNeedUpdate=0),h.fishEyeAngleNeedUpdate&&null!==h.fAngleHandle&&(s.uniform1f(h.fAngleHandle,u.fAngle),h.fishEyeAngleNeedUpdate=0),h.unfoldParaNeedUpdate&&null!==h.unfoldParaHandle&&(s.uniform1f(h.unfoldParaHandle,u.fUnfoldPara),h.unfoldParaNeedUpdate=0),h.fishEyeWinPlaneParamsNeedUpdate&&(null!==h.winPlaneAlphaHandle&&s.uniform1f(h.winPlaneAlphaHandle,u.fWinPlaneAlpha),null!==h.winPlaneBetaHandle&&s.uniform1f(h.winPlaneBetaHandle,u.fWinPlaneBeta),null!==h.winPlaneSizeOverPointZHandle&&s.uniform1f(h.winPlaneSizeOverPointZHandle,u.fWinPlaneSizeOverPointZ),null!==h.winPlaneViewPointZHandle&&s.uniform1f(h.winPlaneViewPointZHandle,u.fWinPlaneViewPointZ),null!==h.winPlaneProjModeHandle&&s.uniform1f(h.winPlaneProjModeHandle,u.fWinPlaneProjMode),null!==h.winPlaneCoefficientHandle&&s.uniform1f(h.winPlaneCoefficientHandle,u.fWinPlaneCoefficient),h.fishEyeWinPlaneParamsNeedUpdate=0),this.frameType===qe?(h.y.fill(e,i,t.subarray(0,r)),h.u.fill(e>>1,i>>1,t.subarray(r,r+n)),h.v.fill(e>>1,i>>1,t.subarray(r+n,t.length))):h.t.fill(e,i,t,Ge),s.drawArrays(s.TRIANGLE_STRIP,0,4)}),t.close&&t.close()}deleteProgram(){this.glPrograms.forEach(t=>{t.deleteProgram()}),this.glPrograms=[],this.zoomBeans=[]}setDisplayInfo(t){this.dispose(),this.displayMode=t.displayMode||Ne,this.frameType=t.frameType||this.frameType,this.initGL()}setFrameType(t){this.frameType!==t&&(this.dispose(),this.frameType=t,this.initGL())}dispose(){const{gl:t,glPrograms:e,frameType:i}=this;e.forEach(e=>{i===qe?(e.y.delete(),e.u.delete(),e.v.delete()):e.t.delete(),t.deleteBuffer(e.vBuffer),t.deleteBuffer(e.fBuffer),e.deleteProgram()}),t.clear(t.COLOR_BUFFER_BIT),this.glPrograms=[],this.zoomBeans=[]}}var $i=Yi,Xi=i("a002"),Qi=i.n(Xi);const Ki=()=>(65536*(1+Math.random())|0).toString(16).substring(1),Zi=t=>{let e="";for(let i=0;inavigator.userAgent.match(/(phone|pad|pod|iPhone|iPod|ios|iPad|Android|Mobile|BlackBerry|IEMobile|MQQBrowser|JUC|Fennec|wOSBrowser|BrowserNG|WebOS|Symbian|Windows Phone)/i),ir=(t=[],e=[])=>{for(let i=0;inull===t||void 0===t||""===t;function nr(t,e,i){if(tr.getItem("worker_"+t,i))console.error("worker test, try to create multiple worker from same resource, please check if the old worker has been closed or not.");else{let r=new Worker(t,{name:e});tr.setItem("worker_"+t,r,i)}return tr.getItem("worker_"+t,i)}function sr(t,e){let i=Object.entries(window[Ji][e]).filter(([t,e])=>"object"===typeof e),r=i.map(t=>t[1]).indexOf(t);-1!==r?(tr.setItem(i[r][0],void 0,e),t.terminate()):console.error("worker test, try to close an unexist worker")}ke("load worker");const ar=["decoder.worker.js","libaudio.js","libs.worker.js","libffmpeg.js","webgl.js","webgl.worker.js"],or=["audio.wasm","libaudio.wasm","libffmpeg.wasm"];function hr(t,e,i="blob"){return fetch(t).then(r=>{if(!r["ok"])throw"failed to load wasm binary file at '"+t+"'";return Qi.a.setItem(e,r[i]())})}async function cr(t){let e=localStorage.getItem("__TUMS_PLAYER_VERSION__"),i=await Qi.a.getItem("__TUMS_PLAYER_VERSION_IDB__");if(e===i)return Promise.resolve();let r=ar.map(e=>hr(t+"/tums-player/"+e,e)),n=or.map(e=>hr(t+"/tums-player/"+e,e,"arrayBuffer"));return Promise.all([...r,...n]).then(()=>{Qi.a.setItem("__TUMS_PLAYER_VERSION_IDB__",e)})}async function ur(){let t,e,i;return t=tr.getItem("libs.worker.js"),t?e=tr.getItem("libaudio.js"):(t=URL.createObjectURL(await Qi.a.getItem("libs.worker.js")),e=URL.createObjectURL(await Qi.a.getItem("libaudio.js")),tr.setItem("libs.worker.js",t),tr.setItem("libaudio.js",e)),i=await Qi.a.getItem("libaudio.wasm"),{libsWorker:t,libaudio:e,libaudioWasm:i}}async function lr(t="wasm"){let e,i,r;return e=tr.getItem("decoder.worker.js"),e||(e=URL.createObjectURL(await Qi.a.getItem("decoder.worker.js")),tr.setItem("decoder.worker.js",e)),"wasm"===t&&(i=tr.getItem("libffmpeg.js"),i||(i=URL.createObjectURL(await Qi.a.getItem("libffmpeg.js")),tr.setItem("libffmpeg.js",i)),r=await Qi.a.getItem("libffmpeg.wasm")),{decoderWorker:e,libffmpeg:i,libffmpegWasm:r}}async function dr(){let t,e;return t=tr.getItem("webgl.worker.js"),t?e=tr.getItem("webgl.js"):(t=URL.createObjectURL(await Qi.a.getItem("webgl.worker.js")),e=URL.createObjectURL(await Qi.a.getItem("webgl.js")),tr.setItem("webgl.worker.js",t),tr.setItem("webgl.js",e)),{webglWorker:t,webgljs:e}}const fr=ke("webglPlayer"),pr=.25,gr=1,mr=5,vr=100,yr=5,br=2304,_r=1296,Tr=8,Sr=15,wr=8,Er=1e3,xr=1e3;class Ar{static get AVSYNCMODE_MASTER_CLOCK(){return 1}static get AVSYNCMODE_MASTER_AUDIO(){return 2}constructor(t,e,i){this.options=t,this.wrapper=e,this.canvasId="canvas_"+(new Date).getTime(),this.audioType=t.audioType,this.audioDecoderType="_decodeG711a",this.configDecoderType=t.decoderType,this.decoderType=t.decoderType,this.sampleRate=t.sampleRate,this.pluginPath=t.pluginPath,this.streamType=t.streamType,this.isCover=t.cover,this.playScale=t.playScale||1,this.startTime=t.startTime,this.isTalking=!1,this.videoTimestamp=t.startTime,this.fishEyeDisplayMode=t.fishEyeDisplayMode,this.videoWidth=1920,this.videoHeight=1080,this.videoCodec="",this.webgl=null,this.webglWorker=null,this.audioPlayer=null,this.audioVoiceEnable=t.audioVoiceEnable||!1,this.decoderWorker=null,this.noisedecoderWorker=null,this.isInit=!0,this.hasDecoderInit=!1,this.hasNoiseDecoderInit=!1,this.zoomState=0,this.zoomScale=1,this.zoomTranslate={x:0,y:0},this.videoQueue=[],this.audioQueue=[],this.initCb=i,this.lastVideoData=null,this.toRenderData=null,this.audioWasm=null,this.audioDecoder=null,this.audioEncoder=null,this.bitCount=t.bitCount,this.forceRotate=!1,this._h264Parser=new Se,this._h265Parser=new we,this._lastPOC=-1,this._pocInterval=-1,this._waitIFrame=!0,this.streamFinished=!1,this.avsyncMode=Ar.AVSYNCMODE_MASTER_AUDIO,this.playStartSystemTime=0,this.videoStartPlayTimestamp=0,this.addCanvasWrap(),this.initWebgl(),this.initDecoderWorker()}addCanvasWrap(){this.canvasWrapper=document.createElement("div"),$(this.canvasWrapper,{position:"relative",width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}),this.wrapper&&this.wrapper.appendChild(this.canvasWrapper),this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.width=this.videoWidth,this.canvas.height=this.videoHeight,this.canvasWrapper.appendChild(this.canvas),this.iframe=document.createElement("iframe"),$(this.iframe,{opacity:0,position:"absolute",zIndex:-1111,left:0,top:0,width:"100%",height:"100%"}),this.iframe.onload=()=>{this.iframe.contentWindow.onresize=()=>{setTimeout(this.resizeCanvas.bind(this))}},this.canvasWrapper.appendChild(this.iframe)}async initWebgl(){let{canvas:t}=this;if(!t)throw new Error("can not find canvas target");let e=!er()&&t.transferControlToOffscreen&&t.transferControlToOffscreen(),i="wasm"===this.decoderType?qe:Ge;if(e){this._offscreenCanvas=e;let{webglWorker:t,webgljs:r}=await dr();this.webglWorker=nr(t,this.canvasId+"_webglWorker",this.canvasId),this.webglWorker.onmessage=t=>{const{data:n={}}=t,{hasInstalled:s,renderError:a}=n;s&&this.webglWorker.postMessage({cmd:"init",canvas:e,options:{preserveDrawingBuffer:!0,displayMode:this.fishEyeDisplayMode,frameType:i},scripts:[r]},[e]),a&&this.renderError(a)},this.resizeCanvas()}else this.webgl=new $i(t,{preserveDrawingBuffer:!0,displayMode:this.fishEyeDisplayMode,frameType:i}),this.resizeCanvas();t.captureStream&&t.captureStream(60),this.isCover=this.isCover||this.fishEyeDisplayMode!==Ne}arrayBufferToBase64(t){let e="",i=new Uint8Array(t),r=i.byteLength;for(let n=0;n{const{data:r={}}=t,{hasInstalled:n,hasInit:s,hasWebcodecsConfig:a,decodeError:o,state:h,flushed:c}=r;if(n){let t={cmd:"init",decoderType:this.decoderType};return"wasm"===this.decoderType&&(t.scripts=[e],t.wasmBinary=i),void this.decoderWorker.postMessage(t,i?[i]:[])}if(o&&"closed"===h)return console.log("decoder occur error",o),void(this.changeWasmDecoder=!0);if(s)return this.hasDecoderInit=!0,void this.sendNewPSInfo();if(a)return this._hasWebcodecsConfig=!0,this._waitNewConfigDecodeOutStartTime=0,void(this.videoNumInDecoder=0);if(c)this.videoWorkerWaitFlush=!1;else if(this._hasWebcodecsConfig&&!this._newConfigHasDecodeOut&&(this._newConfigHasDecodeOut=!0),--this.videoNumInDecoder,this.videoNumInDecoder<0&&(this.videoNumInDecoder=0),r.wasm_error)1===r.wasm_error&&this.outOfMemoryError();else if(this.videoWorkerWaitFlush)"webcodecs"===r.type&&r.data.close();else if("hidden"!==document.visibilityState||"video"!==this.streamType){if(this.videoQueue.length>=vr){let t=this.videoQueue.shift();"webcodecs"===r.type&&t.data.close()}this.videoQueue.push(r),(this.webgl||this.webglWorker)&&this.isInit&&this.flush()}else"webcodecs"===r.type&&r.data.close()}}async initDecoderWorker(){this.hasNoiseDecoderInit=!1;let{libsWorker:t,libaudio:e,libaudioWasm:i}=await ur();this.noisedecoderWorker=nr(t,this.canvasId+"_libsWorker",this.canvasId),this.noisedecoderWorker.onmessage=t=>{const{data:r={}}=t,{hasInstalled:n,hasInit:s,flushed:a}=r;if(n)return void this.noisedecoderWorker.postMessage({cmd:"init",scripts:[e],wasmBinary:i},[i]);if(s)return void(this.hasNoiseDecoderInit=!0);if(a)return void(this.audioWorkerWaitFlush=!1);if(this.audioWorkerWaitFlush)return;if(!this.audioVoiceEnable||!this.audioPlayer)return;if(this.isTalking&&!this.isInit){let t=this.arrayBufferToBase64(r.data);this.client.eventSource.dispatchEvent("sendInterAduioData",t)}if("video"===this.streamType){let t=this.audioPlayer.getCacheDuration();if(t0){let i=e[e.length-1];i.length>0&&(t+=i[0].timestamp-r.timestamp)}}if(t>=Er&&(!this.lastOverflowDropAudioTime||Math.abs(r.timestamp-this.lastOverflowDropAudioTime)>500))return this.lastOverflowDropAudioTime=r.timestamp,void fr.log("audio overflow drop one audio frame",t)}let o=new Int16Array(r.data);if(o.byteLength){this.isInit||"video"!==this.streamType&&!this.isPlaying()?this.audioPlayer.addData(o,r.timestamp,r.samplerate):this.audioPlayer.play(o,r.timestamp,r.samplerate);let t=o.slice(0,o.byteLength>160?160:o.byteLength);this._pcmData=new Int16Array(t),this._pcmTimestamp=r.timestamp,this._pcmSamplerate=r.samplerate}}}setAudioType(t){switch(t){case me.G711A:this.audioDecoderType="_decodeG711a";break;case me.PCMU:this.audioDecoderType="_decodeG711u";break;case me.PCMA_W:this.audioDecoderType="_decodeG711a";break;case me.AAC:this.audioDecoderType="_decodeAAC";break;case me.G726:this.audioDecoderType="_decodeG726";break;case me.ADPCM:this.audioDecoderType="_decodeAdpcm";break;default:break}}setConfig(t){Ae.isSupported&&(this.audioPlayer||(this.audioPlayer=new Ae({pluginPath:this.pluginPath,volume:this.options.volume})))}resizeCanvas(){let{width:t,height:e}=window.getComputedStyle(this.canvasWrapper,null);[t,e]=[parseInt(t),parseInt(e)];let{videoWidth:i,videoHeight:r}=this;fr.log("resize style: ",t,e,i,r),this.forceRotate&&!d()?([t,e]=[e,t],this.canvas.style.transform=this.getTransformScale()+" rotate(90deg)"):this.canvas.style.transform=this.getTransformScale();let n=t+"px",s=Math.floor(t*r/i)+"px";parseInt(s)>=e&&(s=e+"px",n=Math.floor(e*i/r)+"px"),this.isCover&&(this.forceRotate&&!d()?(n=t+"px",s=e+"px"):n=s="100%"),this._offscreenCanvas||(this.canvas.width=this.videoWidth,this.canvas.height=this.videoHeight),this.canvas.style.height=s,this.canvas.style.width=n,this.client.eventSource.dispatchEvent("canvasWidthChange",{canvasHeight:s,canvasWidth:n})}getTransformScale(){return`scale(${this.zoomScale}) translate(${this.zoomTranslate.x}px, ${this.zoomTranslate.y}px)`}canvasTransform(t=!0){this.canvas.style.transform=this.getTransformScale(),this.zoomState&&t&&this.client.eventSource.dispatchEvent("zoom",{scale:this.zoomScale})}zoomCanvas(){this.zoomScale=1;let{canvas:t}=this;t.style.transformOrigin="0 0";const e=(e,i)=>{let r=t.getBoundingClientRect();return{x:(e-r.left)/this.zoomScale,y:(i-r.top)/this.zoomScale}},i=(t,e)=>{if(e>0){if(this.zoomScale>=mr)return;this.zoomScale+=pr,this.zoomScale=Math.min(this.zoomScale,mr)}if(e<0){if(this.zoomScale<=gr)return;this.zoomScale-=pr,this.zoomScale=Math.max(this.zoomScale,gr)}let i=t.x*(this.zoomScale-gr)*-1/this.zoomScale,r=t.y*(this.zoomScale-gr)*-1/this.zoomScale;this.zoomTranslate={x:i,y:r},this.canvasTransform()};t.onclick=t=>{if(!this.zoomState)return;if(this.dragState)return void(this.dragState=0);let r=e(t.clientX,t.clientY);i(r,1)},t.oncontextmenu=t=>{if(!this.zoomState)return!1;if(this.dragState)return this.dragState=0,!1;let r=e(t.clientX,t.clientY);return i(r,-1),!1},t.onmousewheel=t.onwheel=t=>{if(!this.zoomState)return;let r=e(t.clientX,t.clientY);i(r,t.wheelDelta)}}dragCanvas(){this.dragState=0;let t=!1,{canvas:e}=this,i={x:0,y:0};e.onmousedown=e=>{this.zoomState&&(t=!0,i.x=e.clientX,i.y=e.clientY)},document.onmousemove=r=>{if(!this.zoomState)return;let{zoomScale:n}=this,s=(r.clientX-i.x)/n,a=(r.clientY-i.y)/n;if(Math.abs(s)<5&&Math.abs(a)<5)return;if(t&&(t=!1,this.dragState=1),!this.dragState)return;let o=e.getBoundingClientRect(),h=this.canvasWrapper.getBoundingClientRect(),{x:c,y:u}=this.zoomTranslate;s>0&&o.xh.x+h.width&&(c+=Math.max((h.x+h.width-o.x-o.width)/n,s)),a>0&&o.yh.y+h.height&&(u+=Math.max((h.y+h.height-o.y-o.height)/n,a)),this.zoomTranslate={x:c,y:u},i={x:r.clientX,y:r.clientY},this.canvasTransform(!1)},document.onmouseup=()=>{this.zoomState&&(t=!1,setTimeout(()=>{this.dragState=0}))}}clearCanvasEventListener(){let{canvas:t}=this;t.onmousedown=null,t.click=null,t.oncontextmenu=null,t.onmousewheel=null,t.onwheel=null,t.ontouchstart=null}clearIframeEventListener(){let{iframe:t}=this;t.contentWindow&&(t.contentWindow.onresize=null)}attachClient(t,e){this.client=t,e.on("flush",this.onSamples.bind(this))}isPlaying(){return this.client&&!this.client.paused}clearVideoQueue(){if(this.videoQueue.forEach(t=>{t.data&&t.data.close&&t.data.close()}),"video"!==this.streamType)for(let t=this.videoQueue.length-1;t>=0;--t){let e=this.videoQueue[t];if(e.seq){let t=e.seq;this.client.onPlayerNotify({seq:t});break}}this.videoQueue=[]}onSamples(){for(let t in this.client.sampleQueues){let e=this.client.sampleQueues[t];"video"===t?this.onVideoFrame(e,t):"audio"===t&&this.onAudioFrame(e)}}isEqual(t,e){return t.length===e.length&&t.every((t,i)=>t===e[i])}checkAndRecordVideoPS(t){this._curVideoPayloadType=t.payloadType,this.videoCodecType=this._curVideoPayloadType===me.H265?1:0,t.ntype===ye.VPS?(this._vpsChunk&&this.isEqual(this._vpsChunk,t.data)||(this._psChange=!0,console.log("vps changed"),this._vpsChunk=new Uint8Array(t.data)),this._vpsUpdate=!0):t.ntype===ye.SPS||t.ntype===ye.HEVC_SPS?(this._spsChunk&&this.isEqual(this._spsChunk,t.data)||(this._psChange=!0,console.log("sps changed"),this._spsChunk=new Uint8Array(t.data)),this._spsUpdate=!0):t.ntype!==ye.PPS&&t.ntype!==ye.HEVC_PPS||(this._ppsChunk&&this.isEqual(this._ppsChunk,t.data)||(this._psChange=!0,console.log("pps changed"),this._ppsChunk=new Uint8Array(t.data)),this._ppsUpdate=!0)}checkAndClearPSUpdateState(){if(this._curVideoPayloadType===me.H264){if(this._spsUpdate&&this._ppsUpdate)return this._spsUpdate=!1,this._ppsUpdate=!1,this._psChange=!1,!0}else if(this._vpsUpdate&&this._spsUpdate&&this._ppsUpdate)return this._vpsUpdate=!1,this._spsUpdate=!1,this._ppsUpdate=!1,this._psChange=!1,!0;return!1}parseVideoPS(){this._curVideoPayloadType===me.H265?(this._h265Parser.resetParams(),this._h265Parser.parseVPS(this._vpsChunk.subarray(4)),this._h265Parser.parseSPS(this._spsChunk.subarray(4)),this._h265Parser.parsePPS(this._ppsChunk.subarray(4))):(this._h264Parser.resetParams(),this._h264Parser.parseSPS(this._spsChunk.subarray(4)),this._h264Parser.parsePPS(this._ppsChunk.subarray(4)))}checkPOC(t){if(!t.isNormalDataFrame())return;if(t.isKeyframe()||t.isVirtualI)this._lastPOC=-1,this._pocInterval=-1,this._waitIFrame=!1;else if(this._waitIFrame)return;let e;if(e=this._curVideoPayloadType===me.H265?this._h265Parser.getPOC(t.data.subarray(4)):this._h264Parser.getPOC(t.data.subarray(4)),-2!==e)if(-1===e)this._waitIFrame=!0,console.log("get error poc",e,this._lastPOC,this._pocInterval,t.ntype);else{if(-1===this._lastPOC)this._lastPOC=e;else{let i=e-this._lastPOC;-1===this._pocInterval&&i>0&&(this._pocInterval=i),(i<=0||i>this._pocInterval)&&(this._waitIFrame=!0,console.log("get wrong poc",e,this._lastPOC,this._pocInterval,t.ntype))}this._lastPOC=e}}dropVideoWhenQueueFull(t){let e=!1;while(t.length>0){let i=t[0];for(let t of i)if(t.isParameterSet()||t.isKeyframe()||t.isVirtualI){e=!0;break}if(e)break;t.shift(),this._waitIFrame=!0}}sendNewPSInfo(){if("webcodecs"===this.decoderType){let e=this._h264Parser.track;this._curVideoPayloadType===me.H265&&(e=this._h265Parser.track),fr.log("webcodecs config",e,e.codec,e.width,e.height,this._hasWebcodecsConfig);try{this.decoderWorker.postMessage({cmd:"webcodecs_config",codec:e.codec,width:e.width,height:e.height})}catch(t){}this._hasWebcodecsConfig=!1,this._newConfigHasDecodeOut=!1,this.resizeCanvas()}else this._curVideoPayloadType==me.H265&&this.decoderWorker.postMessage({cmd:"decode",data:this._vpsChunk,code_type:this.videoCodecType,pts:0,timestamp:0,seq:0,height:this.videoHeight,width:this.videoWidth}),this.decoderWorker.postMessage({cmd:"decode",data:this._spsChunk,code_type:this.videoCodecType,pts:0,timestamp:0,seq:0,height:this.videoHeight,width:this.videoWidth}),this.decoderWorker.postMessage({cmd:"decode",data:this._ppsChunk,code_type:this.videoCodecType,pts:0,timestamp:0,seq:0,height:this.videoHeight,width:this.videoWidth})}startNewVideoCodecDecode(){this.decoderWorker?"webcodecs"===this.configDecoderType&&this.decoderType!==this.configDecoderType&&(this.decoderType=this.configDecoderType,this.initVideoDecoderWorker()):this.initVideoDecoderWorker()}ifVideoDecodeWorkerReady(){return!(!this.hasDecoderInit||"webcodecs"===this.decoderType&&!this._hasWebcodecsConfig)}async onVideoFrame(t){if(clearTimeout(this.videoDecodeInterval),this.changeWasmDecoder&&(console.log("change to wasm decoder"),this.decoderType="wasm",this.initVideoDecoderWorker(),this.changeWasmDecoder=!1),"video"===this.streamType&&t.length>=vr&&this.dropVideoWhenQueueFull(t),this.videoQueue.length>=wr||this.videoNumInDecoder+this.videoQueue.length>this._maxDecodeInNum)return void(this.videoDecodeInterval=setTimeout(()=>{this.onVideoFrame(t)},20));if(t.length<=0)return;let e=t[0];for(let r of e)if(r.isParameterSet()){this.checkAndRecordVideoPS(r);let t=this._psChange,e=this.checkAndClearPSUpdateState();e&&t&&(console.log("get new video ps info"),this.parseVideoPS(),this.startNewVideoCodecDecode(),this.hasDecoderInit&&this.sendNewPSInfo())}else{if(this.checkPOC(r),this._waitIFrame){if("video"!==this.streamType){let t=r.seq;t&&this.client.onPlayerNotify({seq:t})}continue}if(!this.ifVideoDecodeWorkerReady())return;if(++this.videoNumInDecoder,this.lastVideoDecodeInTS=r.timestamp,"webcodecs"===this.decoderType){if(!this._newConfigHasDecodeOut){if(!r.isKeyframe())continue;let t=new Uint8Array;this._curVideoPayloadType===me.H265&&(t=oe(t,this._vpsChunk)),t=oe(t,this._spsChunk),t=oe(t,this._ppsChunk),t=oe(t,r.data),this.lastDecodeInPTS=r.pts,this.lastDecodeInTS=r.timestamp;try{this.decoderWorker.postMessage({cmd:"decode",data:t.buffer,timestamp:r.timestamp,seq:r.seq,type:"key",pts:r.pts},[t.buffer])}catch(i){}return this._waitNewConfigDecodeOutStartTime<=0&&(this._waitNewConfigDecodeOutStartTime=Date.now()),Date.now()-this._waitNewConfigDecodeOutStartTime>xr?(console.log("wait decode out timeout change to wasm"),void(this.changeWasmDecoder=!0)):void(this.videoNumInDecoder=1)}if(r.isKeyframe()&&this.videoNumInDecoder>=this._maxDecodeInNum)return console.log("frame in decoder too much change to wasm"),void(this.changeWasmDecoder=!0);try{this.decoderWorker.postMessage({cmd:"decode",data:r.data.buffer,timestamp:r.timestamp,seq:r.seq,type:r.isKeyframe()?"key":"delta",pts:r.pts},[r.data.buffer])}catch(i){--this.videoNumInDecoder}}else try{this.decoderWorker.postMessage({cmd:"decode",data:r.data.buffer,code_type:this.videoCodecType,pts:r.pts,timestamp:r.timestamp,seq:r.seq,height:this.videoHeight,width:this.videoWidth},[r.data.buffer])}catch(i){--this.videoNumInDecoder}this._beforeDecodeTime=r.timestamp}t.shift()}onAudioFrame(t){if(!this.noisedecoderWorker)return;let e=0;while(t.length>0){if(this.audioPlayer&&this.audioPlayer.ifPlayListFull())return;let i=t.shift();for(let t of i)this.setAudioType(t.type),this.audioVoiceEnable&&(this.noisedecoderWorker.postMessage({data:t.data,bitCount:t.bitCount,pts:t.pts,dts:t.dts,timestamp:t.timestamp,seq:t.seq,samplerate:t.samplerate||8e3,type:t.type,decoderType:this.audioDecoderType,isTalking:this.isTalking}),++e);if(e>yr)break}}mergeArrayBuffer(t){let e=0;for(let n of t)e+=n.byteLength;let i=new Uint8Array(e),r=0;for(let n of t)for(let t of[n]){let e=new Uint8Array(t);i.set(e,r),r+=t.byteLength}return i.buffer}getSeq(){let t,e;return this.videoQueue.forEach(e=>{e.seq&&(t=e.seq)}),this.audioQueue.forEach(t=>{t.seq&&(e=t.seq)}),t&&e?Math.max(t,e):t||e}flush(){if(!this.webgl&&!this.webglWorker)return;let t=this.videoQueue.shift();if(!t){let t=this.getSeq();return t&&this.client.onPlayerNotify({seq:t}),this.streamFinished?(this.client.eventSource.dispatchEvent("ended"),void console.log("stream play finished, notify ended",Date.now())):void(this.flushInterval=setTimeout(()=>{this.flush()},20))}const{width:e,height:i,timestamp:r,seq:n}=t;let{streamType:s,lastVideoData:a}=this,o=0;if(this.toRenderData)t.data&&t.data.close&&t.data.close();else{if("sdvod"===s&this.playScale<=2&&this.lastVideoData&&Math.abs(r-this.lastVideoData.timestamp)>=2e3)return fr.log("invalid time: ",new Date(r),new Date(this.lastVideoData.timestamp)),this.lastVideoData.timestamp=r,this.playStartSystemTime=0,this.client.onPlayerNotify({seq:n}),t.data&&t.data.close&&t.data.close(),void this.flush();switch(this.toRenderData=t,this.avsyncMode){case Ar.AVSYNCMODE_MASTER_AUDIO:if(1===this.playScale&&this.audioPlayer&&this.audioPlayer.playing()){let t=this.audioPlayer.getTimestamp();if(t>0&&Math.abs(t-r)<("video"===s?500:2e3)){this.playStartSystemTime>0&&(this.playStartSystemTime=0),o=t>=r?0:r-t;break}}case Ar.AVSYNCMODE_MASTER_CLOCK:if("video"===s&&this.videoQueue.length>0&&this.lastVideoDecodeInTS){let t=this.lastVideoDecodeInTS-this.videoQueue[0].timestamp;if(t0){let i=e[e.length-1];i.length>0&&(t=i[0].timestamp-this.videoQueue[0].timestamp)}}t>=Er&&(this.playStartSystemTime=0)}if(0===this.playStartSystemTime)this.playStartSystemTime=Date.now(),this.videoStartPlayTimestamp=r,o=0;else{let t=(Date.now()-this.playStartSystemTime)*this.playScale,e=r-this.videoStartPlayTimestamp;o=(e-t)/this.playScale,o<0||o>=2e3?(this.playStartSystemTime=Date.now(),this.videoStartPlayTimestamp=r,o=0):o=Math.min(o,1e3)}break;default:a&&(o=r-a.timestamp,o=Math.max(o,0),this.playScale<1?(o=Math.min(o,100),o*=1/this.playScale):this.playScale<=2?o=Math.min(o,100):(o/=this.playScale,o=Math.min(o,1e3)));break}this.flushInterval&&clearTimeout(this.flushInterval),this.flushInterval=setTimeout(()=>{if(this.toRenderData=null,0===this.playStartSystemTime&&(this.playStartSystemTime=Date.now(),this.videoStartPlayTimestamp=r),this.videoTimestamp=r,this.videoWidth!==e&&this.canvas&&(this.videoWidth=e,this.videoHeight=i,this.resizeCanvas()),this.isInit&&(this.isInit=!1,this.initCb&&this.initCb()),this.isPlaying()&&"hidden"!==document.visibilityState)if("webcodecs"===t.type){if(this.webglWorker)try{this.webglWorker.postMessage({cmd:"render",frame:t.data,type:t.type,width:e,height:i},[t.data])}catch(s){t.data.close()}else if(this.webgl){this.webgl.setFrameType(Ge);let r=this.webgl.renderFrame(t.data,e,i);r&&this.renderError(r)}t.data.close()}else{let r=e/2*(i/2),n=e*i;if(this.webglWorker)try{this.webglWorker.postMessage({cmd:"render",frame:t.data,type:t.type,width:e,height:i,yLength:n,uvLength:r},[t.data.buffer])}catch(s){}else if(this.webgl){this.webgl.setFrameType(qe);let s=this.webgl.renderFrame(t.data,e,i,n,r);s&&this.renderError(s)}}else t.data&&t.data.close&&t.data.close();if(this._fps&&this.isPlaying()?this._fps++:this._fps=1,this._firstRenderTime&&this.isPlaying()){if(Date.now()-this._firstRenderTime>=5e3){let t=this._fps/5;fr.log("fps:",t);let n=this._beforeDecodeTime-r;if(t<10&&"hidden"!==document.visibilityState){let t=Me.NETWORK_UNSTABLE_WARNING;e*i>br*_r?t=Me.VIDEO_RES_WARNING:n>1e3&&(t=Me.DECODE_WARNING),this.client.eventSource.dispatchEvent("warning",new Me(t))}this._firstRenderTime=0,this._fps=0}}else this._firstRenderTime=Date.now();this.client.onPlayerNotify({seq:n}),this.lastVideoData=t,this.flush()},o)}}requestFullscreen(t,e=!1){this.forceRotate=e,this.fullEl&&this.fullEl.requestFullscreen(),t&&(this.fullscreenCtrlEl=t,this.canvasWrapper.appendChild(t))}exitFullscreen(){this.fullEl&&this.fullEl.exitFullScreen(),this.forceRotate=!1,this.fullscreenCtrlEl&&this.canvasWrapper.removeChild(this.fullscreenCtrlEl)}screenshot(t=!0){if(this.isInit)return;let e=this.canvas.toDataURL();if(t){let t=new Image;t.src=e,t.setAttribute("crossOrigin","anonymous"),t.onload=function(){let e=document.createElement("canvas");e.width=t.width,e.height=t.height,e.getContext("2d").drawImage(t,0,0,t.width,t.height);let i=document.createElement("a");i.download=imgName,i.href=e.toDataURL("image/png"),i.click()};let i=document.createElement("a");i.href=e,i.download=(new Date).getTime()+".png",i.click()}return e}setVolume(t){this.audioPlayer&&this.audioPlayer.setVolume(t)}getVolume(){return this.audioPlayer&&this.audioPlayer.getVolume()}getCanvasSize(){let t={width:0,height:0};if(this.canvas)if("100%"===this.canvas.style.width){if(this.canvasWrapper){let{width:e,height:i}=window.getComputedStyle(this.canvasWrapper,null);t.width=parseInt(e),t.height=parseInt(i)}}else t.width=parseInt(this.canvas.style.width),t.height=parseInt(this.canvas.style.height);return t}async destroy(){this.clearCanvasEventListener(),this.clearIframeEventListener(),this.decoderWorker&&sr(this.decoderWorker,this.canvasId),this.noisedecoderWorker&&(this.noisedecoderWorker.postMessage({isStop:!0}),sr(this.noisedecoderWorker,this.canvasId)),this.decoderWorker=null,this.noisedecoderWorker=null,this.webgl&&this.webgl.dispose(),this.webgl=null,this.webglWorker&&sr(this.webglWorker,this.canvasId),this.webglWorker=null,this.canvasWrapper&&this.canvasWrapper.removeChild(this.canvas),this.canvasWrapper&&this.canvasWrapper.removeChild(this.iframe),this.wrapper&&this.wrapper.removeChild(this.canvasWrapper),this.canvasWrapper=null,this.wrapper=null,this.audioPlayer&&this.audioPlayer.close(),this.audioPlayer=null,this.clearVideoQueue(),this.zoomState=0,this.stopFlushInterval(),this.videoDecodeInterval&&clearTimeout(this.videoDecodeInterval)}stopFlushInterval(){this.toRenderData&&this.toRenderData.data&&this.toRenderData.data.close&&this.toRenderData.data.close(),this.toRenderData=null,this.flushInterval&&clearTimeout(this.flushInterval)}outOfMemoryError(){this.client.stop(),this.client.eventSource.dispatchEvent("error",new Me(Me.COMMON_ERR_OUT_OF_MEMORY)),this.destroy()}renderError(t){this.client.stop(),this.client.eventSource.dispatchEvent("error",t),this.zoomState=0}toggleZoomState(t){this.zoomState=t,0===t?(this.zoomTranslate={x:0,y:0},this.zoomScale=1,this.canvasTransform(),this.clearCanvasEventListener()):(this.zoomCanvas(),this.dragCanvas())}setZoomScale(t){if(!this.zoomState||tmr)return;let{x:e,y:i}=this.zoomTranslate,r=this.canvas.getBoundingClientRect();t===gr?(e=0,i=0):0===e&&0===i?(e=r.width/2*(t-gr)*-1/t,i=r.height/2*(t-gr)*-1/t):(e=e*t/this.zoomScale,i=i*t/this.zoomScale),this.zoomTranslate={x:e,y:i},this.zoomScale=t,this.canvasTransform()}getDuration(){return this.client&&this.client.getDuration&&this.client.getDuration()||0}getTimestamp(){return this.client&&this.client.getDuration&&this.client.getVideoStartPTS&&this.client.getVideoPTSTimescale?this.lastVideoData&&this.lastVideoData.pts?1e3*(this.lastVideoData.pts-this.client.getVideoStartPTS())/this.client.getVideoPTSTimescale():0:this.videoTimestamp}setPlayScale(t){let e=this.getSeq();this.client.onPlayerNotify({seq:e}),this.clearVideoQueue(),this.audioQueue=[],this.playScale=t}setIsTalking(t){this.isTalking=t}getPlayScale(){return this.playScale||1}stopFlush(){this.stopFlushInterval(),this.playStartSystemTime=0,this.audioPlayer&&this.audioPlayer.pause()}startFlush(){"video"===this.streamType&&this.clearVideoQueue(),this.flush(),this.audioPlayer&&this.audioPlayer.resume()}setFakeSlience(){this.audioPlayer&&this.audioPlayer.setFakeSlience()}notifyStreamFinished(){"sdvod"===this.streamType&&(this.streamFinished=!0)}seek(t){if(!t)return;let e=this.getSeq();this.client.onPlayerNotify({seq:e}),this.clearVideoQueue(),this.audioQueue=[],this.audioPlayer&&this.audioPlayer.seek(),this.noisedecoderWorker&&this.hasNoiseDecoderInit&&(this.audioWorkerWaitFlush=!0,this.noisedecoderWorker.postMessage({cmd:"flush"})),this.decoderWorker&&this.hasDecoderInit&&(this.videoWorkerWaitFlush=!0,this.decoderWorker.postMessage({cmd:"flush"})),this.startTime=t,this.videoTimestamp=t,this.playStartSystemTime=0,this.streamFinished=!1,this.lastVideoData&&(this.lastVideoData.timestamp=t)}setDisplayMode(t,e){this.fishEyeDisplayMode=t,this.isCover=t!==Ne||this.options.cover,this.resizeCanvas(),e=Object.assign({},e,{displayMode:t,frameType:"wasm"===this.decoderType?qe:Ge}),this.webglWorker?this.webglWorker.postMessage({cmd:"display",options:e}):this.webgl.setDisplayInfo(e)}playAudio(){const{audioPlayer:t}=this;t&&this._pcmData&&(t.play(this._pcmData,this._pcmTimestamp,this._pcmSamplerate),t.flush(!0))}}var Cr=Ar;class Rr{constructor(){this.fragmented_nalu=null}static parseNALHeader(t){return{nri:96&t,type:31&t}}parseSingleNALUPacket(t,e,i,r){return new ye(e.type,t.subarray(0),i,r,e.nri,me.H264)}parseAggregationPacket(t,e,i,r){let n=new DataView(t.buffer,t.byteOffset,t.byteLength),s=0;ye.STAP_B===e.type&&(n.getUint16(s),s+=2);let a=[];while(s>>7,h=(64&a)>>>6,c=31&a,u=null;if(s++,ye.FU_B===e.type&&(n.getUint16(s),s+=2),o){let e=t.subarray(s),a=new Uint8Array(1+e.length);a[0]=96&n.getUint8(0)|31&n.getUint8(1),a.set(e,1),this.fragmented_nalu=new ye(c,a,i,r,null,me.H264)}else if(this.fragmented_nalu&&this.fragmented_nalu.ntype===c&&(this.fragmented_nalu.appendData(t.subarray(s)),h))return u=this.fragmented_nalu,this.fragmented_nalu=null,u;return null}onNALUFragment(t,e,i){let r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=Rr.parseNALHeader(r.getUint8(0)),s=0,a=null;if(n.type>0&&n.type<24)a=this.parseSingleNALUPacket(t.subarray(s),n,e,i);else{if(ye.FU_A!==n.type&&ye.FU_B!==n.type)return ye.STAP_A===n.type||ye.STAP_B===n.type?this.parseAggregationPacket(t.subarray(s),n,e,i):null;a=this.parseFragmentationUnit(t.subarray(s),n,e,i)}return a?[a]:null}}class Pr{constructor(){this.fragmented_nalu=null}static parseNALHeader(t){return{nri:96&t,type:31&t}}parseSingleNALUPacket(t,e,i,r){return new ye(t,e.subarray(0),i,r,null,me.H265)}parseFragmentationUnit(t,e,i){let r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=2,s=r.getUint8(n),a=(128&s)>>>7,o=(64&s)>>>6,h=63&s,c=null;if(n++,a){let s=t.subarray(n),a=new Uint8Array(2+s.length);a[0]=129&r.getUint8(0)|h<<1,a[1]=r.getUint8(1),a.set(s,2),this.fragmented_nalu=new ye(h,a,e,i,null,me.H265)}else if(this.fragmented_nalu&&this.fragmented_nalu.ntype===h&&(this.fragmented_nalu.appendData(t.subarray(n)),o))return c=this.fragmented_nalu,this.fragmented_nalu=null,c;return null}onNALUFragment(t,e,i){let r=new DataView(t.buffer,t.byteOffset,t.byteLength),n=r.getUint8(0)>>1&63,s=0,a=null;if(n>0&&n<48)a=this.parseSingleNALUPacket(n,t.subarray(s),e,i);else{if(49!=n)return null;a=this.parseFragmentationUnit(t.subarray(s),e,i)}return a?[a]:null}}class Ir{constructor(t,e,i){this.dts=e,this.pts=i||this.dts,this.data=t}getData(){return this.data}getSize(){return this.data.byteLength}}class kr{constructor(){this.config=null}onAACFragment(t){let e=t.getPayload();if(!t.media)return null;let i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=13,n=3,s=3,a=0,o=0,h=0,c=0,u=0,l=0;if(t.media.fmtp){let e=t.media.fmtp["sizelength"]||t.media.fmtp["size-length"];r=Number(e||0);let i=t.media.fmtp["indexlength"]||t.media.fmtp["index-length"];n=Number(i||0);let d=t.media.fmtp["indexdeltalength"]||t.media.fmtp["index-delta-length"];s=Number(d||0),o=Number(t.media.fmtp["ctsdeltalength"]||0),h=Number(t.media.fmtp["dtsdeltalength"]||0),c=Number(t.media.fmtp["randomaccessindication"]||0),u=Number(t.media.fmtp["streamstateindication"]||0),l=Number(t.media.fmtp["auxiliarydatasizelength"]||0),a=r+Math.max(n,s)+o+h+c+u+l}else a=r+Math.max(n,s)+o+h+c+u+l;let d=0,f=0,p=t.getTimestampMS();if(0!==a){let a=i.getUint16(0);d=2+(a>>>3)+(7&a?1:0);let l=[],g=0,m=new de(e.subarray(2+f)),v=0,y=0;for(let i=0;i>2)),E++,A.setUint8(E,((3&T)<<6)+S>>11),E++,A.setUint8(E,(2047&S)>>3),E++,A.setUint8(E,31+((7&S)<<5)),E++,A.setUint8(E,252),E++;const C=new Uint8Array(A.buffer);let R=new Uint8Array(C.length+f.data.length);R.set(C,0),R.set(f.data,C.length),f.data=R,l.push(f),g+=a}return l}{let t=e.subarray(d);while(1){if(255!=t[f])break;++f}return++f,[new Ir(e.subarray(d+f),p)]}}}const Dr=ke("client:rtsp");class Or{constructor(t,e){let i=new DataView(t.buffer,t.byteOffset,t.byteLength);this.version=i.getUint8(0)>>>6,this.padding=(32&i.getUint8(0))>>>5,this.has_extension=(16&i.getUint8(0))>>>4,this.csrc=15&i.getUint8(0),this.marker=i.getUint8(1)>>>7,this.pt=127&i.getUint8(1),this.sequence=i.getUint16(2),this.timestamp=i.getUint32(4),this.ssrc=i.getUint32(8),this.csrcs=[],this.frame_flg=0;let r=12;if(this.csrc>0&&(this.csrcs.push(i.getUint32(r)),r+=4),1==this.has_extension){if(this.extension=i.getUint16(r),this.ehl=i.getUint16(r+2),r+=4,this.header_data=t.slice(r,r+4*this.ehl),1===this.extension&&(this.utc_timestamp=Math.floor(pe(i,r)/1e3)),256===this.extension){let t=0;while(t<4*this.ehl){let e=r+t,n=i.getUint8(e);switch(e+=1,n){case 1:this.channel=i.getUint8(e+2),e+=3;break;case 2:this.frequency=i.getUint8(e+3),this.bitwidth=i.getUint16(e+4),this.audio_channels=i.getUint8(e+6),e+=7;break;case 3:this.frame_flg=i.getUint8(e+2),e+=3;break;case 4:this.utc_timestamp=1e3*i.getUint32(e+3),e+=7;default:break}t=e-r}}r+=4*this.ehl}if(this.headerLength=r,e.isNvmpAccPlayBack){if("audio"===this.getPayloadType(this.pt)){let t=e.mediaMap[e.media.audio.fmt[0]];t.fmt=[this.pt],delete e.mediaMap[e.media.audio.fmt[0]],e.mediaMap[this.pt]=t,e.media.audio.fmt[0]=this.pt}this.media=e.getMediaBlockByPayloadType(this.pt)}else this.media=e.getMediaBlockByPayloadType(this.pt);null===this.media?Dr.log(`Media description for payload type: ${this.pt} not provided.`):this.type=this.media.ptype,this.data=t.subarray(r)}getPayloadType(t){if(t<=23)return"audio";if(t<=34)return"video";switch(t){case 94:case 95:case 96:case 97:case 98:case 99:case 100:return"video";case 101:case 102:case 103:case 104:return"audio";default:break}}getPayload(){return this.data}getTimestampMS(){return this.timestamp}toString(){return"RTP(version:"+this.version+", padding:"+this.padding+", has_extension:"+this.has_extension+", csrc:"+this.csrc+", marker:"+this.marker+", pt:"+this.pt+", sequence:"+this.sequence+", timestamp:"+this.timestamp+", ssrc:"+this.ssrc+")"}isVideo(){return"video"==this.media.type}isAudio(){return"audio"==this.media.type}mediaType(){return this.media.type}}class Mr{constructor(t){this.tsOffsets={};for(let e in t.media)for(let i of t.media[e].fmt)Dr.log(i),this.tsOffsets[i]={last:0,overflow:0}}build(t,e){let i=new Or(t,e),r=this.tsOffsets[i.pt];return r&&(i.timestamp+=r.overflow,r.last&&Math.abs(i.timestamp-r.last)>2147483647&&(Dr.log(`\nlast ts: ${r.last}\n\n new ts: ${i.timestamp}\n\n new ts adjusted: ${i.timestamp+4294967295}\n\n last overflow: ${r.overflow}\n\n new overflow: ${r.overflow+4294967295}\n\n `),r.overflow+=4294967295,i.timestamp+=4294967295),r.last=i.timestamp),i}}class Nr{constructor(t,e,i){this.dts=e,this.pts=i||this.dts,this.data=t}getData(){return this.data}getSize(){return this.data.byteLength}}class Br{constructor(){this.naluasm=new Rr}parse(t){return this.naluasm.onNALUFragment(t.getPayload(),t.timestamp)}}class Lr{constructor(){this.naluasm=new Pr}parse(t){return this.naluasm.onNALUFragment(t.getPayload(),t.timestamp)}}class Ur{constructor(){this.scale=1}parse(t){return[new Nr(t.data,t.timestamp,t.timestamp)]}}class zr{constructor(){this.scale=1,this.asm=new kr}setConfig(t){this.asm.config=t}parse(t){return this.asm.onAACFragment(t)}}class Fr{constructor(){this.h264parser=new Br,this.h265parser=new Lr,this.aacparser=new zr,this.g711parser=new Ur}parse(t){return t.media.ptype==me.H265?this.h265parser.parse(t):t.media.ptype==me.H264?this.h264parser.parse(t):"audio"==t.media.type?t.media.rtpmap&&"MPEG4-GENERIC"===(null===(e=t.media.rtpmap[t.media.fmt[0]])||void 0===e?void 0:e.name)||t.media.ptype===me.AAC?this.aacparser.parse(t):this.g711parser.parse(t):null;var e}}const Wr=ke("parser:sdp");class Hr{constructor(){this.version=-1,this.origin=null,this.sessionName=null,this.timing=null,this.sessionBlock={},this.media={},this.tracks={},this.mediaMap={},this.isNvmpAccPlayBack=!1}parse(t){return Wr.log("sdp content: ",t),new Promise((e,i)=>{let r=t,n=!0,s=this.sessionBlock;for(let t of r.split("\n"))if(t=t.replace(/\r/,""),0!==t.length){switch(t.charAt(0)){case"v":if(-1!==this.version)return Wr.log("Version present multiple times in SDP"),i(),!1;n=n&&this._parseVersion(t);break;case"o":if(null!==this.origin)return Wr.log("Origin present multiple times in SDP"),i(),!1;n=n&&this._parseOrigin(t);break;case"s":if(null!==this.sessionName)return Wr.log("Session Name present multiple times in SDP"),i(),!1;n=n&&this._parseSessionName(t);break;case"t":if(null!==this.timing)return Wr.log("Timing present multiple times in SDP"),i(),!1;n=n&&this._parseTiming(t);break;case"m":null!==s&&this.sessionBlock!==s&&(this.media[s.type]=s),s={},s.rtpmap={},this._parseMediaDescription(t,s);break;case"a":Hr._parseAttribute(t,s);break;default:Wr.log("Ignored unknown SDP directive: "+t);break}if(!n)return void i()}this.media[s.type]=s,n?e():i()})}_parseVersion(t){let e=t.match(/^v=([0-9]+)$/);return e&&e.length?(this.version=e[1],0==this.version||(Wr.log("Unsupported SDP version:"+this.version),!1)):(Wr.log("'v=' (Version) formatted incorrectly: "+t),!1)}_parseOrigin(t){let e=t.match(/^o=(-?) ([0-9]+) (-?[0-9]+) (-?[0-9]+) (IN) (IP4|IP6) ([^ ]+)$/);return e&&e.length?(this.origin={},this.origin.username=e[2],this.origin.sessionid=e[3],this.origin.sessionversion=e[4],this.origin.nettype=e[5],this.origin.addresstype=e[6],this.origin.unicastaddress=e[7],!0):(Wr.log("'o=' (Origin) formatted incorrectly: "+t),!1)}_parseSessionName(t){let e=t.match(/^s=([^\r\n]+)$/);return e&&e.length?(this.sessionName=e[1],!0):(Wr.log("'s=' (Session Name) formatted incorrectly: "+t),!1)}_parseTiming(t){let e=t.match(/^t=([0-9]+) ([0-9]+)$/);return e&&e.length?(this.timing={},this.timing.start=e[1],this.timing.stop=e[2],!0):(Wr.log("'t=' (Timing) formatted incorrectly: "+t),!1)}_parseMediaDescription(t,e){let i=t.match(/^m=([^ ]+) ([^ ]+) ([^ ]+)[ ]/);if(!i||!i.length)return Wr.log("'m=' (Media) formatted incorrectly: "+t),!1;e.type=i[1],e.port=i[2],e.proto=i[3],e.fmt=t.substr(i[0].length).split(" ").map((function(t){return parseInt(t)}));for(let r of e.fmt)this.mediaMap[r]=e;return!0}static _parseAttribute(t,e){if(null===e)return!0;let i,r=t.indexOf(":"),n=t.substr(0,-1===r?2147483647:r);switch(n){case"a=recvonly":case"a=sendrecv":case"a=sendonly":case"a=inactive":e.mode=t.substr("a=".length);break;case"a=range":i=t.match(/^a=range:\s*([a-zA-Z-]+)=([0-9.]+|now)\s*-\s*([0-9.]*)$/),e.range=[Number("now"==i[2]?-1:i[2]),Number(i[3]),i[1]];break;case"a=control":e.control=t.substr("a=control:".length);break;case"a=rtpmap":if(i=t.match(/^a=rtpmap:(\d+) (.*)$/),null===i)return Wr.log("Could not parse 'rtpmap' of 'a='"),!1;let r=parseInt(i[1]);e.rtpmap[r]={};let n=i[2].split("/");e.rtpmap[r].name=n[0].toUpperCase(),e.rtpmap[r].clock=n[1],void 0!==n[2]&&(e.rtpmap[r].encparams=n[2]),e.ptype=me.string_map[n[0].toUpperCase()];break;case"a=fmtp":if(i=t.match(/^a=fmtp:(\d+) (.*)$/),0===i.length)return Wr.log("Could not parse 'fmtp' of 'a='"),!1;e.fmtp={};for(let t of i[2].split(";")){let i=t.indexOf("=");e.fmtp[t.substr(0,i).toLowerCase().trim()]=t.substr(i+1).trim()}break}return!0}getSessionBlock(){return this.sessionBlock}hasMedia(t){return void 0!=this.media[t]}getMediaBlock(t){return this.media[t]}getMediaBlockByPayloadType(t){return this.mediaMap[t]||null}getMediaBlockList(){let t=[];for(let e in this.media)t.push(e);return t}}class jr{constructor(){this.fragments=[],this.pesLength=0,this.pesPkt=null}parse(t){if(!this.extPresent)return null;{let e=this.parseExtension(t);e.data=t.subarray(e.offset)}}parseHeader(){let t=this.fragments[0],e=(t[0]<<16)+(t[1]<<8)+t[2];if(this.extPresent=![190,191].includes(t[3]),1===e){let e=(t[4]<<8)+t[5];return e?(this.pesLength=e,this.hasLength=!0):(this.hasLength=!1,this.pesPkt=null),!0}return!1}static PTSNormalize(t,e){let i;if(void 0===e)return t;i=e4294967296)t+=i;return t}parseExtension(t){let e,i,r,n=0,s=0;return e=t[1],192&e&&(n=536870912*(14&t[3])+4194304*(255&t[4])+16384*(254&t[5])+128*(255&t[6])+(254&t[7])/2,n>4294967295&&(n-=8589934592),64&e?(s=536870912*(14&t[8])+4194304*(255&t[9])+16384*(254&t[10])+128*(255&t[11])+(254&t[12])/2,s>4294967295&&(s-=8589934592)):s=n),i=t[2],r=i+9,{offset:r,pts:n,dts:s}}feed(t,e){let i=null;if(e&&this.fragments.length){if(!this.parseHeader())throw new Error("Invalid PES packet");let t=6,e={};this.extPresent&&(e=this.parseExtension(this.fragments[0].subarray(6)),t=e.offset),this.pesLength>0&&(this.pesPkt=new Uint8Array(this.pesLength));let r=0;while(this.pesLength&&this.fragments.length){let e=this.fragments.shift();if(t){if(e.byteLength=6?(r=5,u=4,h=n-3):(r=2,u=2,h=n):-1!==c.indexOf("android")?(r=2,u=2,h=n):(r=5,u=4,n>=6?h=n-3:(1===s&&(r=2,u=2),h=n));let l=new Uint8Array(u);return l[0]=r<<3,l[0]|=(14&n)>>1,l[1]|=(1&n)<<7,l[1]|=s<<3,5===r&&(l[1]|=(14&h)>>1,l[2]=(1&h)<<7,l[2]|=8,l[3]=0),{config:{config:l,codec:"mp4a.40."+r,samplerate:Vr.SampleRates[n],channels:s},size:a-e.bytepos,frameCount:o,offset:e.bytepos}}}var Gr=i("af87");const Yr=ke("parse ts");class $r{static get AAC(){return 15}static get ID3(){return 21}static get H264(){return 27}static get H265(){return 36}static get PCMA(){return 144}static get PCMU(){return 145}static get PCMA_W(){return 146}}class Xr{static get PACKET_LENGTH(){return 188}constructor(){this.pmtParsed=!1,this.pesParserTypes=new Map,this.pesParsers=new Map,this.pesAsms={},this.ontracks=null,this.toSkip=0,this.pesTypes={},this.iframeTime=0,this.startPts=0,this.scale=1,this.patInfo={pmtList:[]},this.isEncounterVirtualIFrame=!1,this.isEncounterDecodeOnlyIFrame=!1,this.getVideoESTimesAfterGetFrameType=0}updatePTScale(t){t&&(this.scale=t)}addPesParser(t,e){this.pesParserTypes.set(t,e)}parse(t){let e=new de(t);if(71===t[0]){e.skipBits(9);let i=e.readBits(1);e.skipBits(1);let r=e.readBits(13);e.skipBits(2);let n=e.readBits(1),s=e.readBits(1);if(e.skipBits(4),n){let t=e.readBits(8);if(this.toSkip=e.skipBits(8*t),e.finished())return}if(!s)return;let a=t.subarray(e.bytepos);if(this.pmtParsed&&this.pesParsers.has(r)){let t=this.pesAsms[r].feed(a,i);if(t){(!this.startPts||t.pts-this.startPts<0||t.pts-this.startPts>9e5)&&(this.startPts=t.pts);let e=1e3*(this.iframeTime+(t.pts-this.startPts)*this.scale/9e4),i=this.pesParsers.get(r).parse(t),n=this.pesTypes[r]===$r.H264||this.pesTypes[r]===$r.H265;return i.timestamp=parseInt(e),i.mType=n?"video":"audio",(this.isEncounterVirtualIFrame||this.isEncounterDecodeOnlyIFrame)&&n&&(++this.getVideoESTimesAfterGetFrameType,2===this.getVideoESTimesAfterGetFrameType&&(i.units.forEach(t=>{t.isVirtualI=this.isEncounterVirtualIFrame,t.isDecodeOnlyI=this.isEncounterDecodeOnlyIFrame}),this.isEncounterVirtualIFrame=!1,this.isEncounterDecodeOnlyIFrame=!1,this.getVideoESTimesAfterGetFrameType=0)),i}}else 0===r?(this.patInfo=this.parsePAT(a),this._hasLogPat||(Yr.log("pat info: ",this.patInfo),this._hasLogPat=!0)):this.patInfo.pmtList.find(t=>t.pmtId===r)?(this.parsePMT(a),this.pmtParsed=!0,this._hasLogPmt||(Yr.log("pmt info: ",this.patInfo.pmtList.find(t=>t.pmtId===r)),this._hasLogPmt=!0)):8191===r&&this.parseNPT(a)}return null}parsePAT(t){let e=new de(t),i={};e.skipBits(8),i.tableId=e.readBits(8),i.sectionSyntax=e.readBits(1),i.zero=e.readBits(1),i.reserved1=e.readBits(2),i.sectionLength=e.readBits(12),i.transportStreamId=e.readBits(16),i.reserved2=e.readBits(2),i.version=e.readBits(5),i.currentNextIndicator=e.readBits(1),i.sectionNumber=e.readBits(8),i.lastSectionNumber=e.readBits(8),i.pmtList=[];for(let r=0;r0){let t=e.readBits(8);e.skipBits(3);let i=e.readBits(13);e.skipBits(6);let r=e.readBits(10);if(e.skipBits(8*r),[$r.AAC,$r.PCMA,$r.H264,$r.H265,$r.PCMA_W,$r.PCMU].includes(t)&&this.pesParserTypes.has(t)&&(!this.pesParsers.has(i)||this.pesTypes[i]!==t))switch(this.pesParsers.set(i,new(this.pesParserTypes.get(t))(t)),this.pesAsms[i]=new jr,this.pesTypes[i]=t,t){case $r.H264:s.add({type:me.H264,offset:0});break;case $r.H265:s.add({type:me.H265,offset:0});break;case $r.AAC:s.add({type:me.AAC,offset:0});break;case $r.PCMA:s.add({type:me.G711A,offset:0});break;case $r.PCMA_W:s.add({type:me.PCMA_W,offset:0});break;case $r.PCMU:s.add({type:me.PCMU,offset:0});break}a-=5+r}this.ontracks&&this.ontracks(Gr["Array"].from(s))}parseNPT(t){let e=new de(t),i=e.readBits(8);switch(i){case 0:break;case 1:if(e.skipBits(16),this.iframeTime=e.readBits(64),this.startPts=0,88===e.readBits(8)&&70===e.readBits(8)&&73===e.readBits(8)&&84===e.readBits(8)){let t=e.readBits(8);0!=(128&t)&&(this.isEncounterVirtualIFrame=!0),0!=(64&t)&&(this.isEncounterDecodeOnlyIFrame=!0),this.getVideoESTimesAfterGetFrameType=0}break;case 2:break;default:break}}}class Qr{static get PARSERS(){return{[$r.H264]:Rr,[$r.H265]:Pr}}static get PAYLOAD_TYPE_MAP(){return{[$r.H264]:me.H264,[$r.H265]:me.H265}}constructor(t){this.lastUnit=null,this.payloadType=Qr.PAYLOAD_TYPE_MAP[t]||me.H264;let e=Qr.PARSERS[t];this.naluasm=e?new e:null}parse(t){if(!this.naluasm)return null;let e,i,r,n=t.data,s=0,a=n.byteLength,o=0,h=[];while(s1&&(i=m)}while(h+50&&h+p.offset+p.size<=u))break;{c=i+o*a;let t=new Ir(e.subarray(h+p.offset,h+p.offset+p.size),c);for(t.samplerate=this.config.samplerate,g.units.push(t),h+=p.offset+p.size,o++;hthis._wasmOpts.env.memoryBase>>>6)throw new Error("overflow");this._memory.set(new Uint8Array(t.buffer,t.byteOffset,t.byteLength))}}class rn extends en{constructor(t,e,i){super(t,e),this._bitCount=i,this._indexDe=rn._currentIndex,this._indexEn=rn._currentIndex+1,rn._currentIndex=rn._currentIndex+2&63,this._wasm.instance.exports._initG726State(this._indexDe,this._bitCount),this._wasm.instance.exports._initG726State(this._indexEn,this._bitCount)}decodeBe(t){return this._copyToMemory(t),this._wasm.instance.exports._decodeG726(this._indexDe,0,t.byteLength,t.byteLength,0),new Int16Array(this._memory.buffer,t.byteLength,(t.byteLength<<4)/this._bitCount>>>1)}encodeBe(t){return this._copyToMemory(t),this._wasm.instance.exports._encodeG726(this._indexEn,0,t.byteLength/2,t.byteLength,0),new Uint8Array(this._memory.buffer,t.byteLength,t.byteLength*this._bitCount>>>4)}decodeLe(t){return this._copyToMemory(t),this._wasm.instance.exports._decodeG726(this._indexDe,0,t.byteLength,t.byteLength,1),new Int16Array(this._memory.buffer,t.byteLength,(t.byteLength<<4)/this._bitCount>>>1)}encodeLe(t){return this._copyToMemory(t),this._wasm.instance.exports._encodeG726(this._indexEn,0,t.byteLength/2,t.byteLength,1),new Uint8Array(this._memory.buffer,t.byteLength,t.byteLength*this._bitCount>>>4)}}rn._currentIndex=0;class nn extends en{constructor(t,e){super(t,e),this._indexDe=nn._currentIndex,this._indexEn=nn._currentIndex+1,nn._currentIndex=nn._currentIndex+2&63,this._wasm.instance.exports._initAdpcmState(this._indexDe),this._wasm.instance.exports._initAdpcmState(this._indexEn)}resetDecodeState(t){this._wasm.instance.exports._resetAdpcmState(this._indexDe,t.valprev,t.index)}resetEncodeState(t){this._wasm.instance.exports._resetAdpcmState(this._indexEn,t.valprev,t.index)}getDecodeState(){return this._wasm.instance.exports._getAdpcmState(this._indexDe,10236,10238),new nn.State(this._memory[10236]+(this._memory[10237]<<8),this._memory[10238])}getEncodeState(){return this._wasm.instance.exports._getAdpcmState(this._indexEn,10236,10238),new nn.State(this._memory[10236]+(this._memory[10237]<<8),this._memory[10238])}decode(t){return this._copyToMemory(t),this._wasm.instance.exports._decodeAdpcm(this._indexDe,0,10240,t.byteLength<<1),new Int16Array(this._memory.buffer,10240,t.byteLength<<1)}encode(t){return this._copyToMemory(t),this._wasm.instance.exports._encodeAdpcm(this._indexEn,0,10240,t.byteLength>>>1),new Uint8Array(this._memory.buffer,10240,t.byteLength>>>2)}}nn._currentIndex=0,nn.State=class{constructor(t,e){this.valprev=t,this.index=e}};class sn{constructor(t,e){this.stream_type=e,this.endpoint=t,this.eventSource=new J,this.dataQueue=[]}static canTransfer(t){return sn.streamTypes().includes(t)}static streamTypes(){return[]}destroy(){this.eventSource.destroy()}connect(){}disconnect(){}reconnect(){return this.disconnect().then(()=>this.connect())}setEndpoint(t){return this.endpoint=t,this.reconnect()}send(){}prepare(){}onData(){}}var an=sn;i("13d5"),i("9485");class on{static parse(t){let e={},i=/^([^:]+):\/\/([^\/]+)(.*)$/,r=i.exec(t);if(!r)return null;e.full=t,e.protocol=r[1],e.urlpath=r[3];let n=e.urlpath.split("/");e.basename=n.pop().split(/\?|#/)[0],e.basepath=n.join("/");let s=r[2].split("@"),a=s[0].split(":"),o=[null,null];2===s.length&&(o=s[0].split(":"),a=s[1].split(":")),e.user=o[0],e.pass=o[1],e.host=a[0],e.auth=e.user&&e.pass?`${e.user}:${e.pass}`:"",e.port=null==a[1]?on.protocolDefaultPort(e.protocol):a[1],e.portDefined=null!=a[1],e.location=`${e.host}:${e.port}`,e.query={};let h=e.urlpath.split("?")[1];return h&&(e.query=h.split("&").reduce((t,e)=>{let i=e.split("=");return t[i[0]]=i[1],t},{})),"unix"==e.protocol&&(e.socket=e.port,e.port=void 0),e}static full(t){return`${t.protocol}://${t.auth?t.auth+"@":""}${t.location}/${t.urlpath}`}static isAbsolute(t){return/^[^:]+:\/\//.test(t)}static protocolDefaultPort(t){switch(t){case"rtsp":return 554;case"http":return 80;case"https":return 443}return 0}}var hn=on;const cn="transport:ws",un=ke(cn);class ln{static get PROTO(){return"WSP"}static get V1_1(){return"1.1"}static get CMD_INIT(){return"INIT"}static get CMD_JOIN(){return"JOIN"}static get CMD_WRAP(){return"WRAP"}static get CMD_GET_INFO(){return"GET_INFO"}static get WCC_INVALID_DOMAIN(){return 4e3}constructor(t){this.ver=t}build(t,e,i=""){let r="";e.seq||(e.seq=++ln.seq);for(let n in e)r+=`${n}: ${e[n]}\r\n`;return`${ln.PROTO}/${this.ver} ${t}\r\n${r}\r\n${i}`}static parse(t){let e=t.indexOf("\r\n\r\n"),i=t.substr(0,e).split("\r\n"),r=i.shift().match(new RegExp(`${ln.PROTO}/${ln.V1_1}\\s+(\\d+)\\s+(.+)`));if(r){let n={code:Number(r[1]),msg:r[2],data:{},payload:""};while(i.length){let t=i.shift();if(!t)break;{let[e,i]=t.split(":");n.data[e.trim()]=i.trim()}}return n.payload=t.substr(e+4),n}return null}}ln.seq=0;let dn={};class fn{static get CHN_CONTROL(){return"control"}static get CHN_DATA(){return"data"}static get CHN_RTP(){return"rtsp-rtp"}static get CHN_TP_PRIVATE(){return"tp-private"}constructor({wsurl:t,streamType:e,wsId:i,binaryType:r="arraybuffer",proto:n=fn.CHN_CONTROL}){this.url=t,this.endpoint=hn.parse(this.url),this.streamType=e,this.data_handler=()=>{},this.error_handler=()=>{},this.disconnect_handler=()=>{},this.awaitingPromises={},this.seq=0,this.encryptor=null,this.wsId=i,this.proto=n,this.binaryType=r,this.connectState=fn.CHN_CONTROL,dn[i]=0,this.reconnectTime=0,this.isStopped=!1}set_data_handler(t){this.data_handler=t}set_error_handler(t){this.error_handler=t}set_disconnect_handler(t){this.disconnect_handler=t}close(){return new Promise(t=>{this.ctrlChannel?(this.ctrlChannel.close(),this.ctrlChannel.onclose=null,this.dataChannel&&(this.dataChannel.onclose=null,this.dataChannel.close()),this.stop(),t()):t()})}onDisconnect(t){if(this.ctrlChannel.onclose=null,this.ctrlChannel.close(),this.dataChannel&&(this.dataChannel.onclose=null,this.dataChannel.close()),this.disconnect_handler(this),t.code===ln.WCC_INVALID_DOMAIN){let t=new Me(Me.MEDIA_ERR_TRANSPORT);t.message="Invalid Domain (credentials)",Log.error("Invalid domain (credentials)"),this.error(t)}}initDataChannel(){this.connectState=fn.CHN_DATA,this.dataChannel=this.ctrlChannel,this.dataChannel.binaryType="arraybuffer",this.dataChannel.onopen=()=>{},this.dataChannel.onmessage=t=>{let{data:e}=t;this.reconnectTime=0,this.data_handler&&this.data_handler(e);let i=this.awaitingPromises[dn[this.wsId]];if(i){let t="";if(e instanceof ArrayBuffer){let i=new Uint8Array(e),r=ir(i,[13,10,13,10]);r&&(t=String.fromCharCode.apply(null,r[0]))}t.length&&"$"!==t[0]&&-1===t.indexOf(" video/mp2t")&&(e instanceof ArrayBuffer?i.resolve(String.fromCharCode.apply(null,new Uint8Array(e))):i.resolve(e),this.awaitingPromises[dn[this.wsId]]=null)}},this.dataChannel.onerror=t=>{un.error("[data] "+t.type),this.error(Me.MEDIA_ERR_TRANSPORT),this.dataChannel.close()},this.dataChannel.onclose=t=>{un.error(`[data] ${t.type}. code: ${t.code}, reason: ${t.reason||"unknown reason"}`),!this.isStopped&&this.reconnectTime<3?(this.reconnectTime++,this.connect().then(()=>{this.data_handler("reconnect")})):this.onDisconnect(t)}}initCtrlChannel(t){this.connectState=fn.CHN_CONTROL,this.ctrlChannel.onopen=()=>{un.log("onopen stream_type",this.streamType),un.log("onopen url",this.url),t&&t()},this.ctrlChannel.onmessage=t=>{let{data:e}=t;e instanceof ArrayBuffer&&(e=String.fromCharCode.apply(null,new Uint8Array(e))),!e.length||"$"===e[0]||e.indexOf(" video/mp2t")>-1||(un.log("on websocket msg: ",e),this.awaitingPromises[dn[this.wsId]].resolve(e),-1!==e.indexOf("RTP-Info")&&this.initDataChannel(this.channel_id))},this.encryptionKey=void 0,this.encryptionKey&&this.encryptor.setPublicKey(this.encryptionKey),this.ctrlChannel.onerror=t=>{un.error("[ctrl] "+t.type,t),this.error(Me.MEDIA_ERR_CONNECT),this.ctrlChannel.close()},this.ctrlChannel.onclose=t=>{un.error(`[ctrl] ${t.type}. code: ${t.code} ${t.reason||"unknown reason"}`),this.onDisconnect(t)}}connect(){return this.encryptionKey=null,new Promise(t=>{let e=this.url.replace("https://","wss://");this.ctrlChannel=new WebSocket(e,this.proto),un.log("new WebSocket url",e),this.ctrlChannel.binaryType="arraybuffer",this.connected=!1,this.initCtrlChannel(t)})}encrypt(t){if(this.encryptionKey){let e=this.encryptor.encrypt(t);return!1===e?void this.error(Me.MEDIA_ERR_ENCRYPTED):e}return t}send(t,e){return this.ctrlChannel.readyState!==WebSocket.OPEN?(this.close(),{promise:Promise.resolve()}):(dn[this.wsId]++,"string"===typeof t&&un.log("send data:\r\n",t),{promise:new Promise((i,r)=>{this.awaitingPromises[dn[this.wsId]]={resolve:i,reject:r};let n=this.encrypt(t);"blob"!==this.binaryType||e||(n=new Blob([n])),this.ctrlChannel.send(n)})})}error(t){return void 0!==t&&(this.error_=new Me(t),this.error_handler&&this.error_handler(this.error_)),this.error_}stop(){this.isStopped=!0}}var pn=fn;class gn{static get HLS(){return"hls"}static get RTSP(){return"rtsp"}static get RELAY(){return"relay"}static get FILE(){return"file"}static get DEVICE(){return"device"}static isSupported(t){return[gn.HLS,gn.RTSP,gn.RELAY,gn.FILE,gn.DEVICE].includes(t)}static fromUrl(t){let e;try{e=hn.parse(t)}catch(i){return null}switch(e.protocol){case"rtsp":return gn.RTSP;case"http":return null;case"https":return t.indexOf(".m3u8")>=0?gn.HLS:t.indexOf("Relay")?gn.RELAY:null;default:return null}}static fromMime(t){switch(t){case"application/x-rtsp":return gn.RTSP;case"application/vnd.apple.mpegurl":case"application/x-mpegurl":return gn.HLS;default:return null}}}var mn=gn;class vn extends an{constructor(t,e={socket:`${location.protocol.replace("http","ws")}//${location.host}/ws/`,binaryType:"arraybuffer"}){super(null,t),this.proxies=[],this.currentProxy=0,this.socketUrl=e.socket,this.type=t,this.ready=this.connect(),this.wsId="ws_"+(new Date).getTime(),this.binaryType=e.binaryType,this.refreshEvent=new CustomEvent("refresh-url",{detail:"refresh-url"})}destroy(){return this.disconnect().then(()=>super.destroy())}static canTransfer(t){return vn.streamTypes().includes(t)}static streamTypes(){return["hls","rtsp","relay"]}connect(){return this.disconnect().then(()=>{let t,e=[];switch(this.type){case mn.RTSP:t=pn.CHN_CONTROL;break;case mn.RELAY:t=pn.CHN_TP_PRIVATE;break;default:t=pn.CHN_CONTROL;break}let i=new pn({wsurl:this.socketUrl,streamType:this.type,wsId:this.wsId,binaryType:this.binaryType,proto:t});return i.set_error_handler(t=>{this.eventSource.dispatchEvent("error",t)}),i.set_disconnect_handler(t=>{this.eventSource.dispatchEvent("disconnected",{code:t.code,reason:t.reason}),window.dispatchEvent?window.dispatchEvent(this.refreshEvent):window.fireEvent(this.refreshEvent)}),i.set_data_handler(t=>{if("reconnect"===t)this.dataQueue.push(t);else if("string"===typeof t){const e=new TextEncoder,i=e.encode(t);this.dataQueue.push(new Uint8Array(i))}else this.dataQueue.push(new Uint8Array(t));this.eventSource.dispatchEvent("data")}),e.push(i.connect().then(()=>{this.eventSource.dispatchEvent("connected")}).catch(t=>{throw this.eventSource.dispatchEvent("error",new Me(Me.errorTypes.MEDIA_ERR_CONNECT)),new Error(t)})),this.proxies.push(i),Promise.all(e)})}disconnect(){let t=[];for(let e=0;e{let r=t.match(e);if(null!==r)return[i.type,i.version]=[r[1].toLowerCase(),r[2]],/\d/.test(i.type)&&([i.type,i.version]=[i.version,i.type]),!0}),e.indexOf("64")>=0?i.bit="64":i.bit="32","undefined"!==typeof e?e.indexOf("Win")>=0?t.indexOf("Windows Phone")>=0?i.os=n.WIN_PHONE:(i.os=n.WINDOWS,/Windows NT ([\d.]+)/i.test(t)&&(i.osVersion=RegExp["$1"])):t.indexOf("Android")>=0?i.os=n.ANDROID:e.indexOf("iPad")>=0||e.indexOf("iPhone")>=0||e.indexOf("iPod")>=0||e.indexOf("Mac")>=0?i.os=n.IOS:(e.indexOf("X11")>=0||e.indexOf("Linux")>=0||e.indexOf("arm")<0)&&(i.os=n.LINUX):t.indexOf("Android")>=0&&(i.os=n.ANDROID),i};const _n=ke("state machine");class Tn{constructor(t,e){this.stateMachine=e,this.transitions=new Set,this.name=t}activate(){return Promise.resolve(null)}finishTransition(){}failHandler(){}deactivate(){return Promise.resolve(null)}}class Sn{constructor(){this.storage={},this.currentState=null,this.states=new Map}addState(t,{activate:e,finishTransition:i,deactivate:r}){let n=new Tn(t,this);return e&&(n.activate=e),i&&(n.finishTransition=i),r&&(n.deactivate=r),this.states.set(t,n),this}addTransition(t,e){if(!this.states.has(t))throw ReferenceError(`No such state: ${t} while connecting to ${e}`);if(!this.states.has(e))throw ReferenceError(`No such state: ${e} while connecting from ${t}`);return this.states.get(t).transitions.add(e),this}_promisify(t){let e;try{e=t,e.then||(e=Promise.resolve(e))}catch(i){e=Promise.reject(i)}return e}transitionTo(t){if(_n.log("transition to ",t),null==this.currentState){let e=this.states.get(t);return this._promisify(e.activate.call(this)).then(t=>(this.currentState=e,t)).then(e.finishTransition.bind(this)).catch(t=>{throw e.failHandler(),t})}if(this.currentState.name==t)return Promise.resolve();if(this.currentState.transitions.has(t)){let e=this.states.get(t);return this._promisify(e.deactivate.call(this)).then(e.activate.bind(this)).then(t=>(this.currentState=e,t)).then(e.finishTransition.bind(this)).catch(t=>{throw e.failHandler(),t})}return Promise.reject(`No such transition: ${this.currentState.name} to ${t}`)}}var wn=Sn,En=i("bc3a"),xn=i.n(En),An=i("3452"),Cn=i.n(An);function Rn({appKey:t,appSecret:e,terminalId:i,method:r="POST",uri:n,payload:s="UNSIGNED-PAYLOAD"}={}){let a=parseInt(Date.now()/1e3),o=`${r} ${n} tp-link_request`,h=Cn.a.SHA256(s).toString(),c=`HmacSHA256\n${a}\n${o}\n${h}`,u=Cn.a.HmacSHA256(a+"",e),l=Cn.a.HmacSHA256(n,u),d=Cn.a.HmacSHA256("tp-link",l),f=Cn.a.HmacSHA256(c,d).toString(),p=Zi(32),g=`Timestamp=${a},Nonce=${p},AccessKey=${t},Signature=${f},TerminalId=${i}`;return g}const Pn=new De,In=100,kn=Zi(16),Dn=1.5*In;class On{constructor(t={flush:10}){this.options=t,this.eventSource=new J,this.readyToPlay=!1,this.isReconnect=!1,this.channel=0,this.sampleQueues={},this._lastVideoChunk=null,this.isWaitVideoKeyFrame=!1,Object.defineProperties(this,{sourceUrl:{value:null,writable:!0},paused:{value:!0,writable:!0},seekable:{value:!1,writable:!0},connected:{value:!1,writable:!0}}),this._onData=()=>{if(this.connected)while(this.transport.dataQueue.length)this.onData(this.transport.dataQueue.pop())},this._onConnect=this.onConnected.bind(this),this._onDisconnect=this.onDisconnected.bind(this),this._onError=this.onError.bind(this)}static streamType(){return null}static formatScale(t){return"number"!==typeof t||0===t?"1/1":(t=Math.abs(t),t<1?"1/"+parseInt(1/t):parseInt(t)+"/1")}getXAuthHeaders(t){if(!this.options.appKey)return{};let{url:e}=t,i=hn.parse(e),r=i.basepath+"/"+i.basename,n=Object.assign({headers:{"X-Authorization":Rn({appKey:this.options.appKey,appSecret:this.options.appSecret,terminalId:kn,uri:r,payload:JSON.stringify(t.param||{})})}});return n}destroy(){this.detachTransport(),this.stopStreamFlush()}attachTransport(t){this.transport&&this.detachTransport(),this.transport=t,this.transport.eventSource.addEventListener("data",this._onData),this.transport.eventSource.addEventListener("connected",this._onConnect),this.transport.eventSource.addEventListener("disconnected",this._onDisconnect),this.transport.eventSource.addEventListener("error",this._onError)}detachTransport(){this.transport&&(this.transport.eventSource.removeEventListener("data",this._onData),this.transport.eventSource.removeEventListener("connected",this._onConnect),this.transport.eventSource.removeEventListener("disconnected",this._onDisconnect),this.transport.eventSource.removeEventListener("error",this._onError),this.transport.destroy(),this.transport=null)}reset(){}start(){Pn.log("Client started"),this.paused=!1,this.readyToPlay=!0}stop(){Pn.log("Client paused"),this.paused=!0}seek(){}setSource(t){this.stop(),this.endpoint=t,this.sourceUrl=t.urlpath;let{channel:e=""}=t.query;this.channel=e?parseInt(e):0}dropVideoPFrame(t,e){let i=[],r=!1;while(e.length>0){let n=e.shift();if(n.isParameterSet()||n.isKeyframe()||n.isVirtualI){if(i.push(n),n.isKeyframe()||n.isVirtualI){r=!0;break}}else t.length0&&this.pushVideoChunk(t,i),r}pushVideoChunk(t,e){let i=[];e.forEach(t=>{t.isStartSlice()?(this._lastVideoChunk&&i.push(this._lastVideoChunk),this._lastVideoChunk=t):this._lastVideoChunk&&this._lastVideoChunk.appendData(t.data)}),t.push(i),"hidden"===document.visibilityState&&this.eventSource.dispatchEvent("flush")}flushSampleQueue(){for(let t in this.sampleQueues){if("video"===t){if("video"!==this.options.streamType){let e=this.sampleQueues[t];if(this._lastVideoChunk&&this._lastVideoChunk.seq)this.onPlayerNotify(this._lastVideoChunk);else for(let t=e.length-1;t>=0;--t){let i=e[t];if(i.length>0&&i[0].seq){this.onPlayerNotify(i[0]);break}}}this.isWaitVideoKeyFrame=!0,this._lastVideoChunk=null}this.sampleQueues[t]=[]}}feed(t,e){const{streamType:i}=this.options;if("hidden"===document.visibilityState&&"video"===i)"video"===t&&(this.isWaitVideoKeyFrame=!0,this.dropVideoPFrame(this.sampleQueues[t],e));else if(this.sampleQueues[t].length<=Dn){if(this.isWaitVideoKeyFrame&&"video"===t){let i=this.dropVideoPFrame(this.sampleQueues[t],e);i&&(this.isWaitVideoKeyFrame=!1,console.log("base client get i stop drop frame"))}e.length>0&&("video"===t?this.pushVideoChunk(this.sampleQueues[t],e):this.sampleQueues[t].push(e))}else"video"===t&&(this.isWaitVideoKeyFrame=!0,this.dropVideoPFrame(this.sampleQueues[t],e))}startStreamFlush(){this.stopStreamFlush(),this.flushInterval=setInterval(()=>{this.eventSource.dispatchEvent("flush")},this.options.flush)}stopStreamFlush(){clearInterval(this.flushInterval)}onData(){}onConnected(){this.seekable||(this.transport.dataQueue=[],this.eventSource.dispatchEvent("clear")),this.connected=!0}onDisconnected(){this.isReconnect||(this.connected=!1,this.eventSource.dispatchEvent("disconnected"))}onError(t){this.eventSource.dispatchEvent("error",t.detail)}queryCredentials(){return Promise.resolve()}setCredentials(t,e){this.endpoint.user=t,this.endpoint.pass=e,this.endpoint.auth=`${t}:${e}`}setPlaybackConfig(){}onPlayerNotify(){}}var Mn=On;window.URL=window.URL||window.webkitURL,navigator.getUserMedia=navigator.getUserMedia||navigator.webkitGetUserMedia||navigator.mozGetUserMedia||navigator.msGetUserMedia;let Nn=function(t,e){e=e||{},e.sampleBits=e.sampleBits||16,e.sampleRate=e.sampleRate||8e3;let i=new(window.webkitAudioContext||window.AudioContext),r=i.createMediaStreamSource(t),n=i.createScriptProcessor||i.createJavaScriptNode,s=n.apply(i,[4096,1,1]),a={size:0,buffer:[],inputSampleRate:i.sampleRate,inputSampleBits:16,outputSampleRate:e.sampleRate,oututSampleBits:e.sampleBits,input:function(t){this.buffer.push(new Float32Array(t)),this.size+=t.length},clear:function(){this.buffer=[],this.size=0},compress:function(){let t=new Float32Array(this.size),e=0;for(let o=0;o{};let o=this;this.stop=function(){r.disconnect(),s.disconnect();const e=t.getAudioTracks();e[0].stop()},this.clear=function(){a.clear()},this.getPcmData=function(){return a.transToPcmData()},this.play=function(t){let e=document.getElementById("downloadRec");e.href=window.URL.createObjectURL(this.getPcmData()),e.download=(new Date).toLocaleString()+".mp3",t.src=window.URL.createObjectURL(this.getPcmData())},s.onaudioprocess=function(t){a.clear(),a.input(t.inputBuffer.getChannelData(0)),o.audioTatch()}};Nn.throwError=function(t){throw alert(t),new function(){this.toString=function(){return t}}},Nn.canRecording=null!=navigator.getUserMedia,Nn.get=function(t,e){if(t)if(navigator.mediaDevices&&navigator.mediaDevices.getUserMedia)navigator.mediaDevices.getUserMedia({audio:!0}).then(i=>{let r=new Nn(i,e);t({rec:r})},e=>{t({error:e})});else{if(!navigator.getUserMedia)return void Nn.throwError("当前浏览器不支持录音功能。");navigator.getUserMedia({audio:!0},(function(i){let r=new Nn(i,e);t({rec:r})}),(function(e){t({error:e})}))}};var Bn=Nn;class Ln{static get RTSP_1_0(){return"RTSP/1.0"}static get HTTP_1_1(){return"HTTP/1.1"}static get MULTITRANS(){return"MULTITRANS"}constructor(t){this.version=t}build(t,e,i={},r=null){let n=`${t} ${e} ${this.version}\r\n`;for(let s in i)n+=`${s}: ${i[s]}\r\n`;return null!==r&&(r instanceof Object&&(r=JSON.stringify(r)),n+=`Content-Length: ${r.length}\r\n`),n+="\r\n",null!==r&&(n+=r),n}parse(t){let e=t.split("\r\n");1===e.length&&(e=e[0].split("\n"));let i={headers:{},body:null,code:0,statusLine:""};[,i.code,i.statusLine]=e[0].match(new RegExp(this.version+"[ ]+([0-9]{3})[ ]+(.*)")),i.code=Number(i.code);let r=1;while(e[r]){let[t,n]=e[r].split(/:(.+)/);i.headers[t.toLowerCase()]=n.trim(),r++}let n=e.slice(r).join("\n\r");return i.body=JSON.stringify(n),i}}xn.a.defaults.withCredentials=!0;const Un=ke("client:relay");class zn extends Error{constructor(t){super(t)}}const Fn={PERMISSION_DENIED:1202,NOT_SUPPORTED_ERROR:1203,MANDATORY_UNSATISFIED_ERROR:1204,NotFoundError:1205,NotAllowedError:1208},Wn={"-52211":"REQUEST_NOT_MEET_SHARE_RULES","-82400":"CLOUD_ERR_PARAM","-82401":"CLOUD_ERR_PERMISSION","-82414":"CLOUD_ERR_SERVER","-80702":"COMMON_ERR_SESSION","-80731":"CLOUD_ERR_TOKEN","-80304":"CLOUD_ERR_DEVID","-80732":"CLOUD_ERR_BANDWIDTH","-20002":"DEVICE_ERR_CHN_OFFLINE","-20571":"DEVICE_ERR_CHN_OFFLINE","-52405":"CLOUD_ERR_STREAM_LIMIT","-52413":"DEVICE_ERR_CHN_OFFLINE","-40106":"AUDIO_ERR_AUDIO_ENABLE","-52412":"AUDIO_ERR_AUDIO_NOSUPPORTED","-52411":"AUDIO_ERR_AUDIO_BUSY"},Hn=5;let jn=0;const Vn="client-stream-boundary",qn=200;class Gn extends wn{static get USER_AGENT(){return"SFRtsp 0.3"}static get SLP(){return["1.3"]}static get NVMP(){return["2.0"]}static get RESPONSE_ERR_CODE(){return{429:Me.CLOUD_ERR_STREAM_LIMIT,432:Me.CLOUD_ERR_WINDOW_LIMIT,433:Me.CLOUD_ERR_CLIENT_LIMIT}}static get FINISH_REASON(){return{share_finish:Me.CLOUD_ERR_SHARE_FINISH,permission_deny:Me.CLOUD_ERR_PERMISSION,channel_offline:Me.DEVICE_ERR_CHN_OFFLINE,channel_invalid:Me.DEVICE_ERR_CHN_INVALID,internal_error:Me.COMMON_ERR_INTERNAL,password_changed:Me.DEVICE_ERR_PWD_CHANGED,media_encrypt_changed:Me.CLOUD_ERR_ENCRYPT_CHANGED,relay_lifetime_expired:Me.CLOUD_ERR_FREE,channel_talk_busy:Me.CLOUD_ERR_TALK_BUSY,unbind_device:Me.CLOUD_ERR_UNBIND,lack_bandwidth:Me.CLOUD_ERR_BANDWIDTH,offline:Me.DEVICE_ERR_CHN_OFFLINE}}static get STATE_INITIAL(){return 1}static get STATE_OPTIONS(){return 2}static get STATE_GET_RELAY(){return 4}static get STATE_GET_STREAMS(){return 8}static get STATE_STREAMS(){return 16}static get STATE_TEARDOWN(){return 32}static get STATE_PAUSED(){return 64}static get STATE_PLAY(){return 128}static get STATE_SEND_VOICE(){return 256}constructor(t){super(),this.parent=t,this.transport=null,this.onRelayConfig=null,this.streams=null,this.env=bn(),this.messageBuilder={RTSP:new Ln(Ln.RTSP_1_0),HTTP:new Ln(Ln.HTTP_1_1)},this.isPlaying=!1,this.methods=["PLAY","PAUSE"],this.reconnectTimer=0,this.redirectTime=0,this.addState(Gn.STATE_INITIAL,{}).addState(Gn.STATE_GET_RELAY,{activate:this.getRelayRelease,finishTransition:this.onRelayRelease}).addState(Gn.STATE_OPTIONS,{activate:this.sendOptions,finishTransition:this.onOptions}).addState(Gn.STATE_STREAMS,{}).addState(Gn.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(Gn.STATE_INITIAL)}).addState(Gn.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(Gn.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addTransition(Gn.STATE_INITIAL,Gn.STATE_GET_RELAY).addTransition(Gn.STATE_INITIAL,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_GET_RELAY,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_STREAMS,Gn.STATE_PAUSED).addTransition(Gn.STATE_PAUSED,Gn.STATE_STREAMS).addTransition(Gn.STATE_STREAMS,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_PAUSED,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_PAUSED,Gn.STATE_PLAY).addTransition(Gn.STATE_PLAY,Gn.STATE_STREAMS).addTransition(Gn.STATE_PLAY,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_TEARDOWN,Gn.STATE_INITIAL)}destroy(){clearTimeout(this.reconnectTimer)}setSource(){}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Un.log("start"),this.start())}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(Gn.STATE_TEARDOWN),await this.transitionTo(Gn.STATE_INITIAL)}start(){return this.currentState.name!==Gn.STATE_STREAMS?this.transitionTo(Gn.STATE_GET_RELAY):Promise.resolve()}async stop(){this.started&&await this.transitionTo(Gn.STATE_TEARDOWN),this.shouldReconnect=!1}error(t){this.parent.error(t)}onData(){}reset(){}async reconnect(){return await this.reset(),this.currentState.name!=Gn.STATE_INITIAL?(await this.transitionTo(Gn.STATE_TEARDOWN),this.transitionTo(Gn.STATE_GET_RELAY)):this.transitionTo(Gn.STATE_GET_RELAY)}supports(t){return this.methods.includes(t)}sendRequest(){}async send(t,e="RTSP"){if(this.transport){try{await this.transport.ready}catch(i){throw this.onDisconnected(),i}let r=await this.transport.send(t),n=this.parse(r,e);return n}return Promise.reject("No transport attached")}parse(t,e="RTSP"){let i=t.split("\r\n\r\n"),r=this.messageBuilder[e].parse(i[0]),n=Number(r.headers["content-length"]||0);if(n){let t=i[1];t&&(t=JSON.parse(t)),r.body=t}else r.body="";return Un.log("parsed data: ",r),r}sendTeardown(){let t="TEARDOWN";return this.sendRequest(t,"*")}sendOptions(){return this.reset(),this.started=!0,this.cSeq=0,this.sendRequest("OPTIONS",this.url,{})}onOptions(t){this.methods=t.headers["public"].split(",").map(t=>t.trim()),this.transitionTo(Gn.STATE_GET_STREAMS)}pause(){return this.currentState.name===Gn.STATE_STREAMS||this.currentState.name===Gn.STATE_SEND_VOICE?this.transitionTo(Gn.STATE_PAUSED):Promise.resolve()}sendPause(){}onPause(){}play(){return this.currentState.name===Gn.STATE_PAUSED?this.transitionTo(Gn.STATE_PLAY):Promise.resolve()}sendPlay(){}onPlay(){this.transitionTo(Gn.STATE_STREAMS)}errorException(t){let{type:e,params:i={}}=t;if("response"===e&&0!==i["error_code"]){let t=Wn[i["error_code"]]||"CLOUD_ERR_STREAM";return this.error(Me[t]),this.transitionTo(Gn.STATE_TEARDOWN),!0}return!1}updateReceivedSeq(){}}class Yn extends Gn{constructor(t){super(t),this.slpRecorder=null,this.noisedecoderSlpWorker=null,this.hasNoiseSlpDecoderInit=!1,this.initDecoderSlpWorker(),this.continuityCounterTs=48,this.continuityCounterPes=16,this.continuityCounterPNT=16,this.ptsMultiple=1,this.fPATCount=0,this.fPMTCount=0,this.tsaudioBuffer=new Uint8Array,this.tsCount=0,this.addState(Gn.STATE_SEND_VOICE,{activate:this.sendSlpVoice,finishTransition:this.onSlpVoice}).addTransition(Gn.STATE_GET_RELAY,Gn.STATE_SEND_VOICE).addTransition(Gn.STATE_SEND_VOICE,Gn.STATE_STREAMS).addTransition(Gn.STATE_SEND_VOICE,Gn.STATE_TEARDOWN),this.reset()}async initDecoderSlpWorker(){this.hasNoiseSlpDecoderInit=!1;let{libsWorker:t,libaudio:e,libaudioWasm:i}=await ur();this.noisedecoderSlpWorker=new Worker(t),this.noisedecoderSlpWorker.postMessage({cmd:"init",scripts:[e],wasmBinary:i}),this.noisedecoderSlpWorker.onmessage=t=>{const{data:e={}}=t,{hasInit:i}=e;i?this.hasNoiseSlpDecoderInit=!0:this.transformSlpTsBuffer(e.data)}}setSource(t){Un.log("set source: ",t),this.reset(),this.endpoint=t}async onConnected(){this.shouldReconnect&&(Un.log("start"),this.start())}async reset(){this.deviceBoundary="",this.sessionId="",this.loadedChunks=[],this.parsing=!1,this.cSeq=0,this.payload={},this.receivedSeq=0,this.initParser(),this.currentState?this.currentState.name!=Gn.STATE_INITIAL&&(await this.transitionTo(Gn.STATE_TEARDOWN),await this.transitionTo(Gn.STATE_INITIAL)):await this.transitionTo(Gn.STATE_INITIAL)}initParser(){this.parser=new Xr,this.parser.addPesParser($r.H264,Qr),this.parser.addPesParser($r.H265,Qr),this.parser.addPesParser($r.AAC,Kr),this.parser.addPesParser($r.PCMA_W,tn),this.parser.addPesParser($r.PCMA,Zr),this.parser.ontracks=t=>{let e={};for(let i of t)switch(i.type){case me.H264:e.video_codec="H264",this.parent.sampleQueues["video"]=[];break;case me.H265:e.video_codec="H265",this.parent.sampleQueues["video"]=[];break;case me.G711A:e.audio_codec="G711alaw",this.parent.sampleQueues["audio"]=[];break;case me.AAC:e.audio_codec="AAC",this.parent.sampleQueues["audio"]=[];break;case me.PCMA_W:e.audio_codec="PCMA_W",this.parent.sampleQueues["audio"]=[];break;default:break}e.video_codec&&this.onRelayConfig(e)}}buildBoundary(t="",e,i=""){let r=`--${Vn}\r\n`;if("sendMultiparts"===i?t=le(new Uint8Array(t)):t instanceof Object&&(t=JSON.stringify(t)),"sendMultiparts"===i?(r+="Content-Type: audio/mp2t\r\n",r+="X-If-Encrypt\t: 0\r\n"):r+="Content-Type: application/json\r\n",r+=`Content-Length: ${t.length}\r\n`,this.sessionId&&(r+=`X-Session-Id: ${this.sessionId}\r\n`),e&&(r+=e),r+="\r\n",r+=t,"sendMultiparts"===i){for(var n=r.length,s=new Uint8Array(n),a=0;a{this.reset(),this.redirectTime?this.parent.play():this.parent.start()},500)):(jn=0,this.error(Me.CLOUD_ERR_DEV_RELAY)));if(301===i){let t=e["x-domain"],i=e["x-redirect-cookie"];return this.parent.redirect({domain:t,cookie:i}),void this.redirectTime++}if(this.redirectTime=0,jn=0,this.parent.isReconnect=!1,200!==i){let e=Gn.RESPONSE_ERR_CODE[t.code];return void this.error(e||Me.CLOUD_ERR_DEV_RELAY)}this.deviceBoundary=e["content-type"].split("boundary=")[1];let r=this.transport.socket();r.initDataChannel(),this.transitionTo(Gn.STATE_SEND_VOICE)}sendSlpVoice(){Bn.get(t=>{t.rec?(this.parent.sendAudioStream(),this.slpRecorder=t.rec,this.startSlpRecorder()):this.parent.error(Fn[t.error.name])})}async startSlpRecorder(){this.slpRecorder.start(),this.slpRecorder.audioTatch=()=>{this.slpDataPart()}}async slpDataPart(){let t=new FileReader,e=this;t.onload=function(t){let i=t.target.result,r=2048,n=new Uint8Array([...e.tsaudioBuffer,...new Uint8Array(i)]);if(n.length>0){let t=new Uint8Array(r),i=0;for(let s=0;s=r?new Uint8Array(r):new Uint8Array(n.byteLength-s-1),i=0),s+1===n.byteLength&&(s+1)%r!==0&&(e.tsaudioBuffer=t)}},t.readAsArrayBuffer(this.slpRecorder.getPcmData())}noiseSetSlp(t){let e=localStorage.getItem("aduioData"),i=he(e);this.noisedecoderSlpWorker.postMessage({data:t,audioData:i,samplerate:8e3,decoderType:"_decodePCM",mode:this.parent.options.mode||"aec"})}transformSlpTsBuffer(t){if(!t)return;let e=t,i=new Uint8Array(e),r=this.PacketDataToTs(i,1024);this.sendMultiparts(r,"","sendMultiparts")}PacketDataToTs(t,e){let i=!1,r=188,n=0,s=1504,a=14,o=new ArrayBuffer(s);const h=new DataView(o);if(!i){h.setUint8(n,71),n+=1,h.setUint8(n,64),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,16+(15&this.fPATCount)),this.fPATCount++,n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,176),n+=1,h.setUint8(n,13),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,193),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1;let t=this.pat(),e=fe(new Uint8Array(t.pATSetCrc32Buf),t.setPATSetCrc32Off);h.setUint32(n,e),n+=4;for(var c=n;c<188;c++,n+=1)h.setUint8(n,255);h.setUint8(n,71),n+=1,h.setUint8(n,80),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,16+(15&this.fPMTCount)),this.fPMTCount++,n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,2),n+=1;let r=26,s=r-3;s-=5,h.setUint8(n,176),n+=1,h.setUint8(n,s),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,193),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,225),n+=1,h.setUint8(n,1),n+=1,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,144),n+=1,h.setUint8(n,225),n+=1,h.setUint8(n,1),n+=1,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1;let a=this.pmt(),o=fe(new Uint8Array(a.pmtcrcBuf),a.pmtOff);h.setUint32(n,o),n+=4;for(c=n;c<376;c++,n+=1)h.setUint8(n,255);i=!0}let u=0,l=0,d=0,f=12+a,p=r-f;e<=p?(u=1,l=e):(u=parseInt((e-p-1)/(r-4))+1,u+=1,l=(e-p)%(r-4),0==l&&(l=r-4));for(let g=0;g30&&(this.continuityCounterPNT=16),e.setUint8(i,this.continuityCounterPNT),i+=1,this.continuityCounterPNT++,e.setUint8(i,0),i+=1,e.setUint8(i,parseInt(254*Math.random()+1)),i+=1,t}onSlpVoice(){console.log("结束")}sendMultiparts(t,e,i=""){let r=this.buildBoundary(t,e,i);return this.sendBoundary(r).then(t=>{Un.log("on multiparts\n",t);let{body:e="{}"}=t;e=JSON.parse(e);let{params:i={}}=e;return this.errorException(e)?null:(i.session_id&&(this.sessionId=i.session_id),t)})}onTS(t,e){this.isPlaying||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream")),this.parsing?this.loadedChunks.push(t):(this.parsing=!0,this.parseTS(t,e))}parseTS(t,e){for(let i=0;i{Object.prototype.hasOwnProperty.call(t,"type")||(t.type=r.type),t.timestamp=r.timestamp,t.seq=e}),this.parent.sampleQueues[r.mType].push(t)}}this.parsing=!1,this.loadedChunks.length&&this.onTS(this.loadedChunks.shift())}sendPause(){let{streamType:t}=this.parent.options;if("sdvod"===t){let t={type:"request",seq:0,params:{method:"do",pause:"null"}};this.sendMultiparts(t)}else"dtspk"===t&&this.slpRecorder&&this.slpRecorder.stop();return Promise.resolve()}sendPlay(){let{streamType:t}=this.parent.options;if("sdvod"===t){let t={type:"request",seq:0,params:{method:"do",play:"null"}};this.sendMultiparts(t)}return Promise.resolve()}destroy(){this.slpRecorder&&(this.noisedecoderSlpWorker.postMessage({isStop:!0,decoderType:"_decodePCM"}),this.slpRecorder.clear(),this.slpRecorder.stop()),this.noisedecoderSlpWorker&&this.noisedecoderSlpWorker.terminate()}}class $n extends Gn{constructor(t){super(t),this.rtpRecorder=null,this.rtpSequence=0,this.noisedecoderNvmpWorker=null,this.hasNoiseNvmpDecoderInit=!1,this.initDecoderWorker(),this.payParser=new Fr,this.rtp_channels=new Set,this.rtpCnt=0,this.audioBuffer=new Uint8Array,this.addState(Gn.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onStreamConfigs}).addState(Gn.STATE_SEND_VOICE,{activate:this.sendRtpVoice,finishTransition:this.onSendRtpVoice}).addTransition(Gn.STATE_GET_RELAY,Gn.STATE_GET_STREAMS).addTransition(Gn.STATE_PAUSED,Gn.STATE_GET_STREAMS).addTransition(Gn.STATE_GET_STREAMS,Gn.STATE_SEND_VOICE).addTransition(Gn.STATE_SEND_VOICE,Gn.STATE_GET_STREAMS).addTransition(Gn.STATE_GET_STREAMS,Gn.STATE_STREAMS).addTransition(Gn.STATE_GET_STREAMS,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_SEND_VOICE,Gn.STATE_TEARDOWN).addTransition(Gn.STATE_SEND_VOICE,Gn.STATE_PAUSED).addTransition(Gn.STATE_STREAMS,Gn.STATE_GET_STREAMS),this.reset()}async initDecoderWorker(){this.hasNoiseNvmpDecoderInit=!1;let{libsWorker:t,libaudio:e,libaudioWasm:i}=await ur();this.noisedecoderNvmpWorker=new Worker(t),this.noisedecoderNvmpWorker.postMessage({cmd:"init",scripts:[e],wasmBinary:i}),this.noisedecoderNvmpWorker.onmessage=t=>{const{data:e={}}=t,{hasInit:i}=e;i?this.hasNoiseNvmpDecoderInit=!0:this.transformRtpBuffer(e.data)}}setSource(t){Un.log("set source: ",t),this.reset(),this.endpoint=t,this.url="rtsp://192.168.1.1/multitrans"}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Un.log("start"),this.start())}onData(t){let e=le(t);if("$"!==e[0]){let t;Un.log("on data: ",e);try{t=this.parse(e)}catch(r){return r}if(!t)return;let i,n,{body:s={}}=t,{params:a={}}=s,o=a.event_type;switch(o){case"stream_finish":this.parent.stop(),n=Gn.FINISH_REASON[a.reason],this.error(n||Me.MEDIA_ERR_NETWORK);break;case"channel_preview_params":this.onStreamConfigs(t);break;case"stream_sequence":this.currentSeq=a.sequence;break;case"channel_stream_status":i=a.status&&a.status[0],n=Gn.FINISH_REASON[i],"no_data"===i||n&&(this.parent.stop(),this.error(n));break;default:break}return}let i=t[1];this.rtp_channels.has(i)&&this.onRTP({packet:t.subarray(4),type:i})}useRTPChannel(t){this.rtp_channels.add(t)}forgetRTPChannel(t){this.rtp_channels.delete(t)}async reset(){this.authenticator="",this.methods=[],this.tracks=[],this.rtpBuffer={},this.contentBase="",this.currentState?this.currentState.name!=Gn.STATE_INITIAL&&(await this.transitionTo(Gn.STATE_TEARDOWN),await this.transitionTo(Gn.STATE_INITIAL)):await this.transitionTo(Gn.STATE_INITIAL),this.sdp=null,this.interleaveChannelIndex=0,this.session=null,this.timeOffset=0,this.lastTimestamp=0,this.parent.isReconnect=!0,this.cSeq=0,this.receivedSeq=0,this.currentSeq=0,this.dataBuffer=new Uint8Array([]),this.sessionId=""}sendRequest(t,e,i={},r=null,n="RTSP"){return Object.assign(i,{CSeq:this.cSeq,"User-Agent":Gn.USER_AGENT}),this.cSeq++,this.authenticator&&(i["Authorization"]=this.authenticator(t)),this.send(this.messageBuilder[n].build(t,e,i,r),n).catch(n=>{if(n instanceof zn)return this.sendRequest(t,e,i,r);throw n})}sendMultitrans(t,e={}){let i="MULTITRANS",r={"Content-Type":"application/json"};return this.sessionId&&(r["X-Session-Id"]=this.sessionId),Object.assign(r,e),this.sendRequest(i,this.url,r,t).then(t=>{Un.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}getRelayRelease(){let{relayOptions:t={}}=this.parent,{cookie:e,token:i,relayVersion:r}=t,n={Host:this.endpoint.location,"User-Agent":"Client=TP-LINK/"+r,Cookie:e,"X-token":i,"X-Client-UUID":this.parent.clientUUID,"X-Redirect-Times":this.redirectTime,"X-Client-Model":this.env.os,Accept:"/",Upgrade:"websocket",Connection:"upgrade","Sec-WebSocket-Key":X().split("-").join(""),"Sec-WebSocket-Protocol":"tp-private","Sec-WebSocket-Version":"13"},s="GET",a="",o=this.messageBuilder["HTTP"].build(s,this.endpoint.urlpath,n,a);return this.send(o,"HTTP")}onRelayRelease(t){let{headers:e,code:i}=t;if(404!==i&&410!==i){if(301===i){let t=e["x-domain"],i=e["x-redirect-cookie"];return this.parent.redirect({domain:t,cookie:i}),void this.redirectTime++}if(this.redirectTime=0,jn=0,this.parent.isReconnect=!1,101===i)this.transitionTo(Gn.STATE_GET_STREAMS);else{let e=Gn.RESPONSE_ERR_CODE[t.code];this.error(e||Me.CLOUD_ERR_DEV_RELAY)}}else jn<=Hn?(jn++,this.reconnectTimer=setTimeout(()=>{this.reset(),this.redirectTime?this.parent.play():this.parent.start()},500)):(jn=0,this.error(Me.CLOUD_ERR_DEV_RELAY))}async getStreams(){this.started=!0,this.isPlaying=!1;let{channel:t=0}=this.parent,e={method:"get",talk:{mode:this.parent.options.mode||"aec",channel:t}},i={type:"request",seq:0,params:e},r={"X-Data-Window-Size":qn};return this.sendMultitrans(i,r)}async onStreamConfigs(t){if(!t)return;let{body:e={}}=t,{params:i={}}=e;if(this.errorException(e))return;this.sessionId=i["session_id"],this.sdp=new Hr,this.timeOffset=0,this.lastTimestamp=0;let r={type:"audio",port:0,proto:"",fmt:[8]},n="G711alaw";r.ptype=me.string_map[n];for(let a of r.fmt)this.sdp.mediaMap[a]=r;this.sdp.media[r.type]=r,this.rtpBuffer[r.fmt[0]]=[],this.useRTPChannel(0),this.useRTPChannel(1),this.useRTPChannel(2),this.parent.sampleQueues["video"]=[],this.parent.sampleQueues["audio"]=[],this.rtpFactory=new Mr(this.sdp);let s=this.transport.socket();s.initDataChannel(),this.transitionTo(Gn.STATE_SEND_VOICE)}onSendRtpVoice(){}sendRtpVoice(){Bn.get(t=>{t.rec?(this.parent.sendAudioStream(),this.rtpRecorder=t.rec,this.startRecorder()):this.parent.error(Fn[t.error.name])})}async startRecorder(){this.rtpRecorder.start(),this.rtpRecorder.audioTatch=()=>{this.sendRtpData()}}async sendRtpData(){let t=new FileReader,e=this;t.onload=function(t){let i=t.target.result,r=2048,n=new Uint8Array([...e.audioBuffer,...new Uint8Array(i)]);if(n.length>0){let t=new Uint8Array(r),i=0;for(let s=0;s=r?new Uint8Array(r):new Uint8Array(n.byteLength-s-1),i=0),s+1===n.byteLength&&(s+1)%r!==0&&(e.audioBuffer=t)}},t.readAsArrayBuffer(this.rtpRecorder.getPcmData())}noiseSet(t){let e=localStorage.getItem("aduioData"),i=he(e);this.noisedecoderNvmpWorker.postMessage({data:t,audioData:i,samplerate:8e3,decoderType:"_decodePCM",mode:this.parent.options.mode||"aec"})}async transformRtpBuffer(t){if(!t)return;let e=t,i=new Uint8Array(e),r=new ArrayBuffer(16+i.length);const n=new DataView(r);let s=0;n.setUint8(s,36),s+=1,n.setUint8(s,1),s+=1;let a=1036;n.setUint16(s,a),s+=2,n.setUint8(s,128),s+=1,n.setUint8(s,136),s+=1,n.setUint16(s,this.rtpCnt),s+=2,n.setUint32(s,320*this.rtpCnt),this.rtpCnt++,s+=4,s+=4;for(var o=0;o{e.type=t.type,e.timestamp=t.timestamp,this.currentSeq&&(e.seq=this.currentSeq,this.currentSeq=0)}),this.parent.sampleQueues[t.mediaType()].push(e)}}}}destroy(){this.rtpRecorder&&(this.noisedecoderNvmpWorker.postMessage({isStop:!0,decoderType:"_decodePCM"}),this.rtpRecorder.clear(),this.rtpRecorder.stop()),this.noisedecoderNvmpWorker&&this.noisedecoderNvmpWorker.terminate()}}class Xn extends Mn{constructor(t={flush:10}){super(Object.assign({},t)),this.relayUrl="",this.sampleQueues={},this.clientUUID="",this.cloudServer="",this.relayOptions=null,this.relayUrlParse=null,this.clientSM=new Gn(this)}static streamType(){return"dtspk"}static get resolutions(){return{VGA:0,HD:2}}canplay(t){return Gn.SLP.includes(t)||Gn.NVMP.includes(t)}async start(){let{url:t,clientUUID:e}=this.options,i=hn.parse(t);this.cloudServer=`${i.protocol}://${i.location}${i.basepath}`,this.relayOptions=await this.getRelayOptions(),this.relayUrlParse=hn.parse(this.relayOptions.url),this.clientUUID=i.query.clientUUID||this.relayOptions.clientUUID||e,await this.requestRelayAccess();let{relayVersion:r}=this.relayOptions;this.canplay(this.relayOptions.relayVersion)?(Gn.NVMP.includes(r)?this.clientSM=new $n(this):this.clientSM=new Yn(this),this.clientSM.onRelayConfig=t=>{this.eventSource.dispatchEvent("relayConfig",t),this.startStreamFlush()},this.connect(),super.start()):this.error(Me.CLOUD_ERR_VERSION)}async getRelayOptions(){const t=()=>new Promise(t=>{const e=(i,r)=>{let n=this.getXAuthHeaders({url:i,param:r});xn.a.post(i,r,n).then(i=>{let{data:r={}}=i,{result:n={}}=r;if(0===r["error_code"])t(n);else if(-80703===r["error_code"]){let t=this.cloudServer+"/requestRelayUrlAgain",i={sessionId:n.sessionId,token:n.token};this.timer=setTimeout(()=>{e(t,i)},500)}else{let t=Wn[r["error_code"]]||"COMMON_ERR_CUSTOM";this.error(Me[t])}}).catch(()=>{this.error(Me.MEDIA_ERR_NETWORK)})};let i=this.options.url;e(i,{})});let e=await t();return e}requestRelayAccess(){let t=this.options.appKey?this.cloudServer+"/renewRelayCookie":this.cloudServer.slice(0,-4)+"/requestRelayAccess",e={token:this.relayOptions.token,cookie:this.relayOptions.cookie,path:this.relayUrlParse.basepath},i=this.getXAuthHeaders({url:t,param:e});return xn.a.post(t,e,i).catch(()=>{this.error(Me.MEDIA_ERR_NETWORK)})}setSource(t){super.setSource(t),this.clientSM.setSource(t)}attachTransport(t){super.attachTransport(t),this.clientSM.transport=t}detachTransport(){super.detachTransport(),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={}}connect(){let{url:t}=this.relayOptions;this.setSource(hn.parse(t));let e=new yn(this.options.type,{socket:t.replace("https","wss"),binaryType:"blob"});return this.attachTransport(e),this.transport?this.transport.ready.then(()=>this.clientSM.start()):Promise.reject("no transport attached")}async redirect(t){const{relayOptions:e,relayUrlParse:i}=this;e.cookie=t.cookie,e.url=`${i.protocol}://${t.domain}${i.urlpath}`,this.relayUrlParse=hn.parse(e.url),await this.requestRelayAccess(),this.play()}stop(){return this.clientSM.stop(),this.transport&&this.transport.disconnect(),clearTimeout(this.timer),super.stop()}destroy(){return this.clientSM.destroy(),super.destroy()}onData(t){this.clientSM.onData(t)}sendRequest(t){this.clientSM.sendRequest(t)}concatenate(...t){let e=0;for(let n of t)e+=n.byteLength;let i=new Uint8Array(e),r=0;for(let n of t){let t=new Uint8Array(n);i.set(t,r),r+=n.byteLength}return i}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected()}error(t){this.eventSource.dispatchEvent("audioError",new Me(t))}sendAudioStream(){this.eventSource.dispatchEvent("sendAudioStream")}onPlayerNotify(t){let{seq:e}=t;e&&this.clientSM.updateReceivedSeq(e)}}var Qn=Xn;xn.a.defaults.withCredentials=!0;const Kn=ke("client:relay");class Zn extends Error{constructor(t){super(t)}}const Jn={"-52211":"REQUEST_NOT_MEET_SHARE_RULES","-82423":"OVER_SHARE_TIME_ERROR","-82400":"CLOUD_ERR_PARAM","-82401":"CLOUD_ERR_PERMISSION","-82414":"CLOUD_ERR_SERVER","-80702":"COMMON_ERR_SESSION","-80731":"CLOUD_ERR_TOKEN","-80304":"CLOUD_ERR_DEVID","-80732":"CLOUD_ERR_BANDWIDTH","-20002":"DEVICE_ERR_CHN_OFFLINE","-20571":"DEVICE_ERR_CHN_OFFLINE","-52405":"CLOUD_ERR_STREAM_LIMIT","-52413":"DEVICE_ERR_CHN_OFFLINE","-20680":"USING_APP_SPECIFIC_TRAFFIC"},ts=5;let es=0;const is="sdk-client-boundary",rs=100;class ns extends wn{static get USER_AGENT(){return"SFRtsp 0.3"}static get SLP(){return["1.3"]}static get NVMP(){return["2.0"]}static get RESPONSE_ERR_CODE(){return{429:Me.CLOUD_ERR_STREAM_LIMIT,432:Me.CLOUD_ERR_WINDOW_LIMIT,433:Me.CLOUD_ERR_CLIENT_LIMIT}}static get FINISH_REASON(){return{share_finish:Me.CLOUD_ERR_SHARE_FINISH,permission_deny:Me.CLOUD_ERR_PERMISSION,channel_offline:Me.DEVICE_ERR_CHN_OFFLINE,channel_invalid:Me.DEVICE_ERR_CHN_INVALID,internal_error:Me.COMMON_ERR_INTERNAL,password_changed:Me.DEVICE_ERR_PWD_CHANGED,media_encrypt_changed:Me.CLOUD_ERR_ENCRYPT_CHANGED,relay_lifetime_expired:Me.CLOUD_ERR_FREE,channel_talk_busy:Me.CLOUD_ERR_TALK_BUSY,unbind_device:Me.CLOUD_ERR_UNBIND,lack_bandwidth:Me.CLOUD_ERR_BANDWIDTH,offline:Me.DEVICE_ERR_CHN_OFFLINE}}static get STATE_INITIAL(){return 1}static get STATE_OPTIONS(){return 2}static get STATE_GET_RELAY(){return 4}static get STATE_GET_STREAMS(){return 8}static get STATE_STREAMS(){return 16}static get STATE_TEARDOWN(){return 32}static get STATE_PAUSED(){return 64}static get STATE_PLAY(){return 128}constructor(t){super(),this.parent=t,this.transport=null,this.onRelayConfig=null,this.streams=null,this.env=bn(),this.messageBuilder={RTSP:new Ln(Ln.RTSP_1_0),HTTP:new Ln(Ln.HTTP_1_1)},this.isPlaying=!1,this.methods=["PLAY","PAUSE"],this.reconnectTimer=0,this.redirectTime=0,this.addState(ns.STATE_INITIAL,{}).addState(ns.STATE_GET_RELAY,{activate:this.getRelayRelease,finishTransition:this.onRelayRelease}).addState(ns.STATE_OPTIONS,{activate:this.sendOptions,finishTransition:this.onOptions}).addState(ns.STATE_STREAMS,{}).addState(ns.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(ns.STATE_INITIAL)}).addState(ns.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(ns.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addTransition(ns.STATE_INITIAL,ns.STATE_GET_RELAY).addTransition(ns.STATE_INITIAL,ns.STATE_TEARDOWN).addTransition(ns.STATE_GET_RELAY,ns.STATE_TEARDOWN).addTransition(ns.STATE_STREAMS,ns.STATE_PAUSED).addTransition(ns.STATE_PAUSED,ns.STATE_STREAMS).addTransition(ns.STATE_STREAMS,ns.STATE_TEARDOWN).addTransition(ns.STATE_PAUSED,ns.STATE_TEARDOWN).addTransition(ns.STATE_PAUSED,ns.STATE_PLAY).addTransition(ns.STATE_PLAY,ns.STATE_STREAMS).addTransition(ns.STATE_PLAY,ns.STATE_TEARDOWN).addTransition(ns.STATE_TEARDOWN,ns.STATE_INITIAL)}destroy(){clearTimeout(this.reconnectTimer)}setSource(){}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Kn.log("start"),this.start())}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(ns.STATE_TEARDOWN),await this.transitionTo(ns.STATE_INITIAL)}start(){return this.currentState.name!==ns.STATE_STREAMS?this.transitionTo(ns.STATE_GET_RELAY):Promise.resolve()}stop(){this.started&&(this.transitionTo(ns.STATE_TEARDOWN),this.transport&&this.transport.stop()),this.shouldReconnect=!1}error(t){this.parent.error(t)}onData(){}reset(){}async reconnect(){return await this.reset(),this.currentState.name!=ns.STATE_INITIAL?(await this.transitionTo(ns.STATE_TEARDOWN),this.transitionTo(ns.STATE_GET_RELAY)):this.transitionTo(ns.STATE_GET_RELAY)}supports(t){return this.methods.includes(t)}sendRequest(){}async send(t,e="RTSP"){if(this.transport){try{await this.transport.ready}catch(i){throw this.onDisconnected(),i}let r=await this.transport.send(t),n=this.parse(r,e);return n}return Promise.reject("No transport attached")}parse(t,e="RTSP"){let i=t.split("\r\n\r\n"),r={};try{r=this.messageBuilder[e].parse(i[0]);let t=Number(r.headers["content-length"]||0);if(t){let t=i[1];t&&(t=JSON.parse(t)),r.body=t}else r.body=""}catch(n){}return Kn.log("parsed data: ",r),r}sendTeardown(){let t="TEARDOWN";return this.sendRequest(t,"*")}sendOptions(){return this.reset(),this.started=!0,this.cSeq=0,this.sendRequest("OPTIONS",this.url,{})}onOptions(t){this.methods=t.headers["public"].split(",").map(t=>t.trim()),this.transitionTo(ns.STATE_GET_STREAMS)}pause(){return this.currentState.name===ns.STATE_STREAMS?(this.isPlaying=!1,this.transitionTo(ns.STATE_PAUSED)):Promise.resolve()}sendPause(){}onPause(){}play(){return this.currentState.name===ns.STATE_PAUSED?this.transitionTo(ns.STATE_PLAY):Promise.resolve()}sendPlay(){}onPlay(){this.transitionTo(ns.STATE_STREAMS)}errorException(t){let{type:e,params:i={}}=t;if("response"===e&&0!==i["error_code"]){let t=Jn[i["error_code"]]||"CLOUD_ERR_STREAM";return this.error(Me[t]),this.transitionTo(ns.STATE_TEARDOWN),!0}return!1}updateReceivedSeq(){}}class ss extends ns{constructor(t){super(t),this.payParser=new Fr,this.rtp_channels=new Set,this.addState(ns.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onStreamConfigs}).addTransition(ns.STATE_GET_RELAY,ns.STATE_GET_STREAMS).addTransition(ns.STATE_PAUSED,ns.STATE_GET_STREAMS).addTransition(ns.STATE_GET_STREAMS,ns.STATE_STREAMS).addTransition(ns.STATE_GET_STREAMS,ns.STATE_TEARDOWN).addTransition(ns.STATE_STREAMS,ns.STATE_GET_STREAMS),this.reset()}setSource(t){Kn.log("set source: ",t),this.reset(),this.endpoint=t,this.url="rtsp://192.168.1.1/multitrans"}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Kn.log("start"),this.start())}onData(t){if("sdvod"===this.parent.options.streamType){let e=oe(this.dataBuffer,t),i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint8(0);if(36===r){if(!(i.buffer.byteLength>=4))return void(this.dataBuffer=e);{let r=i.getUint16(2),n=r+4;if(!(e.length>=n))return void(this.dataBuffer=e);t=e.slice(0,n),this.dataBuffer=e.slice(n)}}else{let i=e.findIndex(t=>36===t),r=le(e),n=r.indexOf("RTSP");if(-1===i&&-1===n)return void(this.dataBuffer=new Uint8Array([]));if(-1===i)n>0&&(e=e.slice(n),r=le(e));else{if(-1===n||i0&&(e=e.slice(n),i-=n,r=le(e))}let s=r.indexOf("RTSP",4),a=!1;-1!==s&&-1!==i?s{this.parent.eventSource.dispatchEvent("ended"),this.parent.stop()},1500));break;case"stream_status":n=o.status,"finished"===n&&(this.parent.eventSource.dispatchEvent("ended"),this.parent.stop());default:break}return}this.noDataTimeout&&clearTimeout(this.noDataTimeout);let i=t[1];this.rtp_channels.has(i)&&this.onRTP({packet:t.subarray(4),type:i}),e=le(this.dataBuffer),"$"!==e[0]&&0!==e.indexOf("RTSP")||this.onData(new Uint8Array([]))}useRTPChannel(t){this.rtp_channels.add(t)}forgetRTPChannel(t){this.rtp_channels.delete(t)}async reset(){this.authenticator="",this.methods=[],this.tracks=[],this.rtpBuffer={},this.contentBase="",this.currentState?this.currentState.name!=ns.STATE_INITIAL&&(await this.transitionTo(ns.STATE_TEARDOWN),await this.transitionTo(ns.STATE_INITIAL)):await this.transitionTo(ns.STATE_INITIAL),this.sdp=null,this.interleaveChannelIndex=0,this.session=null,this.relativeUTCInfo={},this.videoPTSTimescale=9e4,this.audioSampleRate=8e3,this.parent.isReconnect=!0,this.cSeq=0,this.receivedSeq=0,this.currentSeq=0,this.dataBuffer=new Uint8Array([]),this.sessionId="",this.lastRTPSeq={},this.isVideoWaitIFrame=!0,this.lastVideoFrameFlag=0,this.recordVideoFrameFlagForMultiSlice=0,this.scale=1}parse(t,e="RTSP"){let i=t.match(/\scontent-length:\s*(\d*)\s/i),r=0;if(i&&i.length>=2&&/^\d+$/.test(i[1]))r=parseInt(i[1]);else{if(!/content-length: \s*0$/i.test(t))return{};r=0}let n=t.split("\r\n\r\n"),s=n[1]||"";if(s.length{if(n instanceof Zn)return this.sendRequest(t,e,i,r);throw n})}sendMultitrans(t,e={}){let i="MULTITRANS",r={"Content-Type":"application/json"};return this.sessionId&&(r["X-Session-Id"]=this.sessionId),Object.assign(r,e),this.sendRequest(i,this.url,r,t).then(t=>{Kn.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}getRelayRelease(){let{relayOptions:t={}}=this.parent,{cookie:e,token:i,relayVersion:r}=t,n={Host:this.endpoint.location,"User-Agent":"Client=TP-LINK/"+r,Cookie:e,"X-token":i,"X-Client-UUID":this.parent.clientUUID,"X-Redirect-Times":this.redirectTime,"X-Client-Model":this.env.os,Accept:"/",Upgrade:"websocket",Connection:"upgrade","Sec-WebSocket-Key":X().split("-").join(""),"Sec-WebSocket-Protocol":"tp-private","Sec-WebSocket-Version":"13"},s="GET",a="",o=this.messageBuilder["HTTP"].build(s,this.endpoint.urlpath,n,a);return this.send(o,"HTTP")}onRelayRelease(t){let{headers:e,code:i}=t;if(404!==i&&410!==i){if(301===i){let t=e["x-domain"],i=e["x-redirect-cookie"];return this.parent.redirect({domain:t,cookie:i}),this.redirectTime++,void this.parent.eventSource.dispatchEvent("redirect")}if(this.redirectTime=0,es=0,this.parent.isReconnect=!1,101===i)this.transitionTo(ns.STATE_GET_STREAMS);else{let e=ns.RESPONSE_ERR_CODE[t.code];this.error(e||Me.CLOUD_ERR_DEV_RELAY)}}else es<=ts?(es++,this.reconnectTimer=setTimeout(()=>{this.reset(),this.redirectTime?this.parent.play():this.parent.start()},500)):(es=0,this.error(Me.CLOUD_ERR_DEV_RELAY))}async getStreams(){this.started=!0,this.isPlaying=!1;let{options:t={},channel:e=0}=this.parent,{streamType:i,startTime:r,scale:n,eventType:s,audioVoiceEnable:a}=t;n&&(this.scale=n);let o=a?"enable":"disable",h={method:"get",preview:{audio:[o],channels:[e],resolutions:[this.endpoint.query.resolution]}},c=n<0?"-":"",u={method:"get",playback:{client_id:this.parent.options.userId,channels:[e],scale:c+Mn.formatScale(n),event_type:s,start_time:parseInt(r/1e3)+""}},l={type:"request",seq:0,params:"video"===i?h:u},d={"X-Data-Window-Size":rs};return this.sendMultitrans(l,d)}async onStreamConfigs(t){var e,i;if(!t)return;let{body:r={}}=t,{params:n={}}=r;if(this.errorException(r))return;n["session_id"]&&(this.sessionId=n["session_id"]),this.relativeUTCInfo={},this.videoPTSTimescale=9e4,this.audioSampleRate=8e3,this.sdp=new Hr;let s=n["av_config"][0],a={},o={};a.type="video",a.port=0,a.proto="";let h=(null===n||void 0===n||null===(e=n.av_config[0])||void 0===e||null===(e=e.extra_data)||void 0===e?void 0:e.video_rtpmap)&&(null===n||void 0===n||null===(i=n.av_config[0])||void 0===i||null===(i=i.extra_data)||void 0===i?void 0:i.video_rtpmap.slice(0,2)),c=h||96;a.fmt=[c],a.ptype=me.string_map[s.video_codec];for(let f of a.fmt)this.sdp.mediaMap[f]=a;this.sdp.media[a.type]=a,o.type="audio",o.port=0,o.proto="",o.fmt=[8],o.ptype=me.string_map[s.audio_codec];for(let f of o.fmt)this.sdp.mediaMap[f]=o;this.sdp.media[o.type]=o;let u=1e3*parseInt(s.audio_sampling_rate);if(u>0&&(this.audioSampleRate=u),"AAC"===s.audio_codec){let t={samplerate:1e3*parseInt(s.audio_sampling_rate)};this.payParser.aacparser.setConfig(t)}if(this.sdp.isNvmpAccPlayBack=!0,Object.hasOwnProperty.call(n,"interleaved")){var l;let t=null===(l=n.interleaved[0])||void 0===l||null===(l=l.interleaved_id)||void 0===l?void 0:l.split("-");t.length&&t.forEach(t=>{this.useRTPChannel(Number(t))})}this.useRTPChannel(0),this.useRTPChannel(1),this.useRTPChannel(2),this.rtpBuffer[a.fmt[0]]=[],this.rtpBuffer[o.fmt[0]]=[],this.lastRTPSeq[a.fmt[0]]=-1,this.lastRTPSeq[o.fmt[0]]=-1,this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[],this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[],this.rtpFactory=new Mr(this.sdp);let d=this.transport.socket();d.initDataChannel(),this.transitionTo(ns.STATE_STREAMS),this.onRelayConfig&&this.onRelayConfig(s)}onRTP(t){if(!this.rtpFactory)return;this.isPlaying||this.currentState.name===ns.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream"));let e=this.rtpFactory.build(t.packet,this.sdp);if(!Object.prototype.hasOwnProperty.call(e,"type"))return;!e.utc_timestamp&&this.relativeUTCInfo.utc||(this.relativeUTCInfo={utc:e.utc_timestamp||1,pts:e.timestamp});let i=this.rtpBuffer[e.pt]||[];i.push(e);while(i.length){let t=i.shift();-1===this.lastRTPSeq[t.pt]&&(this.lastRTPSeq[t.pt]=t.sequence);let e=1;if(t.isVideo()&&(this.isVideoWaitIFrame||t.sequence-this.lastRTPSeq[t.pt]!==1&&this.lastRTPSeq[t.pt]-t.sequence!==65535&&(this.isVideoWaitIFrame=!0,console.log("on video get wrong rtp sn",t.sequence,this.lastRTPSeq[t.pt])),0===this.lastVideoFrameFlag&&(this.lastVideoFrameFlag=t.frame_flg),this.scale>1&&(e=this.scale)),this.lastRTPSeq[t.pt]=t.sequence,t.media){let i=this.payParser.parse(t),r=!1;if(i&&this.parent.sampleQueues[t.mediaType()]){if(i.forEach(i=>{i.type=t.type,t.isVideo()?(i.seq=this.currentSeq,0!==this.lastVideoFrameFlag&&(i.isVirtualI=1===this.lastVideoFrameFlag,i.isDecodeOnlyI=2===this.lastVideoFrameFlag),i.isStartSlice()?this.recordVideoFrameFlagForMultiSlice=this.lastVideoFrameFlag:(i.isVirtualI=1===this.recordVideoFrameFlagForMultiSlice,i.isDecodeOnlyI=2===this.recordVideoFrameFlagForMultiSlice),this.lastVideoFrameFlag=0,this.isVideoWaitIFrame&&(r=i.isParameterSet(),i.isKeyframe()&&(console.log("get i frame stop drop frame",i.ntype),this.isVideoWaitIFrame=!1)),i.timestamp=parseInt(this.relativeUTCInfo.utc+1e3*(i.pts-this.relativeUTCInfo.pts)*e/this.videoPTSTimescale)):(i.samplerate=this.audioSampleRate,i.timestamp=parseInt(this.relativeUTCInfo.utc+e*(1e3*i.pts/this.audioSampleRate-1e3*this.relativeUTCInfo.pts/this.videoPTSTimescale)))}),t.isVideo()&&this.isVideoWaitIFrame&&!r)return;this.parent.feed(t.mediaType(),i)}}}}sendPlaybackConfig(t){let{startTime:e,endTime:i,scale:r,eventType:n,currentTime:s}=t,a=r<0?"-":"";r&&(this.scale=r);let o={type:"request",seq:0,params:{method:"do",play:{start_time:e?parseInt(e/1e3)+"":void 0,end_time:i?parseInt(i/1e3)+"":void 0,scale:r?a+Mn.formatScale(r):void 0,event_type:n}}};return n?(this.parent.options.startTime=e||s,this.getStreams()):this.sendMultitrans(o),this.currentState.name===ns.STATE_PAUSED?(this.currentSeq&&this.updateReceivedSeq(this.currentSeq),this.transitionTo(ns.STATE_STREAMS)):Promise.resolve()}sendPause(){return Promise.resolve()}sendPlay(){return Promise.resolve()}sendHeartbeat(){let t={type:"notification"};this.sendMultitrans(t)}updateReceivedSeq(t){if(t=parseInt(t),t<=this.receivedSeq)return;let e={type:"notification",params:{event_type:"stream_sequence"}},i={"X-Data-Received":t};this.sendMultitrans(e,i),this.receivedSeq=t}}class as extends ns{constructor(t){super(t),this.addTransition(ns.STATE_GET_RELAY,ns.STATE_STREAMS),this.reset(),this.isChangeSampleRate=!1}setSource(t){Kn.log("set source: ",t),this.reset(),this.endpoint=t}async onConnected(){this.shouldReconnect&&(Kn.log("start"),this.start())}async reset(){this.deviceBoundary="",this.sessionId="",this.loadedChunks=[],this.parsing=!1,this.cSeq=0,this.payload={},this.currentSeq=0,this.receivedSeq=0,this.initParser(),this.currentState?this.currentState.name!=ns.STATE_INITIAL&&(await this.transitionTo(ns.STATE_TEARDOWN),await this.transitionTo(ns.STATE_INITIAL)):await this.transitionTo(ns.STATE_INITIAL)}initParser(){this.parser=new Xr,this.parser.addPesParser($r.H264,Qr),this.parser.addPesParser($r.H265,Qr),this.parser.addPesParser($r.AAC,Kr),this.parser.addPesParser($r.PCMA_W,tn),this.parser.addPesParser($r.PCMA,Zr),this.parser.addPesParser($r.PCMU,Jr),this.parser.ontracks=t=>{let e={};for(let i of t)switch(i.type){case me.H264:e.video_codec="H264",this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[];break;case me.H265:e.video_codec="H265",this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[];break;case me.G711A:e.audio_codec="G711alaw",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;case me.AAC:e.audio_codec="AAC",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;case me.PCMA_W:e.audio_codec="PCMA_W",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;case me.PCMU:e.audio_codec="PCMU",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;default:break}e.video_codec&&this.onRelayConfig(e)}}buildBoundary(t="",e){let i=`--${is}\r\n`;return t instanceof Object&&(t=JSON.stringify(t)),i+="Content-Type: application/json\r\n",i+=`Content-Length: ${t.length}\r\n`,this.sessionId&&(i+=`X-Session-Id: ${this.sessionId}\r\n`),e&&(i+=e),i+="\r\n",i+=t,i}async sendBoundary(t){if(this.transport){try{await this.transport.ready}catch(e){throw this.onDisconnected(),e}let i=await this.transport.send(t),r=this.parseBoundary(i);return r}return Promise.reject("No transport attached")}parseBoundary(t){let[e,i]=t.split("\r\n\r\n"),r={headers:{},body:i},n=e.split("\r\n");if(-1===n[0].indexOf(this.deviceBoundary))r.body=t;else{let t=1;while(n[t]){let[e,i]=n[t].split(/:(.+)/);r.headers[e.toLowerCase()]=i.trim(),t++}}return r}onData(t){let e=le(t),{headers:i,body:r}=this.parseBoundary(e);if("application/json"===i["content-type"]){Kn.log("on data: ",r),r=JSON.parse(r);let{params:t={}}=r,{error_code:e=0}=t;if(e){let t=Jn[e]||"CLOUD_ERR_STREAM";return this.error(Me[t]),void this.transitionTo(ns.STATE_TEARDOWN)}if(t.session_id&&(this.sessionId=t.session_id),"stream_finish"===t.event_type){this.parent.stop();let e=ns.FINISH_REASON[t.reason];this.error(e||Me.MEDIA_ERR_NETWORK)}else if("channel_stream_status"===t.event_type){let e=t.status&&t.status[0],i=ns.FINISH_REASON[e];i?(this.parent.stop(),this.error(i)):"no_data"===e&&(this.noDataTimeout=setTimeout(()=>{this.parent.eventSource.dispatchEvent("ended"),this.parent.stop()},1500))}else if("stream_status"===t.event_type){let e=t.status;"finished"===e&&(clearTimeout(this.noDataTimeout),this.parent.eventSource.dispatchEvent("ended"),this.parent.stop())}}else{this.noDataTimeout&&clearTimeout(this.noDataTimeout);let t=[];for(let e=0;e1&&(t=a),this.parser&&this.parser.updatePTScale(t)}let f="POST",p={Host:this.endpoint.location,"User-Agent":"Client=TP-LINK/"+d,Cookie:u,"X-token":l,"X-Client-UUID":r,"X-Redirect-Times":this.redirectTime,"X-Client-Model":this.env.os,Accept:"/","Content-Type":"multipart/mixed; boundary="+is,"Content-Length":Number.MAX_SAFE_INTEGER},g=c?"enable":"disable",m={method:"get",preview:{audio:[g],channels:[i],resolutions:[this.endpoint.query.resolution]}},v=a<0?"-":"",y={method:"get",playback:{client_id:h,channels:[i],scale:v+Mn.formatScale(a),event_type:o,start_time:parseInt(s/1e3)+""}},b={type:"request",seq:0,params:"video"===n?m:y},_="sdvod"===n?`X-Data-Window-Size: ${rs}\r\n`:"",T=this.messageBuilder["HTTP"].build(f,this.endpoint.urlpath,p,null);return T+=this.buildBoundary(b,_),this.send(T,"HTTP")}onRelayRelease(t){let{headers:e,code:i}=t;if(404===i||410===i)return void(es<=ts?(es++,this.reconnectTimer=setTimeout(()=>{this.reset(),this.redirectTime?this.parent.play():this.parent.start()},500)):(es=0,this.error(Me.CLOUD_ERR_DEV_RELAY)));if(301===i){let t=e["x-domain"],i=e["x-redirect-cookie"];return this.parent.redirect({domain:t,cookie:i}),this.redirectTime++,void this.parent.eventSource.dispatchEvent("redirect")}if(this.redirectTime=0,es=0,this.parent.isReconnect=!1,200!==i){let e=ns.RESPONSE_ERR_CODE[t.code];return void this.error(e||Me.CLOUD_ERR_DEV_RELAY)}this.deviceBoundary=e["content-type"].split("boundary=")[1];let r=this.transport.socket();r.initDataChannel(),this.transitionTo(ns.STATE_STREAMS)}sendMultiparts(t,e){let i=this.buildBoundary(t,e);return this.sendBoundary(i).then(t=>{Kn.log("on multiparts\n",t);let{body:e="{}"}=t;e=JSON.parse(e);let{params:i={}}=e;return this.errorException(e)?null:(i.session_id&&(this.sessionId=i.session_id),t)})}onTS(t){this.isPlaying||this.currentState.name===ns.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream")),this.parsing?this.loadedChunks.push(t):(this.parsing=!0,this.parseTS(t))}parseTS(t){for(let e=0;e{Object.prototype.hasOwnProperty.call(t,"type")||(t.type=i.type),t.timestamp=i.timestamp,t.seq=this.currentSeq}),this.parent.feed(i.mType,t)}}this.parsing=!1,this.loadedChunks.length&&this.onTS(this.loadedChunks.shift())}sendPlaybackConfig(t){let{startTime:e,endTime:i,scale:r,eventType:n}=t,s=r<0?"-":"";if(r){let t=1;r>1&&(t=r),this.parser&&this.parser.updatePTScale(t)}let a={type:"request",seq:0,params:{method:"do",play:{start_time:e?parseInt(e/1e3)+"":void 0,end_time:i?parseInt(i/1e3)+"":void 0,scale:r?s+Mn.formatScale(r):void 0,event_type:n}}};return this.sendMultiparts(a),this.currentState.name===ns.STATE_PAUSED?(this.currentSeq&&this.updateReceivedSeq(this.currentSeq),this.transitionTo(ns.STATE_STREAMS)):Promise.resolve()}sendPause(){return Promise.resolve()}sendPlay(){return Promise.resolve()}sendHeartbeat(){let t={type:"notification"};this.sendMultiparts(t)}updateReceivedSeq(t){if(!(this.currentState.name!==ns.STATE_STREAMS||t>this.currentSeq)&&(t=parseInt(t),t-this.receivedSeq>=rs/2)){let e={type:"notification",params:{event_type:"stream_sequence"}},i=`X-Data-Received: ${t}\r\n`;this.sendMultiparts(e,i),this.receivedSeq=t}}}class os extends Mn{constructor(t={flush:10}){super(Object.assign({},t)),this.relayUrl="",this.sampleQueues={},this.clientUUID="",this.cloudServer="",this.relayOptions=null,this.relayUrlParse=null,this.heartbeatInterval=0,this.clientSM=new ns(this)}static streamType(){return"relay"}static get resolutions(){return{VGA:0,HD:2}}canplay(t){return ns.SLP.includes(t)||ns.NVMP.includes(t)}async start(){let{url:t,clientUUID:e}=this.options,i=hn.parse(t);this.cloudServer=`${i.protocol}://${i.location}${i.basepath}`,this.relayOptions=await this.getRelayOptions(),this.clientUUID=this.relayOptions.clientUUID||e,this.relayUrlParse=hn.parse(this.relayOptions.url),await this.requestRelayAccess();let{relayVersion:r}=this.relayOptions;this.canplay(this.relayOptions.relayVersion)?(ns.NVMP.includes(r)?this.clientSM=new ss(this):this.clientSM=new as(this),this.clientSM.onRelayConfig=t=>{this.eventSource.dispatchEvent("relayConfig",t),this.startStreamFlush()},this.connect(),super.start()):this.error(Me.CLOUD_ERR_VERSION)}async getRelayOptions(){const t=()=>new Promise(t=>{const e=(i,r)=>{let n=this.getXAuthHeaders({url:i,param:r});xn.a.post(i,r,n).then(i=>{let{data:r={}}=i,{result:n={}}=r;if(0===r["error_code"])t(n);else if(-80703===r["error_code"]){let t=this.cloudServer+"/requestRelayUrlAgain",i={sessionId:n.sessionId,token:n.token};this.timer=setTimeout(()=>{e(t,i)},500)}else{let t=Jn[r["error_code"]]||"COMMON_ERR_CUSTOM";this.error(Me[t])}}).catch(()=>{this.error(Me.MEDIA_ERR_NETWORK)})};let i=this.options.url;e(i,{})});let e=await t();return e}requestRelayAccess(){let t=this.options.appKey?this.cloudServer+"/renewRelayCookie":this.cloudServer.slice(0,-4)+"/requestRelayAccess",e={token:this.relayOptions.token,cookie:this.relayOptions.cookie,path:this.relayUrlParse.basepath},i=this.getXAuthHeaders({url:t,param:e});return xn.a.post(t,e,i).catch(()=>{this.error(Me.MEDIA_ERR_NETWORK)})}setSource(t){super.setSource(t),this.clientSM.setSource(t)}attachTransport(t){super.attachTransport(t),this.clientSM.transport=t}detachTransport(){super.detachTransport(),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={},this.paused=!1,clearInterval(this.heartbeatInterval)}connect(){let{url:t}=this.relayOptions;this.setSource(hn.parse(t));let e=new yn(this.options.type,{socket:t.replace("https","wss"),binaryType:"blob"});return this.attachTransport(e),this.transport?this.transport.ready.then(()=>this.clientSM.start()):Promise.reject("no transport attached")}async redirect(t){const{relayOptions:e,relayUrlParse:i}=this;e.cookie=t.cookie,e.url=`${i.protocol}://${t.domain}${i.urlpath}`,this.relayUrlParse=hn.parse(e.url),await this.requestRelayAccess(),this.connect(),super.start()}stop(){return this.clientSM.stop(),this.transport&&this.transport.disconnect(),clearTimeout(this.timer),super.stop()}destroy(){return this.clientSM.destroy(),clearInterval(this.heartbeatInterval),super.destroy()}play(t){this.clientSM.play().then(()=>{this.paused=!1,t&&t(),clearInterval(this.heartbeatInterval)})}pause(t){let{currentState:e}=this.clientSM;if(!e||e.name!==ns.STATE_STREAMS)return;let{streamType:i}=this.options;"video"===i?(this.clientSM.pause(),super.stop(),t&&t()):this.clientSM.pause().then(()=>{super.stop(),t&&t(),this.heartbeatInterval=setInterval(()=>{this.clientSM.sendHeartbeat()},5e3)})}setResolution(t){let{currentState:e}=this.clientSM;!e||e.name<=ns.STATE_GET_RELAY||(this.detachTransport(),this.options.url=t,this.start())}async onData(t){if("reconnect"===t)return await this.clientSM.onDisconnected(),clearInterval(this.heartbeatInterval),void this.clientSM.start();this.clientSM.onData(t)}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected(),clearInterval(this.heartbeatInterval)}error(t){this.eventSource.dispatchEvent("error",new Me(t))}setPlaybackConfig(t){Object.assign(this.options,t);let{relayVersion:e}=this.relayOptions;return t.eventType&&ns.SLP.includes(e)?(this.options.startTime=t.startTime||t.currentTime,this.reset(),this.start()):this.clientSM.sendPlaybackConfig(t).then(()=>{this.paused=!1,clearInterval(this.heartbeatInterval),this.flushSampleQueue()})}onPlayerNotify(t){let{seq:e}=t,{streamType:i}=this.options;e&&"sdvod"===i&&this.clientSM.updateReceivedSeq(e)}}var hs=os;function cs(t,e){var i=(65535&t)+(65535&e),r=(t>>16)+(e>>16)+(i>>16);return r<<16|65535&i}function us(t,e){return t<>>32-e}function ls(t,e,i,r,n,s){return cs(us(cs(cs(e,t),cs(r,s)),n),i)}function ds(t,e,i,r,n,s,a){return ls(e&i|~e&r,t,e,n,s,a)}function fs(t,e,i,r,n,s,a){return ls(e&r|i&~r,t,e,n,s,a)}function ps(t,e,i,r,n,s,a){return ls(e^i^r,t,e,n,s,a)}function gs(t,e,i,r,n,s,a){return ls(i^(e|~r),t,e,n,s,a)}function ms(t,e){var i,r,n,s,a;t[e>>5]|=128<>>9<<4)]=e;var o=1732584193,h=-271733879,c=-1732584194,u=271733878;for(i=0;i>5]>>>e%32&255);return i}function ys(t){var e,i=[];for(i[(t.length>>2)-1]=void 0,e=0;e>5]|=(255&t.charCodeAt(e/8))<16&&(n=ms(n,8*t.length)),i=0;i<16;i+=1)s[i]=909522486^n[i],a[i]=1549556828^n[i];return r=ms(s.concat(ys(e)),512+8*e.length),vs(ms(a.concat(r),640))}function Ts(t){var e,i,r="0123456789abcdef",n="";for(i=0;i>>4&15)+r.charAt(15&e);return n}function Ss(t){return unescape(encodeURIComponent(t))}function ws(t){return bs(Ss(t))}function Es(t){return Ts(ws(t))}function xs(t,e){return _s(Ss(t),Ss(e))}function As(t,e){return Ts(xs(t,e))}function Cs(t,e,i){return e?i?xs(e,t):As(e,t):i?ws(t):Es(t)}class Rs extends Error{constructor(t){super(t.msg),this.data=t}}class Ps{static get STATE_INITIAL(){return 1}static get STATE_OPTIONS(){return 2}static get STATE_DESCRIBE(){return 4}static get STATE_SETUP(){return 8}static get STATE_STREAMS(){return 16}static get STATE_TEARDOWN(){return 32}static get STATE_MULTITRANS(){return 64}static get STATE_PAUSED(){return 128}constructor(t,e,i){this.state=null,this.client=t,this.track=e,this.audioTrack=i,this.rtpChannel=1,this.audiortpChannel=1,this.stopKeepAlive(),this.keepaliveInterval=null}reset(){this.stopKeepAlive(),this.client.forgetRTPChannel(this.rtpChannel),this.client=null,this.track=null}start(){return this.sendSetup().then(this.sendPlay.bind(this))}stop(){return this.sendTeardown()}getSetupURL(t){let e=this.client.sdp.getSessionBlock();return hn.isAbsolute(t.control)?t.control:hn.isAbsolute(`${e.control}${t.control}`)?`${e.control}${t.control}`:hn.isAbsolute(`${this.client.contentBase}${t.control}`)?`${this.client.contentBase}${t.control}`:t.control}getControlURL(){let t=this.client.sdp.getSessionBlock().control;return hn.isAbsolute(t)?t:t&&"*"!==t?`${this.client.contentBase}${t}`:this.client.contentBase||this.client.url}sendKeepalive(){return this.client.methods.includes("GET_PARAMETER")?this.client.sendRequest("GET_PARAMETER",this.getSetupURL(this.track),{Session:this.session}):this.client.sendRequest("OPTIONS","*")}stopKeepAlive(){clearInterval(this.keepaliveInterval)}startKeepAlive(){this.keepaliveInterval=setInterval(()=>{this.sendKeepalive().catch(t=>{t instanceof Rs&&501==Number(t.data.parsed.code)||this.client.reconnect()})},3e4)}sendRequest(t,e={}){let i={};return this.session&&(i["Session"]=this.session),Object.assign(i,e),this.client.sendRequest(t,this.getControlURL(),i)}async sendAudioSetup(t){let e=t.headers["session"];this.session=-1!==e.indexOf("timeout")?e.slice(0,e.indexOf("timeout")-1):e;let i=this.client.interleaveChannelIndex+++"-"+this.client.interleaveChannelIndex++;await this.client.sendRequest("SETUP",this.getSetupURL(this.audioTrack),{Session:this.session,Transport:"RTP/AVP/TCP;unicast;interleaved="+i,Date:(new Date).toUTCString()})}async sendSetup(){this.state=Ps.STATE_SETUP,this.rtpChannel=this.client.interleaveChannelIndex,this.audiortpChannel=this.client.interleaveChannelIndex+2;let t=this.client.interleaveChannelIndex+++"-"+this.client.interleaveChannelIndex++,e=await this.client.sendRequest("SETUP",this.getSetupURL(this.track),{Transport:"RTP/AVP/TCP;unicast;interleaved="+t,Date:(new Date).toUTCString()});this.sendAudioSetup(e)}async sendPlay(){let t=new Promise(t=>{setTimeout(()=>t("done"),500)});await t,this.state=Ps.STATE_PLAY;let e={},i=this.client.sdp.sessionBlock.range;i&&-1==i[0]&&(i[0]=0),this.client.useRTPChannel(this.rtpChannel),this.client.useRTPChannel(this.audiortpChannel);let r=await this.sendRequest("PLAY",e);return this.state=Ps.STATE_STREAMS,{track:this.track,data:r}}async sendPause(){this.client.supports("PAUSE")&&(await this.sendRequest("PAUSE"),this.state=Ps.STATE_PAUSED)}async sendTeardown(){this.state!=Ps.STATE_TEARDOWN&&(this.client.forgetRTPChannel(this.rtpChannel),this.state=Ps.STATE_TEARDOWN,this.stopKeepAlive(),await this.sendRequest("TEARDOWN"))}}const Is=ke("client:rtsp"),ks=100;let Ds=0;class Os extends Error{constructor(t){super(t)}}const Ms={PERMISSION_DENIED:1202,NOT_SUPPORTED_ERROR:1203,MANDATORY_UNSATISFIED_ERROR:1204,NotFoundError:1205,NotAllowedError:1208},Ns={"-82400":"CLOUD_ERR_PARAM","-52211":"REQUEST_NOT_MEET_SHARE_RULES","-82401":"CLOUD_ERR_PERMISSION","-82414":"CLOUD_ERR_SERVER","-80702":"COMMON_ERR_SESSION","-80731":"CLOUD_ERR_TOKEN","-80304":"CLOUD_ERR_DEVID","-80732":"CLOUD_ERR_BANDWIDTH","-20002":"DEVICE_ERR_CHN_OFFLINE","-20571":"DEVICE_ERR_CHN_OFFLINE","-52405":"CLOUD_ERR_STREAM_LIMIT","-52413":"DEVICE_ERR_CHN_OFFLINE","-40106":"AUDIO_ERR_AUDIO_ENABLE","-52412":"AUDIO_ERR_AUDIO_NOSUPPORTED","-52411":"AUDIO_ERR_AUDIO_BUSY"},Bs="device-stream-boundary";class Ls extends wn{static get USER_AGENT(){return"SFRtsp 0.3"}static get FINISH_REASON(){return{share_finish:Me.CLOUD_ERR_SHARE_FINISH,permission_deny:Me.CLOUD_ERR_PERMISSION,channel_offline:Me.DEVICE_ERR_CHN_OFFLINE,channel_invalid:Me.DEVICE_ERR_CHN_INVALID,internal_error:Me.COMMON_ERR_INTERNAL,password_changed:Me.DEVICE_ERR_PWD_CHANGED,media_encrypt_changed:Me.CLOUD_ERR_ENCRYPT_CHANGED,relay_lifetime_expired:Me.CLOUD_ERR_FREE,channel_talk_busy:Me.CLOUD_ERR_TALK_BUSY,unbind_device:Me.CLOUD_ERR_UNBIND,lack_bandwidth:Me.CLOUD_ERR_BANDWIDTH,offline:Me.DEVICE_ERR_CHN_OFFLINE}}static get STATE_INITIAL(){return 1}static get STATE_OPTIONS(){return 2}static get STATE_DESCRIBE(){return 4}static get STATE_SETUP(){return 8}static get STATE_STREAMS(){return 16}static get STATE_TEARDOWN(){return 32}static get STATE_GET_STREAMS(){return 64}static get STATE_PAUSED(){return 128}static get STATE_PLAY(){return 256}static get STATE_SEND_VOICE(){return 512}constructor(t){super(),this.parent=t,this.transport=null,this.payParser=new Fr,this.rtp_channels=new Set,this.ontracks=null,this.messageBuilder={RTSP:new Ln(Ln.RTSP_1_0),HTTP:new Ln(Ln.HTTP_1_1)},this.isPlaying=!1,this.getAudioTime=0,this.tempVedioData=[],this.tempAudioData=[],this.addState(Ls.STATE_INITIAL,{}).addState(Ls.STATE_OPTIONS,{activate:this.sendOptions,finishTransition:this.onOptions}).addState(Ls.STATE_DESCRIBE,{activate:this.sendDescribe,finishTransition:this.onDescribe}).addState(Ls.STATE_SETUP,{activate:this.sendSetup,finishTransition:this.onSetup}).addState(Ls.STATE_STREAMS,{}).addState(Ls.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(Ls.STATE_INITIAL)}).addState(Ls.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(Ls.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addTransition(Ls.STATE_INITIAL,Ls.STATE_OPTIONS).addTransition(Ls.STATE_INITIAL,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_OPTIONS,Ls.STATE_DESCRIBE).addTransition(Ls.STATE_DESCRIBE,Ls.STATE_SETUP).addTransition(Ls.STATE_SETUP,Ls.STATE_STREAMS).addTransition(Ls.STATE_TEARDOWN,Ls.STATE_INITIAL).addTransition(Ls.STATE_STREAMS,Ls.STATE_PAUSED).addTransition(Ls.STATE_PAUSED,Ls.STATE_STREAMS).addTransition(Ls.STATE_PAUSED,Ls.STATE_PLAY).addTransition(Ls.STATE_PLAY,Ls.STATE_STREAMS).addTransition(Ls.STATE_PLAY,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_STREAMS,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_PAUSED,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_SETUP,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_DESCRIBE,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_OPTIONS,Ls.STATE_TEARDOWN),this.reset(),this.shouldReconnect=!1}destroy(){this.parent=null}setSource(t){this.reset(),this.endpoint=t,this.url=t.full}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&this.start()}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(Ls.STATE_TEARDOWN),await this.transitionTo(Ls.STATE_INITIAL)}start(){return this.currentState.name!==Ls.STATE_STREAMS?this.transitionTo(Ls.STATE_OPTIONS):Promise.resolve()}onData(t){let e=t[1];this.rtp_channels.has(e)&&this.onRTP({packet:t.subarray(4),type:e})}useRTPChannel(t){this.rtp_channels.add(t)}forgetRTPChannel(t){this.rtp_channels.delete(t)}async stop(){this.started&&await this.sendTeardown(),this.shouldReconnect=!1}async reset(){this.authenticator="",this.methods=[],this.tracks=[],this.rtpBuffer={};for(let t in this.streams)this.streams[t].reset();this.streams={},this.contentBase="",this.currentState?this.currentState.name!=Ls.STATE_INITIAL&&(await this.transitionTo(Ls.STATE_TEARDOWN),await this.transitionTo(Ls.STATE_INITIAL)):await this.transitionTo(Ls.STATE_INITIAL),this.sdp=null,this.interleaveChannelIndex=0,this.session=null,this.timeOffset={},this.lastTimestamp=0}async reconnect(){return await this.reset(),this.currentState.name!=Ls.STATE_INITIAL?(await this.transitionTo(Ls.STATE_TEARDOWN),this.transitionTo(Ls.STATE_OPTIONS)):this.transitionTo(Ls.STATE_OPTIONS)}supports(t){return this.methods.includes(t)}parse(t,e="RTSP"){let i=t.split("\r\n\r\n"),r=this.messageBuilder[e].parse(i[0]),n=Number(r.headers["content-length"]);if(n){let t=i[1];t&&"application/json"===r.headers["content-type"]&&(t=JSON.parse(t)),r.body=t}else r.body="";return Fs.log("parsed data: ",r),r}sendRequest(t,e,i={},r=null,n="RTSP"){return this.cSeq++,Object.assign(i,{CSeq:this.cSeq,"User-Agent":Ls.USER_AGENT}),this.authenticator&&(i["Authorization"]=this.authenticator(t)),this.send(this.messageBuilder[n].build(t,e,i,r),n).catch(s=>{if(s instanceof Os)return this.sendRequest(t,e,i,r,n);throw s},n)}async send(t,e="RTSP"){if(this.transport){try{await this.transport.ready}catch(i){throw this.onDisconnected(),i}let r=await this.transport.send(t),n=this.parse(r,e);if(401===n.code){Is.log("www-authenticate header: ",n.headers["www-authenticate"]);let t=n.headers["www-authenticate"],e=t.substring(0,t.indexOf(" "));t=t.substr(e.length+1);let r=t.split(","),s=this.parent.endpoint;if(!s.user||!s.pass)try{await this.parent.queryCredentials.call(this.parent)}catch(i){throw new Os}if("digest"==e.toLowerCase()){let t={};for(let e of r){let i=e.trim(),[r,n]=i.split("=");t[r]=n.substr(1,n.length-2)}this.authenticator=e=>{if(this.parent.options.userName&&this.parent.options.password){let i=this.parent.endpoint,r=Cs(`${this.parent.options.userName}:${t.realm}:${this.parent.options.password}`),n=Cs(`${e}:${i.full}`),s=Cs(`${r}:${t.nonce}:${n}`),a="";return`Digest username="${this.parent.options.userName}", nonce="${t.nonce}", uri="${i.full}", response="${s}"${a}`}{let i=this.parent.endpoint,r=Cs(`${i.user}:${t.realm}:${i.pass}`),n=Cs(`${e}:${i.urlpath}`),s=Cs(`${r}:${t.nonce}:${n}`),a="";return`Digest username="${i.user}", nonce="${t.nonce}", uri="${i.urlpath}", response="${s}"${a}`}}}else this.authenticator=()=>"Basic "+btoa(this.parent.endpoint.auth);throw new Os(n)}if(n.code>=300)throw Is.error(n.statusLine),new Rs({msg:`RTSP error: ${n.code} ${n.statusLine}`,parsed:n});return n}return Promise.reject("No transport attached")}error(t){this.parent.error(t)}sendTeardown(){let t="TEARDOWN";return this.sendRequest(t,"*")}sendHeartbeat(){}sendMultitrans(){}onMultitrans(){}sendDescribe(){return this.sendRequest("DESCRIBE",this.url,{Accept:"application/sdp"}).then(t=>(this.sdp=new Hr,this.sdp.parse(t.body).catch(()=>{throw new Error("Failed to parse SDP")}).then(()=>t)))}onDescribe(t){if(Is.log("sdp data: ",t),Is.log("sdp: ",this.sdp),this.contentBase=t.headers["content-base"]||this.url,this.tracks=this.sdp.getMediaBlockList(),this.rtpFactory=new Mr(this.sdp),Is.log("SDP contained "+this.tracks.length+" track(s). Calling SETUP for each."),t.headers["session"]&&(this.session=t.headers["session"]),!this.tracks.length)throw new Error("No tracks in SDP");this.transitionTo(Ls.STATE_SETUP)}sendSetup(){let t=[],e=this.sdp.getMediaBlock("video"),i=this.sdp.getMediaBlock("audio");Fs.log("video media block: ",e),Fs.log("audio media block: ",i),this.streams["video"]=new Ps(this,e,i);let r=this.streams["video"].start();return this.parent.sampleQueues["video"]=[],i&&(this.parent.sampleQueues["audio"]=[]),this.rtpBuffer[e.fmt[0]]=[],i&&(this.rtpBuffer[i.fmt[0]]=[]),t.push(r.then(({track:t,data:e})=>{Is.log("setup: ",t,e),i&&(this.timeOffset[i.fmt[0]]=0),this.timeOffset[t.fmt[0]]=0;try{let i=e.headers["rtp-info"].split(";");for(let e of i){let[i,r]=e.split("=");"rtptime"===i&&(this.timeOffset[t.fmt[0]]=Number(r))}}catch(s){}let r={timescale:0,scaleFactor:0};if(t.fmtp&&t.fmtp["sprop-parameter-sets"]){let e=t.fmtp["sprop-parameter-sets"].split(",");r={sps:he(e[0]),pps:he(e[1])}}else if(t.fmtp&&t.fmtp["config"]){let e=t.fmtp["config"];this.has_config="0"!=t.fmtp["cpresent"];let i="MPEG4-GENERIC"==t.rtpmap[t.fmt[0]].name;i?(r={config:Vr.parseAudioSpecificConfig(ce(e))},this.payParser.aacparser.setConfig(r.config)):e&&(r={config:Vr.parseStreamMuxConfig(ce(e))},this.payParser.aacparser.setConfig(r.config))}r.duration=this.sdp.sessionBlock.range?this.sdp.sessionBlock.range[1]-this.sdp.sessionBlock.range[0]:1,this.parent.seekable=r.duration>1;let n={track:t,audioTrack:i,offset:this.timeOffset[t.fmt[0]],type:me.string_map[t.rtpmap[t.fmt[0]].name],params:r,duration:r.duration};return n})),Promise.all(t).then(t=>{Fs.log("setup res: ",t),this.ontracks&&this.ontracks(t)}).catch(t=>{Is.log("stop play: ",t),this.stop(),this.reset()})}onSetup(){this.transitionTo(Ls.STATE_STREAMS)}pause(){return this.currentState.name===Ls.STATE_STREAMS?(this.isPlaying=!1,this.transitionTo(Ls.STATE_PAUSED)):Promise.resolve()}sendPause(){this.streams["video"].sendPause()}onPause(){this.isPlaying=!1}play(){return this.currentState.name===Ls.STATE_PAUSED?this.transitionTo(Ls.STATE_PLAY):Promise.resolve()}sendPlay(){return this.streams["video"].sendPlay()}onPlay(){this.transitionTo(Ls.STATE_STREAMS)}onRTP(t){if(!this.rtpFactory)return;this.isPlaying||this.currentState.name===Ls.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream"));let e=this.rtpFactory.build(t.packet,this.sdp);if(!e.type)return;e.utc_timestamp&&(this.timeOffset={},this.timeOffset[e.pt]=e.timestamp,this.lastTimestamp=e.utc_timestamp),this.timeOffset[e.pt]||(this.timeOffset[e.pt]=e.timestamp),this.timeOffset[e.pt]&&(e.timestamp-this.timeOffset[e.pt]<0||e.timestamp-this.timeOffset[e.pt]>9e5)&&(this.timeOffset[e.pt]=e.timestamp);let i=this.rtpBuffer[e.pt];i.push(e);while(i.length){let t=i.shift(),e=parseInt(this.lastTimestamp+1e3*(t.timestamp-this.timeOffset[t.pt])/9e4);if(t.media){let i=this.payParser.parse(t);if(i){if(this.parent.readyToPlay){let e=!1,r=i[0].ntype;switch(t.media.ptype){case me.H264:e=7===r;break;case me.H265:e=32===r;break;default:break}if(!e)return;this.parent.readyToPlay=!1}this.parent.sampleQueues[t.mediaType()]&&(i.forEach(i=>{i.type=t.type,i.timestamp=e,t.isVideo()&&(i.seq=this.currentSeq,this.currentSeq=0)}),this.parent.sampleQueues[t.mediaType()].push(i))}}}}updateReceivedSeq(){}}class Us extends Ls{constructor(t){super(t),this.slpRecorder=null,this.continuityCounterTs=48,this.continuityCounterPes=16,this.continuityCounterPNT=16,this.ptsMultiple=1,this.fPATCount=0,this.fPMTCount=0,this.noisedecoderSlpWorker=null,this.hasNoiseSlpDecoderInit=!1,this.initDecoderSlpWorker(),this.tsaudioBuffer=new Uint8Array,this.tsCount=0,this.addState(Ls.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onSlpStreamConfigs}).addState(Ls.STATE_SEND_VOICE,{activate:this.sendSlpVoice,finishTransition:this.onSlpVoice}).addTransition(Ls.STATE_OPTIONS,Ls.STATE_GET_STREAMS).addTransition(Ls.STATE_GET_STREAMS,Ls.STATE_SEND_VOICE).addTransition(Ls.STATE_SEND_VOICE,Ls.STATE_STREAMS).addTransition(Ls.STATE_SEND_VOICE,Ls.STATE_TEARDOWN),this.reset()}async initDecoderSlpWorker(){this.hasNoiseSlpDecoderInit=!1;let{libsWorker:t,libaudio:e,libaudioWasm:i}=await ur();this.noisedecoderSlpWorker=new Worker(t),this.noisedecoderSlpWorker.postMessage({cmd:"init",scripts:[e],wasmBinary:i}),this.noisedecoderSlpWorker.onmessage=t=>{const{data:e={}}=t,{hasInit:i}=e;i?this.hasNoiseSlpDecoderInit=!0:this.transformSlpTsBuffer(e.data)}}setSource(t){Is.log("set source: ",t),this.reset(),this.endpoint=t}async onConnected(){this.shouldReconnect&&(Is.log("start"),this.start())}async reset(){this.deviceBoundary="",this.sessionId="",this.loadedChunks=[],this.parsing=!1,this.cSeq=0,this.payload={},this.receivedSeq=0,this.initParser(),this.currentState?this.currentState.name!=Ls.STATE_INITIAL&&(await this.transitionTo(Ls.STATE_TEARDOWN),await this.transitionTo(Ls.STATE_INITIAL)):await this.transitionTo(Ls.STATE_INITIAL)}initParser(){this.parser=new Xr,this.parser.addPesParser($r.H264,Qr),this.parser.addPesParser($r.H265,Qr),this.parser.addPesParser($r.AAC,Kr),this.parser.addPesParser($r.PCMA_W,tn),this.parser.addPesParser($r.PCMA,Zr),this.parser.ontracks=t=>{let e={};for(let i of t)switch(i.type){case me.H264:e.video_codec="H264",this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[];break;case me.H265:e.video_codec="H265",this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[];break;case me.G711A:e.audio_codec="G711alaw",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;case me.AAC:e.audio_codec="AAC",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;case me.PCMA_W:e.audio_codec="PCMA_W",this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[];break;default:break}e.video_codec&&this.onRelayConfig(e)}}buildBoundary(t="",e,i=""){let r=`----${Bs}--\r\n`;if("sendMultiparts"===i?t=le(new Uint8Array(t)):t instanceof Object&&(t=JSON.stringify(t)),"sendMultiparts"===i?(r+="Content-Type: audio/mp2t\r\n",r+="X-If-Encrypt\t: 0\r\n"):r+="Content-Type: application/json\r\n",r+=`Content-Length: ${t.length}\r\n`,this.sessionId&&(r+=`X-Session-Id: ${this.sessionId}\r\n`),e&&(r+=e),r+="\r\n",r+=t,"sendMultiparts"===i){for(var n=r.length,s=new Uint8Array(n),a=0;a{this.reset(),this.redirectTime?this.parent.play():this.parent.start()},500)):(Ds=0,this.error(Me.CLOUD_ERR_DEV_RELAY)));if(301===i){let t=e["x-domain"],i=e["x-redirect-cookie"];return this.parent.redirect({domain:t,cookie:i}),void this.redirectTime++}if(this.redirectTime=0,Ds=0,this.parent.isReconnect=!1,0!==i){let e=Ls.RESPONSE_ERR_CODE[t.code];return void this.error(e||Me.CLOUD_ERR_DEV_RELAY)}this.deviceBoundary=e["content-type"].split("boundary=")[1];let r=this.transport.socket();r.initDataChannel(),this.transitionTo(Ls.STATE_SEND_VOICE)}sendSlpVoice(){Bn.get(t=>{t.rec?(this.slpRecorder=t.rec,this.startSlpRecorder()):this.parent.error(Ms[t.error.name])})}async startSlpRecorder(){this.slpRecorder.start(),this.slpRecorder.audioTatch=()=>{this.slpDataPart()}}async slpDataPart(){let t=new FileReader,e=this;t.onload=function(t){let i=t.target.result,r=2048,n=new Uint8Array([...e.tsaudioBuffer,...new Uint8Array(i)]);if(n.length>0){let t=new Uint8Array(r),i=0;for(let s=0;s=r?new Uint8Array(r):new Uint8Array(n.byteLength-s-1),i=0),s+1===n.byteLength&&(s+1)%r!==0&&(e.tsaudioBuffer=t)}},t.readAsArrayBuffer(this.slpRecorder.getPcmData())}noiseSetSlp(t){let e=this.parent.baseBufferQueue&&this.parent.baseBufferQueue.length>0,i=null;if(e){let t=this.parent.baseBufferQueue.shift();i=he(t)}else i=null;this.noisedecoderSlpWorker.postMessage({data:t,audioData:i,samplerate:8e3,decoderType:"_decodePCM",mode:this.parent.options.mode||"aec"})}transformSlpTsBuffer(t){if(!t)return;let e=t,i=new Uint8Array(e),r=this.PacketDataToTs(i,1024);this.sendMultiparts(r,"","sendMultiparts")}PacketDataToTs(t,e){let i=!1,r=188,n=0,s=1504,a=14,o=new ArrayBuffer(s);const h=new DataView(o);if(!i){h.setUint8(n,71),n+=1,h.setUint8(n,64),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,16+(15&this.fPATCount)),this.fPATCount++,n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,176),n+=1,h.setUint8(n,13),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,193),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1;let t=this.pat(),e=fe(new Uint8Array(t.pATSetCrc32Buf),t.setPATSetCrc32Off);h.setUint32(n,e),n+=4;for(var c=n;c<188;c++,n+=1)h.setUint8(n,255);h.setUint8(n,71),n+=1,h.setUint8(n,80),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,16+(15&this.fPMTCount)),this.fPMTCount++,n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,2),n+=1;let r=26,s=r-3;s-=5,h.setUint8(n,176),n+=1,h.setUint8(n,s),n+=1,h.setUint16(n,1),n+=2,h.setUint8(n,193),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,225),n+=1,h.setUint8(n,1),n+=1,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1,h.setUint8(n,144),n+=1,h.setUint8(n,225),n+=1,h.setUint8(n,1),n+=1,h.setUint8(n,240),n+=1,h.setUint8(n,0),n+=1;let a=this.pmt(),o=fe(new Uint8Array(a.pmtcrcBuf),a.pmtOff);h.setUint32(n,o),n+=4;for(c=n;c<376;c++,n+=1)h.setUint8(n,255);i=!0}let u=0,l=0,d=0,f=12+a,p=r-f;e<=p?(u=1,l=e):(u=parseInt((e-p-1)/(r-4))+1,u+=1,l=(e-p)%(r-4),0==l&&(l=r-4));for(let g=0;g30&&(this.continuityCounterPNT=16),e.setUint8(i,this.continuityCounterPNT),i+=1,this.continuityCounterPNT++,e.setUint8(i,0),i+=1,e.setUint8(i,parseInt(254*Math.random()+1)),i+=1,t}onSlpVoice(){console.log("结束")}sendMultiparts(t,e,i=""){let r=this.buildBoundary(t,e,i);return this.sendBoundary(r).then(t=>{Is.log("on multiparts\n",t);let{body:e="{}"}=t;e=JSON.parse(e);let{params:i={}}=e;return this.errorException(e)?null:(i.session_id&&(this.sessionId=i.session_id),t)})}onTS(t,e){this.isPlaying||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream")),this.parsing?this.loadedChunks.push(t):(this.parsing=!0,this.parseTS(t,e))}parseTS(t,e){for(let i=0;i{Object.prototype.hasOwnProperty.call(t,"type")||(t.type=r.type),t.timestamp=r.timestamp,t.seq=e}),this.parent.sampleQueues[r.mType].push(t)}}this.parsing=!1,this.loadedChunks.length&&this.onTS(this.loadedChunks.shift())}sendPause(){let{streamType:t}=this.parent.options;if("sdvod"===t){let t={type:"request",seq:0,params:{method:"do",pause:"null"}};this.sendMultiparts(t)}else"dtspk"===t&&this.slpRecorder&&this.slpRecorder.stop();return Promise.resolve()}sendPlay(){let{streamType:t}=this.parent.options;if("sdvod"===t){let t={type:"request",seq:0,params:{method:"do",play:"null"}};this.sendMultiparts(t)}return Promise.resolve()}destroy(){this.slpRecorder&&(this.noisedecoderSlpWorker.postMessage({isStop:!0,decoderType:"_decodePCM"}),this.slpRecorder.clear(),this.slpRecorder.stop())}}class zs extends Ls{constructor(t){super(t),this.base64BackUpBuffer=[],this.base64BackUpBufferLength=0,this.rtpRecorder=null,this.rtpSequence=0,this.noisedecoderNvmpWorker=null,this.hasNoiseNvmpDecoderInit=!1,this.initDecoderWorker(),this.rtpCnt=0,this.audioBuffer=new Uint8Array,this.addState(Ls.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onStreamConfigs}).addState(Ls.STATE_SEND_VOICE,{activate:this.sendRtpVoice,finishTransition:this.onSendRtpVoice}).addTransition(Ls.STATE_OPTIONS,Ls.STATE_GET_STREAMS).addTransition(Ls.STATE_GET_STREAMS,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_GET_STREAMS,Ls.STATE_SEND_VOICE).addTransition(Ls.STATE_SEND_VOICE,Ls.STATE_GET_STREAMS).addTransition(Ls.STATE_STREAMS,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_SEND_VOICE,Ls.STATE_TEARDOWN).addTransition(Ls.STATE_SEND_VOICE,Ls.STATE_PAUSED).addTransition(Ls.STATE_GET_STREAMS,Ls.STATE_STREAMS),this.dataBuffer=new Uint8Array([])}async initDecoderWorker(){this.hasNoiseNvmpDecoderInit=!1;let{libsWorker:t,libaudio:e,libaudioWasm:i}=await ur();this.noisedecoderNvmpWorker=new Worker(t),this.noisedecoderNvmpWorker.postMessage({cmd:"init",scripts:[e],wasmBinary:i}),this.noisedecoderNvmpWorker.onmessage=t=>{const{data:e={}}=t,{hasInit:i}=e;i?this.hasNoiseNvmpDecoderInit=!0:this.transformRtpBuffer(e.data)}}setSource(t){Is.log("set source: ",t),this.reset(),this.endpoint=t,this.url=t.full}onData(t){let e=oe(this.dataBuffer,t),i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint8(0);if(36===r){let r=i.getUint16(2),n=r+4;if(!(e.length>=n))return void(this.dataBuffer=e);t=e.slice(0,n),this.dataBuffer=e.slice(n)}else{let i=e.findIndex(t=>36===t);-1!==i?(t=e.slice(0,i),this.dataBuffer=e.slice(i)):(t=e,this.dataBuffer=new Uint8Array([]))}let n=le(t);if("$"!==n[0]){let t;Is.log("on data: ",n);try{t=this.parse(n,"RTSP")}catch(a){return a}if(!t)return;let e,i,{body:r={}}=t,{params:s={}}=r,o=s.event_type;switch(o){case"stream_finish":this.parent.stop(),i=Ls.FINISH_REASON[s.reason],this.parent.error(i||Me.MEDIA_ERR_NETWORK);break;case"channel_preview_params":this.onStreamConfigs(t);break;case"stream_sequence":this.currentSeq=s.sequence;break;case"channel_stream_status":e=s.status&&s.status[0],i=Ls.FINISH_REASON[e],i&&(this.parent.stop(),this.parent.error(i));break;case"stream_status":e=s.status,"finished"===e&&(this.parent.eventSource.dispatchEvent("ended"),this.parent.stop());default:break}return}let s=t[1];this.rtp_channels.has(s)&&this.onRTP({packet:t.subarray(4),type:s}),n=le(this.dataBuffer),"$"!==n[0]&&0!==n.indexOf("RTSP")||this.onData(new Uint8Array([]))}async reset(){await super.reset(),this.dataBuffer=new Uint8Array([]),this.receivedSeq=0,this.currentSeq=0}parse(t,e="RTSP"){let i=t.match(/\scontent-length:\s*(\d*)\s/i),r=0;if(i&&i.length>=2&&/^\d+$/.test(i[1]))r=parseInt(i[1]);else{if(!/content-length: \s*0$/i.test(t))return{};r=0}let n=t.split("\r\n\r\n"),s=n[1]||"";if(s.length{Is.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}sendOptions(){this.reset(),this.started=!0,this.cSeq=0;let t=this.endpoint.basename.split(".")[0],e=`rtsp://${this.endpoint.host}/multitrans`;return this.sendMultitrans(e,{type:"request",seq:0,params:{tums_multitrans_connect:{session_id:t,user_type:"player"}}})}onOptions(t){this.transitionTo(Ls.STATE_GET_STREAMS)}getStreams(){return this.sendMultitrans(this.url,{type:"request",seq:0,params:{method:"get",talk:{mode:this.parent.options.mode||"aec",channel:0}}},{"X-Data-Window-Size":ks})}async onStreamConfigs(t){if(!t)return;let{body:e={}}=t,{params:i={}}=e;if(this.errorException(e))return;this.sessionId=i["session_id"],this.sdp=new Hr,this.timeOffset=0,this.lastTimestamp=0;let r={type:"audio",port:0,proto:"",fmt:[8]},n="G711alaw";r.ptype=me.string_map[n];for(let a of r.fmt)this.sdp.mediaMap[a]=r;this.sdp.media[r.type]=r,this.rtpBuffer[r.fmt[0]]=[],this.useRTPChannel(0),this.useRTPChannel(1),this.parent.sampleQueues["video"]=[],this.parent.sampleQueues["audio"]=[],this.rtpFactory=new Mr(this.sdp);let s=this.transport.socket();s.initDataChannel(),this.transitionTo(Ls.STATE_SEND_VOICE)}onSendRtpVoice(){}sendRtpVoice(){Bn.get(t=>{t.rec?(this.rtpRecorder=t.rec,this.startRecorder()):this.parent.error(Ms[t.error.name])})}async startRecorder(){this.rtpRecorder.start(),this.rtpRecorder.audioTatch=()=>{this.sendRtpData()}}async sendRtpData(){let t=new FileReader,e=this;t.onload=function(t){let i=t.target.result,r=2048,n=new Uint8Array([...e.audioBuffer,...new Uint8Array(i)]);if(n.length>0){let t=new Uint8Array(r),i=0;for(let s=0;s=r?new Uint8Array(r):new Uint8Array(n.byteLength-s-1),i=0),s+1===n.byteLength&&(s+1)%r!==0&&(e.audioBuffer=t)}},t.readAsArrayBuffer(this.rtpRecorder.getPcmData())}noiseSet(t){let e=this.parent.baseBufferQueue&&this.parent.baseBufferQueue.length>0,i=null;if(e){let t=this.parent.baseBufferQueue.shift();i=he(t)}else i=null;this.noisedecoderNvmpWorker.postMessage({data:t,audioData:i,samplerate:8e3,decoderType:"_decodePCM",mode:this.parent.options.mode||"aec"})}async transformRtpBuffer(t){if(!t)return;let e=t,i=new Uint8Array(e),r=new ArrayBuffer(16+i.length);const n=new DataView(r);let s=0;n.setUint8(s,36),s+=1,n.setUint8(s,1),s+=1;let a=1036;n.setUint16(s,a),s+=2,n.setUint8(s,128),s+=1,n.setUint8(s,136),s+=1,n.setUint16(s,this.rtpCnt),s+=2,n.setUint32(s,320*this.rtpCnt),this.rtpCnt++,s+=4,s+=4;for(var o=0;o=ks/2)){let e={type:"notification",params:{event_type:"stream_sequence"}},i={"X-Data-Received":t};this.sendMultitrans(this.url,e,i),this.receivedSeq=t}}errorException(t){let{type:e,params:i={}}=t;if("response"===e&&0!==i["error_code"]){let t=Ns[i["error_code"]]||"CLOUD_ERR_STREAM";return this.parent.error(Me[t]),void this.transitionTo(Ls.STATE_TEARDOWN)}return!1}destroy(){return this.rtpRecorder&&(this.rtpRecorder.clear(),this.rtpRecorder.stop(),this.noisedecoderNvmpWorker.postMessage({isStop:!0,decoderType:"_decodePCM"})),this.sendStop()}}const Fs=ke("rtsp:stream");class Ws extends Mn{constructor(t={flush:10}){super(t),this.options.useMultitrans?this.clientSM=new zs(this):this.clientSM=new Us(this),this.clientSM.ontracks=t=>{this.eventSource.dispatchEvent("tracks",t),this.startStreamFlush()},this.heartbeatInterval=0,this.baseBufferQueue=[],this.sampleQueues={}}static streamType(){return"dtspk"}getInterAduioData(t){this.options.sendInterAduioData=t,this.baseBufferQueue.push(t)}setSource(t){Fs.log("RTSPClient source: ",t),super.setSource(t),this.clientSM.setSource(t)}attachTransport(t){super.attachTransport(t),this.clientSM.transport=t}detachTransport(){super.detachTransport(),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={},clearInterval(this.heartbeatInterval)}async destroy(){return await this.clientSM.destroy(),clearInterval(this.heartbeatInterval),super.destroy()}start(){let{options:t}=this,e=t.socket||t.url;this.setSource(hn.parse(t.url));let i=new yn(t.type,{socket:e});return this.attachTransport(i),this.clientSM.onRTSPConfig=t=>{this.eventSource.dispatchEvent("rtspConfig",t),this.startStreamFlush()},super.start(),this.transport?this.transport.ready.then(()=>this.clientSM.start()):Promise.reject("no transport attached")}stop(){return this.clientSM.stop(),super.stop()}async play(t){await this.clientSM.play().then(()=>{this.paused=!1,t&&t(),clearInterval(this.heartbeatInterval)})}async pause(t){await this.clientSM.pause().then(()=>{this.paused=!0,t&&t(),this.heartbeatInterval=setInterval(()=>{this.clientSM.sendHeartbeat()},5e3)})}onData(t){this.clientSM.onData(t)}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected(),clearInterval(this.heartbeatInterval)}error(t){this.eventSource.dispatchEvent("audioError",new Me(t))}onPlayerNotify(t){let{seq:e}=t,{streamType:i}=this.options;e&&"sdvod"===i&&this.clientSM.updateReceivedSeq(e)}}var Hs=Ws;const js="/tums",Vs="v1",qs="playback",Gs=(t,e=qs,i=Vs)=>`${js}/${e}/${i}/${t}`,Ys={suspendPlayback:"suspendPlayback",setPlaybackCfg:"setPlaybackCfg",deletePlaybackChn:"deletePlaybackChn",getCurrentTime:"getCurrentTime"},$s={url:{suspendPlayback:Gs(Ys.suspendPlayback),setPlaybackCfg:Gs(Ys.setPlaybackCfg),deletePlaybackChn:Gs(Ys.deletePlaybackChn),getCurrentTime:Gs(Ys.getCurrentTime,"systemConfig")},value:{suspendFlag:{play:0,pause:1}}};let Xs={ENAME:"error_code",ENONE:0,COMMON:{REQUEST_TIMEOUT:-82432,NETWORK_ERROR:-82428,UNKNOWN_CODE:-82415},VIDEO:{VIDEO_SET_PLAYBACK_FAIL:-80706},zhCN:{"-82432":"操作超时","-82428":"网络异常","-82429":"服务器忙","-80125":"该账号已在其他终端登录,请重新登录","-82402":"用户重新登录","-82415":"未知错误","-80706":"设置回放失败"},codeMap:{"-82432":Me.errorTypes.COMMON_ERR_TIME_OUT,"-82428":Me.errorTypes.COMMON_ERR_NETWORK,"-82429":Me.errorTypes.COMMON_ERR_INTERNAL,"-80125":Me.errorTypes.COMMON_ERR_SESSION,"-82402":Me.errorTypes.COMMON_ERR_SESSION,"-82415":Me.errorTypes.COMMON_ERR_CUSTOM,"-80706":Me.errorTypes.LOCAL_ERR_CONFIG_PLAYBACK},translate:t=>Object.prototype.hasOwnProperty.call(Xs.zhCN,""+t)?Xs.zhCN[t]:t+" is not a valid string",tranToMediaErrorType:t=>Xs.codeMap[t]?Xs.codeMap[t]:Me.errorTypes.COMMON_ERR_CUSTOM};var Qs=Xs;const Ks=ke("client:rtsp"),Zs=ke("client:wsWatch"),Js=12e3,ta=100;class ea extends Error{constructor(t){super(t)}}const ia={"-82400":"CLOUD_ERR_PARAM","-82401":"CLOUD_ERR_PERMISSION","-82414":"CLOUD_ERR_SERVER","-80702":"COMMON_ERR_SESSION","-80731":"CLOUD_ERR_TOKEN","-80304":"CLOUD_ERR_DEVID","-80732":"CLOUD_ERR_BANDWIDTH","-20002":"DEVICE_ERR_CHN_OFFLINE","-20571":"DEVICE_ERR_CHN_OFFLINE","-52405":"CLOUD_ERR_STREAM_LIMIT","-52413":"DEVICE_ERR_CHN_OFFLINE"},ra={[7350]:49,[8e3]:4,[11025]:49,[12e3]:2,[16e3]:8,[22050]:49,[24e3]:4,[32e3]:16,[44100]:49,[48e3]:24,[64e3]:32,[88200]:49,[96e3]:16},na=4294967296,sa=1e6,aa=30;class oa extends wn{static get USER_AGENT(){return"SFRtsp 0.3"}static get FINISH_REASON(){return{share_finish:Me.CLOUD_ERR_SHARE_FINISH,permission_deny:Me.CLOUD_ERR_PERMISSION,channel_offline:Me.DEVICE_ERR_CHN_OFFLINE,channel_invalid:Me.DEVICE_ERR_CHN_INVALID,internal_error:Me.COMMON_ERR_INTERNAL,password_changed:Me.DEVICE_ERR_PWD_CHANGED,media_encrypt_changed:Me.CLOUD_ERR_ENCRYPT_CHANGED,relay_lifetime_expired:Me.CLOUD_ERR_FREE,channel_talk_busy:Me.CLOUD_ERR_TALK_BUSY,unbind_device:Me.CLOUD_ERR_UNBIND,lack_bandwidth:Me.CLOUD_ERR_BANDWIDTH,offline:Me.DEVICE_ERR_CHN_OFFLINE}}static get STATE_INITIAL(){return 1}static get STATE_OPTIONS(){return 2}static get STATE_DESCRIBE(){return 4}static get STATE_SETUP(){return 8}static get STATE_STREAMS(){return 16}static get STATE_TEARDOWN(){return 32}static get STATE_GET_STREAMS(){return 64}static get STATE_PAUSED(){return 128}static get STATE_PLAY(){return 256}constructor(t){super(),this.parent=t,this.transport=null,this.payParser=new Fr,this.rtp_channels=new Set,this.ontracks=null,this.messageBuilder=new Ln(Ln.RTSP_1_0),this.isPlaying=!1,this.getAudioTime=0,this.tempVedioData=[],this.tempAudioData=[],this.isOnDataRemain=!1,this.isVideoWaitIFrame=!0,this.addState(oa.STATE_INITIAL,{}).addState(oa.STATE_OPTIONS,{activate:this.sendOptions,finishTransition:this.onOptions}).addState(oa.STATE_DESCRIBE,{activate:this.sendDescribe,finishTransition:this.onDescribe}).addState(oa.STATE_SETUP,{activate:this.sendSetup,finishTransition:this.onSetup}).addState(oa.STATE_STREAMS,{}).addState(oa.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(oa.STATE_INITIAL)}).addState(oa.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(oa.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addTransition(oa.STATE_INITIAL,oa.STATE_OPTIONS).addTransition(oa.STATE_INITIAL,oa.STATE_TEARDOWN).addTransition(oa.STATE_OPTIONS,oa.STATE_DESCRIBE).addTransition(oa.STATE_DESCRIBE,oa.STATE_SETUP).addTransition(oa.STATE_SETUP,oa.STATE_STREAMS).addTransition(oa.STATE_TEARDOWN,oa.STATE_INITIAL).addTransition(oa.STATE_STREAMS,oa.STATE_PAUSED).addTransition(oa.STATE_PAUSED,oa.STATE_STREAMS).addTransition(oa.STATE_PAUSED,oa.STATE_PLAY).addTransition(oa.STATE_PLAY,oa.STATE_STREAMS).addTransition(oa.STATE_PLAY,oa.STATE_TEARDOWN).addTransition(oa.STATE_STREAMS,oa.STATE_TEARDOWN).addTransition(oa.STATE_PAUSED,oa.STATE_TEARDOWN).addTransition(oa.STATE_SETUP,oa.STATE_TEARDOWN).addTransition(oa.STATE_DESCRIBE,oa.STATE_TEARDOWN).addTransition(oa.STATE_OPTIONS,oa.STATE_TEARDOWN),this.ifNeedAdjustAVPTS=!0,this.reset(),this.shouldReconnect=!1}async destroy(){await this.stop(),this.parent=null}setSource(t){this.reset(),this.endpoint=t,this.url=t.full}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&this.start()}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(oa.STATE_TEARDOWN),await this.transitionTo(oa.STATE_INITIAL)}start(){return this.currentState.name!==oa.STATE_STREAMS?this.transitionTo(oa.STATE_OPTIONS):Promise.resolve()}onData(t){!this.isOnDataRemain&&this.dataBuffer||(this.dataBuffer=new Uint8Array([])),this.isOnDataRemain=!1;let e=oe(this.dataBuffer,t),i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint8(0);if(36===r){if(i.byteLength<4)return void(this.dataBuffer=e);let r=i.getUint16(2),n=r+4;if(!(e.length>=n))return void(this.dataBuffer=e);t=e.slice(0,n),this.dataBuffer=e.slice(n)}else{let i=e.findIndex(t=>36===t);-1!==i?(t=e.slice(0,i),this.dataBuffer=e.slice(i)):(t=e,this.dataBuffer=new Uint8Array([]))}if(t.byteLength){if(36===t[0]){let e=t[1];this.rtp_channels.has(e)&&this.onRTP({packet:t.subarray(4),type:e})}this.dataBuffer.byteLength&&36===this.dataBuffer[0]&&(this.isOnDataRemain=!0,this.onData(this.dataBuffer))}}useRTPChannel(t){this.rtp_channels.add(t)}forgetRTPChannel(t){this.rtp_channels.delete(t)}async stop(){this.started&&(this.sendTeardown(),this.transport&&this.transport.stop()),this.shouldReconnect=!1}async reset(){this.authenticator="",this.methods=[],this.tracks=[],this.rtpBuffer={};for(let t in this.streams)this.streams[t].reset();this.streams={},this.contentBase="",this.currentState?this.currentState.name!=oa.STATE_INITIAL&&(await this.transitionTo(oa.STATE_TEARDOWN),await this.transitionTo(oa.STATE_INITIAL)):await this.transitionTo(oa.STATE_INITIAL),this.sdp=null,this.interleaveChannelIndex=0,this.session=null,this.lastRTPSeq={},this.isVideoWaitIFrame=!0,this.lastVideoFrameFlag=0,this.recordVideoFrameFlagForMultiSlice=0,this.scale=1,this.videoPTSTimescale=9e4,this.audioSampleRate=8e3,this.resetAdjustPTSContext()}resetAdjustPTSContext(){this.relativeUTCInfo={},this.avTrackTSBaseAdjusted=!1,this.trackTSAdjustInterval={},this.ifSetTSAdjustRefTrack=!1,this.tsAdjustRefTrack="video",this.startVideoPTS=-1,this.startAudioPTS=-1}async reconnect(){return await this.reset(),this.currentState.name!=oa.STATE_INITIAL?(await this.transitionTo(oa.STATE_TEARDOWN),this.transitionTo(oa.STATE_OPTIONS)):this.transitionTo(oa.STATE_OPTIONS)}supports(t){return this.methods.includes(t)}parse(t){let e=t.split("\r\n\r\n"),i=this.messageBuilder.parse(e[0]),r=Number(i.headers["content-length"]);if(r){let t=e[1];t&&"application/json"===i.headers["content-type"]&&(t=JSON.parse(t)),i.body=t}else i.body="";return ua.log("parsed data: ",i),i}sendRequest(t,e,i={},r=null){return this.cSeq++,Object.assign(i,{CSeq:this.cSeq,"User-Agent":oa.USER_AGENT}),this.authenticator&&(i["Authorization"]=this.authenticator(t)),this.send(this.messageBuilder.build(t,e,i,r),t).catch(n=>{if(n instanceof ea)return this.sendRequest(t,e,i,r);throw n})}async send(t){if(this.transport){try{await this.transport.ready}catch(e){throw this.onDisconnected(),e}let i=await this.transport.send(t),r=this.parse(i);if(401===r.code){Ks.log("www-authenticate header: ",r.headers["www-authenticate"]);let t=r.headers["www-authenticate"],i=t.substring(0,t.indexOf(" "));t=t.substr(i.length+1);let n=t.split(","),s=this.parent.endpoint;if(!s.user||!s.pass)try{await this.parent.queryCredentials.call(this.parent)}catch(e){throw new ea}if("digest"==i.toLowerCase()){let t={};for(let e of n){let i=e.trim(),[r,n]=i.split("=");t[r]=n.substr(1,n.length-2)}this.authenticator=e=>{if(this.parent.options.userName&&this.parent.options.password){let i=this.parent.endpoint,r=`${i.protocol}://${i.host}/${i.basename}`,n=Cs(`${this.parent.options.userName}:${t.realm}:${this.parent.options.password}`),s=Cs(`${e}:${r}`),a=Cs(`${n}:${t.nonce}:${s}`),o="";return`Digest username="${this.parent.options.userName}", realm="${t.realm}", nonce="${t.nonce}", uri="${r}", response="${a}"${o}`}{let i=this.parent.endpoint,r=Cs(`${i.user}:${t.realm}:${i.pass}`),n=Cs(`${e}:${i.urlpath}`),s=Cs(`${r}:${t.nonce}:${n}`),a="";return`Digest username="${i.user}", nonce="${t.nonce}", uri="${i.urlpath}", response="${s}"${a}`}}}else this.authenticator=()=>"Basic "+btoa(this.parent.endpoint.auth);throw new ea(r)}if(r.code>=300)throw Ks.error(r.statusLine),new Rs({msg:`RTSP error: ${r.code} ${r.statusLine}`,parsed:r});return r}return Promise.reject("No transport attached")}setResolution(){}sendOptions(){this.reset(),this.started=!0,this.cSeq=0;let t=this.url;return this.sendRequest("OPTIONS",t,{})}onOptions(t){this.methods=t.headers["public"].split(",").map(t=>t.trim()),this.transitionTo(oa.STATE_DESCRIBE)}sendTeardown(){let t="TEARDOWN";return this.sendRequest(t,"*")}sendMultitrans(){}onMultitrans(){}sendDescribe(){return this.sendRequest("DESCRIBE",this.url,{Accept:"application/sdp"}).then(t=>(this.sdp=new Hr,this.sdp.parse(t.body).catch(()=>{throw new Error("Failed to parse SDP")}).then(()=>t)))}onDescribe(t){if(Ks.log("sdp data: ",t),Ks.log("sdp: ",this.sdp),this.contentBase=t.headers["content-base"]||this.url,this.tracks=this.sdp.getMediaBlockList(),this.rtpFactory=new Mr(this.sdp),Ks.log("SDP contained "+this.tracks.length+" track(s). Calling SETUP for each."),t.headers["session"]&&(this.session=t.headers["session"]),!this.tracks.length)throw new Error("No tracks in SDP");this.transitionTo(oa.STATE_SETUP)}sendSetup(){let t=[],e=this.sdp.getMediaBlock("video"),i=this.sdp.getMediaBlock("audio");ua.log("video media block: ",e),ua.log("audio media block: ",i),this.streams["video"]=new Ps(this,e,i);let r=this.streams["video"].start();return this.parent.sampleQueues["video"]=[],i&&(this.parent.sampleQueues["audio"]=[]),this.rtpBuffer[e.fmt[0]]=[],i&&(this.rtpBuffer[i.fmt[0]]=[]),t.push(r.then(({track:t,data:e})=>{var r,n;Ks.log("setup: ",t,e),this.lastRTPSeq[t.fmt[0]]=-1;let s={timescale:0,scaleFactor:0};if(t.fmtp&&t.fmtp["sprop-parameter-sets"]){let e=t.fmtp["sprop-parameter-sets"].split(",");s={sps:he(e[0]),pps:he(e[1])}}else if(t.fmtp&&t.fmtp["config"]){let e=t.fmtp["config"];this.has_config="0"!=t.fmtp["cpresent"];let i="MPEG4-GENERIC"==t.rtpmap[t.fmt[0]].name;i?(s={config:Vr.parseAudioSpecificConfig(ce(e))},this.payParser.aacparser.setConfig(s.config)):e&&(s={config:Vr.parseStreamMuxConfig(ce(e))},this.payParser.aacparser.setConfig(s.config))}let a="MPEG4-GENERIC"==(null===i||void 0===i||null===(r=i.rtpmap[null===i||void 0===i?void 0:i.fmt[0]])||void 0===r?void 0:r.name);if(i&&null!==i&&void 0!==i&&i.fmtp&&null!==i&&void 0!==i&&i.fmtp["config"]){let t=i.fmtp["config"];this.has_config="0"!=i.fmtp["cpresent"],a?(s={config:Vr.parseAudioSpecificConfig(ce(t))},this.payParser.aacparser.setConfig(s.config)):t&&(s={config:Vr.parseStreamMuxConfig(ce(t))},this.payParser.aacparser.setConfig(s.config))}if(a&&!Object.hasOwnProperty.call(i,"fmtp")){var o;let t={samplerate:null===i||void 0===i||null===(o=i.rtpmap[null===i||void 0===i?void 0:i.fmt[0]])||void 0===o?void 0:o.clock};this.payParser.aacparser.setConfig(t)}let h=null===i||void 0===i||null===(n=i.rtpmap[null===i||void 0===i?void 0:i.fmt[0]])||void 0===n?void 0:n.clock;h>0&&(this.audioSampleRate=h),s.duration=this.sdp.sessionBlock.range?this.sdp.sessionBlock.range[1]-this.sdp.sessionBlock.range[0]:1,this.parent.seekable=s.duration>1;let c={track:t,audioTrack:i,type:me.string_map[t.rtpmap[t.fmt[0]].name],params:s,duration:s.duration};return c})),Promise.all(t).then(t=>{ua.log("setup res: ",t),this.ontracks&&this.ontracks(t)}).catch(t=>{Ks.log("stop play: ",t),this.stop(),this.reset()})}onSetup(){this.transitionTo(oa.STATE_STREAMS)}pause(){return this.currentState.name===oa.STATE_STREAMS?this.transitionTo(oa.STATE_PAUSED):Promise.resolve()}sendPause(){this.streams["video"].sendPause()}onPause(){this.isPlaying=!1}play(){return this.currentState.name===oa.STATE_PAUSED?this.transitionTo(oa.STATE_PLAY):Promise.resolve()}sendPlay(){return this.streams["video"].sendPlay(),Promise.resolve()}onPlay(){this.transitionTo(oa.STATE_STREAMS)}sendPlaybackConfig(){}adjustTrackPTS(t,e){if(!this.ifNeedAdjustAVPTS)return e;if(this.ifSetTSAdjustRefTrack||(this.ifSetTSAdjustRefTrack=!0,this.tsAdjustRefTrack=t,this.trackTSAdjustInterval[t]=0,console.log("get interval",t,this.trackTSAdjustInterval[t])),t!=this.tsAdjustRefTrack&&!this.avTrackTSBaseAdjusted){this.avTrackTSBaseAdjusted=!0;do{if("audio"===t&&this.relativeUTCInfo.isRealUTC&&this.relativeUTCInfo.utc%1e3!==0){let i=this.relativeUTCInfo.utc*this.audioSampleRate/1e3&4294967295;if(Math.abs(e-i)aa*sa?a-=r:a+aa*sa<0&&(a+=r),Math.abs(a)<=aa*sa){let e="video"===t?1:-1,i="video"===t?this.videoPTSTimescale:this.audioSampleRate;this.trackTSAdjustInterval[t]=a*i*e/sa,console.log("get interval",t,this.trackTSAdjustInterval[t])}else this.trackTSAdjustInterval[t]=0,console.log("adjust abnormal get interval",t,this.trackTSAdjustInterval[t])}while(0)}if("audio"===t){let i=e-this.startAudioPTS+this.trackTSAdjustInterval[t];return i<0?0:i}{let i=e-this.startVideoPTS+this.trackTSAdjustInterval[t];return i<0?0:i}}onRTP(t){if(!this.rtpFactory)return;this.isPlaying||this.currentState.name===oa.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream"));let e=this.rtpFactory.build(t.packet,this.sdp);if(!Object.prototype.hasOwnProperty.call(e,"type"))return;if(this.seekTime){if(!e.utc_timestamp)return;if(Math.abs(e.utc_timestamp-this.seekTime)<=12e3)this.seekTime=0;else{if(!(Date.now()-this.startSeekTime>=3e3))return;this.seekTime=0}}!e.utc_timestamp&&this.relativeUTCInfo.utc||(this.relativeUTCInfo.isRealUTC=!!e.utc_timestamp,this.relativeUTCInfo={utc:e.utc_timestamp||1,pts:e.timestamp},this.relativeUTCInfo.ptsAdjusted=!1,this.ifNeedAdjustAVPTS&&this.avTrackTSBaseAdjusted&&(this.relativeUTCInfo.pts=this.adjustTrackPTS("video",this.relativeUTCInfo.pts),this.relativeUTCInfo.ptsAdjusted=!0));let i=this.rtpBuffer[e.pt]||[];i.push(e);let r=0;while(i.length){let t=i.shift();-1===this.lastRTPSeq[t.pt]&&(this.lastRTPSeq[t.pt]=t.sequence);let e=1;if(t.isVideo()&&(this.isVideoWaitIFrame||t.sequence-this.lastRTPSeq[t.pt]!==1&&this.lastRTPSeq[t.pt]-t.sequence!==65535&&(this.isVideoWaitIFrame=!0,console.log("on video get wrong rtp sn",t.sequence,this.lastRTPSeq[t.pt])),0===this.lastVideoFrameFlag&&(this.lastVideoFrameFlag=t.frame_flg),this.scale>1&&(e=this.scale)),this.lastRTPSeq[t.pt]=t.sequence,t.media){let i=this.payParser.parse(t);if(i){let n=!1;if(this.parent.sampleQueues[t.mediaType()]){if(i.forEach(i=>{let s=i.pts;i.type=t.type,this.ifNeedAdjustAVPTS&&this.avTrackTSBaseAdjusted&&(s=this.adjustTrackPTS(t.media.type,i.pts)),t.isVideo()?(i.seq=this.currentSeq,0!==this.lastVideoFrameFlag&&(i.isVirtualI=1===this.lastVideoFrameFlag,i.isDecodeOnlyI=2===this.lastVideoFrameFlag),i.isStartSlice()?this.recordVideoFrameFlagForMultiSlice=this.lastVideoFrameFlag:(i.isVirtualI=1===this.recordVideoFrameFlagForMultiSlice,i.isDecodeOnlyI=2===this.recordVideoFrameFlagForMultiSlice),this.lastVideoFrameFlag=0,this.isVideoWaitIFrame&&(n=i.isParameterSet(),i.isKeyframe()&&(console.log("get i frame stop drop frame",i.ntype),this.isVideoWaitIFrame=!1,this.startVideoPTS<0&&(this.startVideoPTS=i.pts))),!this.ifNeedAdjustAVPTS||n||this.avTrackTSBaseAdjusted||this.isVideoWaitIFrame||(s=this.adjustTrackPTS("video",i.pts),this.relativeUTCInfo.ptsAdjusted||(this.relativeUTCInfo.pts=this.adjustTrackPTS("video",this.relativeUTCInfo.pts),this.relativeUTCInfo.ptsAdjusted=!0)),i.timestamp=parseInt(this.relativeUTCInfo.utc+1e3*(s-this.relativeUTCInfo.pts)*e/this.videoPTSTimescale)):(this.startAudioPTS<0&&(this.startAudioPTS=i.pts),this.ifNeedAdjustAVPTS&&!this.avTrackTSBaseAdjusted&&(s=this.adjustTrackPTS("audio",i.pts)),i.samplerate=this.audioSampleRate,i.timestamp=parseInt(this.relativeUTCInfo.utc+e*(1e3*s/this.audioSampleRate-1e3*this.relativeUTCInfo.pts/this.videoPTSTimescale))),r=i.timestamp}),t.isVideo()&&this.isVideoWaitIFrame&&!n)return;if(1!==this.scale&&t.isAudio())return;this.parent.feed(t.mediaType(),i)}}}}return{timestamp:r}}video_refresh_thread(t){if(this.tempAudioData.length<3||this.tempVedioData.length<3)return t.type===me.G711A||t.type===me.AAC?(this.tempAudioData.push(t),{}):(this.tempVedioData.push(t),{});if(t.type===me.G711A||t.type===me.AAC)return this.tempAudioData.push(t),this.getAudioTime=this.tempAudioData[0].timestamp,this.tempAudioData.shift();{this.tempVedioData.push(t);let e=this.getAudioTime-Jsthis.tempVedioData[0].timestamp?(this.tempVedioData.shift(),{}):(this.tempVedioData[0].timestamp=this.getAudioTime,{})}}updateReceivedSeq(){}sendHeartbeat(){this.sendRequest("OPTIONS",this.url,{})}throwErrorByErrorCode(t){this.parent.error(Qs.tranToMediaErrorType(t))}}class ha extends oa{constructor(t){super(t),this.addState(oa.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onStreamConfigs}).addTransition(oa.STATE_OPTIONS,oa.STATE_GET_STREAMS).addTransition(oa.STATE_GET_STREAMS,oa.STATE_TEARDOWN).addTransition(oa.STATE_GET_STREAMS,oa.STATE_STREAMS).addTransition(oa.STATE_STREAMS,oa.STATE_TEARDOWN),this.dataBuffer=new Uint8Array([]),this.lastSetMultitransTime=0,this.lastGetWsTime=Number.MAX_SAFE_INTEGER,this.wsWatchIntervalId="",this.ifNeedAdjustAVPTS=!1}setSource(t){Ks.log("set source: ",t),this.reset(),this.endpoint=t,this.url=t.full}onData(t){this.lastGetWsTime=(new Date).getTime(),!this.isOnDataRemain&&this.dataBuffer||(this.dataBuffer=new Uint8Array([])),this.isOnDataRemain=!1;let e=oe(this.dataBuffer,t),i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint8(0);if(36===r){if(i.byteLength<4)return void(this.dataBuffer=e);let r=i.getUint16(2),n=r+4;if(!(e.length>=n))return void(this.dataBuffer=e);t=e.slice(0,n),this.dataBuffer=e.slice(n)}else{let i=e.findIndex(t=>36===t);-1!==i?(t=e.slice(0,i),this.dataBuffer=e.slice(i)):(t=e,this.dataBuffer=new Uint8Array([]))}if(t.byteLength){if(36===t[0]){let e=t[1];this.rtp_channels.has(e)&&this.onRTP({packet:t.subarray(4),type:e})}else{let e,i=le(t);try{if(e=this.parse(i),!e.body)return void(this.dataBuffer=t)}catch(n){return this.dataBuffer=t,n}if(!e)return;let r,s,{body:a={}}=e,{params:o={}}=a,h=o.event_type;switch(h){case"stream_finish":this.parent.stop(),s=oa.FINISH_REASON[o.reason],this.parent.error(s||Me.MEDIA_ERR_NETWORK);break;case"channel_preview_params":this.onStreamConfigs(e);break;case"stream_sequence":this.currentSeq=parseInt(o.sequence);break;case"channel_stream_status":r=o.status&&o.status[0],s=oa.FINISH_REASON[r],s&&(this.parent.stop(),this.parent.error(s));break;case"stream_status":r=o.status,"finished"===r&&(this.parent.eventSource.dispatchEvent("ended"),this.parent.stop());default:break}}(this.dataBuffer.byteLength&&36===this.dataBuffer[0]||this.dataBuffer.byteLength>=4&&"rtsp"===le(this.dataBuffer.slice(0,4)).toLocaleLowerCase())&&(this.isOnDataRemain=!0,this.onData(this.dataBuffer))}}async reset(){await super.reset(),this.dataBuffer=new Uint8Array([]),this.receivedSeq=0,this.currentSeq=0,this.lastSetMultitransTime=0,this.lastGetWsTime=Number.MAX_SAFE_INTEGER,this.wsWatchIntervalId="",this.endWatchWsStatus()}async destroy(){await this.sendStop(),this.endWatchWsStatus(),super.destroy()}parse(t){let e=t.match(/\scontent-length:\s*(\d*)\s/i),i=0;if(e&&e.length>=2&&/^\d+$/.test(e[1]))i=parseInt(e[1]);else{if(!/content-length: \s*0$/i.test(t))return{};i=0}let r=t.split("\r\n\r\n"),n=r[1]||"";if(n.length{Ks.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}sendOptions(){this.reset(),this.started=!0,this.cSeq=0;let t=this.endpoint.basename.split(".")[0],e=`rtsp://${this.endpoint.host}/multitrans`;return this.sendMultitrans(e,{type:"request",seq:0,params:{tums_multitrans_connect:{session_id:t,user_type:"player"}}})}onOptions(t){this.transitionTo(oa.STATE_GET_STREAMS)}getStreams(){let{eventType:t,startTime:e,scale:i,channel:r=0}=this.parent.options;return t=t||[],i&&(this.scale=i),this.sendMultitrans(this.url,{type:"request",seq:0,params:{method:"get",playback:{client_id:0,channels:[r],scale:la.formatScale(i),start_time:String(Math.floor(e/1e3)),event_type:t}}},{"X-Data-Window-Size":ta})}onStreamConfigs(t){var e,i;if(!t)return;let{body:r={}}=t,{params:n={}}=r;if(this.errorException(r))return;n["session_id"]&&(this.sessionId=n["session_id"]),this.sdp=new Hr;let s=n["av_config"][0],a={},o={};a.type="video",a.port=0,a.proto="";let h=(null===n||void 0===n||null===(e=n.av_config[0])||void 0===e||null===(e=e.extra_data)||void 0===e?void 0:e.video_rtpmap)&&(null===n||void 0===n||null===(i=n.av_config[0])||void 0===i||null===(i=i.extra_data)||void 0===i?void 0:i.video_rtpmap.slice(0,2)),c=h||96;a.fmt=[c],a.ptype=me.string_map[s.video_codec];for(let d of a.fmt)this.sdp.mediaMap[d]=a;this.sdp.media[a.type]=a,o.type="audio",o.port=0,o.proto="",o.fmt=[8],o.ptype=me.string_map[s.audio_codec];for(let d of o.fmt)this.sdp.mediaMap[d]=o;if(this.sdp.media[o.type]=o,s.audio_sampling_rate&&(this.audioSampleRate=1e3*s.audio_sampling_rate),"AAC"===s.audio_codec){let t={samplerate:1e3*parseInt(s.audio_sampling_rate)};this.payParser.aacparser.setConfig(t)}if(this.sdp.isNvmpAccPlayBack=!0,Object.hasOwnProperty.call(n,"interleaved")){var u;let t=null===(u=n.interleaved[0])||void 0===u||null===(u=u.interleaved_id)||void 0===u?void 0:u.split("-");t.length&&t.forEach(t=>{this.useRTPChannel(Number(t))})}this.useRTPChannel(0),this.useRTPChannel(1),this.rtpBuffer[a.fmt[0]]=[],this.rtpBuffer[o.fmt[0]]=[],this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[],this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[],this.rtpFactory=new Mr(this.sdp);let l=this.transport.socket();l.initDataChannel(),this.onRTSPConfig&&this.onRTSPConfig(s),this.transitionTo(oa.STATE_STREAMS),this.startWatchWsStatus()}async sendPlaybackConfig(t){let{startTime:e,endTime:i,scale:r,eventType:n,currentTime:s}=t,a=r<0?"-":"";r&&(this.scale=r),e=e||s;let o={type:"request",seq:0,params:{method:"do",play:{start_time:e?parseInt(e/1e3)+"":void 0,end_time:i?parseInt(i/1e3)+"":void 0,scale:r?a+Mn.formatScale(r):void 0}}};return this.sendMultitrans(this.url,o),this.currentState.name===oa.STATE_PAUSED?this.transitionTo(oa.STATE_STREAMS):Promise.resolve()}sendPause(){return Promise.resolve()}sendPlay(){return Promise.resolve()}sendStop(){return this.currentState.name===oa.STATE_STREAMS||this.currentState.name===oa.STATE_PAUSED?this.sendMultitrans(this.url,{type:"request",seq:0,params:{method:"do",stop:"null"}}):Promise.resolve()}startWatchWsStatus(){this.endWatchWsStatus(),this.wsWatchIntervalId=setInterval(()=>{(new Date).getTime()-this.lastSetMultitransTime>=2e3&&this.currentState.name===oa.STATE_STREAMS&&this.sendHeartbeat(),(new Date).getTime()-this.lastGetWsTime>=6e4&&this.currentState.name===oa.STATE_STREAMS&&(this.endWatchWsStatus(),Zs.log("ws stop for a long time",(new Date).getTime(),this.lastGetWsTime),this.parent.error(Me.MEDIA_ERR_TRANSPORT))},2e3)}endWatchWsStatus(){clearInterval(this.wsWatchIntervalId)}sendHeartbeat(){let t={type:"notification"};this.sendMultitrans(this.url,t)}updateReceivedSeq(t){if(this.currentState.name===oa.STATE_STREAMS&&(t=parseInt(t),t>this.receivedSeq)){let e={type:"notification",params:{event_type:"stream_sequence"}},i={"X-Data-Received":t};this.sendMultitrans(this.url,e,i),this.receivedSeq=t}}errorException(t){let{type:e,params:i={}}=t;if("response"===e&&0!==i["error_code"]){let t=ia[i["error_code"]]||"CLOUD_ERR_STREAM";return this.parent.error(Me[t]),void this.transitionTo(oa.STATE_TEARDOWN)}return!1}}class ca extends oa{destroy(){return this.transport&&this.transport.stop(),new Promise((t,e)=>{this.parent.requestor.post($s.url.deletePlaybackChn,{id:[this.getIdParams()]}).then(({result:i=[]})=>{i=i[0]||{},0===i.errorCode||i.errorCode===Qs.VIDEO.VIDEO_SET_PLAYBACK_FAIL?(super.destroy(),t()):(this.throwErrorByErrorCode(i.errorCode),e({error_code:i.errorCode}))}).catch(t=>{this.throwErrorByErrorCode(t.errorCode),e(t)})})}sendPause(){return new Promise((t,e)=>{this.parent.requestor.post($s.url.suspendPlayback,{id:[this.getIdParams()],suspendOrNot:$s.value.suspendFlag.pause}).then(({result:i=[]})=>{i=i[0]||{},0===i.errorCode||i.errorCode===Qs.VIDEO.VIDEO_SET_PLAYBACK_FAIL?(Ks.log("pause sdvod success"),t()):(this.throwErrorByErrorCode(i.errorCode),e({error_code:i.errorCode}))}).catch(t=>{this.throwErrorByErrorCode(t.error_code),e(t)})})}sendPlay(){return new Promise((t,e)=>{this.parent.requestor.post($s.url.suspendPlayback,{id:[this.getIdParams()],suspendOrNot:$s.value.suspendFlag.play}).then(({result:i=[]})=>{i=i[0]||{},0===i.errorCode||i.errorCode===Qs.VIDEO.VIDEO_SET_PLAYBACK_FAIL?(Ks.log("replay sdvod success"),t()):(Ks.log("replay sdvod fail: "+i.errorCode),this.throwErrorByErrorCode(i.errorCode),e({error_code:i.errorCode}))}).catch(t=>{this.throwErrorByErrorCode(t.error_code),e(t)})})}async sendPlaybackConfig(t){let{startTime:e,currentTime:i,endTime:r,scale:n,currentScale:s}=t;if(n&&(this.scale=n),await new Promise((t,a)=>{e||(e=i);let o={startTime:Math.floor(e/1e3),scale:Mn.formatScale(s)};void 0!==r&&null!==r&&Object.assign(o,{endTime:Math.floor(r/1e3)}),void 0===n||null===n||this.parent.options.useMultitrans||Object.assign(o,{scale:Mn.formatScale(n)}),this.parent.requestor.post($s.url.setPlaybackCfg,{id:[this.getIdParams()],...o}).then(({result:e=[]})=>{e=e[0]||{},0===e.errorCode||e.errorCode===Qs.VIDEO.VIDEO_SET_PLAYBACK_FAIL?(Ks.log("replay sdvod success"),t()):(Ks.log("replay sdvod fail: "+e.errorCode),this.throwErrorByErrorCode(e.errorCode),a({error_code:e.errorCode}))}).catch(t=>{this.throwErrorByErrorCode(t.error_code),a(t)}),this.resetAdjustPTSContext(),this.seekTime=e,this.startSeekTime=Date.now(),this.ifNeedAdjustAVPTS=1===this.scale}),this.currentState.name===oa.STATE_PAUSED)return this.transitionTo(oa.STATE_STREAMS)}onRTP(t){let e=super.onRTP(t);if(e&&e.timestamp&&this.parent.options.endTime){let{timestamp:t}=e,{endTime:i}=this.parent.options;i<=t&&(this.parent.eventSource.dispatchEvent("ended"),this.parent.stop())}}getIdParams(){let t={videoDevId:this.parent.options.videoDevId,sessionId:this.parent.options.videoSessionId};return this.parent.options.storageDevId&&Object.assign(t,{storageDevId:this.parent.options.storageDevId}),t}sendHeartbeat(){this.sendRequest("OPTIONS",this.url,{})}}const ua=ke("rtsp:stream");class la extends Mn{constructor(t={flush:10}){super(t),"sdvod"!==this.options.streamType?this.clientSM=new oa(this):"sdvod"!==this.options.streamType||this.options.useMultitrans?"sdvod"===this.options.streamType&&this.options.useMultitrans&&(this.clientSM=new ha(this)):this.clientSM=new ca(this),this.requestor=t.requestor,this.clientSM.ontracks=t=>{this.eventSource.dispatchEvent("tracks",t),this.startStreamFlush()},this.heartbeatInterval=0,this.sampleQueues={}}static streamType(){return"rtsp"}setSource(t){ua.log("RTSPClient source: ",t),super.setSource(t),this.clientSM.setSource(t)}attachTransport(t){super.attachTransport(t),this.clientSM.transport=t}detachTransport(){super.detachTransport(),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={},clearInterval(this.heartbeatInterval)}async destroy(){return await this.clientSM.destroy(),clearInterval(this.heartbeatInterval),super.destroy()}start(){let{options:t}=this,e=t.socket||t.url;this.setSource(hn.parse(t.url));let i=new yn(t.type,{socket:e});return this.attachTransport(i),this.clientSM.onRTSPConfig=t=>{this.eventSource.dispatchEvent("rtspConfig",t),this.startStreamFlush()},super.start(),this.transport?this.transport.ready.then(()=>this.clientSM.start()):Promise.reject("no transport attached")}stop(){return this.clientSM.stop(),super.stop()}async play(t){await this.clientSM.play().then(()=>{this.paused=!1,t&&t(),clearInterval(this.heartbeatInterval)})}async pause(t){let{currentState:e}=this.clientSM;if(!e||e.name!==oa.STATE_STREAMS)return;let{streamType:i}=this.options;"video"===i?(super.stop(),t&&t()):await this.clientSM.pause().then(()=>{this.paused=!0,t&&t(),this.heartbeatInterval=setInterval(()=>{this.clientSM.sendHeartbeat()},4e3)})}setResolution(t){let{currentState:e}=this.clientSM;!e||e.name<=oa.STATE_SETUP||(this.detachTransport(),this.options.url=t,this.start())}changeResolutionIsMultiSensor(t){let{currentState:e}=this.clientSM;!e||e.name<=oa.STATE_SETUP||(this.detachTransport(),this.options.url=t,this.start())}setPlaybackConfig(t){return this.clientSM.sendPlaybackConfig(t).then(()=>{this.paused=!1,this.flushSampleQueue(),clearInterval(this.heartbeatInterval)})}async onData(t){if("reconnect"===t)return await this.clientSM.onDisconnected(),clearInterval(this.heartbeatInterval),void this.clientSM.start();this.clientSM.onData(t)}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected(),clearInterval(this.heartbeatInterval)}error(t){this.eventSource.dispatchEvent("error",new Me(t))}onPlayerNotify(t){let{seq:e}=t,{streamType:i}=this.options;e&&"sdvod"===i&&this.clientSM.updateReceivedSeq(e)}}var da=la;class fa{constructor(t){this.postUrl=t.url,this.eventSource=new J,this.type=t.type,this.queryAddress=t.queryAddress,this.authSessionId=t.authSessionId,this.dataQueue=[],this.ready=!1}destroy(){this.eventSource.destroy()}stop(){}connect(){console.log("transport connect"),this.ready=xn()({method:"get",url:this.postUrl,responseType:"blob",withCredentials:!1}).then(t=>{if(200===t.status){let e=new FileReader,i=this;e.onload=function(t){let e=t.target.result,r=new Uint8Array(e);i.dataQueue.push(r),i.eventSource.dispatchEvent("data")},e.readAsArrayBuffer(t.data)}else this.eventSource.dispatchEvent("error",new Me(Me.errorTypes.COMMON_ERR_NETWORK))}).catch(t=>{this.eventSource.dispatchEvent("error",new Me(Me.errorTypes.MEDIA_ERR_CONNECT))})}}var pa=fa;const ga=188743680,ma=50,va=20,ya=9,ba={[7350]:49,[8e3]:4,[11025]:49,[12e3]:2,[16e3]:8,[22050]:49,[24e3]:4,[32e3]:16,[44100]:49,[48e3]:24,[64e3]:32,[88200]:49,[96e3]:16},_a=4294967296,Ta=1e6,Sa=30;class wa extends wn{static get STATE_INITIAL(){return 1}static get STATE_STREAMS(){return 2}static get STATE_PAUSED(){return 4}static get STATE_PLAY(){return 8}static get STATE_TEARDOWN(){return 16}static get FORMAT_TPRTP(){return"tprtp"}static get TPRTP_TAG_SCRIPT(){return 18}static get TPRTP_TAG_DATA(){return 19}static get TPRTP_TAG_FRAMEINDEX(){return 20}static get TPRTP_PARSE_STATE_IDLE(){return 0}static get TPRTP_PARSE_STATE_HEADER(){return 1}static get TPRTP_PARSE_STATE_TAGHEADER(){return 2}static get TPRTP_PARSE_STATE_SCRIPT(){return 3}static get TPRTP_PARSE_STATE_RTPDATA(){return 4}static get TPRTP_PARSE_STATE_FRAMEINDEX(){return 5}static get TPRTP_PARSE_STATE_ERROR(){return 6}static get TPRTP_PARSE_STATE_FINISH(){return 7}constructor(t){super(),this.parent=t,this.transport=null,this.isPlaying=!1,this.methods=["PLAY","PAUSE"],this.payParser=new Fr,this.addState(wa.STATE_INITIAL,{}).addState(wa.STATE_STREAMS,{}).addState(wa.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(wa.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addState(wa.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(wa.STATE_INITIAL)}).addTransition(wa.STATE_INITIAL,wa.STATE_STREAMS).addTransition(wa.STATE_INITIAL,wa.STATE_PLAY).addTransition(wa.STATE_INITIAL,wa.STATE_TEARDOWN).addTransition(wa.STATE_STREAMS,wa.STATE_PAUSED).addTransition(wa.STATE_PAUSED,wa.STATE_STREAMS).addTransition(wa.STATE_STREAMS,wa.STATE_TEARDOWN).addTransition(wa.STATE_PAUSED,wa.STATE_TEARDOWN).addTransition(wa.STATE_PAUSED,wa.STATE_PLAY).addTransition(wa.STATE_PLAY,wa.STATE_STREAMS).addTransition(wa.STATE_PLAY,wa.STATE_TEARDOWN).addTransition(wa.STATE_TEARDOWN,wa.STATE_INITIAL),this.reset()}async reset(){this.rtpBuffer={},this.currentState?this.currentState.name!=wa.STATE_INITIAL&&(await this.transitionTo(wa.STATE_TEARDOWN),await this.transitionTo(wa.STATE_INITIAL)):await this.transitionTo(wa.STATE_INITIAL),this.sdp=null,this.ifNeedAdjustAVPTS=!0,this.relativeUTCInfo={},this.avTrackTSBaseAdjusted=!1,this.trackTSAdjustInterval={},this.ifSetTSAdjustRefTrack=!1,this.tsAdjustRefTrack="video",this.parent.isReconnect=!0,this.maxLength=ga,this.dataBuffer=new Uint8Array(this.maxLength),this.dataBufferWriteIndex=0,this.dataBufferParsedIndex=0,this.hasCheckFileFMT=!1,this.tpRTPParseState=wa.TPRTP_PARSE_STATE_IDLE,this.fileFMT=null,this.fileSize=-1,this.duration=0,this.tpRTPTagInfo={},this.ifMediaIndexParsed=!1,this.mediaIndexStartPos=-1,this.mediaIndexDataLength=0,this.tprtpMediaIndex=[],this.channelInfo={},this.toSeekTime=-1,this.ifGetFirstVideoPTS=!1,this.startVideoPTS=0,this.videoPTSTimescale=9e4,this.startAudioPTS=-1,this.audioSampleRate=8e3,this.lastRTPSeq={},this.isVideoWaitIFrame=!0,this.lastVideoFrameFlag=0,this.recordVideoFrameFlagForMultiSlice=0,this.parseDataTimer&&clearInterval(this.parseDataTimer),this.parseDataTimer=null,this.checkFinishTimer&&clearInterval(this.checkFinishTimer),this.checkFinishTimer=null}destroy(){this.parseDataTimer&&clearInterval(this.parseDataTimer),this.checkFinishTimer&&clearInterval(this.checkFinishTimer)}setSource(t){Log$7.log("set source: ",t),this.reset(),this.url=t}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Log$7.log("start"),this.start())}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(wa.STATE_TEARDOWN),await this.transitionTo(wa.STATE_INITIAL)}start(){return this.currentState.name!==wa.STATE_STREAMS?this.transitionTo(wa.STATE_STREAMS):Promise.resolve()}stop(){this.started&&(this.transitionTo(wa.STATE_TEARDOWN),this.transport&&this.transport.stop()),this.shouldReconnect=!1}getDuration(){return this.duration}getVideoStartPTS(){return this.startVideoPTS}getVideoPTSTimescale(){return this.videoPTSTimescale}error(t){this.parent.error(t)}onData(t){if(this.dataBufferWriteIndex+t.length>this.maxLength){let e=this.maxLength+ga;ga0)return;console.log("notify stream finished"),this.parent.eventSource.dispatchEvent("streamFinished"),this.parent.stop(),clearInterval(this.checkFinishTimer)}checkFileFMT(){let t=this.dataBufferWriteIndex-this.dataBufferParsedIndex;if(t>=5){if(this.hasCheckFileFMT=!0,116===this.dataBuffer[0]&&112===this.dataBuffer[1]&&114===this.dataBuffer[2]&&116===this.dataBuffer[3]&&112===this.dataBuffer[4])return this.fileFMT=wa.FORMAT_TPRTP,void(this.tpRTPParseState=wa.TPRTP_PARSE_STATE_HEADER);this.tpRTPParseState=wa.TPRTP_PARSE_STATE_ERROR,this.error(Me.MEDIA_ERR_SRC_NOT_SUPPORTED)}}onParseTPRTP(){let t=0;while(t<=0)switch(this.tpRTPParseState){case wa.TPRTP_PARSE_STATE_HEADER:t=this.onTPRTPHeaderData();break;case wa.TPRTP_PARSE_STATE_TAGHEADER:t=this.onTPRTPTagData();break;case wa.TPRTP_PARSE_STATE_SCRIPT:t=this.onTPRTPScript();break;case wa.TPRTP_PARSE_STATE_RTPDATA:t=this.onTPRTPData();break;case wa.TPRTP_PARSE_STATE_FRAMEINDEX:t=this.onTPRTPFrameIndex();break;case wa.TPRTP_PARSE_STATE_ERROR:case wa.TPRTP_PARSE_STATE_FINISH:return}this.startParseTimer(t)}onTPRTPHeaderData(){if(this.dataBufferWriteIndexNumber.MAX_SAFE_INTEGER)throw new Error("BigInt值超出了Number的整数范围");return Number(t)}onTPRTPTagData(){let t=this.dataBufferWriteIndex-this.dataBufferParsedIndex;if(tt)return 20;let s={};return s.size=e,s.pos=this.dataBufferParsedIndex,this.tpRTPTagInfo[r]=s,this.dataBufferParsedIndex+=ya,r===wa.TPRTP_TAG_SCRIPT?this.tpRTPParseState=wa.TPRTP_PARSE_STATE_SCRIPT:r===wa.TPRTP_TAG_DATA?this.tpRTPParseState=wa.TPRTP_PARSE_STATE_RTPDATA:r===wa.TPRTP_TAG_FRAMEINDEX?(this.tpRTPParseState=wa.TPRTP_PARSE_STATE_FRAMEINDEX,this.mediaIndexStartPos=this.dataBufferParsedIndex,this.mediaIndexDataLength=e):(this.tpRTPParseState=wa.TPRTP_PARSE_STATE_ERROR,this.error(Me.MEDIA_ERR_SRC_NOT_SUPPORTED)),0}onTPRTPScript(){let t=this.tpRTPTagInfo[wa.TPRTP_TAG_SCRIPT];if(!t)return 20;let e=this.dataBufferWriteIndex-this.dataBufferParsedIndex;if(e=0&&(this.dataBufferParsedIndex=t)}if(this.currentState===wa.STATE_PAUSED)return 1e3;do{let t=this.getRTPPacket();if(!t)return 20;let e=t[1];if(Object.prototype.hasOwnProperty.call(this.channelInfo,e)){if(this.ifSampleQueueFull(e))return 50;this.onRTP({packet:t.subarray(4),type:e})}this.dataBufferParsedIndex+=t.length}while(1);return 0}checkAndParseFrameIndex(){if(this.dataBufferWriteIndex=4){let r=i.getUint16(2),n=r+4;return t>=n?(e=this.dataBuffer.slice(this.dataBufferParsedIndex,this.dataBufferParsedIndex+n),e):null}return null}{if(this.checkRTPDataParseFinished())return null;let t,e=this.dataBufferWriteIndex;for(t=this.dataBufferParsedIndex;t=t.pos+t.size+ya){if(this.ifMediaIndexParsed){if(clearInterval(this.checkFinishTimer),this.checkFinishTimer=setInterval(()=>{this.checkAndNotifyStreamFinish()},300),this.parent._lastVideoChunk)for(const t of Object.keys(this.parent.sampleQueues))if("video"===t){this.parent.sampleQueues[t].push([this.parent._lastVideoChunk]),this.parent._lastVideoChunk=null;break}this.tpRTPParseState=wa.TPRTP_PARSE_STATE_FINISH}else this.tpRTPParseState=wa.TPRTP_PARSE_STATE_TAGHEADER;return!0}return!1}onTPRTPFrameIndex(){if(this.ifMediaIndexParsed)return 0;if(this.mediaIndexStartPos<0||this.mediaIndexDataLength<=0)return 20;this.tprtpMediaIndex=[];let t=new DataView(this.dataBuffer.buffer,this.mediaIndexStartPos,this.mediaIndexDataLength),e=0;while(e{this.onParseData()},t)}ifSampleQueueFull(t){let e=this.channelInfo[t];return!!this.parent.sampleQueues[e]&&this.parent.sampleQueues[e].length>=ma}adjustTrackPTS(t,e){if(!this.ifNeedAdjustAVPTS)return e;if(this.ifSetTSAdjustRefTrack||(this.ifSetTSAdjustRefTrack=!0,this.tsAdjustRefTrack=t,this.trackTSAdjustInterval[t]=0,console.log("get interval",t,this.trackTSAdjustInterval[t])),t!=this.tsAdjustRefTrack&&!this.avTrackTSBaseAdjusted){this.avTrackTSBaseAdjusted=!0;do{if("audio"===t&&this.relativeUTCInfo.isRealUTC&&this.relativeUTCInfo.utc%1e3!==0){let i=this.relativeUTCInfo.utc*this.audioSampleRate/1e3&4294967295;if(Math.abs(e-i)Sa*Ta?a-=r:a+Sa*Ta<0&&(a+=r),Math.abs(a)<=Sa*Ta){let e="video"===t?1:-1,i="video"===t?this.videoPTSTimescale:this.audioSampleRate;this.trackTSAdjustInterval[t]=a*i*e/Ta,console.log("get interval",t,this.trackTSAdjustInterval[t])}else this.trackTSAdjustInterval[t]=0,console.log("adjust abnormal get interval",t,this.trackTSAdjustInterval[t])}while(0)}if("audio"===t){let i=e-this.startAudioPTS+this.trackTSAdjustInterval[t];return i<0?0:i}{let i=e-this.startVideoPTS+this.trackTSAdjustInterval[t];return i<0?0:i}}onRTP(t){if(!this.rtpFactory)return;this.isPlaying||this.currentState.name===wa.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream"));let e=this.rtpFactory.build(t.packet,this.sdp);if(!Object.prototype.hasOwnProperty.call(e,"type"))return;!e.utc_timestamp&&this.relativeUTCInfo.utc||(this.relativeUTCInfo.isRealUTC=!!e.utc_timestamp,this.relativeUTCInfo={utc:e.utc_timestamp||1,pts:e.timestamp},this.relativeUTCInfo.ptsAdjusted=!1,this.ifNeedAdjustAVPTS&&this.avTrackTSBaseAdjusted&&(this.relativeUTCInfo.pts=this.adjustTrackPTS("video",this.relativeUTCInfo.pts),this.relativeUTCInfo.ptsAdjusted=!0));let i=this.rtpBuffer[e.pt]||[];i.push(e);while(i.length){let t=i.shift();if(-1===this.lastRTPSeq[t.pt]&&(this.lastRTPSeq[t.pt]=t.sequence),t.isVideo()&&(this.isVideoWaitIFrame||t.sequence-this.lastRTPSeq[t.pt]!==1&&this.lastRTPSeq[t.pt]-t.sequence!==65535&&(this.isVideoWaitIFrame=!0,console.log("on video get wrong rtp sn",t.sequence,this.lastRTPSeq[t.pt])),0===this.lastVideoFrameFlag&&(this.lastVideoFrameFlag=t.frame_flg)),this.lastRTPSeq[t.pt]=t.sequence,t.media){let e=this.payParser.parse(t),i=!1;if(e&&this.parent.sampleQueues[t.mediaType()]){if(e.forEach(e=>{e.type=t.type;let r=e.pts;this.ifNeedAdjustAVPTS&&this.avTrackTSBaseAdjusted&&(r=this.adjustTrackPTS(t.media.type,e.pts)),t.isVideo()?(e.seq=this.currentSeq,this.currentSeq=0,0!==this.lastVideoFrameFlag&&(e.isVirtualI=1===this.lastVideoFrameFlag,e.isDecodeOnlyI=2===this.lastVideoFrameFlag),e.isStartSlice()?this.recordVideoFrameFlagForMultiSlice=this.lastVideoFrameFlag:(e.isVirtualI=1===this.recordVideoFrameFlagForMultiSlice,e.isDecodeOnlyI=2===this.recordVideoFrameFlagForMultiSlice),this.lastVideoFrameFlag=0,this.isVideoWaitIFrame&&(i=e.isParameterSet(),e.isKeyframe()&&(console.log("get i frame stop drop frame",e.ntype),this.isVideoWaitIFrame=!1,this.ifGetFirstVideoPTS||(this.ifGetFirstVideoPTS=!0,this.startVideoPTS=e.pts))),!this.ifNeedAdjustAVPTS||i||this.avTrackTSBaseAdjusted||this.isVideoWaitIFrame||(r=this.adjustTrackPTS("video",e.pts),this.relativeUTCInfo.ptsAdjusted||(this.relativeUTCInfo.pts=this.adjustTrackPTS("video",this.relativeUTCInfo.pts),this.relativeUTCInfo.ptsAdjusted=!0)),e.timestamp=parseInt(this.relativeUTCInfo.utc+1e3*(r-this.relativeUTCInfo.pts)/this.videoPTSTimescale)):(this.startAudioPTS<0&&(this.startAudioPTS=e.pts),this.ifNeedAdjustAVPTS&&!this.avTrackTSBaseAdjusted&&(r=this.adjustTrackPTS("audio",e.pts)),e.samplerate=this.audioSampleRate,e.timestamp=parseInt(this.relativeUTCInfo.utc+(1e3*r/this.audioSampleRate-1e3*this.relativeUTCInfo.pts/this.videoPTSTimescale)))}),t.isVideo()&&this.isVideoWaitIFrame&&!i)return;this.parent.feed(t.mediaType(),e)}}}}}class Ea extends Mn{constructor(t={flush:10}){super(Object.assign({},t)),this.clientSM=new wa(this),this._onData=()=>{while(this.transport.dataQueue.length>0)this.onData(this.transport.dataQueue.pop())},this._onError=this.onError.bind(this)}static streamType(){return"file"}async start(){this.clientSM.onStreamConfig=t=>{this.eventSource.dispatchEvent("fileConfig",t),this.startStreamFlush()},this.connect(),super.start()}setSource(t){super.setSource(t),this.clientSM.setSource(t)}attachTransport(t){this.transport=t,this.clientSM.transport=t,this.transport&&(this.transport.eventSource.addEventListener("data",this._onData),this.transport.eventSource.addEventListener("error",this._onError))}detachTransport(){this.transport&&(this.transport.eventSource.removeEventListener("data",this._onData),this.transport.eventSource.removeEventListener("error",this._onError),this.transport.destroy(),this.transport=null),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={},this.paused=!1}getDuration(){return this.clientSM.getDuration()}getVideoStartPTS(){return this.clientSM.getVideoStartPTS()}getVideoPTSTimescale(){return this.clientSM.getVideoPTSTimescale()}connect(){let t=new pa(this.options);this.attachTransport(t),t.connect()}stop(){return this.clientSM.stop(),super.stop()}destroy(){return this.clientSM.destroy(),super.destroy()}play(t){this.clientSM.play().then(()=>{this.paused=!1,t&&t()})}pause(t){let{currentState:e}=this.clientSM;e&&e.name===wa.STATE_STREAMS&&this.clientSM.pause().then(()=>{super.stop(),t&&t()})}async onData(t){if("reconnect"===t)return await this.clientSM.onDisconnected(),void this.clientSM.start();this.clientSM.onData(t)}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected()}error(t){this.eventSource.dispatchEvent("error",new Me(t))}setPlaybackConfig(t){return Object.assign(this.options,t),this.clientSM.sendPlaybackConfig(t).then(()=>{this.paused=!1,this.flushSampleQueue()})}}var xa=Ea;i("5377");class Aa{static init(){var t;for(t in Aa.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:[]},Aa.types)Aa.types.hasOwnProperty(t)&&(Aa.types[t]=[t.charCodeAt(0),t.charCodeAt(1),t.charCodeAt(2),t.charCodeAt(3)]);var e=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]),i=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]);Aa.HDLR_TYPES={video:e,audio:i};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),n=new Uint8Array([0,0,0,0,0,0,0,0]);Aa.STTS=Aa.STSC=Aa.STCO=n,Aa.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),Aa.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),Aa.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),Aa.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]),o=new Uint8Array([0,0,0,1]);Aa.FTYP=Aa.box(Aa.types.ftyp,s,o,s,a),Aa.DINF=Aa.box(Aa.types.dinf,Aa.box(Aa.types.dref,r))}static box(t,...e){var i,r=8,n=e.length,s=n;while(n--)r+=e[n].byteLength;for(i=new Uint8Array(r),i[0]=r>>24&255,i[1]=r>>16&255,i[2]=r>>8&255,i[3]=255&r,i.set(t,4),n=0,r=8;n>24&255,t>>16&255,t>>8&255,255&t,e>>24,e>>16&255,e>>8&255,255&e,85,196,0,0]))}static mdia(t){return Aa.box(Aa.types.mdia,Aa.mdhd(t.timescale,t.duration),Aa.hdlr(t.type),Aa.minf(t))}static mfhd(t){return Aa.box(Aa.types.mfhd,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,255&t]))}static minf(t){return"audio"===t.type?Aa.box(Aa.types.minf,Aa.box(Aa.types.smhd,Aa.SMHD),Aa.DINF,Aa.stbl(t)):Aa.box(Aa.types.minf,Aa.box(Aa.types.vmhd,Aa.VMHD),Aa.DINF,Aa.stbl(t))}static moof(t,e,i){return Aa.box(Aa.types.moof,Aa.mfhd(t),Aa.traf(i,e))}static moov(t,e,i){var r=t.length,n=[];while(r--)n[r]=Aa.trak(t[r]);return Aa.box.apply(null,[Aa.types.moov,Aa.mvhd(i,e)].concat(n).concat(Aa.mvex(t)))}static mvex(t){var e=t.length,i=[];while(e--)i[e]=Aa.trex(t[e]);return Aa.box.apply(null,[Aa.types.mvex].concat(i))}static mvhd(t,e){var i=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,e>>24&255,e>>16&255,e>>8&255,255&e,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 Aa.box(Aa.types.mvhd,i)}static sdtp(t){var e,i,r=t.samples||[],n=new Uint8Array(4+r.length);for(i=0;i>>8&255),n.push(255&r),n=n.concat(Array.prototype.slice.call(i));for(e=0;e>>8&255),s.push(255&r),s=s.concat(Array.prototype.slice.call(i));var a=Aa.box(Aa.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|t.sps.length].concat(n).concat([t.pps.length]).concat(s))),o=t.width,h=t.height;return Aa.box(Aa.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,o>>8&255,255&o,h>>8&255,255&h,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,Aa.box(Aa.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])))}static esds(t){var e=t.config.byteLength;let i=new Uint8Array(26+e+3);return i.set([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5,e]),i.set(t.config,26),i.set([6,1,2],26+e),i}static mp4a(t){var e=t.audiosamplerate;return Aa.box(Aa.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,e>>8&255,255&e,0,0]),Aa.box(Aa.types.esds,Aa.esds(t)))}static stsd(t){return"audio"===t.type?Aa.box(Aa.types.stsd,Aa.STSD,Aa.mp4a(t)):Aa.box(Aa.types.stsd,Aa.STSD,Aa.avc1(t))}static tkhd(t){var e=t.id,i=t.duration,r=t.width,n=t.height,s=t.volume;return Aa.box(Aa.types.tkhd,new Uint8Array([0,0,0,7,0,0,0,0,0,0,0,0,e>>24&255,e>>16&255,e>>8&255,255&e,0,0,0,0,i>>24,i>>16&255,i>>8&255,255&i,0,0,0,0,0,0,0,0,0,0,0,0,s>>0&255,s%1*10>>0&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,r>>8&255,255&r,0,0,n>>8&255,255&n,0,0]))}static traf(t,e){var i=Aa.sdtp(t),r=t.id;return Aa.box(Aa.types.traf,Aa.box(Aa.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,255&r])),Aa.box(Aa.types.tfdt,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e])),Aa.trun(t,i.length+16+16+8+16+8+8),i)}static trak(t){return t.duration=t.duration||4294967295,Aa.box(Aa.types.trak,Aa.tkhd(t),Aa.mdia(t))}static trex(t){var e=t.id;return Aa.box(Aa.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,255&e,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(t,e){var i,r,n,s,a,o,h=t.samples||[],c=h.length,u=12+16*c,l=new Uint8Array(u);for(e+=8+u,l.set([0,0,15,1,c>>>24&255,c>>>16&255,c>>>8&255,255&c,e>>>24&255,e>>>16&255,e>>>8&255,255&e],0),i=0;i>>24&255,n>>>16&255,n>>>8&255,255&n,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,o>>>24&255,o>>>16&255,o>>>8&255,255&o],12+16*i);return Aa.box(Aa.types.trun,l)}static initSegment(t,e,i){Aa.types||Aa.init();var r,n=Aa.moov(t,e,i);return r=new Uint8Array(Aa.FTYP.byteLength+n.byteLength),r.set(Aa.FTYP),r.set(n,Aa.FTYP.byteLength),r}}const Ca="mse",Ra=ke(Ca);class Pa{constructor(t,e){this.mediaSource=t.mediaSource,this.players=t.players,this.cleaning=!1,this.parent=t,this.queue=[],this.cleanResolvers=[],this.codec=e,this.cleanRanges=[],Ra.debug("Use codec: "+e),this.sourceBuffer=this.mediaSource.addSourceBuffer(e),this.eventSource=new J(this.sourceBuffer),this.eventSource.addEventListener("updatestart",()=>{this.cleaning&&Ra.debug(this.codec+" cleaning start")}),this.eventSource.addEventListener("update",()=>{this.cleaning&&Ra.debug(this.codec+" cleaning update")}),this.eventSource.addEventListener("updateend",()=>{if(this.cleaning){Ra.debug(this.codec+" cleaning end");try{this.sourceBuffer.buffered.length&&this.players[0].currentTime{Ra.debug("Source buffer error: "+this.mediaSource.readyState),this.mediaSource.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(this.sourceBuffer),this.parent.eventSource.dispatchEvent("error")}),this.eventSource.addEventListener("abort",()=>{Ra.debug("Source buffer aborted: "+this.mediaSource.readyState),this.mediaSource.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(this.sourceBuffer),this.parent.eventSource.dispatchEvent("error")}),this.sourceBuffer.updating||this.feedNext()}destroy(){this.eventSource.destroy(),this.clear(),this.queue=[],this.mediaSource.removeSourceBuffer(this.sourceBuffer)}clear(){this.queue=[];let t=[];for(let e=0;e{this.cleanResolvers.push(t),this.sourceBuffer.updating?this.sourceBuffer.onupdateend=()=>{this.sourceBuffer&&this.sourceBuffer.remove(this.sourceBuffer.buffered.start(e),this.sourceBuffer.buffered.end(e)),t()}:(this.sourceBuffer.remove(this.sourceBuffer.buffered.start(e),this.sourceBuffer.buffered.end(e)),t())}));return Promise.all(t)}setLive(t){this.is_live=t}feedNext(){this.sourceBuffer.updating||this.cleaning||!this.queue.length||this.doAppend(this.queue.shift())}doCleanup(){if(!this.cleanRanges.length)return this.cleaning=!1,void this.feedNext();let t=this.cleanRanges.shift();Ra.debug(`${this.codec} remove range [${t[0]} - ${t[1]}).\n \nUpdating: ${this.sourceBuffer.updating}\n `),this.cleaning=!0,this.sourceBuffer.remove(t[0],t[1])}initCleanup(){if(!this.sourceBuffer.buffered.length||this.sourceBuffer.updating||this.cleaning)this.feedNext();else{Ra.debug(this.codec+" cleanup");let t=this.sourceBuffer.buffered.end(this.sourceBuffer.buffered.length-1)-2;for(let e=0;e=i?(Ra.debug(`Clear [${i}, ${t}), leave [${t}, ${r}]`),r=t,r!=i&&this.cleanRanges.push([i,r])):this.cleanRanges.push([i,r]))}this.doCleanup()}}doAppend(t){let e=this.players[0].error;if(e){Ra.error("Error occured: "+Ia.ErrorNotes[e.code]);try{this.players.forEach(t=>{t.stop()}),this.mediaSource.endOfStream()}catch(i){Ra.error(i)}this.parent.eventSource.dispatchEvent("error")}else try{this.sourceBuffer.appendBuffer(t)}catch(i){if("QuotaExceededError"===i.name)return Ra.debug(this.codec+" quota fail"),this.queue.unshift(t),void this.initCleanup();Ra.error(`Error occured while appending buffer. ${i.name}: ${i.message}`),this.parent.eventSource.dispatchEvent("error")}}feed(t){this.queue=this.queue.concat(t),!this.sourceBuffer||this.sourceBuffer.updating||this.cleaning||this.feedNext()}}class Ia{static get ErrorNotes(){return{[MediaError.MEDIA_ERR_ABORTED]:"fetching process aborted by user",[MediaError.MEDIA_ERR_NETWORK]:"error occurred when downloading",[MediaError.MEDIA_ERR_DECODE]:"error occurred when decoding",[MediaError.MEDIA_ERR_SRC_NOT_SUPPORTED]:"audio/video not supported"}}static isSupported(t){return window.MediaSource&&window.MediaSource.isTypeSupported(`video/mp4; codecs="${t.join(",")}"`)}constructor(t){this.players=t;const e=this.players.map((t,i)=>(t.onplaying=function(){e[i]=!0},t.onpause=function(){e[i]=!1},!t.paused));this.playing=e,this.mediaSource=new MediaSource,this.eventSource=new J(this.mediaSource),this.reset()}destroy(){this.reset(),this.eventSource.destroy(),this.mediaSource=null,this.eventSource=null}play(){this.players.forEach((t,e)=>{t.paused&&!this.playing[e]&&(Ra.debug(`player ${e}: play`),t.play())})}setLive(t){for(let e in this.buffers)this.buffers[e].setLive(t);this.is_live=t}resetBuffers(){this.players.forEach((t,e)=>{!t.paused&&this.playing[e]&&(t.pause(),t.currentTime=0)});let t=[];for(let e of this.buffers.values())t.push(e.clear());return Promise.all(t).then(()=>{this.mediaSource.endOfStream(),this.mediaSource.duration=0,this.mediaSource.clearLiveSeekableRange(),this.play()})}clear(){return this.reset(),this.players.forEach(t=>{t.src=URL.createObjectURL(this.mediaSource)}),this.setupEvents()}setupEvents(){return this.eventSource.clear(),this.resolved=!1,this.mediaReady=new Promise(t=>{this._sourceOpen=()=>{Ra.debug("Media source opened: "+this.mediaSource.readyState),this.resolved||(this.resolved=!0,t())},this._sourceEnded=()=>{Ra.debug("Media source ended: "+this.mediaSource.readyState)},this._sourceClose=()=>{Ra.debug("Media source closed: "+this.mediaSource.readyState),this.resolved&&this.eventSource.dispatchEvent("sourceclosed")},this.eventSource.addEventListener("sourceopen",this._sourceOpen),this.eventSource.addEventListener("sourceended",this._sourceEnded),this.eventSource.addEventListener("sourceclose",this._sourceClose)}),this.mediaReady}reset(){this.ready=!1;for(let t in this.buffers)this.buffers[t].destroy(),delete this.buffers[t];"open"==this.mediaSource.readyState&&(this.mediaSource.duration=0,this.mediaSource.endOfStream()),this.updating=!1,this.resolved=!1,this.buffers={}}setCodec(t,e){return this.mediaReady.then(()=>{this.buffers[t]=new Pa(this,e),this.buffers[t].setLive(this.is_live)})}feed(t,e){this.buffers[t]&&this.buffers[t].feed(e)}}const ka=ke("remuxer:base");let Da=1;class Oa{static get MP4_TIMESCALE(){return 9e4}static getTrackID(){return Da++}constructor(t,e,i){this.timeOffset=0,this.timescale=t,this.scaleFactor=e,this.readyToDecode=!1,this.samples=[],this.seq=1,this.tsAlign=1}scaled(t){return t/this.scaleFactor}unscaled(t){return t*this.scaleFactor}remux(t){return!!t&&(this.samples.push({unit:t,pts:t.pts,dts:t.dts}),!0)}static toMS(t){return t/90}setConfig(t){}insertDscontinuity(){this.samples.push(null)}init(t,e,i=!0){this.initPTS=Math.min(t,this.samples[0].dts),this.initDTS=Math.min(e,this.samples[0].dts),ka.debug(`Initial pts=${this.initPTS} dts=${this.initDTS} offset=${this.unscaled(this.timeOffset)}`),this.initialized=i}flush(){this.seq++,this.mp4track.len=0,this.mp4track.samples=[]}static dtsSortFunc(t,e){return t.dts-e.dts}static groupByDts(t){const e=(t,e)=>t.reduce((t,i)=>((t[i[e]]=t[i[e]]||[]).push(i),t),{});return e(t,"dts")}getPayloadBase(){return this.readyToDecode&&this.initialized&&this.samples.length?(this.samples.sort(Oa.dtsSortFunc),!0):null}}const Ma=ke("remuxer:aac");class Na extends Oa{constructor(t,e=1,i={}){super(t,e),this.codecstring=Ia.CODEC_AAC,this.units=[],this.initDTS=void 0,this.nextAacPts=void 0,this.lastPts=0,this.firstDTS=0,this.firstPTS=0,this.duration=i.duration||1,this.initialized=!1,this.mp4track={id:Oa.getTrackID(),type:"audio",fragmented:!0,channelCount:0,audiosamplerate:this.timescale,duration:0,timescale:this.timescale,volume:1,samples:[],config:"",len:0},i.config&&this.setConfig(i.config)}setConfig(t){this.mp4track.channelCount=t.channels,this.mp4track.audiosamplerate=t.samplerate,this.mp4track.duration||(this.mp4track.duration=(this.duration?this.duration:1)*t.samplerate),this.mp4track.timescale=t.samplerate,this.mp4track.config=t.config,this.mp4track.codec=t.codec,this.timescale=t.samplerate,this.scaleFactor=Oa.MP4_TIMESCALE/t.samplerate,this.expectedSampleDuration=1024*this.scaleFactor,this.readyToDecode=!0}remux(t){super.remux.call(this,t)&&(this.mp4track.len+=t.getSize())}getPayload(){if(!this.readyToDecode||!this.samples.length)return null;this.samples.sort((function(t,e){return t.dts-e.dts}));let t,e,i,r,n=new Uint8Array(this.mp4track.len),s=0,a=this.mp4track.samples;while(this.samples.length){let o=this.samples.shift();if(null===o){this.nextDts=void 0;break}let h=o.unit;if(i=o.pts-this.initDTS,r=o.dts-this.initDTS,void 0===e){if(this.nextDts){let t=Math.round(this.scaled(i-this.nextAacPts));if(Math.abs(t)<600&&t){if(t>0)Ma.log(t+" ms hole between AAC samples detected,filling it");else if(t<-12){Ma.log(-t+" ms overlapping between AAC samples detected, drop frame"),this.mp4track.len-=h.getSize();continue}i=r=this.nextAacPts}}this.firstDTS=Math.max(0,r)}t={size:h.getSize(),cts:0,duration:1024,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:1}},n.set(h.getData(),s),s+=h.getSize(),a.push(t),e=r}return a.length?(this.nextDts=i+this.expectedSampleDuration,new Uint8Array(n.buffer,0,this.mp4track.len)):null}}const Ba=ke("remuxer:h264");class La extends Oa{constructor(t,e=1,i={}){if(super(t,e),this.nextDts=void 0,this.readyToDecode=!1,this.initialized=!1,this.firstDTS=0,this.firstPTS=0,this.lastDTS=void 0,this.lastSampleDuration=0,this.lastDurations=[],this.tsAlign=Math.round(this.timescale/60),this.mp4track={id:Oa.getTrackID(),type:"video",len:0,fragmented:!0,sps:"",pps:"",width:0,height:0,timescale:t,duration:t,samples:[]},this.samples=[],this.lastGopDTS=-99999999999999,this.gop=[],this.firstUnit=!0,this.h264=new Se(this),i.sps){let t=new Uint8Array(i.sps);7===(31&t[0])?this.setSPS(t):Ba.warn("bad SPS in SDP")}if(i.pps){let t=new Uint8Array(i.pps);8===(31&t[0])?this.setPPS(t):Ba.warn("bad PPS in SDP")}this.mp4track.pps&&this.mp4track.sps&&(this.readyToDecode=!0)}_scaled(t){return t>>>this.scaleFactor}_unscaled(t){return t<1){const t=Oa.groupByDts(this.gop);this.gop=Object.values(t).map(t=>t.reduce((t,e)=>{const i=e.getData();return i.set(new Uint8Array([0,0,0,1])),t.appendData(i),t}))}for(let t of this.gop)super.remux.call(this,t)&&(this.mp4track.len+=t.getSize());this.gop=[],this.lastGopDTS=t.dts}this.h264.parseNAL(t)&&this.gop.push(t)}getPayload(){if(!this.getPayloadBase())return null;let t,e,i,r,n=new Uint8Array(this.mp4track.len),s=0,a=this.mp4track.samples;while(this.samples.length){let o=this.samples.shift();if(null===o){this.nextDts=void 0;break}let h=o.unit;if(i=o.pts-this.initDTS,r=o.dts-this.initDTS,r=Math.min(i,r),void 0!==e){let n=this.scaled(r-e);if(n<0){Ba.log(`invalid AVC sample duration at PTS/DTS: ${i}/${r}|lastDTS: ${e}:${n}`),this.mp4track.len-=h.getSize();continue}this.lastDurations.push(n),this.lastDurations.length>100&&this.lastDurations.shift(),t.duration=n}else{if(this.nextDts){let t=r-this.nextDts;if(Math.abs(Math.round(Oa.toMS(t)))<6e4)t&&(r=this.nextDts,i=Math.max(i-t,r));else if(t<0){Ba.log(`skip frame from the past at DTS=${r} with expected DTS=${this.nextDts}`),this.mp4track.len-=h.getSize();continue}}this.firstDTS=Math.max(0,r)}t={size:h.getSize(),duration:0,cts:this.scaled(i-r),flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0}};let c=t.flags;!0===o.unit.isKeyframe()?(c.dependsOn=2,c.isNonSync=0):(c.dependsOn=1,c.isNonSync=1),n.set(h.getData(),s),s+=h.getSize(),a.push(t),e=r}if(!a.length)return null;let o=this.lastDurations.reduce((function(t,e){return(0|t)+(0|e)}),0)/(this.lastDurations.length||1)|0;if(a.length>=2?(this.lastSampleDuration=o,t.duration=o):t.duration=this.lastSampleDuration,a.length&&(!this.nextDts||navigator.userAgent.toLowerCase().indexOf("chrome")>-1)){let t=a[0].flags;t.dependsOn=2,t.isNonSync=0}return this.nextDts=r+this.unscaled(this.lastSampleDuration),new Uint8Array(n.buffer,0,this.mp4track.len)}}const Ua="remuxer",za=ke(Ua),Fa={[me.H264]:La,[me.AAC]:Na},Wa={[me.H264]:1,[me.AAC]:0},Ha={[me.H264]:9e4,[me.AAC]:0};class ja{constructor(t,e){this.mse=new Ia([t]),this.eventSource=new J,this.mseEventSource=new tt(this.mse.eventSource),this.mse_ready=!0,this.cb=e,this.reset(),this.errorListener=this.mseClose.bind(this),this.closeListener=this.mseClose.bind(this),this.errorDecodeListener=this.mseErrorDecode.bind(this),this.eventSource.addEventListener("ready",this.init.bind(this))}initMSEHandlers(){this.mseEventSource.on("error",this.errorListener),this.mseEventSource.on("sourceclosed",this.closeListener),this.mseEventSource.on("errordecode",this.errorDecodeListener)}async reset(){this.tracks={},this.initialized=!1,this.initSegments={},this.codecs=[],this.streams={},this.enabled=!1,await this.mse.clear(),this.initMSEHandlers()}destroy(){this.mseEventSource.destroy(),this.mse.destroy(),this.mse=null,this.eventSource.destroy()}onTracks(t){za.debug("ontracks: ",t.detail);for(let e of t.detail)this.tracks[e.type]=new Fa[e.type](Ha[e.type],Wa[e.type],e.params),e.offset&&(this.tracks[e.type].timeOffset=e.offset),e.duration?(this.tracks[e.type].mp4track.duration=e.duration*(this.tracks[e.type].timescale||Ha[e.type]),this.tracks[e.type].duration=e.duration):this.tracks[e.type].duration=1}setTimeOffset(t,e){this.tracks[e.type]&&(this.tracks[e.type].timeOffset=t)}get MSE(){return this.mse}init(){let t=[];this.codecs=[];let e=[],i=1/0,r=1/0;for(let n in this.tracks){let e=this.tracks[n];if(!Ia.isSupported([e.mp4track.codec]))return;t.push(e.mp4track),this.codecs.push(e.mp4track.codec),e.init(i,r)}for(let n in this.tracks){let t=this.tracks[n];this.initSegments[n]=Aa.initSegment([t.mp4track],t.duration*t.timescale,t.timescale),e.push(this.initMSE(n,t.mp4track.codec))}return this.initialized=!0,this.cb&&this.cb(),Promise.all(e).then(()=>{this.enabled=!0})}initMSE(t,e){if(Ia.isSupported(this.codecs))return this.mse.setCodec(t,`${me.map[t]}/mp4; codecs="${e}"`).then(()=>{this.mse.feed(t,this.initSegments[t])});throw new Error("Codecs are not supported")}mseClose(){this.client.stop(),this.eventSource.dispatchEvent("stopped")}mseErrorDecode(){this.tracks[2]&&(console.warn(this.tracks[2].mp4track.type),this.mse.buffers[2].destroy(),delete this.tracks[2])}flush(){if(this.onSamples(),this.initialized)for(let t in this.tracks){let e=this.tracks[t],i=e.getPayload();i&&i.byteLength&&(this.mse.feed(t,[Aa.moof(e.seq,e.scaled(e.firstDTS),e.mp4track),Aa.mdat(i)]),e.flush())}else if(za.debug("Initialize..."),Object.keys(this.tracks).length){for(let t in this.tracks){if(!this.tracks[t].readyToDecode||!this.tracks[t].samples.length)return;za.debug("Init MSE for track "+this.tracks[t].mp4track.type)}this.eventSource.dispatchEvent("ready")}}onSamples(){for(let t in this.client.sampleQueues){let e=this.client.sampleQueues[t];"video"===t?this.onVideoFrame(e,t):"audio"===t&&this.onAudioFrame(e)}}onVideoFrame(t,e){while(t.length){let i=t.shift();if(i)for(let t of i)this.tracks[e]&&this.tracks[e].remux(t)}}onAudioFrame(){}onAudioConfig(t){this.tracks[t.detail.pay]&&this.tracks[t.detail.pay].setConfig(t.detail.config)}attachClient(t,e){this.client=t,this.clientEventSource=e,this.clientEventSource.on("samples",this.samplesListener),this.clientEventSource.on("audio_config",this.audioConfigListener),this.clientEventSource.on("flush",this.flush.bind(this)),this.clientEventSource.on("clear",()=>{this.reset(),this.mse.clear().then(()=>{this.initMSEHandlers()})}),this.mse.setLive(!this.client.seekable)}}var Va=ja;const qa={timeout:6e4},Ga="/tums/devConfig/v1/passthrough";class Ya{constructor(t={steamType:"",authSessionId:"",appKey:"",appSecret:"",urlPrefix:""}){this.steamType=t.steamType||"",this.authSessionId=t.authSessionId||"",this.appKey=t.appKey||"",this.appSecret=t.appSecret||"",this.setUrlPrefix(t.urlPrefix)}setUrlPrefix(t=""){this.urlPrefix=t;let e=t.length||0;e&&"/"===t[e-1]&&(this.urlPrefix=this.urlPrefix.substring(0,e-1))}getAxiosConfig(t={uri:uri,param:param,method:"POST",initConfig:{}}){let e=Object.assign({},qa,t.initConfig);if(this.steamType===mn.RELAY&&this.appKey){let i=null;e.headers||(e.headers={}),i=e.headers,e.headers["X-Authorization"]=Rn({appKey:this.appKey,appSecret:this.appSecret,terminalId:Zi(16),method:t.method,uri:t.uri,payload:JSON.stringify(t.param||{})})}return e}getFullUrl(t){let e=this.urlPrefix+t;return this.steamType===mn.RTSP&&(e=e.indexOf("?")>-1?`${e}&SESSIONID=${this.authSessionId}`:`${e}?SESSIONID=${this.authSessionId}`),e}post(t,e,i){const r=this.getFullUrl(t);return xn.a.post(r,e||{},this.getAxiosConfig({uri:t,param:e,method:"POST",initConfig:i||{}})).catch(t=>-1!==t.message.indexOf("timeout")?Promise.reject({error_code:Qs.COMMON.REQUEST_TIMEOUT,msg:"请求超时"}):-1!==t.message.indexOf("Network Error")||-1!==t.message.indexOf("Request failed")?Promise.reject({error_code:void 0,msg:"网络异常"}):Promise.reject({error_code:Qs.COMMON.UNKNOWN_CODE,msg:"未知错误"})).then(t=>{let e=t.data||{};return 0===e.error_code?Promise.resolve(t.data):Promise.reject(t.data)})}passthrough(t){return this.post(Ga,t).then(t=>0===t.error_code&&0===t.result.responseData.error_code?Promise.resolve(t.result.responseData):Promise.reject(t.error_code?t:t.result.responseData))}nvrChnPassthrough(t,e,i){let r={devId:t,param:{method:"forward",destination:"ipc",channel:e,content:i}};return this.passthrough(r).then(t=>0!==t.error_code?Promise.reject(t):t.content)}}class $a{constructor(t,e={parentQrCode:parentQrCode,qrCode:qrCode,channelId:channelId,parentId:parentId,channel:channel,devId:devId}){e.parentQrCode||e.qrCode?(this.requestor=t,this.parentQrCode=e.parentQrCode,this.qrCode=e.qrCode,this.channelId=e.channelId):(this.requestor=t,this.parentId=e.parentId||"",this.channel=e.channel||0,this.devId=e.devId||""),this.init()}init(){this.lensMaskEnable=!1,this.flipEnable=!0,this.rotateEnable=!1,this.fishEveEnable=!1,this.ptzEnable=!1,this.isMultiSensor=!1,this.isMotor=!1,this.talkEnable=!1,this.moduleSpec=null}getModuleSpec(){if(this.moduleSpec)return Promise.resolve({lensMaskEnable:this.lensMaskEnable,flipEnable:this.flipEnable,rotateEnable:this.rotateEnable,fishEveEnable:this.fishEveEnable,ptzEnable:this.ptzEnable,talkEnable:this.talkEnable,isMultiSensor:this.isMultiSensor,isMotor:this.isMotor});if(this.parentQrCode||this.qrCode){let t=this.requestor.post("/vms/open/deviceManager/v1/getDeviceCapability",{qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId});return t.then(({result:t={}})=>(this.moduleSpec=t.capability||{},this.lensMaskEnable="1"===this.moduleSpec.lens_mask,this.ptzEnable="1"===this.moduleSpec.ptz,this.isMultiSensor="1"===this.moduleSpec.multi_sensor,this.isMotor="1"===this.moduleSpec.motor,this.rotateEnable="1"===this.moduleSpec.corridor_mode,this.fishEveEnable="1"===this.moduleSpec.fish_eye,this.talkEnable=this.moduleSpec.audio.includes("speaker")&&this.moduleSpec.audio.includes("microphone"),{lensMaskEnable:this.lensMaskEnable,flipEnable:this.flipEnable,rotateEnable:this.rotateEnable,fishEveEnable:this.fishEveEnable,ptzEnable:this.ptzEnable,talkEnable:this.talkEnable,isMultiSensor:this.isMultiSensor,isMotor:this.isMotor}))}{const t={method:"get",function:{name:"module_spec"}};let e=null;return e=this.channel>0?this.requestor.nvrChnPassthrough(this.parentId,this.channel,t):this.requestor.passthrough({devId:this.devId,param:t}),e.then(t=>{let e=t.function||{},i=e.module_spec||{};return this.moduleSpec=i,this.lensMaskEnable="1"===i.lens_mask,this.rotateEnable="1"===i.corridor_mode,this.fishEveEnable="1"===i.fish_eye,{lensMaskEnable:this.lensMaskEnable,flipEnable:this.flipEnable,rotateEnable:this.rotateEnable,fishEveEnable:this.fishEveEnable}})}}}const Xa=ke("client:device"),Qa=ke("client:wsWatch"),Ka=100,Za={"-52413":"DEVICE_ERR_CHN_OFFLINE"};class Ja extends Error{constructor(t){super(t)}}class to extends wn{static get USER_AGENT(){return"SFRtsp 0.3"}static get STATE_INITIAL(){return 1}static get STATE_MULTITRANS_CONNECT(){return 2}static get STATE_GET_STREAMS(){return 4}static get STATE_STREAMS(){return 8}static get STATE_TEARDOWN(){return 16}static get STATE_PAUSED(){return 32}static get STATE_PLAY(){return 64}static get FINISH_REASON(){return{channel_offline:Me.DEVICE_ERR_CHN_OFFLINE,channel_invalid:Me.DEVICE_ERR_CHN_INVALID,internal_error:Me.COMMON_ERR_INTERNAL,password_changed:Me.DEVICE_ERR_PWD_CHANGED,media_encrypt_changed:Me.CLOUD_ERR_ENCRYPT_CHANGED,lack_bandwidth:Me.CLOUD_ERR_BANDWIDTH,offline:Me.DEVICE_ERR_CHN_OFFLINE}}constructor(t){super(),this.parent=t,this.transport=null,this.onStreamConfig=null,this.env=bn(),this.messageBuilder=new Ln(Ln.RTSP_1_0),this.isPlaying=!1,this.methods=["PLAY","PAUSE"],this.authenticator=null,this.payParser=new Fr,this.rtp_channels=new Set,this.addState(to.STATE_INITIAL,{}).addState(to.STATE_MULTITRANS_CONNECT,{activate:this.multitransHandshake,finishTransition:this.onMultitransHandshake}).addState(to.STATE_GET_STREAMS,{activate:this.getStreams,finishTransition:this.onStreams}).addState(to.STATE_STREAMS,{}).addState(to.STATE_TEARDOWN,{activate:()=>{this.started=!1},finishTransition:()=>this.transitionTo(to.STATE_INITIAL)}).addState(to.STATE_PAUSED,{activate:this.sendPause,finishTransition:this.onPause}).addState(to.STATE_PLAY,{activate:this.sendPlay,finishTransition:this.onPlay}).addTransition(to.STATE_INITIAL,to.STATE_MULTITRANS_CONNECT).addTransition(to.STATE_INITIAL,to.STATE_TEARDOWN).addTransition(to.STATE_MULTITRANS_CONNECT,to.STATE_GET_STREAMS).addTransition(to.STATE_MULTITRANS_CONNECT,to.STATE_TEARDOWN).addTransition(to.STATE_GET_STREAMS,to.STATE_STREAMS).addTransition(to.STATE_GET_STREAMS,to.STATE_TEARDOWN).addTransition(to.STATE_STREAMS,to.STATE_GET_STREAMS).addTransition(to.STATE_STREAMS,to.STATE_PAUSED).addTransition(to.STATE_STREAMS,to.STATE_TEARDOWN).addTransition(to.STATE_PAUSED,to.STATE_STREAMS).addTransition(to.STATE_PAUSED,to.STATE_TEARDOWN).addTransition(to.STATE_PAUSED,to.STATE_PLAY).addTransition(to.STATE_PLAY,to.STATE_STREAMS).addTransition(to.STATE_PLAY,to.STATE_TEARDOWN).addTransition(to.STATE_TEARDOWN,to.STATE_INITIAL),this.reset()}async reset(){this.sessionId="",this.cSeq=0,this.cmdSeq=0,this.payload={},this.currentSeq=0,this.receivedSeq=0,this.lastGetWsTime=Number.MAX_SAFE_INTEGER,this.endWatchWsStatus(),this.parser=new Fr,this.currentState?this.currentState.name!=to.STATE_INITIAL&&(await this.transitionTo(to.STATE_TEARDOWN),await this.transitionTo(to.STATE_INITIAL)):await this.transitionTo(to.STATE_INITIAL),this.isOnDataRemain=!1,this.lastRTPSeq={},this.rtpBuffer={},this.relativeUTCInfo={},this.videoPTSTimescale=9e4,this.audioSampleRate=8e3,this.isVideoWaitIFrame=!0,this.lastVideoFrameFlag=0,this.recordVideoFrameFlagForMultiSlice=0,this.url="rtsp://127.0.0.1/multitrans",this.scale=1}sendStop(){return this.currentState.name===to.STATE_STREAMS||this.currentState.name===to.STATE_PAUSED?this.sendMultitrans({type:"request",seq:this.cmdSeq,params:{method:"do",stop:"null"}}):Promise.resolve()}async stop(){this.started&&await this.transitionTo(to.STATE_TEARDOWN),this.shouldReconnect=!1}sendTeardown(){let t="TEARDOWN";return this.sendRequest(t,this.url)}async destroy(){this.endWatchWsStatus()}async setSource(){await this.reset()}start(){return this.currentState.name!==to.STATE_STREAMS?this.transitionTo(to.STATE_MULTITRANS_CONNECT):Promise.resolve()}async onConnected(){this.rtpFactory&&(this.rtpFactory=null),this.shouldReconnect&&(Xa.log("start"),this.start())}startWatchWsStatus(){this.endWatchWsStatus(),this.wsWatchIntervalId=setInterval(()=>{(new Date).getTime()-this.lastGetWsTime>=6e4&&this.currentState.name===to.STATE_STREAMS&&(this.endWatchWsStatus(),Qa.log("ws stop for a long time",(new Date).getTime(),this.lastGetWsTime),this.parent.error(Me.MEDIA_ERR_TRANSPORT))},2e3)}endWatchWsStatus(){clearInterval(this.wsWatchIntervalId)}sendMultitrans(t,e={}){this.lastSetMultitransTime=(new Date).getTime();let i="MULTITRANS",r={"Content-Type":"application/json"};return this.sessionId&&(r["X-Session-Id"]=this.sessionId),Object.assign(r,e),this.sendRequest(i,this.url,r,t).then(t=>{Xa.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}sendRequest(t,e,i={},r=null){return this.cSeq++,Object.assign(i,{CSeq:this.cSeq,"User-Agent":to.USER_AGENT}),this.authenticator&&(i["Authorization"]=this.authenticator(t)),r&&r.type&&"request"===r.type&&++this.cmdSeq,this.send(this.messageBuilder.build(t,e,i,r),t).catch(n=>{if(n instanceof Ja)return this.sendRequest(t,e,i,r);throw n})}async send(t){if(this.transport){try{await this.transport.ready}catch(e){throw this.onDisconnected(),e}let i=await this.transport.send(t),r=this.parse(i);if(401===r.code&&!this.authenticator){Xa.log("www-authenticate header: ",r.headers["www-authenticate"]);let t=r.headers["www-authenticate"],e=t.substring(0,t.indexOf(" "));t=t.substr(e.length+1);let i=t.split(",");if("digest"==e.toLowerCase()){let t={};for(let e of i){let i=e.trim(),[r,n]=i.split("=");t[r]=n.substr(1,n.length-2)}this.authenticator=e=>{let i=Cs(`${this.parent.username}:${t.realm}:${this.parent.password}`),r=Cs(`${e}:${this.url}`),n=Cs(`${i}:${t.nonce}:${r}`),s="";return`Digest username="${this.parent.username}", realm="${t.realm}", nonce="${t.nonce}", uri="${this.url}", response="${n}"${s}`}}else this.authenticator=()=>{let t=`${this.parent.username}:${this.parent.password}`;return"Basic "+btoa(t)};throw new Ja(r)}if(r.code>=300)throw Xa.error(r.statusLine),new Rs({msg:`RTSP error: ${r.code} ${r.statusLine}`,parsed:r});return r}return Promise.reject("No transport attached")}onData(t){this.lastGetWsTime=(new Date).getTime(),!this.isOnDataRemain&&this.dataBuffer||(this.dataBuffer=new Uint8Array([])),this.isOnDataRemain=!1;let e=oe(this.dataBuffer,t),i=new DataView(e.buffer,e.byteOffset,e.byteLength),r=i.getUint8(0);if(36===r){if(i.byteLength<4)return void(this.dataBuffer=e);let r=i.getUint16(2),n=r+4;if(!(e.length>=n))return void(this.dataBuffer=e);t=e.slice(0,n),this.dataBuffer=e.slice(n)}else{let i=e.findIndex(t=>36===t);-1!==i?(t=e.slice(0,i),this.dataBuffer=e.slice(i)):(t=e,this.dataBuffer=new Uint8Array([]))}if(t.byteLength){if(36===t[0]){let e=t[1];this.rtp_channels.has(e)&&this.onRTP({packet:t.subarray(4),type:e})}else{let e,i=le(t);Xa.log("on data: ",i);try{if(e=this.parse(i),!e.body)return void(this.dataBuffer=t)}catch(n){return this.dataBuffer=t,n}if(!e)return;let r,s,{body:a={}}=e,{params:o={}}=a,h=o.event_type;switch(h){case"stream_finish":this.parent.stop(),s=to.FINISH_REASON[o.reason],this.parent.error(s||Me.MEDIA_ERR_NETWORK);break;case"channel_preview_params":this.onStreams(e);break;case"stream_sequence":this.currentSeq=parseInt(o.sequence);break;case"channel_stream_status":r=o.status&&o.status[0],s=to.FINISH_REASON[r],s&&(this.parent.stop(),this.parent.error(s));break;case"stream_status":r=o.status,"finished"===r&&(this.parent.eventSource.dispatchEvent("ended"),this.parent.stop());default:break}}(this.dataBuffer.byteLength&&36===this.dataBuffer[0]||this.dataBuffer.byteLength>=4&&"rtsp"===le(this.dataBuffer.slice(0,4)).toLocaleLowerCase())&&(this.isOnDataRemain=!0,this.onData(this.dataBuffer))}}onRTP(t){if(!this.rtpFactory)return;this.isPlaying||this.currentState.name===to.STATE_PAUSED||(this.isPlaying=!0,this.parent.eventSource.dispatchEvent("stream"));let e=this.rtpFactory.build(t.packet,this.sdp);if(!Object.prototype.hasOwnProperty.call(e,"type"))return;if(!e.utc_timestamp&&this.relativeUTCInfo.utc||(this.relativeUTCInfo={utc:e.utc_timestamp||1,pts:e.timestamp}),this.ifDropAudio&&e.isAudio())return;let i=this.rtpBuffer[e.pt]||[];i.push(e);while(i.length){let t=i.shift();-1===this.lastRTPSeq[t.pt]&&(this.lastRTPSeq[t.pt]=t.sequence);let e=1;if(t.isVideo()&&(this.isVideoWaitIFrame||t.sequence-this.lastRTPSeq[t.pt]!==1&&this.lastRTPSeq[t.pt]-t.sequence!==65535&&(this.isVideoWaitIFrame=!0,console.log("on video get wrong rtp sn",t.sequence,this.lastRTPSeq[t.pt])),0===this.lastVideoFrameFlag&&(this.lastVideoFrameFlag=t.frame_flg),this.scale>1&&(e=this.scale)),this.lastRTPSeq[t.pt]=t.sequence,t.media){let i=this.payParser.parse(t),r=!1;if(i&&this.parent.sampleQueues[t.mediaType()]){if(i.forEach(i=>{i.type=t.type,t.isVideo()?(i.seq=this.currentSeq,0!==this.lastVideoFrameFlag&&(i.isVirtualI=1===this.lastVideoFrameFlag,i.isDecodeOnlyI=2===this.lastVideoFrameFlag),i.isStartSlice()?this.recordVideoFrameFlagForMultiSlice=this.lastVideoFrameFlag:(i.isVirtualI=1===this.recordVideoFrameFlagForMultiSlice,i.isDecodeOnlyI=2===this.recordVideoFrameFlagForMultiSlice),this.lastVideoFrameFlag=0,this.isVideoWaitIFrame&&(r=i.isParameterSet(),i.isKeyframe()&&(console.log("get i frame stop drop frame",i.ntype),this.isVideoWaitIFrame=!1)),i.timestamp=parseInt(this.relativeUTCInfo.utc+1e3*(i.pts-this.relativeUTCInfo.pts)*e/this.videoPTSTimescale)):(i.samplerate=this.audioSampleRate,i.timestamp=parseInt(this.relativeUTCInfo.utc+e*(1e3*i.pts/this.audioSampleRate-1e3*this.relativeUTCInfo.pts/this.videoPTSTimescale)))}),t.isVideo()&&this.isVideoWaitIFrame&&!r)return;this.parent.feed(t.mediaType(),i)}}}}async onDisconnected(){this.reset(),this.shouldReconnect=!0,await this.transitionTo(to.STATE_TEARDOWN),await this.transitionTo(to.STATE_INITIAL)}error(t){this.parent.error(t)}async reconnect(){return await this.reset(),this.currentState.name!=to.STATE_INITIAL?(await this.transitionTo(to.STATE_TEARDOWN),this.transitionTo(to.STATE_MULTITRANS_CONNECT)):this.transitionTo(to.STATE_MULTITRANS_CONNECT)}multitransHandshake(){this.cSeq=0;let t={"X-Handshake":"unused debug","X-Client-Model":this.env.os,"X-Client-UUID":this.parent.clientUUID};return this.sendRequest("MULTITRANS",this.url,t).then(t=>{Xa.log("on multitrans\n",t);let{body:e={}}=t;return this.errorException(e)?null:t})}onMultitransHandshake(t){this.authenticator=null,this.transitionTo(to.STATE_GET_STREAMS)}getStreams(){this.sessionId="",this.started=!0,this.isPlaying=!1;let{options:t={},channel:e=0}=this.parent,{streamType:i,startTime:r,scale:n,eventType:s,audioVoiceEnable:a,resolution:o}=t,h=a?"enable":"disable",c={method:"get",preview:{audio:[h],channels:[e],resolutions:[o]}},u=n<0?"-":"";n&&(this.scale=n);let l={method:"get",playback:{client_id:this.parent.options.userId,channels:[e],scale:u+Mn.formatScale(n),event_type:s,start_time:parseInt(r/1e3)+""}},d={type:"request",seq:this.cmdSeq,params:"video"===i?c:l},f=null;return"video"!==i&&(f={"X-Data-Window-Size":Ka}),this.sendMultitrans(d,f)}useRTPChannel(t){this.rtp_channels.add(t)}forgetRTPChannel(t){this.rtp_channels.delete(t)}onStreams(t){var e,i;if(!t)return;let{body:r={}}=t,{params:n={}}=r;if(this.errorException(r))return;this.relativeUTCInfo={},this.audioSampleRate=8e3,n["session_id"]&&(this.sessionId=n["session_id"]),this.sdp=new Hr;let s=n["av_config"][0],a={},o={};a.type="video",a.port=0,a.proto="";let h=(null===(e=n.av_config[0])||void 0===e||null===(e=e.extra_data)||void 0===e?void 0:e.video_rtpmap)&&(null===(i=n.av_config[0])||void 0===i||null===(i=i.extra_data)||void 0===i?void 0:i.video_rtpmap.slice(0,2)),c=h||96;a.fmt=[c],a.ptype=me.string_map[s.video_codec];for(let f of a.fmt)this.sdp.mediaMap[f]=a;this.sdp.media[a.type]=a,o.type="audio",o.port=0,o.proto="",o.fmt=[8],o.ptype=me.string_map[s.audio_codec],void 0==o.ptype||o.ptype==me.G726?(this.ifDropAudio=!0,console.log("audio codec not support or abnormal",s.audio_codec,o.ptype)):this.ifDropAudio=!1;for(let f of o.fmt)this.sdp.mediaMap[f]=o;this.sdp.media[o.type]=o;let u=1e3*parseInt(s.audio_sampling_rate);if(u>0&&(this.audioSampleRate=u),"AAC"===s.audio_codec){let t={samplerate:u};this.payParser.aacparser.setConfig(t)}if(this.sdp.isNvmpAccPlayBack=!0,n.interleaved){var l;let t=null===(l=n.interleaved[0])||void 0===l||null===(l=l.interleaved_id)||void 0===l?void 0:l.split("-");t.length&&t.forEach(t=>{this.useRTPChannel(Number(t))})}this.rtpBuffer[a.fmt[0]]=[],this.rtpBuffer[o.fmt[0]]=[],this.lastRTPSeq[a.fmt[0]]=-1,this.lastRTPSeq[o.fmt[0]]=-1,this.parent.sampleQueues["video"]=this.parent.sampleQueues["video"]||[],this.parent.sampleQueues["audio"]=this.parent.sampleQueues["audio"]||[],this.rtpFactory=new Mr(this.sdp);let d=this.transport.socket();d.initDataChannel(),this.transitionTo(to.STATE_STREAMS),this.onStreamConfig&&this.onStreamConfig(s),this.startWatchWsStatus()}parse(t){let e=t.match(/\scontent-length:\s*(\d*)\s/i),i=0;if(e&&e.length>=2&&/^\d+$/.test(e[1]))i=parseInt(e[1]);else{if(!/content-length: \s*0$/i.test(t))return{};i=0}let r=t.split("\r\n\r\n"),n=r[1]||"";if(n.lengththis.receivedSeq)){let e={type:"notification",params:{event_type:"stream_sequence"}},i={"X-Data-Received":t};this.sendMultitrans(e,i),this.receivedSeq=t}}}class eo extends Mn{constructor(t={flush:10}){super(Object.assign({},t)),this.resolution=t.resolution||"HD",this.channel=t.channel||0,this.username=t.username||"admin",this.password=t.password||"",this.sampleQueues={},this.clientUUID=X(),this.clientSM=new to(this)}async start(){this.clientSM.onStreamConfig=t=>{this.eventSource.dispatchEvent("rtspConfig",t),this.startStreamFlush()},this.connect(),super.start()}async setSource(){await this.clientSM.setSource()}attachTransport(t){super.attachTransport(t),this.clientSM.transport=t}detachTransport(){super.detachTransport(),this.clientSM.transport=null}async reset(){await this.clientSM.reset(),this.sampleQueues={},this.paused=!1,this.ifDropAudio=!1}async connect(){let{url:t}=this.options;await this.setSource();let e=new yn(this.options.type,{socket:t,binaryType:"blob"});return this.attachTransport(e),this.transport?this.transport.ready.then(()=>this.clientSM.start()):Promise.reject("no transport attached")}stop(){return this.clientSM.stop(),this.transport&&this.transport.disconnect(),clearTimeout(this.timer),super.stop()}destroy(){return this.clientSM.destroy(),super.destroy()}play(t){this.clientSM.play().then(()=>{this.paused=!1,t&&t()})}pause(t){let{currentState:e}=this.clientSM;if(!e||e.name!==to.STATE_STREAMS)return;let{streamType:i}=this.options;"video"===i?(super.stop(),t&&t()):this.clientSM.pause().then(()=>{super.stop(),t&&t()})}setResolution(t,e){let{currentState:i}=this.clientSM;i&&(this.detachTransport(),this.resolution=e,this.options.url=t,this.options.resolution=e,this.start())}onData(t){this.clientSM.onData(t)}onConnected(){this.clientSM.onConnected(),super.onConnected()}onDisconnected(){super.onDisconnected(),this.clientSM.onDisconnected()}error(t){this.eventSource.dispatchEvent("error",new Me(t))}setPlaybackConfig(t){return Object.assign(this.options,t),this.clientSM.sendPlaybackConfig(t).then(()=>{this.paused=!1,this.flushSampleQueue()})}onPlayerNotify(t){let{seq:e}=t,{streamType:i}=this.options;e&&"sdvod"===i&&this.clientSM.updateReceivedSeq(e)}}var io=eo;const ro=i("9224"),no=ke("TumsPlayer"),so={[mn.RTSP]:da,[mn.RELAY]:hs,[mn.FILE]:xa,[mn.DEVICE]:io},ao={[mn.RTSP]:Hs,[mn.RELAY]:Qn},oo=1;let ho="";xn.a.defaults.withCredentials=!0;class co{constructor(t,e={}){this.isIniting=!1,this.isInit=!0,this.url="",this.type="",this.resolution="",this.client=null,this.audioClient=null,this.player=null,this.modules={},this.errorHandler=null,this.queryCredentials=null,this.eventSource=new J,this.staticImg=!1,this.parent="string"===typeof t?document.getElementById(t):t,e.staticImg?this.staticImg=!0:(localStorage.setItem("__TUMS_PLAYER_VERSION__",`${ro.name}@${ro.version}`),e&&this.init(e))}async init(t){if(!this.isIniting)if(this.isIniting=!0,this.appKey=t.appKey||"",this.appSecret=t.appSecret||"",this.proxyServer=t.proxyServer||"https://api-smbcloud.tp-link.com.cn/",this.parentId=t.parentId,this.channel=t.channel,this.devId=t.devId,this.parentQrCode=t.parentQrCode,this.qrCode=t.qrCode,this.channelId=t.channelId||oo,this.requestor=new Ya(t.type===mn.RTSP?{steamType:t.type,urlPrefix:t.queryAddress,authSessionId:t.authSessionId}:{steamType:t.type,urlPrefix:this.proxyServer,appKey:t.appKey,appSecret:t.appSecret}),this.parentQrCode||this.qrCode?this.devCapability=new $a(this.requestor,{parentQrCode:this.parentQrCode,qrCode:this.qrCode,channelId:this.channelId}):this.devCapability=new $a(this.requestor,{parentId:t.parentId,channel:t.channel,devId:t.devId}),await this.destroy(),this.addVideoWrap(),this.options=t,this.type=t.type||mn.RTSP,this.socket=t.socket,this.autoplay=!1!==t.autoplay,this.resolution=t.resolution||"",this.errorHandler=t.errorHandler||null,this.queryCredentials=t.queryCredentials||null,this.pluginPath=t.pluginPath||"",this.isCover=t.cover||!1,this.streamType=t.streamType||"video",this.storageType=t.storageType||"device",this.type===mn.FILE?this.startTime=t.startTime||0:this.startTime=t.startTime||new Date((new Date).toLocaleDateString()).getTime(),this.endTime=t.endTime||this.startTime+864e5,this.scale=t.scale||1,this.eventType=t.eventType||[1,2],this.userId=t.userId||0,this.screenshotEnable=!1!==t.screenshotEnable,this.audioVoiceEnable=!1!==t.audioVoiceEnable,this.talkEnable=t.talkEnable||!1,this.volume=t.volume||0,this.fishEyeDisplayMode=t.fishEyeDisplayMode||"ORIGIN",this.ptzEnable=t.ptzEnable||!1,this.supportVideoEl=t.supportVideoEl||!1,this.encodeType=t.encodeType||"",this.decoderType=t.decoderType||"webcodecs",this.sendInterAduioData="","wasm"===this.decoderType||"webcodecs"===this.decoderType)if("webcodecs"!==this.decoderType||window.VideoDecoder||(this.decoderType="wasm"),"wasm"!==this.decoderType||window.WebAssembly){if(await cr(this.pluginPath),this._startTime=(new Date).getTime(),this.isError=!1,this.type!==mn.HLS){if(this.supportVideoEl?(this.player=new Va(this.video,()=>{no.log("First frame cost: ",(new Date).getTime()-this._startTime),console.log("[TumsPlayer] playing"),this._keepEventSource=!1,this.eventSource.dispatchEvent("playing",this)}),this.video.style.display="inline-block"):this.player=new Cr({pluginPath:this.pluginPath,cover:this.isCover,playScale:this.scale,streamType:this.streamType,volume:this.volume,startTime:this.startTime,fishEyeDisplayMode:this.fishEyeDisplayMode,audioVoiceEnable:this.audioVoiceEnable,decoderType:this.decoderType,devId:this.devId},this.parent,()=>{no.log("First frame cost: ",(new Date).getTime()-this._startTime),console.log("[TumsPlayer] playing"),this._keepEventSource=!1,this.eventSource.dispatchEvent("playing",this)}),t.url&&t.type)this.url=t.url,this.type=t.type;else if(!this._checkSource(this.video))for(let t=0;t{t.detail.type="audio",this.eventSource.dispatchEvent("error",t.detail)}),this.audioClientEventSource.on("sendAudioStream",()=>{this.eventSource.dispatchEvent("sendAudioStream")})}async setSource(t,e){this.transport&&(this.client&&await this.client.detachTransport(),await this.transport.destroy());try{this.endpoint=hn.parse(t)}catch(r){no.log(r)}this.url=t;let i=this.type;if(this.type=!!mn.isSupported(e)&&e||mn.fromMime(e),!this.type)throw new Error("Bad stream type");if(i==this.type&&this.client)this.client.reset();else{this.client&&await this.client.destroy();let t=so[this.type];this.client=new t({url:this.url,socket:this.socket,type:this.type,flush:10,streamType:this.streamType,startTime:this.startTime,endTime:this.endTime,eventType:this.eventType,scale:this.scale,userId:this.userId,videoSessionId:this.options.videoSessionId,videoDevId:this.options.videoDevId,storageDevId:this.options.storageDevId,useMultitrans:this.options.useMultitrans,userName:this.options.userName||"",password:this.options.password||"",audioVoiceEnable:this.audioVoiceEnable,requestor:this.requestor,channel:this.options.channel,resolution:this.options.resolution,username:this.options.username,appKey:this.appKey,appSecret:this.appSecret,clientUUID:this.clientUUID})}this.queryCredentials&&(this.client.queryCredentials=this.queryCredentials),this.attachClient(),this.player&&this.player.attachClient(this.client,this.clientEventSource),this.eventSource.dispatchEvent("ready",this)}attachClient(){this.detachClient(),this.clientEventSource=new tt(this.client.eventSource),this.clientEventSource.on("tracks",this.onTracks.bind(this)),this.clientEventSource.on("relayConfig",this.onRelayConfig.bind(this)),this.clientEventSource.on("rtspConfig",this.onRTSPConfig.bind(this)),this.clientEventSource.on("fileConfig",this.onFileConfig.bind(this)),this.clientEventSource.on("stream",()=>{this.eventSource.dispatchEvent("stream",this),this.player&&(this.player.isInit=!0)}),this.clientEventSource.on("error",t=>{if(t.detail.code===Me.MEDIA_ERR_DECODER)return this.options.decoderType="wasm",this._keepEventSource=!0,void this.init(this.options);this.isError=!0,this.player&&this.player.stopFlush(),this.eventSource.dispatchEvent("error",t.detail),console.log("[TumsPlayer] disconnected")}),this.clientEventSource.on("disconnected",()=>{this.isError=!0,this.player&&this.player.stopFlush(),this.eventSource.dispatchEvent("disconnected",this),console.log("[TumsPlayer] disconnected")}),this.clientEventSource.on("ended",()=>{this.player&&this.player.stopFlush(),this.eventSource.dispatchEvent("ended",this)}),this.clientEventSource.on("streamFinished",()=>{this.player&&this.player.notifyStreamFinished()}),this.clientEventSource.on("zoom",t=>{this.eventSource.dispatchEvent("zoom",t.detail)}),this.clientEventSource.on("warning",t=>{this.eventSource.dispatchEvent("warning",t.detail)}),this.clientEventSource.on("sendInterAduioData",t=>{this.sendInterAduioData=t.detail,"rtsp"===this.type&&this.audioClient&&this.audioClient.getInterAduioData(this.sendInterAduioData)}),this.clientEventSource.on("redirect",()=>{this.eventSource.dispatchEvent("redirect",this)}),this.clientEventSource.on("canvasWidthChange",t=>{this.eventSource.dispatchEvent("canvasWidthChange",t.detail)})}detachClient(){this.clientEventSource&&(this.clientEventSource.destroy(),this.clientEventSource=null)}onTracks(t){no.log("on tracks: ",t.detail);let e,i,r,n=t.detail||{};for(let s of n)if(s.type==me.H264?e=0:s.type==me.H265&&(e=1),s.audioTrack){let{audioTrack:t}=s,e=t.rtpmap[t.fmt[0]];i=e.clock,r=e.name}this.initPlayer({codeType:e,audioType:r,sampleRate:i,tracks:t})}onRelayConfig(t){let e,i,r,n,s=t.detail||{};s["video_codec"]&&(e="H265"===s["video_codec"]?1:0),r=s["audio_codec"]||"G711alaw";let a=8e3;a="8"===s["audio_sampling_rate"]?8e3:"16"===s["audio_sampling_rate"]?16e3:"44.1"===s["audio_sampling_rate"]?44100:s["audio_sampling_rate"],n=s.bitCount||"",i=parseInt(a||8e3),no.log("player config: ",s),this.initPlayer({codeType:e,audioType:r,sampleRate:i,bitCount:n})}onRTSPConfig(t){this.onRelayConfig(t)}onFileConfig(t){let e=t.detail,i=1;e.videoCodec&&(i="H265"===e.videoCodec?1:0);let r="G711alaw";e.audioCodec&&(r=e.audioCodec);let n=e.bitCount||16,s=parseInt(e.audioSampleRate||8e3);no.log("player config: ",e),this.initPlayer({codeType:i,audioType:r,sampleRate:s,bitCount:n})}initPlayer(t){let{tracks:e}=t;this.supportVideoEl?this.player.onTracks(e):this.player.setConfig(t),this.eventSource.dispatchEvent("play",this)}start(){this.client&&this.client.start().then(()=>{this.isInit=!1}).catch(t=>{this.errorHandler&&this.errorHandler(t)})}stop(){this.client&&this.client.stop(),this.player&&this.player.stopFlush&&this.player.stopFlush()}async destroy(){this.clearSessionInterval(),this.client&&(await this.client.destroy(),this.detachClient(),this.client=null,this.transport=null),this.player&&(this.player.destroy(),this.player=null),this.eventSource&&!this._keepEventSource&&this.eventSource.clear(),this.video&&this.parent.contains(this.video)&&this.parent.removeChild(this.video),this.audioClient&&this.audioClient&&this.audioClient.destroy(),this.drawingBoard&&(this.drawingBoard.destroy(),this.drawingBoard=null)}play(){this.isPlaying()||(this._startTime=Date.now(),this.client&&this.client.play(()=>{this.video.play(),"video"===this.streamType&&this.player.setVolume&&this.player.setVolume(this.volume),this.player.resumeRecord&&this.player.resumeRecord(),this.player.startFlush&&this.player.startFlush(),this.eventSource.dispatchEvent("play",this)}))}pause(){this.isPlaying()&&this.client&&this.client.pause(()=>{this.video.pause(),"sdvod"===this.streamType?this.player.stopFlush&&this.player.stopFlush():"video"===this.streamType&&this.player.setFakeSlience&&this.player.setFakeSlience(),this.player.pauseRecord&&this.player.pauseRecord(),this.eventSource.dispatchEvent("pause",this)})}setResolution(t,e){this._startTime=Date.now(),this.client&&this.client.setResolution(t,e),e&&(this.resolution=e)}changeResolutionIsMultiSensor(t){this._startTime=Date.now(),this.client&&this.client.changeResolutionIsMultiSensor(t)}on(t,e){this.eventSource.addEventListener(t,e)}off(t,e){this.eventSource.removeEventListener(t,e)}setPlaybackConfig(t){t.scale&&(t.startTime||(t=Object.assign({startTime:this.getPlaybackTime()},t))),t.currentTime=this.getPlaybackTime(),t.currentScale=this.getPlayScale(),this.client&&this.client.setPlaybackConfig(t).then(()=>{this.video.play(),this.eventSource.dispatchEvent("play",this),t.scale&&this.player.setPlayScale&&this.player.setPlayScale(t.scale),t.startTime&&this.player.seek&&this.player.seek(t.startTime),this.player.startFlush&&this.player.startFlush()})}getDuration(){return this.player&&this.player.getDuration()&&this.player.getDuration()||0}getPlaybackTime(){return this.player&&this.player.getTimestamp&&this.player.getTimestamp()||this.startTime}getPlayScale(){return this.player&&this.player.getPlayScale&&this.player.getPlayScale()||this.scale}toggleZoomState(t){this.player&&this.player.toggleZoomState&&this.player.toggleZoomState(t)}setZoomScale(t){this.player&&this.player.setZoomScale&&this.player.setZoomScale(t)}playAudio(){this.player&&this.player.playAudio&&this.player.playAudio()}setVolume(t){this.volume=t,this.client&&!this.client.paused&&this.player&&this.player.setVolume&&this.player.setVolume(t)}getVolume(){return this.player&&this.player.getVolume&&this.player.getVolume()}getCanvasSize(){return this.player&&this.player.getCanvasSize?this.player.getCanvasSize():{width:0,height:0}}keepSession(){this.clearSessionInterval(),ho=setInterval(()=>{this.requestor.post($s.url.getCurrentTime,{},{headers:{sessionUpdate:!0}})},3e4)}clearSessionInterval(){clearInterval(ho)}setFishEyeDisplayMode(t,e={}){this.fishEyeDisplayMode=t,this.player&&this.player.setDisplayMode&&this.player.setDisplayMode(t,e)}async setPtzParams(t){if(this.parentQrCode||this.qrCode){let e={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId,speed:t.speed,direction:t.direction};return this.requestor.post("/vms/open/deviceConfig/v1/motionCtrl",e)}{let e=4/7,i={id:t.id,direction:t.direction,startOrNot:t.startOrNot,speed:t.speed||String(e.toFixed(6))};return this.requestor.post("/tums/ptz/v1/motionCtrl",i)}}async startParkConfig(t={}){if(this.parentQrCode||this.qrCode){let e={enabled:t.enabled,parkTime:t.parkTime,actionMode:t.mode,actionId:t.actionId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/setParkConfig",e)}{let e={id:t.id,enabled:t.enabled,parkTime:t.parkTime,actionMode:t.mode,actionId:t.actionId};return this.requestor.post("/tums/ptz/v1/setParkConfig",e)}}async getAllPresets(){if(this.parentQrCode||this.qrCode){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getAllPresets",t)}{let t={id:id};return this.requestor.post("/tums/ptz/v2/getAllPresets",t)}}async operatePreset(t){if(this.parentQrCode||this.qrCode){let e={presetId:t.presetId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return void 0!==t.name&&(e.presetName=t.name,e.override=t.override),this.requestor.post("/vms/open/deviceConfig/v1/operatePreset",e)}{let e={id:t.id,presetId:t.presetId,operation:t.operation};return void 0!==t.name&&(e.presetName=t.name),this.requestor.post("/tums/ptz/v1/operatePreset",e)}}async executePreset(t){let e={presetId:t.presetId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/executePreset",e)}async deletePreset(t){let e={presetId:t.presetId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/deletePreset",e)}async addPresetPoint(t){if(this.parentQrCode||this.qrCode){let e={presetId:t.presetId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId,presetName:t.presetName,override:t.override};return this.requestor.post("/vms/open/deviceConfig/v1/operatePreset",e)}{let e=new FormData;return e.append("imgSrc",t.files,t.filename),e.append("presetName",t.presetName),e.append("id",t.id),this.requestor.post("/tums/ptz/v1/addPresetPoint",e,{header:{"Content-Type":"multipart/form-data;"}})}}resetPtzDevicePosition(t){if(this.parentQrCode||this.qrCode){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/resetPtzDevicePosition",t)}{let e={deviceIndex:t};return this.requestor.post("/vms/deviceConfig/v1/resetPtzDevicePosition",e)}}getPtzDeviceResetSupport(t){if(this.parentQrCode||this.qrCode){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getPtzDeviceResetSupport",t)}{let e={deviceIndex:t};return this.requestor.post("/vms/deviceConfig/v1/getPtzDeviceResetSupport",e)}}getFocusCapability(){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getFocusCapability",t)}getDeviceZoomSupport(){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getDeviceZoomSupport",t)}async getAllTours(){if(this.parentQrCode||this.qrCode){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getAllTours",t)}{let t={id:id};return this.requestor.post("/tums/ptz/v1/getAllTours",t)}}async getToursInfo(t){if(this.parentQrCode||this.qrCode){let e={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId,tourIds:t.tourId};return this.requestor.post("/vms/open/deviceConfig/v1/getToursInfo",e)}{let e={id:t.id,tourId:t.tourId};return this.requestor.post("/tums/ptz/v1/getToursInfo",e)}}async addCruisePath(t){if(this.parentQrCode||this.qrCode){let e=""+("add"===t.type?"/vms/open/deviceConfig/v1/addTour":"/vms/open/deviceConfig/v1/modifyTour"),i={tourId:t.tourId,tourName:t.tourName,presetIds:t.presetIds,times:t.times,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post(e,i)}{let e=""+("add"===t.type?"/tums/ptz/v1/addCruisePath":"/tums/ptz/v1/modifyTour"),i={id:t.id,tourId:t.tourId,tourName:t.tourName,presetIds:t.presetIds,times:t.times};return this.requestor.post(e,i)}}async executeTour(t){if(this.parentQrCode||this.qrCode){let e={tourId:t.tourId,action:t.action,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/executeTour",e)}{let e={id:t.id,tourId:t.tourId,action:t.action};return this.requestor.post("/tums/ptz/v1/executeTour",e)}}async deleteTour(t){if(this.parentQrCode||this.qrCode){let e={tourId:t.tourId,qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/deleteTour",e)}{let e={id:t.id,tourId:t.tourId};return this.requestor.post("/tums/ptz/v1/deleteTour",e)}}async getDeviceType(t){if(this.parentQrCode||this.qrCode){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getPtzCapability",t)}{let e=await this.getEquipmentInfoByDevId(t)||{},i=e.result;if(i.extendInfo.channel>0){let t={devId:i.parentId,param:{method:"do",ptz:{get_ptz_capability:{chn_id:i.extendInfo.channel}}}};return this.getPtzCapability({type:"nvr",param:t,nvrChannel:i.extendInfo.channel})}{let t={devId:i.deviceIndex,param:{method:"get",ptz:{name:"capability"}}};return this.getPtzCapability({type:"ipc",param:t})}}}getEquipmentInfoByDevId(t){let e={deviceIndex:t};return this.requestor.post("/tums/deviceManager/v2/getDeviceDetails",e)}getPtzCapability(t){return this.requestor.passthrough(t.param).then(e=>{if("ipc"===t.type){let t=e.ptz.capability,i=this.isDisabled(t,"position_zoom_range"),r="1"===t.position3D_unsupported,n=!("1"===t.pattern_supported),s=!("1"===t.tour_supported),a=!("1"===t.preset_supported),o=this.isDisabled(t,"position_pan_range"),h=!("1"===t.park_supported),c=this.isDisabled(t,"position_tilt_range"),u="1"===t.pan_tilt_rotate_sync_unsupported,l=t.tour_stay_time_range.map(t=>t/1e3),d={zoomCapabilityDisabled:i,position3DUnsupported:r,patternSupported:n,tourSupportedDisabled:s,presetUnSupported:a,parkSupported:h,tiltRangeDisabled:c,panTiltRotate:u,tourStayTimeRange:l,panRangeDisabled:o,type:"ipc"};return d}{let i=`chn${t.nvrChannel}_ptz_capability`,r=e[i].ptz_capability,n="0.000000"===r.z_max&&"0.000000"===r.z_min,s=!("1"===r.pattern_supported),a=!("1"===r.tour_supported),o=!("1"===r.preset_supported),h="0.000000"===r.x_max&&"0.000000"===r.x_min,c="0.000000"===r.y_max&&"0.000000"===r.y_min,u=this.zoomCapabilityDisabled&&this.panRangeDisabled&&this.tiltRangeDisabled,l={zoomCapabilityDisabled:n,position3DUnsupported:u,patternSupported:s,tourSupportedDisabled:a,presetUnSupported:o,tiltRangeDisabled:c,panRangeDisabled:h,type:"nvr"};return l}}).catch(t=>{if(t.error_code)return Promise.resolve(t);throw t})}isDisabled(t,e){return!(Object.prototype.hasOwnProperty.call(t,e)&&"0.000000,0.000000"!==t[e].toString())}getLensMaskValue(){if(this.parentQrCode||this.qrCode)return this.requestor.post("/vms/open/deviceConfig/v1/getMaskInfo",{qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId});{const t={method:"get",lens_mask:{name:"lens_mask_info"}};return this.channel>0?this.requestor.nvrChnPassthrough(this.parentId,this.channel,t):this.requestor.passthrough({devId:this.devId,param:t})}}setLensMaskValue(t=!1){if(this.parentQrCode||this.qrCode)return this.requestor.post("/vms/open/deviceConfig/v1/setMaskInfo",{qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId,enabled:!!t});{const e={method:"set",lens_mask:{lens_mask_info:{enabled:t}}};return this.channel>0?this.requestor.nvrChnPassthrough(this.parentId,this.channel,e):this.requestor.passthrough({devId:this.devId,param:e})}}getTalkCapability(){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getTalkCapability",t)}getMotorCapability(){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getMotorCapability",t)}getMicrophoneCapability(){let t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return this.requestor.post("/vms/open/deviceConfig/v1/getMicrophoneCapability",t)}getModuleSpec(){return this.devCapability.getModuleSpec()}initDrawingBoard(t={}){if(!this.player&&!this.staticImg||this.drawingBoard&&!this.drawingBoard._isDisposed)return null;let{canvasType:e="line",resetCanvas:i=!1,graphLimit:r=100,operateOtherType:n=!1}=t;return this.staticImg?(this.drawingBoard=new DrawingBoard(Object.assign({},{canvasType:e,resetCanvas:i,graphLimit:r,operateOtherType:n},{wrapper:this.parent,cover:!0,staticImg:this.staticImg})),this.drawingBoard):(this.drawingBoard=new DrawingBoard(Object.assign({},{canvasType:e,resetCanvas:i,graphLimit:r,operateOtherType:n},{wrapper:this.parent,videoId:this.player.canvasId,cover:this.isCover})),this.drawingBoard)}}var uo=co;const lo=1,fo=ke("TumsPlayer");class po extends Hs{async startVoiceIntercom(t){this.options.url=t,this.start()}}class go extends Qn{async startVoiceIntercom(t){this.options.url=t,this.start()}}const mo={[mn.RTSP]:po,[mn.RELAY]:go};class vo extends uo{constructor(...t){super(...t),this.drawingBoard=null}async init(t){if(!this.isIniting)if(this.isIniting=!0,this.appKey=t.appKey||"",this.appSecret=t.appSecret||"",this.proxyServer=t.proxyServer||"https://api-smbcloud.tplinkcloud.com.cn/",this.parentId=t.parentId,this.channel=t.channel,this.devId=t.devId,this.parentQrCode=t.parentQrCode||"",this.qrCode=t.qrCode||"",this.channelId=t.channelId||lo,this.requestor=new Ya(t.type===mn.RTSP?{steamType:t.type,urlPrefix:t.queryAddress,authSessionId:t.authSessionId}:{steamType:t.type,urlPrefix:this.proxyServer,appKey:t.appKey,appSecret:t.appSecret}),this.parentQrCode||this.qrCode?this.devCapability=new $a(this.requestor,{parentQrCode:this.parentQrCode,qrCode:this.qrCode,channelId:this.channelId}):this.devCapability=new $a(this.requestor,{parentId:t.parentId,channel:t.channel,devId:t.devId}),await this.destroy(),this.addVideoWrap(),this.options=t,this.type=t.type||mn.RTSP,this.socket=t.socket,this.autoplay=!1!==t.autoplay,this.resolution=t.resolution||"",this.errorHandler=t.errorHandler||null,this.queryCredentials=t.queryCredentials||null,this.pluginPath=t.pluginPath||"",this.isCover=t.cover||!1,this.streamType=t.streamType||"video",this.storageType=t.storageType||"device",this.type===mn.FILE?this.startTime=t.startTime||0:this.startTime=t.startTime||new Date((new Date).toLocaleDateString()).getTime(),this.endTime=t.endTime||this.startTime+864e5,this.scale=t.scale||1,this.eventType=t.eventType||[1,2],this.userId=t.userId||0,this.screenshotEnable=!1!==t.screenshotEnable,this.audioVoiceEnable=!1!==t.audioVoiceEnable,this.talkEnable=t.talkEnable||!1,this.volume=t.volume||0,this.fishEyeDisplayMode=t.fishEyeDisplayMode||"ORIGIN",this.ptzEnable=t.ptzEnable||!1,this.supportVideoEl=t.supportVideoEl||!1,this.encodeType=t.encodeType||"",this.decoderType=t.decoderType||"webcodecs",this.sendInterAduioData="",this.clientUUID=t.clientUUID||"","wasm"===this.decoderType||"webcodecs"===this.decoderType)if("webcodecs"!==this.decoderType||window.VideoDecoder||(this.decoderType="wasm"),"wasm"!==this.decoderType||window.WebAssembly){if(await cr(this.pluginPath),this._startTime=(new Date).getTime(),this.isError=!1,this.type!==mn.HLS){if(this.supportVideoEl?(this.player=new VideoPlayer(this.video,()=>{fo.log("First frame cost: ",(new Date).getTime()-this._startTime),console.log("[TumsPlayer] playing"),this._keepEventSource=!1,this.eventSource.dispatchEvent("playing",this)}),this.video.style.display="inline-block"):this.player=new yo({pluginPath:this.pluginPath,cover:this.isCover,playScale:this.scale,streamType:this.streamType,volume:this.volume,startTime:this.startTime,fishEyeDisplayMode:this.fishEyeDisplayMode,audioVoiceEnable:this.audioVoiceEnable,decoderType:this.decoderType},this.parent,()=>{fo.log("First frame cost: ",(new Date).getTime()-this._startTime),console.log("[TumsPlayer] playing"),this._keepEventSource=!1,this.eventSource.dispatchEvent("playing",this)}),t.url&&t.type)this.url=t.url,this.type=t.type;else if(!this._checkSource(this.video))for(let t=0;t{this.stopVoiceIntercom(),t.detail.type="audio",this.eventSource.dispatchEvent("error",t.detail)}),this.audioClientEventSource.on("sendAudioStream",()=>{this.eventSource.dispatchEvent("sendAudioStream")})}attachClient(){this.detachClient(),this.clientEventSource=new tt(this.client.eventSource),this.clientEventSource.on("tracks",this.onTracks.bind(this)),this.clientEventSource.on("relayConfig",this.onRelayConfig.bind(this)),this.clientEventSource.on("rtspConfig",this.onRTSPConfig.bind(this)),this.clientEventSource.on("fileConfig",this.onFileConfig.bind(this)),this.clientEventSource.on("stream",()=>{this.eventSource.dispatchEvent("stream",this),this.player&&(this.player.isInit=!0)}),this.clientEventSource.on("error",t=>{if(t.detail.code===Me.MEDIA_ERR_DECODER)return this.options.decoderType="wasm",this._keepEventSource=!0,void this.init(this.options);this.isError=!0,this.player&&this.player.stopFlush(),t.detail.code===Me.CLOUD_ERR_FREE&&this.stopVoiceIntercom(),this.eventSource.dispatchEvent("error",t.detail),console.log("[TumsPlayer] disconnected")}),this.clientEventSource.on("disconnected",()=>{this.isError=!0,this.player&&this.player.stopFlush(),this.eventSource.dispatchEvent("disconnected",this),console.log("[TumsPlayer] disconnected")}),this.clientEventSource.on("ended",()=>{this.player&&this.player.stopFlush(),this.eventSource.dispatchEvent("ended",this)}),this.clientEventSource.on("streamFinished",()=>{this.player&&this.player.notifyStreamFinished()}),this.clientEventSource.on("zoom",t=>{this.eventSource.dispatchEvent("zoom",t.detail)}),this.clientEventSource.on("warning",t=>{this.eventSource.dispatchEvent("warning",t.detail)}),this.clientEventSource.on("videoRecordFinished",t=>{this.eventSource.dispatchEvent("videoRecordFinished",t)})}async destroy(){this.clearSessionInterval(),this.client&&(await this.client.destroy(),this.detachClient(),this.client=null,this.transport=null),this.player&&(await this.player.destroy(),this.player=null),this.eventSource&&!this._keepEventSource&&this.eventSource.clear(),this.video&&this.parent.contains(this.video)&&this.parent.removeChild(this.video),this.audioClient&&this.audioClient&&this.audioClient.destroy(),this.drawingBoard&&(this.drawingBoard.destroy(),this.drawingBoard=null)}fullscreen(t,e=!1){this.player&&this.player.requestFullscreen(t,e)}exitFullscreen(){this.player&&this.player.exitFullscreen()}screenshot(t){return this.screenshotEnable?this.player.screenshot&&this.player.screenshot(t):""}startRecording(t){return this.player&&this.player.startRecord?this.player.startRecord(t):Promise.resolve()}stopRecording(t,e){return this.player&&this.player.stopAndblobDownload?this.player.stopAndblobDownload(t,e):Promise.resolve()}getRecordInfo(){return this.player?this.player.getRecordInfo?this.player.getRecordInfo():{size:0,time:0}:{}}async startVoiceIntercom(t){this.talkEnable&&("string"===typeof t&&(t={url:t,mode:"aec"}),await this.initAudio(t),this.audioClient&&this.audioClient.startVoiceIntercom(t.url),this.player&&this.player.setIsTalking&&this.player.setIsTalking(!0))}stopVoiceIntercom(){this.talkEnable&&(this.audioClient&&this.audioClient.destroy(),this.player&&this.player.setIsTalking&&this.player.setIsTalking(!1))}setSpeakerVolume(){this.talkEnable}getImageSwitch(t={isMultiSensor:!1,isMultiSensorchannelId:1}){if(this.parentQrCode||this.qrCode)return this.requestor.post("/vms/open/deviceConfig/v1/getSwitchType",{qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId});{let e=this.channel>0?"chn"+this.channel+"_switch":"switch";t.isMultiSensor&&(e=t.isMultiSensorchannelId>1?"chn"+t.isMultiSensorchannelId+"_switch":"switch");let i=this.channel>0?this.parentId:this.devId;t.isMultiSensor&&(i=this.devId);let r={devId:i,param:{method:"get",image:{name:e}}};return this.requestor.passthrough(r).then(t=>{const i=t.image||{},r=i[e]||{};let n={};return n.flip_type=r["flip_type"]||"",n.rotate_type=r["rotate_type"]||"",n})}}saveImageSwitch(t={flip_type:"",rotate_type:"",isMultiSensor:!1,isMultiSensorchannelId:1}){const{flip_type:e,rotate_type:i,isMultiSensor:r,isMultiSensorchannelId:n}=t;if(this.parentQrCode||this.qrCode){const t={qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId};return rr(e)||Object.assign(t,{flip:e}),rr(i)||Object.assign(t,{rotate:i}),this.requestor.post("/vms/open/deviceConfig/v1/setSwitchType",t)}{const t={};e&&Object.assign(t,{flip_type:e}),i&&Object.assign(t,{rotate_type:i});let s={};if(r){const e=n>1?"chn"+n+"_switch":"switch";s={devId:this.devId,param:{method:"set",image:{[e]:t}}}}else{const e=this.channel>0?"chn"+this.channel+"_switch":"switch";s={devId:this.channel>0?this.parentId:this.devId,param:{method:"set",image:{[e]:t}}}}return this.requestor.passthrough(s)}}getModuleSpec(){return this.devCapability.getModuleSpec()}getScaleCapability(){if(this.parentQrCode||this.qrCode)return this.requestor.post("/vms/open/deviceConfig/v1/getScaleCapability",{qrCode:this.parentQrCode||this.qrCode,channelId:this.channelId})}initDrawingBoard(t={}){if(this.player&&this.player.isInit)return null;let{canvasType:e="line",resetCanvas:i=!1,graphLimit:r=100,operateOtherType:n=!1}=t;return this.drawingBoard=new ae(Object.assign({},{canvasType:e,resetCanvas:i,graphLimit:r,operateOtherType:n},{wrapper:this.parent,videoId:this.player.canvasId,cover:this.isCover})),this.drawingBoard}}class yo extends Cr{constructor(...t){super(...t),this.recorder=null,this.recordChunks=[]}addCanvasWrap(){this.canvasWrapper=document.createElement("div"),$(this.canvasWrapper,{position:"relative",width:"100%",height:"100%",overflow:"hidden",display:"flex",alignItems:"center",justifyContent:"center",flexDirection:"column"}),this.wrapper&&this.wrapper.appendChild(this.canvasWrapper),this.fullEl=new y({el:this.canvasWrapper,autoRotate:!1,disableScroll:!0,nativeFirst:!0}),this.canvas=document.createElement("canvas"),this.canvas.id=this.canvasId,this.canvas.width=this.videoWidth,this.canvas.height=this.videoHeight,this.canvasWrapper.appendChild(this.canvas),this.iframe=document.createElement("iframe"),$(this.iframe,{opacity:0,position:"absolute",zIndex:-1111,left:0,top:0,width:"100%",height:"100%"}),this.iframe.onload=()=>{this.iframe.contentWindow.onresize=()=>{setTimeout(this.resizeCanvas.bind(this))}},this.canvasWrapper.appendChild(this.iframe)}async startRecord({timeslice:t=100,micStream:e=!1}={}){const{canvas:i,audioPlayer:r}=this,n=i.captureStream(30);let s=r.createMediaStream().stream;e&&await navigator.mediaDevices.getUserMedia({audio:!0}).then(t=>{this._mediaStream=t;const e=new AudioContext,i=e.createMediaStreamSource(s),r=e.createMediaStreamSource(t),n=e.createMediaStreamDestination();i.connect(n),r.connect(n),s=n.stream}).catch(()=>{}),this.recorder=new P(n,s,this.client),this.recorder.startRecord(t)}stopRecord(){this.recorder.stopRecord()}getRecordInfo(){return this.recorder.getRecordInfo()}async stopAndblobDownload(t="record",e=!0){return this.recorder.stopAndblobDownload(t,e).then(t=>(this._mediaStream&&this._mediaStream.getAudioTracks()[0].stop(),this._mediaStream=null,t))}requestFullscreen(t,e=!1){this.forceRotate=e,this.fullEl&&this.fullEl.requestFullscreen(),t&&(this.fullscreenCtrlEl=t,this.canvasWrapper.appendChild(t))}exitFullscreen(){this.fullEl&&this.fullEl.exitFullScreen(),this.forceRotate=!1,this.fullscreenCtrlEl&&this.canvasWrapper.removeChild(this.fullscreenCtrlEl)}screenshot(t=!0){if(this.isInit)return;let e=this.canvas.toDataURL();if(t){let t=document.createElement("a");t.href=e,t.download=(new Date).getTime()+".png",t.click()}return e}async destroy(){this.clearCanvasEventListener(),this.clearIframeEventListener(),this.decoderWorker&&sr(this.decoderWorker,this.canvasId),this.noisedecoderWorker&&sr(this.noisedecoderWorker,this.canvasId),this.decoderWorker=null,this.noisedecoderWorker=null,this.webgl&&this.webgl.dispose(),this.webgl=null,this.webglWorker&&sr(this.webglWorker,this.canvasId),this.webglWorker=null,this.canvasWrapper&&this.canvasWrapper.removeChild(this.canvas),this.canvasWrapper&&this.canvasWrapper.removeChild(this.iframe),this.wrapper&&this.wrapper.removeChild(this.canvasWrapper),this.canvasWrapper=null,this.wrapper=null,this.audioPlayer&&this.audioPlayer.close(),this.audioPlayer=null,this.clearVideoQueue(),this.zoomState=0,this.stopFlushInterval(),this.videoDecodeInterval&&clearTimeout(this.videoDecodeInterval)}}var bo=vo;e["default"]=bo},fb2c:function(t,e,i){"use strict";var r=i("74e8");r("Uint32",(function(t){return function(e,i,r){return t(this,e,i,r)}}))},fb6a:function(t,e,i){"use strict";var r=i("23e7"),n=i("e8b5"),s=i("68ee"),a=i("861d"),o=i("23cb"),h=i("07fa"),c=i("fc6a"),u=i("8418"),l=i("b622"),d=i("1dde"),f=i("f36a"),p=d("slice"),g=l("species"),m=Array,v=Math.max;r({target:"Array",proto:!0,forced:!p},{slice:function(t,e){var i,r,l,d=c(this),p=h(d),y=o(t,p),b=o(void 0===e?p:e,p);if(n(d)&&(i=d.constructor,s(i)&&(i===m||n(i.prototype))?i=void 0:a(i)&&(i=i[g],null===i&&(i=void 0)),i===m||void 0===i))return f(d,y,b);for(r=new(void 0===i?m:i)(v(b-y,0)),l=0;yi||d!==d?u*(1/0):u*d}},fc6a:function(t,e,i){"use strict";var r=i("44ad"),n=i("1d80");t.exports=function(t){return r(n(t))}},fc7b:function(t,e,i){var r=i("cbe5"),n=r.extend({type:"heart",shape:{cx:0,cy:0,width:0,height:0},buildPath:function(t,e){var i=e.cx,r=e.cy,n=e.width,s=e.height;t.moveTo(i,r),t.bezierCurveTo(i+n/2,r-2*s/3,i+2*n,r+s/3,i,r+s),t.bezierCurveTo(i-2*n,r+s/3,i-n/2,r-2*s/3,i,r)}});t.exports=n},fce3:function(t,e,i){"use strict";var r=i("d039"),n=i("cfe9"),s=n.RegExp;t.exports=r((function(){var t=s(".","s");return!(t.dotAll&&t.test("\n")&&"s"===t.flags)}))},fd81:function(t,e,i){"use strict";var r=i("69f3"),n=i("dcc3"),s=i("4754"),a=i("7234"),o=i("861d"),h=i("edd0"),c=i("83ab"),u="Incorrect Iterator.range arguments",l="NumericRangeIterator",d=r.set,f=r.getterFor(l),p=RangeError,g=TypeError,m=n((function(t,e,i,r,n,s){if(typeof t!=r||e!==1/0&&e!==-1/0&&typeof e!=r)throw new g(u);if(t===1/0||t===-1/0)throw new p(u);var h,f=e>t,m=!1;if(void 0===i)h=void 0;else if(o(i))h=i.step,m=!!i.inclusive;else{if(typeof i!=r)throw new g(u);h=i}if(a(h)&&(h=f?s:-s),typeof h!=r)throw new g(u);if(h===1/0||h===-1/0||h===n&&t!==e)throw new p(u);var v=t!==t||e!==e||h!==h||e>t!==h>n;d(this,{type:l,start:t,end:e,step:h,inclusive:m,hitsEnd:v,currentCount:n,zero:n}),c||(this.start=t,this.end=e,this.step=h,this.inclusive=m)}),l,(function(){var t=f(this);if(t.hitsEnd)return s(void 0,!0);var e=t.start,i=t.end,r=t.step,n=e+r*t.currentCount++;n===i&&(t.hitsEnd=!0);var a,o=t.inclusive;return a=i>e?o?n>i:n>=i:o?i>n:i>=n,a?(t.hitsEnd=!0,s(void 0,!0)):s(n,!1)})),v=function(t){h(m.prototype,t,{get:function(){return f(this)[t]},set:function(){},configurable:!0,enumerable:!1})};c&&(v("start"),v("end"),v("inclusive"),v("step")),t.exports=m},fd87:function(t,e,i){"use strict";var r=i("74e8");r("Int8",(function(t){return function(e,i,r){return t(this,e,i,r)}}))},fdbc:function(t,e,i){"use strict";t.exports={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}},fdbf:function(t,e,i){"use strict";var r=i("04f8");t.exports=r&&!Symbol.sham&&"symbol"==typeof Symbol.iterator},fe38:function(t,e,i){"use strict";i("7d4a")},ff9c:function(t,e,i){"use strict";var r=i("23e7"),n=i("8eb5"),s=Math.cosh,a=Math.abs,o=Math.E,h=!s||s(710)===1/0;r({target:"Math",stat:!0,forced:h},{cosh:function(t){var e=n(a(t)-1)+1;return(e+1/(e*o*o))*(o/2)}})},fffc:function(t,e,i){"use strict";i("f665")}})})); //# sourceMappingURL=tums-player.umd.min.js.map