New Case Study:See how Anthropic automated 95% of dependency reviews with Socket.Learn More
Socket
Sign inDemoInstall
Socket

genesys-cloud-client-logger

Package Overview
Dependencies
Maintainers
1
Versions
110
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

genesys-cloud-client-logger - npm Package Compare versions

Comparing version 2.0.0 to 3.0.0-branch.PCM1735.2

dist/es/index.d.ts

2

dist/genesys-cloud-client-logger.min.js

@@ -1,2 +0,2 @@

!function(t,e){"object"==typeof exports&&"object"==typeof module?module.exports=e():"function"==typeof define&&define.amd?define([],e):"object"==typeof exports?exports.GenesysCloudClientLogger=e():t.GenesysCloudClientLogger=e()}(window,(function(){return function(t){var e={};function r(n){if(e[n])return e[n].exports;var o=e[n]={i:n,l:!1,exports:{}};return t[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=t,r.c=e,r.d=function(t,e,n){r.o(t,e)||Object.defineProperty(t,e,{enumerable:!0,get:n})},r.r=function(t){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(t,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(t,"__esModule",{value:!0})},r.t=function(t,e){if(1&e&&(t=r(t)),8&e)return t;if(4&e&&"object"==typeof t&&t&&t.__esModule)return t;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:t}),2&e&&"string"!=typeof t)for(var o in t)r.d(n,o,function(e){return t[e]}.bind(null,o));return n},r.n=function(t){var e=t&&t.__esModule?function(){return t.default}:function(){return t};return r.d(e,"a",e),e},r.o=function(t,e){return Object.prototype.hasOwnProperty.call(t,e)},r.p="",r(r.s=7)}([function(t,e){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);t.exports=function(){return r(n),n}}else{var o=new Array(16);t.exports=function(){for(var t,e=0;e<16;e++)0==(3&e)&&(t=4294967296*Math.random()),o[e]=t>>>((3&e)<<3)&255;return o}}},function(t,e){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);t.exports=function(t,e){var n=e||0,o=r;return[o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],"-",o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]],o[t[n++]]].join("")}},function(t,e){var r=Object.prototype.hasOwnProperty;function n(t){return"[Throws: "+(t?t.message:"?")+"]"}function o(t){var e=[];return function t(o){if(null===o||"object"!=typeof o)return o;if(-1!==e.indexOf(o))return"[Circular]";if(e.push(o),"function"==typeof o.toJSON)try{var i=t(o.toJSON());return e.pop(),i}catch(t){return n(t)}if(Array.isArray(o)){var s=o.map(t);return e.pop(),s}var u=Object.keys(o).reduce((function(e,i){return e[i]=t(function(t,e){if(r.call(t,e))try{return t[e]}catch(t){return n(t)}return t[e]}(o,i)),e}),{});return e.pop(),u}(t)}t.exports=function(t,e,r){return JSON.stringify(o(t),e,r)},t.exports.ensureProperties=o},function(t,e,r){(function(t,r){var n="[object Arguments]",o="[object Function]",i="[object GeneratorFunction]",s="[object Map]",u="[object Set]",a=/\w*$/,c=/^\[object .+?Constructor\]$/,l=/^(?:0|[1-9]\d*)$/,f={};f[n]=f["[object Array]"]=f["[object ArrayBuffer]"]=f["[object DataView]"]=f["[object Boolean]"]=f["[object Date]"]=f["[object Float32Array]"]=f["[object Float64Array]"]=f["[object Int8Array]"]=f["[object Int16Array]"]=f["[object Int32Array]"]=f[s]=f["[object Number]"]=f["[object Object]"]=f["[object RegExp]"]=f[u]=f["[object String]"]=f["[object Symbol]"]=f["[object Uint8Array]"]=f["[object Uint8ClampedArray]"]=f["[object Uint16Array]"]=f["[object Uint32Array]"]=!0,f["[object Error]"]=f[o]=f["[object WeakMap]"]=!1;var p="object"==typeof t&&t&&t.Object===Object&&t,h="object"==typeof self&&self&&self.Object===Object&&self,d=p||h||Function("return this")(),y=e&&!e.nodeType&&e,g=y&&"object"==typeof r&&r&&!r.nodeType&&r,b=g&&g.exports===y;function v(t,e){return t.set(e[0],e[1]),t}function m(t,e){return t.add(e),t}function _(t,e,r,n){var o=-1,i=t?t.length:0;for(n&&i&&(r=t[++o]);++o<i;)r=e(r,t[o],o,t);return r}function w(t){var e=!1;if(null!=t&&"function"!=typeof t.toString)try{e=!!(t+"")}catch(t){}return e}function T(t){var e=-1,r=Array(t.size);return t.forEach((function(t,n){r[++e]=[n,t]})),r}function j(t,e){return function(r){return t(e(r))}}function O(t){var e=-1,r=Array(t.size);return t.forEach((function(t){r[++e]=t})),r}var x,P=Array.prototype,S=Function.prototype,E=Object.prototype,A=d["__core-js_shared__"],k=(x=/[^.]+$/.exec(A&&A.keys&&A.keys.IE_PROTO||""))?"Symbol(src)_1."+x:"",L=S.toString,q=E.hasOwnProperty,R=E.toString,D=RegExp("^"+L.call(q).replace(/[\\^$.*+?()[\]{}|]/g,"\\$&").replace(/hasOwnProperty|(function).*?(?=\\\()| for .+?(?=\\\])/g,"$1.*?")+"$"),M=b?d.Buffer:void 0,C=d.Symbol,z=d.Uint8Array,U=j(Object.getPrototypeOf,Object),I=Object.create,B=E.propertyIsEnumerable,N=P.splice,Q=Object.getOwnPropertySymbols,H=M?M.isBuffer:void 0,F=j(Object.keys,Object),J=gt(d,"DataView"),$=gt(d,"Map"),G=gt(d,"Promise"),X=gt(d,"Set"),V=gt(d,"WeakMap"),W=gt(Object,"create"),K=wt(J),Y=wt($),Z=wt(G),tt=wt(X),et=wt(V),rt=C?C.prototype:void 0,nt=rt?rt.valueOf:void 0;function ot(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function it(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function st(t){var e=-1,r=t?t.length:0;for(this.clear();++e<r;){var n=t[e];this.set(n[0],n[1])}}function ut(t){this.__data__=new it(t)}function at(t,e){var r=jt(t)||function(t){return function(t){return function(t){return!!t&&"object"==typeof t}(t)&&Ot(t)}(t)&&q.call(t,"callee")&&(!B.call(t,"callee")||R.call(t)==n)}(t)?function(t,e){for(var r=-1,n=Array(t);++r<t;)n[r]=e(r);return n}(t.length,String):[],o=r.length,i=!!o;for(var s in t)!e&&!q.call(t,s)||i&&("length"==s||mt(s,o))||r.push(s);return r}function ct(t,e,r){var n=t[e];q.call(t,e)&&Tt(n,r)&&(void 0!==r||e in t)||(t[e]=r)}function lt(t,e){for(var r=t.length;r--;)if(Tt(t[r][0],e))return r;return-1}function ft(t,e,r,c,l,p,h){var d;if(c&&(d=p?c(t,l,p,h):c(t)),void 0!==d)return d;if(!St(t))return t;var y=jt(t);if(y){if(d=function(t){var e=t.length,r=t.constructor(e);e&&"string"==typeof t[0]&&q.call(t,"index")&&(r.index=t.index,r.input=t.input);return r}(t),!e)return function(t,e){var r=-1,n=t.length;e||(e=Array(n));for(;++r<n;)e[r]=t[r];return e}(t,d)}else{var g=vt(t),b=g==o||g==i;if(xt(t))return function(t,e){if(e)return t.slice();var r=new t.constructor(t.length);return t.copy(r),r}(t,e);if("[object Object]"==g||g==n||b&&!p){if(w(t))return p?t:{};if(d=function(t){return"function"!=typeof t.constructor||_t(t)?{}:(e=U(t),St(e)?I(e):{});var e}(b?{}:t),!e)return function(t,e){return dt(t,bt(t),e)}(t,function(t,e){return t&&dt(e,Et(e),t)}(d,t))}else{if(!f[g])return p?t:{};d=function(t,e,r,n){var o=t.constructor;switch(e){case"[object ArrayBuffer]":return ht(t);case"[object Boolean]":case"[object Date]":return new o(+t);case"[object DataView]":return function(t,e){var r=e?ht(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.byteLength)}(t,n);case"[object Float32Array]":case"[object Float64Array]":case"[object Int8Array]":case"[object Int16Array]":case"[object Int32Array]":case"[object Uint8Array]":case"[object Uint8ClampedArray]":case"[object Uint16Array]":case"[object Uint32Array]":return function(t,e){var r=e?ht(t.buffer):t.buffer;return new t.constructor(r,t.byteOffset,t.length)}(t,n);case s:return function(t,e,r){return _(e?r(T(t),!0):T(t),v,new t.constructor)}(t,n,r);case"[object Number]":case"[object String]":return new o(t);case"[object RegExp]":return function(t){var e=new t.constructor(t.source,a.exec(t));return e.lastIndex=t.lastIndex,e}(t);case u:return function(t,e,r){return _(e?r(O(t),!0):O(t),m,new t.constructor)}(t,n,r);case"[object Symbol]":return i=t,nt?Object(nt.call(i)):{}}var i}(t,g,ft,e)}}h||(h=new ut);var j=h.get(t);if(j)return j;if(h.set(t,d),!y)var x=r?function(t){return function(t,e,r){var n=e(t);return jt(t)?n:function(t,e){for(var r=-1,n=e.length,o=t.length;++r<n;)t[o+r]=e[r];return t}(n,r(t))}(t,Et,bt)}(t):Et(t);return function(t,e){for(var r=-1,n=t?t.length:0;++r<n&&!1!==e(t[r],r,t););}(x||t,(function(n,o){x&&(n=t[o=n]),ct(d,o,ft(n,e,r,c,o,t,h))})),d}function pt(t){return!(!St(t)||(e=t,k&&k in e))&&(Pt(t)||w(t)?D:c).test(wt(t));var e}function ht(t){var e=new t.constructor(t.byteLength);return new z(e).set(new z(t)),e}function dt(t,e,r,n){r||(r={});for(var o=-1,i=e.length;++o<i;){var s=e[o],u=n?n(r[s],t[s],s,r,t):void 0;ct(r,s,void 0===u?t[s]:u)}return r}function yt(t,e){var r,n,o=t.__data__;return("string"==(n=typeof(r=e))||"number"==n||"symbol"==n||"boolean"==n?"__proto__"!==r:null===r)?o["string"==typeof e?"string":"hash"]:o.map}function gt(t,e){var r=function(t,e){return null==t?void 0:t[e]}(t,e);return pt(r)?r:void 0}ot.prototype.clear=function(){this.__data__=W?W(null):{}},ot.prototype.delete=function(t){return this.has(t)&&delete this.__data__[t]},ot.prototype.get=function(t){var e=this.__data__;if(W){var r=e[t];return"__lodash_hash_undefined__"===r?void 0:r}return q.call(e,t)?e[t]:void 0},ot.prototype.has=function(t){var e=this.__data__;return W?void 0!==e[t]:q.call(e,t)},ot.prototype.set=function(t,e){return this.__data__[t]=W&&void 0===e?"__lodash_hash_undefined__":e,this},it.prototype.clear=function(){this.__data__=[]},it.prototype.delete=function(t){var e=this.__data__,r=lt(e,t);return!(r<0)&&(r==e.length-1?e.pop():N.call(e,r,1),!0)},it.prototype.get=function(t){var e=this.__data__,r=lt(e,t);return r<0?void 0:e[r][1]},it.prototype.has=function(t){return lt(this.__data__,t)>-1},it.prototype.set=function(t,e){var r=this.__data__,n=lt(r,t);return n<0?r.push([t,e]):r[n][1]=e,this},st.prototype.clear=function(){this.__data__={hash:new ot,map:new($||it),string:new ot}},st.prototype.delete=function(t){return yt(this,t).delete(t)},st.prototype.get=function(t){return yt(this,t).get(t)},st.prototype.has=function(t){return yt(this,t).has(t)},st.prototype.set=function(t,e){return yt(this,t).set(t,e),this},ut.prototype.clear=function(){this.__data__=new it},ut.prototype.delete=function(t){return this.__data__.delete(t)},ut.prototype.get=function(t){return this.__data__.get(t)},ut.prototype.has=function(t){return this.__data__.has(t)},ut.prototype.set=function(t,e){var r=this.__data__;if(r instanceof it){var n=r.__data__;if(!$||n.length<199)return n.push([t,e]),this;r=this.__data__=new st(n)}return r.set(t,e),this};var bt=Q?j(Q,Object):function(){return[]},vt=function(t){return R.call(t)};function mt(t,e){return!!(e=null==e?9007199254740991:e)&&("number"==typeof t||l.test(t))&&t>-1&&t%1==0&&t<e}function _t(t){var e=t&&t.constructor;return t===("function"==typeof e&&e.prototype||E)}function wt(t){if(null!=t){try{return L.call(t)}catch(t){}try{return t+""}catch(t){}}return""}function Tt(t,e){return t===e||t!=t&&e!=e}(J&&"[object DataView]"!=vt(new J(new ArrayBuffer(1)))||$&&vt(new $)!=s||G&&"[object Promise]"!=vt(G.resolve())||X&&vt(new X)!=u||V&&"[object WeakMap]"!=vt(new V))&&(vt=function(t){var e=R.call(t),r="[object Object]"==e?t.constructor:void 0,n=r?wt(r):void 0;if(n)switch(n){case K:return"[object DataView]";case Y:return s;case Z:return"[object Promise]";case tt:return u;case et:return"[object WeakMap]"}return e});var jt=Array.isArray;function Ot(t){return null!=t&&function(t){return"number"==typeof t&&t>-1&&t%1==0&&t<=9007199254740991}(t.length)&&!Pt(t)}var xt=H||function(){return!1};function Pt(t){var e=St(t)?R.call(t):"";return e==o||e==i}function St(t){var e=typeof t;return!!t&&("object"==e||"function"==e)}function Et(t){return Ot(t)?at(t):function(t){if(!_t(t))return F(t);var e=[];for(var r in Object(t))q.call(t,r)&&"constructor"!=r&&e.push(r);return e}(t)}r.exports=function(t){return ft(t,!0,!0)}}).call(this,r(13),r(14)(t))},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.calculateLogBufferSize=function(t){return t.reduce((function(t,r){return t+e.calculateLogMessageSize(r)}),0)},e.calculateLogMessageSize=function(t){var e=JSON.stringify(t),r=encodeURIComponent(e).match(/%[89ABab]/g);return e.length+(r?r.length:0)},e.getDeferred=function(){var t,e;return{promise:new Promise((function(r,n){t=r,e=n})),resolve:t,reject:e}}},function(t,e,r){"use strict";function n(t){return(n="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)}t.exports=function(t){return null!==t&&"object"===n(t)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(27),o=function(){function t(t){this.options=t,this.attempt=0}return t.prototype.apply=function(){var t=this;return new Promise((function(e){return setTimeout(e,t.jitteredDelay)}))},t.prototype.setAttemptNumber=function(t){this.attempt=t},Object.defineProperty(t.prototype,"jitteredDelay",{get:function(){return n.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"delay",{get:function(){var t=this.options.startingDelay,e=this.options.timeMultiple,r=this.numOfDelayedAttempts,n=t*Math.pow(e,r);return Math.min(n,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),t}();e.Delay=o},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(8);e.Logger=n.Logger,e.default=n.Logger},function(t,e,r){"use strict";var n=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var o=r(9),i=n(r(2)),s=r(12),u=function(){function t(t){var e=this;this.logMessage=function(t,r,n,o){var s,u;r instanceof Error&&(n=n||r,r=r.message),r=""+((null===(s=e.config)||void 0===s?void 0:s.logTopic)?"["+e.config.logTopic+"] ":"")+r,(null===(u=e.config)||void 0===u?void 0:u.stringify)?console[t](r,i.default(n)):console[t](r,n),!o&&e.serverLogger&&e.logRank(t)>=e.logRank(e.config.logLevel)&&e.serverLogger.addLogToSend(t,r,n)},Object.defineProperty(this,"clientId",{value:o.v4(),writable:!1}),-1===this.logRank(t.logLevel)&&(t.logLevel&&this.warn('Invalid log level: "'+t.logLevel+'". Default "info" will be used instead.',null,!0),t.logLevel="info"),this.config=t,!1!==this.config.initializeServerLogging&&(this.serverLogger=new s.ServerLogger(this))}return t.prototype.setAccessToken=function(t){this.config.accessToken=t},t.prototype.log=function(t,e,r){void 0===r&&(r=!1),this.logMessage("log",t,e,r)},t.prototype.debug=function(t,e,r){void 0===r&&(r=!1),this.logMessage("debug",t,e,r)},t.prototype.info=function(t,e,r){void 0===r&&(r=!1),this.logMessage("info",t,e,r)},t.prototype.warn=function(t,e,r){void 0===r&&(r=!1),this.logMessage("warn",t,e,r)},t.prototype.error=function(t,e,r){void 0===r&&(r=!1),this.logMessage("error",t,e,r)},t.prototype.logRank=function(t){switch(t){case"log":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;default:return-1}},t}();e.Logger=u},function(t,e,r){var n=r(10),o=r(11),i=o;i.v1=n,i.v4=o,t.exports=i},function(t,e,r){var n,o,i=r(0),s=r(1),u=0,a=0;t.exports=function(t,e,r){var c=e&&r||0,l=e||[],f=(t=t||{}).node||n,p=void 0!==t.clockseq?t.clockseq:o;if(null==f||null==p){var h=i();null==f&&(f=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==p&&(p=o=16383&(h[6]<<8|h[7]))}var d=void 0!==t.msecs?t.msecs:(new Date).getTime(),y=void 0!==t.nsecs?t.nsecs:a+1,g=d-u+(y-a)/1e4;if(g<0&&void 0===t.clockseq&&(p=p+1&16383),(g<0||d>u)&&void 0===t.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,a=y,o=p;var b=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=b>>>24&255,l[c++]=b>>>16&255,l[c++]=b>>>8&255,l[c++]=255&b;var v=d/4294967296*1e4&268435455;l[c++]=v>>>8&255,l[c++]=255&v,l[c++]=v>>>24&15|16,l[c++]=v>>>16&255,l[c++]=p>>>8|128,l[c++]=255&p;for(var m=0;m<6;++m)l[c+m]=f[m];return e||s(l)}},function(t,e,r){var n=r(0),o=r(1);t.exports=function(t,e,r){var i=e&&r||0;"string"==typeof t&&(e="binary"===t?new Array(16):null,t=null);var s=(t=t||{}).random||(t.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,e)for(var u=0;u<16;++u)e[i+u]=s[u];return e||o(s)}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(r(2)),u=i(r(3)),a=r(4),c=r(15),l=function(){function t(t){if(this.isInitialized=!1,this.logBuffer=[],this.debounceTimer=null,this.logger=t,!t.config.url||!t.config.appVersion){var e="Missing `url` and/or `appVersion` config options to set up server logging. Not sending logs to server for this logger instance";throw this.logger.error(e,{providedConfig:t.config},!0),new Error(e)}this.isInitialized=!0,this.debounceLogUploadTime=t.config.uploadDebounceTime||4e3,this.logUploader=c.getOrCreateLogUploader(t.config.url,t.config.debugMode),window.addEventListener("unload",this.sendAllLogsInstantly.bind(this))}return t.prototype.addLogToSend=function(t,e,r){if(this.isInitialized){var n=this.convertToLogMessage(e,r),o=this.convertToTrace(t,n),i=a.calculateLogMessageSize(o);if(i>14500){var s=this.truncateLog(t,n);if(null===s)return void this.logger.error("truncated message is too large to send to server. not sending message",{originalTrace:o,originalTraceSize:a.calculateLogMessageSize(o),truncatedTrace:s,truncatedTraceSize:a.calculateLogMessageSize(s)},!0);i=a.calculateLogMessageSize(s),o=s}var u,c=!this.logBuffer.length;if((u=c?{size:0,traces:[]}:this.logBuffer[this.logBuffer.length-1]).size+i>14500)return this.debug("`exceedsMaxLogSize` was `true`",{logBuffer:this.logBuffer,bufferItem:u,incomingTrace:o,incomingTraceSize:i,maxAllowedTraceSize:14500}),this.logBuffer.push({size:i,traces:[o]}),this.debug("calling sendLogsToServer(true)",{logBuffer:this.logBuffer}),void this.sendLogsToServer(!0);u.size+=i,u.traces.push(o),c&&(this.debug("`this.logBuffer` was empty. pushing new buffer item",{logBuffer:this.logBuffer,bufferItem:u}),this.logBuffer.push(u)),this.debug("calling sendLogsToServer()",{logBuffer:this.logBuffer}),this.sendLogsToServer()}},t.prototype.sendLogsToServer=function(t){return void 0===t&&(t=!1),n(this,void 0,void 0,(function(){var e,r,n=this;return o(this,(function(o){switch(o.label){case 0:if(!this.logBuffer.length)return clearTimeout(this.debounceTimer),this.debounceTimer=null,this.debug("buffer empty, not sending http request"),[2];if(!t)return this.debounceTimer?this.debug("sendLogsToServer() 'immediate' is false. 'debounceTimer' is already running"):(this.debug("sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to "+this.debounceLogUploadTime+"ms"),this.debounceTimer=setTimeout((function(){return n.sendLogsToServer(!0)}),this.debounceLogUploadTime)),[2];clearTimeout(this.debounceTimer),this.debounceTimer=null,e=this.logBuffer.splice(0,1)[0],o.label=1;case 1:return o.trys.push([1,3,4,5]),this.debug("calling logUploader.postLogsToEndpoint() with",{bufferItem:e,newLogBuffer:this.logBuffer}),[4,this.logUploader.postLogsToEndpoint(this.convertToRequestParams(e.traces.reverse()))];case 2:return o.sent(),[3,5];case 3:return r=o.sent(),this.logger.error("Error sending logs to server",r,!0),[3,5];case 4:return this.sendLogsToServer(),[7];case 5:return[2]}}))}))},t.prototype.sendAllLogsInstantly=function(){var t=this;return this.logBuffer.forEach((function(e){t.logUploader.postLogsToEndpointInstantly(t.convertToRequestParams(e.traces.reverse()))})),this.logUploader.sendEntireQueue()},t.prototype.truncateLog=function(t,e){var r,n,o=a.calculateLogMessageSize(this.convertToTrace(t,e)),i=u.default(e);return i.details="[[TRUNCATED]]",r=this.convertToTrace(t,i),(n=a.calculateLogMessageSize(r))<=14500?(this.logger.warn("message too large to send to server. truncated log details",{originalLog:e,truncatedLog:i,originalTraceSize:o,truncatedTraceSize:n,maxAllowedTraceSize:14500},!0),r):(i.message=i.message.substr(0,150)+"... [[TRUNCATED]]",r=this.convertToTrace(t,i),(n=a.calculateLogMessageSize(r))<=14500?(this.logger.warn("message too large to send to server. truncated log details & log message",{originalLog:e,truncatedLog:i,originalTraceSize:o,truncatedTraceSize:n,maxAllowedTraceSize:14500},!0),r):null)},t.prototype.convertToLogMessage=function(t,e){return{clientTime:(new Date).toISOString(),clientId:this.logger.clientId,message:t,details:e}},t.prototype.convertToTrace=function(t,e){return{topic:this.logger.config.logTopic,level:t.toUpperCase(),message:s.default(e)}},t.prototype.convertToRequestParams=function(t){return{accessToken:this.logger.config.accessToken,app:{appId:this.logger.config.logTopic,appVersion:this.logger.config.appVersion},traces:t}},t.prototype.debug=function(t,e){this.logger.config.debugMode&&console.log("%c [DEBUG:"+this.logger.config.logTopic+"] "+t,"color: #32a852",u.default(e))},t}();e.ServerLogger=l},function(t,e){var r;r=function(){return this}();try{r=r||new Function("return this")()}catch(t){"object"==typeof window&&(r=window)}t.exports=r},function(t,e){t.exports=function(t){return t.webpackPolyfill||(t.deprecate=function(){},t.paths=[],t.children||(t.children=[]),Object.defineProperty(t,"loaded",{enumerable:!0,get:function(){return t.l}}),Object.defineProperty(t,"id",{enumerable:!0,get:function(){return t.i}}),t.webpackPolyfill=1),t}},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},i=this&&this.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(e,"__esModule",{value:!0});var s=i(r(16)),u=r(23),a=i(r(3)),c=r(4),l=new Map;e.getOrCreateLogUploader=function(t,e){void 0===e&&(e=!1);var r=l.get(t);return r||(r=new f(t,e),l.set(t,r)),r};var f=function(){function t(t,e){void 0===e&&(e=!1),this.url=t,this.debugMode=e,this.hasPendingRequest=!1,this.sendQueue=[]}return t.prototype.postLogsToEndpoint=function(t){return n(this,void 0,void 0,(function(){var e;return o(this,(function(r){return e=c.getDeferred(),this.sendQueue.push({requestParams:t,deferred:e}),this.sendNextQueuedLogToServer(),this.debug("adding requestParams to sendQueue",{requestParams:t,updatedSendQueue:this.sendQueue.map((function(t){return t.requestParams})),hasPendingRequest:this.hasPendingRequest}),[2,e.promise]}))}))},t.prototype.postLogsToEndpointInstantly=function(t){return n(this,void 0,void 0,(function(){return o(this,(function(e){return this.debug("sending request instantly",{requestParams:t,sendQueue:this.sendQueue.map((function(t){return t.requestParams}))}),[2,this.sendPostRequest(t)]}))}))},t.prototype.sendEntireQueue=function(){var t;for(this.debug("sending all queued requests instantly to clear out sendQueue",{sendQueue:this.sendQueue.map((function(t){return t.requestParams}))});t=this.sendQueue.shift();)this.postLogsToEndpoint(t.requestParams)},t.prototype.sendNextQueuedLogToServer=function(){return n(this,void 0,void 0,(function(){var t,e=this;return o(this,(function(r){return this.hasPendingRequest||0===this.sendQueue.length?(this.debug("sendNextQueuedLogToServer() but not sending request",{hasPendingRequest:this.hasPendingRequest,sendQueueLength:this.sendQueue.length}),[2]):((t=this.sendQueue.shift()).deferred.promise.finally((function(){e.debug("queue item completed. removing from queue and resetting send queue",{queueItemRequestParams:t.requestParams,updatedSendQueue:e.sendQueue.map((function(t){return t.requestParams}))}),e.hasPendingRequest=!1,e.sendNextQueuedLogToServer()})),this.hasPendingRequest=!0,this.debug("sending logs to server",{queueItem:t.requestParams,sendQueue:this.sendQueue.map((function(t){return t.requestParams}))}),[2,u.backOff((function(){return e.sendPostRequest(t.requestParams)}),{retry:function(t){return t&&429===t.status},numOfAttempts:10,startingDelay:0,delayFirstAttempt:!1,maxDelay:15e3}).then((function(r){e.debug("successfully sent logs to server",{requestParams:t.requestParams,response:r}),t.deferred.resolve(r)})).catch((function(r){return e.debug("ERROR sending logs to server",{requestParams:t.requestParams,error:r}),t.deferred.reject(r)}))])}))}))},t.prototype.sendPostRequest=function(t){return this.debug("issuing POST request",{requestParams:t}),s.default.post(this.url).set("Authorization","Bearer "+t.accessToken).type("application/json; charset=UTF-8").send(t)},t.prototype.debug=function(t,e){this.debugMode&&console.log("%c [DEBUG:log-uploader] "+t,"color: #32a0a8",a.default(e))},t}();e.LogUploader=f},function(t,e,r){"use strict";function n(t){return(n="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)}var o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;var i=r(17),s=r(18),u=r(19),a=r(5),c=r(20),l=r(22);function f(){}t.exports=function(t,r){return"function"==typeof r?new e.Request("GET",t).end(r):1===arguments.length?new e.Request("GET",t):new e.Request(t,r)};var p=e=t.exports;e.Request=m,p.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(t){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(t){}throw new Error("Browser-only version of superagent could not find XHR")};var h="".trim?function(t){return t.trim()}:function(t){return t.replace(/(^\s*|\s*$)/g,"")};function d(t){if(!a(t))return t;var e=[];for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&y(e,r,t[r]);return e.join("&")}function y(t,e,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){y(t,e,r)}));else if(a(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&y(t,"".concat(e,"[").concat(n,"]"),r[n]);else t.push(encodeURI(e)+"="+encodeURIComponent(r));else t.push(encodeURI(e))}function g(t){for(var e,r,n={},o=t.split("&"),i=0,s=o.length;i<s;++i)-1===(r=(e=o[i]).indexOf("="))?n[decodeURIComponent(e)]="":n[decodeURIComponent(e.slice(0,r))]=decodeURIComponent(e.slice(r+1));return n}function b(t){return/[/+]json($|[^-\w])/.test(t)}function v(t){this.req=t,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var e=this.xhr.status;1223===e&&(e=204),this._setStatusProperties(e),this.headers=function(t){for(var e,r,n,o,i=t.split(/\r?\n/),s={},u=0,a=i.length;u<a;++u)-1!==(e=(r=i[u]).indexOf(":"))&&(n=r.slice(0,e).toLowerCase(),o=h(r.slice(e+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&t._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function m(t,e){var r=this;this._query=this._query||[],this.method=t,this.url=e,this.header={},this._header={},this.on("end",(function(){var t,e=null,n=null;try{n=new v(r)}catch(t){return(e=new Error("Parser is unable to parse the response")).parse=!0,e.original=t,r.xhr?(e.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,e.status=r.xhr.status?r.xhr.status:null,e.statusCode=e.status):(e.rawResponse=null,e.status=null),r.callback(e)}r.emit("response",n);try{r._isResponseOK(n)||(t=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(e){t=e}t?(t.original=e,t.response=n,t.status=n.status,r.callback(t,n)):r.callback(null,n)}))}function _(t,e,r){var n=p("DELETE",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}p.serializeObject=d,p.parseString=g,p.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},p.serialize={"application/x-www-form-urlencoded":d,"application/json":s},p.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},c(v.prototype),v.prototype._parseBody=function(t){var e=p.parse[this.type];return this.req._parser?this.req._parser(this,t):(!e&&b(this.type)&&(e=p.parse["application/json"]),e&&t&&(t.length>0||t instanceof Object)?e(t):null)},v.prototype.toError=function(){var t=this.req,e=t.method,r=t.url,n="cannot ".concat(e," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=e,o.url=r,o},p.Response=v,i(m.prototype),u(m.prototype),m.prototype.type=function(t){return this.set("Content-Type",p.types[t]||t),this},m.prototype.accept=function(t){return this.set("Accept",p.types[t]||t),this},m.prototype.auth=function(t,e,r){1===arguments.length&&(e=""),"object"===n(e)&&null!==e&&(r=e,e=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=function(t){if("function"==typeof btoa)return btoa(t);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(t,e,r,o)},m.prototype.query=function(t){return"string"!=typeof t&&(t=d(t)),t&&this._query.push(t),this},m.prototype.attach=function(t,e,r){if(e){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(t,e,r||e.name)}return this},m.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},m.prototype.callback=function(t,e){if(this._shouldRetry(t,e))return this._retry();var r=this._callback;this.clearTimeout(),t&&(this._maxRetries&&(t.retries=this._retries-1),this.emit("error",t)),r(t,e)},m.prototype.crossDomainError=function(){var t=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");t.crossDomain=!0,t.status=this.status,t.method=this.method,t.url=this.url,this.callback(t)},m.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},m.prototype.ca=m.prototype.agent,m.prototype.buffer=m.prototype.ca,m.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},m.prototype.pipe=m.prototype.write,m.prototype._isHost=function(t){return t&&"object"===n(t)&&!Array.isArray(t)&&"[object Object]"!==Object.prototype.toString.call(t)},m.prototype.end=function(t){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=t||f,this._finalizeQueryString(),this._end()},m.prototype._setUploadTimeout=function(){var t=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){t._timeoutError("Upload timeout of ",t._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},m.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var t=this;this.xhr=p.getXHR();var e=this.xhr,r=this._formData||this._data;this._setTimeouts(),e.onreadystatechange=function(){var r=e.readyState;if(r>=2&&t._responseTimeoutTimer&&clearTimeout(t._responseTimeoutTimer),4===r){var n;try{n=e.status}catch(t){n=0}if(!n){if(t.timedout||t._aborted)return;return t.crossDomainError()}t.emit("end")}};var n=function(e,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(t._uploadTimeoutTimer)),r.direction=e,t.emit("progress",r)};if(this.hasListeners("progress"))try{e.addEventListener("progress",n.bind(null,"download")),e.upload&&e.upload.addEventListener("progress",n.bind(null,"upload"))}catch(t){}e.upload&&this._setUploadTimeout();try{this.username&&this.password?e.open(this.method,this.url,!0,this.username,this.password):e.open(this.method,this.url,!0)}catch(t){return this.callback(t)}if(this._withCredentials&&(e.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||p.serialize[o?o.split(";")[0]:""];!i&&b(o)&&(i=p.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&e.setRequestHeader(s,this.header[s]);this._responseType&&(e.responseType=this._responseType),this.emit("request",this),e.send(void 0===r?null:r)},p.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(t){l.prototype[t.toLowerCase()]=function(e,r){var n=new p.Request(t,e);return this._setDefaults(n),r&&n.end(r),n}})),l.prototype.del=l.prototype.delete,p.get=function(t,e,r){var n=p("GET",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.head=function(t,e,r){var n=p("HEAD",t);return"function"==typeof e&&(r=e,e=null),e&&n.query(e),r&&n.end(r),n},p.options=function(t,e,r){var n=p("OPTIONS",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.del=_,p.delete=_,p.patch=function(t,e,r){var n=p("PATCH",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.post=function(t,e,r){var n=p("POST",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n},p.put=function(t,e,r){var n=p("PUT",t);return"function"==typeof e&&(r=e,e=null),e&&n.send(e),r&&n.end(r),n}},function(t,e,r){function n(t){if(t)return function(t){for(var e in n.prototype)t[e]=n.prototype[e];return t}(t)}t.exports=n,n.prototype.on=n.prototype.addEventListener=function(t,e){return this._callbacks=this._callbacks||{},(this._callbacks["$"+t]=this._callbacks["$"+t]||[]).push(e),this},n.prototype.once=function(t,e){function r(){this.off(t,r),e.apply(this,arguments)}return r.fn=e,this.on(t,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(t,e){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+t];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+t],this;for(var o=0;o<n.length;o++)if((r=n[o])===e||r.fn===e){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+t],this},n.prototype.emit=function(t){this._callbacks=this._callbacks||{};for(var e=new Array(arguments.length-1),r=this._callbacks["$"+t],n=1;n<arguments.length;n++)e[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,e)}return this},n.prototype.listeners=function(t){return this._callbacks=this._callbacks||{},this._callbacks["$"+t]||[]},n.prototype.hasListeners=function(t){return!!this.listeners(t).length}},function(t,e){t.exports=o,o.default=o,o.stable=s,o.stableStringify=s;var r=[],n=[];function o(t,e,o){var i;for(!function t(e,o,i,s){var u;if("object"==typeof e&&null!==e){for(u=0;u<i.length;u++)if(i[u]===e){var a=Object.getOwnPropertyDescriptor(s,o);return void(void 0!==a.get?a.configurable?(Object.defineProperty(s,o,{value:"[Circular]"}),r.push([s,o,e,a])):n.push([e,o]):(s[o]="[Circular]",r.push([s,o,e])))}if(i.push(e),Array.isArray(e))for(u=0;u<e.length;u++)t(e[u],u,i,e);else{var c=Object.keys(e);for(u=0;u<c.length;u++){var l=c[u];t(e[l],l,i,e)}}i.pop()}}(t,"",[],void 0),i=0===n.length?JSON.stringify(t,e,o):JSON.stringify(t,u(e),o);0!==r.length;){var s=r.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}return i}function i(t,e){return t<e?-1:t>e?1:0}function s(t,e,o){var s,a=function t(e,o,s,u){var a;if("object"==typeof e&&null!==e){for(a=0;a<s.length;a++)if(s[a]===e){var c=Object.getOwnPropertyDescriptor(u,o);return void(void 0!==c.get?c.configurable?(Object.defineProperty(u,o,{value:"[Circular]"}),r.push([u,o,e,c])):n.push([e,o]):(u[o]="[Circular]",r.push([u,o,e])))}if("function"==typeof e.toJSON)return;if(s.push(e),Array.isArray(e))for(a=0;a<e.length;a++)t(e[a],a,s,e);else{var l={},f=Object.keys(e).sort(i);for(a=0;a<f.length;a++){var p=f[a];t(e[p],p,s,e),l[p]=e[p]}if(void 0===u)return l;r.push([u,o,e]),u[o]=l}s.pop()}}(t,"",[],void 0)||t;for(s=0===n.length?JSON.stringify(a,e,o):JSON.stringify(a,u(e),o);0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return s}function u(t){return t=void 0!==t?t:function(t,e){return e},function(e,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===e&&i[0]===r){r="[Circular]",n.splice(o,1);break}}return t.call(this,e,r)}}},function(t,e,r){"use strict";function n(t){return(n="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)}var o=r(5);function i(t){if(t)return function(t){for(var e in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,e)&&(t[e]=i.prototype[e]);return t}(t)}t.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(t){return this._parser=t,this},i.prototype.responseType=function(t){return this._responseType=t,this},i.prototype.serialize=function(t){return this._serializer=t,this},i.prototype.timeout=function(t){if(!t||"object"!==n(t))return this._timeout=t,this._responseTimeout=0,this._uploadTimeout=0,this;for(var e in t)if(Object.prototype.hasOwnProperty.call(t,e))switch(e){case"deadline":this._timeout=t.deadline;break;case"response":this._responseTimeout=t.response;break;case"upload":this._uploadTimeout=t.upload;break;default:console.warn("Unknown timeout option",e)}return this},i.prototype.retry=function(t,e){return 0!==arguments.length&&!0!==t||(t=1),t<=0&&(t=0),this._maxRetries=t,this._retries=0,this._retryCallback=e,this};var s=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(t,e){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(t,e);if(!0===r)return!0;if(!1===r)return!1}catch(t){console.error(t)}if(e&&e.status&&e.status>=500&&501!==e.status)return!0;if(t){if(t.code&&s.includes(t.code))return!0;if(t.timeout&&"ECONNABORTED"===t.code)return!0;if(t.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},i.prototype.then=function(t,e){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(t,e){n.on("abort",(function(){if(r.timedout&&r.timedoutError)e(r.timedoutError);else{var t=new Error("Aborted");t.code="ABORTED",t.status=r.status,t.method=r.method,t.url=r.url,e(t)}})),n.end((function(r,n){r?e(r):t(n)}))}))}return this._fullfilledPromise.then(t,e)},i.prototype.catch=function(t){return this.then(void 0,t)},i.prototype.use=function(t){return t(this),this},i.prototype.ok=function(t){if("function"!=typeof t)throw new Error("Callback required");return this._okCallback=t,this},i.prototype._isResponseOK=function(t){return!!t&&(this._okCallback?this._okCallback(t):t.status>=200&&t.status<300)},i.prototype.get=function(t){return this._header[t.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(t,e){if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.set(r,t[r]);return this}return this._header[t.toLowerCase()]=e,this.header[t]=e,this},i.prototype.unset=function(t){return delete this._header[t.toLowerCase()],delete this.header[t],this},i.prototype.field=function(t,e){if(null==t)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(o(t)){for(var r in t)Object.prototype.hasOwnProperty.call(t,r)&&this.field(r,t[r]);return this}if(Array.isArray(e)){for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&this.field(t,e[n]);return this}if(null==e)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof e&&(e=String(e)),this._getFormData().append(t,e),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(t,e,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(t,":").concat(e))));break;case"auto":this.username=t,this.password=e;break;case"bearer":this.set("Authorization","Bearer ".concat(t))}return this},i.prototype.withCredentials=function(t){return void 0===t&&(t=!0),this._withCredentials=t,this},i.prototype.redirects=function(t){return this._maxRedirects=t,this},i.prototype.maxResponseSize=function(t){if("number"!=typeof t)throw new TypeError("Invalid argument");return this._maxResponseSize=t,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(t){var e=o(t),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(e&&!this._data)Array.isArray(t)?this._data=[]:this._isHost(t)||(this._data={});else if(t&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(e&&o(this._data))for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(this._data[n]=t[n]);else"string"==typeof t?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(t):t:(this._data||"")+t):this._data=t;return!e||this._isHost(t)||r||this.type("json"),this},i.prototype.sortQuery=function(t){return this._sort=void 0===t||t,this},i.prototype._finalizeQueryString=function(){var t=this._query.join("&");if(t&&(this.url+=(this.url.includes("?")?"&":"?")+t),this._query.length=0,this._sort){var e=this.url.indexOf("?");if(e>=0){var r=this.url.slice(e+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,e)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(t,e,r){if(!this._aborted){var n=new Error("".concat(t+e,"ms exceeded"));n.timeout=e,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var t=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){t._timeoutError("Timeout of ",t._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){t._timeoutError("Response timeout of ",t._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(t,e,r){"use strict";var n=r(21);function o(t){if(t)return function(t){for(var e in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,e)&&(t[e]=o.prototype[e]);return t}(t)}t.exports=o,o.prototype.get=function(t){return this.header[t.toLowerCase()]},o.prototype._setHeaderProperties=function(t){var e=t["content-type"]||"";this.type=n.type(e);var r=n.params(e);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{t.link&&(this.links=n.parseLinks(t.link))}catch(t){}},o.prototype._setStatusProperties=function(t){var e=t/100|0;this.statusCode=t,this.status=this.statusCode,this.statusType=e,this.info=1===e,this.ok=2===e,this.redirect=3===e,this.clientError=4===e,this.serverError=5===e,this.error=(4===e||5===e)&&this.toError(),this.created=201===t,this.accepted=202===t,this.noContent=204===t,this.badRequest=400===t,this.unauthorized=401===t,this.notAcceptable=406===t,this.forbidden=403===t,this.notFound=404===t,this.unprocessableEntity=422===t}},function(t,e,r){"use strict";e.type=function(t){return t.split(/ *; */).shift()},e.params=function(t){return t.split(/ *; */).reduce((function(t,e){var r=e.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(t[n]=o),t}),{})},e.parseLinks=function(t){return t.split(/ *, */).reduce((function(t,e){var r=e.split(/ *; */),n=r[0].slice(1,-1);return t[r[1].split(/ *= */)[1].slice(1,-1)]=n,t}),{})},e.cleanHeader=function(t,e){return delete t["content-type"],delete t["content-length"],delete t["transfer-encoding"],delete t.host,e&&(delete t.authorization,delete t.cookie),t}},function(t,e,r){"use strict";function n(t){return function(t){if(Array.isArray(t)){for(var e=0,r=new Array(t.length);e<t.length;e++)r[e]=t[e];return r}}(t)||function(t){if(Symbol.iterator in Object(t)||"[object Arguments]"===Object.prototype.toString.call(t))return Array.from(t)}(t)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(t){o.prototype[t]=function(){for(var e=arguments.length,r=new Array(e),n=0;n<e;n++)r[n]=arguments[n];return this._defaults.push({fn:t,args:r}),this}})),o.prototype._setDefaults=function(t){this._defaults.forEach((function(e){t[e.fn].apply(t,n(e.args))}))},t.exports=o},function(t,e,r){"use strict";var n=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var i=r(24),s=r(25);e.backOff=function(t,e){return void 0===e&&(e={}),n(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return r=i.getSanitizedOptions(e),[4,new u(t,r).execute()];case 1:return[2,n.sent()]}}))}))};var u=function(){function t(t,e){this.request=t,this.options=e,this.attemptNumber=0}return t.prototype.execute=function(){return n(this,void 0,void 0,(function(){var t;return o(this,(function(e){switch(e.label){case 0:if(this.attemptLimitReached)return[3,7];e.label=1;case 1:return e.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return e.sent(),[4,this.request()];case 3:return[2,e.sent()];case 4:return t=e.sent(),this.attemptNumber++,[4,this.options.retry(t,this.attemptNumber)];case 5:if(!e.sent()||this.attemptLimitReached)throw t;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(t.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),t.prototype.applyDelay=function(){return n(this,void 0,void 0,(function(){return o(this,(function(t){switch(t.label){case 0:return[4,s.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return t.sent(),[2]}}))}))},t}()},function(t,e,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(t){for(var e,r=1,n=arguments.length;r<n;r++)for(var o in e=arguments[r])Object.prototype.hasOwnProperty.call(e,o)&&(t[o]=e[o]);return t}).apply(this,arguments)};Object.defineProperty(e,"__esModule",{value:!0});var o={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};e.getSanitizedOptions=function(t){var e=n(n({},o),t);return e.numOfAttempts<1&&(e.numOfAttempts=1),e}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(26),o=r(30);e.DelayFactory=function(t,e){var r=function(t){if(!t.delayFirstAttempt)return new n.SkipFirstDelay(t);return new o.AlwaysDelay(t)}(t);return r.setAttemptNumber(e),r}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)}),i=this&&this.__awaiter||function(t,e,r,n){return new(r||(r=Promise))((function(o,i){function s(t){try{a(n.next(t))}catch(t){i(t)}}function u(t){try{a(n.throw(t))}catch(t){i(t)}}function a(t){var e;t.done?o(t.value):(e=t.value,e instanceof r?e:new r((function(t){t(e)}))).then(s,u)}a((n=n.apply(t,e||[])).next())}))},s=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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=e.call(t,s)}catch(t){i=[6,t],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(e,"__esModule",{value:!0});var u=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e.prototype.apply=function(){return i(this,void 0,void 0,(function(){return s(this,(function(e){return[2,!!this.isFirstAttempt||t.prototype.apply.call(this)]}))}))},Object.defineProperty(e.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),e}(r(6).Delay);e.SkipFirstDelay=u},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0});var n=r(28),o=r(29);e.JitterFactory=function(t){switch(t.jitter){case"full":return n.fullJitter;case"none":default:return o.noJitter}}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.fullJitter=function(t){var e=Math.random()*t;return Math.round(e)}},function(t,e,r){"use strict";Object.defineProperty(e,"__esModule",{value:!0}),e.noJitter=function(t){return t}},function(t,e,r){"use strict";var n,o=this&&this.__extends||(n=function(t,e){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,e){t.__proto__=e}||function(t,e){for(var r in e)e.hasOwnProperty(r)&&(t[r]=e[r])})(t,e)},function(t,e){function r(){this.constructor=t}n(t,e),t.prototype=null===e?Object.create(e):(r.prototype=e.prototype,new r)});Object.defineProperty(e,"__esModule",{value:!0});var i=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return o(e,t),e}(r(6).Delay);e.AlwaysDelay=i}]).default}));
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define([],t):"object"==typeof exports?exports.GenesysCloudClientLogger=t():e.GenesysCloudClientLogger=t()}(window,(function(){return function(e){var t={};function r(n){if(t[n])return t[n].exports;var o=t[n]={i:n,l:!1,exports:{}};return e[n].call(o.exports,o,o.exports,r),o.l=!0,o.exports}return r.m=e,r.c=t,r.d=function(e,t,n){r.o(e,t)||Object.defineProperty(e,t,{enumerable:!0,get:n})},r.r=function(e){"undefined"!=typeof Symbol&&Symbol.toStringTag&&Object.defineProperty(e,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(e,"__esModule",{value:!0})},r.t=function(e,t){if(1&t&&(e=r(e)),8&t)return e;if(4&t&&"object"==typeof e&&e&&e.__esModule)return e;var n=Object.create(null);if(r.r(n),Object.defineProperty(n,"default",{enumerable:!0,value:e}),2&t&&"string"!=typeof e)for(var o in e)r.d(n,o,function(t){return e[t]}.bind(null,o));return n},r.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return r.d(t,"a",t),t},r.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},r.p="",r(r.s=6)}([function(e,t){var r="undefined"!=typeof crypto&&crypto.getRandomValues&&crypto.getRandomValues.bind(crypto)||"undefined"!=typeof msCrypto&&"function"==typeof window.msCrypto.getRandomValues&&msCrypto.getRandomValues.bind(msCrypto);if(r){var n=new Uint8Array(16);e.exports=function(){return r(n),n}}else{var o=new Array(16);e.exports=function(){for(var e,t=0;t<16;t++)0==(3&t)&&(e=4294967296*Math.random()),o[t]=e>>>((3&t)<<3)&255;return o}}},function(e,t){for(var r=[],n=0;n<256;++n)r[n]=(n+256).toString(16).substr(1);e.exports=function(e,t){var n=t||0,o=r;return[o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],"-",o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]],o[e[n++]]].join("")}},function(e,t){var r=Object.prototype.hasOwnProperty;function n(e){return"[Throws: "+(e?e.message:"?")+"]"}function o(e){var t=[];return function e(o){if(null===o||"object"!=typeof o)return o;if(-1!==t.indexOf(o))return"[Circular]";if(t.push(o),"function"==typeof o.toJSON)try{var i=e(o.toJSON());return t.pop(),i}catch(e){return n(e)}if(Array.isArray(o)){var s=o.map(e);return t.pop(),s}var u=Object.keys(o).reduce((function(t,i){return t[i]=e(function(e,t){if(r.call(e,t))try{return e[t]}catch(e){return n(e)}return e[t]}(o,i)),t}),{});return t.pop(),u}(e)}e.exports=function(e,t,r){return JSON.stringify(o(e),t,r)},e.exports.ensureProperties=o},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0}),t.calculateLogBufferSize=function(e){return e.reduce((function(e,r){return e+t.calculateLogMessageSize(r)}),0)},t.calculateLogMessageSize=function(e){var t=JSON.stringify(e),r=encodeURIComponent(t).match(/%[89ABab]/g);return t.length+(r?r.length:0)},t.getDeferred=function(){var e,t;return{promise:new Promise((function(r,n){e=r,t=n})),resolve:e,reject:t}},t.deepClone=function e(t){if(t){if(Array.isArray(t)){for(var r=[],o=0;o<t.length;o++)r[o]=e(t[o]);return r}if("object"==typeof t){var i=n({},t);for(var s in t)i[s]=e(t[s]);return i}}return t}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}e.exports=function(e){return null!==e&&"object"===n(e)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(24),o=function(){function e(e){this.options=e,this.attempt=0}return e.prototype.apply=function(){var e=this;return new Promise((function(t){return setTimeout(t,e.jitteredDelay)}))},e.prototype.setAttemptNumber=function(e){this.attempt=e},Object.defineProperty(e.prototype,"jitteredDelay",{get:function(){return n.JitterFactory(this.options)(this.delay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"delay",{get:function(){var e=this.options.startingDelay,t=this.options.timeMultiple,r=this.numOfDelayedAttempts,n=e*Math.pow(t,r);return Math.min(n,this.options.maxDelay)},enumerable:!0,configurable:!0}),Object.defineProperty(e.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt},enumerable:!0,configurable:!0}),e}();t.Delay=o},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(7);t.Logger=n.Logger,t.default=n.Logger},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)},o=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(8),s=o(r(2)),u=r(11),a=function(){function e(e){var t=this;this.logMessage=function(e,r,n,o){r instanceof Error&&(n=n||r,r=r.message),r=""+(t.config.appName?"["+t.config.appName+"] ":"")+r;try{t.secondaryLogger[e](r,t.config.stringify?s.default(n):n)}catch(e){console.error("Error logging using custom logger passed into `genesys-cloud-client-logger`",{error:e,secondaryLogger:t.secondaryLogger,message:r,details:n,skipServer:o})}!o&&t.serverLogger&&t.logRank(e)>=t.logRank(t.config.logLevel)&&t.serverLogger.addLogToSend(e,r,n)},Object.defineProperty(this,"clientId",{value:i.v4(),writable:!1}),this.config=n({},e),this.secondaryLogger=this.config.logger||console,delete this.config.logger,-1===this.logRank(this.config.logLevel)&&(e.logLevel&&this.warn('Invalid log level: "'+e.logLevel+'". Default "info" will be used instead.',null,!0),this.config.logLevel="info"),!e.appName&&e.logTopic&&(this.warn("`logTopic` has been renamed to `appName`. Please use `appName`",null,!0),this.config.appName=e.logTopic),!1!==this.config.initializeServerLogging&&(this.serverLogger=new u.ServerLogger(this))}return e.prototype.setAccessToken=function(e){this.config.accessToken=e},e.prototype.log=function(e,t,r){void 0===r&&(r=!1),this.logMessage("log",e,t,r)},e.prototype.debug=function(e,t,r){void 0===r&&(r=!1),this.logMessage("debug",e,t,r)},e.prototype.info=function(e,t,r){void 0===r&&(r=!1),this.logMessage("info",e,t,r)},e.prototype.warn=function(e,t,r){void 0===r&&(r=!1),this.logMessage("warn",e,t,r)},e.prototype.error=function(e,t,r){void 0===r&&(r=!1),this.logMessage("error",e,t,r)},e.prototype.logRank=function(e){switch(e){case"log":return 0;case"debug":return 1;case"info":return 2;case"warn":return 3;case"error":return 4;default:return-1}},e}();t.Logger=a},function(e,t,r){var n=r(9),o=r(10),i=o;i.v1=n,i.v4=o,e.exports=i},function(e,t,r){var n,o,i=r(0),s=r(1),u=0,a=0;e.exports=function(e,t,r){var c=t&&r||0,l=t||[],p=(e=e||{}).node||n,f=void 0!==e.clockseq?e.clockseq:o;if(null==p||null==f){var h=i();null==p&&(p=n=[1|h[0],h[1],h[2],h[3],h[4],h[5]]),null==f&&(f=o=16383&(h[6]<<8|h[7]))}var d=void 0!==e.msecs?e.msecs:(new Date).getTime(),y=void 0!==e.nsecs?e.nsecs:a+1,g=d-u+(y-a)/1e4;if(g<0&&void 0===e.clockseq&&(f=f+1&16383),(g<0||d>u)&&void 0===e.nsecs&&(y=0),y>=1e4)throw new Error("uuid.v1(): Can't create more than 10M uuids/sec");u=d,a=y,o=f;var m=(1e4*(268435455&(d+=122192928e5))+y)%4294967296;l[c++]=m>>>24&255,l[c++]=m>>>16&255,l[c++]=m>>>8&255,l[c++]=255&m;var b=d/4294967296*1e4&268435455;l[c++]=b>>>8&255,l[c++]=255&b,l[c++]=b>>>24&15|16,l[c++]=b>>>16&255,l[c++]=f>>>8|128,l[c++]=255&f;for(var v=0;v<6;++v)l[c+v]=p[v];return t||s(l)}},function(e,t,r){var n=r(0),o=r(1);e.exports=function(e,t,r){var i=t&&r||0;"string"==typeof e&&(t="binary"===e?new Array(16):null,e=null);var s=(e=e||{}).random||(e.rng||n)();if(s[6]=15&s[6]|64,s[8]=63&s[8]|128,t)for(var u=0;u<16;++u)t[i+u]=s[u];return t||o(s)}},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(r(2)),u=r(3),a=r(12),c=function(){function e(e){if(this.isInitialized=!1,this.logBuffer=[],this.debounceTimer=null,this.logger=e,!e.config.url||!e.config.appVersion){var t="Missing `url` and/or `appVersion` config options to set up server logging. Not sending logs to server for this logger instance";throw this.logger.error(t,{providedConfig:e.config},!0),new Error(t)}this.isInitialized=!0,this.debounceLogUploadTime=e.config.uploadDebounceTime||4e3,this.logUploader=a.getOrCreateLogUploader(e.config.url,e.config.debugMode),window.addEventListener("unload",this.sendAllLogsInstantly.bind(this))}return e.prototype.addLogToSend=function(e,t,r){if(this.isInitialized){var n=this.convertToLogMessage(t,r),o=this.convertToTrace(e,n),i=u.calculateLogMessageSize(o);if(i>14500){var s=this.truncateLog(e,n);if(null===s)return void this.logger.error("truncated message is too large to send to server. not sending message",{originalTrace:o,originalTraceSize:u.calculateLogMessageSize(o),truncatedTrace:s,truncatedTraceSize:u.calculateLogMessageSize(s)},!0);i=u.calculateLogMessageSize(s),o=s}var a,c=!this.logBuffer.length;if((a=c?{size:0,traces:[]}:this.logBuffer[this.logBuffer.length-1]).size+i>14500)return this.debug("`exceedsMaxLogSize` was `true`",{logBuffer:this.logBuffer,bufferItem:a,incomingTrace:o,incomingTraceSize:i,maxAllowedTraceSize:14500}),this.logBuffer.push({size:i,traces:[o]}),this.debug("calling sendLogsToServer(true)",{logBuffer:this.logBuffer}),void this.sendLogsToServer(!0);a.size+=i,a.traces.push(o),c&&(this.debug("`this.logBuffer` was empty. pushing new buffer item",{logBuffer:this.logBuffer,bufferItem:a}),this.logBuffer.push(a)),this.debug("calling sendLogsToServer()",{logBuffer:this.logBuffer}),this.sendLogsToServer()}},e.prototype.sendLogsToServer=function(e){return void 0===e&&(e=!1),n(this,void 0,void 0,(function(){var t,r,n=this;return o(this,(function(o){switch(o.label){case 0:if(!this.logBuffer.length)return clearTimeout(this.debounceTimer),this.debounceTimer=null,this.debug("buffer empty, not sending http request"),[2];if(!e)return this.debounceTimer?this.debug("sendLogsToServer() 'immediate' is false. 'debounceTimer' is already running"):(this.debug("sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to "+this.debounceLogUploadTime+"ms"),this.debounceTimer=setTimeout((function(){return n.sendLogsToServer(!0)}),this.debounceLogUploadTime)),[2];clearTimeout(this.debounceTimer),this.debounceTimer=null,t=this.logBuffer.splice(0,1)[0],o.label=1;case 1:return o.trys.push([1,3,4,5]),this.debug("calling logUploader.postLogsToEndpoint() with",{bufferItem:t,newLogBuffer:this.logBuffer}),[4,this.logUploader.postLogsToEndpoint(this.convertToRequestParams(t.traces.reverse()))];case 2:return o.sent(),[3,5];case 3:return r=o.sent(),this.logger.error("Error sending logs to server",r,!0),[3,5];case 4:return this.sendLogsToServer(),[7];case 5:return[2]}}))}))},e.prototype.sendAllLogsInstantly=function(){var e=this;return this.logBuffer.forEach((function(t){e.logUploader.postLogsToEndpointInstantly(e.convertToRequestParams(t.traces.reverse()))})),this.logUploader.sendEntireQueue()},e.prototype.truncateLog=function(e,t){var r,n,o=u.calculateLogMessageSize(this.convertToTrace(e,t)),i=u.deepClone(t);return i.details="[[TRUNCATED]]",r=this.convertToTrace(e,i),(n=u.calculateLogMessageSize(r))<=14500?(this.logger.warn("message too large to send to server. truncated log details",{originalLog:t,truncatedLog:i,originalTraceSize:o,truncatedTraceSize:n,maxAllowedTraceSize:14500},!0),r):(i.message=i.message.substr(0,150)+"... [[TRUNCATED]]",r=this.convertToTrace(e,i),(n=u.calculateLogMessageSize(r))<=14500?(this.logger.warn("message too large to send to server. truncated log details & log message",{originalLog:t,truncatedLog:i,originalTraceSize:o,truncatedTraceSize:n,maxAllowedTraceSize:14500},!0),r):null)},e.prototype.convertToLogMessage=function(e,t){var r={clientTime:(new Date).toISOString(),clientId:this.logger.clientId,message:e,details:t},n=this.logger.config,o=n.originAppName,i=n.originAppVersion,s=n.originAppId;return o&&(r.originAppName=o,r.originAppVersion=i,r.originAppId=s),r},e.prototype.convertToTrace=function(e,t){return{topic:this.logger.config.appName,level:e.toUpperCase(),message:s.default(t)}},e.prototype.convertToRequestParams=function(e){return{accessToken:this.logger.config.accessToken,app:{appId:this.logger.config.appName,appVersion:this.logger.config.appVersion},traces:e}},e.prototype.debug=function(e,t){this.logger.config.debugMode&&console.log("%c [DEBUG:"+this.logger.config.appName+"] "+e,"color: #32a852",u.deepClone(t))},e}();t.ServerLogger=c},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}},i=this&&this.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(t,"__esModule",{value:!0});var s=i(r(13)),u=r(20),a=r(3),c=new Map;t.getOrCreateLogUploader=function(e,t){void 0===t&&(t=!1);var r=c.get(e);return r||(r=new l(e,t),c.set(e,r)),r};var l=function(){function e(e,t){void 0===t&&(t=!1),this.url=e,this.debugMode=t,this.hasPendingRequest=!1,this.sendQueue=[]}return e.prototype.postLogsToEndpoint=function(e){return n(this,void 0,void 0,(function(){var t;return o(this,(function(r){return t=a.getDeferred(),this.sendQueue.push({requestParams:e,deferred:t}),this.sendNextQueuedLogToServer(),this.debug("adding requestParams to sendQueue",{requestParams:e,updatedSendQueue:this.sendQueue.map((function(e){return e.requestParams})),hasPendingRequest:this.hasPendingRequest}),[2,t.promise]}))}))},e.prototype.postLogsToEndpointInstantly=function(e){return n(this,void 0,void 0,(function(){return o(this,(function(t){return this.debug("sending request instantly",{requestParams:e,sendQueue:this.sendQueue.map((function(e){return e.requestParams}))}),[2,this.sendPostRequest(e)]}))}))},e.prototype.sendEntireQueue=function(){var e;for(this.debug("sending all queued requests instantly to clear out sendQueue",{sendQueue:this.sendQueue.map((function(e){return e.requestParams}))});e=this.sendQueue.shift();)this.postLogsToEndpoint(e.requestParams)},e.prototype.sendNextQueuedLogToServer=function(){return n(this,void 0,void 0,(function(){var e,t=this;return o(this,(function(r){return this.hasPendingRequest||0===this.sendQueue.length?(this.debug("sendNextQueuedLogToServer() but not sending request",{hasPendingRequest:this.hasPendingRequest,sendQueueLength:this.sendQueue.length}),[2]):((e=this.sendQueue.shift()).deferred.promise.finally((function(){t.debug("queue item completed. removing from queue and resetting send queue",{queueItemRequestParams:e.requestParams,updatedSendQueue:t.sendQueue.map((function(e){return e.requestParams}))}),t.hasPendingRequest=!1,t.sendNextQueuedLogToServer()})),this.hasPendingRequest=!0,this.debug("sending logs to server",{queueItem:e.requestParams,sendQueue:this.sendQueue.map((function(e){return e.requestParams}))}),[2,u.backOff((function(){return t.sendPostRequest(e.requestParams)}),{retry:function(e){return e&&429===e.status},numOfAttempts:10,startingDelay:0,delayFirstAttempt:!1,maxDelay:15e3}).then((function(r){t.debug("successfully sent logs to server",{requestParams:e.requestParams,response:r}),e.deferred.resolve(r)})).catch((function(r){return t.debug("ERROR sending logs to server",{requestParams:e.requestParams,error:r}),e.deferred.reject(r)}))])}))}))},e.prototype.sendPostRequest=function(e){return this.debug("issuing POST request",{requestParams:e}),s.default.post(this.url).set("Authorization","Bearer "+e.accessToken).type("application/json; charset=UTF-8").send(e)},e.prototype.debug=function(e,t){this.debugMode&&console.log("%c [DEBUG:log-uploader] "+e,"color: #32a0a8",a.deepClone(t))},e}();t.LogUploader=l},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o;"undefined"!=typeof window?o=window:"undefined"==typeof self?(console.warn("Using browser-only version of superagent in non-browser environment"),o=void 0):o=self;var i=r(14),s=r(15),u=r(16),a=r(4),c=r(17),l=r(19);function p(){}e.exports=function(e,r){return"function"==typeof r?new t.Request("GET",e).end(r):1===arguments.length?new t.Request("GET",e):new t.Request(e,r)};var f=t=e.exports;t.Request=v,f.getXHR=function(){if(o.XMLHttpRequest&&(!o.location||"file:"!==o.location.protocol||!o.ActiveXObject))return new XMLHttpRequest;try{return new ActiveXObject("Microsoft.XMLHTTP")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.6.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP.3.0")}catch(e){}try{return new ActiveXObject("Msxml2.XMLHTTP")}catch(e){}throw new Error("Browser-only version of superagent could not find XHR")};var h="".trim?function(e){return e.trim()}:function(e){return e.replace(/(^\s*|\s*$)/g,"")};function d(e){if(!a(e))return e;var t=[];for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&y(t,r,e[r]);return t.join("&")}function y(e,t,r){if(void 0!==r)if(null!==r)if(Array.isArray(r))r.forEach((function(r){y(e,t,r)}));else if(a(r))for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&y(e,"".concat(t,"[").concat(n,"]"),r[n]);else e.push(encodeURI(t)+"="+encodeURIComponent(r));else e.push(encodeURI(t))}function g(e){for(var t,r,n={},o=e.split("&"),i=0,s=o.length;i<s;++i)-1===(r=(t=o[i]).indexOf("="))?n[decodeURIComponent(t)]="":n[decodeURIComponent(t.slice(0,r))]=decodeURIComponent(t.slice(r+1));return n}function m(e){return/[/+]json($|[^-\w])/.test(e)}function b(e){this.req=e,this.xhr=this.req.xhr,this.text="HEAD"!==this.req.method&&(""===this.xhr.responseType||"text"===this.xhr.responseType)||void 0===this.xhr.responseType?this.xhr.responseText:null,this.statusText=this.req.xhr.statusText;var t=this.xhr.status;1223===t&&(t=204),this._setStatusProperties(t),this.headers=function(e){for(var t,r,n,o,i=e.split(/\r?\n/),s={},u=0,a=i.length;u<a;++u)-1!==(t=(r=i[u]).indexOf(":"))&&(n=r.slice(0,t).toLowerCase(),o=h(r.slice(t+1)),s[n]=o);return s}(this.xhr.getAllResponseHeaders()),this.header=this.headers,this.header["content-type"]=this.xhr.getResponseHeader("content-type"),this._setHeaderProperties(this.header),null===this.text&&e._responseType?this.body=this.xhr.response:this.body="HEAD"===this.req.method?null:this._parseBody(this.text?this.text:this.xhr.response)}function v(e,t){var r=this;this._query=this._query||[],this.method=e,this.url=t,this.header={},this._header={},this.on("end",(function(){var e,t=null,n=null;try{n=new b(r)}catch(e){return(t=new Error("Parser is unable to parse the response")).parse=!0,t.original=e,r.xhr?(t.rawResponse=void 0===r.xhr.responseType?r.xhr.responseText:r.xhr.response,t.status=r.xhr.status?r.xhr.status:null,t.statusCode=t.status):(t.rawResponse=null,t.status=null),r.callback(t)}r.emit("response",n);try{r._isResponseOK(n)||(e=new Error(n.statusText||n.text||"Unsuccessful HTTP response"))}catch(t){e=t}e?(e.original=t,e.response=n,e.status=n.status,r.callback(e,n)):r.callback(null,n)}))}function _(e,t,r){var n=f("DELETE",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}f.serializeObject=d,f.parseString=g,f.types={html:"text/html",json:"application/json",xml:"text/xml",urlencoded:"application/x-www-form-urlencoded",form:"application/x-www-form-urlencoded","form-data":"application/x-www-form-urlencoded"},f.serialize={"application/x-www-form-urlencoded":d,"application/json":s},f.parse={"application/x-www-form-urlencoded":g,"application/json":JSON.parse},c(b.prototype),b.prototype._parseBody=function(e){var t=f.parse[this.type];return this.req._parser?this.req._parser(this,e):(!t&&m(this.type)&&(t=f.parse["application/json"]),t&&e&&(e.length>0||e instanceof Object)?t(e):null)},b.prototype.toError=function(){var e=this.req,t=e.method,r=e.url,n="cannot ".concat(t," ").concat(r," (").concat(this.status,")"),o=new Error(n);return o.status=this.status,o.method=t,o.url=r,o},f.Response=b,i(v.prototype),u(v.prototype),v.prototype.type=function(e){return this.set("Content-Type",f.types[e]||e),this},v.prototype.accept=function(e){return this.set("Accept",f.types[e]||e),this},v.prototype.auth=function(e,t,r){1===arguments.length&&(t=""),"object"===n(t)&&null!==t&&(r=t,t=""),r||(r={type:"function"==typeof btoa?"basic":"auto"});var o=function(e){if("function"==typeof btoa)return btoa(e);throw new Error("Cannot use basic auth, btoa is not a function")};return this._auth(e,t,r,o)},v.prototype.query=function(e){return"string"!=typeof e&&(e=d(e)),e&&this._query.push(e),this},v.prototype.attach=function(e,t,r){if(t){if(this._data)throw new Error("superagent can't mix .send() and .attach()");this._getFormData().append(e,t,r||t.name)}return this},v.prototype._getFormData=function(){return this._formData||(this._formData=new o.FormData),this._formData},v.prototype.callback=function(e,t){if(this._shouldRetry(e,t))return this._retry();var r=this._callback;this.clearTimeout(),e&&(this._maxRetries&&(e.retries=this._retries-1),this.emit("error",e)),r(e,t)},v.prototype.crossDomainError=function(){var e=new Error("Request has been terminated\nPossible causes: the network is offline, Origin is not allowed by Access-Control-Allow-Origin, the page is being unloaded, etc.");e.crossDomain=!0,e.status=this.status,e.method=this.method,e.url=this.url,this.callback(e)},v.prototype.agent=function(){return console.warn("This is not supported in browser version of superagent"),this},v.prototype.ca=v.prototype.agent,v.prototype.buffer=v.prototype.ca,v.prototype.write=function(){throw new Error("Streaming is not supported in browser version of superagent")},v.prototype.pipe=v.prototype.write,v.prototype._isHost=function(e){return e&&"object"===n(e)&&!Array.isArray(e)&&"[object Object]"!==Object.prototype.toString.call(e)},v.prototype.end=function(e){this._endCalled&&console.warn("Warning: .end() was called twice. This is not supported in superagent"),this._endCalled=!0,this._callback=e||p,this._finalizeQueryString(),this._end()},v.prototype._setUploadTimeout=function(){var e=this;this._uploadTimeout&&!this._uploadTimeoutTimer&&(this._uploadTimeoutTimer=setTimeout((function(){e._timeoutError("Upload timeout of ",e._uploadTimeout,"ETIMEDOUT")}),this._uploadTimeout))},v.prototype._end=function(){if(this._aborted)return this.callback(new Error("The request has been aborted even before .end() was called"));var e=this;this.xhr=f.getXHR();var t=this.xhr,r=this._formData||this._data;this._setTimeouts(),t.onreadystatechange=function(){var r=t.readyState;if(r>=2&&e._responseTimeoutTimer&&clearTimeout(e._responseTimeoutTimer),4===r){var n;try{n=t.status}catch(e){n=0}if(!n){if(e.timedout||e._aborted)return;return e.crossDomainError()}e.emit("end")}};var n=function(t,r){r.total>0&&(r.percent=r.loaded/r.total*100,100===r.percent&&clearTimeout(e._uploadTimeoutTimer)),r.direction=t,e.emit("progress",r)};if(this.hasListeners("progress"))try{t.addEventListener("progress",n.bind(null,"download")),t.upload&&t.upload.addEventListener("progress",n.bind(null,"upload"))}catch(e){}t.upload&&this._setUploadTimeout();try{this.username&&this.password?t.open(this.method,this.url,!0,this.username,this.password):t.open(this.method,this.url,!0)}catch(e){return this.callback(e)}if(this._withCredentials&&(t.withCredentials=!0),!this._formData&&"GET"!==this.method&&"HEAD"!==this.method&&"string"!=typeof r&&!this._isHost(r)){var o=this._header["content-type"],i=this._serializer||f.serialize[o?o.split(";")[0]:""];!i&&m(o)&&(i=f.serialize["application/json"]),i&&(r=i(r))}for(var s in this.header)null!==this.header[s]&&Object.prototype.hasOwnProperty.call(this.header,s)&&t.setRequestHeader(s,this.header[s]);this._responseType&&(t.responseType=this._responseType),this.emit("request",this),t.send(void 0===r?null:r)},f.agent=function(){return new l},["GET","POST","OPTIONS","PATCH","PUT","DELETE"].forEach((function(e){l.prototype[e.toLowerCase()]=function(t,r){var n=new f.Request(e,t);return this._setDefaults(n),r&&n.end(r),n}})),l.prototype.del=l.prototype.delete,f.get=function(e,t,r){var n=f("GET",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},f.head=function(e,t,r){var n=f("HEAD",e);return"function"==typeof t&&(r=t,t=null),t&&n.query(t),r&&n.end(r),n},f.options=function(e,t,r){var n=f("OPTIONS",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},f.del=_,f.delete=_,f.patch=function(e,t,r){var n=f("PATCH",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},f.post=function(e,t,r){var n=f("POST",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n},f.put=function(e,t,r){var n=f("PUT",e);return"function"==typeof t&&(r=t,t=null),t&&n.send(t),r&&n.end(r),n}},function(e,t,r){function n(e){if(e)return function(e){for(var t in n.prototype)e[t]=n.prototype[t];return e}(e)}e.exports=n,n.prototype.on=n.prototype.addEventListener=function(e,t){return this._callbacks=this._callbacks||{},(this._callbacks["$"+e]=this._callbacks["$"+e]||[]).push(t),this},n.prototype.once=function(e,t){function r(){this.off(e,r),t.apply(this,arguments)}return r.fn=t,this.on(e,r),this},n.prototype.off=n.prototype.removeListener=n.prototype.removeAllListeners=n.prototype.removeEventListener=function(e,t){if(this._callbacks=this._callbacks||{},0==arguments.length)return this._callbacks={},this;var r,n=this._callbacks["$"+e];if(!n)return this;if(1==arguments.length)return delete this._callbacks["$"+e],this;for(var o=0;o<n.length;o++)if((r=n[o])===t||r.fn===t){n.splice(o,1);break}return 0===n.length&&delete this._callbacks["$"+e],this},n.prototype.emit=function(e){this._callbacks=this._callbacks||{};for(var t=new Array(arguments.length-1),r=this._callbacks["$"+e],n=1;n<arguments.length;n++)t[n-1]=arguments[n];if(r){n=0;for(var o=(r=r.slice(0)).length;n<o;++n)r[n].apply(this,t)}return this},n.prototype.listeners=function(e){return this._callbacks=this._callbacks||{},this._callbacks["$"+e]||[]},n.prototype.hasListeners=function(e){return!!this.listeners(e).length}},function(e,t){e.exports=o,o.default=o,o.stable=s,o.stableStringify=s;var r=[],n=[];function o(e,t,o){var i;for(!function e(t,o,i,s){var u;if("object"==typeof t&&null!==t){for(u=0;u<i.length;u++)if(i[u]===t){var a=Object.getOwnPropertyDescriptor(s,o);return void(void 0!==a.get?a.configurable?(Object.defineProperty(s,o,{value:"[Circular]"}),r.push([s,o,t,a])):n.push([t,o]):(s[o]="[Circular]",r.push([s,o,t])))}if(i.push(t),Array.isArray(t))for(u=0;u<t.length;u++)e(t[u],u,i,t);else{var c=Object.keys(t);for(u=0;u<c.length;u++){var l=c[u];e(t[l],l,i,t)}}i.pop()}}(e,"",[],void 0),i=0===n.length?JSON.stringify(e,t,o):JSON.stringify(e,u(t),o);0!==r.length;){var s=r.pop();4===s.length?Object.defineProperty(s[0],s[1],s[3]):s[0][s[1]]=s[2]}return i}function i(e,t){return e<t?-1:e>t?1:0}function s(e,t,o){var s,a=function e(t,o,s,u){var a;if("object"==typeof t&&null!==t){for(a=0;a<s.length;a++)if(s[a]===t){var c=Object.getOwnPropertyDescriptor(u,o);return void(void 0!==c.get?c.configurable?(Object.defineProperty(u,o,{value:"[Circular]"}),r.push([u,o,t,c])):n.push([t,o]):(u[o]="[Circular]",r.push([u,o,t])))}if("function"==typeof t.toJSON)return;if(s.push(t),Array.isArray(t))for(a=0;a<t.length;a++)e(t[a],a,s,t);else{var l={},p=Object.keys(t).sort(i);for(a=0;a<p.length;a++){var f=p[a];e(t[f],f,s,t),l[f]=t[f]}if(void 0===u)return l;r.push([u,o,t]),u[o]=l}s.pop()}}(e,"",[],void 0)||e;for(s=0===n.length?JSON.stringify(a,t,o):JSON.stringify(a,u(t),o);0!==r.length;){var c=r.pop();4===c.length?Object.defineProperty(c[0],c[1],c[3]):c[0][c[1]]=c[2]}return s}function u(e){return e=void 0!==e?e:function(e,t){return t},function(t,r){if(n.length>0)for(var o=0;o<n.length;o++){var i=n[o];if(i[1]===t&&i[0]===r){r="[Circular]",n.splice(o,1);break}}return e.call(this,t,r)}}},function(e,t,r){"use strict";function n(e){return(n="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(e){return typeof e}:function(e){return e&&"function"==typeof Symbol&&e.constructor===Symbol&&e!==Symbol.prototype?"symbol":typeof e})(e)}var o=r(4);function i(e){if(e)return function(e){for(var t in i.prototype)Object.prototype.hasOwnProperty.call(i.prototype,t)&&(e[t]=i.prototype[t]);return e}(e)}e.exports=i,i.prototype.clearTimeout=function(){return clearTimeout(this._timer),clearTimeout(this._responseTimeoutTimer),clearTimeout(this._uploadTimeoutTimer),delete this._timer,delete this._responseTimeoutTimer,delete this._uploadTimeoutTimer,this},i.prototype.parse=function(e){return this._parser=e,this},i.prototype.responseType=function(e){return this._responseType=e,this},i.prototype.serialize=function(e){return this._serializer=e,this},i.prototype.timeout=function(e){if(!e||"object"!==n(e))return this._timeout=e,this._responseTimeout=0,this._uploadTimeout=0,this;for(var t in e)if(Object.prototype.hasOwnProperty.call(e,t))switch(t){case"deadline":this._timeout=e.deadline;break;case"response":this._responseTimeout=e.response;break;case"upload":this._uploadTimeout=e.upload;break;default:console.warn("Unknown timeout option",t)}return this},i.prototype.retry=function(e,t){return 0!==arguments.length&&!0!==e||(e=1),e<=0&&(e=0),this._maxRetries=e,this._retries=0,this._retryCallback=t,this};var s=["ECONNRESET","ETIMEDOUT","EADDRINFO","ESOCKETTIMEDOUT"];i.prototype._shouldRetry=function(e,t){if(!this._maxRetries||this._retries++>=this._maxRetries)return!1;if(this._retryCallback)try{var r=this._retryCallback(e,t);if(!0===r)return!0;if(!1===r)return!1}catch(e){console.error(e)}if(t&&t.status&&t.status>=500&&501!==t.status)return!0;if(e){if(e.code&&s.includes(e.code))return!0;if(e.timeout&&"ECONNABORTED"===e.code)return!0;if(e.crossDomain)return!0}return!1},i.prototype._retry=function(){return this.clearTimeout(),this.req&&(this.req=null,this.req=this.request()),this._aborted=!1,this.timedout=!1,this.timedoutError=null,this._end()},i.prototype.then=function(e,t){var r=this;if(!this._fullfilledPromise){var n=this;this._endCalled&&console.warn("Warning: superagent request was sent twice, because both .end() and .then() were called. Never call .end() if you use promises"),this._fullfilledPromise=new Promise((function(e,t){n.on("abort",(function(){if(r.timedout&&r.timedoutError)t(r.timedoutError);else{var e=new Error("Aborted");e.code="ABORTED",e.status=r.status,e.method=r.method,e.url=r.url,t(e)}})),n.end((function(r,n){r?t(r):e(n)}))}))}return this._fullfilledPromise.then(e,t)},i.prototype.catch=function(e){return this.then(void 0,e)},i.prototype.use=function(e){return e(this),this},i.prototype.ok=function(e){if("function"!=typeof e)throw new Error("Callback required");return this._okCallback=e,this},i.prototype._isResponseOK=function(e){return!!e&&(this._okCallback?this._okCallback(e):e.status>=200&&e.status<300)},i.prototype.get=function(e){return this._header[e.toLowerCase()]},i.prototype.getHeader=i.prototype.get,i.prototype.set=function(e,t){if(o(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.set(r,e[r]);return this}return this._header[e.toLowerCase()]=t,this.header[e]=t,this},i.prototype.unset=function(e){return delete this._header[e.toLowerCase()],delete this.header[e],this},i.prototype.field=function(e,t){if(null==e)throw new Error(".field(name, val) name can not be empty");if(this._data)throw new Error(".field() can't be used if .send() is used. Please use only .send() or only .field() & .attach()");if(o(e)){for(var r in e)Object.prototype.hasOwnProperty.call(e,r)&&this.field(r,e[r]);return this}if(Array.isArray(t)){for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&this.field(e,t[n]);return this}if(null==t)throw new Error(".field(name, val) val can not be empty");return"boolean"==typeof t&&(t=String(t)),this._getFormData().append(e,t),this},i.prototype.abort=function(){return this._aborted||(this._aborted=!0,this.xhr&&this.xhr.abort(),this.req&&this.req.abort(),this.clearTimeout(),this.emit("abort")),this},i.prototype._auth=function(e,t,r,n){switch(r.type){case"basic":this.set("Authorization","Basic ".concat(n("".concat(e,":").concat(t))));break;case"auto":this.username=e,this.password=t;break;case"bearer":this.set("Authorization","Bearer ".concat(e))}return this},i.prototype.withCredentials=function(e){return void 0===e&&(e=!0),this._withCredentials=e,this},i.prototype.redirects=function(e){return this._maxRedirects=e,this},i.prototype.maxResponseSize=function(e){if("number"!=typeof e)throw new TypeError("Invalid argument");return this._maxResponseSize=e,this},i.prototype.toJSON=function(){return{method:this.method,url:this.url,data:this._data,headers:this._header}},i.prototype.send=function(e){var t=o(e),r=this._header["content-type"];if(this._formData)throw new Error(".send() can't be used if .attach() or .field() is used. Please use only .send() or only .field() & .attach()");if(t&&!this._data)Array.isArray(e)?this._data=[]:this._isHost(e)||(this._data={});else if(e&&this._data&&this._isHost(this._data))throw new Error("Can't merge these send calls");if(t&&o(this._data))for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&(this._data[n]=e[n]);else"string"==typeof e?(r||this.type("form"),r=this._header["content-type"],this._data="application/x-www-form-urlencoded"===r?this._data?"".concat(this._data,"&").concat(e):e:(this._data||"")+e):this._data=e;return!t||this._isHost(e)||r||this.type("json"),this},i.prototype.sortQuery=function(e){return this._sort=void 0===e||e,this},i.prototype._finalizeQueryString=function(){var e=this._query.join("&");if(e&&(this.url+=(this.url.includes("?")?"&":"?")+e),this._query.length=0,this._sort){var t=this.url.indexOf("?");if(t>=0){var r=this.url.slice(t+1).split("&");"function"==typeof this._sort?r.sort(this._sort):r.sort(),this.url=this.url.slice(0,t)+"?"+r.join("&")}}},i.prototype._appendQueryString=function(){console.warn("Unsupported")},i.prototype._timeoutError=function(e,t,r){if(!this._aborted){var n=new Error("".concat(e+t,"ms exceeded"));n.timeout=t,n.code="ECONNABORTED",n.errno=r,this.timedout=!0,this.timedoutError=n,this.abort(),this.callback(n)}},i.prototype._setTimeouts=function(){var e=this;this._timeout&&!this._timer&&(this._timer=setTimeout((function(){e._timeoutError("Timeout of ",e._timeout,"ETIME")}),this._timeout)),this._responseTimeout&&!this._responseTimeoutTimer&&(this._responseTimeoutTimer=setTimeout((function(){e._timeoutError("Response timeout of ",e._responseTimeout,"ETIMEDOUT")}),this._responseTimeout))}},function(e,t,r){"use strict";var n=r(18);function o(e){if(e)return function(e){for(var t in o.prototype)Object.prototype.hasOwnProperty.call(o.prototype,t)&&(e[t]=o.prototype[t]);return e}(e)}e.exports=o,o.prototype.get=function(e){return this.header[e.toLowerCase()]},o.prototype._setHeaderProperties=function(e){var t=e["content-type"]||"";this.type=n.type(t);var r=n.params(t);for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(this[o]=r[o]);this.links={};try{e.link&&(this.links=n.parseLinks(e.link))}catch(e){}},o.prototype._setStatusProperties=function(e){var t=e/100|0;this.statusCode=e,this.status=this.statusCode,this.statusType=t,this.info=1===t,this.ok=2===t,this.redirect=3===t,this.clientError=4===t,this.serverError=5===t,this.error=(4===t||5===t)&&this.toError(),this.created=201===e,this.accepted=202===e,this.noContent=204===e,this.badRequest=400===e,this.unauthorized=401===e,this.notAcceptable=406===e,this.forbidden=403===e,this.notFound=404===e,this.unprocessableEntity=422===e}},function(e,t,r){"use strict";t.type=function(e){return e.split(/ *; */).shift()},t.params=function(e){return e.split(/ *; */).reduce((function(e,t){var r=t.split(/ *= */),n=r.shift(),o=r.shift();return n&&o&&(e[n]=o),e}),{})},t.parseLinks=function(e){return e.split(/ *, */).reduce((function(e,t){var r=t.split(/ *; */),n=r[0].slice(1,-1);return e[r[1].split(/ *= */)[1].slice(1,-1)]=n,e}),{})},t.cleanHeader=function(e,t){return delete e["content-type"],delete e["content-length"],delete e["transfer-encoding"],delete e.host,t&&(delete e.authorization,delete e.cookie),e}},function(e,t,r){"use strict";function n(e){return function(e){if(Array.isArray(e)){for(var t=0,r=new Array(e.length);t<e.length;t++)r[t]=e[t];return r}}(e)||function(e){if(Symbol.iterator in Object(e)||"[object Arguments]"===Object.prototype.toString.call(e))return Array.from(e)}(e)||function(){throw new TypeError("Invalid attempt to spread non-iterable instance")}()}function o(){this._defaults=[]}["use","on","once","set","query","type","accept","auth","withCredentials","sortQuery","retry","ok","redirects","timeout","buffer","serialize","parse","ca","key","pfx","cert","disableTLSCerts"].forEach((function(e){o.prototype[e]=function(){for(var t=arguments.length,r=new Array(t),n=0;n<t;n++)r[n]=arguments[n];return this._defaults.push({fn:e,args:r}),this}})),o.prototype._setDefaults=function(e){this._defaults.forEach((function(t){e[t.fn].apply(e,n(t.args))}))},e.exports=o},function(e,t,r){"use strict";var n=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))},o=this&&this.__generator||function(e,t){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var i=r(21),s=r(22);t.backOff=function(e,t){return void 0===t&&(t={}),n(this,void 0,void 0,(function(){var r;return o(this,(function(n){switch(n.label){case 0:return r=i.getSanitizedOptions(t),[4,new u(e,r).execute()];case 1:return[2,n.sent()]}}))}))};var u=function(){function e(e,t){this.request=e,this.options=t,this.attemptNumber=0}return e.prototype.execute=function(){return n(this,void 0,void 0,(function(){var e;return o(this,(function(t){switch(t.label){case 0:if(this.attemptLimitReached)return[3,7];t.label=1;case 1:return t.trys.push([1,4,,6]),[4,this.applyDelay()];case 2:return t.sent(),[4,this.request()];case 3:return[2,t.sent()];case 4:return e=t.sent(),this.attemptNumber++,[4,this.options.retry(e,this.attemptNumber)];case 5:if(!t.sent()||this.attemptLimitReached)throw e;return[3,6];case 6:return[3,0];case 7:throw new Error("Something went wrong.")}}))}))},Object.defineProperty(e.prototype,"attemptLimitReached",{get:function(){return this.attemptNumber>=this.options.numOfAttempts},enumerable:!0,configurable:!0}),e.prototype.applyDelay=function(){return n(this,void 0,void 0,(function(){return o(this,(function(e){switch(e.label){case 0:return[4,s.DelayFactory(this.options,this.attemptNumber).apply()];case 1:return e.sent(),[2]}}))}))},e}()},function(e,t,r){"use strict";var n=this&&this.__assign||function(){return(n=Object.assign||function(e){for(var t,r=1,n=arguments.length;r<n;r++)for(var o in t=arguments[r])Object.prototype.hasOwnProperty.call(t,o)&&(e[o]=t[o]);return e}).apply(this,arguments)};Object.defineProperty(t,"__esModule",{value:!0});var o={delayFirstAttempt:!1,jitter:"none",maxDelay:1/0,numOfAttempts:10,retry:function(){return!0},startingDelay:100,timeMultiple:2};t.getSanitizedOptions=function(e){var t=n(n({},o),e);return t.numOfAttempts<1&&(t.numOfAttempts=1),t}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(23),o=r(27);t.DelayFactory=function(e,t){var r=function(e){if(!e.delayFirstAttempt)return new n.SkipFirstDelay(e);return new o.AlwaysDelay(e)}(e);return r.setAttemptNumber(t),r}},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)}),i=this&&this.__awaiter||function(e,t,r,n){return new(r||(r=Promise))((function(o,i){function s(e){try{a(n.next(e))}catch(e){i(e)}}function u(e){try{a(n.throw(e))}catch(e){i(e)}}function a(e){var t;e.done?o(e.value):(t=e.value,t instanceof r?t:new r((function(e){e(t)}))).then(s,u)}a((n=n.apply(e,t||[])).next())}))},s=this&&this.__generator||function(e,t){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:u(0),throw:u(1),return:u(2)},"function"==typeof Symbol&&(i[Symbol.iterator]=function(){return this}),i;function u(i){return function(u){return function(i){if(r)throw new TypeError("Generator is already executing.");for(;s;)try{if(r=1,n&&(o=2&i[0]?n.return:i[0]?n.throw||((o=n.return)&&o.call(n),0):n.next)&&!(o=o.call(n,i[1])).done)return o;switch(n=0,o&&(i=[2&i[0],o.value]),i[0]){case 0:case 1:o=i;break;case 4:return s.label++,{value:i[1],done:!1};case 5:s.label++,n=i[1],i=[0];continue;case 7:i=s.ops.pop(),s.trys.pop();continue;default:if(!(o=s.trys,(o=o.length>0&&o[o.length-1])||6!==i[0]&&2!==i[0])){s=0;continue}if(3===i[0]&&(!o||i[1]>o[0]&&i[1]<o[3])){s.label=i[1];break}if(6===i[0]&&s.label<o[1]){s.label=o[1],o=i;break}if(o&&s.label<o[2]){s.label=o[2],s.ops.push(i);break}o[2]&&s.ops.pop(),s.trys.pop();continue}i=t.call(e,s)}catch(e){i=[6,e],n=0}finally{r=o=0}if(5&i[0])throw i[1];return{value:i[0]?i[1]:void 0,done:!0}}([i,u])}}};Object.defineProperty(t,"__esModule",{value:!0});var u=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t.prototype.apply=function(){return i(this,void 0,void 0,(function(){return s(this,(function(t){return[2,!!this.isFirstAttempt||e.prototype.apply.call(this)]}))}))},Object.defineProperty(t.prototype,"isFirstAttempt",{get:function(){return 0===this.attempt},enumerable:!0,configurable:!0}),Object.defineProperty(t.prototype,"numOfDelayedAttempts",{get:function(){return this.attempt-1},enumerable:!0,configurable:!0}),t}(r(5).Delay);t.SkipFirstDelay=u},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var n=r(25),o=r(26);t.JitterFactory=function(e){switch(e.jitter){case"full":return n.fullJitter;case"none":default:return o.noJitter}}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.fullJitter=function(e){var t=Math.random()*e;return Math.round(t)}},function(e,t,r){"use strict";Object.defineProperty(t,"__esModule",{value:!0}),t.noJitter=function(e){return e}},function(e,t,r){"use strict";var n,o=this&&this.__extends||(n=function(e,t){return(n=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,t){e.__proto__=t}||function(e,t){for(var r in t)t.hasOwnProperty(r)&&(e[r]=t[r])})(e,t)},function(e,t){function r(){this.constructor=e}n(e,t),e.prototype=null===t?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(t,"__esModule",{value:!0});var i=function(e){function t(){return null!==e&&e.apply(this,arguments)||this}return o(t,e),t}(r(5).Delay);t.AlwaysDelay=i}]).default}));
//# sourceMappingURL=genesys-cloud-client-logger.min.js.map
export interface ILoggerConfig {
/** JWT access token to use in HTTP request */
/**
* JWT access token to use in HTTP request
*/
accessToken: string;

@@ -9,18 +11,120 @@ /**

url: string;
/** version of app using the logging library */
/**
* the version of app using the logging library.
*/
appVersion: string;
/** all local logs will be prefixed by this. */
logTopic: string;
/** initialize server logging. defaults to `true` */
/**
* All local logs will be prefixed by this.
* This is the app name of the app using the logger
* Could also be thought of as the `appName`.
*/
appName: string;
/**
* This name is used when the app who is using the logger
* (ie. the `logTopic` app) is being imported/used/consumed
* by another app. Another way to think about this would
* be `originAppName` is who this app's logger is logging
* "on behalf of" or the "parent app of".
*/
originAppName?: string;
/**
* This version is used when the app who is using the logger
* (ie. the `logTopic` app) is being imported/used/consumed
* by another app. Another way to think about this would
* be `originAppName` is who this app's logger is logging
* "on behalf of" or the "parent app of".
*
* NOTE: this is only used if `originAppName` is provided
*/
originAppVersion?: string;
/**
* This should be the `clientId` of the parent app's logger.
* It is used to correlate the parent app to this child app.
*
* NOTE: this is only used if `originAppName` is provided
*/
originAppId?: string;
/**
* initialize server logging. defaults to `true`
*/
initializeServerLogging?: boolean;
/** logs at this level or high get sent to the server. defaults to 'info' */
/**
* logs at this level or high get sent to the server. defaults to 'info'
*/
logLevel?: LogLevel;
/** time to debounce logs uploads to the server. defaults to 4000 */
/**
* time to debounce logs uploads to the server. defaults to 4000
*/
uploadDebounceTime?: number;
/** debug logger events. defaults to `false` */
/**
* debug logger events. defaults to `false`
*/
debugMode?: boolean;
/** stringify log details when writing to console. defaults to `false` */
/**
* stringify log details when writing to console. defaults to `false`
*/
stringify?: boolean;
/**
* Optional extra logger to use instead of the console.
* Default: console
* NOTE: unless `initializeServerLogging = false`, logs
* will also attempt to upload to the server, even if an
* additional logger is passed in. This logger will be used
* in place of the console, but still alongside this logger.
*/
logger?: ILogger;
}
export declare type LogLevel = 'log' | 'debug' | 'info' | 'warn' | 'error';
export interface ILogger {
/**
* Log a message to the location specified by the logger.
* The logger can decide if it wishes to implement `details`
* or `skipServer`.
*
* @param message message or error to log
* @param details any additional details to log
* @param skipServer should log skip server
*/
log(message: string | Error, details?: any, skipServer?: boolean): void;
/**
* Log a message to the location specified by the logger.
* The logger can decide if it wishes to implement `details`
* or `skipServer`.
*
* @param message message or error to log
* @param details any additional details to log
* @param skipServer should log skip server
*/
debug(message: string | Error, details?: any, skipServer?: boolean): void;
/**
* Log a message to the location specified by the logger.
* The logger can decide if it wishes to implement `details`
* or `skipServer`.
*
* @param message message or error to log
* @param details any additional details to log
* @param skipServer should log skip server
*/
info(message: string | Error, details?: any, skipServer?: boolean): void;
/**
* Log a message to the location specified by the logger.
* The logger can decide if it wishes to implement `details`
* or `skipServer`.
*
* @param message message or error to log
* @param details any additional details to log
* @param skipServer should log skip server
*/
warn(message: string | Error, details?: any, skipServer?: boolean): void;
/**
* Log a message to the location specified by the logger.
* The logger can decide if it wishes to implement `details`
* or `skipServer`.
*
* @param message message or error to log
* @param details any additional details to log
* @param skipServer should log skip server
*/
error(message: string | Error, details?: any, skipServer?: boolean): void;
}
export declare type LogLevel = keyof ILogger;
export interface ITrace {

@@ -35,2 +139,5 @@ topic: string;

message: string;
originAppName?: string;
originAppVersion?: string;
originAppId?: string;
details?: any;

@@ -37,0 +144,0 @@ }

@@ -44,3 +44,2 @@ "use strict";

var exponential_backoff_1 = require("exponential-backoff");
var lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
var utils_1 = require("./utils");

@@ -95,3 +94,3 @@ var logUploaderMap = new Map();

var queueItem;
/* tslint:disable-next-line:no-conditional-assignment */
/* eslint-disable-next-line no-cond-assign */
while (queueItem = this.sendQueue.shift()) {

@@ -155,3 +154,3 @@ this.postLogsToEndpoint(queueItem.requestParams);

/* tslint:disable-next-line:no-console */
console.log("%c [DEBUG:log-uploader] " + message, 'color: #32a0a8', lodash_clonedeep_1.default(details));
console.log("%c [DEBUG:log-uploader] " + message, 'color: #32a0a8', utils_1.deepClone(details));
}

@@ -158,0 +157,0 @@ };

@@ -1,6 +0,7 @@

import { ILoggerConfig } from './interfaces';
export declare class Logger {
import { ILoggerConfig, ILogger } from './interfaces';
export declare class Logger implements ILogger {
readonly clientId: string;
config: ILoggerConfig;
private serverLogger;
private secondaryLogger;
constructor(config: ILoggerConfig);

@@ -7,0 +8,0 @@ setAccessToken(token: string): void;

"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
var __importDefault = (this && this.__importDefault) || function (mod) {

@@ -13,3 +24,2 @@ return (mod && mod.__esModule) ? mod : { "default": mod };

this.logMessage = function (logLevel, message, details, skipServer) {
var _a, _b;
if (message instanceof Error) {

@@ -19,10 +29,11 @@ details = details || message;

}
var prefix = ((_a = _this.config) === null || _a === void 0 ? void 0 : _a.logTopic) ? "[" + _this.config.logTopic + "] " : '';
var prefix = _this.config.appName ? "[" + _this.config.appName + "] " : '';
message = "" + prefix + message;
/* log locally */
if ((_b = _this.config) === null || _b === void 0 ? void 0 : _b.stringify) {
console[logLevel](message, safe_json_stringify_1.default(details));
try {
/* log to secondary logger (default is console) */
_this.secondaryLogger[logLevel](message, _this.config.stringify ? safe_json_stringify_1.default(details) : details);
}
else {
console[logLevel](message, details);
catch (error) {
/* don't let custom logger errors stop our logger */
console.error('Error logging using custom logger passed into `genesys-cloud-client-logger`', { error: error, secondaryLogger: _this.secondaryLogger, message: message, details: details, skipServer: skipServer });
}

@@ -40,9 +51,16 @@ /* log to the server */

});
if (this.logRank(config.logLevel) === -1) {
this.config = __assign({}, config);
this.secondaryLogger = this.config.logger || console;
delete this.config.logger;
if (this.logRank(this.config.logLevel) === -1) {
if (config.logLevel) {
this.warn("Invalid log level: \"" + config.logLevel + "\". Default \"info\" will be used instead.", null, true);
}
config.logLevel = 'info';
this.config.logLevel = 'info';
}
this.config = config;
/* do this for (unofficial) backwards compat */
if (!config.appName && config.logTopic) {
this.warn('`logTopic` has been renamed to `appName`. Please use `appName`', null, true);
this.config.appName = config.logTopic;
}
/* default to always set up server logging */

@@ -49,0 +67,0 @@ if (this.config.initializeServerLogging !== false) {

@@ -43,3 +43,2 @@ "use strict";

var safe_json_stringify_1 = __importDefault(require("safe-json-stringify"));
var lodash_clonedeep_1 = __importDefault(require("lodash.clonedeep"));
var utils_1 = require("./utils");

@@ -154,2 +153,3 @@ var log_uploader_1 = require("./log-uploader");

this.debug("sendLogsToServer() 'immediate' is false. setting up 'debounceTimer' to " + this.debounceLogUploadTime + "ms");
/* eslint-disable-next-line @typescript-eslint/no-misused-promises */
this.debounceTimer = setTimeout(function () { return _this.sendLogsToServer(true); }, this.debounceLogUploadTime);

@@ -200,3 +200,3 @@ }

var originalTraceSize = utils_1.calculateLogMessageSize(this.convertToTrace(logLevel, log));
var logCopy = lodash_clonedeep_1.default(log);
var logCopy = utils_1.deepClone(log);
var truncText = '[[TRUNCATED]]';

@@ -235,3 +235,3 @@ /* first truncate the details */

ServerLogger.prototype.convertToLogMessage = function (message, details) {
return {
var log = {
clientTime: new Date().toISOString(),

@@ -242,6 +242,14 @@ clientId: this.logger.clientId,

};
var _a = this.logger.config, originAppName = _a.originAppName, originAppVersion = _a.originAppVersion, originAppId = _a.originAppId;
/* only add these if they are configured */
if (originAppName) {
log.originAppName = originAppName;
log.originAppVersion = originAppVersion;
log.originAppId = originAppId;
}
return log;
};
ServerLogger.prototype.convertToTrace = function (level, log) {
return {
topic: this.logger.config.logTopic,
topic: this.logger.config.appName,
level: level.toUpperCase(),

@@ -255,3 +263,3 @@ message: safe_json_stringify_1.default(log)

app: {
appId: this.logger.config.logTopic,
appId: this.logger.config.appName,
appVersion: this.logger.config.appVersion

@@ -267,3 +275,3 @@ },

/* tslint:disable-next-line:no-console */
console.log("%c [DEBUG:" + this.logger.config.logTopic + "] " + message, 'color: #32a852', lodash_clonedeep_1.default(details));
console.log("%c [DEBUG:" + this.logger.config.appName + "] " + message, 'color: #32a852', utils_1.deepClone(details));
};

@@ -270,0 +278,0 @@ return ServerLogger;

@@ -5,1 +5,2 @@ import { IDeferred } from "./interfaces";

export declare const getDeferred: () => IDeferred<any>;
export declare const deepClone: <T>(itemToBeCloned: T) => T;
"use strict";
var __assign = (this && this.__assign) || function () {
__assign = Object.assign || function(t) {
for (var s, i = 1, n = arguments.length; i < n; i++) {
s = arguments[i];
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
t[p] = s[p];
}
return t;
};
return __assign.apply(this, arguments);
};
Object.defineProperty(exports, "__esModule", { value: true });

@@ -14,9 +25,30 @@ exports.calculateLogBufferSize = function (arr) {

exports.getDeferred = function () {
var res;
var rej;
var promise = new Promise(function (resolve, reject) {
res = resolve;
rej = reject;
var resolve;
var reject;
var promise = new Promise(function (res, rej) {
resolve = res;
reject = rej;
});
return { promise: promise, resolve: res, reject: rej };
return { promise: promise, resolve: resolve, reject: reject };
};
exports.deepClone = function deepClone(itemToBeCloned) {
/* eslint-disable guard-for-in */
if (itemToBeCloned) {
if (Array.isArray(itemToBeCloned)) {
var clonedArray = [];
for (var i = 0; i < itemToBeCloned.length; i++) {
clonedArray[i] = deepClone(itemToBeCloned[i]);
}
return clonedArray;
}
if (typeof itemToBeCloned === 'object') {
var clonedObject = __assign({}, itemToBeCloned);
for (var key in itemToBeCloned) {
clonedObject[key] = deepClone(itemToBeCloned[key]);
}
return clonedObject;
}
}
return itemToBeCloned;
/* eslint-enable guard-for-in */
};
{
"name": "genesys-cloud-client-logger",
"version":"2.0.0",
"version":"3.0.0-branch.PCM1735.2",
"description": "Common logger for genesys cloud client application to upload logs server",
"main": "dist/src/index.js",
"browser": "dist/genesys-cloud-client-logger.min.js",
"module": "dist/es/index.js",
"web": "dist/genesys-cloud-client-logger.min.js",
"publishConfig": {

@@ -13,7 +14,11 @@ "registry": "https://registry.npmjs.org/"

"start": "npm run build:dev && npm run test:server",
"build": "npm run clean && tsc -p . && webpack --env.production",
"build": "npm run clean && npm run build:es && npm run build:cjs && npm run build:web",
"build:es": "tsc -p . --outDir ./dist/es --target es2015 --module es2015",
"build:cjs": "tsc -p .",
"build:web": "webpack --env.production",
"build:dev": "npm run clean && tsc -p . && webpack",
"lint": "tslint --project . --config tslint.json",
"lint:fix": "tslint --project . --config tslint.json --fix",
"test": "jest --collectCoverage",
"lint": "eslint -c .eslintrc.js --ext .ts src",
"lint:fix": "npm run lint -- --fix",
"test": "npm run lint && npm run test:unit",
"test:unit": "jest --collectCoverage",
"test:watch": "jest --watch --collectCoverage=false --runInBand",

@@ -26,3 +31,2 @@ "test:server": "stupid-server -s"

"pre-push": [
"lint",
"test"

@@ -37,7 +41,11 @@ ],

"@types/jest": "^25.2.1",
"@types/lodash.clonedeep": "^4.5.6",
"@types/safe-json-stringify": "^1.1.0",
"@types/superagent": "^4.1.7",
"@types/uuid": "^7.0.3",
"@typescript-eslint/eslint-plugin": "^4.33.0",
"@typescript-eslint/parser": "^4.33.0",
"babel-loader": "^8.1.0",
"eslint": "^7.32.0",
"eslint-plugin-jsdoc": "^36.1.0",
"eslint-plugin-prefer-arrow": "^1.2.3",
"jest": "^25.4.0",

@@ -50,3 +58,2 @@ "nock": "^13.0.11",

"ts-loader": "^7.0.1",
"tslint": "^6.1.1",
"typescript": "^3.8.3",

@@ -60,3 +67,2 @@ "webpack": "^4.46.0",

"exponential-backoff": "^3.1.0",
"lodash.clonedeep": "^4.5.0",
"safe-json-stringify": "^1.2.0",

@@ -66,2 +72,2 @@ "superagent": "^5.2.2",

}
}
}

@@ -27,3 +27,3 @@ # Genesys Cloud Client Logger

appVersion: '1.2.3',
logTopic: 'your-client-app1'
appName: 'your-client-app1'
});

@@ -38,3 +38,5 @@

interface ILoggerConfig {
/** JWT access token to use in HTTP request */
/**
* JWT access token to use in HTTP request
*/
accessToken: string;

@@ -46,17 +48,58 @@ /**

url: string;
/** version of app using the logging library */
/**
* the version of app using the logging library.
*/
appVersion: string;
/** all local logs will be prefixed by this. */
logTopic: string;
/** initialize server logging. defaults to `true` */
/**
* All local logs will be prefixed by this.
* This is the app name of the app using the logger
* Could also be thought of as the `appName`.
*/
appName: string;
/**
* This name is used when the app who is using the logger
* (ie. the `logTopic` app) is being imported/used/consumed
* by another app. Another way to think about this would
* be `originAppName` is who this app's logger is logging
* "on behalf of" or the "parent app of".
*/
originAppName?: string;
/**
* This version is used when the app who is using the logger
* (ie. the `logTopic` app) is being imported/used/consumed
* by another app. Another way to think about this would
* be `originAppName` is who this app's logger is logging
* "on behalf of" or the "parent app of".
*
* NOTE: this is only used if `originAppName` is provided
*/
originAppVersion?: string;
/**
* This should be the `clientId` of the parent app's logger.
* It is used to correlate the parent app to this child app.
*
* NOTE: this is only used if `originAppName` is provided
*/
originAppId?: string;
/**
* initialize server logging. defaults to `true`
*/
initializeServerLogging?: boolean;
/** logs at this level or high get sent to the server. defaults to 'info' */
logLevel?: 'log' | 'debug' | 'info' | 'warn' | 'error';;
/** time to debounce logs uploads to the server. defaults to 4000 */
/**
* logs at this level or high get sent to the server. defaults to 'info'
*/
logLevel?: LogLevel;
/**
* time to debounce logs uploads to the server. defaults to 4000
*/
uploadDebounceTime?: number;
/** debug logger events. defaults to `false` */
/**
* debug logger events. defaults to `false`
*/
debugMode?: boolean;
/** stringify log details when writing to console. defaults to `false` */
/**
* stringify log details when writing to console. defaults to `false`
*/
stringify?: boolean;
}
```

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc