@xylink/xy-rtc-sdk 2.1.3-beta.0 → 2.1.3-beta.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/index.es.js +1 -1
- package/lib/index.js +1 -1
- package/lib/src/enum/index.d.ts +5 -1
- package/lib/src/main/client.d.ts +16 -1
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/utils.d.ts +7 -0
- package/lib/src/type/client.d.ts +9 -0
- package/package.json +1 -1
package/lib/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
"use strict";function e(){
|
|
2
2
|
/*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */
|
|
3
|
-
e=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return I()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h={};function d(){}function f(){}function p(){}var v={};c(v,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(x([])));m&&m!==n&&r.call(m,o)&&(v=m);var y=p.prototype=d.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,h;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return f.prototype=p,c(y,"constructor",p),c(p,"constructor",f),f.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},t.awrap=function(e){return{__await:e}},b(S.prototype),c(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function y(e,t){return e(t={exports:{}},t.exports),t.exports}var b,S,w=function(e){return e&&e.Math==Math&&e},k=w("object"==typeof globalThis&&globalThis)||w("object"==typeof window&&window)||w("object"==typeof self&&self)||w("object"==typeof g&&g)||function(){return this}()||Function("return this")(),C=function(e){try{return!!e()}catch(e){return!0}},E=!C((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=!C((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),I=Function.prototype.call,_=x?I.bind(I):function(){return I.apply(I,arguments)},A={}.propertyIsEnumerable,T=Object.getOwnPropertyDescriptor,R={f:T&&!A.call({1:2},1)?function(e){var t=T(this,e);return!!t&&t.enumerable}:A},O=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},D=Function.prototype,N=D.bind,L=D.call,P=x&&N.bind(L,L),M=x?function(e){return e&&P(e)}:function(e){return e&&function(){return L.apply(e,arguments)}},B=M({}.toString),G=M("".slice),j=function(e){return G(B(e),8,-1)},H=Object,U=M("".split),K=C((function(){return!H("z").propertyIsEnumerable(0)}))?function(e){return"String"==j(e)?U(e,""):H(e)}:H,F=TypeError,z=function(e){if(null==e)throw F("Can't call method on "+e);return e},Y=function(e){return K(z(e))},V=function(e){return"function"==typeof e},X=function(e){return"object"==typeof e?null!==e:V(e)},W=function(e){return V(e)?e:void 0},q=function(e,t){return arguments.length<2?W(k[e]):k[e]&&k[e][t]},Z=M({}.isPrototypeOf),J=q("navigator","userAgent")||"",$=k.process,Q=k.Deno,ee=$&&$.versions||Q&&Q.version,te=ee&&ee.v8;te&&(S=(b=te.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!S&&J&&(!(b=J.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=J.match(/Chrome\/(\d+)/))&&(S=+b[1]);var ne=S,re=!!Object.getOwnPropertySymbols&&!C((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ne&&ne<41})),ie=re&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,oe=Object,ae=ie?function(e){return"symbol"==typeof e}:function(e){var t=q("Symbol");return V(t)&&Z(t.prototype,oe(e))},se=String,ce=function(e){try{return se(e)}catch(e){return"Object"}},ue=TypeError,le=function(e){if(V(e))return e;throw ue(ce(e)+" is not a function")},he=function(e,t){var n=e[t];return null==n?void 0:le(n)},de=TypeError,fe=Object.defineProperty,pe=function(e,t){try{fe(k,e,{value:t,configurable:!0,writable:!0})}catch(n){k[e]=t}return t},ve=k["__core-js_shared__"]||pe("__core-js_shared__",{}),ge=y((function(e){(e.exports=function(e,t){return ve[e]||(ve[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),me=Object,ye=function(e){return me(z(e))},be=M({}.hasOwnProperty),Se=Object.hasOwn||function(e,t){return be(ye(e),t)},we=0,ke=Math.random(),Ce=M(1..toString),Ee=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ce(++we+ke,36)},xe=ge("wks"),Ie=k.Symbol,_e=Ie&&Ie.for,Ae=ie?Ie:Ie&&Ie.withoutSetter||Ee,Te=function(e){if(!Se(xe,e)||!re&&"string"!=typeof xe[e]){var t="Symbol."+e;re&&Se(Ie,e)?xe[e]=Ie[e]:xe[e]=ie&&_e?_e(t):Ae(t)}return xe[e]},Re=TypeError,Oe=Te("toPrimitive"),De=function(e,t){if(!X(e)||ae(e))return e;var n,r=he(e,Oe);if(r){if(void 0===t&&(t="default"),n=_(r,e,t),!X(n)||ae(n))return n;throw Re("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&V(n=e.toString)&&!X(r=_(n,e)))return r;if(V(n=e.valueOf)&&!X(r=_(n,e)))return r;if("string"!==t&&V(n=e.toString)&&!X(r=_(n,e)))return r;throw de("Can't convert object to primitive value")}(e,t)},Ne=function(e){var t=De(e,"string");return ae(t)?t:t+""},Le=k.document,Pe=X(Le)&&X(Le.createElement),Me=function(e){return Pe?Le.createElement(e):{}},Be=!E&&!C((function(){return 7!=Object.defineProperty(Me("div"),"a",{get:function(){return 7}}).a})),Ge=Object.getOwnPropertyDescriptor,je={f:E?Ge:function(e,t){if(e=Y(e),t=Ne(t),Be)try{return Ge(e,t)}catch(e){}if(Se(e,t))return O(!_(R.f,e,t),e[t])}},He=E&&C((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=String,Ke=TypeError,Fe=function(e){if(X(e))return e;throw Ke(Ue(e)+" is not an object")},ze=TypeError,Ye=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Xe={f:E?He?function(e,t,n){if(Fe(e),t=Ne(t),Fe(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=Ve(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return Ye(e,t,n)}:Ye:function(e,t,n){if(Fe(e),t=Ne(t),Fe(n),Be)try{return Ye(e,t,n)}catch(e){}if("get"in n||"set"in n)throw ze("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},We=E?function(e,t,n){return Xe.f(e,t,O(1,n))}:function(e,t,n){return e[t]=n,e},qe=Function.prototype,Ze=E&&Object.getOwnPropertyDescriptor,Je=Se(qe,"name"),$e={EXISTS:Je,PROPER:Je&&"something"===function(){}.name,CONFIGURABLE:Je&&(!E||E&&Ze(qe,"name").configurable)},Qe=M(Function.toString);V(ve.inspectSource)||(ve.inspectSource=function(e){return Qe(e)});var et,tt,nt,rt=ve.inspectSource,it=k.WeakMap,ot=V(it)&&/native code/.test(rt(it)),at=ge("keys"),st=function(e){return at[e]||(at[e]=Ee(e))},ct={},ut=k.TypeError,lt=k.WeakMap;if(ot||ve.state){var ht=ve.state||(ve.state=new lt),dt=M(ht.get),ft=M(ht.has),pt=M(ht.set);et=function(e,t){if(ft(ht,e))throw new ut("Object already initialized");return t.facade=e,pt(ht,e,t),t},tt=function(e){return dt(ht,e)||{}},nt=function(e){return ft(ht,e)}}else{var vt=st("state");ct[vt]=!0,et=function(e,t){if(Se(e,vt))throw new ut("Object already initialized");return t.facade=e,We(e,vt,t),t},tt=function(e){return Se(e,vt)?e[vt]:{}},nt=function(e){return Se(e,vt)}}var gt={set:et,get:tt,has:nt,enforce:function(e){return nt(e)?tt(e):et(e,{})},getterFor:function(e){return function(t){var n;if(!X(t)||(n=tt(t)).type!==e)throw ut("Incompatible receiver, "+e+" required");return n}}},mt=y((function(e){var t=$e.CONFIGURABLE,n=gt.enforce,r=gt.get,i=Object.defineProperty,o=E&&!C((function(){return 8!==i((function(){}),"length",{value:8}).length})),a=String(String).split("String"),s=e.exports=function(e,r,s){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),s&&s.getter&&(r="get "+r),s&&s.setter&&(r="set "+r),(!Se(e,"name")||t&&e.name!==r)&&(E?i(e,"name",{value:r,configurable:!0}):e.name=r),o&&s&&Se(s,"arity")&&e.length!==s.arity&&i(e,"length",{value:s.arity});try{s&&Se(s,"constructor")&&s.constructor?E&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=n(e);return Se(c,"source")||(c.source=a.join("string"==typeof r?r:"")),e};Function.prototype.toString=s((function(){return V(this)&&r(this).source||rt(this)}),"toString")})),yt=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;if(V(n)&&mt(n,o,r),r.global)i?e[t]=n:pe(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=n:Xe.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},bt=Math.ceil,St=Math.floor,wt=Math.trunc||function(e){var t=+e;return(t>0?St:bt)(t)},kt=function(e){var t=+e;return t!=t||0===t?0:wt(t)},Ct=Math.max,Et=Math.min,xt=function(e,t){var n=kt(e);return n<0?Ct(n+t,0):Et(n,t)},It=Math.min,_t=function(e){return e>0?It(kt(e),9007199254740991):0},At=function(e){return _t(e.length)},Tt=function(e){return function(t,n,r){var i,o=Y(t),a=At(o),s=xt(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Rt={includes:Tt(!0),indexOf:Tt(!1)},Ot=Rt.indexOf,Dt=M([].push),Nt=function(e,t){var n,r=Y(e),i=0,o=[];for(n in r)!Se(ct,n)&&Se(r,n)&&Dt(o,n);for(;t.length>i;)Se(r,n=t[i++])&&(~Ot(o,n)||Dt(o,n));return o},Lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pt=Lt.concat("length","prototype"),Mt={f:Object.getOwnPropertyNames||function(e){return Nt(e,Pt)}},Bt={f:Object.getOwnPropertySymbols},Gt=M([].concat),jt=q("Reflect","ownKeys")||function(e){var t=Mt.f(Fe(e)),n=Bt.f;return n?Gt(t,n(e)):t},Ht=function(e,t,n){for(var r=jt(t),i=Xe.f,o=je.f,a=0;a<r.length;a++){var s=r[a];Se(e,s)||n&&Se(n,s)||i(e,s,o(t,s))}},Ut=/#|\.prototype\./,Kt=function(e,t){var n=zt[Ft(e)];return n==Vt||n!=Yt&&(V(t)?C(t):!!t)},Ft=Kt.normalize=function(e){return String(e).replace(Ut,".").toLowerCase()},zt=Kt.data={},Yt=Kt.NATIVE="N",Vt=Kt.POLYFILL="P",Xt=Kt,Wt=je.f,qt=function(e,t){var n,r,i,o,a,s=e.target,c=e.global,u=e.stat;if(n=c?k:u?k[s]||pe(s,{}):(k[s]||{}).prototype)for(r in t){if(o=t[r],i=e.dontCallGetSet?(a=Wt(n,r))&&a.value:n[r],!Xt(c?r:s+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Ht(o,i)}(e.sham||i&&i.sham)&&We(o,"sham",!0),yt(n,r,o,e)}},Zt=Object.keys||function(e){return Nt(e,Lt)},Jt=Object.assign,$t=Object.defineProperty,Qt=M([].concat),en=!Jt||C((function(){if(E&&1!==Jt({b:1},Jt($t({},"a",{enumerable:!0,get:function(){$t(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=Jt({},e)[n]||"abcdefghijklmnopqrst"!=Zt(Jt({},t)).join("")}))?function(e,t){for(var n=ye(e),r=arguments.length,i=1,o=Bt.f,a=R.f;r>i;)for(var s,c=K(arguments[i++]),u=o?Qt(Zt(c),o(c)):Zt(c),l=u.length,h=0;l>h;)s=u[h++],E&&!_(a,c,s)||(n[s]=c[s]);return n}:Jt;qt({target:"Object",stat:!0,arity:2,forced:Object.assign!==en},{assign:en});var tn=Array.isArray||function(e){return"Array"==j(e)},nn=TypeError,rn=function(e){if(e>9007199254740991)throw nn("Maximum allowed index exceeded");return e},on=function(e,t,n){var r=Ne(t);r in e?Xe.f(e,r,O(0,n)):e[r]=n},an={};an[Te("toStringTag")]="z";var sn="[object z]"===String(an),cn=Te("toStringTag"),un=Object,ln="Arguments"==j(function(){return arguments}()),hn=sn?j:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=un(e),cn))?n:ln?j(t):"Object"==(r=j(t))&&V(t.callee)?"Arguments":r},dn=function(){},fn=[],pn=q("Reflect","construct"),vn=/^\s*(?:class|function)\b/,gn=M(vn.exec),mn=!vn.exec(dn),yn=function(e){if(!V(e))return!1;try{return pn(dn,fn,e),!0}catch(e){return!1}},bn=function(e){if(!V(e))return!1;switch(hn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return mn||!!gn(vn,rt(e))}catch(e){return!0}};bn.sham=!0;var Sn=!pn||C((function(){var e;return yn(yn.call)||!yn(Object)||!yn((function(){e=!0}))||e}))?bn:yn,wn=Te("species"),kn=Array,Cn=function(e,t){return new(function(e){var t;return tn(e)&&(t=e.constructor,(Sn(t)&&(t===kn||tn(t.prototype))||X(t)&&null===(t=t[wn]))&&(t=void 0)),void 0===t?kn:t}(e))(0===t?0:t)},En=Te("species"),xn=function(e){return ne>=51||!C((function(){var t=[];return(t.constructor={})[En]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},In=Te("isConcatSpreadable"),_n=ne>=51||!C((function(){var e=[];return e[In]=!1,e.concat()[0]!==e})),An=xn("concat"),Tn=function(e){if(!X(e))return!1;var t=e[In];return void 0!==t?!!t:tn(e)};function Rn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}qt({target:"Array",proto:!0,arity:1,forced:!_n||!An},{concat:function(e){var t,n,r,i,o,a=ye(this),s=Cn(a,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(Tn(o=-1===t?a:arguments[t]))for(i=At(o),rn(c+i),n=0;n<i;n++,c++)n in o&&on(s,c,o[n]);else rn(c+1),on(s,c++,o);return s.length=c,s}});var On=sn?{}.toString:function(){return"[object "+hn(this)+"]"};sn||yt(Object.prototype,"toString",On,{unsafe:!0});var Dn,Nn,Ln,Pn,Mn="process"==j(k.process),Bn=String,Gn=TypeError,jn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=M(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Fe(n),function(e){if("object"==typeof e||V(e))return e;throw Gn("Can't set "+Bn(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Hn=Xe.f,Un=Te("toStringTag"),Kn=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Se(e,Un)&&Hn(e,Un,{configurable:!0,value:t})},Fn=Te("species"),zn=function(e){var t=q(e),n=Xe.f;E&&t&&!t[Fn]&&n(t,Fn,{configurable:!0,get:function(){return this}})},Yn=TypeError,Vn=function(e,t){if(Z(t,e))return e;throw Yn("Incorrect invocation")},Xn=TypeError,Wn=function(e){if(Sn(e))return e;throw Xn(ce(e)+" is not a constructor")},qn=Te("species"),Zn=function(e,t){var n,r=Fe(e).constructor;return void 0===r||null==(n=Fe(r)[qn])?t:Wn(n)},Jn=Function.prototype,$n=Jn.apply,Qn=Jn.call,er="object"==typeof Reflect&&Reflect.apply||(x?Qn.bind($n):function(){return Qn.apply($n,arguments)}),tr=M(M.bind),nr=function(e,t){return le(e),void 0===t?e:x?tr(e,t):function(){return e.apply(t,arguments)}},rr=q("document","documentElement"),ir=M([].slice),or=TypeError,ar=function(e,t){if(e<t)throw or("Not enough arguments");return e},sr=/(?:ipad|iphone|ipod).*applewebkit/i.test(J),cr=k.setImmediate,ur=k.clearImmediate,lr=k.process,hr=k.Dispatch,dr=k.Function,fr=k.MessageChannel,pr=k.String,vr=0,gr={};try{Dn=k.location}catch(e){}var mr=function(e){if(Se(gr,e)){var t=gr[e];delete gr[e],t()}},yr=function(e){return function(){mr(e)}},br=function(e){mr(e.data)},Sr=function(e){k.postMessage(pr(e),Dn.protocol+"//"+Dn.host)};cr&&ur||(cr=function(e){ar(arguments.length,1);var t=V(e)?e:dr(e),n=ir(arguments,1);return gr[++vr]=function(){er(t,void 0,n)},Nn(vr),vr},ur=function(e){delete gr[e]},Mn?Nn=function(e){lr.nextTick(yr(e))}:hr&&hr.now?Nn=function(e){hr.now(yr(e))}:fr&&!sr?(Pn=(Ln=new fr).port2,Ln.port1.onmessage=br,Nn=nr(Pn.postMessage,Pn)):k.addEventListener&&V(k.postMessage)&&!k.importScripts&&Dn&&"file:"!==Dn.protocol&&!C(Sr)?(Nn=Sr,k.addEventListener("message",br,!1)):Nn="onreadystatechange"in Me("script")?function(e){rr.appendChild(Me("script")).onreadystatechange=function(){rr.removeChild(this),mr(e)}}:function(e){setTimeout(yr(e),0)});var wr,kr,Cr,Er,xr,Ir,_r,Ar,Tr={set:cr,clear:ur},Rr=/ipad|iphone|ipod/i.test(J)&&void 0!==k.Pebble,Or=/web0s(?!.*chrome)/i.test(J),Dr=je.f,Nr=Tr.set,Lr=k.MutationObserver||k.WebKitMutationObserver,Pr=k.document,Mr=k.process,Br=k.Promise,Gr=Dr(k,"queueMicrotask"),jr=Gr&&Gr.value;jr||(wr=function(){var e,t;for(Mn&&(e=Mr.domain)&&e.exit();kr;){t=kr.fn,kr=kr.next;try{t()}catch(e){throw kr?Er():Cr=void 0,e}}Cr=void 0,e&&e.enter()},sr||Mn||Or||!Lr||!Pr?!Rr&&Br&&Br.resolve?((_r=Br.resolve(void 0)).constructor=Br,Ar=nr(_r.then,_r),Er=function(){Ar(wr)}):Mn?Er=function(){Mr.nextTick(wr)}:(Nr=nr(Nr,k),Er=function(){Nr(wr)}):(xr=!0,Ir=Pr.createTextNode(""),new Lr(wr).observe(Ir,{characterData:!0}),Er=function(){Ir.data=xr=!xr}));var Hr=jr||function(e){var t={fn:e,next:void 0};Cr&&(Cr.next=t),kr||(kr=t,Er()),Cr=t},Ur=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Kr=function(){this.head=null,this.tail=null};Kr.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Fr=Kr,zr=k.Promise,Yr="object"==typeof window&&"object"!=typeof Deno;zr&&zr.prototype;var Vr,Xr,Wr,qr=Te("species"),Zr=!1,Jr=V(k.PromiseRejectionEvent),$r={CONSTRUCTOR:Xt("Promise",(function(){var e=rt(zr),t=e!==String(zr);if(!t&&66===ne)return!0;if(ne>=51&&/native code/.test(e))return!1;var n=new zr((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[qr]=r,!(Zr=n.then((function(){}))instanceof r)||!t&&Yr&&!Jr})),REJECTION_EVENT:Jr,SUBCLASSING:Zr},Qr=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=le(t),this.reject=le(n)},ei={f:function(e){return new Qr(e)}},ti=Tr.set,ni=$r.CONSTRUCTOR,ri=$r.REJECTION_EVENT,ii=$r.SUBCLASSING,oi=gt.getterFor("Promise"),ai=gt.set,si=zr&&zr.prototype,ci=zr,ui=si,li=k.TypeError,hi=k.document,di=k.process,fi=ei.f,pi=fi,vi=!!(hi&&hi.createEvent&&k.dispatchEvent),gi=function(e){var t;return!(!X(e)||!V(t=e.then))&&t},mi=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&ki(t),t.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===e.promise?u(li("Promise-chain cycle")):(r=gi(n))?_(r,n,c,u):c(n)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},yi=function(e,t){e.notified||(e.notified=!0,Hr((function(){for(var n,r=e.reactions;n=r.get();)mi(n,e);e.notified=!1,t&&!e.rejection&&Si(e)})))},bi=function(e,t,n){var r,i;vi?((r=hi.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),k.dispatchEvent(r)):r={promise:t,reason:n},!ri&&(i=k["on"+e])?i(r):"unhandledrejection"===e&&function(e,t){var n=k.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Si=function(e){_(ti,k,(function(){var t,n=e.facade,r=e.value;if(wi(e)&&(t=Ur((function(){Mn?di.emit("unhandledRejection",r,n):bi("unhandledrejection",n,r)})),e.rejection=Mn||wi(e)?2:1,t.error))throw t.value}))},wi=function(e){return 1!==e.rejection&&!e.parent},ki=function(e){_(ti,k,(function(){var t=e.facade;Mn?di.emit("rejectionHandled",t):bi("rejectionhandled",t,e.value)}))},Ci=function(e,t,n){return function(r){e(t,r,n)}},Ei=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yi(e,!0))},xi=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw li("Promise can't be resolved itself");var r=gi(t);r?Hr((function(){var n={done:!1};try{_(r,t,Ci(xi,n,e),Ci(Ei,n,e))}catch(t){Ei(n,t,e)}})):(e.value=t,e.state=1,yi(e,!1))}catch(t){Ei({done:!1},t,e)}}};if(ni&&(ui=(ci=function(e){Vn(this,ui),le(e),_(Vr,this);var t=oi(this);try{e(Ci(xi,t),Ci(Ei,t))}catch(e){Ei(t,e)}}).prototype,(Vr=function(e){ai(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Fr,rejection:!1,state:0,value:void 0})}).prototype=yt(ui,"then",(function(e,t){var n=oi(this),r=fi(Zn(this,ci));return n.parent=!0,r.ok=!V(e)||e,r.fail=V(t)&&t,r.domain=Mn?di.domain:void 0,0==n.state?n.reactions.add(r):Hr((function(){mi(r,n)})),r.promise})),Xr=function(){var e=new Vr,t=oi(e);this.promise=e,this.resolve=Ci(xi,t),this.reject=Ci(Ei,t)},ei.f=fi=function(e){return e===ci||void 0===e?new Xr(e):pi(e)},V(zr)&&si!==Object.prototype)){Wr=si.then,ii||yt(si,"then",(function(e,t){var n=this;return new ci((function(e,t){_(Wr,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete si.constructor}catch(e){}jn&&jn(si,ui)}qt({global:!0,constructor:!0,wrap:!0,forced:ni},{Promise:ci}),Kn(ci,"Promise",!1),zn("Promise");var Ii={},_i=Te("iterator"),Ai=Array.prototype,Ti=function(e){return void 0!==e&&(Ii.Array===e||Ai[_i]===e)},Ri=Te("iterator"),Oi=function(e){if(null!=e)return he(e,Ri)||he(e,"@@iterator")||Ii[hn(e)]},Di=TypeError,Ni=function(e,t){var n=arguments.length<2?Oi(e):t;if(le(n))return Fe(_(n,e));throw Di(ce(e)+" is not iterable")},Li=function(e,t,n){var r,i;Fe(e);try{if(!(r=he(e,"return"))){if("throw"===t)throw n;return n}r=_(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Fe(r),n},Pi=TypeError,Mi=function(e,t){this.stopped=e,this.result=t},Bi=Mi.prototype,Gi=function(e,t,n){var r,i,o,a,s,c,u,l=n&&n.that,h=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=nr(t,l),g=function(e){return r&&Li(r,"normal",e),new Mi(!0,e)},m=function(e){return h?(Fe(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(d)r=e.iterator;else if(f)r=e;else{if(!(i=Oi(e)))throw Pi(ce(e)+" is not iterable");if(Ti(i)){for(o=0,a=At(e);a>o;o++)if((s=m(e[o]))&&Z(Bi,s))return s;return new Mi(!1)}r=Ni(e,i)}for(c=d?e.next:r.next;!(u=_(c,r)).done;){try{s=m(u.value)}catch(e){Li(r,"throw",e)}if("object"==typeof s&&s&&Z(Bi,s))return s}return new Mi(!1)},ji=Te("iterator"),Hi=!1;try{var Ui=0,Ki={next:function(){return{done:!!Ui++}},return:function(){Hi=!0}};Ki[ji]=function(){return this},Array.from(Ki,(function(){throw 2}))}catch(e){}var Fi=function(e,t){if(!t&&!Hi)return!1;var n=!1;try{var r={};r[ji]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},zi=$r.CONSTRUCTOR||!Fi((function(e){zr.all(e).then(void 0,(function(){}))}));qt({target:"Promise",stat:!0,forced:zi},{all:function(e){var t=this,n=ei.f(t),r=n.resolve,i=n.reject,o=Ur((function(){var n=le(t.resolve),o=[],a=0,s=1;Gi(e,(function(e){var c=a++,u=!1;s++,_(n,t,e).then((function(e){u||(u=!0,o[c]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Yi=$r.CONSTRUCTOR,Vi=zr&&zr.prototype;if(qt({target:"Promise",proto:!0,forced:Yi,real:!0},{catch:function(e){return this.then(void 0,e)}}),V(zr)){var Xi=q("Promise").prototype.catch;Vi.catch!==Xi&&yt(Vi,"catch",Xi,{unsafe:!0})}qt({target:"Promise",stat:!0,forced:zi},{race:function(e){var t=this,n=ei.f(t),r=n.reject,i=Ur((function(){var i=le(t.resolve);Gi(e,(function(e){_(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}}),qt({target:"Promise",stat:!0,forced:$r.CONSTRUCTOR},{reject:function(e){var t=ei.f(this);return _(t.reject,void 0,e),t.promise}});var Wi=$r.CONSTRUCTOR;q("Promise"),qt({target:"Promise",stat:!0,forced:Wi},{resolve:function(e){return function(e,t){if(Fe(e),X(t)&&t.constructor===e)return t;var n=ei.f(e);return(0,n.resolve)(t),n.promise}(this,e)}});var qi=/MSIE .\./.test(J),Zi=k.Function,Ji=function(e){return qi?function(t,n){var r=ar(arguments.length,1)>2,i=V(t)?t:Zi(t),o=r?ir(arguments,2):void 0;return e(r?function(){er(i,this,o)}:i,n)}:e},$i={setTimeout:Ji(k.setTimeout),setInterval:Ji(k.setInterval)},Qi=$i.setInterval;qt({global:!0,bind:!0,forced:k.setInterval!==Qi},{setInterval:Qi});var eo=$i.setTimeout;qt({global:!0,bind:!0,forced:k.setTimeout!==eo},{setTimeout:eo});var to=function(e,t){var n=[][e];return!!n&&C((function(){n.call(null,t||function(){return 1},1)}))},no=Rt.indexOf,ro=M([].indexOf),io=!!ro&&1/ro([1],1,-0)<0,oo=to("indexOf");qt({target:"Array",proto:!0,forced:io||!oo},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return io?ro(this,e,t)||0:no(this,e,t)}});var ao=M([].push),so=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,l,h){for(var d,f,p=ye(c),v=K(p),g=nr(u,l),m=At(v),y=0,b=h||Cn,S=t?b(c,m):n||a?b(c,0):void 0;m>y;y++)if((s||y in v)&&(f=g(d=v[y],y,p),e))if(t)S[y]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return y;case 2:ao(S,d)}else switch(e){case 4:return!1;case 7:ao(S,d)}return o?-1:r||i?i:S}},co={forEach:so(0),map:so(1),filter:so(2),some:so(3),every:so(4),find:so(5),findIndex:so(6),filterReject:so(7)},uo=co.filter,lo=xn("filter");qt({target:"Array",proto:!0,forced:!lo},{filter:function(e){return uo(this,e,arguments.length>1?arguments[1]:void 0)}});var ho,fo=String,po=function(e){if("Symbol"===hn(e))throw TypeError("Cannot convert a Symbol value to a string");return fo(e)},vo=function(){var e=Fe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},go=k.RegExp,mo=C((function(){var e=go("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),yo=mo||C((function(){return!go("a","y").sticky})),bo={BROKEN_CARET:mo||C((function(){var e=go("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:yo,UNSUPPORTED_Y:mo},So={f:E&&!He?Object.defineProperties:function(e,t){Fe(e);for(var n,r=Y(t),i=Zt(t),o=i.length,a=0;o>a;)Xe.f(e,n=i[a++],r[n]);return e}},wo=st("IE_PROTO"),ko=function(){},Co=function(e){return"<script>"+e+"<\/script>"},Eo=function(e){e.write(Co("")),e.close();var t=e.parentWindow.Object;return e=null,t},xo=function(){try{ho=new ActiveXObject("htmlfile")}catch(e){}var e,t;xo="undefined"!=typeof document?document.domain&&ho?Eo(ho):((t=Me("iframe")).style.display="none",rr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Co("document.F=Object")),e.close(),e.F):Eo(ho);for(var n=Lt.length;n--;)delete xo.prototype[Lt[n]];return xo()};ct[wo]=!0;var Io,_o,Ao=Object.create||function(e,t){var n;return null!==e?(ko.prototype=Fe(e),n=new ko,ko.prototype=null,n[wo]=e):n=xo(),void 0===t?n:So.f(n,t)},To=k.RegExp,Ro=C((function(){var e=To(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Oo=k.RegExp,Do=C((function(){var e=Oo("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),No=gt.get,Lo=ge("native-string-replace",String.prototype.replace),Po=RegExp.prototype.exec,Mo=Po,Bo=M("".charAt),Go=M("".indexOf),jo=M("".replace),Ho=M("".slice),Uo=(_o=/b*/g,_(Po,Io=/a/,"a"),_(Po,_o,"a"),0!==Io.lastIndex||0!==_o.lastIndex),Ko=bo.BROKEN_CARET,Fo=void 0!==/()??/.exec("")[1];(Uo||Fo||Ko||Ro||Do)&&(Mo=function(e){var t,n,r,i,o,a,s,c=this,u=No(c),l=po(e),h=u.raw;if(h)return h.lastIndex=c.lastIndex,t=_(Mo,h,l),c.lastIndex=h.lastIndex,t;var d=u.groups,f=Ko&&c.sticky,p=_(vo,c),v=c.source,g=0,m=l;if(f&&(p=jo(p,"y",""),-1===Go(p,"g")&&(p+="g"),m=Ho(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Bo(l,c.lastIndex-1))&&(v="(?: "+v+")",m=" "+m,g++),n=new RegExp("^(?:"+v+")",p)),Fo&&(n=new RegExp("^"+v+"$(?!\\s)",p)),Uo&&(r=c.lastIndex),i=_(Po,f?n:c,m),f?i?(i.input=Ho(i.input,g),i[0]=Ho(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Uo&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),Fo&&i&&i.length>1&&_(Lo,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&d)for(i.groups=a=Ao(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=i[s[1]];return i});var zo=Mo;qt({target:"RegExp",proto:!0,forced:/./.exec!==zo},{exec:zo});var Yo=Te("species"),Vo=RegExp.prototype,Xo=function(e,t,n,r){var i=Te(e),o=!C((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!C((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Yo]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||n){var s=M(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var a=M(e),c=t.exec;return c===zo||c===Vo.exec?o&&!i?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));yt(String.prototype,e,c[0]),yt(Vo,i,c[1])}r&&We(Vo[i],"sham",!0)},Wo=M("".charAt),qo=M("".charCodeAt),Zo=M("".slice),Jo=function(e){return function(t,n){var r,i,o=po(z(t)),a=kt(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=qo(o,a))<55296||r>56319||a+1===s||(i=qo(o,a+1))<56320||i>57343?e?Wo(o,a):r:e?Zo(o,a,a+2):i-56320+(r-55296<<10)+65536}},$o={codeAt:Jo(!1),charAt:Jo(!0)},Qo=$o.charAt,ea=function(e,t,n){return t+(n?Qo(e,t).length:1)},ta=TypeError,na=function(e,t){var n=e.exec;if(V(n)){var r=_(n,e,t);return null!==r&&Fe(r),r}if("RegExp"===j(e))return _(zo,e,t);throw ta("RegExp#exec called on incompatible receiver")};Xo("match",(function(e,t,n){return[function(t){var n=z(this),r=null==t?void 0:he(t,e);return r?_(r,t,n):new RegExp(t)[e](po(n))},function(e){var r=Fe(this),i=po(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return na(r,i);var a=r.unicode;r.lastIndex=0;for(var s,c=[],u=0;null!==(s=na(r,i));){var l=po(s[0]);c[u]=l,""===l&&(r.lastIndex=ea(i,_t(r.lastIndex),a)),u++}return 0===u?null:c}]}));var ra=co.map,ia=xn("map");qt({target:"Array",proto:!0,forced:!ia},{map:function(e){return ra(this,e,arguments.length>1?arguments[1]:void 0)}});var oa="\t\n\v\f\r \u2028\u2029\ufeff",aa=M("".replace),sa="["+oa+"]",ca=RegExp("^"+sa+sa+"*"),ua=RegExp(sa+sa+"*$"),la=function(e){return function(t){var n=po(z(t));return 1&e&&(n=aa(n,ca,"")),2&e&&(n=aa(n,ua,"")),n}},ha={start:la(1),end:la(2),trim:la(3)},da=ha.trim,fa=k.parseInt,pa=k.Symbol,va=pa&&pa.iterator,ga=/^[+-]?0x/i,ma=M(ga.exec),ya=8!==fa(oa+"08")||22!==fa(oa+"0x16")||va&&!C((function(){fa(Object(va))}))?function(e,t){var n=da(po(e));return fa(n,t>>>0||(ma(ga,n)?16:10))}:fa;qt({global:!0,forced:parseInt!=ya},{parseInt:ya});var ba=Te("match"),Sa=function(e){var t;return X(e)&&(void 0!==(t=e[ba])?!!t:"RegExp"==j(e))},wa=Array,ka=Math.max,Ca=function(e,t,n){for(var r=At(e),i=xt(t,r),o=xt(void 0===n?r:n,r),a=wa(ka(o-i,0)),s=0;i<o;i++,s++)on(a,s,e[i]);return a.length=s,a},Ea=bo.UNSUPPORTED_Y,xa=Math.min,Ia=[].push,_a=M(/./.exec),Aa=M(Ia),Ta=M("".slice);Xo("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=po(z(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Sa(e))return _(t,r,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,h=new RegExp(e.source,u+"g");(o=_(zo,h,r))&&!((a=h.lastIndex)>l&&(Aa(c,Ta(r,l,o.index)),o.length>1&&o.index<r.length&&er(Ia,c,Ca(o,1)),s=o[0].length,l=a,c.length>=i));)h.lastIndex===o.index&&h.lastIndex++;return l===r.length?!s&&_a(h,"")||Aa(c,""):Aa(c,Ta(r,l)),c.length>i?Ca(c,0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:_(t,this,e,n)}:t,[function(t,n){var i=z(this),o=null==t?void 0:he(t,e);return o?_(o,t,i,n):_(r,po(i),t,n)},function(e,i){var o=Fe(this),a=po(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var c=Zn(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Ea?"g":"y"),h=new c(Ea?"^(?:"+o.source+")":o,l),d=void 0===i?4294967295:i>>>0;if(0===d)return[];if(0===a.length)return null===na(h,a)?[a]:[];for(var f=0,p=0,v=[];p<a.length;){h.lastIndex=Ea?0:p;var g,m=na(h,Ea?Ta(a,p):a);if(null===m||(g=xa(_t(h.lastIndex+(Ea?p:0)),a.length))===f)p=ea(a,p,u);else{if(Aa(v,Ta(a,f,p)),v.length===d)return v;for(var y=1;y<=m.length-1;y++)if(Aa(v,m[y]),v.length===d)return v;p=f=g}}return Aa(v,Ta(a,f)),v}]}),!!C((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ea);var Ra=function(){var e=navigator.userAgent,t=e.toLocaleLowerCase(),n=navigator.platform.toUpperCase().indexOf("MAC")>=0||/macintosh|mac os x/i.test(e),r=navigator.platform.toUpperCase().indexOf("LINUX")>=0,i=/(?:win)/.test(e),o=/(?:Windows Phone)/.test(e),a=/(?:SymbianOS)/.test(e)||o,s=/(?:Android)/.test(e)||t.indexOf("harmony")>-1,c=/(?:Firefox)/.test(e),u=/(?:Chrome|CriOS)/.test(e)&&!(e.indexOf("Edg")>-1),l=e.indexOf("Edg")>-1,h=e.indexOf("Safari")>-1&&!(e.indexOf("Chrome")>-1),d=/iPad/i.test(e)||e.indexOf("MacIntel")>-1&&navigator.maxTouchPoints>1||e.indexOf("Macintosh")>-1&&navigator.maxTouchPoints>1,f=/(?:iPad|PlayBook)/.test(e)||s&&!/(?:Mobile)/.test(e)||c&&/(?:Tablet)/.test(e),p=/(?:iPhone)/.test(e)&&!f,v=!(p||s||a||d),g=e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1||e.indexOf("baiduboxapp")>-1,m=!!t.match(/firefox/)||e.indexOf("Firefox")>-1,y=!!t.match(/tencenttraveler/)||!!t.match(/qqbrowse/)||e.indexOf("QQ/")>-1||e.indexOf("MicroMessenger")>-1,b=e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,S=e.indexOf("HuaweiBrowser")>-1;return{isTablet:f,isPhone:p,isAndroid:s,isPc:v,isMac:n,isWindows:i,isIPad:d,isChrome:u,isLinux:r,isFirefox:m,isBaidu:g,isQQ:y,isOpera:b,isZhazha:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1||e.indexOf("360SE")>-1||e.indexOf("360EE")>-1||e.indexOf("LBBROWSER")>-1||e.indexOf("UC")>-1||e.indexOf("UBrowser")>-1||e.indexOf("UCWEB")>-1||e.indexOf("Quark")>-1||e.indexOf("MiuiBrowser")>-1||e.indexOf("AliApp(TB")>-1||e.indexOf("Weibo")>-1||e.indexOf("IqiyiApp")>-1||e.indexOf("HuaweiBrowser")>-1||e.indexOf("HUAWEI")>-1||e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1||e.indexOf("SE")>-1||e.indexOf("Maxthon")>-1||e.indexOf("The world")>-1||e.indexOf("MetaSr")>-1||e.indexOf("2345Explorer")>-1||e.indexOf("TencentTraveler")>-1||e.indexOf("Mb2345Browser")>-1,isEdge:l,isSafari:h,isHuaweiBrowser:S}},Oa=!Ra().isPc,Da=Ra(),Na={isMinBrowser:function(){var e=!1,t=Da.isChrome,n=Da.isEdge,r=Da.isFirefox;if(t){var i=function(){var e=navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/);if(null!=e&&5==e.length)return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3],patch:e[4]}}();e=(null==i?void 0:i.major)>=72}else if(n){var o=function(){var e=navigator.userAgent.match(/Ed(?:g)\/([0-9]+)\.([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<4))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3]}}();e=(null==o?void 0:o.major)>=80}else if(r){var a=function(){var e=navigator.userAgent.match(/Firefox\/([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<3))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2]}}();e=(null==a?void 0:a.major)>=80}return e},isMobile:function(){var e=!1,t=Da.isPhone,n=Da.isAndroid,r=Da.isIPad;if(n){var i=function(){var e=navigator.userAgent.toLowerCase().match(/android (.*?);/);if(e){var t=e[1].split(".");return{major:(t=t.map((function(e){return parseInt(e,10)})))[0],minor:t[1]}}}()||{major:0,minor:0},o=i.major;i.minor,e=o>=6}else if(t){var a=function(){var e=navigator.userAgent.toLowerCase().match(/cpu( iphone)? os (.*?) like mac os/);if(e){var t=e[2].split("_");return{major:(t=t.map((function(e){return parseInt(e,10)})))[0],minor:t[1]}}}()||{major:0,minor:0},s=a.major,c=a.minor;e=12===s?c>2:s>12}else r&&(e=!0);return e},isFirefox:function(){return Da.isFirefox},isSupportReauthorize:function(){var e=Da.isPhone,t=Da.isSafari,n=Da.isIPad,r=Da.isFirefox,i=Da.isHuaweiBrowser;return!(e||t||n||r||i)},isSupportAppendTrack:function(){return!Da.isFirefox},isSupportUserMedia:function(){var e;return!!(null===(e=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)||!1},isSupportRTC:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={isSupportRTC:!1,isSupportAddtrack:!1,isSupportAddTransceiver:!1,isSupportReplaceTrack:!1,isApplyConstraints:!1,isSupportSetStreams:!1},i=["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection"],o=0;case 3:if(!(o<i.length)){e.next=11;break}if(!(i[o]in window)){e.next=8;break}return r.isSupportRTC=!0,e.abrupt("break",11);case 8:o++,e.next=3;break;case 11:if(!r.isSupportRTC){e.next=17;break}return e.next=14,Na.isSupportPeerCB(t);case 14:a=e.sent,s=a.isSupportPeer,r=Object.assign(Object.assign({},a),{isSupportRTC:s});case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),n)})))},isSupportPeerCB:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){setTimeout((function(){var n;if(RTCPeerConnection){var r,i,o,a=new RTCPeerConnection({iceServers:[]}),s=!1,c=!1,u=!1;if(r=!!(a.createAnswer&&a.createOffer&&a.addEventListener&&a.removeEventListener&&null===a.onnegotiationneeded),i=!!a.addTrack,o=!!(null==a?void 0:a.addTransceiver),t&&(null===(n=null==t?void 0:t.getVideoTracks())||void 0===n?void 0:n.length)&&o){var l=t.getVideoTracks()[0],h=l.getSettings();console.log("setting: ",h);var d=a.addTransceiver(l);d&&(s=!!d.sender.replaceTrack,u=!!d.sender.setStreams),l&&(c=!!l.applyConstraints),d=null}a.close(),e({isSupportPeer:r,isSupportAddtrack:i,isSupportAddTransceiver:o,isSupportReplaceTrack:s,isApplyConstraints:c,isSupportSetStreams:u})}e({isSupportPeer:!1,isSupportAddtrack:!1,isSupportAddTransceiver:!1,isSupportReplaceTrack:!1,isApplyConstraints:!1,isSupportSetStreams:!1})}),100)})));case 1:case"end":return e.stop()}}),n)})))},isSupportWebsocket:function(){return!!window.WebSocket},isSupportMedia:function(){return!!navigator.mediaDevices},isSupportH264:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Da.isFirefox,a=!1,!o){e.next=13;break}return e.prev=3,s=new RTCPeerConnection,e.next=7,s.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 7:c=e.sent,a=((null===(n=null==c?void 0:c.sdp)||void 0===n?void 0:n.toLowerCase().indexOf("h264"))||-1)>-1,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(3);case 13:try{u=(null===(r=RTCRtpSender.getCapabilities("video"))||void 0===r?void 0:r.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],l=(null===(i=RTCRtpReceiver.getCapabilities("video"))||void 0===i?void 0:i.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],(null==u?void 0:u.length)>0&&l.length>0&&(a=!0)}catch(e){}return e.abrupt("return",a);case 15:case"end":return e.stop()}}),t,null,[[3,11]])})))},osVersion:function(){var e=Da.isMac,t=Da.isWindows,n=Da.isLinux,r=Da.isPhone,i=Da.isAndroid,o=Da.isIPad,a="unknown";return e?a="mac":t?a="windows":n?a="linux":r?a="ios":i?a="android":o&&(a="pad"),a},getNetWork:function(){var e=navigator.connection||{};if(e){var t=e.downlink,n=e.effectiveType,r=e.rtt;return{type:e.type,downlink:t,effectiveType:n,rtt:r,downlinkMax:e.downlinkMax,saveData:e.saveData}}return null}},La=Na.isFirefox(),Pa=Xe.f,Ma=Te("unscopables"),Ba=Array.prototype;null==Ba[Ma]&&Pa(Ba,Ma,{configurable:!0,value:Ao(null)});var Ga,ja,Ha,Ua=function(e){Ba[Ma][e]=!0},Ka=!C((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Fa=st("IE_PROTO"),za=Object,Ya=za.prototype,Va=Ka?za.getPrototypeOf:function(e){var t=ye(e);if(Se(t,Fa))return t[Fa];var n=t.constructor;return V(n)&&t instanceof n?n.prototype:t instanceof za?Ya:null},Xa=Te("iterator"),Wa=!1;[].keys&&("next"in(Ha=[].keys())?(ja=Va(Va(Ha)))!==Object.prototype&&(Ga=ja):Wa=!0),(null==Ga||C((function(){var e={};return Ga[Xa].call(e)!==e})))&&(Ga={}),V(Ga[Xa])||yt(Ga,Xa,(function(){return this}));var qa={IteratorPrototype:Ga,BUGGY_SAFARI_ITERATORS:Wa},Za=qa.IteratorPrototype,Ja=function(){return this},$a=$e.PROPER,Qa=$e.CONFIGURABLE,es=qa.IteratorPrototype,ts=qa.BUGGY_SAFARI_ITERATORS,ns=Te("iterator"),rs=function(){return this},is=function(e,t,n,r,i,o,a){!function(e,t,n,r){var i=t+" Iterator";e.prototype=Ao(Za,{next:O(+!r,n)}),Kn(e,i,!1),Ii[i]=Ja}(n,t,r);var s,c,u,l=function(e){if(e===i&&v)return v;if(!ts&&e in f)return f[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",d=!1,f=e.prototype,p=f[ns]||f["@@iterator"]||i&&f[i],v=!ts&&p||l(i),g="Array"==t&&f.entries||p;if(g&&(s=Va(g.call(new e)))!==Object.prototype&&s.next&&(Va(s)!==es&&(jn?jn(s,es):V(s[ns])||yt(s,ns,rs)),Kn(s,h,!0)),$a&&"values"==i&&p&&"values"!==p.name&&(Qa?We(f,"name","values"):(d=!0,v=function(){return _(p,this)})),i)if(c={values:l("values"),keys:o?v:l("keys"),entries:l("entries")},a)for(u in c)(ts||d||!(u in f))&&yt(f,u,c[u]);else qt({target:t,proto:!0,forced:ts||d},c);return f[ns]!==v&&yt(f,ns,v,{name:i}),Ii[t]=v,c},os=Xe.f,as=gt.set,ss=gt.getterFor("Array Iterator"),cs=is(Array,"Array",(function(e,t){as(this,{type:"Array Iterator",target:Y(e),index:0,kind:t})}),(function(){var e=ss(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),us=Ii.Arguments=Ii.Array;if(Ua("keys"),Ua("values"),Ua("entries"),E&&"values"!==us.name)try{os(us,"name",{value:"values"})}catch(e){}var ls=$o.charAt,hs=gt.set,ds=gt.getterFor("String Iterator");is(String,"String",(function(e){hs(this,{type:"String Iterator",string:po(e),index:0})}),(function(){var e,t=ds(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=ls(n,r),t.index+=e.length,{value:e,done:!1})}));var fs={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},ps=Me("span").classList,vs=ps&&ps.constructor&&ps.constructor.prototype,gs=vs===Object.prototype?void 0:vs,ms=Te("iterator"),ys=Te("toStringTag"),bs=cs.values,Ss=function(e,t){if(e){if(e[ms]!==bs)try{We(e,ms,bs)}catch(t){e[ms]=bs}if(e[ys]||We(e,ys,t),fs[t])for(var n in cs)if(e[n]!==cs[n])try{We(e,n,cs[n])}catch(t){e[n]=cs[n]}}};for(var ws in fs)Ss(k[ws]&&k[ws].prototype,ws);Ss(gs,"DOMTokenList");var ks=Date,Cs=M(ks.prototype.getTime);qt({target:"Date",stat:!0},{now:function(){return Cs(new ks)}});var Es=Date.prototype,xs=M(Es.toString),Is=M(Es.getTime);"Invalid Date"!=String(new Date(NaN))&&yt(Es,"toString",(function(){var e=Is(this);return e==e?xs(this):"Invalid Date"}));var _s=co.forEach,As=to("forEach")?[].forEach:function(e){return _s(this,e,arguments.length>1?arguments[1]:void 0)};qt({target:"Array",proto:!0,forced:[].forEach!=As},{forEach:As});var Ts=function(e){if(e&&e.forEach!==As)try{We(e,"forEach",As)}catch(t){e.forEach=As}};for(var Rs in fs)fs[Rs]&&Ts(k[Rs]&&k[Rs].prototype);Ts(gs);var Os=function(e){for(var t=ye(this),n=At(t),r=arguments.length,i=xt(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:xt(o,n);a>i;)t[i++]=e;return t};qt({target:"Array",proto:!0},{fill:Os}),Ua("fill");var Ds=Object.keys,Ns=Array.isArray,Ls="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function Ps(e,t){return"object"!=typeof t||Ds(t).forEach((function(n){e[n]=t[n]})),e}var Ms=Object.getPrototypeOf,Bs={}.hasOwnProperty;function Gs(e,t){return Bs.call(e,t)}function js(e,t){"function"==typeof t&&(t=t(Ms(e))),Ds(t).forEach((function(n){Us(e,n,t[n])}))}var Hs=Object.defineProperty;function Us(e,t,n,r){Hs(e,t,Ps(n&&Gs(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Ks(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Us(e.prototype,"constructor",e),{extend:js.bind(null,e.prototype)}}}}var Fs=Object.getOwnPropertyDescriptor;var zs=[].slice;function Ys(e,t,n){return zs.call(e,t,n)}function Vs(e,t){return t(e)}function Xs(e){if(!e)throw new Error("Assertion Failed")}function Ws(e){Ls.setImmediate?setImmediate(e):setTimeout(e,0)}function qs(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function Zs(e,t){return function(){try{e.apply(this,arguments)}catch(e){t(e)}}}function Js(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}function $s(e,t){if(Gs(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=$s(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:$s(s,t.substr(a+1))}}function Qs(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Xs("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)Qs(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===n?delete e[a]:e[a]=n;else{var c=e[a];c||(c=e[a]={}),Qs(c,s,n)}}else void 0===n?delete e[t]:e[t]=n}}function ec(e){var t={};for(var n in e)Gs(e,n)&&(t[n]=e[n]);return t}var tc=[].concat;function nc(e){return tc.apply([],e)}var rc="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(nc([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Ls[e]})).map((function(e){return Ls[e]}));function ic(e){if(!e||"object"!=typeof e)return e;var t;if(Ns(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(ic(e[n]))}else if(rc.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)Gs(e,i)&&(t[i]=ic(e[i]));return t}function oc(e,t,n,r){return n=n||{},r=r||"",Ds(e).forEach((function(i){if(Gs(t,i)){var o=e[i],a=t[i];"object"==typeof o&&"object"==typeof a&&o&&a&&""+o.constructor==""+a.constructor?oc(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else n[r+i]=void 0})),Ds(t).forEach((function(i){Gs(e,i)||(n[r+i]=t[i])})),n}var ac="undefined"!=typeof Symbol&&Symbol.iterator,sc=ac?function(e){var t;return null!=e&&(t=e[ac])&&t.apply(e)}:function(){return null},cc={};function uc(e){var t,n,r,i;if(1===arguments.length){if(Ns(e))return e.slice();if(this===cc&&"string"==typeof e)return[e];if(i=sc(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var lc="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function hc(e,t){lc=e,dc=t}var dc=function(){return!0},fc=!new Error("").stack;function pc(){if(fc)try{throw pc.arguments,new Error}catch(e){return e}return new Error}function vc(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(dc).map((function(e){return"\n"+e})).join("")):""}var gc=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mc=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(gc),yc={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function bc(e,t){this._e=pc(),this.name=e,this.message=t}function Sc(e,t,n,r){this._e=pc(),this.failures=t,this.failedKeys=r,this.successCount=n}function wc(e,t){this._e=pc(),this.name="BulkError",this.failures=t,this.message=function(e,t){return e+". Errors: "+t.map((function(e){return e.toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}(e,t)}Ks(bc).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+vc(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Ks(Sc).from(bc),Ks(wc).from(bc);var kc=mc.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Cc=bc,Ec=mc.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=pc(),this.name=n,e?"string"==typeof e?(this.message=e,this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=yc[t]||n,this.inner=null)}return Ks(r).from(Cc),e[t]=r,e}),{});Ec.Syntax=SyntaxError,Ec.Type=TypeError,Ec.Range=RangeError;var xc=gc.reduce((function(e,t){return e[t+"Error"]=Ec[t],e}),{});var Ic=mc.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Ec[t]),e}),{});function _c(){}function Ac(e){return e}function Tc(e,t){return null==e||e===Ac?t:function(n){return t(e(n))}}function Rc(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Oc(e,t){return e===_c?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Rc(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Rc(i,this.onerror):i),void 0!==o?o:n}}function Dc(e,t){return e===_c?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Rc(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Rc(r,this.onerror):r)}}function Nc(e,t){return e===_c?t:function(n){var r=e.apply(this,arguments);Ps(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Rc(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Rc(o,this.onerror):o),void 0===r?void 0===a?void 0:a:Ps(r,a)}}function Lc(e,t){return e===_c?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Pc(e,t){return e===_c?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}Ic.ModifyError=Sc,Ic.DexieError=bc,Ic.BulkError=wc;var Mc={},Bc=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=Ls.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),Gc=Bc[0],jc=Bc[1],Hc=Bc[2],Uc=jc&&jc.then,Kc=Gc&&Gc.constructor,Fc=Bc[3],zc=!!Hc,Yc=!1,Vc=Hc?function(){Hc.then(pu)}:Ls.setImmediate?setImmediate.bind(null,pu):Ls.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){pu(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(pu,0)},Xc=function(e,t){nu.push([e,t]),qc&&(Vc(),qc=!1)},Wc=!0,qc=!0,Zc=[],Jc=[],$c=null,Qc=Ac,eu={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Bu,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Bu(e[0],e[1])}catch(e){}}))}},tu=eu,nu=[],ru=0,iu=[];function ou(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=_c,this._lib=!1;var t=this._PSD=tu;if(lc&&(this._stackHolder=pc(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Mc)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&uu(this,this._value))}this._state=null,this._value=null,++t.ref,cu(this,e)}var au={get:function(){var e=tu,t=Eu;function n(n,r){var i=this,o=!e.global&&(e!==tu||t!==Eu);o&&Au();var a=new ou((function(t,a){hu(i,new su(Pu(n,e,o),Pu(r,e,o),t,a,e))}));return lc&&fu(a,this),a}return n.prototype=Mc,n},set:function(e){Us(this,"then",e&&e.prototype===Mc?au:{get:function(){return e},set:au.set})}};function su(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function cu(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&vu();t&&"function"==typeof t.then?cu(e,(function(e,n){t instanceof ou?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,lu(e)),n&&gu()}}),uu.bind(null,e))}catch(t){uu(e,t)}}function uu(e,t){if(Jc.push(t),null===e._state){var n=e._lib&&vu();t=Qc(t),e._state=!1,e._value=t,lc&&null!==t&&"object"==typeof t&&!t._promise&&Js((function(){var n=function e(t,n){var r;return Fs(t,n)||(r=Ms(t))&&e(r,n)}(t,"stack");t._promise=e,Us(t,"stack",{get:function(){return Yc?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Zc.some((function(t){return t._value===e._value}))||Zc.push(e)}(e),lu(e),n&&gu()}}function lu(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)hu(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===ru&&(++ru,Xc((function(){0==--ru&&mu()}),[]))}function hu(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ru,Xc(du,[n,e,t])}else e._listeners.push(t)}function du(e,t,n){try{$c=t;var r,i=t._value;t._state?r=e(i):(Jc.length&&(Jc=[]),r=e(i),-1===Jc.indexOf(i)&&function(e){var t=Zc.length;for(;t;)if(Zc[--t]._value===e._value)return void Zc.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{$c=null,0==--ru&&mu(),--n.psd.ref||n.psd.finalize()}}function fu(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function pu(){vu()&&gu()}function vu(){var e=Wc;return Wc=!1,qc=!1,e}function gu(){var e,t,n;do{for(;nu.length>0;)for(e=nu,nu=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(nu.length>0);Wc=!0,qc=!0}function mu(){var e=Zc;Zc=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=iu.slice(0),n=t.length;n;)t[--n]()}function yu(e){return new ou(Mc,!1,e)}function bu(e,t){var n=tu;return function(){var r=vu(),i=tu;try{return Du(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Du(i,!1),r&&gu()}}}js(ou.prototype,{then:au,_then:function(e,t){hu(this,new su(null,null,e,t,tu))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):yu(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):yu(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),yu(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Yc=!0;var e=function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=vc(s,0)):(o=s,a=""),n.push(o+(a?": "+a:"")+i)}lc&&((i=vc(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r));return n}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Yc=!1}}},timeout:function(e,t){var n=this;return e<1/0?new ou((function(r,i){var o=setTimeout((function(){return i(new Ec.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Us(ou.prototype,Symbol.toStringTag,"Promise"),eu.env=Nu(),js(ou,{all:function(){var e=uc.apply(null,arguments).map(Tu);return new ou((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return ou.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof ou)return e;if(e&&"function"==typeof e.then)return new ou((function(t,n){e.then(t,n)}));var t=new ou(Mc,!0,e);return fu(t,$c),t},reject:yu,race:function(){var e=uc.apply(null,arguments).map(Tu);return new ou((function(t,n){e.map((function(e){return ou.resolve(e).then(t,n)}))}))},PSD:{get:function(){return tu},set:function(e){return tu=e}},newPSD:Iu,usePSD:Lu,scheduler:{get:function(){return Xc},set:function(e){Xc=e}},rejectionMapper:{get:function(){return Qc},set:function(e){Qc=e}},follow:function(e,t){return new ou((function(n,r){return Iu((function(t,n){var r=tu;r.unhandleds=[],r.onunhandled=n,r.finalize=Rc((function(){var e=this;!function(e){iu.push((function t(){e(),iu.splice(iu.indexOf(t),1)})),++ru,Xc((function(){0==--ru&&mu()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}});var Su={awaits:0,echoes:0,id:0},wu=0,ku=[],Cu=0,Eu=0,xu=0;function Iu(e,t,n,r){var i=tu,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++xu;var a=eu.env;o.env=zc?{Promise:ou,PromiseProp:{value:ou,configurable:!0,writable:!0},all:ou.all,race:ou.race,resolve:ou.resolve,reject:ou.reject,nthen:Mu(a.nthen,o),gthen:Mu(a.gthen,o)}:{},t&&Ps(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Lu(o,e,n,r);return 0===o.ref&&o.finalize(),s}function _u(){return Su.id||(Su.id=++wu),++Su.awaits,Su.echoes+=7,Su.id}function Au(e){!Su.awaits||e&&e!==Su.id||(0==--Su.awaits&&(Su.id=0),Su.echoes=7*Su.awaits)}function Tu(e){return Su.echoes&&e&&e.constructor===Kc?(_u(),e.then((function(e){return Au(),e}),(function(e){return Au(),Gu(e)}))):e}function Ru(e){++Eu,Su.echoes&&0!=--Su.echoes||(Su.echoes=Su.id=0),ku.push(tu),Du(e,!0)}function Ou(){var e=ku[ku.length-1];ku.pop(),Du(e,!1)}function Du(e,t){var n,r=tu;if((t?!Su.echoes||Cu++&&e===tu:!Cu||--Cu&&e===tu)||(n=t?Ru.bind(null,e):Ou,Uc.call(Gc,n)),e!==tu&&(tu=e,r===eu&&(eu.env=Nu()),zc)){var i=eu.env.Promise,o=e.env;jc.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(Ls,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function Nu(){var e=Ls.Promise;return zc?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ls,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:jc.then,gthen:e.prototype.then}:{}}function Lu(e,t,n,r,i){var o=tu;try{return Du(e,!0),t(n,r,i)}finally{Du(o,!1)}}function Pu(e,t,n){return"function"!=typeof e?e:function(){var r=tu;n&&_u(),Du(t,!0);try{return e.apply(this,arguments)}finally{Du(r,!1)}}}function Mu(e,t){return function(n,r){return e.call(this,Pu(n,t,!1),Pu(r,t,!1))}}function Bu(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Ls.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ps(r,i)):Ls.CustomEvent&&Ps(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Ls.dispatchEvent&&(dispatchEvent(r),!Ls.PromiseRejectionEvent&&Ls.onunhandledrejection))try{Ls.onunhandledrejection(r)}catch(e){}r.defaultPrevented||console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var Gu=ou.reject;function ju(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return a(e);r||(r=Lc),i||(i=_c);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function a(e){Ds(e).forEach((function(t){var n=e[t];if(Ns(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Ec.InvalidArgument("Invalid event config");var r=o(t,Ac,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Ws((function(){e.apply(null,t)}))}))}))}}))}}var Hu,Uu=String.fromCharCode(65535),Ku=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(e){return Uu}}(),Fu="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",zu=[],Yu="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Vu=Yu,Xu=Yu,Wu=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)};function qu(e,t){var n,r,i,o,a,s=qu.dependencies,c=Ps({addons:qu.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange},t),u=c.addons,l=c.autoOpen,h=c.indexedDB,d=c.IDBKeyRange,f=this._dbSchema={},p=[],v=[],g={},m=null,y=null,b=!1,S=null,w=!1,k="readwrite",C=this,E=new ou((function(e){n=e})),x=new ou((function(e,t){r=t})),I=!0,_=!!al(h);function A(e){this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null},this.stores({})}function T(e,t,n){var r=C._createTransaction(k,v,f);r.create(t),r._completion.catch(n);var i=r._reject.bind(r);Iu((function(){tu.trans=r,0===e?(Ds(f).forEach((function(e){R(t,e,f[e].primKey,f[e].indexes)})),ou.follow((function(){return C.on.populate.fire(r)})).catch(i)):function(e,t,n){var r=[],i=p.filter((function(t){return t._cfg.version===e}))[0];if(!i)throw new Ec.Upgrade("Dexie specification of currently installed DB version is missing");f=C._dbSchema=i._cfg.dbschema;var o=!1;function a(){return r.length?ou.resolve(r.shift()(t.idbtrans)).then(a):ou.resolve()}return p.filter((function(t){return t._cfg.version>e})).forEach((function(e){r.push((function(){var r=f,i=e._cfg.dbschema;Z(r,n),Z(i,n),f=C._dbSchema=i;var a=function(e,t){var n={del:[],add:[],change:[]};for(var r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src!==o.primKey.src)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName;for(var u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],h=c[u];l?l.src!==h.src&&a.change.push(h):a.add.push(h)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}(r,i);if(a.add.forEach((function(e){R(n,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new Ec.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){O(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),O(t,e)})),e.del.forEach((function(e){t.deleteIndex(e)}))})),e._cfg.contentUpgrade)return o=!0,ou.follow((function(){e._cfg.contentUpgrade(t)}))})),r.push((function(t){o&&Vu||function(e,t){for(var n=0;n<t.db.objectStoreNames.length;++n){var r=t.db.objectStoreNames[n];null==e[r]&&t.db.deleteObjectStore(r)}}(e._cfg.dbschema,t)}))})),a().then((function(){!function(e,t){Ds(e).forEach((function(n){t.db.objectStoreNames.contains(n)||R(t,n,e[n].primKey,e[n].indexes)}))}(f,n)}))}(e,r,t).catch(i)}))}function R(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){O(i,e)})),i}function O(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function D(e,t,n){var r=arguments.length;if(r<2)throw new Ec.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=nc(i);return[e,o,n]}function N(e,t,n){this.name=e,this.schema=t,this._tx=n,this.hook=g[e]?g[e].hook:ju(null,{creating:[Oc,_c],reading:[Tc,Ac],updating:[Nc,_c],deleting:[Dc,_c]})}function L(e,t,n){return(n?el:$u)((function(n){e.push(n),t&&t()}))}function P(e,t,n,r,i){return new ou((function(o,a){var s=n.length,c=s-1;if(0===s)return o();if(r){var u,l=el(a),h=Ju(null);Js((function(){for(var r=0;r<s;++r){u={onsuccess:null,onerror:null};var a=n[r];i.call(u,a[0],a[1],t);var d=e.delete(a[0]);d._hookCtx=u,d.onerror=l,d.onsuccess=r===c?Ju(o):h}}),(function(e){throw u.onerror&&u.onerror(e),e}))}else for(var d=0;d<s;++d){var f=e.delete(n[d]);f.onerror=$u(a),d===c&&(f.onsuccess=bu((function(){return o()})))}}))}function M(e,t,n,r){var i=this;this.db=C,this.mode=e,this.storeNames=t,this.idbtrans=null,this.on=ju(this,"complete","error","abort"),this.parent=r||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ou((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),Gu(e)}))}function B(e,t,n){this._ctx={table:e,index:":id"===t?null:t,or:n}}function G(e,t){var n=null,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx,o=i.table;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:o.hook.reading.fire}}function j(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function H(e,t){return e._cfg.version-t._cfg.version}function U(e,t,n){t.forEach((function(t){var r=n[t];e.forEach((function(e){t in e||(e===M.prototype||e instanceof M?Us(e,t,{get:function(){return this.table(t)}}):e[t]=new N(t,r))}))}))}function K(e,t,n,r,i,o){var a=bu(o?function(e,t,r){return n(o(e),t,r)}:n,i);e.onerror||(e.onerror=$u(i)),e.onsuccess=Zs(t?function(){var n=e.result;if(n){var o=function(){n.continue()};t(n,(function(e){o=e}),r,i)&&a(n.value,n,(function(e){o=e})),o()}else r()}:function(){var t=e.result;if(t){var n=function(){t.continue()};a(t.value,t,(function(e){n=e})),n()}else r()},i)}function F(e,t){return h.cmp(e,t)}function z(e,t){return F(e,t)>0?e:t}function Y(e,t){return h.cmp(e,t)}function V(e,t){return h.cmp(t,e)}function X(e,t){return e<t?-1:e===t?0:1}function W(e,t){return e>t?-1:e===t?0:1}function q(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function Z(e,t){for(var n=t.db.objectStoreNames,r=0;r<n.length;++r){var o=n[r],a=t.objectStore(o);i="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+Ys(u).join("+")+"]";if(e[o]){var h=e[o].idxByName[l];h&&(h.name=c)}}}/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ls.WorkerGlobalScope&&Ls instanceof Ls.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(i=!1)}function J(e){C.on("blocked").fire(e),zu.filter((function(e){return e.name===C.name&&e!==C&&!e._vcFired})).map((function(t){return t.on("versionchange").fire(e)}))}this.version=function(e){if(m||b)throw new Ec.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=p.filter((function(t){return t._cfg.version===e}))[0];return t||(t=new A(e),p.push(t),p.sort(H),I=!1,t)},Ps(A.prototype,{stores:function(e){this._cfg.storesSource=this._cfg.storesSource?Ps(this._cfg.storesSource,e):e;var t={};p.forEach((function(e){Ps(t,e._cfg.storesSource)}));var n=this._cfg.dbschema={};return this._parseStoresSpec(t,n),f=C._dbSchema=n,[g,C,M.prototype].forEach((function(e){for(var t in e)e[t]instanceof N&&delete e[t]})),U([g,C,M.prototype,this._cfg.tables],Ds(n),n),v=Ds(n),this},upgrade:function(e){return this._cfg.contentUpgrade=e,this},_parseStoresSpec:function(e,t){Ds(e).forEach((function(n){if(null!==e[n]){var r={},i=function(e){var t=[];return e.split(",").forEach((function(e){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;t.push(new rl(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Ns(r),/\./.test(e)))})),t}(e[n]),o=i.shift();if(o.multi)throw new Ec.Schema("Primary key cannot be multi-valued");o.keyPath&&Qs(r,o.keyPath,o.auto?0:o.keyPath),i.forEach((function(e){if(e.auto)throw new Ec.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Ec.Schema("Index must have a name and cannot be an empty string");Qs(r,e.keyPath,e.compound?e.keyPath.map((function(){return""})):"")})),t[n]=new il(n,o,i,r)}}))}}),this._allTables=g,this._createTransaction=function(e,t,n,r){return new M(e,t,n,r)},this._whenReady=function(e){return w||tu.letThrough?e():new ou((function(e,t){if(!b){if(!l)return void t(new Ec.DatabaseClosed);C.open().catch(_c)}E.then(e,t)})).then(e)},this.verno=0,this.open=function(){if(b||m)return E.then((function(){return y?Gu(y):C}));lc&&(x._stackHolder=pc()),b=!0,y=null,w=!1;var t=n,r=null;return ou.race([x,new ou((function(t,n){if(!h)throw new Ec.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var i=I?h.open(e):h.open(e,Math.round(10*C.verno));if(!i)throw new Ec.MissingAPI("IndexedDB API not available");i.onerror=$u(n),i.onblocked=bu(J),i.onupgradeneeded=bu((function(t){if(r=i.transaction,I&&!C._allowEmptyDB){i.onerror=tl,r.abort(),i.result.close();var o=h.deleteDatabase(e);o.onsuccess=o.onerror=bu((function(){n(new Ec.NoSuchDatabase("Database "+e+" doesnt exist"))}))}else{r.onerror=$u(n),T((t.oldVersion>Math.pow(2,62)?0:t.oldVersion)/10,r,n)}}),n),i.onsuccess=bu((function(){if(r=null,m=i.result,zu.push(C),I)!function(){if(C.verno=m.version/10,C._dbSchema=f={},0===(v=Ys(m.objectStoreNames,0)).length)return;var e=m.transaction(ol(v),"readonly");v.forEach((function(t){for(var n=e.objectStore(t),r=n.keyPath,i=r&&"string"==typeof r&&-1!==r.indexOf("."),o=new rl(r,r||"",!1,!1,!!n.autoIncrement,r&&"string"!=typeof r,i),a=[],s=0;s<n.indexNames.length;++s){var c=n.index(n.indexNames[s]);i=(r=c.keyPath)&&"string"==typeof r&&-1!==r.indexOf(".");var u=new rl(c.name,r,!!c.unique,!!c.multiEntry,!1,r&&"string"!=typeof r,i);a.push(u)}f[t]=new il(t,o,a,{})})),U([g],Ds(f),f)}();else if(m.objectStoreNames.length>0)try{Z(f,m.transaction(ol(m.objectStoreNames),"readonly"))}catch(e){}m.onversionchange=bu((function(e){C._vcFired=!0,C.on("versionchange").fire(e)})),_||"__dbnames"===e||Hu.dbnames.put({name:e}).catch(_c),t()}),n)}))]).then((function(){return S=[],ou.resolve(qu.vip(C.on.ready.fire)).then((function e(){if(S.length>0){var t=S.reduce(Pc,_c);return S=[],ou.resolve(qu.vip(t)).then(e)}}))})).finally((function(){S=null})).then((function(){return b=!1,C})).catch((function(e){try{r&&r.abort()}catch(e){}return b=!1,C.close(),Gu(y=e)})).finally((function(){w=!0,t()}))},this.close=function(){var e=zu.indexOf(C);if(e>=0&&zu.splice(e,1),m){try{m.close()}catch(e){}m=null}l=!1,y=new Ec.DatabaseClosed,b&&r(y),E=new ou((function(e){n=e})),x=new ou((function(e,t){r=t}))},this.delete=function(){var t=arguments.length>0;return new ou((function(n,r){if(t)throw new Ec.InvalidArgument("Arguments not allowed in db.delete()");function i(){C.close();var t=h.deleteDatabase(e);t.onsuccess=bu((function(){_||Hu.dbnames.delete(e).catch(_c),n()})),t.onerror=$u(r),t.onblocked=J}b?E.then(i):i()}))},this.backendDB=function(){return m},this.isOpen=function(){return null!==m},this.hasBeenClosed=function(){return y&&y instanceof Ec.DatabaseClosed},this.hasFailed=function(){return null!==y},this.dynamicallyOpened=function(){return I},this.name=e,js(this,{tables:{get:function(){return Ds(g).map((function(e){return g[e]}))}}}),this.on=ju(this,"populate","blocked","versionchange",{ready:[Pc,_c]}),this.on.ready.subscribe=Vs(this.on.ready.subscribe,(function(e){return function(t,n){qu.vip((function(){w?(y||ou.resolve().then(t),n&&e(t)):S?(S.push(t),n&&e(t)):(e(t),n||e((function e(){C.on.ready.unsubscribe(t),C.on.ready.unsubscribe(e)})))}))}})),this.transaction=function(){var e=D.apply(this,arguments);return this._transaction.apply(this,e)},this._transaction=function(e,t,n){var r=tu.trans;r&&r.db===C&&-1===e.indexOf("!")||(r=null);var i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{var o=t.map((function(e){var t=e instanceof N?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}));if("r"==e||"readonly"==e)e="readonly";else{if("rw"!=e&&e!=k)throw new Ec.InvalidArgument("Invalid transaction mode: "+e);e=k}if(r){if("readonly"===r.mode&&e===k){if(!i)throw new Ec.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((function(e){if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new Ec.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,(function(t,n){n(e)})):Gu(e)}return r?r._promise(e,a,"lock"):tu.trans?Lu(tu.transless,(function(){return C._whenReady(a)})):C._whenReady(a);function a(){return ou.resolve().then((function(){var t,i=tu.transless||tu,a=C._createTransaction(e,o,f,r),s={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create(),n.constructor===Fc&&_u();var c=ou.follow((function(){if(t=n.call(a,a))if(t.constructor===Kc){var e=Au.bind(null,null);t.then(e,e)}else"function"==typeof t.next&&"function"==typeof t.throw&&(t=nl(t))}),s);return(t&&"function"==typeof t.then?ou.resolve(t).then((function(e){return a.active?e:Gu(new Ec.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):c.then((function(){return t}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),Gu(e)}))}))}},this.table=function(e){if(!Gs(g,e))throw new Ec.InvalidTable("Table "+e+" does not exist");return g[e]},js(N.prototype,{_trans:function(e,t,n){var r=this._tx||tu.trans;return r&&r.db===C?r===tu.trans?r._promise(e,t,n):Iu((function(){return r._promise(e,t,n)}),{trans:r,transless:tu.transless||tu}):function e(t,n,r){if(w||tu.letThrough){var i=C._createTransaction(t,n,f);try{i.create()}catch(e){return Gu(e)}return i._promise(t,(function(e,t){return Iu((function(){return tu.trans=i,r(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!b){if(!l)return Gu(new Ec.DatabaseClosed);C.open().catch(_c)}return E.then((function(){return e(t,n,r)}))}(e,[this.name],t)},_idbstore:function(e,t,n){var r=this.name;return this._trans(e,(function(e,n,i){if(-1===i.storeNames.indexOf(r))throw new Ec.NotFound("Table"+r+" not part of transaction");return t(e,n,i.idbtrans.objectStore(r),i)}),n)},get:function(e,t){if(e&&e.constructor===Object)return this.where(e).first(t);var n=this;return this._idbstore("readonly",(function(t,r,i){var o=i.get(e);o.onerror=$u(r),o.onsuccess=bu((function(){t(n.hook.reading.fire(o.result))}),r)})).then(t)},where:function(e){if("string"==typeof e)return new B(this,e);if(Ns(e))return new B(this,"["+e.join("+")+"]");var t=Ds(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&Ku!==Uu)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));n||console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,i=t.reduce((function(t,n){return[t[0]||r[n],t[0]||!r[n]?q(t[1],(function(t){return""+$s(t,n)==""+e[n]})):t[1]]}),[null,null]),o=i[0];return o?this.where(o.name).equals(e[o.keyPath]).filter(i[1]):n?this.filter(i[1]):this.where(t).equals("")},count:function(e){return this.toCollection().count(e)},offset:function(e){return this.toCollection().offset(e)},limit:function(e){return this.toCollection().limit(e)},reverse:function(){return this.toCollection().reverse()},filter:function(e){return this.toCollection().and(e)},each:function(e){return this.toCollection().each(e)},toArray:function(e){return this.toCollection().toArray(e)},orderBy:function(e){return new G(new B(this,Ns(e)?"["+e.join("+")+"]":e))},toCollection:function(){return new G(new B(this))},mapToClass:function(e,t){this.schema.mappedClass=e;var n=Object.create(e.prototype);t&&Zu(n,t),this.schema.instanceTemplate=n;var r=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(Gs(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=r,this.hook("reading",r),e},defineClass:function(e){return this.mapToClass(qu.defineClass(e),e)},bulkDelete:function(e){return this.hook.deleting.fire===_c?this._idbstore(k,(function(t,n,r,i){t(P(r,i,e,!1,_c))})):this.where(":id").anyOf(e).delete().then((function(){}))},bulkPut:function(e,t){var n=this;return this._idbstore(k,(function(r,i,o){if(!o.keyPath&&!n.schema.primKey.auto&&!t)throw new Ec.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new Ec.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ec.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return r();var a,s,c=function(e){0===u.length?r(e):i(new wc(n.name+".bulkPut(): "+u.length+" of "+l+" operations failed",u))},u=[],l=e.length,h=n;if(n.hook.creating.fire===_c&&n.hook.updating.fire===_c){s=L(u);for(var d=0,f=e.length;d<f;++d)(a=t?o.put(e[d],t[d]):o.put(e[d])).onerror=s;a.onerror=L(u,c),a.onsuccess=Qu(c)}else{var p=t||o.keyPath&&e.map((function(e){return $s(e,o.keyPath)})),v=p&&qs(p,(function(t,n){return null!=t&&[t,e[n]]}));(p?h.where(":id").anyOf(p.filter((function(e){return null!=e}))).modify((function(){this.value=v[this.primKey],v[this.primKey]=null})).catch(Sc,(function(e){u=e.failures})).then((function(){for(var n=[],r=t&&[],i=p.length-1;i>=0;--i){var o=p[i];(null==o||v[o])&&(n.push(e[i]),t&&r.push(o),null!=o&&(v[o]=null))}return n.reverse(),t&&r.reverse(),h.bulkAdd(n,r)})).then((function(e){var t=p[p.length-1];return null!=t?t:e})):h.bulkAdd(e)).then(c).catch(wc,(function(e){u=u.concat(e.failures),c()})).catch(i)}}),"locked")},bulkAdd:function(e,t){var n=this,r=this.hook.creating.fire;return this._idbstore(k,(function(i,o,a,s){if(!a.keyPath&&!n.schema.primKey.auto&&!t)throw new Ec.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(a.keyPath&&t)throw new Ec.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ec.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return i();function c(e){0===d.length?i(e):o(new wc(n.name+".bulkAdd(): "+d.length+" of "+f+" operations failed",d))}var u,l,h,d=[],f=e.length;if(r!==_c){var p,v=a.keyPath;l=L(d,null,!0),h=Ju(null),Js((function(){for(var n=0,i=e.length;n<i;++n){p={onerror:null,onsuccess:null};var o=t&&t[n],c=e[n],d=t?o:v?$s(c,v):void 0,f=r.call(p,d,c,s);null==d&&null!=f&&(v?Qs(c=ic(c),v,f):o=f),(u=null!=o?a.add(c,o):a.add(c))._hookCtx=p,n<i-1&&(u.onerror=l,p.onsuccess&&(u.onsuccess=h))}}),(function(e){throw p.onerror&&p.onerror(e),e})),u.onerror=L(d,c,!0),u.onsuccess=Ju(c)}else{l=L(d);for(var g=0,m=e.length;g<m;++g)(u=t?a.add(e[g],t[g]):a.add(e[g])).onerror=l;u.onerror=L(d,c),u.onsuccess=Qu(c)}}))},add:function(e,t){var n=this.hook.creating.fire;return this._idbstore(k,(function(r,i,o,a){var s={onsuccess:null,onerror:null};if(n!==_c){var c=null!=t?t:o.keyPath?$s(e,o.keyPath):void 0,u=n.call(s,c,e,a);null==c&&null!=u&&(o.keyPath?Qs(e,o.keyPath,u):t=u)}try{var l=null!=t?o.add(e,t):o.add(e);l._hookCtx=s,l.onerror=el(i),l.onsuccess=Ju((function(t){var n=o.keyPath;n&&Qs(e,n,t),r(t)}))}catch(e){throw s.onerror&&s.onerror(e),e}}))},put:function(e,t){var n=this,r=this.hook.creating.fire,i=this.hook.updating.fire;if(r!==_c||i!==_c){var o=this.schema.primKey.keyPath,a=void 0!==t?t:o&&$s(e,o);return null==a?this.add(e):(e=ic(e),this._trans(k,(function(){return n.where(":id").equals(a).modify((function(){this.value=e})).then((function(r){return 0===r?n.add(e,t):a}))}),"locked"))}return this._idbstore(k,(function(n,r,i){var o=void 0!==t?i.put(e,t):i.put(e);o.onerror=$u(r),o.onsuccess=bu((function(t){var r=i.keyPath;r&&Qs(e,r,t.target.result),n(o.result)}))}))},delete:function(e){return this.hook.deleting.subscribers.length?this.where(":id").equals(e).delete():this._idbstore(k,(function(t,n,r){var i=r.delete(e);i.onerror=$u(n),i.onsuccess=bu((function(){t(i.result)}))}))},clear:function(){return this.hook.deleting.subscribers.length?this.toCollection().delete():this._idbstore(k,(function(e,t,n){var r=n.clear();r.onerror=$u(t),r.onsuccess=bu((function(){e(r.result)}))}))},update:function(e,t){if("object"!=typeof t||Ns(t))throw new Ec.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||Ns(e))return this.where(":id").equals(e).modify(t);Ds(t).forEach((function(n){Qs(e,n,t[n])}));var n=$s(e,this.schema.primKey.keyPath);return void 0===n?Gu(new Ec.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}}),js(M.prototype,{_lock:function(){return Xs(!tu.global),++this._reculock,1!==this._reculock||tu.global||(tu.lockOwnerFor=this),this},_unlock:function(){if(Xs(!tu.global),0==--this._reculock)for(tu.global||(tu.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Lu(e[1],e[0])}catch(e){}}return this},_locked:function(){return this._reculock&&tu.lockOwnerFor!==this},create:function(e){var t=this;if(!this.mode)return this;if(Xs(!this.idbtrans),!e&&!m)switch(y&&y.name){case"DatabaseClosedError":throw new Ec.DatabaseClosed(y);case"MissingAPIError":throw new Ec.MissingAPI(y.message,y);default:throw new Ec.OpenFailed(y)}if(!this.active)throw new Ec.TransactionInactive;return Xs(null===this._completion._state),(e=this.idbtrans=e||m.transaction(ol(this.storeNames),this.mode)).onerror=bu((function(n){tl(n),t._reject(e.error)})),e.onabort=bu((function(n){tl(n),t.active&&t._reject(new Ec.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=bu((function(){t.active=!1,t._resolve()})),this},_promise:function(e,t,n){var r=this;if(e===k&&this.mode!==k)return Gu(new Ec.ReadOnly("Transaction is readonly"));if(!this.active)return Gu(new Ec.TransactionInactive);if(this._locked())return new ou((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},tu])}));if(n)return Iu((function(){var e=new ou((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new ou((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},_root:function(){return this.parent?this.parent._root():this},waitFor:function(e){var t=this._root();if(e=ou.resolve(e),t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return e}));else{t._waitingFor=e,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var r=t._waitingFor;return new ou((function(n,i){e.then((function(e){return t._waitingQueue.push(bu(n.bind(null,e)))}),(function(e){return t._waitingQueue.push(bu(i.bind(null,e)))})).finally((function(){t._waitingFor===r&&(t._waitingFor=null)}))}))},abort:function(){this.active&&this._reject(new Ec.Abort),this.active=!1},tables:{get:(o="Transaction.tables",a=function(){return g},function(){return console.warn(o+" is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. "+vc(pc(),1)),a.apply(this,arguments)})},table:function(e){return new N(e,C.table(e).schema,this)}}),js(B.prototype,(function(){function e(e,t,n){var r=e instanceof B?new G(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function t(e){return new G(e,(function(){return d.only("")})).limit(0)}function n(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==r[c])return i(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):i(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<r.length&&"next"===o?e+n.substr(e.length):a<e.length&&"prev"===o?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function r(t,r,i,o){var a,s,c,u,l,h,f,p=i.length;if(!i.every((function(e){return"string"==typeof e})))return e(t,"String expected.");function v(e){a=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),s=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),c="next"===e?X:W;var t=i.map((function(e){return{lower:s(e),upper:a(e)}})).sort((function(e,t){return c(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),l=t.map((function(e){return e.lower})),h=e,f="next"===e?"":o}v("next");var g=new G(t,(function(){return d.bound(u[0],l[p-1]+o)}));g._ondirectionchange=function(e){v(e)};var m=0;return g._addAlgorithm((function(e,t,i){var o=e.key;if("string"!=typeof o)return!1;var a=s(o);if(r(a,l,m))return!0;for(var d=null,v=m;v<p;++v){var g=n(o,a,u[v],l[v],c,h);null===g&&null===d?m=v+1:(null===d||c(d,g)>0)&&(d=g)}return t(null!==d?function(){e.continue(d+f)}:i),!1})),g}return{between:function(n,r,i,o){i=!1!==i,o=!0===o;try{return F(n,r)>0||0===F(n,r)&&(i||o)&&(!i||!o)?t(this):new G(this,(function(){return d.bound(n,r,!i,!o)}))}catch(t){return e(this,Fu)}},equals:function(e){return new G(this,(function(){return d.only(e)}))},above:function(e){return new G(this,(function(){return d.lowerBound(e,!0)}))},aboveOrEqual:function(e){return new G(this,(function(){return d.lowerBound(e)}))},below:function(e){return new G(this,(function(){return d.upperBound(e,!0)}))},belowOrEqual:function(e){return new G(this,(function(){return d.upperBound(e)}))},startsWith:function(t){return"string"!=typeof t?e(this,"String expected."):this.between(t,t+Uu,!0,!0)},startsWithIgnoreCase:function(e){return""===e?this.startsWith(e):r(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Uu)},equalsIgnoreCase:function(e){return r(this,(function(e,t){return e===t[0]}),[e],"")},anyOfIgnoreCase:function(){var e=uc.apply(cc,arguments);return 0===e.length?t(this):r(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},startsWithAnyOfIgnoreCase:function(){var e=uc.apply(cc,arguments);return 0===e.length?t(this):r(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Uu)},anyOf:function(){var n=uc.apply(cc,arguments),r=Y;try{n.sort(r)}catch(t){return e(this,Fu)}if(0===n.length)return t(this);var i=new G(this,(function(){return d.bound(n[0],n[n.length-1])}));i._ondirectionchange=function(e){r="next"===e?Y:V,n.sort(r)};var o=0;return i._addAlgorithm((function(e,t,i){for(var a=e.key;r(a,n[o])>0;)if(++o===n.length)return t(i),!1;return 0===r(a,n[o])||(t((function(){e.continue(n[o])})),!1)})),i},notEqual:function(e){return this.inAnyRange([[-1/0,e],[e,Ku]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=uc.apply(cc,arguments);if(0===t.length)return new G(this);try{t.sort(Y)}catch(t){return e(this,Fu)}var n=t.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return n.push([t[t.length-1],Ku]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},inAnyRange:function(n,r){if(0===n.length)return t(this);if(!n.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&Y(e[0],e[1])<=0})))return e(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ec.InvalidArgument);var i=!r||!1!==r.includeLowers,o=r&&!0===r.includeUppers;var a,s=Y;function c(e,t){return s(e[0],t[0])}try{(a=n.reduce((function(e,t){for(var n=0,r=e.length;n<r;++n){var i=e[n];if(F(t[0],i[1])<0&&F(t[1],i[0])>0){i[0]=(o=i[0],a=t[0],F(o,a)<0?o:a),i[1]=z(i[1],t[1]);break}}var o,a;return n===r&&e.push(t),e}),[])).sort(c)}catch(t){return e(this,Fu)}var u=0,l=o?function(e){return Y(e,a[u][1])>0}:function(e){return Y(e,a[u][1])>=0},h=i?function(e){return V(e,a[u][0])>0}:function(e){return V(e,a[u][0])>=0};var f=l,p=new G(this,(function(){return d.bound(a[0][0],a[a.length-1][1],!i,!o)}));return p._ondirectionchange=function(e){"next"===e?(f=l,s=Y):(f=h,s=V),a.sort(c)},p._addAlgorithm((function(e,t,n){for(var r=e.key;f(r);)if(++u===a.length)return t(n),!1;return!!function(e){return!l(e)&&!h(e)}(r)||(0===F(r,a[u][1])||0===F(r,a[u][0])||t((function(){s===Y?e.continue(a[u][0]):e.continue(a[u][1])})),!1)})),p},startsWithAnyOf:function(){var n=uc.apply(cc,arguments);return n.every((function(e){return"string"==typeof e}))?0===n.length?t(this):this.inAnyRange(n.map((function(e){return[e,e+Uu]}))):e(this,"startsWithAnyOf() only works with strings")}}})),js(G.prototype,(function(){function e(e,t){e.filter=q(e.filter,t)}function t(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return q(r(),t())}:t,e.justLimit=n&&!r}function n(e,t){if(e.isPrimKey)return t;var n=e.table.schema.idxByName[e.index];if(!n)throw new Ec.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return t.index(n.name)}function r(e,t){var r=n(e,t);return e.keysOnly&&"openKeyCursor"in r?r.openKeyCursor(e.range||null,e.dir+e.unique):r.openCursor(e.range||null,e.dir+e.unique)}function o(e,t,n,i,o){var a=e.replayFilter?q(e.filter,e.replayFilter()):e.filter;e.or?function(){var s={},c=0;function u(){2==++c&&n()}function l(e,n,r){if(!a||a(n,r,u,i)){var o=n.primaryKey,c=""+o;"[object ArrayBuffer]"===c&&(c=""+new Uint8Array(o)),Gs(s,c)||(s[c]=!0,t(e,n,r))}}e.or._iterate(l,u,i,o),K(r(e,o),e.algorithm,l,u,i,!e.keysOnly&&e.valueMapper)}():K(r(e,o),q(e.algorithm,a),t,n,i,!e.keysOnly&&e.valueMapper)}return{_read:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Gu.bind(null,n.error)):n.table._idbstore("readonly",e).then(t)},_write:function(e){var t=this._ctx;return t.error?t.table._trans(null,Gu.bind(null,t.error)):t.table._idbstore(k,e,"locked")},_addAlgorithm:function(e){var t=this._ctx;t.algorithm=q(t.algorithm,e)},_iterate:function(e,t,n,r){return o(this._ctx,e,t,n,r)},clone:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ps(n,e),t._ctx=n,t},raw:function(){return this._ctx.valueMapper=null,this},each:function(e){var t=this._ctx;return this._read((function(n,r,i){o(t,e,n,r,i)}))},count:function(e){var t=this._ctx;if(j(t,!0))return this._read((function(e,r,i){var o=n(t,i),a=t.range?o.count(t.range):o.count();a.onerror=$u(r),a.onsuccess=function(n){e(Math.min(n.target.result,t.limit))}}),e);var r=0;return this._read((function(e,n,i){o(t,(function(){return++r,!1}),(function(){e(r)}),n,i)}),e)},sortBy:function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=o(e,i),r=o(t,i);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},toArray:function(e){var t=this._ctx;return this._read((function(e,r,a){if(i&&"next"===t.dir&&j(t,!0)&&t.limit>0){var s=t.table.hook.reading.fire,c=n(t,a),u=t.limit<1/0?c.getAll(t.range,t.limit):c.getAll(t.range);u.onerror=$u(r),u.onsuccess=Qu(s===Ac?e:function(t){try{e(t.map(s))}catch(e){r(e)}})}else{var l=[];o(t,(function(e){l.push(e)}),(function(){e(l)}),r,a)}}),e)},offset:function(e){var n=this._ctx;return e<=0||(n.offset+=e,j(n)?t(n,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):t(n,(function(){var t=e;return function(){return--t<0}}))),this},limit:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),t(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this},until:function(t,n){return e(this._ctx,(function(e,r,i){return!t(e.value)||(r(i),n)})),this},first:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},last:function(e){return this.reverse().first(e)},filter:function(t){return e(this._ctx,(function(e){return t(e.value)})),function(e,t){e.isMatch=q(e.isMatch,t)}(this._ctx,t),this},and:function(e){return this.filter(e)},or:function(e){return new B(this._ctx.table,e,this)},reverse:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},desc:function(){return this.reverse()},eachKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},eachUniqueKey:function(e){return this._ctx.unique="unique",this.eachKey(e)},eachPrimaryKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},keys:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},primaryKeys:function(e){var t=this._ctx;if(i&&"next"===t.dir&&j(t,!0)&&t.limit>0)return this._read((function(e,r,i){var o=n(t,i),a=t.limit<1/0?o.getAllKeys(t.range,t.limit):o.getAllKeys(t.range);a.onerror=$u(r),a.onsuccess=Qu(e)})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},uniqueKeys:function(e){return this._ctx.unique="unique",this.keys(e)},firstKey:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},lastKey:function(e){return this.reverse().firstKey(e)},distinct:function(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var r={};return e(this._ctx,(function(e){var t=e.primaryKey.toString(),n=Gs(r,t);return r[t]=!0,!n})),this},modify:function(e){var t=this,n=this._ctx.table.hook,r=n.updating.fire,i=n.deleting.fire;return this._write((function(n,o,a,s){var c;if("function"==typeof e)c=r===_c&&i===_c?e:function(t){var n=ic(t);if(!1===e.call(this,t,this))return!1;if(Gs(this,"value")){var o=oc(n,this.value),a=r.call(this,o,this.primKey,n,s);a&&(t=this.value,Ds(a).forEach((function(e){Qs(t,e,a[e])})))}else i.call(this,this.primKey,t,s)};else if(r===_c){var u=Ds(e),l=u.length;c=function(t){for(var n=!1,r=0;r<l;++r){var i=u[r],o=e[i];$s(t,i)!==o&&(Qs(t,i,o),n=!0)}return n}}else{var h=e;e=ec(h),c=function(t){var n=!1,i=r.call(this,e,this.primKey,ic(t),s);return i&&Ps(e,i),Ds(e).forEach((function(r){var i=e[r];$s(t,r)!==i&&(Qs(t,r,i),n=!0)})),i&&(e=ec(h)),n}}var d=0,f=0,p=!1,v=[],g=[],m=null;function y(e){return e&&(v.push(e),g.push(m)),o(new Sc("Error modifying one or more objects",v,f,g))}function b(){p&&f+v.length===d&&(v.length>0?y():n(f))}t.clone().raw()._iterate((function(e,t){m=t.primaryKey;var n={primKey:t.primaryKey,value:e,onsuccess:null,onerror:null};function r(e){return v.push(e),g.push(n.primKey),b(),!0}if(!1!==c.call(n,e,n)){var i=!Gs(n,"value");++d,Js((function(){var e=i?t.delete():t.update(n.value);e._hookCtx=n,e.onerror=el(r),e.onsuccess=Ju((function(){++f,b()}))}),r)}else n.onsuccess&&n.onsuccess(n.value)}),(function(){p=!0,b()}),y,a)}))},delete:function(){var e=this,t=this._ctx,n=t.range,r=t.table.hook.deleting.fire,i=r!==_c;if(!i&&j(t)&&(t.isPrimKey&&!Xu||!n))return this._write((function(e,t,r){var i=$u(t),o=n?r.count(n):r.count();o.onerror=i,o.onsuccess=function(){var a=o.result;Js((function(){var t=n?r.delete(n):r.clear();t.onerror=i,t.onsuccess=function(){return e(a)}}),(function(e){return t(e)}))}}));var o=i?2e3:1e4;return this._write((function(n,a,s,c){var u=0,l=e.clone({keysOnly:!t.isMatch&&!i}).distinct().limit(o).raw(),h=[],d=function(){return l.each(i?function(e,t){h.push([t.primaryKey,t.value])}:function(e,t){h.push(t.primaryKey)}).then((function(){return i?h.sort((function(e,t){return Y(e[0],t[0])})):h.sort(Y),P(s,c,h,i,r)})).then((function(){var e=h.length;return u+=e,h=[],e<o?u:d()}))};n(d())}))}}})),Ps(this,{Collection:G,Table:N,Transaction:M,Version:A,WhereClause:B}),C.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+C.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+C.name+"'. Closing db now to resume the delete request."),C.close()})),C.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+C.name+"') was blocked"):console.warn("Upgrade '"+C.name+"' blocked by other connection holding version "+e.oldVersion/10)})),u.forEach((function(e){e(C)}))}function Zu(e,t){return Ds(t).forEach((function(n){var r=function e(t){if("function"==typeof t)return new t;if(Ns(t))return[e(t[0])];if(t&&"object"==typeof t){var n={};return Zu(n,t),n}return t}(t[n]);e[n]=r})),e}function Ju(e){return bu((function(t){var n=t.target,r=n._hookCtx,i=r.value||n.result,o=r&&r.onsuccess;o&&o(i),e&&e(i)}),e)}function $u(e){return bu((function(t){return tl(t),e(t.target.error),!1}))}function Qu(e){return bu((function(t){e(t.target.result)}))}function el(e){return bu((function(t){var n=t.target,r=n.error,i=n._hookCtx,o=i&&i.onerror;return o&&o(r),tl(t),e(r),!1}))}function tl(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function nl(e){var t=function(t){return e.next(t)},n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):Ns(o)?ou.all(o).then(n,r):n(o)}}return i(t)()}function rl(e,t,n,r,i,o,a){this.name=e,this.keyPath=t,this.unique=n,this.multi=r,this.auto=i,this.compound=o,this.dotted=a;var s="string"==typeof t?t:t&&"["+[].join.call(t,"+")+"]";this.src=(n?"&":"")+(r?"*":"")+(i?"++":"")+s}function il(e,t,n,r){this.name=e,this.primKey=t||new rl,this.indexes=n||[new rl],this.instanceTemplate=r,this.mappedClass=null,this.idxByName=qs(n,(function(e){return[e.name,e]}))}function ol(e){return 1===e.length?e[0]:e}function al(e){var t=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);return t&&t.bind(e)}hc(lc,Wu),js(qu,Ic),js(qu,{delete:function(e){var t=new qu(e),n=t.delete();return n.onblocked=function(e){return t.on("blocked",e),this},n},exists:function(e){return new qu(e).open().then((function(e){return e.close(),!0})).catch(qu.NoSuchDatabaseError,(function(){return!1}))},getDatabaseNames:function(e){var t=al(qu.dependencies.indexedDB);return t?new ou((function(e,n){var r=t();r.onsuccess=function(t){e(Ys(t.target.result,0))},r.onerror=$u(n)})).then(e):Hu.dbnames.toCollection().primaryKeys(e)},defineClass:function(){return function(e){e&&Ps(this,e)}},applyStructure:Zu,ignoreTransaction:function(e){return tu.trans?Lu(tu.transless,e):e()},vip:function(e){return Iu((function(){return tu.letThrough=!0,e()}))},async:function(e){return function(){try{var t=nl(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ou.resolve(t)}catch(e){return Gu(e)}}},spawn:function(e,t,n){try{var r=nl(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ou.resolve(r)}catch(e){return Gu(e)}},currentTransaction:{get:function(){return tu.trans||null}},waitFor:function(e,t){var n=ou.resolve("function"==typeof e?qu.ignoreTransaction(e):e).timeout(t||6e4);return tu.trans?tu.trans.waitFor(n):n},Promise:ou,debug:{get:function(){return lc},set:function(e){hc(e,"dexie"===e?function(){return!0}:Wu)}},derive:Ks,extend:Ps,props:js,override:Vs,Events:ju,getByKeyPath:$s,setByKeyPath:Qs,delByKeyPath:function(e,t){"string"==typeof t?Qs(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Qs(e,t,void 0)}))},shallowClone:ec,deepClone:ic,getObjectDiff:oc,asap:Ws,maxKey:Ku,minKey:-1/0,addons:[],connections:zu,MultiModifyError:Ec.Modify,errnames:kc,IndexSpec:rl,TableSchema:il,dependencies:function(){try{return{indexedDB:Ls.indexedDB||Ls.mozIndexedDB||Ls.webkitIndexedDB||Ls.msIndexedDB,IDBKeyRange:Ls.IDBKeyRange||Ls.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"{version}",version:"{version}".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:qu,Dexie:qu}),ou.rejectionMapper=function(e,t){if(!e||e instanceof bc||e instanceof TypeError||e instanceof SyntaxError||!e.name||!xc[e.name])return e;var n=new xc[e.name](t||e.message,e);return"stack"in e&&Us(n,"stack",{get:function(){return this.inner.stack}}),n},(Hu=new qu("__dbnames")).version(1).stores({dbnames:"name"}),function(){try{void 0!==typeof localStorage&&void 0!==Ls.document&&(JSON.parse(localStorage.getItem("Dexie.DatabaseNames")||"[]").forEach((function(e){return Hu.dbnames.put({name:e}).catch(_c)})),localStorage.removeItem("Dexie.DatabaseNames"))}catch(e){}}();var sl={storage:window.localStorage,set:function(e,t){if(t){var n=cl(t)||"";this.storage.setItem(e,n)}},get:function(e){if(e){var t=this.storage.getItem(e),n=t||"";try{n=JSON.parse(n)}catch(e){n=t||""}return n}},remove:function(e){e&&this.storage.removeItem(e)},clear:function(){this.storage.clear()},removeList:function(e){var t,n=v(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.storage.removeItem(r)}}catch(e){n.e(e)}finally{n.f()}}},cl=function(e){if(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t?JSON.stringify(e):e}};function ul(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function ll(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function hl(e){return[e.schema.primKey].concat(e.schema.indexes).map((function(e){return e.src})).join(",")}function dl(e,t){return new Promise((function(n,r){var i=new FileReader;i.onabort=function(e){return r(new Error("file read aborted"))},i.onerror=function(e){return r(e.target.error)},i.onload=function(e){return n(e.target.result)},"binary"===t?i.readAsArrayBuffer(e):i.readAsText(e)}))}function fl(e,t){if("undefined"==typeof FileReaderSync)throw new Error("FileReaderSync missing. Reading blobs synchronously requires code to run from within a web worker. Use TSON.encapsulateAsync() to do it from the main thread.");var n=new FileReaderSync;return"binary"===t?n.readAsArrayBuffer(e):n.readAsText(e)}var pl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vl(e,t){return e(t={exports:{}},t.exports),t.exports}for(var gl=vl((function(e,t){e.exports=function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=Object.keys,r=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,c=["type","replaced","iterateIn","iterateUnsetNumeric"];function u(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function h(t,n){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var r=o(t);if(!r)return!1;var i=a.call(r,"constructor")&&r.constructor;return"function"!=typeof i?null===n:"function"==typeof i&&null!==n&&s.call(i)===s.call(n)}function d(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function f(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,n,o){o=Object.assign({},i,o,{stringification:!0});var a=k(e,null,o);return r(a)?JSON.stringify(a[0],t,n):a.then((function(e){return JSON.stringify(e,t,n)}))};this.stringifySync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),C(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.specialTypeNames=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)},this.rootTypeName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)};var k=this.encapsulate=function(u,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],w=[],k=[],C=!(v&&"cyclic"in v)||v.cyclic,E=v.encapsulateObserver,x=A("",u,C,l||{},k);function I(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(new Set(t)));e&&d(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else f(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return k.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(n,r){return Promise.all(r.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=r.splice(0,1)[0],s=t(a,7),c=s[0],u=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=A(c,i,u,l,o,!0,p),g=h(v,S);return c&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(c?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(x,k)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(x)]:m?I(x):Promise.resolve(I(x));function _(e,t,n){Object.assign(e,t);var r=c.map((function(t){var n=e[t];return delete e[t],n}));n(),c.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,c,u,l){var f=void 0,m={},k=void 0===i?"undefined":e(i),C=E?function(e){var n=l||s.type||p.getJSONType(i);E(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:c,resolvingTypesonPromise:u,awaitingTypesonPromise:h(i,S)},void 0!==n?{type:n}:{}))}:null;if(k in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===k&&(isNaN(i)||i===-1/0||i===1/0)?(f=T(t,i,s,c,!1,u,C))!==i&&(m={replaced:f}):f=i,C&&C(),f;if(null===i)return C&&C(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var x=b.indexOf(i);if(!(x<0))return y[t]="#",C&&C({cyclicKeypath:w[x]}),"#"+w[x];!0===a&&(b.push(i),w.push(t))}var I=d(i),R=r(i),O=(I||R)&&(!o.length||s.replaced)||s.iterateIn?i:T(t,i,s,c,I||R,null,C),D=void 0;if(O!==i?(f=O,m={replaced:O}):R||"array"===s.iterateIn?(D=new Array(i.length),m={clone:D}):I||"object"===s.iterateIn?m={clone:D={}}:""===t&&h(i,S)?(c.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,C&&C(),v.iterateNone)return D||f;if(!D)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};_(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,c,u);h(r,S)?c.push([n,r,!!a,s,D,e,s.type]):void 0!==r&&(D[e]=r)}))};for(var L in i)N(L);C&&C({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);_(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))})),C&&C({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,M=function(e){if(!(e in i)){var n=t+(t?".":"")+e;_(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))}},B=0;B<P;B++)M(B);C&&C({endIterateUnsetNumeric:!0,end:!0})}return D}function T(e,t,n,r,i,c,u){for(var l=i?o:a,h=l.length;h--;){var d=l[h];if(d.test(t,n)){var f=d.type;if(s[f]){var p=y[e];y[e]=p?[f].concat(p):f}return Object.assign(n,{type:f,replaced:!0}),!m&&d.replaceAsync||d.replace?(u&&u({replacing:!0}),A(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),C&&"readonly",n,r,c,f)):(u&&u({typeDetected:!0}),A(e,t,C&&"readonly",n,r,c,f))}}return t}};this.encapsulateSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var C=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,c=e&&e.$types,l=!0;if(!c)return e;if(!0===c)return e.$;c.$&&d(c.$)&&(e=e.$,c=c.$,l=!1);var f=[],p={},v=function e(i,o,a,u,v,m){if(!l||"$types"!==i){var S=c[i];if(r(o)||d(o)){var w=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||w,u,w,t);h(n,b)?w[t]=void 0:void 0!==n&&(w[t]=n)})),o=w;f.length;){var k=t(f[0],4),C=k[0],E=k[1],x=k[2],I=k[3],_=y(C,E);if(h(_,b))x[I]=void 0;else{if(void 0===_)break;x[I]=_}f.splice(0,1)}}if(!S)return o;if("#"===S){var A=y(a,o.substr(1));return void 0===A&&f.push([a,o.substr(1),v,m]),A}var T=u.sync;return[].concat(S).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[T&&n.revive?"revive":!T&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return u(v=h(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(r(i))return i.map(e);i&&n(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var n=i[e],c=n.testPlainObjects?o:a,u=c.filter((function(t){return t.type===e}));if(u.length&&(c.splice(c.indexOf(u[0]),1),delete s[e],delete l[e]),n){if("function"==typeof n){var h=n;n={test:function(e){return e&&e.constructor===h},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(h.prototype),e)}}}else r(n)&&(n={test:n[0],replace:n[1],revive:n[2]});var d={type:e,test:n.test.bind(n)};n.replace&&(d.replace=n.replace.bind(n)),n.replaceAsync&&(d.replaceAsync=n.replaceAsync.bind(n));var f="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(f,0,d):a.splice(f,0,d),n.revive||n.reviveAsync){var g={};n.revive&&(g.revive=n.revive.bind(n)),n.reviveAsync&&(g.reviveAsync=n.reviveAsync.bind(n)),s[e]=g}l[e]=n}}))})),this}}function v(e,t){return n(t).map((function(n){e[n]=t[n]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var n=t.indexOf(".");if(n>-1){var r=e[m(t.substr(0,n))];return void 0===r?void 0:y(r,t.substr(n+1))}return e[m(t)]}function b(){}function S(e){this.p=new Promise(e)}return S.prototype.then=function(e,t){var n=this;return new S((function(r,i){n.p.then((function(t){r(e?e(t):t)}),(function(e){n.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(r,i)}))}))},S.prototype.catch=function(e){return this.then(null,e)},S.resolve=function(e){return new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},["all","race"].map((function(e){S[e]=function(t){return new S((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=S,p.isThenable=u,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=f,p.isPlainObject=d,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var n=o(t);return!n||h(t,Object)||e(n)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":r(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"],p}()})),ml=vl((function(e,t){e.exports=function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=Object.keys,r=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,c=["type","replaced","iterateIn","iterateUnsetNumeric"];function u(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function h(t,n){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var r=o(t);if(!r)return!1;var i=a.call(r,"constructor")&&r.constructor;return"function"!=typeof i?null===n:"function"==typeof i&&null!==n&&s.call(i)===s.call(n)}function d(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function f(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,n,o){o=Object.assign({},i,o,{stringification:!0});var a=k(e,null,o);return r(a)?JSON.stringify(a[0],t,n):a.then((function(e){return JSON.stringify(e,t,n)}))};this.stringifySync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),C(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.specialTypeNames=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)},this.rootTypeName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)};var k=this.encapsulate=function(u,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],w=[],k=[],C=!(v&&"cyclic"in v)||v.cyclic,E=v.encapsulateObserver,x=A("",u,C,l||{},k);function I(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(new Set(t)));e&&d(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else f(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return k.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(n,r){return Promise.all(r.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=r.splice(0,1)[0],s=t(a,7),c=s[0],u=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=A(c,i,u,l,o,!0,p),g=h(v,S);return c&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(c?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(x,k)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(x)]:m?I(x):Promise.resolve(I(x));function _(e,t,n){Object.assign(e,t);var r=c.map((function(t){var n=e[t];return delete e[t],n}));n(),c.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,c,u,l){var f=void 0,m={},k=void 0===i?"undefined":e(i),C=E?function(e){var n=l||s.type||p.getJSONType(i);E(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:c,resolvingTypesonPromise:u,awaitingTypesonPromise:h(i,S)},void 0!==n?{type:n}:{}))}:null;if(k in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===k&&(isNaN(i)||i===-1/0||i===1/0)?(f=T(t,i,s,c,!1,u,C))!==i&&(m={replaced:f}):f=i,C&&C(),f;if(null===i)return C&&C(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var x=b.indexOf(i);if(!(x<0))return y[t]="#",C&&C({cyclicKeypath:w[x]}),"#"+w[x];!0===a&&(b.push(i),w.push(t))}var I=d(i),R=r(i),O=(I||R)&&(!o.length||s.replaced)||s.iterateIn?i:T(t,i,s,c,I||R,null,C),D=void 0;if(O!==i?(f=O,m={replaced:O}):R||"array"===s.iterateIn?(D=new Array(i.length),m={clone:D}):I||"object"===s.iterateIn?m={clone:D={}}:""===t&&h(i,S)?(c.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,C&&C(),v.iterateNone)return D||f;if(!D)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};_(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,c,u);h(r,S)?c.push([n,r,!!a,s,D,e,s.type]):void 0!==r&&(D[e]=r)}))};for(var L in i)N(L);C&&C({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);_(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))})),C&&C({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,M=function(e){if(!(e in i)){var n=t+(t?".":"")+e;_(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))}},B=0;B<P;B++)M(B);C&&C({endIterateUnsetNumeric:!0,end:!0})}return D}function T(e,t,n,r,i,c,u){for(var l=i?o:a,h=l.length;h--;){var d=l[h];if(d.test(t,n)){var f=d.type;if(s[f]){var p=y[e];y[e]=p?[f].concat(p):f}return Object.assign(n,{type:f,replaced:!0}),!m&&d.replaceAsync||d.replace?(u&&u({replacing:!0}),A(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),C&&"readonly",n,r,c,f)):(u&&u({typeDetected:!0}),A(e,t,C&&"readonly",n,r,c,f))}}return t}};this.encapsulateSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var C=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,c=e&&e.$types,l=!0;if(!c)return e;if(!0===c)return e.$;c.$&&d(c.$)&&(e=e.$,c=c.$,l=!1);var f=[],p={},v=function e(i,o,a,u,v,m){if(!l||"$types"!==i){var S=c[i];if(r(o)||d(o)){var w=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||w,u,w,t);h(n,b)?w[t]=void 0:void 0!==n&&(w[t]=n)})),o=w;f.length;){var k=t(f[0],4),C=k[0],E=k[1],x=k[2],I=k[3],_=y(C,E);if(h(_,b))x[I]=void 0;else{if(void 0===_)break;x[I]=_}f.splice(0,1)}}if(!S)return o;if("#"===S){var A=y(a,o.substr(1));return void 0===A&&f.push([a,o.substr(1),v,m]),A}var T=u.sync;return[].concat(S).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[T&&n.revive?"revive":!T&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return u(v=h(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(r(i))return i.map(e);i&&n(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var n=i[e],c=n.testPlainObjects?o:a,u=c.filter((function(t){return t.type===e}));if(u.length&&(c.splice(c.indexOf(u[0]),1),delete s[e],delete l[e]),n){if("function"==typeof n){var h=n;n={test:function(e){return e&&e.constructor===h},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(h.prototype),e)}}}else r(n)&&(n={test:n[0],replace:n[1],revive:n[2]});var d={type:e,test:n.test.bind(n)};n.replace&&(d.replace=n.replace.bind(n)),n.replaceAsync&&(d.replaceAsync=n.replaceAsync.bind(n));var f="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(f,0,d):a.splice(f,0,d),n.revive||n.reviveAsync){var g={};n.revive&&(g.revive=n.revive.bind(n)),n.reviveAsync&&(g.reviveAsync=n.reviveAsync.bind(n)),s[e]=g}l[e]=n}}))})),this}}function v(e,t){return n(t).map((function(n){e[n]=t[n]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var n=t.indexOf(".");if(n>-1){var r=e[m(t.substr(0,n))];return void 0===r?void 0:y(r,t.substr(n+1))}return e[m(t)]}function b(){}function S(e){this.p=new Promise(e)}S.prototype.then=function(e,t){var n=this;return new S((function(r,i){n.p.then((function(t){r(e?e(t):t)}),(function(e){n.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(r,i)}))}))},S.prototype.catch=function(e){return this.then(null,e)},S.resolve=function(e){return new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},["all","race"].map((function(e){S[e]=function(t){return new S((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=S,p.isThenable=u,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=f,p.isPlainObject=d,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var n=o(t);return!n||h(t,Object)||e(n)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":r(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"];for(var w={userObject:{test:function(e,t){return p.isUserObject(e)},replace:function(e){return Object.assign({},e)},revive:function(e){return e}}},k=[[{sparseArrays:{testPlainObjects:!0,test:function(e){return Array.isArray(e)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(e){return null},revive:function(e){}}}],{undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(e){return null},revive:function(e){return new p.Undefined}}}],C={StringObject:{test:function(t){return"String"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return String(e)},revive:function(e){return new String(e)}},BooleanObject:{test:function(t){return"Boolean"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Boolean(e)},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(t){return"Number"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Number(e)},revive:function(e){return new Number(e)}}},E=[{nan:{test:function(e){return"number"==typeof e&&isNaN(e)},replace:function(e){return"NaN"},revive:function(e){return NaN}}},{infinity:{test:function(e){return e===1/0},replace:function(e){return"Infinity"},revive:function(e){return 1/0}}},{negativeInfinity:{test:function(e){return e===-1/0},replace:function(e){return"-Infinity"},revive:function(e){return-1/0}}}],x={date:{test:function(e){return"Date"===p.toStringTag(e)},replace:function(e){var t=e.getTime();return isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(NaN):new Date(e)}}},I={regexp:{test:function(e){return"RegExp"===p.toStringTag(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},_={map:{test:function(e){return"Map"===p.toStringTag(e)},replace:function(e){return Array.from(e.entries())},revive:function(e){return new Map(e)}}},A={set:{test:function(e){return"Set"===p.toStringTag(e)},replace:function(e){return Array.from(e.values())},revive:function(e){return new Set(e)}}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",R=new Uint8Array(256),O=0;O<T.length;O++)R[T.charCodeAt(O)]=O;var D=function(e,t,n){for(var r=new Uint8Array(e,t,n),i=r.length,o="",a=0;a<i;a+=3)o+=T[r[a]>>2],o+=T[(3&r[a])<<4|r[a+1]>>4],o+=T[(15&r[a+1])<<2|r[a+2]>>6],o+=T[63&r[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},N=function(e){var t=e.length,n=.75*e.length,r=0,i=void 0,o=void 0,a=void 0,s=void 0;"="===e[e.length-1]&&(n--,"="===e[e.length-2]&&n--);for(var c=new ArrayBuffer(n),u=new Uint8Array(c),l=0;l<t;l+=4)i=R[e.charCodeAt(l)],o=R[e.charCodeAt(l+1)],a=R[e.charCodeAt(l+2)],s=R[e.charCodeAt(l+3)],u[r++]=i<<2|o>>4,u[r++]=(15&o)<<4|a>>2,u[r++]=(3&a)<<6|63&s;return c},L={arraybuffer:{test:function(e){return"ArrayBuffer"===p.toStringTag(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),D(e))},revive:function(t,n){if(n.buffers||(n.buffers=[]),"object"===(void 0===t?"undefined":e(t)))return n.buffers[t.index];var r=N(t);return n.buffers.push(r),r}}},P="undefined"==typeof self?pl:self,M={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=P[t];n&&(M[e.toLowerCase()]={test:function(e){return p.toStringTag(e)===t},replace:function(e,t){var n=e.buffer,r=e.byteOffset,i=e.length;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(n);return o>-1?{index:o,byteOffset:r,length:i}:(t.buffers.push(n),{encoded:D(n),byteOffset:r,length:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var r=e.byteOffset,i=e.length,o=e.encoded,a=e.index,s=void 0;return"index"in e?s=t.buffers[a]:(s=N(o),t.buffers.push(s)),new n(s,r,i)}})}));var B={dataview:{test:function(e){return"DataView"===p.toStringTag(e)},replace:function(e,t){var n=e.buffer,r=e.byteOffset,i=e.byteLength;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(n);return o>-1?{index:o,byteOffset:r,byteLength:i}:(t.buffers.push(n),{encoded:D(n),byteOffset:r,byteLength:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var n=e.byteOffset,r=e.byteLength,i=e.encoded,o=e.index,a=void 0;return"index"in e?a=t.buffers[o]:(a=N(i),t.buffers.push(a)),new DataView(a,n,r)}}},G={IntlCollator:{test:function(e){return p.hasConstructorOf(e,Intl.Collator)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.Collator(e.locale,e)}},IntlDateTimeFormat:{test:function(e){return p.hasConstructorOf(e,Intl.DateTimeFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.DateTimeFormat(e.locale,e)}},IntlNumberFormat:{test:function(e){return p.hasConstructorOf(e,Intl.NumberFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.NumberFormat(e.locale,e)}}};function j(e){for(var t=new Uint16Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var H={file:{test:function(e){return"File"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,n=e.type,r=e.stringContents,i=e.lastModified,o=j(r);return new File([o],t,{type:n,lastModified:i})},replaceAsync:function(e){return new p.Promise((function(t,n){if(e.isClosed)n(new Error("The File is closed"));else{var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:r.result,name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsText(e,"UTF-16")}}))}}};return[w,k,C,E,x,I,{imagedata:{test:function(e){return"ImageData"===p.toStringTag(e)},replace:function(e){return{array:Array.from(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},{imagebitmap:{test:function(e){return"ImageBitmap"===p.toStringTag(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),t.toDataURL()},revive:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.onload=function(){n.drawImage(r,0,0)},r.src=e,t},reviveAsync:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.onload=function(){n.drawImage(r,0,0)},r.src=e,createImageBitmap(t)}}},H,{file:H.file,filelist:{test:function(e){return"FileList"===p.toStringTag(e)},replace:function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e.item(n);return t},revive:function(e){function t(){this._files=arguments[0],this.length=this._files.length}return t.prototype.item=function(e){return this._files[e]},t.prototype[Symbol.toStringTag]="FileList",new t(e)}}},{blob:{test:function(e){return"Blob"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,n=e.stringContents;return new Blob([j(n)],{type:t})},replaceAsync:function(e){return new p.Promise((function(t,n){if(e.isClosed)n(new Error("The Blob is closed"));else{var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:r.result})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsText(e,"UTF-16")}}))}}}].concat("function"==typeof Map?_:[],"function"==typeof Set?A:[],"function"==typeof ArrayBuffer?L:[],"function"==typeof Uint8Array?M:[],"function"==typeof DataView?B:[],"undefined"!=typeof Intl?G:[])}()})),yl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bl=new Uint8Array(256),Sl=0;Sl<yl.length;Sl++)bl[yl.charCodeAt(Sl)]=Sl;var wl=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,t||0,n),i=r.length,o="",a=0;a<i;a+=3)o+=yl[r[a]>>2],o+=yl[(3&r[a])<<4|r[a+1]>>4],o+=yl[(15&r[a+1])<<2|r[a+2]>>6],o+=yl[63&r[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},kl=function(e){var t,n,r,i,o=e.length,a=.75*e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);for(var c=new ArrayBuffer(a),u=new Uint8Array(c),l=0;l<o;l+=4)t=bl[e.charCodeAt(l)],n=bl[e.charCodeAt(l+1)],r=bl[e.charCodeAt(l+2)],i=bl[e.charCodeAt(l+3)],u[s++]=t<<2|n>>4,u[s++]=(15&n)<<4|r>>2,u[s++]=(3&r)<<6|63&i;return c},Cl="undefined"==typeof self?global:self,El={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=Cl[t];n&&(El[e.toLowerCase()+"2"]={test:function(e){return gl.toStringTag(e)===t},replace:function(e){return{buffer:e.buffer,byteOffset:e.byteOffset,length:e.length}},revive:function(e){var t=e.buffer,r=e.byteOffset,i=e.length;return new n(t,r,i)}})}));var xl={arraybuffer:{test:function(e){return"ArrayBuffer"===gl.toStringTag(e)},replace:function(e){return wl(e,0,e.byteLength)},revive:function(e){return kl(e)}}},Il=(new gl).register(ml),_l="FileReaderSync"in self,Al=[],Tl=0;Il.register([xl,El,{blob2:{test:function(e){return"Blob"===gl.toStringTag(e)},replace:function(e){if(e.isClosed)throw new Error("The Blob is closed");if(_l){var t=fl(e,"binary"),n=wl(t,0,t.byteLength);return{type:e.type,data:n}}Al.push(e);var r={type:e.type,data:{start:Tl,end:Tl+e.size}};return console.log("b.size: "+e.size),Tl+=e.size,r},finalize:function(e,t){e.data=wl(t,0,t.byteLength)},revive:function(e){var t=e.type,n=e.data;return new Blob([kl(n)],{type:t})}}}]),Il.mustFinalize=function(){return Al.length>0},Il.finalize=function(e){return ul(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u,l;return ll(this,(function(h){switch(h.label){case 0:return[4,dl(new Blob(Al),"binary")];case 1:if(t=h.sent(),e)for(n=0,r=e;n<r.length;n++)if((i=r[n]).$types)for(s in o=i.$types,(a=o.$)&&(o=o.$),o)c=o[s],(u=Il.types[c])&&u.finalize&&(l=qu.getByKeyPath(i,a?"$."+s:s),u.finalize(l,t.slice(l.start,l.end)));return Al=[],[2]}}))}))};function Rl(e,t){return ul(this,void 0,void 0,(function(){function n(){return ul(this,void 0,void 0,(function(){var n,u,l,h,d,f,p,v,g;return ll(this,(function(m){switch(m.label){case 0:return[4,Promise.all(e.tables.map((function(e){return e.count()})))];case 1:(n=m.sent()).forEach((function(e,t){return i[t].rowCount=e})),c.totalRows=n.reduce((function(e,t){return e+t})),u=JSON.stringify(a,void 0,o?2:void 0),l=u.lastIndexOf("]"),h=u.substring(0,l),r.push(h),d=t.filter,f=function(n){var i,a,u,l,h,f,p,v,g,m,y;return ll(this,(function(b){switch(b.label){case 0:i=e.table(n),a=i.schema.primKey,u=!!a.keyPath,l=t.numRowsPerChunk||2e3,h=u?{tableName:i.name,inbound:!0,rows:[]}:{tableName:i.name,inbound:!1,rows:[]},f=JSON.stringify(h,void 0,o?2:void 0),o&&(f=f.split("\n").join("\n ")),p=f.lastIndexOf("]"),r.push(f.substring(0,p)),v=null,g=0,m=!0,y=function(){var e,t,h,f,p,y,b,S;return ll(this,(function(w){switch(w.label){case 0:return s&&qu.ignoreTransaction((function(){return s(c)})),[4,(e=null==v?i.limit(l):i.where(":id").above(v).limit(l)).toArray()];case 1:return 0===(t=w.sent()).length?[2,"break"]:(null!=v&&g>0&&(r.push(","),o&&r.push("\n ")),m=t.length===l,u?(h=d?t.filter((function(e){return d(n,e)})):t,f=h.map((function(e){return Il.encapsulate(e)})),Il.mustFinalize()?[4,qu.waitFor(Il.finalize(f))]:[3,3]):[3,4]);case 2:w.sent(),w.label=3;case 3:return S=JSON.stringify(f,void 0,o?2:void 0),o&&(S=S.split("\n").join("\n ")),r.push(new Blob([S.substring(1,S.length-1)])),g=h.length,v=t.length>0?qu.getByKeyPath(t[t.length-1],a.keyPath):null,[3,8];case 4:return[4,e.primaryKeys()];case 5:return p=w.sent(),y=p.map((function(e,n){return[e,t[n]]})),d&&(y=y.filter((function(e){var t=e[0],r=e[1];return d(n,r,t)}))),b=y.map((function(e){return Il.encapsulate(e)})),Il.mustFinalize()?[4,qu.waitFor(Il.finalize(b))]:[3,7];case 6:w.sent(),w.label=7;case 7:S=JSON.stringify(b,void 0,o?2:void 0),o&&(S=S.split("\n").join("\n ")),r.push(new Blob([S.substring(1,S.length-1)])),g=y.length,v=p.length>0?p[p.length-1]:null,w.label=8;case 8:return c.completedRows+=t.length,[2]}}))},b.label=1;case 1:return m?[5,y()]:[3,3];case 2:return"break"===b.sent()?[3,3]:[3,1];case 3:return r.push(f.substr(p)),c.completedTables+=1,c.completedTables<c.totalTables&&r.push(","),[2]}}))},p=0,v=i,m.label=2;case 2:return p<v.length?(g=v[p].name,[5,f(g)]):[3,5];case 3:m.sent(),m.label=4;case 4:return p++,[3,2];case 5:return r.push(u.substr(l)),c.done=!0,s&&qu.ignoreTransaction((function(){return s(c)})),[2]}}))}))}var r,i,o,a,s,c;return ll(this,(function(u){switch(u.label){case 0:t=t||{},r=[],i=e.tables.map((function(e){return{name:e.name,schema:hl(e),rowCount:0}})),o=t.prettyJson,a={formatName:"dexie",formatVersion:1,data:{databaseName:e.name,databaseVersion:e.verno,tables:i,data:[]}},s=t.progressCallback,c={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:e.tables.length},u.label=1;case 1:return u.trys.push([1,,6,7]),t.noTransaction?[4,n()]:[3,3];case 2:return u.sent(),[3,5];case 3:return[4,e.transaction("r",e.tables,n)];case 4:u.sent(),u.label=5;case 5:return[3,7];case 6:return Il.finalize(),[7];case 7:return s&&qu.ignoreTransaction((function(){return s(c)})),[2,new Blob(r,{type:"text/json"})]}}))}))}var Ol=function(){},Dl=vl((function(e,t){!function(e){var t="object"==typeof process&&process.env?process.env:self;e.parser=function(e){return new B(e)},e.CParser=B,e.CStream=G,e.createStream=function(e){return new G(e)},e.MAX_BUFFER_LENGTH=10485760,e.DEBUG="debug"===t.CDEBUG,e.INFO="debug"===t.CDEBUG||"info"===t.CDEBUG,e.EVENTS=["value","string","key","openobject","closeobject","openarray","closearray","error","end","ready"];var n,r={textNode:void 0,numberNode:""},i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e})),o=0;for(var a in e.STATE={BEGIN:o++,VALUE:o++,OPEN_OBJECT:o++,CLOSE_OBJECT:o++,OPEN_ARRAY:o++,CLOSE_ARRAY:o++,TEXT_ESCAPE:o++,STRING:o++,BACKSLASH:o++,END:o++,OPEN_KEY:o++,CLOSE_KEY:o++,TRUE:o++,TRUE2:o++,TRUE3:o++,FALSE:o++,FALSE2:o++,FALSE3:o++,FALSE4:o++,NULL:o++,NULL2:o++,NULL3:o++,NUMBER_DECIMAL_POINT:o++,NUMBER_DIGIT:o++},e.STATE)e.STATE[e.STATE[a]]=a;o=e.STATE;const s=9,c=10,u=13,l=32,h=34,d=43,f=44,p=45,v=46,g=48,m=57,y=58,b=69,S=91,w=92,k=93,C=97,E=98,x=101,I=102,_=108,A=110,T=114,R=115,O=116,D=117,N=123,L=125;function P(e){for(var t in r)e[t]=r[t]}Object.create||(Object.create=function(e){function t(){this.__proto__=e}return t.prototype=e,new t}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});var M=/[\\"\n]/g;function B(t){if(!(this instanceof B))return new B(t);P(this),this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.q=this.c=this.p="",this.opt=t||{},this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.state=o.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,j(this,"onready")}B.prototype={end:function(){z(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return F(this,"Cannot write after close. Assign an onready handler.");if(null===t)return z(this);var n=0,i=t.charCodeAt(0),a=this.p;e.DEBUG&&console.log("write -> ["+t+"]");for(;i&&(a=i,this.c=i=t.charCodeAt(n++),a!==i?this.p=a:a=this.p,i);)switch(e.DEBUG&&console.log(n,i,e.STATE[this.state]),this.position++,i===c?(this.line++,this.column=0):this.column++,this.state){case o.BEGIN:i===N?this.state=o.OPEN_OBJECT:i===S?this.state=o.OPEN_ARRAY:Y(i)||F(this,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(Y(i))continue;if(this.state===o.OPEN_KEY)this.stack.push(o.CLOSE_KEY);else{if(i===L){j(this,"onopenobject"),this.depth++,j(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_OBJECT)}i===h?this.state=o.STRING:F(this,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(Y(i))continue;this.state,o.CLOSE_KEY,i===y?(this.state===o.CLOSE_OBJECT?(this.stack.push(o.CLOSE_OBJECT),U(this,"onopenobject"),this.depth++):U(this,"onkey"),this.state=o.VALUE):i===L?(H(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE):i===f?(this.state===o.CLOSE_OBJECT&&this.stack.push(o.CLOSE_OBJECT),U(this),this.state=o.OPEN_KEY):F(this,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(Y(i))continue;if(this.state===o.OPEN_ARRAY){if(j(this,"onopenarray"),this.depth++,this.state=o.VALUE,i===k){j(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_ARRAY)}i===h?this.state=o.STRING:i===N?this.state=o.OPEN_OBJECT:i===S?this.state=o.OPEN_ARRAY:i===O?this.state=o.TRUE:i===I?this.state=o.FALSE:i===A?this.state=o.NULL:i===p?this.numberNode+="-":g<=i&&i<=m?(this.numberNode+=String.fromCharCode(i),this.state=o.NUMBER_DIGIT):F(this,"Bad value");continue;case o.CLOSE_ARRAY:if(i===f)this.stack.push(o.CLOSE_ARRAY),U(this,"onvalue"),this.state=o.VALUE;else if(i===k)H(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;else{if(Y(i))continue;F(this,"Bad array")}continue;case o.STRING:void 0===this.textNode&&(this.textNode="");var s=n-1,u=this.slashed,l=this.unicodeI;e:for(;;){for(e.DEBUG&&console.log(n,i,e.STATE[this.state],u);l>0;)if(this.unicodeS+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,4===l?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),l=0,s=n-1):l++,!i)break e;if(i===h&&!u){this.state=this.stack.pop()||o.VALUE,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(i===w&&!u&&(u=!0,this.textNode+=t.substring(s,n-1),this.position+=n-1-s,i=t.charCodeAt(n++),this.position++,!i))break;if(u){if(u=!1,i===A?this.textNode+="\n":i===T?this.textNode+="\r":i===O?this.textNode+="\t":i===I?this.textNode+="\f":i===E?this.textNode+="\b":i===D?(l=1,this.unicodeS=""):this.textNode+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,s=n-1,i)continue;break}M.lastIndex=n;var P=M.exec(t);if(null===P){n=t.length+1,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(n=P.index+1,!(i=t.charCodeAt(P.index))){this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}}this.slashed=u,this.unicodeI=l;continue;case o.TRUE:i===T?this.state=o.TRUE2:F(this,"Invalid true started with t"+i);continue;case o.TRUE2:i===D?this.state=o.TRUE3:F(this,"Invalid true started with tr"+i);continue;case o.TRUE3:i===x?(j(this,"onvalue",!0),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid true started with tru"+i);continue;case o.FALSE:i===C?this.state=o.FALSE2:F(this,"Invalid false started with f"+i);continue;case o.FALSE2:i===_?this.state=o.FALSE3:F(this,"Invalid false started with fa"+i);continue;case o.FALSE3:i===R?this.state=o.FALSE4:F(this,"Invalid false started with fal"+i);continue;case o.FALSE4:i===x?(j(this,"onvalue",!1),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid false started with fals"+i);continue;case o.NULL:i===D?this.state=o.NULL2:F(this,"Invalid null started with n"+i);continue;case o.NULL2:i===_?this.state=o.NULL3:F(this,"Invalid null started with nu"+i);continue;case o.NULL3:i===_?(j(this,"onvalue",null),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid null started with nul"+i);continue;case o.NUMBER_DECIMAL_POINT:i===v?(this.numberNode+=".",this.state=o.NUMBER_DIGIT):F(this,"Leading zero not followed by .");continue;case o.NUMBER_DIGIT:g<=i&&i<=m?this.numberNode+=String.fromCharCode(i):i===v?(-1!==this.numberNode.indexOf(".")&&F(this,"Invalid number has two dots"),this.numberNode+="."):i===x||i===b?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||F(this,"Invalid number has two exponential"),this.numberNode+="e"):i===d||i===p?(a!==x&&a!==b&&F(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(i)):(K(this),n--,this.state=this.stack.pop()||o.VALUE);continue;default:F(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0;for(var o in r){var a=void 0===t[o]?0:t[o].length;if(a>n)switch(o){case"text":closeText(t);break;default:F(t,"Max buffer length exceeded: "+o)}i=Math.max(i,a)}t.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+t.position}(this);return this},resume:function(){return this.error=null,this},close:function(){return this.write(null)}};try{n=Ol}catch(e){n=function(){}}function G(e){if(!(this instanceof G))return new G(e);this._parser=new B(e),this.writable=!0,this.readable=!0,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.string="";var t=this;n.apply(t),this._parser.onend=function(){t.emit("end")},this._parser.onerror=function(e){t.emit("error",e),t._parser.error=null},i.forEach((function(e){Object.defineProperty(t,"on"+e,{get:function(){return t._parser["on"+e]},set:function(n){if(!n)return t.removeAllListeners(e),t._parser["on"+e]=n,n;t.on(e,n)},enumerable:!0,configurable:!1})}))}function j(t,n,r){e.INFO&&console.log("-- emit",n,r),t[n]&&t[n](r)}function H(e,t,n){U(e),j(e,t,n)}function U(e,t){e.textNode=function(e,t){if(void 0===t)return t;e.trim&&(t=t.trim());e.normalize&&(t=t.replace(/\s+/g," "));return t}(e.opt,e.textNode),void 0!==e.textNode&&j(e,t||"onvalue",e.textNode),e.textNode=void 0}function K(e){e.numberNode&&j(e,"onvalue",parseFloat(e.numberNode)),e.numberNode=""}function F(e,t){return U(e),t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c,t=new Error(t),e.error=t,j(e,"onerror",t),e}function z(e){return e.state===o.VALUE&&0===e.depth||F(e,"Unexpected end"),U(e),e.c="",e.closed=!0,j(e,"onend"),B.call(e,e.opt),e}function Y(e){return e===u||e===c||e===l||e===s}G.prototype=Object.create(n.prototype,{constructor:{value:G}}),G.prototype.write=function(e){e=new Buffer(e);for(var t=0;t<e.length;t++){var n=e[t];if(this.bytes_remaining>0){for(var r=0;r<this.bytes_remaining;r++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+r]=e[r];this.string=this.temp_buffs[this.bytes_in_sequence].toString(),this.bytes_in_sequence=this.bytes_remaining=0,t=t+r-1,this._parser.write(this.string),this.emit("data",this.string)}else if(0===this.bytes_remaining&&n>=128){if(n>=194&&n<=223&&(this.bytes_in_sequence=2),n>=224&&n<=239&&(this.bytes_in_sequence=3),n>=240&&n<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>e.length){for(var i=0;i<=e.length-1-t;i++)this.temp_buffs[this.bytes_in_sequence][i]=e[t+i];return this.bytes_remaining=t+this.bytes_in_sequence-e.length,!0}this.string=e.slice(t,t+this.bytes_in_sequence).toString(),t=t+this.bytes_in_sequence-1,this._parser.write(this.string),this.emit("data",this.string)}else{for(var o=t;o<e.length&&!(e[o]>=128);o++);this.string=e.slice(t,o).toString(),this._parser.write(this.string),this.emit("data",this.string),t=o-1}}},G.prototype.end=function(e){return e&&e.length&&this._parser.write(e.toString()),this._parser.end(),!0},G.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===i.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)},G.prototype.destroy=function(){P(this._parser),this.emit("close")}}(t)}));function Nl(e){var t=0,n=function(e){var t,n,r,i=Dl.parser(),o=0,a=[],s=!1,c=!1;return i.onopenobject=function(i){var s={incomplete:!0};t||(t=s),n&&(a.push([r,n,c]),e&&(c?n.push(s):n[r]=s)),n=s,r=i,c=!1,++o},i.onkey=function(e){return r=e},i.onvalue=function(e){return c?n.push(e):n[r]=e},i.oncloseobject=function(){var t;if(delete n.incomplete,r=null,0==--o)s=!0;else{var i=n;t=a.pop(),r=t[0],n=t[1],c=t[2],e||(c?n.push(i):n[r]=i)}},i.onopenarray=function(){var i=[];i.incomplete=!0,t||(t=i),n&&(a.push([r,n,c]),e&&(c?n.push(i):n[r]=i)),n=i,c=!0,r=null,++o},i.onclosearray=function(){var t;if(delete n.incomplete,r=null,0==--o)s=!0;else{var i=n;t=a.pop(),r=t[0],n=t[1],c=t[2],e||(c?n.push(i):n[r]=i)}},{write:function(e){return i.write(e),t},done:function(){return s}}}(!0),r={pullAsync:function(i){return ul(this,void 0,void 0,(function(){var o,a,s;return ll(this,(function(c){switch(c.label){case 0:return o=e.slice(t,t+i),t+=i,[4,dl(o,"text")];case 1:return a=c.sent(),s=n.write(a),r.result=s||{},[2,s]}}))}))},pullSync:function(i){var o=e.slice(t,t+i);t+=i;var a=fl(o,"text"),s=n.write(a);return r.result=s||{},s},done:function(){return n.done()},eof:function(){return t>=e.size},result:{}};return r}function Ll(e,t,n){return ul(this,void 0,void 0,(function(){function r(){return ul(this,void 0,void 0,(function(){var t,r,a,h;return ll(this,(function(d){switch(d.label){case 0:t=function(t){var r,i,o,a,s,h,d,f,p,v,g,m;return ll(this,(function(y){switch(y.label){case 0:if(!t.rows)return[2,"break"];if(!t.rows.incomplete&&0===t.rows.length)return[2,"continue"];if(u&&qu.ignoreTransaction((function(){return u(l)})),r=t.tableName,i=e.table(r),o=c.tables.filter((function(e){return e.name===r}))[0].schema,!i){if(n.acceptMissingTables)return[2,"continue"];throw new Error("Exported table "+t.tableName+" is missing in installed database")}if(!n.acceptChangedPrimaryKey&&o.split(",")[0]!=i.schema.primKey.src)throw new Error("Primary key differs for table "+t.tableName+". ");for(a=t.rows,s=[],h=0;h<a.length&&!(d=a[h]).incomplete;h++)s.push(Il.revive(d));return f=n.filter,p=f?t.inbound?s.filter((function(e){return f(r,e)})):s.filter((function(e){var t=e[0],n=e[1];return f(r,n,t)})):s,v=t.inbound?[void 0,p]:[p.map((function(e){return e[0]})),s.map((function(e){return e[1]}))],g=v[0],m=v[1],n.overwriteValues?[4,i.bulkPut(m,g)]:[3,2];case 1:return y.sent(),[3,4];case 2:return[4,i.bulkAdd(m,g)];case 3:y.sent(),y.label=4;case 4:return l.completedRows+=s.length,s.incomplete||(l.completedTables+=1),a.splice(0,s.length),[2]}}))},r=0,a=c.data,d.label=1;case 1:return r<a.length?(h=a[r],[5,t(h)]):[3,4];case 2:if("break"===d.sent())return[3,4];d.label=3;case 3:return r++,[3,1];case 4:for(;c.data.length>0&&c.data[0].rows&&!c.data[0].rows.incomplete;)c.data.splice(0,1);return o.done()||o.eof()?[3,8]:s?(o.pullSync(i),[3,7]):[3,5];case 5:return[4,qu.waitFor(o.pullAsync(i))];case 6:d.sent(),d.label=7;case 7:return[3,9];case 8:return[3,10];case 9:return[3,0];case 10:return[2]}}))}))}var i,o,a,s,c,u,l,h,d;return ll(this,(function(f){switch(f.label){case 0:return i=(n=n||{}).chunkSizeBytes||1048576,[4,Pl(t,i)];case 1:if(o=f.sent(),a=o.result,s="FileReaderSync"in self,c=a.data,!n.acceptNameDiff&&e.name!==c.databaseName)throw new Error("Name differs. Current database name is "+e.name+" but export is "+c.databaseName);if(!n.acceptVersionDiff&&e.verno!==c.databaseVersion)throw new Error("Database version differs. Current database is in version "+e.verno+" but export is "+c.databaseVersion);if(u=n.progressCallback,l={done:!1,completedRows:0,completedTables:0,totalRows:c.tables.reduce((function(e,t){return e+t.rowCount}),0),totalTables:c.tables.length},u&&qu.ignoreTransaction((function(){return u(l)})),!n.clearTablesBeforeImport)return[3,5];h=0,d=e.tables,f.label=2;case 2:return h<d.length?[4,d[h].clear()]:[3,5];case 3:f.sent(),f.label=4;case 4:return h++,[3,2];case 5:return n.noTransaction?[4,r()]:[3,7];case 6:return f.sent(),[3,9];case 7:return[4,e.transaction("rw",e.tables,r)];case 8:f.sent(),f.label=9;case 9:return l.done=!0,u&&qu.ignoreTransaction((function(){return u(l)})),[2]}}))}))}function Pl(e,t){return ul(this,void 0,void 0,(function(){var n,r;return ll(this,(function(i){switch(i.label){case 0:n="slice"in e?Nl(e):e,i.label=1;case 1:return n.eof()?[3,3]:[4,n.pullAsync(t)];case 2:return i.sent(),n.result.data&&n.result.data.data?[3,3]:[3,1];case 3:if(!(r=n.result)||"dexie"!=r.formatName)throw new Error("Given file is not a dexie export");if(r.formatVersion>1)throw new Error("Format version "+r.formatVersion+" not supported");if(!r.data)throw new Error("No data in export file");if(!r.data.databaseName)throw new Error("Missing databaseName in export file");if(!r.data.databaseVersion)throw new Error("Missing databaseVersion in export file");if(!r.data.tables)throw new Error("Missing tables in export file");return[2,n]}}))}))}qu.prototype.export=function(e){return Rl(this,e)},qu.prototype.import=function(e,t){return Ll(this,e,t)},qu.import=function(e,t){return function(e,t){return ul(this,void 0,void 0,(function(){var n,r,i,o;return ll(this,(function(a){switch(a.label){case 0:return n=(t=t||{}).chunkSizeBytes||1048576,[4,Pl(e,n)];case 1:return r=a.sent(),i=r.result.data,(o=new qu(i.databaseName)).version(i.databaseVersion).stores(function(e){for(var t={},n=0,r=e.tables;n<r.length;n++){var i=r[n];t[i.name]=i.schema}return t}(i)),[4,Ll(o,r,t)];case 2:return a.sent(),[2,o]}}))}))}(e,t)};var Ml=y((function(e,t){e.exports=function e(t,n,r){var i,o,a=window,s="application/octet-stream",c=r||s,u=t,l=!n&&!r&&u,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=n||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],h.href=l,-1!==h.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(b(u),p):S(u);c=(u=b(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var g=0,m=new Uint8Array(u.length),y=m.length;g<y;++g)m[g]=u.charCodeAt(g);u=new f([m],{type:c})}function b(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=r.length,o=0,a=new Uint8Array(i);o<i;++o)a[o]=r.charCodeAt(o);return new f([a],{type:n})}function S(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(i=u instanceof f?u:new f([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(i,p);if(a.URL)S(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===d)try{return S("data:"+c+";base64,"+a.btoa(i))}catch(e){return S("data:"+c+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){S(this.result)},o.readAsDataURL(i)}return!0}})),Bl=y((function(e,t){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(!s&&m)return m();if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o=m,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){var r=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,i,a,s,c,u,l=[],h=0,d=e.length,f=d,p="string"!==r.getTypeOf(e);h<e.length;)f=d-h,i=p?(t=e[h++],n=h<d?e[h++]:0,h<d?e[h++]:0):(t=e.charCodeAt(h++),n=h<d?e.charCodeAt(h++):0,h<d?e.charCodeAt(h++):0),a=t>>2,s=(3&t)<<4|n>>4,c=1<f?(15&n)<<2|i>>6:64,u=2<f?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(c)+o.charAt(u));return l.join("")},n.decode=function(e){var t,n,r,a,s,c,u=0,l=0,h="data:";if(e.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&f--,e.charAt(e.length-2)===o.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|f):new Array(0|f);u<e.length;)t=o.indexOf(e.charAt(u++))<<2|(a=o.indexOf(e.charAt(u++)))>>4,n=(15&a)<<4|(s=o.indexOf(e.charAt(u++)))>>2,r=(3&s)<<6|(c=o.indexOf(e.charAt(u++))),d[l++]=t,64!==s&&(d[l++]=n),64!==c&&(d[l++]=r);return d}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=r?"uint8array":"array";function c(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(c,a),c.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},c.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c("Deflate",e)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,a,l){var h,d,f=e.file,p=e.compression,v=l!==s.utf8encode,g=o.transformTo("string",l(f.name)),m=o.transformTo("string",s.utf8encode(f.name)),y=f.comment,b=o.transformTo("string",l(y)),S=o.transformTo("string",s.utf8encode(y)),w=m.length!==f.name.length,k=S.length!==y.length,C="",E="",x="",I=f.dir,_=f.date,A={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),v||!w&&!k||(T|=2048);var R=0,O=0;I&&(R|=16),"UNIX"===a?(O=798,R|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(f.unixPermissions,I)):(O=20,R|=function(e){return 63&(e||0)}(f.dosPermissions)),h=_.getUTCHours(),h<<=6,h|=_.getUTCMinutes(),h<<=5,h|=_.getUTCSeconds()/2,d=_.getUTCFullYear()-1980,d<<=4,d|=_.getUTCMonth()+1,d<<=5,d|=_.getUTCDate(),w&&(E=r(1,1)+r(c(g),4)+m,C+="up"+r(E.length,2)+E),k&&(x=r(1,1)+r(c(b),4)+S,C+="uc"+r(x.length,2)+x);var D="";return D+="\n\0",D+=r(T,2),D+=p.magic,D+=r(h,2),D+=r(d,2),D+=r(A.crc32,4),D+=r(A.compressedSize,4),D+=r(A.uncompressedSize,4),D+=r(g.length,2),D+=r(C.length,2),{fileRecord:u.LOCAL_FILE_HEADER+D+g+C,dirRecord:u.CENTRAL_FILE_HEADER+r(O,2)+D+r(b.length,2)+"\0\0\0\0"+r(R,4)+r(i,4)+g+C+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),c=e("../crc32"),u=e("../signature");function l(e,t,n,r){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,a),l.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,a){var s=o.transformTo("string",a(i));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var o=new i(t.streamFiles,n,t.platform,t.encodeFileName),a=0;try{e.forEach((function(e,n){a++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,u=n.date;n._compressWorker(i,s).withStreamInfo("file",{name:e,dir:c,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)})),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.0",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=e("./external"),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),c=e("./nodejsUtils");function u(e){return new i.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new a(t);return n.load(e),n})).then((function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var o=0;o<r.length;o++)n.push(u(r[o]));return i.Promise.all(n)})).then((function(e){for(var i=e.shift(),o=i.files,a=0;a<o.length;a++){var s=o[a],c=s.fileNameStr,u=r.resolve(s.fileNameStr);n.file(u,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(u).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e("readable-stream").Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=o.getTypeOf(t),s=o.extend(n||{},c);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=v(e)),s.createFolders&&(r=p(e))&&g.call(this,r,!0);var h,m="string"===i&&!1===s.binary&&!1===s.base64;n&&void 0!==n.binary||(s.binary=!m),(t instanceof u&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string"),h=t instanceof u||t instanceof a?t:d.isNode&&d.isStream(t)?new f(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var y=new l(e,h,s);this.files[e]=y}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),c=e("./defaults"),u=e("./compressedObject"),l=e("./zipObject"),h=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},v=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:c.createFolders,e=v(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,r.call(this,e,t,n),this;if(m(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(m(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var r=n.comment||this.comment||"";t=h.generateWorker(this,n,r)}catch(e){(t=new a("error")).error(e)}return new s(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&n===o[1]&&r===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new c(r.transformTo("uint8array",e)):new o(r.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var r=e("./GenericWorker"),i=e("../utils");function o(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,r),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e("./GenericWorker"),i=e("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,r),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),c=e("../external"),u=null;if(s.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t,n){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=n,r.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}l.prototype={accumulate:function(e){return function(e,t){return new c.Promise((function(n,i){var o=[],s=e._internalType,c=e._outputType,u=e._mimeType;e.on("data",(function(e,n){o.push(e),t&&t(n)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,o=0;for(n=0;n<t.length;n++)o+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),u);n(e)}catch(e){i(e)}o=[]})).resume()}))}(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){r.delay(t,arguments,n)})),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=l},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=0===new Blob([r],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=0===i.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,n.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,n,r,o,a,s=e.length,c=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):new Array(c),o=a=0;a<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,o,a=e.length,c=new Array(2*a);for(t=n=0;t<a;)if((i=e[t++])<128)c[n++]=i;else if(4<(o=s[i]))c[n++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(u,a),u.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),c=t;a!==t.length&&(i.uint8array?(c=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(c=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,r.inherits(l,a),l.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("./external");function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,n){var r=[],i=0,o=e.length;if(o<=n)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,o)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,o)))),i+=n;return r.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=u.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return u.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function h(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=l;var d={};d.string={string:s,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},d.array={string:l,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},d.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return o.newBufferFrom(e)}},d.nodebuffer={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return d[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],r=0;r<t.length;r++){var i=t[r];"."===i||""===i&&0!==r&&r!==t.length-1||(".."===i?n.pop():n.push(i))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":r.nodebuffer&&o.isBuffer(e)?"nodebuffer":r.uint8array&&e instanceof Uint8Array?"uint8array":r.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate((function(){e.apply(n||null,t||[])}))},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,o,s,u){return a.Promise.resolve(t).then((function(e){return r.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new a.Promise((function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)})):e})).then((function(t){var l=n.getTypeOf(t);return l?("arraybuffer"===l?t=n.transformTo("uint8array",t):"string"===l&&(u?t=i.decode(t):o&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):a.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=(e("./utf8"),e("./support"));function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),c=e("./compressions"),u=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in c)if(c.hasOwnProperty(t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),c=e("./stream/GenericWorker");r.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&r&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new c("error")).error(e)}return new i(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<u.length;h++)r.prototype[u[h]]=l;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(l),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var c=new e.MessageChannel;c.port1.onmessage=l,n=function(){c.port2.postMessage(0)}}var u=[];function l(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||n()}}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){var r=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&f(this,e)}function l(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){r((function(){var r;try{r=t(n)}catch(r){return o.reject(e,r)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}var a=p((function(){t(i,r)}));"error"===a.status&&r(a.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=u).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(i);return this.state!==c?h(n,this.state===s?e:t,this.outcome):this.queue.push(new l(n,e,t)),n},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=p(d,t);if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)f(e,r);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},u.reject=function(e){var t=new this(i);return o.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,u=new this(i);++c<n;)l(e[c],c);return u;function l(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==n||r||(r=!0,o.resolve(u,a))}),(function(e){r||(r=!0,o.reject(u,e))}))}},u.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);for(var r,a=-1,s=new this(i);++a<t;)r=e[a],this.resolve(r).then((function(e){n||(n=!0,o.resolve(s,e))}),(function(e){n||(n=!0,o.reject(s,e))}));return s}},{immediate:36}],38:[function(e,t,n){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),c=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,l)))throw new Error(a[n]);this._dict_set=!0}}function l(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}u.prototype.push=function(e,t){var n,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(n=r.deflate(s,a))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==a||(this.onEnd(0),!(s.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=u,n.deflate=l,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),c=e("./zlib/zstream"),u=e("./zlib/gzheader"),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function d(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,c,u,h,d,f=this.strm,p=this.options.chunkSize,v=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?f.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(n=r.inflate(f,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&v&&(d="string"==typeof v?o.string2buf(v):"[object ArrayBuffer]"===l.call(v)?new Uint8Array(v):v,n=r.inflateSetDictionary(this.strm,d)),n===a.Z_BUF_ERROR&&!0===g&&(n=a.Z_OK,g=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&n!==a.Z_STREAM_END&&(0!==f.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(c=o.utf8border(f.output,f.next_out),u=f.next_out-c,h=o.buf2string(f.output,c),f.next_out=u,f.avail_out=p-u,u&&i.arraySet(f.output,f.output,c,u,0),this.onData(h)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((0<f.avail_in||0===f.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(f.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,a,s=e.length,c=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),o=a=0;a<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,s=t||e.length,u=new Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)u[r++]=i;else if(4<(o=a[i]))u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&n<s;)i=i<<6|63&e[n++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return c(u,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),c=e("./messages"),u=-2,l=258,h=262,d=113;function f(e,t){return e.msg=c[t],t}function p(e){return(e<<1)-(4<e?9:0)}function v(e){for(var t=e.length;0<=--t;)e[t]=0}function g(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function m(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,g(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function b(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function S(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-h?e.strstart-(e.w_size-h):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+l,v=u[o+a-1],g=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(n=t)+a]===g&&u[n+a-1]===v&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<p);if(r=l-(p-o),o=p-l,a<r){if(e.match_start=t,s<=(a=r))break;v=u[o+a-1],g=u[o+a]}}}while((t=f[t&d])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function w(e){var t,n,r,o,c,u,l,d,f,p,v=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=v+(v-h)){for(i.arraySet(e.window,e.window,v,v,0),e.match_start-=v,e.strstart-=v,e.block_start-=v,t=n=e.hash_size;r=e.head[--t],e.head[t]=v<=r?r-v:0,--n;);for(t=n=v;r=e.prev[--t],e.prev[t]=v<=r?r-v:0,--n;);o+=v}if(0===e.strm.avail_in)break;if(u=e.strm,l=e.window,d=e.strstart+e.lookahead,p=void 0,(f=o)<(p=u.avail_in)&&(p=f),n=0===p?0:(u.avail_in-=p,i.arraySet(l,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=a(u.adler,l,p,d):2===u.state.wrap&&(u.adler=s(u.adler,l,p,d)),u.next_in+=p,u.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+3-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<h&&0!==e.strm.avail_in)}function k(e,t){for(var n,r;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-h&&(e.match_length=S(e,n)),e.match_length>=3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var n,r,i;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-h&&(e.match_length=S(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function E(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function x(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),v(this.dyn_ltree),v(this.dyn_dtree),v(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),v(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),v(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function I(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:d,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):f(e,u)}function _(e){var t=I(e);return 0===t&&function(e){e.window_size=2*e.w_size,v(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function A(e,t,n,r,o,a){if(!e)return u;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),o<1||9<o||8!==n||r<8||15<r||t<0||9<t||a<0||4<a)return f(e,u);8===r&&(r=9);var c=new x;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=o+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<o+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=a,c.method=n,_(e)}r=[new E(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-h&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new E(4,4,8,4,k),new E(4,5,16,8,k),new E(4,6,32,32,k),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)],n.deflateInit=function(e,t){return A(e,t,8,15,8,0)},n.deflateInit2=A,n.deflateReset=_,n.deflateResetKeep=I,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?u:(e.state.gzhead=t,0):u},n.deflate=function(e,t){var n,i,a,c;if(!e||!e.state||5<t||t<0)return e?f(e,u):u;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return f(e,0===e.avail_out?-5:u);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=d);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=d,b(i,h),0!==i.strstart&&(b(i,e.adler>>>16),b(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===c&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===c&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(e),i.pending+2<=i.pending_buf_size&&(y(i,255&e.adler),y(i,e.adler>>8&255),e.adler=0,i.status=d)):i.status=d),0!==i.pending){if(g(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(n)&&4!==t)return f(e,-5);if(666===i.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var S=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+l;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=l-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==S&&4!==S||(i.status=666),1===S||3===S)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===S&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(v(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&e.adler),y(i,e.adler>>8&255),y(i,e.adler>>16&255),y(i,e.adler>>24&255),y(i,255&e.total_in),y(i,e.total_in>>8&255),y(i,e.total_in>>16&255),y(i,e.total_in>>24&255)):(b(i,e.adler>>>16),b(i,65535&e.adler)),g(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},n.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&t!==d&&666!==t?f(e,u):(e.state=null,t===d?f(e,-3):0):u},n.deflateSetDictionary=function(e,t){var n,r,o,s,c,l,h,d,f=t.length;if(!e||!e.state)return u;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return u;for(1===s&&(e.adler=a(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&(v(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,t,f-n.w_size,n.w_size,0),t=d,f=n.w_size),c=e.avail_in,l=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,w(n);n.lookahead>=3;){for(r=n.strstart,o=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--o;);n.strstart=r,n.lookahead=2,w(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=l,e.input=h,e.avail_in=c,n.wrap=s,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n,r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I;n=e.state,r=e.next_in,x=e.input,i=r+(e.avail_in-5),o=e.next_out,I=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),c=n.dmax,u=n.wsize,l=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,v=n.lencode,g=n.distcode,m=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),b=v[f&m];t:for(;;){if(f>>>=S=b>>>24,p-=S,0==(S=b>>>16&255))I[o++]=65535&b;else{if(!(16&S)){if(0==(64&S)){b=v[(65535&b)+(f&(1<<S)-1)];continue t}if(32&S){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&b,(S&=15)&&(p<S&&(f+=x[r++]<<p,p+=8),w+=f&(1<<S)-1,f>>>=S,p-=S),p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),b=g[f&y];n:for(;;){if(f>>>=S=b>>>24,p-=S,!(16&(S=b>>>16&255))){if(0==(64&S)){b=g[(65535&b)+(f&(1<<S)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(k=65535&b,p<(S&=15)&&(f+=x[r++]<<p,(p+=8)<S&&(f+=x[r++]<<p,p+=8)),c<(k+=f&(1<<S)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(f>>>=S,p-=S,(S=o-a)<k){if(l<(S=k-S)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(E=d,(C=0)===h){if(C+=u-S,S<w){for(w-=S;I[o++]=d[C++],--S;);C=o-k,E=I}}else if(h<S){if(C+=u+h-S,(S-=h)<w){for(w-=S;I[o++]=d[C++],--S;);if(C=0,h<w){for(w-=S=h;I[o++]=d[C++],--S;);C=o-k,E=I}}}else if(C+=h-S,S<w){for(w-=S;I[o++]=d[C++],--S;);C=o-k,E=I}for(;2<w;)I[o++]=E[C++],I[o++]=E[C++],I[o++]=E[C++],w-=3;w&&(I[o++]=E[C++],1<w&&(I[o++]=E[C++]))}else{for(C=o-k;I[o++]=I[C++],I[o++]=I[C++],I[o++]=I[C++],2<(w-=3););w&&(I[o++]=I[C++],1<w&&(I[o++]=I[C++]))}break}}break}}while(r<i&&o<s);r-=w=p>>3,f&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=f,n.bits=p}},{}],49:[function(e,t,n){var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),c=-2;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):c}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):c}function f(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?c:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,d(e))):c}function p(e,t){var n,r;return e?(r=new l,(e.state=r).window=null,0!==(n=f(e,t))&&(e.state=null),n):c}var v,g,m=!0;function y(e){if(m){var t;for(v=new r.Buf32(512),g=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=v,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=d,n.inflateReset2=f,n.inflateResetKeep=h,n.inflateInit=function(e){return p(e,15)},n.inflateInit2=p,n.inflate=function(e,t){var n,l,h,d,f,p,v,g,m,S,w,k,C,E,x,I,_,A,T,R,O,D,N,L,P=0,M=new r.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;12===(n=e.state).mode&&(n.mode=13),f=e.next_out,h=e.output,v=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,g=n.hold,m=n.bits,S=p,w=v,D=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(2&n.wrap&&35615===g){M[n.check=0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0),m=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",n.mode=30;break}if(m-=4,O=8+(15&(g>>>=4)),0===n.wbits)n.wbits=O;else if(O>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<O,e.adler=n.check=1,n.mode=512&g?10:12,m=g=0;break;case 2:for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(n.flags=g,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0,n.mode=3;case 3:for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.head&&(n.head.time=g),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,M[2]=g>>>16&255,M[3]=g>>>24&255,n.check=o(n.check,M,4,0)),m=g=0,n.mode=4;case 4:for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(k=n.length)&&(k=p),k&&(n.head&&(O=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,l,d,k,O)),512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,n.length-=k),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;for(k=0;O=l[d+k++],n.head&&O&&n.length<65536&&(n.head.name+=String.fromCharCode(O)),O&&k<p;);if(512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break e;for(k=0;O=l[d+k++],n.head&&O&&n.length<65536&&(n.head.comment+=String.fromCharCode(O)),O&&k<p;);if(512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,O)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}m=g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}e.adler=n.check=u(g),m=g=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){g>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}switch(n.last=1&g,m-=1,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(y(n),n.mode=20,6!==t)break;g>>>=2,m-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,m=g=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(k=n.length){if(p<k&&(k=p),v<k&&(k=v),0===k)break e;r.arraySet(h,l,d,k,f),p-=k,d+=k,v-=k,f+=k,n.length-=k;break}n.mode=12;break;case 17:for(;m<14;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(n.nlen=257+(31&g),g>>>=5,m-=5,n.ndist=1+(31&g),g>>>=5,m-=5,n.ncode=4+(15&g),g>>>=4,m-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.lens[B[n.have++]]=7&g,g>>>=3,m-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},D=s(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,D){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;I=(P=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(_<16)g>>>=x,m-=x,n.lens[n.have++]=_;else{if(16===_){for(L=x+2;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g>>>=x,m-=x,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}O=n.lens[n.have-1],k=3+(3&g),g>>>=2,m-=2}else if(17===_){for(L=x+3;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=x,O=0,k=3+(7&(g>>>=x)),g>>>=3,m-=3}else{for(L=x+7;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=x,O=0,k=11+(127&(g>>>=x)),g>>>=7,m-=7}if(n.have+k>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;k--;)n.lens[n.have++]=O}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,N={bits:n.lenbits},D=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,D){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},D=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,D){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=p&&258<=v){e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,a(e,w),f=e.next_out,h=e.output,v=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,g=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;I=(P=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(I&&0==(240&I)){for(A=x,T=I,R=_;I=(P=n.lencode[R+((g&(1<<A+T)-1)>>A)])>>>16&255,_=65535&P,!(A+(x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=A,m-=A,n.back+=A}if(g>>>=x,m-=x,n.back+=x,n.length=_,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(L=n.extra;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;I=(P=n.distcode[g&(1<<n.distbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(0==(240&I)){for(A=x,T=I,R=_;I=(P=n.distcode[R+((g&(1<<A+T)-1)>>A)])>>>16&255,_=65535&P,!(A+(x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=A,m-=A,n.back+=A}if(g>>>=x,m-=x,n.back+=x,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=_,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(L=n.extra;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===v)break e;if(k=w-v,n.offset>k){if((k=n.offset-k)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}C=k>n.wnext?(k-=n.wnext,n.wsize-k):n.wnext-k,k>n.length&&(k=n.length),E=n.window}else E=h,C=f-n.offset,k=n.length;for(v<k&&(k=v),v-=k,n.length-=k;h[f++]=E[C++],--k;);0===n.length&&(n.mode=21);break;case 26:if(0===v)break e;h[f++]=n.length,v--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===p)break e;p--,g|=l[d++]<<m,m+=8}if(w-=v,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?o(n.check,h,w,f-w):i(n.check,h,w,f-w)),w=v,(n.flags?g:u(g))!==n.check){e.msg="incorrect data check",n.mode=30;break}m=g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}m=g=0}n.mode=29;case 29:D=1;break e;case 30:D=-3;break e;case 31:return-4;case 32:default:return c}return e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,(n.wsize||w!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&b(e,e.output,e.next_out,w-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,w-=e.avail_out,e.total_in+=S,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?o(n.check,h,w,e.next_out-w):i(n.check,h,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==S&&0===w||4===t)&&0===D&&(D=-5),D)},n.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?c:((n.head=t).done=!1,0):c},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?c:11===n.mode&&i(1,t,r,0)!==n.check?-3:b(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):c},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,c,u,l,h,d){var f,p,v,g,m,y,b,S,w,k=d.bits,C=0,E=0,x=0,I=0,_=0,A=0,T=0,R=0,O=0,D=0,N=null,L=0,P=new r.Buf16(16),M=new r.Buf16(16),B=null,G=0;for(C=0;C<=15;C++)P[C]=0;for(E=0;E<c;E++)P[t[n+E]]++;for(_=k,I=15;1<=I&&0===P[I];I--);if(I<_&&(_=I),0===I)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(x=1;x<I&&0===P[x];x++);for(_<x&&(_=x),C=R=1;C<=15;C++)if(R<<=1,(R-=P[C])<0)return-1;if(0<R&&(0===e||1!==I))return-1;for(M[1]=0,C=1;C<15;C++)M[C+1]=M[C]+P[C];for(E=0;E<c;E++)0!==t[n+E]&&(h[M[t[n+E]]++]=E);if(y=0===e?(N=B=h,19):1===e?(N=i,L-=257,B=o,G-=257,256):(N=a,B=s,-1),C=x,m=l,T=E=D=0,v=-1,g=(O=1<<(A=_))-1,1===e&&852<O||2===e&&592<O)return 1;for(;;){for(b=C-T,w=h[E]<y?(S=0,h[E]):h[E]>y?(S=B[G+h[E]],N[L+h[E]]):(S=96,0),f=1<<C-T,x=p=1<<A;u[m+(D>>T)+(p-=f)]=b<<24|S<<16|w|0,0!==p;);for(f=1<<C-1;D&f;)f>>=1;if(0!==f?(D&=f-1,D+=f):D=0,E++,0==--P[C]){if(C===I)break;C=t[n+h[E]]}if(_<C&&(D&g)!==v){for(0===T&&(T=_),m+=x,R=1<<(A=C-T);A+T<I&&!((R-=P[A+T])<=0);)A++,R<<=1;if(O+=1<<A,1===e&&852<O||2===e&&592<O)return 1;u[v=D&g]=_<<24|A<<16|m-l|0}}return 0!==D&&(u[m+D]=C-T<<24|64<<16|0),d.bits=_,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){var r=e("../utils/common");function i(e){for(var t=e.length;0<=--t;)e[t]=0}var o=256,a=286,s=30,c=15,u=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);i(f);var p=new Array(60);i(p);var v=new Array(512);i(v);var g=new Array(256);i(g);var m=new Array(29);i(m);var y,b,S,w=new Array(s);function k(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function C(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E(e){return e<256?v[e]:v[256+(e>>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,x(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function _(e,t,n){I(e,n[2*t],n[2*t+1])}function A(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function T(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=c;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=A(o[s]++,s))}}function R(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8<e.bi_valid?x(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function D(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function N(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&D(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!D(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function L(e,t,n){var r,i,a,s,c=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],i=e.pending_buf[e.l_buf+c],c++,0===r?_(e,i,t):(_(e,(a=g[i])+o+1,t),0!==(s=u[a])&&I(e,i-=m[a],s),_(e,a=E(--r),n),0!==(s=l[a])&&I(e,r-=w[a],s)),c<e.last_lit;);_(e,256,t)}function P(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)N(e,o,n);for(i=u;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,N(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,u=t.dyn_tree,l=t.max_code,h=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,v=t.stat_desc.max_length,g=0;for(o=0;o<=c;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)v<(o=u[2*u[2*(r=e.heap[n])+1]+1]+1)&&(o=v,g++),u[2*r+1]=o,l<r||(e.bl_count[o]++,a=0,p<=r&&(a=f[r-p]),s=u[2*r],e.opt_len+=s*(o+a),d&&(e.static_len+=s*(h[2*r+1]+a)));if(0!==g){do{for(o=v-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[v]--,g-=2}while(0<g);for(o=v;0!==o;o--)for(r=e.bl_count[o];0!==r;)l<(i=e.heap[--n])||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(e,t),T(o,l,e.bl_count)}function M(e,t,n){var r,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<c&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(s=0)===a?(c=138,3):i===a?(c=6,3):(c=7,4))}function B(e,t,n){var r,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<c&&i===a)){if(s<u)for(;_(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(_(e,i,e.bl_tree),s--),_(e,16,e.bl_tree),I(e,s-3,2)):s<=10?(_(e,17,e.bl_tree),I(e,s-3,3)):(_(e,18,e.bl_tree),I(e,s-11,7));o=i,u=(s=0)===a?(c=138,3):i===a?(c=6,3):(c=7,4)}}i(w);var G=!1;function j(e,t,n,i){I(e,0+(i?1:0),3),function(e,t,n,i){O(e),x(e,n),x(e,~n),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n)}n._tr_init=function(e){G||(function(){var e,t,n,r,i,o=new Array(16);for(r=n=0;r<28;r++)for(m[r]=n,e=0;e<1<<u[r];e++)g[n++]=r;for(g[n-1]=r,r=i=0;r<16;r++)for(w[r]=i,e=0;e<1<<l[r];e++)v[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,e=0;e<1<<l[r]-7;e++)v[256+i++]=r;for(t=0;t<=c;t++)o[t]=0;for(e=0;e<=143;)f[2*e+1]=8,e++,o[8]++;for(;e<=255;)f[2*e+1]=9,e++,o[9]++;for(;e<=279;)f[2*e+1]=7,e++,o[7]++;for(;e<=287;)f[2*e+1]=8,e++,o[8]++;for(T(f,287,o),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=A(e,5);y=new k(f,u,257,a,c),b=new k(p,l,0,s,c),S=new k(new Array(0),h,0,19,7)}(),G=!0),e.l_desc=new C(e.dyn_ltree,y),e.d_desc=new C(e.dyn_dtree,b),e.bl_desc=new C(e.bl_tree,S),e.bi_buf=0,e.bi_valid=0,R(e)},n._tr_stored_block=j,n._tr_flush_block=function(e,t,n,r){var i,a,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),P(e,e.l_desc),P(e,e.d_desc),s=function(e){var t;for(M(e,e.dyn_ltree,e.l_desc.max_code),M(e,e.dyn_dtree,e.d_desc.max_code),P(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?j(e,t,n,r):4===e.strategy||a===i?(I(e,2+(r?1:0),3),L(e,f,p)):(I(e,4+(r?1:0),3),function(e,t,n,r){var i;for(I(e,t-257,5),I(e,n-1,5),I(e,r-4,4),i=0;i<r;i++)I(e,e.bl_tree[2*d[i]+1],3);B(e,e.dyn_ltree,t-1),B(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),L(e,e.dyn_ltree,e.dyn_dtree)),R(e),r&&O(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(g[n]+o+1)]++,e.dyn_dtree[2*E(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){I(e,2,3),_(e,256,f),function(e){16===e.bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var n,r,i,o,a=1,s={},c=!1,u=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",f,!1):e.attachEvent("onmessage",f),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(d,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return s[a]=i,n(a),a++},l.clearImmediate=h}function h(e){delete s[e]}function d(e){if(c)setTimeout(d,0,e);else{var t=s[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),c=!1}}}}function f(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&d(+t.data.slice(o.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)}));qt({target:"Array",stat:!0},{isArray:tn});var Gl={0:"XYSDK:950102",2001:"XYSDK:950104",4104:"XYSDK:950104",4103:"XYSDK:950143",2040:"XYSDK:950141",2009:"XYSDK:950142",10004010:"XYSDK:950144",10002e3:"XYSDK:950144"},jl={en_US:{"XYSDK:950010":"Custom message length limit, please check","XYSDK:950120":"success","XYSDK:950112":"WebSocket connecting time out","XYSDK:950113":"WebSocket connecting is stopped,reconnecting now...","XYSDK:950114":"WebSocket connecting is stopped","XYSDK:950115":"WebSocket connecting error","XYSDK:950116":"The browser don't support Websocket, please use Chrome","XYSDK:950201":"The client has finished calling and it is forbidden to join the meeting","XYSDK:950202":"Peer need to be created before operation","XYSDK:950203":"Stream need to be created before operation","XYSDK:950223":"Failed to start or stop Audio&Video","XYSDK:950224":"No Mic permission","XYSDK:950225":"No camera permission","XYSDK:950230":"Hang up the meeting","XYSDK:950102":"Login failed","XYSDK:950101":"Wrong parameter","XYSDK:950103":"Failed to get user information","XYSDK:950104":"Incorrect account or password","XYSDK:950141":"The password has expired. Please change the password and log in again","XYSDK:950142":'The mobile number conflicts. Please use the mode of "+country code-mobile number"',"XYSDK:950143":"Your password inputting exceeds 5 times within 30 minutes, the account will be locked for 30 minutes","XYSDK:950144":"Login has expired, please log in again","XYSDK:950601":"Custom layout mode does not support switching layouts","XYSDK:950602":"Custom layout mode does not support requesting stream when full screen","XYSDK:950603":"Custom layout mode does not support paging","XYSDK:950105":"Invalid meeting ID","XYSDK:950106":"Failed to call the number , please try again later","XYSDK:950107":"Require meeting password","XYSDK:950108":"Wrong meeting password","XYSDK:950109":"The meeting ID is not supported","XYSDK:950110":"Failed to join meeting","XYSDK:950130":"The protocol must be HTTPS, or the host name must be Localhost","XYSDK:950111":"Interface request failed","XYSDK:950204":"Failed to create a Client","XYSDK:950517":"Call failed","XYSDK:950518":"Successful call","XYSDK:950519":"Calling, please wait","XYSDK:950530":"Failed to request a full screen stream","XYSDK:950401":"No camera or Mic device","XYSDK:950402":"Can't access camera or Mic device","XYSDK:950403":"Constraint setting cannot be satisfied","XYSDK:950404":"Mic or camera access denied","XYSDK:950405":"The collection flow constraint is null","XYSDK:950406":"Failed to create media stream","XYSDK:950407":"Failed to switch speakers","XYSDK:950501":"The user cancels the screen share","XYSDK:950502":"Operation abnormal,and can't get the screen","XYSDK:950503":"Failed to get the screen","XYSDK:950504":"No video source is available for capture","XYSDK:950505":"Hardware or operating system error or lock, and it prevent sharing screen","XYSDK:950506":"Capture screen-Constraint setting failed","XYSDK:950507":"Capture screen-An impermissible constraint setting is specified","XYSDK:950508":"The user has refused to authorize the capture screen operation","XYSDK:950509":"Already sharing screen","XYSDK:950510":"Not selected SourceId","XYSDK:950511":"Operation abnormal,and can't get the screen","XYSDK:950512":"Failed to share content","XYSDK:950513":"Failed to end sharing","XYSDK:950515":"Failed to get the codec format supported by the sender","XYSDK:950408":"Failed to obtain device permissions","XYSDK:950409":"Failed to get device list","XYSDK:950410":"Failed to switch media input device","XYSDK:950514":"No local media streaming","XYSDK:950210":"Failed to switch debug mode","XYSDK:950312":"Failed to start the tour","XYSDK:950205":"Stream is not created","XYSDK:950206":"Stream is created successfully","XYSDK:950207":"DomStream is created successfully","XYSDK:950208":"Failed to create Stream","XYSDK:950209":"Client is not created","XYSDK:950301":"The meeting did not start","XYSDK:953901":"Recording parameter error","XYSDK:953902":"No recording permission","XYSDK:953903":"The cloud conference room does not belong to any enterprise and cannot be recorded","XYSDK:953904":"Insufficient recording space","XYSDK:953905":"Recording did not start"},zh_CN:{"XYSDK:950010":"自定义消息长度超过限制,请检查","XYSDK:950120":"成功","XYSDK:950112":"WebSocket连接超时","XYSDK:950113":"WebSocket连接已关闭,正在重连...","XYSDK:950114":"WebSocket连接已关闭","XYSDK:950115":"WebSocket连接错误","XYSDK:950116":"当前浏览器不支持Websocket,请使用Chrome浏览器","XYSDK:950201":"Client已关闭,禁止加入会议","XYSDK:950202":"需要创建Peer才可操作","XYSDK:950203":"需要创建Stream才可操作","XYSDK:950223":"音视频开启关闭操作失败","XYSDK:950224":"没有麦克风权限","XYSDK:950225":"没有摄像头权限","XYSDK:950230":"挂断会议","XYSDK:950102":"登录失败","XYSDK:950101":"参数有误,请检查","XYSDK:950103":"获取用户信息失败","XYSDK:950104":"账号或密码错误","XYSDK:950141":"该账号密码已过期,请修改密码后重新登录","XYSDK:950142":'登录手机号冲突,请使用"+国家码-手机号"的模式输入',"XYSDK:950143":"您登录失败过于频繁,请30分钟后重试","XYSDK:950144":"登录已失效,请重新登录","XYSDK:950601":"自定义布局模式不支持切换布局","XYSDK:950602":"自定义布局模式不支持全屏请流","XYSDK:950603":"自定义布局模式不支持分页","XYSDK:950105":"无效的会议号","XYSDK:950106":"呼叫失败,请稍后重试","XYSDK:950107":"需要入会密码","XYSDK:950108":"入会密码错误","XYSDK:950109":"暂不支持呼叫此号码","XYSDK:950110":"免密入会失败","XYSDK:950130":"协议必须是 https,或者主机名必须是 localhost","XYSDK:950111":"接口请求失败","XYSDK:950204":"Client创建失败","XYSDK:950517":"呼叫失败","XYSDK:950518":"呼叫成功","XYSDK:950519":"正在呼叫中,请等候","XYSDK:950530":"全屏请流失败","XYSDK:950401":"缺失摄像头或麦克风设备","XYSDK:950402":"摄像头或麦克风设备无法访问","XYSDK:950403":"约束设置无法被满足","XYSDK:950404":"麦克风或摄像头使用权限被拒绝","XYSDK:950405":"采集流约束设置为空","XYSDK:950406":"创建媒体流失败","XYSDK:950407":"切换扬声器失败","XYSDK:950501":"用户取消采集屏幕操作","XYSDK:950502":"操作异常采集屏幕失败","XYSDK:950503":"采集屏幕失败","XYSDK:950504":"没有屏幕视频源可用于捕获","XYSDK:950505":"硬件或操作系统错误或锁定,阻止了采集屏幕共享","XYSDK:950506":"采集屏幕-约束设置失败","XYSDK:950507":"采集屏幕-指定了不允许的约束设置\t","XYSDK:950508":"用户已拒绝授权采集屏幕操作","XYSDK:950509":"已经在分享屏幕","XYSDK:950510":"没有 selectedSourceId\t","XYSDK:950511":"操作异常采集屏幕失败","XYSDK:950512":"分享content失败","XYSDK:950513":"结束分享失败\t","XYSDK:950515":"获取发送端支持的编解码格式 失败\t","XYSDK:950408":"获取设备权限失败","XYSDK:950409":"获取设备列表失败","XYSDK:950410":"切换媒体输入设备失败","XYSDK:950514":"本地无媒体流","XYSDK:950312":"开启巡课失败","XYSDK:950205":"Stream对象未创建","XYSDK:950206":"Stream创建成功","XYSDK:950207":"domStream创建成功","XYSDK:950208":"Stream创建失败","XYSDK:950209":"Client对象未创建","XYSDK:950210":"切换调试模式失败","XYSDK:950301":"会议未开始","XYSDK:953901":"录制参数错误","XYSDK:953902":"没有录制权限","XYSDK:953903":"云会议室不属于任何企业,无法录制","XYSDK:953904":"录制空间不足","XYSDK:953905":"录制未开始"},zh_TW:{"XYSDK:950010":"自定義消息長度超過限製,請檢查","XYSDK:950120":"成功","XYSDK:950112":"WebSocket連接超時","XYSDK:950113":"WebSocket連接已關閉,正在重連...","XYSDK:950114":"WebSocket連接已關閉","XYSDK:950115":"WebSocket連接錯誤","XYSDK:950116":"當前瀏覽器不支持Websocket,請使用Chrome瀏覽器","XYSDK:950201":"Client已關閉,禁止加入會議","XYSDK:950202":"需要創建Peer才可操作","XYSDK:950203":"需要創建Stream才可操作","XYSDK:950223":"音視頻開啟關閉操作失敗","XYSDK:950224":"沒有麥克風權限","XYSDK:950225":"沒有攝像頭權限","XYSDK:950230":"掛斷會議","XYSDK:950102":"登錄失敗","XYSDK:950101":"參數有誤,請檢查","XYSDK:950103":"獲取用戶信息失敗","XYSDK:950104":"賬號或密碼錯誤","XYSDK:950141":"該賬號密碼已過期,請修改密碼後重新登錄","XYSDK:950142":'登錄手機號衝突,請使用"+國家碼-手機號"的模式輸入',"XYSDK:950143":"您登錄失敗過於頻繁,請30分鐘後重試","XYSDK:950144":"登錄已失效,請重新登錄","XYSDK:950601":"自定義佈局模式不支持切換佈局","XYSDK:950602":"自定義佈局模式不支持全屏請流","XYSDK:950603":"自定義佈局模式不支持分頁","XYSDK:950105":"無效的會議號","XYSDK:950106":"呼叫失敗,請稍後重試","XYSDK:950107":"需要入會密碼","XYSDK:950108":"入會密碼錯誤","XYSDK:950109":"暫不支持呼叫此號碼","XYSDK:950110":"免密入會失敗","XYSDK:950130":"協議必須是 https,或者主機名必須是 localhost","XYSDK:950111":"接口請求失敗","XYSDK:950204":"Client創建失敗","XYSDK:950517":"呼叫失敗","XYSDK:950518":"呼叫成功","XYSDK:950519":"正在呼叫中,請等候","XYSDK:950530":"全屏請流失敗","XYSDK:950401":"缺失攝像頭或麥克風設備","XYSDK:950402":"攝像頭或麥克風設備無法訪問","XYSDK:950403":"約束設置無法被滿足","XYSDK:950404":"麥克風或攝像頭使用權限被拒絕","XYSDK:950405":"採集流約束設置為空","XYSDK:950406":"創建媒體流失敗","XYSDK:950407":"切換揚聲器失敗","XYSDK:950501":"用戶取消採集屏幕操作","XYSDK:950502":"操作異常採集屏幕失敗","XYSDK:950503":"採集屏幕失敗","XYSDK:950504":"沒有屏幕視頻源可用於捕獲","XYSDK:950505":"硬件或操作系統錯誤或鎖定,阻止了採集屏幕共享","XYSDK:950506":"採集屏幕-約束設置失敗","XYSDK:950507":"採集屏幕-指定了不允許的約束設置\t","XYSDK:950508":"用戶已拒絕授權採集屏幕操作","XYSDK:950509":"已經在分享屏幕","XYSDK:950510":"沒有 selectedSourceId\t","XYSDK:950511":"操作異常採集屏幕失敗","XYSDK:950512":"分享content失敗","XYSDK:950513":"結束分享失敗\t","XYSDK:950515":"獲取發送端支持的編解碼格式 失敗\t","XYSDK:950408":"獲取設備權限失敗","XYSDK:950409":"獲取設備列表失敗","XYSDK:950410":"切換媒體輸入設備失敗","XYSDK:950514":"本地無媒體流","XYSDK:950210":"切換調試模式失敗","XYSDK:950312":"開啟巡課失敗","XYSDK:950205":"Stream對象未創建","XYSDK:950206":"Stream創建成功","XYSDK:950207":"domStream創建成功","XYSDK:950208":"Stream創建失敗","XYSDK:950209":"Client對象未創建","XYSDK:950301":"會議未開始","XYSDK:953901":"錄製參數錯誤","XYSDK:953902":"沒有錄製權限","XYSDK:953903":"雲會議室不屬於任何企業,無法錄製","XYSDK:953904":"錄製空間不足","XYSDK:953905":"錄製未開始"}},Hl={version:"3.6.00",zh_CN:{"CHARGE:646":"云会议室已达企业允许呼入的上限","CHARGE:647":"终端已达允许呼入的上限","CHARGE:644":"没有呼叫权限","CHARGE:645":"云会议室已达允许呼入的上限","CHARGE:648":"终端已达企业允许呼入的上限","CHARGE:649":"预约会议未到开始时间,无法加入","PS:400":"不支持跨云呼叫","SIG:421":"对方终端不允许外人拨打,请与对方确认后再拨","SIG:422":"您已被主持人移出会议","SIG:420":"号码不正确","SIG:789":"录制已停止","SIG:423":"UNKNOWN","SIG:424":"主持人已结束会议","CHARGE:642":"呼叫失败,企业IPPBX方数已达上限","CHARGE:643":"调度失败,企业监控调度方数已达上限\t","CHARGE:640":"所属部门的云会议室存储空间已满,不能再发起录制","CHARGE:641":"所属企业的云会议室存储空间已满,不能再发起录制","CHARGE:635":"账户余额不足,不能发起PSTN通话,请联系管理员充值后再尝试。","CHARGE:636":"云会议室已达允许呼入的上限","CHARGE:633":"无法呼叫当前号码,您的终端仅允许呼叫通讯录上的用户号码","CHARGE:634":"账户余额支付范围不可用于PSTN通话,请联系管理员开启后再尝试。","CHARGE:639":"云会议室存储空间已满,不能再发起录制","CHARGE:637":"云会议室已达部门允许呼入的上限","CHARGE:638":"云会议室已达企业允许呼入的上限","SIG:419":"对方已开启办公模式。您可滑动下方按钮,发起呼叫","SIG:416":"当前在线呼叫数已达服务上限,请稍候再试","SIG:417":"密码输入超时","SIG:410":"呼叫失败,请再试一次","SIG:4445":"云会议室存储空间已满,不能再发起录制","SIG:411":"终端APP版本过低,请升级后再试","SIG:4446":"所属部门的云会议室存储空间已满,不能再发起录制","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":"密码错误次数达到3次,请稍后重试","SIG:4449":"无效的分享content类型","SIG:415":"同步呼叫信息失败,请稍后再试","SIG:412":"对方版本过低,通话无法接通","SIG:4447":"所属企业的云会议室存储空间已满,不能再发起录制","SIG:413":"对方设置了免打扰","SIG:4448":"未知错误","SIG:4441":"录制超时,请稍后再试","CHARGE:631":"此云会议室为按参会时长计费的会议室。您的账户余额已用尽,不能在此云会议室发起会议,请联系管理员充值或选择其他云会议室。","SIG:4442":"UNKNOWN","CHARGE:632":"主动呼叫权限已被管理员关闭,无法发起呼叫","SIG:4440":"分享content超时,请稍后再试","CHARGE:630":"当前云会议室不允许邀请通讯录外成员","CHARGE:624":"呼叫失败。您呼叫的终端端口使用服务已过期","CHARGE:625":"此会议有终端端口服务已过期,无法支持多方呼叫","CHARGE:622":"没有监看权限","REC:511":"录制服务暂时不可用,请稍后再试","CHARGE:623":"呼叫失败。终端端口使用服务已过期,不能加入云会议室或多方通话。","REC:512":"录制服务暂时不可用,请稍后再试","CHARGE:628":"您呼叫的云会议室不允许匿名用户呼入,请登录或注册后重新呼叫","CHARGE:629":"对方正在会议中,且该会议不允许通讯录外成员呼入,请稍后再试","CHARGE:626":"此会议有终端端口服务已过期,无法邀请更多人加入","CHARGE:627":"呼叫的云会议室不允许通讯录外成员呼入,请联系云会议室管理员","SIG:1503":"分配监控资源失败","SIG:4456":"连接已断开,请重新入会","SIG:4457":"号码输入有误,请核对后重新拨打!","SIG:441":"当前在线呼叫数已达网关服务上限,请稍候重试","SIG:4454":"通话不存在,请核对后重试","SIG:4455":"服务器未连接,请稍后重试","SIG:445":"UNKNOWN","SIG:1501":"shuttle获取MA失败","SIG:4458":"网络异常,呼叫已断开","SIG:1502":"shuttle获取媒体资源失败","SIG:4459":"号码输入有误,请核对后重新拨打!","SIG:4452":"录制失败","CHARGE:620":"无单位归属,不能呼叫H.323设备\t","SIG:440":"云会议室密码不正确,请重试","SIG:4453":"通话已存在,请稍后再试","CHARGE:621":"呼叫失败,单位H.323方数不足","SIG:4450":"不支持分享content","SIG:4451":"带宽不足,分享内容失败","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","REC:400":"信令服务与录制服务内部错误。","CHARGE:611":"UNKNOWN","REC:401":"录制服务暂时不可用,请稍后再试","CHARGE:612":"UNKNOWN","REC:402":"录制服务暂时不可用,请稍后再试","CHARGE:617":"UNKNOWN","REC:403":"录制服务暂时不可用,请稍后再试","CHARGE:618":"UNKNOWN","REC:404":"录制不存在","CHARGE:615":"UNKNOWN","REC:405":"录制服务暂时不可用,请稍后再试","CHARGE:616":"会议已被锁定,无法加入,请联系会议发起人解锁后进入。","CHARGE:619":"呼叫失败。终端的云服务端口已过期,请联系管理员续费购买。","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content发送时会议尚未开始","SIG:431":"Content Server创建资源失败INVALID_PASSWORD","SIG:4466":"输入密码超时","REC:406":"录制服务暂时不可用,请稍后再试","SIG:4460":"号码输入有误,请核对后重新拨打!","CHARGE:610":"呼叫失败,您的企业已禁止PSTN通话功能,请联系您的管理员!","SIG:4461":"号码输入有误,请核对后重新拨打!","SIG:1404":"UNKNOWN","SIG:469":"录制正在进行,请勿重复发起录制","CHARGE:441":"当前在线呼叫数已达网关服务上限,请稍候重试","SIG:461":"录制时,本地空间即将耗尽","SIG:462":"录制时,本地空间已耗尽","SIG:580":"pstn呼叫时,第三方服务器报错","REC:465":"本地已开启录制,不能重复发起录制","REC:466":"录制服务暂时不可用,请稍后再试","REC:467":"已达最大录制方数,不能发起录制","REC:468":"录制的存储空间已满,您无法开始录制。\n请删除已有的录制视频,\n或联系管理员购买更多存储空间","REC:469":"UNKNOWN","REC:460":"没有录制权限","REC:463":"录制的存储空间已满,您无法开始录制。\n请删除已有的录制视频,\n或联系管理员购买更多存储空间","SIG:456":"呼叫失败,请再试一次","CHARGE:671":"会议未开始,请等待主持人开始会议后加入","CHARGE:672":"已被移出本次会议,无法入会","CHARGE:670":"您有一场会议正在进行,请先结束该会议","SIG:450":"您的终端目前无法支持此类呼叫","CHARGE:675":"没有可用的视频监控资源","CHARGE:676":"视频监控服务并发超过限制","CHARGE:673":"监控服务已经过期","CCC:501":"数据库操作失败","CHARGE:674":"视频监控服务没有企业归属","CCC:500":"内部服务器错误","CHARGE:668":"会议未通过审批或未到预约开始时间","CCC:602":"输入超时","CHARGE:669":"管理员禁用点对点呼叫","CCC:601":"呼叫超时","CHARGE:666":"超过会议审批允许的最大成员数量,入会失败","CCC:604":"入会超时","CHARGE:667":"超过会议审批允许的最大成员数量,邀请失败","CCC:603":"评价结束","SIG:487":"呼叫已取消","SIG:488":"终端试用期已过,无法继续为您服务了","SIG:485":"已达最大呼叫时长,呼叫已断开","SIG:486":"对方忙,请稍后再试","CHARGE:660":"对方企业账户余额不足,不能发起SDK呼叫","SIG:480":"呼叫失败,请再试一次","CHARGE:661":"对方企业账户尚未开通小程序SDK呼叫服务","SIG:483":"拨打不支持国家的pstn号码","CHARGE:664":"PSTN呼叫已达部门允许呼入的上限","SIG:484":"电话时长已用尽,无法转呼手机号,请联系IT管理员及时充值","CHARGE:665":"服务已过期,请管理员更新服务许可证","CHARGE:420":"号码不正确","CHARGE:662":"对方企业账户余额不足,不能发起小程序SDK呼叫","SIG:482":"邀请失败,请重试","CHARGE:415":"服务已过期,请管理员更新服务许可证","CHARGE:657":"企业账户余额不足,不能发起小程序SDK呼叫","CHARGE:416":"当前在线呼叫数已达服务上限,请稍候再试","CHARGE:658":"web客户端达到企业的呼叫方数限制","CHARGE:655":"企业账户余额不足,不能发起SDK呼叫","CHARGE:414":"H.323接入服务已过期","CHARGE:656":"企业账户尚未开通小程序SDK呼叫服务","CHARGE:659":"对方企业账户尚未开通SDK呼叫服务","STATE:200":"成功","SIG:598":"呼叫失败,请再试一次","SIG:599":"信令消息格式无效","SIG:479":"共享内容路数已达上限,无法发起更多的共享。请等待其他参会者停止共享后再重试","CHARGE:650":"h.323方数已达云会议室允许呼入的上限","CHARGE:653":"会议不支持更多小程序入会,请使用App入会或联系会议管理员","CHARGE:654":"企业账户尚未开通SDK呼叫服务","CHARGE:651":"h.323方数已达部门允许呼入的上限","CCC:600":"用户已被其他座席服务","CHARGE:652":"预约会议已经过期,无法主动加入","SIG:704":"呼叫失败,请再试一次","SIG:703":"呼叫失败,请再试一次","SIG:708":"没有白板分享权限","SIG:709":"不能合并会议","SIG:706":"没有内容标注权限","SIG:707":"没有双流分享权限","CHARGE:481":"对方不允许陌生人呼叫","CCC:415":"坐席名称已存在","CCC:414":"坐席不存在","CCC:417":"IVR配置已存在","CCC:416":"无效的坐席ID","CCC:419":"无效的IVR配置ID","CCC:418":"IVR配置不存在","SIG:498":"当前网络UDP被禁用,无法通话,请联系网络管理员或切换其他网络","SIG:499":"网络异常,呼叫已断开","SIG:496":"媒体超时","SIG:497":"信令超时","SIG:490":"无应答","CHARGE:473":"当前通话人数已满。如需更多人通话,请使用云会议室。","SIG:491":"","CHARGE:474":"当前会议人数已满。请加入通讯录,\n购买更多会议端口,详情请咨询本地经销商。","CHARGE:471":"当前通话人数已满。请使用终端或云会议室召开多方视频会议。","CCC:420":"特服号无效,请重新输入","CHARGE:472":"呼叫无法接通,终端在家最多支持4方通话。","CHARGE:477":"您呼叫的会议已达到最大支持人数,请联系管理员购买或使用超大型会议室。","CHARGE:478":"您的服务可用分钟数不足,无法呼叫。","CCC:421":"号码不存在","CHARGE:475":"当前会议人数已满,请联系管理员%s%s,\n及时为帐户充值,或购买更多会议端口。","CHARGE:476":"您呼叫的会议已达到最大支持人数,请联系管理员购买或使用超大型会议室。","CCC:404":"特服号暂时不可用,请稍后再试","CCC:403":"特服号暂时不可用,请稍后再试","CCC:406":"参数非法","REC:478":"录制中断,网络连接中,请重新发起录制","CHARGE:469":"服务资源使用已达最大值,请稍后重试!","CCC:405":"特服号暂时不可用,请稍后再试","REC:479":"录制中断,服务重启中,请重新发起录制","CCC:408":"企业不存在","CCC:407":"企业已存在","CCC:409":"无效的企业ID","SIG:726":"该号码异常已被限制使用","SIG:727":"呼叫失败,请再试一次","SIG:724":"您已被强制邀请加入新的会议","SIG:725":"呼叫失败,请再试一次","REC:470":"无可用录制服务器,请稍后再试","SIG:722":"设备与配对终端连接断开","SIG:723":"设备与指挥调度服务连接断开","SIG:720":"请稍等,主持人稍后邀请您入会","SIG:721":"会议还未开始,请等待主持人入会","CCC:411":"特服号不存在","CHARGE:467":"已达最大录制方数,不能发起录制","CCC:410":"特服号已存在","CHARGE:464":"录制失败,尚未开通录制服务或服务已过期,请联系管理员购买。","CCC:413":"坐席已存在","CCC:412":"无效的特服号","CHARGE:459":"帐户余额不足,无法支持此呼叫。\n请联系管理员%s%s,及时为帐户充值。","CHARGE:457":"终端电话可用分钟数不足,请充值;或联系管理员,加入通讯录。","CHARGE:458":"暂不支持呼叫国际电话。请联系管理员加入通讯录;或咨询本地经销商,为您的单位开通后台管理帐户。","SIG:716":"网络异常,呼叫已断开","SIG:713":"Content Server创建资源失败","REC:480":"录制失败,因为该会议室已启用单路录制","SIG:714":"Failed to allocated resources for content sharing.","REC:481":"录制中断,网络连接中,请重新发起录制","SIG:719":"呼叫失败,请再试一次","SIG:717":"会议室已超出最高通话时长限制,转为语音通话模式,可联系管理员处理","SIG:718":"语音模式限制已解除","SIG:711":"内容发送时会议尚未开始","SIG:712":"内容发送时会议尚未开始","CHARGE:451":"系统不支持此类型呼叫","CHARGE:452":"您的云会议室不支持邀请电话入会,\n请联系管理员加入通讯录;\n或咨询本地经销商,为您的开通帐户。","CHARGE:450":"您的终端目前无法支持此类呼叫","CHARGE:455":"暂不支持呼叫国际电话号码。","CCC:400":"特服号暂时不可用,请稍后再试","CHARGE:453":"帐户余额不足,无法支持此呼叫。\n请联系管理员%s%s,及时为帐户充值。","CCC:402":"特服号暂时不可用,请稍后再试","CHARGE:454":"终端电话可用分钟数不足,无法呼叫","CCC:401":"特服号暂时不可用,请稍后再试","CHARGE:602":"当前通话人数已达上限,您无法加入。","CHARGE:603":"您呼叫的会议已达最大支持人数。\n设备加入通讯录,可支持更多方会议。\n如需更多支持请呼叫客服终端号’288288’咨询。","CHARGE:721":"不允许互联网链路呼入","CHARGE:601":"会议容量使用现在达到上限,\n无法加入会议。请联系管理员%s%s购买更多会议端口。","CHARGE:606":"当前会议人数已超限,30分钟后将自动结束。\n请加入通讯录,可支持更多方会议。","CHARGE:607":"您的服务可用分钟数不足,无法呼叫。","CHARGE:604":"终端在家仅支持4方通话,当前通话人数已超限,30分钟后将自动结束。","CHARGE:605":"UNKNOWN","SIG:506":"录制服务器内部错误","SIG:504":"呼叫失败,请再试一次","CHARGE:608":"您呼叫的会议已达最大支持人数,请联系IT管理员","SIG:505":"呼叫失败,请再试一次","CHARGE:609":"您呼叫的会议已达最大支持人数,请联系IT管理员,购买超大型云会议室。","SIG:502":"呼叫失败,请再试一次","SIG:4999":"分享内容失败","SIG:503":"呼叫失败,请再试一次","CHARGE:720":"该账号已使用\t","CHARGE:712":"该云会议室已被设置为禁止被监看","CHARGE:713":"该终端正在参会的云会议室被设置为禁止被监看","CHARGE:710":"不支持pstn呼叫","CHARGE:711":"呼叫失败,您的企业已禁止PSTN通话功能,请联系您的管理员!","CHARGE:716":"当前用户不允许参会","CHARGE:717":"当前用户无权限入会","REC:503":"录制服务暂时不可用,请稍后再试","CHARGE:714":"监看权限校验超时,请重试","CHARGE:715":"该号码异常已被限制使用","CHARGE:718":"对方终端不允许拨打","CHARGE:719":"该账号已登录其它终端入会","SURV:580":"监控调度呼叫时,第三方服务报错","REC:505":"录制服务暂时不可用,请稍后再试","REC:506":"直播服务暂时不可用,请稍后再试","REC:507":"录制服务暂时不可用,请稍后再试","REC:509":"录制服务暂时不可用,请稍后再试","CHARGE:701":"企业账户余额不足,无法开启录制。请联系管理员充值后再尝试","CHARGE:702":"个人云会议室不可以用,请选择其他会议室或联系管理员","CHARGE:700":"企业账户未开通多路录制计费服务,无法开启录制。请联系客户咨询开通事宜","CHARGE:705":"H323融合服务器容量不足","CHARGE:706":"云会议室已达允许呼入的上限","CHARGE:703":"呼叫所用的H323集群容量不足","CHARGE:704":"H323融合服务器容量不足","SIG:408":"对方没应答,请稍后再试","SIG:405":"对方设备不在线,请稍后重试","CHARGE:707":"云会议室存储空间已满,不能再发起录制","SIG:409":"建立多点呼叫时的内部消息","SIG:400":"通讯失败,请升级到最新版本","SIG:403":"远端网络异常,呼叫已断开","SIG:404":"对方不在线","SIG:401":"加密算法不匹配","SIG:402":"该会议室不允许关闭摄像头,请开启摄像头加入会议","SURV:483":"同步会议信息失败,请重试","SURV:482":"邀请失败,请重试"},zh_TW:{"CHARGE:644":"沒有呼叫權限","CHARGE:649":"預約會議未到開始時間,無法加入","PS:400":"不支持跨雲呼叫","SIG:421":"對方終端不允許外人撥打,請與對方確認後再撥","SIG:422":"您已被主持人移出會議","SIG:420":"號碼不正確","SIG:789":"錄制已停止","SIG:423":"UNKNOWN","SIG:424":"主持人已結束會議","CHARGE:642":"呼叫失敗,企業IPPBX方數已達上限","CHARGE:643":"調度失敗,企業監控調度方數已達上限","CHARGE:640":"所屬部門的雲會議室存儲空間已滿,不能再發起錄制","CHARGE:641":"所屬企業的雲會議室存儲空間已滿,不能再發起錄制","CHARGE:635":"賬戶余額不足,不能發起PSTN通話,請聯系管理員充值後再嘗試","CHARGE:636":"雲會議室已達允許呼入的上限","CHARGE:633":"無法呼叫當前號碼,您的終端僅允許呼叫通訊錄上的用戶號碼","CHARGE:634":"賬戶余額支付範圍不可用於PSTN通話,請聯系管理員開啟後再嘗試。","CHARGE:639":"雲會議室存儲空間已滿,不能再發起錄制","CHARGE:637":"雲會議室已達部門允許呼入的上限","CHARGE:638":"雲會議室已達企業允許呼入的上限","SIG:419":"對方已開啟辦公模式。您可滑動下方按鈕,發起呼叫","SIG:416":"當前在線呼叫數已達服務上限,請稍後再試","SIG:417":"密碼輸入超時","SIG:410":"呼叫失敗,請再試壹次","SIG:4445":"雲會議室存儲空間已滿,不能再發起錄制","SIG:411":"終端APP版本過低,請升級後再試","SIG:4446":"所屬部門的雲會議室存儲空間已滿,不能再發起錄制","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":" 密碼錯誤次數達到3次,請稍後重試","SIG:4449":"無效的分享content類型","SIG:415":"同步呼叫信息失敗,請稍後再試","SIG:412":"對方版本過低,通話無法接通","SIG:4447":"所屬企業的雲會議室存儲空間已滿,不能再發起錄制","SIG:413":"對方設置了免打擾","SIG:4448":"未知錯誤","CHARGE:631":"此雲會議室為按參會時長計費的會議室。您的帳戶餘額已用盡,不能在此雲會議室發起會議,請聯系管理員充值或選擇其他雲會議室。","SIG:4441":"錄制超時,請稍後再試","CHARGE:632":"主動呼叫權限已被管理員關閉,無法呼叫","SIG:4442":"UNKNOWN","CHARGE:630":"當前雲會議室不允許邀請通訊錄外成員","SIG:4440":"分享content超時,請稍後再試","CHARGE:624":"呼叫失敗。您呼叫的終端埠使用服務已過期。","CHARGE:625":"此會議有終端端口服務已過期,無法支持多方呼叫","CHARGE:622":"沒有監看權限","CHARGE:623":"呼叫失敗。終端埠使用服務已過期,不能加入雲會議室或多方通話","REC:511":"錄制服務暫時不可用,請稍後再試","CHARGE:628":"您呼叫的雲會議室不允許匿名使用者呼入,請登錄或註冊後重新呼叫","REC:512":"錄制服務暫時不可用,請稍後再試","CHARGE:629":"對方正在會議中,且該會議不允許通訊錄外成員呼入,請稍後再試","CHARGE:626":"此會議有終端端口服務已過期,無法邀請更多人加入","CHARGE:627":"呼叫的雲會議室不允許通訊錄外成員呼入,請聯系雲會議室管理員","SIG:1503":"分配監控資源失敗","SIG:4456":"連接已斷開,請重新入會","SIG:4457":"號碼輸入有誤,請核對後重新撥打!","SIG:441":"當前在線呼叫數已達網關服務上限,請稍後重試","SIG:4454":"通話不存在,請核對後重試","SIG:4455":"服務器未連接,請稍後重試","SIG:445":"UNKNOWN","SIG:1501":"shuttle獲取MA失敗","SIG:4458":"網絡異常,呼叫已斷開","SIG:1502":"shuttle獲取媒體資源失敗","SIG:4459":"號碼輸入有誤,請核對後重新撥打!","CHARGE:620":"無單位歸屬,不能呼叫H.323設備","SIG:4452":"錄制失敗","CHARGE:621":"呼叫失敗,單位H.323方數不足","SIG:440":"雲會議室密碼不正確,請重試","SIG:4453":"通話已存在,請稍後再試","SIG:4450":"不支持分享content","SIG:4451":"帶寬不足,分享內容失敗","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","CHARGE:611":"UNKNOWN","REC:400":"信令服務與錄製服務內部錯誤。","CHARGE:612":"UNKNOWN","REC:401":"錄制服務暫時不可用,請稍後再試","CHARGE:617":"UNKNOWN","REC:402":"錄制服務暫時不可用,請稍後再試","CHARGE:618":"UNKNOWN","REC:403":"錄制服務暫時不可用,請稍後再試","CHARGE:615":"UNKNOWN","REC:404":"录制不存在","CHARGE:616":"會議已被鎖定,無法加入,請聯系會議發起人解鎖後進入。","REC:405":"錄制服務暫時不可用,請稍後再試","CHARGE:619":"呼叫失敗。終端的雲服務端口已過期,請聯系管理員續費購買。","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content發送時會議尚未開始","SIG:431":"Content Server創建資源失敗","SIG:4466":"輸入密碼超時","REC:406":"錄制服務暫時不可用,請稍後再試","SIG:4460":"號碼輸入有誤,請核對後重新撥打!","CHARGE:610":"呼叫失敗,您的企業已禁止PSTN通話功能,請聯系您的企業管理員!","SIG:4461":"號碼輸入有誤,請核對後重新撥打!","SIG:1404":"UNKNOWN","SIG:469":"錄製正在進行,請勿重複發起錄製","CHARGE:441":"當前在線呼叫數已達網關服務上限,請稍後重試","SIG:461":"錄制時,本地空間即將耗盡","SIG:462":"錄制時,本地空間已耗盡","SIG:580":"pstn呼叫時,第三方服務器報錯","REC:465":"本地已開啟錄制,不能重復發起錄制","REC:466":"錄制服務暫時不可用,請稍後再試!","REC:467":"已達最大錄制方數,不能發起錄制","REC:468":"錄制的存儲空間已滿,您無法開始錄制。\n請刪除已有的錄制視頻,\n或聯系企業管理員購買更多存儲空間。","REC:469":"UNKNOWN","REC:460":"沒有錄製權限","REC:463":"錄制的存儲空間已滿,您無法開始錄制。\n請刪除已有的錄制視頻,\n或聯系企業管理員購買更多存儲空間。","SIG:456":"呼叫失敗,請再試壹次","CHARGE:671":"會議未開始,請等待主持人開始會議後加入","CHARGE:672":"已被移出本次會議,無法入會","CHARGE:670":"您有一場會議正在進行,請先結束該會議","CHARGE:675":"沒有可用的視頻監控資源","SIG:450":"您的終端目前無法支持此類呼叫","CHARGE:676":"視頻監控服務併發超過限制","CCC:501":"數據庫操作失敗","CHARGE:673":"監控服務已經過期","CCC:500":"內部服務器錯誤","CHARGE:674":"視頻監控服務沒有企業歸屬","CCC:602":"输入超时","CHARGE:668":"會議未通過審批或未到預約開始時間","CCC:601":"呼叫超時","CHARGE:669":"管理員禁用點對點呼叫","CCC:604":"入會超時","CHARGE:666":"超過會議審批允許的最大成員數量,入會失敗","CCC:603":"评价结束","CHARGE:667":"超過會議審批允許的最大成員數量,邀請失敗","SIG:487":"呼叫已取消","SIG:488":"終端試用期已過,無法繼續為您服務了","SIG:485":"已達最大呼叫時長,呼叫已斷開","SIG:486":"對方忙,請稍後再試","CHARGE:660":"對方企業帳戶餘額不足,不能發起SDK呼叫","CHARGE:661":"對方企業賬戶尚未開通小程序SDK呼叫服務","SIG:480":"呼叫失敗,請再試壹次","CHARGE:664":"PSTN呼叫已達部門允許呼入的上限","SIG:483":"撥打不支持國家的pstn號碼","CHARGE:665":"小魚易連服務已過期,請企業管理員更新服務許可證","SIG:484":"電話時長已用盡,無法轉呼手機號,請聯繫IT管理員及時充值","CHARGE:420":"號碼不正確","CHARGE:662":"對方企業帳戶餘額不足,不能發起小程序SDK呼叫","SIG:482":"邀請失敗,請重試","CHARGE:415":"小魚易連服務已過期,請企業管理員更新服務許可證","CHARGE:657":"企業帳戶餘額不足,不能發起小程序SDK呼叫","CHARGE:416":"當前在線呼叫數已達服務上限,請稍後再試","CHARGE:658":"web用戶端達到企業的呼叫方數限制","CHARGE:655":"企業帳戶餘額不足,不能發起SDK呼叫","CHARGE:414":"H.323接入服務已過期","CHARGE:656":"企業帳戶尚未開通小程序SDK呼叫服務","CHARGE:659":"對方企業帳戶尚未開通SDK呼叫服務","STATE:200":"成功","SIG:598":"呼叫失敗,請再試壹次","SIG:599":"信令訊息格式無效","SIG:479":"共享內容路數已達上限,無法發起更多的共享。請等待其他參會者停止共享后再重試。","CHARGE:650":"h.323方數已達雲會議室允許呼入的上限","CHARGE:653":"會議不支持更多小程序入會,請使用App入會或聯系會議管理員","CHARGE:654":"企業帳戶尚未開通SDK呼叫服務","CCC:600":"用戶已被其他座席服務","CHARGE:651":"h.323方數已達部門允許呼入的上限","CHARGE:652":"預約會議已經過期,無法主動加入","SIG:704":"呼叫失敗,請再試壹次","SIG:703":"呼叫失敗,請再試壹次","SIG:708":"沒有白板分享權限","SIG:709":"無法合併會議","SIG:706":"沒有內容標記權限\t","SIG:707":"沒有雙流分享權限","CHARGE:481":"終端不允許陌生人呼叫","CCC:415":"坐席名稱已存在","CCC:414":"坐席不存在","CCC:417":"IVR配置已存在","CCC:416":"無效的坐席ID","CCC:419":"無效的IVR配置ID","CCC:418":"IVR配置不存在","SIG:498":"當前網絡UDP被禁用,無法通話,\n請聯系網絡管理員或切換其他網絡","SIG:499":"網絡異常,呼叫已斷開","SIG:496":"媒體超時","SIG:497":"信令超時","CHARGE:473":"當前通話人數已滿。如需更多人通話,請使用雲會議室。手機端下載小魚易連app,註冊即可獲得。","SIG:490":"無應答","CHARGE:474":"當前會議人數已滿,請加入企業通訊錄,\n購買更多會議端口,詳情請咨詢本地經銷商。","SIG:491":"","CCC:420":"特服號暫時不可用,請稍後再試","CHARGE:471":"當前通話人數已滿。請使用終端或雲會議室召開多方視頻會議。","CHARGE:472":"呼叫無法接通,終端在家最多支持4方通話。","CHARGE:477":"您呼叫的會議已達到最大支持人數,請聯系管理員購買或使用超大型會議室。","CCC:421":"號码不存在","CHARGE:478":"您的服務可用分鐘數不足,無法呼叫。","CHARGE:475":"當前會議人數已滿,請聯系企業管理員%s%s,\n及時為企業帳戶充值,或購買更多會議端口。","CHARGE:476":"您呼叫的會議已達到最大支持人數,請聯系管理員購買或使用超大型會議室。","CCC:404":"特服號暫時不可用,請稍後再試","CCC:403":"特服號暫時不可用,請稍後再試","CCC:406":"參數非法","CCC:405":"特服號暫時不可用,請稍後再試","CHARGE:469":"服務資源使用已達最大值,請稍後重試!","REC:478":"錄制中斷,網絡連接中,請重新發起錄制","CCC:408":"企業不存在","REC:479":"錄製中斷,服務重啟中,請重新發起錄製","CCC:407":"企業已存在","CCC:409":"無效的企業ID","SIG:726":"該號碼異常已被限製使用","SIG:727":"呼叫失敗,請再試壹次","SIG:724":"您已被強制邀請加入新的會議","REC:470":"沒有可用的錄製伺服器,請稍後再試","SIG:725":"呼叫失敗,請再試壹次","SIG:722":"設備與配對終端連接斷開","SIG:723":"設備與指揮調度服務連接斷開","SIG:720":"請稍等,主持人稍後邀請您入會","SIG:721":"會議還未開始,請等待主持人入會","CCC:411":"特服號不存在","CCC:410":"特服號已存在","CHARGE:467":"已達最大錄制方數,不能發起錄制","CCC:413":"坐席已存在","CHARGE:464":"錄制失敗,尚未開通錄制服務或服務已過期,請聯系管理員購買。","CCC:412":"無效的特服號","CHARGE:459":"企業帳戶余額不足,無法支持此呼叫。\n請聯系企業管理員%s%s,及時為企業帳戶充值。","CHARGE:457":"終端電話可用分鐘數不足,請充值;或聯系企業管理員,加入企業通訊錄。","CHARGE:458":"暫不支持呼叫國際電話。請聯系企業管理員加入企業通訊錄;或咨詢本地經銷商,為您開通企業帳戶。","SIG:716":"網絡異常,呼叫已斷開","REC:480":"錄製失敗,因為該會議室已啟用單路錄製模式","SIG:713":"Content Server創建資源失敗","REC:481":"錄制中斷,網絡連接中,請重新發起錄制","SIG:714":"Content Server創建資源失敗","SIG:719":"呼叫失敗,請再試壹次","SIG:717":"會議室已超出最高通話時長限制,轉為語音通話模式,可聯繫管理員處理","SIG:718":"語音模式限制已解除","SIG:711":"内容發送時會議尚未開始","SIG:712":"内容發送時會議尚未開始","CHARGE:451":"系統不支持此類型呼叫","CHARGE:452":"您的雲會議室不支持邀請電話入會,\n請聯系企業管理員加入企業通訊錄;\n或咨詢本地經銷商,為您的企業開通企業帳戶。","CHARGE:450":"您的終端目前無法支持此類呼叫","CCC:400":"特服號暫時不可用,請稍後再試","CHARGE:455":"暫不支持呼叫國際電話號碼。","CCC:402":"特服號暫時不可用,請稍後再試","CHARGE:453":"企業帳戶余額不足,無法支持此呼叫。\n請聯系企業管理員%s%s,及時為企業帳戶充值。","CCC:401":"特服號暫時不可用,請稍後再試","CHARGE:454":"終端電話可用分鐘數不足,無法呼叫。","CHARGE:602":"當前通話人數已達上限,您無法加入。","CHARGE:603":"您呼叫的會議已達最大支持人數。\n設備加入企業通訊錄,可支持更多方會議。\n如需更多支持請呼叫客服終端號’288288’咨詢。","CHARGE:721":"不允許互聯網鏈路呼入!","CHARGE:601":"企業會議容量使用現在達到上限,\n無法加入會議。請聯系管理員%s%s購買更多會議端口。","CHARGE:606":"當前會議人數已超限,30分鐘後將自動結束。\n請加入企業通訊錄,可支持更多方會議。","CHARGE:607":"您的服務可用分鐘數不足,無法呼叫。","CHARGE:604":"終端在家僅支持4方通話,當前通話人數已超限,30分鐘後將自動結束","CHARGE:605":"UNKNOWN","SIG:506":"錄製伺服器內部錯誤","CHARGE:608":"您呼叫的會議已達最大支持人數,請聯系企業IT管理員","SIG:504":"呼叫失敗,請再試壹次","CHARGE:609":"您呼叫的會議已達最大支持人數,請聯系企業IT管理員,購買超大型雲會議室。","SIG:505":"呼叫失敗,請再試壹次","SIG:502":"呼叫失敗,請再試壹次","SIG:4999":"分享內容失敗","SIG:503":"呼叫失敗,請再試壹次","CHARGE:720":"該賬號已使用","CHARGE:712":"該雲該雲會議室已被設置為禁止被監看會議室已被設置為禁止被監看","CHARGE:713":"該終端正在參會的雲會議室被設置為禁止被監看","CHARGE:710":"不支持pstn外呼","CHARGE:711":"呼叫失敗,您的企業已禁止PSTN通話功能,請聯系您的企業管理員!","CHARGE:716":"當前用戶不允許參會","CHARGE:717":"當前用戶無權限入會","CHARGE:714":"監看權限校驗超時,請重試","REC:503":"錄制服務暫時不可用,請稍後再試","CHARGE:715":"該號碼異常已被限製使用","CHARGE:718":"對方終端不允許撥打","CHARGE:719":"該賬號已登錄其它終端入會","SURV:580":"監控調度呼叫時,第三方服務報錯","REC:505":"錄制服務暫時不可用,請稍後再試","REC:506":"直播服務暫時不可用,請稍後再試","REC:507":"錄制服務暫時不可用,請稍後再試","REC:509":"錄制服務暫時不可用,請稍後再試","CHARGE:701":"企業帳戶餘額不足,無法開啟錄製。請聯系管理員充值後再嘗試","CHARGE:702":"個人云會議室不可以用,請選擇其他會議室或聯繫管理員","CHARGE:700":"企業帳戶未開通多路錄製計費服務,無法開啟錄製。請聯系客戶諮詢開通事宜","CHARGE:705":"H323融合服務器容量不足","CHARGE:703":"呼叫所用的H323集群容量不足","CHARGE:704":"H323融合服務器容量不足","SIG:408":"對方沒應答,請稍後再試","SIG:405":"對方設備不在線,請稍後重試","SIG:409":"建立多點呼叫時的內部消息","SIG:400":"通訊失敗,請升級到最新版本","SIG:403":"遠端網絡異常,呼叫已斷開","SIG:404":"對方不在線","SIG:401":"加密算法不匹配","SIG:402":"該會議室不允許關閉攝像頭,請開啟攝像頭加入會議","SURV:483":"同步會議信息失敗,請重試","SURV:482":"邀請失敗,請重試"},en_US:{"CHARGE:646":"Cloud meeting has reached the upper limit of organization's allowed incoming calls","CHARGE:647":"Terminal has reached the upper limit of allowed incoming calls","CHARGE:644":"No authority","CHARGE:645":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:648":"Terminal has reached the upper limit of organization's allowed incoming calls","CHARGE:649":"The scheduled meeting is not reached and cannot be joined","PS:400":"Cross-cloud calls are not supported","SIG:421":"Far end does not accept calls by Xiaoyu ID. Please check.","SIG:422":"You are kicked out by chairman.","SIG:420":"Invalid Number.","SIG:789":"Recording has been stopped","SIG:423":"UNKNOWN","SIG:424":"The meeting has ended.","CHARGE:642":"The call failed, and the IPPBX number of the enterprise has reached the upper limit.","CHARGE:643":"Scheduling failed, the number of enterprises monitoring and dispatching reached the upper limit","CHARGE:640":"Cloud storage of department is full and can no longer record","CHARGE:641":"Cloud storage of organization is full and can no longer record","CHARGE:635":"Account balance exhausted, you cannot initiate PSTN calls, please contact the administrator to recharge and then try again.","CHARGE:636":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:633":"The number can not be dialed out. The endpoint is only authorized to call the number on the contact list","CHARGE:634":"Account balance Payment scope is not available for PSTN calls, please contact the administrator to open and then try again.","CHARGE:639":"Cloud storage of user is full and can no longer record","CHARGE:637":"Cloud meeting has reached the upper limit of department's allowed incoming calls","CHARGE:638":"Cloud meeting has reached the upper limit of organization's allowed incoming calls","SIG:419":"Far end has turned on office mode. Please slide to call.","SIG:416":"Current calls have reached the max limit, please try again later.","SIG:417":"Password entry timeout.","SIG:410":"Call is not connected. Please retry.","SIG:4445":"Cloud storage of user is full and can no longer record","SIG:411":"version is too old.","SIG:4446":"Cloud storage of department is full and can no longer record","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":"Password error number reached 3 times, please try again later.","SIG:4449":"The type of sharing content is invalid.","SIG:415":"Synchronization call information failed. Please try again later.","SIG:412":"version is too old.","SIG:4447":"Cloud storage of organization is full and can no longer record","SIG:413":"Far end is in Do Not Disturb mode.","SIG:4448":"Unknown error.","SIG:4441":"Record is time out. Please retry later.","CHARGE:631":"This meeting room is charged by the minutes of the attendees. While your account balance has been exhausted, you cannot initiate a meeting in this meeting room, please contact your administrator to recharge or select another cloud meeting room.","SIG:4442":"UNKNOWN","CHARGE:632":"The endpoint is not authorized to dial out by admin.","SIG:4440":"Sharing content is time out. Please retry later.","CHARGE:630":"The current meeting does not allow non-address book members to call in.","CHARGE:624":"Call failed. The port service of the terminal you called has expired.","CHARGE:625":"This conference port service has expired and cannot support multi-party calls.","CHARGE:622":"No monitoring permission","CHARGE:623":"Call failed. The port service of this terminal has expired, and you cannot use this terminal to join cloud meeting room or multiparty call.","REC:511":"Xiaoyu recording service is not available, please try again later","CHARGE:628":"The meeting ID you called does not allow anonymous users to call in, Please log in or register and call again.","REC:512":"Xiaoyu recording service is not available, please try again later","CHARGE:629":"Far end is in the meeting which does not allow non-address book members to call in,please retry later.","CHARGE:626":"This conference port service has expired, and no more people can be invited.","CHARGE:627":"The meeting ID you called does not allow non-address book members to call in, please contact the administrator of the meeting room.","SIG:1503":"Allocating resource for survelliance failed.","SIG:4456":"The network is disconnected, please try joining the meeting again.","SIG:4457":"Wrong number, please check it and retry.","SIG:441":"Current calls have reached the max limit of gateway, please try again later.","SIG:4454":"No related call, please check and retry later.","SIG:4455":"No connection with server, please retry later.","SIG:445":"UNKNOWN","SIG:1501":"shuttle Get MA failed","SIG:4458":"Network unstable, call disconnected.","SIG:1502":"shuttle Get media resource failed","SIG:4459":"Wrong number, please check it and retry.","SIG:4452":"Record failed.","CHARGE:620":"You don't belong to an organization,and you cannot call H.323 device","SIG:440":"The password of conference is wrong. Please retry.","SIG:4453":"Call exists, please retry later.","CHARGE:621":"Call failed, insufficient H.323 port of your organization","SIG:4450":"Sharing content is unsupported.","SIG:4451":"Sharing content failed for no bandwidth.","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","CHARGE:611":"UNKNOWN","REC:400":"Internal errors in signaling and recording services.","CHARGE:612":"UNKNOWN","REC:401":"Xiaoyu recording service is not available, please try again later","CHARGE:617":"UNKNOWN","REC:402":"Xiaoyu recording service is not available, please try again later","CHARGE:618":"UNKNOWN","REC:403":"Xiaoyu recording service is not available, please try again later","CHARGE:615":"UNKNOWN","REC:404":"Record is not found.","CHARGE:616":"The meeting is locked, failed to join. Please contact meeting originator to unlock and join.","REC:405":"Xiaoyu recording service is not available, please try again later","CHARGE:619":"Call failed. The video service of the terminal has expired, please contact IT Admin to renew.","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content cannot be shared before meeting is started.","SIG:431":"Failed to allocated resources for content sharing.","SIG:4466":"Check password timeout","REC:406":"Xiaoyu recording service is not available, please try again later","SIG:4460":"Wrong number, please check it and retry.","CHARGE:610":"Call failed. PSTN call is disabled, please contact your enterprise admin!","SIG:4461":"Wrong number, please check it and retry.","SIG:1404":"UNKNOWN","SIG:469":"Recording is in progress, do not repeat the recording","CHARGE:441":"Current calls have reached the max limit of gateway, please try again later.","SIG:461":"Local storage will be used up soon.","SIG:462":"Local storage is used up.","SIG:580":"Failed to make PSTN call.","REC:465":"Record is started. Not allow repeated record.","REC:466":"Xiaoyu recording service is not available, please try again later.","REC:467":"The maximum number of recordings has been reached and you cannot start recording","REC:468":"Storage space not available, cannot .","REC:469":"UNKNOWN","REC:460":"You don't have recording permission.","REC:463":"Storage space not available, cannot .","SIG:456":"Call is not connected. Please retry.","CHARGE:671":"The meeting did not start,please wait for the host to start the meeting","CHARGE:672":"Has been removed from this meeting and cannot join","CHARGE:670":"You have a meeting in progress, please end the meeting first","SIG:450":"Your device does not support this type of call.","CHARGE:675":"No video surveillance service available","CHARGE:676":"Video surveillance service exceeds limit","CCC:501":"Database operate error","CHARGE:673":"The video surveillance service has expired","CCC:500":"Internal server error","CHARGE:674":"Video surveillance services lack enterprise ownership","CHARGE:668":"The meeting has not been approved or the scheduled start time is not reached and cannot be joined","CHARGE:669":"P2P call prohibited by administrator","CHARGE:666":"The maximum number of participants approved by the meeting has been exceeded\t","CHARGE:667":"The maximum number of participants approved by the meeting has been exceeded","SIG:487":"Call is canceled.","SIG:488":"The trial has expired. Xiaoyu stops service.","SIG:485":"Reach max duration. Call ended","SIG:486":"Far end busy. Please retry later.","CHARGE:660":"The other enterprise account balance is insufficient to initiate SDK calls","SIG:480":"Call is not connected. Please retry.","CHARGE:661":"The other enterprise account has not yet enabled mini-program SDK call service","SIG:483":"PSTN call in this region is not supported.","CHARGE:664":"PSTN calling has reached the upper limit of department's allowed incoming calls","SIG:484":"Telephone minutes exhausted, you cannnot transfer your mobile phone number. Please contact the IT administrator to recharge in time","CHARGE:665":"Xiaoyu service is expired. Please update your license key.","CHARGE:420":"Incorrect Number.","CHARGE:662":"The other enterprise account balance is insufficient to initiate mini-program SDK calls","SIG:482":"The invitation failed, please try again","CHARGE:415":"Xiaoyu service is expired. Please update your license key.","CHARGE:657":"The enterprise account balance is insufficient to initiate mini-program SDK calls","CHARGE:416":"Current calls have reached the max limit, please try again later.","CHARGE:658":"Web client has reached the upper limit of organization's allowed incoming calls","CHARGE:655":"The enterprise account balance is insufficient to initiate SDK calls","CHARGE:414":"H.323 access service has expired","CHARGE:656":"The enterprise account has not yet enabled mini-program SDK call service","CHARGE:659":"The other enterprise account has not yet enabled SDK call service","STATE:200":"成功","SIG:598":"Call is not connected. Please retry.","SIG:599":"Signaling message format is not valid.","SIG:479":"The number of content share has exceeded the max limit, please retry after other participants stop the content share.","CHARGE:650":"The number of h.323 parties has reached the upper limit of the cloud conference room","CHARGE:653":"The meeting you are calling does not support the mini-program call-in service , please use app to join the meeting or contact the conference administrator","CHARGE:654":"The enterprise account has not yet enabled SDK call service","CHARGE:651":"The number of h.323 parties has reached the upper limit of department's allowed incoming calls","CHARGE:652":"The scheduled meeting has expired and cannot be joined","SIG:704":"Call is not connected. Please retry.","SIG:703":"Call is not connected. Please retry.","SIG:708":"You don't have whiteboard sharing permission.","SIG:709":"Meetings cannot be merged","SIG:706":"You don't have content labeling permission","SIG:707":"You don't have dual-stream sharing permissions","CHARGE:481":"You are not allowed to call this Xiaoyu.","CCC:415":"Same seat name is exist","CCC:414":"Seat is not exist","CCC:417":"IVR config is already exist","CCC:416":"Seat id is invalid","CCC:419":"IVR config id is invalid","CCC:418":"IVR config is not exist","SIG:498":"UDP is blocked by the network. Please call administrator or switch to another network.","SIG:499":"Network unstable, call disconnected.","SIG:496":"Media Timeout","SIG:497":"Signal Timeout","SIG:490":"Far end did not answer.MEDIA_TIMEOUT","CHARGE:473":"Current session is full. Please use cloud meeting room to have more people in the same conference. \nDownload XYLink App and register account to get free cloud meeting room.","SIG:491":"","CHARGE:474":"Current session is full. \nPlease purchase more cloud meeting ports.","CCC:420":"The service number is temporarily unavailable. Please try later.","CHARGE:471":"Current session is full. Please use Xiaoyu or cloud meeting room to have multi-party video conference.","CHARGE:472":"Call cannot be connected. Xiaoyu Home can only support 4 people in the same call.","CHARGE:477":"The meeting is full. Please contact the enterprise administrator to purchase or use the super large cloud conference room.","CCC:421":"The service number is not exist","CHARGE:478":"No sufficient available phone minutes to make calls.","CHARGE:475":"Current session is full. Please recharge for your enterprise account or purchase more cloud meeting ports.","CHARGE:476":"The meeting is full. Please contact the enterprise administrator to purchase or use the super large cloud conference room.","CCC:404":"The service number is temporarily unavailable. Please try later.","CCC:403":"The service number is temporarily unavailable. Please try later.","CCC:406":"Parameter is invalid","CCC:405":"The service number is temporarily unavailable. Please try later.","CHARGE:469":"The usage of service resources has reached the limit, please try again later! ","REC:478":"The recording is interrupted, the Network is connecting, please try again later","CCC:408":"Enterprise is not exist","REC:479":"The recording is interrupted, the service is restarting, please try again later","CCC:407":"Enterprise is already exist","CCC:409":"Enterprise Id is invalid","SIG:726":"This number is abnormal and has been restricted. ","SIG:727":"Call is not connected. Please retry.","SIG:724":"You have been forced to join a new meeting","SIG:725":"Call is not connected. Please retry.","REC:470":"No recording server available, please try again later","SIG:722":"Loss of connection between device and pairing terminal","SIG:723":"Loss of connection between device and dispatch service","SIG:720":"Please wait a moment, the chairman will invite you to join the conference later.","SIG:721":"The conference has not started. Please wait the chairman to join the conference.","CCC:411":"Service number is not exist","CCC:410":"Service number is exist","CHARGE:467":"The maximum number of recordings has been reached and you cannot start recording","CCC:413":"Seat is already exist","CHARGE:464":"License is needed to start recording, please contact IT administrator to purchase or renewal recording service.","CCC:412":"Service number is invalid","CHARGE:459":"No sufficient balance in your enterprise account. \nPlease contact IT administrator %s%s to recharge.","CHARGE:457":"No sufficient phone minutes. Please recharge or contact IT administrator to enable enterprise account.","CHARGE:458":"phone calls are not supported. Please contact IT administrator to enable enterprise account and create enterprise contacts.","SIG:716":"Network unstable, call disconnected.","SIG:713":"Failed to allocated resources for content sharing.","REC:480":"Recording failed, because the cloud meeting room single recording mode is enabled","SIG:714":"Failed to allocated resources for content sharing.","REC:481":"The recording is interrupted, the Network is connecting, please try again later","SIG:719":"Call is not connected. Please retry.","SIG:717":"The conference has exceeded the maximum call duration limit and switched to voice call mode,could contact the admin to deal with","SIG:718":"Voice call mode restrictions have been lifted","SIG:711":"Content cannot be shared before meeting is started.","SIG:712":"Content cannot be shared before meeting is started.","CHARGE:451":"Your system does not support this type of call.","CHARGE:452":"Your cloud meeting room does not support inviting phone calls. \nPlease contact IT administrator to enable enterprise account \nand create enterprise contacts.","CHARGE:450":"Your device does not support this type of call.","CCC:400":"The service number is temporarily unavailable. Please try later.","CHARGE:455":"International phone calls are not supported.","CCC:402":"The service number is temporarily unavailable. Please try later.","CHARGE:453":"Insufficient.","CCC:401":"The service number is temporarily unavailable. Please try later.","CHARGE:454":"Insufficient.","CHARGE:602":"The current number of calls has reached the upper limit, and you cannot join","CHARGE:603":"Current session is full. \nPlease contact IT administrator to enable enterprise account to support more participants. \nCall XiaoYu service 288288 for more information","CHARGE:721":"Incoming calls from Internet links are not allowed!","CHARGE:601":"Meeting capacity is over limit. \nPlease contact IT administrator %s%sto purchase more meeting resources.","CHARGE:606":"The current number of meetings has been overrun and will be automatically terminable in 30 minutes. \n please join the address book to support more party meetings.","CHARGE:607":"Your service is not available enough to call.","CHARGE:604":"The terminal supports only 4 Party calls at home. The number of calls is now out of line, and will automatically end in 30 minutes.","CHARGE:605":"UNKNOWN","SIG:506":"Internal error on the recording server.","SIG:504":"Call is not connected. Please retry.","CHARGE:608":"Current session is full. \nPlease contact IT administrator","SIG:505":"Call is not connected. Please retry.","CHARGE:609":"Current session is full. \nPlease contact IT administrator to purchase super-large meeting service","SIG:502":"Call is not connected. Please retry.","SIG:4999":"Sharing content failed.","SIG:503":"Call is not connected. Please retry.","CHARGE:720":"This account has been used","CHARGE:712":"The cloud conference room has been set to prohibit monitoring","CHARGE:713":"The cloud conference room that the terminal is participating in is set to prohibit monitoring","CHARGE:710":"Don't support pstn outbound calls","CHARGE:711":"Call failed. PSTN call is disabled, please contact your enterprise admin!","CHARGE:716":"The current user is not allowed to attend the meeting","CHARGE:717":"The current user has no permission to join","CHARGE:714":"Monitoring permission verification timed out, please try again","REC:503":"Xiaoyu recording service is not available, please try again later","CHARGE:715":"This number is abnormal and has been restricted.","CHARGE:718":"Far end does not accept calls","CHARGE:719":"This account has been logged into other terminals to join","SURV:580":"Failed to make IPC call.","REC:505":"Xiaoyu recording service is not available, please try again later","REC:506":"Live service is not available, please try again later","REC:507":"Xiaoyu recording service is not available, please try again later","REC:509":"Xiaoyu recording service is not available, please try again later","CHARGE:701":"The account balance of your enterprise is insufficient,so you can't initiate a recording. Please contact your administrator to recharge and try again","CHARGE:702":"Personal cloud conference room is not available. Please choose another conference room or contact the administrato","CHARGE:700":"The enterprise account does enable multi-recording service charge,so you can't initiate a recording. Please contact customer service for opening","CHARGE:705":"Call failed, insufficient H.323 port of your organization","CHARGE:706":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:703":"Call failed, the capacity of the H323 cluster used by the call is insufficient.","CHARGE:704":"Call failed, insufficient H.323 port of your organization","SIG:408":"Far end no answer. Please retry later.","SIG:405":"Far end device is not online. Please call again later.","CHARGE:707":"Cloud storage of user is full and can no longer record","SIG:409":"Internal message.","SIG:400":"Failed to connect. Please upgrade to laster version.","SIG:403":"Far end network unstable. Call is disconnected.","SIG:404":"Far end is offline.","SIG:401":"Encryption match failed","SIG:402":"It is not allowed to turn off the camera in this meeting room. Please turn on camera to join the meeting","SURV:483":"Failed to synchronize meeting information. Please try again","SURV:482":"The invitation failed, please try again"}},Ul=co.find,Kl=!0;"find"in[]&&Array(1).find((function(){Kl=!1})),qt({target:"Array",proto:!0,forced:Kl},{find:function(e){return Ul(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("find");var Fl="zh_CN",zl=function(){var e=new Date;return"".concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())},Yl=function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())};function Vl(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}var Xl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return{code:e,msg:jl[Fl][e]||n,detail:t}},Wl=function(e,t,n){return t?{success:e,data:{code:t,msg:jl[Fl][t]||n}}:{success:e,data:{}}},ql=function(e,t){if("[object Object]"!==Object.prototype.toString.call(e))return e;if("string"==typeof t)return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,"******"));if(Array.isArray(t)){var n=Object.assign({},e);return t.forEach((function(e){void 0!==n[e]&&(n[e]="******")})),n}return e},Zl=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"webrtc_log",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"webrtc";n(this,t),this.dbName=i,this.db=new qu(this.dbName),this.tableCount=Math.max(e,1),this.tableName=r,this.maxTableCount=3}return i(t,[{key:"add",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=4;break}return this.db=new qu(this.db),e.next=4,this.init();case 4:try{r=t.time,i=void 0===r?"":r,o=t.title,a=void 0===o?"":o,s=t.content,c=void 0===s?"":s,u=t.rest,l=void 0===u?[]:u,h=this.num||1,this.db[this.tableName+h]&&this.db[this.tableName+h].add({t:i+JSON.stringify(a),c:JSON.stringify(c)+" "+JSON.stringify(l)}).then((function(){})).catch((function(e){console.log("add db data failed: ",e)}))}catch(e){console.log("add db data failed: ",e)}case 5:case"end":return e.stop()}}),n,this)})))}},{key:"deleteDB",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.db.delete(),qu.delete(this.dbName),sl.set("xy-webrtc-log",{version:1,num:1}),this.num=1,this.db=null;case 5:case"end":return e.stop()}}),t,this)})))}},{key:"close",value:function(){this.db.close()}},{key:"stop",value:function(){var e=sl.get("xy-webrtc-log")||{version:1,num:1};sl.set("xy-webrtc-log",{version:e.version,num:e.num+1>this.maxTableCount?1:e.num+1})}},{key:"isOpen",value:function(){return this.db&&this.db.isOpen()}},{key:"export",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.db.isOpen()){e.next=4;break}return e.next=4,this.db.open();case 4:return console.log("log download"),e.next=7,Rl(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 7:return n=e.sent,r=zl(),e.next=11,this.generateZipBlobAsync(n,r,"");case 11:return i=e.sent,console.log("log download..."),Ml(i,"xy_webrtc_sdk_log_".concat(r,".zip"),"application/zip"),e.abrupt("return",!0);case 17:return e.prev=17,e.t0=e.catch(0),console.error("export db data error: "+e.t0),e.abrupt("return",!1);case 21:case"end":return e.stop()}}),t,this,[[0,17]])})))}},{key:"upload",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,this.db.isOpen()){e.next=4;break}return e.next=4,this.db.open();case 4:return e.prev=4,e.next=7,Rl(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 7:return i=e.sent,o=zl(),e.next=11,this.generateZipBlobAsync(i,o,t);case 11:r=e.sent,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),console.error("export blob error: "+e.t0);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),n,this,[[4,14]])})))}},{key:"progressCallback",value:function(e){return e.totalRows,e.completedRows,!0}},{key:"open",value:function(){this.db.open()}},{key:"init",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.db){e.next=5;break}return this.db=new qu(this.db),e.next=5,this.init();case 5:return n=sl.get("xy-webrtc-log")||{version:1,num:1},this.num=n.num,this.initStores(),e.next=10,this.db[this.tableName+this.num].clear();case 10:if(this.isOpen()){e.next=13;break}return e.next=13,this.db.open();case 13:e.next=21;break;case 15:return e.prev=15,e.t0=e.catch(0),console.log("init db failed:",e.t0),this.deleteDB(),e.next=21,this.init();case 21:case"end":return e.stop()}}),t,this,[[0,15]])})))}},{key:"getStores",value:function(e){var t=this,n={};return Array(this.tableCount).fill(this.tableCount).forEach((function(r,i){n[t.tableName+(i+1)]=e})),n}},{key:"initStores",value:function(){this.db&&!this.db.isOpen()&&(this.db.version(1).stores(this.getStores("++id,time,title,content,rest")),this.upgradeStores({version:2}),this.upgradeStores())}},{key:"setLogVersion",value:function(e){var t=sl.get("xy-webrtc-log")||{version:1,num:1};sl.set("xy-webrtc-log",Object.assign(Object.assign({},t),{version:e}))}},{key:"upgradeStores",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?1:t,r=e.tableCount,i=void 0===r?this.tableCount:r,o=e.tableName,a=void 0===o?this.tableName:o,s=e.field,c=void 0===s?"++id,t,c":s;this.db&&!this.db.isOpen()&&(this.tableCount=i,this.tableName=a,n<this.db.verno+1&&(n=this.db.verno+1),this.setLogVersion(n),this.db.version(n).stores(this.getStores(c)).upgrade())}},{key:"generateZipBlobAsync",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Bl,e.next=3,o.file("xy_webrtc_sdk_log_".concat(r,"_").concat(n,".json"),t,{});case 3:return e.next=5,o.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:9}});case 5:return a=e.sent,e.abrupt("return",a);case 7:case"end":return e.stop()}}),i)})))}}]),t}(),Jl=RegExp.prototype,$l=$e.PROPER,Ql=RegExp.prototype.toString,eh=C((function(){return"/a/b"!=Ql.call({source:"a",flags:"b"})})),th=$l&&"toString"!=Ql.name;(eh||th)&&yt(RegExp.prototype,"toString",(function(){var e=Fe(this);return"/"+po(e.source)+"/"+po(function(e){var t=e.flags;return void 0!==t||"flags"in Jl||Se(e,"flags")||!Z(Jl,e)?t:_(vo,e)}(e))}),{unsafe:!0});var nh=function(e,t,n){var r,i;return jn&&V(r=t.constructor)&&r!==n&&X(i=r.prototype)&&i!==n.prototype&&jn(e,i),e},rh=M(1..valueOf),ih=Mt.f,oh=je.f,ah=Xe.f,sh=ha.trim,ch=k.Number,uh=ch.prototype,lh=k.TypeError,hh=M("".slice),dh=M("".charCodeAt),fh=function(e){var t=De(e,"number");return"bigint"==typeof t?t:ph(t)},ph=function(e){var t,n,r,i,o,a,s,c,u=De(e,"number");if(ae(u))throw lh("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=sh(u),43===(t=dh(u,0))||45===t){if(88===(n=dh(u,2))||120===n)return NaN}else if(48===t){switch(dh(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(a=(o=hh(u,2)).length,s=0;s<a;s++)if((c=dh(o,s))<48||c>i)return NaN;return parseInt(o,r)}return+u};if(Xt("Number",!ch(" 0o1")||!ch("0b1")||ch("+0x1"))){for(var vh,gh=function(e){var t=arguments.length<1?0:ch(fh(e)),n=this;return Z(uh,n)&&C((function(){rh(n)}))?nh(Object(t),n,gh):t},mh=E?ih(ch):"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(","),yh=0;mh.length>yh;yh++)Se(ch,vh=mh[yh])&&!Se(gh,vh)&&ah(gh,vh,oh(ch,vh));gh.prototype=uh,uh.constructor=gh,yt(k,"Number",gh,{constructor:!0})}var bh=RangeError,Sh=RangeError,wh=String,kh=Math.floor,Ch=M((function(e){var t=po(z(this)),n="",r=kt(e);if(r<0||r==1/0)throw bh("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n})),Eh=M("".slice),xh=M(1..toFixed),Ih=function(e,t,n){return 0===t?n:t%2==1?Ih(e,t-1,n*e):Ih(e*e,t/2,n)},_h=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=kh(i/1e7)},Ah=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=kh(r/t),r=r%t*1e7},Th=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=wh(e[t]);n=""===n?r:n+Ch("0",7-r.length)+r}return n},Rh=C((function(){return"0.000"!==xh(8e-5,3)||"1"!==xh(.9,0)||"1.25"!==xh(1.255,2)||"1000000000000000128"!==xh(0xde0b6b3a7640080,0)}))||!C((function(){xh({})}));qt({target:"Number",proto:!0,forced:Rh},{toFixed:function(e){var t,n,r,i,o=rh(this),a=kt(e),s=[0,0,0,0,0,0],c="",u="0";if(a<0||a>20)throw Sh("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return wh(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*Ih(2,69,1))-69)<0?o*Ih(2,-t,1):o/Ih(2,t,1),n*=4503599627370496,(t=52-t)>0){for(_h(s,0,n),r=a;r>=7;)_h(s,1e7,0),r-=7;for(_h(s,Ih(10,r,1),0),r=t-1;r>=23;)Ah(s,1<<23),r-=23;Ah(s,1<<r),_h(s,1,1),Ah(s,2),u=Th(s)}else _h(s,0,n),_h(s,1<<-t,0),u=Th(s)+Ch("0",a);return u=a>0?c+((i=u.length)<=a?"0."+Ch("0",a-i)+u:Eh(u,0,i-a)+"."+Eh(u,i-a)):c+u}});var Oh="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),Dh=new Uint8Array(16);function Nh(){if(!Oh)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Oh(Dh)}for(var Lh=[],Ph=0;Ph<256;++Ph)Lh[Ph]=(Ph+256).toString(16).substr(1);function Mh(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||Nh)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||function(e,t){var n=t||0,r=Lh;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(i)}var Bh,Gh,jh=y((function(e,t){!function(e){function t(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function n(e,t){return e&t}function r(e,t){return e|t}function i(e,t){return e^t}function o(e,t){return e&~t}function a(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function s(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function u(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=c.charAt(n>>6)+c.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=c.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=c.charAt(n>>2)+c.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function l(e){var n,r="",i=0,o=0;for(n=0;n<e.length&&"="!=e.charAt(n);++n){var a=c.indexOf(e.charAt(n));a<0||(0==i?(r+=t(a>>2),o=3&a,i=1):1==i?(r+=t(o<<2|a>>4),o=15&a,i=2):2==i?(r+=t(o),r+=t(a>>2),o=3&a,i=3):(r+=t(o<<2|a>>4),r+=t(15&a),i=0))}return 1==i&&(r+=t(o<<2)),r}var h,d,f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},p=function(e){var t;if(void 0===h){var n="0123456789ABCDEF";for(h={},t=0;t<16;++t)h[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)h[n.charAt(t)]=t;for(t=0;t<" \f\n\r\t \u2028\u2029".length;++t)h[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=h[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=2?(r[r.length]=i,i=0,o=0):i<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return r},v={decode:function(e){var t;if(void 0===d){for(d=Object.create(null),t=0;t<64;++t)d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<"= \f\n\r\t \u2028\u2029".length;++t)d["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,i=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=d[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);r|=o,++i>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,i=0):r<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=v.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return v.decode(e)}},g=1e13,m=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<g?t=0:r-=(t=0|r/g)*g,i[n]=r;t>0&&(i[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,i=r.length;for(t=0;t<i;++t)(n=r[t]-e)<0?(n+=g,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(g+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*g+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),y=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,b=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function S(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var w,k=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?y:b).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0==(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;0==(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var s=new m(r),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)o+=s>>u&1?"1":"0";if(o.length>n)return i+S(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return S(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new m,o=0,a=e;a<t;++a){var s=this.get(a);if(i.mulAdd(128,127&s),o+=7,!(128&s)){if(""===r)if((i=i.simplify())instanceof m)i.sub(80),r="2."+i.toString();else{var c=i<80?i<40?0:1:2;r=c+"."+(i-40*c)}else r+="."+i.toString();if(r.length>n)return S(r,n);i=new m,o=0}}return o>0&&(r+=".incomplete"),r},e}(),C=function(){function e(e,t,n,r,i){if(!(r instanceof E))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return S(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return S(this.stream.parseStringISO(t,t+n),e);case 30:return S(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)},e.decode=function(t){var n;n=t instanceof k?t:new k(t,0);var r=new k(n),i=new E(n),o=e.decodeLength(n),a=n.pos,s=a-r.pos,c=null,u=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)c=u();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,s,o,i,c)},e}(),E=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new m;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],I=(1<<26)/x[x.length-1],_=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(16==e)n=4;else if(8==e)n=3;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return this.toRadix(e);n=2}var r,i=(1<<n)-1,o=!1,a="",s=this.t,c=this.DB-s*this.DB%n;if(s-- >0)for(c<this.DB&&(r=this[s]>>c)>0&&(o=!0,a=t(r));s>=0;)c<n?(r=(this[s]&(1<<c)-1)<<n-c,r|=this[--s]>>(c+=this.DB-n)):(r=this[s]>>(c-=n)&i,c<=0&&(c+=this.DB,--s)),r>0&&(o=!0),o&&(a+=t(r));return o?a:"0"},e.prototype.negate=function(){var t=D();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+j(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=D();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new T(t):new R(t),this.exp(e,n)},e.prototype.clone=function(){var e=D();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=D();return this.bitwiseTo(e,n,t),t},e.prototype.or=function(e){var t=D();return this.bitwiseTo(e,r,t),t},e.prototype.xor=function(e){var t=D();return this.bitwiseTo(e,i,t),t},e.prototype.andNot=function(e){var t=D();return this.bitwiseTo(e,o,t),t},e.prototype.not=function(){for(var e=D(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=D();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=D();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+a(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=s(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,r)},e.prototype.clearBit=function(e){return this.changeBit(e,o)},e.prototype.flipBit=function(e){return this.changeBit(e,i)},e.prototype.add=function(e){var t=D();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=D();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=D();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=D();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=D();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=D(),n=D();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=G(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new T(t):t.isEven()?new O(t):new R(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=D();for(r.sqrTo(a[1],l);s<=u;)a[s]=D(),r.mulTo(l,a[s-2],a[s]),s+=2}var h,d,f=e.t-1,p=!0,v=D();for(i=j(e[f])-1;f>=0;){for(i>=c?h=e[f]>>i-c&u:(h=(e[f]&(1<<i+1)-1)<<c-i,f>0&&(h|=e[f-1]>>this.DB+i-c)),s=n;0==(1&h);)h>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),p)a[h].copyTo(o),p=!1;else{for(;s>1;)r.sqrTo(o,v),r.sqrTo(v,o),s-=2;s>0?r.sqrTo(o,v):(d=o,o=v,v=d),r.mulTo(v,a[h],o)}for(;f>=0&&0==(e[f]&1<<i);)r.sqrTo(o,v),d=o,o=v,v=d,--i<0&&(i=this.DB-1,--f)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=G(1),a=G(0),s=G(0),c=G(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(s,o),a.subTo(c,a)):(i.subTo(r,i),n&&s.subTo(o,s),c.subTo(a,c))}return 0!=i.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new A)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=x[x.length-1]){for(t=0;t<x.length;++t)if(n[0]==x[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<x.length;){for(var r=x[t],i=t+1;i<x.length&&r<I;)r*=x[i++];for(r=n.modInt(r);t<i;)if(r%x[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var s=8==r?255&+t[i]:B(t,i);s<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,s=this.t-1;s>=0;--s)t[s+o+1]=this[s]>>r|a,a=(this[s]&i)<<n;for(s=o-1;s>=0;--s)t[s]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=D());var a=D(),s=this.s,c=t.s,u=this.DB-j(i[i.t-1]);u>0?(i.lShiftTo(u,a),o.lShiftTo(u,r)):(i.copyTo(a),o.copyTo(r));var l=a.t,h=a[l-1];if(0!=h){var d=h*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),f=this.FV/d,p=(1<<this.F1)/d,v=1<<this.F2,g=r.t,m=g-l,y=null==n?D():n;for(a.dlShiftTo(m,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--m>=0;){var b=r[--g]==h?this.DM:Math.floor(r[g]*f+(r[g-1]+v)*p);if((r[g]+=a.am(0,b,r,m,0,l))<b)for(a.dlShiftTo(m,y),r.subTo(y,r);r[g]<--b;)r.subTo(y,r)}null!=n&&(r.drShiftTo(l,n),s!=c&&e.ZERO.subTo(n,n)),r.t=l,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=D(),i=D(),o=n.convert(this),a=j(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var s=r;r=i,i=s}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=G(n),i=D(),o=D(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,s=0,c=0;c<t.length;++c){var u=B(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(o=!0):(s=n*s+u,++a>=r&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(s,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,i){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),r,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],a=7&t;o.length=1+(t>>3),n.nextBytes(o),a>0?o[0]&=(1<<a)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>x.length&&(t=x.length);for(var o=D(),a=0;a<t;++a){o.fromInt(x[Math.floor(Math.random()*x.length)]);var s=o.modPow(i,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(n)){for(var c=1;c++<r&&0!=s.compareTo(n);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=D();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var s=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(s,0):(a>0&&r.lShiftTo(a,r),setTimeout((function(){t(r)}),0))};setTimeout(s,10)}},e.prototype.fromNumberAsync=function(t,n,i,o){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),r,this),this.isEven()&&this.dAddOffset(1,0);var a=this,s=function(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(n)?setTimeout((function(){o()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var c=[],u=7&t;c.length=1+(t>>3),n.nextBytes(c),u>0?c[0]&=(1<<u)-1:c[0]=0,this.fromString(c,256)}},e}(),A=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),T=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),R=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=D();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=D();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),O=function(){function e(e){this.m=e,this.r2=D(),this.q3=D(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=D();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function D(){return new _(null)}function N(e,t){return new _(e,t)}"Microsoft Internet Explorer"==navigator.appName?(_.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;i=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),n[r++]=1073741823&c}return i},w=30):"Netscape"!=navigator.appName?(_.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},w=26):(_.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;i=((c=a*c+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return i},w=28),_.prototype.DB=w,_.prototype.DM=(1<<w)-1,_.prototype.DV=1<<w,_.prototype.FV=Math.pow(2,52),_.prototype.F1=52-w,_.prototype.F2=2*w-52;var L,P,M=[];for(L="0".charCodeAt(0),P=0;P<=9;++P)M[L++]=P;for(L="a".charCodeAt(0),P=10;P<36;++P)M[L++]=P;for(L="A".charCodeAt(0),P=10;P<36;++P)M[L++]=P;function B(e,t){var n=M[e.charCodeAt(t)];return null==n?-1:n}function G(e){var t=D();return t.fromInt(e),t}function j(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}_.ZERO=G(0),_.ONE=G(1);var H,U,K=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),F=null;if(null==F){F=[],U=0;var z=void 0;if(window.crypto&&window.crypto.getRandomValues){var Y=new Uint32Array(256);for(window.crypto.getRandomValues(Y),z=0;z<Y.length;++z)F[U++]=255&Y[z]}var V=function(e){if(this.count=this.count||0,this.count>=256||U>=256)window.removeEventListener?window.removeEventListener("mousemove",V,!1):window.detachEvent&&window.detachEvent("onmousemove",V);else try{var t=e.x+e.y;F[U++]=255&t,this.count+=1}catch(e){}};window.addEventListener?window.addEventListener("mousemove",V,!1):window.attachEvent&&window.attachEvent("onmousemove",V)}function X(){if(null==H){for(H=new K;U<256;){var e=Math.floor(65536*Math.random());F[U++]=255&e}for(H.init(F),U=0;U<F.length;++U)F[U]=0;U=0}return H.next()}var W=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=X()},e}(),q=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new W,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new _(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},e.prototype.encryptLong=function(e){var t=this,n=(this.n.bitLength()+7>>3)-11;try{var r="";return e.length>n?(e.match(/.{1,117}/g).forEach((function(e){var n=t.encrypt(e);r+=n})),u(r)):u(this.encrypt(e))}catch(e){return!1}},e.prototype.decryptLong=function(e){var t=this,n=this.n.bitLength()+7>>3;e=l(e);try{if(e.length>n){var r="";return e.match(/.{1,256}/g).forEach((function(e){var n=t.decrypt(e);r+=n})),r}return this.decrypt(e)}catch(e){return!1}},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16),this.d=N(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16),this.d=N(n,16),this.p=N(r,16),this.q=N(i,16),this.dmp1=N(o,16),this.dmq1=N(a,16),this.coeff=N(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new W,r=e>>1;this.e=parseInt(t,16);for(var i=new _(t,16);;){for(;this.p=new _(e-r,1,n),0!=this.p.subtract(_.ONE).gcd(i).compareTo(_.ONE)||!this.p.isProbablePrime(10););for(;this.q=new _(r,1,n),0!=this.q.subtract(_.ONE).gcd(i).compareTo(_.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(_.ONE),s=this.q.subtract(_.ONE),c=a.multiply(s);if(0==c.gcd(i).compareTo(_.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=N(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new W,i=e>>1;this.e=parseInt(t,16);var o=new _(t,16),a=this,s=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(_.ONE),r=a.q.subtract(_.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(_.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout((function(){n()}),0)):setTimeout(s,0)},c=function(){a.q=D(),a.q.fromNumberAsync(i,1,r,(function(){a.q.subtract(_.ONE).gcda(o,(function(e){0==e.compareTo(_.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=function(){a.p=D(),a.p.fromNumberAsync(e-i,1,r,(function(){a.p.subtract(_.ONE).gcda(o,(function(e){0==e.compareTo(_.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)},e.prototype.sign=function(e,t,n){var r=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return N("0001"+r+"00"+e,16)}((Z[n]||"")+t(e).toString(),this.n.bitLength()/4);if(null==r)return null;var i=this.doPrivate(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},e.prototype.verify=function(e,t,n){var r=N(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in Z)if(Z.hasOwnProperty(t)){var n=Z[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}(i.toString(16).replace(/^1f+00/,""))==n(e).toString()},e}(),Z={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},J={};J.lang={extend:function(e,t,n){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var r=function(){};if(r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),n){var i;for(i in n)e.prototype[i]=n[i];var o=function(){},a=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(o=function(e,t){for(i=0;i<a.length;i+=1){var n=a[i],r=t[n];"function"==typeof r&&r!=Object.prototype[n]&&(e[n]=r)}})}catch(e){}o(e.prototype,n)}}};var $={};void 0!==$.asn1&&$.asn1||($.asn1={}),$.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new _(r,16).xor(e).add(_.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=$.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,o=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,h=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,p=t.DERUTCTime,v=t.DERGeneralizedTime,g=t.DERSequence,m=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,S=Object.keys(e);if(1!=S.length)throw"key of param shall be only one.";var w=S[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new n(e[w]);if("int"==w)return new r(e[w]);if("bitstr"==w)return new i(e[w]);if("octstr"==w)return new o(e[w]);if("null"==w)return new a(e[w]);if("oid"==w)return new s(e[w]);if("enum"==w)return new c(e[w]);if("utf8str"==w)return new u(e[w]);if("numstr"==w)return new l(e[w]);if("prnstr"==w)return new h(e[w]);if("telstr"==w)return new d(e[w]);if("ia5str"==w)return new f(e[w]);if("utctime"==w)return new p(e[w]);if("gentime"==w)return new v(e[w]);if("seq"==w){for(var k=e[w],C=[],E=0;E<k.length;E++){var x=b(k[E]);C.push(x)}return new g({array:C})}if("set"==w){for(k=e[w],C=[],E=0;E<k.length;E++)x=b(k[E]),C.push(x);return new m({array:C})}if("tag"==w){var I=e[w];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var _=b(I[2]);return new y({tag:I[0],explicit:I[1],obj:_})}var A={};if(void 0!==I.explicit&&(A.explicit=I.explicit),void 0!==I.tag&&(A.tag=I.tag),void 0===I.obj)throw"obj shall be specified for 'tag'.";return A.obj=b(I.obj),new y(A)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},$.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);r+=o.substr(1,7),"0"==o.substr(0,1)&&(t=t+"."+new _(r,2).toString(10),r="")}return t},$.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new _(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},$.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},$.asn1.DERAbstractString=function(e){$.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},J.lang.extend($.asn1.DERAbstractString,$.asn1.ASN1Object),$.asn1.DERAbstractTime=function(e){$.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var c=r(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},J.lang.extend($.asn1.DERAbstractTime,$.asn1.ASN1Object),$.asn1.DERAbstractStructured=function(e){$.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},J.lang.extend($.asn1.DERAbstractStructured,$.asn1.ASN1Object),$.asn1.DERBoolean=function(){$.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},J.lang.extend($.asn1.DERBoolean,$.asn1.ASN1Object),$.asn1.DERInteger=function(e){$.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=$.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},J.lang.extend($.asn1.DERInteger,$.asn1.ASN1Object),$.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=$.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}$.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var i=e.substr(n,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},J.lang.extend($.asn1.DERBitString,$.asn1.ASN1Object),$.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=$.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}$.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},J.lang.extend($.asn1.DEROctetString,$.asn1.DERAbstractString),$.asn1.DERNull=function(){$.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},J.lang.extend($.asn1.DERNull,$.asn1.ASN1Object),$.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new _(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};$.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=$.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},J.lang.extend($.asn1.DERObjectIdentifier,$.asn1.ASN1Object),$.asn1.DEREnumerated=function(e){$.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=$.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},J.lang.extend($.asn1.DEREnumerated,$.asn1.ASN1Object),$.asn1.DERUTF8String=function(e){$.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},J.lang.extend($.asn1.DERUTF8String,$.asn1.DERAbstractString),$.asn1.DERNumericString=function(e){$.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},J.lang.extend($.asn1.DERNumericString,$.asn1.DERAbstractString),$.asn1.DERPrintableString=function(e){$.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},J.lang.extend($.asn1.DERPrintableString,$.asn1.DERAbstractString),$.asn1.DERTeletexString=function(e){$.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},J.lang.extend($.asn1.DERTeletexString,$.asn1.DERAbstractString),$.asn1.DERIA5String=function(e){$.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},J.lang.extend($.asn1.DERIA5String,$.asn1.DERAbstractString),$.asn1.DERUTCTime=function(e){$.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},J.lang.extend($.asn1.DERUTCTime,$.asn1.DERAbstractTime),$.asn1.DERGeneralizedTime=function(e){$.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},J.lang.extend($.asn1.DERGeneralizedTime,$.asn1.DERAbstractTime),$.asn1.DERSequence=function(e){$.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},J.lang.extend($.asn1.DERSequence,$.asn1.DERAbstractStructured),$.asn1.DERSet=function(e){$.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},J.lang.extend($.asn1.DERSet,$.asn1.DERAbstractStructured),$.asn1.DERTaggedObject=function(e){$.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},J.lang.extend($.asn1.DERTaggedObject,$.asn1.ASN1Object);var Q=function(e){function t(n){var r=e.call(this)||this;return n&&("string"==typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return function(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?p(e):v.unarmor(e),i=C.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=N(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var o=i.sub[3].getHexStringValue();this.d=N(o,16);var a=i.sub[4].getHexStringValue();this.p=N(a,16);var s=i.sub[5].getHexStringValue();this.q=N(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=N(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=N(u,16);var l=i.sub[8].getHexStringValue();this.coeff=N(l,16)}else{if(2!==i.sub.length)return!1;var h=i.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=N(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new $.asn1.DERInteger({int:0}),new $.asn1.DERInteger({bigint:this.n}),new $.asn1.DERInteger({int:this.e}),new $.asn1.DERInteger({bigint:this.d}),new $.asn1.DERInteger({bigint:this.p}),new $.asn1.DERInteger({bigint:this.q}),new $.asn1.DERInteger({bigint:this.dmp1}),new $.asn1.DERInteger({bigint:this.dmq1}),new $.asn1.DERInteger({bigint:this.coeff})]};return new $.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return u(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new $.asn1.DERSequence({array:[new $.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new $.asn1.DERNull]}),t=new $.asn1.DERSequence({array:[new $.asn1.DERInteger({bigint:this.n}),new $.asn1.DERInteger({int:this.e})]}),n=new $.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new $.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return u(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var n="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(q),ee=function(){function e(e){e=e||{},this.default_key_size=parseInt(e.default_key_size,10)||1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new Q(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(l(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return u(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptLong=function(e){try{for(var t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",r=0,i=/null$/g;i.test(n)&&(r++,t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",!(r>10)););return t}catch(e){return!1}},e.prototype.decryptLong=function(e){try{return this.getKey().decryptLong(e)}catch(e){return!1}},e.prototype.sign=function(e,t,n){try{return u(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.verify=function(e,t,n){try{return this.getKey().verify(e,l(t),n)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new Q,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.1.4",e}();window.JSEncrypt=ee,e.JSEncrypt=ee,e.default=ee,Object.defineProperty(e,"__esModule",{value:!0})}(t)})),Hh=(Bh=jh)&&Bh.__esModule&&Object.prototype.hasOwnProperty.call(Bh,"default")?Bh.default:Bh,Uh=(Gh=Object.freeze({__proto__:null,default:{}}))&&Gh.default||Gh,Kh=y((function(e,t){var n;e.exports=n=n||function(e,t){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&&void 0!==g&&g.crypto&&(n=g.crypto),!n)try{n=Uh}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},s=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),u=o.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,o);if(u){for(var h=0;h<u;h+=a)this._doProcessBlock(i,h);n=i.splice(0,u),r.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=f.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}});var p=o.algo={};return o}(Math)})),Fh=(y((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Kh).lib,i=r.Base,o=r.WordArray,(a=n.x64={}).Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}}),s)})),y((function(e,t){var n;e.exports=(n=Kh,function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,r=[],i=0;i<n;i++)r[i>>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)}).prototype=e}}(),n.lib.WordArray)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i<n;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(r,2*n)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o<n;o++)r[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(r,2*n)}}}(),n.enc.Utf16)})),y((function(e,t){var n,r,i;e.exports=(r=(n=i=Kh).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)i.push(r.charAt(a>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var a=n.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,c=n[e.charCodeAt(a)]>>>6-a%4*2,u=s|c;i[o>>>2]|=u<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),y((function(e,t){var n,r,i;e.exports=(r=(n=i=Kh).lib.WordArray,n.enc.Base64url={stringify:function(e,t=!0){var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<r;a+=3)for(var s=(n[a>>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<r;c++)o.push(i.charAt(s>>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e,t=!0){var n=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<i.length;a++)o[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(n=c)}return function(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,c=n[e.charCodeAt(a)]>>>6-a%4*2,u=s|c;i[o>>>2]|=u<<24-o%4*8,o++}return r.create(i,o)}(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},i.enc.Base64url)})),y((function(e,t){var n;e.exports=(n=Kh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],v=e[t+4],g=e[t+5],m=e[t+6],y=e[t+7],b=e[t+8],S=e[t+9],w=e[t+10],k=e[t+11],C=e[t+12],E=e[t+13],x=e[t+14],I=e[t+15],_=o[0],A=o[1],T=o[2],R=o[3];_=u(_,A,T,R,a,7,s[0]),R=u(R,_,A,T,c,12,s[1]),T=u(T,R,_,A,f,17,s[2]),A=u(A,T,R,_,p,22,s[3]),_=u(_,A,T,R,v,7,s[4]),R=u(R,_,A,T,g,12,s[5]),T=u(T,R,_,A,m,17,s[6]),A=u(A,T,R,_,y,22,s[7]),_=u(_,A,T,R,b,7,s[8]),R=u(R,_,A,T,S,12,s[9]),T=u(T,R,_,A,w,17,s[10]),A=u(A,T,R,_,k,22,s[11]),_=u(_,A,T,R,C,7,s[12]),R=u(R,_,A,T,E,12,s[13]),T=u(T,R,_,A,x,17,s[14]),_=l(_,A=u(A,T,R,_,I,22,s[15]),T,R,c,5,s[16]),R=l(R,_,A,T,m,9,s[17]),T=l(T,R,_,A,k,14,s[18]),A=l(A,T,R,_,a,20,s[19]),_=l(_,A,T,R,g,5,s[20]),R=l(R,_,A,T,w,9,s[21]),T=l(T,R,_,A,I,14,s[22]),A=l(A,T,R,_,v,20,s[23]),_=l(_,A,T,R,S,5,s[24]),R=l(R,_,A,T,x,9,s[25]),T=l(T,R,_,A,p,14,s[26]),A=l(A,T,R,_,b,20,s[27]),_=l(_,A,T,R,E,5,s[28]),R=l(R,_,A,T,f,9,s[29]),T=l(T,R,_,A,y,14,s[30]),_=h(_,A=l(A,T,R,_,C,20,s[31]),T,R,g,4,s[32]),R=h(R,_,A,T,b,11,s[33]),T=h(T,R,_,A,k,16,s[34]),A=h(A,T,R,_,x,23,s[35]),_=h(_,A,T,R,c,4,s[36]),R=h(R,_,A,T,v,11,s[37]),T=h(T,R,_,A,y,16,s[38]),A=h(A,T,R,_,w,23,s[39]),_=h(_,A,T,R,E,4,s[40]),R=h(R,_,A,T,a,11,s[41]),T=h(T,R,_,A,p,16,s[42]),A=h(A,T,R,_,m,23,s[43]),_=h(_,A,T,R,S,4,s[44]),R=h(R,_,A,T,C,11,s[45]),T=h(T,R,_,A,I,16,s[46]),_=d(_,A=h(A,T,R,_,f,23,s[47]),T,R,a,6,s[48]),R=d(R,_,A,T,y,10,s[49]),T=d(T,R,_,A,x,15,s[50]),A=d(A,T,R,_,g,21,s[51]),_=d(_,A,T,R,C,6,s[52]),R=d(R,_,A,T,p,10,s[53]),T=d(T,R,_,A,w,15,s[54]),A=d(A,T,R,_,c,21,s[55]),_=d(_,A,T,R,b,6,s[56]),R=d(R,_,A,T,I,10,s[57]),T=d(T,R,_,A,m,15,s[58]),A=d(A,T,R,_,E,21,s[59]),_=d(_,A,T,R,v,6,s[60]),R=d(R,_,A,T,k,10,s[61]),T=d(T,R,_,A,f,15,s[62]),A=d(A,T,R,_,S,21,s[63]),o[0]=o[0]+_|0,o[1]=o[1]+A|0,o[2]=o[2]+T|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<<o|s>>>32-o)+t}function l(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<<o|s>>>32-o)+t}function h(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Kh).lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[],c=a.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+s[u];h+=u<20?1518500249+(i&o|~i&a):u<40?1859775393+(i^o^a):u<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,c=a,a=o,o=i<<30|i>>>2,i=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),u.SHA1)})),y((function(e,t){var n;e.exports=(n=Kh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),c[i]=n(e.pow(r,1/3)),i++),r++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],h=n[6],d=n[7],f=0;f<64;f++){if(f<16)u[f]=0|e[t+f];else{var p=u[f-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=u[f-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[f]=v+u[f-7]+m+u[f-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),S=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+c[f]+u[f];d=h,h=l,l=s,s=a+S|0,a=o,o=i,i=r,r=S+(b+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+h|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),n.SHA256)})),y((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Kh).lib.WordArray,i=n.algo,o=i.SHA256,a=i.SHA224=o.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(a),n.HmacSHA224=o._createHmacHelper(a),s.SHA224)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],h=n[6],d=n[7],f=r.high,p=r.low,v=i.high,g=i.low,m=o.high,y=o.low,b=a.high,S=a.low,w=s.high,k=s.low,C=l.high,E=l.low,x=h.high,I=h.low,_=d.high,A=d.low,T=f,R=p,O=v,D=g,N=m,L=y,P=b,M=S,B=w,G=k,j=C,H=E,U=x,K=I,F=_,z=A,Y=0;Y<80;Y++){var V,X,W=u[Y];if(Y<16)X=W.high=0|e[t+2*Y],V=W.low=0|e[t+2*Y+1];else{var q=u[Y-15],Z=q.high,J=q.low,$=(Z>>>1|J<<31)^(Z>>>8|J<<24)^Z>>>7,Q=(J>>>1|Z<<31)^(J>>>8|Z<<24)^(J>>>7|Z<<25),ee=u[Y-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=u[Y-7],ae=oe.high,se=oe.low,ce=u[Y-16],ue=ce.high,le=ce.low;X=(X=(X=$+ae+((V=Q+se)>>>0<Q>>>0?1:0))+re+((V+=ie)>>>0<ie>>>0?1:0))+ue+((V+=le)>>>0<le>>>0?1:0),W.high=X,W.low=V}var he,de=B&j^~B&U,fe=G&H^~G&K,pe=T&O^T&N^O&N,ve=R&D^R&L^D&L,ge=(T>>>28|R<<4)^(T<<30|R>>>2)^(T<<25|R>>>7),me=(R>>>28|T<<4)^(R<<30|T>>>2)^(R<<25|T>>>7),ye=(B>>>14|G<<18)^(B>>>18|G<<14)^(B<<23|G>>>9),be=(G>>>14|B<<18)^(G>>>18|B<<14)^(G<<23|B>>>9),Se=c[Y],we=Se.high,ke=Se.low,Ce=F+ye+((he=z+be)>>>0<z>>>0?1:0),Ee=me+ve;F=U,z=K,U=j,K=H,j=B,H=G,B=P+(Ce=(Ce=(Ce=Ce+de+((he+=fe)>>>0<fe>>>0?1:0))+we+((he+=ke)>>>0<ke>>>0?1:0))+X+((he+=V)>>>0<V>>>0?1:0))+((G=M+he|0)>>>0<M>>>0?1:0)|0,P=N,M=L,N=O,L=D,O=T,D=R,T=Ce+(ge+pe+(Ee>>>0<me>>>0?1:0))+((R=he+Ee|0)>>>0<he>>>0?1:0)|0}p=r.low=p+R,r.high=f+T+(p>>>0<R>>>0?1:0),g=i.low=g+D,i.high=v+O+(g>>>0<D>>>0?1:0),y=o.low=y+L,o.high=m+N+(y>>>0<L>>>0?1:0),S=a.low=S+M,a.high=b+P+(S>>>0<M>>>0?1:0),k=s.low=k+G,s.high=w+B+(k>>>0<G>>>0?1:0),E=l.low=E+H,l.high=C+j+(E>>>0<H>>>0?1:0),I=h.low=I+K,h.high=x+U+(I>>>0<K>>>0?1:0),A=d.low=A+z,d.high=_+F+(A>>>0<z>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Kh).x64,i=r.Word,o=r.WordArray,a=n.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=s._createHelper(c),n.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),y((function(e,t){var n;e.exports=(n=Kh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,h=0,d=0;d<7;d++){if(1&i){var f=(1<<d)-1;f<32?h^=1<<f:s^=1<<f-32}128&i?i=i<<1^113:i<<=1}l[o]=a.create(s,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=a.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(A=n[i]).high^=a,A.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var f=0,p=0,v=0;v<5;v++)f^=(A=n[d+5*v]).high,p^=A.low;var g=h[d];g.high=f,g.low=p}for(d=0;d<5;d++){var m=h[(d+4)%5],y=h[(d+1)%5],b=y.high,S=y.low;for(f=m.high^(b<<1|S>>>31),p=m.low^(S<<1|b>>>31),v=0;v<5;v++)(A=n[d+5*v]).high^=f,A.low^=p}for(var w=1;w<25;w++){var k=(A=n[w]).high,C=A.low,E=c[w];E<32?(f=k<<E|C>>>32-E,p=C<<E|k>>>32-E):(f=C<<E-32|k>>>64-E,p=k<<E-32|C>>>64-E);var x=h[u[w]];x.high=f,x.low=p}var I=h[0],_=n[0];for(I.high=_.high,I.low=_.low,d=0;d<5;d++)for(v=0;v<5;v++){var A=n[w=d+5*v],T=h[w],R=h[(d+1)%5+5*v],O=h[(d+2)%5+5*v];A.high=T.high^~R.high&O.high,A.low=T.low^~R.low&O.low}A=n[0];var D=l[s];A.high^=D.high,A.low^=D.low}},_doFinalize:function(){var t=this._data,n=t.words;this._nDataBytes;var r=8*t.sigBytes,o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var h=a[l],d=h.high,f=h.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),u.push(f),u.push(d)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(d),t.HmacSHA3=o._createHmacHelper(d)}(Math),n.SHA3)})),y((function(e,t){var n;e.exports=(n=Kh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=i.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]),c=i.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]),u=i.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]),l=i.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]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),f=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,f,S,w,k,C,E,x,I,_,A=this._hash.words,T=h.words,R=d.words,O=s.words,D=c.words,N=u.words,L=l.words;for(k=o=A[0],C=a=A[1],E=f=A[2],x=S=A[3],I=w=A[4],n=0;n<80;n+=1)_=o+e[t+O[n]]|0,_+=n<16?p(a,f,S)+T[0]:n<32?v(a,f,S)+T[1]:n<48?g(a,f,S)+T[2]:n<64?m(a,f,S)+T[3]:y(a,f,S)+T[4],_=(_=b(_|=0,N[n]))+w|0,o=w,w=S,S=b(f,10),f=a,a=_,_=k+e[t+D[n]]|0,_+=n<16?y(C,E,x)+R[0]:n<32?m(C,E,x)+R[1]:n<48?g(C,E,x)+R[2]:n<64?v(C,E,x)+R[3]:p(C,E,x)+R[4],_=(_=b(_|=0,L[n]))+I|0,k=I,I=x,x=b(E,10),E=C,C=_;_=A[1]+f+x|0,A[1]=A[2]+S+I|0,A[2]=A[3]+w+k|0,A[3]=A[4]+o+C|0,A[4]=A[0]+a+E|0,A[0]=_},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function m(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(f),t.HmacRIPEMD160=o._createHmacHelper(f)}(),n.RIPEMD160)})),y((function(e,t){var n,r,i;e.exports=(r=(n=Kh).lib.Base,i=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;o.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),y((function(e,t){var n,r,i,o,a,s,c,u,l;e.exports=(r=(n=l=Kh).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.SHA1,c=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=c.create(n.hasher,e),i=o.create(),a=o.create([1]),s=i.words,u=a.words,l=n.keySize,h=n.iterations;s.length<l;){var d=r.update(t).finalize(a);r.reset();for(var f=d.words,p=f.length,v=d,g=1;g<h;g++){v=r.finalize(v),r.reset();for(var m=v.words,y=0;y<p;y++)f[y]^=m[y]}i.concat(d),u[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,n){return u.create(n).compute(e,t)},l.PBKDF2)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Kh).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.MD5,c=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),a=o.create(),s=a.words,c=r.keySize,u=r.iterations;s.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();a.concat(n)}return a.sigBytes=4*c,a}}),n.EvpKDF=function(e,t,n){return c.create(n).compute(e,t)},u.EvpKDF)})),y((function(e,t){var n;e.exports=void((n=Kh).lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var c=s.Base64,u=t.algo.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:m}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=t.mode={},d=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=h.CBC=function(){var e=d.extend();function t(e,t,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o<n;o++)e[t+o]^=r[o]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize;t.call(this,e,n,i),r.encryptBlock(e,n),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=e.slice(n,n+i);r.decryptBlock(e,n),t.call(this,e,n,i),this._prevBlock=o}}),e}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,a=[],s=0;s<r;s+=4)a.push(i);var c=o.create(a,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var v=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:t})}},m=r.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=o.random(8));var i=u.create({keySize:t+n}).compute(e,r),a=o.create(i.words.slice(t),4*n);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:r})}},b=r.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:y}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=m.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,m.decrypt.call(this,e,t,i.key,r)}})}())})),y((function(e,t){var n;e.exports=((n=Kh).mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize;t.call(this,e,n,i,r),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=e.slice(n,n+i);t.call(this,e,n,i,r),this._prevBlock=o}}),e}(),n.mode.CFB)})),y((function(e,t){var n,r,i;e.exports=((i=Kh).mode.CTR=(n=i.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var a=o.slice(0);n.encryptBlock(a,0),o[r-1]=o[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=a[s]}}),n.Decryptor=r,n),i.mode.CTR)})),y((function(e,t){var n;e.exports=((n=Kh).mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<i;c++)e[n+c]^=s[c]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)})),y((function(e,t){var n,r,i;e.exports=((i=Kh).mode.OFB=(n=i.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var a=0;a<r;a++)e[t+a]^=o[a]}}),n.Decryptor=r,n),i.mode.OFB)})),y((function(e,t){var n,r;e.exports=((r=Kh).mode.ECB=((n=r.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),r.mode.ECB)})),y((function(e,t){var n;e.exports=((n=Kh).pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)})),y((function(e,t){var n;e.exports=((n=Kh).pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)})),y((function(e,t){var n;e.exports=((n=Kh).pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)})),y((function(e,t){var n;e.exports=((n=Kh).pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},n.pad.ZeroPadding)})),y((function(e,t){var n;e.exports=((n=Kh).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)})),y((function(e,t){var n,r,i,o;e.exports=(r=(n=o=Kh).lib.CipherParams,i=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}},o.format.Hex)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],a=[],s=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,i[n]=p,o[p]=n;var v=e[n],g=e[v],m=e[g],y=257*e[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,u[n]=y,y=16843009*m^65537*g^257*v^16843008*n,l[p]=y<<24|y>>>8,h[p]=y<<16|y>>>16,d[p]=y<<8|y>>>24,f[p]=y,n?(n=v^e[e[e[m^v]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<r;a++)a<n?o[a]=t[a]:(u=o[a-1],a%n?n>6&&a%n==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[a/n|0]<<24),o[a]=o[a-n]^u);for(var s=this._invKeySchedule=[],c=0;c<r;c++){if(a=r-c,c%4)var u=o[a];else u=o[a-4];s[c]=c<4||a<=4?u:l[i[u>>>24]]^h[i[u>>>16&255]]^d[i[u>>>8&255]]^f[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var v=r[u>>>24]^i[l>>>16&255]^o[h>>>8&255]^a[255&d]^n[f++],g=r[l>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&u]^n[f++],m=r[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&l]^n[f++],y=r[d>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&h]^n[f++];u=v,l=g,h=m,d=y}v=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[f++],g=(s[l>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[f++],m=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^n[f++],y=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&h])^n[f++],e[t]=v,e[t+1]=g,e[t+2]=m,e[t+3]=y},keySize:8});e.AES=t._createHelper(v)}(),n.AES)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=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],s=[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],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{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}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],l=c[o];for(n=0;n<24;n++)u[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+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 i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^i[c])&l[c])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,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),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function f(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=i._createHelper(h);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),n.RC4)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=h,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),n.Rabbit)})),y((function(e,t){var n;e.exports=(n=Kh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,d=l<<16|65535&u;for(r[0]^=u,r[1]^=h,r[2]^=l,r[3]^=d,r[4]^=u,r[5]^=h,r[6]^=l,r[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),n.RabbitLegacy)})),y((function(e,t){e.exports=Kh}))),zh=Rt.includes,Yh=C((function(){return!Array(1).includes()}));qt({target:"Array",proto:!0,forced:Yh},{includes:function(e){return zh(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("includes");var Vh=TypeError,Xh=function(e){if(Sa(e))throw Vh("The method doesn't accept regular expressions");return e},Wh=Te("match"),qh=M("".indexOf);qt({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Wh]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~qh(po(z(this)),po(Xh(e)),arguments.length>1?arguments[1]:void 0)}});var Zh=C((function(){Zt(1)}));qt({target:"Object",stat:!0,forced:Zh},{keys:function(e){return Zt(ye(e))}});var Jh=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},$h=Object.prototype.toString;function Qh(e){return"[object Array]"===$h.call(e)}function ed(e){return void 0===e}function td(e){return null!==e&&"object"==typeof e}function nd(e){return"[object Function]"===$h.call(e)}function rd(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),Qh(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var id={isArray:Qh,isArrayBuffer:function(e){return"[object ArrayBuffer]"===$h.call(e)},isBuffer:function(e){return null!==e&&!ed(e)&&null!==e.constructor&&!ed(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:td,isUndefined:ed,isDate:function(e){return"[object Date]"===$h.call(e)},isFile:function(e){return"[object File]"===$h.call(e)},isBlob:function(e){return"[object Blob]"===$h.call(e)},isFunction:nd,isStream:function(e){return td(e)&&nd(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:rd,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,i=arguments.length;r<i;r++)rd(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]="object"==typeof n?e({},n):n}for(var r=0,i=arguments.length;r<i;r++)rd(arguments[r],n);return t},extend:function(e,t,n){return rd(t,(function(t,r){e[r]=n&&"function"==typeof t?Jh(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function od(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var ad=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(id.isURLSearchParams(t))r=t.toString();else{var i=[];id.forEach(t,(function(e,t){null!=e&&(id.isArray(e)?t+="[]":e=[e],id.forEach(e,(function(e){id.isDate(e)?e=e.toISOString():id.isObject(e)&&(e=JSON.stringify(e)),i.push(od(t)+"="+od(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e};function sd(){this.handlers=[]}sd.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},sd.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},sd.prototype.forEach=function(e){id.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var cd=sd,ud=function(e,t,n){return id.forEach(n,(function(n){e=n(e,t)})),e},ld=function(e){return!(!e||!e.__CANCEL__)},hd=function(e,t){id.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},dd=function(e,t,n,r,i){return function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.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}},e}(new Error(e),t,n,r,i)},fd=["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"],pd=id.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=id.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},vd=id.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),id.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),id.isString(r)&&a.push("path="+r),id.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},gd=function(e){return new Promise((function(t,n){var r=e.data,i=e.headers;id.isFormData(r)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password||"";i.Authorization="Basic "+btoa(a+":"+s)}var c,u,l=(c=e.baseURL,u=e.url,c&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(u)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(c,u):u);if(o.open(e.method.toUpperCase(),ad(l,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in o?function(e){var t,n,r,i={};return e?(id.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=id.trim(e.substr(0,r)).toLowerCase(),n=id.trim(e.substr(r+1)),t){if(i[t]&&fd.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}(o.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:r,config:e,request:o};!function(e,t,n){var r=n.config.validateStatus;!r||r(n.status)?e(n):t(dd("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,i),o=null}},o.onabort=function(){o&&(n(dd("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(dd("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(dd(t,e,"ECONNABORTED",o)),o=null},id.isStandardBrowserEnv()){var h=vd,d=(e.withCredentials||pd(l))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;d&&(i[e.xsrfHeaderName]=d)}if("setRequestHeader"in o&&id.forEach(i,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),id.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),n(e),o=null)})),void 0===r&&(r=null),o.send(r)}))},md={"Content-Type":"application/x-www-form-urlencoded"};function yd(e,t){!id.isUndefined(e)&&id.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var bd,Sd={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(bd=gd),bd),transformRequest:[function(e,t){return hd(t,"Accept"),hd(t,"Content-Type"),id.isFormData(e)||id.isArrayBuffer(e)||id.isBuffer(e)||id.isStream(e)||id.isFile(e)||id.isBlob(e)?e:id.isArrayBufferView(e)?e.buffer:id.isURLSearchParams(e)?(yd(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):id.isObject(e)?(yd(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};Sd.headers={common:{Accept:"application/json, text/plain, */*"}},id.forEach(["delete","get","head"],(function(e){Sd.headers[e]={}})),id.forEach(["post","put","patch"],(function(e){Sd.headers[e]=id.merge(md)}));var wd=Sd;function kd(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Cd=function(e){return kd(e),e.headers=e.headers||{},e.data=ud(e.data,e.headers,e.transformRequest),e.headers=id.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),id.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||wd.adapter)(e).then((function(t){return kd(e),t.data=ud(t.data,t.headers,e.transformResponse),t}),(function(t){return ld(t)||(kd(e),t&&t.response&&(t.response.data=ud(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Ed=function(e,t){t=t||{};var n={},r=["url","method","params","data"],i=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];id.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),id.forEach(i,(function(r){id.isObject(t[r])?n[r]=id.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:id.isObject(e[r])?n[r]=id.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),id.forEach(o,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var a=r.concat(i).concat(o),s=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return id.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function xd(e){this.defaults=e,this.interceptors={request:new cd,response:new cd}}xd.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Ed(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[Cd,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},xd.prototype.getUri=function(e){return e=Ed(this.defaults,e),ad(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},id.forEach(["delete","get","head","options"],(function(e){xd.prototype[e]=function(t,n){return this.request(id.merge(n||{},{method:e,url:t}))}})),id.forEach(["post","put","patch"],(function(e){xd.prototype[e]=function(t,n,r){return this.request(id.merge(r||{},{method:e,url:t,data:n}))}}));var Id=xd;function _d(e){this.message=e}_d.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_d.prototype.__CANCEL__=!0;var Ad=_d;function Td(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Ad(e),t(n.reason))}))}Td.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Td.source=function(){var e;return{token:new Td((function(t){e=t})),cancel:e}};var Rd=Td;function Od(e){var t=new Id(e),n=Jh(Id.prototype.request,t);return id.extend(n,Id.prototype,t),id.extend(n,t),n}var Dd=Od(wd);Dd.Axios=Id,Dd.create=function(e){return Od(Ed(Dd.defaults,e))},Dd.Cancel=Ad,Dd.CancelToken=Rd,Dd.isCancel=ld,Dd.all=function(e){return Promise.all(e)},Dd.spread=function(e){return function(t){return e.apply(null,t)}};var Nd=Dd,Ld=Dd;Nd.default=Ld;var Pd=Nd,Md=Ra(),Bd=1280,Gd=720,jd=640,Hd=360,Ud=function(e){return Md.isFirefox?{}:{frameRate:e}},Kd=Object.assign({aspectRatio:1.777777778,resizeMode:"crop-and-scale",width:640,height:360},Ud({min:15,exact:15,max:15})),Fd=Object.assign({cursor:"always",logicalSurface:!0},Kd),zd={720:{common:Object.assign(Object.assign(Object.assign({},Fd),{width:1280,height:720}),Ud(15)),advanced:Object.assign(Object.assign({},Fd),{frameRate:{ideal:15,max:15},width:{ideal:1280,max:1280},height:{ideal:720,max:720}})},1080:{common:Object.assign(Object.assign(Object.assign({},Fd),{width:1920,height:1080}),Ud(15)),advanced:Object.assign(Object.assign({},Fd),{frameRate:{ideal:15,max:15},width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}})}},Yd={180:{common:Object.assign(Object.assign(Object.assign({},Kd),{width:320,height:180}),Ud(15)),advanced:Object.assign(Object.assign({},Kd),{frameRate:{min:15,exact:15,max:15},width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}})},360:{common:Object.assign(Object.assign(Object.assign({},Kd),{width:640,height:360}),Ud(15)),advanced:Object.assign(Object.assign({},Kd),{frameRate:{min:15,exact:15,max:15},width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}})},720:{common:Object.assign(Object.assign(Object.assign({},Kd),{width:1280,height:720}),Ud(30)),advanced:Object.assign(Object.assign({},Kd),{frameRate:{min:5,ideal:30,max:30},width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}})}},Vd={"90P":0,"180P":1,"360P":2,"720P":3,"1080P":4,"4K":5,Num:6},Xd={180:50,360:100,720:200},Wd=["XYSDK:950401","XYSDK:950402","XYSDK:950403","XYSDK:950404","XYSDK:950405","XYSDK:950406"],qd=["CONFNO","HARD","TVBOX","BRUCE","DESK","SOFT","H323"],Zd=[0,1,2],Jd=[0,1,2,3,4,5],$d={none:0,wifi:1,"3g":2,wired:3,"2g":4,"4g":5,wwan:6,"3g_china_mobile":7},Qd={muteAudio:{type:"AUDIO_MUTE",status:!1},muteVideo:{type:"VIDEO_MUTE",status:!1},unmuteAudio:{type:"AUDIO_UN_MUTE",status:!0},unmuteVideo:{type:"VIDEO_UN_MUTE",status:!0}},ef={bundlePolicy:"max-bundle",iceCandidatePoolSize:0,iceServers:[],iceTransportPolicy:"all",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},tf={OK:"STATE:200",SERVER_INNER_ERROR:"SIG:4448",PEER_NET_DISCONNECT:"SIG:403",LOCAL_NET_DISCONNECT:"SIG:499"},nf={CLIENT_TYPE:"webrtc",INIT_INTERNELS:{bytesReceived:0,bytesReceivedSecond:0,bytesSent:0,bytesSentSecond:0,jitterSent:0,jitterReceived:0,audioSendJitter:0,roundTripTime:0,fractionLostSent:0,fractionLostReceived:0,mimeType:"video/H264",timestamp:0,receiver:{},sender:{},audioReceiver:{},audioSender:{}},RESOLUTION:1,ROSTER:{deviceType:"webrtc",endpointId:"",displayName:"",mediagroupid:0,participantId:0,audioTxMute:!1,videoTxMute:!1,audioRxMute:!1,videoRxMute:!1,videoMuteReason:0,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1,isContent:!1,isActiveSpeaker:!1,id:"",extUserId:""},SELF_MOCK_PID:9999999999,HOR_CONTAINER_RATIO:1.778,VER_CONTAINER_RATIO:.5625,RATIO_MAP:{0:0,1:90,2:180,3:270},MAP_RESOLUTION_INDEX:{90:0,180:1,360:2,720:3,1080:4},RESOLUTION_MAP:{0:90,1:180,2:360,3:720,4:1080},VIDE_BANDWIDTH_BIT:1e3,LOGIN_INFO:{callUri:"",securityKey:"",access_token:"",refresh_token:"",id:0,displayName:""},LAYOUT:{position:[],resolution:0,rotate:0,quality:0,state:"NORMAL",roster:{deviceType:"webrtc",endpointId:"",displayName:"",mediagroupid:0,participantId:0,audioTxMute:!1,videoTxMute:!1,audioRxMute:!1,videoRxMute:!1,videoMuteReason:0,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1,isContent:!1,isActiveSpeaker:!1,id:"",extUserId:""}},MAP_RESOLUTION_STRING:{90:{width:160,height:90},180:{width:320,height:180},360:{width:640,height:360},720:{width:1280,height:720},1080:{width:1920,height:1080}},CONF_INFO:{participantCount:0,totalEpCount:0,chairManUrl:"",contentUri:"",actSpkUri:""}},rf=["SPEAKER","GALLERY"],of=["MULTI_PIC_CONTENT_HIGH_PRIORITY","MULTI_PIC_ACTIVE_HIGH_PRIORITY","TWO_PIC_PIP","CONTENT_ONLY","TWO_PIC_SYMMETRIC"],af="standardWebRtc",sf="thirdWebRtc",cf={muteAudio:"audioMute",unmuteAudio:"audioUnmute",muteVideo:"videoMute",unmuteVideo:"videoUnmute"},uf=0,lf=1,hf=2,df={180:3,360:2,720:1},ff={0:"",1:"HIDE",2:"SDKMonitor+hide"},pf=["HIDE","SDKMonitor+hide"],vf=["Chinese","English"],gf=["clientId","clientSecret","password","token","pwd","securityKey","access_token","refresh_token"],mf={errorCode:10002e3},yf=function(){function t(r){var i=this;n(this,t),this.assignOptions=function(e){return Object.assign({},i.commonOption,e,{params:Object.assign({},i.commonOption.params,e&&e.params)})},this.get=function(e,t){return i.axios.get(e,i.assignOptions(t)).catch((function(e){return e}))},this.put=function(e,t,n){return i.axios.put(e,t,i.assignOptions(n)).catch((function(e){return e}))},this.post=function(e,t,n){return i.axios.post(e,t,i.assignOptions(n)).catch((function(e){return e}))},this.delete=function(e,t){return i.axios.delete(e,i.assignOptions(t)).catch((function(e){return e}))},this.commonOption=r,this.loginInfo=null,this.logger=null,this.baseUrl="",this.clientId="",this.clientSecret="",this.retryCount=0;var o=Object.assign(Object.assign({},r),{headers:{"n-ua":"PL=webrtc-sdk&AV=1.0.0&DR=&RL=&MF=&MO=web&OS=web-sdk&API=&LCLO=&LCLA=&CK="}});Pd.defaults.timeout=1e4,this.axios=Pd.create(o),this.axios.interceptors.request.use((function(e){var t=Math.ceil(1e4*Math.random());return e.url.includes("random=")||(e.url.includes("?")?e.url+="&random=".concat(t):e.url+="?random=".concat(t)),i.setHttpConfig(e),i.logger&&i.logger.log("[http] request:",e.url),e})),this.axios.interceptors.response.use((function(e){return i.logger&&i.logger.log("[http] response:",null==e?void 0:e.data),e}),(function(t){return Rn(i,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger&&this.logger.log("[http] response error:",t),!t.response){e.next=24;break}if(s=t.response||{},c=s.status,u=s.data,401!==c||(null==u?void 0:u.errorCode)!==mf.errorCode){e.next=24;break}if(!(this.retryCount>=1)){e.next=7;break}return this.retryCount=0,e.abrupt("return",Promise.reject(mf));case 7:return e.prev=7,e.next=10,this.refreshToken({baseURL:t.config.baseURL});case 10:if(!(l=e.sent)){e.next=18;break}return h=l.access_token,null===(r=this.logger)||void 0===r||r.log("[http] error.config pre:",t.config),(null===(i=t.config.params)||void 0===i?void 0:i.token)&&(t.config.params.token=h),(null===(o=t.config.data)||void 0===o?void 0:o.includes("token"))&&(d=JSON.parse(t.config.data),t.config.data=JSON.stringify(Object.assign(d,{token:h})),null===(a=this.logger)||void 0===a||a.log("[http] error.config new:",t.config)),this.axios.defaults.headers.post["Content-Type"]="application/json",e.abrupt("return",this.axios.request(t.config));case 18:e.next=24;break;case 20:return e.prev=20,e.t0=e.catch(7),this.retryCount=0,e.abrupt("return",Promise.reject(mf));case 24:return e.abrupt("return",Promise.reject(t.response));case 25:case"end":return e.stop()}}),n,this,[[7,20]])})))}))}return i(t,[{key:"refreshToken",value:function(t){var n,r=t.baseURL,i=void 0===r?this.baseUrl:r,o=t.refresh_token,a=void 0===o?"":o;return Rn(this,void 0,void 0,e().mark((function t(){var r,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=a||(null===(n=this.loginInfo)||void 0===n?void 0:n.refresh_token)){e.next=3;break}return e.abrupt("return",Promise.reject(mf));case 3:return e.prev=3,e.next=6,Pd({method:"post",baseURL:i,url:"admin/login/refresh_token",timeout:5e3,headers:{"x-xy-clientid":this.clientId},data:{refresh_token:a}});case 6:if(!(r=e.sent)||200!==r.status){e.next=13;break}return o=r.data.data,this.loginInfo=o,e.abrupt("return",Promise.resolve(o));case 13:return e.abrupt("return",Promise.reject(mf));case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(3),e.abrupt("return",Promise.reject(mf));case 19:case"end":return e.stop()}}),t,this,[[3,16]])})))}},{key:"setLogger",value:function(e){this.logger=e}},{key:"setBaseUrl",value:function(e){var t=this;e!==this.baseUrl&&delete this.axios.defaults.headers.authorization,this.baseUrl=e,this.axios.interceptors.request.use((function(e){return e.baseURL=t.baseUrl,e}),(function(e){return Promise.reject(e)}))}},{key:"setClientInfo",value:function(e){var t=e.clientId,n=e.clientSecret;this.clientId=t,this.clientSecret=n}},{key:"setHttpConfig",value:function(e){if(1===e.sign){var t=e.method,n=void 0===t?"GET":t,r=e.data,i=e.url,o=void 0===i?"":i,a=e.params,s=e.clientId,c=void 0===s?this.clientId:s,u=e.clientSecret,l=void 0===u?this.clientSecret:u,h="";Object.keys(a).map((function(e){h&&(h+="&"),h+="".concat(e,"=").concat(encodeURIComponent(a[e]))}));var d=h?o+"&"+h:o,f=this.loginInfo||{access_token:""},p=f.access_token,v=void 0===p?"":p,g=f.signSecret,m="string"==typeof r?r:JSON.stringify(r)||"",y={method:n.toLocaleUpperCase(),body:m,url:d,clienttype:nf.CLIENT_TYPE,clientId:c,clientSecret:l,token:v,signSecret:g};e.headers=Object.assign(Object.assign({},e.headers),this.getApiHeader(y))}}},{key:"getApiHeader",value:function(e){var t=e.method,n=e.url,r=e.body,i=void 0===r?"":r,o=e.clientId,a=void 0===o?"":o,s=e.clienttype,c=void 0===s?"":s,u=e.clientSecret,l=void 0===u?"":u,h=e.signSecret,d=void 0===h?"":h,f=e.token,p=void 0===f?"":f,v=Math.random(),g=(new Date).getTime(),m=Fh.MD5(i).toString(),y="x-xy-clientid=".concat(a,"&x-xy-nonce=").concat(v,"&x-xy-signtype=HMAC_SHA256&x-xy-timestamp=").concat(g),b=(d||l)+"&",S="".concat(t.toLocaleUpperCase(),"\n").concat(y,"\n").concat(n,"\n").concat(m,"\n").concat(b),w=Fh.HmacSHA256(S,b).toString().toLocaleUpperCase();return Object.assign({"x-xy-clientid":a,"x-xy-clienttype":c,"x-xy-nonce":v,"x-xy-timestamp":g,"x-xy-signtype":"HMAC_SHA256","x-xy-sign":w,"x-xy-signatureversion":"2.0"},p&&{Authorization:"Bearer ".concat(p||"")})}},{key:"setLoginInfo",value:function(e){this.loginInfo=e}},{key:"getLoginInfo",value:function(){return this.loginInfo}}]),t}(),bf="2.1.3-beta.0 - build on 2022-12-02 19:45",Sf="wss://cloudapi.xylink.com",wf="https://cloudapi.xylink.com",kf="https://log.xylink.com",Cf=new(function(){function t(){var r=this;n(this,t),this.setCommonParams=function(e){var t=(e||{}).securityKey;r.commonParams.securityKey=t},this.customLogin=function(t){return Rn(r,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.post("/api/rest/iauth/external/en/custom/login/v1",t);case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),n,this)})))},this.getWatermarkContent=function(t){return Rn(r,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,i="/api/rest/v1/meetingroom/conferenceNumber/watermarkContent/".concat(t,"?securityKey=").concat(r),e.next=4,this.http.get(i);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),n,this)})))},this.getEnterpriseId=function(t){var n=t.extId,i=t.clientId,o=t.clientSecret,a=t.httpServer,s=void 0===a?wf:a;return Rn(r,void 0,void 0,e().mark((function t(){var r,a,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="/api/rest/v1/sdk/enterpriseToken/findByExtId?extId=".concat(n),e.next=3,this.http.get(a,{baseURL:s,sign:1,clientSecret:o,clientId:i});case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(200!==(c=e.t0).status){e.next=9;break}return e.abrupt("return",(null===(r=c.data)||void 0===r?void 0:r.enterpriseId)||"");case 9:return e.abrupt("return","");case 10:case"end":return e.stop()}}),t,this)})))},this.locator=function(t){var n=t.extId,i=t.clientId,o=t.clientSecret,a=t.httpServer,s=void 0===a?wf:a;return Rn(r,void 0,void 0,e().mark((function t(){var r,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/api/rest/v1/locator/".concat(n,"/node/config"),e.next=3,this.http.get(r,{baseURL:s,sign:1,clientSecret:o,clientId:i});case 3:if(200!==(a=e.sent).status){e.next=6;break}return e.abrupt("return",a.data||[]);case 6:return e.abrupt("return",[]);case 7:case"end":return e.stop()}}),t,this)})))},this.http=new yf({baseURL:wf,timeout:2e4,sign:1}),this.logHttp=new yf({baseURL:kf,timeout:2e4,sign:0}),this.meetingInfo={meetingId:"",callUri:""},this.seqId=0,this.statesTime={timeDiff:0},this.commonParams={securityKey:""},this.randomDeviceSN=Mh()}return i(t,[{key:"setBaseUrl",value:function(e,t){this.http.setBaseUrl(e),this.logHttp.setBaseUrl(t)}},{key:"setLogBaseUrl",value:function(e){this.logHttp.setBaseUrl(e)}},{key:"setClientInfo",value:function(e){var t=e.clientId,n=e.clientSecret;this.http.setClientInfo({clientId:t,clientSecret:n})}},{key:"setLogger",value:function(e){this.http.setLogger(e),this.logHttp.setLogger(e)}},{key:"setMeetingInfo",value:function(e){this.meetingInfo=e}},{key:"setLoginInfo",value:function(e){this.http.setLoginInfo(e)}},{key:"getLoginInfo",value:function(){return this.http.getLoginInfo()}},{key:"upload",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.logHttp.post("/api/rest/v1/log/standardLog",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),n,this)})))}},{key:"getPublicKey",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/api/rest/iauth/v1/en/publicKey",{params:{account:t,deviceType:17}});case 2:if(200!==(i=e.sent).status){e.next=5;break}return e.abrupt("return",(null===(n=i.data)||void 0===n?void 0:n.pubkey)||"");case 5:return e.abrupt("return","");case 6:case"end":return e.stop()}}),r,this)})))}},{key:"login",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),r=t.userName,i=t.password,o=t.extId,a="/api/rest/iauth/v5/en/login",o&&(a+="?extId=".concat(o)),e.next=6,this.http.put(a,{account:r,password:i,deviceType:17,deviceSn:this.randomDeviceSN});case 6:return(s=e.sent).data&&200===s.status&&(this.setCommonParams(s.data),this.http.setLoginInfo(s.data.token)),e.abrupt("return",s);case 9:case"end":return e.stop()}}),n,this)})))}},{key:"encryptLogin",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),i=t.userName,o=t.password,e.next=4,this.getPublicKey(i);case 4:return a=e.sent,(s=new Hh).setPublicKey(a),c=s.encryptLong(Fh.SHA512(o).toString(Fh.enc.Hex)),u={account:i,password:c,deviceType:17,pubKey:a,deviceSn:this.randomDeviceSN},e.next=11,this.http.post("/api/rest/iauth/external/en/encrypt/custom/login/v1",u);case 11:if(e.t0=e.sent,e.t0){e.next=14;break}e.t0={};case 14:if(l=e.t0,1000005!==(null===(n=null==l?void 0:l.data)||void 0===n?void 0:n.errorCode)){e.next=19;break}return e.next=18,this.customLogin(Object.assign(Object.assign({},u),{password:s.encryptLong(o)}));case 18:l=e.sent;case 19:return 200===l.status&&l.data&&(this.setCommonParams(l.data),this.http.setLoginInfo(l.data.token)),e.abrupt("return",l);case 21:case"end":return e.stop()}}),r,this)})))}},{key:"getSdkUserInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),r=t.displayName,i=t.extId,o=t.extUserId,s={extId:i,displayName:r},(a=void 0===o?"":o)&&Object.assign(s,{externalUserId:a}),e.next=6,this.http.post("/api/rest/internal/v1/en/sdk/webRtc/user?extId=".concat(i),s);case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0={};case 9:return e.abrupt("return",e.t0);case 10:case"end":return e.stop()}}),n,this)})))}},{key:"getUserInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/admin/current/userinfo/bytoken",{params:{token:t}});case 2:if(!(r=e.sent).data||0!==r.data.code){e.next=6;break}return this.setCommonParams(r.data.data),e.abrupt("return",r.data.data);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),n,this)})))}},{key:"getCallUri",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.get("/api/rest/uss/v4/callUrlInfoV2",{params:Object.assign(Object.assign({},t),{securityKey:r,version:"v5"})});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"verifyPassword",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.commonParams.securityKey,e.next=3,this.http.put("/api/rest/uss/v4/en/cloudmeeting/validation?securityKey=".concat(i),{number:t,passwd:n});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),r,this)})))}},{key:"hand",value:function(t,n,r,i){return Rn(this,void 0,void 0,e().mark((function o(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.post("/page/api/rest/v2/".concat(t,"?meetingId=").concat(n,"&di=").concat(r,"&conferenceNo=").concat(i));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),o,this)})))}},{key:"getDefaultServerConfig",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/api/rest/clientConfg/v3/getDefaultServerConfig?securityKey=".concat(this.commonParams.securityKey));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),t,this)})))}},{key:"getCodeByJson",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,new yf({baseURL:""}).get(t);case 4:(i=e.sent)&&200===i.status&&i.data&&(r=i.data),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),n,null,[[1,8]])})))}},{key:"getConference",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(r||{}).autoMute,a=void 0===o?0:o,e.abrupt("return",this.http.get("/api/rest/v1/meetingroom/hidden/soft/conference?userProfileId=".concat(t,"&securityKey=").concat(n,"&autoMute=").concat(a)));case 2:case"end":return e.stop()}}),i,this)})))}},{key:"setStates",value:function(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.meetingInfo,s=a.meetingId,c=void 0===s?"":s,u=a.callUri,l=String((new Date).getTime()),h=String((new Date).getTime()+this.statesTime.timeDiff),d=[{seqId:String(this.seqId),createTime:l,alignTime:h,category:t,eventName:n,version:"1.0",meetingId:c,eventValue:JSON.stringify(i)}],f={device:u,msgVer:"0.0.2",sendTime:String((new Date).getTime()),states:d},e.prev=5,p=(new Date).getTime(),e.next=9,this.http.post("/api/rest/v3/device/v2states",f);case 9:v=e.sent,this.seqId++,(null===(r=null==v?void 0:v.data)||void 0===r?void 0:r.currentTime)&&(g=v.data.currentTime,m=void 0===g?0:g,y=(new Date).getTime(),b=Math.round((y-p)/2),S=Number(m)+b-y,this.statesTime.timeDiff=S),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(5);case 16:case"end":return e.stop()}}),o,this,[[5,14]])})))}},{key:"ignoreMeetingMonitor",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(1e3*Math.random()).toFixed(),i=this.commonParams.securityKey,o="/api/rest/uss/v1/cloudmeeting/monitor?securityKey=".concat(i,"&conferenceNumber=").concat(t,"&nonce=").concat(r),e.next=5,this.http.get(o);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),n,this)})))}},{key:"getAllocation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="".concat(n,"/api/rest/allocator/v1/webrtc/allocation?key=").concat(t),a={},r&&(a={sign:0}),e.next=5,this.http.get(o,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),i,this)})))}},{key:"monitorOperation",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/api/rest/avcloud/external/monitor/monitorOperation/v1",e.next=3,this.http.post("/api/rest/avcloud/external/monitor/monitorOperation/v1",t);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:return r=e.t0,i=r.data,o=r.status,e.abrupt("return",[200!=+o,i]);case 10:case"end":return e.stop()}}),n,this)})))}},{key:"updateWebViewProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.monitorOperation({meetingId:e,action:"updateWebViewProp",operations:t})}},{key:"checkPermissionWithMeetingNumber",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/api/rest/v3/en/recording/authorization",i=this.commonParams.securityKey,e.next=4,this.http.get("/api/rest/v3/en/recording/authorization",{params:{confNumber:t,meetingId:n,securityKey:i}});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),r,this)})))}},{key:"checkStorageSpaceWithRecordingUrl",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.get("/api/rest/v3/en/charge/storage?recordingUrl=".concat(t,"&securityKey=").concat(r));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"getWebRxBandwidth",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.post("/api/rest/clientConfg/external/enterpriseConfig/v4",[{clientConfigName:"RemoteSDKConfig",configName:"downLinkCeilingRate"},{clientConfigName:"RemoteSDKConfig",configName:"upLinkCeilingRate"}],{params:{userId:t,securityKey:r,deviceType:17}});case 3:if(200!==(i=e.sent).status){e.next=6;break}return e.abrupt("return",i.data||{});case 6:return e.abrupt("return",{});case 7:case"end":return e.stop()}}),n,this)})))}},{key:"refreshToken",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.refreshToken({refresh_token:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),n,this)})))}}]),t}()),Ef=function(){function t(){var r=this;n(this,t),this.stopDB=function(){r.db.stop()},this.openDB=function(){r.db.open()},this.initDB=function(){return Rn(r,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.init();case 2:case"end":return e.stop()}}),t,this)})))},this.setLogLevel=function(e){r.currentLevel=e},this.putLog=function(t,n,i,o){return Rn(r,void 0,void 0,e().mark((function r(){var a,s=this;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a={time:o,title:t,content:n,rest:i},!this.db||!this.db.isOpen()){r.next=12;break}if(!this.cacheData.length||this.isAddCache){r.next=8;break}return this.isAddCache=!0,r.next=6,Promise.all(this.cacheData.map((function(t){return Rn(s,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.add(t);case 2:case"end":return e.stop()}}),n,this)})))})));case 6:this.cacheData=[],this.isAddCache=!1;case 8:return r.next=10,this.db.add(a);case 10:r.next=14;break;case 12:this.cacheData.length>10&&this.cacheData.shift(),this.cacheData.push(a);case 14:case"end":return r.stop()}}),r,this)})))},this.downloadLog=function(){return Rn(r,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.export();case 2:case"end":return e.stop()}}),t,this)})))},this.setLogServer=function(e){Cf.setLogBaseUrl(e)},this.db=new Zl(10),this.LogLevel={INFO:"INFO",DEBUG:"DEBUG",WARNING:"WARNING",ERROR:"ERROR",NONE:"NONE"},this.currentLevel=this.LogLevel.NONE,this.isArrowUpload=!0,this.cacheData=[],this.isAddCache=!1}return i(t,[{key:"debug",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel.DEBUG,i=zl(),o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];this.currentLevel===r&&"meeting-stats"!==t&&(e=console).log.apply(e,["[".concat(Yl(),"][DEBUG]"),t,n].concat(a));this.putLog(t,n,a,i)}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=zl();n=ql(n,gf);for(var s=arguments.length,c=new Array(s>2?s-2:0),u=2;u<s;u++)c[u-2]=arguments[u];this.currentLevel!==o&&this.currentLevel!==i||(t=console).log.apply(t,["[".concat(Yl(),"][INFO]"),e,n].concat(c));this.putLog(e,n,c,a)}},{key:"warn",value:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=r.WARNING,s=zl(),c=arguments.length,u=new Array(c>2?c-2:0),l=2;l<c;l++)u[l-2]=arguments[l];this.currentLevel!==o&&this.currentLevel!==i&&this.currentLevel!==a||(t=console).log.apply(t,["[".concat(Yl(),"][WARN]"),e,n].concat(u));this.putLog(e,n,u,s)}},{key:"error",value:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=r.ERROR,s=r.WARNING,c=zl(),u=arguments.length,l=new Array(u>2?u-2:0),h=2;h<u;h++)l[h-2]=arguments[h];this.currentLevel!==o&&this.currentLevel!==a&&this.currentLevel!==i&&this.currentLevel!==s||(t=console).log.apply(t,["[".concat(Yl(),"][ERROR]"),e,n].concat(l));this.putLog(e,n,l,c)}},{key:"enableLogUpload",value:function(){this.isArrowUpload=!0}},{key:"disableLogUpload",value:function(){this.isArrowUpload=!1}},{key:"uploadLog",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isArrowUpload){e.next=37;break}return e.next=3,this.db.upload(t);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0="";case 6:return o=e.t0,a=new FormData,s=Math.ceil(1e4*Math.random())+"",c=Date.now()+"",a.append("comments",r||t),a.append("sn",s),a.append("userId",s),a.append("deviceId",s),a.append("deviceType","WebrtcSDK"),a.append("userDisplayName",t),a.append("deviceDisplayName",navigator.userAgent),a.append("dataType","userSubmit"),a.append("account",n),a.append("number",""),a.append("softwareVersion",""),a.append("osVersion",""),a.append("deviceModel",""),a.append("crashType","UI"),a.append("crashTime",c),a.append("suffixName",".zip"),a.append("file",o,"webrtc_log.zip"),e.prev=27,e.next=30,Cf.upload(a);case 30:return u=e.sent,e.abrupt("return",u&&(u.status>=200||u.status<300));case 34:return e.prev=34,e.t1=e.catch(27),e.abrupt("return",!1);case 37:case"end":return e.stop()}}),i,this,[[27,34]])})))}}]),t}(),xf=Function,If=M([].concat),_f=M([].join),Af={},Tf=function(e,t,n){if(!Se(Af,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";Af[t]=xf("C,a","return new C("+_f(r,",")+")")}return Af[t](e,n)},Rf=x?xf.bind:function(e){var t=le(this),n=t.prototype,r=ir(arguments,1),i=function(){var n=If(r,ir(arguments));return this instanceof i?Tf(t,n.length,n):t.apply(e,n)};return X(n)&&(i.prototype=n),i};qt({target:"Function",proto:!0,forced:Function.bind!==Rf},{bind:Rf});var Of=co.findIndex,Df=!0;"findIndex"in[]&&Array(1).findIndex((function(){Df=!1})),qt({target:"Array",proto:!0,forced:Df},{findIndex:function(e){return Of(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("findIndex");var Nf,Lf,Pf,Mf,Bf=/"/g,Gf=M("".replace);qt({target:"String",proto:!0,forced:(Nf="link",C((function(){var e=""[Nf]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{link:function(e){return t="a",n="href",r=e,i=po(z(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+Gf(po(r),Bf,""")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}}),exports.RecordingState=void 0,(Lf=exports.RecordingState||(exports.RecordingState={})).RECORD_STATE_IDLE="RECORD_STATE_IDLE",Lf.RECORD_STATE_STARTING="RECORD_STATE_STARTING",Lf.RECORD_STATE_STARTED="RECORD_STATE_STARTED",Lf.RECORD_STATE_STOPING="RECORD_STATE_STOPING",exports.RecordStatus=void 0,(Pf=exports.RecordStatus||(exports.RecordStatus={}))[Pf.NONE=0]="NONE",Pf[Pf.LOCAL_START=1]="LOCAL_START",Pf[Pf.REMOTE_STAR=2]="REMOTE_STAR",Pf[Pf.REMOTE_PAUSED=3]="REMOTE_PAUSED",exports.AutoMute=void 0,(Mf=exports.AutoMute||(exports.AutoMute={}))[Mf.SMART=0]="SMART",Mf[Mf.ALL=1]="ALL",Mf[Mf.NOT=2]="NOT",Mf[Mf.FORCE=3]="FORCE";var jf={en_US:{default:"The call is abnormal, please try again later",OK:"Call ended",KickoutTipContent:"Your account is logged in at another location and you are forced to go offline",SHARE_CONTENT_FAILED:"Share content failed",LOCAL_NET_DISCONNECT:"The network is interrupted and the call is disconnected",TOKEN_INVALID:"Login has expired, please log in again"},zh_CN:{default:"呼叫异常,请稍后重试",OK:"通话已结束",KickoutTipContent:"您的账号在另一地点登录,您被迫下线",SHARE_CONTENT_FAILED:"分享屏幕失败",LOCAL_NET_DISCONNECT:"网络中断,呼叫已断开",TOKEN_INVALID:"登录已失效,请重新登录"},zh_TW:{default:"呼叫異常,請稍後重試",OK:"通話已結束",KickoutTipContent:"您的賬號在另一地點登錄,您被迫下線",SHARE_CONTENT_FAILED:"分享屏幕失敗",LOCAL_NET_DISCONNECT:"網絡中斷,呼叫已斷開",TOKEN_INVALID:"登錄已失效,請重新登錄"}},Hf=function(){function e(){n(this,e),this.events={}}return i(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if("function"!=typeof t)throw new TypeError("The listener not a function");this.events||(this.events={}),this.events[e]||(this.events[e]=[]),this.events[e].push({total:n,listener:t})}},{key:"once",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.on(e,t,n)}},{key:"removeListener",value:function(e){this.events[e]&&(this.events[e].length=0)}},{key:"removeAllListener",value:function(){this.events={}}},{key:"emmit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.events[e]&&this.events[e].forEach((function(n,i){if((-1===n.total||n.total>=1||"function"==typeof n.listener)&&n.listener.apply(t,r),n.total>=1){var o=t.events[e][i].total-1;t.events[e][i].total=o,0===o&&(t.events[e][i].listener=function(){})}}))}}]),e}(),Uf=[],Kf=function(){function e(t,r){var i=this;n(this,e),this.onOpenSocket=function(e){i.isConnected=!0,i.lockReconnect=!1,i.reconnectCount=0,i.options.openHeatBeat&&i.sendHeartBeat(),i.emit("open",e)},this.onHandleMessage=function(e){i.options.openHeatBeat&&e.data===i.options.pangData?i.clearPangTimer():i.emit("message",e)},this.onCloseSocket=function(e){if(i.isConnected=!1,i.logger.log("close websocket success",e.code+","+e.reason+","+e.wasClean),i.logger.log("this.messageList: ",i.messageList),4e3===e.code)return i.isClose=!0,void i.emit("close",e);i.lockReconnect||(i.reconnectCount>=1?i.reconnectTimer||(i.reconnectTimer=setTimeout((function(){i.reConnect(),i.reconnectTimer=null}),i.reconnectOffset)):i.reConnect(),i.emit("error",e))},this.onErrorSocket=function(e){i.logger.log("error connection websocket"),i.isConnected=!1,i.lockReconnect||(i.reconnectCount>=1?i.reconnectTimer||(i.reconnectTimer=setTimeout((function(){i.reConnect(),i.reconnectTimer=null}),i.reconnectOffset)):i.reConnect(),i.emit("error",e))};this.logger=r.logger,this.client=r,this.options=Object.assign(Object.assign({},{protocols:[],pingData:"PING",pangData:"PONG",autoReConnect:!0,openHeatBeat:!0,params:{}}),t),this.heatBeatFrequency=15e3,this.timeOffset=1e4,this.reconnectCount=0,this.reconnectLimit=5,this.lockReconnect=!1,this.messageList={},this.headBeatTimer=null,this.isConnected=!1,this.isClose=!1,this.reconnectOffset=3e3,this.reconnectTimer=null,this.connect(!1),this.addEvent()}return i(e,[{key:"connect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.options,n=t.url,r=t.params,i=n+"?";if(window.WebSocket){for(var o in r)i+=e&&"start"===o?"".concat(o,"=",!1,"&"):"".concat(o,"=").concat(r[o],"&");this.socket=new WebSocket(i,this.options.protocols),Uf.push(this.socket),e&&(this.lockReconnect=!1)}else this.emit("error",Xl("XYSDK:950116","Current browser cannot support Websocket, please use XyRTC sdk in chrome!"))}},{key:"addEvent",value:function(){this.socket.addEventListener("open",this.onOpenSocket),this.socket.addEventListener("message",this.onHandleMessage),this.socket.addEventListener("close",this.onCloseSocket),this.socket.addEventListener("error",this.onErrorSocket)}},{key:"removeEvent",value:function(){this.socket.removeEventListener("open",this.onOpenSocket),this.socket.removeEventListener("message",this.onHandleMessage),this.socket.removeEventListener("close",this.onCloseSocket),this.socket.removeEventListener("error",this.onErrorSocket)}},{key:"sendHeartBeat",value:function(){var e=this;this.headBeatTimer||(this.socket.send(this.options.pingData||"PING"),this.clearTimeout()),this.headBeatTimer=setInterval((function(){e.client.disconnected?e.clearBeatTimer():(e.socket.send(e.options.pingData||"PING"),e.clearTimeout())}),this.heatBeatFrequency)}},{key:"clearTimeout",value:function(){var e=this;this.pangTimer=setTimeout((function(){e.emit("timeout",""),e.options.autoReConnect&&e.reConnect()}),this.timeOffset)}},{key:"emit",value:function(e,t){this.messageList[e]&&this.messageList[e].forEach((function(e){e(t)}))}},{key:"clearPangTimer",value:function(){this.pangTimer&&clearTimeout(this.pangTimer)}},{key:"clearBeatTimer",value:function(){this.headBeatTimer&&clearInterval(this.headBeatTimer)}},{key:"clearReconnectTimer",value:function(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null}},{key:"reset",value:function(){this.clearBeatTimer(),this.clearPangTimer(),this.clearReconnectTimer(),this.messageList={}}},{key:"on",value:function(e,t){this.messageList[e]?this.messageList[e].push(t):this.messageList[e]=[t]}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.socket&&this.socket.close(),Uf.map((function(e){e&&e.close()})),Uf=[],this.clearBeatTimer(),this.clearPangTimer(),this.clearReconnectTimer(),e||(this.messageList={}),this.removeEvent()}},{key:"send",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r="string"==typeof e,i=t&&!r?JSON.stringify(e):e,o={0:"connection",1:"open",2:"closing",3:"closed"};n&&(this.logger.log("send wss message: ",e),this.isConnected||(this.logger.log("wss connected status: ",this.isConnected),this.logger.log("socket connection status: ",o[this.socket.readyState]||"unknown"))),this.isConnected?this.isClose||(1===this.socket.readyState&&(this.socket.send(i),n&&this.logger.log("send wss message successfully")),"STOP_CALL"===e.type&&this.stopCall()):n&&this.logger.log("send wss message failed, because socket is closed")}},{key:"stopCall",value:function(){var e=this;this.isConnected=!1,setTimeout((function(){e.close()}),10)}},{key:"reConnect",value:function(){if(!this.client.disconnected&&!this.lockReconnect){if(this.reconnectCount>=this.reconnectLimit)return this.isClose=!0,void this.emit("close",null);this.lockReconnect=!0,this.reconnectCount+=1,this.logger.log("reconnect is trigger"),this.logger.log("reconnect count:",this.reconnectCount),this.close(!0),this.emit("reconnect",""),this.connect(!0),this.addEvent()}}}]),e}(),Ff=Math.floor,zf=M("".charAt),Yf=M("".replace),Vf=M("".slice),Xf=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Wf=/\$([$&'`]|\d{1,2})/g,qf=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,c=Wf;return void 0!==i&&(i=ye(i),c=Xf),Yf(o,c,(function(o,c){var u;switch(zf(c,0)){case"$":return"$";case"&":return e;case"`":return Vf(t,0,n);case"'":return Vf(t,a);case"<":u=i[Vf(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>s){var h=Ff(l/10);return 0===h?o:h<=s?void 0===r[h-1]?zf(c,1):r[h-1]+zf(c,1):o}u=r[l-1]}return void 0===u?"":u}))},Zf=Te("replace"),Jf=Math.max,$f=Math.min,Qf=M([].concat),ep=M([].push),tp=M("".indexOf),np=M("".slice),rp="$0"==="a".replace(/./,"$0"),ip=!!/./[Zf]&&""===/./[Zf]("a","$0");Xo("replace",(function(e,t,n){var r=ip?"$":"$0";return[function(e,n){var r=z(this),i=null==e?void 0:he(e,Zf);return i?_(i,e,r,n):_(t,po(r),e,n)},function(e,i){var o=Fe(this),a=po(e);if("string"==typeof i&&-1===tp(i,r)&&-1===tp(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var c=V(i);c||(i=po(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var h=[];;){var d=na(o,a);if(null===d)break;if(ep(h,d),!u)break;""===po(d[0])&&(o.lastIndex=ea(a,_t(o.lastIndex),l))}for(var f,p="",v=0,g=0;g<h.length;g++){for(var m=po((d=h[g])[0]),y=Jf($f(kt(d.index),a.length),0),b=[],S=1;S<d.length;S++)ep(b,void 0===(f=d[S])?f:String(f));var w=d.groups;if(c){var k=Qf([m],b,y,a);void 0!==w&&ep(k,w);var C=po(er(i,void 0,k))}else C=qf(m,a,y,b,w,i);y>=v&&(p+=np(a,v,y)+C,v=y+m.length)}return p+np(a,v)}]}),!!C((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!rp||ip);var op=$e.EXISTS,ap=Xe.f,sp=Function.prototype,cp=M(sp.toString),up=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,lp=M(up.exec);E&&!op&&ap(sp,"name",{configurable:!0,get:function(){try{return lp(up,cp(this))[1]}catch(e){return""}}});var hp=co.some,dp=to("some");qt({target:"Array",proto:!0,forced:!dp},{some:function(e){return hp(this,e,arguments.length>1?arguments[1]:void 0)}});var fp=Object.prototype.toString,pp=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===vp(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(vp(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(t=fp.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function vp(e){return"function"==typeof e.constructor?e.constructor.name:null}const gp=Symbol.prototype.valueOf;var mp=function(e,t){switch(pp(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return function(e){const t=e.length,n=Buffer.allocUnsafe?Buffer.allocUnsafe(t):Buffer.from(t);return e.copy(n),n}(e);case"symbol":return function(e){return gp?Object(gp.call(e)):{}}(e);case"arraybuffer":return function(e){const t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}(e);case"regexp":return function(e){const t=void 0!==e.flags?e.flags:/\w+$/.exec(e)||void 0,n=new e.constructor(e.source,t);return n.lastIndex=e.lastIndex,n}(e);case"error":return Object.create(e);default:return e}};function yp(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function bp(e,t){switch(pp(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||(n=e,!1!==yp(n)&&"function"==typeof(r=n.constructor)&&!1!==yp(i=r.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))){const n=new e.constructor;for(let r in e)n[r]=bp(e[r],t);return n}var n,r,i;return e}(e,t);case"array":return function(e,t){const n=new e.constructor(e.length);for(let r=0;r<e.length;r++)n[r]=bp(e[r],t);return n}(e,t);default:return mp(e)}}var Sp=bp,wp=function(){function t(e,r){n(this,t),this.filterInternels=function(e){var t=Sp(e);return Object.keys(t.audioReceiver).forEach((function(e){var n=t.audioReceiver[e];n.bytesReceivedSecond>0||n.audioLevel||delete t.audioReceiver[e]})),t};var i=e.logger,o=e.invite;this.client=e,this.peerStatus={peerconnectionStatus:"disconnected",iceConnectionState:"disconnected"},this.invite=o,this.logger=i,this.connectCount=0,this.stream=r,this.streamSenders=[],this.senderTimmer=null,this.internels=Sp(nf.INIT_INTERNELS),this.isShareContent=!1,this.isResendContentOffer=uf,this.isRestartIceConnection=!1,this.isFirstConnected=!1,this.onHandleNegotiationNeeded=this.onHandleNegotiationNeeded.bind(this),this.onHandleIceConnectionStateChange=this.onHandleIceConnectionStateChange.bind(this),this.onHandleConnectionStateChange=this.onHandleConnectionStateChange.bind(this),this.onHandleIcecandidateerror=this.onHandleIcecandidateerror.bind(this),this.onTrack=this.onTrack.bind(this),this.init()}return i(t,[{key:"getInternels",value:function(){return this.internels}},{key:"init",value:function(){this.initTimmer(),this.peerConnection=new RTCPeerConnection(ef),this.peerConnection.onnegotiationneeded=this.onHandleNegotiationNeeded,this.peerConnection.oniceconnectionstatechange=this.onHandleIceConnectionStateChange,this.peerConnection.onconnectionstatechange=this.onHandleConnectionStateChange,this.peerConnection.onicecandidateerror=this.onHandleIcecandidateerror,null===this.peerConnection.ontrack?this.peerConnection.ontrack=this.onTrack:this.peerConnection.addEventListener("track",this.onTrack)}},{key:"sendEmmit",value:function(e,t,n,r){this.isRestartIceConnection&&"XYSDK:950517"!==t||("XYSDK:950518"===t&&this.client.setPeerConnectionStatus(!0),this.client.emmit(e,{code:t,msg:n,detail:r}))}},{key:"stopConnectTimmer",value:function(){this.isRestartIceConnection=!1,this.connectTimmer&&clearTimeout(this.connectTimmer),this.connectTimmer=null,this.connectCount=0}},{key:"initTimmer",value:function(){var e=this;this.connectTimmer=setTimeout((function(){var t=e.peerStatus,n=t.peerconnectionStatus,r=t.iceConnectionState,i=Sp(e.peerStatus);return e.connectCount>40?(e.sendEmmit("call-status","XYSDK:950517","呼叫失败","PEER_NET_DISCONNECT"),e.stopConnectTimmer(),void e.logger.log("loop peer status after 40s: ",i)):"connected"!==n&&"unknown"!==n||"connected"!==r&&"completed"!==r?(20===e.connectCount&&(e.sendEmmit("call-status","XYSDK:950519","正在呼叫中,请等候","waiting"),e.logger.log("loop peer status after 20s: ",i)),e.connectCount+=.5,void e.initTimmer()):(e.isFirstConnected=!0,e.sendEmmit("call-status","XYSDK:950518","入会成功","success"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i))}),500)}},{key:"onHandleNegotiationNeeded",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection();case 2:case"end":return e.stop()}}),t,this)})))}},{key:"createBaseOfferConnection",value:function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.peerConnection){e.next=10;break}return e.next=4,this.peerConnection.createOffer(n);case 4:return(i=e.sent).sdp=null===(t=i.sdp)||void 0===t?void 0:t.replace("useinbandfec=1","useinbandfec=0"),e.next=8,this.peerConnection.setLocalDescription(i);case 8:this.sendSocketMessage("offer",{sdp:i.sdp}),this.client.sendPeopleCapability();case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.error("create offer error: ",e.t0);case 15:case"end":return e.stop()}}),r,this,[[0,12]])})))}},{key:"sendSocketMessage",value:function(e,t){var n=this.invite,r=n.meetingId,i=n.callerUri,o=n.callIndex;this.client.sendSocketMessage({type:"PASS_THROUGH",callIndex:o,body:Object.assign({type:e,meetingId:r,endpointId:i},t)})}},{key:"handleCandidate",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete t.type,e.prev=1,e.next=4,null===(n=this.peerConnection)||void 0===n?void 0:n.addIceCandidate(new RTCIceCandidate(t));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),this.logger.error("peer add ice candidate error: ",e.t0);case 9:case"end":return e.stop()}}),r,this,[[1,6]])})))}},{key:"handleAnswer",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(n=this.peerConnection)||void 0===n?void 0:n.setRemoteDescription(new RTCSessionDescription(t));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),this.logger.log("handle answer error:",{name:null===e.t0||void 0===e.t0?void 0:e.t0.name,code:null===e.t0||void 0===e.t0?void 0:e.t0.code,message:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 8:case"end":return e.stop()}}),r,this,[[0,5]])})))}},{key:"setBandWidth",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:nf.VIDE_BANDWIDTH_BIT,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=v(this.streamSenders),e.prev=1,a.s();case 3:if((s=a.n()).done){e.next=22;break}if(c=s.value,!(u=c.sender)||!u.track||"video"!==u.track.kind||t!==u.track.id){e.next=20;break}return l=null,e.prev=8,l=u.getParameters()||{encodings:[{maxBitrate:nf.VIDE_BANDWIDTH_BIT}]},h=r?1e3*n:n,(null==l?void 0:l.encodings)&&l.encodings[0]?l.encodings[0].maxBitrate=h:l.encodings=[{maxBitrate:h}],e.next=14,u.setParameters(l);case 14:this.logger.log("set bandwidth successfully",{params:l,realBandwidth:h,trackId:u.track.id,streamId:null==i?void 0:i.id}),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(8),this.logger.error("set bandwidth failed",l,e.t0);case 20:e.next=3;break;case 22:e.next=27;break;case 24:e.prev=24,e.t1=e.catch(1),a.e(e.t1);case 27:return e.prev=27,a.f(),e.finish(27);case 30:case"end":return e.stop()}}),o,this,[[1,24,27,30],[8,17]])})))}},{key:"onHandleIceConnectionStateChange",value:function(t){var n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.peerStatus.peerconnectionStatus,a=this.peerConnection||{connectionState:"unknown"},s=a.connectionState,c=void 0===s?"unknown":s,this.logger.log("the peerConnection connectionState when ice change: ",null===(n=this.peerConnection)||void 0===n?void 0:n.connectionState),this.peerStatus={iceConnectionState:null===(r=null==t?void 0:t.target)||void 0===r?void 0:r.iceConnectionState,peerconnectionStatus:"connected"===o?o:c},!La){e.next=10;break}if("unknown"!==this.peerStatus.peerconnectionStatus||"disconnected"!==this.peerStatus.iceConnectionState&&"failed"!==this.peerStatus.iceConnectionState&&"closed"!==this.peerStatus.iceConnectionState){e.next=10;break}return this.logger.log("[Firefox] ice state: ",this.peerStatus.iceConnectionState),"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapabilityMessage(),e.next=10,this.restartIceConnection();case 10:this.logger.log("ice change status: ",Sp(this.peerStatus));case 11:case"end":return e.stop()}}),i,this)})))}},{key:"onHandleConnectionStateChange",value:function(){var t;return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null===(t=this.peerConnection)||void 0===t?void 0:t.connectionState)||"",this.logger.log("peerconnection status change: ",{currentStatus:r,previousStatus:this.peerStatus.peerconnectionStatus}),"connected"!==this.peerStatus.peerconnectionStatus||"connected"===r){e.next=10;break}return"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapabilityMessage(),this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:r}),this.logger.log("this.peerStatus before restart: ",this.peerStatus),e.next=8,this.restartIceConnection();case 8:e.next=12;break;case 10:this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:r}),this.logger.log("this.peerStatus: ",this.peerStatus);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"onHandleIcecandidateerror",value:function(e){this.logger.log("ice candidate error:",e)}},{key:"restartIceConnection",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("restart ice connection:",{isRestartIceConnection:this.isRestartIceConnection,isFirstConnected:this.isFirstConnected}),this.isRestartIceConnection=t&&this.isFirstConnected,this.initTimmer(),e.next=5,this.createBaseOfferConnection({iceRestart:!0});case 5:case"end":return e.stop()}}),n,this)})))}},{key:"close",value:function(){var e=this;this.stopConnectTimmer(),this.peerConnection&&(this.streamSenders.forEach((function(t){var n;(null==t?void 0:t.sender)&&(null===(n=e.peerConnection)||void 0===n||n.removeTrack(t.sender))})),this.peerConnection.onicecandidate=null,this.peerConnection.removeEventListener&&this.peerConnection.removeEventListener("track",this.onTrack),this.peerConnection.ontrack=null,this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicegatheringstatechange=null,this.peerConnection.onnegotiationneeded=null,this.peerConnection&&this.peerConnection.close&&this.peerConnection.close(),this.peerConnection=null),this.senderTimmer&&clearInterval(this.senderTimmer),this.senderTimmer=null,this.isShareContent=!1,this.isFirstConnected=!1,this.isRestartIceConnection=!1}},{key:"setRestartIceConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isRestartIceConnection=e}},{key:"publish",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ALL",n=e.getMediaStreams(),r=n.streams,i=n.pipelineStreams,o=n.contentStreams;"ALL"===t?("NORMAL"!==e.current.type&&"AUDIO_ONLY"!==e.current.type&&"VIDEO_ONLY"!==e.current.type||this.addTransceiver(r,"sendrecv"),this.addTransceiver(i,"recvonly"),this.logger.log("publish people stream successfully")):"CONTENT"===t&&(this.isShareContent?this.resetContentStream(o):(this.addTransceiver(o,"sendonly"),this.isResendContentOffer===lf&&(this.isResendContentOffer=hf),this.logger.log("push content use addTransceiver.")),this.isShareContent=!0,this.logger.log("publish content stream successfully: ",this.streamSenders)),this.initSenderStatus()}},{key:"reSendContentOffer",value:function(){this.isResendContentOffer===uf&&(this.isResendContentOffer=lf)}},{key:"resetContentStream",value:function(e){var t;if(this.replaceTrack(e),this.isResendContentOffer===lf){var n=e.find((function(e){return"720"===e.resolution}));if(n){var r=null===(t=n.stream)||void 0===t?void 0:t.getAudioTracks()[0];r&&this.addStreamRenders(r,"sendonly",n)}this.isResendContentOffer=hf}this.logger.log("push content use replaceTrack.")}},{key:"replacePeopleVideoTrack",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",n=e.getMediaStreams(),r=n.streams;"audio"===t?this.replaceAudioTrack(r):this.replaceVideoTrack(r)}},{key:"initSenderStatus",value:function(){var t=this;this.senderInterval=0,this.senderTimmer||(this.calcMeetingStats(),this.senderTimmer=setInterval((function(){return Rn(t,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.senderInterval=this.senderInterval+1,e.next=3,this.calcMeetingStats();case 3:case"end":return e.stop()}}),t,this)})))}),2e3))}},{key:"closeContentStream",value:function(){var e=this;this.streamSenders.forEach((function(t,n){"contentStream"===t.type&&(t.sender.replaceTrack(null),e.streamSenders[n].status="ended")}))}},{key:"getPeerStatus",value:function(){var e=this.peerStatus.peerconnectionStatus;return this.logger.log("get peer status: ",this.peerStatus),"connected"===e}},{key:"setStream",value:function(e,t){var n,r=this,i=(null===(n=this.peerConnection)||void 0===n?void 0:n.getTransceivers())||[],o=0,a=0;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){if(n.kind===t&&("audio"===t&&"180"===e.resolution||"video"===t))for(;o<i.length;){if(!i[o].sender.track&&"sendrecv"!==i[o].direction&&i[o].receiver.track.kind===n.kind){i[o].direction="sendrecv",i[o].sender.setStreams(e.stream),i[o].sender.replaceTrack(n),0===a&&(r.logger.log("sender replace track success"),a++),r.setStreamSenders(n,e,i[o]),o++;break}o++}}))}))}},{key:"calcMeetingStats",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,d,f,p,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R,O,D,N,L,P,M,B,G,j,H,U,K,F,z,Y,V,X,W,q,Z,J;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=Sp(nf.INIT_INTERNELS),r=!1,i=this.client.invite.callerUri,o=this.client.getLayoutList(),a=0,s=0,c=0,u=0,l=0,d=0,f=0,p=0,g=this.client.getAudioTrackList(),m=g.length,n.mimeType="video/H264",n.timestamp=(new Date).valueOf(),y=v(o.entries()),e.prev=17,y.s();case 19:if((b=y.n()).done){e.next=41;break}if((S=h(b.value,2))[0],w=S[1],k=w.roster.endpointId,k===i||w.roster.videoTxMute){e.next=39;break}if(C=w.roster.id,!(E=this.client.getVideoManagers())||!E[C]){e.next=39;break}if(x=E[C],!((I=null==x?void 0:x.getVideoTracks())&&I[0]&&this.peerConnection)){e.next=39;break}return e.next=32,this.peerConnection.getStats(I[0]);case 32:_=e.sent,A=this.getReceiverStatus(_,w,n),a+=A.bytesReceivedSecond||0,l+=A.packetsReceivedSecond||0,d+=A.packetsLostSecond||0,!A.frameWidth&&I[0]&&(T=I[0].getSettings(),R=T.width,O=void 0===R?0:R,D=T.height,N=void 0===D?0:D,A.frameWidth=O,A.frameHeight=N),n.receiver[I[0].id]=A;case 39:e.next=19;break;case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(17),y.e(e.t0);case 46:return e.prev=46,y.f(),e.finish(46);case 49:L=0;case 50:if(!(L<g.length)){e.next=67;break}if(P=g[L],!(M=P.rest.track)||"live"!==M.readyState||!this.peerConnection){e.next=64;break}return e.next=56,this.peerConnection.getStats(M);case 56:B=e.sent,(G=this.getReceiverAudioTrackStatus(B,M)).bytesReceivedSecond=Math.max(G.bytesReceivedSecond,0),f+=G.packetsReceivedSecond||0,p+=G.packetsLostSecond||0,j=m===L+1,Object.assign(G,{isContent:j}),n.audioReceiver[M.id]=G;case 64:L++,e.next=50;break;case 67:H=0,U=0,K=0,F=0,z=v(this.streamSenders.entries()),e.prev=72,z.s();case 74:if((Y=z.n()).done){e.next=90;break}if((V=h(Y.value,2))[0],"active"!==(X=V[1]).status||!X.track){e.next=88;break}return e.next=79,X.sender.getStats();case 79:W=e.sent,q="audio"===X.track.kind?"audioSender":"sender",Z=this.getSenderStatus(q,W,n,X,!r),"video"===X.track.kind&&(s+=Z.bytesSentSecond||0,c+=Z.packetsSentSecond||0,u+=Z.packetsLostSecond||0,K=Math.max(K,1e3*(Z.jitter||0)),F=Math.max(F,1e3*(Z.roundTripTime||0))),"audio"===X.track.kind&&(U+=Z.packetsSentSecond||0,H+=Z.packetsLostSecond||0,n.audioSendJitter=Math.floor(1e3*(Z.jitter||0))),n.jitterSent=Math.floor(K),n.roundTripTime=Math.floor(F),n[q][X.track.id]=Z,r=!0;case 88:e.next=74;break;case 90:e.next=95;break;case 92:e.prev=92,e.t1=e.catch(72),z.e(e.t1);case 95:return e.prev=95,z.f(),e.finish(95);case 98:n.fractionLostSent=this.getLost(c,u),n.audioSendLost=this.getLost(U,H),n.fractionLostReceived=this.getLost(l,d),n.audioRecvLost=this.getLost(f,p),n.bytesSentSecond=s,n.bytesReceivedSecond=a,this.internels=n,J=this.filterInternels(n),this.client.reportQualityData(J),this.client.debug&&this.client.sendInternels(J),this.senderInterval>=3&&n.bytesSentSecond<500&&(this.logger.debug("get network:",Na.getNetWork()),this.logger.debug("meeting-stats",n),this.senderInterval=0);case 109:case"end":return e.stop()}}),t,this,[[17,43,46,49],[72,92,95,98]])})))}},{key:"getLost",value:function(e,t){return 0===e?0:Math.max(Math.floor(t/(t+e)*100),0)}},{key:"addTransceiver",value:function(e,t){var n=this;e.forEach((function(e){var r=e.status,i=e.domStream,o=e.stream;"NORMAL"===r?null==o||o.getTracks().forEach((function(r){n.addStreamRenders(r,t,e)})):"DOMSTRING"===r&&i.forEach((function(r){n.addStreamRenders(r,t,e)}))})),this.logger.log("transceiver senders: ",this.streamSenders)}},{key:"addStreamRenders",value:function(e,t,n){var r=this.addTransceiverByPeer(e,t,n);this.setStreamSenders(e,n,r)}},{key:"preferCodec",value:function(e,t){var n=[];return e.forEach((function(e){e.mimeType===t&&n.push(e)})),n}},{key:"addTransceiverByPeer",value:function(e,t,n){var r,i={direction:t},o="NORMAL"===n.status,a=e.kind;return o&&n.stream&&(i.streams=[n.stream],a=e),null===(r=this.peerConnection)||void 0===r?void 0:r.addTransceiver(a,i)}},{key:"setStreamSenders",value:function(t,n,r){var i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a="NORMAL"===n.status,s=t.kind,c={resolution:n.resolution,track:a?t:null,sender:r.sender,type:n.type,status:a?"active":"invalid"},("video"!==s||"remoteStream"!==n.type&&"contentStream"!==n.type)&&("audio"!==s||"180"!==n.resolution&&"contentStream"!==n.type)){e.next=24;break}if(!La||"video"!==(null===(i=c.track)||void 0===i?void 0:i.kind)){e.next=23;break}if(!(u=c.sender)||!u.track||"video"!==u.track.kind){e.next=23;break}return l=u.track.getSettings().height,h=null,d=1,e.prev=10,720===l&&(d=df[c.resolution]),360===l&&"180"===c.resolution&&(d=2),(null==(h=u.getParameters()||{encodings:[{}]})?void 0:h.encodings)&&h.encodings[0]?h.encodings[0].scaleResolutionDownBy=d:h.encodings=[{scaleResolutionDownBy:d}],this.logger.log("set stream sender in firefox:",h),e.next=18,u.setParameters(h);case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),this.logger.error("set bandwidth failed",h,e.t0);case 23:this.streamSenders.push(c);case 24:case"end":return e.stop()}}),o,this,[[10,20]])})))}},{key:"replaceAudioTrack",value:function(e){var t=this,n=e.find((function(e){return"180"===e.resolution&&e.stream}));if(null==n?void 0:n.stream){var r=n.stream.getAudioTracks()[0];this.streamSenders.forEach((function(e,n){"180"===e.resolution&&e.track&&"audio"===e.track.kind&&(e.sender.replaceTrack(r),t.streamSenders[n].status="active",t.streamSenders[n].track=r)}))}}},{key:"replaceVideoTrack",value:function(e){var t=this;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){"video"===(null==n?void 0:n.kind)&&t.streamSenders.forEach((function(r,i){var o;"video"===(null===(o=r.track)||void 0===o?void 0:o.kind)&&r.type===e.type&&e.resolution===r.resolution&&(r.sender.replaceTrack(n),t.streamSenders[i].status="active",t.streamSenders[i].track=n)}))}))}))}},{key:"replaceTrack",value:function(e){var t=this;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){t.streamSenders.forEach((function(r,i){var o;(null===(o=r.track)||void 0===o?void 0:o.kind)===(null==n?void 0:n.kind)&&r.type===e.type&&e.resolution===r.resolution&&(r.sender.replaceTrack(n),t.streamSenders[i].status="active",t.streamSenders[i].track=n)}))}))}))}},{key:"getSenderStatus",value:function(e,t,n,r,i){var o=this,a={};if(t.forEach((function(t){var s,c,u,l,h,d=t.type,f=t.bytesReceived,p=void 0===f?0:f,v=t.timestamp,g=void 0===v?0:v,m=t.mimeType,y=t.audioLevel,b=void 0===y?0:y;switch(n.timestamp=g,n.mimeType="video/H264",a.isContent="contentStream"===r.type,d){case"transport":if(i){var S=t.bytesSent,w=void 0===S?0:S,k=o.rateBytesCalculator(t,"bytesSent","timestamp",8,1),C=o.rateBytesCalculator(t,"bytesReceived","timestamp",8,1);n.bytesSent=w,n.bytesReceived=p,n.bytesReceivedSecond=C,n.timestamp=g,n.bytesSentSecond=k}break;case"track":var E=t.frameWidth,x=void 0===E?0:E,I=t.frameHeight,_=void 0===I?0:I,A=t.framesSent,T=void 0===A?0:A,R=t.hugeFramesSent,O=void 0===R?0:R,D=o.rateBytesCalculator(t,"framesSent","timestamp",1,1e3,o.internels[e][(null===(s=r.track)||void 0===s?void 0:s.id)||""]);"sender"===e&&(a.frameWidth=x,a.frameHeight=_),a.framesSent=T,a.framesSentSecond=D,a.hugeFramesSent=O,a.timestamp=g,a.type=r.type,a.status=r.status,a.resolution=r.resolution,a.expBandwidth=10;break;case"outbound-rtp":var N=t.bytesSent,L=t.framesEncoded,P=t.packetsSent,M=t.keyFramesEncoded,B=void 0===M?"N/A":M,G=t.nackCount,j=t.ssrc,H=t.pliCount,U=void 0===H?0:H,K=t.firCount,F=void 0===K?0:K,z=o.rateBytesCalculator(t,"framesEncoded","timestamp",1,1e3,o.internels[e][(null===(c=r.track)||void 0===c?void 0:c.id)||""]),Y=o.rateBytesCalculator(t,"bytesSent","timestamp",8,1,o.internels[e][(null===(u=r.track)||void 0===u?void 0:u.id)||""]),V=o.rateBytesCalculator(t,"packetsSent","timestamp",1,1e3,o.internels[e][(null===(l=r.track)||void 0===l?void 0:l.id)||""]);"sender"===e&&(t.frameWidth&&(a.frameWidth=t.frameWidth),t.frameHeight&&(a.frameHeight=t.frameHeight)),a.bytesSent=N,a.bytesSentSecond=Y,a.framesEncoded=L,a.framesEncodedSecond=z,a.timestamp=g,a.packetsSent=P,a.packetsSentSecond=V,a.keyFramesEncoded=B,a.pliCount=U,a.firCount=F,a.nackCount=G,a.ssrc=j,a.type=r.type,a.status=r.status,a.resolution=r.resolution,a.expBandwidth=10;break;case"codec":i&&(n.mimeType=m),a.mimeType=m;break;case"media-source":a.audioLevel=Number((100*b).toFixed(0));break;case"remote-inbound-rtp":var X=t.jitter,W=void 0===X?0:X,q=t.packetsLost,Z=void 0===q?0:q,J=t.roundTripTime,$=void 0===J?0:J,Q=o.rateBytesCalculator(t,"packetsLost","timestamp",1,1e3,o.internels[e][(null===(h=r.track)||void 0===h?void 0:h.id)||""]);a.packetsLost=Z,a.packetsLostSecond=Q,a.jitter=W,a.roundTripTime=$}})),!a.framesSentSecond&&La&&(a.framesSentSecond=30),!a.frameWidth){var s=nf.MAP_RESOLUTION_STRING[r.resolution],c=s.width,u=void 0===c?0:c,l=s.height,h=void 0===l?0:l;a.frameWidth=u,a.frameHeight=h}return a}},{key:"calcAudioLevel",value:function(e){if(e<316e-7)return 0;var t=100*e;return Number(t>1?t.toFixed(0):t.toFixed(2))}},{key:"getReceiverStatus",value:function(e,t,n){var r=this,i={endpointId:t.roster.endpointId,participantId:t.roster.participantId},o=0;return e.forEach((function(e){var n,a=e.type,s=e.timestamp,c=void 0===s?0:s,u=t.roster,l=u.displayName,h=u.isContent,d=u.id,f=u.ExpectHeight,p=void 0===f?0:f,v=u.ExpectWidth,g=void 0===v?0:v,m=r.client.getVideoManagers(),y="";m&&m[d]&&(y=(null===(n=(m[d].getVideoTracks()||[])[0])||void 0===n?void 0:n.id)||"");switch(i.ExpectHeight=p,i.ExpectWidth=g,i.isContent=h,a){case"track":var b=e.frameWidth,S=void 0===b?0:b,w=e.frameHeight,k=void 0===w?0:w,C=e.framesReceived,E=void 0===C?0:C,x=e.jitterBufferDelay,I=void 0===x?0:x,_=r.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,r.internels.receiver[y]);i.frameWidth=S,i.frameHeight=k,i.framesReceived=E,i.framesReceivedSecond=_,i.jitterBufferDelay=I,i.timestamp=c,i.type="video",i.status="active",i.name=l,i.expResolution=0;break;case"inbound-rtp":var A=e.bytesReceived,T=e.framesDecoded,R=e.packetsReceived,O=e.packetsLost,D=e.keyFramesDecoded,N=void 0===D?"N/A":D,L=e.nackCount,P=e.pliCount,M=e.framesPerSecond,B=e.framesDropped,G=e.ssrc,j=e.jitter,H=r.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,r.internels.receiver[y]),U=r.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,r.internels.receiver[y]),K=r.rateBytesCalculator(e,"packetsReceived","timestamp",1,1e3,r.internels.receiver[y]),F=r.rateBytesCalculator(e,"packetsLost","timestamp",1,1e3,r.internels.receiver[y]);if(e.frameWidth&&(i.frameWidth=e.frameWidth),e.frameHeight&&(i.frameHeight=e.frameHeight),e.framesReceived){var z=r.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,r.internels.receiver[y]);i.framesReceived=e.framesReceived,i.framesReceivedSecond=z}i.bytesReceived=A,i.bytesReceivedSecond=U,i.framesDecoded=T,i.framesDecodedSecond=H,i.packetsReceived=R,i.packetsReceivedSecond=K,i.packetsLost=O,i.packetsLostSecond=F,i.keyFramesDecoded=N,i.nackCount=L,i.pliCount=P,i.framesPerSecond=M,i.framesDropped=B,i.ssrc=G,i.jitter=j,i.timestamp=c,i.type="video",i.status="active",i.name=l,i.expResolution=0,j&&(o=Math.max(o,1e3*j))}})),n.jitterReceived=Math.floor(o),i}},{key:"getReceiverAudioTrackStatus",value:function(e,t){var n=this,r={type:"audio"},i=t.id,o="audioReceiver";return e.forEach((function(e){var t=e.type,a=e.mimeType;if(r.mimeType="audio/opus","track"===t){var s=e.framesReceived,c=void 0===s?0:s,u=e.jitterBufferDelay,l=void 0===u?0:u,h=e.timestamp,d=void 0===h?0:h,f=n.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,n.internels[o][i]);r.framesReceived=c,r.framesReceivedSecond=f,r.jitterBufferDelay=l,r.timestamp=d,r.status="active",r.expResolution=0,e.audioLevel&&(r.audioLevel=n.calcAudioLevel(e.audioLevel))}else if("inbound-rtp"===t){var p=e.bytesReceived,v=e.framesDecoded,g=e.packetsReceived,m=e.keyFramesDecoded,y=void 0===m?"N/A":m,b=e.nackCount,S=e.pliCount,w=e.framesPerSecond,k=e.framesDropped,C=e.ssrc,E=e.jitter,x=e.timestamp,I=e.insertedSamplesForDeceleration,_=void 0===I?0:I,A=e.totalSamplesReceived,T=void 0===A?0:A,R=e.removedSamplesForAcceleration,O=void 0===R?0:R,D=n.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,n.internels[o][i]),N=n.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,n.internels[o][i]),L=n.rateBytesCalculator(e,"insertedSamplesForDeceleration","timestamp",1,1e3,n.internels[o][i]),P=n.rateBytesCalculator(e,"totalSamplesReceived","timestamp",1,1e3,n.internels[o][i]),M=n.rateBytesCalculator(e,"removedSamplesForAcceleration","timestamp",1,1e3,n.internels[o][i]);r.bytesReceived=p,r.bytesReceivedSecond=N,r.framesDecoded=v,r.framesDecodedSecond=D,r.packetsReceived=g,r.keyFramesDecoded=y,r.nackCount=b,r.pliCount=S,r.framesPerSecond=w,r.framesDropped=k,r.ssrc=C,r.jitter=E,r.insertedSamplesForDeceleration=_,r.insertedSamplesForDecelerationSecond=L,r.totalSamplesReceived=T,r.totalSamplesReceivedSecond=P,r.removedSamplesForAcceleration=O,r.removedSamplesForAccelerationSecond=M,r.timestamp=x,r.status="active",e.audioLevel&&(r.audioLevel=n.calcAudioLevel(e.audioLevel))}"codec"===t&&a&&(r.mimeType=a)})),r}},{key:"rateBytesCalculator",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5?arguments[5]:void 0,a=o||this.internels,s=Number(a[t])||0,c=Number(e[t])||0,u=Number(a[n]),l=Number(e[n]);if([u,l,s,c].some((function(e){return"number"!=typeof e})))return 0;if(l===u)return 0;var h=r*(c-s),d=(l-u)/i;return Math.max(Math.floor(h/d),0)}},{key:"onTrack",value:function(e){this.client.emmit("track",e)}}]),t}(),kp=function(){function t(e){n(this,t),this.logger=e,this.loginInfo=nf.LOGIN_INFO}return i(t,[{key:"getLoginInfo",value:function(){return this.loginInfo||{}}},{key:"setLoginInfo",value:function(e){this.logger.log("[iauth] set login info:",e),this.loginInfo=e}},{key:"loginExternalAccount",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d,f;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[iauth] loginExternalAccount:",t),r=t.displayName,i=t.extId,o=t.extUserId,a=/^[0-9a-zA-Z_-]{1,50}$/,r||i){e.next=5;break}return e.abrupt("return",Xl("XYSDK:950101",t));case 5:if(!o){e.next=10;break}if(a.test(o)){e.next=10;break}return s="extUserId can only contain numbers, letters, _ and -, and the length cannot be greater than 50",this.logger.log("loginExternalAccount params error:",s),e.abrupt("return",Xl("XYSDK:950101",t,s));case 10:return e.prev=10,e.next=13,Cf.getSdkUserInfo(t);case 13:if(c=e.sent,u=c.status,l=c.data,{userName:"",password:""},200!==u){e.next=25;break}return d=l.userName,f=l.password,h={userName:d,password:f},e.next=22,this.login(h,t);case 22:return e.abrupt("return",e.sent);case 25:return e.abrupt("return",Xl("XYSDK:950103",{status:u,data:l}));case 26:e.next=31;break;case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",Xl("XYSDK:950103",e.t0));case 31:case"end":return e.stop()}}),n,this,[[10,28]])})))}},{key:"login",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(i=n||{}).extId,a=i.extUserId,s=t.userName,c=t.password,this.logger.log("[iauth] login:",Object.assign(Object.assign({},t),n)),e.prev=3,this.logger.log("[iauth] encryptLogin"),e.next=7,Cf.encryptLogin({userName:s,password:c,extId:o});case 7:if(e.t0=e.sent,e.t0){e.next=10;break}e.t0={};case 10:if(404!==(null==(u=e.t0)?void 0:u.status)&&10002e3!==(null==u?void 0:u.errorCode)){e.next=16;break}return this.logger.log("[iauth] unEncrypted login"),e.next=15,Cf.login({userName:s,password:c,extId:o});case 15:u=e.sent;case 16:if(200!==(null==u?void 0:u.status)){e.next=23;break}return l=u.data,h=l.securityKey,d=l.callUri,f=l.token,p=f.access_token,v=f.refresh_token,g=l.userProfile,m=g.displayName,y=g.id,this.loginInfo={securityKey:h,callUri:d,refresh_token:v,access_token:p,id:y,displayName:m,extUserId:a},this.logger.log("[iauth] login data:",this.loginInfo),e.abrupt("return",Xl("XYSDK:950120",{access_token:p}));case 23:return this.logger.error("[iauth]login error: ",u),b=(u||{}).data,S=Gl[b.errorCode]||Gl[0],e.abrupt("return",Xl(S,b));case 27:e.next=33;break;case 29:return e.prev=29,e.t1=e.catch(3),this.logger.error("[iauth]catch login error:: ",e.t1),e.abrupt("return",Xl("XYSDK:950102",e.t1));case 33:case"end":return e.stop()}}),r,this,[[3,29]])})))}}]),t}();const Cp="function"==typeof atob,Ep="function"==typeof btoa,xp="function"==typeof Buffer,Ip="function"==typeof TextDecoder?new TextDecoder:void 0,_p="function"==typeof TextEncoder?new TextEncoder:void 0,Ap=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Tp=(e=>{let t={};return Ap.forEach((e,n)=>t[e]=n),t})(),Rp=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Op=String.fromCharCode.bind(String),Dp="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),Np=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Lp=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Pp=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=Ap[t>>18&63]+Ap[t>>12&63]+Ap[t>>6&63]+Ap[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},Mp=Ep?e=>btoa(e):xp?e=>Buffer.from(e,"binary").toString("base64"):Pp,Bp=xp?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Op.apply(null,e.subarray(n,n+4096)));return Mp(t.join(""))},Gp=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Op(192|t>>>6)+Op(128|63&t):Op(224|t>>>12&15)+Op(128|t>>>6&63)+Op(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Op(240|t>>>18&7)+Op(128|t>>>12&63)+Op(128|t>>>6&63)+Op(128|63&t)},jp=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Hp=e=>e.replace(jp,Gp),Up=xp?e=>Buffer.from(e,"utf8").toString("base64"):_p?e=>Bp(_p.encode(e)):e=>Mp(Hp(e)),Kp=(e,t=!1)=>t?Np(Up(e)):Up(e),Fp=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,zp=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Op(55296+(t>>>10))+Op(56320+(1023&t));case 3:return Op((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Op((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Yp=e=>e.replace(Fp,zp),Vp=e=>{if(e=e.replace(/\s+/g,""),!Rp.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,i="";for(let o=0;o<e.length;)t=Tp[e.charAt(o++)]<<18|Tp[e.charAt(o++)]<<12|(n=Tp[e.charAt(o++)])<<6|(r=Tp[e.charAt(o++)]),i+=64===n?Op(t>>16&255):64===r?Op(t>>16&255,t>>8&255):Op(t>>16&255,t>>8&255,255&t);return i},Xp=Cp?e=>atob(Lp(e)):xp?e=>Buffer.from(e,"base64").toString("binary"):Vp,Wp=xp?e=>Dp(Buffer.from(e,"base64")):e=>Dp(Xp(e),e=>e.charCodeAt(0)),qp=xp?e=>Buffer.from(e,"base64").toString("utf8"):Ip?e=>Ip.decode(Wp(e)):e=>Yp(Xp(e)),Zp=e=>Lp(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Jp=e=>qp(Zp(e)),$p=Kp,Qp=Jp;var ev=co.every,tv=to("every");qt({target:"Array",proto:!0,forced:!tv},{every:function(e){return ev(this,e,arguments.length>1?arguments[1]:void 0)}});var nv={DEVICES:{audioInputList:[],audioOutputList:[],videoInList:[]},currentSelectedDevice:{deviceId:"",groupId:"",label:""}},rv=function(t){o(a,Hf);var r=l(a);function a(e){var t;return n(this,a),(t=r.call(this)).logger=e||new Ef,t.navigator=navigator||window.navigator,t.currentDeviceList=nv.DEVICES,t.nextDeviceList=nv.DEVICES,t.currentUsedDevice={videoInput:nv.currentSelectedDevice,audioInput:nv.currentSelectedDevice,audioOutput:nv.currentSelectedDevice},t.currentPermission={microphone:"",camera:""},t.handlePermissionCameraStateChanged=t.handlePermissionCameraStateChanged.bind(c(t)),t.handlePermissionPhoneStateChanged=t.handlePermissionPhoneStateChanged.bind(c(t)),t.mediaDevicesChange=t.mediaDevicesChange.bind(c(t)),t.initDeviceEvent(),t}return i(a,[{key:"getDevicePermission",value:function(){return this.currentPermission}},{key:"getNextDeviceList",value:function(){return this.nextDeviceList}},{key:"setCurrentUsedDevice",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.emmit("currentDevice",t),this.logger.log("[DM]current used device in first calling: ",t),this.currentUsedDevice=Sp(t),e.next=5,this.getPrivateDevices();case 5:r=e.sent,this.currentDeviceList=Sp(r),this.mediaDevicesChange();case 8:case"end":return e.stop()}}),n,this)})))}},{key:"setCurrentUsedDeviceByType",value:function(e,t){if("audio"===e){var n=this.currentDeviceList.audioInputList.find((function(e){return e.deviceId===t}));n&&(this.currentUsedDevice.audioInput=n)}else if("video"===e){var r=this.currentDeviceList.videoInList.find((function(e){return e.deviceId===t}));r&&(this.currentUsedDevice.videoInput=r)}}},{key:"setAudioOutputDevice",value:function(e,t){var n=this;e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){n.logger.log("[DM]switch audio output device successfully: ".concat(t))})).catch((function(e){var t=e;"SecurityError"===e.name&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),n.logger.error(t)})):this.logger.warn("[DM]Browser does not support output device selection.")}},{key:"emmitDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.init();case 2:return e.next=4,this.emmitPermission();case 4:return e.next=6,this.mediaDevicesChange();case 6:case"end":return e.stop()}}),t,this)})))}},{key:"init",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:return n=e.sent,e.prev=3,e.next=6,this.getPermission();case 6:this.currentPermission=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),this.currentPermission={microphone:"unknown",camera:"unknown"};case 12:this.currentDeviceList=this.nextDeviceList=n,this.logger.log("[DM]current device list: ",this.currentDeviceList),this.logger.log("[DM]current permission: ",this.currentPermission);case 15:case"end":return e.stop()}}),t,this,[[3,9]])})))}},{key:"destroy",value:function(){var e;this.removeDeviceEvent(),this.permissionCameraStatus&&this.permissionCameraStatus.removeEventListener("change",this.handlePermissionCameraStateChanged),this.permissionPhoneStatus&&this.permissionPhoneStatus.removeEventListener("change",this.handlePermissionPhoneStateChanged),null===(e=this.logger)||void 0===e||e.stopDB()}},{key:"getPrivateDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={audioInputList:[],audioOutputList:[],videoInList:[]},e.prev=1,e.next=4,this.getDevices();case 4:n=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.logger.log("[DM]get device failed: ",e.t0);case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),t,this,[[1,7]])})))}},{key:"getDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.navigator.mediaDevices.enumerateDevices();case 3:return n=e.sent,r=[],i=[],o=[],n.forEach((function(e){var t=h(e.kind.match(/(\w+)(input|output)/i),3),n=t[0],a=t[1],s=t[2];if(!e.label.match(/\(Virtual\)$/)&&e.deviceId){var c={deviceId:e.deviceId,kind:n,type:a,direction:s,label:e.label,groupId:e.groupId};"audioinput"===e.kind?r.push(c):"audiooutput"===e.kind?i.push(c):"videoinput"===e.kind&&o.push(c)}})),a={audioInputList:r,audioOutputList:i,videoInList:o},e.abrupt("return",a);case 12:return e.prev=12,e.t0=e.catch(0),e.abrupt("return",Promise.reject(Xl("XYSDK:950409",e.t0)));case 15:case"end":return e.stop()}}),t,this,[[0,12]])})))}},{key:"setPermission",value:function(e){this.currentPermission=e,this.emmit("permission",this.currentPermission)}},{key:"emmitPermission",value:function(){this.currentPermission.camera&&this.emmit("permission",this.currentPermission)}},{key:"query",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.navigator.permissions.query({name:t});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(Xl("XYSDK:950408",e.t0)));case 10:case"end":return e.stop()}}),n,this,[[0,7]])})))}},{key:"handlePermissionCameraStateChanged",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[DM]camera permission changed: ",t),r=t.target.state,i=this.currentPermission.camera,"granted"!==r||"granted"===i){e.next=10;break}return e.next=6,this.getPrivateDevices();case 6:o=e.sent,a={detail:o,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device when camera permission changed: ",a),this.emmit("device",a);case 10:"change"===t.type&&(this.currentPermission.camera=r),this.emmit("permission",this.currentPermission);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"handlePermissionPhoneStateChanged",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[DM]microphone permission changed: ",t),r=t.target.state,i=this.currentPermission.microphone,"granted"!==r||"granted"===i){e.next=10;break}return e.next=6,this.getPrivateDevices();case 6:o=e.sent,a={detail:o,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device when microphone permission changed: ",a),this.emmit("device",a);case 10:"change"===t.type&&(this.currentPermission.microphone=r),this.emmit("permission",this.currentPermission);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"getPermission",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.query("camera");case 3:return n=e.sent,e.next=6,this.query("microphone");case 6:return r=e.sent,i={camera:n.state,microphone:r.state},this.permissionCameraStatus||(this.permissionCameraStatus=n,this.permissionCameraStatus.addEventListener("change",this.handlePermissionCameraStateChanged)),this.permissionPhoneStatus||(this.permissionPhoneStatus=r,this.permissionPhoneStatus.addEventListener("change",this.handlePermissionPhoneStateChanged)),e.abrupt("return",i);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),t,this,[[0,13]])})))}},{key:"diffAudioDevice",value:function(e,t){var n;if(e.length===t.length){var r=e[0]&&e[0].deviceId||"default",i=t[0]&&t[0].deviceId||"default",o=e[0]&&e[0].label||"",a=t[0]&&t[0].label||"";r===i&&o===a||(n=t[0])}else n=t.filter((function(t){return e.every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(n=t[0]);return n}},{key:"diffVideoDevice",value:function(e,t){var n;return n=t.filter((function(t){return e.every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(n=t[0]),n}},{key:"diffDevices",value:function(e,t){var n=e.audioInputList,r=e.audioOutputList,i=e.videoInList,o=t.audioInputList,a=t.audioOutputList,s=t.videoInList,c=this.diffAudioDevice(n,o),u=this.diffAudioDevice(r,a);return{audioInput:c,videoInput:this.diffVideoDevice(i,s),audioOutput:u}}},{key:"mediaDevicesChange",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:n=e.sent,r=this.currentUsedDevice.videoInput,this.nextDeviceList=Sp(n),this.logger.log("[DM]nextDeviceList when mediaDevicesChange:",this.nextDeviceList),this.logger.log("[DM]currentDeviceList when mediaDevicesChange:",this.currentDeviceList),i=this.diffDevices(this.currentDeviceList,this.nextDeviceList),o=i.videoInput,a=i.audioInput,o&&o.deviceId!==(null==r?void 0:r.deviceId)?this.currentUsedDevice.videoInput=o:i.videoInput=void 0,this.currentUsedDevice.audioInput=a,this.currentDeviceList=Sp(n),s={detail:n,nextDevice:i},this.logger.log("[DM]next used device when mediaDevicesChange: ",s),this.emmit("device",s);case 15:case"end":return e.stop()}}),t,this)})))}},{key:"initDeviceEvent",value:function(){var e;null===(e=this.navigator.mediaDevices)||void 0===e||e.addEventListener("devicechange",this.mediaDevicesChange)}},{key:"removeDeviceEvent",value:function(){var e;null===(e=this.navigator.mediaDevices)||void 0===e||e.removeEventListener("devicechange",this.mediaDevicesChange)}}]),a}(),iv=Mt.f,ov="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],av={f:function(e){return ov&&"Window"==j(e)?function(e){try{return iv(e)}catch(e){return Ca(ov)}}(e):iv(Y(e))}},sv=C((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),cv=Object.isExtensible,uv=C((function(){cv(1)}))||sv?function(e){return!!X(e)&&((!sv||"ArrayBuffer"!=j(e))&&(!cv||cv(e)))}:cv,lv=!C((function(){return Object.isExtensible(Object.preventExtensions({}))})),hv=y((function(e){var t=Xe.f,n=!1,r=Ee("meta"),i=0,o=function(e){t(e,r,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},n=!0;var e=Mt.f,t=M([].splice),i={};i[r]=1,e(i).length&&(Mt.f=function(n){for(var i=e(n),o=0,a=i.length;o<a;o++)if(i[o]===r){t(i,o,1);break}return i},qt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:av.f}))},fastKey:function(e,t){if(!X(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Se(e,r)){if(!uv(e))return"F";if(!t)return"E";o(e)}return e[r].objectID},getWeakData:function(e,t){if(!Se(e,r)){if(!uv(e))return!0;if(!t)return!1;o(e)}return e[r].weakData},onFreeze:function(e){return lv&&n&&uv(e)&&!Se(e,r)&&o(e),e}};ct[r]=!0}));hv.enable,hv.fastKey,hv.getWeakData,hv.onFreeze;var dv=function(e,t,n){for(var r in t)yt(e,r,t[r],n);return e},fv=Xe.f,pv=hv.fastKey,vv=gt.set,gv=gt.getterFor,mv={getConstructor:function(e,t,n,r){var i=e((function(e,i){Vn(e,o),vv(e,{type:t,index:Ao(null),first:void 0,last:void 0,size:0}),E||(e.size=0),null!=i&&Gi(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,a=gv(t),s=function(e,t,n){var r,i,o=a(e),s=c(e,t);return s?s.value=n:(o.last=s={index:i=pv(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),E?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var n,r=a(e),i=pv(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return dv(o,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,E?e.size=0:this.size=0},delete:function(e){var t=a(this),n=c(this,e);if(n){var r=n.next,i=n.previous;delete t.index[n.index],n.removed=!0,i&&(i.next=r),r&&(r.previous=i),t.first==n&&(t.first=r),t.last==n&&(t.last=i),E?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=a(this),r=nr(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),dv(o,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),E&&fv(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=gv(t),o=gv(r);is(e,t,(function(e,t){vv(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),zn(t)}};!function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",a=k[e],s=a&&a.prototype,c=a,u={},l=function(e){var t=M(s[e]);yt(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!X(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!X(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!X(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(Xt(e,!V(a)||!(i||s.forEach&&!C((function(){(new a).entries().next()})))))c=n.getConstructor(t,e,r,o),hv.enable();else if(Xt(e,!0)){var h=new c,d=h[o](i?{}:-0,1)!=h,f=C((function(){h.has(1)})),p=Fi((function(e){new a(e)})),v=!i&&C((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Vn(e,s);var n=nh(new a,e,c);return null!=t&&Gi(t,n[o],{that:n,AS_ENTRIES:r}),n}))).prototype=s,s.constructor=c),(f||v)&&(l("delete"),l("has"),r&&l("get")),(v||d)&&l(o),i&&s.clear&&delete s.clear}u[e]=c,qt({global:!0,constructor:!0,forced:c!=a},u),Kn(c,e),i||n.setStrong(c,e,r)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),mv);var yv=TypeError,bv=function(e,t){if(!delete e[t])throw yv("Cannot delete property "+ce(t)+" of "+ce(e))},Sv=xn("splice"),wv=Math.max,kv=Math.min;qt({target:"Array",proto:!0,forced:!Sv},{splice:function(e,t){var n,r,i,o,a,s,c=ye(this),u=At(c),l=xt(e,u),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=u-l):(n=h-2,r=kv(wv(kt(t),0),u-l)),rn(u+n-r),i=Cn(c,r),o=0;o<r;o++)(a=l+o)in c&&on(i,o,c[a]);if(i.length=r,n<r){for(o=l;o<u-r;o++)s=o+n,(a=o+r)in c?c[s]=c[a]:bv(c,s);for(o=u;o>u-r+n;o--)bv(c,o-1)}else if(n>r)for(o=u-r;o>l;o--)s=o+n-1,(a=o+r-1)in c?c[s]=c[a]:bv(c,s);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return c.length=u-r+n,i}});var Cv=function(){function t(e,r){n(this,t),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state="",this.cb=function(){},e&&(this.logger=e),this.isContent=!!r,this.streamTimmerCountDown=500,this.loadStatus="LOAD_START",this.streamStatus="ENABLED",this.streamStatusTimmer=null,this.onCanPlay=this.onCanPlay.bind(this),this.onLoadStart=this.onLoadStart.bind(this),this.onError=this.onError.bind(this),this.onUnmute=this.onUnmute.bind(this),this.onMute=this.onMute.bind(this),this.onEnded=this.onEnded.bind(this),this.onAbort=this.onAbort.bind(this),this.onEmptied=this.onEmptied.bind(this),this.onVideoEnded=this.onVideoEnded.bind(this),this.onLoadeddata=this.onLoadeddata.bind(this),this.onStalled=this.onStalled.bind(this),this.onSuspend=this.onSuspend.bind(this),this.onWaiting=this.onWaiting.bind(this)}return i(t,[{key:"initVideoStreamById",value:function(e,t){var n=(null==t?void 0:t.id)||"";this.key=e,n!==this.streamId&&(this.stream&&this.removeStreamTrackEventListener(),t&&this.initStreamTrackEventListener(t),this.stream=t),this.setSrcObject(n),this.streamId=n}},{key:"getVideoTracks",value:function(){return this.stream?this.stream.getVideoTracks():[]}},{key:"updateLocalTrack",value:function(){this.removeStreamTrackEventListener(),this.initStreamTrackEventListener(this.stream),this.sendVideoStatus()}},{key:"initVideoSource",value:function(e){var t=document.getElementById(e);if(t){var n=t.querySelector("video");if(n)n.autoplay=!0,n.playsInline=!0,n.controls=!1,n.defaultMuted=!0,n.muted=!0;else{var r=document.createElement("video");r.autoplay=!0,r.playsInline=!0,r.controls=!1,r.defaultMuted=!0,r.muted=!0,t.appendChild(r),n=r}this.wrapEleId!==e||n!==this.videoEle?(this.videoEle&&this.videoEle!==n&&this.removeEventListener(this.videoEle),this.wrapEleId=e,this.videoEle=n,this.initEventListener(this.videoEle),this.logger.log("[VM]init video source: ",{key:this.key,wrapEleId:this.wrapEleId}),this.setSrcObject()):this.logger.log("[vm]update video ele",e)}else{var i="Not found wrap video element use id ".concat(this.wrapEleId," selector");this.logger.log(i)}}},{key:"setSrcObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stream){e.next=3;break}return this.logger.warn("[VM]setSrcObject: stream not exist",{streamId:t}),e.abrupt("return");case 3:if(!this.videoEle||this.isHaveSrcObject()&&this.streamId===t){e.next=15;break}if(this.videoEle.srcObject=this.stream,!this.videoEle.paused){e.next=14;break}return e.prev=6,e.next=9,this.videoEle.play();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),"NotAllowedError"===(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(this.emmit(this.key,{status:"VIDEO_PLAY_FAILED",id:this.key,error:e.t0}),this.logger.warn("[VM] video play error: ",e.t0));case 14:this.logger.log("[VM]set video srcObject: ",{key:this.key,streamId:this.streamId});case 15:case"end":return e.stop()}}),n,this,[[6,11]])})))}},{key:"initEventListener",value:function(e){e.addEventListener("canplay",this.onCanPlay),e.addEventListener("loadstart",this.onLoadStart),e.addEventListener("error",this.onError),e.addEventListener("waiting",this.onWaiting),e.addEventListener("suspend",this.onSuspend),e.addEventListener("stalled",this.onStalled),e.addEventListener("loadeddata",this.onLoadeddata),e.addEventListener("ended",this.onVideoEnded),e.addEventListener("emptied",this.onEmptied),e.addEventListener("abort",this.onAbort)}},{key:"removeEventListener",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoEle;null==e||e.removeEventListener("canplay",this.onCanPlay),null==e||e.removeEventListener("loadstart",this.onLoadStart),null==e||e.removeEventListener("error",this.onError),null==e||e.removeEventListener("waiting",this.onWaiting),null==e||e.removeEventListener("suspend",this.onSuspend),null==e||e.removeEventListener("stalled",this.onStalled),null==e||e.removeEventListener("loadeddata",this.onLoadeddata),null==e||e.removeEventListener("ended",this.onVideoEnded),null==e||e.removeEventListener("emptied",this.onEmptied),null==e||e.removeEventListener("abort",this.onAbort)}},{key:"initStreamTrackEventListener",value:function(e){var t,n,r;null===(t=null==e?void 0:e.getVideoTracks()[0])||void 0===t||t.addEventListener("mute",this.onMute),null===(n=null==e?void 0:e.getVideoTracks()[0])||void 0===n||n.addEventListener("unmute",this.onUnmute),null===(r=null==e?void 0:e.getVideoTracks()[0])||void 0===r||r.addEventListener("ended",this.onEnded)}},{key:"removeStreamTrackEventListener",value:function(){var e,t,n,r,i,o;this.streamStatus="ENABLED",null===(t=null===(e=this.stream)||void 0===e?void 0:e.getVideoTracks()[0])||void 0===t||t.removeEventListener("mute",this.onMute),null===(r=null===(n=this.stream)||void 0===n?void 0:n.getVideoTracks()[0])||void 0===r||r.removeEventListener("unmute",this.onUnmute),null===(o=null===(i=this.stream)||void 0===i?void 0:i.getVideoTracks()[0])||void 0===o||o.removeEventListener("ended",this.onEnded)}},{key:"isHaveSrcObject",value:function(){return this.videoEle&&this.videoEle.srcObject}},{key:"setSource",value:function(e,t){this.logger.log("[vm]set source",{key:e,thisKey:this.key,wrapId:t,thisWrapId:this.wrapEleId}),this.key=e,this.initVideoSource(t)}},{key:"destroy",value:function(){this.clearTrackStatusTimmer(),this.removeEventListener(this.videoEle),this.stream&&this.removeStreamTrackEventListener(),this.videoEle&&(this.videoEle.srcObject=null),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state=""}},{key:"setVideoStatusChange",value:function(e){this.cb=e}},{key:"onEnded",value:function(){this.streamStatus="ENDED",this.sendVideoStatus()}},{key:"onMute",value:function(){var e=this;this.streamStatus="MUTE",this.clearTrackStatusTimmer(),this.streamStatusTimmer=setTimeout((function(){"MUTE"===e.streamStatus&&e.sendVideoStatus()}),this.streamTimmerCountDown)}},{key:"onUnmute",value:function(){this.clearTrackStatusTimmer(),this.streamStatus="ENABLED",this.sendVideoStatus()}},{key:"onSuspend",value:function(){this.logger.log("video suspend",this.key)}},{key:"onWaiting",value:function(){this.logger.log("video waiting",this.key)}},{key:"onStalled",value:function(){this.logger.log("video stalled",this.key)}},{key:"onLoadeddata",value:function(){this.logger.log("video loadeddata",this.key)}},{key:"onVideoEnded",value:function(){this.logger.log("video videoEnded",this.key)}},{key:"onEmptied",value:function(){this.logger.log("video emptied",this.key)}},{key:"onAbort",value:function(){this.logger.log("video abort",this.key)}},{key:"onCanPlay",value:function(){this.logger.log("video canplay",this.key),this.loadStatus="CANPLAY",this.sendVideoStatus()}},{key:"onLoadStart",value:function(){this.logger.log("video loadstart",this.key),this.loadStatus="LOAD_START",this.sendVideoStatus()}},{key:"onError",value:function(){this.logger.log("video error",this.key),this.loadStatus="ERROR"}},{key:"clearTrackStatusTimmer",value:function(){this.streamStatusTimmer&&(clearTimeout(this.streamStatusTimmer),this.streamStatusTimmer=null)}},{key:"sendVideoStatus",value:function(){"CANPLAY"===this.loadStatus&&"ENABLED"===this.streamStatus?("CANPLAY"!==this.state&&(this.streamTimmerCountDown=1e4),this.state="CANPLAY",this.emmit(this.key,{status:"CANPLAY",id:this.key})):"ENDED"===this.streamStatus?(this.state="ENDED",this.emmit(this.key,{status:"ENDED",id:this.key})):"LOAD_START"!==this.loadStatus&&"MUTE"!==this.streamStatus||this.isContent&&"CANPLAY"===this.loadStatus||(this.state="REQUEST",this.emmit(this.key,{status:"REQUEST",id:this.key}))}},{key:"emmit",value:function(e,t){this.cb&&this.cb(e,t)}}]),t}(),Ev=ha.trim,xv=M("".charAt),Iv=k.parseFloat,_v=k.Symbol,Av=_v&&_v.iterator,Tv=1/Iv(oa+"-0")!=-1/0||Av&&!C((function(){Iv(Object(Av))}))?function(e){var t=Ev(po(e)),n=Iv(t);return 0===n&&"-"==xv(t,0)?-0:n}:Iv;qt({global:!0,forced:parseFloat!=Tv},{parseFloat:Tv});var Rv=function(e,t,n){var r=e.roster,i=r.videoRxMute,o=r.videoTxMute,a=r.deviceType,s=r.isContent,c=r.isLocal;return s?o?"AUDIO_CONTENT":t&&"REQUEST"!==n&&n?"NORMAL":"REQUEST":i&&o?"AUDIO_ONLY":o||"ENDED"===n?"MUTE":"tel"===a||"pstngw"===a?"AUDIO_TEL":t&&"REQUEST"!==n||c?"NORMAL":"REQUEST"},Ov=function(e,t,n,r,i){var o,a,s=parseFloat((e/t).toFixed(3)),c=nf.RATIO_MAP[i];return s<nf.HOR_CONTAINER_RATIO?(o=n,a=parseFloat((n*s).toFixed(3))):(o=parseFloat((r/s).toFixed(3)),a=r),{realWidth:a,realHeight:o,realRotate:c}},Dv=function(e,t,n){var r=e.width,i=void 0===r?16:r,o=e.height,a=void 0===o?9:o,s=e.rotation,c={};if(s>=0&&s<=3){var u=1===s||3===s,l=Ov(u?a:i,u?i:a,n,t,s),h=l.realWidth,d=l.realHeight,f=l.realRotate;c={transform:"rotateZ(".concat(f,"deg)"),width:"".concat(u?d:h,"px"),height:"".concat(u?h:d,"px")}}return c},Nv=function(){return new Promise((function(e,t){var n,r,i=["video/VP8","video/H264"],o=["audio/opus"];Na.isFirefox()&&e({video:i,audio:o});try{o=(null===(n=RTCRtpSender.getCapabilities("audio"))||void 0===n?void 0:n.codecs.filter((function(e){return"audio/opus"===e.mimeType})).map((function(e){return e.mimeType})))||[],e({video:i=(i=(null===(r=RTCRtpSender.getCapabilities("video"))||void 0===r?void 0:r.codecs.filter((function(e){return"video/H264"===e.mimeType||"video/VP8"===e.mimeType})).map((function(e){return e.mimeType})))||[]).filter((function(e,t){return i.indexOf(e)===t})),audio:o})}catch(e){t(e)}}))},Lv=[-30,-30,1,1],Pv={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1}],"3-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1}],"4-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1},{position:[.75,.666,.25,.333],resolution:1}],"5-1":[{position:[.125,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1}],"6-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1}],"7-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1}],"8-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1},{position:[.75,0,.25,.25],resolution:1}]},Mv={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}],"3-1":[{position:[.25,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2}],"4-1":[{position:[0,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,0,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2}],"5-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1}],"6-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.666,.5,.333,.5],resolution:1}],"7-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1}],"8-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1}],"9-1":[{position:[0,0,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1},{position:[.666,.666,.333,.333],resolution:1}]},Bv={SPEAKER:{length:8,temp:{0:Pv["1-1"],1:Pv["1-1"],2:Pv["2-1"],3:Pv["3-1"],4:Pv["4-1"],5:Pv["5-1"],6:Pv["6-1"],7:Pv["7-1"],8:Pv["8-1"]},rate:{0:.5625,1:.5625,2:.4218,3:.4218,4:.4218,5:.5625,6:.5625,7:.5625,8:.5625}},GALLERY:{length:9,temp:{0:Mv["1-1"],1:Mv["1-1"],2:Mv["2-1"],3:Mv["3-1"],4:Mv["4-1"],5:Mv["5-1"],6:Mv["6-1"],7:Mv["7-1"],8:Mv["8-1"],9:Mv["9-1"]},rate:{0:.5625,1:.5625,2:.2812,3:.5625,4:.5625,5:.375,6:.375,7:.5625,8:.5625,9:.5625}}},Gv=Sp(Bv.SPEAKER);Object.keys(Gv.temp).forEach((function(e){Gv.temp[e][0].resolution=4,Gv.temp[e][0].isContent=!0}));var jv=Sp(Bv.SPEAKER);Object.keys(jv.temp).forEach((function(e){var t=Number(e);t>0&&(t<=2&&(jv.temp[e][t-1].resolution=3,jv.temp[e][t-1].isContent=!0),t>2&&(jv.temp[e][2].resolution=3,jv.temp[e][2].isContent=!0))}));var Hv={MULTI_PIC_CONTENT_HIGH_PRIORITY:Gv,MULTI_PIC_ACTIVE_HIGH_PRIORITY:jv,TWO_PIC_PIP:{length:2,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}],2:[{position:[0,0,1,1],resolution:4,zIndex:1,isContent:!0},{position:[.75,.75,.25,.25],resolution:1,zIndex:2}]},rate:{1:.5625,2:.5625}},CONTENT_ONLY:{length:1,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}]},rate:{1:.5625}},TWO_PIC_SYMMETRIC:{length:2,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}],2:[{position:[0,0,.5,1],resolution:4,isContent:!0},{position:[.5,0,.5,1],resolution:3}]},rate:{1:.5625,2:.2812}}},Uv=Object.assign(Object.assign({},Bv),Hv),Kv=function(){function t(e){var r;n(this,t),this.client=e,this.logger=e.logger,this.customLayoutList=new Map,this.layoutList=new Map,this.videoManagers={},this.originOrderRosters=[],this.orderRosterList=[],this.selfRoster=Object.assign(Object.assign({},nf.ROSTER),{isLocal:!0}),this.newLayoutList=[],this.initLayout=[],this.templateMode=(null===(r=e.config)||void 0===r?void 0:r.templateMode)||"SPEAKER",this.templateRate={previous:.5625,next:0},this.content={previous:null,next:null},this.screenInfo={width:0,height:0,rateHeight:0,rateWidth:0},this.internelsLayout={},this.forceFullScreenId="",this.localContent=null,this.preConfInfo=null,this.confInfo=Sp(nf.CONF_INFO),this.pageInfo={pageSize:9,currentPage:0,totalPage:0},this.isLocalShareContent=!1,this.calculateScreenInfo(),this.onVideoStatusChange=this.onVideoStatusChange.bind(this)}return i(t,[{key:"getNewLayout",value:function(){return this.newLayoutList}},{key:"getOrderRosterList",value:function(){return this.orderRosterList}},{key:"getOriginOrderRosters",value:function(){return this.originOrderRosters}},{key:"getLayoutList",value:function(){return this.layoutList}},{key:"getCustomLayoutList",value:function(){return this.customLayoutList}},{key:"getTemplateRate",value:function(){return this.templateRate}},{key:"getContentRosterItem",value:function(){return this.content.next}},{key:"getSelfRoster",value:function(){return this.selfRoster}},{key:"getScreenInfo",value:function(){return this.screenInfo}},{key:"getVideoManagers",value:function(){return this.videoManagers}},{key:"getForceFullScreenId",value:function(){return this.forceFullScreenId}},{key:"getTemplateMode",value:function(){return this.templateMode}},{key:"getConfInfo",value:function(){return this.confInfo}},{key:"getInternelsLayout",value:function(){return this.internelsLayout}},{key:"getLocalShareState",value:function(){return this.isLocalShareContent}},{key:"setOrderRosterList",value:function(e){this.orderRosterList=e}},{key:"setOriginOrderRosters",value:function(e){this.originOrderRosters=e}},{key:"setForceFullScreenId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.forceFullScreenId=e,this.client.emmit("force-full-screen",this.forceFullScreenId)}},{key:"setTemplateMode",value:function(e){this.templateMode=e}},{key:"setContentRosterItem",value:function(e){this.content={previous:e,next:e}}},{key:"setConfInfo",value:function(e){e.contentUri||(this.content.next=null),this.confInfo=e}},{key:"setLocalShareContent",value:function(e){this.isLocalShareContent=e,this.pageInfo.currentPage=0,this.templateMode=e?"GALLERY":"SPEAKER",this.client.emmit("page-info",this.pageInfo),this.confInfo.contentUri="",this.calcRequestNewLayout()}},{key:"calcTemplate",value:function(){var e,t=[],n=this.pageInfo,r=n.currentPage,i=n.pageSize;switch(this.templateMode){case"MULTI_PIC_ACTIVE_HIGH_PRIORITY":this.orderRosterList[0]=this.orderRosterList.splice(2,1,this.orderRosterList[0])[0],this.orderRosterList=this.orderRosterList.filter(Boolean);break;case"TWO_PIC_PIP":case"TWO_PIC_SYMMETRIC":this.orderRosterList.length>2&&(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal})));break;case"CONTENT_ONLY":this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal}))}var o=this.orderRosterList.length;r>1&&(o=i);var a=Uv[this.templateMode]||Uv.SPEAKER,s=a.temp,c=a.rate,u=a.length;if((t=s[o]||s[u],e=c[o]||c[u],1===this.pageInfo.currentPage&&9===o)&&this.orderRosterList.find((function(e){return e.isLocal}))){var l=[(t=Sp(t))[6],t[1]];t[1]=l[0],t[6]=l[1]}return{tempLayout:t,templateRate:e}}},{key:"initLayoutManager",value:function(){var e=this.templateRate.next,t=this.calcTemplate(),n=t.tempLayout,r=t.templateRate;e!==r&&(this.templateRate={next:r,previous:r},this.calculateScreenInfo()),this.initLayout=Sp(n),this.newLayoutList=this.calculateNewLayoutList()}},{key:"onVideoStatusChange",value:function(e,t){this.logger.log("[LM]on video status change: ",{key:e,data:t});var n,r="AUTO"===this.client.config.layout,i=r?this.layoutList:this.customLayoutList,o=t.status,a=i.has(e),s=!1;if("VIDEO_PLAY_FAILED"===o&&this.client.emmit("play-failed",{type:"video",key:e,error:t.error}),a){var c=i.get(e),u=c.state,l=c.roster.isLocal;"NORMAL"!==u&&"REQUEST"!==u||"ENDED"!==o?"NORMAL"!==u||"REQUEST"!==o||l?("REQUEST"!==u&&"INVALID"!==u||"CANPLAY"!==o)&&("MUTE"!==u||"CANPLAY"!==o||l)||(n="NORMAL",s=!0):(n="REQUEST",s=!0):(n="INVALID",s=!0),s&&(i.set(e,Object.assign(Object.assign({},c),{state:n})),r?(this.layoutList=i,this.client.sendLayoutMessage()):(this.customLayoutList=i,this.client.sendCustomLayoutMessage()))}}},{key:"setVideoRenderer",value:function(e,t){if(this.logger.log("[lm]set video renderer:",{key:e,wrapEleId:t}),!this.videoManagers[e]){this.logger.log("[lm]Not Match VM: ",e);var n="1"===e.charAt(e.length-1);this.videoManagers[e]=new Cv(this.logger,n),this.videoManagers[e].setVideoStatusChange(this.onVideoStatusChange)}this.videoManagers[e].setSource(e,t)}},{key:"removeVideoRenderer",value:function(e,t){this.videoManagers[e]&&(this.logger.log("[lm]remove VM: ",e),delete this.videoManagers[e])}},{key:"playVideo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,i=Object.keys(this.videoManagers);case 1:if(!(r<i.length)){e.next=12;break}if(o=i[r],!(t&&t.indexOf(o)>-1)&&t){e.next=9;break}if(!(null==(a=this.videoManagers[o].videoEle)?void 0:a.srcObject)){e.next=9;break}return e.next=8,a.play();case 8:this.logger.log("replay video successfully:",o);case 9:r++,e.next=1;break;case 12:case"end":return e.stop()}}),n,this)})))}},{key:"updateLocalTrack",value:function(){var e=this.selfRoster.id,t=this.videoManagers[e];t&&t.updateLocalTrack()}},{key:"updateStreams",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="AUTO"===this.client.config.layout,r=n?this.layoutList:this.customLayoutList,i=this.client.getLayoutRosters(),o=i.total.length;r.forEach((function(t,n){var a=t.roster,s=a.isLocal,c=a.id,u=a.isContent,l=!1;e.videoManagers[c]||(e.videoManagers[c]=new Cv(e.logger,u),e.videoManagers[c].setVideoStatusChange(e.onVideoStatusChange)),e.videoManagers[c].match=!0;var h=e.videoManagers[c].state;if(s){var d=e.client.getPreviewStreams().previewStreams,f=((void 0===d?[]:d)[0]||{stream:null}).stream;e.videoManagers[c].initVideoStreamById(c,f);var p=Rv(t,f,h),v=r.get(n);v&&r.set(n,Object.assign(Object.assign({},v),{state:p}))}else{for(var g=0;g<o;g++){var m=i.total[g],y=m.participantId,b=m.mediagroupid,S=m.videoTrackId;if(t.roster.participantId+t.roster.mediagroupid===y+b){var w=e.getVideoStreamByTrackId(S).videoStream;l=!0,e.videoManagers[c].initVideoStreamById(c,w);var k=Rv(t,w,h),C=r.get(n);C&&r.set(n,Object.assign(Object.assign({},C),{state:k}));break}}if(!l){e.videoManagers[c].initVideoStreamById(c,null);var E=Rv(t,null,h),x=r.get(n);x&&r.set(n,Object.assign(Object.assign({},x),{state:E}))}}})),this.clearInvalidVideoManagers(),this.logger.log("updated new layout list",Vl(r)),n?(this.layoutList=r,t&&this.client.sendLayoutMessage()):(this.customLayoutList=r,t&&this.client.sendCustomLayoutMessage())}},{key:"clearInvalidVideoManagers",value:function(){var e=this;Object.keys(this.videoManagers).forEach((function(t){e.videoManagers[t].match?delete e.videoManagers[t].match:(e.videoManagers[t].destroy(),delete e.videoManagers[t])}))}},{key:"calcPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.confInfo,t=this.preConfInfo||{},n=t.contentUri,r=void 0===n?"":n,i=t.chairManUrl,o=void 0===i?"":i,a=e.participantCount,s=e.contentUri,c=e.chairManUrl,u=this.pageInfo,l=u.pageSize,h=u.currentPage,d=a>112?112:a,f=Math.max(Math.ceil(d/l),0);h=Math.min(h,f),this.pageInfo.totalPage=f,this.pageInfo.currentPage=h;var p=s?of:rf;(p.indexOf(this.templateMode)<0&&"GALLERY"!==this.templateMode||!this.isLocalShareContent&&o!==c)&&(this.pageInfo.currentPage=0,this.templateMode=s?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER"),!r&&s&&(this.pageInfo.currentPage=0,this.templateMode="MULTI_PIC_CONTENT_HIGH_PRIORITY",this.isLocalShareContent&&this.setLocalShareContent(!1)),this.preConfInfo=Sp(this.confInfo),this.logger.log("auto pageInfo:",this.pageInfo),this.client.emmit("page-info",this.pageInfo)}},{key:"setPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.forceFullScreenId&&this.setForceFullScreenId(""),this.pageInfo.currentPage=e;var t=this.confInfo.contentUri;this.templateMode=e>0?"GALLERY":t?this.templateModeTemp:"SPEAKER",this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo)}},{key:"calcForceFullScreenRequestLayout",value:function(){var e=this.pageInfo.pageSize,t=[],n=this.forceFullScreenId===this.selfRoster.id,r=this.layoutList.get(this.forceFullScreenId);if(n)this.createAutoLayout([]);else{var i=(null==r?void 0:r.roster)||{},o=i.endpointId,a=void 0===o?"":o,s=i.mediagroupid,c=s?4:3;t.push({calluri:a,mediagroupid:s,resolution:c,quality:2}),this.client.requestNewLayout(t,e,0)}}},{key:"calcRequestNewLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pageInfo;if(this.logger.log("calc request layout page info:",e),this.forceFullScreenId)this.calcForceFullScreenRequestLayout();else{var t=this.confInfo,n=t.participantCount,r=void 0===n?0:n,i=t.chairManUrl,o=void 0===i?"":i,a=t.contentUri,s=void 0===a?"":a,c=e.pageSize,u=e.currentPage,l=e.totalPage,h=0===u&&s?1:0,d=Math.min(112,r),f=d+h-1,p=u>0?c:c-1,v=this.client.getLocalHide(),g=this.client.getOnHold(),m=[];if(u<=1&&!v&&(p-=1),r<=1&&!s)this.client.requestNewLayout([{mediagroupid:0,calluri:this.selfRoster.endpointId,resolution:3,quality:1}],c,0);else if(g)this.client.requestNewLayout(m,c,0);else{if(o&&(f=s?2:1),this.isLocalShareContent&&(f=Math.min(f,v?4:3)),u===l&&(u>0&&(f=d-(u-1)*c),v&&(f-=1)),(f=Math.min(f,p))>0){var y=Uv[this.templateMode],b=y.temp,S=y.length,w=["TWO_PIC_PIP","TWO_PIC_SYMMETRIC"],k=v||w.includes(this.templateMode)?0:1,C=Math.max(1,S-k),E=b[f]||b[C];E.forEach((function(e,t){var n=e.resolution,r=void 0===n?2:n,i=e.isContent,a=void 0!==i&&i,c="";0===u&&(c=a?s:o),m.push({mediagroupid:a?1:0,calluri:c,resolution:r,quality:4===r?2:1})}))}this.logger.log("request layout:",m),this.client.requestNewLayout(m,c,u,[],{uiShowLocalWhenPageMode:!v})}}}},{key:"createAutoLayout",value:function(e){var t=this;if(this.forceFullScreenId)if(this.forceFullScreenId===this.selfRoster.id)e=[];else{var n=e.find((function(e){return e.calluri+e.mediagroupid===t.forceFullScreenId}));if(!n||1===n.mediagroupid&&!this.confInfo.contentUri)return this.setForceFullScreenId(""),void this.calcRequestNewLayout()}this.createOrderRoster(e),this.createLayout()}},{key:"createOrderRoster",value:function(e){this.orderRosterList=[];var t=e.length,n=this.client.getLocalHide(),r=this.confInfo.chairManUrl;if(0!==t){for(var i=0;i<t;i++){var o,a,s=e[i],c=s.calluri,u=void 0===c?"":c,l=s.mediagroupid,h=s.isAudioMute,d=s.isVideoMute,f=s.remoteName,p=s.remoteType,v=s.MuteReason;a=u+l,o=Object.assign(Object.assign({},s),{id:a,isLocal:!1,isContent:1===l,displayName:f,endpointId:u,audioTxMute:h,videoTxMute:d,videoRxMute:!1,deviceType:p,audioRxMute:!1,videoMuteReason:v,isForceFullScreen:0===l&&u===r,isLastAdd:!1,onHold:!1,isPolling:!1}),1===l?(this.confInfo.contentUri&&(this.content=Object.assign(Object.assign({},this.content),{next:o})),this.orderRosterList.splice(0,0,o)):this.orderRosterList.push(o)}(!this.forceFullScreenId||this.forceFullScreenId&&this.forceFullScreenId===this.selfRoster.id)&&!n&&this.pageInfo.currentPage<=1&&this.orderRosterList.splice(1,0,this.selfRoster)}else this.orderRosterList=[this.selfRoster]}},{key:"createCustomLayout",value:function(e){var t=this;this.createOrderRoster(e),this.orderRosterList.forEach((function(e){var n=e.id;if(t.customLayoutList.has(n)){var r=t.customLayoutList.get(n);t.customLayoutList.set(n,Object.assign(Object.assign({},r),{roster:e,resolution:0,quality:0,deal:!0}))}else t.customLayoutList.set(n,{roster:e,rotate:{},state:"NORMAL",resolution:0,quality:0,deal:!0})})),this.clearInvalidLayout(),this.logger.log("[v2]custom layout list: ",this.customLayoutList)}},{key:"requestLayout",value:function(e){var t=this,n=this.orderRosterList;e.forEach((function(e){var r=e.callUri,i=void 0===r?"":r,o=e.isContent,a=e.resolution,s=e.quality,c=i+Number(o),u=t.customLayoutList.has(c),l=n.findIndex((function(e){return e.endpointId+Number(e.isContent)===c})),h=n[l],d=s>0?100*s:100;if(u){var f=t.customLayoutList.get(c);t.customLayoutList.set(c,Object.assign(Object.assign({},f),{roster:h,resolution:a,quality:d,deal:!0}))}else t.customLayoutList.set(c,{roster:h,rotate:{},state:"NORMAL",resolution:a,quality:d,deal:!0})})),this.clearInvalidLayout();var r=this.customLayoutCalculator();this.client.sendCustomLayout(r),this.logger.log("custom layout list: ",this.customLayoutList)}},{key:"calculatePosition",value:function(){var e=this,t={left:"0px",top:"0px",width:"0px",height:"0px"},n={width:0,height:0};this.layoutList.forEach((function(r,i){var o=e.screenInfo,a=o.rateWidth,s=o.rateHeight,c=h(r.position,4),u=c[0],l=c[1],d=c[2],f=c[3],p=Math.round(a*u),v=Math.round(s*l),g=Math.round(a*d),m=Math.round(s*f);t={left:"".concat(p,"px"),top:"".concat(v,"px"),width:"".concat(g,"px"),height:"".concat(m,"px")},n={width:g,height:m},r.zIndex&&(t.zIndex=r.zIndex),e.layoutList.set(i,Object.assign(Object.assign({},r),{positionStyle:t,positionInfo:n}))}))}},{key:"calculateRotate",value:function(){var e=this;this.client.getRotationInfo().forEach((function(t){var n=t.participantId,r=t.mediagroupid,i=e.getLayoutKeyByRotateInfo(n,r),o={};if(i){var a=e.layoutList.get(i);if(a){var s=a.positionInfo||{width:0,height:0},c=s.width,u=s.height;o=Dv(t,c,u),e.layoutList.set(i,Object.assign(Object.assign({},a),{rotate:o}))}}})),this.client.config.localMirror&&this.localMirrorRotate()}},{key:"getVideoStreamByTrackId",value:function(e){for(var t=this.client.getVideoTrackList(),n=t.length,r={videoStream:null,track:null},i=0;i<n;i++){var o=t[i].data,a=t[i].rest,s=o.streams[0].id;if((s=s.replace("-st","-tk-vd"))===e){r={videoStream:o.streams[0],track:a.track};break}}return r}},{key:"calculateNewLayoutList",value:function(){for(var e=this.orderRosterList.length,t=this.initLayout.length,n=[],r=this.client.getSpeakerInfo(),i=0;i<e;i++){var o=this.orderRosterList[i];if(Object.assign(o,{isActiveSpeaker:0===o.mediagroupid&&o.endpointId===r.endpointId}),!(i<t))break;var a=Lv,s=0,c=this.initLayout[i];c&&(a=(null==c?void 0:c.position)||Lv,s=(null==c?void 0:c.zIndex)||0),n.push({roster:o,position:a,resolution:(null==c?void 0:c.resolution)||1,zIndex:s})}return n}},{key:"calculateScreenInfo",value:function(){var e=this.client.getClientConfig();if("CUSTOM"===e.layout)return{width:0,height:0,rateHeight:0,rateWidth:0};var t=e.container||{elementId:"",offset:[]},n=t.elementId,r=void 0===n?"":n,i=t.offset,o=void 0===i?[]:i,a=r?document.getElementById(r):null,s=h(o,4),c=s[0],u=void 0===c?0:c,l=s[1],d=void 0===l?0:l,f=s[2],p=void 0===f?0:f,v=s[3],g=void 0===v?0:v,m=Number(u)+Number(d),y=Number(p)+Number(g),b=(null==a?void 0:a.clientHeight)||document.body.clientHeight,S=(null==a?void 0:a.clientWidth)||document.body.clientWidth,w=b-m,k=S-y,C=w>0?w:b,E=k>0?k:S,x=Math.floor(E*this.templateRate.next),I=Math.floor(C/this.templateRate.next),_={rateHeight:0,rateWidth:0,width:E,height:C};return _=C>x?{rateWidth:E,rateHeight:x,width:E,height:C}:{rateWidth:I,rateHeight:C,width:E,height:C},this.logger.log("client screen info: ",_),this.screenInfo=_,this.client.sendScreenInfoMessage(_),_}},{key:"createLayout",value:function(){var e=this.client.getPeerConnectionStatus();if(this.initLayoutManager(),this.createBaseLayout(),this.updateStreams(!1),this.calculatePosition(),this.calculateRotate(),this.client.sendLayoutMessage(),this.logger.log("create layout: ",Vl(this.layoutList)),this.logger.log("current template mode:",this.templateMode),"GALLERY"!==this.templateMode&&(this.templateModeTemp=this.templateMode),this.client.sendTemplateMode(this.templateMode),e){var t=this.content,n=t.previous,r=t.next;(null==n?void 0:n.participantId)!==(null==r?void 0:r.participantId)&&this.client.sendContentRosterMessage(r)}}},{key:"calculateOrderRosterList",value:function(){var e=this.client.getOriginRosters(),t=this.client.getInviteInfo().callerUri,n=this.client.getContentSenderPid(),r=this.client.getSpeakerInfo(),i=this.client.getLocalHide(),o=e.length,a={content:[],chairmain:[],selfRoster:[],activeSpeaker:[],audioVideoUnmute:[],audioUnmute:[],videoUnmute:[],audioVideoMute:[]},s=[];this.localContent=null;for(var c=0;c<o;c++){var u=e[c],l=u.mediagroupid,h=u.endpointId;u.isActiveSpeaker=!1,u.isLocal=!1,u.id=h+l,u.endpointId===t&&u.isContent?this.localContent=u:"record"!==u.deviceType&&(u.isContent&&n>0&&u.participantId!==n||(u.isContent&&n>0&&u.participantId===n?a.content.push(u):u.isForceFullScreen?a.chairmain.push(u):u.endpointId===t&&i&&o>1||(u.endpointId!==t||u.isContent||i?r.endpointId&&r.endpointId===u.endpointId?(u.isActiveSpeaker=!0,a.activeSpeaker.push(u)):u.audioTxMute||u.videoTxMute?u.audioTxMute||!u.videoTxMute?!u.audioTxMute||u.videoTxMute?u.audioTxMute&&u.videoTxMute&&a.audioVideoMute.push(u):a.videoUnmute.push(u):a.audioUnmute.push(u):a.audioVideoUnmute.push(u):(u.isLocal=!0,this.selfRoster.participantId=u.participantId,a.selfRoster.push(u)))))}for(var d in this.localContent&&a.content&&(a.content=[]),a)s=s.concat(a[d]);return s}},{key:"switchLayout",value:function(e){this.forceFullScreenId&&this.setForceFullScreenId("");var t=this.confInfo.contentUri,n=t?of:rf,r=e;if(r)n.findIndex((function(e){return e===r}))<0&&"GALLERY"!==r&&(r=t?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER");else if("GALLERY"===this.templateMode)r=this.templateModeTemp;else{r=this.templateMode;var i=n.findIndex((function(e){return e===r})),o=i+1>=n.length?0:i+1;r=n[o]}if(this.templateMode=r,"GALLERY"===this.templateMode){var a=this.confInfo.chairManUrl,s=void 0===a?"":a;this.pageInfo.currentPage=s?0:1}else this.pageInfo.currentPage=0;return this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo),this.logger.log("switch layout Mode: ",r),r}},{key:"clearVideoManagersUseMonitorList",value:function(e){var t=this;e.forEach((function(e){t.videoManagers[e]&&(t.videoManagers[e].destroy(),delete t.videoManagers[e])}))}},{key:"setLocalStatus",value:function(e){if(this.logger.log("set local status: ",e),this.selfRoster=Object.assign(Object.assign({},this.selfRoster),e),!this.forceFullScreenId||this.forceFullScreenId===this.selfRoster.id){var t=this.selfRoster,n=t.endpointId,r=t.mediagroupid,i=n+r,o="AUTO"===this.client.config.layout?this.layoutList:this.customLayoutList,a=o.get(i),s=this.orderRosterList.findIndex((function(e){return e.endpointId===n&&e.mediagroupid===r}));s>-1&&(this.orderRosterList[s]=this.selfRoster),a&&o.set(i,Object.assign(Object.assign({},a),{roster:this.selfRoster})),this.updateStreams()}}},{key:"clearInvalidLayout",value:function(){var e="AUTO"===this.client.config.layout?this.layoutList:this.customLayoutList;e.forEach((function(t,n){t.deal?e.set(n,Object.assign(Object.assign({},t),{deal:!1})):e.delete(n)}))}},{key:"createBaseLayout",value:function(){var e=this;this.newLayoutList.forEach((function(t){var n=t.roster,r=t.position,i=t.zIndex,o=t.resolution,a=n.endpointId+n.mediagroupid;if(e.layoutList.has(a)){var s=e.layoutList.get(a);e.layoutList.set(a,Object.assign(Object.assign({},s),{roster:n,position:r,zIndex:i,resolution:o,deal:!0}))}else e.layoutList.set(a,{roster:n,position:r,zIndex:i,resolution:o,state:"NORMAL",rotate:{},positionStyle:{left:"",top:"",width:"",height:""},positionInfo:{width:0,height:0},deal:!0,quality:100})})),this.clearInvalidLayout()}},{key:"customLayoutCalculator",value:function(){var e=[],t={};return this.customLayoutList.forEach((function(n){var r=n.roster||{},i=r.isContent,o=r.id,a=r.isLocal,s=r.participantId,c=n.resolution,u=void 0===c?1:c,l=n.quality,h=void 0===l?100:l,d=h>0?100*h:100;a||(e.push({pid:s,resolution:u,quality:d,mediagroupid:Number(i)}),t[o]={resolution:nf.RESOLUTION_MAP[u],quality:d})})),this.internelsLayout=t,e}},{key:"getLayoutKeyByRotateInfo",value:function(e,t){var n="";return this.layoutList.forEach((function(r){var i=r.roster,o=i.isContent,a=i.endpointId,s=i.mediagroupid;i.participantId===e&&1===t===o&&(n=a+s)})),n}},{key:"localMirrorRotate",value:function(){var e=this.client.invite.callerUri+"0";if(this.layoutList.has(e)){var t=this.layoutList.get(e);this.layoutList.set(e,Object.assign(Object.assign({},t),{rotate:{transform:"rotateY(180deg)"}}))}}}],[{key:"getCustomLayoutItem",value:function(e,t,n){var r=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:n,mediagroupid:r?1:0}}}]),t}(),Fv=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return!1;var t=!0;return e.some((function(e){var n=e||{},r=n.calluri;n.mediagroupid;var i=n.quality,o=n.resolution;("string"!=typeof r||Zd.indexOf(i)<0||Jd.indexOf(o)<0)&&(t=!1)})),t};qt({target:"Math",stat:!0},{trunc:wt});var zv=Math.log,Yv=Math.LOG10E,Vv=Math.log10||function(e){return zv(e)*Yv};qt({target:"Math",stat:!0},{log10:Vv});var Xv=M(R.f),Wv=M([].push),qv=function(e){return function(t){for(var n,r=Y(t),i=Zt(r),o=i.length,a=0,s=[];o>a;)n=i[a++],E&&!Xv(r,n)||Wv(s,e?[n,r[n]]:r[n]);return s}},Zv={entries:qv(!0),values:qv(!1)}.values;qt({target:"Object",stat:!0},{values:function(e){return Zv(e)}});var Jv=function(){function e(t,r){n(this,e),this.client=t,this.layoutManager=r,this.reportDataTimer=0,this.previousInternals=null,this.internals=null,this.meetingQualityData={callNumber:"",deviceId:"",meetingId:"",osVersion:navigator.userAgent,sockProto:"udpProto",swVersion:bf,cdrVersion:10,deviceType:17}}return i(e,[{key:"reportQualityData",value:function(e){var t;if(!this.meetingQualityData.callNumber){var n=(this.client.getConferenceInfo()||{callUrl:""}).callUrl,r=void 0===n?"":n,i=this.client.invite,o=i.meetingId,a=i.callerUri;this.meetingQualityData.callNumber=r,this.meetingQualityData.deviceId=a.split("@")[0],this.meetingQualityData.meetingId=o}if(this.reportDataTimer=this.reportDataTimer+1,this.reportDataTimer%2==0){this.internals=e,this.calcQualityData(0);var s=this.client.getLocalShareContent(),c=((null===(t=this.layoutManager)||void 0===t?void 0:t.getConfInfo())||{}).contentUri;((void 0===c?"":c)||s)&&this.calcQualityData(1),this.reportDataTimer=0}this.previousInternals=e}},{key:"calcAudioLevel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return(e/=100)<316e-7?-90:Math.trunc(20*Math.log10(e))}},{key:"calcQualityData",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.internals){var o=this.internals,a=o.receiver,s=o.sender,c=o.audioReceiver,u=o.audioSender,l=o.jitterReceived,h=o.jitterSent,d=o.fractionLostSent,f=o.fractionLostReceived,p=o.roundTripTime,v=o.audioSendJitter,g=o.audioSendLost,m=void 0===g?0:g,y=o.audioRecvLost,b=void 0===y?0:y,S=this.previousInternals||{audioReceiver:{}},w=S.audioReceiver,k=[],C=0,E=0,x=0,I=0,_=-90,A=-90,T=0,R=(null===(e=this.layoutManager)||void 0===e?void 0:e.getSelfRoster())||{participantId:0,endpointId:""},O=[{callUri:R.endpointId,participantId:R.participantId,sessionId:0,audioStream:[],videoStream:[]}],D=[],N=new Map,L=[],P=0,M=0,B=0,G=0,j=0;Object.values(s).map((function(e){var t=e.bytesSentSecond,n=e.frameWidth,i=e.frameHeight,o=e.framesEncodedSecond,a=e.resolution,s=e.isContent,c=e.expBandwidth;!!r===s&&(I+=t,T+=c,O[0].videoStream.push({fr:o,height:i,width:n}),L.push({Height:i,Width:n,framerate:o,resNum:1,resolution:a&&Vd[a.toUpperCase()]||1}))})),Object.values(a).map((function(e){var t=e.frameWidth,n=e.frameHeight,i=e.framesDecodedSecond,o=e.participantId,a=e.bytesReceivedSecond;e.jitter;var s=e.isContent,c=e.framesReceivedSecond,u=e.ExpectWidth,l=void 0===u?0:u,h=e.ExpectHeight;if(!!r===s){x+=a,P+=t*n*c,M+=l*(void 0===h?0:h)*c;var d=t+"*"+n,f=N.get(d);f?(f.resNum+=1,f.framerate+=c,N.set(d,f)):N.set(d,{Width:t,Height:n,framerate:c,resNum:1,resolution:Vd["".concat(n,"P")]||1}),k.push({participantId:o||0,videoStream:[{fr:i,height:t,width:n}]})}})),Object.values(u).map((function(e){var t=e.bytesSentSecond,i=e.audioLevel,o=void 0===i?0:i,a=e.expBandwidth,s=e.isContent;!!r===s&&(T+=a,_=n.calcAudioLevel(o),E+=t)})),Object.values(w).map((function(e){var t=e.insertedSamplesForDecelerationSecond,n=void 0===t?0:t,i=e.removedSamplesForAccelerationSecond,o=void 0===i?0:i,a=e.totalSamplesReceivedSecond,s=void 0===a?0:a,c=e.isContent;!!r===c&&(G+=n,G+=o,j+=s)})),Object.values(c).map((function(e){var t=e.bytesReceivedSecond,n=e.audioLevel,i=void 0===n?0:n,o=e.insertedSamplesForDecelerationSecond,a=void 0===o?0:o,s=e.removedSamplesForAccelerationSecond,c=void 0===s?0:s,u=e.totalSamplesReceivedSecond,l=void 0===u?0:u,h=e.isContent;!!r===h&&(G+=a,G+=c,j+=l,B=Math.max(B,i),E+=t)})),N.forEach((function(e,t){var n=e.framerate,r=e.resNum;e.framerate=n/r,D.push(e)}));var H=(null===(t=navigator.connection)||void 0===t?void 0:t.type)||"none",U=M?Math.floor(P/M*100):-1,K=j?Math.floor(G/j*100):0;A=this.calcAudioLevel(B);var F={sessionName:r,networkType:$d[H]||0,timestampSec:1e3*parseInt((new Date).getTime()/1e3+""),audioCaptureEnergy:_,audioRenderEnergy:A,audioDownLinkBw:C,audioUpLinkBw:E,avrMissLipsync:0,videoUplinkBw:I,videoDownLinkBw:x,videoPxRatio:U,videoRecvDelay:0,videoSendDelay:0,videoRecvJitter:l,videoSendJitter:h,isLast:i,recvStreams:k,sendStreams:O,videoQuality:D,videoSendQuality:L,dbaDownLinkBw:x,dbaUplinkBw:I,videoSendRtt:p,audioSendRtt:p,audioSendJitter:v,videoRecvLost:f,videoSendLost:d,audioSendLost:m,audioRecvLost:b,upExpectedBw:T,downMaxExpectedBw:3e3,downMinExpectedBw:3e3,audioPlcPct:K},z={content:Object.assign({},this.meetingQualityData,F)};this.client.sendSocketMessage({type:"PASS_THROUGH",body:{type:"dataReport",data:z}},!1,!1)}}},{key:"stopReportData",value:function(){this.client.off("meeting-stats"),this.calcQualityData(0,!0)}}]),e}(),$v=function(r){o(s,Hf);var a=l(s);function s(e,t,r){var i,o;n(this,s),(i=a.call(this)).onSetAudioStream=function(e){if(e&&i.stream){var t=i.stream.getMediaStreams().previewStreams;"mute"===e&&t.length&&i.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===e&&t.length&&i.stream.setAudioOrVideoStatus("unmuteAudio")}},i.logger=r,i.clientErrorState="NONE",i.callInfo={token:"",confNumber:""},i.onhold=!1;try{i.logger.initDB(),Cf.setLogger(i.logger)}catch(e){i.logger.error("init db error: ",e)}i.logger.log("user system info: ",navigator.userAgent),i.logger.log("Version: ",bf),i.logger.log("init config: ",e),i.config=e,e.layout&&(i.config.layout=e.layout.toUpperCase()),i.iauth=new kp(r),i.autoMode="AUTO"===(null===(o=e.layout)||void 0===o?void 0:o.toUpperCase()),i.debug=!!e.debug,i.localHide=!!e.localHide;var u,l,h,d,f,p="HIDE"===e.__hideId?"HIDE":ff[e.__hideId||0]||"";return i.hideId=p,i.config.__hideId=p,i.servers=t,i.disconnected=!1,i.clientStatus=!0,i.peerConnectionStatus=!1,i.isAutoBandwidth=!0,i.seq=0,i.token="",i.speakerInfo={endpointId:"",pid:0},i.stream=null,i.rosters=[],i.videoTrackList=[],i.audioTrackList=[],i.layoutManager=new Kv(c(i)),i.layoutRosters={content:[],people:[],total:[]},i.pushType="ALL",i.cacheMeetingControlMessage=null,i.rotationInfo={people:[],content:[],total:[]},i.customLayoutSeq=0,i.contentSenderPid=0,i.invite={callerUri:"",callIndex:0,automute:"",meetingId:""},i.shareContentTimmer=null,i.shareContentStatus="ENDED",i.streamChangeList={content:[],people:[]},i.autoSwitchDevice=!0,i.audioManagers={},i.limitResolution=[],i.conferenceInfo=null,i.customLayoutCacheList=null,i.contentOnholdInfo={is:!1,audioTrackId:"",contentUrl:""},i.deviceManager=null,i.isPermissionDenied={camera:!1,microphone:!1},i.contentMode="VIDEO",i.isSubscribeBulkRoster=!1,i.isSubscribeTranslation=!1,i.recordPermission={authorize:!1,recordingUrl:""},i.recordState="",i.errorcode=sl.get("xy-error-code")||Hl,i.i18nCode=sl.get("xy-i18n-code"),i.onScreenChangeEvent=i.onScreenChangeEvent.bind(c(i)),i.onDocumentChange=(u=i.onScreenChangeEvent,l=100,h=50,f=null,function(){var e=+new Date,t=this,n=arguments;f&&clearTimeout(f),d||(d=e),e-d>=h?(u.apply(t,n),d=e):f=setTimeout((function(){u.apply(t,n)}),l)}),i.autoMode&&i.initEvent(),i.deviceManager=new rv(i.logger),i.initDeviceManagerEvent(),i.qualityManager=new Jv(c(i),i.layoutManager),i.isShareContent=!1,i}return i(s,[{key:"getClientConfig",value:function(){return this.config}},{key:"getVideoManagers",value:function(){var e;return null===(e=this.layoutManager)||void 0===e?void 0:e.getVideoManagers()}},{key:"getPreviewStreams",value:function(){var e;return(null===(e=this.stream)||void 0===e?void 0:e.getMediaStreams())||{previewStreams:[]}}},{key:"getVideoTrackList",value:function(){return this.videoTrackList}},{key:"getLayoutRosters",value:function(){return this.layoutRosters}},{key:"getOriginRosters",value:function(){return this.rosters}},{key:"getConferenceInfo",value:function(){return this.conferenceInfo}},{key:"getInviteInfo",value:function(){return this.invite}},{key:"getContentSenderPid",value:function(){return this.contentSenderPid}},{key:"getSpeakerInfo",value:function(){return this.speakerInfo}},{key:"getLocalHide",value:function(){return this.localHide}},{key:"getRotationInfo",value:function(){return this.rotationInfo.total}},{key:"getPeerConnectionStatus",value:function(){return this.peerConnectionStatus}},{key:"getOnHold",value:function(){return this.onhold}},{key:"getAudioTrackList",value:function(){return this.audioTrackList||[]}},{key:"getLayoutList",value:function(){var e,t,n=this.config.layout;return"AUTO"===n?null===(e=this.layoutManager)||void 0===e?void 0:e.getLayoutList():"CUSTOM"===n?null===(t=this.layoutManager)||void 0===t?void 0:t.getCustomLayoutList():void 0}},{key:"getSelfRoster",value:function(){var e;return null===(e=this.layoutManager)||void 0===e?void 0:e.getSelfRoster()}},{key:"getLocalShareContent",value:function(){return this.isShareContent}},{key:"loginXYlinkAccount",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] login xylink account:",{userName:t,password:n}),e.next=3,this.iauth.login({userName:t,password:n});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),r,this)})))}},{key:"loginExternalAccount",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] login external account:",t),e.next=3,this.iauth.loginExternalAccount(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"resetInitParameter",value:function(){this.debug=!!this.config.debug,this.localHide=!!this.config.localHide,this.hideId=this.config.__hideId,this.isPermissionDenied={camera:!1,microphone:!1},this.isSubscribeBulkRoster=!1,this.isSubscribeTranslation=!1}},{key:"setContentMode",value:function(e){this.contentMode=e}},{key:"toggleLocal",value:function(){var e=this;return this.logger.log("[client] toggleLocal:",this.autoMode),new Promise((function(t,n){var r;e.autoMode?(e.localHide=!e.localHide,null===(r=e.layoutManager)||void 0===r||r.calcRequestNewLayout(),e.sendsOriginOrderRosterMessage(),t({status:e.localHide})):(e.localHide=!e.localHide,t({status:e.localHide}))}))}},{key:"toggleHideId",value:function(){var e=this;return this.logger.log("[client] toggleHideId:",this.hideId),new Promise((function(t,n){e.hideId=e.hideId?"":e.config.__hideId,e.sendSocketMessage({type:"UPDATE_HIDEID",hideId:e.hideId}),t(!!e.hideId)}))}},{key:"setVideoRenderer",value:function(e,t){var n;this.logger.log("[client] setVideoRenderer:",{key:e,wrapEleId:t}),null===(n=this.layoutManager)||void 0===n||n.setVideoRenderer(e,t)}},{key:"removeVideoRender",value:function(e,t){var n;this.logger.log("[client] removeVideoRender:",{key:e,wrapEleId:t}),null===(n=this.layoutManager)||void 0===n||n.removeVideoRenderer(e,t)}},{key:"playVideo",value:function(e){var t=this;return this.logger.log("[client] playVideo:",e),new Promise((function(n,r){var i;try{null===(i=t.layoutManager)||void 0===i||i.playVideo(e),n(!0)}catch(e){t.logger.log("video replay failed:",e),r(!1)}}))}},{key:"playAudio",value:function(){var t=this;return this.logger.log("[client] playAudio:"),new Promise((function(n,r){return Rn(t,void 0,void 0,e().mark((function t(){var i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,i=0,o=Object.keys(this.audioManagers);case 2:if(!(i<o.length)){e.next=19;break}if(!(a=o[i])){e.next=16;break}if(!(null==(s=this.audioManagers[a].ele)?void 0:s.srcObject)){e.next=16;break}return e.prev=7,e.next=10,s.play();case 10:this.logger.log("audio replay success..."),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(7),this.logger.log("audio replay failed:",e.t0);case 16:i++,e.next=2;break;case 19:n(!0),e.next=26;break;case 22:e.prev=22,e.t1=e.catch(0),this.logger.log("audio replay failed:",e.t1),r(!1);case 26:case"end":return e.stop()}}),t,this,[[0,22],[7,13]])})))}))}},{key:"setAudioRenderer",value:function(t,n){var r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setAudioRenderer:",t),this.audioManagers[t]||(this.audioManagers[t]={ele:n}),s=this.audioManagers[t],this.logger.log("setAudioRenderer render ele srcObject:",null===(r=null==s?void 0:s.ele)||void 0===r?void 0:r.srcObject),!s||!s.ele||s.ele.srcObject){e.next=23;break}if(!((c=this.audioTrackList.findIndex((function(e){return e.rest.streamId===t})))>=0)){e.next=23;break}return u=this.audioTrackList[c].data.streams[0],s.ele.srcObject=u,this.logger.log("setAudioRenderer audioTrack:",u.id),e.prev=10,e.next=13,s.ele.play();case 13:this.logger.log("setAudioRenderer play:",u.id),l=null===(i=this.stream)||void 0===i?void 0:i.config.devices,this.stream&&l&&l.audioOutputValue&&"default"!==l.audioOutputValue&&(null===(o=this.deviceManager)||void 0===o||o.setAudioOutputDevice(s.ele,l.audioOutputValue)),this.logger.log("audio play success: ",u.id,u.active,s.ele.paused),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(10),this.emmit("play-failed",{type:"audio",key:t,error:e.t0}),this.logger.warn("audio play error: ",e.t0);case 23:case"end":return e.stop()}}),a,this,[[10,19]])})))}},{key:"switchAutoDevice",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.logger.log("[client] switchAutoDevice",t),new Promise((function(n,r){e.autoSwitchDevice=!!t,n(e.autoSwitchDevice)}))}},{key:"switchLayout",value:function(e){var t=this;return this.logger.log("[client] switchLayout: ",e),new Promise((function(n,r){var i;t.autoMode?(e=(null===(i=t.layoutManager)||void 0===i?void 0:i.switchLayout(e))||"SPEAKER",Cf.setStates("oper-confOperation","layout"),n(e)):r(Xl("XYSDK:950601"))}))}},{key:"setPageInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.logger.log("[client] setPageInfo: ",t),"AUTO"!==this.config.layout)return Promise.reject(Xl("XYSDK:950603"));null===(e=this.layoutManager)||void 0===e||e.setPageInfo(t)}},{key:"handleConferenceInfo",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.invite,r=n.commonJson,i=void 0===r?"":r,o=n.vcNumber,a=void 0===o?"":o,s=i&&JSON.parse(i)||{},c=(null==s?void 0:s.confAuxProperties)&&JSON.parse(s.confAuxProperties)||{},u=this.callInfo,l=u.meeting,h=u.confNumber,d=Object.assign(Object.assign({},l),{callNumber:a||h}),!a||h===a){e.next=20;break}return e.prev=6,e.next=9,Cf.getCallUri({number:a,deviceType:17,country:"CN"});case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0={};case 12:f=e.t0,p=f.data,v=p.displayName,g=void 0===v?"":v,m=p.numberType,y=void 0===m?"":m,b=p.callUrl,S=void 0===b?"":b,w=p.avatar,k=void 0===w?"":w,C=p.deviceType,E=void 0===C?"":C,x=p.deviceId,I=void 0===x?"":x,d=Object.assign(Object.assign({},d),{displayName:g,numberType:y,callUrl:S,avatar:k,deviceType:E,deviceId:I}),e.next=20;break;case 18:e.prev=18,e.t1=e.catch(6);case 20:if("1"!==c.watermark){e.next=31;break}return e.prev=21,e.next=24,Cf.getWatermarkContent(d.callNumber);case 24:_=e.sent,A=_.data||{watermarkContent:""},T=A.watermarkContent,R=void 0===T?"":T,d.confAuxProperties={watermarkContent:R},e.next=31;break;case 29:e.prev=29,e.t2=e.catch(21);case 31:this.conferenceInfo=d,this.logger.log("Get conference info:",this.conferenceInfo),this.emmit("conference-info",d);case 34:case"end":return e.stop()}}),t,this,[[6,18],[21,29]])})))}},{key:"checkPermissionWithMeetingNumber",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.invite,r=n.meetingId,i=n.vcNumber,o=void 0===i?"":i,this.logger.log("[client] checkPermissionWithMeetingNumber",{meetingId:r,vcNumber:o}),e.prev=2,e.next=5,Cf.checkPermissionWithMeetingNumber(o,r);case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:a=e.t0,s=a.status,c=a.data,200===s&&(u=c.authorize,l=c.recordingUrl,this.recordPermission={authorize:u,recordingUrl:l}),e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),this.logger.log("checkPermissionWithMeetingNumber err:",e.t1);case 17:return this.emmit("record-permission",this.recordPermission),e.abrupt("return",this.recordPermission);case 19:case"end":return e.stop()}}),t,this,[[2,14]])})))}},{key:"checkStorageSpaceWithRecordingUrl",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] checkStorageSpaceWithRecordingUrl:",t),e.prev=1,e.next=4,Cf.checkStorageSpaceWithRecordingUrl(t);case 4:return r=e.sent,i=r.status,o=r.data,400===i&&(a=o.developerMessage,s=o.errorCode,c=o.userMessage,Object.assign(this.recordPermission,{developerMessage:a,errorCode:s,userMessage:c})),e.abrupt("return",r);case 10:e.prev=10,e.t0=e.catch(1),this.logger.log("checkStorageSpaceWithRecordingUrl err:",e.t0);case 13:return this.emmit("record-permission",this.recordPermission),e.abrupt("return",this.recordPermission);case 15:case"end":return e.stop()}}),n,this,[[1,10]])})))}},{key:"handleSocketMessage",value:function(e,t){var n,r,i,o,a,s,c,u,l,h=this;if(!this.disconnected)switch(e.type){case"CALL_INDEX":var d=e.callIndex,f=e.callerUri,p=void 0===f?"":f;if(this.invite=Object.assign(Object.assign({},this.invite),{callIndex:d,callerUri:p}),this.logger.log("Get callIndex message: ",this.invite),"AUTO"===this.config.layout){var v=null===(n=this.layoutManager)||void 0===n?void 0:n.getScreenInfo();v&&this.sendScreenInfoMessage(v)}break;case"CONNECTED":this.invite=Object.assign(Object.assign({},this.invite),e),this.logger.log("Get connected message: ",this.invite);var g=this.iauth.getLoginInfo().extUserId;null===(r=this.layoutManager)||void 0===r||r.setLocalStatus({endpointId:this.invite.callerUri,participantId:9999999999,id:this.invite.callerUri+0,audioTxMute:this.config.muteAudio,videoTxMute:this.config.muteVideo,extUserId:g}),this.sendAudioStatus(!!this.config.muteAudio),setTimeout((function(){t(h.clientStatus&&!h.disconnected),h.handleConferenceInfo(),h.checkPermissionWithMeetingNumber()}),100),Cf.setMeetingInfo({meetingId:this.invite.meetingId,callUri:this.invite.callerUri}),Cf.setStates("sta-confStatus","callIn",{callType:"initiativeJoin",appName:this.config.isThird?sf:af,audioMute:this.config.muteAudio,videoMute:this.config.muteVideo});break;case"confMgmtReport":this.logger.log("Get meeting control confMgmtReport message: ",e),this.onMeetingControlMessage(e);break;case"SUB_TITLE":this.logger.log("Get meeting control SUB_TITLE message: ",e),this.onSubTitle(e);break;case"CANCEL_HANGUP":this.logger.log("Get CANCEL_HANGUP message: ",e),this.emmit("cancel-handup",!0);break;case"PASS_THROUGH":this.onPassThroughMessage(e);break;case"mediaNotifyInfo":break;case"MEDIA_CHANGED":this.logger.log("Get MEDIA_CHANGED message: ",e),this.peer&&this.stream&&(La?(this.peer.close(),this.peer=new wp(this,this.stream),this.peer.setRestartIceConnection(!0),this.peer.publish(this.stream,"ALL"),this.isShareContent&&(null===(i=this.peer)||void 0===i||i.publish(this.stream,"CONTENT"))):this.peer&&this.peer.restartIceConnection()),"STARTING"===this.shareContentStatus&&this.sendContentCapabilityMessage(),this.sendConfParam(),this.isSubscribeBulkRoster&&this.subscribeBulkRoster(),this.config.bandwidthSetting&&this.setWebRxBandwidth(),this.isSubscribeTranslation&&this.startTranslation(),this.videoTrackList=[],this.audioTrackList=[];break;case"DIS_CONNECTED":this.logger.log("Get disconnected message: ",e);var m=e.detail,y=void 0===m?"default":m,b=e.code,S=void 0===b?"STATE:200":b,w=e.reason,k=void 0===w?"":w,C=jf[Fl][y];"KickoutTipContent"!==y&&"The device locked"!==y&&"OK"!==y&&S&&this.errorcode&&(C=this.errorcode[Fl][e.code]),C=C||jf[Fl].default,this.disconnected=!0;var E={message:C,code:S,detail:y,reason:k};this.logger.log("emmit disconnected msg:",E),this.emmit("disconnected",Xl("XYSDK:950230",E)),this.clientStatus=!1,this.stream&&this.stream.close(),this.close("SERVER_INNER_ERROR");break;case"CALL_EXCEPTION_REPORT":this.logger.log("Get exception message: ",e);var x=jf[Fl][e.exception];e.code&&this.errorcode&&(x=this.errorcode[Fl][e.code]),x=x||jf[Fl].default,this.disconnected=!0,this.emmit("disconnected",Xl("XYSDK:950230",{message:x})),this.close("SERVER_INNER_ERROR");break;case"DualStreamReport":this.logger.log("Get share stream message: ",e);var I=e.state,_=function(){h.shareContentTimmer&&clearTimeout(h.shareContentTimmer),h.shareContentTimmer=null};if("SENDING"===I)this.shareContentStatus="STARTING",null===(o=this.stream)||void 0===o||o.emmit("start-share-content",{}),null===(a=this.layoutManager)||void 0===a||a.setLocalShareContent(!0),Cf.setStates("oper-confOperation","content",{contentType:"desk"}),_();else if("IDLE"===I){var A=jf[Fl].SHARE_CONTENT_FAILED;"STATE:200"===e.code?null===(s=this.stream)||void 0===s||s.emmit("stop-share-content",{}):(e.code&&this.errorcode&&this.errorcode[Fl]&&(A=this.errorcode[Fl][e.code]),null===(c=this.stream)||void 0===c||c.emmit("stop-share-content",Xl("XYSDK:950512",{message:A}))),null===(u=this.layoutManager)||void 0===u||u.setLocalShareContent(!1),this.shareContentStatus="ENDED",_()}break;case"MONITOR_STATE_REPORT":this.logger.log("Get monitor state report: ",e),this.dealMonitorReportMessage(e);break;case"RecordingStateChanged":this.logger.log("RecordingStateChanged:",e);var T=e.reason,R=e.state;this.recordState=R;var O=this.errorcode[Fl][T];"CHARGE:641"===T&&(O=this.recordPermission.developerMessage+O),e.reasonText=O,this.emmit("recording-state-changed",e);break;case"RecordStatusNotification":this.logger.log("RecordStatusNotification:",e);var D=e.callUri;e.isLocal=D===(null===(l=this.getSelfRoster())||void 0===l?void 0:l.endpointId),this.emmit("record-status-notification",e);break;default:this.logger.log("接收到其他ws消息",e)}}},{key:"dealMonitorReportMessage",value:function(e){var t=e.code,n=e.monitorInfo,r=n.failUriList,i=this.errorcode[Fl],o=JSON.parse(JSON.stringify(r));if(o=o.map((function(e){var t="未知错误",n=e.status;return"SIG:412"===n||"SIG:4464"===n?t="终端暂不支持":i&&(t=i[n]),Object.assign(Object.assign({},e),{message:t})})),"STATE:200"===t)this.emmit("start-monitor-report",{monitorInfo:Object.assign(Object.assign({},n),{failUriList:o})});else{var a="";t&&i&&(a=i[t]),this.emmit("stop-monitor-report",Xl("XYSDK:950312",{message:a}))}}},{key:"makeCall",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] makeCall params: ",t),a=window.location,s=a.protocol,c=a.hostname,u=t.token,l=t.confNumber,"https:"===s||"localhost"===c){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950130")));case 5:if("[object Object]"===Object.prototype.toString.call(t)){e.next=7;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101",t)));case 7:if(u&&l){e.next=9;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101",t)));case 9:if(this.clientStatus){e.next=11;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950201")));case 11:return null===(n=this.layoutManager)||void 0===n||n.setLocalStatus({displayName:t.displayName||""}),e.next=14,null===(r=this.deviceManager)||void 0===r?void 0:r.emmitDevices();case 14:return e.prev=14,e.next=17,this.getBasicInfo(t);case 17:if(!this.config.isVerifyMeetingId){e.next=23;break}return e.next=20,this.verifyMeeting(t);case 20:if(!(h=e.sent)||h.success){e.next=23;break}return e.abrupt("return",Promise.reject(h.data));case 23:e.next=29;break;case 25:return e.prev=25,e.t0=e.catch(14),this.logger.log("make call error:",e.t0),e.abrupt("return",Promise.reject(Xl(Gl[null===(i=null===e.t0||void 0===e.t0?void 0:e.t0.data)||void 0===i?void 0:i.errorCode]||"XYSDK:950106",e.t0)));case 29:return e.abrupt("return",new Promise((function(e,t){d.initWss(e,t)})));case 30:case"end":return e.stop()}}),o,this,[[14,25]])})))}},{key:"startCall",value:function(){var e=this.callInfo,t=e.confNumber,n=e.displayName,r=void 0===n?"":n,i=e.password,o=void 0===i?"":i,a=e.meeting,s=this.config,c=s.__hideId,u=void 0===c?"":c,l=s.__monitorMode,h=void 0===l?"":l,d=s.muteAudio,f=s.muteVideo,p=(a||{callUrl:t+"@CONFNO"}).callUrl,v=void 0===p?"":p,g=this.iauth.getLoginInfo().cellPhone;this.invite.callIndex||this.sendSocketMessage({type:"START_CALL",calleeNumber:v,displayName:r,pwd:o,callMode:"AUDIO_VIDEO",mediaAppend:{audioEncCapList:[99],videoEncCapList:[106]},hideId:u,monitorMode:h,callerNumber:g,muteAudio:d,muteVideo:f},!1)}},{key:"stopCall",value:function(e){if(this.invite.callIndex){var t=this.invite.callIndex;this.disconnected?e="SERVER_INNER_ERROR":"PUBLISH_ERROR"===this.clientErrorState?e="PEER_NET_DISCONNECT":"WS_CLOSE"!==this.clientErrorState&&"WS_ERROR"!==this.clientErrorState||(e="LOCAL_NET_DISCONNECT"),this.sendSocketMessage({type:"STOP_CALL",reason:e,code:tf[e],callIndex:t},!1)}}},{key:"publish",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isShareContent:!1,isShareFile:!1,isShareWhiteBoard:!1,isSharePeople:!1};if(this.logger.log("[client] publish:",r),this.logger.log("get network when publish:",Na.getNetWork()),this.clientStatus&&!this.disconnected){if(this.isShareContent=!!r.isShareContent,!r.isSharePeople)return r.isShareContent?(this.sendContentCapabilityMessage(e),void(null===(n=this.peer)||void 0===n||n.publish(e,"CONTENT"))):void 0;try{this.stream=e,this.peer=new wp(this,e),e.setClientObj(this),this.peer.publish(e,"ALL"),"CUSTOM"===this.config.layout&&(null===(t=this.layoutManager)||void 0===t||t.initLayoutManager()),this.initTrackEvent()}catch(e){this.logger.error("publish error: ",e),this.clientErrorState="PUBLISH_ERROR",this.emmit("call-status",Xl("XYSDK:950517",e))}}}},{key:"sendContentCapabilityMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stream,t=this.invite,n=t.callerUri,r=void 0===n?"":n,i=t.meetingId,o=e.getMediaStreams(),a=o.contentStreams,s=a.filter((function(e){return"NORMAL"===e.status})).map((function(e){var t;return{streamId:(null===(t=e.stream)||void 0===t?void 0:t.id)||"",resolution:nf.MAP_RESOLUTION_INDEX[e.resolution]}}));s.length?(this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:r,type:"contentCapability",streams:s}}),this.logger.log("contentCapability:",s)):this.logger.log("contentCapability is null"),this.limitResolution=["720"],this.sendPeopleCapability()}},{key:"applyShareContent",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shareContentStatus="PENDING",this.sendSocketMessage({type:"START_CONTENT",mode:this.contentMode,enableAnnotation:!1}),this.shareContentTimmer=setTimeout((function(){var e;"PENDING"===n.shareContentStatus&&(n.shareContentStatus="ENDED",null===(e=n.stream)||void 0===e||e.emmit("stop-share-content",{}),n.shareContentTimmer&&(clearTimeout(n.shareContentTimmer),n.shareContentTimmer=null))}),1e4);case 3:case"end":return e.stop()}}),t,this)})))}},{key:"stopShareContent",value:function(){var e=this;return this.logger.log("[client] stopShareContent"),this.isShareContent=!1,this.limitResolution=[],this.stream&&this.sendPeopleCapability(),new Promise((function(t,n){try{"STARTING"!==e.shareContentStatus&&"PENDING"!==e.shareContentStatus||e.sendSocketMessage({type:"STOP_CONTENT",mode:e.contentMode}),e.peer&&e.peer.closeContentStream(),e.stream&&e.stream.closeContentStream(),e.shareContentStatus="ENDED",e.streamChangeList.content=[],t(!0)}catch(e){n(Xl("XYSDK:950513",e))}}))}},{key:"initTrackEvent",value:function(){var e=this;this.on("track",(function(t){var n=t.track,r=n.id,i=n.kind,o=t.streams[0]||{};e.logger.log("client onTrack event: ",{track:{id:r,kind:i},stream:null==o?void 0:o.id}),t&&t.track.kind&&e.mergeTrackList(t),e.logger.log("video and audio track list: ",{video:e.videoTrackList,audio:e.audioTrackList})}))}},{key:"handleContentOnholdAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.contentOnholdInfo,n=e.streamId,r=e.track,i=t.audioTrackId,o=t.contentUrl;n===i&&(r.enabled=!!o,this.logger.log("content audio track when content onhold,",n))}},{key:"mergeTrackList",value:function(e){var t,n=e.track,r=n.kind,i=n.id,o={streamId:e.streams[0].id,track:n,trackId:i},a={status:"remote",data:e,rest:o};"video"===r?(this.videoTrackList.push(a),null===(t=this.layoutManager)||void 0===t||t.updateStreams(),this.emmit("video-track",this.videoTrackList)):"audio"===r&&(this.handleContentOnholdAudio(o),this.audioTrackList.push(a),this.emmit("audio-track",this.audioTrackList))}},{key:"destroy",value:function(){var e=this;return this.logger.log("[client] destroy"),new Promise((function(t,n){try{e.stream&&e.stream.close(),e.close(),t(!0)}catch(e){n(Xl("XYSDK:950204",e))}}))}},{key:"close",value:function(){var e,t,n,r=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"OK";this.logger.log("[client] close:",i),this.logger.log("get network when close:",Na.getNetWork()),null===(e=this.qualityManager)||void 0===e||e.stopReportData(),this.resetInitParameter(),this.contentOnholdInfo={is:!1,audioTrackId:"",contentUrl:""},this.clientStatus&&(this.clientStatus=!1,this.stopShareContent(),this.stopCall(i),this.peer&&this.peer.close(),this.removeEvent(),this.removeAllListener(),null===(t=this.layoutManager)||void 0===t||t.clearInvalidVideoManagers(),null===(n=this.layoutManager)||void 0===n||n.setForceFullScreenId(),this.socketTask&&this.socketTask.close(),this.deviceManager&&this.deviceManager.destroy(),this.customLayoutSeq=0,this.audioManagers={},this.layoutManager=null,this.deviceManager=null,this.logger.log("client closed successfully"),setTimeout((function(){r.logger.stopDB()}),100))}},{key:"getConference",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{autoMute:0};return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] getConference:",{id:t,sk:n,token:r,params:i}),a=this.iauth.getLoginInfo(),s=n||(null==a?void 0:a.securityKey),c=t||(null==a?void 0:a.id),e.prev=4,Cf.setLoginInfo(r),e.next=8,Cf.getConference(c,s,i);case 8:if(200!==(null==(u=e.sent)?void 0:u.status)){e.next=13;break}return e.abrupt("return",u.data);case 13:return e.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:{}}));case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(4),e.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:e.t0}));case 19:case"end":return e.stop()}}),o,this,[[4,16]])})))}},{key:"getServerConfig",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=sl.get("xy-error-code"),r=sl.get("xy-i18n-code"),i=sl.get("xy-timestamp"),o=(new Date).valueOf(),t=Number(i),d=Number(o),f=void 0,f=d-t,a=Math.floor(f/864e5),!(n&&r&&a<1)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,Cf.getDefaultServerConfig();case 10:if(!(s=e.sent)||200!==s.status||!s.data){e.next=17;break}return c=s.data,u=c.errorcode,l=c.i18n,h=void 0===l?"{}":l,e.next=15,this.getCodeByJson("errorcode",u,n);case 15:return e.next=17,this.getCodeByJson("i18n",h,r);case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),this.logger.log("getServerConfig error:",e.t0);case 22:case"end":return e.stop()}var t,d,f}),t,this,[[0,19]])})))}},{key:"getCodeByJson",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null==r?void 0:r.version,n="string"==typeof n?JSON.parse(n):n,s=(a=n).link,c=a.version,u=(new Date).valueOf(),c!==o){e.next=6;break}return e.abrupt("return");case 6:if(e.t0=s,!e.t0){e.next=11;break}return e.next=10,Cf.getCodeByJson(s);case 10:e.t0=e.sent;case 11:l=e.t0,"errorcode"===t&&l?(this.errorcode=l,sl.set("xy-error-code",this.errorcode)):"i18n"===t&&(this.i18nCode=l,sl.set("xy-i18n-code",this.i18nCode)),sl.set("xy-timestamp",u);case 14:case"end":return e.stop()}}),i,this)})))}},{key:"videoAudioOperate",value:function(t){var n=this;return new Promise((function(r,i){return Rn(n,void 0,void 0,e().mark((function n(){var o,a,s,c,u,l,h,d,f,p=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.stream){e.next=36;break}if(s=Qd[t].type,c=this.stream.getMediaStreams(),u=c.previewStreams,l=this.stream.current.type,this.logger.log("video or audio operate: ",t),h=this.isPermissionDenied.microphone||"FAILED"===this.stream.current.type,d=this.isPermissionDenied.camera||"FAILED"===this.stream.current.type,"unmuteAudio"!==t||!h){e.next=10;break}return this.logger.log("No permission to do audio operations"),e.abrupt("return",i(Xl("XYSDK:950224")));case 10:if("unmuteVideo"!==t||!d){e.next=13;break}return this.logger.log("No permission to do video operations"),e.abrupt("return",i(Xl("XYSDK:950225")));case 13:if(this.peer){e.next=16;break}return this.logger.log("Need to create a peer to do audio and video operations"),e.abrupt("return",i(Xl("XYSDK:950202")));case 16:if(u.length){e.next=19;break}return this.logger.log("Need to create a stream to do audio and video operations"),e.abrupt("return",i(Xl("XYSDK:950203")));case 19:return e.prev=19,f=Qd[t].status,e.next=23,this.stream.setAudioOrVideoStatus(t);case 23:"muteAudio"===t||"unmuteAudio"===t?(null===(o=this.layoutManager)||void 0===o||o.setLocalStatus({audioTxMute:!f}),this.sendAudioStatus(!f)):"muteVideo"!==t&&"unmuteVideo"!==t||null===(a=this.layoutManager)||void 0===a||a.setLocalStatus({videoTxMute:!f}),l=this.stream.current.type,"unmuteVideo"!==t?this.sendOperationMessage(s):"NORMAL"!==l&&"VIDEO_ONLY"!==l||setTimeout((function(){p.sendOperationMessage(s),p.stream&&p.isAutoBandwidth&&p.streamChange&&p.stream.handleChangeStream(p.streamChange,p.peer,p.streamChange.mediagroupid||0)}),800),Cf.setStates("oper-confOperation",cf[t]),r(t),e.next=34;break;case 30:e.prev=30,e.t0=e.catch(19),this.logger.log("video or audio operate error:",e.t0),i(Xl("XYSDK:950223",e.t0,"".concat(t," 操作失败")));case 34:e.next=37;break;case 36:i(Xl("XYSDK:950203"));case 37:case"end":return e.stop()}}),n,this,[[19,30]])})))}))}},{key:"muteAudio",value:function(){return this.logger.log("[client] muteAudio"),this.videoAudioOperate("muteAudio")}},{key:"muteVideo",value:function(){return this.logger.log("[client] muteVideo"),this.videoAudioOperate("muteVideo")}},{key:"unmuteAudio",value:function(){return this.logger.log("[client] unmuteAudio"),this.videoAudioOperate("unmuteAudio")}},{key:"unmuteVideo",value:function(){return this.logger.log("[client] unmuteVideo"),this.videoAudioOperate("unmuteVideo")}},{key:"setPollingAudioStatus",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setPollingAudioStatus: ",{type:t,callUriList:n}),i="string"==typeof n?[n]:Array.isArray(n)?n:[],n&&i.length){e.next=5;break}return this.logger.warn("callUriList should be string or string array."),e.abrupt("return");case 5:if(o=this.invite.meetingId,"mute"!==t&&"unmute"!==t){e.next=24;break}return e.prev=7,e.next=10,Cf.updateWebViewProp(o,i.map((function(e){return{callUri:e,params:'{"audioEnable": '.concat("mute"===t?'"false"':'"true"',"}")}})));case 10:if(a=e.sent,s=h(a,2),c=s[0],u=s[1],c){e.next=18;break}return e.abrupt("return",u);case 18:return e.abrupt("return",Xl("XYSDK:950111",u));case 19:e.next=24;break;case 21:return e.prev=21,e.t0=e.catch(7),e.abrupt("return",Xl("XYSDK:950111",e.t0));case 24:case"end":return e.stop()}}),r,this,[[7,21]])})))}},{key:"onHandUp",value:function(){return this.logger.log("[client] onHandUp"),this.onHand("handup",!0)}},{key:"onHandDown",value:function(){return this.logger.log("[client] onHandDown"),this.onHand("handdown",!1)}},{key:"onMute",value:function(){return this.logger.log("[client] onMute"),this.onHand("mute",!1)}},{key:"onHand",value:function(t,n){var r=this,i=this.invite,o=i.callerUri,a=void 0===o?"":o,s=i.meetingId,c=this.callInfo.confNumber;return new Promise((function(i,o){return Rn(r,void 0,void 0,e().mark((function r(){var u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Cf.hand(t,s,a,c);case 3:200===(u=e.sent).status&&0===u.data.code?i(n):(l=(null==u?void 0:u.data)||{},h=l.errorCode,o(Xl(Gl[h]||"XYSDK:950111",u.data))),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),o(Xl(Gl[null===e.t0||void 0===e.t0?void 0:e.t0.errorCode]||"XYSDK:950111",e.t0));case 10:case"end":return e.stop()}}),r,null,[[0,7]])})))}))}},{key:"sendConfParam",value:function(){var e=this.invite,t=e.meetingId,n=e.callerUri;this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"ConfParam",inoutReminder:"true"===this.invite.inoutReminder,meetingId:t,endpointId:n}})}},{key:"getSendSupportedCodec",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] getSendSupportedCodec"),e.prev=1,e.next=4,Nv();case 4:return n=e.sent,this.logger.log("get capabilities:",n),e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(1),this.logger.error("get capabilities error: ",e.t0),e.abrupt("return",Promise.reject(Xl("XYSDK:950515",e.t0)));case 13:case"end":return e.stop()}}),t,this,[[1,9]])})))}},{key:"setPeerConnectionStatus",value:function(e){var t,n,r;if(this.logger.log("setPeerConnectionStatus:",e),this.peerConnectionStatus=e,this.stream&&!this.stream.isSupportReauthorize&&(this.config.muteVideo&&this.muteVideo(),this.config.muteAudio&&this.muteAudio()),this.sendConfParam(),e){if(this.invite.automute){var i="";this.logger.log("setPeerConnectionStatus setAudioStream:",this.invite.automute),this.onSetAudioStream(this.invite.automute),"mute"===this.invite.automute||"forcemute"===this.invite.automute?i="muteAudio":"unmute"===this.invite.automute&&(i="unmuteAudio"),i&&(this.logger.log("setPeerConnectionStatus update audio status:",this.invite.automute),null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({audioTxMute:"muteAudio"===i}),this.sendAudioStatus(i))}this.cacheMeetingControlMessage&&this.cacheMeetingControlMessage.type&&this.onMeetingControlMessage(this.cacheMeetingControlMessage);var o=null===(n=this.layoutManager)||void 0===n?void 0:n.getContentRosterItem();o&&this.sendContentRosterMessage(o),null===(r=this.stream)||void 0===r||r.sendStreamStatus(),this.config.bandwidthSetting&&this.setWebRxBandwidth()}}},{key:"onMeetingControlMessage",value:function(e){var t,n,r,i,o=e.muteOperation,a=e.disableMute,s=e.chairmanUri,c=void 0===s?"":s,u=e.contentIsDisabled,l=void 0!==u&&u,h=e.commonJson,d=void 0===h?"":h,f=e.isMuteSpeaker,p=e.recordIsDisabled,v=e.groupInfoList,g="",m=!1;if(null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({isForceFullScreen:c===this.invite.callerUri}),this.peerConnectionStatus){if(a&&(m=!0),o&&this.stream&&this.deviceManager&&this.layoutManager)if("denied"!==this.deviceManager.getDevicePermission().microphone){var y=this.stream.getMediaStreams().previewStreams;g="mute"===o?"muteAudio":"unmuteAudio","mute"===o&&y.length&&(this.stream.setAudioOrVideoStatus("muteAudio"),m=!0),"unmute"===o&&y.length&&(this.stream.setAudioOrVideoStatus("unmuteAudio"),m=!1),this.layoutManager.setLocalStatus({audioTxMute:m}),this.sendAudioStatus(g),Cf.setStates("sta-msgCallback",cf[g])}if(d){var b=JSON.parse(d),S=(b.rename&&JSON.parse(b.rename)||{tmpName:""}).tmpName;S&&(null===(n=this.layoutManager)||void 0===n||n.setLocalStatus({displayName:Qp(S)}))}!c||c===(null===(r=this.cacheMeetingControlMessage)||void 0===r?void 0:r.chairmanUri)&&"on"!==f&&"off"!==f||null===(i=this.layoutManager)||void 0===i||i.setForceFullScreenId();var w={chairmanUri:c,disableMute:a,muteOperation:g,contentIsDisabled:l,isMuteSpeaker:f,recordIsDisabled:p,groupInfoList:v};this.logger.log("emmit meeting-control: ",w),this.emmit("meeting-control",w)}this.cacheMeetingControlMessage=e}},{key:"onSubTitle",value:function(e){var t=e.content,n=t&&JSON.parse(t);n.content=this.i18nCode[Fl][n.i18nKey||""]||n.content,this.emmit("sub-title",n),Cf.setStates("sta-msgCallback","subtitle")}},{key:"sendCustomMessage",value:function(e){if(e&&e.data&&"string"!=typeof e.data)return this.logger.warn("send custom message params error: ",t(e.data)),Xl("XYSDK:950101",e);var n=e.data,r=$p(n),i=n.length;if(i>1373333)return this.logger.log("send custom message size limited: ",{oriLen:i,base64Len:r.length}),Xl("XYSDK:950010",e);var o=n.length<=13333,a=e.data.substring(13333,0),s=Object.assign(Object.assign({},e),{type:"userCustomizedBizMsg",data:r});return this.logger.log("send custom message",Object.assign(Object.assign({},e),{data:"".concat(a,"..."),oriLen:n.length,base64Len:r.length})),this.sendSocketMessage({type:"PASS_THROUGH",body:s},!0,o),Xl("XYSDK:950120")}},{key:"onPassThroughMessage",value:function(e){var t,n,r,i,o=this;switch(e.body.type){case"roster":this.logger.log("roster message: ",e);var a=e.body,s=a.contentSenderPid,c=void 0===s?0:s,u=a.rosterInfo;if(0===u.length)return;this.contentSenderPid=c,this.rosters=u,this.sendsOriginOrderRosterMessage();break;case"participantsNum":this.logger.log("participant message: ",e);break;case"speakersInfo":this.logger.log("speaker info message: ",e);var l=e.body.speaker;this.speakerInfo=l,this.autoMode&&(null===(t=this.layoutManager)||void 0===t||t.createLayout(),this.sendOriginOrderedRosterMessage()),this.emmit("speaker-info",{speakerInfo:l});break;case"layoutResult":var h=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=h:1===e.body.mediagroupid&&(this.layoutRosters.content=h),this.layoutRosters.total=[].concat(d(this.layoutRosters.people),d(this.layoutRosters.content)),this.logger.log("layout result message: ",this.layoutRosters.total),this.customLayoutSeq===e.body.rSeq&&(null===(n=this.layoutManager)||void 0===n||n.updateStreams());break;case"streamChange":this.logger.log("stream change message: ",e),this.streamChange=e.body;var f=e.body,p=f.mediagroupid,v=f.streamChangeInfo;this.streamChangeList[0===p?"people":"content"]=v,this.logger.log("stream change list: ",Sp(this.streamChangeList)),this.stream&&this.isAutoBandwidth&&this.stream.handleChangeStream(this.streamChange,this.peer,e.body.mediagroupid||0);break;case"rotationChange":this.logger.log("layout rotation message: ",e),this.updateRotationInfo(e),this.logger.log("rotation info: ",this.rotationInfo),this.autoMode&&(null===(r=this.layoutManager)||void 0===r||r.calculateRotate(),this.sendLayoutMessage()),this.emmit("rotation-change",this.rotationInfo.total);break;case"candidate":this.logger.log("receive candidate:",e),this.peer.handleCandidate(e.body);break;case"answer":this.logger.log("receive answer:",e),this.peer.handleAnswer(e.body);break;case"mediaOnhold":this.logger.log("media onhold message: ",e);var g=e.body.onhold;this.onhold=Boolean(g),this.emmit("onhold",this.onhold);break;case"confChangeInfo":this.logger.log("[receive]conf change info message: ",e);var m=e.body,y=m.chairManUrl,b=void 0===y?"":y,S=m.contentUri,w=void 0===S?"":S,k=m.actSpkUri,C=void 0===k?"":k,E=m.totalEpCount,x=void 0===E?0:E,I=m.displayableEpCount,_=void 0===I?0:I,A=m.mediaGroupInfo,T=void 0===A?[]:A,R=_,O=this.contentOnholdInfo.is&&!this.contentOnholdInfo.contentUrl;this.autoMode&&(R=this.hideId?_+1:_);var D={participantCount:R,totalEpCount:x,chairManUrl:b,contentUri:O?"":w,actSpkUri:C,mediaGroupInfo:T},N=null===(i=this.layoutManager)||void 0===i?void 0:i.getConfInfo();(null==N?void 0:N.totalEpCount)!==x&&this.emmit("participants-count",{participantsNum:x}),this.layoutManager&&(this.layoutManager.setConfInfo(D),this.autoMode?(this.layoutManager.calcPageInfo(),this.layoutManager.calcRequestNewLayout()):1!==x||w||this.layoutManager.createCustomLayout([])),this.logger.log("emmit conf change info message: ",D),this.emmit("conf-change-info",D);break;case"layoutResultEx":this.logger.log("[receive][v2]layout result message: ",e),this.layoutRosters.total=e.body.layout||[],this.logger.log("[v2]layout result: ",this.layoutRosters.total),this.layoutManager&&("AUTO"===this.config.layout?this.layoutManager.createAutoLayout(this.layoutRosters.total):(this.layoutManager.createCustomLayout(this.layoutRosters.total),this.layoutManager.updateStreams()));break;case"inoutnotify":this.logger.log("[receive]inoutnotify message: ",e);var L=e.body.info||[],P=[];L.map((function(e){if(e.e!==o.invite.callerUri){var t=e.a,n=t.split(":");n.length>1&&(t=n[1]),P.push({displayName:e.c,action:e.t,userId:t})}})),this.emmit("in-out-reminder",P);break;case"bulkRoster":this.logger.log("bulk roster message: ",e);var M=e.body,B=M.bulkRosterType,G=void 0===B?0:B,j=M.addRosterInfo,H=void 0===j?[]:j,U=M.changeRosterInfo,K=void 0===U?[]:U,F=M.deleteRosterInfo,z=void 0===F?[]:F;this.emmit("bulkRoster",{bulkRosterType:G,addRosterInfo:H,changeRosterInfo:K,deleteRosterInfo:z});break;case"confproperties":if(0===e.mg&&(this.contentOnholdInfo.is=!0),1===e.mg){this.logger.log("conf properties message: ",e);var Y=e.body.confpropertiesInfo;(void 0===Y?[]:Y).forEach((function(e){"contentOnhold"===e.type&&o.handleContentOnhold(e)}))}case"multiGroupInfo":this.logger.log("receive multi group info",e);var V=e.body.mediagrps,X=void 0===V?[]:V,W=e.endpointId;this.emmit("multi-group-info",{endpointId:W,mediagrps:X});break;case"translationContent":if(this.logger.log("receive translationContent:",e),!this.onhold){var q=e.body;this.logger.log("emmit translationContent:",e),this.emmit("translation-content",q)}break;case"userCustomizedBizMsg":var Z=e.body.data;Z.length>13333?this.logger.log("SDK get userCustomizedBizMsg max message: ",Object.assign({},e.body,{length:e.length,data:""})):this.logger.log("SDK get userCustomizedBizMsg message: ",e);var J=Qp(Z),$=Object.assign(Object.assign({},e.body),{data:J});this.emmit("custom-message-recv",$);break;default:this.logger.log("get pass though default message: ",e)}}},{key:"handleContentOnhold",value:function(e){var t,n,r,i,o,a,s=this,c=e.audioTrackId,u=void 0===c?"":c,l=e.contentUrl,h=void 0===l?"":l,d=null===(t=this.layoutManager)||void 0===t?void 0:t.getConfInfo(),f=null===(n=this.layoutManager)||void 0===n?void 0:n.getSelfRoster(),p=null===(r=this.layoutManager)||void 0===r?void 0:r.getLocalShareState();if(this.contentOnholdInfo.is){(h===(null==f?void 0:f.endpointId)||p)&&(h="");var v={audioTrackId:u,contentUrl:h,is:!0};h&&h===this.contentOnholdInfo.contentUrl||!d||(d.contentUri=h,this.autoMode&&(null===(i=this.layoutManager)||void 0===i||i.calcPageInfo(d),null===(o=this.layoutManager)||void 0===o||o.calcRequestNewLayout()),this.audioTrackList.map((function(e){s.handleContentOnholdAudio(e.rest,v)})),null===(a=this.layoutManager)||void 0===a||a.setConfInfo(d),this.emmit("conf-change-info",d)),this.contentOnholdInfo=v}}},{key:"switchAutoBandwidth",value:function(){this.logger.log("[client] switchAutoBandwidth");var e=!this.isAutoBandwidth;return this.isAutoBandwidth=e,e}},{key:"disconnectInWssError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{code:1e3};if(this.logger.log("disconnected wss error",e),!this.disconnected&&this.clientStatus){this.clientErrorState="XYSDK:950114"===e?"WS_CLOSE":"WS_ERROR";var n=4e3===(null==t?void 0:t.code)?"TOKEN_INVALID":"LOCAL_NET_DISCONNECT";this.emmit("disconnected",Xl(e,{message:jf[Fl][n],key:n,detail:n},"[internel] disconnected meeting"))}}},{key:"switchDebug",value:function(e){var t=this;return this.logger.log("[client] switchDebug"),new Promise((function(n,r){"boolean"!=typeof e&&r(Xl("XYSDK:950101"));try{t.debug=e,t.peer&&t.peer.initSenderStatus(),n(t.debug)}catch(e){r(Xl("XYSDK:950210"))}}))}},{key:"requestLayout",value:function(e){var t=this;return new Promise((function(n,r){var i,o;t.logger.log("[client] requestLayout: ",e);var a=e.length>9?9:e.length;e.length=a,null===(i=t.layoutManager)||void 0===i||i.requestLayout(e),null===(o=t.layoutManager)||void 0===o||o.updateStreams(),n("successfully")}))}},{key:"requestNewLayout",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;return new Promise((function(a,s){if(r.logger.log("new layout request list: ",{reqList:e,extReqList:i,maxViewCountPerPage:t,pageIndex:n}),!Fv(e))return s(Xl("XYSDK:950101",{reqList:e}));if(!Fv(i))return s(Xl("XYSDK:950101",{extReqList:i}));~~t>9&&(t=9),n=Math.max(0,n);var c=r.invite,u=c.callerUri,l=void 0===u?"":u,h=c.meetingId;r.sendSocketMessage({type:"PASS_THROUGH",body:Object.assign({type:"customLayoutEx",conferenceId:h,endpointId:l,layoutMode:0,pageIndex:n,maxViewCountPerPage:t,streams:e,extStreams:i},o)}),a(!0)}))}},{key:"requestAutoPollingLayout",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,r=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,o){t.autoMode&&o("Auto mode not support request layout");var a=t.invite,s=a.callerUri,c=a.meetingId;t.logger.log("send request auto pllling layout data: ",{command:e,interval:n,reqList:r}),t.sendSocketMessage({type:"PASS_THROUGH",body:{type:"customLayoutEx",conferenceId:c,endpointId:s,layoutMode:1,pageIndex:0,PollingCommand:e,pollingInterval:Number(n)||0,streams:r}}),i(!0)}))}},{key:"applyVideoOrAudio",value:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stream){if(o){var a=null===(t=this.stream)||void 0===t?void 0:t.getMediaStreams(),s=a.streams;null===(n=this.peer)||void 0===n||n.setStream(s,e)}else null===(r=this.peer)||void 0===r||r.replacePeopleVideoTrack(this.stream,e);"video"===e&&this.layoutManager&&this.layoutManager.updateLocalTrack()}null===(i=this.stream)||void 0===i||i.updateDeviceByLocalStream()}},{key:"sendAudioStatus",value:function(e){"boolean"==typeof e&&(e=e?"muteAudio":"unmuteAudio"),this.logger.log("emmit audio-status: ",e),this.emmit("audio-status",{status:e})}},{key:"sendLayoutMessage",value:function(){var e,t=null===(e=this.layoutManager)||void 0===e?void 0:e.getLayoutList(),n=[];t&&t.forEach((function(e){n.push(e)})),this.emmit("layout",Sp(n))}},{key:"sendOriginOrderedRosterMessage",value:function(){var e,t=null===(e=this.layoutManager)||void 0===e?void 0:e.getOriginOrderRosters();this.emmit("roster",{rosters:t})}},{key:"sendsOriginOrderRosterMessage",value:function(){var e,t,n=(null===(e=this.layoutManager)||void 0===e?void 0:e.calculateOrderRosterList())||[];null===(t=this.layoutManager)||void 0===t||t.setOriginOrderRosters(n),this.emmit("roster",{rosters:n})}},{key:"sendCustomLayoutMessage",value:function(){var e,t,n=null===(e=this.layoutManager)||void 0===e?void 0:e.getCustomLayoutList();if(0!==(null===(t=this.customLayoutCacheList)||void 0===t?void 0:t.length)||0!==(null==n?void 0:n.size)){var r=[];null==n||n.forEach((function(e){r.push(e)})),this.customLayoutCacheList=r,this.emmit("custom-layout",Sp(r))}}},{key:"sendScreenInfoMessage",value:function(e){this.emmit("screen-info",Sp(e))}},{key:"sendContentRosterMessage",value:function(e){var t;null===(t=this.layoutManager)||void 0===t||t.setContentRosterItem(e),this.emmit("content",{data:e})}},{key:"sendTemplateMode",value:function(e){this.emmit("template-mode",e)}},{key:"sendOperationMessage",value:function(e){this.sendSocketMessage({type:e})}},{key:"updateRotationInfo",value:function(e){var t=this,n=e.body.rosterInfo||[],r=0===e.body.mediagroupid?"people":"content";this.rotationInfo[r]=n,this.rotationInfo.total=[];var i=this.rotationInfo,o=i.people,a=i.content,s=function(e,n){e.forEach((function(e){t.rotationInfo.total.push(Object.assign(Object.assign({},e),{mediagroupid:n,id:e.participantId+""+n}))}))};s(o,0),s(a,1)}},{key:"sendCustomLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.invite,n=t.callerUri,r=void 0===n?"":n,i=t.meetingId;this.customLayoutSeq=this.customLayoutSeq+1,this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:r,type:"customLayout",streams:e,rSeq:this.customLayoutSeq}})}},{key:"reportQualityData",value:function(e){e=this.getInternels(e),this.qualityManager.reportQualityData(e)}},{key:"getInternels",value:function(e){var t,n=(null===(t=this.layoutManager)||void 0===t?void 0:t.getInternelsLayout())||{pid:{resolution:0,quality:0}};Object.keys(e.receiver).forEach((function(t){var r=e.receiver[t],i=r.isContent,o=r.type+Number(i);n[o]&&(e.receiver[t].expResolution=n[o].resolution)}));for(var r=Object.keys(e.sender),i=r.length,o=0;o<i;o++){var a=e.sender[r[o]],s=this.streamChangeList.content.length,c=this.streamChangeList.people.length;if("remoteStream"===a.type&&(e.sender[r[o]].expBandwidth=Xd[a.resolution]),c)for(var u=0;u<c;u++){var l=this.streamChangeList.people[u];if(nf.RESOLUTION_MAP[l.resolution]===Number(a.resolution)&&"remoteStream"===a.type){e.sender[r[o]].expBandwidth=l.bandwidth;break}}if(s)for(var h=0;h<s;h++){var d=this.streamChangeList.content[h];if(nf.RESOLUTION_MAP[d.resolution]===Number(a.resolution)&&"contentStream"===a.type){e.sender[r[o]].expBandwidth=d.bandwidth;break}}}return e}},{key:"sendInternels",value:function(e){this.emmit("meeting-stats",this.getInternels(e))}},{key:"off",value:function(e){this.logger.log("[client] off:",e),this.removeListener(e)}},{key:"onScreenChangeEvent",value:function(){this.autoMode&&this.layoutManager&&(this.layoutManager.calculateScreenInfo(),this.layoutManager.calculatePosition(),this.layoutManager.calculateRotate(),this.sendLayoutMessage())}},{key:"initEvent",value:function(){window.addEventListener("resize",this.onDocumentChange)}},{key:"removeEvent",value:function(){window.removeEventListener("resize",this.onDocumentChange)}},{key:"sendPeopleCapability",value:function(){var e=this,t=this.invite,n=t.callIndex,r=t.callerUri,i=void 0===r?"":r,o=t.meetingId;if(this.stream){var a=this.stream.streams.filter((function(t){return"NORMAL"===t.status&&t.resolution!==e.limitResolution[0]})).map((function(e){var t;return{streamId:(null===(t=e.stream)||void 0===t?void 0:t.id)||"",resolution:nf.MAP_RESOLUTION_INDEX[e.resolution]}}));this.logger.log("stream resolution info: ",a),this.sendSocketMessage({type:"PASS_THROUGH",callIndex:n,body:{type:"peopleCapability",meetingId:o,endpointId:i,streams:a}})}}},{key:"forceFullScreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.logger.log("[client] force full screen:",t),new Promise((function(n,r){if(!e.autoMode)return r(Xl("XYSDK:950602"));if(t&&"string"!=typeof t)return r(Xl("XYSDK:950101"));if(e.layoutManager){var i=e.layoutManager.getLayoutList(),o=e.layoutManager.getForceFullScreenId();if(t){if(!(null==i?void 0:i.get(t)))return r(Xl("XYSDK:950101"));if(t===o)return n(t)}try{e.layoutManager.setForceFullScreenId(t),e.layoutManager.calcRequestNewLayout(),n(t)}catch(e){r(Xl("XYSDK:950530"))}}}))}},{key:"sendSocketMessage",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.invite,i=r.callIndex,o=r.callerUri,a=void 0===o?"":o,s=r.meetingId,c={callIndex:i,meetingId:s,endpointId:a,callUri:a},u=Object.assign(Object.assign({},e),c);if(t){var l=this.seq+"";this.socketTask&&this.socketTask.send(Object.assign(Object.assign({},u),{seq:l}),!0,n),this.seq++}else this.socketTask&&this.socketTask.send(u,!0,n)}},{key:"getBasicInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,this.callInfo=t,this.token=r,i=this.iauth.getLoginInfo(),e.prev=4,o=r||i.access_token,i.securityKey){e.next=12;break}return e.next=9,Cf.getUserInfo(o);case 9:a=e.sent,c=(s=a||{}).securityKey,u=s.userProfile,this.iauth.setLoginInfo(Object.assign(Object.assign({},i),{id:(null==u?void 0:u.id)||i.id,securityKey:c}));case 12:return e.next=14,this.getServerConfig();case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(4),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),n,this,[[4,16]])})))}},{key:"verifyMeeting",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R,O,D;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.token,i=t.confNumber,o=t.password,a=void 0===o?"":o,this.callInfo=t,this.token=r,s={success:!1,data:{}},e.prev=4,e.next=7,Cf.getCallUri({number:i,deviceType:17,country:"CN"});case 7:if(c=e.sent,u=c.data,l=u.avatar,h=void 0===l?"":l,d=u.callNumber,f=void 0===d?"":d,p=u.callUrl,v=void 0===p?"":p,g=u.deviceId,m=void 0===g?"":g,y=u.deviceType,b=void 0===y?"":y,S=u.displayName,w=void 0===S?"":S,k=u.number,C=void 0===k?"":k,E=u.numberType,x=void 0===E?"":E,I=u.enablePwd,_=void 0!==I&&I,A={avatar:h,callNumber:f,callUrl:v,deviceId:m,deviceType:b,displayName:w,number:C||i,numberType:x},!(qd.findIndex((function(e){return e===b}))>-1)){e.next=44;break}if(this.callInfo=Object.assign(this.callInfo,{meeting:A}),s=Wl(!0),!_||!pf.includes(this.hideId)){e.next=31;break}return s=Wl(!1,"XYSDK:950110"),e.prev=17,e.next=20,Cf.ignoreMeetingMonitor(i);case 20:if(e.t0=e.sent,e.t0){e.next=23;break}e.t0={};case 23:T=e.t0,200===T.status&&(s=Wl(!0)),e.next=30;break;case 28:e.prev=28,e.t1=e.catch(17);case 30:return e.abrupt("return",s);case 31:if(!_){e.next=43;break}if(s=Wl(!1,"XYSDK:950107"),!a){e.next=43;break}return e.next=36,Cf.verifyPassword(i,a);case 36:if(e.t2=e.sent,e.t2){e.next=39;break}e.t2={};case 39:R=e.t2,O=R.status,s=Wl(!0),200!==O&&204!==O&&(s=Wl(!1,"XYSDK:950108"));case 43:return e.abrupt("return",s);case 44:if(!x){e.next=46;break}return e.abrupt("return",Wl(!1,"XYSDK:950109"));case 46:if(!(null==u?void 0:u.errorCode)){e.next=50;break}if(1001!==(D=u.errorCode)&&2036!==D){e.next=50;break}return e.abrupt("return",Wl(!1,"XYSDK:950105"));case 50:return e.abrupt("return",Promise.reject(c));case 53:return e.prev=53,e.t3=e.catch(4),e.abrupt("return",Promise.reject(e.t3));case 56:case"end":return e.stop()}}),n,this,[[4,53],[17,28]])})))}},{key:"refreshToken",value:function(e){return Cf.refreshToken(e)}},{key:"setAudioOutputDevice",value:function(e){var t=this;Object.keys(this.audioManagers).forEach((function(n){var r,i=t.audioManagers[n];i.ele&&(null===(r=t.deviceManager)||void 0===r||r.setAudioOutputDevice(i.ele,e))}))}},{key:"removeAudioRender",value:function(e){this.logger.log("[client] removeAudioRender:",e),this.audioManagers[e]&&(this.logger.log("remove audio render: ",e),delete this.audioManagers[e])}},{key:"startMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]start monitor:",e),this.invite.callIndex&&this.sendSocketMessage({type:"START_MONITOR",uriList:e})}},{key:"stopMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]stop monitor:",e),this.invite.callIndex&&(this.layoutManager&&this.layoutManager.clearVideoManagersUseMonitorList(e),this.sendSocketMessage({type:"STOP_MONITOR",uriList:e}))}},{key:"subscribeBulkRoster",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeBulkRoster"}}),n.isSubscribeBulkRoster=!0,e(!0)}else t(Xl("XYSDK:950517"))})));case 1:case"end":return e.stop()}}),t)})))}},{key:"startTranslation",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] startTranslation"),e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeTranslation",operation:1}}),n.isSubscribeTranslation=!0,e(!0)}else t(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),t,this)})))}},{key:"stopTranslation",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] startTranslation"),e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeTranslation",operation:2}}),n.isSubscribeTranslation=!1,e(!0)}else t(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),t,this)})))}},{key:"setTranslationLanguage",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] setTranslationLanguage:",t),e.abrupt("return",new Promise((function(e,n){if(r.invite.callIndex){var i=r.invite,o=i.callerUri,a=i.meetingId;t=vf.includes(t)?t:"English",r.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:a,endpointId:o,language:t,type:"setTranslationLanguage"}}),e(!0)}else n(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),n,this)})))}},{key:"startCloudRecord",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] start record:",this.recordPermission),n=this.recordPermission,r=n.authorize,i=n.recordingUrl,o=this.invite.remoteUri,r){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:953902")));case 5:return e.next=7,this.checkStorageSpaceWithRecordingUrl(i);case 7:this.sendSocketMessage({type:"START_RECORD",remoteUri:o});case 8:case"end":return e.stop()}}),t,this)})))}},{key:"stopCloudRecord",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] stop record:",this.recordState),n=this.invite.remoteUri,this.recordState===exports.RecordingState.RECORD_STATE_STARTED){e.next=4;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:953905")));case 4:this.sendSocketMessage({type:"STOP_RECORD",remoteUri:n});case 5:case"end":return e.stop()}}),t,this)})))}},{key:"setWebRxBandwidth",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setWebRxBandwidth"),n=this.invite,r=n.meetingId,i=n.callerUri,o=this.iauth.getLoginInfo(),a=o.id,s=0,r){e.next=6;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950301")));case 6:return e.prev=6,e.next=9,Cf.getWebRxBandwidth(a);case 9:c=e.sent,u=c.RemoteSDKConfig,this.logger.log("getWebRxBandwidth RemoteSDKConfig:",u),s=1024*~~((null==u?void 0:u.downLinkCeilingRate)||0),e.next=17;break;case 15:e.prev=15,e.t0=e.catch(6);case 17:s&&this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"setWebRxBandwidth",meetingId:r,endpointId:i,rxBandwidth:s}});case 18:case"end":return e.stop()}}),t,this,[[6,15]])})))}},{key:"reSendContentOffer",value:function(){this.peer.reSendContentOffer()}},{key:"startMonitorGroup",value:function(e){return this.setMonitorGroup("start",e)}},{key:"stopMonitorGroup",value:function(e){return this.setMonitorGroup("stop",e)}},{key:"setMonitorGroup",value:function(e,t){if(this.logger.log("[monitor]".concat(e," monitor group"),t),!this.invite.callIndex)return Xl("XYSDK:950517");if(!t||!t.length)return!0;var n=this.invite,r=n.callerUri,i=n.meetingId;return this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"start"===e?"startMediaGrp":"stopMediaGrp",conferenceId:i,endpointId:r,mediagrps:t.map((function(e){return{id:e}}))}}),!0}},{key:"initDeviceManagerEvent",value:function(){var e,t,n,r=this;null===(e=this.deviceManager)||void 0===e||e.on("permission",(function(e){r.logger.log("deviceManager permission changed: ",e),"denied"===e.camera&&(r.isPermissionDenied.camera=!0),"denied"===e.microphone&&(r.isPermissionDenied.microphone=!0),r.emmit("permission",e)})),null===(t=this.deviceManager)||void 0===t||t.on("currentDevice",(function(e){r.emmit("currentDevice",e)})),null===(n=this.deviceManager)||void 0===n||n.on("device",(function(e){var t=e.nextDevice,n=t.audioInput,i=t.videoInput,o=t.audioOutput;try{r.autoSwitchDevice&&(n&&r.stream&&r.stream.switchDevice("audio",n.deviceId),i&&r.stream&&r.stream.switchDevice("video",i.deviceId),o&&r.setAudioOutputDevice(o.deviceId)),r.emmit("device",e)}catch(e){r.logger.log("auto switch device failed:",e)}}))}},{key:"initWss",value:function(t,n){var r,i;return Rn(this,void 0,void 0,e().mark((function n(){var o,a,s,c,u,l,h,d,f=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[wss] init wss"),this.socketTask&&this.socketTask.close(),o="",e.prev=3,a="",s=this.config.isSupportHybridCloud,this.logger.log("[wss] isSupportHybridCloud:",s),s&&(c=this.servers.wssServer.split("//")[1].split("/")[0],a="https://"+c),this.logger.log("[wss] getAllocation server in HybridCloud:",a),u=this.iauth.getLoginInfo(),l=u.id,e.next=12,Cf.getAllocation(l,a,s);case 12:h=e.sent,o=(null===(r=null==h?void 0:h.data)||void 0===r?void 0:r.serverId)||"",e.next=18;break;case 16:e.prev=16,e.t0=e.catch(3);case 18:d="".concat(this.servers.wssServer,"/websocket/webrtc").concat(o?"/".concat(o):""),this.logger.log("[wss]ws url:",d),this.token=(null===(i=Cf.getLoginInfo())||void 0===i?void 0:i.access_token)||this.token,this.socketTask=new Kf({url:d,params:{token:this.token,start:!0}},this),this.socketTask.on("open",(function(e){f.logger.log("websocket is connected:",d),f.logger.log("Version: ",bf),f.invite.callIndex&&f.peer.restartIceConnection(),f.startCall(),f.emmit("socket-open",e)})),this.socketTask.on("message",(function(e){var n=e.data;if(n){var r=JSON.parse(n);f.handleSocketMessage(r,t),f.emmit("socket-message",r)}})),this.socketTask.on("close",(function(e){f.logger.log("连接已关闭"),f.disconnectInWssError("XYSDK:950114",{code:null==e?void 0:e.code}),f.emmit("socket-close",Xl("XYSDK:950114",{code:null==e?void 0:e.code})),f.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("timeout",(function(){f.logger.log("websocket connect timeout"),f.emmit("socket-timeout",Xl("XYSDK:950112"))})),this.socketTask.on("error",(function(e){f.logger.log("Websocket connect is error",e),f.emmit("socket-error",Xl("XYSDK:950115",e))})),this.socketTask.on("reconnect",(function(e){f.logger.log("Websocket reconnect: ","Websocket connected is close, reconnect..."),f.emmit("socket-reconnect",Xl("XYSDK:950113",e))}));case 28:case"end":return e.stop()}}),n,this,[[3,16]])})))}}],[{key:"getClientInstance",value:function(e,t,n){return this.instance||(this.instance=new s(e,t,n)),this.instance}},{key:"getCustomLayoutItem",value:function(e,t,n){var r=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:n,mediagroupid:r?1:0}}}]),s}(),Qv="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,eg=RangeError,tg=function(e){if(void 0===e)return 0;var t=kt(e),n=_t(t);if(t!==n)throw eg("Wrong length or index");return n},ng=Array,rg=Math.abs,ig=Math.pow,og=Math.floor,ag=Math.log,sg=Math.LN2,cg=function(e,t,n){var r,i,o,a=ng(n),s=8*n-t-1,c=(1<<s)-1,u=c>>1,l=23===t?ig(2,-24)-ig(2,-77):0,h=e<0||0===e&&1/e<0?1:0,d=0;for((e=rg(e))!=e||e===1/0?(i=e!=e?1:0,r=c):(r=og(ag(e)/sg),e*(o=ig(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?l/o:l*ig(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*ig(2,t),r+=u):(i=e*ig(2,u-1)*ig(2,t),r=0));t>=8;)a[d++]=255&i,i/=256,t-=8;for(r=r<<t|i,s+=t;s>0;)a[d++]=255&r,r/=256,s-=8;return a[--d]|=128*h,a},ug=function(e,t){var n,r=e.length,i=8*r-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=r-1,u=e[c--],l=127&u;for(u>>=7;s>0;)l=256*l+e[c--],s-=8;for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)n=256*n+e[c--],s-=8;if(0===l)l=1-a;else{if(l===o)return n?NaN:u?-1/0:1/0;n+=ig(2,t),l-=a}return(u?-1:1)*n*ig(2,l-t)},lg=Mt.f,hg=Xe.f,dg=$e.PROPER,fg=$e.CONFIGURABLE,pg=gt.get,vg=gt.set,gg=k.ArrayBuffer,mg=gg,yg=mg&&mg.prototype,bg=k.DataView,Sg=bg&&bg.prototype,wg=Object.prototype,kg=k.Array,Cg=k.RangeError,Eg=M(Os),xg=M([].reverse),Ig=cg,_g=ug,Ag=function(e){return[255&e]},Tg=function(e){return[255&e,e>>8&255]},Rg=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Og=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Dg=function(e){return Ig(e,23,4)},Ng=function(e){return Ig(e,52,8)},Lg=function(e,t){hg(e.prototype,t,{get:function(){return pg(this)[t]}})},Pg=function(e,t,n,r){var i=tg(n),o=pg(e);if(i+t>o.byteLength)throw Cg("Wrong index");var a=pg(o.buffer).bytes,s=i+o.byteOffset,c=Ca(a,s,s+t);return r?c:xg(c)},Mg=function(e,t,n,r,i,o){var a=tg(n),s=pg(e);if(a+t>s.byteLength)throw Cg("Wrong index");for(var c=pg(s.buffer).bytes,u=a+s.byteOffset,l=r(+i),h=0;h<t;h++)c[u+h]=l[o?h:t-h-1]};if(Qv){var Bg=dg&&"ArrayBuffer"!==gg.name;if(C((function(){gg(1)}))&&C((function(){new gg(-1)}))&&!C((function(){return new gg,new gg(1.5),new gg(NaN),Bg&&!fg})))Bg&&fg&&We(gg,"name","ArrayBuffer");else{(mg=function(e){return Vn(this,yg),new gg(tg(e))}).prototype=yg;for(var Gg,jg=lg(gg),Hg=0;jg.length>Hg;)(Gg=jg[Hg++])in mg||We(mg,Gg,gg[Gg]);yg.constructor=mg}jn&&Va(Sg)!==wg&&jn(Sg,wg);var Ug=new bg(new mg(2)),Kg=M(Sg.setInt8);Ug.setInt8(0,2147483648),Ug.setInt8(1,2147483649),!Ug.getInt8(0)&&Ug.getInt8(1)||dv(Sg,{setInt8:function(e,t){Kg(this,e,t<<24>>24)},setUint8:function(e,t){Kg(this,e,t<<24>>24)}},{unsafe:!0})}else yg=(mg=function(e){Vn(this,yg);var t=tg(e);vg(this,{bytes:Eg(kg(t),0),byteLength:t}),E||(this.byteLength=t)}).prototype,Sg=(bg=function(e,t,n){Vn(this,Sg),Vn(e,yg);var r=pg(e).byteLength,i=kt(t);if(i<0||i>r)throw Cg("Wrong offset");if(i+(n=void 0===n?r-i:_t(n))>r)throw Cg("Wrong length");vg(this,{buffer:e,byteLength:n,byteOffset:i}),E||(this.buffer=e,this.byteLength=n,this.byteOffset=i)}).prototype,E&&(Lg(mg,"byteLength"),Lg(bg,"buffer"),Lg(bg,"byteLength"),Lg(bg,"byteOffset")),dv(Sg,{getInt8:function(e){return Pg(this,1,e)[0]<<24>>24},getUint8:function(e){return Pg(this,1,e)[0]},getInt16:function(e){var t=Pg(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Pg(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Og(Pg(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Og(Pg(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return _g(Pg(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return _g(Pg(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Mg(this,1,e,Ag,t)},setUint8:function(e,t){Mg(this,1,e,Ag,t)},setInt16:function(e,t){Mg(this,2,e,Tg,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Mg(this,2,e,Tg,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Mg(this,4,e,Rg,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Mg(this,4,e,Rg,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Mg(this,4,e,Dg,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Mg(this,8,e,Ng,t,arguments.length>2?arguments[2]:void 0)}});Kn(mg,"ArrayBuffer"),Kn(bg,"DataView");var Fg={ArrayBuffer:mg,DataView:bg},zg=Fg.ArrayBuffer,Yg=Fg.DataView,Vg=Yg.prototype,Xg=M(zg.prototype.slice),Wg=M(Vg.getUint8),qg=M(Vg.setUint8),Zg=C((function(){return!new zg(2).slice(1,void 0).byteLength}));qt({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Zg},{slice:function(e,t){if(Xg&&void 0===t)return Xg(Fe(this),e);for(var n=Fe(this).byteLength,r=xt(e,n),i=xt(void 0===t?n:t,n),o=new(Zn(this,zg))(_t(i-r)),a=new Yg(this),s=new Yg(o),c=0;r<i;)qg(s,c++,Wg(a,r++));return o}});var Jg,$g,Qg,em=Xe.f,tm=gt.enforce,nm=gt.get,rm=k.Int8Array,im=rm&&rm.prototype,om=k.Uint8ClampedArray,am=om&&om.prototype,sm=rm&&Va(rm),cm=im&&Va(im),um=Object.prototype,lm=k.TypeError,hm=Te("toStringTag"),dm=Ee("TYPED_ARRAY_TAG"),fm=Qv&&!!jn&&"Opera"!==hn(k.opera),pm=!1,vm={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},gm={BigInt64Array:8,BigUint64Array:8},mm=function(e){var t=Va(e);if(X(t)){var n=nm(t);return n&&Se(n,"TypedArrayConstructor")?n.TypedArrayConstructor:mm(t)}},ym=function(e){if(!X(e))return!1;var t=hn(e);return Se(vm,t)||Se(gm,t)};for(Jg in vm)(Qg=($g=k[Jg])&&$g.prototype)?tm(Qg).TypedArrayConstructor=$g:fm=!1;for(Jg in gm)(Qg=($g=k[Jg])&&$g.prototype)&&(tm(Qg).TypedArrayConstructor=$g);if((!fm||!V(sm)||sm===Function.prototype)&&(sm=function(){throw lm("Incorrect invocation")},fm))for(Jg in vm)k[Jg]&&jn(k[Jg],sm);if((!fm||!cm||cm===um)&&(cm=sm.prototype,fm))for(Jg in vm)k[Jg]&&jn(k[Jg].prototype,cm);if(fm&&Va(am)!==cm&&jn(am,cm),E&&!Se(cm,hm))for(Jg in pm=!0,em(cm,hm,{get:function(){return X(this)?this[dm]:void 0}}),vm)k[Jg]&&We(k[Jg],dm,Jg);var bm={NATIVE_ARRAY_BUFFER_VIEWS:fm,TYPED_ARRAY_TAG:pm&&dm,aTypedArray:function(e){if(ym(e))return e;throw lm("Target is not a typed array")},aTypedArrayConstructor:function(e){if(V(e)&&(!jn||Z(sm,e)))return e;throw lm(ce(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(E){if(n)for(var i in vm){var o=k[i];if(o&&Se(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}cm[e]&&!n||yt(cm,e,n?t:fm&&im[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(E){if(jn){if(n)for(r in vm)if((i=k[r])&&Se(i,e))try{delete i[e]}catch(e){}if(sm[e]&&!n)return;try{return yt(sm,e,n?t:fm&&sm[e]||t)}catch(e){}}for(r in vm)!(i=k[r])||i[e]&&!n||yt(i,e,t)}},getTypedArrayConstructor:mm,isView:function(e){if(!X(e))return!1;var t=hn(e);return"DataView"===t||Se(vm,t)||Se(gm,t)},isTypedArray:ym,TypedArray:sm,TypedArrayPrototype:cm},Sm=bm.NATIVE_ARRAY_BUFFER_VIEWS,wm=k.ArrayBuffer,km=k.Int8Array,Cm=!Sm||!C((function(){km(1)}))||!C((function(){new km(-1)}))||!Fi((function(e){new km,new km(null),new km(1.5),new km(e)}),!0)||C((function(){return 1!==new km(new wm(2),1,void 0).length})),Em=Math.floor,xm=Number.isInteger||function(e){return!X(e)&&isFinite(e)&&Em(e)===e},Im=RangeError,_m=RangeError,Am=function(e,t){var n=function(e){var t=kt(e);if(t<0)throw Im("The argument can't be less than 0");return t}(e);if(n%t)throw _m("Wrong offset");return n},Tm=bm.aTypedArrayConstructor,Rm=function(e){var t,n,r,i,o,a,s=Wn(this),c=ye(e),u=arguments.length,l=u>1?arguments[1]:void 0,h=void 0!==l,d=Oi(c);if(d&&!Ti(d))for(a=(o=Ni(c,d)).next,c=[];!(i=_(a,o)).done;)c.push(i.value);for(h&&u>2&&(l=nr(l,arguments[2])),n=At(c),r=new(Tm(s))(n),t=0;n>t;t++)r[t]=h?l(c[t],t):c[t];return r};y((function(e){var t=Mt.f,n=co.forEach,r=gt.get,i=gt.set,o=gt.enforce,a=Xe.f,s=je.f,c=Math.round,u=k.RangeError,l=Fg.ArrayBuffer,h=l.prototype,d=Fg.DataView,f=bm.NATIVE_ARRAY_BUFFER_VIEWS,p=bm.TYPED_ARRAY_TAG,v=bm.TypedArray,g=bm.TypedArrayPrototype,m=bm.aTypedArrayConstructor,y=bm.isTypedArray,b=function(e,t){m(e);for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i},S=function(e,t){a(e,t,{get:function(){return r(this)[t]}})},w=function(e){var t;return Z(h,e)||"ArrayBuffer"==(t=hn(e))||"SharedArrayBuffer"==t},C=function(e,t){return y(e)&&!ae(t)&&t in e&&xm(+t)&&t>=0},x=function(e,t){return t=Ne(t),C(e,t)?O(2,e[t]):s(e,t)},I=function(e,t,n){return t=Ne(t),!(C(e,t)&&X(n)&&Se(n,"value"))||Se(n,"get")||Se(n,"set")||n.configurable||Se(n,"writable")&&!n.writable||Se(n,"enumerable")&&!n.enumerable?a(e,t,n):(e[t]=n.value,e)};E?(f||(je.f=x,Xe.f=I,S(g,"buffer"),S(g,"byteOffset"),S(g,"byteLength"),S(g,"length")),qt({target:"Object",stat:!0,forced:!f},{getOwnPropertyDescriptor:x,defineProperty:I}),e.exports=function(e,s,h){var m=e.match(/\d+$/)[0]/8,S=e+(h?"Clamped":"")+"Array",C="get"+e,E="set"+e,x=k[S],I=x,A=I&&I.prototype,T={},R=function(e,t){a(e,t,{get:function(){return function(e,t){var n=r(e);return n.view[C](t*m+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=r(e);h&&(n=(n=c(n))<0?0:n>255?255:255&n),i.view[E](t*m+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};f?Cm&&(I=s((function(e,t,n,r){return Vn(e,A),nh(X(t)?w(t)?void 0!==r?new x(t,Am(n,m),r):void 0!==n?new x(t,Am(n,m)):new x(t):y(t)?b(I,t):_(Rm,I,t):new x(tg(t)),e,I)})),jn&&jn(I,v),n(t(x),(function(e){e in I||We(I,e,x[e])})),I.prototype=A):(I=s((function(e,t,n,r){Vn(e,A);var o,a,s,c=0,h=0;if(X(t)){if(!w(t))return y(t)?b(I,t):_(Rm,I,t);o=t,h=Am(n,m);var f=t.byteLength;if(void 0===r){if(f%m)throw u("Wrong length");if((a=f-h)<0)throw u("Wrong length")}else if((a=_t(r)*m)+h>f)throw u("Wrong length");s=a/m}else s=tg(t),o=new l(a=s*m);for(i(e,{buffer:o,byteOffset:h,byteLength:a,length:s,view:new d(o)});c<s;)R(e,c++)})),jn&&jn(I,v),A=I.prototype=Ao(g)),A.constructor!==I&&We(A,"constructor",I),o(A).TypedArrayConstructor=I,p&&We(A,p,S);var O=I!=x;T[S]=I,qt({global:!0,constructor:!0,forced:O,sham:!f},T),"BYTES_PER_ELEMENT"in I||We(I,"BYTES_PER_ELEMENT",m),"BYTES_PER_ELEMENT"in A||We(A,"BYTES_PER_ELEMENT",m),zn(S)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var Om=Math.min,Dm=M([].copyWithin||function(e,t){var n=ye(this),r=At(n),i=xt(e,r),o=xt(t,r),a=arguments.length>2?arguments[2]:void 0,s=Om((void 0===a?r:xt(a,r))-o,r-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in n?n[i]=n[o]:bv(n,i),i+=c,o+=c;return n}),Nm=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("copyWithin",(function(e,t){return Dm(Nm(this),e,t,arguments.length>2?arguments[2]:void 0)}));var Lm=co.every,Pm=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("every",(function(e){return Lm(Pm(this),e,arguments.length>1?arguments[1]:void 0)}));var Mm=TypeError,Bm=function(e){var t=De(e,"number");if("number"==typeof t)throw Mm("Can't convert number to bigint");return BigInt(t)},Gm=bm.aTypedArray,jm=bm.exportTypedArrayMethod,Hm=M("".slice);jm("fill",(function(e){var t=arguments.length;Gm(this);var n="Big"===Hm(hn(this),0,3)?Bm(e):+e;return _(Os,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),C((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var Um=bm.aTypedArrayConstructor,Km=bm.getTypedArrayConstructor,Fm=function(e){return Um(Zn(e,Km(e)))},zm=function(e,t){return function(e,t){for(var n=0,r=At(t),i=new e(r);r>n;)i[n]=t[n++];return i}(Fm(e),t)},Ym=co.filter,Vm=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("filter",(function(e){var t=Ym(Vm(this),e,arguments.length>1?arguments[1]:void 0);return zm(this,t)}));var Xm=co.find,Wm=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("find",(function(e){return Xm(Wm(this),e,arguments.length>1?arguments[1]:void 0)}));var qm=co.findIndex,Zm=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("findIndex",(function(e){return qm(Zm(this),e,arguments.length>1?arguments[1]:void 0)}));var Jm=co.forEach,$m=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("forEach",(function(e){Jm($m(this),e,arguments.length>1?arguments[1]:void 0)}));var Qm=Rt.includes,ey=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("includes",(function(e){return Qm(ey(this),e,arguments.length>1?arguments[1]:void 0)}));var ty=Rt.indexOf,ny=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("indexOf",(function(e){return ty(ny(this),e,arguments.length>1?arguments[1]:void 0)}));var ry=Te("iterator"),iy=k.Uint8Array,oy=M(cs.values),ay=M(cs.keys),sy=M(cs.entries),cy=bm.aTypedArray,uy=bm.exportTypedArrayMethod,ly=iy&&iy.prototype,hy=!C((function(){ly[ry].call([1])})),dy=!!ly&&ly.values&&ly[ry]===ly.values&&"values"===ly.values.name,fy=function(){return oy(cy(this))};uy("entries",(function(){return sy(cy(this))}),hy),uy("keys",(function(){return ay(cy(this))}),hy),uy("values",fy,hy||!dy,{name:"values"}),uy(ry,fy,hy||!dy,{name:"values"});var py=bm.aTypedArray,vy=bm.exportTypedArrayMethod,gy=M([].join);vy("join",(function(e){return gy(py(this),e)}));var my=Math.min,yy=[].lastIndexOf,by=!!yy&&1/[1].lastIndexOf(1,-0)<0,Sy=to("lastIndexOf"),wy=by||!Sy?function(e){if(by)return er(yy,this,arguments)||0;var t=Y(this),n=At(t),r=n-1;for(arguments.length>1&&(r=my(r,kt(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:yy,ky=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return er(wy,ky(this),t>1?[e,arguments[1]]:[e])}));var Cy=co.map,Ey=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("map",(function(e){return Cy(Ey(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Fm(e))(t)}))}));var xy=TypeError,Iy=function(e){return function(t,n,r,i){le(n);var o=ye(t),a=K(o),s=At(o),c=e?s-1:0,u=e?-1:1;if(r<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw xy("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=n(i,a[c],c,o));return i}},_y={left:Iy(!1),right:Iy(!0)},Ay=_y.left,Ty=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return Ay(Ty(this),e,t,t>1?arguments[1]:void 0)}));var Ry=_y.right,Oy=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return Ry(Oy(this),e,t,t>1?arguments[1]:void 0)}));var Dy=bm.aTypedArray,Ny=bm.exportTypedArrayMethod,Ly=Math.floor;Ny("reverse",(function(){for(var e,t=Dy(this).length,n=Ly(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this}));var Py=k.RangeError,My=k.Int8Array,By=My&&My.prototype,Gy=By&&By.set,jy=bm.aTypedArray,Hy=bm.exportTypedArrayMethod,Uy=!C((function(){var e=new Uint8ClampedArray(2);return _(Gy,e,{length:1,0:3},1),3!==e[1]})),Ky=Uy&&bm.NATIVE_ARRAY_BUFFER_VIEWS&&C((function(){var e=new My(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));Hy("set",(function(e){jy(this);var t=Am(arguments.length>1?arguments[1]:void 0,1),n=ye(e);if(Uy)return _(Gy,this,n,t);var r=this.length,i=At(n),o=0;if(i+t>r)throw Py("Wrong length");for(;o<i;)this[t+o]=n[o++]}),!Uy||Ky);var Fy=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("slice",(function(e,t){for(var n=ir(Fy(this),e,t),r=Fm(this),i=0,o=n.length,a=new r(o);o>i;)a[i]=n[i++];return a}),C((function(){new Int8Array(1).slice()})));var zy=co.some,Yy=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("some",(function(e){return zy(Yy(this),e,arguments.length>1?arguments[1]:void 0)}));var Vy=Math.floor,Xy=function(e,t){var n=e.length,r=Vy(n/2);return n<8?Wy(e,t):qy(e,Xy(Ca(e,0,r),t),Xy(Ca(e,r),t),t)},Wy=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},qy=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e},Zy=Xy,Jy=J.match(/firefox\/(\d+)/i),$y=!!Jy&&+Jy[1],Qy=/MSIE|Trident/.test(J),eb=J.match(/AppleWebKit\/(\d+)\./),tb=!!eb&&+eb[1],nb=bm.aTypedArray,rb=bm.exportTypedArrayMethod,ib=k.Uint16Array,ob=ib&&M(ib.prototype.sort),ab=!(!ob||C((function(){ob(new ib(2),null)}))&&C((function(){ob(new ib(2),{})}))),sb=!!ob&&!C((function(){if(ne)return ne<74;if($y)return $y<67;if(Qy)return!0;if(tb)return tb<602;var e,t,n=new ib(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(ob(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));rb("sort",(function(e){return void 0!==e&&le(e),sb?ob(this,e):Zy(nb(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!sb||ab);var cb=bm.aTypedArray;(0,bm.exportTypedArrayMethod)("subarray",(function(e,t){var n=cb(this),r=n.length,i=xt(e,r);return new(Fm(n))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,_t((void 0===t?r:xt(t,r))-i))}));var ub=k.Int8Array,lb=bm.aTypedArray,hb=bm.exportTypedArrayMethod,db=[].toLocaleString,fb=!!ub&&C((function(){db.call(new ub(1))}));hb("toLocaleString",(function(){return er(db,fb?ir(lb(this)):lb(this),ir(arguments))}),C((function(){return[1,2].toLocaleString()!=new ub([1,2]).toLocaleString()}))||!C((function(){ub.prototype.toLocaleString.call([1,2])})));var pb=bm.exportTypedArrayMethod,vb=k.Uint8Array,gb=vb&&vb.prototype||{},mb=[].toString,yb=M([].join);C((function(){mb.call({})}))&&(mb=function(){return yb(this)});var bb=gb.toString!=mb;pb("toString",mb,bb);var Sb=function(){function e(t){n(this,e),this.level=0,this.stream=t}return i(e,[{key:"getAudioLevel",value:function(){if(this.analyser){this.analyser.getByteTimeDomainData(this.timeDomainData);var e=0,t=0,n=this.timeDomainData.length;for(t=0;t<n;t++)e=Math.max(e,Math.abs(this.timeDomainData[t]-128));this.level=e}var r=Math.min(100,100*Number((this.level/64).toFixed(2)));return parseInt(r+"")}},{key:"init",value:function(){var e=window.AudioContext||window.webkitAudioContext;e?(this.audioContext=new e,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2048,this.sourceNode=this.audioContext.createMediaStreamSource(this.stream),this.timeDomainData=new Uint8Array(this.analyser.frequencyBinCount),this.sourceNode.connect(this.analyser)):console.log("init audio content failed: ",e)}}]),e}(),wb=function(t){o(a,Hf);var r=l(a);function a(e){var t;n(this,a),t=r.call(this);var i=e.logger,o=e.client,s=void 0===o?null:o;return t.streams=[],t.pipelineStreams=[],t.contentStreams=[],t.previewStreams=[],t.logger=i,t.client=s,t.isShareContent=!1,t.streamStatus=!0,t.config={devices:{}},t.current={type:"FAILED",detail:""},t.audioDeviceId="",t.videoDeviceId="",t.isFirefox=Na.isFirefox(),t.isReduceResolution=!1,t.isSupportReauthorize=Na.isSupportReauthorize(),t.isSupportAppendTrack=Na.isSupportAppendTrack(),t}return i(a,[{key:"getLocalStream",value:function(){return this.previewStreams}},{key:"getIndexFromStreamChange",value:function(e,t){var n=e.id;return t.findIndex((function(e){return e.streamId===n}))}},{key:"off",value:function(e){this.removeListener(e)}},{key:"handleChangeStream",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.streamChangeInfo,a=0===r?this.streams:this.contentStreams,s=a.length,!Oa||"hidden"!==document.visibilityState||0!==o.length){e.next=6;break}return this.logger.log("not handle set band width when document is hidden in mobile"),e.abrupt("return");case 6:c=0;case 7:if(!(c<s)){e.next=46;break}if(u=a[c],l=u.status,h=u.stream,d=u.resolution,u.type,"NORMAL"!==l){e.next=43;break}f=(null==h?void 0:h.getVideoTracks())||[],p=f.length,v=h?this.getIndexFromStreamChange(h,o):-1,g=0;case 14:if(!(g<p)){e.next=43;break}if(!(m=f[g])){e.next=40;break}if(-1===v){e.next=30;break}return y=o[v],b=y.bandwidth>=100?y.bandwidth:100,e.prev=20,e.next=23,n.setBandWidth(m.id,b,!0,h);case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(20),this.logger.log("[stream]set band width failed:",e.t0);case 28:e.next=40;break;case 30:return e.prev=30,S=Xd[d]||10,e.next=35,n.setBandWidth(m.id,S,!0,h);case 35:e.next=40;break;case 37:e.prev=37,e.t1=e.catch(30),this.logger.log("[stream]reduce band width failed:",e.t1);case 40:g++,e.next=14;break;case 43:c++,e.next=7;break;case 46:case"end":return e.stop()}}),i,this,[[20,25],[30,37]])})))}},{key:"setAudioOutput",value:function(e){var t=this;if(this.logger.log("set audio output device: ".concat(e)),"string"!=typeof e){return this.logger.log("Parameter must be a string"),Promise.reject(Xl("XYSDK:950101"))}return new Promise((function(n,r){var i;try{null===(i=t.client)||void 0===i||i.setAudioOutputDevice(e),n({deviceId:e})}catch(e){r(Xl("XYSDK:950407",e))}}))}},{key:"switchDevice",value:function(t,n){var r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("switch device: type: ".concat(t,", deviceId: ").concat(n)),s=["audio","video"],"string"==typeof t&&s.includes(t)&&"string"==typeof n){e.next=4;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101")));case 4:if(c=null===(r=this.client)||void 0===r?void 0:r.getSelfRoster(),u=(c||{videoTxMute:!1}).videoTxMute,e.prev=6,"audio"!==t||!n){e.next=11;break}return this.audioDeviceId=n,e.next=11,this.replaceAudioTrack();case 11:if("video"!==t||!n){e.next=22;break}if(this.videoDeviceId=n,!this.isSupportReauthorize){e.next=19;break}if(u){e.next=17;break}return e.next=17,this.replaceVideoTrack();case 17:e.next=22;break;case 19:return e.next=21,this.replaceVideoTrack();case 21:u&&this.setStreamStatus("muteVideo");case 22:return null===(o=null===(i=this.client)||void 0===i?void 0:i.deviceManager)||void 0===o||o.setCurrentUsedDeviceByType(t,n),e.abrupt("return",!0);case 26:return e.prev=26,e.t0=e.catch(6),e.abrupt("return",Promise.reject(Xl("XYSDK:950410",e.t0)));case 29:case"end":return e.stop()}}),a,this,[[6,26]])})))}},{key:"sendStreamStatus",value:function(){this.emmit("stream-status",this.current)}},{key:"replaceAudioTrack",value:function(){var t;return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,this.streams.every((function(e){var t;if("180"===e.resolution){var n=(null===(t=e.stream)||void 0===t?void 0:t.getAudioTracks())||[];r=n&&n.length>0,n.forEach((function(t){var n;t.stop(),null===(n=e.stream)||void 0===n||n.removeTrack(t)}))}})),e.prev=2,e.next=5,this.createNextAudioTracks();case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0));case 10:null===(t=this.client)||void 0===t||t.applyVideoOrAudio("audio",!r),this.audioLevel=null;case 12:case"end":return e.stop()}}),n,this,[[2,7]])})))}},{key:"replaceVideoTrack",value:function(){var t,n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(t=this.previewStreams[0])||void 0===t?void 0:t.stream,a=o&&o.getVideoTracks().length>0,!o){e.next=17;break}return e.prev=3,this.isSupportAppendTrack||(this.logger.log("The first step is to delete the track when replaceVideoTrack..."),this.removePreviousVideoTracks(!0)),e.next=7,this.createNextVideoTracks();case 7:this.isSupportAppendTrack&&this.removePreviousVideoTracks(),null===(n=this.client)||void 0===n||n.applyVideoOrAudio("video",!a),null===(r=this.client)||void 0===r||r.sendPeopleCapability(),e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",Promise.reject(e.t0));case 15:e.next=18;break;case 17:return e.abrupt("return",Promise.reject(Xl("XYSDK:950514")));case 18:case"end":return e.stop()}}),i,this,[[3,12]])})))}},{key:"setAudioOrVideoStatus",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("unmuteAudio"!==t&&"unmuteVideo"!==t||"SEND_ONLY"!==this.current.type){e.next=9;break}return a={},s="video","unmuteAudio"===t&&(a={muteAudio:!1},s="audio"),"unmuteVideo"===t&&(a={muteVideo:!1},s="video"),e.next=7,this.init(this.config,a);case 7:return null===(n=this.client)||void 0===n||n.applyVideoOrAudio(s,!0),e.abrupt("return");case 9:if(!this.isSupportReauthorize||"unmuteAudio"!==t){e.next=22;break}if(c=(null===(i=null===(r=this.streams.find((function(e){return"180"===e.resolution})))||void 0===r?void 0:r.stream)||void 0===i?void 0:i.getAudioTracks())||[],c.length>0){e.next=22;break}return e.prev=13,e.next=16,this.replaceAudioTrack();case 16:return e.abrupt("return");case 19:return e.prev=19,e.t0=e.catch(13),e.abrupt("return",Promise.reject(e.t0));case 22:if("muteAudio"!==t&&"unmuteAudio"!==t||this.setStreamStatus(t),"muteVideo"===t&&setTimeout((function(){u.logger.log("setTimeout muteVideo......"),u.setStreamStatus(t)}),10),"unmuteVideo"!==t){e.next=37;break}if(e.prev=25,this.isSupportReauthorize){e.next=30;break}this.setStreamStatus(t),e.next=32;break;case 30:return e.next=32,this.replaceVideoTrack();case 32:e.next=37;break;case 34:return e.prev=34,e.t1=e.catch(25),e.abrupt("return",Promise.reject(e.t1));case 37:case"end":return e.stop()}}),o,this,[[13,19],[25,34]])})))}},{key:"setStreamStatus",value:function(e){var t=this;this.logger.log("setStreamStatus type:",e),this.previewStreams.forEach((function(n){n.stream&&t.setStreamTracksStatus(n.stream,e)})),this.streams.forEach((function(n){n.stream&&t.setStreamTracksStatus(n.stream,e)}))}},{key:"getNextAudioContraints",value:function(e){var t=a.getContraints(!1,!0),n={};return e&&(n={deviceId:{exact:e}}),t.audio&&Object.assign(t.audio,n),this.logger.log("create next audio track contraints:",t),t}},{key:"getNextAudioMedia",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getNextAudioContraints(t),e.prev=1,e.next=4,this.getUserMedia(r);case 4:i=e.sent,e.next=20;break;case 7:return e.prev=7,e.t0=e.catch(1),this.logger.error("create next audio track error:",e.t0),e.prev=10,r=this.getNextAudioContraints(""),e.next=14,this.getUserMedia(r);case 14:i=e.sent,e.next=20;break;case 17:return e.prev=17,e.t1=e.catch(10),e.abrupt("return",Promise.reject(e.t1));case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),n,this,[[1,7],[10,17]])})))}},{key:"createNextAudioTracks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,this.getNextAudioMedia(t);case 4:r=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),i=this.handleCreateStreamError(e.t0),e.abrupt("return",Promise.reject(i));case 11:o=r.getAudioTracks()[0],this.streams.some((function(e){var t;if("180"===e.resolution)return null===(t=e.stream)||void 0===t||t.addTrack(o),!0}));case 13:case"end":return e.stop()}}),n,this,[[1,7]])})))}},{key:"getNextVideoContraints",value:function(e){var t=a.getContraints(!0,!1),n={};return e&&(n={deviceId:{exact:e}}),t.video&&Object.assign(t.video,n),this.logger.log("create next video track contraints:",t),t}},{key:"getNextVideoMedia",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getNextVideoContraints(t),e.prev=1,e.next=4,this.getUserMedia(r);case 4:i=e.sent,e.next=21;break;case 7:return e.prev=7,e.t0=e.catch(1),this.logger.error("create next video track error:",e.t0),e.prev=10,r.video&&(delete r.video.width,delete r.video.height),e.next=14,this.getUserMedia(r);case 14:i=e.sent,e.next=21;break;case 17:return e.prev=17,e.t1=e.catch(10),this.logger.error("create next video track error again:",e.t0),e.abrupt("return",Promise.reject(e.t1));case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),n,this,[[1,7],[10,17]])})))}},{key:"createNextVideoTracks",value:function(){var t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,d,f,p=this;return e().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=null,o.prev=1,o.next=4,this.getNextVideoMedia(i);case 4:a=o.sent,o.next=11;break;case 7:return o.prev=7,o.t0=o.catch(1),s=this.handleCreateStreamError(o.t0),o.abrupt("return",Promise.reject(s));case 11:c=a.getVideoTracks()[0],u=[c.clone(),c.clone(),c.clone()],null===(t=this.previewStreams[0].stream)||void 0===t||t.addTrack(c),l=v(this.streams.entries()),o.prev=15,f=e().mark((function t(){var i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=h(d.value,2),o=i[0],a=i[1],e.prev=1,s=p.getPeopleContraints(Number(a.resolution)),p.isFirefox){e.next=6;break}return e.next=6,u[o].applyConstraints(s);case 6:null===(n=a.stream)||void 0===n||n.addTrack(u[o]),p.streams[o].status="NORMAL",p.logger.log("create next remote track constraints:",s,p.streams),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(1),p.logger.error("new video track apply constraints error: ",e.t0),p.streams[o].status="INVALID",null===(r=p.streams[o].stream)||void 0===r||r.getTracks().forEach((function(e){e.stop(),p.logger.log("disabled track",u[o].id)}));case 16:case"end":return e.stop()}}),t,null,[[1,11]])})),l.s();case 18:if((d=l.n()).done){o.next=22;break}return o.delegateYield(f(),"t1",20);case 20:o.next=18;break;case 22:o.next=27;break;case 24:o.prev=24,o.t2=o.catch(15),l.e(o.t2);case 27:return o.prev=27,l.f(),o.finish(27);case 30:case"end":return o.stop()}}),o,this,[[1,7],[15,24,27,30]])})))}},{key:"removePreviousVideoTracks",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getVideoTracks())||[];if(r||!(i.length<2)){var o=this.getEndedTrack(i);o&&(o.stop(),null===(t=this.previewStreams[0].stream)||void 0===t||t.removeTrack(o)),this.streams.forEach((function(e){var t,r,i=(null===(t=e.stream)||void 0===t?void 0:t.getVideoTracks())||[],o=n.getEndedTrack(i);o&&(o.stop(),null===(r=e.stream)||void 0===r||r.removeTrack(o))}))}}},{key:"getEndedTrack",value:function(e){return e.find((function(e){return"ended"===e.readyState}))||e[0]}},{key:"setStreamTracksStatus",value:function(e,t){var n=this;null==e||e.getTracks().forEach((function(e){if("audio"!==e.kind||"muteAudio"!==t&&"unmuteAudio"!==t||(e.enabled=Qd[t].status),n.isSupportReauthorize)"video"===e.kind&&"muteVideo"===t&&(Qd[t].status||e.stop());else if("video"===e.kind&&("muteVideo"===t||"unmuteVideo"===t)){var r=Qd[t].status;e.enabled=r}}))}},{key:"close",value:function(){this.streamStatus=!1;var e=0;this.clearAudioLevel(),this.streams&&(e+=this.closeStreams(this.streams)),this.pipelineStreams&&(e+=this.closeStreams(this.pipelineStreams)),this.previewStreams&&(e+=this.closeStreams(this.previewStreams)),this.isShareContent&&this.closeContentStream(),this.isShareContent=!1,this.streams=[],this.pipelineStreams=[],this.contentStreams=[],this.previewStreams=[],this.logger.log("stream closed successfully: ",e)}},{key:"closeStreams",value:function(e){var t=0;return e.forEach((function(e){var n;"NORMAL"===e.status&&(null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(e){e.stop(),t+=1})))})),t}},{key:"getMediaStreams",value:function(){return{previewStreams:this.previewStreams,streams:this.streams,pipelineStreams:this.pipelineStreams,contentStreams:this.contentStreams}}},{key:"init",value:function(){var t,n,r,i,o,a,s,c,u,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{devices:{}},h=arguments.length>1?arguments[1]:void 0;return Rn(this,void 0,void 0,e().mark((function d(){var f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("stream init config:",l),this.streamStatus){e.next=3;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950205")));case 3:if(this.client){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950209")));case 5:if(this.config=l,f=(null==l?void 0:l.devices)||{audioInputValue:"",videoInValue:""},p=f.audioInputValue,v=void 0===p?"":p,g=f.videoInValue,m=void 0===g?"":g,y=null===(t=this.client.deviceManager)||void 0===t?void 0:t.getDevicePermission(),b=y.camera,S=y.microphone,w=!0,k=!0,C={type:"NORMAL",detail:"successfully"},w=!(null!==(n=null==h?void 0:h.muteVideo)&&void 0!==n?n:null===(r=this.client)||void 0===r?void 0:r.config.muteVideo),k=!(null!==(i=null==h?void 0:h.muteAudio)&&void 0!==i?i:null===(o=this.client)||void 0===o?void 0:o.config.muteAudio),"denied"===b&&(w=!1,C={type:"AUDIO_ONLY",detail:"Camera is not found or permission denied"}),"denied"===S&&(k=!1,C={type:"VIDEO_ONLY",detail:"Microphone is not found or permission denied"}),this.isSupportReauthorize||(w=!0,k=!0,this.logger.log("[ios] init contraints: ",{video:w,audio:k})),this.current=C,w||k){e.next=21;break}return e.next=20,this.dealWithoutStreams();case 20:return e.abrupt("return",e.sent);case 21:return e.prev=21,e.next=24,this.getStream(w,k,m,v);case 24:return e.abrupt("return",e.sent);case 27:if(e.prev=27,e.t0=e.catch(21),E=this.handleCreateStreamError(e.t0),x=E.code,this.logger.log("get stream is error:",E),!w||"XYSDK:950406"!==x&&"XYSDK:950403"!==x){e.next=46;break}return this.logger.log("Reduce resolution to get stream..."),this.isReduceResolution=!0,e.prev=35,e.next=38,this.getStream(w,k,m,v,!0);case 38:return e.abrupt("return",e.sent);case 41:e.prev=41,e.t1=e.catch(35),E=this.handleCreateStreamError(e.t0),x=E.code,this.logger.log("Reduce resolution to get stream is error:",E);case 46:if(!Wd.includes(x)){e.next=79;break}if(this.logger.log("Init domStream successfully",{status:E,err:e.t0}),!w||!k||"XYSDK:950404"===x){e.next=72;break}return e.prev=49,this.logger.log("only video stream create..."),e.next=53,this.getStream(!0,!1,m,v);case 53:return e.abrupt("return",e.sent);case 56:e.prev=56,e.t2=e.catch(49),this.logger.log("get video stream failed:",e.t2);case 59:return e.prev=59,this.logger.log("only audio stream create..."),e.next=63,this.getStream(!1,!0,m,v);case 63:return e.abrupt("return",e.sent);case 66:e.prev=66,e.t3=e.catch(59),this.logger.log("get audio stream failed:",e.t3);case 69:return e.next=71,this.dealWithoutStreams();case 71:return e.abrupt("return",e.sent);case 72:return I=null===(s=null===(a=this.client)||void 0===a?void 0:a.deviceManager)||void 0===s?void 0:s.getDevicePermission(),_=I.camera,A=I.microphone,null===(u=null===(c=this.client)||void 0===c?void 0:c.deviceManager)||void 0===u||u.setPermission({camera:w&&"unknown"===_?"denied":_,microphone:k&&"unknown"===A?"denied":A}),e.next=76,this.dealWithoutStreams();case 76:return e.abrupt("return",e.sent);case 79:return this.logger.warn("Init stream failed",{status:E,err:e.t0}),this.current={type:"FAILED",detail:E},e.abrupt("return",Promise.reject(Xl("XYSDK:950208",Object.assign({status:E},this.current))));case 82:case"end":return e.stop()}}),d,this,[[21,27],[35,41],[49,56],[59,66]])})))}},{key:"getPeopleContraints",value:function(e){return this.isReduceResolution||this.isFirefox?Yd[e].common:Yd[e].advanced}},{key:"getContentContraints",value:function(e){return this.isReduceResolution||this.isFirefox?zd[e].common:zd[e].advanced}},{key:"getStream",value:function(t,n,r,i){var o,a,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Rn(this,void 0,void 0,e().mark((function c(){var u,l,h,d,f;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u=this.getInitContraints(t,n,r,i,s),this.logger.log("init contraints:",u),e.next=5,this.getUserMedia(u);case 5:return l=e.sent,(null===(o=null==u?void 0:u.audio)||void 0===o?void 0:o.echoCancellation)&&l.getAudioTracks()[0].applyConstraints({echoCancellation:!0}),this.logger.log("base remote stream: ",l),e.next=10,this.initStreams(l);case 10:return this.streamStatus||this.close(),(null===(a=this.client)||void 0===a?void 0:a.deviceManager)&&(h=this.client.deviceManager.getDevicePermission(),d=h.camera,f=h.microphone,this.client.deviceManager.setPermission({camera:t?"granted":d,microphone:n?"granted":f})),this.emmit("local-stream",this.previewStreams),e.abrupt("return",Xl("XYSDK:950206",this.previewStreams));case 16:return e.prev=16,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),c,this,[[0,16]])})))}},{key:"dealWithoutStreams",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Xl("XYSDK:950405"),this.current={type:this.isSupportReauthorize?"SEND_ONLY":"FAILED",detail:t||r.msg},e.next=4,this.initStreams(null);case 4:return e.abrupt("return",Xl("XYSDK:950207",this.current));case 5:case"end":return e.stop()}}),n,this)})))}},{key:"getInitContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={};i&&(o={width:jd,height:Hd});var s=a.getContraints(e,t,o);if(r&&"default"!==r){var c={deviceId:{exact:r}};this.audioDeviceId=r,s.audio&&Object.assign(s.audio,c)}if(n){var u={deviceId:{exact:n}};this.videoDeviceId=n,s.video&&Object.assign(s.video,u)}return this.logger.log("get init constraints: ",s),s}},{key:"initStreams",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initPreviewStream(t);case 2:return e.next=4,this.initRemoteStreams(t);case 4:this.initPipelineStreams();case 5:case"end":return e.stop()}}),n,this)})))}},{key:"initPipelineStreams",value:function(){for(var e=[],t=this.streams.filter((function(t){var n,r;return"NORMAL"===t.status&&((null===(n=t.stream)||void 0===n?void 0:n.getAudioTracks()[0])||e.push({type:"audio"}),(null===(r=t.stream)||void 0===r?void 0:r.getVideoTracks()[0])||e.push({type:"video"})),"NORMAL"===t.status})).length,n=1;n<=11-t;n++)e.push({type:"all"});var r=0;this.pipelineStreams=e.map((function(e){r++;var t=[{kind:"video"},{kind:"audio"}];return"all"!==e.type&&(t=[{kind:e.type}]),{stream:null,domStream:t,status:"DOMSTRING",type:"pipelineStream",resolution:"90"}})),this.logger.log("temp stream count:",r)}},{key:"initRemoteStreams",value:function(t){var n,r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u,l,d,f,p,g=this;return e().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!t){a.next=29;break}if(!this.isFirefox){a.next=5;break}this.initFirefoxRemoteStreams(t),a.next=27;break;case 5:s=t.clone(),c=t.clone(),s.getAudioTracks().forEach((function(e){e.stop(),s.removeTrack(e)})),c.getAudioTracks().forEach((function(e){e.stop(),c.removeTrack(e)})),u={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},u),{stream:t}),Object.assign(Object.assign({},u),{stream:s,resolution:"360"}),Object.assign(Object.assign({},u),{stream:c,resolution:"720"})],l=v(this.streams.entries()),a.prev=12,f=e().mark((function t(){var a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=h(d.value,2),s=a[0],c=a[1],!(u=null===(n=c.stream)||void 0===n?void 0:n.getVideoTracks()[0])){e.next=15;break}return e.prev=3,l=g.getPeopleContraints(Number(c.resolution)),e.next=7,u.applyConstraints(l);case 7:g.logger.log("init remote track constraints:",l,null===(r=c.stream)||void 0===r?void 0:r.id,u.getSettings()),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(3),g.logger.error("init remote track constraints failed:",e.t0,null===(i=c.stream)||void 0===i?void 0:i.id),g.streams[s].status="INVALID",null===(o=g.streams[s].stream)||void 0===o||o.getTracks().forEach((function(e){e.stop(),g.logger.log("disabled track",u.id)}));case 15:case"end":return e.stop()}}),t,null,[[3,10]])})),l.s();case 15:if((d=l.n()).done){a.next=19;break}return a.delegateYield(f(),"t0",17);case 17:a.next=15;break;case 19:a.next=24;break;case 21:a.prev=21,a.t1=a.catch(12),l.e(a.t1);case 24:return a.prev=24,l.f(),a.finish(24);case 27:a.next=32;break;case 29:p={stream:null,domStream:[{kind:"video"},{kind:"audio"}],status:"DOMSTRING",type:"remoteStream",resolution:"90"},this.streams=[Object.assign(Object.assign({},p),{resolution:"180"}),Object.assign(Object.assign({},p),{resolution:"360"}),Object.assign(Object.assign({},p),{resolution:"720"})],this.logger.log("None remote stream, init dom stream: ",this.streams);case 32:case"end":return a.stop()}}),a,this,[[12,21,24,27]])})))}},{key:"initFirefoxRemoteStreams",value:function(t){var n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=t.clone(),a=t.clone(),null===(n=o.getAudioTracks()[0])||void 0===n||n.stop(),null===(r=a.getAudioTracks()[0])||void 0===r||r.stop(),s={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},s),{stream:t,resolution:"720"}),Object.assign(Object.assign({},s),{stream:a,resolution:"360"}),Object.assign(Object.assign({},s),{stream:o})];case 6:case"end":return e.stop()}}),i,this)})))}},{key:"initPreviewStream",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=16;break}if(e.prev=1,a={stream:t.clone(),domStream:[],status:"NORMAL",type:"previewStream",resolution:"360"},this.isFirefox){e.next=6;break}return e.next=6,null===(r=null===(n=a.stream)||void 0===n?void 0:n.getVideoTracks()[0])||void 0===r?void 0:r.applyConstraints(this.getPeopleContraints(360));case 6:null===(i=a.stream)||void 0===i||i.getAudioTracks().forEach((function(e){e.stop()})),this.logger.log("init local stream successfully"),this.previewStreams=[a],e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),this.logger.error("init local constraints failed: ",e.t0);case 14:e.next=18;break;case 16:s={stream:null,domStream:[{kind:"video"}],status:"DOMSTRING",type:"previewStream",resolution:"360"},this.previewStreams=[s];case 18:case"end":return e.stop()}}),o,this,[[1,11]])})))}},{key:"setClientObj",value:function(e){this.client=e,this.updateDeviceByLocalStream()}},{key:"updateDeviceByLocalStream",value:function(){var e,t,n,r,i,o,a,s,c,u;if("NORMAL"===this.current.type||"AUDIO_ONLY"===this.current.type||"VIDEO_ONLY"===this.current.type){var l=null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getAudioTracks()[0],h=null===(t=this.previewStreams[0].stream)||void 0===t?void 0:t.getVideoTracks()[0],d=null==l?void 0:l.getSettings(),f=null==h?void 0:h.getSettings(),p={audioInput:d?{deviceId:d.deviceId||"",groupId:d.groupId||"",label:(null==l?void 0:l.label)||""}:{deviceId:(null===(r=null===(n=this.config)||void 0===n?void 0:n.devices)||void 0===r?void 0:r.audioInputValue)||"default",groupId:"",label:""},videoInput:f?{deviceId:f.deviceId||"",groupId:f.groupId||"",label:(null==h?void 0:h.label)||""}:{deviceId:(null===(o=null===(i=this.config)||void 0===i?void 0:i.devices)||void 0===o?void 0:o.videoInValue)||"",groupId:"",label:""},audioOutput:{deviceId:(null===(s=null===(a=this.config)||void 0===a?void 0:a.devices)||void 0===s?void 0:s.audioOutputValue)||"default",groupId:"",label:""}};this.logger.log("Cache preview stream device info by tracks: ",p),null===(u=null===(c=this.client)||void 0===c?void 0:c.deviceManager)||void 0===u||u.setCurrentUsedDevice(p)}}},{key:"getAudioLevel",value:function(e){var t=this;return new Promise((function(n,r){var i;if(e?i=e:t.streams.length&&(i=t.streams[0].stream),i&&!t.audioLevel)t.audioLevel=new Sb(i),t.audioLevel.init(),n(t.audioLevel.getAudioLevel());else if(t.audioLevel){n(t.audioLevel.getAudioLevel())}else t.client&&(t.client.logger.warn("GetAudio level must need have local stream!"),r(Xl("XYSDK:950514")))}))}},{key:"clearAudioLevel",value:function(){this.audioLevel=null}},{key:"closeContentStream",value:function(){var e=this;if(this.logger.log("close content stream"),this.isShareContent){this.off("start-share-content"),this.off("stop-share-content"),this.contentStreams.forEach((function(t,n){var r;null===(r=t.stream)||void 0===r||r.getTracks().forEach((function(t){var r;t.stop(),t.onended=null,null===(r=e.contentStreams[n].stream)||void 0===r||r.removeTrack(t)})),e.contentStreams[n].status="INVALID"})),this.isShareContent=!1,this.logger.log("content stream closed successfully")}}},{key:"createContentStream",value:function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{screenAudio:!1},r=n.screenAudio;return Rn(this,void 0,void 0,e().mark((function n(){var i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[stream] createContentStream func"),!this.isShareContent){e.next=4;break}return this.logger.warn("Already share content!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950509")));case 4:return e.prev=4,r&&(null===(t=this.client)||void 0===t||t.setContentMode("BOTH")),this.createBaseContentStreams(),i={video:this.getContentContraints(1080),audio:r},this.logger.log("create content contraints:",i),e.next=11,navigator.mediaDevices.getDisplayMedia(i);case 11:return o=e.sent,e.next=14,this.dealCaptureStream(o);case 14:return this.logger.log("capture content stream success... "),e.abrupt("return",this.contentStreams);case 18:return e.prev=18,e.t0=e.catch(4),this.logger.error("capture content stream failed: ",e.t0),this.isShareContent=!1,e.abrupt("return",Promise.reject(this.handleCreateContentStreamError(e.t0)));case 23:case"end":return e.stop()}}),n,this,[[4,18]])})))}},{key:"electronCapture",value:function(e){var t=this;return new Promise((function(n,r){navigator.webkitGetUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,minWidth:1920,maxWidth:1920,minHeight:1080,maxHeight:1080}}},(function(e){n(e)}),(function(e){t.logger.log("capture electron err: ",e),r(e)}))}))}},{key:"getElectronContentSources",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["window","screen"];return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.getSources({types:n});case 3:return i=e.sent,e.abrupt("return",i);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",e.t0);case 10:case"end":return e.stop()}}),r,null,[[0,7]])})))}},{key:"createElectronContentStream",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isShareContent){e.next=3;break}return this.logger.warn("Already share content!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950509")));case 3:if(t){e.next=6;break}return this.logger.warn("No selected sourceId!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950510")));case 6:return this.createBaseContentStreams(),e.prev=7,e.next=10,this.electronCapture(t);case 10:return r=e.sent,e.next=13,this.dealCaptureStream(r);case 13:return e.abrupt("return",this.contentStreams);case 16:return e.prev=16,e.t0=e.catch(7),this.logger.error("capture electron content stream failed: ",e.t0),this.isShareContent=!1,e.abrupt("return",this.handleCreateContentStreamError(e.t0));case 21:case"end":return e.stop()}}),n,this,[[7,16]])})))}},{key:"getPreviewStream",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{video:{},audio:{}};return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=r.video,a=void 0===o?{}:o,s=r.audio,c=void 0===s?{}:s,u={},t&&(u.video=Object.assign({},Kd,a)),n&&(u.audio=Object.assign({},c)),this.logger.log("get preview stream constraints:",u),e.next=8,this.getUserMedia(u);case 8:return l=e.sent,e.abrupt("return",l);case 12:return e.prev=12,e.t0=e.catch(0),h=this.handleCreateStreamError(e.t0),e.abrupt("return",Promise.reject(h));case 16:case"end":return e.stop()}}),i,this,[[0,12]])})))}},{key:"getUserMedia",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.logger.log("get user media constraints:",t),e.next=4,navigator.mediaDevices.getUserMedia(t);case 4:return r=e.sent,this.logger.log("get user media active:",r.active),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 12:case"end":return e.stop()}}),n,this,[[0,9]])})))}},{key:"handleCloseShareContentEvent",value:function(e,t){var n=this,r=!1,i=!1;e.onended=function(){(r=!0)&&i&&n.emmit("stop-share-content",{})},t.onended=function(){i=!0,r&&i&&n.emmit("stop-share-content",{})}}},{key:"dealCaptureStream",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getVideoTracks()[0],i=r.clone(),o=this.getContentContraints(720),a=t.getAudioTracks()[0],e.prev=4,e.next=7,i.applyConstraints(o);case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(4),this.streams[1].status="INVALID",this.logger.error("set 720p content stream contraints error: ",e.t0);case 13:this.handleCloseShareContentEvent(r,i),this.updateContentStreamTrack(r,i,a),this.client&&this.client.applyShareContent(),this.logger.log("create share content stream: ",this.contentStreams);case 17:case"end":return e.stop()}}),n,this,[[4,9]])})))}},{key:"createBaseContentStreams",value:function(){if(this.isShareContent=!0,!this.contentStreams.length){var e=new MediaStream,t=new MediaStream;this.contentStreams=[{type:"contentStream",stream:e,domStream:[],status:"NORMAL",resolution:"1080"},{type:"contentStream",stream:t,domStream:[],status:"NORMAL",resolution:"720"}]}}},{key:"updateContentStreamTrack",value:function(e,t,n){var r=this;this.contentStreams=this.contentStreams.map((function(i){var o,a;return i.stream&&("1080"===i.resolution?i.stream.addTrack(e):(i.stream.addTrack(t),n&&(i.stream.addTrack(n),null===(o=r.client)||void 0===o||o.reSendContentOffer(),r.logger.log("content audio stream:",null===(a=i.stream)||void 0===a?void 0:a.id),r.logger.log("content audio track:",n.id)))),Object.assign(Object.assign({},i),{status:"NORMAL",isSupport:!0})}))}},{key:"handleCreateContentStreamError",value:function(e){var t=e.name,n=e.message;return Xl("NotAllowedError"===t?"Permission denied by system"===n?"XYSDK:950508":"Permission denied"===n?"XYSDK:950501":"XYSDK:950511":"InvalidStateError"===t?"XYSDK:950502":"AbortError"===t?"XYSDK:950503":"NotFoundError"===t?"XYSDK:950504":"NotReadableError"===t?"XYSDK:950505":"OverconstrainedError"===t?"XYSDK:950506":"TypeError"===t?"XYSDK:950507":"XYSDK:950503",e)}},{key:"handleCreateStreamError",value:function(e){var t={code:"",msg:"",detail:""};return t="NotFoundError"==e.name||"DevicesNotFoundError"==e.name?Xl("XYSDK:950401",e):"NotReadableError"==e.name||"TrackStartError"==e.name?Xl("XYSDK:950402",e):"OverconstrainedError"==e.name||"ConstraintNotSatisfiedError"==e.name?Xl("XYSDK:950403",e):"NotAllowedError"==e.name||"PermissionDeniedError"==e.name||e.message.includes("NotAllowedError")?Xl("XYSDK:950404",e):"TypeError"==e.name||"TypeError"==e.name?Xl("XYSDK:950405",e):Xl("XYSDK:950406",e),this.logger.error(t),t}}],[{key:"getStreamInstance",value:function(e){return this.instance||(this.instance=new a(e)),this.instance}},{key:"getContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=a.getSupportConstraints(),i={},o={},s={audio:i,video:o},c=n.channelCount,u=void 0===c?1:c,l=n.autoGainControl,h=void 0===l||l,d=n.noiseSuppression,f=void 0===d||d,p=n.echoCancellation,v=void 0===p||p,g=n.frameRate,m=void 0===g?Kd.frameRate:g,y=n.aspectRatio,b=void 0===y?Kd.aspectRatio:y,S=n.resizeMode,w=void 0===S?Kd.resizeMode:S,k=n.width,C=void 0===k?Bd:k,E=n.height,x=void 0===E?Gd:E,I={channelCount:u,autoGainControl:h,noiseSuppression:f,echoCancellation:v},_=Object.assign({aspectRatio:b,resizeMode:w,width:C,height:x},m&&{frameRate:m});return Object.keys(I).forEach((function(e){i[e]=I[e]})),Object.keys(_).forEach((function(e){r[e]&&(o[e]=_[e])})),s.audio=!!t&&i,s.video=!!e&&o,s}},{key:"getSupportConstraints",value:function(){var e={channelCount:!0,frameRate:!0,aspectRatio:!0,width:!0,height:!0};return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&(e=navigator.mediaDevices.getSupportedConstraints()),e}}]),a}(),kb="*********************************************************",Cb={version:bf,client:null,checkSupportWebRTC:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Na.isSupportRTC();case 2:return n=e.sent,e.next=5,Na.isSupportUserMedia();case 5:return r=e.sent,i=Na.isSupportWebsocket(),o=Na.isMobile(),a=Na.isMinBrowser(),e.next=11,Na.isSupportH264();case 11:return s=e.sent,c=n.isSupportRTC,u=n.isSupportAddTransceiver,l=n.isSupportAddtrack,h={result:(a||o)&&c&&i&&s,detail:{isSupportRTC:c,isSupportWebsocket:i,isSupportBrowser:a,isSupportMobileBrowser:o,isSupportH264:s,isSupportAddTransceiver:u,isSupportAddtrack:l,isSupportUserMedia:r}},Cb.logger.debug("desktop support result: ",h),e.abrupt("return",h);case 17:case"end":return e.stop()}}),t)})))},checkSupportMobileWebRTC:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Na.isMobile(),e.next=3,Cb.checkSupportWebRTC();case 3:return r=e.sent,i=r.detail,o=i.isSupportRTC,a=i.isSupportWebsocket,s=i.isSupportH264,c={result:n&&o&&a&&s,detail:Object.assign({},r.detail)},Cb.logger.debug("mobile support result: ",c),e.abrupt("return",c);case 9:case"end":return e.stop()}}),t)})))},checkSupportShareContent:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)},setLocale:function(e){!function(e){Fl=["en_US","zh_CN","zh_TW"].find((function(t){return t.toUpperCase()===e.toUpperCase()}))||"zh_CN"}(e)},logger:new Ef,createClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clientId:"",clientSecret:""},t=Cb.logger,n=Sf,r=wf,i=kf,o={wssServer:n,httpServer:r,logServer:i,layout:"AUTO",debug:!1,muteAudio:!1,muteVideo:!1,localHide:!1,localMirror:!0,isThird:!0,isVerifyMeetingId:!0,clientId:"",clientSecret:""},a=e.container||{},s=Object.assign(Object.assign(Object.assign({},o),e),{container:a}),c=s.wssServer,u=void 0===c?"":c,l=s.httpServer,h=void 0===l?"":l,d=s.logServer,f=void 0===d?"":d,p=s.clientId,v=void 0===p?"":p,g=s.clientSecret,m=void 0===g?"":g;Cf.setBaseUrl(h,f),Cf.setClientInfo({clientId:v,clientSecret:m});var y=new $v(s,{wssServer:u,httpServer:h,logServer:f},t);return Cb.client=y,y},createStream:function(){var e=Cb.logger;return new wb({logger:e,client:Cb.client})},setConfig:function(e){Cf.setLoginInfo(e);var t=e||{},n=t.client_id,r=t.client_secret;n&&Cf.setClientInfo({clientId:n,clientSecret:r})},closePreviewStream:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t&&t.getTracks().forEach((function(e){e.enabled=!1,e.stop()}));case 1:case"end":return e.stop()}}),n)})))},setOutputAudioDevice:function(e,t){e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){})).catch((function(e){var t=e;"SecurityError"===(null==e?void 0:e.name)&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),console.error(t)})):console.warn("Browser does not support output device selection.")},render:(console.group("小鱼易连 WebRTC SDK"),console.info("%c".concat(kb," \n\t\n * 欢迎使用 XY RTC SDK - 小鱼易连Web云视频 \n\t\n * 版本:").concat(bf," \n\t\n * 文档地址:https://openapi.xylink.com/common/meeting/doc/description?platform=web \n\t\n * 体验地址:https://cdn.xylink.com/webrtc/web/index.html \n\t\n * 问题反馈:https://github.com/xylink-com/xylink-rtc-demo/issues \n\t\n * 联系方式:luojinghui(luojinghui424@gmail.com) \n\n").concat(kb),"color: #3876ff;"),console.info("%c[INFO] XY Agent:"+navigator.userAgent+"\n","color: #3876ff;"),void console.groupEnd())};window.xyRTC={logger:Cb.logger},exports.Client=$v,exports.DeviceManager=rv,exports.ERROR_CODE=jl,exports.Stream=wb,exports.default=Cb,exports.detectLocator=function(t){var n=t.extId,r=t.clientId,i=t.clientSecret,o=t.httpServer;return Rn(void 0,void 0,void 0,e().mark((function t(){var a,s,c,u;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n&&r&&i||Promise.reject(Xl("XYSDK:950101")),a="",t.prev=2,t.next=5,Cf.getEnterpriseId({extId:n,clientId:r,clientSecret:i,httpServer:o});case 5:if(!(s=t.sent)){t.next=21;break}return t.next=9,Cf.locator({extId:s,clientId:r,clientSecret:i,httpServer:o});case 9:if(c=t.sent,!((u=c.filter((function(e){return"WebrtcSigGW"===e.serverName}))).length>0)){t.next=20;break}return t.prev=12,t.next=15,new Promise((function(t,n){var r=u.length;u.map((function(i){return Rn(void 0,void 0,void 0,e().mark((function o(){var a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.innerIp.split(":")[0],e.prev=1,"https:",e.next=5,Pd.get("".concat("https:","//").concat(a),{timeout:2e3});case 5:t(i.innerIp),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),0===--r&&n("All promises were rejected");case 12:case"end":return e.stop()}}),o,null,[[1,8]])})))}))}));case 15:a=t.sent,t.next=20;break;case 18:t.prev=18,t.t0=t.catch(12);case 20:case 21:return t.abrupt("return",a);case 24:return t.prev=24,t.t1=t.catch(2),t.abrupt("return",Promise.reject(t.t1));case 27:case"end":return t.stop()}}),t,null,[[2,24],[12,18]])})))},exports.getLayoutItemState=Rv,exports.getLayoutRotateInfo=Dv,exports.getSendSupportedCodec=Nv,exports.getVideoInfoByRotaion=Ov;
|
|
3
|
+
e=function(){return t};var t={},n=Object.prototype,r=n.hasOwnProperty,i="function"==typeof Symbol?Symbol:{},o=i.iterator||"@@iterator",a=i.asyncIterator||"@@asyncIterator",s=i.toStringTag||"@@toStringTag";function c(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{c({},"")}catch(e){c=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof d?t:d,o=Object.create(i.prototype),a=new E(r||[]);return o._invoke=function(e,t,n){var r="suspendedStart";return function(i,o){if("executing"===r)throw new Error("Generator is already running");if("completed"===r){if("throw"===i)throw o;return I()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===h)continue;return s}}if("next"===n.method)n.sent=n._sent=n.arg;else if("throw"===n.method){if("suspendedStart"===r)throw r="completed",n.arg;n.dispatchException(n.arg)}else"return"===n.method&&n.abrupt("return",n.arg);r="executing";var c=l(e,t,n);if("normal"===c.type){if(r=n.done?"completed":"suspendedYield",c.arg===h)continue;return{value:c.arg,done:n.done}}"throw"===c.type&&(r="completed",n.method="throw",n.arg=c.arg)}}}(e,n,a),o}function l(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}t.wrap=u;var h={};function d(){}function f(){}function p(){}var v={};c(v,o,(function(){return this}));var g=Object.getPrototypeOf,m=g&&g(g(x([])));m&&m!==n&&r.call(m,o)&&(v=m);var y=p.prototype=d.prototype=Object.create(v);function b(e){["next","throw","return"].forEach((function(t){c(e,t,(function(e){return this._invoke(t,e)}))}))}function S(e,t){var n;this._invoke=function(i,o){function a(){return new t((function(n,a){!function n(i,o,a,s){var c=l(e[i],e,o);if("throw"!==c.type){var u=c.arg,h=u.value;return h&&"object"==typeof h&&r.call(h,"__await")?t.resolve(h.__await).then((function(e){n("next",e,a,s)}),(function(e){n("throw",e,a,s)})):t.resolve(h).then((function(e){u.value=e,a(u)}),(function(e){return n("throw",e,a,s)}))}s(c.arg)}(i,o,n,a)}))}return n=n?n.then(a,a):a()}}function w(e,t){var n=e.iterator[t.method];if(void 0===n){if(t.delegate=null,"throw"===t.method){if(e.iterator.return&&(t.method="return",t.arg=void 0,w(e,t),"throw"===t.method))return h;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return h}var r=l(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,h;var i=r.arg;return i?i.done?(t[e.resultName]=i.value,t.next=e.nextLoc,"return"!==t.method&&(t.method="next",t.arg=void 0),t.delegate=null,h):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,h)}function k(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function C(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function E(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[o];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var n=-1,i=function t(){for(;++n<e.length;)if(r.call(e,n))return t.value=e[n],t.done=!1,t;return t.value=void 0,t.done=!0,t};return i.next=i}}return{next:I}}function I(){return{value:void 0,done:!0}}return f.prototype=p,c(y,"constructor",p),c(p,"constructor",f),f.displayName=c(p,s,"GeneratorFunction"),t.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===f||"GeneratorFunction"===(t.displayName||t.name))},t.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,p):(e.__proto__=p,c(e,s,"GeneratorFunction")),e.prototype=Object.create(y),e},t.awrap=function(e){return{__await:e}},b(S.prototype),c(S.prototype,a,(function(){return this})),t.AsyncIterator=S,t.async=function(e,n,r,i,o){void 0===o&&(o=Promise);var a=new S(u(e,n,r,i),o);return t.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},b(y),c(y,s,"Generator"),c(y,o,(function(){return this})),c(y,"toString",(function(){return"[object Generator]"})),t.keys=function(e){var t=[];for(var n in e)t.push(n);return t.reverse(),function n(){for(;t.length;){var r=t.pop();if(r in e)return n.value=r,n.done=!1,n}return n.done=!0,n}},t.values=x,E.prototype={constructor:E,reset:function(e){if(this.prev=0,this.next=0,this.sent=this._sent=void 0,this.done=!1,this.delegate=null,this.method="next",this.arg=void 0,this.tryEntries.forEach(C),!e)for(var t in this)"t"===t.charAt(0)&&r.call(this,t)&&!isNaN(+t.slice(1))&&(this[t]=void 0)},stop:function(){this.done=!0;var e=this.tryEntries[0].completion;if("throw"===e.type)throw e.arg;return this.rval},dispatchException:function(e){if(this.done)throw e;var t=this;function n(n,r){return a.type="throw",a.arg=e,t.next=n,r&&(t.method="next",t.arg=void 0),!!r}for(var i=this.tryEntries.length-1;i>=0;--i){var o=this.tryEntries[i],a=o.completion;if("root"===o.tryLoc)return n("end");if(o.tryLoc<=this.prev){var s=r.call(o,"catchLoc"),c=r.call(o,"finallyLoc");if(s&&c){if(this.prev<o.catchLoc)return n(o.catchLoc,!0);if(this.prev<o.finallyLoc)return n(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return n(o.catchLoc,!0)}else{if(!c)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return n(o.finallyLoc)}}}},abrupt:function(e,t){for(var n=this.tryEntries.length-1;n>=0;--n){var i=this.tryEntries[n];if(i.tryLoc<=this.prev&&r.call(i,"finallyLoc")&&this.prev<i.finallyLoc){var o=i;break}}o&&("break"===e||"continue"===e)&&o.tryLoc<=t&&t<=o.finallyLoc&&(o=null);var a=o?o.completion:{};return a.type=e,a.arg=t,o?(this.method="next",this.next=o.finallyLoc,h):this.complete(a)},complete:function(e,t){if("throw"===e.type)throw e.arg;return"break"===e.type||"continue"===e.type?this.next=e.arg:"return"===e.type?(this.rval=this.arg=e.arg,this.method="return",this.next="end"):"normal"===e.type&&t&&(this.next=t),h},finish:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.finallyLoc===e)return this.complete(n.completion,n.afterLoc),C(n),h}},catch:function(e){for(var t=this.tryEntries.length-1;t>=0;--t){var n=this.tryEntries[t];if(n.tryLoc===e){var r=n.completion;if("throw"===r.type){var i=r.arg;C(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:x(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),h}},t}function t(e){return(t="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}function n(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function r(e,t){for(var n=0;n<t.length;n++){var r=t[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(e,r.key,r)}}function i(e,t,n){return t&&r(e.prototype,t),n&&r(e,n),Object.defineProperty(e,"prototype",{writable:!1}),e}function o(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),Object.defineProperty(e,"prototype",{writable:!1}),t&&s(e,t)}function a(e){return(a=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function s(e,t){return(s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(e,t){return e.__proto__=t,e})(e,t)}function c(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function u(e,t){if(t&&("object"==typeof t||"function"==typeof t))return t;if(void 0!==t)throw new TypeError("Derived constructors may only return object or undefined");return c(e)}function l(e){var t=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],(function(){}))),!0}catch(e){return!1}}();return function(){var n,r=a(e);if(t){var i=a(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return u(this,n)}}function h(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){var n=null==e?null:"undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(null==n)return;var r,i,o=[],a=!0,s=!1;try{for(n=n.call(e);!(a=(r=n.next()).done)&&(o.push(r.value),!t||o.length!==t);a=!0);}catch(e){s=!0,i=e}finally{try{a||null==n.return||n.return()}finally{if(s)throw i}}return o}(e,t)||f(e,t)||function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function d(e){return function(e){if(Array.isArray(e))return p(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||f(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}()}function f(e,t){if(e){if("string"==typeof e)return p(e,t);var n=Object.prototype.toString.call(e).slice(8,-1);return"Object"===n&&e.constructor&&(n=e.constructor.name),"Map"===n||"Set"===n?Array.from(e):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?p(e,t):void 0}}function p(e,t){(null==t||t>e.length)&&(t=e.length);for(var n=0,r=new Array(t);n<t;n++)r[n]=e[n];return r}function v(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=f(e))||t&&e&&"number"==typeof e.length){n&&(e=n);var r=0,i=function(){};return{s:i,n:function(){return r>=e.length?{done:!0}:{done:!1,value:e[r++]}},e:function(e){throw e},f:i}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var o,a=!0,s=!1;return{s:function(){n=n.call(e)},n:function(){var e=n.next();return a=e.done,e},e:function(e){s=!0,o=e},f:function(){try{a||null==n.return||n.return()}finally{if(s)throw o}}}}Object.defineProperty(exports,"__esModule",{value:!0});var g="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function m(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function y(e,t){return e(t={exports:{}},t.exports),t.exports}var b,S,w=function(e){return e&&e.Math==Math&&e},k=w("object"==typeof globalThis&&globalThis)||w("object"==typeof window&&window)||w("object"==typeof self&&self)||w("object"==typeof g&&g)||function(){return this}()||Function("return this")(),C=function(e){try{return!!e()}catch(e){return!0}},E=!C((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),x=!C((function(){var e=function(){}.bind();return"function"!=typeof e||e.hasOwnProperty("prototype")})),I=Function.prototype.call,_=x?I.bind(I):function(){return I.apply(I,arguments)},A={}.propertyIsEnumerable,T=Object.getOwnPropertyDescriptor,R={f:T&&!A.call({1:2},1)?function(e){var t=T(this,e);return!!t&&t.enumerable}:A},O=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},D=Function.prototype,N=D.bind,L=D.call,P=x&&N.bind(L,L),M=x?function(e){return e&&P(e)}:function(e){return e&&function(){return L.apply(e,arguments)}},B=M({}.toString),G=M("".slice),j=function(e){return G(B(e),8,-1)},H=Object,U=M("".split),K=C((function(){return!H("z").propertyIsEnumerable(0)}))?function(e){return"String"==j(e)?U(e,""):H(e)}:H,F=TypeError,z=function(e){if(null==e)throw F("Can't call method on "+e);return e},Y=function(e){return K(z(e))},V=function(e){return"function"==typeof e},X=function(e){return"object"==typeof e?null!==e:V(e)},W=function(e){return V(e)?e:void 0},q=function(e,t){return arguments.length<2?W(k[e]):k[e]&&k[e][t]},Z=M({}.isPrototypeOf),J=q("navigator","userAgent")||"",$=k.process,Q=k.Deno,ee=$&&$.versions||Q&&Q.version,te=ee&&ee.v8;te&&(S=(b=te.split("."))[0]>0&&b[0]<4?1:+(b[0]+b[1])),!S&&J&&(!(b=J.match(/Edge\/(\d+)/))||b[1]>=74)&&(b=J.match(/Chrome\/(\d+)/))&&(S=+b[1]);var ne=S,re=!!Object.getOwnPropertySymbols&&!C((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&ne&&ne<41})),ie=re&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,oe=Object,ae=ie?function(e){return"symbol"==typeof e}:function(e){var t=q("Symbol");return V(t)&&Z(t.prototype,oe(e))},se=String,ce=function(e){try{return se(e)}catch(e){return"Object"}},ue=TypeError,le=function(e){if(V(e))return e;throw ue(ce(e)+" is not a function")},he=function(e,t){var n=e[t];return null==n?void 0:le(n)},de=TypeError,fe=Object.defineProperty,pe=function(e,t){try{fe(k,e,{value:t,configurable:!0,writable:!0})}catch(n){k[e]=t}return t},ve=k["__core-js_shared__"]||pe("__core-js_shared__",{}),ge=y((function(e){(e.exports=function(e,t){return ve[e]||(ve[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.23.4",mode:"global",copyright:"© 2014-2022 Denis Pushkarev (zloirock.ru)",license:"https://github.com/zloirock/core-js/blob/v3.23.4/LICENSE",source:"https://github.com/zloirock/core-js"})})),me=Object,ye=function(e){return me(z(e))},be=M({}.hasOwnProperty),Se=Object.hasOwn||function(e,t){return be(ye(e),t)},we=0,ke=Math.random(),Ce=M(1..toString),Ee=function(e){return"Symbol("+(void 0===e?"":e)+")_"+Ce(++we+ke,36)},xe=ge("wks"),Ie=k.Symbol,_e=Ie&&Ie.for,Ae=ie?Ie:Ie&&Ie.withoutSetter||Ee,Te=function(e){if(!Se(xe,e)||!re&&"string"!=typeof xe[e]){var t="Symbol."+e;re&&Se(Ie,e)?xe[e]=Ie[e]:xe[e]=ie&&_e?_e(t):Ae(t)}return xe[e]},Re=TypeError,Oe=Te("toPrimitive"),De=function(e,t){if(!X(e)||ae(e))return e;var n,r=he(e,Oe);if(r){if(void 0===t&&(t="default"),n=_(r,e,t),!X(n)||ae(n))return n;throw Re("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&V(n=e.toString)&&!X(r=_(n,e)))return r;if(V(n=e.valueOf)&&!X(r=_(n,e)))return r;if("string"!==t&&V(n=e.toString)&&!X(r=_(n,e)))return r;throw de("Can't convert object to primitive value")}(e,t)},Ne=function(e){var t=De(e,"string");return ae(t)?t:t+""},Le=k.document,Pe=X(Le)&&X(Le.createElement),Me=function(e){return Pe?Le.createElement(e):{}},Be=!E&&!C((function(){return 7!=Object.defineProperty(Me("div"),"a",{get:function(){return 7}}).a})),Ge=Object.getOwnPropertyDescriptor,je={f:E?Ge:function(e,t){if(e=Y(e),t=Ne(t),Be)try{return Ge(e,t)}catch(e){}if(Se(e,t))return O(!_(R.f,e,t),e[t])}},He=E&&C((function(){return 42!=Object.defineProperty((function(){}),"prototype",{value:42,writable:!1}).prototype})),Ue=String,Ke=TypeError,Fe=function(e){if(X(e))return e;throw Ke(Ue(e)+" is not an object")},ze=TypeError,Ye=Object.defineProperty,Ve=Object.getOwnPropertyDescriptor,Xe={f:E?He?function(e,t,n){if(Fe(e),t=Ne(t),Fe(n),"function"==typeof e&&"prototype"===t&&"value"in n&&"writable"in n&&!n.writable){var r=Ve(e,t);r&&r.writable&&(e[t]=n.value,n={configurable:"configurable"in n?n.configurable:r.configurable,enumerable:"enumerable"in n?n.enumerable:r.enumerable,writable:!1})}return Ye(e,t,n)}:Ye:function(e,t,n){if(Fe(e),t=Ne(t),Fe(n),Be)try{return Ye(e,t,n)}catch(e){}if("get"in n||"set"in n)throw ze("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},We=E?function(e,t,n){return Xe.f(e,t,O(1,n))}:function(e,t,n){return e[t]=n,e},qe=Function.prototype,Ze=E&&Object.getOwnPropertyDescriptor,Je=Se(qe,"name"),$e={EXISTS:Je,PROPER:Je&&"something"===function(){}.name,CONFIGURABLE:Je&&(!E||E&&Ze(qe,"name").configurable)},Qe=M(Function.toString);V(ve.inspectSource)||(ve.inspectSource=function(e){return Qe(e)});var et,tt,nt,rt=ve.inspectSource,it=k.WeakMap,ot=V(it)&&/native code/.test(rt(it)),at=ge("keys"),st=function(e){return at[e]||(at[e]=Ee(e))},ct={},ut=k.TypeError,lt=k.WeakMap;if(ot||ve.state){var ht=ve.state||(ve.state=new lt),dt=M(ht.get),ft=M(ht.has),pt=M(ht.set);et=function(e,t){if(ft(ht,e))throw new ut("Object already initialized");return t.facade=e,pt(ht,e,t),t},tt=function(e){return dt(ht,e)||{}},nt=function(e){return ft(ht,e)}}else{var vt=st("state");ct[vt]=!0,et=function(e,t){if(Se(e,vt))throw new ut("Object already initialized");return t.facade=e,We(e,vt,t),t},tt=function(e){return Se(e,vt)?e[vt]:{}},nt=function(e){return Se(e,vt)}}var gt={set:et,get:tt,has:nt,enforce:function(e){return nt(e)?tt(e):et(e,{})},getterFor:function(e){return function(t){var n;if(!X(t)||(n=tt(t)).type!==e)throw ut("Incompatible receiver, "+e+" required");return n}}},mt=y((function(e){var t=$e.CONFIGURABLE,n=gt.enforce,r=gt.get,i=Object.defineProperty,o=E&&!C((function(){return 8!==i((function(){}),"length",{value:8}).length})),a=String(String).split("String"),s=e.exports=function(e,r,s){"Symbol("===String(r).slice(0,7)&&(r="["+String(r).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),s&&s.getter&&(r="get "+r),s&&s.setter&&(r="set "+r),(!Se(e,"name")||t&&e.name!==r)&&(E?i(e,"name",{value:r,configurable:!0}):e.name=r),o&&s&&Se(s,"arity")&&e.length!==s.arity&&i(e,"length",{value:s.arity});try{s&&Se(s,"constructor")&&s.constructor?E&&i(e,"prototype",{writable:!1}):e.prototype&&(e.prototype=void 0)}catch(e){}var c=n(e);return Se(c,"source")||(c.source=a.join("string"==typeof r?r:"")),e};Function.prototype.toString=s((function(){return V(this)&&r(this).source||rt(this)}),"toString")})),yt=function(e,t,n,r){r||(r={});var i=r.enumerable,o=void 0!==r.name?r.name:t;if(V(n)&&mt(n,o,r),r.global)i?e[t]=n:pe(t,n);else{try{r.unsafe?e[t]&&(i=!0):delete e[t]}catch(e){}i?e[t]=n:Xe.f(e,t,{value:n,enumerable:!1,configurable:!r.nonConfigurable,writable:!r.nonWritable})}return e},bt=Math.ceil,St=Math.floor,wt=Math.trunc||function(e){var t=+e;return(t>0?St:bt)(t)},kt=function(e){var t=+e;return t!=t||0===t?0:wt(t)},Ct=Math.max,Et=Math.min,xt=function(e,t){var n=kt(e);return n<0?Ct(n+t,0):Et(n,t)},It=Math.min,_t=function(e){return e>0?It(kt(e),9007199254740991):0},At=function(e){return _t(e.length)},Tt=function(e){return function(t,n,r){var i,o=Y(t),a=At(o),s=xt(r,a);if(e&&n!=n){for(;a>s;)if((i=o[s++])!=i)return!0}else for(;a>s;s++)if((e||s in o)&&o[s]===n)return e||s||0;return!e&&-1}},Rt={includes:Tt(!0),indexOf:Tt(!1)},Ot=Rt.indexOf,Dt=M([].push),Nt=function(e,t){var n,r=Y(e),i=0,o=[];for(n in r)!Se(ct,n)&&Se(r,n)&&Dt(o,n);for(;t.length>i;)Se(r,n=t[i++])&&(~Ot(o,n)||Dt(o,n));return o},Lt=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],Pt=Lt.concat("length","prototype"),Mt={f:Object.getOwnPropertyNames||function(e){return Nt(e,Pt)}},Bt={f:Object.getOwnPropertySymbols},Gt=M([].concat),jt=q("Reflect","ownKeys")||function(e){var t=Mt.f(Fe(e)),n=Bt.f;return n?Gt(t,n(e)):t},Ht=function(e,t,n){for(var r=jt(t),i=Xe.f,o=je.f,a=0;a<r.length;a++){var s=r[a];Se(e,s)||n&&Se(n,s)||i(e,s,o(t,s))}},Ut=/#|\.prototype\./,Kt=function(e,t){var n=zt[Ft(e)];return n==Vt||n!=Yt&&(V(t)?C(t):!!t)},Ft=Kt.normalize=function(e){return String(e).replace(Ut,".").toLowerCase()},zt=Kt.data={},Yt=Kt.NATIVE="N",Vt=Kt.POLYFILL="P",Xt=Kt,Wt=je.f,qt=function(e,t){var n,r,i,o,a,s=e.target,c=e.global,u=e.stat;if(n=c?k:u?k[s]||pe(s,{}):(k[s]||{}).prototype)for(r in t){if(o=t[r],i=e.dontCallGetSet?(a=Wt(n,r))&&a.value:n[r],!Xt(c?r:s+(u?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Ht(o,i)}(e.sham||i&&i.sham)&&We(o,"sham",!0),yt(n,r,o,e)}},Zt=Object.keys||function(e){return Nt(e,Lt)},Jt=Object.assign,$t=Object.defineProperty,Qt=M([].concat),en=!Jt||C((function(){if(E&&1!==Jt({b:1},Jt($t({},"a",{enumerable:!0,get:function(){$t(this,"b",{value:3,enumerable:!1})}}),{b:2})).b)return!0;var e={},t={},n=Symbol();return e[n]=7,"abcdefghijklmnopqrst".split("").forEach((function(e){t[e]=e})),7!=Jt({},e)[n]||"abcdefghijklmnopqrst"!=Zt(Jt({},t)).join("")}))?function(e,t){for(var n=ye(e),r=arguments.length,i=1,o=Bt.f,a=R.f;r>i;)for(var s,c=K(arguments[i++]),u=o?Qt(Zt(c),o(c)):Zt(c),l=u.length,h=0;l>h;)s=u[h++],E&&!_(a,c,s)||(n[s]=c[s]);return n}:Jt;qt({target:"Object",stat:!0,arity:2,forced:Object.assign!==en},{assign:en});var tn=Array.isArray||function(e){return"Array"==j(e)},nn=TypeError,rn=function(e){if(e>9007199254740991)throw nn("Maximum allowed index exceeded");return e},on=function(e,t,n){var r=Ne(t);r in e?Xe.f(e,r,O(0,n)):e[r]=n},an={};an[Te("toStringTag")]="z";var sn="[object z]"===String(an),cn=Te("toStringTag"),un=Object,ln="Arguments"==j(function(){return arguments}()),hn=sn?j:function(e){var t,n,r;return void 0===e?"Undefined":null===e?"Null":"string"==typeof(n=function(e,t){try{return e[t]}catch(e){}}(t=un(e),cn))?n:ln?j(t):"Object"==(r=j(t))&&V(t.callee)?"Arguments":r},dn=function(){},fn=[],pn=q("Reflect","construct"),vn=/^\s*(?:class|function)\b/,gn=M(vn.exec),mn=!vn.exec(dn),yn=function(e){if(!V(e))return!1;try{return pn(dn,fn,e),!0}catch(e){return!1}},bn=function(e){if(!V(e))return!1;switch(hn(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}try{return mn||!!gn(vn,rt(e))}catch(e){return!0}};bn.sham=!0;var Sn=!pn||C((function(){var e;return yn(yn.call)||!yn(Object)||!yn((function(){e=!0}))||e}))?bn:yn,wn=Te("species"),kn=Array,Cn=function(e,t){return new(function(e){var t;return tn(e)&&(t=e.constructor,(Sn(t)&&(t===kn||tn(t.prototype))||X(t)&&null===(t=t[wn]))&&(t=void 0)),void 0===t?kn:t}(e))(0===t?0:t)},En=Te("species"),xn=function(e){return ne>=51||!C((function(){var t=[];return(t.constructor={})[En]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},In=Te("isConcatSpreadable"),_n=ne>=51||!C((function(){var e=[];return e[In]=!1,e.concat()[0]!==e})),An=xn("concat"),Tn=function(e){if(!X(e))return!1;var t=e[In];return void 0!==t?!!t:tn(e)};function Rn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}qt({target:"Array",proto:!0,arity:1,forced:!_n||!An},{concat:function(e){var t,n,r,i,o,a=ye(this),s=Cn(a,0),c=0;for(t=-1,r=arguments.length;t<r;t++)if(Tn(o=-1===t?a:arguments[t]))for(i=At(o),rn(c+i),n=0;n<i;n++,c++)n in o&&on(s,c,o[n]);else rn(c+1),on(s,c++,o);return s.length=c,s}});var On=sn?{}.toString:function(){return"[object "+hn(this)+"]"};sn||yt(Object.prototype,"toString",On,{unsafe:!0});var Dn,Nn,Ln,Pn,Mn="process"==j(k.process),Bn=String,Gn=TypeError,jn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=M(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Fe(n),function(e){if("object"==typeof e||V(e))return e;throw Gn("Can't set "+Bn(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Hn=Xe.f,Un=Te("toStringTag"),Kn=function(e,t,n){e&&!n&&(e=e.prototype),e&&!Se(e,Un)&&Hn(e,Un,{configurable:!0,value:t})},Fn=Te("species"),zn=function(e){var t=q(e),n=Xe.f;E&&t&&!t[Fn]&&n(t,Fn,{configurable:!0,get:function(){return this}})},Yn=TypeError,Vn=function(e,t){if(Z(t,e))return e;throw Yn("Incorrect invocation")},Xn=TypeError,Wn=function(e){if(Sn(e))return e;throw Xn(ce(e)+" is not a constructor")},qn=Te("species"),Zn=function(e,t){var n,r=Fe(e).constructor;return void 0===r||null==(n=Fe(r)[qn])?t:Wn(n)},Jn=Function.prototype,$n=Jn.apply,Qn=Jn.call,er="object"==typeof Reflect&&Reflect.apply||(x?Qn.bind($n):function(){return Qn.apply($n,arguments)}),tr=M(M.bind),nr=function(e,t){return le(e),void 0===t?e:x?tr(e,t):function(){return e.apply(t,arguments)}},rr=q("document","documentElement"),ir=M([].slice),or=TypeError,ar=function(e,t){if(e<t)throw or("Not enough arguments");return e},sr=/(?:ipad|iphone|ipod).*applewebkit/i.test(J),cr=k.setImmediate,ur=k.clearImmediate,lr=k.process,hr=k.Dispatch,dr=k.Function,fr=k.MessageChannel,pr=k.String,vr=0,gr={};try{Dn=k.location}catch(e){}var mr=function(e){if(Se(gr,e)){var t=gr[e];delete gr[e],t()}},yr=function(e){return function(){mr(e)}},br=function(e){mr(e.data)},Sr=function(e){k.postMessage(pr(e),Dn.protocol+"//"+Dn.host)};cr&&ur||(cr=function(e){ar(arguments.length,1);var t=V(e)?e:dr(e),n=ir(arguments,1);return gr[++vr]=function(){er(t,void 0,n)},Nn(vr),vr},ur=function(e){delete gr[e]},Mn?Nn=function(e){lr.nextTick(yr(e))}:hr&&hr.now?Nn=function(e){hr.now(yr(e))}:fr&&!sr?(Pn=(Ln=new fr).port2,Ln.port1.onmessage=br,Nn=nr(Pn.postMessage,Pn)):k.addEventListener&&V(k.postMessage)&&!k.importScripts&&Dn&&"file:"!==Dn.protocol&&!C(Sr)?(Nn=Sr,k.addEventListener("message",br,!1)):Nn="onreadystatechange"in Me("script")?function(e){rr.appendChild(Me("script")).onreadystatechange=function(){rr.removeChild(this),mr(e)}}:function(e){setTimeout(yr(e),0)});var wr,kr,Cr,Er,xr,Ir,_r,Ar,Tr={set:cr,clear:ur},Rr=/ipad|iphone|ipod/i.test(J)&&void 0!==k.Pebble,Or=/web0s(?!.*chrome)/i.test(J),Dr=je.f,Nr=Tr.set,Lr=k.MutationObserver||k.WebKitMutationObserver,Pr=k.document,Mr=k.process,Br=k.Promise,Gr=Dr(k,"queueMicrotask"),jr=Gr&&Gr.value;jr||(wr=function(){var e,t;for(Mn&&(e=Mr.domain)&&e.exit();kr;){t=kr.fn,kr=kr.next;try{t()}catch(e){throw kr?Er():Cr=void 0,e}}Cr=void 0,e&&e.enter()},sr||Mn||Or||!Lr||!Pr?!Rr&&Br&&Br.resolve?((_r=Br.resolve(void 0)).constructor=Br,Ar=nr(_r.then,_r),Er=function(){Ar(wr)}):Mn?Er=function(){Mr.nextTick(wr)}:(Nr=nr(Nr,k),Er=function(){Nr(wr)}):(xr=!0,Ir=Pr.createTextNode(""),new Lr(wr).observe(Ir,{characterData:!0}),Er=function(){Ir.data=xr=!xr}));var Hr=jr||function(e){var t={fn:e,next:void 0};Cr&&(Cr.next=t),kr||(kr=t,Er()),Cr=t},Ur=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},Kr=function(){this.head=null,this.tail=null};Kr.prototype={add:function(e){var t={item:e,next:null};this.head?this.tail.next=t:this.head=t,this.tail=t},get:function(){var e=this.head;if(e)return this.head=e.next,this.tail===e&&(this.tail=null),e.item}};var Fr=Kr,zr=k.Promise,Yr="object"==typeof window&&"object"!=typeof Deno;zr&&zr.prototype;var Vr,Xr,Wr,qr=Te("species"),Zr=!1,Jr=V(k.PromiseRejectionEvent),$r={CONSTRUCTOR:Xt("Promise",(function(){var e=rt(zr),t=e!==String(zr);if(!t&&66===ne)return!0;if(ne>=51&&/native code/.test(e))return!1;var n=new zr((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[qr]=r,!(Zr=n.then((function(){}))instanceof r)||!t&&Yr&&!Jr})),REJECTION_EVENT:Jr,SUBCLASSING:Zr},Qr=function(e){var t,n;this.promise=new e((function(e,r){if(void 0!==t||void 0!==n)throw TypeError("Bad Promise constructor");t=e,n=r})),this.resolve=le(t),this.reject=le(n)},ei={f:function(e){return new Qr(e)}},ti=Tr.set,ni=$r.CONSTRUCTOR,ri=$r.REJECTION_EVENT,ii=$r.SUBCLASSING,oi=gt.getterFor("Promise"),ai=gt.set,si=zr&&zr.prototype,ci=zr,ui=si,li=k.TypeError,hi=k.document,di=k.process,fi=ei.f,pi=fi,vi=!!(hi&&hi.createEvent&&k.dispatchEvent),gi=function(e){var t;return!(!X(e)||!V(t=e.then))&&t},mi=function(e,t){var n,r,i,o=t.value,a=1==t.state,s=a?e.ok:e.fail,c=e.resolve,u=e.reject,l=e.domain;try{s?(a||(2===t.rejection&&ki(t),t.rejection=1),!0===s?n=o:(l&&l.enter(),n=s(o),l&&(l.exit(),i=!0)),n===e.promise?u(li("Promise-chain cycle")):(r=gi(n))?_(r,n,c,u):c(n)):u(o)}catch(e){l&&!i&&l.exit(),u(e)}},yi=function(e,t){e.notified||(e.notified=!0,Hr((function(){for(var n,r=e.reactions;n=r.get();)mi(n,e);e.notified=!1,t&&!e.rejection&&Si(e)})))},bi=function(e,t,n){var r,i;vi?((r=hi.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),k.dispatchEvent(r)):r={promise:t,reason:n},!ri&&(i=k["on"+e])?i(r):"unhandledrejection"===e&&function(e,t){var n=k.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Si=function(e){_(ti,k,(function(){var t,n=e.facade,r=e.value;if(wi(e)&&(t=Ur((function(){Mn?di.emit("unhandledRejection",r,n):bi("unhandledrejection",n,r)})),e.rejection=Mn||wi(e)?2:1,t.error))throw t.value}))},wi=function(e){return 1!==e.rejection&&!e.parent},ki=function(e){_(ti,k,(function(){var t=e.facade;Mn?di.emit("rejectionHandled",t):bi("rejectionhandled",t,e.value)}))},Ci=function(e,t,n){return function(r){e(t,r,n)}},Ei=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,yi(e,!0))},xi=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw li("Promise can't be resolved itself");var r=gi(t);r?Hr((function(){var n={done:!1};try{_(r,t,Ci(xi,n,e),Ci(Ei,n,e))}catch(t){Ei(n,t,e)}})):(e.value=t,e.state=1,yi(e,!1))}catch(t){Ei({done:!1},t,e)}}};if(ni&&(ui=(ci=function(e){Vn(this,ui),le(e),_(Vr,this);var t=oi(this);try{e(Ci(xi,t),Ci(Ei,t))}catch(e){Ei(t,e)}}).prototype,(Vr=function(e){ai(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:new Fr,rejection:!1,state:0,value:void 0})}).prototype=yt(ui,"then",(function(e,t){var n=oi(this),r=fi(Zn(this,ci));return n.parent=!0,r.ok=!V(e)||e,r.fail=V(t)&&t,r.domain=Mn?di.domain:void 0,0==n.state?n.reactions.add(r):Hr((function(){mi(r,n)})),r.promise})),Xr=function(){var e=new Vr,t=oi(e);this.promise=e,this.resolve=Ci(xi,t),this.reject=Ci(Ei,t)},ei.f=fi=function(e){return e===ci||void 0===e?new Xr(e):pi(e)},V(zr)&&si!==Object.prototype)){Wr=si.then,ii||yt(si,"then",(function(e,t){var n=this;return new ci((function(e,t){_(Wr,n,e,t)})).then(e,t)}),{unsafe:!0});try{delete si.constructor}catch(e){}jn&&jn(si,ui)}qt({global:!0,constructor:!0,wrap:!0,forced:ni},{Promise:ci}),Kn(ci,"Promise",!1),zn("Promise");var Ii={},_i=Te("iterator"),Ai=Array.prototype,Ti=function(e){return void 0!==e&&(Ii.Array===e||Ai[_i]===e)},Ri=Te("iterator"),Oi=function(e){if(null!=e)return he(e,Ri)||he(e,"@@iterator")||Ii[hn(e)]},Di=TypeError,Ni=function(e,t){var n=arguments.length<2?Oi(e):t;if(le(n))return Fe(_(n,e));throw Di(ce(e)+" is not iterable")},Li=function(e,t,n){var r,i;Fe(e);try{if(!(r=he(e,"return"))){if("throw"===t)throw n;return n}r=_(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Fe(r),n},Pi=TypeError,Mi=function(e,t){this.stopped=e,this.result=t},Bi=Mi.prototype,Gi=function(e,t,n){var r,i,o,a,s,c,u,l=n&&n.that,h=!(!n||!n.AS_ENTRIES),d=!(!n||!n.IS_RECORD),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=nr(t,l),g=function(e){return r&&Li(r,"normal",e),new Mi(!0,e)},m=function(e){return h?(Fe(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(d)r=e.iterator;else if(f)r=e;else{if(!(i=Oi(e)))throw Pi(ce(e)+" is not iterable");if(Ti(i)){for(o=0,a=At(e);a>o;o++)if((s=m(e[o]))&&Z(Bi,s))return s;return new Mi(!1)}r=Ni(e,i)}for(c=d?e.next:r.next;!(u=_(c,r)).done;){try{s=m(u.value)}catch(e){Li(r,"throw",e)}if("object"==typeof s&&s&&Z(Bi,s))return s}return new Mi(!1)},ji=Te("iterator"),Hi=!1;try{var Ui=0,Ki={next:function(){return{done:!!Ui++}},return:function(){Hi=!0}};Ki[ji]=function(){return this},Array.from(Ki,(function(){throw 2}))}catch(e){}var Fi=function(e,t){if(!t&&!Hi)return!1;var n=!1;try{var r={};r[ji]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},zi=$r.CONSTRUCTOR||!Fi((function(e){zr.all(e).then(void 0,(function(){}))}));qt({target:"Promise",stat:!0,forced:zi},{all:function(e){var t=this,n=ei.f(t),r=n.resolve,i=n.reject,o=Ur((function(){var n=le(t.resolve),o=[],a=0,s=1;Gi(e,(function(e){var c=a++,u=!1;s++,_(n,t,e).then((function(e){u||(u=!0,o[c]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise}});var Yi=$r.CONSTRUCTOR,Vi=zr&&zr.prototype;if(qt({target:"Promise",proto:!0,forced:Yi,real:!0},{catch:function(e){return this.then(void 0,e)}}),V(zr)){var Xi=q("Promise").prototype.catch;Vi.catch!==Xi&&yt(Vi,"catch",Xi,{unsafe:!0})}qt({target:"Promise",stat:!0,forced:zi},{race:function(e){var t=this,n=ei.f(t),r=n.reject,i=Ur((function(){var i=le(t.resolve);Gi(e,(function(e){_(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}}),qt({target:"Promise",stat:!0,forced:$r.CONSTRUCTOR},{reject:function(e){var t=ei.f(this);return _(t.reject,void 0,e),t.promise}});var Wi=$r.CONSTRUCTOR;q("Promise"),qt({target:"Promise",stat:!0,forced:Wi},{resolve:function(e){return function(e,t){if(Fe(e),X(t)&&t.constructor===e)return t;var n=ei.f(e);return(0,n.resolve)(t),n.promise}(this,e)}});var qi=/MSIE .\./.test(J),Zi=k.Function,Ji=function(e){return qi?function(t,n){var r=ar(arguments.length,1)>2,i=V(t)?t:Zi(t),o=r?ir(arguments,2):void 0;return e(r?function(){er(i,this,o)}:i,n)}:e},$i={setTimeout:Ji(k.setTimeout),setInterval:Ji(k.setInterval)},Qi=$i.setInterval;qt({global:!0,bind:!0,forced:k.setInterval!==Qi},{setInterval:Qi});var eo=$i.setTimeout;qt({global:!0,bind:!0,forced:k.setTimeout!==eo},{setTimeout:eo});var to=function(e,t){var n=[][e];return!!n&&C((function(){n.call(null,t||function(){return 1},1)}))},no=Rt.indexOf,ro=M([].indexOf),io=!!ro&&1/ro([1],1,-0)<0,oo=to("indexOf");qt({target:"Array",proto:!0,forced:io||!oo},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return io?ro(this,e,t)||0:no(this,e,t)}});var ao=M([].push),so=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=7==e,s=5==e||o;return function(c,u,l,h){for(var d,f,p=ye(c),v=K(p),g=nr(u,l),m=At(v),y=0,b=h||Cn,S=t?b(c,m):n||a?b(c,0):void 0;m>y;y++)if((s||y in v)&&(f=g(d=v[y],y,p),e))if(t)S[y]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return y;case 2:ao(S,d)}else switch(e){case 4:return!1;case 7:ao(S,d)}return o?-1:r||i?i:S}},co={forEach:so(0),map:so(1),filter:so(2),some:so(3),every:so(4),find:so(5),findIndex:so(6),filterReject:so(7)},uo=co.filter,lo=xn("filter");qt({target:"Array",proto:!0,forced:!lo},{filter:function(e){return uo(this,e,arguments.length>1?arguments[1]:void 0)}});var ho,fo=String,po=function(e){if("Symbol"===hn(e))throw TypeError("Cannot convert a Symbol value to a string");return fo(e)},vo=function(){var e=Fe(this),t="";return e.hasIndices&&(t+="d"),e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.unicodeSets&&(t+="v"),e.sticky&&(t+="y"),t},go=k.RegExp,mo=C((function(){var e=go("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),yo=mo||C((function(){return!go("a","y").sticky})),bo={BROKEN_CARET:mo||C((function(){var e=go("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:yo,UNSUPPORTED_Y:mo},So={f:E&&!He?Object.defineProperties:function(e,t){Fe(e);for(var n,r=Y(t),i=Zt(t),o=i.length,a=0;o>a;)Xe.f(e,n=i[a++],r[n]);return e}},wo=st("IE_PROTO"),ko=function(){},Co=function(e){return"<script>"+e+"<\/script>"},Eo=function(e){e.write(Co("")),e.close();var t=e.parentWindow.Object;return e=null,t},xo=function(){try{ho=new ActiveXObject("htmlfile")}catch(e){}var e,t;xo="undefined"!=typeof document?document.domain&&ho?Eo(ho):((t=Me("iframe")).style.display="none",rr.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Co("document.F=Object")),e.close(),e.F):Eo(ho);for(var n=Lt.length;n--;)delete xo.prototype[Lt[n]];return xo()};ct[wo]=!0;var Io,_o,Ao=Object.create||function(e,t){var n;return null!==e?(ko.prototype=Fe(e),n=new ko,ko.prototype=null,n[wo]=e):n=xo(),void 0===t?n:So.f(n,t)},To=k.RegExp,Ro=C((function(){var e=To(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),Oo=k.RegExp,Do=C((function(){var e=Oo("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),No=gt.get,Lo=ge("native-string-replace",String.prototype.replace),Po=RegExp.prototype.exec,Mo=Po,Bo=M("".charAt),Go=M("".indexOf),jo=M("".replace),Ho=M("".slice),Uo=(_o=/b*/g,_(Po,Io=/a/,"a"),_(Po,_o,"a"),0!==Io.lastIndex||0!==_o.lastIndex),Ko=bo.BROKEN_CARET,Fo=void 0!==/()??/.exec("")[1];(Uo||Fo||Ko||Ro||Do)&&(Mo=function(e){var t,n,r,i,o,a,s,c=this,u=No(c),l=po(e),h=u.raw;if(h)return h.lastIndex=c.lastIndex,t=_(Mo,h,l),c.lastIndex=h.lastIndex,t;var d=u.groups,f=Ko&&c.sticky,p=_(vo,c),v=c.source,g=0,m=l;if(f&&(p=jo(p,"y",""),-1===Go(p,"g")&&(p+="g"),m=Ho(l,c.lastIndex),c.lastIndex>0&&(!c.multiline||c.multiline&&"\n"!==Bo(l,c.lastIndex-1))&&(v="(?: "+v+")",m=" "+m,g++),n=new RegExp("^(?:"+v+")",p)),Fo&&(n=new RegExp("^"+v+"$(?!\\s)",p)),Uo&&(r=c.lastIndex),i=_(Po,f?n:c,m),f?i?(i.input=Ho(i.input,g),i[0]=Ho(i[0],g),i.index=c.lastIndex,c.lastIndex+=i[0].length):c.lastIndex=0:Uo&&i&&(c.lastIndex=c.global?i.index+i[0].length:r),Fo&&i&&i.length>1&&_(Lo,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&d)for(i.groups=a=Ao(null),o=0;o<d.length;o++)a[(s=d[o])[0]]=i[s[1]];return i});var zo=Mo;qt({target:"RegExp",proto:!0,forced:/./.exec!==zo},{exec:zo});var Yo=Te("species"),Vo=RegExp.prototype,Xo=function(e,t,n,r){var i=Te(e),o=!C((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!C((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Yo]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||n){var s=M(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var a=M(e),c=t.exec;return c===zo||c===Vo.exec?o&&!i?{done:!0,value:s(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));yt(String.prototype,e,c[0]),yt(Vo,i,c[1])}r&&We(Vo[i],"sham",!0)},Wo=M("".charAt),qo=M("".charCodeAt),Zo=M("".slice),Jo=function(e){return function(t,n){var r,i,o=po(z(t)),a=kt(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=qo(o,a))<55296||r>56319||a+1===s||(i=qo(o,a+1))<56320||i>57343?e?Wo(o,a):r:e?Zo(o,a,a+2):i-56320+(r-55296<<10)+65536}},$o={codeAt:Jo(!1),charAt:Jo(!0)},Qo=$o.charAt,ea=function(e,t,n){return t+(n?Qo(e,t).length:1)},ta=TypeError,na=function(e,t){var n=e.exec;if(V(n)){var r=_(n,e,t);return null!==r&&Fe(r),r}if("RegExp"===j(e))return _(zo,e,t);throw ta("RegExp#exec called on incompatible receiver")};Xo("match",(function(e,t,n){return[function(t){var n=z(this),r=null==t?void 0:he(t,e);return r?_(r,t,n):new RegExp(t)[e](po(n))},function(e){var r=Fe(this),i=po(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return na(r,i);var a=r.unicode;r.lastIndex=0;for(var s,c=[],u=0;null!==(s=na(r,i));){var l=po(s[0]);c[u]=l,""===l&&(r.lastIndex=ea(i,_t(r.lastIndex),a)),u++}return 0===u?null:c}]}));var ra=co.map,ia=xn("map");qt({target:"Array",proto:!0,forced:!ia},{map:function(e){return ra(this,e,arguments.length>1?arguments[1]:void 0)}});var oa="\t\n\v\f\r \u2028\u2029\ufeff",aa=M("".replace),sa="["+oa+"]",ca=RegExp("^"+sa+sa+"*"),ua=RegExp(sa+sa+"*$"),la=function(e){return function(t){var n=po(z(t));return 1&e&&(n=aa(n,ca,"")),2&e&&(n=aa(n,ua,"")),n}},ha={start:la(1),end:la(2),trim:la(3)},da=ha.trim,fa=k.parseInt,pa=k.Symbol,va=pa&&pa.iterator,ga=/^[+-]?0x/i,ma=M(ga.exec),ya=8!==fa(oa+"08")||22!==fa(oa+"0x16")||va&&!C((function(){fa(Object(va))}))?function(e,t){var n=da(po(e));return fa(n,t>>>0||(ma(ga,n)?16:10))}:fa;qt({global:!0,forced:parseInt!=ya},{parseInt:ya});var ba=Te("match"),Sa=function(e){var t;return X(e)&&(void 0!==(t=e[ba])?!!t:"RegExp"==j(e))},wa=Array,ka=Math.max,Ca=function(e,t,n){for(var r=At(e),i=xt(t,r),o=xt(void 0===n?r:n,r),a=wa(ka(o-i,0)),s=0;i<o;i++,s++)on(a,s,e[i]);return a.length=s,a},Ea=bo.UNSUPPORTED_Y,xa=Math.min,Ia=[].push,_a=M(/./.exec),Aa=M(Ia),Ta=M("".slice);Xo("split",(function(e,t,n){var r;return r="c"=="abbc".split(/(b)*/)[1]||4!="test".split(/(?:)/,-1).length||2!="ab".split(/(?:ab)*/).length||4!=".".split(/(.?)(.?)/).length||".".split(/()()/).length>1||"".split(/.?/).length?function(e,n){var r=po(z(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Sa(e))return _(t,r,e,i);for(var o,a,s,c=[],u=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),l=0,h=new RegExp(e.source,u+"g");(o=_(zo,h,r))&&!((a=h.lastIndex)>l&&(Aa(c,Ta(r,l,o.index)),o.length>1&&o.index<r.length&&er(Ia,c,Ca(o,1)),s=o[0].length,l=a,c.length>=i));)h.lastIndex===o.index&&h.lastIndex++;return l===r.length?!s&&_a(h,"")||Aa(c,""):Aa(c,Ta(r,l)),c.length>i?Ca(c,0,i):c}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:_(t,this,e,n)}:t,[function(t,n){var i=z(this),o=null==t?void 0:he(t,e);return o?_(o,t,i,n):_(r,po(i),t,n)},function(e,i){var o=Fe(this),a=po(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var c=Zn(o,RegExp),u=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Ea?"g":"y"),h=new c(Ea?"^(?:"+o.source+")":o,l),d=void 0===i?4294967295:i>>>0;if(0===d)return[];if(0===a.length)return null===na(h,a)?[a]:[];for(var f=0,p=0,v=[];p<a.length;){h.lastIndex=Ea?0:p;var g,m=na(h,Ea?Ta(a,p):a);if(null===m||(g=xa(_t(h.lastIndex+(Ea?p:0)),a.length))===f)p=ea(a,p,u);else{if(Aa(v,Ta(a,f,p)),v.length===d)return v;for(var y=1;y<=m.length-1;y++)if(Aa(v,m[y]),v.length===d)return v;p=f=g}}return Aa(v,Ta(a,f)),v}]}),!!C((function(){var e=/(?:)/,t=e.exec;e.exec=function(){return t.apply(this,arguments)};var n="ab".split(e);return 2!==n.length||"a"!==n[0]||"b"!==n[1]})),Ea);var Ra=function(){var e=navigator.userAgent,t=e.toLocaleLowerCase(),n=navigator.platform.toUpperCase().indexOf("MAC")>=0||/macintosh|mac os x/i.test(e),r=navigator.platform.toUpperCase().indexOf("LINUX")>=0,i=/(?:win)/.test(e),o=/(?:Windows Phone)/.test(e),a=/(?:SymbianOS)/.test(e)||o,s=/(?:Android)/.test(e)||t.indexOf("harmony")>-1,c=/(?:Firefox)/.test(e),u=/(?:Chrome|CriOS)/.test(e)&&!(e.indexOf("Edg")>-1),l=e.indexOf("Edg")>-1,h=e.indexOf("Safari")>-1&&!(e.indexOf("Chrome")>-1),d=/iPad/i.test(e)||e.indexOf("MacIntel")>-1&&navigator.maxTouchPoints>1||e.indexOf("Macintosh")>-1&&navigator.maxTouchPoints>1,f=/(?:iPad|PlayBook)/.test(e)||s&&!/(?:Mobile)/.test(e)||c&&/(?:Tablet)/.test(e),p=/(?:iPhone)/.test(e)&&!f,v=!(p||s||a||d),g=e.indexOf("Baidu")>-1||e.indexOf("BIDUBrowser")>-1||e.indexOf("baiduboxapp")>-1,m=!!t.match(/firefox/)||e.indexOf("Firefox")>-1,y=!!t.match(/tencenttraveler/)||!!t.match(/qqbrowse/)||e.indexOf("QQ/")>-1||e.indexOf("MicroMessenger")>-1,b=e.indexOf("Opera")>-1||e.indexOf("OPR")>-1,S=e.indexOf("HuaweiBrowser")>-1;return{isTablet:f,isPhone:p,isAndroid:s,isPc:v,isMac:n,isWindows:i,isIPad:d,isChrome:u,isLinux:r,isFirefox:m,isBaidu:g,isQQ:y,isOpera:b,isZhazha:e.indexOf("QihooBrowser")>-1||e.indexOf("QHBrowser")>-1||e.indexOf("360SE")>-1||e.indexOf("360EE")>-1||e.indexOf("LBBROWSER")>-1||e.indexOf("UC")>-1||e.indexOf("UBrowser")>-1||e.indexOf("UCWEB")>-1||e.indexOf("Quark")>-1||e.indexOf("MiuiBrowser")>-1||e.indexOf("AliApp(TB")>-1||e.indexOf("Weibo")>-1||e.indexOf("IqiyiApp")>-1||e.indexOf("HuaweiBrowser")>-1||e.indexOf("HUAWEI")>-1||e.indexOf("MetaSr")>-1||e.indexOf("Sogou")>-1||e.indexOf("SE")>-1||e.indexOf("Maxthon")>-1||e.indexOf("The world")>-1||e.indexOf("MetaSr")>-1||e.indexOf("2345Explorer")>-1||e.indexOf("TencentTraveler")>-1||e.indexOf("Mb2345Browser")>-1,isEdge:l,isSafari:h,isHuaweiBrowser:S}},Oa=!Ra().isPc,Da=Ra(),Na={isMinBrowser:function(){var e=!1,t=Da.isChrome,n=Da.isEdge,r=Da.isFirefox;if(t){var i=function(){var e=navigator.userAgent.match(/Chrom(?:e|ium)\/([0-9]+)\.([0-9]+)\.([0-9]+)\.([0-9]+)/);if(null!=e&&5==e.length)return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3],patch:e[4]}}();e=(null==i?void 0:i.major)>=72}else if(n){var o=function(){var e=navigator.userAgent.match(/Ed(?:g)\/([0-9]+)\.([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<4))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2],build:e[3]}}();e=(null==o?void 0:o.major)>=80}else if(r){var a=function(){var e=navigator.userAgent.match(/Firefox\/([0-9]+)\.([0-9]+)/);if(!(null==e||e.length<3))return{major:(e=e.map((function(e){return parseInt(e,10)})))[1],minor:e[2]}}();e=(null==a?void 0:a.major)>=80}return e},isMobile:function(){var e=!1,t=Da.isPhone,n=Da.isAndroid,r=Da.isIPad;if(n){var i=function(){var e=navigator.userAgent.toLowerCase().match(/android (.*?);/);if(e){var t=e[1].split(".");return{major:(t=t.map((function(e){return parseInt(e,10)})))[0],minor:t[1]}}}()||{major:0,minor:0},o=i.major;i.minor,e=o>=6}else if(t){var a=function(){var e=navigator.userAgent.toLowerCase().match(/cpu( iphone)? os (.*?) like mac os/);if(e){var t=e[2].split("_");return{major:(t=t.map((function(e){return parseInt(e,10)})))[0],minor:t[1]}}}()||{major:0,minor:0},s=a.major,c=a.minor;e=12===s?c>2:s>12}else r&&(e=!0);return e},isFirefox:function(){return Da.isFirefox},isSupportReauthorize:function(){var e=Da.isPhone,t=Da.isSafari,n=Da.isIPad,r=Da.isFirefox,i=Da.isHuaweiBrowser;return!(e||t||n||r||i)},isSupportAppendTrack:function(){return!Da.isFirefox},isSupportUserMedia:function(){var e;return!!(null===(e=null===navigator||void 0===navigator?void 0:navigator.mediaDevices)||void 0===e?void 0:e.getUserMedia)||!1},isSupportRTC:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r={isSupportRTC:!1,isSupportAddtrack:!1,isSupportAddTransceiver:!1,isSupportReplaceTrack:!1,isApplyConstraints:!1,isSupportSetStreams:!1},i=["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection"],o=0;case 3:if(!(o<i.length)){e.next=11;break}if(!(i[o]in window)){e.next=8;break}return r.isSupportRTC=!0,e.abrupt("break",11);case 8:o++,e.next=3;break;case 11:if(!r.isSupportRTC){e.next=17;break}return e.next=14,Na.isSupportPeerCB(t);case 14:a=e.sent,s=a.isSupportPeer,r=Object.assign(Object.assign({},a),{isSupportRTC:s});case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),n)})))},isSupportPeerCB:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){setTimeout((function(){var n;if(RTCPeerConnection){var r,i,o,a=new RTCPeerConnection({iceServers:[]}),s=!1,c=!1,u=!1;if(r=!!(a.createAnswer&&a.createOffer&&a.addEventListener&&a.removeEventListener&&null===a.onnegotiationneeded),i=!!a.addTrack,o=!!(null==a?void 0:a.addTransceiver),t&&(null===(n=null==t?void 0:t.getVideoTracks())||void 0===n?void 0:n.length)&&o){var l=t.getVideoTracks()[0],h=l.getSettings();console.log("setting: ",h);var d=a.addTransceiver(l);d&&(s=!!d.sender.replaceTrack,u=!!d.sender.setStreams),l&&(c=!!l.applyConstraints),d=null}a.close(),e({isSupportPeer:r,isSupportAddtrack:i,isSupportAddTransceiver:o,isSupportReplaceTrack:s,isApplyConstraints:c,isSupportSetStreams:u})}e({isSupportPeer:!1,isSupportAddtrack:!1,isSupportAddTransceiver:!1,isSupportReplaceTrack:!1,isApplyConstraints:!1,isSupportSetStreams:!1})}),100)})));case 1:case"end":return e.stop()}}),n)})))},isSupportWebsocket:function(){return!!window.WebSocket},isSupportMedia:function(){return!!navigator.mediaDevices},isSupportH264:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=Da.isFirefox,a=!1,!o){e.next=13;break}return e.prev=3,s=new RTCPeerConnection,e.next=7,s.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 7:c=e.sent,a=((null===(n=null==c?void 0:c.sdp)||void 0===n?void 0:n.toLowerCase().indexOf("h264"))||-1)>-1,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(3);case 13:try{u=(null===(r=RTCRtpSender.getCapabilities("video"))||void 0===r?void 0:r.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],l=(null===(i=RTCRtpReceiver.getCapabilities("video"))||void 0===i?void 0:i.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],(null==u?void 0:u.length)>0&&l.length>0&&(a=!0)}catch(e){}return e.abrupt("return",a);case 15:case"end":return e.stop()}}),t,null,[[3,11]])})))},osVersion:function(){var e=Da.isMac,t=Da.isWindows,n=Da.isLinux,r=Da.isPhone,i=Da.isAndroid,o=Da.isIPad,a="unknown";return e?a="mac":t?a="windows":n?a="linux":r?a="ios":i?a="android":o&&(a="pad"),a},getNetWork:function(){var e=(null===navigator||void 0===navigator?void 0:navigator.connection)||{};if(e){var t=e.downlink,n=e.effectiveType,r=e.rtt;return{type:e.type,downlink:t,effectiveType:n,rtt:r,downlinkMax:e.downlinkMax,saveData:e.saveData}}return null}},La=Na.isFirefox(),Pa=Xe.f,Ma=Te("unscopables"),Ba=Array.prototype;null==Ba[Ma]&&Pa(Ba,Ma,{configurable:!0,value:Ao(null)});var Ga,ja,Ha,Ua=function(e){Ba[Ma][e]=!0},Ka=!C((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Fa=st("IE_PROTO"),za=Object,Ya=za.prototype,Va=Ka?za.getPrototypeOf:function(e){var t=ye(e);if(Se(t,Fa))return t[Fa];var n=t.constructor;return V(n)&&t instanceof n?n.prototype:t instanceof za?Ya:null},Xa=Te("iterator"),Wa=!1;[].keys&&("next"in(Ha=[].keys())?(ja=Va(Va(Ha)))!==Object.prototype&&(Ga=ja):Wa=!0),(null==Ga||C((function(){var e={};return Ga[Xa].call(e)!==e})))&&(Ga={}),V(Ga[Xa])||yt(Ga,Xa,(function(){return this}));var qa={IteratorPrototype:Ga,BUGGY_SAFARI_ITERATORS:Wa},Za=qa.IteratorPrototype,Ja=function(){return this},$a=$e.PROPER,Qa=$e.CONFIGURABLE,es=qa.IteratorPrototype,ts=qa.BUGGY_SAFARI_ITERATORS,ns=Te("iterator"),rs=function(){return this},is=function(e,t,n,r,i,o,a){!function(e,t,n,r){var i=t+" Iterator";e.prototype=Ao(Za,{next:O(+!r,n)}),Kn(e,i,!1),Ii[i]=Ja}(n,t,r);var s,c,u,l=function(e){if(e===i&&v)return v;if(!ts&&e in f)return f[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},h=t+" Iterator",d=!1,f=e.prototype,p=f[ns]||f["@@iterator"]||i&&f[i],v=!ts&&p||l(i),g="Array"==t&&f.entries||p;if(g&&(s=Va(g.call(new e)))!==Object.prototype&&s.next&&(Va(s)!==es&&(jn?jn(s,es):V(s[ns])||yt(s,ns,rs)),Kn(s,h,!0)),$a&&"values"==i&&p&&"values"!==p.name&&(Qa?We(f,"name","values"):(d=!0,v=function(){return _(p,this)})),i)if(c={values:l("values"),keys:o?v:l("keys"),entries:l("entries")},a)for(u in c)(ts||d||!(u in f))&&yt(f,u,c[u]);else qt({target:t,proto:!0,forced:ts||d},c);return f[ns]!==v&&yt(f,ns,v,{name:i}),Ii[t]=v,c},os=Xe.f,as=gt.set,ss=gt.getterFor("Array Iterator"),cs=is(Array,"Array",(function(e,t){as(this,{type:"Array Iterator",target:Y(e),index:0,kind:t})}),(function(){var e=ss(this),t=e.target,n=e.kind,r=e.index++;return!t||r>=t.length?(e.target=void 0,{value:void 0,done:!0}):"keys"==n?{value:r,done:!1}:"values"==n?{value:t[r],done:!1}:{value:[r,t[r]],done:!1}}),"values"),us=Ii.Arguments=Ii.Array;if(Ua("keys"),Ua("values"),Ua("entries"),E&&"values"!==us.name)try{os(us,"name",{value:"values"})}catch(e){}var ls=$o.charAt,hs=gt.set,ds=gt.getterFor("String Iterator");is(String,"String",(function(e){hs(this,{type:"String Iterator",string:po(e),index:0})}),(function(){var e,t=ds(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=ls(n,r),t.index+=e.length,{value:e,done:!1})}));var fs={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},ps=Me("span").classList,vs=ps&&ps.constructor&&ps.constructor.prototype,gs=vs===Object.prototype?void 0:vs,ms=Te("iterator"),ys=Te("toStringTag"),bs=cs.values,Ss=function(e,t){if(e){if(e[ms]!==bs)try{We(e,ms,bs)}catch(t){e[ms]=bs}if(e[ys]||We(e,ys,t),fs[t])for(var n in cs)if(e[n]!==cs[n])try{We(e,n,cs[n])}catch(t){e[n]=cs[n]}}};for(var ws in fs)Ss(k[ws]&&k[ws].prototype,ws);Ss(gs,"DOMTokenList");var ks=Date,Cs=M(ks.prototype.getTime);qt({target:"Date",stat:!0},{now:function(){return Cs(new ks)}});var Es=Date.prototype,xs=M(Es.toString),Is=M(Es.getTime);"Invalid Date"!=String(new Date(NaN))&&yt(Es,"toString",(function(){var e=Is(this);return e==e?xs(this):"Invalid Date"}));var _s=co.forEach,As=to("forEach")?[].forEach:function(e){return _s(this,e,arguments.length>1?arguments[1]:void 0)};qt({target:"Array",proto:!0,forced:[].forEach!=As},{forEach:As});var Ts=function(e){if(e&&e.forEach!==As)try{We(e,"forEach",As)}catch(t){e.forEach=As}};for(var Rs in fs)fs[Rs]&&Ts(k[Rs]&&k[Rs].prototype);Ts(gs);var Os=function(e){for(var t=ye(this),n=At(t),r=arguments.length,i=xt(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:xt(o,n);a>i;)t[i++]=e;return t};qt({target:"Array",proto:!0},{fill:Os}),Ua("fill");var Ds=Object.keys,Ns=Array.isArray,Ls="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function Ps(e,t){return"object"!=typeof t||Ds(t).forEach((function(n){e[n]=t[n]})),e}var Ms=Object.getPrototypeOf,Bs={}.hasOwnProperty;function Gs(e,t){return Bs.call(e,t)}function js(e,t){"function"==typeof t&&(t=t(Ms(e))),Ds(t).forEach((function(n){Us(e,n,t[n])}))}var Hs=Object.defineProperty;function Us(e,t,n,r){Hs(e,t,Ps(n&&Gs(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Ks(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Us(e.prototype,"constructor",e),{extend:js.bind(null,e.prototype)}}}}var Fs=Object.getOwnPropertyDescriptor;var zs=[].slice;function Ys(e,t,n){return zs.call(e,t,n)}function Vs(e,t){return t(e)}function Xs(e){if(!e)throw new Error("Assertion Failed")}function Ws(e){Ls.setImmediate?setImmediate(e):setTimeout(e,0)}function qs(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function Zs(e,t){return function(){try{e.apply(this,arguments)}catch(e){t(e)}}}function Js(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}function $s(e,t){if(Gs(e,t))return e[t];if(!t)return e;if("string"!=typeof t){for(var n=[],r=0,i=t.length;r<i;++r){var o=$s(e,t[r]);n.push(o)}return n}var a=t.indexOf(".");if(-1!==a){var s=e[t.substr(0,a)];return void 0===s?void 0:$s(s,t.substr(a+1))}}function Qs(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Xs("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)Qs(e,t[r],n[r])}else{var o=t.indexOf(".");if(-1!==o){var a=t.substr(0,o),s=t.substr(o+1);if(""===s)void 0===n?delete e[a]:e[a]=n;else{var c=e[a];c||(c=e[a]={}),Qs(c,s,n)}}else void 0===n?delete e[t]:e[t]=n}}function ec(e){var t={};for(var n in e)Gs(e,n)&&(t[n]=e[n]);return t}var tc=[].concat;function nc(e){return tc.apply([],e)}var rc="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(nc([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return Ls[e]})).map((function(e){return Ls[e]}));function ic(e){if(!e||"object"!=typeof e)return e;var t;if(Ns(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(ic(e[n]))}else if(rc.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)Gs(e,i)&&(t[i]=ic(e[i]));return t}function oc(e,t,n,r){return n=n||{},r=r||"",Ds(e).forEach((function(i){if(Gs(t,i)){var o=e[i],a=t[i];"object"==typeof o&&"object"==typeof a&&o&&a&&""+o.constructor==""+a.constructor?oc(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else n[r+i]=void 0})),Ds(t).forEach((function(i){Gs(e,i)||(n[r+i]=t[i])})),n}var ac="undefined"!=typeof Symbol&&Symbol.iterator,sc=ac?function(e){var t;return null!=e&&(t=e[ac])&&t.apply(e)}:function(){return null},cc={};function uc(e){var t,n,r,i;if(1===arguments.length){if(Ns(e))return e.slice();if(this===cc&&"string"==typeof e)return[e];if(i=sc(e)){for(n=[];!(r=i.next()).done;)n.push(r.value);return n}if(null==e)return[e];if("number"==typeof(t=e.length)){for(n=new Array(t);t--;)n[t]=e[t];return n}return[e]}for(t=arguments.length,n=new Array(t);t--;)n[t]=arguments[t];return n}var lc="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function hc(e,t){lc=e,dc=t}var dc=function(){return!0},fc=!new Error("").stack;function pc(){if(fc)try{throw pc.arguments,new Error}catch(e){return e}return new Error}function vc(e,t){var n=e.stack;return n?(t=t||0,0===n.indexOf(e.name)&&(t+=(e.name+e.message).split("\n").length),n.split("\n").slice(t).filter(dc).map((function(e){return"\n"+e})).join("")):""}var gc=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],mc=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(gc),yc={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function bc(e,t){this._e=pc(),this.name=e,this.message=t}function Sc(e,t,n,r){this._e=pc(),this.failures=t,this.failedKeys=r,this.successCount=n}function wc(e,t){this._e=pc(),this.name="BulkError",this.failures=t,this.message=function(e,t){return e+". Errors: "+t.map((function(e){return e.toString()})).filter((function(e,t,n){return n.indexOf(e)===t})).join("\n")}(e,t)}Ks(bc).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+vc(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Ks(Sc).from(bc),Ks(wc).from(bc);var kc=mc.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Cc=bc,Ec=mc.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=pc(),this.name=n,e?"string"==typeof e?(this.message=e,this.inner=r||null):"object"==typeof e&&(this.message=e.name+" "+e.message,this.inner=e):(this.message=yc[t]||n,this.inner=null)}return Ks(r).from(Cc),e[t]=r,e}),{});Ec.Syntax=SyntaxError,Ec.Type=TypeError,Ec.Range=RangeError;var xc=gc.reduce((function(e,t){return e[t+"Error"]=Ec[t],e}),{});var Ic=mc.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Ec[t]),e}),{});function _c(){}function Ac(e){return e}function Tc(e,t){return null==e||e===Ac?t:function(n){return t(e(n))}}function Rc(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function Oc(e,t){return e===_c?t:function(){var n=e.apply(this,arguments);void 0!==n&&(arguments[0]=n);var r=this.onsuccess,i=this.onerror;this.onsuccess=null,this.onerror=null;var o=t.apply(this,arguments);return r&&(this.onsuccess=this.onsuccess?Rc(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Rc(i,this.onerror):i),void 0!==o?o:n}}function Dc(e,t){return e===_c?t:function(){e.apply(this,arguments);var n=this.onsuccess,r=this.onerror;this.onsuccess=this.onerror=null,t.apply(this,arguments),n&&(this.onsuccess=this.onsuccess?Rc(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Rc(r,this.onerror):r)}}function Nc(e,t){return e===_c?t:function(n){var r=e.apply(this,arguments);Ps(n,r);var i=this.onsuccess,o=this.onerror;this.onsuccess=null,this.onerror=null;var a=t.apply(this,arguments);return i&&(this.onsuccess=this.onsuccess?Rc(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Rc(o,this.onerror):o),void 0===r?void 0===a?void 0:a:Ps(r,a)}}function Lc(e,t){return e===_c?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Pc(e,t){return e===_c?t:function(){var n=e.apply(this,arguments);if(n&&"function"==typeof n.then){for(var r=this,i=arguments.length,o=new Array(i);i--;)o[i]=arguments[i];return n.then((function(){return t.apply(r,o)}))}return t.apply(this,arguments)}}Ic.ModifyError=Sc,Ic.DexieError=bc,Ic.BulkError=wc;var Mc={},Bc=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=Ls.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),Gc=Bc[0],jc=Bc[1],Hc=Bc[2],Uc=jc&&jc.then,Kc=Gc&&Gc.constructor,Fc=Bc[3],zc=!!Hc,Yc=!1,Vc=Hc?function(){Hc.then(pu)}:Ls.setImmediate?setImmediate.bind(null,pu):Ls.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){pu(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(pu,0)},Xc=function(e,t){nu.push([e,t]),qc&&(Vc(),qc=!1)},Wc=!0,qc=!0,Zc=[],Jc=[],$c=null,Qc=Ac,eu={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Bu,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Bu(e[0],e[1])}catch(e){}}))}},tu=eu,nu=[],ru=0,iu=[];function ou(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=_c,this._lib=!1;var t=this._PSD=tu;if(lc&&(this._stackHolder=pc(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Mc)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&uu(this,this._value))}this._state=null,this._value=null,++t.ref,cu(this,e)}var au={get:function(){var e=tu,t=Eu;function n(n,r){var i=this,o=!e.global&&(e!==tu||t!==Eu);o&&Au();var a=new ou((function(t,a){hu(i,new su(Pu(n,e,o),Pu(r,e,o),t,a,e))}));return lc&&fu(a,this),a}return n.prototype=Mc,n},set:function(e){Us(this,"then",e&&e.prototype===Mc?au:{get:function(){return e},set:au.set})}};function su(e,t,n,r,i){this.onFulfilled="function"==typeof e?e:null,this.onRejected="function"==typeof t?t:null,this.resolve=n,this.reject=r,this.psd=i}function cu(e,t){try{t((function(t){if(null===e._state){if(t===e)throw new TypeError("A promise cannot be resolved with itself.");var n=e._lib&&vu();t&&"function"==typeof t.then?cu(e,(function(e,n){t instanceof ou?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,lu(e)),n&&gu()}}),uu.bind(null,e))}catch(t){uu(e,t)}}function uu(e,t){if(Jc.push(t),null===e._state){var n=e._lib&&vu();t=Qc(t),e._state=!1,e._value=t,lc&&null!==t&&"object"==typeof t&&!t._promise&&Js((function(){var n=function e(t,n){var r;return Fs(t,n)||(r=Ms(t))&&e(r,n)}(t,"stack");t._promise=e,Us(t,"stack",{get:function(){return Yc?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Zc.some((function(t){return t._value===e._value}))||Zc.push(e)}(e),lu(e),n&&gu()}}function lu(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)hu(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===ru&&(++ru,Xc((function(){0==--ru&&mu()}),[]))}function hu(e,t){if(null!==e._state){var n=e._state?t.onFulfilled:t.onRejected;if(null===n)return(e._state?t.resolve:t.reject)(e._value);++t.psd.ref,++ru,Xc(du,[n,e,t])}else e._listeners.push(t)}function du(e,t,n){try{$c=t;var r,i=t._value;t._state?r=e(i):(Jc.length&&(Jc=[]),r=e(i),-1===Jc.indexOf(i)&&function(e){var t=Zc.length;for(;t;)if(Zc[--t]._value===e._value)return void Zc.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{$c=null,0==--ru&&mu(),--n.psd.ref||n.psd.finalize()}}function fu(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function pu(){vu()&&gu()}function vu(){var e=Wc;return Wc=!1,qc=!1,e}function gu(){var e,t,n;do{for(;nu.length>0;)for(e=nu,nu=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(nu.length>0);Wc=!0,qc=!0}function mu(){var e=Zc;Zc=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=iu.slice(0),n=t.length;n;)t[--n]()}function yu(e){return new ou(Mc,!1,e)}function bu(e,t){var n=tu;return function(){var r=vu(),i=tu;try{return Du(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Du(i,!1),r&&gu()}}}js(ou.prototype,{then:au,_then:function(e,t){hu(this,new su(null,null,e,t,tu))},catch:function(e){if(1===arguments.length)return this.then(null,e);var t=arguments[0],n=arguments[1];return"function"==typeof t?this.then(null,(function(e){return e instanceof t?n(e):yu(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):yu(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),yu(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Yc=!0;var e=function e(t,n,r){if(n.length===r)return n;var i="";if(!1===t._state){var o,a,s=t._value;null!=s?(o=s.name||"Error",a=s.message||s,i=vc(s,0)):(o=s,a=""),n.push(o+(a?": "+a:"")+i)}lc&&((i=vc(t._stackHolder,2))&&-1===n.indexOf(i)&&n.push(i),t._prev&&e(t._prev,n,r));return n}(this,[],20).join("\nFrom previous: ");return null!==this._state&&(this._stack=e),e}finally{Yc=!1}}},timeout:function(e,t){var n=this;return e<1/0?new ou((function(r,i){var o=setTimeout((function(){return i(new Ec.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Us(ou.prototype,Symbol.toStringTag,"Promise"),eu.env=Nu(),js(ou,{all:function(){var e=uc.apply(null,arguments).map(Tu);return new ou((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return ou.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof ou)return e;if(e&&"function"==typeof e.then)return new ou((function(t,n){e.then(t,n)}));var t=new ou(Mc,!0,e);return fu(t,$c),t},reject:yu,race:function(){var e=uc.apply(null,arguments).map(Tu);return new ou((function(t,n){e.map((function(e){return ou.resolve(e).then(t,n)}))}))},PSD:{get:function(){return tu},set:function(e){return tu=e}},newPSD:Iu,usePSD:Lu,scheduler:{get:function(){return Xc},set:function(e){Xc=e}},rejectionMapper:{get:function(){return Qc},set:function(e){Qc=e}},follow:function(e,t){return new ou((function(n,r){return Iu((function(t,n){var r=tu;r.unhandleds=[],r.onunhandled=n,r.finalize=Rc((function(){var e=this;!function(e){iu.push((function t(){e(),iu.splice(iu.indexOf(t),1)})),++ru,Xc((function(){0==--ru&&mu()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}});var Su={awaits:0,echoes:0,id:0},wu=0,ku=[],Cu=0,Eu=0,xu=0;function Iu(e,t,n,r){var i=tu,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++xu;var a=eu.env;o.env=zc?{Promise:ou,PromiseProp:{value:ou,configurable:!0,writable:!0},all:ou.all,race:ou.race,resolve:ou.resolve,reject:ou.reject,nthen:Mu(a.nthen,o),gthen:Mu(a.gthen,o)}:{},t&&Ps(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=Lu(o,e,n,r);return 0===o.ref&&o.finalize(),s}function _u(){return Su.id||(Su.id=++wu),++Su.awaits,Su.echoes+=7,Su.id}function Au(e){!Su.awaits||e&&e!==Su.id||(0==--Su.awaits&&(Su.id=0),Su.echoes=7*Su.awaits)}function Tu(e){return Su.echoes&&e&&e.constructor===Kc?(_u(),e.then((function(e){return Au(),e}),(function(e){return Au(),Gu(e)}))):e}function Ru(e){++Eu,Su.echoes&&0!=--Su.echoes||(Su.echoes=Su.id=0),ku.push(tu),Du(e,!0)}function Ou(){var e=ku[ku.length-1];ku.pop(),Du(e,!1)}function Du(e,t){var n,r=tu;if((t?!Su.echoes||Cu++&&e===tu:!Cu||--Cu&&e===tu)||(n=t?Ru.bind(null,e):Ou,Uc.call(Gc,n)),e!==tu&&(tu=e,r===eu&&(eu.env=Nu()),zc)){var i=eu.env.Promise,o=e.env;jc.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(Ls,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function Nu(){var e=Ls.Promise;return zc?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(Ls,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:jc.then,gthen:e.prototype.then}:{}}function Lu(e,t,n,r,i){var o=tu;try{return Du(e,!0),t(n,r,i)}finally{Du(o,!1)}}function Pu(e,t,n){return"function"!=typeof e?e:function(){var r=tu;n&&_u(),Du(t,!0);try{return e.apply(this,arguments)}finally{Du(r,!1)}}}function Mu(e,t){return function(n,r){return e.call(this,Pu(n,t,!1),Pu(r,t,!1))}}function Bu(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(Ls.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Ps(r,i)):Ls.CustomEvent&&Ps(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&Ls.dispatchEvent&&(dispatchEvent(r),!Ls.PromiseRejectionEvent&&Ls.onunhandledrejection))try{Ls.onunhandledrejection(r)}catch(e){}r.defaultPrevented||console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var Gu=ou.reject;function ju(e){var t={},n=function(n,r){if(r){for(var i=arguments.length,o=new Array(i-1);--i;)o[i-1]=arguments[i];return t[n].subscribe.apply(null,o),e}if("string"==typeof n)return t[n]};n.addEventType=o;for(var r=1,i=arguments.length;r<i;++r)o(arguments[r]);return n;function o(e,r,i){if("object"==typeof e)return a(e);r||(r=Lc),i||(i=_c);var o={subscribers:[],fire:i,subscribe:function(e){-1===o.subscribers.indexOf(e)&&(o.subscribers.push(e),o.fire=r(o.fire,e))},unsubscribe:function(e){o.subscribers=o.subscribers.filter((function(t){return t!==e})),o.fire=o.subscribers.reduce(r,i)}};return t[e]=n[e]=o,o}function a(e){Ds(e).forEach((function(t){var n=e[t];if(Ns(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Ec.InvalidArgument("Invalid event config");var r=o(t,Ac,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){Ws((function(){e.apply(null,t)}))}))}))}}))}}var Hu,Uu=String.fromCharCode(65535),Ku=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(e){return Uu}}(),Fu="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",zu=[],Yu="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Vu=Yu,Xu=Yu,Wu=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)};function qu(e,t){var n,r,i,o,a,s=qu.dependencies,c=Ps({addons:qu.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange},t),u=c.addons,l=c.autoOpen,h=c.indexedDB,d=c.IDBKeyRange,f=this._dbSchema={},p=[],v=[],g={},m=null,y=null,b=!1,S=null,w=!1,k="readwrite",C=this,E=new ou((function(e){n=e})),x=new ou((function(e,t){r=t})),I=!0,_=!!al(h);function A(e){this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null},this.stores({})}function T(e,t,n){var r=C._createTransaction(k,v,f);r.create(t),r._completion.catch(n);var i=r._reject.bind(r);Iu((function(){tu.trans=r,0===e?(Ds(f).forEach((function(e){R(t,e,f[e].primKey,f[e].indexes)})),ou.follow((function(){return C.on.populate.fire(r)})).catch(i)):function(e,t,n){var r=[],i=p.filter((function(t){return t._cfg.version===e}))[0];if(!i)throw new Ec.Upgrade("Dexie specification of currently installed DB version is missing");f=C._dbSchema=i._cfg.dbschema;var o=!1;function a(){return r.length?ou.resolve(r.shift()(t.idbtrans)).then(a):ou.resolve()}return p.filter((function(t){return t._cfg.version>e})).forEach((function(e){r.push((function(){var r=f,i=e._cfg.dbschema;Z(r,n),Z(i,n),f=C._dbSchema=i;var a=function(e,t){var n={del:[],add:[],change:[]};for(var r in e)t[r]||n.del.push(r);for(r in t){var i=e[r],o=t[r];if(i){var a={name:r,def:o,recreate:!1,del:[],add:[],change:[]};if(i.primKey.src!==o.primKey.src)a.recreate=!0,n.change.push(a);else{var s=i.idxByName,c=o.idxByName;for(var u in s)c[u]||a.del.push(u);for(u in c){var l=s[u],h=c[u];l?l.src!==h.src&&a.change.push(h):a.add.push(h)}(a.del.length>0||a.add.length>0||a.change.length>0)&&n.change.push(a)}}else n.add.push([r,o])}return n}(r,i);if(a.add.forEach((function(e){R(n,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new Ec.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){O(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),O(t,e)})),e.del.forEach((function(e){t.deleteIndex(e)}))})),e._cfg.contentUpgrade)return o=!0,ou.follow((function(){e._cfg.contentUpgrade(t)}))})),r.push((function(t){o&&Vu||function(e,t){for(var n=0;n<t.db.objectStoreNames.length;++n){var r=t.db.objectStoreNames[n];null==e[r]&&t.db.deleteObjectStore(r)}}(e._cfg.dbschema,t)}))})),a().then((function(){!function(e,t){Ds(e).forEach((function(n){t.db.objectStoreNames.contains(n)||R(t,n,e[n].primKey,e[n].indexes)}))}(f,n)}))}(e,r,t).catch(i)}))}function R(e,t,n,r){var i=e.db.createObjectStore(t,n.keyPath?{keyPath:n.keyPath,autoIncrement:n.auto}:{autoIncrement:n.auto});return r.forEach((function(e){O(i,e)})),i}function O(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function D(e,t,n){var r=arguments.length;if(r<2)throw new Ec.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=nc(i);return[e,o,n]}function N(e,t,n){this.name=e,this.schema=t,this._tx=n,this.hook=g[e]?g[e].hook:ju(null,{creating:[Oc,_c],reading:[Tc,Ac],updating:[Nc,_c],deleting:[Dc,_c]})}function L(e,t,n){return(n?el:$u)((function(n){e.push(n),t&&t()}))}function P(e,t,n,r,i){return new ou((function(o,a){var s=n.length,c=s-1;if(0===s)return o();if(r){var u,l=el(a),h=Ju(null);Js((function(){for(var r=0;r<s;++r){u={onsuccess:null,onerror:null};var a=n[r];i.call(u,a[0],a[1],t);var d=e.delete(a[0]);d._hookCtx=u,d.onerror=l,d.onsuccess=r===c?Ju(o):h}}),(function(e){throw u.onerror&&u.onerror(e),e}))}else for(var d=0;d<s;++d){var f=e.delete(n[d]);f.onerror=$u(a),d===c&&(f.onsuccess=bu((function(){return o()})))}}))}function M(e,t,n,r){var i=this;this.db=C,this.mode=e,this.storeNames=t,this.idbtrans=null,this.on=ju(this,"complete","error","abort"),this.parent=r||null,this.active=!0,this._reculock=0,this._blockedFuncs=[],this._resolve=null,this._reject=null,this._waitingFor=null,this._waitingQueue=null,this._spinCount=0,this._completion=new ou((function(e,t){i._resolve=e,i._reject=t})),this._completion.then((function(){i.active=!1,i.on.complete.fire()}),(function(e){var t=i.active;return i.active=!1,i.on.error.fire(e),i.parent?i.parent._reject(e):t&&i.idbtrans&&i.idbtrans.abort(),Gu(e)}))}function B(e,t,n){this._ctx={table:e,index:":id"===t?null:t,or:n}}function G(e,t){var n=null,r=null;if(t)try{n=t()}catch(e){r=e}var i=e._ctx,o=i.table;this._ctx={table:o,index:i.index,isPrimKey:!i.index||o.schema.primKey.keyPath&&i.index===o.schema.primKey.name,range:n,keysOnly:!1,dir:"next",unique:"",algorithm:null,filter:null,replayFilter:null,justLimit:!0,isMatch:null,offset:0,limit:1/0,error:r,or:i.or,valueMapper:o.hook.reading.fire}}function j(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function H(e,t){return e._cfg.version-t._cfg.version}function U(e,t,n){t.forEach((function(t){var r=n[t];e.forEach((function(e){t in e||(e===M.prototype||e instanceof M?Us(e,t,{get:function(){return this.table(t)}}):e[t]=new N(t,r))}))}))}function K(e,t,n,r,i,o){var a=bu(o?function(e,t,r){return n(o(e),t,r)}:n,i);e.onerror||(e.onerror=$u(i)),e.onsuccess=Zs(t?function(){var n=e.result;if(n){var o=function(){n.continue()};t(n,(function(e){o=e}),r,i)&&a(n.value,n,(function(e){o=e})),o()}else r()}:function(){var t=e.result;if(t){var n=function(){t.continue()};a(t.value,t,(function(e){n=e})),n()}else r()},i)}function F(e,t){return h.cmp(e,t)}function z(e,t){return F(e,t)>0?e:t}function Y(e,t){return h.cmp(e,t)}function V(e,t){return h.cmp(t,e)}function X(e,t){return e<t?-1:e===t?0:1}function W(e,t){return e>t?-1:e===t?0:1}function q(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function Z(e,t){for(var n=t.db.objectStoreNames,r=0;r<n.length;++r){var o=n[r],a=t.objectStore(o);i="getAll"in a;for(var s=0;s<a.indexNames.length;++s){var c=a.indexNames[s],u=a.index(c).keyPath,l="string"==typeof u?u:"["+Ys(u).join("+")+"]";if(e[o]){var h=e[o].idxByName[l];h&&(h.name=c)}}}/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&Ls.WorkerGlobalScope&&Ls instanceof Ls.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(i=!1)}function J(e){C.on("blocked").fire(e),zu.filter((function(e){return e.name===C.name&&e!==C&&!e._vcFired})).map((function(t){return t.on("versionchange").fire(e)}))}this.version=function(e){if(m||b)throw new Ec.Schema("Cannot add version when database is open");this.verno=Math.max(this.verno,e);var t=p.filter((function(t){return t._cfg.version===e}))[0];return t||(t=new A(e),p.push(t),p.sort(H),I=!1,t)},Ps(A.prototype,{stores:function(e){this._cfg.storesSource=this._cfg.storesSource?Ps(this._cfg.storesSource,e):e;var t={};p.forEach((function(e){Ps(t,e._cfg.storesSource)}));var n=this._cfg.dbschema={};return this._parseStoresSpec(t,n),f=C._dbSchema=n,[g,C,M.prototype].forEach((function(e){for(var t in e)e[t]instanceof N&&delete e[t]})),U([g,C,M.prototype,this._cfg.tables],Ds(n),n),v=Ds(n),this},upgrade:function(e){return this._cfg.contentUpgrade=e,this},_parseStoresSpec:function(e,t){Ds(e).forEach((function(n){if(null!==e[n]){var r={},i=function(e){var t=[];return e.split(",").forEach((function(e){var n=(e=e.trim()).replace(/([&*]|\+\+)/g,""),r=/^\[/.test(n)?n.match(/^\[(.*)\]$/)[1].split("+"):n;t.push(new rl(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),Ns(r),/\./.test(e)))})),t}(e[n]),o=i.shift();if(o.multi)throw new Ec.Schema("Primary key cannot be multi-valued");o.keyPath&&Qs(r,o.keyPath,o.auto?0:o.keyPath),i.forEach((function(e){if(e.auto)throw new Ec.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Ec.Schema("Index must have a name and cannot be an empty string");Qs(r,e.keyPath,e.compound?e.keyPath.map((function(){return""})):"")})),t[n]=new il(n,o,i,r)}}))}}),this._allTables=g,this._createTransaction=function(e,t,n,r){return new M(e,t,n,r)},this._whenReady=function(e){return w||tu.letThrough?e():new ou((function(e,t){if(!b){if(!l)return void t(new Ec.DatabaseClosed);C.open().catch(_c)}E.then(e,t)})).then(e)},this.verno=0,this.open=function(){if(b||m)return E.then((function(){return y?Gu(y):C}));lc&&(x._stackHolder=pc()),b=!0,y=null,w=!1;var t=n,r=null;return ou.race([x,new ou((function(t,n){if(!h)throw new Ec.MissingAPI("indexedDB API not found. If using IE10+, make sure to run your code on a server URL (not locally). If using old Safari versions, make sure to include indexedDB polyfill.");var i=I?h.open(e):h.open(e,Math.round(10*C.verno));if(!i)throw new Ec.MissingAPI("IndexedDB API not available");i.onerror=$u(n),i.onblocked=bu(J),i.onupgradeneeded=bu((function(t){if(r=i.transaction,I&&!C._allowEmptyDB){i.onerror=tl,r.abort(),i.result.close();var o=h.deleteDatabase(e);o.onsuccess=o.onerror=bu((function(){n(new Ec.NoSuchDatabase("Database "+e+" doesnt exist"))}))}else{r.onerror=$u(n),T((t.oldVersion>Math.pow(2,62)?0:t.oldVersion)/10,r,n)}}),n),i.onsuccess=bu((function(){if(r=null,m=i.result,zu.push(C),I)!function(){if(C.verno=m.version/10,C._dbSchema=f={},0===(v=Ys(m.objectStoreNames,0)).length)return;var e=m.transaction(ol(v),"readonly");v.forEach((function(t){for(var n=e.objectStore(t),r=n.keyPath,i=r&&"string"==typeof r&&-1!==r.indexOf("."),o=new rl(r,r||"",!1,!1,!!n.autoIncrement,r&&"string"!=typeof r,i),a=[],s=0;s<n.indexNames.length;++s){var c=n.index(n.indexNames[s]);i=(r=c.keyPath)&&"string"==typeof r&&-1!==r.indexOf(".");var u=new rl(c.name,r,!!c.unique,!!c.multiEntry,!1,r&&"string"!=typeof r,i);a.push(u)}f[t]=new il(t,o,a,{})})),U([g],Ds(f),f)}();else if(m.objectStoreNames.length>0)try{Z(f,m.transaction(ol(m.objectStoreNames),"readonly"))}catch(e){}m.onversionchange=bu((function(e){C._vcFired=!0,C.on("versionchange").fire(e)})),_||"__dbnames"===e||Hu.dbnames.put({name:e}).catch(_c),t()}),n)}))]).then((function(){return S=[],ou.resolve(qu.vip(C.on.ready.fire)).then((function e(){if(S.length>0){var t=S.reduce(Pc,_c);return S=[],ou.resolve(qu.vip(t)).then(e)}}))})).finally((function(){S=null})).then((function(){return b=!1,C})).catch((function(e){try{r&&r.abort()}catch(e){}return b=!1,C.close(),Gu(y=e)})).finally((function(){w=!0,t()}))},this.close=function(){var e=zu.indexOf(C);if(e>=0&&zu.splice(e,1),m){try{m.close()}catch(e){}m=null}l=!1,y=new Ec.DatabaseClosed,b&&r(y),E=new ou((function(e){n=e})),x=new ou((function(e,t){r=t}))},this.delete=function(){var t=arguments.length>0;return new ou((function(n,r){if(t)throw new Ec.InvalidArgument("Arguments not allowed in db.delete()");function i(){C.close();var t=h.deleteDatabase(e);t.onsuccess=bu((function(){_||Hu.dbnames.delete(e).catch(_c),n()})),t.onerror=$u(r),t.onblocked=J}b?E.then(i):i()}))},this.backendDB=function(){return m},this.isOpen=function(){return null!==m},this.hasBeenClosed=function(){return y&&y instanceof Ec.DatabaseClosed},this.hasFailed=function(){return null!==y},this.dynamicallyOpened=function(){return I},this.name=e,js(this,{tables:{get:function(){return Ds(g).map((function(e){return g[e]}))}}}),this.on=ju(this,"populate","blocked","versionchange",{ready:[Pc,_c]}),this.on.ready.subscribe=Vs(this.on.ready.subscribe,(function(e){return function(t,n){qu.vip((function(){w?(y||ou.resolve().then(t),n&&e(t)):S?(S.push(t),n&&e(t)):(e(t),n||e((function e(){C.on.ready.unsubscribe(t),C.on.ready.unsubscribe(e)})))}))}})),this.transaction=function(){var e=D.apply(this,arguments);return this._transaction.apply(this,e)},this._transaction=function(e,t,n){var r=tu.trans;r&&r.db===C&&-1===e.indexOf("!")||(r=null);var i=-1!==e.indexOf("?");e=e.replace("!","").replace("?","");try{var o=t.map((function(e){var t=e instanceof N?e.name:e;if("string"!=typeof t)throw new TypeError("Invalid table argument to Dexie.transaction(). Only Table or String are allowed");return t}));if("r"==e||"readonly"==e)e="readonly";else{if("rw"!=e&&e!=k)throw new Ec.InvalidArgument("Invalid transaction mode: "+e);e=k}if(r){if("readonly"===r.mode&&e===k){if(!i)throw new Ec.SubTransaction("Cannot enter a sub-transaction with READWRITE mode when parent transaction is READONLY");r=null}r&&o.forEach((function(e){if(r&&-1===r.storeNames.indexOf(e)){if(!i)throw new Ec.SubTransaction("Table "+e+" not included in parent transaction.");r=null}})),i&&r&&!r.active&&(r=null)}}catch(e){return r?r._promise(null,(function(t,n){n(e)})):Gu(e)}return r?r._promise(e,a,"lock"):tu.trans?Lu(tu.transless,(function(){return C._whenReady(a)})):C._whenReady(a);function a(){return ou.resolve().then((function(){var t,i=tu.transless||tu,a=C._createTransaction(e,o,f,r),s={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create(),n.constructor===Fc&&_u();var c=ou.follow((function(){if(t=n.call(a,a))if(t.constructor===Kc){var e=Au.bind(null,null);t.then(e,e)}else"function"==typeof t.next&&"function"==typeof t.throw&&(t=nl(t))}),s);return(t&&"function"==typeof t.then?ou.resolve(t).then((function(e){return a.active?e:Gu(new Ec.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):c.then((function(){return t}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),Gu(e)}))}))}},this.table=function(e){if(!Gs(g,e))throw new Ec.InvalidTable("Table "+e+" does not exist");return g[e]},js(N.prototype,{_trans:function(e,t,n){var r=this._tx||tu.trans;return r&&r.db===C?r===tu.trans?r._promise(e,t,n):Iu((function(){return r._promise(e,t,n)}),{trans:r,transless:tu.transless||tu}):function e(t,n,r){if(w||tu.letThrough){var i=C._createTransaction(t,n,f);try{i.create()}catch(e){return Gu(e)}return i._promise(t,(function(e,t){return Iu((function(){return tu.trans=i,r(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!b){if(!l)return Gu(new Ec.DatabaseClosed);C.open().catch(_c)}return E.then((function(){return e(t,n,r)}))}(e,[this.name],t)},_idbstore:function(e,t,n){var r=this.name;return this._trans(e,(function(e,n,i){if(-1===i.storeNames.indexOf(r))throw new Ec.NotFound("Table"+r+" not part of transaction");return t(e,n,i.idbtrans.objectStore(r),i)}),n)},get:function(e,t){if(e&&e.constructor===Object)return this.where(e).first(t);var n=this;return this._idbstore("readonly",(function(t,r,i){var o=i.get(e);o.onerror=$u(r),o.onsuccess=bu((function(){t(n.hook.reading.fire(o.result))}),r)})).then(t)},where:function(e){if("string"==typeof e)return new B(this,e);if(Ns(e))return new B(this,"["+e.join("+")+"]");var t=Ds(e);if(1===t.length)return this.where(t[0]).equals(e[t[0]]);var n=this.schema.indexes.concat(this.schema.primKey).filter((function(e){return e.compound&&t.every((function(t){return e.keyPath.indexOf(t)>=0}))&&e.keyPath.every((function(e){return t.indexOf(e)>=0}))}))[0];if(n&&Ku!==Uu)return this.where(n.name).equals(n.keyPath.map((function(t){return e[t]})));n||console.warn("The query "+JSON.stringify(e)+" on "+this.name+" would benefit of a compound index ["+t.join("+")+"]");var r=this.schema.idxByName,i=t.reduce((function(t,n){return[t[0]||r[n],t[0]||!r[n]?q(t[1],(function(t){return""+$s(t,n)==""+e[n]})):t[1]]}),[null,null]),o=i[0];return o?this.where(o.name).equals(e[o.keyPath]).filter(i[1]):n?this.filter(i[1]):this.where(t).equals("")},count:function(e){return this.toCollection().count(e)},offset:function(e){return this.toCollection().offset(e)},limit:function(e){return this.toCollection().limit(e)},reverse:function(){return this.toCollection().reverse()},filter:function(e){return this.toCollection().and(e)},each:function(e){return this.toCollection().each(e)},toArray:function(e){return this.toCollection().toArray(e)},orderBy:function(e){return new G(new B(this,Ns(e)?"["+e.join("+")+"]":e))},toCollection:function(){return new G(new B(this))},mapToClass:function(e,t){this.schema.mappedClass=e;var n=Object.create(e.prototype);t&&Zu(n,t),this.schema.instanceTemplate=n;var r=function(t){if(!t)return t;var n=Object.create(e.prototype);for(var r in t)if(Gs(t,r))try{n[r]=t[r]}catch(e){}return n};return this.schema.readHook&&this.hook.reading.unsubscribe(this.schema.readHook),this.schema.readHook=r,this.hook("reading",r),e},defineClass:function(e){return this.mapToClass(qu.defineClass(e),e)},bulkDelete:function(e){return this.hook.deleting.fire===_c?this._idbstore(k,(function(t,n,r,i){t(P(r,i,e,!1,_c))})):this.where(":id").anyOf(e).delete().then((function(){}))},bulkPut:function(e,t){var n=this;return this._idbstore(k,(function(r,i,o){if(!o.keyPath&&!n.schema.primKey.auto&&!t)throw new Ec.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new Ec.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ec.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return r();var a,s,c=function(e){0===u.length?r(e):i(new wc(n.name+".bulkPut(): "+u.length+" of "+l+" operations failed",u))},u=[],l=e.length,h=n;if(n.hook.creating.fire===_c&&n.hook.updating.fire===_c){s=L(u);for(var d=0,f=e.length;d<f;++d)(a=t?o.put(e[d],t[d]):o.put(e[d])).onerror=s;a.onerror=L(u,c),a.onsuccess=Qu(c)}else{var p=t||o.keyPath&&e.map((function(e){return $s(e,o.keyPath)})),v=p&&qs(p,(function(t,n){return null!=t&&[t,e[n]]}));(p?h.where(":id").anyOf(p.filter((function(e){return null!=e}))).modify((function(){this.value=v[this.primKey],v[this.primKey]=null})).catch(Sc,(function(e){u=e.failures})).then((function(){for(var n=[],r=t&&[],i=p.length-1;i>=0;--i){var o=p[i];(null==o||v[o])&&(n.push(e[i]),t&&r.push(o),null!=o&&(v[o]=null))}return n.reverse(),t&&r.reverse(),h.bulkAdd(n,r)})).then((function(e){var t=p[p.length-1];return null!=t?t:e})):h.bulkAdd(e)).then(c).catch(wc,(function(e){u=u.concat(e.failures),c()})).catch(i)}}),"locked")},bulkAdd:function(e,t){var n=this,r=this.hook.creating.fire;return this._idbstore(k,(function(i,o,a,s){if(!a.keyPath&&!n.schema.primKey.auto&&!t)throw new Ec.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(a.keyPath&&t)throw new Ec.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ec.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return i();function c(e){0===d.length?i(e):o(new wc(n.name+".bulkAdd(): "+d.length+" of "+f+" operations failed",d))}var u,l,h,d=[],f=e.length;if(r!==_c){var p,v=a.keyPath;l=L(d,null,!0),h=Ju(null),Js((function(){for(var n=0,i=e.length;n<i;++n){p={onerror:null,onsuccess:null};var o=t&&t[n],c=e[n],d=t?o:v?$s(c,v):void 0,f=r.call(p,d,c,s);null==d&&null!=f&&(v?Qs(c=ic(c),v,f):o=f),(u=null!=o?a.add(c,o):a.add(c))._hookCtx=p,n<i-1&&(u.onerror=l,p.onsuccess&&(u.onsuccess=h))}}),(function(e){throw p.onerror&&p.onerror(e),e})),u.onerror=L(d,c,!0),u.onsuccess=Ju(c)}else{l=L(d);for(var g=0,m=e.length;g<m;++g)(u=t?a.add(e[g],t[g]):a.add(e[g])).onerror=l;u.onerror=L(d,c),u.onsuccess=Qu(c)}}))},add:function(e,t){var n=this.hook.creating.fire;return this._idbstore(k,(function(r,i,o,a){var s={onsuccess:null,onerror:null};if(n!==_c){var c=null!=t?t:o.keyPath?$s(e,o.keyPath):void 0,u=n.call(s,c,e,a);null==c&&null!=u&&(o.keyPath?Qs(e,o.keyPath,u):t=u)}try{var l=null!=t?o.add(e,t):o.add(e);l._hookCtx=s,l.onerror=el(i),l.onsuccess=Ju((function(t){var n=o.keyPath;n&&Qs(e,n,t),r(t)}))}catch(e){throw s.onerror&&s.onerror(e),e}}))},put:function(e,t){var n=this,r=this.hook.creating.fire,i=this.hook.updating.fire;if(r!==_c||i!==_c){var o=this.schema.primKey.keyPath,a=void 0!==t?t:o&&$s(e,o);return null==a?this.add(e):(e=ic(e),this._trans(k,(function(){return n.where(":id").equals(a).modify((function(){this.value=e})).then((function(r){return 0===r?n.add(e,t):a}))}),"locked"))}return this._idbstore(k,(function(n,r,i){var o=void 0!==t?i.put(e,t):i.put(e);o.onerror=$u(r),o.onsuccess=bu((function(t){var r=i.keyPath;r&&Qs(e,r,t.target.result),n(o.result)}))}))},delete:function(e){return this.hook.deleting.subscribers.length?this.where(":id").equals(e).delete():this._idbstore(k,(function(t,n,r){var i=r.delete(e);i.onerror=$u(n),i.onsuccess=bu((function(){t(i.result)}))}))},clear:function(){return this.hook.deleting.subscribers.length?this.toCollection().delete():this._idbstore(k,(function(e,t,n){var r=n.clear();r.onerror=$u(t),r.onsuccess=bu((function(){e(r.result)}))}))},update:function(e,t){if("object"!=typeof t||Ns(t))throw new Ec.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||Ns(e))return this.where(":id").equals(e).modify(t);Ds(t).forEach((function(n){Qs(e,n,t[n])}));var n=$s(e,this.schema.primKey.keyPath);return void 0===n?Gu(new Ec.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}}),js(M.prototype,{_lock:function(){return Xs(!tu.global),++this._reculock,1!==this._reculock||tu.global||(tu.lockOwnerFor=this),this},_unlock:function(){if(Xs(!tu.global),0==--this._reculock)for(tu.global||(tu.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{Lu(e[1],e[0])}catch(e){}}return this},_locked:function(){return this._reculock&&tu.lockOwnerFor!==this},create:function(e){var t=this;if(!this.mode)return this;if(Xs(!this.idbtrans),!e&&!m)switch(y&&y.name){case"DatabaseClosedError":throw new Ec.DatabaseClosed(y);case"MissingAPIError":throw new Ec.MissingAPI(y.message,y);default:throw new Ec.OpenFailed(y)}if(!this.active)throw new Ec.TransactionInactive;return Xs(null===this._completion._state),(e=this.idbtrans=e||m.transaction(ol(this.storeNames),this.mode)).onerror=bu((function(n){tl(n),t._reject(e.error)})),e.onabort=bu((function(n){tl(n),t.active&&t._reject(new Ec.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=bu((function(){t.active=!1,t._resolve()})),this},_promise:function(e,t,n){var r=this;if(e===k&&this.mode!==k)return Gu(new Ec.ReadOnly("Transaction is readonly"));if(!this.active)return Gu(new Ec.TransactionInactive);if(this._locked())return new ou((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},tu])}));if(n)return Iu((function(){var e=new ou((function(e,n){r._lock();var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return e.finally((function(){return r._unlock()})),e._lib=!0,e}));var i=new ou((function(e,n){var i=t(e,n,r);i&&i.then&&i.then(e,n)}));return i._lib=!0,i},_root:function(){return this.parent?this.parent._root():this},waitFor:function(e){var t=this._root();if(e=ou.resolve(e),t._waitingFor)t._waitingFor=t._waitingFor.then((function(){return e}));else{t._waitingFor=e,t._waitingQueue=[];var n=t.idbtrans.objectStore(t.storeNames[0]);!function e(){for(++t._spinCount;t._waitingQueue.length;)t._waitingQueue.shift()();t._waitingFor&&(n.get(-1/0).onsuccess=e)}()}var r=t._waitingFor;return new ou((function(n,i){e.then((function(e){return t._waitingQueue.push(bu(n.bind(null,e)))}),(function(e){return t._waitingQueue.push(bu(i.bind(null,e)))})).finally((function(){t._waitingFor===r&&(t._waitingFor=null)}))}))},abort:function(){this.active&&this._reject(new Ec.Abort),this.active=!1},tables:{get:(o="Transaction.tables",a=function(){return g},function(){return console.warn(o+" is deprecated. See https://github.com/dfahlander/Dexie.js/wiki/Deprecations. "+vc(pc(),1)),a.apply(this,arguments)})},table:function(e){return new N(e,C.table(e).schema,this)}}),js(B.prototype,(function(){function e(e,t,n){var r=e instanceof B?new G(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function t(e){return new G(e,(function(){return d.only("")})).limit(0)}function n(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,c=0;c<a;++c){var u=t[c];if(u!==r[c])return i(e[c],n[c])<0?e.substr(0,c)+n[c]+n.substr(c+1):i(e[c],r[c])<0?e.substr(0,c)+r[c]+n.substr(c+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[c],u)<0&&(s=c)}return a<r.length&&"next"===o?e+n.substr(e.length):a<e.length&&"prev"===o?e.substr(0,n.length):s<0?null:e.substr(0,s)+r[s]+n.substr(s+1)}function r(t,r,i,o){var a,s,c,u,l,h,f,p=i.length;if(!i.every((function(e){return"string"==typeof e})))return e(t,"String expected.");function v(e){a=function(e){return"next"===e?function(e){return e.toUpperCase()}:function(e){return e.toLowerCase()}}(e),s=function(e){return"next"===e?function(e){return e.toLowerCase()}:function(e){return e.toUpperCase()}}(e),c="next"===e?X:W;var t=i.map((function(e){return{lower:s(e),upper:a(e)}})).sort((function(e,t){return c(e.lower,t.lower)}));u=t.map((function(e){return e.upper})),l=t.map((function(e){return e.lower})),h=e,f="next"===e?"":o}v("next");var g=new G(t,(function(){return d.bound(u[0],l[p-1]+o)}));g._ondirectionchange=function(e){v(e)};var m=0;return g._addAlgorithm((function(e,t,i){var o=e.key;if("string"!=typeof o)return!1;var a=s(o);if(r(a,l,m))return!0;for(var d=null,v=m;v<p;++v){var g=n(o,a,u[v],l[v],c,h);null===g&&null===d?m=v+1:(null===d||c(d,g)>0)&&(d=g)}return t(null!==d?function(){e.continue(d+f)}:i),!1})),g}return{between:function(n,r,i,o){i=!1!==i,o=!0===o;try{return F(n,r)>0||0===F(n,r)&&(i||o)&&(!i||!o)?t(this):new G(this,(function(){return d.bound(n,r,!i,!o)}))}catch(t){return e(this,Fu)}},equals:function(e){return new G(this,(function(){return d.only(e)}))},above:function(e){return new G(this,(function(){return d.lowerBound(e,!0)}))},aboveOrEqual:function(e){return new G(this,(function(){return d.lowerBound(e)}))},below:function(e){return new G(this,(function(){return d.upperBound(e,!0)}))},belowOrEqual:function(e){return new G(this,(function(){return d.upperBound(e)}))},startsWith:function(t){return"string"!=typeof t?e(this,"String expected."):this.between(t,t+Uu,!0,!0)},startsWithIgnoreCase:function(e){return""===e?this.startsWith(e):r(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Uu)},equalsIgnoreCase:function(e){return r(this,(function(e,t){return e===t[0]}),[e],"")},anyOfIgnoreCase:function(){var e=uc.apply(cc,arguments);return 0===e.length?t(this):r(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},startsWithAnyOfIgnoreCase:function(){var e=uc.apply(cc,arguments);return 0===e.length?t(this):r(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Uu)},anyOf:function(){var n=uc.apply(cc,arguments),r=Y;try{n.sort(r)}catch(t){return e(this,Fu)}if(0===n.length)return t(this);var i=new G(this,(function(){return d.bound(n[0],n[n.length-1])}));i._ondirectionchange=function(e){r="next"===e?Y:V,n.sort(r)};var o=0;return i._addAlgorithm((function(e,t,i){for(var a=e.key;r(a,n[o])>0;)if(++o===n.length)return t(i),!1;return 0===r(a,n[o])||(t((function(){e.continue(n[o])})),!1)})),i},notEqual:function(e){return this.inAnyRange([[-1/0,e],[e,Ku]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=uc.apply(cc,arguments);if(0===t.length)return new G(this);try{t.sort(Y)}catch(t){return e(this,Fu)}var n=t.reduce((function(e,t){return e?e.concat([[e[e.length-1][1],t]]):[[-1/0,t]]}),null);return n.push([t[t.length-1],Ku]),this.inAnyRange(n,{includeLowers:!1,includeUppers:!1})},inAnyRange:function(n,r){if(0===n.length)return t(this);if(!n.every((function(e){return void 0!==e[0]&&void 0!==e[1]&&Y(e[0],e[1])<=0})))return e(this,"First argument to inAnyRange() must be an Array of two-value Arrays [lower,upper] where upper must not be lower than lower",Ec.InvalidArgument);var i=!r||!1!==r.includeLowers,o=r&&!0===r.includeUppers;var a,s=Y;function c(e,t){return s(e[0],t[0])}try{(a=n.reduce((function(e,t){for(var n=0,r=e.length;n<r;++n){var i=e[n];if(F(t[0],i[1])<0&&F(t[1],i[0])>0){i[0]=(o=i[0],a=t[0],F(o,a)<0?o:a),i[1]=z(i[1],t[1]);break}}var o,a;return n===r&&e.push(t),e}),[])).sort(c)}catch(t){return e(this,Fu)}var u=0,l=o?function(e){return Y(e,a[u][1])>0}:function(e){return Y(e,a[u][1])>=0},h=i?function(e){return V(e,a[u][0])>0}:function(e){return V(e,a[u][0])>=0};var f=l,p=new G(this,(function(){return d.bound(a[0][0],a[a.length-1][1],!i,!o)}));return p._ondirectionchange=function(e){"next"===e?(f=l,s=Y):(f=h,s=V),a.sort(c)},p._addAlgorithm((function(e,t,n){for(var r=e.key;f(r);)if(++u===a.length)return t(n),!1;return!!function(e){return!l(e)&&!h(e)}(r)||(0===F(r,a[u][1])||0===F(r,a[u][0])||t((function(){s===Y?e.continue(a[u][0]):e.continue(a[u][1])})),!1)})),p},startsWithAnyOf:function(){var n=uc.apply(cc,arguments);return n.every((function(e){return"string"==typeof e}))?0===n.length?t(this):this.inAnyRange(n.map((function(e){return[e,e+Uu]}))):e(this,"startsWithAnyOf() only works with strings")}}})),js(G.prototype,(function(){function e(e,t){e.filter=q(e.filter,t)}function t(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return q(r(),t())}:t,e.justLimit=n&&!r}function n(e,t){if(e.isPrimKey)return t;var n=e.table.schema.idxByName[e.index];if(!n)throw new Ec.Schema("KeyPath "+e.index+" on object store "+t.name+" is not indexed");return t.index(n.name)}function r(e,t){var r=n(e,t);return e.keysOnly&&"openKeyCursor"in r?r.openKeyCursor(e.range||null,e.dir+e.unique):r.openCursor(e.range||null,e.dir+e.unique)}function o(e,t,n,i,o){var a=e.replayFilter?q(e.filter,e.replayFilter()):e.filter;e.or?function(){var s={},c=0;function u(){2==++c&&n()}function l(e,n,r){if(!a||a(n,r,u,i)){var o=n.primaryKey,c=""+o;"[object ArrayBuffer]"===c&&(c=""+new Uint8Array(o)),Gs(s,c)||(s[c]=!0,t(e,n,r))}}e.or._iterate(l,u,i,o),K(r(e,o),e.algorithm,l,u,i,!e.keysOnly&&e.valueMapper)}():K(r(e,o),q(e.algorithm,a),t,n,i,!e.keysOnly&&e.valueMapper)}return{_read:function(e,t){var n=this._ctx;return n.error?n.table._trans(null,Gu.bind(null,n.error)):n.table._idbstore("readonly",e).then(t)},_write:function(e){var t=this._ctx;return t.error?t.table._trans(null,Gu.bind(null,t.error)):t.table._idbstore(k,e,"locked")},_addAlgorithm:function(e){var t=this._ctx;t.algorithm=q(t.algorithm,e)},_iterate:function(e,t,n,r){return o(this._ctx,e,t,n,r)},clone:function(e){var t=Object.create(this.constructor.prototype),n=Object.create(this._ctx);return e&&Ps(n,e),t._ctx=n,t},raw:function(){return this._ctx.valueMapper=null,this},each:function(e){var t=this._ctx;return this._read((function(n,r,i){o(t,e,n,r,i)}))},count:function(e){var t=this._ctx;if(j(t,!0))return this._read((function(e,r,i){var o=n(t,i),a=t.range?o.count(t.range):o.count();a.onerror=$u(r),a.onsuccess=function(n){e(Math.min(n.target.result,t.limit))}}),e);var r=0;return this._read((function(e,n,i){o(t,(function(){return++r,!1}),(function(){e(r)}),n,i)}),e)},sortBy:function(e,t){var n=e.split(".").reverse(),r=n[0],i=n.length-1;function o(e,t){return t?o(e[n[t]],t-1):e[r]}var a="next"===this._ctx.dir?1:-1;function s(e,t){var n=o(e,i),r=o(t,i);return n<r?-a:n>r?a:0}return this.toArray((function(e){return e.sort(s)})).then(t)},toArray:function(e){var t=this._ctx;return this._read((function(e,r,a){if(i&&"next"===t.dir&&j(t,!0)&&t.limit>0){var s=t.table.hook.reading.fire,c=n(t,a),u=t.limit<1/0?c.getAll(t.range,t.limit):c.getAll(t.range);u.onerror=$u(r),u.onsuccess=Qu(s===Ac?e:function(t){try{e(t.map(s))}catch(e){r(e)}})}else{var l=[];o(t,(function(e){l.push(e)}),(function(){e(l)}),r,a)}}),e)},offset:function(e){var n=this._ctx;return e<=0||(n.offset+=e,j(n)?t(n,(function(){var t=e;return function(e,n){return 0===t||(1===t?(--t,!1):(n((function(){e.advance(t),t=0})),!1))}})):t(n,(function(){var t=e;return function(){return--t<0}}))),this},limit:function(e){return this._ctx.limit=Math.min(this._ctx.limit,e),t(this._ctx,(function(){var t=e;return function(e,n,r){return--t<=0&&n(r),t>=0}}),!0),this},until:function(t,n){return e(this._ctx,(function(e,r,i){return!t(e.value)||(r(i),n)})),this},first:function(e){return this.limit(1).toArray((function(e){return e[0]})).then(e)},last:function(e){return this.reverse().first(e)},filter:function(t){return e(this._ctx,(function(e){return t(e.value)})),function(e,t){e.isMatch=q(e.isMatch,t)}(this._ctx,t),this},and:function(e){return this.filter(e)},or:function(e){return new B(this._ctx.table,e,this)},reverse:function(){return this._ctx.dir="prev"===this._ctx.dir?"next":"prev",this._ondirectionchange&&this._ondirectionchange(this._ctx.dir),this},desc:function(){return this.reverse()},eachKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.key,n)}))},eachUniqueKey:function(e){return this._ctx.unique="unique",this.eachKey(e)},eachPrimaryKey:function(e){var t=this._ctx;return t.keysOnly=!t.isMatch,this.each((function(t,n){e(n.primaryKey,n)}))},keys:function(e){var t=this._ctx;t.keysOnly=!t.isMatch;var n=[];return this.each((function(e,t){n.push(t.key)})).then((function(){return n})).then(e)},primaryKeys:function(e){var t=this._ctx;if(i&&"next"===t.dir&&j(t,!0)&&t.limit>0)return this._read((function(e,r,i){var o=n(t,i),a=t.limit<1/0?o.getAllKeys(t.range,t.limit):o.getAllKeys(t.range);a.onerror=$u(r),a.onsuccess=Qu(e)})).then(e);t.keysOnly=!t.isMatch;var r=[];return this.each((function(e,t){r.push(t.primaryKey)})).then((function(){return r})).then(e)},uniqueKeys:function(e){return this._ctx.unique="unique",this.keys(e)},firstKey:function(e){return this.limit(1).keys((function(e){return e[0]})).then(e)},lastKey:function(e){return this.reverse().firstKey(e)},distinct:function(){var t=this._ctx,n=t.index&&t.table.schema.idxByName[t.index];if(!n||!n.multi)return this;var r={};return e(this._ctx,(function(e){var t=e.primaryKey.toString(),n=Gs(r,t);return r[t]=!0,!n})),this},modify:function(e){var t=this,n=this._ctx.table.hook,r=n.updating.fire,i=n.deleting.fire;return this._write((function(n,o,a,s){var c;if("function"==typeof e)c=r===_c&&i===_c?e:function(t){var n=ic(t);if(!1===e.call(this,t,this))return!1;if(Gs(this,"value")){var o=oc(n,this.value),a=r.call(this,o,this.primKey,n,s);a&&(t=this.value,Ds(a).forEach((function(e){Qs(t,e,a[e])})))}else i.call(this,this.primKey,t,s)};else if(r===_c){var u=Ds(e),l=u.length;c=function(t){for(var n=!1,r=0;r<l;++r){var i=u[r],o=e[i];$s(t,i)!==o&&(Qs(t,i,o),n=!0)}return n}}else{var h=e;e=ec(h),c=function(t){var n=!1,i=r.call(this,e,this.primKey,ic(t),s);return i&&Ps(e,i),Ds(e).forEach((function(r){var i=e[r];$s(t,r)!==i&&(Qs(t,r,i),n=!0)})),i&&(e=ec(h)),n}}var d=0,f=0,p=!1,v=[],g=[],m=null;function y(e){return e&&(v.push(e),g.push(m)),o(new Sc("Error modifying one or more objects",v,f,g))}function b(){p&&f+v.length===d&&(v.length>0?y():n(f))}t.clone().raw()._iterate((function(e,t){m=t.primaryKey;var n={primKey:t.primaryKey,value:e,onsuccess:null,onerror:null};function r(e){return v.push(e),g.push(n.primKey),b(),!0}if(!1!==c.call(n,e,n)){var i=!Gs(n,"value");++d,Js((function(){var e=i?t.delete():t.update(n.value);e._hookCtx=n,e.onerror=el(r),e.onsuccess=Ju((function(){++f,b()}))}),r)}else n.onsuccess&&n.onsuccess(n.value)}),(function(){p=!0,b()}),y,a)}))},delete:function(){var e=this,t=this._ctx,n=t.range,r=t.table.hook.deleting.fire,i=r!==_c;if(!i&&j(t)&&(t.isPrimKey&&!Xu||!n))return this._write((function(e,t,r){var i=$u(t),o=n?r.count(n):r.count();o.onerror=i,o.onsuccess=function(){var a=o.result;Js((function(){var t=n?r.delete(n):r.clear();t.onerror=i,t.onsuccess=function(){return e(a)}}),(function(e){return t(e)}))}}));var o=i?2e3:1e4;return this._write((function(n,a,s,c){var u=0,l=e.clone({keysOnly:!t.isMatch&&!i}).distinct().limit(o).raw(),h=[],d=function(){return l.each(i?function(e,t){h.push([t.primaryKey,t.value])}:function(e,t){h.push(t.primaryKey)}).then((function(){return i?h.sort((function(e,t){return Y(e[0],t[0])})):h.sort(Y),P(s,c,h,i,r)})).then((function(){var e=h.length;return u+=e,h=[],e<o?u:d()}))};n(d())}))}}})),Ps(this,{Collection:G,Table:N,Transaction:M,Version:A,WhereClause:B}),C.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+C.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+C.name+"'. Closing db now to resume the delete request."),C.close()})),C.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+C.name+"') was blocked"):console.warn("Upgrade '"+C.name+"' blocked by other connection holding version "+e.oldVersion/10)})),u.forEach((function(e){e(C)}))}function Zu(e,t){return Ds(t).forEach((function(n){var r=function e(t){if("function"==typeof t)return new t;if(Ns(t))return[e(t[0])];if(t&&"object"==typeof t){var n={};return Zu(n,t),n}return t}(t[n]);e[n]=r})),e}function Ju(e){return bu((function(t){var n=t.target,r=n._hookCtx,i=r.value||n.result,o=r&&r.onsuccess;o&&o(i),e&&e(i)}),e)}function $u(e){return bu((function(t){return tl(t),e(t.target.error),!1}))}function Qu(e){return bu((function(t){e(t.target.result)}))}function el(e){return bu((function(t){var n=t.target,r=n.error,i=n._hookCtx,o=i&&i.onerror;return o&&o(r),tl(t),e(r),!1}))}function tl(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function nl(e){var t=function(t){return e.next(t)},n=i(t),r=i((function(t){return e.throw(t)}));function i(e){return function(t){var i=e(t),o=i.value;return i.done?o:o&&"function"==typeof o.then?o.then(n,r):Ns(o)?ou.all(o).then(n,r):n(o)}}return i(t)()}function rl(e,t,n,r,i,o,a){this.name=e,this.keyPath=t,this.unique=n,this.multi=r,this.auto=i,this.compound=o,this.dotted=a;var s="string"==typeof t?t:t&&"["+[].join.call(t,"+")+"]";this.src=(n?"&":"")+(r?"*":"")+(i?"++":"")+s}function il(e,t,n,r){this.name=e,this.primKey=t||new rl,this.indexes=n||[new rl],this.instanceTemplate=r,this.mappedClass=null,this.idxByName=qs(n,(function(e){return[e.name,e]}))}function ol(e){return 1===e.length?e[0]:e}function al(e){var t=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);return t&&t.bind(e)}hc(lc,Wu),js(qu,Ic),js(qu,{delete:function(e){var t=new qu(e),n=t.delete();return n.onblocked=function(e){return t.on("blocked",e),this},n},exists:function(e){return new qu(e).open().then((function(e){return e.close(),!0})).catch(qu.NoSuchDatabaseError,(function(){return!1}))},getDatabaseNames:function(e){var t=al(qu.dependencies.indexedDB);return t?new ou((function(e,n){var r=t();r.onsuccess=function(t){e(Ys(t.target.result,0))},r.onerror=$u(n)})).then(e):Hu.dbnames.toCollection().primaryKeys(e)},defineClass:function(){return function(e){e&&Ps(this,e)}},applyStructure:Zu,ignoreTransaction:function(e){return tu.trans?Lu(tu.transless,e):e()},vip:function(e){return Iu((function(){return tu.letThrough=!0,e()}))},async:function(e){return function(){try{var t=nl(e.apply(this,arguments));return t&&"function"==typeof t.then?t:ou.resolve(t)}catch(e){return Gu(e)}}},spawn:function(e,t,n){try{var r=nl(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:ou.resolve(r)}catch(e){return Gu(e)}},currentTransaction:{get:function(){return tu.trans||null}},waitFor:function(e,t){var n=ou.resolve("function"==typeof e?qu.ignoreTransaction(e):e).timeout(t||6e4);return tu.trans?tu.trans.waitFor(n):n},Promise:ou,debug:{get:function(){return lc},set:function(e){hc(e,"dexie"===e?function(){return!0}:Wu)}},derive:Ks,extend:Ps,props:js,override:Vs,Events:ju,getByKeyPath:$s,setByKeyPath:Qs,delByKeyPath:function(e,t){"string"==typeof t?Qs(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Qs(e,t,void 0)}))},shallowClone:ec,deepClone:ic,getObjectDiff:oc,asap:Ws,maxKey:Ku,minKey:-1/0,addons:[],connections:zu,MultiModifyError:Ec.Modify,errnames:kc,IndexSpec:rl,TableSchema:il,dependencies:function(){try{return{indexedDB:Ls.indexedDB||Ls.mozIndexedDB||Ls.webkitIndexedDB||Ls.msIndexedDB,IDBKeyRange:Ls.IDBKeyRange||Ls.webkitIDBKeyRange}}catch(e){return{indexedDB:null,IDBKeyRange:null}}}(),semVer:"{version}",version:"{version}".split(".").map((function(e){return parseInt(e)})).reduce((function(e,t,n){return e+t/Math.pow(10,2*n)})),default:qu,Dexie:qu}),ou.rejectionMapper=function(e,t){if(!e||e instanceof bc||e instanceof TypeError||e instanceof SyntaxError||!e.name||!xc[e.name])return e;var n=new xc[e.name](t||e.message,e);return"stack"in e&&Us(n,"stack",{get:function(){return this.inner.stack}}),n},(Hu=new qu("__dbnames")).version(1).stores({dbnames:"name"}),function(){try{void 0!==typeof localStorage&&void 0!==Ls.document&&(JSON.parse(localStorage.getItem("Dexie.DatabaseNames")||"[]").forEach((function(e){return Hu.dbnames.put({name:e}).catch(_c)})),localStorage.removeItem("Dexie.DatabaseNames"))}catch(e){}}();var sl={storage:window.localStorage,set:function(e,t){if(t){var n=cl(t)||"";this.storage.setItem(e,n)}},get:function(e){if(e){var t=this.storage.getItem(e),n=t||"";try{n=JSON.parse(n)}catch(e){n=t||""}return n}},remove:function(e){e&&this.storage.removeItem(e)},clear:function(){this.storage.clear()},removeList:function(e){var t,n=v(e);try{for(n.s();!(t=n.n()).done;){var r=t.value;this.storage.removeItem(r)}}catch(e){n.e(e)}finally{n.f()}}},cl=function(e){if(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t?JSON.stringify(e):e}};function ul(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{c(r.next(e))}catch(e){o(e)}}function s(e){try{c(r.throw(e))}catch(e){o(e)}}function c(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}c((r=r.apply(e,t||[])).next())}))}function ll(e,t){var n,r,i,o,a={label:0,sent:function(){if(1&i[0])throw i[1];return i[1]},trys:[],ops:[]};return o={next:s(0),throw:s(1),return:s(2)},"function"==typeof Symbol&&(o[Symbol.iterator]=function(){return this}),o;function s(o){return function(s){return function(o){if(n)throw new TypeError("Generator is already executing.");for(;a;)try{if(n=1,r&&(i=2&o[0]?r.return:o[0]?r.throw||((i=r.return)&&i.call(r),0):r.next)&&!(i=i.call(r,o[1])).done)return i;switch(r=0,i&&(o=[2&o[0],i.value]),o[0]){case 0:case 1:i=o;break;case 4:return a.label++,{value:o[1],done:!1};case 5:a.label++,r=o[1],o=[0];continue;case 7:o=a.ops.pop(),a.trys.pop();continue;default:if(!(i=a.trys,(i=i.length>0&&i[i.length-1])||6!==o[0]&&2!==o[0])){a=0;continue}if(3===o[0]&&(!i||o[1]>i[0]&&o[1]<i[3])){a.label=o[1];break}if(6===o[0]&&a.label<i[1]){a.label=i[1],i=o;break}if(i&&a.label<i[2]){a.label=i[2],a.ops.push(o);break}i[2]&&a.ops.pop(),a.trys.pop();continue}o=t.call(e,a)}catch(e){o=[6,e],r=0}finally{n=i=0}if(5&o[0])throw o[1];return{value:o[0]?o[1]:void 0,done:!0}}([o,s])}}}function hl(e){return[e.schema.primKey].concat(e.schema.indexes).map((function(e){return e.src})).join(",")}function dl(e,t){return new Promise((function(n,r){var i=new FileReader;i.onabort=function(e){return r(new Error("file read aborted"))},i.onerror=function(e){return r(e.target.error)},i.onload=function(e){return n(e.target.result)},"binary"===t?i.readAsArrayBuffer(e):i.readAsText(e)}))}function fl(e,t){if("undefined"==typeof FileReaderSync)throw new Error("FileReaderSync missing. Reading blobs synchronously requires code to run from within a web worker. Use TSON.encapsulateAsync() to do it from the main thread.");var n=new FileReaderSync;return"binary"===t?n.readAsArrayBuffer(e):n.readAsText(e)}var pl="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function vl(e,t){return e(t={exports:{}},t.exports),t.exports}for(var gl=vl((function(e,t){e.exports=function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=Object.keys,r=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,c=["type","replaced","iterateIn","iterateUnsetNumeric"];function u(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function h(t,n){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var r=o(t);if(!r)return!1;var i=a.call(r,"constructor")&&r.constructor;return"function"!=typeof i?null===n:"function"==typeof i&&null!==n&&s.call(i)===s.call(n)}function d(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function f(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,n,o){o=Object.assign({},i,o,{stringification:!0});var a=k(e,null,o);return r(a)?JSON.stringify(a[0],t,n):a.then((function(e){return JSON.stringify(e,t,n)}))};this.stringifySync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),C(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.specialTypeNames=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)},this.rootTypeName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)};var k=this.encapsulate=function(u,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],w=[],k=[],C=!(v&&"cyclic"in v)||v.cyclic,E=v.encapsulateObserver,x=A("",u,C,l||{},k);function I(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(new Set(t)));e&&d(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else f(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return k.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(n,r){return Promise.all(r.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=r.splice(0,1)[0],s=t(a,7),c=s[0],u=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=A(c,i,u,l,o,!0,p),g=h(v,S);return c&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(c?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(x,k)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(x)]:m?I(x):Promise.resolve(I(x));function _(e,t,n){Object.assign(e,t);var r=c.map((function(t){var n=e[t];return delete e[t],n}));n(),c.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,c,u,l){var f=void 0,m={},k=void 0===i?"undefined":e(i),C=E?function(e){var n=l||s.type||p.getJSONType(i);E(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:c,resolvingTypesonPromise:u,awaitingTypesonPromise:h(i,S)},void 0!==n?{type:n}:{}))}:null;if(k in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===k&&(isNaN(i)||i===-1/0||i===1/0)?(f=T(t,i,s,c,!1,u,C))!==i&&(m={replaced:f}):f=i,C&&C(),f;if(null===i)return C&&C(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var x=b.indexOf(i);if(!(x<0))return y[t]="#",C&&C({cyclicKeypath:w[x]}),"#"+w[x];!0===a&&(b.push(i),w.push(t))}var I=d(i),R=r(i),O=(I||R)&&(!o.length||s.replaced)||s.iterateIn?i:T(t,i,s,c,I||R,null,C),D=void 0;if(O!==i?(f=O,m={replaced:O}):R||"array"===s.iterateIn?(D=new Array(i.length),m={clone:D}):I||"object"===s.iterateIn?m={clone:D={}}:""===t&&h(i,S)?(c.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,C&&C(),v.iterateNone)return D||f;if(!D)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};_(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,c,u);h(r,S)?c.push([n,r,!!a,s,D,e,s.type]):void 0!==r&&(D[e]=r)}))};for(var L in i)N(L);C&&C({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);_(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))})),C&&C({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,M=function(e){if(!(e in i)){var n=t+(t?".":"")+e;_(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))}},B=0;B<P;B++)M(B);C&&C({endIterateUnsetNumeric:!0,end:!0})}return D}function T(e,t,n,r,i,c,u){for(var l=i?o:a,h=l.length;h--;){var d=l[h];if(d.test(t,n)){var f=d.type;if(s[f]){var p=y[e];y[e]=p?[f].concat(p):f}return Object.assign(n,{type:f,replaced:!0}),!m&&d.replaceAsync||d.replace?(u&&u({replacing:!0}),A(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),C&&"readonly",n,r,c,f)):(u&&u({typeDetected:!0}),A(e,t,C&&"readonly",n,r,c,f))}}return t}};this.encapsulateSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var C=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,c=e&&e.$types,l=!0;if(!c)return e;if(!0===c)return e.$;c.$&&d(c.$)&&(e=e.$,c=c.$,l=!1);var f=[],p={},v=function e(i,o,a,u,v,m){if(!l||"$types"!==i){var S=c[i];if(r(o)||d(o)){var w=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||w,u,w,t);h(n,b)?w[t]=void 0:void 0!==n&&(w[t]=n)})),o=w;f.length;){var k=t(f[0],4),C=k[0],E=k[1],x=k[2],I=k[3],_=y(C,E);if(h(_,b))x[I]=void 0;else{if(void 0===_)break;x[I]=_}f.splice(0,1)}}if(!S)return o;if("#"===S){var A=y(a,o.substr(1));return void 0===A&&f.push([a,o.substr(1),v,m]),A}var T=u.sync;return[].concat(S).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[T&&n.revive?"revive":!T&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return u(v=h(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(r(i))return i.map(e);i&&n(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var n=i[e],c=n.testPlainObjects?o:a,u=c.filter((function(t){return t.type===e}));if(u.length&&(c.splice(c.indexOf(u[0]),1),delete s[e],delete l[e]),n){if("function"==typeof n){var h=n;n={test:function(e){return e&&e.constructor===h},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(h.prototype),e)}}}else r(n)&&(n={test:n[0],replace:n[1],revive:n[2]});var d={type:e,test:n.test.bind(n)};n.replace&&(d.replace=n.replace.bind(n)),n.replaceAsync&&(d.replaceAsync=n.replaceAsync.bind(n));var f="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(f,0,d):a.splice(f,0,d),n.revive||n.reviveAsync){var g={};n.revive&&(g.revive=n.revive.bind(n)),n.reviveAsync&&(g.reviveAsync=n.reviveAsync.bind(n)),s[e]=g}l[e]=n}}))})),this}}function v(e,t){return n(t).map((function(n){e[n]=t[n]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var n=t.indexOf(".");if(n>-1){var r=e[m(t.substr(0,n))];return void 0===r?void 0:y(r,t.substr(n+1))}return e[m(t)]}function b(){}function S(e){this.p=new Promise(e)}return S.prototype.then=function(e,t){var n=this;return new S((function(r,i){n.p.then((function(t){r(e?e(t):t)}),(function(e){n.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(r,i)}))}))},S.prototype.catch=function(e){return this.then(null,e)},S.resolve=function(e){return new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},["all","race"].map((function(e){S[e]=function(t){return new S((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=S,p.isThenable=u,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=f,p.isPlainObject=d,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var n=o(t);return!n||h(t,Object)||e(n)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":r(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"],p}()})),ml=vl((function(e,t){e.exports=function(){var e="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e},t=function(e,t){if(Array.isArray(e))return e;if(Symbol.iterator in Object(e))return function(e,t){var n=[],r=!0,i=!1,o=void 0;try{for(var a,s=e[Symbol.iterator]();!(r=(a=s.next()).done)&&(n.push(a.value),!t||n.length!==t);r=!0);}catch(e){i=!0,o=e}finally{try{!r&&s.return&&s.return()}finally{if(i)throw o}}return n}(e,t);throw new TypeError("Invalid attempt to destructure non-iterable instance")},n=Object.keys,r=Array.isArray,i={}.toString,o=Object.getPrototypeOf,a={}.hasOwnProperty,s=a.toString,c=["type","replaced","iterateIn","iterateUnsetNumeric"];function u(e,t){return p.isObject(e)&&"function"==typeof e.then&&(!t||"function"==typeof e.catch)}function l(e){return i.call(e).slice(8,-1)}function h(t,n){if(!t||"object"!==(void 0===t?"undefined":e(t)))return!1;var r=o(t);if(!r)return!1;var i=a.call(r,"constructor")&&r.constructor;return"function"!=typeof i?null===n:"function"==typeof i&&null!==n&&s.call(i)===s.call(n)}function d(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function f(t){return t&&"object"===(void 0===t?"undefined":e(t))}function p(i){var o=[],a=[],s={},l=this.types={},m=this.stringify=function(e,t,n,o){o=Object.assign({},i,o,{stringification:!0});var a=k(e,null,o);return r(a)?JSON.stringify(a[0],t,n):a.then((function(e){return JSON.stringify(e,t,n)}))};this.stringifySync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!0}))},this.stringifyAsync=function(e,t,n,r){return m(e,t,n,Object.assign({},{throwOnBadSyncType:!0},r,{sync:!1}))};var w=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),C(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return w(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))},this.specialTypeNames=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.returnTypeNames=!0,this.encapsulate(e,t,n)},this.rootTypeName=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return n.iterateNone=!0,this.encapsulate(e,t,n)};var k=this.encapsulate=function(u,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],w=[],k=[],C=!(v&&"cyclic"in v)||v.cyclic,E=v.encapsulateObserver,x=A("",u,C,l||{},k);function I(e){var t=Object.values(y);if(v.iterateNone)return t.length?t[0]:p.getJSONType(e);if(t.length){if(v.returnTypeNames)return[].concat(function(e){if(Array.isArray(e)){for(var t=0,n=Array(e.length);t<e.length;t++)n[t]=e[t];return n}return Array.from(e)}(new Set(t)));e&&d(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else f(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return k.length?m&&v.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():Promise.resolve(function e(n,r){return Promise.all(r.map((function(e){return e[1].p}))).then((function(i){return Promise.all(i.map((function(i){var o=[],a=r.splice(0,1)[0],s=t(a,7),c=s[0],u=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=A(c,i,u,l,o,!0,p),g=h(v,S);return c&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(c?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(x,k)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(x)]:m?I(x):Promise.resolve(I(x));function _(e,t,n){Object.assign(e,t);var r=c.map((function(t){var n=e[t];return delete e[t],n}));n(),c.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,c,u,l){var f=void 0,m={},k=void 0===i?"undefined":e(i),C=E?function(e){var n=l||s.type||p.getJSONType(i);E(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:c,resolvingTypesonPromise:u,awaitingTypesonPromise:h(i,S)},void 0!==n?{type:n}:{}))}:null;if(k in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===k&&(isNaN(i)||i===-1/0||i===1/0)?(f=T(t,i,s,c,!1,u,C))!==i&&(m={replaced:f}):f=i,C&&C(),f;if(null===i)return C&&C(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var x=b.indexOf(i);if(!(x<0))return y[t]="#",C&&C({cyclicKeypath:w[x]}),"#"+w[x];!0===a&&(b.push(i),w.push(t))}var I=d(i),R=r(i),O=(I||R)&&(!o.length||s.replaced)||s.iterateIn?i:T(t,i,s,c,I||R,null,C),D=void 0;if(O!==i?(f=O,m={replaced:O}):R||"array"===s.iterateIn?(D=new Array(i.length),m={clone:D}):I||"object"===s.iterateIn?m={clone:D={}}:""===t&&h(i,S)?(c.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,C&&C(),v.iterateNone)return D||f;if(!D)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};_(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,c,u);h(r,S)?c.push([n,r,!!a,s,D,e,s.type]):void 0!==r&&(D[e]=r)}))};for(var L in i)N(L);C&&C({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);_(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))})),C&&C({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,M=function(e){if(!(e in i)){var n=t+(t?".":"")+e;_(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,c,u);h(t,S)?c.push([n,t,!!a,s,D,e,s.type]):void 0!==t&&(D[e]=t)}))}},B=0;B<P;B++)M(B);C&&C({endIterateUnsetNumeric:!0,end:!0})}return D}function T(e,t,n,r,i,c,u){for(var l=i?o:a,h=l.length;h--;){var d=l[h];if(d.test(t,n)){var f=d.type;if(s[f]){var p=y[e];y[e]=p?[f].concat(p):f}return Object.assign(n,{type:f,replaced:!0}),!m&&d.replaceAsync||d.replace?(u&&u({replacing:!0}),A(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),C&&"readonly",n,r,c,f)):(u&&u({typeDetected:!0}),A(e,t,C&&"readonly",n,r,c,f))}}return t}};this.encapsulateSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var C=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,c=e&&e.$types,l=!0;if(!c)return e;if(!0===c)return e.$;c.$&&d(c.$)&&(e=e.$,c=c.$,l=!1);var f=[],p={},v=function e(i,o,a,u,v,m){if(!l||"$types"!==i){var S=c[i];if(r(o)||d(o)){var w=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||w,u,w,t);h(n,b)?w[t]=void 0:void 0!==n&&(w[t]=n)})),o=w;f.length;){var k=t(f[0],4),C=k[0],E=k[1],x=k[2],I=k[3],_=y(C,E);if(h(_,b))x[I]=void 0;else{if(void 0===_)break;x[I]=_}f.splice(0,1)}}if(!S)return o;if("#"===S){var A=y(a,o.substr(1));return void 0===A&&f.push([a,o.substr(1),v,m]),A}var T=u.sync;return[].concat(S).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[T&&n.revive?"revive":!T&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return u(v=h(v,b)?void 0:v)?a&&o.throwOnBadSyncType?function(){throw new TypeError("Sync method requested but async result obtained")}():v:!a&&o.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():a?v:Promise.resolve(v)};this.reviveSync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return C(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!1}))},this.register=function(e,t){return t=t||{},[].concat(e).forEach((function e(i){if(r(i))return i.map(e);i&&n(i).forEach((function(e){if("#"===e)throw new TypeError("# cannot be used as a type name as it is reserved for cyclic objects");if(p.JSON_TYPES.includes(e))throw new TypeError("Plain JSON object types are reserved as type names");var n=i[e],c=n.testPlainObjects?o:a,u=c.filter((function(t){return t.type===e}));if(u.length&&(c.splice(c.indexOf(u[0]),1),delete s[e],delete l[e]),n){if("function"==typeof n){var h=n;n={test:function(e){return e&&e.constructor===h},replace:function(e){return v({},e)},revive:function(e){return v(Object.create(h.prototype),e)}}}else r(n)&&(n={test:n[0],replace:n[1],revive:n[2]});var d={type:e,test:n.test.bind(n)};n.replace&&(d.replace=n.replace.bind(n)),n.replaceAsync&&(d.replaceAsync=n.replaceAsync.bind(n));var f="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(f,0,d):a.splice(f,0,d),n.revive||n.reviveAsync){var g={};n.revive&&(g.revive=n.revive.bind(n)),n.reviveAsync&&(g.reviveAsync=n.reviveAsync.bind(n)),s[e]=g}l[e]=n}}))})),this}}function v(e,t){return n(t).map((function(n){e[n]=t[n]})),e}function g(e){return e.replace(/~/g,"~0").replace(/\./g,"~1")}function m(e){return e.replace(/~1/g,".").replace(/~0/g,"~")}function y(e,t){if(""===t)return e;var n=t.indexOf(".");if(n>-1){var r=e[m(t.substr(0,n))];return void 0===r?void 0:y(r,t.substr(n+1))}return e[m(t)]}function b(){}function S(e){this.p=new Promise(e)}S.prototype.then=function(e,t){var n=this;return new S((function(r,i){n.p.then((function(t){r(e?e(t):t)}),(function(e){n.p.catch((function(e){return t?t(e):Promise.reject(e)})).then(r,i)}))}))},S.prototype.catch=function(e){return this.then(null,e)},S.resolve=function(e){return new S((function(t){t(e)}))},S.reject=function(e){return new S((function(t,n){n(e)}))},["all","race"].map((function(e){S[e]=function(t){return new S((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=S,p.isThenable=u,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=f,p.isPlainObject=d,p.isUserObject=function e(t){if(!t||"Object"!==l(t))return!1;var n=o(t);return!n||h(t,Object)||e(n)},p.escapeKeyPathComponent=g,p.unescapeKeyPathComponent=m,p.getByKeyPath=y,p.getJSONType=function(t){return null===t?"null":r(t)?"array":void 0===t?"undefined":e(t)},p.JSON_TYPES=["null","boolean","number","string","array","object"];for(var w={userObject:{test:function(e,t){return p.isUserObject(e)},replace:function(e){return Object.assign({},e)},revive:function(e){return e}}},k=[[{sparseArrays:{testPlainObjects:!0,test:function(e){return Array.isArray(e)},replace:function(e,t){return t.iterateUnsetNumeric=!0,e}}},{sparseUndefined:{test:function(e,t){return void 0===e&&!1===t.ownKeys},replace:function(e){return null},revive:function(e){}}}],{undef:{test:function(e,t){return void 0===e&&(t.ownKeys||!("ownKeys"in t))},replace:function(e){return null},revive:function(e){return new p.Undefined}}}],C={StringObject:{test:function(t){return"String"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return String(e)},revive:function(e){return new String(e)}},BooleanObject:{test:function(t){return"Boolean"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Boolean(e)},revive:function(e){return new Boolean(e)}},NumberObject:{test:function(t){return"Number"===p.toStringTag(t)&&"object"===(void 0===t?"undefined":e(t))},replace:function(e){return Number(e)},revive:function(e){return new Number(e)}}},E=[{nan:{test:function(e){return"number"==typeof e&&isNaN(e)},replace:function(e){return"NaN"},revive:function(e){return NaN}}},{infinity:{test:function(e){return e===1/0},replace:function(e){return"Infinity"},revive:function(e){return 1/0}}},{negativeInfinity:{test:function(e){return e===-1/0},replace:function(e){return"-Infinity"},revive:function(e){return-1/0}}}],x={date:{test:function(e){return"Date"===p.toStringTag(e)},replace:function(e){var t=e.getTime();return isNaN(t)?"NaN":t},revive:function(e){return"NaN"===e?new Date(NaN):new Date(e)}}},I={regexp:{test:function(e){return"RegExp"===p.toStringTag(e)},replace:function(e){return{source:e.source,flags:(e.global?"g":"")+(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.sticky?"y":"")+(e.unicode?"u":"")}},revive:function(e){var t=e.source,n=e.flags;return new RegExp(t,n)}}},_={map:{test:function(e){return"Map"===p.toStringTag(e)},replace:function(e){return Array.from(e.entries())},revive:function(e){return new Map(e)}}},A={set:{test:function(e){return"Set"===p.toStringTag(e)},replace:function(e){return Array.from(e.values())},revive:function(e){return new Set(e)}}},T="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",R=new Uint8Array(256),O=0;O<T.length;O++)R[T.charCodeAt(O)]=O;var D=function(e,t,n){for(var r=new Uint8Array(e,t,n),i=r.length,o="",a=0;a<i;a+=3)o+=T[r[a]>>2],o+=T[(3&r[a])<<4|r[a+1]>>4],o+=T[(15&r[a+1])<<2|r[a+2]>>6],o+=T[63&r[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},N=function(e){var t=e.length,n=.75*e.length,r=0,i=void 0,o=void 0,a=void 0,s=void 0;"="===e[e.length-1]&&(n--,"="===e[e.length-2]&&n--);for(var c=new ArrayBuffer(n),u=new Uint8Array(c),l=0;l<t;l+=4)i=R[e.charCodeAt(l)],o=R[e.charCodeAt(l+1)],a=R[e.charCodeAt(l+2)],s=R[e.charCodeAt(l+3)],u[r++]=i<<2|o>>4,u[r++]=(15&o)<<4|a>>2,u[r++]=(3&a)<<6|63&s;return c},L={arraybuffer:{test:function(e){return"ArrayBuffer"===p.toStringTag(e)},replace:function(e,t){t.buffers||(t.buffers=[]);var n=t.buffers.indexOf(e);return n>-1?{index:n}:(t.buffers.push(e),D(e))},revive:function(t,n){if(n.buffers||(n.buffers=[]),"object"===(void 0===t?"undefined":e(t)))return n.buffers[t.index];var r=N(t);return n.buffers.push(r),r}}},P="undefined"==typeof self?pl:self,M={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=P[t];n&&(M[e.toLowerCase()]={test:function(e){return p.toStringTag(e)===t},replace:function(e,t){var n=e.buffer,r=e.byteOffset,i=e.length;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(n);return o>-1?{index:o,byteOffset:r,length:i}:(t.buffers.push(n),{encoded:D(n),byteOffset:r,length:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var r=e.byteOffset,i=e.length,o=e.encoded,a=e.index,s=void 0;return"index"in e?s=t.buffers[a]:(s=N(o),t.buffers.push(s)),new n(s,r,i)}})}));var B={dataview:{test:function(e){return"DataView"===p.toStringTag(e)},replace:function(e,t){var n=e.buffer,r=e.byteOffset,i=e.byteLength;t.buffers||(t.buffers=[]);var o=t.buffers.indexOf(n);return o>-1?{index:o,byteOffset:r,byteLength:i}:(t.buffers.push(n),{encoded:D(n),byteOffset:r,byteLength:i})},revive:function(e,t){t.buffers||(t.buffers=[]);var n=e.byteOffset,r=e.byteLength,i=e.encoded,o=e.index,a=void 0;return"index"in e?a=t.buffers[o]:(a=N(i),t.buffers.push(a)),new DataView(a,n,r)}}},G={IntlCollator:{test:function(e){return p.hasConstructorOf(e,Intl.Collator)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.Collator(e.locale,e)}},IntlDateTimeFormat:{test:function(e){return p.hasConstructorOf(e,Intl.DateTimeFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.DateTimeFormat(e.locale,e)}},IntlNumberFormat:{test:function(e){return p.hasConstructorOf(e,Intl.NumberFormat)},replace:function(e){return e.resolvedOptions()},revive:function(e){return new Intl.NumberFormat(e.locale,e)}}};function j(e){for(var t=new Uint16Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var H={file:{test:function(e){return"File"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText,name:e.name,lastModified:e.lastModified}},revive:function(e){var t=e.name,n=e.type,r=e.stringContents,i=e.lastModified,o=j(r);return new File([o],t,{type:n,lastModified:i})},replaceAsync:function(e){return new p.Promise((function(t,n){if(e.isClosed)n(new Error("The File is closed"));else{var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:r.result,name:e.name,lastModified:e.lastModified})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsText(e,"UTF-16")}}))}}};return[w,k,C,E,x,I,{imagedata:{test:function(e){return"ImageData"===p.toStringTag(e)},replace:function(e){return{array:Array.from(e.data),width:e.width,height:e.height}},revive:function(e){return new ImageData(new Uint8ClampedArray(e.array),e.width,e.height)}}},{imagebitmap:{test:function(e){return"ImageBitmap"===p.toStringTag(e)||e&&e.dataset&&"ImageBitmap"===e.dataset.toStringTag},replace:function(e){var t=document.createElement("canvas");return t.getContext("2d").drawImage(e,0,0),t.toDataURL()},revive:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.onload=function(){n.drawImage(r,0,0)},r.src=e,t},reviveAsync:function(e){var t=document.createElement("canvas"),n=t.getContext("2d"),r=document.createElement("img");return r.onload=function(){n.drawImage(r,0,0)},r.src=e,createImageBitmap(t)}}},H,{file:H.file,filelist:{test:function(e){return"FileList"===p.toStringTag(e)},replace:function(e){for(var t=[],n=0;n<e.length;n++)t[n]=e.item(n);return t},revive:function(e){function t(){this._files=arguments[0],this.length=this._files.length}return t.prototype.item=function(e){return this._files[e]},t.prototype[Symbol.toStringTag]="FileList",new t(e)}}},{blob:{test:function(e){return"Blob"===p.toStringTag(e)},replace:function(e){var t=new XMLHttpRequest;if(t.open("GET",URL.createObjectURL(e),!1),"undefined"!=typeof TextEncoder&&t.overrideMimeType("text/plain; charset=utf-16le"),200!==t.status&&0!==t.status)throw new Error("Bad Blob access: "+t.status);return t.send(),{type:e.type,stringContents:t.responseText}},revive:function(e){var t=e.type,n=e.stringContents;return new Blob([j(n)],{type:t})},replaceAsync:function(e){return new p.Promise((function(t,n){if(e.isClosed)n(new Error("The Blob is closed"));else{var r=new FileReader;r.addEventListener("load",(function(){t({type:e.type,stringContents:r.result})})),r.addEventListener("error",(function(){n(r.error)})),r.readAsText(e,"UTF-16")}}))}}}].concat("function"==typeof Map?_:[],"function"==typeof Set?A:[],"function"==typeof ArrayBuffer?L:[],"function"==typeof Uint8Array?M:[],"function"==typeof DataView?B:[],"undefined"!=typeof Intl?G:[])}()})),yl="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",bl=new Uint8Array(256),Sl=0;Sl<yl.length;Sl++)bl[yl.charCodeAt(Sl)]=Sl;var wl=function(e,t,n){null==n&&(n=e.byteLength);for(var r=new Uint8Array(e,t||0,n),i=r.length,o="",a=0;a<i;a+=3)o+=yl[r[a]>>2],o+=yl[(3&r[a])<<4|r[a+1]>>4],o+=yl[(15&r[a+1])<<2|r[a+2]>>6],o+=yl[63&r[a+2]];return i%3==2?o=o.substring(0,o.length-1)+"=":i%3==1&&(o=o.substring(0,o.length-2)+"=="),o},kl=function(e){var t,n,r,i,o=e.length,a=.75*e.length,s=0;"="===e[e.length-1]&&(a--,"="===e[e.length-2]&&a--);for(var c=new ArrayBuffer(a),u=new Uint8Array(c),l=0;l<o;l+=4)t=bl[e.charCodeAt(l)],n=bl[e.charCodeAt(l+1)],r=bl[e.charCodeAt(l+2)],i=bl[e.charCodeAt(l+3)],u[s++]=t<<2|n>>4,u[s++]=(15&n)<<4|r>>2,u[s++]=(3&r)<<6|63&i;return c},Cl="undefined"==typeof self?global:self,El={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=Cl[t];n&&(El[e.toLowerCase()+"2"]={test:function(e){return gl.toStringTag(e)===t},replace:function(e){return{buffer:e.buffer,byteOffset:e.byteOffset,length:e.length}},revive:function(e){var t=e.buffer,r=e.byteOffset,i=e.length;return new n(t,r,i)}})}));var xl={arraybuffer:{test:function(e){return"ArrayBuffer"===gl.toStringTag(e)},replace:function(e){return wl(e,0,e.byteLength)},revive:function(e){return kl(e)}}},Il=(new gl).register(ml),_l="FileReaderSync"in self,Al=[],Tl=0;Il.register([xl,El,{blob2:{test:function(e){return"Blob"===gl.toStringTag(e)},replace:function(e){if(e.isClosed)throw new Error("The Blob is closed");if(_l){var t=fl(e,"binary"),n=wl(t,0,t.byteLength);return{type:e.type,data:n}}Al.push(e);var r={type:e.type,data:{start:Tl,end:Tl+e.size}};return console.log("b.size: "+e.size),Tl+=e.size,r},finalize:function(e,t){e.data=wl(t,0,t.byteLength)},revive:function(e){var t=e.type,n=e.data;return new Blob([kl(n)],{type:t})}}}]),Il.mustFinalize=function(){return Al.length>0},Il.finalize=function(e){return ul(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,s,c,u,l;return ll(this,(function(h){switch(h.label){case 0:return[4,dl(new Blob(Al),"binary")];case 1:if(t=h.sent(),e)for(n=0,r=e;n<r.length;n++)if((i=r[n]).$types)for(s in o=i.$types,(a=o.$)&&(o=o.$),o)c=o[s],(u=Il.types[c])&&u.finalize&&(l=qu.getByKeyPath(i,a?"$."+s:s),u.finalize(l,t.slice(l.start,l.end)));return Al=[],[2]}}))}))};function Rl(e,t){return ul(this,void 0,void 0,(function(){function n(){return ul(this,void 0,void 0,(function(){var n,u,l,h,d,f,p,v,g;return ll(this,(function(m){switch(m.label){case 0:return[4,Promise.all(e.tables.map((function(e){return e.count()})))];case 1:(n=m.sent()).forEach((function(e,t){return i[t].rowCount=e})),c.totalRows=n.reduce((function(e,t){return e+t})),u=JSON.stringify(a,void 0,o?2:void 0),l=u.lastIndexOf("]"),h=u.substring(0,l),r.push(h),d=t.filter,f=function(n){var i,a,u,l,h,f,p,v,g,m,y;return ll(this,(function(b){switch(b.label){case 0:i=e.table(n),a=i.schema.primKey,u=!!a.keyPath,l=t.numRowsPerChunk||2e3,h=u?{tableName:i.name,inbound:!0,rows:[]}:{tableName:i.name,inbound:!1,rows:[]},f=JSON.stringify(h,void 0,o?2:void 0),o&&(f=f.split("\n").join("\n ")),p=f.lastIndexOf("]"),r.push(f.substring(0,p)),v=null,g=0,m=!0,y=function(){var e,t,h,f,p,y,b,S;return ll(this,(function(w){switch(w.label){case 0:return s&&qu.ignoreTransaction((function(){return s(c)})),[4,(e=null==v?i.limit(l):i.where(":id").above(v).limit(l)).toArray()];case 1:return 0===(t=w.sent()).length?[2,"break"]:(null!=v&&g>0&&(r.push(","),o&&r.push("\n ")),m=t.length===l,u?(h=d?t.filter((function(e){return d(n,e)})):t,f=h.map((function(e){return Il.encapsulate(e)})),Il.mustFinalize()?[4,qu.waitFor(Il.finalize(f))]:[3,3]):[3,4]);case 2:w.sent(),w.label=3;case 3:return S=JSON.stringify(f,void 0,o?2:void 0),o&&(S=S.split("\n").join("\n ")),r.push(new Blob([S.substring(1,S.length-1)])),g=h.length,v=t.length>0?qu.getByKeyPath(t[t.length-1],a.keyPath):null,[3,8];case 4:return[4,e.primaryKeys()];case 5:return p=w.sent(),y=p.map((function(e,n){return[e,t[n]]})),d&&(y=y.filter((function(e){var t=e[0],r=e[1];return d(n,r,t)}))),b=y.map((function(e){return Il.encapsulate(e)})),Il.mustFinalize()?[4,qu.waitFor(Il.finalize(b))]:[3,7];case 6:w.sent(),w.label=7;case 7:S=JSON.stringify(b,void 0,o?2:void 0),o&&(S=S.split("\n").join("\n ")),r.push(new Blob([S.substring(1,S.length-1)])),g=y.length,v=p.length>0?p[p.length-1]:null,w.label=8;case 8:return c.completedRows+=t.length,[2]}}))},b.label=1;case 1:return m?[5,y()]:[3,3];case 2:return"break"===b.sent()?[3,3]:[3,1];case 3:return r.push(f.substr(p)),c.completedTables+=1,c.completedTables<c.totalTables&&r.push(","),[2]}}))},p=0,v=i,m.label=2;case 2:return p<v.length?(g=v[p].name,[5,f(g)]):[3,5];case 3:m.sent(),m.label=4;case 4:return p++,[3,2];case 5:return r.push(u.substr(l)),c.done=!0,s&&qu.ignoreTransaction((function(){return s(c)})),[2]}}))}))}var r,i,o,a,s,c;return ll(this,(function(u){switch(u.label){case 0:t=t||{},r=[],i=e.tables.map((function(e){return{name:e.name,schema:hl(e),rowCount:0}})),o=t.prettyJson,a={formatName:"dexie",formatVersion:1,data:{databaseName:e.name,databaseVersion:e.verno,tables:i,data:[]}},s=t.progressCallback,c={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:e.tables.length},u.label=1;case 1:return u.trys.push([1,,6,7]),t.noTransaction?[4,n()]:[3,3];case 2:return u.sent(),[3,5];case 3:return[4,e.transaction("r",e.tables,n)];case 4:u.sent(),u.label=5;case 5:return[3,7];case 6:return Il.finalize(),[7];case 7:return s&&qu.ignoreTransaction((function(){return s(c)})),[2,new Blob(r,{type:"text/json"})]}}))}))}var Ol=function(){},Dl=vl((function(e,t){!function(e){var t="object"==typeof process&&process.env?process.env:self;e.parser=function(e){return new B(e)},e.CParser=B,e.CStream=G,e.createStream=function(e){return new G(e)},e.MAX_BUFFER_LENGTH=10485760,e.DEBUG="debug"===t.CDEBUG,e.INFO="debug"===t.CDEBUG||"info"===t.CDEBUG,e.EVENTS=["value","string","key","openobject","closeobject","openarray","closearray","error","end","ready"];var n,r={textNode:void 0,numberNode:""},i=e.EVENTS.filter((function(e){return"error"!==e&&"end"!==e})),o=0;for(var a in e.STATE={BEGIN:o++,VALUE:o++,OPEN_OBJECT:o++,CLOSE_OBJECT:o++,OPEN_ARRAY:o++,CLOSE_ARRAY:o++,TEXT_ESCAPE:o++,STRING:o++,BACKSLASH:o++,END:o++,OPEN_KEY:o++,CLOSE_KEY:o++,TRUE:o++,TRUE2:o++,TRUE3:o++,FALSE:o++,FALSE2:o++,FALSE3:o++,FALSE4:o++,NULL:o++,NULL2:o++,NULL3:o++,NUMBER_DECIMAL_POINT:o++,NUMBER_DIGIT:o++},e.STATE)e.STATE[e.STATE[a]]=a;o=e.STATE;const s=9,c=10,u=13,l=32,h=34,d=43,f=44,p=45,v=46,g=48,m=57,y=58,b=69,S=91,w=92,k=93,C=97,E=98,x=101,I=102,_=108,A=110,T=114,R=115,O=116,D=117,N=123,L=125;function P(e){for(var t in r)e[t]=r[t]}Object.create||(Object.create=function(e){function t(){this.__proto__=e}return t.prototype=e,new t}),Object.getPrototypeOf||(Object.getPrototypeOf=function(e){return e.__proto__}),Object.keys||(Object.keys=function(e){var t=[];for(var n in e)e.hasOwnProperty(n)&&t.push(n);return t});var M=/[\\"\n]/g;function B(t){if(!(this instanceof B))return new B(t);P(this),this.bufferCheckPosition=e.MAX_BUFFER_LENGTH,this.q=this.c=this.p="",this.opt=t||{},this.closed=this.closedRoot=this.sawRoot=!1,this.tag=this.error=null,this.state=o.BEGIN,this.stack=new Array,this.position=this.column=0,this.line=1,this.slashed=!1,this.unicodeI=0,this.unicodeS=null,this.depth=0,j(this,"onready")}B.prototype={end:function(){z(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return F(this,"Cannot write after close. Assign an onready handler.");if(null===t)return z(this);var n=0,i=t.charCodeAt(0),a=this.p;e.DEBUG&&console.log("write -> ["+t+"]");for(;i&&(a=i,this.c=i=t.charCodeAt(n++),a!==i?this.p=a:a=this.p,i);)switch(e.DEBUG&&console.log(n,i,e.STATE[this.state]),this.position++,i===c?(this.line++,this.column=0):this.column++,this.state){case o.BEGIN:i===N?this.state=o.OPEN_OBJECT:i===S?this.state=o.OPEN_ARRAY:Y(i)||F(this,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(Y(i))continue;if(this.state===o.OPEN_KEY)this.stack.push(o.CLOSE_KEY);else{if(i===L){j(this,"onopenobject"),this.depth++,j(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_OBJECT)}i===h?this.state=o.STRING:F(this,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(Y(i))continue;this.state,o.CLOSE_KEY,i===y?(this.state===o.CLOSE_OBJECT?(this.stack.push(o.CLOSE_OBJECT),U(this,"onopenobject"),this.depth++):U(this,"onkey"),this.state=o.VALUE):i===L?(H(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE):i===f?(this.state===o.CLOSE_OBJECT&&this.stack.push(o.CLOSE_OBJECT),U(this),this.state=o.OPEN_KEY):F(this,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(Y(i))continue;if(this.state===o.OPEN_ARRAY){if(j(this,"onopenarray"),this.depth++,this.state=o.VALUE,i===k){j(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_ARRAY)}i===h?this.state=o.STRING:i===N?this.state=o.OPEN_OBJECT:i===S?this.state=o.OPEN_ARRAY:i===O?this.state=o.TRUE:i===I?this.state=o.FALSE:i===A?this.state=o.NULL:i===p?this.numberNode+="-":g<=i&&i<=m?(this.numberNode+=String.fromCharCode(i),this.state=o.NUMBER_DIGIT):F(this,"Bad value");continue;case o.CLOSE_ARRAY:if(i===f)this.stack.push(o.CLOSE_ARRAY),U(this,"onvalue"),this.state=o.VALUE;else if(i===k)H(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;else{if(Y(i))continue;F(this,"Bad array")}continue;case o.STRING:void 0===this.textNode&&(this.textNode="");var s=n-1,u=this.slashed,l=this.unicodeI;e:for(;;){for(e.DEBUG&&console.log(n,i,e.STATE[this.state],u);l>0;)if(this.unicodeS+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,4===l?(this.textNode+=String.fromCharCode(parseInt(this.unicodeS,16)),l=0,s=n-1):l++,!i)break e;if(i===h&&!u){this.state=this.stack.pop()||o.VALUE,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(i===w&&!u&&(u=!0,this.textNode+=t.substring(s,n-1),this.position+=n-1-s,i=t.charCodeAt(n++),this.position++,!i))break;if(u){if(u=!1,i===A?this.textNode+="\n":i===T?this.textNode+="\r":i===O?this.textNode+="\t":i===I?this.textNode+="\f":i===E?this.textNode+="\b":i===D?(l=1,this.unicodeS=""):this.textNode+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,s=n-1,i)continue;break}M.lastIndex=n;var P=M.exec(t);if(null===P){n=t.length+1,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(n=P.index+1,!(i=t.charCodeAt(P.index))){this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}}this.slashed=u,this.unicodeI=l;continue;case o.TRUE:i===T?this.state=o.TRUE2:F(this,"Invalid true started with t"+i);continue;case o.TRUE2:i===D?this.state=o.TRUE3:F(this,"Invalid true started with tr"+i);continue;case o.TRUE3:i===x?(j(this,"onvalue",!0),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid true started with tru"+i);continue;case o.FALSE:i===C?this.state=o.FALSE2:F(this,"Invalid false started with f"+i);continue;case o.FALSE2:i===_?this.state=o.FALSE3:F(this,"Invalid false started with fa"+i);continue;case o.FALSE3:i===R?this.state=o.FALSE4:F(this,"Invalid false started with fal"+i);continue;case o.FALSE4:i===x?(j(this,"onvalue",!1),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid false started with fals"+i);continue;case o.NULL:i===D?this.state=o.NULL2:F(this,"Invalid null started with n"+i);continue;case o.NULL2:i===_?this.state=o.NULL3:F(this,"Invalid null started with nu"+i);continue;case o.NULL3:i===_?(j(this,"onvalue",null),this.state=this.stack.pop()||o.VALUE):F(this,"Invalid null started with nul"+i);continue;case o.NUMBER_DECIMAL_POINT:i===v?(this.numberNode+=".",this.state=o.NUMBER_DIGIT):F(this,"Leading zero not followed by .");continue;case o.NUMBER_DIGIT:g<=i&&i<=m?this.numberNode+=String.fromCharCode(i):i===v?(-1!==this.numberNode.indexOf(".")&&F(this,"Invalid number has two dots"),this.numberNode+="."):i===x||i===b?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||F(this,"Invalid number has two exponential"),this.numberNode+="e"):i===d||i===p?(a!==x&&a!==b&&F(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(i)):(K(this),n--,this.state=this.stack.pop()||o.VALUE);continue;default:F(this,"Unknown state: "+this.state)}this.position>=this.bufferCheckPosition&&function(t){var n=Math.max(e.MAX_BUFFER_LENGTH,10),i=0;for(var o in r){var a=void 0===t[o]?0:t[o].length;if(a>n)switch(o){case"text":closeText(t);break;default:F(t,"Max buffer length exceeded: "+o)}i=Math.max(i,a)}t.bufferCheckPosition=e.MAX_BUFFER_LENGTH-i+t.position}(this);return this},resume:function(){return this.error=null,this},close:function(){return this.write(null)}};try{n=Ol}catch(e){n=function(){}}function G(e){if(!(this instanceof G))return new G(e);this._parser=new B(e),this.writable=!0,this.readable=!0,this.bytes_remaining=0,this.bytes_in_sequence=0,this.temp_buffs={2:new Buffer(2),3:new Buffer(3),4:new Buffer(4)},this.string="";var t=this;n.apply(t),this._parser.onend=function(){t.emit("end")},this._parser.onerror=function(e){t.emit("error",e),t._parser.error=null},i.forEach((function(e){Object.defineProperty(t,"on"+e,{get:function(){return t._parser["on"+e]},set:function(n){if(!n)return t.removeAllListeners(e),t._parser["on"+e]=n,n;t.on(e,n)},enumerable:!0,configurable:!1})}))}function j(t,n,r){e.INFO&&console.log("-- emit",n,r),t[n]&&t[n](r)}function H(e,t,n){U(e),j(e,t,n)}function U(e,t){e.textNode=function(e,t){if(void 0===t)return t;e.trim&&(t=t.trim());e.normalize&&(t=t.replace(/\s+/g," "));return t}(e.opt,e.textNode),void 0!==e.textNode&&j(e,t||"onvalue",e.textNode),e.textNode=void 0}function K(e){e.numberNode&&j(e,"onvalue",parseFloat(e.numberNode)),e.numberNode=""}function F(e,t){return U(e),t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c,t=new Error(t),e.error=t,j(e,"onerror",t),e}function z(e){return e.state===o.VALUE&&0===e.depth||F(e,"Unexpected end"),U(e),e.c="",e.closed=!0,j(e,"onend"),B.call(e,e.opt),e}function Y(e){return e===u||e===c||e===l||e===s}G.prototype=Object.create(n.prototype,{constructor:{value:G}}),G.prototype.write=function(e){e=new Buffer(e);for(var t=0;t<e.length;t++){var n=e[t];if(this.bytes_remaining>0){for(var r=0;r<this.bytes_remaining;r++)this.temp_buffs[this.bytes_in_sequence][this.bytes_in_sequence-this.bytes_remaining+r]=e[r];this.string=this.temp_buffs[this.bytes_in_sequence].toString(),this.bytes_in_sequence=this.bytes_remaining=0,t=t+r-1,this._parser.write(this.string),this.emit("data",this.string)}else if(0===this.bytes_remaining&&n>=128){if(n>=194&&n<=223&&(this.bytes_in_sequence=2),n>=224&&n<=239&&(this.bytes_in_sequence=3),n>=240&&n<=244&&(this.bytes_in_sequence=4),this.bytes_in_sequence+t>e.length){for(var i=0;i<=e.length-1-t;i++)this.temp_buffs[this.bytes_in_sequence][i]=e[t+i];return this.bytes_remaining=t+this.bytes_in_sequence-e.length,!0}this.string=e.slice(t,t+this.bytes_in_sequence).toString(),t=t+this.bytes_in_sequence-1,this._parser.write(this.string),this.emit("data",this.string)}else{for(var o=t;o<e.length&&!(e[o]>=128);o++);this.string=e.slice(t,o).toString(),this._parser.write(this.string),this.emit("data",this.string),t=o-1}}},G.prototype.end=function(e){return e&&e.length&&this._parser.write(e.toString()),this._parser.end(),!0},G.prototype.on=function(e,t){var r=this;return r._parser["on"+e]||-1===i.indexOf(e)||(r._parser["on"+e]=function(){var t=1===arguments.length?[arguments[0]]:Array.apply(null,arguments);t.splice(0,0,e),r.emit.apply(r,t)}),n.prototype.on.call(r,e,t)},G.prototype.destroy=function(){P(this._parser),this.emit("close")}}(t)}));function Nl(e){var t=0,n=function(e){var t,n,r,i=Dl.parser(),o=0,a=[],s=!1,c=!1;return i.onopenobject=function(i){var s={incomplete:!0};t||(t=s),n&&(a.push([r,n,c]),e&&(c?n.push(s):n[r]=s)),n=s,r=i,c=!1,++o},i.onkey=function(e){return r=e},i.onvalue=function(e){return c?n.push(e):n[r]=e},i.oncloseobject=function(){var t;if(delete n.incomplete,r=null,0==--o)s=!0;else{var i=n;t=a.pop(),r=t[0],n=t[1],c=t[2],e||(c?n.push(i):n[r]=i)}},i.onopenarray=function(){var i=[];i.incomplete=!0,t||(t=i),n&&(a.push([r,n,c]),e&&(c?n.push(i):n[r]=i)),n=i,c=!0,r=null,++o},i.onclosearray=function(){var t;if(delete n.incomplete,r=null,0==--o)s=!0;else{var i=n;t=a.pop(),r=t[0],n=t[1],c=t[2],e||(c?n.push(i):n[r]=i)}},{write:function(e){return i.write(e),t},done:function(){return s}}}(!0),r={pullAsync:function(i){return ul(this,void 0,void 0,(function(){var o,a,s;return ll(this,(function(c){switch(c.label){case 0:return o=e.slice(t,t+i),t+=i,[4,dl(o,"text")];case 1:return a=c.sent(),s=n.write(a),r.result=s||{},[2,s]}}))}))},pullSync:function(i){var o=e.slice(t,t+i);t+=i;var a=fl(o,"text"),s=n.write(a);return r.result=s||{},s},done:function(){return n.done()},eof:function(){return t>=e.size},result:{}};return r}function Ll(e,t,n){return ul(this,void 0,void 0,(function(){function r(){return ul(this,void 0,void 0,(function(){var t,r,a,h;return ll(this,(function(d){switch(d.label){case 0:t=function(t){var r,i,o,a,s,h,d,f,p,v,g,m;return ll(this,(function(y){switch(y.label){case 0:if(!t.rows)return[2,"break"];if(!t.rows.incomplete&&0===t.rows.length)return[2,"continue"];if(u&&qu.ignoreTransaction((function(){return u(l)})),r=t.tableName,i=e.table(r),o=c.tables.filter((function(e){return e.name===r}))[0].schema,!i){if(n.acceptMissingTables)return[2,"continue"];throw new Error("Exported table "+t.tableName+" is missing in installed database")}if(!n.acceptChangedPrimaryKey&&o.split(",")[0]!=i.schema.primKey.src)throw new Error("Primary key differs for table "+t.tableName+". ");for(a=t.rows,s=[],h=0;h<a.length&&!(d=a[h]).incomplete;h++)s.push(Il.revive(d));return f=n.filter,p=f?t.inbound?s.filter((function(e){return f(r,e)})):s.filter((function(e){var t=e[0],n=e[1];return f(r,n,t)})):s,v=t.inbound?[void 0,p]:[p.map((function(e){return e[0]})),s.map((function(e){return e[1]}))],g=v[0],m=v[1],n.overwriteValues?[4,i.bulkPut(m,g)]:[3,2];case 1:return y.sent(),[3,4];case 2:return[4,i.bulkAdd(m,g)];case 3:y.sent(),y.label=4;case 4:return l.completedRows+=s.length,s.incomplete||(l.completedTables+=1),a.splice(0,s.length),[2]}}))},r=0,a=c.data,d.label=1;case 1:return r<a.length?(h=a[r],[5,t(h)]):[3,4];case 2:if("break"===d.sent())return[3,4];d.label=3;case 3:return r++,[3,1];case 4:for(;c.data.length>0&&c.data[0].rows&&!c.data[0].rows.incomplete;)c.data.splice(0,1);return o.done()||o.eof()?[3,8]:s?(o.pullSync(i),[3,7]):[3,5];case 5:return[4,qu.waitFor(o.pullAsync(i))];case 6:d.sent(),d.label=7;case 7:return[3,9];case 8:return[3,10];case 9:return[3,0];case 10:return[2]}}))}))}var i,o,a,s,c,u,l,h,d;return ll(this,(function(f){switch(f.label){case 0:return i=(n=n||{}).chunkSizeBytes||1048576,[4,Pl(t,i)];case 1:if(o=f.sent(),a=o.result,s="FileReaderSync"in self,c=a.data,!n.acceptNameDiff&&e.name!==c.databaseName)throw new Error("Name differs. Current database name is "+e.name+" but export is "+c.databaseName);if(!n.acceptVersionDiff&&e.verno!==c.databaseVersion)throw new Error("Database version differs. Current database is in version "+e.verno+" but export is "+c.databaseVersion);if(u=n.progressCallback,l={done:!1,completedRows:0,completedTables:0,totalRows:c.tables.reduce((function(e,t){return e+t.rowCount}),0),totalTables:c.tables.length},u&&qu.ignoreTransaction((function(){return u(l)})),!n.clearTablesBeforeImport)return[3,5];h=0,d=e.tables,f.label=2;case 2:return h<d.length?[4,d[h].clear()]:[3,5];case 3:f.sent(),f.label=4;case 4:return h++,[3,2];case 5:return n.noTransaction?[4,r()]:[3,7];case 6:return f.sent(),[3,9];case 7:return[4,e.transaction("rw",e.tables,r)];case 8:f.sent(),f.label=9;case 9:return l.done=!0,u&&qu.ignoreTransaction((function(){return u(l)})),[2]}}))}))}function Pl(e,t){return ul(this,void 0,void 0,(function(){var n,r;return ll(this,(function(i){switch(i.label){case 0:n="slice"in e?Nl(e):e,i.label=1;case 1:return n.eof()?[3,3]:[4,n.pullAsync(t)];case 2:return i.sent(),n.result.data&&n.result.data.data?[3,3]:[3,1];case 3:if(!(r=n.result)||"dexie"!=r.formatName)throw new Error("Given file is not a dexie export");if(r.formatVersion>1)throw new Error("Format version "+r.formatVersion+" not supported");if(!r.data)throw new Error("No data in export file");if(!r.data.databaseName)throw new Error("Missing databaseName in export file");if(!r.data.databaseVersion)throw new Error("Missing databaseVersion in export file");if(!r.data.tables)throw new Error("Missing tables in export file");return[2,n]}}))}))}qu.prototype.export=function(e){return Rl(this,e)},qu.prototype.import=function(e,t){return Ll(this,e,t)},qu.import=function(e,t){return function(e,t){return ul(this,void 0,void 0,(function(){var n,r,i,o;return ll(this,(function(a){switch(a.label){case 0:return n=(t=t||{}).chunkSizeBytes||1048576,[4,Pl(e,n)];case 1:return r=a.sent(),i=r.result.data,(o=new qu(i.databaseName)).version(i.databaseVersion).stores(function(e){for(var t={},n=0,r=e.tables;n<r.length;n++){var i=r[n];t[i.name]=i.schema}return t}(i)),[4,Ll(o,r,t)];case 2:return a.sent(),[2,o]}}))}))}(e,t)};var Ml=y((function(e,t){e.exports=function e(t,n,r){var i,o,a=window,s="application/octet-stream",c=r||s,u=t,l=!n&&!r&&u,h=document.createElement("a"),d=function(e){return String(e)},f=a.Blob||a.MozBlob||a.WebKitBlob||d,p=n||"download";if(f=f.call?f.bind(a):Blob,"true"===String(this)&&(c=(u=[u,c])[0],u=u[1]),l&&l.length<2048&&(p=l.split("/").pop().split("?")[0],h.href=l,-1!==h.href.indexOf(l))){var v=new XMLHttpRequest;return v.open("GET",l,!0),v.responseType="blob",v.onload=function(t){e(t.target.response,p,s)},setTimeout((function(){v.send()}),0),v}if(/^data:([\w+-]+\/[\w+.-]+)?[,;]/.test(u)){if(!(u.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(b(u),p):S(u);c=(u=b(u)).type||s}else if(/([\x80-\xff])/.test(u)){for(var g=0,m=new Uint8Array(u.length),y=m.length;g<y;++g)m[g]=u.charCodeAt(g);u=new f([m],{type:c})}function b(e){for(var t=e.split(/[:;,]/),n=t[1],r=("base64"==t[2]?atob:decodeURIComponent)(t.pop()),i=r.length,o=0,a=new Uint8Array(i);o<i;++o)a[o]=r.charCodeAt(o);return new f([a],{type:n})}function S(e,t){if("download"in h)return h.href=e,h.setAttribute("download",p),h.className="download-js-link",h.innerHTML="downloading...",h.style.display="none",document.body.appendChild(h),setTimeout((function(){h.click(),document.body.removeChild(h),!0===t&&setTimeout((function(){a.URL.revokeObjectURL(h.href)}),250)}),66),!0;if(/(Version)\/(\d+)\.(\d+)(?:\.(\d+))?.*Safari\//.test(navigator.userAgent))return/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),window.open(e)||confirm("Displaying New Document\n\nUse Save As... to download, then click back to return to this page.")&&(location.href=e),!0;var n=document.createElement("iframe");document.body.appendChild(n),!t&&/^data:/.test(e)&&(e="data:"+e.replace(/^data:([\w\/\-\+]+)/,s)),n.src=e,setTimeout((function(){document.body.removeChild(n)}),333)}if(i=u instanceof f?u:new f([u],{type:c}),navigator.msSaveBlob)return navigator.msSaveBlob(i,p);if(a.URL)S(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===d)try{return S("data:"+c+";base64,"+a.btoa(i))}catch(e){return S("data:"+c+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){S(this.result)},o.readAsDataURL(i)}return!0}})),Bl=y((function(e,t){e.exports=function e(t,n,r){function i(a,s){if(!n[a]){if(!t[a]){if(!s&&m)return m();if(o)return o(a,!0);var c=new Error("Cannot find module '"+a+"'");throw c.code="MODULE_NOT_FOUND",c}var u=n[a]={exports:{}};t[a][0].call(u.exports,(function(e){return i(t[a][1][e]||e)}),u,u.exports,e,t,n,r)}return n[a].exports}for(var o=m,a=0;a<r.length;a++)i(r[a]);return i}({1:[function(e,t,n){var r=e("./utils"),i=e("./support"),o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=";n.encode=function(e){for(var t,n,i,a,s,c,u,l=[],h=0,d=e.length,f=d,p="string"!==r.getTypeOf(e);h<e.length;)f=d-h,i=p?(t=e[h++],n=h<d?e[h++]:0,h<d?e[h++]:0):(t=e.charCodeAt(h++),n=h<d?e.charCodeAt(h++):0,h<d?e.charCodeAt(h++):0),a=t>>2,s=(3&t)<<4|n>>4,c=1<f?(15&n)<<2|i>>6:64,u=2<f?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(c)+o.charAt(u));return l.join("")},n.decode=function(e){var t,n,r,a,s,c,u=0,l=0,h="data:";if(e.substr(0,h.length)===h)throw new Error("Invalid base64 input, it looks like a data url.");var d,f=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===o.charAt(64)&&f--,e.charAt(e.length-2)===o.charAt(64)&&f--,f%1!=0)throw new Error("Invalid base64 input, bad content length.");for(d=i.uint8array?new Uint8Array(0|f):new Array(0|f);u<e.length;)t=o.indexOf(e.charAt(u++))<<2|(a=o.indexOf(e.charAt(u++)))>>4,n=(15&a)<<4|(s=o.indexOf(e.charAt(u++)))>>2,r=(3&s)<<6|(c=o.indexOf(e.charAt(u++))),d[l++]=t,64!==s&&(d[l++]=n),64!==c&&(d[l++]=r);return d}},{"./support":30,"./utils":32}],2:[function(e,t,n){var r=e("./external"),i=e("./stream/DataWorker"),o=e("./stream/Crc32Probe"),a=e("./stream/DataLengthProbe");function s(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}s.prototype={getContentWorker:function(){var e=new i(r.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new a("data_length")),t=this;return e.on("end",(function(){if(this.streamInfo.data_length!==t.uncompressedSize)throw new Error("Bug : uncompressed data size mismatch")})),e},getCompressedWorker:function(){return new i(r.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},s.createWorkerFrom=function(e,t,n){return e.pipe(new o).pipe(new a("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new a("compressedSize")).withStreamInfo("compression",t)},t.exports=s},{"./external":6,"./stream/Crc32Probe":25,"./stream/DataLengthProbe":26,"./stream/DataWorker":27}],3:[function(e,t,n){var r=e("./stream/GenericWorker");n.STORE={magic:"\0\0",compressWorker:function(e){return new r("STORE compression")},uncompressWorker:function(){return new r("STORE decompression")}},n.DEFLATE=e("./flate")},{"./flate":7,"./stream/GenericWorker":28}],4:[function(e,t,n){var r=e("./utils"),i=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t){return void 0!==e&&e.length?"string"!==r.getTypeOf(e)?function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}(0|t,e,e.length):function(e,t,n,r){var o=i,a=0+n;e^=-1;for(var s=0;s<a;s++)e=e>>>8^o[255&(e^t.charCodeAt(s))];return-1^e}(0|t,e,e.length):0}},{"./utils":32}],5:[function(e,t,n){n.base64=!1,n.binary=!1,n.dir=!1,n.createFolders=!0,n.date=null,n.compression=null,n.compressionOptions=null,n.comment=null,n.unixPermissions=null,n.dosPermissions=null},{}],6:[function(e,t,n){var r;r="undefined"!=typeof Promise?Promise:e("lie"),t.exports={Promise:r}},{lie:37}],7:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array,i=e("pako"),o=e("./utils"),a=e("./stream/GenericWorker"),s=r?"uint8array":"array";function c(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(c,a),c.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},c.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},c.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},c.prototype._createPako=function(){this._pako=new i[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}},n.compressWorker=function(e){return new c("Deflate",e)},n.uncompressWorker=function(){return new c("Inflate",{})}},{"./stream/GenericWorker":28,"./utils":32,pako:38}],8:[function(e,t,n){function r(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r}function i(e,t,n,i,a,l){var h,d,f=e.file,p=e.compression,v=l!==s.utf8encode,g=o.transformTo("string",l(f.name)),m=o.transformTo("string",s.utf8encode(f.name)),y=f.comment,b=o.transformTo("string",l(y)),S=o.transformTo("string",s.utf8encode(y)),w=m.length!==f.name.length,k=S.length!==y.length,C="",E="",x="",I=f.dir,_=f.date,A={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(A.crc32=e.crc32,A.compressedSize=e.compressedSize,A.uncompressedSize=e.uncompressedSize);var T=0;t&&(T|=8),v||!w&&!k||(T|=2048);var R=0,O=0;I&&(R|=16),"UNIX"===a?(O=798,R|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(f.unixPermissions,I)):(O=20,R|=function(e){return 63&(e||0)}(f.dosPermissions)),h=_.getUTCHours(),h<<=6,h|=_.getUTCMinutes(),h<<=5,h|=_.getUTCSeconds()/2,d=_.getUTCFullYear()-1980,d<<=4,d|=_.getUTCMonth()+1,d<<=5,d|=_.getUTCDate(),w&&(E=r(1,1)+r(c(g),4)+m,C+="up"+r(E.length,2)+E),k&&(x=r(1,1)+r(c(b),4)+S,C+="uc"+r(x.length,2)+x);var D="";return D+="\n\0",D+=r(T,2),D+=p.magic,D+=r(h,2),D+=r(d,2),D+=r(A.crc32,4),D+=r(A.compressedSize,4),D+=r(A.uncompressedSize,4),D+=r(g.length,2),D+=r(C.length,2),{fileRecord:u.LOCAL_FILE_HEADER+D+g+C,dirRecord:u.CENTRAL_FILE_HEADER+r(O,2)+D+r(b.length,2)+"\0\0\0\0"+r(R,4)+r(i,4)+g+C+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),c=e("../crc32"),u=e("../signature");function l(e,t,n,r){a.call(this,"ZipFileWorker"),this.bytesWritten=0,this.zipComment=t,this.zipPlatform=n,this.encodeFileName=r,this.streamFiles=e,this.accumulate=!1,this.contentBuffer=[],this.dirRecords=[],this.currentSourceOffset=0,this.entriesCount=0,this.currentFile=null,this._sources=[]}o.inherits(l,a),l.prototype.push=function(e){var t=e.meta.percent||0,n=this.entriesCount,r=this._sources.length;this.accumulate?this.contentBuffer.push(e):(this.bytesWritten+=e.data.length,a.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},l.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=i(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},l.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=i(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:function(e){return u.DATA_DESCRIPTOR+r(e.crc32,4)+r(e.compressedSize,4)+r(e.uncompressedSize,4)}(e),meta:{percent:100}});else for(this.push({data:n.fileRecord,meta:{percent:0}});this.contentBuffer.length;)this.push(this.contentBuffer.shift());this.currentFile=null},l.prototype.flush=function(){for(var e=this.bytesWritten,t=0;t<this.dirRecords.length;t++)this.push({data:this.dirRecords[t],meta:{percent:100}});var n=this.bytesWritten-e,i=function(e,t,n,i,a){var s=o.transformTo("string",a(i));return u.CENTRAL_DIRECTORY_END+"\0\0\0\0"+r(e,2)+r(e,2)+r(t,4)+r(n,4)+r(s.length,2)+s}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:i,meta:{percent:100}})},l.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},l.prototype.registerPrevious=function(e){this._sources.push(e);var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.closedSource(t.previous.streamInfo),t._sources.length?t.prepareNextSource():t.end()})),e.on("error",(function(e){t.error(e)})),this},l.prototype.resume=function(){return!!a.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},l.prototype.error=function(e){var t=this._sources;if(!a.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},l.prototype.lock=function(){a.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()},t.exports=l},{"../crc32":4,"../signature":23,"../stream/GenericWorker":28,"../utf8":31,"../utils":32}],9:[function(e,t,n){var r=e("../compressions"),i=e("./ZipFileWorker");n.generateWorker=function(e,t,n){var o=new i(t.streamFiles,n,t.platform,t.encodeFileName),a=0;try{e.forEach((function(e,n){a++;var i=function(e,t){var n=e||t,i=r[n];if(!i)throw new Error(n+" is not a valid compression method !");return i}(n.options.compression,t.compression),s=n.options.compressionOptions||t.compressionOptions||{},c=n.dir,u=n.date;n._compressWorker(i,s).withStreamInfo("file",{name:e,dir:c,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(o)})),o.entriesCount=a}catch(e){o.error(e)}return o}},{"../compressions":3,"./ZipFileWorker":8}],10:[function(e,t,n){function r(){if(!(this instanceof r))return new r;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files=Object.create(null),this.comment=null,this.root="",this.clone=function(){var e=new r;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}(r.prototype=e("./object")).loadAsync=e("./load"),r.support=e("./support"),r.defaults=e("./defaults"),r.version="3.10.0",r.loadAsync=function(e,t){return(new r).loadAsync(e,t)},r.external=e("./external"),t.exports=r},{"./defaults":5,"./external":6,"./load":11,"./object":15,"./support":30}],11:[function(e,t,n){var r=e("./utils"),i=e("./external"),o=e("./utf8"),a=e("./zipEntries"),s=e("./stream/Crc32Probe"),c=e("./nodejsUtils");function u(e){return new i.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new s);r.on("error",(function(e){n(e)})).on("end",(function(){r.streamInfo.crc32!==e.decompressed.crc32?n(new Error("Corrupted zip : CRC32 mismatch")):t()})).resume()}))}t.exports=function(e,t){var n=this;return t=r.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:o.utf8decode}),c.isNode&&c.isStream(e)?i.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):r.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new a(t);return n.load(e),n})).then((function(e){var n=[i.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var o=0;o<r.length;o++)n.push(u(r[o]));return i.Promise.all(n)})).then((function(e){for(var i=e.shift(),o=i.files,a=0;a<o.length;a++){var s=o[a],c=s.fileNameStr,u=r.resolve(s.fileNameStr);n.file(u,s.decompressed,{binary:!0,optimizedBinaryString:!0,date:s.date,dir:s.dir,comment:s.fileCommentStr.length?s.fileCommentStr:null,unixPermissions:s.unixPermissions,dosPermissions:s.dosPermissions,createFolders:t.createFolders}),s.dir||(n.file(u).unsafeOriginalName=c)}return i.zipComment.length&&(n.comment=i.zipComment),n}))}},{"./external":6,"./nodejsUtils":14,"./stream/Crc32Probe":25,"./utf8":31,"./utils":32,"./zipEntries":33}],12:[function(e,t,n){var r=e("../utils"),i=e("../stream/GenericWorker");function o(e,t){i.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}r.inherits(o,i),o.prototype._bindStream=function(e){var t=this;(this._stream=e).pause(),e.on("data",(function(e){t.push({data:e,meta:{percent:0}})})).on("error",(function(e){t.isPaused?this.generatedError=e:t.error(e)})).on("end",(function(){t.isPaused?t._upstreamEnded=!0:t.end()}))},o.prototype.pause=function(){return!!i.prototype.pause.call(this)&&(this._stream.pause(),!0)},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)},t.exports=o},{"../stream/GenericWorker":28,"../utils":32}],13:[function(e,t,n){var r=e("readable-stream").Readable;function i(e,t,n){r.call(this,t),this._helper=e;var i=this;e.on("data",(function(e,t){i.push(e)||i._helper.pause(),n&&n(t)})).on("error",(function(e){i.emit("error",e)})).on("end",(function(){i.push(null)}))}e("../utils").inherits(i,r),i.prototype._read=function(){this._helper.resume()},t.exports=i},{"../utils":32,"readable-stream":16}],14:[function(e,t,n){t.exports={isNode:"undefined"!=typeof Buffer,newBufferFrom:function(e,t){if(Buffer.from&&Buffer.from!==Uint8Array.from)return Buffer.from(e,t);if("number"==typeof e)throw new Error('The "data" argument must not be a number');return new Buffer(e,t)},allocBuffer:function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},isBuffer:function(e){return Buffer.isBuffer(e)},isStream:function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume}}},{}],15:[function(e,t,n){function r(e,t,n){var r,i=o.getTypeOf(t),s=o.extend(n||{},c);s.date=s.date||new Date,null!==s.compression&&(s.compression=s.compression.toUpperCase()),"string"==typeof s.unixPermissions&&(s.unixPermissions=parseInt(s.unixPermissions,8)),s.unixPermissions&&16384&s.unixPermissions&&(s.dir=!0),s.dosPermissions&&16&s.dosPermissions&&(s.dir=!0),s.dir&&(e=v(e)),s.createFolders&&(r=p(e))&&g.call(this,r,!0);var h,m="string"===i&&!1===s.binary&&!1===s.base64;n&&void 0!==n.binary||(s.binary=!m),(t instanceof u&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string"),h=t instanceof u||t instanceof a?t:d.isNode&&d.isStream(t)?new f(e,t):o.prepareContent(e,t,s.binary,s.optimizedBinaryString,s.base64);var y=new l(e,h,s);this.files[e]=y}var i=e("./utf8"),o=e("./utils"),a=e("./stream/GenericWorker"),s=e("./stream/StreamHelper"),c=e("./defaults"),u=e("./compressedObject"),l=e("./zipObject"),h=e("./generate"),d=e("./nodejsUtils"),f=e("./nodejs/NodejsStreamInputAdapter"),p=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return 0<t?e.substring(0,t):""},v=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},g=function(e,t){return t=void 0!==t?t:c.createFolders,e=v(e),this.files[e]||r.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function m(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var y={load:function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},forEach:function(e){var t,n,r;for(t in this.files)r=this.files[t],(n=t.slice(this.root.length,t.length))&&t.slice(0,this.root.length)===this.root&&e(n,r)},filter:function(e){var t=[];return this.forEach((function(n,r){e(n,r)&&t.push(r)})),t},file:function(e,t,n){if(1!==arguments.length)return e=this.root+e,r.call(this,e,t,n),this;if(m(e)){var i=e;return this.filter((function(e,t){return!t.dir&&i.test(e)}))}var o=this.files[this.root+e];return o&&!o.dir?o:null},folder:function(e){if(!e)return this;if(m(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=g.call(this,t),r=this.clone();return r.root=n.name,r},remove:function(e){e=this.root+e;var t=this.files[e];if(t||("/"!==e.slice(-1)&&(e+="/"),t=this.files[e]),t&&!t.dir)delete this.files[e];else for(var n=this.filter((function(t,n){return n.name.slice(0,e.length)===e})),r=0;r<n.length;r++)delete this.files[n[r].name];return this},generate:function(e){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},generateInternalStream:function(e){var t,n={};try{if((n=o.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:i.utf8encode})).type=n.type.toLowerCase(),n.compression=n.compression.toUpperCase(),"binarystring"===n.type&&(n.type="string"),!n.type)throw new Error("No output type specified.");o.checkSupport(n.type),"darwin"!==n.platform&&"freebsd"!==n.platform&&"linux"!==n.platform&&"sunos"!==n.platform||(n.platform="UNIX"),"win32"===n.platform&&(n.platform="DOS");var r=n.comment||this.comment||"";t=h.generateWorker(this,n,r)}catch(e){(t=new a("error")).error(e)}return new s(t,n.type||"string",n.mimeType)},generateAsync:function(e,t){return this.generateInternalStream(e).accumulate(t)},generateNodeStream:function(e,t){return(e=e||{}).type||(e.type="nodebuffer"),this.generateInternalStream(e).toNodejsStream(t)}};t.exports=y},{"./compressedObject":2,"./defaults":5,"./generate":9,"./nodejs/NodejsStreamInputAdapter":12,"./nodejsUtils":14,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31,"./utils":32,"./zipObject":35}],16:[function(e,t,n){t.exports=e("stream")},{stream:void 0}],17:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data[this.zero+e]},i.prototype.lastIndexOfSignature=function(e){for(var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.length-4;0<=o;--o)if(this.data[o]===t&&this.data[o+1]===n&&this.data[o+2]===r&&this.data[o+3]===i)return o-this.zero;return-1},i.prototype.readAndCheckSignature=function(e){var t=e.charCodeAt(0),n=e.charCodeAt(1),r=e.charCodeAt(2),i=e.charCodeAt(3),o=this.readData(4);return t===o[0]&&n===o[1]&&r===o[2]&&i===o[3]},i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return[];var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],18:[function(e,t,n){var r=e("../utils");function i(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}i.prototype={checkOffset:function(e){this.checkIndex(this.index+e)},checkIndex:function(e){if(this.length<this.zero+e||e<0)throw new Error("End of data reached (data length = "+this.length+", asked index = "+e+"). Corrupted zip ?")},setIndex:function(e){this.checkIndex(e),this.index=e},skip:function(e){this.setIndex(this.index+e)},byteAt:function(e){},readInt:function(e){var t,n=0;for(this.checkOffset(e),t=this.index+e-1;t>=this.index;t--)n=(n<<8)+this.byteAt(t);return this.index+=e,n},readString:function(e){return r.transformTo("string",this.readData(e))},readData:function(e){},lastIndexOfSignature:function(e){},readAndCheckSignature:function(e){},readDate:function(){var e=this.readInt(4);return new Date(Date.UTC(1980+(e>>25&127),(e>>21&15)-1,e>>16&31,e>>11&31,e>>5&63,(31&e)<<1))}},t.exports=i},{"../utils":32}],19:[function(e,t,n){var r=e("./Uint8ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./Uint8ArrayReader":21}],20:[function(e,t,n){var r=e("./DataReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},i.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},i.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},i.prototype.readData=function(e){this.checkOffset(e);var t=this.data.slice(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./DataReader":18}],21:[function(e,t,n){var r=e("./ArrayReader");function i(e){r.call(this,e)}e("../utils").inherits(i,r),i.prototype.readData=function(e){if(this.checkOffset(e),0===e)return new Uint8Array(0);var t=this.data.subarray(this.zero+this.index,this.zero+this.index+e);return this.index+=e,t},t.exports=i},{"../utils":32,"./ArrayReader":17}],22:[function(e,t,n){var r=e("../utils"),i=e("../support"),o=e("./ArrayReader"),a=e("./StringReader"),s=e("./NodeBufferReader"),c=e("./Uint8ArrayReader");t.exports=function(e){var t=r.getTypeOf(e);return r.checkSupport(t),"string"!==t||i.uint8array?"nodebuffer"===t?new s(e):i.uint8array?new c(r.transformTo("uint8array",e)):new o(r.transformTo("array",e)):new a(e)}},{"../support":30,"../utils":32,"./ArrayReader":17,"./NodeBufferReader":19,"./StringReader":20,"./Uint8ArrayReader":21}],23:[function(e,t,n){n.LOCAL_FILE_HEADER="PK",n.CENTRAL_FILE_HEADER="PK",n.CENTRAL_DIRECTORY_END="PK",n.ZIP64_CENTRAL_DIRECTORY_LOCATOR="PK",n.ZIP64_CENTRAL_DIRECTORY_END="PK",n.DATA_DESCRIPTOR="PK\b"},{}],24:[function(e,t,n){var r=e("./GenericWorker"),i=e("../utils");function o(e){r.call(this,"ConvertWorker to "+e),this.destType=e}i.inherits(o,r),o.prototype.processChunk=function(e){this.push({data:i.transformTo(this.destType,e.data),meta:e.meta})},t.exports=o},{"../utils":32,"./GenericWorker":28}],25:[function(e,t,n){var r=e("./GenericWorker"),i=e("../crc32");function o(){r.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}e("../utils").inherits(o,r),o.prototype.processChunk=function(e){this.streamInfo.crc32=i(e.data,this.streamInfo.crc32||0),this.push(e)},t.exports=o},{"../crc32":4,"../utils":32,"./GenericWorker":28}],26:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}r.inherits(o,i),o.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}i.prototype.processChunk.call(this,e)},t.exports=o},{"../utils":32,"./GenericWorker":28}],27:[function(e,t,n){var r=e("../utils"),i=e("./GenericWorker");function o(e){i.call(this,"DataWorker");var t=this;this.dataIsReady=!1,this.index=0,this.max=0,this.data=null,this.type="",this._tickScheduled=!1,e.then((function(e){t.dataIsReady=!0,t.data=e,t.max=e&&e.length||0,t.type=r.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}r.inherits(o,i),o.prototype.cleanUp=function(){i.prototype.cleanUp.call(this),this.data=null},o.prototype.resume=function(){return!!i.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,r.delay(this._tickAndRepeat,[],this)),!0)},o.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(r.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},o.prototype._tick=function(){if(this.isPaused||this.isFinished)return!1;var e=null,t=Math.min(this.max,this.index+16384);if(this.index>=this.max)return this.end();switch(this.type){case"string":e=this.data.substring(this.index,t);break;case"uint8array":e=this.data.subarray(this.index,t);break;case"array":case"nodebuffer":e=this.data.slice(this.index,t)}return this.index=t,this.push({data:e,meta:{percent:this.max?this.index/this.max*100:0}})},t.exports=o},{"../utils":32,"./GenericWorker":28}],28:[function(e,t,n){function r(e){this.name=e||"default",this.streamInfo={},this.generatedError=null,this.extraStreamInfo={},this.isPaused=!0,this.isFinished=!1,this.isLocked=!1,this._listeners={data:[],end:[],error:[]},this.previous=null}r.prototype={push:function(e){this.emit("data",e)},end:function(){if(this.isFinished)return!1;this.flush();try{this.emit("end"),this.cleanUp(),this.isFinished=!0}catch(e){this.emit("error",e)}return!0},error:function(e){return!this.isFinished&&(this.isPaused?this.generatedError=e:(this.isFinished=!0,this.emit("error",e),this.previous&&this.previous.error(e),this.cleanUp()),!0)},on:function(e,t){return this._listeners[e].push(t),this},cleanUp:function(){this.streamInfo=this.generatedError=this.extraStreamInfo=null,this._listeners=[]},emit:function(e,t){if(this._listeners[e])for(var n=0;n<this._listeners[e].length;n++)this._listeners[e][n].call(this,t)},pipe:function(e){return e.registerPrevious(this)},registerPrevious:function(e){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.streamInfo=e.streamInfo,this.mergeStreamInfo(),this.previous=e;var t=this;return e.on("data",(function(e){t.processChunk(e)})),e.on("end",(function(){t.end()})),e.on("error",(function(e){t.error(e)})),this},pause:function(){return!this.isPaused&&!this.isFinished&&(this.isPaused=!0,this.previous&&this.previous.pause(),!0)},resume:function(){if(!this.isPaused||this.isFinished)return!1;var e=this.isPaused=!1;return this.generatedError&&(this.error(this.generatedError),e=!0),this.previous&&this.previous.resume(),!e},flush:function(){},processChunk:function(e){this.push(e)},withStreamInfo:function(e,t){return this.extraStreamInfo[e]=t,this.mergeStreamInfo(),this},mergeStreamInfo:function(){for(var e in this.extraStreamInfo)this.extraStreamInfo.hasOwnProperty(e)&&(this.streamInfo[e]=this.extraStreamInfo[e])},lock:function(){if(this.isLocked)throw new Error("The stream '"+this+"' has already been used.");this.isLocked=!0,this.previous&&this.previous.lock()},toString:function(){var e="Worker "+this.name;return this.previous?this.previous+" -> "+e:e}},t.exports=r},{}],29:[function(e,t,n){var r=e("../utils"),i=e("./ConvertWorker"),o=e("./GenericWorker"),a=e("../base64"),s=e("../support"),c=e("../external"),u=null;if(s.nodestream)try{u=e("../nodejs/NodejsStreamOutputAdapter")}catch(e){}function l(e,t,n){var a=t;switch(t){case"blob":case"arraybuffer":a="uint8array";break;case"base64":a="string"}try{this._internalType=a,this._outputType=t,this._mimeType=n,r.checkSupport(a),this._worker=e.pipe(new i(a)),e.lock()}catch(e){this._worker=new o("error"),this._worker.error(e)}}l.prototype={accumulate:function(e){return function(e,t){return new c.Promise((function(n,i){var o=[],s=e._internalType,c=e._outputType,u=e._mimeType;e.on("data",(function(e,n){o.push(e),t&&t(n)})).on("error",(function(e){o=[],i(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return r.newBlob(r.transformTo("arraybuffer",t),n);case"base64":return a.encode(t);default:return r.transformTo(e,t)}}(c,function(e,t){var n,r=0,i=null,o=0;for(n=0;n<t.length;n++)o+=t[n].length;switch(e){case"string":return t.join("");case"array":return Array.prototype.concat.apply([],t);case"uint8array":for(i=new Uint8Array(o),n=0;n<t.length;n++)i.set(t[n],r),r+=t[n].length;return i;case"nodebuffer":return Buffer.concat(t);default:throw new Error("concat : unsupported type '"+e+"'")}}(s,o),u);n(e)}catch(e){i(e)}o=[]})).resume()}))}(this,e)},on:function(e,t){var n=this;return"data"===e?this._worker.on(e,(function(e){t.call(n,e.data,e.meta)})):this._worker.on(e,(function(){r.delay(t,arguments,n)})),this},resume:function(){return r.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(r.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new u(this,{objectMode:"nodebuffer"!==this._outputType},e)}},t.exports=l},{"../base64":1,"../external":6,"../nodejs/NodejsStreamOutputAdapter":13,"../support":30,"../utils":32,"./ConvertWorker":24,"./GenericWorker":28}],30:[function(e,t,n){if(n.base64=!0,n.array=!0,n.string=!0,n.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,n.nodebuffer="undefined"!=typeof Buffer,n.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)n.blob=!1;else{var r=new ArrayBuffer(0);try{n.blob=0===new Blob([r],{type:"application/zip"}).size}catch(e){try{var i=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);i.append(r),n.blob=0===i.getBlob("application/zip").size}catch(e){n.blob=!1}}}try{n.nodestream=!!e("readable-stream").Readable}catch(e){n.nodestream=!1}},{"readable-stream":16}],31:[function(e,t,n){for(var r=e("./utils"),i=e("./support"),o=e("./nodejsUtils"),a=e("./stream/GenericWorker"),s=new Array(256),c=0;c<256;c++)s[c]=252<=c?6:248<=c?5:240<=c?4:224<=c?3:192<=c?2:1;function u(){a.call(this,"utf-8 decode"),this.leftOver=null}function l(){a.call(this,"utf-8 encode")}s[254]=s[254]=1,n.utf8encode=function(e){return i.nodebuffer?o.newBufferFrom(e,"utf-8"):function(e){var t,n,r,o,a,s=e.length,c=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(c):new Array(c),o=a=0;a<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(r=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(r-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t}(e)},n.utf8decode=function(e){return i.nodebuffer?r.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,n,i,o,a=e.length,c=new Array(2*a);for(t=n=0;t<a;)if((i=e[t++])<128)c[n++]=i;else if(4<(o=s[i]))c[n++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&t<a;)i=i<<6|63&e[t++],o--;1<o?c[n++]=65533:i<65536?c[n++]=i:(i-=65536,c[n++]=55296|i>>10&1023,c[n++]=56320|1023&i)}return c.length!==n&&(c.subarray?c=c.subarray(0,n):c.length=n),r.applyFromCharCode(c)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(u,a),u.prototype.processChunk=function(e){var t=r.transformTo(i.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(i.uint8array){var o=t;(t=new Uint8Array(o.length+this.leftOver.length)).set(this.leftOver,0),t.set(o,this.leftOver.length)}else t=this.leftOver.concat(t);this.leftOver=null}var a=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+s[e[n]]>t?n:t}(t),c=t;a!==t.length&&(i.uint8array?(c=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(c=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:n.utf8decode(c),meta:e.meta})},u.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=u,r.inherits(l,a),l.prototype.processChunk=function(e){this.push({data:n.utf8encode(e.data),meta:e.meta})},n.Utf8EncodeWorker=l},{"./nodejsUtils":14,"./stream/GenericWorker":28,"./support":30,"./utils":32}],32:[function(e,t,n){var r=e("./support"),i=e("./base64"),o=e("./nodejsUtils"),a=e("./external");function s(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}e("setimmediate"),n.newBlob=function(e,t){n.checkSupport("blob");try{return new Blob([e],{type:t})}catch(n){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(t)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var u={stringifyByChunk:function(e,t,n){var r=[],i=0,o=e.length;if(o<=n)return String.fromCharCode.apply(null,e);for(;i<o;)"array"===t||"nodebuffer"===t?r.push(String.fromCharCode.apply(null,e.slice(i,Math.min(i+n,o)))):r.push(String.fromCharCode.apply(null,e.subarray(i,Math.min(i+n,o)))),i+=n;return r.join("")},stringifyByChar:function(e){for(var t="",n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return t},applyCanBeUsed:{uint8array:function(){try{return r.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return r.nodebuffer&&1===String.fromCharCode.apply(null,o.allocBuffer(1)).length}catch(e){return!1}}()}};function l(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=u.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=u.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return u.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return u.stringifyByChar(e)}function h(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=l;var d={};d.string={string:s,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return d.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},d.array={string:l,array:s,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},d.arraybuffer={string:function(e){return l(new Uint8Array(e))},array:function(e){return h(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:s,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},d.uint8array={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:s,nodebuffer:function(e){return o.newBufferFrom(e)}},d.nodebuffer={string:l,array:function(e){return h(e,new Array(e.length))},arraybuffer:function(e){return d.nodebuffer.uint8array(e).buffer},uint8array:function(e){return h(e,new Uint8Array(e.length))},nodebuffer:s},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return d[r][e](t)},n.resolve=function(e){for(var t=e.split("/"),n=[],r=0;r<t.length;r++){var i=t[r];"."===i||""===i&&0!==r&&r!==t.length-1||(".."===i?n.pop():n.push(i))}return n.join("/")},n.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":r.nodebuffer&&o.isBuffer(e)?"nodebuffer":r.uint8array&&e instanceof Uint8Array?"uint8array":r.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},n.checkSupport=function(e){if(!r[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},n.MAX_VALUE_16BITS=65535,n.MAX_VALUE_32BITS=-1,n.pretty=function(e){var t,n,r="";for(n=0;n<(e||"").length;n++)r+="\\x"+((t=e.charCodeAt(n))<16?"0":"")+t.toString(16).toUpperCase();return r},n.delay=function(e,t,n){setImmediate((function(){e.apply(n||null,t||[])}))},n.inherits=function(e,t){function n(){}n.prototype=t.prototype,e.prototype=new n},n.extend=function(){var e,t,n={};for(e=0;e<arguments.length;e++)for(t in arguments[e])arguments[e].hasOwnProperty(t)&&void 0===n[t]&&(n[t]=arguments[e][t]);return n},n.prepareContent=function(e,t,o,s,u){return a.Promise.resolve(t).then((function(e){return r.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new a.Promise((function(t,n){var r=new FileReader;r.onload=function(e){t(e.target.result)},r.onerror=function(e){n(e.target.error)},r.readAsArrayBuffer(e)})):e})).then((function(t){var l=n.getTypeOf(t);return l?("arraybuffer"===l?t=n.transformTo("uint8array",t):"string"===l&&(u?t=i.decode(t):o&&!0!==s&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):a.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}},{"./base64":1,"./external":6,"./nodejsUtils":14,"./support":30,setimmediate:54}],33:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./signature"),a=e("./zipEntry"),s=(e("./utf8"),e("./support"));function c(e){this.files=[],this.loadOptions=e}c.prototype={checkSignature:function(e){if(!this.reader.readAndCheckSignature(e)){this.reader.index-=4;var t=this.reader.readString(4);throw new Error("Corrupted zip or bug: unexpected signature ("+i.pretty(t)+", expected "+i.pretty(e)+")")}},isSignature:function(e,t){var n=this.reader.index;this.reader.setIndex(e);var r=this.reader.readString(4)===t;return this.reader.setIndex(n),r},readBlockEndOfCentral:function(){this.diskNumber=this.reader.readInt(2),this.diskWithCentralDirStart=this.reader.readInt(2),this.centralDirRecordsOnThisDisk=this.reader.readInt(2),this.centralDirRecords=this.reader.readInt(2),this.centralDirSize=this.reader.readInt(4),this.centralDirOffset=this.reader.readInt(4),this.zipCommentLength=this.reader.readInt(2);var e=this.reader.readData(this.zipCommentLength),t=s.uint8array?"uint8array":"array",n=i.transformTo(t,e);this.zipComment=this.loadOptions.decodeFileName(n)},readBlockZip64EndOfCentral:function(){this.zip64EndOfCentralSize=this.reader.readInt(8),this.reader.skip(4),this.diskNumber=this.reader.readInt(4),this.diskWithCentralDirStart=this.reader.readInt(4),this.centralDirRecordsOnThisDisk=this.reader.readInt(8),this.centralDirRecords=this.reader.readInt(8),this.centralDirSize=this.reader.readInt(8),this.centralDirOffset=this.reader.readInt(8),this.zip64ExtensibleData={};for(var e,t,n,r=this.zip64EndOfCentralSize-44;0<r;)e=this.reader.readInt(2),t=this.reader.readInt(4),n=this.reader.readData(t),this.zip64ExtensibleData[e]={id:e,length:t,value:n}},readBlockZip64EndOfCentralLocator:function(){if(this.diskWithZip64CentralDirStart=this.reader.readInt(4),this.relativeOffsetEndOfZip64CentralDir=this.reader.readInt(8),this.disksCount=this.reader.readInt(4),1<this.disksCount)throw new Error("Multi-volumes zip are not supported")},readLocalFiles:function(){var e,t;for(e=0;e<this.files.length;e++)t=this.files[e],this.reader.setIndex(t.localHeaderOffset),this.checkSignature(o.LOCAL_FILE_HEADER),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(o.CENTRAL_FILE_HEADER);)(e=new a({zip64:this.zip64},this.loadOptions)).readCentralPart(this.reader),this.files.push(e);if(this.centralDirRecords!==this.files.length&&0!==this.centralDirRecords&&0===this.files.length)throw new Error("Corrupted zip or bug: expected "+this.centralDirRecords+" records in central dir, got "+this.files.length)},readEndOfCentral:function(){var e=this.reader.lastIndexOfSignature(o.CENTRAL_DIRECTORY_END);if(e<0)throw this.isSignature(0,o.LOCAL_FILE_HEADER)?new Error("Corrupted zip: can't find end of central directory"):new Error("Can't find end of central directory : is this a zip file ? If it is, see https://stuk.github.io/jszip/documentation/howto/read_zip.html");this.reader.setIndex(e);var t=e;if(this.checkSignature(o.CENTRAL_DIRECTORY_END),this.readBlockEndOfCentral(),this.diskNumber===i.MAX_VALUE_16BITS||this.diskWithCentralDirStart===i.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===i.MAX_VALUE_16BITS||this.centralDirRecords===i.MAX_VALUE_16BITS||this.centralDirSize===i.MAX_VALUE_32BITS||this.centralDirOffset===i.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_LOCATOR),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,o.ZIP64_CENTRAL_DIRECTORY_END)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(o.ZIP64_CENTRAL_DIRECTORY_END),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(0<r)this.isSignature(t,o.CENTRAL_FILE_HEADER)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=r(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}},t.exports=c},{"./reader/readerFor":22,"./signature":23,"./support":30,"./utf8":31,"./utils":32,"./zipEntry":34}],34:[function(e,t,n){var r=e("./reader/readerFor"),i=e("./utils"),o=e("./compressedObject"),a=e("./crc32"),s=e("./utf8"),c=e("./compressions"),u=e("./support");function l(e,t){this.options=e,this.loadOptions=t}l.prototype={isEncrypted:function(){return 1==(1&this.bitFlag)},useUTF8:function(){return 2048==(2048&this.bitFlag)},readLocalPart:function(e){var t,n;if(e.skip(22),this.fileNameLength=e.readInt(2),n=e.readInt(2),this.fileName=e.readData(this.fileNameLength),e.skip(n),-1===this.compressedSize||-1===this.uncompressedSize)throw new Error("Bug or corrupted zip : didn't get enough information from the central directory (compressedSize === -1 || uncompressedSize === -1)");if(null===(t=function(e){for(var t in c)if(c.hasOwnProperty(t)&&c[t].magic===e)return c[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+i.pretty(this.compressionMethod)+" unknown (inner file : "+i.transformTo("string",this.fileName)+")");this.decompressed=new o(this.compressedSize,this.uncompressedSize,this.crc32,t,e.readData(this.compressedSize))},readCentralPart:function(e){this.versionMadeBy=e.readInt(2),e.skip(2),this.bitFlag=e.readInt(2),this.compressionMethod=e.readString(2),this.date=e.readDate(),this.crc32=e.readInt(4),this.compressedSize=e.readInt(4),this.uncompressedSize=e.readInt(4);var t=e.readInt(2);if(this.extraFieldsLength=e.readInt(2),this.fileCommentLength=e.readInt(2),this.diskNumberStart=e.readInt(2),this.internalFileAttributes=e.readInt(2),this.externalFileAttributes=e.readInt(4),this.localHeaderOffset=e.readInt(4),this.isEncrypted())throw new Error("Encrypted zip are not supported");e.skip(t),this.readExtraFields(e),this.parseZIP64ExtraField(e),this.fileComment=e.readData(this.fileCommentLength)},processAttributes:function(){this.unixPermissions=null,this.dosPermissions=null;var e=this.versionMadeBy>>8;this.dir=!!(16&this.externalFileAttributes),0==e&&(this.dosPermissions=63&this.externalFileAttributes),3==e&&(this.unixPermissions=this.externalFileAttributes>>16&65535),this.dir||"/"!==this.fileNameStr.slice(-1)||(this.dir=!0)},parseZIP64ExtraField:function(e){if(this.extraFields[1]){var t=r(this.extraFields[1].value);this.uncompressedSize===i.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===i.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===i.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===i.MAX_VALUE_32BITS&&(this.diskNumberStart=t.readInt(4))}},readExtraFields:function(e){var t,n,r,i=e.index+this.extraFieldsLength;for(this.extraFields||(this.extraFields={});e.index+4<i;)t=e.readInt(2),n=e.readInt(2),r=e.readData(n),this.extraFields[t]={id:t,length:n,value:r};e.setIndex(i)},handleUTF8:function(){var e=u.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=s.utf8decode(this.fileName),this.fileCommentStr=s.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=i.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var o=i.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(o)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileName)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=r(e.value);return 1!==t.readInt(1)||a(this.fileComment)!==t.readInt(4)?null:s.utf8decode(t.readData(e.length-5))}return null}},t.exports=l},{"./compressedObject":2,"./compressions":3,"./crc32":4,"./reader/readerFor":22,"./support":30,"./utf8":31,"./utils":32}],35:[function(e,t,n){function r(e,t,n){this.name=e,this.dir=n.dir,this.date=n.date,this.comment=n.comment,this.unixPermissions=n.unixPermissions,this.dosPermissions=n.dosPermissions,this._data=t,this._dataBinary=n.binary,this.options={compression:n.compression,compressionOptions:n.compressionOptions}}var i=e("./stream/StreamHelper"),o=e("./stream/DataWorker"),a=e("./utf8"),s=e("./compressedObject"),c=e("./stream/GenericWorker");r.prototype={internalStream:function(e){var t=null,n="string";try{if(!e)throw new Error("No output type specified.");var r="string"===(n=e.toLowerCase())||"text"===n;"binarystring"!==n&&"text"!==n||(n="string"),t=this._decompressWorker();var o=!this._dataBinary;o&&!r&&(t=t.pipe(new a.Utf8EncodeWorker)),!o&&r&&(t=t.pipe(new a.Utf8DecodeWorker))}catch(e){(t=new c("error")).error(e)}return new i(t,n,"")},async:function(e,t){return this.internalStream(e).accumulate(t)},nodeStream:function(e,t){return this.internalStream(e||"nodebuffer").toNodejsStream(t)},_compressWorker:function(e,t){if(this._data instanceof s&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new a.Utf8EncodeWorker)),s.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof s?this._data.getContentWorker():this._data instanceof c?this._data:new o(this._data)}};for(var u=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],l=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},h=0;h<u.length;h++)r.prototype[u[h]]=l;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(e,t,n){(function(e){var n,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(l),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),n=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)n="document"in e&&"onreadystatechange"in e.document.createElement("script")?function(){var t=e.document.createElement("script");t.onreadystatechange=function(){l(),t.onreadystatechange=null,t.parentNode.removeChild(t),t=null},e.document.documentElement.appendChild(t)}:function(){setTimeout(l,0)};else{var c=new e.MessageChannel;c.port1.onmessage=l,n=function(){c.port2.postMessage(0)}}var u=[];function l(){var e,t;r=!0;for(var n=u.length;n;){for(t=u,u=[],e=-1;++e<n;)t[e]();n=u.length}r=!1}t.exports=function(e){1!==u.push(e)||r||n()}}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],37:[function(e,t,n){var r=e("immediate");function i(){}var o={},a=["REJECTED"],s=["FULFILLED"],c=["PENDING"];function u(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=c,this.queue=[],this.outcome=void 0,e!==i&&f(this,e)}function l(e,t,n){this.promise=e,"function"==typeof t&&(this.onFulfilled=t,this.callFulfilled=this.otherCallFulfilled),"function"==typeof n&&(this.onRejected=n,this.callRejected=this.otherCallRejected)}function h(e,t,n){r((function(){var r;try{r=t(n)}catch(r){return o.reject(e,r)}r===e?o.reject(e,new TypeError("Cannot resolve promise with itself")):o.resolve(e,r)}))}function d(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function f(e,t){var n=!1;function r(t){n||(n=!0,o.reject(e,t))}function i(t){n||(n=!0,o.resolve(e,t))}var a=p((function(){t(i,r)}));"error"===a.status&&r(a.value)}function p(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}(t.exports=u).prototype.finally=function(e){if("function"!=typeof e)return this;var t=this.constructor;return this.then((function(n){return t.resolve(e()).then((function(){return n}))}),(function(n){return t.resolve(e()).then((function(){throw n}))}))},u.prototype.catch=function(e){return this.then(null,e)},u.prototype.then=function(e,t){if("function"!=typeof e&&this.state===s||"function"!=typeof t&&this.state===a)return this;var n=new this.constructor(i);return this.state!==c?h(n,this.state===s?e:t,this.outcome):this.queue.push(new l(n,e,t)),n},l.prototype.callFulfilled=function(e){o.resolve(this.promise,e)},l.prototype.otherCallFulfilled=function(e){h(this.promise,this.onFulfilled,e)},l.prototype.callRejected=function(e){o.reject(this.promise,e)},l.prototype.otherCallRejected=function(e){h(this.promise,this.onRejected,e)},o.resolve=function(e,t){var n=p(d,t);if("error"===n.status)return o.reject(e,n.value);var r=n.value;if(r)f(e,r);else{e.state=s,e.outcome=t;for(var i=-1,a=e.queue.length;++i<a;)e.queue[i].callFulfilled(t)}return e},o.reject=function(e,t){e.state=a,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},u.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},u.reject=function(e){var t=new this(i);return o.reject(t,e)},u.all=function(e){var t=this;if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var n=e.length,r=!1;if(!n)return this.resolve([]);for(var a=new Array(n),s=0,c=-1,u=new this(i);++c<n;)l(e[c],c);return u;function l(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==n||r||(r=!0,o.resolve(u,a))}),(function(e){r||(r=!0,o.reject(u,e))}))}},u.race=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return this.reject(new TypeError("must be an array"));var t=e.length,n=!1;if(!t)return this.resolve([]);for(var r,a=-1,s=new this(i);++a<t;)r=e[a],this.resolve(r).then((function(e){n||(n=!0,o.resolve(s,e))}),(function(e){n||(n=!0,o.reject(s,e))}));return s}},{immediate:36}],38:[function(e,t,n){var r={};(0,e("./lib/utils/common").assign)(r,e("./lib/deflate"),e("./lib/inflate"),e("./lib/zlib/constants")),t.exports=r},{"./lib/deflate":39,"./lib/inflate":40,"./lib/utils/common":41,"./lib/zlib/constants":44}],39:[function(e,t,n){var r=e("./zlib/deflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/messages"),s=e("./zlib/zstream"),c=Object.prototype.toString;function u(e){if(!(this instanceof u))return new u(e);this.options=i.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&0<t.windowBits?t.windowBits=-t.windowBits:t.gzip&&0<t.windowBits&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new s,this.strm.avail_out=0;var n=r.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(a[n]);if(t.header&&r.deflateSetHeader(this.strm,t.header),t.dictionary){var l;if(l="string"==typeof t.dictionary?o.string2buf(t.dictionary):"[object ArrayBuffer]"===c.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=r.deflateSetDictionary(this.strm,l)))throw new Error(a[n]);this._dict_set=!0}}function l(e,t){var n=new u(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}u.prototype.push=function(e,t){var n,a,s=this.strm,u=this.options.chunkSize;if(this.ended)return!1;a=t===~~t?t:!0===t?4:0,"string"==typeof e?s.input=o.string2buf(e):"[object ArrayBuffer]"===c.call(e)?s.input=new Uint8Array(e):s.input=e,s.next_in=0,s.avail_in=s.input.length;do{if(0===s.avail_out&&(s.output=new i.Buf8(u),s.next_out=0,s.avail_out=u),1!==(n=r.deflate(s,a))&&0!==n)return this.onEnd(n),!(this.ended=!0);0!==s.avail_out&&(0!==s.avail_in||4!==a&&2!==a)||("string"===this.options.to?this.onData(o.buf2binstring(i.shrinkBuf(s.output,s.next_out))):this.onData(i.shrinkBuf(s.output,s.next_out)))}while((0<s.avail_in||0===s.avail_out)&&1!==n);return 4===a?(n=r.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==a||(this.onEnd(0),!(s.avail_out=0))},u.prototype.onData=function(e){this.chunks.push(e)},u.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Deflate=u,n.deflate=l,n.deflateRaw=function(e,t){return(t=t||{}).raw=!0,l(e,t)},n.gzip=function(e,t){return(t=t||{}).gzip=!0,l(e,t)}},{"./utils/common":41,"./utils/strings":42,"./zlib/deflate":46,"./zlib/messages":51,"./zlib/zstream":53}],40:[function(e,t,n){var r=e("./zlib/inflate"),i=e("./utils/common"),o=e("./utils/strings"),a=e("./zlib/constants"),s=e("./zlib/messages"),c=e("./zlib/zstream"),u=e("./zlib/gzheader"),l=Object.prototype.toString;function h(e){if(!(this instanceof h))return new h(e);this.options=i.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&0<=t.windowBits&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(0<=t.windowBits&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),15<t.windowBits&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new c,this.strm.avail_out=0;var n=r.inflateInit2(this.strm,t.windowBits);if(n!==a.Z_OK)throw new Error(s[n]);this.header=new u,r.inflateGetHeader(this.strm,this.header)}function d(e,t){var n=new h(t);if(n.push(e,!0),n.err)throw n.msg||s[n.err];return n.result}h.prototype.push=function(e,t){var n,s,c,u,h,d,f=this.strm,p=this.options.chunkSize,v=this.options.dictionary,g=!1;if(this.ended)return!1;s=t===~~t?t:!0===t?a.Z_FINISH:a.Z_NO_FLUSH,"string"==typeof e?f.input=o.binstring2buf(e):"[object ArrayBuffer]"===l.call(e)?f.input=new Uint8Array(e):f.input=e,f.next_in=0,f.avail_in=f.input.length;do{if(0===f.avail_out&&(f.output=new i.Buf8(p),f.next_out=0,f.avail_out=p),(n=r.inflate(f,a.Z_NO_FLUSH))===a.Z_NEED_DICT&&v&&(d="string"==typeof v?o.string2buf(v):"[object ArrayBuffer]"===l.call(v)?new Uint8Array(v):v,n=r.inflateSetDictionary(this.strm,d)),n===a.Z_BUF_ERROR&&!0===g&&(n=a.Z_OK,g=!1),n!==a.Z_STREAM_END&&n!==a.Z_OK)return this.onEnd(n),!(this.ended=!0);f.next_out&&(0!==f.avail_out&&n!==a.Z_STREAM_END&&(0!==f.avail_in||s!==a.Z_FINISH&&s!==a.Z_SYNC_FLUSH)||("string"===this.options.to?(c=o.utf8border(f.output,f.next_out),u=f.next_out-c,h=o.buf2string(f.output,c),f.next_out=u,f.avail_out=p-u,u&&i.arraySet(f.output,f.output,c,u,0),this.onData(h)):this.onData(i.shrinkBuf(f.output,f.next_out)))),0===f.avail_in&&0===f.avail_out&&(g=!0)}while((0<f.avail_in||0===f.avail_out)&&n!==a.Z_STREAM_END);return n===a.Z_STREAM_END&&(s=a.Z_FINISH),s===a.Z_FINISH?(n=r.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===a.Z_OK):s!==a.Z_SYNC_FLUSH||(this.onEnd(a.Z_OK),!(f.avail_out=0))},h.prototype.onData=function(e){this.chunks.push(e)},h.prototype.onEnd=function(e){e===a.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=i.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg},n.Inflate=h,n.inflate=d,n.inflateRaw=function(e,t){return(t=t||{}).raw=!0,d(e,t)},n.ungzip=d},{"./utils/common":41,"./utils/strings":42,"./zlib/constants":44,"./zlib/gzheader":47,"./zlib/inflate":49,"./zlib/messages":51,"./zlib/zstream":53}],41:[function(e,t,n){var r="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;n.assign=function(e){for(var t=Array.prototype.slice.call(arguments,1);t.length;){var n=t.shift();if(n){if("object"!=typeof n)throw new TypeError(n+"must be non-object");for(var r in n)n.hasOwnProperty(r)&&(e[r]=n[r])}}return e},n.shrinkBuf=function(e,t){return e.length===t?e:e.subarray?e.subarray(0,t):(e.length=t,e)};var i={arraySet:function(e,t,n,r,i){if(t.subarray&&e.subarray)e.set(t.subarray(n,n+r),i);else for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){var t,n,r,i,o,a;for(t=r=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),t=i=0,n=e.length;t<n;t++)o=e[t],a.set(o,i),i+=o.length;return a}},o={arraySet:function(e,t,n,r,i){for(var o=0;o<r;o++)e[i+o]=t[n+o]},flattenChunks:function(e){return[].concat.apply([],e)}};n.setTyped=function(e){e?(n.Buf8=Uint8Array,n.Buf16=Uint16Array,n.Buf32=Int32Array,n.assign(n,i)):(n.Buf8=Array,n.Buf16=Array,n.Buf32=Array,n.assign(n,o))},n.setTyped(r)},{}],42:[function(e,t,n){var r=e("./common"),i=!0,o=!0;try{String.fromCharCode.apply(null,[0])}catch(e){i=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){o=!1}for(var a=new r.Buf8(256),s=0;s<256;s++)a[s]=252<=s?6:248<=s?5:240<=s?4:224<=s?3:192<=s?2:1;function c(e,t){if(t<65537&&(e.subarray&&o||!e.subarray&&i))return String.fromCharCode.apply(null,r.shrinkBuf(e,t));for(var n="",a=0;a<t;a++)n+=String.fromCharCode(e[a]);return n}a[254]=a[254]=1,n.string2buf=function(e){var t,n,i,o,a,s=e.length,c=0;for(o=0;o<s;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),c+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(c),o=a=0;a<c;o++)55296==(64512&(n=e.charCodeAt(o)))&&o+1<s&&56320==(64512&(i=e.charCodeAt(o+1)))&&(n=65536+(n-55296<<10)+(i-56320),o++),n<128?t[a++]=n:(n<2048?t[a++]=192|n>>>6:(n<65536?t[a++]=224|n>>>12:(t[a++]=240|n>>>18,t[a++]=128|n>>>12&63),t[a++]=128|n>>>6&63),t[a++]=128|63&n);return t},n.buf2binstring=function(e){return c(e,e.length)},n.binstring2buf=function(e){for(var t=new r.Buf8(e.length),n=0,i=t.length;n<i;n++)t[n]=e.charCodeAt(n);return t},n.buf2string=function(e,t){var n,r,i,o,s=t||e.length,u=new Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)u[r++]=i;else if(4<(o=a[i]))u[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;1<o&&n<s;)i=i<<6|63&e[n++],o--;1<o?u[r++]=65533:i<65536?u[r++]=i:(i-=65536,u[r++]=55296|i>>10&1023,u[r++]=56320|1023&i)}return c(u,r)},n.utf8border=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;0<=n&&128==(192&e[n]);)n--;return n<0||0===n?t:n+a[e[n]]>t?n:t}},{"./common":41}],43:[function(e,t,n){t.exports=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){for(n-=a=2e3<n?2e3:n;o=o+(i=i+t[r++]|0)|0,--a;);i%=65521,o%=65521}return i|o<<16|0}},{}],44:[function(e,t,n){t.exports={Z_NO_FLUSH:0,Z_PARTIAL_FLUSH:1,Z_SYNC_FLUSH:2,Z_FULL_FLUSH:3,Z_FINISH:4,Z_BLOCK:5,Z_TREES:6,Z_OK:0,Z_STREAM_END:1,Z_NEED_DICT:2,Z_ERRNO:-1,Z_STREAM_ERROR:-2,Z_DATA_ERROR:-3,Z_BUF_ERROR:-5,Z_NO_COMPRESSION:0,Z_BEST_SPEED:1,Z_BEST_COMPRESSION:9,Z_DEFAULT_COMPRESSION:-1,Z_FILTERED:1,Z_HUFFMAN_ONLY:2,Z_RLE:3,Z_FIXED:4,Z_DEFAULT_STRATEGY:0,Z_BINARY:0,Z_TEXT:1,Z_UNKNOWN:2,Z_DEFLATED:8}},{}],45:[function(e,t,n){var r=function(){for(var e,t=[],n=0;n<256;n++){e=n;for(var r=0;r<8;r++)e=1&e?3988292384^e>>>1:e>>>1;t[n]=e}return t}();t.exports=function(e,t,n,i){var o=r,a=i+n;e^=-1;for(var s=i;s<a;s++)e=e>>>8^o[255&(e^t[s])];return-1^e}},{}],46:[function(e,t,n){var r,i=e("../utils/common"),o=e("./trees"),a=e("./adler32"),s=e("./crc32"),c=e("./messages"),u=-2,l=258,h=262,d=113;function f(e,t){return e.msg=c[t],t}function p(e){return(e<<1)-(4<e?9:0)}function v(e){for(var t=e.length;0<=--t;)e[t]=0}function g(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(i.arraySet(e.output,t.pending_buf,t.pending_out,n,e.next_out),e.next_out+=n,t.pending_out+=n,e.total_out+=n,e.avail_out-=n,t.pending-=n,0===t.pending&&(t.pending_out=0))}function m(e,t){o._tr_flush_block(e,0<=e.block_start?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,g(e.strm)}function y(e,t){e.pending_buf[e.pending++]=t}function b(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function S(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,c=e.strstart>e.w_size-h?e.strstart-(e.w_size-h):0,u=e.window,d=e.w_mask,f=e.prev,p=e.strstart+l,v=u[o+a-1],g=u[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(u[(n=t)+a]===g&&u[n+a-1]===v&&u[n]===u[o]&&u[++n]===u[o+1]){o+=2,n++;do{}while(u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&u[++o]===u[++n]&&o<p);if(r=l-(p-o),o=p-l,a<r){if(e.match_start=t,s<=(a=r))break;v=u[o+a-1],g=u[o+a]}}}while((t=f[t&d])>c&&0!=--i);return a<=e.lookahead?a:e.lookahead}function w(e){var t,n,r,o,c,u,l,d,f,p,v=e.w_size;do{if(o=e.window_size-e.lookahead-e.strstart,e.strstart>=v+(v-h)){for(i.arraySet(e.window,e.window,v,v,0),e.match_start-=v,e.strstart-=v,e.block_start-=v,t=n=e.hash_size;r=e.head[--t],e.head[t]=v<=r?r-v:0,--n;);for(t=n=v;r=e.prev[--t],e.prev[t]=v<=r?r-v:0,--n;);o+=v}if(0===e.strm.avail_in)break;if(u=e.strm,l=e.window,d=e.strstart+e.lookahead,p=void 0,(f=o)<(p=u.avail_in)&&(p=f),n=0===p?0:(u.avail_in-=p,i.arraySet(l,u.input,u.next_in,p,d),1===u.state.wrap?u.adler=a(u.adler,l,p,d):2===u.state.wrap&&(u.adler=s(u.adler,l,p,d)),u.next_in+=p,u.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=3)for(c=e.strstart-e.insert,e.ins_h=e.window[c],e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[c+3-1])&e.hash_mask,e.prev[c&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=c,c++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<h&&0!==e.strm.avail_in)}function k(e,t){for(var n,r;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!==n&&e.strstart-n<=e.w_size-h&&(e.match_length=S(e,n)),e.match_length>=3)if(r=o._tr_tally(e,e.strstart-e.match_start,e.match_length-3),e.lookahead-=e.match_length,e.match_length<=e.max_lazy_match&&e.lookahead>=3){for(e.match_length--;e.strstart++,e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart,0!=--e.match_length;);e.strstart++}else e.strstart+=e.match_length,e.match_length=0,e.ins_h=e.window[e.strstart],e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+1])&e.hash_mask;else r=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function C(e,t){for(var n,r,i;;){if(e.lookahead<h){if(w(e),e.lookahead<h&&0===t)return 1;if(0===e.lookahead)break}if(n=0,e.lookahead>=3&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),e.prev_length=e.match_length,e.prev_match=e.match_start,e.match_length=2,0!==n&&e.prev_length<e.max_lazy_match&&e.strstart-n<=e.w_size-h&&(e.match_length=S(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&4096<e.strstart-e.match_start)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){for(i=e.strstart+e.lookahead-3,r=o._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;++e.strstart<=i&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[e.strstart+3-1])&e.hash_mask,n=e.prev[e.strstart&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=e.strstart),0!=--e.prev_length;);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(m(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=o._tr_tally(e,0,e.window[e.strstart-1]))&&m(e,!1),e.strstart++,e.lookahead--,0===e.strm.avail_out)return 1}else e.match_available=1,e.strstart++,e.lookahead--}return e.match_available&&(r=o._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}function E(e,t,n,r,i){this.good_length=e,this.max_lazy=t,this.nice_length=n,this.max_chain=r,this.func=i}function x(){this.strm=null,this.status=0,this.pending_buf=null,this.pending_buf_size=0,this.pending_out=0,this.pending=0,this.wrap=0,this.gzhead=null,this.gzindex=0,this.method=8,this.last_flush=-1,this.w_size=0,this.w_bits=0,this.w_mask=0,this.window=null,this.window_size=0,this.prev=null,this.head=null,this.ins_h=0,this.hash_size=0,this.hash_bits=0,this.hash_mask=0,this.hash_shift=0,this.block_start=0,this.match_length=0,this.prev_match=0,this.match_available=0,this.strstart=0,this.match_start=0,this.lookahead=0,this.prev_length=0,this.max_chain_length=0,this.max_lazy_match=0,this.level=0,this.strategy=0,this.good_match=0,this.nice_match=0,this.dyn_ltree=new i.Buf16(1146),this.dyn_dtree=new i.Buf16(122),this.bl_tree=new i.Buf16(78),v(this.dyn_ltree),v(this.dyn_dtree),v(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new i.Buf16(16),this.heap=new i.Buf16(573),v(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new i.Buf16(573),v(this.depth),this.l_buf=0,this.lit_bufsize=0,this.last_lit=0,this.d_buf=0,this.opt_len=0,this.static_len=0,this.matches=0,this.insert=0,this.bi_buf=0,this.bi_valid=0}function I(e){var t;return e&&e.state?(e.total_in=e.total_out=0,e.data_type=2,(t=e.state).pending=0,t.pending_out=0,t.wrap<0&&(t.wrap=-t.wrap),t.status=t.wrap?42:d,e.adler=2===t.wrap?0:1,t.last_flush=0,o._tr_init(t),0):f(e,u)}function _(e){var t=I(e);return 0===t&&function(e){e.window_size=2*e.w_size,v(e.head),e.max_lazy_match=r[e.level].max_lazy,e.good_match=r[e.level].good_length,e.nice_match=r[e.level].nice_length,e.max_chain_length=r[e.level].max_chain,e.strstart=0,e.block_start=0,e.lookahead=0,e.insert=0,e.match_length=e.prev_length=2,e.match_available=0,e.ins_h=0}(e.state),t}function A(e,t,n,r,o,a){if(!e)return u;var s=1;if(-1===t&&(t=6),r<0?(s=0,r=-r):15<r&&(s=2,r-=16),o<1||9<o||8!==n||r<8||15<r||t<0||9<t||a<0||4<a)return f(e,u);8===r&&(r=9);var c=new x;return(e.state=c).strm=e,c.wrap=s,c.gzhead=null,c.w_bits=r,c.w_size=1<<c.w_bits,c.w_mask=c.w_size-1,c.hash_bits=o+7,c.hash_size=1<<c.hash_bits,c.hash_mask=c.hash_size-1,c.hash_shift=~~((c.hash_bits+3-1)/3),c.window=new i.Buf8(2*c.w_size),c.head=new i.Buf16(c.hash_size),c.prev=new i.Buf16(c.w_size),c.lit_bufsize=1<<o+6,c.pending_buf_size=4*c.lit_bufsize,c.pending_buf=new i.Buf8(c.pending_buf_size),c.d_buf=1*c.lit_bufsize,c.l_buf=3*c.lit_bufsize,c.level=t,c.strategy=a,c.method=n,_(e)}r=[new E(0,0,0,0,(function(e,t){var n=65535;for(n>e.pending_buf_size-5&&(n=e.pending_buf_size-5);;){if(e.lookahead<=1){if(w(e),0===e.lookahead&&0===t)return 1;if(0===e.lookahead)break}e.strstart+=e.lookahead,e.lookahead=0;var r=e.block_start+n;if((0===e.strstart||e.strstart>=r)&&(e.lookahead=e.strstart-r,e.strstart=r,m(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-h&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(m(e,!1),e.strm.avail_out),1)})),new E(4,4,8,4,k),new E(4,5,16,8,k),new E(4,6,32,32,k),new E(4,4,16,16,C),new E(8,16,32,32,C),new E(8,16,128,128,C),new E(8,32,128,256,C),new E(32,128,258,1024,C),new E(32,258,258,4096,C)],n.deflateInit=function(e,t){return A(e,t,8,15,8,0)},n.deflateInit2=A,n.deflateReset=_,n.deflateResetKeep=I,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?u:(e.state.gzhead=t,0):u},n.deflate=function(e,t){var n,i,a,c;if(!e||!e.state||5<t||t<0)return e?f(e,u):u;if(i=e.state,!e.output||!e.input&&0!==e.avail_in||666===i.status&&4!==t)return f(e,0===e.avail_out?-5:u);if(i.strm=e,n=i.last_flush,i.last_flush=t,42===i.status)if(2===i.wrap)e.adler=0,y(i,31),y(i,139),y(i,8),i.gzhead?(y(i,(i.gzhead.text?1:0)+(i.gzhead.hcrc?2:0)+(i.gzhead.extra?4:0)+(i.gzhead.name?8:0)+(i.gzhead.comment?16:0)),y(i,255&i.gzhead.time),y(i,i.gzhead.time>>8&255),y(i,i.gzhead.time>>16&255),y(i,i.gzhead.time>>24&255),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,255&i.gzhead.os),i.gzhead.extra&&i.gzhead.extra.length&&(y(i,255&i.gzhead.extra.length),y(i,i.gzhead.extra.length>>8&255)),i.gzhead.hcrc&&(e.adler=s(e.adler,i.pending_buf,i.pending,0)),i.gzindex=0,i.status=69):(y(i,0),y(i,0),y(i,0),y(i,0),y(i,0),y(i,9===i.level?2:2<=i.strategy||i.level<2?4:0),y(i,3),i.status=d);else{var h=8+(i.w_bits-8<<4)<<8;h|=(2<=i.strategy||i.level<2?0:i.level<6?1:6===i.level?2:3)<<6,0!==i.strstart&&(h|=32),h+=31-h%31,i.status=d,b(i,h),0!==i.strstart&&(b(i,e.adler>>>16),b(i,65535&e.adler)),e.adler=1}if(69===i.status)if(i.gzhead.extra){for(a=i.pending;i.gzindex<(65535&i.gzhead.extra.length)&&(i.pending!==i.pending_buf_size||(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending!==i.pending_buf_size));)y(i,255&i.gzhead.extra[i.gzindex]),i.gzindex++;i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),i.gzindex===i.gzhead.extra.length&&(i.gzindex=0,i.status=73)}else i.status=73;if(73===i.status)if(i.gzhead.name){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===c&&(i.gzindex=0,i.status=91)}else i.status=91;if(91===i.status)if(i.gzhead.comment){a=i.pending;do{if(i.pending===i.pending_buf_size&&(i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),g(e),a=i.pending,i.pending===i.pending_buf_size)){c=1;break}c=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,c)}while(0!==c);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===c&&(i.status=103)}else i.status=103;if(103===i.status&&(i.gzhead.hcrc?(i.pending+2>i.pending_buf_size&&g(e),i.pending+2<=i.pending_buf_size&&(y(i,255&e.adler),y(i,e.adler>>8&255),e.adler=0,i.status=d)):i.status=d),0!==i.pending){if(g(e),0===e.avail_out)return i.last_flush=-1,0}else if(0===e.avail_in&&p(t)<=p(n)&&4!==t)return f(e,-5);if(666===i.status&&0!==e.avail_in)return f(e,-5);if(0!==e.avail_in||0!==i.lookahead||0!==t&&666!==i.status){var S=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(w(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):3===i.strategy?function(e,t){for(var n,r,i,a,s=e.window;;){if(e.lookahead<=l){if(w(e),e.lookahead<=l&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&0<e.strstart&&(r=s[i=e.strstart-1])===s[++i]&&r===s[++i]&&r===s[++i]){a=e.strstart+l;do{}while(r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&r===s[++i]&&i<a);e.match_length=l-(a-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=o._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=o._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(m(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(m(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(m(e,!1),0===e.strm.avail_out)?1:2}(i,t):r[i.level].func(i,t);if(3!==S&&4!==S||(i.status=666),1===S||3===S)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===S&&(1===t?o._tr_align(i):5!==t&&(o._tr_stored_block(i,0,0,!1),3===t&&(v(i.head),0===i.lookahead&&(i.strstart=0,i.block_start=0,i.insert=0))),g(e),0===e.avail_out))return i.last_flush=-1,0}return 4!==t?0:i.wrap<=0?1:(2===i.wrap?(y(i,255&e.adler),y(i,e.adler>>8&255),y(i,e.adler>>16&255),y(i,e.adler>>24&255),y(i,255&e.total_in),y(i,e.total_in>>8&255),y(i,e.total_in>>16&255),y(i,e.total_in>>24&255)):(b(i,e.adler>>>16),b(i,65535&e.adler)),g(e),0<i.wrap&&(i.wrap=-i.wrap),0!==i.pending?0:1)},n.deflateEnd=function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&t!==d&&666!==t?f(e,u):(e.state=null,t===d?f(e,-3):0):u},n.deflateSetDictionary=function(e,t){var n,r,o,s,c,l,h,d,f=t.length;if(!e||!e.state)return u;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return u;for(1===s&&(e.adler=a(e.adler,t,f,0)),n.wrap=0,f>=n.w_size&&(0===s&&(v(n.head),n.strstart=0,n.block_start=0,n.insert=0),d=new i.Buf8(n.w_size),i.arraySet(d,t,f-n.w_size,n.w_size,0),t=d,f=n.w_size),c=e.avail_in,l=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,w(n);n.lookahead>=3;){for(r=n.strstart,o=n.lookahead-2;n.ins_h=(n.ins_h<<n.hash_shift^n.window[r+3-1])&n.hash_mask,n.prev[r&n.w_mask]=n.head[n.ins_h],n.head[n.ins_h]=r,r++,--o;);n.strstart=r,n.lookahead=2,w(n)}return n.strstart+=n.lookahead,n.block_start=n.strstart,n.insert=n.lookahead,n.lookahead=0,n.match_length=n.prev_length=2,n.match_available=0,e.next_in=l,e.input=h,e.avail_in=c,n.wrap=s,0},n.deflateInfo="pako deflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./messages":51,"./trees":52}],47:[function(e,t,n){t.exports=function(){this.text=0,this.time=0,this.xflags=0,this.os=0,this.extra=null,this.extra_len=0,this.name="",this.comment="",this.hcrc=0,this.done=!1}},{}],48:[function(e,t,n){t.exports=function(e,t){var n,r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I;n=e.state,r=e.next_in,x=e.input,i=r+(e.avail_in-5),o=e.next_out,I=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),c=n.dmax,u=n.wsize,l=n.whave,h=n.wnext,d=n.window,f=n.hold,p=n.bits,v=n.lencode,g=n.distcode,m=(1<<n.lenbits)-1,y=(1<<n.distbits)-1;e:do{p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),b=v[f&m];t:for(;;){if(f>>>=S=b>>>24,p-=S,0==(S=b>>>16&255))I[o++]=65535&b;else{if(!(16&S)){if(0==(64&S)){b=v[(65535&b)+(f&(1<<S)-1)];continue t}if(32&S){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}w=65535&b,(S&=15)&&(p<S&&(f+=x[r++]<<p,p+=8),w+=f&(1<<S)-1,f>>>=S,p-=S),p<15&&(f+=x[r++]<<p,p+=8,f+=x[r++]<<p,p+=8),b=g[f&y];n:for(;;){if(f>>>=S=b>>>24,p-=S,!(16&(S=b>>>16&255))){if(0==(64&S)){b=g[(65535&b)+(f&(1<<S)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(k=65535&b,p<(S&=15)&&(f+=x[r++]<<p,(p+=8)<S&&(f+=x[r++]<<p,p+=8)),c<(k+=f&(1<<S)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(f>>>=S,p-=S,(S=o-a)<k){if(l<(S=k-S)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(E=d,(C=0)===h){if(C+=u-S,S<w){for(w-=S;I[o++]=d[C++],--S;);C=o-k,E=I}}else if(h<S){if(C+=u+h-S,(S-=h)<w){for(w-=S;I[o++]=d[C++],--S;);if(C=0,h<w){for(w-=S=h;I[o++]=d[C++],--S;);C=o-k,E=I}}}else if(C+=h-S,S<w){for(w-=S;I[o++]=d[C++],--S;);C=o-k,E=I}for(;2<w;)I[o++]=E[C++],I[o++]=E[C++],I[o++]=E[C++],w-=3;w&&(I[o++]=E[C++],1<w&&(I[o++]=E[C++]))}else{for(C=o-k;I[o++]=I[C++],I[o++]=I[C++],I[o++]=I[C++],2<(w-=3););w&&(I[o++]=I[C++],1<w&&(I[o++]=I[C++]))}break}}break}}while(r<i&&o<s);r-=w=p>>3,f&=(1<<(p-=w<<3))-1,e.next_in=r,e.next_out=o,e.avail_in=r<i?i-r+5:5-(r-i),e.avail_out=o<s?s-o+257:257-(o-s),n.hold=f,n.bits=p}},{}],49:[function(e,t,n){var r=e("../utils/common"),i=e("./adler32"),o=e("./crc32"),a=e("./inffast"),s=e("./inftrees"),c=-2;function u(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function l(){this.mode=0,this.last=!1,this.wrap=0,this.havedict=!1,this.flags=0,this.dmax=0,this.check=0,this.total=0,this.head=null,this.wbits=0,this.wsize=0,this.whave=0,this.wnext=0,this.window=null,this.hold=0,this.bits=0,this.length=0,this.offset=0,this.extra=0,this.lencode=null,this.distcode=null,this.lenbits=0,this.distbits=0,this.ncode=0,this.nlen=0,this.ndist=0,this.have=0,this.next=null,this.lens=new r.Buf16(320),this.work=new r.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function h(e){var t;return e&&e.state?(t=e.state,e.total_in=e.total_out=t.total=0,e.msg="",t.wrap&&(e.adler=1&t.wrap),t.mode=1,t.last=0,t.havedict=0,t.dmax=32768,t.head=null,t.hold=0,t.bits=0,t.lencode=t.lendyn=new r.Buf32(852),t.distcode=t.distdyn=new r.Buf32(592),t.sane=1,t.back=-1,0):c}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):c}function f(e,t){var n,r;return e&&e.state?(r=e.state,t<0?(n=0,t=-t):(n=1+(t>>4),t<48&&(t&=15)),t&&(t<8||15<t)?c:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,d(e))):c}function p(e,t){var n,r;return e?(r=new l,(e.state=r).window=null,0!==(n=f(e,t))&&(e.state=null),n):c}var v,g,m=!0;function y(e){if(m){var t;for(v=new r.Buf32(512),g=new r.Buf32(32),t=0;t<144;)e.lens[t++]=8;for(;t<256;)e.lens[t++]=9;for(;t<280;)e.lens[t++]=7;for(;t<288;)e.lens[t++]=8;for(s(1,e.lens,0,288,v,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;s(2,e.lens,0,32,g,0,e.work,{bits:5}),m=!1}e.lencode=v,e.lenbits=9,e.distcode=g,e.distbits=5}function b(e,t,n,i){var o,a=e.state;return null===a.window&&(a.wsize=1<<a.wbits,a.wnext=0,a.whave=0,a.window=new r.Buf8(a.wsize)),i>=a.wsize?(r.arraySet(a.window,t,n-a.wsize,a.wsize,0),a.wnext=0,a.whave=a.wsize):(i<(o=a.wsize-a.wnext)&&(o=i),r.arraySet(a.window,t,n-i,o,a.wnext),(i-=o)?(r.arraySet(a.window,t,n-i,i,0),a.wnext=i,a.whave=a.wsize):(a.wnext+=o,a.wnext===a.wsize&&(a.wnext=0),a.whave<a.wsize&&(a.whave+=o))),0}n.inflateReset=d,n.inflateReset2=f,n.inflateResetKeep=h,n.inflateInit=function(e){return p(e,15)},n.inflateInit2=p,n.inflate=function(e,t){var n,l,h,d,f,p,v,g,m,S,w,k,C,E,x,I,_,A,T,R,O,D,N,L,P=0,M=new r.Buf8(4),B=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15];if(!e||!e.state||!e.output||!e.input&&0!==e.avail_in)return c;12===(n=e.state).mode&&(n.mode=13),f=e.next_out,h=e.output,v=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,g=n.hold,m=n.bits,S=p,w=v,D=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(2&n.wrap&&35615===g){M[n.check=0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0),m=g=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&g)<<8)+(g>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&g)){e.msg="unknown compression method",n.mode=30;break}if(m-=4,O=8+(15&(g>>>=4)),0===n.wbits)n.wbits=O;else if(O>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<O,e.adler=n.check=1,n.mode=512&g?10:12,m=g=0;break;case 2:for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(n.flags=g,8!=(255&n.flags)){e.msg="unknown compression method",n.mode=30;break}if(57344&n.flags){e.msg="unknown header flags set",n.mode=30;break}n.head&&(n.head.text=g>>8&1),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0,n.mode=3;case 3:for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.head&&(n.head.time=g),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,M[2]=g>>>16&255,M[3]=g>>>24&255,n.check=o(n.check,M,4,0)),m=g=0,n.mode=4;case 4:for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.head&&(n.head.xflags=255&g,n.head.os=g>>8),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0,n.mode=5;case 5:if(1024&n.flags){for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.length=g,n.head&&(n.head.extra_len=g),512&n.flags&&(M[0]=255&g,M[1]=g>>>8&255,n.check=o(n.check,M,2,0)),m=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(k=n.length)&&(k=p),k&&(n.head&&(O=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),r.arraySet(n.head.extra,l,d,k,O)),512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,n.length-=k),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;for(k=0;O=l[d+k++],n.head&&O&&n.length<65536&&(n.head.name+=String.fromCharCode(O)),O&&k<p;);if(512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,O)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===p)break e;for(k=0;O=l[d+k++],n.head&&O&&n.length<65536&&(n.head.comment+=String.fromCharCode(O)),O&&k<p;);if(512&n.flags&&(n.check=o(n.check,l,k,d)),p-=k,d+=k,O)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;m<16;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}m=g=0}n.head&&(n.head.hcrc=n.flags>>9&1,n.head.done=!0),e.adler=n.check=0,n.mode=12;break;case 10:for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}e.adler=n.check=u(g),m=g=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){g>>>=7&m,m-=7&m,n.mode=27;break}for(;m<3;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}switch(n.last=1&g,m-=1,3&(g>>>=1)){case 0:n.mode=14;break;case 1:if(y(n),n.mode=20,6!==t)break;g>>>=2,m-=2;break e;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}g>>>=2,m-=2;break;case 14:for(g>>>=7&m,m-=7&m;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if((65535&g)!=(g>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&g,m=g=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(k=n.length){if(p<k&&(k=p),v<k&&(k=v),0===k)break e;r.arraySet(h,l,d,k,f),p-=k,d+=k,v-=k,f+=k,n.length-=k;break}n.mode=12;break;case 17:for(;m<14;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(n.nlen=257+(31&g),g>>>=5,m-=5,n.ndist=1+(31&g),g>>>=5,m-=5,n.ncode=4+(15&g),g>>>=4,m-=4,286<n.nlen||30<n.ndist){e.msg="too many length or distance symbols",n.mode=30;break}n.have=0,n.mode=18;case 18:for(;n.have<n.ncode;){for(;m<3;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.lens[B[n.have++]]=7&g,g>>>=3,m-=3}for(;n.have<19;)n.lens[B[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},D=s(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,D){e.msg="invalid code lengths set",n.mode=30;break}n.have=0,n.mode=19;case 19:for(;n.have<n.nlen+n.ndist;){for(;I=(P=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(_<16)g>>>=x,m-=x,n.lens[n.have++]=_;else{if(16===_){for(L=x+2;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g>>>=x,m-=x,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}O=n.lens[n.have-1],k=3+(3&g),g>>>=2,m-=2}else if(17===_){for(L=x+3;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=x,O=0,k=3+(7&(g>>>=x)),g>>>=3,m-=3}else{for(L=x+7;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=x,O=0,k=11+(127&(g>>>=x)),g>>>=7,m-=7}if(n.have+k>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;k--;)n.lens[n.have++]=O}}if(30===n.mode)break;if(0===n.lens[256]){e.msg="invalid code -- missing end-of-block",n.mode=30;break}if(n.lenbits=9,N={bits:n.lenbits},D=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,D){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},D=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,D){e.msg="invalid distances set",n.mode=30;break}if(n.mode=20,6===t)break e;case 20:n.mode=21;case 21:if(6<=p&&258<=v){e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,a(e,w),f=e.next_out,h=e.output,v=e.avail_out,d=e.next_in,l=e.input,p=e.avail_in,g=n.hold,m=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;I=(P=n.lencode[g&(1<<n.lenbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(I&&0==(240&I)){for(A=x,T=I,R=_;I=(P=n.lencode[R+((g&(1<<A+T)-1)>>A)])>>>16&255,_=65535&P,!(A+(x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=A,m-=A,n.back+=A}if(g>>>=x,m-=x,n.back+=x,n.length=_,0===I){n.mode=26;break}if(32&I){n.back=-1,n.mode=12;break}if(64&I){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&I,n.mode=22;case 22:if(n.extra){for(L=n.extra;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.length+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;I=(P=n.distcode[g&(1<<n.distbits)-1])>>>16&255,_=65535&P,!((x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(0==(240&I)){for(A=x,T=I,R=_;I=(P=n.distcode[R+((g&(1<<A+T)-1)>>A)])>>>16&255,_=65535&P,!(A+(x=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=A,m-=A,n.back+=A}if(g>>>=x,m-=x,n.back+=x,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=_,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(L=n.extra;m<L;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}n.offset+=g&(1<<n.extra)-1,g>>>=n.extra,m-=n.extra,n.back+=n.extra}if(n.offset>n.dmax){e.msg="invalid distance too far back",n.mode=30;break}n.mode=25;case 25:if(0===v)break e;if(k=w-v,n.offset>k){if((k=n.offset-k)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}C=k>n.wnext?(k-=n.wnext,n.wsize-k):n.wnext-k,k>n.length&&(k=n.length),E=n.window}else E=h,C=f-n.offset,k=n.length;for(v<k&&(k=v),v-=k,n.length-=k;h[f++]=E[C++],--k;);0===n.length&&(n.mode=21);break;case 26:if(0===v)break e;h[f++]=n.length,v--,n.mode=21;break;case 27:if(n.wrap){for(;m<32;){if(0===p)break e;p--,g|=l[d++]<<m,m+=8}if(w-=v,e.total_out+=w,n.total+=w,w&&(e.adler=n.check=n.flags?o(n.check,h,w,f-w):i(n.check,h,w,f-w)),w=v,(n.flags?g:u(g))!==n.check){e.msg="incorrect data check",n.mode=30;break}m=g=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;m<32;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}m=g=0}n.mode=29;case 29:D=1;break e;case 30:D=-3;break e;case 31:return-4;case 32:default:return c}return e.next_out=f,e.avail_out=v,e.next_in=d,e.avail_in=p,n.hold=g,n.bits=m,(n.wsize||w!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&b(e,e.output,e.next_out,w-e.avail_out)?(n.mode=31,-4):(S-=e.avail_in,w-=e.avail_out,e.total_in+=S,e.total_out+=w,n.total+=w,n.wrap&&w&&(e.adler=n.check=n.flags?o(n.check,h,w,e.next_out-w):i(n.check,h,w,e.next_out-w)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==S&&0===w||4===t)&&0===D&&(D=-5),D)},n.inflateEnd=function(e){if(!e||!e.state)return c;var t=e.state;return t.window&&(t.window=null),e.state=null,0},n.inflateGetHeader=function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?c:((n.head=t).done=!1,0):c},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?c:11===n.mode&&i(1,t,r,0)!==n.check?-3:b(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):c},n.inflateInfo="pako inflate (from Nodeca project)"},{"../utils/common":41,"./adler32":43,"./crc32":45,"./inffast":48,"./inftrees":50}],50:[function(e,t,n){var r=e("../utils/common"),i=[3,4,5,6,7,8,9,10,11,13,15,17,19,23,27,31,35,43,51,59,67,83,99,115,131,163,195,227,258,0,0],o=[16,16,16,16,16,16,16,16,17,17,17,17,18,18,18,18,19,19,19,19,20,20,20,20,21,21,21,21,16,72,78],a=[1,2,3,4,5,7,9,13,17,25,33,49,65,97,129,193,257,385,513,769,1025,1537,2049,3073,4097,6145,8193,12289,16385,24577,0,0],s=[16,16,16,16,17,17,18,18,19,19,20,20,21,21,22,22,23,23,24,24,25,25,26,26,27,27,28,28,29,29,64,64];t.exports=function(e,t,n,c,u,l,h,d){var f,p,v,g,m,y,b,S,w,k=d.bits,C=0,E=0,x=0,I=0,_=0,A=0,T=0,R=0,O=0,D=0,N=null,L=0,P=new r.Buf16(16),M=new r.Buf16(16),B=null,G=0;for(C=0;C<=15;C++)P[C]=0;for(E=0;E<c;E++)P[t[n+E]]++;for(_=k,I=15;1<=I&&0===P[I];I--);if(I<_&&(_=I),0===I)return u[l++]=20971520,u[l++]=20971520,d.bits=1,0;for(x=1;x<I&&0===P[x];x++);for(_<x&&(_=x),C=R=1;C<=15;C++)if(R<<=1,(R-=P[C])<0)return-1;if(0<R&&(0===e||1!==I))return-1;for(M[1]=0,C=1;C<15;C++)M[C+1]=M[C]+P[C];for(E=0;E<c;E++)0!==t[n+E]&&(h[M[t[n+E]]++]=E);if(y=0===e?(N=B=h,19):1===e?(N=i,L-=257,B=o,G-=257,256):(N=a,B=s,-1),C=x,m=l,T=E=D=0,v=-1,g=(O=1<<(A=_))-1,1===e&&852<O||2===e&&592<O)return 1;for(;;){for(b=C-T,w=h[E]<y?(S=0,h[E]):h[E]>y?(S=B[G+h[E]],N[L+h[E]]):(S=96,0),f=1<<C-T,x=p=1<<A;u[m+(D>>T)+(p-=f)]=b<<24|S<<16|w|0,0!==p;);for(f=1<<C-1;D&f;)f>>=1;if(0!==f?(D&=f-1,D+=f):D=0,E++,0==--P[C]){if(C===I)break;C=t[n+h[E]]}if(_<C&&(D&g)!==v){for(0===T&&(T=_),m+=x,R=1<<(A=C-T);A+T<I&&!((R-=P[A+T])<=0);)A++,R<<=1;if(O+=1<<A,1===e&&852<O||2===e&&592<O)return 1;u[v=D&g]=_<<24|A<<16|m-l|0}}return 0!==D&&(u[m+D]=C-T<<24|64<<16|0),d.bits=_,0}},{"../utils/common":41}],51:[function(e,t,n){t.exports={2:"need dictionary",1:"stream end",0:"","-1":"file error","-2":"stream error","-3":"data error","-4":"insufficient memory","-5":"buffer error","-6":"incompatible version"}},{}],52:[function(e,t,n){var r=e("../utils/common");function i(e){for(var t=e.length;0<=--t;)e[t]=0}var o=256,a=286,s=30,c=15,u=[0,0,0,0,0,0,0,0,1,1,1,1,2,2,2,2,3,3,3,3,4,4,4,4,5,5,5,5,0],l=[0,0,0,0,1,1,2,2,3,3,4,4,5,5,6,6,7,7,8,8,9,9,10,10,11,11,12,12,13,13],h=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],d=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],f=new Array(576);i(f);var p=new Array(60);i(p);var v=new Array(512);i(v);var g=new Array(256);i(g);var m=new Array(29);i(m);var y,b,S,w=new Array(s);function k(e,t,n,r,i){this.static_tree=e,this.extra_bits=t,this.extra_base=n,this.elems=r,this.max_length=i,this.has_stree=e&&e.length}function C(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function E(e){return e<256?v[e]:v[256+(e>>>7)]}function x(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function I(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,x(e,e.bi_buf),e.bi_buf=t>>16-e.bi_valid,e.bi_valid+=n-16):(e.bi_buf|=t<<e.bi_valid&65535,e.bi_valid+=n)}function _(e,t,n){I(e,n[2*t],n[2*t+1])}function A(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function T(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=c;r++)o[r]=a=a+n[r-1]<<1;for(i=0;i<=t;i++){var s=e[2*i+1];0!==s&&(e[2*i]=A(o[s]++,s))}}function R(e){var t;for(t=0;t<a;t++)e.dyn_ltree[2*t]=0;for(t=0;t<s;t++)e.dyn_dtree[2*t]=0;for(t=0;t<19;t++)e.bl_tree[2*t]=0;e.dyn_ltree[512]=1,e.opt_len=e.static_len=0,e.last_lit=e.matches=0}function O(e){8<e.bi_valid?x(e,e.bi_buf):0<e.bi_valid&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function D(e,t,n,r){var i=2*t,o=2*n;return e[i]<e[o]||e[i]===e[o]&&r[t]<=r[n]}function N(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&D(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!D(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function L(e,t,n){var r,i,a,s,c=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*c]<<8|e.pending_buf[e.d_buf+2*c+1],i=e.pending_buf[e.l_buf+c],c++,0===r?_(e,i,t):(_(e,(a=g[i])+o+1,t),0!==(s=u[a])&&I(e,i-=m[a],s),_(e,a=E(--r),n),0!==(s=l[a])&&I(e,r-=w[a],s)),c<e.last_lit;);_(e,256,t)}function P(e,t){var n,r,i,o=t.dyn_tree,a=t.stat_desc.static_tree,s=t.stat_desc.has_stree,u=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(e.heap[++e.heap_len]=l=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=l<2?++l:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=l,n=e.heap_len>>1;1<=n;n--)N(e,o,n);for(i=u;n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],N(e,o,1),r=e.heap[1],e.heap[--e.heap_max]=n,e.heap[--e.heap_max]=r,o[2*i]=o[2*n]+o[2*r],e.depth[i]=(e.depth[n]>=e.depth[r]?e.depth[n]:e.depth[r])+1,o[2*n+1]=o[2*r+1]=i,e.heap[1]=i++,N(e,o,1),2<=e.heap_len;);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,u=t.dyn_tree,l=t.max_code,h=t.stat_desc.static_tree,d=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,p=t.stat_desc.extra_base,v=t.stat_desc.max_length,g=0;for(o=0;o<=c;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)v<(o=u[2*u[2*(r=e.heap[n])+1]+1]+1)&&(o=v,g++),u[2*r+1]=o,l<r||(e.bl_count[o]++,a=0,p<=r&&(a=f[r-p]),s=u[2*r],e.opt_len+=s*(o+a),d&&(e.static_len+=s*(h[2*r+1]+a)));if(0!==g){do{for(o=v-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[v]--,g-=2}while(0<g);for(o=v;0!==o;o--)for(r=e.bl_count[o];0!==r;)l<(i=e.heap[--n])||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(e,t),T(o,l,e.bl_count)}function M(e,t,n){var r,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<c&&i===a||(s<u?e.bl_tree[2*i]+=s:0!==i?(i!==o&&e.bl_tree[2*i]++,e.bl_tree[32]++):s<=10?e.bl_tree[34]++:e.bl_tree[36]++,o=i,u=(s=0)===a?(c=138,3):i===a?(c=6,3):(c=7,4))}function B(e,t,n){var r,i,o=-1,a=t[1],s=0,c=7,u=4;for(0===a&&(c=138,u=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<c&&i===a)){if(s<u)for(;_(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(_(e,i,e.bl_tree),s--),_(e,16,e.bl_tree),I(e,s-3,2)):s<=10?(_(e,17,e.bl_tree),I(e,s-3,3)):(_(e,18,e.bl_tree),I(e,s-11,7));o=i,u=(s=0)===a?(c=138,3):i===a?(c=6,3):(c=7,4)}}i(w);var G=!1;function j(e,t,n,i){I(e,0+(i?1:0),3),function(e,t,n,i){O(e),x(e,n),x(e,~n),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n)}n._tr_init=function(e){G||(function(){var e,t,n,r,i,o=new Array(16);for(r=n=0;r<28;r++)for(m[r]=n,e=0;e<1<<u[r];e++)g[n++]=r;for(g[n-1]=r,r=i=0;r<16;r++)for(w[r]=i,e=0;e<1<<l[r];e++)v[i++]=r;for(i>>=7;r<s;r++)for(w[r]=i<<7,e=0;e<1<<l[r]-7;e++)v[256+i++]=r;for(t=0;t<=c;t++)o[t]=0;for(e=0;e<=143;)f[2*e+1]=8,e++,o[8]++;for(;e<=255;)f[2*e+1]=9,e++,o[9]++;for(;e<=279;)f[2*e+1]=7,e++,o[7]++;for(;e<=287;)f[2*e+1]=8,e++,o[8]++;for(T(f,287,o),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=A(e,5);y=new k(f,u,257,a,c),b=new k(p,l,0,s,c),S=new k(new Array(0),h,0,19,7)}(),G=!0),e.l_desc=new C(e.dyn_ltree,y),e.d_desc=new C(e.dyn_dtree,b),e.bl_desc=new C(e.bl_tree,S),e.bi_buf=0,e.bi_valid=0,R(e)},n._tr_stored_block=j,n._tr_flush_block=function(e,t,n,r){var i,a,s=0;0<e.level?(2===e.strm.data_type&&(e.strm.data_type=function(e){var t,n=4093624447;for(t=0;t<=31;t++,n>>>=1)if(1&n&&0!==e.dyn_ltree[2*t])return 0;if(0!==e.dyn_ltree[18]||0!==e.dyn_ltree[20]||0!==e.dyn_ltree[26])return 1;for(t=32;t<o;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),P(e,e.l_desc),P(e,e.d_desc),s=function(e){var t;for(M(e,e.dyn_ltree,e.l_desc.max_code),M(e,e.dyn_dtree,e.d_desc.max_code),P(e,e.bl_desc),t=18;3<=t&&0===e.bl_tree[2*d[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(a=e.static_len+3+7>>>3)<=i&&(i=a)):i=a=n+5,n+4<=i&&-1!==t?j(e,t,n,r):4===e.strategy||a===i?(I(e,2+(r?1:0),3),L(e,f,p)):(I(e,4+(r?1:0),3),function(e,t,n,r){var i;for(I(e,t-257,5),I(e,n-1,5),I(e,r-4,4),i=0;i<r;i++)I(e,e.bl_tree[2*d[i]+1],3);B(e,e.dyn_ltree,t-1),B(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),L(e,e.dyn_ltree,e.dyn_dtree)),R(e),r&&O(e)},n._tr_tally=function(e,t,n){return e.pending_buf[e.d_buf+2*e.last_lit]=t>>>8&255,e.pending_buf[e.d_buf+2*e.last_lit+1]=255&t,e.pending_buf[e.l_buf+e.last_lit]=255&n,e.last_lit++,0===t?e.dyn_ltree[2*n]++:(e.matches++,t--,e.dyn_ltree[2*(g[n]+o+1)]++,e.dyn_dtree[2*E(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){I(e,2,3),_(e,256,f),function(e){16===e.bi_valid?(x(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):8<=e.bi_valid&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}},{"../utils/common":41}],53:[function(e,t,n){t.exports=function(){this.input=null,this.next_in=0,this.avail_in=0,this.total_in=0,this.output=null,this.next_out=0,this.avail_out=0,this.total_out=0,this.msg="",this.state=null,this.data_type=2,this.adler=0}},{}],54:[function(e,t,n){(function(e){!function(e,t){if(!e.setImmediate){var n,r,i,o,a=1,s={},c=!1,u=e.document,l=Object.getPrototypeOf&&Object.getPrototypeOf(e);l=l&&l.setTimeout?l:e,n="[object process]"==={}.toString.call(e.process)?function(e){process.nextTick((function(){d(e)}))}:function(){if(e.postMessage&&!e.importScripts){var t=!0,n=e.onmessage;return e.onmessage=function(){t=!1},e.postMessage("","*"),e.onmessage=n,t}}()?(o="setImmediate$"+Math.random()+"$",e.addEventListener?e.addEventListener("message",f,!1):e.attachEvent("onmessage",f),function(t){e.postMessage(o+t,"*")}):e.MessageChannel?((i=new MessageChannel).port1.onmessage=function(e){d(e.data)},function(e){i.port2.postMessage(e)}):u&&"onreadystatechange"in u.createElement("script")?(r=u.documentElement,function(e){var t=u.createElement("script");t.onreadystatechange=function(){d(e),t.onreadystatechange=null,r.removeChild(t),t=null},r.appendChild(t)}):function(e){setTimeout(d,0,e)},l.setImmediate=function(e){"function"!=typeof e&&(e=new Function(""+e));for(var t=new Array(arguments.length-1),r=0;r<t.length;r++)t[r]=arguments[r+1];var i={callback:e,args:t};return s[a]=i,n(a),a++},l.clearImmediate=h}function h(e){delete s[e]}function d(e){if(c)setTimeout(d,0,e);else{var t=s[e];if(t){c=!0;try{!function(e){var t=e.callback,n=e.args;switch(n.length){case 0:t();break;case 1:t(n[0]);break;case 2:t(n[0],n[1]);break;case 3:t(n[0],n[1],n[2]);break;default:t.apply(void 0,n)}}(t)}finally{h(e),c=!1}}}}function f(t){t.source===e&&"string"==typeof t.data&&0===t.data.indexOf(o)&&d(+t.data.slice(o.length))}}("undefined"==typeof self?void 0===e?this:e:self)}).call(this,void 0!==g?g:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}]},{},[10])(10)}));qt({target:"Array",stat:!0},{isArray:tn});var Gl={0:"XYSDK:950102",2001:"XYSDK:950104",4104:"XYSDK:950104",4103:"XYSDK:950143",2040:"XYSDK:950141",2009:"XYSDK:950142",10004010:"XYSDK:950144",10002e3:"XYSDK:950144"},jl={en_US:{"XYSDK:950010":"Custom message length limit, please check","XYSDK:950120":"success","XYSDK:950112":"WebSocket connecting time out","XYSDK:950113":"WebSocket connecting is stopped,reconnecting now...","XYSDK:950114":"WebSocket connecting is stopped","XYSDK:950115":"WebSocket connecting error","XYSDK:950116":"The browser don't support Websocket, please use Chrome","XYSDK:950201":"The client has finished calling and it is forbidden to join the meeting","XYSDK:950202":"Peer need to be created before operation","XYSDK:950203":"Stream need to be created before operation","XYSDK:950223":"Failed to start or stop Audio&Video","XYSDK:950224":"No Mic permission","XYSDK:950225":"No camera permission","XYSDK:950230":"Hang up the meeting","XYSDK:950102":"Login failed","XYSDK:950101":"Wrong parameter","XYSDK:950103":"Failed to get user information","XYSDK:950104":"Incorrect account or password","XYSDK:950141":"The password has expired. Please change the password and log in again","XYSDK:950142":'The mobile number conflicts. Please use the mode of "+country code-mobile number"',"XYSDK:950143":"Your password inputting exceeds 5 times within 30 minutes, the account will be locked for 30 minutes","XYSDK:950144":"Login has expired, please log in again","XYSDK:950601":"Custom layout mode does not support switching layouts","XYSDK:950602":"Custom layout mode does not support requesting stream when full screen","XYSDK:950603":"Custom layout mode does not support paging","XYSDK:950105":"Invalid meeting ID","XYSDK:950106":"Failed to call the number , please try again later","XYSDK:950107":"Require meeting password","XYSDK:950108":"Wrong meeting password","XYSDK:950109":"The meeting ID is not supported","XYSDK:950110":"Failed to join meeting","XYSDK:950130":"The protocol must be HTTPS, or the host name must be Localhost","XYSDK:950111":"Interface request failed","XYSDK:950204":"Failed to create a Client","XYSDK:950517":"Call failed","XYSDK:950518":"Successful call","XYSDK:950519":"Calling, please wait","XYSDK:950530":"Failed to request a full screen stream","XYSDK:950401":"No camera or Mic device","XYSDK:950402":"Can't access camera or Mic device","XYSDK:950403":"Constraint setting cannot be satisfied","XYSDK:950404":"Mic or camera access denied","XYSDK:950405":"The collection flow constraint is null","XYSDK:950406":"Failed to create media stream","XYSDK:950407":"Failed to switch speakers","XYSDK:950501":"The user cancels the screen share","XYSDK:950502":"Operation abnormal,and can't get the screen","XYSDK:950503":"Failed to get the screen","XYSDK:950504":"No video source is available for capture","XYSDK:950505":"Hardware or operating system error or lock, and it prevent sharing screen","XYSDK:950506":"Capture screen-Constraint setting failed","XYSDK:950507":"Capture screen-An impermissible constraint setting is specified","XYSDK:950508":"The user has refused to authorize the capture screen operation","XYSDK:950509":"Already sharing screen","XYSDK:950510":"Not selected SourceId","XYSDK:950511":"Operation abnormal,and can't get the screen","XYSDK:950512":"Failed to share content","XYSDK:950513":"Failed to end sharing","XYSDK:950515":"Failed to get the codec format supported by the sender","XYSDK:950408":"Failed to obtain device permissions","XYSDK:950409":"Failed to get device list","XYSDK:950410":"Failed to switch media input device","XYSDK:950514":"No local media streaming","XYSDK:950210":"Failed to switch debug mode","XYSDK:950312":"Failed to start the tour","XYSDK:950205":"Stream is not created","XYSDK:950206":"Stream is created successfully","XYSDK:950207":"DomStream is created successfully","XYSDK:950208":"Failed to create Stream","XYSDK:950209":"Client is not created","XYSDK:950301":"The meeting did not start","XYSDK:953901":"Recording parameter error","XYSDK:953902":"No recording permission","XYSDK:953903":"The cloud conference room does not belong to any enterprise and cannot be recorded","XYSDK:953904":"Insufficient recording space","XYSDK:953905":"Recording did not start"},zh_CN:{"XYSDK:950010":"自定义消息长度超过限制,请检查","XYSDK:950120":"成功","XYSDK:950112":"WebSocket连接超时","XYSDK:950113":"WebSocket连接已关闭,正在重连...","XYSDK:950114":"WebSocket连接已关闭","XYSDK:950115":"WebSocket连接错误","XYSDK:950116":"当前浏览器不支持Websocket,请使用Chrome浏览器","XYSDK:950201":"Client已关闭,禁止加入会议","XYSDK:950202":"需要创建Peer才可操作","XYSDK:950203":"需要创建Stream才可操作","XYSDK:950223":"音视频开启关闭操作失败","XYSDK:950224":"没有麦克风权限","XYSDK:950225":"没有摄像头权限","XYSDK:950230":"挂断会议","XYSDK:950102":"登录失败","XYSDK:950101":"参数有误,请检查","XYSDK:950103":"获取用户信息失败","XYSDK:950104":"账号或密码错误","XYSDK:950141":"该账号密码已过期,请修改密码后重新登录","XYSDK:950142":'登录手机号冲突,请使用"+国家码-手机号"的模式输入',"XYSDK:950143":"您登录失败过于频繁,请30分钟后重试","XYSDK:950144":"登录已失效,请重新登录","XYSDK:950601":"自定义布局模式不支持切换布局","XYSDK:950602":"自定义布局模式不支持全屏请流","XYSDK:950603":"自定义布局模式不支持分页","XYSDK:950105":"无效的会议号","XYSDK:950106":"呼叫失败,请稍后重试","XYSDK:950107":"需要入会密码","XYSDK:950108":"入会密码错误","XYSDK:950109":"暂不支持呼叫此号码","XYSDK:950110":"免密入会失败","XYSDK:950130":"协议必须是 https,或者主机名必须是 localhost","XYSDK:950111":"接口请求失败","XYSDK:950204":"Client创建失败","XYSDK:950517":"呼叫失败","XYSDK:950518":"呼叫成功","XYSDK:950519":"正在呼叫中,请等候","XYSDK:950530":"全屏请流失败","XYSDK:950401":"缺失摄像头或麦克风设备","XYSDK:950402":"摄像头或麦克风设备无法访问","XYSDK:950403":"约束设置无法被满足","XYSDK:950404":"麦克风或摄像头使用权限被拒绝","XYSDK:950405":"采集流约束设置为空","XYSDK:950406":"创建媒体流失败","XYSDK:950407":"切换扬声器失败","XYSDK:950501":"用户取消采集屏幕操作","XYSDK:950502":"操作异常采集屏幕失败","XYSDK:950503":"采集屏幕失败","XYSDK:950504":"没有屏幕视频源可用于捕获","XYSDK:950505":"硬件或操作系统错误或锁定,阻止了采集屏幕共享","XYSDK:950506":"采集屏幕-约束设置失败","XYSDK:950507":"采集屏幕-指定了不允许的约束设置\t","XYSDK:950508":"用户已拒绝授权采集屏幕操作","XYSDK:950509":"已经在分享屏幕","XYSDK:950510":"没有 selectedSourceId\t","XYSDK:950511":"操作异常采集屏幕失败","XYSDK:950512":"分享content失败","XYSDK:950513":"结束分享失败\t","XYSDK:950515":"获取发送端支持的编解码格式 失败\t","XYSDK:950408":"获取设备权限失败","XYSDK:950409":"获取设备列表失败","XYSDK:950410":"切换媒体输入设备失败","XYSDK:950514":"本地无媒体流","XYSDK:950312":"开启巡课失败","XYSDK:950205":"Stream对象未创建","XYSDK:950206":"Stream创建成功","XYSDK:950207":"domStream创建成功","XYSDK:950208":"Stream创建失败","XYSDK:950209":"Client对象未创建","XYSDK:950210":"切换调试模式失败","XYSDK:950301":"会议未开始","XYSDK:953901":"录制参数错误","XYSDK:953902":"没有录制权限","XYSDK:953903":"云会议室不属于任何企业,无法录制","XYSDK:953904":"录制空间不足","XYSDK:953905":"录制未开始"},zh_TW:{"XYSDK:950010":"自定義消息長度超過限製,請檢查","XYSDK:950120":"成功","XYSDK:950112":"WebSocket連接超時","XYSDK:950113":"WebSocket連接已關閉,正在重連...","XYSDK:950114":"WebSocket連接已關閉","XYSDK:950115":"WebSocket連接錯誤","XYSDK:950116":"當前瀏覽器不支持Websocket,請使用Chrome瀏覽器","XYSDK:950201":"Client已關閉,禁止加入會議","XYSDK:950202":"需要創建Peer才可操作","XYSDK:950203":"需要創建Stream才可操作","XYSDK:950223":"音視頻開啟關閉操作失敗","XYSDK:950224":"沒有麥克風權限","XYSDK:950225":"沒有攝像頭權限","XYSDK:950230":"掛斷會議","XYSDK:950102":"登錄失敗","XYSDK:950101":"參數有誤,請檢查","XYSDK:950103":"獲取用戶信息失敗","XYSDK:950104":"賬號或密碼錯誤","XYSDK:950141":"該賬號密碼已過期,請修改密碼後重新登錄","XYSDK:950142":'登錄手機號衝突,請使用"+國家碼-手機號"的模式輸入',"XYSDK:950143":"您登錄失敗過於頻繁,請30分鐘後重試","XYSDK:950144":"登錄已失效,請重新登錄","XYSDK:950601":"自定義佈局模式不支持切換佈局","XYSDK:950602":"自定義佈局模式不支持全屏請流","XYSDK:950603":"自定義佈局模式不支持分頁","XYSDK:950105":"無效的會議號","XYSDK:950106":"呼叫失敗,請稍後重試","XYSDK:950107":"需要入會密碼","XYSDK:950108":"入會密碼錯誤","XYSDK:950109":"暫不支持呼叫此號碼","XYSDK:950110":"免密入會失敗","XYSDK:950130":"協議必須是 https,或者主機名必須是 localhost","XYSDK:950111":"接口請求失敗","XYSDK:950204":"Client創建失敗","XYSDK:950517":"呼叫失敗","XYSDK:950518":"呼叫成功","XYSDK:950519":"正在呼叫中,請等候","XYSDK:950530":"全屏請流失敗","XYSDK:950401":"缺失攝像頭或麥克風設備","XYSDK:950402":"攝像頭或麥克風設備無法訪問","XYSDK:950403":"約束設置無法被滿足","XYSDK:950404":"麥克風或攝像頭使用權限被拒絕","XYSDK:950405":"採集流約束設置為空","XYSDK:950406":"創建媒體流失敗","XYSDK:950407":"切換揚聲器失敗","XYSDK:950501":"用戶取消採集屏幕操作","XYSDK:950502":"操作異常採集屏幕失敗","XYSDK:950503":"採集屏幕失敗","XYSDK:950504":"沒有屏幕視頻源可用於捕獲","XYSDK:950505":"硬件或操作系統錯誤或鎖定,阻止了採集屏幕共享","XYSDK:950506":"採集屏幕-約束設置失敗","XYSDK:950507":"採集屏幕-指定了不允許的約束設置\t","XYSDK:950508":"用戶已拒絕授權採集屏幕操作","XYSDK:950509":"已經在分享屏幕","XYSDK:950510":"沒有 selectedSourceId\t","XYSDK:950511":"操作異常採集屏幕失敗","XYSDK:950512":"分享content失敗","XYSDK:950513":"結束分享失敗\t","XYSDK:950515":"獲取發送端支持的編解碼格式 失敗\t","XYSDK:950408":"獲取設備權限失敗","XYSDK:950409":"獲取設備列表失敗","XYSDK:950410":"切換媒體輸入設備失敗","XYSDK:950514":"本地無媒體流","XYSDK:950210":"切換調試模式失敗","XYSDK:950312":"開啟巡課失敗","XYSDK:950205":"Stream對象未創建","XYSDK:950206":"Stream創建成功","XYSDK:950207":"domStream創建成功","XYSDK:950208":"Stream創建失敗","XYSDK:950209":"Client對象未創建","XYSDK:950301":"會議未開始","XYSDK:953901":"錄製參數錯誤","XYSDK:953902":"沒有錄製權限","XYSDK:953903":"雲會議室不屬於任何企業,無法錄製","XYSDK:953904":"錄製空間不足","XYSDK:953905":"錄製未開始"}},Hl={version:"3.6.00",zh_CN:{"CHARGE:646":"云会议室已达企业允许呼入的上限","CHARGE:647":"终端已达允许呼入的上限","CHARGE:644":"没有呼叫权限","CHARGE:645":"云会议室已达允许呼入的上限","CHARGE:648":"终端已达企业允许呼入的上限","CHARGE:649":"预约会议未到开始时间,无法加入","PS:400":"不支持跨云呼叫","SIG:421":"对方终端不允许外人拨打,请与对方确认后再拨","SIG:422":"您已被主持人移出会议","SIG:420":"号码不正确","SIG:789":"录制已停止","SIG:423":"UNKNOWN","SIG:424":"主持人已结束会议","CHARGE:642":"呼叫失败,企业IPPBX方数已达上限","CHARGE:643":"调度失败,企业监控调度方数已达上限\t","CHARGE:640":"所属部门的云会议室存储空间已满,不能再发起录制","CHARGE:641":"所属企业的云会议室存储空间已满,不能再发起录制","CHARGE:635":"账户余额不足,不能发起PSTN通话,请联系管理员充值后再尝试。","CHARGE:636":"云会议室已达允许呼入的上限","CHARGE:633":"无法呼叫当前号码,您的终端仅允许呼叫通讯录上的用户号码","CHARGE:634":"账户余额支付范围不可用于PSTN通话,请联系管理员开启后再尝试。","CHARGE:639":"云会议室存储空间已满,不能再发起录制","CHARGE:637":"云会议室已达部门允许呼入的上限","CHARGE:638":"云会议室已达企业允许呼入的上限","SIG:419":"对方已开启办公模式。您可滑动下方按钮,发起呼叫","SIG:416":"当前在线呼叫数已达服务上限,请稍候再试","SIG:417":"密码输入超时","SIG:410":"呼叫失败,请再试一次","SIG:4445":"云会议室存储空间已满,不能再发起录制","SIG:411":"终端APP版本过低,请升级后再试","SIG:4446":"所属部门的云会议室存储空间已满,不能再发起录制","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":"密码错误次数达到3次,请稍后重试","SIG:4449":"无效的分享content类型","SIG:415":"同步呼叫信息失败,请稍后再试","SIG:412":"对方版本过低,通话无法接通","SIG:4447":"所属企业的云会议室存储空间已满,不能再发起录制","SIG:413":"对方设置了免打扰","SIG:4448":"未知错误","SIG:4441":"录制超时,请稍后再试","CHARGE:631":"此云会议室为按参会时长计费的会议室。您的账户余额已用尽,不能在此云会议室发起会议,请联系管理员充值或选择其他云会议室。","SIG:4442":"UNKNOWN","CHARGE:632":"主动呼叫权限已被管理员关闭,无法发起呼叫","SIG:4440":"分享content超时,请稍后再试","CHARGE:630":"当前云会议室不允许邀请通讯录外成员","CHARGE:624":"呼叫失败。您呼叫的终端端口使用服务已过期","CHARGE:625":"此会议有终端端口服务已过期,无法支持多方呼叫","CHARGE:622":"没有监看权限","REC:511":"录制服务暂时不可用,请稍后再试","CHARGE:623":"呼叫失败。终端端口使用服务已过期,不能加入云会议室或多方通话。","REC:512":"录制服务暂时不可用,请稍后再试","CHARGE:628":"您呼叫的云会议室不允许匿名用户呼入,请登录或注册后重新呼叫","CHARGE:629":"对方正在会议中,且该会议不允许通讯录外成员呼入,请稍后再试","CHARGE:626":"此会议有终端端口服务已过期,无法邀请更多人加入","CHARGE:627":"呼叫的云会议室不允许通讯录外成员呼入,请联系云会议室管理员","SIG:1503":"分配监控资源失败","SIG:4456":"连接已断开,请重新入会","SIG:4457":"号码输入有误,请核对后重新拨打!","SIG:441":"当前在线呼叫数已达网关服务上限,请稍候重试","SIG:4454":"通话不存在,请核对后重试","SIG:4455":"服务器未连接,请稍后重试","SIG:445":"UNKNOWN","SIG:1501":"shuttle获取MA失败","SIG:4458":"网络异常,呼叫已断开","SIG:1502":"shuttle获取媒体资源失败","SIG:4459":"号码输入有误,请核对后重新拨打!","SIG:4452":"录制失败","CHARGE:620":"无单位归属,不能呼叫H.323设备\t","SIG:440":"云会议室密码不正确,请重试","SIG:4453":"通话已存在,请稍后再试","CHARGE:621":"呼叫失败,单位H.323方数不足","SIG:4450":"不支持分享content","SIG:4451":"带宽不足,分享内容失败","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","REC:400":"信令服务与录制服务内部错误。","CHARGE:611":"UNKNOWN","REC:401":"录制服务暂时不可用,请稍后再试","CHARGE:612":"UNKNOWN","REC:402":"录制服务暂时不可用,请稍后再试","CHARGE:617":"UNKNOWN","REC:403":"录制服务暂时不可用,请稍后再试","CHARGE:618":"UNKNOWN","REC:404":"录制不存在","CHARGE:615":"UNKNOWN","REC:405":"录制服务暂时不可用,请稍后再试","CHARGE:616":"会议已被锁定,无法加入,请联系会议发起人解锁后进入。","CHARGE:619":"呼叫失败。终端的云服务端口已过期,请联系管理员续费购买。","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content发送时会议尚未开始","SIG:431":"Content Server创建资源失败INVALID_PASSWORD","SIG:4466":"输入密码超时","REC:406":"录制服务暂时不可用,请稍后再试","SIG:4460":"号码输入有误,请核对后重新拨打!","CHARGE:610":"呼叫失败,您的企业已禁止PSTN通话功能,请联系您的管理员!","SIG:4461":"号码输入有误,请核对后重新拨打!","SIG:1404":"UNKNOWN","SIG:469":"录制正在进行,请勿重复发起录制","CHARGE:441":"当前在线呼叫数已达网关服务上限,请稍候重试","SIG:461":"录制时,本地空间即将耗尽","SIG:462":"录制时,本地空间已耗尽","SIG:580":"pstn呼叫时,第三方服务器报错","REC:465":"本地已开启录制,不能重复发起录制","REC:466":"录制服务暂时不可用,请稍后再试","REC:467":"已达最大录制方数,不能发起录制","REC:468":"录制的存储空间已满,您无法开始录制。\n请删除已有的录制视频,\n或联系管理员购买更多存储空间","REC:469":"UNKNOWN","REC:460":"没有录制权限","REC:463":"录制的存储空间已满,您无法开始录制。\n请删除已有的录制视频,\n或联系管理员购买更多存储空间","SIG:456":"呼叫失败,请再试一次","CHARGE:671":"会议未开始,请等待主持人开始会议后加入","CHARGE:672":"已被移出本次会议,无法入会","CHARGE:670":"您有一场会议正在进行,请先结束该会议","SIG:450":"您的终端目前无法支持此类呼叫","CHARGE:675":"没有可用的视频监控资源","CHARGE:676":"视频监控服务并发超过限制","CHARGE:673":"监控服务已经过期","CCC:501":"数据库操作失败","CHARGE:674":"视频监控服务没有企业归属","CCC:500":"内部服务器错误","CHARGE:668":"会议未通过审批或未到预约开始时间","CCC:602":"输入超时","CHARGE:669":"管理员禁用点对点呼叫","CCC:601":"呼叫超时","CHARGE:666":"超过会议审批允许的最大成员数量,入会失败","CCC:604":"入会超时","CHARGE:667":"超过会议审批允许的最大成员数量,邀请失败","CCC:603":"评价结束","SIG:487":"呼叫已取消","SIG:488":"终端试用期已过,无法继续为您服务了","SIG:485":"已达最大呼叫时长,呼叫已断开","SIG:486":"对方忙,请稍后再试","CHARGE:660":"对方企业账户余额不足,不能发起SDK呼叫","SIG:480":"呼叫失败,请再试一次","CHARGE:661":"对方企业账户尚未开通小程序SDK呼叫服务","SIG:483":"拨打不支持国家的pstn号码","CHARGE:664":"PSTN呼叫已达部门允许呼入的上限","SIG:484":"电话时长已用尽,无法转呼手机号,请联系IT管理员及时充值","CHARGE:665":"服务已过期,请管理员更新服务许可证","CHARGE:420":"号码不正确","CHARGE:662":"对方企业账户余额不足,不能发起小程序SDK呼叫","SIG:482":"邀请失败,请重试","CHARGE:415":"服务已过期,请管理员更新服务许可证","CHARGE:657":"企业账户余额不足,不能发起小程序SDK呼叫","CHARGE:416":"当前在线呼叫数已达服务上限,请稍候再试","CHARGE:658":"web客户端达到企业的呼叫方数限制","CHARGE:655":"企业账户余额不足,不能发起SDK呼叫","CHARGE:414":"H.323接入服务已过期","CHARGE:656":"企业账户尚未开通小程序SDK呼叫服务","CHARGE:659":"对方企业账户尚未开通SDK呼叫服务","STATE:200":"成功","SIG:598":"呼叫失败,请再试一次","SIG:599":"信令消息格式无效","SIG:479":"共享内容路数已达上限,无法发起更多的共享。请等待其他参会者停止共享后再重试","CHARGE:650":"h.323方数已达云会议室允许呼入的上限","CHARGE:653":"会议不支持更多小程序入会,请使用App入会或联系会议管理员","CHARGE:654":"企业账户尚未开通SDK呼叫服务","CHARGE:651":"h.323方数已达部门允许呼入的上限","CCC:600":"用户已被其他座席服务","CHARGE:652":"预约会议已经过期,无法主动加入","SIG:704":"呼叫失败,请再试一次","SIG:703":"呼叫失败,请再试一次","SIG:708":"没有白板分享权限","SIG:709":"不能合并会议","SIG:706":"没有内容标注权限","SIG:707":"没有双流分享权限","CHARGE:481":"对方不允许陌生人呼叫","CCC:415":"坐席名称已存在","CCC:414":"坐席不存在","CCC:417":"IVR配置已存在","CCC:416":"无效的坐席ID","CCC:419":"无效的IVR配置ID","CCC:418":"IVR配置不存在","SIG:498":"当前网络UDP被禁用,无法通话,请联系网络管理员或切换其他网络","SIG:499":"网络异常,呼叫已断开","SIG:496":"媒体超时","SIG:497":"信令超时","SIG:490":"无应答","CHARGE:473":"当前通话人数已满。如需更多人通话,请使用云会议室。","SIG:491":"","CHARGE:474":"当前会议人数已满。请加入通讯录,\n购买更多会议端口,详情请咨询本地经销商。","CHARGE:471":"当前通话人数已满。请使用终端或云会议室召开多方视频会议。","CCC:420":"特服号无效,请重新输入","CHARGE:472":"呼叫无法接通,终端在家最多支持4方通话。","CHARGE:477":"您呼叫的会议已达到最大支持人数,请联系管理员购买或使用超大型会议室。","CHARGE:478":"您的服务可用分钟数不足,无法呼叫。","CCC:421":"号码不存在","CHARGE:475":"当前会议人数已满,请联系管理员%s%s,\n及时为帐户充值,或购买更多会议端口。","CHARGE:476":"您呼叫的会议已达到最大支持人数,请联系管理员购买或使用超大型会议室。","CCC:404":"特服号暂时不可用,请稍后再试","CCC:403":"特服号暂时不可用,请稍后再试","CCC:406":"参数非法","REC:478":"录制中断,网络连接中,请重新发起录制","CHARGE:469":"服务资源使用已达最大值,请稍后重试!","CCC:405":"特服号暂时不可用,请稍后再试","REC:479":"录制中断,服务重启中,请重新发起录制","CCC:408":"企业不存在","CCC:407":"企业已存在","CCC:409":"无效的企业ID","SIG:726":"该号码异常已被限制使用","SIG:727":"呼叫失败,请再试一次","SIG:724":"您已被强制邀请加入新的会议","SIG:725":"呼叫失败,请再试一次","REC:470":"无可用录制服务器,请稍后再试","SIG:722":"设备与配对终端连接断开","SIG:723":"设备与指挥调度服务连接断开","SIG:720":"请稍等,主持人稍后邀请您入会","SIG:721":"会议还未开始,请等待主持人入会","CCC:411":"特服号不存在","CHARGE:467":"已达最大录制方数,不能发起录制","CCC:410":"特服号已存在","CHARGE:464":"录制失败,尚未开通录制服务或服务已过期,请联系管理员购买。","CCC:413":"坐席已存在","CCC:412":"无效的特服号","CHARGE:459":"帐户余额不足,无法支持此呼叫。\n请联系管理员%s%s,及时为帐户充值。","CHARGE:457":"终端电话可用分钟数不足,请充值;或联系管理员,加入通讯录。","CHARGE:458":"暂不支持呼叫国际电话。请联系管理员加入通讯录;或咨询本地经销商,为您的单位开通后台管理帐户。","SIG:716":"网络异常,呼叫已断开","SIG:713":"Content Server创建资源失败","REC:480":"录制失败,因为该会议室已启用单路录制","SIG:714":"Failed to allocated resources for content sharing.","REC:481":"录制中断,网络连接中,请重新发起录制","SIG:719":"呼叫失败,请再试一次","SIG:717":"会议室已超出最高通话时长限制,转为语音通话模式,可联系管理员处理","SIG:718":"语音模式限制已解除","SIG:711":"内容发送时会议尚未开始","SIG:712":"内容发送时会议尚未开始","CHARGE:451":"系统不支持此类型呼叫","CHARGE:452":"您的云会议室不支持邀请电话入会,\n请联系管理员加入通讯录;\n或咨询本地经销商,为您的开通帐户。","CHARGE:450":"您的终端目前无法支持此类呼叫","CHARGE:455":"暂不支持呼叫国际电话号码。","CCC:400":"特服号暂时不可用,请稍后再试","CHARGE:453":"帐户余额不足,无法支持此呼叫。\n请联系管理员%s%s,及时为帐户充值。","CCC:402":"特服号暂时不可用,请稍后再试","CHARGE:454":"终端电话可用分钟数不足,无法呼叫","CCC:401":"特服号暂时不可用,请稍后再试","CHARGE:602":"当前通话人数已达上限,您无法加入。","CHARGE:603":"您呼叫的会议已达最大支持人数。\n设备加入通讯录,可支持更多方会议。\n如需更多支持请呼叫客服终端号’288288’咨询。","CHARGE:721":"不允许互联网链路呼入","CHARGE:601":"会议容量使用现在达到上限,\n无法加入会议。请联系管理员%s%s购买更多会议端口。","CHARGE:606":"当前会议人数已超限,30分钟后将自动结束。\n请加入通讯录,可支持更多方会议。","CHARGE:607":"您的服务可用分钟数不足,无法呼叫。","CHARGE:604":"终端在家仅支持4方通话,当前通话人数已超限,30分钟后将自动结束。","CHARGE:605":"UNKNOWN","SIG:506":"录制服务器内部错误","SIG:504":"呼叫失败,请再试一次","CHARGE:608":"您呼叫的会议已达最大支持人数,请联系IT管理员","SIG:505":"呼叫失败,请再试一次","CHARGE:609":"您呼叫的会议已达最大支持人数,请联系IT管理员,购买超大型云会议室。","SIG:502":"呼叫失败,请再试一次","SIG:4999":"分享内容失败","SIG:503":"呼叫失败,请再试一次","CHARGE:720":"该账号已使用\t","CHARGE:712":"该云会议室已被设置为禁止被监看","CHARGE:713":"该终端正在参会的云会议室被设置为禁止被监看","CHARGE:710":"不支持pstn呼叫","CHARGE:711":"呼叫失败,您的企业已禁止PSTN通话功能,请联系您的管理员!","CHARGE:716":"当前用户不允许参会","CHARGE:717":"当前用户无权限入会","REC:503":"录制服务暂时不可用,请稍后再试","CHARGE:714":"监看权限校验超时,请重试","CHARGE:715":"该号码异常已被限制使用","CHARGE:718":"对方终端不允许拨打","CHARGE:719":"该账号已登录其它终端入会","SURV:580":"监控调度呼叫时,第三方服务报错","REC:505":"录制服务暂时不可用,请稍后再试","REC:506":"直播服务暂时不可用,请稍后再试","REC:507":"录制服务暂时不可用,请稍后再试","REC:509":"录制服务暂时不可用,请稍后再试","CHARGE:701":"企业账户余额不足,无法开启录制。请联系管理员充值后再尝试","CHARGE:702":"个人云会议室不可以用,请选择其他会议室或联系管理员","CHARGE:700":"企业账户未开通多路录制计费服务,无法开启录制。请联系客户咨询开通事宜","CHARGE:705":"H323融合服务器容量不足","CHARGE:706":"云会议室已达允许呼入的上限","CHARGE:703":"呼叫所用的H323集群容量不足","CHARGE:704":"H323融合服务器容量不足","SIG:408":"对方没应答,请稍后再试","SIG:405":"对方设备不在线,请稍后重试","CHARGE:707":"云会议室存储空间已满,不能再发起录制","SIG:409":"建立多点呼叫时的内部消息","SIG:400":"通讯失败,请升级到最新版本","SIG:403":"远端网络异常,呼叫已断开","SIG:404":"对方不在线","SIG:401":"加密算法不匹配","SIG:402":"该会议室不允许关闭摄像头,请开启摄像头加入会议","SURV:483":"同步会议信息失败,请重试","SURV:482":"邀请失败,请重试"},zh_TW:{"CHARGE:644":"沒有呼叫權限","CHARGE:649":"預約會議未到開始時間,無法加入","PS:400":"不支持跨雲呼叫","SIG:421":"對方終端不允許外人撥打,請與對方確認後再撥","SIG:422":"您已被主持人移出會議","SIG:420":"號碼不正確","SIG:789":"錄制已停止","SIG:423":"UNKNOWN","SIG:424":"主持人已結束會議","CHARGE:642":"呼叫失敗,企業IPPBX方數已達上限","CHARGE:643":"調度失敗,企業監控調度方數已達上限","CHARGE:640":"所屬部門的雲會議室存儲空間已滿,不能再發起錄制","CHARGE:641":"所屬企業的雲會議室存儲空間已滿,不能再發起錄制","CHARGE:635":"賬戶余額不足,不能發起PSTN通話,請聯系管理員充值後再嘗試","CHARGE:636":"雲會議室已達允許呼入的上限","CHARGE:633":"無法呼叫當前號碼,您的終端僅允許呼叫通訊錄上的用戶號碼","CHARGE:634":"賬戶余額支付範圍不可用於PSTN通話,請聯系管理員開啟後再嘗試。","CHARGE:639":"雲會議室存儲空間已滿,不能再發起錄制","CHARGE:637":"雲會議室已達部門允許呼入的上限","CHARGE:638":"雲會議室已達企業允許呼入的上限","SIG:419":"對方已開啟辦公模式。您可滑動下方按鈕,發起呼叫","SIG:416":"當前在線呼叫數已達服務上限,請稍後再試","SIG:417":"密碼輸入超時","SIG:410":"呼叫失敗,請再試壹次","SIG:4445":"雲會議室存儲空間已滿,不能再發起錄制","SIG:411":"終端APP版本過低,請升級後再試","SIG:4446":"所屬部門的雲會議室存儲空間已滿,不能再發起錄制","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":" 密碼錯誤次數達到3次,請稍後重試","SIG:4449":"無效的分享content類型","SIG:415":"同步呼叫信息失敗,請稍後再試","SIG:412":"對方版本過低,通話無法接通","SIG:4447":"所屬企業的雲會議室存儲空間已滿,不能再發起錄制","SIG:413":"對方設置了免打擾","SIG:4448":"未知錯誤","CHARGE:631":"此雲會議室為按參會時長計費的會議室。您的帳戶餘額已用盡,不能在此雲會議室發起會議,請聯系管理員充值或選擇其他雲會議室。","SIG:4441":"錄制超時,請稍後再試","CHARGE:632":"主動呼叫權限已被管理員關閉,無法呼叫","SIG:4442":"UNKNOWN","CHARGE:630":"當前雲會議室不允許邀請通訊錄外成員","SIG:4440":"分享content超時,請稍後再試","CHARGE:624":"呼叫失敗。您呼叫的終端埠使用服務已過期。","CHARGE:625":"此會議有終端端口服務已過期,無法支持多方呼叫","CHARGE:622":"沒有監看權限","CHARGE:623":"呼叫失敗。終端埠使用服務已過期,不能加入雲會議室或多方通話","REC:511":"錄制服務暫時不可用,請稍後再試","CHARGE:628":"您呼叫的雲會議室不允許匿名使用者呼入,請登錄或註冊後重新呼叫","REC:512":"錄制服務暫時不可用,請稍後再試","CHARGE:629":"對方正在會議中,且該會議不允許通訊錄外成員呼入,請稍後再試","CHARGE:626":"此會議有終端端口服務已過期,無法邀請更多人加入","CHARGE:627":"呼叫的雲會議室不允許通訊錄外成員呼入,請聯系雲會議室管理員","SIG:1503":"分配監控資源失敗","SIG:4456":"連接已斷開,請重新入會","SIG:4457":"號碼輸入有誤,請核對後重新撥打!","SIG:441":"當前在線呼叫數已達網關服務上限,請稍後重試","SIG:4454":"通話不存在,請核對後重試","SIG:4455":"服務器未連接,請稍後重試","SIG:445":"UNKNOWN","SIG:1501":"shuttle獲取MA失敗","SIG:4458":"網絡異常,呼叫已斷開","SIG:1502":"shuttle獲取媒體資源失敗","SIG:4459":"號碼輸入有誤,請核對後重新撥打!","CHARGE:620":"無單位歸屬,不能呼叫H.323設備","SIG:4452":"錄制失敗","CHARGE:621":"呼叫失敗,單位H.323方數不足","SIG:440":"雲會議室密碼不正確,請重試","SIG:4453":"通話已存在,請稍後再試","SIG:4450":"不支持分享content","SIG:4451":"帶寬不足,分享內容失敗","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","CHARGE:611":"UNKNOWN","REC:400":"信令服務與錄製服務內部錯誤。","CHARGE:612":"UNKNOWN","REC:401":"錄制服務暫時不可用,請稍後再試","CHARGE:617":"UNKNOWN","REC:402":"錄制服務暫時不可用,請稍後再試","CHARGE:618":"UNKNOWN","REC:403":"錄制服務暫時不可用,請稍後再試","CHARGE:615":"UNKNOWN","REC:404":"录制不存在","CHARGE:616":"會議已被鎖定,無法加入,請聯系會議發起人解鎖後進入。","REC:405":"錄制服務暫時不可用,請稍後再試","CHARGE:619":"呼叫失敗。終端的雲服務端口已過期,請聯系管理員續費購買。","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content發送時會議尚未開始","SIG:431":"Content Server創建資源失敗","SIG:4466":"輸入密碼超時","REC:406":"錄制服務暫時不可用,請稍後再試","SIG:4460":"號碼輸入有誤,請核對後重新撥打!","CHARGE:610":"呼叫失敗,您的企業已禁止PSTN通話功能,請聯系您的企業管理員!","SIG:4461":"號碼輸入有誤,請核對後重新撥打!","SIG:1404":"UNKNOWN","SIG:469":"錄製正在進行,請勿重複發起錄製","CHARGE:441":"當前在線呼叫數已達網關服務上限,請稍後重試","SIG:461":"錄制時,本地空間即將耗盡","SIG:462":"錄制時,本地空間已耗盡","SIG:580":"pstn呼叫時,第三方服務器報錯","REC:465":"本地已開啟錄制,不能重復發起錄制","REC:466":"錄制服務暫時不可用,請稍後再試!","REC:467":"已達最大錄制方數,不能發起錄制","REC:468":"錄制的存儲空間已滿,您無法開始錄制。\n請刪除已有的錄制視頻,\n或聯系企業管理員購買更多存儲空間。","REC:469":"UNKNOWN","REC:460":"沒有錄製權限","REC:463":"錄制的存儲空間已滿,您無法開始錄制。\n請刪除已有的錄制視頻,\n或聯系企業管理員購買更多存儲空間。","SIG:456":"呼叫失敗,請再試壹次","CHARGE:671":"會議未開始,請等待主持人開始會議後加入","CHARGE:672":"已被移出本次會議,無法入會","CHARGE:670":"您有一場會議正在進行,請先結束該會議","CHARGE:675":"沒有可用的視頻監控資源","SIG:450":"您的終端目前無法支持此類呼叫","CHARGE:676":"視頻監控服務併發超過限制","CCC:501":"數據庫操作失敗","CHARGE:673":"監控服務已經過期","CCC:500":"內部服務器錯誤","CHARGE:674":"視頻監控服務沒有企業歸屬","CCC:602":"输入超时","CHARGE:668":"會議未通過審批或未到預約開始時間","CCC:601":"呼叫超時","CHARGE:669":"管理員禁用點對點呼叫","CCC:604":"入會超時","CHARGE:666":"超過會議審批允許的最大成員數量,入會失敗","CCC:603":"评价结束","CHARGE:667":"超過會議審批允許的最大成員數量,邀請失敗","SIG:487":"呼叫已取消","SIG:488":"終端試用期已過,無法繼續為您服務了","SIG:485":"已達最大呼叫時長,呼叫已斷開","SIG:486":"對方忙,請稍後再試","CHARGE:660":"對方企業帳戶餘額不足,不能發起SDK呼叫","CHARGE:661":"對方企業賬戶尚未開通小程序SDK呼叫服務","SIG:480":"呼叫失敗,請再試壹次","CHARGE:664":"PSTN呼叫已達部門允許呼入的上限","SIG:483":"撥打不支持國家的pstn號碼","CHARGE:665":"小魚易連服務已過期,請企業管理員更新服務許可證","SIG:484":"電話時長已用盡,無法轉呼手機號,請聯繫IT管理員及時充值","CHARGE:420":"號碼不正確","CHARGE:662":"對方企業帳戶餘額不足,不能發起小程序SDK呼叫","SIG:482":"邀請失敗,請重試","CHARGE:415":"小魚易連服務已過期,請企業管理員更新服務許可證","CHARGE:657":"企業帳戶餘額不足,不能發起小程序SDK呼叫","CHARGE:416":"當前在線呼叫數已達服務上限,請稍後再試","CHARGE:658":"web用戶端達到企業的呼叫方數限制","CHARGE:655":"企業帳戶餘額不足,不能發起SDK呼叫","CHARGE:414":"H.323接入服務已過期","CHARGE:656":"企業帳戶尚未開通小程序SDK呼叫服務","CHARGE:659":"對方企業帳戶尚未開通SDK呼叫服務","STATE:200":"成功","SIG:598":"呼叫失敗,請再試壹次","SIG:599":"信令訊息格式無效","SIG:479":"共享內容路數已達上限,無法發起更多的共享。請等待其他參會者停止共享后再重試。","CHARGE:650":"h.323方數已達雲會議室允許呼入的上限","CHARGE:653":"會議不支持更多小程序入會,請使用App入會或聯系會議管理員","CHARGE:654":"企業帳戶尚未開通SDK呼叫服務","CCC:600":"用戶已被其他座席服務","CHARGE:651":"h.323方數已達部門允許呼入的上限","CHARGE:652":"預約會議已經過期,無法主動加入","SIG:704":"呼叫失敗,請再試壹次","SIG:703":"呼叫失敗,請再試壹次","SIG:708":"沒有白板分享權限","SIG:709":"無法合併會議","SIG:706":"沒有內容標記權限\t","SIG:707":"沒有雙流分享權限","CHARGE:481":"終端不允許陌生人呼叫","CCC:415":"坐席名稱已存在","CCC:414":"坐席不存在","CCC:417":"IVR配置已存在","CCC:416":"無效的坐席ID","CCC:419":"無效的IVR配置ID","CCC:418":"IVR配置不存在","SIG:498":"當前網絡UDP被禁用,無法通話,\n請聯系網絡管理員或切換其他網絡","SIG:499":"網絡異常,呼叫已斷開","SIG:496":"媒體超時","SIG:497":"信令超時","CHARGE:473":"當前通話人數已滿。如需更多人通話,請使用雲會議室。手機端下載小魚易連app,註冊即可獲得。","SIG:490":"無應答","CHARGE:474":"當前會議人數已滿,請加入企業通訊錄,\n購買更多會議端口,詳情請咨詢本地經銷商。","SIG:491":"","CCC:420":"特服號暫時不可用,請稍後再試","CHARGE:471":"當前通話人數已滿。請使用終端或雲會議室召開多方視頻會議。","CHARGE:472":"呼叫無法接通,終端在家最多支持4方通話。","CHARGE:477":"您呼叫的會議已達到最大支持人數,請聯系管理員購買或使用超大型會議室。","CCC:421":"號码不存在","CHARGE:478":"您的服務可用分鐘數不足,無法呼叫。","CHARGE:475":"當前會議人數已滿,請聯系企業管理員%s%s,\n及時為企業帳戶充值,或購買更多會議端口。","CHARGE:476":"您呼叫的會議已達到最大支持人數,請聯系管理員購買或使用超大型會議室。","CCC:404":"特服號暫時不可用,請稍後再試","CCC:403":"特服號暫時不可用,請稍後再試","CCC:406":"參數非法","CCC:405":"特服號暫時不可用,請稍後再試","CHARGE:469":"服務資源使用已達最大值,請稍後重試!","REC:478":"錄制中斷,網絡連接中,請重新發起錄制","CCC:408":"企業不存在","REC:479":"錄製中斷,服務重啟中,請重新發起錄製","CCC:407":"企業已存在","CCC:409":"無效的企業ID","SIG:726":"該號碼異常已被限製使用","SIG:727":"呼叫失敗,請再試壹次","SIG:724":"您已被強制邀請加入新的會議","REC:470":"沒有可用的錄製伺服器,請稍後再試","SIG:725":"呼叫失敗,請再試壹次","SIG:722":"設備與配對終端連接斷開","SIG:723":"設備與指揮調度服務連接斷開","SIG:720":"請稍等,主持人稍後邀請您入會","SIG:721":"會議還未開始,請等待主持人入會","CCC:411":"特服號不存在","CCC:410":"特服號已存在","CHARGE:467":"已達最大錄制方數,不能發起錄制","CCC:413":"坐席已存在","CHARGE:464":"錄制失敗,尚未開通錄制服務或服務已過期,請聯系管理員購買。","CCC:412":"無效的特服號","CHARGE:459":"企業帳戶余額不足,無法支持此呼叫。\n請聯系企業管理員%s%s,及時為企業帳戶充值。","CHARGE:457":"終端電話可用分鐘數不足,請充值;或聯系企業管理員,加入企業通訊錄。","CHARGE:458":"暫不支持呼叫國際電話。請聯系企業管理員加入企業通訊錄;或咨詢本地經銷商,為您開通企業帳戶。","SIG:716":"網絡異常,呼叫已斷開","REC:480":"錄製失敗,因為該會議室已啟用單路錄製模式","SIG:713":"Content Server創建資源失敗","REC:481":"錄制中斷,網絡連接中,請重新發起錄制","SIG:714":"Content Server創建資源失敗","SIG:719":"呼叫失敗,請再試壹次","SIG:717":"會議室已超出最高通話時長限制,轉為語音通話模式,可聯繫管理員處理","SIG:718":"語音模式限制已解除","SIG:711":"内容發送時會議尚未開始","SIG:712":"内容發送時會議尚未開始","CHARGE:451":"系統不支持此類型呼叫","CHARGE:452":"您的雲會議室不支持邀請電話入會,\n請聯系企業管理員加入企業通訊錄;\n或咨詢本地經銷商,為您的企業開通企業帳戶。","CHARGE:450":"您的終端目前無法支持此類呼叫","CCC:400":"特服號暫時不可用,請稍後再試","CHARGE:455":"暫不支持呼叫國際電話號碼。","CCC:402":"特服號暫時不可用,請稍後再試","CHARGE:453":"企業帳戶余額不足,無法支持此呼叫。\n請聯系企業管理員%s%s,及時為企業帳戶充值。","CCC:401":"特服號暫時不可用,請稍後再試","CHARGE:454":"終端電話可用分鐘數不足,無法呼叫。","CHARGE:602":"當前通話人數已達上限,您無法加入。","CHARGE:603":"您呼叫的會議已達最大支持人數。\n設備加入企業通訊錄,可支持更多方會議。\n如需更多支持請呼叫客服終端號’288288’咨詢。","CHARGE:721":"不允許互聯網鏈路呼入!","CHARGE:601":"企業會議容量使用現在達到上限,\n無法加入會議。請聯系管理員%s%s購買更多會議端口。","CHARGE:606":"當前會議人數已超限,30分鐘後將自動結束。\n請加入企業通訊錄,可支持更多方會議。","CHARGE:607":"您的服務可用分鐘數不足,無法呼叫。","CHARGE:604":"終端在家僅支持4方通話,當前通話人數已超限,30分鐘後將自動結束","CHARGE:605":"UNKNOWN","SIG:506":"錄製伺服器內部錯誤","CHARGE:608":"您呼叫的會議已達最大支持人數,請聯系企業IT管理員","SIG:504":"呼叫失敗,請再試壹次","CHARGE:609":"您呼叫的會議已達最大支持人數,請聯系企業IT管理員,購買超大型雲會議室。","SIG:505":"呼叫失敗,請再試壹次","SIG:502":"呼叫失敗,請再試壹次","SIG:4999":"分享內容失敗","SIG:503":"呼叫失敗,請再試壹次","CHARGE:720":"該賬號已使用","CHARGE:712":"該雲該雲會議室已被設置為禁止被監看會議室已被設置為禁止被監看","CHARGE:713":"該終端正在參會的雲會議室被設置為禁止被監看","CHARGE:710":"不支持pstn外呼","CHARGE:711":"呼叫失敗,您的企業已禁止PSTN通話功能,請聯系您的企業管理員!","CHARGE:716":"當前用戶不允許參會","CHARGE:717":"當前用戶無權限入會","CHARGE:714":"監看權限校驗超時,請重試","REC:503":"錄制服務暫時不可用,請稍後再試","CHARGE:715":"該號碼異常已被限製使用","CHARGE:718":"對方終端不允許撥打","CHARGE:719":"該賬號已登錄其它終端入會","SURV:580":"監控調度呼叫時,第三方服務報錯","REC:505":"錄制服務暫時不可用,請稍後再試","REC:506":"直播服務暫時不可用,請稍後再試","REC:507":"錄制服務暫時不可用,請稍後再試","REC:509":"錄制服務暫時不可用,請稍後再試","CHARGE:701":"企業帳戶餘額不足,無法開啟錄製。請聯系管理員充值後再嘗試","CHARGE:702":"個人云會議室不可以用,請選擇其他會議室或聯繫管理員","CHARGE:700":"企業帳戶未開通多路錄製計費服務,無法開啟錄製。請聯系客戶諮詢開通事宜","CHARGE:705":"H323融合服務器容量不足","CHARGE:703":"呼叫所用的H323集群容量不足","CHARGE:704":"H323融合服務器容量不足","SIG:408":"對方沒應答,請稍後再試","SIG:405":"對方設備不在線,請稍後重試","SIG:409":"建立多點呼叫時的內部消息","SIG:400":"通訊失敗,請升級到最新版本","SIG:403":"遠端網絡異常,呼叫已斷開","SIG:404":"對方不在線","SIG:401":"加密算法不匹配","SIG:402":"該會議室不允許關閉攝像頭,請開啟攝像頭加入會議","SURV:483":"同步會議信息失敗,請重試","SURV:482":"邀請失敗,請重試"},en_US:{"CHARGE:646":"Cloud meeting has reached the upper limit of organization's allowed incoming calls","CHARGE:647":"Terminal has reached the upper limit of allowed incoming calls","CHARGE:644":"No authority","CHARGE:645":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:648":"Terminal has reached the upper limit of organization's allowed incoming calls","CHARGE:649":"The scheduled meeting is not reached and cannot be joined","PS:400":"Cross-cloud calls are not supported","SIG:421":"Far end does not accept calls by Xiaoyu ID. Please check.","SIG:422":"You are kicked out by chairman.","SIG:420":"Invalid Number.","SIG:789":"Recording has been stopped","SIG:423":"UNKNOWN","SIG:424":"The meeting has ended.","CHARGE:642":"The call failed, and the IPPBX number of the enterprise has reached the upper limit.","CHARGE:643":"Scheduling failed, the number of enterprises monitoring and dispatching reached the upper limit","CHARGE:640":"Cloud storage of department is full and can no longer record","CHARGE:641":"Cloud storage of organization is full and can no longer record","CHARGE:635":"Account balance exhausted, you cannot initiate PSTN calls, please contact the administrator to recharge and then try again.","CHARGE:636":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:633":"The number can not be dialed out. The endpoint is only authorized to call the number on the contact list","CHARGE:634":"Account balance Payment scope is not available for PSTN calls, please contact the administrator to open and then try again.","CHARGE:639":"Cloud storage of user is full and can no longer record","CHARGE:637":"Cloud meeting has reached the upper limit of department's allowed incoming calls","CHARGE:638":"Cloud meeting has reached the upper limit of organization's allowed incoming calls","SIG:419":"Far end has turned on office mode. Please slide to call.","SIG:416":"Current calls have reached the max limit, please try again later.","SIG:417":"Password entry timeout.","SIG:410":"Call is not connected. Please retry.","SIG:4445":"Cloud storage of user is full and can no longer record","SIG:411":"version is too old.","SIG:4446":"Cloud storage of department is full and can no longer record","SIG:4443":"UNKNOWN","SIG:4444":"UNKNOWN","SIG:414":"Password error number reached 3 times, please try again later.","SIG:4449":"The type of sharing content is invalid.","SIG:415":"Synchronization call information failed. Please try again later.","SIG:412":"version is too old.","SIG:4447":"Cloud storage of organization is full and can no longer record","SIG:413":"Far end is in Do Not Disturb mode.","SIG:4448":"Unknown error.","SIG:4441":"Record is time out. Please retry later.","CHARGE:631":"This meeting room is charged by the minutes of the attendees. While your account balance has been exhausted, you cannot initiate a meeting in this meeting room, please contact your administrator to recharge or select another cloud meeting room.","SIG:4442":"UNKNOWN","CHARGE:632":"The endpoint is not authorized to dial out by admin.","SIG:4440":"Sharing content is time out. Please retry later.","CHARGE:630":"The current meeting does not allow non-address book members to call in.","CHARGE:624":"Call failed. The port service of the terminal you called has expired.","CHARGE:625":"This conference port service has expired and cannot support multi-party calls.","CHARGE:622":"No monitoring permission","CHARGE:623":"Call failed. The port service of this terminal has expired, and you cannot use this terminal to join cloud meeting room or multiparty call.","REC:511":"Xiaoyu recording service is not available, please try again later","CHARGE:628":"The meeting ID you called does not allow anonymous users to call in, Please log in or register and call again.","REC:512":"Xiaoyu recording service is not available, please try again later","CHARGE:629":"Far end is in the meeting which does not allow non-address book members to call in,please retry later.","CHARGE:626":"This conference port service has expired, and no more people can be invited.","CHARGE:627":"The meeting ID you called does not allow non-address book members to call in, please contact the administrator of the meeting room.","SIG:1503":"Allocating resource for survelliance failed.","SIG:4456":"The network is disconnected, please try joining the meeting again.","SIG:4457":"Wrong number, please check it and retry.","SIG:441":"Current calls have reached the max limit of gateway, please try again later.","SIG:4454":"No related call, please check and retry later.","SIG:4455":"No connection with server, please retry later.","SIG:445":"UNKNOWN","SIG:1501":"shuttle Get MA failed","SIG:4458":"Network unstable, call disconnected.","SIG:1502":"shuttle Get media resource failed","SIG:4459":"Wrong number, please check it and retry.","SIG:4452":"Record failed.","CHARGE:620":"You don't belong to an organization,and you cannot call H.323 device","SIG:440":"The password of conference is wrong. Please retry.","SIG:4453":"Call exists, please retry later.","CHARGE:621":"Call failed, insufficient H.323 port of your organization","SIG:4450":"Sharing content is unsupported.","SIG:4451":"Sharing content failed for no bandwidth.","CHARGE:613":"UNKNOWN","CHARGE:614":"UNKNOWN","CHARGE:611":"UNKNOWN","REC:400":"Internal errors in signaling and recording services.","CHARGE:612":"UNKNOWN","REC:401":"Xiaoyu recording service is not available, please try again later","CHARGE:617":"UNKNOWN","REC:402":"Xiaoyu recording service is not available, please try again later","CHARGE:618":"UNKNOWN","REC:403":"Xiaoyu recording service is not available, please try again later","CHARGE:615":"UNKNOWN","REC:404":"Record is not found.","CHARGE:616":"The meeting is locked, failed to join. Please contact meeting originator to unlock and join.","REC:405":"Xiaoyu recording service is not available, please try again later","CHARGE:619":"Call failed. The video service of the terminal has expired, please contact IT Admin to renew.","SIG:432":"UNKNOWN","SIG:433":"UNKNOWN","SIG:430":"Content cannot be shared before meeting is started.","SIG:431":"Failed to allocated resources for content sharing.","SIG:4466":"Check password timeout","REC:406":"Xiaoyu recording service is not available, please try again later","SIG:4460":"Wrong number, please check it and retry.","CHARGE:610":"Call failed. PSTN call is disabled, please contact your enterprise admin!","SIG:4461":"Wrong number, please check it and retry.","SIG:1404":"UNKNOWN","SIG:469":"Recording is in progress, do not repeat the recording","CHARGE:441":"Current calls have reached the max limit of gateway, please try again later.","SIG:461":"Local storage will be used up soon.","SIG:462":"Local storage is used up.","SIG:580":"Failed to make PSTN call.","REC:465":"Record is started. Not allow repeated record.","REC:466":"Xiaoyu recording service is not available, please try again later.","REC:467":"The maximum number of recordings has been reached and you cannot start recording","REC:468":"Storage space not available, cannot .","REC:469":"UNKNOWN","REC:460":"You don't have recording permission.","REC:463":"Storage space not available, cannot .","SIG:456":"Call is not connected. Please retry.","CHARGE:671":"The meeting did not start,please wait for the host to start the meeting","CHARGE:672":"Has been removed from this meeting and cannot join","CHARGE:670":"You have a meeting in progress, please end the meeting first","SIG:450":"Your device does not support this type of call.","CHARGE:675":"No video surveillance service available","CHARGE:676":"Video surveillance service exceeds limit","CCC:501":"Database operate error","CHARGE:673":"The video surveillance service has expired","CCC:500":"Internal server error","CHARGE:674":"Video surveillance services lack enterprise ownership","CHARGE:668":"The meeting has not been approved or the scheduled start time is not reached and cannot be joined","CHARGE:669":"P2P call prohibited by administrator","CHARGE:666":"The maximum number of participants approved by the meeting has been exceeded\t","CHARGE:667":"The maximum number of participants approved by the meeting has been exceeded","SIG:487":"Call is canceled.","SIG:488":"The trial has expired. Xiaoyu stops service.","SIG:485":"Reach max duration. Call ended","SIG:486":"Far end busy. Please retry later.","CHARGE:660":"The other enterprise account balance is insufficient to initiate SDK calls","SIG:480":"Call is not connected. Please retry.","CHARGE:661":"The other enterprise account has not yet enabled mini-program SDK call service","SIG:483":"PSTN call in this region is not supported.","CHARGE:664":"PSTN calling has reached the upper limit of department's allowed incoming calls","SIG:484":"Telephone minutes exhausted, you cannnot transfer your mobile phone number. Please contact the IT administrator to recharge in time","CHARGE:665":"Xiaoyu service is expired. Please update your license key.","CHARGE:420":"Incorrect Number.","CHARGE:662":"The other enterprise account balance is insufficient to initiate mini-program SDK calls","SIG:482":"The invitation failed, please try again","CHARGE:415":"Xiaoyu service is expired. Please update your license key.","CHARGE:657":"The enterprise account balance is insufficient to initiate mini-program SDK calls","CHARGE:416":"Current calls have reached the max limit, please try again later.","CHARGE:658":"Web client has reached the upper limit of organization's allowed incoming calls","CHARGE:655":"The enterprise account balance is insufficient to initiate SDK calls","CHARGE:414":"H.323 access service has expired","CHARGE:656":"The enterprise account has not yet enabled mini-program SDK call service","CHARGE:659":"The other enterprise account has not yet enabled SDK call service","STATE:200":"成功","SIG:598":"Call is not connected. Please retry.","SIG:599":"Signaling message format is not valid.","SIG:479":"The number of content share has exceeded the max limit, please retry after other participants stop the content share.","CHARGE:650":"The number of h.323 parties has reached the upper limit of the cloud conference room","CHARGE:653":"The meeting you are calling does not support the mini-program call-in service , please use app to join the meeting or contact the conference administrator","CHARGE:654":"The enterprise account has not yet enabled SDK call service","CHARGE:651":"The number of h.323 parties has reached the upper limit of department's allowed incoming calls","CHARGE:652":"The scheduled meeting has expired and cannot be joined","SIG:704":"Call is not connected. Please retry.","SIG:703":"Call is not connected. Please retry.","SIG:708":"You don't have whiteboard sharing permission.","SIG:709":"Meetings cannot be merged","SIG:706":"You don't have content labeling permission","SIG:707":"You don't have dual-stream sharing permissions","CHARGE:481":"You are not allowed to call this Xiaoyu.","CCC:415":"Same seat name is exist","CCC:414":"Seat is not exist","CCC:417":"IVR config is already exist","CCC:416":"Seat id is invalid","CCC:419":"IVR config id is invalid","CCC:418":"IVR config is not exist","SIG:498":"UDP is blocked by the network. Please call administrator or switch to another network.","SIG:499":"Network unstable, call disconnected.","SIG:496":"Media Timeout","SIG:497":"Signal Timeout","SIG:490":"Far end did not answer.MEDIA_TIMEOUT","CHARGE:473":"Current session is full. Please use cloud meeting room to have more people in the same conference. \nDownload XYLink App and register account to get free cloud meeting room.","SIG:491":"","CHARGE:474":"Current session is full. \nPlease purchase more cloud meeting ports.","CCC:420":"The service number is temporarily unavailable. Please try later.","CHARGE:471":"Current session is full. Please use Xiaoyu or cloud meeting room to have multi-party video conference.","CHARGE:472":"Call cannot be connected. Xiaoyu Home can only support 4 people in the same call.","CHARGE:477":"The meeting is full. Please contact the enterprise administrator to purchase or use the super large cloud conference room.","CCC:421":"The service number is not exist","CHARGE:478":"No sufficient available phone minutes to make calls.","CHARGE:475":"Current session is full. Please recharge for your enterprise account or purchase more cloud meeting ports.","CHARGE:476":"The meeting is full. Please contact the enterprise administrator to purchase or use the super large cloud conference room.","CCC:404":"The service number is temporarily unavailable. Please try later.","CCC:403":"The service number is temporarily unavailable. Please try later.","CCC:406":"Parameter is invalid","CCC:405":"The service number is temporarily unavailable. Please try later.","CHARGE:469":"The usage of service resources has reached the limit, please try again later! ","REC:478":"The recording is interrupted, the Network is connecting, please try again later","CCC:408":"Enterprise is not exist","REC:479":"The recording is interrupted, the service is restarting, please try again later","CCC:407":"Enterprise is already exist","CCC:409":"Enterprise Id is invalid","SIG:726":"This number is abnormal and has been restricted. ","SIG:727":"Call is not connected. Please retry.","SIG:724":"You have been forced to join a new meeting","SIG:725":"Call is not connected. Please retry.","REC:470":"No recording server available, please try again later","SIG:722":"Loss of connection between device and pairing terminal","SIG:723":"Loss of connection between device and dispatch service","SIG:720":"Please wait a moment, the chairman will invite you to join the conference later.","SIG:721":"The conference has not started. Please wait the chairman to join the conference.","CCC:411":"Service number is not exist","CCC:410":"Service number is exist","CHARGE:467":"The maximum number of recordings has been reached and you cannot start recording","CCC:413":"Seat is already exist","CHARGE:464":"License is needed to start recording, please contact IT administrator to purchase or renewal recording service.","CCC:412":"Service number is invalid","CHARGE:459":"No sufficient balance in your enterprise account. \nPlease contact IT administrator %s%s to recharge.","CHARGE:457":"No sufficient phone minutes. Please recharge or contact IT administrator to enable enterprise account.","CHARGE:458":"phone calls are not supported. Please contact IT administrator to enable enterprise account and create enterprise contacts.","SIG:716":"Network unstable, call disconnected.","SIG:713":"Failed to allocated resources for content sharing.","REC:480":"Recording failed, because the cloud meeting room single recording mode is enabled","SIG:714":"Failed to allocated resources for content sharing.","REC:481":"The recording is interrupted, the Network is connecting, please try again later","SIG:719":"Call is not connected. Please retry.","SIG:717":"The conference has exceeded the maximum call duration limit and switched to voice call mode,could contact the admin to deal with","SIG:718":"Voice call mode restrictions have been lifted","SIG:711":"Content cannot be shared before meeting is started.","SIG:712":"Content cannot be shared before meeting is started.","CHARGE:451":"Your system does not support this type of call.","CHARGE:452":"Your cloud meeting room does not support inviting phone calls. \nPlease contact IT administrator to enable enterprise account \nand create enterprise contacts.","CHARGE:450":"Your device does not support this type of call.","CCC:400":"The service number is temporarily unavailable. Please try later.","CHARGE:455":"International phone calls are not supported.","CCC:402":"The service number is temporarily unavailable. Please try later.","CHARGE:453":"Insufficient.","CCC:401":"The service number is temporarily unavailable. Please try later.","CHARGE:454":"Insufficient.","CHARGE:602":"The current number of calls has reached the upper limit, and you cannot join","CHARGE:603":"Current session is full. \nPlease contact IT administrator to enable enterprise account to support more participants. \nCall XiaoYu service 288288 for more information","CHARGE:721":"Incoming calls from Internet links are not allowed!","CHARGE:601":"Meeting capacity is over limit. \nPlease contact IT administrator %s%sto purchase more meeting resources.","CHARGE:606":"The current number of meetings has been overrun and will be automatically terminable in 30 minutes. \n please join the address book to support more party meetings.","CHARGE:607":"Your service is not available enough to call.","CHARGE:604":"The terminal supports only 4 Party calls at home. The number of calls is now out of line, and will automatically end in 30 minutes.","CHARGE:605":"UNKNOWN","SIG:506":"Internal error on the recording server.","SIG:504":"Call is not connected. Please retry.","CHARGE:608":"Current session is full. \nPlease contact IT administrator","SIG:505":"Call is not connected. Please retry.","CHARGE:609":"Current session is full. \nPlease contact IT administrator to purchase super-large meeting service","SIG:502":"Call is not connected. Please retry.","SIG:4999":"Sharing content failed.","SIG:503":"Call is not connected. Please retry.","CHARGE:720":"This account has been used","CHARGE:712":"The cloud conference room has been set to prohibit monitoring","CHARGE:713":"The cloud conference room that the terminal is participating in is set to prohibit monitoring","CHARGE:710":"Don't support pstn outbound calls","CHARGE:711":"Call failed. PSTN call is disabled, please contact your enterprise admin!","CHARGE:716":"The current user is not allowed to attend the meeting","CHARGE:717":"The current user has no permission to join","CHARGE:714":"Monitoring permission verification timed out, please try again","REC:503":"Xiaoyu recording service is not available, please try again later","CHARGE:715":"This number is abnormal and has been restricted.","CHARGE:718":"Far end does not accept calls","CHARGE:719":"This account has been logged into other terminals to join","SURV:580":"Failed to make IPC call.","REC:505":"Xiaoyu recording service is not available, please try again later","REC:506":"Live service is not available, please try again later","REC:507":"Xiaoyu recording service is not available, please try again later","REC:509":"Xiaoyu recording service is not available, please try again later","CHARGE:701":"The account balance of your enterprise is insufficient,so you can't initiate a recording. Please contact your administrator to recharge and try again","CHARGE:702":"Personal cloud conference room is not available. Please choose another conference room or contact the administrato","CHARGE:700":"The enterprise account does enable multi-recording service charge,so you can't initiate a recording. Please contact customer service for opening","CHARGE:705":"Call failed, insufficient H.323 port of your organization","CHARGE:706":"Cloud meeting has reached the upper limit of allowed incoming calls","CHARGE:703":"Call failed, the capacity of the H323 cluster used by the call is insufficient.","CHARGE:704":"Call failed, insufficient H.323 port of your organization","SIG:408":"Far end no answer. Please retry later.","SIG:405":"Far end device is not online. Please call again later.","CHARGE:707":"Cloud storage of user is full and can no longer record","SIG:409":"Internal message.","SIG:400":"Failed to connect. Please upgrade to laster version.","SIG:403":"Far end network unstable. Call is disconnected.","SIG:404":"Far end is offline.","SIG:401":"Encryption match failed","SIG:402":"It is not allowed to turn off the camera in this meeting room. Please turn on camera to join the meeting","SURV:483":"Failed to synchronize meeting information. Please try again","SURV:482":"The invitation failed, please try again"}},Ul=co.find,Kl=!0;"find"in[]&&Array(1).find((function(){Kl=!1})),qt({target:"Array",proto:!0,forced:Kl},{find:function(e){return Ul(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("find");var Fl="zh_CN",zl=function(){var e=new Date;return"".concat(e.getMonth()+1,"-").concat(e.getDate()," ").concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())},Yl=function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())};function Vl(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}var Xl=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return{code:e,msg:jl[Fl][e]||n,detail:t}},Wl=function(e,t,n){return t?{success:e,data:{code:t,msg:jl[Fl][t]||n}}:{success:e,data:{}}},ql=function(e,t){if("[object Object]"!==Object.prototype.toString.call(e))return e;if("string"==typeof t)return Object.assign(Object.assign({},e),function(e,t,n){return t in e?Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}):e[t]=n,e}({},t,"******"));if(Array.isArray(t)){var n=Object.assign({},e);return t.forEach((function(e){void 0!==n[e]&&(n[e]="******")})),n}return e},Zl=function(e){return"[object object]"===Object.prototype.toString.call(e).toLocaleLowerCase()},Jl=function(){function t(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:3,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"webrtc_log",i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"webrtc";n(this,t),this.dbName=i,this.db=new qu(this.dbName),this.tableCount=Math.max(e,1),this.tableName=r,this.maxTableCount=3}return i(t,[{key:"add",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.db){e.next=4;break}return this.db=new qu(this.db),e.next=4,this.init();case 4:try{r=t.time,i=void 0===r?"":r,o=t.title,a=void 0===o?"":o,s=t.content,c=void 0===s?"":s,u=t.rest,l=void 0===u?[]:u,h=this.num||1,this.db[this.tableName+h]&&this.db[this.tableName+h].add({t:i+JSON.stringify(a),c:JSON.stringify(c)+" "+JSON.stringify(l)}).then((function(){})).catch((function(e){console.log("add db data failed: ",e)}))}catch(e){console.log("add db data failed: ",e)}case 5:case"end":return e.stop()}}),n,this)})))}},{key:"deleteDB",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.db.delete(),qu.delete(this.dbName),sl.set("xy-webrtc-log",{version:1,num:1}),this.num=1,this.db=null;case 5:case"end":return e.stop()}}),t,this)})))}},{key:"close",value:function(){this.db.close()}},{key:"stop",value:function(){var e=sl.get("xy-webrtc-log")||{version:1,num:1};sl.set("xy-webrtc-log",{version:e.version,num:e.num+1>this.maxTableCount?1:e.num+1})}},{key:"isOpen",value:function(){return this.db&&this.db.isOpen()}},{key:"export",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.db.isOpen()){e.next=4;break}return e.next=4,this.db.open();case 4:return console.log("log download"),e.next=7,Rl(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 7:return n=e.sent,r=zl(),e.next=11,this.generateZipBlobAsync(n,r,"");case 11:return i=e.sent,console.log("log download..."),Ml(i,"xy_webrtc_sdk_log_".concat(r,".zip"),"application/zip"),e.abrupt("return",!0);case 17:return e.prev=17,e.t0=e.catch(0),console.error("export db data error: "+e.t0),e.abrupt("return",!1);case 21:case"end":return e.stop()}}),t,this,[[0,17]])})))}},{key:"upload",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=null,this.db.isOpen()){e.next=4;break}return e.next=4,this.db.open();case 4:return e.prev=4,e.next=7,Rl(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 7:return i=e.sent,o=zl(),e.next=11,this.generateZipBlobAsync(i,o,t);case 11:r=e.sent,e.next=17;break;case 14:e.prev=14,e.t0=e.catch(4),console.error("export blob error: "+e.t0);case 17:return e.abrupt("return",r);case 18:case"end":return e.stop()}}),n,this,[[4,14]])})))}},{key:"progressCallback",value:function(e){return e.totalRows,e.completedRows,!0}},{key:"open",value:function(){this.db.open()}},{key:"init",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,this.db){e.next=5;break}return this.db=new qu(this.db),e.next=5,this.init();case 5:return n=sl.get("xy-webrtc-log")||{version:1,num:1},this.num=n.num,this.initStores(),e.next=10,this.db[this.tableName+this.num].clear();case 10:if(this.isOpen()){e.next=13;break}return e.next=13,this.db.open();case 13:e.next=21;break;case 15:return e.prev=15,e.t0=e.catch(0),console.log("init db failed:",e.t0),this.deleteDB(),e.next=21,this.init();case 21:case"end":return e.stop()}}),t,this,[[0,15]])})))}},{key:"getStores",value:function(e){var t=this,n={};return Array(this.tableCount).fill(this.tableCount).forEach((function(r,i){n[t.tableName+(i+1)]=e})),n}},{key:"initStores",value:function(){this.db&&!this.db.isOpen()&&(this.db.version(1).stores(this.getStores("++id,time,title,content,rest")),this.upgradeStores({version:2}),this.upgradeStores())}},{key:"setLogVersion",value:function(e){var t=sl.get("xy-webrtc-log")||{version:1,num:1};sl.set("xy-webrtc-log",Object.assign(Object.assign({},t),{version:e}))}},{key:"upgradeStores",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=e.version,n=void 0===t?1:t,r=e.tableCount,i=void 0===r?this.tableCount:r,o=e.tableName,a=void 0===o?this.tableName:o,s=e.field,c=void 0===s?"++id,t,c":s;this.db&&!this.db.isOpen()&&(this.tableCount=i,this.tableName=a,n<this.db.verno+1&&(n=this.db.verno+1),this.setLogVersion(n),this.db.version(n).stores(this.getStores(c)).upgrade())}},{key:"generateZipBlobAsync",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=new Bl,e.next=3,o.file("xy_webrtc_sdk_log_".concat(r,"_").concat(n,".json"),t,{});case 3:return e.next=5,o.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:9}});case 5:return a=e.sent,e.abrupt("return",a);case 7:case"end":return e.stop()}}),i)})))}}]),t}(),$l=RegExp.prototype,Ql=$e.PROPER,eh=RegExp.prototype.toString,th=C((function(){return"/a/b"!=eh.call({source:"a",flags:"b"})})),nh=Ql&&"toString"!=eh.name;(th||nh)&&yt(RegExp.prototype,"toString",(function(){var e=Fe(this);return"/"+po(e.source)+"/"+po(function(e){var t=e.flags;return void 0!==t||"flags"in $l||Se(e,"flags")||!Z($l,e)?t:_(vo,e)}(e))}),{unsafe:!0});var rh=function(e,t,n){var r,i;return jn&&V(r=t.constructor)&&r!==n&&X(i=r.prototype)&&i!==n.prototype&&jn(e,i),e},ih=M(1..valueOf),oh=Mt.f,ah=je.f,sh=Xe.f,ch=ha.trim,uh=k.Number,lh=uh.prototype,hh=k.TypeError,dh=M("".slice),fh=M("".charCodeAt),ph=function(e){var t=De(e,"number");return"bigint"==typeof t?t:vh(t)},vh=function(e){var t,n,r,i,o,a,s,c,u=De(e,"number");if(ae(u))throw hh("Cannot convert a Symbol value to a number");if("string"==typeof u&&u.length>2)if(u=ch(u),43===(t=fh(u,0))||45===t){if(88===(n=fh(u,2))||120===n)return NaN}else if(48===t){switch(fh(u,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+u}for(a=(o=dh(u,2)).length,s=0;s<a;s++)if((c=fh(o,s))<48||c>i)return NaN;return parseInt(o,r)}return+u};if(Xt("Number",!uh(" 0o1")||!uh("0b1")||uh("+0x1"))){for(var gh,mh=function(e){var t=arguments.length<1?0:uh(ph(e)),n=this;return Z(lh,n)&&C((function(){ih(n)}))?rh(Object(t),n,mh):t},yh=E?oh(uh):"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(","),bh=0;yh.length>bh;bh++)Se(uh,gh=yh[bh])&&!Se(mh,gh)&&sh(mh,gh,ah(uh,gh));mh.prototype=lh,lh.constructor=mh,yt(k,"Number",mh,{constructor:!0})}var Sh=RangeError,wh=RangeError,kh=String,Ch=Math.floor,Eh=M((function(e){var t=po(z(this)),n="",r=kt(e);if(r<0||r==1/0)throw Sh("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n})),xh=M("".slice),Ih=M(1..toFixed),_h=function(e,t,n){return 0===t?n:t%2==1?_h(e,t-1,n*e):_h(e*e,t/2,n)},Ah=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=Ch(i/1e7)},Th=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=Ch(r/t),r=r%t*1e7},Rh=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=kh(e[t]);n=""===n?r:n+Eh("0",7-r.length)+r}return n},Oh=C((function(){return"0.000"!==Ih(8e-5,3)||"1"!==Ih(.9,0)||"1.25"!==Ih(1.255,2)||"1000000000000000128"!==Ih(0xde0b6b3a7640080,0)}))||!C((function(){Ih({})}));qt({target:"Number",proto:!0,forced:Oh},{toFixed:function(e){var t,n,r,i,o=ih(this),a=kt(e),s=[0,0,0,0,0,0],c="",u="0";if(a<0||a>20)throw wh("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return kh(o);if(o<0&&(c="-",o=-o),o>1e-21)if(n=(t=function(e){for(var t=0,n=e;n>=4096;)t+=12,n/=4096;for(;n>=2;)t+=1,n/=2;return t}(o*_h(2,69,1))-69)<0?o*_h(2,-t,1):o/_h(2,t,1),n*=4503599627370496,(t=52-t)>0){for(Ah(s,0,n),r=a;r>=7;)Ah(s,1e7,0),r-=7;for(Ah(s,_h(10,r,1),0),r=t-1;r>=23;)Th(s,1<<23),r-=23;Th(s,1<<r),Ah(s,1,1),Th(s,2),u=Rh(s)}else Ah(s,0,n),Ah(s,1<<-t,0),u=Rh(s)+Eh("0",a);return u=a>0?c+((i=u.length)<=a?"0."+Eh("0",a-i)+u:xh(u,0,i-a)+"."+xh(u,i-a)):c+u}});var Dh="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),Nh=new Uint8Array(16);function Lh(){if(!Dh)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Dh(Nh)}for(var Ph=[],Mh=0;Mh<256;++Mh)Ph[Mh]=(Mh+256).toString(16).substr(1);function Bh(e,t,n){var r=t&&n||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var i=(e=e||{}).random||(e.rng||Lh)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,t)for(var o=0;o<16;++o)t[r+o]=i[o];return t||function(e,t){var n=t||0,r=Ph;return[r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],"-",r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]],r[e[n++]]].join("")}(i)}var Gh,jh,Hh=y((function(e,t){!function(e){function t(e){return"0123456789abcdefghijklmnopqrstuvwxyz".charAt(e)}function n(e,t){return e&t}function r(e,t){return e|t}function i(e,t){return e^t}function o(e,t){return e&~t}function a(e){if(0==e)return-1;var t=0;return 0==(65535&e)&&(e>>=16,t+=16),0==(255&e)&&(e>>=8,t+=8),0==(15&e)&&(e>>=4,t+=4),0==(3&e)&&(e>>=2,t+=2),0==(1&e)&&++t,t}function s(e){for(var t=0;0!=e;)e&=e-1,++t;return t}var c="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/";function u(e){var t,n,r="";for(t=0;t+3<=e.length;t+=3)n=parseInt(e.substring(t,t+3),16),r+=c.charAt(n>>6)+c.charAt(63&n);for(t+1==e.length?(n=parseInt(e.substring(t,t+1),16),r+=c.charAt(n<<2)):t+2==e.length&&(n=parseInt(e.substring(t,t+2),16),r+=c.charAt(n>>2)+c.charAt((3&n)<<4));(3&r.length)>0;)r+="=";return r}function l(e){var n,r="",i=0,o=0;for(n=0;n<e.length&&"="!=e.charAt(n);++n){var a=c.indexOf(e.charAt(n));a<0||(0==i?(r+=t(a>>2),o=3&a,i=1):1==i?(r+=t(o<<2|a>>4),o=15&a,i=2):2==i?(r+=t(o),r+=t(a>>2),o=3&a,i=3):(r+=t(o<<2|a>>4),r+=t(15&a),i=0))}return 1==i&&(r+=t(o<<2)),r}var h,d,f=function(e,t){return(f=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n])})(e,t)},p=function(e){var t;if(void 0===h){var n="0123456789ABCDEF";for(h={},t=0;t<16;++t)h[n.charAt(t)]=t;for(n=n.toLowerCase(),t=10;t<16;++t)h[n.charAt(t)]=t;for(t=0;t<" \f\n\r\t \u2028\u2029".length;++t)h[" \f\n\r\t \u2028\u2029".charAt(t)]=-1}var r=[],i=0,o=0;for(t=0;t<e.length;++t){var a=e.charAt(t);if("="==a)break;if(-1!=(a=h[a])){if(void 0===a)throw new Error("Illegal character at offset "+t);i|=a,++o>=2?(r[r.length]=i,i=0,o=0):i<<=4}}if(o)throw new Error("Hex encoding incomplete: 4 bits missing");return r},v={decode:function(e){var t;if(void 0===d){for(d=Object.create(null),t=0;t<64;++t)d["ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".charAt(t)]=t;for(t=0;t<"= \f\n\r\t \u2028\u2029".length;++t)d["= \f\n\r\t \u2028\u2029".charAt(t)]=-1}var n=[],r=0,i=0;for(t=0;t<e.length;++t){var o=e.charAt(t);if("="==o)break;if(-1!=(o=d[o])){if(void 0===o)throw new Error("Illegal character at offset "+t);r|=o,++i>=4?(n[n.length]=r>>16,n[n.length]=r>>8&255,n[n.length]=255&r,r=0,i=0):r<<=6}}switch(i){case 1:throw new Error("Base64 encoding incomplete: at least 2 bits missing");case 2:n[n.length]=r>>10;break;case 3:n[n.length]=r>>16,n[n.length]=r>>8&255}return n},re:/-----BEGIN [^-]+-----([A-Za-z0-9+\/=\s]+)-----END [^-]+-----|begin-base64[^\n]+\n([A-Za-z0-9+\/=\s]+)====/,unarmor:function(e){var t=v.re.exec(e);if(t)if(t[1])e=t[1];else{if(!t[2])throw new Error("RegExp out of sync");e=t[2]}return v.decode(e)}},g=1e13,m=function(){function e(e){this.buf=[+e||0]}return e.prototype.mulAdd=function(e,t){var n,r,i=this.buf,o=i.length;for(n=0;n<o;++n)(r=i[n]*e+t)<g?t=0:r-=(t=0|r/g)*g,i[n]=r;t>0&&(i[n]=t)},e.prototype.sub=function(e){var t,n,r=this.buf,i=r.length;for(t=0;t<i;++t)(n=r[t]-e)<0?(n+=g,e=1):e=0,r[t]=n;for(;0===r[r.length-1];)r.pop()},e.prototype.toString=function(e){if(10!=(e||10))throw new Error("only base 10 is supported");for(var t=this.buf,n=t[t.length-1].toString(),r=t.length-2;r>=0;--r)n+=(g+t[r]).toString().substring(1);return n},e.prototype.valueOf=function(){for(var e=this.buf,t=0,n=e.length-1;n>=0;--n)t=t*g+e[n];return t},e.prototype.simplify=function(){var e=this.buf;return 1==e.length?e[0]:this},e}(),y=/^(\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/,b=/^(\d\d\d\d)(0[1-9]|1[0-2])(0[1-9]|[12]\d|3[01])([01]\d|2[0-3])(?:([0-5]\d)(?:([0-5]\d)(?:[.,](\d{1,3}))?)?)?(Z|[-+](?:[0]\d|1[0-2])([0-5]\d)?)?$/;function S(e,t){return e.length>t&&(e=e.substring(0,t)+"…"),e}var w,k=function(){function e(t,n){this.hexDigits="0123456789ABCDEF",t instanceof e?(this.enc=t.enc,this.pos=t.pos):(this.enc=t,this.pos=n)}return e.prototype.get=function(e){if(void 0===e&&(e=this.pos++),e>=this.enc.length)throw new Error("Requesting byte offset "+e+" on a stream of length "+this.enc.length);return"string"==typeof this.enc?this.enc.charCodeAt(e):this.enc[e]},e.prototype.hexByte=function(e){return this.hexDigits.charAt(e>>4&15)+this.hexDigits.charAt(15&e)},e.prototype.hexDump=function(e,t,n){for(var r="",i=e;i<t;++i)if(r+=this.hexByte(this.get(i)),!0!==n)switch(15&i){case 7:r+=" ";break;case 15:r+="\n";break;default:r+=" "}return r},e.prototype.isASCII=function(e,t){for(var n=e;n<t;++n){var r=this.get(n);if(r<32||r>176)return!1}return!0},e.prototype.parseStringISO=function(e,t){for(var n="",r=e;r<t;++r)n+=String.fromCharCode(this.get(r));return n},e.prototype.parseStringUTF=function(e,t){for(var n="",r=e;r<t;){var i=this.get(r++);n+=i<128?String.fromCharCode(i):i>191&&i<224?String.fromCharCode((31&i)<<6|63&this.get(r++)):String.fromCharCode((15&i)<<12|(63&this.get(r++))<<6|63&this.get(r++))}return n},e.prototype.parseStringBMP=function(e,t){for(var n,r,i="",o=e;o<t;)n=this.get(o++),r=this.get(o++),i+=String.fromCharCode(n<<8|r);return i},e.prototype.parseTime=function(e,t,n){var r=this.parseStringISO(e,t),i=(n?y:b).exec(r);return i?(n&&(i[1]=+i[1],i[1]+=+i[1]<70?2e3:1900),r=i[1]+"-"+i[2]+"-"+i[3]+" "+i[4],i[5]&&(r+=":"+i[5],i[6]&&(r+=":"+i[6],i[7]&&(r+="."+i[7]))),i[8]&&(r+=" UTC","Z"!=i[8]&&(r+=i[8],i[9]&&(r+=":"+i[9]))),r):"Unrecognized time: "+r},e.prototype.parseInteger=function(e,t){for(var n,r=this.get(e),i=r>127,o=i?255:0,a="";r==o&&++e<t;)r=this.get(e);if(0==(n=t-e))return i?-1:0;if(n>4){for(a=r,n<<=3;0==(128&(+a^o));)a=+a<<1,--n;a="("+n+" bit)\n"}i&&(r-=256);for(var s=new m(r),c=e+1;c<t;++c)s.mulAdd(256,this.get(c));return a+s.toString()},e.prototype.parseBitString=function(e,t,n){for(var r=this.get(e),i="("+((t-e-1<<3)-r)+" bit)\n",o="",a=e+1;a<t;++a){for(var s=this.get(a),c=a==t-1?r:0,u=7;u>=c;--u)o+=s>>u&1?"1":"0";if(o.length>n)return i+S(o,n)}return i+o},e.prototype.parseOctetString=function(e,t,n){if(this.isASCII(e,t))return S(this.parseStringISO(e,t),n);var r=t-e,i="("+r+" byte)\n";r>(n/=2)&&(t=e+n);for(var o=e;o<t;++o)i+=this.hexByte(this.get(o));return r>n&&(i+="…"),i},e.prototype.parseOID=function(e,t,n){for(var r="",i=new m,o=0,a=e;a<t;++a){var s=this.get(a);if(i.mulAdd(128,127&s),o+=7,!(128&s)){if(""===r)if((i=i.simplify())instanceof m)i.sub(80),r="2."+i.toString();else{var c=i<80?i<40?0:1:2;r=c+"."+(i-40*c)}else r+="."+i.toString();if(r.length>n)return S(r,n);i=new m,o=0}}return o>0&&(r+=".incomplete"),r},e}(),C=function(){function e(e,t,n,r,i){if(!(r instanceof E))throw new Error("Invalid tag value.");this.stream=e,this.header=t,this.length=n,this.tag=r,this.sub=i}return e.prototype.typeName=function(){switch(this.tag.tagClass){case 0:switch(this.tag.tagNumber){case 0:return"EOC";case 1:return"BOOLEAN";case 2:return"INTEGER";case 3:return"BIT_STRING";case 4:return"OCTET_STRING";case 5:return"NULL";case 6:return"OBJECT_IDENTIFIER";case 7:return"ObjectDescriptor";case 8:return"EXTERNAL";case 9:return"REAL";case 10:return"ENUMERATED";case 11:return"EMBEDDED_PDV";case 12:return"UTF8String";case 16:return"SEQUENCE";case 17:return"SET";case 18:return"NumericString";case 19:return"PrintableString";case 20:return"TeletexString";case 21:return"VideotexString";case 22:return"IA5String";case 23:return"UTCTime";case 24:return"GeneralizedTime";case 25:return"GraphicString";case 26:return"VisibleString";case 27:return"GeneralString";case 28:return"UniversalString";case 30:return"BMPString"}return"Universal_"+this.tag.tagNumber.toString();case 1:return"Application_"+this.tag.tagNumber.toString();case 2:return"["+this.tag.tagNumber.toString()+"]";case 3:return"Private_"+this.tag.tagNumber.toString()}},e.prototype.content=function(e){if(void 0===this.tag)return null;void 0===e&&(e=1/0);var t=this.posContent(),n=Math.abs(this.length);if(!this.tag.isUniversal())return null!==this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);switch(this.tag.tagNumber){case 1:return 0===this.stream.get(t)?"false":"true";case 2:return this.stream.parseInteger(t,t+n);case 3:return this.sub?"("+this.sub.length+" elem)":this.stream.parseBitString(t,t+n,e);case 4:return this.sub?"("+this.sub.length+" elem)":this.stream.parseOctetString(t,t+n,e);case 6:return this.stream.parseOID(t,t+n,e);case 16:case 17:return null!==this.sub?"("+this.sub.length+" elem)":"(no elem)";case 12:return S(this.stream.parseStringUTF(t,t+n),e);case 18:case 19:case 20:case 21:case 22:case 26:return S(this.stream.parseStringISO(t,t+n),e);case 30:return S(this.stream.parseStringBMP(t,t+n),e);case 23:case 24:return this.stream.parseTime(t,t+n,23==this.tag.tagNumber)}return null},e.prototype.toString=function(){return this.typeName()+"@"+this.stream.pos+"[header:"+this.header+",length:"+this.length+",sub:"+(null===this.sub?"null":this.sub.length)+"]"},e.prototype.toPrettyString=function(e){void 0===e&&(e="");var t=e+this.typeName()+" @"+this.stream.pos;if(this.length>=0&&(t+="+"),t+=this.length,this.tag.tagConstructed?t+=" (constructed)":!this.tag.isUniversal()||3!=this.tag.tagNumber&&4!=this.tag.tagNumber||null===this.sub||(t+=" (encapsulates)"),t+="\n",null!==this.sub){e+=" ";for(var n=0,r=this.sub.length;n<r;++n)t+=this.sub[n].toPrettyString(e)}return t},e.prototype.posStart=function(){return this.stream.pos},e.prototype.posContent=function(){return this.stream.pos+this.header},e.prototype.posEnd=function(){return this.stream.pos+this.header+Math.abs(this.length)},e.prototype.toHexString=function(){return this.stream.hexDump(this.posStart(),this.posEnd(),!0)},e.decodeLength=function(e){var t=e.get(),n=127&t;if(n==t)return n;if(n>6)throw new Error("Length over 48 bits not supported at position "+(e.pos-1));if(0===n)return null;t=0;for(var r=0;r<n;++r)t=256*t+e.get();return t},e.prototype.getHexStringValue=function(){var e=this.toHexString(),t=2*this.header,n=2*this.length;return e.substr(t,n)},e.decode=function(t){var n;n=t instanceof k?t:new k(t,0);var r=new k(n),i=new E(n),o=e.decodeLength(n),a=n.pos,s=a-r.pos,c=null,u=function(){var t=[];if(null!==o){for(var r=a+o;n.pos<r;)t[t.length]=e.decode(n);if(n.pos!=r)throw new Error("Content size is not correct for container starting at offset "+a)}else try{for(;;){var i=e.decode(n);if(i.tag.isEOC())break;t[t.length]=i}o=a-n.pos}catch(e){throw new Error("Exception while decoding undefined length content: "+e)}return t};if(i.tagConstructed)c=u();else if(i.isUniversal()&&(3==i.tagNumber||4==i.tagNumber))try{if(3==i.tagNumber&&0!=n.get())throw new Error("BIT STRINGs with unused bits cannot encapsulate.");c=u();for(var l=0;l<c.length;++l)if(c[l].tag.isEOC())throw new Error("EOC is not supposed to be actual content.")}catch(e){c=null}if(null===c){if(null===o)throw new Error("We can't skip over an invalid tag with undefined length at offset "+a);n.pos=a+Math.abs(o)}return new e(r,s,o,i,c)},e}(),E=function(){function e(e){var t=e.get();if(this.tagClass=t>>6,this.tagConstructed=0!=(32&t),this.tagNumber=31&t,31==this.tagNumber){var n=new m;do{t=e.get(),n.mulAdd(128,127&t)}while(128&t);this.tagNumber=n.simplify()}}return e.prototype.isUniversal=function(){return 0===this.tagClass},e.prototype.isEOC=function(){return 0===this.tagClass&&0===this.tagNumber},e}(),x=[2,3,5,7,11,13,17,19,23,29,31,37,41,43,47,53,59,61,67,71,73,79,83,89,97,101,103,107,109,113,127,131,137,139,149,151,157,163,167,173,179,181,191,193,197,199,211,223,227,229,233,239,241,251,257,263,269,271,277,281,283,293,307,311,313,317,331,337,347,349,353,359,367,373,379,383,389,397,401,409,419,421,431,433,439,443,449,457,461,463,467,479,487,491,499,503,509,521,523,541,547,557,563,569,571,577,587,593,599,601,607,613,617,619,631,641,643,647,653,659,661,673,677,683,691,701,709,719,727,733,739,743,751,757,761,769,773,787,797,809,811,821,823,827,829,839,853,857,859,863,877,881,883,887,907,911,919,929,937,941,947,953,967,971,977,983,991,997],I=(1<<26)/x[x.length-1],_=function(){function e(e,t,n){null!=e&&("number"==typeof e?this.fromNumber(e,t,n):null==t&&"string"!=typeof e?this.fromString(e,256):this.fromString(e,t))}return e.prototype.toString=function(e){if(this.s<0)return"-"+this.negate().toString(e);var n;if(16==e)n=4;else if(8==e)n=3;else if(2==e)n=1;else if(32==e)n=5;else{if(4!=e)return this.toRadix(e);n=2}var r,i=(1<<n)-1,o=!1,a="",s=this.t,c=this.DB-s*this.DB%n;if(s-- >0)for(c<this.DB&&(r=this[s]>>c)>0&&(o=!0,a=t(r));s>=0;)c<n?(r=(this[s]&(1<<c)-1)<<n-c,r|=this[--s]>>(c+=this.DB-n)):(r=this[s]>>(c-=n)&i,c<=0&&(c+=this.DB,--s)),r>0&&(o=!0),o&&(a+=t(r));return o?a:"0"},e.prototype.negate=function(){var t=D();return e.ZERO.subTo(this,t),t},e.prototype.abs=function(){return this.s<0?this.negate():this},e.prototype.compareTo=function(e){var t=this.s-e.s;if(0!=t)return t;var n=this.t;if(0!=(t=n-e.t))return this.s<0?-t:t;for(;--n>=0;)if(0!=(t=this[n]-e[n]))return t;return 0},e.prototype.bitLength=function(){return this.t<=0?0:this.DB*(this.t-1)+j(this[this.t-1]^this.s&this.DM)},e.prototype.mod=function(t){var n=D();return this.abs().divRemTo(t,null,n),this.s<0&&n.compareTo(e.ZERO)>0&&t.subTo(n,n),n},e.prototype.modPowInt=function(e,t){var n;return n=e<256||t.isEven()?new T(t):new R(t),this.exp(e,n)},e.prototype.clone=function(){var e=D();return this.copyTo(e),e},e.prototype.intValue=function(){if(this.s<0){if(1==this.t)return this[0]-this.DV;if(0==this.t)return-1}else{if(1==this.t)return this[0];if(0==this.t)return 0}return(this[1]&(1<<32-this.DB)-1)<<this.DB|this[0]},e.prototype.byteValue=function(){return 0==this.t?this.s:this[0]<<24>>24},e.prototype.shortValue=function(){return 0==this.t?this.s:this[0]<<16>>16},e.prototype.signum=function(){return this.s<0?-1:this.t<=0||1==this.t&&this[0]<=0?0:1},e.prototype.toByteArray=function(){var e=this.t,t=[];t[0]=this.s;var n,r=this.DB-e*this.DB%8,i=0;if(e-- >0)for(r<this.DB&&(n=this[e]>>r)!=(this.s&this.DM)>>r&&(t[i++]=n|this.s<<this.DB-r);e>=0;)r<8?(n=(this[e]&(1<<r)-1)<<8-r,n|=this[--e]>>(r+=this.DB-8)):(n=this[e]>>(r-=8)&255,r<=0&&(r+=this.DB,--e)),0!=(128&n)&&(n|=-256),0==i&&(128&this.s)!=(128&n)&&++i,(i>0||n!=this.s)&&(t[i++]=n);return t},e.prototype.equals=function(e){return 0==this.compareTo(e)},e.prototype.min=function(e){return this.compareTo(e)<0?this:e},e.prototype.max=function(e){return this.compareTo(e)>0?this:e},e.prototype.and=function(e){var t=D();return this.bitwiseTo(e,n,t),t},e.prototype.or=function(e){var t=D();return this.bitwiseTo(e,r,t),t},e.prototype.xor=function(e){var t=D();return this.bitwiseTo(e,i,t),t},e.prototype.andNot=function(e){var t=D();return this.bitwiseTo(e,o,t),t},e.prototype.not=function(){for(var e=D(),t=0;t<this.t;++t)e[t]=this.DM&~this[t];return e.t=this.t,e.s=~this.s,e},e.prototype.shiftLeft=function(e){var t=D();return e<0?this.rShiftTo(-e,t):this.lShiftTo(e,t),t},e.prototype.shiftRight=function(e){var t=D();return e<0?this.lShiftTo(-e,t):this.rShiftTo(e,t),t},e.prototype.getLowestSetBit=function(){for(var e=0;e<this.t;++e)if(0!=this[e])return e*this.DB+a(this[e]);return this.s<0?this.t*this.DB:-1},e.prototype.bitCount=function(){for(var e=0,t=this.s&this.DM,n=0;n<this.t;++n)e+=s(this[n]^t);return e},e.prototype.testBit=function(e){var t=Math.floor(e/this.DB);return t>=this.t?0!=this.s:0!=(this[t]&1<<e%this.DB)},e.prototype.setBit=function(e){return this.changeBit(e,r)},e.prototype.clearBit=function(e){return this.changeBit(e,o)},e.prototype.flipBit=function(e){return this.changeBit(e,i)},e.prototype.add=function(e){var t=D();return this.addTo(e,t),t},e.prototype.subtract=function(e){var t=D();return this.subTo(e,t),t},e.prototype.multiply=function(e){var t=D();return this.multiplyTo(e,t),t},e.prototype.divide=function(e){var t=D();return this.divRemTo(e,t,null),t},e.prototype.remainder=function(e){var t=D();return this.divRemTo(e,null,t),t},e.prototype.divideAndRemainder=function(e){var t=D(),n=D();return this.divRemTo(e,t,n),[t,n]},e.prototype.modPow=function(e,t){var n,r,i=e.bitLength(),o=G(1);if(i<=0)return o;n=i<18?1:i<48?3:i<144?4:i<768?5:6,r=i<8?new T(t):t.isEven()?new O(t):new R(t);var a=[],s=3,c=n-1,u=(1<<n)-1;if(a[1]=r.convert(this),n>1){var l=D();for(r.sqrTo(a[1],l);s<=u;)a[s]=D(),r.mulTo(l,a[s-2],a[s]),s+=2}var h,d,f=e.t-1,p=!0,v=D();for(i=j(e[f])-1;f>=0;){for(i>=c?h=e[f]>>i-c&u:(h=(e[f]&(1<<i+1)-1)<<c-i,f>0&&(h|=e[f-1]>>this.DB+i-c)),s=n;0==(1&h);)h>>=1,--s;if((i-=s)<0&&(i+=this.DB,--f),p)a[h].copyTo(o),p=!1;else{for(;s>1;)r.sqrTo(o,v),r.sqrTo(v,o),s-=2;s>0?r.sqrTo(o,v):(d=o,o=v,v=d),r.mulTo(v,a[h],o)}for(;f>=0&&0==(e[f]&1<<i);)r.sqrTo(o,v),d=o,o=v,v=d,--i<0&&(i=this.DB-1,--f)}return r.revert(o)},e.prototype.modInverse=function(t){var n=t.isEven();if(this.isEven()&&n||0==t.signum())return e.ZERO;for(var r=t.clone(),i=this.clone(),o=G(1),a=G(0),s=G(0),c=G(1);0!=r.signum();){for(;r.isEven();)r.rShiftTo(1,r),n?(o.isEven()&&a.isEven()||(o.addTo(this,o),a.subTo(t,a)),o.rShiftTo(1,o)):a.isEven()||a.subTo(t,a),a.rShiftTo(1,a);for(;i.isEven();)i.rShiftTo(1,i),n?(s.isEven()&&c.isEven()||(s.addTo(this,s),c.subTo(t,c)),s.rShiftTo(1,s)):c.isEven()||c.subTo(t,c),c.rShiftTo(1,c);r.compareTo(i)>=0?(r.subTo(i,r),n&&o.subTo(s,o),a.subTo(c,a)):(i.subTo(r,i),n&&s.subTo(o,s),c.subTo(a,c))}return 0!=i.compareTo(e.ONE)?e.ZERO:c.compareTo(t)>=0?c.subtract(t):c.signum()<0?(c.addTo(t,c),c.signum()<0?c.add(t):c):c},e.prototype.pow=function(e){return this.exp(e,new A)},e.prototype.gcd=function(e){var t=this.s<0?this.negate():this.clone(),n=e.s<0?e.negate():e.clone();if(t.compareTo(n)<0){var r=t;t=n,n=r}var i=t.getLowestSetBit(),o=n.getLowestSetBit();if(o<0)return t;for(i<o&&(o=i),o>0&&(t.rShiftTo(o,t),n.rShiftTo(o,n));t.signum()>0;)(i=t.getLowestSetBit())>0&&t.rShiftTo(i,t),(i=n.getLowestSetBit())>0&&n.rShiftTo(i,n),t.compareTo(n)>=0?(t.subTo(n,t),t.rShiftTo(1,t)):(n.subTo(t,n),n.rShiftTo(1,n));return o>0&&n.lShiftTo(o,n),n},e.prototype.isProbablePrime=function(e){var t,n=this.abs();if(1==n.t&&n[0]<=x[x.length-1]){for(t=0;t<x.length;++t)if(n[0]==x[t])return!0;return!1}if(n.isEven())return!1;for(t=1;t<x.length;){for(var r=x[t],i=t+1;i<x.length&&r<I;)r*=x[i++];for(r=n.modInt(r);t<i;)if(r%x[t++]==0)return!1}return n.millerRabin(e)},e.prototype.copyTo=function(e){for(var t=this.t-1;t>=0;--t)e[t]=this[t];e.t=this.t,e.s=this.s},e.prototype.fromInt=function(e){this.t=1,this.s=e<0?-1:0,e>0?this[0]=e:e<-1?this[0]=e+this.DV:this.t=0},e.prototype.fromString=function(t,n){var r;if(16==n)r=4;else if(8==n)r=3;else if(256==n)r=8;else if(2==n)r=1;else if(32==n)r=5;else{if(4!=n)return void this.fromRadix(t,n);r=2}this.t=0,this.s=0;for(var i=t.length,o=!1,a=0;--i>=0;){var s=8==r?255&+t[i]:B(t,i);s<0?"-"==t.charAt(i)&&(o=!0):(o=!1,0==a?this[this.t++]=s:a+r>this.DB?(this[this.t-1]|=(s&(1<<this.DB-a)-1)<<a,this[this.t++]=s>>this.DB-a):this[this.t-1]|=s<<a,(a+=r)>=this.DB&&(a-=this.DB))}8==r&&0!=(128&+t[0])&&(this.s=-1,a>0&&(this[this.t-1]|=(1<<this.DB-a)-1<<a)),this.clamp(),o&&e.ZERO.subTo(this,this)},e.prototype.clamp=function(){for(var e=this.s&this.DM;this.t>0&&this[this.t-1]==e;)--this.t},e.prototype.dlShiftTo=function(e,t){var n;for(n=this.t-1;n>=0;--n)t[n+e]=this[n];for(n=e-1;n>=0;--n)t[n]=0;t.t=this.t+e,t.s=this.s},e.prototype.drShiftTo=function(e,t){for(var n=e;n<this.t;++n)t[n-e]=this[n];t.t=Math.max(this.t-e,0),t.s=this.s},e.prototype.lShiftTo=function(e,t){for(var n=e%this.DB,r=this.DB-n,i=(1<<r)-1,o=Math.floor(e/this.DB),a=this.s<<n&this.DM,s=this.t-1;s>=0;--s)t[s+o+1]=this[s]>>r|a,a=(this[s]&i)<<n;for(s=o-1;s>=0;--s)t[s]=0;t[o]=a,t.t=this.t+o+1,t.s=this.s,t.clamp()},e.prototype.rShiftTo=function(e,t){t.s=this.s;var n=Math.floor(e/this.DB);if(n>=this.t)t.t=0;else{var r=e%this.DB,i=this.DB-r,o=(1<<r)-1;t[0]=this[n]>>r;for(var a=n+1;a<this.t;++a)t[a-n-1]|=(this[a]&o)<<i,t[a-n]=this[a]>>r;r>0&&(t[this.t-n-1]|=(this.s&o)<<i),t.t=this.t-n,t.clamp()}},e.prototype.subTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]-e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r-=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r-=e[n],t[n++]=r&this.DM,r>>=this.DB;r-=e.s}t.s=r<0?-1:0,r<-1?t[n++]=this.DV+r:r>0&&(t[n++]=r),t.t=n,t.clamp()},e.prototype.multiplyTo=function(t,n){var r=this.abs(),i=t.abs(),o=r.t;for(n.t=o+i.t;--o>=0;)n[o]=0;for(o=0;o<i.t;++o)n[o+r.t]=r.am(0,i[o],n,o,0,r.t);n.s=0,n.clamp(),this.s!=t.s&&e.ZERO.subTo(n,n)},e.prototype.squareTo=function(e){for(var t=this.abs(),n=e.t=2*t.t;--n>=0;)e[n]=0;for(n=0;n<t.t-1;++n){var r=t.am(n,t[n],e,2*n,0,1);(e[n+t.t]+=t.am(n+1,2*t[n],e,2*n+1,r,t.t-n-1))>=t.DV&&(e[n+t.t]-=t.DV,e[n+t.t+1]=1)}e.t>0&&(e[e.t-1]+=t.am(n,t[n],e,2*n,0,1)),e.s=0,e.clamp()},e.prototype.divRemTo=function(t,n,r){var i=t.abs();if(!(i.t<=0)){var o=this.abs();if(o.t<i.t)return null!=n&&n.fromInt(0),void(null!=r&&this.copyTo(r));null==r&&(r=D());var a=D(),s=this.s,c=t.s,u=this.DB-j(i[i.t-1]);u>0?(i.lShiftTo(u,a),o.lShiftTo(u,r)):(i.copyTo(a),o.copyTo(r));var l=a.t,h=a[l-1];if(0!=h){var d=h*(1<<this.F1)+(l>1?a[l-2]>>this.F2:0),f=this.FV/d,p=(1<<this.F1)/d,v=1<<this.F2,g=r.t,m=g-l,y=null==n?D():n;for(a.dlShiftTo(m,y),r.compareTo(y)>=0&&(r[r.t++]=1,r.subTo(y,r)),e.ONE.dlShiftTo(l,y),y.subTo(a,a);a.t<l;)a[a.t++]=0;for(;--m>=0;){var b=r[--g]==h?this.DM:Math.floor(r[g]*f+(r[g-1]+v)*p);if((r[g]+=a.am(0,b,r,m,0,l))<b)for(a.dlShiftTo(m,y),r.subTo(y,r);r[g]<--b;)r.subTo(y,r)}null!=n&&(r.drShiftTo(l,n),s!=c&&e.ZERO.subTo(n,n)),r.t=l,r.clamp(),u>0&&r.rShiftTo(u,r),s<0&&e.ZERO.subTo(r,r)}}},e.prototype.invDigit=function(){if(this.t<1)return 0;var e=this[0];if(0==(1&e))return 0;var t=3&e;return(t=(t=(t=(t=t*(2-(15&e)*t)&15)*(2-(255&e)*t)&255)*(2-((65535&e)*t&65535))&65535)*(2-e*t%this.DV)%this.DV)>0?this.DV-t:-t},e.prototype.isEven=function(){return 0==(this.t>0?1&this[0]:this.s)},e.prototype.exp=function(t,n){if(t>4294967295||t<1)return e.ONE;var r=D(),i=D(),o=n.convert(this),a=j(t)-1;for(o.copyTo(r);--a>=0;)if(n.sqrTo(r,i),(t&1<<a)>0)n.mulTo(i,o,r);else{var s=r;r=i,i=s}return n.revert(r)},e.prototype.chunkSize=function(e){return Math.floor(Math.LN2*this.DB/Math.log(e))},e.prototype.toRadix=function(e){if(null==e&&(e=10),0==this.signum()||e<2||e>36)return"0";var t=this.chunkSize(e),n=Math.pow(e,t),r=G(n),i=D(),o=D(),a="";for(this.divRemTo(r,i,o);i.signum()>0;)a=(n+o.intValue()).toString(e).substr(1)+a,i.divRemTo(r,i,o);return o.intValue().toString(e)+a},e.prototype.fromRadix=function(t,n){this.fromInt(0),null==n&&(n=10);for(var r=this.chunkSize(n),i=Math.pow(n,r),o=!1,a=0,s=0,c=0;c<t.length;++c){var u=B(t,c);u<0?"-"==t.charAt(c)&&0==this.signum()&&(o=!0):(s=n*s+u,++a>=r&&(this.dMultiply(i),this.dAddOffset(s,0),a=0,s=0))}a>0&&(this.dMultiply(Math.pow(n,a)),this.dAddOffset(s,0)),o&&e.ZERO.subTo(this,this)},e.prototype.fromNumber=function(t,n,i){if("number"==typeof n)if(t<2)this.fromInt(1);else for(this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),r,this),this.isEven()&&this.dAddOffset(1,0);!this.isProbablePrime(n);)this.dAddOffset(2,0),this.bitLength()>t&&this.subTo(e.ONE.shiftLeft(t-1),this);else{var o=[],a=7&t;o.length=1+(t>>3),n.nextBytes(o),a>0?o[0]&=(1<<a)-1:o[0]=0,this.fromString(o,256)}},e.prototype.bitwiseTo=function(e,t,n){var r,i,o=Math.min(e.t,this.t);for(r=0;r<o;++r)n[r]=t(this[r],e[r]);if(e.t<this.t){for(i=e.s&this.DM,r=o;r<this.t;++r)n[r]=t(this[r],i);n.t=this.t}else{for(i=this.s&this.DM,r=o;r<e.t;++r)n[r]=t(i,e[r]);n.t=e.t}n.s=t(this.s,e.s),n.clamp()},e.prototype.changeBit=function(t,n){var r=e.ONE.shiftLeft(t);return this.bitwiseTo(r,n,r),r},e.prototype.addTo=function(e,t){for(var n=0,r=0,i=Math.min(e.t,this.t);n<i;)r+=this[n]+e[n],t[n++]=r&this.DM,r>>=this.DB;if(e.t<this.t){for(r+=e.s;n<this.t;)r+=this[n],t[n++]=r&this.DM,r>>=this.DB;r+=this.s}else{for(r+=this.s;n<e.t;)r+=e[n],t[n++]=r&this.DM,r>>=this.DB;r+=e.s}t.s=r<0?-1:0,r>0?t[n++]=r:r<-1&&(t[n++]=this.DV+r),t.t=n,t.clamp()},e.prototype.dMultiply=function(e){this[this.t]=this.am(0,e-1,this,0,0,this.t),++this.t,this.clamp()},e.prototype.dAddOffset=function(e,t){if(0!=e){for(;this.t<=t;)this[this.t++]=0;for(this[t]+=e;this[t]>=this.DV;)this[t]-=this.DV,++t>=this.t&&(this[this.t++]=0),++this[t]}},e.prototype.multiplyLowerTo=function(e,t,n){var r=Math.min(this.t+e.t,t);for(n.s=0,n.t=r;r>0;)n[--r]=0;for(var i=n.t-this.t;r<i;++r)n[r+this.t]=this.am(0,e[r],n,r,0,this.t);for(i=Math.min(e.t,t);r<i;++r)this.am(0,e[r],n,r,0,t-r);n.clamp()},e.prototype.multiplyUpperTo=function(e,t,n){--t;var r=n.t=this.t+e.t-t;for(n.s=0;--r>=0;)n[r]=0;for(r=Math.max(t-this.t,0);r<e.t;++r)n[this.t+r-t]=this.am(t-r,e[r],n,0,0,this.t+r-t);n.clamp(),n.drShiftTo(1,n)},e.prototype.modInt=function(e){if(e<=0)return 0;var t=this.DV%e,n=this.s<0?e-1:0;if(this.t>0)if(0==t)n=this[0]%e;else for(var r=this.t-1;r>=0;--r)n=(t*n+this[r])%e;return n},e.prototype.millerRabin=function(t){var n=this.subtract(e.ONE),r=n.getLowestSetBit();if(r<=0)return!1;var i=n.shiftRight(r);(t=t+1>>1)>x.length&&(t=x.length);for(var o=D(),a=0;a<t;++a){o.fromInt(x[Math.floor(Math.random()*x.length)]);var s=o.modPow(i,this);if(0!=s.compareTo(e.ONE)&&0!=s.compareTo(n)){for(var c=1;c++<r&&0!=s.compareTo(n);)if(0==(s=s.modPowInt(2,this)).compareTo(e.ONE))return!1;if(0!=s.compareTo(n))return!1}}return!0},e.prototype.square=function(){var e=D();return this.squareTo(e),e},e.prototype.gcda=function(e,t){var n=this.s<0?this.negate():this.clone(),r=e.s<0?e.negate():e.clone();if(n.compareTo(r)<0){var i=n;n=r,r=i}var o=n.getLowestSetBit(),a=r.getLowestSetBit();if(a<0)t(n);else{o<a&&(a=o),a>0&&(n.rShiftTo(a,n),r.rShiftTo(a,r));var s=function(){(o=n.getLowestSetBit())>0&&n.rShiftTo(o,n),(o=r.getLowestSetBit())>0&&r.rShiftTo(o,r),n.compareTo(r)>=0?(n.subTo(r,n),n.rShiftTo(1,n)):(r.subTo(n,r),r.rShiftTo(1,r)),n.signum()>0?setTimeout(s,0):(a>0&&r.lShiftTo(a,r),setTimeout((function(){t(r)}),0))};setTimeout(s,10)}},e.prototype.fromNumberAsync=function(t,n,i,o){if("number"==typeof n)if(t<2)this.fromInt(1);else{this.fromNumber(t,i),this.testBit(t-1)||this.bitwiseTo(e.ONE.shiftLeft(t-1),r,this),this.isEven()&&this.dAddOffset(1,0);var a=this,s=function(){a.dAddOffset(2,0),a.bitLength()>t&&a.subTo(e.ONE.shiftLeft(t-1),a),a.isProbablePrime(n)?setTimeout((function(){o()}),0):setTimeout(s,0)};setTimeout(s,0)}else{var c=[],u=7&t;c.length=1+(t>>3),n.nextBytes(c),u>0?c[0]&=(1<<u)-1:c[0]=0,this.fromString(c,256)}},e}(),A=function(){function e(){}return e.prototype.convert=function(e){return e},e.prototype.revert=function(e){return e},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n)},e.prototype.sqrTo=function(e,t){e.squareTo(t)},e}(),T=function(){function e(e){this.m=e}return e.prototype.convert=function(e){return e.s<0||e.compareTo(this.m)>=0?e.mod(this.m):e},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){e.divRemTo(this.m,null,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),R=function(){function e(e){this.m=e,this.mp=e.invDigit(),this.mpl=32767&this.mp,this.mph=this.mp>>15,this.um=(1<<e.DB-15)-1,this.mt2=2*e.t}return e.prototype.convert=function(e){var t=D();return e.abs().dlShiftTo(this.m.t,t),t.divRemTo(this.m,null,t),e.s<0&&t.compareTo(_.ZERO)>0&&this.m.subTo(t,t),t},e.prototype.revert=function(e){var t=D();return e.copyTo(t),this.reduce(t),t},e.prototype.reduce=function(e){for(;e.t<=this.mt2;)e[e.t++]=0;for(var t=0;t<this.m.t;++t){var n=32767&e[t],r=n*this.mpl+((n*this.mph+(e[t]>>15)*this.mpl&this.um)<<15)&e.DM;for(e[n=t+this.m.t]+=this.m.am(0,r,e,t,0,this.m.t);e[n]>=e.DV;)e[n]-=e.DV,e[++n]++}e.clamp(),e.drShiftTo(this.m.t,e),e.compareTo(this.m)>=0&&e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}(),O=function(){function e(e){this.m=e,this.r2=D(),this.q3=D(),_.ONE.dlShiftTo(2*e.t,this.r2),this.mu=this.r2.divide(e)}return e.prototype.convert=function(e){if(e.s<0||e.t>2*this.m.t)return e.mod(this.m);if(e.compareTo(this.m)<0)return e;var t=D();return e.copyTo(t),this.reduce(t),t},e.prototype.revert=function(e){return e},e.prototype.reduce=function(e){for(e.drShiftTo(this.m.t-1,this.r2),e.t>this.m.t+1&&(e.t=this.m.t+1,e.clamp()),this.mu.multiplyUpperTo(this.r2,this.m.t+1,this.q3),this.m.multiplyLowerTo(this.q3,this.m.t+1,this.r2);e.compareTo(this.r2)<0;)e.dAddOffset(1,this.m.t+1);for(e.subTo(this.r2,e);e.compareTo(this.m)>=0;)e.subTo(this.m,e)},e.prototype.mulTo=function(e,t,n){e.multiplyTo(t,n),this.reduce(n)},e.prototype.sqrTo=function(e,t){e.squareTo(t),this.reduce(t)},e}();function D(){return new _(null)}function N(e,t){return new _(e,t)}"Microsoft Internet Explorer"==navigator.appName?(_.prototype.am=function(e,t,n,r,i,o){for(var a=32767&t,s=t>>15;--o>=0;){var c=32767&this[e],u=this[e++]>>15,l=s*c+u*a;i=((c=a*c+((32767&l)<<15)+n[r]+(1073741823&i))>>>30)+(l>>>15)+s*u+(i>>>30),n[r++]=1073741823&c}return i},w=30):"Netscape"!=navigator.appName?(_.prototype.am=function(e,t,n,r,i,o){for(;--o>=0;){var a=t*this[e++]+n[r]+i;i=Math.floor(a/67108864),n[r++]=67108863&a}return i},w=26):(_.prototype.am=function(e,t,n,r,i,o){for(var a=16383&t,s=t>>14;--o>=0;){var c=16383&this[e],u=this[e++]>>14,l=s*c+u*a;i=((c=a*c+((16383&l)<<14)+n[r]+i)>>28)+(l>>14)+s*u,n[r++]=268435455&c}return i},w=28),_.prototype.DB=w,_.prototype.DM=(1<<w)-1,_.prototype.DV=1<<w,_.prototype.FV=Math.pow(2,52),_.prototype.F1=52-w,_.prototype.F2=2*w-52;var L,P,M=[];for(L="0".charCodeAt(0),P=0;P<=9;++P)M[L++]=P;for(L="a".charCodeAt(0),P=10;P<36;++P)M[L++]=P;for(L="A".charCodeAt(0),P=10;P<36;++P)M[L++]=P;function B(e,t){var n=M[e.charCodeAt(t)];return null==n?-1:n}function G(e){var t=D();return t.fromInt(e),t}function j(e){var t,n=1;return 0!=(t=e>>>16)&&(e=t,n+=16),0!=(t=e>>8)&&(e=t,n+=8),0!=(t=e>>4)&&(e=t,n+=4),0!=(t=e>>2)&&(e=t,n+=2),0!=(t=e>>1)&&(e=t,n+=1),n}_.ZERO=G(0),_.ONE=G(1);var H,U,K=function(){function e(){this.i=0,this.j=0,this.S=[]}return e.prototype.init=function(e){var t,n,r;for(t=0;t<256;++t)this.S[t]=t;for(n=0,t=0;t<256;++t)n=n+this.S[t]+e[t%e.length]&255,r=this.S[t],this.S[t]=this.S[n],this.S[n]=r;this.i=0,this.j=0},e.prototype.next=function(){var e;return this.i=this.i+1&255,this.j=this.j+this.S[this.i]&255,e=this.S[this.i],this.S[this.i]=this.S[this.j],this.S[this.j]=e,this.S[e+this.S[this.i]&255]},e}(),F=null;if(null==F){F=[],U=0;var z=void 0;if(window.crypto&&window.crypto.getRandomValues){var Y=new Uint32Array(256);for(window.crypto.getRandomValues(Y),z=0;z<Y.length;++z)F[U++]=255&Y[z]}var V=function(e){if(this.count=this.count||0,this.count>=256||U>=256)window.removeEventListener?window.removeEventListener("mousemove",V,!1):window.detachEvent&&window.detachEvent("onmousemove",V);else try{var t=e.x+e.y;F[U++]=255&t,this.count+=1}catch(e){}};window.addEventListener?window.addEventListener("mousemove",V,!1):window.attachEvent&&window.attachEvent("onmousemove",V)}function X(){if(null==H){for(H=new K;U<256;){var e=Math.floor(65536*Math.random());F[U++]=255&e}for(H.init(F),U=0;U<F.length;++U)F[U]=0;U=0}return H.next()}var W=function(){function e(){}return e.prototype.nextBytes=function(e){for(var t=0;t<e.length;++t)e[t]=X()},e}(),q=function(){function e(){this.n=null,this.e=0,this.d=null,this.p=null,this.q=null,this.dmp1=null,this.dmq1=null,this.coeff=null}return e.prototype.doPublic=function(e){return e.modPowInt(this.e,this.n)},e.prototype.doPrivate=function(e){if(null==this.p||null==this.q)return e.modPow(this.d,this.n);for(var t=e.mod(this.p).modPow(this.dmp1,this.p),n=e.mod(this.q).modPow(this.dmq1,this.q);t.compareTo(n)<0;)t=t.add(this.p);return t.subtract(n).multiply(this.coeff).mod(this.p).multiply(this.q).add(n)},e.prototype.setPublic=function(e,t){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16)):console.error("Invalid RSA public key")},e.prototype.encrypt=function(e){var t=function(e,t){if(t<e.length+11)return console.error("Message too long for RSA"),null;for(var n=[],r=e.length-1;r>=0&&t>0;){var i=e.charCodeAt(r--);i<128?n[--t]=i:i>127&&i<2048?(n[--t]=63&i|128,n[--t]=i>>6|192):(n[--t]=63&i|128,n[--t]=i>>6&63|128,n[--t]=i>>12|224)}n[--t]=0;for(var o=new W,a=[];t>2;){for(a[0]=0;0==a[0];)o.nextBytes(a);n[--t]=a[0]}return n[--t]=2,n[--t]=0,new _(n)}(e,this.n.bitLength()+7>>3);if(null==t)return null;var n=this.doPublic(t);if(null==n)return null;var r=n.toString(16);return 0==(1&r.length)?r:"0"+r},e.prototype.encryptLong=function(e){var t=this,n=(this.n.bitLength()+7>>3)-11;try{var r="";return e.length>n?(e.match(/.{1,117}/g).forEach((function(e){var n=t.encrypt(e);r+=n})),u(r)):u(this.encrypt(e))}catch(e){return!1}},e.prototype.decryptLong=function(e){var t=this,n=this.n.bitLength()+7>>3;e=l(e);try{if(e.length>n){var r="";return e.match(/.{1,256}/g).forEach((function(e){var n=t.decrypt(e);r+=n})),r}return this.decrypt(e)}catch(e){return!1}},e.prototype.setPrivate=function(e,t,n){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16),this.d=N(n,16)):console.error("Invalid RSA private key")},e.prototype.setPrivateEx=function(e,t,n,r,i,o,a,s){null!=e&&null!=t&&e.length>0&&t.length>0?(this.n=N(e,16),this.e=parseInt(t,16),this.d=N(n,16),this.p=N(r,16),this.q=N(i,16),this.dmp1=N(o,16),this.dmq1=N(a,16),this.coeff=N(s,16)):console.error("Invalid RSA private key")},e.prototype.generate=function(e,t){var n=new W,r=e>>1;this.e=parseInt(t,16);for(var i=new _(t,16);;){for(;this.p=new _(e-r,1,n),0!=this.p.subtract(_.ONE).gcd(i).compareTo(_.ONE)||!this.p.isProbablePrime(10););for(;this.q=new _(r,1,n),0!=this.q.subtract(_.ONE).gcd(i).compareTo(_.ONE)||!this.q.isProbablePrime(10););if(this.p.compareTo(this.q)<=0){var o=this.p;this.p=this.q,this.q=o}var a=this.p.subtract(_.ONE),s=this.q.subtract(_.ONE),c=a.multiply(s);if(0==c.gcd(i).compareTo(_.ONE)){this.n=this.p.multiply(this.q),this.d=i.modInverse(c),this.dmp1=this.d.mod(a),this.dmq1=this.d.mod(s),this.coeff=this.q.modInverse(this.p);break}}},e.prototype.decrypt=function(e){var t=N(e,16),n=this.doPrivate(t);return null==n?null:function(e,t){for(var n=e.toByteArray(),r=0;r<n.length&&0==n[r];)++r;if(n.length-r!=t-1||2!=n[r])return null;for(++r;0!=n[r];)if(++r>=n.length)return null;for(var i="";++r<n.length;){var o=255&n[r];o<128?i+=String.fromCharCode(o):o>191&&o<224?(i+=String.fromCharCode((31&o)<<6|63&n[r+1]),++r):(i+=String.fromCharCode((15&o)<<12|(63&n[r+1])<<6|63&n[r+2]),r+=2)}return i}(n,this.n.bitLength()+7>>3)},e.prototype.generateAsync=function(e,t,n){var r=new W,i=e>>1;this.e=parseInt(t,16);var o=new _(t,16),a=this,s=function(){var t=function(){if(a.p.compareTo(a.q)<=0){var e=a.p;a.p=a.q,a.q=e}var t=a.p.subtract(_.ONE),r=a.q.subtract(_.ONE),i=t.multiply(r);0==i.gcd(o).compareTo(_.ONE)?(a.n=a.p.multiply(a.q),a.d=o.modInverse(i),a.dmp1=a.d.mod(t),a.dmq1=a.d.mod(r),a.coeff=a.q.modInverse(a.p),setTimeout((function(){n()}),0)):setTimeout(s,0)},c=function(){a.q=D(),a.q.fromNumberAsync(i,1,r,(function(){a.q.subtract(_.ONE).gcda(o,(function(e){0==e.compareTo(_.ONE)&&a.q.isProbablePrime(10)?setTimeout(t,0):setTimeout(c,0)}))}))},u=function(){a.p=D(),a.p.fromNumberAsync(e-i,1,r,(function(){a.p.subtract(_.ONE).gcda(o,(function(e){0==e.compareTo(_.ONE)&&a.p.isProbablePrime(10)?setTimeout(c,0):setTimeout(u,0)}))}))};setTimeout(u,0)};setTimeout(s,0)},e.prototype.sign=function(e,t,n){var r=function(e,t){if(t<e.length+22)return console.error("Message too long for RSA"),null;for(var n=t-e.length-6,r="",i=0;i<n;i+=2)r+="ff";return N("0001"+r+"00"+e,16)}((Z[n]||"")+t(e).toString(),this.n.bitLength()/4);if(null==r)return null;var i=this.doPrivate(r);if(null==i)return null;var o=i.toString(16);return 0==(1&o.length)?o:"0"+o},e.prototype.verify=function(e,t,n){var r=N(t,16),i=this.doPublic(r);return null==i?null:function(e){for(var t in Z)if(Z.hasOwnProperty(t)){var n=Z[t],r=n.length;if(e.substr(0,r)==n)return e.substr(r)}return e}(i.toString(16).replace(/^1f+00/,""))==n(e).toString()},e}(),Z={md2:"3020300c06082a864886f70d020205000410",md5:"3020300c06082a864886f70d020505000410",sha1:"3021300906052b0e03021a05000414",sha224:"302d300d06096086480165030402040500041c",sha256:"3031300d060960864801650304020105000420",sha384:"3041300d060960864801650304020205000430",sha512:"3051300d060960864801650304020305000440",ripemd160:"3021300906052b2403020105000414"},J={};J.lang={extend:function(e,t,n){if(!t||!e)throw new Error("YAHOO.lang.extend failed, please check that all dependencies are included.");var r=function(){};if(r.prototype=t.prototype,e.prototype=new r,e.prototype.constructor=e,e.superclass=t.prototype,t.prototype.constructor==Object.prototype.constructor&&(t.prototype.constructor=t),n){var i;for(i in n)e.prototype[i]=n[i];var o=function(){},a=["toString","valueOf"];try{/MSIE/.test(navigator.userAgent)&&(o=function(e,t){for(i=0;i<a.length;i+=1){var n=a[i],r=t[n];"function"==typeof r&&r!=Object.prototype[n]&&(e[n]=r)}})}catch(e){}o(e.prototype,n)}}};var $={};void 0!==$.asn1&&$.asn1||($.asn1={}),$.asn1.ASN1Util=new function(){this.integerToByteHex=function(e){var t=e.toString(16);return t.length%2==1&&(t="0"+t),t},this.bigIntToMinTwosComplementsHex=function(e){var t=e.toString(16);if("-"!=t.substr(0,1))t.length%2==1?t="0"+t:t.match(/^[0-7]/)||(t="00"+t);else{var n=t.substr(1).length;n%2==1?n+=1:t.match(/^[0-7]/)||(n+=2);for(var r="",i=0;i<n;i++)r+="f";t=new _(r,16).xor(e).add(_.ONE).toString(16).replace(/^-/,"")}return t},this.getPEMStringFromHex=function(e,t){return hextopem(e,t)},this.newObject=function(e){var t=$.asn1,n=t.DERBoolean,r=t.DERInteger,i=t.DERBitString,o=t.DEROctetString,a=t.DERNull,s=t.DERObjectIdentifier,c=t.DEREnumerated,u=t.DERUTF8String,l=t.DERNumericString,h=t.DERPrintableString,d=t.DERTeletexString,f=t.DERIA5String,p=t.DERUTCTime,v=t.DERGeneralizedTime,g=t.DERSequence,m=t.DERSet,y=t.DERTaggedObject,b=t.ASN1Util.newObject,S=Object.keys(e);if(1!=S.length)throw"key of param shall be only one.";var w=S[0];if(-1==":bool:int:bitstr:octstr:null:oid:enum:utf8str:numstr:prnstr:telstr:ia5str:utctime:gentime:seq:set:tag:".indexOf(":"+w+":"))throw"undefined key: "+w;if("bool"==w)return new n(e[w]);if("int"==w)return new r(e[w]);if("bitstr"==w)return new i(e[w]);if("octstr"==w)return new o(e[w]);if("null"==w)return new a(e[w]);if("oid"==w)return new s(e[w]);if("enum"==w)return new c(e[w]);if("utf8str"==w)return new u(e[w]);if("numstr"==w)return new l(e[w]);if("prnstr"==w)return new h(e[w]);if("telstr"==w)return new d(e[w]);if("ia5str"==w)return new f(e[w]);if("utctime"==w)return new p(e[w]);if("gentime"==w)return new v(e[w]);if("seq"==w){for(var k=e[w],C=[],E=0;E<k.length;E++){var x=b(k[E]);C.push(x)}return new g({array:C})}if("set"==w){for(k=e[w],C=[],E=0;E<k.length;E++)x=b(k[E]),C.push(x);return new m({array:C})}if("tag"==w){var I=e[w];if("[object Array]"===Object.prototype.toString.call(I)&&3==I.length){var _=b(I[2]);return new y({tag:I[0],explicit:I[1],obj:_})}var A={};if(void 0!==I.explicit&&(A.explicit=I.explicit),void 0!==I.tag&&(A.tag=I.tag),void 0===I.obj)throw"obj shall be specified for 'tag'.";return A.obj=b(I.obj),new y(A)}},this.jsonToASN1HEX=function(e){return this.newObject(e).getEncodedHex()}},$.asn1.ASN1Util.oidHexToInt=function(e){for(var t="",n=parseInt(e.substr(0,2),16),r=(t=Math.floor(n/40)+"."+n%40,""),i=2;i<e.length;i+=2){var o=("00000000"+parseInt(e.substr(i,2),16).toString(2)).slice(-8);r+=o.substr(1,7),"0"==o.substr(0,1)&&(t=t+"."+new _(r,2).toString(10),r="")}return t},$.asn1.ASN1Util.oidIntToHex=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new _(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);return r},$.asn1.ASN1Object=function(){this.getLengthHexFromValue=function(){if(void 0===this.hV||null==this.hV)throw"this.hV is null or undefined.";if(this.hV.length%2==1)throw"value hex must be even length: n="+"".length+",v="+this.hV;var e=this.hV.length/2,t=e.toString(16);if(t.length%2==1&&(t="0"+t),e<128)return t;var n=t.length/2;if(n>15)throw"ASN.1 length too long to represent by 8x: n = "+e.toString(16);return(128+n).toString(16)+t},this.getEncodedHex=function(){return(null==this.hTLV||this.isModified)&&(this.hV=this.getFreshValueHex(),this.hL=this.getLengthHexFromValue(),this.hTLV=this.hT+this.hL+this.hV,this.isModified=!1),this.hTLV},this.getValueHex=function(){return this.getEncodedHex(),this.hV},this.getFreshValueHex=function(){return""}},$.asn1.DERAbstractString=function(e){$.asn1.DERAbstractString.superclass.constructor.call(this),this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(this.s)},this.setStringHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?this.setString(e):void 0!==e.str?this.setString(e.str):void 0!==e.hex&&this.setStringHex(e.hex))},J.lang.extend($.asn1.DERAbstractString,$.asn1.ASN1Object),$.asn1.DERAbstractTime=function(e){$.asn1.DERAbstractTime.superclass.constructor.call(this),this.localDateToUTC=function(e){return utc=e.getTime()+6e4*e.getTimezoneOffset(),new Date(utc)},this.formatDate=function(e,t,n){var r=this.zeroPadding,i=this.localDateToUTC(e),o=String(i.getFullYear());"utc"==t&&(o=o.substr(2,2));var a=o+r(String(i.getMonth()+1),2)+r(String(i.getDate()),2)+r(String(i.getHours()),2)+r(String(i.getMinutes()),2)+r(String(i.getSeconds()),2);if(!0===n){var s=i.getMilliseconds();if(0!=s){var c=r(String(s),3);a=a+"."+(c=c.replace(/[0]+$/,""))}}return a+"Z"},this.zeroPadding=function(e,t){return e.length>=t?e:new Array(t-e.length+1).join("0")+e},this.getString=function(){return this.s},this.setString=function(e){this.hTLV=null,this.isModified=!0,this.s=e,this.hV=stohex(e)},this.setByDateValue=function(e,t,n,r,i,o){var a=new Date(Date.UTC(e,t-1,n,r,i,o,0));this.setByDate(a)},this.getFreshValueHex=function(){return this.hV}},J.lang.extend($.asn1.DERAbstractTime,$.asn1.ASN1Object),$.asn1.DERAbstractStructured=function(e){$.asn1.DERAbstractString.superclass.constructor.call(this),this.setByASN1ObjectArray=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array=e},this.appendASN1Object=function(e){this.hTLV=null,this.isModified=!0,this.asn1Array.push(e)},this.asn1Array=new Array,void 0!==e&&void 0!==e.array&&(this.asn1Array=e.array)},J.lang.extend($.asn1.DERAbstractStructured,$.asn1.ASN1Object),$.asn1.DERBoolean=function(){$.asn1.DERBoolean.superclass.constructor.call(this),this.hT="01",this.hTLV="0101ff"},J.lang.extend($.asn1.DERBoolean,$.asn1.ASN1Object),$.asn1.DERInteger=function(e){$.asn1.DERInteger.superclass.constructor.call(this),this.hT="02",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=$.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.bigint?this.setByBigInteger(e.bigint):void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},J.lang.extend($.asn1.DERInteger,$.asn1.ASN1Object),$.asn1.DERBitString=function(e){if(void 0!==e&&void 0!==e.obj){var t=$.asn1.ASN1Util.newObject(e.obj);e.hex="00"+t.getEncodedHex()}$.asn1.DERBitString.superclass.constructor.call(this),this.hT="03",this.setHexValueIncludingUnusedBits=function(e){this.hTLV=null,this.isModified=!0,this.hV=e},this.setUnusedBitsAndHexValue=function(e,t){if(e<0||7<e)throw"unused bits shall be from 0 to 7: u = "+e;var n="0"+e;this.hTLV=null,this.isModified=!0,this.hV=n+t},this.setByBinaryString=function(e){var t=8-(e=e.replace(/0+$/,"")).length%8;8==t&&(t=0);for(var n=0;n<=t;n++)e+="0";var r="";for(n=0;n<e.length-1;n+=8){var i=e.substr(n,8),o=parseInt(i,2).toString(16);1==o.length&&(o="0"+o),r+=o}this.hTLV=null,this.isModified=!0,this.hV="0"+t+r},this.setByBooleanArray=function(e){for(var t="",n=0;n<e.length;n++)1==e[n]?t+="1":t+="0";this.setByBinaryString(t)},this.newFalseArray=function(e){for(var t=new Array(e),n=0;n<e;n++)t[n]=!1;return t},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e&&e.toLowerCase().match(/^[0-9a-f]+$/)?this.setHexValueIncludingUnusedBits(e):void 0!==e.hex?this.setHexValueIncludingUnusedBits(e.hex):void 0!==e.bin?this.setByBinaryString(e.bin):void 0!==e.array&&this.setByBooleanArray(e.array))},J.lang.extend($.asn1.DERBitString,$.asn1.ASN1Object),$.asn1.DEROctetString=function(e){if(void 0!==e&&void 0!==e.obj){var t=$.asn1.ASN1Util.newObject(e.obj);e.hex=t.getEncodedHex()}$.asn1.DEROctetString.superclass.constructor.call(this,e),this.hT="04"},J.lang.extend($.asn1.DEROctetString,$.asn1.DERAbstractString),$.asn1.DERNull=function(){$.asn1.DERNull.superclass.constructor.call(this),this.hT="05",this.hTLV="0500"},J.lang.extend($.asn1.DERNull,$.asn1.ASN1Object),$.asn1.DERObjectIdentifier=function(e){var t=function(e){var t=e.toString(16);return 1==t.length&&(t="0"+t),t},n=function(e){var n="",r=new _(e,10).toString(2),i=7-r.length%7;7==i&&(i=0);for(var o="",a=0;a<i;a++)o+="0";for(r=o+r,a=0;a<r.length-1;a+=7){var s=r.substr(a,7);a!=r.length-7&&(s="1"+s),n+=t(parseInt(s,2))}return n};$.asn1.DERObjectIdentifier.superclass.constructor.call(this),this.hT="06",this.setValueHex=function(e){this.hTLV=null,this.isModified=!0,this.s=null,this.hV=e},this.setValueOidString=function(e){if(!e.match(/^[0-9.]+$/))throw"malformed oid string: "+e;var r="",i=e.split("."),o=40*parseInt(i[0])+parseInt(i[1]);r+=t(o),i.splice(0,2);for(var a=0;a<i.length;a++)r+=n(i[a]);this.hTLV=null,this.isModified=!0,this.s=null,this.hV=r},this.setValueName=function(e){var t=$.asn1.x509.OID.name2oid(e);if(""===t)throw"DERObjectIdentifier oidName undefined: "+e;this.setValueOidString(t)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&("string"==typeof e?e.match(/^[0-2].[0-9.]+$/)?this.setValueOidString(e):this.setValueName(e):void 0!==e.oid?this.setValueOidString(e.oid):void 0!==e.hex?this.setValueHex(e.hex):void 0!==e.name&&this.setValueName(e.name))},J.lang.extend($.asn1.DERObjectIdentifier,$.asn1.ASN1Object),$.asn1.DEREnumerated=function(e){$.asn1.DEREnumerated.superclass.constructor.call(this),this.hT="0a",this.setByBigInteger=function(e){this.hTLV=null,this.isModified=!0,this.hV=$.asn1.ASN1Util.bigIntToMinTwosComplementsHex(e)},this.setByInteger=function(e){var t=new _(String(e),10);this.setByBigInteger(t)},this.setValueHex=function(e){this.hV=e},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.int?this.setByInteger(e.int):"number"==typeof e?this.setByInteger(e):void 0!==e.hex&&this.setValueHex(e.hex))},J.lang.extend($.asn1.DEREnumerated,$.asn1.ASN1Object),$.asn1.DERUTF8String=function(e){$.asn1.DERUTF8String.superclass.constructor.call(this,e),this.hT="0c"},J.lang.extend($.asn1.DERUTF8String,$.asn1.DERAbstractString),$.asn1.DERNumericString=function(e){$.asn1.DERNumericString.superclass.constructor.call(this,e),this.hT="12"},J.lang.extend($.asn1.DERNumericString,$.asn1.DERAbstractString),$.asn1.DERPrintableString=function(e){$.asn1.DERPrintableString.superclass.constructor.call(this,e),this.hT="13"},J.lang.extend($.asn1.DERPrintableString,$.asn1.DERAbstractString),$.asn1.DERTeletexString=function(e){$.asn1.DERTeletexString.superclass.constructor.call(this,e),this.hT="14"},J.lang.extend($.asn1.DERTeletexString,$.asn1.DERAbstractString),$.asn1.DERIA5String=function(e){$.asn1.DERIA5String.superclass.constructor.call(this,e),this.hT="16"},J.lang.extend($.asn1.DERIA5String,$.asn1.DERAbstractString),$.asn1.DERUTCTime=function(e){$.asn1.DERUTCTime.superclass.constructor.call(this,e),this.hT="17",this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"utc"),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{12}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date))},J.lang.extend($.asn1.DERUTCTime,$.asn1.DERAbstractTime),$.asn1.DERGeneralizedTime=function(e){$.asn1.DERGeneralizedTime.superclass.constructor.call(this,e),this.hT="18",this.withMillis=!1,this.setByDate=function(e){this.hTLV=null,this.isModified=!0,this.date=e,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)},this.getFreshValueHex=function(){return void 0===this.date&&void 0===this.s&&(this.date=new Date,this.s=this.formatDate(this.date,"gen",this.withMillis),this.hV=stohex(this.s)),this.hV},void 0!==e&&(void 0!==e.str?this.setString(e.str):"string"==typeof e&&e.match(/^[0-9]{14}Z$/)?this.setString(e):void 0!==e.hex?this.setStringHex(e.hex):void 0!==e.date&&this.setByDate(e.date),!0===e.millis&&(this.withMillis=!0))},J.lang.extend($.asn1.DERGeneralizedTime,$.asn1.DERAbstractTime),$.asn1.DERSequence=function(e){$.asn1.DERSequence.superclass.constructor.call(this,e),this.hT="30",this.getFreshValueHex=function(){for(var e="",t=0;t<this.asn1Array.length;t++)e+=this.asn1Array[t].getEncodedHex();return this.hV=e,this.hV}},J.lang.extend($.asn1.DERSequence,$.asn1.DERAbstractStructured),$.asn1.DERSet=function(e){$.asn1.DERSet.superclass.constructor.call(this,e),this.hT="31",this.sortFlag=!0,this.getFreshValueHex=function(){for(var e=new Array,t=0;t<this.asn1Array.length;t++){var n=this.asn1Array[t];e.push(n.getEncodedHex())}return 1==this.sortFlag&&e.sort(),this.hV=e.join(""),this.hV},void 0!==e&&void 0!==e.sortflag&&0==e.sortflag&&(this.sortFlag=!1)},J.lang.extend($.asn1.DERSet,$.asn1.DERAbstractStructured),$.asn1.DERTaggedObject=function(e){$.asn1.DERTaggedObject.superclass.constructor.call(this),this.hT="a0",this.hV="",this.isExplicit=!0,this.asn1Object=null,this.setASN1Object=function(e,t,n){this.hT=t,this.isExplicit=e,this.asn1Object=n,this.isExplicit?(this.hV=this.asn1Object.getEncodedHex(),this.hTLV=null,this.isModified=!0):(this.hV=null,this.hTLV=n.getEncodedHex(),this.hTLV=this.hTLV.replace(/^../,t),this.isModified=!1)},this.getFreshValueHex=function(){return this.hV},void 0!==e&&(void 0!==e.tag&&(this.hT=e.tag),void 0!==e.explicit&&(this.isExplicit=e.explicit),void 0!==e.obj&&(this.asn1Object=e.obj,this.setASN1Object(this.isExplicit,this.hT,this.asn1Object)))},J.lang.extend($.asn1.DERTaggedObject,$.asn1.ASN1Object);var Q=function(e){function t(n){var r=e.call(this)||this;return n&&("string"==typeof n?r.parseKey(n):(t.hasPrivateKeyProperty(n)||t.hasPublicKeyProperty(n))&&r.parsePropertiesFrom(n)),r}return function(e,t){function n(){this.constructor=e}f(e,t),e.prototype=null===t?Object.create(t):(n.prototype=t.prototype,new n)}(t,e),t.prototype.parseKey=function(e){try{var t=0,n=0,r=/^\s*(?:[0-9A-Fa-f][0-9A-Fa-f]\s*)+$/.test(e)?p(e):v.unarmor(e),i=C.decode(r);if(3===i.sub.length&&(i=i.sub[2].sub[0]),9===i.sub.length){t=i.sub[1].getHexStringValue(),this.n=N(t,16),n=i.sub[2].getHexStringValue(),this.e=parseInt(n,16);var o=i.sub[3].getHexStringValue();this.d=N(o,16);var a=i.sub[4].getHexStringValue();this.p=N(a,16);var s=i.sub[5].getHexStringValue();this.q=N(s,16);var c=i.sub[6].getHexStringValue();this.dmp1=N(c,16);var u=i.sub[7].getHexStringValue();this.dmq1=N(u,16);var l=i.sub[8].getHexStringValue();this.coeff=N(l,16)}else{if(2!==i.sub.length)return!1;var h=i.sub[1].sub[0];t=h.sub[0].getHexStringValue(),this.n=N(t,16),n=h.sub[1].getHexStringValue(),this.e=parseInt(n,16)}return!0}catch(e){return!1}},t.prototype.getPrivateBaseKey=function(){var e={array:[new $.asn1.DERInteger({int:0}),new $.asn1.DERInteger({bigint:this.n}),new $.asn1.DERInteger({int:this.e}),new $.asn1.DERInteger({bigint:this.d}),new $.asn1.DERInteger({bigint:this.p}),new $.asn1.DERInteger({bigint:this.q}),new $.asn1.DERInteger({bigint:this.dmp1}),new $.asn1.DERInteger({bigint:this.dmq1}),new $.asn1.DERInteger({bigint:this.coeff})]};return new $.asn1.DERSequence(e).getEncodedHex()},t.prototype.getPrivateBaseKeyB64=function(){return u(this.getPrivateBaseKey())},t.prototype.getPublicBaseKey=function(){var e=new $.asn1.DERSequence({array:[new $.asn1.DERObjectIdentifier({oid:"1.2.840.113549.1.1.1"}),new $.asn1.DERNull]}),t=new $.asn1.DERSequence({array:[new $.asn1.DERInteger({bigint:this.n}),new $.asn1.DERInteger({int:this.e})]}),n=new $.asn1.DERBitString({hex:"00"+t.getEncodedHex()});return new $.asn1.DERSequence({array:[e,n]}).getEncodedHex()},t.prototype.getPublicBaseKeyB64=function(){return u(this.getPublicBaseKey())},t.wordwrap=function(e,t){if(!e)return e;var n="(.{1,"+(t=t||64)+"})( +|$\n?)|(.{1,"+t+"})";return e.match(RegExp(n,"g")).join("\n")},t.prototype.getPrivateKey=function(){var e="-----BEGIN RSA PRIVATE KEY-----\n";return e+=t.wordwrap(this.getPrivateBaseKeyB64())+"\n",e+="-----END RSA PRIVATE KEY-----"},t.prototype.getPublicKey=function(){var e="-----BEGIN PUBLIC KEY-----\n";return e+=t.wordwrap(this.getPublicBaseKeyB64())+"\n",e+="-----END PUBLIC KEY-----"},t.hasPublicKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")},t.hasPrivateKeyProperty=function(e){return(e=e||{}).hasOwnProperty("n")&&e.hasOwnProperty("e")&&e.hasOwnProperty("d")&&e.hasOwnProperty("p")&&e.hasOwnProperty("q")&&e.hasOwnProperty("dmp1")&&e.hasOwnProperty("dmq1")&&e.hasOwnProperty("coeff")},t.prototype.parsePropertiesFrom=function(e){this.n=e.n,this.e=e.e,e.hasOwnProperty("d")&&(this.d=e.d,this.p=e.p,this.q=e.q,this.dmp1=e.dmp1,this.dmq1=e.dmq1,this.coeff=e.coeff)},t}(q),ee=function(){function e(e){e=e||{},this.default_key_size=parseInt(e.default_key_size,10)||1024,this.default_public_exponent=e.default_public_exponent||"010001",this.log=e.log||!1,this.key=null}return e.prototype.setKey=function(e){this.log&&this.key&&console.warn("A key was already set, overriding existing."),this.key=new Q(e)},e.prototype.setPrivateKey=function(e){this.setKey(e)},e.prototype.setPublicKey=function(e){this.setKey(e)},e.prototype.decrypt=function(e){try{return this.getKey().decrypt(l(e))}catch(e){return!1}},e.prototype.encrypt=function(e){try{return u(this.getKey().encrypt(e))}catch(e){return!1}},e.prototype.encryptLong=function(e){try{for(var t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",r=0,i=/null$/g;i.test(n)&&(r++,t=this.getKey().encryptLong(e)||"",n=this.getKey().decryptLong(t)||"",!(r>10)););return t}catch(e){return!1}},e.prototype.decryptLong=function(e){try{return this.getKey().decryptLong(e)}catch(e){return!1}},e.prototype.sign=function(e,t,n){try{return u(this.getKey().sign(e,t,n))}catch(e){return!1}},e.prototype.verify=function(e,t,n){try{return this.getKey().verify(e,l(t),n)}catch(e){return!1}},e.prototype.getKey=function(e){if(!this.key){if(this.key=new Q,e&&"[object Function]"==={}.toString.call(e))return void this.key.generateAsync(this.default_key_size,this.default_public_exponent,e);this.key.generate(this.default_key_size,this.default_public_exponent)}return this.key},e.prototype.getPrivateKey=function(){return this.getKey().getPrivateKey()},e.prototype.getPrivateKeyB64=function(){return this.getKey().getPrivateBaseKeyB64()},e.prototype.getPublicKey=function(){return this.getKey().getPublicKey()},e.prototype.getPublicKeyB64=function(){return this.getKey().getPublicBaseKeyB64()},e.version="3.1.4",e}();window.JSEncrypt=ee,e.JSEncrypt=ee,e.default=ee,Object.defineProperty(e,"__esModule",{value:!0})}(t)})),Uh=(Gh=Hh)&&Gh.__esModule&&Object.prototype.hasOwnProperty.call(Gh,"default")?Gh.default:Gh,Kh=(jh=Object.freeze({__proto__:null,default:{}}))&&jh.default||jh,Fh=y((function(e,t){var n;e.exports=n=n||function(e,t){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&&void 0!==g&&g.crypto&&(n=g.crypto),!n)try{n=Kh}catch(e){}var r=function(){if(n){if("function"==typeof n.getRandomValues)try{return n.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof n.randomBytes)try{return n.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},i=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),o={},a=o.lib={},s=a.Base={extend:function(e){var t=i(this);return e&&t.mixIn(e),t.hasOwnProperty("init")&&this.init!==t.init||(t.init=function(){t.$super.init.apply(this,arguments)}),t.init.prototype=t,t.$super=this,t},create:function(){var e=this.extend();return e.init.apply(e,arguments),e},init:function(){},mixIn:function(e){for(var t in e)e.hasOwnProperty(t)&&(this[t]=e[t]);e.hasOwnProperty("toString")&&(this.toString=e.toString)},clone:function(){return this.init.prototype.extend(this)}},c=a.WordArray=s.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||l).stringify(this)},concat:function(e){var t=this.words,n=e.words,r=this.sigBytes,i=e.sigBytes;if(this.clamp(),r%4)for(var o=0;o<i;o++){var a=n[o>>>2]>>>24-o%4*8&255;t[r+o>>>2]|=a<<24-(r+o)%4*8}else for(var s=0;s<i;s+=4)t[r+s>>>2]=n[s>>>2];return this.sigBytes+=i,this},clamp:function(){var t=this.words,n=this.sigBytes;t[n>>>2]&=4294967295<<32-n%4*8,t.length=e.ceil(n/4)},clone:function(){var e=s.clone.call(this);return e.words=this.words.slice(0),e},random:function(e){for(var t=[],n=0;n<e;n+=4)t.push(r());return new c.init(t,e)}}),u=o.enc={},l=u.Hex={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push((o>>>4).toString(16)),r.push((15&o).toString(16))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r+=2)n[r>>>3]|=parseInt(e.substr(r,2),16)<<24-r%8*4;return new c.init(n,t/2)}},h=u.Latin1={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i++){var o=t[i>>>2]>>>24-i%4*8&255;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var t=e.length,n=[],r=0;r<t;r++)n[r>>>2]|=(255&e.charCodeAt(r))<<24-r%4*8;return new c.init(n,t)}},d=u.Utf8={stringify:function(e){try{return decodeURIComponent(escape(h.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return h.parse(unescape(encodeURIComponent(e)))}},f=a.BufferedBlockAlgorithm=s.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=d.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(t){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=t?e.ceil(s):e.max((0|s)-this._minBufferSize,0))*a,l=e.min(4*u,o);if(u){for(var h=0;h<u;h+=a)this._doProcessBlock(i,h);n=i.splice(0,u),r.sigBytes-=l}return new c.init(n,l)},clone:function(){var e=s.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});a.Hasher=f.extend({cfg:s.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){f.reset.call(this),this._doReset()},update:function(e){return this._append(e),this._process(),this},finalize:function(e){return e&&this._append(e),this._doFinalize()},blockSize:16,_createHelper:function(e){return function(t,n){return new e.init(n).finalize(t)}},_createHmacHelper:function(e){return function(t,n){return new p.HMAC.init(e,n).finalize(t)}}});var p=o.algo={};return o}(Math)})),zh=(y((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Fh).lib,i=r.Base,o=r.WordArray,(a=n.x64={}).Word=i.extend({init:function(e,t){this.high=e,this.low=t}}),a.WordArray=i.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:8*e.length},toX32:function(){for(var e=this.words,t=e.length,n=[],r=0;r<t;r++){var i=e[r];n.push(i.high),n.push(i.low)}return o.create(n,this.sigBytes)},clone:function(){for(var e=i.clone.call(this),t=e.words=this.words.slice(0),n=t.length,r=0;r<n;r++)t[r]=t[r].clone();return e}}),s)})),y((function(e,t){var n;e.exports=(n=Fh,function(){if("function"==typeof ArrayBuffer){var e=n.lib.WordArray,t=e.init;(e.init=function(e){if(e instanceof ArrayBuffer&&(e=new Uint8Array(e)),(e instanceof Int8Array||"undefined"!=typeof Uint8ClampedArray&&e instanceof Uint8ClampedArray||e instanceof Int16Array||e instanceof Uint16Array||e instanceof Int32Array||e instanceof Uint32Array||e instanceof Float32Array||e instanceof Float64Array)&&(e=new Uint8Array(e.buffer,e.byteOffset,e.byteLength)),e instanceof Uint8Array){for(var n=e.byteLength,r=[],i=0;i<n;i++)r[i>>>2]|=e[i]<<24-i%4*8;t.call(this,r,n)}else t.apply(this,arguments)}).prototype=e}}(),n.lib.WordArray)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.WordArray,r=e.enc;function i(e){return e<<8&4278255360|e>>>8&16711935}r.Utf16=r.Utf16BE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],i=0;i<n;i+=2){var o=t[i>>>2]>>>16-i%4*8&65535;r.push(String.fromCharCode(o))}return r.join("")},parse:function(e){for(var n=e.length,r=[],i=0;i<n;i++)r[i>>>1]|=e.charCodeAt(i)<<16-i%2*16;return t.create(r,2*n)}},r.Utf16LE={stringify:function(e){for(var t=e.words,n=e.sigBytes,r=[],o=0;o<n;o+=2){var a=i(t[o>>>2]>>>16-o%4*8&65535);r.push(String.fromCharCode(a))}return r.join("")},parse:function(e){for(var n=e.length,r=[],o=0;o<n;o++)r[o>>>1]|=i(e.charCodeAt(o)<<16-o%2*16);return t.create(r,2*n)}}}(),n.enc.Utf16)})),y((function(e,t){var n,r,i;e.exports=(r=(n=i=Fh).lib.WordArray,n.enc.Base64={stringify:function(e){var t=e.words,n=e.sigBytes,r=this._map;e.clamp();for(var i=[],o=0;o<n;o+=3)for(var a=(t[o>>>2]>>>24-o%4*8&255)<<16|(t[o+1>>>2]>>>24-(o+1)%4*8&255)<<8|t[o+2>>>2]>>>24-(o+2)%4*8&255,s=0;s<4&&o+.75*s<n;s++)i.push(r.charAt(a>>>6*(3-s)&63));var c=r.charAt(64);if(c)for(;i.length%4;)i.push(c);return i.join("")},parse:function(e){var t=e.length,n=this._map,i=this._reverseMap;if(!i){i=this._reverseMap=[];for(var o=0;o<n.length;o++)i[n.charCodeAt(o)]=o}var a=n.charAt(64);if(a){var s=e.indexOf(a);-1!==s&&(t=s)}return function(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,c=n[e.charCodeAt(a)]>>>6-a%4*2,u=s|c;i[o>>>2]|=u<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),y((function(e,t){var n,r,i;e.exports=(r=(n=i=Fh).lib.WordArray,n.enc.Base64url={stringify:function(e,t=!0){var n=e.words,r=e.sigBytes,i=t?this._safe_map:this._map;e.clamp();for(var o=[],a=0;a<r;a+=3)for(var s=(n[a>>>2]>>>24-a%4*8&255)<<16|(n[a+1>>>2]>>>24-(a+1)%4*8&255)<<8|n[a+2>>>2]>>>24-(a+2)%4*8&255,c=0;c<4&&a+.75*c<r;c++)o.push(i.charAt(s>>>6*(3-c)&63));var u=i.charAt(64);if(u)for(;o.length%4;)o.push(u);return o.join("")},parse:function(e,t=!0){var n=e.length,i=t?this._safe_map:this._map,o=this._reverseMap;if(!o){o=this._reverseMap=[];for(var a=0;a<i.length;a++)o[i.charCodeAt(a)]=a}var s=i.charAt(64);if(s){var c=e.indexOf(s);-1!==c&&(n=c)}return function(e,t,n){for(var i=[],o=0,a=0;a<t;a++)if(a%4){var s=n[e.charCodeAt(a-1)]<<a%4*2,c=n[e.charCodeAt(a)]>>>6-a%4*2,u=s|c;i[o>>>2]|=u<<24-o%4*8,o++}return r.create(i,o)}(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},i.enc.Base64url)})),y((function(e,t){var n;e.exports=(n=Fh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[];!function(){for(var t=0;t<64;t++)s[t]=4294967296*e.abs(e.sin(t+1))|0}();var c=a.MD5=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o=this._hash.words,a=e[t+0],c=e[t+1],f=e[t+2],p=e[t+3],v=e[t+4],g=e[t+5],m=e[t+6],y=e[t+7],b=e[t+8],S=e[t+9],w=e[t+10],k=e[t+11],C=e[t+12],E=e[t+13],x=e[t+14],I=e[t+15],_=o[0],A=o[1],T=o[2],R=o[3];_=u(_,A,T,R,a,7,s[0]),R=u(R,_,A,T,c,12,s[1]),T=u(T,R,_,A,f,17,s[2]),A=u(A,T,R,_,p,22,s[3]),_=u(_,A,T,R,v,7,s[4]),R=u(R,_,A,T,g,12,s[5]),T=u(T,R,_,A,m,17,s[6]),A=u(A,T,R,_,y,22,s[7]),_=u(_,A,T,R,b,7,s[8]),R=u(R,_,A,T,S,12,s[9]),T=u(T,R,_,A,w,17,s[10]),A=u(A,T,R,_,k,22,s[11]),_=u(_,A,T,R,C,7,s[12]),R=u(R,_,A,T,E,12,s[13]),T=u(T,R,_,A,x,17,s[14]),_=l(_,A=u(A,T,R,_,I,22,s[15]),T,R,c,5,s[16]),R=l(R,_,A,T,m,9,s[17]),T=l(T,R,_,A,k,14,s[18]),A=l(A,T,R,_,a,20,s[19]),_=l(_,A,T,R,g,5,s[20]),R=l(R,_,A,T,w,9,s[21]),T=l(T,R,_,A,I,14,s[22]),A=l(A,T,R,_,v,20,s[23]),_=l(_,A,T,R,S,5,s[24]),R=l(R,_,A,T,x,9,s[25]),T=l(T,R,_,A,p,14,s[26]),A=l(A,T,R,_,b,20,s[27]),_=l(_,A,T,R,E,5,s[28]),R=l(R,_,A,T,f,9,s[29]),T=l(T,R,_,A,y,14,s[30]),_=h(_,A=l(A,T,R,_,C,20,s[31]),T,R,g,4,s[32]),R=h(R,_,A,T,b,11,s[33]),T=h(T,R,_,A,k,16,s[34]),A=h(A,T,R,_,x,23,s[35]),_=h(_,A,T,R,c,4,s[36]),R=h(R,_,A,T,v,11,s[37]),T=h(T,R,_,A,y,16,s[38]),A=h(A,T,R,_,w,23,s[39]),_=h(_,A,T,R,E,4,s[40]),R=h(R,_,A,T,a,11,s[41]),T=h(T,R,_,A,p,16,s[42]),A=h(A,T,R,_,m,23,s[43]),_=h(_,A,T,R,S,4,s[44]),R=h(R,_,A,T,C,11,s[45]),T=h(T,R,_,A,I,16,s[46]),_=d(_,A=h(A,T,R,_,f,23,s[47]),T,R,a,6,s[48]),R=d(R,_,A,T,y,10,s[49]),T=d(T,R,_,A,x,15,s[50]),A=d(A,T,R,_,g,21,s[51]),_=d(_,A,T,R,C,6,s[52]),R=d(R,_,A,T,p,10,s[53]),T=d(T,R,_,A,w,15,s[54]),A=d(A,T,R,_,c,21,s[55]),_=d(_,A,T,R,b,6,s[56]),R=d(R,_,A,T,I,10,s[57]),T=d(T,R,_,A,m,15,s[58]),A=d(A,T,R,_,E,21,s[59]),_=d(_,A,T,R,v,6,s[60]),R=d(R,_,A,T,k,10,s[61]),T=d(T,R,_,A,f,15,s[62]),A=d(A,T,R,_,S,21,s[63]),o[0]=o[0]+_|0,o[1]=o[1]+A|0,o[2]=o[2]+T|0,o[3]=o[3]+R|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;n[i>>>5]|=128<<24-i%32;var o=e.floor(r/4294967296),a=r;n[15+(i+64>>>9<<4)]=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),n[14+(i+64>>>9<<4)]=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),t.sigBytes=4*(n.length+1),this._process();for(var s=this._hash,c=s.words,u=0;u<4;u++){var l=c[u];c[u]=16711935&(l<<8|l>>>24)|4278255360&(l<<24|l>>>8)}return s},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function u(e,t,n,r,i,o,a){var s=e+(t&n|~t&r)+i+a;return(s<<o|s>>>32-o)+t}function l(e,t,n,r,i,o,a){var s=e+(t&r|n&~r)+i+a;return(s<<o|s>>>32-o)+t}function h(e,t,n,r,i,o,a){var s=e+(t^n^r)+i+a;return(s<<o|s>>>32-o)+t}function d(e,t,n,r,i,o,a){var s=e+(n^(t|~r))+i+a;return(s<<o|s>>>32-o)+t}t.MD5=o._createHelper(c),t.HmacMD5=o._createHmacHelper(c)}(Math),n.MD5)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Fh).lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[],c=a.SHA1=o.extend({_doReset:function(){this._hash=new i.init([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],c=n[4],u=0;u<80;u++){if(u<16)s[u]=0|e[t+u];else{var l=s[u-3]^s[u-8]^s[u-14]^s[u-16];s[u]=l<<1|l>>>31}var h=(r<<5|r>>>27)+c+s[u];h+=u<20?1518500249+(i&o|~i&a):u<40?1859775393+(i^o^a):u<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,c=a,a=o,o=i<<30|i>>>2,i=r,r=h}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+c|0},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=Math.floor(n/4294967296),t[15+(r+64>>>9<<4)]=n,e.sigBytes=4*t.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}}),n.SHA1=o._createHelper(c),n.HmacSHA1=o._createHmacHelper(c),u.SHA1)})),y((function(e,t){var n;e.exports=(n=Fh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],c=[];!function(){function t(t){for(var n=e.sqrt(t),r=2;r<=n;r++)if(!(t%r))return!1;return!0}function n(e){return 4294967296*(e-(0|e))|0}for(var r=2,i=0;i<64;)t(r)&&(i<8&&(s[i]=n(e.pow(r,.5))),c[i]=n(e.pow(r,1/3)),i++),r++}();var u=[],l=a.SHA256=o.extend({_doReset:function(){this._hash=new i.init(s.slice(0))},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],h=n[6],d=n[7],f=0;f<64;f++){if(f<16)u[f]=0|e[t+f];else{var p=u[f-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=u[f-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;u[f]=v+u[f-7]+m+u[f-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),S=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+c[f]+u[f];d=h,h=l,l=s,s=a+S|0,a=o,o=i,i=r,r=S+(b+y)|0}n[0]=n[0]+r|0,n[1]=n[1]+i|0,n[2]=n[2]+o|0,n[3]=n[3]+a|0,n[4]=n[4]+s|0,n[5]=n[5]+l|0,n[6]=n[6]+h|0,n[7]=n[7]+d|0},_doFinalize:function(){var t=this._data,n=t.words,r=8*this._nDataBytes,i=8*t.sigBytes;return n[i>>>5]|=128<<24-i%32,n[14+(i+64>>>9<<4)]=e.floor(r/4294967296),n[15+(i+64>>>9<<4)]=r,t.sigBytes=4*n.length,this._process(),this._hash},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});t.SHA256=o._createHelper(l),t.HmacSHA256=o._createHmacHelper(l)}(Math),n.SHA256)})),y((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Fh).lib.WordArray,i=n.algo,o=i.SHA256,a=i.SHA224=o.extend({_doReset:function(){this._hash=new r.init([3238371032,914150663,812702999,4144912697,4290775857,1750603025,1694076839,3204075428])},_doFinalize:function(){var e=o._doFinalize.call(this);return e.sigBytes-=4,e}}),n.SHA224=o._createHelper(a),n.HmacSHA224=o._createHmacHelper(a),s.SHA224)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.Hasher,r=e.x64,i=r.Word,o=r.WordArray,a=e.algo;function s(){return i.create.apply(i,arguments)}var c=[s(1116352408,3609767458),s(1899447441,602891725),s(3049323471,3964484399),s(3921009573,2173295548),s(961987163,4081628472),s(1508970993,3053834265),s(2453635748,2937671579),s(2870763221,3664609560),s(3624381080,2734883394),s(310598401,1164996542),s(607225278,1323610764),s(1426881987,3590304994),s(1925078388,4068182383),s(2162078206,991336113),s(2614888103,633803317),s(3248222580,3479774868),s(3835390401,2666613458),s(4022224774,944711139),s(264347078,2341262773),s(604807628,2007800933),s(770255983,1495990901),s(1249150122,1856431235),s(1555081692,3175218132),s(1996064986,2198950837),s(2554220882,3999719339),s(2821834349,766784016),s(2952996808,2566594879),s(3210313671,3203337956),s(3336571891,1034457026),s(3584528711,2466948901),s(113926993,3758326383),s(338241895,168717936),s(666307205,1188179964),s(773529912,1546045734),s(1294757372,1522805485),s(1396182291,2643833823),s(1695183700,2343527390),s(1986661051,1014477480),s(2177026350,1206759142),s(2456956037,344077627),s(2730485921,1290863460),s(2820302411,3158454273),s(3259730800,3505952657),s(3345764771,106217008),s(3516065817,3606008344),s(3600352804,1432725776),s(4094571909,1467031594),s(275423344,851169720),s(430227734,3100823752),s(506948616,1363258195),s(659060556,3750685593),s(883997877,3785050280),s(958139571,3318307427),s(1322822218,3812723403),s(1537002063,2003034995),s(1747873779,3602036899),s(1955562222,1575990012),s(2024104815,1125592928),s(2227730452,2716904306),s(2361852424,442776044),s(2428436474,593698344),s(2756734187,3733110249),s(3204031479,2999351573),s(3329325298,3815920427),s(3391569614,3928383900),s(3515267271,566280711),s(3940187606,3454069534),s(4118630271,4000239992),s(116418474,1914138554),s(174292421,2731055270),s(289380356,3203993006),s(460393269,320620315),s(685471733,587496836),s(852142971,1086792851),s(1017036298,365543100),s(1126000580,2618297676),s(1288033470,3409855158),s(1501505948,4234509866),s(1607167915,987167468),s(1816402316,1246189591)],u=[];!function(){for(var e=0;e<80;e++)u[e]=s()}();var l=a.SHA512=t.extend({_doReset:function(){this._hash=new o.init([new i.init(1779033703,4089235720),new i.init(3144134277,2227873595),new i.init(1013904242,4271175723),new i.init(2773480762,1595750129),new i.init(1359893119,2917565137),new i.init(2600822924,725511199),new i.init(528734635,4215389547),new i.init(1541459225,327033209)])},_doProcessBlock:function(e,t){for(var n=this._hash.words,r=n[0],i=n[1],o=n[2],a=n[3],s=n[4],l=n[5],h=n[6],d=n[7],f=r.high,p=r.low,v=i.high,g=i.low,m=o.high,y=o.low,b=a.high,S=a.low,w=s.high,k=s.low,C=l.high,E=l.low,x=h.high,I=h.low,_=d.high,A=d.low,T=f,R=p,O=v,D=g,N=m,L=y,P=b,M=S,B=w,G=k,j=C,H=E,U=x,K=I,F=_,z=A,Y=0;Y<80;Y++){var V,X,W=u[Y];if(Y<16)X=W.high=0|e[t+2*Y],V=W.low=0|e[t+2*Y+1];else{var q=u[Y-15],Z=q.high,J=q.low,$=(Z>>>1|J<<31)^(Z>>>8|J<<24)^Z>>>7,Q=(J>>>1|Z<<31)^(J>>>8|Z<<24)^(J>>>7|Z<<25),ee=u[Y-2],te=ee.high,ne=ee.low,re=(te>>>19|ne<<13)^(te<<3|ne>>>29)^te>>>6,ie=(ne>>>19|te<<13)^(ne<<3|te>>>29)^(ne>>>6|te<<26),oe=u[Y-7],ae=oe.high,se=oe.low,ce=u[Y-16],ue=ce.high,le=ce.low;X=(X=(X=$+ae+((V=Q+se)>>>0<Q>>>0?1:0))+re+((V+=ie)>>>0<ie>>>0?1:0))+ue+((V+=le)>>>0<le>>>0?1:0),W.high=X,W.low=V}var he,de=B&j^~B&U,fe=G&H^~G&K,pe=T&O^T&N^O&N,ve=R&D^R&L^D&L,ge=(T>>>28|R<<4)^(T<<30|R>>>2)^(T<<25|R>>>7),me=(R>>>28|T<<4)^(R<<30|T>>>2)^(R<<25|T>>>7),ye=(B>>>14|G<<18)^(B>>>18|G<<14)^(B<<23|G>>>9),be=(G>>>14|B<<18)^(G>>>18|B<<14)^(G<<23|B>>>9),Se=c[Y],we=Se.high,ke=Se.low,Ce=F+ye+((he=z+be)>>>0<z>>>0?1:0),Ee=me+ve;F=U,z=K,U=j,K=H,j=B,H=G,B=P+(Ce=(Ce=(Ce=Ce+de+((he+=fe)>>>0<fe>>>0?1:0))+we+((he+=ke)>>>0<ke>>>0?1:0))+X+((he+=V)>>>0<V>>>0?1:0))+((G=M+he|0)>>>0<M>>>0?1:0)|0,P=N,M=L,N=O,L=D,O=T,D=R,T=Ce+(ge+pe+(Ee>>>0<me>>>0?1:0))+((R=he+Ee|0)>>>0<he>>>0?1:0)|0}p=r.low=p+R,r.high=f+T+(p>>>0<R>>>0?1:0),g=i.low=g+D,i.high=v+O+(g>>>0<D>>>0?1:0),y=o.low=y+L,o.high=m+N+(y>>>0<L>>>0?1:0),S=a.low=S+M,a.high=b+P+(S>>>0<M>>>0?1:0),k=s.low=k+G,s.high=w+B+(k>>>0<G>>>0?1:0),E=l.low=E+H,l.high=C+j+(E>>>0<H>>>0?1:0),I=h.low=I+K,h.high=x+U+(I>>>0<K>>>0?1:0),A=d.low=A+z,d.high=_+F+(A>>>0<z>>>0?1:0)},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;return t[r>>>5]|=128<<24-r%32,t[30+(r+128>>>10<<5)]=Math.floor(n/4294967296),t[31+(r+128>>>10<<5)]=n,e.sigBytes=4*t.length,this._process(),this._hash.toX32()},clone:function(){var e=t.clone.call(this);return e._hash=this._hash.clone(),e},blockSize:32});e.SHA512=t._createHelper(l),e.HmacSHA512=t._createHmacHelper(l)}(),n.SHA512)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Fh).x64,i=r.Word,o=r.WordArray,a=n.algo,s=a.SHA512,c=a.SHA384=s.extend({_doReset:function(){this._hash=new o.init([new i.init(3418070365,3238371032),new i.init(1654270250,914150663),new i.init(2438529370,812702999),new i.init(355462360,4144912697),new i.init(1731405415,4290775857),new i.init(2394180231,1750603025),new i.init(3675008525,1694076839),new i.init(1203062813,3204075428)])},_doFinalize:function(){var e=s._doFinalize.call(this);return e.sigBytes-=16,e}}),n.SHA384=s._createHelper(c),n.HmacSHA384=s._createHmacHelper(c),u.SHA384)})),y((function(e,t){var n;e.exports=(n=Fh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.x64.Word,s=t.algo,c=[],u=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){c[e+5*t]=(n+1)*(n+2)/2%64;var r=(2*e+3*t)%5;e=t%5,t=r}for(e=0;e<5;e++)for(t=0;t<5;t++)u[e+5*t]=t+(2*e+3*t)%5*5;for(var i=1,o=0;o<24;o++){for(var s=0,h=0,d=0;d<7;d++){if(1&i){var f=(1<<d)-1;f<32?h^=1<<f:s^=1<<f-32}128&i?i=i<<1^113:i<<=1}l[o]=a.create(s,h)}}();var h=[];!function(){for(var e=0;e<25;e++)h[e]=a.create()}();var d=s.SHA3=o.extend({cfg:o.cfg.extend({outputLength:512}),_doReset:function(){for(var e=this._state=[],t=0;t<25;t++)e[t]=new a.init;this.blockSize=(1600-2*this.cfg.outputLength)/32},_doProcessBlock:function(e,t){for(var n=this._state,r=this.blockSize/2,i=0;i<r;i++){var o=e[t+2*i],a=e[t+2*i+1];o=16711935&(o<<8|o>>>24)|4278255360&(o<<24|o>>>8),a=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),(A=n[i]).high^=a,A.low^=o}for(var s=0;s<24;s++){for(var d=0;d<5;d++){for(var f=0,p=0,v=0;v<5;v++)f^=(A=n[d+5*v]).high,p^=A.low;var g=h[d];g.high=f,g.low=p}for(d=0;d<5;d++){var m=h[(d+4)%5],y=h[(d+1)%5],b=y.high,S=y.low;for(f=m.high^(b<<1|S>>>31),p=m.low^(S<<1|b>>>31),v=0;v<5;v++)(A=n[d+5*v]).high^=f,A.low^=p}for(var w=1;w<25;w++){var k=(A=n[w]).high,C=A.low,E=c[w];E<32?(f=k<<E|C>>>32-E,p=C<<E|k>>>32-E):(f=C<<E-32|k>>>64-E,p=k<<E-32|C>>>64-E);var x=h[u[w]];x.high=f,x.low=p}var I=h[0],_=n[0];for(I.high=_.high,I.low=_.low,d=0;d<5;d++)for(v=0;v<5;v++){var A=n[w=d+5*v],T=h[w],R=h[(d+1)%5+5*v],O=h[(d+2)%5+5*v];A.high=T.high^~R.high&O.high,A.low=T.low^~R.low&O.low}A=n[0];var D=l[s];A.high^=D.high,A.low^=D.low}},_doFinalize:function(){var t=this._data,n=t.words;this._nDataBytes;var r=8*t.sigBytes,o=32*this.blockSize;n[r>>>5]|=1<<24-r%32,n[(e.ceil((r+1)/o)*o>>>5)-1]|=128,t.sigBytes=4*n.length,this._process();for(var a=this._state,s=this.cfg.outputLength/8,c=s/8,u=[],l=0;l<c;l++){var h=a[l],d=h.high,f=h.low;d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),u.push(f),u.push(d)}return new i.init(u,s)},clone:function(){for(var e=o.clone.call(this),t=e._state=this._state.slice(0),n=0;n<25;n++)t[n]=t[n].clone();return e}});t.SHA3=o._createHelper(d),t.HmacSHA3=o._createHmacHelper(d)}(Math),n.SHA3)})),y((function(e,t){var n;e.exports=(n=Fh,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=i.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]),c=i.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]),u=i.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]),l=i.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]),h=i.create([0,1518500249,1859775393,2400959708,2840853838]),d=i.create([1352829926,1548603684,1836072691,2053994217,0]),f=a.RIPEMD160=o.extend({_doReset:function(){this._hash=i.create([1732584193,4023233417,2562383102,271733878,3285377520])},_doProcessBlock:function(e,t){for(var n=0;n<16;n++){var r=t+n,i=e[r];e[r]=16711935&(i<<8|i>>>24)|4278255360&(i<<24|i>>>8)}var o,a,f,S,w,k,C,E,x,I,_,A=this._hash.words,T=h.words,R=d.words,O=s.words,D=c.words,N=u.words,L=l.words;for(k=o=A[0],C=a=A[1],E=f=A[2],x=S=A[3],I=w=A[4],n=0;n<80;n+=1)_=o+e[t+O[n]]|0,_+=n<16?p(a,f,S)+T[0]:n<32?v(a,f,S)+T[1]:n<48?g(a,f,S)+T[2]:n<64?m(a,f,S)+T[3]:y(a,f,S)+T[4],_=(_=b(_|=0,N[n]))+w|0,o=w,w=S,S=b(f,10),f=a,a=_,_=k+e[t+D[n]]|0,_+=n<16?y(C,E,x)+R[0]:n<32?m(C,E,x)+R[1]:n<48?g(C,E,x)+R[2]:n<64?v(C,E,x)+R[3]:p(C,E,x)+R[4],_=(_=b(_|=0,L[n]))+I|0,k=I,I=x,x=b(E,10),E=C,C=_;_=A[1]+f+x|0,A[1]=A[2]+S+I|0,A[2]=A[3]+w+k|0,A[3]=A[4]+o+C|0,A[4]=A[0]+a+E|0,A[0]=_},_doFinalize:function(){var e=this._data,t=e.words,n=8*this._nDataBytes,r=8*e.sigBytes;t[r>>>5]|=128<<24-r%32,t[14+(r+64>>>9<<4)]=16711935&(n<<8|n>>>24)|4278255360&(n<<24|n>>>8),e.sigBytes=4*(t.length+1),this._process();for(var i=this._hash,o=i.words,a=0;a<5;a++){var s=o[a];o[a]=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8)}return i},clone:function(){var e=o.clone.call(this);return e._hash=this._hash.clone(),e}});function p(e,t,n){return e^t^n}function v(e,t,n){return e&t|~e&n}function g(e,t,n){return(e|~t)^n}function m(e,t,n){return e&n|t&~n}function y(e,t,n){return e^(t|~n)}function b(e,t){return e<<t|e>>>32-t}t.RIPEMD160=o._createHelper(f),t.HmacRIPEMD160=o._createHmacHelper(f)}(),n.RIPEMD160)})),y((function(e,t){var n,r,i;e.exports=(r=(n=Fh).lib.Base,i=n.enc.Utf8,void(n.algo.HMAC=r.extend({init:function(e,t){e=this._hasher=new e.init,"string"==typeof t&&(t=i.parse(t));var n=e.blockSize,r=4*n;t.sigBytes>r&&(t=e.finalize(t)),t.clamp();for(var o=this._oKey=t.clone(),a=this._iKey=t.clone(),s=o.words,c=a.words,u=0;u<n;u++)s[u]^=1549556828,c[u]^=909522486;o.sigBytes=a.sigBytes=r,this.reset()},reset:function(){var e=this._hasher;e.reset(),e.update(this._iKey)},update:function(e){return this._hasher.update(e),this},finalize:function(e){var t=this._hasher,n=t.finalize(e);return t.reset(),t.finalize(this._oKey.clone().concat(n))}})))})),y((function(e,t){var n,r,i,o,a,s,c,u,l;e.exports=(r=(n=l=Fh).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.SHA1,c=a.HMAC,u=a.PBKDF2=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n=this.cfg,r=c.create(n.hasher,e),i=o.create(),a=o.create([1]),s=i.words,u=a.words,l=n.keySize,h=n.iterations;s.length<l;){var d=r.update(t).finalize(a);r.reset();for(var f=d.words,p=f.length,v=d,g=1;g<h;g++){v=r.finalize(v),r.reset();for(var m=v.words,y=0;y<p;y++)f[y]^=m[y]}i.concat(d),u[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,n){return u.create(n).compute(e,t)},l.PBKDF2)})),y((function(e,t){var n,r,i,o,a,s,c,u;e.exports=(r=(n=u=Fh).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.MD5,c=a.EvpKDF=i.extend({cfg:i.extend({keySize:4,hasher:s,iterations:1}),init:function(e){this.cfg=this.cfg.extend(e)},compute:function(e,t){for(var n,r=this.cfg,i=r.hasher.create(),a=o.create(),s=a.words,c=r.keySize,u=r.iterations;s.length<c;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<u;l++)n=i.finalize(n),i.reset();a.concat(n)}return a.sigBytes=4*c,a}}),n.EvpKDF=function(e,t,n){return c.create(n).compute(e,t)},u.EvpKDF)})),y((function(e,t){var n;e.exports=void((n=Fh).lib.Cipher||function(e){var t=n,r=t.lib,i=r.Base,o=r.WordArray,a=r.BufferedBlockAlgorithm,s=t.enc;s.Utf8;var c=s.Base64,u=t.algo.EvpKDF,l=r.Cipher=a.extend({cfg:i.extend(),createEncryptor:function(e,t){return this.create(this._ENC_XFORM_MODE,e,t)},createDecryptor:function(e,t){return this.create(this._DEC_XFORM_MODE,e,t)},init:function(e,t,n){this.cfg=this.cfg.extend(n),this._xformMode=e,this._key=t,this.reset()},reset:function(){a.reset.call(this),this._doReset()},process:function(e){return this._append(e),this._process()},finalize:function(e){return e&&this._append(e),this._doFinalize()},keySize:4,ivSize:4,_ENC_XFORM_MODE:1,_DEC_XFORM_MODE:2,_createHelper:function(){function e(e){return"string"==typeof e?b:m}return function(t){return{encrypt:function(n,r,i){return e(r).encrypt(t,n,r,i)},decrypt:function(n,r,i){return e(r).decrypt(t,n,r,i)}}}}()});r.StreamCipher=l.extend({_doFinalize:function(){return this._process(!0)},blockSize:1});var h=t.mode={},d=r.BlockCipherMode=i.extend({createEncryptor:function(e,t){return this.Encryptor.create(e,t)},createDecryptor:function(e,t){return this.Decryptor.create(e,t)},init:function(e,t){this._cipher=e,this._iv=t}}),f=h.CBC=function(){var e=d.extend();function t(e,t,n){var r,i=this._iv;i?(r=i,this._iv=void 0):r=this._prevBlock;for(var o=0;o<n;o++)e[t+o]^=r[o]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize;t.call(this,e,n,i),r.encryptBlock(e,n),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=e.slice(n,n+i);r.decryptBlock(e,n),t.call(this,e,n,i),this._prevBlock=o}}),e}(),p=(t.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,a=[],s=0;s<r;s+=4)a.push(i);var c=o.create(a,r);e.concat(c)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}};r.BlockCipher=l.extend({cfg:l.cfg.extend({mode:f,padding:p}),reset:function(){var e;l.reset.call(this);var t=this.cfg,n=t.iv,r=t.mode;this._xformMode==this._ENC_XFORM_MODE?e=r.createEncryptor:(e=r.createDecryptor,this._minBufferSize=1),this._mode&&this._mode.__creator==e?this._mode.init(this,n&&n.words):(this._mode=e.call(r,this,n&&n.words),this._mode.__creator=e)},_doProcessBlock:function(e,t){this._mode.processBlock(e,t)},_doFinalize:function(){var e,t=this.cfg.padding;return this._xformMode==this._ENC_XFORM_MODE?(t.pad(this._data,this.blockSize),e=this._process(!0)):(e=this._process(!0),t.unpad(e)),e},blockSize:4});var v=r.CipherParams=i.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),g=(t.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?o.create([1398893684,1701076831]).concat(n).concat(t):t).toString(c)},parse:function(e){var t,n=c.parse(e),r=n.words;return 1398893684==r[0]&&1701076831==r[1]&&(t=o.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),v.create({ciphertext:n,salt:t})}},m=r.SerializableCipher=i.extend({cfg:i.extend({format:g}),encrypt:function(e,t,n,r){r=this.cfg.extend(r);var i=e.createEncryptor(n,r),o=i.finalize(t),a=i.cfg;return v.create({ciphertext:o,key:n,iv:a.iv,algorithm:e,mode:a.mode,padding:a.padding,blockSize:e.blockSize,formatter:r.format})},decrypt:function(e,t,n,r){return r=this.cfg.extend(r),t=this._parse(t,r.format),e.createDecryptor(n,r).finalize(t.ciphertext)},_parse:function(e,t){return"string"==typeof e?t.parse(e,this):e}}),y=(t.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=o.random(8));var i=u.create({keySize:t+n}).compute(e,r),a=o.create(i.words.slice(t),4*n);return i.sigBytes=4*t,v.create({key:i,iv:a,salt:r})}},b=r.PasswordBasedCipher=m.extend({cfg:m.cfg.extend({kdf:y}),encrypt:function(e,t,n,r){var i=(r=this.cfg.extend(r)).kdf.execute(n,e.keySize,e.ivSize);r.iv=i.iv;var o=m.encrypt.call(this,e,t,i.key,r);return o.mixIn(i),o},decrypt:function(e,t,n,r){r=this.cfg.extend(r),t=this._parse(t,r.format);var i=r.kdf.execute(n,e.keySize,e.ivSize,t.salt);return r.iv=i.iv,m.decrypt.call(this,e,t,i.key,r)}})}())})),y((function(e,t){var n;e.exports=((n=Fh).mode.CFB=function(){var e=n.lib.BlockCipherMode.extend();function t(e,t,n,r){var i,o=this._iv;o?(i=o.slice(0),this._iv=void 0):i=this._prevBlock,r.encryptBlock(i,0);for(var a=0;a<n;a++)e[t+a]^=i[a]}return e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize;t.call(this,e,n,i,r),this._prevBlock=e.slice(n,n+i)}}),e.Decryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=e.slice(n,n+i);t.call(this,e,n,i,r),this._prevBlock=o}}),e}(),n.mode.CFB)})),y((function(e,t){var n,r,i;e.exports=((i=Fh).mode.CTR=(n=i.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._counter;i&&(o=this._counter=i.slice(0),this._iv=void 0);var a=o.slice(0);n.encryptBlock(a,0),o[r-1]=o[r-1]+1|0;for(var s=0;s<r;s++)e[t+s]^=a[s]}}),n.Decryptor=r,n),i.mode.CTR)})),y((function(e,t){var n;e.exports=((n=Fh).mode.CTRGladman=function(){var e=n.lib.BlockCipherMode.extend();function t(e){if(255==(e>>24&255)){var t=e>>16&255,n=e>>8&255,r=255&e;255===t?(t=0,255===n?(n=0,255===r?r=0:++r):++n):++t,e=0,e+=t<<16,e+=n<<8,e+=r}else e+=1<<24;return e}var r=e.Encryptor=e.extend({processBlock:function(e,n){var r=this._cipher,i=r.blockSize,o=this._iv,a=this._counter;o&&(a=this._counter=o.slice(0),this._iv=void 0),function(e){0===(e[0]=t(e[0]))&&(e[1]=t(e[1]))}(a);var s=a.slice(0);r.encryptBlock(s,0);for(var c=0;c<i;c++)e[n+c]^=s[c]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)})),y((function(e,t){var n,r,i;e.exports=((i=Fh).mode.OFB=(n=i.lib.BlockCipherMode.extend(),r=n.Encryptor=n.extend({processBlock:function(e,t){var n=this._cipher,r=n.blockSize,i=this._iv,o=this._keystream;i&&(o=this._keystream=i.slice(0),this._iv=void 0),n.encryptBlock(o,0);for(var a=0;a<r;a++)e[t+a]^=o[a]}}),n.Decryptor=r,n),i.mode.OFB)})),y((function(e,t){var n,r;e.exports=((r=Fh).mode.ECB=((n=r.lib.BlockCipherMode.extend()).Encryptor=n.extend({processBlock:function(e,t){this._cipher.encryptBlock(e,t)}}),n.Decryptor=n.extend({processBlock:function(e,t){this._cipher.decryptBlock(e,t)}}),n),r.mode.ECB)})),y((function(e,t){var n;e.exports=((n=Fh).pad.AnsiX923={pad:function(e,t){var n=e.sigBytes,r=4*t,i=r-n%r,o=n+i-1;e.clamp(),e.words[o>>>2]|=i<<24-o%4*8,e.sigBytes+=i},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Ansix923)})),y((function(e,t){var n;e.exports=((n=Fh).pad.Iso10126={pad:function(e,t){var r=4*t,i=r-e.sigBytes%r;e.concat(n.lib.WordArray.random(i-1)).concat(n.lib.WordArray.create([i<<24],1))},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},n.pad.Iso10126)})),y((function(e,t){var n;e.exports=((n=Fh).pad.Iso97971={pad:function(e,t){e.concat(n.lib.WordArray.create([2147483648],1)),n.pad.ZeroPadding.pad(e,t)},unpad:function(e){n.pad.ZeroPadding.unpad(e),e.sigBytes--}},n.pad.Iso97971)})),y((function(e,t){var n;e.exports=((n=Fh).pad.ZeroPadding={pad:function(e,t){var n=4*t;e.clamp(),e.sigBytes+=n-(e.sigBytes%n||n)},unpad:function(e){var t=e.words,n=e.sigBytes-1;for(n=e.sigBytes-1;n>=0;n--)if(t[n>>>2]>>>24-n%4*8&255){e.sigBytes=n+1;break}}},n.pad.ZeroPadding)})),y((function(e,t){var n;e.exports=((n=Fh).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)})),y((function(e,t){var n,r,i,o;e.exports=(r=(n=o=Fh).lib.CipherParams,i=n.enc.Hex,n.format.Hex={stringify:function(e){return e.ciphertext.toString(i)},parse:function(e){var t=i.parse(e);return r.create({ciphertext:t})}},o.format.Hex)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],a=[],s=[],c=[],u=[],l=[],h=[],d=[],f=[];!function(){for(var e=[],t=0;t<256;t++)e[t]=t<128?t<<1:t<<1^283;var n=0,r=0;for(t=0;t<256;t++){var p=r^r<<1^r<<2^r<<3^r<<4;p=p>>>8^255&p^99,i[n]=p,o[p]=n;var v=e[n],g=e[v],m=e[g],y=257*e[p]^16843008*p;a[n]=y<<24|y>>>8,s[n]=y<<16|y>>>16,c[n]=y<<8|y>>>24,u[n]=y,y=16843009*m^65537*g^257*v^16843008*n,l[p]=y<<24|y>>>8,h[p]=y<<16|y>>>16,d[p]=y<<8|y>>>24,f[p]=y,n?(n=v^e[e[e[m^v]]],r^=e[e[r]]):n=r=1}}();var p=[0,1,2,4,8,16,32,64,128,27,54],v=r.AES=t.extend({_doReset:function(){if(!this._nRounds||this._keyPriorReset!==this._key){for(var e=this._keyPriorReset=this._key,t=e.words,n=e.sigBytes/4,r=4*((this._nRounds=n+6)+1),o=this._keySchedule=[],a=0;a<r;a++)a<n?o[a]=t[a]:(u=o[a-1],a%n?n>6&&a%n==4&&(u=i[u>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u]):(u=i[(u=u<<8|u>>>24)>>>24]<<24|i[u>>>16&255]<<16|i[u>>>8&255]<<8|i[255&u],u^=p[a/n|0]<<24),o[a]=o[a-n]^u);for(var s=this._invKeySchedule=[],c=0;c<r;c++){if(a=r-c,c%4)var u=o[a];else u=o[a-4];s[c]=c<4||a<=4?u:l[i[u>>>24]]^h[i[u>>>16&255]]^d[i[u>>>8&255]]^f[i[255&u]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,c,u,i)},decryptBlock:function(e,t){var n=e[t+1];e[t+1]=e[t+3],e[t+3]=n,this._doCryptBlock(e,t,this._invKeySchedule,l,h,d,f,o),n=e[t+1],e[t+1]=e[t+3],e[t+3]=n},_doCryptBlock:function(e,t,n,r,i,o,a,s){for(var c=this._nRounds,u=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],d=e[t+3]^n[3],f=4,p=1;p<c;p++){var v=r[u>>>24]^i[l>>>16&255]^o[h>>>8&255]^a[255&d]^n[f++],g=r[l>>>24]^i[h>>>16&255]^o[d>>>8&255]^a[255&u]^n[f++],m=r[h>>>24]^i[d>>>16&255]^o[u>>>8&255]^a[255&l]^n[f++],y=r[d>>>24]^i[u>>>16&255]^o[l>>>8&255]^a[255&h]^n[f++];u=v,l=g,h=m,d=y}v=(s[u>>>24]<<24|s[l>>>16&255]<<16|s[h>>>8&255]<<8|s[255&d])^n[f++],g=(s[l>>>24]<<24|s[h>>>16&255]<<16|s[d>>>8&255]<<8|s[255&u])^n[f++],m=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[u>>>8&255]<<8|s[255&l])^n[f++],y=(s[d>>>24]<<24|s[u>>>16&255]<<16|s[l>>>8&255]<<8|s[255&h])^n[f++],e[t]=v,e[t+1]=g,e[t+2]=m,e[t+3]=y},keySize:8});e.AES=t._createHelper(v)}(),n.AES)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib,r=t.WordArray,i=t.BlockCipher,o=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],s=[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],c=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],u=[{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}],l=[4160749569,528482304,33030144,2064384,129024,8064,504,2147483679],h=o.DES=i.extend({_doReset:function(){for(var e=this._key.words,t=[],n=0;n<56;n++){var r=a[n]-1;t[n]=e[r>>>5]>>>31-r%32&1}for(var i=this._subKeys=[],o=0;o<16;o++){var u=i[o]=[],l=c[o];for(n=0;n<24;n++)u[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,u[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(u[0]=u[0]<<1|u[0]>>>31,n=1;n<7;n++)u[n]=u[n]>>>4*(n-1)+3;u[7]=u[7]<<5|u[7]>>>27}var h=this._invSubKeys=[];for(n=0;n<16;n++)h[n]=i[15-n]},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._subKeys)},decryptBlock:function(e,t){this._doCryptBlock(e,t,this._invSubKeys)},_doCryptBlock:function(e,t,n){this._lBlock=e[t],this._rBlock=e[t+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 i=n[r],o=this._lBlock,a=this._rBlock,s=0,c=0;c<8;c++)s|=u[c][((a^i[c])&l[c])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,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),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function d(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function f(e,t){var n=(this._rBlock>>>e^this._lBlock)&t;this._lBlock^=n,this._rBlock^=n<<e}e.DES=i._createHelper(h);var p=o.TripleDES=i.extend({_doReset:function(){var e=this._key.words;if(2!==e.length&&4!==e.length&&e.length<6)throw new Error("Invalid key length - 3DES requires the key length to be 64, 128, 192 or >192.");var t=e.slice(0,2),n=e.length<4?e.slice(0,2):e.slice(2,4),i=e.length<6?e.slice(0,2):e.slice(4,6);this._des1=h.createEncryptor(r.create(t)),this._des2=h.createEncryptor(r.create(n)),this._des3=h.createEncryptor(r.create(i))},encryptBlock:function(e,t){this._des1.encryptBlock(e,t),this._des2.decryptBlock(e,t),this._des3.encryptBlock(e,t)},decryptBlock:function(e,t){this._des3.decryptBlock(e,t),this._des2.encryptBlock(e,t),this._des1.decryptBlock(e,t)},keySize:6,ivSize:2,blockSize:2});e.TripleDES=i._createHelper(p)}(),n.TripleDES)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=r.RC4=t.extend({_doReset:function(){for(var e=this._key,t=e.words,n=e.sigBytes,r=this._S=[],i=0;i<256;i++)r[i]=i;i=0;for(var o=0;i<256;i++){var a=i%n,s=t[a>>>2]>>>24-a%4*8&255;o=(o+r[i]+s)%256;var c=r[i];r[i]=r[o],r[o]=c}this._i=this._j=0},_doProcessBlock:function(e,t){e[t]^=o.call(this)},keySize:8,ivSize:0});function o(){for(var e=this._S,t=this._i,n=this._j,r=0,i=0;i<4;i++){n=(n+e[t=(t+1)%256])%256;var o=e[t];e[t]=e[n],e[n]=o,r|=e[(e[t]+e[n])%256]<<24-8*i}return this._i=t,this._j=n,r}e.RC4=t._createHelper(i);var a=r.RC4Drop=i.extend({cfg:i.cfg.extend({drop:192}),_doReset:function(){i._doReset.call(this);for(var e=this.cfg.drop;e>0;e--)o.call(this)}});e.RC4Drop=t._createHelper(a)}(),n.RC4)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.Rabbit=t.extend({_doReset:function(){for(var e=this._key.words,t=this.cfg.iv,n=0;n<4;n++)e[n]=16711935&(e[n]<<8|e[n]>>>24)|4278255360&(e[n]<<24|e[n]>>>8);var r=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],i=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];for(this._b=0,n=0;n<4;n++)c.call(this);for(n=0;n<8;n++)i[n]^=r[n+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,d=l<<16|65535&u;for(i[0]^=u,i[1]^=h,i[2]^=l,i[3]^=d,i[4]^=u,i[5]^=h,i[6]^=l,i[7]^=d,n=0;n<4;n++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.Rabbit=t._createHelper(s)}(),n.Rabbit)})),y((function(e,t){var n;e.exports=(n=Fh,function(){var e=n,t=e.lib.StreamCipher,r=e.algo,i=[],o=[],a=[],s=r.RabbitLegacy=t.extend({_doReset:function(){var e=this._key.words,t=this.cfg.iv,n=this._X=[e[0],e[3]<<16|e[2]>>>16,e[1],e[0]<<16|e[3]>>>16,e[2],e[1]<<16|e[0]>>>16,e[3],e[2]<<16|e[1]>>>16],r=this._C=[e[2]<<16|e[2]>>>16,4294901760&e[0]|65535&e[1],e[3]<<16|e[3]>>>16,4294901760&e[1]|65535&e[2],e[0]<<16|e[0]>>>16,4294901760&e[2]|65535&e[3],e[1]<<16|e[1]>>>16,4294901760&e[3]|65535&e[0]];this._b=0;for(var i=0;i<4;i++)c.call(this);for(i=0;i<8;i++)r[i]^=n[i+4&7];if(t){var o=t.words,a=o[0],s=o[1],u=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=u>>>16|4294901760&l,d=l<<16|65535&u;for(r[0]^=u,r[1]^=h,r[2]^=l,r[3]^=d,r[4]^=u,r[5]^=h,r[6]^=l,r[7]^=d,i=0;i<4;i++)c.call(this)}},_doProcessBlock:function(e,t){var n=this._X;c.call(this),i[0]=n[0]^n[5]>>>16^n[3]<<16,i[1]=n[2]^n[7]>>>16^n[5]<<16,i[2]=n[4]^n[1]>>>16^n[7]<<16,i[3]=n[6]^n[3]>>>16^n[1]<<16;for(var r=0;r<4;r++)i[r]=16711935&(i[r]<<8|i[r]>>>24)|4278255360&(i[r]<<24|i[r]>>>8),e[t+r]^=i[r]},blockSize:4,ivSize:2});function c(){for(var e=this._X,t=this._C,n=0;n<8;n++)o[n]=t[n];for(t[0]=t[0]+1295307597+this._b|0,t[1]=t[1]+3545052371+(t[0]>>>0<o[0]>>>0?1:0)|0,t[2]=t[2]+886263092+(t[1]>>>0<o[1]>>>0?1:0)|0,t[3]=t[3]+1295307597+(t[2]>>>0<o[2]>>>0?1:0)|0,t[4]=t[4]+3545052371+(t[3]>>>0<o[3]>>>0?1:0)|0,t[5]=t[5]+886263092+(t[4]>>>0<o[4]>>>0?1:0)|0,t[6]=t[6]+1295307597+(t[5]>>>0<o[5]>>>0?1:0)|0,t[7]=t[7]+3545052371+(t[6]>>>0<o[6]>>>0?1:0)|0,this._b=t[7]>>>0<o[7]>>>0?1:0,n=0;n<8;n++){var r=e[n]+t[n],i=65535&r,s=r>>>16,c=((i*i>>>17)+i*s>>>15)+s*s,u=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=c^u}e[0]=a[0]+(a[7]<<16|a[7]>>>16)+(a[6]<<16|a[6]>>>16)|0,e[1]=a[1]+(a[0]<<8|a[0]>>>24)+a[7]|0,e[2]=a[2]+(a[1]<<16|a[1]>>>16)+(a[0]<<16|a[0]>>>16)|0,e[3]=a[3]+(a[2]<<8|a[2]>>>24)+a[1]|0,e[4]=a[4]+(a[3]<<16|a[3]>>>16)+(a[2]<<16|a[2]>>>16)|0,e[5]=a[5]+(a[4]<<8|a[4]>>>24)+a[3]|0,e[6]=a[6]+(a[5]<<16|a[5]>>>16)+(a[4]<<16|a[4]>>>16)|0,e[7]=a[7]+(a[6]<<8|a[6]>>>24)+a[5]|0}e.RabbitLegacy=t._createHelper(s)}(),n.RabbitLegacy)})),y((function(e,t){e.exports=Fh}))),Yh=Rt.includes,Vh=C((function(){return!Array(1).includes()}));qt({target:"Array",proto:!0,forced:Vh},{includes:function(e){return Yh(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("includes");var Xh=TypeError,Wh=function(e){if(Sa(e))throw Xh("The method doesn't accept regular expressions");return e},qh=Te("match"),Zh=M("".indexOf);qt({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[qh]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~Zh(po(z(this)),po(Wh(e)),arguments.length>1?arguments[1]:void 0)}});var Jh=C((function(){Zt(1)}));qt({target:"Object",stat:!0,forced:Jh},{keys:function(e){return Zt(ye(e))}});var $h=function(e,t){return function(){for(var n=new Array(arguments.length),r=0;r<n.length;r++)n[r]=arguments[r];return e.apply(t,n)}},Qh=Object.prototype.toString;function ed(e){return"[object Array]"===Qh.call(e)}function td(e){return void 0===e}function nd(e){return null!==e&&"object"==typeof e}function rd(e){return"[object Function]"===Qh.call(e)}function id(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),ed(e))for(var n=0,r=e.length;n<r;n++)t.call(null,e[n],n,e);else for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&t.call(null,e[i],i,e)}var od={isArray:ed,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Qh.call(e)},isBuffer:function(e){return null!==e&&!td(e)&&null!==e.constructor&&!td(e.constructor)&&"function"==typeof e.constructor.isBuffer&&e.constructor.isBuffer(e)},isFormData:function(e){return"undefined"!=typeof FormData&&e instanceof FormData},isArrayBufferView:function(e){return"undefined"!=typeof ArrayBuffer&&ArrayBuffer.isView?ArrayBuffer.isView(e):e&&e.buffer&&e.buffer instanceof ArrayBuffer},isString:function(e){return"string"==typeof e},isNumber:function(e){return"number"==typeof e},isObject:nd,isUndefined:td,isDate:function(e){return"[object Date]"===Qh.call(e)},isFile:function(e){return"[object File]"===Qh.call(e)},isBlob:function(e){return"[object Blob]"===Qh.call(e)},isFunction:rd,isStream:function(e){return nd(e)&&rd(e.pipe)},isURLSearchParams:function(e){return"undefined"!=typeof URLSearchParams&&e instanceof URLSearchParams},isStandardBrowserEnv:function(){return("undefined"==typeof navigator||"ReactNative"!==navigator.product&&"NativeScript"!==navigator.product&&"NS"!==navigator.product)&&("undefined"!=typeof window&&"undefined"!=typeof document)},forEach:id,merge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]=n}for(var r=0,i=arguments.length;r<i;r++)id(arguments[r],n);return t},deepMerge:function e(){var t={};function n(n,r){"object"==typeof t[r]&&"object"==typeof n?t[r]=e(t[r],n):t[r]="object"==typeof n?e({},n):n}for(var r=0,i=arguments.length;r<i;r++)id(arguments[r],n);return t},extend:function(e,t,n){return id(t,(function(t,r){e[r]=n&&"function"==typeof t?$h(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function ad(e){return encodeURIComponent(e).replace(/%40/gi,"@").replace(/%3A/gi,":").replace(/%24/g,"$").replace(/%2C/gi,",").replace(/%20/g,"+").replace(/%5B/gi,"[").replace(/%5D/gi,"]")}var sd=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(od.isURLSearchParams(t))r=t.toString();else{var i=[];od.forEach(t,(function(e,t){null!=e&&(od.isArray(e)?t+="[]":e=[e],od.forEach(e,(function(e){od.isDate(e)?e=e.toISOString():od.isObject(e)&&(e=JSON.stringify(e)),i.push(ad(t)+"="+ad(e))})))})),r=i.join("&")}if(r){var o=e.indexOf("#");-1!==o&&(e=e.slice(0,o)),e+=(-1===e.indexOf("?")?"?":"&")+r}return e};function cd(){this.handlers=[]}cd.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},cd.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},cd.prototype.forEach=function(e){od.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var ud=cd,ld=function(e,t,n){return od.forEach(n,(function(n){e=n(e,t)})),e},hd=function(e){return!(!e||!e.__CANCEL__)},dd=function(e,t){od.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},fd=function(e,t,n,r,i){return function(e,t,n,r,i){return e.config=t,n&&(e.code=n),e.request=r,e.response=i,e.isAxiosError=!0,e.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}},e}(new Error(e),t,n,r,i)},pd=["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"],vd=od.isStandardBrowserEnv()?function(){var e,t=/(msie|trident)/i.test(navigator.userAgent),n=document.createElement("a");function r(e){var r=e;return t&&(n.setAttribute("href",r),r=n.href),n.setAttribute("href",r),{href:n.href,protocol:n.protocol?n.protocol.replace(/:$/,""):"",host:n.host,search:n.search?n.search.replace(/^\?/,""):"",hash:n.hash?n.hash.replace(/^#/,""):"",hostname:n.hostname,port:n.port,pathname:"/"===n.pathname.charAt(0)?n.pathname:"/"+n.pathname}}return e=r(window.location.href),function(t){var n=od.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},gd=od.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),od.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),od.isString(r)&&a.push("path="+r),od.isString(i)&&a.push("domain="+i),!0===o&&a.push("secure"),document.cookie=a.join("; ")},read:function(e){var t=document.cookie.match(new RegExp("(^|;\\s*)("+e+")=([^;]*)"));return t?decodeURIComponent(t[3]):null},remove:function(e){this.write(e,"",Date.now()-864e5)}}:{write:function(){},read:function(){return null},remove:function(){}},md=function(e){return new Promise((function(t,n){var r=e.data,i=e.headers;od.isFormData(r)&&delete i["Content-Type"];var o=new XMLHttpRequest;if(e.auth){var a=e.auth.username||"",s=e.auth.password||"";i.Authorization="Basic "+btoa(a+":"+s)}var c,u,l=(c=e.baseURL,u=e.url,c&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(u)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(c,u):u);if(o.open(e.method.toUpperCase(),sd(l,e.params,e.paramsSerializer),!0),o.timeout=e.timeout,o.onreadystatechange=function(){if(o&&4===o.readyState&&(0!==o.status||o.responseURL&&0===o.responseURL.indexOf("file:"))){var r="getAllResponseHeaders"in o?function(e){var t,n,r,i={};return e?(od.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=od.trim(e.substr(0,r)).toLowerCase(),n=od.trim(e.substr(r+1)),t){if(i[t]&&pd.indexOf(t)>=0)return;i[t]="set-cookie"===t?(i[t]?i[t]:[]).concat([n]):i[t]?i[t]+", "+n:n}})),i):i}(o.getAllResponseHeaders()):null,i={data:e.responseType&&"text"!==e.responseType?o.response:o.responseText,status:o.status,statusText:o.statusText,headers:r,config:e,request:o};!function(e,t,n){var r=n.config.validateStatus;!r||r(n.status)?e(n):t(fd("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,i),o=null}},o.onabort=function(){o&&(n(fd("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(fd("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(fd(t,e,"ECONNABORTED",o)),o=null},od.isStandardBrowserEnv()){var h=gd,d=(e.withCredentials||vd(l))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;d&&(i[e.xsrfHeaderName]=d)}if("setRequestHeader"in o&&od.forEach(i,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),od.isUndefined(e.withCredentials)||(o.withCredentials=!!e.withCredentials),e.responseType)try{o.responseType=e.responseType}catch(t){if("json"!==e.responseType)throw t}"function"==typeof e.onDownloadProgress&&o.addEventListener("progress",e.onDownloadProgress),"function"==typeof e.onUploadProgress&&o.upload&&o.upload.addEventListener("progress",e.onUploadProgress),e.cancelToken&&e.cancelToken.promise.then((function(e){o&&(o.abort(),n(e),o=null)})),void 0===r&&(r=null),o.send(r)}))},yd={"Content-Type":"application/x-www-form-urlencoded"};function bd(e,t){!od.isUndefined(e)&&od.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Sd,wd={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Sd=md),Sd),transformRequest:[function(e,t){return dd(t,"Accept"),dd(t,"Content-Type"),od.isFormData(e)||od.isArrayBuffer(e)||od.isBuffer(e)||od.isStream(e)||od.isFile(e)||od.isBlob(e)?e:od.isArrayBufferView(e)?e.buffer:od.isURLSearchParams(e)?(bd(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):od.isObject(e)?(bd(t,"application/json;charset=utf-8"),JSON.stringify(e)):e}],transformResponse:[function(e){if("string"==typeof e)try{e=JSON.parse(e)}catch(e){}return e}],timeout:0,xsrfCookieName:"XSRF-TOKEN",xsrfHeaderName:"X-XSRF-TOKEN",maxContentLength:-1,validateStatus:function(e){return e>=200&&e<300}};wd.headers={common:{Accept:"application/json, text/plain, */*"}},od.forEach(["delete","get","head"],(function(e){wd.headers[e]={}})),od.forEach(["post","put","patch"],(function(e){wd.headers[e]=od.merge(yd)}));var kd=wd;function Cd(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var Ed=function(e){return Cd(e),e.headers=e.headers||{},e.data=ld(e.data,e.headers,e.transformRequest),e.headers=od.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),od.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||kd.adapter)(e).then((function(t){return Cd(e),t.data=ld(t.data,t.headers,e.transformResponse),t}),(function(t){return hd(t)||(Cd(e),t&&t.response&&(t.response.data=ld(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},xd=function(e,t){t=t||{};var n={},r=["url","method","params","data"],i=["headers","auth","proxy"],o=["baseURL","url","transformRequest","transformResponse","paramsSerializer","timeout","withCredentials","adapter","responseType","xsrfCookieName","xsrfHeaderName","onUploadProgress","onDownloadProgress","maxContentLength","validateStatus","maxRedirects","httpAgent","httpsAgent","cancelToken","socketPath"];od.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),od.forEach(i,(function(r){od.isObject(t[r])?n[r]=od.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:od.isObject(e[r])?n[r]=od.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),od.forEach(o,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])}));var a=r.concat(i).concat(o),s=Object.keys(t).filter((function(e){return-1===a.indexOf(e)}));return od.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function Id(e){this.defaults=e,this.interceptors={request:new ud,response:new ud}}Id.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=xd(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[Ed,void 0],n=Promise.resolve(e);for(this.interceptors.request.forEach((function(e){t.unshift(e.fulfilled,e.rejected)})),this.interceptors.response.forEach((function(e){t.push(e.fulfilled,e.rejected)}));t.length;)n=n.then(t.shift(),t.shift());return n},Id.prototype.getUri=function(e){return e=xd(this.defaults,e),sd(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},od.forEach(["delete","get","head","options"],(function(e){Id.prototype[e]=function(t,n){return this.request(od.merge(n||{},{method:e,url:t}))}})),od.forEach(["post","put","patch"],(function(e){Id.prototype[e]=function(t,n,r){return this.request(od.merge(r||{},{method:e,url:t,data:n}))}}));var _d=Id;function Ad(e){this.message=e}Ad.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},Ad.prototype.__CANCEL__=!0;var Td=Ad;function Rd(e){if("function"!=typeof e)throw new TypeError("executor must be a function.");var t;this.promise=new Promise((function(e){t=e}));var n=this;e((function(e){n.reason||(n.reason=new Td(e),t(n.reason))}))}Rd.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Rd.source=function(){var e;return{token:new Rd((function(t){e=t})),cancel:e}};var Od=Rd;function Dd(e){var t=new _d(e),n=$h(_d.prototype.request,t);return od.extend(n,_d.prototype,t),od.extend(n,t),n}var Nd=Dd(kd);Nd.Axios=_d,Nd.create=function(e){return Dd(xd(Nd.defaults,e))},Nd.Cancel=Td,Nd.CancelToken=Od,Nd.isCancel=hd,Nd.all=function(e){return Promise.all(e)},Nd.spread=function(e){return function(t){return e.apply(null,t)}};var Ld=Nd,Pd=Nd;Ld.default=Pd;var Md=Ld,Bd=Ra(),Gd=1280,jd=720,Hd=640,Ud=360,Kd=function(e){return Bd.isFirefox?{}:{frameRate:e}},Fd=Object.assign({aspectRatio:1.777777778,resizeMode:"crop-and-scale",width:640,height:360},Kd({min:15,exact:15,max:15})),zd=Object.assign({cursor:"always",logicalSurface:!0},Fd),Yd={720:{common:Object.assign(Object.assign(Object.assign({},zd),{width:1280,height:720}),Kd(15)),advanced:Object.assign(Object.assign({},zd),{frameRate:{ideal:15,max:15},width:{ideal:1280,max:1280},height:{ideal:720,max:720}})},1080:{common:Object.assign(Object.assign(Object.assign({},zd),{width:1920,height:1080}),Kd(15)),advanced:Object.assign(Object.assign({},zd),{frameRate:{ideal:15,max:15},width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}})}},Vd={180:{common:Object.assign(Object.assign(Object.assign({},Fd),{width:320,height:180}),Kd(15)),advanced:Object.assign(Object.assign({},Fd),{frameRate:{min:15,exact:15,max:15},width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}})},360:{common:Object.assign(Object.assign(Object.assign({},Fd),{width:640,height:360}),Kd(15)),advanced:Object.assign(Object.assign({},Fd),{frameRate:{min:15,exact:15,max:15},width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}})},720:{common:Object.assign(Object.assign(Object.assign({},Fd),{width:1280,height:720}),Kd(30)),advanced:Object.assign(Object.assign({},Fd),{frameRate:{min:5,ideal:30,max:30},width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}})}},Xd={"90P":0,"180P":1,"360P":2,"720P":3,"1080P":4,"4K":5,Num:6},Wd={180:50,360:100,720:200},qd=["XYSDK:950401","XYSDK:950402","XYSDK:950403","XYSDK:950404","XYSDK:950405","XYSDK:950406"],Zd=["CONFNO","HARD","TVBOX","BRUCE","DESK","SOFT","H323"],Jd=[0,1,2],$d=[0,1,2,3,4,5],Qd={none:0,wifi:1,"3g":2,wired:3,"2g":4,"4g":5,wwan:6,"3g_china_mobile":7},ef={muteAudio:{type:"AUDIO_MUTE",status:!1},muteVideo:{type:"VIDEO_MUTE",status:!1},unmuteAudio:{type:"AUDIO_UN_MUTE",status:!0},unmuteVideo:{type:"VIDEO_UN_MUTE",status:!0}},tf={bundlePolicy:"max-bundle",iceCandidatePoolSize:0,iceServers:[],iceTransportPolicy:"all",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},nf={OK:"STATE:200",SERVER_INNER_ERROR:"SIG:4448",PEER_NET_DISCONNECT:"SIG:403",LOCAL_NET_DISCONNECT:"SIG:499"},rf={CLIENT_TYPE:"webrtc",INIT_INTERNELS:{bytesReceived:0,bytesReceivedSecond:0,bytesSent:0,bytesSentSecond:0,jitterSent:0,jitterReceived:0,audioSendJitter:0,roundTripTime:0,fractionLostSent:0,fractionLostReceived:0,mimeType:"video/H264",timestamp:0,receiver:{},sender:{},audioReceiver:{},audioSender:{}},RESOLUTION:1,ROSTER:{deviceType:"webrtc",endpointId:"",displayName:"",mediagroupid:0,participantId:0,audioTxMute:!1,videoTxMute:!1,audioRxMute:!1,videoRxMute:!1,videoMuteReason:0,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1,isContent:!1,isActiveSpeaker:!1,id:"",extUserId:""},SELF_MOCK_PID:9999999999,HOR_CONTAINER_RATIO:1.778,VER_CONTAINER_RATIO:.5625,RATIO_MAP:{0:0,1:90,2:180,3:270},MAP_RESOLUTION_INDEX:{90:0,180:1,360:2,720:3,1080:4},RESOLUTION_MAP:{0:90,1:180,2:360,3:720,4:1080},VIDE_BANDWIDTH_BIT:1e3,LOGIN_INFO:{callUri:"",securityKey:"",access_token:"",refresh_token:"",id:0,displayName:""},LAYOUT:{position:[],resolution:0,rotate:0,quality:0,state:"NORMAL",roster:{deviceType:"webrtc",endpointId:"",displayName:"",mediagroupid:0,participantId:0,audioTxMute:!1,videoTxMute:!1,audioRxMute:!1,videoRxMute:!1,videoMuteReason:0,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1,isContent:!1,isActiveSpeaker:!1,id:"",extUserId:""}},MAP_RESOLUTION_STRING:{90:{width:160,height:90},180:{width:320,height:180},360:{width:640,height:360},720:{width:1280,height:720},1080:{width:1920,height:1080}},CONF_INFO:{participantCount:0,totalEpCount:0,chairManUrl:"",contentUri:"",actSpkUri:""}},of=["SPEAKER","GALLERY"],af=["MULTI_PIC_CONTENT_HIGH_PRIORITY","MULTI_PIC_ACTIVE_HIGH_PRIORITY","TWO_PIC_PIP","CONTENT_ONLY","TWO_PIC_SYMMETRIC"],sf="standardWebRtc",cf="thirdWebRtc",uf={muteAudio:"audioMute",unmuteAudio:"audioUnmute",muteVideo:"videoMute",unmuteVideo:"videoUnmute"},lf=0,hf=1,df=2,ff={180:3,360:2,720:1},pf={0:"",1:"HIDE",2:"SDKMonitor+hide"},vf=["HIDE","SDKMonitor+hide"],gf=["Chinese","English"],mf=["clientId","clientSecret","password","token","pwd","securityKey","access_token","refresh_token"],yf={enableMobileNotAuth:!1},bf={errorCode:10002e3},Sf=function(){function t(r){var i=this;n(this,t),this.assignOptions=function(e){return Object.assign({},i.commonOption,e,{params:Object.assign({},i.commonOption.params,e&&e.params)})},this.get=function(e,t){return i.axios.get(e,i.assignOptions(t)).catch((function(e){return e}))},this.put=function(e,t,n){return i.axios.put(e,t,i.assignOptions(n)).catch((function(e){return e}))},this.post=function(e,t,n){return i.axios.post(e,t,i.assignOptions(n)).catch((function(e){return e}))},this.delete=function(e,t){return i.axios.delete(e,i.assignOptions(t)).catch((function(e){return e}))},this.commonOption=r,this.loginInfo=null,this.logger=null,this.baseUrl="",this.clientId="",this.clientSecret="",this.retryCount=0;var o=Object.assign(Object.assign({},r),{headers:{"n-ua":"PL=webrtc-sdk&AV=1.0.0&DR=&RL=&MF=&MO=web&OS=web-sdk&API=&LCLO=&LCLA=&CK="}});Md.defaults.timeout=1e4,this.axios=Md.create(o),this.axios.interceptors.request.use((function(e){var t=Math.ceil(1e4*Math.random());return e.url.includes("random=")||(e.url.includes("?")?e.url+="&random=".concat(t):e.url+="?random=".concat(t)),i.setHttpConfig(e),i.logger&&i.logger.log("[http] request:",e.url),e})),this.axios.interceptors.response.use((function(e){return i.logger&&i.logger.log("[http] response:",null==e?void 0:e.data),e}),(function(t){return Rn(i,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger&&this.logger.log("[http] response error:",t),!t.response){e.next=24;break}if(s=t.response||{},c=s.status,u=s.data,401!==c||(null==u?void 0:u.errorCode)!==bf.errorCode){e.next=24;break}if(!(this.retryCount>=1)){e.next=7;break}return this.retryCount=0,e.abrupt("return",Promise.reject(bf));case 7:return e.prev=7,e.next=10,this.refreshToken({baseURL:t.config.baseURL});case 10:if(!(l=e.sent)){e.next=18;break}return h=l.access_token,null===(r=this.logger)||void 0===r||r.log("[http] error.config pre:",t.config),(null===(i=t.config.params)||void 0===i?void 0:i.token)&&(t.config.params.token=h),(null===(o=t.config.data)||void 0===o?void 0:o.includes("token"))&&(d=JSON.parse(t.config.data),t.config.data=JSON.stringify(Object.assign(d,{token:h})),null===(a=this.logger)||void 0===a||a.log("[http] error.config new:",t.config)),this.axios.defaults.headers.post["Content-Type"]="application/json",e.abrupt("return",this.axios.request(t.config));case 18:e.next=24;break;case 20:return e.prev=20,e.t0=e.catch(7),this.retryCount=0,e.abrupt("return",Promise.reject(bf));case 24:return e.abrupt("return",Promise.reject(t.response));case 25:case"end":return e.stop()}}),n,this,[[7,20]])})))}))}return i(t,[{key:"refreshToken",value:function(t){var n,r=t.baseURL,i=void 0===r?this.baseUrl:r,o=t.refresh_token,a=void 0===o?"":o;return Rn(this,void 0,void 0,e().mark((function t(){var r,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=a||(null===(n=this.loginInfo)||void 0===n?void 0:n.refresh_token)){e.next=3;break}return e.abrupt("return",Promise.reject(bf));case 3:return e.prev=3,e.next=6,Md({method:"post",baseURL:i,url:"admin/login/refresh_token",timeout:5e3,headers:{"x-xy-clientid":this.clientId},data:{refresh_token:a}});case 6:if(!(r=e.sent)||200!==r.status){e.next=13;break}return o=r.data.data,this.loginInfo=o,e.abrupt("return",Promise.resolve(o));case 13:return e.abrupt("return",Promise.reject(bf));case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(3),e.abrupt("return",Promise.reject(bf));case 19:case"end":return e.stop()}}),t,this,[[3,16]])})))}},{key:"setLogger",value:function(e){this.logger=e}},{key:"setBaseUrl",value:function(e){var t=this;e!==this.baseUrl&&delete this.axios.defaults.headers.authorization,this.baseUrl=e,this.axios.interceptors.request.use((function(e){return e.baseURL=t.baseUrl,e}),(function(e){return Promise.reject(e)}))}},{key:"setClientInfo",value:function(e){var t=e.clientId,n=e.clientSecret;this.clientId=t,this.clientSecret=n}},{key:"setHttpConfig",value:function(e){if(1===e.sign){var t=e.method,n=void 0===t?"GET":t,r=e.data,i=e.url,o=void 0===i?"":i,a=e.params,s=e.clientId,c=void 0===s?this.clientId:s,u=e.clientSecret,l=void 0===u?this.clientSecret:u,h="";Object.keys(a).map((function(e){h&&(h+="&"),h+="".concat(e,"=").concat(encodeURIComponent(a[e]))}));var d=h?o+"&"+h:o,f=this.loginInfo||{access_token:""},p=f.access_token,v=void 0===p?"":p,g=f.signSecret,m="string"==typeof r?r:JSON.stringify(r)||"",y={method:n.toLocaleUpperCase(),body:m,url:d,clienttype:rf.CLIENT_TYPE,clientId:c,clientSecret:l,token:v,signSecret:g};e.headers=Object.assign(Object.assign({},e.headers),this.getApiHeader(y))}}},{key:"getApiHeader",value:function(e){var t=e.method,n=e.url,r=e.body,i=void 0===r?"":r,o=e.clientId,a=void 0===o?"":o,s=e.clienttype,c=void 0===s?"":s,u=e.clientSecret,l=void 0===u?"":u,h=e.signSecret,d=void 0===h?"":h,f=e.token,p=void 0===f?"":f,v=Math.random(),g=(new Date).getTime(),m=zh.MD5(i).toString(),y="x-xy-clientid=".concat(a,"&x-xy-nonce=").concat(v,"&x-xy-signtype=HMAC_SHA256&x-xy-timestamp=").concat(g),b=(d||l)+"&",S="".concat(t.toLocaleUpperCase(),"\n").concat(y,"\n").concat(n,"\n").concat(m,"\n").concat(b),w=zh.HmacSHA256(S,b).toString().toLocaleUpperCase();return Object.assign({"x-xy-clientid":a,"x-xy-clienttype":c,"x-xy-nonce":v,"x-xy-timestamp":g,"x-xy-signtype":"HMAC_SHA256","x-xy-sign":w,"x-xy-signatureversion":"2.0"},p&&{Authorization:"Bearer ".concat(p||"")})}},{key:"setLoginInfo",value:function(e){this.loginInfo=e}},{key:"getLoginInfo",value:function(){return this.loginInfo}}]),t}(),wf="2.1.3-beta.1 - build on 2022-12-09 17:27",kf="wss://cloudapi.xylink.com",Cf="https://cloudapi.xylink.com",Ef="https://log.xylink.com",xf=new(function(){function t(){var r=this;n(this,t),this.setCommonParams=function(e){var t=(e||{}).securityKey;r.commonParams.securityKey=t},this.customLogin=function(t){return Rn(r,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.post("/api/rest/iauth/external/en/custom/login/v1",t);case 2:if(e.t0=e.sent,e.t0){e.next=5;break}e.t0={};case 5:return e.abrupt("return",e.t0);case 6:case"end":return e.stop()}}),n,this)})))},this.getWatermarkContent=function(t){return Rn(r,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,i="/api/rest/v1/meetingroom/conferenceNumber/watermarkContent/".concat(t,"?securityKey=").concat(r),e.next=4,this.http.get(i);case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),n,this)})))},this.getEnterpriseId=function(t){var n=t.extId,i=t.clientId,o=t.clientSecret,a=t.httpServer,s=void 0===a?Cf:a;return Rn(r,void 0,void 0,e().mark((function t(){var r,a,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a="/api/rest/v1/sdk/enterpriseToken/findByExtId?extId=".concat(n),e.next=3,this.http.get(a,{baseURL:s,sign:1,clientSecret:o,clientId:i});case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:if(200!==(c=e.t0).status){e.next=9;break}return e.abrupt("return",(null===(r=c.data)||void 0===r?void 0:r.enterpriseId)||"");case 9:return e.abrupt("return","");case 10:case"end":return e.stop()}}),t,this)})))},this.locator=function(t){var n=t.extId,i=t.clientId,o=t.clientSecret,a=t.httpServer,s=void 0===a?Cf:a;return Rn(r,void 0,void 0,e().mark((function t(){var r,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r="/api/rest/v1/locator/".concat(n,"/node/config"),e.next=3,this.http.get(r,{baseURL:s,sign:1,clientSecret:o,clientId:i});case 3:if(200!==(a=e.sent).status){e.next=6;break}return e.abrupt("return",a.data||[]);case 6:return e.abrupt("return",[]);case 7:case"end":return e.stop()}}),t,this)})))},this.http=new Sf({baseURL:Cf,timeout:2e4,sign:1}),this.logHttp=new Sf({baseURL:Ef,timeout:2e4,sign:0}),this.meetingInfo={meetingId:"",callUri:""},this.seqId=0,this.statesTime={timeDiff:0},this.commonParams={securityKey:""},this.randomDeviceSN=Bh()}return i(t,[{key:"setBaseUrl",value:function(e,t){this.http.setBaseUrl(e),this.logHttp.setBaseUrl(t)}},{key:"setLogBaseUrl",value:function(e){this.logHttp.setBaseUrl(e)}},{key:"setClientInfo",value:function(e){var t=e.clientId,n=e.clientSecret;this.http.setClientInfo({clientId:t,clientSecret:n})}},{key:"setLogger",value:function(e){this.http.setLogger(e),this.logHttp.setLogger(e)}},{key:"setMeetingInfo",value:function(e){this.meetingInfo=e}},{key:"setLoginInfo",value:function(e){this.http.setLoginInfo(e)}},{key:"getLoginInfo",value:function(){return this.http.getLoginInfo()}},{key:"upload",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.logHttp.post("/api/rest/v1/log/standardLog",t);case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),n,this)})))}},{key:"getPublicKey",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/api/rest/iauth/v1/en/publicKey",{params:{account:t,deviceType:17}});case 2:if(200!==(i=e.sent).status){e.next=5;break}return e.abrupt("return",(null===(n=i.data)||void 0===n?void 0:n.pubkey)||"");case 5:return e.abrupt("return","");case 6:case"end":return e.stop()}}),r,this)})))}},{key:"login",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),r=t.userName,i=t.password,o=t.extId,a="/api/rest/iauth/v5/en/login",o&&(a+="?extId=".concat(o)),e.next=6,this.http.put(a,{account:r,password:i,deviceType:17,deviceSn:this.randomDeviceSN});case 6:return(s=e.sent).data&&200===s.status&&(this.setCommonParams(s.data),this.http.setLoginInfo(s.data.token)),e.abrupt("return",s);case 9:case"end":return e.stop()}}),n,this)})))}},{key:"encryptLogin",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),i=t.userName,o=t.password,e.next=4,this.getPublicKey(i);case 4:return a=e.sent,(s=new Uh).setPublicKey(a),c=s.encryptLong(zh.SHA512(o).toString(zh.enc.Hex)),u={account:i,password:c,deviceType:17,pubKey:a,deviceSn:this.randomDeviceSN},e.next=11,this.http.post("/api/rest/iauth/external/en/encrypt/custom/login/v1",u);case 11:if(e.t0=e.sent,e.t0){e.next=14;break}e.t0={};case 14:if(l=e.t0,1000005!==(null===(n=null==l?void 0:l.data)||void 0===n?void 0:n.errorCode)){e.next=19;break}return e.next=18,this.customLogin(Object.assign(Object.assign({},u),{password:s.encryptLong(o)}));case 18:l=e.sent;case 19:return 200===l.status&&l.data&&(this.setCommonParams(l.data),this.http.setLoginInfo(l.data.token)),e.abrupt("return",l);case 21:case"end":return e.stop()}}),r,this)})))}},{key:"getSdkUserInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.http.setLoginInfo(null),r=t.displayName,i=t.extId,o=t.extUserId,s={extId:i,displayName:r},(a=void 0===o?"":o)&&Object.assign(s,{externalUserId:a}),e.next=6,this.http.post("/api/rest/internal/v1/en/sdk/webRtc/user?extId=".concat(i),s);case 6:if(e.t0=e.sent,e.t0){e.next=9;break}e.t0={};case 9:return e.abrupt("return",e.t0);case 10:case"end":return e.stop()}}),n,this)})))}},{key:"getUserInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/admin/current/userinfo/bytoken",{params:{token:t}});case 2:if(!(r=e.sent).data||0!==r.data.code){e.next=6;break}return this.setCommonParams(r.data.data),e.abrupt("return",r.data.data);case 6:return e.abrupt("return",r);case 7:case"end":return e.stop()}}),n,this)})))}},{key:"getCallUri",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.get("/api/rest/uss/v4/callUrlInfoV2",{params:Object.assign(Object.assign({},t),{securityKey:r,version:"v5"})});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"verifyPassword",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return i=this.commonParams.securityKey,e.next=3,this.http.put("/api/rest/uss/v4/en/cloudmeeting/validation?securityKey=".concat(i),{number:t,passwd:n});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),r,this)})))}},{key:"hand",value:function(t,n,r,i){return Rn(this,void 0,void 0,e().mark((function o(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.post("/page/api/rest/v2/".concat(t,"?meetingId=").concat(n,"&di=").concat(r,"&conferenceNo=").concat(i));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),o,this)})))}},{key:"getDefaultServerConfig",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/api/rest/clientConfg/v3/getDefaultServerConfig?securityKey=".concat(this.commonParams.securityKey));case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),t,this)})))}},{key:"getCodeByJson",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,new Sf({baseURL:""}).get(t);case 4:(i=e.sent)&&200===i.status&&i.data&&(r=i.data),e.next=10;break;case 8:e.prev=8,e.t0=e.catch(1);case 10:return e.abrupt("return",r);case 11:case"end":return e.stop()}}),n,null,[[1,8]])})))}},{key:"getConference",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(r||{}).autoMute,a=void 0===o?0:o,e.abrupt("return",this.http.get("/api/rest/v1/meetingroom/hidden/soft/conference?userProfileId=".concat(t,"&securityKey=").concat(n,"&autoMute=").concat(a)));case 2:case"end":return e.stop()}}),i,this)})))}},{key:"setStates",value:function(t,n){var r,i=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=this.meetingInfo,s=a.meetingId,c=void 0===s?"":s,u=a.callUri,l=String((new Date).getTime()),h=String((new Date).getTime()+this.statesTime.timeDiff),d=[{seqId:String(this.seqId),createTime:l,alignTime:h,category:t,eventName:n,version:"1.0",meetingId:c,eventValue:JSON.stringify(i)}],f={device:u,msgVer:"0.0.2",sendTime:String((new Date).getTime()),states:d},e.prev=5,p=(new Date).getTime(),e.next=9,this.http.post("/api/rest/v3/device/v2states",f);case 9:v=e.sent,this.seqId++,(null===(r=null==v?void 0:v.data)||void 0===r?void 0:r.currentTime)&&(g=v.data.currentTime,m=void 0===g?0:g,y=(new Date).getTime(),b=Math.round((y-p)/2),S=Number(m)+b-y,this.statesTime.timeDiff=S),e.next=16;break;case 14:e.prev=14,e.t0=e.catch(5);case 16:case"end":return e.stop()}}),o,this,[[5,14]])})))}},{key:"ignoreMeetingMonitor",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=(1e3*Math.random()).toFixed(),i=this.commonParams.securityKey,o="/api/rest/uss/v1/cloudmeeting/monitor?securityKey=".concat(i,"&conferenceNumber=").concat(t,"&nonce=").concat(r),e.next=5,this.http.get(o);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),n,this)})))}},{key:"getAllocation",value:function(t,n){var r=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o="".concat(n,"/api/rest/allocator/v1/webrtc/allocation?key=").concat(t),a={},r&&(a={sign:0}),e.next=5,this.http.get(o,a);case 5:return e.abrupt("return",e.sent);case 6:case"end":return e.stop()}}),i,this)})))}},{key:"monitorOperation",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/api/rest/avcloud/external/monitor/monitorOperation/v1",e.next=3,this.http.post("/api/rest/avcloud/external/monitor/monitorOperation/v1",t);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0={};case 6:return r=e.t0,i=r.data,o=r.status,e.abrupt("return",[200!=+o,i]);case 10:case"end":return e.stop()}}),n,this)})))}},{key:"updateWebViewProp",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];return this.monitorOperation({meetingId:e,action:"updateWebViewProp",operations:t})}},{key:"checkPermissionWithMeetingNumber",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return"/api/rest/v3/en/recording/authorization",i=this.commonParams.securityKey,e.next=4,this.http.get("/api/rest/v3/en/recording/authorization",{params:{confNumber:t,meetingId:n,securityKey:i}});case 4:return e.abrupt("return",e.sent);case 5:case"end":return e.stop()}}),r,this)})))}},{key:"checkStorageSpaceWithRecordingUrl",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.get("/api/rest/v3/en/charge/storage?recordingUrl=".concat(t,"&securityKey=").concat(r));case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"getWebRxBandwidth",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.commonParams.securityKey,e.next=3,this.http.post("/api/rest/clientConfg/external/enterpriseConfig/v4",[{clientConfigName:"RemoteSDKConfig",configName:"downLinkCeilingRate"},{clientConfigName:"RemoteSDKConfig",configName:"upLinkCeilingRate"}],{params:{userId:t,securityKey:r,deviceType:17}});case 3:if(200!==(i=e.sent).status){e.next=6;break}return e.abrupt("return",i.data||{});case 6:return e.abrupt("return",{});case 7:case"end":return e.stop()}}),n,this)})))}},{key:"refreshToken",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.refreshToken({refresh_token:t});case 2:return e.abrupt("return",e.sent);case 3:case"end":return e.stop()}}),n,this)})))}}]),t}()),If=function(){function t(){var r=this;n(this,t),this.stopDB=function(){r.db.stop()},this.openDB=function(){r.db.open()},this.initDB=function(){return Rn(r,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.init();case 2:case"end":return e.stop()}}),t,this)})))},this.setLogLevel=function(e){r.currentLevel=e},this.putLog=function(t,n,i,o){return Rn(r,void 0,void 0,e().mark((function r(){var a,s=this;return e().wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(a={time:o,title:t,content:n,rest:i},!this.db||!this.db.isOpen()){r.next=12;break}if(!this.cacheData.length||this.isAddCache){r.next=8;break}return this.isAddCache=!0,r.next=6,Promise.all(this.cacheData.map((function(t){return Rn(s,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.add(t);case 2:case"end":return e.stop()}}),n,this)})))})));case 6:this.cacheData=[],this.isAddCache=!1;case 8:return r.next=10,this.db.add(a);case 10:r.next=14;break;case 12:this.cacheData.length>10&&this.cacheData.shift(),this.cacheData.push(a);case 14:case"end":return r.stop()}}),r,this)})))},this.downloadLog=function(){return Rn(r,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.export();case 2:case"end":return e.stop()}}),t,this)})))},this.setLogServer=function(e){xf.setLogBaseUrl(e)},this.db=new Jl(10),this.LogLevel={INFO:"INFO",DEBUG:"DEBUG",WARNING:"WARNING",ERROR:"ERROR",NONE:"NONE"},this.currentLevel=this.LogLevel.NONE,this.isArrowUpload=!0,this.cacheData=[],this.isAddCache=!1}return i(t,[{key:"debug",value:function(){for(var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel.DEBUG,i=zl(),o=arguments.length,a=new Array(o>2?o-2:0),s=2;s<o;s++)a[s-2]=arguments[s];this.currentLevel===r&&"meeting-stats"!==t&&(e=console).log.apply(e,["[".concat(Yl(),"][DEBUG]"),t,n].concat(a));this.putLog(t,n,a,i)}},{key:"log",value:function(e){var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=zl();n=ql(n,mf);for(var s=arguments.length,c=new Array(s>2?s-2:0),u=2;u<s;u++)c[u-2]=arguments[u];this.currentLevel!==o&&this.currentLevel!==i||(t=console).log.apply(t,["[".concat(Yl(),"][INFO]"),e,n].concat(c));this.putLog(e,n,c,a)}},{key:"warn",value:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=r.WARNING,s=zl(),c=arguments.length,u=new Array(c>2?c-2:0),l=2;l<c;l++)u[l-2]=arguments[l];this.currentLevel!==o&&this.currentLevel!==i&&this.currentLevel!==a||(t=console).log.apply(t,["[".concat(Yl(),"][WARN]"),e,n].concat(u));this.putLog(e,n,u,s)}},{key:"error",value:function(e){for(var t,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=this.LogLevel,i=r.INFO,o=r.DEBUG,a=r.ERROR,s=r.WARNING,c=zl(),u=arguments.length,l=new Array(u>2?u-2:0),h=2;h<u;h++)l[h-2]=arguments[h];this.currentLevel!==o&&this.currentLevel!==a&&this.currentLevel!==i&&this.currentLevel!==s||(t=console).log.apply(t,["[".concat(Yl(),"][ERROR]"),e,n].concat(l));this.putLog(e,n,l,c)}},{key:"enableLogUpload",value:function(){this.isArrowUpload=!0}},{key:"disableLogUpload",value:function(){this.isArrowUpload=!1}},{key:"uploadLog",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isArrowUpload){e.next=37;break}return e.next=3,this.db.upload(t);case 3:if(e.t0=e.sent,e.t0){e.next=6;break}e.t0="";case 6:return o=e.t0,a=new FormData,s=Math.ceil(1e4*Math.random())+"",c=Date.now()+"",a.append("comments",r||t),a.append("sn",s),a.append("userId",s),a.append("deviceId",s),a.append("deviceType","WebrtcSDK"),a.append("userDisplayName",t),a.append("deviceDisplayName",navigator.userAgent),a.append("dataType","userSubmit"),a.append("account",n),a.append("number",""),a.append("softwareVersion",""),a.append("osVersion",""),a.append("deviceModel",""),a.append("crashType","UI"),a.append("crashTime",c),a.append("suffixName",".zip"),a.append("file",o,"webrtc_log.zip"),e.prev=27,e.next=30,xf.upload(a);case 30:return u=e.sent,e.abrupt("return",u&&(u.status>=200||u.status<300));case 34:return e.prev=34,e.t1=e.catch(27),e.abrupt("return",!1);case 37:case"end":return e.stop()}}),i,this,[[27,34]])})))}}]),t}(),_f=Function,Af=M([].concat),Tf=M([].join),Rf={},Of=function(e,t,n){if(!Se(Rf,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";Rf[t]=_f("C,a","return new C("+Tf(r,",")+")")}return Rf[t](e,n)},Df=x?_f.bind:function(e){var t=le(this),n=t.prototype,r=ir(arguments,1),i=function(){var n=Af(r,ir(arguments));return this instanceof i?Of(t,n.length,n):t.apply(e,n)};return X(n)&&(i.prototype=n),i};qt({target:"Function",proto:!0,forced:Function.bind!==Df},{bind:Df});var Nf=co.findIndex,Lf=!0;"findIndex"in[]&&Array(1).findIndex((function(){Lf=!1})),qt({target:"Array",proto:!0,forced:Lf},{findIndex:function(e){return Nf(this,e,arguments.length>1?arguments[1]:void 0)}}),Ua("findIndex");var Pf,Mf,Bf,Gf,jf=/"/g,Hf=M("".replace);qt({target:"String",proto:!0,forced:(Pf="link",C((function(){var e=""[Pf]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{link:function(e){return t="a",n="href",r=e,i=po(z(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+Hf(po(r),jf,""")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}}),exports.RecordingState=void 0,(Mf=exports.RecordingState||(exports.RecordingState={})).RECORD_STATE_IDLE="RECORD_STATE_IDLE",Mf.RECORD_STATE_STARTING="RECORD_STATE_STARTING",Mf.RECORD_STATE_STARTED="RECORD_STATE_STARTED",Mf.RECORD_STATE_STOPING="RECORD_STATE_STOPING",exports.RecordStatus=void 0,(Bf=exports.RecordStatus||(exports.RecordStatus={}))[Bf.NONE=0]="NONE",Bf[Bf.LOCAL_START=1]="LOCAL_START",Bf[Bf.REMOTE_STAR=2]="REMOTE_STAR",Bf[Bf.REMOTE_PAUSED=3]="REMOTE_PAUSED",exports.AutoMute=void 0,(Gf=exports.AutoMute||(exports.AutoMute={}))[Gf.SMART=0]="SMART",Gf[Gf.ALL=1]="ALL",Gf[Gf.NOT=2]="NOT",Gf[Gf.FORCE=3]="FORCE";var Uf={en_US:{default:"The call is abnormal, please try again later",OK:"Call ended",KickoutTipContent:"Your account is logged in at another location and you are forced to go offline",SHARE_CONTENT_FAILED:"Share content failed",LOCAL_NET_DISCONNECT:"The network is interrupted and the call is disconnected",TOKEN_INVALID:"Login has expired, please log in again"},zh_CN:{default:"呼叫异常,请稍后重试",OK:"通话已结束",KickoutTipContent:"您的账号在另一地点登录,您被迫下线",SHARE_CONTENT_FAILED:"分享屏幕失败",LOCAL_NET_DISCONNECT:"网络中断,呼叫已断开",TOKEN_INVALID:"登录已失效,请重新登录"},zh_TW:{default:"呼叫異常,請稍後重試",OK:"通話已結束",KickoutTipContent:"您的賬號在另一地點登錄,您被迫下線",SHARE_CONTENT_FAILED:"分享屏幕失敗",LOCAL_NET_DISCONNECT:"網絡中斷,呼叫已斷開",TOKEN_INVALID:"登錄已失效,請重新登錄"}},Kf=function(){function e(){n(this,e),this.events={}}return i(e,[{key:"on",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:-1;if("function"!=typeof t)throw new TypeError("The listener not a function");this.events||(this.events={}),this.events[e]||(this.events[e]=[]),this.events[e].push({total:n,listener:t})}},{key:"once",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:1;this.on(e,t,n)}},{key:"removeListener",value:function(e){this.events[e]&&(this.events[e].length=0)}},{key:"removeAllListener",value:function(){this.events={}}},{key:"emmit",value:function(e){for(var t=this,n=arguments.length,r=new Array(n>1?n-1:0),i=1;i<n;i++)r[i-1]=arguments[i];this.events[e]&&this.events[e].forEach((function(n,i){if((-1===n.total||n.total>=1||"function"==typeof n.listener)&&n.listener.apply(t,r),n.total>=1){var o=t.events[e][i].total-1;t.events[e][i].total=o,0===o&&(t.events[e][i].listener=function(){})}}))}}]),e}(),Ff=[],zf=function(){function e(t,r){var i=this;n(this,e),this.onOpenSocket=function(e){i.isConnected=!0,i.lockReconnect=!1,i.reconnectCount=0,i.options.openHeatBeat&&i.sendHeartBeat(),i.emit("open",e)},this.onHandleMessage=function(e){i.options.openHeatBeat&&e.data===i.options.pangData?i.clearPangTimer():i.emit("message",e)},this.onCloseSocket=function(e){if(i.isConnected=!1,i.logger.log("close websocket success",e.code+","+e.reason+","+e.wasClean),i.logger.log("this.messageList: ",i.messageList),4e3===e.code)return i.isClose=!0,void i.emit("close",e);i.lockReconnect||(i.reconnectCount>=1?i.reconnectTimer||(i.reconnectTimer=setTimeout((function(){i.reConnect(),i.reconnectTimer=null}),i.reconnectOffset)):i.reConnect(),i.emit("error",e))},this.onErrorSocket=function(e){i.logger.log("error connection websocket"),i.isConnected=!1,i.lockReconnect||(i.reconnectCount>=1?i.reconnectTimer||(i.reconnectTimer=setTimeout((function(){i.reConnect(),i.reconnectTimer=null}),i.reconnectOffset)):i.reConnect(),i.emit("error",e))};this.logger=r.logger,this.client=r,this.options=Object.assign(Object.assign({},{protocols:[],pingData:"PING",pangData:"PONG",autoReConnect:!0,openHeatBeat:!0,params:{}}),t),this.heatBeatFrequency=15e3,this.timeOffset=1e4,this.reconnectCount=0,this.reconnectLimit=5,this.lockReconnect=!1,this.messageList={},this.headBeatTimer=null,this.isConnected=!1,this.isClose=!1,this.reconnectOffset=3e3,this.reconnectTimer=null,this.connect(!1),this.addEvent()}return i(e,[{key:"connect",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],t=this.options,n=t.url,r=t.params,i=n+"?";if(window.WebSocket){for(var o in r)i+=e&&"start"===o?"".concat(o,"=",!1,"&"):"".concat(o,"=").concat(r[o],"&");this.socket=new WebSocket(i,this.options.protocols),Ff.push(this.socket),e&&(this.lockReconnect=!1)}else this.emit("error",Xl("XYSDK:950116","Current browser cannot support Websocket, please use XyRTC sdk in chrome!"))}},{key:"addEvent",value:function(){this.socket.addEventListener("open",this.onOpenSocket),this.socket.addEventListener("message",this.onHandleMessage),this.socket.addEventListener("close",this.onCloseSocket),this.socket.addEventListener("error",this.onErrorSocket)}},{key:"removeEvent",value:function(){this.socket.removeEventListener("open",this.onOpenSocket),this.socket.removeEventListener("message",this.onHandleMessage),this.socket.removeEventListener("close",this.onCloseSocket),this.socket.removeEventListener("error",this.onErrorSocket)}},{key:"sendHeartBeat",value:function(){var e=this;this.headBeatTimer||(this.socket.send(this.options.pingData||"PING"),this.clearTimeout()),this.headBeatTimer=setInterval((function(){e.client.disconnected?e.clearBeatTimer():(e.socket.send(e.options.pingData||"PING"),e.clearTimeout())}),this.heatBeatFrequency)}},{key:"clearTimeout",value:function(){var e=this;this.pangTimer=setTimeout((function(){e.emit("timeout",""),e.options.autoReConnect&&e.reConnect()}),this.timeOffset)}},{key:"emit",value:function(e,t){this.messageList[e]&&this.messageList[e].forEach((function(e){e(t)}))}},{key:"clearPangTimer",value:function(){this.pangTimer&&clearTimeout(this.pangTimer)}},{key:"clearBeatTimer",value:function(){this.headBeatTimer&&clearInterval(this.headBeatTimer)}},{key:"clearReconnectTimer",value:function(){this.reconnectTimer&&clearTimeout(this.reconnectTimer),this.reconnectTimer=null}},{key:"reset",value:function(){this.clearBeatTimer(),this.clearPangTimer(),this.clearReconnectTimer(),this.messageList={}}},{key:"on",value:function(e,t){this.messageList[e]?this.messageList[e].push(t):this.messageList[e]=[t]}},{key:"close",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.socket&&this.socket.close(),Ff.map((function(e){e&&e.close()})),Ff=[],this.clearBeatTimer(),this.clearPangTimer(),this.clearReconnectTimer(),e||(this.messageList={}),this.removeEvent()}},{key:"send",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r="string"==typeof e,i=t&&!r?JSON.stringify(e):e,o={0:"connection",1:"open",2:"closing",3:"closed"};n&&(this.logger.log("send wss message: ",e),this.isConnected||(this.logger.log("wss connected status: ",this.isConnected),this.logger.log("socket connection status: ",o[this.socket.readyState]||"unknown"))),this.isConnected?this.isClose||(1===this.socket.readyState&&(this.socket.send(i),n&&this.logger.log("send wss message successfully")),"STOP_CALL"===e.type&&this.stopCall()):n&&this.logger.log("send wss message failed, because socket is closed")}},{key:"stopCall",value:function(){var e=this;this.isConnected=!1,setTimeout((function(){e.close()}),10)}},{key:"reConnect",value:function(){if(!this.client.disconnected&&!this.lockReconnect){if(this.reconnectCount>=this.reconnectLimit)return this.isClose=!0,void this.emit("close",null);this.lockReconnect=!0,this.reconnectCount+=1,this.logger.log("reconnect is trigger"),this.logger.log("reconnect count:",this.reconnectCount),this.close(!0),this.emit("reconnect",""),this.connect(!0),this.addEvent()}}}]),e}(),Yf=Math.floor,Vf=M("".charAt),Xf=M("".replace),Wf=M("".slice),qf=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,Zf=/\$([$&'`]|\d{1,2})/g,Jf=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,c=Zf;return void 0!==i&&(i=ye(i),c=qf),Xf(o,c,(function(o,c){var u;switch(Vf(c,0)){case"$":return"$";case"&":return e;case"`":return Wf(t,0,n);case"'":return Wf(t,a);case"<":u=i[Wf(c,1,-1)];break;default:var l=+c;if(0===l)return o;if(l>s){var h=Yf(l/10);return 0===h?o:h<=s?void 0===r[h-1]?Vf(c,1):r[h-1]+Vf(c,1):o}u=r[l-1]}return void 0===u?"":u}))},$f=Te("replace"),Qf=Math.max,ep=Math.min,tp=M([].concat),np=M([].push),rp=M("".indexOf),ip=M("".slice),op="$0"==="a".replace(/./,"$0"),ap=!!/./[$f]&&""===/./[$f]("a","$0");Xo("replace",(function(e,t,n){var r=ap?"$":"$0";return[function(e,n){var r=z(this),i=null==e?void 0:he(e,$f);return i?_(i,e,r,n):_(t,po(r),e,n)},function(e,i){var o=Fe(this),a=po(e);if("string"==typeof i&&-1===rp(i,r)&&-1===rp(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var c=V(i);c||(i=po(i));var u=o.global;if(u){var l=o.unicode;o.lastIndex=0}for(var h=[];;){var d=na(o,a);if(null===d)break;if(np(h,d),!u)break;""===po(d[0])&&(o.lastIndex=ea(a,_t(o.lastIndex),l))}for(var f,p="",v=0,g=0;g<h.length;g++){for(var m=po((d=h[g])[0]),y=Qf(ep(kt(d.index),a.length),0),b=[],S=1;S<d.length;S++)np(b,void 0===(f=d[S])?f:String(f));var w=d.groups;if(c){var k=tp([m],b,y,a);void 0!==w&&np(k,w);var C=po(er(i,void 0,k))}else C=Jf(m,a,y,b,w,i);y>=v&&(p+=ip(a,v,y)+C,v=y+m.length)}return p+ip(a,v)}]}),!!C((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!op||ap);var sp=$e.EXISTS,cp=Xe.f,up=Function.prototype,lp=M(up.toString),hp=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,dp=M(hp.exec);E&&!sp&&cp(up,"name",{configurable:!0,get:function(){try{return dp(hp,lp(this))[1]}catch(e){return""}}});var fp=co.some,pp=to("some");qt({target:"Array",proto:!0,forced:!pp},{some:function(e){return fp(this,e,arguments.length>1?arguments[1]:void 0)}});var vp=Object.prototype.toString,gp=function(e){if(void 0===e)return"undefined";if(null===e)return"null";var t=typeof e;if("boolean"===t)return"boolean";if("string"===t)return"string";if("number"===t)return"number";if("symbol"===t)return"symbol";if("function"===t)return"GeneratorFunction"===mp(e)?"generatorfunction":"function";if(function(e){return Array.isArray?Array.isArray(e):e instanceof Array}(e))return"array";if(function(e){if(e.constructor&&"function"==typeof e.constructor.isBuffer)return e.constructor.isBuffer(e);return!1}(e))return"buffer";if(function(e){try{if("number"==typeof e.length&&"function"==typeof e.callee)return!0}catch(e){if(-1!==e.message.indexOf("callee"))return!0}return!1}(e))return"arguments";if(function(e){return e instanceof Date||"function"==typeof e.toDateString&&"function"==typeof e.getDate&&"function"==typeof e.setDate}(e))return"date";if(function(e){return e instanceof Error||"string"==typeof e.message&&e.constructor&&"number"==typeof e.constructor.stackTraceLimit}(e))return"error";if(function(e){return e instanceof RegExp||"string"==typeof e.flags&&"boolean"==typeof e.ignoreCase&&"boolean"==typeof e.multiline&&"boolean"==typeof e.global}(e))return"regexp";switch(mp(e)){case"Symbol":return"symbol";case"Promise":return"promise";case"WeakMap":return"weakmap";case"WeakSet":return"weakset";case"Map":return"map";case"Set":return"set";case"Int8Array":return"int8array";case"Uint8Array":return"uint8array";case"Uint8ClampedArray":return"uint8clampedarray";case"Int16Array":return"int16array";case"Uint16Array":return"uint16array";case"Int32Array":return"int32array";case"Uint32Array":return"uint32array";case"Float32Array":return"float32array";case"Float64Array":return"float64array"}if(function(e){return"function"==typeof e.throw&&"function"==typeof e.return&&"function"==typeof e.next}(e))return"generator";switch(t=vp.call(e)){case"[object Object]":return"object";case"[object Map Iterator]":return"mapiterator";case"[object Set Iterator]":return"setiterator";case"[object String Iterator]":return"stringiterator";case"[object Array Iterator]":return"arrayiterator"}return t.slice(8,-1).toLowerCase().replace(/\s/g,"")};function mp(e){return"function"==typeof e.constructor?e.constructor.name:null}const yp=Symbol.prototype.valueOf;var bp=function(e,t){switch(gp(e)){case"array":return e.slice();case"object":return Object.assign({},e);case"date":return new e.constructor(Number(e));case"map":return new Map(e);case"set":return new Set(e);case"buffer":return function(e){const t=e.length,n=Buffer.allocUnsafe?Buffer.allocUnsafe(t):Buffer.from(t);return e.copy(n),n}(e);case"symbol":return function(e){return yp?Object(yp.call(e)):{}}(e);case"arraybuffer":return function(e){const t=new e.constructor(e.byteLength);return new Uint8Array(t).set(new Uint8Array(e)),t}(e);case"float32array":case"float64array":case"int16array":case"int32array":case"int8array":case"uint16array":case"uint32array":case"uint8clampedarray":case"uint8array":return function(e,t){return new e.constructor(e.buffer,e.byteOffset,e.length)}(e);case"regexp":return function(e){const t=void 0!==e.flags?e.flags:/\w+$/.exec(e)||void 0,n=new e.constructor(e.source,t);return n.lastIndex=e.lastIndex,n}(e);case"error":return Object.create(e);default:return e}};function Sp(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function wp(e,t){switch(gp(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||(n=e,!1!==Sp(n)&&"function"==typeof(r=n.constructor)&&!1!==Sp(i=r.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))){const n=new e.constructor;for(let r in e)n[r]=wp(e[r],t);return n}var n,r,i;return e}(e,t);case"array":return function(e,t){const n=new e.constructor(e.length);for(let r=0;r<e.length;r++)n[r]=wp(e[r],t);return n}(e,t);default:return bp(e)}}var kp=wp,Cp=function(){function t(e,r){n(this,t),this.filterInternels=function(e){var t=kp(e);return Object.keys(t.audioReceiver).forEach((function(e){var n=t.audioReceiver[e];n.bytesReceivedSecond>0||n.audioLevel||delete t.audioReceiver[e]})),t};var i=e.logger,o=e.invite;this.client=e,this.peerStatus={peerconnectionStatus:"disconnected",iceConnectionState:"disconnected"},this.invite=o,this.logger=i,this.connectCount=0,this.stream=r,this.streamSenders=[],this.senderTimmer=null,this.internels=kp(rf.INIT_INTERNELS),this.isShareContent=!1,this.isResendContentOffer=lf,this.isRestartIceConnection=!1,this.isFirstConnected=!1,this.onHandleNegotiationNeeded=this.onHandleNegotiationNeeded.bind(this),this.onHandleIceConnectionStateChange=this.onHandleIceConnectionStateChange.bind(this),this.onHandleConnectionStateChange=this.onHandleConnectionStateChange.bind(this),this.onHandleIcecandidateerror=this.onHandleIcecandidateerror.bind(this),this.onTrack=this.onTrack.bind(this),this.init()}return i(t,[{key:"getInternels",value:function(){return this.internels}},{key:"init",value:function(){this.initTimmer(),this.peerConnection=new RTCPeerConnection(tf),this.peerConnection.onnegotiationneeded=this.onHandleNegotiationNeeded,this.peerConnection.oniceconnectionstatechange=this.onHandleIceConnectionStateChange,this.peerConnection.onconnectionstatechange=this.onHandleConnectionStateChange,this.peerConnection.onicecandidateerror=this.onHandleIcecandidateerror,null===this.peerConnection.ontrack?this.peerConnection.ontrack=this.onTrack:this.peerConnection.addEventListener("track",this.onTrack)}},{key:"sendEmmit",value:function(e,t,n,r){this.isRestartIceConnection&&"XYSDK:950517"!==t||("XYSDK:950518"===t&&this.client.setPeerConnectionStatus(!0),this.client.emmit(e,{code:t,msg:n,detail:r}))}},{key:"stopConnectTimmer",value:function(){this.isRestartIceConnection=!1,this.connectTimmer&&clearTimeout(this.connectTimmer),this.connectTimmer=null,this.connectCount=0}},{key:"initTimmer",value:function(){var e=this;this.connectTimmer=setTimeout((function(){var t=e.peerStatus,n=t.peerconnectionStatus,r=t.iceConnectionState,i=kp(e.peerStatus);return e.connectCount>40?(e.sendEmmit("call-status","XYSDK:950517","呼叫失败","PEER_NET_DISCONNECT"),e.stopConnectTimmer(),void e.logger.log("loop peer status after 40s: ",i)):"connected"!==n&&"unknown"!==n||"connected"!==r&&"completed"!==r?(20===e.connectCount&&(e.sendEmmit("call-status","XYSDK:950519","正在呼叫中,请等候","waiting"),e.logger.log("loop peer status after 20s: ",i)),e.connectCount+=.5,void e.initTimmer()):(e.isFirstConnected=!0,e.sendEmmit("call-status","XYSDK:950518","入会成功","success"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i))}),500)}},{key:"onHandleNegotiationNeeded",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection();case 2:case"end":return e.stop()}}),t,this)})))}},{key:"createBaseOfferConnection",value:function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,!this.peerConnection){e.next=10;break}return e.next=4,this.peerConnection.createOffer(n);case 4:return(i=e.sent).sdp=null===(t=i.sdp)||void 0===t?void 0:t.replace("useinbandfec=1","useinbandfec=0"),e.next=8,this.peerConnection.setLocalDescription(i);case 8:this.sendSocketMessage("offer",{sdp:i.sdp}),this.client.sendPeopleCapability();case 10:e.next=15;break;case 12:e.prev=12,e.t0=e.catch(0),this.logger.error("create offer error: ",e.t0);case 15:case"end":return e.stop()}}),r,this,[[0,12]])})))}},{key:"sendSocketMessage",value:function(e,t){var n=this.invite,r=n.meetingId,i=n.callerUri,o=n.callIndex;this.client.sendSocketMessage({type:"PASS_THROUGH",callIndex:o,body:Object.assign({type:e,meetingId:r,endpointId:i},t)})}},{key:"handleCandidate",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return delete t.type,e.prev=1,e.next=4,null===(n=this.peerConnection)||void 0===n?void 0:n.addIceCandidate(new RTCIceCandidate(t));case 4:e.next=9;break;case 6:e.prev=6,e.t0=e.catch(1),this.logger.error("peer add ice candidate error: ",e.t0);case 9:case"end":return e.stop()}}),r,this,[[1,6]])})))}},{key:"handleAnswer",value:function(t){var n;return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,null===(n=this.peerConnection)||void 0===n?void 0:n.setRemoteDescription(new RTCSessionDescription(t));case 3:e.next=8;break;case 5:e.prev=5,e.t0=e.catch(0),this.logger.log("handle answer error:",{name:null===e.t0||void 0===e.t0?void 0:e.t0.name,code:null===e.t0||void 0===e.t0?void 0:e.t0.code,message:null===e.t0||void 0===e.t0?void 0:e.t0.message});case 8:case"end":return e.stop()}}),r,this,[[0,5]])})))}},{key:"setBandWidth",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:rf.VIDE_BANDWIDTH_BIT,r=arguments.length>2&&void 0!==arguments[2]&&arguments[2],i=arguments.length>3?arguments[3]:void 0;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:a=v(this.streamSenders),e.prev=1,a.s();case 3:if((s=a.n()).done){e.next=22;break}if(c=s.value,!(u=c.sender)||!u.track||"video"!==u.track.kind||t!==u.track.id){e.next=20;break}return l=null,e.prev=8,l=u.getParameters()||{encodings:[{maxBitrate:rf.VIDE_BANDWIDTH_BIT}]},h=r?1e3*n:n,(null==l?void 0:l.encodings)&&l.encodings[0]?l.encodings[0].maxBitrate=h:l.encodings=[{maxBitrate:h}],e.next=14,u.setParameters(l);case 14:this.logger.log("set bandwidth successfully",{params:l,realBandwidth:h,trackId:u.track.id,streamId:null==i?void 0:i.id}),e.next=20;break;case 17:e.prev=17,e.t0=e.catch(8),this.logger.error("set bandwidth failed",l,e.t0);case 20:e.next=3;break;case 22:e.next=27;break;case 24:e.prev=24,e.t1=e.catch(1),a.e(e.t1);case 27:return e.prev=27,a.f(),e.finish(27);case 30:case"end":return e.stop()}}),o,this,[[1,24,27,30],[8,17]])})))}},{key:"onHandleIceConnectionStateChange",value:function(t){var n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=this.peerStatus.peerconnectionStatus,a=this.peerConnection||{connectionState:"unknown"},s=a.connectionState,c=void 0===s?"unknown":s,this.logger.log("the peerConnection connectionState when ice change: ",null===(n=this.peerConnection)||void 0===n?void 0:n.connectionState),this.peerStatus={iceConnectionState:null===(r=null==t?void 0:t.target)||void 0===r?void 0:r.iceConnectionState,peerconnectionStatus:"connected"===o?o:c},!La){e.next=10;break}if("unknown"!==this.peerStatus.peerconnectionStatus||"disconnected"!==this.peerStatus.iceConnectionState&&"failed"!==this.peerStatus.iceConnectionState&&"closed"!==this.peerStatus.iceConnectionState){e.next=10;break}return this.logger.log("[Firefox] ice state: ",this.peerStatus.iceConnectionState),"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapabilityMessage(),e.next=10,this.restartIceConnection();case 10:this.logger.log("ice change status: ",kp(this.peerStatus));case 11:case"end":return e.stop()}}),i,this)})))}},{key:"onHandleConnectionStateChange",value:function(){var t;return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=(null===(t=this.peerConnection)||void 0===t?void 0:t.connectionState)||"",this.logger.log("peerconnection status change: ",{currentStatus:r,previousStatus:this.peerStatus.peerconnectionStatus}),"connected"!==this.peerStatus.peerconnectionStatus||"connected"===r){e.next=10;break}return"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapabilityMessage(),this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:r}),this.logger.log("this.peerStatus before restart: ",this.peerStatus),e.next=8,this.restartIceConnection();case 8:e.next=12;break;case 10:this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:r}),this.logger.log("this.peerStatus: ",this.peerStatus);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"onHandleIcecandidateerror",value:function(e){this.logger.log("ice candidate error:",e)}},{key:"restartIceConnection",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("restart ice connection:",{isRestartIceConnection:this.isRestartIceConnection,isFirstConnected:this.isFirstConnected}),this.isRestartIceConnection=t&&this.isFirstConnected,this.initTimmer(),e.next=5,this.createBaseOfferConnection({iceRestart:!0});case 5:case"end":return e.stop()}}),n,this)})))}},{key:"close",value:function(){var e=this;this.stopConnectTimmer(),this.peerConnection&&(this.streamSenders.forEach((function(t){var n;(null==t?void 0:t.sender)&&(null===(n=e.peerConnection)||void 0===n||n.removeTrack(t.sender))})),this.peerConnection.onicecandidate=null,this.peerConnection.removeEventListener&&this.peerConnection.removeEventListener("track",this.onTrack),this.peerConnection.ontrack=null,this.peerConnection.oniceconnectionstatechange=null,this.peerConnection.onsignalingstatechange=null,this.peerConnection.onicegatheringstatechange=null,this.peerConnection.onnegotiationneeded=null,this.peerConnection&&this.peerConnection.close&&this.peerConnection.close(),this.peerConnection=null),this.senderTimmer&&clearInterval(this.senderTimmer),this.senderTimmer=null,this.isShareContent=!1,this.isFirstConnected=!1,this.isRestartIceConnection=!1}},{key:"setRestartIceConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]&&arguments[0];this.isRestartIceConnection=e}},{key:"publish",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"ALL",n=e.getMediaStreams(),r=n.streams,i=n.pipelineStreams,o=n.contentStreams;"ALL"===t?("NORMAL"!==e.current.type&&"AUDIO_ONLY"!==e.current.type&&"VIDEO_ONLY"!==e.current.type||this.addTransceiver(r,"sendrecv"),this.addTransceiver(i,"recvonly"),this.logger.log("publish people stream successfully")):"CONTENT"===t&&(this.isShareContent?this.resetContentStream(o):(this.addTransceiver(o,"sendonly"),this.isResendContentOffer===hf&&(this.isResendContentOffer=df),this.logger.log("push content use addTransceiver.")),this.isShareContent=!0,this.logger.log("publish content stream successfully: ",this.streamSenders)),this.initSenderStatus()}},{key:"reSendContentOffer",value:function(){this.isResendContentOffer===lf&&(this.isResendContentOffer=hf)}},{key:"resetContentStream",value:function(e){var t;if(this.replaceTrack(e),this.isResendContentOffer===hf){var n=e.find((function(e){return"720"===e.resolution}));if(n){var r=null===(t=n.stream)||void 0===t?void 0:t.getAudioTracks()[0];r&&this.addStreamRenders(r,"sendonly",n)}this.isResendContentOffer=df}this.logger.log("push content use replaceTrack.")}},{key:"replacePeopleVideoTrack",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"video",n=e.getMediaStreams(),r=n.streams;"audio"===t?this.replaceAudioTrack(r):this.replaceVideoTrack(r)}},{key:"initSenderStatus",value:function(){var t=this;this.senderInterval=0,this.senderTimmer||(this.calcMeetingStats(),this.senderTimmer=setInterval((function(){return Rn(t,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.senderInterval=this.senderInterval+1,e.next=3,this.calcMeetingStats();case 3:case"end":return e.stop()}}),t,this)})))}),2e3))}},{key:"closeContentStream",value:function(){var e=this;this.streamSenders.forEach((function(t,n){"contentStream"===t.type&&(t.sender.replaceTrack(null),e.streamSenders[n].status="ended")}))}},{key:"getPeerStatus",value:function(){var e=this.peerStatus.peerconnectionStatus;return this.logger.log("get peer status: ",this.peerStatus),"connected"===e}},{key:"setStream",value:function(e,t){var n,r=this,i=(null===(n=this.peerConnection)||void 0===n?void 0:n.getTransceivers())||[],o=0,a=0;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){if(n.kind===t&&("audio"===t&&"180"===e.resolution||"video"===t))for(;o<i.length;){if(!i[o].sender.track&&"sendrecv"!==i[o].direction&&i[o].receiver.track.kind===n.kind){i[o].direction="sendrecv",i[o].sender.setStreams(e.stream),i[o].sender.replaceTrack(n),0===a&&(r.logger.log("sender replace track success"),a++),r.setStreamSenders(n,e,i[o]),o++;break}o++}}))}))}},{key:"calcMeetingStats",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,d,f,p,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R,O,D,N,L,P,M,B,G,j,H,U,K,F,z,Y,V,X,W,q,Z,J;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:n=kp(rf.INIT_INTERNELS),r=!1,i=this.client.invite.callerUri,o=this.client.getLayoutList(),a=0,s=0,c=0,u=0,l=0,d=0,f=0,p=0,g=this.client.getAudioTrackList(),m=g.length,n.mimeType="video/H264",n.timestamp=(new Date).valueOf(),y=v(o.entries()),e.prev=17,y.s();case 19:if((b=y.n()).done){e.next=41;break}if((S=h(b.value,2))[0],w=S[1],k=w.roster.endpointId,k===i||w.roster.videoTxMute){e.next=39;break}if(C=w.roster.id,!(E=this.client.getVideoManagers())||!E[C]){e.next=39;break}if(x=E[C],!((I=null==x?void 0:x.getVideoTracks())&&I[0]&&this.peerConnection)){e.next=39;break}return e.next=32,this.peerConnection.getStats(I[0]);case 32:_=e.sent,A=this.getReceiverStatus(_,w,n),a+=A.bytesReceivedSecond||0,l+=A.packetsReceivedSecond||0,d+=A.packetsLostSecond||0,!A.frameWidth&&I[0]&&(T=I[0].getSettings(),R=T.width,O=void 0===R?0:R,D=T.height,N=void 0===D?0:D,A.frameWidth=O,A.frameHeight=N),n.receiver[I[0].id]=A;case 39:e.next=19;break;case 41:e.next=46;break;case 43:e.prev=43,e.t0=e.catch(17),y.e(e.t0);case 46:return e.prev=46,y.f(),e.finish(46);case 49:L=0;case 50:if(!(L<g.length)){e.next=67;break}if(P=g[L],!(M=P.rest.track)||"live"!==M.readyState||!this.peerConnection){e.next=64;break}return e.next=56,this.peerConnection.getStats(M);case 56:B=e.sent,(G=this.getReceiverAudioTrackStatus(B,M)).bytesReceivedSecond=Math.max(G.bytesReceivedSecond,0),f+=G.packetsReceivedSecond||0,p+=G.packetsLostSecond||0,j=m===L+1,Object.assign(G,{isContent:j}),n.audioReceiver[M.id]=G;case 64:L++,e.next=50;break;case 67:H=0,U=0,K=0,F=0,z=v(this.streamSenders.entries()),e.prev=72,z.s();case 74:if((Y=z.n()).done){e.next=90;break}if((V=h(Y.value,2))[0],"active"!==(X=V[1]).status||!X.track){e.next=88;break}return e.next=79,X.sender.getStats();case 79:W=e.sent,q="audio"===X.track.kind?"audioSender":"sender",Z=this.getSenderStatus(q,W,n,X,!r),"video"===X.track.kind&&(s+=Z.bytesSentSecond||0,c+=Z.packetsSentSecond||0,u+=Z.packetsLostSecond||0,K=Math.max(K,1e3*(Z.jitter||0)),F=Math.max(F,1e3*(Z.roundTripTime||0))),"audio"===X.track.kind&&(U+=Z.packetsSentSecond||0,H+=Z.packetsLostSecond||0,n.audioSendJitter=Math.floor(1e3*(Z.jitter||0))),n.jitterSent=Math.floor(K),n.roundTripTime=Math.floor(F),n[q][X.track.id]=Z,r=!0;case 88:e.next=74;break;case 90:e.next=95;break;case 92:e.prev=92,e.t1=e.catch(72),z.e(e.t1);case 95:return e.prev=95,z.f(),e.finish(95);case 98:n.fractionLostSent=this.getLost(c,u),n.audioSendLost=this.getLost(U,H),n.fractionLostReceived=this.getLost(l,d),n.audioRecvLost=this.getLost(f,p),n.bytesSentSecond=s,n.bytesReceivedSecond=a,this.internels=n,J=this.filterInternels(n),this.client.reportQualityData(J),this.client.debug&&this.client.sendInternels(J),this.senderInterval>=3&&n.bytesSentSecond<500&&(this.logger.debug("get network:",Na.getNetWork()),this.logger.debug("meeting-stats",n),this.senderInterval=0);case 109:case"end":return e.stop()}}),t,this,[[17,43,46,49],[72,92,95,98]])})))}},{key:"getLost",value:function(e,t){return 0===e?0:Math.max(Math.floor(t/(t+e)*100),0)}},{key:"addTransceiver",value:function(e,t){var n=this;e.forEach((function(e){var r=e.status,i=e.domStream,o=e.stream;"NORMAL"===r?null==o||o.getTracks().forEach((function(r){n.addStreamRenders(r,t,e)})):"DOMSTRING"===r&&i.forEach((function(r){n.addStreamRenders(r,t,e)}))})),this.logger.log("transceiver senders: ",this.streamSenders)}},{key:"addStreamRenders",value:function(e,t,n){var r=this.addTransceiverByPeer(e,t,n);this.setStreamSenders(e,n,r)}},{key:"preferCodec",value:function(e,t){var n=[];return e.forEach((function(e){e.mimeType===t&&n.push(e)})),n}},{key:"addTransceiverByPeer",value:function(e,t,n){var r,i={direction:t},o="NORMAL"===n.status,a=e.kind;return o&&n.stream&&(i.streams=[n.stream],a=e),null===(r=this.peerConnection)||void 0===r?void 0:r.addTransceiver(a,i)}},{key:"setStreamSenders",value:function(t,n,r){var i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a="NORMAL"===n.status,s=t.kind,c={resolution:n.resolution,track:a?t:null,sender:r.sender,type:n.type,status:a?"active":"invalid"},("video"!==s||"remoteStream"!==n.type&&"contentStream"!==n.type)&&("audio"!==s||"180"!==n.resolution&&"contentStream"!==n.type)){e.next=24;break}if(!La||"video"!==(null===(i=c.track)||void 0===i?void 0:i.kind)){e.next=23;break}if(!(u=c.sender)||!u.track||"video"!==u.track.kind){e.next=23;break}return l=u.track.getSettings().height,h=null,d=1,e.prev=10,720===l&&(d=ff[c.resolution]),360===l&&"180"===c.resolution&&(d=2),(null==(h=u.getParameters()||{encodings:[{}]})?void 0:h.encodings)&&h.encodings[0]?h.encodings[0].scaleResolutionDownBy=d:h.encodings=[{scaleResolutionDownBy:d}],this.logger.log("set stream sender in firefox:",h),e.next=18,u.setParameters(h);case 18:e.next=23;break;case 20:e.prev=20,e.t0=e.catch(10),this.logger.error("set bandwidth failed",h,e.t0);case 23:this.streamSenders.push(c);case 24:case"end":return e.stop()}}),o,this,[[10,20]])})))}},{key:"replaceAudioTrack",value:function(e){var t=this,n=e.find((function(e){return"180"===e.resolution&&e.stream}));if(null==n?void 0:n.stream){var r=n.stream.getAudioTracks()[0];this.streamSenders.forEach((function(e,n){"180"===e.resolution&&e.track&&"audio"===e.track.kind&&(e.sender.replaceTrack(r),t.streamSenders[n].status="active",t.streamSenders[n].track=r)}))}}},{key:"replaceVideoTrack",value:function(e){var t=this;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){"video"===(null==n?void 0:n.kind)&&t.streamSenders.forEach((function(r,i){var o;"video"===(null===(o=r.track)||void 0===o?void 0:o.kind)&&r.type===e.type&&e.resolution===r.resolution&&(r.sender.replaceTrack(n),t.streamSenders[i].status="active",t.streamSenders[i].track=n)}))}))}))}},{key:"replaceTrack",value:function(e){var t=this;e.forEach((function(e){var n;null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(n){t.streamSenders.forEach((function(r,i){var o;(null===(o=r.track)||void 0===o?void 0:o.kind)===(null==n?void 0:n.kind)&&r.type===e.type&&e.resolution===r.resolution&&(r.sender.replaceTrack(n),t.streamSenders[i].status="active",t.streamSenders[i].track=n)}))}))}))}},{key:"getSenderStatus",value:function(e,t,n,r,i){var o=this,a={};if(t.forEach((function(t){var s,c,u,l,h,d=t.type,f=t.bytesReceived,p=void 0===f?0:f,v=t.timestamp,g=void 0===v?0:v,m=t.mimeType,y=t.audioLevel,b=void 0===y?0:y;switch(n.timestamp=g,n.mimeType="video/H264",a.isContent="contentStream"===r.type,d){case"transport":if(i){var S=t.bytesSent,w=void 0===S?0:S,k=o.rateBytesCalculator(t,"bytesSent","timestamp",8,1),C=o.rateBytesCalculator(t,"bytesReceived","timestamp",8,1);n.bytesSent=w,n.bytesReceived=p,n.bytesReceivedSecond=C,n.timestamp=g,n.bytesSentSecond=k}break;case"track":var E=t.frameWidth,x=void 0===E?0:E,I=t.frameHeight,_=void 0===I?0:I,A=t.framesSent,T=void 0===A?0:A,R=t.hugeFramesSent,O=void 0===R?0:R,D=o.rateBytesCalculator(t,"framesSent","timestamp",1,1e3,o.internels[e][(null===(s=r.track)||void 0===s?void 0:s.id)||""]);"sender"===e&&(a.frameWidth=x,a.frameHeight=_),a.framesSent=T,a.framesSentSecond=D,a.hugeFramesSent=O,a.timestamp=g,a.type=r.type,a.status=r.status,a.resolution=r.resolution,a.expBandwidth=10;break;case"outbound-rtp":var N=t.bytesSent,L=t.framesEncoded,P=t.packetsSent,M=t.keyFramesEncoded,B=void 0===M?"N/A":M,G=t.nackCount,j=t.ssrc,H=t.pliCount,U=void 0===H?0:H,K=t.firCount,F=void 0===K?0:K,z=o.rateBytesCalculator(t,"framesEncoded","timestamp",1,1e3,o.internels[e][(null===(c=r.track)||void 0===c?void 0:c.id)||""]),Y=o.rateBytesCalculator(t,"bytesSent","timestamp",8,1,o.internels[e][(null===(u=r.track)||void 0===u?void 0:u.id)||""]),V=o.rateBytesCalculator(t,"packetsSent","timestamp",1,1e3,o.internels[e][(null===(l=r.track)||void 0===l?void 0:l.id)||""]);"sender"===e&&(t.frameWidth&&(a.frameWidth=t.frameWidth),t.frameHeight&&(a.frameHeight=t.frameHeight)),a.bytesSent=N,a.bytesSentSecond=Y,a.framesEncoded=L,a.framesEncodedSecond=z,a.timestamp=g,a.packetsSent=P,a.packetsSentSecond=V,a.keyFramesEncoded=B,a.pliCount=U,a.firCount=F,a.nackCount=G,a.ssrc=j,a.type=r.type,a.status=r.status,a.resolution=r.resolution,a.expBandwidth=10;break;case"codec":i&&(n.mimeType=m),a.mimeType=m;break;case"media-source":a.audioLevel=Number((100*b).toFixed(0));break;case"remote-inbound-rtp":var X=t.jitter,W=void 0===X?0:X,q=t.packetsLost,Z=void 0===q?0:q,J=t.roundTripTime,$=void 0===J?0:J,Q=o.rateBytesCalculator(t,"packetsLost","timestamp",1,1e3,o.internels[e][(null===(h=r.track)||void 0===h?void 0:h.id)||""]);a.packetsLost=Z,a.packetsLostSecond=Q,a.jitter=W,a.roundTripTime=$}})),!a.framesSentSecond&&La&&(a.framesSentSecond=30),!a.frameWidth){var s=rf.MAP_RESOLUTION_STRING[r.resolution],c=s.width,u=void 0===c?0:c,l=s.height,h=void 0===l?0:l;a.frameWidth=u,a.frameHeight=h}return a}},{key:"calcAudioLevel",value:function(e){if(e<316e-7)return 0;var t=100*e;return Number(t>1?t.toFixed(0):t.toFixed(2))}},{key:"getReceiverStatus",value:function(e,t,n){var r=this,i={endpointId:t.roster.endpointId,participantId:t.roster.participantId},o=0;return e.forEach((function(e){var n,a=e.type,s=e.timestamp,c=void 0===s?0:s,u=t.roster,l=u.displayName,h=u.isContent,d=u.id,f=u.ExpectHeight,p=void 0===f?0:f,v=u.ExpectWidth,g=void 0===v?0:v,m=r.client.getVideoManagers(),y="";m&&m[d]&&(y=(null===(n=(m[d].getVideoTracks()||[])[0])||void 0===n?void 0:n.id)||"");switch(i.ExpectHeight=p,i.ExpectWidth=g,i.isContent=h,a){case"track":var b=e.frameWidth,S=void 0===b?0:b,w=e.frameHeight,k=void 0===w?0:w,C=e.framesReceived,E=void 0===C?0:C,x=e.jitterBufferDelay,I=void 0===x?0:x,_=r.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,r.internels.receiver[y]);i.frameWidth=S,i.frameHeight=k,i.framesReceived=E,i.framesReceivedSecond=_,i.jitterBufferDelay=I,i.timestamp=c,i.type="video",i.status="active",i.name=l,i.expResolution=0;break;case"inbound-rtp":var A=e.bytesReceived,T=e.framesDecoded,R=e.packetsReceived,O=e.packetsLost,D=e.keyFramesDecoded,N=void 0===D?"N/A":D,L=e.nackCount,P=e.pliCount,M=e.framesPerSecond,B=e.framesDropped,G=e.ssrc,j=e.jitter,H=r.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,r.internels.receiver[y]),U=r.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,r.internels.receiver[y]),K=r.rateBytesCalculator(e,"packetsReceived","timestamp",1,1e3,r.internels.receiver[y]),F=r.rateBytesCalculator(e,"packetsLost","timestamp",1,1e3,r.internels.receiver[y]);if(e.frameWidth&&(i.frameWidth=e.frameWidth),e.frameHeight&&(i.frameHeight=e.frameHeight),e.framesReceived){var z=r.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,r.internels.receiver[y]);i.framesReceived=e.framesReceived,i.framesReceivedSecond=z}i.bytesReceived=A,i.bytesReceivedSecond=U,i.framesDecoded=T,i.framesDecodedSecond=H,i.packetsReceived=R,i.packetsReceivedSecond=K,i.packetsLost=O,i.packetsLostSecond=F,i.keyFramesDecoded=N,i.nackCount=L,i.pliCount=P,i.framesPerSecond=M,i.framesDropped=B,i.ssrc=G,i.jitter=j,i.timestamp=c,i.type="video",i.status="active",i.name=l,i.expResolution=0,j&&(o=Math.max(o,1e3*j))}})),n.jitterReceived=Math.floor(o),i}},{key:"getReceiverAudioTrackStatus",value:function(e,t){var n=this,r={type:"audio"},i=t.id,o="audioReceiver";return e.forEach((function(e){var t=e.type,a=e.mimeType;if(r.mimeType="audio/opus","track"===t){var s=e.framesReceived,c=void 0===s?0:s,u=e.jitterBufferDelay,l=void 0===u?0:u,h=e.timestamp,d=void 0===h?0:h,f=n.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,n.internels[o][i]);r.framesReceived=c,r.framesReceivedSecond=f,r.jitterBufferDelay=l,r.timestamp=d,r.status="active",r.expResolution=0,e.audioLevel&&(r.audioLevel=n.calcAudioLevel(e.audioLevel))}else if("inbound-rtp"===t){var p=e.bytesReceived,v=e.framesDecoded,g=e.packetsReceived,m=e.keyFramesDecoded,y=void 0===m?"N/A":m,b=e.nackCount,S=e.pliCount,w=e.framesPerSecond,k=e.framesDropped,C=e.ssrc,E=e.jitter,x=e.timestamp,I=e.insertedSamplesForDeceleration,_=void 0===I?0:I,A=e.totalSamplesReceived,T=void 0===A?0:A,R=e.removedSamplesForAcceleration,O=void 0===R?0:R,D=n.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,n.internels[o][i]),N=n.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,n.internels[o][i]),L=n.rateBytesCalculator(e,"insertedSamplesForDeceleration","timestamp",1,1e3,n.internels[o][i]),P=n.rateBytesCalculator(e,"totalSamplesReceived","timestamp",1,1e3,n.internels[o][i]),M=n.rateBytesCalculator(e,"removedSamplesForAcceleration","timestamp",1,1e3,n.internels[o][i]);r.bytesReceived=p,r.bytesReceivedSecond=N,r.framesDecoded=v,r.framesDecodedSecond=D,r.packetsReceived=g,r.keyFramesDecoded=y,r.nackCount=b,r.pliCount=S,r.framesPerSecond=w,r.framesDropped=k,r.ssrc=C,r.jitter=E,r.insertedSamplesForDeceleration=_,r.insertedSamplesForDecelerationSecond=L,r.totalSamplesReceived=T,r.totalSamplesReceivedSecond=P,r.removedSamplesForAcceleration=O,r.removedSamplesForAccelerationSecond=M,r.timestamp=x,r.status="active",e.audioLevel&&(r.audioLevel=n.calcAudioLevel(e.audioLevel))}"codec"===t&&a&&(r.mimeType=a)})),r}},{key:"rateBytesCalculator",value:function(e,t,n){var r=arguments.length>3&&void 0!==arguments[3]?arguments[3]:1,i=arguments.length>4&&void 0!==arguments[4]?arguments[4]:1,o=arguments.length>5?arguments[5]:void 0,a=o||this.internels,s=Number(a[t])||0,c=Number(e[t])||0,u=Number(a[n]),l=Number(e[n]);if([u,l,s,c].some((function(e){return"number"!=typeof e})))return 0;if(l===u)return 0;var h=r*(c-s),d=(l-u)/i;return Math.max(Math.floor(h/d),0)}},{key:"onTrack",value:function(e){this.client.emmit("track",e)}}]),t}(),Ep=function(){function t(e){n(this,t),this.logger=e,this.loginInfo=rf.LOGIN_INFO}return i(t,[{key:"getLoginInfo",value:function(){return this.loginInfo||{}}},{key:"setLoginInfo",value:function(e){this.logger.log("[iauth] set login info:",e),this.loginInfo=e}},{key:"loginExternalAccount",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d,f;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[iauth] loginExternalAccount:",t),r=t.displayName,i=t.extId,o=t.extUserId,a=/^[0-9a-zA-Z_-]{1,50}$/,r||i){e.next=5;break}return e.abrupt("return",Xl("XYSDK:950101",t));case 5:if(!o){e.next=10;break}if(a.test(o)){e.next=10;break}return s="extUserId can only contain numbers, letters, _ and -, and the length cannot be greater than 50",this.logger.log("loginExternalAccount params error:",s),e.abrupt("return",Xl("XYSDK:950101",t,s));case 10:return e.prev=10,e.next=13,xf.getSdkUserInfo(t);case 13:if(c=e.sent,u=c.status,l=c.data,{userName:"",password:""},200!==u){e.next=25;break}return d=l.userName,f=l.password,h={userName:d,password:f},e.next=22,this.login(h,t);case 22:return e.abrupt("return",e.sent);case 25:return e.abrupt("return",Xl("XYSDK:950103",{status:u,data:l}));case 26:e.next=31;break;case 28:return e.prev=28,e.t0=e.catch(10),e.abrupt("return",Xl("XYSDK:950103",e.t0));case 31:case"end":return e.stop()}}),n,this,[[10,28]])})))}},{key:"login",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return o=(i=n||{}).extId,a=i.extUserId,s=t.userName,c=t.password,this.logger.log("[iauth] login:",Object.assign(Object.assign({},t),n)),e.prev=3,this.logger.log("[iauth] encryptLogin"),e.next=7,xf.encryptLogin({userName:s,password:c,extId:o});case 7:if(e.t0=e.sent,e.t0){e.next=10;break}e.t0={};case 10:if(404!==(null==(u=e.t0)?void 0:u.status)&&10002e3!==(null==u?void 0:u.errorCode)){e.next=16;break}return this.logger.log("[iauth] unEncrypted login"),e.next=15,xf.login({userName:s,password:c,extId:o});case 15:u=e.sent;case 16:if(200!==(null==u?void 0:u.status)){e.next=23;break}return l=u.data,h=l.securityKey,d=l.callUri,f=l.token,p=f.access_token,v=f.refresh_token,g=l.userProfile,m=g.displayName,y=g.id,this.loginInfo={securityKey:h,callUri:d,refresh_token:v,access_token:p,id:y,displayName:m,extUserId:a},this.logger.log("[iauth] login data:",this.loginInfo),e.abrupt("return",Xl("XYSDK:950120",{access_token:p}));case 23:return this.logger.error("[iauth]login error: ",u),b=(u||{}).data,S=Gl[b.errorCode]||Gl[0],e.abrupt("return",Xl(S,b));case 27:e.next=33;break;case 29:return e.prev=29,e.t1=e.catch(3),this.logger.error("[iauth]catch login error:: ",e.t1),e.abrupt("return",Xl("XYSDK:950102",e.t1));case 33:case"end":return e.stop()}}),r,this,[[3,29]])})))}}]),t}();const xp="function"==typeof atob,Ip="function"==typeof btoa,_p="function"==typeof Buffer,Ap="function"==typeof TextDecoder?new TextDecoder:void 0,Tp="function"==typeof TextEncoder?new TextEncoder:void 0,Rp=Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Op=(e=>{let t={};return Rp.forEach((e,n)=>t[e]=n),t})(),Dp=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Np=String.fromCharCode.bind(String),Lp="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),Pp=e=>e.replace(/=/g,"").replace(/[+\/]/g,e=>"+"==e?"-":"_"),Mp=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Bp=e=>{let t,n,r,i,o="";const a=e.length%3;for(let a=0;a<e.length;){if((n=e.charCodeAt(a++))>255||(r=e.charCodeAt(a++))>255||(i=e.charCodeAt(a++))>255)throw new TypeError("invalid character found");t=n<<16|r<<8|i,o+=Rp[t>>18&63]+Rp[t>>12&63]+Rp[t>>6&63]+Rp[63&t]}return a?o.slice(0,a-3)+"===".substring(a):o},Gp=Ip?e=>btoa(e):_p?e=>Buffer.from(e,"binary").toString("base64"):Bp,jp=_p?e=>Buffer.from(e).toString("base64"):e=>{let t=[];for(let n=0,r=e.length;n<r;n+=4096)t.push(Np.apply(null,e.subarray(n,n+4096)));return Gp(t.join(""))},Hp=e=>{if(e.length<2)return(t=e.charCodeAt(0))<128?e:t<2048?Np(192|t>>>6)+Np(128|63&t):Np(224|t>>>12&15)+Np(128|t>>>6&63)+Np(128|63&t);var t=65536+1024*(e.charCodeAt(0)-55296)+(e.charCodeAt(1)-56320);return Np(240|t>>>18&7)+Np(128|t>>>12&63)+Np(128|t>>>6&63)+Np(128|63&t)},Up=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,Kp=e=>e.replace(Up,Hp),Fp=_p?e=>Buffer.from(e,"utf8").toString("base64"):Tp?e=>jp(Tp.encode(e)):e=>Gp(Kp(e)),zp=(e,t=!1)=>t?Pp(Fp(e)):Fp(e),Yp=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Vp=e=>{switch(e.length){case 4:var t=((7&e.charCodeAt(0))<<18|(63&e.charCodeAt(1))<<12|(63&e.charCodeAt(2))<<6|63&e.charCodeAt(3))-65536;return Np(55296+(t>>>10))+Np(56320+(1023&t));case 3:return Np((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Np((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},Xp=e=>e.replace(Yp,Vp),Wp=e=>{if(e=e.replace(/\s+/g,""),!Dp.test(e))throw new TypeError("malformed base64.");e+="==".slice(2-(3&e.length));let t,n,r,i="";for(let o=0;o<e.length;)t=Op[e.charAt(o++)]<<18|Op[e.charAt(o++)]<<12|(n=Op[e.charAt(o++)])<<6|(r=Op[e.charAt(o++)]),i+=64===n?Np(t>>16&255):64===r?Np(t>>16&255,t>>8&255):Np(t>>16&255,t>>8&255,255&t);return i},qp=xp?e=>atob(Mp(e)):_p?e=>Buffer.from(e,"base64").toString("binary"):Wp,Zp=_p?e=>Lp(Buffer.from(e,"base64")):e=>Lp(qp(e),e=>e.charCodeAt(0)),Jp=_p?e=>Buffer.from(e,"base64").toString("utf8"):Ap?e=>Ap.decode(Zp(e)):e=>Xp(qp(e)),$p=e=>Mp(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Qp=e=>Jp($p(e)),ev=zp,tv=Qp;var nv=co.every,rv=to("every");qt({target:"Array",proto:!0,forced:!rv},{every:function(e){return nv(this,e,arguments.length>1?arguments[1]:void 0)}});var iv={DEVICES:{audioInputList:[],audioOutputList:[],videoInList:[]},currentSelectedDevice:{deviceId:"",groupId:"",label:""}},ov=function(t){o(a,Kf);var r=l(a);function a(e){var t;return n(this,a),(t=r.call(this)).logger=e||new If,t.navigator=navigator||window.navigator,t.currentDeviceList=iv.DEVICES,t.nextDeviceList=iv.DEVICES,t.currentUsedDevice={videoInput:iv.currentSelectedDevice,audioInput:iv.currentSelectedDevice,audioOutput:iv.currentSelectedDevice},t.currentPermission={microphone:"",camera:""},t.handlePermissionCameraStateChanged=t.handlePermissionCameraStateChanged.bind(c(t)),t.handlePermissionPhoneStateChanged=t.handlePermissionPhoneStateChanged.bind(c(t)),t.mediaDevicesChange=t.mediaDevicesChange.bind(c(t)),t.initDeviceEvent(),t}return i(a,[{key:"getDevicePermission",value:function(){return this.currentPermission}},{key:"getNextDeviceList",value:function(){return this.nextDeviceList}},{key:"setCurrentUsedDevice",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.emmit("currentDevice",t),this.logger.log("[DM]current used device in first calling: ",t),this.currentUsedDevice=kp(t),e.next=5,this.getPrivateDevices();case 5:r=e.sent,this.currentDeviceList=kp(r),this.mediaDevicesChange();case 8:case"end":return e.stop()}}),n,this)})))}},{key:"setCurrentUsedDeviceByType",value:function(e,t){if("audio"===e){var n=this.currentDeviceList.audioInputList.find((function(e){return e.deviceId===t}));n&&(this.currentUsedDevice.audioInput=n)}else if("video"===e){var r=this.currentDeviceList.videoInList.find((function(e){return e.deviceId===t}));r&&(this.currentUsedDevice.videoInput=r)}}},{key:"setAudioOutputDevice",value:function(e,t){var n=this;e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){n.logger.log("[DM]switch audio output device successfully: ".concat(t))})).catch((function(e){var t=e;"SecurityError"===e.name&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),n.logger.error(t)})):this.logger.warn("[DM]Browser does not support output device selection.")}},{key:"emmitDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.init();case 2:return e.next=4,this.emmitPermission();case 4:return e.next=6,this.mediaDevicesChange();case 6:case"end":return e.stop()}}),t,this)})))}},{key:"init",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:return n=e.sent,e.prev=3,e.next=6,this.getPermission();case 6:this.currentPermission=e.sent,e.next=12;break;case 9:e.prev=9,e.t0=e.catch(3),this.currentPermission={microphone:"unknown",camera:"unknown"};case 12:this.currentDeviceList=this.nextDeviceList=n,this.logger.log("[DM]current device list: ",this.currentDeviceList),this.logger.log("[DM]current permission: ",this.currentPermission);case 15:case"end":return e.stop()}}),t,this,[[3,9]])})))}},{key:"destroy",value:function(){var e;this.removeDeviceEvent(),this.permissionCameraStatus&&this.permissionCameraStatus.removeEventListener("change",this.handlePermissionCameraStateChanged),this.permissionPhoneStatus&&this.permissionPhoneStatus.removeEventListener("change",this.handlePermissionPhoneStateChanged),null===(e=this.logger)||void 0===e||e.stopDB()}},{key:"getPrivateDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n={audioInputList:[],audioOutputList:[],videoInList:[]},e.prev=1,e.next=4,this.getDevices();case 4:n=e.sent,e.next=10;break;case 7:e.prev=7,e.t0=e.catch(1),this.logger.log("[DM]get device failed: ",e.t0);case 10:return e.abrupt("return",n);case 11:case"end":return e.stop()}}),t,this,[[1,7]])})))}},{key:"getDevices",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.navigator.mediaDevices.enumerateDevices();case 3:return n=e.sent,r=[],i=[],o=[],n.forEach((function(e){var t=h(e.kind.match(/(\w+)(input|output)/i),3),n=t[0],a=t[1],s=t[2];if(!e.label.match(/\(Virtual\)$/)&&e.deviceId){var c={deviceId:e.deviceId,kind:n,type:a,direction:s,label:e.label,groupId:e.groupId};"audioinput"===e.kind?r.push(c):"audiooutput"===e.kind?i.push(c):"videoinput"===e.kind&&o.push(c)}})),a={audioInputList:r,audioOutputList:i,videoInList:o},e.abrupt("return",a);case 12:return e.prev=12,e.t0=e.catch(0),e.abrupt("return",Promise.reject(Xl("XYSDK:950409",e.t0)));case 15:case"end":return e.stop()}}),t,this,[[0,12]])})))}},{key:"setPermission",value:function(e){this.currentPermission=e,this.emmit("permission",this.currentPermission)}},{key:"emmitPermission",value:function(){this.currentPermission.camera&&this.emmit("permission",this.currentPermission)}},{key:"query",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.navigator.permissions.query({name:t});case 3:return r=e.sent,e.abrupt("return",r);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",Promise.reject(Xl("XYSDK:950408",e.t0)));case 10:case"end":return e.stop()}}),n,this,[[0,7]])})))}},{key:"handlePermissionCameraStateChanged",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[DM]camera permission changed: ",t),r=t.target.state,i=this.currentPermission.camera,"granted"!==r||"granted"===i){e.next=10;break}return e.next=6,this.getPrivateDevices();case 6:o=e.sent,a={detail:o,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device when camera permission changed: ",a),this.emmit("device",a);case 10:"change"===t.type&&(this.currentPermission.camera=r),this.emmit("permission",this.currentPermission);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"handlePermissionPhoneStateChanged",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[DM]microphone permission changed: ",t),r=t.target.state,i=this.currentPermission.microphone,"granted"!==r||"granted"===i){e.next=10;break}return e.next=6,this.getPrivateDevices();case 6:o=e.sent,a={detail:o,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device when microphone permission changed: ",a),this.emmit("device",a);case 10:"change"===t.type&&(this.currentPermission.microphone=r),this.emmit("permission",this.currentPermission);case 12:case"end":return e.stop()}}),n,this)})))}},{key:"getPermission",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.query("camera");case 3:return n=e.sent,e.next=6,this.query("microphone");case 6:return r=e.sent,i={camera:n.state,microphone:r.state},this.permissionCameraStatus||(this.permissionCameraStatus=n,this.permissionCameraStatus.addEventListener("change",this.handlePermissionCameraStateChanged)),this.permissionPhoneStatus||(this.permissionPhoneStatus=r,this.permissionPhoneStatus.addEventListener("change",this.handlePermissionPhoneStateChanged)),e.abrupt("return",i);case 13:return e.prev=13,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 16:case"end":return e.stop()}}),t,this,[[0,13]])})))}},{key:"diffAudioDevice",value:function(e,t){var n;if(e.length===t.length){var r=e[0]&&e[0].deviceId||"default",i=t[0]&&t[0].deviceId||"default",o=e[0]&&e[0].label||"",a=t[0]&&t[0].label||"";r===i&&o===a||(n=t[0])}else n=t.filter((function(t){return e.every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(n=t[0]);return n}},{key:"diffVideoDevice",value:function(e,t){var n;return n=t.filter((function(t){return e.every((function(e){return e.deviceId!==t.deviceId}))}))[0],e.length>t.length&&(n=t[0]),n}},{key:"diffDevices",value:function(e,t){var n=e.audioInputList,r=e.audioOutputList,i=e.videoInList,o=t.audioInputList,a=t.audioOutputList,s=t.videoInList,c=this.diffAudioDevice(n,o),u=this.diffAudioDevice(r,a);return{audioInput:c,videoInput:this.diffVideoDevice(i,s),audioOutput:u}}},{key:"mediaDevicesChange",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:n=e.sent,r=this.currentUsedDevice.videoInput,this.nextDeviceList=kp(n),this.logger.log("[DM]nextDeviceList when mediaDevicesChange:",this.nextDeviceList),this.logger.log("[DM]currentDeviceList when mediaDevicesChange:",this.currentDeviceList),i=this.diffDevices(this.currentDeviceList,this.nextDeviceList),o=i.videoInput,a=i.audioInput,o&&o.deviceId!==(null==r?void 0:r.deviceId)?this.currentUsedDevice.videoInput=o:i.videoInput=void 0,this.currentUsedDevice.audioInput=a,this.currentDeviceList=kp(n),s={detail:n,nextDevice:i},this.logger.log("[DM]next used device when mediaDevicesChange: ",s),this.emmit("device",s);case 15:case"end":return e.stop()}}),t,this)})))}},{key:"initDeviceEvent",value:function(){var e;null===(e=this.navigator.mediaDevices)||void 0===e||e.addEventListener("devicechange",this.mediaDevicesChange)}},{key:"removeDeviceEvent",value:function(){var e;null===(e=this.navigator.mediaDevices)||void 0===e||e.removeEventListener("devicechange",this.mediaDevicesChange)}}]),a}(),av=Mt.f,sv="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],cv={f:function(e){return sv&&"Window"==j(e)?function(e){try{return av(e)}catch(e){return Ca(sv)}}(e):av(Y(e))}},uv=C((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),lv=Object.isExtensible,hv=C((function(){lv(1)}))||uv?function(e){return!!X(e)&&((!uv||"ArrayBuffer"!=j(e))&&(!lv||lv(e)))}:lv,dv=!C((function(){return Object.isExtensible(Object.preventExtensions({}))})),fv=y((function(e){var t=Xe.f,n=!1,r=Ee("meta"),i=0,o=function(e){t(e,r,{value:{objectID:"O"+i++,weakData:{}}})},a=e.exports={enable:function(){a.enable=function(){},n=!0;var e=Mt.f,t=M([].splice),i={};i[r]=1,e(i).length&&(Mt.f=function(n){for(var i=e(n),o=0,a=i.length;o<a;o++)if(i[o]===r){t(i,o,1);break}return i},qt({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:cv.f}))},fastKey:function(e,t){if(!X(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!Se(e,r)){if(!hv(e))return"F";if(!t)return"E";o(e)}return e[r].objectID},getWeakData:function(e,t){if(!Se(e,r)){if(!hv(e))return!0;if(!t)return!1;o(e)}return e[r].weakData},onFreeze:function(e){return dv&&n&&hv(e)&&!Se(e,r)&&o(e),e}};ct[r]=!0}));fv.enable,fv.fastKey,fv.getWeakData,fv.onFreeze;var pv=function(e,t,n){for(var r in t)yt(e,r,t[r],n);return e},vv=Xe.f,gv=fv.fastKey,mv=gt.set,yv=gt.getterFor,bv={getConstructor:function(e,t,n,r){var i=e((function(e,i){Vn(e,o),mv(e,{type:t,index:Ao(null),first:void 0,last:void 0,size:0}),E||(e.size=0),null!=i&&Gi(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,a=yv(t),s=function(e,t,n){var r,i,o=a(e),s=c(e,t);return s?s.value=n:(o.last=s={index:i=gv(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),E?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var n,r=a(e),i=gv(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return pv(o,{clear:function(){for(var e=a(this),t=e.index,n=e.first;n;)n.removed=!0,n.previous&&(n.previous=n.previous.next=void 0),delete t[n.index],n=n.next;e.first=e.last=void 0,E?e.size=0:this.size=0},delete:function(e){var t=a(this),n=c(this,e);if(n){var r=n.next,i=n.previous;delete t.index[n.index],n.removed=!0,i&&(i.next=r),r&&(r.previous=i),t.first==n&&(t.first=r),t.last==n&&(t.last=i),E?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=a(this),r=nr(e,arguments.length>1?arguments[1]:void 0);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!c(this,e)}}),pv(o,n?{get:function(e){var t=c(this,e);return t&&t.value},set:function(e,t){return s(this,0===e?0:e,t)}}:{add:function(e){return s(this,e=0===e?0:e,e)}}),E&&vv(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=yv(t),o=yv(r);is(e,t,(function(e,t){mv(this,{type:r,target:e,state:i(e),kind:t,last:void 0})}),(function(){for(var e=o(this),t=e.kind,n=e.last;n&&n.removed;)n=n.previous;return e.target&&(e.last=n=n?n.next:e.state.first)?"keys"==t?{value:n.key,done:!1}:"values"==t?{value:n.value,done:!1}:{value:[n.key,n.value],done:!1}:(e.target=void 0,{value:void 0,done:!0})}),n?"entries":"values",!n,!0),zn(t)}};!function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",a=k[e],s=a&&a.prototype,c=a,u={},l=function(e){var t=M(s[e]);yt(s,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!X(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!X(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!X(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(Xt(e,!V(a)||!(i||s.forEach&&!C((function(){(new a).entries().next()})))))c=n.getConstructor(t,e,r,o),fv.enable();else if(Xt(e,!0)){var h=new c,d=h[o](i?{}:-0,1)!=h,f=C((function(){h.has(1)})),p=Fi((function(e){new a(e)})),v=!i&&C((function(){for(var e=new a,t=5;t--;)e[o](t,t);return!e.has(-0)}));p||((c=t((function(e,t){Vn(e,s);var n=rh(new a,e,c);return null!=t&&Gi(t,n[o],{that:n,AS_ENTRIES:r}),n}))).prototype=s,s.constructor=c),(f||v)&&(l("delete"),l("has"),r&&l("get")),(v||d)&&l(o),i&&s.clear&&delete s.clear}u[e]=c,qt({global:!0,constructor:!0,forced:c!=a},u),Kn(c,e),i||n.setStrong(c,e,r)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),bv);var Sv=TypeError,wv=function(e,t){if(!delete e[t])throw Sv("Cannot delete property "+ce(t)+" of "+ce(e))},kv=xn("splice"),Cv=Math.max,Ev=Math.min;qt({target:"Array",proto:!0,forced:!kv},{splice:function(e,t){var n,r,i,o,a,s,c=ye(this),u=At(c),l=xt(e,u),h=arguments.length;for(0===h?n=r=0:1===h?(n=0,r=u-l):(n=h-2,r=Ev(Cv(kt(t),0),u-l)),rn(u+n-r),i=Cn(c,r),o=0;o<r;o++)(a=l+o)in c&&on(i,o,c[a]);if(i.length=r,n<r){for(o=l;o<u-r;o++)s=o+n,(a=o+r)in c?c[s]=c[a]:wv(c,s);for(o=u;o>u-r+n;o--)wv(c,o-1)}else if(n>r)for(o=u-r;o>l;o--)s=o+n-1,(a=o+r-1)in c?c[s]=c[a]:wv(c,s);for(o=0;o<n;o++)c[o+l]=arguments[o+2];return c.length=u-r+n,i}});var xv=function(){function t(e,r){n(this,t),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state="",this.cb=function(){},e&&(this.logger=e),this.isContent=!!r,this.streamTimmerCountDown=500,this.loadStatus="LOAD_START",this.streamStatus="ENABLED",this.streamStatusTimmer=null,this.onCanPlay=this.onCanPlay.bind(this),this.onLoadStart=this.onLoadStart.bind(this),this.onError=this.onError.bind(this),this.onUnmute=this.onUnmute.bind(this),this.onMute=this.onMute.bind(this),this.onEnded=this.onEnded.bind(this),this.onAbort=this.onAbort.bind(this),this.onEmptied=this.onEmptied.bind(this),this.onVideoEnded=this.onVideoEnded.bind(this),this.onLoadeddata=this.onLoadeddata.bind(this),this.onStalled=this.onStalled.bind(this),this.onSuspend=this.onSuspend.bind(this),this.onWaiting=this.onWaiting.bind(this)}return i(t,[{key:"initVideoStreamById",value:function(e,t){var n=(null==t?void 0:t.id)||"";this.key=e,n!==this.streamId&&(this.stream&&this.removeStreamTrackEventListener(),t&&this.initStreamTrackEventListener(t),this.stream=t),this.setSrcObject(n),this.streamId=n}},{key:"getVideoTracks",value:function(){return this.stream?this.stream.getVideoTracks():[]}},{key:"updateLocalTrack",value:function(){this.removeStreamTrackEventListener(),this.initStreamTrackEventListener(this.stream),this.sendVideoStatus()}},{key:"initVideoSource",value:function(e){var t=document.getElementById(e);if(t){var n=t.querySelector("video");if(n)n.autoplay=!0,n.playsInline=!0,n.controls=!1,n.defaultMuted=!0,n.muted=!0;else{var r=document.createElement("video");r.autoplay=!0,r.playsInline=!0,r.controls=!1,r.defaultMuted=!0,r.muted=!0,t.appendChild(r),n=r}this.wrapEleId!==e||n!==this.videoEle?(this.videoEle&&this.videoEle!==n&&this.removeEventListener(this.videoEle),this.wrapEleId=e,this.videoEle=n,this.initEventListener(this.videoEle),this.logger.log("[VM]init video source: ",{key:this.key,wrapEleId:this.wrapEleId}),this.setSrcObject()):this.logger.log("[vm]update video ele",e)}else{var i="Not found wrap video element use id ".concat(this.wrapEleId," selector");this.logger.log(i)}}},{key:"setSrcObject",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.stream){e.next=3;break}return this.logger.warn("[VM]setSrcObject: stream not exist",{streamId:t}),e.abrupt("return");case 3:if(!this.videoEle||this.isHaveSrcObject()&&this.streamId===t){e.next=15;break}if(this.videoEle.srcObject=this.stream,!this.videoEle.paused){e.next=14;break}return e.prev=6,e.next=9,this.videoEle.play();case 9:e.next=14;break;case 11:e.prev=11,e.t0=e.catch(6),"NotAllowedError"===(null===e.t0||void 0===e.t0?void 0:e.t0.name)&&(this.emmit(this.key,{status:"VIDEO_PLAY_FAILED",id:this.key,error:e.t0}),this.logger.warn("[VM] video play error: ",e.t0));case 14:this.logger.log("[VM]set video srcObject: ",{key:this.key,streamId:this.streamId});case 15:case"end":return e.stop()}}),n,this,[[6,11]])})))}},{key:"initEventListener",value:function(e){e.addEventListener("canplay",this.onCanPlay),e.addEventListener("loadstart",this.onLoadStart),e.addEventListener("error",this.onError),e.addEventListener("waiting",this.onWaiting),e.addEventListener("suspend",this.onSuspend),e.addEventListener("stalled",this.onStalled),e.addEventListener("loadeddata",this.onLoadeddata),e.addEventListener("ended",this.onVideoEnded),e.addEventListener("emptied",this.onEmptied),e.addEventListener("abort",this.onAbort)}},{key:"removeEventListener",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoEle;null==e||e.removeEventListener("canplay",this.onCanPlay),null==e||e.removeEventListener("loadstart",this.onLoadStart),null==e||e.removeEventListener("error",this.onError),null==e||e.removeEventListener("waiting",this.onWaiting),null==e||e.removeEventListener("suspend",this.onSuspend),null==e||e.removeEventListener("stalled",this.onStalled),null==e||e.removeEventListener("loadeddata",this.onLoadeddata),null==e||e.removeEventListener("ended",this.onVideoEnded),null==e||e.removeEventListener("emptied",this.onEmptied),null==e||e.removeEventListener("abort",this.onAbort)}},{key:"initStreamTrackEventListener",value:function(e){var t,n,r;null===(t=null==e?void 0:e.getVideoTracks()[0])||void 0===t||t.addEventListener("mute",this.onMute),null===(n=null==e?void 0:e.getVideoTracks()[0])||void 0===n||n.addEventListener("unmute",this.onUnmute),null===(r=null==e?void 0:e.getVideoTracks()[0])||void 0===r||r.addEventListener("ended",this.onEnded)}},{key:"removeStreamTrackEventListener",value:function(){var e,t,n,r,i,o;this.streamStatus="ENABLED",null===(t=null===(e=this.stream)||void 0===e?void 0:e.getVideoTracks()[0])||void 0===t||t.removeEventListener("mute",this.onMute),null===(r=null===(n=this.stream)||void 0===n?void 0:n.getVideoTracks()[0])||void 0===r||r.removeEventListener("unmute",this.onUnmute),null===(o=null===(i=this.stream)||void 0===i?void 0:i.getVideoTracks()[0])||void 0===o||o.removeEventListener("ended",this.onEnded)}},{key:"isHaveSrcObject",value:function(){return this.videoEle&&this.videoEle.srcObject}},{key:"setSource",value:function(e,t){this.logger.log("[vm]set source",{key:e,thisKey:this.key,wrapId:t,thisWrapId:this.wrapEleId}),this.key=e,this.initVideoSource(t)}},{key:"destroy",value:function(){this.clearTrackStatusTimmer(),this.removeEventListener(this.videoEle),this.stream&&this.removeStreamTrackEventListener(),this.videoEle&&(this.videoEle.srcObject=null),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state=""}},{key:"setVideoStatusChange",value:function(e){this.cb=e}},{key:"onEnded",value:function(){this.streamStatus="ENDED",this.sendVideoStatus()}},{key:"onMute",value:function(){var e=this;this.streamStatus="MUTE",this.clearTrackStatusTimmer(),this.streamStatusTimmer=setTimeout((function(){"MUTE"===e.streamStatus&&e.sendVideoStatus()}),this.streamTimmerCountDown)}},{key:"onUnmute",value:function(){this.clearTrackStatusTimmer(),this.streamStatus="ENABLED",this.sendVideoStatus()}},{key:"onSuspend",value:function(){this.logger.log("video suspend",this.key)}},{key:"onWaiting",value:function(){this.logger.log("video waiting",this.key)}},{key:"onStalled",value:function(){this.logger.log("video stalled",this.key)}},{key:"onLoadeddata",value:function(){this.logger.log("video loadeddata",this.key)}},{key:"onVideoEnded",value:function(){this.logger.log("video videoEnded",this.key)}},{key:"onEmptied",value:function(){this.logger.log("video emptied",this.key)}},{key:"onAbort",value:function(){this.logger.log("video abort",this.key)}},{key:"onCanPlay",value:function(){this.logger.log("video canplay",this.key),this.loadStatus="CANPLAY",this.sendVideoStatus()}},{key:"onLoadStart",value:function(){this.logger.log("video loadstart",this.key),this.loadStatus="LOAD_START",this.sendVideoStatus()}},{key:"onError",value:function(){this.logger.log("video error",this.key),this.loadStatus="ERROR"}},{key:"clearTrackStatusTimmer",value:function(){this.streamStatusTimmer&&(clearTimeout(this.streamStatusTimmer),this.streamStatusTimmer=null)}},{key:"sendVideoStatus",value:function(){"CANPLAY"===this.loadStatus&&"ENABLED"===this.streamStatus?("CANPLAY"!==this.state&&(this.streamTimmerCountDown=1e4),this.state="CANPLAY",this.emmit(this.key,{status:"CANPLAY",id:this.key})):"ENDED"===this.streamStatus?(this.state="ENDED",this.emmit(this.key,{status:"ENDED",id:this.key})):"LOAD_START"!==this.loadStatus&&"MUTE"!==this.streamStatus||this.isContent&&"CANPLAY"===this.loadStatus||(this.state="REQUEST",this.emmit(this.key,{status:"REQUEST",id:this.key}))}},{key:"emmit",value:function(e,t){this.cb&&this.cb(e,t)}}]),t}(),Iv=ha.trim,_v=M("".charAt),Av=k.parseFloat,Tv=k.Symbol,Rv=Tv&&Tv.iterator,Ov=1/Av(oa+"-0")!=-1/0||Rv&&!C((function(){Av(Object(Rv))}))?function(e){var t=Iv(po(e)),n=Av(t);return 0===n&&"-"==_v(t,0)?-0:n}:Av;qt({global:!0,forced:parseFloat!=Ov},{parseFloat:Ov});var Dv=function(e,t,n){var r=e.roster,i=r.videoRxMute,o=r.videoTxMute,a=r.deviceType,s=r.isContent,c=r.isLocal;return s?o?"AUDIO_CONTENT":t&&"REQUEST"!==n&&n?"NORMAL":"REQUEST":i&&o?"AUDIO_ONLY":o||"ENDED"===n?"MUTE":"tel"===a||"pstngw"===a?"AUDIO_TEL":t&&"REQUEST"!==n||c?"NORMAL":"REQUEST"},Nv=function(e,t,n,r,i){var o,a,s=parseFloat((e/t).toFixed(3)),c=rf.RATIO_MAP[i];return s<rf.HOR_CONTAINER_RATIO?(o=n,a=parseFloat((n*s).toFixed(3))):(o=parseFloat((r/s).toFixed(3)),a=r),{realWidth:a,realHeight:o,realRotate:c}},Lv=function(e,t,n){var r=e.width,i=void 0===r?16:r,o=e.height,a=void 0===o?9:o,s=e.rotation,c={};if(s>=0&&s<=3){var u=1===s||3===s,l=Nv(u?a:i,u?i:a,n,t,s),h=l.realWidth,d=l.realHeight,f=l.realRotate;c={transform:"rotateZ(".concat(f,"deg)"),width:"".concat(u?d:h,"px"),height:"".concat(u?h:d,"px")}}return c},Pv=function(){return new Promise((function(e,t){var n,r,i=["video/VP8","video/H264"],o=["audio/opus"];Na.isFirefox()&&e({video:i,audio:o});try{o=(null===(n=RTCRtpSender.getCapabilities("audio"))||void 0===n?void 0:n.codecs.filter((function(e){return"audio/opus"===e.mimeType})).map((function(e){return e.mimeType})))||[],e({video:i=(i=(null===(r=RTCRtpSender.getCapabilities("video"))||void 0===r?void 0:r.codecs.filter((function(e){return"video/H264"===e.mimeType||"video/VP8"===e.mimeType})).map((function(e){return e.mimeType})))||[]).filter((function(e,t){return i.indexOf(e)===t})),audio:o})}catch(e){t(e)}}))},Mv=[-30,-30,1,1],Bv={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1}],"3-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1}],"4-1":[{position:[0,0,.75,1],resolution:3},{position:[.75,0,.25,.333],resolution:1},{position:[.75,.333,.25,.333],resolution:1},{position:[.75,.666,.25,.333],resolution:1}],"5-1":[{position:[.125,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1}],"6-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1}],"7-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1}],"8-1":[{position:[0,0,.75,.75],resolution:3},{position:[0,.75,.25,.25],resolution:1},{position:[.25,.75,.25,.25],resolution:1},{position:[.5,.75,.25,.25],resolution:1},{position:[.75,.75,.25,.25],resolution:1},{position:[.75,.5,.25,.25],resolution:1},{position:[.75,.25,.25,.25],resolution:1},{position:[.75,0,.25,.25],resolution:1}]},Gv={"1-1":[{position:[0,0,1,1],resolution:3}],"2-1":[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}],"3-1":[{position:[.25,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2}],"4-1":[{position:[0,0,.5,.5],resolution:2},{position:[0,.5,.5,.5],resolution:2},{position:[.5,0,.5,.5],resolution:2},{position:[.5,.5,.5,.5],resolution:2}],"5-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1}],"6-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.666,.5,.333,.5],resolution:1}],"7-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1}],"8-1":[{position:[0,0,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1}],"9-1":[{position:[0,0,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.333,.333],resolution:1},{position:[0,.333,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.666,.333,.333,.333],resolution:1},{position:[0,.666,.333,.333],resolution:1},{position:[.333,.666,.333,.333],resolution:1},{position:[.666,.666,.333,.333],resolution:1}]},jv={SPEAKER:{length:8,temp:{0:Bv["1-1"],1:Bv["1-1"],2:Bv["2-1"],3:Bv["3-1"],4:Bv["4-1"],5:Bv["5-1"],6:Bv["6-1"],7:Bv["7-1"],8:Bv["8-1"]},rate:{0:.5625,1:.5625,2:.4218,3:.4218,4:.4218,5:.5625,6:.5625,7:.5625,8:.5625}},GALLERY:{length:9,temp:{0:Gv["1-1"],1:Gv["1-1"],2:Gv["2-1"],3:Gv["3-1"],4:Gv["4-1"],5:Gv["5-1"],6:Gv["6-1"],7:Gv["7-1"],8:Gv["8-1"],9:Gv["9-1"]},rate:{0:.5625,1:.5625,2:.2812,3:.5625,4:.5625,5:.375,6:.375,7:.5625,8:.5625,9:.5625}}},Hv=kp(jv.SPEAKER);Object.keys(Hv.temp).forEach((function(e){Hv.temp[e][0].resolution=4,Hv.temp[e][0].isContent=!0}));var Uv=kp(jv.SPEAKER);Object.keys(Uv.temp).forEach((function(e){var t=Number(e);t>0&&(t<=2&&(Uv.temp[e][t-1].resolution=3,Uv.temp[e][t-1].isContent=!0),t>2&&(Uv.temp[e][2].resolution=3,Uv.temp[e][2].isContent=!0))}));var Kv={MULTI_PIC_CONTENT_HIGH_PRIORITY:Hv,MULTI_PIC_ACTIVE_HIGH_PRIORITY:Uv,TWO_PIC_PIP:{length:2,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}],2:[{position:[0,0,1,1],resolution:4,zIndex:1,isContent:!0},{position:[.75,.75,.25,.25],resolution:1,zIndex:2}]},rate:{1:.5625,2:.5625}},CONTENT_ONLY:{length:1,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}]},rate:{1:.5625}},TWO_PIC_SYMMETRIC:{length:2,temp:{1:[{position:[0,0,1,1],resolution:4,isContent:!0}],2:[{position:[0,0,.5,1],resolution:4,isContent:!0},{position:[.5,0,.5,1],resolution:3}]},rate:{1:.5625,2:.2812}}},Fv=Object.assign(Object.assign({},jv),Kv),zv=function(){function t(e){var r;n(this,t),this.client=e,this.logger=e.logger,this.customLayoutList=new Map,this.layoutList=new Map,this.videoManagers={},this.originOrderRosters=[],this.orderRosterList=[],this.selfRoster=Object.assign(Object.assign({},rf.ROSTER),{isLocal:!0}),this.newLayoutList=[],this.initLayout=[],this.templateMode=(null===(r=e.config)||void 0===r?void 0:r.templateMode)||"SPEAKER",this.templateRate={previous:.5625,next:0},this.content={previous:null,next:null},this.screenInfo={width:0,height:0,rateHeight:0,rateWidth:0},this.internelsLayout={},this.forceFullScreenId="",this.localContent=null,this.preConfInfo=null,this.confInfo=kp(rf.CONF_INFO),this.pageInfo={pageSize:9,currentPage:0,totalPage:0},this.isLocalShareContent=!1,this.calculateScreenInfo(),this.onVideoStatusChange=this.onVideoStatusChange.bind(this)}return i(t,[{key:"getNewLayout",value:function(){return this.newLayoutList}},{key:"getOrderRosterList",value:function(){return this.orderRosterList}},{key:"getOriginOrderRosters",value:function(){return this.originOrderRosters}},{key:"getLayoutList",value:function(){return this.layoutList}},{key:"getCustomLayoutList",value:function(){return this.customLayoutList}},{key:"getTemplateRate",value:function(){return this.templateRate}},{key:"getContentRosterItem",value:function(){return this.content.next}},{key:"getSelfRoster",value:function(){return this.selfRoster}},{key:"getScreenInfo",value:function(){return this.screenInfo}},{key:"getVideoManagers",value:function(){return this.videoManagers}},{key:"getForceFullScreenId",value:function(){return this.forceFullScreenId}},{key:"getTemplateMode",value:function(){return this.templateMode}},{key:"getConfInfo",value:function(){return this.confInfo}},{key:"getInternelsLayout",value:function(){return this.internelsLayout}},{key:"getLocalShareState",value:function(){return this.isLocalShareContent}},{key:"setOrderRosterList",value:function(e){this.orderRosterList=e}},{key:"setOriginOrderRosters",value:function(e){this.originOrderRosters=e}},{key:"setForceFullScreenId",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";this.forceFullScreenId=e,this.client.emmit("force-full-screen",this.forceFullScreenId)}},{key:"setTemplateMode",value:function(e){this.templateMode=e}},{key:"setContentRosterItem",value:function(e){this.content={previous:e,next:e}}},{key:"setConfInfo",value:function(e){e.contentUri||(this.content.next=null),this.confInfo=e}},{key:"setLocalShareContent",value:function(e){this.isLocalShareContent=e,this.pageInfo.currentPage=0,this.templateMode=e?"GALLERY":"SPEAKER",this.client.emmit("page-info",this.pageInfo),this.confInfo.contentUri="",this.calcRequestNewLayout()}},{key:"calcTemplate",value:function(){var e,t=[],n=this.pageInfo,r=n.currentPage,i=n.pageSize;switch(this.templateMode){case"MULTI_PIC_ACTIVE_HIGH_PRIORITY":this.orderRosterList[0]=this.orderRosterList.splice(2,1,this.orderRosterList[0])[0],this.orderRosterList=this.orderRosterList.filter(Boolean);break;case"TWO_PIC_PIP":case"TWO_PIC_SYMMETRIC":this.orderRosterList.length>2&&(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal})));break;case"CONTENT_ONLY":this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal}))}var o=this.orderRosterList.length;r>1&&(o=i);var a=Fv[this.templateMode]||Fv.SPEAKER,s=a.temp,c=a.rate,u=a.length;if((t=s[o]||s[u],e=c[o]||c[u],1===this.pageInfo.currentPage&&9===o)&&this.orderRosterList.find((function(e){return e.isLocal}))){var l=[(t=kp(t))[6],t[1]];t[1]=l[0],t[6]=l[1]}return{tempLayout:t,templateRate:e}}},{key:"initLayoutManager",value:function(){var e=this.templateRate.next,t=this.calcTemplate(),n=t.tempLayout,r=t.templateRate;e!==r&&(this.templateRate={next:r,previous:r},this.calculateScreenInfo()),this.initLayout=kp(n),this.newLayoutList=this.calculateNewLayoutList()}},{key:"onVideoStatusChange",value:function(e,t){this.logger.log("[LM]on video status change: ",{key:e,data:t});var n,r="AUTO"===this.client.config.layout,i=r?this.layoutList:this.customLayoutList,o=t.status,a=i.has(e),s=!1;if("VIDEO_PLAY_FAILED"===o&&this.client.emmit("play-failed",{type:"video",key:e,error:t.error}),a){var c=i.get(e),u=c.state,l=c.roster.isLocal;"NORMAL"!==u&&"REQUEST"!==u||"ENDED"!==o?"NORMAL"!==u||"REQUEST"!==o||l?("REQUEST"!==u&&"INVALID"!==u||"CANPLAY"!==o)&&("MUTE"!==u||"CANPLAY"!==o||l)||(n="NORMAL",s=!0):(n="REQUEST",s=!0):(n="INVALID",s=!0),s&&(i.set(e,Object.assign(Object.assign({},c),{state:n})),r?(this.layoutList=i,this.client.sendLayoutMessage()):(this.customLayoutList=i,this.client.sendCustomLayoutMessage()))}}},{key:"setVideoRenderer",value:function(e,t){if(this.logger.log("[lm]set video renderer:",{key:e,wrapEleId:t}),!this.videoManagers[e]){this.logger.log("[lm]Not Match VM: ",e);var n="1"===e.charAt(e.length-1);this.videoManagers[e]=new xv(this.logger,n),this.videoManagers[e].setVideoStatusChange(this.onVideoStatusChange)}this.videoManagers[e].setSource(e,t)}},{key:"removeVideoRenderer",value:function(e,t){this.videoManagers[e]&&(this.logger.log("[lm]remove VM: ",e),delete this.videoManagers[e])}},{key:"playVideo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:r=0,i=Object.keys(this.videoManagers);case 1:if(!(r<i.length)){e.next=12;break}if(o=i[r],!(t&&t.indexOf(o)>-1)&&t){e.next=9;break}if(!(null==(a=this.videoManagers[o].videoEle)?void 0:a.srcObject)){e.next=9;break}return e.next=8,a.play();case 8:this.logger.log("replay video successfully:",o);case 9:r++,e.next=1;break;case 12:case"end":return e.stop()}}),n,this)})))}},{key:"updateLocalTrack",value:function(){var e=this.selfRoster.id,t=this.videoManagers[e];t&&t.updateLocalTrack()}},{key:"updateStreams",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n="AUTO"===this.client.config.layout,r=n?this.layoutList:this.customLayoutList,i=this.client.getLayoutRosters(),o=i.total.length;r.forEach((function(t,n){var a=t.roster,s=a.isLocal,c=a.id,u=a.isContent,l=!1;e.videoManagers[c]||(e.videoManagers[c]=new xv(e.logger,u),e.videoManagers[c].setVideoStatusChange(e.onVideoStatusChange)),e.videoManagers[c].match=!0;var h=e.videoManagers[c].state;if(s){var d=e.client.getPreviewStreams().previewStreams,f=((void 0===d?[]:d)[0]||{stream:null}).stream;e.videoManagers[c].initVideoStreamById(c,f);var p=Dv(t,f,h),v=r.get(n);v&&r.set(n,Object.assign(Object.assign({},v),{state:p}))}else{for(var g=0;g<o;g++){var m=i.total[g],y=m.participantId,b=m.mediagroupid,S=m.videoTrackId;if(t.roster.participantId+t.roster.mediagroupid===y+b){var w=e.getVideoStreamByTrackId(S).videoStream;l=!0,e.videoManagers[c].initVideoStreamById(c,w);var k=Dv(t,w,h),C=r.get(n);C&&r.set(n,Object.assign(Object.assign({},C),{state:k}));break}}if(!l){e.videoManagers[c].initVideoStreamById(c,null);var E=Dv(t,null,h),x=r.get(n);x&&r.set(n,Object.assign(Object.assign({},x),{state:E}))}}})),this.clearInvalidVideoManagers(),this.logger.log("updated new layout list",Vl(r)),n?(this.layoutList=r,t&&this.client.sendLayoutMessage()):(this.customLayoutList=r,t&&this.client.sendCustomLayoutMessage())}},{key:"clearInvalidVideoManagers",value:function(){var e=this;Object.keys(this.videoManagers).forEach((function(t){e.videoManagers[t].match?delete e.videoManagers[t].match:(e.videoManagers[t].destroy(),delete e.videoManagers[t])}))}},{key:"calcPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.confInfo,t=this.preConfInfo||{},n=t.contentUri,r=void 0===n?"":n,i=t.chairManUrl,o=void 0===i?"":i,a=e.participantCount,s=e.contentUri,c=e.chairManUrl,u=this.pageInfo,l=u.pageSize,h=u.currentPage,d=a>112?112:a,f=Math.max(Math.ceil(d/l),0);h=Math.min(h,f),this.pageInfo.totalPage=f,this.pageInfo.currentPage=h;var p=s?af:of;(p.indexOf(this.templateMode)<0&&"GALLERY"!==this.templateMode||!this.isLocalShareContent&&o!==c)&&(this.pageInfo.currentPage=0,this.templateMode=s?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER"),!r&&s&&(this.pageInfo.currentPage=0,this.templateMode="MULTI_PIC_CONTENT_HIGH_PRIORITY",this.isLocalShareContent&&this.setLocalShareContent(!1)),this.preConfInfo=kp(this.confInfo),this.logger.log("auto pageInfo:",this.pageInfo),this.client.emmit("page-info",this.pageInfo)}},{key:"setPageInfo",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;this.forceFullScreenId&&this.setForceFullScreenId(""),this.pageInfo.currentPage=e;var t=this.confInfo.contentUri;this.templateMode=e>0?"GALLERY":t?this.templateModeTemp:"SPEAKER",this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo)}},{key:"calcForceFullScreenRequestLayout",value:function(){var e=this.pageInfo.pageSize,t=[],n=this.forceFullScreenId===this.selfRoster.id,r=this.layoutList.get(this.forceFullScreenId);if(n)this.createAutoLayout([]);else{var i=(null==r?void 0:r.roster)||{},o=i.endpointId,a=void 0===o?"":o,s=i.mediagroupid,c=s?4:3;t.push({calluri:a,mediagroupid:s,resolution:c,quality:2}),this.client.requestNewLayout(t,e,0)}}},{key:"calcRequestNewLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pageInfo;if(this.logger.log("calc request layout page info:",e),this.forceFullScreenId)this.calcForceFullScreenRequestLayout();else{var t=this.confInfo,n=t.participantCount,r=void 0===n?0:n,i=t.chairManUrl,o=void 0===i?"":i,a=t.contentUri,s=void 0===a?"":a,c=e.pageSize,u=e.currentPage,l=e.totalPage,h=0===u&&s?1:0,d=Math.min(112,r),f=d+h-1,p=u>0?c:c-1,v=this.client.getLocalHide(),g=this.client.getOnHold(),m=[];if(u<=1&&!v&&(p-=1),r<=1&&!s)this.client.requestNewLayout([{mediagroupid:0,calluri:this.selfRoster.endpointId,resolution:3,quality:1}],c,0);else if(g)this.client.requestNewLayout(m,c,0);else{if(o&&(f=s?2:1),this.isLocalShareContent&&(f=Math.min(f,v?4:3)),u===l&&(u>0&&(f=d-(u-1)*c),v&&(f-=1)),(f=Math.min(f,p))>0){var y=Fv[this.templateMode],b=y.temp,S=y.length,w=["TWO_PIC_PIP","TWO_PIC_SYMMETRIC"],k=v||w.includes(this.templateMode)?0:1,C=Math.max(1,S-k),E=b[f]||b[C];E.forEach((function(e,t){var n=e.resolution,r=void 0===n?2:n,i=e.isContent,a=void 0!==i&&i,c="";0===u&&(c=a?s:o),m.push({mediagroupid:a?1:0,calluri:c,resolution:r,quality:4===r?2:1})}))}this.logger.log("request layout:",m),this.client.requestNewLayout(m,c,u,[],{uiShowLocalWhenPageMode:!v})}}}},{key:"createAutoLayout",value:function(e){var t=this;if(this.forceFullScreenId)if(this.forceFullScreenId===this.selfRoster.id)e=[];else{var n=e.find((function(e){return e.calluri+e.mediagroupid===t.forceFullScreenId}));if(!n||1===n.mediagroupid&&!this.confInfo.contentUri)return this.setForceFullScreenId(""),void this.calcRequestNewLayout()}this.createOrderRoster(e),this.createLayout()}},{key:"createOrderRoster",value:function(e){this.orderRosterList=[];var t=e.length,n=this.client.getLocalHide(),r=this.confInfo.chairManUrl;if(0!==t){for(var i=0;i<t;i++){var o,a,s=e[i],c=s.calluri,u=void 0===c?"":c,l=s.mediagroupid,h=s.isAudioMute,d=s.isVideoMute,f=s.remoteName,p=s.remoteType,v=s.MuteReason;a=u+l,o=Object.assign(Object.assign({},s),{id:a,isLocal:!1,isContent:1===l,displayName:f,endpointId:u,audioTxMute:h,videoTxMute:d,videoRxMute:!1,deviceType:p,audioRxMute:!1,videoMuteReason:v,isForceFullScreen:0===l&&u===r,isLastAdd:!1,onHold:!1,isPolling:!1}),1===l?(this.confInfo.contentUri&&(this.content=Object.assign(Object.assign({},this.content),{next:o})),this.orderRosterList.splice(0,0,o)):this.orderRosterList.push(o)}(!this.forceFullScreenId||this.forceFullScreenId&&this.forceFullScreenId===this.selfRoster.id)&&!n&&this.pageInfo.currentPage<=1&&this.orderRosterList.splice(1,0,this.selfRoster)}else this.orderRosterList=[this.selfRoster]}},{key:"createCustomLayout",value:function(e){var t=this;this.createOrderRoster(e),this.orderRosterList.forEach((function(e){var n=e.id;if(t.customLayoutList.has(n)){var r=t.customLayoutList.get(n);t.customLayoutList.set(n,Object.assign(Object.assign({},r),{roster:e,resolution:0,quality:0,deal:!0}))}else t.customLayoutList.set(n,{roster:e,rotate:{},state:"NORMAL",resolution:0,quality:0,deal:!0})})),this.clearInvalidLayout(),this.logger.log("[v2]custom layout list: ",this.customLayoutList)}},{key:"requestLayout",value:function(e){var t=this,n=this.orderRosterList;e.forEach((function(e){var r=e.callUri,i=void 0===r?"":r,o=e.isContent,a=e.resolution,s=e.quality,c=i+Number(o),u=t.customLayoutList.has(c),l=n.findIndex((function(e){return e.endpointId+Number(e.isContent)===c})),h=n[l],d=s>0?100*s:100;if(u){var f=t.customLayoutList.get(c);t.customLayoutList.set(c,Object.assign(Object.assign({},f),{roster:h,resolution:a,quality:d,deal:!0}))}else t.customLayoutList.set(c,{roster:h,rotate:{},state:"NORMAL",resolution:a,quality:d,deal:!0})})),this.clearInvalidLayout();var r=this.customLayoutCalculator();this.client.sendCustomLayout(r),this.logger.log("custom layout list: ",this.customLayoutList)}},{key:"calculatePosition",value:function(){var e=this,t={left:"0px",top:"0px",width:"0px",height:"0px"},n={width:0,height:0};this.layoutList.forEach((function(r,i){var o=e.screenInfo,a=o.rateWidth,s=o.rateHeight,c=h(r.position,4),u=c[0],l=c[1],d=c[2],f=c[3],p=Math.round(a*u),v=Math.round(s*l),g=Math.round(a*d),m=Math.round(s*f);t={left:"".concat(p,"px"),top:"".concat(v,"px"),width:"".concat(g,"px"),height:"".concat(m,"px")},n={width:g,height:m},r.zIndex&&(t.zIndex=r.zIndex),e.layoutList.set(i,Object.assign(Object.assign({},r),{positionStyle:t,positionInfo:n}))}))}},{key:"calculateRotate",value:function(){var e=this;this.client.getRotationInfo().forEach((function(t){var n=t.participantId,r=t.mediagroupid,i=e.getLayoutKeyByRotateInfo(n,r),o={};if(i){var a=e.layoutList.get(i);if(a){var s=a.positionInfo||{width:0,height:0},c=s.width,u=s.height;o=Lv(t,c,u),e.layoutList.set(i,Object.assign(Object.assign({},a),{rotate:o}))}}})),this.client.config.localMirror&&this.localMirrorRotate()}},{key:"getVideoStreamByTrackId",value:function(e){for(var t=this.client.getVideoTrackList(),n=t.length,r={videoStream:null,track:null},i=0;i<n;i++){var o=t[i].data,a=t[i].rest,s=o.streams[0].id;if((s=s.replace("-st","-tk-vd"))===e){r={videoStream:o.streams[0],track:a.track};break}}return r}},{key:"calculateNewLayoutList",value:function(){for(var e=this.orderRosterList.length,t=this.initLayout.length,n=[],r=this.client.getSpeakerInfo(),i=0;i<e;i++){var o=this.orderRosterList[i];if(Object.assign(o,{isActiveSpeaker:0===o.mediagroupid&&o.endpointId===r.endpointId}),!(i<t))break;var a=Mv,s=0,c=this.initLayout[i];c&&(a=(null==c?void 0:c.position)||Mv,s=(null==c?void 0:c.zIndex)||0),n.push({roster:o,position:a,resolution:(null==c?void 0:c.resolution)||1,zIndex:s})}return n}},{key:"calculateScreenInfo",value:function(){var e=this.client.getClientConfig();if("CUSTOM"===e.layout)return{width:0,height:0,rateHeight:0,rateWidth:0};var t=e.container||{elementId:"",offset:[]},n=t.elementId,r=void 0===n?"":n,i=t.offset,o=void 0===i?[]:i,a=r?document.getElementById(r):null,s=h(o,4),c=s[0],u=void 0===c?0:c,l=s[1],d=void 0===l?0:l,f=s[2],p=void 0===f?0:f,v=s[3],g=void 0===v?0:v,m=Number(u)+Number(d),y=Number(p)+Number(g),b=(null==a?void 0:a.clientHeight)||document.body.clientHeight,S=(null==a?void 0:a.clientWidth)||document.body.clientWidth,w=b-m,k=S-y,C=w>0?w:b,E=k>0?k:S,x=Math.floor(E*this.templateRate.next),I=Math.floor(C/this.templateRate.next),_={rateHeight:0,rateWidth:0,width:E,height:C};return _=C>x?{rateWidth:E,rateHeight:x,width:E,height:C}:{rateWidth:I,rateHeight:C,width:E,height:C},this.logger.log("client screen info: ",_),this.screenInfo=_,this.client.sendScreenInfoMessage(_),_}},{key:"createLayout",value:function(){var e=this.client.getPeerConnectionStatus();if(this.initLayoutManager(),this.createBaseLayout(),this.updateStreams(!1),this.calculatePosition(),this.calculateRotate(),this.client.sendLayoutMessage(),this.logger.log("create layout: ",Vl(this.layoutList)),this.logger.log("current template mode:",this.templateMode),"GALLERY"!==this.templateMode&&(this.templateModeTemp=this.templateMode),this.client.sendTemplateMode(this.templateMode),e){var t=this.content,n=t.previous,r=t.next;(null==n?void 0:n.participantId)!==(null==r?void 0:r.participantId)&&this.client.sendContentRosterMessage(r)}}},{key:"calculateOrderRosterList",value:function(){var e=this.client.getOriginRosters(),t=this.client.getInviteInfo().callerUri,n=this.client.getContentSenderPid(),r=this.client.getSpeakerInfo(),i=this.client.getLocalHide(),o=e.length,a={content:[],chairmain:[],selfRoster:[],activeSpeaker:[],audioVideoUnmute:[],audioUnmute:[],videoUnmute:[],audioVideoMute:[]},s=[];this.localContent=null;for(var c=0;c<o;c++){var u=e[c],l=u.mediagroupid,h=u.endpointId;u.isActiveSpeaker=!1,u.isLocal=!1,u.id=h+l,u.endpointId===t&&u.isContent?this.localContent=u:"record"!==u.deviceType&&(u.isContent&&n>0&&u.participantId!==n||(u.isContent&&n>0&&u.participantId===n?a.content.push(u):u.isForceFullScreen?a.chairmain.push(u):u.endpointId===t&&i&&o>1||(u.endpointId!==t||u.isContent||i?r.endpointId&&r.endpointId===u.endpointId?(u.isActiveSpeaker=!0,a.activeSpeaker.push(u)):u.audioTxMute||u.videoTxMute?u.audioTxMute||!u.videoTxMute?!u.audioTxMute||u.videoTxMute?u.audioTxMute&&u.videoTxMute&&a.audioVideoMute.push(u):a.videoUnmute.push(u):a.audioUnmute.push(u):a.audioVideoUnmute.push(u):(u.isLocal=!0,this.selfRoster.participantId=u.participantId,a.selfRoster.push(u)))))}for(var d in this.localContent&&a.content&&(a.content=[]),a)s=s.concat(a[d]);return s}},{key:"switchLayout",value:function(e){this.forceFullScreenId&&this.setForceFullScreenId("");var t=this.confInfo.contentUri,n=t?af:of,r=e;if(r)n.findIndex((function(e){return e===r}))<0&&"GALLERY"!==r&&(r=t?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER");else if("GALLERY"===this.templateMode)r=this.templateModeTemp;else{r=this.templateMode;var i=n.findIndex((function(e){return e===r})),o=i+1>=n.length?0:i+1;r=n[o]}if(this.templateMode=r,"GALLERY"===this.templateMode){var a=this.confInfo.chairManUrl,s=void 0===a?"":a;this.pageInfo.currentPage=s?0:1}else this.pageInfo.currentPage=0;return this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo),this.logger.log("switch layout Mode: ",r),r}},{key:"clearVideoManagersUseMonitorList",value:function(e){var t=this;e.forEach((function(e){t.videoManagers[e]&&(t.videoManagers[e].destroy(),delete t.videoManagers[e])}))}},{key:"setLocalStatus",value:function(e){if(this.logger.log("set local status: ",e),this.selfRoster=Object.assign(Object.assign({},this.selfRoster),e),!this.forceFullScreenId||this.forceFullScreenId===this.selfRoster.id){var t=this.selfRoster,n=t.endpointId,r=t.mediagroupid,i=n+r,o="AUTO"===this.client.config.layout?this.layoutList:this.customLayoutList,a=o.get(i),s=this.orderRosterList.findIndex((function(e){return e.endpointId===n&&e.mediagroupid===r}));s>-1&&(this.orderRosterList[s]=this.selfRoster),a&&o.set(i,Object.assign(Object.assign({},a),{roster:this.selfRoster})),this.updateStreams()}}},{key:"clearInvalidLayout",value:function(){var e="AUTO"===this.client.config.layout?this.layoutList:this.customLayoutList;e.forEach((function(t,n){t.deal?e.set(n,Object.assign(Object.assign({},t),{deal:!1})):e.delete(n)}))}},{key:"createBaseLayout",value:function(){var e=this;this.newLayoutList.forEach((function(t){var n=t.roster,r=t.position,i=t.zIndex,o=t.resolution,a=n.endpointId+n.mediagroupid;if(e.layoutList.has(a)){var s=e.layoutList.get(a);e.layoutList.set(a,Object.assign(Object.assign({},s),{roster:n,position:r,zIndex:i,resolution:o,deal:!0}))}else e.layoutList.set(a,{roster:n,position:r,zIndex:i,resolution:o,state:"NORMAL",rotate:{},positionStyle:{left:"",top:"",width:"",height:""},positionInfo:{width:0,height:0},deal:!0,quality:100})})),this.clearInvalidLayout()}},{key:"customLayoutCalculator",value:function(){var e=[],t={};return this.customLayoutList.forEach((function(n){var r=n.roster||{},i=r.isContent,o=r.id,a=r.isLocal,s=r.participantId,c=n.resolution,u=void 0===c?1:c,l=n.quality,h=void 0===l?100:l,d=h>0?100*h:100;a||(e.push({pid:s,resolution:u,quality:d,mediagroupid:Number(i)}),t[o]={resolution:rf.RESOLUTION_MAP[u],quality:d})})),this.internelsLayout=t,e}},{key:"getLayoutKeyByRotateInfo",value:function(e,t){var n="";return this.layoutList.forEach((function(r){var i=r.roster,o=i.isContent,a=i.endpointId,s=i.mediagroupid;i.participantId===e&&1===t===o&&(n=a+s)})),n}},{key:"localMirrorRotate",value:function(){var e=this.client.invite.callerUri+"0";if(this.layoutList.has(e)){var t=this.layoutList.get(e);this.layoutList.set(e,Object.assign(Object.assign({},t),{rotate:{transform:"rotateY(180deg)"}}))}}}],[{key:"getCustomLayoutItem",value:function(e,t,n){var r=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:n,mediagroupid:r?1:0}}}]),t}(),Yv=function(e){if("[object Array]"!==Object.prototype.toString.call(e))return!1;var t=!0;return e.some((function(e){var n=e||{},r=n.calluri;n.mediagroupid;var i=n.quality,o=n.resolution;("string"!=typeof r||Jd.indexOf(i)<0||$d.indexOf(o)<0)&&(t=!1)})),t};qt({target:"Math",stat:!0},{trunc:wt});var Vv=Math.log,Xv=Math.LOG10E,Wv=Math.log10||function(e){return Vv(e)*Xv};qt({target:"Math",stat:!0},{log10:Wv});var qv=M(R.f),Zv=M([].push),Jv=function(e){return function(t){for(var n,r=Y(t),i=Zt(r),o=i.length,a=0,s=[];o>a;)n=i[a++],E&&!qv(r,n)||Zv(s,e?[n,r[n]]:r[n]);return s}},$v={entries:Jv(!0),values:Jv(!1)}.values;qt({target:"Object",stat:!0},{values:function(e){return $v(e)}});var Qv=function(){function e(t,r){n(this,e),this.client=t,this.layoutManager=r,this.reportDataTimer=0,this.previousInternals=null,this.internals=null,this.meetingQualityData={callNumber:"",deviceId:"",meetingId:"",osVersion:navigator.userAgent,sockProto:"udpProto",swVersion:wf,cdrVersion:10,deviceType:17}}return i(e,[{key:"reportQualityData",value:function(e){var t;if(!this.meetingQualityData.callNumber){var n=(this.client.getConferenceInfo()||{callUrl:""}).callUrl,r=void 0===n?"":n,i=this.client.invite,o=i.meetingId,a=i.callerUri;this.meetingQualityData.callNumber=r,this.meetingQualityData.deviceId=a.split("@")[0],this.meetingQualityData.meetingId=o}if(this.reportDataTimer=this.reportDataTimer+1,this.reportDataTimer%2==0){this.internals=e,this.calcQualityData(0);var s=this.client.getLocalShareContent(),c=((null===(t=this.layoutManager)||void 0===t?void 0:t.getConfInfo())||{}).contentUri;((void 0===c?"":c)||s)&&this.calcQualityData(1),this.reportDataTimer=0}this.previousInternals=e}},{key:"calcAudioLevel",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;return(e/=100)<316e-7?-90:Math.trunc(20*Math.log10(e))}},{key:"calcQualityData",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.internals){var o=this.internals,a=o.receiver,s=o.sender,c=o.audioReceiver,u=o.audioSender,l=o.jitterReceived,h=o.jitterSent,d=o.fractionLostSent,f=o.fractionLostReceived,p=o.roundTripTime,v=o.audioSendJitter,g=o.audioSendLost,m=void 0===g?0:g,y=o.audioRecvLost,b=void 0===y?0:y,S=this.previousInternals||{audioReceiver:{}},w=S.audioReceiver,k=[],C=0,E=0,x=0,I=0,_=-90,A=-90,T=0,R=(null===(e=this.layoutManager)||void 0===e?void 0:e.getSelfRoster())||{participantId:0,endpointId:""},O=[{callUri:R.endpointId,participantId:R.participantId,sessionId:0,audioStream:[],videoStream:[]}],D=[],N=new Map,L=[],P=0,M=0,B=0,G=0,j=0;Object.values(s).map((function(e){var t=e.bytesSentSecond,n=e.frameWidth,i=e.frameHeight,o=e.framesEncodedSecond,a=e.resolution,s=e.isContent,c=e.expBandwidth;!!r===s&&(I+=t,T+=c,O[0].videoStream.push({fr:o,height:i,width:n}),L.push({Height:i,Width:n,framerate:o,resNum:1,resolution:a&&Xd[a.toUpperCase()]||1}))})),Object.values(a).map((function(e){var t=e.frameWidth,n=e.frameHeight,i=e.framesDecodedSecond,o=e.participantId,a=e.bytesReceivedSecond;e.jitter;var s=e.isContent,c=e.framesReceivedSecond,u=e.ExpectWidth,l=void 0===u?0:u,h=e.ExpectHeight;if(!!r===s){x+=a,P+=t*n*c,M+=l*(void 0===h?0:h)*c;var d=t+"*"+n,f=N.get(d);f?(f.resNum+=1,f.framerate+=c,N.set(d,f)):N.set(d,{Width:t,Height:n,framerate:c,resNum:1,resolution:Xd["".concat(n,"P")]||1}),k.push({participantId:o||0,videoStream:[{fr:i,height:t,width:n}]})}})),Object.values(u).map((function(e){var t=e.bytesSentSecond,i=e.audioLevel,o=void 0===i?0:i,a=e.expBandwidth,s=e.isContent;!!r===s&&(T+=a,_=n.calcAudioLevel(o),E+=t)})),Object.values(w).map((function(e){var t=e.insertedSamplesForDecelerationSecond,n=void 0===t?0:t,i=e.removedSamplesForAccelerationSecond,o=void 0===i?0:i,a=e.totalSamplesReceivedSecond,s=void 0===a?0:a,c=e.isContent;!!r===c&&(G+=n,G+=o,j+=s)})),Object.values(c).map((function(e){var t=e.bytesReceivedSecond,n=e.audioLevel,i=void 0===n?0:n,o=e.insertedSamplesForDecelerationSecond,a=void 0===o?0:o,s=e.removedSamplesForAccelerationSecond,c=void 0===s?0:s,u=e.totalSamplesReceivedSecond,l=void 0===u?0:u,h=e.isContent;!!r===h&&(G+=a,G+=c,j+=l,B=Math.max(B,i),E+=t)})),N.forEach((function(e,t){var n=e.framerate,r=e.resNum;e.framerate=n/r,D.push(e)}));var H=(null===(t=navigator.connection)||void 0===t?void 0:t.type)||"none",U=M?Math.floor(P/M*100):-1,K=j?Math.floor(G/j*100):0;A=this.calcAudioLevel(B);var F={sessionName:r,networkType:Qd[H]||0,timestampSec:1e3*parseInt((new Date).getTime()/1e3+""),audioCaptureEnergy:_,audioRenderEnergy:A,audioDownLinkBw:C,audioUpLinkBw:E,avrMissLipsync:0,videoUplinkBw:I,videoDownLinkBw:x,videoPxRatio:U,videoRecvDelay:0,videoSendDelay:0,videoRecvJitter:l,videoSendJitter:h,isLast:i,recvStreams:k,sendStreams:O,videoQuality:D,videoSendQuality:L,dbaDownLinkBw:x,dbaUplinkBw:I,videoSendRtt:p,audioSendRtt:p,audioSendJitter:v,videoRecvLost:f,videoSendLost:d,audioSendLost:m,audioRecvLost:b,upExpectedBw:T,downMaxExpectedBw:3e3,downMinExpectedBw:3e3,audioPlcPct:K},z={content:Object.assign({},this.meetingQualityData,F)};this.client.sendSocketMessage({type:"PASS_THROUGH",body:{type:"dataReport",data:z}},!1,!1)}}},{key:"stopReportData",value:function(){this.client.off("meeting-stats"),this.calcQualityData(0,!0)}}]),e}(),eg=function(r){o(s,Kf);var a=l(s);function s(e,t,r){var i,o;n(this,s),(i=a.call(this)).onSetAudioStream=function(e){if(e&&i.stream){var t=i.stream.getMediaStreams().previewStreams;"mute"===e&&t.length&&i.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===e&&t.length&&i.stream.setAudioOrVideoStatus("unmuteAudio")}},i.logger=r,i.clientErrorState="NONE",i.callInfo={token:"",confNumber:""},i.onhold=!1;try{i.logger.initDB(),xf.setLogger(i.logger)}catch(e){i.logger.error("init db error: ",e)}i.logger.log("user system info: ",navigator.userAgent),i.logger.log("Version: ",wf),i.logger.log("init config: ",e),i.config=e,e.layout&&(i.config.layout=e.layout.toUpperCase()),i.iauth=new Ep(r),i.autoMode="AUTO"===(null===(o=e.layout)||void 0===o?void 0:o.toUpperCase()),i.debug=!!e.debug,i.localHide=!!e.localHide;var u,l,h,d,f,p="HIDE"===e.__hideId?"HIDE":pf[e.__hideId||0]||"";return i.hideId=p,i.config.__hideId=p,i.featureConfig=yf,i.servers=t,i.disconnected=!1,i.clientStatus=!0,i.peerConnectionStatus=!1,i.isAutoBandwidth=!0,i.seq=0,i.token="",i.speakerInfo={endpointId:"",pid:0},i.stream=null,i.rosters=[],i.videoTrackList=[],i.audioTrackList=[],i.layoutManager=new zv(c(i)),i.layoutRosters={content:[],people:[],total:[]},i.pushType="ALL",i.cacheMeetingControlMessage=null,i.rotationInfo={people:[],content:[],total:[]},i.customLayoutSeq=0,i.contentSenderPid=0,i.invite={callerUri:"",callIndex:0,automute:"",meetingId:""},i.shareContentTimmer=null,i.shareContentStatus="ENDED",i.streamChangeList={content:[],people:[]},i.autoSwitchDevice=!0,i.audioManagers={},i.limitResolution=[],i.conferenceInfo=null,i.customLayoutCacheList=null,i.contentOnholdInfo={is:!1,audioTrackId:"",contentUrl:""},i.deviceManager=null,i.isPermissionDenied={camera:!1,microphone:!1},i.contentMode="VIDEO",i.isSubscribeBulkRoster=!1,i.isSubscribeTranslation=!1,i.recordPermission={authorize:!1,recordingUrl:""},i.recordState="",i.errorcode=sl.get("xy-error-code")||Hl,i.i18nCode=sl.get("xy-i18n-code"),i.onScreenChangeEvent=i.onScreenChangeEvent.bind(c(i)),i.onDocumentChange=(u=i.onScreenChangeEvent,l=100,h=50,f=null,function(){var e=+new Date,t=this,n=arguments;f&&clearTimeout(f),d||(d=e),e-d>=h?(u.apply(t,n),d=e):f=setTimeout((function(){u.apply(t,n)}),l)}),i.autoMode&&i.initEvent(),i.deviceManager=new ov(i.logger),i.initDeviceManagerEvent(),i.qualityManager=new Qv(c(i),i.layoutManager),i.isShareContent=!1,i}return i(s,[{key:"getFeatureConfig",value:function(){return this.featureConfig}},{key:"getClientConfig",value:function(){return this.config}},{key:"getVideoManagers",value:function(){var e;return null===(e=this.layoutManager)||void 0===e?void 0:e.getVideoManagers()}},{key:"getPreviewStreams",value:function(){var e;return(null===(e=this.stream)||void 0===e?void 0:e.getMediaStreams())||{previewStreams:[]}}},{key:"getVideoTrackList",value:function(){return this.videoTrackList}},{key:"getLayoutRosters",value:function(){return this.layoutRosters}},{key:"getOriginRosters",value:function(){return this.rosters}},{key:"getConferenceInfo",value:function(){return this.conferenceInfo}},{key:"getInviteInfo",value:function(){return this.invite}},{key:"getContentSenderPid",value:function(){return this.contentSenderPid}},{key:"getSpeakerInfo",value:function(){return this.speakerInfo}},{key:"getLocalHide",value:function(){return this.localHide}},{key:"getRotationInfo",value:function(){return this.rotationInfo.total}},{key:"getPeerConnectionStatus",value:function(){return this.peerConnectionStatus}},{key:"getOnHold",value:function(){return this.onhold}},{key:"getAudioTrackList",value:function(){return this.audioTrackList||[]}},{key:"getLayoutList",value:function(){var e,t,n=this.config.layout;return"AUTO"===n?null===(e=this.layoutManager)||void 0===e?void 0:e.getLayoutList():"CUSTOM"===n?null===(t=this.layoutManager)||void 0===t?void 0:t.getCustomLayoutList():void 0}},{key:"getSelfRoster",value:function(){var e;return null===(e=this.layoutManager)||void 0===e?void 0:e.getSelfRoster()}},{key:"getLocalShareContent",value:function(){return this.isShareContent}},{key:"loginXYlinkAccount",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] login xylink account:",{userName:t,password:n}),e.next=3,this.iauth.login({userName:t,password:n});case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),r,this)})))}},{key:"loginExternalAccount",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] login external account:",t),e.next=3,this.iauth.loginExternalAccount(t);case 3:return e.abrupt("return",e.sent);case 4:case"end":return e.stop()}}),n,this)})))}},{key:"resetInitParameter",value:function(){this.debug=!!this.config.debug,this.localHide=!!this.config.localHide,this.hideId=this.config.__hideId,this.isPermissionDenied={camera:!1,microphone:!1},this.isSubscribeBulkRoster=!1,this.isSubscribeTranslation=!1}},{key:"setContentMode",value:function(e){this.contentMode=e}},{key:"setFeatureConfig",value:function(e){if(this.logger.log("[client]set feature config: ",e),!Zl(e))return this.logger.warn("[client]rejected because params error"),Xl("XYSDK:950101");this.featureConfig=Object.assign({},yf,e),this.logger.log("merged feat config: ",this.featureConfig)}},{key:"toggleLocal",value:function(){var e=this;return this.logger.log("[client] toggleLocal:",this.autoMode),new Promise((function(t,n){var r;e.autoMode?(e.localHide=!e.localHide,null===(r=e.layoutManager)||void 0===r||r.calcRequestNewLayout(),e.sendsOriginOrderRosterMessage(),t({status:e.localHide})):(e.localHide=!e.localHide,t({status:e.localHide}))}))}},{key:"toggleHideId",value:function(){var e=this;return this.logger.log("[client] toggleHideId:",this.hideId),new Promise((function(t,n){e.hideId=e.hideId?"":e.config.__hideId,e.sendSocketMessage({type:"UPDATE_HIDEID",hideId:e.hideId}),t(!!e.hideId)}))}},{key:"setVideoRenderer",value:function(e,t){var n;this.logger.log("[client] setVideoRenderer:",{key:e,wrapEleId:t}),null===(n=this.layoutManager)||void 0===n||n.setVideoRenderer(e,t)}},{key:"removeVideoRender",value:function(e,t){var n;this.logger.log("[client] removeVideoRender:",{key:e,wrapEleId:t}),null===(n=this.layoutManager)||void 0===n||n.removeVideoRenderer(e,t)}},{key:"playVideo",value:function(e){var t=this;return this.logger.log("[client] playVideo:",e),new Promise((function(n,r){var i;try{null===(i=t.layoutManager)||void 0===i||i.playVideo(e),n(!0)}catch(e){t.logger.log("video replay failed:",e),r(!1)}}))}},{key:"playAudio",value:function(){var t=this;return this.logger.log("[client] playAudio:"),new Promise((function(n,r){return Rn(t,void 0,void 0,e().mark((function t(){var i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,i=0,o=Object.keys(this.audioManagers);case 2:if(!(i<o.length)){e.next=19;break}if(!(a=o[i])){e.next=16;break}if(!(null==(s=this.audioManagers[a].ele)?void 0:s.srcObject)){e.next=16;break}return e.prev=7,e.next=10,s.play();case 10:this.logger.log("audio replay success..."),e.next=16;break;case 13:e.prev=13,e.t0=e.catch(7),this.logger.log("audio replay failed:",e.t0);case 16:i++,e.next=2;break;case 19:n(!0),e.next=26;break;case 22:e.prev=22,e.t1=e.catch(0),this.logger.log("audio replay failed:",e.t1),r(!1);case 26:case"end":return e.stop()}}),t,this,[[0,22],[7,13]])})))}))}},{key:"setAudioRenderer",value:function(t,n){var r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setAudioRenderer:",t),this.audioManagers[t]||(this.audioManagers[t]={ele:n}),s=this.audioManagers[t],this.logger.log("setAudioRenderer render ele srcObject:",null===(r=null==s?void 0:s.ele)||void 0===r?void 0:r.srcObject),!s||!s.ele||s.ele.srcObject){e.next=23;break}if(!((c=this.audioTrackList.findIndex((function(e){return e.rest.streamId===t})))>=0)){e.next=23;break}return u=this.audioTrackList[c].data.streams[0],s.ele.srcObject=u,this.logger.log("setAudioRenderer audioTrack:",u.id),e.prev=10,e.next=13,s.ele.play();case 13:this.logger.log("setAudioRenderer play:",u.id),l=null===(i=this.stream)||void 0===i?void 0:i.config.devices,this.stream&&l&&l.audioOutputValue&&"default"!==l.audioOutputValue&&(null===(o=this.deviceManager)||void 0===o||o.setAudioOutputDevice(s.ele,l.audioOutputValue)),this.logger.log("audio play success: ",u.id,u.active,s.ele.paused),e.next=23;break;case 19:e.prev=19,e.t0=e.catch(10),this.emmit("play-failed",{type:"audio",key:t,error:e.t0}),this.logger.warn("audio play error: ",e.t0);case 23:case"end":return e.stop()}}),a,this,[[10,19]])})))}},{key:"switchAutoDevice",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return this.logger.log("[client] switchAutoDevice",t),new Promise((function(n,r){e.autoSwitchDevice=!!t,n(e.autoSwitchDevice)}))}},{key:"switchLayout",value:function(e){var t=this;return this.logger.log("[client] switchLayout: ",e),new Promise((function(n,r){var i;t.autoMode?(e=(null===(i=t.layoutManager)||void 0===i?void 0:i.switchLayout(e))||"SPEAKER",xf.setStates("oper-confOperation","layout"),n(e)):r(Xl("XYSDK:950601"))}))}},{key:"setPageInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if(this.logger.log("[client] setPageInfo: ",t),"AUTO"!==this.config.layout)return Promise.reject(Xl("XYSDK:950603"));null===(e=this.layoutManager)||void 0===e||e.setPageInfo(t)}},{key:"handleConferenceInfo",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(n=this.invite,r=n.commonJson,i=void 0===r?"":r,o=n.vcNumber,a=void 0===o?"":o,s=i&&JSON.parse(i)||{},c=(null==s?void 0:s.confAuxProperties)&&JSON.parse(s.confAuxProperties)||{},u=this.callInfo,l=u.meeting,h=u.confNumber,d=Object.assign(Object.assign({},l),{callNumber:a||h}),!a||h===a){e.next=20;break}return e.prev=6,e.next=9,xf.getCallUri({number:a,deviceType:17,country:"CN"});case 9:if(e.t0=e.sent,e.t0){e.next=12;break}e.t0={};case 12:f=e.t0,p=f.data,v=p.displayName,g=void 0===v?"":v,m=p.numberType,y=void 0===m?"":m,b=p.callUrl,S=void 0===b?"":b,w=p.avatar,k=void 0===w?"":w,C=p.deviceType,E=void 0===C?"":C,x=p.deviceId,I=void 0===x?"":x,d=Object.assign(Object.assign({},d),{displayName:g,numberType:y,callUrl:S,avatar:k,deviceType:E,deviceId:I}),e.next=20;break;case 18:e.prev=18,e.t1=e.catch(6);case 20:if("1"!==c.watermark){e.next=31;break}return e.prev=21,e.next=24,xf.getWatermarkContent(d.callNumber);case 24:_=e.sent,A=_.data||{watermarkContent:""},T=A.watermarkContent,R=void 0===T?"":T,d.confAuxProperties={watermarkContent:R},e.next=31;break;case 29:e.prev=29,e.t2=e.catch(21);case 31:this.conferenceInfo=d,this.logger.log("Get conference info:",this.conferenceInfo),this.emmit("conference-info",d);case 34:case"end":return e.stop()}}),t,this,[[6,18],[21,29]])})))}},{key:"checkPermissionWithMeetingNumber",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=this.invite,r=n.meetingId,i=n.vcNumber,o=void 0===i?"":i,this.logger.log("[client] checkPermissionWithMeetingNumber",{meetingId:r,vcNumber:o}),e.prev=2,e.next=5,xf.checkPermissionWithMeetingNumber(o,r);case 5:if(e.t0=e.sent,e.t0){e.next=8;break}e.t0={};case 8:a=e.t0,s=a.status,c=a.data,200===s&&(u=c.authorize,l=c.recordingUrl,this.recordPermission={authorize:u,recordingUrl:l}),e.next=17;break;case 14:e.prev=14,e.t1=e.catch(2),this.logger.log("checkPermissionWithMeetingNumber err:",e.t1);case 17:return this.emmit("record-permission",this.recordPermission),e.abrupt("return",this.recordPermission);case 19:case"end":return e.stop()}}),t,this,[[2,14]])})))}},{key:"checkStorageSpaceWithRecordingUrl",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] checkStorageSpaceWithRecordingUrl:",t),e.prev=1,e.next=4,xf.checkStorageSpaceWithRecordingUrl(t);case 4:return r=e.sent,i=r.status,o=r.data,400===i&&(a=o.developerMessage,s=o.errorCode,c=o.userMessage,Object.assign(this.recordPermission,{developerMessage:a,errorCode:s,userMessage:c})),e.abrupt("return",r);case 10:e.prev=10,e.t0=e.catch(1),this.logger.log("checkStorageSpaceWithRecordingUrl err:",e.t0);case 13:return this.emmit("record-permission",this.recordPermission),e.abrupt("return",this.recordPermission);case 15:case"end":return e.stop()}}),n,this,[[1,10]])})))}},{key:"handleSocketMessage",value:function(e,t){var n,r,i,o,a,s,c,u,l,h=this;if(!this.disconnected)switch(e.type){case"CALL_INDEX":var d=e.callIndex,f=e.callerUri,p=void 0===f?"":f;if(this.invite=Object.assign(Object.assign({},this.invite),{callIndex:d,callerUri:p}),this.logger.log("Get callIndex message: ",this.invite),"AUTO"===this.config.layout){var v=null===(n=this.layoutManager)||void 0===n?void 0:n.getScreenInfo();v&&this.sendScreenInfoMessage(v)}break;case"CONNECTED":this.invite=Object.assign(Object.assign({},this.invite),e),this.logger.log("Get connected message: ",this.invite);var g=this.iauth.getLoginInfo().extUserId;null===(r=this.layoutManager)||void 0===r||r.setLocalStatus({endpointId:this.invite.callerUri,participantId:9999999999,id:this.invite.callerUri+0,audioTxMute:this.config.muteAudio,videoTxMute:this.config.muteVideo,extUserId:g}),this.sendAudioStatus(!!this.config.muteAudio),setTimeout((function(){t(h.clientStatus&&!h.disconnected),h.handleConferenceInfo(),h.checkPermissionWithMeetingNumber()}),100),xf.setMeetingInfo({meetingId:this.invite.meetingId,callUri:this.invite.callerUri}),xf.setStates("sta-confStatus","callIn",{callType:"initiativeJoin",appName:this.config.isThird?cf:sf,audioMute:this.config.muteAudio,videoMute:this.config.muteVideo});break;case"confMgmtReport":this.logger.log("Get meeting control confMgmtReport message: ",e),this.onMeetingControlMessage(e);break;case"SUB_TITLE":this.logger.log("Get meeting control SUB_TITLE message: ",e),this.onSubTitle(e);break;case"CANCEL_HANGUP":this.logger.log("Get CANCEL_HANGUP message: ",e),this.emmit("cancel-handup",!0);break;case"PASS_THROUGH":this.onPassThroughMessage(e);break;case"mediaNotifyInfo":break;case"MEDIA_CHANGED":this.logger.log("Get MEDIA_CHANGED message: ",e),this.peer&&this.stream&&(La?(this.peer.close(),this.peer=new Cp(this,this.stream),this.peer.setRestartIceConnection(!0),this.peer.publish(this.stream,"ALL"),this.isShareContent&&(null===(i=this.peer)||void 0===i||i.publish(this.stream,"CONTENT"))):this.peer&&this.peer.restartIceConnection()),"STARTING"===this.shareContentStatus&&this.sendContentCapabilityMessage(),this.sendConfParam(),this.isSubscribeBulkRoster&&this.subscribeBulkRoster(),this.config.bandwidthSetting&&this.setWebRxBandwidth(),this.isSubscribeTranslation&&this.startTranslation(),this.videoTrackList=[],this.audioTrackList=[];break;case"DIS_CONNECTED":this.logger.log("Get disconnected message: ",e);var m=e.detail,y=void 0===m?"default":m,b=e.code,S=void 0===b?"STATE:200":b,w=e.reason,k=void 0===w?"":w,C=Uf[Fl][y];"KickoutTipContent"!==y&&"The device locked"!==y&&"OK"!==y&&S&&this.errorcode&&(C=this.errorcode[Fl][e.code]),C=C||Uf[Fl].default,this.disconnected=!0;var E={message:C,code:S,detail:y,reason:k};this.logger.log("emmit disconnected msg:",E),this.emmit("disconnected",Xl("XYSDK:950230",E)),this.clientStatus=!1,this.stream&&this.stream.close(),this.close("SERVER_INNER_ERROR");break;case"CALL_EXCEPTION_REPORT":this.logger.log("Get exception message: ",e);var x=Uf[Fl][e.exception];e.code&&this.errorcode&&(x=this.errorcode[Fl][e.code]),x=x||Uf[Fl].default,this.disconnected=!0,this.emmit("disconnected",Xl("XYSDK:950230",{message:x})),this.close("SERVER_INNER_ERROR");break;case"DualStreamReport":this.logger.log("Get share stream message: ",e);var I=e.state,_=function(){h.shareContentTimmer&&clearTimeout(h.shareContentTimmer),h.shareContentTimmer=null};if("SENDING"===I)this.shareContentStatus="STARTING",null===(o=this.stream)||void 0===o||o.emmit("start-share-content",{}),null===(a=this.layoutManager)||void 0===a||a.setLocalShareContent(!0),xf.setStates("oper-confOperation","content",{contentType:"desk"}),_();else if("IDLE"===I){var A=Uf[Fl].SHARE_CONTENT_FAILED;"STATE:200"===e.code?null===(s=this.stream)||void 0===s||s.emmit("stop-share-content",{}):(e.code&&this.errorcode&&this.errorcode[Fl]&&(A=this.errorcode[Fl][e.code]),null===(c=this.stream)||void 0===c||c.emmit("stop-share-content",Xl("XYSDK:950512",{message:A}))),null===(u=this.layoutManager)||void 0===u||u.setLocalShareContent(!1),this.shareContentStatus="ENDED",_()}break;case"MONITOR_STATE_REPORT":this.logger.log("Get monitor state report: ",e),this.dealMonitorReportMessage(e);break;case"RecordingStateChanged":this.logger.log("RecordingStateChanged:",e);var T=e.reason,R=e.state;this.recordState=R;var O=this.errorcode[Fl][T];"CHARGE:641"===T&&(O=this.recordPermission.developerMessage+O),e.reasonText=O,this.emmit("recording-state-changed",e);break;case"RecordStatusNotification":this.logger.log("RecordStatusNotification:",e);var D=e.callUri;e.isLocal=D===(null===(l=this.getSelfRoster())||void 0===l?void 0:l.endpointId),this.emmit("record-status-notification",e);break;default:this.logger.log("接收到其他ws消息",e)}}},{key:"dealMonitorReportMessage",value:function(e){var t=e.code,n=e.monitorInfo,r=n.failUriList,i=this.errorcode[Fl],o=JSON.parse(JSON.stringify(r));if(o=o.map((function(e){var t="未知错误",n=e.status;return"SIG:412"===n||"SIG:4464"===n?t="终端暂不支持":i&&(t=i[n]),Object.assign(Object.assign({},e),{message:t})})),"STATE:200"===t)this.emmit("start-monitor-report",{monitorInfo:Object.assign(Object.assign({},n),{failUriList:o})});else{var a="";t&&i&&(a=i[t]),this.emmit("stop-monitor-report",Xl("XYSDK:950312",{message:a}))}}},{key:"makeCall",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,h,d=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] makeCall params: ",t),a=window.location,s=a.protocol,c=a.hostname,u=t.token,l=t.confNumber,"https:"===s||"localhost"===c){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950130")));case 5:if("[object Object]"===Object.prototype.toString.call(t)){e.next=7;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101",t)));case 7:if(u&&l){e.next=9;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101",t)));case 9:if(this.clientStatus){e.next=11;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950201")));case 11:return null===(n=this.layoutManager)||void 0===n||n.setLocalStatus({displayName:t.displayName||""}),e.next=14,null===(r=this.deviceManager)||void 0===r?void 0:r.emmitDevices();case 14:return e.prev=14,e.next=17,this.getBasicInfo(t);case 17:if(!this.config.isVerifyMeetingId){e.next=23;break}return e.next=20,this.verifyMeeting(t);case 20:if(!(h=e.sent)||h.success){e.next=23;break}return e.abrupt("return",Promise.reject(h.data));case 23:e.next=29;break;case 25:return e.prev=25,e.t0=e.catch(14),this.logger.log("make call error:",e.t0),e.abrupt("return",Promise.reject(Xl(Gl[null===(i=null===e.t0||void 0===e.t0?void 0:e.t0.data)||void 0===i?void 0:i.errorCode]||"XYSDK:950106",e.t0)));case 29:return e.abrupt("return",new Promise((function(e,t){d.initWss(e,t)})));case 30:case"end":return e.stop()}}),o,this,[[14,25]])})))}},{key:"startCall",value:function(){var e=this.callInfo,t=e.confNumber,n=e.displayName,r=void 0===n?"":n,i=e.password,o=void 0===i?"":i,a=e.meeting,s=this.config,c=s.__hideId,u=void 0===c?"":c,l=s.__monitorMode,h=void 0===l?"":l,d=s.muteAudio,f=s.muteVideo,p=(a||{callUrl:t+"@CONFNO"}).callUrl,v=void 0===p?"":p,g=this.iauth.getLoginInfo().cellPhone;this.invite.callIndex||this.sendSocketMessage({type:"START_CALL",calleeNumber:v,displayName:r,pwd:o,callMode:"AUDIO_VIDEO",mediaAppend:{audioEncCapList:[99],videoEncCapList:[106]},hideId:u,monitorMode:h,callerNumber:g,muteAudio:d,muteVideo:f},!1)}},{key:"stopCall",value:function(e){if(this.invite.callIndex){var t=this.invite.callIndex;this.disconnected?e="SERVER_INNER_ERROR":"PUBLISH_ERROR"===this.clientErrorState?e="PEER_NET_DISCONNECT":"WS_CLOSE"!==this.clientErrorState&&"WS_ERROR"!==this.clientErrorState||(e="LOCAL_NET_DISCONNECT"),this.sendSocketMessage({type:"STOP_CALL",reason:e,code:nf[e],callIndex:t},!1)}}},{key:"publish",value:function(e){var t,n,r=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isShareContent:!1,isShareFile:!1,isShareWhiteBoard:!1,isSharePeople:!1};if(this.logger.log("[client] publish:",r),this.logger.log("get network when publish:",Na.getNetWork()),this.clientStatus&&!this.disconnected){if(this.isShareContent=!!r.isShareContent,!r.isSharePeople)return r.isShareContent?(this.sendContentCapabilityMessage(e),void(null===(n=this.peer)||void 0===n||n.publish(e,"CONTENT"))):void 0;try{this.stream=e,this.peer=new Cp(this,e),e.setClientObj(this),this.peer.publish(e,"ALL"),"CUSTOM"===this.config.layout&&(null===(t=this.layoutManager)||void 0===t||t.initLayoutManager()),this.initTrackEvent()}catch(e){this.logger.error("publish error: ",e),this.clientErrorState="PUBLISH_ERROR",this.emmit("call-status",Xl("XYSDK:950517",e))}}}},{key:"sendContentCapabilityMessage",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.stream,t=this.invite,n=t.callerUri,r=void 0===n?"":n,i=t.meetingId,o=e.getMediaStreams(),a=o.contentStreams,s=a.filter((function(e){return"NORMAL"===e.status})).map((function(e){var t;return{streamId:(null===(t=e.stream)||void 0===t?void 0:t.id)||"",resolution:rf.MAP_RESOLUTION_INDEX[e.resolution]}}));s.length?(this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:r,type:"contentCapability",streams:s}}),this.logger.log("contentCapability:",s)):this.logger.log("contentCapability is null"),this.limitResolution=["720"],this.sendPeopleCapability()}},{key:"applyShareContent",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shareContentStatus="PENDING",this.sendSocketMessage({type:"START_CONTENT",mode:this.contentMode,enableAnnotation:!1}),this.shareContentTimmer=setTimeout((function(){var e;"PENDING"===n.shareContentStatus&&(n.shareContentStatus="ENDED",null===(e=n.stream)||void 0===e||e.emmit("stop-share-content",{}),n.shareContentTimmer&&(clearTimeout(n.shareContentTimmer),n.shareContentTimmer=null))}),1e4);case 3:case"end":return e.stop()}}),t,this)})))}},{key:"stopShareContent",value:function(){var e=this;return this.logger.log("[client] stopShareContent"),this.isShareContent=!1,this.limitResolution=[],this.stream&&this.sendPeopleCapability(),new Promise((function(t,n){try{"STARTING"!==e.shareContentStatus&&"PENDING"!==e.shareContentStatus||e.sendSocketMessage({type:"STOP_CONTENT",mode:e.contentMode}),e.peer&&e.peer.closeContentStream(),e.stream&&e.stream.closeContentStream(),e.shareContentStatus="ENDED",e.streamChangeList.content=[],t(!0)}catch(e){n(Xl("XYSDK:950513",e))}}))}},{key:"initTrackEvent",value:function(){var e=this;this.on("track",(function(t){var n=t.track,r=n.id,i=n.kind,o=t.streams[0]||{};e.logger.log("client onTrack event: ",{track:{id:r,kind:i},stream:null==o?void 0:o.id}),t&&t.track.kind&&e.mergeTrackList(t),e.logger.log("video and audio track list: ",{video:e.videoTrackList,audio:e.audioTrackList})}))}},{key:"handleContentOnholdAudio",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:this.contentOnholdInfo,n=e.streamId,r=e.track,i=t.audioTrackId,o=t.contentUrl;n===i&&(r.enabled=!!o,this.logger.log("content audio track when content onhold,",n))}},{key:"mergeTrackList",value:function(e){var t,n=e.track,r=n.kind,i=n.id,o={streamId:e.streams[0].id,track:n,trackId:i},a={status:"remote",data:e,rest:o};"video"===r?(this.videoTrackList.push(a),null===(t=this.layoutManager)||void 0===t||t.updateStreams(),this.emmit("video-track",this.videoTrackList)):"audio"===r&&(this.handleContentOnholdAudio(o),this.audioTrackList.push(a),this.emmit("audio-track",this.audioTrackList))}},{key:"destroy",value:function(){var e=this;return this.logger.log("[client] destroy"),new Promise((function(t,n){try{e.stream&&e.stream.close(),e.close(),t(!0)}catch(e){n(Xl("XYSDK:950204",e))}}))}},{key:"close",value:function(){var e,t,n,r=this,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"OK";this.logger.log("[client] close:",i),this.logger.log("get network when close:",Na.getNetWork()),null===(e=this.qualityManager)||void 0===e||e.stopReportData(),this.resetInitParameter(),this.contentOnholdInfo={is:!1,audioTrackId:"",contentUrl:""},this.clientStatus&&(this.clientStatus=!1,this.stopShareContent(),this.stopCall(i),this.peer&&this.peer.close(),this.removeEvent(),this.removeAllListener(),null===(t=this.layoutManager)||void 0===t||t.clearInvalidVideoManagers(),null===(n=this.layoutManager)||void 0===n||n.setForceFullScreenId(),this.socketTask&&this.socketTask.close(),this.deviceManager&&this.deviceManager.destroy(),this.customLayoutSeq=0,this.audioManagers={},this.layoutManager=null,this.deviceManager=null,this.logger.log("client closed successfully"),setTimeout((function(){r.logger.stopDB()}),100))}},{key:"getConference",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:{autoMute:0};return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] getConference:",{id:t,sk:n,token:r,params:i}),a=this.iauth.getLoginInfo(),s=n||(null==a?void 0:a.securityKey),c=t||(null==a?void 0:a.id),e.prev=4,xf.setLoginInfo(r),e.next=8,xf.getConference(c,s,i);case 8:if(200!==(null==(u=e.sent)?void 0:u.status)){e.next=13;break}return e.abrupt("return",u.data);case 13:return e.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:{}}));case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(4),e.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:e.t0}));case 19:case"end":return e.stop()}}),o,this,[[4,16]])})))}},{key:"getServerConfig",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(e.prev=0,n=sl.get("xy-error-code"),r=sl.get("xy-i18n-code"),i=sl.get("xy-timestamp"),o=(new Date).valueOf(),t=Number(i),d=Number(o),f=void 0,f=d-t,a=Math.floor(f/864e5),!(n&&r&&a<1)){e.next=8;break}return e.abrupt("return");case 8:return e.next=10,xf.getDefaultServerConfig();case 10:if(!(s=e.sent)||200!==s.status||!s.data){e.next=17;break}return c=s.data,u=c.errorcode,l=c.i18n,h=void 0===l?"{}":l,e.next=15,this.getCodeByJson("errorcode",u,n);case 15:return e.next=17,this.getCodeByJson("i18n",h,r);case 17:e.next=22;break;case 19:e.prev=19,e.t0=e.catch(0),this.logger.log("getServerConfig error:",e.t0);case 22:case"end":return e.stop()}var t,d,f}),t,this,[[0,19]])})))}},{key:"getCodeByJson",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null==r?void 0:r.version,n="string"==typeof n?JSON.parse(n):n,s=(a=n).link,c=a.version,u=(new Date).valueOf(),c!==o){e.next=6;break}return e.abrupt("return");case 6:if(e.t0=s,!e.t0){e.next=11;break}return e.next=10,xf.getCodeByJson(s);case 10:e.t0=e.sent;case 11:l=e.t0,"errorcode"===t&&l?(this.errorcode=l,sl.set("xy-error-code",this.errorcode)):"i18n"===t&&(this.i18nCode=l,sl.set("xy-i18n-code",this.i18nCode)),sl.set("xy-timestamp",u);case 14:case"end":return e.stop()}}),i,this)})))}},{key:"videoAudioOperate",value:function(t){var n=this;return new Promise((function(r,i){return Rn(n,void 0,void 0,e().mark((function n(){var o,a,s,c,u,l,h,d,f,p=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.stream){e.next=36;break}if(s=ef[t].type,c=this.stream.getMediaStreams(),u=c.previewStreams,l=this.stream.current.type,this.logger.log("video or audio operate: ",t),h=this.isPermissionDenied.microphone||"FAILED"===this.stream.current.type,d=this.isPermissionDenied.camera||"FAILED"===this.stream.current.type,"unmuteAudio"!==t||!h){e.next=10;break}return this.logger.log("No permission to do audio operations"),e.abrupt("return",i(Xl("XYSDK:950224")));case 10:if("unmuteVideo"!==t||!d){e.next=13;break}return this.logger.log("No permission to do video operations"),e.abrupt("return",i(Xl("XYSDK:950225")));case 13:if(this.peer){e.next=16;break}return this.logger.log("Need to create a peer to do audio and video operations"),e.abrupt("return",i(Xl("XYSDK:950202")));case 16:if(u.length){e.next=19;break}return this.logger.log("Need to create a stream to do audio and video operations"),e.abrupt("return",i(Xl("XYSDK:950203")));case 19:return e.prev=19,f=ef[t].status,e.next=23,this.stream.setAudioOrVideoStatus(t);case 23:"muteAudio"===t||"unmuteAudio"===t?(null===(o=this.layoutManager)||void 0===o||o.setLocalStatus({audioTxMute:!f}),this.sendAudioStatus(!f)):"muteVideo"!==t&&"unmuteVideo"!==t||null===(a=this.layoutManager)||void 0===a||a.setLocalStatus({videoTxMute:!f}),l=this.stream.current.type,"unmuteVideo"!==t?this.sendOperationMessage(s):"NORMAL"!==l&&"VIDEO_ONLY"!==l||setTimeout((function(){p.sendOperationMessage(s),p.stream&&p.isAutoBandwidth&&p.streamChange&&p.stream.handleChangeStream(p.streamChange,p.peer,p.streamChange.mediagroupid||0)}),800),xf.setStates("oper-confOperation",uf[t]),r(t),e.next=34;break;case 30:e.prev=30,e.t0=e.catch(19),this.logger.log("video or audio operate error:",e.t0),i(Xl("XYSDK:950223",e.t0,"".concat(t," 操作失败")));case 34:e.next=37;break;case 36:i(Xl("XYSDK:950203"));case 37:case"end":return e.stop()}}),n,this,[[19,30]])})))}))}},{key:"muteAudio",value:function(){return this.logger.log("[client] muteAudio"),this.videoAudioOperate("muteAudio")}},{key:"muteVideo",value:function(){return this.logger.log("[client] muteVideo"),this.videoAudioOperate("muteVideo")}},{key:"unmuteAudio",value:function(){return this.logger.log("[client] unmuteAudio"),this.videoAudioOperate("unmuteAudio")}},{key:"unmuteVideo",value:function(){return this.logger.log("[client] unmuteVideo"),this.videoAudioOperate("unmuteVideo")}},{key:"setPollingAudioStatus",value:function(t,n){return Rn(this,void 0,void 0,e().mark((function r(){var i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setPollingAudioStatus: ",{type:t,callUriList:n}),i="string"==typeof n?[n]:Array.isArray(n)?n:[],n&&i.length){e.next=5;break}return this.logger.warn("callUriList should be string or string array."),e.abrupt("return");case 5:if(o=this.invite.meetingId,"mute"!==t&&"unmute"!==t){e.next=24;break}return e.prev=7,e.next=10,xf.updateWebViewProp(o,i.map((function(e){return{callUri:e,params:'{"audioEnable": '.concat("mute"===t?'"false"':'"true"',"}")}})));case 10:if(a=e.sent,s=h(a,2),c=s[0],u=s[1],c){e.next=18;break}return e.abrupt("return",u);case 18:return e.abrupt("return",Xl("XYSDK:950111",u));case 19:e.next=24;break;case 21:return e.prev=21,e.t0=e.catch(7),e.abrupt("return",Xl("XYSDK:950111",e.t0));case 24:case"end":return e.stop()}}),r,this,[[7,21]])})))}},{key:"onHandUp",value:function(){return this.logger.log("[client] onHandUp"),this.onHand("handup",!0)}},{key:"onHandDown",value:function(){return this.logger.log("[client] onHandDown"),this.onHand("handdown",!1)}},{key:"onMute",value:function(){return this.logger.log("[client] onMute"),this.onHand("mute",!1)}},{key:"onHand",value:function(t,n){var r=this,i=this.invite,o=i.callerUri,a=void 0===o?"":o,s=i.meetingId,c=this.callInfo.confNumber;return new Promise((function(i,o){return Rn(r,void 0,void 0,e().mark((function r(){var u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,xf.hand(t,s,a,c);case 3:200===(u=e.sent).status&&0===u.data.code?i(n):(l=(null==u?void 0:u.data)||{},h=l.errorCode,o(Xl(Gl[h]||"XYSDK:950111",u.data))),e.next=10;break;case 7:e.prev=7,e.t0=e.catch(0),o(Xl(Gl[null===e.t0||void 0===e.t0?void 0:e.t0.errorCode]||"XYSDK:950111",e.t0));case 10:case"end":return e.stop()}}),r,null,[[0,7]])})))}))}},{key:"sendConfParam",value:function(){var e=this.invite,t=e.meetingId,n=e.callerUri;this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"ConfParam",inoutReminder:"true"===this.invite.inoutReminder,meetingId:t,endpointId:n}})}},{key:"getSendSupportedCodec",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] getSendSupportedCodec"),e.prev=1,e.next=4,Pv();case 4:return n=e.sent,this.logger.log("get capabilities:",n),e.abrupt("return",n);case 9:return e.prev=9,e.t0=e.catch(1),this.logger.error("get capabilities error: ",e.t0),e.abrupt("return",Promise.reject(Xl("XYSDK:950515",e.t0)));case 13:case"end":return e.stop()}}),t,this,[[1,9]])})))}},{key:"setPeerConnectionStatus",value:function(e){var t,n,r;if(this.logger.log("setPeerConnectionStatus:",e),this.peerConnectionStatus=e,this.stream&&!this.stream.isSupportReauthorize&&(this.config.muteVideo&&this.muteVideo(),this.config.muteAudio&&this.muteAudio()),this.sendConfParam(),e){if(this.invite.automute){var i="";this.logger.log("setPeerConnectionStatus setAudioStream:",this.invite.automute),this.onSetAudioStream(this.invite.automute),"mute"===this.invite.automute||"forcemute"===this.invite.automute?i="muteAudio":"unmute"===this.invite.automute&&(i="unmuteAudio"),i&&(this.logger.log("setPeerConnectionStatus update audio status:",this.invite.automute),null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({audioTxMute:"muteAudio"===i}),this.sendAudioStatus(i))}this.cacheMeetingControlMessage&&this.cacheMeetingControlMessage.type&&this.onMeetingControlMessage(this.cacheMeetingControlMessage);var o=null===(n=this.layoutManager)||void 0===n?void 0:n.getContentRosterItem();o&&this.sendContentRosterMessage(o),null===(r=this.stream)||void 0===r||r.sendStreamStatus(),this.config.bandwidthSetting&&this.setWebRxBandwidth()}}},{key:"onMeetingControlMessage",value:function(e){var t,n,r,i,o=e.muteOperation,a=e.disableMute,s=e.chairmanUri,c=void 0===s?"":s,u=e.contentIsDisabled,l=void 0!==u&&u,h=e.commonJson,d=void 0===h?"":h,f=e.isMuteSpeaker,p=e.recordIsDisabled,v=e.groupInfoList,g="",m=!1;if(null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({isForceFullScreen:c===this.invite.callerUri}),this.peerConnectionStatus){if(a&&(m=!0),o&&this.stream&&this.deviceManager&&this.layoutManager)if("denied"!==this.deviceManager.getDevicePermission().microphone){var y=this.stream.getMediaStreams().previewStreams;g="mute"===o?"muteAudio":"unmuteAudio","mute"===o&&y.length&&(this.stream.setAudioOrVideoStatus("muteAudio"),m=!0),"unmute"===o&&y.length&&(this.stream.setAudioOrVideoStatus("unmuteAudio"),m=!1),this.layoutManager.setLocalStatus({audioTxMute:m}),this.sendAudioStatus(g),xf.setStates("sta-msgCallback",uf[g])}if(d){var b=JSON.parse(d),S=(b.rename&&JSON.parse(b.rename)||{tmpName:""}).tmpName;S&&(null===(n=this.layoutManager)||void 0===n||n.setLocalStatus({displayName:tv(S)}))}!c||c===(null===(r=this.cacheMeetingControlMessage)||void 0===r?void 0:r.chairmanUri)&&"on"!==f&&"off"!==f||null===(i=this.layoutManager)||void 0===i||i.setForceFullScreenId();var w={chairmanUri:c,disableMute:a,muteOperation:g,contentIsDisabled:l,isMuteSpeaker:f,recordIsDisabled:p,groupInfoList:v};this.logger.log("emmit meeting-control: ",w),this.emmit("meeting-control",w)}this.cacheMeetingControlMessage=e}},{key:"onSubTitle",value:function(e){var t=e.content,n=t&&JSON.parse(t);n.content=this.i18nCode[Fl][n.i18nKey||""]||n.content,this.emmit("sub-title",n),xf.setStates("sta-msgCallback","subtitle")}},{key:"sendCustomMessage",value:function(e){if(e&&e.data&&"string"!=typeof e.data)return this.logger.warn("send custom message params error: ",t(e.data)),Xl("XYSDK:950101",e);var n=e.data,r=ev(n),i=n.length;if(i>1373333)return this.logger.log("send custom message size limited: ",{oriLen:i,base64Len:r.length}),Xl("XYSDK:950010",e);var o=n.length<=13333,a=e.data.substring(13333,0),s=Object.assign(Object.assign({},e),{type:"userCustomizedBizMsg",data:r});return this.logger.log("send custom message",Object.assign(Object.assign({},e),{data:"".concat(a,"..."),oriLen:n.length,base64Len:r.length})),this.sendSocketMessage({type:"PASS_THROUGH",body:s},!0,o),Xl("XYSDK:950120")}},{key:"onPassThroughMessage",value:function(e){var t,n,r,i,o=this;switch(e.body.type){case"roster":this.logger.log("roster message: ",e);var a=e.body,s=a.contentSenderPid,c=void 0===s?0:s,u=a.rosterInfo;if(0===u.length)return;this.contentSenderPid=c,this.rosters=u,this.sendsOriginOrderRosterMessage();break;case"participantsNum":this.logger.log("participant message: ",e);break;case"speakersInfo":this.logger.log("speaker info message: ",e);var l=e.body.speaker;this.speakerInfo=l,this.autoMode&&(null===(t=this.layoutManager)||void 0===t||t.createLayout(),this.sendOriginOrderedRosterMessage()),this.emmit("speaker-info",{speakerInfo:l});break;case"layoutResult":var h=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=h:1===e.body.mediagroupid&&(this.layoutRosters.content=h),this.layoutRosters.total=[].concat(d(this.layoutRosters.people),d(this.layoutRosters.content)),this.logger.log("layout result message: ",this.layoutRosters.total),this.customLayoutSeq===e.body.rSeq&&(null===(n=this.layoutManager)||void 0===n||n.updateStreams());break;case"streamChange":this.logger.log("stream change message: ",e),this.streamChange=e.body;var f=e.body,p=f.mediagroupid,v=f.streamChangeInfo;this.streamChangeList[0===p?"people":"content"]=v,this.logger.log("stream change list: ",kp(this.streamChangeList)),this.stream&&this.isAutoBandwidth&&this.stream.handleChangeStream(this.streamChange,this.peer,e.body.mediagroupid||0);break;case"rotationChange":this.logger.log("layout rotation message: ",e),this.updateRotationInfo(e),this.logger.log("rotation info: ",this.rotationInfo),this.autoMode&&(null===(r=this.layoutManager)||void 0===r||r.calculateRotate(),this.sendLayoutMessage()),this.emmit("rotation-change",this.rotationInfo.total);break;case"candidate":this.logger.log("receive candidate:",e),this.peer.handleCandidate(e.body);break;case"answer":this.logger.log("receive answer:",e),this.peer.handleAnswer(e.body);break;case"mediaOnhold":this.logger.log("media onhold message: ",e);var g=e.body.onhold;this.onhold=Boolean(g),this.emmit("onhold",this.onhold);break;case"confChangeInfo":this.logger.log("[receive]conf change info message: ",e);var m=e.body,y=m.chairManUrl,b=void 0===y?"":y,S=m.contentUri,w=void 0===S?"":S,k=m.actSpkUri,C=void 0===k?"":k,E=m.totalEpCount,x=void 0===E?0:E,I=m.displayableEpCount,_=void 0===I?0:I,A=m.mediaGroupInfo,T=void 0===A?[]:A,R=_,O=this.contentOnholdInfo.is&&!this.contentOnholdInfo.contentUrl;this.autoMode&&(R=this.hideId?_+1:_);var D={participantCount:R,totalEpCount:x,chairManUrl:b,contentUri:O?"":w,actSpkUri:C,mediaGroupInfo:T},N=null===(i=this.layoutManager)||void 0===i?void 0:i.getConfInfo();(null==N?void 0:N.totalEpCount)!==x&&this.emmit("participants-count",{participantsNum:x}),this.layoutManager&&(this.layoutManager.setConfInfo(D),this.autoMode?(this.layoutManager.calcPageInfo(),this.layoutManager.calcRequestNewLayout()):1!==x||w||this.layoutManager.createCustomLayout([])),this.logger.log("emmit conf change info message: ",D),this.emmit("conf-change-info",D);break;case"layoutResultEx":this.logger.log("[receive][v2]layout result message: ",e),this.layoutRosters.total=e.body.layout||[],this.logger.log("[v2]layout result: ",this.layoutRosters.total),this.layoutManager&&("AUTO"===this.config.layout?this.layoutManager.createAutoLayout(this.layoutRosters.total):(this.layoutManager.createCustomLayout(this.layoutRosters.total),this.layoutManager.updateStreams()));break;case"inoutnotify":this.logger.log("[receive]inoutnotify message: ",e);var L=e.body.info||[],P=[];L.map((function(e){if(e.e!==o.invite.callerUri){var t=e.a,n=t.split(":");n.length>1&&(t=n[1]),P.push({displayName:e.c,action:e.t,userId:t})}})),this.emmit("in-out-reminder",P);break;case"bulkRoster":this.logger.log("bulk roster message: ",e);var M=e.body,B=M.bulkRosterType,G=void 0===B?0:B,j=M.addRosterInfo,H=void 0===j?[]:j,U=M.changeRosterInfo,K=void 0===U?[]:U,F=M.deleteRosterInfo,z=void 0===F?[]:F;this.emmit("bulkRoster",{bulkRosterType:G,addRosterInfo:H,changeRosterInfo:K,deleteRosterInfo:z});break;case"confproperties":if(0===e.mg&&(this.contentOnholdInfo.is=!0),1===e.mg){this.logger.log("conf properties message: ",e);var Y=e.body.confpropertiesInfo;(void 0===Y?[]:Y).forEach((function(e){"contentOnhold"===e.type&&o.handleContentOnhold(e)}))}case"multiGroupInfo":this.logger.log("receive multi group info",e);var V=e.body.mediagrps,X=void 0===V?[]:V,W=e.endpointId;this.emmit("multi-group-info",{endpointId:W,mediagrps:X});break;case"translationContent":if(this.logger.log("receive translationContent:",e),!this.onhold){var q=e.body;this.logger.log("emmit translationContent:",e),this.emmit("translation-content",q)}break;case"userCustomizedBizMsg":var Z=e.body.data;Z.length>13333?this.logger.log("SDK get userCustomizedBizMsg max message: ",Object.assign({},e.body,{length:e.length,data:""})):this.logger.log("SDK get userCustomizedBizMsg message: ",e);var J=tv(Z),$=Object.assign(Object.assign({},e.body),{data:J});this.emmit("custom-message-recv",$);break;default:this.logger.log("get pass though default message: ",e)}}},{key:"handleContentOnhold",value:function(e){var t,n,r,i,o,a,s=this,c=e.audioTrackId,u=void 0===c?"":c,l=e.contentUrl,h=void 0===l?"":l,d=null===(t=this.layoutManager)||void 0===t?void 0:t.getConfInfo(),f=null===(n=this.layoutManager)||void 0===n?void 0:n.getSelfRoster(),p=null===(r=this.layoutManager)||void 0===r?void 0:r.getLocalShareState();if(this.contentOnholdInfo.is){(h===(null==f?void 0:f.endpointId)||p)&&(h="");var v={audioTrackId:u,contentUrl:h,is:!0};h&&h===this.contentOnholdInfo.contentUrl||!d||(d.contentUri=h,this.autoMode&&(null===(i=this.layoutManager)||void 0===i||i.calcPageInfo(d),null===(o=this.layoutManager)||void 0===o||o.calcRequestNewLayout()),this.audioTrackList.map((function(e){s.handleContentOnholdAudio(e.rest,v)})),null===(a=this.layoutManager)||void 0===a||a.setConfInfo(d),this.emmit("conf-change-info",d)),this.contentOnholdInfo=v}}},{key:"switchAutoBandwidth",value:function(){this.logger.log("[client] switchAutoBandwidth");var e=!this.isAutoBandwidth;return this.isAutoBandwidth=e,e}},{key:"disconnectInWssError",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{code:1e3};if(this.logger.log("disconnected wss error",e),!this.disconnected&&this.clientStatus){this.clientErrorState="XYSDK:950114"===e?"WS_CLOSE":"WS_ERROR";var n=4e3===(null==t?void 0:t.code)?"TOKEN_INVALID":"LOCAL_NET_DISCONNECT";this.emmit("disconnected",Xl(e,{message:Uf[Fl][n],key:n,detail:n},"[internel] disconnected meeting"))}}},{key:"switchDebug",value:function(e){var t=this;return this.logger.log("[client] switchDebug"),new Promise((function(n,r){"boolean"!=typeof e&&r(Xl("XYSDK:950101"));try{t.debug=e,t.peer&&t.peer.initSenderStatus(),n(t.debug)}catch(e){r(Xl("XYSDK:950210"))}}))}},{key:"requestLayout",value:function(e){var t=this;return new Promise((function(n,r){var i,o;t.logger.log("[client] requestLayout: ",e);var a=e.length>9?9:e.length;e.length=a,null===(i=t.layoutManager)||void 0===i||i.requestLayout(e),null===(o=t.layoutManager)||void 0===o||o.updateStreams(),n("successfully")}))}},{key:"requestNewLayout",value:function(e,t,n){var r=this,i=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[],o=arguments.length>4?arguments[4]:void 0;return new Promise((function(a,s){if(r.logger.log("new layout request list: ",{reqList:e,extReqList:i,maxViewCountPerPage:t,pageIndex:n}),!Yv(e))return s(Xl("XYSDK:950101",{reqList:e}));if(!Yv(i))return s(Xl("XYSDK:950101",{extReqList:i}));~~t>9&&(t=9),n=Math.max(0,n);var c=r.invite,u=c.callerUri,l=void 0===u?"":u,h=c.meetingId;r.sendSocketMessage({type:"PASS_THROUGH",body:Object.assign({type:"customLayoutEx",conferenceId:h,endpointId:l,layoutMode:0,pageIndex:n,maxViewCountPerPage:t,streams:e,extStreams:i},o)}),a(!0)}))}},{key:"requestAutoPollingLayout",value:function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:5,r=arguments.length>2?arguments[2]:void 0;return new Promise((function(i,o){t.autoMode&&o("Auto mode not support request layout");var a=t.invite,s=a.callerUri,c=a.meetingId;t.logger.log("send request auto pllling layout data: ",{command:e,interval:n,reqList:r}),t.sendSocketMessage({type:"PASS_THROUGH",body:{type:"customLayoutEx",conferenceId:c,endpointId:s,layoutMode:1,pageIndex:0,PollingCommand:e,pollingInterval:Number(n)||0,streams:r}}),i(!0)}))}},{key:"applyVideoOrAudio",value:function(e){var t,n,r,i,o=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stream){if(o){var a=null===(t=this.stream)||void 0===t?void 0:t.getMediaStreams(),s=a.streams;null===(n=this.peer)||void 0===n||n.setStream(s,e)}else null===(r=this.peer)||void 0===r||r.replacePeopleVideoTrack(this.stream,e);"video"===e&&this.layoutManager&&this.layoutManager.updateLocalTrack()}null===(i=this.stream)||void 0===i||i.updateDeviceByLocalStream()}},{key:"sendAudioStatus",value:function(e){"boolean"==typeof e&&(e=e?"muteAudio":"unmuteAudio"),this.logger.log("emmit audio-status: ",e),this.emmit("audio-status",{status:e})}},{key:"sendLayoutMessage",value:function(){var e,t=null===(e=this.layoutManager)||void 0===e?void 0:e.getLayoutList(),n=[];t&&t.forEach((function(e){n.push(e)})),this.emmit("layout",kp(n))}},{key:"sendOriginOrderedRosterMessage",value:function(){var e,t=null===(e=this.layoutManager)||void 0===e?void 0:e.getOriginOrderRosters();this.emmit("roster",{rosters:t})}},{key:"sendsOriginOrderRosterMessage",value:function(){var e,t,n=(null===(e=this.layoutManager)||void 0===e?void 0:e.calculateOrderRosterList())||[];null===(t=this.layoutManager)||void 0===t||t.setOriginOrderRosters(n),this.emmit("roster",{rosters:n})}},{key:"sendCustomLayoutMessage",value:function(){var e,t,n=null===(e=this.layoutManager)||void 0===e?void 0:e.getCustomLayoutList();if(0!==(null===(t=this.customLayoutCacheList)||void 0===t?void 0:t.length)||0!==(null==n?void 0:n.size)){var r=[];null==n||n.forEach((function(e){r.push(e)})),this.customLayoutCacheList=r,this.emmit("custom-layout",kp(r))}}},{key:"sendScreenInfoMessage",value:function(e){this.emmit("screen-info",kp(e))}},{key:"sendContentRosterMessage",value:function(e){var t;null===(t=this.layoutManager)||void 0===t||t.setContentRosterItem(e),this.emmit("content",{data:e})}},{key:"sendTemplateMode",value:function(e){this.emmit("template-mode",e)}},{key:"sendOperationMessage",value:function(e){this.sendSocketMessage({type:e})}},{key:"updateRotationInfo",value:function(e){var t=this,n=e.body.rosterInfo||[],r=0===e.body.mediagroupid?"people":"content";this.rotationInfo[r]=n,this.rotationInfo.total=[];var i=this.rotationInfo,o=i.people,a=i.content,s=function(e,n){e.forEach((function(e){t.rotationInfo.total.push(Object.assign(Object.assign({},e),{mediagroupid:n,id:e.participantId+""+n}))}))};s(o,0),s(a,1)}},{key:"sendCustomLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[],t=this.invite,n=t.callerUri,r=void 0===n?"":n,i=t.meetingId;this.customLayoutSeq=this.customLayoutSeq+1,this.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:i,endpointId:r,type:"customLayout",streams:e,rSeq:this.customLayoutSeq}})}},{key:"reportQualityData",value:function(e){e=this.getInternels(e),this.qualityManager.reportQualityData(e)}},{key:"getInternels",value:function(e){var t,n=(null===(t=this.layoutManager)||void 0===t?void 0:t.getInternelsLayout())||{pid:{resolution:0,quality:0}};Object.keys(e.receiver).forEach((function(t){var r=e.receiver[t],i=r.isContent,o=r.type+Number(i);n[o]&&(e.receiver[t].expResolution=n[o].resolution)}));for(var r=Object.keys(e.sender),i=r.length,o=0;o<i;o++){var a=e.sender[r[o]],s=this.streamChangeList.content.length,c=this.streamChangeList.people.length;if("remoteStream"===a.type&&(e.sender[r[o]].expBandwidth=Wd[a.resolution]),c)for(var u=0;u<c;u++){var l=this.streamChangeList.people[u];if(rf.RESOLUTION_MAP[l.resolution]===Number(a.resolution)&&"remoteStream"===a.type){e.sender[r[o]].expBandwidth=l.bandwidth;break}}if(s)for(var h=0;h<s;h++){var d=this.streamChangeList.content[h];if(rf.RESOLUTION_MAP[d.resolution]===Number(a.resolution)&&"contentStream"===a.type){e.sender[r[o]].expBandwidth=d.bandwidth;break}}}return e}},{key:"sendInternels",value:function(e){this.emmit("meeting-stats",this.getInternels(e))}},{key:"off",value:function(e){this.logger.log("[client] off:",e),this.removeListener(e)}},{key:"onScreenChangeEvent",value:function(){this.autoMode&&this.layoutManager&&(this.layoutManager.calculateScreenInfo(),this.layoutManager.calculatePosition(),this.layoutManager.calculateRotate(),this.sendLayoutMessage())}},{key:"initEvent",value:function(){window.addEventListener("resize",this.onDocumentChange)}},{key:"removeEvent",value:function(){window.removeEventListener("resize",this.onDocumentChange)}},{key:"sendPeopleCapability",value:function(){var e=this,t=this.invite,n=t.callIndex,r=t.callerUri,i=void 0===r?"":r,o=t.meetingId;if(this.stream){var a=this.stream.streams.filter((function(t){return"NORMAL"===t.status&&t.resolution!==e.limitResolution[0]})).map((function(e){var t;return{streamId:(null===(t=e.stream)||void 0===t?void 0:t.id)||"",resolution:rf.MAP_RESOLUTION_INDEX[e.resolution]}}));this.logger.log("stream resolution info: ",a),this.sendSocketMessage({type:"PASS_THROUGH",callIndex:n,body:{type:"peopleCapability",meetingId:o,endpointId:i,streams:a}})}}},{key:"forceFullScreen",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return this.logger.log("[client] force full screen:",t),new Promise((function(n,r){if(!e.autoMode)return r(Xl("XYSDK:950602"));if(t&&"string"!=typeof t)return r(Xl("XYSDK:950101"));if(e.layoutManager){var i=e.layoutManager.getLayoutList(),o=e.layoutManager.getForceFullScreenId();if(t){if(!(null==i?void 0:i.get(t)))return r(Xl("XYSDK:950101"));if(t===o)return n(t)}try{e.layoutManager.setForceFullScreenId(t),e.layoutManager.calcRequestNewLayout(),n(t)}catch(e){r(Xl("XYSDK:950530"))}}}))}},{key:"sendSocketMessage",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=!(arguments.length>2&&void 0!==arguments[2])||arguments[2],r=this.invite,i=r.callIndex,o=r.callerUri,a=void 0===o?"":o,s=r.meetingId,c={callIndex:i,meetingId:s,endpointId:a,callUri:a},u=Object.assign(Object.assign({},e),c);if(t){var l=this.seq+"";this.socketTask&&this.socketTask.send(Object.assign(Object.assign({},u),{seq:l}),!0,n),this.seq++}else this.socketTask&&this.socketTask.send(u,!0,n)}},{key:"getBasicInfo",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(r=t.token,this.callInfo=t,this.token=r,i=this.iauth.getLoginInfo(),e.prev=4,o=r||i.access_token,i.securityKey){e.next=12;break}return e.next=9,xf.getUserInfo(o);case 9:a=e.sent,c=(s=a||{}).securityKey,u=s.userProfile,this.iauth.setLoginInfo(Object.assign(Object.assign({},i),{id:(null==u?void 0:u.id)||i.id,securityKey:c}));case 12:return e.next=14,this.getServerConfig();case 14:e.next=19;break;case 16:return e.prev=16,e.t0=e.catch(4),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),n,this,[[4,16]])})))}},{key:"verifyMeeting",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R,O,D;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.token,i=t.confNumber,o=t.password,a=void 0===o?"":o,this.callInfo=t,this.token=r,s={success:!1,data:{}},e.prev=4,e.next=7,xf.getCallUri({number:i,deviceType:17,country:"CN"});case 7:if(c=e.sent,u=c.data,l=u.avatar,h=void 0===l?"":l,d=u.callNumber,f=void 0===d?"":d,p=u.callUrl,v=void 0===p?"":p,g=u.deviceId,m=void 0===g?"":g,y=u.deviceType,b=void 0===y?"":y,S=u.displayName,w=void 0===S?"":S,k=u.number,C=void 0===k?"":k,E=u.numberType,x=void 0===E?"":E,I=u.enablePwd,_=void 0!==I&&I,A={avatar:h,callNumber:f,callUrl:v,deviceId:m,deviceType:b,displayName:w,number:C||i,numberType:x},!(Zd.findIndex((function(e){return e===b}))>-1)){e.next=44;break}if(this.callInfo=Object.assign(this.callInfo,{meeting:A}),s=Wl(!0),!_||!vf.includes(this.hideId)){e.next=31;break}return s=Wl(!1,"XYSDK:950110"),e.prev=17,e.next=20,xf.ignoreMeetingMonitor(i);case 20:if(e.t0=e.sent,e.t0){e.next=23;break}e.t0={};case 23:T=e.t0,200===T.status&&(s=Wl(!0)),e.next=30;break;case 28:e.prev=28,e.t1=e.catch(17);case 30:return e.abrupt("return",s);case 31:if(!_){e.next=43;break}if(s=Wl(!1,"XYSDK:950107"),!a){e.next=43;break}return e.next=36,xf.verifyPassword(i,a);case 36:if(e.t2=e.sent,e.t2){e.next=39;break}e.t2={};case 39:R=e.t2,O=R.status,s=Wl(!0),200!==O&&204!==O&&(s=Wl(!1,"XYSDK:950108"));case 43:return e.abrupt("return",s);case 44:if(!x){e.next=46;break}return e.abrupt("return",Wl(!1,"XYSDK:950109"));case 46:if(!(null==u?void 0:u.errorCode)){e.next=50;break}if(1001!==(D=u.errorCode)&&2036!==D){e.next=50;break}return e.abrupt("return",Wl(!1,"XYSDK:950105"));case 50:return e.abrupt("return",Promise.reject(c));case 53:return e.prev=53,e.t3=e.catch(4),e.abrupt("return",Promise.reject(e.t3));case 56:case"end":return e.stop()}}),n,this,[[4,53],[17,28]])})))}},{key:"refreshToken",value:function(e){return xf.refreshToken(e)}},{key:"setAudioOutputDevice",value:function(e){var t=this;Object.keys(this.audioManagers).forEach((function(n){var r,i=t.audioManagers[n];i.ele&&(null===(r=t.deviceManager)||void 0===r||r.setAudioOutputDevice(i.ele,e))}))}},{key:"removeAudioRender",value:function(e){this.logger.log("[client] removeAudioRender:",e),this.audioManagers[e]&&(this.logger.log("remove audio render: ",e),delete this.audioManagers[e])}},{key:"startMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]start monitor:",e),this.invite.callIndex&&this.sendSocketMessage({type:"START_MONITOR",uriList:e})}},{key:"stopMonitor",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("[monitor]stop monitor:",e),this.invite.callIndex&&(this.layoutManager&&this.layoutManager.clearVideoManagersUseMonitorList(e),this.sendSocketMessage({type:"STOP_MONITOR",uriList:e}))}},{key:"subscribeBulkRoster",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeBulkRoster"}}),n.isSubscribeBulkRoster=!0,e(!0)}else t(Xl("XYSDK:950517"))})));case 1:case"end":return e.stop()}}),t)})))}},{key:"startTranslation",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] startTranslation"),e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeTranslation",operation:1}}),n.isSubscribeTranslation=!0,e(!0)}else t(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),t,this)})))}},{key:"stopTranslation",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] startTranslation"),e.abrupt("return",new Promise((function(e,t){if(n.invite.callIndex){var r=n.invite,i=r.callerUri,o=r.meetingId;n.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeTranslation",operation:2}}),n.isSubscribeTranslation=!1,e(!0)}else t(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),t,this)})))}},{key:"setTranslationLanguage",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[client] setTranslationLanguage:",t),e.abrupt("return",new Promise((function(e,n){if(r.invite.callIndex){var i=r.invite,o=i.callerUri,a=i.meetingId;t=gf.includes(t)?t:"English",r.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:a,endpointId:o,language:t,type:"setTranslationLanguage"}}),e(!0)}else n(Xl("XYSDK:950301"))})));case 2:case"end":return e.stop()}}),n,this)})))}},{key:"startCloudRecord",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] start record:",this.recordPermission),n=this.recordPermission,r=n.authorize,i=n.recordingUrl,o=this.invite.remoteUri,r){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:953902")));case 5:return e.next=7,this.checkStorageSpaceWithRecordingUrl(i);case 7:this.sendSocketMessage({type:"START_RECORD",remoteUri:o});case 8:case"end":return e.stop()}}),t,this)})))}},{key:"stopCloudRecord",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] stop record:",this.recordState),n=this.invite.remoteUri,this.recordState===exports.RecordingState.RECORD_STATE_STARTED){e.next=4;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:953905")));case 4:this.sendSocketMessage({type:"STOP_RECORD",remoteUri:n});case 5:case"end":return e.stop()}}),t,this)})))}},{key:"setWebRxBandwidth",value:function(){return Rn(this,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[client] setWebRxBandwidth"),n=this.invite,r=n.meetingId,i=n.callerUri,o=this.iauth.getLoginInfo(),a=o.id,s=0,r){e.next=6;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950301")));case 6:return e.prev=6,e.next=9,xf.getWebRxBandwidth(a);case 9:c=e.sent,u=c.RemoteSDKConfig,this.logger.log("getWebRxBandwidth RemoteSDKConfig:",u),s=1024*~~((null==u?void 0:u.downLinkCeilingRate)||0),e.next=17;break;case 15:e.prev=15,e.t0=e.catch(6);case 17:s&&this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"setWebRxBandwidth",meetingId:r,endpointId:i,rxBandwidth:s}});case 18:case"end":return e.stop()}}),t,this,[[6,15]])})))}},{key:"reSendContentOffer",value:function(){this.peer.reSendContentOffer()}},{key:"startMonitorGroup",value:function(e){return this.setMonitorGroup("start",e)}},{key:"stopMonitorGroup",value:function(e){return this.setMonitorGroup("stop",e)}},{key:"setMonitorGroup",value:function(e,t){if(this.logger.log("[monitor]".concat(e," monitor group"),t),!this.invite.callIndex)return Xl("XYSDK:950517");if(!t||!t.length)return!0;var n=this.invite,r=n.callerUri,i=n.meetingId;return this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"start"===e?"startMediaGrp":"stopMediaGrp",conferenceId:i,endpointId:r,mediagrps:t.map((function(e){return{id:e}}))}}),!0}},{key:"initDeviceManagerEvent",value:function(){var e,t,n,r=this;null===(e=this.deviceManager)||void 0===e||e.on("permission",(function(e){r.logger.log("deviceManager permission changed: ",e),"denied"===e.camera&&(r.isPermissionDenied.camera=!0),"denied"===e.microphone&&(r.isPermissionDenied.microphone=!0),r.emmit("permission",e)})),null===(t=this.deviceManager)||void 0===t||t.on("currentDevice",(function(e){r.emmit("currentDevice",e)})),null===(n=this.deviceManager)||void 0===n||n.on("device",(function(e){var t=e.nextDevice,n=t.audioInput,i=t.videoInput,o=t.audioOutput;try{r.autoSwitchDevice&&(n&&r.stream&&r.stream.switchDevice("audio",n.deviceId),i&&r.stream&&r.stream.switchDevice("video",i.deviceId),o&&r.setAudioOutputDevice(o.deviceId)),r.emmit("device",e)}catch(e){r.logger.log("auto switch device failed:",e)}}))}},{key:"initWss",value:function(t,n){var r,i;return Rn(this,void 0,void 0,e().mark((function n(){var o,a,s,c,u,l,h,d,f=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.logger.log("[wss] init wss"),this.socketTask&&this.socketTask.close(),o="",e.prev=3,a="",s=this.config.isSupportHybridCloud,this.logger.log("[wss] isSupportHybridCloud:",s),s&&(c=this.servers.wssServer.split("//")[1].split("/")[0],a="https://"+c),this.logger.log("[wss] getAllocation server in HybridCloud:",a),u=this.iauth.getLoginInfo(),l=u.id,e.next=12,xf.getAllocation(l,a,s);case 12:h=e.sent,o=(null===(r=null==h?void 0:h.data)||void 0===r?void 0:r.serverId)||"",e.next=18;break;case 16:e.prev=16,e.t0=e.catch(3);case 18:d="".concat(this.servers.wssServer,"/websocket/webrtc").concat(o?"/".concat(o):""),this.logger.log("[wss]ws url:",d),this.token=(null===(i=xf.getLoginInfo())||void 0===i?void 0:i.access_token)||this.token,this.socketTask=new zf({url:d,params:{token:this.token,start:!0}},this),this.socketTask.on("open",(function(e){f.logger.log("websocket is connected:",d),f.logger.log("Version: ",wf),f.invite.callIndex&&f.peer.restartIceConnection(),f.startCall(),f.emmit("socket-open",e)})),this.socketTask.on("message",(function(e){var n=e.data;if(n){var r=JSON.parse(n);f.handleSocketMessage(r,t),f.emmit("socket-message",r)}})),this.socketTask.on("close",(function(e){f.logger.log("连接已关闭"),f.disconnectInWssError("XYSDK:950114",{code:null==e?void 0:e.code}),f.emmit("socket-close",Xl("XYSDK:950114",{code:null==e?void 0:e.code})),f.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("timeout",(function(){f.logger.log("websocket connect timeout"),f.emmit("socket-timeout",Xl("XYSDK:950112"))})),this.socketTask.on("error",(function(e){f.logger.log("Websocket connect is error",e),f.emmit("socket-error",Xl("XYSDK:950115",e))})),this.socketTask.on("reconnect",(function(e){f.logger.log("Websocket reconnect: ","Websocket connected is close, reconnect..."),f.emmit("socket-reconnect",Xl("XYSDK:950113",e))}));case 28:case"end":return e.stop()}}),n,this,[[3,16]])})))}}],[{key:"getClientInstance",value:function(e,t,n){return this.instance||(this.instance=new s(e,t,n)),this.instance}},{key:"getCustomLayoutItem",value:function(e,t,n){var r=e.roster.isContent;return{pid:e.roster.participantId,resolution:t,quality:n,mediagroupid:r?1:0}}}]),s}(),tg="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,ng=RangeError,rg=function(e){if(void 0===e)return 0;var t=kt(e),n=_t(t);if(t!==n)throw ng("Wrong length or index");return n},ig=Array,og=Math.abs,ag=Math.pow,sg=Math.floor,cg=Math.log,ug=Math.LN2,lg=function(e,t,n){var r,i,o,a=ig(n),s=8*n-t-1,c=(1<<s)-1,u=c>>1,l=23===t?ag(2,-24)-ag(2,-77):0,h=e<0||0===e&&1/e<0?1:0,d=0;for((e=og(e))!=e||e===1/0?(i=e!=e?1:0,r=c):(r=sg(cg(e)/ug),e*(o=ag(2,-r))<1&&(r--,o*=2),(e+=r+u>=1?l/o:l*ag(2,1-u))*o>=2&&(r++,o/=2),r+u>=c?(i=0,r=c):r+u>=1?(i=(e*o-1)*ag(2,t),r+=u):(i=e*ag(2,u-1)*ag(2,t),r=0));t>=8;)a[d++]=255&i,i/=256,t-=8;for(r=r<<t|i,s+=t;s>0;)a[d++]=255&r,r/=256,s-=8;return a[--d]|=128*h,a},hg=function(e,t){var n,r=e.length,i=8*r-t-1,o=(1<<i)-1,a=o>>1,s=i-7,c=r-1,u=e[c--],l=127&u;for(u>>=7;s>0;)l=256*l+e[c--],s-=8;for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)n=256*n+e[c--],s-=8;if(0===l)l=1-a;else{if(l===o)return n?NaN:u?-1/0:1/0;n+=ag(2,t),l-=a}return(u?-1:1)*n*ag(2,l-t)},dg=Mt.f,fg=Xe.f,pg=$e.PROPER,vg=$e.CONFIGURABLE,gg=gt.get,mg=gt.set,yg=k.ArrayBuffer,bg=yg,Sg=bg&&bg.prototype,wg=k.DataView,kg=wg&&wg.prototype,Cg=Object.prototype,Eg=k.Array,xg=k.RangeError,Ig=M(Os),_g=M([].reverse),Ag=lg,Tg=hg,Rg=function(e){return[255&e]},Og=function(e){return[255&e,e>>8&255]},Dg=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Ng=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Lg=function(e){return Ag(e,23,4)},Pg=function(e){return Ag(e,52,8)},Mg=function(e,t){fg(e.prototype,t,{get:function(){return gg(this)[t]}})},Bg=function(e,t,n,r){var i=rg(n),o=gg(e);if(i+t>o.byteLength)throw xg("Wrong index");var a=gg(o.buffer).bytes,s=i+o.byteOffset,c=Ca(a,s,s+t);return r?c:_g(c)},Gg=function(e,t,n,r,i,o){var a=rg(n),s=gg(e);if(a+t>s.byteLength)throw xg("Wrong index");for(var c=gg(s.buffer).bytes,u=a+s.byteOffset,l=r(+i),h=0;h<t;h++)c[u+h]=l[o?h:t-h-1]};if(tg){var jg=pg&&"ArrayBuffer"!==yg.name;if(C((function(){yg(1)}))&&C((function(){new yg(-1)}))&&!C((function(){return new yg,new yg(1.5),new yg(NaN),jg&&!vg})))jg&&vg&&We(yg,"name","ArrayBuffer");else{(bg=function(e){return Vn(this,Sg),new yg(rg(e))}).prototype=Sg;for(var Hg,Ug=dg(yg),Kg=0;Ug.length>Kg;)(Hg=Ug[Kg++])in bg||We(bg,Hg,yg[Hg]);Sg.constructor=bg}jn&&Va(kg)!==Cg&&jn(kg,Cg);var Fg=new wg(new bg(2)),zg=M(kg.setInt8);Fg.setInt8(0,2147483648),Fg.setInt8(1,2147483649),!Fg.getInt8(0)&&Fg.getInt8(1)||pv(kg,{setInt8:function(e,t){zg(this,e,t<<24>>24)},setUint8:function(e,t){zg(this,e,t<<24>>24)}},{unsafe:!0})}else Sg=(bg=function(e){Vn(this,Sg);var t=rg(e);mg(this,{bytes:Ig(Eg(t),0),byteLength:t}),E||(this.byteLength=t)}).prototype,kg=(wg=function(e,t,n){Vn(this,kg),Vn(e,Sg);var r=gg(e).byteLength,i=kt(t);if(i<0||i>r)throw xg("Wrong offset");if(i+(n=void 0===n?r-i:_t(n))>r)throw xg("Wrong length");mg(this,{buffer:e,byteLength:n,byteOffset:i}),E||(this.buffer=e,this.byteLength=n,this.byteOffset=i)}).prototype,E&&(Mg(bg,"byteLength"),Mg(wg,"buffer"),Mg(wg,"byteLength"),Mg(wg,"byteOffset")),pv(kg,{getInt8:function(e){return Bg(this,1,e)[0]<<24>>24},getUint8:function(e){return Bg(this,1,e)[0]},getInt16:function(e){var t=Bg(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Bg(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Ng(Bg(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Ng(Bg(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return Tg(Bg(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return Tg(Bg(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Gg(this,1,e,Rg,t)},setUint8:function(e,t){Gg(this,1,e,Rg,t)},setInt16:function(e,t){Gg(this,2,e,Og,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Gg(this,2,e,Og,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Gg(this,4,e,Dg,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Gg(this,4,e,Dg,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Gg(this,4,e,Lg,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Gg(this,8,e,Pg,t,arguments.length>2?arguments[2]:void 0)}});Kn(bg,"ArrayBuffer"),Kn(wg,"DataView");var Yg={ArrayBuffer:bg,DataView:wg},Vg=Yg.ArrayBuffer,Xg=Yg.DataView,Wg=Xg.prototype,qg=M(Vg.prototype.slice),Zg=M(Wg.getUint8),Jg=M(Wg.setUint8),$g=C((function(){return!new Vg(2).slice(1,void 0).byteLength}));qt({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:$g},{slice:function(e,t){if(qg&&void 0===t)return qg(Fe(this),e);for(var n=Fe(this).byteLength,r=xt(e,n),i=xt(void 0===t?n:t,n),o=new(Zn(this,Vg))(_t(i-r)),a=new Xg(this),s=new Xg(o),c=0;r<i;)Jg(s,c++,Zg(a,r++));return o}});var Qg,em,tm,nm=Xe.f,rm=gt.enforce,im=gt.get,om=k.Int8Array,am=om&&om.prototype,sm=k.Uint8ClampedArray,cm=sm&&sm.prototype,um=om&&Va(om),lm=am&&Va(am),hm=Object.prototype,dm=k.TypeError,fm=Te("toStringTag"),pm=Ee("TYPED_ARRAY_TAG"),vm=tg&&!!jn&&"Opera"!==hn(k.opera),gm=!1,mm={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},ym={BigInt64Array:8,BigUint64Array:8},bm=function(e){var t=Va(e);if(X(t)){var n=im(t);return n&&Se(n,"TypedArrayConstructor")?n.TypedArrayConstructor:bm(t)}},Sm=function(e){if(!X(e))return!1;var t=hn(e);return Se(mm,t)||Se(ym,t)};for(Qg in mm)(tm=(em=k[Qg])&&em.prototype)?rm(tm).TypedArrayConstructor=em:vm=!1;for(Qg in ym)(tm=(em=k[Qg])&&em.prototype)&&(rm(tm).TypedArrayConstructor=em);if((!vm||!V(um)||um===Function.prototype)&&(um=function(){throw dm("Incorrect invocation")},vm))for(Qg in mm)k[Qg]&&jn(k[Qg],um);if((!vm||!lm||lm===hm)&&(lm=um.prototype,vm))for(Qg in mm)k[Qg]&&jn(k[Qg].prototype,lm);if(vm&&Va(cm)!==lm&&jn(cm,lm),E&&!Se(lm,fm))for(Qg in gm=!0,nm(lm,fm,{get:function(){return X(this)?this[pm]:void 0}}),mm)k[Qg]&&We(k[Qg],pm,Qg);var wm={NATIVE_ARRAY_BUFFER_VIEWS:vm,TYPED_ARRAY_TAG:gm&&pm,aTypedArray:function(e){if(Sm(e))return e;throw dm("Target is not a typed array")},aTypedArrayConstructor:function(e){if(V(e)&&(!jn||Z(um,e)))return e;throw dm(ce(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n,r){if(E){if(n)for(var i in mm){var o=k[i];if(o&&Se(o.prototype,e))try{delete o.prototype[e]}catch(n){try{o.prototype[e]=t}catch(e){}}}lm[e]&&!n||yt(lm,e,n?t:vm&&am[e]||t,r)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(E){if(jn){if(n)for(r in mm)if((i=k[r])&&Se(i,e))try{delete i[e]}catch(e){}if(um[e]&&!n)return;try{return yt(um,e,n?t:vm&&um[e]||t)}catch(e){}}for(r in mm)!(i=k[r])||i[e]&&!n||yt(i,e,t)}},getTypedArrayConstructor:bm,isView:function(e){if(!X(e))return!1;var t=hn(e);return"DataView"===t||Se(mm,t)||Se(ym,t)},isTypedArray:Sm,TypedArray:um,TypedArrayPrototype:lm},km=wm.NATIVE_ARRAY_BUFFER_VIEWS,Cm=k.ArrayBuffer,Em=k.Int8Array,xm=!km||!C((function(){Em(1)}))||!C((function(){new Em(-1)}))||!Fi((function(e){new Em,new Em(null),new Em(1.5),new Em(e)}),!0)||C((function(){return 1!==new Em(new Cm(2),1,void 0).length})),Im=Math.floor,_m=Number.isInteger||function(e){return!X(e)&&isFinite(e)&&Im(e)===e},Am=RangeError,Tm=RangeError,Rm=function(e,t){var n=function(e){var t=kt(e);if(t<0)throw Am("The argument can't be less than 0");return t}(e);if(n%t)throw Tm("Wrong offset");return n},Om=wm.aTypedArrayConstructor,Dm=function(e){var t,n,r,i,o,a,s=Wn(this),c=ye(e),u=arguments.length,l=u>1?arguments[1]:void 0,h=void 0!==l,d=Oi(c);if(d&&!Ti(d))for(a=(o=Ni(c,d)).next,c=[];!(i=_(a,o)).done;)c.push(i.value);for(h&&u>2&&(l=nr(l,arguments[2])),n=At(c),r=new(Om(s))(n),t=0;n>t;t++)r[t]=h?l(c[t],t):c[t];return r};y((function(e){var t=Mt.f,n=co.forEach,r=gt.get,i=gt.set,o=gt.enforce,a=Xe.f,s=je.f,c=Math.round,u=k.RangeError,l=Yg.ArrayBuffer,h=l.prototype,d=Yg.DataView,f=wm.NATIVE_ARRAY_BUFFER_VIEWS,p=wm.TYPED_ARRAY_TAG,v=wm.TypedArray,g=wm.TypedArrayPrototype,m=wm.aTypedArrayConstructor,y=wm.isTypedArray,b=function(e,t){m(e);for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i},S=function(e,t){a(e,t,{get:function(){return r(this)[t]}})},w=function(e){var t;return Z(h,e)||"ArrayBuffer"==(t=hn(e))||"SharedArrayBuffer"==t},C=function(e,t){return y(e)&&!ae(t)&&t in e&&_m(+t)&&t>=0},x=function(e,t){return t=Ne(t),C(e,t)?O(2,e[t]):s(e,t)},I=function(e,t,n){return t=Ne(t),!(C(e,t)&&X(n)&&Se(n,"value"))||Se(n,"get")||Se(n,"set")||n.configurable||Se(n,"writable")&&!n.writable||Se(n,"enumerable")&&!n.enumerable?a(e,t,n):(e[t]=n.value,e)};E?(f||(je.f=x,Xe.f=I,S(g,"buffer"),S(g,"byteOffset"),S(g,"byteLength"),S(g,"length")),qt({target:"Object",stat:!0,forced:!f},{getOwnPropertyDescriptor:x,defineProperty:I}),e.exports=function(e,s,h){var m=e.match(/\d+$/)[0]/8,S=e+(h?"Clamped":"")+"Array",C="get"+e,E="set"+e,x=k[S],I=x,A=I&&I.prototype,T={},R=function(e,t){a(e,t,{get:function(){return function(e,t){var n=r(e);return n.view[C](t*m+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=r(e);h&&(n=(n=c(n))<0?0:n>255?255:255&n),i.view[E](t*m+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};f?xm&&(I=s((function(e,t,n,r){return Vn(e,A),rh(X(t)?w(t)?void 0!==r?new x(t,Rm(n,m),r):void 0!==n?new x(t,Rm(n,m)):new x(t):y(t)?b(I,t):_(Dm,I,t):new x(rg(t)),e,I)})),jn&&jn(I,v),n(t(x),(function(e){e in I||We(I,e,x[e])})),I.prototype=A):(I=s((function(e,t,n,r){Vn(e,A);var o,a,s,c=0,h=0;if(X(t)){if(!w(t))return y(t)?b(I,t):_(Dm,I,t);o=t,h=Rm(n,m);var f=t.byteLength;if(void 0===r){if(f%m)throw u("Wrong length");if((a=f-h)<0)throw u("Wrong length")}else if((a=_t(r)*m)+h>f)throw u("Wrong length");s=a/m}else s=rg(t),o=new l(a=s*m);for(i(e,{buffer:o,byteOffset:h,byteLength:a,length:s,view:new d(o)});c<s;)R(e,c++)})),jn&&jn(I,v),A=I.prototype=Ao(g)),A.constructor!==I&&We(A,"constructor",I),o(A).TypedArrayConstructor=I,p&&We(A,p,S);var O=I!=x;T[S]=I,qt({global:!0,constructor:!0,forced:O,sham:!f},T),"BYTES_PER_ELEMENT"in I||We(I,"BYTES_PER_ELEMENT",m),"BYTES_PER_ELEMENT"in A||We(A,"BYTES_PER_ELEMENT",m),zn(S)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var Nm=Math.min,Lm=M([].copyWithin||function(e,t){var n=ye(this),r=At(n),i=xt(e,r),o=xt(t,r),a=arguments.length>2?arguments[2]:void 0,s=Nm((void 0===a?r:xt(a,r))-o,r-i),c=1;for(o<i&&i<o+s&&(c=-1,o+=s-1,i+=s-1);s-- >0;)o in n?n[i]=n[o]:wv(n,i),i+=c,o+=c;return n}),Pm=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("copyWithin",(function(e,t){return Lm(Pm(this),e,t,arguments.length>2?arguments[2]:void 0)}));var Mm=co.every,Bm=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("every",(function(e){return Mm(Bm(this),e,arguments.length>1?arguments[1]:void 0)}));var Gm=TypeError,jm=function(e){var t=De(e,"number");if("number"==typeof t)throw Gm("Can't convert number to bigint");return BigInt(t)},Hm=wm.aTypedArray,Um=wm.exportTypedArrayMethod,Km=M("".slice);Um("fill",(function(e){var t=arguments.length;Hm(this);var n="Big"===Km(hn(this),0,3)?jm(e):+e;return _(Os,this,n,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}),C((function(){var e=0;return new Int8Array(2).fill({valueOf:function(){return e++}}),1!==e})));var Fm=wm.aTypedArrayConstructor,zm=wm.getTypedArrayConstructor,Ym=function(e){return Fm(Zn(e,zm(e)))},Vm=function(e,t){return function(e,t){for(var n=0,r=At(t),i=new e(r);r>n;)i[n]=t[n++];return i}(Ym(e),t)},Xm=co.filter,Wm=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("filter",(function(e){var t=Xm(Wm(this),e,arguments.length>1?arguments[1]:void 0);return Vm(this,t)}));var qm=co.find,Zm=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("find",(function(e){return qm(Zm(this),e,arguments.length>1?arguments[1]:void 0)}));var Jm=co.findIndex,$m=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("findIndex",(function(e){return Jm($m(this),e,arguments.length>1?arguments[1]:void 0)}));var Qm=co.forEach,ey=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("forEach",(function(e){Qm(ey(this),e,arguments.length>1?arguments[1]:void 0)}));var ty=Rt.includes,ny=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("includes",(function(e){return ty(ny(this),e,arguments.length>1?arguments[1]:void 0)}));var ry=Rt.indexOf,iy=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("indexOf",(function(e){return ry(iy(this),e,arguments.length>1?arguments[1]:void 0)}));var oy=Te("iterator"),ay=k.Uint8Array,sy=M(cs.values),cy=M(cs.keys),uy=M(cs.entries),ly=wm.aTypedArray,hy=wm.exportTypedArrayMethod,dy=ay&&ay.prototype,fy=!C((function(){dy[oy].call([1])})),py=!!dy&&dy.values&&dy[oy]===dy.values&&"values"===dy.values.name,vy=function(){return sy(ly(this))};hy("entries",(function(){return uy(ly(this))}),fy),hy("keys",(function(){return cy(ly(this))}),fy),hy("values",vy,fy||!py,{name:"values"}),hy(oy,vy,fy||!py,{name:"values"});var gy=wm.aTypedArray,my=wm.exportTypedArrayMethod,yy=M([].join);my("join",(function(e){return yy(gy(this),e)}));var by=Math.min,Sy=[].lastIndexOf,wy=!!Sy&&1/[1].lastIndexOf(1,-0)<0,ky=to("lastIndexOf"),Cy=wy||!ky?function(e){if(wy)return er(Sy,this,arguments)||0;var t=Y(this),n=At(t),r=n-1;for(arguments.length>1&&(r=by(r,kt(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:Sy,Ey=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return er(Cy,Ey(this),t>1?[e,arguments[1]]:[e])}));var xy=co.map,Iy=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("map",(function(e){return xy(Iy(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(Ym(e))(t)}))}));var _y=TypeError,Ay=function(e){return function(t,n,r,i){le(n);var o=ye(t),a=K(o),s=At(o),c=e?s-1:0,u=e?-1:1;if(r<2)for(;;){if(c in a){i=a[c],c+=u;break}if(c+=u,e?c<0:s<=c)throw _y("Reduce of empty array with no initial value")}for(;e?c>=0:s>c;c+=u)c in a&&(i=n(i,a[c],c,o));return i}},Ty={left:Ay(!1),right:Ay(!0)},Ry=Ty.left,Oy=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return Ry(Oy(this),e,t,t>1?arguments[1]:void 0)}));var Dy=Ty.right,Ny=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return Dy(Ny(this),e,t,t>1?arguments[1]:void 0)}));var Ly=wm.aTypedArray,Py=wm.exportTypedArrayMethod,My=Math.floor;Py("reverse",(function(){for(var e,t=Ly(this).length,n=My(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this}));var By=k.RangeError,Gy=k.Int8Array,jy=Gy&&Gy.prototype,Hy=jy&&jy.set,Uy=wm.aTypedArray,Ky=wm.exportTypedArrayMethod,Fy=!C((function(){var e=new Uint8ClampedArray(2);return _(Hy,e,{length:1,0:3},1),3!==e[1]})),zy=Fy&&wm.NATIVE_ARRAY_BUFFER_VIEWS&&C((function(){var e=new Gy(2);return e.set(1),e.set("2",1),0!==e[0]||2!==e[1]}));Ky("set",(function(e){Uy(this);var t=Rm(arguments.length>1?arguments[1]:void 0,1),n=ye(e);if(Fy)return _(Hy,this,n,t);var r=this.length,i=At(n),o=0;if(i+t>r)throw By("Wrong length");for(;o<i;)this[t+o]=n[o++]}),!Fy||zy);var Yy=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("slice",(function(e,t){for(var n=ir(Yy(this),e,t),r=Ym(this),i=0,o=n.length,a=new r(o);o>i;)a[i]=n[i++];return a}),C((function(){new Int8Array(1).slice()})));var Vy=co.some,Xy=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("some",(function(e){return Vy(Xy(this),e,arguments.length>1?arguments[1]:void 0)}));var Wy=Math.floor,qy=function(e,t){var n=e.length,r=Wy(n/2);return n<8?Zy(e,t):Jy(e,qy(Ca(e,0,r),t),qy(Ca(e,r),t),t)},Zy=function(e,t){for(var n,r,i=e.length,o=1;o<i;){for(r=o,n=e[o];r&&t(e[r-1],n)>0;)e[r]=e[--r];r!==o++&&(e[r]=n)}return e},Jy=function(e,t,n,r){for(var i=t.length,o=n.length,a=0,s=0;a<i||s<o;)e[a+s]=a<i&&s<o?r(t[a],n[s])<=0?t[a++]:n[s++]:a<i?t[a++]:n[s++];return e},$y=qy,Qy=J.match(/firefox\/(\d+)/i),eb=!!Qy&&+Qy[1],tb=/MSIE|Trident/.test(J),nb=J.match(/AppleWebKit\/(\d+)\./),rb=!!nb&&+nb[1],ib=wm.aTypedArray,ob=wm.exportTypedArrayMethod,ab=k.Uint16Array,sb=ab&&M(ab.prototype.sort),cb=!(!sb||C((function(){sb(new ab(2),null)}))&&C((function(){sb(new ab(2),{})}))),ub=!!sb&&!C((function(){if(ne)return ne<74;if(eb)return eb<67;if(tb)return!0;if(rb)return rb<602;var e,t,n=new ab(516),r=Array(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(sb(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));ob("sort",(function(e){return void 0!==e&&le(e),ub?sb(this,e):$y(ib(this),function(e){return function(t,n){return void 0!==e?+e(t,n)||0:n!=n?-1:t!=t?1:0===t&&0===n?1/t>0&&1/n<0?1:-1:t>n}}(e))}),!ub||cb);var lb=wm.aTypedArray;(0,wm.exportTypedArrayMethod)("subarray",(function(e,t){var n=lb(this),r=n.length,i=xt(e,r);return new(Ym(n))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,_t((void 0===t?r:xt(t,r))-i))}));var hb=k.Int8Array,db=wm.aTypedArray,fb=wm.exportTypedArrayMethod,pb=[].toLocaleString,vb=!!hb&&C((function(){pb.call(new hb(1))}));fb("toLocaleString",(function(){return er(pb,vb?ir(db(this)):db(this),ir(arguments))}),C((function(){return[1,2].toLocaleString()!=new hb([1,2]).toLocaleString()}))||!C((function(){hb.prototype.toLocaleString.call([1,2])})));var gb=wm.exportTypedArrayMethod,mb=k.Uint8Array,yb=mb&&mb.prototype||{},bb=[].toString,Sb=M([].join);C((function(){bb.call({})}))&&(bb=function(){return Sb(this)});var wb=yb.toString!=bb;gb("toString",bb,wb);var kb=function(){function e(t){n(this,e),this.level=0,this.stream=t}return i(e,[{key:"getAudioLevel",value:function(){if(this.analyser){this.analyser.getByteTimeDomainData(this.timeDomainData);var e=0,t=0,n=this.timeDomainData.length;for(t=0;t<n;t++)e=Math.max(e,Math.abs(this.timeDomainData[t]-128));this.level=e}var r=Math.min(100,100*Number((this.level/64).toFixed(2)));return parseInt(r+"")}},{key:"init",value:function(){var e=window.AudioContext||window.webkitAudioContext;e?(this.audioContext=new e,this.analyser=this.audioContext.createAnalyser(),this.analyser.fftSize=2048,this.sourceNode=this.audioContext.createMediaStreamSource(this.stream),this.timeDomainData=new Uint8Array(this.analyser.frequencyBinCount),this.sourceNode.connect(this.analyser)):console.log("init audio content failed: ",e)}}]),e}(),Cb=function(t){o(a,Kf);var r=l(a);function a(e){var t;n(this,a),t=r.call(this);var i=e.logger,o=e.client,s=void 0===o?null:o;return t.streams=[],t.pipelineStreams=[],t.contentStreams=[],t.previewStreams=[],t.logger=i,t.client=s,t.isShareContent=!1,t.streamStatus=!0,t.config={devices:{}},t.current={type:"FAILED",detail:""},t.audioDeviceId="",t.videoDeviceId="",t.isFirefox=Na.isFirefox(),t.isReduceResolution=!1,t.isSupportReauthorize=Na.isSupportReauthorize(),t.isSupportAppendTrack=Na.isSupportAppendTrack(),t}return i(a,[{key:"getLocalStream",value:function(){return this.previewStreams}},{key:"getIndexFromStreamChange",value:function(e,t){var n=e.id;return t.findIndex((function(e){return e.streamId===n}))}},{key:"off",value:function(e){this.removeListener(e)}},{key:"handleChangeStream",value:function(t,n,r){return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l,h,d,f,p,v,g,m,y,b,S;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=t.streamChangeInfo,a=0===r?this.streams:this.contentStreams,s=a.length,!Oa||"hidden"!==document.visibilityState||0!==o.length){e.next=6;break}return this.logger.log("not handle set band width when document is hidden in mobile"),e.abrupt("return");case 6:c=0;case 7:if(!(c<s)){e.next=46;break}if(u=a[c],l=u.status,h=u.stream,d=u.resolution,u.type,"NORMAL"!==l){e.next=43;break}f=(null==h?void 0:h.getVideoTracks())||[],p=f.length,v=h?this.getIndexFromStreamChange(h,o):-1,g=0;case 14:if(!(g<p)){e.next=43;break}if(!(m=f[g])){e.next=40;break}if(-1===v){e.next=30;break}return y=o[v],b=y.bandwidth>=100?y.bandwidth:100,e.prev=20,e.next=23,n.setBandWidth(m.id,b,!0,h);case 23:e.next=28;break;case 25:e.prev=25,e.t0=e.catch(20),this.logger.log("[stream]set band width failed:",e.t0);case 28:e.next=40;break;case 30:return e.prev=30,S=Wd[d]||10,e.next=35,n.setBandWidth(m.id,S,!0,h);case 35:e.next=40;break;case 37:e.prev=37,e.t1=e.catch(30),this.logger.log("[stream]reduce band width failed:",e.t1);case 40:g++,e.next=14;break;case 43:c++,e.next=7;break;case 46:case"end":return e.stop()}}),i,this,[[20,25],[30,37]])})))}},{key:"setAudioOutput",value:function(e){var t=this;if(this.logger.log("set audio output device: ".concat(e)),"string"!=typeof e){return this.logger.log("Parameter must be a string"),Promise.reject(Xl("XYSDK:950101"))}return new Promise((function(n,r){var i;try{null===(i=t.client)||void 0===i||i.setAudioOutputDevice(e),n({deviceId:e})}catch(e){r(Xl("XYSDK:950407",e))}}))}},{key:"switchDevice",value:function(t,n){var r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("switch device: type: ".concat(t,", deviceId: ").concat(n)),s=["audio","video"],"string"==typeof t&&s.includes(t)&&"string"==typeof n){e.next=4;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950101")));case 4:if(c=null===(r=this.client)||void 0===r?void 0:r.getSelfRoster(),u=(c||{videoTxMute:!1}).videoTxMute,e.prev=6,"audio"!==t||!n){e.next=11;break}return this.audioDeviceId=n,e.next=11,this.replaceAudioTrack();case 11:if("video"!==t||!n){e.next=22;break}if(this.videoDeviceId=n,!this.isSupportReauthorize){e.next=19;break}if(u){e.next=17;break}return e.next=17,this.replaceVideoTrack();case 17:e.next=22;break;case 19:return e.next=21,this.replaceVideoTrack();case 21:u&&this.setStreamStatus("muteVideo");case 22:return null===(o=null===(i=this.client)||void 0===i?void 0:i.deviceManager)||void 0===o||o.setCurrentUsedDeviceByType(t,n),e.abrupt("return",!0);case 26:return e.prev=26,e.t0=e.catch(6),e.abrupt("return",Promise.reject(Xl("XYSDK:950410",e.t0)));case 29:case"end":return e.stop()}}),a,this,[[6,26]])})))}},{key:"sendStreamStatus",value:function(){this.emmit("stream-status",this.current)}},{key:"replaceAudioTrack",value:function(){var t;return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=!0,this.streams.every((function(e){var t;if("180"===e.resolution){var n=(null===(t=e.stream)||void 0===t?void 0:t.getAudioTracks())||[];r=n&&n.length>0,n.forEach((function(t){var n;t.stop(),null===(n=e.stream)||void 0===n||n.removeTrack(t)}))}})),e.prev=2,e.next=5,this.createNextAudioTracks();case 5:e.next=10;break;case 7:return e.prev=7,e.t0=e.catch(2),e.abrupt("return",Promise.reject(e.t0));case 10:null===(t=this.client)||void 0===t||t.applyVideoOrAudio("audio",!r),this.audioLevel=null;case 12:case"end":return e.stop()}}),n,this,[[2,7]])})))}},{key:"replaceVideoTrack",value:function(){var t,n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(o=null===(t=this.previewStreams[0])||void 0===t?void 0:t.stream,a=o&&o.getVideoTracks().length>0,!o){e.next=17;break}return e.prev=3,this.isSupportAppendTrack||(this.logger.log("The first step is to delete the track when replaceVideoTrack..."),this.removePreviousVideoTracks(!0)),e.next=7,this.createNextVideoTracks();case 7:this.isSupportAppendTrack&&this.removePreviousVideoTracks(),null===(n=this.client)||void 0===n||n.applyVideoOrAudio("video",!a),null===(r=this.client)||void 0===r||r.sendPeopleCapability(),e.next=15;break;case 12:return e.prev=12,e.t0=e.catch(3),e.abrupt("return",Promise.reject(e.t0));case 15:e.next=18;break;case 17:return e.abrupt("return",Promise.reject(Xl("XYSDK:950514")));case 18:case"end":return e.stop()}}),i,this,[[3,12]])})))}},{key:"setAudioOrVideoStatus",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u=this;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if("unmuteAudio"!==t&&"unmuteVideo"!==t||"SEND_ONLY"!==this.current.type){e.next=9;break}return a={},s="video","unmuteAudio"===t&&(a={muteAudio:!1},s="audio"),"unmuteVideo"===t&&(a={muteVideo:!1},s="video"),e.next=7,this.init(this.config,a);case 7:return null===(n=this.client)||void 0===n||n.applyVideoOrAudio(s,!0),e.abrupt("return");case 9:if(!this.isSupportReauthorize||"unmuteAudio"!==t){e.next=22;break}if(c=(null===(i=null===(r=this.streams.find((function(e){return"180"===e.resolution})))||void 0===r?void 0:r.stream)||void 0===i?void 0:i.getAudioTracks())||[],c.length>0){e.next=22;break}return e.prev=13,e.next=16,this.replaceAudioTrack();case 16:return e.abrupt("return");case 19:return e.prev=19,e.t0=e.catch(13),e.abrupt("return",Promise.reject(e.t0));case 22:if("muteAudio"!==t&&"unmuteAudio"!==t||this.setStreamStatus(t),"muteVideo"===t&&setTimeout((function(){u.logger.log("setTimeout muteVideo......"),u.setStreamStatus(t)}),10),"unmuteVideo"!==t){e.next=37;break}if(e.prev=25,this.isSupportReauthorize){e.next=30;break}this.setStreamStatus(t),e.next=32;break;case 30:return e.next=32,this.replaceVideoTrack();case 32:e.next=37;break;case 34:return e.prev=34,e.t1=e.catch(25),e.abrupt("return",Promise.reject(e.t1));case 37:case"end":return e.stop()}}),o,this,[[13,19],[25,34]])})))}},{key:"setStreamStatus",value:function(e){var t=this;this.logger.log("setStreamStatus type:",e),this.previewStreams.forEach((function(n){n.stream&&t.setStreamTracksStatus(n.stream,e)})),this.streams.forEach((function(n){n.stream&&t.setStreamTracksStatus(n.stream,e)}))}},{key:"getNextAudioContraints",value:function(e){var t=a.getContraints(!1,!0),n={};return e&&(n={deviceId:{exact:e}}),t.audio&&Object.assign(t.audio,n),this.logger.log("create next audio track contraints:",t),t}},{key:"getNextAudioMedia",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getNextAudioContraints(t),e.prev=1,e.next=4,this.getUserMedia(r);case 4:i=e.sent,e.next=20;break;case 7:return e.prev=7,e.t0=e.catch(1),this.logger.error("create next audio track error:",e.t0),e.prev=10,r=this.getNextAudioContraints(""),e.next=14,this.getUserMedia(r);case 14:i=e.sent,e.next=20;break;case 17:return e.prev=17,e.t1=e.catch(10),e.abrupt("return",Promise.reject(e.t1));case 20:return e.abrupt("return",i);case 21:case"end":return e.stop()}}),n,this,[[1,7],[10,17]])})))}},{key:"createNextAudioTracks",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=null,e.prev=1,e.next=4,this.getNextAudioMedia(t);case 4:r=e.sent,e.next=11;break;case 7:return e.prev=7,e.t0=e.catch(1),i=this.handleCreateStreamError(e.t0),e.abrupt("return",Promise.reject(i));case 11:o=r.getAudioTracks()[0],this.streams.some((function(e){var t;if("180"===e.resolution)return null===(t=e.stream)||void 0===t||t.addTrack(o),!0}));case 13:case"end":return e.stop()}}),n,this,[[1,7]])})))}},{key:"getNextVideoContraints",value:function(e){var t=a.getContraints(!0,!1),n={};return e&&(n={deviceId:{exact:e}}),t.video&&Object.assign(t.video,n),this.logger.log("create next video track contraints:",t),t}},{key:"getNextVideoMedia",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return Rn(this,void 0,void 0,e().mark((function n(){var r,i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=this.getNextVideoContraints(t),e.prev=1,e.next=4,this.getUserMedia(r);case 4:i=e.sent,e.next=21;break;case 7:return e.prev=7,e.t0=e.catch(1),this.logger.error("create next video track error:",e.t0),e.prev=10,r.video&&(delete r.video.width,delete r.video.height),e.next=14,this.getUserMedia(r);case 14:i=e.sent,e.next=21;break;case 17:return e.prev=17,e.t1=e.catch(10),this.logger.error("create next video track error again:",e.t0),e.abrupt("return",Promise.reject(e.t1));case 21:return e.abrupt("return",i);case 22:case"end":return e.stop()}}),n,this,[[1,7],[10,17]])})))}},{key:"createNextVideoTracks",value:function(){var t,n,r,i=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return Rn(this,void 0,void 0,e().mark((function o(){var a,s,c,u,l,d,f,p=this;return e().wrap((function(o){for(;;)switch(o.prev=o.next){case 0:return a=null,o.prev=1,o.next=4,this.getNextVideoMedia(i);case 4:a=o.sent,o.next=11;break;case 7:return o.prev=7,o.t0=o.catch(1),s=this.handleCreateStreamError(o.t0),o.abrupt("return",Promise.reject(s));case 11:c=a.getVideoTracks()[0],u=[c.clone(),c.clone(),c.clone()],null===(t=this.previewStreams[0].stream)||void 0===t||t.addTrack(c),l=v(this.streams.entries()),o.prev=15,f=e().mark((function t(){var i,o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=h(d.value,2),o=i[0],a=i[1],e.prev=1,s=p.getPeopleContraints(Number(a.resolution)),p.isFirefox){e.next=6;break}return e.next=6,u[o].applyConstraints(s);case 6:null===(n=a.stream)||void 0===n||n.addTrack(u[o]),p.streams[o].status="NORMAL",p.logger.log("create next remote track constraints:",s,p.streams),e.next=16;break;case 11:e.prev=11,e.t0=e.catch(1),p.logger.error("new video track apply constraints error: ",e.t0),p.streams[o].status="INVALID",null===(r=p.streams[o].stream)||void 0===r||r.getTracks().forEach((function(e){e.stop(),p.logger.log("disabled track",u[o].id)}));case 16:case"end":return e.stop()}}),t,null,[[1,11]])})),l.s();case 18:if((d=l.n()).done){o.next=22;break}return o.delegateYield(f(),"t1",20);case 20:o.next=18;break;case 22:o.next=27;break;case 24:o.prev=24,o.t2=o.catch(15),l.e(o.t2);case 27:return o.prev=27,l.f(),o.finish(27);case 30:case"end":return o.stop()}}),o,this,[[1,7],[15,24,27,30]])})))}},{key:"removePreviousVideoTracks",value:function(){var e,t,n=this,r=arguments.length>0&&void 0!==arguments[0]&&arguments[0],i=(null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getVideoTracks())||[];if(r||!(i.length<2)){var o=this.getEndedTrack(i);o&&(o.stop(),null===(t=this.previewStreams[0].stream)||void 0===t||t.removeTrack(o)),this.streams.forEach((function(e){var t,r,i=(null===(t=e.stream)||void 0===t?void 0:t.getVideoTracks())||[],o=n.getEndedTrack(i);o&&(o.stop(),null===(r=e.stream)||void 0===r||r.removeTrack(o))}))}}},{key:"getEndedTrack",value:function(e){return e.find((function(e){return"ended"===e.readyState}))||e[0]}},{key:"setStreamTracksStatus",value:function(e,t){var n=this;null==e||e.getTracks().forEach((function(e){if("audio"!==e.kind||"muteAudio"!==t&&"unmuteAudio"!==t||(e.enabled=ef[t].status),n.isSupportReauthorize)"video"===e.kind&&"muteVideo"===t&&(ef[t].status||e.stop());else if("video"===e.kind&&("muteVideo"===t||"unmuteVideo"===t)){var r=ef[t].status;e.enabled=r}}))}},{key:"close",value:function(){this.streamStatus=!1;var e=0;this.clearAudioLevel(),this.streams&&(e+=this.closeStreams(this.streams)),this.pipelineStreams&&(e+=this.closeStreams(this.pipelineStreams)),this.previewStreams&&(e+=this.closeStreams(this.previewStreams)),this.isShareContent&&this.closeContentStream(),this.isShareContent=!1,this.streams=[],this.pipelineStreams=[],this.contentStreams=[],this.previewStreams=[],this.logger.log("stream closed successfully: ",e)}},{key:"closeStreams",value:function(e){var t=0;return e.forEach((function(e){var n;"NORMAL"===e.status&&(null===(n=e.stream)||void 0===n||n.getTracks().forEach((function(e){e.stop(),t+=1})))})),t}},{key:"getMediaStreams",value:function(){return{previewStreams:this.previewStreams,streams:this.streams,pipelineStreams:this.pipelineStreams,contentStreams:this.contentStreams}}},{key:"init",value:function(){var t,n,r,i,o,a,s,c,u,l=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{devices:{}},h=arguments.length>1?arguments[1]:void 0;return Rn(this,void 0,void 0,e().mark((function d(){var f,p,v,g,m,y,b,S,w,k,C,E,x,I,_,A,T,R;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("stream init config:",l),this.streamStatus){e.next=3;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950205")));case 3:if(this.client){e.next=5;break}return e.abrupt("return",Promise.reject(Xl("XYSDK:950209")));case 5:if(this.config=l,f=(null==l?void 0:l.devices)||{audioInputValue:"",videoInValue:""},p=f.audioInputValue,v=void 0===p?"":p,g=f.videoInValue,m=void 0===g?"":g,y=null===(t=this.client.deviceManager)||void 0===t?void 0:t.getDevicePermission(),b=y.camera,S=y.microphone,w=!0,k=!0,C={type:"NORMAL",detail:"successfully"},w=!(null!==(n=null==h?void 0:h.muteVideo)&&void 0!==n?n:null===(r=this.client)||void 0===r?void 0:r.config.muteVideo),k=!(null!==(i=null==h?void 0:h.muteAudio)&&void 0!==i?i:null===(o=this.client)||void 0===o?void 0:o.config.muteAudio),"denied"===b&&(w=!1,C={type:"AUDIO_ONLY",detail:"Camera is not found or permission denied"}),"denied"===S&&(k=!1,C={type:"VIDEO_ONLY",detail:"Microphone is not found or permission denied"}),E=this.client.getFeatureConfig(),x=E.enableMobileNotAuth,this.isSupportReauthorize||x||(w=!0,k=!0,this.logger.log("[ios] init contraints: ",{video:w,audio:k})),this.current=C,w||k){e.next=22;break}return e.next=21,this.dealWithoutStreams();case 21:return e.abrupt("return",e.sent);case 22:return e.prev=22,e.next=25,this.getStream(w,k,m,v);case 25:return e.abrupt("return",e.sent);case 28:if(e.prev=28,e.t0=e.catch(22),I=this.handleCreateStreamError(e.t0),_=I.code,this.logger.log("get stream is error:",I),!w||"XYSDK:950406"!==_&&"XYSDK:950403"!==_){e.next=47;break}return this.logger.log("Reduce resolution to get stream..."),this.isReduceResolution=!0,e.prev=36,e.next=39,this.getStream(w,k,m,v,!0);case 39:return e.abrupt("return",e.sent);case 42:e.prev=42,e.t1=e.catch(36),I=this.handleCreateStreamError(e.t0),_=I.code,this.logger.log("Reduce resolution to get stream is error:",I);case 47:if(!qd.includes(_)){e.next=80;break}if(this.logger.log("Init domStream successfully",{status:I,err:e.t0}),!w||!k||"XYSDK:950404"===_){e.next=73;break}return e.prev=50,this.logger.log("only video stream create..."),e.next=54,this.getStream(!0,!1,m,v);case 54:return e.abrupt("return",e.sent);case 57:e.prev=57,e.t2=e.catch(50),this.logger.log("get video stream failed:",e.t2);case 60:return e.prev=60,this.logger.log("only audio stream create..."),e.next=64,this.getStream(!1,!0,m,v);case 64:return e.abrupt("return",e.sent);case 67:e.prev=67,e.t3=e.catch(60),this.logger.log("get audio stream failed:",e.t3);case 70:return e.next=72,this.dealWithoutStreams();case 72:return e.abrupt("return",e.sent);case 73:return A=null===(s=null===(a=this.client)||void 0===a?void 0:a.deviceManager)||void 0===s?void 0:s.getDevicePermission(),T=A.camera,R=A.microphone,null===(u=null===(c=this.client)||void 0===c?void 0:c.deviceManager)||void 0===u||u.setPermission({camera:w&&"unknown"===T?"denied":T,microphone:k&&"unknown"===R?"denied":R}),e.next=77,this.dealWithoutStreams();case 77:return e.abrupt("return",e.sent);case 80:return this.logger.warn("Init stream failed",{status:I,err:e.t0}),this.current={type:"FAILED",detail:I},e.abrupt("return",Promise.reject(Xl("XYSDK:950208",Object.assign({status:I},this.current))));case 83:case"end":return e.stop()}}),d,this,[[22,28],[36,42],[50,57],[60,67]])})))}},{key:"getPeopleContraints",value:function(e){return this.isReduceResolution||this.isFirefox?Vd[e].common:Vd[e].advanced}},{key:"getContentContraints",value:function(e){return this.isReduceResolution||this.isFirefox?Yd[e].common:Yd[e].advanced}},{key:"getStream",value:function(t,n,r,i){var o,a,s=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return Rn(this,void 0,void 0,e().mark((function c(){var u,l,h,d,f;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,u=this.getInitContraints(t,n,r,i,s),this.logger.log("init contraints:",u),e.next=5,this.getUserMedia(u);case 5:return l=e.sent,(null===(o=null==u?void 0:u.audio)||void 0===o?void 0:o.echoCancellation)&&l.getAudioTracks()[0].applyConstraints({echoCancellation:!0}),this.logger.log("base remote stream: ",l),e.next=10,this.initStreams(l);case 10:return this.streamStatus||this.close(),(null===(a=this.client)||void 0===a?void 0:a.deviceManager)&&(h=this.client.deviceManager.getDevicePermission(),d=h.camera,f=h.microphone,this.client.deviceManager.setPermission({camera:t?"granted":d,microphone:n?"granted":f})),this.emmit("local-stream",this.previewStreams),e.abrupt("return",Xl("XYSDK:950206",this.previewStreams));case 16:return e.prev=16,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 19:case"end":return e.stop()}}),c,this,[[0,16]])})))}},{key:"dealWithoutStreams",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=Xl("XYSDK:950405"),this.current={type:this.isSupportReauthorize?"SEND_ONLY":"FAILED",detail:t||r.msg},e.next=4,this.initStreams(null);case 4:return e.abrupt("return",Xl("XYSDK:950207",this.current));case 5:case"end":return e.stop()}}),n,this)})))}},{key:"getInitContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2?arguments[2]:void 0,r=arguments.length>3?arguments[3]:void 0,i=arguments.length>4&&void 0!==arguments[4]&&arguments[4],o={};i&&(o={width:Hd,height:Ud});var s=a.getContraints(e,t,o);if(r&&"default"!==r){var c={deviceId:{exact:r}};this.audioDeviceId=r,s.audio&&Object.assign(s.audio,c)}if(n){var u={deviceId:{exact:n}};this.videoDeviceId=n,s.video&&Object.assign(s.video,u)}return this.logger.log("get init constraints: ",s),s}},{key:"initStreams",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.initPreviewStream(t);case 2:return e.next=4,this.initRemoteStreams(t);case 4:this.initPipelineStreams();case 5:case"end":return e.stop()}}),n,this)})))}},{key:"initPipelineStreams",value:function(){for(var e=[],t=this.streams.filter((function(t){var n,r;return"NORMAL"===t.status&&((null===(n=t.stream)||void 0===n?void 0:n.getAudioTracks()[0])||e.push({type:"audio"}),(null===(r=t.stream)||void 0===r?void 0:r.getVideoTracks()[0])||e.push({type:"video"})),"NORMAL"===t.status})).length,n=1;n<=11-t;n++)e.push({type:"all"});var r=0;this.pipelineStreams=e.map((function(e){r++;var t=[{kind:"video"},{kind:"audio"}];return"all"!==e.type&&(t=[{kind:e.type}]),{stream:null,domStream:t,status:"DOMSTRING",type:"pipelineStream",resolution:"90"}})),this.logger.log("temp stream count:",r)}},{key:"initRemoteStreams",value:function(t){var n,r,i,o;return Rn(this,void 0,void 0,e().mark((function a(){var s,c,u,l,d,f,p,g=this;return e().wrap((function(a){for(;;)switch(a.prev=a.next){case 0:if(!t){a.next=29;break}if(!this.isFirefox){a.next=5;break}this.initFirefoxRemoteStreams(t),a.next=27;break;case 5:s=t.clone(),c=t.clone(),s.getAudioTracks().forEach((function(e){e.stop(),s.removeTrack(e)})),c.getAudioTracks().forEach((function(e){e.stop(),c.removeTrack(e)})),u={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},u),{stream:t}),Object.assign(Object.assign({},u),{stream:s,resolution:"360"}),Object.assign(Object.assign({},u),{stream:c,resolution:"720"})],l=v(this.streams.entries()),a.prev=12,f=e().mark((function t(){var a,s,c,u,l;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(a=h(d.value,2),s=a[0],c=a[1],!(u=null===(n=c.stream)||void 0===n?void 0:n.getVideoTracks()[0])){e.next=15;break}return e.prev=3,l=g.getPeopleContraints(Number(c.resolution)),e.next=7,u.applyConstraints(l);case 7:g.logger.log("init remote track constraints:",l,null===(r=c.stream)||void 0===r?void 0:r.id,u.getSettings()),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(3),g.logger.error("init remote track constraints failed:",e.t0,null===(i=c.stream)||void 0===i?void 0:i.id),g.streams[s].status="INVALID",null===(o=g.streams[s].stream)||void 0===o||o.getTracks().forEach((function(e){e.stop(),g.logger.log("disabled track",u.id)}));case 15:case"end":return e.stop()}}),t,null,[[3,10]])})),l.s();case 15:if((d=l.n()).done){a.next=19;break}return a.delegateYield(f(),"t0",17);case 17:a.next=15;break;case 19:a.next=24;break;case 21:a.prev=21,a.t1=a.catch(12),l.e(a.t1);case 24:return a.prev=24,l.f(),a.finish(24);case 27:a.next=32;break;case 29:p={stream:null,domStream:[{kind:"video"},{kind:"audio"}],status:"DOMSTRING",type:"remoteStream",resolution:"90"},this.streams=[Object.assign(Object.assign({},p),{resolution:"180"}),Object.assign(Object.assign({},p),{resolution:"360"}),Object.assign(Object.assign({},p),{resolution:"720"})],this.logger.log("None remote stream, init dom stream: ",this.streams);case 32:case"end":return a.stop()}}),a,this,[[12,21,24,27]])})))}},{key:"initFirefoxRemoteStreams",value:function(t){var n,r;return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:o=t.clone(),a=t.clone(),null===(n=o.getAudioTracks()[0])||void 0===n||n.stop(),null===(r=a.getAudioTracks()[0])||void 0===r||r.stop(),s={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},s),{stream:t,resolution:"720"}),Object.assign(Object.assign({},s),{stream:a,resolution:"360"}),Object.assign(Object.assign({},s),{stream:o})];case 6:case"end":return e.stop()}}),i,this)})))}},{key:"initPreviewStream",value:function(t){var n,r,i;return Rn(this,void 0,void 0,e().mark((function o(){var a,s;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!t){e.next=16;break}if(e.prev=1,a={stream:t.clone(),domStream:[],status:"NORMAL",type:"previewStream",resolution:"360"},this.isFirefox){e.next=6;break}return e.next=6,null===(r=null===(n=a.stream)||void 0===n?void 0:n.getVideoTracks()[0])||void 0===r?void 0:r.applyConstraints(this.getPeopleContraints(360));case 6:null===(i=a.stream)||void 0===i||i.getAudioTracks().forEach((function(e){e.stop()})),this.logger.log("init local stream successfully"),this.previewStreams=[a],e.next=14;break;case 11:e.prev=11,e.t0=e.catch(1),this.logger.error("init local constraints failed: ",e.t0);case 14:e.next=18;break;case 16:s={stream:null,domStream:[{kind:"video"}],status:"DOMSTRING",type:"previewStream",resolution:"360"},this.previewStreams=[s];case 18:case"end":return e.stop()}}),o,this,[[1,11]])})))}},{key:"setClientObj",value:function(e){this.client=e,this.updateDeviceByLocalStream()}},{key:"updateDeviceByLocalStream",value:function(){var e,t,n,r,i,o,a,s,c,u;if("NORMAL"===this.current.type||"AUDIO_ONLY"===this.current.type||"VIDEO_ONLY"===this.current.type){var l=null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getAudioTracks()[0],h=null===(t=this.previewStreams[0].stream)||void 0===t?void 0:t.getVideoTracks()[0],d=null==l?void 0:l.getSettings(),f=null==h?void 0:h.getSettings(),p={audioInput:d?{deviceId:d.deviceId||"",groupId:d.groupId||"",label:(null==l?void 0:l.label)||""}:{deviceId:(null===(r=null===(n=this.config)||void 0===n?void 0:n.devices)||void 0===r?void 0:r.audioInputValue)||"default",groupId:"",label:""},videoInput:f?{deviceId:f.deviceId||"",groupId:f.groupId||"",label:(null==h?void 0:h.label)||""}:{deviceId:(null===(o=null===(i=this.config)||void 0===i?void 0:i.devices)||void 0===o?void 0:o.videoInValue)||"",groupId:"",label:""},audioOutput:{deviceId:(null===(s=null===(a=this.config)||void 0===a?void 0:a.devices)||void 0===s?void 0:s.audioOutputValue)||"default",groupId:"",label:""}};this.logger.log("Cache preview stream device info by tracks: ",p),null===(u=null===(c=this.client)||void 0===c?void 0:c.deviceManager)||void 0===u||u.setCurrentUsedDevice(p)}}},{key:"getAudioLevel",value:function(e){var t=this;return new Promise((function(n,r){var i;if(e?i=e:t.streams.length&&(i=t.streams[0].stream),i&&!t.audioLevel)t.audioLevel=new kb(i),t.audioLevel.init(),n(t.audioLevel.getAudioLevel());else if(t.audioLevel){n(t.audioLevel.getAudioLevel())}else t.client&&(t.client.logger.warn("GetAudio level must need have local stream!"),r(Xl("XYSDK:950514")))}))}},{key:"clearAudioLevel",value:function(){this.audioLevel=null}},{key:"closeContentStream",value:function(){var e=this;if(this.logger.log("close content stream"),this.isShareContent){this.off("start-share-content"),this.off("stop-share-content"),this.contentStreams.forEach((function(t,n){var r;null===(r=t.stream)||void 0===r||r.getTracks().forEach((function(t){var r;t.stop(),t.onended=null,null===(r=e.contentStreams[n].stream)||void 0===r||r.removeTrack(t)})),e.contentStreams[n].status="INVALID"})),this.isShareContent=!1,this.logger.log("content stream closed successfully")}}},{key:"createContentStream",value:function(){var t,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{screenAudio:!1},r=n.screenAudio;return Rn(this,void 0,void 0,e().mark((function n(){var i,o;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(this.logger.log("[stream] createContentStream func"),!this.isShareContent){e.next=4;break}return this.logger.warn("Already share content!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950509")));case 4:return e.prev=4,r&&(null===(t=this.client)||void 0===t||t.setContentMode("BOTH")),this.createBaseContentStreams(),i={video:this.getContentContraints(1080),audio:r},this.logger.log("create content contraints:",i),e.next=11,navigator.mediaDevices.getDisplayMedia(i);case 11:return o=e.sent,e.next=14,this.dealCaptureStream(o);case 14:return this.logger.log("capture content stream success... "),e.abrupt("return",this.contentStreams);case 18:return e.prev=18,e.t0=e.catch(4),this.logger.error("capture content stream failed: ",e.t0),this.isShareContent=!1,e.abrupt("return",Promise.reject(this.handleCreateContentStreamError(e.t0)));case 23:case"end":return e.stop()}}),n,this,[[4,18]])})))}},{key:"electronCapture",value:function(e){var t=this;return new Promise((function(n,r){navigator.webkitGetUserMedia({audio:!1,video:{mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,minWidth:1920,maxWidth:1920,minHeight:1080,maxHeight:1080}}},(function(e){n(e)}),(function(e){t.logger.log("capture electron err: ",e),r(e)}))}))}},{key:"getElectronContentSources",value:function(t){var n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["window","screen"];return Rn(this,void 0,void 0,e().mark((function r(){var i;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,t.getSources({types:n});case 3:return i=e.sent,e.abrupt("return",i);case 7:return e.prev=7,e.t0=e.catch(0),e.abrupt("return",e.t0);case 10:case"end":return e.stop()}}),r,null,[[0,7]])})))}},{key:"createElectronContentStream",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(!this.isShareContent){e.next=3;break}return this.logger.warn("Already share content!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950509")));case 3:if(t){e.next=6;break}return this.logger.warn("No selected sourceId!"),e.abrupt("return",Promise.reject(Xl("XYSDK:950510")));case 6:return this.createBaseContentStreams(),e.prev=7,e.next=10,this.electronCapture(t);case 10:return r=e.sent,e.next=13,this.dealCaptureStream(r);case 13:return e.abrupt("return",this.contentStreams);case 16:return e.prev=16,e.t0=e.catch(7),this.logger.error("capture electron content stream failed: ",e.t0),this.isShareContent=!1,e.abrupt("return",this.handleCreateContentStreamError(e.t0));case 21:case"end":return e.stop()}}),n,this,[[7,16]])})))}},{key:"getPreviewStream",value:function(){var t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],n=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{video:{},audio:{}};return Rn(this,void 0,void 0,e().mark((function i(){var o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,o=r.video,a=void 0===o?{}:o,s=r.audio,c=void 0===s?{}:s,u={},t&&(u.video=Object.assign({},Fd,a)),n&&(u.audio=Object.assign({},c)),this.logger.log("get preview stream constraints:",u),e.next=8,this.getUserMedia(u);case 8:return l=e.sent,e.abrupt("return",l);case 12:return e.prev=12,e.t0=e.catch(0),h=this.handleCreateStreamError(e.t0),e.abrupt("return",Promise.reject(h));case 16:case"end":return e.stop()}}),i,this,[[0,12]])})))}},{key:"getUserMedia",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,this.logger.log("get user media constraints:",t),e.next=4,navigator.mediaDevices.getUserMedia(t);case 4:return r=e.sent,this.logger.log("get user media active:",r.active),e.abrupt("return",r);case 9:return e.prev=9,e.t0=e.catch(0),e.abrupt("return",Promise.reject(e.t0));case 12:case"end":return e.stop()}}),n,this,[[0,9]])})))}},{key:"handleCloseShareContentEvent",value:function(e,t){var n=this,r=!1,i=!1;e.onended=function(){(r=!0)&&i&&n.emmit("stop-share-content",{})},t.onended=function(){i=!0,r&&i&&n.emmit("stop-share-content",{})}}},{key:"dealCaptureStream",value:function(t){return Rn(this,void 0,void 0,e().mark((function n(){var r,i,o,a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=t.getVideoTracks()[0],i=r.clone(),o=this.getContentContraints(720),a=t.getAudioTracks()[0],e.prev=4,e.next=7,i.applyConstraints(o);case 7:e.next=13;break;case 9:e.prev=9,e.t0=e.catch(4),this.streams[1].status="INVALID",this.logger.error("set 720p content stream contraints error: ",e.t0);case 13:this.handleCloseShareContentEvent(r,i),this.updateContentStreamTrack(r,i,a),this.client&&this.client.applyShareContent(),this.logger.log("create share content stream: ",this.contentStreams);case 17:case"end":return e.stop()}}),n,this,[[4,9]])})))}},{key:"createBaseContentStreams",value:function(){if(this.isShareContent=!0,!this.contentStreams.length){var e=new MediaStream,t=new MediaStream;this.contentStreams=[{type:"contentStream",stream:e,domStream:[],status:"NORMAL",resolution:"1080"},{type:"contentStream",stream:t,domStream:[],status:"NORMAL",resolution:"720"}]}}},{key:"updateContentStreamTrack",value:function(e,t,n){var r=this;this.contentStreams=this.contentStreams.map((function(i){var o,a;return i.stream&&("1080"===i.resolution?i.stream.addTrack(e):(i.stream.addTrack(t),n&&(i.stream.addTrack(n),null===(o=r.client)||void 0===o||o.reSendContentOffer(),r.logger.log("content audio stream:",null===(a=i.stream)||void 0===a?void 0:a.id),r.logger.log("content audio track:",n.id)))),Object.assign(Object.assign({},i),{status:"NORMAL",isSupport:!0})}))}},{key:"handleCreateContentStreamError",value:function(e){var t=e.name,n=e.message;return Xl("NotAllowedError"===t?"Permission denied by system"===n?"XYSDK:950508":"Permission denied"===n?"XYSDK:950501":"XYSDK:950511":"InvalidStateError"===t?"XYSDK:950502":"AbortError"===t?"XYSDK:950503":"NotFoundError"===t?"XYSDK:950504":"NotReadableError"===t?"XYSDK:950505":"OverconstrainedError"===t?"XYSDK:950506":"TypeError"===t?"XYSDK:950507":"XYSDK:950503",e)}},{key:"handleCreateStreamError",value:function(e){var t={code:"",msg:"",detail:""};return t="NotFoundError"==e.name||"DevicesNotFoundError"==e.name?Xl("XYSDK:950401",e):"NotReadableError"==e.name||"TrackStartError"==e.name?Xl("XYSDK:950402",e):"OverconstrainedError"==e.name||"ConstraintNotSatisfiedError"==e.name?Xl("XYSDK:950403",e):"NotAllowedError"==e.name||"PermissionDeniedError"==e.name||e.message.includes("NotAllowedError")?Xl("XYSDK:950404",e):"TypeError"==e.name||"TypeError"==e.name?Xl("XYSDK:950405",e):Xl("XYSDK:950406",e),this.logger.error(t),t}}],[{key:"getStreamInstance",value:function(e){return this.instance||(this.instance=new a(e)),this.instance}},{key:"getContraints",value:function(){var e=!(arguments.length>0&&void 0!==arguments[0])||arguments[0],t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},r=a.getSupportConstraints(),i={},o={},s={audio:i,video:o},c=n.channelCount,u=void 0===c?1:c,l=n.autoGainControl,h=void 0===l||l,d=n.noiseSuppression,f=void 0===d||d,p=n.echoCancellation,v=void 0===p||p,g=n.frameRate,m=void 0===g?Fd.frameRate:g,y=n.aspectRatio,b=void 0===y?Fd.aspectRatio:y,S=n.resizeMode,w=void 0===S?Fd.resizeMode:S,k=n.width,C=void 0===k?Gd:k,E=n.height,x=void 0===E?jd:E,I={channelCount:u,autoGainControl:h,noiseSuppression:f,echoCancellation:v},_=Object.assign({aspectRatio:b,resizeMode:w,width:C,height:x},m&&{frameRate:m});return Object.keys(I).forEach((function(e){i[e]=I[e]})),Object.keys(_).forEach((function(e){r[e]&&(o[e]=_[e])})),s.audio=!!t&&i,s.video=!!e&&o,s}},{key:"getSupportConstraints",value:function(){var e={channelCount:!0,frameRate:!0,aspectRatio:!0,width:!0,height:!0};return navigator&&navigator.mediaDevices&&navigator.mediaDevices.getSupportedConstraints&&(e=navigator.mediaDevices.getSupportedConstraints()),e}}]),a}(),Eb="*********************************************************",xb={version:wf,client:null,checkSupportWebRTC:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c,u,l,h;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,Na.isSupportRTC();case 2:return n=e.sent,e.next=5,Na.isSupportUserMedia();case 5:return r=e.sent,i=Na.isSupportWebsocket(),o=Na.isMobile(),a=Na.isMinBrowser(),e.next=11,Na.isSupportH264();case 11:return s=e.sent,c=n.isSupportRTC,u=n.isSupportAddTransceiver,l=n.isSupportAddtrack,h={result:(a||o)&&c&&i&&s,detail:{isSupportRTC:c,isSupportWebsocket:i,isSupportBrowser:a,isSupportMobileBrowser:o,isSupportH264:s,isSupportAddTransceiver:u,isSupportAddtrack:l,isSupportUserMedia:r}},xb.logger.debug("desktop support result: ",h),e.abrupt("return",h);case 17:case"end":return e.stop()}}),t)})))},checkSupportMobileWebRTC:function(){return Rn(void 0,void 0,void 0,e().mark((function t(){var n,r,i,o,a,s,c;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return n=Na.isMobile(),e.next=3,xb.checkSupportWebRTC();case 3:return r=e.sent,i=r.detail,o=i.isSupportRTC,a=i.isSupportWebsocket,s=i.isSupportH264,c={result:n&&o&&a&&s,detail:Object.assign({},r.detail)},xb.logger.debug("mobile support result: ",c),e.abrupt("return",c);case 9:case"end":return e.stop()}}),t)})))},checkSupportShareContent:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)},setLocale:function(e){!function(e){Fl=["en_US","zh_CN","zh_TW"].find((function(t){return t.toUpperCase()===e.toUpperCase()}))||"zh_CN"}(e)},logger:new If,createClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{clientId:"",clientSecret:""},t=xb.logger,n=kf,r=Cf,i=Ef,o={wssServer:n,httpServer:r,logServer:i,layout:"AUTO",debug:!1,muteAudio:!1,muteVideo:!1,localHide:!1,localMirror:!0,isThird:!0,isVerifyMeetingId:!0,clientId:"",clientSecret:""},a=e.container||{},s=Object.assign(Object.assign(Object.assign({},o),e),{container:a}),c=s.wssServer,u=void 0===c?"":c,l=s.httpServer,h=void 0===l?"":l,d=s.logServer,f=void 0===d?"":d,p=s.clientId,v=void 0===p?"":p,g=s.clientSecret,m=void 0===g?"":g;xf.setBaseUrl(h,f),xf.setClientInfo({clientId:v,clientSecret:m});var y=new eg(s,{wssServer:u,httpServer:h,logServer:f},t);return xb.client=y,y},createStream:function(){var e=xb.logger;return new Cb({logger:e,client:xb.client})},setConfig:function(e){xf.setLoginInfo(e);var t=e||{},n=t.client_id,r=t.client_secret;n&&xf.setClientInfo({clientId:n,clientSecret:r})},closePreviewStream:function(t){return Rn(void 0,void 0,void 0,e().mark((function n(){return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t&&t.getTracks().forEach((function(e){e.enabled=!1,e.stop()}));case 1:case"end":return e.stop()}}),n)})))},setOutputAudioDevice:function(e,t){e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){})).catch((function(e){var t=e;"SecurityError"===(null==e?void 0:e.name)&&(t="You need to use HTTPS for selecting audio output device: ".concat(e)),console.error(t)})):console.warn("Browser does not support output device selection.")},render:(console.group("小鱼易连 WebRTC SDK"),console.info("%c".concat(Eb," \n\t\n * 欢迎使用 XY RTC SDK - 小鱼易连Web云视频 \n\t\n * 版本:").concat(wf," \n\t\n * 文档地址:https://openapi.xylink.com/common/meeting/doc/description?platform=web \n\t\n * 体验地址:https://cdn.xylink.com/webrtc/web/index.html \n\t\n * 问题反馈:https://github.com/xylink-com/xylink-rtc-demo/issues \n\t\n * 联系方式:luojinghui(luojinghui424@gmail.com) \n\n").concat(Eb),"color: #3876ff;"),console.info("%c[INFO] XY Agent:"+navigator.userAgent+"\n","color: #3876ff;"),void console.groupEnd())};window.xyRTC={logger:xb.logger},exports.Client=eg,exports.DeviceManager=ov,exports.ERROR_CODE=jl,exports.Stream=Cb,exports.default=xb,exports.detectLocator=function(t){var n=t.extId,r=t.clientId,i=t.clientSecret,o=t.httpServer;return Rn(void 0,void 0,void 0,e().mark((function t(){var a,s,c,u;return e().wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n&&r&&i||Promise.reject(Xl("XYSDK:950101")),a="",t.prev=2,t.next=5,xf.getEnterpriseId({extId:n,clientId:r,clientSecret:i,httpServer:o});case 5:if(!(s=t.sent)){t.next=21;break}return t.next=9,xf.locator({extId:s,clientId:r,clientSecret:i,httpServer:o});case 9:if(c=t.sent,!((u=c.filter((function(e){return"WebrtcSigGW"===e.serverName}))).length>0)){t.next=20;break}return t.prev=12,t.next=15,new Promise((function(t,n){var r=u.length;u.map((function(i){return Rn(void 0,void 0,void 0,e().mark((function o(){var a;return e().wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return a=i.innerIp.split(":")[0],e.prev=1,"https:",e.next=5,Md.get("".concat("https:","//").concat(a),{timeout:2e3});case 5:t(i.innerIp),e.next=12;break;case 8:e.prev=8,e.t0=e.catch(1),0===--r&&n("All promises were rejected");case 12:case"end":return e.stop()}}),o,null,[[1,8]])})))}))}));case 15:a=t.sent,t.next=20;break;case 18:t.prev=18,t.t0=t.catch(12);case 20:case 21:return t.abrupt("return",a);case 24:return t.prev=24,t.t1=t.catch(2),t.abrupt("return",Promise.reject(t.t1));case 27:case"end":return t.stop()}}),t,null,[[2,24],[12,18]])})))},exports.getLayoutItemState=Dv,exports.getLayoutRotateInfo=Lv,exports.getSendSupportedCodec=Pv,exports.getVideoInfoByRotaion=Nv;
|