uneeq-js 2.39.8 → 2.40.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.js CHANGED
@@ -28,8 +28,8 @@ var r=n(122),i=n(123),V=n(124);function o(){return a.TYPED_ARRAY_SUPPORT?2147483
28
28
  * Released under MIT license <https://lodash.com/license>
29
29
  * Based on Underscore.js 1.8.3 <http://underscorejs.org/LICENSE>
30
30
  * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors
31
- */(function(){var V,o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="__lodash_hash_undefined__",u=500,h="__lodash_placeholder__",l=1,f=2,d=4,p=1,g=2,v=1,y=2,m=4,b=8,_=16,w=32,A=64,S=128,x=256,C=512,T=30,E="...",R=800,M=16,O=1,P=2,k=1/0,D=9007199254740991,I=17976931348623157e292,N=NaN,j=4294967295,L=j-1,U=j>>>1,F=[["ary",S],["bind",v],["bindKey",y],["curry",b],["curryRight",_],["flip",C],["partial",w],["partialRight",A],["rearg",x]],B="[object Arguments]",W="[object Array]",z="[object AsyncFunction]",q="[object Boolean]",H="[object Date]",G="[object DOMException]",Y="[object Error]",$="[object Function]",Q="[object GeneratorFunction]",X="[object Map]",Z="[object Number]",K="[object Null]",J="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",Vt="[object Undefined]",ot="[object WeakMap]",st="[object WeakSet]",at="[object ArrayBuffer]",ct="[object DataView]",ut="[object Float32Array]",ht="[object Float64Array]",lt="[object Int8Array]",ft="[object Int16Array]",dt="[object Int32Array]",pt="[object Uint8Array]",gt="[object Uint8ClampedArray]",vt="[object Uint16Array]",yt="[object Uint32Array]",mt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,St=RegExp(wt.source),xt=RegExp(At.source),Ct=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,kt=RegExp(Pt.source),Dt=/^\s+|\s+$/g,It=/^\s+/,Nt=/\s+$/,jt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ut=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bt=/\\(\\)?/g,Wt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Ht=/^0b[01]+$/i,Gt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,$t=/^(?:0|[1-9]\d*)$/,Qt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,Zt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Jt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Jt+"]",ne="["+Kt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",Ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Jt+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",le="(?:"+Ve+"|"+oe+")",fe="(?:"+he+"|"+oe+")",de="(?:"+ne+"|"+se+")"+"?",pe="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[ae,ce,ue].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ce,ue].join("|")+")"+pe,ve="(?:"+[ae+ne+"?",ne,ce,ue,te].join("|")+")",ye=RegExp("['’]","g"),me=RegExp(ne,"g"),be=RegExp(se+"(?="+se+")|"+ve+pe,"g"),_e=RegExp([he+"?"+Ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,he,"$"].join("|")+")",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,he+le,"$"].join("|")+")",he+"?"+le+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),Ae=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Ce={};Ce[ut]=Ce[ht]=Ce[lt]=Ce[ft]=Ce[dt]=Ce[pt]=Ce[gt]=Ce[vt]=Ce[yt]=!0,Ce[B]=Ce[W]=Ce[at]=Ce[q]=Ce[ct]=Ce[H]=Ce[Y]=Ce[$]=Ce[X]=Ce[Z]=Ce[J]=Ce[et]=Ce[nt]=Ce[rt]=Ce[ot]=!1;var Te={};Te[B]=Te[W]=Te[at]=Te[ct]=Te[q]=Te[H]=Te[ut]=Te[ht]=Te[lt]=Te[ft]=Te[dt]=Te[X]=Te[Z]=Te[J]=Te[et]=Te[nt]=Te[rt]=Te[it]=Te[pt]=Te[gt]=Te[vt]=Te[yt]=!0,Te[Y]=Te[$]=Te[ot]=!1;var Ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Re=parseFloat,Me=parseInt,Oe="object"==typeof t&&t&&t.Object===Object&&t,Pe="object"==typeof self&&self&&self.Object===Object&&self,ke=Oe||Pe||Function("return this")(),De=e&&!e.nodeType&&e,Ie=De&&"object"==typeof r&&r&&!r.nodeType&&r,Ne=Ie&&Ie.exports===De,je=Ne&&Oe.process,Le=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t||je&&je.binding&&je.binding("util")}catch(t){}}(),Ue=Le&&Le.isArrayBuffer,Fe=Le&&Le.isDate,Be=Le&&Le.isMap,We=Le&&Le.isRegExp,ze=Le&&Le.isSet,qe=Le&&Le.isTypedArray;function He(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ge(t,e,n,r){for(var i=-1,V=null==t?0:t.length;++i<V;){var o=t[i];e(r,o,n(o),t)}return r}function Ye(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function $e(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Qe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Xe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,V=[];++n<r;){var o=t[n];e(o,n,t)&&(V[i++]=o)}return V}function Ze(t,e){return!!(null==t?0:t.length)&&an(t,e,0)>-1}function Ke(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function tn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function en(t,e,n,r){var i=-1,V=null==t?0:t.length;for(r&&V&&(n=t[++i]);++i<V;)n=e(n,t[i],i,t);return n}function nn(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function rn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Vn=ln("length");function on(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function sn(t,e,n,r){for(var i=t.length,V=n+(r?1:-1);r?V--:++V<i;)if(e(t[V],V,t))return V;return-1}function an(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):sn(t,un,n)}function cn(t,e,n,r){for(var i=n-1,V=t.length;++i<V;)if(r(t[i],e))return i;return-1}function un(t){return t!=t}function hn(t,e){var n=null==t?0:t.length;return n?pn(t,e)/n:N}function ln(t){return function(e){return null==e?V:e[t]}}function fn(t){return function(e){return null==t?V:t[e]}}function dn(t,e,n,r,i){return i(t,function(t,i,V){n=r?(r=!1,t):e(n,t,i,V)}),n}function pn(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==V&&(n=n===V?o:n+o)}return n}function gn(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function vn(t){return function(e){return t(e)}}function yn(t,e){return Je(e,function(e){return t[e]})}function mn(t,e){return t.has(e)}function bn(t,e){for(var n=-1,r=t.length;++n<r&&an(e,t[n],0)>-1;);return n}function _n(t,e){for(var n=t.length;n--&&an(e,t[n],0)>-1;);return n}var wn=fn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),An=fn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Sn(t){return"\\"+Ee[t]}function xn(t){return we.test(t)}function Cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function Tn(t,e){return function(n){return t(e(n))}}function En(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n];o!==e&&o!==h||(t[n]=h,V[i++]=n)}return V}function Rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function Mn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function On(t){return xn(t)?function(t){var e=be.lastIndex=0;for(;be.test(t);)++e;return e}(t):Vn(t)}function Pn(t){return xn(t)?function(t){return t.match(be)||[]}(t):function(t){return t.split("")}(t)}var kn=fn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Dn=function t(e){var n,r=(e=null==e?ke:Dn.defaults(ke.Object(),e,Dn.pick(ke,Se))).Array,i=e.Date,Kt=e.Error,Jt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,Ve=r.prototype,oe=Jt.prototype,se=ee.prototype,ae=e["__core-js_shared__"],ce=oe.toString,ue=se.hasOwnProperty,he=0,le=(n=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",fe=se.toString,de=ce.call(ee),pe=ke._,ge=ne("^"+ce.call(ue).replace(Pt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=Ne?e.Buffer:V,be=e.Symbol,we=e.Uint8Array,Ee=ve?ve.allocUnsafe:V,Oe=Tn(ee.getPrototypeOf,ee),Pe=ee.create,De=se.propertyIsEnumerable,Ie=Ve.splice,je=be?be.isConcatSpreadable:V,Le=be?be.iterator:V,Vn=be?be.toStringTag:V,fn=function(){try{var t=LV(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),In=e.clearTimeout!==ke.clearTimeout&&e.clearTimeout,Nn=i&&i.now!==ke.Date.now&&i.now,jn=e.setTimeout!==ke.setTimeout&&e.setTimeout,Ln=te.ceil,Un=te.floor,Fn=ee.getOwnPropertySymbols,Bn=ve?ve.isBuffer:V,Wn=e.isFinite,zn=Ve.join,qn=Tn(ee.keys,ee),Hn=te.max,Gn=te.min,Yn=i.now,$n=e.parseInt,Qn=te.random,Xn=Ve.reverse,Zn=LV(e,"DataView"),Kn=LV(e,"Map"),Jn=LV(e,"Promise"),tr=LV(e,"Set"),er=LV(e,"WeakMap"),nr=LV(ee,"create"),rr=er&&new er,ir={},Vr=uo(Zn),or=uo(Kn),sr=uo(Jn),ar=uo(tr),cr=uo(er),ur=be?be.prototype:V,hr=ur?ur.valueOf:V,lr=ur?ur.toString:V;function fr(t){if(Es(t)&&!vs(t)&&!(t instanceof vr)){if(t instanceof gr)return t;if(ue.call(t,"__wrapped__"))return ho(t)}return new gr(t)}var dr=function(){function t(){}return function(e){if(!Ts(e))return{};if(Pe)return Pe(e);t.prototype=e;var n=new t;return t.prototype=V,n}}();function pr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=V}function vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function mr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function br(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function _r(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new br;++e<n;)this.add(t[e])}function wr(t){var e=this.__data__=new mr(t);this.size=e.size}function Ar(t,e){var n=vs(t),r=!n&&gs(t),i=!n&&!r&&_s(t),V=!n&&!r&&!i&&Ns(t),o=n||r||i||V,s=o?gn(t.length,re):[],a=s.length;for(var c in t)!e&&!ue.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||V&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||HV(c,a))||s.push(c);return s}function Sr(t){var e=t.length;return e?t[_i(0,e-1)]:V}function xr(t,e){return so(nV(t),Dr(e,0,t.length))}function Cr(t){return so(nV(t))}function Tr(t,e,n){(n===V||fs(t[e],n))&&(n!==V||e in t)||Pr(t,e,n)}function Er(t,e,n){var r=t[e];ue.call(t,e)&&fs(r,n)&&(n!==V||e in t)||Pr(t,e,n)}function Rr(t,e){for(var n=t.length;n--;)if(fs(t[n][0],e))return n;return-1}function Mr(t,e,n,r){return Ur(t,function(t,i,V){e(r,t,n(t),V)}),r}function Or(t,e){return t&&rV(e,ia(e),t)}function Pr(t,e,n){"__proto__"==e&&fn?fn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function kr(t,e){for(var n=-1,i=e.length,o=r(i),s=null==t;++n<i;)o[n]=s?V:Js(t,e[n]);return o}function Dr(t,e,n){return t==t&&(n!==V&&(t=t<=n?t:n),e!==V&&(t=t>=e?t:e)),t}function Ir(t,e,n,r,i,o){var s,a=e&l,c=e&f,u=e&d;if(n&&(s=i?n(t,r,i,o):n(t)),s!==V)return s;if(!Ts(t))return t;var h=vs(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&ue.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!a)return nV(t,s)}else{var p=BV(t),g=p==$||p==Q;if(_s(t))return Xi(t,a);if(p==J||p==B||g&&!i){if(s=c||g?{}:zV(t),!a)return c?function(t,e){return rV(t,FV(t),e)}(t,function(t,e){return t&&rV(e,Va(e),t)}(s,t)):function(t,e){return rV(t,UV(t),e)}(t,Or(s,t))}else{if(!Te[p])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case at:return Zi(t);case q:case H:return new r(+t);case ct:return function(t,e){var n=e?Zi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case ut:case ht:case lt:case ft:case dt:case pt:case gt:case vt:case yt:return Ki(t,n);case X:return new r;case Z:case rt:return new r(t);case et:return function(t){var e=new t.constructor(t.source,zt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new r;case it:return i=t,hr?ee(hr.call(i)):{}}var i}(t,p,a)}}o||(o=new wr);var v=o.get(t);if(v)return v;o.set(t,s),ks(t)?t.forEach(function(r){s.add(Ir(r,e,n,r,t,o))}):Rs(t)&&t.forEach(function(r,i){s.set(i,Ir(r,e,n,i,t,o))});var y=h?V:(u?c?OV:MV:c?Va:ia)(t);return Ye(y||t,function(r,i){y&&(r=t[i=r]),Er(s,i,Ir(r,e,n,i,t,o))}),s}function Nr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],o=e[i],s=t[i];if(s===V&&!(i in t)||!o(s))return!1}return!0}function jr(t,e,n){if("function"!=typeof t)throw new ie(a);return ro(function(){t.apply(V,n)},e)}function Lr(t,e,n,r){var i=-1,V=Ze,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;n&&(e=Je(e,vn(n))),r?(V=Ke,s=!1):e.length>=o&&(V=mn,s=!1,e=new _r(e));t:for(;++i<a;){var h=t[i],l=null==n?h:n(h);if(h=r||0!==h?h:0,s&&l==l){for(var f=u;f--;)if(e[f]===l)continue t;c.push(h)}else V(e,l,r)||c.push(h)}return c}fr.templateSettings={escape:Ct,evaluate:Tt,interpolate:Et,variable:"",imports:{_:fr}},fr.prototype=pr.prototype,fr.prototype.constructor=fr,gr.prototype=dr(pr.prototype),gr.prototype.constructor=gr,vr.prototype=dr(pr.prototype),vr.prototype.constructor=vr,yr.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},yr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},yr.prototype.get=function(t){var e=this.__data__;if(nr){var n=e[t];return n===c?V:n}return ue.call(e,t)?e[t]:V},yr.prototype.has=function(t){var e=this.__data__;return nr?e[t]!==V:ue.call(e,t)},yr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nr&&e===V?c:e,this},mr.prototype.clear=function(){this.__data__=[],this.size=0},mr.prototype.delete=function(t){var e=this.__data__,n=Rr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ie.call(e,n,1),--this.size,!0)},mr.prototype.get=function(t){var e=this.__data__,n=Rr(e,t);return n<0?V:e[n][1]},mr.prototype.has=function(t){return Rr(this.__data__,t)>-1},mr.prototype.set=function(t,e){var n=this.__data__,r=Rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Kn||mr),string:new yr}},br.prototype.delete=function(t){var e=NV(this,t).delete(t);return this.size-=e?1:0,e},br.prototype.get=function(t){return NV(this,t).get(t)},br.prototype.has=function(t){return NV(this,t).has(t)},br.prototype.set=function(t,e){var n=NV(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},_r.prototype.add=_r.prototype.push=function(t){return this.__data__.set(t,c),this},_r.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new mr,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof mr){var r=n.__data__;if(!Kn||r.length<o-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new br(r)}return n.set(t,e),this.size=n.size,this};var Ur=oV(Yr),Fr=oV($r,!0);function Br(t,e){var n=!0;return Ur(t,function(t,r,i){return n=!!e(t,r,i)}),n}function Wr(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],s=e(o);if(null!=s&&(a===V?s==s&&!Is(s):n(s,a)))var a=s,c=o}return c}function zr(t,e){var n=[];return Ur(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function qr(t,e,n,r,i){var V=-1,o=t.length;for(n||(n=qV),i||(i=[]);++V<o;){var s=t[V];e>0&&n(s)?e>1?qr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Hr=sV(),Gr=sV(!0);function Yr(t,e){return t&&Hr(t,e,ia)}function $r(t,e){return t&&Gr(t,e,ia)}function Qr(t,e){return Xe(e,function(e){return Ss(t[e])})}function Xr(t,e){for(var n=0,r=(e=Gi(e,t)).length;null!=t&&n<r;)t=t[co(e[n++])];return n&&n==r?t:V}function Zr(t,e,n){var r=e(t);return vs(t)?r:tn(r,n(t))}function Kr(t){return null==t?t===V?Vt:K:Vn&&Vn in ee(t)?function(t){var e=ue.call(t,Vn),n=t[Vn];try{t[Vn]=V;var r=!0}catch(t){}var i=fe.call(t);r&&(e?t[Vn]=n:delete t[Vn]);return i}(t):function(t){return fe.call(t)}(t)}function Jr(t,e){return t>e}function ti(t,e){return null!=t&&ue.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Ke:Ze,o=t[0].length,s=t.length,a=s,c=r(s),u=1/0,h=[];a--;){var l=t[a];a&&e&&(l=Je(l,vn(e))),u=Gn(l.length,u),c[a]=!n&&(e||o>=120&&l.length>=120)?new _r(a&&l):V}l=t[0];var f=-1,d=c[0];t:for(;++f<o&&h.length<u;){var p=l[f],g=e?e(p):p;if(p=n||0!==p?p:0,!(d?mn(d,g):i(h,g,n))){for(a=s;--a;){var v=c[a];if(!(v?mn(v,g):i(t[a],g,n)))continue t}d&&d.push(g),h.push(p)}}return h}function ri(t,e,n){var r=null==(t=to(t,e=Gi(e,t)))?t:t[co(Ao(e))];return null==r?V:He(r,t,n)}function ii(t){return Es(t)&&Kr(t)==B}function Vi(t,e,n,r,i){return t===e||(null==t||null==e||!Es(t)&&!Es(e)?t!=t&&e!=e:function(t,e,n,r,i,o){var s=vs(t),a=vs(e),c=s?W:BV(t),u=a?W:BV(e),h=(c=c==B?J:c)==J,l=(u=u==B?J:u)==J,f=c==u;if(f&&_s(t)){if(!_s(e))return!1;s=!0,h=!1}if(f&&!h)return o||(o=new wr),s||Ns(t)?EV(t,e,n,r,i,o):function(t,e,n,r,i,V,o){switch(n){case ct:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case at:return!(t.byteLength!=e.byteLength||!V(new we(t),new we(e)));case q:case H:case Z:return fs(+t,+e);case Y:return t.name==e.name&&t.message==e.message;case et:case rt:return t==e+"";case X:var s=Cn;case nt:var a=r&p;if(s||(s=Rn),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;r|=g,o.set(t,e);var u=EV(s(t),s(e),r,i,V,o);return o.delete(t),u;case it:if(hr)return hr.call(t)==hr.call(e)}return!1}(t,e,c,n,r,i,o);if(!(n&p)){var d=h&&ue.call(t,"__wrapped__"),v=l&&ue.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,m=v?e.value():e;return o||(o=new wr),i(y,m,n,r,o)}}if(!f)return!1;return o||(o=new wr),function(t,e,n,r,i,o){var s=n&p,a=MV(t),c=a.length,u=MV(e).length;if(c!=u&&!s)return!1;var h=c;for(;h--;){var l=a[h];if(!(s?l in e:ue.call(e,l)))return!1}var f=o.get(t);if(f&&o.get(e))return f==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<c;){l=a[h];var v=t[l],y=e[l];if(r)var m=s?r(y,v,l,e,t,o):r(v,y,l,t,e,o);if(!(m===V?v===y||i(v,y,n,r,o):m)){d=!1;break}g||(g="constructor"==l)}if(d&&!g){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o)}(t,e,n,r,Vi,i))}function oi(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=ee(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var c=(a=n[i])[0],u=t[c],h=a[1];if(s&&a[2]){if(u===V&&!(c in t))return!1}else{var l=new wr;if(r)var f=r(u,h,c,t,e,l);if(!(f===V?Vi(h,u,p|g,r,l):f))return!1}}return!0}function si(t){return!(!Ts(t)||(e=t,le&&le in e))&&(Ss(t)?ge:Gt).test(uo(t));var e}function ai(t){return"function"==typeof t?t:null==t?Ma:"object"==typeof t?vs(t)?di(t[0],t[1]):fi(t):Ua(t)}function ci(t){if(!XV(t))return qn(t);var e=[];for(var n in ee(t))ue.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ui(t){if(!Ts(t))return function(t){var e=[];if(null!=t)for(var n in ee(t))e.push(n);return e}(t);var e=XV(t),n=[];for(var r in t)("constructor"!=r||!e&&ue.call(t,r))&&n.push(r);return n}function hi(t,e){return t<e}function li(t,e){var n=-1,i=ms(t)?r(t.length):[];return Ur(t,function(t,r,V){i[++n]=e(t,r,V)}),i}function fi(t){var e=jV(t);return 1==e.length&&e[0][2]?KV(e[0][0],e[0][1]):function(n){return n===t||oi(n,t,e)}}function di(t,e){return YV(t)&&ZV(e)?KV(co(t),e):function(n){var r=Js(n,t);return r===V&&r===e?ta(n,t):Vi(e,r,p|g)}}function pi(t,e,n,r,i){t!==e&&Hr(e,function(o,s){if(i||(i=new wr),Ts(o))!function(t,e,n,r,i,o,s){var a=eo(t,n),c=eo(e,n),u=s.get(c);if(u)return void Tr(t,n,u);var h=o?o(a,c,n+"",t,e,s):V,l=h===V;if(l){var f=vs(c),d=!f&&_s(c),p=!f&&!d&&Ns(c);h=c,f||d||p?vs(a)?h=a:bs(a)?h=nV(a):d?(l=!1,h=Xi(c,!0)):p?(l=!1,h=Ki(c,!0)):h=[]:Os(c)||gs(c)?(h=a,gs(a)?h=qs(a):Ts(a)&&!Ss(a)||(h=zV(c))):l=!1}l&&(s.set(c,h),i(h,c,r,o,s),s.delete(c));Tr(t,n,h)}(t,e,s,n,pi,r,i);else{var a=r?r(eo(t,s),o,s+"",t,e,i):V;a===V&&(a=o),Tr(t,s,a)}},Va)}function gi(t,e){var n=t.length;if(n)return HV(e+=e<0?n:0,n)?t[e]:V}function vi(t,e,n){var r=-1;return e=Je(e.length?e:[Ma],vn(IV())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(li(t,function(t,n,i){return{criteria:Je(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){var r=-1,i=t.criteria,V=e.criteria,o=i.length,s=n.length;for(;++r<o;){var a=Ji(i[r],V[r]);if(a){if(r>=s)return a;var c=n[r];return a*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,V={};++r<i;){var o=e[r],s=Xr(t,o);n(s,o)&&Ci(V,Gi(o,t),s)}return V}function mi(t,e,n,r){var i=r?cn:an,V=-1,o=e.length,s=t;for(t===e&&(e=nV(e)),n&&(s=Je(t,vn(n)));++V<o;)for(var a=0,c=e[V],u=n?n(c):c;(a=i(s,u,a,r))>-1;)s!==t&&Ie.call(s,a,1),Ie.call(t,a,1);return t}function bi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==V){var V=i;HV(i)?Ie.call(t,i,1):Li(t,i)}}return t}function _i(t,e){return t+Un(Qn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>D)return n;do{e%2&&(n+=t),(e=Un(e/2))&&(t+=t)}while(e);return n}function Ai(t,e){return io(JV(t,e,Ma),t+"")}function Si(t){return Sr(fa(t))}function xi(t,e){var n=fa(t);return so(n,Dr(e,0,n.length))}function Ci(t,e,n,r){if(!Ts(t))return t;for(var i=-1,o=(e=Gi(e,t)).length,s=o-1,a=t;null!=a&&++i<o;){var c=co(e[i]),u=n;if(i!=s){var h=a[c];(u=r?r(h,c,a):V)===V&&(u=Ts(h)?h:HV(e[i+1])?[]:{})}Er(a,c,u),a=a[c]}return t}var Ti=rr?function(t,e){return rr.set(t,e),t}:Ma,Ei=fn?function(t,e){return fn(t,"toString",{configurable:!0,enumerable:!1,value:Ta(e),writable:!0})}:Ma;function Ri(t){return so(fa(t))}function Mi(t,e,n){var i=-1,V=t.length;e<0&&(e=-e>V?0:V+e),(n=n>V?V:n)<0&&(n+=V),V=e>n?0:n-e>>>0,e>>>=0;for(var o=r(V);++i<V;)o[i]=t[i+e];return o}function Oi(t,e){var n;return Ur(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function Pi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=U){for(;r<i;){var V=r+i>>>1,o=t[V];null!==o&&!Is(o)&&(n?o<=e:o<e)?r=V+1:i=V}return i}return ki(t,e,Ma,n)}function ki(t,e,n,r){e=n(e);for(var i=0,o=null==t?0:t.length,s=e!=e,a=null===e,c=Is(e),u=e===V;i<o;){var h=Un((i+o)/2),l=n(t[h]),f=l!==V,d=null===l,p=l==l,g=Is(l);if(s)var v=r||p;else v=u?p&&(r||f):a?p&&f&&(r||!d):c?p&&f&&!d&&(r||!g):!d&&!g&&(r?l<=e:l<e);v?i=h+1:o=h}return Gn(o,L)}function Di(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n],s=e?e(o):o;if(!n||!fs(s,a)){var a=s;V[i++]=0===o?0:o}}return V}function Ii(t){return"number"==typeof t?t:Is(t)?N:+t}function Ni(t){if("string"==typeof t)return t;if(vs(t))return Je(t,Ni)+"";if(Is(t))return lr?lr.call(t):"";var e=t+"";return"0"==e&&1/t==-k?"-0":e}function ji(t,e,n){var r=-1,i=Ze,V=t.length,s=!0,a=[],c=a;if(n)s=!1,i=Ke;else if(V>=o){var u=e?null:wV(t);if(u)return Rn(u);s=!1,i=mn,c=new _r}else c=e?[]:a;t:for(;++r<V;){var h=t[r],l=e?e(h):h;if(h=n||0!==h?h:0,s&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),a.push(h)}else i(c,l,n)||(c!==a&&c.push(l),a.push(h))}return a}function Li(t,e){return null==(t=to(t,e=Gi(e,t)))||delete t[co(Ao(e))]}function Ui(t,e,n,r){return Ci(t,e,n(Xr(t,e)),r)}function Fi(t,e,n,r){for(var i=t.length,V=r?i:-1;(r?V--:++V<i)&&e(t[V],V,t););return n?Mi(t,r?0:V,r?V+1:i):Mi(t,r?V+1:0,r?i:V)}function Bi(t,e){var n=t;return n instanceof vr&&(n=n.value()),en(e,function(t,e){return e.func.apply(e.thisArg,tn([t],e.args))},n)}function Wi(t,e,n){var i=t.length;if(i<2)return i?ji(t[0]):[];for(var V=-1,o=r(i);++V<i;)for(var s=t[V],a=-1;++a<i;)a!=V&&(o[V]=Lr(o[V]||s,t[a],e,n));return ji(qr(o,1),e,n)}function zi(t,e,n){for(var r=-1,i=t.length,o=e.length,s={};++r<i;){var a=r<o?e[r]:V;n(s,t[r],a)}return s}function qi(t){return bs(t)?t:[]}function Hi(t){return"function"==typeof t?t:Ma}function Gi(t,e){return vs(t)?t:YV(t,e)?[t]:ao(Hs(t))}var Yi=Ai;function $i(t,e,n){var r=t.length;return n=n===V?r:n,!e&&n>=r?t:Mi(t,e,n)}var Qi=In||function(t){return ke.clearTimeout(t)};function Xi(t,e){if(e)return t.slice();var n=t.length,r=Ee?Ee(n):new t.constructor(n);return t.copy(r),r}function Zi(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Ki(t,e){var n=e?Zi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ji(t,e){if(t!==e){var n=t!==V,r=null===t,i=t==t,o=Is(t),s=e!==V,a=null===e,c=e==e,u=Is(e);if(!a&&!u&&!o&&t>e||o&&s&&c&&!a&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!c)return-1}return 0}function tV(t,e,n,i){for(var V=-1,o=t.length,s=n.length,a=-1,c=e.length,u=Hn(o-s,0),h=r(c+u),l=!i;++a<c;)h[a]=e[a];for(;++V<s;)(l||V<o)&&(h[n[V]]=t[V]);for(;u--;)h[a++]=t[V++];return h}function eV(t,e,n,i){for(var V=-1,o=t.length,s=-1,a=n.length,c=-1,u=e.length,h=Hn(o-a,0),l=r(h+u),f=!i;++V<h;)l[V]=t[V];for(var d=V;++c<u;)l[d+c]=e[c];for(;++s<a;)(f||V<o)&&(l[d+n[s]]=t[V++]);return l}function nV(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function rV(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=r?r(n[a],t[a],a,n,t):V;c===V&&(c=t[a]),i?Pr(n,a,c):Er(n,a,c)}return n}function iV(t,e){return function(n,r){var i=vs(n)?Ge:Mr,V=e?e():{};return i(n,t,IV(r,2),V)}}function VV(t){return Ai(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:V,s=i>2?n[2]:V;for(o=t.length>3&&"function"==typeof o?(i--,o):V,s&&GV(n[0],n[1],s)&&(o=i<3?V:o,i=1),e=ee(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e})}function oV(t,e){return function(n,r){if(null==n)return n;if(!ms(n))return t(n,r);for(var i=n.length,V=e?i:-1,o=ee(n);(e?V--:++V<i)&&!1!==r(o[V],V,o););return n}}function sV(t){return function(e,n,r){for(var i=-1,V=ee(e),o=r(e),s=o.length;s--;){var a=o[t?s:++i];if(!1===n(V[a],a,V))break}return e}}function aV(t){return function(e){var n=xn(e=Hs(e))?Pn(e):V,r=n?n[0]:e.charAt(0),i=n?$i(n,1).join(""):e.slice(1);return r[t]()+i}}function cV(t){return function(e){return en(Sa(ga(e).replace(ye,"")),t,"")}}function uV(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=dr(t.prototype),r=t.apply(n,e);return Ts(r)?r:n}}function hV(t){return function(e,n,r){var i=ee(e);if(!ms(e)){var o=IV(n,3);e=ia(e),n=function(t){return o(i[t],t,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:V}}function lV(t){return RV(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new ie(a);if(i&&!s&&"wrapper"==kV(o))var s=new gr([],!0)}for(r=s?r:n;++r<n;){var c=kV(o=e[r]),u="wrapper"==c?PV(o):V;s=u&&$V(u[0])&&u[1]==(S|b|w|x)&&!u[4].length&&1==u[9]?s[kV(u[0])].apply(s,u[3]):1==o.length&&$V(o)?s[c]():s.thru(o)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&vs(r))return s.plant(r).value();for(var i=0,V=n?e[i].apply(this,t):r;++i<n;)V=e[i].call(this,V);return V}})}function fV(t,e,n,i,o,s,a,c,u,h){var l=e&S,f=e&v,d=e&y,p=e&(b|_),g=e&C,m=d?V:uV(t);return function v(){for(var y=arguments.length,b=r(y),_=y;_--;)b[_]=arguments[_];if(p)var w=DV(v),A=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,w);if(i&&(b=tV(b,i,o,p)),s&&(b=eV(b,s,a,p)),y-=A,p&&y<h){var S=En(b,w);return bV(t,e,fV,v.placeholder,n,b,S,c,u,h-y)}var x=f?n:this,C=d?x[t]:t;return y=b.length,c?b=function(t,e){var n=t.length,r=Gn(e.length,n),i=nV(t);for(;r--;){var o=e[r];t[r]=HV(o,n)?i[o]:V}return t}(b,c):g&&y>1&&b.reverse(),l&&u<y&&(b.length=u),this&&this!==ke&&this instanceof v&&(C=m||uV(C)),C.apply(x,b)}}function dV(t,e){return function(n,r){return function(t,e,n,r){return Yr(t,function(t,i,V){e(r,n(t),i,V)}),r}(n,t,e(r),{})}}function pV(t,e){return function(n,r){var i;if(n===V&&r===V)return e;if(n!==V&&(i=n),r!==V){if(i===V)return r;"string"==typeof n||"string"==typeof r?(n=Ni(n),r=Ni(r)):(n=Ii(n),r=Ii(r)),i=t(n,r)}return i}}function gV(t){return RV(function(e){return e=Je(e,vn(IV())),Ai(function(n){var r=this;return t(e,function(t){return He(t,r,n)})})})}function vV(t,e){var n=(e=e===V?" ":Ni(e)).length;if(n<2)return n?wi(e,t):e;var r=wi(e,Ln(t/On(e)));return xn(e)?$i(Pn(r),0,t).join(""):r.slice(0,t)}function yV(t){return function(e,n,i){return i&&"number"!=typeof i&&GV(e,n,i)&&(n=i=V),e=Fs(e),n===V?(n=e,e=0):n=Fs(n),function(t,e,n,i){for(var V=-1,o=Hn(Ln((e-t)/(n||1)),0),s=r(o);o--;)s[i?o:++V]=t,t+=n;return s}(e,n,i=i===V?e<n?1:-1:Fs(i),t)}}function mV(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=zs(e),n=zs(n)),t(e,n)}}function bV(t,e,n,r,i,o,s,a,c,u){var h=e&b;e|=h?w:A,(e&=~(h?A:w))&m||(e&=~(v|y));var l=[t,e,i,h?o:V,h?s:V,h?V:o,h?V:s,a,c,u],f=n.apply(V,l);return $V(t)&&no(f,l),f.placeholder=r,Vo(f,t,e)}function _V(t){var e=te[t];return function(t,n){if(t=zs(t),(n=null==n?0:Gn(Bs(n),292))&&Wn(t)){var r=(Hs(t)+"e").split("e");return+((r=(Hs(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var wV=tr&&1/Rn(new tr([,-0]))[1]==k?function(t){return new tr(t)}:Ia;function AV(t){return function(e){var n=BV(e);return n==X?Cn(e):n==nt?Mn(e):function(t,e){return Je(e,function(e){return[e,t[e]]})}(e,t(e))}}function SV(t,e,n,i,o,s,c,u){var l=e&y;if(!l&&"function"!=typeof t)throw new ie(a);var f=i?i.length:0;if(f||(e&=~(w|A),i=o=V),c=c===V?c:Hn(Bs(c),0),u=u===V?u:Bs(u),f-=o?o.length:0,e&A){var d=i,p=o;i=o=V}var g=l?V:PV(t),C=[t,e,n,i,o,d,p,s,c,u];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,V=i<(v|y|S),o=r==S&&n==b||r==S&&n==x&&t[7].length<=e[8]||r==(S|x)&&e[7].length<=e[8]&&n==b;if(!V&&!o)return t;r&v&&(t[2]=e[2],i|=n&v?0:m);var s=e[3];if(s){var a=t[3];t[3]=a?tV(a,s,e[4]):s,t[4]=a?En(t[3],h):e[4]}(s=e[5])&&(a=t[5],t[5]=a?eV(a,s,e[6]):s,t[6]=a?En(t[5],h):e[6]);(s=e[7])&&(t[7]=s);r&S&&(t[8]=null==t[8]?e[8]:Gn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(C,g),t=C[0],e=C[1],n=C[2],i=C[3],o=C[4],!(u=C[9]=C[9]===V?l?0:t.length:Hn(C[9]-f,0))&&e&(b|_)&&(e&=~(b|_)),e&&e!=v)T=e==b||e==_?function(t,e,n){var i=uV(t);return function o(){for(var s=arguments.length,a=r(s),c=s,u=DV(o);c--;)a[c]=arguments[c];var h=s<3&&a[0]!==u&&a[s-1]!==u?[]:En(a,u);return(s-=h.length)<n?bV(t,e,fV,o.placeholder,V,a,h,V,V,n-s):He(this&&this!==ke&&this instanceof o?i:t,this,a)}}(t,e,u):e!=w&&e!=(v|w)||o.length?fV.apply(V,C):function(t,e,n,i){var V=e&v,o=uV(t);return function e(){for(var s=-1,a=arguments.length,c=-1,u=i.length,h=r(u+a),l=this&&this!==ke&&this instanceof e?o:t;++c<u;)h[c]=i[c];for(;a--;)h[c++]=arguments[++s];return He(l,V?n:this,h)}}(t,e,n,i);else var T=function(t,e,n){var r=e&v,i=uV(t);return function e(){return(this&&this!==ke&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Vo((g?Ti:no)(T,C),t,e)}function xV(t,e,n,r){return t===V||fs(t,se[n])&&!ue.call(r,n)?e:t}function CV(t,e,n,r,i,o){return Ts(t)&&Ts(e)&&(o.set(e,t),pi(t,e,V,CV,o),o.delete(e)),t}function TV(t){return Os(t)?V:t}function EV(t,e,n,r,i,o){var s=n&p,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var h=-1,l=!0,f=n&g?new _r:V;for(o.set(t,e),o.set(e,t);++h<a;){var d=t[h],v=e[h];if(r)var y=s?r(v,d,h,e,t,o):r(d,v,h,t,e,o);if(y!==V){if(y)continue;l=!1;break}if(f){if(!rn(e,function(t,e){if(!mn(f,e)&&(d===t||i(d,t,n,r,o)))return f.push(e)})){l=!1;break}}else if(d!==v&&!i(d,v,n,r,o)){l=!1;break}}return o.delete(t),o.delete(e),l}function RV(t){return io(JV(t,V,yo),t+"")}function MV(t){return Zr(t,ia,UV)}function OV(t){return Zr(t,Va,FV)}var PV=rr?function(t){return rr.get(t)}:Ia;function kV(t){for(var e=t.name+"",n=ir[e],r=ue.call(ir,e)?n.length:0;r--;){var i=n[r],V=i.func;if(null==V||V==t)return i.name}return e}function DV(t){return(ue.call(fr,"placeholder")?fr:t).placeholder}function IV(){var t=fr.iteratee||Oa;return t=t===Oa?ai:t,arguments.length?t(arguments[0],arguments[1]):t}function NV(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function jV(t){for(var e=ia(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ZV(i)]}return e}function LV(t,e){var n=function(t,e){return null==t?V:t[e]}(t,e);return si(n)?n:V}var UV=Fn?function(t){return null==t?[]:(t=ee(t),Xe(Fn(t),function(e){return De.call(t,e)}))}:Wa,FV=Fn?function(t){for(var e=[];t;)tn(e,UV(t)),t=Oe(t);return e}:Wa,BV=Kr;function WV(t,e,n){for(var r=-1,i=(e=Gi(e,t)).length,V=!1;++r<i;){var o=co(e[r]);if(!(V=null!=t&&n(t,o)))break;t=t[o]}return V||++r!=i?V:!!(i=null==t?0:t.length)&&Cs(i)&&HV(o,i)&&(vs(t)||gs(t))}function zV(t){return"function"!=typeof t.constructor||XV(t)?{}:dr(Oe(t))}function qV(t){return vs(t)||gs(t)||!!(je&&t&&t[je])}function HV(t,e){var n=typeof t;return!!(e=null==e?D:e)&&("number"==n||"symbol"!=n&&$t.test(t))&&t>-1&&t%1==0&&t<e}function GV(t,e,n){if(!Ts(n))return!1;var r=typeof e;return!!("number"==r?ms(n)&&HV(e,n.length):"string"==r&&e in n)&&fs(n[e],t)}function YV(t,e){if(vs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Is(t))||(Mt.test(t)||!Rt.test(t)||null!=e&&t in ee(e))}function $V(t){var e=kV(t),n=fr[e];if("function"!=typeof n||!(e in vr.prototype))return!1;if(t===n)return!0;var r=PV(n);return!!r&&t===r[0]}(Zn&&BV(new Zn(new ArrayBuffer(1)))!=ct||Kn&&BV(new Kn)!=X||Jn&&"[object Promise]"!=BV(Jn.resolve())||tr&&BV(new tr)!=nt||er&&BV(new er)!=ot)&&(BV=function(t){var e=Kr(t),n=e==J?t.constructor:V,r=n?uo(n):"";if(r)switch(r){case Vr:return ct;case or:return X;case sr:return"[object Promise]";case ar:return nt;case cr:return ot}return e});var QV=ae?Ss:za;function XV(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||se)}function ZV(t){return t==t&&!Ts(t)}function KV(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==V||t in ee(n)))}}function JV(t,e,n){return e=Hn(e===V?t.length-1:e,0),function(){for(var i=arguments,V=-1,o=Hn(i.length-e,0),s=r(o);++V<o;)s[V]=i[e+V];V=-1;for(var a=r(e+1);++V<e;)a[V]=i[V];return a[e]=n(s),He(t,this,a)}}function to(t,e){return e.length<2?t:Xr(t,Mi(e,0,-1))}function eo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var no=oo(Ti),ro=jn||function(t,e){return ke.setTimeout(t,e)},io=oo(Ei);function Vo(t,e,n){var r=e+"";return io(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(jt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ye(F,function(n){var r="_."+n[0];e&n[1]&&!Ze(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Lt);return e?e[1].split(Ut):[]}(r),n)))}function oo(t){var e=0,n=0;return function(){var r=Yn(),i=M-(r-n);if(n=r,i>0){if(++e>=R)return arguments[0]}else e=0;return t.apply(V,arguments)}}function so(t,e){var n=-1,r=t.length,i=r-1;for(e=e===V?r:e;++n<e;){var o=_i(n,i),s=t[o];t[o]=t[n],t[n]=s}return t.length=e,t}var ao=function(t){var e=ss(t,function(t){return n.size===u&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ot,function(t,n,r,i){e.push(r?i.replace(Bt,"$1"):n||t)}),e});function co(t){if("string"==typeof t||Is(t))return t;var e=t+"";return"0"==e&&1/t==-k?"-0":e}function uo(t){if(null!=t){try{return ce.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ho(t){if(t instanceof vr)return t.clone();var e=new gr(t.__wrapped__,t.__chain__);return e.__actions__=nV(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var lo=Ai(function(t,e){return bs(t)?Lr(t,qr(e,1,bs,!0)):[]}),fo=Ai(function(t,e){var n=Ao(e);return bs(n)&&(n=V),bs(t)?Lr(t,qr(e,1,bs,!0),IV(n,2)):[]}),po=Ai(function(t,e){var n=Ao(e);return bs(n)&&(n=V),bs(t)?Lr(t,qr(e,1,bs,!0),V,n):[]});function go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Hn(r+i,0)),sn(t,IV(e,3),i)}function vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==V&&(i=Bs(n),i=n<0?Hn(r+i,0):Gn(i,r-1)),sn(t,IV(e,3),i,!0)}function yo(t){return(null==t?0:t.length)?qr(t,1):[]}function mo(t){return t&&t.length?t[0]:V}var bo=Ai(function(t){var e=Je(t,qi);return e.length&&e[0]===t[0]?ni(e):[]}),_o=Ai(function(t){var e=Ao(t),n=Je(t,qi);return e===Ao(n)?e=V:n.pop(),n.length&&n[0]===t[0]?ni(n,IV(e,2)):[]}),wo=Ai(function(t){var e=Ao(t),n=Je(t,qi);return(e="function"==typeof e?e:V)&&n.pop(),n.length&&n[0]===t[0]?ni(n,V,e):[]});function Ao(t){var e=null==t?0:t.length;return e?t[e-1]:V}var So=Ai(xo);function xo(t,e){return t&&t.length&&e&&e.length?mi(t,e):t}var Co=RV(function(t,e){var n=null==t?0:t.length,r=kr(t,e);return bi(t,Je(e,function(t){return HV(t,n)?+t:t}).sort(Ji)),r});function To(t){return null==t?t:Xn.call(t)}var Eo=Ai(function(t){return ji(qr(t,1,bs,!0))}),Ro=Ai(function(t){var e=Ao(t);return bs(e)&&(e=V),ji(qr(t,1,bs,!0),IV(e,2))}),Mo=Ai(function(t){var e=Ao(t);return e="function"==typeof e?e:V,ji(qr(t,1,bs,!0),V,e)});function Oo(t){if(!t||!t.length)return[];var e=0;return t=Xe(t,function(t){if(bs(t))return e=Hn(t.length,e),!0}),gn(e,function(e){return Je(t,ln(e))})}function Po(t,e){if(!t||!t.length)return[];var n=Oo(t);return null==e?n:Je(n,function(t){return He(e,V,t)})}var ko=Ai(function(t,e){return bs(t)?Lr(t,e):[]}),Do=Ai(function(t){return Wi(Xe(t,bs))}),Io=Ai(function(t){var e=Ao(t);return bs(e)&&(e=V),Wi(Xe(t,bs),IV(e,2))}),No=Ai(function(t){var e=Ao(t);return e="function"==typeof e?e:V,Wi(Xe(t,bs),V,e)}),jo=Ai(Oo);var Lo=Ai(function(t){var e=t.length,n=e>1?t[e-1]:V;return n="function"==typeof n?(t.pop(),n):V,Po(t,n)});function Uo(t){var e=fr(t);return e.__chain__=!0,e}function Fo(t,e){return e(t)}var Bo=RV(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return kr(e,t)};return!(e>1||this.__actions__.length)&&r instanceof vr&&HV(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Fo,args:[i],thisArg:V}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(V),t})):this.thru(i)});var Wo=iV(function(t,e,n){ue.call(t,n)?++t[n]:Pr(t,n,1)});var zo=hV(go),qo=hV(vo);function Ho(t,e){return(vs(t)?Ye:Ur)(t,IV(e,3))}function Go(t,e){return(vs(t)?$e:Fr)(t,IV(e,3))}var Yo=iV(function(t,e,n){ue.call(t,n)?t[n].push(e):Pr(t,n,[e])});var $o=Ai(function(t,e,n){var i=-1,V="function"==typeof e,o=ms(t)?r(t.length):[];return Ur(t,function(t){o[++i]=V?He(e,t,n):ri(t,e,n)}),o}),Qo=iV(function(t,e,n){Pr(t,n,e)});function Xo(t,e){return(vs(t)?Je:li)(t,IV(e,3))}var Zo=iV(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Ko=Ai(function(t,e){if(null==t)return[];var n=e.length;return n>1&&GV(t,e[0],e[1])?e=[]:n>2&&GV(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,qr(e,1),[])}),Jo=Nn||function(){return ke.Date.now()};function ts(t,e,n){return e=n?V:e,e=t&&null==e?t.length:e,SV(t,S,V,V,V,V,e)}function es(t,e){var n;if("function"!=typeof e)throw new ie(a);return t=Bs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=V),n}}var ns=Ai(function(t,e,n){var r=v;if(n.length){var i=En(n,DV(ns));r|=w}return SV(t,r,e,n,i)}),rs=Ai(function(t,e,n){var r=v|y;if(n.length){var i=En(n,DV(rs));r|=w}return SV(e,r,t,n,i)});function is(t,e,n){var r,i,o,s,c,u,h=0,l=!1,f=!1,d=!0;if("function"!=typeof t)throw new ie(a);function p(e){var n=r,o=i;return r=i=V,h=e,s=t.apply(o,n)}function g(t){var n=t-u;return u===V||n>=e||n<0||f&&t-h>=o}function v(){var t=Jo();if(g(t))return y(t);c=ro(v,function(t){var n=e-(t-u);return f?Gn(n,o-(t-h)):n}(t))}function y(t){return c=V,d&&r?p(t):(r=i=V,s)}function m(){var t=Jo(),n=g(t);if(r=arguments,i=this,u=t,n){if(c===V)return function(t){return h=t,c=ro(v,e),l?p(t):s}(u);if(f)return Qi(c),c=ro(v,e),p(u)}return c===V&&(c=ro(v,e)),s}return e=zs(e)||0,Ts(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Hn(zs(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),m.cancel=function(){c!==V&&Qi(c),h=0,r=u=i=c=V},m.flush=function(){return c===V?s:y(Jo())},m}var Vs=Ai(function(t,e){return jr(t,1,e)}),os=Ai(function(t,e,n){return jr(t,zs(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],V=n.cache;if(V.has(i))return V.get(i);var o=t.apply(this,r);return n.cache=V.set(i,o)||V,o};return n.cache=new(ss.Cache||br),n}function as(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=br;var cs=Yi(function(t,e){var n=(e=1==e.length&&vs(e[0])?Je(e[0],vn(IV())):Je(qr(e,1),vn(IV()))).length;return Ai(function(r){for(var i=-1,V=Gn(r.length,n);++i<V;)r[i]=e[i].call(this,r[i]);return He(t,this,r)})}),us=Ai(function(t,e){var n=En(e,DV(us));return SV(t,w,V,e,n)}),hs=Ai(function(t,e){var n=En(e,DV(hs));return SV(t,A,V,e,n)}),ls=RV(function(t,e){return SV(t,x,V,V,V,e)});function fs(t,e){return t===e||t!=t&&e!=e}var ds=mV(Jr),ps=mV(function(t,e){return t>=e}),gs=ii(function(){return arguments}())?ii:function(t){return Es(t)&&ue.call(t,"callee")&&!De.call(t,"callee")},vs=r.isArray,ys=Ue?vn(Ue):function(t){return Es(t)&&Kr(t)==at};function ms(t){return null!=t&&Cs(t.length)&&!Ss(t)}function bs(t){return Es(t)&&ms(t)}var _s=Bn||za,ws=Fe?vn(Fe):function(t){return Es(t)&&Kr(t)==H};function As(t){if(!Es(t))return!1;var e=Kr(t);return e==Y||e==G||"string"==typeof t.message&&"string"==typeof t.name&&!Os(t)}function Ss(t){if(!Ts(t))return!1;var e=Kr(t);return e==$||e==Q||e==z||e==tt}function xs(t){return"number"==typeof t&&t==Bs(t)}function Cs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Ts(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Es(t){return null!=t&&"object"==typeof t}var Rs=Be?vn(Be):function(t){return Es(t)&&BV(t)==X};function Ms(t){return"number"==typeof t||Es(t)&&Kr(t)==Z}function Os(t){if(!Es(t)||Kr(t)!=J)return!1;var e=Oe(t);if(null===e)return!0;var n=ue.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ce.call(n)==de}var Ps=We?vn(We):function(t){return Es(t)&&Kr(t)==et};var ks=ze?vn(ze):function(t){return Es(t)&&BV(t)==nt};function Ds(t){return"string"==typeof t||!vs(t)&&Es(t)&&Kr(t)==rt}function Is(t){return"symbol"==typeof t||Es(t)&&Kr(t)==it}var Ns=qe?vn(qe):function(t){return Es(t)&&Cs(t.length)&&!!Ce[Kr(t)]};var js=mV(hi),Ls=mV(function(t,e){return t<=e});function Us(t){if(!t)return[];if(ms(t))return Ds(t)?Pn(t):nV(t);if(Le&&t[Le])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Le]());var e=BV(t);return(e==X?Cn:e==nt?Rn:fa)(t)}function Fs(t){return t?(t=zs(t))===k||t===-k?(t<0?-1:1)*I:t==t?t:0:0===t?t:0}function Bs(t){var e=Fs(t),n=e%1;return e==e?n?e-n:e:0}function Ws(t){return t?Dr(Bs(t),0,j):0}function zs(t){if("number"==typeof t)return t;if(Is(t))return N;if(Ts(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ts(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var n=Ht.test(t);return n||Yt.test(t)?Me(t.slice(2),n?2:8):qt.test(t)?N:+t}function qs(t){return rV(t,Va(t))}function Hs(t){return null==t?"":Ni(t)}var Gs=VV(function(t,e){if(XV(e)||ms(e))rV(e,ia(e),t);else for(var n in e)ue.call(e,n)&&Er(t,n,e[n])}),Ys=VV(function(t,e){rV(e,Va(e),t)}),$s=VV(function(t,e,n,r){rV(e,Va(e),t,r)}),Qs=VV(function(t,e,n,r){rV(e,ia(e),t,r)}),Xs=RV(kr);var Zs=Ai(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:V;for(i&&GV(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=Va(o),a=-1,c=s.length;++a<c;){var u=s[a],h=t[u];(h===V||fs(h,se[u])&&!ue.call(t,u))&&(t[u]=o[u])}return t}),Ks=Ai(function(t){return t.push(V,CV),He(sa,V,t)});function Js(t,e,n){var r=null==t?V:Xr(t,e);return r===V?n:r}function ta(t,e){return null!=t&&WV(t,e,ei)}var ea=dV(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),t[e]=n},Ta(Ma)),na=dV(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),ue.call(t,e)?t[e].push(n):t[e]=[n]},IV),ra=Ai(ri);function ia(t){return ms(t)?Ar(t):ci(t)}function Va(t){return ms(t)?Ar(t,!0):ui(t)}var oa=VV(function(t,e,n){pi(t,e,n)}),sa=VV(function(t,e,n,r){pi(t,e,n,r)}),aa=RV(function(t,e){var n={};if(null==t)return n;var r=!1;e=Je(e,function(e){return e=Gi(e,t),r||(r=e.length>1),e}),rV(t,OV(t),n),r&&(n=Ir(n,l|f|d,TV));for(var i=e.length;i--;)Li(n,e[i]);return n});var ca=RV(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return ta(t,n)})}(t,e)});function ua(t,e){if(null==t)return{};var n=Je(OV(t),function(t){return[t]});return e=IV(e),yi(t,n,function(t,n){return e(t,n[0])})}var ha=AV(ia),la=AV(Va);function fa(t){return null==t?[]:yn(t,ia(t))}var da=cV(function(t,e,n){return e=e.toLowerCase(),t+(n?pa(e):e)});function pa(t){return Aa(Hs(t).toLowerCase())}function ga(t){return(t=Hs(t))&&t.replace(Qt,wn).replace(me,"")}var va=cV(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),ya=cV(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),ma=aV("toLowerCase");var ba=cV(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var _a=cV(function(t,e,n){return t+(n?" ":"")+Aa(e)});var wa=cV(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Aa=aV("toUpperCase");function Sa(t,e,n){return t=Hs(t),(e=n?V:e)===V?function(t){return Ae.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(Ft)||[]}(t):t.match(e)||[]}var xa=Ai(function(t,e){try{return He(t,V,e)}catch(t){return As(t)?t:new Kt(t)}}),Ca=RV(function(t,e){return Ye(e,function(e){e=co(e),Pr(t,e,ns(t[e],t))}),t});function Ta(t){return function(){return t}}var Ea=lV(),Ra=lV(!0);function Ma(t){return t}function Oa(t){return ai("function"==typeof t?t:Ir(t,l))}var Pa=Ai(function(t,e){return function(n){return ri(n,t,e)}}),ka=Ai(function(t,e){return function(n){return ri(t,n,e)}});function Da(t,e,n){var r=ia(e),i=Qr(e,r);null!=n||Ts(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Qr(e,ia(e)));var V=!(Ts(n)&&"chain"in n&&!n.chain),o=Ss(t);return Ye(i,function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(V||e){var n=t(this.__wrapped__),i=n.__actions__=nV(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Ia(){}var Na=gV(Je),ja=gV(Qe),La=gV(rn);function Ua(t){return YV(t)?ln(co(t)):function(t){return function(e){return Xr(e,t)}}(t)}var Fa=yV(),Ba=yV(!0);function Wa(){return[]}function za(){return!1}var qa=pV(function(t,e){return t+e},0),Ha=_V("ceil"),Ga=pV(function(t,e){return t/e},1),Ya=_V("floor");var $a,Qa=pV(function(t,e){return t*e},1),Xa=_V("round"),Za=pV(function(t,e){return t-e},0);return fr.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=Bs(t),function(){if(--t<1)return e.apply(this,arguments)}},fr.ary=ts,fr.assign=Gs,fr.assignIn=Ys,fr.assignInWith=$s,fr.assignWith=Qs,fr.at=Xs,fr.before=es,fr.bind=ns,fr.bindAll=Ca,fr.bindKey=rs,fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},fr.chain=Uo,fr.chunk=function(t,e,n){e=(n?GV(t,e,n):e===V)?1:Hn(Bs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=r(Ln(i/e));o<i;)a[s++]=Mi(t,o,o+=e);return a},fr.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var V=t[e];V&&(i[r++]=V)}return i},fr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return tn(vs(n)?nV(n):[n],qr(e,1))},fr.cond=function(t){var e=null==t?0:t.length,n=IV();return t=e?Je(t,function(t){if("function"!=typeof t[1])throw new ie(a);return[n(t[0]),t[1]]}):[],Ai(function(n){for(var r=-1;++r<e;){var i=t[r];if(He(i[0],this,n))return He(i[1],this,n)}})},fr.conforms=function(t){return function(t){var e=ia(t);return function(n){return Nr(n,t,e)}}(Ir(t,l))},fr.constant=Ta,fr.countBy=Wo,fr.create=function(t,e){var n=dr(t);return null==e?n:Or(n,e)},fr.curry=function t(e,n,r){var i=SV(e,b,V,V,V,V,V,n=r?V:n);return i.placeholder=t.placeholder,i},fr.curryRight=function t(e,n,r){var i=SV(e,_,V,V,V,V,V,n=r?V:n);return i.placeholder=t.placeholder,i},fr.debounce=is,fr.defaults=Zs,fr.defaultsDeep=Ks,fr.defer=Vs,fr.delay=os,fr.difference=lo,fr.differenceBy=fo,fr.differenceWith=po,fr.drop=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,(e=n||e===V?1:Bs(e))<0?0:e,r):[]},fr.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,0,(e=r-(e=n||e===V?1:Bs(e)))<0?0:e):[]},fr.dropRightWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!0,!0):[]},fr.dropWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!0):[]},fr.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&GV(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=Bs(n))<0&&(n=-n>i?0:i+n),(r=r===V||r>i?i:Bs(r))<0&&(r+=i),r=n>r?0:Ws(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},fr.filter=function(t,e){return(vs(t)?Xe:zr)(t,IV(e,3))},fr.flatMap=function(t,e){return qr(Xo(t,e),1)},fr.flatMapDeep=function(t,e){return qr(Xo(t,e),k)},fr.flatMapDepth=function(t,e,n){return n=n===V?1:Bs(n),qr(Xo(t,e),n)},fr.flatten=yo,fr.flattenDeep=function(t){return(null==t?0:t.length)?qr(t,k):[]},fr.flattenDepth=function(t,e){return(null==t?0:t.length)?qr(t,e=e===V?1:Bs(e)):[]},fr.flip=function(t){return SV(t,C)},fr.flow=Ea,fr.flowRight=Ra,fr.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},fr.functions=function(t){return null==t?[]:Qr(t,ia(t))},fr.functionsIn=function(t){return null==t?[]:Qr(t,Va(t))},fr.groupBy=Yo,fr.initial=function(t){return(null==t?0:t.length)?Mi(t,0,-1):[]},fr.intersection=bo,fr.intersectionBy=_o,fr.intersectionWith=wo,fr.invert=ea,fr.invertBy=na,fr.invokeMap=$o,fr.iteratee=Oa,fr.keyBy=Qo,fr.keys=ia,fr.keysIn=Va,fr.map=Xo,fr.mapKeys=function(t,e){var n={};return e=IV(e,3),Yr(t,function(t,r,i){Pr(n,e(t,r,i),t)}),n},fr.mapValues=function(t,e){var n={};return e=IV(e,3),Yr(t,function(t,r,i){Pr(n,r,e(t,r,i))}),n},fr.matches=function(t){return fi(Ir(t,l))},fr.matchesProperty=function(t,e){return di(t,Ir(e,l))},fr.memoize=ss,fr.merge=oa,fr.mergeWith=sa,fr.method=Pa,fr.methodOf=ka,fr.mixin=Da,fr.negate=as,fr.nthArg=function(t){return t=Bs(t),Ai(function(e){return gi(e,t)})},fr.omit=aa,fr.omitBy=function(t,e){return ua(t,as(IV(e)))},fr.once=function(t){return es(2,t)},fr.orderBy=function(t,e,n,r){return null==t?[]:(vs(e)||(e=null==e?[]:[e]),vs(n=r?V:n)||(n=null==n?[]:[n]),vi(t,e,n))},fr.over=Na,fr.overArgs=cs,fr.overEvery=ja,fr.overSome=La,fr.partial=us,fr.partialRight=hs,fr.partition=Zo,fr.pick=ca,fr.pickBy=ua,fr.property=Ua,fr.propertyOf=function(t){return function(e){return null==t?V:Xr(t,e)}},fr.pull=So,fr.pullAll=xo,fr.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?mi(t,e,IV(n,2)):t},fr.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?mi(t,e,V,n):t},fr.pullAt=Co,fr.range=Fa,fr.rangeRight=Ba,fr.rearg=ls,fr.reject=function(t,e){return(vs(t)?Xe:zr)(t,as(IV(e,3)))},fr.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],V=t.length;for(e=IV(e,3);++r<V;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return bi(t,i),n},fr.rest=function(t,e){if("function"!=typeof t)throw new ie(a);return Ai(t,e=e===V?e:Bs(e))},fr.reverse=To,fr.sampleSize=function(t,e,n){return e=(n?GV(t,e,n):e===V)?1:Bs(e),(vs(t)?xr:xi)(t,e)},fr.set=function(t,e,n){return null==t?t:Ci(t,e,n)},fr.setWith=function(t,e,n,r){return r="function"==typeof r?r:V,null==t?t:Ci(t,e,n,r)},fr.shuffle=function(t){return(vs(t)?Cr:Ri)(t)},fr.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&GV(t,e,n)?(e=0,n=r):(e=null==e?0:Bs(e),n=n===V?r:Bs(n)),Mi(t,e,n)):[]},fr.sortBy=Ko,fr.sortedUniq=function(t){return t&&t.length?Di(t):[]},fr.sortedUniqBy=function(t,e){return t&&t.length?Di(t,IV(e,2)):[]},fr.split=function(t,e,n){return n&&"number"!=typeof n&&GV(t,e,n)&&(e=n=V),(n=n===V?j:n>>>0)?(t=Hs(t))&&("string"==typeof e||null!=e&&!Ps(e))&&!(e=Ni(e))&&xn(t)?$i(Pn(t),0,n):t.split(e,n):[]},fr.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Hn(Bs(e),0),Ai(function(n){var r=n[e],i=$i(n,0,e);return r&&tn(i,r),He(t,this,i)})},fr.tail=function(t){var e=null==t?0:t.length;return e?Mi(t,1,e):[]},fr.take=function(t,e,n){return t&&t.length?Mi(t,0,(e=n||e===V?1:Bs(e))<0?0:e):[]},fr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,(e=r-(e=n||e===V?1:Bs(e)))<0?0:e,r):[]},fr.takeRightWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!1,!0):[]},fr.takeWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3)):[]},fr.tap=function(t,e){return e(t),t},fr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(a);return Ts(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(t,e,{leading:r,maxWait:e,trailing:i})},fr.thru=Fo,fr.toArray=Us,fr.toPairs=ha,fr.toPairsIn=la,fr.toPath=function(t){return vs(t)?Je(t,co):Is(t)?[t]:nV(ao(Hs(t)))},fr.toPlainObject=qs,fr.transform=function(t,e,n){var r=vs(t),i=r||_s(t)||Ns(t);if(e=IV(e,4),null==n){var V=t&&t.constructor;n=i?r?new V:[]:Ts(t)&&Ss(V)?dr(Oe(t)):{}}return(i?Ye:Yr)(t,function(t,r,i){return e(n,t,r,i)}),n},fr.unary=function(t){return ts(t,1)},fr.union=Eo,fr.unionBy=Ro,fr.unionWith=Mo,fr.uniq=function(t){return t&&t.length?ji(t):[]},fr.uniqBy=function(t,e){return t&&t.length?ji(t,IV(e,2)):[]},fr.uniqWith=function(t,e){return e="function"==typeof e?e:V,t&&t.length?ji(t,V,e):[]},fr.unset=function(t,e){return null==t||Li(t,e)},fr.unzip=Oo,fr.unzipWith=Po,fr.update=function(t,e,n){return null==t?t:Ui(t,e,Hi(n))},fr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:V,null==t?t:Ui(t,e,Hi(n),r)},fr.values=fa,fr.valuesIn=function(t){return null==t?[]:yn(t,Va(t))},fr.without=ko,fr.words=Sa,fr.wrap=function(t,e){return us(Hi(e),t)},fr.xor=Do,fr.xorBy=Io,fr.xorWith=No,fr.zip=jo,fr.zipObject=function(t,e){return zi(t||[],e||[],Er)},fr.zipObjectDeep=function(t,e){return zi(t||[],e||[],Ci)},fr.zipWith=Lo,fr.entries=ha,fr.entriesIn=la,fr.extend=Ys,fr.extendWith=$s,Da(fr,fr),fr.add=qa,fr.attempt=xa,fr.camelCase=da,fr.capitalize=pa,fr.ceil=Ha,fr.clamp=function(t,e,n){return n===V&&(n=e,e=V),n!==V&&(n=(n=zs(n))==n?n:0),e!==V&&(e=(e=zs(e))==e?e:0),Dr(zs(t),e,n)},fr.clone=function(t){return Ir(t,d)},fr.cloneDeep=function(t){return Ir(t,l|d)},fr.cloneDeepWith=function(t,e){return Ir(t,l|d,e="function"==typeof e?e:V)},fr.cloneWith=function(t,e){return Ir(t,d,e="function"==typeof e?e:V)},fr.conformsTo=function(t,e){return null==e||Nr(t,e,ia(e))},fr.deburr=ga,fr.defaultTo=function(t,e){return null==t||t!=t?e:t},fr.divide=Ga,fr.endsWith=function(t,e,n){t=Hs(t),e=Ni(e);var r=t.length,i=n=n===V?r:Dr(Bs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},fr.eq=fs,fr.escape=function(t){return(t=Hs(t))&&xt.test(t)?t.replace(At,An):t},fr.escapeRegExp=function(t){return(t=Hs(t))&&kt.test(t)?t.replace(Pt,"\\$&"):t},fr.every=function(t,e,n){var r=vs(t)?Qe:Br;return n&&GV(t,e,n)&&(e=V),r(t,IV(e,3))},fr.find=zo,fr.findIndex=go,fr.findKey=function(t,e){return on(t,IV(e,3),Yr)},fr.findLast=qo,fr.findLastIndex=vo,fr.findLastKey=function(t,e){return on(t,IV(e,3),$r)},fr.floor=Ya,fr.forEach=Ho,fr.forEachRight=Go,fr.forIn=function(t,e){return null==t?t:Hr(t,IV(e,3),Va)},fr.forInRight=function(t,e){return null==t?t:Gr(t,IV(e,3),Va)},fr.forOwn=function(t,e){return t&&Yr(t,IV(e,3))},fr.forOwnRight=function(t,e){return t&&$r(t,IV(e,3))},fr.get=Js,fr.gt=ds,fr.gte=ps,fr.has=function(t,e){return null!=t&&WV(t,e,ti)},fr.hasIn=ta,fr.head=mo,fr.identity=Ma,fr.includes=function(t,e,n,r){t=ms(t)?t:fa(t),n=n&&!r?Bs(n):0;var i=t.length;return n<0&&(n=Hn(i+n,0)),Ds(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&an(t,e,n)>-1},fr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Hn(r+i,0)),an(t,e,i)},fr.inRange=function(t,e,n){return e=Fs(e),n===V?(n=e,e=0):n=Fs(n),function(t,e,n){return t>=Gn(e,n)&&t<Hn(e,n)}(t=zs(t),e,n)},fr.invoke=ra,fr.isArguments=gs,fr.isArray=vs,fr.isArrayBuffer=ys,fr.isArrayLike=ms,fr.isArrayLikeObject=bs,fr.isBoolean=function(t){return!0===t||!1===t||Es(t)&&Kr(t)==q},fr.isBuffer=_s,fr.isDate=ws,fr.isElement=function(t){return Es(t)&&1===t.nodeType&&!Os(t)},fr.isEmpty=function(t){if(null==t)return!0;if(ms(t)&&(vs(t)||"string"==typeof t||"function"==typeof t.splice||_s(t)||Ns(t)||gs(t)))return!t.length;var e=BV(t);if(e==X||e==nt)return!t.size;if(XV(t))return!ci(t).length;for(var n in t)if(ue.call(t,n))return!1;return!0},fr.isEqual=function(t,e){return Vi(t,e)},fr.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:V)?n(t,e):V;return r===V?Vi(t,e,V,n):!!r},fr.isError=As,fr.isFinite=function(t){return"number"==typeof t&&Wn(t)},fr.isFunction=Ss,fr.isInteger=xs,fr.isLength=Cs,fr.isMap=Rs,fr.isMatch=function(t,e){return t===e||oi(t,e,jV(e))},fr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:V,oi(t,e,jV(e),n)},fr.isNaN=function(t){return Ms(t)&&t!=+t},fr.isNative=function(t){if(QV(t))throw new Kt(s);return si(t)},fr.isNil=function(t){return null==t},fr.isNull=function(t){return null===t},fr.isNumber=Ms,fr.isObject=Ts,fr.isObjectLike=Es,fr.isPlainObject=Os,fr.isRegExp=Ps,fr.isSafeInteger=function(t){return xs(t)&&t>=-D&&t<=D},fr.isSet=ks,fr.isString=Ds,fr.isSymbol=Is,fr.isTypedArray=Ns,fr.isUndefined=function(t){return t===V},fr.isWeakMap=function(t){return Es(t)&&BV(t)==ot},fr.isWeakSet=function(t){return Es(t)&&Kr(t)==st},fr.join=function(t,e){return null==t?"":zn.call(t,e)},fr.kebabCase=va,fr.last=Ao,fr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==V&&(i=(i=Bs(n))<0?Hn(r+i,0):Gn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,un,i,!0)},fr.lowerCase=ya,fr.lowerFirst=ma,fr.lt=js,fr.lte=Ls,fr.max=function(t){return t&&t.length?Wr(t,Ma,Jr):V},fr.maxBy=function(t,e){return t&&t.length?Wr(t,IV(e,2),Jr):V},fr.mean=function(t){return hn(t,Ma)},fr.meanBy=function(t,e){return hn(t,IV(e,2))},fr.min=function(t){return t&&t.length?Wr(t,Ma,hi):V},fr.minBy=function(t,e){return t&&t.length?Wr(t,IV(e,2),hi):V},fr.stubArray=Wa,fr.stubFalse=za,fr.stubObject=function(){return{}},fr.stubString=function(){return""},fr.stubTrue=function(){return!0},fr.multiply=Qa,fr.nth=function(t,e){return t&&t.length?gi(t,Bs(e)):V},fr.noConflict=function(){return ke._===this&&(ke._=pe),this},fr.noop=Ia,fr.now=Jo,fr.pad=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return vV(Un(i),n)+t+vV(Ln(i),n)},fr.padEnd=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;return e&&r<e?t+vV(e-r,n):t},fr.padStart=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;return e&&r<e?vV(e-r,n)+t:t},fr.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),$n(Hs(t).replace(It,""),e||0)},fr.random=function(t,e,n){if(n&&"boolean"!=typeof n&&GV(t,e,n)&&(e=n=V),n===V&&("boolean"==typeof e?(n=e,e=V):"boolean"==typeof t&&(n=t,t=V)),t===V&&e===V?(t=0,e=1):(t=Fs(t),e===V?(e=t,t=0):e=Fs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Qn();return Gn(t+i*(e-t+Re("1e-"+((i+"").length-1))),e)}return _i(t,e)},fr.reduce=function(t,e,n){var r=vs(t)?en:dn,i=arguments.length<3;return r(t,IV(e,4),n,i,Ur)},fr.reduceRight=function(t,e,n){var r=vs(t)?nn:dn,i=arguments.length<3;return r(t,IV(e,4),n,i,Fr)},fr.repeat=function(t,e,n){return e=(n?GV(t,e,n):e===V)?1:Bs(e),wi(Hs(t),e)},fr.replace=function(){var t=arguments,e=Hs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},fr.result=function(t,e,n){var r=-1,i=(e=Gi(e,t)).length;for(i||(i=1,t=V);++r<i;){var o=null==t?V:t[co(e[r])];o===V&&(r=i,o=n),t=Ss(o)?o.call(t):o}return t},fr.round=Xa,fr.runInContext=t,fr.sample=function(t){return(vs(t)?Sr:Si)(t)},fr.size=function(t){if(null==t)return 0;if(ms(t))return Ds(t)?On(t):t.length;var e=BV(t);return e==X||e==nt?t.size:ci(t).length},fr.snakeCase=ba,fr.some=function(t,e,n){var r=vs(t)?rn:Oi;return n&&GV(t,e,n)&&(e=V),r(t,IV(e,3))},fr.sortedIndex=function(t,e){return Pi(t,e)},fr.sortedIndexBy=function(t,e,n){return ki(t,e,IV(n,2))},fr.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Pi(t,e);if(r<n&&fs(t[r],e))return r}return-1},fr.sortedLastIndex=function(t,e){return Pi(t,e,!0)},fr.sortedLastIndexBy=function(t,e,n){return ki(t,e,IV(n,2),!0)},fr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Pi(t,e,!0)-1;if(fs(t[n],e))return n}return-1},fr.startCase=_a,fr.startsWith=function(t,e,n){return t=Hs(t),n=null==n?0:Dr(Bs(n),0,t.length),e=Ni(e),t.slice(n,n+e.length)==e},fr.subtract=Za,fr.sum=function(t){return t&&t.length?pn(t,Ma):0},fr.sumBy=function(t,e){return t&&t.length?pn(t,IV(e,2)):0},fr.template=function(t,e,n){var r=fr.templateSettings;n&&GV(t,e,n)&&(e=V),t=Hs(t),e=$s({},e,r,xV);var i,o,s=$s({},e.imports,r.imports,xV),a=ia(s),c=yn(s,a),u=0,h=e.interpolate||Xt,l="__p += '",f=ne((e.escape||Xt).source+"|"+h.source+"|"+(h===Et?Wt:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),d="//# sourceURL="+(ue.call(e,"sourceURL")?(e.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++xe+"]")+"\n";t.replace(f,function(e,n,r,V,s,a){return r||(r=V),l+=t.slice(u,a).replace(Zt,Sn),n&&(i=!0,l+="' +\n__e("+n+") +\n'"),s&&(o=!0,l+="';\n"+s+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=a+e.length,e}),l+="';\n";var p=ue.call(e,"variable")&&e.variable;p||(l="with (obj) {\n"+l+"\n}\n"),l=(o?l.replace(mt,""):l).replace(bt,"$1").replace(_t,"$1;"),l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var g=xa(function(){return Jt(a,d+"return "+l).apply(V,c)});if(g.source=l,As(g))throw g;return g},fr.times=function(t,e){if((t=Bs(t))<1||t>D)return[];var n=j,r=Gn(t,j);e=IV(e),t-=j;for(var i=gn(r,e);++n<t;)e(n);return i},fr.toFinite=Fs,fr.toInteger=Bs,fr.toLength=Ws,fr.toLower=function(t){return Hs(t).toLowerCase()},fr.toNumber=zs,fr.toSafeInteger=function(t){return t?Dr(Bs(t),-D,D):0===t?t:0},fr.toString=Hs,fr.toUpper=function(t){return Hs(t).toUpperCase()},fr.trim=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(Dt,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t),i=Pn(e);return $i(r,bn(r,i),_n(r,i)+1).join("")},fr.trimEnd=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(Nt,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t);return $i(r,0,_n(r,Pn(e))+1).join("")},fr.trimStart=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(It,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t);return $i(r,bn(r,Pn(e))).join("")},fr.truncate=function(t,e){var n=T,r=E;if(Ts(e)){var i="separator"in e?e.separator:i;n="length"in e?Bs(e.length):n,r="omission"in e?Ni(e.omission):r}var o=(t=Hs(t)).length;if(xn(t)){var s=Pn(t);o=s.length}if(n>=o)return t;var a=n-On(r);if(a<1)return r;var c=s?$i(s,0,a).join(""):t.slice(0,a);if(i===V)return c+r;if(s&&(a+=c.length-a),Ps(i)){if(t.slice(a).search(i)){var u,h=c;for(i.global||(i=ne(i.source,Hs(zt.exec(i))+"g")),i.lastIndex=0;u=i.exec(h);)var l=u.index;c=c.slice(0,l===V?a:l)}}else if(t.indexOf(Ni(i),a)!=a){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},fr.unescape=function(t){return(t=Hs(t))&&St.test(t)?t.replace(wt,kn):t},fr.uniqueId=function(t){var e=++he;return Hs(t)+e},fr.upperCase=wa,fr.upperFirst=Aa,fr.each=Ho,fr.eachRight=Go,fr.first=mo,Da(fr,($a={},Yr(fr,function(t,e){ue.call(fr.prototype,e)||($a[e]=t)}),$a),{chain:!1}),fr.VERSION="4.17.15",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){fr[t].placeholder=fr}),Ye(["drop","take"],function(t,e){vr.prototype[t]=function(n){n=n===V?1:Hn(Bs(n),0);var r=this.__filtered__&&!e?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=Gn(n,r.__takeCount__):r.__views__.push({size:Gn(n,j),type:t+(r.__dir__<0?"Right":"")}),r},vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ye(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==O||3==n;vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:IV(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Ye(["head","last"],function(t,e){var n="take"+(e?"Right":"");vr.prototype[t]=function(){return this[n](1).value()[0]}}),Ye(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");vr.prototype[t]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Ma)},vr.prototype.find=function(t){return this.filter(t).head()},vr.prototype.findLast=function(t){return this.reverse().find(t)},vr.prototype.invokeMap=Ai(function(t,e){return"function"==typeof t?new vr(this):this.map(function(n){return ri(n,t,e)})}),vr.prototype.reject=function(t){return this.filter(as(IV(t)))},vr.prototype.slice=function(t,e){t=Bs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new vr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==V&&(n=(e=Bs(e))<0?n.dropRight(-e):n.take(e-t)),n)},vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vr.prototype.toArray=function(){return this.take(j)},Yr(vr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=fr[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(fr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,a=e instanceof vr,c=s[0],u=a||vs(e),h=function(t){var e=i.apply(fr,tn([t],s));return r&&l?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(a=u=!1);var l=this.__chain__,f=!!this.__actions__.length,d=o&&!l,p=a&&!f;if(!o&&u){e=p?e:new vr(this);var g=t.apply(e,s);return g.__actions__.push({func:Fo,args:[h],thisArg:V}),new gr(g,l)}return d&&p?t.apply(this,s):(g=this.thru(h),d?r?g.value()[0]:g.value():g)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=Ve[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);fr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[n](function(n){return e.apply(vs(n)?n:[],t)})}}),Yr(vr.prototype,function(t,e){var n=fr[e];if(n){var r=n.name+"";ue.call(ir,r)||(ir[r]=[]),ir[r].push({name:e,func:n})}}),ir[fV(V,y).name]=[{name:"wrapper",func:V}],vr.prototype.clone=function(){var t=new vr(this.__wrapped__);return t.__actions__=nV(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=nV(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=nV(this.__views__),t},vr.prototype.reverse=function(){if(this.__filtered__){var t=new vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=vs(t),r=e<0,i=n?t.length:0,V=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var V=n[r],o=V.size;switch(V.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=Gn(e,t+o);break;case"takeRight":t=Hn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=V.start,s=V.end,a=s-o,c=r?s:o-1,u=this.__iteratees__,h=u.length,l=0,f=Gn(a,this.__takeCount__);if(!n||!r&&i==a&&f==a)return Bi(t,this.__actions__);var d=[];t:for(;a--&&l<f;){for(var p=-1,g=t[c+=e];++p<h;){var v=u[p],y=v.iteratee,m=v.type,b=y(g);if(m==P)g=b;else if(!b){if(m==O)continue t;break t}}d[l++]=g}return d},fr.prototype.at=Bo,fr.prototype.chain=function(){return Uo(this)},fr.prototype.commit=function(){return new gr(this.value(),this.__chain__)},fr.prototype.next=function(){this.__values__===V&&(this.__values__=Us(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?V:this.__values__[this.__index__++]}},fr.prototype.plant=function(t){for(var e,n=this;n instanceof pr;){var r=ho(n);r.__index__=0,r.__values__=V,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},fr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vr){var e=t;return this.__actions__.length&&(e=new vr(this)),(e=e.reverse()).__actions__.push({func:Fo,args:[To],thisArg:V}),new gr(e,this.__chain__)}return this.thru(To)},fr.prototype.toJSON=fr.prototype.valueOf=fr.prototype.value=function(){return Bi(this.__wrapped__,this.__actions__)},fr.prototype.first=fr.prototype.head,Le&&(fr.prototype[Le]=function(){return this}),fr}();ke._=Dn,(i=function(){return Dn}.call(e,n,e,r))===V||(r.exports=i)}).call(this)}).call(this,n(33),n(140)(t))},function(t,e,n){"use strict";n.d(e,"a",function(){return c}),n.d(e,"b",function(){return u});var r=n(0),i=n(6),V=n(2),o=n(1),s=n(5),a=n(46),c=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new h(this.getSubject(),this))),t.closed&&(this._connection=null,t=s.a.EMPTY)),t},e.prototype.refCount=function(){return Object(a.a)()(this)},e}(V.a),u=function(){var t=c.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);o.a},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),i=n(6),V=n(21),o=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.a(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new V.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a});var r=n(0),i=n(1),V=n(17);function o(t,e){return void 0===e&&(e=0),function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.scheduler,this.delay))},t}(),a=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new c(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(V.a.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(V.a.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(V.a.createComplete()),this.unsubscribe()},e}(i.a),c=function(){return function(t,e){this.notification=t,this.destination=e}}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(50);function i(){return Object(r.a)(1)}},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(10),V=n(50),o=n(26);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,s=null,a=t[t.length-1];return Object(i.a)(a)?(s=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof a&&(n=t.pop()),null===s&&1===t.length&&t[0]instanceof r.a?t[0]:Object(V.a)(n)(Object(o.a)(t,s))}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(0),i=n(7),V=n(26),o=n(4),s=n(3);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!Object(i.a)(t[0]))return t[0];t=t[0]}return Object(V.a)(t,void 0).lift(new c)}var c=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],i=Object(s.a)(this,r,r,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var V=0;V<this.subscriptions.length;V++)if(V!==n){var o=this.subscriptions[V];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(8),V=n(30),o=n(10);function s(t,e,n){void 0===t&&(t=0);var s=-1;return Object(V.a)(e)?s=Number(e)<1?1:Number(e):Object(o.a)(e)&&(n=e),Object(o.a)(n)||(n=i.a),new r.a(function(e){var r=Object(V.a)(t)?t:+t-n.now();return n.schedule(a,r,{index:0,period:s,subscriber:e})})}function a(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}},function(t,e,n){"use strict";var r=n(2),i=n(5),V=n(20);var o=n(55),s=n(19);var a=n(76),c=n(75);function u(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[V.a]}(t))return function(t,e){return new r.a(function(n){var r=new i.a;return r.add(e.schedule(function(){var i=t[V.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}(t,e);if(Object(a.a)(t))return function(t,e){return new r.a(function(n){var r=new i.a;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r})}(t,e);if(Object(c.a)(t))return Object(o.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a(function(n){var r,V=new i.a;return V.add(function(){r&&"function"==typeof r.return&&r.return()}),V.add(e.schedule(function(){r=t[s.a](),V.add(e.schedule(function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}}))})),V})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}n.d(e,"a",function(){return u})},function(t,e,n){"use strict";var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(29).a),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(n(27).a);n.d(e,"a",function(){return o});var o=new V(i)},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(5).a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",function(){return r})},function(t,e,n){"use strict";function r(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}n.d(e,"a",function(){return r})},function(t,e,n){"use strict";var r=n(43).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,V){if("function"==typeof n)return t(e,null,n);n||(n={}),V=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(V||i);var o=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,a=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!0,o||V.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,h=!0,s||V.call(e)},f=function(t){V.call(e,t)},d=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new r),V.call(e,t)):s&&!c?(e._writableState&&e._writableState.ended||(t=new r),V.call(e,t)):void 0},p=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?s&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",u),e.on("abort",d),e.req?p():e.on("request",p)),e.on("end",l),e.on("finish",u),!1!==n.error&&e.on("error",f),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",p),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",d)}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Prom=e.PromMessageType=void 0;const i=r(n(138));var V;!function(t){t[t.SessionStart=0]="SessionStart",t[t.WebRtcPerformance=1]="WebRtcPerformance",t[t.AvailabilityCheck=2]="AvailabilityCheck",t[t.QuestionMessageReceived=3]="QuestionMessageReceived",t[t.AnswerMessageReceived=4]="AnswerMessageReceived"}(V=e.PromMessageType||(e.PromMessageType={}));e.Prom=class{constructor(t){this.apiUrl=t,this.prom_prefix="client_sdk_",this.registry=i.default(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),setInterval(()=>{this.sendMetrics()},5e3)}handleMessage(t){var e,n,r,i,o,s,a;const c=Object.assign(t.labels||{},{platform:"js"});switch(t.type){case V.SessionStart:this.sessionStartTime.observe(t.value,c);break;case V.QuestionMessageReceived:this.messageTimings.push(t.value);break;case V.AnswerMessageReceived:const u=this.calculateConversationRtt(t);u>0&&this.conversationRoundTripTime.observe(u,c);break;case V.WebRtcPerformance:const h=t.value;h.outboundQualityLimitationReason?c.qualityLimitationReason=null===(e=h.outboundQualityLimitationReason)||void 0===e?void 0:e.value:c.qualityLimitationReason="unknown",h.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=h.newFramesDropped)||void 0===n?void 0:n.value,c),h.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=h.framesPerSec)||void 0===r?void 0:r.value,c),h.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=h.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),h.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(o=h.inboundRoundTripTime)||void 0===o?void 0:o.value,c),h.frameHeight&&this.webRtcFrameHeight.observe(null===(s=h.frameHeight)||void 0===s?void 0:s.value,c),h.frameWidth&&this.webRtcFrameWidth.observe(null===(a=h.frameWidth)||void 0===a?void 0:a.value,c);break;case V.AvailabilityCheck:this.availabilityCheckTime.observe(t.value,c)}}calculateConversationRtt(t){if(t.value&&this.messageTimings){const e=this.messageTimings.find(e=>e.id===t.value.id);if(e){const n=e.receivedOn;if(n){const r=(t.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(e),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const t=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(t),this.registry.reset()}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(4),V=n(3);function o(t){return function(e){return e.lift(new s(t))}}var s=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=Object(V.a)(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(i.a),c=n(8),u=n(70);function h(t,e){return void 0===e&&(e=c.a),o(function(){return Object(u.a)(t,e)})}function l(t){return function(e){return e.lift(new f(t))}}var f=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new d(t,this.closingNotifier))},t}(),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(Object(V.a)(r,n)),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,i){var V=this.buffer;this.buffer=[],this.destination.next(V)},e}(i.a),p=n(1);function g(t,e){return void 0===e&&(e=null),function(n){return n.lift(new v(t,e))}}var v=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?m:y}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),y=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.a(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(p.a),m=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var V=r.length;V--;){var o=r[V];o.push(t),o.length===e&&(r.splice(V,1),this.destination.next(o))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(p.a),b=n(10);function _(t){var e=arguments.length,n=c.a;Object(b.a)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new w(t,r,i,n))}}var w=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),A=function(){return function(){this.buffer=[]}}(),S=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=V,o.contexts=[];var s=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var a={subscriber:o,context:s,bufferTimeSpan:n};o.add(s.closeAction=V.schedule(x,n,a))}else{var c={subscriber:o,context:s},u={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:V};o.add(s.closeAction=V.schedule(T,n,c)),o.add(V.schedule(C,r,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var V=n[i],o=V.buffer;o.push(t),o.length==this.maxBufferSize&&(e=V)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(x,n,r))}},e.prototype.openContext=function(){var t=new A;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(p.a);function x(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function C(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,V=r.openContext();r.closed||(r.add(V.closeAction=i.schedule(T,n,{subscriber:r,context:V})),this.schedule(t,e))}function T(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var E=n(5);function R(t,e){return function(n){return n.lift(new M(t,e))}}var M=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new O(t,this.openings,this.closingSelector))},t}(),O=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(Object(V.a)(i,n)),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new E.a,r={buffer:[],subscription:n};e.push(r);var i=Object(V.a)(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(i.a);function P(t){return function(e){return e.lift(new k(t))}}var k=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new D(t,this.closingSelector))},t}(),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,i){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new E.a,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(Object(V.a)(this,e)),this.subscribing=!1},e}(i.a),I=n(13);function N(t){return function(e){var n=new j(t),r=e.lift(n);return n.caught=r}}var j=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new L(t,this.selector,this.caught))},t}(),L=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new I.a(this,void 0,void 0);this.add(r),Object(V.a)(this,n,void 0,void 0,r)}},e}(i.a),U=n(49);function F(t){return function(e){return e.lift(new U.a(t))}}var B=n(7),W=n(12);function z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(B.a)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(Object(W.a)([e].concat(t)),new U.a(n))}}var q=n(31);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(q.a.apply(void 0,[e].concat(t)))}}var G=n(67),Y=n(22);function $(t,e){return Object(Y.a)(t,e,1)}function Q(t,e){return $(function(){return t},e)}function X(t){return function(e){return e.lift(new Z(t,e))}}var Z=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new K(t,this.predicate,this.source))},t}(),K=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(p.a);function J(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return r.a(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(V.a)(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(i.a);function nt(t,e){return void 0===e&&(e=c.a),function(n){return n.lift(new rt(t,e))}}var rt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new it(t,this.dueTime,this.scheduler))},t}(),it=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.a(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(p.a);function Vt(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new st(t))}}var st=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new at(t,this.defaultValue))},t}(),at=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.a(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(p.a);function ct(t){return t instanceof Date&&!isNaN(+t)}var ut=n(17);function ht(t,e){void 0===e&&(e=c.a);var n=ct(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(n,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new ft(t,this.delay,this.scheduler))},t}(),ft=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.a(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var V=Math.max(0,n[0].time-r.now());this.schedule(t,V)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new dt(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ut.a.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ut.a.createComplete()),this.unsubscribe()},e}(p.a),dt=function(){return function(t,e){this.time=t,this.notification=e}}(),pt=n(2);function gt(t,e){return e?function(n){return new mt(n,e).lift(new vt(t))}:function(e){return e.lift(new vt(t))}}var vt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new yt(t,this.delayDurationSelector))},t}(),yt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=Object(V.a)(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(i.a),mt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.a(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new bt(t,this.source))},e}(pt.a),bt=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.a(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(p.a);function _t(){return function(t){return t.lift(new wt)}}var wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new At(t))},t}(),At=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(p.a);function St(t,e){return function(n){return n.lift(new xt(t,e))}}var xt=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Ct(t,this.keySelector,this.flushes))},t}(),Ct=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=n,i.values=new Set,r&&i.add(Object(V.a)(i,r)),i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(i.a);function Tt(t,e){return function(n){return n.lift(new Et(t,e))}}var Et=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rt(t,this.compare,this.keySelector))},t}(),Rt=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(p.a);function Mt(t,e){return Tt(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}var Ot=n(23),Pt=n(16),kt=n(25);function Dt(t){return void 0===t&&(t=jt),function(e){return e.lift(new It(t))}}var It=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Nt(t,this.errorFactory))},t}(),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(p.a);function jt(){return new kt.a}var Lt=n(11);function Ut(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new Ft(t))}}var Ft=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.total))},t}(),Bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(p.a);function Wt(t,e){if(t<0)throw new Ot.a;var n=arguments.length>=2;return function(r){return r.pipe(Object(Pt.a)(function(e,n){return n===t}),Ut(1),n?ot(e):Dt(function(){return new Ot.a}))}}var zt=n(34);function qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Object(q.a)(e,zt.a.apply(void 0,t))}}function Ht(t,e){return function(n){return n.lift(new Gt(t,e,n))}}var Gt=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t,this.predicate,this.thisArg,this.source))},t}(),Yt=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.predicate=n,V.thisArg=r,V.source=i,V.index=0,V.thisArg=r||V,V}return r.a(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.a);function $t(){return function(t){return t.lift(new Qt)}}var Qt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xt(t))},t}(),Xt=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(V.a)(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.a),Zt=n(9);function Kt(t,e){return e?function(n){return n.pipe(Kt(function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)(function(t,i){return e(n,t,r,i)}))}))}:function(e){return e.lift(new Jt(t))}}var Jt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new I.a(this,void 0,void 0);this.destination.add(r),Object(V.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.a);function ee(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new ne(t,e,n))}}var ne=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new re(t,this.project,this.concurrent,this.scheduler))},t}(),re=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.project=n,V.concurrent=r,V.scheduler=i,V.index=0,V.active=0,V.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(V.buffer=[]),V}return r.a(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var V={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,V))}else this.subscribeToProjection(i,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(Object(V.a)(this,t,e,n))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this._next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(i.a);function ie(t){return function(e){return e.lift(new Ve(t))}}var Ve=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new E.a(n)),r}return r.a(e,t),e}(p.a);function se(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new ae(t,n,!1,e))}}var ae=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ce=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=V,o.index=0,o}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(p.a);function ue(t,e){return function(n){return n.lift(new ae(t,n,!0,e))}}var he=n(18);function le(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)(function(e,n){return t(e,n,r)}):he.a,Ut(1),n?ot(e):Dt(function(){return new kt.a}))}}var fe=n(61);function de(){return function(t){return t.lift(new pe)}}var pe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype._next=function(t){},e}(p.a);function ve(){return function(t){return t.lift(new ye)}}var ye=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new me(t))},t}(),me=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.a);function be(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new we(t,this.total))},t}(),we=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var V=e++%n;t.next(r[V])}t.complete()},e}(p.a);function Ae(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)(function(e,n){return t(e,n,r)}):he.a,be(1),n?ot(e):Dt(function(){return new kt.a}))}}function Se(t){return function(e){return e.lift(new xe(t))}}var xe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Ce(t,this.value))},t}(),Ce=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.a(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(p.a);function Te(){return function(t){return t.lift(new Ee)}}var Ee=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Re(t))},t}(),Re=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){this.destination.next(ut.a.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ut.a.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ut.a.createComplete()),t.complete()},e}(p.a);function Me(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Pe(t,this.accumulator,this.seed,this.hasSeed))},t}(),Pe=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V._seed=r,V.hasSeed=i,V.index=0,V}return r.a(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(p.a),ke=n(37);function De(t,e){return arguments.length>=2?function(n){return Object(ke.a)(Me(t,e),be(1),ot(e))(n)}:function(e){return Object(ke.a)(Me(function(e,n,r){return t(e,n,r+1)}),be(1))(e)}}function Ie(t){return De("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}var Ne=n(68);function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ne.a.apply(void 0,[e].concat(t)))}}var Le=n(50);function Ue(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Object(Y.a)(function(){return t},e,n):("number"==typeof e&&(n=e),Object(Y.a)(function(){return t},n))}function Fe(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Be(t,e,n))}}var Be=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.accumulator,this.seed,this.concurrent))},t}(),We=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V.acc=r,V.concurrent=i,V.hasValue=!1,V.hasCompleted=!1,V.buffer=[],V.active=0,V.index=0,V}return r.a(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r,t,e)}else this.buffer.push(t)},e.prototype._innerSub=function(t,e,n){var r=new I.a(this,void 0,void 0);this.destination.add(r),Object(V.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){var V=this.destination;this.acc=e,this.hasValue=!0,V.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(i.a);function ze(t){return De("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}var qe=n(63);function He(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Ge(r,e));var i=Object.create(n,qe.b);return i.source=n,i.subjectFactory=r,i}}var Ge=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Ye=n(65);function $e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.nextSources))},t}(),Xe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.a(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new I.a(this,void 0,void 0);this.destination.add(e),Object(V.a)(this,t,void 0,void 0,e)}else this.destination.complete()},e}(i.a);function Ze(){return function(t){return t.lift(new Ke)}}var Ke=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Je(t))},t}(),Je=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.a(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(p.a),tn=n(77);function en(t,e){return function(n){return[Object(Pt.a)(t,e)(n),Object(Pt.a)(Object(tn.a)(t,e))(n)]}}function nn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Object(Zt.a)(function(t,e){return function(n){for(var r=n,i=0;i<e;i++){var V=r[t[i]];if(void 0===V)return;r=V}return r}}(t,n))(e)}}var rn=n(6);function Vn(t){return t?He(function(){return new rn.a},t):He(new rn.a)}var on=n(64);function sn(t){return function(e){return He(new on.a(t))(e)}}var an=n(28);function cn(){return function(t){return He(new an.a)(t)}}var un=n(47);function hn(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,V=new un.a(t,e,r);return function(t){return He(function(){return V},i)(t)}}var ln=n(69);function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),e.lift.call(ln.a.apply(void 0,[e].concat(t)))}}function dn(t){return void 0===t&&(t=-1),function(e){return 0===t?Object(Lt.b)():t<0?e.lift(new pn(-1,e)):e.lift(new pn(t-1,e))}}var pn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gn(t,this.count,this.source))},t}(),gn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(p.a);function vn(t){return function(e){return e.lift(new yn(t))}}var yn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new mn(t,this.notifier,e))},t}(),mn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new rn.a;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=Object(V.a)(this,e)},e}(i.a);function bn(t){return void 0===t&&(t=-1),function(e){return e.lift(new _n(t,e))}}var _n=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new wn(t,this.count,this.source))},t}(),wn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(p.a);function An(t){return function(e){return e.lift(new Sn(t,e))}}var Sn=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new xn(t,this.notifier,this.source))},t}(),xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new rn.a;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=Object(V.a)(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,i){var V=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=V,this.source.subscribe(this)},e}(i.a),Cn=n(46);function Tn(t){return function(e){return e.lift(new En(t))}}var En=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Rn(t),r=e.subscribe(n);return r.add(Object(V.a)(n,this.notifier)),r},t}(),Rn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.a(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(i.a);function Mn(t,e){return void 0===e&&(e=c.a),function(n){return n.lift(new On(t,e))}}var On=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Pn(t,this.period,this.scheduler))},t}(),Pn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(kn,n,{subscriber:i,period:n})),i}return r.a(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(p.a);function kn(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Dn(t,e){return function(n){return n.lift(new In(t,e))}}var In=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Nn(t,this.compareTo,this.comparator))},t}(),Nn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new jn(e,i))),i}return r.a(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),V=!1;try{V=n?n(r,i):r===i}catch(t){this.destination.error(t)}V||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(p.a),jn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.a(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(p.a);function Ln(){return new rn.a}function Un(){return function(t){return Object(Cn.a)()(He(Ln)(t))}}function Fn(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,V=t.windowTime,o=void 0===V?Number.POSITIVE_INFINITY:V,s=t.refCount,a=t.scheduler,c=0,u=!1,h=!1;return function(t){c++,e&&!u||(u=!1,e=new un.a(i,o,a),n=t.subscribe({next:function(t){e.next(t)},error:function(t){u=!0,e.error(t)},complete:function(){h=!0,e.complete()}}));var r=e.subscribe(this);this.add(function(){c--,r.unsubscribe(),n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)})}}(r))}}function Bn(t){return function(e){return e.lift(new Wn(t,e))}}var Wn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new zn(t,this.predicate,this.source))},t}(),zn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.a(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.a)},e}(p.a);function qn(t){return function(e){return e.lift(new Hn(t))}}var Hn=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new Gn(t,this.total))},t}(),Gn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(p.a);function Yn(t){return function(e){return e.lift(new $n(t))}}var $n=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ot.a}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new p.a(t)):e.subscribe(new Qn(t,this._skipCount))},t}(),Qn=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.a(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,V=i[r];i[r]=t,this.destination.next(V)}},e}(p.a);function Xn(t){return function(e){return e.lift(new Zn(t))}}var Zn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Kn(t,this.notifier))},t}(),Kn=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var i=new I.a(r,void 0,void 0);return r.add(i),r.innerSubscription=i,Object(V.a)(r,n,void 0,void 0,i),r}return r.a(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(t,e,n,r,i){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(i.a);function Jn(t){return function(e){return e.lift(new tr(t))}}var tr=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new er(t,this.predicate))},t}(),er=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(p.a);function nr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(b.a)(n)?(t.pop(),function(e){return Object(q.a)(t,e,n)}):function(e){return Object(q.a)(t,e)}}var rr=n(56),ir=n(30),Vr=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=rr.a);var i=t.call(this)||this;return i.source=e,i.delayTime=n,i.scheduler=r,(!Object(ir.a)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=rr.a),i}return r.a(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=rr.a),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(pt.a);function or(t,e){return void 0===e&&(e=0),function(n){return n.lift(new sr(t,e))}}var sr=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Vr(e,this.delay,this.scheduler).subscribe(t)},t}();function ar(t,e){return"function"==typeof e?function(n){return n.pipe(ar(function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)(function(t,i){return e(n,t,r,i)}))}))}:function(e){return e.lift(new cr(t))}}var cr=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new ur(t,this.project))},t}(),ur=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new I.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(V.a)(this,t,e,n,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e}(i.a);function hr(){return ar(he.a)}function lr(t,e){return e?ar(function(){return t},e):ar(function(){return t})}function fr(t){return function(e){return e.lift(new dr(t))}}var dr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new pr(t),r=Object(V.a)(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),pr=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(i.a);function gr(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new vr(t,e))}}var vr=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.predicate,this.inclusive))},t}(),yr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(p.a),mr=n(15),br=n(24);function _r(t,e,n){return function(r){return r.lift(new wr(t,e,n))}}var wr=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Ar(t,this.nextOrObserver,this.error,this.complete))},t}(),Ar=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V._tapNext=mr.a,V._tapError=mr.a,V._tapComplete=mr.a,V._tapError=r||mr.a,V._tapComplete=i||mr.a,Object(br.a)(n)?(V._context=V,V._tapNext=n):n&&(V._context=n,V._tapNext=n.next||mr.a,V._tapError=n.error||mr.a,V._tapComplete=n.complete||mr.a),V}return r.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(p.a),Sr={leading:!0,trailing:!1};function xr(t,e){return void 0===e&&(e=Sr),function(n){return n.lift(new Cr(t,e.leading,e.trailing))}}var Cr=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Tr(t,this.durationSelector,this.leading,this.trailing))},t}(),Tr=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.destination=e,V.durationSelector=n,V._leading=r,V._trailing=i,V._hasValue=!1,V}return r.a(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=Object(V.a)(this,e))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(t,e,n,r,i){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(i.a);function Er(t,e,n){return void 0===e&&(e=c.a),void 0===n&&(n=Sr),function(r){return r.lift(new Rr(t,e,n.leading,n.trailing))}}var Rr=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Mr(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Mr=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=V,o._hasTrailingValue=!1,o._trailingValue=null,o}return r.a(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Or,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(p.a);function Or(t){t.subscriber.clearThrottle()}var Pr=n(51);function kr(t){return void 0===t&&(t=c.a),function(e){return Object(Pr.a)(function(){return e.pipe(Me(function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}},{current:t.now(),value:void 0,last:void 0}),Object(Zt.a)(function(t){var e=t.current,n=t.last,r=t.value;return new Dr(r,e-n)}))})}}var Dr=function(){return function(t,e){this.value=t,this.interval=e}}(),Ir=n(66);function Nr(t,e,n){return void 0===n&&(n=c.a),function(r){var i=ct(t),V=i?+t-n.now():Math.abs(t);return r.lift(new jr(V,i,e,n))}}var jr=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Lr(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Lr=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=V,o.action=null,o.scheduleTimeout(),o}return r.a(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(Object(V.a)(t,e))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},e}(i.a),Ur=n(48);function Fr(t,e){return void 0===e&&(e=c.a),Nr(t,Object(Ur.a)(new Ir.a),e)}function Br(t){return void 0===t&&(t=c.a),Object(Zt.a)(function(e){return new Wr(e,t.now())})}var Wr=function(){return function(t,e){this.value=t,this.timestamp=e}}();function zr(t,e,n){return 0===n?[e]:(t.push(e),t)}function qr(){return De(zr,[])}function Hr(t){return function(e){return e.lift(new Gr(t))}}var Gr=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new Yr(t),r=e.subscribe(n);return r.closed||n.add(Object(V.a)(n,this.windowBoundaries)),r},t}(),Yr=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new rn.a,e.next(n.window),n}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new rn.a;e.next(n)},e}(i.a);function $r(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Qr(t,e))}}var Qr=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.windowSize,this.startWindowEvery))},t}(),Xr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=n,i.startWindowEvery=r,i.windows=[new rn.a],i.count=0,e.next(i.windows[0]),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,V=i.length,o=0;o<V&&!this.closed;o++)i[o].next(t);var s=this.count-r+1;if(s>=0&&s%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new rn.a;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(p.a);function Zr(t){var e=c.a,n=null,r=Number.POSITIVE_INFINITY;return Object(b.a)(arguments[3])&&(e=arguments[3]),Object(b.a)(arguments[2])?e=arguments[2]:Object(ir.a)(arguments[2])&&(r=arguments[2]),Object(b.a)(arguments[1])?e=arguments[1]:Object(ir.a)(arguments[1])&&(n=arguments[1]),function(i){return i.lift(new Kr(t,n,r,e))}}var Kr=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ti(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Jr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.a(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(rn.a),ti=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=V,o.windows=[];var s=o.openWindow();if(null!==r&&r>=0){var a={subscriber:o,window:s,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:V};o.add(V.schedule(ri,n,a)),o.add(V.schedule(ni,r,c))}else{var u={subscriber:o,window:s,windowTimeSpan:n};o.add(V.schedule(ei,n,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new Jr;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(p.a);function ei(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function ni(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,V=n.openWindow(),o={action:this,subscription:null},s={subscriber:n,window:V,context:o};o.subscription=r.schedule(ri,e,s),this.add(o.subscription),this.schedule(t,i)}function ri(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function ii(t,e){return function(n){return n.lift(new Vi(t,e))}}var Vi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new oi(t,this.openings,this.closingSelector))},t}(),oi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(V.a)(i,n,n)),i}return r.a(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var V=n[i];V.window.error(e),V.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var i=e[r];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var o=void 0;try{o=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new rn.a,a=new E.a,c={window:s,subscription:a};this.contexts.push(c);var u=Object(V.a)(this,o,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},e}(i.a);function si(t){return function(e){return e.lift(new ai(t))}}var ai=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ci(t,this.closingSelector))},t}(),ci=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new rn.a;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Object(V.a)(this,n))},e}(i.a);function ui(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new hi(r,n))}}var hi=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new li(t,this.observables,this.project))},t}(),li=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=n[s];i.add(Object(V.a)(i,a,a,s))}return i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e;var V=this.toRespond;if(V.length>0){var o=V.indexOf(n);-1!==o&&V.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a),fi=n(52);function di(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(fi.b.apply(void 0,[e].concat(t)))}}function pi(t){return function(e){return e.lift(new fi.a(t))}}n.d(e,"audit",function(){return o}),n.d(e,"auditTime",function(){return h}),n.d(e,"buffer",function(){return l}),n.d(e,"bufferCount",function(){return g}),n.d(e,"bufferTime",function(){return _}),n.d(e,"bufferToggle",function(){return R}),n.d(e,"bufferWhen",function(){return P}),n.d(e,"catchError",function(){return N}),n.d(e,"combineAll",function(){return F}),n.d(e,"combineLatest",function(){return z}),n.d(e,"concat",function(){return H}),n.d(e,"concatAll",function(){return G.a}),n.d(e,"concatMap",function(){return $}),n.d(e,"concatMapTo",function(){return Q}),n.d(e,"count",function(){return X}),n.d(e,"debounce",function(){return J}),n.d(e,"debounceTime",function(){return nt}),n.d(e,"defaultIfEmpty",function(){return ot}),n.d(e,"delay",function(){return ht}),n.d(e,"delayWhen",function(){return gt}),n.d(e,"dematerialize",function(){return _t}),n.d(e,"distinct",function(){return St}),n.d(e,"distinctUntilChanged",function(){return Tt}),n.d(e,"distinctUntilKeyChanged",function(){return Mt}),n.d(e,"elementAt",function(){return Wt}),n.d(e,"endWith",function(){return qt}),n.d(e,"every",function(){return Ht}),n.d(e,"exhaust",function(){return $t}),n.d(e,"exhaustMap",function(){return Kt}),n.d(e,"expand",function(){return ee}),n.d(e,"filter",function(){return Pt.a}),n.d(e,"finalize",function(){return ie}),n.d(e,"find",function(){return se}),n.d(e,"findIndex",function(){return ue}),n.d(e,"first",function(){return le}),n.d(e,"groupBy",function(){return fe.b}),n.d(e,"ignoreElements",function(){return de}),n.d(e,"isEmpty",function(){return ve}),n.d(e,"last",function(){return Ae}),n.d(e,"map",function(){return Zt.a}),n.d(e,"mapTo",function(){return Se}),n.d(e,"materialize",function(){return Te}),n.d(e,"max",function(){return Ie}),n.d(e,"merge",function(){return je}),n.d(e,"mergeAll",function(){return Le.a}),n.d(e,"mergeMap",function(){return Y.a}),n.d(e,"flatMap",function(){return Y.a}),n.d(e,"mergeMapTo",function(){return Ue}),n.d(e,"mergeScan",function(){return Fe}),n.d(e,"min",function(){return ze}),n.d(e,"multicast",function(){return He}),n.d(e,"observeOn",function(){return Ye.b}),n.d(e,"onErrorResumeNext",function(){return $e}),n.d(e,"pairwise",function(){return Ze}),n.d(e,"partition",function(){return en}),n.d(e,"pluck",function(){return nn}),n.d(e,"publish",function(){return Vn}),n.d(e,"publishBehavior",function(){return sn}),n.d(e,"publishLast",function(){return cn}),n.d(e,"publishReplay",function(){return hn}),n.d(e,"race",function(){return fn}),n.d(e,"reduce",function(){return De}),n.d(e,"repeat",function(){return dn}),n.d(e,"repeatWhen",function(){return vn}),n.d(e,"retry",function(){return bn}),n.d(e,"retryWhen",function(){return An}),n.d(e,"refCount",function(){return Cn.a}),n.d(e,"sample",function(){return Tn}),n.d(e,"sampleTime",function(){return Mn}),n.d(e,"scan",function(){return Me}),n.d(e,"sequenceEqual",function(){return Dn}),n.d(e,"share",function(){return Un}),n.d(e,"shareReplay",function(){return Fn}),n.d(e,"single",function(){return Bn}),n.d(e,"skip",function(){return qn}),n.d(e,"skipLast",function(){return Yn}),n.d(e,"skipUntil",function(){return Xn}),n.d(e,"skipWhile",function(){return Jn}),n.d(e,"startWith",function(){return nr}),n.d(e,"subscribeOn",function(){return or}),n.d(e,"switchAll",function(){return hr}),n.d(e,"switchMap",function(){return ar}),n.d(e,"switchMapTo",function(){return lr}),n.d(e,"take",function(){return Ut}),n.d(e,"takeLast",function(){return be}),n.d(e,"takeUntil",function(){return fr}),n.d(e,"takeWhile",function(){return gr}),n.d(e,"tap",function(){return _r}),n.d(e,"throttle",function(){return xr}),n.d(e,"throttleTime",function(){return Er}),n.d(e,"throwIfEmpty",function(){return Dt}),n.d(e,"timeInterval",function(){return kr}),n.d(e,"timeout",function(){return Fr}),n.d(e,"timeoutWith",function(){return Nr}),n.d(e,"timestamp",function(){return Br}),n.d(e,"toArray",function(){return qr}),n.d(e,"window",function(){return Hr}),n.d(e,"windowCount",function(){return $r}),n.d(e,"windowTime",function(){return Zr}),n.d(e,"windowToggle",function(){return ii}),n.d(e,"windowWhen",function(){return si}),n.d(e,"withLatestFrom",function(){return ui}),n.d(e,"zip",function(){return di}),n.d(e,"zipAll",function(){return pi})},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"shimGetUserMedia",function(){return m}),n.d(r,"shimGetDisplayMedia",function(){return b}),n.d(r,"shimMediaStream",function(){return _}),n.d(r,"shimOnTrack",function(){return w}),n.d(r,"shimGetSendersWithDtmf",function(){return A}),n.d(r,"shimGetStats",function(){return S}),n.d(r,"shimSenderReceiverGetStats",function(){return x}),n.d(r,"shimAddTrackRemoveTrackWithNative",function(){return C}),n.d(r,"shimAddTrackRemoveTrack",function(){return T}),n.d(r,"shimPeerConnection",function(){return E}),n.d(r,"fixNegotiationNeeded",function(){return R});var i={};n.r(i),n.d(i,"shimGetUserMedia",function(){return M}),n.d(i,"shimGetDisplayMedia",function(){return O}),n.d(i,"shimOnTrack",function(){return P}),n.d(i,"shimPeerConnection",function(){return k}),n.d(i,"shimSenderGetStats",function(){return D}),n.d(i,"shimReceiverGetStats",function(){return I}),n.d(i,"shimRemoveStream",function(){return N}),n.d(i,"shimRTCDataChannel",function(){return j}),n.d(i,"shimAddTransceiver",function(){return L}),n.d(i,"shimGetParameters",function(){return U}),n.d(i,"shimCreateOffer",function(){return F}),n.d(i,"shimCreateAnswer",function(){return B});var V={};n.r(V),n.d(V,"shimLocalStreamsAPI",function(){return W}),n.d(V,"shimRemoteStreamsAPI",function(){return z}),n.d(V,"shimCallbacksAPI",function(){return q}),n.d(V,"shimGetUserMedia",function(){return H}),n.d(V,"shimConstraints",function(){return G}),n.d(V,"shimRTCIceServerUrls",function(){return Y}),n.d(V,"shimTrackEventTransceiver",function(){return $}),n.d(V,"shimCreateOfferLegacy",function(){return Q}),n.d(V,"shimAudioContext",function(){return X});var o={};n.r(o),n.d(o,"shimRTCIceCandidate",function(){return J}),n.d(o,"shimMaxMessageSize",function(){return tt}),n.d(o,"shimSendThrowTypeError",function(){return et}),n.d(o,"shimConnectionState",function(){return nt}),n.d(o,"removeExtmapAllowMixed",function(){return rt}),n.d(o,"shimAddIceCandidateNullOrEmpty",function(){return it}),n.d(o,"shimParameterlessSetLocalDescription",function(){return Vt});let s=!0,a=!0;function c(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function u(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(t,r){if(t!==e)return i.apply(this,arguments);const V=t=>{const e=n(t);e&&(r.handleEvent?r.handleEvent(e):r(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(r,V),i.apply(this,[t,V])};const V=r.removeEventListener;r.removeEventListener=function(t,n){if(t!==e||!this._eventMap||!this._eventMap[e])return V.apply(this,arguments);if(!this._eventMap[e].has(n))return V.apply(this,arguments);const r=this._eventMap[e].get(n);return this._eventMap[e].delete(n),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,V.apply(this,[t,r])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function h(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(s=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function l(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(a=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function f(){if("object"==typeof window){if(s)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function d(t,e){a&&console.warn(t+" is deprecated, please use "+e+" instead.")}function p(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return p(t)?Object.keys(t).reduce(function(e,n){const r=p(t[n]),i=r?g(t[n]):t[n],V=r&&!Object.keys(i).length;return void 0===i||V?e:Object.assign(e,{[n]:i})},{}):t}function v(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const V=[];return t.forEach(t=>{"track"===t.type&&t.trackIdentifier===e.id&&V.push(t)}),V.forEach(e=>{t.forEach(n=>{n.type===r&&n.trackId===e.id&&function t(e,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?t(e,e.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{t(e,e.get(n),r)})}))}(t,n,i)})}),i}const y=f;function m(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof t[n]?t[n]:{ideal:t[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==r.ideal){e.optional=e.optional||[];let t={};"number"==typeof r.ideal?(t[i("min",n)]=r.ideal,e.optional.push(t),(t={})[i("max",n)]=r.ideal,e.optional.push(t)):(t[i("",n)]=r.ideal,e.optional.push(t))}void 0!==r.exact&&"number"!=typeof r.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",n)]=r.exact):["min","max"].forEach(t=>{void 0!==r[t]&&(e.mandatory=e.mandatory||{},e.mandatory[i(t,n)]=r[t])})}),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},i=function(t,i){if(e.version>=61)return i(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=r(t.audio)}if(t&&"object"==typeof t.video){let V=t.video.facingMode;V=V&&("object"==typeof V?V:{ideal:V});const o=e.version<66;if(V&&("user"===V.exact||"environment"===V.exact||"user"===V.ideal||"environment"===V.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let e;if(delete t.video.facingMode,"environment"===V.exact||"environment"===V.ideal?e=["back","rear"]:"user"!==V.exact&&"user"!==V.ideal||(e=["front"]),e)return n.mediaDevices.enumerateDevices().then(n=>{let o=(n=n.filter(t=>"videoinput"===t.kind)).find(t=>e.some(e=>t.label.toLowerCase().includes(e)));return!o&&n.length&&e.includes("back")&&(o=n[n.length-1]),o&&(t.video.deviceId=V.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=r(t.video),y("chrome: "+JSON.stringify(t)),i(t)})}t.video=r(t.video)}return y("chrome: "+JSON.stringify(t)),i(t)},V=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(t,e,r){i(t,t=>{n.webkitGetUserMedia(t,e,t=>{r&&r(V(t))})})}.bind(n),n.mediaDevices.getUserMedia){const t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return i(e,e=>t(e).then(t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(t=>{t.stop()}),new DOMException("","NotFoundError");return t},t=>Promise.reject(V(t))))}}}function b(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(e=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,V=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:V||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),t.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function _(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function w(t){if("object"!=typeof t||!t.RTCPeerConnection||"ontrack"in t.RTCPeerConnection.prototype)u(t,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t));else{Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)}),e.stream.getTracks().forEach(n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}}function A(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){let i=n.apply(this,arguments);return i||(i=e(this,t),this._senders.push(i)),i};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){r.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],n.apply(this,[t]),t.getTracks().forEach(t=>{this._senders.push(e(this,t))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach(t=>{const e=this._senders.find(e=>e.track===t);e&&this._senders.splice(this._senders.indexOf(e),1)})}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function S(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,n,r]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const i=function(t){const e={};return t.result().forEach(t=>{const n={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach(e=>{n[e]=t.stat(e)}),e[n.id]=n}),e},V=function(t){return new Map(Object.keys(t).map(e=>[e,t[e]]))};if(arguments.length>=2){const r=function(t){n(V(i(t)))};return e.apply(this,[r,t])}return new Promise((t,n)=>{e.apply(this,[function(e){t(V(i(e)))},n])}).then(n,r)}}function x(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,n,r;return this.getSenders().forEach(n=>{n.track===t&&(e?r=!0:e=n)}),this.getReceivers().forEach(e=>(e.track===t&&(n?r=!0:n=e),e.track===t)),r||e&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function C(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(t=>this._shimmedLocalStreams[t][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){if(!n)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=e.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")});const e=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(t=>-1===e.indexOf(t));this._shimmedLocalStreams[t.id]=[t].concat(r)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach(e=>{const n=this._shimmedLocalStreams[e].indexOf(t);-1!==n&&this._shimmedLocalStreams[e].splice(n,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]}),i.apply(this,arguments)}}function T(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return C(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map(t=>this._reverseStreams[t.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[e.id]){const n=new t.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}r.apply(this,[e])};const i=t.RTCPeerConnection.prototype.removeStream;function V(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:e.type,sdp:n})}function o(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:e.type,sdp:n})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(t=>t===e))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(t=>t.track===e);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const V=this._streams[n.id];if(V)V.addTrack(e),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new t.MediaStream([e]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(t=>t.track===e)},["createOffer","createAnswer"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[e=>{const n=V(this,e);t[0].apply(null,[n])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then(t=>V(this,t))}};t.RTCPeerConnection.prototype[e]=r[e]});const s=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=a.get.apply(this);return""===t.type?t:V(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(e=>t.track===e)&&(e=this._streams[n])}),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function E(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]})}function R(t,e){u(t,"negotiationneeded",t=>{const n=t.target;if(!(e.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return t})}function M(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(t,e,r){d("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(t).then(e,r)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const t=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])},e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),t(n.audio,"autoGainControl","mozAutoGainControl"),t(n.audio,"noiseSuppression","mozNoiseSuppression")),e(n)},r&&r.prototype.getSettings){const e=r.prototype.getSettings;r.prototype.getSettings=function(){const n=e.apply(this,arguments);return t(n,"mozAutoGainControl","autoGainControl"),t(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const e=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),t(n,"autoGainControl","mozAutoGainControl"),t(n,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[n])}}}}function O(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===n.video?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function P(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function k(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,i,V]=arguments;return r.apply(this,[t||null]).then(t=>{if(e.version<53&&!i)try{t.forEach(t=>{t.type=n[t.type]||t.type})}catch(e){if("TypeError"!==e.name)throw e;t.forEach((e,r)=>{t.set(r,Object.assign({},e,{type:n[e.type]||e.type}))})}return t}).then(i,V)}}function D(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function I(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function N(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){d("removeStream","removeTrack"),this.getSenders().forEach(e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)})})}function j(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function L(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const t=arguments[1],n=t&&"sendEncodings"in t;n&&t.sendEncodings.forEach(t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(n){const{sender:e}=r,n=e.getParameters();"encodings"in n&&(1!==n.encodings.length||0!==Object.keys(n.encodings[0]).length)||(n.encodings=t.sendEncodings,e.sendEncodings=t.sendEncodings,this.setParametersPromises.push(e.setParameters(n).then(()=>{delete e.sendEncodings}).catch(()=>{delete e.sendEncodings})))}return r})}function U(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function F(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function B(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function W(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(n=>e.call(this,n,t)),t.getVideoTracks().forEach(n=>e.call(this,n,t))},t.RTCPeerConnection.prototype.addTrack=function(t,...n){return n&&n.forEach(t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const n=t.getTracks();this.getSenders().forEach(t=>{n.includes(t.track)&&this.removeTrack(t)})})}}function z(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach(t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const n=new Event("addstream");n.stream=e,t.dispatchEvent(n)})}),e.apply(t,arguments)}}}function q(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,V=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return e?(i.then(t,e),Promise.resolve()):i},e.createAnswer=function(t,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return e?(i.then(t,e),Promise.resolve()):i};let s=function(t,e,n){const r=i.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r};e.setLocalDescription=s,s=function(t,e,n){const r=V.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.setRemoteDescription=s,s=function(t,e,n){const r=o.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.addIceCandidate=s}function H(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>n(G(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,n,r){e.mediaDevices.getUserMedia(t).then(n,r)}.bind(e))}function G(t){return t&&void 0!==t.video?Object.assign({},t,{video:g(t.video)}):t}function Y(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,n){if(t&&t.iceServers){const e=[];for(let n=0;n<t.iceServers.length;n++){let r=t.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(d("RTCIceServer.url","RTCIceServer.urls"),(r=JSON.parse(JSON.stringify(r))).urls=r.url,delete r.url,e.push(r)):e.push(t.iceServers[n])}t.iceServers=e}return new e(t,n)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function $(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Q(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find(t=>"audio"===t.receiver.track.kind);!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio"),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const n=this.getTransceivers().find(t=>"video"===t.receiver.track.kind);!1===t.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==t.offerToReceiveVideo||n||this.addTransceiver("video")}return e.apply(this,arguments)}}function X(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Z=n(41),K=n.n(Z);function J(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const n=new e(t),r=K.a.parseCandidate(t.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,u(t,"icecandidate",e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e))}function tt(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(t){if(!t||!t.sdp)return!1;const e=K.a.splitSections(t.sdp);return e.shift(),e.some(t=>{const e=K.a.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")})},r=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const n=parseInt(e[1],10);return n!=n?-1:n},i=function(t){let n=65536;return"firefox"===e.browser&&(n=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),n},V=function(t,n){let r=65536;"firefox"===e.browser&&57===e.version&&(r=65535);const i=K.a.matchPrefix(t.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===e.browser&&-1!==n&&(r=2147483637),r},o=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const t=r(arguments[0]),e=i(t),n=V(arguments[0],t);let o;o=0===e&&0===n?Number.POSITIVE_INFINITY:0===e||0===n?Math.max(e,n):Math.min(e,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>o}),this._sctp=s}return o.apply(this,arguments)}}function et(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const n=t.send;t.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===t.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return n.apply(t,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=n.apply(this,arguments);return e(t,this),t},u(t,"datachannel",t=>(e(t.channel,t.target),t))}function nt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const n=new Event("connectionstatechange",t);e.dispatchEvent(n)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function rt(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const n=e.sdp.split("\n").filter(t=>"a=extmap-allow-mixed"!==t.trim()).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:n}):e.sdp=n}return n.apply(this,arguments)}}function it(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Vt(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return n.apply(this,arguments);if(!(t={type:t.type,sdp:t.sdp}).type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return n.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then(t=>n.apply(this,[t]))})}const ot=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=f,s=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=c(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=c(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=c(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),a={browserDetails:s,commonShim:o,extractVersion:c,disableLog:h,disableWarnings:l,sdp:Z};switch(s.browser){case"chrome":if(!r||!E||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=r,it(t,s),Vt(t),m(t,s),_(t),E(t,s),w(t),T(t,s),A(t),S(t),x(t),R(t,s),J(t),nt(t),tt(t,s),et(t),rt(t,s);break;case"firefox":if(!i||!k||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=i,it(t,s),Vt(t),M(t,s),k(t,s),P(t),N(t),D(t),I(t),j(t),L(t),U(t),F(t),B(t),J(t),nt(t),tt(t,s),et(t);break;case"safari":if(!V||!e.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=V,it(t,s),Vt(t),Y(t),Q(t),q(t),W(t),z(t),$(t),H(t),X(t),J(t),tt(t,s),et(t),rt(t,s);break;default:n("Unsupported browser!")}return a}({window:"undefined"==typeof window?void 0:window});e.default=ot},function(t,e,n){"use strict";n.r(e),console.log("BUILD/SERIOUSLY.MODULE");let r,i,V,o,s,a,c,u={},h={},l={},f={},d=[],p={},g={},v={canvas:[],image:[],video:[]},y={},m=window.WeakMap&&new WeakMap,b=0,_=function(){},w={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},A=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,S=/^#(([0-9a-fA-F]{3,8}))/,x=["x","y","z","w"],C=["r","g","b","a"],T={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},E=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(t,e,n,r,i,V,o){o||(o=M.create());var s=e-t,a=r-n,c=V-i;return o[0]=2*i/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/a,o[6]=0,o[7]=0,o[8]=(e+t)/s,o[9]=(r+n)/a,o[10]=-(V+i)/c,o[11]=-1,o[12]=0,o[13]=0,o[14]=-V*i*2/c,o[15]=0,o},perspective:function(t,e,n,r,i){var V=n*Math.tan(t*Math.PI/360),o=V*e;return M.frustum(-o,o,-V,V,n,r,i)},multiply:function(t,e,n){var r=e[0],i=e[1],V=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n[0],b=n[1],_=n[2],w=n[3];return t[0]=m*r+b*s+_*h+w*p,t[1]=m*i+b*a+_*l+w*g,t[2]=m*V+b*c+_*f+w*v,t[3]=m*o+b*u+_*d+w*y,m=n[4],b=n[5],_=n[6],w=n[7],t[4]=m*r+b*s+_*h+w*p,t[5]=m*i+b*a+_*l+w*g,t[6]=m*V+b*c+_*f+w*v,t[7]=m*o+b*u+_*d+w*y,m=n[8],b=n[9],_=n[10],w=n[11],t[8]=m*r+b*s+_*h+w*p,t[9]=m*i+b*a+_*l+w*g,t[10]=m*V+b*c+_*f+w*v,t[11]=m*o+b*u+_*d+w*y,m=n[12],b=n[13],_=n[14],w=n[15],t[12]=m*r+b*s+_*h+w*p,t[13]=m*i+b*a+_*l+w*g,t[14]=m*V+b*c+_*f+w*v,t[15]=m*o+b*u+_*d+w*y,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},O=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){var e,n,r;return e=(new Date).getTime(),n=Math.max(0,16-(e-N)),r=window.setTimeout(function(){t(e+n)},n),N=e+n,r}),P=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){window.cancelTimeout(t)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],D=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],I=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function j(t,e){var n,r;if("string"==typeof t)n=document.querySelector(t);else if(!t)return!1;return t.tagName&&(n=t),n?(r=n.tagName.toLowerCase(),e&&e.indexOf(r)<0?t:n):t}function L(t,e){var n,r;for(n in t.prototype&&e.prototype&&t.prototype!==e.prototype&&L(t.prototype,e.prototype),e)e.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(e,n)).get||r.set?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):t[n]=e[n]);return t}function U(t){var e;if(!console)return _;if("function"==typeof console[t])e=console[t];else{if("function"!=typeof console.log)return _;e=console.log}return e.bind?e.bind(console):function(){e.apply(console,arguments)}}function F(t,e){if(e||(e="HTMLElement"),t instanceof window[e])return!0;if(!t||"object"!=typeof t)return!1;for(;t;)if((t=Object.getPrototypeOf(t))&&t.constructor.name===e)return!0;return!1}function B(t,e,n,r,i){function V(t,e,n){return(n%=1)<0&&(n+=1),n<1/6?t+(e-t)*n*6:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var o,s;return o=2*n-(s=n<.5?n*(e+1):n+e-n*e),i||(i=[]),i[0]=V(o,s,t+1/3),i[1]=V(o,s,t),i[2]=V(o,s,t-1/3),i[3]=r,i}function W(t){var e,n,r,i="#",V=t[3]<1?4:3;for(e=0;e<V;e++)r=(n=Math.min(255,Math.round(255*t[e]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function z(t){return Array.isArray(t)||t&&t.BYTES_PER_ELEMENT&&"length"in t}function q(t){if("function"!=typeof t)throw new Error("setTimeoutZero argument is not a function");d.push(t),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout(function(){d.length&&d.shift()()},0)}function H(t,e){var n;try{n=window.WebGLDebugUtils&&e&&e.debugContext?window.WebGLDebugUtils.makeDebugContext(t.getContext("webgl",e)):t.getContext("webgl",e)}catch(t){}if(!n)try{n=t.getContext("experimental-webgl",e)}catch(t){}return n}function G(){var t;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||V?r:(t=document.createElement("canvas"),(r=H(t))?t.addEventListener("webglcontextlost",function e(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,t.removeEventListener("webglcontextlost",e,!1))},!1):X.logger.warn("Unable to access WebGL."),r)}function Y(t){var e,n,r;function i(t,r){var i,V;z(t)?(i=t[0],V=t[1]||i):i=t,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=V,r||(e.firstValue=i)}function V(t){return t}for(r in t.inputs)if(t.inputs.hasOwnProperty(r)){if(t.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(e=t.inputs[r]).name=r,isNaN(e.min)&&(e.min=-1/0),isNaN(e.max)&&(e.max=1/0),isNaN(e.minCount)&&(e.minCount=-1/0),isNaN(e.maxCount)&&(e.maxCount=1/0),isNaN(e.step)&&(e.step=0),isNaN(e.mod)&&(e.mod=0),"enum"===e.type&&e.options&&z(e.options)&&e.options.length&&(n={},e.options.forEach(i),e.options=n),"vector"===e.type?e.dimensions<2?e.dimensions=2:e.dimensions>4?e.dimensions=4:!e.dimensions||isNaN(e.dimensions)?e.dimensions=4:e.dimensions=Math.round(e.dimensions):e.dimensions=1,e.shaderDirty=!!e.shaderDirty,"function"!=typeof e.validate&&(e.validate=X.inputValidators[e.type]||V),t.defaultImageInput||"image"!==e.type||(t.defaultImageInput=r)}}function $(t,e,n,r){var i,V,o,s;!0===r||r&&r.useFloat;this.type=t.UNSIGNED_BYTE,i=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,t.bindTexture(t.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===t.FLOAT?(o=new Float32Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.FLOAT,o)):(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,null),this.type=t.UNSIGNED_BYTE)}catch(r){this.type=t.UNSIGNED_BYTE,o=new Uint8Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,o)}if(V=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,V),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,V),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),(s=t.checkFramebufferStatus(t.FRAMEBUFFER))===t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(s===t.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(s!==t.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+s);t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.gl=t,this.frameBuffer=i,this.renderBuffer=V,this.width=e,this.height=n}function Q(t,e,n){var r,i,V,o,s,a,c,u,h="";function l(e,n){var r,i;if(r=n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){for(e=e.split(/[\n\r]/),i=0;i<e.length;i++)e[i]=i+1+":\t"+e[i];throw e.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(e.join("\n")),new Error("Shader error: "+t.getShaderInfoLog(r))}return r}function f(e,n){if(e.type===t.SAMPLER_2D)return function(r){e.glTexture=t["TEXTURE"+r],t.uniform1i(n,r)};if(e.type===t.BOOL||e.type===t.INT)return e.size>1?function(e){t.uniform1iv(n,e)}:function(e){t.uniform1i(n,e)};if(e.type===t.FLOAT)return e.size>1?function(e){t.uniform1fv(n,e)}:function(e){t.uniform1f(n,e)};if(e.type===t.FLOAT_VEC2)return function(e){t.uniform2f(n,e[0],e[1])};if(e.type===t.FLOAT_VEC3)return function(e){t.uniform3f(n,e[0],e[1],e[2])};if(e.type===t.FLOAT_VEC4)return function(e){t.uniform4f(n,e[0],e[1],e[2],e[3])};if(e.type===t.FLOAT_MAT3)return function(e){t.uniformMatrix3fv(n,!1,e)};if(e.type===t.FLOAT_MAT4)return function(e){t.uniformMatrix4fv(n,!1,e)};throw new Error("Unknown shader uniform type: "+e.type)}function d(e){return function(){return t.getUniform(r,e)}}if(i=l(e),V=l(n,!0),r=t.createProgram(),t.attachShader(r,i),(o=t.getShaderInfoLog(i))&&(h+="Vertex shader error: "+o+"\n"),t.attachShader(r,V),(o=t.getShaderInfoLog(V))&&(h+="Fragment shader error: "+o+"\n"),t.linkProgram(r),!t.getProgramParameter(r,t.LINK_STATUS))throw h+=t.getProgramInfoLog(r),t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V),(c=R.exec(e)||R.exec(n))&&(h="Shader = "+c[1]+"\n"+h),E.forEach(function(e){h+="\n"+e+": "+t.getParameter(t[e])}),new Error("Could not initialize shader:\n"+h);for(t.useProgram(r),this.uniforms={},a=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),s=0;s<a;++s)(u={info:t.getActiveUniform(r,s)}).name=u.info.name.replace(/\[0\]$/,""),u.loc=t.getUniformLocation(r,u.name),u.set=f(u.info,u.loc),u.get=d(u.loc),this.uniforms[u.name]=u,this[u.name]||(this[u.name]=u);for(this.attributes={},this.location={},a=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),s=0;s<a;++s)(u={info:t.getActiveAttrib(r,s)}).name=u.info.name,u.location=t.getAttribLocation(r,u.name),this.attributes[u.name]=u,this.location[u.name]=u.location;this.gl=t,this.program=r,this.destroy=function(){var e;for(e in t&&(t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V)),this)this.hasOwnProperty(e)&&delete this[e];r=null,i=null,V=null}}function X(t){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(t);var e,n,r,i,V,s,d,y,w,A,S,x,C,E,k,D=++b,N=this,U=[],B={},z=0,G=[],Z=[],K=[],J=[],tt={},et=[],nt=[],rt={},it={},Vt=!1,ot=!1;function st(t,e){var n,r,i;return!!e&&(n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.STATIC_DRAW),n.size=3,r=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),i=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,t.coords,e.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:t.indices.length,mode:t.mode||e.TRIANGLES})}function at(t){var e={};return e.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),e.indices=new Uint16Array([0,1,2,0,2,3]),e.coords=new Float32Array([0,0,1,0,1,1,0,1]),st(e,t)}function ct(t){var r,o;if(!n)if(t.canvas.addEventListener("webglcontextlost",ht,!1),t.canvas.addEventListener("webglcontextrestored",ut,!1),t.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=t,e=t.canvas,i=at(n),V=new Q(n,"#define SHADER_NAME seriously.base\n"+a,"#define SHADER_NAME seriously.base\n"+c),r=0;r<J.length;r++)(o=J[r]).gl=n,o.initialize(),o.buildShader();for(r=0;r<G.length;r++)(o=G[r]).initialize();for(r=0;r<Z.length;r++)(o=Z[r]).model||(o.model=i,o.shader=V)}}function ut(){var t,e,i,V;if(r&&!n){if(F(e=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(t=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(t.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ct(t),r.renderToTexture?r.frameBuffer=new $(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(V=U[i]).setDirty(),V.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function ht(t){var r,o;for(t&&(X.logger.warn("WebGL context lost"),t.preventDefault()),k&&(P(k),k=0),e&&e.removeEventListener("webglcontextlost",ht,!1),r=0;r<J.length;r++)(o=J[r]).gl=null,o.initialized=!1,o.baseShader=null,o.model=null,o.frameBuffer=null,o.texture=null,o.shader&&o.shader.destroy&&(o.shader.destroy(),o.effect.commonShader&&delete it[o.hook]),o.shaderDirty=!0,o.shader=null,o.effect.lostContext&&o.effect.lostContext.call(o),t&&o.emit("webglcontextlost");for(r=0;r<G.length;r++)(o=G[r]).texture=null,o.initialized=!1,o.allowRefresh=!1,t&&o.emit("webglcontextlost");for(r=0;r<K.length;r++)(o=K[r]).frameBuffer=null,o.texture=null,t&&o.emit("webglcontextlost");for(r=0;r<Z.length;r++)(o=Z[r]).model=!1,o.frameBuffer=null,t&&o.emit("webglcontextlost");V&&V.destroy&&V.destroy(),n&&(n.deleteBuffer(i.vertex),n.deleteBuffer(i.texCoord),n.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,V=null,n=null,e=null}function lt(t){var e,n,r=!1;if(k=0,et.length)for(r=!0,e=0;e<et.length;e++)et[e].call(N,t);if(G&&G.length)for(r=!0,e=0;e<G.length;e++)((n=G[e]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(e=0;e<Z.length;e++)(n=Z[e]).auto&&n.dirty&&n.render();if(nt.length)for(r=!0,e=0;e<nt.length;e++)nt[e].call(N);r&&!k&&(k=O(lt))}function ft(t,e,r,i,V,o){var s,a,c,u,h,l,f,p,g,v=0,m=V&&V.gl||n;if(m){for(s in V?(u=o&&o.width||V.width||m.canvas.width,h=o&&o.height||V.height||m.canvas.height):(u=o&&o.width||m.canvas.width,h=o&&o.height||m.canvas.height),t.use(),m.viewport(0,0,u,h),m.bindFramebuffer(m.FRAMEBUFFER,i),m.enableVertexAttribArray(t.location.position),m.enableVertexAttribArray(t.location.texCoord),e.texCoord&&(m.bindBuffer(m.ARRAY_BUFFER,e.texCoord),m.vertexAttribPointer(t.location.texCoord,e.texCoord.size,m.FLOAT,!1,0,0)),m.bindBuffer(m.ARRAY_BUFFER,e.vertex),m.vertexAttribPointer(t.location.position,e.vertex.size,m.FLOAT,!1,0,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.index),o&&o.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),o?void 0===o.blend||o.blend?(n.enable(n.BLEND),l=void 0===o.srcRGB?n.ONE:o.srcRGB,p=o.dstRGB||n.ZERO,f=void 0===o.srcAlpha?l:o.srcAlpha,g=void 0===o.dstAlpha?p:o.dstAlpha,n.blendFuncSeparate(l,p,f,g),n.blendEquation(o.blendEquation||n.FUNC_ADD)):n.disable(n.BLEND):(n.enable(n.BLEND),n.blendFunc(n.ONE,n.ZERO),n.blendEquation(n.FUNC_ADD)),r)r.hasOwnProperty(s)&&(a=r[s],(c=t.uniforms[s])&&(F(a,"WebGLTexture")?(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a),c.set(v),v++):a instanceof d||a instanceof y||a instanceof w?a.texture&&(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a.texture),c.set(v),v++):null!=a&&c.set(a)));o&&void 0!==o.clear&&!o.clear||(m.clearColor(0,0,0,0),m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT)),m.drawElements(e.mode,e.length,m.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function dt(t,e,n){var r,i;if(("string"!=typeof t||!e&&0!==e)&&(n&&"object"==typeof n||(n=e),e=t),"string"==typeof t&&l[t]||(t=null),e instanceof d||e instanceof y||e instanceof w)r=e;else if(e instanceof S||e instanceof x||e instanceof C){if(!(r=B[e.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),i=0;i<G.length;i++)if(r=G[i],(!t||t===r.hook)&&r.compare&&r.compare(e,n))return r;r=new d(t,e,n)}return r}function pt(t,e){var n,r,i;if(!(t instanceof y||t instanceof w))return!1;if(t===e)return!0;for(n in i=t.sources)if(i.hasOwnProperty(n)&&((r=i[n])===e||pt(r,e)))return!0;return!1}(s=function(){this.ready=!1,this.width=1,this.height=1,this.gl=n,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=z,z++}).prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},s.prototype.setUnready=function(){var t;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setUnready()},s.prototype.setDirty=function(){var t;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setDirty()},s.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,t))},s.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},s.prototype.resize=function(){var t,e;this.source?(t=this.source.width,e=this.source.height):this.sources&&this.sources.source?(t=this.sources.source.width,e=this.sources.source.height):this.inputs&&this.inputs.width?(t=this.inputs.width,e=this.inputs.height||t):this.inputs&&this.inputs.height?t=e=this.inputs.height:(t=1,e=1),t=Math.floor(t),e=Math.floor(e),this.width===t&&this.height===e||(this.width=t,this.height=e,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=e),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,e)},s.prototype.on=function(t,e){var n,r=-1;t&&"function"==typeof e&&((n=this.listeners[t])?r=n.indexOf(e):n=this.listeners[t]=[],r<0&&n.push(e))},s.prototype.off=function(t,e){var n,r=-1;t&&"function"==typeof e&&(n=this.listeners[t])&&(r=n.indexOf(e))>=0&&n.splice(r,1)},s.prototype.emit=function(t){var e,n=this.listeners[t];if(n&&n.length)for(e=0;e<n.length;e++)q(n[e])},s.prototype.destroy=function(){var t,e;for(e in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(e)&&delete this.listeners[e];for(t in this.uniforms)this.uniforms.hasOwnProperty(t)&&delete this.uniforms[t];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(t=U.indexOf(this))>=0&&U.splice(t,1),delete B[this.id],this.isDestroyed=!0},S=function(t){var e,n=t;function r(t,e){var r,i,V;return V=n.effect.inputs[t],r=n.inputElements[t],"string"==typeof e&&isNaN(e)&&("enum"===V.type?V.options.hasOwnProperty(e)||(e=j(e,["select"])):"number"===V.type||"boolean"===V.type?e=j(e,["input","select"]):"image"===V.type&&(e=j(e,["canvas","img","video"]))),F(e,"HTMLInputElement")||F(e,"HTMLSelectElement")?(i=e.value,r&&r.element!==e&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t],r=null),r||(r={element:e,listener:function(t,r){return function(){var i,o;i="checkbox"===e.type?e.checked:r.value,o=n.setInput(t,i),"color"===V.type&&(o=W(o).substr(0,7)),o!==i&&(r.value=o)}}(t,e)},n.inputElements[t]=r,"range"===e.type?(e.addEventListener("input",r.listener,!0),e.addEventListener("change",r.listener,!0)):e.addEventListener("change",r.listener,!0)),r&&"checkbox"===e.type&&(i=e.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t]),i=e),n.setInput(t,i),n.inputs[t]}function i(t){return function(e){var n=r(t,e);return n&&n.pub}}function V(t){return function(){var e=n.inputs[t];return e&&e.pub}}function o(t){return function(e){return r(t,e)}}function s(t){return function(){return n.inputs[t]}}for(e in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(e)){if(void 0!==this[e])throw new Error("Cannot overwrite Seriously."+e);"image"===n.effect.inputs[e].type?Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:V(e),set:i(e)}):Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:s(e),set:o(e)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.effect.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}}}),this.render=function(){return n.render(),this},this.readPixels=function(t,e,r,i,V){return n.readPixels(t,e,r,i,V)},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.inputs=function(t){var e,r,i,V;if(i=n.effect.inputs,t)return(r=i[t])?(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e):null;for(V in e={},i)i.hasOwnProperty(V)&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.matte=function(t){n.matte(t)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(y=function(t,e){var r,i,V,a,c={};for(r in s.call(this,e),this.gl=n,this.effectRef=u[t],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=t,this.options=e,this.transform=null,this.effect=L({},this.effectRef),this.effectRef.definition&&L(this.effect,this.effectRef.definition.call(this,e)),Y(this.effect),this.uniforms.transform=o,this.inputs={},a=rt[t],this.effect.inputs)this.effect.inputs.hasOwnProperty(r)&&(void 0!==(i=this.effect.inputs[r]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),V=i.validate.call(this,i.defaultValue,i),a&&void 0!==a[r]&&(V=i.validate.call(this,a[r],i,i.defaultValue,V),a[r]=V,"image"===i.type&&(c[r]=V)),this.inputs[r]=V,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(r in n&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new S(this),U.push(this),B[this.id]=this,J.push(this),p[t].push(this),c)c.hasOwnProperty(r)&&this.setInput(r,c[r])}).prototype=Object.create(s.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var t=this;this.baseShader=V,this.shape?this.model=st(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,function(){t.initFrameBuffer(!0)},n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize()},y.prototype.updateReady=function(){var t,e,n,r,i=!0;for(e in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(e)&&"image"===this.effect.inputs[e].type&&(!this.sources[e]||!this.sources[e].ready)&&(!n.requires||n.requires.call(this,e,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(t=0;t<this.targets.length;t++)this.targets[t][r]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},y.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},y.prototype.removeSource=function(t){var e,n=t&&t.pub;for(e in this.inputs)!this.inputs.hasOwnProperty(e)||this.inputs[e]!==t&&this.inputs[e]!==n||(this.inputs[e]=null);for(e in this.sources)!this.sources.hasOwnProperty(e)||this.sources[e]!==t&&this.sources[e]!==n||(this.sources[e]=null)},y.prototype.buildShader=function(){var t,e=this.effect,r=this;function i(t){return R.test(t)?t:"#define SHADER_NAME seriously."+r.hook+"\n"+t}this.shaderDirty&&(e.commonShader&&it[this.hook]?(this.shader||it[this.hook].count++,this.shader=it[this.hook].shader):e.shader?(this.shader&&!e.commonShader&&this.shader.destroy(),(t=e.shader.call(this,this.inputs,{vertex:a,fragment:c},X.util))instanceof Q?this.shader=t:t&&t.vertex&&t.fragment?this.shader=new Q(n,i(t.vertex),i(t.fragment)):this.shader=V,e.commonShader&&(it[this.hook]={count:1,shader:this.shader})):this.shader=V,this.shaderDirty=!1)},y.prototype.render=function(){var t,e,r,i=this.effect,V=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(t in this.sources)!this.sources.hasOwnProperty(t)||i.requires&&!i.requires.call(this,t,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(t):this.inPlace,this.sources[t].render(!r));this.frameBuffer&&(e=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,e,function(t,e,n,r,i,o){ft(t,e,n,r,i||V,o)}),this.emit("render")):e&&(ft(this.shader,this.model,this.uniforms,e,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(t,e){var n,r,i,V,s,a=this;if(this.effect.inputs.hasOwnProperty(t)){if("image"===(n=this.effect.inputs[t]).type){if(e){if((e=dt(e))!==this.sources[t]){if(function(){var e,n=a.sources[t];if(n){for(e in a.sources)if(e!==t&&a.sources.hasOwnProperty(e)&&a.sources[e]===n)return;n.removeTarget(a)}}(),pt(e,this))throw new Error("Attempt to make cyclical connection.");this.sources[t]=e,e.addTarget(this)}}else delete this.sources[t],e=!1;r=this.sources[t],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(V=this.sources[i[0]],this.uniforms.transform=V&&V.cumulativeMatrix||o):this.uniforms.transform=o}else s=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,r=e=n.validate.call(this,e,n,s,this.inputs[t]);return this.inputs[t]===e&&"color"!==n.type&&"vector"!==n.type?e:(this.inputs[t]=e,n.uniform&&(this.uniforms[n.uniform]=r),"image"===n.type?(this.resize(),this.updateReady()):n.updateSources&&this.updateReady(),n.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),n.update&&n.update.call(this,e),e)}},y.prototype.alias=function(t,e){var n=this;if(I.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),tt[e]={node:this,input:t},Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return n.inputs[t]},set:function(e){return n.setInput(t,e)}})),this},y.prototype.matte=function(t){var e,n,r,i,V,o,s,a=[],c=[],u={};function h(t){var e,n,r,i,V,o,s,u,h,l,f,d=[];if(!t.simple){for(e=0;e<t.edges.length;e++)for(r=t.edges[e],n=e+1;n<t.edges.length;n++)i=t.edges[n],p=r[0],g=r[1],v=i[0],y=i[1],m=void 0,b=void 0,_=void 0,w=void 0,A=void 0,m=(y.x-v.x)*(p.y-v.y)-(y.y-v.y)*(p.x-v.x),b=(g.x-p.x)*(p.y-v.y)-(g.y-p.y)*(p.x-v.x),(V=!!((_=(y.y-v.y)*(g.x-p.x)-(y.x-v.x)*(g.y-p.y))&&(A=b/_,(w=m/_)>0&&w<=1&&A>0&&A<=1))&&{x:p.x+w*(g.x-p.x),y:p.y+w*(g.y-p.y)})&&(V.edge1=r,V.edge2=i,d.push(V));var p,g,v,y,m,b,_,w,A;if(d.length){for(h=[],e=0;e<d.length;e++)r=(V=d[e]).edge1,i=V.edge2,l={x:V.x,y:V.y,prev:r[0],next:i[1],id:c.length},t.vertices.push(l),c.push(l),f={x:V.x,y:V.y,prev:i[0],next:r[1],id:c.length},t.vertices.push(f),c.push(l),l.prev.next=l,l.next.prev=l,f.prev.next=f,f.next.prev=f;do{o={edges:[],vertices:[],simple:!0},h.push(o),s=u=t.vertices[0];do{e=t.vertices.indexOf(u),t.vertices.splice(e,1),o.edges.push([u,u.next]),o.vertices.push(u),u=u.next}while(u!==s)}while(t.vertices.length);for(e=a.indexOf(t),a.splice(e,1),e=0;e<h.length;e++)a.push(h[e])}else t.simple=!0}}function l(t){var e,n,r,i,V=t.vertices.length,o=0;for(e=V-1,n=0;n<V;e=n,n++)r=t.vertices[e],i=t.vertices[n],o+=r.x*i.y-i.x*r.y;return o>0}function f(t){var e,r,i,V,o,s,a,c,u,h,l,f=t.vertices,d=[],p=[];function g(t,e,n,r){var i,V,o,s,a,c,u,h,l,f,d,p;return i=n.x-e.x,V=n.y-e.y,o=t.x-n.x,s=t.y-n.y,a=e.x-t.x,c=e.y-t.y,u=r.x-t.x,h=r.y-t.y,l=r.x-e.x,f=r.y-e.y,d=r.x-n.x,p=r.y-n.y,i*f-V*l>=0&&o*p-s*d>=0&&a*h-c*u>=0}function v(t,e,n,r,i){var V,o,s,a;if(o=f[i[t]],s=f[i[e]],a=f[i[n]],0>(s.x-o.x)*(a.y-o.y)-(s.y-o.y)*(a.x-o.x))return!1;for(V=0;V<r;V++)if(V!==t&&V!==e&&V!==n&&g(o,s,a,f[i[V]]))return!1;return!0}if(r=f.length,t.clockWise)for(e=0;e<r;e++)d[e]=e;else for(e=0;e<r;e++)d[e]=r-1-e;for(V=2*(i=r),e=i-1;i>2;){if(V--<=0)return p;if(i<=(o=e)&&(o=0),i<=(e=o+1)&&(e=0),i<(s=e+1)&&(s=0),v(o,e,s,i,d)){for(a=d[o],c=d[e],u=d[s],t.clockWise?(p.push(f[a]),p.push(f[c]),p.push(f[u])):(p.push(f[u]),p.push(f[c]),p.push(f[a])),h=e,l=e+1;l<i;h++,l++)d[h]=d[l];V=2*--i}}n.indices=p}for(e=function(t){return t&&t.length&&Array.isArray(t)?Array.isArray(t[0])?Array.isArray(t[0])&&!isNaN(t[0][0])?[t]:t:[t]:[]}(t),r=0;r<e.length;r++){for(t=e[r],s=null,n={vertices:[],edges:[]},i=0;i<t.length;i++)"object"!=typeof(V=t[i])||isNaN(V.x)||isNaN(V.y)?V.length>=2&&!isNaN(V[0])&&!isNaN(V[1])&&(o={x:V[0],y:V[1],id:c.length}):o={x:V.x,y:V.y,id:c.length},o&&(s?(s.next=o,o.prev=s,o.next=n.vertices[0],n.vertices[0].prev=o):(n.head=o,o.next=o,o.prev=o),c.push(o),n.vertices.push(o),s=o);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),a.push(n),i=0;i<n.vertices.length;i++)o=n.vertices[i],n.edges.push([o,o.next])}for(r=a.length-1;r>=0;r--)h(n=a[r]);for(r=0;r<a.length;r++)(n=a[r]).clockWise=l(n),f(n);for(u.vertices=[],u.coords=[],r=0;r<c.length;r++)V=c[r],u.vertices.push(2*V.x-1),u.vertices.push(-2*V.y+1),u.vertices.push(-1),u.coords.push(V.x),u.coords.push(-1*V.y+1);for(u.vertices=new Float32Array(u.vertices),u.coords=new Float32Array(u.coords),u.indices=[],r=0;r<a.length;r++)for(n=a[r],i=0;i<n.indices.length;i++)V=n.indices[i],u.indices.push(V.id);u.indices=new Uint16Array(u.indices),this.shape=u,this.gl&&st(u,this.gl)},y.prototype.destroy=function(){var t,e,n,r=this.hook;for(e in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,it[r]&&(it[r].count--,it[r].count||delete it[r]),this.shader&&this.shader.destroy&&this.shader!==V&&!it[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(e)&&((n=this.inputElements[e]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(e in this.sources)this.sources.hasOwnProperty(e)&&((n=this.sources[e])&&n.removeTarget&&n.removeTarget(this),delete this.sources[e]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=J.indexOf(this))>=0&&J.splice(t,1),(t=p[r].indexOf(this))>=0&&p[r].splice(t,1),s.prototype.destroy.call(this)},x=function(t){var e=t;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return e.source}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}},width:{enumerable:!0,configurable:!0,get:function(){return e.width}},height:{enumerable:!0,configurable:!0,get:function(){return e.height}}}),this.render=function(){e.render()},this.update=function(){e.setDirty()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},(d=function(t,e,r){var i,V,o=r||{},a=void 0===o.flip||o.flip,c=o.width,u=o.height,h=!1,f=this,d=!1;function p(t,e,n,r){var i=l[t];if(i.definition){if(!(i=i.definition.call(f,e,n,r)))return null;i=L(L({},l[t]),i)}return i}function g(t){return f.source===t}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(r&&"object"==typeof r||(r=e),e=t),"string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),"string"==typeof t&&l[t]&&(V=p(t,e,r,!0))&&(this.hook=t,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source)),!V&&F(e))"CANVAS"===e.tagName?(this.width=e.width,this.height=e.height,this.render=this.renderImageCanvas,d=!0,this.hook="canvas",this.compare=g):"IMG"===e.tagName&&(this.width=e.naturalWidth||1,this.height=e.naturalHeight||1,e.complete&&e.naturalWidth||(h=!0),e.addEventListener("load",function(){f.isDestroyed||(f.width===e.naturalWidth&&f.height===e.naturalHeight||(f.width=e.naturalWidth,f.height=e.naturalHeight,f.resize()),f.setDirty(),f.setReady())},!0),this.render=this.renderImageCanvas,d=!0,this.hook="image",this.compare=g);else if(!V&&F(e,"WebGLTexture")){if(n&&!n.isTexture(e))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(u)||(c=u):isNaN(u)&&(u=c),this.width=c,this.height=u,void 0===o.flip&&(a=!1),d=!0,this.texture=e,this.initialized=!0,this.hook="texture",this.compare=g,this.render=function(){}}if(!d&&!V)for(i in l)if(l.hasOwnProperty(i)&&l[i]&&(V=p(i,e,r,!1))){this.hook=i,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source);break}if(!d)throw new Error("Unknown source type");this.source=e,void 0===this.flip&&(this.flip=a),this.targets=[],h||f.setReady(),this.pub=new x(this),U.push(this),B[this.id]=this,G.push(this),v[this.hook].push(this),G.length&&!k&&lt()}).prototype=Object.create(s.prototype),d.prototype.constructor=d,d.prototype.initialize=function(){var t;n&&!this.texture&&this.ready&&(t=n.createTexture(),n.bindTexture(n.TEXTURE_2D,t),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this.texture=t,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},d.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,{texture:this.texture,useFloat:t}))},d.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},d.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},d.prototype.resize=function(){var t,e;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(t=0;t<this.targets.length;t++)(e=this.targets[t]).resize(),e.setTransformDirty&&e.setTransformDirty()},d.prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},d.prototype.render=function(){var t=this.source;n&&(t||0===t)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,n,ft,i,V)&&(this.dirty=!1,this.emit("render")))},d.prototype.renderImageCanvas=function(){var t=this.source;if(n&&t&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.dirty=!1,this.emit("render"),!0}catch(t){t.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},d.prototype.destroy=function(){var t,e,r;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),n&&this.texture&&n.deleteTexture(this.texture);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(e in(t=G.indexOf(this))>=0&&G.splice(t,1),(t=v[this.hook].indexOf(this))>=0&&v[this.hook].splice(t,1),this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];s.prototype.destroy.call(this)},E=function(t){var e=t;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(e.source)return e.source.pub},set:function(t){e.setSource(t)}},original:{enumerable:!0,configurable:!0,get:function(){return e.target}},width:{enumerable:!0,configurable:!0,get:function(){return e.width},set:function(t){!isNaN(t)&&t>0&&e.width!==t&&(e.width=t,e.resize(),e.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return e.height},set:function(t){!isNaN(t)&&t>0&&e.height!==t&&(e.height=t,e.resize(),e.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}}}),this.render=function(){e.render()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.go=function(t){e.go(t)},this.stop=function(){e.stop()},this.getTexture=function(){return e.frameBuffer.texture},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.inputs=function(t){return{source:{type:"image"}}},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},((A=function(t,e,o){var u,h,l,d,p,g,v,y,b,w=this,A=!1;function S(t,e,r,o){var s=f[t];if(s.definition){if(!(s=s.definition.call(w,e,r,o)))return null;s=L(L({},f[t]),s),w.hook=b,A=!0,w.plugin=s,w.compare=s.compare,s.target&&(e=s.target),s.gl&&!w.gl&&(w.gl=s.gl,n||ct(s.gl)),w.gl===n&&(w.model=i,w.shader=V)}return s}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(o&&"object"==typeof o||(o=e),e=t),h=void 0===(u=o||{}).flip||u.flip,l=parseInt(u.width,10),d=parseInt(u.height,10),g=u.debugContext,"string"==typeof t&&f[t]&&S(t,e,u,!0),this.renderToTexture=u.renderToTexture,F(e,"WebGLFramebuffer"))if(v=e,F(u,"HTMLCanvasElement"))e=u;else if(F(u,"WebGLRenderingContext"))e=u.canvas;else if(F(u.canvas,"HTMLCanvasElement"))e=u.canvas;else{if(!F(u.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");e=u.context.canvas}if(F(e,"HTMLCanvasElement")){if(l=e.width,d=e.height,(!n||n.canvas!==e&&u.allowSecondaryWebGL)&&(p=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:g})),p)n&&n!==p?(this.gl=p,this.frameBuffer={frameBuffer:v||null},this.shader=new Q(this.gl,a,c),this.model=at.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(n.TEXTURE_2D,this.texture),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(r||(r=this),n||ct(p),this.render=this.renderWebGL,u.renderToTexture?n&&(this.frameBuffer=new $(n,l,d,!1)):this.frameBuffer={frameBuffer:v||null});else{if(!u.allowSecondaryWebGL&&n&&n.canvas!==e)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=_,X.logger.log("Unable to create WebGL context.")}A=!0}if(!A)for(b in f)if(f.hasOwnProperty(b)&&f[b]&&S(b,e,u,!1))break;if(!A)throw new Error("Unknown target type");m&&((y=m.get(e))?X.logger.warn("Target already in use by another instance",e,Object.keys(y).map(function(t){return y[t]})):(y={},m.set(e,y)),y[N.id]=N),this.target=e,this.transform=null,this.transformDirty=!0,this.flip=h,l&&(this.width=l),d&&(this.height=d),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==u.auto?this.auto=u.auto:this.auto=Vt,this.frames=0,this.pub=new E(this),U.push(this),B[this.id]=this,Z.push(this)}).prototype=Object.create(s.prototype)).constructor=A,A.prototype.setSource=function(t){var e;(e=dt(t))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&(this.resize(),e.ready?this.setReady():this.setUnready()),this.setDirty())},A.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=O(lt))},A.prototype.resize=function(){F(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},A.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},A.prototype.go=function(){this.auto=!0,this.setDirty()},A.prototype.stop=function(){this.auto=!1},A.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,ft,V,i)},A.prototype.renderWebGL=function(){var t,e,r;if(this.resize(),n&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||o:this.transformDirty&&(t=this.transform,M.copy(t,this.source.cumulativeMatrix||o),e=this.source.width/this.width,r=this.source.height/this.height,t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=r,t[5]*=r,t[6]*=r,t[7]*=r,this.uniforms.transform=t,this.transformDirty=!1),ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this,T),this.emit("render"),this.dirty=!1}},A.prototype.renderSecondaryWebGL=function(){var t,e,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),t=this.source.width,e=this.source.height,this.pixels&&this.pixels.length===t*e*4||(this.pixels=new Uint8Array(t*e*4)),this.source.readPixels(0,0,t,e,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),t===this.width&&e===this.height?this.uniforms.transform=o:this.transformDirty&&(n=this.transform,M.copy(n,o),r=this.source.width/this.width,i=this.source.height/this.height,n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r,n[4]*=i,n[5]*=i,n[6]*=i,n[7]*=i,this.uniforms.transform=n,this.transformDirty=!1),this.uniforms.source=this.texture,ft(this.shader,this.model,this.uniforms,null,this,T),this.dirty=!1)},A.prototype.removeSource=function(t){this.source!==t&&this.source!==t.pub||(this.source=null)},A.prototype.destroy=function(){var t,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),m&&(delete(n=m.get(this.target))[N.id],Object.keys(n).length||m.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(t=Z.indexOf(this))>=0&&Z.splice(t,1),s.prototype.destroy.call(this),this===r&&(e.removeEventListener("webglcontextrestored",ut,!1),ht(),r=null)},C=function(t){var e,n=t,r=this;function i(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e.get.call(n)},set:function(r){!function(t,e,r){var i,V,o;i=n.inputElements[t],"string"==typeof r&&isNaN(r)&&("enum"===e.type?e.options.hasOwnProperty(r)||(r=j(r,["select"])):"number"===e.type||"boolean"===e.type?r=j(r,["input","select"]):"image"===e.type&&(r=j(r,["canvas","img","video"]))),F(r,"HTMLInputElement")||F(r,"HTMLSelectElement")?(V=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t],i=null),i||(i={element:r,listener:(o=r,function(){var e,i;e="checkbox"===r.type?r.checked:o.value,i=n.setInput(t,e),"color"===r.type&&(i=W(i)),i!==e&&(o.value=i)})},n.inputElements[t]=i,"range"===r.type?(r.addEventListener("input",i.listener,!0),r.addEventListener("change",i.listener,!0)):r.addEventListener("change",i.listener,!0)),i&&"checkbox"===r.type&&(V=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t]),V=r),n.setInput(t,V)}(t,e,r)}})}function V(t){return function(){t.apply(n,arguments)&&n.setTransformDirty()}}for(e in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.plugin.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}},source:{enumerable:!0,configurable:!0,get:function(){return n.source&&n.source.pub},set:function(t){n.setSource(t)}}}),n.methods)n.methods.hasOwnProperty(e)&&(this[e]=V(n.methods[e]));for(e in n.inputs)n.inputs.hasOwnProperty(e)&&i(e,n.inputs[e]);this.update=function(){n.setDirty()},this.inputs=function(t){var e,r,i,V;if(i=n.plugin.inputs,t)return!(r=i[t])||r.method?null:(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e);for(V in e={},i)i.hasOwnProperty(V)&&!i[V].method&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(w=function(t,e){var n,r,i,V,o;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=h[t],this.hook=t,this.id=z,z++,this.options=e,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=L({},this.transformRef),this.transformRef.definition&&L(this.plugin,this.transformRef.definition.call(this,e)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&((r=this.plugin.inputs[n]).method&&"function"==typeof r.method?this.methods[n]=r.method:"function"==typeof r.set&&"function"==typeof r.get&&(this.inputs[n]=r));for(n in Y(this.plugin),o=rt[t],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&"function"==typeof(r=this.plugin.inputs[n]).set&&"function"==typeof r.get&&"function"!=typeof r.method&&(i=r.get.call(this),V=void 0===r.defaultValue?i:r.defaultValue,V=r.validate.call(this,V,r,i),o&&void 0!==o[n]&&(V=r.validate.call(this,o[n],r,r.defaultValue,V),o[n]=V),V!==i&&r.set.call(this,V));U.push(this),B[this.id]=this,this.pub=new C(this),K.push(this),g[t].push(this)}).prototype=Object.create(s.prototype),w.prototype.constructor=w,w.prototype.setDirty=function(){this.renderDirty=!0,s.prototype.setDirty.call(this)},w.prototype.setTransformDirty=function(){var t,e;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,t=0;t<this.targets.length;t++)(e=this.targets[t]).setTransformDirty?e.setTransformDirty():e.setDirty()},w.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty()},w.prototype.setSource=function(t){var e;if((e=dt(t))!==this.source){if(pt(e,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&e.ready?this.setReady():this.setUnready(),this.resize()}},w.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},w.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1),this.targets&&this.targets.length&&this.resize()},w.prototype.setInput=function(t,e){var n,r,i;if(this.plugin.inputs.hasOwnProperty(t))return n=this.plugin.inputs[t],r=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),e=n.validate.call(this,e,n,r,i),n.set.call(this,e)&&this.setTransformDirty(),n.get.call(this)},w.prototype.alias=function(t,e){var n,r,i=this;if(I.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),(n=this.inputs[t])?(r=i.inputs[t],Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(t){r.set.call(i,t)&&i.setTransformDirty()}})):(n=this.methods[t])&&(r=n,N[e]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(tt[e]={node:this,input:t})),this},w.prototype.render=function(t){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||o),this.transformDirty=!1),t&&n?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new $(n,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||o,ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},w.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},w.prototype.destroy=function(){var t,e,n,r=this.hook;for(t in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=K.indexOf(this))>=0&&K.splice(t,1),(t=g[r].indexOf(this))>=0&&g[r].splice(t,1),s.prototype.destroy.call(this)},w.prototype.setReady=s.prototype.setReady,w.prototype.setUnready=s.prototype.setUnready,w.prototype.on=s.prototype.on,w.prototype.off=s.prototype.off,w.prototype.emit=s.prototype.emit,(t=F(t,"HTMLCanvasElement")?{canvas:t}:t||{}).canvas,this.effect=function(t,e){if(!u[t])throw new Error("Unknown effect: "+t);return new y(t,e).pub},this.source=function(t,e,n){return dt(t,e,n).pub},this.transform=function(e,n){if("string"!=typeof e&&(n=e,e=!1),e){if(!h[e])throw new Error("Unknown transform: "+e)}else if(e=t&&t.defaultTransform||"2d",!h[e])throw new Error("No transform specified");return new w(e,n).pub},this.target=function(t,e,n){var r,i,V;for(t&&"string"==typeof t&&!f[t]&&(i=document.querySelector(t)),("string"!=typeof t||!e&&0!==e||i)&&(n&&"object"==typeof n||(n=e),e=i||t,t=null),"string"==typeof e&&isNaN(e)&&(e=document.querySelector(e)),V=0;V<Z.length;V++)if(r=Z[V],(!t||t===r.hook)&&(r.target===e||r.compare&&r.compare(e,n)))return r.pub;return(r=new A(t,e,n)).pub},this.aliases=function(){return Object.keys(tt)},this.removeAlias=function(t){tt[t]&&(delete this[t],delete tt[t])},this.defaults=function(t,e){var n;if(t)if("object"!=typeof t)null===e?delete rt[t]:"object"==typeof e&&(rt[t]=L({},e));else for(n in t)t.hasOwnProperty(n)&&this.defaults(n,t[n]);else if(null===t)for(n in rt)rt.hasOwnProperty(n)&&delete rt[n]},this.go=function(t,e){var n;for("function"==typeof t&&et.indexOf(t)<0&&et.push(t),"function"==typeof e&&nt.indexOf(e)<0&&nt.push(e),Vt=!0,n=0;n<Z.length;n++)Z[n].go();k||!et.length&&!nt.length||lt()},this.stop=function(){et.length=0,nt.length=0,P(k),k=0},this.render=function(){var e;for(e=0;e<Z.length;e++)Z[e].render(t)},this.destroy=function(){for(var t,e;U.length;)U[0].pub.destroy();for(t in this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_);N=null,G=[],Z=[],J=[],U=[],et.length=0,nt.length=0,P(k),k=0,ot=!0},this.isDestroyed=function(){return ot},this.incompatible=function(t){var e,n,r;if(r=X.incompatible(t))return r;if(!t){for(e in p)if(p.hasOwnProperty(e)&&p[e].length&&(n=u[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+e;for(e in v)if(v.hasOwnProperty(e)&&v[e].length&&(n=l[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+e}return!1},this.isNode=function(t){var e;return!(!t||!(e=B[t.id])||e.isDestroyed)},this.isSource=function(t){return this.isNode(t)&&t instanceof x},this.isEffect=function(t){return this.isNode(t)&&t instanceof S},this.isTransform=function(t){return this.isNode(t)&&t instanceof C},this.isTarget=function(t){return this.isNode(t)&&t instanceof E},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return D}}}),this.defaults(t.defaults)}window.addEventListener("message",function(t){t.source===window&&"seriously-timeout-message"===t.data&&(t.stopPropagation(),d.length>0&&d.shift()())},!0),$.prototype.resize=function(t,e){var n=this.gl;this.width===t&&this.height===e||(this.width=t,this.height=e,n&&(n.bindTexture(n.TEXTURE_2D,this.texture),n.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,this.renderBuffer),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t,e,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.texture,0),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null)))},$.prototype.destroy=function(){var t=this.gl;t&&(t.deleteFramebuffer(this.frameBuffer),t.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&t.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},Q.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(t){var e,n,r;if(void 0===V&&((e=document.createElement("canvas"))&&e.getContext?window.WebGLRenderingContext?(n=G())||(V="context"):V="webgl":V="canvas"),V)return V;if(t){if((r=u[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+t;if((r=l[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+t}return!1},X.plugin=function(t,e,n){var r;if(u[t])X.logger.warn("Effect ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=k,r.inputs&&Y(r),r.title||(r.title=t),u[t]=r,p[t]=[],r},X.removePlugin=function(t){var e;if(!t)return this;if(!u[t])return this;if(e=p[t]){for(;e.length;)e.shift().destroy();delete p[t]}return delete u[t],this},X.source=function(t,e,n){var r;if(l[t])X.logger.warn("Source ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),l[t]=r,v[t]=[],r},X.removeSource=function(t){var e;if(!t)return this;if(!l[t])return this;if(e=v[t]){for(;e.length;)e.shift().destroy();delete v[t]}return delete l[t],this},X.transform=function(t,e,n){var r;if(h[t])X.logger.warn("Transform ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=D,r.inputs&&Y(r),r.title||(r.title=t),h[t]=r,g[t]=[],r},X.removeTransform=function(t){var e;if(!t)return this;if(!h[t])return this;if(e=g[t]){for(;e.length;)e.shift().destroy();delete g[t]}return delete h[t],this},X.target=function(t,e,n){var r;if(f[t])X.logger.warn("Target ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),f[t]=r,y[t]=[],r},X.removeTarget=function(t){var e;if(!t)return this;if(!f[t])return this;if(e=y[t]){for(;e.length;)e.shift().destroy();delete y[t]}return delete f[t],this},X.inputValidators={color:function(t,e,n,r){var V,o,s,a;if(o=r||[],"string"==typeof t){if((s=A.exec(t))&&s.length){if(s.length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(o[3]=1,a=0;a<3;a++)o[a]=parseFloat(s[a+2])/255;return isNaN(s[6])||(o[3]=parseFloat(s[6])),"hsl"===s[1].toLowerCase()?B(o[0],o[1],o[2],o[3],o):o}if((s=S.exec(t))&&s.length)return 3===(V=s[1]).length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=1):4===V.length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=parseInt(V[3],16)/15):6===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=1):8===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=parseInt(V.substr(6,2),16)/255):o[0]=o[1]=o[2]=o[3]=0,o;if(s=w[t.toLowerCase()]){for(a=0;a<4;a++)o[a]=s[a];return o}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=t,(V=i.fillStyle)&&"#000000"!==V?X.inputValidators.color(V,e,n,r):(o[0]=o[1]=o[2]=o[3]=0,o)}if(z(t)){if((o=t).length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(a=0;a<3;a++)if(isNaN(o[a]))return o[0]=o[1]=o[2]=o[3]=0,o;return o.length<4&&o.push(1),o}if("number"==typeof t)return o[0]=o[1]=o[2]=t,o[3]=1,o;if("object"==typeof t){for(a=0;a<4;a++)null===t[V=C[a]]||isNaN(t[V])?o[a]=3===a?1:0:o[a]=t[V];return o}return o[0]=o[1]=o[2]=o[3]=0,o},number:function(t,e,n){return t=parseFloat(t),isNaN(t)?n||0:(e.mod&&(t-=e.mod*Math.floor(t/e.mod)),t<e.min?e.min:t>e.max?e.max:e.step?Math.round(t/e.step)*e.step:t)},enum:function(t,e,n){var r=e.options||[];return"string"==typeof t?t=t.toLowerCase():"number"==typeof t?t=t.toString():t||(t=""),r.hasOwnProperty(t)?t:n||""},vector:function(t,e,n,r){var i,V,o,s=e.dimensions||4;if(i=r||[],z(t)){for(V=0;V<s;V++)i[V]=t[V]||0;return i}if("object"==typeof t){for(V=0;V<s;V++)void 0===t[o=x[V]]&&(o=C[V]),i[V]=t[o]||0;return i}for(t=parseFloat(t)||0,V=0;V<s;V++)i[V]=t;return i},boolean:function(t){return!!t&&(!t||!t.toLowerCase||"false"!==t.toLowerCase())},string:function(t){return"string"==typeof t?t:0===t||t?t.toString?t.toString():String(t):""}},X.prototype.effects=X.effects=function(){var t,e,n,r,i,V={};for(t in u)if(u.hasOwnProperty(t)){for(i in n={title:(e=u[t]).title||t,description:e.description||"",inputs:{}},e.inputs)e.inputs.hasOwnProperty(i)&&(r=e.inputs[i],n.inputs[i]={type:r.type,defaultValue:r.defaultValue,step:r.step,min:r.min,max:r.max,mod:r.mod,minCount:r.minCount,maxCount:r.maxCount,dimensions:r.dimensions,title:r.title||i,description:r.description||"",options:r.options||[]});V[t]=n}return V},window.Float32Array&&(o=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var t;for(t in window.Seriously)window.Seriously.hasOwnProperty(t)&&"plugin"!==t&&"object"==typeof window.Seriously[t]&&X.plugin(t,window.Seriously[t])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(t){var e,n,r,i;if(!(e=j(t,["img","canvas","video"])))return!1;if(!(n=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===e.naturalWidth&&"IMG"===e.tagName)return X.logger.warn("Image not loaded"),!1;if(0===e.readyState&&0===e.videoWidth&&"VIDEO"===e.tagName)return X.logger.warn("Video not loaded"),!1;if(r=G()){(i=r.createTexture())||X.logger.error("Test WebGL context has been lost"),r.bindTexture(r.TEXTURE_2D,i);try{r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+t.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(e,0,0),r.getImageData(0,0,1,1)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+t.message),!1}}return!0},hslToRgb:B,colors:w,setTimeoutZero:q,ShaderProgram:Q,FrameBuffer:$,requestAnimationFrame:O,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",function(t,e,n){var r,i,V=this,o=!1,a=!1,c=!1,u=0;function h(){t.removeEventListener("loadedmetadata",h,!0),o||(t.videoWidth?(V.width===t.videoWidth&&V.height===t.videoHeight||(V.width=t.videoWidth,V.height=t.videoHeight,V.resize()),a&&V.setReady()):(a=!0,setTimeout(h,50)))}function l(){c=!0}function f(){c=!1,V.setDirty()}if(F(t,"HTMLVideoElement"))return t.readyState?h():(a=!0,t.addEventListener("loadedmetadata",h,!0)),t.addEventListener("seeking",l,!1),t.addEventListener("seeked",f,!1),{deferTexture:a,source:t,render:function e(n){var o;if(u=t.currentTime,!t.videoHeight||!t.videoWidth)return!1;s?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=V.width,r.height=V.height),o=r,i.drawImage(t,0,0,V.width,V.height)):o=t,n.bindTexture(n.TEXTURE_2D,V.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,V.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,o),void 0===s){if(n.getError()===n.INVALID_VALUE)return s=!0,e(n);s=!1}return!0}catch(t){t.code===window.DOMException.SECURITY_ERR?(V.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",t)}return!1},checkDirty:function(){return!c&&t.currentTime!==u},compare:function(t){return V.source===t},destroy:function(){o=!0,t.removeEventListener("seeking",l,!1),t.removeEventListener("seeked",f,!1),t.removeEventListener("loadedmetadata",h,!0)}}},{title:"Video"}),X.transform("2d",function(t){var e=this,n=!(t&&t.radians),r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0;function l(){var t,l,f,d,p,g,v,y,m,b,_,w=e.matrix;function A(t,e){w[12]=w[0]*t+w[4]*e+w[12],w[13]=w[1]*t+w[5]*e+w[13],w[14]=w[2]*t+w[6]*e+w[14],w[15]=w[3]*t+w[7]*e+w[15]}s||a||c||u||h||1!==V||1!==o?(M.identity(w),A(s+r,a+i),u&&(w[4]=u/e.width),h&&(w[1]=h/e.height),c&&(d=w[0],p=w[1],g=w[2],v=w[3],y=w[4],m=w[5],b=w[6],_=w[7],t=-(n?c*Math.PI/180:c),l=Math.sin(t),f=Math.cos(t),w[0]=d*f+y*l,w[1]=p*f+m*l,w[2]=g*f+b*l,w[3]=v*f+_*l,w[4]=y*f-d*l,w[5]=m*f-p*l,w[6]=b*f-g*l,w[7]=_*f-v*l),1!==V&&(w[0]*=V,w[1]*=V,w[2]*=V,w[3]*=V),1!==o&&(w[4]*=o,w[5]*=o,w[6]*=o,w[7]*=o),A(-r,-i),e.transformed=!0):e.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0,!!e.transformed&&(e.transformed=!1,!0)}},translate:{method:function(t,e){return isNaN(t)&&(t=s),isNaN(e)&&(e=a),(t!==s||e!==a)&&(s=t,a=e,l(),!0)},type:["number","number"]},translateX:{get:function(){return s},set:function(t){return t!==s&&(s=t,l(),!0)},type:"number"},translateY:{get:function(){return a},set:function(t){return t!==a&&(a=t,l(),!0)},type:"number"},rotation:{get:function(){return c},set:function(t){return t!==c&&(c=parseFloat(t),l(),!0)},type:"number"},center:{method:function(t,e){return isNaN(t)&&(t=r),isNaN(e)&&(e=i),(t!==r||e!==i)&&(r=t,i=e,l(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(t){return t!==r&&(r=t,l(),!0)},type:"number"},centerY:{get:function(){return i},set:function(t){return t!==i&&(i=t,l(),!0)},type:"number"},skew:{method:function(t,e){return isNaN(t)&&(t=u),isNaN(e)&&(e=h),(t!==u||e!==h)&&(u=t,h=e,l(),!0)},type:["number","number"]},skewX:{get:function(){return u},set:function(t){return t!==u&&(u=t,l(),!0)},type:"number"},skewY:{get:function(){return h},set:function(t){return t!==h&&(h=t,l(),!0)},type:"number"},scale:{method:function(t,e){var n,r;if(n=isNaN(t)?V:t,isNaN(e)){if(isNaN(t))return!1;r=n}else r=e;return(n!==V||r!==o)&&(V=n,o=r,l(),!0)},type:["number","number"]},scaleX:{get:function(){return V},set:function(t){return t!==V&&(V=t,l(),!0)},type:"number"},scaleY:{get:function(){return o},set:function(t){return t!==o&&(o=t,l(),!0)},type:"number"}}}},{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",function(){var t=this,e=!0;function n(){var n=t.matrix;e?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return M.identity(t.matrix),n(),t.transformDirty=!0,t.transformed=!0,{inputs:{direction:{get:function(){return e?"horizontal":"vertical"},set:function(t){var r;return(r="vertical"!==t)!==e&&(e=r,n(),!0)},type:"string"}}}},{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",function(){var t,e,n=this,r="contain";function i(){var i,V,o,s,a=n.matrix,c=t||n.width,u=e||n.height,h=n.source,l=h&&h.width||1,f=h&&h.height||1;"distort"===r||c===l&&u===f?n.transformed=!1:(o=l/f,s=c/u,"none"===r?(i=l/c,V=f/u):"width"===r||"contain"===r&&s<=o?(i=1,V=s/o):"height"===r||"contain"===r&&s>o?(i=o/s,V=1):s>o?(i=1,V=s/o):(i=o/s,V=1),1!==i||1!==V?(M.identity(a),1!==i&&(a[0]*=i,a[1]*=i,a[2]*=i,a[3]*=i),1!==V&&(a[4]*=V,a[5]*=V,a[6]*=V,a[7]*=V),n.transformed=!0):n.transformed=!1)}function V(){return t||n.source&&n.source.width||1}function o(){return e||n.source&&n.source.height||1}return this.resize=function(){var t,e=V(),n=o();if(this.width!==e||this.height!==n)for(this.width=e,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,n),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty(),i()},{inputs:{width:{get:V,set:function(e){return(e=Math.floor(e))!==t&&(t=e,this.resize(),!1)},type:"number"},height:{get:o,set:function(t){return(t=Math.floor(t))!==e&&(e=t,this.resize(),!1)},type:"number"},mode:{get:function(){return r},set:function(t){return t!==r&&(r=t,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}},{title:"Reformat",description:"Change output dimensions"}),a=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n",e.default=X},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uneeq=void 0;const V=n(45);n(101);const o=n(80),s=i(n(104)),a=n(84),c=n(105),u=n(106),h=n(58),l=n(137),f=n(144),d=n(150),p=n(152),g=n(79),v=n(153),y=n(99),m=n(154),b=n(85),_=n(86);e.Uneeq=class{constructor(t){this.ready=new V.BehaviorSubject(!1),this.version=s.default.version,this.messages=new V.Subject,this.internalMessages$=new V.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.remoteVideoPlayCount=0,h.logger.enabled=t.logging||!1,this.options=t,this.options.diagnostics=t.diagnostics||!1,this.options.micActivityMessages=t.micActivityMessages||!1,this.options.sendLocalVideo=void 0===t.sendLocalVideo||t.sendLocalVideo,this.options.sendLocalAudio=void 0===t.sendLocalAudio||t.sendLocalAudio,this.options.enableClientPerformanceMessage=t.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=t.enableTransparentBackground||!1,this.api=new c.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:m.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new v.StreamManager,this.metricsService=new d.MetricsService(this.options,this.internalMessages$,this.messages)}init(){this.initPromMetricsListener(),this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then(t=>{this.session=t,this.initialize()}).catch(t=>{this.sendServiceUnavailableMessage(t)})}initWithToken(t){return r(this,void 0,void 0,function*(){this.initPromMetricsListener(),this.startSessionTime=Date.now();try{this.startSessionData.tokenId=t,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.sourceApp=_.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:_.SourceApp.UNKNOWN,this.session.showUneeqLogo&&this.initImageContentSecurityViolationListener(),this.initialize()}catch(t){this.sendServiceUnavailableMessage(t)}})}get sessionId(){return this.session?this.session.id:null}setCamera(t){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(t)}setMic(t){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(t)}setSpeaker(t){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(t)}enableMicrophone(t=!0){this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,t)}enableCamera(t=!0){this.deviceManager.enableLocalDevices(t,this.options.sendLocalAudio)}enableMicrophoneAndCamera(t=!0){this.deviceManager.enableLocalDevices(t,t)}sendTranscript(t){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(t))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.api.avatarStartRecording().then(()=>this.messages.next(new y.RecordingStartedMessage)))}stopSpeaking(){return this.api.avatarStopSpeaking()}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.api.avatarStopRecording().then(()=>this.messages.next(new y.RecordingStoppedMessage)))}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new y.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new y.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new y.SessionResumedMessage),!0):(this.messages.next(new y.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(t){return this.api.setAvatarDebug(t)}playWelcomeMessage(){return this.api.avatarWelcome()}gatherWebRtcMetrics(){var t;null===(t=this.deviceManager)||void 0===t||t.mediaHandler.gatherWebRTCStats((t,e)=>{this.metricsService.parseAndLogWebRtcStats(e)}),setTimeout(()=>{this.gatherWebRtcMetrics()},5e3)}initMessaging(){this.messages.subscribe(t=>this.messageCallback(t)),this.messaging.state$.filter(t=>t===f.MessagingState.CONNECTED).subscribe(()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new y.ReadyMessage),this.gatherWebRtcMetrics()}),this.messaging.messages$.subscribe(t=>this.internalMessages$.next(JSON.parse(t.body))),this.messageHandler=new l.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe(t=>{h.logger.log("-- Msg -- ",t)})}initDeviceManager(){this.deviceManager=new u.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new y.SessionLiveMessage),this.options.playWelcome&&this.api.avatarWelcome();const t={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.sessionStarted=!0}}initAvatar(){this.ready.filter(Boolean).pipe(o.take(1)).subscribe(()=>{this.internalMessages$.filter(t=>"DevicePermissionAllowedInternal"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>{console.log("DevicePermissionAllowedInternal"),this.messages.next(new y.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()}),this.initDeviceManager()}),this.internalMessages$.filter(t=>"sessionLive"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>this.sessionLiveHandler()),this.internalMessages$.filter(t=>"sessionEnd"===t.faceMeMessageType).subscribe(()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new y.SessionEndedMessage),this.messaging.disconnect()}),this.internalMessages$.filter(t=>"remoteVideoReadyToPlay"===t.faceMeMessageType).subscribe(t=>{this.playRemoteVideo(),this.streamManager.remoteVideoReadyToPlay()})}playRemoteVideo(){this.deviceManager.mediaHandler.avatarVideoElement&&(this.deviceManager.mediaHandler.avatarVideoElement.play(),this.deviceManager.mediaHandler.avatarVideoElement.autoplay=!0,this.remoteVideoPlayCount++,setTimeout(()=>{this.remoteVideoPlayCount<=10&&this.playRemoteVideo()},100*(this.remoteVideoPlayCount-1)))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then(t=>{if(t.available>0){const t={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new y.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground})}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new y.AvatarUnavailableMessage)),setTimeout(()=>{this.startAvatarWhenAvailable()},1e3)})}initialize(){if(this.session){this.api.callId=this.session.id,this.initAvatar();const t={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new y.ConnectionLostMessage(b.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new f.MessagingService(this.options.url+"/api/messaging",t),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(t){const e=new y.ServiceUnavailableMessage(t);this.messages.next(e),this.messageCallback(e)}serviceReadyCheck(t){return!!this.ready.value||(this.messages.next(new y.WarningMessage("Call to "+t+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new p.OnlineStatusService(this.messages,()=>{this.messages.next(new y.ConnectionLostMessage(b.PublishSubscribeState.DISCONNECTED)),this.endSession()})}initPromMetricsListener(){const t=new g.Prom(this.options.url);this.internalMessages$.filter(t=>"prom"===t.faceMeMessageType).subscribe(e=>{t.handleMessage(e.promMsg)})}initImageContentSecurityViolationListener(){const t=(new a.MediaUtils).getMediaApiUrl(this.options.url);document.addEventListener("securitypolicyviolation",e=>{console.debug("Handling securitypolicyviolation event",e),e.violatedDirective&&"img-src"===e.violatedDirective&&e.blockedURI&&e.blockedURI.includes(t)&&(console.error("Session was unable to start because the UneeQ watermark was not allowed to load. Please add img-src "+t.replace("https://","")+" to your Content Security Policy."),this.endSession())})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaUtils=void 0;e.MediaUtils=class{constructor(){}getMediaApiUrl(t){return t.replace("api","media")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublishSubscribeState=void 0,function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.CONNECTED="CONNECTED",t.FAILED="FAILED"}(e.PublishSubscribeState||(e.PublishSubscribeState={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceApp=void 0,function(t){t.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",t.SHOWCASE="SHOWCASE",t.SPLIT_SCREEN="SPLIT_SCREEN",t.INTERACTIONS="INTERACTIONS",t.UNKNOWN="UNKNOWN"}(e.SourceApp||(e.SourceApp={}))},function(t,e,n){"use strict";(function(e,r){var i;t.exports=x,x.ReadableState=S;n(88).EventEmitter;var V=function(t,e){return t.listeners(e).length},o=n(89),s=n(42).Buffer,a=e.Uint8Array||function(){};var c,u=n(126);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,l,f,d=n(127),p=n(90),g=n(91).getHighWaterMark,v=n(43).codes,y=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(59)(x,o);var w=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function S(t,e,r){i=i||n(44),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(93).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||n(44),!(this instanceof x))return new x(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function C(t,e,n,r,i){c("readableAddChunk",e);var V,o=t._readableState;if(null===e)o.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?M(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}(t,o);else if(i||(V=function(t,e){var n;r=e,s.isBuffer(r)||r instanceof a||"string"==typeof e||void 0===e||t.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(o,e)),V)w(t,V);else if(o.objectMode||e&&e.length>0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)o.endEmitted?w(t,new _):T(t,o,e,!0);else if(o.ended)w(t,new m);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):P(t,o)):T(t,o,e,!1)}else r||(o.reading=!1,P(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function T(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&M(t)),P(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=p.destroy,x.prototype._undestroy=p.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=s.from(t,e),e=""),n=!0),C(this,t,e,!1,n)},x.prototype.unshift=function(t){return C(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){h||(h=n(93).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var E=1073741824;function R(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(O,t))}function O(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(k,t,e))}function k(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(c("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function D(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function N(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(F,e,t))}function F(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function B(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}x.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):M(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&U(this),null;var r,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=R(n,e))),null===(r=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&U(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(t){w(this,new b("_read()"))},x.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?a:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&V(t,"data")&&(e.flowing=!0,j(t))}}(n);t.on("drain",u);var h=!1;function l(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==B(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){c("onerror",e),g(),t.removeListener("error",f),0===V(t,"error")&&w(t,e)}function d(){t.removeListener("finish",p),g()}function p(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var V=0;V<i;V++)r[V].emit("unpipe",this,{hasUnpiped:!1});return this}var o=B(e.pipes,t);return-1===o?this:(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},x.prototype.on=function(t,e){var n=o.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?M(this):i.reading||r.nextTick(I,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(D,this),n},x.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(D,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(N,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var V=0;V<A.length;V++)t.on(A[V],this.emit.bind(this,A[V]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=n(131)),l(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=L,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===f&&(f=n(132)),f(x,t,e)})}).call(this,n(33),n(36))},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,V=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,n,r){var i,V,o,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(V=t._events)?(V=t._events=Object.create(null),t._eventsCount=0):(void 0!==V.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),V=t._events),o=V[e]),void 0===o)o=V[e]=n,++t._eventsCount;else if("function"==typeof o?o=V[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,s=a,console&&console.warn&&console.warn(s)}return t}function h(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,V(this.listener,this.target,t))}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function f(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)V(a,this,e);else{var c=a.length,u=p(a,c);for(n=0;n<c;++n)V(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,V,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,V=n.length-1;V>=0;V--)if(n[V]===e||n[V].listener===e){o=n[V].listener,i=V;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,V=Object.keys(n);for(r=0;r<V.length;++r)"removeListener"!==(i=V[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){t.exports=n(88).EventEmitter},function(t,e,n){"use strict";(function(e){function n(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,V){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(V?V(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!V&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(r,o):(o._writableState.errorEmitted=!0,e.nextTick(n,o,t)):e.nextTick(n,o,t):V?(e.nextTick(r,o),V(t)):e.nextTick(r,o)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,n(36))},function(t,e,n){"use strict";var r=n(43).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var V=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=V){if(!isFinite(V)||Math.floor(V)!==V||V<0)throw new r(i?n:"highWaterMark",V);return Math.floor(V)}return t.objectMode?16:16384}}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var V;t.exports=x,x.WritableState=S;var o={deprecate:n(129)},s=n(89),a=n(42).Buffer,c=e.Uint8Array||function(){};var u,h=n(90),l=n(91).getHighWaterMark,f=n(43).codes,d=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,m=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,w=h.errorOrDestroy;function A(){}function S(t,e,o){V=V||n(44),t=t||{},"boolean"!=typeof o&&(o=e instanceof V),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,V=n.writecb;if("function"!=typeof V)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,V){--e.pendingcb,n?(r.nextTick(V,i),r.nextTick(O,t,e),t._writableState.errorEmitted=!0,w(t,i)):(V(i),t._writableState.errorEmitted=!0,w(t,i),O(t,e))}(t,n,i,e,V);else{var o=R(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(t,n),i?r.nextTick(T,t,n,o,V):T(t,n,o,V)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(t){var e=this instanceof(V=V||n(44));if(!e&&!u.call(x,this))return new x(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function C(t,e,n,r,i,V,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):n?t._writev(i,e.onwrite):t._write(i,V,e.onwrite),e.sync=!1}function T(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),O(t,e)}function E(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,V=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)V[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;V.allBuffers=a,C(t,e,!0,e.length,V,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(C(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(n){e.pendingcb--,n&&w(t,n),e.prefinished=!0,t.emit("prefinish"),O(t,e)})}function O(t,e){var n=R(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(M,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}n(59)(x,s),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===x&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},x.prototype.pipe=function(){w(this,new v)},x.prototype.write=function(t,e,n){var i,V=this._writableState,o=!1,s=!V.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return s&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=V.defaultEncoding),"function"!=typeof n&&(n=A),V.ending?function(t,e){var n=new b;w(t,n),r.nextTick(e,n)}(this,n):(s||function(t,e,n,i){var V;return null===n?V=new m:"string"==typeof n||e.objectMode||(V=new d("chunk",["string","Buffer"],n)),!V||(w(t,V),r.nextTick(i,V),!1)}(this,V,t,n))&&(V.pendingcb++,o=function(t,e,n,r,i,V){if(!n){var o=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,n));return e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=e.objectMode?1:r.length;e.length+=s;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:V,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,s,r,i,V);return c}(this,V,s,t,e,n)),o},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,n){n(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,O(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(t,e){e(t)}}).call(this,n(33),n(36))},function(t,e,n){"use strict";var r=n(130).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function V(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=l,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=V,V.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},V.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},V.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=o(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},V.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(43).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,V=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,a=n(44);function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new V);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush(function(e,n){l(t,e,n)})}function l(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}n(59)(u,a),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,function(t){e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Counter=void 0;var r=n(96);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,s(e).apply(this,arguments))}var n,i,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,r.Collector),n=e,(i=[{key:"inc",value:function(t){return this.add(1,t),this}},{key:"add",value:function(t,e){if(t<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(t));var n=this.get(e);return this.set(n?n.value+t:t,e),this}},{key:"reset",value:function(t){this.set(0,t)}}])&&V(n.prototype,i),c&&V(n,c),e}();e.Counter=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0;var r=n(62),i=n(97);function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data=[]}var e,n,o;return e=t,(n=[{key:"get",value:function(t){return(0,i.findExistingMetric)(t,this.data)}},{key:"set",value:function(t,e){var n=(0,i.findExistingMetric)(e,this.data);return n?n.value=t:this.data.push({labels:e,value:t}),this}},{key:"collect",value:function(t){return(0,r.filter)(this.data,function(e){return(0,r.matches)(t)(e.labels)})}},{key:"resetAll",value:function(){var t=this;return(0,r.each)(this.data,function(e){t.reset(e.labels)}),this}}])&&V(e.prototype,n),o&&V(e,o),t}();e.Collector=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatHistogramOrSummary=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",V=function(t){var e=(0,r.map)(t.labels,function(t,e){return"".concat(e,'="').concat(t,'"')});return 0===e.length?"":"".concat(e.join(","))}(e);V.length>0?(i+="".concat(t,"_count{").concat(V,"} ").concat(e.value.count,"\n"),i+="".concat(t,"_sum{").concat(V,"} ").concat(e.value.sum,"\n")):(i+="".concat(t,"_count ").concat(e.value.count,"\n"),i+="".concat(t,"_sum ").concat(e.value.sum,"\n"));return(0,r.reduce)(e.value.entries,function(e,r,o){return V.length>0?i+="".concat(t,"_bucket{").concat(n,'="').concat(o,'",').concat(V,"} ").concat(r,"\n"):i+="".concat(t,"_bucket{").concat(n,'="').concat(o,'"} ').concat(r,"\n"),i},i)},e.findExistingMetric=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t)return e[0];return(0,r.find)(e,function(e){return(0,r.isEqual)(e.labels,t)})},e.formatCounterOrGauge=function(t,e){var n=" ".concat(e.value.toString());if(null==e.labels||0===Object.keys(e.labels).length)return"".concat(t).concat(n,"\n");var i=(0,r.map)(e.labels,function(t,e){return"".concat(e,'="').concat(t,'"')});return"".concat(t,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(62)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=void 0,function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(e.MessagingState||(e.MessagingState={}))},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceMessage=e.ClientMediaStreamUpdateMessage=e.OnlineStatusUpdateMessage=e.SessionInfoMessage=e.AvatarRequestIgnored=e.AvatarRequestCompleted=e.SessionErrorMessage=e.WebRtcStatsMessage=e.WebRtcDataMessage=e.SessionLiveMessage=e.WarningMessage=e.RecordingStoppedMessage=e.RecordingStartedMessage=e.DevicePermissionAllowedMessage=e.AvatarTextInputFinishedMessage=e.FinishedSpeakingMessage=e.StartedSpeakingMessage=e.AvatarQuestionMessage=e.AvatarAnswerContentMessage=e.AvatarAnswerMessage=e.ConnectionLostMessage=e.MicActivityNotSupportedMessage=e.MicActivityMessage=e.MicActivityErrorMessage=e.ServiceUnavailableMessage=e.AvatarUnavailableMessage=e.AvatarAvailableMessage=e.SessionEndedMessage=e.SessionResumedMessage=e.SessionPausedMessage=e.DeviceListUpdatedMessage=e.DeviceErrorMessage=e.SetSpeakerSuccessMessage=e.SetMicSuccessMessage=e.SetCameraSuccessMessage=e.DeviceNotFoundErrorMessage=e.ReadyMessage=e.UneeqMessageType=void 0,function(t){t.Ready="Ready",t.DeviceNotFoundError="DeviceNotFoundError",t.SetCameraSuccess="SetCameraSuccess",t.SetMicSuccess="SetMicSuccess",t.SetSpeakerSuccess="SetSpeakerSuccess",t.SessionPaused="SessionPaused",t.SessionResumed="SessionResumed",t.SessionEnded="SessionEnded",t.AvatarAvailable="AvatarAvailable",t.AvatarUnavailable="AvatarUnavailable",t.ConnectionLost="ConnectionLost",t.ServiceUnavailable="ServiceUnavailable",t.OnlineStatusUpdate="OnlineStatusUpdate",t.MicActivityNotSupported="MicActivityNotSupported",t.MicActivityError="MicActivityError",t.MicActivity="MicActivity",t.DeviceError="DeviceError",t.DeviceListUpdated="DeviceListUpdated",t.AvatarAnswer="AvatarAnswer",t.AvatarAnswerContent="AvatarAnswerContent",t.StartedSpeaking="StartedSpeaking",t.FinishedSpeaking="FinishedSpeaking",t.AvatarTextInputFinished="AvatarTextInputFinished",t.AvatarQuestionText="AvatarQuestionText",t.DevicePermissionAllowed="DevicePermissionAllowed",t.RecordingStarted="RecordingStarted",t.RecordingStopped="RecordingStopped",t.Warning="Warning",t.SessionLive="SessionLive",t.WebRtcData="WebRtcData",t.WebRtcStats="WebRtcStats",t.SessionError="SessionError",t.SessionInfo="SessionInfo",t.AvatarRequestCompleted="AvatarRequestCompleted",t.AvatarRequestIgnored="AvatarRequestIgnored",t.ClientMediaStreamUpdate="ClientMediaStreamUpdate",t.ClientPerformanceMessage="ClientPerformanceMessage"}(r=e.UneeqMessageType||(e.UneeqMessageType={}));e.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}};e.DeviceNotFoundErrorMessage=class{constructor(t,e){this.msg=t,this.deviceId=e,this.uneeqMessageType=r.DeviceNotFoundError}};e.SetCameraSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetCameraSuccess}};e.SetMicSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetMicSuccess}};e.SetSpeakerSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetSpeakerSuccess}};e.DeviceErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.DeviceError}};e.DeviceListUpdatedMessage=class{constructor(t){this.devices=t,this.uneeqMessageType=r.DeviceListUpdated}};e.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}};e.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}};e.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}};e.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}};e.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}};e.ServiceUnavailableMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.ServiceUnavailable}};e.MicActivityErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.MicActivityError}};e.MicActivityMessage=class{constructor(t){this.level=t,this.uneeqMessageType=r.MicActivity}};e.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}};e.ConnectionLostMessage=class{constructor(t){this.connectionState=t,this.uneeqMessageType=r.ConnectionLost}};e.AvatarAnswerMessage=class{constructor(t,e,n,i){this.answer=t,this.answerAvatar=e,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}};e.AvatarAnswerContentMessage=class{constructor(t,e,n=!1){this.content=t,this.transcriptId=e,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}};e.AvatarQuestionMessage=class{constructor(t,e){this.question=t,this.transcriptId=e,this.uneeqMessageType=r.AvatarQuestionText}};e.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}};e.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}};e.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}};e.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}};e.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}};e.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}};e.WarningMessage=class{constructor(t){this.msg=t,this.uneeqMessageType=r.Warning}};e.SessionLiveMessage=class{constructor(){this.uneeqMessageType=r.SessionLive}};e.WebRtcDataMessage=class{constructor(t){this.data=t,this.uneeqMessageType=r.WebRtcData}};e.WebRtcStatsMessage=class{constructor(t){this.stats=t,this.uneeqMessageType=r.WebRtcStats}};e.SessionErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.SessionError}};e.AvatarRequestCompleted=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestCompleted}};e.AvatarRequestIgnored=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestIgnored}};e.SessionInfoMessage=class{constructor(t){this.info=t,this.uneeqMessageType=r.SessionInfo}};e.OnlineStatusUpdateMessage=class{constructor(t){this.online=t,this.uneeqMessageType=r.OnlineStatusUpdate}};e.ClientMediaStreamUpdateMessage=class{constructor(t,e,n,i){this.clientStreamingAudio=t,this.clientStreamingVideo=e,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}};e.ClientPerformanceMessage=class{constructor(t){this.clientPerformance=t,this.uneeqMessageType=r.ClientPerformanceMessage}}},function(t,e,n){(function(t){!function(t){function e(t){if("utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+t+"') is invalid.")}function n(t,e){if(e=void 0===e?{fatal:!1}:e,"utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(t.TextEncoder&&t.TextDecoder)return!1;Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,i=Math.max(32,n+(n>>1)+7),V=new Uint8Array(i>>3<<3);e<n;){var o=t.charCodeAt(e++);if(55296<=o&&56319>=o){if(e<n){var s=t.charCodeAt(e);56320==(64512&s)&&(++e,o=((1023&o)<<10)+(1023&s)+65536)}if(55296<=o&&56319>=o)continue}if(r+4>V.length&&(i+=8,i=(i*=1+e/t.length*2)>>3<<3,(s=new Uint8Array(i)).set(V),V=s),0==(4294967168&o))V[r++]=o;else{if(0==(4294965248&o))V[r++]=o>>6&31|192;else if(0==(4294901760&o))V[r++]=o>>12&15|224,V[r++]=o>>6&63|128;else{if(0!=(4292870144&o))continue;V[r++]=o>>18&7|240,V[r++]=o>>12&63|128,V[r++]=o>>6&63|128}V[r++]=63&o|128}}return V.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e=0;for(var n=(t=new Uint8Array(t)).length,r=[];e<n;){var i=t[e++];if(0===i)break;if(0==(128&i))r.push(i);else if(192==(224&i)){var V=63&t[e++];r.push((31&i)<<6|V)}else if(224==(240&i)){V=63&t[e++];var o=63&t[e++];r.push((31&i)<<12|V<<6|o)}else if(240==(248&i)){65535<(i=(7&i)<<18|(V=63&t[e++])<<12|(o=63&t[e++])<<6|63&t[e++])&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i)}}return String.fromCharCode.apply(null,r)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:void 0!==t?t:this)}).call(this,n(33))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(102)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(103);r.Observable.prototype.filter=i.filter},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80);e.filter=function(t,e){return r.filter(t,e)(this)}},function(t){t.exports=JSON.parse('{"name":"uneeq-js","version":"2.39.8","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG","test":"./node_modules/karma/bin/karma start --browsers ChromeHeadless --single-run","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"./node_modules/tslint/bin/tslint -p tsconfig.json --fix","docs":"./node_modules/typedoc/bin/typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^6.2.2","rxjs-compat":"^6.3.2","simple-peer":"9.11.0","webrtc-adapter":"8.1.0"},"devDependencies":{"@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^3.2.0","jasmine-class-mock":"^1.0.1","jasmine-core":"^3.3.0","karma":"^5.0.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^2.0.1","karma-jasmine-html-reporter":"^1.4.0","karma-requirejs":"^1.1.0","karma-safari-launcher":"^1.0.0","karma-typescript":"^5.0.0","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^5.0.0","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^3.9.7","webpack":"^4.17.1","webpack-cli":"^3.1.0"}}')},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0;e.API=class{constructor(t,e="",n=(()=>{})){this.xAuthToken="",this.apiUrl=t,this.apiKey=e,this.loggedOutHandler=n}set callId(t){this._callId=t}get authToken(){return this.xAuthToken}startSession(t){return this.postRequest("/api/v1/customers/",t,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",t)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:t})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(t){return this.postRequest("/api/v2/clients/start-session",t,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(t){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:t})}sendMediaUnavailable(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",t)}getEdgeNodeId(t){let e=t.replace("turn:","http://");e=e.replace("turns:","https://");const n=new Request(e,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(t){return r(this,void 0,void 0,function*(){const e=yield fetch(t);if(!e.ok){401===e.status&&this.loggedOutHandler();const t=yield e.json();throw{status:e.status,body:t}}return 204===e.status?new Promise((t,e)=>{t()}):(this.xAuthToken=e.headers.get("x-auth-token")||this.xAuthToken,yield e.json())})}getRequest(t){const e=new Request(this.apiUrl+t,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(e)}postRequest(t,e={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(e)},V=new Request(this.apiUrl+t,Object.assign(i,n));return this.makeRequest(V)}putRequest(t,e={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(e)},i=new Request(this.apiUrl+t,Object.assign(r,n));return this.makeRequest(i)}}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceManager=void 0;const i=n(35),V=n(107);e.DeviceManager=class{constructor(t,e){this.options=t,this.api=e,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new V.MediaHandler(this.options,()=>this.remoteVideoReady()),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(t){this.mediaHandler.setEdgeNodeId(t),this.getDevices(!0)}enableLocalDevices(t,e){const n=this.options.uneeqOptions.sendLocalVideo!==t,r=this.options.uneeqOptions.sendLocalAudio!==e;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=t,this.options.uneeqOptions.sendLocalAudio=e,n&&!1===t&&this.publishStream.getVideoTracks().forEach(t=>t.stop()),r&&!1===e&&this.publishStream.getAudioTracks().forEach(t=>t.stop()),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(t=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const e=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then(e=>r(this,void 0,void 0,function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),t){if(this.options.uneeqOptions.sendLocalVideo){const t=e.getVideoTracks();t.length>0&&(this.publishStream.getVideoTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}if(this.options.uneeqOptions.sendLocalAudio){const t=e.getAudioTracks();t.length>0&&(this.publishStream.getAudioTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})).catch(t=>{e.options.userMessages.next(new i.DeviceErrorMessage(t)),console.error("device error: ",t),this.sendMediaUnavailableInfo("NotAllowedError"===t.name),this.revertMediaOptions()})}setMicDevice(t,e=!0){const n=this.devices.audioInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=t,this.audioConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(t));else{const e="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setCamDevice(t,e=!0){const n=this.devices.videoInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=t,this.videoConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(t));else{const e="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setAvatarSpeakerDevice(t){if(this.mediaHandler.avatarVideoElement){const e=this.devices.audioOutput.filter(e=>e.deviceId===t);if(e&&e.length>0)this.options.uneeqOptions.preferredSpeakerId=t,this.mediaHandler.avatarVideoElement.setSinkId(t).then(()=>{this.speakerConstraints.deviceId=t,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(t))}).catch(e=>{const n="Uneeq setSpeaker: Error setting device. "+e.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,t))});else{const e="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(t){return r(this,void 0,void 0,function*(){const e=yield this.getMediaDevices(),n={audioInputs:e.audioInput.length,videoInputs:e.videoInput.length,hasUserDeniedPermission:t};return this.api.sendMediaUnavailable(n)})}getMediaDevices(){return r(this,void 0,void 0,function*(){const t=yield navigator.mediaDevices.enumerateDevices(),e={audioInput:[],audioOutput:[],videoInput:[]};return e.audioInput=t.filter(t=>"audioinput"===t.kind),e.audioOutput=t.filter(t=>"audiooutput"===t.kind),e.videoInput=t.filter(t=>"videoinput"===t.kind),e})}initDeviceList(){return r(this,void 0,void 0,function*(){navigator.mediaDevices.ondevicechange=t=>{this.initDeviceList()};const t=yield this.getMediaDevices();JSON.stringify(t)!==JSON.stringify(this.devices)&&(this.devices=t,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaHandler=void 0;const r=n(45),i=n(80),V=n(35),o=n(108),s=n(109),a=n(85),c=n(111),u=n(58),h=n(114);e.MediaHandler=class{constructor(t,e){this.options=t,this.remoteVideoReady=e,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.canvasService=new c.CanvasService(this.options.uneeqOptions),this.remoteStream$.filter(t=>null!==t).subscribe(n=>{const r=document.createElement("video");this.avatarVideoElement=r,r.srcObject=n,r.volume=1,r.controls=!1,r.setAttribute("playsinline","true"),r.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",t.uneeqOptions.avatarVideoContainerElement.innerHTML="",t.uneeqOptions.avatarVideoContainerElement.appendChild(r);const i=this.canvasService.createCanvas();this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(r,i),this.options.session.showUneeqLogo&&this.canvasService.drawVideoOnCanvasWithLogo(n,r,i,this.avatarVideoElement,this.options.session),e()}),this.localStream$.filter(t=>null!==t).subscribe(e=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=e,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),t.uneeqOptions.localVideoContainerElement.innerHTML="",t.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.uneeqOptions.micActivityMessages&&this.initMicActivity(e),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()});try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(t){this.options.uneeqOptions.micActivityMessages&&this.options.userMessages.next(new V.MicActivityNotSupportedMessage)}this.options.internalMessages$.filter(t=>"AnswerMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(t)}),this.options.internalMessages$.filter(t=>"IceCandidateMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(t)})}setEdgeNodeId(t){this.options.session.edgeNodeId=t,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){u.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),e&&e.getTracks().forEach(t=>t.enabled=!1),t&&t.getTracks().forEach(t=>t.enabled=!1)}resume(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();e&&e.getTracks().forEach(t=>t.enabled=!0),t&&t.getTracks().forEach(t=>t.enabled=!0),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const t=this.localStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const t=this.remoteStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.soundMeter&&this.soundMeter.stop()}sendDataMessage(t){this.webRTC&&this.webRTC.sendDataMessage(t)}gatherWebRTCStats(t){var e;null===(e=this.webRTC)||void 0===e||e.getStats(t)}publishVideo(){const t=this.options.session.streamId,e=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,i=this.options.session.turnPassword,o=this.options.session.forceTurnServerUse,s=this.publishState$,c=this.remoteStream$,l=this.localStream$.getValue();if(!l||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let f=0;u.logger.log("UserSession | publishVideo - stream:",l,"publishStreamName:",t),u.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new h.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:t,subscribeStreamName:e,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:t=>{u.logger.log("WEBRTC: onAddstream "+t.stream),c.next(t.stream)},forceTurnServerUse:o,iceServers:[{urls:n,username:r,credential:i}],onConnect:()=>{u.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),s.getValue()===a.PublishSubscribeState.CONNECTING&&s.next(a.PublishSubscribeState.CONNECTED)},onError:t=>{u.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",f),f<3?(f++,this.performWebRTCConnection(l),this.options.userMessages.next(new V.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(u.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),s.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new V.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(l)):this.webRTC.updateStreamTracks(l)}performWebRTCConnection(t){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(t))}initMicActivity(t){this.soundMeter=new o.SoundMeter(this.audioContext),this.soundMeter.connectToSource(t,t=>this.micActivityConnected(t))}initTransparentBackground(t,e){(new s.VideoEditor).applyChromaKeyEffect(e,t),this.avatarVideoElement.style.display="none"}micActivityConnected(t){const e=this.options.userMessages;t?e.next(new V.MicActivityErrorMessage(t)):this.soundMeter&&this.soundMeter.instant$.pipe(i.distinctUntilChanged()).subscribe(t=>{e.next(new V.MicActivityMessage(t))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SoundMeter=void 0;const r=n(45),i=n(58);e.SoundMeter=class{constructor(t){this.instant$=new r.BehaviorSubject(0),this.context=t,this.instant=0,this.slow=0,this.clip=0,this.script=t.createScriptProcessor(2048,1,1);const e=this;this.script.onaudioprocess=t=>{const n=t.inputBuffer.getChannelData(0);let r,i=0,V=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(V+=1);e.instant=Math.sqrt(i/n.length),e.slow=.95*e.slow+.05*e.instant,e.clip=V/n.length,e.instant$.next(parseFloat(e.instant.toFixed(2)))}}connectToSource(t,e){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(t),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==e&&e(null)}catch(t){console.error(t),void 0!==e&&e(t)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoEditor=void 0;const o=V(n(82));e.VideoEditor=class{constructor(){}applyChromaKeyEffect(t,e){try{n(110);const r=o.default();let i,V,s;(i=r.transform("reformat")).source=e,i.width=t.width,i.height=t.height,s=r.target(t),(V=r.effect("chroma")).source=i,s.source=V,r.go()}catch(t){console.error(t)}}}},function(t,e,n){"use strict";n.r(e),n(82).default.plugin("chroma",{shader:function(t,e){return e.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),e.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),e},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasService=void 0;const r=n(112),i=n(84);e.CanvasService=class{constructor(t){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=t,this.mediaApiUrl=(new i.MediaUtils).getMediaApiUrl(t.url),this.logoDimensionsCalculator=new r.LogoDimensionsCalculator}drawVideoOnCanvasWithLogo(t,e,n,r,i){const V=this.uneeqOptions.enableTransparentBackground||!1;this.logo=new Image,this.logo.src=this.mediaApiUrl+"/media/v1/assets/logo/svg/download",this.logo.onload=()=>{let o=n.getContext("2d");if(V){const t=this.createCanvas();o=t.getContext("2d"),n.style.display="none"}e.addEventListener("play",()=>{let r=this.logoDimensionsCalculator.calculateLogoDimensions(i.sourceApp,V,this.uneeqOptions.avatarVideoContainerElement,n),s=this.uneeqOptions.avatarVideoContainerElement.offsetWidth,a=this.uneeqOptions.avatarVideoContainerElement.offsetHeight;const c=u=>{const h=t.getVideoTracks();if(0===h.length)return void console.error("Unable to get video stream tracks.");const l=h[0].getSettings();null==o||o.clearRect(0,0,n.width,n.height),u?null==o||o.drawImage(n,0,0):null==o||o.drawImage(e,0,0,l.width||0,l.height||0,0,0,n.width,n.height),null==o||o.drawImage(this.logo,r.dx,r.dy,r.width,r.height);const f=this.uneeqOptions.avatarVideoContainerElement.offsetWidth,d=this.uneeqOptions.avatarVideoContainerElement.offsetHeight;f===s&&d===a||(r=this.logoDimensionsCalculator.calculateLogoDimensions(i.sourceApp,V,this.uneeqOptions.avatarVideoContainerElement,n),s=f,a=d),requestAnimationFrame(()=>{c(V)})};c(V)}),r.style.display="none"}}createCanvas(){const t=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(t),t.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.height=this.canvasHeight,t.width=this.canvasWidth,t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogoDimensionsCalculator=void 0;const r=n(113),i=n(86);e.LogoDimensionsCalculator=class{constructor(){this.MIN_DESKTOP_SCREEN_WIDTH=800}calculateLogoDimensions(t,e,n,r){const V={width:170,height:40,dx:0,dy:0},o={left:0,top:0,bottom:0};switch(i.SourceApp[t]){case i.SourceApp.INTERACTIONS:V.width=86.5,V.height=23,this.populatInteractionsLogo(e,o,V,n,r);break;case i.SourceApp.SPLIT_SCREEN:V.width=173,V.height=46,o.left=10,o.top=10,this.populateLogoDimensions(V,n,r,o,!1);break;case i.SourceApp.SHOWCASE||i.SourceApp.HOSTED_EXPERIENCE:V.width=173,V.height=46,n.offsetWidth<this.MIN_DESKTOP_SCREEN_WIDTH?(o.bottom=50,this.populateLogoDimensions(V,n,r,o,!0)):(o.left=10,o.top=10,this.populateLogoDimensions(V,n,r,o,!1));break;case i.SourceApp.UNKNOWN:V.width=173,V.height=46,e||n.offsetWidth<this.MIN_DESKTOP_SCREEN_WIDTH?(o.bottom=50,this.populateLogoDimensions(V,n,r,o,!0)):(o.left=80,o.top=30,this.populateLogoDimensions(V,n,r,o,!1))}return V}populatInteractionsLogo(t,e,n,r,i){t?(e.bottom=40,this.populateLogoDimensions(n,r,i,e,!0)):(e.left=10,e.top=10,this.populateLogoDimensions(n,r,i,e,!1))}populateLogoDimensions(t,e,n,i,V){const{width:o,height:s,x:a,y:c}=r.cover(e.offsetWidth,e.offsetHeight,n.width,n.height),u=n.width/o,h=n.height/s;if(t.width=Math.max(t.width,t.width*u),t.height=Math.max(t.height,t.height*h),V){const e=n.width/2;t.dx=e-t.width/2,t.dy=n.height-t.height-i.bottom}else{const e=u*a,n=h*c;t.dx=i.left*u-e,t.dy=i.top*h-n}return t}}},function(t,e,n){"use strict";
31
+ */(function(){var V,o=200,s="Unsupported core-js use. Try https://npms.io/search?q=ponyfill.",a="Expected a function",c="__lodash_hash_undefined__",u=500,h="__lodash_placeholder__",l=1,f=2,d=4,p=1,g=2,v=1,y=2,m=4,b=8,_=16,w=32,A=64,S=128,x=256,C=512,T=30,E="...",R=800,M=16,O=1,P=2,k=1/0,D=9007199254740991,I=17976931348623157e292,N=NaN,j=4294967295,L=j-1,U=j>>>1,F=[["ary",S],["bind",v],["bindKey",y],["curry",b],["curryRight",_],["flip",C],["partial",w],["partialRight",A],["rearg",x]],B="[object Arguments]",W="[object Array]",z="[object AsyncFunction]",q="[object Boolean]",H="[object Date]",G="[object DOMException]",Y="[object Error]",$="[object Function]",Q="[object GeneratorFunction]",X="[object Map]",Z="[object Number]",K="[object Null]",J="[object Object]",tt="[object Proxy]",et="[object RegExp]",nt="[object Set]",rt="[object String]",it="[object Symbol]",Vt="[object Undefined]",ot="[object WeakMap]",st="[object WeakSet]",at="[object ArrayBuffer]",ct="[object DataView]",ut="[object Float32Array]",ht="[object Float64Array]",lt="[object Int8Array]",ft="[object Int16Array]",dt="[object Int32Array]",pt="[object Uint8Array]",gt="[object Uint8ClampedArray]",vt="[object Uint16Array]",yt="[object Uint32Array]",mt=/\b__p \+= '';/g,bt=/\b(__p \+=) '' \+/g,_t=/(__e\(.*?\)|\b__t\)) \+\n'';/g,wt=/&(?:amp|lt|gt|quot|#39);/g,At=/[&<>"']/g,St=RegExp(wt.source),xt=RegExp(At.source),Ct=/<%-([\s\S]+?)%>/g,Tt=/<%([\s\S]+?)%>/g,Et=/<%=([\s\S]+?)%>/g,Rt=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,Mt=/^\w*$/,Ot=/[^.[\]]+|\[(?:(-?\d+(?:\.\d+)?)|(["'])((?:(?!\2)[^\\]|\\.)*?)\2)\]|(?=(?:\.|\[\])(?:\.|\[\]|$))/g,Pt=/[\\^$.*+?()[\]{}|]/g,kt=RegExp(Pt.source),Dt=/^\s+|\s+$/g,It=/^\s+/,Nt=/\s+$/,jt=/\{(?:\n\/\* \[wrapped with .+\] \*\/)?\n?/,Lt=/\{\n\/\* \[wrapped with (.+)\] \*/,Ut=/,? & /,Ft=/[^\x00-\x2f\x3a-\x40\x5b-\x60\x7b-\x7f]+/g,Bt=/\\(\\)?/g,Wt=/\$\{([^\\}]*(?:\\.[^\\}]*)*)\}/g,zt=/\w*$/,qt=/^[-+]0x[0-9a-f]+$/i,Ht=/^0b[01]+$/i,Gt=/^\[object .+?Constructor\]$/,Yt=/^0o[0-7]+$/i,$t=/^(?:0|[1-9]\d*)$/,Qt=/[\xc0-\xd6\xd8-\xf6\xf8-\xff\u0100-\u017f]/g,Xt=/($^)/,Zt=/['\n\r\u2028\u2029\\]/g,Kt="\\u0300-\\u036f\\ufe20-\\ufe2f\\u20d0-\\u20ff",Jt="\\xac\\xb1\\xd7\\xf7\\x00-\\x2f\\x3a-\\x40\\x5b-\\x60\\x7b-\\xbf\\u2000-\\u206f \\t\\x0b\\f\\xa0\\ufeff\\n\\r\\u2028\\u2029\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000",te="[\\ud800-\\udfff]",ee="["+Jt+"]",ne="["+Kt+"]",re="\\d+",ie="[\\u2700-\\u27bf]",Ve="[a-z\\xdf-\\xf6\\xf8-\\xff]",oe="[^\\ud800-\\udfff"+Jt+re+"\\u2700-\\u27bfa-z\\xdf-\\xf6\\xf8-\\xffA-Z\\xc0-\\xd6\\xd8-\\xde]",se="\\ud83c[\\udffb-\\udfff]",ae="[^\\ud800-\\udfff]",ce="(?:\\ud83c[\\udde6-\\uddff]){2}",ue="[\\ud800-\\udbff][\\udc00-\\udfff]",he="[A-Z\\xc0-\\xd6\\xd8-\\xde]",le="(?:"+Ve+"|"+oe+")",fe="(?:"+he+"|"+oe+")",de="(?:"+ne+"|"+se+")"+"?",pe="[\\ufe0e\\ufe0f]?"+de+("(?:\\u200d(?:"+[ae,ce,ue].join("|")+")[\\ufe0e\\ufe0f]?"+de+")*"),ge="(?:"+[ie,ce,ue].join("|")+")"+pe,ve="(?:"+[ae+ne+"?",ne,ce,ue,te].join("|")+")",ye=RegExp("['’]","g"),me=RegExp(ne,"g"),be=RegExp(se+"(?="+se+")|"+ve+pe,"g"),_e=RegExp([he+"?"+Ve+"+(?:['’](?:d|ll|m|re|s|t|ve))?(?="+[ee,he,"$"].join("|")+")",fe+"+(?:['’](?:D|LL|M|RE|S|T|VE))?(?="+[ee,he+le,"$"].join("|")+")",he+"?"+le+"+(?:['’](?:d|ll|m|re|s|t|ve))?",he+"+(?:['’](?:D|LL|M|RE|S|T|VE))?","\\d*(?:1ST|2ND|3RD|(?![123])\\dTH)(?=\\b|[a-z_])","\\d*(?:1st|2nd|3rd|(?![123])\\dth)(?=\\b|[A-Z_])",re,ge].join("|"),"g"),we=RegExp("[\\u200d\\ud800-\\udfff"+Kt+"\\ufe0e\\ufe0f]"),Ae=/[a-z][A-Z]|[A-Z]{2}[a-z]|[0-9][a-zA-Z]|[a-zA-Z][0-9]|[^a-zA-Z0-9 ]/,Se=["Array","Buffer","DataView","Date","Error","Float32Array","Float64Array","Function","Int8Array","Int16Array","Int32Array","Map","Math","Object","Promise","RegExp","Set","String","Symbol","TypeError","Uint8Array","Uint8ClampedArray","Uint16Array","Uint32Array","WeakMap","_","clearTimeout","isFinite","parseInt","setTimeout"],xe=-1,Ce={};Ce[ut]=Ce[ht]=Ce[lt]=Ce[ft]=Ce[dt]=Ce[pt]=Ce[gt]=Ce[vt]=Ce[yt]=!0,Ce[B]=Ce[W]=Ce[at]=Ce[q]=Ce[ct]=Ce[H]=Ce[Y]=Ce[$]=Ce[X]=Ce[Z]=Ce[J]=Ce[et]=Ce[nt]=Ce[rt]=Ce[ot]=!1;var Te={};Te[B]=Te[W]=Te[at]=Te[ct]=Te[q]=Te[H]=Te[ut]=Te[ht]=Te[lt]=Te[ft]=Te[dt]=Te[X]=Te[Z]=Te[J]=Te[et]=Te[nt]=Te[rt]=Te[it]=Te[pt]=Te[gt]=Te[vt]=Te[yt]=!0,Te[Y]=Te[$]=Te[ot]=!1;var Ee={"\\":"\\","'":"'","\n":"n","\r":"r","\u2028":"u2028","\u2029":"u2029"},Re=parseFloat,Me=parseInt,Oe="object"==typeof t&&t&&t.Object===Object&&t,Pe="object"==typeof self&&self&&self.Object===Object&&self,ke=Oe||Pe||Function("return this")(),De=e&&!e.nodeType&&e,Ie=De&&"object"==typeof r&&r&&!r.nodeType&&r,Ne=Ie&&Ie.exports===De,je=Ne&&Oe.process,Le=function(){try{var t=Ie&&Ie.require&&Ie.require("util").types;return t||je&&je.binding&&je.binding("util")}catch(t){}}(),Ue=Le&&Le.isArrayBuffer,Fe=Le&&Le.isDate,Be=Le&&Le.isMap,We=Le&&Le.isRegExp,ze=Le&&Le.isSet,qe=Le&&Le.isTypedArray;function He(t,e,n){switch(n.length){case 0:return t.call(e);case 1:return t.call(e,n[0]);case 2:return t.call(e,n[0],n[1]);case 3:return t.call(e,n[0],n[1],n[2])}return t.apply(e,n)}function Ge(t,e,n,r){for(var i=-1,V=null==t?0:t.length;++i<V;){var o=t[i];e(r,o,n(o),t)}return r}function Ye(t,e){for(var n=-1,r=null==t?0:t.length;++n<r&&!1!==e(t[n],n,t););return t}function $e(t,e){for(var n=null==t?0:t.length;n--&&!1!==e(t[n],n,t););return t}function Qe(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(!e(t[n],n,t))return!1;return!0}function Xe(t,e){for(var n=-1,r=null==t?0:t.length,i=0,V=[];++n<r;){var o=t[n];e(o,n,t)&&(V[i++]=o)}return V}function Ze(t,e){return!!(null==t?0:t.length)&&an(t,e,0)>-1}function Ke(t,e,n){for(var r=-1,i=null==t?0:t.length;++r<i;)if(n(e,t[r]))return!0;return!1}function Je(t,e){for(var n=-1,r=null==t?0:t.length,i=Array(r);++n<r;)i[n]=e(t[n],n,t);return i}function tn(t,e){for(var n=-1,r=e.length,i=t.length;++n<r;)t[i+n]=e[n];return t}function en(t,e,n,r){var i=-1,V=null==t?0:t.length;for(r&&V&&(n=t[++i]);++i<V;)n=e(n,t[i],i,t);return n}function nn(t,e,n,r){var i=null==t?0:t.length;for(r&&i&&(n=t[--i]);i--;)n=e(n,t[i],i,t);return n}function rn(t,e){for(var n=-1,r=null==t?0:t.length;++n<r;)if(e(t[n],n,t))return!0;return!1}var Vn=ln("length");function on(t,e,n){var r;return n(t,function(t,n,i){if(e(t,n,i))return r=n,!1}),r}function sn(t,e,n,r){for(var i=t.length,V=n+(r?1:-1);r?V--:++V<i;)if(e(t[V],V,t))return V;return-1}function an(t,e,n){return e==e?function(t,e,n){var r=n-1,i=t.length;for(;++r<i;)if(t[r]===e)return r;return-1}(t,e,n):sn(t,un,n)}function cn(t,e,n,r){for(var i=n-1,V=t.length;++i<V;)if(r(t[i],e))return i;return-1}function un(t){return t!=t}function hn(t,e){var n=null==t?0:t.length;return n?pn(t,e)/n:N}function ln(t){return function(e){return null==e?V:e[t]}}function fn(t){return function(e){return null==t?V:t[e]}}function dn(t,e,n,r,i){return i(t,function(t,i,V){n=r?(r=!1,t):e(n,t,i,V)}),n}function pn(t,e){for(var n,r=-1,i=t.length;++r<i;){var o=e(t[r]);o!==V&&(n=n===V?o:n+o)}return n}function gn(t,e){for(var n=-1,r=Array(t);++n<t;)r[n]=e(n);return r}function vn(t){return function(e){return t(e)}}function yn(t,e){return Je(e,function(e){return t[e]})}function mn(t,e){return t.has(e)}function bn(t,e){for(var n=-1,r=t.length;++n<r&&an(e,t[n],0)>-1;);return n}function _n(t,e){for(var n=t.length;n--&&an(e,t[n],0)>-1;);return n}var wn=fn({"À":"A","Á":"A","Â":"A","Ã":"A","Ä":"A","Å":"A","à":"a","á":"a","â":"a","ã":"a","ä":"a","å":"a","Ç":"C","ç":"c","Ð":"D","ð":"d","È":"E","É":"E","Ê":"E","Ë":"E","è":"e","é":"e","ê":"e","ë":"e","Ì":"I","Í":"I","Î":"I","Ï":"I","ì":"i","í":"i","î":"i","ï":"i","Ñ":"N","ñ":"n","Ò":"O","Ó":"O","Ô":"O","Õ":"O","Ö":"O","Ø":"O","ò":"o","ó":"o","ô":"o","õ":"o","ö":"o","ø":"o","Ù":"U","Ú":"U","Û":"U","Ü":"U","ù":"u","ú":"u","û":"u","ü":"u","Ý":"Y","ý":"y","ÿ":"y","Æ":"Ae","æ":"ae","Þ":"Th","þ":"th","ß":"ss","Ā":"A","Ă":"A","Ą":"A","ā":"a","ă":"a","ą":"a","Ć":"C","Ĉ":"C","Ċ":"C","Č":"C","ć":"c","ĉ":"c","ċ":"c","č":"c","Ď":"D","Đ":"D","ď":"d","đ":"d","Ē":"E","Ĕ":"E","Ė":"E","Ę":"E","Ě":"E","ē":"e","ĕ":"e","ė":"e","ę":"e","ě":"e","Ĝ":"G","Ğ":"G","Ġ":"G","Ģ":"G","ĝ":"g","ğ":"g","ġ":"g","ģ":"g","Ĥ":"H","Ħ":"H","ĥ":"h","ħ":"h","Ĩ":"I","Ī":"I","Ĭ":"I","Į":"I","İ":"I","ĩ":"i","ī":"i","ĭ":"i","į":"i","ı":"i","Ĵ":"J","ĵ":"j","Ķ":"K","ķ":"k","ĸ":"k","Ĺ":"L","Ļ":"L","Ľ":"L","Ŀ":"L","Ł":"L","ĺ":"l","ļ":"l","ľ":"l","ŀ":"l","ł":"l","Ń":"N","Ņ":"N","Ň":"N","Ŋ":"N","ń":"n","ņ":"n","ň":"n","ŋ":"n","Ō":"O","Ŏ":"O","Ő":"O","ō":"o","ŏ":"o","ő":"o","Ŕ":"R","Ŗ":"R","Ř":"R","ŕ":"r","ŗ":"r","ř":"r","Ś":"S","Ŝ":"S","Ş":"S","Š":"S","ś":"s","ŝ":"s","ş":"s","š":"s","Ţ":"T","Ť":"T","Ŧ":"T","ţ":"t","ť":"t","ŧ":"t","Ũ":"U","Ū":"U","Ŭ":"U","Ů":"U","Ű":"U","Ų":"U","ũ":"u","ū":"u","ŭ":"u","ů":"u","ű":"u","ų":"u","Ŵ":"W","ŵ":"w","Ŷ":"Y","ŷ":"y","Ÿ":"Y","Ź":"Z","Ż":"Z","Ž":"Z","ź":"z","ż":"z","ž":"z","IJ":"IJ","ij":"ij","Œ":"Oe","œ":"oe","ʼn":"'n","ſ":"s"}),An=fn({"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"});function Sn(t){return"\\"+Ee[t]}function xn(t){return we.test(t)}function Cn(t){var e=-1,n=Array(t.size);return t.forEach(function(t,r){n[++e]=[r,t]}),n}function Tn(t,e){return function(n){return t(e(n))}}function En(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n];o!==e&&o!==h||(t[n]=h,V[i++]=n)}return V}function Rn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=t}),n}function Mn(t){var e=-1,n=Array(t.size);return t.forEach(function(t){n[++e]=[t,t]}),n}function On(t){return xn(t)?function(t){var e=be.lastIndex=0;for(;be.test(t);)++e;return e}(t):Vn(t)}function Pn(t){return xn(t)?function(t){return t.match(be)||[]}(t):function(t){return t.split("")}(t)}var kn=fn({"&amp;":"&","&lt;":"<","&gt;":">","&quot;":'"',"&#39;":"'"});var Dn=function t(e){var n,r=(e=null==e?ke:Dn.defaults(ke.Object(),e,Dn.pick(ke,Se))).Array,i=e.Date,Kt=e.Error,Jt=e.Function,te=e.Math,ee=e.Object,ne=e.RegExp,re=e.String,ie=e.TypeError,Ve=r.prototype,oe=Jt.prototype,se=ee.prototype,ae=e["__core-js_shared__"],ce=oe.toString,ue=se.hasOwnProperty,he=0,le=(n=/[^.]+$/.exec(ae&&ae.keys&&ae.keys.IE_PROTO||""))?"Symbol(src)_1."+n:"",fe=se.toString,de=ce.call(ee),pe=ke._,ge=ne("^"+ce.call(ue).replace(Pt,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),ve=Ne?e.Buffer:V,be=e.Symbol,we=e.Uint8Array,Ee=ve?ve.allocUnsafe:V,Oe=Tn(ee.getPrototypeOf,ee),Pe=ee.create,De=se.propertyIsEnumerable,Ie=Ve.splice,je=be?be.isConcatSpreadable:V,Le=be?be.iterator:V,Vn=be?be.toStringTag:V,fn=function(){try{var t=LV(ee,"defineProperty");return t({},"",{}),t}catch(t){}}(),In=e.clearTimeout!==ke.clearTimeout&&e.clearTimeout,Nn=i&&i.now!==ke.Date.now&&i.now,jn=e.setTimeout!==ke.setTimeout&&e.setTimeout,Ln=te.ceil,Un=te.floor,Fn=ee.getOwnPropertySymbols,Bn=ve?ve.isBuffer:V,Wn=e.isFinite,zn=Ve.join,qn=Tn(ee.keys,ee),Hn=te.max,Gn=te.min,Yn=i.now,$n=e.parseInt,Qn=te.random,Xn=Ve.reverse,Zn=LV(e,"DataView"),Kn=LV(e,"Map"),Jn=LV(e,"Promise"),tr=LV(e,"Set"),er=LV(e,"WeakMap"),nr=LV(ee,"create"),rr=er&&new er,ir={},Vr=uo(Zn),or=uo(Kn),sr=uo(Jn),ar=uo(tr),cr=uo(er),ur=be?be.prototype:V,hr=ur?ur.valueOf:V,lr=ur?ur.toString:V;function fr(t){if(Es(t)&&!vs(t)&&!(t instanceof vr)){if(t instanceof gr)return t;if(ue.call(t,"__wrapped__"))return ho(t)}return new gr(t)}var dr=function(){function t(){}return function(e){if(!Ts(e))return{};if(Pe)return Pe(e);t.prototype=e;var n=new t;return t.prototype=V,n}}();function pr(){}function gr(t,e){this.__wrapped__=t,this.__actions__=[],this.__chain__=!!e,this.__index__=0,this.__values__=V}function vr(t){this.__wrapped__=t,this.__actions__=[],this.__dir__=1,this.__filtered__=!1,this.__iteratees__=[],this.__takeCount__=j,this.__views__=[]}function yr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function mr(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function br(t){var e=-1,n=null==t?0:t.length;for(this.clear();++e<n;){var r=t[e];this.set(r[0],r[1])}}function _r(t){var e=-1,n=null==t?0:t.length;for(this.__data__=new br;++e<n;)this.add(t[e])}function wr(t){var e=this.__data__=new mr(t);this.size=e.size}function Ar(t,e){var n=vs(t),r=!n&&gs(t),i=!n&&!r&&_s(t),V=!n&&!r&&!i&&Ns(t),o=n||r||i||V,s=o?gn(t.length,re):[],a=s.length;for(var c in t)!e&&!ue.call(t,c)||o&&("length"==c||i&&("offset"==c||"parent"==c)||V&&("buffer"==c||"byteLength"==c||"byteOffset"==c)||HV(c,a))||s.push(c);return s}function Sr(t){var e=t.length;return e?t[_i(0,e-1)]:V}function xr(t,e){return so(nV(t),Dr(e,0,t.length))}function Cr(t){return so(nV(t))}function Tr(t,e,n){(n===V||fs(t[e],n))&&(n!==V||e in t)||Pr(t,e,n)}function Er(t,e,n){var r=t[e];ue.call(t,e)&&fs(r,n)&&(n!==V||e in t)||Pr(t,e,n)}function Rr(t,e){for(var n=t.length;n--;)if(fs(t[n][0],e))return n;return-1}function Mr(t,e,n,r){return Ur(t,function(t,i,V){e(r,t,n(t),V)}),r}function Or(t,e){return t&&rV(e,ia(e),t)}function Pr(t,e,n){"__proto__"==e&&fn?fn(t,e,{configurable:!0,enumerable:!0,value:n,writable:!0}):t[e]=n}function kr(t,e){for(var n=-1,i=e.length,o=r(i),s=null==t;++n<i;)o[n]=s?V:Js(t,e[n]);return o}function Dr(t,e,n){return t==t&&(n!==V&&(t=t<=n?t:n),e!==V&&(t=t>=e?t:e)),t}function Ir(t,e,n,r,i,o){var s,a=e&l,c=e&f,u=e&d;if(n&&(s=i?n(t,r,i,o):n(t)),s!==V)return s;if(!Ts(t))return t;var h=vs(t);if(h){if(s=function(t){var e=t.length,n=new t.constructor(e);e&&"string"==typeof t[0]&&ue.call(t,"index")&&(n.index=t.index,n.input=t.input);return n}(t),!a)return nV(t,s)}else{var p=BV(t),g=p==$||p==Q;if(_s(t))return Xi(t,a);if(p==J||p==B||g&&!i){if(s=c||g?{}:zV(t),!a)return c?function(t,e){return rV(t,FV(t),e)}(t,function(t,e){return t&&rV(e,Va(e),t)}(s,t)):function(t,e){return rV(t,UV(t),e)}(t,Or(s,t))}else{if(!Te[p])return i?t:{};s=function(t,e,n){var r=t.constructor;switch(e){case at:return Zi(t);case q:case H:return new r(+t);case ct:return function(t,e){var n=e?Zi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.byteLength)}(t,n);case ut:case ht:case lt:case ft:case dt:case pt:case gt:case vt:case yt:return Ki(t,n);case X:return new r;case Z:case rt:return new r(t);case et:return function(t){var e=new t.constructor(t.source,zt.exec(t));return e.lastIndex=t.lastIndex,e}(t);case nt:return new r;case it:return i=t,hr?ee(hr.call(i)):{}}var i}(t,p,a)}}o||(o=new wr);var v=o.get(t);if(v)return v;o.set(t,s),ks(t)?t.forEach(function(r){s.add(Ir(r,e,n,r,t,o))}):Rs(t)&&t.forEach(function(r,i){s.set(i,Ir(r,e,n,i,t,o))});var y=h?V:(u?c?OV:MV:c?Va:ia)(t);return Ye(y||t,function(r,i){y&&(r=t[i=r]),Er(s,i,Ir(r,e,n,i,t,o))}),s}function Nr(t,e,n){var r=n.length;if(null==t)return!r;for(t=ee(t);r--;){var i=n[r],o=e[i],s=t[i];if(s===V&&!(i in t)||!o(s))return!1}return!0}function jr(t,e,n){if("function"!=typeof t)throw new ie(a);return ro(function(){t.apply(V,n)},e)}function Lr(t,e,n,r){var i=-1,V=Ze,s=!0,a=t.length,c=[],u=e.length;if(!a)return c;n&&(e=Je(e,vn(n))),r?(V=Ke,s=!1):e.length>=o&&(V=mn,s=!1,e=new _r(e));t:for(;++i<a;){var h=t[i],l=null==n?h:n(h);if(h=r||0!==h?h:0,s&&l==l){for(var f=u;f--;)if(e[f]===l)continue t;c.push(h)}else V(e,l,r)||c.push(h)}return c}fr.templateSettings={escape:Ct,evaluate:Tt,interpolate:Et,variable:"",imports:{_:fr}},fr.prototype=pr.prototype,fr.prototype.constructor=fr,gr.prototype=dr(pr.prototype),gr.prototype.constructor=gr,vr.prototype=dr(pr.prototype),vr.prototype.constructor=vr,yr.prototype.clear=function(){this.__data__=nr?nr(null):{},this.size=0},yr.prototype.delete=function(t){var e=this.has(t)&&delete this.__data__[t];return this.size-=e?1:0,e},yr.prototype.get=function(t){var e=this.__data__;if(nr){var n=e[t];return n===c?V:n}return ue.call(e,t)?e[t]:V},yr.prototype.has=function(t){var e=this.__data__;return nr?e[t]!==V:ue.call(e,t)},yr.prototype.set=function(t,e){var n=this.__data__;return this.size+=this.has(t)?0:1,n[t]=nr&&e===V?c:e,this},mr.prototype.clear=function(){this.__data__=[],this.size=0},mr.prototype.delete=function(t){var e=this.__data__,n=Rr(e,t);return!(n<0)&&(n==e.length-1?e.pop():Ie.call(e,n,1),--this.size,!0)},mr.prototype.get=function(t){var e=this.__data__,n=Rr(e,t);return n<0?V:e[n][1]},mr.prototype.has=function(t){return Rr(this.__data__,t)>-1},mr.prototype.set=function(t,e){var n=this.__data__,r=Rr(n,t);return r<0?(++this.size,n.push([t,e])):n[r][1]=e,this},br.prototype.clear=function(){this.size=0,this.__data__={hash:new yr,map:new(Kn||mr),string:new yr}},br.prototype.delete=function(t){var e=NV(this,t).delete(t);return this.size-=e?1:0,e},br.prototype.get=function(t){return NV(this,t).get(t)},br.prototype.has=function(t){return NV(this,t).has(t)},br.prototype.set=function(t,e){var n=NV(this,t),r=n.size;return n.set(t,e),this.size+=n.size==r?0:1,this},_r.prototype.add=_r.prototype.push=function(t){return this.__data__.set(t,c),this},_r.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.clear=function(){this.__data__=new mr,this.size=0},wr.prototype.delete=function(t){var e=this.__data__,n=e.delete(t);return this.size=e.size,n},wr.prototype.get=function(t){return this.__data__.get(t)},wr.prototype.has=function(t){return this.__data__.has(t)},wr.prototype.set=function(t,e){var n=this.__data__;if(n instanceof mr){var r=n.__data__;if(!Kn||r.length<o-1)return r.push([t,e]),this.size=++n.size,this;n=this.__data__=new br(r)}return n.set(t,e),this.size=n.size,this};var Ur=oV(Yr),Fr=oV($r,!0);function Br(t,e){var n=!0;return Ur(t,function(t,r,i){return n=!!e(t,r,i)}),n}function Wr(t,e,n){for(var r=-1,i=t.length;++r<i;){var o=t[r],s=e(o);if(null!=s&&(a===V?s==s&&!Is(s):n(s,a)))var a=s,c=o}return c}function zr(t,e){var n=[];return Ur(t,function(t,r,i){e(t,r,i)&&n.push(t)}),n}function qr(t,e,n,r,i){var V=-1,o=t.length;for(n||(n=qV),i||(i=[]);++V<o;){var s=t[V];e>0&&n(s)?e>1?qr(s,e-1,n,r,i):tn(i,s):r||(i[i.length]=s)}return i}var Hr=sV(),Gr=sV(!0);function Yr(t,e){return t&&Hr(t,e,ia)}function $r(t,e){return t&&Gr(t,e,ia)}function Qr(t,e){return Xe(e,function(e){return Ss(t[e])})}function Xr(t,e){for(var n=0,r=(e=Gi(e,t)).length;null!=t&&n<r;)t=t[co(e[n++])];return n&&n==r?t:V}function Zr(t,e,n){var r=e(t);return vs(t)?r:tn(r,n(t))}function Kr(t){return null==t?t===V?Vt:K:Vn&&Vn in ee(t)?function(t){var e=ue.call(t,Vn),n=t[Vn];try{t[Vn]=V;var r=!0}catch(t){}var i=fe.call(t);r&&(e?t[Vn]=n:delete t[Vn]);return i}(t):function(t){return fe.call(t)}(t)}function Jr(t,e){return t>e}function ti(t,e){return null!=t&&ue.call(t,e)}function ei(t,e){return null!=t&&e in ee(t)}function ni(t,e,n){for(var i=n?Ke:Ze,o=t[0].length,s=t.length,a=s,c=r(s),u=1/0,h=[];a--;){var l=t[a];a&&e&&(l=Je(l,vn(e))),u=Gn(l.length,u),c[a]=!n&&(e||o>=120&&l.length>=120)?new _r(a&&l):V}l=t[0];var f=-1,d=c[0];t:for(;++f<o&&h.length<u;){var p=l[f],g=e?e(p):p;if(p=n||0!==p?p:0,!(d?mn(d,g):i(h,g,n))){for(a=s;--a;){var v=c[a];if(!(v?mn(v,g):i(t[a],g,n)))continue t}d&&d.push(g),h.push(p)}}return h}function ri(t,e,n){var r=null==(t=to(t,e=Gi(e,t)))?t:t[co(Ao(e))];return null==r?V:He(r,t,n)}function ii(t){return Es(t)&&Kr(t)==B}function Vi(t,e,n,r,i){return t===e||(null==t||null==e||!Es(t)&&!Es(e)?t!=t&&e!=e:function(t,e,n,r,i,o){var s=vs(t),a=vs(e),c=s?W:BV(t),u=a?W:BV(e),h=(c=c==B?J:c)==J,l=(u=u==B?J:u)==J,f=c==u;if(f&&_s(t)){if(!_s(e))return!1;s=!0,h=!1}if(f&&!h)return o||(o=new wr),s||Ns(t)?EV(t,e,n,r,i,o):function(t,e,n,r,i,V,o){switch(n){case ct:if(t.byteLength!=e.byteLength||t.byteOffset!=e.byteOffset)return!1;t=t.buffer,e=e.buffer;case at:return!(t.byteLength!=e.byteLength||!V(new we(t),new we(e)));case q:case H:case Z:return fs(+t,+e);case Y:return t.name==e.name&&t.message==e.message;case et:case rt:return t==e+"";case X:var s=Cn;case nt:var a=r&p;if(s||(s=Rn),t.size!=e.size&&!a)return!1;var c=o.get(t);if(c)return c==e;r|=g,o.set(t,e);var u=EV(s(t),s(e),r,i,V,o);return o.delete(t),u;case it:if(hr)return hr.call(t)==hr.call(e)}return!1}(t,e,c,n,r,i,o);if(!(n&p)){var d=h&&ue.call(t,"__wrapped__"),v=l&&ue.call(e,"__wrapped__");if(d||v){var y=d?t.value():t,m=v?e.value():e;return o||(o=new wr),i(y,m,n,r,o)}}if(!f)return!1;return o||(o=new wr),function(t,e,n,r,i,o){var s=n&p,a=MV(t),c=a.length,u=MV(e).length;if(c!=u&&!s)return!1;var h=c;for(;h--;){var l=a[h];if(!(s?l in e:ue.call(e,l)))return!1}var f=o.get(t);if(f&&o.get(e))return f==e;var d=!0;o.set(t,e),o.set(e,t);var g=s;for(;++h<c;){l=a[h];var v=t[l],y=e[l];if(r)var m=s?r(y,v,l,e,t,o):r(v,y,l,t,e,o);if(!(m===V?v===y||i(v,y,n,r,o):m)){d=!1;break}g||(g="constructor"==l)}if(d&&!g){var b=t.constructor,_=e.constructor;b!=_&&"constructor"in t&&"constructor"in e&&!("function"==typeof b&&b instanceof b&&"function"==typeof _&&_ instanceof _)&&(d=!1)}return o.delete(t),o.delete(e),d}(t,e,n,r,i,o)}(t,e,n,r,Vi,i))}function oi(t,e,n,r){var i=n.length,o=i,s=!r;if(null==t)return!o;for(t=ee(t);i--;){var a=n[i];if(s&&a[2]?a[1]!==t[a[0]]:!(a[0]in t))return!1}for(;++i<o;){var c=(a=n[i])[0],u=t[c],h=a[1];if(s&&a[2]){if(u===V&&!(c in t))return!1}else{var l=new wr;if(r)var f=r(u,h,c,t,e,l);if(!(f===V?Vi(h,u,p|g,r,l):f))return!1}}return!0}function si(t){return!(!Ts(t)||(e=t,le&&le in e))&&(Ss(t)?ge:Gt).test(uo(t));var e}function ai(t){return"function"==typeof t?t:null==t?Ma:"object"==typeof t?vs(t)?di(t[0],t[1]):fi(t):Ua(t)}function ci(t){if(!XV(t))return qn(t);var e=[];for(var n in ee(t))ue.call(t,n)&&"constructor"!=n&&e.push(n);return e}function ui(t){if(!Ts(t))return function(t){var e=[];if(null!=t)for(var n in ee(t))e.push(n);return e}(t);var e=XV(t),n=[];for(var r in t)("constructor"!=r||!e&&ue.call(t,r))&&n.push(r);return n}function hi(t,e){return t<e}function li(t,e){var n=-1,i=ms(t)?r(t.length):[];return Ur(t,function(t,r,V){i[++n]=e(t,r,V)}),i}function fi(t){var e=jV(t);return 1==e.length&&e[0][2]?KV(e[0][0],e[0][1]):function(n){return n===t||oi(n,t,e)}}function di(t,e){return YV(t)&&ZV(e)?KV(co(t),e):function(n){var r=Js(n,t);return r===V&&r===e?ta(n,t):Vi(e,r,p|g)}}function pi(t,e,n,r,i){t!==e&&Hr(e,function(o,s){if(i||(i=new wr),Ts(o))!function(t,e,n,r,i,o,s){var a=eo(t,n),c=eo(e,n),u=s.get(c);if(u)return void Tr(t,n,u);var h=o?o(a,c,n+"",t,e,s):V,l=h===V;if(l){var f=vs(c),d=!f&&_s(c),p=!f&&!d&&Ns(c);h=c,f||d||p?vs(a)?h=a:bs(a)?h=nV(a):d?(l=!1,h=Xi(c,!0)):p?(l=!1,h=Ki(c,!0)):h=[]:Os(c)||gs(c)?(h=a,gs(a)?h=qs(a):Ts(a)&&!Ss(a)||(h=zV(c))):l=!1}l&&(s.set(c,h),i(h,c,r,o,s),s.delete(c));Tr(t,n,h)}(t,e,s,n,pi,r,i);else{var a=r?r(eo(t,s),o,s+"",t,e,i):V;a===V&&(a=o),Tr(t,s,a)}},Va)}function gi(t,e){var n=t.length;if(n)return HV(e+=e<0?n:0,n)?t[e]:V}function vi(t,e,n){var r=-1;return e=Je(e.length?e:[Ma],vn(IV())),function(t,e){var n=t.length;for(t.sort(e);n--;)t[n]=t[n].value;return t}(li(t,function(t,n,i){return{criteria:Je(e,function(e){return e(t)}),index:++r,value:t}}),function(t,e){return function(t,e,n){var r=-1,i=t.criteria,V=e.criteria,o=i.length,s=n.length;for(;++r<o;){var a=Ji(i[r],V[r]);if(a){if(r>=s)return a;var c=n[r];return a*("desc"==c?-1:1)}}return t.index-e.index}(t,e,n)})}function yi(t,e,n){for(var r=-1,i=e.length,V={};++r<i;){var o=e[r],s=Xr(t,o);n(s,o)&&Ci(V,Gi(o,t),s)}return V}function mi(t,e,n,r){var i=r?cn:an,V=-1,o=e.length,s=t;for(t===e&&(e=nV(e)),n&&(s=Je(t,vn(n)));++V<o;)for(var a=0,c=e[V],u=n?n(c):c;(a=i(s,u,a,r))>-1;)s!==t&&Ie.call(s,a,1),Ie.call(t,a,1);return t}function bi(t,e){for(var n=t?e.length:0,r=n-1;n--;){var i=e[n];if(n==r||i!==V){var V=i;HV(i)?Ie.call(t,i,1):Li(t,i)}}return t}function _i(t,e){return t+Un(Qn()*(e-t+1))}function wi(t,e){var n="";if(!t||e<1||e>D)return n;do{e%2&&(n+=t),(e=Un(e/2))&&(t+=t)}while(e);return n}function Ai(t,e){return io(JV(t,e,Ma),t+"")}function Si(t){return Sr(fa(t))}function xi(t,e){var n=fa(t);return so(n,Dr(e,0,n.length))}function Ci(t,e,n,r){if(!Ts(t))return t;for(var i=-1,o=(e=Gi(e,t)).length,s=o-1,a=t;null!=a&&++i<o;){var c=co(e[i]),u=n;if(i!=s){var h=a[c];(u=r?r(h,c,a):V)===V&&(u=Ts(h)?h:HV(e[i+1])?[]:{})}Er(a,c,u),a=a[c]}return t}var Ti=rr?function(t,e){return rr.set(t,e),t}:Ma,Ei=fn?function(t,e){return fn(t,"toString",{configurable:!0,enumerable:!1,value:Ta(e),writable:!0})}:Ma;function Ri(t){return so(fa(t))}function Mi(t,e,n){var i=-1,V=t.length;e<0&&(e=-e>V?0:V+e),(n=n>V?V:n)<0&&(n+=V),V=e>n?0:n-e>>>0,e>>>=0;for(var o=r(V);++i<V;)o[i]=t[i+e];return o}function Oi(t,e){var n;return Ur(t,function(t,r,i){return!(n=e(t,r,i))}),!!n}function Pi(t,e,n){var r=0,i=null==t?r:t.length;if("number"==typeof e&&e==e&&i<=U){for(;r<i;){var V=r+i>>>1,o=t[V];null!==o&&!Is(o)&&(n?o<=e:o<e)?r=V+1:i=V}return i}return ki(t,e,Ma,n)}function ki(t,e,n,r){e=n(e);for(var i=0,o=null==t?0:t.length,s=e!=e,a=null===e,c=Is(e),u=e===V;i<o;){var h=Un((i+o)/2),l=n(t[h]),f=l!==V,d=null===l,p=l==l,g=Is(l);if(s)var v=r||p;else v=u?p&&(r||f):a?p&&f&&(r||!d):c?p&&f&&!d&&(r||!g):!d&&!g&&(r?l<=e:l<e);v?i=h+1:o=h}return Gn(o,L)}function Di(t,e){for(var n=-1,r=t.length,i=0,V=[];++n<r;){var o=t[n],s=e?e(o):o;if(!n||!fs(s,a)){var a=s;V[i++]=0===o?0:o}}return V}function Ii(t){return"number"==typeof t?t:Is(t)?N:+t}function Ni(t){if("string"==typeof t)return t;if(vs(t))return Je(t,Ni)+"";if(Is(t))return lr?lr.call(t):"";var e=t+"";return"0"==e&&1/t==-k?"-0":e}function ji(t,e,n){var r=-1,i=Ze,V=t.length,s=!0,a=[],c=a;if(n)s=!1,i=Ke;else if(V>=o){var u=e?null:wV(t);if(u)return Rn(u);s=!1,i=mn,c=new _r}else c=e?[]:a;t:for(;++r<V;){var h=t[r],l=e?e(h):h;if(h=n||0!==h?h:0,s&&l==l){for(var f=c.length;f--;)if(c[f]===l)continue t;e&&c.push(l),a.push(h)}else i(c,l,n)||(c!==a&&c.push(l),a.push(h))}return a}function Li(t,e){return null==(t=to(t,e=Gi(e,t)))||delete t[co(Ao(e))]}function Ui(t,e,n,r){return Ci(t,e,n(Xr(t,e)),r)}function Fi(t,e,n,r){for(var i=t.length,V=r?i:-1;(r?V--:++V<i)&&e(t[V],V,t););return n?Mi(t,r?0:V,r?V+1:i):Mi(t,r?V+1:0,r?i:V)}function Bi(t,e){var n=t;return n instanceof vr&&(n=n.value()),en(e,function(t,e){return e.func.apply(e.thisArg,tn([t],e.args))},n)}function Wi(t,e,n){var i=t.length;if(i<2)return i?ji(t[0]):[];for(var V=-1,o=r(i);++V<i;)for(var s=t[V],a=-1;++a<i;)a!=V&&(o[V]=Lr(o[V]||s,t[a],e,n));return ji(qr(o,1),e,n)}function zi(t,e,n){for(var r=-1,i=t.length,o=e.length,s={};++r<i;){var a=r<o?e[r]:V;n(s,t[r],a)}return s}function qi(t){return bs(t)?t:[]}function Hi(t){return"function"==typeof t?t:Ma}function Gi(t,e){return vs(t)?t:YV(t,e)?[t]:ao(Hs(t))}var Yi=Ai;function $i(t,e,n){var r=t.length;return n=n===V?r:n,!e&&n>=r?t:Mi(t,e,n)}var Qi=In||function(t){return ke.clearTimeout(t)};function Xi(t,e){if(e)return t.slice();var n=t.length,r=Ee?Ee(n):new t.constructor(n);return t.copy(r),r}function Zi(t){var e=new t.constructor(t.byteLength);return new we(e).set(new we(t)),e}function Ki(t,e){var n=e?Zi(t.buffer):t.buffer;return new t.constructor(n,t.byteOffset,t.length)}function Ji(t,e){if(t!==e){var n=t!==V,r=null===t,i=t==t,o=Is(t),s=e!==V,a=null===e,c=e==e,u=Is(e);if(!a&&!u&&!o&&t>e||o&&s&&c&&!a&&!u||r&&s&&c||!n&&c||!i)return 1;if(!r&&!o&&!u&&t<e||u&&n&&i&&!r&&!o||a&&n&&i||!s&&i||!c)return-1}return 0}function tV(t,e,n,i){for(var V=-1,o=t.length,s=n.length,a=-1,c=e.length,u=Hn(o-s,0),h=r(c+u),l=!i;++a<c;)h[a]=e[a];for(;++V<s;)(l||V<o)&&(h[n[V]]=t[V]);for(;u--;)h[a++]=t[V++];return h}function eV(t,e,n,i){for(var V=-1,o=t.length,s=-1,a=n.length,c=-1,u=e.length,h=Hn(o-a,0),l=r(h+u),f=!i;++V<h;)l[V]=t[V];for(var d=V;++c<u;)l[d+c]=e[c];for(;++s<a;)(f||V<o)&&(l[d+n[s]]=t[V++]);return l}function nV(t,e){var n=-1,i=t.length;for(e||(e=r(i));++n<i;)e[n]=t[n];return e}function rV(t,e,n,r){var i=!n;n||(n={});for(var o=-1,s=e.length;++o<s;){var a=e[o],c=r?r(n[a],t[a],a,n,t):V;c===V&&(c=t[a]),i?Pr(n,a,c):Er(n,a,c)}return n}function iV(t,e){return function(n,r){var i=vs(n)?Ge:Mr,V=e?e():{};return i(n,t,IV(r,2),V)}}function VV(t){return Ai(function(e,n){var r=-1,i=n.length,o=i>1?n[i-1]:V,s=i>2?n[2]:V;for(o=t.length>3&&"function"==typeof o?(i--,o):V,s&&GV(n[0],n[1],s)&&(o=i<3?V:o,i=1),e=ee(e);++r<i;){var a=n[r];a&&t(e,a,r,o)}return e})}function oV(t,e){return function(n,r){if(null==n)return n;if(!ms(n))return t(n,r);for(var i=n.length,V=e?i:-1,o=ee(n);(e?V--:++V<i)&&!1!==r(o[V],V,o););return n}}function sV(t){return function(e,n,r){for(var i=-1,V=ee(e),o=r(e),s=o.length;s--;){var a=o[t?s:++i];if(!1===n(V[a],a,V))break}return e}}function aV(t){return function(e){var n=xn(e=Hs(e))?Pn(e):V,r=n?n[0]:e.charAt(0),i=n?$i(n,1).join(""):e.slice(1);return r[t]()+i}}function cV(t){return function(e){return en(Sa(ga(e).replace(ye,"")),t,"")}}function uV(t){return function(){var e=arguments;switch(e.length){case 0:return new t;case 1:return new t(e[0]);case 2:return new t(e[0],e[1]);case 3:return new t(e[0],e[1],e[2]);case 4:return new t(e[0],e[1],e[2],e[3]);case 5:return new t(e[0],e[1],e[2],e[3],e[4]);case 6:return new t(e[0],e[1],e[2],e[3],e[4],e[5]);case 7:return new t(e[0],e[1],e[2],e[3],e[4],e[5],e[6])}var n=dr(t.prototype),r=t.apply(n,e);return Ts(r)?r:n}}function hV(t){return function(e,n,r){var i=ee(e);if(!ms(e)){var o=IV(n,3);e=ia(e),n=function(t){return o(i[t],t,i)}}var s=t(e,n,r);return s>-1?i[o?e[s]:s]:V}}function lV(t){return RV(function(e){var n=e.length,r=n,i=gr.prototype.thru;for(t&&e.reverse();r--;){var o=e[r];if("function"!=typeof o)throw new ie(a);if(i&&!s&&"wrapper"==kV(o))var s=new gr([],!0)}for(r=s?r:n;++r<n;){var c=kV(o=e[r]),u="wrapper"==c?PV(o):V;s=u&&$V(u[0])&&u[1]==(S|b|w|x)&&!u[4].length&&1==u[9]?s[kV(u[0])].apply(s,u[3]):1==o.length&&$V(o)?s[c]():s.thru(o)}return function(){var t=arguments,r=t[0];if(s&&1==t.length&&vs(r))return s.plant(r).value();for(var i=0,V=n?e[i].apply(this,t):r;++i<n;)V=e[i].call(this,V);return V}})}function fV(t,e,n,i,o,s,a,c,u,h){var l=e&S,f=e&v,d=e&y,p=e&(b|_),g=e&C,m=d?V:uV(t);return function v(){for(var y=arguments.length,b=r(y),_=y;_--;)b[_]=arguments[_];if(p)var w=DV(v),A=function(t,e){for(var n=t.length,r=0;n--;)t[n]===e&&++r;return r}(b,w);if(i&&(b=tV(b,i,o,p)),s&&(b=eV(b,s,a,p)),y-=A,p&&y<h){var S=En(b,w);return bV(t,e,fV,v.placeholder,n,b,S,c,u,h-y)}var x=f?n:this,C=d?x[t]:t;return y=b.length,c?b=function(t,e){var n=t.length,r=Gn(e.length,n),i=nV(t);for(;r--;){var o=e[r];t[r]=HV(o,n)?i[o]:V}return t}(b,c):g&&y>1&&b.reverse(),l&&u<y&&(b.length=u),this&&this!==ke&&this instanceof v&&(C=m||uV(C)),C.apply(x,b)}}function dV(t,e){return function(n,r){return function(t,e,n,r){return Yr(t,function(t,i,V){e(r,n(t),i,V)}),r}(n,t,e(r),{})}}function pV(t,e){return function(n,r){var i;if(n===V&&r===V)return e;if(n!==V&&(i=n),r!==V){if(i===V)return r;"string"==typeof n||"string"==typeof r?(n=Ni(n),r=Ni(r)):(n=Ii(n),r=Ii(r)),i=t(n,r)}return i}}function gV(t){return RV(function(e){return e=Je(e,vn(IV())),Ai(function(n){var r=this;return t(e,function(t){return He(t,r,n)})})})}function vV(t,e){var n=(e=e===V?" ":Ni(e)).length;if(n<2)return n?wi(e,t):e;var r=wi(e,Ln(t/On(e)));return xn(e)?$i(Pn(r),0,t).join(""):r.slice(0,t)}function yV(t){return function(e,n,i){return i&&"number"!=typeof i&&GV(e,n,i)&&(n=i=V),e=Fs(e),n===V?(n=e,e=0):n=Fs(n),function(t,e,n,i){for(var V=-1,o=Hn(Ln((e-t)/(n||1)),0),s=r(o);o--;)s[i?o:++V]=t,t+=n;return s}(e,n,i=i===V?e<n?1:-1:Fs(i),t)}}function mV(t){return function(e,n){return"string"==typeof e&&"string"==typeof n||(e=zs(e),n=zs(n)),t(e,n)}}function bV(t,e,n,r,i,o,s,a,c,u){var h=e&b;e|=h?w:A,(e&=~(h?A:w))&m||(e&=~(v|y));var l=[t,e,i,h?o:V,h?s:V,h?V:o,h?V:s,a,c,u],f=n.apply(V,l);return $V(t)&&no(f,l),f.placeholder=r,Vo(f,t,e)}function _V(t){var e=te[t];return function(t,n){if(t=zs(t),(n=null==n?0:Gn(Bs(n),292))&&Wn(t)){var r=(Hs(t)+"e").split("e");return+((r=(Hs(e(r[0]+"e"+(+r[1]+n)))+"e").split("e"))[0]+"e"+(+r[1]-n))}return e(t)}}var wV=tr&&1/Rn(new tr([,-0]))[1]==k?function(t){return new tr(t)}:Ia;function AV(t){return function(e){var n=BV(e);return n==X?Cn(e):n==nt?Mn(e):function(t,e){return Je(e,function(e){return[e,t[e]]})}(e,t(e))}}function SV(t,e,n,i,o,s,c,u){var l=e&y;if(!l&&"function"!=typeof t)throw new ie(a);var f=i?i.length:0;if(f||(e&=~(w|A),i=o=V),c=c===V?c:Hn(Bs(c),0),u=u===V?u:Bs(u),f-=o?o.length:0,e&A){var d=i,p=o;i=o=V}var g=l?V:PV(t),C=[t,e,n,i,o,d,p,s,c,u];if(g&&function(t,e){var n=t[1],r=e[1],i=n|r,V=i<(v|y|S),o=r==S&&n==b||r==S&&n==x&&t[7].length<=e[8]||r==(S|x)&&e[7].length<=e[8]&&n==b;if(!V&&!o)return t;r&v&&(t[2]=e[2],i|=n&v?0:m);var s=e[3];if(s){var a=t[3];t[3]=a?tV(a,s,e[4]):s,t[4]=a?En(t[3],h):e[4]}(s=e[5])&&(a=t[5],t[5]=a?eV(a,s,e[6]):s,t[6]=a?En(t[5],h):e[6]);(s=e[7])&&(t[7]=s);r&S&&(t[8]=null==t[8]?e[8]:Gn(t[8],e[8]));null==t[9]&&(t[9]=e[9]);t[0]=e[0],t[1]=i}(C,g),t=C[0],e=C[1],n=C[2],i=C[3],o=C[4],!(u=C[9]=C[9]===V?l?0:t.length:Hn(C[9]-f,0))&&e&(b|_)&&(e&=~(b|_)),e&&e!=v)T=e==b||e==_?function(t,e,n){var i=uV(t);return function o(){for(var s=arguments.length,a=r(s),c=s,u=DV(o);c--;)a[c]=arguments[c];var h=s<3&&a[0]!==u&&a[s-1]!==u?[]:En(a,u);return(s-=h.length)<n?bV(t,e,fV,o.placeholder,V,a,h,V,V,n-s):He(this&&this!==ke&&this instanceof o?i:t,this,a)}}(t,e,u):e!=w&&e!=(v|w)||o.length?fV.apply(V,C):function(t,e,n,i){var V=e&v,o=uV(t);return function e(){for(var s=-1,a=arguments.length,c=-1,u=i.length,h=r(u+a),l=this&&this!==ke&&this instanceof e?o:t;++c<u;)h[c]=i[c];for(;a--;)h[c++]=arguments[++s];return He(l,V?n:this,h)}}(t,e,n,i);else var T=function(t,e,n){var r=e&v,i=uV(t);return function e(){return(this&&this!==ke&&this instanceof e?i:t).apply(r?n:this,arguments)}}(t,e,n);return Vo((g?Ti:no)(T,C),t,e)}function xV(t,e,n,r){return t===V||fs(t,se[n])&&!ue.call(r,n)?e:t}function CV(t,e,n,r,i,o){return Ts(t)&&Ts(e)&&(o.set(e,t),pi(t,e,V,CV,o),o.delete(e)),t}function TV(t){return Os(t)?V:t}function EV(t,e,n,r,i,o){var s=n&p,a=t.length,c=e.length;if(a!=c&&!(s&&c>a))return!1;var u=o.get(t);if(u&&o.get(e))return u==e;var h=-1,l=!0,f=n&g?new _r:V;for(o.set(t,e),o.set(e,t);++h<a;){var d=t[h],v=e[h];if(r)var y=s?r(v,d,h,e,t,o):r(d,v,h,t,e,o);if(y!==V){if(y)continue;l=!1;break}if(f){if(!rn(e,function(t,e){if(!mn(f,e)&&(d===t||i(d,t,n,r,o)))return f.push(e)})){l=!1;break}}else if(d!==v&&!i(d,v,n,r,o)){l=!1;break}}return o.delete(t),o.delete(e),l}function RV(t){return io(JV(t,V,yo),t+"")}function MV(t){return Zr(t,ia,UV)}function OV(t){return Zr(t,Va,FV)}var PV=rr?function(t){return rr.get(t)}:Ia;function kV(t){for(var e=t.name+"",n=ir[e],r=ue.call(ir,e)?n.length:0;r--;){var i=n[r],V=i.func;if(null==V||V==t)return i.name}return e}function DV(t){return(ue.call(fr,"placeholder")?fr:t).placeholder}function IV(){var t=fr.iteratee||Oa;return t=t===Oa?ai:t,arguments.length?t(arguments[0],arguments[1]):t}function NV(t,e){var n,r,i=t.__data__;return("string"==(r=typeof(n=e))||"number"==r||"symbol"==r||"boolean"==r?"__proto__"!==n:null===n)?i["string"==typeof e?"string":"hash"]:i.map}function jV(t){for(var e=ia(t),n=e.length;n--;){var r=e[n],i=t[r];e[n]=[r,i,ZV(i)]}return e}function LV(t,e){var n=function(t,e){return null==t?V:t[e]}(t,e);return si(n)?n:V}var UV=Fn?function(t){return null==t?[]:(t=ee(t),Xe(Fn(t),function(e){return De.call(t,e)}))}:Wa,FV=Fn?function(t){for(var e=[];t;)tn(e,UV(t)),t=Oe(t);return e}:Wa,BV=Kr;function WV(t,e,n){for(var r=-1,i=(e=Gi(e,t)).length,V=!1;++r<i;){var o=co(e[r]);if(!(V=null!=t&&n(t,o)))break;t=t[o]}return V||++r!=i?V:!!(i=null==t?0:t.length)&&Cs(i)&&HV(o,i)&&(vs(t)||gs(t))}function zV(t){return"function"!=typeof t.constructor||XV(t)?{}:dr(Oe(t))}function qV(t){return vs(t)||gs(t)||!!(je&&t&&t[je])}function HV(t,e){var n=typeof t;return!!(e=null==e?D:e)&&("number"==n||"symbol"!=n&&$t.test(t))&&t>-1&&t%1==0&&t<e}function GV(t,e,n){if(!Ts(n))return!1;var r=typeof e;return!!("number"==r?ms(n)&&HV(e,n.length):"string"==r&&e in n)&&fs(n[e],t)}function YV(t,e){if(vs(t))return!1;var n=typeof t;return!("number"!=n&&"symbol"!=n&&"boolean"!=n&&null!=t&&!Is(t))||(Mt.test(t)||!Rt.test(t)||null!=e&&t in ee(e))}function $V(t){var e=kV(t),n=fr[e];if("function"!=typeof n||!(e in vr.prototype))return!1;if(t===n)return!0;var r=PV(n);return!!r&&t===r[0]}(Zn&&BV(new Zn(new ArrayBuffer(1)))!=ct||Kn&&BV(new Kn)!=X||Jn&&"[object Promise]"!=BV(Jn.resolve())||tr&&BV(new tr)!=nt||er&&BV(new er)!=ot)&&(BV=function(t){var e=Kr(t),n=e==J?t.constructor:V,r=n?uo(n):"";if(r)switch(r){case Vr:return ct;case or:return X;case sr:return"[object Promise]";case ar:return nt;case cr:return ot}return e});var QV=ae?Ss:za;function XV(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||se)}function ZV(t){return t==t&&!Ts(t)}function KV(t,e){return function(n){return null!=n&&(n[t]===e&&(e!==V||t in ee(n)))}}function JV(t,e,n){return e=Hn(e===V?t.length-1:e,0),function(){for(var i=arguments,V=-1,o=Hn(i.length-e,0),s=r(o);++V<o;)s[V]=i[e+V];V=-1;for(var a=r(e+1);++V<e;)a[V]=i[V];return a[e]=n(s),He(t,this,a)}}function to(t,e){return e.length<2?t:Xr(t,Mi(e,0,-1))}function eo(t,e){if(("constructor"!==e||"function"!=typeof t[e])&&"__proto__"!=e)return t[e]}var no=oo(Ti),ro=jn||function(t,e){return ke.setTimeout(t,e)},io=oo(Ei);function Vo(t,e,n){var r=e+"";return io(t,function(t,e){var n=e.length;if(!n)return t;var r=n-1;return e[r]=(n>1?"& ":"")+e[r],e=e.join(n>2?", ":" "),t.replace(jt,"{\n/* [wrapped with "+e+"] */\n")}(r,function(t,e){return Ye(F,function(n){var r="_."+n[0];e&n[1]&&!Ze(t,r)&&t.push(r)}),t.sort()}(function(t){var e=t.match(Lt);return e?e[1].split(Ut):[]}(r),n)))}function oo(t){var e=0,n=0;return function(){var r=Yn(),i=M-(r-n);if(n=r,i>0){if(++e>=R)return arguments[0]}else e=0;return t.apply(V,arguments)}}function so(t,e){var n=-1,r=t.length,i=r-1;for(e=e===V?r:e;++n<e;){var o=_i(n,i),s=t[o];t[o]=t[n],t[n]=s}return t.length=e,t}var ao=function(t){var e=ss(t,function(t){return n.size===u&&n.clear(),t}),n=e.cache;return e}(function(t){var e=[];return 46===t.charCodeAt(0)&&e.push(""),t.replace(Ot,function(t,n,r,i){e.push(r?i.replace(Bt,"$1"):n||t)}),e});function co(t){if("string"==typeof t||Is(t))return t;var e=t+"";return"0"==e&&1/t==-k?"-0":e}function uo(t){if(null!=t){try{return ce.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function ho(t){if(t instanceof vr)return t.clone();var e=new gr(t.__wrapped__,t.__chain__);return e.__actions__=nV(t.__actions__),e.__index__=t.__index__,e.__values__=t.__values__,e}var lo=Ai(function(t,e){return bs(t)?Lr(t,qr(e,1,bs,!0)):[]}),fo=Ai(function(t,e){var n=Ao(e);return bs(n)&&(n=V),bs(t)?Lr(t,qr(e,1,bs,!0),IV(n,2)):[]}),po=Ai(function(t,e){var n=Ao(e);return bs(n)&&(n=V),bs(t)?Lr(t,qr(e,1,bs,!0),V,n):[]});function go(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Hn(r+i,0)),sn(t,IV(e,3),i)}function vo(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r-1;return n!==V&&(i=Bs(n),i=n<0?Hn(r+i,0):Gn(i,r-1)),sn(t,IV(e,3),i,!0)}function yo(t){return(null==t?0:t.length)?qr(t,1):[]}function mo(t){return t&&t.length?t[0]:V}var bo=Ai(function(t){var e=Je(t,qi);return e.length&&e[0]===t[0]?ni(e):[]}),_o=Ai(function(t){var e=Ao(t),n=Je(t,qi);return e===Ao(n)?e=V:n.pop(),n.length&&n[0]===t[0]?ni(n,IV(e,2)):[]}),wo=Ai(function(t){var e=Ao(t),n=Je(t,qi);return(e="function"==typeof e?e:V)&&n.pop(),n.length&&n[0]===t[0]?ni(n,V,e):[]});function Ao(t){var e=null==t?0:t.length;return e?t[e-1]:V}var So=Ai(xo);function xo(t,e){return t&&t.length&&e&&e.length?mi(t,e):t}var Co=RV(function(t,e){var n=null==t?0:t.length,r=kr(t,e);return bi(t,Je(e,function(t){return HV(t,n)?+t:t}).sort(Ji)),r});function To(t){return null==t?t:Xn.call(t)}var Eo=Ai(function(t){return ji(qr(t,1,bs,!0))}),Ro=Ai(function(t){var e=Ao(t);return bs(e)&&(e=V),ji(qr(t,1,bs,!0),IV(e,2))}),Mo=Ai(function(t){var e=Ao(t);return e="function"==typeof e?e:V,ji(qr(t,1,bs,!0),V,e)});function Oo(t){if(!t||!t.length)return[];var e=0;return t=Xe(t,function(t){if(bs(t))return e=Hn(t.length,e),!0}),gn(e,function(e){return Je(t,ln(e))})}function Po(t,e){if(!t||!t.length)return[];var n=Oo(t);return null==e?n:Je(n,function(t){return He(e,V,t)})}var ko=Ai(function(t,e){return bs(t)?Lr(t,e):[]}),Do=Ai(function(t){return Wi(Xe(t,bs))}),Io=Ai(function(t){var e=Ao(t);return bs(e)&&(e=V),Wi(Xe(t,bs),IV(e,2))}),No=Ai(function(t){var e=Ao(t);return e="function"==typeof e?e:V,Wi(Xe(t,bs),V,e)}),jo=Ai(Oo);var Lo=Ai(function(t){var e=t.length,n=e>1?t[e-1]:V;return n="function"==typeof n?(t.pop(),n):V,Po(t,n)});function Uo(t){var e=fr(t);return e.__chain__=!0,e}function Fo(t,e){return e(t)}var Bo=RV(function(t){var e=t.length,n=e?t[0]:0,r=this.__wrapped__,i=function(e){return kr(e,t)};return!(e>1||this.__actions__.length)&&r instanceof vr&&HV(n)?((r=r.slice(n,+n+(e?1:0))).__actions__.push({func:Fo,args:[i],thisArg:V}),new gr(r,this.__chain__).thru(function(t){return e&&!t.length&&t.push(V),t})):this.thru(i)});var Wo=iV(function(t,e,n){ue.call(t,n)?++t[n]:Pr(t,n,1)});var zo=hV(go),qo=hV(vo);function Ho(t,e){return(vs(t)?Ye:Ur)(t,IV(e,3))}function Go(t,e){return(vs(t)?$e:Fr)(t,IV(e,3))}var Yo=iV(function(t,e,n){ue.call(t,n)?t[n].push(e):Pr(t,n,[e])});var $o=Ai(function(t,e,n){var i=-1,V="function"==typeof e,o=ms(t)?r(t.length):[];return Ur(t,function(t){o[++i]=V?He(e,t,n):ri(t,e,n)}),o}),Qo=iV(function(t,e,n){Pr(t,n,e)});function Xo(t,e){return(vs(t)?Je:li)(t,IV(e,3))}var Zo=iV(function(t,e,n){t[n?0:1].push(e)},function(){return[[],[]]});var Ko=Ai(function(t,e){if(null==t)return[];var n=e.length;return n>1&&GV(t,e[0],e[1])?e=[]:n>2&&GV(e[0],e[1],e[2])&&(e=[e[0]]),vi(t,qr(e,1),[])}),Jo=Nn||function(){return ke.Date.now()};function ts(t,e,n){return e=n?V:e,e=t&&null==e?t.length:e,SV(t,S,V,V,V,V,e)}function es(t,e){var n;if("function"!=typeof e)throw new ie(a);return t=Bs(t),function(){return--t>0&&(n=e.apply(this,arguments)),t<=1&&(e=V),n}}var ns=Ai(function(t,e,n){var r=v;if(n.length){var i=En(n,DV(ns));r|=w}return SV(t,r,e,n,i)}),rs=Ai(function(t,e,n){var r=v|y;if(n.length){var i=En(n,DV(rs));r|=w}return SV(e,r,t,n,i)});function is(t,e,n){var r,i,o,s,c,u,h=0,l=!1,f=!1,d=!0;if("function"!=typeof t)throw new ie(a);function p(e){var n=r,o=i;return r=i=V,h=e,s=t.apply(o,n)}function g(t){var n=t-u;return u===V||n>=e||n<0||f&&t-h>=o}function v(){var t=Jo();if(g(t))return y(t);c=ro(v,function(t){var n=e-(t-u);return f?Gn(n,o-(t-h)):n}(t))}function y(t){return c=V,d&&r?p(t):(r=i=V,s)}function m(){var t=Jo(),n=g(t);if(r=arguments,i=this,u=t,n){if(c===V)return function(t){return h=t,c=ro(v,e),l?p(t):s}(u);if(f)return Qi(c),c=ro(v,e),p(u)}return c===V&&(c=ro(v,e)),s}return e=zs(e)||0,Ts(n)&&(l=!!n.leading,o=(f="maxWait"in n)?Hn(zs(n.maxWait)||0,e):o,d="trailing"in n?!!n.trailing:d),m.cancel=function(){c!==V&&Qi(c),h=0,r=u=i=c=V},m.flush=function(){return c===V?s:y(Jo())},m}var Vs=Ai(function(t,e){return jr(t,1,e)}),os=Ai(function(t,e,n){return jr(t,zs(e)||0,n)});function ss(t,e){if("function"!=typeof t||null!=e&&"function"!=typeof e)throw new ie(a);var n=function(){var r=arguments,i=e?e.apply(this,r):r[0],V=n.cache;if(V.has(i))return V.get(i);var o=t.apply(this,r);return n.cache=V.set(i,o)||V,o};return n.cache=new(ss.Cache||br),n}function as(t){if("function"!=typeof t)throw new ie(a);return function(){var e=arguments;switch(e.length){case 0:return!t.call(this);case 1:return!t.call(this,e[0]);case 2:return!t.call(this,e[0],e[1]);case 3:return!t.call(this,e[0],e[1],e[2])}return!t.apply(this,e)}}ss.Cache=br;var cs=Yi(function(t,e){var n=(e=1==e.length&&vs(e[0])?Je(e[0],vn(IV())):Je(qr(e,1),vn(IV()))).length;return Ai(function(r){for(var i=-1,V=Gn(r.length,n);++i<V;)r[i]=e[i].call(this,r[i]);return He(t,this,r)})}),us=Ai(function(t,e){var n=En(e,DV(us));return SV(t,w,V,e,n)}),hs=Ai(function(t,e){var n=En(e,DV(hs));return SV(t,A,V,e,n)}),ls=RV(function(t,e){return SV(t,x,V,V,V,e)});function fs(t,e){return t===e||t!=t&&e!=e}var ds=mV(Jr),ps=mV(function(t,e){return t>=e}),gs=ii(function(){return arguments}())?ii:function(t){return Es(t)&&ue.call(t,"callee")&&!De.call(t,"callee")},vs=r.isArray,ys=Ue?vn(Ue):function(t){return Es(t)&&Kr(t)==at};function ms(t){return null!=t&&Cs(t.length)&&!Ss(t)}function bs(t){return Es(t)&&ms(t)}var _s=Bn||za,ws=Fe?vn(Fe):function(t){return Es(t)&&Kr(t)==H};function As(t){if(!Es(t))return!1;var e=Kr(t);return e==Y||e==G||"string"==typeof t.message&&"string"==typeof t.name&&!Os(t)}function Ss(t){if(!Ts(t))return!1;var e=Kr(t);return e==$||e==Q||e==z||e==tt}function xs(t){return"number"==typeof t&&t==Bs(t)}function Cs(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=D}function Ts(t){var e=typeof t;return null!=t&&("object"==e||"function"==e)}function Es(t){return null!=t&&"object"==typeof t}var Rs=Be?vn(Be):function(t){return Es(t)&&BV(t)==X};function Ms(t){return"number"==typeof t||Es(t)&&Kr(t)==Z}function Os(t){if(!Es(t)||Kr(t)!=J)return!1;var e=Oe(t);if(null===e)return!0;var n=ue.call(e,"constructor")&&e.constructor;return"function"==typeof n&&n instanceof n&&ce.call(n)==de}var Ps=We?vn(We):function(t){return Es(t)&&Kr(t)==et};var ks=ze?vn(ze):function(t){return Es(t)&&BV(t)==nt};function Ds(t){return"string"==typeof t||!vs(t)&&Es(t)&&Kr(t)==rt}function Is(t){return"symbol"==typeof t||Es(t)&&Kr(t)==it}var Ns=qe?vn(qe):function(t){return Es(t)&&Cs(t.length)&&!!Ce[Kr(t)]};var js=mV(hi),Ls=mV(function(t,e){return t<=e});function Us(t){if(!t)return[];if(ms(t))return Ds(t)?Pn(t):nV(t);if(Le&&t[Le])return function(t){for(var e,n=[];!(e=t.next()).done;)n.push(e.value);return n}(t[Le]());var e=BV(t);return(e==X?Cn:e==nt?Rn:fa)(t)}function Fs(t){return t?(t=zs(t))===k||t===-k?(t<0?-1:1)*I:t==t?t:0:0===t?t:0}function Bs(t){var e=Fs(t),n=e%1;return e==e?n?e-n:e:0}function Ws(t){return t?Dr(Bs(t),0,j):0}function zs(t){if("number"==typeof t)return t;if(Is(t))return N;if(Ts(t)){var e="function"==typeof t.valueOf?t.valueOf():t;t=Ts(e)?e+"":e}if("string"!=typeof t)return 0===t?t:+t;t=t.replace(Dt,"");var n=Ht.test(t);return n||Yt.test(t)?Me(t.slice(2),n?2:8):qt.test(t)?N:+t}function qs(t){return rV(t,Va(t))}function Hs(t){return null==t?"":Ni(t)}var Gs=VV(function(t,e){if(XV(e)||ms(e))rV(e,ia(e),t);else for(var n in e)ue.call(e,n)&&Er(t,n,e[n])}),Ys=VV(function(t,e){rV(e,Va(e),t)}),$s=VV(function(t,e,n,r){rV(e,Va(e),t,r)}),Qs=VV(function(t,e,n,r){rV(e,ia(e),t,r)}),Xs=RV(kr);var Zs=Ai(function(t,e){t=ee(t);var n=-1,r=e.length,i=r>2?e[2]:V;for(i&&GV(e[0],e[1],i)&&(r=1);++n<r;)for(var o=e[n],s=Va(o),a=-1,c=s.length;++a<c;){var u=s[a],h=t[u];(h===V||fs(h,se[u])&&!ue.call(t,u))&&(t[u]=o[u])}return t}),Ks=Ai(function(t){return t.push(V,CV),He(sa,V,t)});function Js(t,e,n){var r=null==t?V:Xr(t,e);return r===V?n:r}function ta(t,e){return null!=t&&WV(t,e,ei)}var ea=dV(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),t[e]=n},Ta(Ma)),na=dV(function(t,e,n){null!=e&&"function"!=typeof e.toString&&(e=fe.call(e)),ue.call(t,e)?t[e].push(n):t[e]=[n]},IV),ra=Ai(ri);function ia(t){return ms(t)?Ar(t):ci(t)}function Va(t){return ms(t)?Ar(t,!0):ui(t)}var oa=VV(function(t,e,n){pi(t,e,n)}),sa=VV(function(t,e,n,r){pi(t,e,n,r)}),aa=RV(function(t,e){var n={};if(null==t)return n;var r=!1;e=Je(e,function(e){return e=Gi(e,t),r||(r=e.length>1),e}),rV(t,OV(t),n),r&&(n=Ir(n,l|f|d,TV));for(var i=e.length;i--;)Li(n,e[i]);return n});var ca=RV(function(t,e){return null==t?{}:function(t,e){return yi(t,e,function(e,n){return ta(t,n)})}(t,e)});function ua(t,e){if(null==t)return{};var n=Je(OV(t),function(t){return[t]});return e=IV(e),yi(t,n,function(t,n){return e(t,n[0])})}var ha=AV(ia),la=AV(Va);function fa(t){return null==t?[]:yn(t,ia(t))}var da=cV(function(t,e,n){return e=e.toLowerCase(),t+(n?pa(e):e)});function pa(t){return Aa(Hs(t).toLowerCase())}function ga(t){return(t=Hs(t))&&t.replace(Qt,wn).replace(me,"")}var va=cV(function(t,e,n){return t+(n?"-":"")+e.toLowerCase()}),ya=cV(function(t,e,n){return t+(n?" ":"")+e.toLowerCase()}),ma=aV("toLowerCase");var ba=cV(function(t,e,n){return t+(n?"_":"")+e.toLowerCase()});var _a=cV(function(t,e,n){return t+(n?" ":"")+Aa(e)});var wa=cV(function(t,e,n){return t+(n?" ":"")+e.toUpperCase()}),Aa=aV("toUpperCase");function Sa(t,e,n){return t=Hs(t),(e=n?V:e)===V?function(t){return Ae.test(t)}(t)?function(t){return t.match(_e)||[]}(t):function(t){return t.match(Ft)||[]}(t):t.match(e)||[]}var xa=Ai(function(t,e){try{return He(t,V,e)}catch(t){return As(t)?t:new Kt(t)}}),Ca=RV(function(t,e){return Ye(e,function(e){e=co(e),Pr(t,e,ns(t[e],t))}),t});function Ta(t){return function(){return t}}var Ea=lV(),Ra=lV(!0);function Ma(t){return t}function Oa(t){return ai("function"==typeof t?t:Ir(t,l))}var Pa=Ai(function(t,e){return function(n){return ri(n,t,e)}}),ka=Ai(function(t,e){return function(n){return ri(t,n,e)}});function Da(t,e,n){var r=ia(e),i=Qr(e,r);null!=n||Ts(e)&&(i.length||!r.length)||(n=e,e=t,t=this,i=Qr(e,ia(e)));var V=!(Ts(n)&&"chain"in n&&!n.chain),o=Ss(t);return Ye(i,function(n){var r=e[n];t[n]=r,o&&(t.prototype[n]=function(){var e=this.__chain__;if(V||e){var n=t(this.__wrapped__),i=n.__actions__=nV(this.__actions__);return i.push({func:r,args:arguments,thisArg:t}),n.__chain__=e,n}return r.apply(t,tn([this.value()],arguments))})}),t}function Ia(){}var Na=gV(Je),ja=gV(Qe),La=gV(rn);function Ua(t){return YV(t)?ln(co(t)):function(t){return function(e){return Xr(e,t)}}(t)}var Fa=yV(),Ba=yV(!0);function Wa(){return[]}function za(){return!1}var qa=pV(function(t,e){return t+e},0),Ha=_V("ceil"),Ga=pV(function(t,e){return t/e},1),Ya=_V("floor");var $a,Qa=pV(function(t,e){return t*e},1),Xa=_V("round"),Za=pV(function(t,e){return t-e},0);return fr.after=function(t,e){if("function"!=typeof e)throw new ie(a);return t=Bs(t),function(){if(--t<1)return e.apply(this,arguments)}},fr.ary=ts,fr.assign=Gs,fr.assignIn=Ys,fr.assignInWith=$s,fr.assignWith=Qs,fr.at=Xs,fr.before=es,fr.bind=ns,fr.bindAll=Ca,fr.bindKey=rs,fr.castArray=function(){if(!arguments.length)return[];var t=arguments[0];return vs(t)?t:[t]},fr.chain=Uo,fr.chunk=function(t,e,n){e=(n?GV(t,e,n):e===V)?1:Hn(Bs(e),0);var i=null==t?0:t.length;if(!i||e<1)return[];for(var o=0,s=0,a=r(Ln(i/e));o<i;)a[s++]=Mi(t,o,o+=e);return a},fr.compact=function(t){for(var e=-1,n=null==t?0:t.length,r=0,i=[];++e<n;){var V=t[e];V&&(i[r++]=V)}return i},fr.concat=function(){var t=arguments.length;if(!t)return[];for(var e=r(t-1),n=arguments[0],i=t;i--;)e[i-1]=arguments[i];return tn(vs(n)?nV(n):[n],qr(e,1))},fr.cond=function(t){var e=null==t?0:t.length,n=IV();return t=e?Je(t,function(t){if("function"!=typeof t[1])throw new ie(a);return[n(t[0]),t[1]]}):[],Ai(function(n){for(var r=-1;++r<e;){var i=t[r];if(He(i[0],this,n))return He(i[1],this,n)}})},fr.conforms=function(t){return function(t){var e=ia(t);return function(n){return Nr(n,t,e)}}(Ir(t,l))},fr.constant=Ta,fr.countBy=Wo,fr.create=function(t,e){var n=dr(t);return null==e?n:Or(n,e)},fr.curry=function t(e,n,r){var i=SV(e,b,V,V,V,V,V,n=r?V:n);return i.placeholder=t.placeholder,i},fr.curryRight=function t(e,n,r){var i=SV(e,_,V,V,V,V,V,n=r?V:n);return i.placeholder=t.placeholder,i},fr.debounce=is,fr.defaults=Zs,fr.defaultsDeep=Ks,fr.defer=Vs,fr.delay=os,fr.difference=lo,fr.differenceBy=fo,fr.differenceWith=po,fr.drop=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,(e=n||e===V?1:Bs(e))<0?0:e,r):[]},fr.dropRight=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,0,(e=r-(e=n||e===V?1:Bs(e)))<0?0:e):[]},fr.dropRightWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!0,!0):[]},fr.dropWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!0):[]},fr.fill=function(t,e,n,r){var i=null==t?0:t.length;return i?(n&&"number"!=typeof n&&GV(t,e,n)&&(n=0,r=i),function(t,e,n,r){var i=t.length;for((n=Bs(n))<0&&(n=-n>i?0:i+n),(r=r===V||r>i?i:Bs(r))<0&&(r+=i),r=n>r?0:Ws(r);n<r;)t[n++]=e;return t}(t,e,n,r)):[]},fr.filter=function(t,e){return(vs(t)?Xe:zr)(t,IV(e,3))},fr.flatMap=function(t,e){return qr(Xo(t,e),1)},fr.flatMapDeep=function(t,e){return qr(Xo(t,e),k)},fr.flatMapDepth=function(t,e,n){return n=n===V?1:Bs(n),qr(Xo(t,e),n)},fr.flatten=yo,fr.flattenDeep=function(t){return(null==t?0:t.length)?qr(t,k):[]},fr.flattenDepth=function(t,e){return(null==t?0:t.length)?qr(t,e=e===V?1:Bs(e)):[]},fr.flip=function(t){return SV(t,C)},fr.flow=Ea,fr.flowRight=Ra,fr.fromPairs=function(t){for(var e=-1,n=null==t?0:t.length,r={};++e<n;){var i=t[e];r[i[0]]=i[1]}return r},fr.functions=function(t){return null==t?[]:Qr(t,ia(t))},fr.functionsIn=function(t){return null==t?[]:Qr(t,Va(t))},fr.groupBy=Yo,fr.initial=function(t){return(null==t?0:t.length)?Mi(t,0,-1):[]},fr.intersection=bo,fr.intersectionBy=_o,fr.intersectionWith=wo,fr.invert=ea,fr.invertBy=na,fr.invokeMap=$o,fr.iteratee=Oa,fr.keyBy=Qo,fr.keys=ia,fr.keysIn=Va,fr.map=Xo,fr.mapKeys=function(t,e){var n={};return e=IV(e,3),Yr(t,function(t,r,i){Pr(n,e(t,r,i),t)}),n},fr.mapValues=function(t,e){var n={};return e=IV(e,3),Yr(t,function(t,r,i){Pr(n,r,e(t,r,i))}),n},fr.matches=function(t){return fi(Ir(t,l))},fr.matchesProperty=function(t,e){return di(t,Ir(e,l))},fr.memoize=ss,fr.merge=oa,fr.mergeWith=sa,fr.method=Pa,fr.methodOf=ka,fr.mixin=Da,fr.negate=as,fr.nthArg=function(t){return t=Bs(t),Ai(function(e){return gi(e,t)})},fr.omit=aa,fr.omitBy=function(t,e){return ua(t,as(IV(e)))},fr.once=function(t){return es(2,t)},fr.orderBy=function(t,e,n,r){return null==t?[]:(vs(e)||(e=null==e?[]:[e]),vs(n=r?V:n)||(n=null==n?[]:[n]),vi(t,e,n))},fr.over=Na,fr.overArgs=cs,fr.overEvery=ja,fr.overSome=La,fr.partial=us,fr.partialRight=hs,fr.partition=Zo,fr.pick=ca,fr.pickBy=ua,fr.property=Ua,fr.propertyOf=function(t){return function(e){return null==t?V:Xr(t,e)}},fr.pull=So,fr.pullAll=xo,fr.pullAllBy=function(t,e,n){return t&&t.length&&e&&e.length?mi(t,e,IV(n,2)):t},fr.pullAllWith=function(t,e,n){return t&&t.length&&e&&e.length?mi(t,e,V,n):t},fr.pullAt=Co,fr.range=Fa,fr.rangeRight=Ba,fr.rearg=ls,fr.reject=function(t,e){return(vs(t)?Xe:zr)(t,as(IV(e,3)))},fr.remove=function(t,e){var n=[];if(!t||!t.length)return n;var r=-1,i=[],V=t.length;for(e=IV(e,3);++r<V;){var o=t[r];e(o,r,t)&&(n.push(o),i.push(r))}return bi(t,i),n},fr.rest=function(t,e){if("function"!=typeof t)throw new ie(a);return Ai(t,e=e===V?e:Bs(e))},fr.reverse=To,fr.sampleSize=function(t,e,n){return e=(n?GV(t,e,n):e===V)?1:Bs(e),(vs(t)?xr:xi)(t,e)},fr.set=function(t,e,n){return null==t?t:Ci(t,e,n)},fr.setWith=function(t,e,n,r){return r="function"==typeof r?r:V,null==t?t:Ci(t,e,n,r)},fr.shuffle=function(t){return(vs(t)?Cr:Ri)(t)},fr.slice=function(t,e,n){var r=null==t?0:t.length;return r?(n&&"number"!=typeof n&&GV(t,e,n)?(e=0,n=r):(e=null==e?0:Bs(e),n=n===V?r:Bs(n)),Mi(t,e,n)):[]},fr.sortBy=Ko,fr.sortedUniq=function(t){return t&&t.length?Di(t):[]},fr.sortedUniqBy=function(t,e){return t&&t.length?Di(t,IV(e,2)):[]},fr.split=function(t,e,n){return n&&"number"!=typeof n&&GV(t,e,n)&&(e=n=V),(n=n===V?j:n>>>0)?(t=Hs(t))&&("string"==typeof e||null!=e&&!Ps(e))&&!(e=Ni(e))&&xn(t)?$i(Pn(t),0,n):t.split(e,n):[]},fr.spread=function(t,e){if("function"!=typeof t)throw new ie(a);return e=null==e?0:Hn(Bs(e),0),Ai(function(n){var r=n[e],i=$i(n,0,e);return r&&tn(i,r),He(t,this,i)})},fr.tail=function(t){var e=null==t?0:t.length;return e?Mi(t,1,e):[]},fr.take=function(t,e,n){return t&&t.length?Mi(t,0,(e=n||e===V?1:Bs(e))<0?0:e):[]},fr.takeRight=function(t,e,n){var r=null==t?0:t.length;return r?Mi(t,(e=r-(e=n||e===V?1:Bs(e)))<0?0:e,r):[]},fr.takeRightWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3),!1,!0):[]},fr.takeWhile=function(t,e){return t&&t.length?Fi(t,IV(e,3)):[]},fr.tap=function(t,e){return e(t),t},fr.throttle=function(t,e,n){var r=!0,i=!0;if("function"!=typeof t)throw new ie(a);return Ts(n)&&(r="leading"in n?!!n.leading:r,i="trailing"in n?!!n.trailing:i),is(t,e,{leading:r,maxWait:e,trailing:i})},fr.thru=Fo,fr.toArray=Us,fr.toPairs=ha,fr.toPairsIn=la,fr.toPath=function(t){return vs(t)?Je(t,co):Is(t)?[t]:nV(ao(Hs(t)))},fr.toPlainObject=qs,fr.transform=function(t,e,n){var r=vs(t),i=r||_s(t)||Ns(t);if(e=IV(e,4),null==n){var V=t&&t.constructor;n=i?r?new V:[]:Ts(t)&&Ss(V)?dr(Oe(t)):{}}return(i?Ye:Yr)(t,function(t,r,i){return e(n,t,r,i)}),n},fr.unary=function(t){return ts(t,1)},fr.union=Eo,fr.unionBy=Ro,fr.unionWith=Mo,fr.uniq=function(t){return t&&t.length?ji(t):[]},fr.uniqBy=function(t,e){return t&&t.length?ji(t,IV(e,2)):[]},fr.uniqWith=function(t,e){return e="function"==typeof e?e:V,t&&t.length?ji(t,V,e):[]},fr.unset=function(t,e){return null==t||Li(t,e)},fr.unzip=Oo,fr.unzipWith=Po,fr.update=function(t,e,n){return null==t?t:Ui(t,e,Hi(n))},fr.updateWith=function(t,e,n,r){return r="function"==typeof r?r:V,null==t?t:Ui(t,e,Hi(n),r)},fr.values=fa,fr.valuesIn=function(t){return null==t?[]:yn(t,Va(t))},fr.without=ko,fr.words=Sa,fr.wrap=function(t,e){return us(Hi(e),t)},fr.xor=Do,fr.xorBy=Io,fr.xorWith=No,fr.zip=jo,fr.zipObject=function(t,e){return zi(t||[],e||[],Er)},fr.zipObjectDeep=function(t,e){return zi(t||[],e||[],Ci)},fr.zipWith=Lo,fr.entries=ha,fr.entriesIn=la,fr.extend=Ys,fr.extendWith=$s,Da(fr,fr),fr.add=qa,fr.attempt=xa,fr.camelCase=da,fr.capitalize=pa,fr.ceil=Ha,fr.clamp=function(t,e,n){return n===V&&(n=e,e=V),n!==V&&(n=(n=zs(n))==n?n:0),e!==V&&(e=(e=zs(e))==e?e:0),Dr(zs(t),e,n)},fr.clone=function(t){return Ir(t,d)},fr.cloneDeep=function(t){return Ir(t,l|d)},fr.cloneDeepWith=function(t,e){return Ir(t,l|d,e="function"==typeof e?e:V)},fr.cloneWith=function(t,e){return Ir(t,d,e="function"==typeof e?e:V)},fr.conformsTo=function(t,e){return null==e||Nr(t,e,ia(e))},fr.deburr=ga,fr.defaultTo=function(t,e){return null==t||t!=t?e:t},fr.divide=Ga,fr.endsWith=function(t,e,n){t=Hs(t),e=Ni(e);var r=t.length,i=n=n===V?r:Dr(Bs(n),0,r);return(n-=e.length)>=0&&t.slice(n,i)==e},fr.eq=fs,fr.escape=function(t){return(t=Hs(t))&&xt.test(t)?t.replace(At,An):t},fr.escapeRegExp=function(t){return(t=Hs(t))&&kt.test(t)?t.replace(Pt,"\\$&"):t},fr.every=function(t,e,n){var r=vs(t)?Qe:Br;return n&&GV(t,e,n)&&(e=V),r(t,IV(e,3))},fr.find=zo,fr.findIndex=go,fr.findKey=function(t,e){return on(t,IV(e,3),Yr)},fr.findLast=qo,fr.findLastIndex=vo,fr.findLastKey=function(t,e){return on(t,IV(e,3),$r)},fr.floor=Ya,fr.forEach=Ho,fr.forEachRight=Go,fr.forIn=function(t,e){return null==t?t:Hr(t,IV(e,3),Va)},fr.forInRight=function(t,e){return null==t?t:Gr(t,IV(e,3),Va)},fr.forOwn=function(t,e){return t&&Yr(t,IV(e,3))},fr.forOwnRight=function(t,e){return t&&$r(t,IV(e,3))},fr.get=Js,fr.gt=ds,fr.gte=ps,fr.has=function(t,e){return null!=t&&WV(t,e,ti)},fr.hasIn=ta,fr.head=mo,fr.identity=Ma,fr.includes=function(t,e,n,r){t=ms(t)?t:fa(t),n=n&&!r?Bs(n):0;var i=t.length;return n<0&&(n=Hn(i+n,0)),Ds(t)?n<=i&&t.indexOf(e,n)>-1:!!i&&an(t,e,n)>-1},fr.indexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=null==n?0:Bs(n);return i<0&&(i=Hn(r+i,0)),an(t,e,i)},fr.inRange=function(t,e,n){return e=Fs(e),n===V?(n=e,e=0):n=Fs(n),function(t,e,n){return t>=Gn(e,n)&&t<Hn(e,n)}(t=zs(t),e,n)},fr.invoke=ra,fr.isArguments=gs,fr.isArray=vs,fr.isArrayBuffer=ys,fr.isArrayLike=ms,fr.isArrayLikeObject=bs,fr.isBoolean=function(t){return!0===t||!1===t||Es(t)&&Kr(t)==q},fr.isBuffer=_s,fr.isDate=ws,fr.isElement=function(t){return Es(t)&&1===t.nodeType&&!Os(t)},fr.isEmpty=function(t){if(null==t)return!0;if(ms(t)&&(vs(t)||"string"==typeof t||"function"==typeof t.splice||_s(t)||Ns(t)||gs(t)))return!t.length;var e=BV(t);if(e==X||e==nt)return!t.size;if(XV(t))return!ci(t).length;for(var n in t)if(ue.call(t,n))return!1;return!0},fr.isEqual=function(t,e){return Vi(t,e)},fr.isEqualWith=function(t,e,n){var r=(n="function"==typeof n?n:V)?n(t,e):V;return r===V?Vi(t,e,V,n):!!r},fr.isError=As,fr.isFinite=function(t){return"number"==typeof t&&Wn(t)},fr.isFunction=Ss,fr.isInteger=xs,fr.isLength=Cs,fr.isMap=Rs,fr.isMatch=function(t,e){return t===e||oi(t,e,jV(e))},fr.isMatchWith=function(t,e,n){return n="function"==typeof n?n:V,oi(t,e,jV(e),n)},fr.isNaN=function(t){return Ms(t)&&t!=+t},fr.isNative=function(t){if(QV(t))throw new Kt(s);return si(t)},fr.isNil=function(t){return null==t},fr.isNull=function(t){return null===t},fr.isNumber=Ms,fr.isObject=Ts,fr.isObjectLike=Es,fr.isPlainObject=Os,fr.isRegExp=Ps,fr.isSafeInteger=function(t){return xs(t)&&t>=-D&&t<=D},fr.isSet=ks,fr.isString=Ds,fr.isSymbol=Is,fr.isTypedArray=Ns,fr.isUndefined=function(t){return t===V},fr.isWeakMap=function(t){return Es(t)&&BV(t)==ot},fr.isWeakSet=function(t){return Es(t)&&Kr(t)==st},fr.join=function(t,e){return null==t?"":zn.call(t,e)},fr.kebabCase=va,fr.last=Ao,fr.lastIndexOf=function(t,e,n){var r=null==t?0:t.length;if(!r)return-1;var i=r;return n!==V&&(i=(i=Bs(n))<0?Hn(r+i,0):Gn(i,r-1)),e==e?function(t,e,n){for(var r=n+1;r--;)if(t[r]===e)return r;return r}(t,e,i):sn(t,un,i,!0)},fr.lowerCase=ya,fr.lowerFirst=ma,fr.lt=js,fr.lte=Ls,fr.max=function(t){return t&&t.length?Wr(t,Ma,Jr):V},fr.maxBy=function(t,e){return t&&t.length?Wr(t,IV(e,2),Jr):V},fr.mean=function(t){return hn(t,Ma)},fr.meanBy=function(t,e){return hn(t,IV(e,2))},fr.min=function(t){return t&&t.length?Wr(t,Ma,hi):V},fr.minBy=function(t,e){return t&&t.length?Wr(t,IV(e,2),hi):V},fr.stubArray=Wa,fr.stubFalse=za,fr.stubObject=function(){return{}},fr.stubString=function(){return""},fr.stubTrue=function(){return!0},fr.multiply=Qa,fr.nth=function(t,e){return t&&t.length?gi(t,Bs(e)):V},fr.noConflict=function(){return ke._===this&&(ke._=pe),this},fr.noop=Ia,fr.now=Jo,fr.pad=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;if(!e||r>=e)return t;var i=(e-r)/2;return vV(Un(i),n)+t+vV(Ln(i),n)},fr.padEnd=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;return e&&r<e?t+vV(e-r,n):t},fr.padStart=function(t,e,n){t=Hs(t);var r=(e=Bs(e))?On(t):0;return e&&r<e?vV(e-r,n)+t:t},fr.parseInt=function(t,e,n){return n||null==e?e=0:e&&(e=+e),$n(Hs(t).replace(It,""),e||0)},fr.random=function(t,e,n){if(n&&"boolean"!=typeof n&&GV(t,e,n)&&(e=n=V),n===V&&("boolean"==typeof e?(n=e,e=V):"boolean"==typeof t&&(n=t,t=V)),t===V&&e===V?(t=0,e=1):(t=Fs(t),e===V?(e=t,t=0):e=Fs(e)),t>e){var r=t;t=e,e=r}if(n||t%1||e%1){var i=Qn();return Gn(t+i*(e-t+Re("1e-"+((i+"").length-1))),e)}return _i(t,e)},fr.reduce=function(t,e,n){var r=vs(t)?en:dn,i=arguments.length<3;return r(t,IV(e,4),n,i,Ur)},fr.reduceRight=function(t,e,n){var r=vs(t)?nn:dn,i=arguments.length<3;return r(t,IV(e,4),n,i,Fr)},fr.repeat=function(t,e,n){return e=(n?GV(t,e,n):e===V)?1:Bs(e),wi(Hs(t),e)},fr.replace=function(){var t=arguments,e=Hs(t[0]);return t.length<3?e:e.replace(t[1],t[2])},fr.result=function(t,e,n){var r=-1,i=(e=Gi(e,t)).length;for(i||(i=1,t=V);++r<i;){var o=null==t?V:t[co(e[r])];o===V&&(r=i,o=n),t=Ss(o)?o.call(t):o}return t},fr.round=Xa,fr.runInContext=t,fr.sample=function(t){return(vs(t)?Sr:Si)(t)},fr.size=function(t){if(null==t)return 0;if(ms(t))return Ds(t)?On(t):t.length;var e=BV(t);return e==X||e==nt?t.size:ci(t).length},fr.snakeCase=ba,fr.some=function(t,e,n){var r=vs(t)?rn:Oi;return n&&GV(t,e,n)&&(e=V),r(t,IV(e,3))},fr.sortedIndex=function(t,e){return Pi(t,e)},fr.sortedIndexBy=function(t,e,n){return ki(t,e,IV(n,2))},fr.sortedIndexOf=function(t,e){var n=null==t?0:t.length;if(n){var r=Pi(t,e);if(r<n&&fs(t[r],e))return r}return-1},fr.sortedLastIndex=function(t,e){return Pi(t,e,!0)},fr.sortedLastIndexBy=function(t,e,n){return ki(t,e,IV(n,2),!0)},fr.sortedLastIndexOf=function(t,e){if(null==t?0:t.length){var n=Pi(t,e,!0)-1;if(fs(t[n],e))return n}return-1},fr.startCase=_a,fr.startsWith=function(t,e,n){return t=Hs(t),n=null==n?0:Dr(Bs(n),0,t.length),e=Ni(e),t.slice(n,n+e.length)==e},fr.subtract=Za,fr.sum=function(t){return t&&t.length?pn(t,Ma):0},fr.sumBy=function(t,e){return t&&t.length?pn(t,IV(e,2)):0},fr.template=function(t,e,n){var r=fr.templateSettings;n&&GV(t,e,n)&&(e=V),t=Hs(t),e=$s({},e,r,xV);var i,o,s=$s({},e.imports,r.imports,xV),a=ia(s),c=yn(s,a),u=0,h=e.interpolate||Xt,l="__p += '",f=ne((e.escape||Xt).source+"|"+h.source+"|"+(h===Et?Wt:Xt).source+"|"+(e.evaluate||Xt).source+"|$","g"),d="//# sourceURL="+(ue.call(e,"sourceURL")?(e.sourceURL+"").replace(/[\r\n]/g," "):"lodash.templateSources["+ ++xe+"]")+"\n";t.replace(f,function(e,n,r,V,s,a){return r||(r=V),l+=t.slice(u,a).replace(Zt,Sn),n&&(i=!0,l+="' +\n__e("+n+") +\n'"),s&&(o=!0,l+="';\n"+s+";\n__p += '"),r&&(l+="' +\n((__t = ("+r+")) == null ? '' : __t) +\n'"),u=a+e.length,e}),l+="';\n";var p=ue.call(e,"variable")&&e.variable;p||(l="with (obj) {\n"+l+"\n}\n"),l=(o?l.replace(mt,""):l).replace(bt,"$1").replace(_t,"$1;"),l="function("+(p||"obj")+") {\n"+(p?"":"obj || (obj = {});\n")+"var __t, __p = ''"+(i?", __e = _.escape":"")+(o?", __j = Array.prototype.join;\nfunction print() { __p += __j.call(arguments, '') }\n":";\n")+l+"return __p\n}";var g=xa(function(){return Jt(a,d+"return "+l).apply(V,c)});if(g.source=l,As(g))throw g;return g},fr.times=function(t,e){if((t=Bs(t))<1||t>D)return[];var n=j,r=Gn(t,j);e=IV(e),t-=j;for(var i=gn(r,e);++n<t;)e(n);return i},fr.toFinite=Fs,fr.toInteger=Bs,fr.toLength=Ws,fr.toLower=function(t){return Hs(t).toLowerCase()},fr.toNumber=zs,fr.toSafeInteger=function(t){return t?Dr(Bs(t),-D,D):0===t?t:0},fr.toString=Hs,fr.toUpper=function(t){return Hs(t).toUpperCase()},fr.trim=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(Dt,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t),i=Pn(e);return $i(r,bn(r,i),_n(r,i)+1).join("")},fr.trimEnd=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(Nt,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t);return $i(r,0,_n(r,Pn(e))+1).join("")},fr.trimStart=function(t,e,n){if((t=Hs(t))&&(n||e===V))return t.replace(It,"");if(!t||!(e=Ni(e)))return t;var r=Pn(t);return $i(r,bn(r,Pn(e))).join("")},fr.truncate=function(t,e){var n=T,r=E;if(Ts(e)){var i="separator"in e?e.separator:i;n="length"in e?Bs(e.length):n,r="omission"in e?Ni(e.omission):r}var o=(t=Hs(t)).length;if(xn(t)){var s=Pn(t);o=s.length}if(n>=o)return t;var a=n-On(r);if(a<1)return r;var c=s?$i(s,0,a).join(""):t.slice(0,a);if(i===V)return c+r;if(s&&(a+=c.length-a),Ps(i)){if(t.slice(a).search(i)){var u,h=c;for(i.global||(i=ne(i.source,Hs(zt.exec(i))+"g")),i.lastIndex=0;u=i.exec(h);)var l=u.index;c=c.slice(0,l===V?a:l)}}else if(t.indexOf(Ni(i),a)!=a){var f=c.lastIndexOf(i);f>-1&&(c=c.slice(0,f))}return c+r},fr.unescape=function(t){return(t=Hs(t))&&St.test(t)?t.replace(wt,kn):t},fr.uniqueId=function(t){var e=++he;return Hs(t)+e},fr.upperCase=wa,fr.upperFirst=Aa,fr.each=Ho,fr.eachRight=Go,fr.first=mo,Da(fr,($a={},Yr(fr,function(t,e){ue.call(fr.prototype,e)||($a[e]=t)}),$a),{chain:!1}),fr.VERSION="4.17.15",Ye(["bind","bindKey","curry","curryRight","partial","partialRight"],function(t){fr[t].placeholder=fr}),Ye(["drop","take"],function(t,e){vr.prototype[t]=function(n){n=n===V?1:Hn(Bs(n),0);var r=this.__filtered__&&!e?new vr(this):this.clone();return r.__filtered__?r.__takeCount__=Gn(n,r.__takeCount__):r.__views__.push({size:Gn(n,j),type:t+(r.__dir__<0?"Right":"")}),r},vr.prototype[t+"Right"]=function(e){return this.reverse()[t](e).reverse()}}),Ye(["filter","map","takeWhile"],function(t,e){var n=e+1,r=n==O||3==n;vr.prototype[t]=function(t){var e=this.clone();return e.__iteratees__.push({iteratee:IV(t,3),type:n}),e.__filtered__=e.__filtered__||r,e}}),Ye(["head","last"],function(t,e){var n="take"+(e?"Right":"");vr.prototype[t]=function(){return this[n](1).value()[0]}}),Ye(["initial","tail"],function(t,e){var n="drop"+(e?"":"Right");vr.prototype[t]=function(){return this.__filtered__?new vr(this):this[n](1)}}),vr.prototype.compact=function(){return this.filter(Ma)},vr.prototype.find=function(t){return this.filter(t).head()},vr.prototype.findLast=function(t){return this.reverse().find(t)},vr.prototype.invokeMap=Ai(function(t,e){return"function"==typeof t?new vr(this):this.map(function(n){return ri(n,t,e)})}),vr.prototype.reject=function(t){return this.filter(as(IV(t)))},vr.prototype.slice=function(t,e){t=Bs(t);var n=this;return n.__filtered__&&(t>0||e<0)?new vr(n):(t<0?n=n.takeRight(-t):t&&(n=n.drop(t)),e!==V&&(n=(e=Bs(e))<0?n.dropRight(-e):n.take(e-t)),n)},vr.prototype.takeRightWhile=function(t){return this.reverse().takeWhile(t).reverse()},vr.prototype.toArray=function(){return this.take(j)},Yr(vr.prototype,function(t,e){var n=/^(?:filter|find|map|reject)|While$/.test(e),r=/^(?:head|last)$/.test(e),i=fr[r?"take"+("last"==e?"Right":""):e],o=r||/^find/.test(e);i&&(fr.prototype[e]=function(){var e=this.__wrapped__,s=r?[1]:arguments,a=e instanceof vr,c=s[0],u=a||vs(e),h=function(t){var e=i.apply(fr,tn([t],s));return r&&l?e[0]:e};u&&n&&"function"==typeof c&&1!=c.length&&(a=u=!1);var l=this.__chain__,f=!!this.__actions__.length,d=o&&!l,p=a&&!f;if(!o&&u){e=p?e:new vr(this);var g=t.apply(e,s);return g.__actions__.push({func:Fo,args:[h],thisArg:V}),new gr(g,l)}return d&&p?t.apply(this,s):(g=this.thru(h),d?r?g.value()[0]:g.value():g)})}),Ye(["pop","push","shift","sort","splice","unshift"],function(t){var e=Ve[t],n=/^(?:push|sort|unshift)$/.test(t)?"tap":"thru",r=/^(?:pop|shift)$/.test(t);fr.prototype[t]=function(){var t=arguments;if(r&&!this.__chain__){var i=this.value();return e.apply(vs(i)?i:[],t)}return this[n](function(n){return e.apply(vs(n)?n:[],t)})}}),Yr(vr.prototype,function(t,e){var n=fr[e];if(n){var r=n.name+"";ue.call(ir,r)||(ir[r]=[]),ir[r].push({name:e,func:n})}}),ir[fV(V,y).name]=[{name:"wrapper",func:V}],vr.prototype.clone=function(){var t=new vr(this.__wrapped__);return t.__actions__=nV(this.__actions__),t.__dir__=this.__dir__,t.__filtered__=this.__filtered__,t.__iteratees__=nV(this.__iteratees__),t.__takeCount__=this.__takeCount__,t.__views__=nV(this.__views__),t},vr.prototype.reverse=function(){if(this.__filtered__){var t=new vr(this);t.__dir__=-1,t.__filtered__=!0}else(t=this.clone()).__dir__*=-1;return t},vr.prototype.value=function(){var t=this.__wrapped__.value(),e=this.__dir__,n=vs(t),r=e<0,i=n?t.length:0,V=function(t,e,n){var r=-1,i=n.length;for(;++r<i;){var V=n[r],o=V.size;switch(V.type){case"drop":t+=o;break;case"dropRight":e-=o;break;case"take":e=Gn(e,t+o);break;case"takeRight":t=Hn(t,e-o)}}return{start:t,end:e}}(0,i,this.__views__),o=V.start,s=V.end,a=s-o,c=r?s:o-1,u=this.__iteratees__,h=u.length,l=0,f=Gn(a,this.__takeCount__);if(!n||!r&&i==a&&f==a)return Bi(t,this.__actions__);var d=[];t:for(;a--&&l<f;){for(var p=-1,g=t[c+=e];++p<h;){var v=u[p],y=v.iteratee,m=v.type,b=y(g);if(m==P)g=b;else if(!b){if(m==O)continue t;break t}}d[l++]=g}return d},fr.prototype.at=Bo,fr.prototype.chain=function(){return Uo(this)},fr.prototype.commit=function(){return new gr(this.value(),this.__chain__)},fr.prototype.next=function(){this.__values__===V&&(this.__values__=Us(this.value()));var t=this.__index__>=this.__values__.length;return{done:t,value:t?V:this.__values__[this.__index__++]}},fr.prototype.plant=function(t){for(var e,n=this;n instanceof pr;){var r=ho(n);r.__index__=0,r.__values__=V,e?i.__wrapped__=r:e=r;var i=r;n=n.__wrapped__}return i.__wrapped__=t,e},fr.prototype.reverse=function(){var t=this.__wrapped__;if(t instanceof vr){var e=t;return this.__actions__.length&&(e=new vr(this)),(e=e.reverse()).__actions__.push({func:Fo,args:[To],thisArg:V}),new gr(e,this.__chain__)}return this.thru(To)},fr.prototype.toJSON=fr.prototype.valueOf=fr.prototype.value=function(){return Bi(this.__wrapped__,this.__actions__)},fr.prototype.first=fr.prototype.head,Le&&(fr.prototype[Le]=function(){return this}),fr}();ke._=Dn,(i=function(){return Dn}.call(e,n,e,r))===V||(r.exports=i)}).call(this)}).call(this,n(33),n(140)(t))},function(t,e,n){"use strict";n.d(e,"a",function(){return c}),n.d(e,"b",function(){return u});var r=n(0),i=n(6),V=n(2),o=n(1),s=n(5),a=n(46),c=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subjectFactory=n,r._refCount=0,r._isComplete=!1,r}return r.a(e,t),e.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},e.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},e.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new s.a).add(this.source.subscribe(new h(this.getSubject(),this))),t.closed&&(this._connection=null,t=s.a.EMPTY)),t},e.prototype.refCount=function(){return Object(a.a)()(this)},e}(V.a),u=function(){var t=c.prototype;return{operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:t._subscribe},_isComplete:{value:t._isComplete,writable:!0},getSubject:{value:t.getSubject},connect:{value:t.connect},refCount:{value:t.refCount}}}(),h=function(t){function e(e,n){var r=t.call(this,e)||this;return r.connectable=n,r}return r.a(e,t),e.prototype._error=function(e){this._unsubscribe(),t.prototype._error.call(this,e)},e.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._connection;t._refCount=0,t._subject=null,t._connection=null,e&&e.unsubscribe()}},e}(i.b);o.a},function(t,e,n){"use strict";n.d(e,"a",function(){return o});var r=n(0),i=n(6),V=n(21),o=function(t){function e(e){var n=t.call(this)||this;return n._value=e,n}return r.a(e,t),Object.defineProperty(e.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),e.prototype._subscribe=function(e){var n=t.prototype._subscribe.call(this,e);return n&&!n.closed&&e.next(this._value),n},e.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new V.a;return this._value},e.prototype.next=function(e){t.prototype.next.call(this,this._value=e)},e}(i.a)},function(t,e,n){"use strict";n.d(e,"b",function(){return o}),n.d(e,"a",function(){return a});var r=n(0),i=n(1),V=n(17);function o(t,e){return void 0===e&&(e=0),function(n){return n.lift(new s(t,e))}}var s=function(){function t(t,e){void 0===e&&(e=0),this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.scheduler,this.delay))},t}(),a=function(t){function e(e,n,r){void 0===r&&(r=0);var i=t.call(this,e)||this;return i.scheduler=n,i.delay=r,i}return r.a(e,t),e.dispatch=function(t){var e=t.notification,n=t.destination;e.observe(n),this.unsubscribe()},e.prototype.scheduleMessage=function(t){this.destination.add(this.scheduler.schedule(e.dispatch,this.delay,new c(t,this.destination)))},e.prototype._next=function(t){this.scheduleMessage(V.a.createNext(t))},e.prototype._error=function(t){this.scheduleMessage(V.a.createError(t)),this.unsubscribe()},e.prototype._complete=function(){this.scheduleMessage(V.a.createComplete()),this.unsubscribe()},e}(i.a),c=function(){return function(t,e){this.notification=t,this.destination=e}}()},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(){function t(){return Error.call(this),this.message="Timeout has occurred",this.name="TimeoutError",this}return t.prototype=Object.create(Error.prototype),t}()},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(50);function i(){return Object(r.a)(1)}},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(10),V=n(50),o=n(26);function s(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=Number.POSITIVE_INFINITY,s=null,a=t[t.length-1];return Object(i.a)(a)?(s=t.pop(),t.length>1&&"number"==typeof t[t.length-1]&&(n=t.pop())):"number"==typeof a&&(n=t.pop()),null===s&&1===t.length&&t[0]instanceof r.a?t[0]:Object(V.a)(n)(Object(o.a)(t,s))}},function(t,e,n){"use strict";n.d(e,"a",function(){return a});var r=n(0),i=n(7),V=n(26),o=n(4),s=n(3);function a(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];if(1===t.length){if(!Object(i.a)(t[0]))return t[0];t=t[0]}return Object(V.a)(t,void 0).lift(new c)}var c=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new u(t))},t}(),u=function(t){function e(e){var n=t.call(this,e)||this;return n.hasFirst=!1,n.observables=[],n.subscriptions=[],n}return r.a(e,t),e.prototype._next=function(t){this.observables.push(t)},e.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{for(var n=0;n<e&&!this.hasFirst;n++){var r=t[n],i=Object(s.a)(this,r,r,n);this.subscriptions&&this.subscriptions.push(i),this.add(i)}this.observables=null}},e.prototype.notifyNext=function(t,e,n,r,i){if(!this.hasFirst){this.hasFirst=!0;for(var V=0;V<this.subscriptions.length;V++)if(V!==n){var o=this.subscriptions[V];o.unsubscribe(),this.remove(o)}this.subscriptions=null}this.destination.next(e)},e}(o.a)},function(t,e,n){"use strict";n.d(e,"a",function(){return s});var r=n(2),i=n(8),V=n(30),o=n(10);function s(t,e,n){void 0===t&&(t=0);var s=-1;return Object(V.a)(e)?s=Number(e)<1?1:Number(e):Object(o.a)(e)&&(n=e),Object(o.a)(n)||(n=i.a),new r.a(function(e){var r=Object(V.a)(t)?t:+t-n.now();return n.schedule(a,r,{index:0,period:s,subscriber:e})})}function a(t){var e=t.index,n=t.period,r=t.subscriber;if(r.next(e),!r.closed){if(-1===n)return r.complete();t.index=e+1,this.schedule(t,n)}}},function(t,e,n){"use strict";var r=n(2),i=n(5),V=n(20);var o=n(55),s=n(19);var a=n(76),c=n(75);function u(t,e){if(null!=t){if(function(t){return t&&"function"==typeof t[V.a]}(t))return function(t,e){return new r.a(function(n){var r=new i.a;return r.add(e.schedule(function(){var i=t[V.a]();r.add(i.subscribe({next:function(t){r.add(e.schedule(function(){return n.next(t)}))},error:function(t){r.add(e.schedule(function(){return n.error(t)}))},complete:function(){r.add(e.schedule(function(){return n.complete()}))}}))})),r})}(t,e);if(Object(a.a)(t))return function(t,e){return new r.a(function(n){var r=new i.a;return r.add(e.schedule(function(){return t.then(function(t){r.add(e.schedule(function(){n.next(t),r.add(e.schedule(function(){return n.complete()}))}))},function(t){r.add(e.schedule(function(){return n.error(t)}))})})),r})}(t,e);if(Object(c.a)(t))return Object(o.a)(t,e);if(function(t){return t&&"function"==typeof t[s.a]}(t)||"string"==typeof t)return function(t,e){if(!t)throw new Error("Iterable cannot be null");return new r.a(function(n){var r,V=new i.a;return V.add(function(){r&&"function"==typeof r.return&&r.return()}),V.add(e.schedule(function(){r=t[s.a](),V.add(e.schedule(function(){if(!n.closed){var t,e;try{var i=r.next();t=i.value,e=i.done}catch(t){return void n.error(t)}e?n.complete():(n.next(t),this.schedule())}}))})),V})}(t,e)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")}n.d(e,"a",function(){return u})},function(t,e,n){"use strict";var r=n(0),i=function(t){function e(e,n){var r=t.call(this,e,n)||this;return r.scheduler=e,r.work=n,r}return r.a(e,t),e.prototype.schedule=function(e,n){return void 0===n&&(n=0),n>0?t.prototype.schedule.call(this,e,n):(this.delay=n,this.state=e,this.scheduler.flush(this),this)},e.prototype.execute=function(e,n){return n>0||this.closed?t.prototype.execute.call(this,e,n):this._execute(e,n)},e.prototype.requestAsyncId=function(e,n,r){return void 0===r&&(r=0),null!==r&&r>0||null===r&&this.delay>0?t.prototype.requestAsyncId.call(this,e,n,r):e.flush(this)},e}(n(29).a),V=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e}(n(27).a);n.d(e,"a",function(){return o});var o=new V(i)},function(t,e,n){"use strict";n.d(e,"a",function(){return i});var r=n(0),i=function(t){function e(e,n){var r=t.call(this)||this;return r.subject=e,r.subscriber=n,r.closed=!1,r}return r.a(e,t),e.prototype.unsubscribe=function(){if(!this.closed){this.closed=!0;var t=this.subject,e=t.observers;if(this.subject=null,e&&0!==e.length&&!t.isStopped&&!t.closed){var n=e.indexOf(this.subscriber);-1!==n&&e.splice(n,1)}}},e}(n(5).a)},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return function(e){for(var n=0,r=t.length;n<r&&!e.closed;n++)e.next(t[n]);e.complete()}}},function(t,e,n){"use strict";n.d(e,"a",function(){return r});var r=function(t){return t&&"number"==typeof t.length&&"function"!=typeof t}},function(t,e,n){"use strict";function r(t){return!!t&&"function"!=typeof t.subscribe&&"function"==typeof t.then}n.d(e,"a",function(){return r})},function(t,e,n){"use strict";function r(t,e){function n(){return!n.pred.apply(n.thisArg,arguments)}return n.pred=t,n.thisArg=e,n}n.d(e,"a",function(){return r})},function(t,e,n){"use strict";var r=n(43).codes.ERR_STREAM_PREMATURE_CLOSE;function i(){}t.exports=function t(e,n,V){if("function"==typeof n)return t(e,null,n);n||(n={}),V=function(t){var e=!1;return function(){if(!e){e=!0;for(var n=arguments.length,r=new Array(n),i=0;i<n;i++)r[i]=arguments[i];t.apply(this,r)}}}(V||i);var o=n.readable||!1!==n.readable&&e.readable,s=n.writable||!1!==n.writable&&e.writable,a=function(){e.writable||u()},c=e._writableState&&e._writableState.finished,u=function(){s=!1,c=!0,o||V.call(e)},h=e._readableState&&e._readableState.endEmitted,l=function(){o=!1,h=!0,s||V.call(e)},f=function(t){V.call(e,t)},d=function(){var t;return o&&!h?(e._readableState&&e._readableState.ended||(t=new r),V.call(e,t)):s&&!c?(e._writableState&&e._writableState.ended||(t=new r),V.call(e,t)):void 0},p=function(){e.req.on("finish",u)};return!function(t){return t.setHeader&&"function"==typeof t.abort}(e)?s&&!e._writableState&&(e.on("end",a),e.on("close",a)):(e.on("complete",u),e.on("abort",d),e.req?p():e.on("request",p)),e.on("end",l),e.on("finish",u),!1!==n.error&&e.on("error",f),e.on("close",d),function(){e.removeListener("complete",u),e.removeListener("abort",d),e.removeListener("request",p),e.req&&e.req.removeListener("finish",u),e.removeListener("end",a),e.removeListener("close",a),e.removeListener("finish",u),e.removeListener("end",l),e.removeListener("error",f),e.removeListener("close",d)}}},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Prom=e.PromMessageType=void 0;const i=r(n(138));var V;!function(t){t[t.SessionStart=0]="SessionStart",t[t.WebRtcPerformance=1]="WebRtcPerformance",t[t.AvailabilityCheck=2]="AvailabilityCheck",t[t.QuestionMessageReceived=3]="QuestionMessageReceived",t[t.AnswerMessageReceived=4]="AnswerMessageReceived"}(V=e.PromMessageType||(e.PromMessageType={}));e.Prom=class{constructor(t){this.apiUrl=t,this.prom_prefix="client_sdk_",this.registry=i.default(),this.messageTimings=[],this.metricsPushedCounter=this.registry.create("counter",this.prom_prefix+"metrics_pushed_total","A counter for showcase metrics pushed."),this.sessionStartTime=this.registry.create("histogram",this.prom_prefix+"session_start_duration_seconds","A histogram of session start times.",[1,2.5,4,5,6,7.5,8.5,10,15,30,60]),this.availabilityCheckTime=this.registry.create("histogram",this.prom_prefix+"availability_chk_duration_seconds","A histogram of availability check response times.",[.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),this.webRtcInboundRTT=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_rtt_duration_seconds","A histogram of client inbound round trip time.",[.001,.002,.005,.01,.02,.05,.1,.5,2,5]),this.webRtcInboundFramesPerSec=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_per_second","A histogram of client inbound frames per second.",[1,2,5,10,15,20,25,35,50]),this.webRtcInboundPacketsLost=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_packets_lost","A histogram of client packets lost.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFramesDropped=this.registry.create("histogram",this.prom_prefix+"webrtc_inbound_frames_dropped","A histogram of frames dropped.",[1,2,4,8,12,16,22,30,50,100,200,500]),this.webRtcFrameHeight=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_height_px","A histogram of frame height in pixels",[60,180,240,360,540,720,1280]),this.webRtcFrameWidth=this.registry.create("histogram",this.prom_prefix+"webrtc_frame_width_px","A histogram of frame width in pixels",[60,180,240,360,540,720,1280,1500,1920]),this.conversationRoundTripTime=this.registry.create("histogram",this.prom_prefix+"conversation_rtt_duration_seconds","A histogram of round trip time of a conversation",[.001,.005,.01,.03,.05,.1,.2,.5,.75,1,1.5,2,2.5,5,7.5,10]),setInterval(()=>{this.sendMetrics()},5e3)}handleMessage(t){var e,n,r,i,o,s,a;const c=Object.assign(t.labels||{},{platform:"js"});switch(t.type){case V.SessionStart:this.sessionStartTime.observe(t.value,c);break;case V.QuestionMessageReceived:this.messageTimings.push(t.value);break;case V.AnswerMessageReceived:const u=this.calculateConversationRtt(t);u>0&&this.conversationRoundTripTime.observe(u,c);break;case V.WebRtcPerformance:const h=t.value;h.outboundQualityLimitationReason?c.qualityLimitationReason=null===(e=h.outboundQualityLimitationReason)||void 0===e?void 0:e.value:c.qualityLimitationReason="unknown",h.newFramesDropped&&this.webRtcFramesDropped.observe(null===(n=h.newFramesDropped)||void 0===n?void 0:n.value,c),h.framesPerSec&&this.webRtcInboundFramesPerSec.observe(null===(r=h.framesPerSec)||void 0===r?void 0:r.value,c),h.inboundNewPacketsLost&&this.webRtcInboundPacketsLost.observe(null===(i=h.inboundNewPacketsLost)||void 0===i?void 0:i.value,c),h.inboundRoundTripTime&&this.webRtcInboundRTT.observe(null===(o=h.inboundRoundTripTime)||void 0===o?void 0:o.value,c),h.frameHeight&&this.webRtcFrameHeight.observe(null===(s=h.frameHeight)||void 0===s?void 0:s.value,c),h.frameWidth&&this.webRtcFrameWidth.observe(null===(a=h.frameWidth)||void 0===a?void 0:a.value,c);break;case V.AvailabilityCheck:this.availabilityCheckTime.observe(t.value,c)}}calculateConversationRtt(t){if(t.value&&this.messageTimings){const e=this.messageTimings.find(e=>e.id===t.value.id);if(e){const n=e.receivedOn;if(n){const r=(t.value.receivedOn-n)/1e3;return this.messageTimings.splice(this.messageTimings.indexOf(e),1),r}}}return 0}sendMetrics(){this.metricsPushedCounter.inc({platform:"js"});const t=new Request(this.apiUrl+"/client-metrics",{method:"POST",body:this.registry.metrics(),mode:"no-cors"});fetch(t),this.registry.reset()}}},function(t,e,n){"use strict";n.r(e);var r=n(0),i=n(4),V=n(3);function o(t){return function(e){return e.lift(new s(t))}}var s=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.durationSelector))},t}(),a=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){if(this.value=t,this.hasValue=!0,!this.throttled){var e=void 0;try{e=(0,this.durationSelector)(t)}catch(t){return this.destination.error(t)}var n=Object(V.a)(this,e);!n||n.closed?this.clearThrottle():this.add(this.throttled=n)}},e.prototype.clearThrottle=function(){var t=this.value,e=this.hasValue,n=this.throttled;n&&(this.remove(n),this.throttled=null,n.unsubscribe()),e&&(this.value=null,this.hasValue=!1,this.destination.next(t))},e.prototype.notifyNext=function(t,e,n,r){this.clearThrottle()},e.prototype.notifyComplete=function(){this.clearThrottle()},e}(i.a),c=n(8),u=n(70);function h(t,e){return void 0===e&&(e=c.a),o(function(){return Object(u.a)(t,e)})}function l(t){return function(e){return e.lift(new f(t))}}var f=function(){function t(t){this.closingNotifier=t}return t.prototype.call=function(t,e){return e.subscribe(new d(t,this.closingNotifier))},t}(),d=function(t){function e(e,n){var r=t.call(this,e)||this;return r.buffer=[],r.add(Object(V.a)(r,n)),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype.notifyNext=function(t,e,n,r,i){var V=this.buffer;this.buffer=[],this.destination.next(V)},e}(i.a),p=n(1);function g(t,e){return void 0===e&&(e=null),function(n){return n.lift(new v(t,e))}}var v=function(){function t(t,e){this.bufferSize=t,this.startBufferEvery=e,this.subscriberClass=e&&t!==e?m:y}return t.prototype.call=function(t,e){return e.subscribe(new this.subscriberClass(t,this.bufferSize,this.startBufferEvery))},t}(),y=function(t){function e(e,n){var r=t.call(this,e)||this;return r.bufferSize=n,r.buffer=[],r}return r.a(e,t),e.prototype._next=function(t){var e=this.buffer;e.push(t),e.length==this.bufferSize&&(this.destination.next(e),this.buffer=[])},e.prototype._complete=function(){var e=this.buffer;e.length>0&&this.destination.next(e),t.prototype._complete.call(this)},e}(p.a),m=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.bufferSize=n,i.startBufferEvery=r,i.buffers=[],i.count=0,i}return r.a(e,t),e.prototype._next=function(t){var e=this.bufferSize,n=this.startBufferEvery,r=this.buffers,i=this.count;this.count++,i%n==0&&r.push([]);for(var V=r.length;V--;){var o=r[V];o.push(t),o.length===e&&(r.splice(V,1),this.destination.next(o))}},e.prototype._complete=function(){for(var e=this.buffers,n=this.destination;e.length>0;){var r=e.shift();r.length>0&&n.next(r)}t.prototype._complete.call(this)},e}(p.a),b=n(10);function _(t){var e=arguments.length,n=c.a;Object(b.a)(arguments[arguments.length-1])&&(n=arguments[arguments.length-1],e--);var r=null;e>=2&&(r=arguments[1]);var i=Number.POSITIVE_INFINITY;return e>=3&&(i=arguments[2]),function(e){return e.lift(new w(t,r,i,n))}}var w=function(){function t(t,e,n,r){this.bufferTimeSpan=t,this.bufferCreationInterval=e,this.maxBufferSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new S(t,this.bufferTimeSpan,this.bufferCreationInterval,this.maxBufferSize,this.scheduler))},t}(),A=function(){return function(){this.buffer=[]}}(),S=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.bufferTimeSpan=n,o.bufferCreationInterval=r,o.maxBufferSize=i,o.scheduler=V,o.contexts=[];var s=o.openContext();if(o.timespanOnly=null==r||r<0,o.timespanOnly){var a={subscriber:o,context:s,bufferTimeSpan:n};o.add(s.closeAction=V.schedule(x,n,a))}else{var c={subscriber:o,context:s},u={bufferTimeSpan:n,bufferCreationInterval:r,subscriber:o,scheduler:V};o.add(s.closeAction=V.schedule(T,n,c)),o.add(V.schedule(C,r,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e,n=this.contexts,r=n.length,i=0;i<r;i++){var V=n[i],o=V.buffer;o.push(t),o.length==this.maxBufferSize&&(e=V)}e&&this.onBufferFull(e)},e.prototype._error=function(e){this.contexts.length=0,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts,n=this.destination;e.length>0;){var r=e.shift();n.next(r.buffer)}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.contexts=null},e.prototype.onBufferFull=function(t){this.closeContext(t);var e=t.closeAction;if(e.unsubscribe(),this.remove(e),!this.closed&&this.timespanOnly){t=this.openContext();var n=this.bufferTimeSpan,r={subscriber:this,context:t,bufferTimeSpan:n};this.add(t.closeAction=this.scheduler.schedule(x,n,r))}},e.prototype.openContext=function(){var t=new A;return this.contexts.push(t),t},e.prototype.closeContext=function(t){this.destination.next(t.buffer);var e=this.contexts;(e?e.indexOf(t):-1)>=0&&e.splice(e.indexOf(t),1)},e}(p.a);function x(t){var e=t.subscriber,n=t.context;n&&e.closeContext(n),e.closed||(t.context=e.openContext(),t.context.closeAction=this.schedule(t,t.bufferTimeSpan))}function C(t){var e=t.bufferCreationInterval,n=t.bufferTimeSpan,r=t.subscriber,i=t.scheduler,V=r.openContext();r.closed||(r.add(V.closeAction=i.schedule(T,n,{subscriber:r,context:V})),this.schedule(t,e))}function T(t){var e=t.subscriber,n=t.context;e.closeContext(n)}var E=n(5);function R(t,e){return function(n){return n.lift(new M(t,e))}}var M=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new O(t,this.openings,this.closingSelector))},t}(),O=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(Object(V.a)(i,n)),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.contexts,n=e.length,r=0;r<n;r++)e[r].buffer.push(t)},e.prototype._error=function(e){for(var n=this.contexts;n.length>0;){var r=n.shift();r.subscription.unsubscribe(),r.buffer=null,r.subscription=null}this.contexts=null,t.prototype._error.call(this,e)},e.prototype._complete=function(){for(var e=this.contexts;e.length>0;){var n=e.shift();this.destination.next(n.buffer),n.subscription.unsubscribe(),n.buffer=null,n.subscription=null}this.contexts=null,t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){t?this.closeBuffer(t):this.openBuffer(e)},e.prototype.notifyComplete=function(t){this.closeBuffer(t.context)},e.prototype.openBuffer=function(t){try{var e=this.closingSelector.call(this,t);e&&this.trySubscribe(e)}catch(t){this._error(t)}},e.prototype.closeBuffer=function(t){var e=this.contexts;if(e&&t){var n=t.buffer,r=t.subscription;this.destination.next(n),e.splice(e.indexOf(t),1),this.remove(r),r.unsubscribe()}},e.prototype.trySubscribe=function(t){var e=this.contexts,n=new E.a,r={buffer:[],subscription:n};e.push(r);var i=Object(V.a)(this,t,r);!i||i.closed?this.closeBuffer(r):(i.context=r,this.add(i),n.add(i))},e}(i.a);function P(t){return function(e){return e.lift(new k(t))}}var k=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new D(t,this.closingSelector))},t}(),D=function(t){function e(e,n){var r=t.call(this,e)||this;return r.closingSelector=n,r.subscribing=!1,r.openBuffer(),r}return r.a(e,t),e.prototype._next=function(t){this.buffer.push(t)},e.prototype._complete=function(){var e=this.buffer;e&&this.destination.next(e),t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){this.buffer=null,this.subscribing=!1},e.prototype.notifyNext=function(t,e,n,r,i){this.openBuffer()},e.prototype.notifyComplete=function(){this.subscribing?this.complete():this.openBuffer()},e.prototype.openBuffer=function(){var t=this.closingSubscription;t&&(this.remove(t),t.unsubscribe());var e,n=this.buffer;this.buffer&&this.destination.next(n),this.buffer=[];try{e=(0,this.closingSelector)()}catch(t){return this.error(t)}t=new E.a,this.closingSubscription=t,this.add(t),this.subscribing=!0,t.add(Object(V.a)(this,e)),this.subscribing=!1},e}(i.a),I=n(13);function N(t){return function(e){var n=new j(t),r=e.lift(n);return n.caught=r}}var j=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new L(t,this.selector,this.caught))},t}(),L=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.selector=n,i.caught=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=void 0;try{n=this.selector(e,this.caught)}catch(e){return void t.prototype.error.call(this,e)}this._unsubscribeAndRecycle();var r=new I.a(this,void 0,void 0);this.add(r),Object(V.a)(this,n,void 0,void 0,r)}},e}(i.a),U=n(49);function F(t){return function(e){return e.lift(new U.a(t))}}var B=n(7),W=n(12);function z(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=null;return"function"==typeof t[t.length-1]&&(n=t.pop()),1===t.length&&Object(B.a)(t[0])&&(t=t[0].slice()),function(e){return e.lift.call(Object(W.a)([e].concat(t)),new U.a(n))}}var q=n(31);function H(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(q.a.apply(void 0,[e].concat(t)))}}var G=n(67),Y=n(22);function $(t,e){return Object(Y.a)(t,e,1)}function Q(t,e){return $(function(){return t},e)}function X(t){return function(e){return e.lift(new Z(t,e))}}var Z=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new K(t,this.predicate,this.source))},t}(),K=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.count=0,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},e.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e&&this.count++},e.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},e}(p.a);function J(t){return function(e){return e.lift(new tt(t))}}var tt=function(){function t(t){this.durationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new et(t,this.durationSelector))},t}(),et=function(t){function e(e,n){var r=t.call(this,e)||this;return r.durationSelector=n,r.hasValue=!1,r.durationSubscription=null,r}return r.a(e,t),e.prototype._next=function(t){try{var e=this.durationSelector.call(this,t);e&&this._tryNext(t,e)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.emitValue(),this.destination.complete()},e.prototype._tryNext=function(t,e){var n=this.durationSubscription;this.value=t,this.hasValue=!0,n&&(n.unsubscribe(),this.remove(n)),(n=Object(V.a)(this,e))&&!n.closed&&this.add(this.durationSubscription=n)},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){if(this.hasValue){var e=this.value,n=this.durationSubscription;n&&(this.durationSubscription=null,n.unsubscribe(),this.remove(n)),this.value=null,this.hasValue=!1,t.prototype._next.call(this,e)}},e}(i.a);function nt(t,e){return void 0===e&&(e=c.a),function(n){return n.lift(new rt(t,e))}}var rt=function(){function t(t,e){this.dueTime=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new it(t,this.dueTime,this.scheduler))},t}(),it=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.dueTime=n,i.scheduler=r,i.debouncedSubscription=null,i.lastValue=null,i.hasValue=!1,i}return r.a(e,t),e.prototype._next=function(t){this.clearDebounce(),this.lastValue=t,this.hasValue=!0,this.add(this.debouncedSubscription=this.scheduler.schedule(Vt,this.dueTime,this))},e.prototype._complete=function(){this.debouncedNext(),this.destination.complete()},e.prototype.debouncedNext=function(){if(this.clearDebounce(),this.hasValue){var t=this.lastValue;this.lastValue=null,this.hasValue=!1,this.destination.next(t)}},e.prototype.clearDebounce=function(){var t=this.debouncedSubscription;null!==t&&(this.remove(t),t.unsubscribe(),this.debouncedSubscription=null)},e}(p.a);function Vt(t){t.debouncedNext()}function ot(t){return void 0===t&&(t=null),function(e){return e.lift(new st(t))}}var st=function(){function t(t){this.defaultValue=t}return t.prototype.call=function(t,e){return e.subscribe(new at(t,this.defaultValue))},t}(),at=function(t){function e(e,n){var r=t.call(this,e)||this;return r.defaultValue=n,r.isEmpty=!0,r}return r.a(e,t),e.prototype._next=function(t){this.isEmpty=!1,this.destination.next(t)},e.prototype._complete=function(){this.isEmpty&&this.destination.next(this.defaultValue),this.destination.complete()},e}(p.a);function ct(t){return t instanceof Date&&!isNaN(+t)}var ut=n(17);function ht(t,e){void 0===e&&(e=c.a);var n=ct(t)?+t-e.now():Math.abs(t);return function(t){return t.lift(new lt(n,e))}}var lt=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new ft(t,this.delay,this.scheduler))},t}(),ft=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.delay=n,i.scheduler=r,i.queue=[],i.active=!1,i.errored=!1,i}return r.a(e,t),e.dispatch=function(t){for(var e=t.source,n=e.queue,r=t.scheduler,i=t.destination;n.length>0&&n[0].time-r.now()<=0;)n.shift().notification.observe(i);if(n.length>0){var V=Math.max(0,n[0].time-r.now());this.schedule(t,V)}else this.unsubscribe(),e.active=!1},e.prototype._schedule=function(t){this.active=!0,this.destination.add(t.schedule(e.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},e.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,n=new dt(e.now()+this.delay,t);this.queue.push(n),!1===this.active&&this._schedule(e)}},e.prototype._next=function(t){this.scheduleNotification(ut.a.createNext(t))},e.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t),this.unsubscribe()},e.prototype._complete=function(){this.scheduleNotification(ut.a.createComplete()),this.unsubscribe()},e}(p.a),dt=function(){return function(t,e){this.time=t,this.notification=e}}(),pt=n(2);function gt(t,e){return e?function(n){return new mt(n,e).lift(new vt(t))}:function(e){return e.lift(new vt(t))}}var vt=function(){function t(t){this.delayDurationSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new yt(t,this.delayDurationSelector))},t}(),yt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.delayDurationSelector=n,r.completed=!1,r.delayNotifierSubscriptions=[],r.index=0,r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(t),this.removeSubscription(i),this.tryComplete()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){var e=this.removeSubscription(t);e&&this.destination.next(e),this.tryComplete()},e.prototype._next=function(t){var e=this.index++;try{var n=this.delayDurationSelector(t,e);n&&this.tryDelay(n,t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.completed=!0,this.tryComplete(),this.unsubscribe()},e.prototype.removeSubscription=function(t){t.unsubscribe();var e=this.delayNotifierSubscriptions.indexOf(t);return-1!==e&&this.delayNotifierSubscriptions.splice(e,1),t.outerValue},e.prototype.tryDelay=function(t,e){var n=Object(V.a)(this,t,e);n&&!n.closed&&(this.destination.add(n),this.delayNotifierSubscriptions.push(n))},e.prototype.tryComplete=function(){this.completed&&0===this.delayNotifierSubscriptions.length&&this.destination.complete()},e}(i.a),mt=function(t){function e(e,n){var r=t.call(this)||this;return r.source=e,r.subscriptionDelay=n,r}return r.a(e,t),e.prototype._subscribe=function(t){this.subscriptionDelay.subscribe(new bt(t,this.source))},e}(pt.a),bt=function(t){function e(e,n){var r=t.call(this)||this;return r.parent=e,r.source=n,r.sourceSubscribed=!1,r}return r.a(e,t),e.prototype._next=function(t){this.subscribeToSource()},e.prototype._error=function(t){this.unsubscribe(),this.parent.error(t)},e.prototype._complete=function(){this.unsubscribe(),this.subscribeToSource()},e.prototype.subscribeToSource=function(){this.sourceSubscribed||(this.sourceSubscribed=!0,this.unsubscribe(),this.source.subscribe(this.parent))},e}(p.a);function _t(){return function(t){return t.lift(new wt)}}var wt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new At(t))},t}(),At=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){t.observe(this.destination)},e}(p.a);function St(t,e){return function(n){return n.lift(new xt(t,e))}}var xt=function(){function t(t,e){this.keySelector=t,this.flushes=e}return t.prototype.call=function(t,e){return e.subscribe(new Ct(t,this.keySelector,this.flushes))},t}(),Ct=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=n,i.values=new Set,r&&i.add(Object(V.a)(i,r)),i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values.clear()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype._next=function(t){this.keySelector?this._useKeySelector(t):this._finalizeNext(t,t)},e.prototype._useKeySelector=function(t){var e,n=this.destination;try{e=this.keySelector(t)}catch(t){return void n.error(t)}this._finalizeNext(e,t)},e.prototype._finalizeNext=function(t,e){var n=this.values;n.has(t)||(n.add(t),this.destination.next(e))},e}(i.a);function Tt(t,e){return function(n){return n.lift(new Et(t,e))}}var Et=function(){function t(t,e){this.compare=t,this.keySelector=e}return t.prototype.call=function(t,e){return e.subscribe(new Rt(t,this.compare,this.keySelector))},t}(),Rt=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.keySelector=r,i.hasKey=!1,"function"==typeof n&&(i.compare=n),i}return r.a(e,t),e.prototype.compare=function(t,e){return t===e},e.prototype._next=function(t){var e;try{var n=this.keySelector;e=n?n(t):t}catch(t){return this.destination.error(t)}var r=!1;if(this.hasKey)try{r=(0,this.compare)(this.key,e)}catch(t){return this.destination.error(t)}else this.hasKey=!0;r||(this.key=e,this.destination.next(t))},e}(p.a);function Mt(t,e){return Tt(function(n,r){return e?e(n[t],r[t]):n[t]===r[t]})}var Ot=n(23),Pt=n(16),kt=n(25);function Dt(t){return void 0===t&&(t=jt),function(e){return e.lift(new It(t))}}var It=function(){function t(t){this.errorFactory=t}return t.prototype.call=function(t,e){return e.subscribe(new Nt(t,this.errorFactory))},t}(),Nt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.errorFactory=n,r.hasValue=!1,r}return r.a(e,t),e.prototype._next=function(t){this.hasValue=!0,this.destination.next(t)},e.prototype._complete=function(){if(this.hasValue)return this.destination.complete();var t=void 0;try{t=this.errorFactory()}catch(e){t=e}this.destination.error(t)},e}(p.a);function jt(){return new kt.a}var Lt=n(11);function Ut(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new Ft(t))}}var Ft=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new Bt(t,this.total))},t}(),Bt=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.total,n=++this.count;n<=e&&(this.destination.next(t),n===e&&(this.destination.complete(),this.unsubscribe()))},e}(p.a);function Wt(t,e){if(t<0)throw new Ot.a;var n=arguments.length>=2;return function(r){return r.pipe(Object(Pt.a)(function(e,n){return n===t}),Ut(1),n?ot(e):Dt(function(){return new Ot.a}))}}var zt=n(34);function qt(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return Object(q.a)(e,zt.a.apply(void 0,t))}}function Ht(t,e){return function(n){return n.lift(new Gt(t,e,n))}}var Gt=function(){function t(t,e,n){this.predicate=t,this.thisArg=e,this.source=n}return t.prototype.call=function(t,e){return e.subscribe(new Yt(t,this.predicate,this.thisArg,this.source))},t}(),Yt=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.predicate=n,V.thisArg=r,V.source=i,V.index=0,V.thisArg=r||V,V}return r.a(e,t),e.prototype.notifyComplete=function(t){this.destination.next(t),this.destination.complete()},e.prototype._next=function(t){var e=!1;try{e=this.predicate.call(this.thisArg,t,this.index++,this.source)}catch(t){return void this.destination.error(t)}e||this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.a);function $t(){return function(t){return t.lift(new Qt)}}var Qt=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Xt(t))},t}(),Xt=function(t){function e(e){var n=t.call(this,e)||this;return n.hasCompleted=!1,n.hasSubscription=!1,n}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||(this.hasSubscription=!0,this.add(Object(V.a)(this,t)))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete()},e.prototype.notifyComplete=function(t){this.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.a),Zt=n(9);function Kt(t,e){return e?function(n){return n.pipe(Kt(function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)(function(t,i){return e(n,t,r,i)}))}))}:function(e){return e.lift(new Jt(t))}}var Jt=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new te(t,this.project))},t}(),te=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.hasSubscription=!1,r.hasCompleted=!1,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){this.hasSubscription||this.tryNext(t)},e.prototype.tryNext=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this.hasSubscription=!0,this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=new I.a(this,void 0,void 0);this.destination.add(r),Object(V.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,this.hasSubscription||this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e.prototype.notifyError=function(t){this.destination.error(t)},e.prototype.notifyComplete=function(t){this.destination.remove(t),this.hasSubscription=!1,this.hasCompleted&&this.destination.complete()},e}(i.a);function ee(t,e,n){return void 0===e&&(e=Number.POSITIVE_INFINITY),void 0===n&&(n=void 0),e=(e||0)<1?Number.POSITIVE_INFINITY:e,function(r){return r.lift(new ne(t,e,n))}}var ne=function(){function t(t,e,n){this.project=t,this.concurrent=e,this.scheduler=n}return t.prototype.call=function(t,e){return e.subscribe(new re(t,this.project,this.concurrent,this.scheduler))},t}(),re=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.project=n,V.concurrent=r,V.scheduler=i,V.index=0,V.active=0,V.hasCompleted=!1,r<Number.POSITIVE_INFINITY&&(V.buffer=[]),V}return r.a(e,t),e.dispatch=function(t){var e=t.subscriber,n=t.result,r=t.value,i=t.index;e.subscribeToProjection(n,r,i)},e.prototype._next=function(t){var n=this.destination;if(n.closed)this._complete();else{var r=this.index++;if(this.active<this.concurrent){n.next(t);try{var i=(0,this.project)(t,r);if(this.scheduler){var V={subscriber:this,result:i,value:t,index:r};this.destination.add(this.scheduler.schedule(e.dispatch,0,V))}else this.subscribeToProjection(i,t,r)}catch(t){n.error(t)}}else this.buffer.push(t)}},e.prototype.subscribeToProjection=function(t,e,n){this.active++,this.destination.add(Object(V.a)(this,t,e,n))},e.prototype._complete=function(){this.hasCompleted=!0,this.hasCompleted&&0===this.active&&this.destination.complete(),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){this._next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e&&e.length>0&&this._next(e.shift()),this.hasCompleted&&0===this.active&&this.destination.complete()},e}(i.a);function ie(t){return function(e){return e.lift(new Ve(t))}}var Ve=function(){function t(t){this.callback=t}return t.prototype.call=function(t,e){return e.subscribe(new oe(t,this.callback))},t}(),oe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.add(new E.a(n)),r}return r.a(e,t),e}(p.a);function se(t,e){if("function"!=typeof t)throw new TypeError("predicate is not a function");return function(n){return n.lift(new ae(t,n,!1,e))}}var ae=function(){function t(t,e,n,r){this.predicate=t,this.source=e,this.yieldIndex=n,this.thisArg=r}return t.prototype.call=function(t,e){return e.subscribe(new ce(t,this.predicate,this.source,this.yieldIndex,this.thisArg))},t}(),ce=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.predicate=n,o.source=r,o.yieldIndex=i,o.thisArg=V,o.index=0,o}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete(),this.unsubscribe()},e.prototype._next=function(t){var e=this.predicate,n=this.thisArg,r=this.index++;try{e.call(n||this,t,r,this.source)&&this.notifyComplete(this.yieldIndex?r:t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){this.notifyComplete(this.yieldIndex?-1:void 0)},e}(p.a);function ue(t,e){return function(n){return n.lift(new ae(t,n,!0,e))}}var he=n(18);function le(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)(function(e,n){return t(e,n,r)}):he.a,Ut(1),n?ot(e):Dt(function(){return new kt.a}))}}var fe=n(61);function de(){return function(t){return t.lift(new pe)}}var pe=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new ge(t))},t}(),ge=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r.a(e,t),e.prototype._next=function(t){},e}(p.a);function ve(){return function(t){return t.lift(new ye)}}var ye=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new me(t))},t}(),me=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype.notifyComplete=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype._next=function(t){this.notifyComplete(!1)},e.prototype._complete=function(){this.notifyComplete(!0)},e}(p.a);function be(t){return function(e){return 0===t?Object(Lt.b)():e.lift(new _e(t))}}var _e=function(){function t(t){if(this.total=t,this.total<0)throw new Ot.a}return t.prototype.call=function(t,e){return e.subscribe(new we(t,this.total))},t}(),we=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.ring=new Array,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.ring,n=this.total,r=this.count++;e.length<n?e.push(t):e[r%n]=t},e.prototype._complete=function(){var t=this.destination,e=this.count;if(e>0)for(var n=this.count>=this.total?this.total:this.count,r=this.ring,i=0;i<n;i++){var V=e++%n;t.next(r[V])}t.complete()},e}(p.a);function Ae(t,e){var n=arguments.length>=2;return function(r){return r.pipe(t?Object(Pt.a)(function(e,n){return t(e,n,r)}):he.a,be(1),n?ot(e):Dt(function(){return new kt.a}))}}function Se(t){return function(e){return e.lift(new xe(t))}}var xe=function(){function t(t){this.value=t}return t.prototype.call=function(t,e){return e.subscribe(new Ce(t,this.value))},t}(),Ce=function(t){function e(e,n){var r=t.call(this,e)||this;return r.value=n,r}return r.a(e,t),e.prototype._next=function(t){this.destination.next(this.value)},e}(p.a);function Te(){return function(t){return t.lift(new Ee)}}var Ee=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Re(t))},t}(),Re=function(t){function e(e){return t.call(this,e)||this}return r.a(e,t),e.prototype._next=function(t){this.destination.next(ut.a.createNext(t))},e.prototype._error=function(t){var e=this.destination;e.next(ut.a.createError(t)),e.complete()},e.prototype._complete=function(){var t=this.destination;t.next(ut.a.createComplete()),t.complete()},e}(p.a);function Me(t,e){var n=!1;return arguments.length>=2&&(n=!0),function(r){return r.lift(new Oe(t,e,n))}}var Oe=function(){function t(t,e,n){void 0===n&&(n=!1),this.accumulator=t,this.seed=e,this.hasSeed=n}return t.prototype.call=function(t,e){return e.subscribe(new Pe(t,this.accumulator,this.seed,this.hasSeed))},t}(),Pe=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V._seed=r,V.hasSeed=i,V.index=0,V}return r.a(e,t),Object.defineProperty(e.prototype,"seed",{get:function(){return this._seed},set:function(t){this.hasSeed=!0,this._seed=t},enumerable:!0,configurable:!0}),e.prototype._next=function(t){if(this.hasSeed)return this._tryNext(t);this.seed=t,this.destination.next(t)},e.prototype._tryNext=function(t){var e,n=this.index++;try{e=this.accumulator(this.seed,t,n)}catch(t){this.destination.error(t)}this.seed=e,this.destination.next(e)},e}(p.a),ke=n(37);function De(t,e){return arguments.length>=2?function(n){return Object(ke.a)(Me(t,e),be(1),ot(e))(n)}:function(e){return Object(ke.a)(Me(function(e,n,r){return t(e,n,r+1)}),be(1))(e)}}function Ie(t){return De("function"==typeof t?function(e,n){return t(e,n)>0?e:n}:function(t,e){return t>e?t:e})}var Ne=n(68);function je(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(Ne.a.apply(void 0,[e].concat(t)))}}var Le=n(50);function Ue(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),"function"==typeof e?Object(Y.a)(function(){return t},e,n):("number"==typeof e&&(n=e),Object(Y.a)(function(){return t},n))}function Fe(t,e,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),function(r){return r.lift(new Be(t,e,n))}}var Be=function(){function t(t,e,n){this.accumulator=t,this.seed=e,this.concurrent=n}return t.prototype.call=function(t,e){return e.subscribe(new We(t,this.accumulator,this.seed,this.concurrent))},t}(),We=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.accumulator=n,V.acc=r,V.concurrent=i,V.hasValue=!1,V.hasCompleted=!1,V.buffer=[],V.active=0,V.index=0,V}return r.a(e,t),e.prototype._next=function(t){if(this.active<this.concurrent){var e=this.index++,n=this.destination,r=void 0;try{r=(0,this.accumulator)(this.acc,t,e)}catch(t){return n.error(t)}this.active++,this._innerSub(r,t,e)}else this.buffer.push(t)},e.prototype._innerSub=function(t,e,n){var r=new I.a(this,void 0,void 0);this.destination.add(r),Object(V.a)(this,t,e,n,r)},e.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete()),this.unsubscribe()},e.prototype.notifyNext=function(t,e,n,r,i){var V=this.destination;this.acc=e,this.hasValue=!0,V.next(e)},e.prototype.notifyComplete=function(t){var e=this.buffer;this.destination.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&(!1===this.hasValue&&this.destination.next(this.acc),this.destination.complete())},e}(i.a);function ze(t){return De("function"==typeof t?function(e,n){return t(e,n)<0?e:n}:function(t,e){return t<e?t:e})}var qe=n(63);function He(t,e){return function(n){var r;if(r="function"==typeof t?t:function(){return t},"function"==typeof e)return n.lift(new Ge(r,e));var i=Object.create(n,qe.b);return i.source=n,i.subjectFactory=r,i}}var Ge=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var n=this.selector,r=this.subjectFactory(),i=n(r).subscribe(t);return i.add(e.subscribe(r)),i},t}(),Ye=n(65);function $e(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),function(e){return e.lift(new Qe(t))}}var Qe=function(){function t(t){this.nextSources=t}return t.prototype.call=function(t,e){return e.subscribe(new Xe(t,this.nextSources))},t}(),Xe=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.nextSources=n,r}return r.a(e,t),e.prototype.notifyError=function(t,e){this.subscribeToNextSource()},e.prototype.notifyComplete=function(t){this.subscribeToNextSource()},e.prototype._error=function(t){this.subscribeToNextSource(),this.unsubscribe()},e.prototype._complete=function(){this.subscribeToNextSource(),this.unsubscribe()},e.prototype.subscribeToNextSource=function(){var t=this.nextSources.shift();if(t){var e=new I.a(this,void 0,void 0);this.destination.add(e),Object(V.a)(this,t,void 0,void 0,e)}else this.destination.complete()},e}(i.a);function Ze(){return function(t){return t.lift(new Ke)}}var Ke=function(){function t(){}return t.prototype.call=function(t,e){return e.subscribe(new Je(t))},t}(),Je=function(t){function e(e){var n=t.call(this,e)||this;return n.hasPrev=!1,n}return r.a(e,t),e.prototype._next=function(t){var e;this.hasPrev?e=[this.prev,t]:this.hasPrev=!0,this.prev=t,e&&this.destination.next(e)},e}(p.a),tn=n(77);function en(t,e){return function(n){return[Object(Pt.a)(t,e)(n),Object(Pt.a)(Object(tn.a)(t,e))(n)]}}function nn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t.length;if(0===n)throw new Error("list of properties cannot be empty.");return function(e){return Object(Zt.a)(function(t,e){return function(n){for(var r=n,i=0;i<e;i++){var V=r[t[i]];if(void 0===V)return;r=V}return r}}(t,n))(e)}}var rn=n(6);function Vn(t){return t?He(function(){return new rn.a},t):He(new rn.a)}var on=n(64);function sn(t){return function(e){return He(new on.a(t))(e)}}var an=n(28);function cn(){return function(t){return He(new an.a)(t)}}var un=n(47);function hn(t,e,n,r){n&&"function"!=typeof n&&(r=n);var i="function"==typeof n?n:void 0,V=new un.a(t,e,r);return function(t){return He(function(){return V},i)(t)}}var ln=n(69);function fn(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return 1===t.length&&Object(B.a)(t[0])&&(t=t[0]),e.lift.call(ln.a.apply(void 0,[e].concat(t)))}}function dn(t){return void 0===t&&(t=-1),function(e){return 0===t?Object(Lt.b)():t<0?e.lift(new pn(-1,e)):e.lift(new pn(t-1,e))}}var pn=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new gn(t,this.count,this.source))},t}(),gn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.complete=function(){if(!this.isStopped){var e=this.source,n=this.count;if(0===n)return t.prototype.complete.call(this);n>-1&&(this.count=n-1),e.subscribe(this._unsubscribeAndRecycle())}},e}(p.a);function vn(t){return function(e){return e.lift(new yn(t))}}var yn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new mn(t,this.notifier,e))},t}(),mn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i.sourceIsBeingSubscribedTo=!0,i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.sourceIsBeingSubscribedTo=!0,this.source.subscribe(this)},e.prototype.notifyComplete=function(e){if(!1===this.sourceIsBeingSubscribedTo)return t.prototype.complete.call(this)},e.prototype.complete=function(){if(this.sourceIsBeingSubscribedTo=!1,!this.isStopped){if(this.retries||this.subscribeToRetries(),!this.retriesSubscription||this.retriesSubscription.closed)return t.prototype.complete.call(this);this._unsubscribeAndRecycle(),this.notifications.next()}},e.prototype._unsubscribe=function(){var t=this.notifications,e=this.retriesSubscription;t&&(t.unsubscribe(),this.notifications=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype._unsubscribeAndRecycle=function(){var e=this._unsubscribe;return this._unsubscribe=null,t.prototype._unsubscribeAndRecycle.call(this),this._unsubscribe=e,this},e.prototype.subscribeToRetries=function(){var e;this.notifications=new rn.a;try{e=(0,this.notifier)(this.notifications)}catch(e){return t.prototype.complete.call(this)}this.retries=e,this.retriesSubscription=Object(V.a)(this,e)},e}(i.a);function bn(t){return void 0===t&&(t=-1),function(e){return e.lift(new _n(t,e))}}var _n=function(){function t(t,e){this.count=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new wn(t,this.count,this.source))},t}(),wn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.count=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.source,r=this.count;if(0===r)return t.prototype.error.call(this,e);r>-1&&(this.count=r-1),n.subscribe(this._unsubscribeAndRecycle())}},e}(p.a);function An(t){return function(e){return e.lift(new Sn(t,e))}}var Sn=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new xn(t,this.notifier,this.source))},t}(),xn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.notifier=n,i.source=r,i}return r.a(e,t),e.prototype.error=function(e){if(!this.isStopped){var n=this.errors,r=this.retries,i=this.retriesSubscription;if(r)this.errors=null,this.retriesSubscription=null;else{n=new rn.a;try{r=(0,this.notifier)(n)}catch(e){return t.prototype.error.call(this,e)}i=Object(V.a)(this,r)}this._unsubscribeAndRecycle(),this.errors=n,this.retries=r,this.retriesSubscription=i,n.next(e)}},e.prototype._unsubscribe=function(){var t=this.errors,e=this.retriesSubscription;t&&(t.unsubscribe(),this.errors=null),e&&(e.unsubscribe(),this.retriesSubscription=null),this.retries=null},e.prototype.notifyNext=function(t,e,n,r,i){var V=this._unsubscribe;this._unsubscribe=null,this._unsubscribeAndRecycle(),this._unsubscribe=V,this.source.subscribe(this)},e}(i.a),Cn=n(46);function Tn(t){return function(e){return e.lift(new En(t))}}var En=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new Rn(t),r=e.subscribe(n);return r.add(Object(V.a)(n,this.notifier)),r},t}(),Rn=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e.hasValue=!1,e}return r.a(e,t),e.prototype._next=function(t){this.value=t,this.hasValue=!0},e.prototype.notifyNext=function(t,e,n,r,i){this.emitValue()},e.prototype.notifyComplete=function(){this.emitValue()},e.prototype.emitValue=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.value))},e}(i.a);function Mn(t,e){return void 0===e&&(e=c.a),function(n){return n.lift(new On(t,e))}}var On=function(){function t(t,e){this.period=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new Pn(t,this.period,this.scheduler))},t}(),Pn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.period=n,i.scheduler=r,i.hasValue=!1,i.add(r.schedule(kn,n,{subscriber:i,period:n})),i}return r.a(e,t),e.prototype._next=function(t){this.lastValue=t,this.hasValue=!0},e.prototype.notifyNext=function(){this.hasValue&&(this.hasValue=!1,this.destination.next(this.lastValue))},e}(p.a);function kn(t){var e=t.subscriber,n=t.period;e.notifyNext(),this.schedule(t,n)}function Dn(t,e){return function(n){return n.lift(new In(t,e))}}var In=function(){function t(t,e){this.compareTo=t,this.comparator=e}return t.prototype.call=function(t,e){return e.subscribe(new Nn(t,this.compareTo,this.comparator))},t}(),Nn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.compareTo=n,i.comparator=r,i._a=[],i._b=[],i._oneComplete=!1,i.destination.add(n.subscribe(new jn(e,i))),i}return r.a(e,t),e.prototype._next=function(t){this._oneComplete&&0===this._b.length?this.emit(!1):(this._a.push(t),this.checkValues())},e.prototype._complete=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0,this.unsubscribe()},e.prototype.checkValues=function(){for(var t=this._a,e=this._b,n=this.comparator;t.length>0&&e.length>0;){var r=t.shift(),i=e.shift(),V=!1;try{V=n?n(r,i):r===i}catch(t){this.destination.error(t)}V||this.emit(!1)}},e.prototype.emit=function(t){var e=this.destination;e.next(t),e.complete()},e.prototype.nextB=function(t){this._oneComplete&&0===this._a.length?this.emit(!1):(this._b.push(t),this.checkValues())},e.prototype.completeB=function(){this._oneComplete?this.emit(0===this._a.length&&0===this._b.length):this._oneComplete=!0},e}(p.a),jn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.parent=n,r}return r.a(e,t),e.prototype._next=function(t){this.parent.nextB(t)},e.prototype._error=function(t){this.parent.error(t),this.unsubscribe()},e.prototype._complete=function(){this.parent.completeB(),this.unsubscribe()},e}(p.a);function Ln(){return new rn.a}function Un(){return function(t){return Object(Cn.a)()(He(Ln)(t))}}function Fn(t,e,n){var r;return r=t&&"object"==typeof t?t:{bufferSize:t,windowTime:e,refCount:!1,scheduler:n},function(t){return t.lift(function(t){var e,n,r=t.bufferSize,i=void 0===r?Number.POSITIVE_INFINITY:r,V=t.windowTime,o=void 0===V?Number.POSITIVE_INFINITY:V,s=t.refCount,a=t.scheduler,c=0,u=!1,h=!1;return function(t){c++,e&&!u||(u=!1,e=new un.a(i,o,a),n=t.subscribe({next:function(t){e.next(t)},error:function(t){u=!0,e.error(t)},complete:function(){h=!0,e.complete()}}));var r=e.subscribe(this);this.add(function(){c--,r.unsubscribe(),n&&!h&&s&&0===c&&(n.unsubscribe(),n=void 0,e=void 0)})}}(r))}}function Bn(t){return function(e){return e.lift(new Wn(t,e))}}var Wn=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new zn(t,this.predicate,this.source))},t}(),zn=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.source=r,i.seenValue=!1,i.index=0,i}return r.a(e,t),e.prototype.applySingleValue=function(t){this.seenValue?this.destination.error("Sequence contains more than one element"):(this.seenValue=!0,this.singleValue=t)},e.prototype._next=function(t){var e=this.index++;this.predicate?this.tryNext(t,e):this.applySingleValue(t)},e.prototype.tryNext=function(t,e){try{this.predicate(t,e,this.source)&&this.applySingleValue(t)}catch(t){this.destination.error(t)}},e.prototype._complete=function(){var t=this.destination;this.index>0?(t.next(this.seenValue?this.singleValue:void 0),t.complete()):t.error(new kt.a)},e}(p.a);function qn(t){return function(e){return e.lift(new Hn(t))}}var Hn=function(){function t(t){this.total=t}return t.prototype.call=function(t,e){return e.subscribe(new Gn(t,this.total))},t}(),Gn=function(t){function e(e,n){var r=t.call(this,e)||this;return r.total=n,r.count=0,r}return r.a(e,t),e.prototype._next=function(t){++this.count>this.total&&this.destination.next(t)},e}(p.a);function Yn(t){return function(e){return e.lift(new $n(t))}}var $n=function(){function t(t){if(this._skipCount=t,this._skipCount<0)throw new Ot.a}return t.prototype.call=function(t,e){return 0===this._skipCount?e.subscribe(new p.a(t)):e.subscribe(new Qn(t,this._skipCount))},t}(),Qn=function(t){function e(e,n){var r=t.call(this,e)||this;return r._skipCount=n,r._count=0,r._ring=new Array(n),r}return r.a(e,t),e.prototype._next=function(t){var e=this._skipCount,n=this._count++;if(n<e)this._ring[n]=t;else{var r=n%e,i=this._ring,V=i[r];i[r]=t,this.destination.next(V)}},e}(p.a);function Xn(t){return function(e){return e.lift(new Zn(t))}}var Zn=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){return e.subscribe(new Kn(t,this.notifier))},t}(),Kn=function(t){function e(e,n){var r=t.call(this,e)||this;r.hasValue=!1;var i=new I.a(r,void 0,void 0);return r.add(i),r.innerSubscription=i,Object(V.a)(r,n,void 0,void 0,i),r}return r.a(e,t),e.prototype._next=function(e){this.hasValue&&t.prototype._next.call(this,e)},e.prototype.notifyNext=function(t,e,n,r,i){this.hasValue=!0,this.innerSubscription&&this.innerSubscription.unsubscribe()},e.prototype.notifyComplete=function(){},e}(i.a);function Jn(t){return function(e){return e.lift(new tr(t))}}var tr=function(){function t(t){this.predicate=t}return t.prototype.call=function(t,e){return e.subscribe(new er(t,this.predicate))},t}(),er=function(t){function e(e,n){var r=t.call(this,e)||this;return r.predicate=n,r.skipping=!0,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e=this.destination;this.skipping&&this.tryCallPredicate(t),this.skipping||e.next(t)},e.prototype.tryCallPredicate=function(t){try{var e=this.predicate(t,this.index++);this.skipping=Boolean(e)}catch(t){this.destination.error(t)}},e}(p.a);function nr(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];var n=t[t.length-1];return Object(b.a)(n)?(t.pop(),function(e){return Object(q.a)(t,e,n)}):function(e){return Object(q.a)(t,e)}}var rr=n(56),ir=n(30),Vr=function(t){function e(e,n,r){void 0===n&&(n=0),void 0===r&&(r=rr.a);var i=t.call(this)||this;return i.source=e,i.delayTime=n,i.scheduler=r,(!Object(ir.a)(n)||n<0)&&(i.delayTime=0),r&&"function"==typeof r.schedule||(i.scheduler=rr.a),i}return r.a(e,t),e.create=function(t,n,r){return void 0===n&&(n=0),void 0===r&&(r=rr.a),new e(t,n,r)},e.dispatch=function(t){var e=t.source,n=t.subscriber;return this.add(e.subscribe(n))},e.prototype._subscribe=function(t){var n=this.delayTime,r=this.source;return this.scheduler.schedule(e.dispatch,n,{source:r,subscriber:t})},e}(pt.a);function or(t,e){return void 0===e&&(e=0),function(n){return n.lift(new sr(t,e))}}var sr=function(){function t(t,e){this.scheduler=t,this.delay=e}return t.prototype.call=function(t,e){return new Vr(e,this.delay,this.scheduler).subscribe(t)},t}();function ar(t,e){return"function"==typeof e?function(n){return n.pipe(ar(function(n,r){return Object(W.a)(t(n,r)).pipe(Object(Zt.a)(function(t,i){return e(n,t,r,i)}))}))}:function(e){return e.lift(new cr(t))}}var cr=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new ur(t,this.project))},t}(),ur=function(t){function e(e,n){var r=t.call(this,e)||this;return r.project=n,r.index=0,r}return r.a(e,t),e.prototype._next=function(t){var e,n=this.index++;try{e=this.project(t,n)}catch(t){return void this.destination.error(t)}this._innerSub(e,t,n)},e.prototype._innerSub=function(t,e,n){var r=this.innerSubscription;r&&r.unsubscribe();var i=new I.a(this,void 0,void 0);this.destination.add(i),this.innerSubscription=Object(V.a)(this,t,e,n,i)},e.prototype._complete=function(){var e=this.innerSubscription;e&&!e.closed||t.prototype._complete.call(this),this.unsubscribe()},e.prototype._unsubscribe=function(){this.innerSubscription=null},e.prototype.notifyComplete=function(e){this.destination.remove(e),this.innerSubscription=null,this.isStopped&&t.prototype._complete.call(this)},e.prototype.notifyNext=function(t,e,n,r,i){this.destination.next(e)},e}(i.a);function hr(){return ar(he.a)}function lr(t,e){return e?ar(function(){return t},e):ar(function(){return t})}function fr(t){return function(e){return e.lift(new dr(t))}}var dr=function(){function t(t){this.notifier=t}return t.prototype.call=function(t,e){var n=new pr(t),r=Object(V.a)(n,this.notifier);return r&&!n.seenValue?(n.add(r),e.subscribe(n)):n},t}(),pr=function(t){function e(e){var n=t.call(this,e)||this;return n.seenValue=!1,n}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.seenValue=!0,this.complete()},e.prototype.notifyComplete=function(){},e}(i.a);function gr(t,e){return void 0===e&&(e=!1),function(n){return n.lift(new vr(t,e))}}var vr=function(){function t(t,e){this.predicate=t,this.inclusive=e}return t.prototype.call=function(t,e){return e.subscribe(new yr(t,this.predicate,this.inclusive))},t}(),yr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.predicate=n,i.inclusive=r,i.index=0,i}return r.a(e,t),e.prototype._next=function(t){var e,n=this.destination;try{e=this.predicate(t,this.index++)}catch(t){return void n.error(t)}this.nextOrComplete(t,e)},e.prototype.nextOrComplete=function(t,e){var n=this.destination;Boolean(e)?n.next(t):(this.inclusive&&n.next(t),n.complete())},e}(p.a),mr=n(15),br=n(24);function _r(t,e,n){return function(r){return r.lift(new wr(t,e,n))}}var wr=function(){function t(t,e,n){this.nextOrObserver=t,this.error=e,this.complete=n}return t.prototype.call=function(t,e){return e.subscribe(new Ar(t,this.nextOrObserver,this.error,this.complete))},t}(),Ar=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V._tapNext=mr.a,V._tapError=mr.a,V._tapComplete=mr.a,V._tapError=r||mr.a,V._tapComplete=i||mr.a,Object(br.a)(n)?(V._context=V,V._tapNext=n):n&&(V._context=n,V._tapNext=n.next||mr.a,V._tapError=n.error||mr.a,V._tapComplete=n.complete||mr.a),V}return r.a(e,t),e.prototype._next=function(t){try{this._tapNext.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.next(t)},e.prototype._error=function(t){try{this._tapError.call(this._context,t)}catch(t){return void this.destination.error(t)}this.destination.error(t)},e.prototype._complete=function(){try{this._tapComplete.call(this._context)}catch(t){return void this.destination.error(t)}return this.destination.complete()},e}(p.a),Sr={leading:!0,trailing:!1};function xr(t,e){return void 0===e&&(e=Sr),function(n){return n.lift(new Cr(t,e.leading,e.trailing))}}var Cr=function(){function t(t,e,n){this.durationSelector=t,this.leading=e,this.trailing=n}return t.prototype.call=function(t,e){return e.subscribe(new Tr(t,this.durationSelector,this.leading,this.trailing))},t}(),Tr=function(t){function e(e,n,r,i){var V=t.call(this,e)||this;return V.destination=e,V.durationSelector=n,V._leading=r,V._trailing=i,V._hasValue=!1,V}return r.a(e,t),e.prototype._next=function(t){this._hasValue=!0,this._sendValue=t,this._throttled||(this._leading?this.send():this.throttle(t))},e.prototype.send=function(){var t=this._hasValue,e=this._sendValue;t&&(this.destination.next(e),this.throttle(e)),this._hasValue=!1,this._sendValue=null},e.prototype.throttle=function(t){var e=this.tryDurationSelector(t);e&&this.add(this._throttled=Object(V.a)(this,e))},e.prototype.tryDurationSelector=function(t){try{return this.durationSelector(t)}catch(t){return this.destination.error(t),null}},e.prototype.throttlingDone=function(){var t=this._throttled,e=this._trailing;t&&t.unsubscribe(),this._throttled=null,e&&this.send()},e.prototype.notifyNext=function(t,e,n,r,i){this.throttlingDone()},e.prototype.notifyComplete=function(){this.throttlingDone()},e}(i.a);function Er(t,e,n){return void 0===e&&(e=c.a),void 0===n&&(n=Sr),function(r){return r.lift(new Rr(t,e,n.leading,n.trailing))}}var Rr=function(){function t(t,e,n,r){this.duration=t,this.scheduler=e,this.leading=n,this.trailing=r}return t.prototype.call=function(t,e){return e.subscribe(new Mr(t,this.duration,this.scheduler,this.leading,this.trailing))},t}(),Mr=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.duration=n,o.scheduler=r,o.leading=i,o.trailing=V,o._hasTrailingValue=!1,o._trailingValue=null,o}return r.a(e,t),e.prototype._next=function(t){this.throttled?this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0):(this.add(this.throttled=this.scheduler.schedule(Or,this.duration,{subscriber:this})),this.leading?this.destination.next(t):this.trailing&&(this._trailingValue=t,this._hasTrailingValue=!0))},e.prototype._complete=function(){this._hasTrailingValue?(this.destination.next(this._trailingValue),this.destination.complete()):this.destination.complete()},e.prototype.clearThrottle=function(){var t=this.throttled;t&&(this.trailing&&this._hasTrailingValue&&(this.destination.next(this._trailingValue),this._trailingValue=null,this._hasTrailingValue=!1),t.unsubscribe(),this.remove(t),this.throttled=null)},e}(p.a);function Or(t){t.subscriber.clearThrottle()}var Pr=n(51);function kr(t){return void 0===t&&(t=c.a),function(e){return Object(Pr.a)(function(){return e.pipe(Me(function(e,n){var r=e.current;return{value:n,current:t.now(),last:r}},{current:t.now(),value:void 0,last:void 0}),Object(Zt.a)(function(t){var e=t.current,n=t.last,r=t.value;return new Dr(r,e-n)}))})}}var Dr=function(){return function(t,e){this.value=t,this.interval=e}}(),Ir=n(66);function Nr(t,e,n){return void 0===n&&(n=c.a),function(r){var i=ct(t),V=i?+t-n.now():Math.abs(t);return r.lift(new jr(V,i,e,n))}}var jr=function(){function t(t,e,n,r){this.waitFor=t,this.absoluteTimeout=e,this.withObservable=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new Lr(t,this.absoluteTimeout,this.waitFor,this.withObservable,this.scheduler))},t}(),Lr=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;return o.absoluteTimeout=n,o.waitFor=r,o.withObservable=i,o.scheduler=V,o.action=null,o.scheduleTimeout(),o}return r.a(e,t),e.dispatchTimeout=function(t){var e=t.withObservable;t._unsubscribeAndRecycle(),t.add(Object(V.a)(t,e))},e.prototype.scheduleTimeout=function(){var t=this.action;t?this.action=t.schedule(this,this.waitFor):this.add(this.action=this.scheduler.schedule(e.dispatchTimeout,this.waitFor,this))},e.prototype._next=function(e){this.absoluteTimeout||this.scheduleTimeout(),t.prototype._next.call(this,e)},e.prototype._unsubscribe=function(){this.action=null,this.scheduler=null,this.withObservable=null},e}(i.a),Ur=n(48);function Fr(t,e){return void 0===e&&(e=c.a),Nr(t,Object(Ur.a)(new Ir.a),e)}function Br(t){return void 0===t&&(t=c.a),Object(Zt.a)(function(e){return new Wr(e,t.now())})}var Wr=function(){return function(t,e){this.value=t,this.timestamp=e}}();function zr(t,e,n){return 0===n?[e]:(t.push(e),t)}function qr(){return De(zr,[])}function Hr(t){return function(e){return e.lift(new Gr(t))}}var Gr=function(){function t(t){this.windowBoundaries=t}return t.prototype.call=function(t,e){var n=new Yr(t),r=e.subscribe(n);return r.closed||n.add(Object(V.a)(n,this.windowBoundaries)),r},t}(),Yr=function(t){function e(e){var n=t.call(this,e)||this;return n.window=new rn.a,e.next(n.window),n}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow()},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this._complete()},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t)},e.prototype._complete=function(){this.window.complete(),this.destination.complete()},e.prototype._unsubscribe=function(){this.window=null},e.prototype.openWindow=function(){var t=this.window;t&&t.complete();var e=this.destination,n=this.window=new rn.a;e.next(n)},e}(i.a);function $r(t,e){return void 0===e&&(e=0),function(n){return n.lift(new Qr(t,e))}}var Qr=function(){function t(t,e){this.windowSize=t,this.startWindowEvery=e}return t.prototype.call=function(t,e){return e.subscribe(new Xr(t,this.windowSize,this.startWindowEvery))},t}(),Xr=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.destination=e,i.windowSize=n,i.startWindowEvery=r,i.windows=[new rn.a],i.count=0,e.next(i.windows[0]),i}return r.a(e,t),e.prototype._next=function(t){for(var e=this.startWindowEvery>0?this.startWindowEvery:this.windowSize,n=this.destination,r=this.windowSize,i=this.windows,V=i.length,o=0;o<V&&!this.closed;o++)i[o].next(t);var s=this.count-r+1;if(s>=0&&s%e==0&&!this.closed&&i.shift().complete(),++this.count%e==0&&!this.closed){var a=new rn.a;i.push(a),n.next(a)}},e.prototype._error=function(t){var e=this.windows;if(e)for(;e.length>0&&!this.closed;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){var t=this.windows;if(t)for(;t.length>0&&!this.closed;)t.shift().complete();this.destination.complete()},e.prototype._unsubscribe=function(){this.count=0,this.windows=null},e}(p.a);function Zr(t){var e=c.a,n=null,r=Number.POSITIVE_INFINITY;return Object(b.a)(arguments[3])&&(e=arguments[3]),Object(b.a)(arguments[2])?e=arguments[2]:Object(ir.a)(arguments[2])&&(r=arguments[2]),Object(b.a)(arguments[1])?e=arguments[1]:Object(ir.a)(arguments[1])&&(n=arguments[1]),function(i){return i.lift(new Kr(t,n,r,e))}}var Kr=function(){function t(t,e,n,r){this.windowTimeSpan=t,this.windowCreationInterval=e,this.maxWindowSize=n,this.scheduler=r}return t.prototype.call=function(t,e){return e.subscribe(new ti(t,this.windowTimeSpan,this.windowCreationInterval,this.maxWindowSize,this.scheduler))},t}(),Jr=function(t){function e(){var e=null!==t&&t.apply(this,arguments)||this;return e._numberOfNextedValues=0,e}return r.a(e,t),e.prototype.next=function(e){this._numberOfNextedValues++,t.prototype.next.call(this,e)},Object.defineProperty(e.prototype,"numberOfNextedValues",{get:function(){return this._numberOfNextedValues},enumerable:!0,configurable:!0}),e}(rn.a),ti=function(t){function e(e,n,r,i,V){var o=t.call(this,e)||this;o.destination=e,o.windowTimeSpan=n,o.windowCreationInterval=r,o.maxWindowSize=i,o.scheduler=V,o.windows=[];var s=o.openWindow();if(null!==r&&r>=0){var a={subscriber:o,window:s,context:null},c={windowTimeSpan:n,windowCreationInterval:r,subscriber:o,scheduler:V};o.add(V.schedule(ri,n,a)),o.add(V.schedule(ni,r,c))}else{var u={subscriber:o,window:s,windowTimeSpan:n};o.add(V.schedule(ei,n,u))}return o}return r.a(e,t),e.prototype._next=function(t){for(var e=this.windows,n=e.length,r=0;r<n;r++){var i=e[r];i.closed||(i.next(t),i.numberOfNextedValues>=this.maxWindowSize&&this.closeWindow(i))}},e.prototype._error=function(t){for(var e=this.windows;e.length>0;)e.shift().error(t);this.destination.error(t)},e.prototype._complete=function(){for(var t=this.windows;t.length>0;){var e=t.shift();e.closed||e.complete()}this.destination.complete()},e.prototype.openWindow=function(){var t=new Jr;return this.windows.push(t),this.destination.next(t),t},e.prototype.closeWindow=function(t){t.complete();var e=this.windows;e.splice(e.indexOf(t),1)},e}(p.a);function ei(t){var e=t.subscriber,n=t.windowTimeSpan,r=t.window;r&&e.closeWindow(r),t.window=e.openWindow(),this.schedule(t,n)}function ni(t){var e=t.windowTimeSpan,n=t.subscriber,r=t.scheduler,i=t.windowCreationInterval,V=n.openWindow(),o={action:this,subscription:null},s={subscriber:n,window:V,context:o};o.subscription=r.schedule(ri,e,s),this.add(o.subscription),this.schedule(t,i)}function ri(t){var e=t.subscriber,n=t.window,r=t.context;r&&r.action&&r.subscription&&r.action.remove(r.subscription),e.closeWindow(n)}function ii(t,e){return function(n){return n.lift(new Vi(t,e))}}var Vi=function(){function t(t,e){this.openings=t,this.closingSelector=e}return t.prototype.call=function(t,e){return e.subscribe(new oi(t,this.openings,this.closingSelector))},t}(),oi=function(t){function e(e,n,r){var i=t.call(this,e)||this;return i.openings=n,i.closingSelector=r,i.contexts=[],i.add(i.openSubscription=Object(V.a)(i,n,n)),i}return r.a(e,t),e.prototype._next=function(t){var e=this.contexts;if(e)for(var n=e.length,r=0;r<n;r++)e[r].window.next(t)},e.prototype._error=function(e){var n=this.contexts;if(this.contexts=null,n)for(var r=n.length,i=-1;++i<r;){var V=n[i];V.window.error(e),V.subscription.unsubscribe()}t.prototype._error.call(this,e)},e.prototype._complete=function(){var e=this.contexts;if(this.contexts=null,e)for(var n=e.length,r=-1;++r<n;){var i=e[r];i.window.complete(),i.subscription.unsubscribe()}t.prototype._complete.call(this)},e.prototype._unsubscribe=function(){var t=this.contexts;if(this.contexts=null,t)for(var e=t.length,n=-1;++n<e;){var r=t[n];r.window.unsubscribe(),r.subscription.unsubscribe()}},e.prototype.notifyNext=function(t,e,n,r,i){if(t===this.openings){var o=void 0;try{o=(0,this.closingSelector)(e)}catch(t){return this.error(t)}var s=new rn.a,a=new E.a,c={window:s,subscription:a};this.contexts.push(c);var u=Object(V.a)(this,o,c);u.closed?this.closeWindow(this.contexts.length-1):(u.context=c,a.add(u)),this.destination.next(s)}else this.closeWindow(this.contexts.indexOf(t))},e.prototype.notifyError=function(t){this.error(t)},e.prototype.notifyComplete=function(t){t!==this.openSubscription&&this.closeWindow(this.contexts.indexOf(t.context))},e.prototype.closeWindow=function(t){if(-1!==t){var e=this.contexts,n=e[t],r=n.window,i=n.subscription;e.splice(t,1),r.complete(),i.unsubscribe()}},e}(i.a);function si(t){return function(e){return e.lift(new ai(t))}}var ai=function(){function t(t){this.closingSelector=t}return t.prototype.call=function(t,e){return e.subscribe(new ci(t,this.closingSelector))},t}(),ci=function(t){function e(e,n){var r=t.call(this,e)||this;return r.destination=e,r.closingSelector=n,r.openWindow(),r}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.openWindow(i)},e.prototype.notifyError=function(t,e){this._error(t)},e.prototype.notifyComplete=function(t){this.openWindow(t)},e.prototype._next=function(t){this.window.next(t)},e.prototype._error=function(t){this.window.error(t),this.destination.error(t),this.unsubscribeClosingNotification()},e.prototype._complete=function(){this.window.complete(),this.destination.complete(),this.unsubscribeClosingNotification()},e.prototype.unsubscribeClosingNotification=function(){this.closingNotification&&this.closingNotification.unsubscribe()},e.prototype.openWindow=function(t){void 0===t&&(t=null),t&&(this.remove(t),t.unsubscribe());var e=this.window;e&&e.complete();var n,r=this.window=new rn.a;this.destination.next(r);try{n=(0,this.closingSelector)()}catch(t){return this.destination.error(t),void this.window.error(t)}this.add(this.closingNotification=Object(V.a)(this,n))},e}(i.a);function ui(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){var n;"function"==typeof t[t.length-1]&&(n=t.pop());var r=t;return e.lift(new hi(r,n))}}var hi=function(){function t(t,e){this.observables=t,this.project=e}return t.prototype.call=function(t,e){return e.subscribe(new li(t,this.observables,this.project))},t}(),li=function(t){function e(e,n,r){var i=t.call(this,e)||this;i.observables=n,i.project=r,i.toRespond=[];var o=n.length;i.values=new Array(o);for(var s=0;s<o;s++)i.toRespond.push(s);for(s=0;s<o;s++){var a=n[s];i.add(Object(V.a)(i,a,a,s))}return i}return r.a(e,t),e.prototype.notifyNext=function(t,e,n,r,i){this.values[n]=e;var V=this.toRespond;if(V.length>0){var o=V.indexOf(n);-1!==o&&V.splice(o,1)}},e.prototype.notifyComplete=function(){},e.prototype._next=function(t){if(0===this.toRespond.length){var e=[t].concat(this.values);this.project?this._tryProject(e):this.destination.next(e)}},e.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(t){return void this.destination.error(t)}this.destination.next(e)},e}(i.a),fi=n(52);function di(){for(var t=[],e=0;e<arguments.length;e++)t[e]=arguments[e];return function(e){return e.lift.call(fi.b.apply(void 0,[e].concat(t)))}}function pi(t){return function(e){return e.lift(new fi.a(t))}}n.d(e,"audit",function(){return o}),n.d(e,"auditTime",function(){return h}),n.d(e,"buffer",function(){return l}),n.d(e,"bufferCount",function(){return g}),n.d(e,"bufferTime",function(){return _}),n.d(e,"bufferToggle",function(){return R}),n.d(e,"bufferWhen",function(){return P}),n.d(e,"catchError",function(){return N}),n.d(e,"combineAll",function(){return F}),n.d(e,"combineLatest",function(){return z}),n.d(e,"concat",function(){return H}),n.d(e,"concatAll",function(){return G.a}),n.d(e,"concatMap",function(){return $}),n.d(e,"concatMapTo",function(){return Q}),n.d(e,"count",function(){return X}),n.d(e,"debounce",function(){return J}),n.d(e,"debounceTime",function(){return nt}),n.d(e,"defaultIfEmpty",function(){return ot}),n.d(e,"delay",function(){return ht}),n.d(e,"delayWhen",function(){return gt}),n.d(e,"dematerialize",function(){return _t}),n.d(e,"distinct",function(){return St}),n.d(e,"distinctUntilChanged",function(){return Tt}),n.d(e,"distinctUntilKeyChanged",function(){return Mt}),n.d(e,"elementAt",function(){return Wt}),n.d(e,"endWith",function(){return qt}),n.d(e,"every",function(){return Ht}),n.d(e,"exhaust",function(){return $t}),n.d(e,"exhaustMap",function(){return Kt}),n.d(e,"expand",function(){return ee}),n.d(e,"filter",function(){return Pt.a}),n.d(e,"finalize",function(){return ie}),n.d(e,"find",function(){return se}),n.d(e,"findIndex",function(){return ue}),n.d(e,"first",function(){return le}),n.d(e,"groupBy",function(){return fe.b}),n.d(e,"ignoreElements",function(){return de}),n.d(e,"isEmpty",function(){return ve}),n.d(e,"last",function(){return Ae}),n.d(e,"map",function(){return Zt.a}),n.d(e,"mapTo",function(){return Se}),n.d(e,"materialize",function(){return Te}),n.d(e,"max",function(){return Ie}),n.d(e,"merge",function(){return je}),n.d(e,"mergeAll",function(){return Le.a}),n.d(e,"mergeMap",function(){return Y.a}),n.d(e,"flatMap",function(){return Y.a}),n.d(e,"mergeMapTo",function(){return Ue}),n.d(e,"mergeScan",function(){return Fe}),n.d(e,"min",function(){return ze}),n.d(e,"multicast",function(){return He}),n.d(e,"observeOn",function(){return Ye.b}),n.d(e,"onErrorResumeNext",function(){return $e}),n.d(e,"pairwise",function(){return Ze}),n.d(e,"partition",function(){return en}),n.d(e,"pluck",function(){return nn}),n.d(e,"publish",function(){return Vn}),n.d(e,"publishBehavior",function(){return sn}),n.d(e,"publishLast",function(){return cn}),n.d(e,"publishReplay",function(){return hn}),n.d(e,"race",function(){return fn}),n.d(e,"reduce",function(){return De}),n.d(e,"repeat",function(){return dn}),n.d(e,"repeatWhen",function(){return vn}),n.d(e,"retry",function(){return bn}),n.d(e,"retryWhen",function(){return An}),n.d(e,"refCount",function(){return Cn.a}),n.d(e,"sample",function(){return Tn}),n.d(e,"sampleTime",function(){return Mn}),n.d(e,"scan",function(){return Me}),n.d(e,"sequenceEqual",function(){return Dn}),n.d(e,"share",function(){return Un}),n.d(e,"shareReplay",function(){return Fn}),n.d(e,"single",function(){return Bn}),n.d(e,"skip",function(){return qn}),n.d(e,"skipLast",function(){return Yn}),n.d(e,"skipUntil",function(){return Xn}),n.d(e,"skipWhile",function(){return Jn}),n.d(e,"startWith",function(){return nr}),n.d(e,"subscribeOn",function(){return or}),n.d(e,"switchAll",function(){return hr}),n.d(e,"switchMap",function(){return ar}),n.d(e,"switchMapTo",function(){return lr}),n.d(e,"take",function(){return Ut}),n.d(e,"takeLast",function(){return be}),n.d(e,"takeUntil",function(){return fr}),n.d(e,"takeWhile",function(){return gr}),n.d(e,"tap",function(){return _r}),n.d(e,"throttle",function(){return xr}),n.d(e,"throttleTime",function(){return Er}),n.d(e,"throwIfEmpty",function(){return Dt}),n.d(e,"timeInterval",function(){return kr}),n.d(e,"timeout",function(){return Fr}),n.d(e,"timeoutWith",function(){return Nr}),n.d(e,"timestamp",function(){return Br}),n.d(e,"toArray",function(){return qr}),n.d(e,"window",function(){return Hr}),n.d(e,"windowCount",function(){return $r}),n.d(e,"windowTime",function(){return Zr}),n.d(e,"windowToggle",function(){return ii}),n.d(e,"windowWhen",function(){return si}),n.d(e,"withLatestFrom",function(){return ui}),n.d(e,"zip",function(){return di}),n.d(e,"zipAll",function(){return pi})},function(t,e,n){"use strict";n.r(e);var r={};n.r(r),n.d(r,"shimGetUserMedia",function(){return m}),n.d(r,"shimGetDisplayMedia",function(){return b}),n.d(r,"shimMediaStream",function(){return _}),n.d(r,"shimOnTrack",function(){return w}),n.d(r,"shimGetSendersWithDtmf",function(){return A}),n.d(r,"shimGetStats",function(){return S}),n.d(r,"shimSenderReceiverGetStats",function(){return x}),n.d(r,"shimAddTrackRemoveTrackWithNative",function(){return C}),n.d(r,"shimAddTrackRemoveTrack",function(){return T}),n.d(r,"shimPeerConnection",function(){return E}),n.d(r,"fixNegotiationNeeded",function(){return R});var i={};n.r(i),n.d(i,"shimGetUserMedia",function(){return M}),n.d(i,"shimGetDisplayMedia",function(){return O}),n.d(i,"shimOnTrack",function(){return P}),n.d(i,"shimPeerConnection",function(){return k}),n.d(i,"shimSenderGetStats",function(){return D}),n.d(i,"shimReceiverGetStats",function(){return I}),n.d(i,"shimRemoveStream",function(){return N}),n.d(i,"shimRTCDataChannel",function(){return j}),n.d(i,"shimAddTransceiver",function(){return L}),n.d(i,"shimGetParameters",function(){return U}),n.d(i,"shimCreateOffer",function(){return F}),n.d(i,"shimCreateAnswer",function(){return B});var V={};n.r(V),n.d(V,"shimLocalStreamsAPI",function(){return W}),n.d(V,"shimRemoteStreamsAPI",function(){return z}),n.d(V,"shimCallbacksAPI",function(){return q}),n.d(V,"shimGetUserMedia",function(){return H}),n.d(V,"shimConstraints",function(){return G}),n.d(V,"shimRTCIceServerUrls",function(){return Y}),n.d(V,"shimTrackEventTransceiver",function(){return $}),n.d(V,"shimCreateOfferLegacy",function(){return Q}),n.d(V,"shimAudioContext",function(){return X});var o={};n.r(o),n.d(o,"shimRTCIceCandidate",function(){return J}),n.d(o,"shimMaxMessageSize",function(){return tt}),n.d(o,"shimSendThrowTypeError",function(){return et}),n.d(o,"shimConnectionState",function(){return nt}),n.d(o,"removeExtmapAllowMixed",function(){return rt}),n.d(o,"shimAddIceCandidateNullOrEmpty",function(){return it}),n.d(o,"shimParameterlessSetLocalDescription",function(){return Vt});let s=!0,a=!0;function c(t,e,n){const r=t.match(e);return r&&r.length>=n&&parseInt(r[n],10)}function u(t,e,n){if(!t.RTCPeerConnection)return;const r=t.RTCPeerConnection.prototype,i=r.addEventListener;r.addEventListener=function(t,r){if(t!==e)return i.apply(this,arguments);const V=t=>{const e=n(t);e&&(r.handleEvent?r.handleEvent(e):r(e))};return this._eventMap=this._eventMap||{},this._eventMap[e]||(this._eventMap[e]=new Map),this._eventMap[e].set(r,V),i.apply(this,[t,V])};const V=r.removeEventListener;r.removeEventListener=function(t,n){if(t!==e||!this._eventMap||!this._eventMap[e])return V.apply(this,arguments);if(!this._eventMap[e].has(n))return V.apply(this,arguments);const r=this._eventMap[e].get(n);return this._eventMap[e].delete(n),0===this._eventMap[e].size&&delete this._eventMap[e],0===Object.keys(this._eventMap).length&&delete this._eventMap,V.apply(this,[t,r])},Object.defineProperty(r,"on"+e,{get(){return this["_on"+e]},set(t){this["_on"+e]&&(this.removeEventListener(e,this["_on"+e]),delete this["_on"+e]),t&&this.addEventListener(e,this["_on"+e]=t)},enumerable:!0,configurable:!0})}function h(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(s=t,t?"adapter.js logging disabled":"adapter.js logging enabled")}function l(t){return"boolean"!=typeof t?new Error("Argument type: "+typeof t+". Please use a boolean."):(a=!t,"adapter.js deprecation warnings "+(t?"disabled":"enabled"))}function f(){if("object"==typeof window){if(s)return;"undefined"!=typeof console&&"function"==typeof console.log&&console.log.apply(console,arguments)}}function d(t,e){a&&console.warn(t+" is deprecated, please use "+e+" instead.")}function p(t){return"[object Object]"===Object.prototype.toString.call(t)}function g(t){return p(t)?Object.keys(t).reduce(function(e,n){const r=p(t[n]),i=r?g(t[n]):t[n],V=r&&!Object.keys(i).length;return void 0===i||V?e:Object.assign(e,{[n]:i})},{}):t}function v(t,e,n){const r=n?"outbound-rtp":"inbound-rtp",i=new Map;if(null===e)return i;const V=[];return t.forEach(t=>{"track"===t.type&&t.trackIdentifier===e.id&&V.push(t)}),V.forEach(e=>{t.forEach(n=>{n.type===r&&n.trackId===e.id&&function t(e,n,r){n&&!r.has(n.id)&&(r.set(n.id,n),Object.keys(n).forEach(i=>{i.endsWith("Id")?t(e,e.get(n[i]),r):i.endsWith("Ids")&&n[i].forEach(n=>{t(e,e.get(n),r)})}))}(t,n,i)})}),i}const y=f;function m(t,e){const n=t&&t.navigator;if(!n.mediaDevices)return;const r=function(t){if("object"!=typeof t||t.mandatory||t.optional)return t;const e={};return Object.keys(t).forEach(n=>{if("require"===n||"advanced"===n||"mediaSource"===n)return;const r="object"==typeof t[n]?t[n]:{ideal:t[n]};void 0!==r.exact&&"number"==typeof r.exact&&(r.min=r.max=r.exact);const i=function(t,e){return t?t+e.charAt(0).toUpperCase()+e.slice(1):"deviceId"===e?"sourceId":e};if(void 0!==r.ideal){e.optional=e.optional||[];let t={};"number"==typeof r.ideal?(t[i("min",n)]=r.ideal,e.optional.push(t),(t={})[i("max",n)]=r.ideal,e.optional.push(t)):(t[i("",n)]=r.ideal,e.optional.push(t))}void 0!==r.exact&&"number"!=typeof r.exact?(e.mandatory=e.mandatory||{},e.mandatory[i("",n)]=r.exact):["min","max"].forEach(t=>{void 0!==r[t]&&(e.mandatory=e.mandatory||{},e.mandatory[i(t,n)]=r[t])})}),t.advanced&&(e.optional=(e.optional||[]).concat(t.advanced)),e},i=function(t,i){if(e.version>=61)return i(t);if((t=JSON.parse(JSON.stringify(t)))&&"object"==typeof t.audio){const e=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])};e((t=JSON.parse(JSON.stringify(t))).audio,"autoGainControl","googAutoGainControl"),e(t.audio,"noiseSuppression","googNoiseSuppression"),t.audio=r(t.audio)}if(t&&"object"==typeof t.video){let V=t.video.facingMode;V=V&&("object"==typeof V?V:{ideal:V});const o=e.version<66;if(V&&("user"===V.exact||"environment"===V.exact||"user"===V.ideal||"environment"===V.ideal)&&(!n.mediaDevices.getSupportedConstraints||!n.mediaDevices.getSupportedConstraints().facingMode||o)){let e;if(delete t.video.facingMode,"environment"===V.exact||"environment"===V.ideal?e=["back","rear"]:"user"!==V.exact&&"user"!==V.ideal||(e=["front"]),e)return n.mediaDevices.enumerateDevices().then(n=>{let o=(n=n.filter(t=>"videoinput"===t.kind)).find(t=>e.some(e=>t.label.toLowerCase().includes(e)));return!o&&n.length&&e.includes("back")&&(o=n[n.length-1]),o&&(t.video.deviceId=V.exact?{exact:o.deviceId}:{ideal:o.deviceId}),t.video=r(t.video),y("chrome: "+JSON.stringify(t)),i(t)})}t.video=r(t.video)}return y("chrome: "+JSON.stringify(t)),i(t)},V=function(t){return e.version>=64?t:{name:{PermissionDeniedError:"NotAllowedError",PermissionDismissedError:"NotAllowedError",InvalidStateError:"NotAllowedError",DevicesNotFoundError:"NotFoundError",ConstraintNotSatisfiedError:"OverconstrainedError",TrackStartError:"NotReadableError",MediaDeviceFailedDueToShutdown:"NotAllowedError",MediaDeviceKillSwitchOn:"NotAllowedError",TabCaptureError:"AbortError",ScreenCaptureError:"AbortError",DeviceCaptureError:"AbortError"}[t.name]||t.name,message:t.message,constraint:t.constraint||t.constraintName,toString(){return this.name+(this.message&&": ")+this.message}}};if(n.getUserMedia=function(t,e,r){i(t,t=>{n.webkitGetUserMedia(t,e,t=>{r&&r(V(t))})})}.bind(n),n.mediaDevices.getUserMedia){const t=n.mediaDevices.getUserMedia.bind(n.mediaDevices);n.mediaDevices.getUserMedia=function(e){return i(e,e=>t(e).then(t=>{if(e.audio&&!t.getAudioTracks().length||e.video&&!t.getVideoTracks().length)throw t.getTracks().forEach(t=>{t.stop()}),new DOMException("","NotFoundError");return t},t=>Promise.reject(V(t))))}}}function b(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&("function"==typeof e?t.navigator.mediaDevices.getDisplayMedia=function(n){return e(n).then(e=>{const r=n.video&&n.video.width,i=n.video&&n.video.height,V=n.video&&n.video.frameRate;return n.video={mandatory:{chromeMediaSource:"desktop",chromeMediaSourceId:e,maxFrameRate:V||3}},r&&(n.video.mandatory.maxWidth=r),i&&(n.video.mandatory.maxHeight=i),t.navigator.mediaDevices.getUserMedia(n)})}:console.error("shimGetDisplayMedia: getSourceId argument is not a function"))}function _(t){t.MediaStream=t.MediaStream||t.webkitMediaStream}function w(t){if("object"!=typeof t||!t.RTCPeerConnection||"ontrack"in t.RTCPeerConnection.prototype)u(t,"track",t=>(t.transceiver||Object.defineProperty(t,"transceiver",{value:{receiver:t.receiver}}),t));else{Object.defineProperty(t.RTCPeerConnection.prototype,"ontrack",{get(){return this._ontrack},set(t){this._ontrack&&this.removeEventListener("track",this._ontrack),this.addEventListener("track",this._ontrack=t)},enumerable:!0,configurable:!0});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){return this._ontrackpoly||(this._ontrackpoly=e=>{e.stream.addEventListener("addtrack",n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.track.id):{track:n.track};const i=new Event("track");i.track=n.track,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)}),e.stream.getTracks().forEach(n=>{let r;r=t.RTCPeerConnection.prototype.getReceivers?this.getReceivers().find(t=>t.track&&t.track.id===n.id):{track:n};const i=new Event("track");i.track=n,i.receiver=r,i.transceiver={receiver:r},i.streams=[e.stream],this.dispatchEvent(i)})},this.addEventListener("addstream",this._ontrackpoly)),e.apply(this,arguments)}}}function A(t){if("object"==typeof t&&t.RTCPeerConnection&&!("getSenders"in t.RTCPeerConnection.prototype)&&"createDTMFSender"in t.RTCPeerConnection.prototype){const e=function(t,e){return{track:e,get dtmf(){return void 0===this._dtmf&&("audio"===e.kind?this._dtmf=t.createDTMFSender(e):this._dtmf=null),this._dtmf},_pc:t}};if(!t.RTCPeerConnection.prototype.getSenders){t.RTCPeerConnection.prototype.getSenders=function(){return this._senders=this._senders||[],this._senders.slice()};const n=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,r){let i=n.apply(this,arguments);return i||(i=e(this,t),this._senders.push(i)),i};const r=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){r.apply(this,arguments);const e=this._senders.indexOf(t);-1!==e&&this._senders.splice(e,1)}}const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._senders=this._senders||[],n.apply(this,[t]),t.getTracks().forEach(t=>{this._senders.push(e(this,t))})};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){this._senders=this._senders||[],r.apply(this,[t]),t.getTracks().forEach(t=>{const e=this._senders.find(e=>e.track===t);e&&this._senders.splice(this._senders.indexOf(e),1)})}}else if("object"==typeof t&&t.RTCPeerConnection&&"getSenders"in t.RTCPeerConnection.prototype&&"createDTMFSender"in t.RTCPeerConnection.prototype&&t.RTCRtpSender&&!("dtmf"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t},Object.defineProperty(t.RTCRtpSender.prototype,"dtmf",{get(){return void 0===this._dtmf&&("audio"===this.track.kind?this._dtmf=this._pc.createDTMFSender(this.track):this._dtmf=null),this._dtmf}})}}function S(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,n,r]=arguments;if(arguments.length>0&&"function"==typeof t)return e.apply(this,arguments);if(0===e.length&&(0===arguments.length||"function"!=typeof t))return e.apply(this,[]);const i=function(t){const e={};return t.result().forEach(t=>{const n={id:t.id,timestamp:t.timestamp,type:{localcandidate:"local-candidate",remotecandidate:"remote-candidate"}[t.type]||t.type};t.names().forEach(e=>{n[e]=t.stat(e)}),e[n.id]=n}),e},V=function(t){return new Map(Object.keys(t).map(e=>[e,t[e]]))};if(arguments.length>=2){const r=function(t){n(V(i(t)))};return e.apply(this,[r,t])}return new Promise((t,n)=>{e.apply(this,[function(e){t(V(i(e)))},n])}).then(n,r)}}function x(t){if(!("object"==typeof t&&t.RTCPeerConnection&&t.RTCRtpSender&&t.RTCRtpReceiver))return;if(!("getStats"in t.RTCRtpSender.prototype)){const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!0))}}if(!("getStats"in t.RTCRtpReceiver.prototype)){const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){const t=this;return this._pc.getStats().then(e=>v(e,t.track,!1))}}if(!("getStats"in t.RTCRtpSender.prototype&&"getStats"in t.RTCRtpReceiver.prototype))return;const e=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){if(arguments.length>0&&arguments[0]instanceof t.MediaStreamTrack){const t=arguments[0];let e,n,r;return this.getSenders().forEach(n=>{n.track===t&&(e?r=!0:e=n)}),this.getReceivers().forEach(e=>(e.track===t&&(n?r=!0:n=e),e.track===t)),r||e&&n?Promise.reject(new DOMException("There are more than one sender or receiver for the track.","InvalidAccessError")):e?e.getStats():n?n.getStats():Promise.reject(new DOMException("There is no sender or receiver for the track.","InvalidAccessError"))}return e.apply(this,arguments)}}function C(t){t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},Object.keys(this._shimmedLocalStreams).map(t=>this._shimmedLocalStreams[t][0])};const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addTrack=function(t,n){if(!n)return e.apply(this,arguments);this._shimmedLocalStreams=this._shimmedLocalStreams||{};const r=e.apply(this,arguments);return this._shimmedLocalStreams[n.id]?-1===this._shimmedLocalStreams[n.id].indexOf(r)&&this._shimmedLocalStreams[n.id].push(r):this._shimmedLocalStreams[n.id]=[n,r],r};const n=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(t){this._shimmedLocalStreams=this._shimmedLocalStreams||{},t.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")});const e=this.getSenders();n.apply(this,arguments);const r=this.getSenders().filter(t=>-1===e.indexOf(t));this._shimmedLocalStreams[t.id]=[t].concat(r)};const r=t.RTCPeerConnection.prototype.removeStream;t.RTCPeerConnection.prototype.removeStream=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},delete this._shimmedLocalStreams[t.id],r.apply(this,arguments)};const i=t.RTCPeerConnection.prototype.removeTrack;t.RTCPeerConnection.prototype.removeTrack=function(t){return this._shimmedLocalStreams=this._shimmedLocalStreams||{},t&&Object.keys(this._shimmedLocalStreams).forEach(e=>{const n=this._shimmedLocalStreams[e].indexOf(t);-1!==n&&this._shimmedLocalStreams[e].splice(n,1),1===this._shimmedLocalStreams[e].length&&delete this._shimmedLocalStreams[e]}),i.apply(this,arguments)}}function T(t,e){if(!t.RTCPeerConnection)return;if(t.RTCPeerConnection.prototype.addTrack&&e.version>=65)return C(t);const n=t.RTCPeerConnection.prototype.getLocalStreams;t.RTCPeerConnection.prototype.getLocalStreams=function(){const t=n.apply(this);return this._reverseStreams=this._reverseStreams||{},t.map(t=>this._reverseStreams[t.id])};const r=t.RTCPeerConnection.prototype.addStream;t.RTCPeerConnection.prototype.addStream=function(e){if(this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},e.getTracks().forEach(t=>{if(this.getSenders().find(e=>e.track===t))throw new DOMException("Track already exists.","InvalidAccessError")}),!this._reverseStreams[e.id]){const n=new t.MediaStream(e.getTracks());this._streams[e.id]=n,this._reverseStreams[n.id]=e,e=n}r.apply(this,[e])};const i=t.RTCPeerConnection.prototype.removeStream;function V(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(i.id,"g"),r.id)}),new RTCSessionDescription({type:e.type,sdp:n})}function o(t,e){let n=e.sdp;return Object.keys(t._reverseStreams||[]).forEach(e=>{const r=t._reverseStreams[e],i=t._streams[r.id];n=n.replace(new RegExp(r.id,"g"),i.id)}),new RTCSessionDescription({type:e.type,sdp:n})}t.RTCPeerConnection.prototype.removeStream=function(t){this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{},i.apply(this,[this._streams[t.id]||t]),delete this._reverseStreams[this._streams[t.id]?this._streams[t.id].id:t.id],delete this._streams[t.id]},t.RTCPeerConnection.prototype.addTrack=function(e,n){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");const r=[].slice.call(arguments,1);if(1!==r.length||!r[0].getTracks().find(t=>t===e))throw new DOMException("The adapter.js addTrack polyfill only supports a single stream which is associated with the specified track.","NotSupportedError");const i=this.getSenders().find(t=>t.track===e);if(i)throw new DOMException("Track already exists.","InvalidAccessError");this._streams=this._streams||{},this._reverseStreams=this._reverseStreams||{};const V=this._streams[n.id];if(V)V.addTrack(e),Promise.resolve().then(()=>{this.dispatchEvent(new Event("negotiationneeded"))});else{const r=new t.MediaStream([e]);this._streams[n.id]=r,this._reverseStreams[r.id]=n,this.addStream(r)}return this.getSenders().find(t=>t.track===e)},["createOffer","createAnswer"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){const t=arguments;return arguments.length&&"function"==typeof arguments[0]?n.apply(this,[e=>{const n=V(this,e);t[0].apply(null,[n])},e=>{t[1]&&t[1].apply(null,e)},arguments[2]]):n.apply(this,arguments).then(t=>V(this,t))}};t.RTCPeerConnection.prototype[e]=r[e]});const s=t.RTCPeerConnection.prototype.setLocalDescription;t.RTCPeerConnection.prototype.setLocalDescription=function(){return arguments.length&&arguments[0].type?(arguments[0]=o(this,arguments[0]),s.apply(this,arguments)):s.apply(this,arguments)};const a=Object.getOwnPropertyDescriptor(t.RTCPeerConnection.prototype,"localDescription");Object.defineProperty(t.RTCPeerConnection.prototype,"localDescription",{get(){const t=a.get.apply(this);return""===t.type?t:V(this,t)}}),t.RTCPeerConnection.prototype.removeTrack=function(t){if("closed"===this.signalingState)throw new DOMException("The RTCPeerConnection's signalingState is 'closed'.","InvalidStateError");if(!t._pc)throw new DOMException("Argument 1 of RTCPeerConnection.removeTrack does not implement interface RTCRtpSender.","TypeError");if(!(t._pc===this))throw new DOMException("Sender was not created by this connection.","InvalidAccessError");let e;this._streams=this._streams||{},Object.keys(this._streams).forEach(n=>{this._streams[n].getTracks().find(e=>t.track===e)&&(e=this._streams[n])}),e&&(1===e.getTracks().length?this.removeStream(this._reverseStreams[e.id]):e.removeTrack(t.track),this.dispatchEvent(new Event("negotiationneeded")))}}function E(t,e){!t.RTCPeerConnection&&t.webkitRTCPeerConnection&&(t.RTCPeerConnection=t.webkitRTCPeerConnection),t.RTCPeerConnection&&e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]})}function R(t,e){u(t,"negotiationneeded",t=>{const n=t.target;if(!(e.version<72||n.getConfiguration&&"plan-b"===n.getConfiguration().sdpSemantics)||"stable"===n.signalingState)return t})}function M(t,e){const n=t&&t.navigator,r=t&&t.MediaStreamTrack;if(n.getUserMedia=function(t,e,r){d("navigator.getUserMedia","navigator.mediaDevices.getUserMedia"),n.mediaDevices.getUserMedia(t).then(e,r)},!(e.version>55&&"autoGainControl"in n.mediaDevices.getSupportedConstraints())){const t=function(t,e,n){e in t&&!(n in t)&&(t[n]=t[e],delete t[e])},e=n.mediaDevices.getUserMedia.bind(n.mediaDevices);if(n.mediaDevices.getUserMedia=function(n){return"object"==typeof n&&"object"==typeof n.audio&&(n=JSON.parse(JSON.stringify(n)),t(n.audio,"autoGainControl","mozAutoGainControl"),t(n.audio,"noiseSuppression","mozNoiseSuppression")),e(n)},r&&r.prototype.getSettings){const e=r.prototype.getSettings;r.prototype.getSettings=function(){const n=e.apply(this,arguments);return t(n,"mozAutoGainControl","autoGainControl"),t(n,"mozNoiseSuppression","noiseSuppression"),n}}if(r&&r.prototype.applyConstraints){const e=r.prototype.applyConstraints;r.prototype.applyConstraints=function(n){return"audio"===this.kind&&"object"==typeof n&&(n=JSON.parse(JSON.stringify(n)),t(n,"autoGainControl","mozAutoGainControl"),t(n,"noiseSuppression","mozNoiseSuppression")),e.apply(this,[n])}}}}function O(t,e){t.navigator.mediaDevices&&"getDisplayMedia"in t.navigator.mediaDevices||t.navigator.mediaDevices&&(t.navigator.mediaDevices.getDisplayMedia=function(n){if(!n||!n.video){const t=new DOMException("getDisplayMedia without video constraints is undefined");return t.name="NotFoundError",t.code=8,Promise.reject(t)}return!0===n.video?n.video={mediaSource:e}:n.video.mediaSource=e,t.navigator.mediaDevices.getUserMedia(n)})}function P(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function k(t,e){if("object"!=typeof t||!t.RTCPeerConnection&&!t.mozRTCPeerConnection)return;!t.RTCPeerConnection&&t.mozRTCPeerConnection&&(t.RTCPeerConnection=t.mozRTCPeerConnection),e.version<53&&["setLocalDescription","setRemoteDescription","addIceCandidate"].forEach(function(e){const n=t.RTCPeerConnection.prototype[e],r={[e](){return arguments[0]=new("addIceCandidate"===e?t.RTCIceCandidate:t.RTCSessionDescription)(arguments[0]),n.apply(this,arguments)}};t.RTCPeerConnection.prototype[e]=r[e]});const n={inboundrtp:"inbound-rtp",outboundrtp:"outbound-rtp",candidatepair:"candidate-pair",localcandidate:"local-candidate",remotecandidate:"remote-candidate"},r=t.RTCPeerConnection.prototype.getStats;t.RTCPeerConnection.prototype.getStats=function(){const[t,i,V]=arguments;return r.apply(this,[t||null]).then(t=>{if(e.version<53&&!i)try{t.forEach(t=>{t.type=n[t.type]||t.type})}catch(e){if("TypeError"!==e.name)throw e;t.forEach((e,r)=>{t.set(r,Object.assign({},e,{type:n[e.type]||e.type}))})}return t}).then(i,V)}}function D(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpSender.prototype)return;const e=t.RTCPeerConnection.prototype.getSenders;e&&(t.RTCPeerConnection.prototype.getSenders=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t});const n=t.RTCPeerConnection.prototype.addTrack;n&&(t.RTCPeerConnection.prototype.addTrack=function(){const t=n.apply(this,arguments);return t._pc=this,t}),t.RTCRtpSender.prototype.getStats=function(){return this.track?this._pc.getStats(this.track):Promise.resolve(new Map)}}function I(t){if("object"!=typeof t||!t.RTCPeerConnection||!t.RTCRtpSender)return;if(t.RTCRtpSender&&"getStats"in t.RTCRtpReceiver.prototype)return;const e=t.RTCPeerConnection.prototype.getReceivers;e&&(t.RTCPeerConnection.prototype.getReceivers=function(){const t=e.apply(this,[]);return t.forEach(t=>t._pc=this),t}),u(t,"track",t=>(t.receiver._pc=t.srcElement,t)),t.RTCRtpReceiver.prototype.getStats=function(){return this._pc.getStats(this.track)}}function N(t){!t.RTCPeerConnection||"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){d("removeStream","removeTrack"),this.getSenders().forEach(e=>{e.track&&t.getTracks().includes(e.track)&&this.removeTrack(e)})})}function j(t){t.DataChannel&&!t.RTCDataChannel&&(t.RTCDataChannel=t.DataChannel)}function L(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.addTransceiver;e&&(t.RTCPeerConnection.prototype.addTransceiver=function(){this.setParametersPromises=[];const t=arguments[1],n=t&&"sendEncodings"in t;n&&t.sendEncodings.forEach(t=>{if("rid"in t){if(!/^[a-z0-9]{0,16}$/i.test(t.rid))throw new TypeError("Invalid RID value provided.")}if("scaleResolutionDownBy"in t&&!(parseFloat(t.scaleResolutionDownBy)>=1))throw new RangeError("scale_resolution_down_by must be >= 1.0");if("maxFramerate"in t&&!(parseFloat(t.maxFramerate)>=0))throw new RangeError("max_framerate must be >= 0.0")});const r=e.apply(this,arguments);if(n){const{sender:e}=r,n=e.getParameters();"encodings"in n&&(1!==n.encodings.length||0!==Object.keys(n.encodings[0]).length)||(n.encodings=t.sendEncodings,e.sendEncodings=t.sendEncodings,this.setParametersPromises.push(e.setParameters(n).then(()=>{delete e.sendEncodings}).catch(()=>{delete e.sendEncodings})))}return r})}function U(t){if("object"!=typeof t||!t.RTCRtpSender)return;const e=t.RTCRtpSender.prototype.getParameters;e&&(t.RTCRtpSender.prototype.getParameters=function(){const t=e.apply(this,arguments);return"encodings"in t||(t.encodings=[].concat(this.sendEncodings||[{}])),t})}function F(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function B(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype.createAnswer;t.RTCPeerConnection.prototype.createAnswer=function(){return this.setParametersPromises&&this.setParametersPromises.length?Promise.all(this.setParametersPromises).then(()=>e.apply(this,arguments)).finally(()=>{this.setParametersPromises=[]}):e.apply(this,arguments)}}function W(t){if("object"==typeof t&&t.RTCPeerConnection){if("getLocalStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getLocalStreams=function(){return this._localStreams||(this._localStreams=[]),this._localStreams}),!("addStream"in t.RTCPeerConnection.prototype)){const e=t.RTCPeerConnection.prototype.addTrack;t.RTCPeerConnection.prototype.addStream=function(t){this._localStreams||(this._localStreams=[]),this._localStreams.includes(t)||this._localStreams.push(t),t.getAudioTracks().forEach(n=>e.call(this,n,t)),t.getVideoTracks().forEach(n=>e.call(this,n,t))},t.RTCPeerConnection.prototype.addTrack=function(t,...n){return n&&n.forEach(t=>{this._localStreams?this._localStreams.includes(t)||this._localStreams.push(t):this._localStreams=[t]}),e.apply(this,arguments)}}"removeStream"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.removeStream=function(t){this._localStreams||(this._localStreams=[]);const e=this._localStreams.indexOf(t);if(-1===e)return;this._localStreams.splice(e,1);const n=t.getTracks();this.getSenders().forEach(t=>{n.includes(t.track)&&this.removeTrack(t)})})}}function z(t){if("object"==typeof t&&t.RTCPeerConnection&&("getRemoteStreams"in t.RTCPeerConnection.prototype||(t.RTCPeerConnection.prototype.getRemoteStreams=function(){return this._remoteStreams?this._remoteStreams:[]}),!("onaddstream"in t.RTCPeerConnection.prototype))){Object.defineProperty(t.RTCPeerConnection.prototype,"onaddstream",{get(){return this._onaddstream},set(t){this._onaddstream&&(this.removeEventListener("addstream",this._onaddstream),this.removeEventListener("track",this._onaddstreampoly)),this.addEventListener("addstream",this._onaddstream=t),this.addEventListener("track",this._onaddstreampoly=t=>{t.streams.forEach(t=>{if(this._remoteStreams||(this._remoteStreams=[]),this._remoteStreams.includes(t))return;this._remoteStreams.push(t);const e=new Event("addstream");e.stream=t,this.dispatchEvent(e)})})}});const e=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){const t=this;return this._onaddstreampoly||this.addEventListener("track",this._onaddstreampoly=function(e){e.streams.forEach(e=>{if(t._remoteStreams||(t._remoteStreams=[]),t._remoteStreams.indexOf(e)>=0)return;t._remoteStreams.push(e);const n=new Event("addstream");n.stream=e,t.dispatchEvent(n)})}),e.apply(t,arguments)}}}function q(t){if("object"!=typeof t||!t.RTCPeerConnection)return;const e=t.RTCPeerConnection.prototype,n=e.createOffer,r=e.createAnswer,i=e.setLocalDescription,V=e.setRemoteDescription,o=e.addIceCandidate;e.createOffer=function(t,e){const r=arguments.length>=2?arguments[2]:arguments[0],i=n.apply(this,[r]);return e?(i.then(t,e),Promise.resolve()):i},e.createAnswer=function(t,e){const n=arguments.length>=2?arguments[2]:arguments[0],i=r.apply(this,[n]);return e?(i.then(t,e),Promise.resolve()):i};let s=function(t,e,n){const r=i.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r};e.setLocalDescription=s,s=function(t,e,n){const r=V.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.setRemoteDescription=s,s=function(t,e,n){const r=o.apply(this,[t]);return n?(r.then(e,n),Promise.resolve()):r},e.addIceCandidate=s}function H(t){const e=t&&t.navigator;if(e.mediaDevices&&e.mediaDevices.getUserMedia){const t=e.mediaDevices,n=t.getUserMedia.bind(t);e.mediaDevices.getUserMedia=t=>n(G(t))}!e.getUserMedia&&e.mediaDevices&&e.mediaDevices.getUserMedia&&(e.getUserMedia=function(t,n,r){e.mediaDevices.getUserMedia(t).then(n,r)}.bind(e))}function G(t){return t&&void 0!==t.video?Object.assign({},t,{video:g(t.video)}):t}function Y(t){if(!t.RTCPeerConnection)return;const e=t.RTCPeerConnection;t.RTCPeerConnection=function(t,n){if(t&&t.iceServers){const e=[];for(let n=0;n<t.iceServers.length;n++){let r=t.iceServers[n];!r.hasOwnProperty("urls")&&r.hasOwnProperty("url")?(d("RTCIceServer.url","RTCIceServer.urls"),(r=JSON.parse(JSON.stringify(r))).urls=r.url,delete r.url,e.push(r)):e.push(t.iceServers[n])}t.iceServers=e}return new e(t,n)},t.RTCPeerConnection.prototype=e.prototype,"generateCertificate"in e&&Object.defineProperty(t.RTCPeerConnection,"generateCertificate",{get:()=>e.generateCertificate})}function $(t){"object"==typeof t&&t.RTCTrackEvent&&"receiver"in t.RTCTrackEvent.prototype&&!("transceiver"in t.RTCTrackEvent.prototype)&&Object.defineProperty(t.RTCTrackEvent.prototype,"transceiver",{get(){return{receiver:this.receiver}}})}function Q(t){const e=t.RTCPeerConnection.prototype.createOffer;t.RTCPeerConnection.prototype.createOffer=function(t){if(t){void 0!==t.offerToReceiveAudio&&(t.offerToReceiveAudio=!!t.offerToReceiveAudio);const e=this.getTransceivers().find(t=>"audio"===t.receiver.track.kind);!1===t.offerToReceiveAudio&&e?"sendrecv"===e.direction?e.setDirection?e.setDirection("sendonly"):e.direction="sendonly":"recvonly"===e.direction&&(e.setDirection?e.setDirection("inactive"):e.direction="inactive"):!0!==t.offerToReceiveAudio||e||this.addTransceiver("audio"),void 0!==t.offerToReceiveVideo&&(t.offerToReceiveVideo=!!t.offerToReceiveVideo);const n=this.getTransceivers().find(t=>"video"===t.receiver.track.kind);!1===t.offerToReceiveVideo&&n?"sendrecv"===n.direction?n.setDirection?n.setDirection("sendonly"):n.direction="sendonly":"recvonly"===n.direction&&(n.setDirection?n.setDirection("inactive"):n.direction="inactive"):!0!==t.offerToReceiveVideo||n||this.addTransceiver("video")}return e.apply(this,arguments)}}function X(t){"object"!=typeof t||t.AudioContext||(t.AudioContext=t.webkitAudioContext)}var Z=n(41),K=n.n(Z);function J(t){if(!t.RTCIceCandidate||t.RTCIceCandidate&&"foundation"in t.RTCIceCandidate.prototype)return;const e=t.RTCIceCandidate;t.RTCIceCandidate=function(t){if("object"==typeof t&&t.candidate&&0===t.candidate.indexOf("a=")&&((t=JSON.parse(JSON.stringify(t))).candidate=t.candidate.substr(2)),t.candidate&&t.candidate.length){const n=new e(t),r=K.a.parseCandidate(t.candidate),i=Object.assign(n,r);return i.toJSON=function(){return{candidate:i.candidate,sdpMid:i.sdpMid,sdpMLineIndex:i.sdpMLineIndex,usernameFragment:i.usernameFragment}},i}return new e(t)},t.RTCIceCandidate.prototype=e.prototype,u(t,"icecandidate",e=>(e.candidate&&Object.defineProperty(e,"candidate",{value:new t.RTCIceCandidate(e.candidate),writable:"false"}),e))}function tt(t,e){if(!t.RTCPeerConnection)return;"sctp"in t.RTCPeerConnection.prototype||Object.defineProperty(t.RTCPeerConnection.prototype,"sctp",{get(){return void 0===this._sctp?null:this._sctp}});const n=function(t){if(!t||!t.sdp)return!1;const e=K.a.splitSections(t.sdp);return e.shift(),e.some(t=>{const e=K.a.parseMLine(t);return e&&"application"===e.kind&&-1!==e.protocol.indexOf("SCTP")})},r=function(t){const e=t.sdp.match(/mozilla...THIS_IS_SDPARTA-(\d+)/);if(null===e||e.length<2)return-1;const n=parseInt(e[1],10);return n!=n?-1:n},i=function(t){let n=65536;return"firefox"===e.browser&&(n=e.version<57?-1===t?16384:2147483637:e.version<60?57===e.version?65535:65536:2147483637),n},V=function(t,n){let r=65536;"firefox"===e.browser&&57===e.version&&(r=65535);const i=K.a.matchPrefix(t.sdp,"a=max-message-size:");return i.length>0?r=parseInt(i[0].substr(19),10):"firefox"===e.browser&&-1!==n&&(r=2147483637),r},o=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(){if(this._sctp=null,"chrome"===e.browser&&e.version>=76){const{sdpSemantics:t}=this.getConfiguration();"plan-b"===t&&Object.defineProperty(this,"sctp",{get(){return void 0===this._sctp?null:this._sctp},enumerable:!0,configurable:!0})}if(n(arguments[0])){const t=r(arguments[0]),e=i(t),n=V(arguments[0],t);let o;o=0===e&&0===n?Number.POSITIVE_INFINITY:0===e||0===n?Math.max(e,n):Math.min(e,n);const s={};Object.defineProperty(s,"maxMessageSize",{get:()=>o}),this._sctp=s}return o.apply(this,arguments)}}function et(t){if(!(t.RTCPeerConnection&&"createDataChannel"in t.RTCPeerConnection.prototype))return;function e(t,e){const n=t.send;t.send=function(){const r=arguments[0],i=r.length||r.size||r.byteLength;if("open"===t.readyState&&e.sctp&&i>e.sctp.maxMessageSize)throw new TypeError("Message too large (can send a maximum of "+e.sctp.maxMessageSize+" bytes)");return n.apply(t,arguments)}}const n=t.RTCPeerConnection.prototype.createDataChannel;t.RTCPeerConnection.prototype.createDataChannel=function(){const t=n.apply(this,arguments);return e(t,this),t},u(t,"datachannel",t=>(e(t.channel,t.target),t))}function nt(t){if(!t.RTCPeerConnection||"connectionState"in t.RTCPeerConnection.prototype)return;const e=t.RTCPeerConnection.prototype;Object.defineProperty(e,"connectionState",{get(){return{completed:"connected",checking:"connecting"}[this.iceConnectionState]||this.iceConnectionState},enumerable:!0,configurable:!0}),Object.defineProperty(e,"onconnectionstatechange",{get(){return this._onconnectionstatechange||null},set(t){this._onconnectionstatechange&&(this.removeEventListener("connectionstatechange",this._onconnectionstatechange),delete this._onconnectionstatechange),t&&this.addEventListener("connectionstatechange",this._onconnectionstatechange=t)},enumerable:!0,configurable:!0}),["setLocalDescription","setRemoteDescription"].forEach(t=>{const n=e[t];e[t]=function(){return this._connectionstatechangepoly||(this._connectionstatechangepoly=t=>{const e=t.target;if(e._lastConnectionState!==e.connectionState){e._lastConnectionState=e.connectionState;const n=new Event("connectionstatechange",t);e.dispatchEvent(n)}return t},this.addEventListener("iceconnectionstatechange",this._connectionstatechangepoly)),n.apply(this,arguments)}})}function rt(t,e){if(!t.RTCPeerConnection)return;if("chrome"===e.browser&&e.version>=71)return;if("safari"===e.browser&&e.version>=605)return;const n=t.RTCPeerConnection.prototype.setRemoteDescription;t.RTCPeerConnection.prototype.setRemoteDescription=function(e){if(e&&e.sdp&&-1!==e.sdp.indexOf("\na=extmap-allow-mixed")){const n=e.sdp.split("\n").filter(t=>"a=extmap-allow-mixed"!==t.trim()).join("\n");t.RTCSessionDescription&&e instanceof t.RTCSessionDescription?arguments[0]=new t.RTCSessionDescription({type:e.type,sdp:n}):e.sdp=n}return n.apply(this,arguments)}}function it(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.addIceCandidate;n&&0!==n.length&&(t.RTCPeerConnection.prototype.addIceCandidate=function(){return arguments[0]?("chrome"===e.browser&&e.version<78||"firefox"===e.browser&&e.version<68||"safari"===e.browser)&&arguments[0]&&""===arguments[0].candidate?Promise.resolve():n.apply(this,arguments):(arguments[1]&&arguments[1].apply(null),Promise.resolve())})}function Vt(t,e){if(!t.RTCPeerConnection||!t.RTCPeerConnection.prototype)return;const n=t.RTCPeerConnection.prototype.setLocalDescription;n&&0!==n.length&&(t.RTCPeerConnection.prototype.setLocalDescription=function(){let t=arguments[0]||{};if("object"!=typeof t||t.type&&t.sdp)return n.apply(this,arguments);if(!(t={type:t.type,sdp:t.sdp}).type)switch(this.signalingState){case"stable":case"have-local-offer":case"have-remote-pranswer":t.type="offer";break;default:t.type="answer"}if(t.sdp||"offer"!==t.type&&"answer"!==t.type)return n.apply(this,[t]);const e="offer"===t.type?this.createOffer:this.createAnswer;return e.apply(this).then(t=>n.apply(this,[t]))})}const ot=function({window:t}={},e={shimChrome:!0,shimFirefox:!0,shimSafari:!0}){const n=f,s=function(t){const e={browser:null,version:null};if(void 0===t||!t.navigator)return e.browser="Not a browser.",e;const{navigator:n}=t;if(n.mozGetUserMedia)e.browser="firefox",e.version=c(n.userAgent,/Firefox\/(\d+)\./,1);else if(n.webkitGetUserMedia||!1===t.isSecureContext&&t.webkitRTCPeerConnection&&!t.RTCIceGatherer)e.browser="chrome",e.version=c(n.userAgent,/Chrom(e|ium)\/(\d+)\./,2);else{if(!t.RTCPeerConnection||!n.userAgent.match(/AppleWebKit\/(\d+)\./))return e.browser="Not a supported browser.",e;e.browser="safari",e.version=c(n.userAgent,/AppleWebKit\/(\d+)\./,1),e.supportsUnifiedPlan=t.RTCRtpTransceiver&&"currentDirection"in t.RTCRtpTransceiver.prototype}return e}(t),a={browserDetails:s,commonShim:o,extractVersion:c,disableLog:h,disableWarnings:l,sdp:Z};switch(s.browser){case"chrome":if(!r||!E||!e.shimChrome)return n("Chrome shim is not included in this adapter release."),a;if(null===s.version)return n("Chrome shim can not determine version, not shimming."),a;n("adapter.js shimming chrome."),a.browserShim=r,it(t,s),Vt(t),m(t,s),_(t),E(t,s),w(t),T(t,s),A(t),S(t),x(t),R(t,s),J(t),nt(t),tt(t,s),et(t),rt(t,s);break;case"firefox":if(!i||!k||!e.shimFirefox)return n("Firefox shim is not included in this adapter release."),a;n("adapter.js shimming firefox."),a.browserShim=i,it(t,s),Vt(t),M(t,s),k(t,s),P(t),N(t),D(t),I(t),j(t),L(t),U(t),F(t),B(t),J(t),nt(t),tt(t,s),et(t);break;case"safari":if(!V||!e.shimSafari)return n("Safari shim is not included in this adapter release."),a;n("adapter.js shimming safari."),a.browserShim=V,it(t,s),Vt(t),Y(t),Q(t),q(t),W(t),z(t),$(t),H(t),X(t),J(t),tt(t,s),et(t),rt(t,s);break;default:n("Unsupported browser!")}return a}({window:"undefined"==typeof window?void 0:window});e.default=ot},function(t,e,n){"use strict";n.r(e),console.log("BUILD/SERIOUSLY.MODULE");let r,i,V,o,s,a,c,u={},h={},l={},f={},d=[],p={},g={},v={canvas:[],image:[],video:[]},y={},m=window.WeakMap&&new WeakMap,b=0,_=function(){},w={transparent:[0,0,0,0],black:[0,0,0,1],red:[1,0,0,1],green:[0,128/255,0,1],blue:[0,0,1,1],white:[1,1,1,1],silver:[192/255,192/255,192/255,1],gray:[128/255,128/255,128/255,1],maroon:[128/255,0,0,1],purple:[128/255,0,128/255,1],fuchsia:[1,0,1,1],lime:[0,1,0,1],olive:[128/255,128/255,0,1],yellow:[1,1,0,1],navy:[0,0,128/255,1],teal:[0,128/255,128/255,1],aqua:[0,1,1,1],orange:[1,165/255,0,1]},A=/^(rgb|hsl)a?\(\s*(\d+)\s*,\s*(\d+)\s*,\s*(\d+)\s*(,\s*(\d+(\.\d*)?)\s*)?\)/i,S=/^#(([0-9a-fA-F]{3,8}))/,x=["x","y","z","w"],C=["r","g","b","a"],T={srcRGB:770,dstRGB:771,srcAlpha:1,dstAlpha:771},E=["MAX_COMBINED_TEXTURE_IMAGE_UNITS","MAX_FRAGMENT_UNIFORM_VECTORS","MAX_TEXTURE_IMAGE_UNITS","MAX_VARYING_VECTORS","MAX_VERTEX_ATTRIBS","MAX_VERTEX_TEXTURE_IMAGE_UNITS","MAX_VERTEX_UNIFORM_VECTORS"],R=/^[\t ]*#define[\t ]+SHADER_NAME\s+([^$\n\r]+)/i,M={frustum:function(t,e,n,r,i,V,o){o||(o=M.create());var s=e-t,a=r-n,c=V-i;return o[0]=2*i/s,o[1]=0,o[2]=0,o[3]=0,o[4]=0,o[5]=2*i/a,o[6]=0,o[7]=0,o[8]=(e+t)/s,o[9]=(r+n)/a,o[10]=-(V+i)/c,o[11]=-1,o[12]=0,o[13]=0,o[14]=-V*i*2/c,o[15]=0,o},perspective:function(t,e,n,r,i){var V=n*Math.tan(t*Math.PI/360),o=V*e;return M.frustum(-o,o,-V,V,n,r,i)},multiply:function(t,e,n){var r=e[0],i=e[1],V=e[2],o=e[3],s=e[4],a=e[5],c=e[6],u=e[7],h=e[8],l=e[9],f=e[10],d=e[11],p=e[12],g=e[13],v=e[14],y=e[15],m=n[0],b=n[1],_=n[2],w=n[3];return t[0]=m*r+b*s+_*h+w*p,t[1]=m*i+b*a+_*l+w*g,t[2]=m*V+b*c+_*f+w*v,t[3]=m*o+b*u+_*d+w*y,m=n[4],b=n[5],_=n[6],w=n[7],t[4]=m*r+b*s+_*h+w*p,t[5]=m*i+b*a+_*l+w*g,t[6]=m*V+b*c+_*f+w*v,t[7]=m*o+b*u+_*d+w*y,m=n[8],b=n[9],_=n[10],w=n[11],t[8]=m*r+b*s+_*h+w*p,t[9]=m*i+b*a+_*l+w*g,t[10]=m*V+b*c+_*f+w*v,t[11]=m*o+b*u+_*d+w*y,m=n[12],b=n[13],_=n[14],w=n[15],t[12]=m*r+b*s+_*h+w*p,t[13]=m*i+b*a+_*l+w*g,t[14]=m*V+b*c+_*f+w*v,t[15]=m*o+b*u+_*d+w*y,t},identity:function(t){return t[0]=1,t[1]=0,t[2]=0,t[3]=0,t[4]=0,t[5]=1,t[6]=0,t[7]=0,t[8]=0,t[9]=0,t[10]=1,t[11]=0,t[12]=0,t[13]=0,t[14]=0,t[15]=1,t},copy:function(t,e){return t[0]=e[0],t[1]=e[1],t[2]=e[2],t[3]=e[3],t[4]=e[4],t[5]=e[5],t[6]=e[6],t[7]=e[7],t[8]=e[8],t[9]=e[9],t[10]=e[10],t[11]=e[11],t[12]=e[12],t[13]=e[13],t[14]=e[14],t[15]=e[15],t}},O=(N=0,window.requestAnimationFrame||window.webkitRequestAnimationFrame||window.mozRequestAnimationFrame||window.oRequestAnimationFrame||window.msRequestAnimationFrame||function(t){var e,n,r;return e=(new Date).getTime(),n=Math.max(0,16-(e-N)),r=window.setTimeout(function(){t(e+n)},n),N=e+n,r}),P=window.cancelAnimationFrame||window.webkitCancelAnimationFrame||window.mozCancelAnimationFrame||window.oCancelAnimationFrame||window.msCancelAnimationFrame||function(t){window.cancelTimeout(t)},k=["alias","destroy","effect","id","initialize","inputs","isDestroyed","isReady","matte","off","on","readPixels","render","title","update"],D=["alias","destroy","id","inputs","isDestroyed","isReady","off","on","source","title","update"],I=["aliases","defaults","destroy","effect","go","id","incompatible","isDestroyed","isEffect","isNode","isSource","isTarget","isTransform","removeAlias","render","source","stop","target","transform"];var N;function j(t,e){var n,r;if("string"==typeof t)n=document.querySelector(t);else if(!t)return!1;return t.tagName&&(n=t),n?(r=n.tagName.toLowerCase(),e&&e.indexOf(r)<0?t:n):t}function L(t,e){var n,r;for(n in t.prototype&&e.prototype&&t.prototype!==e.prototype&&L(t.prototype,e.prototype),e)e.hasOwnProperty(n)&&((r=Object.getOwnPropertyDescriptor(e,n)).get||r.set?Object.defineProperty(t,n,{configurable:!0,enumerable:!0,get:r.get,set:r.set}):t[n]=e[n]);return t}function U(t){var e;if(!console)return _;if("function"==typeof console[t])e=console[t];else{if("function"!=typeof console.log)return _;e=console.log}return e.bind?e.bind(console):function(){e.apply(console,arguments)}}function F(t,e){if(e||(e="HTMLElement"),t instanceof window[e])return!0;if(!t||"object"!=typeof t)return!1;for(;t;)if((t=Object.getPrototypeOf(t))&&t.constructor.name===e)return!0;return!1}function B(t,e,n,r,i){function V(t,e,n){return(n%=1)<0&&(n+=1),n<1/6?t+(e-t)*n*6:n<.5?e:n<2/3?t+(e-t)*(2/3-n)*6:t}var o,s;return o=2*n-(s=n<.5?n*(e+1):n+e-n*e),i||(i=[]),i[0]=V(o,s,t+1/3),i[1]=V(o,s,t),i[2]=V(o,s,t-1/3),i[3]=r,i}function W(t){var e,n,r,i="#",V=t[3]<1?4:3;for(e=0;e<V;e++)r=(n=Math.min(255,Math.round(255*t[e]||0))).toString(16),n<16&&(r="0"+r),i+=r;return i}function z(t){return Array.isArray(t)||t&&t.BYTES_PER_ELEMENT&&"length"in t}function q(t){if("function"!=typeof t)throw new Error("setTimeoutZero argument is not a function");d.push(t),"file:"!==window.location.protocol?window.postMessage("seriously-timeout-message",window.location):setTimeout(function(){d.length&&d.shift()()},0)}function H(t,e){var n;try{n=window.WebGLDebugUtils&&e&&e.debugContext?window.WebGLDebugUtils.makeDebugContext(t.getContext("webgl",e)):t.getContext("webgl",e)}catch(t){}if(!n)try{n=t.getContext("experimental-webgl",e)}catch(t){}return n}function G(){var t;return r&&r.getError()===r.CONTEXT_LOST_WEBGL&&(r=void 0),r||!window.WebGLRenderingContext||V?r:(t=document.createElement("canvas"),(r=H(t))?t.addEventListener("webglcontextlost",function e(n){n.preventDefault(),r&&r.canvas===this&&(r=void 0,t.removeEventListener("webglcontextlost",e,!1))},!1):X.logger.warn("Unable to access WebGL."),r)}function Y(t){var e,n,r;function i(t,r){var i,V;z(t)?(i=t[0],V=t[1]||i):i=t,"string"==typeof i?i=i.toLowerCase():"number"==typeof i?i=String(i):i||(i=""),n[i]=V,r||(e.firstValue=i)}function V(t){return t}for(r in t.inputs)if(t.inputs.hasOwnProperty(r)){if(t.reserved.indexOf(r)>=0||Object.prototype[r])throw new Error("Reserved input name: "+r);(e=t.inputs[r]).name=r,isNaN(e.min)&&(e.min=-1/0),isNaN(e.max)&&(e.max=1/0),isNaN(e.minCount)&&(e.minCount=-1/0),isNaN(e.maxCount)&&(e.maxCount=1/0),isNaN(e.step)&&(e.step=0),isNaN(e.mod)&&(e.mod=0),"enum"===e.type&&e.options&&z(e.options)&&e.options.length&&(n={},e.options.forEach(i),e.options=n),"vector"===e.type?e.dimensions<2?e.dimensions=2:e.dimensions>4?e.dimensions=4:!e.dimensions||isNaN(e.dimensions)?e.dimensions=4:e.dimensions=Math.round(e.dimensions):e.dimensions=1,e.shaderDirty=!!e.shaderDirty,"function"!=typeof e.validate&&(e.validate=X.inputValidators[e.type]||V),t.defaultImageInput||"image"!==e.type||(t.defaultImageInput=r)}}function $(t,e,n,r){var i,V,o,s;!0===r||r&&r.useFloat;this.type=t.UNSIGNED_BYTE,i=t.createFramebuffer(),t.bindFramebuffer(t.FRAMEBUFFER,i),r&&r.texture?(this.texture=r.texture,t.bindTexture(t.TEXTURE_2D,this.texture),this.ownTexture=!1):(this.texture=t.createTexture(),t.bindTexture(t.TEXTURE_2D,this.texture),t.pixelStorei(t.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MAG_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_MIN_FILTER,t.LINEAR),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_S,t.CLAMP_TO_EDGE),t.texParameteri(t.TEXTURE_2D,t.TEXTURE_WRAP_T,t.CLAMP_TO_EDGE),this.ownTexture=!0);try{this.type===t.FLOAT?(o=new Float32Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.FLOAT,o)):(t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,null),this.type=t.UNSIGNED_BYTE)}catch(r){this.type=t.UNSIGNED_BYTE,o=new Uint8Array(e*n*4),t.texImage2D(t.TEXTURE_2D,0,t.RGBA,e,n,0,t.RGBA,t.UNSIGNED_BYTE,o)}if(V=t.createRenderbuffer(),t.bindRenderbuffer(t.RENDERBUFFER,V),t.renderbufferStorage(t.RENDERBUFFER,t.DEPTH_COMPONENT16,e,n),t.framebufferRenderbuffer(t.FRAMEBUFFER,t.DEPTH_ATTACHMENT,t.RENDERBUFFER,V),t.framebufferTexture2D(t.FRAMEBUFFER,t.COLOR_ATTACHMENT0,t.TEXTURE_2D,this.texture,0),(s=t.checkFramebufferStatus(t.FRAMEBUFFER))===t.FRAMEBUFFER_INCOMPLETE_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT");if(s===t.FRAMEBUFFER_INCOMPLETE_DIMENSIONS)throw new Error("Incomplete framebuffer: FRAMEBUFFER_INCOMPLETE_DIMENSIONS");if(s===t.FRAMEBUFFER_UNSUPPORTED)throw new Error("Incomplete framebuffer: FRAMEBUFFER_UNSUPPORTED");if(s!==t.FRAMEBUFFER_COMPLETE)throw new Error("Incomplete framebuffer: "+s);t.bindTexture(t.TEXTURE_2D,null),t.bindRenderbuffer(t.RENDERBUFFER,null),t.bindFramebuffer(t.FRAMEBUFFER,null),this.gl=t,this.frameBuffer=i,this.renderBuffer=V,this.width=e,this.height=n}function Q(t,e,n){var r,i,V,o,s,a,c,u,h="";function l(e,n){var r,i;if(r=n?t.createShader(t.FRAGMENT_SHADER):t.createShader(t.VERTEX_SHADER),t.shaderSource(r,e),t.compileShader(r),!t.getShaderParameter(r,t.COMPILE_STATUS)){for(e=e.split(/[\n\r]/),i=0;i<e.length;i++)e[i]=i+1+":\t"+e[i];throw e.unshift("Error compiling "+(n?"fragment":"vertex")+" shader:"),X.logger.error(e.join("\n")),new Error("Shader error: "+t.getShaderInfoLog(r))}return r}function f(e,n){if(e.type===t.SAMPLER_2D)return function(r){e.glTexture=t["TEXTURE"+r],t.uniform1i(n,r)};if(e.type===t.BOOL||e.type===t.INT)return e.size>1?function(e){t.uniform1iv(n,e)}:function(e){t.uniform1i(n,e)};if(e.type===t.FLOAT)return e.size>1?function(e){t.uniform1fv(n,e)}:function(e){t.uniform1f(n,e)};if(e.type===t.FLOAT_VEC2)return function(e){t.uniform2f(n,e[0],e[1])};if(e.type===t.FLOAT_VEC3)return function(e){t.uniform3f(n,e[0],e[1],e[2])};if(e.type===t.FLOAT_VEC4)return function(e){t.uniform4f(n,e[0],e[1],e[2],e[3])};if(e.type===t.FLOAT_MAT3)return function(e){t.uniformMatrix3fv(n,!1,e)};if(e.type===t.FLOAT_MAT4)return function(e){t.uniformMatrix4fv(n,!1,e)};throw new Error("Unknown shader uniform type: "+e.type)}function d(e){return function(){return t.getUniform(r,e)}}if(i=l(e),V=l(n,!0),r=t.createProgram(),t.attachShader(r,i),(o=t.getShaderInfoLog(i))&&(h+="Vertex shader error: "+o+"\n"),t.attachShader(r,V),(o=t.getShaderInfoLog(V))&&(h+="Fragment shader error: "+o+"\n"),t.linkProgram(r),!t.getProgramParameter(r,t.LINK_STATUS))throw h+=t.getProgramInfoLog(r),t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V),(c=R.exec(e)||R.exec(n))&&(h="Shader = "+c[1]+"\n"+h),E.forEach(function(e){h+="\n"+e+": "+t.getParameter(t[e])}),new Error("Could not initialize shader:\n"+h);for(t.useProgram(r),this.uniforms={},a=t.getProgramParameter(r,t.ACTIVE_UNIFORMS),s=0;s<a;++s)(u={info:t.getActiveUniform(r,s)}).name=u.info.name.replace(/\[0\]$/,""),u.loc=t.getUniformLocation(r,u.name),u.set=f(u.info,u.loc),u.get=d(u.loc),this.uniforms[u.name]=u,this[u.name]||(this[u.name]=u);for(this.attributes={},this.location={},a=t.getProgramParameter(r,t.ACTIVE_ATTRIBUTES),s=0;s<a;++s)(u={info:t.getActiveAttrib(r,s)}).name=u.info.name,u.location=t.getAttribLocation(r,u.name),this.attributes[u.name]=u,this.location[u.name]=u.location;this.gl=t,this.program=r,this.destroy=function(){var e;for(e in t&&(t.deleteProgram(r),t.deleteShader(i),t.deleteShader(V)),this)this.hasOwnProperty(e)&&delete this[e];r=null,i=null,V=null}}function X(t){if(window===this||!(this instanceof X)||void 0!==this.id)return new X(t);var e,n,r,i,V,s,d,y,w,A,S,x,C,E,k,D=++b,N=this,U=[],B={},z=0,G=[],Z=[],K=[],J=[],tt={},et=[],nt=[],rt={},it={},Vt=!1,ot=!1;function st(t,e){var n,r,i;return!!e&&(n=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,n),e.bufferData(e.ARRAY_BUFFER,t.vertices,e.STATIC_DRAW),n.size=3,r=e.createBuffer(),e.bindBuffer(e.ELEMENT_ARRAY_BUFFER,r),e.bufferData(e.ELEMENT_ARRAY_BUFFER,t.indices,e.STATIC_DRAW),i=e.createBuffer(),e.bindBuffer(e.ARRAY_BUFFER,i),e.bufferData(e.ARRAY_BUFFER,t.coords,e.STATIC_DRAW),i.size=2,{vertex:n,index:r,texCoord:i,length:t.indices.length,mode:t.mode||e.TRIANGLES})}function at(t){var e={};return e.vertices=new Float32Array([-1,-1,0,1,-1,0,1,1,0,-1,1,0]),e.indices=new Uint16Array([0,1,2,0,2,3]),e.coords=new Float32Array([0,0,1,0,1,1,0,1]),st(e,t)}function ct(t){var r,o;if(!n)if(t.canvas.addEventListener("webglcontextlost",ht,!1),t.canvas.addEventListener("webglcontextrestored",ut,!1),t.isContextLost())X.logger.warn("Unable to attach lost WebGL context. Will try again when context is restored.");else{for(n=t,e=t.canvas,i=at(n),V=new Q(n,"#define SHADER_NAME seriously.base\n"+a,"#define SHADER_NAME seriously.base\n"+c),r=0;r<J.length;r++)(o=J[r]).gl=n,o.initialize(),o.buildShader();for(r=0;r<G.length;r++)(o=G[r]).initialize();for(r=0;r<Z.length;r++)(o=Z[r]).model||(o.model=i,o.shader=V)}}function ut(){var t,e,i,V;if(r&&!n){if(F(e=r.target,"WebGLFramebuffer"))return void X.logger.error("Unable to restore target built on WebGLFramebuffer");if(t=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:r.debugContext})){if(t.isContextLost())return void X.logger.error("Unable to restore WebGL Context");for(ct(t),r.renderToTexture?r.frameBuffer=new $(n,r.width,r.height,!1):r.frameBuffer={frameBuffer:null},i=0;i<U.length;i++)(V=U[i]).setDirty(),V.emit("webglcontextrestored");X.logger.log("WebGL context restored")}}}function ht(t){var r,o;for(t&&(X.logger.warn("WebGL context lost"),t.preventDefault()),k&&(P(k),k=0),e&&e.removeEventListener("webglcontextlost",ht,!1),r=0;r<J.length;r++)(o=J[r]).gl=null,o.initialized=!1,o.baseShader=null,o.model=null,o.frameBuffer=null,o.texture=null,o.shader&&o.shader.destroy&&(o.shader.destroy(),o.effect.commonShader&&delete it[o.hook]),o.shaderDirty=!0,o.shader=null,o.effect.lostContext&&o.effect.lostContext.call(o),t&&o.emit("webglcontextlost");for(r=0;r<G.length;r++)(o=G[r]).texture=null,o.initialized=!1,o.allowRefresh=!1,t&&o.emit("webglcontextlost");for(r=0;r<K.length;r++)(o=K[r]).frameBuffer=null,o.texture=null,t&&o.emit("webglcontextlost");for(r=0;r<Z.length;r++)(o=Z[r]).model=!1,o.frameBuffer=null,t&&o.emit("webglcontextlost");V&&V.destroy&&V.destroy(),n&&(n.deleteBuffer(i.vertex),n.deleteBuffer(i.texCoord),n.deleteBuffer(i.index)),i&&(delete i.vertex,delete i.texCoord,delete i.index),i=null,V=null,n=null,e=null}function lt(t){var e,n,r=!1;if(k=0,et.length)for(r=!0,e=0;e<et.length;e++)et[e].call(N,t);if(G&&G.length)for(r=!0,e=0;e<G.length;e++)((n=G[e]).dirty||n.checkDirty&&n.checkDirty())&&(n.dirty=!1,n.setDirty());for(e=0;e<Z.length;e++)(n=Z[e]).auto&&n.dirty&&n.render();if(nt.length)for(r=!0,e=0;e<nt.length;e++)nt[e].call(N);r&&!k&&(k=O(lt))}function ft(t,e,r,i,V,o){var s,a,c,u,h,l,f,p,g,v=0,m=V&&V.gl||n;if(m){for(s in V?(u=o&&o.width||V.width||m.canvas.width,h=o&&o.height||V.height||m.canvas.height):(u=o&&o.width||m.canvas.width,h=o&&o.height||m.canvas.height),t.use(),m.viewport(0,0,u,h),m.bindFramebuffer(m.FRAMEBUFFER,i),m.enableVertexAttribArray(t.location.position),m.enableVertexAttribArray(t.location.texCoord),e.texCoord&&(m.bindBuffer(m.ARRAY_BUFFER,e.texCoord),m.vertexAttribPointer(t.location.texCoord,e.texCoord.size,m.FLOAT,!1,0,0)),m.bindBuffer(m.ARRAY_BUFFER,e.vertex),m.vertexAttribPointer(t.location.position,e.vertex.size,m.FLOAT,!1,0,0),m.bindBuffer(m.ELEMENT_ARRAY_BUFFER,e.index),o&&o.depth?n.enable(n.DEPTH_TEST):n.disable(n.DEPTH_TEST),o?void 0===o.blend||o.blend?(n.enable(n.BLEND),l=void 0===o.srcRGB?n.ONE:o.srcRGB,p=o.dstRGB||n.ZERO,f=void 0===o.srcAlpha?l:o.srcAlpha,g=void 0===o.dstAlpha?p:o.dstAlpha,n.blendFuncSeparate(l,p,f,g),n.blendEquation(o.blendEquation||n.FUNC_ADD)):n.disable(n.BLEND):(n.enable(n.BLEND),n.blendFunc(n.ONE,n.ZERO),n.blendEquation(n.FUNC_ADD)),r)r.hasOwnProperty(s)&&(a=r[s],(c=t.uniforms[s])&&(F(a,"WebGLTexture")?(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a),c.set(v),v++):a instanceof d||a instanceof y||a instanceof w?a.texture&&(m.activeTexture(m.TEXTURE0+v),m.bindTexture(m.TEXTURE_2D,a.texture),c.set(v),v++):null!=a&&c.set(a)));o&&void 0!==o.clear&&!o.clear||(m.clearColor(0,0,0,0),m.clear(m.COLOR_BUFFER_BIT|m.DEPTH_BUFFER_BIT)),m.drawElements(e.mode,e.length,m.UNSIGNED_SHORT,0),n.enable(n.DEPTH_TEST)}}function dt(t,e,n){var r,i;if(("string"!=typeof t||!e&&0!==e)&&(n&&"object"==typeof n||(n=e),e=t),"string"==typeof t&&l[t]||(t=null),e instanceof d||e instanceof y||e instanceof w)r=e;else if(e instanceof S||e instanceof x||e instanceof C){if(!(r=B[e.id]))throw new Error("Cannot connect a foreign node")}else{for("string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),i=0;i<G.length;i++)if(r=G[i],(!t||t===r.hook)&&r.compare&&r.compare(e,n))return r;r=new d(t,e,n)}return r}function pt(t,e){var n,r,i;if(!(t instanceof y||t instanceof w))return!1;if(t===e)return!0;for(n in i=t.sources)if(i.hasOwnProperty(n)&&((r=i[n])===e||pt(r,e)))return!0;return!1}(s=function(){this.ready=!1,this.width=1,this.height=1,this.gl=n,this.uniforms={resolution:[this.width,this.height],transform:null},this.dirty=!0,this.isDestroyed=!1,this.seriously=N,this.listeners={},this.id=z,z++}).prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},s.prototype.setUnready=function(){var t;if(this.ready&&(this.ready=!1,this.emit("unready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setUnready()},s.prototype.setDirty=function(){var t;if(!this.dirty&&(this.emit("dirty"),this.dirty=!0,this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setDirty()},s.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,t))},s.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.frameBuffer||(this.initFrameBuffer(),this.setDirty()),this.render(),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},s.prototype.resize=function(){var t,e;this.source?(t=this.source.width,e=this.source.height):this.sources&&this.sources.source?(t=this.sources.source.width,e=this.sources.source.height):this.inputs&&this.inputs.width?(t=this.inputs.width,e=this.inputs.height||t):this.inputs&&this.inputs.height?t=e=this.inputs.height:(t=1,e=1),t=Math.floor(t),e=Math.floor(e),this.width===t&&this.height===e||(this.width=t,this.height=e,this.emit("resize"),this.setDirty()),this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=t,this.uniforms.resolution[1]=e),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(t,e)},s.prototype.on=function(t,e){var n,r=-1;t&&"function"==typeof e&&((n=this.listeners[t])?r=n.indexOf(e):n=this.listeners[t]=[],r<0&&n.push(e))},s.prototype.off=function(t,e){var n,r=-1;t&&"function"==typeof e&&(n=this.listeners[t])&&(r=n.indexOf(e))>=0&&n.splice(r,1)},s.prototype.emit=function(t){var e,n=this.listeners[t];if(n&&n.length)for(e=0;e<n.length;e++)q(n[e])},s.prototype.destroy=function(){var t,e;for(e in delete this.gl,delete this.seriously,this.listeners)this.listeners.hasOwnProperty(e)&&delete this.listeners[e];for(t in this.uniforms)this.uniforms.hasOwnProperty(t)&&delete this.uniforms[t];this.targets&&delete this.targets,this.frameBuffer&&this.frameBuffer.destroy&&(this.frameBuffer.destroy(),delete this.frameBuffer),(t=U.indexOf(this))>=0&&U.splice(t,1),delete B[this.id],this.isDestroyed=!0},S=function(t){var e,n=t;function r(t,e){var r,i,V;return V=n.effect.inputs[t],r=n.inputElements[t],"string"==typeof e&&isNaN(e)&&("enum"===V.type?V.options.hasOwnProperty(e)||(e=j(e,["select"])):"number"===V.type||"boolean"===V.type?e=j(e,["input","select"]):"image"===V.type&&(e=j(e,["canvas","img","video"]))),F(e,"HTMLInputElement")||F(e,"HTMLSelectElement")?(i=e.value,r&&r.element!==e&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t],r=null),r||(r={element:e,listener:function(t,r){return function(){var i,o;i="checkbox"===e.type?e.checked:r.value,o=n.setInput(t,i),"color"===V.type&&(o=W(o).substr(0,7)),o!==i&&(r.value=o)}}(t,e)},n.inputElements[t]=r,"range"===e.type?(e.addEventListener("input",r.listener,!0),e.addEventListener("change",r.listener,!0)):e.addEventListener("change",r.listener,!0)),r&&"checkbox"===e.type&&(i=e.checked)):(r&&(r.element.removeEventListener("change",r.listener,!0),r.element.removeEventListener("input",r.listener,!0),delete n.inputElements[t]),i=e),n.setInput(t,i),n.inputs[t]}function i(t){return function(e){var n=r(t,e);return n&&n.pub}}function V(t){return function(){var e=n.inputs[t];return e&&e.pub}}function o(t){return function(e){return r(t,e)}}function s(t){return function(){return n.inputs[t]}}for(e in n.effect.inputs)if(n.effect.inputs.hasOwnProperty(e)){if(void 0!==this[e])throw new Error("Cannot overwrite Seriously."+e);"image"===n.effect.inputs[e].type?Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:V(e),set:i(e)}):Object.defineProperty(this,e,{configurable:!0,enumerable:!0,get:s(e),set:o(e)})}Object.defineProperties(this,{effect:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.effect.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}}}),this.render=function(){return n.render(),this},this.readPixels=function(t,e,r,i,V){return n.readPixels(t,e,r,i,V)},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.inputs=function(t){var e,r,i,V;if(i=n.effect.inputs,t)return(r=i[t])?(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e):null;for(V in e={},i)i.hasOwnProperty(V)&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.matte=function(t){n.matte(t)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(y=function(t,e){var r,i,V,a,c={};for(r in s.call(this,e),this.gl=n,this.effectRef=u[t],this.sources={},this.targets=[],this.inputElements={},this.dirty=!0,this.shaderDirty=!0,this.hook=t,this.options=e,this.transform=null,this.effect=L({},this.effectRef),this.effectRef.definition&&L(this.effect,this.effectRef.definition.call(this,e)),Y(this.effect),this.uniforms.transform=o,this.inputs={},a=rt[t],this.effect.inputs)this.effect.inputs.hasOwnProperty(r)&&(void 0!==(i=this.effect.inputs[r]).defaultValue&&null!==i.defaultValue||("number"===i.type?i.defaultValue=Math.min(Math.max(0,i.min),i.max):"color"===i.type?i.defaultValue=[0,0,0,0]:"boolean"===i.type?i.defaultValue=!1:"string"===i.type?i.defaultValue="":"enum"===i.type&&(i.defaultValue=i.firstValue)),V=i.validate.call(this,i.defaultValue,i),a&&void 0!==a[r]&&(V=i.validate.call(this,a[r],i,i.defaultValue,V),a[r]=V,"image"===i.type&&(c[r]=V)),this.inputs[r]=V,i.uniform&&(this.uniforms[i.uniform]=i.defaultValue));for(r in n&&(this.initialize(),this.effect.commonShader&&this.buildShader()),this.updateReady(),this.inPlace=this.effect.inPlace,this.pub=new S(this),U.push(this),B[this.id]=this,J.push(this),p[t].push(this),c)c.hasOwnProperty(r)&&this.setInput(r,c[r])}).prototype=Object.create(s.prototype),y.prototype.constructor=y,y.prototype.initialize=function(){if(!this.initialized){var t=this;this.baseShader=V,this.shape?this.model=st(this.shape,this.gl):this.model=i,"function"==typeof this.effect.initialize?this.effect.initialize.call(this,function(){t.initFrameBuffer(!0)},n):this.initFrameBuffer(!0),this.frameBuffer&&(this.texture=this.frameBuffer.texture),this.initialized=!0}},y.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.effect.resize&&this.effect.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize()},y.prototype.updateReady=function(){var t,e,n,r,i=!0;for(e in(n=this.effect).inputs)if(n.inputs.hasOwnProperty(e)&&"image"===this.effect.inputs[e].type&&(!this.sources[e]||!this.sources[e].ready)&&(!n.requires||n.requires.call(this,e,this.inputs))){i=!1;break}if(this.ready!==i&&(this.ready=i,this.emit(i?"ready":"unready"),r=i?"setReady":"setUnready",this.targets))for(t=0;t<this.targets.length;t++)this.targets[t][r]()},y.prototype.setReady=y.prototype.updateReady,y.prototype.setUnready=y.prototype.updateReady,y.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},y.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},y.prototype.removeSource=function(t){var e,n=t&&t.pub;for(e in this.inputs)!this.inputs.hasOwnProperty(e)||this.inputs[e]!==t&&this.inputs[e]!==n||(this.inputs[e]=null);for(e in this.sources)!this.sources.hasOwnProperty(e)||this.sources[e]!==t&&this.sources[e]!==n||(this.sources[e]=null)},y.prototype.buildShader=function(){var t,e=this.effect,r=this;function i(t){return R.test(t)?t:"#define SHADER_NAME seriously."+r.hook+"\n"+t}this.shaderDirty&&(e.commonShader&&it[this.hook]?(this.shader||it[this.hook].count++,this.shader=it[this.hook].shader):e.shader?(this.shader&&!e.commonShader&&this.shader.destroy(),(t=e.shader.call(this,this.inputs,{vertex:a,fragment:c},X.util))instanceof Q?this.shader=t:t&&t.vertex&&t.fragment?this.shader=new Q(n,i(t.vertex),i(t.fragment)):this.shader=V,e.commonShader&&(it[this.hook]={count:1,shader:this.shader})):this.shader=V,this.shaderDirty=!1)},y.prototype.render=function(){var t,e,r,i=this.effect,V=this;if(n){if(this.initialized||this.initialize(),this.shaderDirty&&this.buildShader(),this.dirty&&this.ready){for(t in this.sources)!this.sources.hasOwnProperty(t)||i.requires&&!i.requires.call(this,t,this.inputs)||(r="function"==typeof this.inPlace?this.inPlace(t):this.inPlace,this.sources[t].render(!r));this.frameBuffer&&(e=this.frameBuffer.frameBuffer),"function"==typeof i.draw?(i.draw.call(this,this.shader,this.model,this.uniforms,e,function(t,e,n,r,i,o){ft(t,e,n,r,i||V,o)}),this.emit("render")):e&&(ft(this.shader,this.model,this.uniforms,e,this),this.emit("render")),this.dirty=!1}return this.texture}},y.prototype.setInput=function(t,e){var n,r,i,V,s,a=this;if(this.effect.inputs.hasOwnProperty(t)){if("image"===(n=this.effect.inputs[t]).type){if(e){if((e=dt(e))!==this.sources[t]){if(function(){var e,n=a.sources[t];if(n){for(e in a.sources)if(e!==t&&a.sources.hasOwnProperty(e)&&a.sources[e]===n)return;n.removeTarget(a)}}(),pt(e,this))throw new Error("Attempt to make cyclical connection.");this.sources[t]=e,e.addTarget(this)}}else delete this.sources[t],e=!1;r=this.sources[t],i=Object.keys(this.sources),!0===this.inPlace&&1===i.length?(V=this.sources[i[0]],this.uniforms.transform=V&&V.cumulativeMatrix||o):this.uniforms.transform=o}else s=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,r=e=n.validate.call(this,e,n,s,this.inputs[t]);return this.inputs[t]===e&&"color"!==n.type&&"vector"!==n.type?e:(this.inputs[t]=e,n.uniform&&(this.uniforms[n.uniform]=r),"image"===n.type?(this.resize(),this.updateReady()):n.updateSources&&this.updateReady(),n.shaderDirty&&(this.shaderDirty=!0),this.setDirty(),n.update&&n.update.call(this,e),e)}},y.prototype.alias=function(t,e){var n=this;if(I.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.effect.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),tt[e]={node:this,input:t},Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return n.inputs[t]},set:function(e){return n.setInput(t,e)}})),this},y.prototype.matte=function(t){var e,n,r,i,V,o,s,a=[],c=[],u={};function h(t){var e,n,r,i,V,o,s,u,h,l,f,d=[];if(!t.simple){for(e=0;e<t.edges.length;e++)for(r=t.edges[e],n=e+1;n<t.edges.length;n++)i=t.edges[n],p=r[0],g=r[1],v=i[0],y=i[1],m=void 0,b=void 0,_=void 0,w=void 0,A=void 0,m=(y.x-v.x)*(p.y-v.y)-(y.y-v.y)*(p.x-v.x),b=(g.x-p.x)*(p.y-v.y)-(g.y-p.y)*(p.x-v.x),(V=!!((_=(y.y-v.y)*(g.x-p.x)-(y.x-v.x)*(g.y-p.y))&&(A=b/_,(w=m/_)>0&&w<=1&&A>0&&A<=1))&&{x:p.x+w*(g.x-p.x),y:p.y+w*(g.y-p.y)})&&(V.edge1=r,V.edge2=i,d.push(V));var p,g,v,y,m,b,_,w,A;if(d.length){for(h=[],e=0;e<d.length;e++)r=(V=d[e]).edge1,i=V.edge2,l={x:V.x,y:V.y,prev:r[0],next:i[1],id:c.length},t.vertices.push(l),c.push(l),f={x:V.x,y:V.y,prev:i[0],next:r[1],id:c.length},t.vertices.push(f),c.push(l),l.prev.next=l,l.next.prev=l,f.prev.next=f,f.next.prev=f;do{o={edges:[],vertices:[],simple:!0},h.push(o),s=u=t.vertices[0];do{e=t.vertices.indexOf(u),t.vertices.splice(e,1),o.edges.push([u,u.next]),o.vertices.push(u),u=u.next}while(u!==s)}while(t.vertices.length);for(e=a.indexOf(t),a.splice(e,1),e=0;e<h.length;e++)a.push(h[e])}else t.simple=!0}}function l(t){var e,n,r,i,V=t.vertices.length,o=0;for(e=V-1,n=0;n<V;e=n,n++)r=t.vertices[e],i=t.vertices[n],o+=r.x*i.y-i.x*r.y;return o>0}function f(t){var e,r,i,V,o,s,a,c,u,h,l,f=t.vertices,d=[],p=[];function g(t,e,n,r){var i,V,o,s,a,c,u,h,l,f,d,p;return i=n.x-e.x,V=n.y-e.y,o=t.x-n.x,s=t.y-n.y,a=e.x-t.x,c=e.y-t.y,u=r.x-t.x,h=r.y-t.y,l=r.x-e.x,f=r.y-e.y,d=r.x-n.x,p=r.y-n.y,i*f-V*l>=0&&o*p-s*d>=0&&a*h-c*u>=0}function v(t,e,n,r,i){var V,o,s,a;if(o=f[i[t]],s=f[i[e]],a=f[i[n]],0>(s.x-o.x)*(a.y-o.y)-(s.y-o.y)*(a.x-o.x))return!1;for(V=0;V<r;V++)if(V!==t&&V!==e&&V!==n&&g(o,s,a,f[i[V]]))return!1;return!0}if(r=f.length,t.clockWise)for(e=0;e<r;e++)d[e]=e;else for(e=0;e<r;e++)d[e]=r-1-e;for(V=2*(i=r),e=i-1;i>2;){if(V--<=0)return p;if(i<=(o=e)&&(o=0),i<=(e=o+1)&&(e=0),i<(s=e+1)&&(s=0),v(o,e,s,i,d)){for(a=d[o],c=d[e],u=d[s],t.clockWise?(p.push(f[a]),p.push(f[c]),p.push(f[u])):(p.push(f[u]),p.push(f[c]),p.push(f[a])),h=e,l=e+1;l<i;h++,l++)d[h]=d[l];V=2*--i}}n.indices=p}for(e=function(t){return t&&t.length&&Array.isArray(t)?Array.isArray(t[0])?Array.isArray(t[0])&&!isNaN(t[0][0])?[t]:t:[t]:[]}(t),r=0;r<e.length;r++){for(t=e[r],s=null,n={vertices:[],edges:[]},i=0;i<t.length;i++)"object"!=typeof(V=t[i])||isNaN(V.x)||isNaN(V.y)?V.length>=2&&!isNaN(V[0])&&!isNaN(V[1])&&(o={x:V[0],y:V[1],id:c.length}):o={x:V.x,y:V.y,id:c.length},o&&(s?(s.next=o,o.prev=s,o.next=n.vertices[0],n.vertices[0].prev=o):(n.head=o,o.next=o,o.prev=o),c.push(o),n.vertices.push(o),s=o);if(n.vertices.length>2)for(3===n.vertices.length&&(n.simple=!0),a.push(n),i=0;i<n.vertices.length;i++)o=n.vertices[i],n.edges.push([o,o.next])}for(r=a.length-1;r>=0;r--)h(n=a[r]);for(r=0;r<a.length;r++)(n=a[r]).clockWise=l(n),f(n);for(u.vertices=[],u.coords=[],r=0;r<c.length;r++)V=c[r],u.vertices.push(2*V.x-1),u.vertices.push(-2*V.y+1),u.vertices.push(-1),u.coords.push(V.x),u.coords.push(-1*V.y+1);for(u.vertices=new Float32Array(u.vertices),u.coords=new Float32Array(u.coords),u.indices=[],r=0;r<a.length;r++)for(n=a[r],i=0;i<n.indices.length;i++)V=n.indices[i],u.indices.push(V.id);u.indices=new Uint16Array(u.indices),this.shape=u,this.gl&&st(u,this.gl)},y.prototype.destroy=function(){var t,e,n,r=this.hook;for(e in this.effect.destroy&&"function"==typeof this.effect.destroy&&this.effect.destroy.call(this),delete this.effect,it[r]&&(it[r].count--,it[r].count||delete it[r]),this.shader&&this.shader.destroy&&this.shader!==V&&!it[r]&&this.shader.destroy(),delete this.shader,this.inputElements)this.inputElements.hasOwnProperty(e)&&((n=this.inputElements[e]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(e in this.sources)this.sources.hasOwnProperty(e)&&((n=this.sources[e])&&n.removeTarget&&n.removeTarget(this),delete this.sources[e]);for(;this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=J.indexOf(this))>=0&&J.splice(t,1),(t=p[r].indexOf(this))>=0&&p[r].splice(t,1),s.prototype.destroy.call(this)},x=function(t){var e=t;Object.defineProperties(this,{original:{enumerable:!0,configurable:!0,get:function(){return e.source}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}},width:{enumerable:!0,configurable:!0,get:function(){return e.width}},height:{enumerable:!0,configurable:!0,get:function(){return e.height}}}),this.render=function(){e.render()},this.update=function(){e.setDirty()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},(d=function(t,e,r){var i,V,o=r||{},a=void 0===o.flip||o.flip,c=o.width,u=o.height,h=!1,f=this,d=!1;function p(t,e,n,r){var i=l[t];if(i.definition){if(!(i=i.definition.call(f,e,n,r)))return null;i=L(L({},l[t]),i)}return i}function g(t){return f.source===t}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(r&&"object"==typeof r||(r=e),e=t),"string"==typeof e&&isNaN(e)&&(e=j(e,["canvas","img","video"])),"string"==typeof t&&l[t]&&(V=p(t,e,r,!0))&&(this.hook=t,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source)),!V&&F(e))"CANVAS"===e.tagName?(this.width=e.width,this.height=e.height,this.render=this.renderImageCanvas,d=!0,this.hook="canvas",this.compare=g):"IMG"===e.tagName&&(this.width=e.naturalWidth||1,this.height=e.naturalHeight||1,e.complete&&e.naturalWidth||(h=!0),e.addEventListener("load",function(){f.isDestroyed||(f.width===e.naturalWidth&&f.height===e.naturalHeight||(f.width=e.naturalWidth,f.height=e.naturalHeight,f.resize()),f.setDirty(),f.setReady())},!0),this.render=this.renderImageCanvas,d=!0,this.hook="image",this.compare=g);else if(!V&&F(e,"WebGLTexture")){if(n&&!n.isTexture(e))throw new Error("Not a valid WebGL texture.");isNaN(c)?isNaN(u)||(c=u):isNaN(u)&&(u=c),this.width=c,this.height=u,void 0===o.flip&&(a=!1),d=!0,this.texture=e,this.initialized=!0,this.hook="texture",this.compare=g,this.render=function(){}}if(!d&&!V)for(i in l)if(l.hasOwnProperty(i)&&l[i]&&(V=p(i,e,r,!1))){this.hook=i,d=!0,h=V.deferTexture,this.plugin=V,this.compare=V.compare,this.checkDirty=V.checkDirty,V.source&&(e=V.source);break}if(!d)throw new Error("Unknown source type");this.source=e,void 0===this.flip&&(this.flip=a),this.targets=[],h||f.setReady(),this.pub=new x(this),U.push(this),B[this.id]=this,G.push(this),v[this.hook].push(this),G.length&&!k&&lt()}).prototype=Object.create(s.prototype),d.prototype.constructor=d,d.prototype.initialize=function(){var t;n&&!this.texture&&this.ready&&(t=n.createTexture(),n.bindTexture(n.TEXTURE_2D,t),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),n.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),n.bindTexture(n.TEXTURE_2D,null),this.texture=t,this.initialized=!0,this.allowRefresh=!0,this.setDirty())},d.prototype.initFrameBuffer=function(t){n&&(this.frameBuffer=new $(n,this.width,this.height,{texture:this.texture,useFloat:t}))},d.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},d.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1)},d.prototype.resize=function(){var t,e;if(this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.framebuffer&&this.framebuffer.resize(this.width,this.height),this.emit("resize"),this.setDirty(),this.targets)for(t=0;t<this.targets.length;t++)(e=this.targets[t]).resize(),e.setTransformDirty&&e.setTransformDirty()},d.prototype.setReady=function(){var t;if(!this.ready&&(this.ready=!0,this.resize(),this.initialize(),this.emit("ready"),this.targets))for(t=0;t<this.targets.length;t++)this.targets[t].setReady()},d.prototype.render=function(){var t=this.source;n&&(t||0===t)&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.plugin&&this.plugin.render&&(this.dirty||this.checkDirty&&this.checkDirty())&&this.plugin.render.call(this,n,ft,i,V)&&(this.dirty=!1,this.emit("render")))},d.prototype.renderImageCanvas=function(){var t=this.source;if(n&&t&&this.ready&&(this.initialized||this.initialize(),this.allowRefresh&&this.dirty)){n.bindTexture(n.TEXTURE_2D,this.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,this.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{return n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,t),this.dirty=!1,this.emit("render"),!0}catch(t){t.code===window.DOMException.SECURITY_ERR&&(this.allowRefresh=!1,X.logger.error("Unable to access cross-domain image"))}return!1}},d.prototype.destroy=function(){var t,e,r;for(this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),n&&this.texture&&n.deleteTexture(this.texture);this.targets.length;)(r=this.targets.pop())&&r.removeSource&&r.removeSource(this);for(e in(t=G.indexOf(this))>=0&&G.splice(t,1),(t=v[this.hook].indexOf(this))>=0&&v[this.hook].splice(t,1),this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];s.prototype.destroy.call(this)},E=function(t){var e=t;Object.defineProperties(this,{source:{enumerable:!0,configurable:!0,get:function(){if(e.source)return e.source.pub},set:function(t){e.setSource(t)}},original:{enumerable:!0,configurable:!0,get:function(){return e.target}},width:{enumerable:!0,configurable:!0,get:function(){return e.width},set:function(t){!isNaN(t)&&t>0&&e.width!==t&&(e.width=t,e.resize(),e.setTransformDirty())}},height:{enumerable:!0,configurable:!0,get:function(){return e.height},set:function(t){!isNaN(t)&&t>0&&e.height!==t&&(e.height=t,e.resize(),e.setTransformDirty())}},id:{enumerable:!0,configurable:!0,get:function(){return e.id}}}),this.render=function(){e.render()},this.readPixels=function(t,n,r,i,V){return e.readPixels(t,n,r,i,V)},this.on=function(t,n){e.on(t,n)},this.off=function(t,n){e.off(t,n)},this.go=function(t){e.go(t)},this.stop=function(){e.stop()},this.getTexture=function(){return e.frameBuffer.texture},this.destroy=function(){var t,n;for(t in e.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((n=Object.getOwnPropertyDescriptor(this,t)).get||n.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.inputs=function(t){return{source:{type:"image"}}},this.isDestroyed=function(){return e.isDestroyed},this.isReady=function(){return e.ready}},((A=function(t,e,o){var u,h,l,d,p,g,v,y,b,w=this,A=!1;function S(t,e,r,o){var s=f[t];if(s.definition){if(!(s=s.definition.call(w,e,r,o)))return null;s=L(L({},f[t]),s),w.hook=b,A=!0,w.plugin=s,w.compare=s.compare,s.target&&(e=s.target),s.gl&&!w.gl&&(w.gl=s.gl,n||ct(s.gl)),w.gl===n&&(w.model=i,w.shader=V)}return s}if(s.call(this),(t&&"string"!=typeof t||!e&&0!==e)&&(o&&"object"==typeof o||(o=e),e=t),h=void 0===(u=o||{}).flip||u.flip,l=parseInt(u.width,10),d=parseInt(u.height,10),g=u.debugContext,"string"==typeof t&&f[t]&&S(t,e,u,!0),this.renderToTexture=u.renderToTexture,F(e,"WebGLFramebuffer"))if(v=e,F(u,"HTMLCanvasElement"))e=u;else if(F(u,"WebGLRenderingContext"))e=u.canvas;else if(F(u.canvas,"HTMLCanvasElement"))e=u.canvas;else{if(!F(u.context,"WebGLRenderingContext"))throw new Error("Must provide a canvas with WebGLFramebuffer target");e=u.context.canvas}if(F(e,"HTMLCanvasElement")){if(l=e.width,d=e.height,(!n||n.canvas!==e&&u.allowSecondaryWebGL)&&(p=H(e,{alpha:!0,premultipliedAlpha:!0,preserveDrawingBuffer:!0,stencil:!0,debugContext:g})),p)n&&n!==p?(this.gl=p,this.frameBuffer={frameBuffer:v||null},this.shader=new Q(this.gl,a,c),this.model=at.call(this,this.gl),this.pixels=null,this.texture=this.gl.createTexture(),this.gl.bindTexture(n.TEXTURE_2D,this.texture),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MAG_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_MIN_FILTER,n.LINEAR),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_S,n.CLAMP_TO_EDGE),this.gl.texParameteri(n.TEXTURE_2D,n.TEXTURE_WRAP_T,n.CLAMP_TO_EDGE),this.render=this.renderSecondaryWebGL):(r||(r=this),n||ct(p),this.render=this.renderWebGL,u.renderToTexture?n&&(this.frameBuffer=new $(n,l,d,!1)):this.frameBuffer={frameBuffer:v||null});else{if(!u.allowSecondaryWebGL&&n&&n.canvas!==e)throw new Error("Only one WebGL target canvas allowed. Set allowSecondaryWebGL option to create secondary context.");this.render=_,X.logger.log("Unable to create WebGL context.")}A=!0}if(!A)for(b in f)if(f.hasOwnProperty(b)&&f[b]&&S(b,e,u,!1))break;if(!A)throw new Error("Unknown target type");m&&((y=m.get(e))?X.logger.warn("Target already in use by another instance",e,Object.keys(y).map(function(t){return y[t]})):(y={},m.set(e,y)),y[N.id]=N),this.target=e,this.transform=null,this.transformDirty=!0,this.flip=h,l&&(this.width=l),d&&(this.height=d),this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,void 0!==u.auto?this.auto=u.auto:this.auto=Vt,this.frames=0,this.pub=new E(this),U.push(this),B[this.id]=this,Z.push(this)}).prototype=Object.create(s.prototype)).constructor=A,A.prototype.setSource=function(t){var e;(e=dt(t))!==this.source&&(this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&(this.resize(),e.ready?this.setReady():this.setUnready()),this.setDirty())},A.prototype.setDirty=function(){this.dirty=!0,this.auto&&!k&&(k=O(lt))},A.prototype.resize=function(){F(this.target,"HTMLCanvasElement")?this.width===this.target.width&&this.height===this.target.height||(this.target.width=this.width,this.target.height=this.height,this.uniforms.resolution[0]=this.width,this.uniforms.resolution[1]=this.height,this.emit("resize"),this.setTransformDirty()):this.plugin&&this.plugin.resize&&this.plugin.resize.call(this),!this.source||this.source.width===this.width&&this.source.height===this.height||this.transform||(this.transform=new Float32Array(16))},A.prototype.setTransformDirty=function(){this.transformDirty=!0,this.setDirty()},A.prototype.go=function(){this.auto=!0,this.setDirty()},A.prototype.stop=function(){this.auto=!1},A.prototype.render=function(){n&&this.plugin&&this.plugin.render&&this.plugin.render.call(this,ft,V,i)},A.prototype.renderWebGL=function(){var t,e,r;if(this.resize(),n&&this.dirty&&this.ready){if(!this.source)return;this.source.render(),this.uniforms.source=this.source.texture,this.source.width===this.width&&this.source.height===this.height?this.uniforms.transform=this.source.cumulativeMatrix||o:this.transformDirty&&(t=this.transform,M.copy(t,this.source.cumulativeMatrix||o),e=this.source.width/this.width,r=this.source.height/this.height,t[0]*=e,t[1]*=e,t[2]*=e,t[3]*=e,t[4]*=r,t[5]*=r,t[6]*=r,t[7]*=r,this.uniforms.transform=t,this.transformDirty=!1),ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this,T),this.emit("render"),this.dirty=!1}},A.prototype.renderSecondaryWebGL=function(){var t,e,n,r,i;this.dirty&&this.ready&&this.source&&(this.emit("render"),this.source.render(!0),t=this.source.width,e=this.source.height,this.pixels&&this.pixels.length===t*e*4||(this.pixels=new Uint8Array(t*e*4)),this.source.readPixels(0,0,t,e,this.pixels),this.gl.texImage2D(this.gl.TEXTURE_2D,0,this.gl.RGBA,t,e,0,this.gl.RGBA,this.gl.UNSIGNED_BYTE,this.pixels),t===this.width&&e===this.height?this.uniforms.transform=o:this.transformDirty&&(n=this.transform,M.copy(n,o),r=this.source.width/this.width,i=this.source.height/this.height,n[0]*=r,n[1]*=r,n[2]*=r,n[3]*=r,n[4]*=i,n[5]*=i,n[6]*=i,n[7]*=i,this.uniforms.transform=n,this.transformDirty=!1),this.uniforms.source=this.texture,ft(this.shader,this.model,this.uniforms,null,this,T),this.dirty=!1)},A.prototype.removeSource=function(t){this.source!==t&&this.source!==t.pub||(this.source=null)},A.prototype.destroy=function(){var t,n;this.source&&this.source.removeTarget&&this.source.removeTarget(this),m&&(delete(n=m.get(this.target))[N.id],Object.keys(n).length||m.delete(this.target)),this.plugin&&this.plugin.destroy&&this.plugin.destroy.call(this),delete this.source,delete this.target,delete this.pub,delete this.uniforms,delete this.pixels,delete this.auto,(t=Z.indexOf(this))>=0&&Z.splice(t,1),s.prototype.destroy.call(this),this===r&&(e.removeEventListener("webglcontextrestored",ut,!1),ht(),r=null)},C=function(t){var e,n=t,r=this;function i(t,e){Object.defineProperty(r,t,{configurable:!0,enumerable:!0,get:function(){return e.get.call(n)},set:function(r){!function(t,e,r){var i,V,o;i=n.inputElements[t],"string"==typeof r&&isNaN(r)&&("enum"===e.type?e.options.hasOwnProperty(r)||(r=j(r,["select"])):"number"===e.type||"boolean"===e.type?r=j(r,["input","select"]):"image"===e.type&&(r=j(r,["canvas","img","video"]))),F(r,"HTMLInputElement")||F(r,"HTMLSelectElement")?(V=r.value,i&&i.element!==r&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t],i=null),i||(i={element:r,listener:(o=r,function(){var e,i;e="checkbox"===r.type?r.checked:o.value,i=n.setInput(t,e),"color"===r.type&&(i=W(i)),i!==e&&(o.value=i)})},n.inputElements[t]=i,"range"===r.type?(r.addEventListener("input",i.listener,!0),r.addEventListener("change",i.listener,!0)):r.addEventListener("change",i.listener,!0)),i&&"checkbox"===r.type&&(V=r.checked)):(i&&(i.element.removeEventListener("change",i.listener,!0),i.element.removeEventListener("input",i.listener,!0),delete n.inputElements[t]),V=r),n.setInput(t,V)}(t,e,r)}})}function V(t){return function(){t.apply(n,arguments)&&n.setTransformDirty()}}for(e in Object.defineProperties(this,{transform:{enumerable:!0,configurable:!0,get:function(){return n.hook}},title:{enumerable:!0,configurable:!0,get:function(){return n.plugin.title||n.hook}},width:{enumerable:!0,configurable:!0,get:function(){return n.width}},height:{enumerable:!0,configurable:!0,get:function(){return n.height}},id:{enumerable:!0,configurable:!0,get:function(){return n.id}},source:{enumerable:!0,configurable:!0,get:function(){return n.source&&n.source.pub},set:function(t){n.setSource(t)}}}),n.methods)n.methods.hasOwnProperty(e)&&(this[e]=V(n.methods[e]));for(e in n.inputs)n.inputs.hasOwnProperty(e)&&i(e,n.inputs[e]);this.update=function(){n.setDirty()},this.inputs=function(t){var e,r,i,V;if(i=n.plugin.inputs,t)return!(r=i[t])||r.method?null:(e={type:r.type,defaultValue:r.defaultValue,title:r.title||t},"number"===r.type?(e.min=r.min,e.max=r.max,e.step=r.step,e.mod=r.mod):"enum"===r.type?e.options=L({},r.options):"vector"===r.type&&(e.dimensions=r.dimensions),r.description&&(e.description=r.description),e);for(V in e={},i)i.hasOwnProperty(V)&&!i[V].method&&(e[V]=this.inputs(V));return e},this.alias=function(t,e){return n.alias(t,e),this},this.on=function(t,e){n.on(t,e)},this.off=function(t,e){n.off(t,e)},this.destroy=function(){var t,e;for(t in n.destroy(),this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_)},this.isDestroyed=function(){return n.isDestroyed},this.isReady=function(){return n.ready}},(w=function(t,e){var n,r,i,V,o;for(n in this.matrix=new Float32Array(16),this.cumulativeMatrix=new Float32Array(16),this.ready=!1,this.width=1,this.height=1,this.seriously=N,this.transformRef=h[t],this.hook=t,this.id=z,z++,this.options=e,this.sources=null,this.targets=[],this.inputElements={},this.inputs={},this.methods={},this.listeners={},this.texture=null,this.frameBuffer=null,this.uniforms=null,this.dirty=!0,this.transformDirty=!0,this.renderDirty=!1,this.isDestroyed=!1,this.transformed=!1,this.plugin=L({},this.transformRef),this.transformRef.definition&&L(this.plugin,this.transformRef.definition.call(this,e)),this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&((r=this.plugin.inputs[n]).method&&"function"==typeof r.method?this.methods[n]=r.method:"function"==typeof r.set&&"function"==typeof r.get&&(this.inputs[n]=r));for(n in Y(this.plugin),o=rt[t],this.plugin.inputs)this.plugin.inputs.hasOwnProperty(n)&&"function"==typeof(r=this.plugin.inputs[n]).set&&"function"==typeof r.get&&"function"!=typeof r.method&&(i=r.get.call(this),V=void 0===r.defaultValue?i:r.defaultValue,V=r.validate.call(this,V,r,i),o&&void 0!==o[n]&&(V=r.validate.call(this,o[n],r,r.defaultValue,V),o[n]=V),V!==i&&r.set.call(this,V));U.push(this),B[this.id]=this,this.pub=new C(this),K.push(this),g[t].push(this)}).prototype=Object.create(s.prototype),w.prototype.constructor=w,w.prototype.setDirty=function(){this.renderDirty=!0,s.prototype.setDirty.call(this)},w.prototype.setTransformDirty=function(){var t,e;for(this.transformDirty=!0,this.dirty=!0,this.renderDirty=!0,t=0;t<this.targets.length;t++)(e=this.targets[t]).setTransformDirty?e.setTransformDirty():e.setDirty()},w.prototype.resize=function(){var t;for(s.prototype.resize.call(this),this.plugin.resize&&this.plugin.resize.call(this),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty()},w.prototype.setSource=function(t){var e;if((e=dt(t))!==this.source){if(pt(e,this))throw new Error("Attempt to make cyclical connection.");this.source&&this.source.removeTarget(this),this.source=e,e.addTarget(this),e&&e.ready?this.setReady():this.setUnready(),this.resize()}},w.prototype.addTarget=function(t){var e;for(e=0;e<this.targets.length;e++)if(this.targets[e]===t)return;this.targets.push(t)},w.prototype.removeTarget=function(t){var e=this.targets&&this.targets.indexOf(t);e>=0&&this.targets.splice(e,1),this.targets&&this.targets.length&&this.resize()},w.prototype.setInput=function(t,e){var n,r,i;if(this.plugin.inputs.hasOwnProperty(t))return n=this.plugin.inputs[t],r=rt[this.hook]&&void 0!==rt[this.hook][t]?rt[this.hook][t]:n.defaultValue,i=n.get.call(this),void 0===r&&(r=i),e=n.validate.call(this,e,n,r,i),n.set.call(this,e)&&this.setTransformDirty(),n.get.call(this)},w.prototype.alias=function(t,e){var n,r,i=this;if(I.indexOf(e)>=0)throw new Error("'"+e+"' is a reserved name and cannot be used as an alias.");return this.plugin.inputs.hasOwnProperty(t)&&(e||(e=t),N.removeAlias(e),(n=this.inputs[t])?(r=i.inputs[t],Object.defineProperty(N,e,{configurable:!0,enumerable:!0,get:function(){return r.get.call(i)},set:function(t){r.set.call(i,t)&&i.setTransformDirty()}})):(n=this.methods[t])&&(r=n,N[e]=function(){r.apply(i,arguments)&&i.setTransformDirty()}),n&&(tt[e]={node:this,input:t})),this},w.prototype.render=function(t){return this.source?(this.source.render(),this.transformDirty&&(this.transformed?this.source.cumulativeMatrix?M.multiply(this.cumulativeMatrix,this.matrix,this.source.cumulativeMatrix):M.copy(this.cumulativeMatrix,this.matrix):M.copy(this.cumulativeMatrix,this.source.cumulativeMatrix||o),this.transformDirty=!1),t&&n?(this.renderDirty&&(this.frameBuffer||(this.uniforms={resolution:[this.width,this.height]},this.frameBuffer=new $(n,this.width,this.height)),this.uniforms.source=this.source.texture,this.uniforms.transform=this.cumulativeMatrix||o,ft(V,i,this.uniforms,this.frameBuffer.frameBuffer,this),this.renderDirty=!1),this.texture=this.frameBuffer.texture):this.source?this.texture=this.source.texture:this.texture=null,this.dirty=!1,this.texture):(this.transformDirty&&(M.copy(this.cumulativeMatrix,this.matrix),this.transformDirty=!1),this.texture=null,void(this.dirty=!1))},w.prototype.readPixels=function(t,e,r,i,V){var o=this.gl||n;if(!n)throw new Error("Cannot read pixels until a canvas is connected");if(this.render(!0),void 0===V)V=new Uint8Array(r*i*4);else if(!F(V,"Uint8Array"))throw new Error("Incompatible array type");return o.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer.frameBuffer),o.readPixels(t,e,r,i,n.RGBA,n.UNSIGNED_BYTE,V),V},w.prototype.destroy=function(){var t,e,n,r=this.hook;for(t in this.plugin.destroy&&"function"==typeof this.plugin.destroy&&this.plugin.destroy.call(this),delete this.effect,this.frameBuffer&&(this.frameBuffer.destroy(),delete this.frameBuffer,delete this.texture),this.inputElements)this.inputElements.hasOwnProperty(t)&&((n=this.inputElements[t]).element.removeEventListener("change",n.listener,!0),n.element.removeEventListener("input",n.listener,!0));for(this.source&&this.source.removeTarget(this);this.targets.length;)(n=this.targets.pop())&&n.removeSource&&n.removeSource(this);for(e in this)this.hasOwnProperty(e)&&"id"!==e&&delete this[e];for(e in tt)tt.hasOwnProperty(e)&&(n=tt[e]).node===this&&N.removeAlias(e);(t=K.indexOf(this))>=0&&K.splice(t,1),(t=g[r].indexOf(this))>=0&&g[r].splice(t,1),s.prototype.destroy.call(this)},w.prototype.setReady=s.prototype.setReady,w.prototype.setUnready=s.prototype.setUnready,w.prototype.on=s.prototype.on,w.prototype.off=s.prototype.off,w.prototype.emit=s.prototype.emit,(t=F(t,"HTMLCanvasElement")?{canvas:t}:t||{}).canvas,this.effect=function(t,e){if(!u[t])throw new Error("Unknown effect: "+t);return new y(t,e).pub},this.source=function(t,e,n){return dt(t,e,n).pub},this.transform=function(e,n){if("string"!=typeof e&&(n=e,e=!1),e){if(!h[e])throw new Error("Unknown transform: "+e)}else if(e=t&&t.defaultTransform||"2d",!h[e])throw new Error("No transform specified");return new w(e,n).pub},this.target=function(t,e,n){var r,i,V;for(t&&"string"==typeof t&&!f[t]&&(i=document.querySelector(t)),("string"!=typeof t||!e&&0!==e||i)&&(n&&"object"==typeof n||(n=e),e=i||t,t=null),"string"==typeof e&&isNaN(e)&&(e=document.querySelector(e)),V=0;V<Z.length;V++)if(r=Z[V],(!t||t===r.hook)&&(r.target===e||r.compare&&r.compare(e,n)))return r.pub;return(r=new A(t,e,n)).pub},this.aliases=function(){return Object.keys(tt)},this.removeAlias=function(t){tt[t]&&(delete this[t],delete tt[t])},this.defaults=function(t,e){var n;if(t)if("object"!=typeof t)null===e?delete rt[t]:"object"==typeof e&&(rt[t]=L({},e));else for(n in t)t.hasOwnProperty(n)&&this.defaults(n,t[n]);else if(null===t)for(n in rt)rt.hasOwnProperty(n)&&delete rt[n]},this.go=function(t,e){var n;for("function"==typeof t&&et.indexOf(t)<0&&et.push(t),"function"==typeof e&&nt.indexOf(e)<0&&nt.push(e),Vt=!0,n=0;n<Z.length;n++)Z[n].go();k||!et.length&&!nt.length||lt()},this.stop=function(){et.length=0,nt.length=0,P(k),k=0},this.render=function(){var e;for(e=0;e<Z.length;e++)Z[e].render(t)},this.destroy=function(){for(var t,e;U.length;)U[0].pub.destroy();for(t in this)this.hasOwnProperty(t)&&"isDestroyed"!==t&&"id"!==t&&((e=Object.getOwnPropertyDescriptor(this,t)).get||e.set||"function"!=typeof this[t]?delete this[t]:this[t]=_);N=null,G=[],Z=[],J=[],U=[],et.length=0,nt.length=0,P(k),k=0,ot=!0},this.isDestroyed=function(){return ot},this.incompatible=function(t){var e,n,r;if(r=X.incompatible(t))return r;if(!t){for(e in p)if(p.hasOwnProperty(e)&&p[e].length&&(n=u[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"plugin-"+e;for(e in v)if(v.hasOwnProperty(e)&&v[e].length&&(n=l[e])&&"function"==typeof n.compatible&&!n.compatible.call(this))return"source-"+e}return!1},this.isNode=function(t){var e;return!(!t||!(e=B[t.id])||e.isDestroyed)},this.isSource=function(t){return this.isNode(t)&&t instanceof x},this.isEffect=function(t){return this.isNode(t)&&t instanceof S},this.isTransform=function(t){return this.isNode(t)&&t instanceof C},this.isTarget=function(t){return this.isNode(t)&&t instanceof E},Object.defineProperties(this,{id:{enumerable:!0,configurable:!0,get:function(){return D}}}),this.defaults(t.defaults)}window.addEventListener("message",function(t){t.source===window&&"seriously-timeout-message"===t.data&&(t.stopPropagation(),d.length>0&&d.shift()())},!0),$.prototype.resize=function(t,e){var n=this.gl;this.width===t&&this.height===e||(this.width=t,this.height=e,n&&(n.bindTexture(n.TEXTURE_2D,this.texture),n.bindFramebuffer(n.FRAMEBUFFER,this.frameBuffer),n.bindRenderbuffer(n.RENDERBUFFER,this.renderBuffer),n.texImage2D(n.TEXTURE_2D,0,n.RGBA,t,e,0,n.RGBA,n.UNSIGNED_BYTE,null),n.renderbufferStorage(n.RENDERBUFFER,n.DEPTH_COMPONENT16,t,e),n.framebufferTexture2D(n.FRAMEBUFFER,n.COLOR_ATTACHMENT0,n.TEXTURE_2D,this.texture,0),n.bindTexture(n.TEXTURE_2D,null),n.bindRenderbuffer(n.RENDERBUFFER,null),n.bindFramebuffer(n.FRAMEBUFFER,null)))},$.prototype.destroy=function(){var t=this.gl;t&&(t.deleteFramebuffer(this.frameBuffer),t.deleteRenderbuffer(this.renderBuffer),this.ownTexture&&t.deleteTexture(this.texture)),delete this.frameBuffer,delete this.renderBuffer,delete this.texture,delete this.gl},Q.prototype.use=function(){this.gl.useProgram(this.program)},X.incompatible=function(t){var e,n,r;if(void 0===V&&((e=document.createElement("canvas"))&&e.getContext?window.WebGLRenderingContext?(n=G())||(V="context"):V="webgl":V="canvas"),V)return V;if(t){if((r=u[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"plugin-"+t;if((r=l[t])&&"function"==typeof r.compatible&&!r.compatible(n))return"source-"+t}return!1},X.plugin=function(t,e,n){var r;if(u[t])X.logger.warn("Effect ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=k,r.inputs&&Y(r),r.title||(r.title=t),u[t]=r,p[t]=[],r},X.removePlugin=function(t){var e;if(!t)return this;if(!u[t])return this;if(e=p[t]){for(;e.length;)e.shift().destroy();delete p[t]}return delete u[t],this},X.source=function(t,e,n){var r;if(l[t])X.logger.warn("Source ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),l[t]=r,v[t]=[],r},X.removeSource=function(t){var e;if(!t)return this;if(!l[t])return this;if(e=v[t]){for(;e.length;)e.shift().destroy();delete v[t]}return delete l[t],this},X.transform=function(t,e,n){var r;if(h[t])X.logger.warn("Transform ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.reserved=D,r.inputs&&Y(r),r.title||(r.title=t),h[t]=r,g[t]=[],r},X.removeTransform=function(t){var e;if(!t)return this;if(!h[t])return this;if(e=g[t]){for(;e.length;)e.shift().destroy();delete g[t]}return delete h[t],this},X.target=function(t,e,n){var r;if(f[t])X.logger.warn("Target ["+t+"] already loaded");else if(void 0===n&&"object"==typeof e&&(n=e),n||e)return r=L({},n),"function"==typeof e&&(r.definition=e),r.title||(r.title=t),f[t]=r,y[t]=[],r},X.removeTarget=function(t){var e;if(!t)return this;if(!f[t])return this;if(e=y[t]){for(;e.length;)e.shift().destroy();delete y[t]}return delete f[t],this},X.inputValidators={color:function(t,e,n,r){var V,o,s,a;if(o=r||[],"string"==typeof t){if((s=A.exec(t))&&s.length){if(s.length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(o[3]=1,a=0;a<3;a++)o[a]=parseFloat(s[a+2])/255;return isNaN(s[6])||(o[3]=parseFloat(s[6])),"hsl"===s[1].toLowerCase()?B(o[0],o[1],o[2],o[3],o):o}if((s=S.exec(t))&&s.length)return 3===(V=s[1]).length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=1):4===V.length?(o[0]=parseInt(V[0],16)/15,o[1]=parseInt(V[1],16)/15,o[2]=parseInt(V[2],16)/15,o[3]=parseInt(V[3],16)/15):6===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=1):8===V.length?(o[0]=parseInt(V.substr(0,2),16)/255,o[1]=parseInt(V.substr(2,2),16)/255,o[2]=parseInt(V.substr(4,2),16)/255,o[3]=parseInt(V.substr(6,2),16)/255):o[0]=o[1]=o[2]=o[3]=0,o;if(s=w[t.toLowerCase()]){for(a=0;a<4;a++)o[a]=s[a];return o}return i||(i=document.createElement("canvas").getContext("2d")),i.fillStyle=t,(V=i.fillStyle)&&"#000000"!==V?X.inputValidators.color(V,e,n,r):(o[0]=o[1]=o[2]=o[3]=0,o)}if(z(t)){if((o=t).length<3)return o[0]=o[1]=o[2]=o[3]=0,o;for(a=0;a<3;a++)if(isNaN(o[a]))return o[0]=o[1]=o[2]=o[3]=0,o;return o.length<4&&o.push(1),o}if("number"==typeof t)return o[0]=o[1]=o[2]=t,o[3]=1,o;if("object"==typeof t){for(a=0;a<4;a++)null===t[V=C[a]]||isNaN(t[V])?o[a]=3===a?1:0:o[a]=t[V];return o}return o[0]=o[1]=o[2]=o[3]=0,o},number:function(t,e,n){return t=parseFloat(t),isNaN(t)?n||0:(e.mod&&(t-=e.mod*Math.floor(t/e.mod)),t<e.min?e.min:t>e.max?e.max:e.step?Math.round(t/e.step)*e.step:t)},enum:function(t,e,n){var r=e.options||[];return"string"==typeof t?t=t.toLowerCase():"number"==typeof t?t=t.toString():t||(t=""),r.hasOwnProperty(t)?t:n||""},vector:function(t,e,n,r){var i,V,o,s=e.dimensions||4;if(i=r||[],z(t)){for(V=0;V<s;V++)i[V]=t[V]||0;return i}if("object"==typeof t){for(V=0;V<s;V++)void 0===t[o=x[V]]&&(o=C[V]),i[V]=t[o]||0;return i}for(t=parseFloat(t)||0,V=0;V<s;V++)i[V]=t;return i},boolean:function(t){return!!t&&(!t||!t.toLowerCase||"false"!==t.toLowerCase())},string:function(t){return"string"==typeof t?t:0===t||t?t.toString?t.toString():String(t):""}},X.prototype.effects=X.effects=function(){var t,e,n,r,i,V={};for(t in u)if(u.hasOwnProperty(t)){for(i in n={title:(e=u[t]).title||t,description:e.description||"",inputs:{}},e.inputs)e.inputs.hasOwnProperty(i)&&(r=e.inputs[i],n.inputs[i]={type:r.type,defaultValue:r.defaultValue,step:r.step,min:r.min,max:r.max,mod:r.mod,minCount:r.minCount,maxCount:r.maxCount,dimensions:r.dimensions,title:r.title||i,description:r.description||"",options:r.options||[]});V[t]=n}return V},window.Float32Array&&(o=new Float32Array([1,0,0,0,0,1,0,0,0,0,1,0,0,0,0,1])),window.Seriously&&"object"==typeof window.Seriously&&function(){var t;for(t in window.Seriously)window.Seriously.hasOwnProperty(t)&&"plugin"!==t&&"object"==typeof window.Seriously[t]&&X.plugin(t,window.Seriously[t])}(),X.logger={log:U("log"),info:U("info"),warn:U("warn"),error:U("error")},X.util={mat4:M,checkSource:function(t){var e,n,r,i;if(!(e=j(t,["img","canvas","video"])))return!1;if(!(n=document.createElement("canvas")))return X.logger.warn("Browser does not support canvas or Seriously.js"),!1;if(0===e.naturalWidth&&"IMG"===e.tagName)return X.logger.warn("Image not loaded"),!1;if(0===e.readyState&&0===e.videoWidth&&"VIDEO"===e.tagName)return X.logger.warn("Video not loaded"),!1;if(r=G()){(i=r.createTexture())||X.logger.error("Test WebGL context has been lost"),r.bindTexture(r.TEXTURE_2D,i);try{r.texImage2D(r.TEXTURE_2D,0,r.RGBA,r.RGBA,r.UNSIGNED_BYTE,e)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error storing image to texture: "+t.message),r.deleteTexture(i),!1}r.deleteTexture(i)}else{r=n.getContext("2d");try{r.drawImage(e,0,0),r.getImageData(0,0,1,1)}catch(t){return t.code===window.DOMException.SECURITY_ERR?X.logger.log("Unable to access cross-domain image"):X.logger.error("Error drawing image to canvas: "+t.message),!1}}return!0},hslToRgb:B,colors:w,setTimeoutZero:q,ShaderProgram:Q,FrameBuffer:$,requestAnimationFrame:O,shader:{makeNoise:"float makeNoise(float u, float v, float timer) {\n\tfloat x = u * v * mod(timer * 1000.0, 100.0);\n\tx = mod(x, 13.0) * mod(x, 127.0);\n\tfloat dx = mod(x, 0.01);\n\treturn clamp(0.1 + dx * 100.0, 0.0, 1.0);\n}\n",random:"#ifndef RANDOM\n#define RANDOM\nfloat random(vec2 n) {\n\treturn 0.5 + 0.5 * fract(sin(dot(n.xy, vec2(12.9898, 78.233)))* 43758.5453);\n}\n#endif\n"}},X.source("video",function(t,e,n){var r,i,V=this,o=!1,a=!1,c=!1,u=0;function h(){t.removeEventListener("loadedmetadata",h,!0),o||(t.videoWidth?(V.width===t.videoWidth&&V.height===t.videoHeight||(V.width=t.videoWidth,V.height=t.videoHeight,V.resize()),a&&V.setReady()):(a=!0,setTimeout(h,50)))}function l(){c=!0}function f(){c=!1,V.setDirty()}if(F(t,"HTMLVideoElement"))return t.readyState?h():(a=!0,t.addEventListener("loadedmetadata",h,!0)),t.addEventListener("seeking",l,!1),t.addEventListener("seeked",f,!1),{deferTexture:a,source:t,render:function e(n){var o;if(u=t.currentTime,!t.videoHeight||!t.videoWidth)return!1;s?(i||(i=document.createElement("canvas").getContext("2d"),(r=i.canvas).width=V.width,r.height=V.height),o=r,i.drawImage(t,0,0,V.width,V.height)):o=t,n.bindTexture(n.TEXTURE_2D,V.texture),n.pixelStorei(n.UNPACK_FLIP_Y_WEBGL,V.flip),n.pixelStorei(n.UNPACK_PREMULTIPLY_ALPHA_WEBGL,!1);try{if(n.texImage2D(n.TEXTURE_2D,0,n.RGBA,n.RGBA,n.UNSIGNED_BYTE,o),void 0===s){if(n.getError()===n.INVALID_VALUE)return s=!0,e(n);s=!1}return!0}catch(t){t.code===window.DOMException.SECURITY_ERR?(V.allowRefresh=!1,X.logger.error("Unable to access cross-domain image")):X.logger.error("Error rendering video source",t)}return!1},checkDirty:function(){return!c&&t.currentTime!==u},compare:function(t){return V.source===t},destroy:function(){o=!0,t.removeEventListener("seeking",l,!1),t.removeEventListener("seeked",f,!1),t.removeEventListener("loadedmetadata",h,!0)}}},{title:"Video"}),X.transform("2d",function(t){var e=this,n=!(t&&t.radians),r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0;function l(){var t,l,f,d,p,g,v,y,m,b,_,w=e.matrix;function A(t,e){w[12]=w[0]*t+w[4]*e+w[12],w[13]=w[1]*t+w[5]*e+w[13],w[14]=w[2]*t+w[6]*e+w[14],w[15]=w[3]*t+w[7]*e+w[15]}s||a||c||u||h||1!==V||1!==o?(M.identity(w),A(s+r,a+i),u&&(w[4]=u/e.width),h&&(w[1]=h/e.height),c&&(d=w[0],p=w[1],g=w[2],v=w[3],y=w[4],m=w[5],b=w[6],_=w[7],t=-(n?c*Math.PI/180:c),l=Math.sin(t),f=Math.cos(t),w[0]=d*f+y*l,w[1]=p*f+m*l,w[2]=g*f+b*l,w[3]=v*f+_*l,w[4]=y*f-d*l,w[5]=m*f-p*l,w[6]=b*f-g*l,w[7]=_*f-v*l),1!==V&&(w[0]*=V,w[1]*=V,w[2]*=V,w[3]*=V),1!==o&&(w[4]*=o,w[5]*=o,w[6]*=o,w[7]*=o),A(-r,-i),e.transformed=!0):e.transformed=!1}return{inputs:{reset:{method:function(){return r=0,i=0,V=1,o=1,s=0,a=0,c=0,u=0,h=0,!!e.transformed&&(e.transformed=!1,!0)}},translate:{method:function(t,e){return isNaN(t)&&(t=s),isNaN(e)&&(e=a),(t!==s||e!==a)&&(s=t,a=e,l(),!0)},type:["number","number"]},translateX:{get:function(){return s},set:function(t){return t!==s&&(s=t,l(),!0)},type:"number"},translateY:{get:function(){return a},set:function(t){return t!==a&&(a=t,l(),!0)},type:"number"},rotation:{get:function(){return c},set:function(t){return t!==c&&(c=parseFloat(t),l(),!0)},type:"number"},center:{method:function(t,e){return isNaN(t)&&(t=r),isNaN(e)&&(e=i),(t!==r||e!==i)&&(r=t,i=e,l(),!0)},type:["number","number"]},centerX:{get:function(){return r},set:function(t){return t!==r&&(r=t,l(),!0)},type:"number"},centerY:{get:function(){return i},set:function(t){return t!==i&&(i=t,l(),!0)},type:"number"},skew:{method:function(t,e){return isNaN(t)&&(t=u),isNaN(e)&&(e=h),(t!==u||e!==h)&&(u=t,h=e,l(),!0)},type:["number","number"]},skewX:{get:function(){return u},set:function(t){return t!==u&&(u=t,l(),!0)},type:"number"},skewY:{get:function(){return h},set:function(t){return t!==h&&(h=t,l(),!0)},type:"number"},scale:{method:function(t,e){var n,r;if(n=isNaN(t)?V:t,isNaN(e)){if(isNaN(t))return!1;r=n}else r=e;return(n!==V||r!==o)&&(V=n,o=r,l(),!0)},type:["number","number"]},scaleX:{get:function(){return V},set:function(t){return t!==V&&(V=t,l(),!0)},type:"number"},scaleY:{get:function(){return o},set:function(t){return t!==o&&(o=t,l(),!0)},type:"number"}}}},{title:"2D Transform",description:"Translate, Rotate, Scale, Skew"}),X.transform("flip",function(){var t=this,e=!0;function n(){var n=t.matrix;e?(n[0]=-1,n[5]=1):(n[0]=1,n[5]=-1)}return M.identity(t.matrix),n(),t.transformDirty=!0,t.transformed=!0,{inputs:{direction:{get:function(){return e?"horizontal":"vertical"},set:function(t){var r;return(r="vertical"!==t)!==e&&(e=r,n(),!0)},type:"string"}}}},{title:"Flip",description:"Flip Horizontal/Vertical"}),X.transform("reformat",function(){var t,e,n=this,r="contain";function i(){var i,V,o,s,a=n.matrix,c=t||n.width,u=e||n.height,h=n.source,l=h&&h.width||1,f=h&&h.height||1;"distort"===r||c===l&&u===f?n.transformed=!1:(o=l/f,s=c/u,"none"===r?(i=l/c,V=f/u):"width"===r||"contain"===r&&s<=o?(i=1,V=s/o):"height"===r||"contain"===r&&s>o?(i=o/s,V=1):s>o?(i=1,V=s/o):(i=o/s,V=1),1!==i||1!==V?(M.identity(a),1!==i&&(a[0]*=i,a[1]*=i,a[2]*=i,a[3]*=i),1!==V&&(a[4]*=V,a[5]*=V,a[6]*=V,a[7]*=V),n.transformed=!0):n.transformed=!1)}function V(){return t||n.source&&n.source.width||1}function o(){return e||n.source&&n.source.height||1}return this.resize=function(){var t,e=V(),n=o();if(this.width!==e||this.height!==n)for(this.width=e,this.height=n,this.uniforms&&this.uniforms.resolution&&(this.uniforms.resolution[0]=e,this.uniforms.resolution[1]=n),this.frameBuffer&&this.frameBuffer.resize&&this.frameBuffer.resize(e,n),t=0;t<this.targets.length;t++)this.targets[t].resize();this.setTransformDirty(),i()},{inputs:{width:{get:V,set:function(e){return(e=Math.floor(e))!==t&&(t=e,this.resize(),!1)},type:"number"},height:{get:o,set:function(t){return(t=Math.floor(t))!==e&&(e=t,this.resize(),!1)},type:"number"},mode:{get:function(){return r},set:function(t){return t!==r&&(r=t,i(),!0)},type:"enum",options:["cover","contain","distort","width","height","none"]}}}},{title:"Reformat",description:"Change output dimensions"}),a=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","void main(void) {","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tgl_Position.w = screenPosition.w;","\tvTexCoord = texCoord;","}\n"].join("\n"),c=["precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","void main(void) {","\t\tgl_FragColor = texture2D(source, vTexCoord);","}"].join("\n"),X.util.shader.noiseHelpers="#ifndef NOISE_HELPERS\n#define NOISE_HELPERS\nvec2 mod289(vec2 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 mod289(vec3 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec4 mod289(vec4 x) {\n\treturn x - floor(x * (1.0 / 289.0)) * 289.0;\n}\nvec3 permute(vec3 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 permute(vec4 x) {\n\treturn mod289(((x*34.0)+1.0)*x);\n}\nvec4 taylorInvSqrt(vec4 r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\nfloat taylorInvSqrt(float r) {\n\treturn 1.79284291400159 - 0.85373472095314 * r;\n}\n#endif\n",X.util.shader.snoise2d="#ifndef NOISE2D\n#define NOISE2D\nfloat snoise(vec2 v) {\n\tconst vec4 C = vec4(0.211324865405187, // (3.0-sqrt(3.0))/6.0\n\t\t0.366025403784439, // 0.5*(sqrt(3.0)-1.0)\n\t\t-0.577350269189626, // -1.0 + 2.0 * C.x\n\t\t0.024390243902439); // 1.0 / 41.0\n\tvec2 i = floor(v + dot(v, C.yy));\n\tvec2 x0 = v - i + dot(i, C.xx);\n\tvec2 i1;\n\t//i1.x = step(x0.y, x0.x); // x0.x > x0.y ? 1.0 : 0.0\n\t//i1.y = 1.0 - i1.x;\n\ti1 = (x0.x > x0.y) ? vec2(1.0, 0.0) : vec2(0.0, 1.0);\n\t// x0 = x0 - 0.0 + 0.0 * C.xx ;\n\t// x1 = x0 - i1 + 1.0 * C.xx ;\n\t// x2 = x0 - 1.0 + 2.0 * C.xx ;\n\tvec4 x12 = x0.xyxy + C.xxzz;\n\tx12.xy -= i1;\n\ti = mod289(i); // Avoid truncation effects in permutation\n\tvec3 p = permute(permute(i.y + vec3(0.0, i1.y, 1.0)) + i.x + vec3(0.0, i1.x, 1.0));\n\tvec3 m = max(0.5 - vec3(dot(x0, x0), dot(x12.xy, x12.xy), dot(x12.zw, x12.zw)), 0.0);\n\tm = m*m ;\n\tm = m*m ;\n\tvec3 x = 2.0 * fract(p * C.www) - 1.0;\n\tvec3 h = abs(x) - 0.5;\n\tvec3 ox = floor(x + 0.5);\n\tvec3 a0 = x - ox;\n\tm *= 1.79284291400159 - 0.85373472095314 * (a0*a0 + h*h);\n\tvec3 g;\n\tg.x = a0.x * x0.x + h.x * x0.y;\n\tg.yz = a0.yz * x12.xz + h.yz * x12.yw;\n\treturn 130.0 * dot(m, g);\n}\n#endif\n",X.util.shader.snoise3d="#ifndef NOISE3D\n#define NOISE3D\nfloat snoise(vec3 v) {\n\tconst vec2 C = vec2(1.0/6.0, 1.0/3.0) ;\n\tconst vec4 D = vec4(0.0, 0.5, 1.0, 2.0);\n\tvec3 i = floor(v + dot(v, C.yyy));\n\tvec3 x0 = v - i + dot(i, C.xxx) ;\n\tvec3 g = step(x0.yzx, x0.xyz);\n\tvec3 l = 1.0 - g;\n\tvec3 i1 = min(g.xyz, l.zxy);\n\tvec3 i2 = max(g.xyz, l.zxy);\n\t// x0 = x0 - 0.0 + 0.0 * C.xxx;\n\t// x1 = x0 - i1 + 1.0 * C.xxx;\n\t// x2 = x0 - i2 + 2.0 * C.xxx;\n\t// x3 = x0 - 1.0 + 3.0 * C.xxx;\n\tvec3 x1 = x0 - i1 + C.xxx;\n\tvec3 x2 = x0 - i2 + C.yyy; // 2.0*C.x = 1/3 = C.y\n\tvec3 x3 = x0 - D.yyy; // -1.0+3.0*C.x = -0.5 = -D.y\n\ti = mod289(i);\n\tvec4 p = permute(permute(permute(\n\t\t\t\t\t\ti.z + vec4(0.0, i1.z, i2.z, 1.0))\n\t\t\t\t\t\t+ i.y + vec4(0.0, i1.y, i2.y, 1.0))\n\t\t\t\t\t\t+ i.x + vec4(0.0, i1.x, i2.x, 1.0));\n\tfloat n_ = 0.142857142857; // 1.0/7.0\n\tvec3 ns = n_ * D.wyz - D.xzx;\n\tvec4 j = p - 49.0 * floor(p * ns.z * ns.z); // mod(p, 7 * 7)\n\tvec4 x_ = floor(j * ns.z);\n\tvec4 y_ = floor(j - 7.0 * x_); // mod(j, N)\n\tvec4 x = x_ * ns.x + ns.yyyy;\n\tvec4 y = y_ * ns.x + ns.yyyy;\n\tvec4 h = 1.0 - abs(x) - abs(y);\n\tvec4 b0 = vec4(x.xy, y.xy);\n\tvec4 b1 = vec4(x.zw, y.zw);\n\t//vec4 s0 = vec4(lessThan(b0, 0.0)) * 2.0 - 1.0;\n\t//vec4 s1 = vec4(lessThan(b1, 0.0)) * 2.0 - 1.0;\n\tvec4 s0 = floor(b0) * 2.0 + 1.0;\n\tvec4 s1 = floor(b1) * 2.0 + 1.0;\n\tvec4 sh = -step(h, vec4(0.0));\n\tvec4 a0 = b0.xzyw + s0.xzyw * sh.xxyy ;\n\tvec4 a1 = b1.xzyw + s1.xzyw * sh.zzww ;\n\tvec3 p0 = vec3(a0.xy, h.x);\n\tvec3 p1 = vec3(a0.zw, h.y);\n\tvec3 p2 = vec3(a1.xy, h.z);\n\tvec3 p3 = vec3(a1.zw, h.w);\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tvec4 m = max(0.6 - vec4(dot(x0, x0), dot(x1, x1), dot(x2, x2), dot(x3, x3)), 0.0);\n\tm = m * m;\n\treturn 42.0 * dot(m*m, vec4(dot(p0, x0), dot(p1, x1), dot(p2, x2), dot(p3, x3)));\n}\n#endif\n",X.util.shader.snoise4d="#ifndef NOISE4D\n#define NOISE4D\nvec4 grad4(float j, vec4 ip)\n\t{\n\tconst vec4 ones = vec4(1.0, 1.0, 1.0, -1.0);\n\tvec4 p, s;\n\n\tp.xyz = floor(fract (vec3(j) * ip.xyz) * 7.0) * ip.z - 1.0;\n\tp.w = 1.5 - dot(abs(p.xyz), ones.xyz);\n\ts = vec4(lessThan(p, vec4(0.0)));\n\tp.xyz = p.xyz + (s.xyz*2.0 - 1.0) * s.www;\n\n\treturn p;\n\t}\n\n#define F4 0.309016994374947451\n\nfloat snoise(vec4 v)\n\t{\n\tconst vec4 C = vec4(0.138196601125011, // (5 - sqrt(5))/20 G4\n\t\t\t\t\t\t0.276393202250021, // 2 * G4\n\t\t\t\t\t\t0.414589803375032, // 3 * G4\n\t\t\t\t\t\t-0.447213595499958); // -1 + 4 * G4\n\n\tvec4 i = floor(v + dot(v, vec4(F4)));\n\tvec4 x0 = v - i + dot(i, C.xxxx);\n\n\n\tvec4 i0;\n\tvec3 isX = step(x0.yzw, x0.xxx);\n\tvec3 isYZ = step(x0.zww, x0.yyz);\n\ti0.x = isX.x + isX.y + isX.z;\n\ti0.yzw = 1.0 - isX;\n\ti0.y += isYZ.x + isYZ.y;\n\ti0.zw += 1.0 - isYZ.xy;\n\ti0.z += isYZ.z;\n\ti0.w += 1.0 - isYZ.z;\n\n\tvec4 i3 = clamp(i0, 0.0, 1.0);\n\tvec4 i2 = clamp(i0 - 1.0, 0.0, 1.0);\n\tvec4 i1 = clamp(i0 - 2.0, 0.0, 1.0);\n\n\tvec4 x1 = x0 - i1 + C.xxxx;\n\tvec4 x2 = x0 - i2 + C.yyyy;\n\tvec4 x3 = x0 - i3 + C.zzzz;\n\tvec4 x4 = x0 + C.wwww;\n\n\ti = mod289(i);\n\tfloat j0 = permute(permute(permute(permute(i.w) + i.z) + i.y) + i.x);\n\tvec4 j1 = permute(permute(permute(permute (\n\t\t\t\t\ti.w + vec4(i1.w, i2.w, i3.w, 1.0))\n\t\t\t\t\t+ i.z + vec4(i1.z, i2.z, i3.z, 1.0))\n\t\t\t\t\t+ i.y + vec4(i1.y, i2.y, i3.y, 1.0))\n\t\t\t\t\t+ i.x + vec4(i1.x, i2.x, i3.x, 1.0));\n\n\tvec4 ip = vec4(1.0/294.0, 1.0/49.0, 1.0/7.0, 0.0) ;\n\n\tvec4 p0 = grad4(j0, ip);\n\tvec4 p1 = grad4(j1.x, ip);\n\tvec4 p2 = grad4(j1.y, ip);\n\tvec4 p3 = grad4(j1.z, ip);\n\tvec4 p4 = grad4(j1.w, ip);\n\n\tvec4 norm = taylorInvSqrt(vec4(dot(p0, p0), dot(p1, p1), dot(p2, p2), dot(p3, p3)));\n\tp0 *= norm.x;\n\tp1 *= norm.y;\n\tp2 *= norm.z;\n\tp3 *= norm.w;\n\tp4 *= taylorInvSqrt(dot(p4, p4));\n\n\tvec3 m0 = max(0.6 - vec3(dot(x0, x0), dot(x1, x1), dot(x2, x2)), 0.0);\n\tvec2 m1 = max(0.6 - vec2(dot(x3, x3), dot(x4, x4)), 0.0);\n\tm0 = m0 * m0;\n\tm1 = m1 * m1;\n\treturn 49.0 * (dot(m0*m0, vec3(dot(p0, x0), dot(p1, x1), dot(p2, x2)))\n\t\t\t\t\t\t\t+ dot(m1*m1, vec2(dot(p3, x3), dot(p4, x4)))) ;\n}\n#endif\n",e.default=X},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.Uneeq=void 0;const V=n(45);n(101);const o=n(80),s=i(n(104)),a=n(84),c=n(105),u=n(106),h=n(58),l=n(137),f=n(144),d=n(150),p=n(152),g=n(79),v=n(153),y=n(99),m=n(154),b=n(85),_=n(86);e.Uneeq=class{constructor(t){this.ready=new V.BehaviorSubject(!1),this.version=s.default.version,this.messages=new V.Subject,this.internalMessages$=new V.Subject,this.sessionPaused=!1,this.sessionStarted=!1,this.unavailableAvatarMsgSent=!1,this.remoteVideoPlayCount=0,h.logger.enabled=t.logging||!1,this.options=t,this.options.diagnostics=t.diagnostics||!1,this.options.micActivityMessages=t.micActivityMessages||!1,this.options.sendLocalVideo=void 0===t.sendLocalVideo||t.sendLocalVideo,this.options.sendLocalAudio=void 0===t.sendLocalAudio||t.sendLocalAudio,this.options.enableClientPerformanceMessage=t.enableClientPerformanceMessage||!1,this.options.enableTransparentBackground=t.enableTransparentBackground||!1,this.api=new c.API(this.options.url,this.options.apiKey),this.messageCallback=this.options.messageHandler||(()=>{}),this.checkWebRTCSupport(),this.startSessionData={workspaceName:this.options.conversationId,sessionType:m.SessionType.WEB,sdkVersion:this.version,clientWidth:window.screen.availWidth,clientHeight:window.screen.availHeight},this.options.customData&&(this.startSessionData.customData=this.options.customData),h.logger.log(`Uneeq Created (version ${this.version})`),this.streamManager=new v.StreamManager,this.metricsService=new d.MetricsService(this.options,this.internalMessages$,this.messages)}init(){this.initPromMetricsListener(),this.startSessionTime=Date.now(),this.api.startSession(this.startSessionData).then(t=>{this.session=t,this.initialize()}).catch(t=>{this.sendServiceUnavailableMessage(t)})}initWithToken(t){return r(this,void 0,void 0,function*(){this.initPromMetricsListener(),this.startSessionTime=Date.now();try{this.startSessionData.tokenId=t,this.session=yield this.api.startSessionWithToken(this.startSessionData),console.log("UneeQ Session ID: "+this.session.id),this.session.sourceApp=_.SourceApp[this.session.sourceApp?this.session.sourceApp:""]?this.session.sourceApp:_.SourceApp.UNKNOWN,this.session.showUneeqLogo&&this.initImageContentSecurityViolationListener(),this.initialize()}catch(t){this.sendServiceUnavailableMessage(t)}})}get sessionId(){return this.session?this.session.id:null}setCamera(t){this.serviceReadyCheck("setCamera")&&this.deviceManager.setCamDevice(t)}setMic(t){this.serviceReadyCheck("setMic")&&this.deviceManager.setMicDevice(t)}setSpeaker(t){this.serviceReadyCheck("setSpeaker")&&this.deviceManager.setAvatarSpeakerDevice(t)}enableMicrophone(t=!0){this.deviceManager.enableLocalDevices(this.options.sendLocalVideo,t)}enableCamera(t=!0){this.deviceManager.enableLocalDevices(t,this.options.sendLocalAudio)}enableMicrophoneAndCamera(t=!0){this.deviceManager.enableLocalDevices(t,t)}sendTranscript(t){this.serviceReadyCheck("sendTranscript")&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to sendTranscript() will be ignored. Session is paused.")):this.api.avatarAsk(t))}getServerStats(){this.deviceManager&&this.deviceManager.mediaHandler&&this.deviceManager.mediaHandler.sendDataMessage("stats")}startRecording(){this.serviceReadyCheck("startRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to startRecording() will be ignored. Session is paused.")):this.api.avatarStartRecording().then(()=>this.messages.next(new y.RecordingStartedMessage)))}stopSpeaking(){return this.api.avatarStopSpeaking()}stopRecording(){this.serviceReadyCheck("stopRecording")&&this.options.sendLocalAudio&&(this.sessionPaused?this.messages.next(new y.WarningMessage("Call to stopRecording() will be ignored. Session is paused.")):this.api.avatarStopRecording().then(()=>this.messages.next(new y.RecordingStoppedMessage)))}pauseSession(){return!!this.serviceReadyCheck("pauseSession")&&(this.sessionPaused?(this.messages.next(new y.WarningMessage("Call to pauseSession() will be ignored. Session is paused.")),!1):(this.sessionPaused=!0,this.deviceManager.mediaHandler.pause(),this.messages.next(new y.SessionPausedMessage),!0))}resumeSession(){return!!this.serviceReadyCheck("resumeSession")&&(this.sessionPaused?(this.sessionPaused=!1,this.deviceManager.mediaHandler.resume(),this.messages.next(new y.SessionResumedMessage),!0):(this.messages.next(new y.WarningMessage("Call to resumeSession() will be ignored. Session is unpaused.")),!1))}endSession(){this.serviceReadyCheck("endSession")&&(this.api.endCall(),this.internalMessages$.next({faceMeMessageType:"sessionEnd"}))}setAvatarDebug(t){return this.api.setAvatarDebug(t)}playWelcomeMessage(){return this.api.avatarWelcome()}gatherWebRtcMetrics(){var t;null===(t=this.deviceManager)||void 0===t||t.mediaHandler.gatherWebRTCStats((t,e)=>{this.metricsService.parseAndLogWebRtcStats(e)}),setTimeout(()=>{this.gatherWebRtcMetrics()},5e3)}initMessaging(){this.messages.subscribe(t=>this.messageCallback(t)),this.messaging.state$.filter(t=>t===f.MessagingState.CONNECTED).subscribe(()=>{this.messaging.getTopic("/topic/avatar/"+this.session.streamId),this.ready.next(!0),this.messages.next(new y.ReadyMessage),this.gatherWebRtcMetrics()}),this.messaging.messages$.subscribe(t=>this.internalMessages$.next(JSON.parse(t.body))),this.messageHandler=new l.MessageHandler(this.internalMessages$,this.messages),this.messaging.connect(),this.messaging.messages$.subscribe(t=>{h.logger.log("-- Msg -- ",t)})}initDeviceManager(){this.deviceManager=new u.DeviceManager({userMessages:this.messages,session:this.session,messages:this.messages,internalMessages$:this.internalMessages$,messaging:this.messaging,uneeqOptions:this.options,streamManager:this.streamManager},this.api),this.messageHandler.setDeviceManager(this.deviceManager)}sessionLiveHandler(){if(!this.sessionStarted){this.messages.next(new y.SessionLiveMessage),this.options.playWelcome&&this.api.avatarWelcome();const t={type:g.PromMessageType.SessionStart,value:(Date.now()-this.startSessionTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.sessionStarted=!0}}initAvatar(){this.ready.filter(Boolean).pipe(o.take(1)).subscribe(()=>{this.internalMessages$.filter(t=>"DevicePermissionAllowedInternal"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>{console.log("DevicePermissionAllowedInternal"),this.messages.next(new y.DevicePermissionAllowedMessage),this.startAvatarWhenAvailable()}),this.initDeviceManager()}),this.internalMessages$.filter(t=>"sessionLive"===t.faceMeMessageType).pipe(o.take(1)).subscribe(t=>this.sessionLiveHandler()),this.internalMessages$.filter(t=>"sessionEnd"===t.faceMeMessageType).subscribe(()=>{this.deviceManager.mediaHandler.endSession(),this.messages.next(new y.SessionEndedMessage),this.messaging.disconnect()}),this.internalMessages$.filter(t=>"remoteVideoReadyToPlay"===t.faceMeMessageType).subscribe(t=>{this.playRemoteVideo(),this.streamManager.remoteVideoReadyToPlay()})}playRemoteVideo(){this.deviceManager.mediaHandler.avatarVideoElement&&(this.deviceManager.mediaHandler.avatarVideoElement.play(),this.deviceManager.mediaHandler.avatarVideoElement.autoplay=!0,this.remoteVideoPlayCount++,setTimeout(()=>{this.remoteVideoPlayCount<=10&&this.playRemoteVideo()},100*(this.remoteVideoPlayCount-1)))}startAvatarWhenAvailable(){this.availableResponseTime=Date.now(),this.api.getAvailableAvatarCount().then(t=>{if(t.available>0){const t={type:g.PromMessageType.AvailabilityCheck,value:(Date.now()-this.availableResponseTime)/1e3};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:t}),this.messages.next(new y.AvatarAvailableMessage),this.api.avatarStart({enableTransparentBackground:this.options.enableTransparentBackground})}else this.unavailableAvatarMsgSent||(this.unavailableAvatarMsgSent=!0,this.messages.next(new y.AvatarUnavailableMessage)),setTimeout(()=>{this.startAvatarWhenAvailable()},1e3)})}initialize(){if(this.session){this.api.callId=this.session.id,this.initAvatar();const t={maxReconnectAttempts:3,reconnectTime:3e3,maxReconnectLimitReached:()=>{this.messages.next(new y.ConnectionLostMessage(b.PublishSubscribeState.DISCONNECTED)),this.endSession()},connectionHeaders:{"x-auth-token":this.api.authToken}};this.messaging=new f.MessagingService(this.options.url+"/api/messaging",t),this.initMessaging(),this.initOnlineStatusUpdateMessages()}}sendServiceUnavailableMessage(t){const e=new y.ServiceUnavailableMessage(t);this.messages.next(e),this.messageCallback(e)}serviceReadyCheck(t){return!!this.ready.value||(this.messages.next(new y.WarningMessage("Call to "+t+" ignored. Service Not Ready")),!1)}checkWebRTCSupport(){navigator.getUserMedia||this.sendServiceUnavailableMessage("Error: WEBRTC NOT SUPPORTED")}initOnlineStatusUpdateMessages(){new p.OnlineStatusService(this.messages,()=>{this.messages.next(new y.ConnectionLostMessage(b.PublishSubscribeState.DISCONNECTED)),this.endSession()})}initPromMetricsListener(){const t=new g.Prom(this.options.url);this.internalMessages$.filter(t=>"prom"===t.faceMeMessageType).subscribe(e=>{t.handleMessage(e.promMsg)})}initImageContentSecurityViolationListener(){const t=(new a.MediaUtils).getMediaApiUrl(this.options.url);document.addEventListener("securitypolicyviolation",e=>{console.debug("Handling securitypolicyviolation event",e),e.violatedDirective&&"img-src"===e.violatedDirective&&e.blockedURI&&e.blockedURI.includes(t)&&(console.error("Session was unable to start because the UneeQ watermark was not allowed to load. Please add img-src "+t.replace("https://","")+" to your Content Security Policy."),this.endSession())})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaUtils=void 0;e.MediaUtils=class{constructor(){}getMediaApiUrl(t){return t.replace("api","media")}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.PublishSubscribeState=void 0,function(t){t.DISCONNECTED="DISCONNECTED",t.CONNECTING="CONNECTING",t.CONNECTED="CONNECTED",t.FAILED="FAILED"}(e.PublishSubscribeState||(e.PublishSubscribeState={}))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SourceApp=void 0,function(t){t.HOSTED_EXPERIENCE="HOSTED_EXPERIENCE",t.SHOWCASE="SHOWCASE",t.SPLIT_SCREEN="SPLIT_SCREEN",t.INTERACTIONS="INTERACTIONS",t.UNKNOWN="UNKNOWN"}(e.SourceApp||(e.SourceApp={}))},function(t,e,n){"use strict";(function(e,r){var i;t.exports=x,x.ReadableState=S;n(88).EventEmitter;var V=function(t,e){return t.listeners(e).length},o=n(89),s=n(42).Buffer,a=e.Uint8Array||function(){};var c,u=n(126);c=u&&u.debuglog?u.debuglog("stream"):function(){};var h,l,f,d=n(127),p=n(90),g=n(91).getHighWaterMark,v=n(43).codes,y=v.ERR_INVALID_ARG_TYPE,m=v.ERR_STREAM_PUSH_AFTER_EOF,b=v.ERR_METHOD_NOT_IMPLEMENTED,_=v.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;n(59)(x,o);var w=p.errorOrDestroy,A=["error","close","destroy","pause","resume"];function S(t,e,r){i=i||n(44),t=t||{},"boolean"!=typeof r&&(r=e instanceof i),this.objectMode=!!t.objectMode,r&&(this.objectMode=this.objectMode||!!t.readableObjectMode),this.highWaterMark=g(this,t,"readableHighWaterMark",r),this.buffer=new d,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.destroyed=!1,this.defaultEncoding=t.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,t.encoding&&(h||(h=n(93).StringDecoder),this.decoder=new h(t.encoding),this.encoding=t.encoding)}function x(t){if(i=i||n(44),!(this instanceof x))return new x(t);var e=this instanceof i;this._readableState=new S(t,this,e),this.readable=!0,t&&("function"==typeof t.read&&(this._read=t.read),"function"==typeof t.destroy&&(this._destroy=t.destroy)),o.call(this)}function C(t,e,n,r,i){c("readableAddChunk",e);var V,o=t._readableState;if(null===e)o.reading=!1,function(t,e){if(c("onEofChunk"),e.ended)return;if(e.decoder){var n=e.decoder.end();n&&n.length&&(e.buffer.push(n),e.length+=e.objectMode?1:n.length)}e.ended=!0,e.sync?M(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,O(t)))}(t,o);else if(i||(V=function(t,e){var n;r=e,s.isBuffer(r)||r instanceof a||"string"==typeof e||void 0===e||t.objectMode||(n=new y("chunk",["string","Buffer","Uint8Array"],e));var r;return n}(o,e)),V)w(t,V);else if(o.objectMode||e&&e.length>0)if("string"==typeof e||o.objectMode||Object.getPrototypeOf(e)===s.prototype||(e=function(t){return s.from(t)}(e)),r)o.endEmitted?w(t,new _):T(t,o,e,!0);else if(o.ended)w(t,new m);else{if(o.destroyed)return!1;o.reading=!1,o.decoder&&!n?(e=o.decoder.write(e),o.objectMode||0!==e.length?T(t,o,e,!1):P(t,o)):T(t,o,e,!1)}else r||(o.reading=!1,P(t,o));return!o.ended&&(o.length<o.highWaterMark||0===o.length)}function T(t,e,n,r){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",n)):(e.length+=e.objectMode?1:n.length,r?e.buffer.unshift(n):e.buffer.push(n),e.needReadable&&M(t)),P(t,e)}Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),x.prototype.destroy=p.destroy,x.prototype._undestroy=p.undestroy,x.prototype._destroy=function(t,e){e(t)},x.prototype.push=function(t,e){var n,r=this._readableState;return r.objectMode?n=!0:"string"==typeof t&&((e=e||r.defaultEncoding)!==r.encoding&&(t=s.from(t,e),e=""),n=!0),C(this,t,e,!1,n)},x.prototype.unshift=function(t){return C(this,t,null,!0,!1)},x.prototype.isPaused=function(){return!1===this._readableState.flowing},x.prototype.setEncoding=function(t){h||(h=n(93).StringDecoder);var e=new h(t);this._readableState.decoder=e,this._readableState.encoding=this._readableState.decoder.encoding;for(var r=this._readableState.buffer.head,i="";null!==r;)i+=e.write(r.data),r=r.next;return this._readableState.buffer.clear(),""!==i&&this._readableState.buffer.push(i),this._readableState.length=i.length,this};var E=1073741824;function R(t,e){return t<=0||0===e.length&&e.ended?0:e.objectMode?1:t!=t?e.flowing&&e.length?e.buffer.head.data.length:e.length:(t>e.highWaterMark&&(e.highWaterMark=function(t){return t>=E?t=E:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function M(t){var e=t._readableState;c("emitReadable",e.needReadable,e.emittedReadable),e.needReadable=!1,e.emittedReadable||(c("emitReadable",e.flowing),e.emittedReadable=!0,r.nextTick(O,t))}function O(t){var e=t._readableState;c("emitReadable_",e.destroyed,e.length,e.ended),e.destroyed||!e.length&&!e.ended||(t.emit("readable"),e.emittedReadable=!1),e.needReadable=!e.flowing&&!e.ended&&e.length<=e.highWaterMark,j(t)}function P(t,e){e.readingMore||(e.readingMore=!0,r.nextTick(k,t,e))}function k(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var n=e.length;if(c("maybeReadMore read 0"),t.read(0),n===e.length)break}e.readingMore=!1}function D(t){var e=t._readableState;e.readableListening=t.listenerCount("readable")>0,e.resumeScheduled&&!e.paused?e.flowing=!0:t.listenerCount("data")>0&&t.resume()}function I(t){c("readable nexttick read 0"),t.read(0)}function N(t,e){c("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),j(t),e.flowing&&!e.reading&&t.read(0)}function j(t){var e=t._readableState;for(c("flow",e.flowing);e.flowing&&null!==t.read(););}function L(t,e){return 0===e.length?null:(e.objectMode?n=e.buffer.shift():!t||t>=e.length?(n=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):n=e.buffer.consume(t,e.decoder),n);var n}function U(t){var e=t._readableState;c("endReadable",e.endEmitted),e.endEmitted||(e.ended=!0,r.nextTick(F,e,t))}function F(t,e){if(c("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var n=e._writableState;(!n||n.autoDestroy&&n.finished)&&e.destroy()}}function B(t,e){for(var n=0,r=t.length;n<r;n++)if(t[n]===e)return n;return-1}x.prototype.read=function(t){c("read",t),t=parseInt(t,10);var e=this._readableState,n=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return c("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?U(this):M(this),null;if(0===(t=R(t,e))&&e.ended)return 0===e.length&&U(this),null;var r,i=e.needReadable;return c("need readable",i),(0===e.length||e.length-t<e.highWaterMark)&&c("length less than watermark",i=!0),e.ended||e.reading?c("reading or ended",i=!1):i&&(c("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=R(n,e))),null===(r=t>0?L(t,e):null)?(e.needReadable=e.length<=e.highWaterMark,t=0):(e.length-=t,e.awaitDrain=0),0===e.length&&(e.ended||(e.needReadable=!0),n!==t&&e.ended&&U(this)),null!==r&&this.emit("data",r),r},x.prototype._read=function(t){w(this,new b("_read()"))},x.prototype.pipe=function(t,e){var n=this,i=this._readableState;switch(i.pipesCount){case 0:i.pipes=t;break;case 1:i.pipes=[i.pipes,t];break;default:i.pipes.push(t)}i.pipesCount+=1,c("pipe count=%d opts=%j",i.pipesCount,e);var o=(!e||!1!==e.end)&&t!==r.stdout&&t!==r.stderr?a:g;function s(e,r){c("onunpipe"),e===n&&r&&!1===r.hasUnpiped&&(r.hasUnpiped=!0,c("cleanup"),t.removeListener("close",d),t.removeListener("finish",p),t.removeListener("drain",u),t.removeListener("error",f),t.removeListener("unpipe",s),n.removeListener("end",a),n.removeListener("end",g),n.removeListener("data",l),h=!0,!i.awaitDrain||t._writableState&&!t._writableState.needDrain||u())}function a(){c("onend"),t.end()}i.endEmitted?r.nextTick(o):n.once("end",o),t.on("unpipe",s);var u=function(t){return function(){var e=t._readableState;c("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&V(t,"data")&&(e.flowing=!0,j(t))}}(n);t.on("drain",u);var h=!1;function l(e){c("ondata");var r=t.write(e);c("dest.write",r),!1===r&&((1===i.pipesCount&&i.pipes===t||i.pipesCount>1&&-1!==B(i.pipes,t))&&!h&&(c("false write response, pause",i.awaitDrain),i.awaitDrain++),n.pause())}function f(e){c("onerror",e),g(),t.removeListener("error",f),0===V(t,"error")&&w(t,e)}function d(){t.removeListener("finish",p),g()}function p(){c("onfinish"),t.removeListener("close",d),g()}function g(){c("unpipe"),n.unpipe(t)}return n.on("data",l),function(t,e,n){if("function"==typeof t.prependListener)return t.prependListener(e,n);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(n):t._events[e]=[n,t._events[e]]:t.on(e,n)}(t,"error",f),t.once("close",d),t.once("finish",p),t.emit("pipe",n),i.flowing||(c("pipe resume"),n.resume()),t},x.prototype.unpipe=function(t){var e=this._readableState,n={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes?this:(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,n),this);if(!t){var r=e.pipes,i=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var V=0;V<i;V++)r[V].emit("unpipe",this,{hasUnpiped:!1});return this}var o=B(e.pipes,t);return-1===o?this:(e.pipes.splice(o,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,n),this)},x.prototype.on=function(t,e){var n=o.prototype.on.call(this,t,e),i=this._readableState;return"data"===t?(i.readableListening=this.listenerCount("readable")>0,!1!==i.flowing&&this.resume()):"readable"===t&&(i.endEmitted||i.readableListening||(i.readableListening=i.needReadable=!0,i.flowing=!1,i.emittedReadable=!1,c("on readable",i.length,i.reading),i.length?M(this):i.reading||r.nextTick(I,this))),n},x.prototype.addListener=x.prototype.on,x.prototype.removeListener=function(t,e){var n=o.prototype.removeListener.call(this,t,e);return"readable"===t&&r.nextTick(D,this),n},x.prototype.removeAllListeners=function(t){var e=o.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||r.nextTick(D,this),e},x.prototype.resume=function(){var t=this._readableState;return t.flowing||(c("resume"),t.flowing=!t.readableListening,function(t,e){e.resumeScheduled||(e.resumeScheduled=!0,r.nextTick(N,t,e))}(this,t)),t.paused=!1,this},x.prototype.pause=function(){return c("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(c("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},x.prototype.wrap=function(t){var e=this,n=this._readableState,r=!1;for(var i in t.on("end",function(){if(c("wrapped end"),n.decoder&&!n.ended){var t=n.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(i){(c("wrapped data"),n.decoder&&(i=n.decoder.write(i)),n.objectMode&&null==i)||(n.objectMode||i&&i.length)&&(e.push(i)||(r=!0,t.pause()))}),t)void 0===this[i]&&"function"==typeof t[i]&&(this[i]=function(e){return function(){return t[e].apply(t,arguments)}}(i));for(var V=0;V<A.length;V++)t.on(A[V],this.emit.bind(this,A[V]));return this._read=function(e){c("wrapped _read",e),r&&(r=!1,t.resume())},this},"function"==typeof Symbol&&(x.prototype[Symbol.asyncIterator]=function(){return void 0===l&&(l=n(131)),l(this)}),Object.defineProperty(x.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(x.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(x.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),x._fromList=L,Object.defineProperty(x.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(x.from=function(t,e){return void 0===f&&(f=n(132)),f(x,t,e)})}).call(this,n(33),n(36))},function(t,e,n){"use strict";var r,i="object"==typeof Reflect?Reflect:null,V=i&&"function"==typeof i.apply?i.apply:function(t,e,n){return Function.prototype.apply.call(t,e,n)};r=i&&"function"==typeof i.ownKeys?i.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var o=Number.isNaN||function(t){return t!=t};function s(){s.init.call(this)}t.exports=s,s.EventEmitter=s,s.prototype._events=void 0,s.prototype._eventsCount=0,s.prototype._maxListeners=void 0;var a=10;function c(t){return void 0===t._maxListeners?s.defaultMaxListeners:t._maxListeners}function u(t,e,n,r){var i,V,o,s;if("function"!=typeof n)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof n);if(void 0===(V=t._events)?(V=t._events=Object.create(null),t._eventsCount=0):(void 0!==V.newListener&&(t.emit("newListener",e,n.listener?n.listener:n),V=t._events),o=V[e]),void 0===o)o=V[e]=n,++t._eventsCount;else if("function"==typeof o?o=V[e]=r?[n,o]:[o,n]:r?o.unshift(n):o.push(n),(i=c(t))>0&&o.length>i&&!o.warned){o.warned=!0;var a=new Error("Possible EventEmitter memory leak detected. "+o.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");a.name="MaxListenersExceededWarning",a.emitter=t,a.type=e,a.count=o.length,s=a,console&&console.warn&&console.warn(s)}return t}function h(){for(var t=[],e=0;e<arguments.length;e++)t.push(arguments[e]);this.fired||(this.target.removeListener(this.type,this.wrapFn),this.fired=!0,V(this.listener,this.target,t))}function l(t,e,n){var r={fired:!1,wrapFn:void 0,target:t,type:e,listener:n},i=h.bind(r);return i.listener=n,r.wrapFn=i,i}function f(t,e,n){var r=t._events;if(void 0===r)return[];var i=r[e];return void 0===i?[]:"function"==typeof i?n?[i.listener||i]:[i]:n?function(t){for(var e=new Array(t.length),n=0;n<e.length;++n)e[n]=t[n].listener||t[n];return e}(i):p(i,i.length)}function d(t){var e=this._events;if(void 0!==e){var n=e[t];if("function"==typeof n)return 1;if(void 0!==n)return n.length}return 0}function p(t,e){for(var n=new Array(e),r=0;r<e;++r)n[r]=t[r];return n}Object.defineProperty(s,"defaultMaxListeners",{enumerable:!0,get:function(){return a},set:function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");a=t}}),s.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},s.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||o(t))throw new RangeError('The value of "n" is out of range. It must be a non-negative number. Received '+t+".");return this._maxListeners=t,this},s.prototype.getMaxListeners=function(){return c(this)},s.prototype.emit=function(t){for(var e=[],n=1;n<arguments.length;n++)e.push(arguments[n]);var r="error"===t,i=this._events;if(void 0!==i)r=r&&void 0===i.error;else if(!r)return!1;if(r){var o;if(e.length>0&&(o=e[0]),o instanceof Error)throw o;var s=new Error("Unhandled error."+(o?" ("+o.message+")":""));throw s.context=o,s}var a=i[t];if(void 0===a)return!1;if("function"==typeof a)V(a,this,e);else{var c=a.length,u=p(a,c);for(n=0;n<c;++n)V(u[n],this,e)}return!0},s.prototype.addListener=function(t,e){return u(this,t,e,!1)},s.prototype.on=s.prototype.addListener,s.prototype.prependListener=function(t,e){return u(this,t,e,!0)},s.prototype.once=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.on(t,l(this,t,e)),this},s.prototype.prependOnceListener=function(t,e){if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);return this.prependListener(t,l(this,t,e)),this},s.prototype.removeListener=function(t,e){var n,r,i,V,o;if("function"!=typeof e)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof e);if(void 0===(r=this._events))return this;if(void 0===(n=r[t]))return this;if(n===e||n.listener===e)0==--this._eventsCount?this._events=Object.create(null):(delete r[t],r.removeListener&&this.emit("removeListener",t,n.listener||e));else if("function"!=typeof n){for(i=-1,V=n.length-1;V>=0;V--)if(n[V]===e||n[V].listener===e){o=n[V].listener,i=V;break}if(i<0)return this;0===i?n.shift():function(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}(n,i),1===n.length&&(r[t]=n[0]),void 0!==r.removeListener&&this.emit("removeListener",t,o||e)}return this},s.prototype.off=s.prototype.removeListener,s.prototype.removeAllListeners=function(t){var e,n,r;if(void 0===(n=this._events))return this;if(void 0===n.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==n[t]&&(0==--this._eventsCount?this._events=Object.create(null):delete n[t]),this;if(0===arguments.length){var i,V=Object.keys(n);for(r=0;r<V.length;++r)"removeListener"!==(i=V[r])&&this.removeAllListeners(i);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=n[t]))this.removeListener(t,e);else if(void 0!==e)for(r=e.length-1;r>=0;r--)this.removeListener(t,e[r]);return this},s.prototype.listeners=function(t){return f(this,t,!0)},s.prototype.rawListeners=function(t){return f(this,t,!1)},s.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):d.call(t,e)},s.prototype.listenerCount=d,s.prototype.eventNames=function(){return this._eventsCount>0?r(this._events):[]}},function(t,e,n){t.exports=n(88).EventEmitter},function(t,e,n){"use strict";(function(e){function n(t,e){i(t,e),r(t)}function r(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(t,e){t.emit("error",e)}t.exports={destroy:function(t,V){var o=this,s=this._readableState&&this._readableState.destroyed,a=this._writableState&&this._writableState.destroyed;return s||a?(V?V(t):t&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,e.nextTick(i,this,t)):e.nextTick(i,this,t)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(t||null,function(t){!V&&t?o._writableState?o._writableState.errorEmitted?e.nextTick(r,o):(o._writableState.errorEmitted=!0,e.nextTick(n,o,t)):e.nextTick(n,o,t):V?(e.nextTick(r,o),V(t)):e.nextTick(r,o)}),this)},undestroy:function(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)},errorOrDestroy:function(t,e){var n=t._readableState,r=t._writableState;n&&n.autoDestroy||r&&r.autoDestroy?t.destroy(e):t.emit("error",e)}}}).call(this,n(36))},function(t,e,n){"use strict";var r=n(43).codes.ERR_INVALID_OPT_VALUE;t.exports={getHighWaterMark:function(t,e,n,i){var V=function(t,e,n){return null!=t.highWaterMark?t.highWaterMark:e?t[n]:null}(e,i,n);if(null!=V){if(!isFinite(V)||Math.floor(V)!==V||V<0)throw new r(i?n:"highWaterMark",V);return Math.floor(V)}return t.objectMode?16:16384}}},function(t,e,n){"use strict";(function(e,r){function i(t){var e=this;this.next=null,this.entry=null,this.finish=function(){!function(t,e,n){var r=t.entry;t.entry=null;for(;r;){var i=r.callback;e.pendingcb--,i(n),r=r.next}e.corkedRequestsFree.next=t}(e,t)}}var V;t.exports=x,x.WritableState=S;var o={deprecate:n(129)},s=n(89),a=n(42).Buffer,c=e.Uint8Array||function(){};var u,h=n(90),l=n(91).getHighWaterMark,f=n(43).codes,d=f.ERR_INVALID_ARG_TYPE,p=f.ERR_METHOD_NOT_IMPLEMENTED,g=f.ERR_MULTIPLE_CALLBACK,v=f.ERR_STREAM_CANNOT_PIPE,y=f.ERR_STREAM_DESTROYED,m=f.ERR_STREAM_NULL_VALUES,b=f.ERR_STREAM_WRITE_AFTER_END,_=f.ERR_UNKNOWN_ENCODING,w=h.errorOrDestroy;function A(){}function S(t,e,o){V=V||n(44),t=t||{},"boolean"!=typeof o&&(o=e instanceof V),this.objectMode=!!t.objectMode,o&&(this.objectMode=this.objectMode||!!t.writableObjectMode),this.highWaterMark=l(this,t,"writableHighWaterMark",o),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===t.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=t.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){!function(t,e){var n=t._writableState,i=n.sync,V=n.writecb;if("function"!=typeof V)throw new g;if(function(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}(n),e)!function(t,e,n,i,V){--e.pendingcb,n?(r.nextTick(V,i),r.nextTick(O,t,e),t._writableState.errorEmitted=!0,w(t,i)):(V(i),t._writableState.errorEmitted=!0,w(t,i),O(t,e))}(t,n,i,e,V);else{var o=R(n)||t.destroyed;o||n.corked||n.bufferProcessing||!n.bufferedRequest||E(t,n),i?r.nextTick(T,t,n,o,V):T(t,n,o,V)}}(e,t)},this.writecb=null,this.writelen=0,this.bufferedRequest=null,this.lastBufferedRequest=null,this.pendingcb=0,this.prefinished=!1,this.errorEmitted=!1,this.emitClose=!1!==t.emitClose,this.autoDestroy=!!t.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new i(this)}function x(t){var e=this instanceof(V=V||n(44));if(!e&&!u.call(x,this))return new x(t);this._writableState=new S(t,this,e),this.writable=!0,t&&("function"==typeof t.write&&(this._write=t.write),"function"==typeof t.writev&&(this._writev=t.writev),"function"==typeof t.destroy&&(this._destroy=t.destroy),"function"==typeof t.final&&(this._final=t.final)),s.call(this)}function C(t,e,n,r,i,V,o){e.writelen=r,e.writecb=o,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new y("write")):n?t._writev(i,e.onwrite):t._write(i,V,e.onwrite),e.sync=!1}function T(t,e,n,r){n||function(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}(t,e),e.pendingcb--,r(),O(t,e)}function E(t,e){e.bufferProcessing=!0;var n=e.bufferedRequest;if(t._writev&&n&&n.next){var r=e.bufferedRequestCount,V=new Array(r),o=e.corkedRequestsFree;o.entry=n;for(var s=0,a=!0;n;)V[s]=n,n.isBuf||(a=!1),n=n.next,s+=1;V.allBuffers=a,C(t,e,!0,e.length,V,"",o.finish),e.pendingcb++,e.lastBufferedRequest=null,o.next?(e.corkedRequestsFree=o.next,o.next=null):e.corkedRequestsFree=new i(e),e.bufferedRequestCount=0}else{for(;n;){var c=n.chunk,u=n.encoding,h=n.callback;if(C(t,e,!1,e.objectMode?1:c.length,c,u,h),n=n.next,e.bufferedRequestCount--,e.writing)break}null===n&&(e.lastBufferedRequest=null)}e.bufferedRequest=n,e.bufferProcessing=!1}function R(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function M(t,e){t._final(function(n){e.pendingcb--,n&&w(t,n),e.prefinished=!0,t.emit("prefinish"),O(t,e)})}function O(t,e){var n=R(e);if(n&&(function(t,e){e.prefinished||e.finalCalled||("function"!=typeof t._final||e.destroyed?(e.prefinished=!0,t.emit("prefinish")):(e.pendingcb++,e.finalCalled=!0,r.nextTick(M,t,e)))}(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var i=t._readableState;(!i||i.autoDestroy&&i.endEmitted)&&t.destroy()}return n}n(59)(x,s),S.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(S.prototype,"buffer",{get:o.deprecate(function(){return this.getBuffer()},"_writableState.buffer is deprecated. Use _writableState.getBuffer instead.","DEP0003")})}catch(t){}}(),"function"==typeof Symbol&&Symbol.hasInstance&&"function"==typeof Function.prototype[Symbol.hasInstance]?(u=Function.prototype[Symbol.hasInstance],Object.defineProperty(x,Symbol.hasInstance,{value:function(t){return!!u.call(this,t)||this===x&&(t&&t._writableState instanceof S)}})):u=function(t){return t instanceof this},x.prototype.pipe=function(){w(this,new v)},x.prototype.write=function(t,e,n){var i,V=this._writableState,o=!1,s=!V.objectMode&&(i=t,a.isBuffer(i)||i instanceof c);return s&&!a.isBuffer(t)&&(t=function(t){return a.from(t)}(t)),"function"==typeof e&&(n=e,e=null),s?e="buffer":e||(e=V.defaultEncoding),"function"!=typeof n&&(n=A),V.ending?function(t,e){var n=new b;w(t,n),r.nextTick(e,n)}(this,n):(s||function(t,e,n,i){var V;return null===n?V=new m:"string"==typeof n||e.objectMode||(V=new d("chunk",["string","Buffer"],n)),!V||(w(t,V),r.nextTick(i,V),!1)}(this,V,t,n))&&(V.pendingcb++,o=function(t,e,n,r,i,V){if(!n){var o=function(t,e,n){t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=a.from(e,n));return e}(e,r,i);r!==o&&(n=!0,i="buffer",r=o)}var s=e.objectMode?1:r.length;e.length+=s;var c=e.length<e.highWaterMark;c||(e.needDrain=!0);if(e.writing||e.corked){var u=e.lastBufferedRequest;e.lastBufferedRequest={chunk:r,encoding:i,isBuf:n,callback:V,next:null},u?u.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,s,r,i,V);return c}(this,V,s,t,e,n)),o},x.prototype.cork=function(){this._writableState.corked++},x.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||E(this,t))},x.prototype.setDefaultEncoding=function(t){if("string"==typeof t&&(t=t.toLowerCase()),!(["hex","utf8","utf-8","ascii","binary","base64","ucs2","ucs-2","utf16le","utf-16le","raw"].indexOf((t+"").toLowerCase())>-1))throw new _(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(x.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(x.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),x.prototype._write=function(t,e,n){n(new p("_write()"))},x.prototype._writev=null,x.prototype.end=function(t,e,n){var i=this._writableState;return"function"==typeof t?(n=t,t=null,e=null):"function"==typeof e&&(n=e,e=null),null!=t&&this.write(t,e),i.corked&&(i.corked=1,this.uncork()),i.ending||function(t,e,n){e.ending=!0,O(t,e),n&&(e.finished?r.nextTick(n):t.once("finish",n));e.ended=!0,t.writable=!1}(this,i,n),this},Object.defineProperty(x.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(x.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),x.prototype.destroy=h.destroy,x.prototype._undestroy=h.undestroy,x.prototype._destroy=function(t,e){e(t)}}).call(this,n(33),n(36))},function(t,e,n){"use strict";var r=n(130).Buffer,i=r.isEncoding||function(t){switch((t=""+t)&&t.toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":case"raw":return!0;default:return!1}};function V(t){var e;switch(this.encoding=function(t){var e=function(t){if(!t)return"utf8";for(var e;;)switch(t){case"utf8":case"utf-8":return"utf8";case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return"utf16le";case"latin1":case"binary":return"latin1";case"base64":case"ascii":case"hex":return t;default:if(e)return;t=(""+t).toLowerCase(),e=!0}}(t);if("string"!=typeof e&&(r.isEncoding===i||!i(t)))throw new Error("Unknown encoding: "+t);return e||t}(t),this.encoding){case"utf16le":this.text=a,this.end=c,e=4;break;case"utf8":this.fillLast=s,e=4;break;case"base64":this.text=u,this.end=h,e=3;break;default:return this.write=l,void(this.end=f)}this.lastNeed=0,this.lastTotal=0,this.lastChar=r.allocUnsafe(e)}function o(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function s(t){var e=this.lastTotal-this.lastNeed,n=function(t,e,n){if(128!=(192&e[0]))return t.lastNeed=0,"�";if(t.lastNeed>1&&e.length>1){if(128!=(192&e[1]))return t.lastNeed=1,"�";if(t.lastNeed>2&&e.length>2&&128!=(192&e[2]))return t.lastNeed=2,"�"}}(this,t);return void 0!==n?n:this.lastNeed<=t.length?(t.copy(this.lastChar,e,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal)):(t.copy(this.lastChar,e,0,t.length),void(this.lastNeed-=t.length))}function a(t,e){if((t.length-e)%2==0){var n=t.toString("utf16le",e);if(n){var r=n.charCodeAt(n.length-1);if(r>=55296&&r<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],n.slice(0,-1)}return n}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function c(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var n=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,n)}return e}function u(t,e){var n=(t.length-e)%3;return 0===n?t.toString("base64",e):(this.lastNeed=3-n,this.lastTotal=3,1===n?this.lastChar[0]=t[t.length-1]:(this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1]),t.toString("base64",e,t.length-n))}function h(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function l(t){return t.toString(this.encoding)}function f(t){return t&&t.length?this.write(t):""}e.StringDecoder=V,V.prototype.write=function(t){if(0===t.length)return"";var e,n;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";n=this.lastNeed,this.lastNeed=0}else n=0;return n<t.length?e?e+this.text(t,n):this.text(t,n):e||""},V.prototype.end=function(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e},V.prototype.text=function(t,e){var n=function(t,e,n){var r=e.length-1;if(r<n)return 0;var i=o(e[r]);if(i>=0)return i>0&&(t.lastNeed=i-1),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(t.lastNeed=i-2),i;if(--r<n||-2===i)return 0;if((i=o(e[r]))>=0)return i>0&&(2===i?i=0:t.lastNeed=i-3),i;return 0}(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=n;var r=t.length-(n-this.lastNeed);return t.copy(this.lastChar,0,r),t.toString("utf8",e,r)},V.prototype.fillLast=function(t){if(this.lastNeed<=t.length)return t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,this.lastNeed),this.lastChar.toString(this.encoding,0,this.lastTotal);t.copy(this.lastChar,this.lastTotal-this.lastNeed,0,t.length),this.lastNeed-=t.length}},function(t,e,n){"use strict";t.exports=u;var r=n(43).codes,i=r.ERR_METHOD_NOT_IMPLEMENTED,V=r.ERR_MULTIPLE_CALLBACK,o=r.ERR_TRANSFORM_ALREADY_TRANSFORMING,s=r.ERR_TRANSFORM_WITH_LENGTH_0,a=n(44);function c(t,e){var n=this._transformState;n.transforming=!1;var r=n.writecb;if(null===r)return this.emit("error",new V);n.writechunk=null,n.writecb=null,null!=e&&this.push(e),r(t);var i=this._readableState;i.reading=!1,(i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}function u(t){if(!(this instanceof u))return new u(t);a.call(this,t),this._transformState={afterTransform:c.bind(this),needTransform:!1,transforming:!1,writecb:null,writechunk:null,writeencoding:null},this._readableState.needReadable=!0,this._readableState.sync=!1,t&&("function"==typeof t.transform&&(this._transform=t.transform),"function"==typeof t.flush&&(this._flush=t.flush)),this.on("prefinish",h)}function h(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?l(this,null,null):this._flush(function(e,n){l(t,e,n)})}function l(t,e,n){if(e)return t.emit("error",e);if(null!=n&&t.push(n),t._writableState.length)throw new s;if(t._transformState.transforming)throw new o;return t.push(null)}n(59)(u,a),u.prototype.push=function(t,e){return this._transformState.needTransform=!1,a.prototype.push.call(this,t,e)},u.prototype._transform=function(t,e,n){n(new i("_transform()"))},u.prototype._write=function(t,e,n){var r=this._transformState;if(r.writecb=n,r.writechunk=t,r.writeencoding=e,!r.transforming){var i=this._readableState;(r.needTransform||i.needReadable||i.length<i.highWaterMark)&&this._read(i.highWaterMark)}},u.prototype._read=function(t){var e=this._transformState;null===e.writechunk||e.transforming?e.needTransform=!0:(e.transforming=!0,this._transform(e.writechunk,e.writeencoding,e.afterTransform))},u.prototype._destroy=function(t,e){a.prototype._destroy.call(this,t,function(t){e(t)})}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Counter=void 0;var r=n(96);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,s(e).apply(this,arguments))}var n,i,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,r.Collector),n=e,(i=[{key:"inc",value:function(t){return this.add(1,t),this}},{key:"add",value:function(t,e){if(t<0)throw new Error("Expected increment amount to be greater than -1. Received: ".concat(t));var n=this.get(e);return this.set(n?n.value+t:t,e),this}},{key:"reset",value:function(t){this.set(0,t)}}])&&V(n.prototype,i),c&&V(n,c),e}();e.Counter=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Collector=void 0;var r=n(62),i=n(97);function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data=[]}var e,n,o;return e=t,(n=[{key:"get",value:function(t){return(0,i.findExistingMetric)(t,this.data)}},{key:"set",value:function(t,e){var n=(0,i.findExistingMetric)(e,this.data);return n?n.value=t:this.data.push({labels:e,value:t}),this}},{key:"collect",value:function(t){return(0,r.filter)(this.data,function(e){return(0,r.matches)(t)(e.labels)})}},{key:"resetAll",value:function(){var t=this;return(0,r.each)(this.data,function(e){t.reset(e.labels)}),this}}])&&V(e.prototype,n),o&&V(e,o),t}();e.Collector=o},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.formatHistogramOrSummary=function(t,e){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"le",i="",V=function(t){var e=(0,r.map)(t.labels,function(t,e){return"".concat(e,'="').concat(t,'"')});return 0===e.length?"":"".concat(e.join(","))}(e);V.length>0?(i+="".concat(t,"_count{").concat(V,"} ").concat(e.value.count,"\n"),i+="".concat(t,"_sum{").concat(V,"} ").concat(e.value.sum,"\n")):(i+="".concat(t,"_count ").concat(e.value.count,"\n"),i+="".concat(t,"_sum ").concat(e.value.sum,"\n"));return(0,r.reduce)(e.value.entries,function(e,r,o){return V.length>0?i+="".concat(t,"_bucket{").concat(n,'="').concat(o,'",').concat(V,"} ").concat(r,"\n"):i+="".concat(t,"_bucket{").concat(n,'="').concat(o,'"} ').concat(r,"\n"),i},i)},e.findExistingMetric=function(t){var e=arguments.length>1&&void 0!==arguments[1]?arguments[1]:[];if(!t)return e[0];return(0,r.find)(e,function(e){return(0,r.isEqual)(e.labels,t)})},e.formatCounterOrGauge=function(t,e){var n=" ".concat(e.value.toString());if(null==e.labels||0===Object.keys(e.labels).length)return"".concat(t).concat(n,"\n");var i=(0,r.map)(e.labels,function(t,e){return"".concat(e,'="').concat(t,'"')});return"".concat(t,"{").concat(i.join(","),"}").concat(n,"\n")};var r=n(62)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=void 0,function(t){t[t.DISCONNECTED=0]="DISCONNECTED",t[t.CONNECTING=1]="CONNECTING",t[t.CONNECTED=2]="CONNECTED"}(e.MessagingState||(e.MessagingState={}))},function(t,e,n){"use strict";var r;Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceMessage=e.ClientMediaStreamUpdateMessage=e.OnlineStatusUpdateMessage=e.SessionInfoMessage=e.AvatarRequestIgnored=e.AvatarRequestCompleted=e.SessionErrorMessage=e.WebRtcStatsMessage=e.WebRtcDataMessage=e.SessionLiveMessage=e.WarningMessage=e.RecordingStoppedMessage=e.RecordingStartedMessage=e.DevicePermissionAllowedMessage=e.AvatarTextInputFinishedMessage=e.FinishedSpeakingMessage=e.StartedSpeakingMessage=e.AvatarQuestionMessage=e.InstructionsMessage=e.AvatarAnswerContentMessage=e.AvatarAnswerMessage=e.ConnectionLostMessage=e.MicActivityNotSupportedMessage=e.MicActivityMessage=e.MicActivityErrorMessage=e.ServiceUnavailableMessage=e.AvatarUnavailableMessage=e.AvatarAvailableMessage=e.SessionEndedMessage=e.SessionResumedMessage=e.SessionPausedMessage=e.DeviceListUpdatedMessage=e.DeviceErrorMessage=e.SetSpeakerSuccessMessage=e.SetMicSuccessMessage=e.SetCameraSuccessMessage=e.DeviceNotFoundErrorMessage=e.ReadyMessage=e.UneeqMessageType=void 0,function(t){t.Ready="Ready",t.DeviceNotFoundError="DeviceNotFoundError",t.SetCameraSuccess="SetCameraSuccess",t.SetMicSuccess="SetMicSuccess",t.SetSpeakerSuccess="SetSpeakerSuccess",t.SessionPaused="SessionPaused",t.SessionResumed="SessionResumed",t.SessionEnded="SessionEnded",t.AvatarAvailable="AvatarAvailable",t.AvatarUnavailable="AvatarUnavailable",t.ConnectionLost="ConnectionLost",t.ServiceUnavailable="ServiceUnavailable",t.OnlineStatusUpdate="OnlineStatusUpdate",t.MicActivityNotSupported="MicActivityNotSupported",t.MicActivityError="MicActivityError",t.MicActivity="MicActivity",t.DeviceError="DeviceError",t.DeviceListUpdated="DeviceListUpdated",t.AvatarAnswer="AvatarAnswer",t.AvatarAnswerContent="AvatarAnswerContent",t.Instructions="Instructions",t.StartedSpeaking="StartedSpeaking",t.FinishedSpeaking="FinishedSpeaking",t.AvatarTextInputFinished="AvatarTextInputFinished",t.AvatarQuestionText="AvatarQuestionText",t.DevicePermissionAllowed="DevicePermissionAllowed",t.RecordingStarted="RecordingStarted",t.RecordingStopped="RecordingStopped",t.Warning="Warning",t.SessionLive="SessionLive",t.WebRtcData="WebRtcData",t.WebRtcStats="WebRtcStats",t.SessionError="SessionError",t.SessionInfo="SessionInfo",t.AvatarRequestCompleted="AvatarRequestCompleted",t.AvatarRequestIgnored="AvatarRequestIgnored",t.ClientMediaStreamUpdate="ClientMediaStreamUpdate",t.ClientPerformanceMessage="ClientPerformanceMessage"}(r=e.UneeqMessageType||(e.UneeqMessageType={}));e.ReadyMessage=class{constructor(){this.uneeqMessageType=r.Ready}};e.DeviceNotFoundErrorMessage=class{constructor(t,e){this.msg=t,this.deviceId=e,this.uneeqMessageType=r.DeviceNotFoundError}};e.SetCameraSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetCameraSuccess}};e.SetMicSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetMicSuccess}};e.SetSpeakerSuccessMessage=class{constructor(t){this.deviceId=t,this.uneeqMessageType=r.SetSpeakerSuccess}};e.DeviceErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.DeviceError}};e.DeviceListUpdatedMessage=class{constructor(t){this.devices=t,this.uneeqMessageType=r.DeviceListUpdated}};e.SessionPausedMessage=class{constructor(){this.uneeqMessageType=r.SessionPaused}};e.SessionResumedMessage=class{constructor(){this.uneeqMessageType=r.SessionResumed}};e.SessionEndedMessage=class{constructor(){this.uneeqMessageType=r.SessionEnded}};e.AvatarAvailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarAvailable}};e.AvatarUnavailableMessage=class{constructor(){this.uneeqMessageType=r.AvatarUnavailable}};e.ServiceUnavailableMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.ServiceUnavailable}};e.MicActivityErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.MicActivityError}};e.MicActivityMessage=class{constructor(t){this.level=t,this.uneeqMessageType=r.MicActivity}};e.MicActivityNotSupportedMessage=class{constructor(){this.uneeqMessageType=r.MicActivityNotSupported}};e.ConnectionLostMessage=class{constructor(t){this.connectionState=t,this.uneeqMessageType=r.ConnectionLost}};e.AvatarAnswerMessage=class{constructor(t,e,n,i){this.answer=t,this.answerAvatar=e,this.answerSpeech=n,this.transcriptId=i,this.uneeqMessageType=r.AvatarAnswer}};e.AvatarAnswerContentMessage=class{constructor(t,e,n=!1){this.content=t,this.transcriptId=e,this.hasDisplayHtml=n,this.uneeqMessageType=r.AvatarAnswerContent}};e.InstructionsMessage=class{constructor(t){this.instructions=t,this.uneeqMessageType=r.Instructions}};e.AvatarQuestionMessage=class{constructor(t,e){this.question=t,this.transcriptId=e,this.uneeqMessageType=r.AvatarQuestionText}};e.StartedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.StartedSpeaking}};e.FinishedSpeakingMessage=class{constructor(){this.uneeqMessageType=r.FinishedSpeaking}};e.AvatarTextInputFinishedMessage=class{constructor(){this.uneeqMessageType=r.AvatarTextInputFinished}};e.DevicePermissionAllowedMessage=class{constructor(){this.uneeqMessageType=r.DevicePermissionAllowed}};e.RecordingStartedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStarted}};e.RecordingStoppedMessage=class{constructor(){this.uneeqMessageType=r.RecordingStopped}};e.WarningMessage=class{constructor(t){this.msg=t,this.uneeqMessageType=r.Warning}};e.SessionLiveMessage=class{constructor(){this.uneeqMessageType=r.SessionLive}};e.WebRtcDataMessage=class{constructor(t){this.data=t,this.uneeqMessageType=r.WebRtcData}};e.WebRtcStatsMessage=class{constructor(t){this.stats=t,this.uneeqMessageType=r.WebRtcStats}};e.SessionErrorMessage=class{constructor(t){this.error=t,this.uneeqMessageType=r.SessionError}};e.AvatarRequestCompleted=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestCompleted}};e.AvatarRequestIgnored=class{constructor(t){this.reason=t,this.uneeqMessageType=r.AvatarRequestIgnored}};e.SessionInfoMessage=class{constructor(t){this.info=t,this.uneeqMessageType=r.SessionInfo}};e.OnlineStatusUpdateMessage=class{constructor(t){this.online=t,this.uneeqMessageType=r.OnlineStatusUpdate}};e.ClientMediaStreamUpdateMessage=class{constructor(t,e,n,i){this.clientStreamingAudio=t,this.clientStreamingVideo=e,this.serverStreamingAudio=n,this.serverStreamingVideo=i,this.uneeqMessageType=r.ClientMediaStreamUpdate}};e.ClientPerformanceMessage=class{constructor(t){this.clientPerformance=t,this.uneeqMessageType=r.ClientPerformanceMessage}}},function(t,e,n){(function(t){!function(t){function e(t){if("utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextEncoder': The encoding label provided ('"+t+"') is invalid.")}function n(t,e){if(e=void 0===e?{fatal:!1}:e,"utf-8"!==(t=void 0===t?"utf-8":t))throw new RangeError("Failed to construct 'TextDecoder': The encoding label provided ('"+t+"') is invalid.");if(e.fatal)throw Error("Failed to construct 'TextDecoder': the 'fatal' option is unsupported.")}if(t.TextEncoder&&t.TextDecoder)return!1;Object.defineProperty(e.prototype,"encoding",{value:"utf-8"}),e.prototype.encode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to encode: the 'stream' option is unsupported.");e=0;for(var n=t.length,r=0,i=Math.max(32,n+(n>>1)+7),V=new Uint8Array(i>>3<<3);e<n;){var o=t.charCodeAt(e++);if(55296<=o&&56319>=o){if(e<n){var s=t.charCodeAt(e);56320==(64512&s)&&(++e,o=((1023&o)<<10)+(1023&s)+65536)}if(55296<=o&&56319>=o)continue}if(r+4>V.length&&(i+=8,i=(i*=1+e/t.length*2)>>3<<3,(s=new Uint8Array(i)).set(V),V=s),0==(4294967168&o))V[r++]=o;else{if(0==(4294965248&o))V[r++]=o>>6&31|192;else if(0==(4294901760&o))V[r++]=o>>12&15|224,V[r++]=o>>6&63|128;else{if(0!=(4292870144&o))continue;V[r++]=o>>18&7|240,V[r++]=o>>12&63|128,V[r++]=o>>6&63|128}V[r++]=63&o|128}}return V.slice(0,r)},Object.defineProperty(n.prototype,"encoding",{value:"utf-8"}),Object.defineProperty(n.prototype,"fatal",{value:!1}),Object.defineProperty(n.prototype,"ignoreBOM",{value:!1}),n.prototype.decode=function(t,e){if((e=void 0===e?{stream:!1}:e).stream)throw Error("Failed to decode: the 'stream' option is unsupported.");e=0;for(var n=(t=new Uint8Array(t)).length,r=[];e<n;){var i=t[e++];if(0===i)break;if(0==(128&i))r.push(i);else if(192==(224&i)){var V=63&t[e++];r.push((31&i)<<6|V)}else if(224==(240&i)){V=63&t[e++];var o=63&t[e++];r.push((31&i)<<12|V<<6|o)}else if(240==(248&i)){65535<(i=(7&i)<<18|(V=63&t[e++])<<12|(o=63&t[e++])<<6|63&t[e++])&&(i-=65536,r.push(i>>>10&1023|55296),i=56320|1023&i),r.push(i)}}return String.fromCharCode.apply(null,r)},t.TextEncoder=e,t.TextDecoder=n}("undefined"!=typeof window?window:void 0!==t?t:this)}).call(this,n(33))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),n(102)},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45),i=n(103);r.Observable.prototype.filter=i.filter},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(80);e.filter=function(t,e){return r.filter(t,e)(this)}},function(t){t.exports=JSON.parse('{"name":"uneeq-js","version":"2.40.0","description":"","main":"dist/index.js","types":"dist/src/index.d.ts","scripts":{"start":"npx webpack -w","test-local":"./node_modules/karma/bin/karma start karma.conf.js -logLevel=DEBUG","test":"./node_modules/karma/bin/karma start --browsers ChromeHeadless --single-run","build":"webpack --config webpack.config.prod.js && webpack --config webpack.config.umd.js","lint":"./node_modules/tslint/bin/tslint -p tsconfig.json --fix","docs":"./node_modules/typedoc/bin/typedoc --options"},"files":["dist","!dist/test"],"author":"","license":"ISC","dependencies":{"@stomp/stompjs":"^6.0.0","@uehreka/seriously":"^1.0.1","fast-text-encoding":"^1.0.0","intrinsic-scale":"^3.0.4","promjs":"^0.4.1","rxjs":"^6.2.2","rxjs-compat":"^6.3.2","simple-peer":"9.11.0","webrtc-adapter":"8.1.0"},"devDependencies":{"@types/jasmine":"^2.8.8","@types/node":"^10.9.4","fetch-mock":"7.7.3","ignore-styles":"^5.0.1","jasmine":"^3.2.0","jasmine-class-mock":"^1.0.1","jasmine-core":"^3.3.0","karma":"^5.0.0","karma-chrome-launcher":"^2.2.0","karma-firefox-launcher":"^1.1.0","karma-jasmine":"^2.0.1","karma-jasmine-html-reporter":"^1.4.0","karma-requirejs":"^1.1.0","karma-safari-launcher":"^1.0.0","karma-typescript":"^5.0.0","karma-typescript-es6-transform":"^5.0.0","nock":"^9.6.1","requirejs":"^2.3.6","ts-loader":"^5.0.0","ts-node":"^7.0.1","tslint":"^5.11.0","tslint-no-focused-test":"^0.5.0","typedoc":"^0.18.0","typescript":"^3.9.7","webpack":"^4.17.1","webpack-cli":"^3.1.0"}}')},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.API=void 0;e.API=class{constructor(t,e="",n=(()=>{})){this.xAuthToken="",this.apiUrl=t,this.apiKey=e,this.loggedOutHandler=n}set callId(t){this._callId=t}get authToken(){return this.xAuthToken}startSession(t){return this.postRequest("/api/v1/customers/",t,{},{"faceme-api-key":this.apiKey})}endCall(){return this.postRequest("/api/v1/calls/"+this._callId+"/endCall")}avatarStart(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/start",t)}avatarWelcome(){return this.postRequest("/api/v1/avatar/"+this._callId+"/welcome")}avatarAsk(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/ask",{text:t})}avatarStartRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/start")}avatarStopRecording(){return this.postRequest("/api/v1/avatar/"+this._callId+"/audioCapture/stop")}avatarStopSpeaking(){return this.postRequest("/api/v1/avatar/"+this._callId+"/stopSpeaking")}getAvailableAvatarCount(){return this.getRequest("/api/v1/avatar/"+this._callId+"/available")}startSessionWithToken(t){return this.postRequest("/api/v2/clients/start-session",t,{},{"x-timezone-name":this.getTimeZone()})}setAvatarDebug(t){return this.putRequest("/api/v1/avatar/"+this._callId+"/debug",{enabled:t})}sendMediaUnavailable(t){return this.postRequest("/api/v1/avatar/"+this._callId+"/media/unavailable-update",t)}getEdgeNodeId(t){let e=t.replace("turn:","http://");e=e.replace("turns:","https://");const n=new Request(e,{method:"GET"});return this.makeRequest(n)}getTimeZone(){return Intl.DateTimeFormat().resolvedOptions().timeZone}makeRequest(t){return r(this,void 0,void 0,function*(){const e=yield fetch(t);if(!e.ok){401===e.status&&this.loggedOutHandler();const t=yield e.json();throw{status:e.status,body:t}}return 204===e.status?new Promise((t,e)=>{t()}):(this.xAuthToken=e.headers.get("x-auth-token")||this.xAuthToken,yield e.json())})}getRequest(t){const e=new Request(this.apiUrl+t,{method:"GET",credentials:"omit",headers:{"x-auth-token":this.xAuthToken}});return this.makeRequest(e)}postRequest(t,e={},n={},r={}){const i={method:"POST",credentials:"omit",headers:Object.assign({"Content-Type":"application/json","x-auth-token":this.xAuthToken},r),body:JSON.stringify(e)},V=new Request(this.apiUrl+t,Object.assign(i,n));return this.makeRequest(V)}putRequest(t,e={},n={}){const r={method:"PUT",credentials:"omit",headers:{"Content-Type":"application/json","x-auth-token":this.xAuthToken},body:JSON.stringify(e)},i=new Request(this.apiUrl+t,Object.assign(r,n));return this.makeRequest(i)}}},function(t,e,n){"use strict";var r=this&&this.__awaiter||function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};Object.defineProperty(e,"__esModule",{value:!0}),e.DeviceManager=void 0;const i=n(35),V=n(107);e.DeviceManager=class{constructor(t,e){this.options=t,this.api=e,this.speakerConstraints={},this.publishStream=new MediaStream,this.devices={audioInput:[],audioOutput:[],videoInput:[]},this.previousMediaOptions={},this.mediaHandler=new V.MediaHandler(this.options,()=>this.remoteVideoReady()),this.initMediaConstraints(),this.getDevices(!1)}set edgeNodeId(t){this.mediaHandler.setEdgeNodeId(t),this.getDevices(!0)}enableLocalDevices(t,e){const n=this.options.uneeqOptions.sendLocalVideo!==t,r=this.options.uneeqOptions.sendLocalAudio!==e;(n||r)&&(this.previousMediaOptions={sendLocalVideo:this.options.uneeqOptions.sendLocalVideo,sendLocalAudio:this.options.uneeqOptions.sendLocalAudio},this.options.uneeqOptions.sendLocalVideo=t,this.options.uneeqOptions.sendLocalAudio=e,n&&!1===t&&this.publishStream.getVideoTracks().forEach(t=>t.stop()),r&&!1===e&&this.publishStream.getAudioTracks().forEach(t=>t.stop()),this.mediaHandler.publishingStream=!1,this.initMediaConstraints(),this.getDevices(!0))}getDevices(t=!0){if(!this.options.uneeqOptions.sendLocalVideo&&!this.options.uneeqOptions.sendLocalAudio)return void this.initStreamWithoutDevices();const e=this;this.publishStream=new MediaStream,this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),navigator.mediaDevices.getUserMedia(this.userMediaConstraints).then(e=>r(this,void 0,void 0,function*(){if(this.initDeviceList(),this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),t){if(this.options.uneeqOptions.sendLocalVideo){const t=e.getVideoTracks();t.length>0&&(this.publishStream.getVideoTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}if(this.options.uneeqOptions.sendLocalAudio){const t=e.getAudioTracks();t.length>0&&(this.publishStream.getAudioTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream.addTrack(t[0]))}this.mediaHandler.localStream$.next(this.publishStream)}})).catch(t=>{e.options.userMessages.next(new i.DeviceErrorMessage(t)),console.error("device error: ",t),this.sendMediaUnavailableInfo("NotAllowedError"===t.name),this.revertMediaOptions()})}setMicDevice(t,e=!0){const n=this.devices.audioInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredMicrophoneId=t,this.audioConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetMicSuccessMessage(t));else{const e="Uneeq setMic: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setCamDevice(t,e=!0){const n=this.devices.videoInput.filter(e=>e.deviceId===t);if(n&&n.length>0)this.options.uneeqOptions.preferredCameraId=t,this.videoConstraints.deviceId=t,e&&(this.mediaHandler.publishingStream=!1,this.getDevices(!0)),this.options.userMessages.next(new i.SetCameraSuccessMessage(t));else{const e="Uneeq setCamera: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}setAvatarSpeakerDevice(t){if(this.mediaHandler.avatarVideoElement){const e=this.devices.audioOutput.filter(e=>e.deviceId===t);if(e&&e.length>0)this.options.uneeqOptions.preferredSpeakerId=t,this.mediaHandler.avatarVideoElement.setSinkId(t).then(()=>{this.speakerConstraints.deviceId=t,this.options.userMessages.next(new i.SetSpeakerSuccessMessage(t))}).catch(e=>{const n="Uneeq setSpeaker: Error setting device. "+e.message;this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(n,t))});else{const e="Uneeq setSpeaker: Error setting device. Device not found.";this.options.userMessages.next(new i.DeviceNotFoundErrorMessage(e,t))}}}revertMediaOptions(){this.previousMediaOptions&&(this.options.uneeqOptions.sendLocalAudio=this.previousMediaOptions.sendLocalAudio,this.options.uneeqOptions.sendLocalVideo=this.previousMediaOptions.sendLocalVideo)}initMediaConstraints(){this.audioConstraints={},this.videoConstraints={facingMode:"user",width:640,height:480},this.userMediaConstraints={audio:!!this.options.uneeqOptions.sendLocalAudio&&this.audioConstraints,video:!!this.options.uneeqOptions.sendLocalVideo&&this.videoConstraints}}initStreamWithoutDevices(){this.publishStream.getTracks().forEach(t=>this.publishStream.removeTrack(t)),this.publishStream=new MediaStream,this.options.internalMessages$.next({faceMeMessageType:"DevicePermissionAllowedInternal"}),this.options.streamManager.addCanvasVideoTrackToStream(this.publishStream),this.options.streamManager.addSilentAudioTrackToStream(this.publishStream),this.mediaHandler.localStream$.next(this.publishStream)}remoteVideoReady(){this.options.uneeqOptions.preferredSpeakerId&&this.setAvatarSpeakerDevice(this.options.uneeqOptions.preferredSpeakerId)}sendMediaUnavailableInfo(t){return r(this,void 0,void 0,function*(){const e=yield this.getMediaDevices(),n={audioInputs:e.audioInput.length,videoInputs:e.videoInput.length,hasUserDeniedPermission:t};return this.api.sendMediaUnavailable(n)})}getMediaDevices(){return r(this,void 0,void 0,function*(){const t=yield navigator.mediaDevices.enumerateDevices(),e={audioInput:[],audioOutput:[],videoInput:[]};return e.audioInput=t.filter(t=>"audioinput"===t.kind),e.audioOutput=t.filter(t=>"audiooutput"===t.kind),e.videoInput=t.filter(t=>"videoinput"===t.kind),e})}initDeviceList(){return r(this,void 0,void 0,function*(){navigator.mediaDevices.ondevicechange=t=>{this.initDeviceList()};const t=yield this.getMediaDevices();JSON.stringify(t)!==JSON.stringify(this.devices)&&(this.devices=t,this.options.uneeqOptions.preferredCameraId&&this.setCamDevice(this.options.uneeqOptions.preferredCameraId,!1),this.options.uneeqOptions.preferredMicrophoneId&&this.setMicDevice(this.options.uneeqOptions.preferredMicrophoneId,!1),this.options.userMessages.next(new i.DeviceListUpdatedMessage(this.devices)))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MediaHandler=void 0;const r=n(45),i=n(80),V=n(35),o=n(108),s=n(109),a=n(85),c=n(111),u=n(58),h=n(114);e.MediaHandler=class{constructor(t,e){this.options=t,this.remoteVideoReady=e,this.remoteStream$=new r.BehaviorSubject(null),this.localStream$=new r.BehaviorSubject(null),this.publishState$=new r.BehaviorSubject(a.PublishSubscribeState.DISCONNECTED),this.publishingStream=!1,this.canvasService=new c.CanvasService(this.options.uneeqOptions),this.remoteStream$.filter(t=>null!==t).subscribe(n=>{const r=document.createElement("video");this.avatarVideoElement=r,r.srcObject=n,r.volume=1,r.controls=!1,r.setAttribute("playsinline","true"),r.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.uneeqOptions.avatarVideoContainerElement.style.overflow="hidden",t.uneeqOptions.avatarVideoContainerElement.innerHTML="",t.uneeqOptions.avatarVideoContainerElement.appendChild(r);const i=this.canvasService.createCanvas();this.options.uneeqOptions.enableTransparentBackground&&this.initTransparentBackground(r,i),this.options.session.showUneeqLogo&&this.canvasService.drawVideoOnCanvasWithLogo(n,r,i,this.avatarVideoElement,this.options.session),e()}),this.localStream$.filter(t=>null!==t).subscribe(e=>{const n=document.createElement("video");this.localVideoElement=n,n.srcObject=e,n.autoplay=!0,n.muted=!0,n.setAttribute("playsinline","true"),n.setAttribute("style","width: 100%; height: 100%;"),t.uneeqOptions.localVideoContainerElement.innerHTML="",t.uneeqOptions.localVideoContainerElement.appendChild(n),this.options.uneeqOptions.micActivityMessages&&this.initMicActivity(e),this.options.session.edgeNodeId&&!this.publishingStream&&this.publishVideo()});try{window.AudioContext=window.AudioContext||window.webkitAudioContext,this.audioContext=new AudioContext}catch(t){this.options.uneeqOptions.micActivityMessages&&this.options.userMessages.next(new V.MicActivityNotSupportedMessage)}this.options.internalMessages$.filter(t=>"AnswerMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleAnswerMessage(t)}),this.options.internalMessages$.filter(t=>"IceCandidateMessage"===t.faceMeMessageType).subscribe(t=>{void 0!==this.webRTC&&this.webRTC.handleIceCandidate(t)})}setEdgeNodeId(t){this.options.session.edgeNodeId=t,this.options.session.edgeNodeId&&!this.publishingStream&&this.localStream$.getValue()&&this.publishVideo()}unpublishVideo(){u.logger.log("UserSession | unpublishVideo"),void 0!==this.webRTC&&(this.webRTC.close(),this.webRTC=void 0),this.publishState$.next(a.PublishSubscribeState.DISCONNECTED)}pause(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();this.avatarVideoElement.pause(),this.localVideoElement.pause(),e&&e.getTracks().forEach(t=>t.enabled=!1),t&&t.getTracks().forEach(t=>t.enabled=!1)}resume(){const t=this.remoteStream$.getValue(),e=this.localStream$.getValue();e&&e.getTracks().forEach(t=>t.enabled=!0),t&&t.getTracks().forEach(t=>t.enabled=!0),this.avatarVideoElement.play(),this.localVideoElement.play()}stopAllLocalStreams(){const t=this.localStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.publishingStream=!1}endSession(){this.stopAllLocalStreams(),this.options.uneeqOptions.localVideoContainerElement&&this.options.uneeqOptions.localVideoContainerElement&&(this.options.uneeqOptions.localVideoContainerElement.innerHTML=""),this.unpublishVideo(),this.options.uneeqOptions.avatarVideoContainerElement&&this.options.uneeqOptions.avatarVideoContainerElement&&(this.options.uneeqOptions.avatarVideoContainerElement.innerHTML="");const t=this.remoteStream$.getValue();t&&t.getTracks().forEach(t=>t.stop()),this.soundMeter&&this.soundMeter.stop()}sendDataMessage(t){this.webRTC&&this.webRTC.sendDataMessage(t)}gatherWebRTCStats(t){var e;null===(e=this.webRTC)||void 0===e||e.getStats(t)}publishVideo(){const t=this.options.session.streamId,e=this.options.session.avatarStreamId,n=this.options.session.turnServerAddresses,r=this.options.session.turnUsername,i=this.options.session.turnPassword,o=this.options.session.forceTurnServerUse,s=this.publishState$,c=this.remoteStream$,l=this.localStream$.getValue();if(!l||!this.options.session.edgeNodeId)return void console.error("Not ready to publish");let f=0;u.logger.log("UserSession | publishVideo - stream:",l,"publishStreamName:",t),u.logger.log("PublishVideo with edge node id: ",this.options.session.edgeNodeId),this.publishingStream=!0,null==this.webRTC?(this.webRTC=new h.UneeqWebRTC({messaging:this.options.messaging,userMessages:this.options.userMessages,publishStreamName:t,subscribeStreamName:e,edgeNodeId:this.options.session.edgeNodeId||"id",diagnostics:this.options.uneeqOptions.diagnostics,onAddStream:t=>{u.logger.log("WEBRTC: onAddstream "+t.stream),c.next(t.stream)},forceTurnServerUse:o,iceServers:[{urls:n,username:r,credential:i}],onConnect:()=>{u.logger.log("UserSession | publishVideo | webRtcInstance | onStateChange - connected"),s.getValue()===a.PublishSubscribeState.CONNECTING&&s.next(a.PublishSubscribeState.CONNECTED)},onError:t=>{u.logger.log("UserSession | publishVideo | webRtcInstance | onConnectionFailed - ",f),f<3?(f++,this.performWebRTCConnection(l),this.options.userMessages.next(new V.ConnectionLostMessage(a.PublishSubscribeState.DISCONNECTED))):(u.logger.log("UserSession | publishVideo | webRtcInstance | Publish failures > 3, so giving up"),s.next(a.PublishSubscribeState.FAILED),this.options.userMessages.next(new V.ConnectionLostMessage(a.PublishSubscribeState.FAILED)))}}),this.performWebRTCConnection(l)):this.webRTC.updateStreamTracks(l)}performWebRTCConnection(t){this.webRTC&&(this.publishState$.next(a.PublishSubscribeState.CONNECTING),this.webRTC.connect(t))}initMicActivity(t){this.soundMeter=new o.SoundMeter(this.audioContext),this.soundMeter.connectToSource(t,t=>this.micActivityConnected(t))}initTransparentBackground(t,e){(new s.VideoEditor).applyChromaKeyEffect(e,t),this.avatarVideoElement.style.display="none"}micActivityConnected(t){const e=this.options.userMessages;t?e.next(new V.MicActivityErrorMessage(t)):this.soundMeter&&this.soundMeter.instant$.pipe(i.distinctUntilChanged()).subscribe(t=>{e.next(new V.MicActivityMessage(t))})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SoundMeter=void 0;const r=n(45),i=n(58);e.SoundMeter=class{constructor(t){this.instant$=new r.BehaviorSubject(0),this.context=t,this.instant=0,this.slow=0,this.clip=0,this.script=t.createScriptProcessor(2048,1,1);const e=this;this.script.onaudioprocess=t=>{const n=t.inputBuffer.getChannelData(0);let r,i=0,V=0;for(r=0;r<n.length;++r)i+=n[r]*n[r],Math.abs(n[r])>.99&&(V+=1);e.instant=Math.sqrt(i/n.length),e.slow=.95*e.slow+.05*e.instant,e.clip=V/n.length,e.instant$.next(parseFloat(e.instant.toFixed(2)))}}connectToSource(t,e){i.logger.log("SoundMeter connecting");try{this.mic=this.context.createMediaStreamSource(t),this.mic.connect(this.script),this.script.connect(this.context.destination),void 0!==e&&e(null)}catch(t){console.error(t),void 0!==e&&e(t)}}stop(){this.mic.disconnect(),this.script.disconnect()}}},function(t,e,n){"use strict";var r=this&&this.__createBinding||(Object.create?function(t,e,n,r){void 0===r&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}:function(t,e,n,r){void 0===r&&(r=n),t[r]=e[n]}),i=this&&this.__setModuleDefault||(Object.create?function(t,e){Object.defineProperty(t,"default",{enumerable:!0,value:e})}:function(t,e){t.default=e}),V=this&&this.__importStar||function(t){if(t&&t.__esModule)return t;var e={};if(null!=t)for(var n in t)"default"!==n&&Object.hasOwnProperty.call(t,n)&&r(e,t,n);return i(e,t),e};Object.defineProperty(e,"__esModule",{value:!0}),e.VideoEditor=void 0;const o=V(n(82));e.VideoEditor=class{constructor(){}applyChromaKeyEffect(t,e){try{n(110);const r=o.default();let i,V,s;(i=r.transform("reformat")).source=e,i.width=t.width,i.height=t.height,s=r.target(t),(V=r.effect("chroma")).source=i,s.source=V,r.go()}catch(t){console.error(t)}}}},function(t,e,n){"use strict";n.r(e),n(82).default.plugin("chroma",{shader:function(t,e){return e.vertex=["precision mediump float;","attribute vec4 position;","attribute vec2 texCoord;","uniform vec2 resolution;","uniform mat4 transform;","varying vec2 vTexCoord;","uniform vec4 screen;","uniform float balance;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat fmin = min(min(screen.r, screen.g), screen.b);","\tfloat fmax = max(max(screen.r, screen.g), screen.b);","\tfloat secondaryComponents;","\tscreenPrimary = step(fmax, screen.rgb);","\tsecondaryComponents = dot(1.0 - screenPrimary, screen.rgb);","\tscreenSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tvec4 screenPosition = vec4(position.xy * resolution / 2.0, position.z, position.w);","\tscreenPosition = transform * screenPosition;","\tgl_Position = screenPosition;","\tgl_Position.xy = screenPosition.xy * 2.0 / resolution;","\tgl_Position.z = screenPosition.z * 2.0 / (resolution.x / resolution.y);","\tvTexCoord = texCoord;","}"].join("\n"),e.fragment=[this.inputs.mask?"#define MASK":"","precision mediump float;","varying vec2 vTexCoord;","uniform sampler2D source;","uniform vec4 screen;","uniform float screenWeight;","uniform float balance;","uniform float clipBlack;","uniform float clipWhite;","uniform bool mask;","varying float screenSat;","varying vec3 screenPrimary;","void main(void) {","\tfloat pixelSat, secondaryComponents;","\tvec4 sourcePixel = texture2D(source, vTexCoord);","\tfloat fmin = min(min(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tfloat fmax = max(max(sourcePixel.r, sourcePixel.g), sourcePixel.b);","\tvec3 pixelPrimary = step(fmax, sourcePixel.rgb);","\tsecondaryComponents = dot(1.0 - pixelPrimary, sourcePixel.rgb);","\tpixelSat = fmax - mix(secondaryComponents - fmin, secondaryComponents / 2.0, balance);","\tfloat diffPrimary = dot(abs(pixelPrimary - screenPrimary), vec3(1.0));","\tfloat solid = step(1.0, step(pixelSat, 0.1) + step(fmax, 0.1) + diffPrimary);","\tfloat alpha = max(0.0, 1.0 - pixelSat / screenSat);","\talpha = smoothstep(clipBlack, clipWhite, alpha);","\tvec4 semiTransparentPixel = vec4((sourcePixel.rgb - (1.0 - alpha) * screen.rgb * screenWeight) / max(0.00001, alpha), alpha);","\tvec4 pixel = mix(semiTransparentPixel, sourcePixel, solid);","#ifdef MASK","\tgl_FragColor = vec4(vec3(pixel.a), 1.0);","#else","\tgl_FragColor = pixel;","#endif","}"].join("\n"),e},inPlace:!0,inputs:{source:{type:"image",uniform:"source"},screen:{type:"color",uniform:"screen",defaultValue:[66/255,195/255,31/255,1]},weight:{type:"number",uniform:"screenWeight",defaultValue:1,min:0},balance:{type:"number",uniform:"balance",defaultValue:1,min:0,max:1},clipBlack:{type:"number",uniform:"clipBlack",defaultValue:0,min:0,max:1},clipWhite:{type:"number",uniform:"clipWhite",defaultValue:1,min:0,max:1},mask:{type:"boolean",defaultValue:!1,uniform:"mask",shaderDirty:!0}},title:"Chroma Key",description:""})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.CanvasService=void 0;const r=n(112),i=n(84);e.CanvasService=class{constructor(t){this.canvasHeight=720,this.canvasWidth=1280,this.uneeqOptions=t,this.mediaApiUrl=(new i.MediaUtils).getMediaApiUrl(t.url),this.logoDimensionsCalculator=new r.LogoDimensionsCalculator}drawVideoOnCanvasWithLogo(t,e,n,r,i){const V=this.uneeqOptions.enableTransparentBackground||!1;this.logo=new Image,this.logo.src=this.mediaApiUrl+"/media/v1/assets/logo/svg/download",this.logo.onload=()=>{let o=n.getContext("2d");if(V){const t=this.createCanvas();o=t.getContext("2d"),n.style.display="none"}e.addEventListener("play",()=>{let r=this.logoDimensionsCalculator.calculateLogoDimensions(i.sourceApp,V,this.uneeqOptions.avatarVideoContainerElement,n),s=this.uneeqOptions.avatarVideoContainerElement.offsetWidth,a=this.uneeqOptions.avatarVideoContainerElement.offsetHeight;const c=u=>{const h=t.getVideoTracks();if(0===h.length)return void console.error("Unable to get video stream tracks.");const l=h[0].getSettings();null==o||o.clearRect(0,0,n.width,n.height),u?null==o||o.drawImage(n,0,0):null==o||o.drawImage(e,0,0,l.width||0,l.height||0,0,0,n.width,n.height),null==o||o.drawImage(this.logo,r.dx,r.dy,r.width,r.height);const f=this.uneeqOptions.avatarVideoContainerElement.offsetWidth,d=this.uneeqOptions.avatarVideoContainerElement.offsetHeight;f===s&&d===a||(r=this.logoDimensionsCalculator.calculateLogoDimensions(i.sourceApp,V,this.uneeqOptions.avatarVideoContainerElement,n),s=f,a=d),requestAnimationFrame(()=>{c(V)})};c(V)}),r.style.display="none"}}createCanvas(){const t=document.createElement("canvas");return this.uneeqOptions.avatarVideoContainerElement.appendChild(t),t.setAttribute("style","object-fit: cover; width: 100%; height: 100%;"),t.height=this.canvasHeight,t.width=this.canvasWidth,t}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.LogoDimensionsCalculator=void 0;const r=n(113),i=n(86);e.LogoDimensionsCalculator=class{constructor(){this.MIN_DESKTOP_SCREEN_WIDTH=800}calculateLogoDimensions(t,e,n,r){const V={width:170,height:40,dx:0,dy:0},o={left:0,top:0,bottom:0};switch(i.SourceApp[t]){case i.SourceApp.INTERACTIONS:V.width=86.5,V.height=23,this.populatInteractionsLogo(e,o,V,n,r);break;case i.SourceApp.SPLIT_SCREEN:V.width=173,V.height=46,o.left=10,o.top=10,this.populateLogoDimensions(V,n,r,o,!1);break;case i.SourceApp.SHOWCASE||i.SourceApp.HOSTED_EXPERIENCE:V.width=173,V.height=46,n.offsetWidth<this.MIN_DESKTOP_SCREEN_WIDTH?(o.bottom=50,this.populateLogoDimensions(V,n,r,o,!0)):(o.left=10,o.top=10,this.populateLogoDimensions(V,n,r,o,!1));break;case i.SourceApp.UNKNOWN:V.width=173,V.height=46,e||n.offsetWidth<this.MIN_DESKTOP_SCREEN_WIDTH?(o.bottom=50,this.populateLogoDimensions(V,n,r,o,!0)):(o.left=80,o.top=30,this.populateLogoDimensions(V,n,r,o,!1))}return V}populatInteractionsLogo(t,e,n,r,i){t?(e.bottom=40,this.populateLogoDimensions(n,r,i,e,!0)):(e.left=10,e.top=10,this.populateLogoDimensions(n,r,i,e,!1))}populateLogoDimensions(t,e,n,i,V){const{width:o,height:s,x:a,y:c}=r.cover(e.offsetWidth,e.offsetHeight,n.width,n.height),u=n.width/o,h=n.height/s;if(t.width=Math.max(t.width,t.width*u),t.height=Math.max(t.height,t.height*h),V){const e=n.width/2;t.dx=e-t.width/2,t.dy=n.height-t.height-i.bottom}else{const e=u*a,n=h*c;t.dx=i.left*u-e,t.dy=i.top*h-n}return t}}},function(t,e,n){"use strict";
32
32
  /*! npm.im/intrinsic-scale */function r(t){return function(e,n,r,i){var V=r/i,o=e/n,s=e,a=n;return(t?V>o:V<o)?a=s/V:s=a*V,{width:s,height:a,x:(e-s)/2,y:(n-a)/2}}}Object.defineProperty(e,"__esModule",{value:!0});var i=r(!0),V=r(!1);e.contain=i,e.cover=V},function(t,e,n){"use strict";var r=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0}),e.UneeqWebRTC=void 0;const i=r(n(115)),V=r(n(81)),o=n(35),s=n(58);e.UneeqWebRTC=class{constructor(t){this.fakeDataChannel={},this.MESSAGING_ENDPOINT="/app/v2/webRTC",this.onStats=(t,e)=>{this.options.userMessages.next(new o.WebRtcStatsMessage(e)),this.statTimer=window.setTimeout(()=>{this.client.getStats(this.onStats)},2e3)},this.options=Object.assign({forceTurnServerUse:!1,iceServers:[]},t),this.log("Options",this.options),this.uniqueId=Math.random().toString(36).substring(2,12),RTCPeerConnection.prototype.createDataChannel||(this.warn("Implementing a fake createDataChannel"),RTCPeerConnection.prototype.createDataChannel=()=>this.fakeDataChannel)}connect(t){this.close(),this.client=new i.default({initiator:!0,config:{iceServers:this.options.iceServers},stream:t,channelName:"UneeqChannel"}),this.options.diagnostics&&this.enableDiagnostics(),this.fakeDataChannel.onopen&&(this.warn("Calling channel open on fake data channel"),this.fakeDataChannel.onopen()),this.client.on("error",t=>{this.log("error",t),void 0!==this.options.onError&&this.options.onError(t)}),this.client.on("signal",t=>{const e={payload:"",publishStreamName:this.options.publishStreamName,subscribeStreamName:this.options.subscribeStreamName,uniqueId:this.uniqueId,userAgent:navigator.userAgent,edgeNodeId:this.options.edgeNodeId};if("type"in t&&"offer"===t.type)e.payload=JSON.stringify({type:"offer",sdp:t.sdp}),e.type="OfferMessage",this.log("Offer payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e);else if("candidate"in t){const n=JSON.stringify(t.candidate);this.options.forceTurnServerUse&&!n.match(/typ relay/)||n.match(/::/)||(e.payload=n,e.type="IceCandidate",this.log("IC payload ",e),this.options.messaging.send(this.MESSAGING_ENDPOINT,e))}else this.warn("WARNING Unhandled signal: ",JSON.stringify(t))}),this.client.on("connect",()=>{this.log("CONNECT"),void 0!==this.options.onConnect&&this.options.onConnect()}),this.client.on("data",t=>{this.log("data: "+t),void 0!==this.options.onData&&this.options.onData(t),this.options.userMessages.next(new o.WebRtcDataMessage(t))}),this.client.on("close",()=>{this.log("WebRTC session closed: "+this.uniqueId),this.client=null,void 0!==this.options.onClose&&this.options.onClose()}),this.client.on("stream",t=>{void 0!==this.options.onAddStream&&this.options.onAddStream({stream:t})})}close(){this.client&&(this.client.destroy(),this.client=null),this.statTimer&&clearTimeout(this.statTimer)}handleAnswerMessage(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);return this.log("got answer: ",e),this.client.signal(e),!0}return this.log("ignoring answer: ",t),!1}handleIceCandidate(t){if(this.isMessageForUs(t)&&this.client){const e=JSON.parse(t.payload);if("candidate"in e&&""===e.candidate){if("edge"===V.default.browserDetails.browser){const t=this.client._pc;t.remoteDescription&&t.remoteDescription.type&&t.addIceCandidate(null)}}else this.client.signal({candidate:e});return!0}return!1}sendDataMessage(t){this.client.send(t)}getStats(t){return this.client&&this.client.getStats(t)}updateStreamTracks(t){t.getTracks().forEach(t=>{this.client._pc.getSenders().find(e=>t.kind===e.track.kind).replaceTrack(t).then(()=>{s.logger.log("Updated publish media stream track for "+t.kind)}).catch(e=>{s.logger.error("Error: updating publish media stream track failed for "+t.kind,e)})})}enableDiagnostics(){this.client._pc&&0!==this.client._pc.getStats.length&&(this.client._pc.getStats=""),this.client.getStats(this.onStats)}isMessageForUs(t){return t.requestUniqueId===this.uniqueId}log(t,...e){s.logger.log("UneeqWebRTC: "+t,e)}warn(t,...e){s.logger.warn("UneeqWebRTC: "+t,e)}}},function(t,e,n){
33
33
  /*! simple-peer. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
34
34
  const r=n(116)("simple-peer"),i=n(119),V=n(120),o=n(125),s=n(135),a=n(136),{Buffer:c}=n(42),u=65536,h=5e3,l=5e3;function f(t){return t.replace(/a=ice-options:trickle\s\n/g,"")}class d extends o.Duplex{constructor(t){if(super(t=Object.assign({allowHalfOpen:!1},t)),this._id=V(4).toString("hex").slice(0,7),this._debug("new peer %o",t),this.channelName=t.initiator?t.channelName||V(20).toString("hex"):null,this.initiator=t.initiator||!1,this.channelConfig=t.channelConfig||d.channelConfig,this.channelNegotiated=this.channelConfig.negotiated,this.config=Object.assign({},d.config,t.config),this.offerOptions=t.offerOptions||{},this.answerOptions=t.answerOptions||{},this.sdpTransform=t.sdpTransform||(t=>t),this.streams=t.streams||(t.stream?[t.stream]:[]),this.trickle=void 0===t.trickle||t.trickle,this.allowHalfTrickle=void 0!==t.allowHalfTrickle&&t.allowHalfTrickle,this.iceCompleteTimeout=t.iceCompleteTimeout||h,this.destroyed=!1,this.destroying=!1,this._connected=!1,this.remoteAddress=void 0,this.remoteFamily=void 0,this.remotePort=void 0,this.localAddress=void 0,this.localFamily=void 0,this.localPort=void 0,this._wrtc=t.wrtc&&"object"==typeof t.wrtc?t.wrtc:i(),!this._wrtc)throw"undefined"==typeof window?a(new Error("No WebRTC support: Specify `opts.wrtc` option in this environment"),"ERR_WEBRTC_SUPPORT"):a(new Error("No WebRTC support: Not a supported browser"),"ERR_WEBRTC_SUPPORT");this._pcReady=!1,this._channelReady=!1,this._iceComplete=!1,this._iceCompleteTimer=null,this._channel=null,this._pendingCandidates=[],this._isNegotiating=!1,this._firstNegotiation=!0,this._batchedNegotiation=!1,this._queuedNegotiation=!1,this._sendersAwaitingStable=[],this._senderMap=new Map,this._closingInterval=null,this._remoteTracks=[],this._remoteStreams=[],this._chunk=null,this._cb=null,this._interval=null;try{this._pc=new this._wrtc.RTCPeerConnection(this.config)}catch(t){return void this.destroy(a(t,"ERR_PC_CONSTRUCTOR"))}this._isReactNativeWebrtc="number"==typeof this._pc._peerConnectionId,this._pc.oniceconnectionstatechange=()=>{this._onIceStateChange()},this._pc.onicegatheringstatechange=()=>{this._onIceStateChange()},this._pc.onconnectionstatechange=()=>{this._onConnectionStateChange()},this._pc.onsignalingstatechange=()=>{this._onSignalingStateChange()},this._pc.onicecandidate=t=>{this._onIceCandidate(t)},"object"==typeof this._pc.peerIdentity&&this._pc.peerIdentity.catch(t=>{this.destroy(a(t,"ERR_PC_PEER_IDENTITY"))}),this.initiator||this.channelNegotiated?this._setupData({channel:this._pc.createDataChannel(this.channelName,this.channelConfig)}):this._pc.ondatachannel=t=>{this._setupData(t)},this.streams&&this.streams.forEach(t=>{this.addStream(t)}),this._pc.ontrack=t=>{this._onTrack(t)},this._debug("initial negotiation"),this._needsNegotiation(),this._onFinishBound=()=>{this._onFinish()},this.once("finish",this._onFinishBound)}get bufferSize(){return this._channel&&this._channel.bufferedAmount||0}get connected(){return this._connected&&"open"===this._channel.readyState}address(){return{port:this.localPort,family:this.localFamily,address:this.localAddress}}signal(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot signal after peer is destroyed"),"ERR_DESTROYED");if("string"==typeof t)try{t=JSON.parse(t)}catch(e){t={}}this._debug("signal()"),t.renegotiate&&this.initiator&&(this._debug("got request to renegotiate"),this._needsNegotiation()),t.transceiverRequest&&this.initiator&&(this._debug("got request for transceiver"),this.addTransceiver(t.transceiverRequest.kind,t.transceiverRequest.init)),t.candidate&&(this._pc.remoteDescription&&this._pc.remoteDescription.type?this._addIceCandidate(t.candidate):this._pendingCandidates.push(t.candidate)),t.sdp&&this._pc.setRemoteDescription(new this._wrtc.RTCSessionDescription(t)).then(()=>{this.destroyed||(this._pendingCandidates.forEach(t=>{this._addIceCandidate(t)}),this._pendingCandidates=[],"offer"===this._pc.remoteDescription.type&&this._createAnswer())}).catch(t=>{this.destroy(a(t,"ERR_SET_REMOTE_DESCRIPTION"))}),t.sdp||t.candidate||t.renegotiate||t.transceiverRequest||this.destroy(a(new Error("signal() called with invalid signal data"),"ERR_SIGNALING"))}}_addIceCandidate(t){const e=new this._wrtc.RTCIceCandidate(t);this._pc.addIceCandidate(e).catch(t=>{!e.address||e.address.endsWith(".local")?function(t){console.warn(t)}("Ignoring unsupported ICE candidate."):this.destroy(a(t,"ERR_ADD_ICE_CANDIDATE"))})}send(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot send after peer is destroyed"),"ERR_DESTROYED");this._channel.send(t)}}addTransceiver(t,e){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot addTransceiver after peer is destroyed"),"ERR_DESTROYED");if(this._debug("addTransceiver()"),this.initiator)try{this._pc.addTransceiver(t,e),this._needsNegotiation()}catch(t){this.destroy(a(t,"ERR_ADD_TRANSCEIVER"))}else this.emit("signal",{type:"transceiverRequest",transceiverRequest:{kind:t,init:e}})}}addStream(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot addStream after peer is destroyed"),"ERR_DESTROYED");this._debug("addStream()"),t.getTracks().forEach(e=>{this.addTrack(e,t)})}}addTrack(t,e){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot addTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("addTrack()");const n=this._senderMap.get(t)||new Map;let r=n.get(e);if(r)throw r.removed?a(new Error("Track has been removed. You should enable/disable tracks that you want to re-add."),"ERR_SENDER_REMOVED"):a(new Error("Track has already been added to that stream."),"ERR_SENDER_ALREADY_ADDED");r=this._pc.addTrack(t,e),n.set(e,r),this._senderMap.set(t,n),this._needsNegotiation()}replaceTrack(t,e,n){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot replaceTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("replaceTrack()");const r=this._senderMap.get(t),i=r?r.get(n):null;if(!i)throw a(new Error("Cannot replace track that was never added."),"ERR_TRACK_NOT_ADDED");e&&this._senderMap.set(e,r),null!=i.replaceTrack?i.replaceTrack(e):this.destroy(a(new Error("replaceTrack is not supported in this browser"),"ERR_UNSUPPORTED_REPLACETRACK"))}removeTrack(t,e){if(this.destroying)return;if(this.destroyed)throw a(new Error("cannot removeTrack after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSender()");const n=this._senderMap.get(t),r=n?n.get(e):null;if(!r)throw a(new Error("Cannot remove track that was never added."),"ERR_TRACK_NOT_ADDED");try{r.removed=!0,this._pc.removeTrack(r)}catch(t){"NS_ERROR_UNEXPECTED"===t.name?this._sendersAwaitingStable.push(r):this.destroy(a(t,"ERR_REMOVE_TRACK"))}this._needsNegotiation()}removeStream(t){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot removeStream after peer is destroyed"),"ERR_DESTROYED");this._debug("removeSenders()"),t.getTracks().forEach(e=>{this.removeTrack(e,t)})}}_needsNegotiation(){this._debug("_needsNegotiation"),this._batchedNegotiation||(this._batchedNegotiation=!0,s(()=>{this._batchedNegotiation=!1,this.initiator||!this._firstNegotiation?(this._debug("starting batched negotiation"),this.negotiate()):this._debug("non-initiator initial negotiation request discarded"),this._firstNegotiation=!1}))}negotiate(){if(!this.destroying){if(this.destroyed)throw a(new Error("cannot negotiate after peer is destroyed"),"ERR_DESTROYED");this.initiator?this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("start negotiation"),setTimeout(()=>{this._createOffer()},0)):this._isNegotiating?(this._queuedNegotiation=!0,this._debug("already negotiating, queueing")):(this._debug("requesting negotiation from initiator"),this.emit("signal",{type:"renegotiate",renegotiate:!0})),this._isNegotiating=!0}}destroy(t){this._destroy(t,()=>{})}_destroy(t,e){this.destroyed||this.destroying||(this.destroying=!0,this._debug("destroying (error: %s)",t&&(t.message||t)),s(()=>{if(this.destroyed=!0,this.destroying=!1,this._debug("destroy (error: %s)",t&&(t.message||t)),this.readable=this.writable=!1,this._readableState.ended||this.push(null),this._writableState.finished||this.end(),this._connected=!1,this._pcReady=!1,this._channelReady=!1,this._remoteTracks=null,this._remoteStreams=null,this._senderMap=null,clearInterval(this._closingInterval),this._closingInterval=null,clearInterval(this._interval),this._interval=null,this._chunk=null,this._cb=null,this._onFinishBound&&this.removeListener("finish",this._onFinishBound),this._onFinishBound=null,this._channel){try{this._channel.close()}catch(t){}this._channel.onmessage=null,this._channel.onopen=null,this._channel.onclose=null,this._channel.onerror=null}if(this._pc){try{this._pc.close()}catch(t){}this._pc.oniceconnectionstatechange=null,this._pc.onicegatheringstatechange=null,this._pc.onsignalingstatechange=null,this._pc.onicecandidate=null,this._pc.ontrack=null,this._pc.ondatachannel=null}this._pc=null,this._channel=null,t&&this.emit("error",t),this.emit("close"),e()}))}_setupData(t){if(!t.channel)return this.destroy(a(new Error("Data channel event is missing `channel` property"),"ERR_DATA_CHANNEL"));this._channel=t.channel,this._channel.binaryType="arraybuffer","number"==typeof this._channel.bufferedAmountLowThreshold&&(this._channel.bufferedAmountLowThreshold=u),this.channelName=this._channel.label,this._channel.onmessage=t=>{this._onChannelMessage(t)},this._channel.onbufferedamountlow=()=>{this._onChannelBufferedAmountLow()},this._channel.onopen=()=>{this._onChannelOpen()},this._channel.onclose=()=>{this._onChannelClose()},this._channel.onerror=t=>{const e=t.error instanceof Error?t.error:new Error(`Datachannel error: ${t.message} ${t.filename}:${t.lineno}:${t.colno}`);this.destroy(a(e,"ERR_DATA_CHANNEL"))};let e=!1;this._closingInterval=setInterval(()=>{this._channel&&"closing"===this._channel.readyState?(e&&this._onChannelClose(),e=!0):e=!1},l)}_read(){}_write(t,e,n){if(this.destroyed)return n(a(new Error("cannot write after peer is destroyed"),"ERR_DATA_CHANNEL"));if(this._connected){try{this.send(t)}catch(t){return this.destroy(a(t,"ERR_DATA_CHANNEL"))}this._channel.bufferedAmount>u?(this._debug("start backpressure: bufferedAmount %d",this._channel.bufferedAmount),this._cb=n):n(null)}else this._debug("write before connect"),this._chunk=t,this._cb=n}_onFinish(){if(this.destroyed)return;const t=()=>{setTimeout(()=>this.destroy(),1e3)};this._connected?t():this.once("connect",t)}_startIceCompleteTimeout(){this.destroyed||this._iceCompleteTimer||(this._debug("started iceComplete timeout"),this._iceCompleteTimer=setTimeout(()=>{this._iceComplete||(this._iceComplete=!0,this._debug("iceComplete timeout completed"),this.emit("iceTimeout"),this.emit("_iceComplete"))},this.iceCompleteTimeout))}_createOffer(){this.destroyed||this._pc.createOffer(this.offerOptions).then(t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=f(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp})};this._pc.setLocalDescription(t).then(()=>{this._debug("createOffer success"),this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))}).catch(t=>{this.destroy(a(t,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(t=>{this.destroy(a(t,"ERR_CREATE_OFFER"))})}_requestMissingTransceivers(){this._pc.getTransceivers&&this._pc.getTransceivers().forEach(t=>{t.mid||!t.sender.track||t.requested||(t.requested=!0,this.addTransceiver(t.sender.track.kind))})}_createAnswer(){this.destroyed||this._pc.createAnswer(this.answerOptions).then(t=>{if(this.destroyed)return;this.trickle||this.allowHalfTrickle||(t.sdp=f(t.sdp)),t.sdp=this.sdpTransform(t.sdp);const e=()=>{if(this.destroyed)return;const e=this._pc.localDescription||t;this._debug("signal"),this.emit("signal",{type:e.type,sdp:e.sdp}),this.initiator||this._requestMissingTransceivers()};this._pc.setLocalDescription(t).then(()=>{this.destroyed||(this.trickle||this._iceComplete?e():this.once("_iceComplete",e))}).catch(t=>{this.destroy(a(t,"ERR_SET_LOCAL_DESCRIPTION"))})}).catch(t=>{this.destroy(a(t,"ERR_CREATE_ANSWER"))})}_onConnectionStateChange(){this.destroyed||"failed"===this._pc.connectionState&&this.destroy(a(new Error("Connection failed."),"ERR_CONNECTION_FAILURE"))}_onIceStateChange(){if(this.destroyed)return;const t=this._pc.iceConnectionState,e=this._pc.iceGatheringState;this._debug("iceStateChange (connection: %s) (gathering: %s)",t,e),this.emit("iceStateChange",t,e),"connected"!==t&&"completed"!==t||(this._pcReady=!0,this._maybeReady()),"failed"===t&&this.destroy(a(new Error("Ice connection failed."),"ERR_ICE_CONNECTION_FAILURE")),"closed"===t&&this.destroy(a(new Error("Ice connection closed."),"ERR_ICE_CONNECTION_CLOSED"))}getStats(t){const e=t=>("[object Array]"===Object.prototype.toString.call(t.values)&&t.values.forEach(e=>{Object.assign(t,e)}),t);0===this._pc.getStats.length||this._isReactNativeWebrtc?this._pc.getStats().then(n=>{const r=[];n.forEach(t=>{r.push(e(t))}),t(null,r)},e=>t(e)):this._pc.getStats.length>0?this._pc.getStats(n=>{if(this.destroyed)return;const r=[];n.result().forEach(t=>{const n={};t.names().forEach(e=>{n[e]=t.stat(e)}),n.id=t.id,n.type=t.type,n.timestamp=t.timestamp,r.push(e(n))}),t(null,r)},e=>t(e)):t(null,[])}_maybeReady(){if(this._debug("maybeReady pc %s channel %s",this._pcReady,this._channelReady),this._connected||this._connecting||!this._pcReady||!this._channelReady)return;this._connecting=!0;const t=()=>{this.destroyed||this.getStats((e,n)=>{if(this.destroyed)return;e&&(n=[]);const r={},i={},V={};let o=!1;n.forEach(t=>{"remotecandidate"!==t.type&&"remote-candidate"!==t.type||(r[t.id]=t),"localcandidate"!==t.type&&"local-candidate"!==t.type||(i[t.id]=t),"candidatepair"!==t.type&&"candidate-pair"!==t.type||(V[t.id]=t)});const s=t=>{o=!0;let e=i[t.localCandidateId];e&&(e.ip||e.address)?(this.localAddress=e.ip||e.address,this.localPort=Number(e.port)):e&&e.ipAddress?(this.localAddress=e.ipAddress,this.localPort=Number(e.portNumber)):"string"==typeof t.googLocalAddress&&(e=t.googLocalAddress.split(":"),this.localAddress=e[0],this.localPort=Number(e[1])),this.localAddress&&(this.localFamily=this.localAddress.includes(":")?"IPv6":"IPv4");let n=r[t.remoteCandidateId];n&&(n.ip||n.address)?(this.remoteAddress=n.ip||n.address,this.remotePort=Number(n.port)):n&&n.ipAddress?(this.remoteAddress=n.ipAddress,this.remotePort=Number(n.portNumber)):"string"==typeof t.googRemoteAddress&&(n=t.googRemoteAddress.split(":"),this.remoteAddress=n[0],this.remotePort=Number(n[1])),this.remoteAddress&&(this.remoteFamily=this.remoteAddress.includes(":")?"IPv6":"IPv4"),this._debug("connect local: %s:%s remote: %s:%s",this.localAddress,this.localPort,this.remoteAddress,this.remotePort)};if(n.forEach(t=>{"transport"===t.type&&t.selectedCandidatePairId&&s(V[t.selectedCandidatePairId]),("googCandidatePair"===t.type&&"true"===t.googActiveConnection||("candidatepair"===t.type||"candidate-pair"===t.type)&&t.selected)&&s(t)}),o||Object.keys(V).length&&!Object.keys(i).length){if(this._connecting=!1,this._connected=!0,this._chunk){try{this.send(this._chunk)}catch(e){return this.destroy(a(e,"ERR_DATA_CHANNEL"))}this._chunk=null,this._debug('sent chunk from "write before connect"');const t=this._cb;this._cb=null,t(null)}"number"!=typeof this._channel.bufferedAmountLowThreshold&&(this._interval=setInterval(()=>this._onInterval(),150),this._interval.unref&&this._interval.unref()),this._debug("connect"),this.emit("connect")}else setTimeout(t,100)})};t()}_onInterval(){!this._cb||!this._channel||this._channel.bufferedAmount>u||this._onChannelBufferedAmountLow()}_onSignalingStateChange(){this.destroyed||("stable"===this._pc.signalingState&&(this._isNegotiating=!1,this._debug("flushing sender queue",this._sendersAwaitingStable),this._sendersAwaitingStable.forEach(t=>{this._pc.removeTrack(t),this._queuedNegotiation=!0}),this._sendersAwaitingStable=[],this._queuedNegotiation?(this._debug("flushing negotiation queue"),this._queuedNegotiation=!1,this._needsNegotiation()):(this._debug("negotiated"),this.emit("negotiated"))),this._debug("signalingStateChange %s",this._pc.signalingState),this.emit("signalingStateChange",this._pc.signalingState))}_onIceCandidate(t){this.destroyed||(t.candidate&&this.trickle?this.emit("signal",{type:"candidate",candidate:{candidate:t.candidate.candidate,sdpMLineIndex:t.candidate.sdpMLineIndex,sdpMid:t.candidate.sdpMid}}):t.candidate||this._iceComplete||(this._iceComplete=!0,this.emit("_iceComplete")),t.candidate&&this._startIceCompleteTimeout())}_onChannelMessage(t){if(this.destroyed)return;let e=t.data;e instanceof ArrayBuffer&&(e=c.from(e)),this.push(e)}_onChannelBufferedAmountLow(){if(this.destroyed||!this._cb)return;this._debug("ending backpressure: bufferedAmount %d",this._channel.bufferedAmount);const t=this._cb;this._cb=null,t(null)}_onChannelOpen(){this._connected||this.destroyed||(this._debug("on channel open"),this._channelReady=!0,this._maybeReady())}_onChannelClose(){this.destroyed||(this._debug("on channel close"),this.destroy())}_onTrack(t){this.destroyed||t.streams.forEach(e=>{this._debug("on track"),this.emit("track",t.track,e),this._remoteTracks.push({track:t.track,stream:e}),this._remoteStreams.some(t=>t.id===e.id)||(this._remoteStreams.push(e),s(()=>{this._debug("on stream"),this.emit("stream",e)}))})}_debug(){const t=[].slice.call(arguments);t[0]="["+this._id+"] "+t[0],r.apply(null,t)}}d.WEBRTC_SUPPORT=!!i(),d.config={iceServers:[{urls:["stun:stun.l.google.com:19302","stun:global.stun.twilio.com:3478"]}],sdpSemantics:"unified-plan"},d.channelConfig={},t.exports=d},function(t,e,n){(function(r){e.formatArgs=function(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+t.exports.humanize(this.diff),!this.useColors)return;const n="color: "+this.color;e.splice(1,0,n,"color: inherit");let r=0,i=0;e[0].replace(/%[a-zA-Z%]/g,t=>{"%%"!==t&&(r++,"%c"===t&&(i=r))}),e.splice(i,0,n)},e.save=function(t){try{t?e.storage.setItem("debug",t):e.storage.removeItem("debug")}catch(t){}},e.load=function(){let t;try{t=e.storage.getItem("debug")}catch(t){}!t&&void 0!==r&&"env"in r&&(t=r.env.DEBUG);return t},e.useColors=function(){if("undefined"!=typeof window&&window.process&&("renderer"===window.process.type||window.process.__nwjs))return!0;if("undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;return"undefined"!=typeof document&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||"undefined"!=typeof window&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/)&&parseInt(RegExp.$1,10)>=31||"undefined"!=typeof navigator&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)},e.storage=function(){try{return localStorage}catch(t){}}(),e.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})(),e.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"],e.log=console.debug||console.log||(()=>{}),t.exports=n(117)(e);const{formatters:i}=t.exports;i.j=function(t){try{return JSON.stringify(t)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}}).call(this,n(36))},function(t,e,n){t.exports=function(t){function e(t){let n,i,V,o=null;function s(...t){if(!s.enabled)return;const r=s,i=Number(new Date),V=i-(n||i);r.diff=V,r.prev=n,r.curr=i,n=i,t[0]=e.coerce(t[0]),"string"!=typeof t[0]&&t.unshift("%O");let o=0;t[0]=t[0].replace(/%([a-zA-Z%])/g,(n,i)=>{if("%%"===n)return"%";o++;const V=e.formatters[i];if("function"==typeof V){const e=t[o];n=V.call(r,e),t.splice(o,1),o--}return n}),e.formatArgs.call(r,t),(r.log||e.log).apply(r,t)}return s.namespace=t,s.useColors=e.useColors(),s.color=e.selectColor(t),s.extend=r,s.destroy=e.destroy,Object.defineProperty(s,"enabled",{enumerable:!0,configurable:!1,get:()=>null!==o?o:(i!==e.namespaces&&(i=e.namespaces,V=e.enabled(t)),V),set:t=>{o=t}}),"function"==typeof e.init&&e.init(s),s}function r(t,n){const r=e(this.namespace+(void 0===n?":":n)+t);return r.log=this.log,r}function i(t){return t.toString().substring(2,t.toString().length-2).replace(/\.\*\?$/,"*")}return e.debug=e,e.default=e,e.coerce=function(t){if(t instanceof Error)return t.stack||t.message;return t},e.disable=function(){const t=[...e.names.map(i),...e.skips.map(i).map(t=>"-"+t)].join(",");return e.enable(""),t},e.enable=function(t){let n;e.save(t),e.namespaces=t,e.names=[],e.skips=[];const r=("string"==typeof t?t:"").split(/[\s,]+/),i=r.length;for(n=0;n<i;n++)r[n]&&("-"===(t=r[n].replace(/\*/g,".*?"))[0]?e.skips.push(new RegExp("^"+t.substr(1)+"$")):e.names.push(new RegExp("^"+t+"$")))},e.enabled=function(t){if("*"===t[t.length-1])return!0;let n,r;for(n=0,r=e.skips.length;n<r;n++)if(e.skips[n].test(t))return!1;for(n=0,r=e.names.length;n<r;n++)if(e.names[n].test(t))return!0;return!1},e.humanize=n(118),e.destroy=function(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")},Object.keys(t).forEach(n=>{e[n]=t[n]}),e.names=[],e.skips=[],e.formatters={},e.selectColor=function(t){let n=0;for(let e=0;e<t.length;e++)n=(n<<5)-n+t.charCodeAt(e),n|=0;return e.colors[Math.abs(n)%e.colors.length]},e.enable(e.load()),e}},function(t,e){var n=1e3,r=60*n,i=60*r,V=24*i,o=7*V,s=365.25*V;function a(t,e,n,r){var i=e>=1.5*n;return Math.round(t/n)+" "+r+(i?"s":"")}t.exports=function(t,e){e=e||{};var c=typeof t;if("string"===c&&t.length>0)return function(t){if((t=String(t)).length>100)return;var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(!e)return;var a=parseFloat(e[1]);switch((e[2]||"ms").toLowerCase()){case"years":case"year":case"yrs":case"yr":case"y":return a*s;case"weeks":case"week":case"w":return a*o;case"days":case"day":case"d":return a*V;case"hours":case"hour":case"hrs":case"hr":case"h":return a*i;case"minutes":case"minute":case"mins":case"min":case"m":return a*r;case"seconds":case"second":case"secs":case"sec":case"s":return a*n;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return a;default:return}}(t);if("number"===c&&isFinite(t))return e.long?function(t){var e=Math.abs(t);if(e>=V)return a(t,e,V,"day");if(e>=i)return a(t,e,i,"hour");if(e>=r)return a(t,e,r,"minute");if(e>=n)return a(t,e,n,"second");return t+" ms"}(t):function(t){var e=Math.abs(t);if(e>=V)return Math.round(t/V)+"d";if(e>=i)return Math.round(t/i)+"h";if(e>=r)return Math.round(t/r)+"m";if(e>=n)return Math.round(t/n)+"s";return t+"ms"}(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))}},function(t,e){t.exports=function(){if("undefined"==typeof globalThis)return null;var t={RTCPeerConnection:globalThis.RTCPeerConnection||globalThis.mozRTCPeerConnection||globalThis.webkitRTCPeerConnection,RTCSessionDescription:globalThis.RTCSessionDescription||globalThis.mozRTCSessionDescription||globalThis.webkitRTCSessionDescription,RTCIceCandidate:globalThis.RTCIceCandidate||globalThis.mozRTCIceCandidate||globalThis.webkitRTCIceCandidate};return t.RTCPeerConnection?t:null}},function(t,e,n){"use strict";(function(e,r){var i=65536,V=4294967295;var o=n(121).Buffer,s=e.crypto||e.msCrypto;s&&s.getRandomValues?t.exports=function(t,e){if(t>V)throw new RangeError("requested too many random bytes");var n=o.allocUnsafe(t);if(t>0)if(t>i)for(var a=0;a<t;a+=i)s.getRandomValues(n.slice(a,a+i));else s.getRandomValues(n);if("function"==typeof e)return r.nextTick(function(){e(null,n)});return n}:t.exports=function(){throw new Error("Secure random number generation is not supported by this browser.\nUse Chrome, Firefox or Internet Explorer 11")}}).call(this,n(33),n(36))},function(t,e,n){var r=n(42),i=r.Buffer;function V(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(V(r,e),e.Buffer=o),o.prototype=Object.create(i.prototype),V(i,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";e.byteLength=function(t){var e=c(t),n=e[0],r=e[1];return 3*(n+r)/4-r},e.toByteArray=function(t){var e,n,r=c(t),o=r[0],s=r[1],a=new V(function(t,e,n){return 3*(e+n)/4-n}(0,o,s)),u=0,h=s>0?o-4:o;for(n=0;n<h;n+=4)e=i[t.charCodeAt(n)]<<18|i[t.charCodeAt(n+1)]<<12|i[t.charCodeAt(n+2)]<<6|i[t.charCodeAt(n+3)],a[u++]=e>>16&255,a[u++]=e>>8&255,a[u++]=255&e;2===s&&(e=i[t.charCodeAt(n)]<<2|i[t.charCodeAt(n+1)]>>4,a[u++]=255&e);1===s&&(e=i[t.charCodeAt(n)]<<10|i[t.charCodeAt(n+1)]<<4|i[t.charCodeAt(n+2)]>>2,a[u++]=e>>8&255,a[u++]=255&e);return a},e.fromByteArray=function(t){for(var e,n=t.length,i=n%3,V=[],o=0,s=n-i;o<s;o+=16383)V.push(u(t,o,o+16383>s?s:o+16383));1===i?(e=t[n-1],V.push(r[e>>2]+r[e<<4&63]+"==")):2===i&&(e=(t[n-2]<<8)+t[n-1],V.push(r[e>>10]+r[e>>4&63]+r[e<<2&63]+"="));return V.join("")};for(var r=[],i=[],V="undefined"!=typeof Uint8Array?Uint8Array:Array,o="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",s=0,a=o.length;s<a;++s)r[s]=o[s],i[o.charCodeAt(s)]=s;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var n=t.indexOf("=");return-1===n&&(n=e),[n,n===e?0:4-n%4]}function u(t,e,n){for(var i,V,o=[],s=e;s<n;s+=3)i=(t[s]<<16&16711680)+(t[s+1]<<8&65280)+(255&t[s+2]),o.push(r[(V=i)>>18&63]+r[V>>12&63]+r[V>>6&63]+r[63&V]);return o.join("")}i["-".charCodeAt(0)]=62,i["_".charCodeAt(0)]=63},function(t,e){e.read=function(t,e,n,r,i){var V,o,s=8*i-r-1,a=(1<<s)-1,c=a>>1,u=-7,h=n?i-1:0,l=n?-1:1,f=t[e+h];for(h+=l,V=f&(1<<-u)-1,f>>=-u,u+=s;u>0;V=256*V+t[e+h],h+=l,u-=8);for(o=V&(1<<-u)-1,V>>=-u,u+=r;u>0;o=256*o+t[e+h],h+=l,u-=8);if(0===V)V=1-c;else{if(V===a)return o?NaN:1/0*(f?-1:1);o+=Math.pow(2,r),V-=c}return(f?-1:1)*o*Math.pow(2,V-r)},e.write=function(t,e,n,r,i,V){var o,s,a,c=8*V-i-1,u=(1<<c)-1,h=u>>1,l=23===i?Math.pow(2,-24)-Math.pow(2,-77):0,f=r?0:V-1,d=r?1:-1,p=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(s=isNaN(e)?1:0,o=u):(o=Math.floor(Math.log(e)/Math.LN2),e*(a=Math.pow(2,-o))<1&&(o--,a*=2),(e+=o+h>=1?l/a:l*Math.pow(2,1-h))*a>=2&&(o++,a/=2),o+h>=u?(s=0,o=u):o+h>=1?(s=(e*a-1)*Math.pow(2,i),o+=h):(s=e*Math.pow(2,h-1)*Math.pow(2,i),o=0));i>=8;t[n+f]=255&s,f+=d,s/=256,i-=8);for(o=o<<i|s,c+=i;c>0;t[n+f]=255&o,f+=d,o/=256,c-=8);t[n+f-d]|=128*p}},function(t,e){var n={}.toString;t.exports=Array.isArray||function(t){return"[object Array]"==n.call(t)}},function(t,e,n){(e=t.exports=n(87)).Stream=e,e.Readable=e,e.Writable=n(92),e.Duplex=n(44),e.Transform=n(94),e.PassThrough=n(133),e.finished=n(78),e.pipeline=n(134)},function(t,e){},function(t,e,n){"use strict";function r(t,e){var n=Object.keys(t);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(t);e&&(r=r.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),n.push.apply(n,r)}return n}function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var o=n(42).Buffer,s=n(128).inspect,a=s&&s.custom||"inspect";t.exports=function(){function t(){!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),this.head=null,this.tail=null,this.length=0}var e,n,c;return e=t,(n=[{key:"push",value:function(t){var e={data:t,next:null};this.length>0?this.tail.next=e:this.head=e,this.tail=e,++this.length}},{key:"unshift",value:function(t){var e={data:t,next:this.head};0===this.length&&(this.tail=e),this.head=e,++this.length}},{key:"shift",value:function(){if(0!==this.length){var t=this.head.data;return 1===this.length?this.head=this.tail=null:this.head=this.head.next,--this.length,t}}},{key:"clear",value:function(){this.head=this.tail=null,this.length=0}},{key:"join",value:function(t){if(0===this.length)return"";for(var e=this.head,n=""+e.data;e=e.next;)n+=t+e.data;return n}},{key:"concat",value:function(t){if(0===this.length)return o.alloc(0);for(var e,n,r,i=o.allocUnsafe(t>>>0),V=this.head,s=0;V;)e=V.data,n=i,r=s,o.prototype.copy.call(e,n,r),s+=V.data.length,V=V.next;return i}},{key:"consume",value:function(t,e){var n;return t<this.head.data.length?(n=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):n=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),n}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,n=1,r=e.data;for(t-=r.length;e=e.next;){var i=e.data,V=t>i.length?i.length:t;if(V===i.length?r+=i:r+=i.slice(0,t),0==(t-=V)){V===i.length?(++n,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=i.slice(V));break}++n}return this.length-=n,r}},{key:"_getBuffer",value:function(t){var e=o.allocUnsafe(t),n=this.head,r=1;for(n.data.copy(e),t-=n.data.length;n=n.next;){var i=n.data,V=t>i.length?i.length:t;if(i.copy(e,e.length-t,0,V),0==(t-=V)){V===i.length?(++r,n.next?this.head=n.next:this.head=this.tail=null):(this.head=n,n.data=i.slice(V));break}++r}return this.length-=r,e}},{key:a,value:function(t,e){return s(this,function(t){for(var e=1;e<arguments.length;e++){var n=null!=arguments[e]?arguments[e]:{};e%2?r(Object(n),!0).forEach(function(e){i(t,e,n[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(n)):r(Object(n)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(n,e))})}return t}({},e,{depth:0,customInspect:!1}))}}])&&V(e.prototype,n),c&&V(e,c),t}()},function(t,e){},function(t,e,n){(function(e){function n(t){try{if(!e.localStorage)return!1}catch(t){return!1}var n=e.localStorage[t];return null!=n&&"true"===String(n).toLowerCase()}t.exports=function(t,e){if(n("noDeprecation"))return t;var r=!1;return function(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}}}).call(this,n(33))},function(t,e,n){var r=n(42),i=r.Buffer;function V(t,e){for(var n in t)e[n]=t[n]}function o(t,e,n){return i(t,e,n)}i.from&&i.alloc&&i.allocUnsafe&&i.allocUnsafeSlow?t.exports=r:(V(r,e),e.Buffer=o),V(i,o),o.from=function(t,e,n){if("number"==typeof t)throw new TypeError("Argument must not be a number");return i(t,e,n)},o.alloc=function(t,e,n){if("number"!=typeof t)throw new TypeError("Argument must be a number");var r=i(t);return void 0!==e?"string"==typeof n?r.fill(e,n):r.fill(e):r.fill(0),r},o.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return i(t)},o.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return r.SlowBuffer(t)}},function(t,e,n){"use strict";(function(e){var r;function i(t,e,n){return e in t?Object.defineProperty(t,e,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[e]=n,t}var V=n(78),o=Symbol("lastResolve"),s=Symbol("lastReject"),a=Symbol("error"),c=Symbol("ended"),u=Symbol("lastPromise"),h=Symbol("handlePromise"),l=Symbol("stream");function f(t,e){return{value:t,done:e}}function d(t){var e=t[o];if(null!==e){var n=t[l].read();null!==n&&(t[u]=null,t[o]=null,t[s]=null,e(f(n,!1)))}}function p(t){e.nextTick(d,t)}var g=Object.getPrototypeOf(function(){}),v=Object.setPrototypeOf((i(r={get stream(){return this[l]},next:function(){var t=this,n=this[a];if(null!==n)return Promise.reject(n);if(this[c])return Promise.resolve(f(void 0,!0));if(this[l].destroyed)return new Promise(function(n,r){e.nextTick(function(){t[a]?r(t[a]):n(f(void 0,!0))})});var r,i=this[u];if(i)r=new Promise(function(t,e){return function(n,r){t.then(function(){e[c]?n(f(void 0,!0)):e[h](n,r)},r)}}(i,this));else{var V=this[l].read();if(null!==V)return Promise.resolve(f(V,!1));r=new Promise(this[h])}return this[u]=r,r}},Symbol.asyncIterator,function(){return this}),i(r,"return",function(){var t=this;return new Promise(function(e,n){t[l].destroy(null,function(t){t?n(t):e(f(void 0,!0))})})}),r),g);t.exports=function(t){var e,n=Object.create(v,(i(e={},l,{value:t,writable:!0}),i(e,o,{value:null,writable:!0}),i(e,s,{value:null,writable:!0}),i(e,a,{value:null,writable:!0}),i(e,c,{value:t._readableState.endEmitted,writable:!0}),i(e,h,{value:function(t,e){var r=n[l].read();r?(n[u]=null,n[o]=null,n[s]=null,t(f(r,!1))):(n[o]=t,n[s]=e)},writable:!0}),e));return n[u]=null,V(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=n[s];return null!==e&&(n[u]=null,n[o]=null,n[s]=null,e(t)),void(n[a]=t)}var r=n[o];null!==r&&(n[u]=null,n[o]=null,n[s]=null,r(f(void 0,!0))),n[c]=!0}),t.on("readable",p.bind(null,n)),n}}).call(this,n(36))},function(t,e){t.exports=function(){throw new Error("Readable.from is not available in the browser")}},function(t,e,n){"use strict";t.exports=i;var r=n(94);function i(t){if(!(this instanceof i))return new i(t);r.call(this,t)}n(59)(i,r),i.prototype._transform=function(t,e,n){n(null,t)}},function(t,e,n){"use strict";var r;var i=n(43).codes,V=i.ERR_MISSING_ARGS,o=i.ERR_STREAM_DESTROYED;function s(t){if(t)throw t}function a(t){t()}function c(t,e){return t.pipe(e)}t.exports=function(){for(var t=arguments.length,e=new Array(t),i=0;i<t;i++)e[i]=arguments[i];var u,h=function(t){return t.length?"function"!=typeof t[t.length-1]?s:t.pop():s}(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new V("streams");var l=e.map(function(t,i){var V=i<e.length-1;return function(t,e,i,V){V=function(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}(V);var s=!1;t.on("close",function(){s=!0}),void 0===r&&(r=n(78)),r(t,{readable:e,writable:i},function(t){if(t)return V(t);s=!0,V()});var a=!1;return function(e){if(!s&&!a)return a=!0,function(t){return t.setHeader&&"function"==typeof t.abort}(t)?t.abort():"function"==typeof t.destroy?t.destroy():void V(e||new o("pipe"))}}(t,V,i>0,function(t){u||(u=t),t&&l.forEach(a),V||(l.forEach(a),h(u))})});return e.reduce(c)}},function(t,e,n){(function(e){/*! queue-microtask. MIT License. Feross Aboukhadijeh <https://feross.org/opensource> */
35
- let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):t=>(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this,n(33))},function(t,e,n){"use strict";function r(t,e){for(const n in e)Object.defineProperty(t,n,{value:e[n],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,n){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof e&&(n=e,e=""),e&&(n.code=e);try{return r(t,n)}catch(e){n.message=t.message,n.stack=t.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),r(new i,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;const r=n(35),i=n(79);e.MessageHandler=class{constructor(t,e){this.internalMessages$=t,this.messages=e,this.deviceManager={getDevices:(t,e)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe(t=>{const e={type:i.PromMessageType.QuestionMessageReceived,value:{id:t.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarQuestionMessage(t.question,t.id))}),this.getMessagesOfType("AvatarAnswerText").subscribe(t=>{const e={type:i.PromMessageType.AnswerMessageReceived,value:{id:t.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarAnswerMessage(t.answer,t.answerAvatar,t.answerSpeech,t.questionId))}),this.getMessagesOfType("AvatarAnswerHTML").subscribe(t=>this.messages.next(new r.AvatarAnswerContentMessage(t.html,t.messageId,t.hasDisplayHtml))),this.getMessagesOfType("AvatarTextInputStarted").subscribe(t=>this.messages.next(new r.StartedSpeakingMessage)),this.getMessagesOfType("AvatarTextInputFinished").subscribe(t=>{this.messages.next(new r.FinishedSpeakingMessage),this.messages.next(new r.AvatarTextInputFinishedMessage)}),this.getMessagesOfType("AvatarStarting").subscribe(t=>{this.deviceManager.edgeNodeId=t.edgeNodeId}),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe(t=>{this.messages.next(new r.ClientMediaStreamUpdateMessage(t.clientStreamingAudio,t.clientStreamingVideo,t.serverStreamingAudio,t.serverStreamingVideo)),t.clientStreamingAudio&&t.clientStreamingVideo&&t.serverStreamingAudio&&t.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))}),this.getMessagesOfType("SessionErrorMessage").subscribe(t=>{console.error(t.error),this.messages.next(new r.SessionErrorMessage(t.error))}),this.getMessagesOfType("SessionInfoMessage").subscribe(t=>{this.messages.next(new r.SessionInfoMessage(t.info))}),this.getMessagesOfType("SessionEndedMessage").subscribe(()=>{this.internalMessages$.next({faceMeMessageType:"sessionEnd"})}),this.getMessagesOfType("AvatarRequestCompleted").subscribe(t=>{this.messages.next(new r.AvatarRequestCompleted(t.reason))}),this.getMessagesOfType("AvatarRequestIgnored").subscribe(t=>{this.messages.next(new r.AvatarRequestIgnored(t.reason))})}setDeviceManager(t){this.deviceManager=t}getMessagesOfType(t){return this.internalMessages$.filter(e=>e.faceMeMessageType===t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};e.default=void 0;var i=n(139),V=n(143);Object.keys(V).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return V[t]}}))});e.default=function(){return new i.Registry}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;var r=n(62),i=n(95),V=n(141),o=n(142),s=n(97);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data={counter:{},gauge:{},histogram:{}}}var e,n,c;return e=t,(n=[{key:"validateInput",value:function(t,e,n,i){if(""===String(e))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(t))throw new Error("Unknown metric type ".concat(t));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(t,".").concat(e)))throw new Error("A metric with the name '".concat(e,"' already exists for type '").concat(t,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(t,e,r,s),"counter"===t?(n=new i.Counter,this.data.counter[e]={help:r,instance:n,type:t}):"gauge"===t?(n=new V.Gauge,this.data.gauge[e]={help:r,instance:n,type:t}):(n=new o.Histogram(s),this.data.histogram[e]={help:r,instance:n,type:t}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,function(t,e,n){return t+(0,r.reduce)(e,function(t,e,i){var V=e.instance.collect(),o=t;return e.help.length>0&&(o+="# HELP ".concat(i," ").concat(e.help,"\n")),o+="# TYPE ".concat(i," ").concat(n,"\n"),o+=(0,r.reduce)(V,function(t,e){return t+("histogram"===n?(0,s.formatHistogramOrSummary)(i,e):(0,s.formatCounterOrGauge)(i,e))},"")},"")},"")}},{key:"reset",value:function(){return(0,r.each)(this.data,function(t){(0,r.each)(t,function(t){t.instance.resetAll()})}),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(t,e){var n=(null!=t?[this.data[t]]:(0,r.valuesIn)(this.data)).find(function(t){return(0,r.has)(t,e)});return null!=n?n[e].instance:void 0}}])&&a(e.prototype,n),c&&a(e,c),t}();e.Registry=c},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gauge=void 0;var r=n(95);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,s(e).apply(this,arguments))}var n,i,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,r.Counter),n=e,(i=[{key:"dec",value:function(t){var e=this.get(t);return this.set(e?e.value-1:0,t),this}},{key:"sub",value:function(t,e){var n=this.get(e);return this.set(n?n.value-t:0,e),this}}])&&V(n.prototype,i),c&&V(n,c),e}();e.Gauge=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Histogram=void 0;var r=n(62),i=n(96);function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return{entries:(0,r.reduce)(t,function(t,e){return t[e.toString()]=0,t},{"+Inf":0}),sum:0,count:0,raw:[]}}var h=function(t){function e(){var t,n,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=function(t,e){return!e||"object"!==V(e)&&"function"!=typeof e?a(t):e}(this,s(e).call(this)),n=a(t),i=void 0,(r="buckets")in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,t.buckets=o.sort(function(t,e){return t>e?1:-1}),t.set(u(t.buckets)),t.observe=t.observe.bind(a(t)),t}var n,h,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(e,i.Collector),n=e,(h=[{key:"observe",value:function(t,e){var n=this.get(e);null==n&&(n=this.set(u(this.buckets),e).get(e)),n.value.raw.push(t),n.value.entries["+Inf"]+=1;var i=function(t,e){if(e<t[t.length-1])for(var n=0;n<t.length;n+=1)if(e<=t[n])return n}(this.buckets,t);if(null!=i)for(var V=i;V<this.buckets.length;V+=1){var o=n.value.entries[this.buckets[V].toString()];n.value.entries[this.buckets[V].toString()]=o+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(t){this.set(u(this.buckets),t)}}])&&o(n.prototype,h),l&&o(n,l),e}();e.Histogram=h},function(t,e,n){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=e.MessagingService=void 0;const r=n(145);Object.defineProperty(e,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(98);Object.defineProperty(e,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingService=void 0;const r=n(155),i=n(146),V=n(148),o=n(58),s=n(98);e.MessagingService=class{constructor(t,e){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=t,this.options=Object.assign(this.options,e),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new V.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const n={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new r.Client(n),this.stompClient.onConnect=t=>this.onStompConnected(t),this.stompClient.onDisconnect=t=>{o.logger.log("Stomp client disconnected",t)},this.stompClient.onStompError=t=>{o.logger.log("Stomp client error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketError=t=>{o.logger.log("Stomp client web socket error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketClose=t=>{o.logger.log("Stomp client web socket closed",t),this.onStompClientConnectionClosed(t)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const t=this.state$.getValue();if(t===s.MessagingState.CONNECTED||t===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(t){console.error("MessagingService | disconnect: error",t),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(t,e){o.logger.log("MessagingService | send:",t,e);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(e);this.stompClient.publish({destination:t,body:r,headers:n})}getTopic(t){o.logger.log("MessagingService | subscribeToTopic: "+t);const e=this.subscriptions[t];if(e)return o.logger.log("existing subscription... not re-subscribing to topic"),e;const n=new V.Subject;return this.stompClient.subscribe(t,t=>{n.next(t),this.messages$.next(t)}),this.subscriptions[t]=n,n}onStompConnected(t){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(t){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout(()=>{this.connect()},this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription");this.stompClient.subscribe("/",t=>{this.messages$.next(t)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(147))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);e.BehaviorSubject=r.BehaviorSubject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(149))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);e.Subject=r.Subject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsService=void 0;const r=n(35),i=n(151),V=n(79);e.MetricsService=class{constructor(t,e,n){this.uneeqOptions=t,this.internalMessages=e,this.messages=n,this.clientPerformanceStats={},this.options=t,this.internalMessages$=e,this.messages$=n}parseAndLogWebRtcStats(t){try{t.forEach(t=>{var e,n;if("inbound-rtp"===t.type&&"video"===t.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",t.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",t.frameWidth);const r=t.framesDropped,V=r?r-(null===(e=this.clientPerformanceStats.totalFramesDropped)||void 0===e?void 0:e.value):0;this.clientPerformanceStats.newFramesDropped=V?new i.ClientPerformanceStat("New Frames Dropped",V):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const o=t.packetsLost,s=o?o-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=s?new i.ClientPerformanceStat("New packets lost",s):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=o?new i.ClientPerformanceStat("Total packets lost",o):new i.ClientPerformanceStat;const a=t.framesPerSecond;this.clientPerformanceStats.framesPerSec=a?new i.ClientPerformanceStat("Frames per second",a):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===t.type&&"video"===t.kind){const e=t.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=e?new i.ClientPerformanceStat("Round Trip Time",e):new i.ClientPerformanceStat}else if("outbound-rtp"===t.type&&"video"===t.kind){const e=t.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",e)}}),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const e={type:V.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e})}catch(t){console.warn("Unable to parseAndLogWebRTCStats",t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceStat=void 0;e.ClientPerformanceStat=class{constructor(t="",e=0){this.label=t,this.value=e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnlineStatusService=void 0;const r=n(35);e.OnlineStatusService=class{constructor(t,e){this.messages=t,this.offlineTimeoutLimitHandler=e,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",()=>this.handleOffline()),window.addEventListener("online",()=>this.handleOnline())}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout(()=>{this.offlineTimeoutLimitHandler()},this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new r.OnlineStatusUpdateMessage(this.online))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StreamManager=void 0;class r{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioElement=document.createElement("audio"),this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(t){return t.getVideoTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.canvasVideoTrack),t}addSilentAudioTrackToStream(t){return t.getAudioTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.silentAudioTrack),t}remoteVideoReadyToPlay(){null!==this.silentAudioElement&&setTimeout(()=>{this.silentAudioElement.pause(),setTimeout(()=>{this.silentAudioElement.play()},500)},500)}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){this.canvasInterval&&clearInterval(this.canvasInterval);const t=document.createElement("canvas");t.width=40,t.height=30;const e=t.getContext("2d");return this.canvasInterval=setInterval(()=>(e.fillStyle="#"+(16777216+16777215*Math.random()).toString(16).substr(1,6),e.fillRect(0,0,t.width,t.height),t),1e3),t.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){this.silentAudioElement.loop=!0,this.silentAudioElement.volume=1;const t=(t=>{const e=t.indexOf(";base64,")+";base64,".length,n=t.substring(e),r=window.atob(n),i=r.length,V=new Uint8Array(new ArrayBuffer(i));for(let t=0;t<i;t++)V[t]=r.charCodeAt(t);return V})(r.audioData),e=new Blob([t],{type:"audio/mpeg"});this.silentAudioElement.src=URL.createObjectURL(e),this.silentAudioElement.play();const n=new window.AudioContext;this.audioContextInstance=n,this.audioSourceDestination=n.createMediaStreamDestination(),this.audioSourceNode=n.createMediaElementSource(this.silentAudioElement),this.audioSourceNode.connect(this.audioSourceDestination),this.audioSourceNode.connect(n.destination)}return this.audioSourceDestination.stream.getAudioTracks()[0]}}e.StreamManager=r,r.audioData="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjgzLjEwMAAAAAAAAAAAAAAA//tUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAArAABBQAAICA4OFBQaGhogICYmLCwsMjI3Nz09PUNDSUlPT09VVVtbYWFhZmZsbHJycnh4fn6EhISKipCQlpaWm5uhoaenp62ts7O5ubm/v8XFy8vL0NDW1tzc3OLi6Oju7u709Pr6//8AAAAATGF2YzU3LjEwAAAAAAAAAAAAAAAAJAPAAAAAAAAAQUCaftgR//uUZAAP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAETEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionType=void 0,function(t){t[t.WEB=0]="WEB"}(e.SessionType||(e.SessionType={}))},function(t,e,n){"use strict";n.r(e);const r={LF:"\n",NULL:"\0"};class i{constructor(t){const{command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:V,skipContentLengthHeader:o}=t;this.command=e,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=V||!1,this.skipContentLengthHeader=o||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(t,e){const n={},r=t=>t.replace(/^\s+|\s+$/g,"");for(const V of t.headers.reverse()){V.indexOf(":");const o=r(V[0]);let s=r(V[1]);e&&"CONNECT"!==t.command&&"CONNECTED"!==t.command&&(s=i.hdrValueUnEscape(s)),n[o]=s}return new i({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:e})}toString(){return this.serializeCmdAndHeaders()}serialize(){const t=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(t,this._binaryBody).buffer:t+this._body+r.NULL}serializeCmdAndHeaders(){const t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const e of Object.keys(this.headers||{})){const n=this.headers[e];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?t.push(`${e}:${i.hdrValueEscape(`${n}`)}`):t.push(`${e}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push(`content-length:${this.bodyLength()}`),t.join(r.LF)+r.LF+r.LF}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?(new TextEncoder).encode(t).length:0}static toUnit8Array(t,e){const n=(new TextEncoder).encode(t),r=new Uint8Array([0]),i=new Uint8Array(n.length+e.length+r.length);return i.set(n),i.set(e,n.length),i.set(r,n.length+e.length),i}static marshall(t){return new i(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const V=0,o=10,s=13,a=58;class c{constructor(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,e=!1){let n;if(n=t instanceof ArrayBuffer?new Uint8Array(t):this._encoder.encode(t),e&&0!==n[n.length-1]){const t=new Uint8Array(n.length+1);t.set(n,0),t[n.length]=0,n=t}for(let t=0;t<n.length;t++){const e=n[t];this._onByte(e)}}_collectFrame(t){t!==V&&t!==s&&(t!==o?(this._onByte=this._collectCommand,this._reinjectByte(t)):this.onIncomingPing())}_collectCommand(t){if(t!==s)return t===o?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_collectHeaders(t){t!==s&&(t!==o?(this._onByte=this._collectHeaderKey,this._reinjectByte(t)):this._setupCollectBody())}_reinjectByte(t){this._onByte(t)}_collectHeaderKey(t){if(t===a)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(t)}_collectHeaderValue(t){if(t!==s)return t===o?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_setupCollectBody(){const t=this._results.headers.filter(t=>"content-length"===t[0])[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){t!==V?this._consumeByte(t):this._retrievedBody()}_collectBodyFixedSize(t){0!=this._bodyBytesRemaining--?this._consumeByte(t):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var u,h;!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(u||(u={})),function(t){t[t.ACTIVE=0]="ACTIVE",t[t.DEACTIVATING=1]="DEACTIVATING",t[t.INACTIVE=2]="INACTIVE"}(h||(h={}));class l{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}}l.V1_0="1.0",l.V1_1="1.1",l.V1_2="1.2",l.default=new l([l.V1_0,l.V1_1,l.V1_2]);class f{constructor(t,e,n={}){this._client=t,this._webSocket=e,this._serverFrameHandlers={CONNECTED:t=>{this.debug(`connected to server ${t.headers.server}`),this._connected=!0,this._connectedVersion=t.headers.version,this._connectedVersion===l.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(t.headers),this.onConnect(t)},MESSAGE:t=>{const e=t.headers.subscription,n=this._subscriptions[e]||this.onUnhandledMessage,r=t,i=this,V=this._connectedVersion===l.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(t={})=>i.ack(V,e,t),r.nack=(t={})=>i.nack(V,e,t),n(r)},RECEIPT:t=>{const e=this._receiptWatchers[t.headers["receipt-id"]];e?(e(t),delete this._receiptWatchers[t.headers["receipt-id"]]):this.onUnhandledReceipt(t)},ERROR:t=>{this.onStompError(t)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(n)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(t){Object.assign(this,t)}start(){const t=new c(t=>{const e=i.fromRawFrame(t,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${e}`),(this._serverFrameHandlers[e.command]||this.onUnhandledFrame)(e)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const t=e.data instanceof ArrayBuffer?(new TextDecoder).decode(e.data):e.data;this.debug(`<<< ${t}`)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._onclose=t=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(t)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=t=>{this.onWebSocketError(t)},this._webSocket.onopen=()=>{const t=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),t["accept-version"]=this.stompVersions.supportedVersions(),t["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:t})}}_setupHeartbeat(t){if(t.version!==l.V1_1&&t.version!==l.V1_2)return;if(!t["heart-beat"])return;const[e,n]=t["heart-beat"].split(",").map(t=>parseInt(t,10));if(0!==this.heartbeatOutgoing&&0!==n){const t=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${t}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===u.OPEN&&(this._webSocket.send(r.LF),this.debug(">>> PING"))},t)}if(0!==this.heartbeatIncoming&&0!==e){const t=Math.max(this.heartbeatIncoming,e);this.debug(`check PONG every ${t}ms`),this._ponger=setInterval(()=>{const e=Date.now()-this._lastServerActivityTS;e>2*t&&(this.debug(`did not receive server activity for the last ${e}ms`),this._closeOrDiscardWebsocket())},t)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==u.CONNECTING&&this._webSocket.readyState!==u.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var t,e;this._webSocket.terminate||(t=this._webSocket,e=t=>this.debug(t),t.terminate=function(){const t=()=>{};this.onerror=t,this.onmessage=t,this.onopen=t;const n=new Date,r=this.onclose;this.onclose=t=>{const r=(new Date).getTime()-n.getTime();e(`Discarded socket closed after ${r}ms, with code/reason: ${t.code}/${t.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(t){const{command:e,headers:n,body:r,binaryBody:V,skipContentLengthHeader:o}=t,s=new i({command:e,headers:n,body:r,binaryBody:V,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let a=s.serialize();if(this.logRawCommunication?this.debug(`>>> ${a}`):this.debug(`>>> ${s}`),this.forceBinaryWSFrames&&"string"==typeof a&&(a=(new TextEncoder).encode(a)),"string"==typeof a&&this.splitLargeFrames){let t=a;for(;t.length>0;){const e=t.substring(0,this.maxWebSocketChunkSize);t=t.substring(this.maxWebSocketChunkSize),this._webSocket.send(e),this.debug(`chunk sent = ${e.length}, remaining = ${t.length}`)}}else this._webSocket.send(a)}dispose(){if(this.connected)try{const t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt=`close-${this._counter++}`),this.watchForReceipt(t.receipt,t=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(t)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug(`Ignoring error during disconnect ${t}`)}else this._webSocket.readyState!==u.CONNECTING&&this._webSocket.readyState!==u.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(t){const{destination:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:V}=t,o=Object.assign({destination:e},n);this._transmit({command:"SEND",headers:o,body:r,binaryBody:i,skipContentLengthHeader:V})}watchForReceipt(t,e){this._receiptWatchers[t]=e}subscribe(t,e,n={}){(n=Object.assign({},n)).id||(n.id=`sub-${this._counter++}`),n.destination=t,this._subscriptions[n.id]=e,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:t=>r.unsubscribe(n.id,t)}}unsubscribe(t,e={}){e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})}begin(t){const e=t||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:e}});const n=this;return{id:e,commit(){n.commit(e)},abort(){n.abort(e)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,e,n={}){n=Object.assign({},n),this._connectedVersion===l.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"ACK",headers:n})}nack(t,e,n={}){return n=Object.assign({},n),this._connectedVersion===l.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"NACK",headers:n})}}var d=function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};class p{constructor(t={}){this.stompVersions=l.default,this.connectionTimeout=1e4,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=h.INACTIVE;const e=()=>{};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.onChangeState=e,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===h.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){if(this.state===h.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(h.ACTIVE),this._connect())}_connect(){return d(this,void 0,void 0,function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher=setTimeout(()=>{this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect()},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new f(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:t=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(t)},onDisconnect:t=>{this.onDisconnect(t)},onStompError:t=>{this.onStompError(t)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===h.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(h.INACTIVE)),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:t=>{this.onWebSocketError(t)},onUnhandledMessage:t=>{this.onUnhandledMessage(t)},onUnhandledReceipt:t=>{this.onUnhandledReceipt(t)},onUnhandledFrame:t=>{this.onUnhandledFrame(t)}}),this._stompHandler.start()})}_createWebSocket(){let t;return(t=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions())).binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return d(this,void 0,void 0,function*(){let t;return this.state!==h.ACTIVE?(this.debug(`Already ${h[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(h.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==u.CLOSED?(t=new Promise((t,e)=>{this._resolveSocketClose=t}),this._disposeStompHandler(),t):(this._changeState(h.INACTIVE),Promise.resolve()))})}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(t){this._stompHandler.publish(t)}watchForReceipt(t,e){this._stompHandler.watchForReceipt(t,e)}subscribe(t,e,n={}){return this._stompHandler.subscribe(t,e,n)}unsubscribe(t,e={}){this._stompHandler.unsubscribe(t,e)}begin(t){return this._stompHandler.begin(t)}commit(t){this._stompHandler.commit(t)}abort(t){this._stompHandler.abort(t)}ack(t,e,n={}){this._stompHandler.ack(t,e,n)}nack(t,e,n={}){this._stompHandler.nack(t,e,n)}}class g{}class v{}class y{}class m{constructor(t){this.client=t}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(t){this.client.heartbeatOutgoing=t}get incoming(){return this.client.heartbeatIncoming}set incoming(t){this.client.heartbeatIncoming=t}}class b extends p{constructor(t){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new m(this),this.reconnect_delay=0,this.webSocketFactory=t,this.debug=(...t)=>{console.log(...t)}}_parseConnect(...t){let e,n,r,i={};if(t.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof t[1])[i,n,r,e]=t;else switch(t.length){case 6:[i.login,i.passcode,n,r,e,i.host]=t;break;default:[i.login,i.passcode,n,r,e]=t}return[i,n,r,e]}connect(...t){const e=this._parseConnect(...t);e[0]&&(this.connectHeaders=e[0]),e[1]&&(this.onConnect=e[1]),e[2]&&(this.onStompError=e[2]),e[3]&&(this.onWebSocketClose=e[3]),super.activate()}disconnect(t,e={}){t&&(this.onDisconnect=t),this.disconnectHeaders=e,super.deactivate()}send(t,e={},n=""){const r=!1===(e=Object.assign({},e))["content-length"];r&&delete e["content-length"],this.publish({destination:t,headers:e,body:n,skipContentLengthHeader:r})}set reconnect_delay(t){this.reconnectDelay=t}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(t){this.onUnhandledMessage=t}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(t){this.onUnhandledReceipt=t}get heartbeat(){return this._heartbeatInfo}set heartbeat(t){this.heartbeatIncoming=t.incoming,this.heartbeatOutgoing=t.outgoing}}class _{static client(t,e){null==e&&(e=l.default.protocolVersions());return new b(()=>{return new(_.WebSocketClass||WebSocket)(t,e)})}static over(t){let e;return"function"==typeof t?e=t:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),e=()=>t),new b(e)}}_.WebSocketClass=null,n.d(e,"Client",function(){return p}),n.d(e,"FrameImpl",function(){return i}),n.d(e,"Parser",function(){return c}),n.d(e,"StompConfig",function(){return g}),n.d(e,"StompHeaders",function(){return v}),n.d(e,"StompSubscription",function(){return y}),n.d(e,"StompSocketState",function(){return u}),n.d(e,"ActivationState",function(){return h}),n.d(e,"Versions",function(){return l}),n.d(e,"CompatClient",function(){return b}),n.d(e,"Stomp",function(){return _})}]));
35
+ let n;t.exports="function"==typeof queueMicrotask?queueMicrotask.bind("undefined"!=typeof window?window:e):t=>(n||(n=Promise.resolve())).then(t).catch(t=>setTimeout(()=>{throw t},0))}).call(this,n(33))},function(t,e,n){"use strict";function r(t,e){for(const n in e)Object.defineProperty(t,n,{value:e[n],enumerable:!0,configurable:!0});return t}t.exports=function(t,e,n){if(!t||"string"==typeof t)throw new TypeError("Please pass an Error to err-code");n||(n={}),"object"==typeof e&&(n=e,e=""),e&&(n.code=e);try{return r(t,n)}catch(e){n.message=t.message,n.stack=t.stack;const i=function(){};return i.prototype=Object.create(Object.getPrototypeOf(t)),r(new i,n)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessageHandler=void 0;const r=n(35),i=n(79);e.MessageHandler=class{constructor(t,e){this.internalMessages$=t,this.messages=e,this.deviceManager={getDevices:(t,e)=>{}},this.getMessagesOfType("AvatarQuestionText").subscribe(t=>{const e={type:i.PromMessageType.QuestionMessageReceived,value:{id:t.id,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarQuestionMessage(t.question,t.id))}),this.getMessagesOfType("AvatarAnswerText").subscribe(t=>{const e={type:i.PromMessageType.AnswerMessageReceived,value:{id:t.questionId,receivedOn:Date.now()}};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e}),this.messages.next(new r.AvatarAnswerMessage(t.answer,t.answerAvatar,t.answerSpeech,t.questionId))}),this.getMessagesOfType("AvatarAnswerHTML").subscribe(t=>{this.messages.next(new r.AvatarAnswerContentMessage(t.html,t.messageId,t.hasDisplayHtml)),this.messages.next(new r.InstructionsMessage(t.instructions))}),this.getMessagesOfType("AvatarTextInputStarted").subscribe(t=>this.messages.next(new r.StartedSpeakingMessage)),this.getMessagesOfType("AvatarTextInputFinished").subscribe(t=>{this.messages.next(new r.FinishedSpeakingMessage),this.messages.next(new r.AvatarTextInputFinishedMessage)}),this.getMessagesOfType("AvatarStarting").subscribe(t=>{this.deviceManager.edgeNodeId=t.edgeNodeId}),this.getMessagesOfType("ClientMediaStreamUpdate").subscribe(t=>{this.messages.next(new r.ClientMediaStreamUpdateMessage(t.clientStreamingAudio,t.clientStreamingVideo,t.serverStreamingAudio,t.serverStreamingVideo)),t.clientStreamingAudio&&t.clientStreamingVideo&&t.serverStreamingAudio&&t.serverStreamingVideo&&(this.internalMessages$.next({faceMeMessageType:"sessionLive"}),this.internalMessages$.next({faceMeMessageType:"remoteVideoReadyToPlay"}))}),this.getMessagesOfType("SessionErrorMessage").subscribe(t=>{console.error(t.error),this.messages.next(new r.SessionErrorMessage(t.error))}),this.getMessagesOfType("SessionInfoMessage").subscribe(t=>{this.messages.next(new r.SessionInfoMessage(t.info))}),this.getMessagesOfType("SessionEndedMessage").subscribe(()=>{this.internalMessages$.next({faceMeMessageType:"sessionEnd"})}),this.getMessagesOfType("AvatarRequestCompleted").subscribe(t=>{this.messages.next(new r.AvatarRequestCompleted(t.reason))}),this.getMessagesOfType("AvatarRequestIgnored").subscribe(t=>{this.messages.next(new r.AvatarRequestIgnored(t.reason))})}setDeviceManager(t){this.deviceManager=t}getMessagesOfType(t){return this.internalMessages$.filter(e=>e.faceMeMessageType===t)}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r={};e.default=void 0;var i=n(139),V=n(143);Object.keys(V).forEach(function(t){"default"!==t&&"__esModule"!==t&&(Object.prototype.hasOwnProperty.call(r,t)||Object.defineProperty(e,t,{enumerable:!0,get:function(){return V[t]}}))});e.default=function(){return new i.Registry}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Registry=void 0;var r=n(62),i=n(95),V=n(141),o=n(142),s=n(97);function a(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}var c=function(){function t(){var e,n,r;!function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,t),r=void 0,(n="data")in(e=this)?Object.defineProperty(e,n,{value:r,enumerable:!0,configurable:!0,writable:!0}):e[n]=r,this.data={counter:{},gauge:{},histogram:{}}}var e,n,c;return e=t,(n=[{key:"validateInput",value:function(t,e,n,i){if(""===String(e))throw new Error("Metric name cannot be empty");if(-1===["counter","gauge","histogram"].indexOf(t))throw new Error("Unknown metric type ".concat(t));if("string"!=typeof n&&null!=n)throw new Error("help must be string or undefined/null");if((0,r.has)(this.data,"".concat(t,".").concat(e)))throw new Error("A metric with the name '".concat(e,"' already exists for type '").concat(t,"'"));if(!Array.isArray(i)&&null!=i)throw new Error("buckets must be array or undefined/null")}},{key:"create",value:function(t,e){var n,r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:"",s=arguments.length>3&&void 0!==arguments[3]?arguments[3]:[];return this.validateInput(t,e,r,s),"counter"===t?(n=new i.Counter,this.data.counter[e]={help:r,instance:n,type:t}):"gauge"===t?(n=new V.Gauge,this.data.gauge[e]={help:r,instance:n,type:t}):(n=new o.Histogram(s),this.data.histogram[e]={help:r,instance:n,type:t}),n}},{key:"metrics",value:function(){return(0,r.reduce)(this.data,function(t,e,n){return t+(0,r.reduce)(e,function(t,e,i){var V=e.instance.collect(),o=t;return e.help.length>0&&(o+="# HELP ".concat(i," ").concat(e.help,"\n")),o+="# TYPE ".concat(i," ").concat(n,"\n"),o+=(0,r.reduce)(V,function(t,e){return t+("histogram"===n?(0,s.formatHistogramOrSummary)(i,e):(0,s.formatCounterOrGauge)(i,e))},"")},"")},"")}},{key:"reset",value:function(){return(0,r.each)(this.data,function(t){(0,r.each)(t,function(t){t.instance.resetAll()})}),this}},{key:"clear",value:function(){return this.data={counter:{},gauge:{},histogram:{}},this}},{key:"get",value:function(t,e){var n=(null!=t?[this.data[t]]:(0,r.valuesIn)(this.data)).find(function(t){return(0,r.has)(t,e)});return null!=n?n[e].instance:void 0}}])&&a(e.prototype,n),c&&a(e,c),t}();e.Registry=c},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Gauge=void 0;var r=n(95);function i(t){return(i="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function V(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function o(t,e){return!e||"object"!==i(e)&&"function"!=typeof e?function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}(t):e}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t,e){return(a=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}var c=function(t){function e(){return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),o(this,s(e).apply(this,arguments))}var n,i,c;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&a(t,e)}(e,r.Counter),n=e,(i=[{key:"dec",value:function(t){var e=this.get(t);return this.set(e?e.value-1:0,t),this}},{key:"sub",value:function(t,e){var n=this.get(e);return this.set(n?n.value-t:0,e),this}}])&&V(n.prototype,i),c&&V(n,c),e}();e.Gauge=c},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.Histogram=void 0;var r=n(62),i=n(96);function V(t){return(V="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(t){return typeof t}:function(t){return t&&"function"==typeof Symbol&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(t)}function o(t,e){for(var n=0;n<e.length;n++){var r=e[n];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(t,r.key,r)}}function s(t){return(s=Object.setPrototypeOf?Object.getPrototypeOf:function(t){return t.__proto__||Object.getPrototypeOf(t)})(t)}function a(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t}function c(t,e){return(c=Object.setPrototypeOf||function(t,e){return t.__proto__=e,t})(t,e)}function u(t){return{entries:(0,r.reduce)(t,function(t,e){return t[e.toString()]=0,t},{"+Inf":0}),sum:0,count:0,raw:[]}}var h=function(t){function e(){var t,n,r,i,o=arguments.length>0&&void 0!==arguments[0]?arguments[0]:[];return function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this,e),t=function(t,e){return!e||"object"!==V(e)&&"function"!=typeof e?a(t):e}(this,s(e).call(this)),n=a(t),i=void 0,(r="buckets")in n?Object.defineProperty(n,r,{value:i,enumerable:!0,configurable:!0,writable:!0}):n[r]=i,t.buckets=o.sort(function(t,e){return t>e?1:-1}),t.set(u(t.buckets)),t.observe=t.observe.bind(a(t)),t}var n,h,l;return function(t,e){if("function"!=typeof e&&null!==e)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(e&&e.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),e&&c(t,e)}(e,i.Collector),n=e,(h=[{key:"observe",value:function(t,e){var n=this.get(e);null==n&&(n=this.set(u(this.buckets),e).get(e)),n.value.raw.push(t),n.value.entries["+Inf"]+=1;var i=function(t,e){if(e<t[t.length-1])for(var n=0;n<t.length;n+=1)if(e<=t[n])return n}(this.buckets,t);if(null!=i)for(var V=i;V<this.buckets.length;V+=1){var o=n.value.entries[this.buckets[V].toString()];n.value.entries[this.buckets[V].toString()]=o+1}return n.value.sum=(0,r.sum)(n.value.raw),n.value.count+=1,this}},{key:"reset",value:function(t){this.set(u(this.buckets),t)}}])&&o(n.prototype,h),l&&o(n,l),e}();e.Histogram=h},function(t,e,n){},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingState=e.MessagingService=void 0;const r=n(145);Object.defineProperty(e,"MessagingService",{enumerable:!0,get:function(){return r.MessagingService}});const i=n(98);Object.defineProperty(e,"MessagingState",{enumerable:!0,get:function(){return i.MessagingState}})},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MessagingService=void 0;const r=n(155),i=n(146),V=n(148),o=n(58),s=n(98);e.MessagingService=class{constructor(t,e){this.options={autoReconnect:!0,reconnectTime:5e3,maxReconnectAttempts:3,connectionHeaders:{},maxReconnectLimitReached:()=>{},onReconnect:()=>{}},this.url=t,this.options=Object.assign(this.options,e),this.subscriptions={},this.connectionAttempts=0,this.state$=new i.BehaviorSubject(s.MessagingState.DISCONNECTED),this.messages$=new V.Subject,console.log("connect headers messaging: ",this.options.connectionHeaders);const n={connectHeaders:this.options.connectionHeaders,reconnectDelay:0,connectionTimeout:5e3,discardWebsocketOnCommFailure:!0,brokerURL:this.url.replace("https://","wss://").replace("http://","ws://")};this.stompClient=new r.Client(n),this.stompClient.onConnect=t=>this.onStompConnected(t),this.stompClient.onDisconnect=t=>{o.logger.log("Stomp client disconnected",t)},this.stompClient.onStompError=t=>{o.logger.log("Stomp client error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketError=t=>{o.logger.log("Stomp client web socket error",t),this.onStompClientConnectionClosed(t)},this.stompClient.onWebSocketClose=t=>{o.logger.log("Stomp client web socket closed",t),this.onStompClientConnectionClosed(t)}}connect(){this.disconnect(),o.logger.log("MessagingService | connecting..."),this.state$.next(s.MessagingState.CONNECTING),this.connectionAttempts++,this.stompClient.activate()}disconnect(){const t=this.state$.getValue();if(t===s.MessagingState.CONNECTED||t===s.MessagingState.CONNECTING){o.logger.log("Disconnecting stomp client");try{this.subscriptions={},this.stompClient.deactivate(),this.stompClient.forceDisconnect(),this.state$.next(s.MessagingState.DISCONNECTED)}catch(t){console.error("MessagingService | disconnect: error",t),this.state$.next(s.MessagingState.DISCONNECTED)}}}send(t,e){o.logger.log("MessagingService | send:",t,e);const n={"content-type":"application/json","x-auth-token":this.options.connectionHeaders["x-auth-token"]},r=JSON.stringify(e);this.stompClient.publish({destination:t,body:r,headers:n})}getTopic(t){o.logger.log("MessagingService | subscribeToTopic: "+t);const e=this.subscriptions[t];if(e)return o.logger.log("existing subscription... not re-subscribing to topic"),e;const n=new V.Subject;return this.stompClient.subscribe(t,t=>{n.next(t),this.messages$.next(t)}),this.subscriptions[t]=n,n}onStompConnected(t){o.logger.log("MessagingService | connected"),this.state$.next(s.MessagingState.CONNECTED),this.initMessagingSubscription(),this.connectionAttempts=0}onStompClientConnectionClosed(t){this.options.autoReconnect?this.options.maxReconnectAttempts&&this.connectionAttempts<this.options.maxReconnectAttempts?setTimeout(()=>{this.connect()},this.options.reconnectTime):this.options.maxReconnectLimitReached&&(this.options.maxReconnectLimitReached(),this.disconnect()):this.disconnect()}initMessagingSubscription(){o.logger.log("MessagingService | initMessagingSubscription");this.stompClient.subscribe("/",t=>{this.messages$.next(t)})}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(147))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);e.BehaviorSubject=r.BehaviorSubject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),function(t){for(var n in t)e.hasOwnProperty(n)||(e[n]=t[n])}(n(149))},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var r=n(45);e.Subject=r.Subject},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.MetricsService=void 0;const r=n(35),i=n(151),V=n(79);e.MetricsService=class{constructor(t,e,n){this.uneeqOptions=t,this.internalMessages=e,this.messages=n,this.clientPerformanceStats={},this.options=t,this.internalMessages$=e,this.messages$=n}parseAndLogWebRtcStats(t){try{t.forEach(t=>{var e,n;if("inbound-rtp"===t.type&&"video"===t.kind){this.clientPerformanceStats.frameHeight=new i.ClientPerformanceStat("Frame height",t.frameHeight),this.clientPerformanceStats.frameWidth=new i.ClientPerformanceStat("Frame width",t.frameWidth);const r=t.framesDropped,V=r?r-(null===(e=this.clientPerformanceStats.totalFramesDropped)||void 0===e?void 0:e.value):0;this.clientPerformanceStats.newFramesDropped=V?new i.ClientPerformanceStat("New Frames Dropped",V):new i.ClientPerformanceStat,this.clientPerformanceStats.totalFramesDropped=r?new i.ClientPerformanceStat("Total Frames Dropped",r):new i.ClientPerformanceStat;const o=t.packetsLost,s=o?o-(null===(n=this.clientPerformanceStats.inboundTotalPacketsLost)||void 0===n?void 0:n.value):0;this.clientPerformanceStats.inboundNewPacketsLost=s?new i.ClientPerformanceStat("New packets lost",s):new i.ClientPerformanceStat,this.clientPerformanceStats.inboundTotalPacketsLost=o?new i.ClientPerformanceStat("Total packets lost",o):new i.ClientPerformanceStat;const a=t.framesPerSecond;this.clientPerformanceStats.framesPerSec=a?new i.ClientPerformanceStat("Frames per second",a):new i.ClientPerformanceStat}else if("remote-inbound-rtp"===t.type&&"video"===t.kind){const e=t.roundTripTime;this.clientPerformanceStats.inboundRoundTripTime=e?new i.ClientPerformanceStat("Round Trip Time",e):new i.ClientPerformanceStat}else if("outbound-rtp"===t.type&&"video"===t.kind){const e=t.qualityLimitationReason;this.clientPerformanceStats.outboundQualityLimitationReason=new i.ClientPerformanceStat("Quality Limitation Reason",e)}}),this.options.enableClientPerformanceMessage&&this.messages$.next(new r.ClientPerformanceMessage(this.clientPerformanceStats));const e={type:V.PromMessageType.WebRtcPerformance,value:this.clientPerformanceStats};this.internalMessages$.next({faceMeMessageType:"prom",promMsg:e})}catch(t){console.warn("Unable to parseAndLogWebRTCStats",t)}}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.ClientPerformanceStat=void 0;e.ClientPerformanceStat=class{constructor(t="",e=0){this.label=t,this.value=e}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.OnlineStatusService=void 0;const r=n(35);e.OnlineStatusService=class{constructor(t,e){this.messages=t,this.offlineTimeoutLimitHandler=e,this.online=!0,this.offlineDisconnectTimeLimitMS=1e4,window.addEventListener("offline",()=>this.handleOffline()),window.addEventListener("online",()=>this.handleOnline())}handleOffline(){this.online=!1,this.disconnectTimer=setTimeout(()=>{this.offlineTimeoutLimitHandler()},this.offlineDisconnectTimeLimitMS),this.sendStatusUpdate()}handleOnline(){this.online=!0,window.clearTimeout(this.disconnectTimer),this.sendStatusUpdate()}sendStatusUpdate(){this.messages.next(new r.OnlineStatusUpdateMessage(this.online))}}},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.StreamManager=void 0;class r{constructor(){window.AudioContext=window.AudioContext||window.webkitAudioContext,this.silentAudioElement=document.createElement("audio"),this.silentAudioTrack=this.generateSilentAudioTrack(),this.canvasVideoTrack=this.generateCanvasVideoTrack()}addCanvasVideoTrackToStream(t){return t.getVideoTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.canvasVideoTrack),t}addSilentAudioTrackToStream(t){return t.getAudioTracks().forEach(e=>t.removeTrack(e)),t.addTrack(this.silentAudioTrack),t}remoteVideoReadyToPlay(){null!==this.silentAudioElement&&setTimeout(()=>{this.silentAudioElement.pause(),setTimeout(()=>{this.silentAudioElement.play()},500)},500)}resumeAudioContext(){this.audioContextInstance&&this.audioContextInstance.resume()}generateCanvasVideoTrack(){this.canvasInterval&&clearInterval(this.canvasInterval);const t=document.createElement("canvas");t.width=40,t.height=30;const e=t.getContext("2d");return this.canvasInterval=setInterval(()=>(e.fillStyle="#"+(16777216+16777215*Math.random()).toString(16).substr(1,6),e.fillRect(0,0,t.width,t.height),t),1e3),t.captureStream(1).getVideoTracks()[0]}generateSilentAudioTrack(){if(!this.audioSourceNode||!this.audioSourceDestination){this.silentAudioElement.loop=!0,this.silentAudioElement.volume=1;const t=(t=>{const e=t.indexOf(";base64,")+";base64,".length,n=t.substring(e),r=window.atob(n),i=r.length,V=new Uint8Array(new ArrayBuffer(i));for(let t=0;t<i;t++)V[t]=r.charCodeAt(t);return V})(r.audioData),e=new Blob([t],{type:"audio/mpeg"});this.silentAudioElement.src=URL.createObjectURL(e),this.silentAudioElement.play();const n=new window.AudioContext;this.audioContextInstance=n,this.audioSourceDestination=n.createMediaStreamDestination(),this.audioSourceNode=n.createMediaElementSource(this.silentAudioElement),this.audioSourceNode.connect(this.audioSourceDestination),this.audioSourceNode.connect(n.destination)}return this.audioSourceDestination.stream.getAudioTracks()[0]}}e.StreamManager=r,r.audioData="data:audio/mpeg;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU3LjgzLjEwMAAAAAAAAAAAAAAA//tUAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAASW5mbwAAAA8AAAArAABBQAAICA4OFBQaGhogICYmLCwsMjI3Nz09PUNDSUlPT09VVVtbYWFhZmZsbHJycnh4fn6EhISKipCQlpaWm5uhoaenp62ts7O5ubm/v8XFy8vL0NDW1tzc3OLi6Oju7u709Pr6//8AAAAATGF2YzU3LjEwAAAAAAAAAAAAAAAAJAPAAAAAAAAAQUCaftgR//uUZAAP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAETEFNRTMuMTAwVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVMQU1FMy4xMDBVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV//uUZFGP8AAAaQAAAAgAAA0gAAABAAABpAAAACAAADSAAAAEVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVVV"},function(t,e,n){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.SessionType=void 0,function(t){t[t.WEB=0]="WEB"}(e.SessionType||(e.SessionType={}))},function(t,e,n){"use strict";n.r(e);const r={LF:"\n",NULL:"\0"};class i{constructor(t){const{command:e,headers:n,body:r,binaryBody:i,escapeHeaderValues:V,skipContentLengthHeader:o}=t;this.command=e,this.headers=Object.assign({},n||{}),i?(this._binaryBody=i,this.isBinaryBody=!0):(this._body=r||"",this.isBinaryBody=!1),this.escapeHeaderValues=V||!1,this.skipContentLengthHeader=o||!1}get body(){return!this._body&&this.isBinaryBody&&(this._body=(new TextDecoder).decode(this._binaryBody)),this._body}get binaryBody(){return this._binaryBody||this.isBinaryBody||(this._binaryBody=(new TextEncoder).encode(this._body)),this._binaryBody}static fromRawFrame(t,e){const n={},r=t=>t.replace(/^\s+|\s+$/g,"");for(const V of t.headers.reverse()){V.indexOf(":");const o=r(V[0]);let s=r(V[1]);e&&"CONNECT"!==t.command&&"CONNECTED"!==t.command&&(s=i.hdrValueUnEscape(s)),n[o]=s}return new i({command:t.command,headers:n,binaryBody:t.binaryBody,escapeHeaderValues:e})}toString(){return this.serializeCmdAndHeaders()}serialize(){const t=this.serializeCmdAndHeaders();return this.isBinaryBody?i.toUnit8Array(t,this._binaryBody).buffer:t+this._body+r.NULL}serializeCmdAndHeaders(){const t=[this.command];this.skipContentLengthHeader&&delete this.headers["content-length"];for(const e of Object.keys(this.headers||{})){const n=this.headers[e];this.escapeHeaderValues&&"CONNECT"!==this.command&&"CONNECTED"!==this.command?t.push(`${e}:${i.hdrValueEscape(`${n}`)}`):t.push(`${e}:${n}`)}return(this.isBinaryBody||!this.isBodyEmpty()&&!this.skipContentLengthHeader)&&t.push(`content-length:${this.bodyLength()}`),t.join(r.LF)+r.LF+r.LF}isBodyEmpty(){return 0===this.bodyLength()}bodyLength(){const t=this.binaryBody;return t?t.length:0}static sizeOfUTF8(t){return t?(new TextEncoder).encode(t).length:0}static toUnit8Array(t,e){const n=(new TextEncoder).encode(t),r=new Uint8Array([0]),i=new Uint8Array(n.length+e.length+r.length);return i.set(n),i.set(e,n.length),i.set(r,n.length+e.length),i}static marshall(t){return new i(t).serialize()}static hdrValueEscape(t){return t.replace(/\\/g,"\\\\").replace(/\r/g,"\\r").replace(/\n/g,"\\n").replace(/:/g,"\\c")}static hdrValueUnEscape(t){return t.replace(/\\r/g,"\r").replace(/\\n/g,"\n").replace(/\\c/g,":").replace(/\\\\/g,"\\")}}const V=0,o=10,s=13,a=58;class c{constructor(t,e){this.onFrame=t,this.onIncomingPing=e,this._encoder=new TextEncoder,this._decoder=new TextDecoder,this._token=[],this._initState()}parseChunk(t,e=!1){let n;if(n=t instanceof ArrayBuffer?new Uint8Array(t):this._encoder.encode(t),e&&0!==n[n.length-1]){const t=new Uint8Array(n.length+1);t.set(n,0),t[n.length]=0,n=t}for(let t=0;t<n.length;t++){const e=n[t];this._onByte(e)}}_collectFrame(t){t!==V&&t!==s&&(t!==o?(this._onByte=this._collectCommand,this._reinjectByte(t)):this.onIncomingPing())}_collectCommand(t){if(t!==s)return t===o?(this._results.command=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_collectHeaders(t){t!==s&&(t!==o?(this._onByte=this._collectHeaderKey,this._reinjectByte(t)):this._setupCollectBody())}_reinjectByte(t){this._onByte(t)}_collectHeaderKey(t){if(t===a)return this._headerKey=this._consumeTokenAsUTF8(),void(this._onByte=this._collectHeaderValue);this._consumeByte(t)}_collectHeaderValue(t){if(t!==s)return t===o?(this._results.headers.push([this._headerKey,this._consumeTokenAsUTF8()]),this._headerKey=void 0,void(this._onByte=this._collectHeaders)):void this._consumeByte(t)}_setupCollectBody(){const t=this._results.headers.filter(t=>"content-length"===t[0])[0];t?(this._bodyBytesRemaining=parseInt(t[1],10),this._onByte=this._collectBodyFixedSize):this._onByte=this._collectBodyNullTerminated}_collectBodyNullTerminated(t){t!==V?this._consumeByte(t):this._retrievedBody()}_collectBodyFixedSize(t){0!=this._bodyBytesRemaining--?this._consumeByte(t):this._retrievedBody()}_retrievedBody(){this._results.binaryBody=this._consumeTokenAsRaw(),this.onFrame(this._results),this._initState()}_consumeByte(t){this._token.push(t)}_consumeTokenAsUTF8(){return this._decoder.decode(this._consumeTokenAsRaw())}_consumeTokenAsRaw(){const t=new Uint8Array(this._token);return this._token=[],t}_initState(){this._results={command:void 0,headers:[],binaryBody:void 0},this._token=[],this._headerKey=void 0,this._onByte=this._collectFrame}}var u,h;!function(t){t[t.CONNECTING=0]="CONNECTING",t[t.OPEN=1]="OPEN",t[t.CLOSING=2]="CLOSING",t[t.CLOSED=3]="CLOSED"}(u||(u={})),function(t){t[t.ACTIVE=0]="ACTIVE",t[t.DEACTIVATING=1]="DEACTIVATING",t[t.INACTIVE=2]="INACTIVE"}(h||(h={}));class l{constructor(t){this.versions=t}supportedVersions(){return this.versions.join(",")}protocolVersions(){return this.versions.map(t=>`v${t.replace(".","")}.stomp`)}}l.V1_0="1.0",l.V1_1="1.1",l.V1_2="1.2",l.default=new l([l.V1_0,l.V1_1,l.V1_2]);class f{constructor(t,e,n={}){this._client=t,this._webSocket=e,this._serverFrameHandlers={CONNECTED:t=>{this.debug(`connected to server ${t.headers.server}`),this._connected=!0,this._connectedVersion=t.headers.version,this._connectedVersion===l.V1_2&&(this._escapeHeaderValues=!0),this._setupHeartbeat(t.headers),this.onConnect(t)},MESSAGE:t=>{const e=t.headers.subscription,n=this._subscriptions[e]||this.onUnhandledMessage,r=t,i=this,V=this._connectedVersion===l.V1_2?r.headers.ack:r.headers["message-id"];r.ack=(t={})=>i.ack(V,e,t),r.nack=(t={})=>i.nack(V,e,t),n(r)},RECEIPT:t=>{const e=this._receiptWatchers[t.headers["receipt-id"]];e?(e(t),delete this._receiptWatchers[t.headers["receipt-id"]]):this.onUnhandledReceipt(t)},ERROR:t=>{this.onStompError(t)}},this._counter=0,this._subscriptions={},this._receiptWatchers={},this._partialData="",this._escapeHeaderValues=!1,this._lastServerActivityTS=Date.now(),this.configure(n)}get connectedVersion(){return this._connectedVersion}get connected(){return this._connected}configure(t){Object.assign(this,t)}start(){const t=new c(t=>{const e=i.fromRawFrame(t,this._escapeHeaderValues);this.logRawCommunication||this.debug(`<<< ${e}`),(this._serverFrameHandlers[e.command]||this.onUnhandledFrame)(e)},()=>{this.debug("<<< PONG")});this._webSocket.onmessage=e=>{if(this.debug("Received data"),this._lastServerActivityTS=Date.now(),this.logRawCommunication){const t=e.data instanceof ArrayBuffer?(new TextDecoder).decode(e.data):e.data;this.debug(`<<< ${t}`)}t.parseChunk(e.data,this.appendMissingNULLonIncoming)},this._onclose=t=>{this.debug(`Connection closed to ${this._client.brokerURL}`),this._cleanUp(),this.onWebSocketClose(t)},this._webSocket.onclose=this._onclose,this._webSocket.onerror=t=>{this.onWebSocketError(t)},this._webSocket.onopen=()=>{const t=Object.assign({},this.connectHeaders);this.debug("Web Socket Opened..."),t["accept-version"]=this.stompVersions.supportedVersions(),t["heart-beat"]=[this.heartbeatOutgoing,this.heartbeatIncoming].join(","),this._transmit({command:"CONNECT",headers:t})}}_setupHeartbeat(t){if(t.version!==l.V1_1&&t.version!==l.V1_2)return;if(!t["heart-beat"])return;const[e,n]=t["heart-beat"].split(",").map(t=>parseInt(t,10));if(0!==this.heartbeatOutgoing&&0!==n){const t=Math.max(this.heartbeatOutgoing,n);this.debug(`send PING every ${t}ms`),this._pinger=setInterval(()=>{this._webSocket.readyState===u.OPEN&&(this._webSocket.send(r.LF),this.debug(">>> PING"))},t)}if(0!==this.heartbeatIncoming&&0!==e){const t=Math.max(this.heartbeatIncoming,e);this.debug(`check PONG every ${t}ms`),this._ponger=setInterval(()=>{const e=Date.now()-this._lastServerActivityTS;e>2*t&&(this.debug(`did not receive server activity for the last ${e}ms`),this._closeOrDiscardWebsocket())},t)}}_closeOrDiscardWebsocket(){this.discardWebsocketOnCommFailure?(this.debug("Discarding websocket, the underlying socket may linger for a while"),this._discardWebsocket()):(this.debug("Issuing close on the websocket"),this._closeWebsocket())}forceDisconnect(){this._webSocket&&(this._webSocket.readyState!==u.CONNECTING&&this._webSocket.readyState!==u.OPEN||this._closeOrDiscardWebsocket())}_closeWebsocket(){this._webSocket.onmessage=()=>{},this._webSocket.close()}_discardWebsocket(){var t,e;this._webSocket.terminate||(t=this._webSocket,e=t=>this.debug(t),t.terminate=function(){const t=()=>{};this.onerror=t,this.onmessage=t,this.onopen=t;const n=new Date,r=this.onclose;this.onclose=t=>{const r=(new Date).getTime()-n.getTime();e(`Discarded socket closed after ${r}ms, with code/reason: ${t.code}/${t.reason}`)},this.close(),r.call(this,{code:4001,reason:"Heartbeat failure, discarding the socket",wasClean:!1})}),this._webSocket.terminate()}_transmit(t){const{command:e,headers:n,body:r,binaryBody:V,skipContentLengthHeader:o}=t,s=new i({command:e,headers:n,body:r,binaryBody:V,escapeHeaderValues:this._escapeHeaderValues,skipContentLengthHeader:o});let a=s.serialize();if(this.logRawCommunication?this.debug(`>>> ${a}`):this.debug(`>>> ${s}`),this.forceBinaryWSFrames&&"string"==typeof a&&(a=(new TextEncoder).encode(a)),"string"==typeof a&&this.splitLargeFrames){let t=a;for(;t.length>0;){const e=t.substring(0,this.maxWebSocketChunkSize);t=t.substring(this.maxWebSocketChunkSize),this._webSocket.send(e),this.debug(`chunk sent = ${e.length}, remaining = ${t.length}`)}}else this._webSocket.send(a)}dispose(){if(this.connected)try{const t=Object.assign({},this.disconnectHeaders);t.receipt||(t.receipt=`close-${this._counter++}`),this.watchForReceipt(t.receipt,t=>{this._closeWebsocket(),this._cleanUp(),this.onDisconnect(t)}),this._transmit({command:"DISCONNECT",headers:t})}catch(t){this.debug(`Ignoring error during disconnect ${t}`)}else this._webSocket.readyState!==u.CONNECTING&&this._webSocket.readyState!==u.OPEN||this._closeWebsocket()}_cleanUp(){this._connected=!1,this._pinger&&clearInterval(this._pinger),this._ponger&&clearInterval(this._ponger)}publish(t){const{destination:e,headers:n,body:r,binaryBody:i,skipContentLengthHeader:V}=t,o=Object.assign({destination:e},n);this._transmit({command:"SEND",headers:o,body:r,binaryBody:i,skipContentLengthHeader:V})}watchForReceipt(t,e){this._receiptWatchers[t]=e}subscribe(t,e,n={}){(n=Object.assign({},n)).id||(n.id=`sub-${this._counter++}`),n.destination=t,this._subscriptions[n.id]=e,this._transmit({command:"SUBSCRIBE",headers:n});const r=this;return{id:n.id,unsubscribe:t=>r.unsubscribe(n.id,t)}}unsubscribe(t,e={}){e=Object.assign({},e),delete this._subscriptions[t],e.id=t,this._transmit({command:"UNSUBSCRIBE",headers:e})}begin(t){const e=t||`tx-${this._counter++}`;this._transmit({command:"BEGIN",headers:{transaction:e}});const n=this;return{id:e,commit(){n.commit(e)},abort(){n.abort(e)}}}commit(t){this._transmit({command:"COMMIT",headers:{transaction:t}})}abort(t){this._transmit({command:"ABORT",headers:{transaction:t}})}ack(t,e,n={}){n=Object.assign({},n),this._connectedVersion===l.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"ACK",headers:n})}nack(t,e,n={}){return n=Object.assign({},n),this._connectedVersion===l.V1_2?n.id=t:n["message-id"]=t,n.subscription=e,this._transmit({command:"NACK",headers:n})}}var d=function(t,e,n,r){return new(n||(n=Promise))(function(i,V){function o(t){try{a(r.next(t))}catch(t){V(t)}}function s(t){try{a(r.throw(t))}catch(t){V(t)}}function a(t){var e;t.done?i(t.value):(e=t.value,e instanceof n?e:new n(function(t){t(e)})).then(o,s)}a((r=r.apply(t,e||[])).next())})};class p{constructor(t={}){this.stompVersions=l.default,this.connectionTimeout=1e4,this.reconnectDelay=5e3,this.heartbeatIncoming=1e4,this.heartbeatOutgoing=1e4,this.splitLargeFrames=!1,this.maxWebSocketChunkSize=8192,this.forceBinaryWSFrames=!1,this.appendMissingNULLonIncoming=!1,this.state=h.INACTIVE;const e=()=>{};this.debug=e,this.beforeConnect=e,this.onConnect=e,this.onDisconnect=e,this.onUnhandledMessage=e,this.onUnhandledReceipt=e,this.onUnhandledFrame=e,this.onStompError=e,this.onWebSocketClose=e,this.onWebSocketError=e,this.logRawCommunication=!1,this.onChangeState=e,this.connectHeaders={},this._disconnectHeaders={},this.configure(t)}get webSocket(){return this._stompHandler?this._stompHandler._webSocket:void 0}get disconnectHeaders(){return this._disconnectHeaders}set disconnectHeaders(t){this._disconnectHeaders=t,this._stompHandler&&(this._stompHandler.disconnectHeaders=this._disconnectHeaders)}get connected(){return!!this._stompHandler&&this._stompHandler.connected}get connectedVersion(){return this._stompHandler?this._stompHandler.connectedVersion:void 0}get active(){return this.state===h.ACTIVE}_changeState(t){this.state=t,this.onChangeState(t)}configure(t){Object.assign(this,t)}activate(){if(this.state===h.DEACTIVATING)throw this.debug("Still DEACTIVATING, please await call to deactivate before trying to re-activate"),new Error("Still DEACTIVATING, can not activate now");this.active?this.debug("Already ACTIVE, ignoring request to activate"):(this._changeState(h.ACTIVE),this._connect())}_connect(){return d(this,void 0,void 0,function*(){if(this.connected)return void this.debug("STOMP: already connected, nothing to do");if(yield this.beforeConnect(),!this.active)return void this.debug("Client has been marked inactive, will not attempt to connect");this.connectionTimeout>0&&(this._connectionWatcher=setTimeout(()=>{this.debug(`Connection not established in ${this.connectionTimeout}ms, closing socket`),this.forceDisconnect()},this.connectionTimeout)),this.debug("Opening Web Socket...");const t=this._createWebSocket();this._stompHandler=new f(this,t,{debug:this.debug,stompVersions:this.stompVersions,connectHeaders:this.connectHeaders,disconnectHeaders:this._disconnectHeaders,heartbeatIncoming:this.heartbeatIncoming,heartbeatOutgoing:this.heartbeatOutgoing,splitLargeFrames:this.splitLargeFrames,maxWebSocketChunkSize:this.maxWebSocketChunkSize,forceBinaryWSFrames:this.forceBinaryWSFrames,logRawCommunication:this.logRawCommunication,appendMissingNULLonIncoming:this.appendMissingNULLonIncoming,discardWebsocketOnCommFailure:this.discardWebsocketOnCommFailure,onConnect:t=>{if(this._connectionWatcher&&(clearTimeout(this._connectionWatcher),this._connectionWatcher=void 0),!this.active)return this.debug("STOMP got connected while deactivate was issued, will disconnect now"),void this._disposeStompHandler();this.onConnect(t)},onDisconnect:t=>{this.onDisconnect(t)},onStompError:t=>{this.onStompError(t)},onWebSocketClose:t=>{this._stompHandler=void 0,this.state===h.DEACTIVATING&&(this._resolveSocketClose(),this._resolveSocketClose=void 0,this._changeState(h.INACTIVE)),this.onWebSocketClose(t),this.active&&this._schedule_reconnect()},onWebSocketError:t=>{this.onWebSocketError(t)},onUnhandledMessage:t=>{this.onUnhandledMessage(t)},onUnhandledReceipt:t=>{this.onUnhandledReceipt(t)},onUnhandledFrame:t=>{this.onUnhandledFrame(t)}}),this._stompHandler.start()})}_createWebSocket(){let t;return(t=this.webSocketFactory?this.webSocketFactory():new WebSocket(this.brokerURL,this.stompVersions.protocolVersions())).binaryType="arraybuffer",t}_schedule_reconnect(){this.reconnectDelay>0&&(this.debug(`STOMP: scheduling reconnection in ${this.reconnectDelay}ms`),this._reconnector=setTimeout(()=>{this._connect()},this.reconnectDelay))}deactivate(){return d(this,void 0,void 0,function*(){let t;return this.state!==h.ACTIVE?(this.debug(`Already ${h[this.state]}, ignoring call to deactivate`),Promise.resolve()):(this._changeState(h.DEACTIVATING),this._reconnector&&clearTimeout(this._reconnector),this._stompHandler&&this.webSocket.readyState!==u.CLOSED?(t=new Promise((t,e)=>{this._resolveSocketClose=t}),this._disposeStompHandler(),t):(this._changeState(h.INACTIVE),Promise.resolve()))})}forceDisconnect(){this._stompHandler&&this._stompHandler.forceDisconnect()}_disposeStompHandler(){this._stompHandler&&(this._stompHandler.dispose(),this._stompHandler=null)}publish(t){this._stompHandler.publish(t)}watchForReceipt(t,e){this._stompHandler.watchForReceipt(t,e)}subscribe(t,e,n={}){return this._stompHandler.subscribe(t,e,n)}unsubscribe(t,e={}){this._stompHandler.unsubscribe(t,e)}begin(t){return this._stompHandler.begin(t)}commit(t){this._stompHandler.commit(t)}abort(t){this._stompHandler.abort(t)}ack(t,e,n={}){this._stompHandler.ack(t,e,n)}nack(t,e,n={}){this._stompHandler.nack(t,e,n)}}class g{}class v{}class y{}class m{constructor(t){this.client=t}get outgoing(){return this.client.heartbeatOutgoing}set outgoing(t){this.client.heartbeatOutgoing=t}get incoming(){return this.client.heartbeatIncoming}set incoming(t){this.client.heartbeatIncoming=t}}class b extends p{constructor(t){super(),this.maxWebSocketFrameSize=16384,this._heartbeatInfo=new m(this),this.reconnect_delay=0,this.webSocketFactory=t,this.debug=(...t)=>{console.log(...t)}}_parseConnect(...t){let e,n,r,i={};if(t.length<2)throw new Error("Connect requires at least 2 arguments");if("function"==typeof t[1])[i,n,r,e]=t;else switch(t.length){case 6:[i.login,i.passcode,n,r,e,i.host]=t;break;default:[i.login,i.passcode,n,r,e]=t}return[i,n,r,e]}connect(...t){const e=this._parseConnect(...t);e[0]&&(this.connectHeaders=e[0]),e[1]&&(this.onConnect=e[1]),e[2]&&(this.onStompError=e[2]),e[3]&&(this.onWebSocketClose=e[3]),super.activate()}disconnect(t,e={}){t&&(this.onDisconnect=t),this.disconnectHeaders=e,super.deactivate()}send(t,e={},n=""){const r=!1===(e=Object.assign({},e))["content-length"];r&&delete e["content-length"],this.publish({destination:t,headers:e,body:n,skipContentLengthHeader:r})}set reconnect_delay(t){this.reconnectDelay=t}get ws(){return this.webSocket}get version(){return this.connectedVersion}get onreceive(){return this.onUnhandledMessage}set onreceive(t){this.onUnhandledMessage=t}get onreceipt(){return this.onUnhandledReceipt}set onreceipt(t){this.onUnhandledReceipt=t}get heartbeat(){return this._heartbeatInfo}set heartbeat(t){this.heartbeatIncoming=t.incoming,this.heartbeatOutgoing=t.outgoing}}class _{static client(t,e){null==e&&(e=l.default.protocolVersions());return new b(()=>{return new(_.WebSocketClass||WebSocket)(t,e)})}static over(t){let e;return"function"==typeof t?e=t:(console.warn("Stomp.over did not receive a factory, auto reconnect will not work. Please see https://stomp-js.github.io/api-docs/latest/classes/Stomp.html#over"),e=()=>t),new b(e)}}_.WebSocketClass=null,n.d(e,"Client",function(){return p}),n.d(e,"FrameImpl",function(){return i}),n.d(e,"Parser",function(){return c}),n.d(e,"StompConfig",function(){return g}),n.d(e,"StompHeaders",function(){return v}),n.d(e,"StompSubscription",function(){return y}),n.d(e,"StompSocketState",function(){return u}),n.d(e,"ActivationState",function(){return h}),n.d(e,"Versions",function(){return l}),n.d(e,"CompatClient",function(){return b}),n.d(e,"Stomp",function(){return _})}]));