@xylink/xy-rtc-sdk 2.0.1-beta.8 → 2.0.3-beta.11
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.MD +56 -22
- package/lib/index.cjs.js +1 -1
- package/lib/index.js +1 -1
- package/lib/src/action/index.d.ts +26 -6
- package/lib/src/enum/errorCode.d.ts +6 -0
- package/lib/src/enum/index.d.ts +77 -118
- package/lib/src/index.d.ts +20 -11
- package/lib/src/main/client.d.ts +429 -91
- package/lib/src/main/deviceManager.d.ts +31 -5
- package/lib/src/main/helper.d.ts +24 -5
- package/lib/src/main/layoutManager.d.ts +100 -45
- package/lib/src/main/peer.d.ts +173 -33
- package/lib/src/main/stream.d.ts +87 -23
- package/lib/src/main/videoManager.d.ts +3 -3
- package/lib/src/tools/browser.d.ts +18 -3
- package/lib/src/tools/config.d.ts +1 -1
- package/lib/src/tools/db.d.ts +1 -1
- package/lib/src/tools/detect.d.ts +6 -0
- package/lib/src/tools/emmitter.d.ts +4 -4
- package/lib/src/tools/enum.d.ts +4 -57
- package/lib/src/tools/httpClient.d.ts +15 -7
- package/lib/src/tools/i18n.d.ts +8 -0
- package/lib/src/tools/index.d.ts +1 -1
- package/lib/src/tools/logger.d.ts +110 -8
- package/lib/src/tools/socket.d.ts +5 -3
- package/lib/src/tools/utils.d.ts +6 -4
- package/lib/src/type/base.d.ts +29 -0
- package/lib/src/type/client.d.ts +923 -0
- package/lib/src/type/device.d.ts +77 -0
- package/lib/src/type/index.d.ts +8 -615
- package/lib/src/type/stream.d.ts +350 -0
- package/package.json +56 -33
- package/lib/src/test/main/client.d.ts +0 -2
package/lib/index.cjs.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
"use strict";function e(e){return e&&"object"==typeof e&&"default"in e?e.default:e}Object.defineProperty(exports,"__esModule",{value:!0});var t=e(require("stream")),n=e(require("crypto")),r="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function i(e,t){return e(t={exports:{}},t.exports),t.exports}var o=function(e){return e&&e.Math==Math&&e},a=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof r&&r)||Function("return this")(),s=function(e){try{return!!e()}catch(e){return!0}},u=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c={}.propertyIsEnumerable,l=Object.getOwnPropertyDescriptor,h={f:l&&!c.call({1:2},1)?function(e){var t=l(this,e);return!!t&&t.enumerable}:c},f=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},d={}.toString,p=function(e){return d.call(e).slice(8,-1)},v="".split,g=s((function(){return!Object("z").propertyIsEnumerable(0)}))?function(e){return"String"==p(e)?v.call(e,""):Object(e)}:Object,m=function(e){if(null==e)throw TypeError("Can't call method on "+e);return e},y=function(e){return g(m(e))},b=function(e){return"object"==typeof e?null!==e:"function"==typeof e},w=function(e,t){if(!b(e))return e;var n,r;if(t&&"function"==typeof(n=e.toString)&&!b(r=n.call(e)))return r;if("function"==typeof(n=e.valueOf)&&!b(r=n.call(e)))return r;if(!t&&"function"==typeof(n=e.toString)&&!b(r=n.call(e)))return r;throw TypeError("Can't convert object to primitive value")},k={}.hasOwnProperty,_=function(e,t){return k.call(e,t)},S=a.document,x=b(S)&&b(S.createElement),E=function(e){return x?S.createElement(e):{}},O=!u&&!s((function(){return 7!=Object.defineProperty(E("div"),"a",{get:function(){return 7}}).a})),C=Object.getOwnPropertyDescriptor,A={f:u?C:function(e,t){if(e=y(e),t=w(t,!0),O)try{return C(e,t)}catch(e){}if(_(e,t))return f(!h.f.call(e,t),e[t])}},I=function(e){if(!b(e))throw TypeError(String(e)+" is not an object");return e},T=Object.defineProperty,R={f:u?T:function(e,t,n){if(I(e),t=w(t,!0),I(n),O)try{return T(e,t,n)}catch(e){}if("get"in n||"set"in n)throw TypeError("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},L=u?function(e,t,n){return R.f(e,t,f(1,n))}:function(e,t,n){return e[t]=n,e},N=function(e,t){try{L(a,e,t)}catch(n){a[e]=t}return t},M=a["__core-js_shared__"]||N("__core-js_shared__",{}),P=Function.toString;"function"!=typeof M.inspectSource&&(M.inspectSource=function(e){return P.call(e)});var B,D,j,U=M.inspectSource,F=a.WeakMap,z="function"==typeof F&&/native code/.test(U(F)),H=i((function(e){(e.exports=function(e,t){return M[e]||(M[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.6.5",mode:"global",copyright:"© 2020 Denis Pushkarev (zloirock.ru)"})})),V=0,W=Math.random(),K=function(e){return"Symbol("+String(void 0===e?"":e)+")_"+(++V+W).toString(36)},q=H("keys"),G=function(e){return q[e]||(q[e]=K(e))},Y={},Z=a.WeakMap;if(z){var X=new Z,J=X.get,$=X.has,Q=X.set;B=function(e,t){return Q.call(X,e,t),t},D=function(e){return J.call(X,e)||{}},j=function(e){return $.call(X,e)}}else{var ee=G("state");Y[ee]=!0,B=function(e,t){return L(e,ee,t),t},D=function(e){return _(e,ee)?e[ee]:{}},j=function(e){return _(e,ee)}}var te={set:B,get:D,has:j,enforce:function(e){return j(e)?D(e):B(e,{})},getterFor:function(e){return function(t){var n;if(!b(t)||(n=D(t)).type!==e)throw TypeError("Incompatible receiver, "+e+" required");return n}}},ne=i((function(e){var t=te.get,n=te.enforce,r=String(String).split("String");(e.exports=function(e,t,i,o){var s=!!o&&!!o.unsafe,u=!!o&&!!o.enumerable,c=!!o&&!!o.noTargetGet;"function"==typeof i&&("string"!=typeof t||_(i,"name")||L(i,"name",t),n(i).source=r.join("string"==typeof t?t:"")),e!==a?(s?!c&&e[t]&&(u=!0):delete e[t],u?e[t]=i:L(e,t,i)):u?e[t]=i:N(t,i)})(Function.prototype,"toString",(function(){return"function"==typeof this&&t(this).source||U(this)}))})),re=a,ie=function(e){return"function"==typeof e?e:void 0},oe=function(e,t){return arguments.length<2?ie(re[e])||ie(a[e]):re[e]&&re[e][t]||a[e]&&a[e][t]},ae=Math.ceil,se=Math.floor,ue=function(e){return isNaN(e=+e)?0:(e>0?se:ae)(e)},ce=Math.min,le=function(e){return e>0?ce(ue(e),9007199254740991):0},he=Math.max,fe=Math.min,de=function(e,t){var n=ue(e);return n<0?he(n+t,0):fe(n,t)},pe=function(e){return function(t,n,r){var i,o=y(t),a=le(o.length),s=de(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}},ve={includes:pe(!0),indexOf:pe(!1)},ge=ve.indexOf,me=function(e,t){var n,r=y(e),i=0,o=[];for(n in r)!_(Y,n)&&_(r,n)&&o.push(n);for(;t.length>i;)_(r,n=t[i++])&&(~ge(o,n)||o.push(n));return o},ye=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],be=ye.concat("length","prototype"),we={f:Object.getOwnPropertyNames||function(e){return me(e,be)}},ke={f:Object.getOwnPropertySymbols},_e=oe("Reflect","ownKeys")||function(e){var t=we.f(I(e)),n=ke.f;return n?t.concat(n(e)):t},Se=function(e,t){for(var n=_e(t),r=R.f,i=A.f,o=0;o<n.length;o++){var a=n[o];_(e,a)||r(e,a,i(t,a))}},xe=/#|\.prototype\./,Ee=function(e,t){var n=Ce[Oe(e)];return n==Ie||n!=Ae&&("function"==typeof t?s(t):!!t)},Oe=Ee.normalize=function(e){return String(e).replace(xe,".").toLowerCase()},Ce=Ee.data={},Ae=Ee.NATIVE="N",Ie=Ee.POLYFILL="P",Te=Ee,Re=A.f,Le=function(e,t){var n,r,i,o,s,u=e.target,c=e.global,l=e.stat;if(n=c?a:l?a[u]||N(u,{}):(a[u]||{}).prototype)for(r in t){if(o=t[r],i=e.noTargetGet?(s=Re(n,r))&&s.value:n[r],!Te(c?r:u+(l?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;Se(o,i)}(e.sham||i&&i.sham)&&L(o,"sham",!0),ne(n,r,o,e)}},Ne=Object.keys||function(e){return me(e,ye)},Me=function(e){return Object(m(e))},Pe=Object.assign,Be=Object.defineProperty,De=!Pe||s((function(){if(u&&1!==Pe({b:1},Pe(Be({},"a",{enumerable:!0,get:function(){Be(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!=Pe({},e)[n]||"abcdefghijklmnopqrst"!=Ne(Pe({},t)).join("")}))?function(e,t){for(var n=Me(e),r=arguments.length,i=1,o=ke.f,a=h.f;r>i;)for(var s,c=g(arguments[i++]),l=o?Ne(c).concat(o(c)):Ne(c),f=l.length,d=0;f>d;)s=l[d++],u&&!a.call(c,s)||(n[s]=c[s]);return n}:Pe;Le({target:"Object",stat:!0,forced:Object.assign!==De},{assign:De});var je=function(e,t){var n=[][e];return!!n&&s((function(){n.call(null,t||function(){throw 1},1)}))},Ue=Object.defineProperty,Fe={},ze=function(e){throw e},He=function(e,t){if(_(Fe,e))return Fe[e];t||(t={});var n=[][e],r=!!_(t,"ACCESSORS")&&t.ACCESSORS,i=_(t,0)?t[0]:ze,o=_(t,1)?t[1]:void 0;return Fe[e]=!!n&&!s((function(){if(r&&!u)return!0;var e={length:-1};r?Ue(e,1,{enumerable:!0,get:ze}):e[1]=1,n.call(e,i,o)}))},Ve=ve.indexOf,We=[].indexOf,Ke=!!We&&1/[1].indexOf(1,-0)<0,qe=je("indexOf"),Ge=He("indexOf",{ACCESSORS:!0,1:0});Le({target:"Array",proto:!0,forced:Ke||!qe||!Ge},{indexOf:function(e){return Ke?We.apply(this,arguments)||0:Ve(this,e,arguments.length>1?arguments[1]:void 0)}});var Ye,Ze,Xe=function(e){if("function"!=typeof e)throw TypeError(String(e)+" is not a function");return e},Je=function(e,t,n){if(Xe(e),void 0===t)return e;switch(n){case 0:return function(){return e.call(t)};case 1:return function(n){return e.call(t,n)};case 2:return function(n,r){return e.call(t,n,r)};case 3:return function(n,r,i){return e.call(t,n,r,i)}}return function(){return e.apply(t,arguments)}},$e=Array.isArray||function(e){return"Array"==p(e)},Qe=!!Object.getOwnPropertySymbols&&!s((function(){return!String(Symbol())})),et=Qe&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,tt=H("wks"),nt=a.Symbol,rt=et?nt:nt&&nt.withoutSetter||K,it=function(e){return _(tt,e)||(Qe&&_(nt,e)?tt[e]=nt[e]:tt[e]=rt("Symbol."+e)),tt[e]},ot=it("species"),at=function(e,t){var n;return $e(e)&&("function"!=typeof(n=e.constructor)||n!==Array&&!$e(n.prototype)?b(n)&&null===(n=n[ot])&&(n=void 0):n=void 0),new(void 0===n?Array:n)(0===t?0:t)},st=[].push,ut=function(e){var t=1==e,n=2==e,r=3==e,i=4==e,o=6==e,a=5==e||o;return function(s,u,c,l){for(var h,f,d=Me(s),p=g(d),v=Je(u,c,3),m=le(p.length),y=0,b=l||at,w=t?b(s,m):n?b(s,0):void 0;m>y;y++)if((a||y in p)&&(f=v(h=p[y],y,d),e))if(t)w[y]=f;else if(f)switch(e){case 3:return!0;case 5:return h;case 6:return y;case 2:st.call(w,h)}else if(i)return!1;return o?-1:r||i?i:w}},ct={forEach:ut(0),map:ut(1),filter:ut(2),some:ut(3),every:ut(4),find:ut(5),findIndex:ut(6)},lt=oe("navigator","userAgent")||"",ht=a.process,ft=ht&&ht.versions,dt=ft&&ft.v8;dt?Ze=(Ye=dt.split("."))[0]+Ye[1]:lt&&(!(Ye=lt.match(/Edge\/(\d+)/))||Ye[1]>=74)&&(Ye=lt.match(/Chrome\/(\d+)/))&&(Ze=Ye[1]);var pt=Ze&&+Ze,vt=it("species"),gt=function(e){return pt>=51||!s((function(){var t=[];return(t.constructor={})[vt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},mt=ct.map,yt=gt("map"),bt=He("map");Le({target:"Array",proto:!0,forced:!yt||!bt},{map:function(e){return mt(this,e,arguments.length>1?arguments[1]:void 0)}});var wt="\t\n\v\f\r \u2028\u2029\ufeff",kt="["+wt+"]",_t=RegExp("^"+kt+kt+"*"),St=RegExp(kt+kt+"*$"),xt=function(e){return function(t){var n=String(m(t));return 1&e&&(n=n.replace(_t,"")),2&e&&(n=n.replace(St,"")),n}},Et={start:xt(1),end:xt(2),trim:xt(3)},Ot=Et.trim,Ct=a.parseInt,At=/^[+-]?0[Xx]/,It=8!==Ct(wt+"08")||22!==Ct(wt+"0x16")?function(e,t){var n=Ot(String(e));return Ct(n,t>>>0||(At.test(n)?16:10))}:Ct;Le({global:!0,forced:parseInt!=It},{parseInt:It});var Tt=function(){var e=I(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t};function Rt(e,t){return RegExp(e,t)}var Lt,Nt,Mt={UNSUPPORTED_Y:s((function(){var e=Rt("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),BROKEN_CARET:s((function(){var e=Rt("^r","gy");return e.lastIndex=2,null!=e.exec("str")}))},Pt=RegExp.prototype.exec,Bt=String.prototype.replace,Dt=Pt,jt=(Lt=/a/,Nt=/b*/g,Pt.call(Lt,"a"),Pt.call(Nt,"a"),0!==Lt.lastIndex||0!==Nt.lastIndex),Ut=Mt.UNSUPPORTED_Y||Mt.BROKEN_CARET,Ft=void 0!==/()??/.exec("")[1];(jt||Ft||Ut)&&(Dt=function(e){var t,n,r,i,o=this,a=Ut&&o.sticky,s=Tt.call(o),u=o.source,c=0,l=e;return a&&(-1===(s=s.replace("y","")).indexOf("g")&&(s+="g"),l=String(e).slice(o.lastIndex),o.lastIndex>0&&(!o.multiline||o.multiline&&"\n"!==e[o.lastIndex-1])&&(u="(?: "+u+")",l=" "+l,c++),n=new RegExp("^(?:"+u+")",s)),Ft&&(n=new RegExp("^"+u+"$(?!\\s)",s)),jt&&(t=o.lastIndex),r=Pt.call(a?n:o,l),a?r?(r.input=r.input.slice(c),r[0]=r[0].slice(c),r.index=o.lastIndex,o.lastIndex+=r[0].length):o.lastIndex=0:jt&&r&&(o.lastIndex=o.global?r.index+r[0].length:t),Ft&&r&&r.length>1&&Bt.call(r[0],n,(function(){for(i=1;i<arguments.length-2;i++)void 0===arguments[i]&&(r[i]=void 0)})),r});var zt=Dt;Le({target:"RegExp",proto:!0,forced:/./.exec!==zt},{exec:zt});var Ht=it("species"),Vt=!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")})),Wt="$0"==="a".replace(/./,"$0"),Kt=it("replace"),qt=!!/./[Kt]&&""===/./[Kt]("a","$0"),Gt=!s((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]})),Yt=function(e,t,n,r){var i=it(e),o=!s((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!s((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[Ht]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||"replace"===e&&(!Vt||!Wt||qt)||"split"===e&&!Gt){var u=/./[i],c=n(i,""[e],(function(e,t,n,r,i){return t.exec===zt?o&&!i?{done:!0,value:u.call(t,n,r)}:{done:!0,value:e.call(n,t,r)}:{done:!1}}),{REPLACE_KEEPS_$0:Wt,REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE:qt}),l=c[0],h=c[1];ne(String.prototype,e,l),ne(RegExp.prototype,i,2==t?function(e,t){return h.call(e,this,t)}:function(e){return h.call(e,this)})}r&&L(RegExp.prototype[i],"sham",!0)},Zt=function(e){return function(t,n){var r,i,o=String(m(t)),a=ue(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=o.charCodeAt(a))<55296||r>56319||a+1===s||(i=o.charCodeAt(a+1))<56320||i>57343?e?o.charAt(a):r:e?o.slice(a,a+2):i-56320+(r-55296<<10)+65536}},Xt={codeAt:Zt(!1),charAt:Zt(!0)},Jt=Xt.charAt,$t=function(e,t,n){return t+(n?Jt(e,t).length:1)},Qt=function(e,t){var n=e.exec;if("function"==typeof n){var r=n.call(e,t);if("object"!=typeof r)throw TypeError("RegExp exec method returned something other than an Object or null");return r}if("RegExp"!==p(e))throw TypeError("RegExp#exec called on incompatible receiver");return zt.call(e,t)};Yt("match",1,(function(e,t,n){return[function(t){var n=m(this),r=null==t?void 0:t[e];return void 0!==r?r.call(t,n):new RegExp(t)[e](String(n))},function(e){var r=n(t,e,this);if(r.done)return r.value;var i=I(e),o=String(this);if(!i.global)return Qt(i,o);var a=i.unicode;i.lastIndex=0;for(var s,u=[],c=0;null!==(s=Qt(i,o));){var l=String(s[0]);u[c]=l,""===l&&(i.lastIndex=$t(o,le(i.lastIndex),a)),c++}return 0===c?null:u}]}));var en,tn,nn,rn,on,an,sn,un,cn,ln,hn,fn,dn,pn,vn,gn,mn=(en=navigator.userAgent,tn=en.toLocaleLowerCase(),nn=navigator.platform.toUpperCase().indexOf("MAC")>=0||/macintosh|mac os x/i.test(en),rn=navigator.platform.toUpperCase().indexOf("LINUX")>=0,on=/(?:Windows Phone)/.test(en),an=/(?:SymbianOS)/.test(en)||on,sn=/(?:Android)/.test(en),un=/(?:Firefox)/.test(en),cn=/(?:Chrome|CriOS)/.test(en)&&!(en.indexOf("Edg")>-1),ln=en.indexOf("Edg")>-1,hn=en.indexOf("Safari")>-1&&!(en.indexOf("Chrome")>-1),fn=/iPad/i.test(en),dn=/(?:iPad|PlayBook)/.test(en)||sn&&!/(?:Mobile)/.test(en)||un&&/(?:Tablet)/.test(en),pn=/(?:iPhone)/.test(en)&&!dn,vn=!(pn||sn||an||fn),gn=en.indexOf("Baidu")>-1||en.indexOf("BIDUBrowser")>-1||en.indexOf("baiduboxapp")>-1,{isTablet:dn,isPhone:pn,isAndroid:sn,isPc:vn,isMac:nn,isChrome:cn,isLinux:rn,isFirefox:!!tn.match(/firefox/)||en.indexOf("Firefox")>-1,isBaidu:gn,isQQ:!!tn.match(/tencenttraveler/)||!!tn.match(/qqbrowse/)||en.indexOf("QQ/")>-1||en.indexOf("MicroMessenger")>-1,isOpera:en.indexOf("Opera")>-1||en.indexOf("OPR")>-1,isZhazha:en.indexOf("QihooBrowser")>-1||en.indexOf("QHBrowser")>-1||en.indexOf("360SE")>-1||en.indexOf("360EE")>-1||en.indexOf("LBBROWSER")>-1||en.indexOf("UC")>-1||en.indexOf("UBrowser")>-1||en.indexOf("UCWEB")>-1||en.indexOf("Quark")>-1||en.indexOf("MiuiBrowser")>-1||en.indexOf("AliApp(TB")>-1||en.indexOf("Weibo")>-1||en.indexOf("IqiyiApp")>-1||en.indexOf("HuaweiBrowser")>-1||en.indexOf("HUAWEI")>-1||en.indexOf("MetaSr")>-1||en.indexOf("Sogou")>-1||en.indexOf("SE")>-1||en.indexOf("Maxthon")>-1||en.indexOf("The world")>-1||en.indexOf("MetaSr")>-1||en.indexOf("2345Explorer")>-1||en.indexOf("TencentTraveler")>-1||en.indexOf("Mb2345Browser")>-1,isEdge:ln,isSafari:hn}),yn={isMinBrowser:function(){var e=!0,t=mn.isEdge,n=mn.isSafari;if(mn.isChrome){var r=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=r&&r.major>=72}else if(t){var i=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=i&&i.major>=80}else if(n){var o=function(){var e=navigator.userAgent.match(/Version\/([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=o&&o.major>=13}return e},isSupportRTC:function(){for(var e=!1,t=["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection","RTCIceGatherer"],n=0;n<t.length;n++){if(t[n]in window){e=!0;break}}return e&&(e=yn.isSupportPeerCB()),e},isSupportPeerCB:function(){if(RTCPeerConnection){var e,t=new RTCPeerConnection({iceServers:[]}),n=mn.isQQ,r=mn.isBaidu,i=mn.isOpera,o=mn.isZhazha,a=mn.isFirefox,s=mn.isSafari;return e=!(!(t.createDataChannel&&t.createAnswer&&t.createOffer&&t.addEventListener&&t.removeEventListener)||(n||r||i||o||a||s)),t.close(),e}return!1},isSupportWebsocket:function(){return!!window.WebSocket},isSupportMedia:function(){return!!navigator.mediaDevices}},bn=function(e,t,n){var r=w(t);r in e?R.f(e,r,f(0,n)):e[r]=n},wn=it("isConcatSpreadable"),kn=pt>=51||!s((function(){var e=[];return e[wn]=!1,e.concat()[0]!==e})),_n=gt("concat"),Sn=function(e){if(!b(e))return!1;var t=e[wn];return void 0!==t?!!t:$e(e)};Le({target:"Array",proto:!0,forced:!kn||!_n},{concat:function(e){var t,n,r,i,o,a=Me(this),s=at(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(o=-1===t?a:arguments[t],Sn(o)){if(u+(i=le(o.length))>9007199254740991)throw TypeError("Maximum allowed index exceeded");for(n=0;n<i;n++,u++)n in o&&bn(s,u,o[n])}else{if(u>=9007199254740991)throw TypeError("Maximum allowed index exceeded");bn(s,u++,o)}return s.length=u,s}});var xn,En=u?Object.defineProperties:function(e,t){I(e);for(var n,r=Ne(t),i=r.length,o=0;i>o;)R.f(e,n=r[o++],t[n]);return e},On=oe("document","documentElement"),Cn=G("IE_PROTO"),An=function(){},In=function(e){return"<script>"+e+"<\/script>"},Tn=function(){try{xn=document.domain&&new ActiveXObject("htmlfile")}catch(e){}var e,t;Tn=xn?function(e){e.write(In("")),e.close();var t=e.parentWindow.Object;return e=null,t}(xn):((t=E("iframe")).style.display="none",On.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(In("document.F=Object")),e.close(),e.F);for(var n=ye.length;n--;)delete Tn.prototype[ye[n]];return Tn()};Y[Cn]=!0;var Rn=Object.create||function(e,t){var n;return null!==e?(An.prototype=I(e),n=new An,An.prototype=null,n[Cn]=e):n=Tn(),void 0===t?n:En(n,t)},Ln=it("unscopables"),Nn=Array.prototype;null==Nn[Ln]&&R.f(Nn,Ln,{configurable:!0,value:Rn(null)});var Mn,Pn,Bn,Dn=function(e){Nn[Ln][e]=!0},jn={},Un=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),Fn=G("IE_PROTO"),zn=Object.prototype,Hn=Un?Object.getPrototypeOf:function(e){return e=Me(e),_(e,Fn)?e[Fn]:"function"==typeof e.constructor&&e instanceof e.constructor?e.constructor.prototype:e instanceof Object?zn:null},Vn=it("iterator"),Wn=!1;[].keys&&("next"in(Bn=[].keys())?(Pn=Hn(Hn(Bn)))!==Object.prototype&&(Mn=Pn):Wn=!0),null==Mn&&(Mn={}),_(Mn,Vn)||L(Mn,Vn,(function(){return this}));var Kn={IteratorPrototype:Mn,BUGGY_SAFARI_ITERATORS:Wn},qn=R.f,Gn=it("toStringTag"),Yn=function(e,t,n){e&&!_(e=n?e:e.prototype,Gn)&&qn(e,Gn,{configurable:!0,value:t})},Zn=Kn.IteratorPrototype,Xn=function(){return this},Jn=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return I(n),function(e){if(!b(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype")}(r),t?e.call(n,r):n.__proto__=r,n}}():void 0),$n=Kn.IteratorPrototype,Qn=Kn.BUGGY_SAFARI_ITERATORS,er=it("iterator"),tr=function(){return this},nr=function(e,t,n,r,i,o,a){!function(e,t,n){var r=t+" Iterator";e.prototype=Rn(Zn,{next:f(1,n)}),Yn(e,r,!1),jn[r]=Xn}(n,t,r);var s,u,c,l=function(e){if(e===i&&g)return g;if(!Qn&&e in p)return p[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,p=e.prototype,v=p[er]||p["@@iterator"]||i&&p[i],g=!Qn&&v||l(i),m="Array"==t&&p.entries||v;if(m&&(s=Hn(m.call(new e)),$n!==Object.prototype&&s.next&&(Hn(s)!==$n&&(Jn?Jn(s,$n):"function"!=typeof s[er]&&L(s,er,tr)),Yn(s,h,!0))),"values"==i&&v&&"values"!==v.name&&(d=!0,g=function(){return v.call(this)}),p[er]!==g&&L(p,er,g),jn[t]=g,i)if(u={values:l("values"),keys:o?g:l("keys"),entries:l("entries")},a)for(c in u)(Qn||d||!(c in p))&&ne(p,c,u[c]);else Le({target:t,proto:!0,forced:Qn||d},u);return u},rr=te.set,ir=te.getterFor("Array Iterator"),or=nr(Array,"Array",(function(e,t){rr(this,{type:"Array Iterator",target:y(e),index:0,kind:t})}),(function(){var e=ir(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");jn.Arguments=jn.Array,Dn("keys"),Dn("values"),Dn("entries"),Le({target:"Date",stat:!0},{now:function(){return(new Date).getTime()}});var ar=Date.prototype,sr=ar.toString,ur=ar.getTime;new Date(NaN)+""!="Invalid Date"&&ne(ar,"toString",(function(){var e=ur.call(this);return e==e?sr.call(this):"Invalid Date"}));var cr={};cr[it("toStringTag")]="z";var lr="[object z]"===String(cr),hr=it("toStringTag"),fr="Arguments"==p(function(){return arguments}()),dr=lr?p: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=Object(e),hr))?n:fr?p(t):"Object"==(r=p(t))&&"function"==typeof t.callee?"Arguments":r},pr=lr?{}.toString:function(){return"[object "+dr(this)+"]"};lr||ne(Object.prototype,"toString",pr,{unsafe:!0});var vr=a.Promise,gr=function(e,t,n){for(var r in t)ne(e,r,t[r],n);return e},mr=it("species"),yr=function(e){var t=oe(e),n=R.f;u&&t&&!t[mr]&&n(t,mr,{configurable:!0,get:function(){return this}})},br=function(e,t,n){if(!(e instanceof t))throw TypeError("Incorrect "+(n?n+" ":"")+"invocation");return e},wr=it("iterator"),kr=Array.prototype,_r=function(e){return void 0!==e&&(jn.Array===e||kr[wr]===e)},Sr=it("iterator"),xr=function(e){if(null!=e)return e[Sr]||e["@@iterator"]||jn[dr(e)]},Er=function(e,t,n,r){try{return r?t(I(n)[0],n[1]):t(n)}catch(t){var i=e.return;throw void 0!==i&&I(i.call(e)),t}},Or=i((function(e){var t=function(e,t){this.stopped=e,this.result=t};(e.exports=function(e,n,r,i,o){var a,s,u,c,l,h,f,d=Je(n,r,i?2:1);if(o)a=e;else{if("function"!=typeof(s=xr(e)))throw TypeError("Target is not iterable");if(_r(s)){for(u=0,c=le(e.length);c>u;u++)if((l=i?d(I(f=e[u])[0],f[1]):d(e[u]))&&l instanceof t)return l;return new t(!1)}a=s.call(e)}for(h=a.next;!(f=h.call(a)).done;)if("object"==typeof(l=Er(a,d,f.value,i))&&l&&l instanceof t)return l;return new t(!1)}).stop=function(e){return new t(!0,e)}})),Cr=it("iterator"),Ar=!1;try{var Ir=0,Tr={next:function(){return{done:!!Ir++}},return:function(){Ar=!0}};Tr[Cr]=function(){return this},Array.from(Tr,(function(){throw 2}))}catch(e){}var Rr,Lr,Nr,Mr=function(e,t){if(!t&&!Ar)return!1;var n=!1;try{var r={};r[Cr]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},Pr=it("species"),Br=function(e,t){var n,r=I(e).constructor;return void 0===r||null==(n=I(r)[Pr])?t:Xe(n)},Dr=/(iphone|ipod|ipad).*applewebkit/i.test(lt),jr=a.location,Ur=a.setImmediate,Fr=a.clearImmediate,zr=a.process,Hr=a.MessageChannel,Vr=a.Dispatch,Wr=0,Kr={},qr=function(e){if(Kr.hasOwnProperty(e)){var t=Kr[e];delete Kr[e],t()}},Gr=function(e){return function(){qr(e)}},Yr=function(e){qr(e.data)},Zr=function(e){a.postMessage(e+"",jr.protocol+"//"+jr.host)};Ur&&Fr||(Ur=function(e){for(var t=[],n=1;arguments.length>n;)t.push(arguments[n++]);return Kr[++Wr]=function(){("function"==typeof e?e:Function(e)).apply(void 0,t)},Rr(Wr),Wr},Fr=function(e){delete Kr[e]},"process"==p(zr)?Rr=function(e){zr.nextTick(Gr(e))}:Vr&&Vr.now?Rr=function(e){Vr.now(Gr(e))}:Hr&&!Dr?(Nr=(Lr=new Hr).port2,Lr.port1.onmessage=Yr,Rr=Je(Nr.postMessage,Nr,1)):!a.addEventListener||"function"!=typeof postMessage||a.importScripts||s(Zr)||"file:"===jr.protocol?Rr="onreadystatechange"in E("script")?function(e){On.appendChild(E("script")).onreadystatechange=function(){On.removeChild(this),qr(e)}}:function(e){setTimeout(Gr(e),0)}:(Rr=Zr,a.addEventListener("message",Yr,!1)));var Xr,Jr,$r,Qr,ei,ti,ni,ri,ii={set:Ur,clear:Fr},oi=A.f,ai=ii.set,si=a.MutationObserver||a.WebKitMutationObserver,ui=a.process,ci=a.Promise,li="process"==p(ui),hi=oi(a,"queueMicrotask"),fi=hi&&hi.value;fi||(Xr=function(){var e,t;for(li&&(e=ui.domain)&&e.exit();Jr;){t=Jr.fn,Jr=Jr.next;try{t()}catch(e){throw Jr?Qr():$r=void 0,e}}$r=void 0,e&&e.enter()},li?Qr=function(){ui.nextTick(Xr)}:si&&!Dr?(ei=!0,ti=document.createTextNode(""),new si(Xr).observe(ti,{characterData:!0}),Qr=function(){ti.data=ei=!ei}):ci&&ci.resolve?(ni=ci.resolve(void 0),ri=ni.then,Qr=function(){ri.call(ni,Xr)}):Qr=function(){ai.call(a,Xr)});var di,pi,vi,gi,mi=fi||function(e){var t={fn:e,next:void 0};$r&&($r.next=t),Jr||(Jr=t,Qr()),$r=t},yi=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=Xe(t),this.reject=Xe(n)},bi={f:function(e){return new yi(e)}},wi=function(e,t){if(I(e),b(t)&&t.constructor===e)return t;var n=bi.f(e);return(0,n.resolve)(t),n.promise},ki=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},_i=ii.set,Si=it("species"),xi="Promise",Ei=te.get,Oi=te.set,Ci=te.getterFor(xi),Ai=vr,Ii=a.TypeError,Ti=a.document,Ri=a.process,Li=oe("fetch"),Ni=bi.f,Mi=Ni,Pi="process"==p(Ri),Bi=!!(Ti&&Ti.createEvent&&a.dispatchEvent),Di=Te(xi,(function(){if(!(U(Ai)!==String(Ai))){if(66===pt)return!0;if(!Pi&&"function"!=typeof PromiseRejectionEvent)return!0}if(pt>=51&&/native code/.test(Ai))return!1;var e=Ai.resolve(1),t=function(e){e((function(){}),(function(){}))};return(e.constructor={})[Si]=t,!(e.then((function(){}))instanceof t)})),ji=Di||!Mr((function(e){Ai.all(e).catch((function(){}))})),Ui=function(e){var t;return!(!b(e)||"function"!=typeof(t=e.then))&&t},Fi=function(e,t,n){if(!t.notified){t.notified=!0;var r=t.reactions;mi((function(){for(var i=t.value,o=1==t.state,a=0;r.length>a;){var s,u,c,l=r[a++],h=o?l.ok:l.fail,f=l.resolve,d=l.reject,p=l.domain;try{h?(o||(2===t.rejection&&Wi(e,t),t.rejection=1),!0===h?s=i:(p&&p.enter(),s=h(i),p&&(p.exit(),c=!0)),s===l.promise?d(Ii("Promise-chain cycle")):(u=Ui(s))?u.call(s,f,d):f(s)):d(i)}catch(e){p&&!c&&p.exit(),d(e)}}t.reactions=[],t.notified=!1,n&&!t.rejection&&Hi(e,t)}))}},zi=function(e,t,n){var r,i;Bi?((r=Ti.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:t,reason:n},(i=a["on"+e])?i(r):"unhandledrejection"===e&&function(e,t){var n=a.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Hi=function(e,t){_i.call(a,(function(){var n,r=t.value;if(Vi(t)&&(n=ki((function(){Pi?Ri.emit("unhandledRejection",r,e):zi("unhandledrejection",e,r)})),t.rejection=Pi||Vi(t)?2:1,n.error))throw n.value}))},Vi=function(e){return 1!==e.rejection&&!e.parent},Wi=function(e,t){_i.call(a,(function(){Pi?Ri.emit("rejectionHandled",e):zi("rejectionhandled",e,t.value)}))},Ki=function(e,t,n,r){return function(i){e(t,n,i,r)}},qi=function(e,t,n,r){t.done||(t.done=!0,r&&(t=r),t.value=n,t.state=2,Fi(e,t,!0))},Gi=function(e,t,n,r){if(!t.done){t.done=!0,r&&(t=r);try{if(e===n)throw Ii("Promise can't be resolved itself");var i=Ui(n);i?mi((function(){var r={done:!1};try{i.call(n,Ki(Gi,e,r,t),Ki(qi,e,r,t))}catch(n){qi(e,r,n,t)}})):(t.value=n,t.state=1,Fi(e,t,!1))}catch(n){qi(e,{done:!1},n,t)}}};Di&&(Ai=function(e){br(this,Ai,xi),Xe(e),di.call(this);var t=Ei(this);try{e(Ki(Gi,this,t),Ki(qi,this,t))}catch(e){qi(this,t,e)}},(di=function(e){Oi(this,{type:xi,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=gr(Ai.prototype,{then:function(e,t){var n=Ci(this),r=Ni(Br(this,Ai));return r.ok="function"!=typeof e||e,r.fail="function"==typeof t&&t,r.domain=Pi?Ri.domain:void 0,n.parent=!0,n.reactions.push(r),0!=n.state&&Fi(this,n,!1),r.promise},catch:function(e){return this.then(void 0,e)}}),pi=function(){var e=new di,t=Ei(e);this.promise=e,this.resolve=Ki(Gi,e,t),this.reject=Ki(qi,e,t)},bi.f=Ni=function(e){return e===Ai||e===vi?new pi(e):Mi(e)},"function"==typeof vr&&(gi=vr.prototype.then,ne(vr.prototype,"then",(function(e,t){var n=this;return new Ai((function(e,t){gi.call(n,e,t)})).then(e,t)}),{unsafe:!0}),"function"==typeof Li&&Le({global:!0,enumerable:!0,forced:!0},{fetch:function(e){return wi(Ai,Li.apply(a,arguments))}}))),Le({global:!0,wrap:!0,forced:Di},{Promise:Ai}),Yn(Ai,xi,!1),yr(xi),vi=oe(xi),Le({target:xi,stat:!0,forced:Di},{reject:function(e){var t=Ni(this);return t.reject.call(void 0,e),t.promise}}),Le({target:xi,stat:!0,forced:Di},{resolve:function(e){return wi(this,e)}}),Le({target:xi,stat:!0,forced:ji},{all:function(e){var t=this,n=Ni(t),r=n.resolve,i=n.reject,o=ki((function(){var n=Xe(t.resolve),o=[],a=0,s=1;Or(e,(function(e){var u=a++,c=!1;o.push(void 0),s++,n.call(t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=Ni(t),r=n.reject,i=ki((function(){var i=Xe(t.resolve);Or(e,(function(e){i.call(t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Yi=Xt.charAt,Zi=te.set,Xi=te.getterFor("String Iterator");nr(String,"String",(function(e){Zi(this,{type:"String Iterator",string:String(e),index:0})}),(function(){var e,t=Xi(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Yi(n,r),t.index+=e.length,{value:e,done:!1})}));var Ji={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},$i=it("iterator"),Qi=it("toStringTag"),eo=or.values;for(var to in Ji){var no=a[to],ro=no&&no.prototype;if(ro){if(ro[$i]!==eo)try{L(ro,$i,eo)}catch(e){ro[$i]=eo}if(ro[Qi]||L(ro,Qi,to),Ji[to])for(var io in or)if(ro[io]!==or[io])try{L(ro,io,or[io])}catch(e){ro[io]=or[io]}}}i((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n,r){var i=t&&t.prototype instanceof l?t:l,o=Object.create(i.prototype),a=new _(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 x()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=b(a,n);if(s){if(s===c)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 l=u(e,t,n);if("normal"===l.type){if(r=n.done?"completed":"suspendedYield",l.arg===c)continue;return{value:l.arg,done:n.done}}"throw"===l.type&&(r="completed",n.method="throw",n.arg=l.arg)}}}(e,n,a),o}function u(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=s;var c={};function l(){}function h(){}function f(){}var d={};d[i]=function(){return this};var p=Object.getPrototypeOf,v=p&&p(p(S([])));v&&v!==t&&n.call(v,i)&&(d=v);var g=f.prototype=l.prototype=Object.create(d);function m(e){["next","throw","return"].forEach((function(t){e[t]=function(e){return this._invoke(t,e)}}))}function y(e,t){var r;this._invoke=function(i,o){function a(){return new t((function(r,a){!function r(i,o,a,s){var c=u(e[i],e,o);if("throw"!==c.type){var l=c.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(c.arg)}(i,o,r,a)}))}return r=r?r.then(a,a):a()}}function b(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,b(e,t),"throw"===t.method))return c;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return c}var r=u(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,c;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,c):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,c)}function w(e){var t={tryLoc:e[0]};1 in e&&(t.catchLoc=e[1]),2 in e&&(t.finallyLoc=e[2],t.afterLoc=e[3]),this.tryEntries.push(t)}function k(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function _(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(w,this),this.reset(!0)}function S(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:x}}function x(){return{value:void 0,done:!0}}return h.prototype=g.constructor=f,f.constructor=h,f[a]=h.displayName="GeneratorFunction",e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===h||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,a in e||(e[a]="GeneratorFunction")),e.prototype=Object.create(g),e},e.awrap=function(e){return{__await:e}},m(y.prototype),y.prototype[o]=function(){return this},e.AsyncIterator=y,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new y(s(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},m(g),g[a]="Generator",g[i]=function(){return this},g.toString=function(){return"[object Generator]"},e.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}},e.values=S,_.prototype={constructor:_,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(k),!e)for(var t in this)"t"===t.charAt(0)&&n.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 r(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 r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.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,c):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),c},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),k(n),c}},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;k(n)}return i}}throw new Error("illegal catch attempt")},delegateYield:function(e,t,n){return this.delegate={iterator:S(e),resultName:t,nextLoc:n},"next"===this.method&&(this.arg=void 0),c}},e}(e.exports);try{regeneratorRuntime=t}catch(e){Function("r","regeneratorRuntime = r")(t)}}));function oo(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function ao(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 so(e,t,n){return t&&ao(e.prototype,t),n&&ao(e,n),e}function uo(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&lo(e,t)}function co(e){return(co=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function lo(e,t){return(lo=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ho(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(e){return!1}}function fo(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function po(e,t){return!t||"object"!=typeof t&&"function"!=typeof t?fo(e):t}function vo(e){return function(){var t,n=co(e);if(ho()){var r=co(this).constructor;t=Reflect.construct(n,arguments,r)}else t=n.apply(this,arguments);return po(this,t)}}function go(e,t){return function(e){if(Array.isArray(e))return e}(e)||function(e,t){if("undefined"==typeof Symbol||!(Symbol.iterator in Object(e)))return;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||null==s.return||s.return()}finally{if(i)throw o}}return n}(e,t)||yo(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 mo(e){return function(e){if(Array.isArray(e))return bo(e)}(e)||function(e){if("undefined"!=typeof Symbol&&Symbol.iterator in Object(e))return Array.from(e)}(e)||yo(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 yo(e,t){if(e){if("string"==typeof e)return bo(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(n):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?bo(e,t):void 0}}function bo(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 wo(e){if("undefined"==typeof Symbol||null==e[Symbol.iterator]){if(Array.isArray(e)||(e=yo(e))){var t=0,n=function(){};return{s:n,n:function(){return t>=e.length?{done:!0}:{done:!1,value:e[t++]}},e:function(e){throw e},f:n}}throw new TypeError("Invalid attempt to iterate non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")}var r,i,o=!0,a=!1;return{s:function(){r=e[Symbol.iterator]()},n:function(){var e=r.next();return o=e.done,e},e:function(e){a=!0,i=e},f:function(){try{o||null==r.return||r.return()}finally{if(a)throw i}}}}function ko(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}var _o=Object.keys,So=Array.isArray,xo="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function Eo(e,t){return"object"!=typeof t||_o(t).forEach((function(n){e[n]=t[n]})),e}var Oo=Object.getPrototypeOf,Co={}.hasOwnProperty;function Ao(e,t){return Co.call(e,t)}function Io(e,t){"function"==typeof t&&(t=t(Oo(e))),_o(t).forEach((function(n){Ro(e,n,t[n])}))}var To=Object.defineProperty;function Ro(e,t,n,r){To(e,t,Eo(n&&Ao(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function Lo(e){return{from:function(t){return e.prototype=Object.create(t.prototype),Ro(e.prototype,"constructor",e),{extend:Io.bind(null,e.prototype)}}}}var No=Object.getOwnPropertyDescriptor;var Mo=[].slice;function Po(e,t,n){return Mo.call(e,t,n)}function Bo(e,t){return t(e)}function Do(e){if(!e)throw new Error("Assertion Failed")}function jo(e){xo.setImmediate?setImmediate(e):setTimeout(e,0)}function Uo(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function Fo(e,t){return function(){try{e.apply(this,arguments)}catch(e){t(e)}}}function zo(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}function Ho(e,t){if(Ao(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=Ho(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:Ho(s,t.substr(a+1))}}function Vo(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){Do("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)Vo(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 u=e[a];u||(u=e[a]={}),Vo(u,s,n)}}else void 0===n?delete e[t]:e[t]=n}}function Wo(e){var t={};for(var n in e)Ao(e,n)&&(t[n]=e[n]);return t}var Ko=[].concat;function qo(e){return Ko.apply([],e)}var Go="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(qo([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return xo[e]})).map((function(e){return xo[e]}));function Yo(e){if(!e||"object"!=typeof e)return e;var t;if(So(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(Yo(e[n]))}else if(Go.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)Ao(e,i)&&(t[i]=Yo(e[i]));return t}function Zo(e,t,n,r){return n=n||{},r=r||"",_o(e).forEach((function(i){if(Ao(t,i)){var o=e[i],a=t[i];"object"==typeof o&&"object"==typeof a&&o&&a&&""+o.constructor==""+a.constructor?Zo(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else n[r+i]=void 0})),_o(t).forEach((function(i){Ao(e,i)||(n[r+i]=t[i])})),n}var Xo="undefined"!=typeof Symbol&&Symbol.iterator,Jo=Xo?function(e){var t;return null!=e&&(t=e[Xo])&&t.apply(e)}:function(){return null},$o={};function Qo(e){var t,n,r,i;if(1===arguments.length){if(So(e))return e.slice();if(this===$o&&"string"==typeof e)return[e];if(i=Jo(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 ea="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function ta(e,t){ea=e,na=t}var na=function(){return!0},ra=!new Error("").stack;function ia(){if(ra)try{throw ia.arguments,new Error}catch(e){return e}return new Error}function oa(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(na).map((function(e){return"\n"+e})).join("")):""}var aa=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],sa=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(aa),ua={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function ca(e,t){this._e=ia(),this.name=e,this.message=t}function la(e,t,n,r){this._e=ia(),this.failures=t,this.failedKeys=r,this.successCount=n}function ha(e,t){this._e=ia(),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)}Lo(ca).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+oa(this._e,2))}},toString:function(){return this.name+": "+this.message}}),Lo(la).from(ca),Lo(ha).from(ca);var fa=sa.reduce((function(e,t){return e[t]=t+"Error",e}),{}),da=ca,pa=sa.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=ia(),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=ua[t]||n,this.inner=null)}return Lo(r).from(da),e[t]=r,e}),{});pa.Syntax=SyntaxError,pa.Type=TypeError,pa.Range=RangeError;var va=aa.reduce((function(e,t){return e[t+"Error"]=pa[t],e}),{});var ga=sa.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=pa[t]),e}),{});function ma(){}function ya(e){return e}function ba(e,t){return null==e||e===ya?t:function(n){return t(e(n))}}function wa(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function ka(e,t){return e===ma?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?wa(r,this.onsuccess):r),i&&(this.onerror=this.onerror?wa(i,this.onerror):i),void 0!==o?o:n}}function _a(e,t){return e===ma?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?wa(n,this.onsuccess):n),r&&(this.onerror=this.onerror?wa(r,this.onerror):r)}}function Sa(e,t){return e===ma?t:function(n){var r=e.apply(this,arguments);Eo(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?wa(i,this.onsuccess):i),o&&(this.onerror=this.onerror?wa(o,this.onerror):o),void 0===r?void 0===a?void 0:a:Eo(r,a)}}function xa(e,t){return e===ma?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function Ea(e,t){return e===ma?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)}}ga.ModifyError=la,ga.DexieError=ca,ga.BulkError=ha;var Oa={},Ca=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=xo.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),Aa=Ca[0],Ia=Ca[1],Ta=Ca[2],Ra=Ia&&Ia.then,La=Aa&&Aa.constructor,Na=Ca[3],Ma=!!Ta,Pa=!1,Ba=Ta?function(){Ta.then(is)}:xo.setImmediate?setImmediate.bind(null,is):xo.MutationObserver?function(){var e=document.createElement("div");new MutationObserver((function(){is(),e=null})).observe(e,{attributes:!0}),e.setAttribute("i","1")}:function(){setTimeout(is,0)},Da=function(e,t){qa.push([e,t]),Ua&&(Ba(),Ua=!1)},ja=!0,Ua=!0,Fa=[],za=[],Ha=null,Va=ya,Wa={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:Cs,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{Cs(e[0],e[1])}catch(e){}}))}},Ka=Wa,qa=[],Ga=0,Ya=[];function Za(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=ma,this._lib=!1;var t=this._PSD=Ka;if(ea&&(this._stackHolder=ia(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==Oa)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Qa(this,this._value))}this._state=null,this._value=null,++t.ref,$a(this,e)}var Xa={get:function(){var e=Ka,t=ps;function n(n,r){var i=this,o=!e.global&&(e!==Ka||t!==ps);o&&ys();var a=new Za((function(t,a){ts(i,new Ja(Es(n,e,o),Es(r,e,o),t,a,e))}));return ea&&rs(a,this),a}return n.prototype=Oa,n},set:function(e){Ro(this,"then",e&&e.prototype===Oa?Xa:{get:function(){return e},set:Xa.set})}};function Ja(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 $a(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&&os();t&&"function"==typeof t.then?$a(e,(function(e,n){t instanceof Za?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,es(e)),n&&as()}}),Qa.bind(null,e))}catch(t){Qa(e,t)}}function Qa(e,t){if(za.push(t),null===e._state){var n=e._lib&&os();t=Va(t),e._state=!1,e._value=t,ea&&null!==t&&"object"==typeof t&&!t._promise&&zo((function(){var n=function e(t,n){var r;return No(t,n)||(r=Oo(t))&&e(r,n)}(t,"stack");t._promise=e,Ro(t,"stack",{get:function(){return Pa?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){Fa.some((function(t){return t._value===e._value}))||Fa.push(e)}(e),es(e),n&&as()}}function es(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)ts(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===Ga&&(++Ga,Da((function(){0==--Ga&&ss()}),[]))}function ts(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,++Ga,Da(ns,[n,e,t])}else e._listeners.push(t)}function ns(e,t,n){try{Ha=t;var r,i=t._value;t._state?r=e(i):(za.length&&(za=[]),r=e(i),-1===za.indexOf(i)&&function(e){var t=Fa.length;for(;t;)if(Fa[--t]._value===e._value)return void Fa.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{Ha=null,0==--Ga&&ss(),--n.psd.ref||n.psd.finalize()}}function rs(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function is(){os()&&as()}function os(){var e=ja;return ja=!1,Ua=!1,e}function as(){var e,t,n;do{for(;qa.length>0;)for(e=qa,qa=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(qa.length>0);ja=!0,Ua=!0}function ss(){var e=Fa;Fa=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Ya.slice(0),n=t.length;n;)t[--n]()}function us(e){return new Za(Oa,!1,e)}function cs(e,t){var n=Ka;return function(){var r=os(),i=Ka;try{return _s(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{_s(i,!1),r&&as()}}}Io(Za.prototype,{then:Xa,_then:function(e,t){ts(this,new Ja(null,null,e,t,Ka))},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):us(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):us(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),us(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{Pa=!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=oa(s,0)):(o=s,a=""),n.push(o+(a?": "+a:"")+i)}ea&&((i=oa(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{Pa=!1}}},timeout:function(e,t){var n=this;return e<1/0?new Za((function(r,i){var o=setTimeout((function(){return i(new pa.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&Ro(Za.prototype,Symbol.toStringTag,"Promise"),Wa.env=Ss(),Io(Za,{all:function(){var e=Qo.apply(null,arguments).map(bs);return new Za((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return Za.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof Za)return e;if(e&&"function"==typeof e.then)return new Za((function(t,n){e.then(t,n)}));var t=new Za(Oa,!0,e);return rs(t,Ha),t},reject:us,race:function(){var e=Qo.apply(null,arguments).map(bs);return new Za((function(t,n){e.map((function(e){return Za.resolve(e).then(t,n)}))}))},PSD:{get:function(){return Ka},set:function(e){return Ka=e}},newPSD:gs,usePSD:xs,scheduler:{get:function(){return Da},set:function(e){Da=e}},rejectionMapper:{get:function(){return Va},set:function(e){Va=e}},follow:function(e,t){return new Za((function(n,r){return gs((function(t,n){var r=Ka;r.unhandleds=[],r.onunhandled=n,r.finalize=wa((function(){var e=this;!function(e){Ya.push((function t(){e(),Ya.splice(Ya.indexOf(t),1)})),++Ga,Da((function(){0==--Ga&&ss()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}});var ls={awaits:0,echoes:0,id:0},hs=0,fs=[],ds=0,ps=0,vs=0;function gs(e,t,n,r){var i=Ka,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++vs;var a=Wa.env;o.env=Ma?{Promise:Za,PromiseProp:{value:Za,configurable:!0,writable:!0},all:Za.all,race:Za.race,resolve:Za.resolve,reject:Za.reject,nthen:Os(a.nthen,o),gthen:Os(a.gthen,o)}:{},t&&Eo(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=xs(o,e,n,r);return 0===o.ref&&o.finalize(),s}function ms(){return ls.id||(ls.id=++hs),++ls.awaits,ls.echoes+=7,ls.id}function ys(e){!ls.awaits||e&&e!==ls.id||(0==--ls.awaits&&(ls.id=0),ls.echoes=7*ls.awaits)}function bs(e){return ls.echoes&&e&&e.constructor===La?(ms(),e.then((function(e){return ys(),e}),(function(e){return ys(),As(e)}))):e}function ws(e){++ps,ls.echoes&&0!=--ls.echoes||(ls.echoes=ls.id=0),fs.push(Ka),_s(e,!0)}function ks(){var e=fs[fs.length-1];fs.pop(),_s(e,!1)}function _s(e,t){var n,r=Ka;if((t?!ls.echoes||ds++&&e===Ka:!ds||--ds&&e===Ka)||(n=t?ws.bind(null,e):ks,Ra.call(Aa,n)),e!==Ka&&(Ka=e,r===Wa&&(Wa.env=Ss()),Ma)){var i=Wa.env.Promise,o=e.env;Ia.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(xo,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function Ss(){var e=xo.Promise;return Ma?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(xo,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:Ia.then,gthen:e.prototype.then}:{}}function xs(e,t,n,r,i){var o=Ka;try{return _s(e,!0),t(n,r,i)}finally{_s(o,!1)}}function Es(e,t,n){return"function"!=typeof e?e:function(){var r=Ka;n&&ms(),_s(t,!0);try{return e.apply(this,arguments)}finally{_s(r,!1)}}}function Os(e,t){return function(n,r){return e.call(this,Es(n,t,!1),Es(r,t,!1))}}function Cs(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(xo.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),Eo(r,i)):xo.CustomEvent&&Eo(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&xo.dispatchEvent&&(dispatchEvent(r),!xo.PromiseRejectionEvent&&xo.onunhandledrejection))try{xo.onunhandledrejection(r)}catch(e){}r.defaultPrevented||console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var As=Za.reject;function Is(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=xa),i||(i=ma);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){_o(e).forEach((function(t){var n=e[t];if(So(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new pa.InvalidArgument("Invalid event config");var r=o(t,ya,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){jo((function(){e.apply(null,t)}))}))}))}}))}}var Ts,Rs=String.fromCharCode(65535),Ls=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(e){return Rs}}(),Ns="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",Ms=[],Ps="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),Bs=Ps,Ds=Ps,js=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)};function Us(e,t){var n,r,i,o,a,s=Us.dependencies,u=Eo({addons:Us.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange},t),c=u.addons,l=u.autoOpen,h=u.indexedDB,f=u.IDBKeyRange,d=this._dbSchema={},p=[],v=[],g={},m=null,y=null,b=!1,w=null,k=!1,_="readwrite",S=this,x=new Za((function(e){n=e})),E=new Za((function(e,t){r=t})),O=!0,C=!!Xs(h);function A(e){this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null},this.stores({})}function I(e,t,n){var r=S._createTransaction(_,v,d);r.create(t),r._completion.catch(n);var i=r._reject.bind(r);gs((function(){Ka.trans=r,0===e?(_o(d).forEach((function(e){T(t,e,d[e].primKey,d[e].indexes)})),Za.follow((function(){return S.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 pa.Upgrade("Dexie specification of currently installed DB version is missing");d=S._dbSchema=i._cfg.dbschema;var o=!1;function a(){return r.length?Za.resolve(r.shift()(t.idbtrans)).then(a):Za.resolve()}return p.filter((function(t){return t._cfg.version>e})).forEach((function(e){r.push((function(){var r=d,i=e._cfg.dbschema;X(r,n),X(i,n),d=S._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,u=o.idxByName;for(var c in s)u[c]||a.del.push(c);for(c in u){var l=s[c],h=u[c];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){T(n,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new pa.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){R(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),R(t,e)})),e.del.forEach((function(e){t.deleteIndex(e)}))})),e._cfg.contentUpgrade)return o=!0,Za.follow((function(){e._cfg.contentUpgrade(t)}))})),r.push((function(t){o&&Bs||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){_o(e).forEach((function(n){t.db.objectStoreNames.contains(n)||T(t,n,e[n].primKey,e[n].indexes)}))}(d,n)}))}(e,r,t).catch(i)}))}function T(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){R(i,e)})),i}function R(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function L(e,t,n){var r=arguments.length;if(r<2)throw new pa.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=qo(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:Is(null,{creating:[ka,ma],reading:[ba,ya],updating:[Sa,ma],deleting:[_a,ma]})}function M(e,t,n){return(n?Ws:Hs)((function(n){e.push(n),t&&t()}))}function P(e,t,n,r,i){return new Za((function(o,a){var s=n.length,u=s-1;if(0===s)return o();if(r){var c,l=Ws(a),h=zs(null);zo((function(){for(var r=0;r<s;++r){c={onsuccess:null,onerror:null};var a=n[r];i.call(c,a[0],a[1],t);var f=e.delete(a[0]);f._hookCtx=c,f.onerror=l,f.onsuccess=r===u?zs(o):h}}),(function(e){throw c.onerror&&c.onerror(e),e}))}else for(var f=0;f<s;++f){var d=e.delete(n[f]);d.onerror=Hs(a),f===u&&(d.onsuccess=cs((function(){return o()})))}}))}function B(e,t,n,r){var i=this;this.db=S,this.mode=e,this.storeNames=t,this.idbtrans=null,this.on=Is(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 Za((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(),As(e)}))}function D(e,t,n){this._ctx={table:e,index:":id"===t?null:t,or:n}}function j(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 U(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function F(e,t){return e._cfg.version-t._cfg.version}function z(e,t,n){t.forEach((function(t){var r=n[t];e.forEach((function(e){t in e||(e===B.prototype||e instanceof B?Ro(e,t,{get:function(){return this.table(t)}}):e[t]=new N(t,r))}))}))}function H(e,t,n,r,i,o){var a=cs(o?function(e,t,r){return n(o(e),t,r)}:n,i);e.onerror||(e.onerror=Hs(i)),e.onsuccess=Fo(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 V(e,t){return h.cmp(e,t)}function W(e,t){return V(e,t)>0?e:t}function K(e,t){return h.cmp(e,t)}function q(e,t){return h.cmp(t,e)}function G(e,t){return e<t?-1:e===t?0:1}function Y(e,t){return e>t?-1:e===t?0:1}function Z(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function X(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 u=a.indexNames[s],c=a.index(u).keyPath,l="string"==typeof c?c:"["+Po(c).join("+")+"]";if(e[o]){var h=e[o].idxByName[l];h&&(h.name=u)}}}/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&xo.WorkerGlobalScope&&xo instanceof xo.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(i=!1)}function J(e){S.on("blocked").fire(e),Ms.filter((function(e){return e.name===S.name&&e!==S&&!e._vcFired})).map((function(t){return t.on("versionchange").fire(e)}))}this.version=function(e){if(m||b)throw new pa.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(F),O=!1,t)},Eo(A.prototype,{stores:function(e){this._cfg.storesSource=this._cfg.storesSource?Eo(this._cfg.storesSource,e):e;var t={};p.forEach((function(e){Eo(t,e._cfg.storesSource)}));var n=this._cfg.dbschema={};return this._parseStoresSpec(t,n),d=S._dbSchema=n,[g,S,B.prototype].forEach((function(e){for(var t in e)e[t]instanceof N&&delete e[t]})),z([g,S,B.prototype,this._cfg.tables],_o(n),n),v=_o(n),this},upgrade:function(e){return this._cfg.contentUpgrade=e,this},_parseStoresSpec:function(e,t){_o(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 Gs(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),So(r),/\./.test(e)))})),t}(e[n]),o=i.shift();if(o.multi)throw new pa.Schema("Primary key cannot be multi-valued");o.keyPath&&Vo(r,o.keyPath,o.auto?0:o.keyPath),i.forEach((function(e){if(e.auto)throw new pa.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new pa.Schema("Index must have a name and cannot be an empty string");Vo(r,e.keyPath,e.compound?e.keyPath.map((function(){return""})):"")})),t[n]=new Ys(n,o,i,r)}}))}}),this._allTables=g,this._createTransaction=function(e,t,n,r){return new B(e,t,n,r)},this._whenReady=function(e){return k||Ka.letThrough?e():new Za((function(e,t){if(!b){if(!l)return void t(new pa.DatabaseClosed);S.open().catch(ma)}x.then(e,t)})).then(e)},this.verno=0,this.open=function(){if(b||m)return x.then((function(){return y?As(y):S}));ea&&(E._stackHolder=ia()),b=!0,y=null,k=!1;var t=n,r=null;return Za.race([E,new Za((function(t,n){if(!h)throw new pa.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=O?h.open(e):h.open(e,Math.round(10*S.verno));if(!i)throw new pa.MissingAPI("IndexedDB API not available");i.onerror=Hs(n),i.onblocked=cs(J),i.onupgradeneeded=cs((function(t){if(r=i.transaction,O&&!S._allowEmptyDB){i.onerror=Ks,r.abort(),i.result.close();var o=h.deleteDatabase(e);o.onsuccess=o.onerror=cs((function(){n(new pa.NoSuchDatabase("Database "+e+" doesnt exist"))}))}else{r.onerror=Hs(n),I((t.oldVersion>Math.pow(2,62)?0:t.oldVersion)/10,r,n)}}),n),i.onsuccess=cs((function(){if(r=null,m=i.result,Ms.push(S),O)!function(){if(S.verno=m.version/10,S._dbSchema=d={},0===(v=Po(m.objectStoreNames,0)).length)return;var e=m.transaction(Zs(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 Gs(r,r||"",!1,!1,!!n.autoIncrement,r&&"string"!=typeof r,i),a=[],s=0;s<n.indexNames.length;++s){var u=n.index(n.indexNames[s]);i=(r=u.keyPath)&&"string"==typeof r&&-1!==r.indexOf(".");var c=new Gs(u.name,r,!!u.unique,!!u.multiEntry,!1,r&&"string"!=typeof r,i);a.push(c)}d[t]=new Ys(t,o,a,{})})),z([g],_o(d),d)}();else if(m.objectStoreNames.length>0)try{X(d,m.transaction(Zs(m.objectStoreNames),"readonly"))}catch(e){}m.onversionchange=cs((function(e){S._vcFired=!0,S.on("versionchange").fire(e)})),C||"__dbnames"===e||Ts.dbnames.put({name:e}).catch(ma),t()}),n)}))]).then((function(){return w=[],Za.resolve(Us.vip(S.on.ready.fire)).then((function e(){if(w.length>0){var t=w.reduce(Ea,ma);return w=[],Za.resolve(Us.vip(t)).then(e)}}))})).finally((function(){w=null})).then((function(){return b=!1,S})).catch((function(e){try{r&&r.abort()}catch(e){}return b=!1,S.close(),As(y=e)})).finally((function(){k=!0,t()}))},this.close=function(){var e=Ms.indexOf(S);if(e>=0&&Ms.splice(e,1),m){try{m.close()}catch(e){}m=null}l=!1,y=new pa.DatabaseClosed,b&&r(y),x=new Za((function(e){n=e})),E=new Za((function(e,t){r=t}))},this.delete=function(){var t=arguments.length>0;return new Za((function(n,r){if(t)throw new pa.InvalidArgument("Arguments not allowed in db.delete()");function i(){S.close();var t=h.deleteDatabase(e);t.onsuccess=cs((function(){C||Ts.dbnames.delete(e).catch(ma),n()})),t.onerror=Hs(r),t.onblocked=J}b?x.then(i):i()}))},this.backendDB=function(){return m},this.isOpen=function(){return null!==m},this.hasBeenClosed=function(){return y&&y instanceof pa.DatabaseClosed},this.hasFailed=function(){return null!==y},this.dynamicallyOpened=function(){return O},this.name=e,Io(this,{tables:{get:function(){return _o(g).map((function(e){return g[e]}))}}}),this.on=Is(this,"populate","blocked","versionchange",{ready:[Ea,ma]}),this.on.ready.subscribe=Bo(this.on.ready.subscribe,(function(e){return function(t,n){Us.vip((function(){k?(y||Za.resolve().then(t),n&&e(t)):w?(w.push(t),n&&e(t)):(e(t),n||e((function e(){S.on.ready.unsubscribe(t),S.on.ready.unsubscribe(e)})))}))}})),this.transaction=function(){var e=L.apply(this,arguments);return this._transaction.apply(this,e)},this._transaction=function(e,t,n){var r=Ka.trans;r&&r.db===S&&-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!=_)throw new pa.InvalidArgument("Invalid transaction mode: "+e);e=_}if(r){if("readonly"===r.mode&&e===_){if(!i)throw new pa.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 pa.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)})):As(e)}return r?r._promise(e,a,"lock"):Ka.trans?xs(Ka.transless,(function(){return S._whenReady(a)})):S._whenReady(a);function a(){return Za.resolve().then((function(){var t,i=Ka.transless||Ka,a=S._createTransaction(e,o,d,r),s={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create(),n.constructor===Na&&ms();var u=Za.follow((function(){if(t=n.call(a,a))if(t.constructor===La){var e=ys.bind(null,null);t.then(e,e)}else"function"==typeof t.next&&"function"==typeof t.throw&&(t=qs(t))}),s);return(t&&"function"==typeof t.then?Za.resolve(t).then((function(e){return a.active?e:As(new pa.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):u.then((function(){return t}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),As(e)}))}))}},this.table=function(e){if(!Ao(g,e))throw new pa.InvalidTable("Table "+e+" does not exist");return g[e]},Io(N.prototype,{_trans:function(e,t,n){var r=this._tx||Ka.trans;return r&&r.db===S?r===Ka.trans?r._promise(e,t,n):gs((function(){return r._promise(e,t,n)}),{trans:r,transless:Ka.transless||Ka}):function e(t,n,r){if(k||Ka.letThrough){var i=S._createTransaction(t,n,d);try{i.create()}catch(e){return As(e)}return i._promise(t,(function(e,t){return gs((function(){return Ka.trans=i,r(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!b){if(!l)return As(new pa.DatabaseClosed);S.open().catch(ma)}return x.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 pa.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=Hs(r),o.onsuccess=cs((function(){t(n.hook.reading.fire(o.result))}),r)})).then(t)},where:function(e){if("string"==typeof e)return new D(this,e);if(So(e))return new D(this,"["+e.join("+")+"]");var t=_o(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&&Ls!==Rs)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]?Z(t[1],(function(t){return""+Ho(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 j(new D(this,So(e)?"["+e.join("+")+"]":e))},toCollection:function(){return new j(new D(this))},mapToClass:function(e,t){this.schema.mappedClass=e;var n=Object.create(e.prototype);t&&Fs(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(Ao(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(Us.defineClass(e),e)},bulkDelete:function(e){return this.hook.deleting.fire===ma?this._idbstore(_,(function(t,n,r,i){t(P(r,i,e,!1,ma))})):this.where(":id").anyOf(e).delete().then((function(){}))},bulkPut:function(e,t){var n=this;return this._idbstore(_,(function(r,i,o){if(!o.keyPath&&!n.schema.primKey.auto&&!t)throw new pa.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new pa.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new pa.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return r();var a,s,u=function(e){0===c.length?r(e):i(new ha(n.name+".bulkPut(): "+c.length+" of "+l+" operations failed",c))},c=[],l=e.length,h=n;if(n.hook.creating.fire===ma&&n.hook.updating.fire===ma){s=M(c);for(var f=0,d=e.length;f<d;++f)(a=t?o.put(e[f],t[f]):o.put(e[f])).onerror=s;a.onerror=M(c,u),a.onsuccess=Vs(u)}else{var p=t||o.keyPath&&e.map((function(e){return Ho(e,o.keyPath)})),v=p&&Uo(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(la,(function(e){c=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(u).catch(ha,(function(e){c=c.concat(e.failures),u()})).catch(i)}}),"locked")},bulkAdd:function(e,t){var n=this,r=this.hook.creating.fire;return this._idbstore(_,(function(i,o,a,s){if(!a.keyPath&&!n.schema.primKey.auto&&!t)throw new pa.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(a.keyPath&&t)throw new pa.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new pa.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return i();function u(e){0===f.length?i(e):o(new ha(n.name+".bulkAdd(): "+f.length+" of "+d+" operations failed",f))}var c,l,h,f=[],d=e.length;if(r!==ma){var p,v=a.keyPath;l=M(f,null,!0),h=zs(null),zo((function(){for(var n=0,i=e.length;n<i;++n){p={onerror:null,onsuccess:null};var o=t&&t[n],u=e[n],f=t?o:v?Ho(u,v):void 0,d=r.call(p,f,u,s);null==f&&null!=d&&(v?Vo(u=Yo(u),v,d):o=d),(c=null!=o?a.add(u,o):a.add(u))._hookCtx=p,n<i-1&&(c.onerror=l,p.onsuccess&&(c.onsuccess=h))}}),(function(e){throw p.onerror&&p.onerror(e),e})),c.onerror=M(f,u,!0),c.onsuccess=zs(u)}else{l=M(f);for(var g=0,m=e.length;g<m;++g)(c=t?a.add(e[g],t[g]):a.add(e[g])).onerror=l;c.onerror=M(f,u),c.onsuccess=Vs(u)}}))},add:function(e,t){var n=this.hook.creating.fire;return this._idbstore(_,(function(r,i,o,a){var s={onsuccess:null,onerror:null};if(n!==ma){var u=null!=t?t:o.keyPath?Ho(e,o.keyPath):void 0,c=n.call(s,u,e,a);null==u&&null!=c&&(o.keyPath?Vo(e,o.keyPath,c):t=c)}try{var l=null!=t?o.add(e,t):o.add(e);l._hookCtx=s,l.onerror=Ws(i),l.onsuccess=zs((function(t){var n=o.keyPath;n&&Vo(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!==ma||i!==ma){var o=this.schema.primKey.keyPath,a=void 0!==t?t:o&&Ho(e,o);return null==a?this.add(e):(e=Yo(e),this._trans(_,(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(_,(function(n,r,i){var o=void 0!==t?i.put(e,t):i.put(e);o.onerror=Hs(r),o.onsuccess=cs((function(t){var r=i.keyPath;r&&Vo(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(_,(function(t,n,r){var i=r.delete(e);i.onerror=Hs(n),i.onsuccess=cs((function(){t(i.result)}))}))},clear:function(){return this.hook.deleting.subscribers.length?this.toCollection().delete():this._idbstore(_,(function(e,t,n){var r=n.clear();r.onerror=Hs(t),r.onsuccess=cs((function(){e(r.result)}))}))},update:function(e,t){if("object"!=typeof t||So(t))throw new pa.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||So(e))return this.where(":id").equals(e).modify(t);_o(t).forEach((function(n){Vo(e,n,t[n])}));var n=Ho(e,this.schema.primKey.keyPath);return void 0===n?As(new pa.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}}),Io(B.prototype,{_lock:function(){return Do(!Ka.global),++this._reculock,1!==this._reculock||Ka.global||(Ka.lockOwnerFor=this),this},_unlock:function(){if(Do(!Ka.global),0==--this._reculock)for(Ka.global||(Ka.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{xs(e[1],e[0])}catch(e){}}return this},_locked:function(){return this._reculock&&Ka.lockOwnerFor!==this},create:function(e){var t=this;if(!this.mode)return this;if(Do(!this.idbtrans),!e&&!m)switch(y&&y.name){case"DatabaseClosedError":throw new pa.DatabaseClosed(y);case"MissingAPIError":throw new pa.MissingAPI(y.message,y);default:throw new pa.OpenFailed(y)}if(!this.active)throw new pa.TransactionInactive;return Do(null===this._completion._state),(e=this.idbtrans=e||m.transaction(Zs(this.storeNames),this.mode)).onerror=cs((function(n){Ks(n),t._reject(e.error)})),e.onabort=cs((function(n){Ks(n),t.active&&t._reject(new pa.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=cs((function(){t.active=!1,t._resolve()})),this},_promise:function(e,t,n){var r=this;if(e===_&&this.mode!==_)return As(new pa.ReadOnly("Transaction is readonly"));if(!this.active)return As(new pa.TransactionInactive);if(this._locked())return new Za((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},Ka])}));if(n)return gs((function(){var e=new Za((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 Za((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=Za.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 Za((function(n,i){e.then((function(e){return t._waitingQueue.push(cs(n.bind(null,e)))}),(function(e){return t._waitingQueue.push(cs(i.bind(null,e)))})).finally((function(){t._waitingFor===r&&(t._waitingFor=null)}))}))},abort:function(){this.active&&this._reject(new pa.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. "+oa(ia(),1)),a.apply(this,arguments)})},table:function(e){return new N(e,S.table(e).schema,this)}}),Io(D.prototype,(function(){function e(e,t,n){var r=e instanceof D?new j(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function t(e){return new j(e,(function(){return f.only("")})).limit(0)}function n(e,t,n,r,i,o){for(var a=Math.min(e.length,r.length),s=-1,u=0;u<a;++u){var c=t[u];if(c!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[u],c)<0&&(s=u)}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,u,c,l,h,d,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),u="next"===e?G:Y;var t=i.map((function(e){return{lower:s(e),upper:a(e)}})).sort((function(e,t){return u(e.lower,t.lower)}));c=t.map((function(e){return e.upper})),l=t.map((function(e){return e.lower})),h=e,d="next"===e?"":o}v("next");var g=new j(t,(function(){return f.bound(c[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 f=null,v=m;v<p;++v){var g=n(o,a,c[v],l[v],u,h);null===g&&null===f?m=v+1:(null===f||u(f,g)>0)&&(f=g)}return t(null!==f?function(){e.continue(f+d)}:i),!1})),g}return{between:function(n,r,i,o){i=!1!==i,o=!0===o;try{return V(n,r)>0||0===V(n,r)&&(i||o)&&(!i||!o)?t(this):new j(this,(function(){return f.bound(n,r,!i,!o)}))}catch(t){return e(this,Ns)}},equals:function(e){return new j(this,(function(){return f.only(e)}))},above:function(e){return new j(this,(function(){return f.lowerBound(e,!0)}))},aboveOrEqual:function(e){return new j(this,(function(){return f.lowerBound(e)}))},below:function(e){return new j(this,(function(){return f.upperBound(e,!0)}))},belowOrEqual:function(e){return new j(this,(function(){return f.upperBound(e)}))},startsWith:function(t){return"string"!=typeof t?e(this,"String expected."):this.between(t,t+Rs,!0,!0)},startsWithIgnoreCase:function(e){return""===e?this.startsWith(e):r(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],Rs)},equalsIgnoreCase:function(e){return r(this,(function(e,t){return e===t[0]}),[e],"")},anyOfIgnoreCase:function(){var e=Qo.apply($o,arguments);return 0===e.length?t(this):r(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},startsWithAnyOfIgnoreCase:function(){var e=Qo.apply($o,arguments);return 0===e.length?t(this):r(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,Rs)},anyOf:function(){var n=Qo.apply($o,arguments),r=K;try{n.sort(r)}catch(t){return e(this,Ns)}if(0===n.length)return t(this);var i=new j(this,(function(){return f.bound(n[0],n[n.length-1])}));i._ondirectionchange=function(e){r="next"===e?K:q,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,Ls]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=Qo.apply($o,arguments);if(0===t.length)return new j(this);try{t.sort(K)}catch(t){return e(this,Ns)}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],Ls]),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]&&K(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",pa.InvalidArgument);var i=!r||!1!==r.includeLowers,o=r&&!0===r.includeUppers;var a,s=K;function u(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(V(t[0],i[1])<0&&V(t[1],i[0])>0){i[0]=(o=i[0],a=t[0],V(o,a)<0?o:a),i[1]=W(i[1],t[1]);break}}var o,a;return n===r&&e.push(t),e}),[])).sort(u)}catch(t){return e(this,Ns)}var c=0,l=o?function(e){return K(e,a[c][1])>0}:function(e){return K(e,a[c][1])>=0},h=i?function(e){return q(e,a[c][0])>0}:function(e){return q(e,a[c][0])>=0};var d=l,p=new j(this,(function(){return f.bound(a[0][0],a[a.length-1][1],!i,!o)}));return p._ondirectionchange=function(e){"next"===e?(d=l,s=K):(d=h,s=q),a.sort(u)},p._addAlgorithm((function(e,t,n){for(var r=e.key;d(r);)if(++c===a.length)return t(n),!1;return!!function(e){return!l(e)&&!h(e)}(r)||(0===V(r,a[c][1])||0===V(r,a[c][0])||t((function(){s===K?e.continue(a[c][0]):e.continue(a[c][1])})),!1)})),p},startsWithAnyOf:function(){var n=Qo.apply($o,arguments);return n.every((function(e){return"string"==typeof e}))?0===n.length?t(this):this.inAnyRange(n.map((function(e){return[e,e+Rs]}))):e(this,"startsWithAnyOf() only works with strings")}}})),Io(j.prototype,(function(){function e(e,t){e.filter=Z(e.filter,t)}function t(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Z(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 pa.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?Z(e.filter,e.replayFilter()):e.filter;e.or?function(){var s={},u=0;function c(){2==++u&&n()}function l(e,n,r){if(!a||a(n,r,c,i)){var o=n.primaryKey,u=""+o;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(o)),Ao(s,u)||(s[u]=!0,t(e,n,r))}}e.or._iterate(l,c,i,o),H(r(e,o),e.algorithm,l,c,i,!e.keysOnly&&e.valueMapper)}():H(r(e,o),Z(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,As.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,As.bind(null,t.error)):t.table._idbstore(_,e,"locked")},_addAlgorithm:function(e){var t=this._ctx;t.algorithm=Z(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&&Eo(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(U(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=Hs(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&&U(t,!0)&&t.limit>0){var s=t.table.hook.reading.fire,u=n(t,a),c=t.limit<1/0?u.getAll(t.range,t.limit):u.getAll(t.range);c.onerror=Hs(r),c.onsuccess=Vs(s===ya?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,U(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=Z(e.isMatch,t)}(this._ctx,t),this},and:function(e){return this.filter(e)},or:function(e){return new D(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&&U(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=Hs(r),a.onsuccess=Vs(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=Ao(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 u;if("function"==typeof e)u=r===ma&&i===ma?e:function(t){var n=Yo(t);if(!1===e.call(this,t,this))return!1;if(Ao(this,"value")){var o=Zo(n,this.value),a=r.call(this,o,this.primKey,n,s);a&&(t=this.value,_o(a).forEach((function(e){Vo(t,e,a[e])})))}else i.call(this,this.primKey,t,s)};else if(r===ma){var c=_o(e),l=c.length;u=function(t){for(var n=!1,r=0;r<l;++r){var i=c[r],o=e[i];Ho(t,i)!==o&&(Vo(t,i,o),n=!0)}return n}}else{var h=e;e=Wo(h),u=function(t){var n=!1,i=r.call(this,e,this.primKey,Yo(t),s);return i&&Eo(e,i),_o(e).forEach((function(r){var i=e[r];Ho(t,r)!==i&&(Vo(t,r,i),n=!0)})),i&&(e=Wo(h)),n}}var f=0,d=0,p=!1,v=[],g=[],m=null;function y(e){return e&&(v.push(e),g.push(m)),o(new la("Error modifying one or more objects",v,d,g))}function b(){p&&d+v.length===f&&(v.length>0?y():n(d))}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!==u.call(n,e,n)){var i=!Ao(n,"value");++f,zo((function(){var e=i?t.delete():t.update(n.value);e._hookCtx=n,e.onerror=Ws(r),e.onsuccess=zs((function(){++d,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!==ma;if(!i&&U(t)&&(t.isPrimKey&&!Ds||!n))return this._write((function(e,t,r){var i=Hs(t),o=n?r.count(n):r.count();o.onerror=i,o.onsuccess=function(){var a=o.result;zo((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,u){var c=0,l=e.clone({keysOnly:!t.isMatch&&!i}).distinct().limit(o).raw(),h=[],f=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 K(e[0],t[0])})):h.sort(K),P(s,u,h,i,r)})).then((function(){var e=h.length;return c+=e,h=[],e<o?c:f()}))};n(f())}))}}})),Eo(this,{Collection:j,Table:N,Transaction:B,Version:A,WhereClause:D}),S.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+S.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+S.name+"'. Closing db now to resume the delete request."),S.close()})),S.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+S.name+"') was blocked"):console.warn("Upgrade '"+S.name+"' blocked by other connection holding version "+e.oldVersion/10)})),c.forEach((function(e){e(S)}))}function Fs(e,t){return _o(t).forEach((function(n){var r=function e(t){if("function"==typeof t)return new t;if(So(t))return[e(t[0])];if(t&&"object"==typeof t){var n={};return Fs(n,t),n}return t}(t[n]);e[n]=r})),e}function zs(e){return cs((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 Hs(e){return cs((function(t){return Ks(t),e(t.target.error),!1}))}function Vs(e){return cs((function(t){e(t.target.result)}))}function Ws(e){return cs((function(t){var n=t.target,r=n.error,i=n._hookCtx,o=i&&i.onerror;return o&&o(r),Ks(t),e(r),!1}))}function Ks(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function qs(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):So(o)?Za.all(o).then(n,r):n(o)}}return i(t)()}function Gs(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 Ys(e,t,n,r){this.name=e,this.primKey=t||new Gs,this.indexes=n||[new Gs],this.instanceTemplate=r,this.mappedClass=null,this.idxByName=Uo(n,(function(e){return[e.name,e]}))}function Zs(e){return 1===e.length?e[0]:e}function Xs(e){var t=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);return t&&t.bind(e)}ta(ea,js),Io(Us,ga),Io(Us,{delete:function(e){var t=new Us(e),n=t.delete();return n.onblocked=function(e){return t.on("blocked",e),this},n},exists:function(e){return new Us(e).open().then((function(e){return e.close(),!0})).catch(Us.NoSuchDatabaseError,(function(){return!1}))},getDatabaseNames:function(e){var t=Xs(Us.dependencies.indexedDB);return t?new Za((function(e,n){var r=t();r.onsuccess=function(t){e(Po(t.target.result,0))},r.onerror=Hs(n)})).then(e):Ts.dbnames.toCollection().primaryKeys(e)},defineClass:function(){return function(e){e&&Eo(this,e)}},applyStructure:Fs,ignoreTransaction:function(e){return Ka.trans?xs(Ka.transless,e):e()},vip:function(e){return gs((function(){return Ka.letThrough=!0,e()}))},async:function(e){return function(){try{var t=qs(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Za.resolve(t)}catch(e){return As(e)}}},spawn:function(e,t,n){try{var r=qs(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Za.resolve(r)}catch(e){return As(e)}},currentTransaction:{get:function(){return Ka.trans||null}},waitFor:function(e,t){var n=Za.resolve("function"==typeof e?Us.ignoreTransaction(e):e).timeout(t||6e4);return Ka.trans?Ka.trans.waitFor(n):n},Promise:Za,debug:{get:function(){return ea},set:function(e){ta(e,"dexie"===e?function(){return!0}:js)}},derive:Lo,extend:Eo,props:Io,override:Bo,Events:Is,getByKeyPath:Ho,setByKeyPath:Vo,delByKeyPath:function(e,t){"string"==typeof t?Vo(e,t,void 0):"length"in t&&[].map.call(t,(function(t){Vo(e,t,void 0)}))},shallowClone:Wo,deepClone:Yo,getObjectDiff:Zo,asap:jo,maxKey:Ls,minKey:-1/0,addons:[],connections:Ms,MultiModifyError:pa.Modify,errnames:fa,IndexSpec:Gs,TableSchema:Ys,dependencies:function(){try{return{indexedDB:xo.indexedDB||xo.mozIndexedDB||xo.webkitIndexedDB||xo.msIndexedDB,IDBKeyRange:xo.IDBKeyRange||xo.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:Us,Dexie:Us}),Za.rejectionMapper=function(e,t){if(!e||e instanceof ca||e instanceof TypeError||e instanceof SyntaxError||!e.name||!va[e.name])return e;var n=new va[e.name](t||e.message,e);return"stack"in e&&Ro(n,"stack",{get:function(){return this.inner.stack}}),n},(Ts=new Us("__dbnames")).version(1).stores({dbnames:"name"}),function(){try{void 0!==typeof localStorage&&void 0!==xo.document&&(JSON.parse(localStorage.getItem("Dexie.DatabaseNames")||"[]").forEach((function(e){return Ts.dbnames.put({name:e}).catch(ma)})),localStorage.removeItem("Dexie.DatabaseNames"))}catch(e){}}();var Js=RegExp.prototype,$s=Js.toString,Qs=s((function(){return"/a/b"!=$s.call({source:"a",flags:"b"})})),eu="toString"!=$s.name;(Qs||eu)&&ne(RegExp.prototype,"toString",(function(){var e=I(this),t=String(e.source),n=e.flags;return"/"+t+"/"+String(void 0===n&&e instanceof RegExp&&!("flags"in Js)?Tt.call(e):n)}),{unsafe:!0});var tu={storage:window.localStorage,set:function(e,t){if(t){var n=nu(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=wo(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()}}},nu=function(e){if(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t?JSON.stringify(e):e}};function ru(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){e.done?i(e.value):new n((function(t){t(e.value)})).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function iu(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 ou(e){return[e.schema.primKey].concat(e.schema.indexes).map((function(e){return e.src})).join(",")}function au(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 su(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 uu="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function cu(e,t){return e(t={exports:{}},t.exports),t.exports}for(var lu=cu((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,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(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 f(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function d(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=_(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 k=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),S(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return k(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 _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=A("",c,S,l||{},_);function O(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&&f(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else d(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return _.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),u=s[0],c=s[2],l=s[3],f=s[4],d=s[5],p=s[6],v=A(u,i,c,l,o,!0,p),g=h(v,w);return u&&g?v.p.then((function(t){return f[d]=t,e(n,o)})):(u?f[d]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(E,_)).then(O):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[O(E)]:m?O(E):Promise.resolve(O(E));function C(e,t,n){Object.assign(e,t);var r=u.map((function(t){var n=e[t];return delete e[t],n}));n(),u.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,u,c,l){var d=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var n=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:h(i,w)},void 0!==n?{type:n}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(d=I(t,i,s,u,!1,c,S))!==i&&(m={replaced:d}):d=i,S&&S(),d;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var O=f(i),T=r(i),R=(O||T)&&(!o.length||s.replaced)||s.iterateIn?i:I(t,i,s,u,O||T,null,S),L=void 0;if(R!==i?(d=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):O||"object"===s.iterateIn?m={clone:L={}}:""===t&&h(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),d=i):d=i,S&&S(),v.iterateNone)return L||d;if(!L)return d;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};C(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,u,c);h(r,w)?u.push([n,r,!!a,s,L,e,s.type]):void 0!==r&&(L[e]=r)}))};for(var M in i)N(M);S&&S({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);C(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,B=function(e){if(!(e in i)){var n=t+(t?".":"")+e;C(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},D=0;D<P;D++)B(D);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function I(e,t,n,r,i,u,c){for(var l=i?o:a,h=l.length;h--;){var f=l[h];if(f.test(t,n)){var d=f.type;if(s[d]){var p=y[e];y[e]=p?[d].concat(p):d}return Object.assign(n,{type:d,replaced:!0}),!m&&f.replaceAsync||f.replace?(c&&c({replacing:!0}),A(e,f[m||!f.replaceAsync?"replace":"replaceAsync"](t,n),S&&"readonly",n,r,u,d)):(c&&c({typeDetected:!0}),A(e,t,S&&"readonly",n,r,u,d))}}return t}};this.encapsulateSync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&f(u.$)&&(e=e.$,u=u.$,l=!1);var d=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(r(o)||f(o)){var k=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);h(n,b)?k[t]=void 0:void 0!==n&&(k[t]=n)})),o=k;d.length;){var _=t(d[0],4),S=_[0],x=_[1],E=_[2],O=_[3],C=y(S,x);if(h(C,b))E[O]=void 0;else{if(void 0===C)break;E[O]=C}d.splice(0,1)}}if(!w)return o;if("#"===w){var A=y(a,o.substr(1));return void 0===A&&d.push([a,o.substr(1),v,m]),A}var I=c.sync;return[].concat(w).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[I&&n.revive?"revive":!I&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(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 S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(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],u=n.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[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 f={type:e,test:n.test.bind(n)};n.replace&&(f.replace=n.replace.bind(n)),n.replaceAsync&&(f.replaceAsync=n.replaceAsync.bind(n));var d="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(d,0,f):a.splice(d,0,f),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 w(e){this.p=new Promise(e)}return w.prototype.then=function(e,t){var n=this;return new w((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)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,n){n(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=d,p.isPlainObject=f,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}()})),hu=cu((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,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(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 f(e){return!(!e||"Object"!==l(e))&&(!o(e)||h(e,Object))}function d(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=_(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 k=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),S(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return k(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 _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=A("",c,S,l||{},_);function O(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&&f(e)&&!e.hasOwnProperty("$types")?e.$types=y:e={$:e,$types:{$:y}}}else d(e)&&e.hasOwnProperty("$types")&&(e={$:e,$types:!0});return!v.returnTypeNames&&e}return _.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),u=s[0],c=s[2],l=s[3],f=s[4],d=s[5],p=s[6],v=A(u,i,c,l,o,!0,p),g=h(v,w);return u&&g?v.p.then((function(t){return f[d]=t,e(n,o)})):(u?f[d]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(E,_)).then(O):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[O(E)]:m?O(E):Promise.resolve(O(E));function C(e,t,n){Object.assign(e,t);var r=u.map((function(t){var n=e[t];return delete e[t],n}));n(),u.forEach((function(t,n){e[t]=r[n]}))}function A(t,i,a,s,u,c,l){var d=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var n=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:h(i,w)},void 0!==n?{type:n}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(d=I(t,i,s,u,!1,c,S))!==i&&(m={replaced:d}):d=i,S&&S(),d;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var O=f(i),T=r(i),R=(O||T)&&(!o.length||s.replaced)||s.iterateIn?i:I(t,i,s,u,O||T,null,S),L=void 0;if(R!==i?(d=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):O||"object"===s.iterateIn?m={clone:L={}}:""===t&&h(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),d=i):d=i,S&&S(),v.iterateNone)return L||d;if(!L)return d;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};C(s,n,(function(){var n=t+(t?".":"")+g(e),r=A(n,i[e],!!a,s,u,c);h(r,w)?u.push([n,r,!!a,s,L,e,s.type]):void 0!==r&&(L[e]=r)}))};for(var M in i)N(M);S&&S({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);C(s,{ownKeys:!0},(function(){var t=A(n,i[e],!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,B=function(e){if(!(e in i)){var n=t+(t?".":"")+e;C(s,{ownKeys:!1},(function(){var t=A(n,void 0,!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},D=0;D<P;D++)B(D);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function I(e,t,n,r,i,u,c){for(var l=i?o:a,h=l.length;h--;){var f=l[h];if(f.test(t,n)){var d=f.type;if(s[d]){var p=y[e];y[e]=p?[d].concat(p):d}return Object.assign(n,{type:d,replaced:!0}),!m&&f.replaceAsync||f.replace?(c&&c({replacing:!0}),A(e,f[m||!f.replaceAsync?"replace":"replaceAsync"](t,n),S&&"readonly",n,r,u,d)):(c&&c({typeDetected:!0}),A(e,t,S&&"readonly",n,r,u,d))}}return t}};this.encapsulateSync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&f(u.$)&&(e=e.$,u=u.$,l=!1);var d=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(r(o)||f(o)){var k=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);h(n,b)?k[t]=void 0:void 0!==n&&(k[t]=n)})),o=k;d.length;){var _=t(d[0],4),S=_[0],x=_[1],E=_[2],O=_[3],C=y(S,x);if(h(C,b))E[O]=void 0;else{if(void 0===C)break;E[O]=C}d.splice(0,1)}}if(!w)return o;if("#"===w){var A=y(a,o.substr(1));return void 0===A&&d.push([a,o.substr(1),v,m]),A}var I=c.sync;return[].concat(w).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[I&&n.revive?"revive":!I&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(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 S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(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],u=n.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[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 f={type:e,test:n.test.bind(n)};n.replace&&(f.replace=n.replace.bind(n)),n.replaceAsync&&(f.replaceAsync=n.replaceAsync.bind(n));var d="number"==typeof t.fallback?t.fallback:t.fallback?0:1/0;if(n.testPlainObjects?o.splice(d,0,f):a.splice(d,0,f),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 w(e){this.p=new Promise(e)}w.prototype.then=function(e,t){var n=this;return new w((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)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,n){n(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,p.toStringTag=l,p.hasConstructorOf=h,p.isObject=d,p.isPlainObject=f,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 k={userObject:{test:function(e,t){return p.isUserObject(e)},replace:function(e){return Object.assign({},e)},revive:function(e){return e}}},_=[[{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}}}],S={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)}}},x=[{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}}}],E={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)}}},O={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)}}},C={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)}}},I="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=new Uint8Array(256),R=0;R<I.length;R++)T[I.charCodeAt(R)]=R;var L=function(e,t,n){for(var r=new Uint8Array(e,t,n),i=r.length,o="",a=0;a<i;a+=3)o+=I[r[a]>>2],o+=I[(3&r[a])<<4|r[a+1]>>4],o+=I[(15&r[a+1])<<2|r[a+2]>>6],o+=I[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 u=new ArrayBuffer(n),c=new Uint8Array(u),l=0;l<t;l+=4)i=T[e.charCodeAt(l)],o=T[e.charCodeAt(l+1)],a=T[e.charCodeAt(l+2)],s=T[e.charCodeAt(l+3)],c[r++]=i<<2|o>>4,c[r++]=(15&o)<<4|a>>2,c[r++]=(3&a)<<6|63&s;return u},M={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),L(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?uu:self,B={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=P[t];n&&(B[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:L(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 D={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:L(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)}}},j={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 U(e){for(var t=new Uint16Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var F={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=U(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[k,_,S,x,E,O,{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)}}},F,{file:F.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([U(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?C:[],"function"==typeof Set?A:[],"function"==typeof ArrayBuffer?M:[],"function"==typeof Uint8Array?B:[],"function"==typeof DataView?D:[],"undefined"!=typeof Intl?j:[])}()})),fu="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",du=new Uint8Array(256),pu=0;pu<fu.length;pu++)du[fu.charCodeAt(pu)]=pu;var vu=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+=fu[r[a]>>2],o+=fu[(3&r[a])<<4|r[a+1]>>4],o+=fu[(15&r[a+1])<<2|r[a+2]>>6],o+=fu[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},gu=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 u=new ArrayBuffer(a),c=new Uint8Array(u),l=0;l<o;l+=4)t=du[e.charCodeAt(l)],n=du[e.charCodeAt(l+1)],r=du[e.charCodeAt(l+2)],i=du[e.charCodeAt(l+3)],c[s++]=t<<2|n>>4,c[s++]=(15&n)<<4|r>>2,c[s++]=(3&r)<<6|63&i;return u},mu="undefined"==typeof self?global:self,yu={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=mu[t];n&&(yu[e.toLowerCase()+"2"]={test:function(e){return lu.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 bu={arraybuffer:{test:function(e){return"ArrayBuffer"===lu.toStringTag(e)},replace:function(e){return vu(e,0,e.byteLength)},revive:function(e){return gu(e)}}},wu=(new lu).register(hu),ku="FileReaderSync"in self,_u=[],Su=0;wu.register([bu,yu,{blob2:{test:function(e){return"Blob"===lu.toStringTag(e)},replace:function(e){if(e.isClosed)throw new Error("The Blob is closed");if(ku){var t=su(e,"binary"),n=vu(t,0,t.byteLength);return{type:e.type,data:n}}_u.push(e);var r={type:e.type,data:{start:Su,end:Su+e.size}};return console.log("b.size: "+e.size),Su+=e.size,r},finalize:function(e,t){e.data=vu(t,0,t.byteLength)},revive:function(e){var t=e.type,n=e.data;return new Blob([gu(n)],{type:t})}}}]),wu.mustFinalize=function(){return _u.length>0},wu.finalize=function(e){return ru(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,s,u,c,l;return iu(this,(function(h){switch(h.label){case 0:return[4,au(new Blob(_u),"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)u=o[s],(c=wu.types[u])&&c.finalize&&(l=Us.getByKeyPath(i,a?"$."+s:s),c.finalize(l,t.slice(l.start,l.end)));return _u=[],[2]}}))}))};function xu(e,t){return ru(this,void 0,void 0,(function(){function n(){return ru(this,void 0,void 0,(function(){var n,c,l,h,f,d,p,v,g;return iu(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})),u.totalRows=n.reduce((function(e,t){return e+t})),c=JSON.stringify(a,void 0,o?2:void 0),l=c.lastIndexOf("]"),h=c.substring(0,l),r.push(h),f=t.filter,d=function(n){var i,a,c,l,h,d,p,v,g,m,y;return iu(this,(function(b){switch(b.label){case 0:i=e.table(n),a=i.schema.primKey,c=!!a.keyPath,l=t.numRowsPerChunk||2e3,h=c?{tableName:i.name,inbound:!0,rows:[]}:{tableName:i.name,inbound:!1,rows:[]},d=JSON.stringify(h,void 0,o?2:void 0),o&&(d=d.split("\n").join("\n ")),p=d.lastIndexOf("]"),r.push(d.substring(0,p)),v=null,g=0,m=!0,y=function(){var e,t,h,d,p,y,b,w;return iu(this,(function(k){switch(k.label){case 0:return s&&Us.ignoreTransaction((function(){return s(u)})),[4,(e=null==v?i.limit(l):i.where(":id").above(v).limit(l)).toArray()];case 1:return 0===(t=k.sent()).length?[2,"break"]:(null!=v&&g>0&&(r.push(","),o&&r.push("\n ")),m=t.length===l,c?(h=f?t.filter((function(e){return f(n,e)})):t,d=h.map((function(e){return wu.encapsulate(e)})),wu.mustFinalize()?[4,Us.waitFor(wu.finalize(d))]:[3,3]):[3,4]);case 2:k.sent(),k.label=3;case 3:return w=JSON.stringify(d,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),r.push(new Blob([w.substring(1,w.length-1)])),g=h.length,v=t.length>0?Us.getByKeyPath(t[t.length-1],a.keyPath):null,[3,8];case 4:return[4,e.primaryKeys()];case 5:return p=k.sent(),y=p.map((function(e,n){return[e,t[n]]})),f&&(y=y.filter((function(e){var t=e[0],r=e[1];return f(n,r,t)}))),b=y.map((function(e){return wu.encapsulate(e)})),wu.mustFinalize()?[4,Us.waitFor(wu.finalize(b))]:[3,7];case 6:k.sent(),k.label=7;case 7:w=JSON.stringify(b,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),r.push(new Blob([w.substring(1,w.length-1)])),g=y.length,v=p.length>0?p[p.length-1]:null,k.label=8;case 8:return u.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(d.substr(p)),u.completedTables+=1,u.completedTables<u.totalTables&&r.push(","),[2]}}))},p=0,v=i,m.label=2;case 2:return p<v.length?(g=v[p].name,[5,d(g)]):[3,5];case 3:m.sent(),m.label=4;case 4:return p++,[3,2];case 5:return r.push(c.substr(l)),u.done=!0,s&&Us.ignoreTransaction((function(){return s(u)})),[2]}}))}))}var r,i,o,a,s,u;return iu(this,(function(c){switch(c.label){case 0:t=t||{},r=[],i=e.tables.map((function(e){return{name:e.name,schema:ou(e),rowCount:0}})),o=t.prettyJson,a={formatName:"dexie",formatVersion:1,data:{databaseName:e.name,databaseVersion:e.verno,tables:i,data:[]}},s=t.progressCallback,u={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:e.tables.length},c.label=1;case 1:return c.trys.push([1,,6,7]),t.noTransaction?[4,n()]:[3,3];case 2:return c.sent(),[3,5];case 3:return[4,e.transaction("r",e.tables,n)];case 4:c.sent(),c.label=5;case 5:return[3,7];case 6:return wu.finalize(),[7];case 7:return s&&Us.ignoreTransaction((function(){return s(u)})),[2,new Blob(r,{type:"text/json"})]}}))}))}var Eu=function(){},Ou=cu((function(e,t){!function(e){var t="object"==typeof process&&process.env?process.env:self;e.parser=function(e){return new D(e)},e.CParser=D,e.CStream=j,e.createStream=function(e){return new j(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,u=10,c=13,l=32,h=34,f=43,d=44,p=45,v=46,g=48,m=57,y=58,b=69,w=91,k=92,_=93,S=97,x=98,E=101,O=102,C=108,A=110,I=114,T=115,R=116,L=117,N=123,M=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 B=/[\\"\n]/g;function D(t){if(!(this instanceof D))return new D(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,U(this,"onready")}D.prototype={end:function(){W(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return V(this,"Cannot write after close. Assign an onready handler.");if(null===t)return W(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===u?(this.line++,this.column=0):this.column++,this.state){case o.BEGIN:i===N?this.state=o.OPEN_OBJECT:i===w?this.state=o.OPEN_ARRAY:K(i)||V(this,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(K(i))continue;if(this.state===o.OPEN_KEY)this.stack.push(o.CLOSE_KEY);else{if(i===M){U(this,"onopenobject"),this.depth++,U(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_OBJECT)}i===h?this.state=o.STRING:V(this,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(K(i))continue;this.state,o.CLOSE_KEY;i===y?(this.state===o.CLOSE_OBJECT?(this.stack.push(o.CLOSE_OBJECT),z(this,"onopenobject"),this.depth++):z(this,"onkey"),this.state=o.VALUE):i===M?(F(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE):i===d?(this.state===o.CLOSE_OBJECT&&this.stack.push(o.CLOSE_OBJECT),z(this),this.state=o.OPEN_KEY):V(this,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(K(i))continue;if(this.state===o.OPEN_ARRAY){if(U(this,"onopenarray"),this.depth++,this.state=o.VALUE,i===_){U(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===w?this.state=o.OPEN_ARRAY:i===R?this.state=o.TRUE:i===O?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):V(this,"Bad value");continue;case o.CLOSE_ARRAY:if(i===d)this.stack.push(o.CLOSE_ARRAY),z(this,"onvalue"),this.state=o.VALUE;else if(i===_)F(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;else{if(K(i))continue;V(this,"Bad array")}continue;case o.STRING:void 0===this.textNode&&(this.textNode="");var s=n-1,c=this.slashed,l=this.unicodeI;e:for(;;){for(e.DEBUG&&console.log(n,i,e.STATE[this.state],c);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&&!c){this.state=this.stack.pop()||o.VALUE,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(i===k&&!c&&(c=!0,this.textNode+=t.substring(s,n-1),this.position+=n-1-s,i=t.charCodeAt(n++),this.position++,!i))break;if(c){if(c=!1,i===A?this.textNode+="\n":i===I?this.textNode+="\r":i===R?this.textNode+="\t":i===O?this.textNode+="\f":i===x?this.textNode+="\b":i===L?(l=1,this.unicodeS=""):this.textNode+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,s=n-1,i)continue;break}B.lastIndex=n;var P=B.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=c,this.unicodeI=l;continue;case o.TRUE:i===I?this.state=o.TRUE2:V(this,"Invalid true started with t"+i);continue;case o.TRUE2:i===L?this.state=o.TRUE3:V(this,"Invalid true started with tr"+i);continue;case o.TRUE3:i===E?(U(this,"onvalue",!0),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid true started with tru"+i);continue;case o.FALSE:i===S?this.state=o.FALSE2:V(this,"Invalid false started with f"+i);continue;case o.FALSE2:i===C?this.state=o.FALSE3:V(this,"Invalid false started with fa"+i);continue;case o.FALSE3:i===T?this.state=o.FALSE4:V(this,"Invalid false started with fal"+i);continue;case o.FALSE4:i===E?(U(this,"onvalue",!1),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid false started with fals"+i);continue;case o.NULL:i===L?this.state=o.NULL2:V(this,"Invalid null started with n"+i);continue;case o.NULL2:i===C?this.state=o.NULL3:V(this,"Invalid null started with nu"+i);continue;case o.NULL3:i===C?(U(this,"onvalue",null),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid null started with nul"+i);continue;case o.NUMBER_DECIMAL_POINT:i===v?(this.numberNode+=".",this.state=o.NUMBER_DIGIT):V(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(".")&&V(this,"Invalid number has two dots"),this.numberNode+="."):i===E||i===b?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||V(this,"Invalid number has two exponential"),this.numberNode+="e"):i===f||i===p?(a!==E&&a!==b&&V(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(i)):(H(this),n--,this.state=this.stack.pop()||o.VALUE);continue;default:V(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:V(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=Eu}catch(e){n=function(){}}function j(e){if(!(this instanceof j))return new j(e);this._parser=new D(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 U(t,n,r){e.INFO&&console.log("-- emit",n,r),t[n]&&t[n](r)}function F(e,t,n){z(e),U(e,t,n)}function z(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&&U(e,t||"onvalue",e.textNode),e.textNode=void 0}function H(e){e.numberNode&&U(e,"onvalue",parseFloat(e.numberNode)),e.numberNode=""}function V(e,t){return z(e),t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c,t=new Error(t),e.error=t,U(e,"onerror",t),e}function W(e){return e.state===o.VALUE&&0===e.depth||V(e,"Unexpected end"),z(e),e.c="",e.closed=!0,U(e,"onend"),D.call(e,e.opt),e}function K(e){return e===c||e===u||e===l||e===s}j.prototype=Object.create(n.prototype,{constructor:{value:j}}),j.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}}},j.prototype.end=function(e){return e&&e.length&&this._parser.write(e.toString()),this._parser.end(),!0},j.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)},j.prototype.destroy=function(){P(this._parser),this.emit("close")}}(t)}));function Cu(e){var t=0,n=function(e){var t,n,r,i=Ou.parser(),o=0,a=[],s=!1,u=!1;return i.onopenobject=function(i){var s={incomplete:!0};t||(t=s),n&&(a.push([r,n,u]),e&&(u?n.push(s):n[r]=s)),n=s,r=i,u=!1,++o},i.onkey=function(e){return r=e},i.onvalue=function(e){return u?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],u=t[2],e||(u?n.push(i):n[r]=i)}},i.onopenarray=function(){var i=[];i.incomplete=!0,t||(t=i),n&&(a.push([r,n,u]),e&&(u?n.push(i):n[r]=i)),n=i,u=!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],u=t[2],e||(u?n.push(i):n[r]=i)}},{write:function(e){return i.write(e),t},done:function(){return s}}}(!0),r={pullAsync:function(i){return ru(this,void 0,void 0,(function(){var o,a,s;return iu(this,(function(u){switch(u.label){case 0:return o=e.slice(t,t+i),t+=i,[4,au(o,"text")];case 1:return a=u.sent(),s=n.write(a),r.result=s||{},[2,s]}}))}))},pullSync:function(i){var o=e.slice(t,t+i);t+=i;var a=su(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 Au(e,t,n){return ru(this,void 0,void 0,(function(){function r(){return ru(this,void 0,void 0,(function(){var t,r,a,h;return iu(this,(function(f){switch(f.label){case 0:t=function(t){var r,i,o,a,s,h,f,d,p,v,g,m;return iu(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(c&&Us.ignoreTransaction((function(){return c(l)})),r=t.tableName,i=e.table(r),o=u.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&&!(f=a[h]).incomplete;h++)s.push(wu.revive(f));return d=n.filter,p=d?t.inbound?s.filter((function(e){return d(r,e)})):s.filter((function(e){var t=e[0],n=e[1];return d(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.clearTablesBeforeImport?[4,i.clear()]:[3,2];case 1:y.sent(),y.label=2;case 2:return n.overwriteValues?[4,i.bulkPut(m,g)]:[3,4];case 3:return y.sent(),[3,6];case 4:return[4,i.bulkAdd(m,g)];case 5:y.sent(),y.label=6;case 6:return l.completedRows+=s.length,s.incomplete||(l.completedTables+=1),a.splice(0,s.length),[2]}}))},r=0,a=u.data,f.label=1;case 1:return r<a.length?(h=a[r],[5,t(h)]):[3,4];case 2:if("break"===f.sent())return[3,4];f.label=3;case 3:return r++,[3,1];case 4:for(;u.data.length>0&&u.data[0].rows&&!u.data[0].rows.incomplete;)u.data.splice(0,1);return o.done()||o.eof()?[3,8]:s?(o.pullSync(i),[3,7]):[3,5];case 5:return[4,Us.waitFor(o.pullAsync(i))];case 6:f.sent(),f.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,u,c,l;return iu(this,(function(h){switch(h.label){case 0:return i=(n=n||{}).chunkSizeBytes||1048576,[4,Iu(t,i)];case 1:if(o=h.sent(),a=o.result,s="FileReaderSync"in self,u=a.data,!n.acceptNameDiff&&e.name!==u.databaseName)throw new Error("Name differs. Current database name is "+e.name+" but export is "+u.databaseName);if(!n.acceptVersionDiff&&e.verno!==u.databaseVersion)throw new Error("Database version differs. Current database is in version "+e.verno+" but export is "+u.databaseVersion);return c=n.progressCallback,l={done:!1,completedRows:0,completedTables:0,totalRows:u.tables.reduce((function(e,t){return e+t.rowCount}),0),totalTables:u.tables.length},c&&Us.ignoreTransaction((function(){return c(l)})),n.noTransaction?[4,r()]:[3,3];case 2:return h.sent(),[3,5];case 3:return[4,e.transaction("rw",e.tables,r)];case 4:h.sent(),h.label=5;case 5:return l.done=!0,c&&Us.ignoreTransaction((function(){return c(l)})),[2]}}))}))}function Iu(e,t){return ru(this,void 0,void 0,(function(){var n,r;return iu(this,(function(i){switch(i.label){case 0:n="slice"in e?Cu(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]}}))}))}Us.prototype.export=function(e){return xu(this,e)},Us.prototype.import=function(e,t){return Au(this,e,t)},Us.import=function(e,t){return function(e,t){return ru(this,void 0,void 0,(function(){var n,r,i,o;return iu(this,(function(a){switch(a.label){case 0:return n=(t=t||{}).chunkSizeBytes||1048576,[4,Iu(e,n)];case 1:return r=a.sent(),i=r.result.data,(o=new Us(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,Au(o,r,t)];case 2:return a.sent(),[2,o]}}))}))}(e,t)};var Tu,Ru,Lu=i((function(e,t){e.exports=function e(t,n,r){var i,o,a=window,s="application/octet-stream",u=r||s,c=t,l=!n&&!r&&c,h=document.createElement("a"),f=function(e){return String(e)},d=a.Blob||a.MozBlob||a.WebKitBlob||f,p=n||"download";if(d=d.call?d.bind(a):Blob,"true"===String(this)&&(u=(c=[c,u])[0],c=c[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(c)){if(!(c.length>2096103.424&&d!==f))return navigator.msSaveBlob?navigator.msSaveBlob(b(c),p):w(c);u=(c=b(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var g=0,m=new Uint8Array(c.length),y=m.length;g<y;++g)m[g]=c.charCodeAt(g);c=new d([m],{type:u})}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 d([a],{type:n})}function w(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=c instanceof d?c:new d([c],{type:u}),navigator.msSaveBlob)return navigator.msSaveBlob(i,p);if(a.URL)w(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===f)try{return w("data:"+u+";base64,"+a.btoa(i))}catch(e){return w("data:"+u+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){w(this.result)},o.readAsDataURL(i)}return!0}})),Nu=t,Mu=i((function(e,t){if(t.base64=!0,t.array=!0,t.string=!0,t.arraybuffer="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof Uint8Array,t.nodebuffer="undefined"!=typeof Buffer,t.uint8array="undefined"!=typeof Uint8Array,"undefined"==typeof ArrayBuffer)t.blob=!1;else{var n=new ArrayBuffer(0);try{t.blob=0===new Blob([n],{type:"application/zip"}).size}catch(e){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);r.append(n),t.blob=0===r.getBlob("application/zip").size}catch(e){t.blob=!1}}}try{t.nodestream=!!Nu.Readable}catch(e){t.nodestream=!1}})),Pu=(Mu.base64,Mu.array,Mu.string,Mu.arraybuffer,Mu.nodebuffer,Mu.uint8array,Mu.blob,Mu.nodestream,"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="),Bu=function(e){for(var t,n,r,i,o,a,s,u=[],c=0,l=e.length,h=l,f="string"!==hc.getTypeOf(e);c<e.length;)h=l-c,f?(t=e[c++],n=c<l?e[c++]:0,r=c<l?e[c++]:0):(t=e.charCodeAt(c++),n=c<l?e.charCodeAt(c++):0,r=c<l?e.charCodeAt(c++):0),i=t>>2,o=(3&t)<<4|n>>4,a=h>1?(15&n)<<2|r>>6:64,s=h>2?63&r:64,u.push(Pu.charAt(i)+Pu.charAt(o)+Pu.charAt(a)+Pu.charAt(s));return u.join("")},Du=function(e){var t,n,r,i,o,a,s=0,u=0;if("data:"===e.substr(0,"data:".length))throw new Error("Invalid base64 input, it looks like a data url.");var c,l=3*(e=e.replace(/[^A-Za-z0-9\+\/\=]/g,"")).length/4;if(e.charAt(e.length-1)===Pu.charAt(64)&&l--,e.charAt(e.length-2)===Pu.charAt(64)&&l--,l%1!=0)throw new Error("Invalid base64 input, bad content length.");for(c=Mu.uint8array?new Uint8Array(0|l):new Array(0|l);s<e.length;)t=Pu.indexOf(e.charAt(s++))<<2|(i=Pu.indexOf(e.charAt(s++)))>>4,n=(15&i)<<4|(o=Pu.indexOf(e.charAt(s++)))>>2,r=(3&o)<<6|(a=Pu.indexOf(e.charAt(s++))),c[u++]=t,64!==o&&(c[u++]=n),64!==a&&(c[u++]=r);return c},ju="undefined"!=typeof Buffer,Uu=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)},Fu=function(e){if(Buffer.alloc)return Buffer.alloc(e);var t=new Buffer(e);return t.fill(0),t},zu=function(e){return Buffer.isBuffer(e)},Hu=function(e){return e&&"function"==typeof e.on&&"function"==typeof e.pause&&"function"==typeof e.resume},Vu="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)},Wu=r.MutationObserver||r.WebKitMutationObserver;if(Wu){var Ku=0,qu=new Wu(Xu),Gu=r.document.createTextNode("");qu.observe(Gu,{characterData:!0}),Tu=function(){Gu.data=Ku=++Ku%2}}else if(r.setImmediate||void 0===r.MessageChannel)Tu="document"in r&&"onreadystatechange"in r.document.createElement("script")?function(){var e=r.document.createElement("script");e.onreadystatechange=function(){Xu(),e.onreadystatechange=null,e.parentNode.removeChild(e),e=null},r.document.documentElement.appendChild(e)}:function(){setTimeout(Xu,0)};else{var Yu=new r.MessageChannel;Yu.port1.onmessage=Xu,Tu=function(){Yu.port2.postMessage(0)}}var Zu=[];function Xu(){var e,t;Ru=!0;for(var n=Zu.length;n;){for(t=Zu,Zu=[],e=-1;++e<n;)t[e]();n=Zu.length}Ru=!1}var Ju=function(e){1!==Zu.push(e)||Ru||Tu()};function $u(){}var Qu={},ec=["REJECTED"],tc=["FULFILLED"],nc=["PENDING"],rc=ic;function ic(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=nc,this.queue=[],this.outcome=void 0,e!==$u&&uc(this,e)}function oc(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 ac(e,t,n){Ju((function(){var r;try{r=t(n)}catch(t){return Qu.reject(e,t)}r===e?Qu.reject(e,new TypeError("Cannot resolve promise with itself")):Qu.resolve(e,r)}))}function sc(e){var t=e&&e.then;if(e&&("object"==typeof e||"function"==typeof e)&&"function"==typeof t)return function(){t.apply(e,arguments)}}function uc(e,t){var n=!1;function r(t){n||(n=!0,Qu.reject(e,t))}function i(t){n||(n=!0,Qu.resolve(e,t))}var o=cc((function(){t(i,r)}));"error"===o.status&&r(o.value)}function cc(e,t){var n={};try{n.value=e(t),n.status="success"}catch(e){n.status="error",n.value=e}return n}ic.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}))}))},ic.prototype.catch=function(e){return this.then(null,e)},ic.prototype.then=function(e,t){if("function"!=typeof e&&this.state===tc||"function"!=typeof t&&this.state===ec)return this;var n=new this.constructor($u);this.state!==nc?ac(n,this.state===tc?e:t,this.outcome):this.queue.push(new oc(n,e,t));return n},oc.prototype.callFulfilled=function(e){Qu.resolve(this.promise,e)},oc.prototype.otherCallFulfilled=function(e){ac(this.promise,this.onFulfilled,e)},oc.prototype.callRejected=function(e){Qu.reject(this.promise,e)},oc.prototype.otherCallRejected=function(e){ac(this.promise,this.onRejected,e)},Qu.resolve=function(e,t){var n=cc(sc,t);if("error"===n.status)return Qu.reject(e,n.value);var r=n.value;if(r)uc(e,r);else{e.state=tc,e.outcome=t;for(var i=-1,o=e.queue.length;++i<o;)e.queue[i].callFulfilled(t)}return e},Qu.reject=function(e,t){e.state=ec,e.outcome=t;for(var n=-1,r=e.queue.length;++n<r;)e.queue[n].callRejected(t);return e},ic.resolve=function(e){if(e instanceof this)return e;return Qu.resolve(new this($u),e)},ic.reject=function(e){var t=new this($u);return Qu.reject(t,e)},ic.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([]);var i=new Array(n),o=0,a=-1,s=new this($u);for(;++a<n;)u(e[a],a);return s;function u(e,a){t.resolve(e).then((function(e){i[a]=e,++o!==n||r||(r=!0,Qu.resolve(s,i))}),(function(e){r||(r=!0,Qu.reject(s,e))}))}},ic.race=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([]);var i=-1,o=new this($u);for(;++i<n;)a=e[i],t.resolve(a).then((function(e){r||(r=!0,Qu.resolve(o,e))}),(function(e){r||(r=!0,Qu.reject(o,e))}));var a;return o};var lc={Promise:"undefined"!=typeof Promise?Promise:rc},hc=i((function(e,t){function n(e){return e}function r(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}t.newBlob=function(e,n){t.checkSupport("blob");try{return new Blob([e],{type:n})}catch(t){try{var r=new(self.BlobBuilder||self.WebKitBlobBuilder||self.MozBlobBuilder||self.MSBlobBuilder);return r.append(e),r.getBlob(n)}catch(e){throw new Error("Bug : can't construct the Blob.")}}};var i={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 Mu.uint8array&&1===String.fromCharCode.apply(null,new Uint8Array(1)).length}catch(e){return!1}}(),nodebuffer:function(){try{return Mu.nodebuffer&&1===String.fromCharCode.apply(null,Fu(1)).length}catch(e){return!1}}()}};function o(e){var n=65536,r=t.getTypeOf(e),o=!0;if("uint8array"===r?o=i.applyCanBeUsed.uint8array:"nodebuffer"===r&&(o=i.applyCanBeUsed.nodebuffer),o)for(;n>1;)try{return i.stringifyByChunk(e,r,n)}catch(e){n=Math.floor(n/2)}return i.stringifyByChar(e)}function a(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}t.applyFromCharCode=o;var s={};s.string={string:n,array:function(e){return r(e,new Array(e.length))},arraybuffer:function(e){return s.string.uint8array(e).buffer},uint8array:function(e){return r(e,new Uint8Array(e.length))},nodebuffer:function(e){return r(e,Fu(e.length))}},s.array={string:o,array:n,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return Uu(e)}},s.arraybuffer={string:function(e){return o(new Uint8Array(e))},array:function(e){return a(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:n,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return Uu(new Uint8Array(e))}},s.uint8array={string:o,array:function(e){return a(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:n,nodebuffer:function(e){return Uu(e)}},s.nodebuffer={string:o,array:function(e){return a(e,new Array(e.length))},arraybuffer:function(e){return s.nodebuffer.uint8array(e).buffer},uint8array:function(e){return a(e,new Uint8Array(e.length))},nodebuffer:n},t.transformTo=function(e,n){if(n||(n=""),!e)return n;t.checkSupport(e);var r=t.getTypeOf(n);return s[r][e](n)},t.getTypeOf=function(e){return"string"==typeof e?"string":"[object Array]"===Object.prototype.toString.call(e)?"array":Mu.nodebuffer&&zu(e)?"nodebuffer":Mu.uint8array&&e instanceof Uint8Array?"uint8array":Mu.arraybuffer&&e instanceof ArrayBuffer?"arraybuffer":void 0},t.checkSupport=function(e){if(!Mu[e.toLowerCase()])throw new Error(e+" is not supported by this platform")},t.MAX_VALUE_16BITS=65535,t.MAX_VALUE_32BITS=-1,t.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},t.delay=function(e,t,n){Vu((function(){e.apply(n||null,t||[])}))},t.inherits=function(e,t){var n=function(){};n.prototype=t.prototype,e.prototype=new n},t.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},t.prepareContent=function(e,n,i,o,a){return lc.Promise.resolve(n).then((function(e){return Mu.blob&&(e instanceof Blob||-1!==["[object File]","[object Blob]"].indexOf(Object.prototype.toString.call(e)))&&"undefined"!=typeof FileReader?new lc.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(n){var s,u=t.getTypeOf(n);return u?("arraybuffer"===u?n=t.transformTo("uint8array",n):"string"===u&&(a?n=Du(n):i&&!0!==o&&(n=r(s=n,Mu.uint8array?new Uint8Array(s.length):new Array(s.length)))),n):lc.Promise.reject(new Error("Can't read the data of '"+e+"'. Is it in a supported JavaScript type (String, Blob, ArrayBuffer, etc) ?"))}))}}));hc.newBlob,hc.applyFromCharCode,hc.transformTo,hc.getTypeOf,hc.checkSupport,hc.MAX_VALUE_16BITS,hc.MAX_VALUE_32BITS,hc.pretty,hc.delay,hc.inherits,hc.extend,hc.prepareContent;function fc(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}fc.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;this.isPaused=!1;var e=!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}};var dc=fc,pc=i((function(e,t){for(var n=new Array(256),r=0;r<256;r++)n[r]=r>=252?6:r>=248?5:r>=240?4:r>=224?3:r>=192?2:1;n[254]=n[254]=1;function i(){dc.call(this,"utf-8 decode"),this.leftOver=null}function o(){dc.call(this,"utf-8 encode")}t.utf8encode=function(e){return Mu.nodebuffer?Uu(e,"utf-8"):function(e){var t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=Mu.uint8array?new Uint8Array(s):new Array(s),o=0,i=0;o<s;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t}(e)},t.utf8decode=function(e){return Mu.nodebuffer?hc.transformTo("nodebuffer",e).toString("utf-8"):function(e){var t,r,i,o,a=e.length,s=new Array(2*a);for(r=0,t=0;t<a;)if((i=e[t++])<128)s[r++]=i;else if((o=n[i])>4)s[r++]=65533,t+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&t<a;)i=i<<6|63&e[t++],o--;o>1?s[r++]=65533:i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|1023&i)}return s.length!==r&&(s.subarray?s=s.subarray(0,r):s.length=r),hc.applyFromCharCode(s)}(e=hc.transformTo(Mu.uint8array?"uint8array":"array",e))},hc.inherits(i,dc),i.prototype.processChunk=function(e){var r=hc.transformTo(Mu.uint8array?"uint8array":"array",e.data);if(this.leftOver&&this.leftOver.length){if(Mu.uint8array){var i=r;(r=new Uint8Array(i.length+this.leftOver.length)).set(this.leftOver,0),r.set(i,this.leftOver.length)}else r=this.leftOver.concat(r);this.leftOver=null}var o=function(e,t){var r;for((t=t||e.length)>e.length&&(t=e.length),r=t-1;r>=0&&128==(192&e[r]);)r--;return r<0||0===r?t:r+n[e[r]]>t?r:t}(r),a=r;o!==r.length&&(Mu.uint8array?(a=r.subarray(0,o),this.leftOver=r.subarray(o,r.length)):(a=r.slice(0,o),this.leftOver=r.slice(o,r.length))),this.push({data:t.utf8decode(a),meta:e.meta})},i.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:t.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},t.Utf8DecodeWorker=i,hc.inherits(o,dc),o.prototype.processChunk=function(e){this.push({data:t.utf8encode(e.data),meta:e.meta})},t.Utf8EncodeWorker=o}));pc.utf8encode,pc.utf8decode,pc.Utf8DecodeWorker,pc.Utf8EncodeWorker;function vc(e){dc.call(this,"ConvertWorker to "+e),this.destType=e}hc.inherits(vc,dc),vc.prototype.processChunk=function(e){this.push({data:hc.transformTo(this.destType,e.data),meta:e.meta})};var gc=vc,mc=Nu.Readable;function yc(e,t,n){mc.call(this,t),this._helper=e;var r=this;e.on("data",(function(e,t){r.push(e)||r._helper.pause(),n&&n(t)})).on("error",(function(e){r.emit("error",e)})).on("end",(function(){r.push(null)}))}hc.inherits(yc,mc),yc.prototype._read=function(){this._helper.resume()};var bc=yc,wc=null;if(Mu.nodestream)try{wc=bc}catch(e){}function kc(e,t){return new lc.Promise((function(n,r){var i=[],o=e._internalType,a=e._outputType,s=e._mimeType;e.on("data",(function(e,n){i.push(e),t&&t(n)})).on("error",(function(e){i=[],r(e)})).on("end",(function(){try{var e=function(e,t,n){switch(e){case"blob":return hc.newBlob(hc.transformTo("arraybuffer",t),n);case"base64":return Bu(t);default:return hc.transformTo(e,t)}}(a,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+"'")}}(o,i),s);n(e)}catch(e){r(e)}i=[]})).resume()}))}function _c(e,t,n){var r=t;switch(t){case"blob":case"arraybuffer":r="uint8array";break;case"base64":r="string"}try{this._internalType=r,this._outputType=t,this._mimeType=n,hc.checkSupport(r),this._worker=e.pipe(new gc(r)),e.lock()}catch(e){this._worker=new dc("error"),this._worker.error(e)}}_c.prototype={accumulate:function(e){return kc(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(){hc.delay(t,arguments,n)})),this},resume:function(){return hc.delay(this._worker.resume,[],this._worker),this},pause:function(){return this._worker.pause(),this},toNodejsStream:function(e){if(hc.checkSupport("nodestream"),"nodebuffer"!==this._outputType)throw new Error(this._outputType+" is not supported by this method");return new wc(this,{objectMode:"nodebuffer"!==this._outputType},e)}};var Sc=_c,xc={base64:!1,binary:!1,dir:!1,createFolders:!0,date:null,compression:null,compressionOptions:null,comment:null,unixPermissions:null,dosPermissions:null};function Ec(e){dc.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=hc.getTypeOf(e),t.isPaused||t._tickAndRepeat()}),(function(e){t.error(e)}))}hc.inherits(Ec,dc),Ec.prototype.cleanUp=function(){dc.prototype.cleanUp.call(this),this.data=null},Ec.prototype.resume=function(){return!!dc.prototype.resume.call(this)&&(!this._tickScheduled&&this.dataIsReady&&(this._tickScheduled=!0,hc.delay(this._tickAndRepeat,[],this)),!0)},Ec.prototype._tickAndRepeat=function(){this._tickScheduled=!1,this.isPaused||this.isFinished||(this._tick(),this.isFinished||(hc.delay(this._tickAndRepeat,[],this),this._tickScheduled=!0))},Ec.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}})};var Oc=Ec;function Cc(e){dc.call(this,"DataLengthProbe for "+e),this.propName=e,this.withStreamInfo(e,0)}hc.inherits(Cc,dc),Cc.prototype.processChunk=function(e){if(e){var t=this.streamInfo[this.propName]||0;this.streamInfo[this.propName]=t+e.data.length}dc.prototype.processChunk.call(this,e)};var Ac=Cc;var Ic=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}();var Tc=function(e,t){return void 0!==e&&e.length?"string"!==hc.getTypeOf(e)?function(e,t,n,r){var i=Ic,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e}(0|t,e,e.length,0):function(e,t,n,r){var i=Ic,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t.charCodeAt(a))];return-1^e}(0|t,e,e.length,0):0};function Rc(){dc.call(this,"Crc32Probe"),this.withStreamInfo("crc32",0)}hc.inherits(Rc,dc),Rc.prototype.processChunk=function(e){this.streamInfo.crc32=Tc(e.data,this.streamInfo.crc32||0),this.push(e)};var Lc=Rc;function Nc(e,t,n,r,i){this.compressedSize=e,this.uncompressedSize=t,this.crc32=n,this.compression=r,this.compressedContent=i}Nc.prototype={getContentWorker:function(){var e=new Oc(lc.Promise.resolve(this.compressedContent)).pipe(this.compression.uncompressWorker()).pipe(new Ac("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 Oc(lc.Promise.resolve(this.compressedContent)).withStreamInfo("compressedSize",this.compressedSize).withStreamInfo("uncompressedSize",this.uncompressedSize).withStreamInfo("crc32",this.crc32).withStreamInfo("compression",this.compression)}},Nc.createWorkerFrom=function(e,t,n){return e.pipe(new Lc).pipe(new Ac("uncompressedSize")).pipe(t.compressWorker(n)).pipe(new Ac("compressedSize")).withStreamInfo("compression",t)};var Mc=Nc,Pc=function(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}};Pc.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 i=!this._dataBinary;i&&!r&&(t=t.pipe(new pc.Utf8EncodeWorker)),!i&&r&&(t=t.pipe(new pc.Utf8DecodeWorker))}catch(e){(t=new dc("error")).error(e)}return new Sc(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 Mc&&this._data.compression.magic===e.magic)return this._data.getCompressedWorker();var n=this._decompressWorker();return this._dataBinary||(n=n.pipe(new pc.Utf8EncodeWorker)),Mc.createWorkerFrom(n,e,t)},_decompressWorker:function(){return this._data instanceof Mc?this._data.getContentWorker():this._data instanceof dc?this._data:new Oc(this._data)}};for(var Bc=["asText","asBinary","asNodeBuffer","asUint8Array","asArrayBuffer"],Dc=function(){throw new Error("This method has been removed in JSZip 3.0, please check the upgrade guide.")},jc=0;jc<Bc.length;jc++)Pc.prototype[Bc[jc]]=Dc;var Uc=Pc,Fc=i((function(e,t){var n="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Int32Array;function r(e,t){return Object.prototype.hasOwnProperty.call(e,t)}t.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 i in n)r(n,i)&&(e[i]=n[i])}}return e},t.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(r=0,t=0,n=e.length;t<n;t++)r+=e[t].length;for(a=new Uint8Array(r),i=0,t=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)}};t.setTyped=function(e){e?(t.Buf8=Uint8Array,t.Buf16=Uint16Array,t.Buf32=Int32Array,t.assign(t,i)):(t.Buf8=Array,t.Buf16=Array,t.Buf32=Array,t.assign(t,o))},t.setTyped(n)}));Fc.assign,Fc.shrinkBuf,Fc.setTyped,Fc.Buf8,Fc.Buf16,Fc.Buf32;function zc(e){for(var t=e.length;--t>=0;)e[t]=0}var Hc=[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],Vc=[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],Wc=[0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,2,3,7],Kc=[16,17,18,0,8,7,9,6,10,5,11,4,12,3,13,2,14,1,15],qc=new Array(576);zc(qc);var Gc=new Array(60);zc(Gc);var Yc=new Array(512);zc(Yc);var Zc=new Array(256);zc(Zc);var Xc=new Array(29);zc(Xc);var Jc,$c,Qc,el=new Array(30);function tl(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 nl(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function rl(e){return e<256?Yc[e]:Yc[256+(e>>>7)]}function il(e,t){e.pending_buf[e.pending++]=255&t,e.pending_buf[e.pending++]=t>>>8&255}function ol(e,t,n){e.bi_valid>16-n?(e.bi_buf|=t<<e.bi_valid&65535,il(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 al(e,t,n){ol(e,n[2*t],n[2*t+1])}function sl(e,t){var n=0;do{n|=1&e,e>>>=1,n<<=1}while(--t>0);return n>>>1}function ul(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=15;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]=sl(o[s]++,s))}}function cl(e){var t;for(t=0;t<286;t++)e.dyn_ltree[2*t]=0;for(t=0;t<30;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 ll(e){e.bi_valid>8?il(e,e.bi_buf):e.bi_valid>0&&(e.pending_buf[e.pending++]=e.bi_buf),e.bi_buf=0,e.bi_valid=0}function hl(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 fl(e,t,n){for(var r=e.heap[n],i=n<<1;i<=e.heap_len&&(i<e.heap_len&&hl(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!hl(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function dl(e,t,n){var r,i,o,a,s=0;if(0!==e.last_lit)do{r=e.pending_buf[e.d_buf+2*s]<<8|e.pending_buf[e.d_buf+2*s+1],i=e.pending_buf[e.l_buf+s],s++,0===r?al(e,i,t):(al(e,(o=Zc[i])+256+1,t),0!==(a=Hc[o])&&ol(e,i-=Xc[o],a),al(e,o=rl(--r),n),0!==(a=Vc[o])&&ol(e,r-=el[o],a))}while(s<e.last_lit);al(e,256,t)}function pl(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,c=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<u;n++)0!==o[2*n]?(e.heap[++e.heap_len]=c=n,e.depth[n]=0):o[2*n+1]=0;for(;e.heap_len<2;)o[2*(i=e.heap[++e.heap_len]=c<2?++c:0)]=1,e.depth[i]=0,e.opt_len--,s&&(e.static_len-=a[2*i+1]);for(t.max_code=c,n=e.heap_len>>1;n>=1;n--)fl(e,o,n);i=u;do{n=e.heap[1],e.heap[1]=e.heap[e.heap_len--],fl(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++,fl(e,o,1)}while(e.heap_len>=2);e.heap[--e.heap_max]=e.heap[1],function(e,t){var n,r,i,o,a,s,u=t.dyn_tree,c=t.max_code,l=t.stat_desc.static_tree,h=t.stat_desc.has_stree,f=t.stat_desc.extra_bits,d=t.stat_desc.extra_base,p=t.stat_desc.max_length,v=0;for(o=0;o<=15;o++)e.bl_count[o]=0;for(u[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)(o=u[2*u[2*(r=e.heap[n])+1]+1]+1)>p&&(o=p,v++),u[2*r+1]=o,r>c||(e.bl_count[o]++,a=0,r>=d&&(a=f[r-d]),s=u[2*r],e.opt_len+=s*(o+a),h&&(e.static_len+=s*(l[2*r+1]+a)));if(0!==v){do{for(o=p-1;0===e.bl_count[o];)o--;e.bl_count[o]--,e.bl_count[o+1]+=2,e.bl_count[p]--,v-=2}while(v>0);for(o=p;0!==o;o--)for(r=e.bl_count[o];0!==r;)(i=e.heap[--n])>c||(u[2*i+1]!==o&&(e.opt_len+=(o-u[2*i+1])*u[2*i],u[2*i+1]=o),r--)}}(e,t),ul(o,c,e.bl_count)}function vl(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<c?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]++,s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4))}function gl(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)do{al(e,i,e.bl_tree)}while(0!=--s);else 0!==i?(i!==o&&(al(e,i,e.bl_tree),s--),al(e,16,e.bl_tree),ol(e,s-3,2)):s<=10?(al(e,17,e.bl_tree),ol(e,s-3,3)):(al(e,18,e.bl_tree),ol(e,s-11,7));s=0,o=i,0===a?(u=138,c=3):i===a?(u=6,c=3):(u=7,c=4)}}zc(el);var ml=!1;function yl(e,t,n,r){ol(e,0+(r?1:0),3),function(e,t,n,r){ll(e),r&&(il(e,n),il(e,~n)),Fc.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n,!0)}var bl={_tr_init:function(e){ml||(!function(){var e,t,n,r,i,o=new Array(16);for(n=0,r=0;r<28;r++)for(Xc[r]=n,e=0;e<1<<Hc[r];e++)Zc[n++]=r;for(Zc[n-1]=r,i=0,r=0;r<16;r++)for(el[r]=i,e=0;e<1<<Vc[r];e++)Yc[i++]=r;for(i>>=7;r<30;r++)for(el[r]=i<<7,e=0;e<1<<Vc[r]-7;e++)Yc[256+i++]=r;for(t=0;t<=15;t++)o[t]=0;for(e=0;e<=143;)qc[2*e+1]=8,e++,o[8]++;for(;e<=255;)qc[2*e+1]=9,e++,o[9]++;for(;e<=279;)qc[2*e+1]=7,e++,o[7]++;for(;e<=287;)qc[2*e+1]=8,e++,o[8]++;for(ul(qc,287,o),e=0;e<30;e++)Gc[2*e+1]=5,Gc[2*e]=sl(e,5);Jc=new tl(qc,Hc,257,286,15),$c=new tl(Gc,Vc,0,30,15),Qc=new tl(new Array(0),Wc,0,19,7)}(),ml=!0),e.l_desc=new nl(e.dyn_ltree,Jc),e.d_desc=new nl(e.dyn_dtree,$c),e.bl_desc=new nl(e.bl_tree,Qc),e.bi_buf=0,e.bi_valid=0,cl(e)},_tr_stored_block:yl,_tr_flush_block:function(e,t,n,r){var i,o,a=0;e.level>0?(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<256;t++)if(0!==e.dyn_ltree[2*t])return 1;return 0}(e)),pl(e,e.l_desc),pl(e,e.d_desc),a=function(e){var t;for(vl(e,e.dyn_ltree,e.l_desc.max_code),vl(e,e.dyn_dtree,e.d_desc.max_code),pl(e,e.bl_desc),t=18;t>=3&&0===e.bl_tree[2*Kc[t]+1];t--);return e.opt_len+=3*(t+1)+5+5+4,t}(e),i=e.opt_len+3+7>>>3,(o=e.static_len+3+7>>>3)<=i&&(i=o)):i=o=n+5,n+4<=i&&-1!==t?yl(e,t,n,r):4===e.strategy||o===i?(ol(e,2+(r?1:0),3),dl(e,qc,Gc)):(ol(e,4+(r?1:0),3),function(e,t,n,r){var i;for(ol(e,t-257,5),ol(e,n-1,5),ol(e,r-4,4),i=0;i<r;i++)ol(e,e.bl_tree[2*Kc[i]+1],3);gl(e,e.dyn_ltree,t-1),gl(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,a+1),dl(e,e.dyn_ltree,e.dyn_dtree)),cl(e),r&&ll(e)},_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*(Zc[n]+256+1)]++,e.dyn_dtree[2*rl(t)]++),e.last_lit===e.lit_bufsize-1},_tr_align:function(e){ol(e,2,3),al(e,256,qc),function(e){16===e.bi_valid?(il(e,e.bi_buf),e.bi_buf=0,e.bi_valid=0):e.bi_valid>=8&&(e.pending_buf[e.pending++]=255&e.bi_buf,e.bi_buf>>=8,e.bi_valid-=8)}(e)}};var wl=function(e,t,n,r){for(var i=65535&e|0,o=e>>>16&65535|0,a=0;0!==n;){n-=a=n>2e3?2e3:n;do{o=o+(i=i+t[r++]|0)|0}while(--a);i%=65521,o%=65521}return i|o<<16|0};var kl=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}();var _l,Sl=function(e,t,n,r){var i=kl,o=r+n;e^=-1;for(var a=r;a<o;a++)e=e>>>8^i[255&(e^t[a])];return-1^e},xl={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"};function El(e,t){return e.msg=xl[t],t}function Ol(e){return(e<<1)-(e>4?9:0)}function Cl(e){for(var t=e.length;--t>=0;)e[t]=0}function Al(e){var t=e.state,n=t.pending;n>e.avail_out&&(n=e.avail_out),0!==n&&(Fc.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 Il(e,t){bl._tr_flush_block(e,e.block_start>=0?e.block_start:-1,e.strstart-e.block_start,t),e.block_start=e.strstart,Al(e.strm)}function Tl(e,t){e.pending_buf[e.pending++]=t}function Rl(e,t){e.pending_buf[e.pending++]=t>>>8&255,e.pending_buf[e.pending++]=255&t}function Ll(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-262?e.strstart-(e.w_size-262):0,c=e.window,l=e.w_mask,h=e.prev,f=e.strstart+258,d=c[o+a-1],p=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===p&&c[n+a-1]===d&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<f);if(r=258-(f-o),o=f-258,r>a){if(e.match_start=t,a=r,r>=s)break;d=c[o+a-1],p=c[o+a]}}}while((t=h[t&l])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function Nl(e){var t,n,r,i,o,a,s,u,c,l,h=e.w_size;do{if(i=e.window_size-e.lookahead-e.strstart,e.strstart>=h+(h-262)){Fc.arraySet(e.window,e.window,h,h,0),e.match_start-=h,e.strstart-=h,e.block_start-=h,t=n=e.hash_size;do{r=e.head[--t],e.head[t]=r>=h?r-h:0}while(--n);t=n=h;do{r=e.prev[--t],e.prev[t]=r>=h?r-h:0}while(--n);i+=h}if(0===e.strm.avail_in)break;if(a=e.strm,s=e.window,u=e.strstart+e.lookahead,c=i,l=void 0,(l=a.avail_in)>c&&(l=c),n=0===l?0:(a.avail_in-=l,Fc.arraySet(s,a.input,a.next_in,l,u),1===a.state.wrap?a.adler=wl(a.adler,s,l,u):2===a.state.wrap&&(a.adler=Sl(a.adler,s,l,u)),a.next_in+=l,a.total_in+=l,l),e.lookahead+=n,e.lookahead+e.insert>=3)for(o=e.strstart-e.insert,e.ins_h=e.window[o],e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[o+3-1])&e.hash_mask,e.prev[o&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=o,o++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<262&&0!==e.strm.avail_in)}function Ml(e,t){for(var n,r;;){if(e.lookahead<262){if(Nl(e),e.lookahead<262&&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-262&&(e.match_length=Ll(e,n)),e.match_length>=3)if(r=bl._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){e.match_length--;do{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}while(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=bl._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++;if(r&&(Il(e,!1),0===e.strm.avail_out))return 1}return e.insert=e.strstart<2?e.strstart:2,4===t?(Il(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Il(e,!1),0===e.strm.avail_out)?1:2}function Pl(e,t){for(var n,r,i;;){if(e.lookahead<262){if(Nl(e),e.lookahead<262&&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-262&&(e.match_length=Ll(e,n),e.match_length<=5&&(1===e.strategy||3===e.match_length&&e.strstart-e.match_start>4096)&&(e.match_length=2)),e.prev_length>=3&&e.match_length<=e.prev_length){i=e.strstart+e.lookahead-3,r=bl._tr_tally(e,e.strstart-1-e.prev_match,e.prev_length-3),e.lookahead-=e.prev_length-1,e.prev_length-=2;do{++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)}while(0!=--e.prev_length);if(e.match_available=0,e.match_length=2,e.strstart++,r&&(Il(e,!1),0===e.strm.avail_out))return 1}else if(e.match_available){if((r=bl._tr_tally(e,0,e.window[e.strstart-1]))&&Il(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=bl._tr_tally(e,0,e.window[e.strstart-1]),e.match_available=0),e.insert=e.strstart<2?e.strstart:2,4===t?(Il(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Il(e,!1),0===e.strm.avail_out)?1:2}function Bl(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 Dl(){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 Fc.Buf16(1146),this.dyn_dtree=new Fc.Buf16(122),this.bl_tree=new Fc.Buf16(78),Cl(this.dyn_ltree),Cl(this.dyn_dtree),Cl(this.bl_tree),this.l_desc=null,this.d_desc=null,this.bl_desc=null,this.bl_count=new Fc.Buf16(16),this.heap=new Fc.Buf16(573),Cl(this.heap),this.heap_len=0,this.heap_max=0,this.depth=new Fc.Buf16(573),Cl(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 jl(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:113,e.adler=2===t.wrap?0:1,t.last_flush=0,bl._tr_init(t),0):El(e,-2)}function Ul(e){var t,n=jl(e);return 0===n&&((t=e.state).window_size=2*t.w_size,Cl(t.head),t.max_lazy_match=_l[t.level].max_lazy,t.good_match=_l[t.level].good_length,t.nice_match=_l[t.level].nice_length,t.max_chain_length=_l[t.level].max_chain,t.strstart=0,t.block_start=0,t.lookahead=0,t.insert=0,t.match_length=t.prev_length=2,t.match_available=0,t.ins_h=0),n}function Fl(e,t,n,r,i,o){if(!e)return-2;var a=1;if(-1===t&&(t=6),r<0?(a=0,r=-r):r>15&&(a=2,r-=16),i<1||i>9||8!==n||r<8||r>15||t<0||t>9||o<0||o>4)return El(e,-2);8===r&&(r=9);var s=new Dl;return e.state=s,s.strm=e,s.wrap=a,s.gzhead=null,s.w_bits=r,s.w_size=1<<s.w_bits,s.w_mask=s.w_size-1,s.hash_bits=i+7,s.hash_size=1<<s.hash_bits,s.hash_mask=s.hash_size-1,s.hash_shift=~~((s.hash_bits+3-1)/3),s.window=new Fc.Buf8(2*s.w_size),s.head=new Fc.Buf16(s.hash_size),s.prev=new Fc.Buf16(s.w_size),s.lit_bufsize=1<<i+6,s.pending_buf_size=4*s.lit_bufsize,s.pending_buf=new Fc.Buf8(s.pending_buf_size),s.d_buf=1*s.lit_bufsize,s.l_buf=3*s.lit_bufsize,s.level=t,s.strategy=o,s.method=n,Ul(e)}_l=[new Bl(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(Nl(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,Il(e,!1),0===e.strm.avail_out))return 1;if(e.strstart-e.block_start>=e.w_size-262&&(Il(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Il(e,!0),0===e.strm.avail_out?3:4):(e.strstart>e.block_start&&(Il(e,!1),e.strm.avail_out),1)})),new Bl(4,4,8,4,Ml),new Bl(4,5,16,8,Ml),new Bl(4,6,32,32,Ml),new Bl(4,4,16,16,Pl),new Bl(8,16,32,32,Pl),new Bl(8,16,128,128,Pl),new Bl(8,32,128,256,Pl),new Bl(32,128,258,1024,Pl),new Bl(32,258,258,4096,Pl)];var zl={deflateInit:function(e,t){return Fl(e,t,8,15,8,0)},deflateInit2:Fl,deflateReset:Ul,deflateResetKeep:jl,deflateSetHeader:function(e,t){return e&&e.state?2!==e.state.wrap?-2:(e.state.gzhead=t,0):-2},deflate:function(e,t){var n,r,i,o;if(!e||!e.state||t>5||t<0)return e?El(e,-2):-2;if(r=e.state,!e.output||!e.input&&0!==e.avail_in||666===r.status&&4!==t)return El(e,0===e.avail_out?-5:-2);if(r.strm=e,n=r.last_flush,r.last_flush=t,42===r.status)if(2===r.wrap)e.adler=0,Tl(r,31),Tl(r,139),Tl(r,8),r.gzhead?(Tl(r,(r.gzhead.text?1:0)+(r.gzhead.hcrc?2:0)+(r.gzhead.extra?4:0)+(r.gzhead.name?8:0)+(r.gzhead.comment?16:0)),Tl(r,255&r.gzhead.time),Tl(r,r.gzhead.time>>8&255),Tl(r,r.gzhead.time>>16&255),Tl(r,r.gzhead.time>>24&255),Tl(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Tl(r,255&r.gzhead.os),r.gzhead.extra&&r.gzhead.extra.length&&(Tl(r,255&r.gzhead.extra.length),Tl(r,r.gzhead.extra.length>>8&255)),r.gzhead.hcrc&&(e.adler=Sl(e.adler,r.pending_buf,r.pending,0)),r.gzindex=0,r.status=69):(Tl(r,0),Tl(r,0),Tl(r,0),Tl(r,0),Tl(r,0),Tl(r,9===r.level?2:r.strategy>=2||r.level<2?4:0),Tl(r,3),r.status=113);else{var a=8+(r.w_bits-8<<4)<<8;a|=(r.strategy>=2||r.level<2?0:r.level<6?1:6===r.level?2:3)<<6,0!==r.strstart&&(a|=32),a+=31-a%31,r.status=113,Rl(r,a),0!==r.strstart&&(Rl(r,e.adler>>>16),Rl(r,65535&e.adler)),e.adler=1}if(69===r.status)if(r.gzhead.extra){for(i=r.pending;r.gzindex<(65535&r.gzhead.extra.length)&&(r.pending!==r.pending_buf_size||(r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),Al(e),i=r.pending,r.pending!==r.pending_buf_size));)Tl(r,255&r.gzhead.extra[r.gzindex]),r.gzindex++;r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),r.gzindex===r.gzhead.extra.length&&(r.gzindex=0,r.status=73)}else r.status=73;if(73===r.status)if(r.gzhead.name){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),Al(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.name.length?255&r.gzhead.name.charCodeAt(r.gzindex++):0,Tl(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.gzindex=0,r.status=91)}else r.status=91;if(91===r.status)if(r.gzhead.comment){i=r.pending;do{if(r.pending===r.pending_buf_size&&(r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),Al(e),i=r.pending,r.pending===r.pending_buf_size)){o=1;break}o=r.gzindex<r.gzhead.comment.length?255&r.gzhead.comment.charCodeAt(r.gzindex++):0,Tl(r,o)}while(0!==o);r.gzhead.hcrc&&r.pending>i&&(e.adler=Sl(e.adler,r.pending_buf,r.pending-i,i)),0===o&&(r.status=103)}else r.status=103;if(103===r.status&&(r.gzhead.hcrc?(r.pending+2>r.pending_buf_size&&Al(e),r.pending+2<=r.pending_buf_size&&(Tl(r,255&e.adler),Tl(r,e.adler>>8&255),e.adler=0,r.status=113)):r.status=113),0!==r.pending){if(Al(e),0===e.avail_out)return r.last_flush=-1,0}else if(0===e.avail_in&&Ol(t)<=Ol(n)&&4!==t)return El(e,-5);if(666===r.status&&0!==e.avail_in)return El(e,-5);if(0!==e.avail_in||0!==r.lookahead||0!==t&&666!==r.status){var s=2===r.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(Nl(e),0===e.lookahead)){if(0===t)return 1;break}if(e.match_length=0,n=bl._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++,n&&(Il(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Il(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Il(e,!1),0===e.strm.avail_out)?1:2}(r,t):3===r.strategy?function(e,t){for(var n,r,i,o,a=e.window;;){if(e.lookahead<=258){if(Nl(e),e.lookahead<=258&&0===t)return 1;if(0===e.lookahead)break}if(e.match_length=0,e.lookahead>=3&&e.strstart>0&&(r=a[i=e.strstart-1])===a[++i]&&r===a[++i]&&r===a[++i]){o=e.strstart+258;do{}while(r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&r===a[++i]&&i<o);e.match_length=258-(o-i),e.match_length>e.lookahead&&(e.match_length=e.lookahead)}if(e.match_length>=3?(n=bl._tr_tally(e,1,e.match_length-3),e.lookahead-=e.match_length,e.strstart+=e.match_length,e.match_length=0):(n=bl._tr_tally(e,0,e.window[e.strstart]),e.lookahead--,e.strstart++),n&&(Il(e,!1),0===e.strm.avail_out))return 1}return e.insert=0,4===t?(Il(e,!0),0===e.strm.avail_out?3:4):e.last_lit&&(Il(e,!1),0===e.strm.avail_out)?1:2}(r,t):_l[r.level].func(r,t);if(3!==s&&4!==s||(r.status=666),1===s||3===s)return 0===e.avail_out&&(r.last_flush=-1),0;if(2===s&&(1===t?bl._tr_align(r):5!==t&&(bl._tr_stored_block(r,0,0,!1),3===t&&(Cl(r.head),0===r.lookahead&&(r.strstart=0,r.block_start=0,r.insert=0))),Al(e),0===e.avail_out))return r.last_flush=-1,0}return 4!==t?0:r.wrap<=0?1:(2===r.wrap?(Tl(r,255&e.adler),Tl(r,e.adler>>8&255),Tl(r,e.adler>>16&255),Tl(r,e.adler>>24&255),Tl(r,255&e.total_in),Tl(r,e.total_in>>8&255),Tl(r,e.total_in>>16&255),Tl(r,e.total_in>>24&255)):(Rl(r,e.adler>>>16),Rl(r,65535&e.adler)),Al(e),r.wrap>0&&(r.wrap=-r.wrap),0!==r.pending?0:1)},deflateEnd:function(e){var t;return e&&e.state?42!==(t=e.state.status)&&69!==t&&73!==t&&91!==t&&103!==t&&113!==t&&666!==t?El(e,-2):(e.state=null,113===t?El(e,-3):0):-2},deflateSetDictionary:function(e,t){var n,r,i,o,a,s,u,c,l=t.length;if(!e||!e.state)return-2;if(2===(o=(n=e.state).wrap)||1===o&&42!==n.status||n.lookahead)return-2;for(1===o&&(e.adler=wl(e.adler,t,l,0)),n.wrap=0,l>=n.w_size&&(0===o&&(Cl(n.head),n.strstart=0,n.block_start=0,n.insert=0),c=new Fc.Buf8(n.w_size),Fc.arraySet(c,t,l-n.w_size,n.w_size,0),t=c,l=n.w_size),a=e.avail_in,s=e.next_in,u=e.input,e.avail_in=l,e.next_in=0,e.input=t,Nl(n);n.lookahead>=3;){r=n.strstart,i=n.lookahead-2;do{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++}while(--i);n.strstart=r,n.lookahead=2,Nl(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=s,e.input=u,e.avail_in=a,n.wrap=o,0},deflateInfo:"pako deflate (from Nodeca project)"},Hl=!0,Vl=!0;try{String.fromCharCode.apply(null,[0])}catch(e){Hl=!1}try{String.fromCharCode.apply(null,new Uint8Array(1))}catch(e){Vl=!1}for(var Wl=new Fc.Buf8(256),Kl=0;Kl<256;Kl++)Wl[Kl]=Kl>=252?6:Kl>=248?5:Kl>=240?4:Kl>=224?3:Kl>=192?2:1;Wl[254]=Wl[254]=1;function ql(e,t){if(t<65534&&(e.subarray&&Vl||!e.subarray&&Hl))return String.fromCharCode.apply(null,Fc.shrinkBuf(e,t));for(var n="",r=0;r<t;r++)n+=String.fromCharCode(e[r]);return n}var Gl=function(e){var t,n,r,i,o,a=e.length,s=0;for(i=0;i<a;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),s+=n<128?1:n<2048?2:n<65536?3:4;for(t=new Fc.Buf8(s),o=0,i=0;o<s;i++)55296==(64512&(n=e.charCodeAt(i)))&&i+1<a&&56320==(64512&(r=e.charCodeAt(i+1)))&&(n=65536+(n-55296<<10)+(r-56320),i++),n<128?t[o++]=n:n<2048?(t[o++]=192|n>>>6,t[o++]=128|63&n):n<65536?(t[o++]=224|n>>>12,t[o++]=128|n>>>6&63,t[o++]=128|63&n):(t[o++]=240|n>>>18,t[o++]=128|n>>>12&63,t[o++]=128|n>>>6&63,t[o++]=128|63&n);return t},Yl=function(e){return ql(e,e.length)},Zl=function(e){for(var t=new Fc.Buf8(e.length),n=0,r=t.length;n<r;n++)t[n]=e.charCodeAt(n);return t},Xl=function(e,t){var n,r,i,o,a=t||e.length,s=new Array(2*a);for(r=0,n=0;n<a;)if((i=e[n++])<128)s[r++]=i;else if((o=Wl[i])>4)s[r++]=65533,n+=o-1;else{for(i&=2===o?31:3===o?15:7;o>1&&n<a;)i=i<<6|63&e[n++],o--;o>1?s[r++]=65533:i<65536?s[r++]=i:(i-=65536,s[r++]=55296|i>>10&1023,s[r++]=56320|1023&i)}return ql(s,r)},Jl=function(e,t){var n;for((t=t||e.length)>e.length&&(t=e.length),n=t-1;n>=0&&128==(192&e[n]);)n--;return n<0||0===n?t:n+Wl[e[n]]>t?n:t};var $l=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},Ql=Object.prototype.toString;function eh(e){if(!(this instanceof eh))return new eh(e);this.options=Fc.assign({level:-1,method:8,chunkSize:16384,windowBits:15,memLevel:8,strategy:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>0?t.windowBits=-t.windowBits:t.gzip&&t.windowBits>0&&t.windowBits<16&&(t.windowBits+=16),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $l,this.strm.avail_out=0;var n=zl.deflateInit2(this.strm,t.level,t.method,t.windowBits,t.memLevel,t.strategy);if(0!==n)throw new Error(xl[n]);if(t.header&&zl.deflateSetHeader(this.strm,t.header),t.dictionary){var r;if(r="string"==typeof t.dictionary?Gl(t.dictionary):"[object ArrayBuffer]"===Ql.call(t.dictionary)?new Uint8Array(t.dictionary):t.dictionary,0!==(n=zl.deflateSetDictionary(this.strm,r)))throw new Error(xl[n]);this._dict_set=!0}}function th(e,t){var n=new eh(t);if(n.push(e,!0),n.err)throw n.msg||xl[n.err];return n.result}eh.prototype.push=function(e,t){var n,r,i=this.strm,o=this.options.chunkSize;if(this.ended)return!1;r=t===~~t?t:!0===t?4:0,"string"==typeof e?i.input=Gl(e):"[object ArrayBuffer]"===Ql.call(e)?i.input=new Uint8Array(e):i.input=e,i.next_in=0,i.avail_in=i.input.length;do{if(0===i.avail_out&&(i.output=new Fc.Buf8(o),i.next_out=0,i.avail_out=o),1!==(n=zl.deflate(i,r))&&0!==n)return this.onEnd(n),this.ended=!0,!1;0!==i.avail_out&&(0!==i.avail_in||4!==r&&2!==r)||("string"===this.options.to?this.onData(Yl(Fc.shrinkBuf(i.output,i.next_out))):this.onData(Fc.shrinkBuf(i.output,i.next_out)))}while((i.avail_in>0||0===i.avail_out)&&1!==n);return 4===r?(n=zl.deflateEnd(this.strm),this.onEnd(n),this.ended=!0,0===n):2!==r||(this.onEnd(0),i.avail_out=0,!0)},eh.prototype.onData=function(e){this.chunks.push(e)},eh.prototype.onEnd=function(e){0===e&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Fc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var nh={Deflate:eh,deflate:th,deflateRaw:function(e,t){return(t=t||{}).raw=!0,th(e,t)},gzip:function(e,t){return(t=t||{}).gzip=!0,th(e,t)}},rh=function(e,t){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,w,k,_,S,x,E,O;n=e.state,r=e.next_in,E=e.input,i=r+(e.avail_in-5),o=e.next_out,O=e.output,a=o-(t-e.avail_out),s=o+(e.avail_out-257),u=n.dmax,c=n.wsize,l=n.whave,h=n.wnext,f=n.window,d=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&&(d+=E[r++]<<p,p+=8,d+=E[r++]<<p,p+=8),b=v[d&m];t:for(;;){if(d>>>=w=b>>>24,p-=w,0===(w=b>>>16&255))O[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=v[(65535&b)+(d&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}k=65535&b,(w&=15)&&(p<w&&(d+=E[r++]<<p,p+=8),k+=d&(1<<w)-1,d>>>=w,p-=w),p<15&&(d+=E[r++]<<p,p+=8,d+=E[r++]<<p,p+=8),b=g[d&y];n:for(;;){if(d>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(d&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(_=65535&b,p<(w&=15)&&(d+=E[r++]<<p,(p+=8)<w&&(d+=E[r++]<<p,p+=8)),(_+=d&(1<<w)-1)>u){e.msg="invalid distance too far back",n.mode=30;break e}if(d>>>=w,p-=w,_>(w=o-a)){if((w=_-w)>l&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(S=0,x=f,0===h){if(S+=c-w,w<k){k-=w;do{O[o++]=f[S++]}while(--w);S=o-_,x=O}}else if(h<w){if(S+=c+h-w,(w-=h)<k){k-=w;do{O[o++]=f[S++]}while(--w);if(S=0,h<k){k-=w=h;do{O[o++]=f[S++]}while(--w);S=o-_,x=O}}}else if(S+=h-w,w<k){k-=w;do{O[o++]=f[S++]}while(--w);S=o-_,x=O}for(;k>2;)O[o++]=x[S++],O[o++]=x[S++],O[o++]=x[S++],k-=3;k&&(O[o++]=x[S++],k>1&&(O[o++]=x[S++]))}else{S=o-_;do{O[o++]=O[S++],O[o++]=O[S++],O[o++]=O[S++],k-=3}while(k>2);k&&(O[o++]=O[S++],k>1&&(O[o++]=O[S++]))}break}}break}}while(r<i&&o<s);r-=k=p>>3,d&=(1<<(p-=k<<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=d,n.bits=p},ih=[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],oh=[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],ah=[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],sh=[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],uh=function(e,t,n,r,i,o,a,s){var u,c,l,h,f,d,p,v,g,m=s.bits,y=0,b=0,w=0,k=0,_=0,S=0,x=0,E=0,O=0,C=0,A=null,I=0,T=new Fc.Buf16(16),R=new Fc.Buf16(16),L=null,N=0;for(y=0;y<=15;y++)T[y]=0;for(b=0;b<r;b++)T[t[n+b]]++;for(_=m,k=15;k>=1&&0===T[k];k--);if(_>k&&(_=k),0===k)return i[o++]=20971520,i[o++]=20971520,s.bits=1,0;for(w=1;w<k&&0===T[w];w++);for(_<w&&(_=w),E=1,y=1;y<=15;y++)if(E<<=1,(E-=T[y])<0)return-1;if(E>0&&(0===e||1!==k))return-1;for(R[1]=0,y=1;y<15;y++)R[y+1]=R[y]+T[y];for(b=0;b<r;b++)0!==t[n+b]&&(a[R[t[n+b]]++]=b);if(0===e?(A=L=a,d=19):1===e?(A=ih,I-=257,L=oh,N-=257,d=256):(A=ah,L=sh,d=-1),C=0,b=0,y=w,f=o,S=_,x=0,l=-1,h=(O=1<<_)-1,1===e&&O>852||2===e&&O>592)return 1;for(;;){p=y-x,a[b]<d?(v=0,g=a[b]):a[b]>d?(v=L[N+a[b]],g=A[I+a[b]]):(v=96,g=0),u=1<<y-x,w=c=1<<S;do{i[f+(C>>x)+(c-=u)]=p<<24|v<<16|g|0}while(0!==c);for(u=1<<y-1;C&u;)u>>=1;if(0!==u?(C&=u-1,C+=u):C=0,b++,0==--T[y]){if(y===k)break;y=t[n+a[b]]}if(y>_&&(C&h)!==l){for(0===x&&(x=_),f+=w,E=1<<(S=y-x);S+x<k&&!((E-=T[S+x])<=0);)S++,E<<=1;if(O+=1<<S,1===e&&O>852||2===e&&O>592)return 1;i[l=C&h]=_<<24|S<<16|f-o|0}}return 0!==C&&(i[f+C]=y-x<<24|64<<16|0),s.bits=_,0};function ch(e){return(e>>>24&255)+(e>>>8&65280)+((65280&e)<<8)+((255&e)<<24)}function lh(){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 Fc.Buf16(320),this.work=new Fc.Buf16(288),this.lendyn=null,this.distdyn=null,this.sane=0,this.back=0,this.was=0}function hh(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 Fc.Buf32(852),t.distcode=t.distdyn=new Fc.Buf32(592),t.sane=1,t.back=-1,0):-2}function fh(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,hh(e)):-2}function dh(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||t>15)?-2:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,fh(e))):-2}function ph(e,t){var n,r;return e?(r=new lh,e.state=r,r.window=null,0!==(n=dh(e,t))&&(e.state=null),n):-2}var vh,gh,mh=!0;function yh(e){if(mh){var t;for(vh=new Fc.Buf32(512),gh=new Fc.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(uh(1,e.lens,0,288,vh,0,e.work,{bits:9}),t=0;t<32;)e.lens[t++]=5;uh(2,e.lens,0,32,gh,0,e.work,{bits:5}),mh=!1}e.lencode=vh,e.lenbits=9,e.distcode=gh,e.distbits=5}function bh(e,t,n,r){var i,o=e.state;return null===o.window&&(o.wsize=1<<o.wbits,o.wnext=0,o.whave=0,o.window=new Fc.Buf8(o.wsize)),r>=o.wsize?(Fc.arraySet(o.window,t,n-o.wsize,o.wsize,0),o.wnext=0,o.whave=o.wsize):((i=o.wsize-o.wnext)>r&&(i=r),Fc.arraySet(o.window,t,n-r,i,o.wnext),(r-=i)?(Fc.arraySet(o.window,t,n-r,r,0),o.wnext=r,o.whave=o.wsize):(o.wnext+=i,o.wnext===o.wsize&&(o.wnext=0),o.whave<o.wsize&&(o.whave+=i))),0}var wh={inflateReset:fh,inflateReset2:dh,inflateResetKeep:hh,inflateInit:function(e){return ph(e,15)},inflateInit2:ph,inflate:function(e,t){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,w,k,_,S,x,E,O=0,C=new Fc.Buf8(4),A=[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-2;12===(n=e.state).mode&&(n.mode=13),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,h=s,f=u,S=0;e:for(;;)switch(n.mode){case 1:if(0===n.wrap){n.mode=13;break}for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(2&n.wrap&&35615===c){n.check=0,C[0]=255&c,C[1]=c>>>8&255,n.check=Sl(n.check,C,2,0),c=0,l=0,n.mode=2;break}if(n.flags=0,n.head&&(n.head.done=!1),!(1&n.wrap)||(((255&c)<<8)+(c>>8))%31){e.msg="incorrect header check",n.mode=30;break}if(8!=(15&c)){e.msg="unknown compression method",n.mode=30;break}if(l-=4,_=8+(15&(c>>>=4)),0===n.wbits)n.wbits=_;else if(_>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<_,e.adler=n.check=1,n.mode=512&c?10:12,c=0,l=0;break;case 2:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.flags=c,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=c>>8&1),512&n.flags&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Sl(n.check,C,2,0)),c=0,l=0,n.mode=3;case 3:for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.time=c),512&n.flags&&(C[0]=255&c,C[1]=c>>>8&255,C[2]=c>>>16&255,C[3]=c>>>24&255,n.check=Sl(n.check,C,4,0)),c=0,l=0,n.mode=4;case 4:for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.head&&(n.head.xflags=255&c,n.head.os=c>>8),512&n.flags&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Sl(n.check,C,2,0)),c=0,l=0,n.mode=5;case 5:if(1024&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length=c,n.head&&(n.head.extra_len=c),512&n.flags&&(C[0]=255&c,C[1]=c>>>8&255,n.check=Sl(n.check,C,2,0)),c=0,l=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&((d=n.length)>s&&(d=s),d&&(n.head&&(_=n.head.extra_len-n.length,n.head.extra||(n.head.extra=new Array(n.head.extra_len)),Fc.arraySet(n.head.extra,r,o,d,_)),512&n.flags&&(n.check=Sl(n.check,r,d,o)),s-=d,o+=d,n.length-=d),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===s)break e;d=0;do{_=r[o+d++],n.head&&_&&n.length<65536&&(n.head.name+=String.fromCharCode(_))}while(_&&d<s);if(512&n.flags&&(n.check=Sl(n.check,r,d,o)),s-=d,o+=d,_)break e}else n.head&&(n.head.name=null);n.length=0,n.mode=8;case 8:if(4096&n.flags){if(0===s)break e;d=0;do{_=r[o+d++],n.head&&_&&n.length<65536&&(n.head.comment+=String.fromCharCode(_))}while(_&&d<s);if(512&n.flags&&(n.check=Sl(n.check,r,d,o)),s-=d,o+=d,_)break e}else n.head&&(n.head.comment=null);n.mode=9;case 9:if(512&n.flags){for(;l<16;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(65535&n.check)){e.msg="header crc mismatch",n.mode=30;break}c=0,l=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(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}e.adler=n.check=ch(c),c=0,l=0,n.mode=11;case 11:if(0===n.havedict)return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,2;e.adler=n.check=1,n.mode=12;case 12:if(5===t||6===t)break e;case 13:if(n.last){c>>>=7&l,l-=7&l,n.mode=27;break}for(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}switch(n.last=1&c,l-=1,3&(c>>>=1)){case 0:n.mode=14;break;case 1:if(yh(n),n.mode=20,6===t){c>>>=2,l-=2;break e}break;case 2:n.mode=17;break;case 3:e.msg="invalid block type",n.mode=30}c>>>=2,l-=2;break;case 14:for(c>>>=7&l,l-=7&l;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if((65535&c)!=(c>>>16^65535)){e.msg="invalid stored block lengths",n.mode=30;break}if(n.length=65535&c,c=0,l=0,n.mode=15,6===t)break e;case 15:n.mode=16;case 16:if(d=n.length){if(d>s&&(d=s),d>u&&(d=u),0===d)break e;Fc.arraySet(i,r,o,d,a),s-=d,o+=d,u-=d,a+=d,n.length-=d;break}n.mode=12;break;case 17:for(;l<14;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(n.nlen=257+(31&c),c>>>=5,l-=5,n.ndist=1+(31&c),c>>>=5,l-=5,n.ncode=4+(15&c),c>>>=4,l-=4,n.nlen>286||n.ndist>30){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(;l<3;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.lens[A[n.have++]]=7&c,c>>>=3,l-=3}for(;n.have<19;)n.lens[A[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,x={bits:n.lenbits},S=uh(0,n.lens,0,19,n.lencode,0,n.work,x),n.lenbits=x.bits,S){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(;m=(O=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,y=65535&O,!((g=O>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(y<16)c>>>=g,l-=g,n.lens[n.have++]=y;else{if(16===y){for(E=g+2;l<E;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c>>>=g,l-=g,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}_=n.lens[n.have-1],d=3+(3&c),c>>>=2,l-=2}else if(17===y){for(E=g+3;l<E;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,_=0,d=3+(7&(c>>>=g)),c>>>=3,l-=3}else{for(E=g+7;l<E;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}l-=g,_=0,d=11+(127&(c>>>=g)),c>>>=7,l-=7}if(n.have+d>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;d--;)n.lens[n.have++]=_}}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,x={bits:n.lenbits},S=uh(1,n.lens,0,n.nlen,n.lencode,0,n.work,x),n.lenbits=x.bits,S){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,x={bits:n.distbits},S=uh(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,x),n.distbits=x.bits,S){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(s>=6&&u>=258){e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,rh(e,f),a=e.next_out,i=e.output,u=e.avail_out,o=e.next_in,r=e.input,s=e.avail_in,c=n.hold,l=n.bits,12===n.mode&&(n.back=-1);break}for(n.back=0;m=(O=n.lencode[c&(1<<n.lenbits)-1])>>>16&255,y=65535&O,!((g=O>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(m&&0==(240&m)){for(b=g,w=m,k=y;m=(O=n.lencode[k+((c&(1<<b+w)-1)>>b)])>>>16&255,y=65535&O,!(b+(g=O>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=b,l-=b,n.back+=b}if(c>>>=g,l-=g,n.back+=g,n.length=y,0===m){n.mode=26;break}if(32&m){n.back=-1,n.mode=12;break}if(64&m){e.msg="invalid literal/length code",n.mode=30;break}n.extra=15&m,n.mode=22;case 22:if(n.extra){for(E=n.extra;l<E;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.length+=c&(1<<n.extra)-1,c>>>=n.extra,l-=n.extra,n.back+=n.extra}n.was=n.length,n.mode=23;case 23:for(;m=(O=n.distcode[c&(1<<n.distbits)-1])>>>16&255,y=65535&O,!((g=O>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(0==(240&m)){for(b=g,w=m,k=y;m=(O=n.distcode[k+((c&(1<<b+w)-1)>>b)])>>>16&255,y=65535&O,!(b+(g=O>>>24)<=l);){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}c>>>=b,l-=b,n.back+=b}if(c>>>=g,l-=g,n.back+=g,64&m){e.msg="invalid distance code",n.mode=30;break}n.offset=y,n.extra=15&m,n.mode=24;case 24:if(n.extra){for(E=n.extra;l<E;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}n.offset+=c&(1<<n.extra)-1,c>>>=n.extra,l-=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===u)break e;if(d=f-u,n.offset>d){if((d=n.offset-d)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}d>n.wnext?(d-=n.wnext,p=n.wsize-d):p=n.wnext-d,d>n.length&&(d=n.length),v=n.window}else v=i,p=a-n.offset,d=n.length;d>u&&(d=u),u-=d,n.length-=d;do{i[a++]=v[p++]}while(--d);0===n.length&&(n.mode=21);break;case 26:if(0===u)break e;i[a++]=n.length,u--,n.mode=21;break;case 27:if(n.wrap){for(;l<32;){if(0===s)break e;s--,c|=r[o++]<<l,l+=8}if(f-=u,e.total_out+=f,n.total+=f,f&&(e.adler=n.check=n.flags?Sl(n.check,i,f,a-f):wl(n.check,i,f,a-f)),f=u,(n.flags?c:ch(c))!==n.check){e.msg="incorrect data check",n.mode=30;break}c=0,l=0}n.mode=28;case 28:if(n.wrap&&n.flags){for(;l<32;){if(0===s)break e;s--,c+=r[o++]<<l,l+=8}if(c!==(4294967295&n.total)){e.msg="incorrect length check",n.mode=30;break}c=0,l=0}n.mode=29;case 29:S=1;break e;case 30:S=-3;break e;case 31:return-4;case 32:default:return-2}return e.next_out=a,e.avail_out=u,e.next_in=o,e.avail_in=s,n.hold=c,n.bits=l,(n.wsize||f!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&bh(e,e.output,e.next_out,f-e.avail_out),h-=e.avail_in,f-=e.avail_out,e.total_in+=h,e.total_out+=f,n.total+=f,n.wrap&&f&&(e.adler=n.check=n.flags?Sl(n.check,i,f,e.next_out-f):wl(n.check,i,f,e.next_out-f)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0===h&&0===f||4===t)&&0===S&&(S=-5),S},inflateEnd:function(e){if(!e||!e.state)return-2;var t=e.state;return t.window&&(t.window=null),e.state=null,0},inflateGetHeader:function(e,t){var n;return e&&e.state?0==(2&(n=e.state).wrap)?-2:(n.head=t,t.done=!1,0):-2},inflateSetDictionary:function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?-2:11===n.mode&&wl(1,t,r,0)!==n.check?-3:bh(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):-2},inflateInfo:"pako inflate (from Nodeca project)"},kh={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};var _h=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},Sh=Object.prototype.toString;function xh(e){if(!(this instanceof xh))return new xh(e);this.options=Fc.assign({chunkSize:16384,windowBits:0,to:""},e||{});var t=this.options;t.raw&&t.windowBits>=0&&t.windowBits<16&&(t.windowBits=-t.windowBits,0===t.windowBits&&(t.windowBits=-15)),!(t.windowBits>=0&&t.windowBits<16)||e&&e.windowBits||(t.windowBits+=32),t.windowBits>15&&t.windowBits<48&&0==(15&t.windowBits)&&(t.windowBits|=15),this.err=0,this.msg="",this.ended=!1,this.chunks=[],this.strm=new $l,this.strm.avail_out=0;var n=wh.inflateInit2(this.strm,t.windowBits);if(n!==kh.Z_OK)throw new Error(xl[n]);if(this.header=new _h,wh.inflateGetHeader(this.strm,this.header),t.dictionary&&("string"==typeof t.dictionary?t.dictionary=Gl(t.dictionary):"[object ArrayBuffer]"===Sh.call(t.dictionary)&&(t.dictionary=new Uint8Array(t.dictionary)),t.raw&&(n=wh.inflateSetDictionary(this.strm,t.dictionary))!==kh.Z_OK))throw new Error(xl[n])}function Eh(e,t){var n=new xh(t);if(n.push(e,!0),n.err)throw n.msg||xl[n.err];return n.result}xh.prototype.push=function(e,t){var n,r,i,o,a,s=this.strm,u=this.options.chunkSize,c=this.options.dictionary,l=!1;if(this.ended)return!1;r=t===~~t?t:!0===t?kh.Z_FINISH:kh.Z_NO_FLUSH,"string"==typeof e?s.input=Zl(e):"[object ArrayBuffer]"===Sh.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 Fc.Buf8(u),s.next_out=0,s.avail_out=u),(n=wh.inflate(s,kh.Z_NO_FLUSH))===kh.Z_NEED_DICT&&c&&(n=wh.inflateSetDictionary(this.strm,c)),n===kh.Z_BUF_ERROR&&!0===l&&(n=kh.Z_OK,l=!1),n!==kh.Z_STREAM_END&&n!==kh.Z_OK)return this.onEnd(n),this.ended=!0,!1;s.next_out&&(0!==s.avail_out&&n!==kh.Z_STREAM_END&&(0!==s.avail_in||r!==kh.Z_FINISH&&r!==kh.Z_SYNC_FLUSH)||("string"===this.options.to?(i=Jl(s.output,s.next_out),o=s.next_out-i,a=Xl(s.output,i),s.next_out=o,s.avail_out=u-o,o&&Fc.arraySet(s.output,s.output,i,o,0),this.onData(a)):this.onData(Fc.shrinkBuf(s.output,s.next_out)))),0===s.avail_in&&0===s.avail_out&&(l=!0)}while((s.avail_in>0||0===s.avail_out)&&n!==kh.Z_STREAM_END);return n===kh.Z_STREAM_END&&(r=kh.Z_FINISH),r===kh.Z_FINISH?(n=wh.inflateEnd(this.strm),this.onEnd(n),this.ended=!0,n===kh.Z_OK):r!==kh.Z_SYNC_FLUSH||(this.onEnd(kh.Z_OK),s.avail_out=0,!0)},xh.prototype.onData=function(e){this.chunks.push(e)},xh.prototype.onEnd=function(e){e===kh.Z_OK&&("string"===this.options.to?this.result=this.chunks.join(""):this.result=Fc.flattenChunks(this.chunks)),this.chunks=[],this.err=e,this.msg=this.strm.msg};var Oh={Inflate:xh,inflate:Eh,inflateRaw:function(e,t){return(t=t||{}).raw=!0,Eh(e,t)},ungzip:Eh},Ch={};(0,Fc.assign)(Ch,nh,Oh,kh);var Ah=Ch,Ih="undefined"!=typeof Uint8Array&&"undefined"!=typeof Uint16Array&&"undefined"!=typeof Uint32Array?"uint8array":"array";function Th(e,t){dc.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}hc.inherits(Th,dc),Th.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(hc.transformTo(Ih,e.data),!1)},Th.prototype.flush=function(){dc.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},Th.prototype.cleanUp=function(){dc.prototype.cleanUp.call(this),this._pako=null},Th.prototype._createPako=function(){this._pako=new Ah[this._pakoAction]({raw:!0,level:this._pakoOptions.level||-1});var e=this;this._pako.onData=function(t){e.push({data:t,meta:e.meta})}};var Rh={STORE:{magic:"\0\0",compressWorker:function(e){return new dc("STORE compression")},uncompressWorker:function(){return new dc("STORE decompression")}},DEFLATE:{magic:"\b\0",compressWorker:function(e){return new Th("Deflate",e)},uncompressWorker:function(){return new Th("Inflate",{})}}},Lh="PK",Nh="PK",Mh="PK",Ph="PK",Bh="PK",Dh="PK\b",jh=function(e,t){var n,r="";for(n=0;n<t;n++)r+=String.fromCharCode(255&e),e>>>=8;return r},Uh=function(e,t,n,r,i,o){var a,s,u=e.file,c=e.compression,l=o!==pc.utf8encode,h=hc.transformTo("string",o(u.name)),f=hc.transformTo("string",pc.utf8encode(u.name)),d=u.comment,p=hc.transformTo("string",o(d)),v=hc.transformTo("string",pc.utf8encode(d)),g=f.length!==u.name.length,m=v.length!==d.length,y="",b="",w="",k=u.dir,_=u.date,S={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(S.crc32=e.crc32,S.compressedSize=e.compressedSize,S.uncompressedSize=e.uncompressedSize);var x=0;t&&(x|=8),l||!g&&!m||(x|=2048);var E=0,O=0;k&&(E|=16),"UNIX"===i?(O=798,E|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(u.unixPermissions,k)):(O=20,E|=function(e,t){return 63&(e||0)}(u.dosPermissions)),a=_.getUTCHours(),a<<=6,a|=_.getUTCMinutes(),a<<=5,a|=_.getUTCSeconds()/2,s=_.getUTCFullYear()-1980,s<<=4,s|=_.getUTCMonth()+1,s<<=5,s|=_.getUTCDate(),g&&(b=jh(1,1)+jh(Tc(h),4)+f,y+="up"+jh(b.length,2)+b),m&&(w=jh(1,1)+jh(Tc(p),4)+v,y+="uc"+jh(w.length,2)+w);var C="";return C+="\n\0",C+=jh(x,2),C+=c.magic,C+=jh(a,2),C+=jh(s,2),C+=jh(S.crc32,4),C+=jh(S.compressedSize,4),C+=jh(S.uncompressedSize,4),C+=jh(h.length,2),C+=jh(y.length,2),{fileRecord:Lh+C+h+y,dirRecord:Nh+jh(O,2)+C+jh(p.length,2)+"\0\0\0\0"+jh(E,4)+jh(r,4)+h+y+p}},Fh=function(e){return Dh+jh(e.crc32,4)+jh(e.compressedSize,4)+jh(e.uncompressedSize,4)};function zh(e,t,n,r){dc.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=[]}hc.inherits(zh,dc),zh.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,dc.prototype.push.call(this,{data:e.data,meta:{currentFile:this.currentFile,percent:n?(t+100*(n-r-1))/n:100}}))},zh.prototype.openedSource=function(e){this.currentSourceOffset=this.bytesWritten,this.currentFile=e.file.name;var t=this.streamFiles&&!e.file.dir;if(t){var n=Uh(e,t,!1,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);this.push({data:n.fileRecord,meta:{percent:0}})}else this.accumulate=!0},zh.prototype.closedSource=function(e){this.accumulate=!1;var t=this.streamFiles&&!e.file.dir,n=Uh(e,t,!0,this.currentSourceOffset,this.zipPlatform,this.encodeFileName);if(this.dirRecords.push(n.dirRecord),t)this.push({data:Fh(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},zh.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,r=function(e,t,n,r,i){var o=hc.transformTo("string",i(r));return Mh+"\0\0\0\0"+jh(e,2)+jh(e,2)+jh(t,4)+jh(n,4)+jh(o.length,2)+o}(this.dirRecords.length,n,e,this.zipComment,this.encodeFileName);this.push({data:r,meta:{percent:100}})},zh.prototype.prepareNextSource=function(){this.previous=this._sources.shift(),this.openedSource(this.previous.streamInfo),this.isPaused?this.previous.pause():this.previous.resume()},zh.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},zh.prototype.resume=function(){return!!dc.prototype.resume.call(this)&&(!this.previous&&this._sources.length?(this.prepareNextSource(),!0):this.previous||this._sources.length||this.generatedError?void 0:(this.end(),!0))},zh.prototype.error=function(e){var t=this._sources;if(!dc.prototype.error.call(this,e))return!1;for(var n=0;n<t.length;n++)try{t[n].error(e)}catch(e){}return!0},zh.prototype.lock=function(){dc.prototype.lock.call(this);for(var e=this._sources,t=0;t<e.length;t++)e[t].lock()};var Hh=zh,Vh=function(e,t,n){var r=new Hh(t.streamFiles,n,t.platform,t.encodeFileName),i=0;try{e.forEach((function(e,n){i++;var o=function(e,t){var n=e||t,r=Rh[n];if(!r)throw new Error(n+" is not a valid compression method !");return r}(n.options.compression,t.compression),a=n.options.compressionOptions||t.compressionOptions||{},s=n.dir,u=n.date;n._compressWorker(o,a).withStreamInfo("file",{name:e,dir:s,date:u,comment:n.comment||"",unixPermissions:n.unixPermissions,dosPermissions:n.dosPermissions}).pipe(r)})),r.entriesCount=i}catch(e){r.error(e)}return r};function Wh(e,t){dc.call(this,"Nodejs stream input adapter for "+e),this._upstreamEnded=!1,this._bindStream(t)}hc.inherits(Wh,dc),Wh.prototype._bindStream=function(e){var t=this;this._stream=e,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()}))},Wh.prototype.pause=function(){return!!dc.prototype.pause.call(this)&&(this._stream.pause(),!0)},Wh.prototype.resume=function(){return!!dc.prototype.resume.call(this)&&(this._upstreamEnded?this.end():this._stream.resume(),!0)};var Kh=Wh,qh=function(e,t,n){var r,i=hc.getTypeOf(t),o=hc.extend(n||{},xc);o.date=o.date||new Date,null!==o.compression&&(o.compression=o.compression.toUpperCase()),"string"==typeof o.unixPermissions&&(o.unixPermissions=parseInt(o.unixPermissions,8)),o.unixPermissions&&16384&o.unixPermissions&&(o.dir=!0),o.dosPermissions&&16&o.dosPermissions&&(o.dir=!0),o.dir&&(e=Yh(e)),o.createFolders&&(r=Gh(e))&&Zh.call(this,r,!0);var a="string"===i&&!1===o.binary&&!1===o.base64;n&&void 0!==n.binary||(o.binary=!a),(t instanceof Mc&&0===t.uncompressedSize||o.dir||!t||0===t.length)&&(o.base64=!1,o.binary=!0,t="",o.compression="STORE",i="string");var s=null;s=t instanceof Mc||t instanceof dc?t:ju&&Hu(t)?new Kh(e,t):hc.prepareContent(e,t,o.binary,o.optimizedBinaryString,o.base64);var u=new Uc(e,s,o);this.files[e]=u},Gh=function(e){"/"===e.slice(-1)&&(e=e.substring(0,e.length-1));var t=e.lastIndexOf("/");return t>0?e.substring(0,t):""},Yh=function(e){return"/"!==e.slice(-1)&&(e+="/"),e},Zh=function(e,t){return t=void 0!==t?t:xc.createFolders,e=Yh(e),this.files[e]||qh.call(this,e,null,{dir:!0,createFolders:t}),this.files[e]};function Xh(e){return"[object RegExp]"===Object.prototype.toString.call(e)}var Jh={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)this.files.hasOwnProperty(t)&&(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){if(Xh(e)){var r=e;return this.filter((function(e,t){return!t.dir&&r.test(e)}))}var i=this.files[this.root+e];return i&&!i.dir?i:null}return e=this.root+e,qh.call(this,e,t,n),this},folder:function(e){if(!e)return this;if(Xh(e))return this.filter((function(t,n){return n.dir&&e.test(t)}));var t=this.root+e,n=Zh.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=hc.extend(e||{},{streamFiles:!1,compression:"STORE",compressionOptions:null,type:"",platform:"DOS",comment:null,mimeType:"application/zip",encodeFileName:pc.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.");hc.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=Vh(this,n,r)}catch(e){(t=new dc("error")).error(e)}return new Sc(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)}};function $h(e){this.data=e,this.length=e.length,this.index=0,this.zero=0}$h.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 hc.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))}};var Qh=$h;function ef(e){Qh.call(this,e);for(var t=0;t<this.data.length;t++)e[t]=255&e[t]}hc.inherits(ef,Qh),ef.prototype.byteAt=function(e){return this.data[this.zero+e]},ef.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;o>=0;--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},ef.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]},ef.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};var tf=ef;function nf(e){Qh.call(this,e)}hc.inherits(nf,Qh),nf.prototype.byteAt=function(e){return this.data.charCodeAt(this.zero+e)},nf.prototype.lastIndexOfSignature=function(e){return this.data.lastIndexOf(e)-this.zero},nf.prototype.readAndCheckSignature=function(e){return e===this.readData(4)},nf.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};var rf=nf;function of(e){tf.call(this,e)}hc.inherits(of,tf),of.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};var af=of;function sf(e){af.call(this,e)}hc.inherits(sf,af),sf.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};var uf=sf,cf=function(e){var t=hc.getTypeOf(e);return hc.checkSupport(t),"string"!==t||Mu.uint8array?"nodebuffer"===t?new uf(e):Mu.uint8array?new af(hc.transformTo("uint8array",e)):new tf(hc.transformTo("array",e)):new rf(e)};function lf(e,t){this.options=e,this.loadOptions=t}lf.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 Rh)if(Rh.hasOwnProperty(t)&&Rh[t].magic===e)return Rh[t];return null}(this.compressionMethod)))throw new Error("Corrupted zip : compression "+hc.pretty(this.compressionMethod)+" unknown (inner file : "+hc.transformTo("string",this.fileName)+")");this.decompressed=new Mc(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=cf(this.extraFields[1].value);this.uncompressedSize===hc.MAX_VALUE_32BITS&&(this.uncompressedSize=t.readInt(8)),this.compressedSize===hc.MAX_VALUE_32BITS&&(this.compressedSize=t.readInt(8)),this.localHeaderOffset===hc.MAX_VALUE_32BITS&&(this.localHeaderOffset=t.readInt(8)),this.diskNumberStart===hc.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=Mu.uint8array?"uint8array":"array";if(this.useUTF8())this.fileNameStr=pc.utf8decode(this.fileName),this.fileCommentStr=pc.utf8decode(this.fileComment);else{var t=this.findExtraFieldUnicodePath();if(null!==t)this.fileNameStr=t;else{var n=hc.transformTo(e,this.fileName);this.fileNameStr=this.loadOptions.decodeFileName(n)}var r=this.findExtraFieldUnicodeComment();if(null!==r)this.fileCommentStr=r;else{var i=hc.transformTo(e,this.fileComment);this.fileCommentStr=this.loadOptions.decodeFileName(i)}}},findExtraFieldUnicodePath:function(){var e=this.extraFields[28789];if(e){var t=cf(e.value);return 1!==t.readInt(1)||Tc(this.fileName)!==t.readInt(4)?null:pc.utf8decode(t.readData(e.length-5))}return null},findExtraFieldUnicodeComment:function(){var e=this.extraFields[25461];if(e){var t=cf(e.value);return 1!==t.readInt(1)||Tc(this.fileComment)!==t.readInt(4)?null:pc.utf8decode(t.readData(e.length-5))}return null}};var hf=lf;function ff(e){this.files=[],this.loadOptions=e}ff.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 ("+hc.pretty(t)+", expected "+hc.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=Mu.uint8array?"uint8array":"array",n=hc.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),this.disksCount>1)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(Lh),t.readLocalPart(this.reader),t.handleUTF8(),t.processAttributes()},readCentralDir:function(){var e;for(this.reader.setIndex(this.centralDirOffset);this.reader.readAndCheckSignature(Nh);)(e=new hf({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(Mh);if(e<0)throw!this.isSignature(0,Lh)?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"):new Error("Corrupted zip: can't find end of central directory");this.reader.setIndex(e);var t=e;if(this.checkSignature(Mh),this.readBlockEndOfCentral(),this.diskNumber===hc.MAX_VALUE_16BITS||this.diskWithCentralDirStart===hc.MAX_VALUE_16BITS||this.centralDirRecordsOnThisDisk===hc.MAX_VALUE_16BITS||this.centralDirRecords===hc.MAX_VALUE_16BITS||this.centralDirSize===hc.MAX_VALUE_32BITS||this.centralDirOffset===hc.MAX_VALUE_32BITS){if(this.zip64=!0,(e=this.reader.lastIndexOfSignature(Ph))<0)throw new Error("Corrupted zip: can't find the ZIP64 end of central directory locator");if(this.reader.setIndex(e),this.checkSignature(Ph),this.readBlockZip64EndOfCentralLocator(),!this.isSignature(this.relativeOffsetEndOfZip64CentralDir,Bh)&&(this.relativeOffsetEndOfZip64CentralDir=this.reader.lastIndexOfSignature(Bh),this.relativeOffsetEndOfZip64CentralDir<0))throw new Error("Corrupted zip: can't find the ZIP64 end of central directory");this.reader.setIndex(this.relativeOffsetEndOfZip64CentralDir),this.checkSignature(Bh),this.readBlockZip64EndOfCentral()}var n=this.centralDirOffset+this.centralDirSize;this.zip64&&(n+=20,n+=12+this.zip64EndOfCentralSize);var r=t-n;if(r>0)this.isSignature(t,Nh)||(this.reader.zero=r);else if(r<0)throw new Error("Corrupted zip: missing "+Math.abs(r)+" bytes.")},prepareReader:function(e){this.reader=cf(e)},load:function(e){this.prepareReader(e),this.readEndOfCentral(),this.readCentralDir(),this.readLocalFiles()}};var df=ff;function pf(e){return new lc.Promise((function(t,n){var r=e.decompressed.getContentWorker().pipe(new Lc);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()}))}function vf(){if(!(this instanceof vf))return new vf;if(arguments.length)throw new Error("The constructor with parameters has been removed in JSZip 3.0, please check the upgrade guide.");this.files={},this.comment=null,this.root="",this.clone=function(){var e=new vf;for(var t in this)"function"!=typeof this[t]&&(e[t]=this[t]);return e}}vf.prototype=Jh,vf.prototype.loadAsync=function(e,t){var n=this;return t=hc.extend(t||{},{base64:!1,checkCRC32:!1,optimizedBinaryString:!1,createFolders:!1,decodeFileName:pc.utf8decode}),ju&&Hu(e)?lc.Promise.reject(new Error("JSZip can't accept a stream when loading a zip file.")):hc.prepareContent("the loaded zip file",e,!0,t.optimizedBinaryString,t.base64).then((function(e){var n=new df(t);return n.load(e),n})).then((function(e){var n=[lc.Promise.resolve(e)],r=e.files;if(t.checkCRC32)for(var i=0;i<r.length;i++)n.push(pf(r[i]));return lc.Promise.all(n)})).then((function(e){for(var r=e.shift(),i=r.files,o=0;o<i.length;o++){var a=i[o];n.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return r.zipComment.length&&(n.comment=r.zipComment),n}))},vf.support=Mu,vf.defaults=xc,vf.version="3.5.0",vf.loadAsync=function(e,t){return(new vf).loadAsync(e,t)},vf.external=lc;var gf=vf,mf=ct.forEach,yf=je("forEach"),bf=He("forEach"),wf=yf&&bf?[].forEach:function(e){return mf(this,e,arguments.length>1?arguments[1]:void 0)};Le({target:"Array",proto:!0,forced:[].forEach!=wf},{forEach:wf});var kf=we.f,_f={}.toString,Sf="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],xf=function(e){return Sf&&"[object Window]"==_f.call(e)?function(e){try{return kf(e)}catch(e){return Sf.slice()}}(e):kf(y(e))},Ef=s((function(){return!Object.getOwnPropertyNames(1)}));for(var Of in Le({target:"Object",stat:!0,forced:Ef},{getOwnPropertyNames:xf}),Ji){var Cf=a[Of],Af=Cf&&Cf.prototype;if(Af&&Af.forEach!==wf)try{L(Af,"forEach",wf)}catch(e){Af.forEach=wf}}var If=[].slice,Tf=/MSIE .\./.test(lt),Rf=function(e){return function(t,n){var r=arguments.length>2,i=r?If.call(arguments,2):void 0;return e(r?function(){("function"==typeof t?t:Function(t)).apply(this,i)}:t,n)}};Le({global:!0,bind:!0,forced:Tf},{setTimeout:Rf(a.setTimeout),setInterval:Rf(a.setInterval)});var Lf=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())},Nf=function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())},Mf=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return{code:e,msg:t,detail:n}},Pf=function(){function e(){oo(this,e),this.db=new Us("webrtc")}return so(e,[{key:"add",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.db){t.next=4;break}return this.db=new Us("webrtc"),t.next=4,this.init();case 4:try{n=e.time,r=void 0===n?"":n,i=e.title,o=void 0===i?"":i,a=e.content,s=void 0===a?"":a,u=e.rest,c=void 0===u?[]:u,l=this.num||1,this.db["webrtc_log"+l].add({t:r+JSON.stringify(o),c:JSON.stringify(s)+" "+JSON.stringify(c)}).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 t.stop()}}),t,this)})))}},{key:"deleteDB",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.db.delete(),Us.delete("webrtc"),tu.set("xy-webrtc-log",{version:1,num:1}),this.num=1;case 4:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){this.db.close()}},{key:"stop",value:function(){var e=tu.get("xy-webrtc-log")||{version:1,num:1};tu.set("xy-webrtc-log",{version:e.version,num:e.num+1>3?1:e.num+1})}},{key:"isOpen",value:function(){return this.db&&this.db.isOpen()}},{key:"export",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,xu(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 3:return t=e.sent,n=Lf(),e.next=7,this.generateZipBlobAsync(t,n,"");case 7:return r=e.sent,Lu(r,"xy_webrtc_sdk_log_".concat(n,".zip"),"application/zip"),e.abrupt("return",!0);case 12:return e.prev=12,e.t0=e.catch(0),console.error("export db data error: "+e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[0,12]])})))}},{key:"upload",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,xu(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 4:return r=t.sent,i=Lf(),t.next=8,this.generateZipBlobAsync(r,i,e);case 8:n=t.sent,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),console.error("export blob error: "+t.t0);case 14:return t.abrupt("return",n);case 15:case"end":return t.stop()}}),t,this,[[1,11]])})))}},{key:"progressCallback",value:function(e){e.totalRows,e.completedRows;return!0}},{key:"open",value:function(){this.db.open()}},{key:"tempStart",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=tu.get("xy-webrtc-log")||{version:1,num:1},this.initStores(t),this.db.isOpen()){e.next=5;break}return e.next=5,this.db.open();case 5:case"end":return e.stop()}}),e,this)})))}},{key:"init",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=tu.get("xy-webrtc-log")||{version:1,num:1},this.num=t.num,this.initStores(t),e.next=5,this.db["webrtc_log"+this.num].clear();case 5:if(this.isOpen()){e.next=8;break}return e.next=8,this.db.open();case 8:tu.set("xy-webrtc-log",t);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"initStores",value:function(e){this.db&&!this.db.isOpen()&&(this.db.version(e.version).stores({webrtc_log1:"++id,time,title,content,rest",webrtc_log2:"++id,time,title,content,rest",webrtc_log3:"++id,time,title,content,rest"}),this.db.version(2).stores({webrtc_log1:"++id,t,c",webrtc_log2:"++id,t,c",webrtc_log3:"++id,t,c"}).upgrade())}},{key:"generateZipBlobAsync",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new gf,r.next=3,i.file("xy_webrtc_sdk_log_".concat(n,"_").concat(t,".json"),e,{});case 3:return r.next=5,i.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:9}});case 5:return o=r.sent,r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)})))}}]),e}(),Bf="".repeat||function(e){var t=String(m(this)),n="",r=ue(e);if(r<0||r==1/0)throw RangeError("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n},Df=1..toFixed,jf=Math.floor,Uf=function(e,t,n){return 0===t?n:t%2==1?Uf(e,t-1,n*e):Uf(e*e,t/2,n)},Ff=Df&&("0.000"!==8e-5.toFixed(3)||"1"!==.9.toFixed(0)||"1.25"!==1.255.toFixed(2)||"1000000000000000128"!==(0xde0b6b3a7640080).toFixed(0))||!s((function(){Df.call({})}));Le({target:"Number",proto:!0,forced:Ff},{toFixed:function(e){var t,n,r,i,o=function(e){if("number"!=typeof e&&"Number"!=p(e))throw TypeError("Incorrect invocation");return+e}(this),a=ue(e),s=[0,0,0,0,0,0],u="",c="0",l=function(e,t){for(var n=-1,r=t;++n<6;)r+=e*s[n],s[n]=r%1e7,r=jf(r/1e7)},h=function(e){for(var t=6,n=0;--t>=0;)n+=s[t],s[t]=jf(n/e),n=n%e*1e7},f=function(){for(var e=6,t="";--e>=0;)if(""!==t||0===e||0!==s[e]){var n=String(s[e]);t=""===t?n:t+Bf.call("0",7-n.length)+n}return t};if(a<0||a>20)throw RangeError("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return String(o);if(o<0&&(u="-",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*Uf(2,69,1))-69)<0?o*Uf(2,-t,1):o/Uf(2,t,1),n*=4503599627370496,(t=52-t)>0){for(l(0,n),r=a;r>=7;)l(1e7,0),r-=7;for(l(Uf(10,r,1),0),r=t-1;r>=23;)h(1<<23),r-=23;h(1<<r),l(1,1),h(2),c=f()}else l(0,n),l(1<<-t,0),c=f()+Bf.call("0",a);return c=a>0?u+((i=c.length)<=a?"0."+Bf.call("0",a-i)+c:c.slice(0,i-a)+"."+c.slice(i-a)):u+c}});var zf=ve.includes,Hf=He("indexOf",{ACCESSORS:!0,1:0});Le({target:"Array",proto:!0,forced:!Hf},{includes:function(e){return zf(this,e,arguments.length>1?arguments[1]:void 0)}}),Dn("includes");var Vf=it("match"),Wf=function(e){if(function(e){var t;return b(e)&&(void 0!==(t=e[Vf])?!!t:"RegExp"==p(e))}(e))throw TypeError("The method doesn't accept regular expressions");return e},Kf=it("match");Le({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[Kf]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~String(m(this)).indexOf(Wf(e),arguments.length>1?arguments[1]:void 0)}});var qf=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)}},Gf=Object.prototype.toString;function Yf(e){return"[object Array]"===Gf.call(e)}function Zf(e){return void 0===e}function Xf(e){return null!==e&&"object"==typeof e}function Jf(e){return"[object Function]"===Gf.call(e)}function $f(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),Yf(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 Qf={isArray:Yf,isArrayBuffer:function(e){return"[object ArrayBuffer]"===Gf.call(e)},isBuffer:function(e){return null!==e&&!Zf(e)&&null!==e.constructor&&!Zf(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:Xf,isUndefined:Zf,isDate:function(e){return"[object Date]"===Gf.call(e)},isFile:function(e){return"[object File]"===Gf.call(e)},isBlob:function(e){return"[object Blob]"===Gf.call(e)},isFunction:Jf,isStream:function(e){return Xf(e)&&Jf(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:$f,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++)$f(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++)$f(arguments[r],n);return t},extend:function(e,t,n){return $f(t,(function(t,r){e[r]=n&&"function"==typeof t?qf(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function ed(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 td=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(Qf.isURLSearchParams(t))r=t.toString();else{var i=[];Qf.forEach(t,(function(e,t){null!=e&&(Qf.isArray(e)?t+="[]":e=[e],Qf.forEach(e,(function(e){Qf.isDate(e)?e=e.toISOString():Qf.isObject(e)&&(e=JSON.stringify(e)),i.push(ed(t)+"="+ed(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 nd(){this.handlers=[]}nd.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},nd.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},nd.prototype.forEach=function(e){Qf.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var rd=nd,id=function(e,t,n){return Qf.forEach(n,(function(n){e=n(e,t)})),e},od=function(e){return!(!e||!e.__CANCEL__)},ad=function(e,t){Qf.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},sd=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)},ud=["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"],cd=Qf.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=Qf.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},ld=Qf.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),Qf.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),Qf.isString(r)&&a.push("path="+r),Qf.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(){}},hd=function(e){return new Promise((function(t,n){var r=e.data,i=e.headers;Qf.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 u,c,l=(u=e.baseURL,c=e.url,u&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(c)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,c):c);if(o.open(e.method.toUpperCase(),td(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?(Qf.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=Qf.trim(e.substr(0,r)).toLowerCase(),n=Qf.trim(e.substr(r+1)),t){if(i[t]&&ud.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(sd("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,i),o=null}},o.onabort=function(){o&&(n(sd("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(sd("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(sd(t,e,"ECONNABORTED",o)),o=null},Qf.isStandardBrowserEnv()){var h=ld,f=(e.withCredentials||cd(l))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;f&&(i[e.xsrfHeaderName]=f)}if("setRequestHeader"in o&&Qf.forEach(i,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),Qf.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)}))},fd={"Content-Type":"application/x-www-form-urlencoded"};function dd(e,t){!Qf.isUndefined(e)&&Qf.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var pd,vd={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(pd=hd),pd),transformRequest:[function(e,t){return ad(t,"Accept"),ad(t,"Content-Type"),Qf.isFormData(e)||Qf.isArrayBuffer(e)||Qf.isBuffer(e)||Qf.isStream(e)||Qf.isFile(e)||Qf.isBlob(e)?e:Qf.isArrayBufferView(e)?e.buffer:Qf.isURLSearchParams(e)?(dd(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):Qf.isObject(e)?(dd(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}};vd.headers={common:{Accept:"application/json, text/plain, */*"}},Qf.forEach(["delete","get","head"],(function(e){vd.headers[e]={}})),Qf.forEach(["post","put","patch"],(function(e){vd.headers[e]=Qf.merge(fd)}));var gd=vd;function md(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var yd=function(e){return md(e),e.headers=e.headers||{},e.data=id(e.data,e.headers,e.transformRequest),e.headers=Qf.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),Qf.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||gd.adapter)(e).then((function(t){return md(e),t.data=id(t.data,t.headers,e.transformResponse),t}),(function(t){return od(t)||(md(e),t&&t.response&&(t.response.data=id(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},bd=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"];Qf.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),Qf.forEach(i,(function(r){Qf.isObject(t[r])?n[r]=Qf.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:Qf.isObject(e[r])?n[r]=Qf.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),Qf.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 Qf.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function wd(e){this.defaults=e,this.interceptors={request:new rd,response:new rd}}wd.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=bd(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[yd,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},wd.prototype.getUri=function(e){return e=bd(this.defaults,e),td(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},Qf.forEach(["delete","get","head","options"],(function(e){wd.prototype[e]=function(t,n){return this.request(Qf.merge(n||{},{method:e,url:t}))}})),Qf.forEach(["post","put","patch"],(function(e){wd.prototype[e]=function(t,n,r){return this.request(Qf.merge(r||{},{method:e,url:t,data:n}))}}));var kd=wd;function _d(e){this.message=e}_d.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},_d.prototype.__CANCEL__=!0;var Sd=_d;function xd(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 Sd(e),t(n.reason))}))}xd.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},xd.source=function(){var e;return{token:new xd((function(t){e=t})),cancel:e}};var Ed=xd;function Od(e){var t=new kd(e),n=qf(kd.prototype.request,t);return Qf.extend(n,kd.prototype,t),Qf.extend(n,t),n}var Cd=Od(gd);Cd.Axios=kd,Cd.create=function(e){return Od(bd(Cd.defaults,e))},Cd.Cancel=Sd,Cd.CancelToken=Ed,Cd.isCancel=od,Cd.all=function(e){return Promise.all(e)},Cd.spread=function(e){return function(t){return e.apply(null,t)}};var Ad=Cd,Id=Cd;Ad.default=Id;var Td=Ad,Rd=[20400,20401,20403,20405],Ld={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}},Nd={frameRate:{min:15,exact:15,max:15},aspectRatio:1.777777778,resizeMode:"crop-and-scale"},Md=Object.assign({cursor:"always",frameRate:{ideal:15,max:15},logicalSurface:!0},Nd),Pd={720:{min:Object.assign(Object.assign({},Md),{frameRate:1,width:{ideal:1280,max:1280},height:{ideal:720,max:720}}),max:Object.assign(Object.assign({},Md),{frameRate:{ideal:8,max:8},width:{ideal:1280,max:1280},height:{ideal:720,max:720}})},1080:{min:Object.assign(Object.assign({},Md),{frameRate:1,width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}}),max:Object.assign(Object.assign({},Md),{frameRate:{ideal:8,max:8},width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}})}},Bd={90:{min:Object.assign(Object.assign({},Nd),{frameRate:1,width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}}),max:Object.assign(Object.assign({},Nd),{frameRate:{min:15,exact:15,max:15},width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}})},180:{min:Object.assign(Object.assign({},Nd),{frameRate:1,width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}}),max:Object.assign(Object.assign({},Nd),{frameRate:{min:15,exact:15,max:15},width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}})},360:{min:Object.assign(Object.assign({},Nd),{frameRate:1,width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}}),max:Object.assign(Object.assign({},Nd),{frameRate:{min:15,exact:15,max:15},width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}})},720:{min:Object.assign(Object.assign({},Nd),{frameRate:1,width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}}),max:Object.assign(Object.assign({},Nd),{frameRate:{min:5,ideal:30,max:30},width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}})}},Dd={bundlePolicy:"max-bundle",iceCandidatePoolSize:0,iceServers:[],iceTransportPolicy:"all",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},jd={OK:"STATE:200",SERVER_INNER_ERROR:"SIG:4448",PEER_NET_DISCONNECT:"SIG:403",LOCAL_NET_DISCONNECT:"SIG:499"},Ud={CLIENT_TYPE:"webrtc",INIT_INTERNELS:{bytesReceived:0,bytesReceivedSecond:0,bytesSent:0,bytesSentSecond:0,mimeType:"",timestamp:0,receiver:{},sender:{}},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:""},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:""}},Fd=["SPEAKER","GALLERY"],zd=["MULTI_PIC_CONTENT_HIGH_PRIORITY","MULTI_PIC_ACTIVE_HIGH_PRIORITY","TWO_PIC_PIP","CONTENT_ONLY","TWO_PIC_SYMMETRIC"],Hd="standardWebRtc",Vd="thirdWebrtc",Wd={muteAudio:"audioMute",unmuteAudio:"audioUnmute",muteVideo:"videoMute",unmuteVideo:"videoUnmute"},Kd=i((function(e,t){var i;e.exports=(i=i||function(e,t){var i;if("undefined"!=typeof window&&window.crypto&&(i=window.crypto),!i&&"undefined"!=typeof window&&window.msCrypto&&(i=window.msCrypto),!i&&void 0!==r&&r.crypto&&(i=r.crypto),!i)try{i=n}catch(e){}var o=function(){if(i){if("function"==typeof i.getRandomValues)try{return i.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof i.randomBytes)try{return i.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},a=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),s={},u=s.lib={},c=u.Base={extend:function(e){var t=a(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)}},l=u.WordArray=c.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||f).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(o=0;o<i;o+=4)t[r+o>>>2]=n[o>>>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=c.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(o());return new l.init(t,e)}}),h=s.enc={},f=h.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 l.init(n,t/2)}},d=h.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 l.init(n,t)}},p=h.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},v=u.BufferedBlockAlgorithm=c.extend({reset:function(){this._data=new l.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=p.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,c=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-=c}return new l.init(n,c)},clone:function(){var e=c.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0}),g=(u.Hasher=v.extend({cfg:c.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){v.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 g.HMAC.init(e,n).finalize(t)}}}),s.algo={});return s}(Math),i)})),qd=(i((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Kd).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)})),i((function(e,t){var n;e.exports=(n=Kd,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)})),i((function(e,t){var n;e.exports=(n=Kd,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)})),i((function(e,t){var n,r,i;e.exports=(r=(n=i=Kd).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 u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);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,u=n[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),i((function(e,t){var n;e.exports=(n=Kd,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 u=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],u=e[t+1],d=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],w=e[t+9],k=e[t+10],_=e[t+11],S=e[t+12],x=e[t+13],E=e[t+14],O=e[t+15],C=o[0],A=o[1],I=o[2],T=o[3];C=c(C,A,I,T,a,7,s[0]),T=c(T,C,A,I,u,12,s[1]),I=c(I,T,C,A,d,17,s[2]),A=c(A,I,T,C,p,22,s[3]),C=c(C,A,I,T,v,7,s[4]),T=c(T,C,A,I,g,12,s[5]),I=c(I,T,C,A,m,17,s[6]),A=c(A,I,T,C,y,22,s[7]),C=c(C,A,I,T,b,7,s[8]),T=c(T,C,A,I,w,12,s[9]),I=c(I,T,C,A,k,17,s[10]),A=c(A,I,T,C,_,22,s[11]),C=c(C,A,I,T,S,7,s[12]),T=c(T,C,A,I,x,12,s[13]),I=c(I,T,C,A,E,17,s[14]),C=l(C,A=c(A,I,T,C,O,22,s[15]),I,T,u,5,s[16]),T=l(T,C,A,I,m,9,s[17]),I=l(I,T,C,A,_,14,s[18]),A=l(A,I,T,C,a,20,s[19]),C=l(C,A,I,T,g,5,s[20]),T=l(T,C,A,I,k,9,s[21]),I=l(I,T,C,A,O,14,s[22]),A=l(A,I,T,C,v,20,s[23]),C=l(C,A,I,T,w,5,s[24]),T=l(T,C,A,I,E,9,s[25]),I=l(I,T,C,A,p,14,s[26]),A=l(A,I,T,C,b,20,s[27]),C=l(C,A,I,T,x,5,s[28]),T=l(T,C,A,I,d,9,s[29]),I=l(I,T,C,A,y,14,s[30]),C=h(C,A=l(A,I,T,C,S,20,s[31]),I,T,g,4,s[32]),T=h(T,C,A,I,b,11,s[33]),I=h(I,T,C,A,_,16,s[34]),A=h(A,I,T,C,E,23,s[35]),C=h(C,A,I,T,u,4,s[36]),T=h(T,C,A,I,v,11,s[37]),I=h(I,T,C,A,y,16,s[38]),A=h(A,I,T,C,k,23,s[39]),C=h(C,A,I,T,x,4,s[40]),T=h(T,C,A,I,a,11,s[41]),I=h(I,T,C,A,p,16,s[42]),A=h(A,I,T,C,m,23,s[43]),C=h(C,A,I,T,w,4,s[44]),T=h(T,C,A,I,S,11,s[45]),I=h(I,T,C,A,O,16,s[46]),C=f(C,A=h(A,I,T,C,d,23,s[47]),I,T,a,6,s[48]),T=f(T,C,A,I,y,10,s[49]),I=f(I,T,C,A,E,15,s[50]),A=f(A,I,T,C,g,21,s[51]),C=f(C,A,I,T,S,6,s[52]),T=f(T,C,A,I,p,10,s[53]),I=f(I,T,C,A,k,15,s[54]),A=f(A,I,T,C,u,21,s[55]),C=f(C,A,I,T,b,6,s[56]),T=f(T,C,A,I,O,10,s[57]),I=f(I,T,C,A,m,15,s[58]),A=f(A,I,T,C,x,21,s[59]),C=f(C,A,I,T,v,6,s[60]),T=f(T,C,A,I,_,10,s[61]),I=f(I,T,C,A,d,15,s[62]),A=f(A,I,T,C,w,21,s[63]),o[0]=o[0]+C|0,o[1]=o[1]+A|0,o[2]=o[2]+I|0,o[3]=o[3]+T|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,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=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 c(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 f(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(u),t.HmacMD5=o._createHmacHelper(u)}(Math),n.MD5)})),i((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=Kd).lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[],u=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],u=n[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var l=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=l<<1|l>>>31}var h=(r<<5|r>>>27)+u+s[c];h+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,u=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]+u|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(u),n.HmacSHA1=o._createHmacHelper(u),c.SHA1)})),i((function(e,t){var n;e.exports=(n=Kd,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],u=[];!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))),u[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],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],f=n[7],d=0;d<64;d++){if(d<16)c[d]=0|e[t+d];else{var p=c[d-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[d-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[d]=v+c[d-7]+m+c[d-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=f+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+u[d]+c[d];f=h,h=l,l=s,s=a+w|0,a=o,o=i,i=r,r=w+(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]+f|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)})),i((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=Kd).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)})),i((function(e,t){var n;e.exports=(n=Kd,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 u=[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)],c=[];!function(){for(var e=0;e<80;e++)c[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],f=n[7],d=r.high,p=r.low,v=i.high,g=i.low,m=o.high,y=o.low,b=a.high,w=a.low,k=s.high,_=s.low,S=l.high,x=l.low,E=h.high,O=h.low,C=f.high,A=f.low,I=d,T=p,R=v,L=g,N=m,M=y,P=b,B=w,D=k,j=_,U=S,F=x,z=E,H=O,V=C,W=A,K=0;K<80;K++){var q,G,Y=c[K];if(K<16)G=Y.high=0|e[t+2*K],q=Y.low=0|e[t+2*K+1];else{var Z=c[K-15],X=Z.high,J=Z.low,$=(X>>>1|J<<31)^(X>>>8|J<<24)^X>>>7,Q=(J>>>1|X<<31)^(J>>>8|X<<24)^(J>>>7|X<<25),ee=c[K-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=c[K-7],ae=oe.high,se=oe.low,ue=c[K-16],ce=ue.high,le=ue.low;G=(G=(G=$+ae+((q=Q+se)>>>0<Q>>>0?1:0))+re+((q+=ie)>>>0<ie>>>0?1:0))+ce+((q+=le)>>>0<le>>>0?1:0),Y.high=G,Y.low=q}var he,fe=D&U^~D&z,de=j&F^~j&H,pe=I&R^I&N^R&N,ve=T&L^T&M^L&M,ge=(I>>>28|T<<4)^(I<<30|T>>>2)^(I<<25|T>>>7),me=(T>>>28|I<<4)^(T<<30|I>>>2)^(T<<25|I>>>7),ye=(D>>>14|j<<18)^(D>>>18|j<<14)^(D<<23|j>>>9),be=(j>>>14|D<<18)^(j>>>18|D<<14)^(j<<23|D>>>9),we=u[K],ke=we.high,_e=we.low,Se=V+ye+((he=W+be)>>>0<W>>>0?1:0),xe=me+ve;V=z,W=H,z=U,H=F,U=D,F=j,D=P+(Se=(Se=(Se=Se+fe+((he+=de)>>>0<de>>>0?1:0))+ke+((he+=_e)>>>0<_e>>>0?1:0))+G+((he+=q)>>>0<q>>>0?1:0))+((j=B+he|0)>>>0<B>>>0?1:0)|0,P=N,B=M,N=R,M=L,R=I,L=T,I=Se+(ge+pe+(xe>>>0<me>>>0?1:0))+((T=he+xe|0)>>>0<he>>>0?1:0)|0}p=r.low=p+T,r.high=d+I+(p>>>0<T>>>0?1:0),g=i.low=g+L,i.high=v+R+(g>>>0<L>>>0?1:0),y=o.low=y+M,o.high=m+N+(y>>>0<M>>>0?1:0),w=a.low=w+B,a.high=b+P+(w>>>0<B>>>0?1:0),_=s.low=_+j,s.high=k+D+(_>>>0<j>>>0?1:0),x=l.low=x+F,l.high=S+U+(x>>>0<F>>>0?1:0),O=h.low=O+H,h.high=E+z+(O>>>0<H>>>0?1:0),A=f.low=A+W,f.high=C+V+(A>>>0<W>>>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)})),i((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=Kd).x64,i=r.Word,o=r.WordArray,a=n.algo,s=a.SHA512,u=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(u),n.HmacSHA384=s._createHmacHelper(u),c.SHA384)})),i((function(e,t){var n;e.exports=(n=Kd,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.x64.Word,s=t.algo,u=[],c=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[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++)c[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,f=0;f<7;f++){if(1&i){var d=(1<<f)-1;d<32?h^=1<<d:s^=1<<d-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 f=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 f=0;f<5;f++){for(var d=0,p=0,v=0;v<5;v++)d^=(A=n[f+5*v]).high,p^=A.low;var g=h[f];g.high=d,g.low=p}for(f=0;f<5;f++){var m=h[(f+4)%5],y=h[(f+1)%5],b=y.high,w=y.low;for(d=m.high^(b<<1|w>>>31),p=m.low^(w<<1|b>>>31),v=0;v<5;v++)(A=n[f+5*v]).high^=d,A.low^=p}for(var k=1;k<25;k++){var _=(A=n[k]).high,S=A.low,x=u[k];x<32?(d=_<<x|S>>>32-x,p=S<<x|_>>>32-x):(d=S<<x-32|_>>>64-x,p=_<<x-32|S>>>64-x);var E=h[c[k]];E.high=d,E.low=p}var O=h[0],C=n[0];for(O.high=C.high,O.low=C.low,f=0;f<5;f++)for(v=0;v<5;v++){var A=n[k=f+5*v],I=h[k],T=h[(f+1)%5+5*v],R=h[(f+2)%5+5*v];A.high=I.high^~T.high&R.high,A.low=I.low^~T.low&R.low}A=n[0];var L=l[s];A.high^=L.high,A.low^=L.low}},_doFinalize:function(){var t=this._data,n=t.words,r=(this._nDataBytes,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,u=s/8,c=[],l=0;l<u;l++){var h=a[l],f=h.high,d=h.low;f=16711935&(f<<8|f>>>24)|4278255360&(f<<24|f>>>8),d=16711935&(d<<8|d>>>24)|4278255360&(d<<24|d>>>8),c.push(d),c.push(f)}return new i.init(c,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(f),t.HmacSHA3=o._createHmacHelper(f)}(Math),n.SHA3)})),i((function(e,t){var n;e.exports=(n=Kd,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]),u=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]),c=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]),f=i.create([1352829926,1548603684,1836072691,2053994217,0]),d=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,d,w,k,_,S,x,E,O,C,A=this._hash.words,I=h.words,T=f.words,R=s.words,L=u.words,N=c.words,M=l.words;for(_=o=A[0],S=a=A[1],x=d=A[2],E=w=A[3],O=k=A[4],n=0;n<80;n+=1)C=o+e[t+R[n]]|0,C+=n<16?p(a,d,w)+I[0]:n<32?v(a,d,w)+I[1]:n<48?g(a,d,w)+I[2]:n<64?m(a,d,w)+I[3]:y(a,d,w)+I[4],C=(C=b(C|=0,N[n]))+k|0,o=k,k=w,w=b(d,10),d=a,a=C,C=_+e[t+L[n]]|0,C+=n<16?y(S,x,E)+T[0]:n<32?m(S,x,E)+T[1]:n<48?g(S,x,E)+T[2]:n<64?v(S,x,E)+T[3]:p(S,x,E)+T[4],C=(C=b(C|=0,M[n]))+O|0,_=O,O=E,E=b(x,10),x=S,S=C;C=A[1]+d+E|0,A[1]=A[2]+w+O|0,A[2]=A[3]+k+_|0,A[3]=A[4]+o+S|0,A[4]=A[0]+a+x|0,A[0]=C},_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(d),t.HmacRIPEMD160=o._createHmacHelper(d)}(),n.RIPEMD160)})),i((function(e,t){var n,r,i;e.exports=(r=(n=Kd).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,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=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))}})))})),i((function(e,t){var n,r,i,o,a,s,u,c,l;e.exports=(r=(n=l=Kd).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.SHA1,u=a.HMAC,c=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=u.create(n.hasher,e),i=o.create(),a=o.create([1]),s=i.words,c=a.words,l=n.keySize,h=n.iterations;s.length<l;){var f=r.update(t).finalize(a);r.reset();for(var d=f.words,p=d.length,v=f,g=1;g<h;g++){v=r.finalize(v),r.reset();for(var m=v.words,y=0;y<p;y++)d[y]^=m[y]}i.concat(f),c[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)},l.PBKDF2)})),i((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=Kd).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.MD5,u=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,u=r.keySize,c=r.iterations;s.length<u;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<c;l++)n=i.finalize(n),i.reset();a.concat(n)}return a.sigBytes=4*u,a}}),n.EvpKDF=function(e,t,n){return u.create(n).compute(e,t)},c.EvpKDF)})),i((function(e,t){var n,r,i,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,w;e.exports=void((n=Kd).lib.Cipher||(r=n,i=r.lib,o=i.Base,a=i.WordArray,s=i.BufferedBlockAlgorithm,u=r.enc,u.Utf8,c=u.Base64,l=r.algo.EvpKDF,h=i.Cipher=s.extend({cfg:o.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(){s.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?w:y}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)}}}}()}),i.StreamCipher=h.extend({_doFinalize:function(){return this._process(!0)},blockSize:1}),f=r.mode={},d=i.BlockCipherMode=o.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}}),p=f.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}(),v=(r.pad={}).Pkcs7={pad:function(e,t){for(var n=4*t,r=n-e.sigBytes%n,i=r<<24|r<<16|r<<8|r,o=[],s=0;s<r;s+=4)o.push(i);var u=a.create(o,r);e.concat(u)},unpad:function(e){var t=255&e.words[e.sigBytes-1>>>2];e.sigBytes-=t}},i.BlockCipher=h.extend({cfg:h.cfg.extend({mode:p,padding:v}),reset:function(){var e;h.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}),g=i.CipherParams=o.extend({init:function(e){this.mixIn(e)},toString:function(e){return(e||this.formatter).stringify(this)}}),m=(r.format={}).OpenSSL={stringify:function(e){var t=e.ciphertext,n=e.salt;return(n?a.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=a.create(r.slice(2,4)),r.splice(0,4),n.sigBytes-=16),g.create({ciphertext:n,salt:t})}},y=i.SerializableCipher=o.extend({cfg:o.extend({format:m}),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 g.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}}),b=(r.kdf={}).OpenSSL={execute:function(e,t,n,r){r||(r=a.random(8));var i=l.create({keySize:t+n}).compute(e,r),o=a.create(i.words.slice(t),4*n);return i.sigBytes=4*t,g.create({key:i,iv:o,salt:r})}},w=i.PasswordBasedCipher=y.extend({cfg:y.cfg.extend({kdf:b}),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=y.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,y.decrypt.call(this,e,t,i.key,r)}})))})),i((function(e,t){var n;e.exports=((n=Kd).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)})),i((function(e,t){var n,r,i;e.exports=((i=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).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 u=0;u<i;u++)e[n+u]^=s[u]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)})),i((function(e,t){var n,r,i;e.exports=((i=Kd).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)})),i((function(e,t){var n,r;e.exports=((r=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).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)})),i((function(e,t){var n;e.exports=((n=Kd).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)})),i((function(e,t){var n,r,i,o;e.exports=(r=(n=o=Kd).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)})),i((function(e,t){var n;e.exports=(n=Kd,function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],a=[],s=[],u=[],c=[],l=[],h=[],f=[],d=[];!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,u[n]=y<<8|y>>>24,c[n]=y,y=16843009*m^65537*g^257*v^16843008*n,l[p]=y<<24|y>>>8,h[p]=y<<16|y>>>16,f[p]=y<<8|y>>>24,d[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]:(c=o[a-1],a%n?n>6&&a%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[a/n|0]<<24),o[a]=o[a-n]^c);for(var s=this._invKeySchedule=[],u=0;u<r;u++){if(a=r-u,u%4)var c=o[a];else c=o[a-4];s[u]=u<4||a<=4?c:l[i[c>>>24]]^h[i[c>>>16&255]]^f[i[c>>>8&255]]^d[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,c,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,f,d,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 u=this._nRounds,c=e[t]^n[0],l=e[t+1]^n[1],h=e[t+2]^n[2],f=e[t+3]^n[3],d=4,p=1;p<u;p++){var v=r[c>>>24]^i[l>>>16&255]^o[h>>>8&255]^a[255&f]^n[d++],g=r[l>>>24]^i[h>>>16&255]^o[f>>>8&255]^a[255&c]^n[d++],m=r[h>>>24]^i[f>>>16&255]^o[c>>>8&255]^a[255&l]^n[d++],y=r[f>>>24]^i[c>>>16&255]^o[l>>>8&255]^a[255&h]^n[d++];c=v,l=g,h=m,f=y}v=(s[c>>>24]<<24|s[l>>>16&255]<<16|s[h>>>8&255]<<8|s[255&f])^n[d++],g=(s[l>>>24]<<24|s[h>>>16&255]<<16|s[f>>>8&255]<<8|s[255&c])^n[d++],m=(s[h>>>24]<<24|s[f>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[d++],y=(s[f>>>24]<<24|s[c>>>16&255]<<16|s[l>>>8&255]<<8|s[255&h])^n[d++],e[t]=v,e[t+1]=g,e[t+2]=m,e[t+3]=y},keySize:8});e.AES=t._createHelper(v)}(),n.AES)})),i((function(e,t){var n;e.exports=(n=Kd,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],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],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 c=i[o]=[],l=u[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[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],f.call(this,4,252645135),f.call(this,16,65535),d.call(this,2,858993459),d.call(this,8,16711935),f.call(this,1,1431655765);for(var r=0;r<16;r++){for(var i=n[r],o=this._lBlock,a=this._rBlock,s=0,u=0;u<8;u++)s|=c[u][((a^i[u])&l[u])>>>0];this._lBlock=a,this._rBlock=o^s}var h=this._lBlock;this._lBlock=this._rBlock,this._rBlock=h,f.call(this,1,1431655765),d.call(this,8,16711935),d.call(this,2,858993459),f.call(this,16,65535),f.call(this,4,252645135),e[t]=this._lBlock,e[t+1]=this._rBlock},keySize:2,ivSize:2,blockSize:2});function f(e,t){var n=(this._lBlock>>>e^this._rBlock)&t;this._rBlock^=n,this._lBlock^=n<<e}function d(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)})),i((function(e,t){var n;e.exports=(n=Kd,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 u=r[i];r[i]=r[o],r[o]=u}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)})),i((function(e,t){var n;e.exports=(n=Kd,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++)u.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],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&l,f=l<<16|65535&c;for(i[0]^=c,i[1]^=h,i[2]^=l,i[3]^=f,i[4]^=c,i[5]^=h,i[6]^=l,i[7]^=f,n=0;n<4;n++)u.call(this)}},_doProcessBlock:function(e,t){var n=this._X;u.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 u(){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,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=u^c}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)})),i((function(e,t){var n;e.exports=(n=Kd,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++)u.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],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&l,f=l<<16|65535&c;for(r[0]^=c,r[1]^=h,r[2]^=l,r[3]^=f,r[4]^=c,r[5]^=h,r[6]^=l,r[7]^=f,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var n=this._X;u.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 u(){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,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=u^c}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)})),i((function(e,t){e.exports=Kd}))),Gd=Object.prototype.hasOwnProperty,Yd=Array.isArray,Zd=function(){for(var e=[],t=0;t<256;++t)e.push("%"+((t<16?"0":"")+t.toString(16)).toUpperCase());return e}(),Xd=function(e,t){for(var n=t&&t.plainObjects?Object.create(null):{},r=0;r<e.length;++r)void 0!==e[r]&&(n[r]=e[r]);return n},Jd={arrayToObject:Xd,assign:function(e,t){return Object.keys(t).reduce((function(e,n){return e[n]=t[n],e}),e)},combine:function(e,t){return[].concat(e,t)},compact:function(e){for(var t=[{obj:{o:e},prop:"o"}],n=[],r=0;r<t.length;++r)for(var i=t[r],o=i.obj[i.prop],a=Object.keys(o),s=0;s<a.length;++s){var u=a[s],c=o[u];"object"==typeof c&&null!==c&&-1===n.indexOf(c)&&(t.push({obj:o,prop:u}),n.push(c))}return function(e){for(;e.length>1;){var t=e.pop(),n=t.obj[t.prop];if(Yd(n)){for(var r=[],i=0;i<n.length;++i)void 0!==n[i]&&r.push(n[i]);t.obj[t.prop]=r}}}(t),e},decode:function(e,t,n){var r=e.replace(/\+/g," ");if("iso-8859-1"===n)return r.replace(/%[0-9a-f]{2}/gi,unescape);try{return decodeURIComponent(r)}catch(e){return r}},encode:function(e,t,n){if(0===e.length)return e;var r=e;if("symbol"==typeof e?r=Symbol.prototype.toString.call(e):"string"!=typeof e&&(r=String(e)),"iso-8859-1"===n)return escape(r).replace(/%u[0-9a-f]{4}/gi,(function(e){return"%26%23"+parseInt(e.slice(2),16)+"%3B"}));for(var i="",o=0;o<r.length;++o){var a=r.charCodeAt(o);45===a||46===a||95===a||126===a||a>=48&&a<=57||a>=65&&a<=90||a>=97&&a<=122?i+=r.charAt(o):a<128?i+=Zd[a]:a<2048?i+=Zd[192|a>>6]+Zd[128|63&a]:a<55296||a>=57344?i+=Zd[224|a>>12]+Zd[128|a>>6&63]+Zd[128|63&a]:(o+=1,a=65536+((1023&a)<<10|1023&r.charCodeAt(o)),i+=Zd[240|a>>18]+Zd[128|a>>12&63]+Zd[128|a>>6&63]+Zd[128|63&a])}return i},isBuffer:function(e){return!(!e||"object"!=typeof e)&&!!(e.constructor&&e.constructor.isBuffer&&e.constructor.isBuffer(e))},isRegExp:function(e){return"[object RegExp]"===Object.prototype.toString.call(e)},maybeMap:function(e,t){if(Yd(e)){for(var n=[],r=0;r<e.length;r+=1)n.push(t(e[r]));return n}return t(e)},merge:function e(t,n,r){if(!n)return t;if("object"!=typeof n){if(Yd(t))t.push(n);else{if(!t||"object"!=typeof t)return[t,n];(r&&(r.plainObjects||r.allowPrototypes)||!Gd.call(Object.prototype,n))&&(t[n]=!0)}return t}if(!t||"object"!=typeof t)return[t].concat(n);var i=t;return Yd(t)&&!Yd(n)&&(i=Xd(t,r)),Yd(t)&&Yd(n)?(n.forEach((function(n,i){if(Gd.call(t,i)){var o=t[i];o&&"object"==typeof o&&n&&"object"==typeof n?t[i]=e(o,n,r):t.push(n)}else t[i]=n})),t):Object.keys(n).reduce((function(t,i){var o=n[i];return Gd.call(t,i)?t[i]=e(t[i],o,r):t[i]=o,t}),i)}},$d=String.prototype.replace,Qd=/%20/g,ep={RFC1738:"RFC1738",RFC3986:"RFC3986"},tp=Jd.assign({default:ep.RFC3986,formatters:{RFC1738:function(e){return $d.call(e,Qd,"+")},RFC3986:function(e){return String(e)}}},ep),np=Object.prototype.hasOwnProperty,rp={brackets:function(e){return e+"[]"},comma:"comma",indices:function(e,t){return e+"["+t+"]"},repeat:function(e){return e}},ip=Array.isArray,op=Array.prototype.push,ap=function(e,t){op.apply(e,ip(t)?t:[t])},sp=Date.prototype.toISOString,up=tp.default,cp={addQueryPrefix:!1,allowDots:!1,charset:"utf-8",charsetSentinel:!1,delimiter:"&",encode:!0,encoder:Jd.encode,encodeValuesOnly:!1,format:up,formatter:tp.formatters[up],indices:!1,serializeDate:function(e){return sp.call(e)},skipNulls:!1,strictNullHandling:!1},lp=function e(t,n,r,i,o,a,s,u,c,l,h,f,d){var p,v=t;if("function"==typeof s?v=s(n,v):v instanceof Date?v=l(v):"comma"===r&&ip(v)&&(v=Jd.maybeMap(v,(function(e){return e instanceof Date?l(e):e})).join(",")),null===v){if(i)return a&&!f?a(n,cp.encoder,d,"key"):n;v=""}if("string"==typeof(p=v)||"number"==typeof p||"boolean"==typeof p||"symbol"==typeof p||"bigint"==typeof p||Jd.isBuffer(v))return a?[h(f?n:a(n,cp.encoder,d,"key"))+"="+h(a(v,cp.encoder,d,"value"))]:[h(n)+"="+h(String(v))];var g,m=[];if(void 0===v)return m;if(ip(s))g=s;else{var y=Object.keys(v);g=u?y.sort(u):y}for(var b=0;b<g.length;++b){var w=g[b],k=v[w];if(!o||null!==k){var _=ip(v)?"function"==typeof r?r(n,w):n:n+(c?"."+w:"["+w+"]");ap(m,e(k,_,r,i,o,a,s,u,c,l,h,f,d))}}return m},hp=(Object.prototype.hasOwnProperty,Array.isArray,function(e,t){var n,r=e,i=function(e){if(!e)return cp;if(null!==e.encoder&&void 0!==e.encoder&&"function"!=typeof e.encoder)throw new TypeError("Encoder has to be a function.");var t=e.charset||cp.charset;if(void 0!==e.charset&&"utf-8"!==e.charset&&"iso-8859-1"!==e.charset)throw new TypeError("The charset option must be either utf-8, iso-8859-1, or undefined");var n=tp.default;if(void 0!==e.format){if(!np.call(tp.formatters,e.format))throw new TypeError("Unknown format option provided.");n=e.format}var r=tp.formatters[n],i=cp.filter;return("function"==typeof e.filter||ip(e.filter))&&(i=e.filter),{addQueryPrefix:"boolean"==typeof e.addQueryPrefix?e.addQueryPrefix:cp.addQueryPrefix,allowDots:void 0===e.allowDots?cp.allowDots:!!e.allowDots,charset:t,charsetSentinel:"boolean"==typeof e.charsetSentinel?e.charsetSentinel:cp.charsetSentinel,delimiter:void 0===e.delimiter?cp.delimiter:e.delimiter,encode:"boolean"==typeof e.encode?e.encode:cp.encode,encoder:"function"==typeof e.encoder?e.encoder:cp.encoder,encodeValuesOnly:"boolean"==typeof e.encodeValuesOnly?e.encodeValuesOnly:cp.encodeValuesOnly,filter:i,formatter:r,serializeDate:"function"==typeof e.serializeDate?e.serializeDate:cp.serializeDate,skipNulls:"boolean"==typeof e.skipNulls?e.skipNulls:cp.skipNulls,sort:"function"==typeof e.sort?e.sort:null,strictNullHandling:"boolean"==typeof e.strictNullHandling?e.strictNullHandling:cp.strictNullHandling}}(t);"function"==typeof i.filter?r=(0,i.filter)("",r):ip(i.filter)&&(n=i.filter);var o,a=[];if("object"!=typeof r||null===r)return"";o=t&&t.arrayFormat in rp?t.arrayFormat:t&&"indices"in t?t.indices?"indices":"repeat":"indices";var s=rp[o];n||(n=Object.keys(r)),i.sort&&n.sort(i.sort);for(var u=0;u<n.length;++u){var c=n[u];i.skipNulls&&null===r[c]||ap(a,lp(r[c],c,s,i.strictNullHandling,i.skipNulls,i.encode?i.encoder:null,i.filter,i.sort,i.allowDots,i.serializeDate,i.formatter,i.encodeValuesOnly,i.charset))}var l=a.join(i.delimiter),h=!0===i.addQueryPrefix?"?":"";return i.charsetSentinel&&("iso-8859-1"===i.charset?h+="utf8=%26%2310003%3B&":h+="utf8=%E2%9C%93&"),l.length>0?h+l:""}),fp=function(){function e(t){var n=this;oo(this,e),this.assignOptions=function(e){return Object.assign({},n.commonOption,e,{params:Object.assign({},n.commonOption.params,e&&e.params)})},this.get=function(e,t){return n.axios.get(e,n.assignOptions(t)).catch((function(e){return{err:e}}))},this.put=function(e,t,r){return n.axios.put(e,t,n.assignOptions(r)).catch((function(e){return{err:e}}))},this.post=function(e,t,r){return n.axios.post(e,t,n.assignOptions(r)).catch((function(e){return{err:e}}))},this.delete=function(e,t){return n.axios.delete(e,n.assignOptions(t)).catch((function(e){return{err:e}}))},this.commonOption=t,this.loginInfo=null,this.logger=null,this.baseUrl="",this.clientId="";var r=Object.assign(Object.assign({},t),{headers:{"n-ua":"PL=webrtc-sdk&AV=1.0.0&DR=&RL=&MF=&MO=web&OS=web-sdk&API=&LCLO=&LCLA=&CK="}});Td.defaults.timeout=1e4,this.axios=Td.create(r),this.axios.interceptors.request.use((function(e){var t=Math.ceil(1e4*Math.random());if(e.url.includes("?")?e.url+="&random=".concat(t):e.url+="?random=".concat(t),n.loginInfo){var r=e.method,i=e.data,o=e.url,a=e.params,s=hp(a)?o+"&"+hp(a):o,u={method:r.toLocaleUpperCase(),data:JSON.stringify(i)||"",url:s};e.headers=Object.assign({},n.setHeader(u))}return n.logger&&n.logger.log("[http] request:",e.url),e})),this.axios.interceptors.response.use((function(e){return n.logger&&n.logger.log("[http] response:",e),e}),(function(e){return n.logger&&n.logger.log("[http] response error:",e),Promise.reject(e)}))}return so(e,[{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:"setClientId",value:function(e){this.clientId=e}},{key:"setHeader",value:function(e){var t=this.loginInfo.access_token,n=e.method,r=e.url,i=e.data,o=void 0===i?"":i,a=Math.random(),s=(new Date).getTime(),u=qd.MD5(o).toString(),c="x-xy-clientid=".concat(this.clientId,"&x-xy-nonce=").concat(a,"&x-xy-signtype=HMAC_SHA256&x-xy-timestamp=").concat(s),l="".concat(n,"\n").concat(c,"\n").concat(r,"\n").concat(u,"\naccess_token=").concat(t),h=qd.HmacSHA256(l,t).toString().toLocaleUpperCase();return Object.assign(Object.assign({},this.axios.defaults.headers),{Authorization:"Bearer ".concat(t||""),"x-xy-clientid":this.clientId,"x-xy-clienttype":Ud.CLIENT_TYPE,"x-xy-nonce":a,"x-xy-timestamp":s,"x-xy-signtype":"HMAC_SHA256","x-xy-sign":h})}},{key:"setLoginInfo",value:function(e){this.loginInfo=e}}]),e}(),dp="2.0.1-beta.8 - build on 2021-03-26 19:11",pp="wss://cloudapi.xylink.com",vp="https://cloudapi.xylink.com",gp="https://log.xylink.com",mp="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),yp=new Uint8Array(16);function bp(){if(!mp)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return mp(yp)}for(var wp=[],kp=0;kp<256;++kp)wp[kp]=(kp+256).toString(16).substr(1);function _p(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||bp)();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=wp;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 Sp=new(function(){function e(){oo(this,e),this.http=new fp({baseURL:vp,timeout:2e4}),this.logHttp=new fp({baseURL:gp,timeout:2e4}),this.clientId="",this.meetingInfo={meetingId:"",callUri:""}}return so(e,[{key:"setBaseUrl",value:function(e,t){this.http.setBaseUrl(e),this.logHttp.setBaseUrl(t)}},{key:"setLogBaseUrl",value:function(e){this.logHttp.setBaseUrl(e)}},{key:"setClientId",value:function(e){this.clientId=e,this.http.setClientId(e)}},{key:"setLogger",value:function(e){this.http.setLogger(e),this.logHttp.setLogger(e)}},{key:"setMeetingInfo",value:function(e){this.meetingInfo=e}},{key:"upload",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.logHttp.post("/api/rest/v1/log/standardLog",e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"login",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),n=e.userName,r=e.password,t.next=4,this.http.put("/api/rest/iauth/v5/en/login",{account:n,password:r,deviceType:17,deviceSn:_p()},{headers:{"x-xy-clientid":this.clientId,"x-xy-clienttype":Ud.CLIENT_TYPE}});case 4:return(i=t.sent).data&&200===i.status&&this.http.setLoginInfo(i.data.token),t.abrupt("return",i);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"getSdkUserInfo",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),n=e.displayName,r=e.extId,t.next=4,this.http.post("/api/rest/internal/v1/en/sdk/webRtc/user",{extId:r,displayName:n,externalUserId:""},{headers:{"x-xy-clientid":this.clientId,"x-xy-clienttype":Ud.CLIENT_TYPE}});case 4:return i=t.sent,t.abrupt("return",i);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"setLoginInfo",value:function(e){this.http.setLoginInfo(e)}},{key:"getUserInfo",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("/admin/login/current/user",{token:e});case 2:if(!(n=t.sent).data||0!==n.data.code){t.next=5;break}return t.abrupt("return",n.data.data);case 5:return t.abrupt("return",n);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"getCallUri",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("/api/rest/uss/v4/callUrlInfoV2",{params:e});case 2:if(!(n=t.sent)||!n.data){t.next=5;break}return t.abrupt("return",n.data);case 5:return t.abrupt("return",n);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"verifyPassword",value:function(e,t,n){return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.next=2,this.http.put("/api/rest/uss/v4/en/cloudmeeting/validation?securitykey=".concat(n),{number:e,passwd:t});case 2:return i=r.sent,r.abrupt("return",i);case 4:case"end":return r.stop()}}),r,this)})))}},{key:"hand",value:function(e,t,n,r){return ko(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.http.post("/page/api/rest/v2/".concat(e,"?meetingId=").concat(t,"&di=").concat(n,"&conferenceNo=").concat(r));case 2:return o=i.sent,i.abrupt("return",o);case 4:case"end":return i.stop()}}),i,this)})))}},{key:"fetchErrorCode",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.get("/api/rest/clientConfg/v3/getDefaultServerConfig?configName=errorcode&securityKey=".concat(e));case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"getErrorCodeByJson",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new fp({baseURL:""}).get(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t)})))}},{key:"getConference",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.http.get("/api/rest/v1/meetingroom/hidden/soft/conference?userProfileId=".concat(e,"&securityKey=").concat(t)));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"setStates",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=this.meetingInfo,o=i.meetingId,a=i.callUri,s={meetingId:o,callUri:a,action:e,eventType:t,timestamp:(new Date).getTime()},u=JSON.stringify(Object.assign({},s,n)),c={device:a,msgVer:"0.0.1",states:[{name:"meetingEvent",version:"1.0",value:u,tag:"audit"}]},r.prev=4,r.next=7,this.http.post("/api/rest/v3/device/states",c);case 7:r.next=11;break;case 9:r.prev=9,r.t0=r.catch(4);case 11:case"end":return r.stop()}}),r,this,[[4,9]])})))}},{key:"igonreMeetingMonito",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=(1e3*Math.random()).toFixed(),i="/api/rest/uss/v1/cloudmeeting/monitor?securityKey=".concat(t,"&conferenceNumber=").concat(e,"&nonce=").concat(r),n.next=4,this.http.get(i);case 4:return n.abrupt("return",n.sent);case 5:case"end":return n.stop()}}),n,this)})))}}]),e}()),xp=function(){function e(){var t=this;oo(this,e),this.stopDB=function(){t.db.stop()},this.openDB=function(){t.db.open()},this.initDB=function(){return ko(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,this)})))},this.setLogLevel=function(e){t.currentLevel=e},this.putLog=function(e,n,r,i){return ko(t,void 0,void 0,regeneratorRuntime.mark((function t(){var o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o={time:i,title:e,content:n,rest:r},!this.db||!this.db.isOpen()){t.next=12;break}if(!this.cacheData.length||this.isAddCache){t.next=8;break}return this.isAddCache=!0,t.next=6,Promise.all(this.cacheData.map((function(e){return ko(a,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.db.add(e);case 2:case"end":return t.stop()}}),t,this)})))})));case 6:this.cacheData=[],this.isAddCache=!1;case 8:return t.next=10,this.db.add(o);case 10:t.next=14;break;case 12:this.cacheData.length>4&&this.cacheData.shift(),this.cacheData.push(o);case 14:case"end":return t.stop()}}),t,this)})))},this.downloadLog=function(){return ko(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.tempStart();case 2:return e.next=4,this.db.export();case 4:case"end":return e.stop()}}),e,this)})))},this.setLogServer=function(e){Sp.setLogBaseUrl(e)},this.db=new Pf,this.LogLevel={INFO:"INFO",DEBUG:"DEBUG",WARNING:"WARNING",ERROR:"ERROR",NONE:"NONE"},this.currentLevel=this.LogLevel.DEBUG,this.isArrowUpload=!0,this.cacheData=[],this.isAddCache=!1}return so(e,[{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=Lf(),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(Nf(),"][DEBUG]"),t,n].concat(a));this.putLog(t,n,a,i)}},{key:"log",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=Lf(),s=arguments.length,u=new Array(s>2?s-2:0),c=2;c<s;c++)u[c-2]=arguments[c];this.currentLevel!==o&&this.currentLevel!==i||(t=console).log.apply(t,["[".concat(Nf(),"][INFO]"),e,n].concat(u));this.putLog(e,n,u,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=Lf(),u=arguments.length,c=new Array(u>2?u-2:0),l=2;l<u;l++)c[l-2]=arguments[l];this.currentLevel!==o&&this.currentLevel!==i&&this.currentLevel!==a||(t=console).log.apply(t,["[".concat(Nf(),"][WARN]"),e,n].concat(c));this.putLog(e,n,c,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,u=Lf(),c=arguments.length,l=new Array(c>2?c-2:0),h=2;h<c;h++)l[h-2]=arguments[h];this.currentLevel!==o&&this.currentLevel!==a&&this.currentLevel!==i&&this.currentLevel!==s||(t=console).log.apply(t,["[".concat(Nf(),"][ERROR]"),e,n].concat(l));this.putLog(e,n,l,u)}},{key:"enableLogUpload",value:function(){this.isArrowUpload=!0}},{key:"disableLogUpload",value:function(){this.isArrowUpload=!1}},{key:"uploadLog",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.isArrowUpload){r.next=36;break}return r.next=3,this.db.tempStart();case 3:return r.next=5,this.db.upload(e);case 5:return i=r.sent,o=new FormData,a=Math.ceil(1e4*Math.random())+"",s=Date.now()+"",o.append("comments",n||e),o.append("sn",a),o.append("userId",a),o.append("deviceId",a),o.append("deviceType","WebrtcSDK"),o.append("userDisplayName",e),o.append("deviceDisplayName",navigator.userAgent),o.append("dataType","userSubmit"),o.append("account",t),o.append("number",""),o.append("softwareVersion",""),o.append("osVersion",""),o.append("deviceModel",""),o.append("crashType","UI"),o.append("crashTime",s),o.append("suffixName",".zip"),o.append("file",i,"webrt_log.zip"),r.prev=26,r.next=29,Sp.upload(o);case 29:return u=r.sent,r.abrupt("return",u&&(u.status>=200||u.status<300));case 33:return r.prev=33,r.t0=r.catch(26),r.abrupt("return",!1);case 36:case"end":return r.stop()}}),r,this,[[26,33]])})))}}]),e}(),Ep=ct.filter,Op=gt("filter"),Cp=He("filter");Le({target:"Array",proto:!0,forced:!Op||!Cp},{filter:function(e){return Ep(this,e,arguments.length>1?arguments[1]:void 0)}});var Ap=ct.findIndex,Ip=!0,Tp=He("findIndex");"findIndex"in[]&&Array(1).findIndex((function(){Ip=!1})),Le({target:"Array",proto:!0,forced:Ip||!Tp},{findIndex:function(e){return Ap(this,e,arguments.length>1?arguments[1]:void 0)}}),Dn("findIndex");var Rp=[].slice,Lp={},Np=function(e,t,n){if(!(t in Lp)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";Lp[t]=Function("C,a","return new C("+r.join(",")+")")}return Lp[t](e,n)},Mp=Function.bind||function(e){var t=Xe(this),n=Rp.call(arguments,1),r=function(){var i=n.concat(Rp.call(arguments));return this instanceof r?Np(t,i.length,i):t.apply(e,i)};return b(t.prototype)&&(r.prototype=t.prototype),r};Le({target:"Function",proto:!0},{bind:Mp});var Pp=function(e,t,n){var r,i;return Jn&&"function"==typeof(r=t.constructor)&&r!==n&&b(i=r.prototype)&&i!==n.prototype&&Jn(e,i),e},Bp=we.f,Dp=A.f,jp=R.f,Up=Et.trim,Fp=a.Number,zp=Fp.prototype,Hp="Number"==p(Rn(zp)),Vp=function(e){var t,n,r,i,o,a,s,u,c=w(e,!1);if("string"==typeof c&&c.length>2)if(43===(t=(c=Up(c)).charCodeAt(0))||45===t){if(88===(n=c.charCodeAt(2))||120===n)return NaN}else if(48===t){switch(c.charCodeAt(1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=c.slice(2)).length,s=0;s<a;s++)if((u=o.charCodeAt(s))<48||u>i)return NaN;return parseInt(o,r)}return+c};if(Te("Number",!Fp(" 0o1")||!Fp("0b1")||Fp("+0x1"))){for(var Wp,Kp=function(e){var t=arguments.length<1?0:e,n=this;return n instanceof Kp&&(Hp?s((function(){zp.valueOf.call(n)})):"Number"!=p(n))?Pp(new Fp(Vp(t)),n,Kp):Vp(t)},qp=u?Bp(Fp):"MAX_VALUE,MIN_VALUE,NaN,NEGATIVE_INFINITY,POSITIVE_INFINITY,EPSILON,isFinite,isInteger,isNaN,isSafeInteger,MAX_SAFE_INTEGER,MIN_SAFE_INTEGER,parseFloat,parseInt,isInteger".split(","),Gp=0;qp.length>Gp;Gp++)_(Fp,Wp=qp[Gp])&&!_(Kp,Wp)&&jp(Kp,Wp,Dp(Fp,Wp));Kp.prototype=zp,zp.constructor=Kp,ne(a,"Number",Kp)}var Yp=s((function(){Ne(1)}));Le({target:"Object",stat:!0,forced:Yp},{keys:function(e){return Ne(Me(e))}});var Zp=/"/g;Le({target:"String",proto:!0,forced:function(e){return s((function(){var t=""[e]('"');return t!==t.toLowerCase()||t.split('"').length>3}))}("link")},{link:function(e){return t="a",n="href",r=e,i=String(m(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+String(r).replace(Zp,""")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}});var Xp={LOCAL_NET_DISCONNECT:"网络中断,呼叫已断开",SIGNAL_TIMEOUT:"网络中断,呼叫已断开",MEDIA_TIMEOUT:"媒体超时",EXCEPTION_CALL_EXIST:"您正在呼叫中,请稍后重试",EXCEPTION_CALL_NOT_EXIST:"呼叫异常,请稍后重试",EXCEPTION_UNKNOWN:"呼叫异常,请稍后重试",TIME_OUT:"对方没有应答,请稍后再试",INVALID_NEMONO:"无效的终端号,请重新输入",USER_NOT_ALLOWED:"对方终端不允许外人拨打,请与对方确认后再拨",NEN_NORMAL_CONF_SESSION_EXCEED:"当前会议人数已超限,请加入企业通讯录,可支持更多方会议。",NOT_ALLOW_NEMO_CALL:"对方终端不允许陌生人呼叫",CONFMGMT_CONFOVER:"主持人结束会议",CONFMGMT_KICKOUT:"主持人移除当前的小程序",MEETING_LOCKED:"会议已经被锁定,无法加入",NORMAL_CONF_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",NORMAL_EN_NEMO_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",LARGE_CONF_SESSION_EXCEED:"您呼叫的会议已达到最大支持人数",NOT_ALLOW_CONFERENCE_CALL:"您呼叫的云会议室不允许通讯录外成员呼入,请联系云会议室管理员",NOT_ALLOW_CONFERENCE_ANONYMOUS_CALL:"您呼叫的云会议室不允许匿名用户呼入,请联系云会议室管理员",BUSY:"对方忙",PEER_NOT_FOUND:"对方不在线",STATUS_OK:"通话已结束",EXCEPTION_PARAM_ERROR:"呼叫失败,请稍后重试",MEETING_DISCONNECT_USER_CONF_SESSION_EXCEED:"此云会议室已达允许呼入的上限",MEETING_DISCONNECT_DEP_CONF_SESSION_EXCEED:"此云会议室已达部门允许呼入的上限",MEETING_DISCONNECT_ENT_CONF_SESSION_EXCEED:"此云会议室已达企业允许呼入的上限",NO_AUTHORITY:"没有呼叫权限",KickoutTipContent:"您的账号在另一地点登录,您被迫下线",UNSUPPORT_CALL:"您的终端目前无法支持此类呼叫",SHARE_CONTENT_FAILED:"分享屏幕失败"},Jp=function(){function e(){oo(this,e),this.events={}}return so(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}(),$p=[],Qp=function(){function e(t,n){var r=this;oo(this,e),this.onOpenSocket=function(e){r.isConnected=!0,r.lockReconnect=!1,r.options.openHeatBeat&&r.sendHeartBeat(),r.emit("open",e)},this.onHandleMessage=function(e){r.options.openHeatBeat&&e.data===r.options.pangData?r.handlePang():r.emit("message",e)},this.onCloseSocket=function(e){r.isConnected=!1,r.isClose=!0,r.logger.log("close websocket success",function(e){return JSON.stringify(e,Object.getOwnPropertyNames(e),2)}(e)),r.logger.log("this.messageList: ",r.messageList),r.emit("close",e)},this.onErrorSocket=function(e){r.logger.log("error connection websocket"),r.isConnected=!1,r.emit("error",e)};this.logger=n.logger,this.options=Object.assign(Object.assign({},{protocols:[],pingData:"PING",pangData:"PONG",autoReConnect:!0,openHeatBeat:!0,params:{}}),t),this.heatBeatFrequency=2e4,this.timeOffset=1e4,this.reconnectCount=0,this.reconnectLimit=5,this.lockReconnect=!1,this.messageList={},this.headBeatTimer=null,this.isConnected=!1,this.isClose=!1,this.connect(!1),this.addEvent()}return so(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),$p.push(this.socket),e&&(this.lockReconnect=!1)}else this.emit("error",Mf(10002,"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),this.creatTimeout()),this.headBeatTimer=setInterval((function(){e.socket.send(e.options.pingData),e.creatTimeout()}),this.heatBeatFrequency)}},{key:"creatTimeout",value:function(){var e=this;this.pangTimer=setTimeout((function(){e.emit("timeout",""),e.options.autoReConnect&&e.reConnect()}),this.timeOffset)}},{key:"handlePang",value:function(){clearTimeout(this.pangTimer)}},{key:"emit",value:function(e,t){this.messageList[e]&&this.messageList[e].forEach((function(e){e(t)}))}},{key:"reset",value:function(){clearInterval(this.headBeatTimer),clearTimeout(this.pangTimer),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(),$p.map((function(e){e&&e.close()})),$p=[],clearInterval(this.headBeatTimer),clearTimeout(this.pangTimer),e||(this.messageList={}),this.removeEvent()}},{key:"send",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=e.type&&"PASS_THROUGH"===e.type&&"candidate"===e.body.type,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),this.logger.log("send wss message successfully")),"STOP_CALL"===e.type&&this.stopCall()):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(){this.lockReconnect||(this.reconnectCount>=this.reconnectLimit?this.emit("close",null):(this.lockReconnect=!0,this.reconnectCount+=1,this.logger.log("reconnect is trgger"),this.logger.log("reconnect count:",this.reconnectCount),this.close(!0),this.emit("reconnect",""),this.connect(!0),this.addEvent()))}}]),e}(),ev=ct.every,tv=je("every"),nv=He("every");Le({target:"Array",proto:!0,forced:!tv||!nv},{every:function(e){return ev(this,e,arguments.length>1?arguments[1]:void 0)}});var rv=Math.max,iv=Math.min,ov=Math.floor,av=/\$([$&'`]|\d\d?|<[^>]*>)/g,sv=/\$([$&'`]|\d\d?)/g;Yt("replace",2,(function(e,t,n,r){var i=r.REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE,o=r.REPLACE_KEEPS_$0,a=i?"$":"$0";return[function(n,r){var i=m(this),o=null==n?void 0:n[e];return void 0!==o?o.call(n,i,r):t.call(String(i),n,r)},function(e,r){if(!i&&o||"string"==typeof r&&-1===r.indexOf(a)){var u=n(t,e,this,r);if(u.done)return u.value}var c=I(e),l=String(this),h="function"==typeof r;h||(r=String(r));var f=c.global;if(f){var d=c.unicode;c.lastIndex=0}for(var p=[];;){var v=Qt(c,l);if(null===v)break;if(p.push(v),!f)break;""===String(v[0])&&(c.lastIndex=$t(l,le(c.lastIndex),d))}for(var g,m="",y=0,b=0;b<p.length;b++){v=p[b];for(var w=String(v[0]),k=rv(iv(ue(v.index),l.length),0),_=[],S=1;S<v.length;S++)_.push(void 0===(g=v[S])?g:String(g));var x=v.groups;if(h){var E=[w].concat(_,k,l);void 0!==x&&E.push(x);var O=String(r.apply(void 0,E))}else O=s(w,l,k,_,x,r);k>=y&&(m+=l.slice(y,k)+O,y=k+w.length)}return m+l.slice(y)}];function s(e,n,r,i,o,a){var s=r+e.length,u=i.length,c=sv;return void 0!==o&&(o=Me(o),c=av),t.call(a,c,(function(t,a){var c;switch(a.charAt(0)){case"$":return"$";case"&":return e;case"`":return n.slice(0,r);case"'":return n.slice(s);case"<":c=o[a.slice(1,-1)];break;default:var l=+a;if(0===l)return t;if(l>u){var h=ov(l/10);return 0===h?t:h<=u?void 0===i[h-1]?a.charAt(1):i[h-1]+a.charAt(1):t}c=i[l-1]}return void 0===c?"":c}))}}));var uv=Object.prototype.toString,cv=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"===lv(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(lv(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=uv.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 lv(e){return"function"==typeof e.constructor?e.constructor.name:null}const hv=Symbol.prototype.valueOf;var fv=function(e,t){switch(cv(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 hv?Object(hv.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 dv(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function pv(e,t){switch(cv(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||(n=e,!1!==dv(n)&&"function"==typeof(r=n.constructor)&&!1!==dv(i=r.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))){const n=new e.constructor;for(let r in e)n[r]=pv(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]=pv(e[r],t);return n}(e,t);default:return fv(e)}}var vv=pv,gv=function(){function e(t,n){oo(this,e);var r=t.logger,i=t.invite;this.client=t,this.peerStatus={peerconnectionStatus:"disconnected",iceConnectionState:"disconnected"},this.invite=i,this.logger=r,this.peerConnection=null,this.connectCount=0,this.stream=n,this.streamSenders=[],this.senderTimmer=null,this.internels=vv(Ud.INIT_INTERNELS),this.isShareContent=!1,this.onHandleNegotiationNeeded=this.onHandleNegotiationNeeded.bind(this),this.onHandleIceConnectionStateChange=this.onHandleIceConnectionStateChange.bind(this),this.onHandleConnectionStateChange=this.onHandleConnectionStateChange.bind(this),this.onTrack=this.onTrack.bind(this),this.init()}return so(e,[{key:"init",value:function(){this.initTimmer(),this.peerConnection=new RTCPeerConnection(Dd),this.peerConnection.onnegotiationneeded=this.onHandleNegotiationNeeded,this.peerConnection.oniceconnectionstatechange=this.onHandleIceConnectionStateChange,this.peerConnection.onconnectionstatechange=this.onHandleConnectionStateChange,null===this.peerConnection.ontrack?this.peerConnection.ontrack=this.onTrack:this.peerConnection.addEventListener("track",this.onTrack)}},{key:"sendEmmit",value:function(e,t,n,r){10518===t&&this.client.setPeerConnectionStatus(!0),this.client.emmit(e,{code:t,msg:n,detail:r})}},{key:"stopConnectTimmer",value:function(){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=vv(e.peerStatus);return e.connectCount>40?(e.sendEmmit("call-status",10517,"呼叫失败","PEER_NET_DISCONNECT"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i)):"connected"!==n||"connected"!==r&&"completed"!==r?(20===e.connectCount&&(e.sendEmmit("call-status",10519,"正在呼叫中,请等候","waiting"),e.logger.log("loop peer status: ",i)),e.connectCount++,void e.initTimmer()):(e.sendEmmit("call-status",10518,"入会成功","success"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i))}),1e3)}},{key:"onHandleNegotiationNeeded",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"createBaseOfferConnection",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.peerConnection.createOffer(e);case 3:return(n=t.sent).sdp=n.sdp.replace("useinbandfec=1","useinbandfec=0"),t.next=7,this.peerConnection.setLocalDescription(n);case 7:this.sendSocketMessage("offer",{sdp:n.sdp}),this.client.sendPeopleCapability(),t.next=14;break;case 11:t.prev=11,t.t0=t.catch(0),this.logger.error("create offer error: ",t.t0);case 14:case"end":return t.stop()}}),t,this,[[0,11]])})))}},{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(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return delete e.type,t.prev=1,t.next=4,this.peerConnection.addIceCandidate(new RTCIceCandidate(e));case 4:t.next=9;break;case 6:t.prev=6,t.t0=t.catch(1),this.logger.error("peer add ice candidate error: ",t.t0);case 9:case"end":return t.stop()}}),t,this,[[1,6]])})))}},{key:"handleAnswer",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.peerConnection.setRemoteDescription(new RTCSessionDescription(e));case 2:case"end":return t.stop()}}),t,this)})))}},{key:"setBandWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Ud.VIDE_BANDWIDTH_BIT,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=wo(this.streamSenders),r.prev=1,i.s();case 3:if((o=i.n()).done){r.next=21;break}if(a=o.value,!(s=a.sender)||!s.track||"video"!==s.track.kind||e!==s.track.id){r.next=19;break}return u=s.getParameters()||{encodings:[{maxBitrate:Ud.VIDE_BANDWIDTH_BIT}]},c=n?1e3*t:t,u.encodings[0]?u.encodings[0].maxBitrate=c:u.encodings[0]={maxBitrate:c},r.prev=10,r.next=13,s.setParameters(u);case 13:this.logger.debug("set bandwidth successfully",{paramas:u,realBandwidth:c,trackId:s.track.id}),r.next=19;break;case 16:r.prev=16,r.t0=r.catch(10),this.logger.error("set bandwidth failed",u,r.t0);case 19:r.next=3;break;case 21:r.next=26;break;case 23:r.prev=23,r.t1=r.catch(1),i.e(r.t1);case 26:return r.prev=26,i.f(),r.finish(26);case 29:case"end":return r.stop()}}),r,this,[[1,23,26,29],[10,16]])})))}},{key:"onHandleIceConnectionStateChange",value:function(e){this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{iceConnectionState:e.target.iceConnectionState}),this.logger.log("ice change status: ",vv(this.peerStatus))}},{key:"onHandleConnectionStateChange",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.peerConnection.connectionState,this.logger.log("peerconnection status change: ",{currentStatus:t,previousStatus:this.peerStatus.peerconnectionStatus}),"connected"!==this.peerStatus.peerconnectionStatus||"connected"===t){e.next=6;break}return"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapablityMessage(),e.next=6,this.restartIceConnection();case 6:this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:t}),this.logger.log("this.peerStatus: ",this.peerStatus);case 8:case"end":return e.stop()}}),e,this)})))}},{key:"restartIceConnection",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection({iceRestart:!0});case 2:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){var e=this;this.stopConnectTimmer(),this.peerConnection&&(this.streamSenders.forEach((function(t){(null==t?void 0:t.sender)&&e.peerConnection.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}},{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&&this.addTransceiver(r,"sendrecv"),this.addTransceiver(i,"recvonly"),this.logger.log("publish people stream successfully")):"CONTENT"===t&&(this.isShareContent?(this.replaceTrack(o),this.logger.log("push content use replaceTrack.")):(this.addTransceiver(o,"sendonly"),this.logger.log("push content use addTransceiver.")),this.isShareContent=!0,this.logger.log("publish content stream successfully: ",this.streamSenders)),this.initSenderStatus()}},{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.replaceTrack(r)}},{key:"initSenderStatus",value:function(){var e=this;this.senderInterval=0,this.senderTimmer||(this.calcMeetingStats(),this.senderTimmer=setInterval((function(){return ko(e,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,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:"calcMeetingStats",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l,h,f,d,p,v,g,m,y,b,w,k;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=vv(Ud.INIT_INTERNELS),n=!1,r=this.client.invite.callerUri,i=this.client.getLayoutList(),o=wo(i.entries()),e.prev=5,o.s();case 7:if((a=o.n()).done){e.next=24;break}if(s=go(a.value,2),s[0],u=s[1],c=u.roster.endpointId,c===r){e.next=22;break}if(l=u.roster.id,h=this.client.getVideoManagers(),f=h[l],!((d=null==f?void 0:f.getVideoTracks())&&d[0]&&this.peerConnection)){e.next=22;break}return e.next=19,this.peerConnection.getStats(d[0]);case 19:p=e.sent,v=this.getReceiverStatus(p,u),t.receiver[d[0].id]=v;case 22:e.next=7;break;case 24:e.next=29;break;case 26:e.prev=26,e.t0=e.catch(5),o.e(e.t0);case 29:return e.prev=29,o.f(),e.finish(29);case 32:g=wo(this.streamSenders.entries()),e.prev=33,g.s();case 35:if((m=g.n()).done){e.next=46;break}if(y=go(m.value,2),y[0],"active"!==(b=y[1]).status||!b.track||"video"!==b.track.kind){e.next=44;break}return e.next=40,b.sender.getStats();case 40:w=e.sent,k=this.getSenderStatus(w,t,b,!n),t.sender[b.track.id]=k,n=!0;case 44:e.next=35;break;case 46:e.next=51;break;case 48:e.prev=48,e.t1=e.catch(33),g.e(e.t1);case 51:return e.prev=51,g.f(),e.finish(51);case 54:this.internels=t,this.client.debug&&this.client.sendInternels(t),this.senderInterval>=3&&t.bytesSentSecond<500&&(this.logger.debug("meeting-stats",t),this.senderInterval=0);case 57:case"end":return e.stop()}}),e,this,[[5,26,29,32],[33,48,51,54]])})))}},{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?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,i=e.kind,o={direction:t},a="NORMAL"===n.status,s=e.kind;a&&(o.streams=[n.stream],s=e),r=this.peerConnection.addTransceiver(s,o);var u={resolution:n.resolution,track:a?e:null,sender:r.sender,type:n.type,status:a?"active":"invalid"};("video"===i&&("remoteStream"===n.type||"contentStream"===n.type)||"audio"===i&&"180"===n.resolution)&&this.streamSenders.push(u)}},{key:"replaceAudioTrack",value:function(e){var t,n=this;e.every((function(e){"180"===e.resolution&&(t=e.stream.getAudioTracks()[0])})),this.streamSenders.forEach((function(e,r){"180"===e.resolution&&e.track&&"audio"===e.track.kind&&(e.sender.replaceTrack(t),n.streamSenders[r].status="active",n.streamSenders[r].track=t)}))}},{key:"replaceTrack",value:function(e){var t=this;e.forEach((function(e){e.stream.getTracks().forEach((function(n){"video"===n.kind&&t.streamSenders.forEach((function(r,i){"video"===r.track.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){var i=this,o={};return e.forEach((function(e){var a=e.type,s=e.bytesSent,u=void 0===s?0:s,c=e.bytesReceived,l=void 0===c?0:c,h=e.timestamp,f=void 0===h?0:h,d=e.pliCount,p=void 0===d?0:d;if(r&&"transport"===a){var v=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1),g=i.rateBytesCalculator(e,"bytesReceived","timestamp",8,1);t.bytesSent=u,t.bytesReceived=l,t.bytesReceivedSecond=g,t.timestamp=f,t.bytesSentSecond=v}else if("track"===a){var m=e.frameWidth,y=void 0===m?0:m,b=e.frameHeight,w=void 0===b?0:b,k=e.framesSent,_=void 0===k?0:k,S=e.hugeFramesSent,x=void 0===S?0:S,E=e.timestamp,O=void 0===E?0:E,C=i.rateBytesCalculator(e,"framesSent","timestamp",1,1e3,i.internels.sender[n.track.id]);o.frameWidth=y,o.frameHeight=w,o.framesSent=_,o.framesSentSecond=C,o.hugeFramesSent=x,o.timestamp=O,o.type=n.type,o.status=n.status,o.resolution=n.resolution,o.expBandwidth=10}else if("outbound-rtp"===a){var A=e.bytesSent,I=e.framesEncoded,T=e.packetsSent,R=e.keyFramesEncoded,L=void 0===R?"N/A":R,N=i.rateBytesCalculator(e,"framesEncoded","timestamp",1,1e3,i.internels.sender[n.track.id]),M=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1,i.internels.sender[n.track.id]);o.bytesSent=A,o.bytesSentSecond=M,o.framesEncoded=I,o.framesEncodedSecond=N,o.packetsSent=T,o.keyFramesEncoded=L,o.pliCount=p}else if(r&&"codec"===a){var P=e.mimeType;t.mimeType=P}})),o}},{key:"getReceiverStatus",value:function(e,t){var n=this,r={};return e.forEach((function(e){var i,o=e.type,a=t.roster.id,s=n.client.getVideoManagers()[a],u=(null===(i=((null==s?void 0:s.getVideoTracks())||[])[0])||void 0===i?void 0:i.id)||"";if("track"===o){var c=e.frameWidth,l=void 0===c?0:c,h=e.frameHeight,f=void 0===h?0:h,d=e.framesReceived,p=void 0===d?0:d,v=e.jitterBufferDelay,g=void 0===v?0:v,m=e.timestamp,y=void 0===m?0:m,b=n.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,n.internels.receiver[u]),w=t.roster,k=w.displayName,_=w.endpointId,S=w.isContent;r.frameWidth=l,r.frameHeight=f,r.framesReceived=p,r.framesReceivedSecond=b,r.jitterBufferDelay=g,r.timestamp=y,r.type=_,r.status="active",r.name=k,r.isContent=S,r.expResolution=0}else if("inbound-rtp"===o){var x=e.bytesReceived,E=e.framesDecoded,O=e.packetsReceived,C=e.keyFramesDecoded,A=void 0===C?"N/A":C,I=e.nackCount,T=e.pliCount,R=n.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,n.internels.receiver[u]),L=n.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,n.internels.receiver[u]);r.bytesReceived=x,r.bytesReceivedSecond=L,r.framesDecoded=E,r.framesDecodedSecond=R,r.packetsReceived=O,r.keyFramesDecoded=A,r.nackCount=I,r.pliCount=T}})),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]),u=Number(e[t]),c=Number(a[n]),l=Number(e[n]);if(!(s&&u&&c&&l))return 0;if("number"!=typeof c||"number"!=typeof l||"number"!=typeof s||"number"!=typeof u)return 0;if(l-c==0)return 0;var h=r*(u-s),f=(l-c)/i;return Math.floor(h/f)}},{key:"onTrack",value:function(e){this.client.emmit("track",e)}}]),e}(),mv=ct.find,yv=!0,bv=He("find");"find"in[]&&Array(1).find((function(){yv=!1})),Le({target:"Array",proto:!0,forced:yv||!bv},{find:function(e){return mv(this,e,arguments.length>1?arguments[1]:void 0)}}),Dn("find");var wv=R.f,kv=Function.prototype,_v=kv.toString,Sv=/^\s*function ([^ (]*)/;u&&!("name"in kv)&&wv(kv,"name",{configurable:!0,get:function(){try{return _v.call(this).match(Sv)[1]}catch(e){return""}}});var xv={DEVICES:{audioInputList:[],audioOutputList:[],videoInList:[]},currentSelectedDevice:{deviceId:"",groupId:"",label:""}},Ev=function(e){uo(n,Jp);var t=vo(n);function n(e){var r;return oo(this,n),(r=t.call(this)).logger=e||new xp,r.navigator=navigator||window.navigator,r.mediaDevices=r.navigator.mediaDevices,r.currentDeviceList=xv.DEVICES,r.nextDeviceList=xv.DEVICES,r.currentUsedDevice={videoInput:xv.currentSelectedDevice,audioInput:xv.currentSelectedDevice,audioOutput:xv.currentSelectedDevice},r.currentPermission={microphone:"",camera:""},r.handlePermissionStateChanged=r.handlePermissionStateChanged.bind(fo(r)),r.mediaDevicesChange=r.mediaDevicesChange.bind(fo(r)),r.initDeviceEvent(),r}return so(n,[{key:"getDevicePermission",value:function(){return this.currentPermission}},{key:"setCurrentUsedDevice",value:function(e){this.currentUsedDevice=e,this.emmit("currentDevice",this.currentUsedDevice),this.logger.log("[DM]current used device in first calling: ",this.currentUsedDevice)}},{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 ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,this)})))}},{key:"init",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDevices();case 2:return t=e.sent,e.next=5,this.getPermission();case 5:n=e.sent,this.currentDeviceList=this.nextDeviceList=t,this.currentPermission=n,this.logger.log("[DM]current device list: ",this.currentDeviceList),this.logger.log("[DM]current permission: ",this.currentPermission);case 10:case"end":return e.stop()}}),e,this)})))}},{key:"destroy",value:function(){this.removeDeviceEvent(),this.permissionCameraStatus&&this.permissionCameraStatus.removeEventListener("change",this.handlePermissionStateChanged)}},{key:"getDevices",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.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 t=e.sent,n=[],r=[],i=[],t.forEach((function(e){var t=go(e.kind.match(/(\w+)(input|output)/i),3),o=t[0],a=t[1],s=t[2];if(!e.label.match(/\(Virtual\)$/)){var u={deviceId:e.deviceId,kind:o,type:a,direction:s,label:e.label,groupId:e.groupId};"audioinput"===e.kind?n.push(u):"audiooutput"===e.kind?r.push(u):"videoinput"===e.kind&&i.push(u)}})),o={audioInputList:n,audioOutputList:r,videoInList:i},e.abrupt("return",o);case 12:return e.prev=12,e.t0=e.catch(0),e.abrupt("return",Promise.reject(Mf(20521,"获取设备列表失败",e.t0)));case 15:case"end":return e.stop()}}),e,this,[[0,12]])})))}},{key:"emmitPermission",value:function(){this.currentPermission.camera&&this.emmit("permission",this.currentPermission)}},{key:"query",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.navigator.permissions.query({name:e});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",Promise.reject(Mf(20520,"Get permission failed",t.t0)));case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"handlePermissionStateChanged",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("[DM]permission changed: ",e),n=e.target.state,r=this.currentPermission,i=r.camera,o=r.microphone,"granted"!==n||"granted"===i&&"granted"===o){t.next=10;break}return t.next=6,this.getDevices();case 6:a=t.sent,s={detail:a,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device: ",s),this.emmit("device",s);case 10:"change"===e.type&&(this.currentPermission={microphone:n,camera:n}),this.emmit("permission",this.currentPermission);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getPermission",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.query("camera");case 3:return t=e.sent,e.next=6,this.query("microphone");case 6:return n=e.sent,r={camera:t.state,microphone:n.state},this.permissionCameraStatus||(this.permissionCameraStatus=t,this.permissionCameraStatus.addEventListener("change",this.handlePermissionStateChanged)),this.permissionPhoneStatus||(this.permissionPhoneStatus=n),e.abrupt("return",r);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()}}),e,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=mo(t).filter((function(t){return mo(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=mo(t).filter((function(t){return mo(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,u=this.diffAudioDevice(n,o),c=this.diffAudioDevice(r,a);return{audioInput:u,videoInput:this.diffVideoDevice(i,s),audioOutput:c}}},{key:"mediaDevicesChange",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getDevices();case 2:t=e.sent,n=this.currentUsedDevice.videoInput,this.nextDeviceList=vv(t),r=this.diffDevices(this.currentDeviceList,this.nextDeviceList),i=r.videoInput,o=r.audioInput,i&&i.deviceId!==n.deviceId?this.currentUsedDevice.videoInput=i:r.videoInput=void 0,this.currentUsedDevice.audioInput=o,this.currentDeviceList=vv(t),a={detail:t,nextDevice:r},this.logger.log("[DM]next used device: ",a),this.emmit("device",a);case 13:case"end":return e.stop()}}),e,this)})))}},{key:"initDeviceEvent",value:function(){this.navigator.mediaDevices.addEventListener("devicechange",this.mediaDevicesChange)}},{key:"removeDeviceEvent",value:function(){this.navigator.mediaDevices.removeEventListener("devicechange",this.mediaDevicesChange)}}]),n}(),Ov=gt("splice"),Cv=He("splice",{ACCESSORS:!0,0:0,1:2}),Av=Math.max,Iv=Math.min;Le({target:"Array",proto:!0,forced:!Ov||!Cv},{splice:function(e,t){var n,r,i,o,a,s,u=Me(this),c=le(u.length),l=de(e,c),h=arguments.length;if(0===h?n=r=0:1===h?(n=0,r=c-l):(n=h-2,r=Iv(Av(ue(t),0),c-l)),c+n-r>9007199254740991)throw TypeError("Maximum allowed length exceeded");for(i=at(u,r),o=0;o<r;o++)(a=l+o)in u&&bn(i,o,u[a]);if(i.length=r,n<r){for(o=l;o<c-r;o++)s=o+n,(a=o+r)in u?u[s]=u[a]:delete u[s];for(o=c;o>c-r+n;o--)delete u[o-1]}else if(n>r)for(o=c-r;o>l;o--)s=o+n-1,(a=o+r-1)in u?u[s]=u[a]:delete u[s];for(o=0;o<n;o++)u[o+l]=arguments[o+2];return u.length=c-r+n,i}});var Tv=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),Rv=i((function(e){var t=R.f,n=K("meta"),r=0,i=Object.isExtensible||function(){return!0},o=function(e){t(e,n,{value:{objectID:"O"+ ++r,weakData:{}}})},a=e.exports={REQUIRED:!1,fastKey:function(e,t){if(!b(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!_(e,n)){if(!i(e))return"F";if(!t)return"E";o(e)}return e[n].objectID},getWeakData:function(e,t){if(!_(e,n)){if(!i(e))return!0;if(!t)return!1;o(e)}return e[n].weakData},onFreeze:function(e){return Tv&&a.REQUIRED&&i(e)&&!_(e,n)&&o(e),e}};Y[n]=!0})),Lv=(Rv.REQUIRED,Rv.fastKey,Rv.getWeakData,Rv.onFreeze,R.f),Nv=Rv.fastKey,Mv=te.set,Pv=te.getterFor,Bv=(function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",u=a[e],c=u&&u.prototype,l=u,h={},f=function(e){var t=c[e];ne(c,e,"add"==e?function(e){return t.call(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!b(e))&&t.call(this,0===e?0:e)}:"get"==e?function(e){return i&&!b(e)?void 0:t.call(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!b(e))&&t.call(this,0===e?0:e)}:function(e,n){return t.call(this,0===e?0:e,n),this})};if(Te(e,"function"!=typeof u||!(i||c.forEach&&!s((function(){(new u).entries().next()})))))l=n.getConstructor(t,e,r,o),Rv.REQUIRED=!0;else if(Te(e,!0)){var d=new l,p=d[o](i?{}:-0,1)!=d,v=s((function(){d.has(1)})),g=Mr((function(e){new u(e)})),m=!i&&s((function(){for(var e=new u,t=5;t--;)e[o](t,t);return!e.has(-0)}));g||((l=t((function(t,n){br(t,l,e);var i=Pp(new u,t,l);return null!=n&&Or(n,i[o],i,r),i}))).prototype=c,c.constructor=l),(v||m)&&(f("delete"),f("has"),r&&f("get")),(m||p)&&f(o),i&&c.clear&&delete c.clear}h[e]=l,Le({global:!0,forced:l!=u},h),Yn(l,e),i||n.setStrong(l,e,r)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),{getConstructor:function(e,t,n,r){var i=e((function(e,o){br(e,i,t),Mv(e,{type:t,index:Rn(null),first:void 0,last:void 0,size:0}),u||(e.size=0),null!=o&&Or(o,e[r],e,n)})),o=Pv(t),a=function(e,t,n){var r,i,a=o(e),c=s(e,t);return c?c.value=n:(a.last=c={index:i=Nv(t,!0),key:t,value:n,previous:r=a.last,next:void 0,removed:!1},a.first||(a.first=c),r&&(r.next=c),u?a.size++:e.size++,"F"!==i&&(a.index[i]=c)),e},s=function(e,t){var n,r=o(e),i=Nv(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return gr(i.prototype,{clear:function(){for(var e=o(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,u?e.size=0:this.size=0},delete:function(e){var t=o(this),n=s(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),u?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=o(this),r=Je(e,arguments.length>1?arguments[1]:void 0,3);t=t?t.next:n.first;)for(r(t.value,t.key,this);t&&t.removed;)t=t.previous},has:function(e){return!!s(this,e)}}),gr(i.prototype,n?{get:function(e){var t=s(this,e);return t&&t.value},set:function(e,t){return a(this,0===e?0:e,t)}}:{add:function(e){return a(this,e=0===e?0:e,e)}}),u&&Lv(i.prototype,"size",{get:function(){return o(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=Pv(t),o=Pv(r);nr(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),yr(t)}}),function(){function e(t,n){oo(this,e),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state="",t&&(this.logger=t),this.isContent=!!n,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.onWainting=this.onWainting.bind(this)}return so(e,[{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;else{var r=document.createElement("video");r.autoplay=!0,r.playsInline=!0,r.controls=!1,t.appendChild(r),n=r}this.videoEle&&this.videoEle!==n&&this.removeEventListener(this.videoEle),this.wrapEleId=e,this.videoEle=n,this.initEventListerner(this.videoEle),this.logger.log("[VM]init video source: ",{key:this.key,wrapEleId:this.wrapEleId}),this.setSrcObject()}else{var i="Not found wrap video element use id ".concat(this.wrapEleId," selector");this.logger.log(i)}}},{key:"setSrcObject",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(!this.isHaveSrcObject&&this.stream||this.streamId!==e&&this.stream)){t.next=12;break}if(!this.videoEle){t.next=12;break}if(this.videoEle.srcObject=this.stream,!this.videoEle.paused){t.next=11;break}return t.prev=4,t.next=7,this.videoEle.play();case 7:t.next=11;break;case 9:t.prev=9,t.t0=t.catch(4);case 11:this.logger.log("[VM]set video srcObject: ",{key:this.key,streamId:this.streamId});case 12:case"end":return t.stop()}}),t,this,[[4,9]])})))}},{key:"initEventListerner",value:function(e){e.addEventListener("canplay",this.onCanPlay),e.addEventListener("loadstart",this.onLoadStart),e.addEventListener("error",this.onError),e.addEventListener("waiting",this.onWainting),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.onWainting),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){null==e||e.getVideoTracks()[0].addEventListener("mute",this.onMute),null==e||e.getVideoTracks()[0].addEventListener("unmute",this.onUnmute),null==e||e.getVideoTracks()[0].addEventListener("ended",this.onEnded)}},{key:"removeStreamTrackEventListener",value:function(){var e,t,n;this.streamStatus="ENABLED",null===(e=this.stream)||void 0===e||e.getVideoTracks()[0].removeEventListener("mute",this.onMute),null===(t=this.stream)||void 0===t||t.getVideoTracks()[0].removeEventListener("unmute",this.onUnmute),null===(n=this.stream)||void 0===n||n.getVideoTracks()[0].removeEventListener("ended",this.onEnded)}},{key:"isHaveSrcObject",value:function(){return this.videoEle&&this.videoEle.srcObject}},{key:"setSource",value:function(e,t){this.key===e&&this.wrapEleId===t||(this.key=e,this.initVideoSource(t))}},{key:"destroy",value:function(){this.clearTrackStatusTimmer(),this.removeEventListener(this.videoEle),this.stream&&this.removeStreamTrackEventListener(),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:"onWainting",value:function(){this.logger.log("video wainting",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(e){this.logger.log("video canplay",this.key),this.loadStatus="CANPLAY",this.sendVideoStatus()}},{key:"onLoadStart",value:function(e){this.logger.log("video loadstart",this.key),this.loadStatus="LOAD_START",this.sendVideoStatus()}},{key:"onError",value:function(e){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)}}]),e}()),Dv=Et.trim,jv=a.parseFloat,Uv=1/jv(wt+"-0")!=-1/0?function(e){var t=Dv(String(e)),n=jv(t);return 0===n&&"-"==t.charAt(0)?-0:n}:jv;Le({global:!0,forced:parseFloat!=Uv},{parseFloat:Uv});var Fv=function(e,t,n){var r=e.roster,i=r.videoRxMute,o=r.videoTxMute,a=r.deviceType,s=r.isContent,u=r.isLocal;return s?o?"AUDIO_CONTENT":"NORMAL":i&&o?"AUDIO_ONLY":o||"ENDED"===n?"MUTE":"tel"===a||"pstngw"===a?"AUDIO_TEL":t&&"REQUEST"!==n||u?"NORMAL":"REQUEST"},zv=function(e,t,n,r,i){var o,a,s=parseFloat((e/t).toFixed(3)),u=Ud.RATIO_MAP[i];return s<Ud.HOR_CONTAINER_RATIO?(o=n,a=parseFloat((n*s).toFixed(3))):(o=parseFloat((r/s).toFixed(3)),a=r),{realWidth:a,realHeight:o,realRotate:u}},Hv=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,u={};if(s>=0&&s<=3){var c=1===s||3===s,l=zv(c?a:i,c?i:a,n,t,s),h=l.realWidth,f=l.realHeight,d=l.realRotate;u={transform:"rotateZ(".concat(d,"deg)"),width:"".concat(c?f:h,"px"),height:"".concat(c?h:f,"px")}}return u},Vv=[-30,-30,1,1],Wv={"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}]},Kv={"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,.5,.5,.5],resolution:2},{position:[.5,0,.5,.5],resolution:2}],"5-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.333,.5],resolution:1}],"6-1":[{position:[0,0,.333,.5],resolution:1},{position:[0,.5,.333,.5],resolution:1},{position:[.333,.5,.333,.5],resolution:1},{position:[.333,0,.333,.5],resolution:1},{position:[.666,0,.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,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.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,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.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:[0,.666,.333,.333],resolution:1},{position:[.333,.333,.333,.333],resolution:1},{position:[.333,0,.333,.333],resolution:1},{position:[.666,0,.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},{position:[.666,.666,.333,.333],resolution:1}]},qv={SPEAKER:{length:8,temp:{0:Wv["1-1"],1:Wv["1-1"],2:Wv["2-1"],3:Wv["3-1"],4:Wv["4-1"],5:Wv["5-1"],6:Wv["6-1"],7:Wv["7-1"],8:Wv["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:Kv["1-1"],1:Kv["1-1"],2:Kv["2-1"],3:Kv["3-1"],4:Kv["4-1"],5:Kv["5-1"],6:Kv["6-1"],7:Kv["7-1"],8:Kv["8-1"],9:Kv["9-1"]},rate:{0:.5625,1:.5625,2:.2812,3:.5625,4:.5625,5:.375,6:.375,7:.5625,8:.5625,9:.5625}}},Gv={MULTI_PIC_CONTENT_HIGH_PRIORITY:qv.SPEAKER,MULTI_PIC_ACTIVE_HIGH_PRIORITY:qv.SPEAKER,TWO_PIC_PIP:{length:2,temp:{2:[{position:[0,0,1,1],resolution:3,zIndex:1},{position:[.75,.75,.25,.25],resolution:1,zIndex:2}]},rate:{2:.5625}},CONTENT_ONLY:{length:1,temp:{1:[{position:[0,0,1,1],resolution:3}]},rate:{1:.5625}},TWO_PIC_SYMMETRIC:{length:2,temp:{2:[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}]},rate:{2:.2812}}},Yv=Object.assign(Object.assign({},qv),Gv),Zv=function(){function e(t){var n,r;oo(this,e),this.client=t,this.logger=t.logger,this.customLayoutList=new Map,this.layoutList=new Map,this.videoManagers={},this.orderRosterList=[],this.selfRoster=Object.assign(Object.assign({},Ud.ROSTER),{isLocal:!0}),this.newLayoutList=[],this.initLayout=[],this.templateMode=(null===(n=t.config)||void 0===n?void 0:n.templateMode)||"SPEAKER",this.specifyTemplateMode=null===(r=t.config)||void 0===r?void 0:r.templateMode,this.templateRate={previous:.5625,next:null},this.content={previous:null,next:null},this.screenInfo={width:0,height:0,rateHeight:0,rateWidth:0},this.internelsLayout={},this.forceFullScreenId="",this.chairmanRoster=null,this.calculateScreenInfo(),this.onVideoStatusChange=this.onVideoStatusChange.bind(this)}return so(e,[{key:"getNewLayout",value:function(){return this.newLayoutList}},{key:"getOrderRosterList",value:function(){return this.orderRosterList}},{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:"getChairmanRoster",value:function(){return this.chairmanRoster}},{key:"rosterRecvMode",value:function(e){var t,n,r=this,i=[],o=.5625,a=this.client.getContentSenderPid(),s=this.client.getChairmanUri(),u=this.client.getSelfRoster(),c=this.client.invite.callerUri;this.specifyTemplateMode&&([].concat(mo(zd),mo(Fd)).findIndex((function(e){return e===r.specifyTemplateMode}))<0&&(this.templateMode=a?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER"));a?(zd.findIndex((function(e){return e===r.templateMode}))<0&&!this.specifyTemplateMode&&(this.templateMode="MULTI_PIC_CONTENT_HIGH_PRIORITY"),a===this.selfRoster.participantId&&(this.templateMode="GALLERY"),"TWO_PIC_PIP"!==this.templateMode&&"TWO_PIC_SYMMETRIC"!==this.templateMode||(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal}))),"MULTI_PIC_ACTIVE_HIGH_PRIORITY"===this.templateMode&&(this.orderRosterList[0]=this.orderRosterList.splice(2,1,this.orderRosterList[0])[0]),"GALLERY"===this.templateMode&&(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isContent})),e=this.orderRosterList.length),a===u.participantId?e=e>4?4:e:s&&this.chairmanRoster&&(null===(t=this.chairmanRoster)||void 0===t?void 0:t.endpointId)!==c&&e>3&&(e=3)):(Fd.findIndex((function(e){return e===r.templateMode}))<0&&(this.templateMode="SPEAKER"),s&&this.chairmanRoster&&(null===(n=this.chairmanRoster)||void 0===n?void 0:n.endpointId)!==c&&e>2&&(e=2));var l=Yv[this.templateMode];switch(this.templateMode){case"TWO_PIC_PIP":i=l.temp[2],o=l.rate[2];break;case"CONTENT_ONLY":i=l.temp[1],o=l.rate[1];break;case"TWO_PIC_SYMMETRIC":i=l.temp[2],o=l.rate[2];break;default:e>=0&&e<=l.length?(i=l.temp[e],o=l.rate[e]):(i=l.temp[l.length],o=l.rate[l.length])}return{tempLayout:i,templateRate:o}}},{key:"getInternelsLayout",value:function(){return this.internelsLayout}},{key:"setOrderRosterList",value:function(e){this.orderRosterList=e}},{key:"initLayoutManager",value:function(){this.orderRosterList=this.calculateOrderRosterList();var e=this.orderRosterList.length,t=this.templateRate.next,n=this.rosterRecvMode(e),r=n.tempLayout,i=n.templateRate;t!==i&&(this.templateRate={next:i,previous:i},this.calculateScreenInfo()),this.initLayout=vv(r),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=!1;if(i.has(e)){var s=i.get(e),u=s.state,c=s.roster.isLocal;"NORMAL"!==u&&"REQUEST"!==u||"ENDED"!==o?"NORMAL"!==u||"REQUEST"!==o||c?"REQUEST"!==u&&"INVALID"!==u||"CANPLAY"!==o||(n="NORMAL",a=!0):(n="REQUEST",a=!0):(n="INVALID",a=!0),a&&(i.set(e,Object.assign(Object.assign({},s),{state:n})),r?(this.layoutList=i,this.client.sendLayoutMessage()):(this.customLayoutList=i,this.client.sendCustomLayoutMessage()))}}},{key:"setVideoRenderer",value:function(e,t){this.videoManagers[e]||(this.videoManagers[e]=new Bv(this.logger)),this.videoManagers[e].setSource(e,t)}},{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,u=a.id,c=!1;e.videoManagers[u]||(e.videoManagers[u]=new Bv(e.logger),e.videoManagers[u].setVideoStatusChange(e.onVideoStatusChange)),e.videoManagers[u].match=!0;var l=e.videoManagers[u].state;if(s){var h=e.client.getPreviewStreams().previewStreams,f=((void 0===h?[]:h)[0]||{stream:null}).stream;e.videoManagers[u].initVideoStreamById(u,f);var d=Fv(t,f,l),p=r.get(n);r.set(n,Object.assign(Object.assign({},p),{state:d}))}else{for(var v=0;v<o;v++){var g=i.total[v],m=g.participantId,y=g.mediagroupid,b=g.videoTrackId;if(t.roster.participantId+t.roster.mediagroupid===m+y){var w=e.getVideoStreamByTrackId(b).videoStream;c=!0,e.videoManagers[u].initVideoStreamById(u,w);var k=Fv(t,w,l),_=r.get(n);r.set(n,Object.assign(Object.assign({},_),{state:k}));break}}if(!c){e.videoManagers[u].initVideoStreamById(u,null);var S=Fv(t,null,l),x=r.get(n);r.set(n,Object.assign(Object.assign({},x),{state:S}))}}})),this.clearInvalidVideoManagers(),this.logger.log('updated new layout list" ',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:"createCustomLayout",value:function(e){var t=this;e.forEach((function(e){var n=e.calluri,r=e.mediagroupid,i=e.isAudioMute,o=e.isVideoMute,a=e.remoteName,s=e.remoteType,u=e.MuteReason,c=n+r,l=Object.assign(Object.assign({},e),{id:c,isLocal:!1,isContent:1===r,displayName:a,endpointId:n,audioTxMute:i,videoTxMute:o,videoRxMute:!1,deviceType:s,audioRxMute:!1,videoMuteReason:u,isForceFullScreen:!1,isLastAdd:!1,onHold:!1,isPolling:!1});if(t.customLayoutList.has(c)){var h=t.customLayoutList.get(c);t.customLayoutList.set(c,Object.assign(Object.assign({},h),{roster:l,resolution:0,quality:0,deal:!0}))}else t.customLayoutList.set(c,{roster:l,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=e.isContent,o=e.resolution,a=e.quality,s=r+Number(i),u=t.customLayoutList.has(s),c=n.findIndex((function(e){return e.endpointId+Number(e.isContent)===s})),l=n[c],h=a>0?100*a:100;if(u){var f=t.customLayoutList.get(s);t.customLayoutList.set(s,Object.assign(Object.assign({},f),{roster:l,resolution:o,quality:h,deal:!0}))}else t.customLayoutList.set(s,{roster:l,rotate:{},state:"NORMAL",resolution:o,quality:h,deal:!0})})),this.clearInvalidLayout();var r=this.customLayoutCalculator();this.client.sendCustomLayout(r),this.logger.log("custom layout list: ",this.customLayoutList)}},{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:{},positionInfo:{},deal:!0,quality:100})})),this.clearInvalidLayout()}},{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,u=go(r.position,4),c=u[0],l=u[1],h=u[2],f=u[3],d=Math.round(a*c),p=Math.round(s*l),v=Math.round(a*h),g=Math.round(s*f);t={left:"".concat(d,"px"),top:"".concat(p,"px"),width:"".concat(v,"px"),height:"".concat(g,"px")},n={width:v,height:g},r.zIndex&&(t.zIndex=r.zIndex),e.layoutList.set(i,Object.assign(Object.assign({},r),{positionStyle:t,positionInfo:n}))}))}},{key:"requestLayoutCalculator",value:function(){var t=this,n=[],r={};if(this.forceFullScreenId){var i,o=!1,a=wo(this.layoutList);try{for(a.s();!(i=a.n()).done;){var s=go(i.value,2);s[0];if(s[1].roster.id===this.forceFullScreenId){o=!0;break}}}catch(e){a.e(e)}finally{a.f()}o||(this.forceFullScreenId="")}return this.layoutList.forEach((function(i,o){var a=i.roster,s=a.isContent,u=a.isLocal,c=a.id,l=a.videoTxMute,h=i.resolution;if(t.forceFullScreenId&&t.forceFullScreenId!==c)return!0;if(!u&&!l){var f={index:h,quality:200,resolution:Ud.RESOLUTION_MAP[h]};if(t.forceFullScreenId){var d=s?4:3;f={index:d,quality:200,resolution:Ud.RESOLUTION_MAP[d]}}else s&&(f=s&&3===h?{index:4,quality:100,resolution:Ud.RESOLUTION_MAP[4]}:{index:3,quality:200,resolution:Ud.RESOLUTION_MAP[3]});n.push(e.getCustomLayoutItem(i,f.index,f.quality)),r[o]={resolution:f.resolution,quality:f.quality}}})),this.internelsLayout=r,n}},{key:"setForceFullScreenId",value:function(e){this.forceFullScreenId=e}},{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,u=n.resolution,c=n.quality,l=c>0?100*c:100;a||(e.push({pid:s,resolution:u,quality:l,mediagroupid:Number(i)}),t[o]={resolution:Ud.RESOLUTION_MAP[u],quality:l})})),this.internelsLayout=t,e}},{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),s=null==a?void 0:a.positionInfo,u=s.width,c=s.height;o=Hv(t,u,c),e.layoutList.set(i,Object.assign(Object.assign({},a),{rotate:o}))}})),this.client.config.localMirror&&this.localMirrorRotate()}},{key:"customNewLayoutReq",value:function(e){var t=[],n=e.body,r=n.mediaGroupInfo,i=void 0===r?[]:r,o=n.totalEpCount,a=void 0===o?0:o,s=i.filter((function(e){return 1===e.mediagroupid})),u=a-1;s.length&&s[0].endpointCount&&t.push({calluri:"",mediagroupid:1,resolution:4,quality:2});for(var c=0;c<u;c++)t.push({calluri:"",mediagroupid:0,resolution:2,quality:1});this.logger.log("request list: ",t),this.client.sendCustomNewLayoutReqlist(t)}},{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.get(e)){var t=this.layoutList.get(e);this.layoutList.set(e,Object.assign(Object.assign({},t),{rotate:{transform:"rotateY(180deg)"}}))}}},{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=0;r<e;r++){var i=this.orderRosterList[r];if(!(r<t))break;var o=Vv,a=0,s=this.initLayout[r];s&&(o=(null==s?void 0:s.position)||Vv,a=(null==s?void 0:s.zIndex)||0),n.push({seat:r,roster:i,position:o,resolution:(null==s?void 0:s.resolution)||1,zIndex:a})}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,n=t.elementId,r=void 0===n?"":n,i=t.offset,o=void 0===i?[]:i,a=r&&document.getElementById(r),s=go(o,4),u=s[0],c=void 0===u?0:u,l=s[1],h=void 0===l?0:l,f=s[2],d=void 0===f?0:f,p=s[3],v=void 0===p?0:p,g=Number(c)+Number(h),m=Number(d)+Number(v),y=(null==a?void 0:a.clientHeight)||document.body.clientHeight,b=(null==a?void 0:a.clientWidth)||document.body.clientWidth,w=y-g,k=b-m,_=w>0?w:y,S=k>0?k:b,x=Math.floor(S*this.templateRate.next),E=Math.floor(_/this.templateRate.next),O={rateHeight:0,rateWidth:0,width:S,height:_};return O=_>x?{rateWidth:S,rateHeight:x,width:S,height:_}:{rateWidth:E,rateHeight:_,width:S,height:_},this.logger.log("client screen info: ",O),this.screenInfo=O,this.client.sendScreenInfoMessage(O),O}},{key:"requestCustomLayout",value:function(){if(this.client.getOnHold())this.client.sendCustomLayout();else{var e=this.requestLayoutCalculator();this.client.sendCustomLayout(e)}}},{key:"createLayout",value:function(){var e=this.client.getPeerConnectionStatus();if(this.initLayoutManager(),this.createBaseLayout(),this.updateStreams(!1),this.requestCustomLayout(),this.calculatePosition(),this.calculateRotate(),this.client.sendLayoutMessage(),this.logger.log("create layout: ",function(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}(this.layoutList)),this.logger.log("current template mode:",this.templateMode),this.client.sendTemplateMode(this.templateMode),this.client.sendChairmanRosterMessage(this.chairmanRoster),this.client.sendSelfRosterMessage(this.selfRoster),e){var t=this.content,n=t.previous,r=t.next;(!n&&r||n&&r&&n.participantId!==r.participantId||n&&!r)&&(this.content.previous=r,this.client.sendContentRosterMessage(r))}}},{key:"calculateOrderRosterList",value:function(){for(var e=this.client.getOriginRosters(),t=this.client.getInviteInfo().callerUri,n=this.client.getContentSenderPid(),r=this.client.getSpeakerInfo(),i=e.length,o={content:[],chairmain:[],activeSpeaker:[],audioVideoUnmute:[],audioUnmute:[],videoUnmute:[],audioVideoMute:[]},a=[],s=0;s<i;s++){var u=e[s],c=u.mediagroupid,l=u.endpointId;u.isActiveSpeaker=!1,u.isLocal=!1,u.id=l+c,u.endpointId!==t?"record"!==u.deviceType&&(u.isContent&&n>0&&u.participantId!==n||(u.isContent&&n>0&&u.participantId===n?(this.content=Object.assign(Object.assign({},this.content),{next:u}),o.content.push(u)):u.isForceFullScreen?(this.chairmanRoster=u,o.chairmain.push(u)):r.endpointId&&r.endpointId===u.endpointId?(u.isActiveSpeaker=!0,o.activeSpeaker.push(u)):u.audioTxMute||u.videoTxMute?u.audioTxMute||!u.videoTxMute?!u.audioTxMute||u.videoTxMute?u.audioTxMute&&u.videoTxMute&&o.audioVideoMute.push(u):o.videoUnmute.push(u):o.audioUnmute.push(u):o.audioVideoUnmute.push(u))):u.isContent||(this.selfRoster=Object.assign(Object.assign({},u),{isLocal:!0}))}for(var h in o)a=a.concat(o[h]);return this.setSelfRoster(a)}},{key:"switchLayout",value:function(e){var t=this.client.getContentSenderPid(),n=Fd;t&&(n=zd);var r=e;if(e)this.specifyTemplateMode=e;else{r=this.templateMode;var i=n.findIndex((function(e){return e===r})),o=i+1>=n.length?0:i+1;r=n[o]}return this.templateMode=r,this.createLayout(),this.logger.log("switch layout Mode: ",r),r}},{key:"setTemplateMode",value:function(e){this.templateMode=e}},{key:"setChairmanRoster",value:function(e){this.chairmanRoster=e}},{key:"setContentRosterItem",value:function(e){this.content={previous:e,next:e}}},{key:"setSelfRoster",value:function(e){var t=this.client.getLocalHide();return 0===e.length?(e.push(this.selfRoster),e):(t||e.splice(1,0,this.selfRoster),e||[])}}],[{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}}}]),e}(),Xv=function(e){uo(n,Jp);var t=vo(n);function n(e,r,i){var o,a,s,u,c,l;oo(this,n),(o=t.call(this)).onSetAudioStream=function(e){if(e){var t=o.stream.getMediaStreams().previewStreams;"mute"===e&&t.length&&o.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===e&&t.length&&o.stream.setAudioOrVideoStatus("unmuteAudio")}},o.getSelfRoster=function(){var e;return null===(e=o.layoutManager)||void 0===e?void 0:e.getSelfRoster()},o.logger=i;try{o.logger.initDB(),Sp.setLogger(o.logger)}catch(e){o.logger.error("init db error: ",e)}return o.config=e,o.autoMode="AUTO"===e.layout.toUpperCase(),o.debug=e.debug,o.localHide=e.localHide,o.hideId=e.__hideId,o.servers=r,o.loginInfo=Ud.LOGIN_INFO,o.disconnected=!1,o.clientStatus=!0,o.peerConnectionStatus=!1,o.isAutoBandwidth=!0,o.seq=0,o.token="",o.meetingControl={callIndex:-1,callUri:"",chairmanUri:"",disableMute:!1,muteOperation:"mute",role:"",type:""},o.speakerInfo={endpointId:"",pid:0},o.stream=null,o.rosters=[],o.videoTrackList=[],o.audioTrackList=[],o.layoutManager=new Zv(fo(o)),o.layoutRosters={content:[],people:[],total:[]},o.pushType="ALL",o.cacheMeetingControlMessage=null,o.rotationInfo={people:[],content:[],total:[]},o.customLayoutSeq=0,o.contentSenderPid=0,o.invite={callerUri:"",callIndex:0,automute:"",meetingId:""},o.shareContentTimmer=null,o.shareContentStatus="ENDED",o.streamChangeList={content:[],people:[]},o.autoSwitchDevice=!0,o.audioManagers={},o.limitResolution=[],o.errorcode=tu.get("xy-error-code"),o.onScreenChangeEvent=o.onScreenChangeEvent.bind(fo(o)),o.onDocumentChange=(a=o.onScreenChangeEvent,s=500,u=300,c=null,l=null,function(){var e=+new Date,t=this,n=arguments;clearTimeout(c),l||(l=e),e-l>=u?(a.apply(t,n),l=e):c=setTimeout((function(){a.apply(t,n)}),s)}),o.autoMode&&o.initEvent(),o.deviceManager=new Ev(o.logger),o.initDeviceManagerEvent(),o}return so(n,[{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:"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:"getLayoutList",value:function(){var e=this.config.layout;return"AUTO"===e?this.layoutManager.getLayoutList():"CUSTOM"===e?this.layoutManager.getCustomLayoutList():void 0}},{key:"getChairmanUri",value:function(){return this.meetingControl.chairmanUri}},{key:"toggleLocal",value:function(){var e=this;return new Promise((function(t,n){if(e.autoMode){e.localHide=!e.localHide,e.layoutManager.createLayout();var r=e.layoutManager.getOrderRosterList();e.emmit("roster",{rosters:r}),t({status:e.localHide})}else n(Mf(10300,"自定义布局模式不支持隐藏本地画面功能"))}))}},{key:"toggleHideId",value:function(){var e=this;return new Promise((function(t,n){e.hideId=e.hideId?"":"HIDE",e.sendSocketMessage({type:"UPDATE_HIDEID",hideId:e.hideId}),t(!!e.hideId)}))}},{key:"setVideoRenderer",value:function(e,t){this.layoutManager.setVideoRenderer(e,t)}},{key:"setAudioRenderer",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.audioManagers[e]||(this.audioManagers[e]={ele:t}),!(r=this.audioManagers[e])||!r.ele||r.ele.srcObject){n.next=17;break}if(i=this.audioTrackList.findIndex((function(t){return t.rest.streamId===e})),r.ele.autoPlay=!0,!(i>=0)){n.next=17;break}return r.ele.srcObject=this.audioTrackList[i].data.streams[0],n.prev=7,n.next=10,r.ele.play();case 10:o=this.stream.config.devices,this.stream&&o&&o.audioOutputValue&&"default"!==o.audioOutputValue&&this.deviceManager.setAudioOutputDevice(r.ele,o.audioOutputValue),n.next=17;break;case 14:n.prev=14,n.t0=n.catch(7),this.logger.warn("audio play error: ",n.t0);case 17:case"end":return n.stop()}}),n,this,[[7,14]])})))}},{key:"switchAutoDevice",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise((function(n,r){e.autoSwitchDevice=!!t,n(e.autoSwitchDevice)}))}},{key:"switchLayout",value:function(e){var t=this;return this.logger.log("switch layout input: ",e),new Promise((function(n,r){t.autoMode?(e=t.layoutManager.switchLayout(e),Sp.setStates("click","layout"),n(e)):r(Mf(10301,"自定义布局模式不支持切换布局"))}))}},{key:"handleSocketMessage",value:function(e,t){var n=this;if(!this.disconnected)switch(e.type){case"CALL_INDEX":var r=e.callIndex,i=e.callerUri,o=void 0===i?"":i;if(this.invite=Object.assign(Object.assign({},this.invite),{callIndex:r,callerUri:o}),this.logger.log("Get callIndex message: ",this.invite),"AUTO"===this.config.layout){var a=this.layoutManager.getScreenInfo();this.sendScreenInfoMessage(a)}break;case"CONNECTED":this.invite=Object.assign(Object.assign({},this.invite),e),this.logger.log("Get connected message: ",this.invite),setTimeout((function(){t(n.clientStatus&&!n.disconnected)}),100),this.config.muteAudio&&this.sendOperationMessage("AUDIO_MUTE"),this.config.muteVideo&&this.sendOperationMessage("VIDEO_MUTE"),Sp.setMeetingInfo({meetingId:this.invite.meetingId,callUri:this.invite.callerUri}),Sp.setStates("trigger","callIn",{callType:"initiativeJoin",appName:this.config.isThird?Vd:Hd});break;case"confMgmtReport":this.logger.log("Get meeting control confMgmtReport message: ",e);var s=this.deviceManager.getDevicePermission(),u=s.camera,c=s.microphone;if("denied"===u||"denied"===c)return;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.peer.restartIceConnection(),"STARTING"===this.shareContentStatus&&this.sendContentCapablityMessage(),this.videoTrackList=[],this.audioTrackList=[];break;case"DIS_CONNECTED":this.logger.log("Get disconnected message: ",e);var l=Xp[e.detail];e.code&&this.errorcode&&this.errorcode.zh_CN&&(l=this.errorcode.zh_CN[e.code]),l=l||"呼叫异常,请稍后重试",this.disconnected=!0,this.emmit("disconnected",Mf(10030,"Disconnected meeting",{message:l})),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 h=Xp[e.exception];e.code&&this.errorcode.zh_CN&&(h=this.errorcode.zh_CN[e.code]),h=h||"呼叫异常,请稍后重试",this.disconnected=!0,this.emmit("disconnected",Mf(10030,"call meeting exception",{message:h})),this.close("SERVER_INNER_ERROR");break;case"DualStreamReport":this.logger.log("Get share stream message: ",e);var f=e.state,d=function(){clearTimeout(n.shareContentTimmer),n.shareContentTimmer=null};if("SENDING"===f)this.shareContentStatus="STARTING",this.stream.emmit("start-share-content",{}),Sp.setStates("click","content",{contentType:"desk"}),d();else if("IDLE"===f){var p=Xp.SHARE_CONTENT_FAILED;"STATE:200"===e.code?this.stream.emmit("stop-share-content",{}):(e.code&&this.errorcode&&this.errorcode.zh_CN&&(p=this.errorcode.zh_CN[e.code]),this.stream.emmit("stop-share-content",Mf(20512,"share content failed",{message:p}))),this.shareContentStatus="ENDED",d()}break;case"MONITOR_STATE_REPORT":this.logger.log("Get monitor state report: ",e);var v=e.code,g=e.monitorInfo;if("STATE:200"===v)this.emmit("start-monitor-report",{monitorInfo:g});else{var m="";v&&this.errorcode&&this.errorcode.zh_CN&&(m=this.errorcode.zh_CN[v]),this.emmit("stop-monitor-report",Mf(30512,"start monitor failed",{message:m}))}break;default:this.logger.log("接收到其他ws消息",e)}}},{key:"makeCall",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("mackcall params: ",e),"[object Object]"===Object.prototype.toString.call(e)){t.next=3;break}return t.abrupt("return",Promise.reject(Mf(10400,"Parameter must be an Object")));case 3:if(n=e.token,r=e.confNumber,this.clientStatus){t.next=6;break}return t.abrupt("return",Promise.reject(Mf(10009,"Client is closed, it is forbidden to join the conference")));case 6:return t.next=8,this.deviceManager.emmitDevices();case 8:return t.prev=8,t.next=11,this.verifyMeeting(e);case 11:if(!(i=t.sent)||i.success){t.next=14;break}return t.abrupt("return",Promise.reject(i.data));case 14:t.next=19;break;case 16:return t.prev=16,t.t0=t.catch(8),t.abrupt("return",Promise.reject(Mf(10402,"呼叫失败")));case 19:return t.abrupt("return",new Promise((function(e,t){return n?r?void o.initWss(e,t):(o.logger.log("makeCall must be send confNumber params"),void o.emmit("error",Mf(10003,"MakeCall must be send confNumber params"))):(o.logger.log("makeCall must be send token params"),void o.emmit("error",Mf(10004,"MakeCall must be send token params")))})));case 20:case"end":return t.stop()}}),t,this,[[8,16]])})))}},{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=this.config,s=a.__hideId,u=void 0===s?"":s,c=a.__monitorMode,l=void 0===c?"":c;this.invite.callIndex||this.sendSocketMessage({type:"START_CALL",calleeNumber:t+"@CONFNO",displayName:r,pwd:o,callMode:"AUDIO_VIDEO",mediaAppend:{audioEncCapList:[99],videoEncCapList:[106,127]},hideId:u,monitorMode:l},!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:jd[e],callIndex:t},!1)}}},{key:"publish",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{isShareContent:!1,isShareFile:!1,isShareWhiteBoard:!1,isSharePeople:!1};if(this.clientStatus&&!this.disconnected){if(!t.isSharePeople)return t.isShareContent?(this.sendContentCapablityMessage(e),void this.peer.publish(e,"CONTENT")):void 0;try{this.stream=e,this.peer=new gv(this,e),e.setClientObj(this),this.peer.publish(e,"ALL"),"AUTO"===this.config.layout?this.rosters&&this.rosters.length>0&&this.layoutManager.createLayout():"CUSTOM"===this.config.layout&&this.layoutManager.initLayoutManager(),this.initTrackEvent()}catch(e){this.logger.error("publish error: ",e),this.clientErrorState="PUBLISH_ERROR",this.emmit("call-status",Mf(10517,"呼叫失败",e))}}}},{key:"sendContentCapablityMessage",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){return{streamId:e.stream.id,resolution:Ud.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 is null"),this.limitResolution=["720"],this.sendPeopleCapability()}},{key:"applyShareContent",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shareContentStatus="PENDING",this.sendSocketMessage({type:"START_CONTENT",mode:"VIDEO",enableAnnotation:!1}),this.shareContentTimmer=setTimeout((function(){"PENDING"===t.shareContentStatus&&(t.shareContentStatus="ENDED",t.stream.emmit("stop-share-content",{}),clearTimeout(t.shareContentTimmer),t.shareContentTimmer=null)}),1e4);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stopShareContent",value:function(){var e=this;return this.limitResolution=[],this.stream&&this.sendPeopleCapability(),new Promise((function(t,n){try{"STARTING"!==e.shareContentStatus&&"PENDING"!==e.shareContentStatus||e.sendSocketMessage({type:"STOP_CONTENT",mode:"VIDEO"}),e.peer&&e.peer.closeContentStream(),e.stream&&e.stream.closeContentStream(),e.shareContentStatus="ENDED",e.streamChangeList.content=[],t(!0)}catch(e){n(Mf(20517,"结束分享失败",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:"mergeTrackList",value:function(e){var t=e.track,n=t.kind,r=t.id,i={status:"remote",data:e,rest:{streamId:e.streams[0].id,track:t,trackId:r}};"video"===n?(this.videoTrackList.push(i),this.layoutManager.updateStreams(),this.emmit("video-track",this.videoTrackList)):"audio"===n&&(this.audioTrackList.push(i),this.emmit("audio-track",this.audioTrackList))}},{key:"destroy",value:function(){var e=this;return new Promise((function(t,n){try{e.stream&&e.stream.close(),e.close(),t(!0)}catch(e){n(Mf(10515,"Client destroy failed",e))}}))}},{key:"close",value:function(){var e=this,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"OK";this.clientStatus&&(this.clientStatus=!1,this.stopShareContent(),this.stopCall(t),this.peer&&this.peer.close(),this.removeEvent(),this.removeAllListener(),this.layoutManager.clearInvalidVideoManagers(),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(){e.logger.stopDB()}),100))}},{key:"loginXYlinkAccount",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o,a,s,u,c,l,h,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Sp.login({userName:e,password:t});case 3:if(!(r=n.sent)||200!==r.status){n.next=10;break}return i=r.data,o=i.securityKey,a=i.callUri,s=i.token,u=s.access_token,c=s.refresh_token,l=i.userProfile,h=l.displayName,f=l.id,this.loginInfo={securityKey:o,callUri:a,refresh_token:c,access_token:u,id:f,displayName:h},n.abrupt("return",Mf(200,"ok",{access_token:u}));case 10:if(!(r&&r.err&&r.err.response&&r.err.response.data&&2001===r.err.response.data.errorCode)){n.next=15;break}return this.logger.error("login err: ",r),n.abrupt("return",Mf(10104,"account or password error",r));case 15:return n.abrupt("return",Mf(10100,"login error",r));case 16:n.next=22;break;case 18:return n.prev=18,n.t0=n.catch(0),this.logger.error("login err: ",n.t0),n.abrupt("return",Mf(10100,"xyrtc login error",n.t0));case 22:case"end":return n.stop()}}),n,this,[[0,18]])})))}},{key:"getExternalLoginInfo",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o,a,s,u,c,l,h,f,d,p,v,g;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.displayName,i=t.extId,o=e.userName,a=e.password,r||i||a||o){n.next=4;break}return n.abrupt("return",Mf(10101,"参数有误,请检查",t));case 4:return n.prev=4,n.next=7,Sp.login(e);case 7:if(!(s=n.sent)||200!==s.status){n.next=14;break}return u=s.data,c=u.securityKey,l=u.callUri,h=u.token,f=h.access_token,d=h.refresh_token,p=u.userProfile,v=p.displayName,g=p.id,this.loginInfo={securityKey:c,callUri:l,refresh_token:d,access_token:f,id:g,displayName:v},n.abrupt("return",Mf(200,"ok",{access_token:f}));case 14:return n.abrupt("return",Mf(10100,"login failed",s));case 15:n.next=21;break;case 17:return n.prev=17,n.t0=n.catch(4),this.logger.error("external login err: ",n.t0),n.abrupt("return",Mf(10100,"xyrtc login error",n.t0));case 21:case"end":return n.stop()}}),n,this,[[4,17]])})))}},{key:"loginExternalAccount",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.displayName,r=e.extId,n||r){t.next=3;break}return t.abrupt("return",Mf(10101,"参数有误,请检查",e));case 3:return t.prev=3,t.next=6,Sp.getSdkUserInfo(e);case 6:if(i=t.sent,{userName:"",password:""},!i||200!==i.status){t.next=16;break}return a=i.data,s=a.userName,u=a.password,o={userName:s,password:u},t.next=13,this.getExternalLoginInfo(o,e);case 13:return t.abrupt("return",t.sent);case 16:return t.abrupt("return",Mf(10103,"Get user info failed",i));case 17:t.next=22;break;case 19:return t.prev=19,t.t0=t.catch(3),t.abrupt("return",Mf(10103,"Get user info failed",t.t0));case 22:case"end":return t.stop()}}),t,this,[[3,19]])})))}},{key:"getConference",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return ko(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,c,l,h;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return this.logger.log("get conference:",{id:r,sk:i,token:o}),s=i||(null===(e=this.loginInfo)||void 0===e?void 0:e.securityKey),u=r||(null===(t=this.loginInfo)||void 0===t?void 0:t.id),c=o||(null===(n=this.loginInfo)||void 0===n?void 0:n.access_token),l={securityKey:s,access_token:c,id:u},a.prev=5,Sp.setLoginInfo(l),a.next=9,Sp.getConference(u,s);case 9:if(200!==(null==(h=a.sent)?void 0:h.status)){a.next=14;break}return a.abrupt("return",h.data);case 14:return a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:{}}));case 15:a.next=20;break;case 17:return a.prev=17,a.t0=a.catch(5),a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:a.t0}));case 20:case"end":return a.stop()}}),a,this,[[5,17]])})))}},{key:"fetchErrorCode",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c,l,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=tu.get("xy-error-code"),r=n&&n.version,i=tu.get("xy-timestamp"),o=(new Date).valueOf(),f=Number(i),d=Number(o),p=void 0,p=d-f,a=Math.floor(p/864e5),!(n&&a<1)){t.next=7;break}return t.abrupt("return");case 7:return t.next=9,Sp.fetchErrorCode(e);case 9:if(!(s=t.sent)||200!==s.status||!s.data){t.next=24;break}if(u=s.data.errorcode,c=u.link,l=u.version,h=(new Date).valueOf(),l!==r){t.next=16;break}return t.abrupt("return");case 16:if(t.t0=c,!t.t0){t.next=21;break}return t.next=20,this.getErrorCodeByJson(c);case 20:t.t0=t.sent;case 21:this.errorcode=t.t0,tu.set("xy-error-code",this.errorcode),tu.set("xy-timestamp",h);case 24:case"end":return t.stop()}var f,d,p}),t,this)})))}},{key:"getErrorCodeByJson",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,Sp.getErrorCodeByJson(e);case 4:(r=t.sent)&&200===r.status&&r.data&&(n=r.data),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(1);case 10:return t.abrupt("return",n);case 11:case"end":return t.stop()}}),t,null,[[1,8]])})))}},{key:"videoAudioOperate",value:function(e){var t=this;return new Promise((function(n,r){return ko(t,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,c,l,h=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(i=Ld[e].type,o=this.stream.getMediaStreams(),a=o.previewStreams,s=this.stream.current.type,this.logger.log("video or audio operate: ",e),this.peer||(u="Need to create a peer to do audio and video operations",this.logger.log(u),r(Mf(10020,u))),a.length||(c="Need to create a stream to do audio and video operations",this.logger.log(c),r(Mf(10021,c))),"SEND_ONLY"!==s||"unmuteAudio"!==e&&"unmuteVideo"!==e){t.next=11;break}return l="Only receive streaming mode, does not support operating devices",this.logger.log(l),r(Mf(10022,l,this.stream.current.detail)),t.abrupt("return");case 11:return t.prev=11,t.next=14,this.stream.setAudioOrVideoStatus(e);case 14:"unmuteVideo"!==e?this.sendOperationMessage(i):"NORMAL"===s&&setTimeout((function(){h.sendOperationMessage(i),h.stream&&h.isAutoBandwidth&&h.streamChange&&h.stream.handleChangeStream(h.streamChange,h.peer,h.streamChange.mediagroupid||0)}),800),Sp.setStates("click",Wd[e]),n(e),t.next=22;break;case 19:t.prev=19,t.t0=t.catch(11),r(Mf(10023,"".concat(e," operate failed"),t.t0));case 22:case"end":return t.stop()}}),t,this,[[11,19]])})))}))}},{key:"muteAudio",value:function(){return this.videoAudioOperate("muteAudio")}},{key:"muteVideo",value:function(){return this.videoAudioOperate("muteVideo")}},{key:"unmuteAudio",value:function(){return this.videoAudioOperate("unmuteAudio")}},{key:"unmuteVideo",value:function(){return this.videoAudioOperate("unmuteVideo")}},{key:"onHandUp",value:function(){return this.onHand("handup",!0)}},{key:"onHandDown",value:function(){return this.onHand("handdown",!1)}},{key:"onMute",value:function(){return this.onHand("mute",!1)}},{key:"onHand",value:function(e,t){var n=this,r=this.invite,i=r.callerUri,o=void 0===i?"":i,a=r.meetingId,s=this.callInfo.confNumber;return new Promise((function(r,i){return ko(n,void 0,void 0,regeneratorRuntime.mark((function n(){var u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Sp.hand(e,a,o,s);case 3:200===(u=n.sent).status&&0===u.data.code?r(t):i(Mf(10500,"".concat(e," failed"),u)),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),i(Mf(10500,"".concat(e," failed"),n.t0));case 10:case"end":return n.stop()}}),n,null,[[0,7]])})))}))}},{key:"getSendSupportedCodec",value:function(){var e=this;return new Promise((function(t,n){var r=["video/VP8","video/H264"],i=["audio/opus"];try{i=RTCRtpSender.getCapabilities("audio").codecs.filter((function(e){return"audio/opus"===e.mimeType})).map((function(e){return e.mimeType})),t({video:r=(r=RTCRtpSender.getCapabilities("video").codecs.filter((function(e){return"video/H264"===e.mimeType||"video/VP8"===e.mimeType})).map((function(e){return e.mimeType}))).filter((function(e,t){return r.indexOf(e)===t})),audio:i})}catch(t){e.logger.error("get capabilities error: ",t),n(Mf(20519,"get capabilities error",t))}}))}},{key:"setPeerConnectionStatus",value:function(e){this.peerConnectionStatus=e;var t="SEND_ONLY"===this.stream.current.type;if((this.config.muteAudio||t)&&this.muteAudio(),(this.config.muteVideo||t)&&this.muteVideo(),e){if(this.invite.automute){var n="";this.onSetAudioStream(this.invite.automute),"mute"===this.invite.automute?n="muteAudio":"unmute"===this.invite.automute&&(n="unmuteAudio"),n&&this.emmit("audio-status",{status:n})}this.cacheMeetingControlMessage&&this.cacheMeetingControlMessage.type&&this.onMeetingControlMessage(this.cacheMeetingControlMessage);var r=this.layoutManager.getContentRosterItem();r&&(this.layoutManager.setContentRosterItem(r),this.emmit("content",{data:r})),this.stream.sendStreamStatus()}}},{key:"onMeetingControlMessage",value:function(e){var t=e.muteOperation,n=e.disableMute,r=e.chairmanUri,i=void 0===r?"":r,o=this.meetingControl&&this.meetingControl.chairmanUri||"",a="";if(this.peerConnectionStatus){if(t){var s=this.stream.getMediaStreams().previewStreams;a="mute"===t?"muteAudio":"unmuteAudio","mute"===t&&s.length&&this.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===t&&s.length&&this.stream.setAudioOrVideoStatus("unmuteAudio"),this.logger.log("emmit audio-status: ",a),this.emmit("audio-status",{status:a}),Sp.setStates("msgCallback",Wd[a]),this.cacheMeetingControlMessage=null}if(i||this.layoutManager.setChairmanRoster(null),"GALLERY"===this.layoutManager.getTemplateMode()){var u=this.layoutManager.getChairmanRoster();(!o&&i&&u||o&&!i)&&this.layoutManager.setTemplateMode(this.contentSenderPid?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER")}o!==i&&this.rosters.length>0&&this.autoMode&&this.layoutManager.createLayout();var c={chairmanUri:i,disableMute:n,muteOperation:a};this.logger.log("emmit meeting-control: ",c),this.emmit("meeting-control",c)}else this.cacheMeetingControlMessage=e;this.meetingControl=e}},{key:"onSubTitle",value:function(e){var t=e.content,n=t&&JSON.parse(t);this.emmit("sub-title",n),Sp.setStates("msgCallback","subtitle")}},{key:"onPassThroughMessage",value:function(e){switch(e.body.type){case"roster":this.logger.log("roster message: ",e);var t=e.body,n=t.contentSenderPid,r=void 0===n?0:n,i=t.rosterInfo;if(r&&!this.contentSenderPid&&this.layoutManager.setTemplateMode("MULTI_PIC_CONTENT_HIGH_PRIORITY"),!r&&this.contentSenderPid&&(this.layoutManager.setTemplateMode("SPEAKER"),this.layoutManager.setContentRosterItem(null)),this.contentSenderPid=r,this.rosters=i,0===this.rosters.length)return;this.autoMode?(this.layoutManager.createLayout(),this.sendOrderedRosterListMessage()):this.sendOrderRosterListMessage(),this.sendMeetingStatus();break;case"participantsNum":this.logger.log("particpant message: ",e);var o=e.body.participantsNum;this.emmit("participants-count",{participantsNum:o});break;case"speakersInfo":this.logger.log("speaker info message: ",e);var a=e.body.speaker;this.speakerInfo=a,this.autoMode&&(this.layoutManager.createLayout(),this.sendOrderedRosterListMessage()),this.emmit("speaker-info",{speakerInfo:a});break;case"layoutResult":var s=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=s:1===e.body.mediagroupid&&(this.layoutRosters.content=s),this.layoutRosters.total=[].concat(mo(this.layoutRosters.people),mo(this.layoutRosters.content)),this.logger.log("layout result message: ",this.layoutRosters.total),this.customLayoutSeq===e.body.rSeq&&this.layoutManager.updateStreams();break;case"streamChange":this.logger.log("stream change message: ",e),this.streamChange=e.body;var u=e.body,c=u.mediagroupid,l=u.streamChangeInfo;this.streamChangeList[0===c?"people":"content"]=l,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&&(this.layoutManager.calculateRotate(),this.sendLayoutMessage()),this.emmit("rotation-change",this.rotationInfo.total);break;case"candidate":this.peer.handleCandidate(e.body);break;case"answer":this.peer.handleAnswer(e.body);break;case"mediaOnhold":this.logger.log("media onhold message: ",e);var h=e.body.onhold;this.onhold=Boolean(h),this.emmit("onhold",this.onhold);break;case"confChangeInfo":if(this.logger.log("[receive]conf change info message: ",e),this.autoMode)return void console.log("自动布局模式不支持请流");var f=e.body,d=f.chairManUrl,p=f.totalEpCount,v=f.mediaGroupInfo,g=(void 0===v?[]:v).filter((function(e){return 1===e.mediagroupid})),m=0;g.length&&g[0].endpointCount&&(m=g[0].endpointCount);var y={contentPartCount:m,participantCount:p,chairManUrl:d};this.emmit("conf-change-info",y);break;case"layoutResultEx":if(this.logger.log("[receive][v2]layout result message: ",e),this.autoMode)return void console.log("自动布局模式不支持请流");var b=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=b:1===e.body.mediagroupid&&(this.layoutRosters.content=b),this.layoutRosters.total=[].concat(mo(this.layoutRosters.people),mo(this.layoutRosters.content)),this.logger.log("[v2]layout result: ",this.layoutRosters.total),"CUSTOM"===this.config.layout&&(this.layoutManager.createCustomLayout(this.layoutRosters.total),this.layoutManager.updateStreams());break;default:this.logger.log("get pass though default message: ",e)}}},{key:"switchAutoBandwidth",value:function(){var e=!this.isAutoBandwidth;return this.isAutoBandwidth=e,e}},{key:"disconnectInWssError",value:function(e){this.logger.log("disconnected wss error",e),!this.disconnected&&this.clientStatus&&(this.clientErrorState=2004===e?"WS_CLOSE":"WS_ERROR",this.emmit("disconnected",Mf(e,"[internel] disconnected meeting",{message:Xp.LOCAL_NET_DISCONNECT,key:"LOCAL_NET_DISCONNECT"})))}},{key:"switchDebug",value:function(e){var t=this;return new Promise((function(n,r){"boolean"!=typeof e&&r(Mf(10400,"Parameter must be boolean"));try{t.debug=e,t.peer&&t.peer.initSenderStatus(),n(t.debug)}catch(e){r(Mf(30500,"Switch debug error"))}}))}},{key:"requestLayout",value:function(e){var t=this;return new Promise((function(n,r){t.autoMode&&r("Auto mode not support request layout"),t.logger.log("request layout: ",e);var i=e.length>9?9:e.length;e.length=i,"CUSTOM"===t.config.layout&&(t.layoutManager.requestLayout(e),t.layoutManager.updateStreams(),n("successfully"))}))}},{key:"requestAutoPlllingLayout",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,u=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:u,endpointId:s,layoutMode:1,pageIndex:0,PollingCommand:e,pollingInterval:n,streams:r}}),i(!0)}))}},{key:"applyVideoOrAudio",value:function(e){this.peer.replacePeopleVideoTrack(this.stream,e)}},{key:"sendLayoutMessage",value:function(){var e=this.layoutManager.getLayoutList(),t=[];e.forEach((function(e){t.push(e)})),this.emmit("layout",vv(t))}},{key:"sendOrderedRosterListMessage",value:function(){var e=this.layoutManager.getOrderRosterList();this.emmit("roster",{rosters:e})}},{key:"sendOrderRosterListMessage",value:function(){var e=this.layoutManager.calculateOrderRosterList();this.layoutManager.setOrderRosterList(e),this.emmit("roster",{rosters:e})}},{key:"sendCustomLayoutMessage",value:function(){var e=this.layoutManager.getCustomLayoutList(),t=[];e.forEach((function(e){t.push(e)})),this.emmit("custom-layout",vv(t))}},{key:"sendScreenInfoMessage",value:function(e){this.emmit("screen-info",vv(e))}},{key:"sendContentRosterMessage",value:function(e){this.emmit("content",{data:e})}},{key:"sendChairmanRosterMessage",value:function(e){this.emmit("chairman",e)}},{key:"sendSelfRosterMessage",value:function(e){this.emmit("self-roster",e)}},{key:"sendTemplateMode",value:function(e){this.emmit("template-mode",e)}},{key:"sendOperationMessage",value:function(e){this.sendSocketMessage({type:e})}},{key:"sendMeetingStatus",value:function(){var e=this.layoutManager.getSelfRoster(),t={video:"unmuteVideo",audio:"unmuteAudio"};if(e&&e.endpointId){var n=e.videoTxMute,r=e.audioTxMute;t.video=n?"muteVideo":"unmuteVideo",t.audio=r?"muteAudio":"unmuteAudio",this.logger.log("emmit meeting-status: ",t),this.emmit("audio-status",{status:t.audio}),this.emmit("video-status",{status:t.video})}}},{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:"sendCustomNewLayoutReqlist",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];this.logger.log("send new layout requlist data: ",e);var t=this.invite,n=t.callerUri,r=void 0===n?"":n,i=t.meetingId;this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"customLayoutEx",conferenceId:i,endpointId:r,layoutMode:0,pageIndex:0,maxViewCountPerPage:9,streams:e}})}},{key:"sendInternels",value:function(e){var t=this.layoutManager.getInternelsLayout();Object.keys(e.receiver).forEach((function(n){var r=e.receiver[n],i=r.isContent,o=r.type+Number(i);t[o]&&(e.receiver[n].expResolution=t[o].resolution)}));for(var n=Object.keys(e.sender),r=n.length,i=0;i<r;i++){var o=e.sender[n[i]],a=this.streamChangeList.content.length,s=this.streamChangeList.people.length;if(s)for(var u=0;u<s;u++){var c=this.streamChangeList.people[u];if(Ud.RESOLUTION_MAP[c.resolution]===Number(o.resolution)&&"remoteStream"===o.type){e.sender[n[i]].expBandwidth=c.bandwidth;break}}if(a)for(var l=0;l<a;l++){var h=this.streamChangeList.content[l];if(Ud.RESOLUTION_MAP[h.resolution]===Number(o.resolution)&&"contentStream"===o.type){e.sender[n[i]].expBandwidth=h.bandwidth;break}}}this.emmit("meeting-stats",e)}},{key:"off",value:function(e){this.removeListener(e)}},{key:"onScreenChangeEvent",value:function(){this.autoMode&&(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,a=this.stream.streams.filter((function(t){return"NORMAL"===t.status&&t.resolution!==e.limitResolution[0]})).map((function(e){return{streamId:e.stream.id,resolution:Ud.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(e){var t=this;return new Promise((function(n,r){t.autoMode||r(Mf(10302,"自定义布局模式不支持此方法")),e&&"string"!=typeof e&&r(Mf(10400,"Parameter must be string"));try{var i=t.layoutManager.getForceFullScreenId();if(!e&&!i)return void n(e);var o=t.layoutManager.getSelfRoster();e!==o.id&&(t.layoutManager.setForceFullScreenId(e),e?(t.layoutManager.requestCustomLayout(),t.layoutRosters={content:[],people:[],total:[]}):t.layoutManager.createLayout()),n(e)}catch(e){r(Mf(10530,"Force full screen request stream faild"))}}))}},{key:"sendSocketMessage",value:function(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1],n=this.invite,r=n.callIndex,i=n.callerUri,o=void 0===i?"":i,a=n.meetingId,s={callIndex:r,meetingId:a,endpointId:o},u=this.seq+"",c=t?Object.assign(Object.assign(Object.assign({},e),s),{seq:u}):e;this.socketTask&&this.socketTask.send(c),this.seq++}},{key:"verifyMeeting",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,i,o,a,s,u,c,l,h,f,d,p;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.token,i=e.confNumber,o=e.password,a=void 0===o?"":o,this.callInfo=e,this.token=r,s={success:!1,data:{}},t.prev=4,u=r||this.loginInfo.access_token,t.next=8,Sp.getUserInfo(u);case 8:return c=t.sent,l=(c||{}).securityKey,this.fetchErrorCode(l),t.next=13,Sp.getCallUri({number:i,securityKey:l,deviceType:17,country:"CN"});case 13:if(!(h=t.sent)||"CONFERENCE"!==h.numberType){t.next=38;break}if(!h.enablePwd||"HIDE"!==this.config.__hideId){t.next=28;break}return t.prev=16,t.next=19,Sp.igonreMeetingMonito(i,l);case 19:f=t.sent,s=f&&200===f.status?n.getMeetingStatus(!0):n.getMeetingStatus(!1,10406,"免密入会失败"),t.next=26;break;case 23:t.prev=23,t.t0=t.catch(16),s=n.getMeetingStatus(!1,10406,"免密入会失败");case 26:t.next=36;break;case 28:if(!h.enablePwd||!a){t.next=35;break}return t.next=31,Sp.verifyPassword(i,a,l);case 31:d=t.sent,s=200!==d.status&&204!==d.status?n.getMeetingStatus(!1,10404,"入会密码错误"):n.getMeetingStatus(!0),t.next=36;break;case 35:s=h.enablePwd&&!a?n.getMeetingStatus(!1,10403,"需要入会密码"):n.getMeetingStatus(!0);case 36:t.next=39;break;case 38:h&&h.numberType?s=n.getMeetingStatus(!1,10405,"暂不支持呼叫此号码"):h&&h.errorCode?(p=h.errorCode,s=1001===p||2036===p?n.getMeetingStatus(!1,10401,"无效的会议号"):n.getMeetingStatus(!1,10402,"呼叫失败")):s=n.getMeetingStatus(!1,10402,"呼叫失败");case 39:t.next=44;break;case 41:t.prev=41,t.t1=t.catch(4),s=n.getMeetingStatus(!1,10402,"呼叫失败");case 44:return t.abrupt("return",s);case 45:case"end":return t.stop()}}),t,this,[[4,41],[16,23]])})))}},{key:"setAudioOutputDevice",value:function(e){var t=this;Object.keys(this.audioManagers).forEach((function(n){var r=t.audioManagers[n];r.ele&&t.deviceManager.setAudioOutputDevice(r.ele,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.sendSocketMessage({type:"STOP_MONITOR",uriList:e})}},{key:"initDeviceManagerEvent",value:function(){var e=this;this.deviceManager.on("permission",(function(t){var n;e.logger.log("deviceManager permission changed: ",t),"denied"!==t.camera&&"denied"!==t.microphone||null===(n=e.stream)||void 0===n||n.setAudioOrVideoStatus("muteAudio"),e.emmit("permission",t)})),this.deviceManager.on("currentDevice",(function(t){e.emmit("currentDevice",t)})),this.deviceManager.on("device",(function(t){var n=t.nextDevice,r=n.audioInput,i=n.videoInput,o=n.audioOutput;try{e.autoSwitchDevice&&(r&&e.stream&&(console.log("switch audio device:",r),e.stream.switchDevice("audio",r.deviceId)),i&&e.stream&&(console.log("switch video device:",r),e.stream.switchDevice("video",i.deviceId)),o&&e.setAudioOutputDevice(o.deviceId)),e.emmit("device",t)}catch(t){e.logger.log("auto switch device faild:",t)}}))}},{key:"initWss",value:function(e,t){var n=this;this.socketTask&&this.socketTask.close(),this.socketTask=new Qp({url:"".concat(this.servers.wssServer,"/websocket/webrtc"),params:{token:this.token,start:!0}},this),this.socketTask.on("open",(function(e){n.logger.log("websocket is conneted"),n.logger.log("user system info: ",navigator.userAgent),n.logger.log("Version: ",dp),n.startCall(),n.emmit("socket-open",e)})),this.socketTask.on("message",(function(t){var r=t.data;if(r){var i=JSON.parse(r);n.handleSocketMessage(i,e),n.emmit("socket-message",i)}})),this.socketTask.on("close",(function(){n.logger.log("连接已关闭"),n.disconnectInWssError(2004),n.emmit("socket-close",Mf(2004,"Websocket connect is close")),n.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("timeout",(function(){n.logger.log("websocket connect timeout"),n.emmit("socket-timeout",Mf(2002,"Websocket connect is timeout"))})),this.socketTask.on("error",(function(e){n.logger.log("Websocket connect is error",e),n.disconnectInWssError(2005),n.emmit("socket-error",Mf(2005,"Websocket connect is error",e)),n.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("reconnect",(function(e){n.logger.log("Websocket reconnect: ","Websocket connected is close, reconect..."),n.emmit("socket-reconnect",Mf(2003,"Websocket connected is close, reconect...",e))}))}}],[{key:"getClientInstance",value:function(e,t,r){return this.instance||(this.instance=new n(e,t,r)),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}}},{key:"getMeetingStatus",value:function(e,t,n){return t?{success:e,data:{code:t,msg:n}}:{success:e,data:{}}}}]),n}(),Jv=ct.some,$v=je("some"),Qv=He("some");Le({target:"Array",proto:!0,forced:!$v||!Qv},{some:function(e){return Jv(this,e,arguments.length>1?arguments[1]:void 0)}});var eg="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,tg=function(e){if(void 0===e)return 0;var t=ue(e),n=le(t);if(t!==n)throw RangeError("Wrong length or index");return n},ng=Math.abs,rg=Math.pow,ig=Math.floor,og=Math.log,ag=Math.LN2,sg=function(e,t,n){var r,i,o,a=new Array(n),s=8*n-t-1,u=(1<<s)-1,c=u>>1,l=23===t?rg(2,-24)-rg(2,-77):0,h=e<0||0===e&&1/e<0?1:0,f=0;for((e=ng(e))!=e||e===1/0?(i=e!=e?1:0,r=u):(r=ig(og(e)/ag),e*(o=rg(2,-r))<1&&(r--,o*=2),(e+=r+c>=1?l/o:l*rg(2,1-c))*o>=2&&(r++,o/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(e*o-1)*rg(2,t),r+=c):(i=e*rg(2,c-1)*rg(2,t),r=0));t>=8;a[f++]=255&i,i/=256,t-=8);for(r=r<<t|i,s+=t;s>0;a[f++]=255&r,r/=256,s-=8);return a[--f]|=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,u=r-1,c=e[u--],l=127&c;for(c>>=7;s>0;l=256*l+e[u],u--,s-=8);for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;n=256*n+e[u],u--,s-=8);if(0===l)l=1-a;else{if(l===o)return n?NaN:c?-1/0:1/0;n+=rg(2,t),l-=a}return(c?-1:1)*n*rg(2,l-t)},cg=function(e){for(var t=Me(this),n=le(t.length),r=arguments.length,i=de(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:de(o,n);a>i;)t[i++]=e;return t},lg=we.f,hg=R.f,fg=te.get,dg=te.set,pg=a.ArrayBuffer,vg=pg,gg=a.DataView,mg=gg&&gg.prototype,yg=Object.prototype,bg=a.RangeError,wg=sg,kg=ug,_g=function(e){return[255&e]},Sg=function(e){return[255&e,e>>8&255]},xg=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},Eg=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},Og=function(e){return wg(e,23,4)},Cg=function(e){return wg(e,52,8)},Ag=function(e,t){hg(e.prototype,t,{get:function(){return fg(this)[t]}})},Ig=function(e,t,n,r){var i=tg(n),o=fg(e);if(i+t>o.byteLength)throw bg("Wrong index");var a=fg(o.buffer).bytes,s=i+o.byteOffset,u=a.slice(s,s+t);return r?u:u.reverse()},Tg=function(e,t,n,r,i,o){var a=tg(n),s=fg(e);if(a+t>s.byteLength)throw bg("Wrong index");for(var u=fg(s.buffer).bytes,c=a+s.byteOffset,l=r(+i),h=0;h<t;h++)u[c+h]=l[o?h:t-h-1]};if(eg){if(!s((function(){pg(1)}))||!s((function(){new pg(-1)}))||s((function(){return new pg,new pg(1.5),new pg(NaN),"ArrayBuffer"!=pg.name}))){for(var Rg,Lg=(vg=function(e){return br(this,vg),new pg(tg(e))}).prototype=pg.prototype,Ng=lg(pg),Mg=0;Ng.length>Mg;)(Rg=Ng[Mg++])in vg||L(vg,Rg,pg[Rg]);Lg.constructor=vg}Jn&&Hn(mg)!==yg&&Jn(mg,yg);var Pg=new gg(new vg(2)),Bg=mg.setInt8;Pg.setInt8(0,2147483648),Pg.setInt8(1,2147483649),!Pg.getInt8(0)&&Pg.getInt8(1)||gr(mg,{setInt8:function(e,t){Bg.call(this,e,t<<24>>24)},setUint8:function(e,t){Bg.call(this,e,t<<24>>24)}},{unsafe:!0})}else vg=function(e){br(this,vg,"ArrayBuffer");var t=tg(e);dg(this,{bytes:cg.call(new Array(t),0),byteLength:t}),u||(this.byteLength=t)},gg=function(e,t,n){br(this,gg,"DataView"),br(e,vg,"DataView");var r=fg(e).byteLength,i=ue(t);if(i<0||i>r)throw bg("Wrong offset");if(i+(n=void 0===n?r-i:le(n))>r)throw bg("Wrong length");dg(this,{buffer:e,byteLength:n,byteOffset:i}),u||(this.buffer=e,this.byteLength=n,this.byteOffset=i)},u&&(Ag(vg,"byteLength"),Ag(gg,"buffer"),Ag(gg,"byteLength"),Ag(gg,"byteOffset")),gr(gg.prototype,{getInt8:function(e){return Ig(this,1,e)[0]<<24>>24},getUint8:function(e){return Ig(this,1,e)[0]},getInt16:function(e){var t=Ig(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=Ig(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return Eg(Ig(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return Eg(Ig(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return kg(Ig(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return kg(Ig(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){Tg(this,1,e,_g,t)},setUint8:function(e,t){Tg(this,1,e,_g,t)},setInt16:function(e,t){Tg(this,2,e,Sg,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){Tg(this,2,e,Sg,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){Tg(this,4,e,xg,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){Tg(this,4,e,xg,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){Tg(this,4,e,Og,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){Tg(this,8,e,Cg,t,arguments.length>2?arguments[2]:void 0)}});Yn(vg,"ArrayBuffer"),Yn(gg,"DataView");var Dg={ArrayBuffer:vg,DataView:gg},jg=Dg.ArrayBuffer,Ug=Dg.DataView,Fg=jg.prototype.slice,zg=s((function(){return!new jg(2).slice(1,void 0).byteLength}));Le({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:zg},{slice:function(e,t){if(void 0!==Fg&&void 0===t)return Fg.call(I(this),e);for(var n=I(this).byteLength,r=de(e,n),i=de(void 0===t?n:t,n),o=new(Br(this,jg))(le(i-r)),a=new Ug(this),s=new Ug(o),u=0;r<i;)s.setUint8(u++,a.getUint8(r++));return o}});var Hg,Vg=R.f,Wg=a.Int8Array,Kg=Wg&&Wg.prototype,qg=a.Uint8ClampedArray,Gg=qg&&qg.prototype,Yg=Wg&&Hn(Wg),Zg=Kg&&Hn(Kg),Xg=Object.prototype,Jg=Xg.isPrototypeOf,$g=it("toStringTag"),Qg=K("TYPED_ARRAY_TAG"),em=eg&&!!Jn&&"Opera"!==dr(a.opera),tm=!1,nm={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},rm=function(e){return b(e)&&_(nm,dr(e))};for(Hg in nm)a[Hg]||(em=!1);if((!em||"function"!=typeof Yg||Yg===Function.prototype)&&(Yg=function(){throw TypeError("Incorrect invocation")},em))for(Hg in nm)a[Hg]&&Jn(a[Hg],Yg);if((!em||!Zg||Zg===Xg)&&(Zg=Yg.prototype,em))for(Hg in nm)a[Hg]&&Jn(a[Hg].prototype,Zg);if(em&&Hn(Gg)!==Zg&&Jn(Gg,Zg),u&&!_(Zg,$g))for(Hg in tm=!0,Vg(Zg,$g,{get:function(){return b(this)?this[Qg]:void 0}}),nm)a[Hg]&&L(a[Hg],Qg,Hg);var im={NATIVE_ARRAY_BUFFER_VIEWS:em,TYPED_ARRAY_TAG:tm&&Qg,aTypedArray:function(e){if(rm(e))return e;throw TypeError("Target is not a typed array")},aTypedArrayConstructor:function(e){if(Jn){if(Jg.call(Yg,e))return e}else for(var t in nm)if(_(nm,Hg)){var n=a[t];if(n&&(e===n||Jg.call(n,e)))return e}throw TypeError("Target is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(u){if(n)for(var r in nm){var i=a[r];i&&_(i.prototype,e)&&delete i.prototype[e]}Zg[e]&&!n||ne(Zg,e,n?t:em&&Kg[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(u){if(Jn){if(n)for(r in nm)(i=a[r])&&_(i,e)&&delete i[e];if(Yg[e]&&!n)return;try{return ne(Yg,e,n?t:em&&Wg[e]||t)}catch(e){}}for(r in nm)!(i=a[r])||i[e]&&!n||ne(i,e,t)}},isView:function(e){var t=dr(e);return"DataView"===t||_(nm,t)},isTypedArray:rm,TypedArray:Yg,TypedArrayPrototype:Zg},om=im.NATIVE_ARRAY_BUFFER_VIEWS,am=a.ArrayBuffer,sm=a.Int8Array,um=!om||!s((function(){sm(1)}))||!s((function(){new sm(-1)}))||!Mr((function(e){new sm,new sm(null),new sm(1.5),new sm(e)}),!0)||s((function(){return 1!==new sm(new am(2),1,void 0).length})),cm=function(e,t){var n=function(e){var t=ue(e);if(t<0)throw RangeError("The argument can't be less than 0");return t}(e);if(n%t)throw RangeError("Wrong offset");return n},lm=im.aTypedArrayConstructor,hm=function(e){var t,n,r,i,o,a,s=Me(e),u=arguments.length,c=u>1?arguments[1]:void 0,l=void 0!==c,h=xr(s);if(null!=h&&!_r(h))for(a=(o=h.call(s)).next,s=[];!(i=a.call(o)).done;)s.push(i.value);for(l&&u>2&&(c=Je(c,arguments[2],2)),n=le(s.length),r=new(lm(this))(n),t=0;n>t;t++)r[t]=l?c(s[t],t):s[t];return r};i((function(e){var t=we.f,n=ct.forEach,r=te.get,i=te.set,o=R.f,s=A.f,c=Math.round,l=a.RangeError,h=Dg.ArrayBuffer,d=Dg.DataView,p=im.NATIVE_ARRAY_BUFFER_VIEWS,v=im.TYPED_ARRAY_TAG,g=im.TypedArray,m=im.TypedArrayPrototype,y=im.aTypedArrayConstructor,k=im.isTypedArray,S=function(e,t){for(var n=0,r=t.length,i=new(y(e))(r);r>n;)i[n]=t[n++];return i},x=function(e,t){o(e,t,{get:function(){return r(this)[t]}})},E=function(e){var t;return e instanceof h||"ArrayBuffer"==(t=dr(e))||"SharedArrayBuffer"==t},O=function(e,t){return k(e)&&"symbol"!=typeof t&&t in e&&String(+t)==String(t)},C=function(e,t){return O(e,t=w(t,!0))?f(2,e[t]):s(e,t)},I=function(e,t,n){return!(O(e,t=w(t,!0))&&b(n)&&_(n,"value"))||_(n,"get")||_(n,"set")||n.configurable||_(n,"writable")&&!n.writable||_(n,"enumerable")&&!n.enumerable?o(e,t,n):(e[t]=n.value,e)};u?(p||(A.f=C,R.f=I,x(m,"buffer"),x(m,"byteOffset"),x(m,"byteLength"),x(m,"length")),Le({target:"Object",stat:!0,forced:!p},{getOwnPropertyDescriptor:C,defineProperty:I}),e.exports=function(e,s,u){var f=e.match(/\d+$/)[0]/8,y=e+(u?"Clamped":"")+"Array",w="get"+e,_="set"+e,x=a[y],O=x,C=O&&O.prototype,A={},I=function(e,t){o(e,t,{get:function(){return function(e,t){var n=r(e);return n.view[w](t*f+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=r(e);u&&(n=(n=c(n))<0?0:n>255?255:255&n),i.view[_](t*f+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};p?um&&(O=s((function(e,t,n,r){return br(e,O,y),Pp(b(t)?E(t)?void 0!==r?new x(t,cm(n,f),r):void 0!==n?new x(t,cm(n,f)):new x(t):k(t)?S(O,t):hm.call(O,t):new x(tg(t)),e,O)})),Jn&&Jn(O,g),n(t(x),(function(e){e in O||L(O,e,x[e])})),O.prototype=C):(O=s((function(e,t,n,r){br(e,O,y);var o,a,s,u=0,c=0;if(b(t)){if(!E(t))return k(t)?S(O,t):hm.call(O,t);o=t,c=cm(n,f);var p=t.byteLength;if(void 0===r){if(p%f)throw l("Wrong length");if((a=p-c)<0)throw l("Wrong length")}else if((a=le(r)*f)+c>p)throw l("Wrong length");s=a/f}else s=tg(t),o=new h(a=s*f);for(i(e,{buffer:o,byteOffset:c,byteLength:a,length:s,view:new d(o)});u<s;)I(e,u++)})),Jn&&Jn(O,g),C=O.prototype=Rn(m)),C.constructor!==O&&L(C,"constructor",O),v&&L(C,v,y),A[y]=O,Le({global:!0,forced:O!=x,sham:!p},A),"BYTES_PER_ELEMENT"in O||L(O,"BYTES_PER_ELEMENT",f),"BYTES_PER_ELEMENT"in C||L(C,"BYTES_PER_ELEMENT",f),yr(y)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var fm=Math.min,dm=[].copyWithin||function(e,t){var n=Me(this),r=le(n.length),i=de(e,r),o=de(t,r),a=arguments.length>2?arguments[2]:void 0,s=fm((void 0===a?r:de(a,r))-o,r-i),u=1;for(o<i&&i<o+s&&(u=-1,o+=s-1,i+=s-1);s-- >0;)o in n?n[i]=n[o]:delete n[i],i+=u,o+=u;return n},pm=im.aTypedArray;(0,im.exportTypedArrayMethod)("copyWithin",(function(e,t){return dm.call(pm(this),e,t,arguments.length>2?arguments[2]:void 0)}));var vm=ct.every,gm=im.aTypedArray;(0,im.exportTypedArrayMethod)("every",(function(e){return vm(gm(this),e,arguments.length>1?arguments[1]:void 0)}));var mm=im.aTypedArray;(0,im.exportTypedArrayMethod)("fill",(function(e){return cg.apply(mm(this),arguments)}));var ym=ct.filter,bm=im.aTypedArray,wm=im.aTypedArrayConstructor;(0,im.exportTypedArrayMethod)("filter",(function(e){for(var t=ym(bm(this),e,arguments.length>1?arguments[1]:void 0),n=Br(this,this.constructor),r=0,i=t.length,o=new(wm(n))(i);i>r;)o[r]=t[r++];return o}));var km=ct.find,_m=im.aTypedArray;(0,im.exportTypedArrayMethod)("find",(function(e){return km(_m(this),e,arguments.length>1?arguments[1]:void 0)}));var Sm=ct.findIndex,xm=im.aTypedArray;(0,im.exportTypedArrayMethod)("findIndex",(function(e){return Sm(xm(this),e,arguments.length>1?arguments[1]:void 0)}));var Em=ct.forEach,Om=im.aTypedArray;(0,im.exportTypedArrayMethod)("forEach",(function(e){Em(Om(this),e,arguments.length>1?arguments[1]:void 0)}));var Cm=ve.includes,Am=im.aTypedArray;(0,im.exportTypedArrayMethod)("includes",(function(e){return Cm(Am(this),e,arguments.length>1?arguments[1]:void 0)}));var Im=ve.indexOf,Tm=im.aTypedArray;(0,im.exportTypedArrayMethod)("indexOf",(function(e){return Im(Tm(this),e,arguments.length>1?arguments[1]:void 0)}));var Rm=it("iterator"),Lm=a.Uint8Array,Nm=or.values,Mm=or.keys,Pm=or.entries,Bm=im.aTypedArray,Dm=im.exportTypedArrayMethod,jm=Lm&&Lm.prototype[Rm],Um=!!jm&&("values"==jm.name||null==jm.name),Fm=function(){return Nm.call(Bm(this))};Dm("entries",(function(){return Pm.call(Bm(this))})),Dm("keys",(function(){return Mm.call(Bm(this))})),Dm("values",Fm,!Um),Dm(Rm,Fm,!Um);var zm=im.aTypedArray,Hm=[].join;(0,im.exportTypedArrayMethod)("join",(function(e){return Hm.apply(zm(this),arguments)}));var Vm=Math.min,Wm=[].lastIndexOf,Km=!!Wm&&1/[1].lastIndexOf(1,-0)<0,qm=je("lastIndexOf"),Gm=He("indexOf",{ACCESSORS:!0,1:0}),Ym=Km||!qm||!Gm?function(e){if(Km)return Wm.apply(this,arguments)||0;var t=y(this),n=le(t.length),r=n-1;for(arguments.length>1&&(r=Vm(r,ue(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:Wm,Zm=im.aTypedArray;(0,im.exportTypedArrayMethod)("lastIndexOf",(function(e){return Ym.apply(Zm(this),arguments)}));var Xm=ct.map,Jm=im.aTypedArray,$m=im.aTypedArrayConstructor;(0,im.exportTypedArrayMethod)("map",(function(e){return Xm(Jm(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new($m(Br(e,e.constructor)))(t)}))}));var Qm=function(e){return function(t,n,r,i){Xe(n);var o=Me(t),a=g(o),s=le(o.length),u=e?s-1:0,c=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw TypeError("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in a&&(i=n(i,a[u],u,o));return i}},ey={left:Qm(!1),right:Qm(!0)},ty=ey.left,ny=im.aTypedArray;(0,im.exportTypedArrayMethod)("reduce",(function(e){return ty(ny(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var ry=ey.right,iy=im.aTypedArray;(0,im.exportTypedArrayMethod)("reduceRight",(function(e){return ry(iy(this),e,arguments.length,arguments.length>1?arguments[1]:void 0)}));var oy=im.aTypedArray,ay=im.exportTypedArrayMethod,sy=Math.floor;ay("reverse",(function(){for(var e,t=oy(this).length,n=sy(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this}));var uy=im.aTypedArray;(0,im.exportTypedArrayMethod)("set",(function(e){uy(this);var t=cm(arguments.length>1?arguments[1]:void 0,1),n=this.length,r=Me(e),i=le(r.length),o=0;if(i+t>n)throw RangeError("Wrong length");for(;o<i;)this[t+o]=r[o++]}),s((function(){new Int8Array(1).set({})})));var cy=im.aTypedArray,ly=im.aTypedArrayConstructor,hy=[].slice;(0,im.exportTypedArrayMethod)("slice",(function(e,t){for(var n=hy.call(cy(this),e,t),r=Br(this,this.constructor),i=0,o=n.length,a=new(ly(r))(o);o>i;)a[i]=n[i++];return a}),s((function(){new Int8Array(1).slice()})));var fy=ct.some,dy=im.aTypedArray;(0,im.exportTypedArrayMethod)("some",(function(e){return fy(dy(this),e,arguments.length>1?arguments[1]:void 0)}));var py=im.aTypedArray,vy=[].sort;(0,im.exportTypedArrayMethod)("sort",(function(e){return vy.call(py(this),e)}));var gy=im.aTypedArray;(0,im.exportTypedArrayMethod)("subarray",(function(e,t){var n=gy(this),r=n.length,i=de(e,r);return new(Br(n,n.constructor))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,le((void 0===t?r:de(t,r))-i))}));var my=a.Int8Array,yy=im.aTypedArray,by=im.exportTypedArrayMethod,wy=[].toLocaleString,ky=[].slice,_y=!!my&&s((function(){wy.call(new my(1))}));by("toLocaleString",(function(){return wy.apply(_y?ky.call(yy(this)):yy(this),arguments)}),s((function(){return[1,2].toLocaleString()!=new my([1,2]).toLocaleString()}))||!s((function(){my.prototype.toLocaleString.call([1,2])})));var Sy=im.exportTypedArrayMethod,xy=a.Uint8Array,Ey=xy&&xy.prototype||{},Oy=[].toString,Cy=[].join;s((function(){Oy.call({})}))&&(Oy=function(){return Cy.call(this)});var Ay=Ey.toString!=Oy;Sy("toString",Oy,Ay);var Iy=function(){function e(t){oo(this,e),this.level=0,this.stream=t}return so(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=100*Number((this.level/128).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}(),Ty=function(e){uo(n,Jp);var t=vo(n);function n(e){var r,i=e.logger;return oo(this,n),(r=t.call(this)).streams=[],r.pipelineStreams=[],r.contentStreams=[],r.previewStreams=[],r.logger=i,r.isShareContent=!1,r.client=null,r.streamStatus=!0,r.config={devices:{}},r.current={type:"FAILED",detail:""},r.audioDeviceId="",r.videoDeviceId="",r}return so(n,[{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(e,t,n){return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l,h,f,d,p,v,g;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=e.streamChangeInfo,o=0===n?this.streams:this.contentStreams,a=0===n?Bd:Pd,s=o.length,u=0;case 5:if(!(u<s)){r.next=45;break}if("NORMAL"!==o[u].status){r.next=42;break}c=o[u].stream,l=o[u].stream.getVideoTracks(),h=l.length,f=this.getIndexFromStreamChange(c,i),d=0;case 12:if(!(d<h)){r.next=42;break}if(p=l[d],-1===f){r.next=29;break}if(v=i[f],g=v.bandwidth>=100?v.bandwidth:100,!p){r.next=27;break}return r.prev=18,r.next=21,p.applyConstraints(a[o[u].resolution].max);case 21:return r.next=23,t.setBandWidth(p.id,g,!0);case 23:r.next=27;break;case 25:r.prev=25,r.t0=r.catch(18);case 27:r.next=39;break;case 29:if(!p){r.next=39;break}return r.prev=30,r.next=33,p.applyConstraints(a[o[u].resolution].min);case 33:return r.next=35,t.setBandWidth(p.id,5,!0);case 35:r.next=39;break;case 37:r.prev=37,r.t1=r.catch(30);case 39:d++,r.next=12;break;case 42:u++,r.next=5;break;case 45:case"end":return r.stop()}}),r,this,[[18,25],[30,37]])})))}},{key:"setAudioOutput",value:function(e){var t=this;if(this.logger.log("set audio output device: ".concat(e)),"string"!=typeof e){var n="Parameter must be a string";return this.logger.log(n),Promise.reject(Mf(10400,n))}return new Promise((function(n,r){try{t.client.setAudioOutputDevice(e),n({deviceId:e})}catch(e){r(Mf(20407,"set audioOutput error",e))}}))}},{key:"switchDevice",value:function(e,t){return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o,a,s,u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(this.logger.log("switch device: type: ".concat(e,", deviceId: ").concat(t)),r=["audio","video"],"string"==typeof e&&r.includes(e)){n.next=6;break}return i="Must receive audio or video string in type parameter",this.logger.log(i),n.abrupt("return",Promise.reject(Mf(10400,i)));case 6:if("string"==typeof t){n.next=10;break}return o="Must receive string in deviceId parameter",this.logger.log(o),n.abrupt("return",Promise.reject(Mf(10400,o)));case 10:if(a=this.client.getSelfRoster(),s=a.videoTxMute,u=a.audioTxMute,n.prev=12,"audio"!==e||!t){n.next=18;break}if(this.audioDeviceId=t,u){n.next=18;break}return n.next=18,this.replaceAudioTrack();case 18:if("video"!==e||!t){n.next=23;break}if(this.videoDeviceId=t,s){n.next=23;break}return n.next=23,this.replaceVideoTrack();case 23:return this.client.deviceManager.setCurrentUsedDeviceByType(e,t),n.abrupt("return",!0);case 27:return n.prev=27,n.t0=n.catch(12),n.abrupt("return",Promise.reject(Mf(20522,"Switch ".concat(e," device failed"),n.t0)));case 30:case"end":return n.stop()}}),n,this,[[12,27]])})))}},{key:"sendStreamStatus",value:function(){this.emmit("stream-status",this.current)}},{key:"replaceAudioTrack",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return this.streams.every((function(e){"180"===e.resolution&&e.stream.getAudioTracks().forEach((function(t){t.stop(),e.stream.removeTrack(t)}))})),e.prev=1,e.next=4,this.createNextAudioTracks();case 4:e.next=9;break;case 6:return e.prev=6,e.t0=e.catch(1),e.abrupt("return",Promise.reject(e.t0));case 9:this.client.applyVideoOrAudio("audio"),this.audioLevel=null;case 11:case"end":return e.stop()}}),e,this,[[1,6]])})))}},{key:"replaceVideoTrack",value:function(){var e;return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!(n=(null===(e=this.previewStreams[0])||void 0===e?void 0:e.stream)||null)||!(null==n?void 0:n.getVideoTracks()[0])){t.next=15;break}return t.prev=2,t.next=5,this.createNextVideoTracks();case 5:this.removePreviousVideoTracks("muteVideo"),this.client.applyVideoOrAudio("video"),this.client.sendPeopleCapability(),t.next=13;break;case 10:return t.prev=10,t.t0=t.catch(2),t.abrupt("return",Promise.reject(t.t0));case 13:t.next=16;break;case 15:return t.abrupt("return",Promise.reject(Mf(30409,"当前无媒体流")));case 16:case"end":return t.stop()}}),t,this,[[2,10]])})))}},{key:"setAudioOrVideoStatus",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if("NORMAL"===this.current.type){t.next=2;break}return t.abrupt("return");case 2:if("muteAudio"!==e&&"unmuteAudio"!==e||this.setStreamStatus(e),"muteVideo"===e&&setTimeout((function(){n.setStreamStatus(e)}),250),"unmuteVideo"!==e){t.next=13;break}return t.prev=5,t.next=8,this.replaceVideoTrack();case 8:t.next=13;break;case 10:return t.prev=10,t.t0=t.catch(5),t.abrupt("return",Promise.reject(t.t0));case 13:case"end":return t.stop()}}),t,this,[[5,10]])})))}},{key:"setStreamStatus",value:function(e){var t=this;this.previewStreams.forEach((function(n){t.setStreamTracksStatus(n.stream,e)})),this.streams.forEach((function(n){t.setStreamTracksStatus(n.stream,e)}))}},{key:"getNextAudioContraints",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId,t=n.getContraints(!1,!0),r={};return e&&(r={deviceId:{exact:e}}),Object.assign(t.audio,r),this.logger.log("create next audio track contrants:",t),t}},{key:"getNextAudioMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.getNextAudioContraints(e),t.prev=1,t.next=4,this.getUserMedia(n);case 4:r=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next audio track error:",t.t0),t.prev=10,n=this.getNextAudioContraints(""),t.next=14,this.getUserMedia(n);case 14:r=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextAudioTracks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,this.getNextAudioMedia(e);case 4:n=t.sent,t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(1),r=this.handleCreateStreamError(t.t0),t.abrupt("return",Promise.reject(r));case 11:i=n.getAudioTracks()[0],this.streams.some((function(e){if("180"===e.resolution)return e.stream.addTrack(i),!0}));case 13:case"end":return t.stop()}}),t,this,[[1,7]])})))}},{key:"getNextVideoContraints",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId,t=n.getContraints(!0,!1),r={};return e&&(r={deviceId:{exact:e}}),Object.assign(t.video,r),this.logger.log("create next video track contrants:",t),t}},{key:"getNextVideoMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.getNextVideoContraints(e),t.prev=1,t.next=4,this.getUserMedia(n);case 4:r=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next video track error:",t.t0),t.prev=10,n=this.getNextVideoContraints(""),t.next=14,this.getUserMedia(n);case 14:r=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextVideoTracks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,this.getNextVideoMedia(e);case 4:n=t.sent,t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(1),r=this.handleCreateStreamError(t.t0),t.abrupt("return",Promise.reject(r));case 11:i=n.getVideoTracks()[0],o=[i.clone(),i.clone(),i.clone()],this.previewStreams[0].stream.addTrack(i),a=wo(this.streams.entries()),t.prev=15,u=regeneratorRuntime.mark((function e(){var t,n,r,i;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=go(s.value,2),n=t[0],r=t[1],e.prev=1,i=Bd[r.resolution].max,e.next=5,o[n].applyConstraints(i);case 5:r.stream.addTrack(o[n]),c.streams[n].status="NORMAL",e.next=14;break;case 9:e.prev=9,e.t0=e.catch(1),c.logger.error("new video track apply constraints error: ",e.t0),c.streams[n].status="INVALID",c.streams[n].stream.getTracks().forEach((function(e){e.stop(),c.logger.log("disabled track",o[n].id)}));case 14:case"end":return e.stop()}}),e,null,[[1,9]])})),a.s();case 18:if((s=a.n()).done){t.next=22;break}return t.delegateYield(u(),"t1",20);case 20:t.next=18;break;case 22:t.next=27;break;case 24:t.prev=24,t.t2=t.catch(15),a.e(t.t2);case 27:return t.prev=27,a.f(),t.finish(27);case 30:case"end":return t.stop()}}),t,this,[[1,7],[15,24,27,30]])})))}},{key:"removePreviousVideoTracks",value:function(e){var t=Ld[e].status,n=this.previewStreams[0].stream.getVideoTracks()[0];n&&(this.previewStreams[0].stream.removeTrack(n),!t&&n.stop()),this.streams.forEach((function(e){var n=e.stream.getVideoTracks()[0];n&&(e.stream.removeTrack(n),!t&&n.stop())}))}},{key:"setStreamTracksStatus",value:function(e,t){e.getTracks().forEach((function(e){("audio"!==e.kind||"muteAudio"!==t&&"unmuteAudio"!==t||(e.enabled=Ld[t].status),"video"===e.kind&&"muteVideo"===t)&&(Ld[t].status||e.stop())}))}},{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.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){"NORMAL"===e.status&&e.stream.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 e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{devices:{}};return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("stream init config:",e),this.streamStatus){t.next=3;break}return t.abrupt("return",Promise.reject(Mf(30524,"Stream status is invalid")));case 3:return this.config=e,n=(null==e?void 0:e.devices)||{audioInputValue:"",videoInValue:""},r=n.audioInputValue,i=void 0===r?"":r,o=n.videoInValue,a=void 0===o?"":o,s=this.getInitContraints(i,a),this.logger.log("init contraints:",s),t.prev=7,t.next=10,this.getUserMedia(s);case 10:return u=t.sent,this.logger.log("base remote stream: ",u),t.next=14,this.initStreams(u);case 14:return this.streamStatus||this.close(),this.current={type:"NORMAL",detail:"successfully"},this.emmit("local-stream",this.previewStreams),t.abrupt("return",Mf(30525,"Init stream successfully",this.previewStreams));case 20:if(t.prev=20,t.t0=t.catch(7),c=this.handleCreateStreamError(t.t0),l=c.code,!Rd.includes(l)){t.next=32;break}return this.current={type:"SEND_ONLY",detail:c},t.next=28,this.initStreams(null);case 28:return this.logger.log("Init domstream successfully",{status:c,err:t.t0}),t.abrupt("return",Mf(30526,"Init domstream successfully",this.current));case 32:return this.logger.warn("Init stream failed",{status:c,err:t.t0}),this.current={type:"FAILED",detail:c},t.abrupt("return",Promise.reject(Mf(30527,"Init stream failed",Object.assign({status:c},this.current))));case 35:case"end":return t.stop()}}),t,this,[[7,20]])})))}},{key:"getInitContraints",value:function(e,t){var r=n.getContraints();if(e&&"default"!==e){var i={deviceId:{exact:e}};this.audioDeviceId=e,Object.assign(r.audio,i)}if(t){var o={deviceId:{exact:t}};this.videoDeviceId=t,Object.assign(r.video,o)}return this.logger.log("init remote constraints: ",r),r}},{key:"initStreams",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPreviewStream(e);case 2:return this.initPipelineStreams(),t.next=5,this.initRemoteStreams(e);case 5:case"end":return t.stop()}}),t,this)})))}},{key:"initPipelineStreams",value:function(){var e=0;this.pipelineStreams=[1,2,3,4,5,6].map((function(){return e++,{stream:null,domStream:[{kind:"video"},{kind:"audio"}],status:"DOMSTRING",type:"pipelineStream",resolution:"90"}})),this.logger.log("temp stream count:",e)}},{key:"initRemoteStreams",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=25;break}n=e.clone(),r=e.clone(),n.getAudioTracks()[0].stop(),r.getAudioTracks()[0].stop(),i={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},i),{stream:e}),Object.assign(Object.assign({},i),{stream:n,resolution:"360"}),Object.assign(Object.assign({},i),{stream:r,resolution:"720"})],o=wo(this.streams.entries()),t.prev=8,s=regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=go(a.value,2),n=t[0],r=t[1],i=r.stream.getVideoTracks()[0],e.prev=2,o=Bd[r.resolution].max,e.next=6,i.applyConstraints(o);case 6:c.logger.log("init remote track constranits:",o,r.stream.id),e.next=14;break;case 9:e.prev=9,e.t0=e.catch(2),c.logger.error("init remote track constranits failed:",e.t0,r.stream.id),c.streams[n].status="INVALID",c.streams[n].stream.getTracks().forEach((function(e){e.stop(),c.logger.log("disabled track",i.id)}));case 14:case"end":return e.stop()}}),e,null,[[2,9]])})),o.s();case 11:if((a=o.n()).done){t.next=15;break}return t.delegateYield(s(),"t0",13);case 13:t.next=11;break;case 15:t.next=20;break;case 17:t.prev=17,t.t1=t.catch(8),o.e(t.t1);case 20:return t.prev=20,o.f(),t.finish(20);case 23:t.next=28;break;case 25:u={stream:null,domStream:[{kind:"video"},{kind:"audio"}],status:"DOMSTRING",type:"remoteStream",resolution:"90"},this.streams=[Object.assign(Object.assign({},u),{resolution:"180"}),Object.assign(Object.assign({},u),{resolution:"360"}),Object.assign(Object.assign({},u),{resolution:"720"})],this.logger.log("None remote stream, init dom stream: ",this.streams);case 28:case"end":return t.stop()}}),t,this,[[8,17,20,23]])})))}},{key:"initPreviewStream",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!e){t.next=15;break}return t.prev=1,n={stream:e.clone(),domStream:[],status:"NORMAL",type:"previewStream",resolution:"360"},t.next=5,n.stream.getVideoTracks()[0].applyConstraints(Bd[360].max);case 5:n.stream.getAudioTracks().forEach((function(e){e.stop()})),this.logger.log("init local stream succeffully"),this.previewStreams=[n],t.next=13;break;case 10:t.prev=10,t.t0=t.catch(1),this.logger.error("init local constraints failed: ",t.t0);case 13:t.next=17;break;case 15:r={stream:null,domStream:[{kind:"video"}],status:"DOMSTRING",type:"previewStream",resolution:"360"},this.previewStreams=[r];case 17:case"end":return t.stop()}}),t,this,[[1,10]])})))}},{key:"setClientObj",value:function(e){this.client=e,this.updateDeviceByLocalStream()}},{key:"updateDeviceByLocalStream",value:function(){var e,t;if("NORMAL"===this.current.type){var n=this.previewStreams[0].stream.getAudioTracks()[0],r=this.previewStreams[0].stream.getVideoTracks()[0],i=n.getSettings(),o=r.getSettings(),a={audioInput:{deviceId:i.deviceId,groupId:i.groupId,label:n.label},videoInput:{deviceId:o.deviceId,groupId:o.groupId,label:r.label},audioOutput:{deviceId:(null===(t=null===(e=this.config)||void 0===e?void 0:e.devices)||void 0===t?void 0:t.audioOutputValue)||"default",groupId:"",label:""}};this.logger.log("Cache preview stream device info by tracks: ",a),this.client.deviceManager.setCurrentUsedDevice(a)}}},{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 Iy(i),t.audioLevel.init(),n(t.audioLevel.getAudioLevel());else if(t.audioLevel){n(t.audioLevel.getAudioLevel())}else if(t.client){var o="GetAudio level must need have local stream!";t.client.logger.warn(o),r(Mf(20530,o))}}))}},{key:"clearAudioLevel",value:function(){this.audioLevel=null}},{key:"closeContentStream",value:function(){var e=this;if(this.isShareContent){this.streamStatus=!1;this.off("start-share-content"),this.off("stop-share-content"),this.contentStreams.forEach((function(t,n){t.stream.getTracks().forEach((function(t){t.stop(),t.onended=null,e.contentStreams[n].stream.removeTrack(t)})),e.contentStreams[n].status="INVALID"})),this.isShareContent=!1,this.logger.log("content stream closed successfully")}}},{key:"createContentStream",value:function(){return ko(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.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(Mf(20508,"已经在分享屏幕")));case 3:return this.createBaseContentStreams(),e.prev=4,t={video:Pd[1080].max,audio:!1},e.next=8,navigator.mediaDevices.getDisplayMedia(t);case 8:return n=e.sent,e.next=11,this.dealCaptureStream(n);case 11:return e.abrupt("return",this.contentStreams);case 14:return e.prev=14,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 19:case"end":return e.stop()}}),e,this,[[4,14]])})))}},{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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["window","screen"];return ko(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.getSources({types:t});case 3:return r=n.sent,n.abrupt("return",r);case 7:return n.prev=7,n.t0=n.catch(0),n.abrupt("return",n.t0);case 10:case"end":return n.stop()}}),n,null,[[0,7]])})))}},{key:"createElectronContentStream",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isShareContent){t.next=3;break}return this.logger.warn("Already share content!"),t.abrupt("return",Promise.reject(Mf(20508,"已经在分享屏幕")));case 3:if(e){t.next=6;break}return this.logger.warn("No selected sourceId!"),t.abrupt("return",Promise.reject(Mf(20509,"没有selectedSourceId")));case 6:return this.createBaseContentStreams(),t.prev=7,t.next=10,this.electronCapture(e);case 10:return n=t.sent,t.next=13,this.dealCaptureStream(n);case 13:return t.abrupt("return",this.contentStreams);case 16:return t.prev=16,t.t0=t.catch(7),this.logger.error("capture electron content stream failed: ",t.t0),this.isShareContent=!1,t.abrupt("return",this.handleCreateContentStreamError(t.t0));case 21:case"end":return t.stop()}}),t,this,[[7,16]])})))}},{key:"getPreviewStream",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]:{video:{},audio:{}};return ko(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,i=n.video,o=void 0===i?{}:i,a=n.audio,s=void 0===a?{}:a,u={},e&&(u.video=Object.assign({},Nd,o)),t&&(u.audio=Object.assign({},s)),this.logger.log("get preview stream constraints:",u),r.next=8,this.getUserMedia(u);case 8:return c=r.sent,r.abrupt("return",c);case 12:return r.prev=12,r.t0=r.catch(0),l=this.handleCreateStreamError(r.t0),r.abrupt("return",Promise.reject(l));case 16:case"end":return r.stop()}}),r,this,[[0,12]])})))}},{key:"getUserMedia",value:function(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,navigator.mediaDevices.getUserMedia(e);case 3:return t.abrupt("return",t.sent);case 6:return t.prev=6,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 9:case"end":return t.stop()}}),t,null,[[0,6]])})))}},{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(e){return ko(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getVideoTracks()[0],r=n.clone(),i=Pd[720].max,t.prev=3,t.next=6,r.applyConstraints(i);case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(3),this.streams[1].status="INVALID",this.logger.error("set 720p content stream conts error: ",t.t0);case 12:this.handleCloseShareContentEvent(n,r),this.updateContentStreamTrack(n,r),this.client&&this.client.applyShareContent(),this.logger.log("create share content stream: ",this.contentStreams);case 16:case"end":return t.stop()}}),t,this,[[3,8]])})))}},{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){this.contentStreams=this.contentStreams.map((function(n){return"1080"===n.resolution?n.stream.addTrack(e):n.stream.addTrack(t),Object.assign(Object.assign({},n),{isSupport:!0})}))}},{key:"handleCreateContentStreamError",value:function(e){var t=e.name,n=e.message;return"NotAllowedError"===t?"Permission denied by system"===n?Mf(20507,"用户已拒绝授权采集屏幕操作",e):"Permission denied"===n?Mf(20500,"用户取消采集屏幕操作",e):Mf(20510,"用户已拒绝授权或取消采集屏幕操作",e):"InvalidStateError"===t?Mf(20501,"操作异常采集屏幕失败",e):"AbortError"===t?Mf(20502,"采集屏幕失败",e):"NotFoundError"===t?Mf(20503,"没有屏幕视频源可用于捕获",e):"NotReadableError"===t?Mf(20504,"硬件或操作系统错误或锁定,阻止了采集屏幕共享",e):"OverconstrainedError"===t?Mf(20505,"采集屏幕-约束设置失败",e):"TypeError"===t?Mf(20506,"采集屏幕-指定了不允许的约束设置",e):Mf(20502,"采集屏幕失败",e)}},{key:"handleCreateStreamError",value:function(e){var t={code:0,msg:"",detail:""};return t="NotFoundError"==e.name||"DevicesNotFoundError"==e.name?Mf(20400,"缺失摄像头或麦克风设备",e):"NotReadableError"==e.name||"TrackStartError"==e.name?Mf(20401,"摄像头或麦克风设备无法访问",e):"OverconstrainedError"==e.name||"ConstraintNotSatisfiedError"==e.name?Mf(20402,"约束设置无法被满足",e):"NotAllowedError"==e.name||"PermissionDeniedError"==e.name||e.message.includes("NotAllowedError")?Mf(20403,"麦克风或摄像头使用权限被拒绝",e):"TypeError"==e.name||"TypeError"==e.name?Mf(20404,"采集流约束设置为空",e):Mf(20405,"创建媒体流失败",e),this.logger.error(t),t}}],[{key:"getStreamInstance",value:function(e){return this.instance||(this.instance=new n(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],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getSupportConstraints(),o={},a={},s={audio:o,video:a},u=r.channelCount,c=void 0===u?1:u,l=r.autoGainControl,h=void 0===l||l,f=r.noiseSuppression,d=void 0===f||f,p=r.echoCancellation,v=void 0===p||p,g=r.frameRate,m=void 0===g?Nd.frameRate:g,y=r.aspectRatio,b=void 0===y?Nd.aspectRatio:y,w=r.resizeMode,k=void 0===w?Nd.resizeMode:w,_=r.width,S=void 0===_?1280:_,x=r.height,E=void 0===x?720:x,O={channelCount:c,autoGainControl:h,noiseSuppression:d,echoCancellation:v},C={frameRate:m,aspectRatio:b,resizeMode:k,width:S,height:E};return Object.keys(O).forEach((function(e){o[e]=O[e]})),Object.keys(C).forEach((function(e){i[e]&&(a[e]=C[e])})),s.audio=!!t&&o,s.video=!!e&&a,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}}]),n}(),Ry={version:dp,checkSupportWebRTC:function(){var e=yn.isSupportRTC(),t=yn.isSupportWebsocket(),n=yn.isMinBrowser(),r=e&&t&&n;return Ry.logger.debug("support result: ",{isSupportRTC:e,isSupportWebsocket:t,isMinBrowser:n}),r},checkSupportShareContent:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)},logger:new xp,createClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ry.logger,n=pp,r=vp,i=gp,o={wssServer:n,httpServer:r,logServer:i,layout:"AUTO",debug:!1,muteAudio:!1,muteVideo:!1,localHide:!1,localMirror:!0,isThird:!0},a=e.container||{},s=Object.assign(Object.assign(Object.assign({},o),e),{container:a}),u=s.wssServer,c=s.httpServer,l=s.logServer,h=s.clientId,f=void 0===h?"":h;return Sp.setBaseUrl(c,l),Sp.setClientId(f),new Xv(s,{wssServer:u,httpServer:c,logServer:l},t)},createStream:function(){var e=Ry.logger;return new Ty({logger:e})},setConfig:function(e){Sp.setLoginInfo(e),Sp.setClientId(e.client_id)},closePreviewStream:function(e){return ko(void 0,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e&&e.getTracks().forEach((function(e){e.enabled=!1,e.stop()}));case 1:case"end":return t.stop()}}),t)})))},setOutputAudioDevice:function(e,t){e&&void 0!==e.sinkId?e.setSinkId(t).then((function(){})).catch((function(e){var t=e;"SecurityError"===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.info("%c******************************************************************","color: #3876ff;"),console.info("%c* 欢迎使用 XY Web SDK - 小鱼易连Web云视频会议","color: #3876ff;"),console.info("%c* 版本:"+dp,"color: #3876ff;"),console.info("%c* 文档临时地址:https://www.yuque.com/jinghui/xylink","color: #3876ff;"),console.info("%c* 体验地址:https://cdn.xylink.com/webrtc/web/index.html","color: #3876ff;"),console.info("%c* 问题反馈:https://github.com/xylink-com/xylink-rtc-demo/issues","color: #3876ff;"),console.info("%c******************************************************************","color: #3876ff;"),console.info("%c[INFO] XY Web Agent: "+navigator.userAgent+"\n","color: #3876ff;"))};window.xyRTC=Ry,exports.DeviceManager=Ev,exports.default=Ry,exports.getLayoutItemState=Fv,exports.getLayoutRotateInfo=Hv,exports.getVideoInfoByRotaion=zv;
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0});var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function t(){throw new Error("Dynamic requires are not currently supported by rollup-plugin-commonjs")}function n(e,t){return e(t={exports:{}},t.exports),t.exports}var r,i,o=function(e){return e&&e.Math==Math&&e},a=o("object"==typeof globalThis&&globalThis)||o("object"==typeof window&&window)||o("object"==typeof self&&self)||o("object"==typeof e&&e)||function(){return this}()||Function("return this")(),s=function(e){try{return!!e()}catch(e){return!0}},u=!s((function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})),c=Function.prototype.call,l=c.bind?c.bind(c):function(){return c.apply(c,arguments)},h={}.propertyIsEnumerable,d=Object.getOwnPropertyDescriptor,f={f:d&&!h.call({1:2},1)?function(e){var t=d(this,e);return!!t&&t.enumerable}:h},p=function(e,t){return{enumerable:!(1&e),configurable:!(2&e),writable:!(4&e),value:t}},v=Function.prototype,g=v.bind,m=v.call,y=g&&g.bind(m),b=g?function(e){return e&&y(m,e)}:function(e){return e&&function(){return m.apply(e,arguments)}},w=b({}.toString),k=b("".slice),_=function(e){return k(w(e),8,-1)},S=a.Object,x=b("".split),E=s((function(){return!S("z").propertyIsEnumerable(0)}))?function(e){return"String"==_(e)?x(e,""):S(e)}:S,I=a.TypeError,O=function(e){if(null==e)throw I("Can't call method on "+e);return e},C=function(e){return E(O(e))},A=function(e){return"function"==typeof e},T=function(e){return"object"==typeof e?null!==e:A(e)},R=function(e){return A(e)?e:void 0},L=function(e,t){return arguments.length<2?R(a[e]):a[e]&&a[e][t]},N=b({}.isPrototypeOf),M=L("navigator","userAgent")||"",P=a.process,D=a.Deno,j=P&&P.versions||D&&D.version,B=j&&j.v8;B&&(i=(r=B.split("."))[0]>0&&r[0]<4?1:+(r[0]+r[1])),!i&&M&&(!(r=M.match(/Edge\/(\d+)/))||r[1]>=74)&&(r=M.match(/Chrome\/(\d+)/))&&(i=+r[1]);var U=i,F=!!Object.getOwnPropertySymbols&&!s((function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&U&&U<41})),z=F&&!Symbol.sham&&"symbol"==typeof Symbol.iterator,H=a.Object,V=z?function(e){return"symbol"==typeof e}:function(e){var t=L("Symbol");return A(t)&&N(t.prototype,H(e))},W=a.String,K=function(e){try{return W(e)}catch(e){return"Object"}},q=a.TypeError,G=function(e){if(A(e))return e;throw q(K(e)+" is not a function")},Y=function(e,t){var n=e[t];return null==n?void 0:G(n)},Z=a.TypeError,J=Object.defineProperty,X=function(e,t){try{J(a,e,{value:t,configurable:!0,writable:!0})}catch(n){a[e]=t}return t},$=a["__core-js_shared__"]||X("__core-js_shared__",{}),Q=n((function(e){(e.exports=function(e,t){return $[e]||($[e]=void 0!==t?t:{})})("versions",[]).push({version:"3.19.2",mode:"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"})})),ee=a.Object,te=function(e){return ee(O(e))},ne=b({}.hasOwnProperty),re=Object.hasOwn||function(e,t){return ne(te(e),t)},ie=0,oe=Math.random(),ae=b(1..toString),se=function(e){return"Symbol("+(void 0===e?"":e)+")_"+ae(++ie+oe,36)},ue=Q("wks"),ce=a.Symbol,le=ce&&ce.for,he=z?ce:ce&&ce.withoutSetter||se,de=function(e){if(!re(ue,e)||!F&&"string"!=typeof ue[e]){var t="Symbol."+e;F&&re(ce,e)?ue[e]=ce[e]:ue[e]=z&&le?le(t):he(t)}return ue[e]},fe=a.TypeError,pe=de("toPrimitive"),ve=function(e,t){if(!T(e)||V(e))return e;var n,r=Y(e,pe);if(r){if(void 0===t&&(t="default"),n=l(r,e,t),!T(n)||V(n))return n;throw fe("Can't convert object to primitive value")}return void 0===t&&(t="number"),function(e,t){var n,r;if("string"===t&&A(n=e.toString)&&!T(r=l(n,e)))return r;if(A(n=e.valueOf)&&!T(r=l(n,e)))return r;if("string"!==t&&A(n=e.toString)&&!T(r=l(n,e)))return r;throw Z("Can't convert object to primitive value")}(e,t)},ge=function(e){var t=ve(e,"string");return V(t)?t:t+""},me=a.document,ye=T(me)&&T(me.createElement),be=function(e){return ye?me.createElement(e):{}},we=!u&&!s((function(){return 7!=Object.defineProperty(be("div"),"a",{get:function(){return 7}}).a})),ke=Object.getOwnPropertyDescriptor,_e={f:u?ke:function(e,t){if(e=C(e),t=ge(t),we)try{return ke(e,t)}catch(e){}if(re(e,t))return p(!l(f.f,e,t),e[t])}},Se=a.String,xe=a.TypeError,Ee=function(e){if(T(e))return e;throw xe(Se(e)+" is not an object")},Ie=a.TypeError,Oe=Object.defineProperty,Ce={f:u?Oe:function(e,t,n){if(Ee(e),t=ge(t),Ee(n),we)try{return Oe(e,t,n)}catch(e){}if("get"in n||"set"in n)throw Ie("Accessors not supported");return"value"in n&&(e[t]=n.value),e}},Ae=u?function(e,t,n){return Ce.f(e,t,p(1,n))}:function(e,t,n){return e[t]=n,e},Te=b(Function.toString);A($.inspectSource)||($.inspectSource=function(e){return Te(e)});var Re,Le,Ne,Me=$.inspectSource,Pe=a.WeakMap,De=A(Pe)&&/native code/.test(Me(Pe)),je=Q("keys"),Be=function(e){return je[e]||(je[e]=se(e))},Ue={},Fe=a.TypeError,ze=a.WeakMap;if(De||$.state){var He=$.state||($.state=new ze),Ve=b(He.get),We=b(He.has),Ke=b(He.set);Re=function(e,t){if(We(He,e))throw new Fe("Object already initialized");return t.facade=e,Ke(He,e,t),t},Le=function(e){return Ve(He,e)||{}},Ne=function(e){return We(He,e)}}else{var qe=Be("state");Ue[qe]=!0,Re=function(e,t){if(re(e,qe))throw new Fe("Object already initialized");return t.facade=e,Ae(e,qe,t),t},Le=function(e){return re(e,qe)?e[qe]:{}},Ne=function(e){return re(e,qe)}}var Ge={set:Re,get:Le,has:Ne,enforce:function(e){return Ne(e)?Le(e):Re(e,{})},getterFor:function(e){return function(t){var n;if(!T(t)||(n=Le(t)).type!==e)throw Fe("Incompatible receiver, "+e+" required");return n}}},Ye=Function.prototype,Ze=u&&Object.getOwnPropertyDescriptor,Je=re(Ye,"name"),Xe={EXISTS:Je,PROPER:Je&&"something"===function(){}.name,CONFIGURABLE:Je&&(!u||u&&Ze(Ye,"name").configurable)},$e=n((function(e){var t=Xe.CONFIGURABLE,n=Ge.get,r=Ge.enforce,i=String(String).split("String");(e.exports=function(e,n,o,s){var u,c=!!s&&!!s.unsafe,l=!!s&&!!s.enumerable,h=!!s&&!!s.noTargetGet,d=s&&void 0!==s.name?s.name:n;A(o)&&("Symbol("===String(d).slice(0,7)&&(d="["+String(d).replace(/^Symbol\(([^)]*)\)/,"$1")+"]"),(!re(o,"name")||t&&o.name!==d)&&Ae(o,"name",d),(u=r(o)).source||(u.source=i.join("string"==typeof d?d:""))),e!==a?(c?!h&&e[n]&&(l=!0):delete e[n],l?e[n]=o:Ae(e,n,o)):l?e[n]=o:X(n,o)})(Function.prototype,"toString",(function(){return A(this)&&n(this).source||Me(this)}))})),Qe=Math.ceil,et=Math.floor,tt=function(e){var t=+e;return t!=t||0===t?0:(t>0?et:Qe)(t)},nt=Math.max,rt=Math.min,it=function(e,t){var n=tt(e);return n<0?nt(n+t,0):rt(n,t)},ot=Math.min,at=function(e){return e>0?ot(tt(e),9007199254740991):0},st=function(e){return at(e.length)},ut=function(e){return function(t,n,r){var i,o=C(t),a=st(o),s=it(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}},ct={includes:ut(!0),indexOf:ut(!1)},lt=ct.indexOf,ht=b([].push),dt=function(e,t){var n,r=C(e),i=0,o=[];for(n in r)!re(Ue,n)&&re(r,n)&&ht(o,n);for(;t.length>i;)re(r,n=t[i++])&&(~lt(o,n)||ht(o,n));return o},ft=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"],pt=ft.concat("length","prototype"),vt={f:Object.getOwnPropertyNames||function(e){return dt(e,pt)}},gt={f:Object.getOwnPropertySymbols},mt=b([].concat),yt=L("Reflect","ownKeys")||function(e){var t=vt.f(Ee(e)),n=gt.f;return n?mt(t,n(e)):t},bt=function(e,t){for(var n=yt(t),r=Ce.f,i=_e.f,o=0;o<n.length;o++){var a=n[o];re(e,a)||r(e,a,i(t,a))}},wt=/#|\.prototype\./,kt=function(e,t){var n=St[_t(e)];return n==Et||n!=xt&&(A(t)?s(t):!!t)},_t=kt.normalize=function(e){return String(e).replace(wt,".").toLowerCase()},St=kt.data={},xt=kt.NATIVE="N",Et=kt.POLYFILL="P",It=kt,Ot=_e.f,Ct=function(e,t){var n,r,i,o,s,u=e.target,c=e.global,l=e.stat;if(n=c?a:l?a[u]||X(u,{}):(a[u]||{}).prototype)for(r in t){if(o=t[r],i=e.noTargetGet?(s=Ot(n,r))&&s.value:n[r],!It(c?r:u+(l?".":"#")+r,e.forced)&&void 0!==i){if(typeof o==typeof i)continue;bt(o,i)}(e.sham||i&&i.sham)&&Ae(o,"sham",!0),$e(n,r,o,e)}},At=Object.keys||function(e){return dt(e,ft)},Tt=Object.assign,Rt=Object.defineProperty,Lt=b([].concat),Nt=!Tt||s((function(){if(u&&1!==Tt({b:1},Tt(Rt({},"a",{enumerable:!0,get:function(){Rt(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!=Tt({},e)[n]||"abcdefghijklmnopqrst"!=At(Tt({},t)).join("")}))?function(e,t){for(var n=te(e),r=arguments.length,i=1,o=gt.f,a=f.f;r>i;)for(var s,c=E(arguments[i++]),h=o?Lt(At(c),o(c)):At(c),d=h.length,p=0;d>p;)s=h[p++],u&&!l(a,c,s)||(n[s]=c[s]);return n}:Tt;Ct({target:"Object",stat:!0,forced:Object.assign!==Nt},{assign:Nt});var Mt=Array.isArray||function(e){return"Array"==_(e)},Pt=function(e,t,n){var r=ge(t);r in e?Ce.f(e,r,p(0,n)):e[r]=n},Dt={};Dt[de("toStringTag")]="z";var jt="[object z]"===String(Dt),Bt=de("toStringTag"),Ut=a.Object,Ft="Arguments"==_(function(){return arguments}()),zt=jt?_: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=Ut(e),Bt))?n:Ft?_(t):"Object"==(r=_(t))&&A(t.callee)?"Arguments":r},Ht=function(){},Vt=[],Wt=L("Reflect","construct"),Kt=/^\s*(?:class|function)\b/,qt=b(Kt.exec),Gt=!Kt.exec(Ht),Yt=function(e){if(!A(e))return!1;try{return Wt(Ht,Vt,e),!0}catch(e){return!1}},Zt=!Wt||s((function(){var e;return Yt(Yt.call)||!Yt(Object)||!Yt((function(){e=!0}))||e}))?function(e){if(!A(e))return!1;switch(zt(e)){case"AsyncFunction":case"GeneratorFunction":case"AsyncGeneratorFunction":return!1}return Gt||!!qt(Kt,Me(e))}:Yt,Jt=de("species"),Xt=a.Array,$t=function(e,t){return new(function(e){var t;return Mt(e)&&(t=e.constructor,(Zt(t)&&(t===Xt||Mt(t.prototype))||T(t)&&null===(t=t[Jt]))&&(t=void 0)),void 0===t?Xt:t}(e))(0===t?0:t)},Qt=de("species"),en=function(e){return U>=51||!s((function(){var t=[];return(t.constructor={})[Qt]=function(){return{foo:1}},1!==t[e](Boolean).foo}))},tn=de("isConcatSpreadable"),nn=a.TypeError,rn=U>=51||!s((function(){var e=[];return e[tn]=!1,e.concat()[0]!==e})),on=en("concat"),an=function(e){if(!T(e))return!1;var t=e[tn];return void 0!==t?!!t:Mt(e)};function sn(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}Ct({target:"Array",proto:!0,forced:!rn||!on},{concat:function(e){var t,n,r,i,o,a=te(this),s=$t(a,0),u=0;for(t=-1,r=arguments.length;t<r;t++)if(an(o=-1===t?a:arguments[t])){if(u+(i=st(o))>9007199254740991)throw nn("Maximum allowed index exceeded");for(n=0;n<i;n++,u++)n in o&&Pt(s,u,o[n])}else{if(u>=9007199254740991)throw nn("Maximum allowed index exceeded");Pt(s,u++,o)}return s.length=u,s}}),n((function(e){var t=function(e){var t=Object.prototype,n=t.hasOwnProperty,r="function"==typeof Symbol?Symbol:{},i=r.iterator||"@@iterator",o=r.asyncIterator||"@@asyncIterator",a=r.toStringTag||"@@toStringTag";function s(e,t,n){return Object.defineProperty(e,t,{value:n,enumerable:!0,configurable:!0,writable:!0}),e[t]}try{s({},"")}catch(e){s=function(e,t,n){return e[t]=n}}function u(e,t,n,r){var i=t&&t.prototype instanceof h?t:h,o=Object.create(i.prototype),a=new S(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 E()}for(n.method=i,n.arg=o;;){var a=n.delegate;if(a){var s=w(a,n);if(s){if(s===l)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 u=c(e,t,n);if("normal"===u.type){if(r=n.done?"completed":"suspendedYield",u.arg===l)continue;return{value:u.arg,done:n.done}}"throw"===u.type&&(r="completed",n.method="throw",n.arg=u.arg)}}}(e,n,a),o}function c(e,t,n){try{return{type:"normal",arg:e.call(t,n)}}catch(e){return{type:"throw",arg:e}}}e.wrap=u;var l={};function h(){}function d(){}function f(){}var p={};s(p,i,(function(){return this}));var v=Object.getPrototypeOf,g=v&&v(v(x([])));g&&g!==t&&n.call(g,i)&&(p=g);var m=f.prototype=h.prototype=Object.create(p);function y(e){["next","throw","return"].forEach((function(t){s(e,t,(function(e){return this._invoke(t,e)}))}))}function b(e,t){var r;this._invoke=function(i,o){function a(){return new t((function(r,a){!function r(i,o,a,s){var u=c(e[i],e,o);if("throw"!==u.type){var l=u.arg,h=l.value;return h&&"object"==typeof h&&n.call(h,"__await")?t.resolve(h.__await).then((function(e){r("next",e,a,s)}),(function(e){r("throw",e,a,s)})):t.resolve(h).then((function(e){l.value=e,a(l)}),(function(e){return r("throw",e,a,s)}))}s(u.arg)}(i,o,r,a)}))}return r=r?r.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 l;t.method="throw",t.arg=new TypeError("The iterator does not provide a 'throw' method")}return l}var r=c(n,e.iterator,t.arg);if("throw"===r.type)return t.method="throw",t.arg=r.arg,t.delegate=null,l;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,l):i:(t.method="throw",t.arg=new TypeError("iterator result is not an object"),t.delegate=null,l)}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 _(e){var t=e.completion||{};t.type="normal",delete t.arg,e.completion=t}function S(e){this.tryEntries=[{tryLoc:"root"}],e.forEach(k,this),this.reset(!0)}function x(e){if(e){var t=e[i];if(t)return t.call(e);if("function"==typeof e.next)return e;if(!isNaN(e.length)){var r=-1,o=function t(){for(;++r<e.length;)if(n.call(e,r))return t.value=e[r],t.done=!1,t;return t.value=void 0,t.done=!0,t};return o.next=o}}return{next:E}}function E(){return{value:void 0,done:!0}}return d.prototype=f,s(m,"constructor",f),s(f,"constructor",d),d.displayName=s(f,a,"GeneratorFunction"),e.isGeneratorFunction=function(e){var t="function"==typeof e&&e.constructor;return!!t&&(t===d||"GeneratorFunction"===(t.displayName||t.name))},e.mark=function(e){return Object.setPrototypeOf?Object.setPrototypeOf(e,f):(e.__proto__=f,s(e,a,"GeneratorFunction")),e.prototype=Object.create(m),e},e.awrap=function(e){return{__await:e}},y(b.prototype),s(b.prototype,o,(function(){return this})),e.AsyncIterator=b,e.async=function(t,n,r,i,o){void 0===o&&(o=Promise);var a=new b(u(t,n,r,i),o);return e.isGeneratorFunction(n)?a:a.next().then((function(e){return e.done?e.value:a.next()}))},y(m),s(m,a,"Generator"),s(m,i,(function(){return this})),s(m,"toString",(function(){return"[object Generator]"})),e.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}},e.values=x,S.prototype={constructor:S,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(_),!e)for(var t in this)"t"===t.charAt(0)&&n.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 r(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 r("end");if(o.tryLoc<=this.prev){var s=n.call(o,"catchLoc"),u=n.call(o,"finallyLoc");if(s&&u){if(this.prev<o.catchLoc)return r(o.catchLoc,!0);if(this.prev<o.finallyLoc)return r(o.finallyLoc)}else if(s){if(this.prev<o.catchLoc)return r(o.catchLoc,!0)}else{if(!u)throw new Error("try statement without catch or finally");if(this.prev<o.finallyLoc)return r(o.finallyLoc)}}}},abrupt:function(e,t){for(var r=this.tryEntries.length-1;r>=0;--r){var i=this.tryEntries[r];if(i.tryLoc<=this.prev&&n.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,l):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),l},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),_(n),l}},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;_(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),l}},e}(e.exports);try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}}));var un=function(e,t){var n=[][e];return!!n&&s((function(){n.call(null,t||function(){throw 1},1)}))},cn=ct.indexOf,ln=b([].indexOf),hn=!!ln&&1/ln([1],1,-0)<0,dn=un("indexOf");Ct({target:"Array",proto:!0,forced:hn||!dn},{indexOf:function(e){var t=arguments.length>1?arguments[1]:void 0;return hn?ln(this,e,t)||0:cn(this,e,t)}});var fn=b(b.bind),pn=function(e,t){return G(e),void 0===t?e:fn?fn(e,t):function(){return e.apply(t,arguments)}},vn=b([].push),gn=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(u,c,l,h){for(var d,f,p=te(u),v=E(p),g=pn(c,l),m=st(v),y=0,b=h||$t,w=t?b(u,m):n||a?b(u,0):void 0;m>y;y++)if((s||y in v)&&(f=g(d=v[y],y,p),e))if(t)w[y]=f;else if(f)switch(e){case 3:return!0;case 5:return d;case 6:return y;case 2:vn(w,d)}else switch(e){case 4:return!1;case 7:vn(w,d)}return o?-1:r||i?i:w}},mn={forEach:gn(0),map:gn(1),filter:gn(2),some:gn(3),every:gn(4),find:gn(5),findIndex:gn(6),filterReject:gn(7)},yn=mn.filter,bn=en("filter");Ct({target:"Array",proto:!0,forced:!bn},{filter:function(e){return yn(this,e,arguments.length>1?arguments[1]:void 0)}});var wn=jt?{}.toString:function(){return"[object "+zt(this)+"]"};jt||$e(Object.prototype,"toString",wn,{unsafe:!0});var kn,_n=a.String,Sn=function(e){if("Symbol"===zt(e))throw TypeError("Cannot convert a Symbol value to a string");return _n(e)},xn=function(){var e=Ee(this),t="";return e.global&&(t+="g"),e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e.unicode&&(t+="u"),e.sticky&&(t+="y"),t},En=a.RegExp,In=s((function(){var e=En("a","y");return e.lastIndex=2,null!=e.exec("abcd")})),On=In||s((function(){return!En("a","y").sticky})),Cn={BROKEN_CARET:In||s((function(){var e=En("^r","gy");return e.lastIndex=2,null!=e.exec("str")})),MISSED_STICKY:On,UNSUPPORTED_Y:In},An=u?Object.defineProperties:function(e,t){Ee(e);for(var n,r=C(t),i=At(t),o=i.length,a=0;o>a;)Ce.f(e,n=i[a++],r[n]);return e},Tn=L("document","documentElement"),Rn=Be("IE_PROTO"),Ln=function(){},Nn=function(e){return"<script>"+e+"<\/script>"},Mn=function(e){e.write(Nn("")),e.close();var t=e.parentWindow.Object;return e=null,t},Pn=function(){try{kn=new ActiveXObject("htmlfile")}catch(e){}var e,t;Pn="undefined"!=typeof document?document.domain&&kn?Mn(kn):((t=be("iframe")).style.display="none",Tn.appendChild(t),t.src=String("javascript:"),(e=t.contentWindow.document).open(),e.write(Nn("document.F=Object")),e.close(),e.F):Mn(kn);for(var n=ft.length;n--;)delete Pn.prototype[ft[n]];return Pn()};Ue[Rn]=!0;var Dn,jn,Bn=Object.create||function(e,t){var n;return null!==e?(Ln.prototype=Ee(e),n=new Ln,Ln.prototype=null,n[Rn]=e):n=Pn(),void 0===t?n:An(n,t)},Un=a.RegExp,Fn=s((function(){var e=Un(".","s");return!(e.dotAll&&e.exec("\n")&&"s"===e.flags)})),zn=a.RegExp,Hn=s((function(){var e=zn("(?<a>b)","g");return"b"!==e.exec("b").groups.a||"bc"!=="b".replace(e,"$<a>c")})),Vn=Ge.get,Wn=Q("native-string-replace",String.prototype.replace),Kn=RegExp.prototype.exec,qn=Kn,Gn=b("".charAt),Yn=b("".indexOf),Zn=b("".replace),Jn=b("".slice),Xn=(jn=/b*/g,l(Kn,Dn=/a/,"a"),l(Kn,jn,"a"),0!==Dn.lastIndex||0!==jn.lastIndex),$n=Cn.BROKEN_CARET,Qn=void 0!==/()??/.exec("")[1];(Xn||Qn||$n||Fn||Hn)&&(qn=function(e){var t,n,r,i,o,a,s,u=this,c=Vn(u),h=Sn(e),d=c.raw;if(d)return d.lastIndex=u.lastIndex,t=l(qn,d,h),u.lastIndex=d.lastIndex,t;var f=c.groups,p=$n&&u.sticky,v=l(xn,u),g=u.source,m=0,y=h;if(p&&(v=Zn(v,"y",""),-1===Yn(v,"g")&&(v+="g"),y=Jn(h,u.lastIndex),u.lastIndex>0&&(!u.multiline||u.multiline&&"\n"!==Gn(h,u.lastIndex-1))&&(g="(?: "+g+")",y=" "+y,m++),n=new RegExp("^(?:"+g+")",v)),Qn&&(n=new RegExp("^"+g+"$(?!\\s)",v)),Xn&&(r=u.lastIndex),i=l(Kn,p?n:u,y),p?i?(i.input=Jn(i.input,m),i[0]=Jn(i[0],m),i.index=u.lastIndex,u.lastIndex+=i[0].length):u.lastIndex=0:Xn&&i&&(u.lastIndex=u.global?i.index+i[0].length:r),Qn&&i&&i.length>1&&l(Wn,i[0],n,(function(){for(o=1;o<arguments.length-2;o++)void 0===arguments[o]&&(i[o]=void 0)})),i&&f)for(i.groups=a=Bn(null),o=0;o<f.length;o++)a[(s=f[o])[0]]=i[s[1]];return i});var er=qn;Ct({target:"RegExp",proto:!0,forced:/./.exec!==er},{exec:er});var tr=de("species"),nr=RegExp.prototype,rr=function(e,t,n,r){var i=de(e),o=!s((function(){var t={};return t[i]=function(){return 7},7!=""[e](t)})),a=o&&!s((function(){var t=!1,n=/a/;return"split"===e&&((n={}).constructor={},n.constructor[tr]=function(){return n},n.flags="",n[i]=/./[i]),n.exec=function(){return t=!0,null},n[i](""),!t}));if(!o||!a||n){var u=b(/./[i]),c=t(i,""[e],(function(e,t,n,r,i){var a=b(e),s=t.exec;return s===er||s===nr.exec?o&&!i?{done:!0,value:u(t,n,r)}:{done:!0,value:a(n,t,r)}:{done:!1}}));$e(String.prototype,e,c[0]),$e(nr,i,c[1])}r&&Ae(nr[i],"sham",!0)},ir=b("".charAt),or=b("".charCodeAt),ar=b("".slice),sr=function(e){return function(t,n){var r,i,o=Sn(O(t)),a=tt(n),s=o.length;return a<0||a>=s?e?"":void 0:(r=or(o,a))<55296||r>56319||a+1===s||(i=or(o,a+1))<56320||i>57343?e?ir(o,a):r:e?ar(o,a,a+2):i-56320+(r-55296<<10)+65536}},ur={codeAt:sr(!1),charAt:sr(!0)},cr=ur.charAt,lr=function(e,t,n){return t+(n?cr(e,t).length:1)},hr=a.TypeError,dr=function(e,t){var n=e.exec;if(A(n)){var r=l(n,e,t);return null!==r&&Ee(r),r}if("RegExp"===_(e))return l(er,e,t);throw hr("RegExp#exec called on incompatible receiver")};rr("match",(function(e,t,n){return[function(t){var n=O(this),r=null==t?void 0:Y(t,e);return r?l(r,t,n):new RegExp(t)[e](Sn(n))},function(e){var r=Ee(this),i=Sn(e),o=n(t,r,i);if(o.done)return o.value;if(!r.global)return dr(r,i);var a=r.unicode;r.lastIndex=0;for(var s,u=[],c=0;null!==(s=dr(r,i));){var l=Sn(s[0]);u[c]=l,""===l&&(r.lastIndex=lr(i,at(r.lastIndex),a)),c++}return 0===c?null:u}]}));var fr=mn.map,pr=en("map");Ct({target:"Array",proto:!0,forced:!pr},{map:function(e){return fr(this,e,arguments.length>1?arguments[1]:void 0)}});var vr="\t\n\v\f\r \u2028\u2029\ufeff",gr=b("".replace),mr="["+vr+"]",yr=RegExp("^"+mr+mr+"*"),br=RegExp(mr+mr+"*$"),wr=function(e){return function(t){var n=Sn(O(t));return 1&e&&(n=gr(n,yr,"")),2&e&&(n=gr(n,br,"")),n}},kr={start:wr(1),end:wr(2),trim:wr(3)},_r=kr.trim,Sr=a.parseInt,xr=a.Symbol,Er=xr&&xr.iterator,Ir=/^[+-]?0x/i,Or=b(Ir.exec),Cr=8!==Sr(vr+"08")||22!==Sr(vr+"0x16")||Er&&!s((function(){Sr(Object(Er))}))?function(e,t){var n=_r(Sn(e));return Sr(n,t>>>0||(Or(Ir,n)?16:10))}:Sr;Ct({global:!0,forced:parseInt!=Cr},{parseInt:Cr});var Ar=Function.prototype,Tr=Ar.apply,Rr=Ar.bind,Lr=Ar.call,Nr="object"==typeof Reflect&&Reflect.apply||(Rr?Lr.bind(Tr):function(){return Lr.apply(Tr,arguments)}),Mr=de("match"),Pr=function(e){var t;return T(e)&&(void 0!==(t=e[Mr])?!!t:"RegExp"==_(e))},Dr=a.TypeError,jr=function(e){if(Zt(e))return e;throw Dr(K(e)+" is not a constructor")},Br=de("species"),Ur=function(e,t){var n,r=Ee(e).constructor;return void 0===r||null==(n=Ee(r)[Br])?t:jr(n)},Fr=a.Array,zr=Math.max,Hr=function(e,t,n){for(var r=st(e),i=it(t,r),o=it(void 0===n?r:n,r),a=Fr(zr(o-i,0)),s=0;i<o;i++,s++)Pt(a,s,e[i]);return a.length=s,a},Vr=Cn.UNSUPPORTED_Y,Wr=Math.min,Kr=[].push,qr=b(/./.exec),Gr=b(Kr),Yr=b("".slice);rr("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=Sn(O(this)),i=void 0===n?4294967295:n>>>0;if(0===i)return[];if(void 0===e)return[r];if(!Pr(e))return l(t,r,e,i);for(var o,a,s,u=[],c=(e.ignoreCase?"i":"")+(e.multiline?"m":"")+(e.unicode?"u":"")+(e.sticky?"y":""),h=0,d=new RegExp(e.source,c+"g");(o=l(er,d,r))&&!((a=d.lastIndex)>h&&(Gr(u,Yr(r,h,o.index)),o.length>1&&o.index<r.length&&Nr(Kr,u,Hr(o,1)),s=o[0].length,h=a,u.length>=i));)d.lastIndex===o.index&&d.lastIndex++;return h===r.length?!s&&qr(d,"")||Gr(u,""):Gr(u,Yr(r,h)),u.length>i?Hr(u,0,i):u}:"0".split(void 0,0).length?function(e,n){return void 0===e&&0===n?[]:l(t,this,e,n)}:t,[function(t,n){var i=O(this),o=null==t?void 0:Y(t,e);return o?l(o,t,i,n):l(r,Sn(i),t,n)},function(e,i){var o=Ee(this),a=Sn(e),s=n(r,o,a,i,r!==t);if(s.done)return s.value;var u=Ur(o,RegExp),c=o.unicode,l=(o.ignoreCase?"i":"")+(o.multiline?"m":"")+(o.unicode?"u":"")+(Vr?"g":"y"),h=new u(Vr?"^(?:"+o.source+")":o,l),d=void 0===i?4294967295:i>>>0;if(0===d)return[];if(0===a.length)return null===dr(h,a)?[a]:[];for(var f=0,p=0,v=[];p<a.length;){h.lastIndex=Vr?0:p;var g,m=dr(h,Vr?Yr(a,p):a);if(null===m||(g=Wr(at(h.lastIndex+(Vr?p:0)),a.length))===f)p=lr(a,p,c);else{if(Gr(v,Yr(a,f,p)),v.length===d)return v;for(var y=1;y<=m.length-1;y++)if(Gr(v,m[y]),v.length===d)return v;p=f=g}}return Gr(v,Yr(a,f)),v}]}),!!s((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]})),Vr);var Zr=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),u=/(?:Firefox)/.test(e),c=/(?: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)||u&&/(?: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,w=e.indexOf("HuaweiBrowser")>-1;return{isTablet:f,isPhone:p,isAndroid:s,isPc:v,isMac:n,isWindows:i,isPad:d,isChrome:c,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:w}},Jr=Zr(),Xr={isMinBrowser:function(){var e=!1,t=Jr.isChrome,n=Jr.isEdge;if(t){var r=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==r?void 0:r.major)>=72}else if(n){var i=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==i?void 0:i.major)>=80}return e},isMobile:function(){var e=!1,t=Jr.isPhone,n=Jr.isAndroid,r=Jr.isPad;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,u=a.minor;e=12===s?u>2:s>12}else r&&(e=!0);return e},isFirefox:function(){return Jr.isFirefox},isSupportReauthorize:function(){var e=Jr.isPhone,t=Jr.isSafari,n=Jr.isPad,r=Jr.isFirefox,i=Jr.isHuaweiBrowser;return!(e||t||n||r||i)},isSupportAppendTrack:function(){return!Jr.isFirefox},isSupportRTC:function(){for(var e=!1,t=["RTCPeerConnection","webkitRTCPeerConnection","mozRTCPeerConnection","RTCIceGatherer"],n=0;n<t.length;n++){if(t[n]in window){e=!0;break}}return e&&(e=Xr.isSupportPeerCB()),e},isSupportPeerCB:function(){if(RTCPeerConnection){var e,t=new RTCPeerConnection({iceServers:[]});return e=!!(t.createDataChannel&&t.createAnswer&&t.createOffer&&t.addEventListener&&t.removeEventListener),t.close(),e}return!1},isSupportWebsocket:function(){return!!window.WebSocket},isSupportMedia:function(){return!!navigator.mediaDevices},isSupportH264:function(){return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(i=Jr.isFirefox,o=!1,!i){e.next=13;break}return e.prev=3,a=new RTCPeerConnection,e.next=7,a.createOffer({offerToReceiveAudio:!0,offerToReceiveVideo:!0});case 7:s=e.sent,o=((null===(t=null==s?void 0:s.sdp)||void 0===t?void 0:t.toLowerCase().indexOf("h264"))||-1)>-1,e.next=13;break;case 11:e.prev=11,e.t0=e.catch(3);case 13:try{u=(null===(n=RTCRtpSender.getCapabilities("video"))||void 0===n?void 0:n.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],c=(null===(r=RTCRtpReceiver.getCapabilities("video"))||void 0===r?void 0:r.codecs.filter((function(e){return e.mimeType.toLowerCase().indexOf("h264")>0})))||[],(null==u?void 0:u.length)>0&&c.length>0&&(o=!0)}catch(e){}return e.abrupt("return",o);case 15:case"end":return e.stop()}}),e,null,[[3,11]])})))},osVersion:function(){var e=Jr.isMac,t=Jr.isWindows,n=Jr.isLinux,r=Jr.isPhone,i=Jr.isAndroid,o=Jr.isPad,a="unknown";return e?a="mac":t?a="windows":n?a="linux":r?a="ios":i?a="android":o&&(a="pad"),a}};function $r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function Qr(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 ei(e,t,n){return t&&Qr(e.prototype,t),n&&Qr(e,n),e}function ti(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function");e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,writable:!0,configurable:!0}}),t&&ri(e,t)}function ni(e){return(ni=Object.setPrototypeOf?Object.getPrototypeOf:function(e){return e.__proto__||Object.getPrototypeOf(e)})(e)}function ri(e,t){return(ri=Object.setPrototypeOf||function(e,t){return e.__proto__=t,e})(e,t)}function ii(e){if(void 0===e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return e}function oi(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 ii(e)}function ai(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=ni(e);if(t){var i=ni(this).constructor;n=Reflect.construct(r,arguments,i)}else n=r.apply(this,arguments);return oi(this,n)}}function si(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)||ci(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 ui(e){return function(e){if(Array.isArray(e))return li(e)}(e)||function(e){if("undefined"!=typeof Symbol&&null!=e[Symbol.iterator]||null!=e["@@iterator"])return Array.from(e)}(e)||ci(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 ci(e,t){if(e){if("string"==typeof e)return li(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)?li(e,t):void 0}}function li(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 hi(e,t){var n="undefined"!=typeof Symbol&&e[Symbol.iterator]||e["@@iterator"];if(!n){if(Array.isArray(e)||(n=ci(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}}}}var di=de("unscopables"),fi=Array.prototype;null==fi[di]&&Ce.f(fi,di,{configurable:!0,value:Bn(null)});var pi,vi,gi,mi=function(e){fi[di][e]=!0},yi={},bi=!s((function(){function e(){}return e.prototype.constructor=null,Object.getPrototypeOf(new e)!==e.prototype})),wi=Be("IE_PROTO"),ki=a.Object,_i=ki.prototype,Si=bi?ki.getPrototypeOf:function(e){var t=te(e);if(re(t,wi))return t[wi];var n=t.constructor;return A(n)&&t instanceof n?n.prototype:t instanceof ki?_i:null},xi=de("iterator"),Ei=!1;[].keys&&("next"in(gi=[].keys())?(vi=Si(Si(gi)))!==Object.prototype&&(pi=vi):Ei=!0),(null==pi||s((function(){var e={};return pi[xi].call(e)!==e})))&&(pi={}),A(pi[xi])||$e(pi,xi,(function(){return this}));var Ii={IteratorPrototype:pi,BUGGY_SAFARI_ITERATORS:Ei},Oi=Ce.f,Ci=de("toStringTag"),Ai=function(e,t,n){e&&!re(e=n?e:e.prototype,Ci)&&Oi(e,Ci,{configurable:!0,value:t})},Ti=Ii.IteratorPrototype,Ri=function(){return this},Li=a.String,Ni=a.TypeError,Mi=Object.setPrototypeOf||("__proto__"in{}?function(){var e,t=!1,n={};try{(e=b(Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set))(n,[]),t=n instanceof Array}catch(e){}return function(n,r){return Ee(n),function(e){if("object"==typeof e||A(e))return e;throw Ni("Can't set "+Li(e)+" as a prototype")}(r),t?e(n,r):n.__proto__=r,n}}():void 0),Pi=Xe.PROPER,Di=Xe.CONFIGURABLE,ji=Ii.IteratorPrototype,Bi=Ii.BUGGY_SAFARI_ITERATORS,Ui=de("iterator"),Fi=function(){return this},zi=function(e,t,n,r,i,o,a){!function(e,t,n){var r=t+" Iterator";e.prototype=Bn(Ti,{next:p(1,n)}),Ai(e,r,!1),yi[r]=Ri}(n,t,r);var s,u,c,h=function(e){if(e===i&&m)return m;if(!Bi&&e in v)return v[e];switch(e){case"keys":case"values":case"entries":return function(){return new n(this,e)}}return function(){return new n(this)}},d=t+" Iterator",f=!1,v=e.prototype,g=v[Ui]||v["@@iterator"]||i&&v[i],m=!Bi&&g||h(i),y="Array"==t&&v.entries||g;if(y&&(s=Si(y.call(new e)))!==Object.prototype&&s.next&&(Si(s)!==ji&&(Mi?Mi(s,ji):A(s[Ui])||$e(s,Ui,Fi)),Ai(s,d,!0)),Pi&&"values"==i&&g&&"values"!==g.name&&(Di?Ae(v,"name","values"):(f=!0,m=function(){return l(g,this)})),i)if(u={values:h("values"),keys:o?m:h("keys"),entries:h("entries")},a)for(c in u)(Bi||f||!(c in v))&&$e(v,c,u[c]);else Ct({target:t,proto:!0,forced:Bi||f},u);return v[Ui]!==m&&$e(v,Ui,m,{name:i}),yi[t]=m,u},Hi=Ge.set,Vi=Ge.getterFor("Array Iterator"),Wi=zi(Array,"Array",(function(e,t){Hi(this,{type:"Array Iterator",target:C(e),index:0,kind:t})}),(function(){var e=Vi(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");yi.Arguments=yi.Array,mi("keys"),mi("values"),mi("entries");var Ki=a.Promise,qi=function(e,t,n){for(var r in t)$e(e,r,t[r],n);return e},Gi=de("species"),Yi=function(e){var t=L(e),n=Ce.f;u&&t&&!t[Gi]&&n(t,Gi,{configurable:!0,get:function(){return this}})},Zi=a.TypeError,Ji=function(e,t){if(N(t,e))return e;throw Zi("Incorrect invocation")},Xi=de("iterator"),$i=Array.prototype,Qi=function(e){return void 0!==e&&(yi.Array===e||$i[Xi]===e)},eo=de("iterator"),to=function(e){if(null!=e)return Y(e,eo)||Y(e,"@@iterator")||yi[zt(e)]},no=a.TypeError,ro=function(e,t){var n=arguments.length<2?to(e):t;if(G(n))return Ee(l(n,e));throw no(K(e)+" is not iterable")},io=function(e,t,n){var r,i;Ee(e);try{if(!(r=Y(e,"return"))){if("throw"===t)throw n;return n}r=l(r,e)}catch(e){i=!0,r=e}if("throw"===t)throw n;if(i)throw r;return Ee(r),n},oo=a.TypeError,ao=function(e,t){this.stopped=e,this.result=t},so=ao.prototype,uo=function(e,t,n){var r,i,o,a,s,u,c,h=n&&n.that,d=!(!n||!n.AS_ENTRIES),f=!(!n||!n.IS_ITERATOR),p=!(!n||!n.INTERRUPTED),v=pn(t,h),g=function(e){return r&&io(r,"normal",e),new ao(!0,e)},m=function(e){return d?(Ee(e),p?v(e[0],e[1],g):v(e[0],e[1])):p?v(e,g):v(e)};if(f)r=e;else{if(!(i=to(e)))throw oo(K(e)+" is not iterable");if(Qi(i)){for(o=0,a=st(e);a>o;o++)if((s=m(e[o]))&&N(so,s))return s;return new ao(!1)}r=ro(e,i)}for(u=r.next;!(c=l(u,r)).done;){try{s=m(c.value)}catch(e){io(r,"throw",e)}if("object"==typeof s&&s&&N(so,s))return s}return new ao(!1)},co=de("iterator"),lo=!1;try{var ho=0,fo={next:function(){return{done:!!ho++}},return:function(){lo=!0}};fo[co]=function(){return this},Array.from(fo,(function(){throw 2}))}catch(e){}var po,vo,go,mo,yo=function(e,t){if(!t&&!lo)return!1;var n=!1;try{var r={};r[co]=function(){return{next:function(){return{done:n=!0}}}},e(r)}catch(e){}return n},bo=b([].slice),wo=/(?:ipad|iphone|ipod).*applewebkit/i.test(M),ko="process"==_(a.process),_o=a.setImmediate,So=a.clearImmediate,xo=a.process,Eo=a.Dispatch,Io=a.Function,Oo=a.MessageChannel,Co=a.String,Ao=0,To={};try{po=a.location}catch(e){}var Ro=function(e){if(re(To,e)){var t=To[e];delete To[e],t()}},Lo=function(e){return function(){Ro(e)}},No=function(e){Ro(e.data)},Mo=function(e){a.postMessage(Co(e),po.protocol+"//"+po.host)};_o&&So||(_o=function(e){var t=bo(arguments,1);return To[++Ao]=function(){Nr(A(e)?e:Io(e),void 0,t)},vo(Ao),Ao},So=function(e){delete To[e]},ko?vo=function(e){xo.nextTick(Lo(e))}:Eo&&Eo.now?vo=function(e){Eo.now(Lo(e))}:Oo&&!wo?(mo=(go=new Oo).port2,go.port1.onmessage=No,vo=pn(mo.postMessage,mo)):a.addEventListener&&A(a.postMessage)&&!a.importScripts&&po&&"file:"!==po.protocol&&!s(Mo)?(vo=Mo,a.addEventListener("message",No,!1)):vo="onreadystatechange"in be("script")?function(e){Tn.appendChild(be("script")).onreadystatechange=function(){Tn.removeChild(this),Ro(e)}}:function(e){setTimeout(Lo(e),0)});var Po,Do,jo,Bo,Uo,Fo,zo,Ho,Vo={set:_o,clear:So},Wo=/ipad|iphone|ipod/i.test(M)&&void 0!==a.Pebble,Ko=/web0s(?!.*chrome)/i.test(M),qo=_e.f,Go=Vo.set,Yo=a.MutationObserver||a.WebKitMutationObserver,Zo=a.document,Jo=a.process,Xo=a.Promise,$o=qo(a,"queueMicrotask"),Qo=$o&&$o.value;Qo||(Po=function(){var e,t;for(ko&&(e=Jo.domain)&&e.exit();Do;){t=Do.fn,Do=Do.next;try{t()}catch(e){throw Do?Bo():jo=void 0,e}}jo=void 0,e&&e.enter()},wo||ko||Ko||!Yo||!Zo?!Wo&&Xo&&Xo.resolve?((zo=Xo.resolve(void 0)).constructor=Xo,Ho=pn(zo.then,zo),Bo=function(){Ho(Po)}):ko?Bo=function(){Jo.nextTick(Po)}:(Go=pn(Go,a),Bo=function(){Go(Po)}):(Uo=!0,Fo=Zo.createTextNode(""),new Yo(Po).observe(Fo,{characterData:!0}),Bo=function(){Fo.data=Uo=!Uo}));var ea,ta,na,ra,ia=Qo||function(e){var t={fn:e,next:void 0};jo&&(jo.next=t),Do||(Do=t,Bo()),jo=t},oa=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=G(t),this.reject=G(n)},aa={f:function(e){return new oa(e)}},sa=function(e){try{return{error:!1,value:e()}}catch(e){return{error:!0,value:e}}},ua="object"==typeof window,ca=Vo.set,la=de("species"),ha=Ge.get,da=Ge.set,fa=Ge.getterFor("Promise"),pa=Ki&&Ki.prototype,va=Ki,ga=pa,ma=a.TypeError,ya=a.document,ba=a.process,wa=aa.f,ka=wa,_a=!!(ya&&ya.createEvent&&a.dispatchEvent),Sa=A(a.PromiseRejectionEvent),xa=!1,Ea=It("Promise",(function(){var e=Me(va),t=e!==String(va);if(!t&&66===U)return!0;if(U>=51&&/native code/.test(e))return!1;var n=new va((function(e){e(1)})),r=function(e){e((function(){}),(function(){}))};return(n.constructor={})[la]=r,!(xa=n.then((function(){}))instanceof r)||!t&&ua&&!Sa})),Ia=Ea||!yo((function(e){va.all(e).catch((function(){}))})),Oa=function(e){var t;return!(!T(e)||!A(t=e.then))&&t},Ca=function(e,t){if(!e.notified){e.notified=!0;var n=e.reactions;ia((function(){for(var r=e.value,i=1==e.state,o=0;n.length>o;){var a,s,u,c=n[o++],h=i?c.ok:c.fail,d=c.resolve,f=c.reject,p=c.domain;try{h?(i||(2===e.rejection&&La(e),e.rejection=1),!0===h?a=r:(p&&p.enter(),a=h(r),p&&(p.exit(),u=!0)),a===c.promise?f(ma("Promise-chain cycle")):(s=Oa(a))?l(s,a,d,f):d(a)):f(r)}catch(e){p&&!u&&p.exit(),f(e)}}e.reactions=[],e.notified=!1,t&&!e.rejection&&Ta(e)}))}},Aa=function(e,t,n){var r,i;_a?((r=ya.createEvent("Event")).promise=t,r.reason=n,r.initEvent(e,!1,!0),a.dispatchEvent(r)):r={promise:t,reason:n},!Sa&&(i=a["on"+e])?i(r):"unhandledrejection"===e&&function(e,t){var n=a.console;n&&n.error&&(1==arguments.length?n.error(e):n.error(e,t))}("Unhandled promise rejection",n)},Ta=function(e){l(ca,a,(function(){var t,n=e.facade,r=e.value;if(Ra(e)&&(t=sa((function(){ko?ba.emit("unhandledRejection",r,n):Aa("unhandledrejection",n,r)})),e.rejection=ko||Ra(e)?2:1,t.error))throw t.value}))},Ra=function(e){return 1!==e.rejection&&!e.parent},La=function(e){l(ca,a,(function(){var t=e.facade;ko?ba.emit("rejectionHandled",t):Aa("rejectionhandled",t,e.value)}))},Na=function(e,t,n){return function(r){e(t,r,n)}},Ma=function(e,t,n){e.done||(e.done=!0,n&&(e=n),e.value=t,e.state=2,Ca(e,!0))},Pa=function(e,t,n){if(!e.done){e.done=!0,n&&(e=n);try{if(e.facade===t)throw ma("Promise can't be resolved itself");var r=Oa(t);r?ia((function(){var n={done:!1};try{l(r,t,Na(Pa,n,e),Na(Ma,n,e))}catch(t){Ma(n,t,e)}})):(e.value=t,e.state=1,Ca(e,!1))}catch(t){Ma({done:!1},t,e)}}};if(Ea&&(ga=(va=function(e){Ji(this,ga),G(e),l(ea,this);var t=ha(this);try{e(Na(Pa,t),Na(Ma,t))}catch(e){Ma(t,e)}}).prototype,(ea=function(e){da(this,{type:"Promise",done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=qi(ga,{then:function(e,t){var n=fa(this),r=n.reactions,i=wa(Ur(this,va));return i.ok=!A(e)||e,i.fail=A(t)&&t,i.domain=ko?ba.domain:void 0,n.parent=!0,r[r.length]=i,0!=n.state&&Ca(n,!1),i.promise},catch:function(e){return this.then(void 0,e)}}),ta=function(){var e=new ea,t=ha(e);this.promise=e,this.resolve=Na(Pa,t),this.reject=Na(Ma,t)},aa.f=wa=function(e){return e===va||e===na?new ta(e):ka(e)},A(Ki)&&pa!==Object.prototype)){ra=pa.then,xa||($e(pa,"then",(function(e,t){var n=this;return new va((function(e,t){l(ra,n,e,t)})).then(e,t)}),{unsafe:!0}),$e(pa,"catch",ga.catch,{unsafe:!0}));try{delete pa.constructor}catch(e){}Mi&&Mi(pa,ga)}Ct({global:!0,wrap:!0,forced:Ea},{Promise:va}),Ai(va,"Promise",!1),Yi("Promise"),na=L("Promise"),Ct({target:"Promise",stat:!0,forced:Ea},{reject:function(e){var t=wa(this);return l(t.reject,void 0,e),t.promise}}),Ct({target:"Promise",stat:!0,forced:Ea},{resolve:function(e){return function(e,t){if(Ee(e),T(t)&&t.constructor===e)return t;var n=aa.f(e);return(0,n.resolve)(t),n.promise}(this,e)}}),Ct({target:"Promise",stat:!0,forced:Ia},{all:function(e){var t=this,n=wa(t),r=n.resolve,i=n.reject,o=sa((function(){var n=G(t.resolve),o=[],a=0,s=1;uo(e,(function(e){var u=a++,c=!1;s++,l(n,t,e).then((function(e){c||(c=!0,o[u]=e,--s||r(o))}),i)})),--s||r(o)}));return o.error&&i(o.value),n.promise},race:function(e){var t=this,n=wa(t),r=n.reject,i=sa((function(){var i=G(t.resolve);uo(e,(function(e){l(i,t,e).then(n.resolve,r)}))}));return i.error&&r(i.value),n.promise}});var Da=ur.charAt,ja=Ge.set,Ba=Ge.getterFor("String Iterator");zi(String,"String",(function(e){ja(this,{type:"String Iterator",string:Sn(e),index:0})}),(function(){var e,t=Ba(this),n=t.string,r=t.index;return r>=n.length?{value:void 0,done:!0}:(e=Da(n,r),t.index+=e.length,{value:e,done:!1})}));var Ua={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},Fa=be("span").classList,za=Fa&&Fa.constructor&&Fa.constructor.prototype,Ha=za===Object.prototype?void 0:za,Va=de("iterator"),Wa=de("toStringTag"),Ka=Wi.values,qa=function(e,t){if(e){if(e[Va]!==Ka)try{Ae(e,Va,Ka)}catch(t){e[Va]=Ka}if(e[Wa]||Ae(e,Wa,t),Ua[t])for(var n in Wi)if(e[n]!==Wi[n])try{Ae(e,n,Wi[n])}catch(t){e[n]=Wi[n]}}};for(var Ga in Ua)qa(a[Ga]&&a[Ga].prototype,Ga);qa(Ha,"DOMTokenList");var Ya=a.Date,Za=b(Ya.prototype.getTime);Ct({target:"Date",stat:!0},{now:function(){return Za(new Ya)}});var Ja=Date.prototype,Xa=b(Ja.toString),$a=b(Ja.getTime);"Invalid Date"!=String(new Date(NaN))&&$e(Ja,"toString",(function(){var e=$a(this);return e==e?Xa(this):"Invalid Date"}));var Qa=Object.keys,es=Array.isArray,ts="undefined"!=typeof self?self:"undefined"!=typeof window?window:global;function ns(e,t){return"object"!=typeof t||Qa(t).forEach((function(n){e[n]=t[n]})),e}var rs=Object.getPrototypeOf,is={}.hasOwnProperty;function os(e,t){return is.call(e,t)}function as(e,t){"function"==typeof t&&(t=t(rs(e))),Qa(t).forEach((function(n){us(e,n,t[n])}))}var ss=Object.defineProperty;function us(e,t,n,r){ss(e,t,ns(n&&os(n,"get")&&"function"==typeof n.get?{get:n.get,set:n.set,configurable:!0}:{value:n,configurable:!0,writable:!0},r))}function cs(e){return{from:function(t){return e.prototype=Object.create(t.prototype),us(e.prototype,"constructor",e),{extend:as.bind(null,e.prototype)}}}}var ls=Object.getOwnPropertyDescriptor;var hs=[].slice;function ds(e,t,n){return hs.call(e,t,n)}function fs(e,t){return t(e)}function ps(e){if(!e)throw new Error("Assertion Failed")}function vs(e){ts.setImmediate?setImmediate(e):setTimeout(e,0)}function gs(e,t){return e.reduce((function(e,n,r){var i=t(n,r);return i&&(e[i[0]]=i[1]),e}),{})}function ms(e,t){return function(){try{e.apply(this,arguments)}catch(e){t(e)}}}function ys(e,t,n){try{e.apply(null,n)}catch(e){t&&t(e)}}function bs(e,t){if(os(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=bs(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:bs(s,t.substr(a+1))}}function ws(e,t,n){if(e&&void 0!==t&&(!("isFrozen"in Object)||!Object.isFrozen(e)))if("string"!=typeof t&&"length"in t){ps("string"!=typeof n&&"length"in n);for(var r=0,i=t.length;r<i;++r)ws(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 u=e[a];u||(u=e[a]={}),ws(u,s,n)}}else void 0===n?delete e[t]:e[t]=n}}function ks(e){var t={};for(var n in e)os(e,n)&&(t[n]=e[n]);return t}var _s=[].concat;function Ss(e){return _s.apply([],e)}var xs="Boolean,String,Date,RegExp,Blob,File,FileList,ArrayBuffer,DataView,Uint8ClampedArray,ImageData,Map,Set".split(",").concat(Ss([8,16,32,64].map((function(e){return["Int","Uint","Float"].map((function(t){return t+e+"Array"}))})))).filter((function(e){return ts[e]})).map((function(e){return ts[e]}));function Es(e){if(!e||"object"!=typeof e)return e;var t;if(es(e)){t=[];for(var n=0,r=e.length;n<r;++n)t.push(Es(e[n]))}else if(xs.indexOf(e.constructor)>=0)t=e;else for(var i in t=e.constructor?Object.create(e.constructor.prototype):{},e)os(e,i)&&(t[i]=Es(e[i]));return t}function Is(e,t,n,r){return n=n||{},r=r||"",Qa(e).forEach((function(i){if(os(t,i)){var o=e[i],a=t[i];"object"==typeof o&&"object"==typeof a&&o&&a&&""+o.constructor==""+a.constructor?Is(o,a,n,r+i+"."):o!==a&&(n[r+i]=t[i])}else n[r+i]=void 0})),Qa(t).forEach((function(i){os(e,i)||(n[r+i]=t[i])})),n}var Os="undefined"!=typeof Symbol&&Symbol.iterator,Cs=Os?function(e){var t;return null!=e&&(t=e[Os])&&t.apply(e)}:function(){return null},As={};function Ts(e){var t,n,r,i;if(1===arguments.length){if(es(e))return e.slice();if(this===As&&"string"==typeof e)return[e];if(i=Cs(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 Rs="undefined"!=typeof location&&/^(http|https):\/\/(localhost|127\.0\.0\.1)/.test(location.href);function Ls(e,t){Rs=e,Ns=t}var Ns=function(){return!0},Ms=!new Error("").stack;function Ps(){if(Ms)try{throw Ps.arguments,new Error}catch(e){return e}return new Error}function Ds(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(Ns).map((function(e){return"\n"+e})).join("")):""}var js=["Unknown","Constraint","Data","TransactionInactive","ReadOnly","Version","NotFound","InvalidState","InvalidAccess","Abort","Timeout","QuotaExceeded","Syntax","DataClone"],Bs=["Modify","Bulk","OpenFailed","VersionChange","Schema","Upgrade","InvalidTable","MissingAPI","NoSuchDatabase","InvalidArgument","SubTransaction","Unsupported","Internal","DatabaseClosed","PrematureCommit","ForeignAwait"].concat(js),Us={VersionChanged:"Database version changed by other database connection",DatabaseClosed:"Database has been closed",Abort:"Transaction aborted",TransactionInactive:"Transaction has already completed or failed"};function Fs(e,t){this._e=Ps(),this.name=e,this.message=t}function zs(e,t,n,r){this._e=Ps(),this.failures=t,this.failedKeys=r,this.successCount=n}function Hs(e,t){this._e=Ps(),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)}cs(Fs).from(Error).extend({stack:{get:function(){return this._stack||(this._stack=this.name+": "+this.message+Ds(this._e,2))}},toString:function(){return this.name+": "+this.message}}),cs(zs).from(Fs),cs(Hs).from(Fs);var Vs=Bs.reduce((function(e,t){return e[t]=t+"Error",e}),{}),Ws=Fs,Ks=Bs.reduce((function(e,t){var n=t+"Error";function r(e,r){this._e=Ps(),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=Us[t]||n,this.inner=null)}return cs(r).from(Ws),e[t]=r,e}),{});Ks.Syntax=SyntaxError,Ks.Type=TypeError,Ks.Range=RangeError;var qs=js.reduce((function(e,t){return e[t+"Error"]=Ks[t],e}),{});var Gs=Bs.reduce((function(e,t){return-1===["Syntax","Type","Range"].indexOf(t)&&(e[t+"Error"]=Ks[t]),e}),{});function Ys(){}function Zs(e){return e}function Js(e,t){return null==e||e===Zs?t:function(n){return t(e(n))}}function Xs(e,t){return function(){e.apply(this,arguments),t.apply(this,arguments)}}function $s(e,t){return e===Ys?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?Xs(r,this.onsuccess):r),i&&(this.onerror=this.onerror?Xs(i,this.onerror):i),void 0!==o?o:n}}function Qs(e,t){return e===Ys?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?Xs(n,this.onsuccess):n),r&&(this.onerror=this.onerror?Xs(r,this.onerror):r)}}function eu(e,t){return e===Ys?t:function(n){var r=e.apply(this,arguments);ns(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?Xs(i,this.onsuccess):i),o&&(this.onerror=this.onerror?Xs(o,this.onerror):o),void 0===r?void 0===a?void 0:a:ns(r,a)}}function tu(e,t){return e===Ys?t:function(){return!1!==t.apply(this,arguments)&&e.apply(this,arguments)}}function nu(e,t){return e===Ys?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)}}Gs.ModifyError=zs,Gs.DexieError=Fs,Gs.BulkError=Hs;var ru={},iu=function(){try{return new Function("let F=async ()=>{},p=F();return [p,Object.getPrototypeOf(p),Promise.resolve(),F.constructor];")()}catch(t){var e=ts.Promise;return e?[e.resolve(),e.prototype,e.resolve()]:[]}}(),ou=iu[0],au=iu[1],su=iu[2],uu=au&&au.then,cu=ou&&ou.constructor,lu=iu[3],hu=!!su,du=!1,fu=su?function(){su.then(Pu)}:ts.setImmediate?setImmediate.bind(null,Pu):ts.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)},pu=function(e,t){Su.push([e,t]),gu&&(fu(),gu=!1)},vu=!0,gu=!0,mu=[],yu=[],bu=null,wu=Zs,ku={id:"global",global:!0,ref:0,unhandleds:[],onunhandled:ic,pgp:!1,env:{},finalize:function(){this.unhandleds.forEach((function(e){try{ic(e[0],e[1])}catch(e){}}))}},_u=ku,Su=[],xu=0,Eu=[];function Iu(e){if("object"!=typeof this)throw new TypeError("Promises must be constructed via new");this._listeners=[],this.onuncatched=Ys,this._lib=!1;var t=this._PSD=_u;if(Rs&&(this._stackHolder=Ps(),this._prev=null,this._numPrev=0),"function"!=typeof e){if(e!==ru)throw new TypeError("Not a function");return this._state=arguments[1],this._value=arguments[2],void(!1===this._state&&Tu(this,this._value))}this._state=null,this._value=null,++t.ref,Au(this,e)}var Ou={get:function(){var e=_u,t=Ku;function n(n,r){var i=this,o=!e.global&&(e!==_u||t!==Ku);o&&Zu();var a=new Iu((function(t,a){Lu(i,new Cu(nc(n,e,o),nc(r,e,o),t,a,e))}));return Rs&&Mu(a,this),a}return n.prototype=ru,n},set:function(e){us(this,"then",e&&e.prototype===ru?Ou:{get:function(){return e},set:Ou.set})}};function Cu(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 Au(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&&Du();t&&"function"==typeof t.then?Au(e,(function(e,n){t instanceof Iu?t._then(e,n):t.then(e,n)})):(e._state=!0,e._value=t,Ru(e)),n&&ju()}}),Tu.bind(null,e))}catch(t){Tu(e,t)}}function Tu(e,t){if(yu.push(t),null===e._state){var n=e._lib&&Du();t=wu(t),e._state=!1,e._value=t,Rs&&null!==t&&"object"==typeof t&&!t._promise&&ys((function(){var n=function e(t,n){var r;return ls(t,n)||(r=rs(t))&&e(r,n)}(t,"stack");t._promise=e,us(t,"stack",{get:function(){return du?n&&(n.get?n.get.apply(t):n.value):e.stack}})})),function(e){mu.some((function(t){return t._value===e._value}))||mu.push(e)}(e),Ru(e),n&&ju()}}function Ru(e){var t=e._listeners;e._listeners=[];for(var n=0,r=t.length;n<r;++n)Lu(e,t[n]);var i=e._PSD;--i.ref||i.finalize(),0===xu&&(++xu,pu((function(){0==--xu&&Bu()}),[]))}function Lu(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,++xu,pu(Nu,[n,e,t])}else e._listeners.push(t)}function Nu(e,t,n){try{bu=t;var r,i=t._value;t._state?r=e(i):(yu.length&&(yu=[]),r=e(i),-1===yu.indexOf(i)&&function(e){var t=mu.length;for(;t;)if(mu[--t]._value===e._value)return void mu.splice(t,1)}(t)),n.resolve(r)}catch(e){n.reject(e)}finally{bu=null,0==--xu&&Bu(),--n.psd.ref||n.psd.finalize()}}function Mu(e,t){var n=t?t._numPrev+1:0;n<100&&(e._prev=t,e._numPrev=n)}function Pu(){Du()&&ju()}function Du(){var e=vu;return vu=!1,gu=!1,e}function ju(){var e,t,n;do{for(;Su.length>0;)for(e=Su,Su=[],n=e.length,t=0;t<n;++t){var r=e[t];r[0].apply(null,r[1])}}while(Su.length>0);vu=!0,gu=!0}function Bu(){var e=mu;mu=[],e.forEach((function(e){e._PSD.onunhandled.call(null,e._value,e)}));for(var t=Eu.slice(0),n=t.length;n;)t[--n]()}function Uu(e){return new Iu(ru,!1,e)}function Fu(e,t){var n=_u;return function(){var r=Du(),i=_u;try{return Qu(n,!0),e.apply(this,arguments)}catch(e){t&&t(e)}finally{Qu(i,!1),r&&ju()}}}as(Iu.prototype,{then:Ou,_then:function(e,t){Lu(this,new Cu(null,null,e,t,_u))},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):Uu(e)})):this.then(null,(function(e){return e&&e.name===t?n(e):Uu(e)}))},finally:function(e){return this.then((function(t){return e(),t}),(function(t){return e(),Uu(t)}))},stack:{get:function(){if(this._stack)return this._stack;try{du=!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=Ds(s,0)):(o=s,a=""),n.push(o+(a?": "+a:"")+i)}Rs&&((i=Ds(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{du=!1}}},timeout:function(e,t){var n=this;return e<1/0?new Iu((function(r,i){var o=setTimeout((function(){return i(new Ks.Timeout(t))}),e);n.then(r,i).finally(clearTimeout.bind(null,o))})):this}}),"undefined"!=typeof Symbol&&Symbol.toStringTag&&us(Iu.prototype,Symbol.toStringTag,"Promise"),ku.env=ec(),as(Iu,{all:function(){var e=Ts.apply(null,arguments).map(Ju);return new Iu((function(t,n){0===e.length&&t([]);var r=e.length;e.forEach((function(i,o){return Iu.resolve(i).then((function(n){e[o]=n,--r||t(e)}),n)}))}))},resolve:function(e){if(e instanceof Iu)return e;if(e&&"function"==typeof e.then)return new Iu((function(t,n){e.then(t,n)}));var t=new Iu(ru,!0,e);return Mu(t,bu),t},reject:Uu,race:function(){var e=Ts.apply(null,arguments).map(Ju);return new Iu((function(t,n){e.map((function(e){return Iu.resolve(e).then(t,n)}))}))},PSD:{get:function(){return _u},set:function(e){return _u=e}},newPSD:Gu,usePSD:tc,scheduler:{get:function(){return pu},set:function(e){pu=e}},rejectionMapper:{get:function(){return wu},set:function(e){wu=e}},follow:function(e,t){return new Iu((function(n,r){return Gu((function(t,n){var r=_u;r.unhandleds=[],r.onunhandled=n,r.finalize=Xs((function(){var e=this;!function(e){Eu.push((function t(){e(),Eu.splice(Eu.indexOf(t),1)})),++xu,pu((function(){0==--xu&&Bu()}),[])}((function(){0===e.unhandleds.length?t():n(e.unhandleds[0])}))}),r.finalize),e()}),t,n,r)}))}});var zu={awaits:0,echoes:0,id:0},Hu=0,Vu=[],Wu=0,Ku=0,qu=0;function Gu(e,t,n,r){var i=_u,o=Object.create(i);o.parent=i,o.ref=0,o.global=!1,o.id=++qu;var a=ku.env;o.env=hu?{Promise:Iu,PromiseProp:{value:Iu,configurable:!0,writable:!0},all:Iu.all,race:Iu.race,resolve:Iu.resolve,reject:Iu.reject,nthen:rc(a.nthen,o),gthen:rc(a.gthen,o)}:{},t&&ns(o,t),++i.ref,o.finalize=function(){--this.parent.ref||this.parent.finalize()};var s=tc(o,e,n,r);return 0===o.ref&&o.finalize(),s}function Yu(){return zu.id||(zu.id=++Hu),++zu.awaits,zu.echoes+=7,zu.id}function Zu(e){!zu.awaits||e&&e!==zu.id||(0==--zu.awaits&&(zu.id=0),zu.echoes=7*zu.awaits)}function Ju(e){return zu.echoes&&e&&e.constructor===cu?(Yu(),e.then((function(e){return Zu(),e}),(function(e){return Zu(),oc(e)}))):e}function Xu(e){++Ku,zu.echoes&&0!=--zu.echoes||(zu.echoes=zu.id=0),Vu.push(_u),Qu(e,!0)}function $u(){var e=Vu[Vu.length-1];Vu.pop(),Qu(e,!1)}function Qu(e,t){var n,r=_u;if((t?!zu.echoes||Wu++&&e===_u:!Wu||--Wu&&e===_u)||(n=t?Xu.bind(null,e):$u,uu.call(ou,n)),e!==_u&&(_u=e,r===ku&&(ku.env=ec()),hu)){var i=ku.env.Promise,o=e.env;au.then=o.nthen,i.prototype.then=o.gthen,(r.global||e.global)&&(Object.defineProperty(ts,"Promise",o.PromiseProp),i.all=o.all,i.race=o.race,i.resolve=o.resolve,i.reject=o.reject)}}function ec(){var e=ts.Promise;return hu?{Promise:e,PromiseProp:Object.getOwnPropertyDescriptor(ts,"Promise"),all:e.all,race:e.race,resolve:e.resolve,reject:e.reject,nthen:au.then,gthen:e.prototype.then}:{}}function tc(e,t,n,r,i){var o=_u;try{return Qu(e,!0),t(n,r,i)}finally{Qu(o,!1)}}function nc(e,t,n){return"function"!=typeof e?e:function(){var r=_u;n&&Yu(),Qu(t,!0);try{return e.apply(this,arguments)}finally{Qu(r,!1)}}}function rc(e,t){return function(n,r){return e.call(this,nc(n,t,!1),nc(r,t,!1))}}function ic(e,t){var n;try{n=t.onuncatched(e)}catch(e){}if(!1!==n)try{var r,i={promise:t,reason:e};if(ts.document&&document.createEvent?((r=document.createEvent("Event")).initEvent("unhandledrejection",!0,!0),ns(r,i)):ts.CustomEvent&&ns(r=new CustomEvent("unhandledrejection",{detail:i}),i),r&&ts.dispatchEvent&&(dispatchEvent(r),!ts.PromiseRejectionEvent&&ts.onunhandledrejection))try{ts.onunhandledrejection(r)}catch(e){}r.defaultPrevented||console.warn("Unhandled rejection: "+(e.stack||e))}catch(e){}}var oc=Iu.reject;function ac(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=tu),i||(i=Ys);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){Qa(e).forEach((function(t){var n=e[t];if(es(n))o(t,e[t][0],e[t][1]);else{if("asap"!==n)throw new Ks.InvalidArgument("Invalid event config");var r=o(t,Zs,(function(){for(var e=arguments.length,t=new Array(e);e--;)t[e]=arguments[e];r.subscribers.forEach((function(e){vs((function(){e.apply(null,t)}))}))}))}}))}}var sc,uc=String.fromCharCode(65535),cc=function(){try{return IDBKeyRange.only([[]]),[[]]}catch(e){return uc}}(),lc="Invalid key provided. Keys must be of type string, number, Date or Array<string | number | Date>.",hc=[],dc="undefined"!=typeof navigator&&/(MSIE|Trident|Edge)/.test(navigator.userAgent),fc=dc,pc=dc,vc=function(e){return!/(dexie\.js|dexie\.min\.js)/.test(e)};function gc(e,t){var n,r,i,o,a,s=gc.dependencies,u=ns({addons:gc.addons,autoOpen:!0,indexedDB:s.indexedDB,IDBKeyRange:s.IDBKeyRange},t),c=u.addons,l=u.autoOpen,h=u.indexedDB,d=u.IDBKeyRange,f=this._dbSchema={},p=[],v=[],g={},m=null,y=null,b=!1,w=null,k=!1,_="readwrite",S=this,x=new Iu((function(e){n=e})),E=new Iu((function(e,t){r=t})),I=!0,O=!!Oc(h);function C(e){this._cfg={version:e,storesSource:null,dbschema:{},tables:{},contentUpgrade:null},this.stores({})}function A(e,t,n){var r=S._createTransaction(_,v,f);r.create(t),r._completion.catch(n);var i=r._reject.bind(r);Gu((function(){_u.trans=r,0===e?(Qa(f).forEach((function(e){T(t,e,f[e].primKey,f[e].indexes)})),Iu.follow((function(){return S.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 Ks.Upgrade("Dexie specification of currently installed DB version is missing");f=S._dbSchema=i._cfg.dbschema;var o=!1;function a(){return r.length?Iu.resolve(r.shift()(t.idbtrans)).then(a):Iu.resolve()}return p.filter((function(t){return t._cfg.version>e})).forEach((function(e){r.push((function(){var r=f,i=e._cfg.dbschema;J(r,n),J(i,n),f=S._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,u=o.idxByName;for(var c in s)u[c]||a.del.push(c);for(c in u){var l=s[c],h=u[c];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){T(n,e[0],e[1].primKey,e[1].indexes)})),a.change.forEach((function(e){if(e.recreate)throw new Ks.Upgrade("Not yet support for changing primary key");var t=n.objectStore(e.name);e.add.forEach((function(e){R(t,e)})),e.change.forEach((function(e){t.deleteIndex(e.name),R(t,e)})),e.del.forEach((function(e){t.deleteIndex(e)}))})),e._cfg.contentUpgrade)return o=!0,Iu.follow((function(){e._cfg.contentUpgrade(t)}))})),r.push((function(t){o&&fc||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){Qa(e).forEach((function(n){t.db.objectStoreNames.contains(n)||T(t,n,e[n].primKey,e[n].indexes)}))}(f,n)}))}(e,r,t).catch(i)}))}function T(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){R(i,e)})),i}function R(e,t){e.createIndex(t.name,t.keyPath,{unique:t.unique,multiEntry:t.multi})}function L(e,t,n){var r=arguments.length;if(r<2)throw new Ks.InvalidArgument("Too few arguments");for(var i=new Array(r-1);--r;)i[r-1]=arguments[r];n=i.pop();var o=Ss(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:ac(null,{creating:[$s,Ys],reading:[Js,Zs],updating:[eu,Ys],deleting:[Qs,Ys]})}function M(e,t,n){return(n?kc:bc)((function(n){e.push(n),t&&t()}))}function P(e,t,n,r,i){return new Iu((function(o,a){var s=n.length,u=s-1;if(0===s)return o();if(r){var c,l=kc(a),h=yc(null);ys((function(){for(var r=0;r<s;++r){c={onsuccess:null,onerror:null};var a=n[r];i.call(c,a[0],a[1],t);var d=e.delete(a[0]);d._hookCtx=c,d.onerror=l,d.onsuccess=r===u?yc(o):h}}),(function(e){throw c.onerror&&c.onerror(e),e}))}else for(var d=0;d<s;++d){var f=e.delete(n[d]);f.onerror=bc(a),d===u&&(f.onsuccess=Fu((function(){return o()})))}}))}function D(e,t,n,r){var i=this;this.db=S,this.mode=e,this.storeNames=t,this.idbtrans=null,this.on=ac(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 Iu((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(),oc(e)}))}function j(e,t,n){this._ctx={table:e,index:":id"===t?null:t,or:n}}function B(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 U(e,t){return!(e.filter||e.algorithm||e.or)&&(t?e.justLimit:!e.replayFilter)}function F(e,t){return e._cfg.version-t._cfg.version}function z(e,t,n){t.forEach((function(t){var r=n[t];e.forEach((function(e){t in e||(e===D.prototype||e instanceof D?us(e,t,{get:function(){return this.table(t)}}):e[t]=new N(t,r))}))}))}function H(e,t,n,r,i,o){var a=Fu(o?function(e,t,r){return n(o(e),t,r)}:n,i);e.onerror||(e.onerror=bc(i)),e.onsuccess=ms(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 V(e,t){return h.cmp(e,t)}function W(e,t){return V(e,t)>0?e:t}function K(e,t){return h.cmp(e,t)}function q(e,t){return h.cmp(t,e)}function G(e,t){return e<t?-1:e===t?0:1}function Y(e,t){return e>t?-1:e===t?0:1}function Z(e,t){return e?t?function(){return e.apply(this,arguments)&&t.apply(this,arguments)}:e:t}function J(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 u=a.indexNames[s],c=a.index(u).keyPath,l="string"==typeof c?c:"["+ds(c).join("+")+"]";if(e[o]){var h=e[o].idxByName[l];h&&(h.name=u)}}}/Safari/.test(navigator.userAgent)&&!/(Chrome\/|Edge\/)/.test(navigator.userAgent)&&ts.WorkerGlobalScope&&ts instanceof ts.WorkerGlobalScope&&[].concat(navigator.userAgent.match(/Safari\/(\d*)/))[1]<604&&(i=!1)}function X(e){S.on("blocked").fire(e),hc.filter((function(e){return e.name===S.name&&e!==S&&!e._vcFired})).map((function(t){return t.on("versionchange").fire(e)}))}this.version=function(e){if(m||b)throw new Ks.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 C(e),p.push(t),p.sort(F),I=!1,t)},ns(C.prototype,{stores:function(e){this._cfg.storesSource=this._cfg.storesSource?ns(this._cfg.storesSource,e):e;var t={};p.forEach((function(e){ns(t,e._cfg.storesSource)}));var n=this._cfg.dbschema={};return this._parseStoresSpec(t,n),f=S._dbSchema=n,[g,S,D.prototype].forEach((function(e){for(var t in e)e[t]instanceof N&&delete e[t]})),z([g,S,D.prototype,this._cfg.tables],Qa(n),n),v=Qa(n),this},upgrade:function(e){return this._cfg.contentUpgrade=e,this},_parseStoresSpec:function(e,t){Qa(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 xc(n,r||null,/\&/.test(e),/\*/.test(e),/\+\+/.test(e),es(r),/\./.test(e)))})),t}(e[n]),o=i.shift();if(o.multi)throw new Ks.Schema("Primary key cannot be multi-valued");o.keyPath&&ws(r,o.keyPath,o.auto?0:o.keyPath),i.forEach((function(e){if(e.auto)throw new Ks.Schema("Only primary key can be marked as autoIncrement (++)");if(!e.keyPath)throw new Ks.Schema("Index must have a name and cannot be an empty string");ws(r,e.keyPath,e.compound?e.keyPath.map((function(){return""})):"")})),t[n]=new Ec(n,o,i,r)}}))}}),this._allTables=g,this._createTransaction=function(e,t,n,r){return new D(e,t,n,r)},this._whenReady=function(e){return k||_u.letThrough?e():new Iu((function(e,t){if(!b){if(!l)return void t(new Ks.DatabaseClosed);S.open().catch(Ys)}x.then(e,t)})).then(e)},this.verno=0,this.open=function(){if(b||m)return x.then((function(){return y?oc(y):S}));Rs&&(E._stackHolder=Ps()),b=!0,y=null,k=!1;var t=n,r=null;return Iu.race([E,new Iu((function(t,n){if(!h)throw new Ks.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*S.verno));if(!i)throw new Ks.MissingAPI("IndexedDB API not available");i.onerror=bc(n),i.onblocked=Fu(X),i.onupgradeneeded=Fu((function(t){if(r=i.transaction,I&&!S._allowEmptyDB){i.onerror=_c,r.abort(),i.result.close();var o=h.deleteDatabase(e);o.onsuccess=o.onerror=Fu((function(){n(new Ks.NoSuchDatabase("Database "+e+" doesnt exist"))}))}else{r.onerror=bc(n),A((t.oldVersion>Math.pow(2,62)?0:t.oldVersion)/10,r,n)}}),n),i.onsuccess=Fu((function(){if(r=null,m=i.result,hc.push(S),I)!function(){if(S.verno=m.version/10,S._dbSchema=f={},0===(v=ds(m.objectStoreNames,0)).length)return;var e=m.transaction(Ic(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 xc(r,r||"",!1,!1,!!n.autoIncrement,r&&"string"!=typeof r,i),a=[],s=0;s<n.indexNames.length;++s){var u=n.index(n.indexNames[s]);i=(r=u.keyPath)&&"string"==typeof r&&-1!==r.indexOf(".");var c=new xc(u.name,r,!!u.unique,!!u.multiEntry,!1,r&&"string"!=typeof r,i);a.push(c)}f[t]=new Ec(t,o,a,{})})),z([g],Qa(f),f)}();else if(m.objectStoreNames.length>0)try{J(f,m.transaction(Ic(m.objectStoreNames),"readonly"))}catch(e){}m.onversionchange=Fu((function(e){S._vcFired=!0,S.on("versionchange").fire(e)})),O||"__dbnames"===e||sc.dbnames.put({name:e}).catch(Ys),t()}),n)}))]).then((function(){return w=[],Iu.resolve(gc.vip(S.on.ready.fire)).then((function e(){if(w.length>0){var t=w.reduce(nu,Ys);return w=[],Iu.resolve(gc.vip(t)).then(e)}}))})).finally((function(){w=null})).then((function(){return b=!1,S})).catch((function(e){try{r&&r.abort()}catch(e){}return b=!1,S.close(),oc(y=e)})).finally((function(){k=!0,t()}))},this.close=function(){var e=hc.indexOf(S);if(e>=0&&hc.splice(e,1),m){try{m.close()}catch(e){}m=null}l=!1,y=new Ks.DatabaseClosed,b&&r(y),x=new Iu((function(e){n=e})),E=new Iu((function(e,t){r=t}))},this.delete=function(){var t=arguments.length>0;return new Iu((function(n,r){if(t)throw new Ks.InvalidArgument("Arguments not allowed in db.delete()");function i(){S.close();var t=h.deleteDatabase(e);t.onsuccess=Fu((function(){O||sc.dbnames.delete(e).catch(Ys),n()})),t.onerror=bc(r),t.onblocked=X}b?x.then(i):i()}))},this.backendDB=function(){return m},this.isOpen=function(){return null!==m},this.hasBeenClosed=function(){return y&&y instanceof Ks.DatabaseClosed},this.hasFailed=function(){return null!==y},this.dynamicallyOpened=function(){return I},this.name=e,as(this,{tables:{get:function(){return Qa(g).map((function(e){return g[e]}))}}}),this.on=ac(this,"populate","blocked","versionchange",{ready:[nu,Ys]}),this.on.ready.subscribe=fs(this.on.ready.subscribe,(function(e){return function(t,n){gc.vip((function(){k?(y||Iu.resolve().then(t),n&&e(t)):w?(w.push(t),n&&e(t)):(e(t),n||e((function e(){S.on.ready.unsubscribe(t),S.on.ready.unsubscribe(e)})))}))}})),this.transaction=function(){var e=L.apply(this,arguments);return this._transaction.apply(this,e)},this._transaction=function(e,t,n){var r=_u.trans;r&&r.db===S&&-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!=_)throw new Ks.InvalidArgument("Invalid transaction mode: "+e);e=_}if(r){if("readonly"===r.mode&&e===_){if(!i)throw new Ks.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 Ks.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)})):oc(e)}return r?r._promise(e,a,"lock"):_u.trans?tc(_u.transless,(function(){return S._whenReady(a)})):S._whenReady(a);function a(){return Iu.resolve().then((function(){var t,i=_u.transless||_u,a=S._createTransaction(e,o,f,r),s={trans:a,transless:i};r?a.idbtrans=r.idbtrans:a.create(),n.constructor===lu&&Yu();var u=Iu.follow((function(){if(t=n.call(a,a))if(t.constructor===cu){var e=Zu.bind(null,null);t.then(e,e)}else"function"==typeof t.next&&"function"==typeof t.throw&&(t=Sc(t))}),s);return(t&&"function"==typeof t.then?Iu.resolve(t).then((function(e){return a.active?e:oc(new Ks.PrematureCommit("Transaction committed too early. See http://bit.ly/2kdckMn"))})):u.then((function(){return t}))).then((function(e){return r&&a._resolve(),a._completion.then((function(){return e}))})).catch((function(e){return a._reject(e),oc(e)}))}))}},this.table=function(e){if(!os(g,e))throw new Ks.InvalidTable("Table "+e+" does not exist");return g[e]},as(N.prototype,{_trans:function(e,t,n){var r=this._tx||_u.trans;return r&&r.db===S?r===_u.trans?r._promise(e,t,n):Gu((function(){return r._promise(e,t,n)}),{trans:r,transless:_u.transless||_u}):function e(t,n,r){if(k||_u.letThrough){var i=S._createTransaction(t,n,f);try{i.create()}catch(e){return oc(e)}return i._promise(t,(function(e,t){return Gu((function(){return _u.trans=i,r(e,t,i)}))})).then((function(e){return i._completion.then((function(){return e}))}))}if(!b){if(!l)return oc(new Ks.DatabaseClosed);S.open().catch(Ys)}return x.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 Ks.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=bc(r),o.onsuccess=Fu((function(){t(n.hook.reading.fire(o.result))}),r)})).then(t)},where:function(e){if("string"==typeof e)return new j(this,e);if(es(e))return new j(this,"["+e.join("+")+"]");var t=Qa(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&&cc!==uc)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]?Z(t[1],(function(t){return""+bs(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 B(new j(this,es(e)?"["+e.join("+")+"]":e))},toCollection:function(){return new B(new j(this))},mapToClass:function(e,t){this.schema.mappedClass=e;var n=Object.create(e.prototype);t&&mc(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(os(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(gc.defineClass(e),e)},bulkDelete:function(e){return this.hook.deleting.fire===Ys?this._idbstore(_,(function(t,n,r,i){t(P(r,i,e,!1,Ys))})):this.where(":id").anyOf(e).delete().then((function(){}))},bulkPut:function(e,t){var n=this;return this._idbstore(_,(function(r,i,o){if(!o.keyPath&&!n.schema.primKey.auto&&!t)throw new Ks.InvalidArgument("bulkPut() with non-inbound keys requires keys array in second argument");if(o.keyPath&&t)throw new Ks.InvalidArgument("bulkPut(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ks.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return r();var a,s,u=function(e){0===c.length?r(e):i(new Hs(n.name+".bulkPut(): "+c.length+" of "+l+" operations failed",c))},c=[],l=e.length,h=n;if(n.hook.creating.fire===Ys&&n.hook.updating.fire===Ys){s=M(c);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=M(c,u),a.onsuccess=wc(u)}else{var p=t||o.keyPath&&e.map((function(e){return bs(e,o.keyPath)})),v=p&&gs(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(zs,(function(e){c=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(u).catch(Hs,(function(e){c=c.concat(e.failures),u()})).catch(i)}}),"locked")},bulkAdd:function(e,t){var n=this,r=this.hook.creating.fire;return this._idbstore(_,(function(i,o,a,s){if(!a.keyPath&&!n.schema.primKey.auto&&!t)throw new Ks.InvalidArgument("bulkAdd() with non-inbound keys requires keys array in second argument");if(a.keyPath&&t)throw new Ks.InvalidArgument("bulkAdd(): keys argument invalid on tables with inbound keys");if(t&&t.length!==e.length)throw new Ks.InvalidArgument("Arguments objects and keys must have the same length");if(0===e.length)return i();function u(e){0===d.length?i(e):o(new Hs(n.name+".bulkAdd(): "+d.length+" of "+f+" operations failed",d))}var c,l,h,d=[],f=e.length;if(r!==Ys){var p,v=a.keyPath;l=M(d,null,!0),h=yc(null),ys((function(){for(var n=0,i=e.length;n<i;++n){p={onerror:null,onsuccess:null};var o=t&&t[n],u=e[n],d=t?o:v?bs(u,v):void 0,f=r.call(p,d,u,s);null==d&&null!=f&&(v?ws(u=Es(u),v,f):o=f),(c=null!=o?a.add(u,o):a.add(u))._hookCtx=p,n<i-1&&(c.onerror=l,p.onsuccess&&(c.onsuccess=h))}}),(function(e){throw p.onerror&&p.onerror(e),e})),c.onerror=M(d,u,!0),c.onsuccess=yc(u)}else{l=M(d);for(var g=0,m=e.length;g<m;++g)(c=t?a.add(e[g],t[g]):a.add(e[g])).onerror=l;c.onerror=M(d,u),c.onsuccess=wc(u)}}))},add:function(e,t){var n=this.hook.creating.fire;return this._idbstore(_,(function(r,i,o,a){var s={onsuccess:null,onerror:null};if(n!==Ys){var u=null!=t?t:o.keyPath?bs(e,o.keyPath):void 0,c=n.call(s,u,e,a);null==u&&null!=c&&(o.keyPath?ws(e,o.keyPath,c):t=c)}try{var l=null!=t?o.add(e,t):o.add(e);l._hookCtx=s,l.onerror=kc(i),l.onsuccess=yc((function(t){var n=o.keyPath;n&&ws(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!==Ys||i!==Ys){var o=this.schema.primKey.keyPath,a=void 0!==t?t:o&&bs(e,o);return null==a?this.add(e):(e=Es(e),this._trans(_,(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(_,(function(n,r,i){var o=void 0!==t?i.put(e,t):i.put(e);o.onerror=bc(r),o.onsuccess=Fu((function(t){var r=i.keyPath;r&&ws(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(_,(function(t,n,r){var i=r.delete(e);i.onerror=bc(n),i.onsuccess=Fu((function(){t(i.result)}))}))},clear:function(){return this.hook.deleting.subscribers.length?this.toCollection().delete():this._idbstore(_,(function(e,t,n){var r=n.clear();r.onerror=bc(t),r.onsuccess=Fu((function(){e(r.result)}))}))},update:function(e,t){if("object"!=typeof t||es(t))throw new Ks.InvalidArgument("Modifications must be an object.");if("object"!=typeof e||es(e))return this.where(":id").equals(e).modify(t);Qa(t).forEach((function(n){ws(e,n,t[n])}));var n=bs(e,this.schema.primKey.keyPath);return void 0===n?oc(new Ks.InvalidArgument("Given object does not contain its primary key")):this.where(":id").equals(n).modify(t)}}),as(D.prototype,{_lock:function(){return ps(!_u.global),++this._reculock,1!==this._reculock||_u.global||(_u.lockOwnerFor=this),this},_unlock:function(){if(ps(!_u.global),0==--this._reculock)for(_u.global||(_u.lockOwnerFor=null);this._blockedFuncs.length>0&&!this._locked();){var e=this._blockedFuncs.shift();try{tc(e[1],e[0])}catch(e){}}return this},_locked:function(){return this._reculock&&_u.lockOwnerFor!==this},create:function(e){var t=this;if(!this.mode)return this;if(ps(!this.idbtrans),!e&&!m)switch(y&&y.name){case"DatabaseClosedError":throw new Ks.DatabaseClosed(y);case"MissingAPIError":throw new Ks.MissingAPI(y.message,y);default:throw new Ks.OpenFailed(y)}if(!this.active)throw new Ks.TransactionInactive;return ps(null===this._completion._state),(e=this.idbtrans=e||m.transaction(Ic(this.storeNames),this.mode)).onerror=Fu((function(n){_c(n),t._reject(e.error)})),e.onabort=Fu((function(n){_c(n),t.active&&t._reject(new Ks.Abort(e.error)),t.active=!1,t.on("abort").fire(n)})),e.oncomplete=Fu((function(){t.active=!1,t._resolve()})),this},_promise:function(e,t,n){var r=this;if(e===_&&this.mode!==_)return oc(new Ks.ReadOnly("Transaction is readonly"));if(!this.active)return oc(new Ks.TransactionInactive);if(this._locked())return new Iu((function(i,o){r._blockedFuncs.push([function(){r._promise(e,t,n).then(i,o)},_u])}));if(n)return Gu((function(){var e=new Iu((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 Iu((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=Iu.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 Iu((function(n,i){e.then((function(e){return t._waitingQueue.push(Fu(n.bind(null,e)))}),(function(e){return t._waitingQueue.push(Fu(i.bind(null,e)))})).finally((function(){t._waitingFor===r&&(t._waitingFor=null)}))}))},abort:function(){this.active&&this._reject(new Ks.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. "+Ds(Ps(),1)),a.apply(this,arguments)})},table:function(e){return new N(e,S.table(e).schema,this)}}),as(j.prototype,(function(){function e(e,t,n){var r=e instanceof j?new B(e):e;return r._ctx.error=n?new n(t):new TypeError(t),r}function t(e){return new B(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,u=0;u<a;++u){var c=t[u];if(c!==r[u])return i(e[u],n[u])<0?e.substr(0,u)+n[u]+n.substr(u+1):i(e[u],r[u])<0?e.substr(0,u)+r[u]+n.substr(u+1):s>=0?e.substr(0,s)+t[s]+n.substr(s+1):null;i(e[u],c)<0&&(s=u)}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,u,c,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),u="next"===e?G:Y;var t=i.map((function(e){return{lower:s(e),upper:a(e)}})).sort((function(e,t){return u(e.lower,t.lower)}));c=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 B(t,(function(){return d.bound(c[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,c[v],l[v],u,h);null===g&&null===d?m=v+1:(null===d||u(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 V(n,r)>0||0===V(n,r)&&(i||o)&&(!i||!o)?t(this):new B(this,(function(){return d.bound(n,r,!i,!o)}))}catch(t){return e(this,lc)}},equals:function(e){return new B(this,(function(){return d.only(e)}))},above:function(e){return new B(this,(function(){return d.lowerBound(e,!0)}))},aboveOrEqual:function(e){return new B(this,(function(){return d.lowerBound(e)}))},below:function(e){return new B(this,(function(){return d.upperBound(e,!0)}))},belowOrEqual:function(e){return new B(this,(function(){return d.upperBound(e)}))},startsWith:function(t){return"string"!=typeof t?e(this,"String expected."):this.between(t,t+uc,!0,!0)},startsWithIgnoreCase:function(e){return""===e?this.startsWith(e):r(this,(function(e,t){return 0===e.indexOf(t[0])}),[e],uc)},equalsIgnoreCase:function(e){return r(this,(function(e,t){return e===t[0]}),[e],"")},anyOfIgnoreCase:function(){var e=Ts.apply(As,arguments);return 0===e.length?t(this):r(this,(function(e,t){return-1!==t.indexOf(e)}),e,"")},startsWithAnyOfIgnoreCase:function(){var e=Ts.apply(As,arguments);return 0===e.length?t(this):r(this,(function(e,t){return t.some((function(t){return 0===e.indexOf(t)}))}),e,uc)},anyOf:function(){var n=Ts.apply(As,arguments),r=K;try{n.sort(r)}catch(t){return e(this,lc)}if(0===n.length)return t(this);var i=new B(this,(function(){return d.bound(n[0],n[n.length-1])}));i._ondirectionchange=function(e){r="next"===e?K:q,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,cc]],{includeLowers:!1,includeUppers:!1})},noneOf:function(){var t=Ts.apply(As,arguments);if(0===t.length)return new B(this);try{t.sort(K)}catch(t){return e(this,lc)}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],cc]),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]&&K(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",Ks.InvalidArgument);var i=!r||!1!==r.includeLowers,o=r&&!0===r.includeUppers;var a,s=K;function u(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(V(t[0],i[1])<0&&V(t[1],i[0])>0){i[0]=(o=i[0],a=t[0],V(o,a)<0?o:a),i[1]=W(i[1],t[1]);break}}var o,a;return n===r&&e.push(t),e}),[])).sort(u)}catch(t){return e(this,lc)}var c=0,l=o?function(e){return K(e,a[c][1])>0}:function(e){return K(e,a[c][1])>=0},h=i?function(e){return q(e,a[c][0])>0}:function(e){return q(e,a[c][0])>=0};var f=l,p=new B(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=K):(f=h,s=q),a.sort(u)},p._addAlgorithm((function(e,t,n){for(var r=e.key;f(r);)if(++c===a.length)return t(n),!1;return!!function(e){return!l(e)&&!h(e)}(r)||(0===V(r,a[c][1])||0===V(r,a[c][0])||t((function(){s===K?e.continue(a[c][0]):e.continue(a[c][1])})),!1)})),p},startsWithAnyOf:function(){var n=Ts.apply(As,arguments);return n.every((function(e){return"string"==typeof e}))?0===n.length?t(this):this.inAnyRange(n.map((function(e){return[e,e+uc]}))):e(this,"startsWithAnyOf() only works with strings")}}})),as(B.prototype,(function(){function e(e,t){e.filter=Z(e.filter,t)}function t(e,t,n){var r=e.replayFilter;e.replayFilter=r?function(){return Z(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 Ks.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?Z(e.filter,e.replayFilter()):e.filter;e.or?function(){var s={},u=0;function c(){2==++u&&n()}function l(e,n,r){if(!a||a(n,r,c,i)){var o=n.primaryKey,u=""+o;"[object ArrayBuffer]"===u&&(u=""+new Uint8Array(o)),os(s,u)||(s[u]=!0,t(e,n,r))}}e.or._iterate(l,c,i,o),H(r(e,o),e.algorithm,l,c,i,!e.keysOnly&&e.valueMapper)}():H(r(e,o),Z(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,oc.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,oc.bind(null,t.error)):t.table._idbstore(_,e,"locked")},_addAlgorithm:function(e){var t=this._ctx;t.algorithm=Z(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&&ns(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(U(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=bc(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&&U(t,!0)&&t.limit>0){var s=t.table.hook.reading.fire,u=n(t,a),c=t.limit<1/0?u.getAll(t.range,t.limit):u.getAll(t.range);c.onerror=bc(r),c.onsuccess=wc(s===Zs?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,U(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=Z(e.isMatch,t)}(this._ctx,t),this},and:function(e){return this.filter(e)},or:function(e){return new j(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&&U(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=bc(r),a.onsuccess=wc(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=os(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 u;if("function"==typeof e)u=r===Ys&&i===Ys?e:function(t){var n=Es(t);if(!1===e.call(this,t,this))return!1;if(os(this,"value")){var o=Is(n,this.value),a=r.call(this,o,this.primKey,n,s);a&&(t=this.value,Qa(a).forEach((function(e){ws(t,e,a[e])})))}else i.call(this,this.primKey,t,s)};else if(r===Ys){var c=Qa(e),l=c.length;u=function(t){for(var n=!1,r=0;r<l;++r){var i=c[r],o=e[i];bs(t,i)!==o&&(ws(t,i,o),n=!0)}return n}}else{var h=e;e=ks(h),u=function(t){var n=!1,i=r.call(this,e,this.primKey,Es(t),s);return i&&ns(e,i),Qa(e).forEach((function(r){var i=e[r];bs(t,r)!==i&&(ws(t,r,i),n=!0)})),i&&(e=ks(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 zs("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!==u.call(n,e,n)){var i=!os(n,"value");++d,ys((function(){var e=i?t.delete():t.update(n.value);e._hookCtx=n,e.onerror=kc(r),e.onsuccess=yc((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!==Ys;if(!i&&U(t)&&(t.isPrimKey&&!pc||!n))return this._write((function(e,t,r){var i=bc(t),o=n?r.count(n):r.count();o.onerror=i,o.onsuccess=function(){var a=o.result;ys((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,u){var c=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 K(e[0],t[0])})):h.sort(K),P(s,u,h,i,r)})).then((function(){var e=h.length;return c+=e,h=[],e<o?c:d()}))};n(d())}))}}})),ns(this,{Collection:B,Table:N,Transaction:D,Version:C,WhereClause:j}),S.on("versionchange",(function(e){e.newVersion>0?console.warn("Another connection wants to upgrade database '"+S.name+"'. Closing db now to resume the upgrade."):console.warn("Another connection wants to delete database '"+S.name+"'. Closing db now to resume the delete request."),S.close()})),S.on("blocked",(function(e){!e.newVersion||e.newVersion<e.oldVersion?console.warn("Dexie.delete('"+S.name+"') was blocked"):console.warn("Upgrade '"+S.name+"' blocked by other connection holding version "+e.oldVersion/10)})),c.forEach((function(e){e(S)}))}function mc(e,t){return Qa(t).forEach((function(n){var r=function e(t){if("function"==typeof t)return new t;if(es(t))return[e(t[0])];if(t&&"object"==typeof t){var n={};return mc(n,t),n}return t}(t[n]);e[n]=r})),e}function yc(e){return Fu((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 bc(e){return Fu((function(t){return _c(t),e(t.target.error),!1}))}function wc(e){return Fu((function(t){e(t.target.result)}))}function kc(e){return Fu((function(t){var n=t.target,r=n.error,i=n._hookCtx,o=i&&i.onerror;return o&&o(r),_c(t),e(r),!1}))}function _c(e){e.stopPropagation&&e.stopPropagation(),e.preventDefault&&e.preventDefault()}function Sc(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):es(o)?Iu.all(o).then(n,r):n(o)}}return i(t)()}function xc(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 Ec(e,t,n,r){this.name=e,this.primKey=t||new xc,this.indexes=n||[new xc],this.instanceTemplate=r,this.mappedClass=null,this.idxByName=gs(n,(function(e){return[e.name,e]}))}function Ic(e){return 1===e.length?e[0]:e}function Oc(e){var t=e&&(e.getDatabaseNames||e.webkitGetDatabaseNames);return t&&t.bind(e)}Ls(Rs,vc),as(gc,Gs),as(gc,{delete:function(e){var t=new gc(e),n=t.delete();return n.onblocked=function(e){return t.on("blocked",e),this},n},exists:function(e){return new gc(e).open().then((function(e){return e.close(),!0})).catch(gc.NoSuchDatabaseError,(function(){return!1}))},getDatabaseNames:function(e){var t=Oc(gc.dependencies.indexedDB);return t?new Iu((function(e,n){var r=t();r.onsuccess=function(t){e(ds(t.target.result,0))},r.onerror=bc(n)})).then(e):sc.dbnames.toCollection().primaryKeys(e)},defineClass:function(){return function(e){e&&ns(this,e)}},applyStructure:mc,ignoreTransaction:function(e){return _u.trans?tc(_u.transless,e):e()},vip:function(e){return Gu((function(){return _u.letThrough=!0,e()}))},async:function(e){return function(){try{var t=Sc(e.apply(this,arguments));return t&&"function"==typeof t.then?t:Iu.resolve(t)}catch(e){return oc(e)}}},spawn:function(e,t,n){try{var r=Sc(e.apply(n,t||[]));return r&&"function"==typeof r.then?r:Iu.resolve(r)}catch(e){return oc(e)}},currentTransaction:{get:function(){return _u.trans||null}},waitFor:function(e,t){var n=Iu.resolve("function"==typeof e?gc.ignoreTransaction(e):e).timeout(t||6e4);return _u.trans?_u.trans.waitFor(n):n},Promise:Iu,debug:{get:function(){return Rs},set:function(e){Ls(e,"dexie"===e?function(){return!0}:vc)}},derive:cs,extend:ns,props:as,override:fs,Events:ac,getByKeyPath:bs,setByKeyPath:ws,delByKeyPath:function(e,t){"string"==typeof t?ws(e,t,void 0):"length"in t&&[].map.call(t,(function(t){ws(e,t,void 0)}))},shallowClone:ks,deepClone:Es,getObjectDiff:Is,asap:vs,maxKey:cc,minKey:-1/0,addons:[],connections:hc,MultiModifyError:Ks.Modify,errnames:Vs,IndexSpec:xc,TableSchema:Ec,dependencies:function(){try{return{indexedDB:ts.indexedDB||ts.mozIndexedDB||ts.webkitIndexedDB||ts.msIndexedDB,IDBKeyRange:ts.IDBKeyRange||ts.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:gc,Dexie:gc}),Iu.rejectionMapper=function(e,t){if(!e||e instanceof Fs||e instanceof TypeError||e instanceof SyntaxError||!e.name||!qs[e.name])return e;var n=new qs[e.name](t||e.message,e);return"stack"in e&&us(n,"stack",{get:function(){return this.inner.stack}}),n},(sc=new gc("__dbnames")).version(1).stores({dbnames:"name"}),function(){try{void 0!==typeof localStorage&&void 0!==ts.document&&(JSON.parse(localStorage.getItem("Dexie.DatabaseNames")||"[]").forEach((function(e){return sc.dbnames.put({name:e}).catch(Ys)})),localStorage.removeItem("Dexie.DatabaseNames"))}catch(e){}}();var Cc={storage:window.localStorage,set:function(e,t){if(t){var n=Ac(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=hi(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()}}},Ac=function(e){if(e){var t=Object.prototype.toString.call(e);return"[object Object]"===t||"[object Array]"===t?JSON.stringify(e):e}};function Tc(e,t,n,r){return new(n||(n=Promise))((function(i,o){function a(e){try{u(r.next(e))}catch(e){o(e)}}function s(e){try{u(r.throw(e))}catch(e){o(e)}}function u(e){var t;e.done?i(e.value):(t=e.value,t instanceof n?t:new n((function(e){e(t)}))).then(a,s)}u((r=r.apply(e,t||[])).next())}))}function Rc(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 Lc(e){return[e.schema.primKey].concat(e.schema.indexes).map((function(e){return e.src})).join(",")}function Nc(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 Mc(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 Pc="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function Dc(e,t){return e(t={exports:{}},t.exports),t.exports}for(var jc=Dc((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,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(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=_(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 k=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),S(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return k(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 _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=C("",c,S,l||{},_);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 _.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),u=s[0],c=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=C(u,i,c,l,o,!0,p),g=h(v,w);return u&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(u?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(E,_)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(E)]:m?I(E):Promise.resolve(I(E));function O(e,t,n){Object.assign(e,t);var r=u.map((function(t){var n=e[t];return delete e[t],n}));n(),u.forEach((function(t,n){e[t]=r[n]}))}function C(t,i,a,s,u,c,l){var f=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var n=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:h(i,w)},void 0!==n?{type:n}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(f=A(t,i,s,u,!1,c,S))!==i&&(m={replaced:f}):f=i,S&&S(),f;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var I=d(i),T=r(i),R=(I||T)&&(!o.length||s.replaced)||s.iterateIn?i:A(t,i,s,u,I||T,null,S),L=void 0;if(R!==i?(f=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):I||"object"===s.iterateIn?m={clone:L={}}:""===t&&h(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,S&&S(),v.iterateNone)return L||f;if(!L)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};O(s,n,(function(){var n=t+(t?".":"")+g(e),r=C(n,i[e],!!a,s,u,c);h(r,w)?u.push([n,r,!!a,s,L,e,s.type]):void 0!==r&&(L[e]=r)}))};for(var M in i)N(M);S&&S({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);O(s,{ownKeys:!0},(function(){var t=C(n,i[e],!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,D=function(e){if(!(e in i)){var n=t+(t?".":"")+e;O(s,{ownKeys:!1},(function(){var t=C(n,void 0,!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},j=0;j<P;j++)D(j);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function A(e,t,n,r,i,u,c){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?(c&&c({replacing:!0}),C(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),S&&"readonly",n,r,u,f)):(c&&c({typeDetected:!0}),C(e,t,S&&"readonly",n,r,u,f))}}return t}};this.encapsulateSync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&d(u.$)&&(e=e.$,u=u.$,l=!1);var f=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(r(o)||d(o)){var k=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);h(n,b)?k[t]=void 0:void 0!==n&&(k[t]=n)})),o=k;f.length;){var _=t(f[0],4),S=_[0],x=_[1],E=_[2],I=_[3],O=y(S,x);if(h(O,b))E[I]=void 0;else{if(void 0===O)break;E[I]=O}f.splice(0,1)}}if(!w)return o;if("#"===w){var C=y(a,o.substr(1));return void 0===C&&f.push([a,o.substr(1),v,m]),C}var A=c.sync;return[].concat(w).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[A&&n.revive?"revive":!A&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(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 S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(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],u=n.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[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 w(e){this.p=new Promise(e)}return w.prototype.then=function(e,t){var n=this;return new w((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)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,n){n(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,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}()})),Bc=Dc((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,u=["type","replaced","iterateIn","iterateUnsetNumeric"];function c(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=_(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 k=this.parse=function(e,t,n){return n=Object.assign({},i,n,{parse:!0}),S(JSON.parse(e,t),n)};this.parseSync=function(e,t,n){return k(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.parseAsync=function(e,t,n){return k(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 _=this.encapsulate=function(c,l,v){var m=(v=Object.assign({sync:!0},i,v)).sync,y={},b=[],k=[],_=[],S=!(v&&"cyclic"in v)||v.cyclic,x=v.encapsulateObserver,E=C("",c,S,l||{},_);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 _.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),u=s[0],c=s[2],l=s[3],d=s[4],f=s[5],p=s[6],v=C(u,i,c,l,o,!0,p),g=h(v,w);return u&&g?v.p.then((function(t){return d[f]=t,e(n,o)})):(u?d[f]=v:n=g?v.p:v,e(n,o))})))})).then((function(){return n}))}(E,_)).then(I):!m&&v.throwOnBadSyncType?function(){throw new TypeError("Async method requested but sync result obtained")}():v.stringification&&m?[I(E)]:m?I(E):Promise.resolve(I(E));function O(e,t,n){Object.assign(e,t);var r=u.map((function(t){var n=e[t];return delete e[t],n}));n(),u.forEach((function(t,n){e[t]=r[n]}))}function C(t,i,a,s,u,c,l){var f=void 0,m={},_=void 0===i?"undefined":e(i),S=x?function(e){var n=l||s.type||p.getJSONType(i);x(Object.assign(e||m,{keypath:t,value:i,cyclic:a,stateObj:s,promisesData:u,resolvingTypesonPromise:c,awaitingTypesonPromise:h(i,w)},void 0!==n?{type:n}:{}))}:null;if(_ in{string:1,boolean:1,number:1,undefined:1})return void 0===i||"number"===_&&(isNaN(i)||i===-1/0||i===1/0)?(f=A(t,i,s,u,!1,c,S))!==i&&(m={replaced:f}):f=i,S&&S(),f;if(null===i)return S&&S(),i;if(a&&!s.iterateIn&&!s.iterateUnsetNumeric){var E=b.indexOf(i);if(!(E<0))return y[t]="#",S&&S({cyclicKeypath:k[E]}),"#"+k[E];!0===a&&(b.push(i),k.push(t))}var I=d(i),T=r(i),R=(I||T)&&(!o.length||s.replaced)||s.iterateIn?i:A(t,i,s,u,I||T,null,S),L=void 0;if(R!==i?(f=R,m={replaced:R}):T||"array"===s.iterateIn?(L=new Array(i.length),m={clone:L}):I||"object"===s.iterateIn?m={clone:L={}}:""===t&&h(i,w)?(u.push([t,i,a,s,void 0,void 0,s.type]),f=i):f=i,S&&S(),v.iterateNone)return L||f;if(!L)return f;if(s.iterateIn){var N=function(e){var n={ownKeys:i.hasOwnProperty(e)};O(s,n,(function(){var n=t+(t?".":"")+g(e),r=C(n,i[e],!!a,s,u,c);h(r,w)?u.push([n,r,!!a,s,L,e,s.type]):void 0!==r&&(L[e]=r)}))};for(var M in i)N(M);S&&S({endIterateIn:!0,end:!0})}else n(i).forEach((function(e){var n=t+(t?".":"")+g(e);O(s,{ownKeys:!0},(function(){var t=C(n,i[e],!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))})),S&&S({endIterateOwn:!0,end:!0});if(s.iterateUnsetNumeric){for(var P=i.length,D=function(e){if(!(e in i)){var n=t+(t?".":"")+e;O(s,{ownKeys:!1},(function(){var t=C(n,void 0,!!a,s,u,c);h(t,w)?u.push([n,t,!!a,s,L,e,s.type]):void 0!==t&&(L[e]=t)}))}},j=0;j<P;j++)D(j);S&&S({endIterateUnsetNumeric:!0,end:!0})}return L}function A(e,t,n,r,i,u,c){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?(c&&c({replacing:!0}),C(e,d[m||!d.replaceAsync?"replace":"replaceAsync"](t,n),S&&"readonly",n,r,u,f)):(c&&c({typeDetected:!0}),C(e,t,S&&"readonly",n,r,u,f))}}return t}};this.encapsulateSync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!0}))},this.encapsulateAsync=function(e,t,n){return _(e,t,Object.assign({},{throwOnBadSyncType:!0},n,{sync:!1}))};var S=this.revive=function(e,o){var a=(o=Object.assign({sync:!0},i,o)).sync,u=e&&e.$types,l=!0;if(!u)return e;if(!0===u)return e.$;u.$&&d(u.$)&&(e=e.$,u=u.$,l=!1);var f=[],p={},v=function e(i,o,a,c,v,m){if(!l||"$types"!==i){var w=u[i];if(r(o)||d(o)){var k=r(o)?new Array(o.length):{};for(n(o).forEach((function(t){var n=e(i+(i?".":"")+g(t),o[t],a||k,c,k,t);h(n,b)?k[t]=void 0:void 0!==n&&(k[t]=n)})),o=k;f.length;){var _=t(f[0],4),S=_[0],x=_[1],E=_[2],I=_[3],O=y(S,x);if(h(O,b))E[I]=void 0;else{if(void 0===O)break;E[I]=O}f.splice(0,1)}}if(!w)return o;if("#"===w){var C=y(a,o.substr(1));return void 0===C&&f.push([a,o.substr(1),v,m]),C}var A=c.sync;return[].concat(w).reduce((function(e,t){var n=s[t];if(!n)throw new Error("Unregistered type: "+t);return n[A&&n.revive?"revive":!A&&n.reviveAsync?"reviveAsync":"revive"](e,p)}),o)}}("",e,null,o);return c(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 S(e,Object.assign({},{throwOnBadSyncType:!0},t,{sync:!0}))},this.reviveAsync=function(e,t){return S(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],u=n.testPlainObjects?o:a,c=u.filter((function(t){return t.type===e}));if(c.length&&(u.splice(u.indexOf(c[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 w(e){this.p=new Promise(e)}w.prototype.then=function(e,t){var n=this;return new w((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)}))}))},w.prototype.catch=function(e){return this.then(null,e)},w.resolve=function(e){return new w((function(t){t(e)}))},w.reject=function(e){return new w((function(t,n){n(e)}))},["all","race"].map((function(e){w[e]=function(t){return new w((function(n,r){Promise[e](t.map((function(e){return e.p}))).then(n,r)}))}})),p.Undefined=b,p.Promise=w,p.isThenable=c,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 k={userObject:{test:function(e,t){return p.isUserObject(e)},replace:function(e){return Object.assign({},e)},revive:function(e){return e}}},_=[[{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}}}],S={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)}}},x=[{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}}}],E={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)}}},O={map:{test:function(e){return"Map"===p.toStringTag(e)},replace:function(e){return Array.from(e.entries())},revive:function(e){return new Map(e)}}},C={set:{test:function(e){return"Set"===p.toStringTag(e)},replace:function(e){return Array.from(e.values())},revive:function(e){return new Set(e)}}},A="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=new Uint8Array(256),R=0;R<A.length;R++)T[A.charCodeAt(R)]=R;var L=function(e,t,n){for(var r=new Uint8Array(e,t,n),i=r.length,o="",a=0;a<i;a+=3)o+=A[r[a]>>2],o+=A[(3&r[a])<<4|r[a+1]>>4],o+=A[(15&r[a+1])<<2|r[a+2]>>6],o+=A[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 u=new ArrayBuffer(n),c=new Uint8Array(u),l=0;l<t;l+=4)i=T[e.charCodeAt(l)],o=T[e.charCodeAt(l+1)],a=T[e.charCodeAt(l+2)],s=T[e.charCodeAt(l+3)],c[r++]=i<<2|o>>4,c[r++]=(15&o)<<4|a>>2,c[r++]=(3&a)<<6|63&s;return u},M={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),L(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?Pc:self,D={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=P[t];n&&(D[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:L(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 j={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:L(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)}}},B={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 U(e){for(var t=new Uint16Array(e.length),n=0;n<e.length;n++)t[n]=e.charCodeAt(n);return t.buffer}var F={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=U(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[k,_,S,x,E,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)}}},F,{file:F.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([U(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?O:[],"function"==typeof Set?C:[],"function"==typeof ArrayBuffer?M:[],"function"==typeof Uint8Array?D:[],"function"==typeof DataView?j:[],"undefined"!=typeof Intl?B:[])}()})),Uc="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",Fc=new Uint8Array(256),zc=0;zc<Uc.length;zc++)Fc[Uc.charCodeAt(zc)]=zc;var Hc=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+=Uc[r[a]>>2],o+=Uc[(3&r[a])<<4|r[a+1]>>4],o+=Uc[(15&r[a+1])<<2|r[a+2]>>6],o+=Uc[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},Vc=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 u=new ArrayBuffer(a),c=new Uint8Array(u),l=0;l<o;l+=4)t=Fc[e.charCodeAt(l)],n=Fc[e.charCodeAt(l+1)],r=Fc[e.charCodeAt(l+2)],i=Fc[e.charCodeAt(l+3)],c[s++]=t<<2|n>>4,c[s++]=(15&n)<<4|r>>2,c[s++]=(3&r)<<6|63&i;return u},Wc="undefined"==typeof self?global:self,Kc={};["Int8Array","Uint8Array","Uint8ClampedArray","Int16Array","Uint16Array","Int32Array","Uint32Array","Float32Array","Float64Array"].forEach((function(e){var t=e,n=Wc[t];n&&(Kc[e.toLowerCase()+"2"]={test:function(e){return jc.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 qc={arraybuffer:{test:function(e){return"ArrayBuffer"===jc.toStringTag(e)},replace:function(e){return Hc(e,0,e.byteLength)},revive:function(e){return Vc(e)}}},Gc=(new jc).register(Bc),Yc="FileReaderSync"in self,Zc=[],Jc=0;Gc.register([qc,Kc,{blob2:{test:function(e){return"Blob"===jc.toStringTag(e)},replace:function(e){if(e.isClosed)throw new Error("The Blob is closed");if(Yc){var t=Mc(e,"binary"),n=Hc(t,0,t.byteLength);return{type:e.type,data:n}}Zc.push(e);var r={type:e.type,data:{start:Jc,end:Jc+e.size}};return console.log("b.size: "+e.size),Jc+=e.size,r},finalize:function(e,t){e.data=Hc(t,0,t.byteLength)},revive:function(e){var t=e.type,n=e.data;return new Blob([Vc(n)],{type:t})}}}]),Gc.mustFinalize=function(){return Zc.length>0},Gc.finalize=function(e){return Tc(void 0,void 0,void 0,(function(){var t,n,r,i,o,a,s,u,c,l;return Rc(this,(function(h){switch(h.label){case 0:return[4,Nc(new Blob(Zc),"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)u=o[s],(c=Gc.types[u])&&c.finalize&&(l=gc.getByKeyPath(i,a?"$."+s:s),c.finalize(l,t.slice(l.start,l.end)));return Zc=[],[2]}}))}))};function Xc(e,t){return Tc(this,void 0,void 0,(function(){function n(){return Tc(this,void 0,void 0,(function(){var n,c,l,h,d,f,p,v,g;return Rc(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})),u.totalRows=n.reduce((function(e,t){return e+t})),c=JSON.stringify(a,void 0,o?2:void 0),l=c.lastIndexOf("]"),h=c.substring(0,l),r.push(h),d=t.filter,f=function(n){var i,a,c,l,h,f,p,v,g,m,y;return Rc(this,(function(b){switch(b.label){case 0:i=e.table(n),a=i.schema.primKey,c=!!a.keyPath,l=t.numRowsPerChunk||2e3,h=c?{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,w;return Rc(this,(function(k){switch(k.label){case 0:return s&&gc.ignoreTransaction((function(){return s(u)})),[4,(e=null==v?i.limit(l):i.where(":id").above(v).limit(l)).toArray()];case 1:return 0===(t=k.sent()).length?[2,"break"]:(null!=v&&g>0&&(r.push(","),o&&r.push("\n ")),m=t.length===l,c?(h=d?t.filter((function(e){return d(n,e)})):t,f=h.map((function(e){return Gc.encapsulate(e)})),Gc.mustFinalize()?[4,gc.waitFor(Gc.finalize(f))]:[3,3]):[3,4]);case 2:k.sent(),k.label=3;case 3:return w=JSON.stringify(f,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),r.push(new Blob([w.substring(1,w.length-1)])),g=h.length,v=t.length>0?gc.getByKeyPath(t[t.length-1],a.keyPath):null,[3,8];case 4:return[4,e.primaryKeys()];case 5:return p=k.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 Gc.encapsulate(e)})),Gc.mustFinalize()?[4,gc.waitFor(Gc.finalize(b))]:[3,7];case 6:k.sent(),k.label=7;case 7:w=JSON.stringify(b,void 0,o?2:void 0),o&&(w=w.split("\n").join("\n ")),r.push(new Blob([w.substring(1,w.length-1)])),g=y.length,v=p.length>0?p[p.length-1]:null,k.label=8;case 8:return u.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)),u.completedTables+=1,u.completedTables<u.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(c.substr(l)),u.done=!0,s&&gc.ignoreTransaction((function(){return s(u)})),[2]}}))}))}var r,i,o,a,s,u;return Rc(this,(function(c){switch(c.label){case 0:t=t||{},r=[],i=e.tables.map((function(e){return{name:e.name,schema:Lc(e),rowCount:0}})),o=t.prettyJson,a={formatName:"dexie",formatVersion:1,data:{databaseName:e.name,databaseVersion:e.verno,tables:i,data:[]}},s=t.progressCallback,u={done:!1,completedRows:0,completedTables:0,totalRows:NaN,totalTables:e.tables.length},c.label=1;case 1:return c.trys.push([1,,6,7]),t.noTransaction?[4,n()]:[3,3];case 2:return c.sent(),[3,5];case 3:return[4,e.transaction("r",e.tables,n)];case 4:c.sent(),c.label=5;case 5:return[3,7];case 6:return Gc.finalize(),[7];case 7:return s&&gc.ignoreTransaction((function(){return s(u)})),[2,new Blob(r,{type:"text/json"})]}}))}))}var $c=function(){},Qc=Dc((function(e,t){!function(e){var t="object"==typeof process&&process.env?process.env:self;e.parser=function(e){return new j(e)},e.CParser=j,e.CStream=B,e.createStream=function(e){return new B(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,u=10,c=13,l=32,h=34,d=43,f=44,p=45,v=46,g=48,m=57,y=58,b=69,w=91,k=92,_=93,S=97,x=98,E=101,I=102,O=108,C=110,A=114,T=115,R=116,L=117,N=123,M=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 D=/[\\"\n]/g;function j(t){if(!(this instanceof j))return new j(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,U(this,"onready")}j.prototype={end:function(){W(this)},write:function(t){if(this.error)throw this.error;if(this.closed)return V(this,"Cannot write after close. Assign an onready handler.");if(null===t)return W(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===u?(this.line++,this.column=0):this.column++,this.state){case o.BEGIN:i===N?this.state=o.OPEN_OBJECT:i===w?this.state=o.OPEN_ARRAY:K(i)||V(this,"Non-whitespace before {[.");continue;case o.OPEN_KEY:case o.OPEN_OBJECT:if(K(i))continue;if(this.state===o.OPEN_KEY)this.stack.push(o.CLOSE_KEY);else{if(i===M){U(this,"onopenobject"),this.depth++,U(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE;continue}this.stack.push(o.CLOSE_OBJECT)}i===h?this.state=o.STRING:V(this,'Malformed object key should start with "');continue;case o.CLOSE_KEY:case o.CLOSE_OBJECT:if(K(i))continue;this.state,o.CLOSE_KEY,i===y?(this.state===o.CLOSE_OBJECT?(this.stack.push(o.CLOSE_OBJECT),z(this,"onopenobject"),this.depth++):z(this,"onkey"),this.state=o.VALUE):i===M?(F(this,"oncloseobject"),this.depth--,this.state=this.stack.pop()||o.VALUE):i===f?(this.state===o.CLOSE_OBJECT&&this.stack.push(o.CLOSE_OBJECT),z(this),this.state=o.OPEN_KEY):V(this,"Bad object");continue;case o.OPEN_ARRAY:case o.VALUE:if(K(i))continue;if(this.state===o.OPEN_ARRAY){if(U(this,"onopenarray"),this.depth++,this.state=o.VALUE,i===_){U(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===w?this.state=o.OPEN_ARRAY:i===R?this.state=o.TRUE:i===I?this.state=o.FALSE:i===C?this.state=o.NULL:i===p?this.numberNode+="-":g<=i&&i<=m?(this.numberNode+=String.fromCharCode(i),this.state=o.NUMBER_DIGIT):V(this,"Bad value");continue;case o.CLOSE_ARRAY:if(i===f)this.stack.push(o.CLOSE_ARRAY),z(this,"onvalue"),this.state=o.VALUE;else if(i===_)F(this,"onclosearray"),this.depth--,this.state=this.stack.pop()||o.VALUE;else{if(K(i))continue;V(this,"Bad array")}continue;case o.STRING:void 0===this.textNode&&(this.textNode="");var s=n-1,c=this.slashed,l=this.unicodeI;e:for(;;){for(e.DEBUG&&console.log(n,i,e.STATE[this.state],c);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&&!c){this.state=this.stack.pop()||o.VALUE,this.textNode+=t.substring(s,n-1),this.position+=n-1-s;break}if(i===k&&!c&&(c=!0,this.textNode+=t.substring(s,n-1),this.position+=n-1-s,i=t.charCodeAt(n++),this.position++,!i))break;if(c){if(c=!1,i===C?this.textNode+="\n":i===A?this.textNode+="\r":i===R?this.textNode+="\t":i===I?this.textNode+="\f":i===x?this.textNode+="\b":i===L?(l=1,this.unicodeS=""):this.textNode+=String.fromCharCode(i),i=t.charCodeAt(n++),this.position++,s=n-1,i)continue;break}D.lastIndex=n;var P=D.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=c,this.unicodeI=l;continue;case o.TRUE:i===A?this.state=o.TRUE2:V(this,"Invalid true started with t"+i);continue;case o.TRUE2:i===L?this.state=o.TRUE3:V(this,"Invalid true started with tr"+i);continue;case o.TRUE3:i===E?(U(this,"onvalue",!0),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid true started with tru"+i);continue;case o.FALSE:i===S?this.state=o.FALSE2:V(this,"Invalid false started with f"+i);continue;case o.FALSE2:i===O?this.state=o.FALSE3:V(this,"Invalid false started with fa"+i);continue;case o.FALSE3:i===T?this.state=o.FALSE4:V(this,"Invalid false started with fal"+i);continue;case o.FALSE4:i===E?(U(this,"onvalue",!1),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid false started with fals"+i);continue;case o.NULL:i===L?this.state=o.NULL2:V(this,"Invalid null started with n"+i);continue;case o.NULL2:i===O?this.state=o.NULL3:V(this,"Invalid null started with nu"+i);continue;case o.NULL3:i===O?(U(this,"onvalue",null),this.state=this.stack.pop()||o.VALUE):V(this,"Invalid null started with nul"+i);continue;case o.NUMBER_DECIMAL_POINT:i===v?(this.numberNode+=".",this.state=o.NUMBER_DIGIT):V(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(".")&&V(this,"Invalid number has two dots"),this.numberNode+="."):i===E||i===b?(-1===this.numberNode.indexOf("e")&&-1===this.numberNode.indexOf("E")||V(this,"Invalid number has two exponential"),this.numberNode+="e"):i===d||i===p?(a!==E&&a!==b&&V(this,"Invalid symbol in number"),this.numberNode+=String.fromCharCode(i)):(H(this),n--,this.state=this.stack.pop()||o.VALUE);continue;default:V(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:V(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=$c}catch(e){n=function(){}}function B(e){if(!(this instanceof B))return new B(e);this._parser=new j(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 U(t,n,r){e.INFO&&console.log("-- emit",n,r),t[n]&&t[n](r)}function F(e,t,n){z(e),U(e,t,n)}function z(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&&U(e,t||"onvalue",e.textNode),e.textNode=void 0}function H(e){e.numberNode&&U(e,"onvalue",parseFloat(e.numberNode)),e.numberNode=""}function V(e,t){return z(e),t+="\nLine: "+e.line+"\nColumn: "+e.column+"\nChar: "+e.c,t=new Error(t),e.error=t,U(e,"onerror",t),e}function W(e){return e.state===o.VALUE&&0===e.depth||V(e,"Unexpected end"),z(e),e.c="",e.closed=!0,U(e,"onend"),j.call(e,e.opt),e}function K(e){return e===c||e===u||e===l||e===s}B.prototype=Object.create(n.prototype,{constructor:{value:B}}),B.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}}},B.prototype.end=function(e){return e&&e.length&&this._parser.write(e.toString()),this._parser.end(),!0},B.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)},B.prototype.destroy=function(){P(this._parser),this.emit("close")}}(t)}));function el(e){var t=0,n=function(e){var t,n,r,i=Qc.parser(),o=0,a=[],s=!1,u=!1;return i.onopenobject=function(i){var s={incomplete:!0};t||(t=s),n&&(a.push([r,n,u]),e&&(u?n.push(s):n[r]=s)),n=s,r=i,u=!1,++o},i.onkey=function(e){return r=e},i.onvalue=function(e){return u?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],u=t[2],e||(u?n.push(i):n[r]=i)}},i.onopenarray=function(){var i=[];i.incomplete=!0,t||(t=i),n&&(a.push([r,n,u]),e&&(u?n.push(i):n[r]=i)),n=i,u=!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],u=t[2],e||(u?n.push(i):n[r]=i)}},{write:function(e){return i.write(e),t},done:function(){return s}}}(!0),r={pullAsync:function(i){return Tc(this,void 0,void 0,(function(){var o,a,s;return Rc(this,(function(u){switch(u.label){case 0:return o=e.slice(t,t+i),t+=i,[4,Nc(o,"text")];case 1:return a=u.sent(),s=n.write(a),r.result=s||{},[2,s]}}))}))},pullSync:function(i){var o=e.slice(t,t+i);t+=i;var a=Mc(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 tl(e,t,n){return Tc(this,void 0,void 0,(function(){function r(){return Tc(this,void 0,void 0,(function(){var t,r,a,h;return Rc(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 Rc(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(c&&gc.ignoreTransaction((function(){return c(l)})),r=t.tableName,i=e.table(r),o=u.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(Gc.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=u.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(;u.data.length>0&&u.data[0].rows&&!u.data[0].rows.incomplete;)u.data.splice(0,1);return o.done()||o.eof()?[3,8]:s?(o.pullSync(i),[3,7]):[3,5];case 5:return[4,gc.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,u,c,l,h,d;return Rc(this,(function(f){switch(f.label){case 0:return i=(n=n||{}).chunkSizeBytes||1048576,[4,nl(t,i)];case 1:if(o=f.sent(),a=o.result,s="FileReaderSync"in self,u=a.data,!n.acceptNameDiff&&e.name!==u.databaseName)throw new Error("Name differs. Current database name is "+e.name+" but export is "+u.databaseName);if(!n.acceptVersionDiff&&e.verno!==u.databaseVersion)throw new Error("Database version differs. Current database is in version "+e.verno+" but export is "+u.databaseVersion);if(c=n.progressCallback,l={done:!1,completedRows:0,completedTables:0,totalRows:u.tables.reduce((function(e,t){return e+t.rowCount}),0),totalTables:u.tables.length},c&&gc.ignoreTransaction((function(){return c(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,c&&gc.ignoreTransaction((function(){return c(l)})),[2]}}))}))}function nl(e,t){return Tc(this,void 0,void 0,(function(){var n,r;return Rc(this,(function(i){switch(i.label){case 0:n="slice"in e?el(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]}}))}))}gc.prototype.export=function(e){return Xc(this,e)},gc.prototype.import=function(e,t){return tl(this,e,t)},gc.import=function(e,t){return function(e,t){return Tc(this,void 0,void 0,(function(){var n,r,i,o;return Rc(this,(function(a){switch(a.label){case 0:return n=(t=t||{}).chunkSizeBytes||1048576,[4,nl(e,n)];case 1:return r=a.sent(),i=r.result.data,(o=new gc(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,tl(o,r,t)];case 2:return a.sent(),[2,o]}}))}))}(e,t)};var rl=n((function(e,t){e.exports=function e(t,n,r){var i,o,a=window,s="application/octet-stream",u=r||s,c=t,l=!n&&!r&&c,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)&&(u=(c=[c,u])[0],c=c[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(c)){if(!(c.length>2096103.424&&f!==d))return navigator.msSaveBlob?navigator.msSaveBlob(b(c),p):w(c);u=(c=b(c)).type||s}else if(/([\x80-\xff])/.test(c)){for(var g=0,m=new Uint8Array(c.length),y=m.length;g<y;++g)m[g]=c.charCodeAt(g);c=new f([m],{type:u})}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 w(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=c instanceof f?c:new f([c],{type:u}),navigator.msSaveBlob)return navigator.msSaveBlob(i,p);if(a.URL)w(a.URL.createObjectURL(i),!0);else{if("string"==typeof i||i.constructor===d)try{return w("data:"+u+";base64,"+a.btoa(i))}catch(e){return w("data:"+u+","+encodeURIComponent(i))}(o=new FileReader).onload=function(e){w(this.result)},o.readAsDataURL(i)}return!0}})),il=n((function(n,r){n.exports=function e(n,r,i){function o(s,u){if(!r[s]){if(!n[s]){if(!u&&t)return t();if(a)return a(s,!0);var c=new Error("Cannot find module '"+s+"'");throw c.code="MODULE_NOT_FOUND",c}var l=r[s]={exports:{}};n[s][0].call(l.exports,(function(e){return o(n[s][1][e]||e)}),l,l.exports,e,n,r,i)}return r[s].exports}for(var a=t,s=0;s<i.length;s++)o(i[s]);return o}({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,u,c,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,u=1<f?(15&n)<<2|i>>6:64,c=2<f?63&i:64,l.push(o.charAt(a)+o.charAt(s)+o.charAt(u)+o.charAt(c));return l.join("")},n.decode=function(e){var t,n,r,a,s,u,c=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);c<e.length;)t=o.indexOf(e.charAt(c++))<<2|(a=o.indexOf(e.charAt(c++)))>>4,n=(15&a)<<4|(s=o.indexOf(e.charAt(c++)))>>2,r=(3&s)<<6|(u=o.indexOf(e.charAt(c++))),d[l++]=t,64!==s&&(d[l++]=n),64!==u&&(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 u(e,t){a.call(this,"FlateWorker/"+e),this._pako=null,this._pakoAction=e,this._pakoOptions=t,this.meta={}}n.magic="\b\0",o.inherits(u,a),u.prototype.processChunk=function(e){this.meta=e.meta,null===this._pako&&this._createPako(),this._pako.push(o.transformTo(s,e.data),!1)},u.prototype.flush=function(){a.prototype.flush.call(this),null===this._pako&&this._createPako(),this._pako.push([],!0)},u.prototype.cleanUp=function(){a.prototype.cleanUp.call(this),this._pako=null},u.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 u("Deflate",e)},n.uncompressWorker=function(){return new u("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)),w=o.transformTo("string",s.utf8encode(y)),k=m.length!==f.name.length,_=w.length!==y.length,S="",x="",E="",I=f.dir,O=f.date,C={crc32:0,compressedSize:0,uncompressedSize:0};t&&!n||(C.crc32=e.crc32,C.compressedSize=e.compressedSize,C.uncompressedSize=e.uncompressedSize);var A=0;t&&(A|=8),v||!k&&!_||(A|=2048);var T=0,R=0;I&&(T|=16),"UNIX"===a?(R=798,T|=function(e,t){var n=e;return e||(n=t?16893:33204),(65535&n)<<16}(f.unixPermissions,I)):(R=20,T|=function(e){return 63&(e||0)}(f.dosPermissions)),h=O.getUTCHours(),h<<=6,h|=O.getUTCMinutes(),h<<=5,h|=O.getUTCSeconds()/2,d=O.getUTCFullYear()-1980,d<<=4,d|=O.getUTCMonth()+1,d<<=5,d|=O.getUTCDate(),k&&(x=r(1,1)+r(u(g),4)+m,S+="up"+r(x.length,2)+x),_&&(E=r(1,1)+r(u(b),4)+w,S+="uc"+r(E.length,2)+E);var L="";return L+="\n\0",L+=r(A,2),L+=p.magic,L+=r(h,2),L+=r(d,2),L+=r(C.crc32,4),L+=r(C.compressedSize,4),L+=r(C.uncompressedSize,4),L+=r(g.length,2),L+=r(S.length,2),{fileRecord:c.LOCAL_FILE_HEADER+L+g+S,dirRecord:c.CENTRAL_FILE_HEADER+r(R,2)+L+r(b.length,2)+"\0\0\0\0"+r(T,4)+r(i,4)+g+S+b}}var o=e("../utils"),a=e("../stream/GenericWorker"),s=e("../utf8"),u=e("../crc32"),c=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 c.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 c.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||{},u=n.dir,c=n.date;n._compressWorker(i,s).withStreamInfo("file",{name:e,dir:u,date:c,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.7.1",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"),u=e("./nodejsUtils");function c(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}),u.isNode&&u.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(c(r[o]));return i.Promise.all(n)})).then((function(e){for(var r=e.shift(),i=r.files,o=0;o<i.length;o++){var a=i[o];n.file(a.fileNameStr,a.decompressed,{binary:!0,optimizedBinaryString:!0,date:a.date,dir:a.dir,comment:a.fileCommentStr.length?a.fileCommentStr:null,unixPermissions:a.unixPermissions,dosPermissions:a.dosPermissions,createFolders:t.createFolders})}return r.zipComment.length&&(n.comment=r.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||{},u);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 c&&0===t.uncompressedSize||s.dir||!t||0===t.length)&&(s.base64=!1,s.binary=!0,t="",s.compression="STORE",i="string"),h=t instanceof c||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"),u=e("./defaults"),c=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:u.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"),u=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 u(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"),u=e("../external"),c=null;if(s.nodestream)try{c=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 u.Promise((function(n,i){var o=[],s=e._internalType,u=e._outputType,c=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)}}(u,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),c);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 c(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),u=0;u<256;u++)s[u]=252<=u?6:248<=u?5:240<=u?4:224<=u?3:192<=u?2:1;function c(){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,u=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++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=i.uint8array?new Uint8Array(u):new Array(u),o=a=0;a<u;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,u=new Array(2*a);for(t=n=0;t<a;)if((i=e[t++])<128)u[n++]=i;else if(4<(o=s[i]))u[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?u[n++]=65533:i<65536?u[n++]=i:(i-=65536,u[n++]=55296|i>>10&1023,u[n++]=56320|1023&i)}return u.length!==n&&(u.subarray?u=u.subarray(0,n):u.length=n),r.applyFromCharCode(u)}(e=r.transformTo(i.uint8array?"uint8array":"array",e))},r.inherits(c,a),c.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),u=t;a!==t.length&&(i.uint8array?(u=t.subarray(0,a),this.leftOver=t.subarray(a,t.length)):(u=t.slice(0,a),this.leftOver=t.slice(a,t.length))),this.push({data:n.utf8decode(u),meta:e.meta})},c.prototype.flush=function(){this.leftOver&&this.leftOver.length&&(this.push({data:n.utf8decode(this.leftOver),meta:{}}),this.leftOver=null)},n.Utf8DecodeWorker=c,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("set-immediate-shim"),s=e("./external");function u(e){return e}function c(e,t){for(var n=0;n<e.length;++n)t[n]=255&e.charCodeAt(n);return t}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 l={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 h(e){var t=65536,r=n.getTypeOf(e),i=!0;if("uint8array"===r?i=l.applyCanBeUsed.uint8array:"nodebuffer"===r&&(i=l.applyCanBeUsed.nodebuffer),i)for(;1<t;)try{return l.stringifyByChunk(e,r,t)}catch(e){t=Math.floor(t/2)}return l.stringifyByChar(e)}function d(e,t){for(var n=0;n<e.length;n++)t[n]=e[n];return t}n.applyFromCharCode=h;var f={};f.string={string:u,array:function(e){return c(e,new Array(e.length))},arraybuffer:function(e){return f.string.uint8array(e).buffer},uint8array:function(e){return c(e,new Uint8Array(e.length))},nodebuffer:function(e){return c(e,o.allocBuffer(e.length))}},f.array={string:h,array:u,arraybuffer:function(e){return new Uint8Array(e).buffer},uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(e)}},f.arraybuffer={string:function(e){return h(new Uint8Array(e))},array:function(e){return d(new Uint8Array(e),new Array(e.byteLength))},arraybuffer:u,uint8array:function(e){return new Uint8Array(e)},nodebuffer:function(e){return o.newBufferFrom(new Uint8Array(e))}},f.uint8array={string:h,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return e.buffer},uint8array:u,nodebuffer:function(e){return o.newBufferFrom(e)}},f.nodebuffer={string:h,array:function(e){return d(e,new Array(e.length))},arraybuffer:function(e){return f.nodebuffer.uint8array(e).buffer},uint8array:function(e){return d(e,new Uint8Array(e.length))},nodebuffer:u},n.transformTo=function(e,t){if(t=t||"",!e)return t;n.checkSupport(e);var r=n.getTypeOf(t);return f[r][e](t)},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){a((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,a,u){return s.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 s.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!==a&&(t=function(e){return c(e,r.uint8array?new Uint8Array(e.length):new Array(e.length))}(t))),t):s.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,"set-immediate-shim":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 u(e){this.files=[],this.loadOptions=e}u.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=u},{"./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"),u=e("./compressions"),c=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 u)if(u.hasOwnProperty(t)&&u[t].magic===e)return u[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=c.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"),u=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 u("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 u?this._data:new o(this._data)}};for(var c=["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<c.length;h++)r.prototype[c[h]]=l;t.exports=r},{"./compressedObject":2,"./stream/DataWorker":27,"./stream/GenericWorker":28,"./stream/StreamHelper":29,"./utf8":31}],36:[function(t,n,r){(function(e){var t,r,i=e.MutationObserver||e.WebKitMutationObserver;if(i){var o=0,a=new i(l),s=e.document.createTextNode("");a.observe(s,{characterData:!0}),t=function(){s.data=o=++o%2}}else if(e.setImmediate||void 0===e.MessageChannel)t="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 u=new e.MessageChannel;u.port1.onmessage=l,t=function(){u.port2.postMessage(0)}}var c=[];function l(){var e,t;r=!0;for(var n=c.length;n;){for(t=c,c=[],e=-1;++e<n;)t[e]();n=c.length}r=!1}n.exports=function(e){1!==c.push(e)||r||t()}}).call(this,void 0!==e?e:"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"],u=["PENDING"];function c(e){if("function"!=typeof e)throw new TypeError("resolver must be a function");this.state=u,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=c).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}))}))},c.prototype.catch=function(e){return this.then(null,e)},c.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!==u?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},c.resolve=function(e){return e instanceof this?e:o.resolve(new this(i),e)},c.reject=function(e){var t=new this(i);return o.reject(t,e)},c.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,u=-1,c=new this(i);++u<n;)l(e[u],u);return c;function l(e,i){t.resolve(e).then((function(e){a[i]=e,++s!==n||r||(r=!0,o.resolve(c,a))}),(function(e){r||(r=!0,o.reject(c,e))}))}},c.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"),u=Object.prototype.toString;function c(e){if(!(this instanceof c))return new c(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]"===u.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 c(t);if(n.push(e,!0),n.err)throw n.msg||a[n.err];return n.result}c.prototype.push=function(e,t){var n,a,s=this.strm,c=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]"===u.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(c),s.next_out=0,s.avail_out=c),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))},c.prototype.onData=function(e){this.chunks.push(e)},c.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=c,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"),u=e("./zlib/zstream"),c=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 u,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 c,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,u,c,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?(u=o.utf8border(f.output,f.next_out),c=f.next_out-u,h=o.buf2string(f.output,u),f.next_out=c,f.avail_out=p-c,c&&i.arraySet(f.output,f.output,u,c,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 u(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,u=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++),u+=n<128?1:n<2048?2:n<65536?3:4;for(t=new r.Buf8(u),o=a=0;a<u;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 u(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,c=new Array(2*s);for(n=r=0;n<s;)if((i=e[n++])<128)c[r++]=i;else if(4<(o=a[i]))c[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?c[r++]=65533:i<65536?c[r++]=i:(i-=65536,c[r++]=55296|i>>10&1023,c[r++]=56320|1023&i)}return u(c,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"),u=e("./messages"),c=-2,l=258,h=262,d=113;function f(e,t){return e.msg=u[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 w(e,t){var n,r,i=e.max_chain_length,o=e.strstart,a=e.prev_length,s=e.nice_match,u=e.strstart>e.w_size-h?e.strstart-(e.w_size-h):0,c=e.window,d=e.w_mask,f=e.prev,p=e.strstart+l,v=c[o+a-1],g=c[o+a];e.prev_length>=e.good_match&&(i>>=2),s>e.lookahead&&(s=e.lookahead);do{if(c[(n=t)+a]===g&&c[n+a-1]===v&&c[n]===c[o]&&c[++n]===c[o+1]){o+=2,n++;do{}while(c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&c[++o]===c[++n]&&o<p);if(r=l-(p-o),o=p-l,a<r){if(e.match_start=t,s<=(a=r))break;v=c[o+a-1],g=c[o+a]}}}while((t=f[t&d])>u&&0!=--i);return a<=e.lookahead?a:e.lookahead}function k(e){var t,n,r,o,u,c,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(c=e.strm,l=e.window,d=e.strstart+e.lookahead,p=void 0,(f=o)<(p=c.avail_in)&&(p=f),n=0===p?0:(c.avail_in-=p,i.arraySet(l,c.input,c.next_in,p,d),1===c.state.wrap?c.adler=a(c.adler,l,p,d):2===c.state.wrap&&(c.adler=s(c.adler,l,p,d)),c.next_in+=p,c.total_in+=p,p),e.lookahead+=n,e.lookahead+e.insert>=3)for(u=e.strstart-e.insert,e.ins_h=e.window[u],e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+1])&e.hash_mask;e.insert&&(e.ins_h=(e.ins_h<<e.hash_shift^e.window[u+3-1])&e.hash_mask,e.prev[u&e.w_mask]=e.head[e.ins_h],e.head[e.ins_h]=u,u++,e.insert--,!(e.lookahead+e.insert<3)););}while(e.lookahead<h&&0!==e.strm.avail_in)}function _(e,t){for(var n,r;;){if(e.lookahead<h){if(k(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=w(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 S(e,t){for(var n,r,i;;){if(e.lookahead<h){if(k(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=w(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 x(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 E(){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,c)}function O(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 C(e,t,n,r,o,a){if(!e)return c;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,c);8===r&&(r=9);var u=new E;return(e.state=u).strm=e,u.wrap=s,u.gzhead=null,u.w_bits=r,u.w_size=1<<u.w_bits,u.w_mask=u.w_size-1,u.hash_bits=o+7,u.hash_size=1<<u.hash_bits,u.hash_mask=u.hash_size-1,u.hash_shift=~~((u.hash_bits+3-1)/3),u.window=new i.Buf8(2*u.w_size),u.head=new i.Buf16(u.hash_size),u.prev=new i.Buf16(u.w_size),u.lit_bufsize=1<<o+6,u.pending_buf_size=4*u.lit_bufsize,u.pending_buf=new i.Buf8(u.pending_buf_size),u.d_buf=1*u.lit_bufsize,u.l_buf=3*u.lit_bufsize,u.level=t,u.strategy=a,u.method=n,O(e)}r=[new x(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(k(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 x(4,4,8,4,_),new x(4,5,16,8,_),new x(4,6,32,32,_),new x(4,4,16,16,S),new x(8,16,32,32,S),new x(8,16,128,128,S),new x(8,32,128,256,S),new x(32,128,258,1024,S),new x(32,258,258,4096,S)],n.deflateInit=function(e,t){return C(e,t,8,15,8,0)},n.deflateInit2=C,n.deflateReset=O,n.deflateResetKeep=I,n.deflateSetHeader=function(e,t){return e&&e.state?2!==e.state.wrap?c:(e.state.gzhead=t,0):c},n.deflate=function(e,t){var n,i,a,u;if(!e||!e.state||5<t||t<0)return e?f(e,c):c;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:c);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)){u=1;break}u=i.gzindex<i.gzhead.name.length?255&i.gzhead.name.charCodeAt(i.gzindex++):0,y(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(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)){u=1;break}u=i.gzindex<i.gzhead.comment.length?255&i.gzhead.comment.charCodeAt(i.gzindex++):0,y(i,u)}while(0!==u);i.gzhead.hcrc&&i.pending>a&&(e.adler=s(e.adler,i.pending_buf,i.pending-a,a)),0===u&&(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 w=2===i.strategy?function(e,t){for(var n;;){if(0===e.lookahead&&(k(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(k(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!==w&&4!==w||(i.status=666),1===w||3===w)return 0===e.avail_out&&(i.last_flush=-1),0;if(2===w&&(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,c):(e.state=null,t===d?f(e,-3):0):c},n.deflateSetDictionary=function(e,t){var n,r,o,s,u,l,h,d,f=t.length;if(!e||!e.state)return c;if(2===(s=(n=e.state).wrap)||1===s&&42!==n.status||n.lookahead)return c;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),u=e.avail_in,l=e.next_in,h=e.input,e.avail_in=f,e.next_in=0,e.input=t,k(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,k(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=u,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,u,c,l,h,d,f,p,v,g,m,y,b,w,k,_,S,x,E,I;n=e.state,r=e.next_in,E=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),u=n.dmax,c=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+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),b=v[f&m];t:for(;;){if(f>>>=w=b>>>24,p-=w,0==(w=b>>>16&255))I[o++]=65535&b;else{if(!(16&w)){if(0==(64&w)){b=v[(65535&b)+(f&(1<<w)-1)];continue t}if(32&w){n.mode=12;break e}e.msg="invalid literal/length code",n.mode=30;break e}k=65535&b,(w&=15)&&(p<w&&(f+=E[r++]<<p,p+=8),k+=f&(1<<w)-1,f>>>=w,p-=w),p<15&&(f+=E[r++]<<p,p+=8,f+=E[r++]<<p,p+=8),b=g[f&y];n:for(;;){if(f>>>=w=b>>>24,p-=w,!(16&(w=b>>>16&255))){if(0==(64&w)){b=g[(65535&b)+(f&(1<<w)-1)];continue n}e.msg="invalid distance code",n.mode=30;break e}if(_=65535&b,p<(w&=15)&&(f+=E[r++]<<p,(p+=8)<w&&(f+=E[r++]<<p,p+=8)),u<(_+=f&(1<<w)-1)){e.msg="invalid distance too far back",n.mode=30;break e}if(f>>>=w,p-=w,(w=o-a)<_){if(l<(w=_-w)&&n.sane){e.msg="invalid distance too far back",n.mode=30;break e}if(x=d,(S=0)===h){if(S+=c-w,w<k){for(k-=w;I[o++]=d[S++],--w;);S=o-_,x=I}}else if(h<w){if(S+=c+h-w,(w-=h)<k){for(k-=w;I[o++]=d[S++],--w;);if(S=0,h<k){for(k-=w=h;I[o++]=d[S++],--w;);S=o-_,x=I}}}else if(S+=h-w,w<k){for(k-=w;I[o++]=d[S++],--w;);S=o-_,x=I}for(;2<k;)I[o++]=x[S++],I[o++]=x[S++],I[o++]=x[S++],k-=3;k&&(I[o++]=x[S++],1<k&&(I[o++]=x[S++]))}else{for(S=o-_;I[o++]=I[S++],I[o++]=I[S++],I[o++]=I[S++],2<(k-=3););k&&(I[o++]=I[S++],1<k&&(I[o++]=I[S++]))}break}}break}}while(r<i&&o<s);r-=k=p>>3,f&=(1<<(p-=k<<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"),u=-2;function c(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):u}function d(e){var t;return e&&e.state?((t=e.state).wsize=0,t.whave=0,t.wnext=0,h(e)):u}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)?u:(null!==r.window&&r.wbits!==t&&(r.window=null),r.wrap=n,r.wbits=t,d(e))):u}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):u}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,w,k,_,S,x,E,I,O,C,A,T,R,L,N,M,P=0,D=new r.Buf8(4),j=[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 u;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,w=p,k=v,L=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){D[n.check=0]=255&g,D[1]=g>>>8&255,n.check=o(n.check,D,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,R=8+(15&(g>>>=4)),0===n.wbits)n.wbits=R;else if(R>n.wbits){e.msg="invalid window size",n.mode=30;break}n.dmax=1<<R,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&&(D[0]=255&g,D[1]=g>>>8&255,n.check=o(n.check,D,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&&(D[0]=255&g,D[1]=g>>>8&255,D[2]=g>>>16&255,D[3]=g>>>24&255,n.check=o(n.check,D,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&&(D[0]=255&g,D[1]=g>>>8&255,n.check=o(n.check,D,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&&(D[0]=255&g,D[1]=g>>>8&255,n.check=o(n.check,D,2,0)),m=g=0}else n.head&&(n.head.extra=null);n.mode=6;case 6:if(1024&n.flags&&(p<(_=n.length)&&(_=p),_&&(n.head&&(R=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,_,R)),512&n.flags&&(n.check=o(n.check,l,_,d)),p-=_,d+=_,n.length-=_),n.length))break e;n.length=0,n.mode=7;case 7:if(2048&n.flags){if(0===p)break e;for(_=0;R=l[d+_++],n.head&&R&&n.length<65536&&(n.head.name+=String.fromCharCode(R)),R&&_<p;);if(512&n.flags&&(n.check=o(n.check,l,_,d)),p-=_,d+=_,R)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(_=0;R=l[d+_++],n.head&&R&&n.length<65536&&(n.head.comment+=String.fromCharCode(R)),R&&_<p;);if(512&n.flags&&(n.check=o(n.check,l,_,d)),p-=_,d+=_,R)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=c(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(_=n.length){if(p<_&&(_=p),v<_&&(_=v),0===_)break e;r.arraySet(h,l,d,_,f),p-=_,d+=_,v-=_,f+=_,n.length-=_;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[j[n.have++]]=7&g,g>>>=3,m-=3}for(;n.have<19;)n.lens[j[n.have++]]=0;if(n.lencode=n.lendyn,n.lenbits=7,N={bits:n.lenbits},L=s(0,n.lens,0,19,n.lencode,0,n.work,N),n.lenbits=N.bits,L){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,O=65535&P,!((E=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(O<16)g>>>=E,m-=E,n.lens[n.have++]=O;else{if(16===O){for(M=E+2;m<M;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(g>>>=E,m-=E,0===n.have){e.msg="invalid bit length repeat",n.mode=30;break}R=n.lens[n.have-1],_=3+(3&g),g>>>=2,m-=2}else if(17===O){for(M=E+3;m<M;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=E,R=0,_=3+(7&(g>>>=E)),g>>>=3,m-=3}else{for(M=E+7;m<M;){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}m-=E,R=0,_=11+(127&(g>>>=E)),g>>>=7,m-=7}if(n.have+_>n.nlen+n.ndist){e.msg="invalid bit length repeat",n.mode=30;break}for(;_--;)n.lens[n.have++]=R}}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},L=s(1,n.lens,0,n.nlen,n.lencode,0,n.work,N),n.lenbits=N.bits,L){e.msg="invalid literal/lengths set",n.mode=30;break}if(n.distbits=6,n.distcode=n.distdyn,N={bits:n.distbits},L=s(2,n.lens,n.nlen,n.ndist,n.distcode,0,n.work,N),n.distbits=N.bits,L){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,k),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,O=65535&P,!((E=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(I&&0==(240&I)){for(C=E,A=I,T=O;I=(P=n.lencode[T+((g&(1<<C+A)-1)>>C)])>>>16&255,O=65535&P,!(C+(E=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=C,m-=C,n.back+=C}if(g>>>=E,m-=E,n.back+=E,n.length=O,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(M=n.extra;m<M;){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,O=65535&P,!((E=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}if(0==(240&I)){for(C=E,A=I,T=O;I=(P=n.distcode[T+((g&(1<<C+A)-1)>>C)])>>>16&255,O=65535&P,!(C+(E=P>>>24)<=m);){if(0===p)break e;p--,g+=l[d++]<<m,m+=8}g>>>=C,m-=C,n.back+=C}if(g>>>=E,m-=E,n.back+=E,64&I){e.msg="invalid distance code",n.mode=30;break}n.offset=O,n.extra=15&I,n.mode=24;case 24:if(n.extra){for(M=n.extra;m<M;){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-v,n.offset>_){if((_=n.offset-_)>n.whave&&n.sane){e.msg="invalid distance too far back",n.mode=30;break}S=_>n.wnext?(_-=n.wnext,n.wsize-_):n.wnext-_,_>n.length&&(_=n.length),x=n.window}else x=h,S=f-n.offset,_=n.length;for(v<_&&(_=v),v-=_,n.length-=_;h[f++]=x[S++],--_;);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(k-=v,e.total_out+=k,n.total+=k,k&&(e.adler=n.check=n.flags?o(n.check,h,k,f-k):i(n.check,h,k,f-k)),k=v,(n.flags?g:c(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:L=1;break e;case 30:L=-3;break e;case 31:return-4;case 32:default:return u}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||k!==e.avail_out&&n.mode<30&&(n.mode<27||4!==t))&&b(e,e.output,e.next_out,k-e.avail_out)?(n.mode=31,-4):(w-=e.avail_in,k-=e.avail_out,e.total_in+=w,e.total_out+=k,n.total+=k,n.wrap&&k&&(e.adler=n.check=n.flags?o(n.check,h,k,e.next_out-k):i(n.check,h,k,e.next_out-k)),e.data_type=n.bits+(n.last?64:0)+(12===n.mode?128:0)+(20===n.mode||15===n.mode?256:0),(0==w&&0===k||4===t)&&0===L&&(L=-5),L)},n.inflateEnd=function(e){if(!e||!e.state)return u;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)?u:((n.head=t).done=!1,0):u},n.inflateSetDictionary=function(e,t){var n,r=t.length;return e&&e.state?0!==(n=e.state).wrap&&11!==n.mode?u:11===n.mode&&i(1,t,r,0)!==n.check?-3:b(e,t,r,r)?(n.mode=31,-4):(n.havedict=1,0):u},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,u,c,l,h,d){var f,p,v,g,m,y,b,w,k,_=d.bits,S=0,x=0,E=0,I=0,O=0,C=0,A=0,T=0,R=0,L=0,N=null,M=0,P=new r.Buf16(16),D=new r.Buf16(16),j=null,B=0;for(S=0;S<=15;S++)P[S]=0;for(x=0;x<u;x++)P[t[n+x]]++;for(O=_,I=15;1<=I&&0===P[I];I--);if(I<O&&(O=I),0===I)return c[l++]=20971520,c[l++]=20971520,d.bits=1,0;for(E=1;E<I&&0===P[E];E++);for(O<E&&(O=E),S=T=1;S<=15;S++)if(T<<=1,(T-=P[S])<0)return-1;if(0<T&&(0===e||1!==I))return-1;for(D[1]=0,S=1;S<15;S++)D[S+1]=D[S]+P[S];for(x=0;x<u;x++)0!==t[n+x]&&(h[D[t[n+x]]++]=x);if(y=0===e?(N=j=h,19):1===e?(N=i,M-=257,j=o,B-=257,256):(N=a,j=s,-1),S=E,m=l,A=x=L=0,v=-1,g=(R=1<<(C=O))-1,1===e&&852<R||2===e&&592<R)return 1;for(;;){for(b=S-A,k=h[x]<y?(w=0,h[x]):h[x]>y?(w=j[B+h[x]],N[M+h[x]]):(w=96,0),f=1<<S-A,E=p=1<<C;c[m+(L>>A)+(p-=f)]=b<<24|w<<16|k|0,0!==p;);for(f=1<<S-1;L&f;)f>>=1;if(0!==f?(L&=f-1,L+=f):L=0,x++,0==--P[S]){if(S===I)break;S=t[n+h[x]]}if(O<S&&(L&g)!==v){for(0===A&&(A=O),m+=E,T=1<<(C=S-A);C+A<I&&!((T-=P[C+A])<=0);)C++,T<<=1;if(R+=1<<C,1===e&&852<R||2===e&&592<R)return 1;c[v=L&g]=O<<24|C<<16|m-l|0}}return 0!==L&&(c[m+L]=S-A<<24|64<<16|0),d.bits=O,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,u=15,c=[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,w,k=new Array(s);function _(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 S(e,t){this.dyn_tree=e,this.max_code=0,this.stat_desc=t}function x(e){return e<256?v[e]:v[256+(e>>>7)]}function E(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,E(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 O(e,t,n){I(e,n[2*t],n[2*t+1])}function C(e,t){for(var n=0;n|=1&e,e>>>=1,n<<=1,0<--t;);return n>>>1}function A(e,t,n){var r,i,o=new Array(16),a=0;for(r=1;r<=u;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]=C(o[s]++,s))}}function T(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 R(e){8<e.bi_valid?E(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 L(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&&L(t,e.heap[i+1],e.heap[i],e.depth)&&i++,!L(t,r,e.heap[i],e.depth));)e.heap[n]=e.heap[i],n=i,i<<=1;e.heap[n]=r}function M(e,t,n){var r,i,a,s,u=0;if(0!==e.last_lit)for(;r=e.pending_buf[e.d_buf+2*u]<<8|e.pending_buf[e.d_buf+2*u+1],i=e.pending_buf[e.l_buf+u],u++,0===r?O(e,i,t):(O(e,(a=g[i])+o+1,t),0!==(s=c[a])&&I(e,i-=m[a],s),O(e,a=x(--r),n),0!==(s=l[a])&&I(e,r-=k[a],s)),u<e.last_lit;);O(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,c=t.stat_desc.elems,l=-1;for(e.heap_len=0,e.heap_max=573,n=0;n<c;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=c;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,c=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<=u;o++)e.bl_count[o]=0;for(c[2*e.heap[e.heap_max]+1]=0,n=e.heap_max+1;n<573;n++)v<(o=c[2*c[2*(r=e.heap[n])+1]+1]+1)&&(o=v,g++),c[2*r+1]=o,l<r||(e.bl_count[o]++,a=0,p<=r&&(a=f[r-p]),s=c[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])||(c[2*i+1]!==o&&(e.opt_len+=(o-c[2*i+1])*c[2*i],c[2*i+1]=o),r--)}}(e,t),A(o,l,e.bl_count)}function D(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),t[2*(n+1)+1]=65535,r=0;r<=n;r++)i=a,a=t[2*(r+1)+1],++s<u&&i===a||(s<c?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,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4))}function j(e,t,n){var r,i,o=-1,a=t[1],s=0,u=7,c=4;for(0===a&&(u=138,c=3),r=0;r<=n;r++)if(i=a,a=t[2*(r+1)+1],!(++s<u&&i===a)){if(s<c)for(;O(e,i,e.bl_tree),0!=--s;);else 0!==i?(i!==o&&(O(e,i,e.bl_tree),s--),O(e,16,e.bl_tree),I(e,s-3,2)):s<=10?(O(e,17,e.bl_tree),I(e,s-3,3)):(O(e,18,e.bl_tree),I(e,s-11,7));o=i,c=(s=0)===a?(u=138,3):i===a?(u=6,3):(u=7,4)}}i(k);var B=!1;function U(e,t,n,i){I(e,0+(i?1:0),3),function(e,t,n,i){R(e),E(e,n),E(e,~n),r.arraySet(e.pending_buf,e.window,t,n,e.pending),e.pending+=n}(e,t,n)}n._tr_init=function(e){B||(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<<c[r];e++)g[n++]=r;for(g[n-1]=r,r=i=0;r<16;r++)for(k[r]=i,e=0;e<1<<l[r];e++)v[i++]=r;for(i>>=7;r<s;r++)for(k[r]=i<<7,e=0;e<1<<l[r]-7;e++)v[256+i++]=r;for(t=0;t<=u;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(A(f,287,o),e=0;e<s;e++)p[2*e+1]=5,p[2*e]=C(e,5);y=new _(f,c,257,a,u),b=new _(p,l,0,s,u),w=new _(new Array(0),h,0,19,7)}(),B=!0),e.l_desc=new S(e.dyn_ltree,y),e.d_desc=new S(e.dyn_dtree,b),e.bl_desc=new S(e.bl_tree,w),e.bi_buf=0,e.bi_valid=0,T(e)},n._tr_stored_block=U,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(D(e,e.dyn_ltree,e.l_desc.max_code),D(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?U(e,t,n,r):4===e.strategy||a===i?(I(e,2+(r?1:0),3),M(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);j(e,e.dyn_ltree,t-1),j(e,e.dyn_dtree,n-1)}(e,e.l_desc.max_code+1,e.d_desc.max_code+1,s+1),M(e,e.dyn_ltree,e.dyn_dtree)),T(e),r&&R(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*x(t)]++),e.last_lit===e.lit_bufsize-1},n._tr_align=function(e){I(e,2,3),O(e,256,f),function(e){16===e.bi_valid?(E(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){t.exports="function"==typeof setImmediate?setImmediate:function(){var e=[].slice.apply(arguments);e.splice(1,0,0),setTimeout.apply(null,e)}},{}]},{},[10])(10)})),ol=/MSIE .\./.test(M),al=a.Function,sl=function(e){return function(t,n){var r=arguments.length>2,i=r?bo(arguments,2):void 0;return e(r?function(){Nr(A(t)?t:al(t),this,i)}:t,n)}};Ct({global:!0,bind:!0,forced:ol},{setTimeout:sl(a.setTimeout),setInterval:sl(a.setInterval)});var ul=mn.forEach,cl=un("forEach")?[].forEach:function(e){return ul(this,e,arguments.length>1?arguments[1]:void 0)};Ct({target:"Array",proto:!0,forced:[].forEach!=cl},{forEach:cl});var ll=function(e){if(e&&e.forEach!==cl)try{Ae(e,"forEach",cl)}catch(t){e.forEach=cl}};for(var hl in Ua)Ua[hl]&&ll(a[hl]&&a[hl].prototype);ll(Ha);var dl=vt.f,fl="object"==typeof window&&window&&Object.getOwnPropertyNames?Object.getOwnPropertyNames(window):[],pl={f:function(e){return fl&&"Window"==_(e)?function(e){try{return dl(e)}catch(e){return Hr(fl)}}(e):dl(C(e))}},vl=pl.f,gl=s((function(){return!Object.getOwnPropertyNames(1)}));Ct({target:"Object",stat:!0,forced:gl},{getOwnPropertyNames:vl});var ml={en_US:{200:"success",2002:"WebSocket connecting time out",2003:"WebSocket connecting is stoped,reconnecting now...",2004:"WebSocket connecting is stoped",2005:"WebSocket connecting error",10002:"The browser don't support Websocket, please use Chrome",10009:"The client has finished calling and it is forbidden to join the meeting",10020:"Peer need to be created before operation",10021:"Stream need to be created before operation",10023:"Failed to start or stop Audio&Video",10024:"No Mic permission",10025:"No camera permission",10030:"Hang up the meeting",10100:"Login failed",10101:"Wrong parameter",10103:"Failed to get user information",10104:"Incorrect account or password",10301:"Custom layout mode does not support switching layouts",10302:"Custom layout mode does not support requesting stream when full screen",10303:"Custom layout mode does not support paging",10401:"Invalid meeting ID",10402:"Call failed",10403:"Require meeting password",10404:"Wrong meeting password",10405:"The meeting ID is not supported",10406:"Failed to join meeting",10407:"The protocol must be HTTPS, or the host name must be Localhost",10500:"Interface request failed",10515:"Failed to create a Client",10517:"Call failed",10518:"Successful call",10519:"Calling, please wait",10530:"Failed to request a full screen stream",20400:"No camera or Mic device",20401:"Can't access camera or Mic device",20402:"Constraint setting cannot be satisfied",20403:"Mic or camera access denied",20404:"The collection flow constraint is null",20405:"Failed to create media stream",20407:"Failed to switch speakers",20500:"The user cancels the screen share",20501:"Operation abnormal,and can't get the screen",20502:"Failed to get the screen",20503:"No video source is available for capture",20504:"Hardware or operating system error or lock, and it prevent sharing screen",20505:"Capture screen-Constraint setting failed",20506:"Capture screen-An impermissible constraint setting is specified",20507:"The user has refused to authorize the capture screen operation",20508:"Already sharing screen",20509:"Not selected SourceId",20510:"Operation abnormal,and can't get the screen",20512:"Failed to share content",20517:"Failed to end sharing",20519:"Failed to get the codec format supported by the sender",20520:"Failed to obtain device permissions",20521:"Failed to get device list",20522:"Failed to switch media input device",20530:"No local media streaming",30500:"Failed to switch debug mode",30512:"Failed to start the tour",30524:"Stream is not created",30525:"Stream is created successfully",30526:"DomStream is created successfully",30527:"Failed to create Stream",30528:"Client is not created"},zh_CN:{200:"成功",2002:"WebSocket连接超时",2003:"WebSocket连接已关闭,正在重连...",2004:"WebSocket连接已关闭",2005:"WebSocket连接错误",10002:"当前浏览器不支持Websocket,请使用Chrome浏览器",10009:"Client已关闭,禁止加入会议",10020:"需要创建Peer才可操作",10021:"需要创建Stream才可操作",10023:"音视频开启关闭操作失败",10024:"没有麦克风权限",10025:"没有摄像头权限",10030:"挂断会议",10100:"登录失败",10101:"参数有误,请检查",10103:"获取用户信息失败",10104:"账号或者密码错误",10301:"自定义布局模式不支持切换布局",10302:"自定义布局模式不支持全屏请流",10303:"自定义布局模式不支持分页",10401:"无效的会议号",10402:"呼叫失败",10403:"需要入会密码",10404:"入会密码错误",10405:"暂不支持呼叫此号码",10406:"免密入会失败",10407:"协议必须是 https,或者主机名必须是 localhost",10500:"接口请求失败",10515:"Client创建失败",10517:"呼叫失败",10518:"呼叫成功",10519:"正在呼叫中,请等候",10530:"全屏请流失败",20400:"缺失摄像头或麦克风设备",20401:"摄像头或麦克风设备无法访问",20402:"约束设置无法被满足",20403:"麦克风或摄像头使用权限被拒绝",20404:"采集流约束设置为空",20405:"创建媒体流失败",20407:"切换扬声器失败",20500:"用户取消采集屏幕操作",20501:"操作异常采集屏幕失败",20502:"采集屏幕失败",20503:"没有屏幕视频源可用于捕获",20504:"硬件或操作系统错误或锁定,阻止了采集屏幕共享",20505:"采集屏幕-约束设置失败",20506:"采集屏幕-指定了不允许的约束设置\t",20507:"用户已拒绝授权采集屏幕操作",20508:"已经在分享屏幕",20509:"没有 selectedSourceId\t",20510:"操作异常采集屏幕失败",20512:"分享content失败",20517:"结束分享失败\t",20519:"获取发送端支持的编解码格式 失败\t",20520:"获取设备权限失败",20521:"获取设备列表失败",20522:"切换媒体输入设备失败",20530:"本地无媒体流",30500:"切换调试模式失败",30512:"开启巡课失败",30524:"Stream对象未创建",30525:"Stream创建成功",30526:"domstream创建成功",30527:"Stream创建失败",30528:"Client对象未创建"},zh_TW:{200:"成功",2002:"WebSocket連接超時",2003:"WebSocket連接已關閉,正在重連...",2004:"WebSocket連接已關閉",2005:"WebSocket連接錯誤",10002:"當前瀏覽器不支持Websocket,請使用Chrome瀏覽器",10009:"Client已關閉,禁止加入會議",10020:"需要創建Peer才可操作",10021:"需要創建Stream才可操作",10023:"音視頻開啟關閉操作失敗",10024:"沒有麥克風權限",10025:"沒有攝像頭權限",10030:"掛斷會議",10100:"登錄失敗",10101:"參數有誤,請檢查",10103:"獲取用戶信息失敗",10104:"賬號或者密碼錯誤",10301:"自定義佈局模式不支持切換佈局",10302:"自定義佈局模式不支持全屏請流",10303:"自定義佈局模式不支持分頁",10401:"無效的會議號",10402:"呼叫失敗",10403:"需要入會密碼",10404:"入會密碼錯誤",10405:"暫不支持呼叫此號碼",10406:"免密入會失敗",10407:"協議必須是 https,或者主機名必須是 localhost",10500:"接口請求失敗",10515:"Client創建失敗",10517:"呼叫失敗",10518:"呼叫成功",10519:"正在呼叫中,請等候",10530:"全屏請流失敗",20400:"缺失攝像頭或麥克風設備",20401:"攝像頭或麥克風設備無法訪問",20402:"約束設置無法被滿足",20403:"麥克風或攝像頭使用權限被拒絕",20404:"採集流約束設置為空",20405:"創建媒體流失敗",20407:"切換揚聲器失敗",20500:"用戶取消採集屏幕操作",20501:"操作異常採集屏幕失敗",20502:"採集屏幕失敗",20503:"沒有屏幕視頻源可用於捕獲",20504:"硬件或操作系統錯誤或鎖定,阻止了採集屏幕共享",20505:"採集屏幕-約束設置失敗",20506:"採集屏幕-指定了不允許的約束設置\t",20507:"用戶已拒絕授權採集屏幕操作",20508:"已經在分享屏幕",20509:"沒有 selectedSourceId\t",20510:"操作異常採集屏幕失敗",20512:"分享content失敗",20517:"結束分享失敗\t",20519:"獲取發送端支持的編解碼格式 失敗\t",20520:"獲取設備權限失敗",20521:"獲取設備列表失敗",20522:"切換媒體輸入設備失敗",20530:"本地無媒體流",30500:"切換調試模式失敗",30512:"開啟巡課失敗",30524:"Stream對象未創建",30525:"Stream創建成功",30526:"domstream創建成功",30527:"Stream創建失敗",30528:"Client對象未創建"}},yl="zh_CN",bl=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())},wl=function(){var e=new Date;return"".concat(e.getHours(),":").concat(e.getMinutes(),":").concat(e.getSeconds()," ").concat(e.getMilliseconds())};function kl(e){var t={};return e.forEach((function(e,n){t[n]=e})),t}var _l=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:ml[yl][e]||n,detail:t}},Sl=function(){function e(){$r(this,e),this.db=new gc("webrtc")}return ei(e,[{key:"add",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.db){t.next=4;break}return this.db=new gc("webrtc"),t.next=4,this.init();case 4:try{n=e.time,r=void 0===n?"":n,i=e.title,o=void 0===i?"":i,a=e.content,s=void 0===a?"":a,u=e.rest,c=void 0===u?[]:u,l=this.num||1,this.db["webrtc_log"+l].add({t:r+JSON.stringify(o),c:JSON.stringify(s)+" "+JSON.stringify(c)}).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 t.stop()}}),t,this)})))}},{key:"deleteDB",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.db.delete(),gc.delete("webrtc"),Cc.set("xy-webrtc-log",{version:1,num:1}),this.num=1;case 4:case"end":return e.stop()}}),e,this)})))}},{key:"close",value:function(){this.db.close()}},{key:"stop",value:function(){var e=Cc.get("xy-webrtc-log")||{version:1,num:1};Cc.set("xy-webrtc-log",{version:e.version,num:e.num+1>3?1:e.num+1})}},{key:"isOpen",value:function(){return this.db&&this.db.isOpen()}},{key:"export",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Xc(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 3:return t=e.sent,n=bl(),e.next=7,this.generateZipBlobAsync(t,n,"");case 7:return r=e.sent,rl(r,"xy_webrtc_sdk_log_".concat(n,".zip"),"application/zip"),e.abrupt("return",!0);case 12:return e.prev=12,e.t0=e.catch(0),console.error("export db data error: "+e.t0),e.abrupt("return",!1);case 16:case"end":return e.stop()}}),e,this,[[0,12]])})))}},{key:"upload",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,Xc(this.db,{prettyJson:!0,progressCallback:this.progressCallback});case 4:return r=t.sent,i=bl(),t.next=8,this.generateZipBlobAsync(r,i,e);case 8:n=t.sent,t.next=14;break;case 11:t.prev=11,t.t0=t.catch(1),console.error("export blob error: "+t.t0);case 14:return t.abrupt("return",n);case 15:case"end":return t.stop()}}),t,this,[[1,11]])})))}},{key:"progressCallback",value:function(e){return e.totalRows,e.completedRows,!0}},{key:"open",value:function(){this.db.open()}},{key:"tempStart",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Cc.get("xy-webrtc-log")||{version:1,num:1},this.initStores(t),this.db.isOpen()){e.next=5;break}return e.next=5,this.db.open();case 5:case"end":return e.stop()}}),e,this)})))}},{key:"init",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Cc.get("xy-webrtc-log")||{version:1,num:1},this.num=t.num,this.initStores(t),e.next=5,this.db["webrtc_log"+this.num].clear();case 5:if(this.isOpen()){e.next=8;break}return e.next=8,this.db.open();case 8:Cc.set("xy-webrtc-log",t);case 9:case"end":return e.stop()}}),e,this)})))}},{key:"initStores",value:function(e){this.db&&!this.db.isOpen()&&(this.db.version(e.version).stores({webrtc_log1:"++id,time,title,content,rest",webrtc_log2:"++id,time,title,content,rest",webrtc_log3:"++id,time,title,content,rest"}),this.db.version(2).stores({webrtc_log1:"++id,t,c",webrtc_log2:"++id,t,c",webrtc_log3:"++id,t,c"}).upgrade())}},{key:"generateZipBlobAsync",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=new il,r.next=3,i.file("xy_webrtc_sdk_log_".concat(n,"_").concat(t,".json"),e,{});case 3:return r.next=5,i.generateAsync({type:"blob",mimeType:"application/zip",compression:"DEFLATE",compressionOptions:{level:9}});case 5:return o=r.sent,r.abrupt("return",o);case 7:case"end":return r.stop()}}),r)})))}}]),e}(),xl=function(e,t,n){var r,i;return Mi&&A(r=t.constructor)&&r!==n&&T(i=r.prototype)&&i!==n.prototype&&Mi(e,i),e},El=b(1..valueOf),Il=vt.f,Ol=_e.f,Cl=Ce.f,Al=kr.trim,Tl=a.Number,Rl=Tl.prototype,Ll=a.TypeError,Nl=b("".slice),Ml=b("".charCodeAt),Pl=function(e){var t=ve(e,"number");return"bigint"==typeof t?t:Dl(t)},Dl=function(e){var t,n,r,i,o,a,s,u,c=ve(e,"number");if(V(c))throw Ll("Cannot convert a Symbol value to a number");if("string"==typeof c&&c.length>2)if(c=Al(c),43===(t=Ml(c,0))||45===t){if(88===(n=Ml(c,2))||120===n)return NaN}else if(48===t){switch(Ml(c,1)){case 66:case 98:r=2,i=49;break;case 79:case 111:r=8,i=55;break;default:return+c}for(a=(o=Nl(c,2)).length,s=0;s<a;s++)if((u=Ml(o,s))<48||u>i)return NaN;return parseInt(o,r)}return+c};if(It("Number",!Tl(" 0o1")||!Tl("0b1")||Tl("+0x1"))){for(var jl,Bl=function(e){var t=arguments.length<1?0:Tl(Pl(e)),n=this;return N(Rl,n)&&s((function(){El(n)}))?xl(Object(t),n,Bl):t},Ul=u?Il(Tl):"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(","),Fl=0;Ul.length>Fl;Fl++)re(Tl,jl=Ul[Fl])&&!re(Bl,jl)&&Cl(Bl,jl,Ol(Tl,jl));Bl.prototype=Rl,Rl.constructor=Bl,$e(a,"Number",Bl)}var zl=a.RangeError,Hl=a.RangeError,Vl=a.String,Wl=Math.floor,Kl=b((function(e){var t=Sn(O(this)),n="",r=tt(e);if(r<0||r==1/0)throw zl("Wrong number of repetitions");for(;r>0;(r>>>=1)&&(t+=t))1&r&&(n+=t);return n})),ql=b("".slice),Gl=b(1..toFixed),Yl=function(e,t,n){return 0===t?n:t%2==1?Yl(e,t-1,n*e):Yl(e*e,t/2,n)},Zl=function(e,t,n){for(var r=-1,i=n;++r<6;)i+=t*e[r],e[r]=i%1e7,i=Wl(i/1e7)},Jl=function(e,t){for(var n=6,r=0;--n>=0;)r+=e[n],e[n]=Wl(r/t),r=r%t*1e7},Xl=function(e){for(var t=6,n="";--t>=0;)if(""!==n||0===t||0!==e[t]){var r=Vl(e[t]);n=""===n?r:n+Kl("0",7-r.length)+r}return n},$l=s((function(){return"0.000"!==Gl(8e-5,3)||"1"!==Gl(.9,0)||"1.25"!==Gl(1.255,2)||"1000000000000000128"!==Gl(0xde0b6b3a7640080,0)}))||!s((function(){Gl({})}));Ct({target:"Number",proto:!0,forced:$l},{toFixed:function(e){var t,n,r,i,o=El(this),a=tt(e),s=[0,0,0,0,0,0],u="",c="0";if(a<0||a>20)throw Hl("Incorrect fraction digits");if(o!=o)return"NaN";if(o<=-1e21||o>=1e21)return Vl(o);if(o<0&&(u="-",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*Yl(2,69,1))-69)<0?o*Yl(2,-t,1):o/Yl(2,t,1),n*=4503599627370496,(t=52-t)>0){for(Zl(s,0,n),r=a;r>=7;)Zl(s,1e7,0),r-=7;for(Zl(s,Yl(10,r,1),0),r=t-1;r>=23;)Jl(s,1<<23),r-=23;Jl(s,1<<r),Zl(s,1,1),Jl(s,2),c=Xl(s)}else Zl(s,0,n),Zl(s,1<<-t,0),c=Xl(s)+Kl("0",a);return c=a>0?u+((i=c.length)<=a?"0."+Kl("0",a-i)+c:ql(c,0,i-a)+"."+ql(c,i-a)):u+c}});var Ql=ct.includes;Ct({target:"Array",proto:!0},{includes:function(e){return Ql(this,e,arguments.length>1?arguments[1]:void 0)}}),mi("includes");var eh=a.TypeError,th=function(e){if(Pr(e))throw eh("The method doesn't accept regular expressions");return e},nh=de("match"),rh=b("".indexOf);Ct({target:"String",proto:!0,forced:!function(e){var t=/./;try{"/./"[e](t)}catch(n){try{return t[nh]=!1,"/./"[e](t)}catch(e){}}return!1}("includes")},{includes:function(e){return!!~rh(Sn(O(this)),Sn(th(e)),arguments.length>1?arguments[1]:void 0)}});var ih=s((function(){At(1)}));Ct({target:"Object",stat:!0,forced:ih},{keys:function(e){return At(te(e))}});var oh=Xe.PROPER,ah=RegExp.prototype,sh=ah.toString,uh=b(xn),ch=s((function(){return"/a/b"!=sh.call({source:"a",flags:"b"})})),lh=oh&&"toString"!=sh.name;(ch||lh)&&$e(RegExp.prototype,"toString",(function(){var e=Ee(this),t=Sn(e.source),n=e.flags;return"/"+t+"/"+Sn(void 0===n&&N(ah,e)&&!("flags"in ah)?uh(e):n)}),{unsafe:!0});var hh=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)}},dh=Object.prototype.toString;function fh(e){return"[object Array]"===dh.call(e)}function ph(e){return void 0===e}function vh(e){return null!==e&&"object"==typeof e}function gh(e){return"[object Function]"===dh.call(e)}function mh(e,t){if(null!=e)if("object"!=typeof e&&(e=[e]),fh(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 yh={isArray:fh,isArrayBuffer:function(e){return"[object ArrayBuffer]"===dh.call(e)},isBuffer:function(e){return null!==e&&!ph(e)&&null!==e.constructor&&!ph(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:vh,isUndefined:ph,isDate:function(e){return"[object Date]"===dh.call(e)},isFile:function(e){return"[object File]"===dh.call(e)},isBlob:function(e){return"[object Blob]"===dh.call(e)},isFunction:gh,isStream:function(e){return vh(e)&&gh(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:mh,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++)mh(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++)mh(arguments[r],n);return t},extend:function(e,t,n){return mh(t,(function(t,r){e[r]=n&&"function"==typeof t?hh(t,n):t})),e},trim:function(e){return e.replace(/^\s*/,"").replace(/\s*$/,"")}};function bh(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 wh=function(e,t,n){if(!t)return e;var r;if(n)r=n(t);else if(yh.isURLSearchParams(t))r=t.toString();else{var i=[];yh.forEach(t,(function(e,t){null!=e&&(yh.isArray(e)?t+="[]":e=[e],yh.forEach(e,(function(e){yh.isDate(e)?e=e.toISOString():yh.isObject(e)&&(e=JSON.stringify(e)),i.push(bh(t)+"="+bh(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 kh(){this.handlers=[]}kh.prototype.use=function(e,t){return this.handlers.push({fulfilled:e,rejected:t}),this.handlers.length-1},kh.prototype.eject=function(e){this.handlers[e]&&(this.handlers[e]=null)},kh.prototype.forEach=function(e){yh.forEach(this.handlers,(function(t){null!==t&&e(t)}))};var _h=kh,Sh=function(e,t,n){return yh.forEach(n,(function(n){e=n(e,t)})),e},xh=function(e){return!(!e||!e.__CANCEL__)},Eh=function(e,t){yh.forEach(e,(function(n,r){r!==t&&r.toUpperCase()===t.toUpperCase()&&(e[t]=n,delete e[r])}))},Ih=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)},Oh=["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"],Ch=yh.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=yh.isString(t)?r(t):t;return n.protocol===e.protocol&&n.host===e.host}}():function(){return!0},Ah=yh.isStandardBrowserEnv()?{write:function(e,t,n,r,i,o){var a=[];a.push(e+"="+encodeURIComponent(t)),yh.isNumber(n)&&a.push("expires="+new Date(n).toGMTString()),yh.isString(r)&&a.push("path="+r),yh.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(){}},Th=function(e){return new Promise((function(t,n){var r=e.data,i=e.headers;yh.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 u,c,l=(u=e.baseURL,c=e.url,u&&!/^([a-z][a-z\d\+\-\.]*:)?\/\//i.test(c)?function(e,t){return t?e.replace(/\/+$/,"")+"/"+t.replace(/^\/+/,""):e}(u,c):c);if(o.open(e.method.toUpperCase(),wh(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?(yh.forEach(e.split("\n"),(function(e){if(r=e.indexOf(":"),t=yh.trim(e.substr(0,r)).toLowerCase(),n=yh.trim(e.substr(r+1)),t){if(i[t]&&Oh.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(Ih("Request failed with status code "+n.status,n.config,null,n.request,n))}(t,n,i),o=null}},o.onabort=function(){o&&(n(Ih("Request aborted",e,"ECONNABORTED",o)),o=null)},o.onerror=function(){n(Ih("Network Error",e,null,o)),o=null},o.ontimeout=function(){var t="timeout of "+e.timeout+"ms exceeded";e.timeoutErrorMessage&&(t=e.timeoutErrorMessage),n(Ih(t,e,"ECONNABORTED",o)),o=null},yh.isStandardBrowserEnv()){var h=Ah,d=(e.withCredentials||Ch(l))&&e.xsrfCookieName?h.read(e.xsrfCookieName):void 0;d&&(i[e.xsrfHeaderName]=d)}if("setRequestHeader"in o&&yh.forEach(i,(function(e,t){void 0===r&&"content-type"===t.toLowerCase()?delete i[t]:o.setRequestHeader(t,e)})),yh.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)}))},Rh={"Content-Type":"application/x-www-form-urlencoded"};function Lh(e,t){!yh.isUndefined(e)&&yh.isUndefined(e["Content-Type"])&&(e["Content-Type"]=t)}var Nh,Mh={adapter:(("undefined"!=typeof XMLHttpRequest||"undefined"!=typeof process&&"[object process]"===Object.prototype.toString.call(process))&&(Nh=Th),Nh),transformRequest:[function(e,t){return Eh(t,"Accept"),Eh(t,"Content-Type"),yh.isFormData(e)||yh.isArrayBuffer(e)||yh.isBuffer(e)||yh.isStream(e)||yh.isFile(e)||yh.isBlob(e)?e:yh.isArrayBufferView(e)?e.buffer:yh.isURLSearchParams(e)?(Lh(t,"application/x-www-form-urlencoded;charset=utf-8"),e.toString()):yh.isObject(e)?(Lh(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}};Mh.headers={common:{Accept:"application/json, text/plain, */*"}},yh.forEach(["delete","get","head"],(function(e){Mh.headers[e]={}})),yh.forEach(["post","put","patch"],(function(e){Mh.headers[e]=yh.merge(Rh)}));var Ph=Mh;function Dh(e){e.cancelToken&&e.cancelToken.throwIfRequested()}var jh=function(e){return Dh(e),e.headers=e.headers||{},e.data=Sh(e.data,e.headers,e.transformRequest),e.headers=yh.merge(e.headers.common||{},e.headers[e.method]||{},e.headers),yh.forEach(["delete","get","head","post","put","patch","common"],(function(t){delete e.headers[t]})),(e.adapter||Ph.adapter)(e).then((function(t){return Dh(e),t.data=Sh(t.data,t.headers,e.transformResponse),t}),(function(t){return xh(t)||(Dh(e),t&&t.response&&(t.response.data=Sh(t.response.data,t.response.headers,e.transformResponse))),Promise.reject(t)}))},Bh=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"];yh.forEach(r,(function(e){void 0!==t[e]&&(n[e]=t[e])})),yh.forEach(i,(function(r){yh.isObject(t[r])?n[r]=yh.deepMerge(e[r],t[r]):void 0!==t[r]?n[r]=t[r]:yh.isObject(e[r])?n[r]=yh.deepMerge(e[r]):void 0!==e[r]&&(n[r]=e[r])})),yh.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 yh.forEach(s,(function(r){void 0!==t[r]?n[r]=t[r]:void 0!==e[r]&&(n[r]=e[r])})),n};function Uh(e){this.defaults=e,this.interceptors={request:new _h,response:new _h}}Uh.prototype.request=function(e){"string"==typeof e?(e=arguments[1]||{}).url=arguments[0]:e=e||{},(e=Bh(this.defaults,e)).method?e.method=e.method.toLowerCase():this.defaults.method?e.method=this.defaults.method.toLowerCase():e.method="get";var t=[jh,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},Uh.prototype.getUri=function(e){return e=Bh(this.defaults,e),wh(e.url,e.params,e.paramsSerializer).replace(/^\?/,"")},yh.forEach(["delete","get","head","options"],(function(e){Uh.prototype[e]=function(t,n){return this.request(yh.merge(n||{},{method:e,url:t}))}})),yh.forEach(["post","put","patch"],(function(e){Uh.prototype[e]=function(t,n,r){return this.request(yh.merge(r||{},{method:e,url:t,data:n}))}}));var Fh=Uh;function zh(e){this.message=e}zh.prototype.toString=function(){return"Cancel"+(this.message?": "+this.message:"")},zh.prototype.__CANCEL__=!0;var Hh=zh;function Vh(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 Hh(e),t(n.reason))}))}Vh.prototype.throwIfRequested=function(){if(this.reason)throw this.reason},Vh.source=function(){var e;return{token:new Vh((function(t){e=t})),cancel:e}};var Wh=Vh;function Kh(e){var t=new Fh(e),n=hh(Fh.prototype.request,t);return yh.extend(n,Fh.prototype,t),yh.extend(n,t),n}var qh=Kh(Ph);qh.Axios=Fh,qh.create=function(e){return Kh(Bh(qh.defaults,e))},qh.Cancel=Hh,qh.CancelToken=Wh,qh.isCancel=xh,qh.all=function(e){return Promise.all(e)},qh.spread=function(e){return function(t){return e.apply(null,t)}};var Gh=qh,Yh=qh;Gh.default=Yh;var Zh,Jh=Gh,Xh=Zr(),$h=[20400,20401,20402,20403,20404,20405],Qh=["CONFNO","HARD","TVBOX","BRUCE","DESK","SOFT"],ed={none:0,wifi:1,"3g":2,wired:3,"2g":4,"4g":5,wwan:6,"3g_china_mobile":7},td={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}},nd={width:{min:640,ideal:1280},height:{min:360,ideal:720}},rd=640,id=360,od={frameRate:Xh.isFirefox?15:{min:15,exact:15,max:15},aspectRatio:1.777777778,resizeMode:"crop-and-scale"},ad=Object.assign({cursor:"always",logicalSurface:!0},od),sd={720:{min:Object.assign(Object.assign({},ad),{frameRate:1,width:1280,height:720}),max:Object.assign(Object.assign({},ad),{frameRate:8,width:1280,height:720})},1080:{min:Object.assign(Object.assign({},ad),{frameRate:1,width:1920,height:1080}),max:Object.assign(Object.assign({},ad),{frameRate:8,width:1920,height:1080})}},ud=Xh.isFirefox?sd:{720:{min:Object.assign(Object.assign({},ad),{frameRate:1,width:{ideal:1280,max:1280},height:{ideal:720,max:720}}),max:Object.assign(Object.assign({},ad),{frameRate:{ideal:8,max:8},width:{ideal:1280,max:1280},height:{ideal:720,max:720}})},1080:{min:Object.assign(Object.assign({},ad),{frameRate:1,width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}}),max:Object.assign(Object.assign({},ad),{frameRate:{ideal:8,max:8},width:{ideal:1920,max:1920},height:{ideal:1080,max:1080}})}},cd={90:{min:Object.assign(Object.assign({},od),{frameRate:1,width:160,height:90}),max:Object.assign(Object.assign({},od),{frameRate:15,width:160,height:90})},180:{min:Object.assign(Object.assign({},od),{frameRate:1,width:320,height:180}),max:Object.assign(Object.assign({},od),{frameRate:15,width:320,height:180})},360:{min:Object.assign(Object.assign({},od),{frameRate:1,width:640,height:360}),max:Object.assign(Object.assign({},od),{frameRate:15,width:640,height:360})},720:{min:Object.assign(Object.assign({},od),{frameRate:1,width:1280,height:720}),max:Object.assign(Object.assign({},od),{frameRate:30,width:1280,height:720})}},ld=Xh.isFirefox?cd:{90:{min:Object.assign(Object.assign({},od),{frameRate:1,width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}}),max:Object.assign(Object.assign({},od),{frameRate:{min:15,exact:15,max:15},width:{min:160,ideal:160,max:160},height:{min:90,ideal:90,max:90}})},180:{min:Object.assign(Object.assign({},od),{frameRate:1,width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}}),max:Object.assign(Object.assign({},od),{frameRate:{min:15,exact:15,max:15},width:{min:320,ideal:320,max:320},height:{min:180,ideal:180,max:180}})},360:{min:Object.assign(Object.assign({},od),{frameRate:1,width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}}),max:Object.assign(Object.assign({},od),{frameRate:{min:15,exact:15,max:15},width:{min:640,ideal:640,max:640},height:{min:360,ideal:360,max:360}})},720:{min:Object.assign(Object.assign({},od),{frameRate:1,width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}}),max:Object.assign(Object.assign({},od),{frameRate:{min:5,ideal:30,max:30},width:{min:1280,ideal:1280,max:1280},height:{min:720,ideal:720,max:720}})}},hd={bundlePolicy:"max-bundle",iceCandidatePoolSize:0,iceServers:[],iceTransportPolicy:"all",rtcpMuxPolicy:"require",sdpSemantics:"unified-plan"},dd={OK:"STATE:200",SERVER_INNER_ERROR:"SIG:4448",PEER_NET_DISCONNECT:"SIG:403",LOCAL_NET_DISCONNECT:"SIG:499"},fd={CLIENT_TYPE:"webrtc",INIT_INTERNELS:{bytesReceived:0,bytesReceivedSecond:0,bytesSent:0,bytesSentSecond:0,mimeType:"video/H264",timestamp:0,receiver:{},sender:{}},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}}},pd=["SPEAKER","GALLERY"],vd=["MULTI_PIC_CONTENT_HIGH_PRIORITY","MULTI_PIC_ACTIVE_HIGH_PRIORITY","TWO_PIC_PIP","CONTENT_ONLY","TWO_PIC_SYMMETRIC"],gd="standardWebRtc",md="thirdWebRtc",yd={muteAudio:"audioMute",unmuteAudio:"audioUnmute",muteVideo:"videoMute",unmuteVideo:"videoUnmute"},bd=(Zh=Object.freeze({__proto__:null,default:{}}))&&Zh.default||Zh,wd=n((function(t,n){var r;t.exports=r=r||function(t,n){var r;if("undefined"!=typeof window&&window.crypto&&(r=window.crypto),"undefined"!=typeof self&&self.crypto&&(r=self.crypto),"undefined"!=typeof globalThis&&globalThis.crypto&&(r=globalThis.crypto),!r&&"undefined"!=typeof window&&window.msCrypto&&(r=window.msCrypto),!r&&void 0!==e&&e.crypto&&(r=e.crypto),!r)try{r=bd}catch(e){}var i=function(){if(r){if("function"==typeof r.getRandomValues)try{return r.getRandomValues(new Uint32Array(1))[0]}catch(e){}if("function"==typeof r.randomBytes)try{return r.randomBytes(4).readInt32LE()}catch(e){}}throw new Error("Native crypto module could not be used to get secure random number.")},o=Object.create||function(){function e(){}return function(t){var n;return e.prototype=t,n=new e,e.prototype=null,n}}(),a={},s=a.lib={},u=s.Base={extend:function(e){var t=o(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=s.WordArray=u.extend({init:function(e,t){e=this.words=e||[],this.sigBytes=null!=t?t:4*e.length},toString:function(e){return(e||h).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 e=this.words,n=this.sigBytes;e[n>>>2]&=4294967295<<32-n%4*8,e.length=t.ceil(n/4)},clone:function(){var e=u.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(i());return new c.init(t,e)}}),l=a.enc={},h=l.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)}},d=l.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)}},f=l.Utf8={stringify:function(e){try{return decodeURIComponent(escape(d.stringify(e)))}catch(e){throw new Error("Malformed UTF-8 data")}},parse:function(e){return d.parse(unescape(encodeURIComponent(e)))}},p=s.BufferedBlockAlgorithm=u.extend({reset:function(){this._data=new c.init,this._nDataBytes=0},_append:function(e){"string"==typeof e&&(e=f.parse(e)),this._data.concat(e),this._nDataBytes+=e.sigBytes},_process:function(e){var n,r=this._data,i=r.words,o=r.sigBytes,a=this.blockSize,s=o/(4*a),u=(s=e?t.ceil(s):t.max((0|s)-this._minBufferSize,0))*a,l=t.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=u.clone.call(this);return e._data=this._data.clone(),e},_minBufferSize:0});s.Hasher=p.extend({cfg:u.extend(),init:function(e){this.cfg=this.cfg.extend(e),this.reset()},reset:function(){p.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 v.HMAC.init(e,n).finalize(t)}}});var v=a.algo={};return a}(Math)})),kd=(n((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=wd).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)})),n((function(e,t){var n;e.exports=(n=wd,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)})),n((function(e,t){var n;e.exports=(n=wd,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)})),n((function(e,t){var n,r,i;e.exports=(r=(n=i=wd).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 u=r.charAt(64);if(u)for(;i.length%4;)i.push(u);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,u=n[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return r.create(i,o)}(e,t,i)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/="},i.enc.Base64)})),n((function(e,t){var n,r,i;e.exports=(r=(n=i=wd).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,u=0;u<4&&a+.75*u<r;u++)o.push(i.charAt(s>>>6*(3-u)&63));var c=i.charAt(64);if(c)for(;o.length%4;)o.push(c);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 u=e.indexOf(s);-1!==u&&(n=u)}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,u=n[e.charCodeAt(a)]>>>6-a%4*2,c=s|u;i[o>>>2]|=c<<24-o%4*8,o++}return r.create(i,o)}(e,n,o)},_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=",_safe_map:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789-_"},i.enc.Base64url)})),n((function(e,t){var n;e.exports=(n=wd,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 u=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],u=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],w=e[t+9],k=e[t+10],_=e[t+11],S=e[t+12],x=e[t+13],E=e[t+14],I=e[t+15],O=o[0],C=o[1],A=o[2],T=o[3];O=c(O,C,A,T,a,7,s[0]),T=c(T,O,C,A,u,12,s[1]),A=c(A,T,O,C,f,17,s[2]),C=c(C,A,T,O,p,22,s[3]),O=c(O,C,A,T,v,7,s[4]),T=c(T,O,C,A,g,12,s[5]),A=c(A,T,O,C,m,17,s[6]),C=c(C,A,T,O,y,22,s[7]),O=c(O,C,A,T,b,7,s[8]),T=c(T,O,C,A,w,12,s[9]),A=c(A,T,O,C,k,17,s[10]),C=c(C,A,T,O,_,22,s[11]),O=c(O,C,A,T,S,7,s[12]),T=c(T,O,C,A,x,12,s[13]),A=c(A,T,O,C,E,17,s[14]),O=l(O,C=c(C,A,T,O,I,22,s[15]),A,T,u,5,s[16]),T=l(T,O,C,A,m,9,s[17]),A=l(A,T,O,C,_,14,s[18]),C=l(C,A,T,O,a,20,s[19]),O=l(O,C,A,T,g,5,s[20]),T=l(T,O,C,A,k,9,s[21]),A=l(A,T,O,C,I,14,s[22]),C=l(C,A,T,O,v,20,s[23]),O=l(O,C,A,T,w,5,s[24]),T=l(T,O,C,A,E,9,s[25]),A=l(A,T,O,C,p,14,s[26]),C=l(C,A,T,O,b,20,s[27]),O=l(O,C,A,T,x,5,s[28]),T=l(T,O,C,A,f,9,s[29]),A=l(A,T,O,C,y,14,s[30]),O=h(O,C=l(C,A,T,O,S,20,s[31]),A,T,g,4,s[32]),T=h(T,O,C,A,b,11,s[33]),A=h(A,T,O,C,_,16,s[34]),C=h(C,A,T,O,E,23,s[35]),O=h(O,C,A,T,u,4,s[36]),T=h(T,O,C,A,v,11,s[37]),A=h(A,T,O,C,y,16,s[38]),C=h(C,A,T,O,k,23,s[39]),O=h(O,C,A,T,x,4,s[40]),T=h(T,O,C,A,a,11,s[41]),A=h(A,T,O,C,p,16,s[42]),C=h(C,A,T,O,m,23,s[43]),O=h(O,C,A,T,w,4,s[44]),T=h(T,O,C,A,S,11,s[45]),A=h(A,T,O,C,I,16,s[46]),O=d(O,C=h(C,A,T,O,f,23,s[47]),A,T,a,6,s[48]),T=d(T,O,C,A,y,10,s[49]),A=d(A,T,O,C,E,15,s[50]),C=d(C,A,T,O,g,21,s[51]),O=d(O,C,A,T,S,6,s[52]),T=d(T,O,C,A,p,10,s[53]),A=d(A,T,O,C,k,15,s[54]),C=d(C,A,T,O,u,21,s[55]),O=d(O,C,A,T,b,6,s[56]),T=d(T,O,C,A,I,10,s[57]),A=d(A,T,O,C,m,15,s[58]),C=d(C,A,T,O,x,21,s[59]),O=d(O,C,A,T,v,6,s[60]),T=d(T,O,C,A,_,10,s[61]),A=d(A,T,O,C,f,15,s[62]),C=d(C,A,T,O,w,21,s[63]),o[0]=o[0]+O|0,o[1]=o[1]+C|0,o[2]=o[2]+A|0,o[3]=o[3]+T|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,u=s.words,c=0;c<4;c++){var l=u[c];u[c]=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 c(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(u),t.HmacMD5=o._createHmacHelper(u)}(Math),n.MD5)})),n((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=wd).lib,i=r.WordArray,o=r.Hasher,a=n.algo,s=[],u=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],u=n[4],c=0;c<80;c++){if(c<16)s[c]=0|e[t+c];else{var l=s[c-3]^s[c-8]^s[c-14]^s[c-16];s[c]=l<<1|l>>>31}var h=(r<<5|r>>>27)+u+s[c];h+=c<20?1518500249+(i&o|~i&a):c<40?1859775393+(i^o^a):c<60?(i&o|i&a|o&a)-1894007588:(i^o^a)-899497514,u=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]+u|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(u),n.HmacSHA1=o._createHmacHelper(u),c.SHA1)})),n((function(e,t){var n;e.exports=(n=wd,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.algo,s=[],u=[];!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))),u[i]=n(e.pow(r,1/3)),i++),r++}();var c=[],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)c[f]=0|e[t+f];else{var p=c[f-15],v=(p<<25|p>>>7)^(p<<14|p>>>18)^p>>>3,g=c[f-2],m=(g<<15|g>>>17)^(g<<13|g>>>19)^g>>>10;c[f]=v+c[f-7]+m+c[f-16]}var y=r&i^r&o^i&o,b=(r<<30|r>>>2)^(r<<19|r>>>13)^(r<<10|r>>>22),w=d+((s<<26|s>>>6)^(s<<21|s>>>11)^(s<<7|s>>>25))+(s&l^~s&h)+u[f]+c[f];d=h,h=l,l=s,s=a+w|0,a=o,o=i,i=r,r=w+(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)})),n((function(e,t){var n,r,i,o,a,s;e.exports=(r=(n=s=wd).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)})),n((function(e,t){var n;e.exports=(n=wd,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 u=[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)],c=[];!function(){for(var e=0;e<80;e++)c[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,w=a.low,k=s.high,_=s.low,S=l.high,x=l.low,E=h.high,I=h.low,O=d.high,C=d.low,A=f,T=p,R=v,L=g,N=m,M=y,P=b,D=w,j=k,B=_,U=S,F=x,z=E,H=I,V=O,W=C,K=0;K<80;K++){var q,G,Y=c[K];if(K<16)G=Y.high=0|e[t+2*K],q=Y.low=0|e[t+2*K+1];else{var Z=c[K-15],J=Z.high,X=Z.low,$=(J>>>1|X<<31)^(J>>>8|X<<24)^J>>>7,Q=(X>>>1|J<<31)^(X>>>8|J<<24)^(X>>>7|J<<25),ee=c[K-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=c[K-7],ae=oe.high,se=oe.low,ue=c[K-16],ce=ue.high,le=ue.low;G=(G=(G=$+ae+((q=Q+se)>>>0<Q>>>0?1:0))+re+((q+=ie)>>>0<ie>>>0?1:0))+ce+((q+=le)>>>0<le>>>0?1:0),Y.high=G,Y.low=q}var he,de=j&U^~j&z,fe=B&F^~B&H,pe=A&R^A&N^R&N,ve=T&L^T&M^L&M,ge=(A>>>28|T<<4)^(A<<30|T>>>2)^(A<<25|T>>>7),me=(T>>>28|A<<4)^(T<<30|A>>>2)^(T<<25|A>>>7),ye=(j>>>14|B<<18)^(j>>>18|B<<14)^(j<<23|B>>>9),be=(B>>>14|j<<18)^(B>>>18|j<<14)^(B<<23|j>>>9),we=u[K],ke=we.high,_e=we.low,Se=V+ye+((he=W+be)>>>0<W>>>0?1:0),xe=me+ve;V=z,W=H,z=U,H=F,U=j,F=B,j=P+(Se=(Se=(Se=Se+de+((he+=fe)>>>0<fe>>>0?1:0))+ke+((he+=_e)>>>0<_e>>>0?1:0))+G+((he+=q)>>>0<q>>>0?1:0))+((B=D+he|0)>>>0<D>>>0?1:0)|0,P=N,D=M,N=R,M=L,R=A,L=T,A=Se+(ge+pe+(xe>>>0<me>>>0?1:0))+((T=he+xe|0)>>>0<he>>>0?1:0)|0}p=r.low=p+T,r.high=f+A+(p>>>0<T>>>0?1:0),g=i.low=g+L,i.high=v+R+(g>>>0<L>>>0?1:0),y=o.low=y+M,o.high=m+N+(y>>>0<M>>>0?1:0),w=a.low=w+D,a.high=b+P+(w>>>0<D>>>0?1:0),_=s.low=_+B,s.high=k+j+(_>>>0<B>>>0?1:0),x=l.low=x+F,l.high=S+U+(x>>>0<F>>>0?1:0),I=h.low=I+H,h.high=E+z+(I>>>0<H>>>0?1:0),C=d.low=C+W,d.high=O+V+(C>>>0<W>>>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)})),n((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=wd).x64,i=r.Word,o=r.WordArray,a=n.algo,s=a.SHA512,u=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(u),n.HmacSHA384=s._createHmacHelper(u),c.SHA384)})),n((function(e,t){var n;e.exports=(n=wd,function(e){var t=n,r=t.lib,i=r.WordArray,o=r.Hasher,a=t.x64.Word,s=t.algo,u=[],c=[],l=[];!function(){for(var e=1,t=0,n=0;n<24;n++){u[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++)c[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),(C=n[i]).high^=a,C.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^=(C=n[d+5*v]).high,p^=C.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,w=y.low;for(f=m.high^(b<<1|w>>>31),p=m.low^(w<<1|b>>>31),v=0;v<5;v++)(C=n[d+5*v]).high^=f,C.low^=p}for(var k=1;k<25;k++){var _=(C=n[k]).high,S=C.low,x=u[k];x<32?(f=_<<x|S>>>32-x,p=S<<x|_>>>32-x):(f=S<<x-32|_>>>64-x,p=_<<x-32|S>>>64-x);var E=h[c[k]];E.high=f,E.low=p}var I=h[0],O=n[0];for(I.high=O.high,I.low=O.low,d=0;d<5;d++)for(v=0;v<5;v++){var C=n[k=d+5*v],A=h[k],T=h[(d+1)%5+5*v],R=h[(d+2)%5+5*v];C.high=A.high^~T.high&R.high,C.low=A.low^~T.low&R.low}C=n[0];var L=l[s];C.high^=L.high,C.low^=L.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,u=s/8,c=[],l=0;l<u;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),c.push(f),c.push(d)}return new i.init(c,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)})),n((function(e,t){var n;e.exports=(n=wd,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]),u=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]),c=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,w,k,_,S,x,E,I,O,C=this._hash.words,A=h.words,T=d.words,R=s.words,L=u.words,N=c.words,M=l.words;for(_=o=C[0],S=a=C[1],x=f=C[2],E=w=C[3],I=k=C[4],n=0;n<80;n+=1)O=o+e[t+R[n]]|0,O+=n<16?p(a,f,w)+A[0]:n<32?v(a,f,w)+A[1]:n<48?g(a,f,w)+A[2]:n<64?m(a,f,w)+A[3]:y(a,f,w)+A[4],O=(O=b(O|=0,N[n]))+k|0,o=k,k=w,w=b(f,10),f=a,a=O,O=_+e[t+L[n]]|0,O+=n<16?y(S,x,E)+T[0]:n<32?m(S,x,E)+T[1]:n<48?g(S,x,E)+T[2]:n<64?v(S,x,E)+T[3]:p(S,x,E)+T[4],O=(O=b(O|=0,M[n]))+I|0,_=I,I=E,E=b(x,10),x=S,S=O;O=C[1]+f+E|0,C[1]=C[2]+w+I|0,C[2]=C[3]+k+_|0,C[3]=C[4]+o+S|0,C[4]=C[0]+a+x|0,C[0]=O},_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)})),n((function(e,t){var n,r,i;e.exports=(r=(n=wd).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,u=a.words,c=0;c<n;c++)s[c]^=1549556828,u[c]^=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))}})))})),n((function(e,t){var n,r,i,o,a,s,u,c,l;e.exports=(r=(n=l=wd).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.SHA1,u=a.HMAC,c=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=u.create(n.hasher,e),i=o.create(),a=o.create([1]),s=i.words,c=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),c[0]++}return i.sigBytes=4*l,i}}),n.PBKDF2=function(e,t,n){return c.create(n).compute(e,t)},l.PBKDF2)})),n((function(e,t){var n,r,i,o,a,s,u,c;e.exports=(r=(n=c=wd).lib,i=r.Base,o=r.WordArray,a=n.algo,s=a.MD5,u=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,u=r.keySize,c=r.iterations;s.length<u;){n&&i.update(n),n=i.update(e).finalize(t),i.reset();for(var l=1;l<c;l++)n=i.finalize(n),i.reset();a.concat(n)}return a.sigBytes=4*u,a}}),n.EvpKDF=function(e,t,n){return u.create(n).compute(e,t)},c.EvpKDF)})),n((function(e,t){var n;e.exports=void((n=wd).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 u=s.Base64,c=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 u=o.create(a,r);e.concat(u)},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(u)},parse:function(e){var t,n=u.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=c.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)}})}())})),n((function(e,t){var n;e.exports=((n=wd).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)})),n((function(e,t){var n,r,i;e.exports=((i=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).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 u=0;u<i;u++)e[n+u]^=s[u]}});return e.Decryptor=r,e}(),n.mode.CTRGladman)})),n((function(e,t){var n,r,i;e.exports=((i=wd).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)})),n((function(e,t){var n,r;e.exports=((r=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).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)})),n((function(e,t){var n;e.exports=((n=wd).pad.NoPadding={pad:function(){},unpad:function(){}},n.pad.NoPadding)})),n((function(e,t){var n,r,i,o;e.exports=(r=(n=o=wd).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)})),n((function(e,t){var n;e.exports=(n=wd,function(){var e=n,t=e.lib.BlockCipher,r=e.algo,i=[],o=[],a=[],s=[],u=[],c=[],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,u[n]=y<<8|y>>>24,c[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]:(c=o[a-1],a%n?n>6&&a%n==4&&(c=i[c>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c]):(c=i[(c=c<<8|c>>>24)>>>24]<<24|i[c>>>16&255]<<16|i[c>>>8&255]<<8|i[255&c],c^=p[a/n|0]<<24),o[a]=o[a-n]^c);for(var s=this._invKeySchedule=[],u=0;u<r;u++){if(a=r-u,u%4)var c=o[a];else c=o[a-4];s[u]=u<4||a<=4?c:l[i[c>>>24]]^h[i[c>>>16&255]]^d[i[c>>>8&255]]^f[i[255&c]]}}},encryptBlock:function(e,t){this._doCryptBlock(e,t,this._keySchedule,a,s,u,c,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 u=this._nRounds,c=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<u;p++){var v=r[c>>>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&c]^n[f++],m=r[h>>>24]^i[d>>>16&255]^o[c>>>8&255]^a[255&l]^n[f++],y=r[d>>>24]^i[c>>>16&255]^o[l>>>8&255]^a[255&h]^n[f++];c=v,l=g,h=m,d=y}v=(s[c>>>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&c])^n[f++],m=(s[h>>>24]<<24|s[d>>>16&255]<<16|s[c>>>8&255]<<8|s[255&l])^n[f++],y=(s[d>>>24]<<24|s[c>>>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)})),n((function(e,t){var n;e.exports=(n=wd,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],u=[1,2,4,6,8,10,12,14,15,17,19,21,23,25,27,28],c=[{0:8421888,268435456:32768,536870912:8421378,805306368:2,1073741824:512,1342177280:8421890,1610612736:8389122,1879048192:8388608,2147483648:514,2415919104:8389120,2684354560:33280,2952790016:8421376,3221225472:32770,3489660928:8388610,3758096384:0,4026531840:33282,134217728:0,402653184:8421890,671088640:33282,939524096:32768,1207959552:8421888,1476395008:512,1744830464:8421378,2013265920:2,2281701376:8389120,2550136832:33280,2818572288:8421376,3087007744:8389122,3355443200:8388610,3623878656:32770,3892314112:514,4160749568:8388608,1:32768,268435457:2,536870913:8421888,805306369:8388608,1073741825:8421378,1342177281:33280,1610612737:512,1879048193:8389122,2147483649:8421890,2415919105:8421376,2684354561:8388610,2952790017:33282,3221225473:514,3489660929:8389120,3758096385:32770,4026531841:0,134217729:8421890,402653185:8421376,671088641:8388608,939524097:512,1207959553:32768,1476395009:8388610,1744830465:2,2013265921:33282,2281701377:32770,2550136833:8389122,2818572289:514,3087007745:8421888,3355443201:8389120,3623878657:0,3892314113:33280,4160749569:8421378},{0:1074282512,16777216:16384,33554432:524288,50331648:1074266128,67108864:1073741840,83886080:1074282496,100663296:1073758208,117440512:16,134217728:540672,150994944:1073758224,167772160:1073741824,184549376:540688,201326592:524304,218103808:0,234881024:16400,251658240:1074266112,8388608:1073758208,25165824:540688,41943040:16,58720256:1073758224,75497472:1074282512,92274688:1073741824,109051904:524288,125829120:1074266128,142606336:524304,159383552:0,176160768:16384,192937984:1074266112,209715200:1073741840,226492416:540672,243269632:1074282496,260046848:16400,268435456:0,285212672:1074266128,301989888:1073758224,318767104:1074282496,335544320:1074266112,352321536:16,369098752:540688,385875968:16384,402653184:16400,419430400:524288,436207616:524304,452984832:1073741840,469762048:540672,486539264:1073758208,503316480:1073741824,520093696:1074282512,276824064:540688,293601280:524288,310378496:1074266112,327155712:16384,343932928:1073758208,360710144:1074282512,377487360:16,394264576:1073741824,411041792:1074282496,427819008:1073741840,444596224:1073758224,461373440:524304,478150656:0,494927872:16400,511705088:1074266128,528482304:540672},{0:260,1048576:0,2097152:67109120,3145728:65796,4194304:65540,5242880:67108868,6291456:67174660,7340032:67174400,8388608:67108864,9437184:67174656,10485760:65792,11534336:67174404,12582912:67109124,13631488:65536,14680064:4,15728640:256,524288:67174656,1572864:67174404,2621440:0,3670016:67109120,4718592:67108868,5767168:65536,6815744:65540,7864320:260,8912896:4,9961472:256,11010048:67174400,12058624:65796,13107200:65792,14155776:67109124,15204352:67174660,16252928:67108864,16777216:67174656,17825792:65540,18874368:65536,19922944:67109120,20971520:256,22020096:67174660,23068672:67108868,24117248:0,25165824:67109124,26214400:67108864,27262976:4,28311552:65792,29360128:67174400,30408704:260,31457280:65796,32505856:67174404,17301504:67108864,18350080:260,19398656:67174656,20447232:0,21495808:65540,22544384:67109120,23592960:256,24641536:67174404,25690112:65536,26738688:67174660,27787264:65796,28835840:67108868,29884416:67109124,30932992:67174400,31981568:4,33030144:65792},{0:2151682048,65536:2147487808,131072:4198464,196608:2151677952,262144:0,327680:4198400,393216:2147483712,458752:4194368,524288:2147483648,589824:4194304,655360:64,720896:2147487744,786432:2151678016,851968:4160,917504:4096,983040:2151682112,32768:2147487808,98304:64,163840:2151678016,229376:2147487744,294912:4198400,360448:2151682112,425984:0,491520:2151677952,557056:4096,622592:2151682048,688128:4194304,753664:4160,819200:2147483648,884736:4194368,950272:4198464,1015808:2147483712,1048576:4194368,1114112:4198400,1179648:2147483712,1245184:0,1310720:4160,1376256:2151678016,1441792:2151682048,1507328:2147487808,1572864:2151682112,1638400:2147483648,1703936:2151677952,1769472:4198464,1835008:2147487744,1900544:4194304,1966080:64,2031616:4096,1081344:2151677952,1146880:2151682112,1212416:0,1277952:4198400,1343488:4194368,1409024:2147483648,1474560:2147487808,1540096:64,1605632:2147483712,1671168:4096,1736704:2147487744,1802240:2151678016,1867776:4160,1933312:2151682048,1998848:4194304,2064384:4198464},{0:128,4096:17039360,8192:262144,12288:536870912,16384:537133184,20480:16777344,24576:553648256,28672:262272,32768:16777216,36864:537133056,40960:536871040,45056:553910400,49152:553910272,53248:0,57344:17039488,61440:553648128,2048:17039488,6144:553648256,10240:128,14336:17039360,18432:262144,22528:537133184,26624:553910272,30720:536870912,34816:537133056,38912:0,43008:553910400,47104:16777344,51200:536871040,55296:553648128,59392:16777216,63488:262272,65536:262144,69632:128,73728:536870912,77824:553648256,81920:16777344,86016:553910272,90112:537133184,94208:16777216,98304:553910400,102400:553648128,106496:17039360,110592:537133056,114688:262272,118784:536871040,122880:0,126976:17039488,67584:553648256,71680:16777216,75776:17039360,79872:537133184,83968:536870912,88064:17039488,92160:128,96256:553910272,100352:262272,104448:553910400,108544:0,112640:553648128,116736:16777344,120832:262144,124928:537133056,129024:536871040},{0:268435464,256:8192,512:270532608,768:270540808,1024:268443648,1280:2097152,1536:2097160,1792:268435456,2048:0,2304:268443656,2560:2105344,2816:8,3072:270532616,3328:2105352,3584:8200,3840:270540800,128:270532608,384:270540808,640:8,896:2097152,1152:2105352,1408:268435464,1664:268443648,1920:8200,2176:2097160,2432:8192,2688:268443656,2944:270532616,3200:0,3456:270540800,3712:2105344,3968:268435456,4096:268443648,4352:270532616,4608:270540808,4864:8200,5120:2097152,5376:268435456,5632:268435464,5888:2105344,6144:2105352,6400:0,6656:8,6912:270532608,7168:8192,7424:268443656,7680:270540800,7936:2097160,4224:8,4480:2105344,4736:2097152,4992:268435464,5248:268443648,5504:8200,5760:270540808,6016:270532608,6272:270540800,6528:270532616,6784:8192,7040:2105352,7296:2097160,7552:0,7808:268435456,8064:268443656},{0:1048576,16:33555457,32:1024,48:1049601,64:34604033,80:0,96:1,112:34603009,128:33555456,144:1048577,160:33554433,176:34604032,192:34603008,208:1025,224:1049600,240:33554432,8:34603009,24:0,40:33555457,56:34604032,72:1048576,88:33554433,104:33554432,120:1025,136:1049601,152:33555456,168:34603008,184:1048577,200:1024,216:34604033,232:1,248:1049600,256:33554432,272:1048576,288:33555457,304:34603009,320:1048577,336:33555456,352:34604032,368:1049601,384:1025,400:34604033,416:1049600,432:1,448:0,464:34603008,480:33554433,496:1024,264:1049600,280:33555457,296:34603009,312:1,328:33554432,344:1048576,360:1025,376:34604032,392:33554433,408:34603008,424:0,440:34604033,456:1049601,472:1024,488:33555456,504:1048577},{0:134219808,1:131072,2:134217728,3:32,4:131104,5:134350880,6:134350848,7:2048,8:134348800,9:134219776,10:133120,11:134348832,12:2080,13:0,14:134217760,15:133152,2147483648:2048,2147483649:134350880,2147483650:134219808,2147483651:134217728,2147483652:134348800,2147483653:133120,2147483654:133152,2147483655:32,2147483656:134217760,2147483657:2080,2147483658:131104,2147483659:134350848,2147483660:0,2147483661:134348832,2147483662:134219776,2147483663:131072,16:133152,17:134350848,18:32,19:2048,20:134219776,21:134217760,22:134348832,23:131072,24:0,25:131104,26:134348800,27:134219808,28:134350880,29:133120,30:2080,31:134217728,2147483664:131072,2147483665:2048,2147483666:134348832,2147483667:133152,2147483668:32,2147483669:134348800,2147483670:134217728,2147483671:134219808,2147483672:134350880,2147483673:134217760,2147483674:134219776,2147483675:0,2147483676:133120,2147483677:2080,2147483678:131104,2147483679:134350848}],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 c=i[o]=[],l=u[o];for(n=0;n<24;n++)c[n/6|0]|=t[(s[n]-1+l)%28]<<31-n%6,c[4+(n/6|0)]|=t[28+(s[n+24]-1+l)%28]<<31-n%6;for(c[0]=c[0]<<1|c[0]>>>31,n=1;n<7;n++)c[n]=c[n]>>>4*(n-1)+3;c[7]=c[7]<<5|c[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,u=0;u<8;u++)s|=c[u][((a^i[u])&l[u])>>>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)})),n((function(e,t){var n;e.exports=(n=wd,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 u=r[i];r[i]=r[o],r[o]=u}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)})),n((function(e,t){var n;e.exports=(n=wd,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++)u.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],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&l,d=l<<16|65535&c;for(i[0]^=c,i[1]^=h,i[2]^=l,i[3]^=d,i[4]^=c,i[5]^=h,i[6]^=l,i[7]^=d,n=0;n<4;n++)u.call(this)}},_doProcessBlock:function(e,t){var n=this._X;u.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 u(){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,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=u^c}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)})),n((function(e,t){var n;e.exports=(n=wd,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++)u.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],c=16711935&(a<<8|a>>>24)|4278255360&(a<<24|a>>>8),l=16711935&(s<<8|s>>>24)|4278255360&(s<<24|s>>>8),h=c>>>16|4294901760&l,d=l<<16|65535&c;for(r[0]^=c,r[1]^=h,r[2]^=l,r[3]^=d,r[4]^=c,r[5]^=h,r[6]^=l,r[7]^=d,i=0;i<4;i++)u.call(this)}},_doProcessBlock:function(e,t){var n=this._X;u.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 u(){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,u=((i*i>>>17)+i*s>>>15)+s*s,c=((4294901760&r)*r|0)+((65535&r)*r|0);a[n]=u^c}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)})),n((function(e,t){e.exports=wd}))),_d=function(){function e(t){var n=this;$r(this,e),this.assignOptions=function(e){return Object.assign({},n.commonOption,e,{params:Object.assign({},n.commonOption.params,e&&e.params)})},this.get=function(e,t){return n.axios.get(e,n.assignOptions(t)).catch((function(e){return{err:e}}))},this.put=function(e,t,r){return n.axios.put(e,t,n.assignOptions(r)).catch((function(e){return{err:e}}))},this.post=function(e,t,r){return n.axios.post(e,t,n.assignOptions(r)).catch((function(e){return{err:e}}))},this.delete=function(e,t){return n.axios.delete(e,n.assignOptions(t)).catch((function(e){return{err:e}}))},this.commonOption=t,this.loginInfo=null,this.logger=null,this.baseUrl="",this.clientId="";var r=Object.assign(Object.assign({},t),{headers:{"n-ua":"PL=webrtc-sdk&AV=1.0.0&DR=&RL=&MF=&MO=web&OS=web-sdk&API=&LCLO=&LCLA=&CK="}});Jh.defaults.timeout=1e4,this.axios=Jh.create(r),this.axios.interceptors.request.use((function(e){var t=Math.ceil(1e4*Math.random());return e.url.includes("?")?e.url+="&random=".concat(t):e.url+="?random=".concat(t),n.setHttpConfig(e),n.logger&&n.logger.log("[http] request:",e.url),e})),this.axios.interceptors.response.use((function(e){return n.logger&&n.logger.log("[http] response:",null==e?void 0:e.data),e}),(function(e){return n.logger&&n.logger.log("[http] response error:",e),Promise.reject(e)}))}return ei(e,[{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:"setClientId",value:function(e){this.clientId=e}},{key:"setHttpConfig",value:function(e){if(1===e.sign||2===e.sign)if(2===e.sign||this.loginInfo){var t=e.method,n=e.data,r=e.url,i=e.params,o=e.clientId,a=void 0===o?this.clientId:o,s=e.clientSecret,u=void 0===s?"":s,c="";Object.keys(i).map((function(e){c&&(c+="&"),c+="".concat(e,"=").concat(encodeURIComponent(i[e]))}));var l=c?r+"&"+c:r,h={method:(t||"").toLocaleUpperCase(),data:JSON.stringify(n)||"",url:l||"",clientId:a,clientSecret:u};e.headers=Object.assign({},this.setHeader(h))}else e.headers["x-xy-clientid"]=e.clientId||this.clientId,e.headers["x-xy-clienttype"]=fd.CLIENT_TYPE}},{key:"setHeader",value:function(e){var t=(this.loginInfo||{access_token:""}).access_token,n=void 0===t?"":t,r=e.method,i=e.url,o=e.data,a=void 0===o?"":o,s=e.clientId,u=void 0===s?"Dx9AiLgQEOboyidOWxGoQRSi":s,c=e.clientSecret,l=Math.random(),h=(new Date).getTime(),d=kd.MD5(a).toString(),f="x-xy-clientid=".concat(u,"&x-xy-nonce=").concat(l,"&x-xy-signtype=HMAC_SHA256&x-xy-timestamp=").concat(h),p=n||c,v="".concat(r,"\n").concat(f,"\n").concat(i,"\n").concat(d,"\naccess_token=").concat(p),g=kd.HmacSHA256(v,p).toString().toLocaleUpperCase(),m={"x-xy-clientid":u,"x-xy-clienttype":fd.CLIENT_TYPE,"x-xy-nonce":l,"x-xy-timestamp":h,"x-xy-signtype":"HMAC_SHA256","x-xy-sign":g};return n&&Object.assign(m,{Authorization:"Bearer ".concat(n||"")}),Object.assign(Object.assign({},this.axios.defaults.headers),m)}},{key:"setLoginInfo",value:function(e){this.loginInfo=e}}]),e}(),Sd="2.0.3-beta.11 - build on 2022-01-13 14:59",xd="wss://cloudapi.xylink.com",Ed="https://cloudapi.xylink.com",Id="https://log.xylink.com",Od="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),Cd=new Uint8Array(16);function Ad(){if(!Od)throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return Od(Cd)}for(var Td=[],Rd=0;Rd<256;++Rd)Td[Rd]=(Rd+256).toString(16).substr(1);function Ld(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||Ad)();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=Td;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 Nd=new(function(){function e(){var t=this;$r(this,e),this.getWatermarkContent=function(e){return sn(t,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.commonParams.securityKey,r="/api/rest/v1/meetingroom/conferenceNumber/watermarkContent/".concat(e,"?securityKey=").concat(n),t.next=4,this.http.get(r);case 4:return t.abrupt("return",t.sent);case 5:case"end":return t.stop()}}),t,this)})))},this.getEnterpriseId=function(e){var n=e.extId,r=e.clientId,i=e.clientSecret,o=e.httpServer;return sn(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,a,s;return regeneratorRuntime.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:o,sign:2,clientSecret:i,clientId:r});case 3:if(200!==(s=e.sent).status){e.next=6;break}return e.abrupt("return",(null===(t=s.data)||void 0===t?void 0:t.enterpriseId)||"");case 6:return e.abrupt("return","");case 7:case"end":return e.stop()}}),e,this)})))},this.locator=function(e){var n=e.extId,r=e.clientId,i=e.clientSecret,o=e.httpServer;return sn(t,void 0,void 0,regeneratorRuntime.mark((function e(){var t,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t="/api/rest/v1/locator/".concat(n,"/node/config"),e.next=3,this.http.get(t,{baseURL:o,sign:2,clientSecret:i,clientId:r});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()}}),e,this)})))},this.http=new _d({baseURL:Ed,timeout:2e4,sign:1}),this.logHttp=new _d({baseURL:Id,timeout:2e4,sign:0}),this.meetingInfo={meetingId:"",callUri:""},this.seqId=0,this.statesTime={timeDiff:0},this.commonParams={securityKey:""}}return ei(e,[{key:"setBaseUrl",value:function(e,t){this.http.setBaseUrl(e),this.logHttp.setBaseUrl(t)}},{key:"setLogBaseUrl",value:function(e){this.logHttp.setBaseUrl(e)}},{key:"setClientId",value:function(e){this.http.setClientId(e)}},{key:"setLogger",value:function(e){this.http.setLogger(e),this.logHttp.setLogger(e)}},{key:"setMeetingInfo",value:function(e){this.meetingInfo=e}},{key:"upload",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.logHttp.post("/api/rest/v1/log/standardLog",e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t,this)})))}},{key:"login",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),n=e.userName,r=e.password,i=e.extId,o="/api/rest/iauth/v5/en/login",i&&(o+="?extId=".concat(i)),t.next=6,this.http.put(o,{account:n,password:r,deviceType:17,deviceSn:Ld()});case 6:return(a=t.sent).data&&200===a.status&&this.http.setLoginInfo(a.data.token),t.abrupt("return",a);case 9:case"end":return t.stop()}}),t,this)})))}},{key:"getSdkUserInfo",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.http.setLoginInfo(""),n=e.displayName,r=e.extId,i=e.extUserId,a={extId:r,displayName:n},(o=void 0===i?"":i)&&Object.assign(a,{externalUserId:o}),t.next=6,this.http.post("/api/rest/internal/v1/en/sdk/webRtc/user?extId=".concat(r),a);case 6:return s=t.sent,t.abrupt("return",s);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"setLoginInfo",value:function(e){this.http.setLoginInfo(e)}},{key:"getUserInfo",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.http.post("/admin/login/current/user",{token:e});case 2:if(!(n=t.sent).data||0!==n.data.code){t.next=7;break}return r=n.data.data.securityKey,(i=void 0===r?"":r)&&(this.commonParams=Object.assign(Object.assign({},this.commonParams),{securityKey:i})),t.abrupt("return",n.data.data);case 7:return t.abrupt("return",n);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"getCallUri",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.commonParams.securityKey,t.next=3,this.http.get("/api/rest/uss/v4/callUrlInfoV2",{params:Object.assign(Object.assign({},e),{securityKey:n})});case 3:if(!(r=t.sent)||!r.data){t.next=6;break}return t.abrupt("return",r.data);case 6:return t.abrupt("return",r);case 7:case"end":return t.stop()}}),t,this)})))}},{key:"verifyPassword",value:function(e,t){return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return r=this.commonParams.securityKey,n.next=3,this.http.put("/api/rest/uss/v4/en/cloudmeeting/validation?securitykey=".concat(r),{number:e,passwd:t});case 3:return i=n.sent,n.abrupt("return",i);case 5:case"end":return n.stop()}}),n,this)})))}},{key:"hand",value:function(e,t,n,r){return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return i.next=2,this.http.post("/page/api/rest/v2/".concat(e,"?meetingId=").concat(t,"&di=").concat(n,"&conferenceNo=").concat(r));case 2:return o=i.sent,i.abrupt("return",o);case 4:case"end":return i.stop()}}),i,this)})))}},{key:"fetchErrorCode",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.http.get("/api/rest/clientConfg/v3/getDefaultServerConfig?configName=errorcode&securityKey=".concat(this.commonParams.securityKey));case 2:return t=e.sent,e.abrupt("return",t);case 4:case"end":return e.stop()}}),e,this)})))}},{key:"getErrorCodeByJson",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,new _d({baseURL:""}).get(e);case 2:return n=t.sent,t.abrupt("return",n);case 4:case"end":return t.stop()}}),t)})))}},{key:"getConference",value:function(e,t){return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.abrupt("return",this.http.get("/api/rest/v1/meetingroom/hidden/soft/conference?userProfileId=".concat(e,"&securityKey=").concat(t)));case 1:case"end":return n.stop()}}),n,this)})))}},{key:"setStates1",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i=this.meetingInfo,o=i.meetingId,a=i.callUri,s={meetingId:o,callUri:a,action:e,eventType:t,timestamp:(new Date).getTime()},u=JSON.stringify(Object.assign({},s,n)),c={device:a,msgVer:"0.0.1",states:[{name:"meetingEvent",version:"1.0",value:u,tag:"audit"}]},r.prev=4,r.next=7,this.http.post("/api/rest/v3/device/states",c);case 7:r.next=11;break;case 9:r.prev=9,r.t0=r.catch(4);case 11:case"end":return r.stop()}}),r,this,[[4,9]])})))}},{key:"setStates",value:function(e,t){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c,l,h,d,f,p,v,g,m,y,b;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=this.meetingInfo,a=o.meetingId,s=void 0===a?"":a,u=o.callUri,c=String((new Date).getTime()),l=String((new Date).getTime()+this.statesTime.timeDiff),h=[{seqId:String(this.seqId),createTime:c,alignTime:l,category:e,eventName:t,version:"1.0",meetingId:s,eventValue:JSON.stringify(r)}],d={device:u,msgVer:"0.0.2",sendTime:String((new Date).getTime()),states:h},i.prev=5,f=(new Date).getTime(),i.next=9,this.http.post("/api/rest/v3/device/v2states",d);case 9:p=i.sent,this.seqId++,(null===(n=null==p?void 0:p.data)||void 0===n?void 0:n.currentTime)&&(v=p.data.currentTime,g=void 0===v?0:v,m=(new Date).getTime(),y=Math.round((m-f)/2),b=Number(g)+y-m,this.statesTime.timeDiff=b),i.next=16;break;case 14:i.prev=14,i.t0=i.catch(5);case 16:case"end":return i.stop()}}),i,this,[[5,14]])})))}},{key:"igonreMeetingMonito",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=(1e3*Math.random()).toFixed(),r=this.commonParams.securityKey,i="/api/rest/uss/v1/cloudmeeting/monitor?securityKey=".concat(r,"&conferenceNumber=").concat(e,"&nonce=").concat(n),t.next=5,this.http.get(i);case 5:return t.abrupt("return",t.sent);case 6:case"end":return t.stop()}}),t,this)})))}},{key:"getAllocation",value:function(e,t){var n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return i="".concat(t,"/api/rest/allocator/v1/webrtc/allocation?key=").concat(e),o={},n&&(o={sign:0}),r.next=5,this.http.get(i,o);case 5:return r.abrupt("return",r.sent);case 6:case"end":return r.stop()}}),r,this)})))}}]),e}()),Md=function(){function e(){var t=this;$r(this,e),this.stopDB=function(){t.db.stop()},this.openDB=function(){t.db.open()},this.initDB=function(){return sn(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,this)})))},this.setLogLevel=function(e){t.currentLevel=e},this.putLog=function(e,n,r,i){return sn(t,void 0,void 0,regeneratorRuntime.mark((function t(){var o,a=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(o={time:i,title:e,content:n,rest:r},!this.db||!this.db.isOpen()){t.next=12;break}if(!this.cacheData.length||this.isAddCache){t.next=8;break}return this.isAddCache=!0,t.next=6,Promise.all(this.cacheData.map((function(e){return sn(a,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.db.add(e);case 2:case"end":return t.stop()}}),t,this)})))})));case 6:this.cacheData=[],this.isAddCache=!1;case 8:return t.next=10,this.db.add(o);case 10:t.next=14;break;case 12:this.cacheData.length>4&&this.cacheData.shift(),this.cacheData.push(o);case 14:case"end":return t.stop()}}),t,this)})))},this.downloadLog=function(){return sn(t,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.db.tempStart();case 2:return e.next=4,this.db.export();case 4:case"end":return e.stop()}}),e,this)})))},this.setLogServer=function(e){Nd.setLogBaseUrl(e)},this.db=new Sl,this.LogLevel={INFO:"INFO",DEBUG:"DEBUG",WARNING:"WARNING",ERROR:"ERROR",NONE:"NONE"},this.currentLevel=this.LogLevel.DEBUG,this.isArrowUpload=!0,this.cacheData=[],this.isAddCache=!1}return ei(e,[{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=bl(),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(wl(),"][DEBUG]"),t,n].concat(a));this.putLog(t,n,a,i)}},{key:"log",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=bl(),s=arguments.length,u=new Array(s>2?s-2:0),c=2;c<s;c++)u[c-2]=arguments[c];this.currentLevel!==o&&this.currentLevel!==i||(t=console).log.apply(t,["[".concat(wl(),"][INFO]"),e,n].concat(u));this.putLog(e,n,u,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=bl(),u=arguments.length,c=new Array(u>2?u-2:0),l=2;l<u;l++)c[l-2]=arguments[l];this.currentLevel!==o&&this.currentLevel!==i&&this.currentLevel!==a||(t=console).log.apply(t,["[".concat(wl(),"][WARN]"),e,n].concat(c));this.putLog(e,n,c,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,u=bl(),c=arguments.length,l=new Array(c>2?c-2:0),h=2;h<c;h++)l[h-2]=arguments[h];this.currentLevel!==o&&this.currentLevel!==a&&this.currentLevel!==i&&this.currentLevel!==s||(t=console).log.apply(t,["[".concat(wl(),"][ERROR]"),e,n].concat(l));this.putLog(e,n,l,u)}},{key:"enableLogUpload",value:function(){this.isArrowUpload=!0}},{key:"disableLogUpload",value:function(){this.isArrowUpload=!1}},{key:"uploadLog",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]:"";return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(!this.isArrowUpload){r.next=39;break}return r.next=3,this.db.tempStart();case 3:return r.next=5,this.db.upload(e);case 5:if(r.t0=r.sent,r.t0){r.next=8;break}r.t0="";case 8:return i=r.t0,o=new FormData,a=Math.ceil(1e4*Math.random())+"",s=Date.now()+"",o.append("comments",n||e),o.append("sn",a),o.append("userId",a),o.append("deviceId",a),o.append("deviceType","WebrtcSDK"),o.append("userDisplayName",e),o.append("deviceDisplayName",navigator.userAgent),o.append("dataType","userSubmit"),o.append("account",t),o.append("number",""),o.append("softwareVersion",""),o.append("osVersion",""),o.append("deviceModel",""),o.append("crashType","UI"),o.append("crashTime",s),o.append("suffixName",".zip"),o.append("file",i,"webrt_log.zip"),r.prev=29,r.next=32,Nd.upload(o);case 32:return u=r.sent,r.abrupt("return",u&&(u.status>=200||u.status<300));case 36:return r.prev=36,r.t1=r.catch(29),r.abrupt("return",!1);case 39:case"end":return r.stop()}}),r,this,[[29,36]])})))}}]),e}(),Pd=a.Function,Dd=b([].concat),jd=b([].join),Bd={},Ud=function(e,t,n){if(!re(Bd,t)){for(var r=[],i=0;i<t;i++)r[i]="a["+i+"]";Bd[t]=Pd("C,a","return new C("+jd(r,",")+")")}return Bd[t](e,n)},Fd=Pd.bind||function(e){var t=G(this),n=t.prototype,r=bo(arguments,1),i=function(){var n=Dd(r,bo(arguments));return this instanceof i?Ud(t,n.length,n):t.apply(e,n)};return T(n)&&(i.prototype=n),i};Ct({target:"Function",proto:!0},{bind:Fd});var zd=mn.findIndex,Hd=!0;"findIndex"in[]&&Array(1).findIndex((function(){Hd=!1})),Ct({target:"Array",proto:!0,forced:Hd},{findIndex:function(e){return zd(this,e,arguments.length>1?arguments[1]:void 0)}}),mi("findIndex");var Vd,Wd=/"/g,Kd=b("".replace);Ct({target:"String",proto:!0,forced:(Vd="link",s((function(){var e=""[Vd]('"');return e!==e.toLowerCase()||e.split('"').length>3})))},{link:function(e){return t="a",n="href",r=e,i=Sn(O(this)),o="<"+t,""!==n&&(o+=" "+n+'="'+Kd(Sn(r),Wd,""")+'"'),o+">"+i+"</"+t+">";var t,n,r,i,o}});var qd={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",shareContentFailed:"Share content failed",localNetDisconnect:"The network is interrupted and the call is disconnected"},zh_CN:{default:"呼叫异常,请稍后重试",OK:"通话已结束",KickoutTipContent:"您的账号在另一地点登录,您被迫下线",shareContentFailed:"分享屏幕失败",localNetDisconnect:"网络中断,呼叫已断开"},zh_TW:{default:"呼叫異常,請稍後重試",OK:"通話已結束",KickoutTipContent:"您的賬號在另一地點登錄,您被迫下線",shareContentFailed:"分享屏幕失敗",localNetDisconnect:"網絡中斷,呼叫已斷開"}},Gd=function(){function e(){$r(this,e),this.events={}}return ei(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}(),Yd=[],Zd=function(){function e(t,n){var r=this;$r(this,e),this.onOpenSocket=function(e){r.isConnected=!0,r.lockReconnect=!1,r.reconnectCount=0,r.options.openHeatBeat&&r.sendHeartBeat(),r.emit("open",e)},this.onHandleMessage=function(e){r.options.openHeatBeat&&e.data===r.options.pangData?r.clearPangTimer():r.emit("message",e)},this.onCloseSocket=function(e){r.isConnected=!1,r.isClose=!0,r.logger.log("close websocket success",e.code+","+e.reason+","+e.wasClean),r.logger.log("this.messageList: ",r.messageList),r.emit("close",e)},this.onErrorSocket=function(e){r.logger.log("error connection websocket"),r.isConnected=!1,r.reConnect(),r.emit("error",e)};this.logger=n.logger,this.client=n,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.connect(!1),this.addEvent()}return ei(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),Yd.push(this.socket),e&&(this.lockReconnect=!1)}else this.emit("error",_l(10002,"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.creatTimeout()),this.headBeatTimer=setInterval((function(){e.client.disconnected?e.clearBeatTimer():(e.socket.send(e.options.pingData||"PING"),e.creatTimeout())}),this.heatBeatFrequency)}},{key:"creatTimeout",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:"reset",value:function(){this.clearBeatTimer(),this.clearPangTimer(),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(),Yd.map((function(e){e&&e.close()})),Yd=[],this.clearBeatTimer(),this.clearPangTimer(),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&&("START_CALL"===(null==e?void 0:e.type)&&(e.pwd="******"),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(){this.client.disconnected||this.lockReconnect||(this.reconnectCount>=this.reconnectLimit?this.emit("close",null):(this.lockReconnect=!0,this.reconnectCount+=1,this.logger.log("reconnect is trgger"),this.logger.log("reconnect count:",this.reconnectCount),this.close(!0),this.emit("reconnect",""),this.connect(!0),this.addEvent()))}}]),e}(),Jd=Math.floor,Xd=b("".charAt),$d=b("".replace),Qd=b("".slice),ef=/\$([$&'`]|\d{1,2}|<[^>]*>)/g,tf=/\$([$&'`]|\d{1,2})/g,nf=function(e,t,n,r,i,o){var a=n+e.length,s=r.length,u=tf;return void 0!==i&&(i=te(i),u=ef),$d(o,u,(function(o,u){var c;switch(Xd(u,0)){case"$":return"$";case"&":return e;case"`":return Qd(t,0,n);case"'":return Qd(t,a);case"<":c=i[Qd(u,1,-1)];break;default:var l=+u;if(0===l)return o;if(l>s){var h=Jd(l/10);return 0===h?o:h<=s?void 0===r[h-1]?Xd(u,1):r[h-1]+Xd(u,1):o}c=r[l-1]}return void 0===c?"":c}))},rf=de("replace"),of=Math.max,af=Math.min,sf=b([].concat),uf=b([].push),cf=b("".indexOf),lf=b("".slice),hf="$0"==="a".replace(/./,"$0"),df=!!/./[rf]&&""===/./[rf]("a","$0");rr("replace",(function(e,t,n){var r=df?"$":"$0";return[function(e,n){var r=O(this),i=null==e?void 0:Y(e,rf);return i?l(i,e,r,n):l(t,Sn(r),e,n)},function(e,i){var o=Ee(this),a=Sn(e);if("string"==typeof i&&-1===cf(i,r)&&-1===cf(i,"$<")){var s=n(t,o,a,i);if(s.done)return s.value}var u=A(i);u||(i=Sn(i));var c=o.global;if(c){var l=o.unicode;o.lastIndex=0}for(var h=[];;){var d=dr(o,a);if(null===d)break;if(uf(h,d),!c)break;""===Sn(d[0])&&(o.lastIndex=lr(a,at(o.lastIndex),l))}for(var f,p="",v=0,g=0;g<h.length;g++){for(var m=Sn((d=h[g])[0]),y=of(af(tt(d.index),a.length),0),b=[],w=1;w<d.length;w++)uf(b,void 0===(f=d[w])?f:String(f));var k=d.groups;if(u){var _=sf([m],b,y,a);void 0!==k&&uf(_,k);var S=Sn(Nr(i,void 0,_))}else S=nf(m,a,y,b,k,i);y>=v&&(p+=lf(a,v,y)+S,v=y+m.length)}return p+lf(a,v)}]}),!!s((function(){var e=/./;return e.exec=function(){var e=[];return e.groups={a:"7"},e},"7"!=="".replace(e,"$<a>")}))||!hf||df);var ff=mn.every,pf=un("every");Ct({target:"Array",proto:!0,forced:!pf},{every:function(e){return ff(this,e,arguments.length>1?arguments[1]:void 0)}});var vf=Xe.EXISTS,gf=Ce.f,mf=Function.prototype,yf=b(mf.toString),bf=/function\b(?:\s|\/\*[\S\s]*?\*\/|\/\/[^\n\r]*[\n\r]+)*([^\s(/]*)/,wf=b(bf.exec);u&&!vf&&gf(mf,"name",{configurable:!0,get:function(){try{return wf(bf,yf(this))[1]}catch(e){return""}}});var kf=Object.prototype.toString,_f=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"===Sf(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(Sf(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=kf.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 Sf(e){return"function"==typeof e.constructor?e.constructor.name:null}const xf=Symbol.prototype.valueOf;var Ef=function(e,t){switch(_f(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 xf?Object(xf.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 If(e){return!0==(null!=(t=e)&&"object"==typeof t&&!1===Array.isArray(t))&&"[object Object]"===Object.prototype.toString.call(e);var t}function Of(e,t){switch(_f(e)){case"object":return function(e,t){if("function"==typeof t)return t(e);if(t||(n=e,!1!==If(n)&&"function"==typeof(r=n.constructor)&&!1!==If(i=r.prototype)&&!1!==i.hasOwnProperty("isPrototypeOf"))){const n=new e.constructor;for(let r in e)n[r]=Of(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]=Of(e[r],t);return n}(e,t);default:return Ef(e)}}var Cf=Of,Af=function(){function e(t,n){$r(this,e);var r=t.logger,i=t.invite;this.client=t,this.peerStatus={peerconnectionStatus:"disconnected",iceConnectionState:"disconnected"},this.invite=i,this.logger=r,this.connectCount=0,this.stream=n,this.streamSenders=[],this.senderTimmer=null,this.internels=Cf(fd.INIT_INTERNELS),this.isShareContent=!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 ei(e,[{key:"getInternels",value:function(){return this.internels}},{key:"init",value:function(){this.initTimmer(),this.peerConnection=new RTCPeerConnection(hd),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){10518===t&&this.client.setPeerConnectionStatus(!0),this.client.emmit(e,{code:t,msg:n,detail:r})}},{key:"stopConnectTimmer",value:function(){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=Cf(e.peerStatus);return e.connectCount>40?(e.sendEmmit("call-status",10517,"呼叫失败","PEER_NET_DISCONNECT"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i)):"connected"!==n&&"unknown"!==n||"connected"!==r&&"completed"!==r?(20===e.connectCount&&(e.sendEmmit("call-status",10519,"正在呼叫中,请等候","waiting"),e.logger.log("loop peer status: ",i)),e.connectCount++,void e.initTimmer()):(e.sendEmmit("call-status",10518,"入会成功","success"),e.stopConnectTimmer(),void e.logger.log("loop peer status: ",i))}),1e3)}},{key:"onHandleNegotiationNeeded",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection();case 2:case"end":return e.stop()}}),e,this)})))}},{key:"createBaseOfferConnection",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(n.prev=0,!this.peerConnection){n.next=10;break}return n.next=4,this.peerConnection.createOffer(t);case 4:return(r=n.sent).sdp=null===(e=r.sdp)||void 0===e?void 0:e.replace("useinbandfec=1","useinbandfec=0"),n.next=8,this.peerConnection.setLocalDescription(r);case 8:this.sendSocketMessage("offer",{sdp:r.sdp}),this.client.sendPeopleCapability();case 10:n.next=15;break;case 12:n.prev=12,n.t0=n.catch(0),this.logger.error("create offer error: ",n.t0);case 15:case"end":return n.stop()}}),n,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(e){var t;return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return delete e.type,n.prev=1,n.next=4,null===(t=this.peerConnection)||void 0===t?void 0:t.addIceCandidate(new RTCIceCandidate(e));case 4:n.next=9;break;case 6:n.prev=6,n.t0=n.catch(1),this.logger.error("peer add ice candidate error: ",n.t0);case 9:case"end":return n.stop()}}),n,this,[[1,6]])})))}},{key:"handleAnswer",value:function(e){var t;return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.next=2,null===(t=this.peerConnection)||void 0===t?void 0:t.setRemoteDescription(new RTCSessionDescription(e));case 2:case"end":return n.stop()}}),n,this)})))}},{key:"setBandWidth",value:function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:fd.VIDE_BANDWIDTH_BIT,n=arguments.length>2&&void 0!==arguments[2]&&arguments[2];return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:i=hi(this.streamSenders),r.prev=1,i.s();case 3:if((o=i.n()).done){r.next=22;break}if(a=o.value,!(s=a.sender)||!s.track||"video"!==s.track.kind||e!==s.track.id){r.next=20;break}return u=null,r.prev=8,u=s.getParameters()||{encodings:[{maxBitrate:fd.VIDE_BANDWIDTH_BIT}]},c=n?1e3*t:t,(null==u?void 0:u.encodings)&&u.encodings[0]?u.encodings[0].maxBitrate=c:u.encodings=[{maxBitrate:c}],r.next=14,s.setParameters(u);case 14:this.logger.debug("set bandwidth successfully",{paramas:u,realBandwidth:c,trackId:s.track.id}),r.next=20;break;case 17:r.prev=17,r.t0=r.catch(8),this.logger.error("set bandwidth failed",u,r.t0);case 20:r.next=3;break;case 22:r.next=27;break;case 24:r.prev=24,r.t1=r.catch(1),i.e(r.t1);case 27:return r.prev=27,i.f(),r.finish(27);case 30:case"end":return r.stop()}}),r,this,[[1,24,27,30],[8,17]])})))}},{key:"onHandleIceConnectionStateChange",value:function(e){var t,n,r=this.peerStatus.peerconnectionStatus,i=(this.peerConnection||{connectionState:"unknown"}).connectionState,o=void 0===i?"unknown":i;this.logger.log("the peerConnection connectionState when ice change: ",null===(t=this.peerConnection)||void 0===t?void 0:t.connectionState),this.peerStatus={iceConnectionState:null===(n=null==e?void 0:e.target)||void 0===n?void 0:n.iceConnectionState,peerconnectionStatus:"connected"===r?r:o},this.logger.log("ice change status: ",Cf(this.peerStatus))}},{key:"onHandleConnectionStateChange",value:function(){var e;return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=(null===(e=this.peerConnection)||void 0===e?void 0:e.connectionState)||"",this.logger.log("peerconnection status change: ",{currentStatus:n,previousStatus:this.peerStatus.peerconnectionStatus}),"connected"!==this.peerStatus.peerconnectionStatus||"connected"===n){t.next=6;break}return"STARTING"===this.client.shareContentStatus&&this.client.sendContentCapablityMessage(),t.next=6,this.restartIceConnection();case 6:this.peerStatus=Object.assign(Object.assign({},this.peerStatus),{peerconnectionStatus:n}),this.logger.log("this.peerStatus: ",this.peerStatus);case 8:case"end":return t.stop()}}),t,this)})))}},{key:"onHandleIcecandidateerror",value:function(e){this.logger.log("ice candidate error:",e)}},{key:"restartIceConnection",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.createBaseOfferConnection({iceRestart:!0});case 2:case"end":return e.stop()}}),e,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}},{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.replaceTrack(o),this.logger.log("push content use replaceTrack.")):(this.addTransceiver(o,"sendonly"),this.logger.log("push content use addTransceiver.")),this.isShareContent=!0,this.logger.log("publish content stream successfully: ",this.streamSenders)),this.initSenderStatus()}},{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.replaceTrack(r)}},{key:"initSenderStatus",value:function(){var e=this;this.senderInterval=0,this.senderTimmer||(this.calcMeetingStats(),this.senderTimmer=setInterval((function(){return sn(e,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,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 sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l,h,d,f,p,v,g,m,y,b,w,k,_,S,x,E,I,O,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:t=Cf(fd.INIT_INTERNELS),n=!1,r=this.client.invite.callerUri,i=this.client.getLayoutList(),o=0,a=0,s=hi(i.entries()),e.prev=7,s.s();case 9:if((u=s.n()).done){e.next=29;break}if(c=si(u.value,2),l=c[1],h=l.roster.endpointId,h===r){e.next=27;break}if(d=l.roster.id,!(f=this.client.getVideoManagers())||!f[d]){e.next=27;break}if(p=f[d],!((v=null==p?void 0:p.getVideoTracks())&&v[0]&&this.peerConnection)){e.next=27;break}return e.next=22,this.peerConnection.getStats(v[0]);case 22:g=e.sent,m=this.getReceiverStatus(g,l),o+=m.bytesReceivedSecond,!m.frameWidth&&v[0]&&(y=v[0].getSettings(),b=y.width,w=void 0===b?0:b,k=y.height,_=void 0===k?0:k,m.frameWidth=w,m.frameHeight=_),t.receiver[v[0].id]=m;case 27:e.next=9;break;case 29:e.next=34;break;case 31:e.prev=31,e.t0=e.catch(7),s.e(e.t0);case 34:return e.prev=34,s.f(),e.finish(34);case 37:S=hi(this.streamSenders.entries()),e.prev=38,S.s();case 40:if((x=S.n()).done){e.next=52;break}if(E=si(x.value,2),"active"!==(I=E[1]).status||!I.track||"video"!==I.track.kind){e.next=50;break}return e.next=45,I.sender.getStats();case 45:O=e.sent,C=this.getSenderStatus(O,t,I,!n),a+=C.bytesSentSecond,t.sender[I.track.id]=C,n=!0;case 50:e.next=40;break;case 52:e.next=57;break;case 54:e.prev=54,e.t1=e.catch(38),S.e(e.t1);case 57:return e.prev=57,S.f(),e.finish(57);case 60:t.bytesSentSecond||(t.bytesSentSecond=a),t.bytesReceivedSecond||(t.bytesReceivedSecond=o),this.internels=t,this.client.debug&&this.client.sendInternels(t),this.senderInterval>=3&&t.bytesSentSecond<500&&(this.logger.debug("meeting-stats",t),this.senderInterval=0);case 65:case"end":return e.stop()}}),e,this,[[7,31,34,37],[38,54,57,60]])})))}},{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,i;e.kind;var o={direction:t},a="NORMAL"===n.status,s=e.kind;a&&n.stream&&(o.streams=[n.stream],s=e),i=null===(r=this.peerConnection)||void 0===r?void 0:r.addTransceiver(s,o),this.setStreamSenders(e,n,i)}},{key:"setStreamSenders",value:function(e,t,n){var r="NORMAL"===t.status,i=e.kind,o={resolution:t.resolution,track:r?e:null,sender:n.sender,type:t.type,status:r?"active":"invalid"};("video"===i&&("remoteStream"===t.type||"contentStream"===t.type)||"audio"===i&&"180"===t.resolution)&&this.streamSenders.push(o)}},{key:"replaceAudioTrack",value:function(e){var t,n=this;e.every((function(e){"180"===e.resolution&&e.stream&&(t=e.stream.getAudioTracks()[0])})),this.streamSenders.forEach((function(e,r){"180"===e.resolution&&e.track&&"audio"===e.track.kind&&(e.sender.replaceTrack(t),n.streamSenders[r].status="active",n.streamSenders[r].track=t)}))}},{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){"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:"getSenderStatus",value:function(e,t,n,r){var i=this,o={};if(e.forEach((function(e){var a,s,u,c=e.type,l=e.bytesSent,h=void 0===l?0:l,d=e.bytesReceived,f=void 0===d?0:d,p=e.timestamp,v=void 0===p?0:p;if(t.timestamp=v,t.mimeType="video/H264",r&&"transport"===c){var g=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1),m=i.rateBytesCalculator(e,"bytesReceived","timestamp",8,1);t.bytesSent=h,t.bytesReceived=f,t.bytesReceivedSecond=m,t.timestamp=v,t.bytesSentSecond=g}else if("track"===c){var y=e.frameWidth,b=void 0===y?0:y,w=e.frameHeight,k=void 0===w?0:w,_=e.framesSent,S=void 0===_?0:_,x=e.hugeFramesSent,E=void 0===x?0:x,I=e.timestamp,O=void 0===I?0:I,C=i.rateBytesCalculator(e,"framesSent","timestamp",1,1e3,i.internels.sender[(null===(a=n.track)||void 0===a?void 0:a.id)||""]);o.frameWidth=b,o.frameHeight=k,o.framesSent=S,o.framesSentSecond=C,o.hugeFramesSent=E,o.timestamp=O,o.type=n.type,o.status=n.status,o.resolution=n.resolution,o.expBandwidth=10}else if("outbound-rtp"===c){var A=e.bytesSent,T=e.framesEncoded,R=e.packetsSent,L=e.keyFramesEncoded,N=void 0===L?"N/A":L,M=e.nackCount,P=e.ssrc,D=e.pliCount,j=void 0===D?0:D,B=e.timestamp,U=i.rateBytesCalculator(e,"framesEncoded","timestamp",1,1e3,i.internels.sender[(null===(s=n.track)||void 0===s?void 0:s.id)||""]),F=i.rateBytesCalculator(e,"bytesSent","timestamp",8,1,i.internels.sender[(null===(u=n.track)||void 0===u?void 0:u.id)||""]);o.bytesSent=A,o.bytesSentSecond=F,o.framesEncoded=T,o.framesEncodedSecond=U,o.timestamp=B,o.packetsSent=R,o.keyFramesEncoded=N,o.pliCount=j,o.nackCount=M,o.ssrc=P,o.type=n.type,o.status=n.status,o.resolution=n.resolution,o.expBandwidth=10}else if(r&&"codec"===c){var z=e.mimeType;t.mimeType=z}})),!o.frameWidth){var a=fd.MAP_RESOLUTION_STRING[n.resolution],s=a.width,u=void 0===s?0:s,c=a.height,l=void 0===c?0:c;o.frameWidth=u,o.frameHeight=l}return o}},{key:"getReceiverStatus",value:function(e,t){var n=this,r={endpointId:t.roster.endpointId,participantId:t.roster.participantId};return e.forEach((function(e){var i,o=e.type,a=t.roster.id,s=n.client.getVideoManagers(),u="";s&&s[a]&&(u=(null===(i=(s[a].getVideoTracks()||[])[0])||void 0===i?void 0:i.id)||"");var c=t.roster,l=c.displayName,h=c.endpointId,d=c.isContent;if("track"===o){var f=e.frameWidth,p=void 0===f?0:f,v=e.frameHeight,g=void 0===v?0:v,m=e.framesReceived,y=void 0===m?0:m,b=e.jitterBufferDelay,w=void 0===b?0:b,k=e.timestamp,_=void 0===k?0:k,S=n.rateBytesCalculator(e,"framesReceived","timestamp",1,1e3,n.internels.receiver[u]);r.frameWidth=p,r.frameHeight=g,r.framesReceived=y,r.framesReceivedSecond=S,r.jitterBufferDelay=w,r.timestamp=_,r.type=h,r.status="active",r.name=l,r.isContent=d,r.expResolution=0}else if("inbound-rtp"===o){var x=e.bytesReceived,E=e.framesDecoded,I=e.packetsReceived,O=e.keyFramesDecoded,C=void 0===O?"N/A":O,A=e.nackCount,T=e.pliCount,R=e.framesPerSecond,L=e.framesDropped,N=e.ssrc,M=e.jitter,P=e.timestamp,D=n.rateBytesCalculator(e,"framesDecoded","timestamp",1,1e3,n.internels.receiver[u]),j=n.rateBytesCalculator(e,"bytesReceived","timestamp",8,1,n.internels.receiver[u]);r.bytesReceived=x,r.bytesReceivedSecond=j,r.framesDecoded=E,r.framesDecodedSecond=D,r.packetsReceived=I,r.keyFramesDecoded=C,r.nackCount=A,r.pliCount=T,r.framesPerSecond=R,r.framesDropped=L,r.ssrc=N,r.jitter=M,r.timestamp=P,r.type=h,r.status="active",r.name=l,r.isContent=d,r.expResolution=0}})),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]),u=Number(e[t]),c=Number(a[n]),l=Number(e[n]);if(!(s&&u&&c&&l))return 0;if("number"!=typeof c||"number"!=typeof l||"number"!=typeof s||"number"!=typeof u)return 0;if(l-c==0)return 0;var h=r*(u-s),d=(l-c)/i;return Math.floor(h/d)}},{key:"onTrack",value:function(e){this.client.emmit("track",e)}}]),e}();const Tf="function"==typeof atob,Rf="function"==typeof Buffer,Lf="function"==typeof TextDecoder?new TextDecoder:void 0,Nf=("function"==typeof TextEncoder&&new TextEncoder,Array.prototype.slice.call("ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=")),Mf=(e=>{let t={};return Nf.forEach((e,n)=>t[e]=n),t})(),Pf=/^(?:[A-Za-z\d+\/]{4})*?(?:[A-Za-z\d+\/]{2}(?:==)?|[A-Za-z\d+\/]{3}=?)?$/,Df=String.fromCharCode.bind(String),jf="function"==typeof Uint8Array.from?Uint8Array.from.bind(Uint8Array):(e,t=(e=>e))=>new Uint8Array(Array.prototype.slice.call(e,0).map(t)),Bf=e=>e.replace(/[^A-Za-z0-9\+\/]/g,""),Uf=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,Ff=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 Df(55296+(t>>>10))+Df(56320+(1023&t));case 3:return Df((15&e.charCodeAt(0))<<12|(63&e.charCodeAt(1))<<6|63&e.charCodeAt(2));default:return Df((31&e.charCodeAt(0))<<6|63&e.charCodeAt(1))}},zf=e=>e.replace(Uf,Ff),Hf=e=>{if(e=e.replace(/\s+/g,""),!Pf.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=Mf[e.charAt(o++)]<<18|Mf[e.charAt(o++)]<<12|(n=Mf[e.charAt(o++)])<<6|(r=Mf[e.charAt(o++)]),i+=64===n?Df(t>>16&255):64===r?Df(t>>16&255,t>>8&255):Df(t>>16&255,t>>8&255,255&t);return i},Vf=Tf?e=>atob(Bf(e)):Rf?e=>Buffer.from(e,"base64").toString("binary"):Hf,Wf=Rf?e=>jf(Buffer.from(e,"base64")):e=>jf(Vf(e),e=>e.charCodeAt(0)),Kf=Rf?e=>Buffer.from(e,"base64").toString("utf8"):Lf?e=>Lf.decode(Wf(e)):e=>zf(Vf(e)),qf=e=>Bf(e.replace(/[-_]/g,e=>"-"==e?"+":"/")),Gf=e=>Kf(qf(e)),Yf=Gf;var Zf=mn.find,Jf=!0;"find"in[]&&Array(1).find((function(){Jf=!1})),Ct({target:"Array",proto:!0,forced:Jf},{find:function(e){return Zf(this,e,arguments.length>1?arguments[1]:void 0)}}),mi("find");var Xf={DEVICES:{audioInputList:[],audioOutputList:[],videoInList:[]},currentSelectedDevice:{deviceId:"",groupId:"",label:""}},$f=function(e){ti(n,Gd);var t=ai(n);function n(e){var r;return $r(this,n),(r=t.call(this)).logger=e||new Md,r.navigator=navigator||window.navigator,r.mediaDevices=r.navigator.mediaDevices,r.currentDeviceList=Xf.DEVICES,r.nextDeviceList=Xf.DEVICES,r.currentUsedDevice={videoInput:Xf.currentSelectedDevice,audioInput:Xf.currentSelectedDevice,audioOutput:Xf.currentSelectedDevice},r.currentPermission={microphone:"",camera:""},r.handlePermissionCameraStateChanged=r.handlePermissionCameraStateChanged.bind(ii(r)),r.handlePermissionPhoneStateChanged=r.handlePermissionPhoneStateChanged.bind(ii(r)),r.mediaDevicesChange=r.mediaDevicesChange.bind(ii(r)),r.initDeviceEvent(),r}return ei(n,[{key:"getDevicePermission",value:function(){return this.currentPermission}},{key:"getNextDeviceList",value:function(){return this.nextDeviceList}},{key:"setCurrentUsedDevice",value:function(e){this.currentUsedDevice=e,this.emmit("currentDevice",this.currentUsedDevice),this.mediaDevicesChange(),this.logger.log("[DM]current used device in first calling: ",this.currentUsedDevice)}},{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 sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){return regeneratorRuntime.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()}}),e,this)})))}},{key:"init",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:return t=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:"unknow",camera:"unknow"};case 12:this.currentDeviceList=this.nextDeviceList=t,this.logger.log("[DM]current device list: ",this.currentDeviceList),this.logger.log("[DM]current permission: ",this.currentPermission);case 15:case"end":return e.stop()}}),e,this,[[3,9]])})))}},{key:"destroy",value:function(){this.removeDeviceEvent(),this.permissionCameraStatus&&this.permissionCameraStatus.removeEventListener("change",this.handlePermissionCameraStateChanged),this.permissionPhoneStatus&&this.permissionPhoneStatus.removeEventListener("change",this.handlePermissionPhoneStateChanged)}},{key:"getPrivateDevices",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t={audioInputList:[],audioOutputList:[],videoInList:[]},e.prev=1,e.next=4,this.getDevices();case 4:t=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",t);case 11:case"end":return e.stop()}}),e,this,[[1,7]])})))}},{key:"getDevices",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.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 t=e.sent,n=[],r=[],i=[],t.forEach((function(e){var t=si(e.kind.match(/(\w+)(input|output)/i),3),o=t[0],a=t[1],s=t[2];if(!e.label.match(/\(Virtual\)$/)&&e.deviceId){var u={deviceId:e.deviceId,kind:o,type:a,direction:s,label:e.label,groupId:e.groupId};"audioinput"===e.kind?n.push(u):"audiooutput"===e.kind?r.push(u):"videoinput"===e.kind&&i.push(u)}})),o={audioInputList:n,audioOutputList:r,videoInList:i},e.abrupt("return",o);case 12:return e.prev=12,e.t0=e.catch(0),e.abrupt("return",Promise.reject(_l(20521,e.t0)));case 15:case"end":return e.stop()}}),e,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(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,t.next=3,this.navigator.permissions.query({name:e});case 3:return n=t.sent,t.abrupt("return",n);case 7:return t.prev=7,t.t0=t.catch(0),t.abrupt("return",Promise.reject(_l(20520,t.t0)));case 10:case"end":return t.stop()}}),t,this,[[0,7]])})))}},{key:"handlePermissionCameraStateChanged",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("[DM]camera permission changed: ",e),n=e.target.state,r=this.currentPermission.camera,"granted"!==n||"granted"===r){t.next=10;break}return t.next=6,this.getPrivateDevices();case 6:i=t.sent,o={detail:i,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device: ",o),this.emmit("device",o);case 10:"change"===e.type&&(this.currentPermission.camera=n),this.emmit("permission",this.currentPermission);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"handlePermissionPhoneStateChanged",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(this.logger.log("[DM]microphone permission changed: ",e),n=e.target.state,r=this.currentPermission.microphone,"granted"!==n||"granted"===r){t.next=10;break}return t.next=6,this.getPrivateDevices();case 6:i=t.sent,o={detail:i,nextDevice:{audioInput:void 0,audioOutput:void 0,videoInput:void 0}},this.logger.log("[DM]next used device: ",o),this.emmit("device",o);case 10:"change"===e.type&&(this.currentPermission.microphone=n),this.emmit("permission",this.currentPermission);case 12:case"end":return t.stop()}}),t,this)})))}},{key:"getPermission",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,this.query("camera");case 3:return t=e.sent,e.next=6,this.query("microphone");case 6:return n=e.sent,r={camera:t.state,microphone:n.state},this.permissionCameraStatus||(this.permissionCameraStatus=t,this.permissionCameraStatus.addEventListener("change",this.handlePermissionCameraStateChanged)),this.permissionPhoneStatus||(this.permissionPhoneStatus=n,this.permissionPhoneStatus.addEventListener("change",this.handlePermissionPhoneStateChanged)),e.abrupt("return",r);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()}}),e,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,u=this.diffAudioDevice(n,o),c=this.diffAudioDevice(r,a);return{audioInput:u,videoInput:this.diffVideoDevice(i,s),audioOutput:c}}},{key:"mediaDevicesChange",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.next=2,this.getPrivateDevices();case 2:t=e.sent,n=this.currentUsedDevice.videoInput,this.nextDeviceList=Cf(t),r=this.diffDevices(this.currentDeviceList,this.nextDeviceList),i=r.videoInput,o=r.audioInput,i&&i.deviceId!==(null==n?void 0:n.deviceId)?this.currentUsedDevice.videoInput=i:r.videoInput=void 0,this.currentUsedDevice.audioInput=o,this.currentDeviceList=Cf(t),a={detail:t,nextDevice:r},this.logger.log("[DM]next used device: ",a),this.emmit("device",a);case 13:case"end":return e.stop()}}),e,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)}}]),n}(),Qf=s((function(){if("function"==typeof ArrayBuffer){var e=new ArrayBuffer(8);Object.isExtensible(e)&&Object.defineProperty(e,"a",{value:8})}})),ep=Object.isExtensible,tp=s((function(){ep(1)}))||Qf?function(e){return!!T(e)&&((!Qf||"ArrayBuffer"!=_(e))&&(!ep||ep(e)))}:ep,np=!s((function(){return Object.isExtensible(Object.preventExtensions({}))})),rp=n((function(e){var t=Ce.f,n=!1,r=se("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=vt.f,t=b([].splice),i={};i[r]=1,e(i).length&&(vt.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},Ct({target:"Object",stat:!0,forced:!0},{getOwnPropertyNames:pl.f}))},fastKey:function(e,t){if(!T(e))return"symbol"==typeof e?e:("string"==typeof e?"S":"P")+e;if(!re(e,r)){if(!tp(e))return"F";if(!t)return"E";o(e)}return e[r].objectID},getWeakData:function(e,t){if(!re(e,r)){if(!tp(e))return!0;if(!t)return!1;o(e)}return e[r].weakData},onFreeze:function(e){return np&&n&&tp(e)&&!re(e,r)&&o(e),e}};Ue[r]=!0}));rp.enable,rp.fastKey,rp.getWeakData,rp.onFreeze;var ip=Ce.f,op=rp.fastKey,ap=Ge.set,sp=Ge.getterFor,up={getConstructor:function(e,t,n,r){var i=e((function(e,i){Ji(e,o),ap(e,{type:t,index:Bn(null),first:void 0,last:void 0,size:0}),u||(e.size=0),null!=i&&uo(i,e[r],{that:e,AS_ENTRIES:n})})),o=i.prototype,a=sp(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=op(t,!0),key:t,value:n,previous:r=o.last,next:void 0,removed:!1},o.first||(o.first=s),r&&(r.next=s),u?o.size++:e.size++,"F"!==i&&(o.index[i]=s)),e},c=function(e,t){var n,r=a(e),i=op(t);if("F"!==i)return r.index[i];for(n=r.first;n;n=n.next)if(n.key==t)return n};return qi(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,u?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),u?t.size--:this.size--}return!!n},forEach:function(e){for(var t,n=a(this),r=pn(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)}}),qi(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)}}),u&&ip(o,"size",{get:function(){return a(this).size}}),i},setStrong:function(e,t,n){var r=t+" Iterator",i=sp(t),o=sp(r);zi(e,t,(function(e,t){ap(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),Yi(t)}};!function(e,t,n){var r=-1!==e.indexOf("Map"),i=-1!==e.indexOf("Weak"),o=r?"set":"add",u=a[e],c=u&&u.prototype,l=u,h={},d=function(e){var t=b(c[e]);$e(c,e,"add"==e?function(e){return t(this,0===e?0:e),this}:"delete"==e?function(e){return!(i&&!T(e))&&t(this,0===e?0:e)}:"get"==e?function(e){return i&&!T(e)?void 0:t(this,0===e?0:e)}:"has"==e?function(e){return!(i&&!T(e))&&t(this,0===e?0:e)}:function(e,n){return t(this,0===e?0:e,n),this})};if(It(e,!A(u)||!(i||c.forEach&&!s((function(){(new u).entries().next()})))))l=n.getConstructor(t,e,r,o),rp.enable();else if(It(e,!0)){var f=new l,p=f[o](i?{}:-0,1)!=f,v=s((function(){f.has(1)})),g=yo((function(e){new u(e)})),m=!i&&s((function(){for(var e=new u,t=5;t--;)e[o](t,t);return!e.has(-0)}));g||((l=t((function(e,t){Ji(e,c);var n=xl(new u,e,l);return null!=t&&uo(t,n[o],{that:n,AS_ENTRIES:r}),n}))).prototype=c,c.constructor=l),(v||m)&&(d("delete"),d("has"),r&&d("get")),(m||p)&&d(o),i&&c.clear&&delete c.clear}h[e]=l,Ct({global:!0,forced:l!=u},h),Ai(l,e),i||n.setStrong(l,e,r)}("Map",(function(e){return function(){return e(this,arguments.length?arguments[0]:void 0)}}),up);var cp=en("splice"),lp=a.TypeError,hp=Math.max,dp=Math.min;Ct({target:"Array",proto:!0,forced:!cp},{splice:function(e,t){var n,r,i,o,a,s,u=te(this),c=st(u),l=it(e,c),h=arguments.length;if(0===h?n=r=0:1===h?(n=0,r=c-l):(n=h-2,r=dp(hp(tt(t),0),c-l)),c+n-r>9007199254740991)throw lp("Maximum allowed length exceeded");for(i=$t(u,r),o=0;o<r;o++)(a=l+o)in u&&Pt(i,o,u[a]);if(i.length=r,n<r){for(o=l;o<c-r;o++)s=o+n,(a=o+r)in u?u[s]=u[a]:delete u[s];for(o=c;o>c-r+n;o--)delete u[o-1]}else if(n>r)for(o=c-r;o>l;o--)s=o+n-1,(a=o+r-1)in u?u[s]=u[a]:delete u[s];for(o=0;o<n;o++)u[o+l]=arguments[o+2];return u.length=c-r+n,i}});var fp=function(){function e(t,n){$r(this,e),this.key="",this.wrapEleId="",this.videoEle=null,this.stream=null,this.streamId="",this.state="",this.cb=function(){},t&&(this.logger=t),this.isContent=!!n,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.onWainting=this.onWainting.bind(this)}return ei(e,[{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.initEventListerner(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 e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"";return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(!(!this.isHaveSrcObject&&this.stream||this.streamId!==t&&this.stream)){n.next=13;break}if(!this.videoEle){n.next=13;break}if(this.videoEle.srcObject=this.stream,!this.videoEle.paused){n.next=12;break}return n.prev=4,n.next=7,this.videoEle.play();case 7:n.next=12;break;case 9:n.prev=9,n.t0=n.catch(4),"NotAllowedError"===(null===(e=n.t0)||void 0===e?void 0:e.name)&&(this.emmit(this.key,{status:"VIDEO_PLAY_FAILED",id:this.key,error:n.t0}),this.logger.warn("[VM] video play error: ",n.t0));case 12:this.logger.log("[VM]set video srcObject: ",{key:this.key,streamId:this.streamId});case 13:case"end":return n.stop()}}),n,this,[[4,9]])})))}},{key:"initEventListerner",value:function(e){e.addEventListener("canplay",this.onCanPlay),e.addEventListener("loadstart",this.onLoadStart),e.addEventListener("error",this.onError),e.addEventListener("waiting",this.onWainting),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.onWainting),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:"onWainting",value:function(){this.logger.log("video wainting",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)}}]),e}(),pp=kr.trim,vp=b("".charAt),gp=a.parseFloat,mp=a.Symbol,yp=mp&&mp.iterator,bp=1/gp(vr+"-0")!=-1/0||yp&&!s((function(){gp(Object(yp))}))?function(e){var t=pp(Sn(e)),n=gp(t);return 0===n&&"-"==vp(t,0)?-0:n}:gp;Ct({global:!0,forced:parseFloat!=bp},{parseFloat:bp});var wp=function(e,t,n){var r=e.roster,i=r.videoRxMute,o=r.videoTxMute,a=r.deviceType,s=r.isContent,u=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||u?"NORMAL":"REQUEST"},kp=function(e,t,n,r,i){var o,a,s=parseFloat((e/t).toFixed(3)),u=fd.RATIO_MAP[i];return s<fd.HOR_CONTAINER_RATIO?(o=n,a=parseFloat((n*s).toFixed(3))):(o=parseFloat((r/s).toFixed(3)),a=r),{realWidth:a,realHeight:o,realRotate:u}},_p=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,u={};if(s>=0&&s<=3){var c=1===s||3===s,l=kp(c?a:i,c?i:a,n,t,s),h=l.realWidth,d=l.realHeight,f=l.realRotate;u={transform:"rotateZ(".concat(f,"deg)"),width:"".concat(c?d:h,"px"),height:"".concat(c?h:d,"px")}}return u},Sp=function(){return new Promise((function(e,t){var n,r,i=["video/VP8","video/H264"],o=["audio/opus"];Xr.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)}}))},xp=[-30,-30,1,1],Ep={"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}]},Ip={"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:[0,.666,.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:[.333,.666,.333,.333],resolution:1},{position:[.666,.666,.333,.333],resolution:1}]},Op={SPEAKER:{length:8,temp:{0:Ep["1-1"],1:Ep["1-1"],2:Ep["2-1"],3:Ep["3-1"],4:Ep["4-1"],5:Ep["5-1"],6:Ep["6-1"],7:Ep["7-1"],8:Ep["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:Ip["1-1"],1:Ip["1-1"],2:Ip["2-1"],3:Ip["3-1"],4:Ip["4-1"],5:Ip["5-1"],6:Ip["6-1"],7:Ip["7-1"],8:Ip["8-1"],9:Ip["9-1"]},rate:{0:.5625,1:.5625,2:.2812,3:.5625,4:.5625,5:.375,6:.375,7:.5625,8:.5625,9:.5625}}},Cp={MULTI_PIC_CONTENT_HIGH_PRIORITY:Op.SPEAKER,MULTI_PIC_ACTIVE_HIGH_PRIORITY:Op.SPEAKER,TWO_PIC_PIP:{length:2,temp:{2:[{position:[0,0,1,1],resolution:3,zIndex:1},{position:[.75,.75,.25,.25],resolution:1,zIndex:2}]},rate:{2:.5625}},CONTENT_ONLY:{length:1,temp:{1:[{position:[0,0,1,1],resolution:3}]},rate:{1:.5625}},TWO_PIC_SYMMETRIC:{length:2,temp:{2:[{position:[0,0,.5,1],resolution:3},{position:[.5,0,.5,1],resolution:3}]},rate:{2:.2812}}},Ap=Object.assign(Object.assign({},Op),Cp),Tp=function(){function e(t){var n,r;$r(this,e),this.client=t,this.logger=t.logger,this.customLayoutList=new Map,this.layoutList=new Map,this.videoManagers={},this.originOrderRosters=[],this.orderRosterList=[],this.selfRoster=Object.assign(Object.assign({},fd.ROSTER),{isLocal:!0}),this.newLayoutList=[],this.initLayout=[],this.templateMode=(null===(n=t.config)||void 0===n?void 0:n.templateMode)||"SPEAKER",this.specifyTemplateMode=(null===(r=t.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={participantCount:0,totalEpCount:0,chairManUrl:"",contentUri:"",actSpkUri:""},this.pageInfo={pageSize:9,currentPage:0,totalPage:0},this.isLocalShareContent=!1,this.calculateScreenInfo(),this.onVideoStatusChange=this.onVideoStatusChange.bind(this)}return ei(e,[{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:"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}},{key:"setTemplateMode",value:function(e){this.templateMode=e}},{key:"setContentRosterItem",value:function(e){this.content={previous:e,next:e}}},{key:"setConfInfo",value:function(e){this.preConfInfo||(this.preConfInfo=e),this.confInfo=e}},{key:"setLocalShareContent",value:function(e){e?this.pageInfo.currentPage>1&&(this.pageInfo.currentPage=0,this.calcRequestNewLayout()):(this.pageInfo.currentPage=0,this.templateMode="SPEAKER",this.client.emmit("page-info",this.pageInfo)),this.isLocalShareContent=e}},{key:"rosterRecvMode",value:function(e){var t=this,n=[],r=.5625,i=this.confInfo,o=i.contentUri,a=i.chairManUrl,s=this.client.invite.callerUri,u=[].concat(ui(vd),ui(pd));this.specifyTemplateMode&&(u.findIndex((function(e){return e===t.specifyTemplateMode}))<0&&(this.templateMode=o?vd[0]:"SPEAKER"));o?(this.isLocalShareContent&&this.setLocalShareContent(!1),(u.findIndex((function(e){return e===t.templateMode}))<0&&!this.specifyTemplateMode||"SPEAKER"===this.templateMode)&&(this.templateMode=vd[0]),"TWO_PIC_PIP"!==this.templateMode&&"TWO_PIC_SYMMETRIC"!==this.templateMode||(this.orderRosterList=this.orderRosterList.filter((function(e){return!e.isLocal}))),"MULTI_PIC_ACTIVE_HIGH_PRIORITY"===this.templateMode&&(this.orderRosterList[0]=this.orderRosterList.splice(2,1,this.orderRosterList[0])[0]),a&&a!==s&&e>3&&(e=3)):this.isLocalShareContent?(this.templateMode="GALLERY",e=e>4?4:e):(pd.findIndex((function(e){return e===t.templateMode}))<0&&(this.templateMode="SPEAKER"),a&&a!==s&&e>2&&(e=2));var c=Ap[this.templateMode];switch(this.templateMode){case"TWO_PIC_PIP":n=c.temp[2],r=c.rate[2];break;case"CONTENT_ONLY":n=c.temp[1],r=c.rate[1];break;case"TWO_PIC_SYMMETRIC":n=c.temp[2],r=c.rate[2];break;default:if(this.pageInfo.currentPage>1&&(e=9),e>=0&&e<=c.length?(n=c.temp[e],r=c.rate[e]):(n=c.temp[c.length],r=c.rate[c.length]),this.pageInfo.currentPage>1){var l=(n=Cf(n))[1];n.splice(1,1),n.splice(6,0,l)}}return{tempLayout:n,templateRate:r}}},{key:"initLayoutManager",value:function(){var e=this.orderRosterList.length,t=this.templateRate.next,n=this.rosterRecvMode(e),r=n.tempLayout,i=n.templateRate;t!==i&&(this.templateRate={next:i,previous:i},this.calculateScreenInfo()),this.initLayout=Cf(r),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 u=i.get(e),c=u.state,l=u.roster.isLocal;"NORMAL"!==c&&"REQUEST"!==c||"ENDED"!==o?"NORMAL"!==c||"REQUEST"!==o||l?"REQUEST"!==c&&"INVALID"!==c||"CANPLAY"!==o||(n="NORMAL",s=!0):(n="REQUEST",s=!0):(n="INVALID",s=!0),s&&(i.set(e,Object.assign(Object.assign({},u),{state:n})),r?(this.layoutList=i,this.client.sendLayoutMessage()):(this.customLayoutList=i,this.client.sendCustomLayoutMessage()))}}},{key:"setVideoRenderer",value:function(e,t){this.logger.log("[lm]set video renderer:",{key:e,wrapEleId:t}),this.videoManagers[e]||(this.logger.log("[lm]Not Match VM: ",e),this.videoManagers[e]=new fp(this.logger)),this.videoManagers[e].setSource(e,t)}},{key:"playVideo",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:n=0,r=Object.keys(this.videoManagers);case 1:if(!(n<r.length)){t.next=11;break}if(i=r[n],!(e&&e.indexOf(i)>-1)&&e){t.next=8;break}if(!(o=this.videoManagers[i].videoEle).srcObject){t.next=8;break}return t.next=8,o.play();case 8:n++,t.next=1;break;case 11:case"end":return t.stop()}}),t,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,u=a.id,c=a.isContent,l=!1;e.videoManagers[u]||(e.videoManagers[u]=new fp(e.logger,c),e.videoManagers[u].setVideoStatusChange(e.onVideoStatusChange)),e.videoManagers[u].match=!0;var h=e.videoManagers[u].state;if(s){var d=e.client.getPreviewStreams().previewStreams,f=((void 0===d?[]:d)[0]||{stream:null}).stream;e.videoManagers[u].initVideoStreamById(u,f);var p=wp(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,w=m.videoTrackId;if(t.roster.participantId+t.roster.mediagroupid===y+b){var k=e.getVideoStreamByTrackId(w).videoStream;l=!0,e.videoManagers[u].initVideoStreamById(u,k);var _=wp(t,k,h),S=r.get(n);S&&r.set(n,Object.assign(Object.assign({},S),{state:_}));break}}if(!l){e.videoManagers[u].initVideoStreamById(u,null);var x=wp(t,null,h),E=r.get(n);E&&r.set(n,Object.assign(Object.assign({},E),{state:x}))}}})),this.clearInvalidVideoManagers(),this.logger.log("updated new layout list",kl(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=this.preConfInfo,t=e.contentUri,n=e.chairManUrl,r=this.confInfo,i=r.participantCount,o=r.contentUri,a=r.chairManUrl,s=this.pageInfo,u=s.pageSize,c=s.currentPage,l=i>112?112:i,h=Math.ceil(l/u);h=h>0?h:0,this.pageInfo.totalPage=h,c>h&&(c=h),this.pageInfo.currentPage=c,n!==a&&(this.pageInfo.currentPage=0,this.templateMode=pd[0]),!t&&o&&(this.pageInfo.currentPage=0,this.templateMode=vd[0]),this.preConfInfo=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.pageInfo.currentPage=e,this.templateMode=e>0?"GALLERY":this.templateModeTemp,this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo)}},{key:"calcForceFullScreenRequestLayout",value:function(){var e=this.pageInfo.pageSize,t=[],n=!1;if(!this.forceFullScreenId)return!1;if(this.forceFullScreenId){var r,i=!1,o=hi(this.layoutList);try{for(o.s();!(r=o.n()).done;){var a=si(r.value,2),s=(a[0],a[1]);if(s.roster.id===this.forceFullScreenId){s.roster.isLocal&&(n=!0),i=!0;break}}}catch(e){o.e(e)}finally{o.f()}i||(this.forceFullScreenId="")}if(this.forceFullScreenId&&n)return!0;if(this.forceFullScreenId){var u=this.forceFullScreenId.length,c=Number(this.forceFullScreenId.substr(u-1,1)),l=this.forceFullScreenId.substr(0,u-1),h=c?4:3;return t.push({calluri:l,mediagroupid:c,resolution:h,quality:2}),this.client.requestNewLayout(t,e,0),!0}return!1}},{key:"calcRequestNewLayout",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.pageInfo;this.logger.log("calc request layout page info:",e);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,u="GALLERY"===this.templateMode,c=e.pageSize,l=e.currentPage,h=[],d=0===l&&s?1:0,f=r>112?112:r,p=f+d-1,v=this.client.getOnHold(),g=u?c:c-1,m=this.client.getLocalHide();if(l<=1&&!m&&(g-=1),r<=1&&!s)this.createAutoLayout([]);else if(v)this.client.requestNewLayout(h,c,0);else if(!this.calcForceFullScreenRequestLayout()){if(p>g&&(l<=1?p=g:(p=f-(l-1)*c,m&&(p-=1),p>g&&(p=g))),s&&0===l){var y=3,b="MULTI_PIC_ACTIVE_HIGH_PRIORITY"!==this.templateMode;(p<=1&&u||b)&&(y=4),h.push({mediagroupid:1,calluri:s,resolution:y,quality:2}),p-=1,"TWO_PIC_SYMMETRIC"===this.templateMode&&(u=!0,p=1),"TWO_PIC_PIP"===this.templateMode&&(p=1),"CONTENT_ONLY"===this.templateMode&&(p=0)}if(o&&0===l){var w=1;s?u&&p<=3&&(w=2):(u&&p<=3||!u)&&(w=3),h.push({mediagroupid:0,calluri:o,resolution:w,quality:1}),p-=1}if(r>=1)for(var k=h.length,_=0;_<p;_++){var S=1,x=1;u&&p<2?(S=3,x=1):!u||2!==p&&3!==p?u&&p>=4?(S=1,x=0):k||0!==_||(S=3,x=1):(S=2,x=1),"MULTI_PIC_ACTIVE_HIGH_PRIORITY"===this.templateMode&&0===_&&(S=3,x=1),h.push({mediagroupid:0,calluri:"",resolution:S,quality:x})}this.logger.log("request layout:",h),this.client.requestNewLayout(h,c,l,[],{uiShowLocalWhenPageMode:!m})}}},{key:"createAutoLayout",value:function(e){if(this.forceFullScreenId&&0===e.length)return this.forceFullScreenId="",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],u=s.calluri,c=void 0===u?"":u,l=s.mediagroupid,h=s.isAudioMute,d=s.isVideoMute,f=s.remoteName,p=s.remoteType,v=s.MuteReason;a=c+l,o=Object.assign(Object.assign({},s),{id:a,isLocal:!1,isContent:1===l,displayName:f,endpointId:c,audioTxMute:h,videoTxMute:d,videoRxMute:!1,deviceType:p,audioRxMute:!1,videoMuteReason:v,isForceFullScreen:0===l&&c===r,isLastAdd:!1,onHold:!1,isPolling:!1}),1===l?this.orderRosterList.splice(0,0,o):this.orderRosterList.push(o)}!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,u=i+Number(o),c=t.customLayoutList.has(u),l=n.findIndex((function(e){return e.endpointId+Number(e.isContent)===u})),h=n[l],d=s>0?100*s:100;if(c){var f=t.customLayoutList.get(u);t.customLayoutList.set(u,Object.assign(Object.assign({},f),{roster:h,resolution:a,quality:d,deal:!0}))}else t.customLayoutList.set(u,{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,u=si(r.position,4),c=u[0],l=u[1],h=u[2],d=u[3],f=Math.round(a*c),p=Math.round(s*l),v=Math.round(a*h),g=Math.round(s*d);t={left:"".concat(f,"px"),top:"".concat(p,"px"),width:"".concat(v,"px"),height:"".concat(g,"px")},n={width:v,height:g},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},u=s.width,c=s.height;o=_p(t,u,c),e.layoutList.set(i,Object.assign(Object.assign({},a),{rotate:o}))}}})),this.client.config.localMirror&&this.localMirrorRotate()}},{key:"requestLayoutCalculator",value:function(){var t=this,n=[],r={};if(this.forceFullScreenId){var i,o=!1,a=hi(this.layoutList);try{for(a.s();!(i=a.n()).done;){var s=si(i.value,2);s[0];if(s[1].roster.id===this.forceFullScreenId){o=!0;break}}}catch(e){a.e(e)}finally{a.f()}o||(this.forceFullScreenId="")}return this.layoutList.forEach((function(i,o){var a=i.roster,s=a.isContent,u=a.isLocal,c=a.id,l=a.videoTxMute,h=i.resolution,d=void 0===h?1:h;if(t.forceFullScreenId&&t.forceFullScreenId!==c)return!0;if(!u&&!l){var f={index:d,quality:200,resolution:fd.RESOLUTION_MAP[d]};if(t.forceFullScreenId){var p=s?4:3;f={index:p,quality:200,resolution:fd.RESOLUTION_MAP[p]}}else s&&(f=s&&3===d?{index:4,quality:100,resolution:fd.RESOLUTION_MAP[4]}:{index:3,quality:200,resolution:fd.RESOLUTION_MAP[3]});n.push(e.getCustomLayoutItem(i,f.index,f.quality)),r[o]={resolution:f.resolution,quality:f.quality}}})),this.internelsLayout=r,n}},{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:o.endpointId===r.endpointId}),!(i<t))break;var a=xp,s=0,u=this.initLayout[i];u&&(a=(null==u?void 0:u.position)||xp,s=(null==u?void 0:u.zIndex)||0),n.push({roster:o,position:a,resolution:(null==u?void 0:u.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=si(o,4),u=s[0],c=void 0===u?0:u,l=s[1],h=void 0===l?0:l,d=s[2],f=void 0===d?0:d,p=s[3],v=void 0===p?0:p,g=Number(c)+Number(h),m=Number(f)+Number(v),y=(null==a?void 0:a.clientHeight)||document.body.clientHeight,b=(null==a?void 0:a.clientWidth)||document.body.clientWidth,w=y-g,k=b-m,_=w>0?w:y,S=k>0?k:b,x=Math.floor(S*this.templateRate.next),E=Math.floor(_/this.templateRate.next),I={rateHeight:0,rateWidth:0,width:S,height:_};return I=_>x?{rateWidth:S,rateHeight:x,width:S,height:_}:{rateWidth:E,rateHeight:_,width:S,height:_},this.logger.log("client screen info: ",I),this.screenInfo=I,this.client.sendScreenInfoMessage(I),I}},{key:"requestCustomLayout",value:function(){if(this.client.getOnHold())this.client.sendCustomLayout();else{var e=this.requestLayoutCalculator();this.client.sendCustomLayout(e)}}},{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: ",kl(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;(!n&&r||n&&r&&n.participantId!==r.participantId||n&&!r)&&(this.content.previous=r,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 u=0;u<o;u++){var c=e[u],l=c.mediagroupid,h=c.endpointId;c.isActiveSpeaker=!1,c.isLocal=!1,c.id=h+l,c.endpointId===t&&c.isContent?this.localContent=c:"record"!==c.deviceType&&(c.isContent&&n>0&&c.participantId!==n||(c.isContent&&n>0&&c.participantId===n?(this.content=Object.assign(Object.assign({},this.content),{next:c}),a.content.push(c)):c.isForceFullScreen?a.chairmain.push(c):c.endpointId===t&&i&&o>1||(c.endpointId!==t||c.isContent||i?r.endpointId&&r.endpointId===c.endpointId?(c.isActiveSpeaker=!0,a.activeSpeaker.push(c)):c.audioTxMute||c.videoTxMute?c.audioTxMute||!c.videoTxMute?!c.audioTxMute||c.videoTxMute?c.audioTxMute&&c.videoTxMute&&a.audioVideoMute.push(c):a.videoUnmute.push(c):a.audioUnmute.push(c):a.audioVideoUnmute.push(c):(c.isLocal=!0,this.selfRoster.participantId=c.participantId,a.selfRoster.push(c)))))}for(var d in this.localContent&&a.content&&(a.content=[],this.content=Object.assign(Object.assign({},this.content),{next:null})),a)s=s.concat(a[d]);return s}},{key:"switchLayout",value:function(e){this.forceFullScreenId="";var t=this.confInfo.contentUri?vd:pd,n=e;if(e)this.specifyTemplateMode=e;else if("GALLERY"===this.templateMode)n=this.templateModeTemp;else{n=this.templateMode;var r=t.findIndex((function(e){return e===n})),i=r+1>=t.length?0:r+1;n=t[i]}return this.templateMode=n,"GALLERY"===this.templateMode?this.pageInfo.currentPage=1:this.pageInfo.currentPage=0,this.calcRequestNewLayout(),this.client.emmit("page-info",this.pageInfo),this.logger.log("switch layout Mode: ",n),n}},{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){this.logger.log("set local status: ",e),this.selfRoster=Object.assign(Object.assign({},this.selfRoster),e);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,u=n.resolution,c=void 0===u?1:u,l=n.quality,h=void 0===l?100:l,d=h>0?100*h:100;a||(e.push({pid:s,resolution:c,quality:d,mediagroupid:Number(i)}),t[o]={resolution:fd.RESOLUTION_MAP[c],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}}}]),e}(),Rp=function(e){ti(n,Gd);var t=ai(n);function n(e,r,i){var o,a,s,u,c,l,h;$r(this,n),(o=t.call(this)).onSetAudioStream=function(e){if(e&&o.stream){var t=o.stream.getMediaStreams().previewStreams;"mute"===e&&t.length&&o.stream.setAudioOrVideoStatus("muteAudio"),"unmute"===e&&t.length&&o.stream.setAudioOrVideoStatus("unmuteAudio")}},o.logger=i,o.clientErrorState="NONE",o.callInfo={token:"",confNumber:""},o.onhold=!1;try{o.logger.initDB(),Nd.setLogger(o.logger)}catch(e){o.logger.error("init db error: ",e)}return o.logger.log("init config: ",e),o.config=e,e.layout&&(o.config.layout=e.layout.toUpperCase()),o.autoMode="AUTO"===(null===(a=e.layout)||void 0===a?void 0:a.toUpperCase()),o.debug=!!e.debug,o.localHide=!!e.localHide,o.hideId=e.__hideId||"",o.servers=r,o.loginInfo=fd.LOGIN_INFO,o.disconnected=!1,o.clientStatus=!0,o.peerConnectionStatus=!1,o.isAutoBandwidth=!Xr.isFirefox(),o.seq=0,o.token="",o.meetingControl={callIndex:-1,callUri:"",chairmanUri:"",contentIsDisabled:!1,disableMute:!1,muteOperation:"mute",role:"",type:"",commonJson:""},o.speakerInfo={endpointId:"",pid:0},o.stream=null,o.rosters=[],o.videoTrackList=[],o.audioTrackList=[],o.layoutManager=new Tp(ii(o)),o.layoutRosters={content:[],people:[],total:[]},o.pushType="ALL",o.cacheMeetingControlMessage=null,o.rotationInfo={people:[],content:[],total:[]},o.customLayoutSeq=0,o.contentSenderPid=0,o.invite={callerUri:"",callIndex:0,automute:"",meetingId:""},o.shareContentTimmer=null,o.shareContentStatus="ENDED",o.streamChangeList={content:[],people:[]},o.autoSwitchDevice=!0,o.audioManagers={},o.limitResolution=[],o.reportDataTimer=null,o.reportDataFrequency=5e3,o.meetingQualityData={},o.conferenceInfo=null,o.customLayoutCacheList=null,o.deviceManager=null,o.isPermissionDenied={camera:!1,microphone:!1},o.errorcode=Cc.get("xy-error-code"),o.onScreenChangeEvent=o.onScreenChangeEvent.bind(ii(o)),o.onDocumentChange=(s=o.onScreenChangeEvent,u=500,c=300,h=null,function(){var e=+new Date,t=this,n=arguments;h&&clearTimeout(h),l||(l=e),e-l>=c?(s.apply(t,n),l=e):h=setTimeout((function(){s.apply(t,n)}),u)}),o.autoMode&&o.initEvent(),o.deviceManager=new $f(o.logger),o.initDeviceManagerEvent(),o}return ei(n,[{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:"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:"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:"toggleLocal",value:function(){var e=this;return 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 new Promise((function(t,n){e.hideId=e.hideId?"":"HIDE",e.sendSocketMessage({type:"UPDATE_HIDEID",hideId:e.hideId}),t(!!e.hideId)}))}},{key:"setVideoRenderer",value:function(e,t){var n;null===(n=this.layoutManager)||void 0===n||n.setVideoRenderer(e,t)}},{key:"playVideo",value:function(e){var t=this;return this.logger.log("video replay:",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 e=this;return this.logger.log("audio replay"),new Promise((function(t,n){return sn(e,void 0,void 0,regeneratorRuntime.mark((function e(){var r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:e.prev=0,r=0,i=Object.keys(this.audioManagers);case 2:if(!(r<i.length)){e.next=20;break}if(!(o=i[r])){e.next=17;break}if(!(null==(a=this.audioManagers[o].ele)?void 0:a.srcObject)){e.next=17;break}return a.autoPlay=!0,e.prev=8,e.next=11,a.play();case 11:this.logger.log("audio replay success..."),e.next=17;break;case 14:e.prev=14,e.t0=e.catch(8),this.logger.log("audio replay failed:",e.t0);case 17:r++,e.next=2;break;case 20:t(!0),e.next=27;break;case 23:e.prev=23,e.t1=e.catch(0),this.logger.log("audio replay failed:",e.t1),n(!1);case 27:case"end":return e.stop()}}),e,this,[[0,23],[8,14]])})))}))}},{key:"setAudioRenderer",value:function(e,t){var n,r;return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(this.audioManagers[e]||(this.audioManagers[e]={ele:t}),!(o=this.audioManagers[e])||!o.ele||o.ele.srcObject){i.next=19;break}if(a=this.audioTrackList.findIndex((function(t){return t.rest.streamId===e})),o.ele.autoPlay=!0,!(a>=0)){i.next=19;break}return o.ele.srcObject=this.audioTrackList[a].data.streams[0],i.prev=7,i.next=10,o.ele.play();case 10:s=null===(n=this.stream)||void 0===n?void 0:n.config.devices,this.stream&&s&&s.audioOutputValue&&"default"!==s.audioOutputValue&&(null===(r=this.deviceManager)||void 0===r||r.setAudioOutputDevice(o.ele,s.audioOutputValue)),i.next=19;break;case 14:i.prev=14,i.t0=i.catch(7),o.ele.autoPlay=!1,this.emmit("play-failed",{type:"audio",key:e,error:i.t0}),this.logger.warn("[VM] audio play error: ",i.t0);case 19:case"end":return i.stop()}}),i,this,[[7,14]])})))}},{key:"switchAutoDevice",value:function(){var e=this,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return new Promise((function(n,r){e.autoSwitchDevice=!!t,n(e.autoSwitchDevice)}))}},{key:"switchLayout",value:function(e){var t=this;return this.logger.log("switch layout input: ",e),new Promise((function(n,r){var i;t.autoMode?(e=(null===(i=t.layoutManager)||void 0===i?void 0:i.switchLayout(e))||"SPEAKER",Nd.setStates("oper-confOperation","layout"),n(e)):r(_l(10301))}))}},{key:"setPageInfo",value:function(){var e,t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0;if("AUTO"!==this.config.layout)return Promise.reject(_l(10303));null===(e=this.layoutManager)||void 0===e||e.setPageInfo(t)}},{key:"handleConferenceInfo",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l,h,d,f,p,v,g,m,y,b,w,k,_,S,x,E,I,O,C;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=this.invite,n=t.commonJson,r=void 0===n?"":n,i=t.vcNumber,o=void 0===i?"":i,a=r&&JSON.parse(r)||{},s=(null==a?void 0:a.confAuxProperties)&&JSON.parse(a.confAuxProperties)||{},u=this.callInfo,c=u.meeting,l=u.confNumber,h=Object.assign(Object.assign({},c),{callNumber:o||l}),!o||l===o){e.next=21;break}return e.prev=6,e.next=9,Nd.getCallUri({number:o,deviceType:17,country:"CN"});case 9:d=e.sent,f=d.displayName,p=void 0===f?"":f,v=d.numberType,g=void 0===v?"":v,m=d.callUrl,y=void 0===m?"":m,b=d.avatar,w=void 0===b?"":b,k=d.deviceType,_=void 0===k?"":k,S=d.deviceId,x=void 0===S?"":S,h.displayName=p,h.numberType=g,h.callUrl=y,h.avatar=w,h.deviceType=_,h.deviceId=x,e.next=21;break;case 19:e.prev=19,e.t0=e.catch(6);case 21:if("1"!==s.watermark){e.next=32;break}return e.prev=22,e.next=25,Nd.getWatermarkContent(h.callNumber);case 25:E=e.sent,I=E.data||{watermarkContent:""},O=I.watermarkContent,C=void 0===O?"":O,h.confAuxProperties={watermarkContent:C},e.next=32;break;case 30:e.prev=30,e.t1=e.catch(22);case 32:this.conferenceInfo=h,this.logger.log("Get conference info:",this.conferenceInfo),this.emmit("conference-info",h);case 35:case"end":return e.stop()}}),e,this,[[6,19],[22,30]])})))}},{key:"handleSocketMessage",value:function(e,t){var n,r,i,o,a,s,u,c=this;if(!this.disconnected)switch(e.type){case"CALL_INDEX":var l=e.callIndex,h=e.callerUri,d=void 0===h?"":h;if(this.invite=Object.assign(Object.assign({},this.invite),{callIndex:l,callerUri:d}),this.logger.log("Get callIndex message: ",this.invite),"AUTO"===this.config.layout){var f=null===(n=this.layoutManager)||void 0===n?void 0:n.getScreenInfo();f&&this.sendScreenInfoMessage(f)}break;case"CONNECTED":this.invite=Object.assign(Object.assign({},this.invite),e),this.logger.log("Get connected message: ",this.invite),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:this.loginInfo.extUserId}),setTimeout((function(){t(c.clientStatus&&!c.disconnected),c.handleConferenceInfo()}),100),Nd.setMeetingInfo({meetingId:this.invite.meetingId,callUri:this.invite.callerUri}),Nd.setStates("sta-confStatus","callIn",{callType:"initiativeJoin",appName:this.config.isThird?md:gd,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.peer.restartIceConnection(),"STARTING"===this.shareContentStatus&&this.sendContentCapablityMessage(),this.videoTrackList=[],this.audioTrackList=[];break;case"DIS_CONNECTED":this.logger.log("Get disconnected message: ",e);var p=qd[yl][e.detail];"KickoutTipContent"!==e.detail&&"The device locked"!==e.detail&&"OK"!==e.detail&&e.code&&this.errorcode&&(p=this.errorcode[yl][e.code]),p=p||qd[yl].default,this.disconnected=!0,this.emmit("disconnected",_l(10030,{message:p})),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 v=qd[yl][e.exception];e.code&&this.errorcode&&(v=this.errorcode[yl][e.code]),v=v||qd[yl].default,this.disconnected=!0,this.emmit("disconnected",_l(10030,{message:v})),this.close("SERVER_INNER_ERROR");break;case"DualStreamReport":this.logger.log("Get share stream message: ",e);var g=e.state,m=function(){c.shareContentTimmer&&clearTimeout(c.shareContentTimmer),c.shareContentTimmer=null};if("SENDING"===g)this.shareContentStatus="STARTING",null===(i=this.stream)||void 0===i||i.emmit("start-share-content",{}),null===(o=this.layoutManager)||void 0===o||o.setLocalShareContent(!0),Nd.setStates("oper-confOperation","content",{contentType:"desk"}),m();else if("IDLE"===g){var y=qd[yl].shareContentFailed;"STATE:200"===e.code?null===(a=this.stream)||void 0===a||a.emmit("stop-share-content",{}):(e.code&&this.errorcode&&this.errorcode.zh_CN&&(y=this.errorcode.zh_CN[e.code]),null===(s=this.stream)||void 0===s||s.emmit("stop-share-content",_l(20512,{message:y}))),null===(u=this.layoutManager)||void 0===u||u.setLocalShareContent(!1),this.shareContentStatus="ENDED",m()}break;case"MONITOR_STATE_REPORT":this.logger.log("Get monitor state report: ",e),this.dealMonitorReportMessage(e);break;default:this.logger.log("接收到其他ws消息",e)}}},{key:"dealMonitorReportMessage",value:function(e){var t=this,n=e.code,r=e.monitorInfo,i=r.failUriList,o=this.errorcode&&this.errorcode.zh_CN,a=JSON.parse(JSON.stringify(i));if(a=a.map((function(e){var n="未知错误",r=e.status;return"SIG:412"===r||"SIG:4464"===r?n="终端暂不支持":o&&(n=t.errorcode.zh_CN[r]),Object.assign(Object.assign({},e),{message:n})})),"STATE:200"===n)this.emmit("start-monitor-report",{monitorInfo:Object.assign(Object.assign({},r),{failUriList:a})});else{var s="";n&&o&&(s=this.errorcode.zh_CN[n]),this.emmit("stop-monitor-report",_l(30512,{message:s}))}}},{key:"makeCall",value:function(e){var t,n;return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l,h=this;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if((null==(i=Cf(e))?void 0:i.password)&&(i.password="******"),this.logger.log("makeCall params: ",i),o=window.location,a=o.protocol,s=o.hostname,u=e.token,c=e.confNumber,"https:"===a||"localhost"===s){r.next=7;break}return r.abrupt("return",Promise.reject(_l(10407)));case 7:if("[object Object]"===Object.prototype.toString.call(e)){r.next=9;break}return r.abrupt("return",Promise.reject(_l(10101,e)));case 9:if(u&&c){r.next=11;break}return r.abrupt("return",Promise.reject(_l(10101,e)));case 11:if(this.clientStatus){r.next=13;break}return r.abrupt("return",Promise.reject(_l(10009)));case 13:return null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({displayName:e.displayName||""}),r.next=16,null===(n=this.deviceManager)||void 0===n?void 0:n.emmitDevices();case 16:return r.prev=16,r.next=19,this.verifyMeeting(e);case 19:if(!(l=r.sent)||l.success){r.next=22;break}return r.abrupt("return",Promise.reject(l.data));case 22:r.next=27;break;case 24:return r.prev=24,r.t0=r.catch(16),r.abrupt("return",Promise.reject(_l(10402,r.t0)));case 27:return r.abrupt("return",new Promise((function(e,t){h.initWss(e,t)})));case 28:case"end":return r.stop()}}),r,this,[[16,24]])})))}},{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,u=s.__hideId,c=void 0===u?"":u,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.loginInfo.cellPhone;this.invite.callIndex||this.sendSocketMessage({type:"START_CALL",calleeNumber:v,displayName:r,pwd:o,callMode:"AUDIO_VIDEO",mediaAppend:{audioEncCapList:[99],videoEncCapList:[106,127]},hideId:c,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:dd[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.clientStatus&&!this.disconnected){if(!r.isSharePeople)return r.isShareContent?(this.sendContentCapablityMessage(e),void(null===(n=this.peer)||void 0===n||n.publish(e,"CONTENT"))):void 0;try{this.stream=e,this.peer=new Af(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",_l(10517,e))}}}},{key:"sendContentCapablityMessage",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:fd.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 is null"),this.limitResolution=["720"],this.sendPeopleCapability()}},{key:"applyShareContent",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:this.shareContentStatus="PENDING",this.sendSocketMessage({type:"START_CONTENT",mode:"VIDEO",enableAnnotation:!1}),this.shareContentTimmer=setTimeout((function(){var e;"PENDING"===t.shareContentStatus&&(t.shareContentStatus="ENDED",null===(e=t.stream)||void 0===e||e.emmit("stop-share-content",{}),t.shareContentTimmer&&(clearTimeout(t.shareContentTimmer),t.shareContentTimmer=null))}),1e4);case 3:case"end":return e.stop()}}),e,this)})))}},{key:"stopShareContent",value:function(){var e=this;return this.limitResolution=[],this.stream&&this.sendPeopleCapability(),new Promise((function(t,n){try{"STARTING"!==e.shareContentStatus&&"PENDING"!==e.shareContentStatus||e.sendSocketMessage({type:"STOP_CONTENT",mode:"VIDEO"}),e.peer&&e.peer.closeContentStream(),e.stream&&e.stream.closeContentStream(),e.shareContentStatus="ENDED",e.streamChangeList.content=[],t(!0)}catch(e){n(_l(20517,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:"mergeTrackList",value:function(e){var t,n=e.track,r=n.kind,i=n.id,o={status:"remote",data:e,rest:{streamId:e.streams[0].id,track:n,trackId:i}};"video"===r?(this.videoTrackList.push(o),null===(t=this.layoutManager)||void 0===t||t.updateStreams(),this.emmit("video-track",this.videoTrackList)):"audio"===r&&(this.audioTrackList.push(o),this.emmit("audio-track",this.audioTrackList))}},{key:"destroy",value:function(){var e=this;return new Promise((function(t,n){try{e.stream&&e.stream.close(),e.close(),t(!0)}catch(e){n(_l(10515,e))}}))}},{key:"close",value:function(){var e,t=this,n=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"OK";this.stopReportData(),this.isPermissionDenied={camera:!1,microphone:!1},this.clientStatus&&(this.clientStatus=!1,this.stopShareContent(),this.stopCall(n),this.peer&&this.peer.close(),this.removeEvent(),this.removeAllListener(),null===(e=this.layoutManager)||void 0===e||e.clearInvalidVideoManagers(),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(){t.logger.stopDB()}),100))}},{key:"loginXYlinkAccount",value:function(e,t){return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o,a,s,u,c,l,h,d,f;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Nd.login({userName:e,password:t});case 3:if(!(r=n.sent)||200!==r.status){n.next=10;break}return i=r.data,o=i.securityKey,a=i.callUri,s=i.token,u=s.access_token,c=s.refresh_token,l=i.userProfile,h=l.displayName,d=l.id,f=l.cellPhone,this.loginInfo={securityKey:o,callUri:a,refresh_token:c,access_token:u,id:d,displayName:h,cellPhone:f,extUserId:e},n.abrupt("return",_l(200,{access_token:u}));case 10:if(!(r&&r.err&&r.err.response&&r.err.response.data&&2001===r.err.response.data.errorCode)){n.next=15;break}return this.logger.error("login err: ",r),n.abrupt("return",_l(10104,r));case 15:return n.abrupt("return",_l(10100,r));case 16:n.next=22;break;case 18:return n.prev=18,n.t0=n.catch(0),this.logger.error("login err: ",n.t0),n.abrupt("return",_l(10100,n.t0));case 22:case"end":return n.stop()}}),n,this,[[0,18]])})))}},{key:"getExternalLoginInfo",value:function(e,t){return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r,i,o,a,s,u,c,l,h,d,f,p,v,g,m;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:if(r=t.displayName,i=t.extId,o=t.extUserId,a=e.userName,s=e.password,r||i||s||a){n.next=4;break}return n.abrupt("return",_l(10101,t));case 4:return n.prev=4,n.next=7,Nd.login({userName:a,password:s,extId:i});case 7:if(!(u=n.sent)||200!==u.status){n.next=14;break}return c=u.data,l=c.securityKey,h=c.callUri,d=c.token,f=d.access_token,p=d.refresh_token,v=c.userProfile,g=v.displayName,m=v.id,this.loginInfo={securityKey:l,callUri:h,refresh_token:p,access_token:f,id:m,displayName:g,extUserId:o},n.abrupt("return",_l(200,{access_token:f}));case 14:return n.abrupt("return",_l(10100,u));case 15:n.next=21;break;case 17:return n.prev=17,n.t0=n.catch(4),this.logger.error("external login err: ",n.t0),n.abrupt("return",_l(10100,n.t0));case 21:case"end":return n.stop()}}),n,this,[[4,17]])})))}},{key:"loginExternalAccount",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i,o,a,s,u,c,l,h;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(n=e.displayName,r=e.extId,i=e.extUserId,o=/^[0-9a-zA-Z_-]{1,50}$/,n||r){t.next=4;break}return t.abrupt("return",_l(10101,e));case 4:if(!i){t.next=9;break}if(o.test(i)){t.next=9;break}return a="extUserId can only contain numbers, letters, _ and -, and the length cannot be greater than 50",this.logger.log("loginExternalAccount params error:",a),t.abrupt("return",_l(10101,e,a));case 9:return t.prev=9,t.next=12,Nd.getSdkUserInfo(e);case 12:if(s=t.sent,{userName:"",password:""},!s||200!==s.status){t.next=22;break}return c=s.data,l=c.userName,h=c.password,u={userName:l,password:h},t.next=19,this.getExternalLoginInfo(u,e);case 19:return t.abrupt("return",t.sent);case 22:return t.abrupt("return",_l(10103,s));case 23:t.next=28;break;case 25:return t.prev=25,t.t0=t.catch(9),t.abrupt("return",_l(10103,t.t0));case 28:case"end":return t.stop()}}),t,this,[[9,25]])})))}},{key:"getConference",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:0,i=arguments.length>1&&void 0!==arguments[1]?arguments[1]:"",o=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"";return sn(this,void 0,void 0,regeneratorRuntime.mark((function a(){var s,u,c,l,h;return regeneratorRuntime.wrap((function(a){for(;;)switch(a.prev=a.next){case 0:return this.logger.log("get conference:",{id:r,sk:i,token:o}),s=i||(null===(e=this.loginInfo)||void 0===e?void 0:e.securityKey),u=r||(null===(t=this.loginInfo)||void 0===t?void 0:t.id),c=o||(null===(n=this.loginInfo)||void 0===n?void 0:n.access_token),l={securityKey:s,access_token:c,id:u},a.prev=5,Nd.setLoginInfo(l),a.next=9,Nd.getConference(u,s);case 9:if(200!==(null==(h=a.sent)?void 0:h.status)){a.next=14;break}return a.abrupt("return",h.data);case 14:return a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:{}}));case 15:a.next=20;break;case 17:return a.prev=17,a.t0=a.catch(5),a.abrupt("return",Promise.reject({code:500,msg:"获取云会议室失败",detail:a.t0}));case 20:case"end":return a.stop()}}),a,this,[[5,17]])})))}},{key:"fetchErrorCode",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=Cc.get("xy-error-code"),n=t&&t.version,r=Cc.get("xy-timestamp"),i=(new Date).valueOf(),h=Number(r),d=Number(i),f=void 0,f=d-h,o=Math.floor(f/864e5),!(t&&o<1)){e.next=7;break}return e.abrupt("return");case 7:return e.next=9,Nd.fetchErrorCode();case 9:if(!(a=e.sent)||200!==a.status||!a.data){e.next=24;break}if(s=a.data.errorcode,u=s.link,c=s.version,l=(new Date).valueOf(),c!==n){e.next=16;break}return e.abrupt("return");case 16:if(e.t0=u,!e.t0){e.next=21;break}return e.next=20,this.getErrorCodeByJson(u);case 20:e.t0=e.sent;case 21:this.errorcode=e.t0,Cc.set("xy-error-code",this.errorcode),Cc.set("xy-timestamp",l);case 24:case"end":return e.stop()}var h,d,f}),e,this)})))}},{key:"getErrorCodeByJson",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,Nd.getErrorCodeByJson(e);case 4:(r=t.sent)&&200===r.status&&r.data&&(n=r.data),t.next=10;break;case 8:t.prev=8,t.t0=t.catch(1);case 10:return t.abrupt("return",n);case 11:case"end":return t.stop()}}),t,null,[[1,8]])})))}},{key:"videoAudioOperate",value:function(e){var t=this;return new Promise((function(n,r){return sn(t,void 0,void 0,regeneratorRuntime.mark((function t(){var i,o,a,s,u,c,l,h,d,f=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.stream){t.next=36;break}if(a=td[e].type,s=this.stream.getMediaStreams(),u=s.previewStreams,c=this.stream.current.type,this.logger.log("video or audio operate: ",e),l=this.isPermissionDenied.microphone||"FAILED"===this.stream.current.type,h=this.isPermissionDenied.camera||"FAILED"===this.stream.current.type,"unmuteAudio"!==e||!l){t.next=10;break}return this.logger.log("No permission to do audio operations"),t.abrupt("return",r(_l(10024)));case 10:if("unmuteVideo"!==e||!h){t.next=13;break}return this.logger.log("No permission to do video operations"),t.abrupt("return",r(_l(10025)));case 13:if(this.peer){t.next=16;break}return this.logger.log("Need to create a peer to do audio and video operations"),t.abrupt("return",r(_l(10020)));case 16:if(u.length){t.next=19;break}return this.logger.log("Need to create a stream to do audio and video operations"),t.abrupt("return",r(_l(10021)));case 19:return t.prev=19,d=td[e].status,t.next=23,this.stream.setAudioOrVideoStatus(e);case 23:"muteAudio"===e||"unmuteAudio"===e?null===(i=this.layoutManager)||void 0===i||i.setLocalStatus({audioTxMute:!d}):"muteVideo"!==e&&"unmuteVideo"!==e||null===(o=this.layoutManager)||void 0===o||o.setLocalStatus({videoTxMute:!d}),c=this.stream.current.type,"unmuteVideo"!==e?this.sendOperationMessage(a):"NORMAL"!==c&&"VIDEO_ONLY"!==c||setTimeout((function(){f.sendOperationMessage(a),f.stream&&f.isAutoBandwidth&&f.streamChange&&f.stream.handleChangeStream(f.streamChange,f.peer,f.streamChange.mediagroupid||0)}),800),Nd.setStates("oper-confOperation",yd[e]),n(e),t.next=34;break;case 30:t.prev=30,t.t0=t.catch(19),this.logger.log("video or audio operate error:",t.t0),r(_l(10023,t.t0,"".concat(e," 操作失败")));case 34:t.next=37;break;case 36:r(_l(10021));case 37:case"end":return t.stop()}}),t,this,[[19,30]])})))}))}},{key:"muteAudio",value:function(){return this.videoAudioOperate("muteAudio")}},{key:"muteVideo",value:function(){return this.videoAudioOperate("muteVideo")}},{key:"unmuteAudio",value:function(){return this.videoAudioOperate("unmuteAudio")}},{key:"unmuteVideo",value:function(){return this.videoAudioOperate("unmuteVideo")}},{key:"onHandUp",value:function(){return this.onHand("handup",!0)}},{key:"onHandDown",value:function(){return this.onHand("handdown",!1)}},{key:"onMute",value:function(){return this.onHand("mute",!1)}},{key:"onHand",value:function(e,t){var n=this,r=this.invite,i=r.callerUri,o=void 0===i?"":i,a=r.meetingId,s=this.callInfo.confNumber;return new Promise((function(r,i){return sn(n,void 0,void 0,regeneratorRuntime.mark((function n(){var u;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,Nd.hand(e,a,o,s);case 3:200===(u=n.sent).status&&0===u.data.code?r(t):i(_l(10500,u)),n.next=10;break;case 7:n.prev=7,n.t0=n.catch(0),i(_l(10500,n.t0));case 10:case"end":return n.stop()}}),n,null,[[0,7]])})))}))}},{key:"getSendSupportedCodec",value:function(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.prev=0,e.next=3,Sp();case 3:return t=e.sent,this.logger.log("get capabilities:",t),e.abrupt("return",t);case 8:return e.prev=8,e.t0=e.catch(0),this.logger.error("get capabilities error: ",e.t0),e.abrupt("return",Promise.reject(_l(20519,e.t0)));case 12:case"end":return e.stop()}}),e,this,[[0,8]])})))}},{key:"setPeerConnectionStatus",value:function(e){var t,n,r,i;this.peerConnectionStatus=e,this.stream&&!this.stream.isSupportReauthorize&&(this.config.muteVideo&&this.muteVideo(),this.config.muteAudio&&this.muteAudio());var o=this.invite,a=o.meetingId,s=o.callerUri;if(this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"ConfParam",inoutReminder:"true"===this.invite.inoutReminder,meetingId:a,endpointId:s}}),e){if(this.invite.automute){var u="";this.onSetAudioStream(this.invite.automute),"mute"===this.invite.automute?u="muteAudio":"unmute"===this.invite.automute&&(u="unmuteAudio"),u&&(null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({audioTxMute:"muteAudio"===u}),this.emmit("audio-status",{status:u}))}this.cacheMeetingControlMessage&&this.cacheMeetingControlMessage.type&&this.onMeetingControlMessage(this.cacheMeetingControlMessage);var c=null===(n=this.layoutManager)||void 0===n?void 0:n.getContentRosterItem();c&&(null===(r=this.layoutManager)||void 0===r||r.setContentRosterItem(c),this.emmit("content",{data:c})),null===(i=this.stream)||void 0===i||i.sendStreamStatus(),this.reportQualityData()}}},{key:"onMeetingControlMessage",value:function(e){var t,n,r,i,o,a=e.muteOperation,s=e.disableMute,u=e.chairmanUri,c=void 0===u?"":u,l=e.contentIsDisabled,h=void 0!==l&&l,d=e.commonJson,f=void 0===d?"":d,p=this.meetingControl&&this.meetingControl.chairmanUri||"",v="",g=!1;if(null===(t=this.layoutManager)||void 0===t||t.setLocalStatus({isForceFullScreen:c===this.invite.callerUri}),this.peerConnectionStatus){if(s&&(g=!0),a&&this.stream&&this.deviceManager&&this.layoutManager)if("denied"!==this.deviceManager.getDevicePermission().microphone){var m=this.stream.getMediaStreams().previewStreams;v="mute"===a?"muteAudio":"unmuteAudio","mute"===a&&m.length&&(this.stream.setAudioOrVideoStatus("muteAudio"),g=!0),"unmute"===a&&m.length&&(this.stream.setAudioOrVideoStatus("unmuteAudio"),g=!1),this.layoutManager.setLocalStatus({audioTxMute:g}),this.logger.log("emmit audio-status: ",v),this.emmit("audio-status",{status:v}),Nd.setStates("sta-msgCallback",yd[v]),this.cacheMeetingControlMessage=null}if(this.autoMode&&"GALLERY"===(null===(n=this.layoutManager)||void 0===n?void 0:n.getTemplateMode())&&(!p&&c||p&&!c)){var y=(null===(r=this.layoutManager)||void 0===r?void 0:r.getConfInfo()).contentUri;this.layoutManager.setTemplateMode(y?"MULTI_PIC_CONTENT_HIGH_PRIORITY":"SPEAKER")}if(p!==c&&this.rosters.length>0&&this.autoMode&&(null===(i=this.layoutManager)||void 0===i||i.createLayout()),f){var b=JSON.parse(f),w=(b.rename&&JSON.parse(b.rename)||{tmpName:""}).tmpName;w&&(null===(o=this.layoutManager)||void 0===o||o.setLocalStatus({displayName:Yf(w)}))}var k={chairmanUri:c,disableMute:s,muteOperation:v,contentIsDisabled:h};this.logger.log("emmit meeting-control: ",k),this.emmit("meeting-control",k)}else this.cacheMeetingControlMessage=e;this.meetingControl=e}},{key:"onSubTitle",value:function(e){var t=e.content,n=t&&JSON.parse(t);this.emmit("sub-title",n),Nd.setStates("sta-msgCallback","subtitle")}},{key:"onPassThroughMessage",value:function(e){var t,n,r,i,o,a,s,u,c,l,h,d=this;switch(e.body.type){case"roster":this.logger.log("roster message: ",e);var f=e.body,p=f.contentSenderPid,v=void 0===p?0:p,g=f.rosterInfo;if(0===g.length)return;this.contentSenderPid=v,this.rosters=g,this.sendsOriginOrderRosterMessage();break;case"participantsNum":this.logger.log("particpant message: ",e);break;case"speakersInfo":this.logger.log("speaker info message: ",e);var m=e.body.speaker;this.speakerInfo=m,this.autoMode&&(null===(t=this.layoutManager)||void 0===t||t.createLayout(),this.sendOriginOrderedRosterMessage()),this.emmit("speaker-info",{speakerInfo:m});break;case"layoutResult":var y=e.body.layout;0===e.body.mediagroupid?this.layoutRosters.people=y:1===e.body.mediagroupid&&(this.layoutRosters.content=y),this.layoutRosters.total=[].concat(ui(this.layoutRosters.people),ui(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 b=e.body,w=b.mediagroupid,k=b.streamChangeInfo;this.streamChangeList[0===w?"people":"content"]=k,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.peer.handleAnswer(e.body);break;case"mediaOnhold":this.logger.log("media onhold message: ",e);var _=e.body.onhold;this.onhold=Boolean(_),this.emmit("onhold",this.onhold);break;case"confChangeInfo":this.logger.log("[receive]conf change info message: ",e);var S=e.body,x=S.chairManUrl,E=void 0===x?"":x,I=S.contentUri,O=void 0===I?"":I,C=S.actSpkUri,A=void 0===C?"":C,T=S.totalEpCount,R=void 0===T?0:T,L=S.displayableEpCount,N=void 0===L?0:L,M=null===(i=this.layoutManager)||void 0===i?void 0:i.getConfInfo();(null==M?void 0:M.totalEpCount)!==R&&this.emmit("participants-count",{participantsNum:R});var P={participantCount:N,totalEpCount:R,chairManUrl:E,contentUri:O,actSpkUri:A};null===(o=this.layoutManager)||void 0===o||o.setConfInfo(P),this.autoMode?(null===(a=this.layoutManager)||void 0===a||a.calcPageInfo(),null===(s=this.layoutManager)||void 0===s||s.calcRequestNewLayout()):1!==R||O||null===(u=this.layoutManager)||void 0===u||u.createCustomLayout([]),this.emmit("conf-change-info",P);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),"AUTO"===this.config.layout?null===(c=this.layoutManager)||void 0===c||c.createAutoLayout(this.layoutRosters.total):(null===(l=this.layoutManager)||void 0===l||l.createCustomLayout(this.layoutRosters.total),null===(h=this.layoutManager)||void 0===h||h.updateStreams());break;case"inoutnotify":this.logger.log("[receive]inoutnotify message: ",e);var D=e.body.info||[],j=[];D.map((function(e){if(e.e!==d.invite.callerUri){var t=e.a,n=t.split(":");n.length>1&&(t=n[1]),j.push({displayName:e.c,action:e.t,userId:t})}})),this.emmit("in-out-reminder",j);break;case"bulkRoster":this.logger.log("bulk roster message: ",e);var B=e.body,U=B.bulkRosterType,F=void 0===U?0:U,z=B.addRosterInfo,H=void 0===z?[]:z,V=B.changeRosterInfo,W=void 0===V?[]:V,K=B.deleteRosterInfo,q=void 0===K?[]:K;this.emmit("bulkRoster",{bulkRosterType:F,addRosterInfo:H,changeRosterInfo:W,deleteRosterInfo:q});break;default:this.logger.log("get pass though default message: ",e)}}},{key:"switchAutoBandwidth",value:function(){var e=!this.isAutoBandwidth;return this.isAutoBandwidth=e,e}},{key:"disconnectInWssError",value:function(e){this.logger.log("disconnected wss error",e),!this.disconnected&&this.clientStatus&&(this.clientErrorState=2004===e?"WS_CLOSE":"WS_ERROR",this.emmit("disconnected",_l(e,{message:qd[yl].localNetDisconnect,key:"LOCAL_NET_DISCONNECT"},"[internel] disconnected meeting")))}},{key:"switchDebug",value:function(e){var t=this;return new Promise((function(n,r){"boolean"!=typeof e&&r(_l(10101));try{t.debug=e,t.peer&&t.peer.initSenderStatus(),n(t.debug)}catch(e){r(_l(30500))}}))}},{key:"requestLayout",value:function(e){var t=this;return new Promise((function(n,r){var i,o;t.logger.log("request layout: ",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}),"[object Array]"!==Object.prototype.toString.call(e)||"[object Array]"!==Object.prototype.toString.call(i))return s(_l(10101));~~t>9&&(t=9);var u=r.invite,c=u.callerUri,l=void 0===c?"":c,h=u.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,u=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:u,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=arguments.length>1&&void 0!==arguments[1]&&arguments[1];if(this.stream){if(i){var o=null===(t=this.stream)||void 0===t?void 0:t.getMediaStreams(),a=o.streams;null===(n=this.peer)||void 0===n||n.setStream(a,e)}else null===(r=this.peer)||void 0===r||r.replacePeopleVideoTrack(this.stream,e);"video"===e&&this.layoutManager&&this.layoutManager.updateLocalTrack()}}},{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",Cf(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",Cf(r))}}},{key:"sendScreenInfoMessage",value:function(e){this.emmit("screen-info",Cf(e))}},{key:"sendContentRosterMessage",value:function(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:"sendInternels",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,u=this.streamChangeList.people.length;if(u)for(var c=0;c<u;c++){var l=this.streamChangeList.people[c];if(fd.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(fd.RESOLUTION_MAP[d.resolution]===Number(a.resolution)&&"contentStream"===a.type){e.sender[r[o]].expBandwidth=d.bandwidth;break}}}this.emmit("meeting-stats",e)}},{key:"off",value:function(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:fd.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(e){var t=this;return new Promise((function(n,r){var i,o,a;t.autoMode||r(_l(10302)),e&&"string"!=typeof e&&r(_l(10101));try{var s=null===(i=t.layoutManager)||void 0===i?void 0:i.getForceFullScreenId();if(!e&&!s)return void n(e);var u=t.getSelfRoster();e!==(null==u?void 0:u.id)&&(null===(o=t.layoutManager)||void 0===o||o.setForceFullScreenId(e),null===(a=t.layoutManager)||void 0===a||a.calcRequestNewLayout()),n(e)}catch(e){r(_l(10530))}}))}},{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,u={callIndex:i,meetingId:s,endpointId:a,callUri:a},c=this.seq+"",l=t?Object.assign(Object.assign(Object.assign({},e),u),{seq:c}):e;this.socketTask&&this.socketTask.send(l,!0,n),this.seq++}},{key:"verifyMeeting",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,i,o,a,s,u,c,l,h,d,f,p,v,g,m,y,b,w,k,_,S,x,E,I,O,C,A,T,R,L;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return r=e.token,i=e.confNumber,o=e.password,a=void 0===o?"":o,this.callInfo=e,this.token=r,s={success:!1,data:{}},t.prev=4,u=r||this.loginInfo.access_token,t.next=8,Nd.getUserInfo(u);case 8:return c=t.sent,h=(l=c||{}).securityKey,d=l.userProfile,this.loginInfo.id=(null==d?void 0:d.id)||this.loginInfo.id,this.loginInfo.securityKey=h,this.fetchErrorCode(),t.next=15,Nd.getCallUri({number:i,deviceType:17,country:"CN"});case 15:if(f=t.sent,p=f.avatar,v=void 0===p?"":p,g=f.callNumber,m=void 0===g?"":g,y=f.callUrl,b=void 0===y?"":y,w=f.deviceId,k=void 0===w?"":w,_=f.deviceType,S=void 0===_?"":_,x=f.displayName,E=void 0===x?"":x,I=f.number,O=void 0===I?"":I,C=f.numberType,A={avatar:v,callNumber:m,callUrl:b,deviceId:k,deviceType:S,displayName:E,number:O||i,numberType:void 0===C?"":C},!(Qh.findIndex((function(e){return e===(null==f?void 0:f.deviceType)}))>-1)){t.next=44;break}if(this.callInfo=Object.assign(this.callInfo,{meeting:A}),!f.enablePwd||"HIDE"!==this.config.__hideId){t.next=34;break}return t.prev=22,t.next=25,Nd.igonreMeetingMonito(i);case 25:T=t.sent,s=T&&200===T.status?n.getMeetingStatus(!0):n.getMeetingStatus(!1,10406),t.next=32;break;case 29:t.prev=29,t.t0=t.catch(22),s=n.getMeetingStatus(!1,10406);case 32:t.next=42;break;case 34:if(!f.enablePwd||!a){t.next=41;break}return t.next=37,Nd.verifyPassword(i,a);case 37:R=t.sent,s=200!==R.status&&204!==R.status?n.getMeetingStatus(!1,10404):n.getMeetingStatus(!0),t.next=42;break;case 41:s=f.enablePwd&&!a?n.getMeetingStatus(!1,10403):n.getMeetingStatus(!0);case 42:t.next=45;break;case 44:f&&f.numberType?s=n.getMeetingStatus(!1,10405):f&&f.errorCode?(L=f.errorCode,s=1001===L||2036===L?n.getMeetingStatus(!1,10401):n.getMeetingStatus(!1,10402)):s=n.getMeetingStatus(!1,10402);case 45:t.next=50;break;case 47:t.prev=47,t.t1=t.catch(4),s=n.getMeetingStatus(!1,10402);case 50:return t.abrupt("return",s);case 51:case"end":return t.stop()}}),t,this,[[4,47],[22,29]])})))}},{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:"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 sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t=this;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return e.abrupt("return",new Promise((function(e,n){if(t.invite.callIndex){var r=t.invite,i=r.callerUri,o=r.meetingId;t.sendSocketMessage({type:"PASS_THROUGH",body:{meetingId:o,endpointId:i,type:"subscribeBulkRoster"}}),e(!0)}else n(_l(10517))})));case 1:case"end":return e.stop()}}),e)})))}},{key:"reportQualityData",value:function(){var e=this;this.reportDataTimer&&(clearInterval(this.reportDataTimer),this.reportDataTimer=null);var t=(this.conferenceInfo||{callUrl:""}).callUrl,n=void 0===t?"":t,r=this.invite,i=r.meetingId,o=r.callerUri;this.meetingQualityData={callNumber:n,deviceId:o.split("@")[0],meetingId:i,osVersion:Xr.osVersion(),sessionName:0,sockProto:"udpProto",swVersion:Sd,cdrVersion:10,deviceType:17},this.reportDataTimer=setInterval((function(){e.calcQualityData()}),this.reportDataFrequency)}},{key:"calcQualityData",value:function(){var e,t,n=arguments.length>0&&void 0!==arguments[0]&&arguments[0];if(this.peer){var r=this.peer.getInternels(),i=r.receiver,o=r.sender,a=r.bytesReceivedSecond,s=r.bytesSentSecond,u=0,c=(null===(e=this.layoutManager)||void 0===e?void 0:e.getSelfRoster())||{participantId:0},l=[{participantId:c.participantId,sessionId:0,audioStream:[],videoStream:[]}];Object.keys(o).length>0&&(l[0].videoStream=Object.keys(o).map((function(e){var t=o[e],n=t.frameWidth,r=t.frameHeight;return{fr:t.framesEncodedSecond,height:r,width:n}})));var h=Object.keys(i).map((function(e){var t=i[e],n=t.frameWidth,r=t.frameHeight,o=t.framesDecodedSecond;t.endpointId;var a=t.participantId,s=t.jitter,c=void 0===s?0:s;return u=Math.ceil(Math.max(u,c)),{participantId:a,videoStream:[{fr:o,height:n,width:r}]}}));if(0!==h.length){var d=(null===(t=navigator.connection)||void 0===t?void 0:t.type)||"none",f={networkType:ed[d]||0,timestampSec:1e3*parseInt((new Date).getTime()/1e3+""),audioCaptureEnergy:0,audioDownLinkBw:0,audioUpLinkBw:0,avrMissLipsync:0,videoDownLinkBw:a,videoPxRatio:50,videoRecvDelay:0,videoRecvJitter:u,videoSendJitter:0,videoUplinkBw:s,isLast:n,recvStreams:h,sendStreams:l},p={content:Object.assign({},this.meetingQualityData,f)};this.sendSocketMessage({type:"PASS_THROUGH",body:{type:"dataReport",data:p}},!0,!1)}}}},{key:"stopReportData",value:function(){this.reportDataTimer&&clearInterval(this.reportDataTimer),this.reportDataTimer=null,this.calcQualityData(!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 faild:",e)}}))}},{key:"initWss",value:function(e,t){var n;return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var r,i,o,a,s,u=this;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return this.socketTask&&this.socketTask.close(),r="",t.prev=2,i="",this.config.isSupportHybridCloud&&(o=this.servers.wssServer.split("//")[1].split("/")[0],i="https://"+o),t.next=7,Nd.getAllocation(this.loginInfo.id,i,this.config.isSupportHybridCloud);case 7:a=t.sent,r=(null===(n=null==a?void 0:a.data)||void 0===n?void 0:n.serverId)||"",t.next=13;break;case 11:t.prev=11,t.t0=t.catch(2);case 13:s="".concat(this.servers.wssServer,"/websocket/webrtc").concat(r?"/".concat(r):""),this.socketTask=new Zd({url:s,params:{token:this.token,start:!0}},this),this.socketTask.on("open",(function(e){u.logger.log("websocket is conneted"),u.logger.log("user system info: ",navigator.userAgent),u.logger.log("Version: ",Sd),u.startCall(),u.emmit("socket-open",e)})),this.socketTask.on("message",(function(t){var n=t.data;if(n){var r=JSON.parse(n);u.handleSocketMessage(r,e),u.emmit("socket-message",r)}})),this.socketTask.on("close",(function(){u.logger.log("连接已关闭"),u.disconnectInWssError(2004),u.emmit("socket-close",_l(2004)),u.close("LOCAL_NET_DISCONNECT")})),this.socketTask.on("timeout",(function(){u.logger.log("websocket connect timeout"),u.emmit("socket-timeout",_l(2002))})),this.socketTask.on("error",(function(e){u.logger.log("Websocket connect is error",e),u.emmit("socket-error",_l(2005,e))})),this.socketTask.on("reconnect",(function(e){u.logger.log("Websocket reconnect: ","Websocket connected is close, reconect..."),u.emmit("socket-reconnect",_l(2003,e))}));case 21:case"end":return t.stop()}}),t,this,[[2,11]])})))}}],[{key:"getClientInstance",value:function(e,t,r){return this.instance||(this.instance=new n(e,t,r)),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}}},{key:"getMeetingStatus",value:function(e,t,n){return t?{success:e,data:{code:t,msg:ml[yl][t]||n}}:{success:e,data:{}}}}]),n}(),Lp=mn.some,Np=un("some");Ct({target:"Array",proto:!0,forced:!Np},{some:function(e){return Lp(this,e,arguments.length>1?arguments[1]:void 0)}});var Mp="undefined"!=typeof ArrayBuffer&&"undefined"!=typeof DataView,Pp=a.RangeError,Dp=function(e){if(void 0===e)return 0;var t=tt(e),n=at(t);if(t!==n)throw Pp("Wrong length or index");return n},jp=a.Array,Bp=Math.abs,Up=Math.pow,Fp=Math.floor,zp=Math.log,Hp=Math.LN2,Vp=function(e,t,n){var r,i,o,a=jp(n),s=8*n-t-1,u=(1<<s)-1,c=u>>1,l=23===t?Up(2,-24)-Up(2,-77):0,h=e<0||0===e&&1/e<0?1:0,d=0;for((e=Bp(e))!=e||e===1/0?(i=e!=e?1:0,r=u):(r=Fp(zp(e)/Hp),e*(o=Up(2,-r))<1&&(r--,o*=2),(e+=r+c>=1?l/o:l*Up(2,1-c))*o>=2&&(r++,o/=2),r+c>=u?(i=0,r=u):r+c>=1?(i=(e*o-1)*Up(2,t),r+=c):(i=e*Up(2,c-1)*Up(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},Wp=function(e,t){var n,r=e.length,i=8*r-t-1,o=(1<<i)-1,a=o>>1,s=i-7,u=r-1,c=e[u--],l=127&c;for(c>>=7;s>0;)l=256*l+e[u--],s-=8;for(n=l&(1<<-s)-1,l>>=-s,s+=t;s>0;)n=256*n+e[u--],s-=8;if(0===l)l=1-a;else{if(l===o)return n?NaN:c?-1/0:1/0;n+=Up(2,t),l-=a}return(c?-1:1)*n*Up(2,l-t)},Kp=function(e){for(var t=te(this),n=st(t),r=arguments.length,i=it(r>1?arguments[1]:void 0,n),o=r>2?arguments[2]:void 0,a=void 0===o?n:it(o,n);a>i;)t[i++]=e;return t},qp=vt.f,Gp=Ce.f,Yp=Xe.PROPER,Zp=Xe.CONFIGURABLE,Jp=Ge.get,Xp=Ge.set,$p=a.ArrayBuffer,Qp=$p,ev=Qp&&Qp.prototype,tv=a.DataView,nv=tv&&tv.prototype,rv=Object.prototype,iv=a.Array,ov=a.RangeError,av=b(Kp),sv=b([].reverse),uv=Vp,cv=Wp,lv=function(e){return[255&e]},hv=function(e){return[255&e,e>>8&255]},dv=function(e){return[255&e,e>>8&255,e>>16&255,e>>24&255]},fv=function(e){return e[3]<<24|e[2]<<16|e[1]<<8|e[0]},pv=function(e){return uv(e,23,4)},vv=function(e){return uv(e,52,8)},gv=function(e,t){Gp(e.prototype,t,{get:function(){return Jp(this)[t]}})},mv=function(e,t,n,r){var i=Dp(n),o=Jp(e);if(i+t>o.byteLength)throw ov("Wrong index");var a=Jp(o.buffer).bytes,s=i+o.byteOffset,u=Hr(a,s,s+t);return r?u:sv(u)},yv=function(e,t,n,r,i,o){var a=Dp(n),s=Jp(e);if(a+t>s.byteLength)throw ov("Wrong index");for(var u=Jp(s.buffer).bytes,c=a+s.byteOffset,l=r(+i),h=0;h<t;h++)u[c+h]=l[o?h:t-h-1]};if(Mp){var bv=Yp&&"ArrayBuffer"!==$p.name;if(s((function(){$p(1)}))&&s((function(){new $p(-1)}))&&!s((function(){return new $p,new $p(1.5),new $p(NaN),bv&&!Zp})))bv&&Zp&&Ae($p,"name","ArrayBuffer");else{(Qp=function(e){return Ji(this,ev),new $p(Dp(e))}).prototype=ev;for(var wv,kv=qp($p),_v=0;kv.length>_v;)(wv=kv[_v++])in Qp||Ae(Qp,wv,$p[wv]);ev.constructor=Qp}Mi&&Si(nv)!==rv&&Mi(nv,rv);var Sv=new tv(new Qp(2)),xv=b(nv.setInt8);Sv.setInt8(0,2147483648),Sv.setInt8(1,2147483649),!Sv.getInt8(0)&&Sv.getInt8(1)||qi(nv,{setInt8:function(e,t){xv(this,e,t<<24>>24)},setUint8:function(e,t){xv(this,e,t<<24>>24)}},{unsafe:!0})}else ev=(Qp=function(e){Ji(this,ev);var t=Dp(e);Xp(this,{bytes:av(iv(t),0),byteLength:t}),u||(this.byteLength=t)}).prototype,nv=(tv=function(e,t,n){Ji(this,nv),Ji(e,ev);var r=Jp(e).byteLength,i=tt(t);if(i<0||i>r)throw ov("Wrong offset");if(i+(n=void 0===n?r-i:at(n))>r)throw ov("Wrong length");Xp(this,{buffer:e,byteLength:n,byteOffset:i}),u||(this.buffer=e,this.byteLength=n,this.byteOffset=i)}).prototype,u&&(gv(Qp,"byteLength"),gv(tv,"buffer"),gv(tv,"byteLength"),gv(tv,"byteOffset")),qi(nv,{getInt8:function(e){return mv(this,1,e)[0]<<24>>24},getUint8:function(e){return mv(this,1,e)[0]},getInt16:function(e){var t=mv(this,2,e,arguments.length>1?arguments[1]:void 0);return(t[1]<<8|t[0])<<16>>16},getUint16:function(e){var t=mv(this,2,e,arguments.length>1?arguments[1]:void 0);return t[1]<<8|t[0]},getInt32:function(e){return fv(mv(this,4,e,arguments.length>1?arguments[1]:void 0))},getUint32:function(e){return fv(mv(this,4,e,arguments.length>1?arguments[1]:void 0))>>>0},getFloat32:function(e){return cv(mv(this,4,e,arguments.length>1?arguments[1]:void 0),23)},getFloat64:function(e){return cv(mv(this,8,e,arguments.length>1?arguments[1]:void 0),52)},setInt8:function(e,t){yv(this,1,e,lv,t)},setUint8:function(e,t){yv(this,1,e,lv,t)},setInt16:function(e,t){yv(this,2,e,hv,t,arguments.length>2?arguments[2]:void 0)},setUint16:function(e,t){yv(this,2,e,hv,t,arguments.length>2?arguments[2]:void 0)},setInt32:function(e,t){yv(this,4,e,dv,t,arguments.length>2?arguments[2]:void 0)},setUint32:function(e,t){yv(this,4,e,dv,t,arguments.length>2?arguments[2]:void 0)},setFloat32:function(e,t){yv(this,4,e,pv,t,arguments.length>2?arguments[2]:void 0)},setFloat64:function(e,t){yv(this,8,e,vv,t,arguments.length>2?arguments[2]:void 0)}});Ai(Qp,"ArrayBuffer"),Ai(tv,"DataView");var Ev={ArrayBuffer:Qp,DataView:tv},Iv=Ev.ArrayBuffer,Ov=Ev.DataView,Cv=Ov.prototype,Av=b(Iv.prototype.slice),Tv=b(Cv.getUint8),Rv=b(Cv.setUint8),Lv=s((function(){return!new Iv(2).slice(1,void 0).byteLength}));Ct({target:"ArrayBuffer",proto:!0,unsafe:!0,forced:Lv},{slice:function(e,t){if(Av&&void 0===t)return Av(Ee(this),e);for(var n=Ee(this).byteLength,r=it(e,n),i=it(void 0===t?n:t,n),o=new(Ur(this,Iv))(at(i-r)),a=new Ov(this),s=new Ov(o),u=0;r<i;)Rv(s,u++,Tv(a,r++));return o}});var Nv,Mv,Pv,Dv=Ce.f,jv=a.Int8Array,Bv=jv&&jv.prototype,Uv=a.Uint8ClampedArray,Fv=Uv&&Uv.prototype,zv=jv&&Si(jv),Hv=Bv&&Si(Bv),Vv=Object.prototype,Wv=a.TypeError,Kv=de("toStringTag"),qv=se("TYPED_ARRAY_TAG"),Gv=se("TYPED_ARRAY_CONSTRUCTOR"),Yv=Mp&&!!Mi&&"Opera"!==zt(a.opera),Zv=!1,Jv={Int8Array:1,Uint8Array:1,Uint8ClampedArray:1,Int16Array:2,Uint16Array:2,Int32Array:4,Uint32Array:4,Float32Array:4,Float64Array:8},Xv={BigInt64Array:8,BigUint64Array:8},$v=function(e){if(!T(e))return!1;var t=zt(e);return re(Jv,t)||re(Xv,t)};for(Nv in Jv)(Pv=(Mv=a[Nv])&&Mv.prototype)?Ae(Pv,Gv,Mv):Yv=!1;for(Nv in Xv)(Pv=(Mv=a[Nv])&&Mv.prototype)&&Ae(Pv,Gv,Mv);if((!Yv||!A(zv)||zv===Function.prototype)&&(zv=function(){throw Wv("Incorrect invocation")},Yv))for(Nv in Jv)a[Nv]&&Mi(a[Nv],zv);if((!Yv||!Hv||Hv===Vv)&&(Hv=zv.prototype,Yv))for(Nv in Jv)a[Nv]&&Mi(a[Nv].prototype,Hv);if(Yv&&Si(Fv)!==Hv&&Mi(Fv,Hv),u&&!re(Hv,Kv))for(Nv in Zv=!0,Dv(Hv,Kv,{get:function(){return T(this)?this[qv]:void 0}}),Jv)a[Nv]&&Ae(a[Nv],qv,Nv);var Qv={NATIVE_ARRAY_BUFFER_VIEWS:Yv,TYPED_ARRAY_CONSTRUCTOR:Gv,TYPED_ARRAY_TAG:Zv&&qv,aTypedArray:function(e){if($v(e))return e;throw Wv("Target is not a typed array")},aTypedArrayConstructor:function(e){if(A(e)&&(!Mi||N(zv,e)))return e;throw Wv(K(e)+" is not a typed array constructor")},exportTypedArrayMethod:function(e,t,n){if(u){if(n)for(var r in Jv){var i=a[r];if(i&&re(i.prototype,e))try{delete i.prototype[e]}catch(e){}}Hv[e]&&!n||$e(Hv,e,n?t:Yv&&Bv[e]||t)}},exportTypedArrayStaticMethod:function(e,t,n){var r,i;if(u){if(Mi){if(n)for(r in Jv)if((i=a[r])&&re(i,e))try{delete i[e]}catch(e){}if(zv[e]&&!n)return;try{return $e(zv,e,n?t:Yv&&zv[e]||t)}catch(e){}}for(r in Jv)!(i=a[r])||i[e]&&!n||$e(i,e,t)}},isView:function(e){if(!T(e))return!1;var t=zt(e);return"DataView"===t||re(Jv,t)||re(Xv,t)},isTypedArray:$v,TypedArray:zv,TypedArrayPrototype:Hv},eg=Qv.NATIVE_ARRAY_BUFFER_VIEWS,tg=a.ArrayBuffer,ng=a.Int8Array,rg=!eg||!s((function(){ng(1)}))||!s((function(){new ng(-1)}))||!yo((function(e){new ng,new ng(null),new ng(1.5),new ng(e)}),!0)||s((function(){return 1!==new ng(new tg(2),1,void 0).length})),ig=Math.floor,og=Number.isInteger||function(e){return!T(e)&&isFinite(e)&&ig(e)===e},ag=a.RangeError,sg=a.RangeError,ug=function(e,t){var n=function(e){var t=tt(e);if(t<0)throw ag("The argument can't be less than 0");return t}(e);if(n%t)throw sg("Wrong offset");return n},cg=Qv.aTypedArrayConstructor,lg=function(e){var t,n,r,i,o,a,s=jr(this),u=te(e),c=arguments.length,h=c>1?arguments[1]:void 0,d=void 0!==h,f=to(u);if(f&&!Qi(f))for(a=(o=ro(u,f)).next,u=[];!(i=l(a,o)).done;)u.push(i.value);for(d&&c>2&&(h=pn(h,arguments[2])),n=st(u),r=new(cg(s))(n),t=0;n>t;t++)r[t]=d?h(u[t],t):u[t];return r};n((function(e){var t=vt.f,n=mn.forEach,r=Ge.get,i=Ge.set,o=Ce.f,s=_e.f,c=Math.round,h=a.RangeError,d=Ev.ArrayBuffer,f=d.prototype,v=Ev.DataView,g=Qv.NATIVE_ARRAY_BUFFER_VIEWS,m=Qv.TYPED_ARRAY_CONSTRUCTOR,y=Qv.TYPED_ARRAY_TAG,b=Qv.TypedArray,w=Qv.TypedArrayPrototype,k=Qv.aTypedArrayConstructor,_=Qv.isTypedArray,S=function(e,t){k(e);for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i},x=function(e,t){o(e,t,{get:function(){return r(this)[t]}})},E=function(e){var t;return N(f,e)||"ArrayBuffer"==(t=zt(e))||"SharedArrayBuffer"==t},I=function(e,t){return _(e)&&!V(t)&&t in e&&og(+t)&&t>=0},O=function(e,t){return t=ge(t),I(e,t)?p(2,e[t]):s(e,t)},C=function(e,t,n){return t=ge(t),!(I(e,t)&&T(n)&&re(n,"value"))||re(n,"get")||re(n,"set")||n.configurable||re(n,"writable")&&!n.writable||re(n,"enumerable")&&!n.enumerable?o(e,t,n):(e[t]=n.value,e)};u?(g||(_e.f=O,Ce.f=C,x(w,"buffer"),x(w,"byteOffset"),x(w,"byteLength"),x(w,"length")),Ct({target:"Object",stat:!0,forced:!g},{getOwnPropertyDescriptor:O,defineProperty:C}),e.exports=function(e,s,u){var f=e.match(/\d+$/)[0]/8,p=e+(u?"Clamped":"")+"Array",k="get"+e,x="set"+e,I=a[p],O=I,C=O&&O.prototype,A={},R=function(e,t){o(e,t,{get:function(){return function(e,t){var n=r(e);return n.view[k](t*f+n.byteOffset,!0)}(this,t)},set:function(e){return function(e,t,n){var i=r(e);u&&(n=(n=c(n))<0?0:n>255?255:255&n),i.view[x](t*f+i.byteOffset,n,!0)}(this,t,e)},enumerable:!0})};g?rg&&(O=s((function(e,t,n,r){return Ji(e,C),xl(T(t)?E(t)?void 0!==r?new I(t,ug(n,f),r):void 0!==n?new I(t,ug(n,f)):new I(t):_(t)?S(O,t):l(lg,O,t):new I(Dp(t)),e,O)})),Mi&&Mi(O,b),n(t(I),(function(e){e in O||Ae(O,e,I[e])})),O.prototype=C):(O=s((function(e,t,n,r){Ji(e,C);var o,a,s,u=0,c=0;if(T(t)){if(!E(t))return _(t)?S(O,t):l(lg,O,t);o=t,c=ug(n,f);var p=t.byteLength;if(void 0===r){if(p%f)throw h("Wrong length");if((a=p-c)<0)throw h("Wrong length")}else if((a=at(r)*f)+c>p)throw h("Wrong length");s=a/f}else s=Dp(t),o=new d(a=s*f);for(i(e,{buffer:o,byteOffset:c,byteLength:a,length:s,view:new v(o)});u<s;)R(e,u++)})),Mi&&Mi(O,b),C=O.prototype=Bn(w)),C.constructor!==O&&Ae(C,"constructor",O),Ae(C,m,O),y&&Ae(C,y,p),A[p]=O,Ct({global:!0,forced:O!=I,sham:!g},A),"BYTES_PER_ELEMENT"in O||Ae(O,"BYTES_PER_ELEMENT",f),"BYTES_PER_ELEMENT"in C||Ae(C,"BYTES_PER_ELEMENT",f),Yi(p)}):e.exports=function(){}}))("Uint8",(function(e){return function(t,n,r){return e(this,t,n,r)}}));var hg=Math.min,dg=b([].copyWithin||function(e,t){var n=te(this),r=st(n),i=it(e,r),o=it(t,r),a=arguments.length>2?arguments[2]:void 0,s=hg((void 0===a?r:it(a,r))-o,r-i),u=1;for(o<i&&i<o+s&&(u=-1,o+=s-1,i+=s-1);s-- >0;)o in n?n[i]=n[o]:delete n[i],i+=u,o+=u;return n}),fg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("copyWithin",(function(e,t){return dg(fg(this),e,t,arguments.length>2?arguments[2]:void 0)}));var pg=mn.every,vg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("every",(function(e){return pg(vg(this),e,arguments.length>1?arguments[1]:void 0)}));var gg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("fill",(function(e){var t=arguments.length;return l(Kp,gg(this),e,t>1?arguments[1]:void 0,t>2?arguments[2]:void 0)}));var mg=Qv.TYPED_ARRAY_CONSTRUCTOR,yg=Qv.aTypedArrayConstructor,bg=function(e){return yg(Ur(e,e[mg]))},wg=function(e,t){return function(e,t){for(var n=0,r=t.length,i=new e(r);r>n;)i[n]=t[n++];return i}(bg(e),t)},kg=mn.filter,_g=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("filter",(function(e){var t=kg(_g(this),e,arguments.length>1?arguments[1]:void 0);return wg(this,t)}));var Sg=mn.find,xg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("find",(function(e){return Sg(xg(this),e,arguments.length>1?arguments[1]:void 0)}));var Eg=mn.findIndex,Ig=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("findIndex",(function(e){return Eg(Ig(this),e,arguments.length>1?arguments[1]:void 0)}));var Og=mn.forEach,Cg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("forEach",(function(e){Og(Cg(this),e,arguments.length>1?arguments[1]:void 0)}));var Ag=ct.includes,Tg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("includes",(function(e){return Ag(Tg(this),e,arguments.length>1?arguments[1]:void 0)}));var Rg=ct.indexOf,Lg=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("indexOf",(function(e){return Rg(Lg(this),e,arguments.length>1?arguments[1]:void 0)}));var Ng=Xe.PROPER,Mg=de("iterator"),Pg=a.Uint8Array,Dg=b(Wi.values),jg=b(Wi.keys),Bg=b(Wi.entries),Ug=Qv.aTypedArray,Fg=Qv.exportTypedArrayMethod,zg=Pg&&Pg.prototype[Mg],Hg=!!zg&&"values"===zg.name,Vg=function(){return Dg(Ug(this))};Fg("entries",(function(){return Bg(Ug(this))})),Fg("keys",(function(){return jg(Ug(this))})),Fg("values",Vg,Ng&&!Hg),Fg(Mg,Vg,Ng&&!Hg);var Wg=Qv.aTypedArray,Kg=Qv.exportTypedArrayMethod,qg=b([].join);Kg("join",(function(e){return qg(Wg(this),e)}));var Gg=Math.min,Yg=[].lastIndexOf,Zg=!!Yg&&1/[1].lastIndexOf(1,-0)<0,Jg=un("lastIndexOf"),Xg=Zg||!Jg?function(e){if(Zg)return Nr(Yg,this,arguments)||0;var t=C(this),n=st(t),r=n-1;for(arguments.length>1&&(r=Gg(r,tt(arguments[1]))),r<0&&(r=n+r);r>=0;r--)if(r in t&&t[r]===e)return r||0;return-1}:Yg,$g=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("lastIndexOf",(function(e){var t=arguments.length;return Nr(Xg,$g(this),t>1?[e,arguments[1]]:[e])}));var Qg=mn.map,em=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("map",(function(e){return Qg(em(this),e,arguments.length>1?arguments[1]:void 0,(function(e,t){return new(bg(e))(t)}))}));var tm=a.TypeError,nm=function(e){return function(t,n,r,i){G(n);var o=te(t),a=E(o),s=st(o),u=e?s-1:0,c=e?-1:1;if(r<2)for(;;){if(u in a){i=a[u],u+=c;break}if(u+=c,e?u<0:s<=u)throw tm("Reduce of empty array with no initial value")}for(;e?u>=0:s>u;u+=c)u in a&&(i=n(i,a[u],u,o));return i}},rm={left:nm(!1),right:nm(!0)},im=rm.left,om=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("reduce",(function(e){var t=arguments.length;return im(om(this),e,t,t>1?arguments[1]:void 0)}));var am=rm.right,sm=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("reduceRight",(function(e){var t=arguments.length;return am(sm(this),e,t,t>1?arguments[1]:void 0)}));var um=Qv.aTypedArray,cm=Qv.exportTypedArrayMethod,lm=Math.floor;cm("reverse",(function(){for(var e,t=um(this).length,n=lm(t/2),r=0;r<n;)e=this[r],this[r++]=this[--t],this[t]=e;return this}));var hm=a.RangeError,dm=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("set",(function(e){dm(this);var t=ug(arguments.length>1?arguments[1]:void 0,1),n=this.length,r=te(e),i=st(r),o=0;if(i+t>n)throw hm("Wrong length");for(;o<i;)this[t+o]=r[o++]}),s((function(){new Int8Array(1).set({})})));var fm=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("slice",(function(e,t){for(var n=bo(fm(this),e,t),r=bg(this),i=0,o=n.length,a=new r(o);o>i;)a[i]=n[i++];return a}),s((function(){new Int8Array(1).slice()})));var pm=mn.some,vm=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("some",(function(e){return pm(vm(this),e,arguments.length>1?arguments[1]:void 0)}));var gm=Math.floor,mm=function(e,t){var n=e.length,r=gm(n/2);return n<8?ym(e,t):bm(e,mm(Hr(e,0,r),t),mm(Hr(e,r),t),t)},ym=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},bm=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},wm=mm,km=M.match(/firefox\/(\d+)/i),_m=!!km&&+km[1],Sm=/MSIE|Trident/.test(M),xm=M.match(/AppleWebKit\/(\d+)\./),Em=!!xm&&+xm[1],Im=a.Array,Om=Qv.aTypedArray,Cm=Qv.exportTypedArrayMethod,Am=a.Uint16Array,Tm=Am&&b(Am.prototype.sort),Rm=!(!Tm||s((function(){Tm(new Am(2),null)}))&&s((function(){Tm(new Am(2),{})}))),Lm=!!Tm&&!s((function(){if(U)return U<74;if(_m)return _m<67;if(Sm)return!0;if(Em)return Em<602;var e,t,n=new Am(516),r=Im(516);for(e=0;e<516;e++)t=e%4,n[e]=515-e,r[e]=e-2*t+3;for(Tm(n,(function(e,t){return(e/4|0)-(t/4|0)})),e=0;e<516;e++)if(n[e]!==r[e])return!0}));Cm("sort",(function(e){return void 0!==e&&G(e),Lm?Tm(this,e):wm(Om(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))}),!Lm||Rm);var Nm=Qv.aTypedArray;(0,Qv.exportTypedArrayMethod)("subarray",(function(e,t){var n=Nm(this),r=n.length,i=it(e,r);return new(bg(n))(n.buffer,n.byteOffset+i*n.BYTES_PER_ELEMENT,at((void 0===t?r:it(t,r))-i))}));var Mm=a.Int8Array,Pm=Qv.aTypedArray,Dm=Qv.exportTypedArrayMethod,jm=[].toLocaleString,Bm=!!Mm&&s((function(){jm.call(new Mm(1))}));Dm("toLocaleString",(function(){return Nr(jm,Bm?bo(Pm(this)):Pm(this),bo(arguments))}),s((function(){return[1,2].toLocaleString()!=new Mm([1,2]).toLocaleString()}))||!s((function(){Mm.prototype.toLocaleString.call([1,2])})));var Um=Qv.exportTypedArrayMethod,Fm=a.Uint8Array,zm=Fm&&Fm.prototype||{},Hm=[].toString,Vm=b([].join);s((function(){Hm.call({})}))&&(Hm=function(){return Vm(this)});var Wm=zm.toString!=Hm;Um("toString",Hm,Wm);var Km=function(){function e(t){$r(this,e),this.level=0,this.stream=t}return ei(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=100*Number((this.level/128).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}(),qm=function(e){ti(n,Gd);var t=ai(n);function n(e){var r;$r(this,n),r=t.call(this);var i=e.logger,o=e.client,a=void 0===o?null:o;return r.streams=[],r.pipelineStreams=[],r.contentStreams=[],r.previewStreams=[],r.logger=i,r.client=a,r.isShareContent=!1,r.streamStatus=!0,r.config={devices:{}},r.current={type:"FAILED",detail:""},r.audioDeviceId="",r.videoDeviceId="",r.isSupportReauthorize=Xr.isSupportReauthorize(),r.isSupportAppendTrack=Xr.isSupportAppendTrack(),r}return ei(n,[{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(e,t,n){var r;return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c,l,h,d,f,p,v,g,m;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:o=e.streamChangeInfo,a=0===n?this.streams:this.contentStreams,s=0===n?ld:ud,u=a.length,c=0;case 5:if(!(c<u)){i.next=45;break}if("NORMAL"!==a[c].status){i.next=42;break}l=a[c].stream,h=(null===(r=a[c].stream)||void 0===r?void 0:r.getVideoTracks())||[],d=h.length,f=l?this.getIndexFromStreamChange(l,o):-1,p=0;case 12:if(!(p<d)){i.next=42;break}if(v=h[p],-1===f){i.next=29;break}if(g=o[f],m=g.bandwidth>=100?g.bandwidth:100,!v){i.next=27;break}return i.prev=18,i.next=21,v.applyConstraints(s[a[c].resolution].max);case 21:return i.next=23,t.setBandWidth(v.id,m,!0);case 23:i.next=27;break;case 25:i.prev=25,i.t0=i.catch(18);case 27:i.next=39;break;case 29:if(!v){i.next=39;break}return i.prev=30,i.next=33,v.applyConstraints(s[a[c].resolution].min);case 33:return i.next=35,t.setBandWidth(v.id,5,!0);case 35:i.next=39;break;case 37:i.prev=37,i.t1=i.catch(30);case 39:p++,i.next=12;break;case 42:c++,i.next=5;break;case 45:case"end":return i.stop()}}),i,this,[[18,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(_l(10101))}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(_l(20407,e))}}))}},{key:"switchDevice",value:function(e,t){var n,r,i;return sn(this,void 0,void 0,regeneratorRuntime.mark((function o(){var a,s,u;return regeneratorRuntime.wrap((function(o){for(;;)switch(o.prev=o.next){case 0:if(this.logger.log("switch device: type: ".concat(e,", deviceId: ").concat(t)),a=["audio","video"],"string"==typeof e&&a.includes(e)&&"string"==typeof t){o.next=4;break}return o.abrupt("return",Promise.reject(_l(10101)));case 4:if(s=null===(n=this.client)||void 0===n?void 0:n.getSelfRoster(),u=(s||{videoTxMute:!1}).videoTxMute,o.prev=6,"audio"!==e||!t){o.next=11;break}return this.audioDeviceId=t,o.next=11,this.replaceAudioTrack();case 11:if("video"!==e||!t){o.next=22;break}if(this.videoDeviceId=t,!this.isSupportReauthorize){o.next=19;break}if(u){o.next=17;break}return o.next=17,this.replaceVideoTrack();case 17:o.next=22;break;case 19:return o.next=21,this.replaceVideoTrack();case 21:u&&this.setStreamStatus("muteVideo");case 22:return null===(i=null===(r=this.client)||void 0===r?void 0:r.deviceManager)||void 0===i||i.setCurrentUsedDeviceByType(e,t),o.abrupt("return",!0);case 26:return o.prev=26,o.t0=o.catch(6),o.abrupt("return",Promise.reject(_l(20522,o.t0)));case 29:case"end":return o.stop()}}),o,this,[[6,26]])})))}},{key:"sendStreamStatus",value:function(){this.emmit("stream-status",this.current)}},{key:"replaceAudioTrack",value:function(){var e,t=!(arguments.length>0&&void 0!==arguments[0])||arguments[0];return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return this.streams.every((function(e){var t;"180"===e.resolution&&(null===(t=e.stream)||void 0===t||t.getAudioTracks().forEach((function(t){var n;t.stop(),null===(n=e.stream)||void 0===n||n.removeTrack(t)})))})),n.prev=1,n.next=4,this.createNextAudioTracks();case 4:n.next=9;break;case 6:return n.prev=6,n.t0=n.catch(1),n.abrupt("return",Promise.reject(n.t0));case 9:null===(e=this.client)||void 0===e||e.applyVideoOrAudio("audio",!t),this.audioLevel=null;case 11:case"end":return n.stop()}}),n,this,[[1,6]])})))}},{key:"replaceVideoTrack",value:function(){var e,t,n;return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:if(i=null===(e=this.previewStreams[0])||void 0===e?void 0:e.stream,o=i&&i.getVideoTracks().length>0,!i){r.next=17;break}return r.prev=3,this.isSupportAppendTrack||(this.logger.log("The first step is to delete the track when replaceVideoTrack..."),this.removePreviousVideoTracks(!0)),r.next=7,this.createNextVideoTracks();case 7:this.isSupportAppendTrack&&this.removePreviousVideoTracks(),null===(t=this.client)||void 0===t||t.applyVideoOrAudio("video",!o),null===(n=this.client)||void 0===n||n.sendPeopleCapability(),r.next=15;break;case 12:return r.prev=12,r.t0=r.catch(3),r.abrupt("return",Promise.reject(r.t0));case 15:r.next=18;break;case 17:return r.abrupt("return",Promise.reject(_l(20530)));case 18:case"end":return r.stop()}}),r,this,[[3,12]])})))}},{key:"setAudioOrVideoStatus",value:function(e){var t,n,r;return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if("unmuteAudio"!==e&&"unmuteVideo"!==e||"SEND_ONLY"!==this.current.type){i.next=9;break}return o={},a="video","unmuteAudio"===e&&(o={muteAudio:!1},a="audio"),"unmuteVideo"===e&&(o={muteVideo:!1},a="video"),i.next=7,this.init(this.config,o);case 7:return null===(t=this.client)||void 0===t||t.applyVideoOrAudio(a,!0),i.abrupt("return");case 9:if("unmuteAudio"!==e){i.next=22;break}if(s=(null===(r=null===(n=this.streams.find((function(e){return"180"===e.resolution})))||void 0===n?void 0:n.stream)||void 0===r?void 0:r.getAudioTracks())||[],u=s.length>0){i.next=22;break}return i.prev=13,i.next=16,this.replaceAudioTrack(u);case 16:return i.abrupt("return");case 19:return i.prev=19,i.t0=i.catch(13),i.abrupt("return",Promise.reject(i.t0));case 22:if("muteAudio"!==e&&"unmuteAudio"!==e||this.setStreamStatus(e),"muteVideo"===e&&setTimeout((function(){c.setStreamStatus(e)}),250),"unmuteVideo"!==e){i.next=37;break}if(i.prev=25,this.isSupportReauthorize){i.next=30;break}this.setStreamStatus(e),i.next=32;break;case 30:return i.next=32,this.replaceVideoTrack();case 32:i.next=37;break;case 34:return i.prev=34,i.t1=i.catch(25),i.abrupt("return",Promise.reject(i.t1));case 37:case"end":return i.stop()}}),i,this,[[13,19],[25,34]])})))}},{key:"setStreamStatus",value:function(e){var t=this;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(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId,t=n.getContraints(!1,!0),r={};return e&&(r={deviceId:{exact:e}}),Object.assign(t.audio,r),this.logger.log("create next audio track contrants:",t),t}},{key:"getNextAudioMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.getNextAudioContraints(e),t.prev=1,t.next=4,this.getUserMedia(n);case 4:r=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next audio track error:",t.t0),t.prev=10,n=this.getNextAudioContraints(""),t.next=14,this.getUserMedia(n);case 14:r=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextAudioTracks",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.audioDeviceId;return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=null,t.prev=1,t.next=4,this.getNextAudioMedia(e);case 4:n=t.sent,t.next=11;break;case 7:return t.prev=7,t.t0=t.catch(1),r=this.handleCreateStreamError(t.t0),t.abrupt("return",Promise.reject(r));case 11:i=n.getAudioTracks()[0],this.streams.some((function(e){var t;if("180"===e.resolution)return null===(t=e.stream)||void 0===t||t.addTrack(i),!0}));case 13:case"end":return t.stop()}}),t,this,[[1,7]])})))}},{key:"getNextVideoContraints",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId,t=n.getContraints(!0,!1),r={};return e&&(r={deviceId:{exact:e}}),Object.assign(t.video,r),this.logger.log("create next video track contrants:",t),t}},{key:"getNextVideoMedia",value:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=this.getNextVideoContraints(e),t.prev=1,t.next=4,this.getUserMedia(n);case 4:r=t.sent,t.next=20;break;case 7:return t.prev=7,t.t0=t.catch(1),this.logger.error("create next video track error:",t.t0),t.prev=10,n=this.getNextVideoContraints(""),t.next=14,this.getUserMedia(n);case 14:r=t.sent,t.next=20;break;case 17:return t.prev=17,t.t1=t.catch(10),t.abrupt("return",Promise.reject(t.t1));case 20:return t.abrupt("return",r);case 21:case"end":return t.stop()}}),t,this,[[1,7],[10,17]])})))}},{key:"createNextVideoTracks",value:function(){var e,t,n,r=arguments.length>0&&void 0!==arguments[0]?arguments[0]:this.videoDeviceId;return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a,s,u,c,l,h,d=this;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=null,i.prev=1,i.next=4,this.getNextVideoMedia(r);case 4:o=i.sent,i.next=11;break;case 7:return i.prev=7,i.t0=i.catch(1),a=this.handleCreateStreamError(i.t0),i.abrupt("return",Promise.reject(a));case 11:s=o.getVideoTracks()[0],u=[s.clone(),s.clone(),s.clone()],null===(e=this.previewStreams[0].stream)||void 0===e||e.addTrack(s),c=hi(this.streams.entries()),i.prev=15,h=regeneratorRuntime.mark((function e(){var r,i,o,a;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return r=si(l.value,2),i=r[0],o=r[1],e.prev=1,a=ld[o.resolution].max,e.next=5,u[i].applyConstraints(a);case 5:null===(t=o.stream)||void 0===t||t.addTrack(u[i]),d.streams[i].status="NORMAL",d.logger.log("create next remote track constranits:",a,d.streams),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(1),d.logger.error("new video track apply constraints error: ",e.t0),d.streams[i].status="INVALID",null===(n=d.streams[i].stream)||void 0===n||n.getTracks().forEach((function(e){e.stop(),d.logger.log("disabled track",u[i].id)}));case 15:case"end":return e.stop()}}),e,null,[[1,10]])})),c.s();case 18:if((l=c.n()).done){i.next=22;break}return i.delegateYield(h(),"t1",20);case 20:i.next=18;break;case 22:i.next=27;break;case 24:i.prev=24,i.t2=i.catch(15),c.e(i.t2);case 27:return i.prev=27,c.f(),i.finish(27);case 30:case"end":return i.stop()}}),i,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)||i[0];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)||i[0];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}))}},{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=td[t].status),n.isSupportReauthorize)"video"===e.kind&&"muteVideo"===t&&(td[t].status||e.stop());else if("video"===e.kind&&("muteVideo"===t||"unmuteVideo"===t)){var r=td[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.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 e,t,n,r,i,o,a,s,u,c=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{devices:{}},l=arguments.length>1?arguments[1]:void 0;return sn(this,void 0,void 0,regeneratorRuntime.mark((function h(){var d,f,p,v,g,m,y,b,w,k,_,S,x,E,I,O;return regeneratorRuntime.wrap((function(h){for(;;)switch(h.prev=h.next){case 0:if(this.logger.log("stream init config:",c),this.streamStatus){h.next=3;break}return h.abrupt("return",Promise.reject(_l(30524)));case 3:if(this.client){h.next=5;break}return h.abrupt("return",Promise.reject(_l(30528)));case 5:if(this.config=c,d=(null==c?void 0:c.devices)||{audioInputValue:"",videoInValue:""},f=d.audioInputValue,p=void 0===f?"":f,v=d.videoInValue,g=void 0===v?"":v,m=null===(e=this.client.deviceManager)||void 0===e?void 0:e.getDevicePermission(),y=m.camera,b=m.microphone,w=!0,k=!0,_={type:"NORMAL",detail:"successfully"},w=!(null!==(t=null==l?void 0:l.muteVideo)&&void 0!==t?t:null===(n=this.client)||void 0===n?void 0:n.config.muteVideo),k=!(null!==(r=null==l?void 0:l.muteAudio)&&void 0!==r?r:null===(i=this.client)||void 0===i?void 0:i.config.muteAudio),"denied"===y&&(w=!1,_={type:"AUDIO_ONLY",detail:"Camera is not found or permission denied"}),"denied"===b&&(k=!1,_={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=_,w||k){h.next=21;break}return h.next=20,this.dealWithoutStreams();case 20:return h.abrupt("return",h.sent);case 21:return h.prev=21,h.next=24,this.getStream(w,k,g,p);case 24:return h.abrupt("return",h.sent);case 27:if(h.prev=27,h.t0=h.catch(21),S=this.handleCreateStreamError(h.t0),x=S.code,this.logger.log("get stream is error:",S),!w||20405!==x&&20402!==x){h.next=45;break}return this.logger.log("Reduce resolution to get stream..."),h.prev=34,h.next=37,this.getStream(w,k,g,p,!0);case 37:return h.abrupt("return",h.sent);case 40:h.prev=40,h.t1=h.catch(34),S=this.handleCreateStreamError(h.t0),x=S.code,this.logger.log("Reduce resolution to get stream is error:",S);case 45:if(!$h.includes(x)){h.next=78;break}if(this.logger.log("Init domstream successfully",{status:S,err:h.t0}),!w||!k||20403===x){h.next=71;break}return h.prev=48,this.logger.log("only video stream create..."),h.next=52,this.getStream(!0,!1,g,p);case 52:return h.abrupt("return",h.sent);case 55:h.prev=55,h.t2=h.catch(48),this.logger.log("get video stream failed:",h.t2);case 58:return h.prev=58,this.logger.log("only audio stream create..."),h.next=62,this.getStream(!1,!0,g,p);case 62:return h.abrupt("return",h.sent);case 65:h.prev=65,h.t3=h.catch(58),this.logger.log("get audio stream failed:",h.t3);case 68:return h.next=70,this.dealWithoutStreams();case 70:return h.abrupt("return",h.sent);case 71:return E=null===(a=null===(o=this.client)||void 0===o?void 0:o.deviceManager)||void 0===a?void 0:a.getDevicePermission(),I=E.camera,O=E.microphone,null===(u=null===(s=this.client)||void 0===s?void 0:s.deviceManager)||void 0===u||u.setPermission({camera:w&&"unknow"===I?"denied":I,microphone:k&&"unknow"===O?"denied":O}),h.next=75,this.dealWithoutStreams();case 75:return h.abrupt("return",h.sent);case 78:return this.logger.warn("Init stream failed",{status:S,err:h.t0}),this.current={type:"FAILED",detail:S},h.abrupt("return",Promise.reject(_l(30527,Object.assign({status:S},this.current))));case 81:case"end":return h.stop()}}),h,this,[[21,27],[34,40],[48,55],[58,65]])})))}},{key:"getStream",value:function(e,t,n,r){var i,o,a=arguments.length>4&&void 0!==arguments[4]&&arguments[4];return sn(this,void 0,void 0,regeneratorRuntime.mark((function s(){var u,c,l,h,d;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,u=this.getInitContraints(e,t,n,r,a),this.logger.log("init contraints:",u),s.next=5,this.getUserMedia(u);case 5:return c=s.sent,(null===(i=null==u?void 0:u.audio)||void 0===i?void 0:i.echoCancellation)&&c.getAudioTracks()[0].applyConstraints({echoCancellation:!0}),this.logger.log("base remote stream: ",c),s.next=10,this.initStreams(c);case 10:return this.streamStatus||this.close(),(null===(o=this.client)||void 0===o?void 0:o.deviceManager)&&(l=this.client.deviceManager.getDevicePermission(),h=l.camera,d=l.microphone,this.client.deviceManager.setPermission({camera:e?"granted":h,microphone:t?"granted":d})),this.emmit("local-stream",this.previewStreams),s.abrupt("return",_l(30525,this.previewStreams));case 16:return s.prev=16,s.t0=s.catch(0),s.abrupt("return",Promise.reject(s.t0));case 19:case"end":return s.stop()}}),s,this,[[0,16]])})))}},{key:"dealWithoutStreams",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=_l(20404),this.current={type:this.isSupportReauthorize?"SEND_ONLY":"FAILED",detail:e||n.msg},t.next=4,this.initStreams(null);case 4:return t.abrupt("return",_l(30526,this.current));case 5:case"end":return t.stop()}}),t,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],r=arguments.length>2?arguments[2]:void 0,i=arguments.length>3?arguments[3]:void 0,o=arguments.length>4&&void 0!==arguments[4]&&arguments[4],a={};o&&(a={width:rd,height:id});var s=n.getContraints(e,t,a);if(i&&"default"!==i){var u={deviceId:{exact:i}};this.audioDeviceId=i,Object.assign(s.audio,u)}if(r){var c={deviceId:{exact:r}};this.videoDeviceId=r,Object.assign(s.video,c)}return this.logger.log("init remote constraints: ",s),s}},{key:"initStreams",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,this.initPreviewStream(e);case 2:return t.next=4,this.initRemoteStreams(e);case 4:this.initPipelineStreams();case 5:case"end":return t.stop()}}),t,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(e){var t,n,r,i,o,a;return sn(this,void 0,void 0,regeneratorRuntime.mark((function s(){var u,c,l,h,d,f,p,v=this;return regeneratorRuntime.wrap((function(s){for(;;)switch(s.prev=s.next){case 0:if(!e){s.next=25;break}u=e.clone(),c=e.clone(),null===(t=u.getAudioTracks()[0])||void 0===t||t.stop(),null===(n=c.getAudioTracks()[0])||void 0===n||n.stop(),l={stream:null,domStream:[],status:"NORMAL",type:"remoteStream",resolution:"180"},this.streams=[Object.assign(Object.assign({},l),{stream:e}),Object.assign(Object.assign({},l),{stream:u,resolution:"360"}),Object.assign(Object.assign({},l),{stream:c,resolution:"720"})],h=hi(this.streams.entries()),s.prev=8,f=regeneratorRuntime.mark((function e(){var t,n,s,u,c;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(t=si(d.value,2),n=t[0],s=t[1],!(u=null===(r=s.stream)||void 0===r?void 0:r.getVideoTracks()[0])){e.next=15;break}return e.prev=3,c=ld[s.resolution].max,e.next=7,u.applyConstraints(c);case 7:v.logger.log("init remote track constranits:",c,null===(i=s.stream)||void 0===i?void 0:i.id),e.next=15;break;case 10:e.prev=10,e.t0=e.catch(3),v.logger.error("init remote track constranits failed:",e.t0,null===(o=s.stream)||void 0===o?void 0:o.id),v.streams[n].status="INVALID",null===(a=v.streams[n].stream)||void 0===a||a.getTracks().forEach((function(e){e.stop(),v.logger.log("disabled track",u.id)}));case 15:case"end":return e.stop()}}),e,null,[[3,10]])})),h.s();case 11:if((d=h.n()).done){s.next=15;break}return s.delegateYield(f(),"t0",13);case 13:s.next=11;break;case 15:s.next=20;break;case 17:s.prev=17,s.t1=s.catch(8),h.e(s.t1);case 20:return s.prev=20,h.f(),s.finish(20);case 23:s.next=28;break;case 25: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 28:case"end":return s.stop()}}),s,this,[[8,17,20,23]])})))}},{key:"initPreviewStream",value:function(e){var t,n,r;return sn(this,void 0,void 0,regeneratorRuntime.mark((function i(){var o,a;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:if(!e){i.next=15;break}return i.prev=1,o={stream:e.clone(),domStream:[],status:"NORMAL",type:"previewStream",resolution:"360"},i.next=5,null===(n=null===(t=o.stream)||void 0===t?void 0:t.getVideoTracks()[0])||void 0===n?void 0:n.applyConstraints(ld[360].max);case 5:null===(r=o.stream)||void 0===r||r.getAudioTracks().forEach((function(e){e.stop()})),this.logger.log("init local stream succeffully"),this.previewStreams=[o],i.next=13;break;case 10:i.prev=10,i.t0=i.catch(1),this.logger.error("init local constraints failed: ",i.t0);case 13:i.next=17;break;case 15:a={stream:null,domStream:[{kind:"video"}],status:"DOMSTRING",type:"previewStream",resolution:"360"},this.previewStreams=[a];case 17:case"end":return i.stop()}}),i,this,[[1,10]])})))}},{key:"setClientObj",value:function(e){this.client=e,this.updateDeviceByLocalStream()}},{key:"updateDeviceByLocalStream",value:function(){var e,t,n,r,i,o;if("NORMAL"===this.current.type||"AUDIO_ONLY"===this.current.type||"VIDEO_ONLY"===this.current.type){var a=null===(e=this.previewStreams[0].stream)||void 0===e?void 0:e.getAudioTracks()[0],s=null===(t=this.previewStreams[0].stream)||void 0===t?void 0:t.getVideoTracks()[0],u=null==a?void 0:a.getSettings(),c=null==s?void 0:s.getSettings(),l={audioInput:u?{deviceId:u.deviceId||"",groupId:u.groupId||"",label:(null==a?void 0:a.label)||""}:void 0,videoInput:c?{deviceId:c.deviceId||"",groupId:c.groupId||"",label:(null==s?void 0:s.label)||""}:void 0,audioOutput:{deviceId:(null===(r=null===(n=this.config)||void 0===n?void 0:n.devices)||void 0===r?void 0:r.audioOutputValue)||"default",groupId:"",label:""}};this.logger.log("Cache preview stream device info by tracks: ",l),null===(o=null===(i=this.client)||void 0===i?void 0:i.deviceManager)||void 0===o||o.setCurrentUsedDevice(l)}}},{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 Km(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(_l(20530)))}))}},{key:"clearAudioLevel",value:function(){this.audioLevel=null}},{key:"closeContentStream",value:function(){var e=this;if(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(){return sn(this,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n;return regeneratorRuntime.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(_l(20508)));case 3:return this.createBaseContentStreams(),e.prev=4,t={video:ud[1080].max,audio:!1},e.next=8,navigator.mediaDevices.getDisplayMedia(t);case 8:return n=e.sent,e.next=11,this.dealCaptureStream(n);case 11:return e.abrupt("return",this.contentStreams);case 14:return e.prev=14,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 19:case"end":return e.stop()}}),e,this,[[4,14]])})))}},{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(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:["window","screen"];return sn(this,void 0,void 0,regeneratorRuntime.mark((function n(){var r;return regeneratorRuntime.wrap((function(n){for(;;)switch(n.prev=n.next){case 0:return n.prev=0,n.next=3,e.getSources({types:t});case 3:return r=n.sent,n.abrupt("return",r);case 7:return n.prev=7,n.t0=n.catch(0),n.abrupt("return",n.t0);case 10:case"end":return n.stop()}}),n,null,[[0,7]])})))}},{key:"createElectronContentStream",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:if(!this.isShareContent){t.next=3;break}return this.logger.warn("Already share content!"),t.abrupt("return",Promise.reject(_l(20508)));case 3:if(e){t.next=6;break}return this.logger.warn("No selected sourceId!"),t.abrupt("return",Promise.reject(_l(20509)));case 6:return this.createBaseContentStreams(),t.prev=7,t.next=10,this.electronCapture(e);case 10:return n=t.sent,t.next=13,this.dealCaptureStream(n);case 13:return t.abrupt("return",this.contentStreams);case 16:return t.prev=16,t.t0=t.catch(7),this.logger.error("capture electron content stream failed: ",t.t0),this.isShareContent=!1,t.abrupt("return",this.handleCreateContentStreamError(t.t0));case 21:case"end":return t.stop()}}),t,this,[[7,16]])})))}},{key:"getPreviewStream",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]:{video:{},audio:{}};return sn(this,void 0,void 0,regeneratorRuntime.mark((function r(){var i,o,a,s,u,c,l;return regeneratorRuntime.wrap((function(r){for(;;)switch(r.prev=r.next){case 0:return r.prev=0,i=n.video,o=void 0===i?{}:i,a=n.audio,s=void 0===a?{}:a,u={},e&&(u.video=Object.assign({},od,o)),t&&(u.audio=Object.assign({},s)),this.logger.log("get preview stream constraints:",u),r.next=8,this.getUserMedia(u);case 8:return c=r.sent,r.abrupt("return",c);case 12:return r.prev=12,r.t0=r.catch(0),l=this.handleCreateStreamError(r.t0),r.abrupt("return",Promise.reject(l));case 16:case"end":return r.stop()}}),r,this,[[0,12]])})))}},{key:"getUserMedia",value:function(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,this.logger.log("get user media constraints:",e),t.next=4,navigator.mediaDevices.getUserMedia(e);case 4:return n=t.sent,this.logger.log("get user media active:",n.active),t.abrupt("return",n);case 9:return t.prev=9,t.t0=t.catch(0),t.abrupt("return",Promise.reject(t.t0));case 12:case"end":return t.stop()}}),t,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(e){return sn(this,void 0,void 0,regeneratorRuntime.mark((function t(){var n,r,i;return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:return n=e.getVideoTracks()[0],r=n.clone(),i=ud[720].max,t.prev=3,t.next=6,r.applyConstraints(i);case 6:t.next=12;break;case 8:t.prev=8,t.t0=t.catch(3),this.streams[1].status="INVALID",this.logger.error("set 720p content stream conts error: ",t.t0);case 12:this.handleCloseShareContentEvent(n,r),this.updateContentStreamTrack(n,r),this.client&&this.client.applyShareContent(),this.logger.log("create share content stream: ",this.contentStreams);case 16:case"end":return t.stop()}}),t,this,[[3,8]])})))}},{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){this.contentStreams=this.contentStreams.map((function(n){var r,i;return"1080"===n.resolution?null===(r=n.stream)||void 0===r||r.addTrack(e):null===(i=n.stream)||void 0===i||i.addTrack(t),Object.assign(Object.assign({},n),{isSupport:!0})}))}},{key:"handleCreateContentStreamError",value:function(e){var t=e.name,n=e.message;return _l("NotAllowedError"===t?"Permission denied by system"===n?20507:"Permission denied"===n?20500:20510:"InvalidStateError"===t?20501:"AbortError"===t?20502:"NotFoundError"===t?20503:"NotReadableError"===t?20504:"OverconstrainedError"===t?20505:"TypeError"===t?20506:20502,e)}},{key:"handleCreateStreamError",value:function(e){var t={code:0,msg:"",detail:""};return t="NotFoundError"==e.name||"DevicesNotFoundError"==e.name?_l(20400,e):"NotReadableError"==e.name||"TrackStartError"==e.name?_l(20401,e):"OverconstrainedError"==e.name||"ConstraintNotSatisfiedError"==e.name?_l(20402,e):"NotAllowedError"==e.name||"PermissionDeniedError"==e.name||e.message.includes("NotAllowedError")?_l(20403,e):"TypeError"==e.name||"TypeError"==e.name?_l(20404,e):_l(20405,e),this.logger.error(t),t}}],[{key:"getStreamInstance",value:function(e){return this.instance||(this.instance=new n(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],r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{},i=n.getSupportConstraints(),o={},a={},s={audio:o,video:a},u=r.channelCount,c=void 0===u?1:u,l=r.autoGainControl,h=void 0===l||l,d=r.noiseSuppression,f=void 0===d||d,p=r.echoCancellation,v=void 0===p||p,g=r.frameRate,m=void 0===g?od.frameRate:g,y=r.aspectRatio,b=void 0===y?od.aspectRatio:y,w=r.resizeMode,k=void 0===w?od.resizeMode:w,_=r.width,S=void 0===_?nd.width:_,x=r.height,E=void 0===x?nd.height:x,I={channelCount:c,autoGainControl:h,noiseSuppression:f,echoCancellation:v},O={frameRate:m,aspectRatio:b,resizeMode:k,width:S,height:E};return Object.keys(I).forEach((function(e){o[e]=I[e]})),Object.keys(O).forEach((function(e){i[e]&&(a[e]=O[e])})),s.audio=!!t&&o,s.video=!!e&&a,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}}]),n}(),Gm="*********************************************************",Ym={version:Sd,client:null,checkSupportWebRTC:function(){return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Xr.isSupportRTC(),n=Xr.isSupportWebsocket(),r=Xr.isMinBrowser(),e.next=5,Xr.isSupportH264();case 5:return i=e.sent,o={result:t&&n&&r&&i,detail:{isSupportRTC:t,isSupportWebsocket:n,isSupportBrowser:r,isSupportH264:i}},Ym.logger.debug("desktop support result: ",o),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))},checkSupportMobileWebRTC:function(){return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function e(){var t,n,r,i,o;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t=Xr.isMobile(),n=Xr.isSupportRTC(),r=Xr.isSupportWebsocket(),e.next=5,Xr.isSupportH264();case 5:return i=e.sent,o={result:n&&r&&t&&i,detail:{isSupportRTC:n,isSupportWebsocket:r,isSupportBrowser:t,isSupportH264:i}},Ym.logger.debug("mobile support result: ",o),e.abrupt("return",o);case 10:case"end":return e.stop()}}),e)})))},checkSupportShareContent:function(){return!(!navigator.mediaDevices||!navigator.mediaDevices.getDisplayMedia)},setLocale:function(e){!function(e){yl=e}(e)},logger:new Md,createClient:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{},t=Ym.logger,n=xd,r=Ed,i=Id,o={wssServer:n,httpServer:r,logServer:i,layout:"AUTO",debug:!1,muteAudio:!1,muteVideo:!1,localHide:!1,localMirror:!0,isThird:!0},a=e.container||{},s=Object.assign(Object.assign(Object.assign({},o),e),{container:a}),u=s.wssServer,c=void 0===u?"":u,l=s.httpServer,h=void 0===l?"":l,d=s.logServer,f=void 0===d?"":d,p=s.clientId,v=void 0===p?"":p;Nd.setBaseUrl(h,f),Nd.setClientId(v);var g=new Rp(s,{wssServer:c,httpServer:h,logServer:f},t);return Ym.client=g,g},createStream:function(){var e=Ym.logger;return new qm({logger:e,client:Ym.client})},setConfig:function(e){Nd.setLoginInfo(e),Nd.setClientId(e.client_id)},closePreviewStream:function(e){return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function t(){return regeneratorRuntime.wrap((function(t){for(;;)switch(t.prev=t.next){case 0:e&&e.getTracks().forEach((function(e){e.enabled=!1,e.stop()}));case 1:case"end":return t.stop()}}),t)})))},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(Gm," \n\t\n * 欢迎使用 XY RTC SDK - 小鱼易连Web云视频 \n\t\n * 版本:").concat(Sd," \n\t\n * 文档地址:http://openapi.xylink.com/doc_web/product/description/ \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(Gm),"color: #3876ff;"),console.info("%c[INFO] XY Agent:"+navigator.userAgent+"\n","color: #3876ff;"),void console.groupEnd())};window.xyRTC=Ym,exports.Client=Rp,exports.DeviceManager=$f,exports.ERROR_CODE=ml,exports.Stream=qm,exports.default=Ym,exports.detectLocator=function(e){var t=e.extId,n=e.clientId,r=e.clientSecret,i=e.httpServer;return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function e(){var o,a,s,u;return regeneratorRuntime.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return t&&n&&r||Promise.reject(_l(10101)),o="",e.prev=2,e.next=5,Nd.getEnterpriseId({extId:t,clientId:n,clientSecret:r,httpServer:i});case 5:if(!(a=e.sent)){e.next=21;break}return e.next=9,Nd.locator({extId:a,clientId:n,clientSecret:r,httpServer:i});case 9:if(s=e.sent,!((u=s.filter((function(e){return"WebrtcSigGW"===e.serverName}))).length>0)){e.next=20;break}return e.prev=12,e.next=15,new Promise((function(e,t){var n=u.length;u.map((function(r){return sn(void 0,void 0,void 0,regeneratorRuntime.mark((function i(){var o;return regeneratorRuntime.wrap((function(i){for(;;)switch(i.prev=i.next){case 0:return o=r.innerIp.split(":")[0],i.prev=1,"https:",i.next=5,Jh.get("".concat("https:","//").concat(o),{timeout:2e3});case 5:e(r.innerIp),i.next=12;break;case 8:i.prev=8,i.t0=i.catch(1),0===--n&&t("All promises were rejected");case 12:case"end":return i.stop()}}),i,null,[[1,8]])})))}))}));case 15:o=e.sent,e.next=20;break;case 18:e.prev=18,e.t0=e.catch(12);case 20:case 21:return e.abrupt("return",o);case 24:return e.prev=24,e.t1=e.catch(2),e.abrupt("return",Promise.reject(e.t1));case 27:case"end":return e.stop()}}),e,null,[[2,24],[12,18]])})))},exports.getLayoutItemState=wp,exports.getLayoutRotateInfo=_p,exports.getSendSupportedCodec=Sp,exports.getVideoInfoByRotaion=kp;
|