@chativa/connector-directline 0.4.0 → 0.5.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.
|
@@ -0,0 +1,2 @@
|
|
|
1
|
+
var ChativaDirectLine=function(t){"use strict";var e="undefined"!=typeof globalThis?globalThis:"undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{};function r(t){if(Object.prototype.hasOwnProperty.call(t,"__esModule"))return t;var e=t.default;if("function"==typeof e){var r=function t(){var r=!1;try{r=this instanceof t}catch{}return r?Reflect.construct(e,arguments,this.constructor):e.apply(this,arguments)};r.prototype=e.prototype}else r={};return Object.defineProperty(r,"__esModule",{value:!0}),Object.keys(t).forEach(function(e){var n=Object.getOwnPropertyDescriptor(t,e);Object.defineProperty(r,e,n.get?n:{enumerable:!0,get:function(){return t[e]}})}),r}var n,o={},i={exports:{}};function s(){return n||(n=1,(t=i).exports=function(t){return t&&t.__esModule?t:{default:t}},t.exports.__esModule=!0,t.exports.default=t.exports),i.exports;var t}var a,u={exports:{}};function c(){return a||(a=1,function(t){function e(r){return t.exports=e="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.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(u)),u.exports}var f,l,h={exports:{}},p={exports:{}};function d(){return l||(l=1,t=h,e=function(){return f||(f=1,(t=p).exports=function(t,e){if(null==t)return{};var r={};for(var n in t)if({}.hasOwnProperty.call(t,n)){if(-1!==e.indexOf(n))continue;r[n]=t[n]}return r},t.exports.__esModule=!0,t.exports.default=t.exports),p.exports;var t}(),t.exports=function(t,r){if(null==t)return{};var n,o,i=e(t,r);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(t);for(o=0;o<s.length;o++)n=s[o],-1===r.indexOf(n)&&{}.propertyIsEnumerable.call(t,n)&&(i[n]=t[n])}return i},t.exports.__esModule=!0,t.exports.default=t.exports),h.exports;var t,e}var y,b={exports:{}};function v(){return y||(y=1,(t=b).exports=function(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")},t.exports.__esModule=!0,t.exports.default=t.exports),b.exports;var t}var m,g,w,_={exports:{}},S={exports:{}},x={exports:{}};function O(){return g||(g=1,t=S,e=c().default,r=function(){return m||(m=1,t=x,e=c().default,t.exports=function(t,r){if("object"!=e(t)||!t)return t;var n=t[Symbol.toPrimitive];if(void 0!==n){var o=n.call(t,r||"default");if("object"!=e(o))return o;throw new TypeError("@@toPrimitive must return a primitive value.")}return("string"===r?String:Number)(t)},t.exports.__esModule=!0,t.exports.default=t.exports),x.exports;var t,e}(),t.exports=function(t){var n=r(t,"string");return"symbol"==e(n)?n:n+""},t.exports.__esModule=!0,t.exports.default=t.exports),S.exports;var t,e,r}function E(){return w||(w=1,function(t){var e=O();function r(t,r){for(var n=0;n<r.length;n++){var o=r[n];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(t,e(o.key),o)}}t.exports=function(t,e,n){return e&&r(t.prototype,e),n&&r(t,n),Object.defineProperty(t,"prototype",{writable:!1}),t},t.exports.__esModule=!0,t.exports.default=t.exports}(_)),_.exports}var T,k={exports:{}};function j(){return T||(T=1,t=k,e=O(),t.exports=function(t,r,n){return(r=e(r))in t?Object.defineProperty(t,r,{value:n,enumerable:!0,configurable:!0,writable:!0}):t[r]=n,t},t.exports.__esModule=!0,t.exports.default=t.exports),k.exports;var t,e}var P,A,R={};function C(){if(A)return P;A=1;var t=function(t){return t&&t.Math==Math&&t};return P=t("object"==typeof globalThis&&globalThis)||t("object"==typeof window&&window)||t("object"==typeof self&&self)||t("object"==typeof e&&e)||function(){return this}()||Function("return this")()}var M,L,I,B,D={};function U(){return L?M:(L=1,M=function(t){try{return!!t()}catch(e){return!0}})}function N(){if(B)return I;B=1;var t=U();return I=!t(function(){return 7!=Object.defineProperty({},1,{get:function(){return 7}})[1]})}var q,H,F,W,$,G,z,V,J,Y,X,K,Q,Z,tt,et,rt,nt,ot,it,st,at,ut,ct,ft={};function lt(){return F?H:(F=1,H=function(t,e){return{enumerable:!(1&t),configurable:!(2&t),writable:!(4&t),value:e}})}function ht(){if($)return W;$=1;var t={}.toString;return W=function(e){return t.call(e).slice(8,-1)}}function pt(){return J?V:(J=1,V=function(t){if(null==t)throw TypeError("Can't call method on "+t);return t})}function dt(){if(X)return Y;X=1;var t=function(){if(z)return G;z=1;var t=U(),e=ht(),r="".split;return G=t(function(){return!Object("z").propertyIsEnumerable(0)})?function(t){return"String"==e(t)?r.call(t,""):Object(t)}:Object}(),e=pt();return Y=function(r){return t(e(r))}}function yt(){return Q?K:(Q=1,K=function(t){return"object"==typeof t?null!==t:"function"==typeof t})}function bt(){if(tt)return Z;tt=1;var t=yt();return Z=function(e,r){if(!t(e))return e;var n,o;if(r&&"function"==typeof(n=e.toString)&&!t(o=n.call(e)))return o;if("function"==typeof(n=e.valueOf)&&!t(o=n.call(e)))return o;if(!r&&"function"==typeof(n=e.toString)&&!t(o=n.call(e)))return o;throw TypeError("Can't convert object to primitive value")}}function vt(){if(rt)return et;rt=1;var t=pt();return et=function(e){return Object(t(e))}}function mt(){if(ot)return nt;ot=1;var t=vt(),e={}.hasOwnProperty;return nt=Object.hasOwn||function(r,n){return e.call(t(r),n)}}function gt(){if(st)return it;st=1;var t=C(),e=yt(),r=t.document,n=e(r)&&e(r.createElement);return it=function(t){return n?r.createElement(t):{}}}function wt(){if(ut)return at;ut=1;var t=N(),e=U(),r=gt();return at=!t&&!e(function(){return 7!=Object.defineProperty(r("div"),"a",{get:function(){return 7}}).a})}function _t(){if(ct)return D;ct=1;var t=N(),e=function(){if(q)return ft;q=1;var t={}.propertyIsEnumerable,e=Object.getOwnPropertyDescriptor,r=e&&!t.call({1:2},1);return ft.f=r?function(t){var r=e(this,t);return!!r&&r.enumerable}:t,ft}(),r=lt(),n=dt(),o=bt(),i=mt(),s=wt(),a=Object.getOwnPropertyDescriptor;return D.f=t?a:function(t,u){if(t=n(t),u=o(u,!0),s)try{return a(t,u)}catch(c){}if(i(t,u))return r(!e.f.call(t,u),t[u])},D}var St,xt,Ot,Et,Tt,kt={};function jt(){if(xt)return St;xt=1;var t=yt();return St=function(e){if(!t(e))throw TypeError(String(e)+" is not an object");return e}}function Pt(){if(Ot)return kt;Ot=1;var t=N(),e=wt(),r=jt(),n=bt(),o=Object.defineProperty;return kt.f=t?o:function(t,i,s){if(r(t),i=n(i,!0),r(s),e)try{return o(t,i,s)}catch(a){}if("get"in s||"set"in s)throw TypeError("Accessors not supported");return"value"in s&&(t[i]=s.value),t},kt}function At(){if(Tt)return Et;Tt=1;var t=N(),e=Pt(),r=lt();return Et=t?function(t,n,o){return e.f(t,n,r(1,o))}:function(t,e,r){return t[e]=r,t}}var Rt,Ct,Mt,Lt,It,Bt,Dt,Ut,Nt={exports:{}};function qt(){if(Ct)return Rt;Ct=1;var t=C(),e=At();return Rt=function(r,n){try{e(t,r,n)}catch(o){t[r]=n}return n}}function Ht(){if(Lt)return Mt;Lt=1;var t=C(),e=qt(),r="__core-js_shared__",n=t[r]||e(r,{});return Mt=n}function Ft(){if(Bt)return It;Bt=1;var t=Ht(),e=Function.toString;return"function"!=typeof t.inspectSource&&(t.inspectSource=function(t){return e.call(t)}),It=t.inspectSource}var Wt,$t,Gt,zt,Vt,Jt,Yt,Xt,Kt,Qt,Zt,te,ee,re,ne,oe,ie={exports:{}};function se(){return $t?Wt:($t=1,Wt=!1)}function ae(){if(Gt)return ie.exports;Gt=1;var t=se(),e=Ht();return(ie.exports=function(t,r){return e[t]||(e[t]=void 0!==r?r:{})})("versions",[]).push({version:"3.15.2",mode:t?"pure":"global",copyright:"© 2021 Denis Pushkarev (zloirock.ru)"}),ie.exports}function ue(){if(Vt)return zt;Vt=1;var t=0,e=Math.random();return zt=function(r){return"Symbol("+String(void 0===r?"":r)+")_"+(++t+e).toString(36)}}function ce(){if(Yt)return Jt;Yt=1;var t=ae(),e=ue(),r=t("keys");return Jt=function(t){return r[t]||(r[t]=e(t))}}function fe(){return Kt?Xt:(Kt=1,Xt={})}function le(){if(Zt)return Qt;Zt=1;var t,e,r,n=function(){if(Ut)return Dt;Ut=1;var t=C(),e=Ft(),r=t.WeakMap;return Dt="function"==typeof r&&/native code/.test(e(r))}(),o=C(),i=yt(),s=At(),a=mt(),u=Ht(),c=ce(),f=fe(),l="Object already initialized",h=o.WeakMap;if(n||u.state){var p=u.state||(u.state=new h),d=p.get,y=p.has,b=p.set;t=function(t,e){if(y.call(p,t))throw new TypeError(l);return e.facade=t,b.call(p,t,e),e},e=function(t){return d.call(p,t)||{}},r=function(t){return y.call(p,t)}}else{var v=c("state");f[v]=!0,t=function(t,e){if(a(t,v))throw new TypeError(l);return e.facade=t,s(t,v,e),e},e=function(t){return a(t,v)?t[v]:{}},r=function(t){return a(t,v)}}return Qt={set:t,get:e,has:r,enforce:function(n){return r(n)?e(n):t(n,{})},getterFor:function(t){return function(r){var n;if(!i(r)||(n=e(r)).type!==t)throw TypeError("Incompatible receiver, "+t+" required");return n}}}}function he(){if(te)return Nt.exports;te=1;var t=C(),e=At(),r=mt(),n=qt(),o=Ft(),i=le(),s=i.get,a=i.enforce,u=String(String).split("String");return(Nt.exports=function(o,i,s,c){var f,l=!!c&&!!c.unsafe,h=!!c&&!!c.enumerable,p=!!c&&!!c.noTargetGet;"function"==typeof s&&("string"!=typeof i||r(s,"name")||e(s,"name",i),(f=a(s)).source||(f.source=u.join("string"==typeof i?i:""))),o!==t?(l?!p&&o[i]&&(h=!0):delete o[i],h?o[i]=s:e(o,i,s)):h?o[i]=s:n(i,s)})(Function.prototype,"toString",function(){return"function"==typeof this&&s(this).source||o(this)}),Nt.exports}function pe(){if(re)return ee;re=1;var t=C();return ee=t}function de(){if(oe)return ne;oe=1;var t=pe(),e=C(),r=function(t){return"function"==typeof t?t:void 0};return ne=function(n,o){return arguments.length<2?r(t[n])||r(e[n]):t[n]&&t[n][o]||e[n]&&e[n][o]},ne}var ye,be,ve,me,ge,we,_e,Se,xe,Oe,Ee,Te,ke,je={};function Pe(){if(be)return ye;be=1;var t=Math.ceil,e=Math.floor;return ye=function(r){return isNaN(r=+r)?0:(r>0?e:t)(r)}}function Ae(){if(me)return ve;me=1;var t=Pe(),e=Math.min;return ve=function(r){return r>0?e(t(r),9007199254740991):0}}function Re(){if(Se)return _e;Se=1;var t=dt(),e=Ae(),r=function(){if(we)return ge;we=1;var t=Pe(),e=Math.max,r=Math.min;return ge=function(n,o){var i=t(n);return i<0?e(i+o,0):r(i,o)}}(),n=function(n){return function(o,i,s){var a,u=t(o),c=e(u.length),f=r(s,c);if(n&&i!=i){for(;c>f;)if((a=u[f++])!=a)return!0}else for(;c>f;f++)if((n||f in u)&&u[f]===i)return n||f||0;return!n&&-1}};return _e={includes:n(!0),indexOf:n(!1)}}function Ce(){if(Oe)return xe;Oe=1;var t=mt(),e=dt(),r=Re().indexOf,n=fe();return xe=function(o,i){var s,a=e(o),u=0,c=[];for(s in a)!t(n,s)&&t(a,s)&&c.push(s);for(;i.length>u;)t(a,s=i[u++])&&(~r(c,s)||c.push(s));return c}}function Me(){return Te?Ee:(Te=1,Ee=["constructor","hasOwnProperty","isPrototypeOf","propertyIsEnumerable","toLocaleString","toString","valueOf"])}var Le,Ie,Be,De,Ue,Ne,qe,He,Fe,We,$e,Ge,ze,Ve,Je,Ye,Xe,Ke,Qe,Ze,tr,er,rr,nr,or,ir,sr,ar,ur,cr,fr,lr,hr,pr,dr,yr,br,vr,mr,gr,wr,_r,Sr,xr,Or,Er,Tr,kr,jr,Pr,Ar,Rr,Cr,Mr,Lr={};function Ir(){if(Be)return Ie;Be=1;var t=de(),e=function(){if(ke)return je;ke=1;var t=Ce(),e=Me().concat("length","prototype");return je.f=Object.getOwnPropertyNames||function(r){return t(r,e)},je}(),r=(Le||(Le=1,Lr.f=Object.getOwnPropertySymbols),Lr),n=jt();return Ie=t("Reflect","ownKeys")||function(t){var o=e.f(n(t)),i=r.f;return i?o.concat(i(t)):o}}function Br(){if(qe)return Ne;qe=1;var t=U(),e=/#|\.prototype\./,r=function(e,r){var a=o[n(e)];return a==s||a!=i&&("function"==typeof r?t(r):!!r)},n=r.normalize=function(t){return String(t).replace(e,".").toLowerCase()},o=r.data={},i=r.NATIVE="N",s=r.POLYFILL="P";return Ne=r}function Dr(){if(Fe)return He;Fe=1;var t=C(),e=_t().f,r=At(),n=he(),o=qt(),i=function(){if(Ue)return De;Ue=1;var t=mt(),e=Ir(),r=_t(),n=Pt();return De=function(o,i){for(var s=e(i),a=n.f,u=r.f,c=0;c<s.length;c++){var f=s[c];t(o,f)||a(o,f,u(i,f))}}}(),s=Br();return He=function(a,u){var c,f,l,h,p,d=a.target,y=a.global,b=a.stat;if(c=y?t:b?t[d]||o(d,{}):(t[d]||{}).prototype)for(f in u){if(h=u[f],l=a.noTargetGet?(p=e(c,f))&&p.value:c[f],!s(y?f:d+(b?".":"#")+f,a.forced)&&void 0!==l){if(typeof h==typeof l)continue;i(h,l)}(a.sham||l&&l.sham)&&r(h,"sham",!0),n(c,f,h,a)}}}function Ur(){if(ze)return Ge;ze=1;var t=mt(),e=vt(),r=ce(),n=function(){if($e)return We;$e=1;var t=U();return We=!t(function(){function t(){}return t.prototype.constructor=null,Object.getPrototypeOf(new t)!==t.prototype})}(),o=r("IE_PROTO"),i=Object.prototype;return Ge=n?Object.getPrototypeOf:function(r){return r=e(r),t(r,o)?r[o]:"function"==typeof r.constructor&&r instanceof r.constructor?r.constructor.prototype:r instanceof Object?i:null}}function Nr(){if(Xe)return Ye;Xe=1;var t=jt(),e=function(){if(Je)return Ve;Je=1;var t=yt();return Ve=function(e){if(!t(e)&&null!==e)throw TypeError("Can't set "+String(e)+" as a prototype");return e}}();return Ye=Object.setPrototypeOf||("__proto__"in{}?function(){var r,n=!1,o={};try{(r=Object.getOwnPropertyDescriptor(Object.prototype,"__proto__").set).call(o,[]),n=o instanceof Array}catch(i){}return function(o,i){return t(o),e(i),n?r.call(o,i):o.__proto__=i,o}}():void 0)}function qr(){if(tr)return Ze;tr=1;var t=N(),e=Pt(),r=jt(),n=function(){if(Qe)return Ke;Qe=1;var t=Ce(),e=Me();return Ke=Object.keys||function(r){return t(r,e)}}();return Ze=t?Object.defineProperties:function(t,o){r(t);for(var i,s=n(o),a=s.length,u=0;a>u;)e.f(t,i=s[u++],o[i]);return t}}function Hr(){if(rr)return er;rr=1;var t=de();return er=t("document","documentElement")}function Fr(){if(or)return nr;or=1;var t,e=jt(),r=qr(),n=Me(),o=fe(),i=Hr(),s=gt(),a=ce(),u="prototype",c="script",f=a("IE_PROTO"),l=function(){},h=function(t){return"<"+c+">"+t+"</"+c+">"},p=function(){try{t=document.domain&&new ActiveXObject("htmlfile")}catch(f){}var e,r,o;p=t?function(t){t.write(h("")),t.close();var e=t.parentWindow.Object;return t=null,e}(t):(r=s("iframe"),o="java"+c+":",r.style.display="none",i.appendChild(r),r.src=String(o),(e=r.contentWindow.document).open(),e.write(h("document.F=Object")),e.close(),e.F);for(var a=n.length;a--;)delete p[u][n[a]];return p()};return o[f]=!0,nr=Object.create||function(t,n){var o;return null!==t?(l[u]=e(t),o=new l,l[u]=null,o[f]=t):o=p(),void 0===n?o:r(o,n)}}function Wr(){if(sr)return ir;sr=1;var t=de();return ir=t("navigator","userAgent")||""}function $r(){if(ur)return ar;ur=1;var t,e,r=C(),n=Wr(),o=r.process,i=o&&o.versions,s=i&&i.v8;return s?e=(t=s.split("."))[0]<4?1:t[0]+t[1]:n&&(!(t=n.match(/Edge\/(\d+)/))||t[1]>=74)&&(t=n.match(/Chrome\/(\d+)/))&&(e=t[1]),ar=e&&+e}function Gr(){if(fr)return cr;fr=1;var t=$r(),e=U();return cr=!!Object.getOwnPropertySymbols&&!e(function(){var e=Symbol();return!String(e)||!(Object(e)instanceof Symbol)||!Symbol.sham&&t&&t<41})}function zr(){if(dr)return pr;dr=1;var t=C(),e=ae(),r=mt(),n=ue(),o=Gr(),i=function(){if(hr)return lr;hr=1;var t=Gr();return lr=t&&!Symbol.sham&&"symbol"==typeof Symbol.iterator}(),s=e("wks"),a=t.Symbol,u=i?a:a&&a.withoutSetter||n;return pr=function(t){return r(s,t)&&(o||"string"==typeof s[t])||(o&&r(a,t)?s[t]=a[t]:s[t]=u("Symbol."+t)),s[t]}}function Vr(){return br?yr:(br=1,yr={})}function Jr(){return wr?gr:(wr=1,gr=function(t){if("function"!=typeof t)throw TypeError(String(t)+" is not a function");return t})}function Yr(){if(Sr)return _r;Sr=1;var t=Jr();return _r=function(e,r,n){if(t(e),void 0===r)return e;switch(n){case 0:return function(){return e.call(r)};case 1:return function(t){return e.call(r,t)};case 2:return function(t,n){return e.call(r,t,n)};case 3:return function(t,n,o){return e.call(r,t,n,o)}}return function(){return e.apply(r,arguments)}},_r}function Xr(){if(Or)return xr;Or=1;var t={};return t[zr()("toStringTag")]="z",xr="[object z]"===String(t)}function Kr(){if(Tr)return Er;Tr=1;var t=Xr(),e=ht(),r=zr()("toStringTag"),n="Arguments"==e(function(){return arguments}());return Er=t?e:function(t){var o,i,s;return void 0===t?"Undefined":null===t?"Null":"string"==typeof(i=function(t,e){try{return t[e]}catch(r){}}(o=Object(t),r))?i:n?e(o):"Object"==(s=e(o))&&"function"==typeof o.callee?"Arguments":s}}function Qr(){if(Cr)return Rr;Cr=1;var t=jt(),e=function(){if(mr)return vr;mr=1;var t=zr(),e=Vr(),r=t("iterator"),n=Array.prototype;return vr=function(t){return void 0!==t&&(e.Array===t||n[r]===t)}}(),r=Ae(),n=Yr(),o=function(){if(jr)return kr;jr=1;var t=Kr(),e=Vr(),r=zr()("iterator");return kr=function(n){if(null!=n)return n[r]||n["@@iterator"]||e[t(n)]}}(),i=function(){if(Ar)return Pr;Ar=1;var t=jt();return Pr=function(e){var r=e.return;if(void 0!==r)return t(r.call(e)).value}}(),s=function(t,e){this.stopped=t,this.result=e};return Rr=function(a,u,c){var f,l,h,p,d,y,b,v=c&&c.that,m=!(!c||!c.AS_ENTRIES),g=!(!c||!c.IS_ITERATOR),w=!(!c||!c.INTERRUPTED),_=n(u,v,1+m+w),S=function(t){return f&&i(f),new s(!0,t)},x=function(e){return m?(t(e),w?_(e[0],e[1],S):_(e[0],e[1])):w?_(e,S):_(e)};if(g)f=a;else{if("function"!=typeof(l=o(a)))throw TypeError("Target is not iterable");if(e(l)){for(h=0,p=r(a.length);p>h;h++)if((d=x(a[h]))&&d instanceof s)return d;return new s(!1)}f=l.call(a)}for(y=f.next;!(b=y.call(f)).done;){try{d=x(b.value)}catch(O){throw i(f),O}if("object"==typeof d&&d&&d instanceof s)return d}return new s(!1)}}function Zr(){if(Mr)return R;Mr=1;var t=Dr(),e=Ur(),r=Nr(),n=Fr(),o=At(),i=lt(),s=Qr(),a=function(t,n){var i=this;if(!(i instanceof a))return new a(t,n);r&&(i=r(new Error(void 0),e(i))),void 0!==n&&o(i,"message",String(n));var u=[];return s(t,u.push,{that:u}),o(i,"errors",u),i};return a.prototype=n(Error.prototype,{constructor:i(5,a),message:i(5,""),name:i(5,"AggregateError")}),t({global:!0},{AggregateError:a}),R}var tn,en,rn,nn={};function on(){if(rn)return nn;rn=1;var t=Xr(),e=he(),r=function(){if(en)return tn;en=1;var t=Xr(),e=Kr();return tn=t?{}.toString:function(){return"[object "+e(this)+"]"}}();return t||e(Object.prototype,"toString",r,{unsafe:!0}),nn}var sn,an,un,cn,fn,ln,hn,pn,dn,yn,bn,vn,mn,gn,wn,_n,Sn,xn,On,En,Tn,kn,jn,Pn,An={};function Rn(){if(an)return sn;an=1;var t=C();return sn=t.Promise}function Cn(){if(ln)return fn;ln=1;var t=Pt().f,e=mt(),r=zr()("toStringTag");return fn=function(n,o,i){n&&!e(n=i?n:n.prototype,r)&&t(n,r,{configurable:!0,value:o})}}function Mn(){if(gn)return mn;gn=1;var t=jt(),e=Jr(),r=zr()("species");return mn=function(n,o){var i,s=t(n).constructor;return void 0===s||null==(i=t(s)[r])?o:e(i)}}function Ln(){if(_n)return wn;_n=1;var t=Wr();return wn=/(?:iphone|ipod|ipad).*applewebkit/i.test(t)}function In(){if(xn)return Sn;xn=1;var t=ht(),e=C();return Sn="process"==t(e.process)}function Bn(){if(En)return On;En=1;var t,e,r,n=C(),o=U(),i=Yr(),s=Hr(),a=gt(),u=Ln(),c=In(),f=n.location,l=n.setImmediate,h=n.clearImmediate,p=n.process,d=n.MessageChannel,y=n.Dispatch,b=0,v={},m="onreadystatechange",g=function(t){if(v.hasOwnProperty(t)){var e=v[t];delete v[t],e()}},w=function(t){return function(){g(t)}},_=function(t){g(t.data)},S=function(t){n.postMessage(t+"",f.protocol+"//"+f.host)};return l&&h||(l=function(e){for(var r=[],n=1;arguments.length>n;)r.push(arguments[n++]);return v[++b]=function(){("function"==typeof e?e:Function(e)).apply(void 0,r)},t(b),b},h=function(t){delete v[t]},c?t=function(t){p.nextTick(w(t))}:y&&y.now?t=function(t){y.now(w(t))}:d&&!u?(r=(e=new d).port2,e.port1.onmessage=_,t=i(r.postMessage,r,1)):n.addEventListener&&"function"==typeof postMessage&&!n.importScripts&&f&&"file:"!==f.protocol&&!o(S)?(t=S,n.addEventListener("message",_,!1)):t=m in a("script")?function(t){s.appendChild(a("script"))[m]=function(){s.removeChild(this),g(t)}}:function(t){setTimeout(w(t),0)}),On={set:l,clear:h}}function Dn(){if(Pn)return jn;Pn=1;var t,e,r,n,o,i,s,a,u=C(),c=_t().f,f=Bn().set,l=Ln(),h=function(){if(kn)return Tn;kn=1;var t=Wr();return Tn=/web0s(?!.*chrome)/i.test(t)}(),p=In(),d=u.MutationObserver||u.WebKitMutationObserver,y=u.document,b=u.process,v=u.Promise,m=c(u,"queueMicrotask"),g=m&&m.value;return g||(t=function(){var t,o;for(p&&(t=b.domain)&&t.exit();e;){o=e.fn,e=e.next;try{o()}catch(i){throw e?n():r=void 0,i}}r=void 0,t&&t.enter()},l||p||h||!d||!y?v&&v.resolve?((s=v.resolve(void 0)).constructor=v,a=s.then,n=function(){a.call(s,t)}):n=p?function(){b.nextTick(t)}:function(){f.call(u,t)}:(o=!0,i=y.createTextNode(""),new d(t).observe(i,{characterData:!0}),n=function(){i.data=o=!o})),jn=g||function(t){var o={fn:t,next:void 0};r&&(r.next=o),e||(e=o,n()),r=o}}var Un,Nn,qn,Hn,Fn,Wn,$n,Gn,zn,Vn,Jn={};function Yn(){if(Un)return Jn;Un=1;var t=Jr(),e=function(e){var r,n;this.promise=new e(function(t,e){if(void 0!==r||void 0!==n)throw TypeError("Bad Promise constructor");r=t,n=e}),this.resolve=t(r),this.reject=t(n)};return Jn.f=function(t){return new e(t)},Jn}function Xn(){if(qn)return Nn;qn=1;var t=jt(),e=yt(),r=Yn();return Nn=function(n,o){if(t(n),e(o)&&o.constructor===n)return o;var i=r.f(n);return(0,i.resolve)(o),i.promise}}function Kn(){return $n?Wn:($n=1,Wn=function(t){try{return{error:!1,value:t()}}catch(e){return{error:!0,value:e}}})}function Qn(){if(Vn)return An;Vn=1;var t,e,r,n,o=Dr(),i=se(),s=C(),a=de(),u=Rn(),c=he(),f=function(){if(cn)return un;cn=1;var t=he();return un=function(e,r,n){for(var o in r)t(e,o,r[o],n);return e}}(),l=Nr(),h=Cn(),p=function(){if(pn)return hn;pn=1;var t=de(),e=Pt(),r=zr(),n=N(),o=r("species");return hn=function(r){var i=t(r),s=e.f;n&&i&&!i[o]&&s(i,o,{configurable:!0,get:function(){return this}})}}(),d=yt(),y=Jr(),b=yn?dn:(yn=1,dn=function(t,e,r){if(!(t instanceof e))throw TypeError("Incorrect "+(r?r+" ":"")+"invocation");return t}),v=Ft(),m=Qr(),g=function(){if(vn)return bn;vn=1;var t=zr()("iterator"),e=!1;try{var r=0,n={next:function(){return{done:!!r++}},return:function(){e=!0}};n[t]=function(){return this},Array.from(n,function(){throw 2})}catch(o){}return bn=function(r,n){if(!n&&!e)return!1;var i=!1;try{var s={};s[t]=function(){return{next:function(){return{done:i=!0}}}},r(s)}catch(o){}return i}}(),w=Mn(),_=Bn().set,S=Dn(),x=Xn(),O=function(){if(Fn)return Hn;Fn=1;var t=C();return Hn=function(e,r){var n=t.console;n&&n.error&&(1===arguments.length?n.error(e):n.error(e,r))},Hn}(),E=Yn(),T=Kn(),k=le(),j=Br(),P=zr(),A=zn?Gn:(zn=1,Gn="object"==typeof window),R=In(),M=$r(),L=P("species"),I="Promise",B=k.get,D=k.set,U=k.getterFor(I),q=u&&u.prototype,H=u,F=q,W=s.TypeError,$=s.document,G=s.process,z=E.f,V=z,J=!!($&&$.createEvent&&s.dispatchEvent),Y="function"==typeof PromiseRejectionEvent,X="unhandledrejection",K=!1,Q=j(I,function(){var t=v(H),e=t!==String(H);if(!e&&66===M)return!0;if(i&&!F.finally)return!0;if(M>=51&&/native code/.test(t))return!1;var r=new H(function(t){t(1)}),n=function(t){t(function(){},function(){})};return(r.constructor={})[L]=n,!(K=r.then(function(){})instanceof n)||!e&&A&&!Y}),Z=Q||!g(function(t){H.all(t).catch(function(){})}),tt=function(t){var e;return!(!d(t)||"function"!=typeof(e=t.then))&&e},et=function(t,e){if(!t.notified){t.notified=!0;var r=t.reactions;S(function(){for(var n=t.value,o=1==t.state,i=0;r.length>i;){var s,a,u,c=r[i++],f=o?c.ok:c.fail,l=c.resolve,h=c.reject,p=c.domain;try{f?(o||(2===t.rejection&&it(t),t.rejection=1),!0===f?s=n:(p&&p.enter(),s=f(n),p&&(p.exit(),u=!0)),s===c.promise?h(W("Promise-chain cycle")):(a=tt(s))?a.call(s,l,h):l(s)):h(n)}catch(d){p&&!u&&p.exit(),h(d)}}t.reactions=[],t.notified=!1,e&&!t.rejection&&nt(t)})}},rt=function(t,e,r){var n,o;J?((n=$.createEvent("Event")).promise=e,n.reason=r,n.initEvent(t,!1,!0),s.dispatchEvent(n)):n={promise:e,reason:r},!Y&&(o=s["on"+t])?o(n):t===X&&O("Unhandled promise rejection",r)},nt=function(t){_.call(s,function(){var e,r=t.facade,n=t.value;if(ot(t)&&(e=T(function(){R?G.emit("unhandledRejection",n,r):rt(X,r,n)}),t.rejection=R||ot(t)?2:1,e.error))throw e.value})},ot=function(t){return 1!==t.rejection&&!t.parent},it=function(t){_.call(s,function(){var e=t.facade;R?G.emit("rejectionHandled",e):rt("rejectionhandled",e,t.value)})},st=function(t,e,r){return function(n){t(e,n,r)}},at=function(t,e,r){t.done||(t.done=!0,r&&(t=r),t.value=e,t.state=2,et(t,!0))},ut=function(t,e,r){if(!t.done){t.done=!0,r&&(t=r);try{if(t.facade===e)throw W("Promise can't be resolved itself");var n=tt(e);n?S(function(){var r={done:!1};try{n.call(e,st(ut,r,t),st(at,r,t))}catch(o){at(r,o,t)}}):(t.value=e,t.state=1,et(t,!1))}catch(o){at({done:!1},o,t)}}};if(Q&&(F=(H=function(e){b(this,H,I),y(e),t.call(this);var r=B(this);try{e(st(ut,r),st(at,r))}catch(n){at(r,n)}}).prototype,(t=function(t){D(this,{type:I,done:!1,notified:!1,parent:!1,reactions:[],rejection:!1,state:0,value:void 0})}).prototype=f(F,{then:function(t,e){var r=U(this),n=z(w(this,H));return n.ok="function"!=typeof t||t,n.fail="function"==typeof e&&e,n.domain=R?G.domain:void 0,r.parent=!0,r.reactions.push(n),0!=r.state&&et(r,!1),n.promise},catch:function(t){return this.then(void 0,t)}}),e=function(){var e=new t,r=B(e);this.promise=e,this.resolve=st(ut,r),this.reject=st(at,r)},E.f=z=function(t){return t===H||t===r?new e(t):V(t)},!i&&"function"==typeof u&&q!==Object.prototype)){n=q.then,K||(c(q,"then",function(t,e){var r=this;return new H(function(t,e){n.call(r,t,e)}).then(t,e)},{unsafe:!0}),c(q,"catch",F.catch,{unsafe:!0}));try{delete q.constructor}catch(ct){}l&&l(q,F)}return o({global:!0,wrap:!0,forced:Q},{Promise:H}),h(H,I,!1,!0),p(I),r=a(I),o({target:I,stat:!0,forced:Q},{reject:function(t){var e=z(this);return e.reject.call(void 0,t),e.promise}}),o({target:I,stat:!0,forced:i||Q},{resolve:function(t){return x(i&&this===r?H:this,t)}}),o({target:I,stat:!0,forced:Z},{all:function(t){var e=this,r=z(e),n=r.resolve,o=r.reject,i=T(function(){var r=y(e.resolve),i=[],s=0,a=1;m(t,function(t){var u=s++,c=!1;i.push(void 0),a++,r.call(e,t).then(function(t){c||(c=!0,i[u]=t,--a||n(i))},o)}),--a||n(i)});return i.error&&o(i.value),r.promise},race:function(t){var e=this,r=z(e),n=r.reject,o=T(function(){var o=y(e.resolve);m(t,function(t){o.call(e,t).then(r.resolve,n)})});return o.error&&n(o.value),r.promise}}),An}var Zn,to={};function eo(){if(Zn)return to;Zn=1;var t=Dr(),e=Jr(),r=Yn(),n=Kn(),o=Qr();return t({target:"Promise",stat:!0},{allSettled:function(t){var i=this,s=r.f(i),a=s.resolve,u=s.reject,c=n(function(){var r=e(i.resolve),n=[],s=0,u=1;o(t,function(t){var e=s++,o=!1;n.push(void 0),u++,r.call(i,t).then(function(t){o||(o=!0,n[e]={status:"fulfilled",value:t},--u||a(n))},function(t){o||(o=!0,n[e]={status:"rejected",reason:t},--u||a(n))})}),--u||a(n)});return c.error&&u(c.value),s.promise}}),to}var ro,no={};function oo(){if(ro)return no;ro=1;var t=Dr(),e=Jr(),r=de(),n=Yn(),o=Kn(),i=Qr(),s="No one promise resolved";return t({target:"Promise",stat:!0},{any:function(t){var a=this,u=n.f(a),c=u.resolve,f=u.reject,l=o(function(){var n=e(a.resolve),o=[],u=0,l=1,h=!1;i(t,function(t){var e=u++,i=!1;o.push(void 0),l++,n.call(a,t).then(function(t){i||h||(h=!0,c(t))},function(t){i||h||(i=!0,o[e]=t,--l||f(new(r("AggregateError"))(o,s)))})}),--l||f(new(r("AggregateError"))(o,s))});return l.error&&f(l.value),u.promise}}),no}var io,so={};var ao,uo,co,fo,lo,ho,po,yo,bo,vo={};function mo(){if(fo)return co;fo=1;var t,e,r,n=U(),o=Ur(),i=At(),s=mt(),a=zr(),u=se(),c=a("iterator"),f=!1;[].keys&&("next"in(r=[].keys())?(e=o(o(r)))!==Object.prototype&&(t=e):f=!0);var l=null==t||n(function(){var e={};return t[c].call(e)!==e});return l&&(t={}),u&&!l||s(t,c)||i(t,c,function(){return this}),co={IteratorPrototype:t,BUGGY_SAFARI_ITERATORS:f}}function go(){if(yo)return po;yo=1;var t=Dr(),e=function(){if(ho)return lo;ho=1;var t=mo().IteratorPrototype,e=Fr(),r=lt(),n=Cn(),o=Vr(),i=function(){return this};return lo=function(s,a,u){var c=a+" Iterator";return s.prototype=e(t,{next:r(1,u)}),n(s,c,!1,!0),o[c]=i,s}}(),r=Ur(),n=Nr(),o=Cn(),i=At(),s=he(),a=zr(),u=se(),c=Vr(),f=mo(),l=f.IteratorPrototype,h=f.BUGGY_SAFARI_ITERATORS,p=a("iterator"),d="keys",y="values",b="entries",v=function(){return this};return po=function(a,f,m,g,w,_,S){e(m,f,g);var x,O,E,T=function(t){if(t===w&&R)return R;if(!h&&t in P)return P[t];switch(t){case d:case y:case b:return function(){return new m(this,t)}}return function(){return new m(this)}},k=f+" Iterator",j=!1,P=a.prototype,A=P[p]||P["@@iterator"]||w&&P[w],R=!h&&A||T(w),C="Array"==f&&P.entries||A;if(C&&(x=r(C.call(new a)),l!==Object.prototype&&x.next&&(u||r(x)===l||(n?n(x,l):"function"!=typeof x[p]&&i(x,p,v)),o(x,k,!0,!0),u&&(c[k]=v))),w==y&&A&&A.name!==y&&(j=!0,R=function(){return A.call(this)}),u&&!S||P[p]===R||i(P,p,R),c[f]=R,w)if(O={values:T(y),keys:_?R:T(d),entries:T(b)},S)for(E in O)(h||j||!(E in P))&&s(P,E,O[E]);else t({target:f,proto:!0,forced:h||j},O);return O}}function wo(){if(bo)return vo;bo=1;var t=function(){if(uo)return ao;uo=1;var t=Pe(),e=pt(),r=function(r){return function(n,o){var i,s,a=String(e(n)),u=t(o),c=a.length;return u<0||u>=c?r?"":void 0:(i=a.charCodeAt(u))<55296||i>56319||u+1===c||(s=a.charCodeAt(u+1))<56320||s>57343?r?a.charAt(u):i:r?a.slice(u,u+2):s-56320+(i-55296<<10)+65536}};return ao={codeAt:r(!1),charAt:r(!0)}}().charAt,e=le(),r=go(),n="String Iterator",o=e.set,i=e.getterFor(n);return r(String,"String",function(t){o(this,{type:n,string:String(t),index:0})},function(){var e,r=i(this),n=r.string,o=r.index;return o>=n.length?{value:void 0,done:!0}:(e=t(n,o),r.index+=e.length,{value:e,done:!1})}),vo}var _o,So,xo,Oo,Eo,To,ko,jo,Po,Ao={};function Ro(){if(To)return Eo;To=1;var t=dt(),e=function(){if(Oo)return xo;Oo=1;var t=zr(),e=Fr(),r=Pt(),n=t("unscopables"),o=Array.prototype;return null==o[n]&&r.f(o,n,{configurable:!0,value:e(null)}),xo=function(t){o[n][t]=!0}}(),r=Vr(),n=le(),o=go(),i="Array Iterator",s=n.set,a=n.getterFor(i);return Eo=o(Array,"Array",function(e,r){s(this,{type:i,target:t(e),index:0,kind:r})},function(){var t=a(this),e=t.target,r=t.kind,n=t.index++;return!e||n>=e.length?(t.target=void 0,{value:void 0,done:!0}):"keys"==r?{value:n,done:!1}:"values"==r?{value:e[n],done:!1}:{value:[n,e[n]],done:!1}},"values"),r.Arguments=r.Array,e("keys"),e("values"),e("entries"),Eo}function Co(){if(ko)return Ao;ko=1;var t=C(),e=So?_o:(So=1,_o={CSSRuleList:0,CSSStyleDeclaration:0,CSSValueList:0,ClientRectList:0,DOMRectList:0,DOMStringList:0,DOMTokenList:1,DataTransferItemList:0,FileList:0,HTMLAllCollection:0,HTMLCollection:0,HTMLFormElement:0,HTMLSelectElement:0,MediaList:0,MimeTypeArray:0,NamedNodeMap:0,NodeList:1,PaintRequestList:0,Plugin:0,PluginArray:0,SVGLengthList:0,SVGNumberList:0,SVGPathSegList:0,SVGPointList:0,SVGStringList:0,SVGTransformList:0,SourceBufferList:0,StyleSheetList:0,TextTrackCueList:0,TextTrackList:0,TouchList:0}),r=Ro(),n=At(),o=zr(),i=o("iterator"),s=o("toStringTag"),a=r.values;for(var u in e){var c=t[u],f=c&&c.prototype;if(f){if(f[i]!==a)try{n(f,i,a)}catch(h){f[i]=a}if(f[s]||n(f,s,u),e[u])for(var l in r)if(f[l]!==r[l])try{n(f,l,r[l])}catch(h){f[l]=r[l]}}}return Ao}function Mo(){if(Po)return jo;Po=1,Zr(),on(),Qn(),eo(),oo(),function(){if(io)return so;io=1;var t=Dr(),e=se(),r=Rn(),n=U(),o=de(),i=Mn(),s=Xn(),a=he();if(t({target:"Promise",proto:!0,real:!0,forced:!!r&&n(function(){r.prototype.finally.call({then:function(){}},function(){})})},{finally:function(t){var e=i(this,o("Promise")),r="function"==typeof t;return this.then(r?function(r){return s(e,t()).then(function(){return r})}:t,r?function(r){return s(e,t()).then(function(){throw r})}:t)}}),!e&&"function"==typeof r){var u=o("Promise").prototype.finally;r.prototype.finally!==u&&a(r.prototype,"finally",u,{unsafe:!0})}}(),wo(),Co();var t=pe();return jo=t.Promise}var Lo;var Io;var Bo,Do={};var Uo,No,qo;function Ho(){if(qo)return No;qo=1;var t=Mo();return Lo||(Lo=1,Zr()),Io||(Io=1,eo()),function(){if(Bo)return Do;Bo=1;var t=Dr(),e=Yn(),r=Kn();t({target:"Promise",stat:!0},{try:function(t){var n=e.f(this),o=r(t);return(o.error?n.reject:n.resolve)(o.value),n.promise}})}(),Uo||(Uo=1,oo()),No=t}var Fo,Wo={};var $o,Go={},zo={},Vo={},Jo={};function Yo(){if($o)return Jo;$o=1;var t="undefined"!=typeof window&&window,r="undefined"!=typeof self&&"undefined"!=typeof WorkerGlobalScope&&self instanceof WorkerGlobalScope&&self,n=t||void 0!==e&&e||r;return Jo.root=n,function(){if(!n)throw new Error("RxJS could not find any global context (window, self, global)")}(),Jo}var Xo,Ko={},Qo={},Zo={};function ti(){if(Xo)return Zo;return Xo=1,Zo.isFunction=function(t){return"function"==typeof t},Zo}var ei,ri={},ni={};function oi(){return ei||(ei=1,ni.isArray=Array.isArray||function(t){return t&&"number"==typeof t.length}),ni}var ii,si={};function ai(){if(ii)return si;return ii=1,si.isObject=function(t){return null!=t&&"object"==typeof t},si}var ui,ci,fi={},li={};function hi(){return ui||(ui=1,li.errorObject={e:{}}),li}function pi(){if(ci)return fi;ci=1;var t,e=hi();function r(){try{return t.apply(this,arguments)}catch(r){return e.errorObject.e=r,e.errorObject}}return fi.tryCatch=function(e){return t=e,r},fi}var di,yi,bi={};function vi(){if(yi)return ri;yi=1;var t=oi(),e=ai(),r=ti(),n=pi(),o=hi(),i=function(){if(di)return bi;di=1;var t=bi&&bi.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t){e.call(this),this.errors=t;var r=Error.call(this,t?t.length+" errors occurred during unsubscription:\n "+t.map(function(t,e){return e+1+") "+t.toString()}).join("\n "):"");this.name=r.name="UnsubscriptionError",this.stack=r.stack,this.message=r.message}return t(r,e),r}(Error);return bi.UnsubscriptionError=e,bi}(),s=function(){function s(t){this.closed=!1,this._parent=null,this._parents=null,this._subscriptions=null,t&&(this._unsubscribe=t)}var u;return s.prototype.unsubscribe=function(){var s,u=!1;if(!this.closed){var c=this,f=c._parent,l=c._parents,h=c._unsubscribe,p=c._subscriptions;this.closed=!0,this._parent=null,this._parents=null,this._subscriptions=null;for(var d=-1,y=l?l.length:0;f;)f.remove(this),f=++d<y&&l[d]||null;if(r.isFunction(h))n.tryCatch(h).call(this)===o.errorObject&&(u=!0,s=s||(o.errorObject.e instanceof i.UnsubscriptionError?a(o.errorObject.e.errors):[o.errorObject.e]));if(t.isArray(p))for(d=-1,y=p.length;++d<y;){var b=p[d];if(e.isObject(b))if(n.tryCatch(b.unsubscribe).call(b)===o.errorObject){u=!0,s=s||[];var v=o.errorObject.e;v instanceof i.UnsubscriptionError?s=s.concat(a(v.errors)):s.push(v)}}if(u)throw new i.UnsubscriptionError(s)}},s.prototype.add=function(t){if(!t||t===s.EMPTY)return s.EMPTY;if(t===this)return this;var e=t;switch(typeof t){case"function":e=new s(t);case"object":if(e.closed||"function"!=typeof e.unsubscribe)return e;if(this.closed)return e.unsubscribe(),e;if("function"!=typeof e._addParent){var r=e;(e=new s)._subscriptions=[r]}break;default:throw new Error("unrecognized teardown "+t+" added to Subscription.")}return(this._subscriptions||(this._subscriptions=[])).push(e),e._addParent(this),e},s.prototype.remove=function(t){var e=this._subscriptions;if(e){var r=e.indexOf(t);-1!==r&&e.splice(r,1)}},s.prototype._addParent=function(t){var e=this._parent,r=this._parents;e&&e!==t?r?-1===r.indexOf(t)&&r.push(t):this._parents=[t]:this._parent=t},s.EMPTY=((u=new s).closed=!0,u),s}();function a(t){return t.reduce(function(t,e){return t.concat(e instanceof i.UnsubscriptionError?e.errors:e)},[])}return ri.Subscription=s,ri}var mi,gi={};function wi(){return mi||(mi=1,gi.empty={closed:!0,next:function(t){},error:function(t){throw t},complete:function(){}}),gi}var _i,Si,xi,Oi={};function Ei(){return _i||(_i=1,t=Oi,e=Yo().root.Symbol,t.rxSubscriber="function"==typeof e&&"function"==typeof e.for?e.for("rxSubscriber"):"@@rxSubscriber",t.$$rxSubscriber=t.rxSubscriber),Oi;var t,e}function Ti(){if(Si)return Qo;Si=1;var t=Qo&&Qo.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=ti(),r=vi(),n=wi(),o=Ei(),i=function(e){function r(t,r,a){switch(e.call(this),this.syncErrorValue=null,this.syncErrorThrown=!1,this.syncErrorThrowable=!1,this.isStopped=!1,arguments.length){case 0:this.destination=n.empty;break;case 1:if(!t){this.destination=n.empty;break}if("object"==typeof t){if((c=t)instanceof i||"syncErrorThrowable"in c&&c[o.rxSubscriber]){var u=t[o.rxSubscriber]();this.syncErrorThrowable=u.syncErrorThrowable,this.destination=u,u.add(this)}else this.syncErrorThrowable=!0,this.destination=new s(this,t);break}default:this.syncErrorThrowable=!0,this.destination=new s(this,t,r,a)}var c}return t(r,e),r.prototype[o.rxSubscriber]=function(){return this},r.create=function(t,e,n){var o=new r(t,e,n);return o.syncErrorThrowable=!1,o},r.prototype.next=function(t){this.isStopped||this._next(t)},r.prototype.error=function(t){this.isStopped||(this.isStopped=!0,this._error(t))},r.prototype.complete=function(){this.isStopped||(this.isStopped=!0,this._complete())},r.prototype.unsubscribe=function(){this.closed||(this.isStopped=!0,e.prototype.unsubscribe.call(this))},r.prototype._next=function(t){this.destination.next(t)},r.prototype._error=function(t){this.destination.error(t),this.unsubscribe()},r.prototype._complete=function(){this.destination.complete(),this.unsubscribe()},r.prototype._unsubscribeAndRecycle=function(){var t=this._parent,e=this._parents;return this._parent=null,this._parents=null,this.unsubscribe(),this.closed=!1,this.isStopped=!1,this._parent=t,this._parents=e,this},r}(r.Subscription);Qo.Subscriber=i;var s=function(r){function o(t,o,i,s){var a;r.call(this),this._parentSubscriber=t;var u=this;e.isFunction(o)?a=o:o&&(a=o.next,i=o.error,s=o.complete,o!==n.empty&&(u=Object.create(o),e.isFunction(u.unsubscribe)&&this.add(u.unsubscribe.bind(u)),u.unsubscribe=this.unsubscribe.bind(this))),this._context=u,this._next=a,this._error=i,this._complete=s}return t(o,r),o.prototype.next=function(t){if(!this.isStopped&&this._next){var e=this._parentSubscriber;e.syncErrorThrowable?this.__tryOrSetError(e,this._next,t)&&this.unsubscribe():this.__tryOrUnsub(this._next,t)}},o.prototype.error=function(t){if(!this.isStopped){var e=this._parentSubscriber;if(this._error)e.syncErrorThrowable?(this.__tryOrSetError(e,this._error,t),this.unsubscribe()):(this.__tryOrUnsub(this._error,t),this.unsubscribe());else{if(!e.syncErrorThrowable)throw this.unsubscribe(),t;e.syncErrorValue=t,e.syncErrorThrown=!0,this.unsubscribe()}}},o.prototype.complete=function(){var t=this;if(!this.isStopped){var e=this._parentSubscriber;if(this._complete){var r=function(){return t._complete.call(t._context)};e.syncErrorThrowable?(this.__tryOrSetError(e,r),this.unsubscribe()):(this.__tryOrUnsub(r),this.unsubscribe())}else this.unsubscribe()}},o.prototype.__tryOrUnsub=function(t,e){try{t.call(this._context,e)}catch(r){throw this.unsubscribe(),r}},o.prototype.__tryOrSetError=function(t,e,r){try{e.call(this._context,r)}catch(n){return t.syncErrorValue=n,t.syncErrorThrown=!0,!0}return!1},o.prototype._unsubscribe=function(){var t=this._parentSubscriber;this._context=null,this._parentSubscriber=null,t.unsubscribe()},o}(i);return Qo}var ki,ji={};function Pi(){return ki||(ki=1,function(t){var e=Yo();function r(t){var e,r=t.Symbol;return"function"==typeof r?r.observable?e=r.observable:(e=r("observable"),r.observable=e):e="@@observable",e}t.getSymbolObservable=r,t.observable=r(e.root),t.$$observable=t.observable}(ji)),ji}var Ai,Ri,Ci,Mi={},Li={};function Ii(){if(Ri)return Mi;Ri=1;var t=(Ai||(Ai=1,Li.noop=function(){}),Li);function e(e){return e?1===e.length?e[0]:function(t){return e.reduce(function(t,e){return e(t)},t)}:t.noop}return Mi.pipe=function(){for(var t=[],r=0;r<arguments.length;r++)t[r-0]=arguments[r];return e(t)},Mi.pipeFromArray=e,Mi}function Bi(){if(Ci)return Vo;Ci=1;var t=Yo(),e=function(){if(xi)return Ko;xi=1;var t=Ti(),e=Ei(),r=wi();return Ko.toSubscriber=function(n,o,i){if(n){if(n instanceof t.Subscriber)return n;if(n[e.rxSubscriber])return n[e.rxSubscriber]()}return n||o||i?new t.Subscriber(n,o,i):new t.Subscriber(r.empty)},Ko}(),r=Pi(),n=Ii(),o=function(){function o(t){this._isScalar=!1,t&&(this._subscribe=t)}return o.prototype.lift=function(t){var e=new o;return e.source=this,e.operator=t,e},o.prototype.subscribe=function(t,r,n){var o=this.operator,i=e.toSubscriber(t,r,n);if(o?o.call(i,this.source):i.add(this.source||!i.syncErrorThrowable?this._subscribe(i):this._trySubscribe(i)),i.syncErrorThrowable&&(i.syncErrorThrowable=!1,i.syncErrorThrown))throw i.syncErrorValue;return i},o.prototype._trySubscribe=function(t){try{return this._subscribe(t)}catch(e){t.syncErrorThrown=!0,t.syncErrorValue=e,t.error(e)}},o.prototype.forEach=function(e,r){var n=this;if(r||(t.root.Rx&&t.root.Rx.config&&t.root.Rx.config.Promise?r=t.root.Rx.config.Promise:t.root.Promise&&(r=t.root.Promise)),!r)throw new Error("no Promise impl found");return new r(function(t,r){var o;o=n.subscribe(function(t){if(o)try{e(t)}catch(n){r(n),o.unsubscribe()}else e(t)},r,t)})},o.prototype._subscribe=function(t){return this.source.subscribe(t)},o.prototype[r.observable]=function(){return this},o.prototype.pipe=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];return 0===t.length?this:n.pipeFromArray(t)(this)},o.prototype.toPromise=function(e){var r=this;if(e||(t.root.Rx&&t.root.Rx.config&&t.root.Rx.config.Promise?e=t.root.Rx.config.Promise:t.root.Promise&&(e=t.root.Promise)),!e)throw new Error("no Promise impl found");return new e(function(t,e){var n;r.subscribe(function(t){return n=t},function(t){return e(t)},function(){return t(n)})})},o.create=function(t){return new o(t)},o}();return Vo.Observable=o,Vo}var Di,Ui={};function Ni(){if(Di)return Ui;Di=1;var t=Ui&&Ui.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(){var t=e.call(this,"object unsubscribed");this.name=t.name="ObjectUnsubscribedError",this.stack=t.stack,this.message=t.message}return t(r,e),r}(Error);return Ui.ObjectUnsubscribedError=e,Ui}var qi,Hi,Fi,Wi={};function $i(){if(Hi)return zo;Hi=1;var t=zo&&zo.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Bi(),r=Ti(),n=vi(),o=Ni(),i=function(){if(qi)return Wi;qi=1;var t=Wi&&Wi.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t,r){e.call(this),this.subject=t,this.subscriber=r,this.closed=!1}return t(r,e),r.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 r=e.indexOf(this.subscriber);-1!==r&&e.splice(r,1)}}},r}(vi().Subscription);return Wi.SubjectSubscription=e,Wi}(),s=Ei(),a=function(e){function r(t){e.call(this,t),this.destination=t}return t(r,e),r}(r.Subscriber);zo.SubjectSubscriber=a;var u=function(r){function u(){r.call(this),this.observers=[],this.closed=!1,this.isStopped=!1,this.hasError=!1,this.thrownError=null}return t(u,r),u.prototype[s.rxSubscriber]=function(){return new a(this)},u.prototype.lift=function(t){var e=new c(this,this);return e.operator=t,e},u.prototype.next=function(t){if(this.closed)throw new o.ObjectUnsubscribedError;if(!this.isStopped)for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].next(t)},u.prototype.error=function(t){if(this.closed)throw new o.ObjectUnsubscribedError;this.hasError=!0,this.thrownError=t,this.isStopped=!0;for(var e=this.observers,r=e.length,n=e.slice(),i=0;i<r;i++)n[i].error(t);this.observers.length=0},u.prototype.complete=function(){if(this.closed)throw new o.ObjectUnsubscribedError;this.isStopped=!0;for(var t=this.observers,e=t.length,r=t.slice(),n=0;n<e;n++)r[n].complete();this.observers.length=0},u.prototype.unsubscribe=function(){this.isStopped=!0,this.closed=!0,this.observers=null},u.prototype._trySubscribe=function(t){if(this.closed)throw new o.ObjectUnsubscribedError;return r.prototype._trySubscribe.call(this,t)},u.prototype._subscribe=function(t){if(this.closed)throw new o.ObjectUnsubscribedError;return this.hasError?(t.error(this.thrownError),n.Subscription.EMPTY):this.isStopped?(t.complete(),n.Subscription.EMPTY):(this.observers.push(t),new i.SubjectSubscription(this,t))},u.prototype.asObservable=function(){var t=new e.Observable;return t.source=this,t},u.create=function(t,e){return new c(t,e)},u}(e.Observable);zo.Subject=u;var c=function(e){function r(t,r){e.call(this),this.destination=t,this.source=r}return t(r,e),r.prototype.next=function(t){var e=this.destination;e&&e.next&&e.next(t)},r.prototype.error=function(t){var e=this.destination;e&&e.error&&this.destination.error(t)},r.prototype.complete=function(){var t=this.destination;t&&t.complete&&this.destination.complete()},r.prototype._subscribe=function(t){return this.source?this.source.subscribe(t):n.Subscription.EMPTY},r}(u);return zo.AnonymousSubject=c,zo}function Gi(){if(Fi)return Go;Fi=1;var t=Go&&Go.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=$i(),r=Ni(),n=function(e){function n(t){e.call(this),this._value=t}return t(n,e),Object.defineProperty(n.prototype,"value",{get:function(){return this.getValue()},enumerable:!0,configurable:!0}),n.prototype._subscribe=function(t){var r=e.prototype._subscribe.call(this,t);return r&&!r.closed&&t.next(this._value),r},n.prototype.getValue=function(){if(this.hasError)throw this.thrownError;if(this.closed)throw new r.ObjectUnsubscribedError;return this._value},n.prototype.next=function(t){e.prototype.next.call(this,this._value=t)},n}(e.Subject);return Go.BehaviorSubject=n,Go}var zi,Vi,Ji={},Yi={},Xi={};function Ki(){if(Vi)return Yi;Vi=1;var t=Yi&&Yi.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Yo(),r=function(){if(zi)return Xi;zi=1;var t=Xi&&Xi.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t,r){e.call(this)}return t(r,e),r.prototype.schedule=function(t,e){return this},r}(vi().Subscription);return Xi.Action=e,Xi}(),n=function(r){function n(t,e){r.call(this,t,e),this.scheduler=t,this.pending=!1,this.work=e}return t(n,r),n.prototype.schedule=function(t,e){if(void 0===e&&(e=0),this.closed)return this;this.state=t,this.pending=!0;var r=this.id,n=this.scheduler;return null!=r&&(this.id=this.recycleAsyncId(n,r,e)),this.delay=e,this.id=this.id||this.requestAsyncId(n,this.id,e),this},n.prototype.requestAsyncId=function(t,r,n){return void 0===n&&(n=0),e.root.setInterval(t.flush.bind(t,this),n)},n.prototype.recycleAsyncId=function(t,r,n){if(void 0===n&&(n=0),null!==n&&this.delay===n&&!1===this.pending)return r;e.root.clearInterval(r)},n.prototype.execute=function(t,e){if(this.closed)return new Error("executing a cancelled action");this.pending=!1;var r=this._execute(t,e);if(r)return r;!1===this.pending&&null!=this.id&&(this.id=this.recycleAsyncId(this.scheduler,this.id,null))},n.prototype._execute=function(t,e){var r=!1,n=void 0;try{this.work(t)}catch(o){r=!0,n=!!o&&o||new Error(o)}if(r)return this.unsubscribe(),n},n.prototype._unsubscribe=function(){var t=this.id,e=this.scheduler,r=e.actions,n=r.indexOf(this);this.work=null,this.state=null,this.pending=!1,this.scheduler=null,-1!==n&&r.splice(n,1),null!=t&&(this.id=this.recycleAsyncId(e,t,null)),this.delay=null},n}(r.Action);return Yi.AsyncAction=n,Yi}var Qi,Zi,ts,es={},rs={};function ns(){if(Zi)return es;Zi=1;var t=es&&es.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(){e.apply(this,arguments),this.actions=[],this.active=!1,this.scheduled=void 0}return t(r,e),r.prototype.flush=function(t){var e=this.actions;if(this.active)e.push(t);else{var r;this.active=!0;do{if(r=t.execute(t.state,t.delay))break}while(t=e.shift());if(this.active=!1,r){for(;t=e.shift();)t.unsubscribe();throw r}}},r}(function(){if(Qi)return rs;Qi=1;var t=function(){function t(e,r){void 0===r&&(r=t.now),this.SchedulerAction=e,this.now=r}return t.prototype.schedule=function(t,e,r){return void 0===e&&(e=0),new this.SchedulerAction(this,t).schedule(r,e)},t.now=Date.now?Date.now:function(){return+new Date},t}();return rs.Scheduler=t,rs}().Scheduler);return es.AsyncScheduler=e,es}function os(){if(ts)return Ji;ts=1;var t=Ki(),e=ns();return Ji.async=new e.AsyncScheduler(t.AsyncAction),Ji}function is(t){this.message=t}is.prototype=new Error,is.prototype.name="InvalidCharacterError";var ss="undefined"!=typeof window&&window.atob&&window.atob.bind(window)||function(t){var e=String(t).replace(/=+$/,"");if(e.length%4==1)throw new is("'atob' failed: The string to be decoded is not correctly encoded.");for(var r,n,o=0,i=0,s="";n=e.charAt(i++);~n&&(r=o%4?64*r+n:n,o++%4)?s+=String.fromCharCode(255&r>>(-2*o&6)):0)n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/=".indexOf(n);return s};function as(t){this.message=t}as.prototype=new Error,as.prototype.name="InvalidTokenError";const us=r(Object.freeze(Object.defineProperty({__proto__:null,InvalidTokenError:as,default:function(t,e){if("string"!=typeof t)throw new as("Invalid token specified");var r=!0===(e=e||{}).header?0:1;try{return JSON.parse(function(t){var e=t.replace(/-/g,"+").replace(/_/g,"/");switch(e.length%4){case 0:break;case 2:e+="==";break;case 3:e+="=";break;default:throw"Illegal base64url string!"}try{return decodeURIComponent(ss(e).replace(/(.)/g,function(t,e){var r=e.charCodeAt(0).toString(16).toUpperCase();return r.length<2&&(r="0"+r),"%"+r}))}catch(r){return ss(e)}}(t.split(".")[r]))}catch(n){throw new as("Invalid token specified: "+n.message)}}},Symbol.toStringTag,{value:"Module"})));var cs,fs={},ls={},hs={},ps={};function ds(){if(cs)return ps;cs=1;var t=ps&&ps.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(){e.apply(this,arguments)}return t(r,e),r.prototype.notifyNext=function(t,e,r,n,o){this.destination.next(e)},r.prototype.notifyError=function(t,e){this.destination.error(t)},r.prototype.notifyComplete=function(t){this.destination.complete()},r}(Ti().Subscriber);return ps.OuterSubscriber=e,ps}var ys,bs={},vs={};function ms(){return ys||(ys=1,vs.isArrayLike=function(t){return t&&"number"==typeof t.length}),vs}var gs,ws={};function _s(){if(gs)return ws;return gs=1,ws.isPromise=function(t){return t&&"function"!=typeof t.subscribe&&"function"==typeof t.then},ws}var Ss,xs={};function Os(){return Ss||(Ss=1,function(t){var e=Yo();function r(t){var e=t.Symbol;if("function"==typeof e)return e.iterator||(e.iterator=e("iterator polyfill")),e.iterator;var r=t.Set;if(r&&"function"==typeof(new r)["@@iterator"])return"@@iterator";var n=t.Map;if(n)for(var o=Object.getOwnPropertyNames(n.prototype),i=0;i<o.length;++i){var s=o[i];if("entries"!==s&&"size"!==s&&n.prototype[s]===n.prototype.entries)return s}return"@@iterator"}t.symbolIteratorPonyfill=r,t.iterator=r(e.root),t.$$iterator=t.iterator}(xs)),xs}var Es,Ts,ks,js,Ps,As={};function Rs(){if(Ts)return bs;Ts=1;var t=Yo(),e=ms(),r=_s(),n=ai(),o=Bi(),i=Os(),s=function(){if(Es)return As;Es=1;var t=As&&As.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t,r,n){e.call(this),this.parent=t,this.outerValue=r,this.outerIndex=n,this.index=0}return t(r,e),r.prototype._next=function(t){this.parent.notifyNext(this.outerValue,t,this.outerIndex,this.index++,this)},r.prototype._error=function(t){this.parent.notifyError(t,this),this.unsubscribe()},r.prototype._complete=function(){this.parent.notifyComplete(this),this.unsubscribe()},r}(Ti().Subscriber);return As.InnerSubscriber=e,As}(),a=Pi();return bs.subscribeToResult=function(u,c,f,l){var h=new s.InnerSubscriber(u,f,l);if(h.closed)return null;if(c instanceof o.Observable)return c._isScalar?(h.next(c.value),h.complete(),null):(h.syncErrorThrowable=!0,c.subscribe(h));if(e.isArrayLike(c)){for(var p=0,d=c.length;p<d&&!h.closed;p++)h.next(c[p]);h.closed||h.complete()}else{if(r.isPromise(c))return c.then(function(t){h.closed||(h.next(t),h.complete())},function(t){return h.error(t)}).then(null,function(e){t.root.setTimeout(function(){throw e})}),h;if(c&&"function"==typeof c[i.iterator])for(var y=c[i.iterator]();;){var b=y.next();if(b.done){h.complete();break}if(h.next(b.value),h.closed)break}else if(c&&"function"==typeof c[a.observable]){var v=c[a.observable]();if("function"==typeof v.subscribe)return v.subscribe(new s.InnerSubscriber(u,f,l));h.error(new TypeError("Provided object does not correctly implement Symbol.observable"))}else{var m="You provided "+(n.isObject(c)?"an invalid object":"'"+c+"'")+" where a stream was expected. You can provide an Observable, Promise, Array, or Iterable.";h.error(new TypeError(m))}}return null},bs}function Cs(){if(js)return ls;js=1;var t=function(){if(ks)return hs;ks=1;var t=hs&&hs.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=ds(),r=Rs();hs.catchError=function(t){return function(e){var r=new n(t),o=e.lift(r);return r.caught=o}};var n=function(){function t(t){this.selector=t}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.selector,this.caught))},t}(),o=function(e){function n(t,r,n){e.call(this,t),this.selector=r,this.caught=n}return t(n,e),n.prototype.error=function(t){if(!this.isStopped){var n=void 0;try{n=this.selector(t,this.caught)}catch(o){return void e.prototype.error.call(this,o)}this._unsubscribeAndRecycle(),this.add(r.subscribeToResult(this,n))}},n}(e.OuterSubscriber);return hs}();return ls._catch=function(e){return t.catchError(e)(this)},ls}var Ms,Ls={},Is={},Bs={},Ds={},Us={};function Ns(){if(Ms)return Us;Ms=1;var t=Us&&Us.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t,r){e.call(this),this.value=t,this.scheduler=r,this._isScalar=!0,r&&(this._isScalar=!1)}return t(r,e),r.create=function(t,e){return new r(t,e)},r.dispatch=function(t){var e=t.done,r=t.value,n=t.subscriber;e?n.complete():(n.next(r),n.closed||(t.done=!0,this.schedule(t)))},r.prototype._subscribe=function(t){var e=this.value,n=this.scheduler;if(n)return n.schedule(r.dispatch,0,{done:!1,value:e,subscriber:t});t.next(e),t.closed||t.complete()},r}(Bi().Observable);return Us.ScalarObservable=e,Us}var qs,Hs={};function Fs(){if(qs)return Hs;qs=1;var t=Hs&&Hs.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t){e.call(this),this.scheduler=t}return t(r,e),r.create=function(t){return new r(t)},r.dispatch=function(t){t.subscriber.complete()},r.prototype._subscribe=function(t){var e=this.scheduler;if(e)return e.schedule(r.dispatch,0,{subscriber:t});t.complete()},r}(Bi().Observable);return Hs.EmptyObservable=e,Hs}var Ws,$s,Gs,zs,Vs,Js={};function Ys(){if($s)return Ds;$s=1;var t=Ds&&Ds.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Bi(),r=Ns(),n=Fs(),o=(Ws||(Ws=1,Js.isScheduler=function(t){return t&&"function"==typeof t.schedule}),Js),i=function(e){function i(t,r){e.call(this),this.array=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return t(i,e),i.create=function(t,e){return new i(t,e)},i.of=function(){for(var t=[],e=0;e<arguments.length;e++)t[e-0]=arguments[e];var s=t[t.length-1];o.isScheduler(s)?t.pop():s=null;var a=t.length;return a>1?new i(t,s):1===a?new r.ScalarObservable(t[0],s):new n.EmptyObservable(s)},i.dispatch=function(t){var e=t.array,r=t.index,n=t.count,o=t.subscriber;r>=n?o.complete():(o.next(e[r]),o.closed||(t.index=r+1,this.schedule(t)))},i.prototype._subscribe=function(t){var e=this.array,r=e.length,n=this.scheduler;if(n)return n.schedule(i.dispatch,0,{array:e,index:0,count:r,subscriber:t});for(var o=0;o<r&&!t.closed;o++)t.next(e[o]);t.complete()},i}(e.Observable);return Ds.ArrayObservable=i,Ds}function Xs(){if(zs)return Is;zs=1;var t=function(){if(Gs)return Bs;Gs=1;var t=Bs&&Bs.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ys(),r=oi(),n=ds(),o=Rs(),i={};Bs.combineLatest=function(){for(var t=[],n=0;n<arguments.length;n++)t[n-0]=arguments[n];var o=null;return"function"==typeof t[t.length-1]&&(o=t.pop()),1===t.length&&r.isArray(t[0])&&(t=t[0].slice()),function(r){return r.lift.call(new e.ArrayObservable([r].concat(t)),new s(o))}};var s=function(){function t(t){this.project=t}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.project))},t}();Bs.CombineLatestOperator=s;var a=function(e){function r(t,r){e.call(this,t),this.project=r,this.active=0,this.values=[],this.observables=[]}return t(r,e),r.prototype._next=function(t){this.values.push(i),this.observables.push(t)},r.prototype._complete=function(){var t=this.observables,e=t.length;if(0===e)this.destination.complete();else{this.active=e,this.toRespond=e;for(var r=0;r<e;r++){var n=t[r];this.add(o.subscribeToResult(this,n,n,r))}}},r.prototype.notifyComplete=function(t){0==(this.active-=1)&&this.destination.complete()},r.prototype.notifyNext=function(t,e,r,n,o){var s=this.values,a=s[r],u=this.toRespond?a===i?--this.toRespond:this.toRespond:0;s[r]=e,0===u&&(this.project?this._tryProject(s):this.destination.next(s.slice()))},r.prototype._tryProject=function(t){var e;try{e=this.project.apply(this,t)}catch(r){return void this.destination.error(r)}this.destination.next(e)},r}(n.OuterSubscriber);return Bs.CombineLatestSubscriber=a,Bs}();return Is.combineLatest=function(){for(var e=[],r=0;r<arguments.length;r++)e[r-0]=arguments[r];return t.combineLatest.apply(void 0,e)(this)},Is}var Ks,Qs,Zs,ta={},ea={},ra={};function na(){if(Qs)return ea;Qs=1;var t=function(){if(Ks)return ra;Ks=1;var t=ra&&ra.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti();ra.count=function(t){return function(e){return e.lift(new r(t,e))}};var r=function(){function t(t,e){this.predicate=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new n(t,this.predicate,this.source))},t}(),n=function(e){function r(t,r,n){e.call(this,t),this.predicate=r,this.source=n,this.count=0,this.index=0}return t(r,e),r.prototype._next=function(t){this.predicate?this._tryPredicate(t):this.count++},r.prototype._tryPredicate=function(t){var e;try{e=this.predicate(t,this.index++,this.source)}catch(r){return void this.destination.error(r)}e&&this.count++},r.prototype._complete=function(){this.destination.next(this.count),this.destination.complete()},r}(e.Subscriber);return ra}();return ea.count=function(e){return t.count(e)(this)},ea}var oa,ia={},sa={},aa={},ua={};var ca,fa,la,ha,pa={};function da(){if(ca)return pa;ca=1;var t=Bi(),e=function(){function e(t,e,r){this.kind=t,this.value=e,this.error=r,this.hasValue="N"===t}return e.prototype.observe=function(t){switch(this.kind){case"N":return t.next&&t.next(this.value);case"E":return t.error&&t.error(this.error);case"C":return t.complete&&t.complete()}},e.prototype.do=function(t,e,r){switch(this.kind){case"N":return t&&t(this.value);case"E":return e&&e(this.error);case"C":return r&&r()}},e.prototype.accept=function(t,e,r){return t&&"function"==typeof t.next?this.observe(t):this.do(t,e,r)},e.prototype.toObservable=function(){switch(this.kind){case"N":return t.Observable.of(this.value);case"E":return t.Observable.throw(this.error);case"C":return t.Observable.empty()}throw new Error("unexpected notification kind value")},e.createNext=function(t){return void 0!==t?new e("N",t):e.undefinedValueNotification},e.createError=function(t){return new e("E",void 0,t)},e.createComplete=function(){return e.completeNotification},e.completeNotification=new e("C"),e.undefinedValueNotification=new e("N",void 0),e}();return pa.Notification=e,pa}function ya(){if(fa)return aa;fa=1;var t=aa&&aa.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=os(),r=(oa||(oa=1,ua.isDate=function(t){return t instanceof Date&&!isNaN(+t)}),ua),n=Ti(),o=da();aa.delay=function(t,n){void 0===n&&(n=e.async);var o=r.isDate(t)?+t-n.now():Math.abs(t);return function(t){return t.lift(new i(o,n))}};var i=function(){function t(t,e){this.delay=t,this.scheduler=e}return t.prototype.call=function(t,e){return e.subscribe(new s(t,this.delay,this.scheduler))},t}(),s=function(e){function r(t,r,n){e.call(this,t),this.delay=r,this.scheduler=n,this.queue=[],this.active=!1,this.errored=!1}return t(r,e),r.dispatch=function(t){for(var e=t.source,r=e.queue,n=t.scheduler,o=t.destination;r.length>0&&r[0].time-n.now()<=0;)r.shift().notification.observe(o);if(r.length>0){var i=Math.max(0,r[0].time-n.now());this.schedule(t,i)}else this.unsubscribe(),e.active=!1},r.prototype._schedule=function(t){this.active=!0,this.add(t.schedule(r.dispatch,this.delay,{source:this,destination:this.destination,scheduler:t}))},r.prototype.scheduleNotification=function(t){if(!0!==this.errored){var e=this.scheduler,r=new a(e.now()+this.delay,t);this.queue.push(r),!1===this.active&&this._schedule(e)}},r.prototype._next=function(t){this.scheduleNotification(o.Notification.createNext(t))},r.prototype._error=function(t){this.errored=!0,this.queue=[],this.destination.error(t)},r.prototype._complete=function(){this.scheduleNotification(o.Notification.createComplete())},r}(n.Subscriber),a=function(){return function(t,e){this.time=t,this.notification=e}}();return aa}function ba(){if(ha)return ia;ha=1;var t=Bi(),e=function(){if(la)return sa;la=1;var t=os(),e=ya();return sa.delay=function(r,n){return void 0===n&&(n=t.async),e.delay(r,n)(this)},sa}();return t.Observable.prototype.delay=e.delay,ia}var va,ma,ga,wa={},_a={},Sa={};function xa(){if(ma)return _a;ma=1;var t=function(){if(va)return Sa;va=1;var t=Sa&&Sa.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti();Sa.tap=function(t,e,n){return function(o){return o.lift(new r(t,e,n))}};var r=function(){function t(t,e,r){this.nextOrObserver=t,this.error=e,this.complete=r}return t.prototype.call=function(t,e){return e.subscribe(new n(t,this.nextOrObserver,this.error,this.complete))},t}(),n=function(r){function n(t,n,o,i){r.call(this,t);var s=new e.Subscriber(n,o,i);s.syncErrorThrowable=!0,this.add(s),this.safeSubscriber=s}return t(n,r),n.prototype._next=function(t){var e=this.safeSubscriber;e.next(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.next(t)},n.prototype._error=function(t){var e=this.safeSubscriber;e.error(t),e.syncErrorThrown?this.destination.error(e.syncErrorValue):this.destination.error(t)},n.prototype._complete=function(){var t=this.safeSubscriber;t.complete(),t.syncErrorThrown?this.destination.error(t.syncErrorValue):this.destination.complete()},n}(e.Subscriber);return Sa}();return _a._do=function(e,r,n){return t.tap(e,r,n)(this)},_a}var Oa,Ea,Ta,ka={},ja={},Pa={};function Aa(){if(Ea)return ja;Ea=1;var t=function(){if(Oa)return Pa;Oa=1;var t=Pa&&Pa.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti();Pa.filter=function(t,e){return function(n){return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.predicate=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new n(t,this.predicate,this.thisArg))},t}(),n=function(e){function r(t,r,n){e.call(this,t),this.predicate=r,this.thisArg=n,this.count=0}return t(r,e),r.prototype._next=function(t){var e;try{e=this.predicate.call(this.thisArg,t,this.count++)}catch(r){return void this.destination.error(r)}e&&this.destination.next(t)},r}(e.Subscriber);return Pa}();return ja.filter=function(e,r){return t.filter(e,r)(this)},ja}var Ra,Ca,Ma,La={},Ia={},Ba={};function Da(){if(Ra)return Ba;Ra=1;var t=Ba&&Ba.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti();Ba.map=function(t,e){return function(n){if("function"!=typeof t)throw new TypeError("argument is not a function. Are you looking for `mapTo()`?");return n.lift(new r(t,e))}};var r=function(){function t(t,e){this.project=t,this.thisArg=e}return t.prototype.call=function(t,e){return e.subscribe(new n(t,this.project,this.thisArg))},t}();Ba.MapOperator=r;var n=function(e){function r(t,r,n){e.call(this,t),this.project=r,this.count=0,this.thisArg=n||this}return t(r,e),r.prototype._next=function(t){var e;try{e=this.project.call(this.thisArg,t,this.count++)}catch(r){return void this.destination.error(r)}this.destination.next(e)},r}(e.Subscriber);return Ba}function Ua(){if(Ma)return La;Ma=1;var t=Bi(),e=function(){if(Ca)return Ia;Ca=1;var t=Da();return Ia.map=function(e,r){return t.map(e,r)(this)},Ia}();return t.Observable.prototype.map=e.map,La}var Na,qa,Ha,Fa={},Wa={},$a={};function Ga(){if(Na)return $a;Na=1;var t=$a&&$a.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Rs(),r=ds();$a.mergeMap=function(t,e,r){return void 0===r&&(r=Number.POSITIVE_INFINITY),function(o){return"number"==typeof e&&(r=e,e=null),o.lift(new n(t,e,r))}};var n=function(){function t(t,e,r){void 0===r&&(r=Number.POSITIVE_INFINITY),this.project=t,this.resultSelector=e,this.concurrent=r}return t.prototype.call=function(t,e){return e.subscribe(new o(t,this.project,this.resultSelector,this.concurrent))},t}();$a.MergeMapOperator=n;var o=function(r){function n(t,e,n,o){void 0===o&&(o=Number.POSITIVE_INFINITY),r.call(this,t),this.project=e,this.resultSelector=n,this.concurrent=o,this.hasCompleted=!1,this.buffer=[],this.active=0,this.index=0}return t(n,r),n.prototype._next=function(t){this.active<this.concurrent?this._tryNext(t):this.buffer.push(t)},n.prototype._tryNext=function(t){var e,r=this.index++;try{e=this.project(t,r)}catch(n){return void this.destination.error(n)}this.active++,this._innerSub(e,t,r)},n.prototype._innerSub=function(t,r,n){this.add(e.subscribeToResult(this,t,r,n))},n.prototype._complete=function(){this.hasCompleted=!0,0===this.active&&0===this.buffer.length&&this.destination.complete()},n.prototype.notifyNext=function(t,e,r,n,o){this.resultSelector?this._notifyResultSelector(t,e,r,n):this.destination.next(e)},n.prototype._notifyResultSelector=function(t,e,r,n){var o;try{o=this.resultSelector(t,e,r,n)}catch(i){return void this.destination.error(i)}this.destination.next(o)},n.prototype.notifyComplete=function(t){var e=this.buffer;this.remove(t),this.active--,e.length>0?this._next(e.shift()):0===this.active&&this.hasCompleted&&this.destination.complete()},n}(r.OuterSubscriber);return $a.MergeMapSubscriber=o,$a}function za(){if(Ha)return Fa;Ha=1;var t=Bi(),e=function(){if(qa)return Wa;qa=1;var t=Ga();return Wa.mergeMap=function(e,r,n){return void 0===n&&(n=Number.POSITIVE_INFINITY),t.mergeMap(e,r,n)(this)},Wa}();return t.Observable.prototype.mergeMap=e.mergeMap,t.Observable.prototype.flatMap=e.mergeMap,Fa}var Va,Ja,Ya,Xa={},Ka={},Qa={};function Za(){if(Ja)return Ka;Ja=1;var t=function(){if(Va)return Qa;Va=1;var t=Ga();return Qa.concatMap=function(e,r){return t.mergeMap(e,r,1)},Qa}();return Ka.concatMap=function(e,r){return t.concatMap(e,r)(this)},Ka}var tu,eu,ru,nu={},ou={},iu={};function su(){if(eu)return ou;eu=1;var t=function(){if(tu)return iu;tu=1;var t=iu&&iu.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=$i(),r=pi(),n=hi(),o=ds(),i=Rs();iu.retryWhen=function(t){return function(e){return e.lift(new s(t,e))}};var s=function(){function t(t,e){this.notifier=t,this.source=e}return t.prototype.call=function(t,e){return e.subscribe(new a(t,this.notifier,this.source))},t}(),a=function(o){function s(t,e,r){o.call(this,t),this.notifier=e,this.source=r}return t(s,o),s.prototype.error=function(t){if(!this.isStopped){var s=this.errors,a=this.retries,u=this.retriesSubscription;if(a)this.errors=null,this.retriesSubscription=null;else{if(s=new e.Subject,(a=r.tryCatch(this.notifier)(s))===n.errorObject)return o.prototype.error.call(this,n.errorObject.e);u=i.subscribeToResult(this,a)}this._unsubscribeAndRecycle(),this.errors=s,this.retries=a,this.retriesSubscription=u,s.next(t)}},s.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},s.prototype.notifyNext=function(t,e,r,n,o){var i=this,s=i.errors,a=i.retries,u=i.retriesSubscription;this.errors=null,this.retries=null,this.retriesSubscription=null,this._unsubscribeAndRecycle(),this.errors=s,this.retries=a,this.retriesSubscription=u,this.source.subscribe(this)},s}(o.OuterSubscriber);return iu}();return ou.retryWhen=function(e){return t.retryWhen(e)(this)},ou}var au,uu,cu,fu,lu,hu,pu={},du={},yu={},bu={},vu={},mu={};function gu(){if(au)return mu;au=1;var t=mu&&mu.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti();mu.refCount=function(){return function(t){return t.lift(new r(t))}};var r=function(){function t(t){this.connectable=t}return t.prototype.call=function(t,e){var r=this.connectable;r._refCount++;var o=new n(t,r),i=e.subscribe(o);return o.closed||(o.connection=r.connect()),i},t}(),n=function(e){function r(t,r){e.call(this,t),this.connectable=r}return t(r,e),r.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null},r}(e.Subscriber);return mu}function wu(){if(cu)return bu;cu=1;var t=function(){if(uu)return vu;uu=1;var t=vu&&vu.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=$i(),r=Bi(),n=Ti(),o=vi(),i=gu(),s=function(e){function r(t,r){e.call(this),this.source=t,this.subjectFactory=r,this._refCount=0,this._isComplete=!1}return t(r,e),r.prototype._subscribe=function(t){return this.getSubject().subscribe(t)},r.prototype.getSubject=function(){var t=this._subject;return t&&!t.isStopped||(this._subject=this.subjectFactory()),this._subject},r.prototype.connect=function(){var t=this._connection;return t||(this._isComplete=!1,(t=this._connection=new o.Subscription).add(this.source.subscribe(new u(this.getSubject(),this))),t.closed?(this._connection=null,t=o.Subscription.EMPTY):this._connection=t),t},r.prototype.refCount=function(){return i.refCount()(this)},r}(r.Observable);vu.ConnectableObservable=s;var a=s.prototype;vu.connectableObservableDescriptor={operator:{value:null},_refCount:{value:0,writable:!0},_subject:{value:null,writable:!0},_connection:{value:null,writable:!0},_subscribe:{value:a._subscribe},_isComplete:{value:a._isComplete,writable:!0},getSubject:{value:a.getSubject},connect:{value:a.connect},refCount:{value:a.refCount}};var u=function(e){function r(t,r){e.call(this,t),this.connectable=r}return t(r,e),r.prototype._error=function(t){this._unsubscribe(),e.prototype._error.call(this,t)},r.prototype._complete=function(){this.connectable._isComplete=!0,this._unsubscribe(),e.prototype._complete.call(this)},r.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()}},r}(e.SubjectSubscriber);return function(e){function r(t,r){e.call(this,t),this.connectable=r}t(r,e),r.prototype._unsubscribe=function(){var t=this.connectable;if(t){this.connectable=null;var e=t._refCount;if(e<=0)this.connection=null;else if(t._refCount=e-1,e>1)this.connection=null;else{var r=this.connection,n=t._connection;this.connection=null,!n||r&&n!==r||n.unsubscribe()}}else this.connection=null}}(n.Subscriber),vu}();bu.multicast=function(r,n){return function(o){var i;if(i="function"==typeof r?r:function(){return r},"function"==typeof n)return o.lift(new e(i,n));var s=Object.create(o,t.connectableObservableDescriptor);return s.source=o,s.subjectFactory=i,s}};var e=function(){function t(t,e){this.subjectFactory=t,this.selector=e}return t.prototype.call=function(t,e){var r=this.selector,n=this.subjectFactory(),o=r(n).subscribe(t);return o.add(e.subscribe(n)),o},t}();return bu.MulticastOperator=e,bu}function _u(){if(lu)return du;lu=1;var t=function(){if(fu)return yu;fu=1;var t=wu(),e=gu(),r=$i();function n(){return new r.Subject}return yu.share=function(){return function(r){return e.refCount()(t.multicast(n)(r))}},yu}();return du.share=function(){return t.share()(this)},du}var Su,xu,Ou,Eu,Tu={},ku={},ju={},Pu={};function Au(){if(xu)return ju;xu=1;var t=ju&&ju.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti(),r=function(){if(Su)return Pu;Su=1;var t=Pu&&Pu.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(){var t=e.call(this,"argument out of range");this.name=t.name="ArgumentOutOfRangeError",this.stack=t.stack,this.message=t.message}return t(r,e),r}(Error);return Pu.ArgumentOutOfRangeError=e,Pu}(),n=Fs();ju.take=function(t){return function(e){return 0===t?new n.EmptyObservable:e.lift(new o(t))}};var o=function(){function t(t){if(this.total=t,this.total<0)throw new r.ArgumentOutOfRangeError}return t.prototype.call=function(t,e){return e.subscribe(new i(t,this.total))},t}(),i=function(e){function r(t,r){e.call(this,t),this.total=r,this.count=0}return t(r,e),r.prototype._next=function(t){var e=this.total,r=++this.count;r<=e&&(this.destination.next(t),r===e&&(this.destination.complete(),this.unsubscribe()))},r}(e.Subscriber);return ju}function Ru(){if(Eu)return Tu;Eu=1;var t=Bi(),e=function(){if(Ou)return ku;Ou=1;var t=Au();return ku.take=function(e){return t.take(e)(this)},ku}();return t.Observable.prototype.take=e.take,Tu}var Cu,Mu,Lu,Iu={},Bu={},Du={};function Uu(){if(Cu)return Du;Cu=1;var t=Du&&Du.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Yo(),r=pi(),n=hi(),o=Bi(),i=Ti(),s=Da();function a(){if(e.root.XMLHttpRequest)return new e.root.XMLHttpRequest;if(e.root.XDomainRequest)return new e.root.XDomainRequest;throw new Error("CORS is not supported by your browser")}function u(t,e){return void 0===e&&(e=null),new y({method:"GET",url:t,headers:e})}function c(t,e,r){return new y({method:"POST",url:t,body:e,headers:r})}function f(t,e){return new y({method:"DELETE",url:t,headers:e})}function l(t,e,r){return new y({method:"PUT",url:t,body:e,headers:r})}function h(t,e,r){return new y({method:"PATCH",url:t,body:e,headers:r})}Du.ajaxGet=u,Du.ajaxPost=c,Du.ajaxDelete=f,Du.ajaxPut=l,Du.ajaxPatch=h;var p=s.map(function(t,e){return t.response});function d(t,e){return p(new y({method:"GET",url:t,responseType:"json",headers:e}))}Du.ajaxGetJSON=d;var y=function(r){function n(t){r.call(this);var n={async:!0,createXHR:function(){return this.crossDomain?a.call(this):function(){if(e.root.XMLHttpRequest)return new e.root.XMLHttpRequest;var t=void 0;try{for(var r=["Msxml2.XMLHTTP","Microsoft.XMLHTTP","Msxml2.XMLHTTP.4.0"],n=0;n<3;n++)try{if(t=r[n],new e.root.ActiveXObject(t))break}catch(o){}return new e.root.ActiveXObject(t)}catch(o){throw new Error("XMLHttpRequest is not supported by your browser")}}()},crossDomain:!1,withCredentials:!1,headers:{},method:"GET",responseType:"json",timeout:0};if("string"==typeof t)n.url=t;else for(var o in t)t.hasOwnProperty(o)&&(n[o]=t[o]);this.request=n}var o;return t(n,r),n.prototype._subscribe=function(t){return new b(t,this.request)},n.create=((o=function(t){return new n(t)}).get=u,o.post=c,o.delete=f,o.put=l,o.patch=h,o.getJSON=d,o),n}(o.Observable);Du.AjaxObservable=y;var b=function(o){function i(t,r){o.call(this,t),this.request=r,this.done=!1;var n=r.headers=r.headers||{};r.crossDomain||n["X-Requested-With"]||(n["X-Requested-With"]="XMLHttpRequest"),"Content-Type"in n||e.root.FormData&&r.body instanceof e.root.FormData||void 0===r.body||(n["Content-Type"]="application/x-www-form-urlencoded; charset=UTF-8"),r.body=this.serializeBody(r.body,r.headers["Content-Type"]),this.send()}return t(i,o),i.prototype.next=function(t){this.done=!0;var e=this,r=e.xhr,n=e.request,o=e.destination,i=new v(t,r,n);o.next(i)},i.prototype.send=function(){var t=this.request,e=this.request,o=e.user,i=e.method,s=e.url,a=e.async,u=e.password,c=e.headers,f=e.body,l=t.createXHR,h=r.tryCatch(l).call(t);if(h===n.errorObject)this.error(n.errorObject.e);else{this.xhr=h,this.setupEvents(h,t);if((o?r.tryCatch(h.open).call(h,i,s,a,o,u):r.tryCatch(h.open).call(h,i,s,a))===n.errorObject)return this.error(n.errorObject.e),null;if(a&&(h.timeout=t.timeout,h.responseType=t.responseType),"withCredentials"in h&&(h.withCredentials=!!t.withCredentials),this.setHeaders(h,c),(f?r.tryCatch(h.send).call(h,f):r.tryCatch(h.send).call(h))===n.errorObject)return this.error(n.errorObject.e),null}return h},i.prototype.serializeBody=function(t,r){if(!t||"string"==typeof t)return t;if(e.root.FormData&&t instanceof e.root.FormData)return t;if(r){var n=r.indexOf(";");-1!==n&&(r=r.substring(0,n))}switch(r){case"application/x-www-form-urlencoded":return Object.keys(t).map(function(e){return encodeURIComponent(e)+"="+encodeURIComponent(t[e])}).join("&");case"application/json":return JSON.stringify(t);default:return t}},i.prototype.setHeaders=function(t,e){for(var r in e)e.hasOwnProperty(r)&&t.setRequestHeader(r,e[r])},i.prototype.setupEvents=function(t,r){var n=r.progressSubscriber;function o(t){var e=o,r=e.subscriber,n=e.progressSubscriber,i=e.request;n&&n.error(t),r.error(new w(this,i))}if(t.ontimeout=o,o.request=r,o.subscriber=this,o.progressSubscriber=n,t.upload&&"withCredentials"in t){var i,s;if(n)i=function(t){i.progressSubscriber.next(t)},e.root.XDomainRequest?t.onprogress=i:t.upload.onprogress=i,i.progressSubscriber=n;s=function(t){var e=s,r=e.progressSubscriber,n=e.subscriber,o=e.request;r&&r.error(t),n.error(new m("ajax error",this,o))},t.onerror=s,s.request=r,s.subscriber=this,s.progressSubscriber=n}function a(t){var e=a,r=e.subscriber,n=e.progressSubscriber,o=e.request;if(4===this.readyState){var i=1223===this.status?204:this.status,s="text"===this.responseType?this.response||this.responseText:this.response;0===i&&(i=s?200:0),200<=i&&i<300?(n&&n.complete(),r.next(t),r.complete()):(n&&n.error(t),r.error(new m("ajax error "+i,this,o)))}}t.onreadystatechange=a,a.subscriber=this,a.progressSubscriber=n,a.request=r},i.prototype.unsubscribe=function(){var t=this.done,e=this.xhr;!t&&e&&4!==e.readyState&&"function"==typeof e.abort&&e.abort(),o.prototype.unsubscribe.call(this)},i}(i.Subscriber);Du.AjaxSubscriber=b;var v=function(){return function(t,e,r){this.originalEvent=t,this.xhr=e,this.request=r,this.status=e.status,this.responseType=e.responseType||r.responseType,this.response=g(this.responseType,e)}}();Du.AjaxResponse=v;var m=function(e){function r(t,r,n){e.call(this,t),this.message=t,this.xhr=r,this.request=n,this.status=r.status,this.responseType=r.responseType||n.responseType,this.response=g(this.responseType,r)}return t(r,e),r}(Error);function g(t,e){switch(t){case"json":return"response"in e?e.responseType?e.response:JSON.parse(e.response||e.responseText||"null"):JSON.parse(e.responseText||"null");case"xml":return e.responseXML;default:return"response"in e?e.response:e.responseText}}Du.AjaxError=m;var w=function(e){function r(t,r){e.call(this,"ajax timeout",t,r)}return t(r,e),r}(m);return Du.AjaxTimeoutError=w,Du}function Nu(){if(Lu)return Iu;Lu=1;var t=Bi(),e=function(){if(Mu)return Bu;Mu=1;var t=Uu();return Bu.ajax=t.AjaxObservable.create,Bu}();return t.Observable.ajax=e.ajax,Iu}var qu,Hu,Fu={},Wu={};function $u(){if(Hu)return Fu;Hu=1;var t=Bi(),e=function(){if(qu)return Wu;qu=1;var t=Fs();return Wu.empty=t.EmptyObservable.create,Wu}();return t.Observable.empty=e.empty,Fu}var Gu,zu={},Vu={},Ju={},Yu={};var Xu,Ku={};function Qu(){if(Xu)return Ku;Xu=1;var t=Ku&&Ku.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Yo(),r=Bi(),n=Os(),o=function(e){function r(t,r){if(e.call(this),this.scheduler=r,null==t)throw new Error("iterator cannot be null.");this.iterator=function(t){var e=t[n.iterator];if(!e&&"string"==typeof t)return new i(t);if(!e&&void 0!==t.length)return new s(t);if(!e)throw new TypeError("object is not iterable");return t[n.iterator]()}(t)}return t(r,e),r.create=function(t,e){return new r(t,e)},r.dispatch=function(t){var e=t.index,r=t.hasError,n=t.iterator,o=t.subscriber;if(r)o.error(t.error);else{var i=n.next();i.done?o.complete():(o.next(i.value),t.index=e+1,o.closed?"function"==typeof n.return&&n.return():this.schedule(t))}},r.prototype._subscribe=function(t){var e=this.iterator,n=this.scheduler;if(n)return n.schedule(r.dispatch,0,{index:0,iterator:e,subscriber:t});for(;;){var o=e.next();if(o.done){t.complete();break}if(t.next(o.value),t.closed){"function"==typeof e.return&&e.return();break}}},r}(r.Observable);Ku.IteratorObservable=o;var i=function(){function t(t,e,r){void 0===e&&(e=0),void 0===r&&(r=t.length),this.str=t,this.idx=e,this.len=r}return t.prototype[n.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.str.charAt(this.idx++)}:{done:!0,value:void 0}},t}(),s=function(){function t(t,r,n){void 0===r&&(r=0),void 0===n&&(n=function(t){var r=+t.length;if(isNaN(r))return 0;if(0===r||(n=r,"number"!=typeof n||!e.root.isFinite(n)))return r;var n;if(r=function(t){var e=+t;if(0===e)return e;if(isNaN(e))return e;return e<0?-1:1}(r)*Math.floor(Math.abs(r)),r<=0)return 0;if(r>a)return a;return r}(t)),this.arr=t,this.idx=r,this.len=n}return t.prototype[n.iterator]=function(){return this},t.prototype.next=function(){return this.idx<this.len?{done:!1,value:this.arr[this.idx++]}:{done:!0,value:void 0}},t}();var a=Math.pow(2,53)-1;return Ku}var Zu,tc={};var ec,rc,nc,oc,ic={};function sc(){if(rc)return Ju;rc=1;var t=Ju&&Ju.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=oi(),r=ms(),n=_s(),o=function(){if(Gu)return Yu;Gu=1;var t=Yu&&Yu.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Yo(),r=function(r){function i(t,e){r.call(this),this.promise=t,this.scheduler=e}return t(i,r),i.create=function(t,e){return new i(t,e)},i.prototype._subscribe=function(t){var r=this,i=this.promise,s=this.scheduler;if(null==s)this._isScalar?t.closed||(t.next(this.value),t.complete()):i.then(function(e){r.value=e,r._isScalar=!0,t.closed||(t.next(e),t.complete())},function(e){t.closed||t.error(e)}).then(null,function(t){e.root.setTimeout(function(){throw t})});else if(this._isScalar){if(!t.closed)return s.schedule(n,0,{value:this.value,subscriber:t})}else i.then(function(e){r.value=e,r._isScalar=!0,t.closed||t.add(s.schedule(n,0,{value:e,subscriber:t}))},function(e){t.closed||t.add(s.schedule(o,0,{err:e,subscriber:t}))}).then(null,function(t){e.root.setTimeout(function(){throw t})})},i}(Bi().Observable);function n(t){var e=t.value,r=t.subscriber;r.closed||(r.next(e),r.complete())}function o(t){var e=t.err,r=t.subscriber;r.closed||r.error(e)}return Yu.PromiseObservable=r,Yu}(),i=Qu(),s=Ys(),a=function(){if(Zu)return tc;Zu=1;var t=tc&&tc.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Bi(),r=Ns(),n=Fs(),o=function(e){function o(t,r){e.call(this),this.arrayLike=t,this.scheduler=r,r||1!==t.length||(this._isScalar=!0,this.value=t[0])}return t(o,e),o.create=function(t,e){var i=t.length;return 0===i?new n.EmptyObservable:1===i?new r.ScalarObservable(t[0],e):new o(t,e)},o.dispatch=function(t){var e=t.arrayLike,r=t.index,n=t.length,o=t.subscriber;o.closed||(r>=n?o.complete():(o.next(e[r]),t.index=r+1,this.schedule(t)))},o.prototype._subscribe=function(t){var e=this.arrayLike,r=this.scheduler,n=e.length;if(r)return r.schedule(o.dispatch,0,{arrayLike:e,index:0,length:n,subscriber:t});for(var i=0;i<n&&!t.closed;i++)t.next(e[i]);t.complete()},o}(e.Observable);return tc.ArrayLikeObservable=o,tc}(),u=Os(),c=Bi(),f=function(){if(ec)return ic;ec=1;var t=ic&&ic.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=Ti(),r=da();ic.observeOn=function(t,e){return void 0===e&&(e=0),function(r){return r.lift(new n(t,e))}};var n=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 o(t,this.scheduler,this.delay))},t}();ic.ObserveOnOperator=n;var o=function(e){function n(t,r,n){void 0===n&&(n=0),e.call(this,t),this.scheduler=r,this.delay=n}return t(n,e),n.dispatch=function(t){var e=t.notification,r=t.destination;e.observe(r),this.unsubscribe()},n.prototype.scheduleMessage=function(t){this.add(this.scheduler.schedule(n.dispatch,this.delay,new i(t,this.destination)))},n.prototype._next=function(t){this.scheduleMessage(r.Notification.createNext(t))},n.prototype._error=function(t){this.scheduleMessage(r.Notification.createError(t))},n.prototype._complete=function(){this.scheduleMessage(r.Notification.createComplete())},n}(e.Subscriber);ic.ObserveOnSubscriber=o;var i=function(){return function(t,e){this.notification=t,this.destination=e}}();return ic.ObserveOnMessage=i,ic}(),l=Pi(),h=function(h){function p(t,e){h.call(this,null),this.ish=t,this.scheduler=e}return t(p,h),p.create=function(t,f){if(null!=t){if("function"==typeof t[l.observable])return t instanceof c.Observable&&!f?t:new p(t,f);if(e.isArray(t))return new s.ArrayObservable(t,f);if(n.isPromise(t))return new o.PromiseObservable(t,f);if("function"==typeof t[u.iterator]||"string"==typeof t)return new i.IteratorObservable(t,f);if(r.isArrayLike(t))return new a.ArrayLikeObservable(t,f)}throw new TypeError((null!==t&&typeof t||t)+" is not observable")},p.prototype._subscribe=function(t){var e=this.ish,r=this.scheduler;return null==r?e[l.observable]().subscribe(t):e[l.observable]().subscribe(new f.ObserveOnSubscriber(t,r,0))},p}(c.Observable);return Ju.FromObservable=h,Ju}function ac(){if(oc)return zu;oc=1;var t=Bi(),e=function(){if(nc)return Vu;nc=1;var t=sc();return Vu.from=t.FromObservable.create,Vu}();return t.Observable.from=e.from,zu}var uc,cc,fc,lc,hc={},pc={},dc={},yc={};function bc(){if(cc)return dc;cc=1;var t=dc&&dc.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(){if(uc)return yc;uc=1;var t=oi();return yc.isNumeric=function(e){return!t.isArray(e)&&e-parseFloat(e)+1>=0},yc}(),r=Bi(),n=os(),o=function(r){function o(t,o){void 0===t&&(t=0),void 0===o&&(o=n.async),r.call(this),this.period=t,this.scheduler=o,(!e.isNumeric(t)||t<0)&&(this.period=0),o&&"function"==typeof o.schedule||(this.scheduler=n.async)}return t(o,r),o.create=function(t,e){return void 0===t&&(t=0),void 0===e&&(e=n.async),new o(t,e)},o.dispatch=function(t){var e=t.index,r=t.subscriber,n=t.period;r.next(e),r.closed||(t.index+=1,this.schedule(t,n))},o.prototype._subscribe=function(t){var e=this.period,r=this.scheduler;t.add(r.schedule(o.dispatch,e,{index:0,subscriber:t,period:e}))},o}(r.Observable);return dc.IntervalObservable=o,dc}function vc(){if(lc)return hc;lc=1;var t=Bi(),e=function(){if(fc)return pc;fc=1;var t=bc();return pc.interval=t.IntervalObservable.create,pc}();return t.Observable.interval=e.interval,hc}var mc,gc,wc={},_c={};function Sc(){if(gc)return wc;gc=1;var t=Bi(),e=function(){if(mc)return _c;mc=1;var t=Ys();return _c.of=t.ArrayObservable.of,_c}();return t.Observable.of=e.of,wc}var xc,Oc,Ec,Tc={},kc={},jc={};function Pc(){if(Oc)return kc;Oc=1;var t=function(){if(xc)return jc;xc=1;var t=jc&&jc.__extends||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r]);function n(){this.constructor=t}t.prototype=null===e?Object.create(e):(n.prototype=e.prototype,new n)},e=function(e){function r(t,r){e.call(this),this.error=t,this.scheduler=r}return t(r,e),r.create=function(t,e){return new r(t,e)},r.dispatch=function(t){var e=t.error;t.subscriber.error(e)},r.prototype._subscribe=function(t){var e=this.error,n=this.scheduler;if(t.syncErrorThrowable=!0,n)return n.schedule(r.dispatch,0,{error:e,subscriber:t});t.error(e)},r}(Bi().Observable);return jc.ErrorObservable=e,jc}();return kc._throw=t.ErrorObservable.create,kc}var Ac,Rc={},Cc={},Mc={exports:{}},Lc={exports:{}};var Ic,Bc={exports:{}};function Dc(){return Ic||(Ic=1,(t=Bc).exports=function(t){if("undefined"!=typeof Symbol&&null!=t[Symbol.iterator]||null!=t["@@iterator"])return Array.from(t)},t.exports.__esModule=!0,t.exports.default=t.exports),Bc.exports;var t}var Uc,Nc,qc={exports:{}},Hc={exports:{}};function Fc(){return Uc||(Uc=1,(t=Hc).exports=function(t,e){(null==e||e>t.length)&&(e=t.length);for(var r=0,n=Array(e);r<e;r++)n[r]=t[r];return n},t.exports.__esModule=!0,t.exports.default=t.exports),Hc.exports;var t}function Wc(){return Nc||(Nc=1,t=qc,e=Fc(),t.exports=function(t,r){if(t){if("string"==typeof t)return e(t,r);var n={}.toString.call(t).slice(8,-1);return"Object"===n&&t.constructor&&(n=t.constructor.name),"Map"===n||"Set"===n?Array.from(t):"Arguments"===n||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?e(t,r):void 0}},t.exports.__esModule=!0,t.exports.default=t.exports),qc.exports;var t,e}var $c,Gc,zc,Vc,Jc={exports:{}};function Yc(){return Gc||(Gc=1,t=Mc,e=function(){return Ac||(Ac=1,(t=Lc).exports=function(t){if(Array.isArray(t))return t},t.exports.__esModule=!0,t.exports.default=t.exports),Lc.exports;var t}(),r=Dc(),n=Wc(),o=function(){return $c||($c=1,(t=Jc).exports=function(){throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports),Jc.exports;var t}(),t.exports=function(t){return e(t)||r(t)||n(t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports),Mc.exports;var t,e,r,n,o}function Xc(){return Vc||(Vc=1,function(t){var e=s();Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){var e=[];return t.forEach(function(t){for(var n=(0,r.default)(t),o=n.extname,i=n.name,s=0,a=t;e.includes(a);)a=[i,"(".concat(++s,")")].filter(function(t){return t}).join(" ")+o;e.push(a)}),e};var r=e((zc||(zc=1,function(t){var e=s();Object.defineProperty(t,"__esModule",{value:!0}),t.default=function(t){if(t){if(~t.indexOf(".")){var e=t.split(".").reverse(),n=(0,r.default)(e);return{extname:"."+n[0],name:n.slice(1).reverse().join(".")}}return{extname:"",name:t}}return{extname:"",name:""}};var r=e(Yc())}(Cc)),Cc))}(Rc)),Rc}var Kc,Qc,Zc,tf={},ef={exports:{}};function rf(){return Kc||(Kc=1,function(t){var e=c().default;function r(){t.exports=r=function(){return o},t.exports.__esModule=!0,t.exports.default=t.exports;var n,o={},i=Object.prototype,s=i.hasOwnProperty,a=Object.defineProperty||function(t,e,r){t[e]=r.value},u="function"==typeof Symbol?Symbol:{},c=u.iterator||"@@iterator",f=u.asyncIterator||"@@asyncIterator",l=u.toStringTag||"@@toStringTag";function h(t,e,r){return Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}),t[e]}try{h({},"")}catch(I){h=function(t,e,r){return t[e]=r}}function p(t,e,r,n){var o=e&&e.prototype instanceof w?e:w,i=Object.create(o.prototype),s=new M(n||[]);return a(i,"_invoke",{value:P(t,r,s)}),i}function d(t,e,r){try{return{type:"normal",arg:t.call(e,r)}}catch(n){return{type:"throw",arg:n}}}o.wrap=p;var y="suspendedStart",b="suspendedYield",v="executing",m="completed",g={};function w(){}function _(){}function S(){}var x={};h(x,c,function(){return this});var O=Object.getPrototypeOf,E=O&&O(O(L([])));E&&E!==i&&s.call(E,c)&&(x=E);var T=S.prototype=w.prototype=Object.create(x);function k(t){["next","throw","return"].forEach(function(e){h(t,e,function(t){return this._invoke(e,t)})})}function j(t,r){function n(o,i,a,u){var c=d(t[o],t,i);if("throw"!==c.type){var f=c.arg,l=f.value;return l&&"object"==e(l)&&s.call(l,"__await")?r.resolve(l.__await).then(function(t){n("next",t,a,u)},function(t){n("throw",t,a,u)}):r.resolve(l).then(function(t){f.value=t,a(f)},function(t){return n("throw",t,a,u)})}u(c.arg)}var o;a(this,"_invoke",{value:function(t,e){function i(){return new r(function(r,o){n(t,e,r,o)})}return o=o?o.then(i,i):i()}})}function P(t,e,r){var o=y;return function(i,s){if(o===v)throw Error("Generator is already running");if(o===m){if("throw"===i)throw s;return{value:n,done:!0}}for(r.method=i,r.arg=s;;){var a=r.delegate;if(a){var u=A(a,r);if(u){if(u===g)continue;return u}}if("next"===r.method)r.sent=r._sent=r.arg;else if("throw"===r.method){if(o===y)throw o=m,r.arg;r.dispatchException(r.arg)}else"return"===r.method&&r.abrupt("return",r.arg);o=v;var c=d(t,e,r);if("normal"===c.type){if(o=r.done?m:b,c.arg===g)continue;return{value:c.arg,done:r.done}}"throw"===c.type&&(o=m,r.method="throw",r.arg=c.arg)}}}function A(t,e){var r=e.method,o=t.iterator[r];if(o===n)return e.delegate=null,"throw"===r&&t.iterator.return&&(e.method="return",e.arg=n,A(t,e),"throw"===e.method)||"return"!==r&&(e.method="throw",e.arg=new TypeError("The iterator does not provide a '"+r+"' method")),g;var i=d(o,t.iterator,e.arg);if("throw"===i.type)return e.method="throw",e.arg=i.arg,e.delegate=null,g;var s=i.arg;return s?s.done?(e[t.resultName]=s.value,e.next=t.nextLoc,"return"!==e.method&&(e.method="next",e.arg=n),e.delegate=null,g):s:(e.method="throw",e.arg=new TypeError("iterator result is not an object"),e.delegate=null,g)}function R(t){var e={tryLoc:t[0]};1 in t&&(e.catchLoc=t[1]),2 in t&&(e.finallyLoc=t[2],e.afterLoc=t[3]),this.tryEntries.push(e)}function C(t){var e=t.completion||{};e.type="normal",delete e.arg,t.completion=e}function M(t){this.tryEntries=[{tryLoc:"root"}],t.forEach(R,this),this.reset(!0)}function L(t){if(t||""===t){var r=t[c];if(r)return r.call(t);if("function"==typeof t.next)return t;if(!isNaN(t.length)){var o=-1,i=function e(){for(;++o<t.length;)if(s.call(t,o))return e.value=t[o],e.done=!1,e;return e.value=n,e.done=!0,e};return i.next=i}}throw new TypeError(e(t)+" is not iterable")}return _.prototype=S,a(T,"constructor",{value:S,configurable:!0}),a(S,"constructor",{value:_,configurable:!0}),_.displayName=h(S,l,"GeneratorFunction"),o.isGeneratorFunction=function(t){var e="function"==typeof t&&t.constructor;return!!e&&(e===_||"GeneratorFunction"===(e.displayName||e.name))},o.mark=function(t){return Object.setPrototypeOf?Object.setPrototypeOf(t,S):(t.__proto__=S,h(t,l,"GeneratorFunction")),t.prototype=Object.create(T),t},o.awrap=function(t){return{__await:t}},k(j.prototype),h(j.prototype,f,function(){return this}),o.AsyncIterator=j,o.async=function(t,e,r,n,i){void 0===i&&(i=Promise);var s=new j(p(t,e,r,n),i);return o.isGeneratorFunction(e)?s:s.next().then(function(t){return t.done?t.value:s.next()})},k(T),h(T,l,"Generator"),h(T,c,function(){return this}),h(T,"toString",function(){return"[object Generator]"}),o.keys=function(t){var e=Object(t),r=[];for(var n in e)r.push(n);return r.reverse(),function t(){for(;r.length;){var n=r.pop();if(n in e)return t.value=n,t.done=!1,t}return t.done=!0,t}},o.values=L,M.prototype={constructor:M,reset:function(t){if(this.prev=0,this.next=0,this.sent=this._sent=n,this.done=!1,this.delegate=null,this.method="next",this.arg=n,this.tryEntries.forEach(C),!t)for(var e in this)"t"===e.charAt(0)&&s.call(this,e)&&!isNaN(+e.slice(1))&&(this[e]=n)},stop:function(){this.done=!0;var t=this.tryEntries[0].completion;if("throw"===t.type)throw t.arg;return this.rval},dispatchException:function(t){if(this.done)throw t;var e=this;function r(r,o){return a.type="throw",a.arg=t,e.next=r,o&&(e.method="next",e.arg=n),!!o}for(var o=this.tryEntries.length-1;o>=0;--o){var i=this.tryEntries[o],a=i.completion;if("root"===i.tryLoc)return r("end");if(i.tryLoc<=this.prev){var u=s.call(i,"catchLoc"),c=s.call(i,"finallyLoc");if(u&&c){if(this.prev<i.catchLoc)return r(i.catchLoc,!0);if(this.prev<i.finallyLoc)return r(i.finallyLoc)}else if(u){if(this.prev<i.catchLoc)return r(i.catchLoc,!0)}else{if(!c)throw Error("try statement without catch or finally");if(this.prev<i.finallyLoc)return r(i.finallyLoc)}}}},abrupt:function(t,e){for(var r=this.tryEntries.length-1;r>=0;--r){var n=this.tryEntries[r];if(n.tryLoc<=this.prev&&s.call(n,"finallyLoc")&&this.prev<n.finallyLoc){var o=n;break}}o&&("break"===t||"continue"===t)&&o.tryLoc<=e&&e<=o.finallyLoc&&(o=null);var i=o?o.completion:{};return i.type=t,i.arg=e,o?(this.method="next",this.next=o.finallyLoc,g):this.complete(i)},complete:function(t,e){if("throw"===t.type)throw t.arg;return"break"===t.type||"continue"===t.type?this.next=t.arg:"return"===t.type?(this.rval=this.arg=t.arg,this.method="return",this.next="end"):"normal"===t.type&&e&&(this.next=e),g},finish:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.finallyLoc===t)return this.complete(r.completion,r.afterLoc),C(r),g}},catch:function(t){for(var e=this.tryEntries.length-1;e>=0;--e){var r=this.tryEntries[e];if(r.tryLoc===t){var n=r.completion;if("throw"===n.type){var o=n.arg;C(r)}return o}}throw Error("illegal catch attempt")},delegateYield:function(t,e,r){return this.delegate={iterator:L(t),resultName:e,nextLoc:r},"next"===this.method&&(this.arg=n),g}},o}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(ef)),ef.exports}var nf,of={exports:{}},sf={exports:{}};var af,uf,cf,ff={exports:{}},lf={exports:{}};function hf(){return uf||(uf=1,t=ff,e=function(){return af||(af=1,(t=lf).exports=function(t,e,r){if("function"==typeof t?t===e:t.has(e))return arguments.length<3?e:r;throw new TypeError("Private element is not present on this object")},t.exports.__esModule=!0,t.exports.default=t.exports),lf.exports;var t}(),t.exports=function(t,r){return t.get(e(t,r))},t.exports.__esModule=!0,t.exports.default=t.exports),ff.exports;var t,e}function pf(){return cf||(cf=1,t=of,e=function(){return nf||(nf=1,(t=sf).exports=function(t,e){return e.get?e.get.call(t):e.value},t.exports.__esModule=!0,t.exports.default=t.exports),sf.exports;var t}(),r=hf(),t.exports=function(t,n){var o=r(n,t);return e(t,o)},t.exports.__esModule=!0,t.exports.default=t.exports),of.exports;var t,e,r}var df,yf,bf={exports:{}},vf={exports:{}};function mf(){return yf||(yf=1,t=bf,e=function(){return df||(df=1,(t=vf).exports=function(t,e,r){if(e.set)e.set.call(t,r);else{if(!e.writable)throw new TypeError("attempted to set read only private field");e.value=r}},t.exports.__esModule=!0,t.exports.default=t.exports),vf.exports;var t}(),r=hf(),t.exports=function(t,n,o){var i=r(n,t);return e(t,i,o),o},t.exports.__esModule=!0,t.exports.default=t.exports),bf.exports;var t,e,r}var gf,wf={exports:{}},_f={exports:{}};var Sf,xf,Of={exports:{}};function Ef(){return xf||(xf=1,t=wf,e=function(){return gf||(gf=1,t=_f,e=Fc(),t.exports=function(t){if(Array.isArray(t))return e(t)},t.exports.__esModule=!0,t.exports.default=t.exports),_f.exports;var t,e}(),r=Dc(),n=Wc(),o=function(){return Sf||(Sf=1,(t=Of).exports=function(){throw new TypeError("Invalid attempt to spread non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.")},t.exports.__esModule=!0,t.exports.default=t.exports),Of.exports;var t}(),t.exports=function(t){return e(t)||r(t)||n(t)||o()},t.exports.__esModule=!0,t.exports.default=t.exports),wf.exports;var t,e,r,n,o}var Tf,kf={exports:{}};var jf,Pf={},Af={};var Rf,Cf,Mf={};function Lf(){return Cf||(Cf=1,function(t){const e=function(){if(jf)return Af;jf=1,Af.byteLength=function(t){var e=i(t),r=e[0],n=e[1];return 3*(r+n)/4-n},Af.toByteArray=function(t){var n,o,s=i(t),a=s[0],u=s[1],c=new r(function(t,e,r){return 3*(e+r)/4-r}(0,a,u)),f=0,l=u>0?a-4:a;for(o=0;o<l;o+=4)n=e[t.charCodeAt(o)]<<18|e[t.charCodeAt(o+1)]<<12|e[t.charCodeAt(o+2)]<<6|e[t.charCodeAt(o+3)],c[f++]=n>>16&255,c[f++]=n>>8&255,c[f++]=255&n;return 2===u&&(n=e[t.charCodeAt(o)]<<2|e[t.charCodeAt(o+1)]>>4,c[f++]=255&n),1===u&&(n=e[t.charCodeAt(o)]<<10|e[t.charCodeAt(o+1)]<<4|e[t.charCodeAt(o+2)]>>2,c[f++]=n>>8&255,c[f++]=255&n),c},Af.fromByteArray=function(e){for(var r,n=e.length,o=n%3,i=[],s=16383,u=0,c=n-o;u<c;u+=s)i.push(a(e,u,u+s>c?c:u+s));return 1===o?(r=e[n-1],i.push(t[r>>2]+t[r<<4&63]+"==")):2===o&&(r=(e[n-2]<<8)+e[n-1],i.push(t[r>>10]+t[r>>4&63]+t[r<<2&63]+"=")),i.join("")};for(var t=[],e=[],r="undefined"!=typeof Uint8Array?Uint8Array:Array,n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",o=0;o<64;++o)t[o]=n[o],e[n.charCodeAt(o)]=o;function i(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function s(e){return t[e>>18&63]+t[e>>12&63]+t[e>>6&63]+t[63&e]}function a(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(s(n));return o.join("")}return e["-".charCodeAt(0)]=62,e["_".charCodeAt(0)]=63,Af}(),r=(Rf||(Rf=1,Mf.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},Mf.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}),Mf),n="function"==typeof Symbol&&"function"==typeof Symbol.for?Symbol.for("nodejs.util.inspect.custom"):null;t.Buffer=s,t.SlowBuffer=function(t){+t!=t&&(t=0);return s.alloc(+t)},t.INSPECT_MAX_BYTES=50;const o=2147483647;function i(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');const e=new Uint8Array(t);return Object.setPrototypeOf(e,s.prototype),e}function s(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return c(t)}return a(t,e,r)}function a(t,e,r){if("string"==typeof t)return function(t,e){"string"==typeof e&&""!==e||(e="utf8");if(!s.isEncoding(e))throw new TypeError("Unknown encoding: "+e);const r=0|p(t,e);let n=i(r);const o=n.write(t,e);o!==r&&(n=n.slice(0,o));return n}(t,e);if(ArrayBuffer.isView(t))return function(t){if(V(t,Uint8Array)){const e=new Uint8Array(t);return l(e.buffer,e.byteOffset,e.byteLength)}return f(t)}(t);if(null==t)throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(V(t,ArrayBuffer)||t&&V(t.buffer,ArrayBuffer))return l(t,e,r);if("undefined"!=typeof SharedArrayBuffer&&(V(t,SharedArrayBuffer)||t&&V(t.buffer,SharedArrayBuffer)))return l(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');const n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return s.from(n,e,r);const o=function(t){if(s.isBuffer(t)){const e=0|h(t.length),r=i(e);return 0===r.length||t.copy(r,0,0,e),r}if(void 0!==t.length)return"number"!=typeof t.length||J(t.length)?i(0):f(t);if("Buffer"===t.type&&Array.isArray(t.data))return f(t.data)}(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return s.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function u(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function c(t){return u(t),i(t<0?0:0|h(t))}function f(t){const e=t.length<0?0:0|h(t.length),r=i(e);for(let n=0;n<e;n+=1)r[n]=255&t[n];return r}function l(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');let n;return n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r),Object.setPrototypeOf(n,s.prototype),n}function h(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function p(t,e){if(s.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||V(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);const r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;let o=!1;for(;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return $(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return G(t).length;default:if(o)return n?-1:$(t).length;e=(""+e).toLowerCase(),o=!0}}function d(t,e,r){let n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return j(this,e,r);case"utf8":case"utf-8":return O(this,e,r);case"ascii":return T(this,e,r);case"latin1":case"binary":return k(this,e,r);case"base64":return x(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return P(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function y(t,e,r){const n=t[e];t[e]=t[r],t[r]=n}function b(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),J(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=s.from(e,n)),s.isBuffer(e))return 0===e.length?-1:v(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):v(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function v(t,e,r,n,o){let i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){let n=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===n?0:i-n)){if(-1===n&&(n=i),i-n+1===u)return n*s}else-1!==n&&(i-=i-n),n=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){let r=!0;for(let n=0;n<u;n++)if(c(t,i+n)!==c(e,n)){r=!1;break}if(r)return i}return-1}function m(t,e,r,n){r=Number(r)||0;const o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;const i=e.length;let s;for(n>i/2&&(n=i/2),s=0;s<n;++s){const n=parseInt(e.substr(2*s,2),16);if(J(n))return s;t[r+s]=n}return s}function g(t,e,r,n){return z($(e,t.length-r),t,r,n)}function w(t,e,r,n){return z(function(t){const e=[];for(let r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}(e),t,r,n)}function _(t,e,r,n){return z(G(e),t,r,n)}function S(t,e,r,n){return z(function(t,e){let r,n,o;const i=[];for(let s=0;s<t.length&&!((e-=2)<0);++s)r=t.charCodeAt(s),n=r>>8,o=r%256,i.push(o),i.push(n);return i}(e,t.length-r),t,r,n)}function x(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function O(t,e,r){r=Math.min(t.length,r);const n=[];let o=e;for(;o<r;){const e=t[o];let i=null,s=e>239?4:e>223?3:e>191?2:1;if(o+s<=r){let r,n,a,u;switch(s){case 1:e<128&&(i=e);break;case 2:r=t[o+1],128==(192&r)&&(u=(31&e)<<6|63&r,u>127&&(i=u));break;case 3:r=t[o+1],n=t[o+2],128==(192&r)&&128==(192&n)&&(u=(15&e)<<12|(63&r)<<6|63&n,u>2047&&(u<55296||u>57343)&&(i=u));break;case 4:r=t[o+1],n=t[o+2],a=t[o+3],128==(192&r)&&128==(192&n)&&128==(192&a)&&(u=(15&e)<<18|(63&r)<<12|(63&n)<<6|63&a,u>65535&&u<1114112&&(i=u))}}null===i?(i=65533,s=1):i>65535&&(i-=65536,n.push(i>>>10&1023|55296),i=56320|1023&i),n.push(i),o+=s}return function(t){const e=t.length;if(e<=E)return String.fromCharCode.apply(String,t);let r="",n=0;for(;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=E));return r}(n)}t.kMaxLength=o,s.TYPED_ARRAY_SUPPORT=function(){try{const t=new Uint8Array(1),e={foo:function(){return 42}};return Object.setPrototypeOf(e,Uint8Array.prototype),Object.setPrototypeOf(t,e),42===t.foo()}catch(t){return!1}}(),s.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(s.prototype,"parent",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.buffer}}),Object.defineProperty(s.prototype,"offset",{enumerable:!0,get:function(){if(s.isBuffer(this))return this.byteOffset}}),s.poolSize=8192,s.from=function(t,e,r){return a(t,e,r)},Object.setPrototypeOf(s.prototype,Uint8Array.prototype),Object.setPrototypeOf(s,Uint8Array),s.alloc=function(t,e,r){return function(t,e,r){return u(t),t<=0?i(t):void 0!==e?"string"==typeof r?i(t).fill(e,r):i(t).fill(e):i(t)}(t,e,r)},s.allocUnsafe=function(t){return c(t)},s.allocUnsafeSlow=function(t){return c(t)},s.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==s.prototype},s.compare=function(t,e){if(V(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),V(e,Uint8Array)&&(e=s.from(e,e.offset,e.byteLength)),!s.isBuffer(t)||!s.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;let r=t.length,n=e.length;for(let o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},s.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},s.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return s.alloc(0);let r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;const n=s.allocUnsafe(e);let o=0;for(r=0;r<t.length;++r){let e=t[r];if(V(e,Uint8Array))o+e.length>n.length?(s.isBuffer(e)||(e=s.from(e)),e.copy(n,o)):Uint8Array.prototype.set.call(n,e,o);else{if(!s.isBuffer(e))throw new TypeError('"list" argument must be an Array of Buffers');e.copy(n,o)}o+=e.length}return n},s.byteLength=p,s.prototype._isBuffer=!0,s.prototype.swap16=function(){const t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(let e=0;e<t;e+=2)y(this,e,e+1);return this},s.prototype.swap32=function(){const t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(let e=0;e<t;e+=4)y(this,e,e+3),y(this,e+1,e+2);return this},s.prototype.swap64=function(){const t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(let e=0;e<t;e+=8)y(this,e,e+7),y(this,e+1,e+6),y(this,e+2,e+5),y(this,e+3,e+4);return this},s.prototype.toString=function(){const t=this.length;return 0===t?"":0===arguments.length?O(this,0,t):d.apply(this,arguments)},s.prototype.toLocaleString=s.prototype.toString,s.prototype.equals=function(t){if(!s.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===s.compare(this,t)},s.prototype.inspect=function(){let e="";const r=t.INSPECT_MAX_BYTES;return e=this.toString("hex",0,r).replace(/(.{2})/g,"$1 ").trim(),this.length>r&&(e+=" ... "),"<Buffer "+e+">"},n&&(s.prototype[n]=s.prototype.inspect),s.prototype.compare=function(t,e,r,n,o){if(V(t,Uint8Array)&&(t=s.from(t,t.offset,t.byteLength)),!s.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;let i=(o>>>=0)-(n>>>=0),a=(r>>>=0)-(e>>>=0);const u=Math.min(i,a),c=this.slice(n,o),f=t.slice(e,r);for(let s=0;s<u;++s)if(c[s]!==f[s]){i=c[s],a=f[s];break}return i<a?-1:a<i?1:0},s.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},s.prototype.indexOf=function(t,e,r){return b(this,t,e,r,!0)},s.prototype.lastIndexOf=function(t,e,r){return b(this,t,e,r,!1)},s.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}const o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");let i=!1;for(;;)switch(n){case"hex":return m(this,t,e,r);case"utf8":case"utf-8":return g(this,t,e,r);case"ascii":case"latin1":case"binary":return w(this,t,e,r);case"base64":return _(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return S(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},s.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};const E=4096;function T(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function k(t,e,r){let n="";r=Math.min(t.length,r);for(let o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function j(t,e,r){const n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);let o="";for(let i=e;i<r;++i)o+=Y[t[i]];return o}function P(t,e,r){const n=t.slice(e,r);let o="";for(let i=0;i<n.length-1;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function A(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function R(t,e,r,n,o,i){if(!s.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function C(t,e,r,n,o){q(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i,i>>=8,t[r++]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,s>>=8,t[r++]=s,r}function M(t,e,r,n,o){q(e,n,o,t,r,7);let i=Number(e&BigInt(4294967295));t[r+7]=i,i>>=8,t[r+6]=i,i>>=8,t[r+5]=i,i>>=8,t[r+4]=i;let s=Number(e>>BigInt(32)&BigInt(4294967295));return t[r+3]=s,s>>=8,t[r+2]=s,s>>=8,t[r+1]=s,s>>=8,t[r]=s,r+8}function L(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function I(t,e,n,o,i){return e=+e,n>>>=0,i||L(t,0,n,4),r.write(t,e,n,o,23,4),n+4}function B(t,e,n,o,i){return e=+e,n>>>=0,i||L(t,0,n,8),r.write(t,e,n,o,52,8),n+8}s.prototype.slice=function(t,e){const r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);const n=this.subarray(t,e);return Object.setPrototypeOf(n,s.prototype),n},s.prototype.readUintLE=s.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return n},s.prototype.readUintBE=s.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t+--e],o=1;for(;e>0&&(o*=256);)n+=this[t+--e]*o;return n},s.prototype.readUint8=s.prototype.readUInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),this[t]},s.prototype.readUint16LE=s.prototype.readUInt16LE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]|this[t+1]<<8},s.prototype.readUint16BE=s.prototype.readUInt16BE=function(t,e){return t>>>=0,e||A(t,2,this.length),this[t]<<8|this[t+1]},s.prototype.readUint32LE=s.prototype.readUInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},s.prototype.readUint32BE=s.prototype.readUInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},s.prototype.readBigUInt64LE=X(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=e+256*this[++t]+65536*this[++t]+this[++t]*2**24,o=this[++t]+256*this[++t]+65536*this[++t]+r*2**24;return BigInt(n)+(BigInt(o)<<BigInt(32))}),s.prototype.readBigUInt64BE=X(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=e*2**24+65536*this[++t]+256*this[++t]+this[++t],o=this[++t]*2**24+65536*this[++t]+256*this[++t]+r;return(BigInt(n)<<BigInt(32))+BigInt(o)}),s.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=this[t],o=1,i=0;for(;++i<e&&(o*=256);)n+=this[t+i]*o;return o*=128,n>=o&&(n-=Math.pow(2,8*e)),n},s.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||A(t,e,this.length);let n=e,o=1,i=this[t+--n];for(;n>0&&(o*=256);)i+=this[t+--n]*o;return o*=128,i>=o&&(i-=Math.pow(2,8*e)),i},s.prototype.readInt8=function(t,e){return t>>>=0,e||A(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},s.prototype.readInt16LE=function(t,e){t>>>=0,e||A(t,2,this.length);const r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt16BE=function(t,e){t>>>=0,e||A(t,2,this.length);const r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},s.prototype.readInt32LE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},s.prototype.readInt32BE=function(t,e){return t>>>=0,e||A(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},s.prototype.readBigInt64LE=X(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=this[t+4]+256*this[t+5]+65536*this[t+6]+(r<<24);return(BigInt(n)<<BigInt(32))+BigInt(e+256*this[++t]+65536*this[++t]+this[++t]*2**24)}),s.prototype.readBigInt64BE=X(function(t){H(t>>>=0,"offset");const e=this[t],r=this[t+7];void 0!==e&&void 0!==r||F(t,this.length-8);const n=(e<<24)+65536*this[++t]+256*this[++t]+this[++t];return(BigInt(n)<<BigInt(32))+BigInt(this[++t]*2**24+65536*this[++t]+256*this[++t]+r)}),s.prototype.readFloatLE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!0,23,4)},s.prototype.readFloatBE=function(t,e){return t>>>=0,e||A(t,4,this.length),r.read(this,t,!1,23,4)},s.prototype.readDoubleLE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!0,52,8)},s.prototype.readDoubleBE=function(t,e){return t>>>=0,e||A(t,8,this.length),r.read(this,t,!1,52,8)},s.prototype.writeUintLE=s.prototype.writeUIntLE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){R(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},s.prototype.writeUintBE=s.prototype.writeUIntBE=function(t,e,r,n){if(t=+t,e>>>=0,r>>>=0,!n){R(this,t,e,r,Math.pow(2,8*r)-1,0)}let o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},s.prototype.writeUint8=s.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,255,0),this[e]=255&t,e+1},s.prototype.writeUint16LE=s.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeUint16BE=s.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeUint32LE=s.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},s.prototype.writeUint32BE=s.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigUInt64LE=X(function(t,e=0){return C(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeBigUInt64BE=X(function(t,e=0){return M(this,t,e,BigInt(0),BigInt("0xffffffffffffffff"))}),s.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let o=0,i=1,s=0;for(this[e]=255&t;++o<r&&(i*=256);)t<0&&0===s&&0!==this[e+o-1]&&(s=1),this[e+o]=(t/i|0)-s&255;return e+r},s.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){const n=Math.pow(2,8*r-1);R(this,t,e,r,n-1,-n)}let o=r-1,i=1,s=0;for(this[e+o]=255&t;--o>=0&&(i*=256);)t<0&&0===s&&0!==this[e+o+1]&&(s=1),this[e+o]=(t/i|0)-s&255;return e+r},s.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},s.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},s.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},s.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},s.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||R(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},s.prototype.writeBigInt64LE=X(function(t,e=0){return C(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeBigInt64BE=X(function(t,e=0){return M(this,t,e,-BigInt("0x8000000000000000"),BigInt("0x7fffffffffffffff"))}),s.prototype.writeFloatLE=function(t,e,r){return I(this,t,e,!0,r)},s.prototype.writeFloatBE=function(t,e,r){return I(this,t,e,!1,r)},s.prototype.writeDoubleLE=function(t,e,r){return B(this,t,e,!0,r)},s.prototype.writeDoubleBE=function(t,e,r){return B(this,t,e,!1,r)},s.prototype.copy=function(t,e,r,n){if(!s.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);const o=n-r;return this===t&&"function"==typeof Uint8Array.prototype.copyWithin?this.copyWithin(e,r,n):Uint8Array.prototype.set.call(t,this.subarray(r,n),e),o},s.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!s.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){const e=t.charCodeAt(0);("utf8"===n&&e<128||"latin1"===n)&&(t=e)}}else"number"==typeof t?t&=255:"boolean"==typeof t&&(t=Number(t));if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;let o;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(o=e;o<r;++o)this[o]=t;else{const i=s.isBuffer(t)?t:s.from(t,n),a=i.length;if(0===a)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(o=0;o<r-e;++o)this[o+e]=i[o%a]}return this};const D={};function U(t,e,r){D[t]=class extends r{constructor(){super(),Object.defineProperty(this,"message",{value:e.apply(this,arguments),writable:!0,configurable:!0}),this.name=`${this.name} [${t}]`,this.stack,delete this.name}get code(){return t}set code(t){Object.defineProperty(this,"code",{configurable:!0,enumerable:!0,value:t,writable:!0})}toString(){return`${this.name} [${t}]: ${this.message}`}}}function N(t){let e="",r=t.length;const n="-"===t[0]?1:0;for(;r>=n+4;r-=3)e=`_${t.slice(r-3,r)}${e}`;return`${t.slice(0,r)}${e}`}function q(t,e,r,n,o,i){if(t>r||t<e){const r="bigint"==typeof e?"n":"";let n;throw n=0===e||e===BigInt(0)?`>= 0${r} and < 2${r} ** ${8*(i+1)}${r}`:`>= -(2${r} ** ${8*(i+1)-1}${r}) and < 2 ** ${8*(i+1)-1}${r}`,new D.ERR_OUT_OF_RANGE("value",n,t)}!function(t,e,r){H(e,"offset"),void 0!==t[e]&&void 0!==t[e+r]||F(e,t.length-(r+1))}(n,o,i)}function H(t,e){if("number"!=typeof t)throw new D.ERR_INVALID_ARG_TYPE(e,"number",t)}function F(t,e,r){if(Math.floor(t)!==t)throw H(t,r),new D.ERR_OUT_OF_RANGE("offset","an integer",t);if(e<0)throw new D.ERR_BUFFER_OUT_OF_BOUNDS;throw new D.ERR_OUT_OF_RANGE("offset",`>= 0 and <= ${e}`,t)}U("ERR_BUFFER_OUT_OF_BOUNDS",function(t){return t?`${t} is outside of buffer bounds`:"Attempt to access memory outside buffer bounds"},RangeError),U("ERR_INVALID_ARG_TYPE",function(t,e){return`The "${t}" argument must be of type number. Received type ${typeof e}`},TypeError),U("ERR_OUT_OF_RANGE",function(t,e,r){let n=`The value of "${t}" is out of range.`,o=r;return Number.isInteger(r)&&Math.abs(r)>2**32?o=N(String(r)):"bigint"==typeof r&&(o=String(r),(r>BigInt(2)**BigInt(32)||r<-(BigInt(2)**BigInt(32)))&&(o=N(o)),o+="n"),n+=` It must be ${e}. Received ${o}`,n},RangeError);const W=/[^+/0-9A-Za-z-_]/g;function $(t,e){let r;e=e||1/0;const n=t.length;let o=null;const i=[];for(let s=0;s<n;++s){if(r=t.charCodeAt(s),r>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function G(t){return e.toByteArray(function(t){if((t=(t=t.split("=")[0]).trim().replace(W,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}(t))}function z(t,e,r,n){let o;for(o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function V(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function J(t){return t!=t}const Y=function(){const t="0123456789abcdef",e=new Array(256);for(let r=0;r<16;++r){const n=16*r;for(let o=0;o<16;++o)e[n+o]=t[r]+t[o]}return e}();function X(t){return"undefined"==typeof BigInt?K:t}function K(){throw new Error("BigInt not supported")}}(Pf)),Pf}function If(t){throw new Error('Could not dynamically require "'+t+'". Please configure the dynamicRequireTargets or/and ignoreDynamicRequires option of @rollup/plugin-commonjs appropriately for this require call to work.')}var Bf,Df={exports:{}};function Uf(){return Bf||(Bf=1,Df.exports=function(){function t(e,r,n){function o(s,a){if(!r[s]){if(!e[s]){if(!a&&If)return If(s);if(i)return i(s,!0);var u=new Error("Cannot find module '"+s+"'");throw u.code="MODULE_NOT_FOUND",u}var c=r[s]={exports:{}};e[s][0].call(c.exports,function(t){return o(e[s][1][t]||t)},c,c.exports,t,e,r,n)}return r[s].exports}for(var i=If,s=0;s<n.length;s++)o(n[s]);return o}return t}()({1:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadAssembler=void 0;var i=t("../subscribableStream"),s=t("../payloads"),a=t("../contentStream"),u=function(){function t(t,e){if(this.streamManager=t,this._byteOrderMark=65279,this._utf="utf8",e.header?(this.id=e.header.id,this.payloadType=e.header.payloadType,this.contentLength=e.header.payloadLength,this.end=e.header.end):this.id=e.id,!this.id)throw Error("An ID must be supplied when creating an assembler.");this._onCompleted=e.onCompleted}return t.prototype.getPayloadStream=function(){return this.stream||(this.stream=this.createPayloadStream()),this.stream},t.prototype.onReceive=function(t,e,r){this.end=t.end,t.payloadType===s.PayloadTypes.response||t.payloadType===s.PayloadTypes.request?this.process(e).then().catch():t.end&&e.end()},t.prototype.close=function(){this.streamManager.closeStream(this.id)},t.prototype.createPayloadStream=function(){return new i.SubscribableStream},t.prototype.payloadFromJson=function(t){return JSON.parse(t.charCodeAt(0)===this._byteOrderMark?t.slice(1):t)},t.prototype.stripBOM=function(t){return t.charCodeAt(0)===this._byteOrderMark?t.slice(1):t},t.prototype.process=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return(e=t.read(t.length))?(r=e.toString(this._utf),this.payloadType!==s.PayloadTypes.request?[3,2]:[4,this.processRequest(r)]):[2];case 1:return n.sent(),[3,4];case 2:return this.payloadType!==s.PayloadTypes.response?[3,4]:[4,this.processResponse(r)];case 3:n.sent(),n.label=4;case 4:return[2]}})})},t.prototype.processResponse=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return e=this.payloadFromJson(this.stripBOM(t)),r={streams:[],statusCode:e.statusCode},[4,this.processStreams(e,r)];case 1:return n.sent(),[2]}})})},t.prototype.processRequest=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return e=this.payloadFromJson(t),r={streams:[],path:e.path,verb:e.verb},[4,this.processStreams(e,r)];case 1:return n.sent(),[2]}})})},t.prototype.processStreams=function(t,e){var r;return n(this,void 0,void 0,function(){var n=this;return o(this,function(o){switch(o.label){case 0:return null===(r=t.streams)||void 0===r||r.forEach(function(t){var r,o=null!==(r=t.type)&&void 0!==r?r:t.contentType,i=n.streamManager.getPayloadAssembler(t.id);i.payloadType=o,i.contentLength=t.length,e.streams.push(new a.ContentStream(t.id,i))}),[4,this._onCompleted(this.id,e)];case 1:return o.sent(),[2]}})})},t}();r.PayloadAssembler=u},{"../contentStream":2,"../payloads":16,"../subscribableStream":27}],2:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.ContentStream=void 0;var i=function(){function t(t,e){if(!e)throw Error("Null Argument Exception");this.id=t,this.assembler=e}return Object.defineProperty(t.prototype,"contentType",{get:function(){return this.assembler.payloadType},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this.assembler.contentLength},enumerable:!1,configurable:!0}),t.prototype.getStream=function(){return this.stream||(this.stream=this.assembler.getPayloadStream()),this.stream},t.prototype.cancel=function(){this.assembler.close()},t.prototype.readAsString=function(){return n(this,void 0,void 0,function(){return o(this,function(t){switch(t.label){case 0:return[4,this.readAll()];case 1:return[2,(t.sent().bufferArray||[]).map(function(t){return t.toString("utf8")}).join("")]}})})},t.prototype.readAsJson=function(){return n(this,void 0,void 0,function(){var t;return o(this,function(e){switch(e.label){case 0:return[4,this.readAsString()];case 1:return t=e.sent(),[2,JSON.parse(t)]}})})},t.prototype.readAll=function(){return n(this,void 0,void 0,function(){var t,e,r,n,i=this;return o(this,function(o){switch(o.label){case 0:for(t=[],e=0,r=this.getStream();e<r.length;)n=r.read(r.length),t.push(n),e+=n.length;return e<this.length?[4,new Promise(function(n){var o=function(r){return function(o){t.push(o),(e+=o.length)===r.length&&n(!0)}};r.subscribe(o(i))})]:[3,2];case 1:o.sent(),o.label=2;case 2:return[2,{bufferArray:t,size:e}]}})})},t}();r.ContentStream=i},{}],3:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.CancelDisassembler=void 0;var n=function(){function t(t,e,r){this.sender=t,this.id=e,this.payloadType=r}return t.prototype.disassemble=function(){var t={payloadType:this.payloadType,payloadLength:0,id:this.id,end:!0};this.sender.sendPayload(t)},t}();r.CancelDisassembler=n},{}],4:[function(t,e,r){var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.HttpContentStreamDisassembler=void 0;var s=t("./payloadDisassembler"),a=t("../payloads"),u=function(t){function e(e,r){var n=t.call(this,e,r.id)||this;return n.payloadType=a.PayloadTypes.stream,n.contentStream=r,n}return n(e,t),e.prototype.getStream=function(){return o(this,void 0,void 0,function(){var t;return i(this,function(e){return[2,{stream:t=this.contentStream.content.getStream(),streamLength:t.length}]})})},e}(s.PayloadDisassembler);r.HttpContentStreamDisassembler=u},{"../payloads":16,"./payloadDisassembler":5}],5:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadDisassembler=void 0;var i=t("../subscribableStream"),s=function(){function t(t,e){this.sender=t,this.id=e}return t.serialize=function(t){var e=new i.SubscribableStream;return e.write(JSON.stringify(t)),e.end(),{stream:e,streamLength:e.length}},t.prototype.disassemble=function(){return n(this,void 0,void 0,function(){var t,e,r;return o(this,function(n){switch(n.label){case 0:return[4,this.getStream()];case 1:return t=n.sent(),e=t.stream,r=t.streamLength,this.stream=e,this.streamLength=r,[2,this.send()]}})})},t.prototype.send=function(){return n(this,void 0,void 0,function(){var t;return o(this,function(e){return t={payloadType:this.payloadType,payloadLength:this.streamLength,id:this.id,end:!0},this.sender.sendPayload(t,this.stream),[2]})})},t}();r.PayloadDisassembler=s},{"../subscribableStream":27}],6:[function(t,e,r){var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.RequestDisassembler=void 0;var s=t("../payloads/payloadTypes"),a=t("./payloadDisassembler"),u=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.request=n,o.payloadType=s.PayloadTypes.request,o}return n(e,t),e.prototype.getStream=function(){var t,e,r,n;return o(this,void 0,void 0,function(){var o;return i(this,function(i){return o={verb:null===(t=this.request)||void 0===t?void 0:t.verb,path:null===(e=this.request)||void 0===e?void 0:e.path,streams:[]},null===(n=null===(r=this.request)||void 0===r?void 0:r.streams)||void 0===n||n.forEach(function(t){o.streams.push(t.description)}),[2,a.PayloadDisassembler.serialize(o)]})})},e}(a.PayloadDisassembler);r.RequestDisassembler=u},{"../payloads/payloadTypes":19,"./payloadDisassembler":5}],7:[function(t,e,r){var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}(),o=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},i=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.ResponseDisassembler=void 0;var s=t("../payloads/payloadTypes"),a=t("./payloadDisassembler"),u=function(t){function e(e,r,n){var o=t.call(this,e,r)||this;return o.payloadType=s.PayloadTypes.response,o.response=n,o}return n(e,t),e.prototype.getStream=function(){var t;return o(this,void 0,void 0,function(){var e;return i(this,function(r){return e={statusCode:this.response.statusCode,streams:[]},null===(t=this.response.streams)||void 0===t||t.forEach(function(t){var r=t.description;e.streams.push({id:r.id,contentType:r.type,length:r.length})}),[2,a.PayloadDisassembler.serialize(e)]})})},e}(a.PayloadDisassembler);r.ResponseDisassembler=u},{"../payloads/payloadTypes":19,"./payloadDisassembler":5}],8:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.HttpContent=r.HttpContentStream=void 0;var n=t("./utilities/protocol-base"),o=function(){function t(t){var e,r,o,i,s,a;this.content=t,this.id=(0,n.generateGuid)(),this.description={id:this.id,type:null!==(o=null===(r=null===(e=this.content)||void 0===e?void 0:e.headers)||void 0===r?void 0:r.type)&&void 0!==o?o:"unknown",length:null!==(a=null===(s=null===(i=this.content)||void 0===i?void 0:i.headers)||void 0===s?void 0:s.contentLength)&&void 0!==a?a:0}}return t}();r.HttpContentStream=o;var i=function(){function t(t,e){this.headers=t,this.stream=e}return t.prototype.getStream=function(){return this.stream},t}();r.HttpContent=i},{"./utilities/protocol-base":28}],9:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebSocketClient=r.BrowserWebSocket=r.SubscribableStream=r.StreamingResponse=r.StreamingRequest=r.RequestHandler=r.HttpContent=r.ContentStream=void 0;var n=t("./contentStream");Object.defineProperty(r,"ContentStream",{enumerable:!0,get:function(){return n.ContentStream}});var o=t("./httpContentStream");Object.defineProperty(r,"HttpContent",{enumerable:!0,get:function(){return o.HttpContent}});var i=t("./requestHandler");Object.defineProperty(r,"RequestHandler",{enumerable:!0,get:function(){return i.RequestHandler}});var s=t("./streamingRequest");Object.defineProperty(r,"StreamingRequest",{enumerable:!0,get:function(){return s.StreamingRequest}});var a=t("./streamingResponse");Object.defineProperty(r,"StreamingResponse",{enumerable:!0,get:function(){return a.StreamingResponse}});var u=t("./subscribableStream");Object.defineProperty(r,"SubscribableStream",{enumerable:!0,get:function(){return u.SubscribableStream}});var c=t("./webSocket/index-browser");Object.defineProperty(r,"BrowserWebSocket",{enumerable:!0,get:function(){return c.BrowserWebSocket}}),Object.defineProperty(r,"WebSocketClient",{enumerable:!0,get:function(){return c.WebSocketClient}})},{"./contentStream":2,"./httpContentStream":8,"./requestHandler":24,"./streamingRequest":25,"./streamingResponse":26,"./subscribableStream":27,"./webSocket/index-browser":31}],10:[function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(r,"__esModule",{value:!0}),o(t("./payloadReceiver"),r),o(t("./payloadSender"),r),o(t("./transportDisconnectedEvent"),r),o(t("./transportDisconnectedEventHandler"),r)},{"./payloadReceiver":11,"./payloadSender":12,"./transportDisconnectedEvent":13,"./transportDisconnectedEventHandler":14}],11:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadReceiver=void 0;var i=t("../payloads/payloadTypes"),s=t("../payloads/headerSerializer"),a=t("../payloads/payloadConstants"),u=t("./transportDisconnectedEvent"),c=function(){function t(){}return Object.defineProperty(t.prototype,"isConnected",{get:function(){return null!=this._receiver},enumerable:!1,configurable:!0}),t.prototype.connect=function(t){return this._receiver=t,this.receivePackets()},t.prototype.subscribe=function(t,e){this._getStream=t,this._receiveAction=e},t.prototype.disconnect=function(t){var e,r;if(void 0===t&&(t=u.TransportDisconnectedEvent.Empty),this.isConnected)try{this._receiver.close(),null===(e=this.disconnected)||void 0===e||e.call(this,this,t)}catch(n){null===(r=this.disconnected)||void 0===r||r.call(this,this,new u.TransportDisconnectedEvent(n.message))}finally{this._receiver=null}},t.prototype.receivePackets=function(){return n(this,void 0,void 0,function(){var t,e,r,n,c,f,l,h,p;return o(this,function(o){switch(o.label){case 0:if(!this.isConnected)return[3,11];o.label=1;case 1:o.trys.push([1,9,,10]),t=0,o.label=2;case 2:return t<a.PayloadConstants.MaxHeaderLength?(e=this,[4,this._receiver.receive(a.PayloadConstants.MaxHeaderLength-t)]):[3,4];case 3:return e._receiveHeaderBuffer=o.sent(),this._receiveHeaderBuffer&&(t+=this._receiveHeaderBuffer.length),[3,2];case 4:if(r=s.HeaderSerializer.deserialize(this._receiveHeaderBuffer),n=r.payloadType===i.PayloadTypes.stream,!(r.payloadLength>0))return[3,8];c=0,f=this._getStream(r),o.label=5;case 5:return c<r.payloadLength&&c<a.PayloadConstants.MaxPayloadLength?(l=Math.min(r.payloadLength-c,a.PayloadConstants.MaxPayloadLength),h=this,[4,this._receiver.receive(l)]):[3,7];case 6:return h._receivePayloadBuffer=o.sent(),c+=this._receivePayloadBuffer.byteLength,f.write(this._receivePayloadBuffer),n&&this._receiveAction(r,f,c),[3,5];case 7:n||this._receiveAction(r,f,c),o.label=8;case 8:return[3,10];case 9:return p=o.sent(),this.disconnect(new u.TransportDisconnectedEvent(p.message)),[3,10];case 10:return[3,0];case 11:return[2]}})})},t}();r.PayloadReceiver=c},{"../payloads/headerSerializer":15,"../payloads/payloadConstants":18,"../payloads/payloadTypes":19,"./transportDisconnectedEvent":13}],12:[function(t,e,r){(function(e){(function(){Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadSender=void 0;var n=t("../payloads/headerSerializer"),o=t("../payloads/payloadConstants"),i=t("./transportDisconnectedEvent"),s=function(){function t(){}return Object.defineProperty(t.prototype,"isConnected",{get:function(){return null!=this._sender},enumerable:!1,configurable:!0}),t.prototype.connect=function(t){this._sender=t},t.prototype.sendPayload=function(t,e,r){var n={header:t,payload:e,sentCallback:r};this.writePacket(n)},t.prototype.disconnect=function(t){var e,r;if(void 0===t&&(t=i.TransportDisconnectedEvent.Empty),this.isConnected)try{this._sender.close(),null===(e=this.disconnected)||void 0===e||e.call(this,this,t)}catch(n){null===(r=this.disconnected)||void 0===r||r.call(this,this,new i.TransportDisconnectedEvent(n.message))}finally{this._sender=null}},t.prototype.writePacket=function(t){try{if(t.header.payloadLength>0&&t.payload){for(var r=t.header.payloadLength;r>0;){var s=r<=o.PayloadConstants.MaxPayloadLength?r:o.PayloadConstants.MaxPayloadLength,a=t.payload.read(s),u=t.header;u.payloadLength=s,u.end=r<=o.PayloadConstants.MaxPayloadLength;var c=e.alloc(o.PayloadConstants.MaxHeaderLength);n.HeaderSerializer.serialize(u,c),this._sender.send(c),this._sender.send(a),r-=a.length}t.sentCallback&&t.sentCallback()}}catch(f){this.disconnect(new i.TransportDisconnectedEvent(f.message))}},t}();r.PayloadSender=s}).call(this)}).call(this,t("buffer").Buffer)},{"../payloads/headerSerializer":15,"../payloads/payloadConstants":18,"./transportDisconnectedEvent":13,buffer:35}],13:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.TransportDisconnectedEvent=void 0;var n=function(){function t(t){this.reason=t}return t.Empty=new t,t}();r.TransportDisconnectedEvent=n},{}],14:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0})},{}],15:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.HeaderSerializer=void 0;var n=t("./payloadConstants"),o=function(){function t(){}return t.serialize=function(t,e){e.write(t.payloadType,this.TypeOffset,1,this.Encoding),e.write(this.Delimiter,this.TypeDelimiterOffset,1,this.Encoding),e.write(this.headerLengthPadder(t.payloadLength,this.LengthLength,"0"),this.LengthOffset,this.LengthLength,this.Encoding),e.write(this.Delimiter,this.LengthDelimeterOffset,1,this.Encoding),e.write(t.id,this.IdOffset),e.write(this.Delimiter,this.IdDelimeterOffset,1,this.Encoding),e.write(t.end?this.End:this.NotEnd,this.EndOffset),e.write(this.Terminator,this.TerminatorOffset)},t.deserialize=function(t){var e=t.toString(this.Encoding),r=e.split(this.Delimiter);if(4!==r.length)throw Error("Cannot parse header, header is malformed. Header: ".concat(e));var o=r[0],i=r[1],s=r[2],a=r[3],u={end:"1\n"===a,payloadLength:Number(i),payloadType:o,id:s};if(!(u.payloadLength<=n.PayloadConstants.MaxPayloadLength&&u.payloadLength>=n.PayloadConstants.MinLength))throw Error("Header length of ".concat(u.payloadLength," is missing or malformed"));if(u.payloadType.length!==this.TypeDelimiterOffset)throw Error("Header type '".concat(u.payloadType.length,"' is missing or malformed."));if(!u.id||!u.id.match(/^[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}$/i)||u.id.length!==this.IdLength)throw Error("Header ID '".concat(u.id,"' is missing or malformed."));if("0\n"!==a&&"1\n"!==a)throw Error("Header End is missing or not a valid value. Header end: '".concat(a,"'"));return u},t.headerLengthPadder=function(t,e,r){var n=Array(e+1).join(r),o=t.toString();return(n+o).slice(o.length)},t.Delimiter=".",t.Terminator="\n",t.End="1",t.NotEnd="0",t.TypeOffset=0,t.TypeDelimiterOffset=1,t.LengthOffset=2,t.LengthLength=6,t.LengthDelimeterOffset=8,t.IdOffset=9,t.IdLength=36,t.IdDelimeterOffset=45,t.EndOffset=46,t.TerminatorOffset=47,t.Encoding="utf8",t}();r.HeaderSerializer=o},{"./payloadConstants":18}],16:[function(t,e,r){var n=this&&this.__createBinding||(Object.create?function(t,e,r,n){void 0===n&&(n=r);var o=Object.getOwnPropertyDescriptor(e,r);o&&!("get"in o?!e.__esModule:o.writable||o.configurable)||(o={enumerable:!0,get:function(){return e[r]}}),Object.defineProperty(t,n,o)}:function(t,e,r,n){void 0===n&&(n=r),t[n]=e[r]}),o=this&&this.__exportStar||function(t,e){for(var r in t)"default"===r||Object.prototype.hasOwnProperty.call(e,r)||n(e,t,r)};Object.defineProperty(r,"__esModule",{value:!0}),o(t("./headerSerializer"),r),o(t("./streamManager"),r),o(t("./payloadAssemblerManager"),r),o(t("./payloadTypes"),r),o(t("./requestManager"),r),o(t("./sendOperations"),r),o(t("./streamManager"),r)},{"./headerSerializer":15,"./payloadAssemblerManager":17,"./payloadTypes":19,"./requestManager":20,"./sendOperations":21,"./streamManager":22}],17:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadAssemblerManager=void 0;var n=t("../assemblers/payloadAssembler"),o=t("./payloadTypes"),i=function(){function t(t,e,r){this.streamManager=t,this.onReceiveResponse=e,this.onReceiveRequest=r,this.activeAssemblers={}}return t.prototype.getPayloadStream=function(t){if(t.payloadType===o.PayloadTypes.stream)return this.streamManager.getPayloadStream(t);if(!this.activeAssemblers[t.id]){var e=this.createPayloadAssembler(t);if(e)return this.activeAssemblers[t.id]=e,e.getPayloadStream()}},t.prototype.onReceive=function(t,e,r){t.payloadType===o.PayloadTypes.stream?this.streamManager.onReceive(t,e,r):(this.activeAssemblers&&this.activeAssemblers[t.id]&&this.activeAssemblers[t.id].onReceive(t,e,r),t.end&&delete this.activeAssemblers[t.id])},t.prototype.createPayloadAssembler=function(t){return t.payloadType===o.PayloadTypes.request?new n.PayloadAssembler(this.streamManager,{header:t,onCompleted:this.onReceiveRequest}):t.payloadType===o.PayloadTypes.response?new n.PayloadAssembler(this.streamManager,{header:t,onCompleted:this.onReceiveResponse}):void 0},t}();r.PayloadAssemblerManager=i},{"../assemblers/payloadAssembler":1,"./payloadTypes":19}],18:[function(t,e,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadConstants=void 0,(n=r.PayloadConstants||(r.PayloadConstants={}))[n.MaxPayloadLength=4096]="MaxPayloadLength",n[n.MaxHeaderLength=48]="MaxHeaderLength",n[n.MaxLength=999999]="MaxLength",n[n.MinLength=0]="MinLength"},{}],19:[function(t,e,r){var n;Object.defineProperty(r,"__esModule",{value:!0}),r.PayloadTypes=void 0,(n=r.PayloadTypes||(r.PayloadTypes={})).request="A",n.response="B",n.stream="S",n.cancelAll="X",n.cancelStream="C"},{}],20:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.RequestManager=void 0;var i=function(){function t(){}return t}(),s=function(){function t(){this._pendingRequests={}}return t.prototype.pendingRequestCount=function(){return Object.keys(this._pendingRequests).length},t.prototype.signalResponse=function(t,e){return n(this,void 0,void 0,function(){var r;return o(this,function(n){return(r=this._pendingRequests[t])?(r.resolve(e),delete this._pendingRequests[t],[2,!0]):[2,!1]})})},t.prototype.getResponse=function(t){var e=this._pendingRequests[t];if(e)return Promise.reject("requestId '".concat(t,"' already exists in RequestManager"));(e=new i).requestId=t;var r=new Promise(function(t,r){e.resolve=t,e.reject=r});return this._pendingRequests[t]=e,r},t.prototype.rejectAllResponses=function(t){var e=this;Object.entries(this._pendingRequests).forEach(function(r){var n=r[0];(0,r[1].reject)(t),delete e._pendingRequests[n]})},t}();r.RequestManager=s},{}],21:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.SendOperations=void 0;var i=t("../disassemblers/cancelDisassembler"),s=t("../disassemblers/httpContentStreamDisassembler"),a=t("../disassemblers/requestDisassembler"),u=t("../disassemblers/responseDisassembler"),c=t("./payloadTypes"),f=function(){function t(t){this.payloadSender=t}return t.prototype.sendRequest=function(t,e){return n(this,void 0,void 0,function(){var r=this;return o(this,function(i){switch(i.label){case 0:return[4,new a.RequestDisassembler(this.payloadSender,t,e).disassemble()];case 1:return i.sent(),e.streams&&e.streams.forEach(function(t){return n(r,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,new s.HttpContentStreamDisassembler(this.payloadSender,t).disassemble()];case 1:return e.sent(),[2]}})})}),[2]}})})},t.prototype.sendResponse=function(t,e){return n(this,void 0,void 0,function(){var r=this;return o(this,function(i){switch(i.label){case 0:return[4,new u.ResponseDisassembler(this.payloadSender,t,e).disassemble()];case 1:return i.sent(),e.streams&&e.streams.forEach(function(t){return n(r,void 0,void 0,function(){return o(this,function(e){switch(e.label){case 0:return[4,new s.HttpContentStreamDisassembler(this.payloadSender,t).disassemble()];case 1:return e.sent(),[2]}})})}),[2]}})})},t.prototype.sendCancelStream=function(t){return n(this,void 0,void 0,function(){return o(this,function(e){return new i.CancelDisassembler(this.payloadSender,t,c.PayloadTypes.cancelStream).disassemble(),[2]})})},t}();r.SendOperations=f},{"../disassemblers/cancelDisassembler":3,"../disassemblers/httpContentStreamDisassembler":4,"../disassemblers/requestDisassembler":6,"../disassemblers/responseDisassembler":7,"./payloadTypes":19}],22:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StreamManager=void 0;var n=t("../assemblers/payloadAssembler"),o=function(){function t(t){this.onCancelStream=t,this.activeAssemblers=[]}return t.prototype.getPayloadAssembler=function(t){if(this.activeAssemblers[t])return this.activeAssemblers[t];var e=new n.PayloadAssembler(this,{id:t});return this.activeAssemblers[t]=e,e},t.prototype.getPayloadStream=function(t){return this.getPayloadAssembler(t.id).getPayloadStream()},t.prototype.onReceive=function(t,e,r){this.activeAssemblers[t.id]&&this.activeAssemblers[t.id].onReceive(t,e,r)},t.prototype.closeStream=function(t){if(this.activeAssemblers[t]){var e=this.activeAssemblers[t];this.activeAssemblers.splice(this.activeAssemblers.indexOf(t),1);var r=e.getPayloadStream();(e.contentLength&&r.length<e.contentLength||!e.end)&&this.onCancelStream(e)}},t}();r.StreamManager=o},{"../assemblers/payloadAssembler":1}],23:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.ProtocolAdapter=void 0;var i=t("./payloads/payloadAssemblerManager"),s=t("./payloads/sendOperations"),a=t("./payloads/streamManager"),u=t("./utilities/protocol-base"),c=function(){function t(t,e,r,n){var o=this;this.requestHandler=t,this.requestManager=e,this.payloadSender=r,this.payloadReceiver=n,this.sendOperations=new s.SendOperations(this.payloadSender),this.streamManager=new a.StreamManager(this.onCancelStream),this.assemblerManager=new i.PayloadAssemblerManager(this.streamManager,function(t,e){return o.onReceiveResponse(t,e)},function(t,e){return o.onReceiveRequest(t,e)}),this.payloadReceiver.subscribe(function(t){return o.assemblerManager.getPayloadStream(t)},function(t,e,r){return o.assemblerManager.onReceive(t,e,r)})}return t.prototype.sendRequest=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){switch(n.label){case 0:return e=(0,u.generateGuid)(),r=this.requestManager.getResponse(e),[4,this.sendOperations.sendRequest(e,t)];case 1:return n.sent(),[2,r]}})})},t.prototype.onReceiveRequest=function(t,e){return n(this,void 0,void 0,function(){var r;return o(this,function(n){switch(n.label){case 0:return this.requestHandler?[4,this.requestHandler.processRequest(e)]:[3,3];case 1:return(r=n.sent())?[4,this.sendOperations.sendResponse(t,r)]:[3,3];case 2:n.sent(),n.label=3;case 3:return[2]}})})},t.prototype.onReceiveResponse=function(t,e){return n(this,void 0,void 0,function(){return o(this,function(r){switch(r.label){case 0:return[4,this.requestManager.signalResponse(t,e)];case 1:return r.sent(),[2]}})})},t.prototype.onCancelStream=function(t){this.sendOperations.sendCancelStream(t.id).catch()},t}();r.ProtocolAdapter=c},{"./payloads/payloadAssemblerManager":17,"./payloads/sendOperations":21,"./payloads/streamManager":22,"./utilities/protocol-base":28}],24:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.RequestHandler=void 0;var n=function(){function t(){}return t}();r.RequestHandler=n},{}],25:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StreamingRequest=void 0;var n=t("./httpContentStream"),o=t("./subscribableStream"),i=function(){function t(){this.streams=[]}return t.create=function(e,r,n){var o=new t;return o.verb=e,o.path=r,n&&o.setBody(n),o},t.prototype.addStream=function(t){if(!t)throw new Error("Argument Undefined Exception: content undefined.");this.streams.push(new n.HttpContentStream(t))},t.prototype.setBody=function(t){if("string"==typeof t){var e=new o.SubscribableStream;e.write(t,"utf8"),this.addStream(new n.HttpContent({type:"application/json; charset=utf-8",contentLength:e.length},e))}else"object"==typeof t&&this.addStream(t)},t}();r.StreamingRequest=i},{"./httpContentStream":8,"./subscribableStream":27}],26:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.StreamingResponse=void 0;var n=t("./httpContentStream"),o=t("./subscribableStream"),i=function(){function t(){this.streams=[]}return t.create=function(e,r){var n=new t;return n.statusCode=e,r&&n.addStream(r),n},t.prototype.addStream=function(t){this.streams.push(new n.HttpContentStream(t))},t.prototype.setBody=function(t){var e=new o.SubscribableStream;e.write(JSON.stringify(t),"utf8"),this.addStream(new n.HttpContent({type:"application/json; charset=utf-8",contentLength:e.length},e))},t}();r.StreamingResponse=i},{"./httpContentStream":8,"./subscribableStream":27}],27:[function(t,e,r){(function(e){(function(){var n=this&&this.__extends||function(){var t=function(e,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&(t[r]=e[r])})(e,r)};return function(e,r){if("function"!=typeof r&&null!==r)throw new TypeError("Class extends value "+String(r)+" is not a constructor or null");function n(){this.constructor=e}t(e,r),e.prototype=null===r?Object.create(r):(n.prototype=r.prototype,new n)}}();Object.defineProperty(r,"__esModule",{value:!0}),r.SubscribableStream=void 0;var o=function(t){function r(e){var r=t.call(this,e)||this;return r.length=0,r.bufferList=[],r}return n(r,t),r.prototype._write=function(t,r,n){var o=e.from(t);this.bufferList.push(o),this.length+=t.length,this._onData&&this._onData(o),n()},r.prototype._read=function(t){if(0===this.bufferList.length)this.push(null);else for(var e=0;e<t&&this.bufferList.length>0;){var r=this.bufferList[0];this.push(r),this.bufferList.splice(0,1),e+=r.length}},r.prototype.subscribe=function(t){this._onData=t},r}(t("stream").Duplex);r.SubscribableStream=o}).call(this)}).call(this,t("buffer").Buffer)},{buffer:35,stream:41}],28:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.generateGuid=void 0;var n=t("uuid");function o(){return(0,n.v4)()}r.generateGuid=o},{uuid:58}],29:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.BrowserWebSocket=void 0;var i=function(){function t(t){t&&(this.webSocket=t)}return t.prototype.connect=function(t){return n(this,void 0,void 0,function(){var e,r;return o(this,function(n){return this.webSocket||(this.webSocket=new WebSocket(t)),this.webSocket.onerror=function(t){r(t)},this.webSocket.onopen=function(t){e(t)},[2,new Promise(function(t,n){e=t,r=n})]})})},Object.defineProperty(t.prototype,"isConnected",{get:function(){return 1===this.webSocket.readyState},enumerable:!1,configurable:!0}),t.prototype.write=function(t){this.webSocket.send(t)},t.prototype.close=function(){this.webSocket.close()},t.prototype.setOnMessageHandler=function(t){var e="buffer",r=[];this.webSocket.onmessage=function(n){var o=new FileReader,i={buffer:null};r.push(i),o.onload=function(n){var o=n.target;if(i[e]=o.result,r[0]===i)for(;0<r.length&&r[0][e];)t(r[0][e]),r.splice(0,1)},o.readAsArrayBuffer(n.data)}},t.prototype.setOnErrorHandler=function(t){this.webSocket.onerror=function(e){e&&t(e)}},t.prototype.setOnCloseHandler=function(t){this.webSocket.onclose=t},t}();r.BrowserWebSocket=i},{}],30:[function(t,e,r){var n=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},o=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.WebSocketClient=void 0;var i=t("./browserWebSocket"),s=t("../payloadTransport"),a=t("../protocolAdapter"),u=t("../payloads"),c=t("./webSocketTransport"),f=function(){function t(t){var e=t.url,r=t.requestHandler,n=t.disconnectionHandler,o=void 0===n?null:n;this._url=e,this._requestHandler=r,this._disconnectionHandler=o,this._requestManager=new u.RequestManager,this._sender=new s.PayloadSender,this._sender.disconnected=this.onConnectionDisconnected.bind(this),this._receiver=new s.PayloadReceiver,this._receiver.disconnected=this.onConnectionDisconnected.bind(this),this._protocolAdapter=new a.ProtocolAdapter(this._requestHandler,this._requestManager,this._sender,this._receiver)}return t.prototype.connect=function(){return n(this,void 0,void 0,function(){var t,e;return o(this,function(r){switch(r.label){case 0:return[4,(t=new i.BrowserWebSocket).connect(this._url)];case 1:return r.sent(),e=new c.WebSocketTransport(t),this._sender.connect(e),this._receiver.connect(e),[2]}})})},t.prototype.disconnect=function(){this._sender.disconnect(new s.TransportDisconnectedEvent("Disconnect was called.")),this._receiver.disconnect(new s.TransportDisconnectedEvent("Disconnect was called."))},t.prototype.send=function(t){return n(this,void 0,void 0,function(){return o(this,function(e){return[2,this._protocolAdapter.sendRequest(t)]})})},t.prototype.onConnectionDisconnected=function(t,e){if(this._requestManager.rejectAllResponses(new Error("Disconnect was called.")),null==this._disconnectionHandler)throw new Error("Unable to re-connect client to transport for url ".concat(this._url,". Sender: '").concat(JSON.stringify(t),"'. Args:' ").concat(JSON.stringify(e)));this._disconnectionHandler("Disconnected")},t}();r.WebSocketClient=f},{"../payloadTransport":10,"../payloads":16,"../protocolAdapter":23,"./browserWebSocket":29,"./webSocketTransport":32}],31:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.WebSocketTransport=r.WebSocketClient=r.BrowserWebSocket=void 0;var n=t("./browserWebSocket");Object.defineProperty(r,"BrowserWebSocket",{enumerable:!0,get:function(){return n.BrowserWebSocket}});var o=t("./browserWebSocketClient");Object.defineProperty(r,"WebSocketClient",{enumerable:!0,get:function(){return o.WebSocketClient}});var i=t("./webSocketTransport");Object.defineProperty(r,"WebSocketTransport",{enumerable:!0,get:function(){return i.WebSocketTransport}})},{"./browserWebSocket":29,"./browserWebSocketClient":30,"./webSocketTransport":32}],32:[function(t,e,r){(function(t){(function(){var e=this&&this.__awaiter||function(t,e,r,n){function o(t){return t instanceof r?t:new r(function(e){e(t)})}return new(r||(r=Promise))(function(r,i){function s(t){try{u(n.next(t))}catch(e){i(e)}}function a(t){try{u(n.throw(t))}catch(e){i(e)}}function u(t){t.done?r(t.value):o(t.value).then(s,a)}u((n=n.apply(t,e||[])).next())})},n=this&&this.__generator||function(t,e){var r,n,o,i,s={label:0,sent:function(){if(1&o[0])throw o[1];return o[1]},trys:[],ops:[]};return i={next:a(0),throw:a(1),return:a(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function a(t){return function(e){return u([t,e])}}function u(a){if(r)throw new TypeError("Generator is already executing.");for(;i&&(i=0,a[0]&&(s=0)),s;)try{if(r=1,n&&(o=2&a[0]?n.return:a[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,a[1])).done)return o;switch(n=0,o&&(a=[2&a[0],o.value]),a[0]){case 0:case 1:o=a;break;case 4:return s.label++,{value:a[1],done:!1};case 5:s.label++,n=a[1],a=[0];continue;case 7:a=s.ops.pop(),s.trys.pop();continue;default:if(!((o=(o=s.trys).length>0&&o[o.length-1])||6!==a[0]&&2!==a[0])){s=0;continue}if(3===a[0]&&(!o||a[1]>o[0]&&a[1]<o[3])){s.label=a[1];break}if(6===a[0]&&s.label<o[1]){s.label=o[1],o=a;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(a);break}o[2]&&s.ops.pop(),s.trys.pop();continue}a=e.call(t,s)}catch(u){a=[6,u],n=0}finally{r=o=0}if(5&a[0])throw a[1];return{value:a[0]?a[1]:void 0,done:!0}}};Object.defineProperty(r,"__esModule",{value:!0}),r.WebSocketTransport=void 0;var o=function(){function r(t){var e=this;this.ws=t,this._queue=[],this._activeOffset=0,this._activeReceiveCount=0,this.ws.setOnMessageHandler(function(t){e.onReceive(t)}),this.ws.setOnErrorHandler(function(t){e.onError(t)}),this.ws.setOnCloseHandler(function(){e.onClose()})}return r.prototype.send=function(t){var e;return(null===(e=this.ws)||void 0===e?void 0:e.isConnected)?(this.ws.write(t),t.length):0},Object.defineProperty(r.prototype,"isConnected",{get:function(){var t;return!!(null===(t=this.ws)||void 0===t?void 0:t.isConnected)},enumerable:!1,configurable:!0}),r.prototype.close=function(){var t;(null===(t=this.ws)||void 0===t?void 0:t.isConnected)&&this.ws.close()},r.prototype.receive=function(t){return e(this,void 0,void 0,function(){var e,r=this;return n(this,function(n){if(this._activeReceiveResolve)throw new Error("Cannot call receive more than once before it has returned.");return this._activeReceiveCount=t,e=new Promise(function(t,e){r._activeReceiveResolve=t,r._activeReceiveReject=e}),this.trySignalData(),[2,e]})})},r.prototype.onReceive=function(e){this._queue&&e&&e.byteLength>0&&(this._queue.push(t.from(e)),this.trySignalData())},r.prototype.onClose=function(){this._activeReceiveReject&&this._activeReceiveReject(new Error("Socket was closed.")),this._active=null,this._activeOffset=0,this._activeReceiveResolve=null,this._activeReceiveReject=null,this._activeReceiveCount=0,this.ws=null},r.prototype.onError=function(t){this._activeReceiveReject&&this._activeReceiveReject(t),this.onClose()},r.prototype.trySignalData=function(){if(this._activeReceiveResolve&&(!this._active&&this._queue.length>0&&(this._active=this._queue.shift(),this._activeOffset=0),this._active)){if(0===this._activeOffset&&this._active.length===this._activeReceiveCount){var e=this._active;this._active=null,this._activeReceiveResolve(e)}else{var r=Math.min(this._activeReceiveCount,this._active.length-this._activeOffset);e=t.alloc(r),this._active.copy(e,0,this._activeOffset,this._activeOffset+r),this._activeOffset+=r,this._activeOffset>=this._active.length&&(this._active=null,this._activeOffset=0),this._activeReceiveResolve(e)}this._activeReceiveCount=0,this._activeReceiveReject=null,this._activeReceiveResolve=null}},r}();r.WebSocketTransport=o}).call(this)}).call(this,t("buffer").Buffer)},{buffer:35}],33:[function(t,e,r){},{}],34:[function(t,e,r){r.byteLength=f,r.toByteArray=h,r.fromByteArray=y;for(var n=[],o=[],i="undefined"!=typeof Uint8Array?Uint8Array:Array,s="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",a=0,u=s.length;a<u;++a)n[a]=s[a],o[s.charCodeAt(a)]=a;function c(t){var e=t.length;if(e%4>0)throw new Error("Invalid string. Length must be a multiple of 4");var r=t.indexOf("=");return-1===r&&(r=e),[r,r===e?0:4-r%4]}function f(t){var e=c(t),r=e[0],n=e[1];return 3*(r+n)/4-n}function l(t,e,r){return 3*(e+r)/4-r}function h(t){var e,r,n=c(t),s=n[0],a=n[1],u=new i(l(t,s,a)),f=0,h=a>0?s-4:s;for(r=0;r<h;r+=4)e=o[t.charCodeAt(r)]<<18|o[t.charCodeAt(r+1)]<<12|o[t.charCodeAt(r+2)]<<6|o[t.charCodeAt(r+3)],u[f++]=e>>16&255,u[f++]=e>>8&255,u[f++]=255&e;return 2===a&&(e=o[t.charCodeAt(r)]<<2|o[t.charCodeAt(r+1)]>>4,u[f++]=255&e),1===a&&(e=o[t.charCodeAt(r)]<<10|o[t.charCodeAt(r+1)]<<4|o[t.charCodeAt(r+2)]>>2,u[f++]=e>>8&255,u[f++]=255&e),u}function p(t){return n[t>>18&63]+n[t>>12&63]+n[t>>6&63]+n[63&t]}function d(t,e,r){for(var n,o=[],i=e;i<r;i+=3)n=(t[i]<<16&16711680)+(t[i+1]<<8&65280)+(255&t[i+2]),o.push(p(n));return o.join("")}function y(t){for(var e,r=t.length,o=r%3,i=[],s=16383,a=0,u=r-o;a<u;a+=s)i.push(d(t,a,a+s>u?u:a+s));return 1===o?(e=t[r-1],i.push(n[e>>2]+n[e<<4&63]+"==")):2===o&&(e=(t[r-2]<<8)+t[r-1],i.push(n[e>>10]+n[e>>4&63]+n[e<<2&63]+"=")),i.join("")}o["-".charCodeAt(0)]=62,o["_".charCodeAt(0)]=63},{}],35:[function(t,e,r){(function(e){(function(){var e=t("base64-js"),n=t("ieee754");r.Buffer=a,r.SlowBuffer=v,r.INSPECT_MAX_BYTES=50;var o=2147483647;function i(){try{var t=new Uint8Array(1);return t.__proto__={__proto__:Uint8Array.prototype,foo:function(){return 42}},42===t.foo()}catch(e){return!1}}function s(t){if(t>o)throw new RangeError('The value "'+t+'" is invalid for option "size"');var e=new Uint8Array(t);return e.__proto__=a.prototype,e}function a(t,e,r){if("number"==typeof t){if("string"==typeof e)throw new TypeError('The "string" argument must be of type string. Received type number');return l(t)}return u(t,e,r)}function u(t,e,r){if("string"==typeof t)return h(t,e);if(ArrayBuffer.isView(t))return p(t);if(null==t)throw TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t);if(X(t,ArrayBuffer)||t&&X(t.buffer,ArrayBuffer))return d(t,e,r);if("number"==typeof t)throw new TypeError('The "value" argument must not be of type number. Received type number');var n=t.valueOf&&t.valueOf();if(null!=n&&n!==t)return a.from(n,e,r);var o=y(t);if(o)return o;if("undefined"!=typeof Symbol&&null!=Symbol.toPrimitive&&"function"==typeof t[Symbol.toPrimitive])return a.from(t[Symbol.toPrimitive]("string"),e,r);throw new TypeError("The first argument must be one of type string, Buffer, ArrayBuffer, Array, or Array-like Object. Received type "+typeof t)}function c(t){if("number"!=typeof t)throw new TypeError('"size" argument must be of type number');if(t<0)throw new RangeError('The value "'+t+'" is invalid for option "size"')}function f(t,e,r){return c(t),t<=0?s(t):void 0!==e?"string"==typeof r?s(t).fill(e,r):s(t).fill(e):s(t)}function l(t){return c(t),s(t<0?0:0|b(t))}function h(t,e){if("string"==typeof e&&""!==e||(e="utf8"),!a.isEncoding(e))throw new TypeError("Unknown encoding: "+e);var r=0|m(t,e),n=s(r),o=n.write(t,e);return o!==r&&(n=n.slice(0,o)),n}function p(t){for(var e=t.length<0?0:0|b(t.length),r=s(e),n=0;n<e;n+=1)r[n]=255&t[n];return r}function d(t,e,r){if(e<0||t.byteLength<e)throw new RangeError('"offset" is outside of buffer bounds');if(t.byteLength<e+(r||0))throw new RangeError('"length" is outside of buffer bounds');var n;return(n=void 0===e&&void 0===r?new Uint8Array(t):void 0===r?new Uint8Array(t,e):new Uint8Array(t,e,r)).__proto__=a.prototype,n}function y(t){if(a.isBuffer(t)){var e=0|b(t.length),r=s(e);return 0===r.length||t.copy(r,0,0,e),r}return void 0!==t.length?"number"!=typeof t.length||K(t.length)?s(0):p(t):"Buffer"===t.type&&Array.isArray(t.data)?p(t.data):void 0}function b(t){if(t>=o)throw new RangeError("Attempt to allocate Buffer larger than maximum size: 0x"+o.toString(16)+" bytes");return 0|t}function v(t){return+t!=t&&(t=0),a.alloc(+t)}function m(t,e){if(a.isBuffer(t))return t.length;if(ArrayBuffer.isView(t)||X(t,ArrayBuffer))return t.byteLength;if("string"!=typeof t)throw new TypeError('The "string" argument must be one of type string, Buffer, or ArrayBuffer. Received type '+typeof t);var r=t.length,n=arguments.length>2&&!0===arguments[2];if(!n&&0===r)return 0;for(var o=!1;;)switch(e){case"ascii":case"latin1":case"binary":return r;case"utf8":case"utf-8":return G(t).length;case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return 2*r;case"hex":return r>>>1;case"base64":return J(t).length;default:if(o)return n?-1:G(t).length;e=(""+e).toLowerCase(),o=!0}}function g(t,e,r){var n=!1;if((void 0===e||e<0)&&(e=0),e>this.length)return"";if((void 0===r||r>this.length)&&(r=this.length),r<=0)return"";if((r>>>=0)<=(e>>>=0))return"";for(t||(t="utf8");;)switch(t){case"hex":return I(this,e,r);case"utf8":case"utf-8":return A(this,e,r);case"ascii":return M(this,e,r);case"latin1":case"binary":return L(this,e,r);case"base64":return P(this,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return B(this,e,r);default:if(n)throw new TypeError("Unknown encoding: "+t);t=(t+"").toLowerCase(),n=!0}}function w(t,e,r){var n=t[e];t[e]=t[r],t[r]=n}function _(t,e,r,n,o){if(0===t.length)return-1;if("string"==typeof r?(n=r,r=0):r>2147483647?r=2147483647:r<-2147483648&&(r=-2147483648),K(r=+r)&&(r=o?0:t.length-1),r<0&&(r=t.length+r),r>=t.length){if(o)return-1;r=t.length-1}else if(r<0){if(!o)return-1;r=0}if("string"==typeof e&&(e=a.from(e,n)),a.isBuffer(e))return 0===e.length?-1:S(t,e,r,n,o);if("number"==typeof e)return e&=255,"function"==typeof Uint8Array.prototype.indexOf?o?Uint8Array.prototype.indexOf.call(t,e,r):Uint8Array.prototype.lastIndexOf.call(t,e,r):S(t,[e],r,n,o);throw new TypeError("val must be string, number or Buffer")}function S(t,e,r,n,o){var i,s=1,a=t.length,u=e.length;if(void 0!==n&&("ucs2"===(n=String(n).toLowerCase())||"ucs-2"===n||"utf16le"===n||"utf-16le"===n)){if(t.length<2||e.length<2)return-1;s=2,a/=2,u/=2,r/=2}function c(t,e){return 1===s?t[e]:t.readUInt16BE(e*s)}if(o){var f=-1;for(i=r;i<a;i++)if(c(t,i)===c(e,-1===f?0:i-f)){if(-1===f&&(f=i),i-f+1===u)return f*s}else-1!==f&&(i-=i-f),f=-1}else for(r+u>a&&(r=a-u),i=r;i>=0;i--){for(var l=!0,h=0;h<u;h++)if(c(t,i+h)!==c(e,h)){l=!1;break}if(l)return i}return-1}function x(t,e,r,n){r=Number(r)||0;var o=t.length-r;n?(n=Number(n))>o&&(n=o):n=o;var i=e.length;n>i/2&&(n=i/2);for(var s=0;s<n;++s){var a=parseInt(e.substr(2*s,2),16);if(K(a))return s;t[r+s]=a}return s}function O(t,e,r,n){return Y(G(e,t.length-r),t,r,n)}function E(t,e,r,n){return Y(z(e),t,r,n)}function T(t,e,r,n){return E(t,e,r,n)}function k(t,e,r,n){return Y(J(e),t,r,n)}function j(t,e,r,n){return Y(V(e,t.length-r),t,r,n)}function P(t,r,n){return 0===r&&n===t.length?e.fromByteArray(t):e.fromByteArray(t.slice(r,n))}function A(t,e,r){r=Math.min(t.length,r);for(var n=[],o=e;o<r;){var i,s,a,u,c=t[o],f=null,l=c>239?4:c>223?3:c>191?2:1;if(o+l<=r)switch(l){case 1:c<128&&(f=c);break;case 2:128==(192&(i=t[o+1]))&&(u=(31&c)<<6|63&i)>127&&(f=u);break;case 3:i=t[o+1],s=t[o+2],128==(192&i)&&128==(192&s)&&(u=(15&c)<<12|(63&i)<<6|63&s)>2047&&(u<55296||u>57343)&&(f=u);break;case 4:i=t[o+1],s=t[o+2],a=t[o+3],128==(192&i)&&128==(192&s)&&128==(192&a)&&(u=(15&c)<<18|(63&i)<<12|(63&s)<<6|63&a)>65535&&u<1114112&&(f=u)}null===f?(f=65533,l=1):f>65535&&(f-=65536,n.push(f>>>10&1023|55296),f=56320|1023&f),n.push(f),o+=l}return C(n)}r.kMaxLength=o,a.TYPED_ARRAY_SUPPORT=i(),a.TYPED_ARRAY_SUPPORT||"undefined"==typeof console||"function"!=typeof console.error||console.error("This browser lacks typed array (Uint8Array) support which is required by `buffer` v5.x. Use `buffer` v4.x if you require old browser support."),Object.defineProperty(a.prototype,"parent",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.buffer}}),Object.defineProperty(a.prototype,"offset",{enumerable:!0,get:function(){if(a.isBuffer(this))return this.byteOffset}}),"undefined"!=typeof Symbol&&null!=Symbol.species&&a[Symbol.species]===a&&Object.defineProperty(a,Symbol.species,{value:null,configurable:!0,enumerable:!1,writable:!1}),a.poolSize=8192,a.from=function(t,e,r){return u(t,e,r)},a.prototype.__proto__=Uint8Array.prototype,a.__proto__=Uint8Array,a.alloc=function(t,e,r){return f(t,e,r)},a.allocUnsafe=function(t){return l(t)},a.allocUnsafeSlow=function(t){return l(t)},a.isBuffer=function(t){return null!=t&&!0===t._isBuffer&&t!==a.prototype},a.compare=function(t,e){if(X(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),X(e,Uint8Array)&&(e=a.from(e,e.offset,e.byteLength)),!a.isBuffer(t)||!a.isBuffer(e))throw new TypeError('The "buf1", "buf2" arguments must be one of type Buffer or Uint8Array');if(t===e)return 0;for(var r=t.length,n=e.length,o=0,i=Math.min(r,n);o<i;++o)if(t[o]!==e[o]){r=t[o],n=e[o];break}return r<n?-1:n<r?1:0},a.isEncoding=function(t){switch(String(t).toLowerCase()){case"hex":case"utf8":case"utf-8":case"ascii":case"latin1":case"binary":case"base64":case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return!0;default:return!1}},a.concat=function(t,e){if(!Array.isArray(t))throw new TypeError('"list" argument must be an Array of Buffers');if(0===t.length)return a.alloc(0);var r;if(void 0===e)for(e=0,r=0;r<t.length;++r)e+=t[r].length;var n=a.allocUnsafe(e),o=0;for(r=0;r<t.length;++r){var i=t[r];if(X(i,Uint8Array)&&(i=a.from(i)),!a.isBuffer(i))throw new TypeError('"list" argument must be an Array of Buffers');i.copy(n,o),o+=i.length}return n},a.byteLength=m,a.prototype._isBuffer=!0,a.prototype.swap16=function(){var t=this.length;if(t%2!=0)throw new RangeError("Buffer size must be a multiple of 16-bits");for(var e=0;e<t;e+=2)w(this,e,e+1);return this},a.prototype.swap32=function(){var t=this.length;if(t%4!=0)throw new RangeError("Buffer size must be a multiple of 32-bits");for(var e=0;e<t;e+=4)w(this,e,e+3),w(this,e+1,e+2);return this},a.prototype.swap64=function(){var t=this.length;if(t%8!=0)throw new RangeError("Buffer size must be a multiple of 64-bits");for(var e=0;e<t;e+=8)w(this,e,e+7),w(this,e+1,e+6),w(this,e+2,e+5),w(this,e+3,e+4);return this},a.prototype.toString=function(){var t=this.length;return 0===t?"":0===arguments.length?A(this,0,t):g.apply(this,arguments)},a.prototype.toLocaleString=a.prototype.toString,a.prototype.equals=function(t){if(!a.isBuffer(t))throw new TypeError("Argument must be a Buffer");return this===t||0===a.compare(this,t)},a.prototype.inspect=function(){var t="",e=r.INSPECT_MAX_BYTES;return t=this.toString("hex",0,e).replace(/(.{2})/g,"$1 ").trim(),this.length>e&&(t+=" ... "),"<Buffer "+t+">"},a.prototype.compare=function(t,e,r,n,o){if(X(t,Uint8Array)&&(t=a.from(t,t.offset,t.byteLength)),!a.isBuffer(t))throw new TypeError('The "target" argument must be one of type Buffer or Uint8Array. Received type '+typeof t);if(void 0===e&&(e=0),void 0===r&&(r=t?t.length:0),void 0===n&&(n=0),void 0===o&&(o=this.length),e<0||r>t.length||n<0||o>this.length)throw new RangeError("out of range index");if(n>=o&&e>=r)return 0;if(n>=o)return-1;if(e>=r)return 1;if(this===t)return 0;for(var i=(o>>>=0)-(n>>>=0),s=(r>>>=0)-(e>>>=0),u=Math.min(i,s),c=this.slice(n,o),f=t.slice(e,r),l=0;l<u;++l)if(c[l]!==f[l]){i=c[l],s=f[l];break}return i<s?-1:s<i?1:0},a.prototype.includes=function(t,e,r){return-1!==this.indexOf(t,e,r)},a.prototype.indexOf=function(t,e,r){return _(this,t,e,r,!0)},a.prototype.lastIndexOf=function(t,e,r){return _(this,t,e,r,!1)},a.prototype.write=function(t,e,r,n){if(void 0===e)n="utf8",r=this.length,e=0;else if(void 0===r&&"string"==typeof e)n=e,r=this.length,e=0;else{if(!isFinite(e))throw new Error("Buffer.write(string, encoding, offset[, length]) is no longer supported");e>>>=0,isFinite(r)?(r>>>=0,void 0===n&&(n="utf8")):(n=r,r=void 0)}var o=this.length-e;if((void 0===r||r>o)&&(r=o),t.length>0&&(r<0||e<0)||e>this.length)throw new RangeError("Attempt to write outside buffer bounds");n||(n="utf8");for(var i=!1;;)switch(n){case"hex":return x(this,t,e,r);case"utf8":case"utf-8":return O(this,t,e,r);case"ascii":return E(this,t,e,r);case"latin1":case"binary":return T(this,t,e,r);case"base64":return k(this,t,e,r);case"ucs2":case"ucs-2":case"utf16le":case"utf-16le":return j(this,t,e,r);default:if(i)throw new TypeError("Unknown encoding: "+n);n=(""+n).toLowerCase(),i=!0}},a.prototype.toJSON=function(){return{type:"Buffer",data:Array.prototype.slice.call(this._arr||this,0)}};var R=4096;function C(t){var e=t.length;if(e<=R)return String.fromCharCode.apply(String,t);for(var r="",n=0;n<e;)r+=String.fromCharCode.apply(String,t.slice(n,n+=R));return r}function M(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(127&t[o]);return n}function L(t,e,r){var n="";r=Math.min(t.length,r);for(var o=e;o<r;++o)n+=String.fromCharCode(t[o]);return n}function I(t,e,r){var n=t.length;(!e||e<0)&&(e=0),(!r||r<0||r>n)&&(r=n);for(var o="",i=e;i<r;++i)o+=$(t[i]);return o}function B(t,e,r){for(var n=t.slice(e,r),o="",i=0;i<n.length;i+=2)o+=String.fromCharCode(n[i]+256*n[i+1]);return o}function D(t,e,r){if(t%1!=0||t<0)throw new RangeError("offset is not uint");if(t+e>r)throw new RangeError("Trying to access beyond buffer length")}function U(t,e,r,n,o,i){if(!a.isBuffer(t))throw new TypeError('"buffer" argument must be a Buffer instance');if(e>o||e<i)throw new RangeError('"value" argument is out of bounds');if(r+n>t.length)throw new RangeError("Index out of range")}function N(t,e,r,n,o,i){if(r+n>t.length)throw new RangeError("Index out of range");if(r<0)throw new RangeError("Index out of range")}function q(t,e,r,o,i){return e=+e,r>>>=0,i||N(t,e,r,4),n.write(t,e,r,o,23,4),r+4}function H(t,e,r,o,i){return e=+e,r>>>=0,i||N(t,e,r,8),n.write(t,e,r,o,52,8),r+8}a.prototype.slice=function(t,e){var r=this.length;(t=~~t)<0?(t+=r)<0&&(t=0):t>r&&(t=r),(e=void 0===e?r:~~e)<0?(e+=r)<0&&(e=0):e>r&&(e=r),e<t&&(e=t);var n=this.subarray(t,e);return n.__proto__=a.prototype,n},a.prototype.readUIntLE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n},a.prototype.readUIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t+--e],o=1;e>0&&(o*=256);)n+=this[t+--e]*o;return n},a.prototype.readUInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),this[t]},a.prototype.readUInt16LE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]|this[t+1]<<8},a.prototype.readUInt16BE=function(t,e){return t>>>=0,e||D(t,2,this.length),this[t]<<8|this[t+1]},a.prototype.readUInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),(this[t]|this[t+1]<<8|this[t+2]<<16)+16777216*this[t+3]},a.prototype.readUInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),16777216*this[t]+(this[t+1]<<16|this[t+2]<<8|this[t+3])},a.prototype.readIntLE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=this[t],o=1,i=0;++i<e&&(o*=256);)n+=this[t+i]*o;return n>=(o*=128)&&(n-=Math.pow(2,8*e)),n},a.prototype.readIntBE=function(t,e,r){t>>>=0,e>>>=0,r||D(t,e,this.length);for(var n=e,o=1,i=this[t+--n];n>0&&(o*=256);)i+=this[t+--n]*o;return i>=(o*=128)&&(i-=Math.pow(2,8*e)),i},a.prototype.readInt8=function(t,e){return t>>>=0,e||D(t,1,this.length),128&this[t]?-1*(255-this[t]+1):this[t]},a.prototype.readInt16LE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t]|this[t+1]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt16BE=function(t,e){t>>>=0,e||D(t,2,this.length);var r=this[t+1]|this[t]<<8;return 32768&r?4294901760|r:r},a.prototype.readInt32LE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]|this[t+1]<<8|this[t+2]<<16|this[t+3]<<24},a.prototype.readInt32BE=function(t,e){return t>>>=0,e||D(t,4,this.length),this[t]<<24|this[t+1]<<16|this[t+2]<<8|this[t+3]},a.prototype.readFloatLE=function(t,e){return t>>>=0,e||D(t,4,this.length),n.read(this,t,!0,23,4)},a.prototype.readFloatBE=function(t,e){return t>>>=0,e||D(t,4,this.length),n.read(this,t,!1,23,4)},a.prototype.readDoubleLE=function(t,e){return t>>>=0,e||D(t,8,this.length),n.read(this,t,!0,52,8)},a.prototype.readDoubleBE=function(t,e){return t>>>=0,e||D(t,8,this.length),n.read(this,t,!1,52,8)},a.prototype.writeUIntLE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=1,i=0;for(this[e]=255&t;++i<r&&(o*=256);)this[e+i]=t/o&255;return e+r},a.prototype.writeUIntBE=function(t,e,r,n){t=+t,e>>>=0,r>>>=0,n||U(this,t,e,r,Math.pow(2,8*r)-1,0);var o=r-1,i=1;for(this[e+o]=255&t;--o>=0&&(i*=256);)this[e+o]=t/i&255;return e+r},a.prototype.writeUInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,255,0),this[e]=255&t,e+1},a.prototype.writeUInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeUInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,65535,0),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeUInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,4294967295,0),this[e+3]=t>>>24,this[e+2]=t>>>16,this[e+1]=t>>>8,this[e]=255&t,e+4},a.prototype.writeUInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,4294967295,0),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeIntLE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=0,s=1,a=0;for(this[e]=255&t;++i<r&&(s*=256);)t<0&&0===a&&0!==this[e+i-1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},a.prototype.writeIntBE=function(t,e,r,n){if(t=+t,e>>>=0,!n){var o=Math.pow(2,8*r-1);U(this,t,e,r,o-1,-o)}var i=r-1,s=1,a=0;for(this[e+i]=255&t;--i>=0&&(s*=256);)t<0&&0===a&&0!==this[e+i+1]&&(a=1),this[e+i]=(t/s|0)-a&255;return e+r},a.prototype.writeInt8=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,1,127,-128),t<0&&(t=255+t+1),this[e]=255&t,e+1},a.prototype.writeInt16LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=255&t,this[e+1]=t>>>8,e+2},a.prototype.writeInt16BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,2,32767,-32768),this[e]=t>>>8,this[e+1]=255&t,e+2},a.prototype.writeInt32LE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,2147483647,-2147483648),this[e]=255&t,this[e+1]=t>>>8,this[e+2]=t>>>16,this[e+3]=t>>>24,e+4},a.prototype.writeInt32BE=function(t,e,r){return t=+t,e>>>=0,r||U(this,t,e,4,2147483647,-2147483648),t<0&&(t=4294967295+t+1),this[e]=t>>>24,this[e+1]=t>>>16,this[e+2]=t>>>8,this[e+3]=255&t,e+4},a.prototype.writeFloatLE=function(t,e,r){return q(this,t,e,!0,r)},a.prototype.writeFloatBE=function(t,e,r){return q(this,t,e,!1,r)},a.prototype.writeDoubleLE=function(t,e,r){return H(this,t,e,!0,r)},a.prototype.writeDoubleBE=function(t,e,r){return H(this,t,e,!1,r)},a.prototype.copy=function(t,e,r,n){if(!a.isBuffer(t))throw new TypeError("argument should be a Buffer");if(r||(r=0),n||0===n||(n=this.length),e>=t.length&&(e=t.length),e||(e=0),n>0&&n<r&&(n=r),n===r)return 0;if(0===t.length||0===this.length)return 0;if(e<0)throw new RangeError("targetStart out of bounds");if(r<0||r>=this.length)throw new RangeError("Index out of range");if(n<0)throw new RangeError("sourceEnd out of bounds");n>this.length&&(n=this.length),t.length-e<n-r&&(n=t.length-e+r);var o=n-r;if(this===t&&"function"==typeof Uint8Array.prototype.copyWithin)this.copyWithin(e,r,n);else if(this===t&&r<e&&e<n)for(var i=o-1;i>=0;--i)t[i+e]=this[i+r];else Uint8Array.prototype.set.call(t,this.subarray(r,n),e);return o},a.prototype.fill=function(t,e,r,n){if("string"==typeof t){if("string"==typeof e?(n=e,e=0,r=this.length):"string"==typeof r&&(n=r,r=this.length),void 0!==n&&"string"!=typeof n)throw new TypeError("encoding must be a string");if("string"==typeof n&&!a.isEncoding(n))throw new TypeError("Unknown encoding: "+n);if(1===t.length){var o=t.charCodeAt(0);("utf8"===n&&o<128||"latin1"===n)&&(t=o)}}else"number"==typeof t&&(t&=255);if(e<0||this.length<e||this.length<r)throw new RangeError("Out of range index");if(r<=e)return this;var i;if(e>>>=0,r=void 0===r?this.length:r>>>0,t||(t=0),"number"==typeof t)for(i=e;i<r;++i)this[i]=t;else{var s=a.isBuffer(t)?t:a.from(t,n),u=s.length;if(0===u)throw new TypeError('The value "'+t+'" is invalid for argument "value"');for(i=0;i<r-e;++i)this[i+e]=s[i%u]}return this};var F=/[^+/0-9A-Za-z-_]/g;function W(t){if((t=(t=t.split("=")[0]).trim().replace(F,"")).length<2)return"";for(;t.length%4!=0;)t+="=";return t}function $(t){return t<16?"0"+t.toString(16):t.toString(16)}function G(t,e){var r;e=e||1/0;for(var n=t.length,o=null,i=[],s=0;s<n;++s){if((r=t.charCodeAt(s))>55295&&r<57344){if(!o){if(r>56319){(e-=3)>-1&&i.push(239,191,189);continue}if(s+1===n){(e-=3)>-1&&i.push(239,191,189);continue}o=r;continue}if(r<56320){(e-=3)>-1&&i.push(239,191,189),o=r;continue}r=65536+(o-55296<<10|r-56320)}else o&&(e-=3)>-1&&i.push(239,191,189);if(o=null,r<128){if((e-=1)<0)break;i.push(r)}else if(r<2048){if((e-=2)<0)break;i.push(r>>6|192,63&r|128)}else if(r<65536){if((e-=3)<0)break;i.push(r>>12|224,r>>6&63|128,63&r|128)}else{if(!(r<1114112))throw new Error("Invalid code point");if((e-=4)<0)break;i.push(r>>18|240,r>>12&63|128,r>>6&63|128,63&r|128)}}return i}function z(t){for(var e=[],r=0;r<t.length;++r)e.push(255&t.charCodeAt(r));return e}function V(t,e){for(var r,n,o,i=[],s=0;s<t.length&&!((e-=2)<0);++s)n=(r=t.charCodeAt(s))>>8,o=r%256,i.push(o),i.push(n);return i}function J(t){return e.toByteArray(W(t))}function Y(t,e,r,n){for(var o=0;o<n&&!(o+r>=e.length||o>=t.length);++o)e[o+r]=t[o];return o}function X(t,e){return t instanceof e||null!=t&&null!=t.constructor&&null!=t.constructor.name&&t.constructor.name===e.name}function K(t){return t!=t}}).call(this)}).call(this,t("buffer").Buffer)},{"base64-js":34,buffer:35,ieee754:37}],36:[function(t,e,r){var n,o="object"==typeof Reflect?Reflect:null,i=o&&"function"==typeof o.apply?o.apply:function(t,e,r){return Function.prototype.apply.call(t,e,r)};function s(t){console&&console.warn&&console.warn(t)}n=o&&"function"==typeof o.ownKeys?o.ownKeys:Object.getOwnPropertySymbols?function(t){return Object.getOwnPropertyNames(t).concat(Object.getOwnPropertySymbols(t))}:function(t){return Object.getOwnPropertyNames(t)};var a=Number.isNaN||function(t){return t!=t};function u(){u.init.call(this)}e.exports=u,e.exports.once=w,u.EventEmitter=u,u.prototype._events=void 0,u.prototype._eventsCount=0,u.prototype._maxListeners=void 0;var c=10;function f(t){if("function"!=typeof t)throw new TypeError('The "listener" argument must be of type Function. Received type '+typeof t)}function l(t){return void 0===t._maxListeners?u.defaultMaxListeners:t._maxListeners}function h(t,e,r,n){var o,i,a;if(f(r),void 0===(i=t._events)?(i=t._events=Object.create(null),t._eventsCount=0):(void 0!==i.newListener&&(t.emit("newListener",e,r.listener?r.listener:r),i=t._events),a=i[e]),void 0===a)a=i[e]=r,++t._eventsCount;else if("function"==typeof a?a=i[e]=n?[r,a]:[a,r]:n?a.unshift(r):a.push(r),(o=l(t))>0&&a.length>o&&!a.warned){a.warned=!0;var u=new Error("Possible EventEmitter memory leak detected. "+a.length+" "+String(e)+" listeners added. Use emitter.setMaxListeners() to increase limit");u.name="MaxListenersExceededWarning",u.emitter=t,u.type=e,u.count=a.length,s(u)}return t}function p(){if(!this.fired)return this.target.removeListener(this.type,this.wrapFn),this.fired=!0,0===arguments.length?this.listener.call(this.target):this.listener.apply(this.target,arguments)}function d(t,e,r){var n={fired:!1,wrapFn:void 0,target:t,type:e,listener:r},o=p.bind(n);return o.listener=r,n.wrapFn=o,o}function y(t,e,r){var n=t._events;if(void 0===n)return[];var o=n[e];return void 0===o?[]:"function"==typeof o?r?[o.listener||o]:[o]:r?g(o):v(o,o.length)}function b(t){var e=this._events;if(void 0!==e){var r=e[t];if("function"==typeof r)return 1;if(void 0!==r)return r.length}return 0}function v(t,e){for(var r=new Array(e),n=0;n<e;++n)r[n]=t[n];return r}function m(t,e){for(;e+1<t.length;e++)t[e]=t[e+1];t.pop()}function g(t){for(var e=new Array(t.length),r=0;r<e.length;++r)e[r]=t[r].listener||t[r];return e}function w(t,e){return new Promise(function(r,n){function o(){void 0!==i&&t.removeListener("error",i),r([].slice.call(arguments))}var i;"error"!==e&&(i=function(r){t.removeListener(e,o),n(r)},t.once("error",i)),t.once(e,o)})}Object.defineProperty(u,"defaultMaxListeners",{enumerable:!0,get:function(){return c},set:function(t){if("number"!=typeof t||t<0||a(t))throw new RangeError('The value of "defaultMaxListeners" is out of range. It must be a non-negative number. Received '+t+".");c=t}}),u.init=function(){void 0!==this._events&&this._events!==Object.getPrototypeOf(this)._events||(this._events=Object.create(null),this._eventsCount=0),this._maxListeners=this._maxListeners||void 0},u.prototype.setMaxListeners=function(t){if("number"!=typeof t||t<0||a(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},u.prototype.getMaxListeners=function(){return l(this)},u.prototype.emit=function(t){for(var e=[],r=1;r<arguments.length;r++)e.push(arguments[r]);var n="error"===t,o=this._events;if(void 0!==o)n=n&&void 0===o.error;else if(!n)return!1;if(n){var s;if(e.length>0&&(s=e[0]),s instanceof Error)throw s;var a=new Error("Unhandled error."+(s?" ("+s.message+")":""));throw a.context=s,a}var u=o[t];if(void 0===u)return!1;if("function"==typeof u)i(u,this,e);else{var c=u.length,f=v(u,c);for(r=0;r<c;++r)i(f[r],this,e)}return!0},u.prototype.addListener=function(t,e){return h(this,t,e,!1)},u.prototype.on=u.prototype.addListener,u.prototype.prependListener=function(t,e){return h(this,t,e,!0)},u.prototype.once=function(t,e){return f(e),this.on(t,d(this,t,e)),this},u.prototype.prependOnceListener=function(t,e){return f(e),this.prependListener(t,d(this,t,e)),this},u.prototype.removeListener=function(t,e){var r,n,o,i,s;if(f(e),void 0===(n=this._events))return this;if(void 0===(r=n[t]))return this;if(r===e||r.listener===e)0===--this._eventsCount?this._events=Object.create(null):(delete n[t],n.removeListener&&this.emit("removeListener",t,r.listener||e));else if("function"!=typeof r){for(o=-1,i=r.length-1;i>=0;i--)if(r[i]===e||r[i].listener===e){s=r[i].listener,o=i;break}if(o<0)return this;0===o?r.shift():m(r,o),1===r.length&&(n[t]=r[0]),void 0!==n.removeListener&&this.emit("removeListener",t,s||e)}return this},u.prototype.off=u.prototype.removeListener,u.prototype.removeAllListeners=function(t){var e,r,n;if(void 0===(r=this._events))return this;if(void 0===r.removeListener)return 0===arguments.length?(this._events=Object.create(null),this._eventsCount=0):void 0!==r[t]&&(0===--this._eventsCount?this._events=Object.create(null):delete r[t]),this;if(0===arguments.length){var o,i=Object.keys(r);for(n=0;n<i.length;++n)"removeListener"!==(o=i[n])&&this.removeAllListeners(o);return this.removeAllListeners("removeListener"),this._events=Object.create(null),this._eventsCount=0,this}if("function"==typeof(e=r[t]))this.removeListener(t,e);else if(void 0!==e)for(n=e.length-1;n>=0;n--)this.removeListener(t,e[n]);return this},u.prototype.listeners=function(t){return y(this,t,!0)},u.prototype.rawListeners=function(t){return y(this,t,!1)},u.listenerCount=function(t,e){return"function"==typeof t.listenerCount?t.listenerCount(e):b.call(t,e)},u.prototype.listenerCount=b,u.prototype.eventNames=function(){return this._eventsCount>0?n(this._events):[]}},{}],37:[function(t,e,r){r.read=function(t,e,r,n,o){var i,s,a=8*o-n-1,u=(1<<a)-1,c=u>>1,f=-7,l=r?o-1:0,h=r?-1:1,p=t[e+l];for(l+=h,i=p&(1<<-f)-1,p>>=-f,f+=a;f>0;i=256*i+t[e+l],l+=h,f-=8);for(s=i&(1<<-f)-1,i>>=-f,f+=n;f>0;s=256*s+t[e+l],l+=h,f-=8);if(0===i)i=1-c;else{if(i===u)return s?NaN:1/0*(p?-1:1);s+=Math.pow(2,n),i-=c}return(p?-1:1)*s*Math.pow(2,i-n)},r.write=function(t,e,r,n,o,i){var s,a,u,c=8*i-o-1,f=(1<<c)-1,l=f>>1,h=23===o?Math.pow(2,-24)-Math.pow(2,-77):0,p=n?0:i-1,d=n?1:-1,y=e<0||0===e&&1/e<0?1:0;for(e=Math.abs(e),isNaN(e)||e===1/0?(a=isNaN(e)?1:0,s=f):(s=Math.floor(Math.log(e)/Math.LN2),e*(u=Math.pow(2,-s))<1&&(s--,u*=2),(e+=s+l>=1?h/u:h*Math.pow(2,1-l))*u>=2&&(s++,u/=2),s+l>=f?(a=0,s=f):s+l>=1?(a=(e*u-1)*Math.pow(2,o),s+=l):(a=e*Math.pow(2,l-1)*Math.pow(2,o),s=0));o>=8;t[r+p]=255&a,p+=d,a/=256,o-=8);for(s=s<<o|a,c+=o;c>0;t[r+p]=255&s,p+=d,s/=256,c-=8);t[r+p-d]|=128*y}},{}],38:[function(t,e,r){"function"==typeof Object.create?e.exports=function(t,e){e&&(t.super_=e,t.prototype=Object.create(e.prototype,{constructor:{value:t,enumerable:!1,writable:!0,configurable:!0}}))}:e.exports=function(t,e){if(e){t.super_=e;var r=function(){};r.prototype=e.prototype,t.prototype=new r,t.prototype.constructor=t}}},{}],39:[function(t,e,r){var n,o,i=e.exports={};function s(){throw new Error("setTimeout has not been defined")}function a(){throw new Error("clearTimeout has not been defined")}function u(t){if(n===setTimeout)return setTimeout(t,0);if((n===s||!n)&&setTimeout)return n=setTimeout,setTimeout(t,0);try{return n(t,0)}catch(e){try{return n.call(null,t,0)}catch(r){return n.call(this,t,0)}}}function c(t){if(o===clearTimeout)return clearTimeout(t);if((o===a||!o)&&clearTimeout)return o=clearTimeout,clearTimeout(t);try{return o(t)}catch(e){try{return o.call(null,t)}catch(r){return o.call(this,t)}}}!function(){try{n="function"==typeof setTimeout?setTimeout:s}catch(t){n=s}try{o="function"==typeof clearTimeout?clearTimeout:a}catch(t){o=a}}();var f,l=[],h=!1,p=-1;function d(){h&&f&&(h=!1,f.length?l=f.concat(l):p=-1,l.length&&y())}function y(){if(!h){var t=u(d);h=!0;for(var e=l.length;e;){for(f=l,l=[];++p<e;)f&&f[p].run();p=-1,e=l.length}f=null,h=!1,c(t)}}function b(t,e){this.fun=t,this.array=e}function v(){}i.nextTick=function(t){var e=new Array(arguments.length-1);if(arguments.length>1)for(var r=1;r<arguments.length;r++)e[r-1]=arguments[r];l.push(new b(t,e)),1!==l.length||h||u(y)},b.prototype.run=function(){this.fun.apply(null,this.array)},i.title="browser",i.browser=!0,i.env={},i.argv=[],i.version="",i.versions={},i.on=v,i.addListener=v,i.once=v,i.off=v,i.removeListener=v,i.removeAllListeners=v,i.emit=v,i.prependListener=v,i.prependOnceListener=v,i.listeners=function(t){return[]},i.binding=function(t){throw new Error("process.binding is not supported")},i.cwd=function(){return"/"},i.chdir=function(t){throw new Error("process.chdir is not supported")},i.umask=function(){return 0}},{}],40:[function(t,e,r){var n=t("buffer"),o=n.Buffer;function i(t,e){for(var r in t)e[r]=t[r]}function s(t,e,r){return o(t,e,r)}o.from&&o.alloc&&o.allocUnsafe&&o.allocUnsafeSlow?e.exports=n:(i(n,r),r.Buffer=s),s.prototype=Object.create(o.prototype),i(o,s),s.from=function(t,e,r){if("number"==typeof t)throw new TypeError("Argument must not be a number");return o(t,e,r)},s.alloc=function(t,e,r){if("number"!=typeof t)throw new TypeError("Argument must be a number");var n=o(t);return void 0!==e?"string"==typeof r?n.fill(e,r):n.fill(e):n.fill(0),n},s.allocUnsafe=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return o(t)},s.allocUnsafeSlow=function(t){if("number"!=typeof t)throw new TypeError("Argument must be a number");return n.SlowBuffer(t)}},{buffer:35}],41:[function(t,e,r){e.exports=o;var n=t("events").EventEmitter;function o(){n.call(this)}t("inherits")(o,n),o.Readable=t("readable-stream/lib/_stream_readable.js"),o.Writable=t("readable-stream/lib/_stream_writable.js"),o.Duplex=t("readable-stream/lib/_stream_duplex.js"),o.Transform=t("readable-stream/lib/_stream_transform.js"),o.PassThrough=t("readable-stream/lib/_stream_passthrough.js"),o.finished=t("readable-stream/lib/internal/streams/end-of-stream.js"),o.pipeline=t("readable-stream/lib/internal/streams/pipeline.js"),o.Stream=o,o.prototype.pipe=function(t,e){var r=this;function o(e){t.writable&&!1===t.write(e)&&r.pause&&r.pause()}function i(){r.readable&&r.resume&&r.resume()}r.on("data",o),t.on("drain",i),t._isStdio||e&&!1===e.end||(r.on("end",a),r.on("close",u));var s=!1;function a(){s||(s=!0,t.end())}function u(){s||(s=!0,"function"==typeof t.destroy&&t.destroy())}function c(t){if(f(),0===n.listenerCount(this,"error"))throw t}function f(){r.removeListener("data",o),t.removeListener("drain",i),r.removeListener("end",a),r.removeListener("close",u),r.removeListener("error",c),t.removeListener("error",c),r.removeListener("end",f),r.removeListener("close",f),t.removeListener("close",f)}return r.on("error",c),t.on("error",c),r.on("end",f),r.on("close",f),t.on("close",f),t.emit("pipe",r),t}},{events:36,inherits:38,"readable-stream/lib/_stream_duplex.js":43,"readable-stream/lib/_stream_passthrough.js":44,"readable-stream/lib/_stream_readable.js":45,"readable-stream/lib/_stream_transform.js":46,"readable-stream/lib/_stream_writable.js":47,"readable-stream/lib/internal/streams/end-of-stream.js":51,"readable-stream/lib/internal/streams/pipeline.js":53}],42:[function(t,e,r){function n(t,e){t.prototype=Object.create(e.prototype),t.prototype.constructor=t,t.__proto__=e}var o={};function i(t,e,r){function i(t,r,n){return"string"==typeof e?e:e(t,r,n)}r||(r=Error);var s=function(t){function e(e,r,n){return t.call(this,i(e,r,n))||this}return n(e,t),e}(r);s.prototype.name=r.name,s.prototype.code=t,o[t]=s}function s(t,e){if(Array.isArray(t)){var r=t.length;return t=t.map(function(t){return String(t)}),r>2?"one of ".concat(e," ").concat(t.slice(0,r-1).join(", "),", or ")+t[r-1]:2===r?"one of ".concat(e," ").concat(t[0]," or ").concat(t[1]):"of ".concat(e," ").concat(t[0])}return"of ".concat(e," ").concat(String(t))}function a(t,e,r){return t.substr(0,e.length)===e}function u(t,e,r){return(void 0===r||r>t.length)&&(r=t.length),t.substring(r-e.length,r)===e}function c(t,e,r){return"number"!=typeof r&&(r=0),!(r+e.length>t.length)&&-1!==t.indexOf(e,r)}i("ERR_INVALID_OPT_VALUE",function(t,e){return'The value "'+e+'" is invalid for option "'+t+'"'},TypeError),i("ERR_INVALID_ARG_TYPE",function(t,e,r){var n,o;if("string"==typeof e&&a(e,"not ")?(n="must not be",e=e.replace(/^not /,"")):n="must be",u(t," argument"))o="The ".concat(t," ").concat(n," ").concat(s(e,"type"));else{var i=c(t,".")?"property":"argument";o='The "'.concat(t,'" ').concat(i," ").concat(n," ").concat(s(e,"type"))}return o+=". Received type ".concat(typeof r)},TypeError),i("ERR_STREAM_PUSH_AFTER_EOF","stream.push() after EOF"),i("ERR_METHOD_NOT_IMPLEMENTED",function(t){return"The "+t+" method is not implemented"}),i("ERR_STREAM_PREMATURE_CLOSE","Premature close"),i("ERR_STREAM_DESTROYED",function(t){return"Cannot call "+t+" after a stream was destroyed"}),i("ERR_MULTIPLE_CALLBACK","Callback called multiple times"),i("ERR_STREAM_CANNOT_PIPE","Cannot pipe, not readable"),i("ERR_STREAM_WRITE_AFTER_END","write after end"),i("ERR_STREAM_NULL_VALUES","May not write null values to stream",TypeError),i("ERR_UNKNOWN_ENCODING",function(t){return"Unknown encoding: "+t},TypeError),i("ERR_STREAM_UNSHIFT_AFTER_END_EVENT","stream.unshift() after end event"),e.exports.codes=o},{}],43:[function(t,e,r){(function(r){(function(){var n=Object.keys||function(t){var e=[];for(var r in t)e.push(r);return e};e.exports=c;var o=t("./_stream_readable"),i=t("./_stream_writable");t("inherits")(c,o);for(var s=n(i.prototype),a=0;a<s.length;a++){var u=s[a];c.prototype[u]||(c.prototype[u]=i.prototype[u])}function c(t){if(!(this instanceof c))return new c(t);o.call(this,t),i.call(this,t),this.allowHalfOpen=!0,t&&(!1===t.readable&&(this.readable=!1),!1===t.writable&&(this.writable=!1),!1===t.allowHalfOpen&&(this.allowHalfOpen=!1,this.once("end",f)))}function f(){this._writableState.ended||r.nextTick(l,this)}function l(t){t.end()}Object.defineProperty(c.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),Object.defineProperty(c.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(c.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(c.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&void 0!==this._writableState&&this._readableState.destroyed&&this._writableState.destroyed},set:function(t){void 0!==this._readableState&&void 0!==this._writableState&&(this._readableState.destroyed=t,this._writableState.destroyed=t)}})}).call(this)}).call(this,t("_process"))},{"./_stream_readable":45,"./_stream_writable":47,_process:39,inherits:38}],44:[function(t,e,r){e.exports=o;var n=t("./_stream_transform");function o(t){if(!(this instanceof o))return new o(t);n.call(this,t)}t("inherits")(o,n),o.prototype._transform=function(t,e,r){r(null,t)}},{"./_stream_transform":46,inherits:38}],45:[function(t,r,n){(function(e,n){(function(){var o;r.exports=j,j.ReadableState=k,t("events").EventEmitter;var i=function(t,e){return t.listeners(e).length},s=t("./internal/streams/stream"),a=t("buffer").Buffer,u=n.Uint8Array||function(){};function c(t){return a.from(t)}function f(t){return a.isBuffer(t)||t instanceof u}var l,h=t("util");l=h&&h.debuglog?h.debuglog("stream"):function(){};var p,d,y,b=t("./internal/streams/buffer_list"),v=t("./internal/streams/destroy"),m=t("./internal/streams/state").getHighWaterMark,g=t("../errors").codes,w=g.ERR_INVALID_ARG_TYPE,_=g.ERR_STREAM_PUSH_AFTER_EOF,S=g.ERR_METHOD_NOT_IMPLEMENTED,x=g.ERR_STREAM_UNSHIFT_AFTER_END_EVENT;t("inherits")(j,s);var O=v.errorOrDestroy,E=["error","close","destroy","pause","resume"];function T(t,e,r){if("function"==typeof t.prependListener)return t.prependListener(e,r);t._events&&t._events[e]?Array.isArray(t._events[e])?t._events[e].unshift(r):t._events[e]=[r,t._events[e]]:t.on(e,r)}function k(e,r,n){o=o||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof o),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.readableObjectMode),this.highWaterMark=m(this,e,"readableHighWaterMark",n),this.buffer=new b,this.length=0,this.pipes=null,this.pipesCount=0,this.flowing=null,this.ended=!1,this.endEmitted=!1,this.reading=!1,this.sync=!0,this.needReadable=!1,this.emittedReadable=!1,this.readableListening=!1,this.resumeScheduled=!1,this.paused=!0,this.emitClose=!1!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.destroyed=!1,this.defaultEncoding=e.defaultEncoding||"utf8",this.awaitDrain=0,this.readingMore=!1,this.decoder=null,this.encoding=null,e.encoding&&(p||(p=t("string_decoder/").StringDecoder),this.decoder=new p(e.encoding),this.encoding=e.encoding)}function j(e){if(o=o||t("./_stream_duplex"),!(this instanceof j))return new j(e);var r=this instanceof o;this._readableState=new k(e,this,r),this.readable=!0,e&&("function"==typeof e.read&&(this._read=e.read),"function"==typeof e.destroy&&(this._destroy=e.destroy)),s.call(this)}function P(t,e,r,n,o){l("readableAddChunk",e);var i,s=t._readableState;if(null===e)s.reading=!1,I(t,s);else if(o||(i=R(s,e)),i)O(t,i);else if(s.objectMode||e&&e.length>0)if("string"==typeof e||s.objectMode||Object.getPrototypeOf(e)===a.prototype||(e=c(e)),n)s.endEmitted?O(t,new x):A(t,s,e,!0);else if(s.ended)O(t,new _);else{if(s.destroyed)return!1;s.reading=!1,s.decoder&&!r?(e=s.decoder.write(e),s.objectMode||0!==e.length?A(t,s,e,!1):U(t,s)):A(t,s,e,!1)}else n||(s.reading=!1,U(t,s));return!s.ended&&(s.length<s.highWaterMark||0===s.length)}function A(t,e,r,n){e.flowing&&0===e.length&&!e.sync?(e.awaitDrain=0,t.emit("data",r)):(e.length+=e.objectMode?1:r.length,n?e.buffer.unshift(r):e.buffer.push(r),e.needReadable&&B(t)),U(t,e)}function R(t,e){var r;return f(e)||"string"==typeof e||void 0===e||t.objectMode||(r=new w("chunk",["string","Buffer","Uint8Array"],e)),r}Object.defineProperty(j.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._readableState&&this._readableState.destroyed},set:function(t){this._readableState&&(this._readableState.destroyed=t)}}),j.prototype.destroy=v.destroy,j.prototype._undestroy=v.undestroy,j.prototype._destroy=function(t,e){e(t)},j.prototype.push=function(t,e){var r,n=this._readableState;return n.objectMode?r=!0:"string"==typeof t&&((e=e||n.defaultEncoding)!==n.encoding&&(t=a.from(t,e),e=""),r=!0),P(this,t,e,!1,r)},j.prototype.unshift=function(t){return P(this,t,null,!0,!1)},j.prototype.isPaused=function(){return!1===this._readableState.flowing},j.prototype.setEncoding=function(e){p||(p=t("string_decoder/").StringDecoder);var r=new p(e);this._readableState.decoder=r,this._readableState.encoding=this._readableState.decoder.encoding;for(var n=this._readableState.buffer.head,o="";null!==n;)o+=r.write(n.data),n=n.next;return this._readableState.buffer.clear(),""!==o&&this._readableState.buffer.push(o),this._readableState.length=o.length,this};var C=1073741824;function M(t){return t>=C?t=C:(t--,t|=t>>>1,t|=t>>>2,t|=t>>>4,t|=t>>>8,t|=t>>>16,t++),t}function L(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=M(t)),t<=e.length?t:e.ended?e.length:(e.needReadable=!0,0))}function I(t,e){if(l("onEofChunk"),!e.ended){if(e.decoder){var r=e.decoder.end();r&&r.length&&(e.buffer.push(r),e.length+=e.objectMode?1:r.length)}e.ended=!0,e.sync?B(t):(e.needReadable=!1,e.emittedReadable||(e.emittedReadable=!0,D(t)))}}function B(t){var r=t._readableState;l("emitReadable",r.needReadable,r.emittedReadable),r.needReadable=!1,r.emittedReadable||(l("emitReadable",r.flowing),r.emittedReadable=!0,e.nextTick(D,t))}function D(t){var e=t._readableState;l("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,G(t)}function U(t,r){r.readingMore||(r.readingMore=!0,e.nextTick(N,t,r))}function N(t,e){for(;!e.reading&&!e.ended&&(e.length<e.highWaterMark||e.flowing&&0===e.length);){var r=e.length;if(l("maybeReadMore read 0"),t.read(0),r===e.length)break}e.readingMore=!1}function q(t){return function(){var e=t._readableState;l("pipeOnDrain",e.awaitDrain),e.awaitDrain&&e.awaitDrain--,0===e.awaitDrain&&i(t,"data")&&(e.flowing=!0,G(t))}}function H(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 F(t){l("readable nexttick read 0"),t.read(0)}function W(t,r){r.resumeScheduled||(r.resumeScheduled=!0,e.nextTick($,t,r))}function $(t,e){l("resume",e.reading),e.reading||t.read(0),e.resumeScheduled=!1,t.emit("resume"),G(t),e.flowing&&!e.reading&&t.read(0)}function G(t){var e=t._readableState;for(l("flow",e.flowing);e.flowing&&null!==t.read(););}function z(t,e){return 0===e.length?null:(e.objectMode?r=e.buffer.shift():!t||t>=e.length?(r=e.decoder?e.buffer.join(""):1===e.buffer.length?e.buffer.first():e.buffer.concat(e.length),e.buffer.clear()):r=e.buffer.consume(t,e.decoder),r);var r}function V(t){var r=t._readableState;l("endReadable",r.endEmitted),r.endEmitted||(r.ended=!0,e.nextTick(J,r,t))}function J(t,e){if(l("endReadableNT",t.endEmitted,t.length),!t.endEmitted&&0===t.length&&(t.endEmitted=!0,e.readable=!1,e.emit("end"),t.autoDestroy)){var r=e._writableState;(!r||r.autoDestroy&&r.finished)&&e.destroy()}}function Y(t,e){for(var r=0,n=t.length;r<n;r++)if(t[r]===e)return r;return-1}j.prototype.read=function(t){l("read",t),t=parseInt(t,10);var e=this._readableState,r=t;if(0!==t&&(e.emittedReadable=!1),0===t&&e.needReadable&&((0!==e.highWaterMark?e.length>=e.highWaterMark:e.length>0)||e.ended))return l("read: emitReadable",e.length,e.ended),0===e.length&&e.ended?V(this):B(this),null;if(0===(t=L(t,e))&&e.ended)return 0===e.length&&V(this),null;var n,o=e.needReadable;return l("need readable",o),(0===e.length||e.length-t<e.highWaterMark)&&l("length less than watermark",o=!0),e.ended||e.reading?l("reading or ended",o=!1):o&&(l("do read"),e.reading=!0,e.sync=!0,0===e.length&&(e.needReadable=!0),this._read(e.highWaterMark),e.sync=!1,e.reading||(t=L(r,e))),null===(n=t>0?z(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),r!==t&&e.ended&&V(this)),null!==n&&this.emit("data",n),n},j.prototype._read=function(t){O(this,new S("_read()"))},j.prototype.pipe=function(t,r){var n=this,o=this._readableState;switch(o.pipesCount){case 0:o.pipes=t;break;case 1:o.pipes=[o.pipes,t];break;default:o.pipes.push(t)}o.pipesCount+=1,l("pipe count=%d opts=%j",o.pipesCount,r);var s=r&&!1===r.end||t===e.stdout||t===e.stderr?v:u;function a(t,e){l("onunpipe"),t===n&&e&&!1===e.hasUnpiped&&(e.hasUnpiped=!0,h())}function u(){l("onend"),t.end()}o.endEmitted?e.nextTick(s):n.once("end",s),t.on("unpipe",a);var c=q(n);t.on("drain",c);var f=!1;function h(){l("cleanup"),t.removeListener("close",y),t.removeListener("finish",b),t.removeListener("drain",c),t.removeListener("error",d),t.removeListener("unpipe",a),n.removeListener("end",u),n.removeListener("end",v),n.removeListener("data",p),f=!0,!o.awaitDrain||t._writableState&&!t._writableState.needDrain||c()}function p(e){l("ondata");var r=t.write(e);l("dest.write",r),!1===r&&((1===o.pipesCount&&o.pipes===t||o.pipesCount>1&&-1!==Y(o.pipes,t))&&!f&&(l("false write response, pause",o.awaitDrain),o.awaitDrain++),n.pause())}function d(e){l("onerror",e),v(),t.removeListener("error",d),0===i(t,"error")&&O(t,e)}function y(){t.removeListener("finish",b),v()}function b(){l("onfinish"),t.removeListener("close",y),v()}function v(){l("unpipe"),n.unpipe(t)}return n.on("data",p),T(t,"error",d),t.once("close",y),t.once("finish",b),t.emit("pipe",n),o.flowing||(l("pipe resume"),n.resume()),t},j.prototype.unpipe=function(t){var e=this._readableState,r={hasUnpiped:!1};if(0===e.pipesCount)return this;if(1===e.pipesCount)return t&&t!==e.pipes||(t||(t=e.pipes),e.pipes=null,e.pipesCount=0,e.flowing=!1,t&&t.emit("unpipe",this,r)),this;if(!t){var n=e.pipes,o=e.pipesCount;e.pipes=null,e.pipesCount=0,e.flowing=!1;for(var i=0;i<o;i++)n[i].emit("unpipe",this,{hasUnpiped:!1});return this}var s=Y(e.pipes,t);return-1===s||(e.pipes.splice(s,1),e.pipesCount-=1,1===e.pipesCount&&(e.pipes=e.pipes[0]),t.emit("unpipe",this,r)),this},j.prototype.on=function(t,r){var n=s.prototype.on.call(this,t,r),o=this._readableState;return"data"===t?(o.readableListening=this.listenerCount("readable")>0,!1!==o.flowing&&this.resume()):"readable"===t&&(o.endEmitted||o.readableListening||(o.readableListening=o.needReadable=!0,o.flowing=!1,o.emittedReadable=!1,l("on readable",o.length,o.reading),o.length?B(this):o.reading||e.nextTick(F,this))),n},j.prototype.addListener=j.prototype.on,j.prototype.removeListener=function(t,r){var n=s.prototype.removeListener.call(this,t,r);return"readable"===t&&e.nextTick(H,this),n},j.prototype.removeAllListeners=function(t){var r=s.prototype.removeAllListeners.apply(this,arguments);return"readable"!==t&&void 0!==t||e.nextTick(H,this),r},j.prototype.resume=function(){var t=this._readableState;return t.flowing||(l("resume"),t.flowing=!t.readableListening,W(this,t)),t.paused=!1,this},j.prototype.pause=function(){return l("call pause flowing=%j",this._readableState.flowing),!1!==this._readableState.flowing&&(l("pause"),this._readableState.flowing=!1,this.emit("pause")),this._readableState.paused=!0,this},j.prototype.wrap=function(t){var e=this,r=this._readableState,n=!1;for(var o in t.on("end",function(){if(l("wrapped end"),r.decoder&&!r.ended){var t=r.decoder.end();t&&t.length&&e.push(t)}e.push(null)}),t.on("data",function(o){l("wrapped data"),r.decoder&&(o=r.decoder.write(o)),r.objectMode&&null==o||(r.objectMode||o&&o.length)&&(e.push(o)||(n=!0,t.pause()))}),t)void 0===this[o]&&"function"==typeof t[o]&&(this[o]=function(e){return function(){return t[e].apply(t,arguments)}}(o));for(var i=0;i<E.length;i++)t.on(E[i],this.emit.bind(this,E[i]));return this._read=function(e){l("wrapped _read",e),n&&(n=!1,t.resume())},this},"function"==typeof Symbol&&(j.prototype[Symbol.asyncIterator]=function(){return void 0===d&&(d=t("./internal/streams/async_iterator")),d(this)}),Object.defineProperty(j.prototype,"readableHighWaterMark",{enumerable:!1,get:function(){return this._readableState.highWaterMark}}),Object.defineProperty(j.prototype,"readableBuffer",{enumerable:!1,get:function(){return this._readableState&&this._readableState.buffer}}),Object.defineProperty(j.prototype,"readableFlowing",{enumerable:!1,get:function(){return this._readableState.flowing},set:function(t){this._readableState&&(this._readableState.flowing=t)}}),j._fromList=z,Object.defineProperty(j.prototype,"readableLength",{enumerable:!1,get:function(){return this._readableState.length}}),"function"==typeof Symbol&&(j.from=function(e,r){return void 0===y&&(y=t("./internal/streams/from")),y(j,e,r)})}).call(this)}).call(this,t("_process"),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/async_iterator":48,"./internal/streams/buffer_list":49,"./internal/streams/destroy":50,"./internal/streams/from":52,"./internal/streams/state":54,"./internal/streams/stream":55,_process:39,buffer:35,events:36,inherits:38,"string_decoder/":56,util:33}],46:[function(t,e,r){e.exports=f;var n=t("../errors").codes,o=n.ERR_METHOD_NOT_IMPLEMENTED,i=n.ERR_MULTIPLE_CALLBACK,s=n.ERR_TRANSFORM_ALREADY_TRANSFORMING,a=n.ERR_TRANSFORM_WITH_LENGTH_0,u=t("./_stream_duplex");function c(t,e){var r=this._transformState;r.transforming=!1;var n=r.writecb;if(null===n)return this.emit("error",new i);r.writechunk=null,r.writecb=null,null!=e&&this.push(e),n(t);var o=this._readableState;o.reading=!1,(o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}function f(t){if(!(this instanceof f))return new f(t);u.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",l)}function l(){var t=this;"function"!=typeof this._flush||this._readableState.destroyed?h(this,null,null):this._flush(function(e,r){h(t,e,r)})}function h(t,e,r){if(e)return t.emit("error",e);if(null!=r&&t.push(r),t._writableState.length)throw new a;if(t._transformState.transforming)throw new s;return t.push(null)}t("inherits")(f,u),f.prototype.push=function(t,e){return this._transformState.needTransform=!1,u.prototype.push.call(this,t,e)},f.prototype._transform=function(t,e,r){r(new o("_transform()"))},f.prototype._write=function(t,e,r){var n=this._transformState;if(n.writecb=r,n.writechunk=t,n.writeencoding=e,!n.transforming){var o=this._readableState;(n.needTransform||o.needReadable||o.length<o.highWaterMark)&&this._read(o.highWaterMark)}},f.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))},f.prototype._destroy=function(t,e){u.prototype._destroy.call(this,t,function(t){e(t)})}},{"../errors":42,"./_stream_duplex":43,inherits:38}],47:[function(t,r,n){(function(e,n){(function(){function o(t){var e=this;this.next=null,this.entry=null,this.finish=function(){$(e,t)}}var i;r.exports=k,k.WritableState=T;var s={deprecate:t("util-deprecate")},a=t("./internal/streams/stream"),u=t("buffer").Buffer,c=n.Uint8Array||function(){};function f(t){return u.from(t)}function l(t){return u.isBuffer(t)||t instanceof c}var h,p=t("./internal/streams/destroy"),d=t("./internal/streams/state").getHighWaterMark,y=t("../errors").codes,b=y.ERR_INVALID_ARG_TYPE,v=y.ERR_METHOD_NOT_IMPLEMENTED,m=y.ERR_MULTIPLE_CALLBACK,g=y.ERR_STREAM_CANNOT_PIPE,w=y.ERR_STREAM_DESTROYED,_=y.ERR_STREAM_NULL_VALUES,S=y.ERR_STREAM_WRITE_AFTER_END,x=y.ERR_UNKNOWN_ENCODING,O=p.errorOrDestroy;function E(){}function T(e,r,n){i=i||t("./_stream_duplex"),e=e||{},"boolean"!=typeof n&&(n=r instanceof i),this.objectMode=!!e.objectMode,n&&(this.objectMode=this.objectMode||!!e.writableObjectMode),this.highWaterMark=d(this,e,"writableHighWaterMark",n),this.finalCalled=!1,this.needDrain=!1,this.ending=!1,this.ended=!1,this.finished=!1,this.destroyed=!1;var s=!1===e.decodeStrings;this.decodeStrings=!s,this.defaultEncoding=e.defaultEncoding||"utf8",this.length=0,this.writing=!1,this.corked=0,this.sync=!0,this.bufferProcessing=!1,this.onwrite=function(t){I(r,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!==e.emitClose,this.autoDestroy=!!e.autoDestroy,this.bufferedRequestCount=0,this.corkedRequestsFree=new o(this)}function k(e){var r=this instanceof(i=i||t("./_stream_duplex"));if(!r&&!h.call(k,this))return new k(e);this._writableState=new T(e,this,r),this.writable=!0,e&&("function"==typeof e.write&&(this._write=e.write),"function"==typeof e.writev&&(this._writev=e.writev),"function"==typeof e.destroy&&(this._destroy=e.destroy),"function"==typeof e.final&&(this._final=e.final)),a.call(this)}function j(t,r){var n=new S;O(t,n),e.nextTick(r,n)}function P(t,r,n,o){var i;return null===n?i=new _:"string"==typeof n||r.objectMode||(i=new b("chunk",["string","Buffer"],n)),!i||(O(t,i),e.nextTick(o,i),!1)}function A(t,e,r){return t.objectMode||!1===t.decodeStrings||"string"!=typeof e||(e=u.from(e,r)),e}function R(t,e,r,n,o,i){if(!r){var s=A(e,n,o);n!==s&&(r=!0,o="buffer",n=s)}var a=e.objectMode?1:n.length;e.length+=a;var u=e.length<e.highWaterMark;if(u||(e.needDrain=!0),e.writing||e.corked){var c=e.lastBufferedRequest;e.lastBufferedRequest={chunk:n,encoding:o,isBuf:r,callback:i,next:null},c?c.next=e.lastBufferedRequest:e.bufferedRequest=e.lastBufferedRequest,e.bufferedRequestCount+=1}else C(t,e,!1,a,n,o,i);return u}function C(t,e,r,n,o,i,s){e.writelen=n,e.writecb=s,e.writing=!0,e.sync=!0,e.destroyed?e.onwrite(new w("write")):r?t._writev(o,e.onwrite):t._write(o,i,e.onwrite),e.sync=!1}function M(t,r,n,o,i){--r.pendingcb,n?(e.nextTick(i,o),e.nextTick(F,t,r),t._writableState.errorEmitted=!0,O(t,o)):(i(o),t._writableState.errorEmitted=!0,O(t,o),F(t,r))}function L(t){t.writing=!1,t.writecb=null,t.length-=t.writelen,t.writelen=0}function I(t,r){var n=t._writableState,o=n.sync,i=n.writecb;if("function"!=typeof i)throw new m;if(L(n),r)M(t,n,o,r,i);else{var s=N(n)||t.destroyed;s||n.corked||n.bufferProcessing||!n.bufferedRequest||U(t,n),o?e.nextTick(B,t,n,s,i):B(t,n,s,i)}}function B(t,e,r,n){r||D(t,e),e.pendingcb--,n(),F(t,e)}function D(t,e){0===e.length&&e.needDrain&&(e.needDrain=!1,t.emit("drain"))}function U(t,e){e.bufferProcessing=!0;var r=e.bufferedRequest;if(t._writev&&r&&r.next){var n=e.bufferedRequestCount,i=new Array(n),s=e.corkedRequestsFree;s.entry=r;for(var a=0,u=!0;r;)i[a]=r,r.isBuf||(u=!1),r=r.next,a+=1;i.allBuffers=u,C(t,e,!0,e.length,i,"",s.finish),e.pendingcb++,e.lastBufferedRequest=null,s.next?(e.corkedRequestsFree=s.next,s.next=null):e.corkedRequestsFree=new o(e),e.bufferedRequestCount=0}else{for(;r;){var c=r.chunk,f=r.encoding,l=r.callback;if(C(t,e,!1,e.objectMode?1:c.length,c,f,l),r=r.next,e.bufferedRequestCount--,e.writing)break}null===r&&(e.lastBufferedRequest=null)}e.bufferedRequest=r,e.bufferProcessing=!1}function N(t){return t.ending&&0===t.length&&null===t.bufferedRequest&&!t.finished&&!t.writing}function q(t,e){t._final(function(r){e.pendingcb--,r&&O(t,r),e.prefinished=!0,t.emit("prefinish"),F(t,e)})}function H(t,r){r.prefinished||r.finalCalled||("function"!=typeof t._final||r.destroyed?(r.prefinished=!0,t.emit("prefinish")):(r.pendingcb++,r.finalCalled=!0,e.nextTick(q,t,r)))}function F(t,e){var r=N(e);if(r&&(H(t,e),0===e.pendingcb&&(e.finished=!0,t.emit("finish"),e.autoDestroy))){var n=t._readableState;(!n||n.autoDestroy&&n.endEmitted)&&t.destroy()}return r}function W(t,r,n){r.ending=!0,F(t,r),n&&(r.finished?e.nextTick(n):t.once("finish",n)),r.ended=!0,t.writable=!1}function $(t,e,r){var n=t.entry;for(t.entry=null;n;){var o=n.callback;e.pendingcb--,o(r),n=n.next}e.corkedRequestsFree.next=t}t("inherits")(k,a),T.prototype.getBuffer=function(){for(var t=this.bufferedRequest,e=[];t;)e.push(t),t=t.next;return e},function(){try{Object.defineProperty(T.prototype,"buffer",{get:s.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]?(h=Function.prototype[Symbol.hasInstance],Object.defineProperty(k,Symbol.hasInstance,{value:function(t){return!!h.call(this,t)||this===k&&t&&t._writableState instanceof T}})):h=function(t){return t instanceof this},k.prototype.pipe=function(){O(this,new g)},k.prototype.write=function(t,e,r){var n=this._writableState,o=!1,i=!n.objectMode&&l(t);return i&&!u.isBuffer(t)&&(t=f(t)),"function"==typeof e&&(r=e,e=null),i?e="buffer":e||(e=n.defaultEncoding),"function"!=typeof r&&(r=E),n.ending?j(this,r):(i||P(this,n,t,r))&&(n.pendingcb++,o=R(this,n,i,t,e,r)),o},k.prototype.cork=function(){this._writableState.corked++},k.prototype.uncork=function(){var t=this._writableState;t.corked&&(t.corked--,t.writing||t.corked||t.bufferProcessing||!t.bufferedRequest||U(this,t))},k.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 x(t);return this._writableState.defaultEncoding=t,this},Object.defineProperty(k.prototype,"writableBuffer",{enumerable:!1,get:function(){return this._writableState&&this._writableState.getBuffer()}}),Object.defineProperty(k.prototype,"writableHighWaterMark",{enumerable:!1,get:function(){return this._writableState.highWaterMark}}),k.prototype._write=function(t,e,r){r(new v("_write()"))},k.prototype._writev=null,k.prototype.end=function(t,e,r){var n=this._writableState;return"function"==typeof t?(r=t,t=null,e=null):"function"==typeof e&&(r=e,e=null),null!=t&&this.write(t,e),n.corked&&(n.corked=1,this.uncork()),n.ending||W(this,n,r),this},Object.defineProperty(k.prototype,"writableLength",{enumerable:!1,get:function(){return this._writableState.length}}),Object.defineProperty(k.prototype,"destroyed",{enumerable:!1,get:function(){return void 0!==this._writableState&&this._writableState.destroyed},set:function(t){this._writableState&&(this._writableState.destroyed=t)}}),k.prototype.destroy=p.destroy,k.prototype._undestroy=p.undestroy,k.prototype._destroy=function(t,e){e(t)}}).call(this)}).call(this,t("_process"),void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{"../errors":42,"./_stream_duplex":43,"./internal/streams/destroy":50,"./internal/streams/state":54,"./internal/streams/stream":55,_process:39,buffer:35,inherits:38,"util-deprecate":57}],48:[function(t,e,r){(function(r){(function(){var n;function o(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}var i=t("./end-of-stream"),s=Symbol("lastResolve"),a=Symbol("lastReject"),u=Symbol("error"),c=Symbol("ended"),f=Symbol("lastPromise"),l=Symbol("handlePromise"),h=Symbol("stream");function p(t,e){return{value:t,done:e}}function d(t){var e=t[s];if(null!==e){var r=t[h].read();null!==r&&(t[f]=null,t[s]=null,t[a]=null,e(p(r,!1)))}}function y(t){r.nextTick(d,t)}function b(t,e){return function(r,n){t.then(function(){e[c]?r(p(void 0,!0)):e[l](r,n)},n)}}var v=Object.getPrototypeOf(function(){}),m=Object.setPrototypeOf((o(n={get stream(){return this[h]},next:function(){var t=this,e=this[u];if(null!==e)return Promise.reject(e);if(this[c])return Promise.resolve(p(void 0,!0));if(this[h].destroyed)return new Promise(function(e,n){r.nextTick(function(){t[u]?n(t[u]):e(p(void 0,!0))})});var n,o=this[f];if(o)n=new Promise(b(o,this));else{var i=this[h].read();if(null!==i)return Promise.resolve(p(i,!1));n=new Promise(this[l])}return this[f]=n,n}},Symbol.asyncIterator,function(){return this}),o(n,"return",function(){var t=this;return new Promise(function(e,r){t[h].destroy(null,function(t){t?r(t):e(p(void 0,!0))})})}),n),v),g=function(t){var e,r=Object.create(m,(o(e={},h,{value:t,writable:!0}),o(e,s,{value:null,writable:!0}),o(e,a,{value:null,writable:!0}),o(e,u,{value:null,writable:!0}),o(e,c,{value:t._readableState.endEmitted,writable:!0}),o(e,l,{value:function(t,e){var n=r[h].read();n?(r[f]=null,r[s]=null,r[a]=null,t(p(n,!1))):(r[s]=t,r[a]=e)},writable:!0}),e));return r[f]=null,i(t,function(t){if(t&&"ERR_STREAM_PREMATURE_CLOSE"!==t.code){var e=r[a];return null!==e&&(r[f]=null,r[s]=null,r[a]=null,e(t)),void(r[u]=t)}var n=r[s];null!==n&&(r[f]=null,r[s]=null,r[a]=null,n(p(void 0,!0))),r[c]=!0}),t.on("readable",y.bind(null,r)),r};e.exports=g}).call(this)}).call(this,t("_process"))},{"./end-of-stream":51,_process:39}],49:[function(t,e,r){function n(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function o(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?n(Object(r),!0).forEach(function(e){i(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):n(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}function i(t,e,r){return e in t?Object.defineProperty(t,e,{value:r,enumerable:!0,configurable:!0,writable:!0}):t[e]=r,t}function s(t,e){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}function a(t,e){for(var r=0;r<e.length;r++){var n=e[r];n.enumerable=n.enumerable||!1,n.configurable=!0,"value"in n&&(n.writable=!0),Object.defineProperty(t,n.key,n)}}function u(t,e,r){return e&&a(t.prototype,e),t}var c=t("buffer").Buffer,f=t("util").inspect,l=f&&f.custom||"inspect";function h(t,e,r){c.prototype.copy.call(t,e,r)}e.exports=function(){function t(){s(this,t),this.head=null,this.tail=null,this.length=0}return u(t,[{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,r=""+e.data;e=e.next;)r+=t+e.data;return r}},{key:"concat",value:function(t){if(0===this.length)return c.alloc(0);for(var e=c.allocUnsafe(t>>>0),r=this.head,n=0;r;)h(r.data,e,n),n+=r.data.length,r=r.next;return e}},{key:"consume",value:function(t,e){var r;return t<this.head.data.length?(r=this.head.data.slice(0,t),this.head.data=this.head.data.slice(t)):r=t===this.head.data.length?this.shift():e?this._getString(t):this._getBuffer(t),r}},{key:"first",value:function(){return this.head.data}},{key:"_getString",value:function(t){var e=this.head,r=1,n=e.data;for(t-=n.length;e=e.next;){var o=e.data,i=t>o.length?o.length:t;if(i===o.length?n+=o:n+=o.slice(0,t),0===(t-=i)){i===o.length?(++r,e.next?this.head=e.next:this.head=this.tail=null):(this.head=e,e.data=o.slice(i));break}++r}return this.length-=r,n}},{key:"_getBuffer",value:function(t){var e=c.allocUnsafe(t),r=this.head,n=1;for(r.data.copy(e),t-=r.data.length;r=r.next;){var o=r.data,i=t>o.length?o.length:t;if(o.copy(e,e.length-t,0,i),0===(t-=i)){i===o.length?(++n,r.next?this.head=r.next:this.head=this.tail=null):(this.head=r,r.data=o.slice(i));break}++n}return this.length-=n,e}},{key:l,value:function(t,e){return f(this,o({},e,{depth:0,customInspect:!1}))}}]),t}()},{buffer:35,util:33}],50:[function(t,e,r){(function(t){(function(){function r(e,r){var i=this,a=this._readableState&&this._readableState.destroyed,u=this._writableState&&this._writableState.destroyed;return a||u?(r?r(e):e&&(this._writableState?this._writableState.errorEmitted||(this._writableState.errorEmitted=!0,t.nextTick(s,this,e)):t.nextTick(s,this,e)),this):(this._readableState&&(this._readableState.destroyed=!0),this._writableState&&(this._writableState.destroyed=!0),this._destroy(e||null,function(e){!r&&e?i._writableState?i._writableState.errorEmitted?t.nextTick(o,i):(i._writableState.errorEmitted=!0,t.nextTick(n,i,e)):t.nextTick(n,i,e):r?(t.nextTick(o,i),r(e)):t.nextTick(o,i)}),this)}function n(t,e){s(t,e),o(t)}function o(t){t._writableState&&!t._writableState.emitClose||t._readableState&&!t._readableState.emitClose||t.emit("close")}function i(){this._readableState&&(this._readableState.destroyed=!1,this._readableState.reading=!1,this._readableState.ended=!1,this._readableState.endEmitted=!1),this._writableState&&(this._writableState.destroyed=!1,this._writableState.ended=!1,this._writableState.ending=!1,this._writableState.finalCalled=!1,this._writableState.prefinished=!1,this._writableState.finished=!1,this._writableState.errorEmitted=!1)}function s(t,e){t.emit("error",e)}function a(t,e){var r=t._readableState,n=t._writableState;r&&r.autoDestroy||n&&n.autoDestroy?t.destroy(e):t.emit("error",e)}e.exports={destroy:r,undestroy:i,errorOrDestroy:a}}).call(this)}).call(this,t("_process"))},{_process:39}],51:[function(t,e,r){var n=t("../../../errors").codes.ERR_STREAM_PREMATURE_CLOSE;function o(t){var e=!1;return function(){if(!e){e=!0;for(var r=arguments.length,n=new Array(r),o=0;o<r;o++)n[o]=arguments[o];t.apply(this,n)}}}function i(){}function s(t){return t.setHeader&&"function"==typeof t.abort}function a(t,e,r){if("function"==typeof e)return a(t,null,e);e||(e={}),r=o(r||i);var u=e.readable||!1!==e.readable&&t.readable,c=e.writable||!1!==e.writable&&t.writable,f=function(){t.writable||h()},l=t._writableState&&t._writableState.finished,h=function(){c=!1,l=!0,u||r.call(t)},p=t._readableState&&t._readableState.endEmitted,d=function(){u=!1,p=!0,c||r.call(t)},y=function(e){r.call(t,e)},b=function(){var e;return u&&!p?(t._readableState&&t._readableState.ended||(e=new n),r.call(t,e)):c&&!l?(t._writableState&&t._writableState.ended||(e=new n),r.call(t,e)):void 0},v=function(){t.req.on("finish",h)};return s(t)?(t.on("complete",h),t.on("abort",b),t.req?v():t.on("request",v)):c&&!t._writableState&&(t.on("end",f),t.on("close",f)),t.on("end",d),t.on("finish",h),!1!==e.error&&t.on("error",y),t.on("close",b),function(){t.removeListener("complete",h),t.removeListener("abort",b),t.removeListener("request",v),t.req&&t.req.removeListener("finish",h),t.removeListener("end",f),t.removeListener("close",f),t.removeListener("finish",h),t.removeListener("end",d),t.removeListener("error",y),t.removeListener("close",b)}}e.exports=a},{"../../../errors":42}],52:[function(t,e,r){e.exports=function(){throw new Error("Readable.from is not available in the browser")}},{}],53:[function(t,e,r){var n;function o(t){var e=!1;return function(){e||(e=!0,t.apply(void 0,arguments))}}var i=t("../../../errors").codes,s=i.ERR_MISSING_ARGS,a=i.ERR_STREAM_DESTROYED;function u(t){if(t)throw t}function c(t){return t.setHeader&&"function"==typeof t.abort}function f(e,r,i,s){s=o(s);var u=!1;e.on("close",function(){u=!0}),void 0===n&&(n=t("./end-of-stream")),n(e,{readable:r,writable:i},function(t){if(t)return s(t);u=!0,s()});var f=!1;return function(t){if(!u&&!f)return f=!0,c(e)?e.abort():"function"==typeof e.destroy?e.destroy():void s(t||new a("pipe"))}}function l(t){t()}function h(t,e){return t.pipe(e)}function p(t){return t.length?"function"!=typeof t[t.length-1]?u:t.pop():u}function d(){for(var t=arguments.length,e=new Array(t),r=0;r<t;r++)e[r]=arguments[r];var n,o=p(e);if(Array.isArray(e[0])&&(e=e[0]),e.length<2)throw new s("streams");var i=e.map(function(t,r){var s=r<e.length-1;return f(t,s,r>0,function(t){n||(n=t),t&&i.forEach(l),s||(i.forEach(l),o(n))})});return e.reduce(h)}e.exports=d},{"../../../errors":42,"./end-of-stream":51}],54:[function(t,e,r){var n=t("../../../errors").codes.ERR_INVALID_OPT_VALUE;function o(t,e,r){return null!=t.highWaterMark?t.highWaterMark:e?t[r]:null}function i(t,e,r,i){var s=o(e,i,r);if(null!=s){if(!isFinite(s)||Math.floor(s)!==s||s<0)throw new n(i?r:"highWaterMark",s);return Math.floor(s)}return t.objectMode?16:16384}e.exports={getHighWaterMark:i}},{"../../../errors":42}],55:[function(t,e,r){e.exports=t("events").EventEmitter},{events:36}],56:[function(t,e,r){var n=t("safe-buffer").Buffer,o=n.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 i(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}}function s(t){var e=i(t);if("string"!=typeof e&&(n.isEncoding===o||!o(t)))throw new Error("Unknown encoding: "+t);return e||t}function a(t){var e;switch(this.encoding=s(t),this.encoding){case"utf16le":this.text=d,this.end=y,e=4;break;case"utf8":this.fillLast=l,e=4;break;case"base64":this.text=b,this.end=v,e=3;break;default:return this.write=m,void(this.end=g)}this.lastNeed=0,this.lastTotal=0,this.lastChar=n.allocUnsafe(e)}function u(t){return t<=127?0:t>>5==6?2:t>>4==14?3:t>>3==30?4:t>>6==2?-1:-2}function c(t,e,r){var n=e.length-1;if(n<r)return 0;var o=u(e[n]);return o>=0?(o>0&&(t.lastNeed=o-1),o):--n<r||-2===o?0:(o=u(e[n]))>=0?(o>0&&(t.lastNeed=o-2),o):--n<r||-2===o?0:(o=u(e[n]))>=0?(o>0&&(2===o?o=0:t.lastNeed=o-3),o):0}function f(t,e,r){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,"�"}}function l(t){var e=this.lastTotal-this.lastNeed,r=f(this,t);return void 0!==r?r: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 h(t,e){var r=c(this,t,e);if(!this.lastNeed)return t.toString("utf8",e);this.lastTotal=r;var n=t.length-(r-this.lastNeed);return t.copy(this.lastChar,0,n),t.toString("utf8",e,n)}function p(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+"�":e}function d(t,e){if((t.length-e)%2==0){var r=t.toString("utf16le",e);if(r){var n=r.charCodeAt(r.length-1);if(n>=55296&&n<=56319)return this.lastNeed=2,this.lastTotal=4,this.lastChar[0]=t[t.length-2],this.lastChar[1]=t[t.length-1],r.slice(0,-1)}return r}return this.lastNeed=1,this.lastTotal=2,this.lastChar[0]=t[t.length-1],t.toString("utf16le",e,t.length-1)}function y(t){var e=t&&t.length?this.write(t):"";if(this.lastNeed){var r=this.lastTotal-this.lastNeed;return e+this.lastChar.toString("utf16le",0,r)}return e}function b(t,e){var r=(t.length-e)%3;return 0===r?t.toString("base64",e):(this.lastNeed=3-r,this.lastTotal=3,1===r?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-r))}function v(t){var e=t&&t.length?this.write(t):"";return this.lastNeed?e+this.lastChar.toString("base64",0,3-this.lastNeed):e}function m(t){return t.toString(this.encoding)}function g(t){return t&&t.length?this.write(t):""}r.StringDecoder=a,a.prototype.write=function(t){if(0===t.length)return"";var e,r;if(this.lastNeed){if(void 0===(e=this.fillLast(t)))return"";r=this.lastNeed,this.lastNeed=0}else r=0;return r<t.length?e?e+this.text(t,r):this.text(t,r):e||""},a.prototype.end=p,a.prototype.text=h,a.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}},{"safe-buffer":40}],57:[function(t,r,n){(function(t){(function(){function e(t,e){if(n("noDeprecation"))return t;var r=!1;function o(){if(!r){if(n("throwDeprecation"))throw new Error(e);n("traceDeprecation")?console.trace(e):console.warn(e),r=!0}return t.apply(this,arguments)}return o}function n(e){try{if(!t.localStorage)return!1}catch(n){return!1}var r=t.localStorage[e];return null!=r&&"true"===String(r).toLowerCase()}r.exports=e}).call(this)}).call(this,void 0!==e?e:"undefined"!=typeof self?self:"undefined"!=typeof window?window:{})},{}],58:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),Object.defineProperty(r,"v1",{enumerable:!0,get:function(){return n.default}}),Object.defineProperty(r,"v3",{enumerable:!0,get:function(){return o.default}}),Object.defineProperty(r,"v4",{enumerable:!0,get:function(){return i.default}}),Object.defineProperty(r,"v5",{enumerable:!0,get:function(){return s.default}}),Object.defineProperty(r,"NIL",{enumerable:!0,get:function(){return a.default}}),Object.defineProperty(r,"version",{enumerable:!0,get:function(){return u.default}}),Object.defineProperty(r,"validate",{enumerable:!0,get:function(){return c.default}}),Object.defineProperty(r,"stringify",{enumerable:!0,get:function(){return f.default}}),Object.defineProperty(r,"parse",{enumerable:!0,get:function(){return l.default}});var n=h(t("./v1.js")),o=h(t("./v3.js")),i=h(t("./v4.js")),s=h(t("./v5.js")),a=h(t("./nil.js")),u=h(t("./version.js")),c=h(t("./validate.js")),f=h(t("./stringify.js")),l=h(t("./parse.js"));function h(t){return t&&t.__esModule?t:{default:t}}},{"./nil.js":60,"./parse.js":61,"./stringify.js":65,"./v1.js":66,"./v3.js":67,"./v4.js":69,"./v5.js":70,"./validate.js":71,"./version.js":72}],59:[function(t,e,r){function n(t){if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=new Uint8Array(e.length);for(let r=0;r<e.length;++r)t[r]=e.charCodeAt(r)}return o(s(a(t),8*t.length))}function o(t){const e=[],r=32*t.length,n="0123456789abcdef";for(let o=0;o<r;o+=8){const r=t[o>>5]>>>o%32&255,i=parseInt(n.charAt(r>>>4&15)+n.charAt(15&r),16);e.push(i)}return e}function i(t){return 14+(t+64>>>9<<4)+1}function s(t,e){t[e>>5]|=128<<e%32,t[i(e)-1]=e;let r=1732584193,n=-271733879,o=-1732584194,s=271733878;for(let i=0;i<t.length;i+=16){const e=r,a=n,c=o,f=s;r=l(r,n,o,s,t[i],7,-680876936),s=l(s,r,n,o,t[i+1],12,-389564586),o=l(o,s,r,n,t[i+2],17,606105819),n=l(n,o,s,r,t[i+3],22,-1044525330),r=l(r,n,o,s,t[i+4],7,-176418897),s=l(s,r,n,o,t[i+5],12,1200080426),o=l(o,s,r,n,t[i+6],17,-1473231341),n=l(n,o,s,r,t[i+7],22,-45705983),r=l(r,n,o,s,t[i+8],7,1770035416),s=l(s,r,n,o,t[i+9],12,-1958414417),o=l(o,s,r,n,t[i+10],17,-42063),n=l(n,o,s,r,t[i+11],22,-1990404162),r=l(r,n,o,s,t[i+12],7,1804603682),s=l(s,r,n,o,t[i+13],12,-40341101),o=l(o,s,r,n,t[i+14],17,-1502002290),n=l(n,o,s,r,t[i+15],22,1236535329),r=h(r,n,o,s,t[i+1],5,-165796510),s=h(s,r,n,o,t[i+6],9,-1069501632),o=h(o,s,r,n,t[i+11],14,643717713),n=h(n,o,s,r,t[i],20,-373897302),r=h(r,n,o,s,t[i+5],5,-701558691),s=h(s,r,n,o,t[i+10],9,38016083),o=h(o,s,r,n,t[i+15],14,-660478335),n=h(n,o,s,r,t[i+4],20,-405537848),r=h(r,n,o,s,t[i+9],5,568446438),s=h(s,r,n,o,t[i+14],9,-1019803690),o=h(o,s,r,n,t[i+3],14,-187363961),n=h(n,o,s,r,t[i+8],20,1163531501),r=h(r,n,o,s,t[i+13],5,-1444681467),s=h(s,r,n,o,t[i+2],9,-51403784),o=h(o,s,r,n,t[i+7],14,1735328473),n=h(n,o,s,r,t[i+12],20,-1926607734),r=p(r,n,o,s,t[i+5],4,-378558),s=p(s,r,n,o,t[i+8],11,-2022574463),o=p(o,s,r,n,t[i+11],16,1839030562),n=p(n,o,s,r,t[i+14],23,-35309556),r=p(r,n,o,s,t[i+1],4,-1530992060),s=p(s,r,n,o,t[i+4],11,1272893353),o=p(o,s,r,n,t[i+7],16,-155497632),n=p(n,o,s,r,t[i+10],23,-1094730640),r=p(r,n,o,s,t[i+13],4,681279174),s=p(s,r,n,o,t[i],11,-358537222),o=p(o,s,r,n,t[i+3],16,-722521979),n=p(n,o,s,r,t[i+6],23,76029189),r=p(r,n,o,s,t[i+9],4,-640364487),s=p(s,r,n,o,t[i+12],11,-421815835),o=p(o,s,r,n,t[i+15],16,530742520),n=p(n,o,s,r,t[i+2],23,-995338651),r=d(r,n,o,s,t[i],6,-198630844),s=d(s,r,n,o,t[i+7],10,1126891415),o=d(o,s,r,n,t[i+14],15,-1416354905),n=d(n,o,s,r,t[i+5],21,-57434055),r=d(r,n,o,s,t[i+12],6,1700485571),s=d(s,r,n,o,t[i+3],10,-1894986606),o=d(o,s,r,n,t[i+10],15,-1051523),n=d(n,o,s,r,t[i+1],21,-2054922799),r=d(r,n,o,s,t[i+8],6,1873313359),s=d(s,r,n,o,t[i+15],10,-30611744),o=d(o,s,r,n,t[i+6],15,-1560198380),n=d(n,o,s,r,t[i+13],21,1309151649),r=d(r,n,o,s,t[i+4],6,-145523070),s=d(s,r,n,o,t[i+11],10,-1120210379),o=d(o,s,r,n,t[i+2],15,718787259),n=d(n,o,s,r,t[i+9],21,-343485551),r=u(r,e),n=u(n,a),o=u(o,c),s=u(s,f)}return[r,n,o,s]}function a(t){if(0===t.length)return[];const e=8*t.length,r=new Uint32Array(i(e));for(let n=0;n<e;n+=8)r[n>>5]|=(255&t[n/8])<<n%32;return r}function u(t,e){const r=(65535&t)+(65535&e);return(t>>16)+(e>>16)+(r>>16)<<16|65535&r}function c(t,e){return t<<e|t>>>32-e}function f(t,e,r,n,o,i){return u(c(u(u(e,t),u(n,i)),o),r)}function l(t,e,r,n,o,i,s){return f(e&r|~e&n,t,e,o,i,s)}function h(t,e,r,n,o,i,s){return f(e&n|r&~n,t,e,o,i,s)}function p(t,e,r,n,o,i,s){return f(e^r^n,t,e,o,i,s)}function d(t,e,r,n,o,i,s){return f(r^(e|~n),t,e,o,i,s)}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var y=n;r.default=y},{}],60:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n="00000000-0000-0000-0000-000000000000";r.default=n},{}],61:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(t("./validate.js"));function o(t){return t&&t.__esModule?t:{default:t}}function i(t){if(!(0,n.default)(t))throw TypeError("Invalid UUID");let e;const r=new Uint8Array(16);return r[0]=(e=parseInt(t.slice(0,8),16))>>>24,r[1]=e>>>16&255,r[2]=e>>>8&255,r[3]=255&e,r[4]=(e=parseInt(t.slice(9,13),16))>>>8,r[5]=255&e,r[6]=(e=parseInt(t.slice(14,18),16))>>>8,r[7]=255&e,r[8]=(e=parseInt(t.slice(19,23),16))>>>8,r[9]=255&e,r[10]=(e=parseInt(t.slice(24,36),16))/1099511627776&255,r[11]=e/4294967296&255,r[12]=e>>>24&255,r[13]=e>>>16&255,r[14]=e>>>8&255,r[15]=255&e,r}var s=i;r.default=s},{"./validate.js":71}],62:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=/^(?:[0-9a-f]{8}-[0-9a-f]{4}-[1-5][0-9a-f]{3}-[89ab][0-9a-f]{3}-[0-9a-f]{12}|00000000-0000-0000-0000-000000000000)$/i;r.default=n},{}],63:[function(t,e,r){let n;Object.defineProperty(r,"__esModule",{value:!0}),r.default=i;const o=new Uint8Array(16);function i(){if(!n&&(n="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto),!n))throw new Error("crypto.getRandomValues() not supported. See https://github.com/uuidjs/uuid#getrandomvalues-not-supported");return n(o)}},{}],64:[function(t,e,r){function n(t,e,r,n){switch(t){case 0:return e&r^~e&n;case 1:case 3:return e^r^n;case 2:return e&r^e&n^r&n}}function o(t,e){return t<<e|t>>>32-e}function i(t){const e=[1518500249,1859775393,2400959708,3395469782],r=[1732584193,4023233417,2562383102,271733878,3285377520];if("string"==typeof t){const e=unescape(encodeURIComponent(t));t=[];for(let r=0;r<e.length;++r)t.push(e.charCodeAt(r))}else Array.isArray(t)||(t=Array.prototype.slice.call(t));t.push(128);const i=t.length/4+2,s=Math.ceil(i/16),a=new Array(s);for(let n=0;n<s;++n){const e=new Uint32Array(16);for(let r=0;r<16;++r)e[r]=t[64*n+4*r]<<24|t[64*n+4*r+1]<<16|t[64*n+4*r+2]<<8|t[64*n+4*r+3];a[n]=e}a[s-1][14]=8*(t.length-1)/Math.pow(2,32),a[s-1][14]=Math.floor(a[s-1][14]),a[s-1][15]=8*(t.length-1)&4294967295;for(let u=0;u<s;++u){const t=new Uint32Array(80);for(let e=0;e<16;++e)t[e]=a[u][e];for(let e=16;e<80;++e)t[e]=o(t[e-3]^t[e-8]^t[e-14]^t[e-16],1);let i=r[0],s=r[1],c=r[2],f=r[3],l=r[4];for(let r=0;r<80;++r){const a=Math.floor(r/20),u=o(i,5)+n(a,s,c,f)+l+e[a]+t[r]>>>0;l=f,f=c,c=o(s,30)>>>0,s=i,i=u}r[0]=r[0]+i>>>0,r[1]=r[1]+s>>>0,r[2]=r[2]+c>>>0,r[3]=r[3]+f>>>0,r[4]=r[4]+l>>>0}return[r[0]>>24&255,r[0]>>16&255,r[0]>>8&255,255&r[0],r[1]>>24&255,r[1]>>16&255,r[1]>>8&255,255&r[1],r[2]>>24&255,r[2]>>16&255,r[2]>>8&255,255&r[2],r[3]>>24&255,r[3]>>16&255,r[3]>>8&255,255&r[3],r[4]>>24&255,r[4]>>16&255,r[4]>>8&255,255&r[4]]}Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var s=i;r.default=s},{}],65:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(t("./validate.js"));function o(t){return t&&t.__esModule?t:{default:t}}const i=[];for(let u=0;u<256;++u)i.push((u+256).toString(16).substr(1));function s(t,e=0){const r=(i[t[e+0]]+i[t[e+1]]+i[t[e+2]]+i[t[e+3]]+"-"+i[t[e+4]]+i[t[e+5]]+"-"+i[t[e+6]]+i[t[e+7]]+"-"+i[t[e+8]]+i[t[e+9]]+"-"+i[t[e+10]]+i[t[e+11]]+i[t[e+12]]+i[t[e+13]]+i[t[e+14]]+i[t[e+15]]).toLowerCase();if(!(0,n.default)(r))throw TypeError("Stringified UUID is invalid");return r}var a=s;r.default=a},{"./validate.js":71}],66:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("./rng.js")),o=i(t("./stringify.js"));function i(t){return t&&t.__esModule?t:{default:t}}let s,a,u=0,c=0;function f(t,e,r){let i=e&&r||0;const f=e||new Array(16);let l=(t=t||{}).node||s,h=void 0!==t.clockseq?t.clockseq:a;if(null==l||null==h){const e=t.random||(t.rng||n.default)();null==l&&(l=s=[1|e[0],e[1],e[2],e[3],e[4],e[5]]),null==h&&(h=a=16383&(e[6]<<8|e[7]))}let p=void 0!==t.msecs?t.msecs:Date.now(),d=void 0!==t.nsecs?t.nsecs:c+1;const y=p-u+(d-c)/1e4;if(y<0&&void 0===t.clockseq&&(h=h+1&16383),(y<0||p>u)&&void 0===t.nsecs&&(d=0),d>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=p,c=d,a=h,p+=122192928e5;const b=(1e4*(268435455&p)+d)%4294967296;f[i++]=b>>>24&255,f[i++]=b>>>16&255,f[i++]=b>>>8&255,f[i++]=255&b;const v=p/4294967296*1e4&268435455;f[i++]=v>>>8&255,f[i++]=255&v,f[i++]=v>>>24&15|16,f[i++]=v>>>16&255,f[i++]=h>>>8|128,f[i++]=255&h;for(let n=0;n<6;++n)f[i+n]=l[n];return e||(0,o.default)(f)}var l=f;r.default=l},{"./rng.js":63,"./stringify.js":65}],67:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("./v35.js")),o=i(t("./md5.js"));function i(t){return t&&t.__esModule?t:{default:t}}var s=(0,n.default)("v3",48,o.default);r.default=s},{"./md5.js":59,"./v35.js":68}],68:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=c,r.URL=r.DNS=void 0;var n=i(t("./stringify.js")),o=i(t("./parse.js"));function i(t){return t&&t.__esModule?t:{default:t}}function s(t){t=unescape(encodeURIComponent(t));const e=[];for(let r=0;r<t.length;++r)e.push(t.charCodeAt(r));return e}const a="6ba7b810-9dad-11d1-80b4-00c04fd430c8";r.DNS=a;const u="6ba7b811-9dad-11d1-80b4-00c04fd430c8";function c(t,e,r){function i(t,i,a,u){if("string"==typeof t&&(t=s(t)),"string"==typeof i&&(i=(0,o.default)(i)),16!==i.length)throw TypeError("Namespace must be array-like (16 iterable integer values, 0-255)");let c=new Uint8Array(16+t.length);if(c.set(i),c.set(t,i.length),c=r(c),c[6]=15&c[6]|e,c[8]=63&c[8]|128,a){u=u||0;for(let t=0;t<16;++t)a[u+t]=c[t];return a}return(0,n.default)(c)}try{i.name=t}catch(c){}return i.DNS=a,i.URL=u,i}r.URL=u},{"./parse.js":61,"./stringify.js":65}],69:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("./rng.js")),o=i(t("./stringify.js"));function i(t){return t&&t.__esModule?t:{default:t}}function s(t,e,r){const i=(t=t||{}).random||(t.rng||n.default)();if(i[6]=15&i[6]|64,i[8]=63&i[8]|128,e){r=r||0;for(let t=0;t<16;++t)e[r+t]=i[t];return e}return(0,o.default)(i)}var a=s;r.default=a},{"./rng.js":63,"./stringify.js":65}],70:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=i(t("./v35.js")),o=i(t("./sha1.js"));function i(t){return t&&t.__esModule?t:{default:t}}var s=(0,n.default)("v5",80,o.default);r.default=s},{"./sha1.js":64,"./v35.js":68}],71:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(t("./regex.js"));function o(t){return t&&t.__esModule?t:{default:t}}function i(t){return"string"==typeof t&&n.default.test(t)}var s=i;r.default=s},{"./regex.js":62}],72:[function(t,e,r){Object.defineProperty(r,"__esModule",{value:!0}),r.default=void 0;var n=o(t("./validate.js"));function o(t){return t&&t.__esModule?t:{default:t}}function i(t){if(!(0,n.default)(t))throw TypeError("Invalid UUID");return parseInt(t.substr(14,1),16)}var s=i;r.default=s},{"./validate.js":71}]},{},[9])(9)),Df.exports}var Nf,qf={};var Hf,Ff={exports:{}};function Wf(){return Hf||(Hf=1,function(t,r){var n,o="undefined"!=typeof globalThis&&globalThis||"undefined"!=typeof self&&self||void 0!==e&&e,i=function(){function t(){this.fetch=!1,this.DOMException=o.DOMException}return t.prototype=o,new t}();n=i,function(t){var r=void 0!==n&&n||"undefined"!=typeof self&&self||void 0!==e&&e||{},o="URLSearchParams"in r,i="Symbol"in r&&"iterator"in Symbol,s="FileReader"in r&&"Blob"in r&&function(){try{return new Blob,!0}catch(t){return!1}}(),a="FormData"in r,u="ArrayBuffer"in r;if(u)var c=["[object Int8Array]","[object Uint8Array]","[object Uint8ClampedArray]","[object Int16Array]","[object Uint16Array]","[object Int32Array]","[object Uint32Array]","[object Float32Array]","[object Float64Array]"],f=ArrayBuffer.isView||function(t){return t&&c.indexOf(Object.prototype.toString.call(t))>-1};function l(t){if("string"!=typeof t&&(t=String(t)),/[^a-z0-9\-#$%&'*+.^_`|~!]/i.test(t)||""===t)throw new TypeError('Invalid character in header field name: "'+t+'"');return t.toLowerCase()}function h(t){return"string"!=typeof t&&(t=String(t)),t}function p(t){var e={next:function(){var e=t.shift();return{done:void 0===e,value:e}}};return i&&(e[Symbol.iterator]=function(){return e}),e}function d(t){this.map={},t instanceof d?t.forEach(function(t,e){this.append(e,t)},this):Array.isArray(t)?t.forEach(function(t){if(2!=t.length)throw new TypeError("Headers constructor: expected name/value pair to be length 2, found"+t.length);this.append(t[0],t[1])},this):t&&Object.getOwnPropertyNames(t).forEach(function(e){this.append(e,t[e])},this)}function y(t){if(!t._noBody)return t.bodyUsed?Promise.reject(new TypeError("Already read")):void(t.bodyUsed=!0)}function b(t){return new Promise(function(e,r){t.onload=function(){e(t.result)},t.onerror=function(){r(t.error)}})}function v(t){var e=new FileReader,r=b(e);return e.readAsArrayBuffer(t),r}function m(t){if(t.slice)return t.slice(0);var e=new Uint8Array(t.byteLength);return e.set(new Uint8Array(t)),e.buffer}function g(){return this.bodyUsed=!1,this._initBody=function(t){var e;this.bodyUsed=this.bodyUsed,this._bodyInit=t,t?"string"==typeof t?this._bodyText=t:s&&Blob.prototype.isPrototypeOf(t)?this._bodyBlob=t:a&&FormData.prototype.isPrototypeOf(t)?this._bodyFormData=t:o&&URLSearchParams.prototype.isPrototypeOf(t)?this._bodyText=t.toString():u&&s&&(e=t)&&DataView.prototype.isPrototypeOf(e)?(this._bodyArrayBuffer=m(t.buffer),this._bodyInit=new Blob([this._bodyArrayBuffer])):u&&(ArrayBuffer.prototype.isPrototypeOf(t)||f(t))?this._bodyArrayBuffer=m(t):this._bodyText=t=Object.prototype.toString.call(t):(this._noBody=!0,this._bodyText=""),this.headers.get("content-type")||("string"==typeof t?this.headers.set("content-type","text/plain;charset=UTF-8"):this._bodyBlob&&this._bodyBlob.type?this.headers.set("content-type",this._bodyBlob.type):o&&URLSearchParams.prototype.isPrototypeOf(t)&&this.headers.set("content-type","application/x-www-form-urlencoded;charset=UTF-8"))},s&&(this.blob=function(){var t=y(this);if(t)return t;if(this._bodyBlob)return Promise.resolve(this._bodyBlob);if(this._bodyArrayBuffer)return Promise.resolve(new Blob([this._bodyArrayBuffer]));if(this._bodyFormData)throw new Error("could not read FormData body as blob");return Promise.resolve(new Blob([this._bodyText]))}),this.arrayBuffer=function(){if(this._bodyArrayBuffer){var t=y(this);return t||(ArrayBuffer.isView(this._bodyArrayBuffer)?Promise.resolve(this._bodyArrayBuffer.buffer.slice(this._bodyArrayBuffer.byteOffset,this._bodyArrayBuffer.byteOffset+this._bodyArrayBuffer.byteLength)):Promise.resolve(this._bodyArrayBuffer))}if(s)return this.blob().then(v);throw new Error("could not read as ArrayBuffer")},this.text=function(){var t,e,r,n,o,i=y(this);if(i)return i;if(this._bodyBlob)return t=this._bodyBlob,e=new FileReader,r=b(e),n=/charset=([A-Za-z0-9_-]+)/.exec(t.type),o=n?n[1]:"utf-8",e.readAsText(t,o),r;if(this._bodyArrayBuffer)return Promise.resolve(function(t){for(var e=new Uint8Array(t),r=new Array(e.length),n=0;n<e.length;n++)r[n]=String.fromCharCode(e[n]);return r.join("")}(this._bodyArrayBuffer));if(this._bodyFormData)throw new Error("could not read FormData body as text");return Promise.resolve(this._bodyText)},a&&(this.formData=function(){return this.text().then(S)}),this.json=function(){return this.text().then(JSON.parse)},this}d.prototype.append=function(t,e){t=l(t),e=h(e);var r=this.map[t];this.map[t]=r?r+", "+e:e},d.prototype.delete=function(t){delete this.map[l(t)]},d.prototype.get=function(t){return t=l(t),this.has(t)?this.map[t]:null},d.prototype.has=function(t){return this.map.hasOwnProperty(l(t))},d.prototype.set=function(t,e){this.map[l(t)]=h(e)},d.prototype.forEach=function(t,e){for(var r in this.map)this.map.hasOwnProperty(r)&&t.call(e,this.map[r],r,this)},d.prototype.keys=function(){var t=[];return this.forEach(function(e,r){t.push(r)}),p(t)},d.prototype.values=function(){var t=[];return this.forEach(function(e){t.push(e)}),p(t)},d.prototype.entries=function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),p(t)},i&&(d.prototype[Symbol.iterator]=d.prototype.entries);var w=["CONNECT","DELETE","GET","HEAD","OPTIONS","PATCH","POST","PUT","TRACE"];function _(t,e){if(!(this instanceof _))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');var n,o,i=(e=e||{}).body;if(t instanceof _){if(t.bodyUsed)throw new TypeError("Already read");this.url=t.url,this.credentials=t.credentials,e.headers||(this.headers=new d(t.headers)),this.method=t.method,this.mode=t.mode,this.signal=t.signal,i||null==t._bodyInit||(i=t._bodyInit,t.bodyUsed=!0)}else this.url=String(t);if(this.credentials=e.credentials||this.credentials||"same-origin",!e.headers&&this.headers||(this.headers=new d(e.headers)),this.method=(n=e.method||this.method||"GET",o=n.toUpperCase(),w.indexOf(o)>-1?o:n),this.mode=e.mode||this.mode||null,this.signal=e.signal||this.signal||function(){if("AbortController"in r)return(new AbortController).signal}(),this.referrer=null,("GET"===this.method||"HEAD"===this.method)&&i)throw new TypeError("Body not allowed for GET or HEAD requests");if(this._initBody(i),!("GET"!==this.method&&"HEAD"!==this.method||"no-store"!==e.cache&&"no-cache"!==e.cache)){var s=/([?&])_=[^&]*/;s.test(this.url)?this.url=this.url.replace(s,"$1_="+(new Date).getTime()):this.url+=(/\?/.test(this.url)?"&":"?")+"_="+(new Date).getTime()}}function S(t){var e=new FormData;return t.trim().split("&").forEach(function(t){if(t){var r=t.split("="),n=r.shift().replace(/\+/g," "),o=r.join("=").replace(/\+/g," ");e.append(decodeURIComponent(n),decodeURIComponent(o))}}),e}function x(t,e){if(!(this instanceof x))throw new TypeError('Please use the "new" operator, this DOM object constructor cannot be called as a function.');if(e||(e={}),this.type="default",this.status=void 0===e.status?200:e.status,this.status<200||this.status>599)throw new RangeError("Failed to construct 'Response': The status provided (0) is outside the range [200, 599].");this.ok=this.status>=200&&this.status<300,this.statusText=void 0===e.statusText?"":""+e.statusText,this.headers=new d(e.headers),this.url=e.url||"",this._initBody(t)}_.prototype.clone=function(){return new _(this,{body:this._bodyInit})},g.call(_.prototype),g.call(x.prototype),x.prototype.clone=function(){return new x(this._bodyInit,{status:this.status,statusText:this.statusText,headers:new d(this.headers),url:this.url})},x.error=function(){var t=new x(null,{status:200,statusText:""});return t.ok=!1,t.status=0,t.type="error",t};var O=[301,302,303,307,308];x.redirect=function(t,e){if(-1===O.indexOf(e))throw new RangeError("Invalid status code");return new x(null,{status:e,headers:{location:t}})},t.DOMException=r.DOMException;try{new t.DOMException}catch(T){t.DOMException=function(t,e){this.message=t,this.name=e;var r=Error(t);this.stack=r.stack},t.DOMException.prototype=Object.create(Error.prototype),t.DOMException.prototype.constructor=t.DOMException}function E(e,n){return new Promise(function(o,i){var a=new _(e,n);if(a.signal&&a.signal.aborted)return i(new t.DOMException("Aborted","AbortError"));var c=new XMLHttpRequest;function f(){c.abort()}if(c.onload=function(){var t,e,r={statusText:c.statusText,headers:(t=c.getAllResponseHeaders()||"",e=new d,t.replace(/\r?\n[\t ]+/g," ").split("\r").map(function(t){return 0===t.indexOf("\n")?t.substr(1,t.length):t}).forEach(function(t){var r=t.split(":"),n=r.shift().trim();if(n){var o=r.join(":").trim();try{e.append(n,o)}catch(i){console.warn("Response "+i.message)}}}),e)};0===a.url.indexOf("file://")&&(c.status<200||c.status>599)?r.status=200:r.status=c.status,r.url="responseURL"in c?c.responseURL:r.headers.get("X-Request-URL");var n="response"in c?c.response:c.responseText;setTimeout(function(){o(new x(n,r))},0)},c.onerror=function(){setTimeout(function(){i(new TypeError("Network request failed"))},0)},c.ontimeout=function(){setTimeout(function(){i(new TypeError("Network request timed out"))},0)},c.onabort=function(){setTimeout(function(){i(new t.DOMException("Aborted","AbortError"))},0)},c.open(a.method,function(t){try{return""===t&&r.location.href?r.location.href:t}catch(e){return t}}(a.url),!0),"include"===a.credentials?c.withCredentials=!0:"omit"===a.credentials&&(c.withCredentials=!1),"responseType"in c&&(s?c.responseType="blob":u&&(c.responseType="arraybuffer")),n&&"object"==typeof n.headers&&!(n.headers instanceof d||r.Headers&&n.headers instanceof r.Headers)){var p=[];Object.getOwnPropertyNames(n.headers).forEach(function(t){p.push(l(t)),c.setRequestHeader(t,h(n.headers[t]))}),a.headers.forEach(function(t,e){-1===p.indexOf(e)&&c.setRequestHeader(e,t)})}else a.headers.forEach(function(t,e){c.setRequestHeader(e,t)});a.signal&&(a.signal.addEventListener("abort",f),c.onreadystatechange=function(){4===c.readyState&&a.signal.removeEventListener("abort",f)}),c.send(void 0===a._bodyInit?null:a._bodyInit)})}E.polyfill=!0,r.fetch||(r.fetch=E,r.Headers=d,r.Request=_,r.Response=x),t.Headers=d,t.Request=_,t.Response=x,t.fetch=E,Object.defineProperty(t,"__esModule",{value:!0})}({}),i.fetch.ponyfill=!0,delete i.fetch.polyfill;var s=o.fetch?o:i;(r=s.fetch).default=s.fetch,r.fetch=s.fetch,r.Headers=s.Headers,r.Request=s.Request,r.Response=s.Response,t.exports=r}(Ff,Ff.exports)),Ff.exports}var $f,Gf={},zf={exports:{}};function Vf(){return $f||($f=1,(t=zf).exports=function(t){if(void 0===t)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return t},t.exports.__esModule=!0,t.exports.default=t.exports),zf.exports;var t}var Jf,Yf,Xf,Kf={exports:{}},Qf={exports:{}},Zf={exports:{}};function tl(){return Jf||(Jf=1,function(t){function e(r){return t.exports=e=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(t){return t.__proto__||Object.getPrototypeOf(t)},t.exports.__esModule=!0,t.exports.default=t.exports,e(r)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(Zf)),Zf.exports}function el(){return Xf||(Xf=1,function(t){var e=function(){return Yf||(Yf=1,t=Qf,e=tl(),t.exports=function(t,r){for(;!{}.hasOwnProperty.call(t,r)&&null!==(t=e(t)););return t},t.exports.__esModule=!0,t.exports.default=t.exports),Qf.exports;var t,e}();function r(){return t.exports=r="undefined"!=typeof Reflect&&Reflect.get?Reflect.get.bind():function(t,r,n){var o=e(t,r);if(o){var i=Object.getOwnPropertyDescriptor(o,r);return i.get?i.get.call(arguments.length<3?t:n):i.value}},t.exports.__esModule=!0,t.exports.default=t.exports,r.apply(null,arguments)}t.exports=r,t.exports.__esModule=!0,t.exports.default=t.exports}(Kf)),Kf.exports}var rl,nl,ol={exports:{}},il={exports:{}};function sl(){return nl||(nl=1,t=ol,rl||(rl=1,function(t){function e(r,n){return t.exports=e=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(t,e){return t.__proto__=e,t},t.exports.__esModule=!0,t.exports.default=t.exports,e(r,n)}t.exports=e,t.exports.__esModule=!0,t.exports.default=t.exports}(il)),e=il.exports,t.exports=function(t,r){if("function"!=typeof r&&null!==r)throw new TypeError("Super expression must either be null or a function");t.prototype=Object.create(r&&r.prototype,{constructor:{value:t,writable:!0,configurable:!0}}),Object.defineProperty(t,"prototype",{writable:!1}),r&&e(t,r)},t.exports.__esModule=!0,t.exports.default=t.exports),ol.exports;var t,e}var al,ul,cl,fl,ll={exports:{}};function hl(){return ul||(ul=1,function(t){var e=s();Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var r,n,o,i=e(v()),a=e(E()),u=e(Vf()),f=e(el()),l=e(sl()),h=e((al||(al=1,r=ll,n=c().default,o=Vf(),r.exports=function(t,e){if(e&&("object"==n(e)||"function"==typeof e))return e;if(void 0!==e)throw new TypeError("Derived constructors may only return object or undefined");return o(t)},r.exports.__esModule=!0,r.exports.default=r.exports),ll.exports)),p=e(tl()),d=e(pf()),y=e(mf()),b=Uf();function m(t){var e=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(t){return!1}}();return function(){var r,n=(0,p.default)(t);if(e){var o=(0,p.default)(this).constructor;r=Reflect.construct(n,arguments,o)}else r=n.apply(this,arguments);return(0,h.default)(this,r)}}var g=new WeakMap,w=new WeakMap,_=new WeakMap,S=new WeakMap,x=function(t){(0,l.default)(r,t);var e=m(r);function r(t){var n,o=t.disconnectionHandler,s=t.networkInformation,a=t.requestHandler,c=t.url;return(0,i.default)(this,r),n=e.call(this,{disconnectionHandler:o,requestHandler:a,url:c}),g.set((0,u.default)(n),{writable:!0,value:!1}),w.set((0,u.default)(n),{writable:!0,value:function(){return(0,d.default)((0,u.default)(n),_)===(0,d.default)((0,u.default)(n),S).type||n.disconnect()}}),_.set((0,u.default)(n),{writable:!0,value:void 0}),S.set((0,u.default)(n),{writable:!0,value:void 0}),(0,y.default)((0,u.default)(n),S,s),n}return(0,a.default)(r,[{key:"connect",value:function(){if((0,d.default)(this,g))return console.warn("botframework-directlinejs: connect() can only be called once."),Promise.resolve();if((0,y.default)(this,g,!0),(0,d.default)(this,S)){var t=(0,d.default)(this,S).type;if((0,y.default)(this,_,t),"none"===t)return console.warn("botframework-directlinejs: Failed to connect while offline."),Promise.reject(new Error("botframework-directlinejs: Failed to connect while offline."));(0,d.default)(this,S).addEventListener("change",(0,d.default)(this,w))}return(0,f.default)((0,p.default)(r.prototype),"connect",this).call(this)}},{key:"disconnect",value:function(){var t;null===(t=(0,d.default)(this,S))||void 0===t||t.removeEventListener("change",(0,d.default)(this,w)),(0,f.default)((0,p.default)(r.prototype),"disconnect",this).call(this)}}]),r}(b.WebSocketClient);t.default=x}(Gf)),Gf}function pl(){if(cl)return tf;cl=1;var t=s(),e=c();Object.defineProperty(tf,"__esModule",{value:!0}),tf.DirectLineStreaming=void 0;var r=t(d()),n=t(function(){if(Zc)return Qc;Zc=1;var t=rf()();Qc=t;try{regeneratorRuntime=t}catch(e){"object"==typeof globalThis?globalThis.regeneratorRuntime=t:Function("r","regeneratorRuntime = r")(t)}return Qc}()),o=t(pf()),i=t(mf()),a=t(Ef()),u=t((Tf||(Tf=1,function(t){function e(t,e,r,n,o,i,s){try{var a=t[i](s),u=a.value}catch(c){return void r(c)}a.done?e(u):Promise.resolve(u).then(n,o)}t.exports=function(t){return function(){var r=this,n=arguments;return new Promise(function(o,i){var s=t.apply(r,n);function a(t){e(s,o,i,a,u,"next",t)}function u(t){e(s,o,i,a,u,"throw",t)}a(void 0)})}},t.exports.__esModule=!0,t.exports.default=t.exports}(kf)),kf.exports)),f=t(v()),l=t(E()),h=t(j()),p=Gi(),y=Lf(),b=Bi(),m=function(t,r){if(t&&t.__esModule)return t;if(null===t||"object"!==e(t)&&"function"!=typeof t)return{default:t};var n=O(r);if(n&&n.has(t))return n.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=i?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=t[s]}o.default=t,n&&n.set(t,o);return o}(Uf()),g=t((Nf||(Nf=1,function(t){Object.defineProperty(t,"__esModule",{value:!0}),t.default=void 0;var e=function(){var t={};return t.promise=new Promise(function(e,r){t.reject=r,t.resolve=e}),t};t.default=e}(qf)),qf)),w=t(Wf()),_=dl(),S=t(hl()),x=["attachments"];function O(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(O=function(t){return t?r:e})(t)}var T=function(){function t(e,r,n){(0,f.default)(this,t),(0,h.default)(this,"activityQueue",[]),this.subscriber=e,this.connectionStatus$=r,this.shouldQueue=n}var e;return(0,l.default)(t,[{key:"setSubscriber",value:function(t){this.subscriber=t}},{key:"processRequest",value:(e=(0,u.default)(n.default.mark(function t(e,r){var o,i,s,u,c,f,l,h,p;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return o=(0,a.default)(e.streams),i=o.shift(),t.next=4,i.readAsString();case 4:if(s=t.sent,1===(u=JSON.parse(s)).activities.length){t.next=9;break}return this.subscriber.error(new Error("there should be exactly one activity")),t.abrupt("return",m.StreamingResponse.create(500));case 9:if(c=u.activities[0],!(o.length>0)){t.next=21;break}f=(0,a.default)(c.attachments);case 12:if(!(l=o.shift())){t.next=20;break}return t.next=15,l.readAsString();case 15:h=t.sent,p="data:text/plain;base64,"+h,f.push({contentType:l.contentType,contentUrl:p}),t.next=12;break;case 20:c.attachments=f;case 21:return this.shouldQueue()?this.activityQueue.push(c):this.subscriber.next(c),t.abrupt("return",m.StreamingResponse.create(200));case 23:case"end":return t.stop()}},t,this)})),function(t,r){return e.apply(this,arguments)})},{key:"flush",value:function(){var t=this;this.connectionStatus$.subscribe(function(){}),this.activityQueue.forEach(function(e){return t.subscriber.next(e)}),this.activityQueue=[]}},{key:"end",value:function(){this.subscriber.complete()}}]),t}(),k=new WeakMap,P=function(){function t(e){var r=this;(0,f.default)(this,t),(0,h.default)(this,"connectionStatus$",new p.BehaviorSubject(_.ConnectionStatus.Uninitialized)),(0,h.default)(this,"_botAgent",""),k.set(this,{writable:!0,value:void 0});var o=null==e?void 0:e.networkInformation;void 0===o||"function"==typeof o.addEventListener&&"function"==typeof o.removeEventListener&&"string"==typeof o.type?(0,i.default)(this,k,o):console.warn('botframework-directlinejs: "networkInformation" option specified must be a `NetworkInformation`-like instance extending `EventTarget` interface with a `type` property returning a string.'),this.token=e.token,this.refreshToken().catch(function(){r.connectionStatus$.next(_.ConnectionStatus.ExpiredToken)}),this.domain=e.domain,e.conversationId&&(this.conversationId=e.conversationId),this._botAgent=this.getBotAgent(e.botAgent),this.queueActivities=!0,this.activity$=b.Observable.create(function(){var t=(0,u.default)(n.default.mark(function t(e){return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:r.activitySubscriber=e,r.theStreamHandler=new T(e,r.connectionStatus$,function(){return r.queueActivities}),r.connectDeferred.resolve();case 3:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()).share(),this.connectWithRetryAsync()}var e,s,a,c;return(0,l.default)(t,[{key:"reconnect",value:function(t){var e=t.conversationId,r=t.token;if(this.connectionStatus$.getValue()===_.ConnectionStatus.Ended)throw new Error("Connection has ended.");this.conversationId=e,this.token=r,this.connectDeferred.resolve()}},{key:"end",value:function(){this.activitySubscriber.complete(),this.connectionStatus$.next(_.ConnectionStatus.Ended),this.connectionStatus$.complete(),this.streamConnection.disconnect()}},{key:"commonHeaders",value:function(){return{Authorization:"Bearer ".concat(this.token),"x-ms-bot-agent":this._botAgent}}},{key:"getBotAgent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="directlineStreaming";return t&&(e+="; ".concat(t)),"".concat("DirectLine/3.0"," (").concat(e,")")}},{key:"refreshToken",value:(c=(0,u.default)(n.default.mark(function t(){var e,r,o,i;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=4,this.waitUntilOnline();case 4:e=0;case 5:if(!(e<3)){t.next=30;break}return e++,t.next=9,new Promise(function(t){return setTimeout(t,9e5)});case 9:return t.prev=9,t.next=12,(0,w.default)("".concat(this.domain,"/tokens/refresh"),{method:"POST",headers:this.commonHeaders()});case 12:if(!(r=t.sent).ok){t.next=22;break}return e=0,t.next=17,r.json();case 17:o=t.sent,i=o.token,this.token=i,t.next=23;break;case 22:403===r.status||403===r.status?(console.error("Fatal error while refreshing the token: ".concat(r.status," ").concat(r.statusText)),this.streamConnection.disconnect()):console.warn("Refresh attempt #".concat(e," failed: ").concat(r.status," ").concat(r.statusText));case 23:t.next=28;break;case 25:t.prev=25,t.t0=t.catch(9),console.warn("Refresh attempt #".concat(e," threw an exception: ").concat(t.t0));case 28:t.next=5;break;case 30:console.error("Retries exhausted"),this.streamConnection.disconnect();case 32:case"end":return t.stop()}},t,this,[[9,25]])})),function(){return c.apply(this,arguments)})},{key:"postActivity",value:function(t){var e=this;if(this.connectionStatus$.value===_.ConnectionStatus.Ended||this.connectionStatus$.value===_.ConnectionStatus.FailedToConnect)return b.Observable.throw(new Error("Connection is closed"));if("message"===t.type&&t.attachments&&t.attachments.length>0)return this.postMessageWithAttachments(t);var r=b.Observable.create(function(){var r=(0,u.default)(n.default.mark(function r(o){var i,s,a,u,c,f;return n.default.wrap(function(r){for(;;)switch(r.prev=r.next){case 0:return(i=m.StreamingRequest.create("POST","/v3/directline/conversations/"+e.conversationId+"/activities")).setBody(JSON.stringify(t)),r.prev=2,r.next=5,e.streamConnection.send(i);case 5:if(200===(s=r.sent).statusCode){r.next=8;break}throw new Error("PostActivity returned "+s.statusCode);case 8:if(1===(a=s.streams.length)){r.next=11;break}throw new Error("Expected one stream but got "+a);case 11:return r.next=13,s.streams[0].readAsString();case 13:return u=r.sent,c=JSON.parse(u),f=c.Id,o.next(f),r.abrupt("return",o.complete());case 19:return r.prev=19,r.t0=r.catch(2),console.warn(r.t0),e.streamConnection.disconnect(),r.abrupt("return",o.error(r.t0));case 24:case"end":return r.stop()}},r,null,[[2,19]])}));return function(t){return r.apply(this,arguments)}}());return r}},{key:"postMessageWithAttachments",value:function(t){var e=this,o=t.attachments,i=(0,r.default)(t,x);return b.Observable.create(function(t){var r=[];(0,u.default)(n.default.mark(function s(){var a,c,f,l,h,p;return n.default.wrap(function(s){for(;;)switch(s.prev=s.next){case 0:return s.prev=0,s.next=3,Promise.all(o.map(function(){var t=(0,u.default)(n.default.mark(function t(e){var r,o;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return r=e,t.next=3,(0,w.default)(r.contentUrl);case 3:if(!(o=t.sent).ok){t.next=12;break}return t.next=7,o.arrayBuffer();case 7:return t.t0=t.sent,t.t1=r,t.abrupt("return",{arrayBuffer:t.t0,media:t.t1});case 12:throw new Error("...");case 13:case"end":return t.stop()}},t)}));return function(e){return t.apply(this,arguments)}}()));case 3:return s.sent.forEach(function(t){var e=t.arrayBuffer,n=t.media,o=y.Buffer.from(e),i=new m.SubscribableStream;i.write(o);var s=new m.HttpContent({type:n.contentType,contentLength:o.length},i);r.push(s)}),a="/v3/directline/conversations/".concat(e.conversationId,"/users/").concat(i.from.id,"/upload"),c=m.StreamingRequest.create("PUT",a),(f=new m.SubscribableStream).write(JSON.stringify(i),"utf-8"),c.addStream(new m.HttpContent({type:"application/vnd.microsoft.activity",contentLength:f.length},f)),r.forEach(function(t){return c.addStream(t)}),s.next=13,e.streamConnection.send(c);case 13:if(!(l=s.sent).streams||1===l.streams.length){s.next=18;break}t.error(new Error("Invalid stream count ".concat(l.streams.length))),s.next=24;break;case 18:return s.next=20,l.streams[0].readAsJson();case 20:h=s.sent,p=h.Id,t.next(p),t.complete();case 24:s.next=29;break;case 26:s.prev=26,s.t0=s.catch(0),t.error(s.t0);case 29:case"end":return s.stop()}},s,null,[[0,26]])}))()})}},{key:"waitUntilOnline",value:(a=(0,u.default)(n.default.mark(function t(){var e=this;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.abrupt("return",new Promise(function(t,r){e.connectionStatus$.subscribe(function(e){if(e===_.ConnectionStatus.Online)return t()},function(t){return r(t)})}));case 1:case"end":return t.stop()}},t)})),function(){return a.apply(this,arguments)})},{key:"connectAsync",value:(s=(0,u.default)(n.default.mark(function t(){var e,r,i,s,a,c=this;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:if((e=new RegExp("^http(s?)")).test(this.domain)){t.next=3;break}throw"Domain must begin with http or https";case 3:return r={token:this.token},this.conversationId&&(r.conversationId=this.conversationId),i=new AbortController,s=new URLSearchParams(r).toString(),a="".concat(this.domain.replace(e,"ws$1"),"/conversations/connect?").concat(s),t.abrupt("return",new Promise(function(){var t=(0,u.default)(n.default.mark(function t(e,r){var s,u,f,l;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.prev=0,c.streamConnection=new S.default({disconnectionHandler:e,networkInformation:(0,o.default)(c,k),requestHandler:{processRequest:function(t){if(i.signal.aborted)throw new Error("Cannot process streaming request, `streamingConnection` should be disconnected.");return c.theStreamHandler.processRequest(t)}},url:a}),c.queueActivities=!0,t.next=5,c.streamConnection.connect();case 5:return s=m.StreamingRequest.create("POST","/v3/directline/conversations"),t.next=8,c.streamConnection.send(s);case 8:if(200===(u=t.sent).statusCode){t.next=11;break}throw new Error("Connection response code "+u.statusCode);case 11:if(1===u.streams.length){t.next=13;break}throw new Error("Expected 1 stream but got "+u.streams.length);case 13:return t.next=15,u.streams[0].readAsString();case 15:return f=t.sent,l=JSON.parse(f),c.conversationId=l.conversationId,c.connectionStatus$.next(_.ConnectionStatus.Online),t.next=21,c.waitUntilOnline();case 21:c.theStreamHandler.flush(),c.queueActivities=!1,t.next=28;break;case 25:t.prev=25,t.t0=t.catch(0),r(t.t0);case 28:case"end":return t.stop()}},t,null,[[0,25]])}));return function(e,r){return t.apply(this,arguments)}}()).finally(function(){return i.abort()}));case 9:case"end":return t.stop()}},t,this)})),function(){return s.apply(this,arguments)})},{key:"connectWithRetryAsync",value:(e=(0,u.default)(n.default.mark(function t(){var e,r,o=this;return n.default.wrap(function(t){for(;;)switch(t.prev=t.next){case 0:return t.next=2,(this.connectDeferred=(0,g.default)()).promise;case 2:e=3,this.connectionStatus$.next(_.ConnectionStatus.Connecting);case 4:if(!(e>0)){t.next=27;break}return e--,r=Date.now(),t.prev=7,t.next=10,this.connectAsync();case 10:t.next=15;break;case 12:t.prev=12,t.t0=t.catch(7),console.error(t.t0);case 15:if(this.connectionStatus$.getValue()!==_.ConnectionStatus.Ended){t.next=17;break}return t.abrupt("return");case 17:if(this.connectionStatus$.getValue()!==_.ConnectionStatus.Connecting&&this.connectionStatus$.next(_.ConnectionStatus.Connecting),!(6e4<Date.now()-r)){t.next=22;break}e=3,t.next=25;break;case 22:if(!(e>0)){t.next=25;break}return t.next=25,new Promise(function(t){return setTimeout(t,o.getRetryDelay())});case 25:t.next=4;break;case 27:this.connectionStatus$.next(_.ConnectionStatus.FailedToConnect);case 28:t.next=0;break;case 30:case"end":return t.stop()}},t,this,[[7,12]])})),function(){return e.apply(this,arguments)})},{key:"getRetryDelay",value:function(){return Math.floor(3e3+12e3*Math.random())}}]),t}();return tf.DirectLineStreaming=P,tf}function dl(){return fl||(fl=1,function(t){var r=s(),n=c();Object.defineProperty(t,"__esModule",{value:!0}),Object.defineProperty(t,"DirectLineStreaming",{enumerable:!0,get:function(){return b.DirectLineStreaming}}),t.DirectLine=t.ConnectionStatus=void 0;var o=r(d()),i=r(v()),a=r(E()),u=r(j());Ho(),Fo||(Fo=1,function(t){var e,r=function(){try{if(t.URLSearchParams&&"bar"===new t.URLSearchParams("foo=bar").get("foo"))return t.URLSearchParams}catch(e){}return null}(),n=r&&"a=1"===new r({a:1}).toString(),o=r&&"+"===new r("s=%2B").get("s"),i="__URLSearchParams__",s=!r||((e=new r).append("s"," &"),"s=+%26"===e.toString()),a=l.prototype,u=!(!t.Symbol||!t.Symbol.iterator);if(!(r&&n&&o&&s)){var c;a.append=function(t,e){b(this[i],t,e)},a.delete=function(t){delete this[i][t]},a.get=function(t){var e=this[i];return this.has(t)?e[t][0]:null},a.getAll=function(t){var e=this[i];return this.has(t)?e[t].slice(0):[]},a.has=function(t){return m(this[i],t)},a.set=function(t,e){this[i][t]=[""+e]},a.toString=function(){var t,e,r,n,o=this[i],s=[];for(e in o)for(r=h(e),t=0,n=o[e];t<n.length;t++)s.push(r+"="+h(n[t]));return s.join("&")},o&&r&&!n&&t.Proxy?(c=new Proxy(r,{construct:function(t,e){return new t(new l(e[0]).toString())}})).toString=Function.prototype.toString.bind(l):c=l,Object.defineProperty(t,"URLSearchParams",{value:c});var f=t.URLSearchParams.prototype;f.polyfill=!0,f.forEach=f.forEach||function(t,e){var r=y(this.toString());Object.getOwnPropertyNames(r).forEach(function(n){r[n].forEach(function(r){t.call(e,r,n,this)},this)},this)},f.sort=f.sort||function(){var t,e,r,n=y(this.toString()),o=[];for(t in n)o.push(t);for(o.sort(),e=0;e<o.length;e++)this.delete(o[e]);for(e=0;e<o.length;e++){var i=o[e],s=n[i];for(r=0;r<s.length;r++)this.append(i,s[r])}},f.keys=f.keys||function(){var t=[];return this.forEach(function(e,r){t.push(r)}),d(t)},f.values=f.values||function(){var t=[];return this.forEach(function(e){t.push(e)}),d(t)},f.entries=f.entries||function(){var t=[];return this.forEach(function(e,r){t.push([r,e])}),d(t)},u&&(f[t.Symbol.iterator]=f[t.Symbol.iterator]||f.entries)}function l(t){((t=t||"")instanceof URLSearchParams||t instanceof l)&&(t=t.toString()),this[i]=y(t)}function h(t){var e={"!":"%21","'":"%27","(":"%28",")":"%29","~":"%7E","%20":"+","%00":"\0"};return encodeURIComponent(t).replace(/[!'\(\)~]|%20|%00/g,function(t){return e[t]})}function p(t){return t.replace(/[ +]/g,"%20").replace(/(%[a-f0-9]{2})+/gi,function(t){return decodeURIComponent(t)})}function d(e){var r={next:function(){var t=e.shift();return{done:void 0===t,value:t}}};return u&&(r[t.Symbol.iterator]=function(){return r}),r}function y(t){var e={};if("object"==typeof t)if(v(t))for(var r=0;r<t.length;r++){var n=t[r];if(!v(n)||2!==n.length)throw new TypeError("Failed to construct 'URLSearchParams': Sequence initializer must only contain pair elements");b(e,n[0],n[1])}else for(var o in t)t.hasOwnProperty(o)&&b(e,o,t[o]);else{0===t.indexOf("?")&&(t=t.slice(1));for(var i=t.split("&"),s=0;s<i.length;s++){var a=i[s],u=a.indexOf("=");-1<u?b(e,p(a.slice(0,u)),p(a.slice(u+1))):a&&b(e,p(a),"")}}return e}function b(t,e,r){var n="string"==typeof r?r:null!=r&&"function"==typeof r.toString?r.toString():JSON.stringify(r);m(t,e)?t[e].push(n):t[e]=[n]}function v(t){return!!t&&"[object Array]"===Object.prototype.toString.call(t)}function m(t,e){return Object.prototype.hasOwnProperty.call(t,e)}}(void 0!==e?e:"undefined"!=typeof window?window:Wo));var f=Gi(),l=Bi(),h=os(),p=function(t,e){if(t&&t.__esModule)return t;if(null===t||"object"!==n(t)&&"function"!=typeof t)return{default:t};var r=g(e);if(r&&r.has(t))return r.get(t);var o={},i=Object.defineProperty&&Object.getOwnPropertyDescriptor;for(var s in t)if("default"!==s&&Object.prototype.hasOwnProperty.call(t,s)){var a=i?Object.getOwnPropertyDescriptor(t,s):null;a&&(a.get||a.set)?Object.defineProperty(o,s,a):o[s]=t[s]}o.default=t,r&&r.set(t,o);return o}(us);!function(){if(Ps)return fs;Ps=1;var t=Bi(),e=Cs();t.Observable.prototype.catch=e._catch,t.Observable.prototype._catch=e._catch}(),function(){if(Vs)return Ls;Vs=1;var t=Bi(),e=Xs();t.Observable.prototype.combineLatest=e.combineLatest}(),function(){if(Zs)return ta;Zs=1;var t=Bi(),e=na();t.Observable.prototype.count=e.count}(),ba(),function(){if(ga)return wa;ga=1;var t=Bi(),e=xa();t.Observable.prototype.do=e._do,t.Observable.prototype._do=e._do}(),function(){if(Ta)return ka;Ta=1;var t=Bi(),e=Aa();t.Observable.prototype.filter=e.filter}(),Ua(),za(),function(){if(Ya)return Xa;Ya=1;var t=Bi(),e=Za();t.Observable.prototype.concatMap=e.concatMap}(),function(){if(ru)return nu;ru=1;var t=Bi(),e=su();t.Observable.prototype.retryWhen=e.retryWhen}(),function(){if(hu)return pu;hu=1;var t=Bi(),e=_u();t.Observable.prototype.share=e.share}(),Ru(),Nu(),$u(),ac(),vc(),Sc(),function(){if(Ec)return Tc;Ec=1;var t=Bi(),e=Pc();t.Observable.throw=e._throw}();var y=r(Xc()),b=pl(),m=["contentUrl"];function g(t){if("function"!=typeof WeakMap)return null;var e=new WeakMap,r=new WeakMap;return(g=function(t){return t?r:e})(t)}function w(t,e){var r=Object.keys(t);if(Object.getOwnPropertySymbols){var n=Object.getOwnPropertySymbols(t);e&&(n=n.filter(function(e){return Object.getOwnPropertyDescriptor(t,e).enumerable})),r.push.apply(r,n)}return r}function _(t){for(var e=1;e<arguments.length;e++){var r=null!=arguments[e]?arguments[e]:{};e%2?w(Object(r),!0).forEach(function(e){(0,u.default)(t,e,r[e])}):Object.getOwnPropertyDescriptors?Object.defineProperties(t,Object.getOwnPropertyDescriptors(r)):w(Object(r)).forEach(function(e){Object.defineProperty(t,e,Object.getOwnPropertyDescriptor(r,e))})}return t}var S,x;t.ConnectionStatus=S,(x=S||(t.ConnectionStatus=S={}))[x.Uninitialized=0]="Uninitialized",x[x.Connecting=1]="Connecting",x[x.Online=2]="Online",x[x.ExpiredToken=3]="ExpiredToken",x[x.FailedToConnect=4]="FailedToConnect",x[x.Ended=5]="Ended";var O=function(t,e){var r=function(){throw new Error("not implemented")};return Object.assign(function(r){return t(r).catch(function(t){if(429===t.status){var r=t.xhr.getResponseHeader("Retry-After"),n=Number(r);if(!isNaN(n))return l.Observable.timer(n,e).flatMap(function(r){return l.Observable.throw(t,e)})}return l.Observable.throw(t,e)})},{get:function(t,e){return r()},post:function(t,e,n){return r()},put:function(t,e,n){return r()},patch:function(t,e,n){return r()},delete:function(t,e){return r()},getJSON:function(t,e){return r()}})},T=9e5,k=new Error("expired token"),P=new Error("conversation ended"),A=new Error("failed to connect"),R=function(t){for(var e,r=arguments.length,n=new Array(r>1?r-1:0),o=1;o<r;o++)n[o-1]=arguments[o];"undefined"!=typeof window&&window.botchatDebug&&t&&(e=console).log.apply(e,[t].concat(n))},C=function(){function t(e){var r,n;(0,i.default)(this,t),(0,u.default)(this,"connectionStatus$",new f.BehaviorSubject(S.Uninitialized)),(0,u.default)(this,"domain","https://directline.botframework.com/v3/directline"),(0,u.default)(this,"watermark",""),(0,u.default)(this,"_botAgent",""),(0,u.default)(this,"timeout",2e4),(0,u.default)(this,"pollingInterval",1e3),this.secret=e.secret,this.token=e.secret||e.token,this.webSocket=(void 0===e.webSocket||e.webSocket)&&"undefined"!=typeof WebSocket&&void 0!==WebSocket,e.streaming&&(this.streaming=e.streaming),e.conversationStartProperties&&e.conversationStartProperties.locale&&("[object String]"===Object.prototype.toString.call(e.conversationStartProperties.locale)?this.localeOnStartConversation=e.conversationStartProperties.locale:console.warn("DirectLineJS: conversationStartProperties.locale was ignored: the locale name may be a BCP 47 language tag")),e.domain&&(this.domain=e.domain),e.conversationId&&(this.conversationId=e.conversationId),e.watermark&&(this.watermark=e.watermark),e.streamUrl&&(e.token&&e.conversationId?this.streamUrl=e.streamUrl:console.warn("DirectLineJS: streamUrl was ignored: you need to provide a token and a conversationid")),void 0!==e.timeout&&(this.timeout=e.timeout),this.retries=9e5/this.timeout,this._botAgent=this.getBotAgent(e.botAgent),this.services={scheduler:n=(r=e).scheduler||h.async,ajax:O(r.ajax||l.Observable.ajax,n),WebSocket:r.WebSocket||WebSocket,random:r.random||Math.random};var o=~~e.pollingInterval;o<200?void 0!==e.pollingInterval&&console.warn("DirectLineJS: provided pollingInterval (".concat(e.pollingInterval,") is under lower bound (200ms), using default of 1000ms")):this.pollingInterval=o,this.expiredTokenExhaustion=this.setConnectionStatusFallback(S.ExpiredToken,S.FailedToConnect,5),this.activity$=(this.webSocket?this.webSocketActivity$():this.pollingGetActivity$()).share()}return(0,a.default)(t,[{key:"checkConnection",value:function(){var t=this,e=arguments.length>0&&void 0!==arguments[0]&&arguments[0],r=this.connectionStatus$.flatMap(function(e){return e===S.Uninitialized?(t.connectionStatus$.next(S.Connecting),t.token&&t.streamUrl?(t.connectionStatus$.next(S.Online),l.Observable.of(e,t.services.scheduler)):t.startConversation().do(function(e){t.conversationId=e.conversationId,t.token=t.secret||e.token,t.streamUrl=e.streamUrl,t.referenceGrammarId=e.referenceGrammarId,t.secret||t.refreshTokenLoop(),t.connectionStatus$.next(S.Online)},function(e){t.connectionStatus$.next(S.FailedToConnect)}).map(function(t){return e})):l.Observable.of(e,t.services.scheduler)}).filter(function(t){return t!=S.Uninitialized&&t!=S.Connecting}).flatMap(function(e){switch(e){case S.Ended:return l.Observable.throw(P,t.services.scheduler);case S.FailedToConnect:return l.Observable.throw(A,t.services.scheduler);case S.ExpiredToken:default:return l.Observable.of(e,t.services.scheduler)}});return e?r.take(1):r}},{key:"setConnectionStatusFallback",value:function(t,e){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:5;r--;var n=0,o=null;return function(i){return i===t&&o===i&&n>=r?(n=0,e):(n++,o=i,i)}}},{key:"expiredToken",value:function(){var t=this.connectionStatus$.getValue();t!=S.Ended&&t!=S.FailedToConnect&&this.connectionStatus$.next(S.ExpiredToken);var e=this.expiredTokenExhaustion(this.connectionStatus$.getValue());this.connectionStatus$.next(e)}},{key:"startConversation",value:function(){var t=this,e=this.conversationId?"".concat(this.domain,"/conversations/").concat(this.conversationId,"?watermark=").concat(this.watermark):"".concat(this.domain,"/conversations"),r=this.conversationId?"GET":"POST",n=this.conversationId?void 0:{user:{id:this.userIdOnStartConversation},locale:this.localeOnStartConversation};return this.services.ajax({method:r,url:e,body:n,timeout:this.timeout,headers:_({Accept:"application/json","Content-Type":"application/json"},this.commonHeaders())}).map(function(t){return t.response}).retryWhen(function(e){return e.mergeMap(function(e){return e.status>=400&&e.status<600?l.Observable.throw(e,t.services.scheduler):l.Observable.of(e,t.services.scheduler)}).delay(t.timeout,t.services.scheduler).take(t.retries)})}},{key:"refreshTokenLoop",value:function(){var t=this;this.tokenRefreshSubscription=l.Observable.interval(T,this.services.scheduler).flatMap(function(e){return t.refreshToken()}).subscribe(function(e){R("refreshing token",e,"at",new Date),t.token=e})}},{key:"refreshToken",value:function(){var t=this;return this.checkConnection(!0).flatMap(function(e){return t.services.ajax({method:"POST",url:"".concat(t.domain,"/tokens/refresh"),timeout:t.timeout,headers:_({},t.commonHeaders())}).map(function(t){return t.response.token}).retryWhen(function(e){return e.mergeMap(function(e){return 403===e.status?(t.expiredToken(),l.Observable.throw(e,t.services.scheduler)):404===e.status?l.Observable.throw(e,t.services.scheduler):l.Observable.of(e,t.services.scheduler)}).delay(t.timeout,t.services.scheduler).take(t.retries)})})}},{key:"reconnect",value:function(t){this.token=t.token,this.streamUrl=t.streamUrl,this.connectionStatus$.getValue()===S.ExpiredToken&&this.connectionStatus$.next(S.Online)}},{key:"end",value:function(){this.tokenRefreshSubscription&&this.tokenRefreshSubscription.unsubscribe();try{this.connectionStatus$.next(S.Ended)}catch(t){if(t===P)return;throw t}}},{key:"getSessionId",value:function(){var t=this;return R("getSessionId"),this.checkConnection(!0).flatMap(function(e){return t.services.ajax({method:"GET",url:"".concat(t.domain,"/session/getsessionid"),withCredentials:!0,timeout:t.timeout,headers:_({"Content-Type":"application/json"},t.commonHeaders())}).map(function(t){return t&&t.response&&t.response.sessionId?(R("getSessionId response: "+t.response.sessionId),t.response.sessionId):""}).catch(function(e){return R("getSessionId error: "+e.status),l.Observable.of("",t.services.scheduler)})}).catch(function(e){return t.catchExpiredToken(e)})}},{key:"postActivity",value:function(t){var e=this;return this.streaming&&(t.deliveryMode="stream"),this.userIdOnStartConversation&&t.from&&t.from.id!==this.userIdOnStartConversation&&(console.warn("DirectLineJS: Activity.from.id does not match with user id, ignoring activity.from.id"),t.from.id=this.userIdOnStartConversation),"message"===t.type&&t.attachments&&t.attachments.length>0?this.postMessageWithAttachments(t):(R("postActivity",t),this.checkConnection(!0).flatMap(function(r){return e.services.ajax({method:"POST",url:"".concat(e.domain,"/conversations/").concat(e.conversationId,"/activities"),body:t,timeout:e.timeout,headers:_({"Content-Type":"application/json"},e.commonHeaders())}).map(function(t){return t.response.id}).catch(function(t){return e.catchPostError(t)})}).catch(function(t){return e.catchExpiredToken(t)}))}},{key:"postMessageWithAttachments",value:function(t){var e,r=this,n=t.attachments,i=(0,y.default)(n.map(function(t){return t.name||"blob"})),s=n.map(function(t,e){return _(_({},t),{},{name:i[e]})});return this.checkConnection(!0).flatMap(function(n){return(e=new FormData).append("activity",new Blob([JSON.stringify(_(_({},t),{},{attachments:s.map(function(t){return t.contentUrl,_({},(0,o.default)(t,m))})}))],{type:"application/vnd.microsoft.activity"})),l.Observable.from(s,r.services.scheduler).flatMap(function(t){return r.services.ajax({method:"GET",url:t.contentUrl,responseType:"arraybuffer"}).do(function(r){return e.append("file",new Blob([r.response],{type:t.contentType}),t.name)})}).count()}).flatMap(function(n){return r.services.ajax({method:"POST",url:"".concat(r.domain,"/conversations/").concat(r.conversationId,"/upload?userId=").concat(t.from.id),body:e,timeout:r.timeout,headers:_({},r.commonHeaders())}).map(function(t){return t.response.id}).catch(function(t){return r.catchPostError(t)})}).catch(function(t){return r.catchPostError(t)})}},{key:"catchPostError",value:function(t){if(403===t.status)this.expiredToken();else if(t.status>=400&&t.status<500)return l.Observable.throw(t,this.services.scheduler);return l.Observable.of("retry",this.services.scheduler)}},{key:"catchExpiredToken",value:function(t){return t===k?l.Observable.of("retry",this.services.scheduler):l.Observable.throw(t,this.services.scheduler)}},{key:"pollingGetActivity$",value:function(){var t=this,e=l.Observable.create(function(e){var r=new f.BehaviorSubject({});r.subscribe(function(){if(t.connectionStatus$.getValue()===S.Online){var n=Date.now();t.services.ajax({headers:_({Accept:"application/json"},t.commonHeaders()),method:"GET",url:"".concat(t.domain,"/conversations/").concat(t.conversationId,"/activities?watermark=").concat(t.watermark),timeout:t.timeout}).subscribe(function(o){e.next(o),setTimeout(function(){return r.next(null)},Math.max(0,t.pollingInterval-Date.now()+n))},function(n){switch(n.status){case 403:t.connectionStatus$.next(S.ExpiredToken),setTimeout(function(){return r.next(null)},t.pollingInterval);break;case 404:t.connectionStatus$.next(S.Ended);break;default:e.error(n)}})}})});return this.checkConnection().flatMap(function(r){return e.catch(function(){return l.Observable.empty()}).map(function(t){return t.response}).flatMap(function(e){return t.observableFromActivityGroup(e)})})}},{key:"observableFromActivityGroup",value:function(t){return t.watermark&&(this.watermark=t.watermark),l.Observable.from(t.activities,this.services.scheduler)}},{key:"webSocketActivity$",value:function(){var t=this;return this.checkConnection().flatMap(function(e){return t.observableWebSocket().retryWhen(function(e){return e.delay(t.getRetryDelay(),t.services.scheduler).mergeMap(function(e){return t.reconnectToConversation()})})}).flatMap(function(e){return t.observableFromActivityGroup(e)})}},{key:"getRetryDelay",value:function(){return Math.floor(3e3+12e3*this.services.random())}},{key:"observableWebSocket",value:function(){var t=this;return l.Observable.create(function(e){R("creating WebSocket",t.streamUrl);var r,n,o=new t.services.WebSocket(t.streamUrl);return o.onopen=function(e){R("WebSocket open",e),r=l.Observable.interval(t.timeout,t.services.scheduler).subscribe(function(t){try{o.send("")}catch(e){R("Ping error",e)}})},o.onclose=function(t){R("WebSocket close",t),r&&r.unsubscribe(),n||e.error(t),n=!0},o.onerror=function(t){R("WebSocket error",t),r&&r.unsubscribe(),n||e.error(t),n=!0},o.onmessage=function(t){return t.data&&e.next(JSON.parse(t.data))},function(){0!==o.readyState&&1!==o.readyState||o.close()}})}},{key:"reconnectToConversation",value:function(){var t=this;return this.checkConnection(!0).flatMap(function(e){return t.services.ajax({method:"GET",url:"".concat(t.domain,"/conversations/").concat(t.conversationId,"?watermark=").concat(t.watermark),timeout:t.timeout,headers:_({Accept:"application/json"},t.commonHeaders())}).do(function(e){t.secret||(t.token=e.response.token),t.streamUrl=e.response.streamUrl}).map(function(t){return null}).retryWhen(function(e){return e.mergeMap(function(e){if(403===e.status)t.expiredToken();else if(404===e.status)return l.Observable.throw(P,t.services.scheduler);return l.Observable.of(e,t.services.scheduler)}).delay(t.timeout,t.services.scheduler).take(t.retries)})})}},{key:"commonHeaders",value:function(){return{Authorization:"Bearer ".concat(this.token),"x-ms-bot-agent":this._botAgent}}},{key:"getBotAgent",value:function(){var t=arguments.length>0&&void 0!==arguments[0]?arguments[0]:"",e="directlinejs";return t&&(e+="; ".concat(t)),"".concat("DirectLine/3.0"," (").concat(e," ").concat("0.15.8",")")}},{key:"setUserId",value:function(t){if(this.connectionStatus$.getValue()===S.Online)throw new Error("DirectLineJS: It is connected, we cannot set user id.");return this.parseToken(this.token)?console.warn("DirectLineJS: user id is already set in token, will ignore this user id."):/^dl_/.test(t)?console.warn('DirectLineJS: user id prefixed with "dl_" is reserved and must be embedded into the Direct Line token to prevent forgery.'):void(this.userIdOnStartConversation=t)}},{key:"parseToken",value:function(t){try{return(0,p.default)(t).user}catch(e){if(e instanceof p.InvalidTokenError)return}}}]),t}();t.DirectLine=C}(o)),o}var yl=dl();const bl=Symbol("typing"),vl="application/vnd.microsoft.card.hero",ml="application/vnd.microsoft.card.thumbnail",gl="application/vnd.microsoft.card.adaptive",wl="application/vnd.microsoft.card.signin",_l="application/vnd.microsoft.card.oauth",Sl="application/vnd.microsoft.card.receipt",xl="application/vnd.microsoft.card.audio",Ol="application/vnd.microsoft.card.video",El="application/vnd.microsoft.card.animation",Tl="application/vnd.microsoft.card.flex";function kl(t,e){if(t.from.id===e)return null;if("typing"===t.type)return bl;if("message"!==t.type)return null;const r=t,n=r.id??`dl-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,o=r.timestamp?new Date(r.timestamp).getTime():Date.now(),i=r.channelData,s=function(t){const e=t.suggestedActions?.actions;return e&&0!==e.length?e.map(t=>{const e=("title"in t?t.title:void 0)??String(t.value??"");return"openUrl"===t.type?{label:e,url:String(t.value??"")}:{label:e,value:String(t.value??e)}}):[]}(r);if(r.attachments&&r.attachments.length>0){const t=function(t,e,r){const n=t.attachments,o=t.attachmentLayout,i=[vl,ml,Tl,gl];if(n.every(t=>i.includes(t.contentType))&&(n.length>1||"carousel"===o))return{id:e,type:"carousel",from:"bot",data:{cards:n.map(t=>t.contentType===gl?function(t){const{texts:e,image:r,buttons:n}=Rl(t);return{image:r,title:e[0]??"",subtitle:e.slice(1).join("\n"),buttons:n}}(t.content):jl(t.content))},timestamp:r};return function(t,e,r,n){const o=t.contentType;if(o===vl||o===ml||o===Tl){return{id:r,type:"card",from:"bot",data:jl(t.content),timestamp:n}}if(o===gl)return function(t,e,r){const{texts:n,image:o,buttons:i}=Rl(t),s=t.fallbackText??t.speak??n.join("\n");if(o)return{id:e,type:"card",from:"bot",data:{image:o,title:n[0]??"",subtitle:n.slice(1).join("\n"),buttons:i},timestamp:r};if(i.length>0)return{id:e,type:"buttons",from:"bot",data:{text:s||"Adaptive Card",buttons:i},timestamp:r};return{id:e,type:"text",from:"bot",data:{text:s||"[Adaptive Card]"},timestamp:r}}(t.content,r,n);if(o===wl||o===_l){const e=t.content;return{id:r,type:"buttons",from:"bot",data:{text:e.text??"Please sign in",buttons:Pl(e.buttons)},timestamp:n}}if(o===Sl)return function(t,e,r){const n=[];t.title&&n.push(`**${t.title}**`);if(t.facts)for(const o of t.facts)n.push(`${o.key}: ${o.value}`);if(t.items)for(const o of t.items){const t=o.price?` — ${o.price}`:"";n.push(`- ${o.title??"Item"}${t}`)}t.tax&&n.push(`Tax: ${t.tax}`);t.total&&n.push(`**Total: ${t.total}**`);return{id:e,type:"text",from:"bot",data:{text:n.join("\n")},timestamp:r}}(t.content,r,n);if(o===Ol){const o=t.content,i=o.media?.[0]?.url;return i?{id:r,type:"video",from:"bot",data:{src:i,poster:o.image?.url,caption:o.title??e.text},timestamp:n}:null}if(o===xl){const e=t.content,o=e.media?.[0]?.url;return o?{id:r,type:"file",from:"bot",data:{url:o,name:e.title??"audio",mimeType:"audio/mpeg"},timestamp:n}:null}if(o===El){const o=t.content,i=o.media?.[0]?.url;return i?{id:r,type:"image",from:"bot",data:{src:i,caption:o.title??e.text},timestamp:n}:null}if(o.startsWith("image/")&&"contentUrl"in t)return{id:r,type:"image",from:"bot",data:{src:t.contentUrl,alt:t.name,caption:e.text},timestamp:n};if(o.startsWith("video/")&&"contentUrl"in t)return{id:r,type:"video",from:"bot",data:{src:t.contentUrl,caption:e.text},timestamp:n};if("contentUrl"in t)return{id:r,type:"file",from:"bot",data:{url:t.contentUrl,name:t.name??"file",mimeType:o},timestamp:n};return null}(n[0],t,e,r)}(r,n,o);return t&&(s.length>0&&(t.actions=s),i&&(t.data.channelData=i)),t}return s.length>0?{id:n,type:"quick-reply",from:"bot",data:{text:r.text??"",actions:s,...i?{channelData:i}:{}},timestamp:o}:r.text?{id:n,type:"text",from:"bot",data:{text:r.text,...i?{channelData:i}:{}},timestamp:o}:null}function jl(t){return{image:t.images?.[0]?.url,title:t.title??"",subtitle:t.subtitle??t.text,buttons:Pl(t.buttons)}}function Pl(t){return t&&0!==t.length?t.map(t=>{const e=("title"in t?t.title:void 0)??String(t.value??"");switch(t.type){case"openUrl":case"signin":case"call":return{label:e,url:String(t.value??"")};default:return{label:e,value:String(t.value??e)}}}):[]}function Al(t,e,r,n){if(t)for(const o of t)switch(o.type){case"TextBlock":o.text&&e.push(o.text);break;case"Image":o.url&&n(o.url);break;case"ActionSet":o.actions&&Cl(o.actions,r);break;case"Container":case"Column":Al(o.items,e,r,n);break;case"ColumnSet":for(const t of o.columns??[])Al(t.items,e,r,n)}}function Rl(t){const e=[];let r;const n=[];return Al(t.body,e,n,t=>{r=r??t}),Array.isArray(t.actions)&&Cl(t.actions,n),{texts:e,image:r,buttons:n}}function Cl(t,e){for(const r of t){const t=r.title??"Action";"Action.OpenUrl"===r.type&&r.url?e.push({label:t,url:r.url}):"Action.Submit"===r.type?e.push({label:t,value:"string"==typeof r.data?r.data:t}):e.push({label:t,value:t})}}const Ml="chativa_directline_userId",Ll="chativa_directline_conversation";async function Il(t,e){const r=e??"https://directline.botframework.com/v3/directline",n=await fetch(`${r}/tokens/refresh`,{method:"POST",headers:{Authorization:`Bearer ${t}`}});if(!n.ok)throw new Error(`Token refresh failed: ${n.status}`);return await n.json()}return t.DirectLineConnector=class{constructor(t){this.name="directline",this.addSentToHistory=!0,this.chativaCtx=null,this.messageHandler=null,this.connectHandler=null,this.disconnectHandler=null,this.typingHandler=null,this.messageStatusHandler=null,this.activitySub=null,this.connectionSub=null,this.typingTimeout=null,this.refreshTimer=null,this.pendingIds=[],this.hasConnectedBefore=!1,this.resolveReady=null,this._skipNextJoin=!1,this.options=t}setContext(t){this.chativaCtx=t}addEventHandler(t,e){this.options.eventHandlers??={},this.options.eventHandlers[t]=e}removeEventHandler(t){return!!this.options.eventHandlers?.[t]&&(delete this.options.eventHandlers[t],!0)}hasEventHandler(t){return!!this.options.eventHandlers?.[t]}getEventHandlerNames(){return Object.keys(this.options.eventHandlers??{})}async connect(){this.userId=this.options.userId??function(){try{const t=localStorage.getItem(Ml);if(t)return t}catch{}const t=Math.random().toString(36).slice(2,15)+Math.random().toString(36).slice(2,15);try{localStorage.setItem(Ml,t)}catch{}return t}(),this.userName=this.options.userName;let t=!1;if(this.options.resumeConversation){const e=this.loadPersistedConversation();if(e)try{const r=await Il(e.token,this.options.domain);this.token=r.token,this.conversationId=e.conversationId,this.watermark=e.watermark,this.userId=e.userId,t=!0}catch{this.clearPersistedConversation()}}if(!t)if(this.options.tokenGeneratorUrl){const t=await async function(t){const e=await fetch(t,{method:"POST"});if(!e.ok)throw new Error(`Token generator failed: ${e.status}`);return await e.json()}(this.options.tokenGeneratorUrl);this.token=t.token,t.conversationId&&(this.conversationId=t.conversationId),t.userId&&(this.userId=t.userId)}else if(this.options.token)this.token=this.options.token;else{if(!this.options.secret)throw new Error("DirectLineConnector: provide token, secret, or tokenGeneratorUrl.");{const t=await async function(t,e){const r=await fetch("https://directline.botframework.com/v3/directline/tokens/generate",{method:"POST",headers:{Authorization:`Bearer ${t}`,"Content-Type":"application/json"},body:JSON.stringify({user:{id:e,name:e}})});if(!r.ok)throw new Error(`DirectLine token fetch failed: ${r.status}`);const n=await r.json();return{token:n.token,conversationId:n.conversationId}}(this.options.secret,this.userId);this.token=t.token,this.conversationId=t.conversationId}}this.scheduleTokenRefresh(),this.directLine=new yl.DirectLine({token:this.token,domain:this.options.domain,...t?{conversationId:this.conversationId,watermark:this.watermark}:{}}),t&&(this.hasConnectedBefore=!0,this._skipNextJoin=!0);const e=new Promise(t=>{this.resolveReady=t});this.startListening(t),await e,this.connectHandler?.(),this.options.resumeConversation&&this.persistConversation()}async disconnect(){this.activitySub?.unsubscribe(),this.activitySub=null,this.connectionSub?.unsubscribe(),this.connectionSub=null,this.clearTypingTimeout(),this.clearRefreshTimer();try{this.directLine?.end()}catch{}this.messageHandler=null,this.connectHandler=null,this.disconnectHandler=null,this.typingHandler=null,this.messageStatusHandler=null}clearConversation(){this.watermark=void 0,this.clearPersistedConversation()}async sendMessage(t){return this.pendingIds.push(t.id),this.messageStatusHandler?.(t.id,"sent"),new Promise((e,r)=>{this.directLine.postActivity({type:"message",from:{id:this.userId,name:this.userName??this.userId},text:t.data.text??"",conversation:{id:this.conversationId},channelId:"directline",...this.options.locale?{locale:this.options.locale}:{},timestamp:(new Date).toISOString(),id:t.id}).subscribe({next:()=>e(),error:t=>r(t)})})}async sendFile(t){const e=`${this.options.domain??"https://directline.botframework.com/v3/directline"}/conversations/${this.conversationId}/upload?userId=${encodeURIComponent(this.userId)}`,r=new FormData;r.append("file",t,t.name);const n=await fetch(e,{method:"POST",headers:{Authorization:`Bearer ${this.token}`},body:r});if(!n.ok)throw new Error(`DirectLine file upload failed: ${n.status}`)}async sendFeedback(t,e){const r=this.chativaCtx?.messages.getAll().find(e=>e.id===t),n=r?.data?.channelData?.correlationId;if(!n)return void console.warn("[DirectLineConnector] sendFeedback: no correlationId found for message",t);const o="like"===e?0:1;return new Promise((t,e)=>{this.directLine.postActivity({type:"event",name:"webchat/messageFeedback",from:{id:this.userId,name:this.userId},value:{correlationId:n,feedbackType:o}}).subscribe({next:()=>t(),error:t=>e(t)})})}async loadHistory(t){const e=this.options.domain??"https://directline.botframework.com/v3/directline",r=t?`${e}/conversations/${this.conversationId}/activities?watermark=${encodeURIComponent(t)}`:`${e}/conversations/${this.conversationId}/activities`,n=await fetch(r,{headers:{Authorization:`Bearer ${this.token}`}});if(!n.ok)throw new Error(`DirectLine history fetch failed: ${n.status}`);const o=await n.json(),i=[];for(const s of o.activities){if(s.from.id===this.userId&&"message"===s.type){const t=s;t.text&&i.push({id:s.id??`dl-${Date.now()}-${Math.random().toString(36).slice(2,7)}`,type:"text",from:"user",data:{text:t.text},timestamp:s.timestamp?new Date(s.timestamp).getTime():Date.now()});continue}const t=kl(s,this.userId);null!==t&&t!==bl&&i.push(t)}return{messages:i,hasMore:!1,cursor:o.watermark}}onMessage(t){this.messageHandler=t}onConnect(t){this.connectHandler=t}onDisconnect(t){this.disconnectHandler=t}onTyping(t){this.typingHandler=t}onMessageStatus(t){this.messageStatusHandler=t}startListening(t){this.connectionSub=this.directLine.connectionStatus$.subscribe(e=>{switch(e){case yl.ConnectionStatus.Online:this.sendJoinEvent(),t&&this.resolveReady&&(this.resolveReady(),this.resolveReady=null);break;case yl.ConnectionStatus.ExpiredToken:this.handleExpiredToken();break;case yl.ConnectionStatus.FailedToConnect:this.options.resumeConversation&&this.clearPersistedConversation(),this.disconnectHandler?.("Failed to connect");break;case yl.ConnectionStatus.Ended:this.disconnectHandler?.("Connection ended")}}),this.activitySub=this.directLine.activity$.subscribe(t=>{try{if(t.id&&(this.watermark=t.id),!this.conversationId&&t.conversation?.id&&(this.conversationId=t.conversation.id),t.from.id===this.userId){if("message"===t.type){const t=this.pendingIds.shift();t&&this.messageStatusHandler?.(t,"read")}return}if("event"===t.type&&t.name){if("DisableFeedbackButton"===t.name&&t.value){const e=t.value;e.CorrelationId&&this.handleDisableFeedback(e.CorrelationId,e.FeedbackType)}const e=this.options.eventHandlers?.[t.name];return void(e&&e(this.createEventContext(t)))}const e=kl(t,this.userId);if(e===bl)return void this.handleTyping();null!==e&&(this.clearTypingTimeout(),this.typingHandler?.(!1),this.resolveReady&&(this.resolveReady(),this.resolveReady=null),this.messageHandler?.(e),this.options.resumeConversation&&this.persistConversation())}catch(e){console.warn("[DirectLineConnector] Activity mapping error:",e)}})}createEventContext(t){const e={id:this.userId,name:this.userName??this.userId};return{activity:t,userId:this.userId,userName:this.userName??this.userId,postEvent:(t,r)=>{this.directLine.postActivity({type:"event",name:t,from:e,...this.options.locale?{locale:this.options.locale}:{},value:r}).subscribe()},chativa:this.chativaCtx}}sendJoinEvent(){const t=this.options.locale,e={id:this.userId,name:this.userName??this.userId};if(this._skipNextJoin)return this._skipNextJoin=!1,this.hasConnectedBefore=!0,void this.directLine.postActivity({type:"event",name:"webchat/rejoin",from:e,...t?{locale:t}:{},value:{...t?{language:t}:{}}}).subscribe();this.directLine.postActivity({type:"event",name:"webchat/join",from:e,...t?{locale:t}:{},value:{...t?{language:t}:{},...this.options.joinParameters}}).subscribe()}handleDisableFeedback(t,e){const r=this.chativaCtx?.messages.getAll();if(!r)return;const n=r.find(e=>e.data?.channelData?.correlationId===t);n&&this.chativaCtx.messages.update(n.id,{data:{...n.data,feedbackDisabled:!0,feedbackType:e}})}handleTyping(){this.clearTypingTimeout(),this.typingHandler?.(!0),this.typingTimeout=setTimeout(()=>{this.typingHandler?.(!1),this.typingTimeout=null},3e3)}clearTypingTimeout(){null!==this.typingTimeout&&(clearTimeout(this.typingTimeout),this.typingTimeout=null)}scheduleTokenRefresh(){this.clearRefreshTimer();const t=function(t){try{const e=JSON.parse(atob(t.split(".")[1]));return"number"==typeof e.exp?1e3*e.exp:null}catch{return null}}(this.token);if(!t)return;const e=t-Date.now()-6e4;e<=0?this.refreshTokenNow():this.refreshTimer=setTimeout(()=>this.refreshTokenNow(),e)}async refreshTokenNow(){try{const t=await Il(this.token,this.options.domain);this.token=t.token,this.scheduleTokenRefresh(),this.options.resumeConversation&&this.persistConversation()}catch(t){console.warn("[DirectLineConnector] Token refresh failed:",t)}}async handleExpiredToken(){try{const t=await Il(this.token,this.options.domain);this.token=t.token,this.scheduleTokenRefresh()}catch{return this.options.resumeConversation&&this.clearPersistedConversation(),void this.disconnectHandler?.("Token expired and refresh failed")}this.activitySub?.unsubscribe(),this.connectionSub?.unsubscribe(),this.clearTypingTimeout();try{this.directLine.end()}catch{}this.directLine=new yl.DirectLine({token:this.token,domain:this.options.domain,conversationId:this.conversationId,watermark:this.watermark}),this.startListening(!0),this.options.resumeConversation&&this.persistConversation()}clearRefreshTimer(){null!==this.refreshTimer&&(clearTimeout(this.refreshTimer),this.refreshTimer=null)}persistConversation(){if(this.conversationId&&this.token)try{const t={conversationId:this.conversationId,token:this.token,watermark:this.watermark,userId:this.userId};localStorage.setItem(Ll,JSON.stringify(t))}catch{}}loadPersistedConversation(){try{const t=localStorage.getItem(Ll);return t?JSON.parse(t):null}catch{return null}}clearPersistedConversation(){try{localStorage.removeItem(Ll)}catch{}}},Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),t}({});
|
|
2
|
+
//# sourceMappingURL=chativa-directline.global.js.map
|