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

beaver-logger

Package Overview
Dependencies
Maintainers
2
Versions
76
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

beaver-logger - npm Package Compare versions

Comparing version 4.0.6 to 4.0.7

3

dist/beaver-logger.min.js

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

!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("beaver",[],t):"object"==typeof exports?exports.beaver=t():e.beaver=t()}("undefined"!=typeof self?self:this,function(){return function(e){var t={};function n(r){if(t[r])return t[r].exports;var o=t[r]={i:r,l:!1,exports:{}};return e[r].call(o.exports,o,o.exports,n),o.l=!0,o.exports}return n.m=e,n.c=t,n.d=function(e,t,r){n.o(e,t)||Object.defineProperty(e,t,{configurable:!1,enumerable:!0,get:r})},n.n=function(e){var t=e&&e.__esModule?function(){return e.default}:function(){return e};return n.d(t,"a",t),t},n.o=function(e,t){return Object.prototype.hasOwnProperty.call(e,t)},n.p="",n(n.s=7)}([function(e,t,n){"use strict";t.q=c,t.d=function(){if("undefined"!=typeof window)return window;if("undefined"!=typeof window)return window;if("undefined"!=typeof global)return global;throw new Error("No global found")},t.f=function(e){var t=this,n=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{},r=new o.a;function i(){for(var t=arguments.length,o=Array(t),a=0;a<t;a++)o[a]=arguments[a];var c=r.getOrSet(n.thisNamespace?this:e,function(){return{}}),u=s(o),f=n.time;if(c[u]&&f&&Date.now()-c[u].time<f&&delete c[u],c[u])return c[u].value;i.__calling__=!0;var l=Date.now(),d=e.apply(this,arguments);return i.__calling__=!1,c[u]={time:l,value:d},c[u].value}return i.reset=function(){r.delete(n.thisNamespace?t:e)},n.name&&(i.displayName=n.name+":memoized"),i},t.k=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:{};function n(){return r.a.try(e,this,arguments)}return t.name&&(n.displayName=t.name+":promisified"),n},t.e=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],r=e.__inline_memoize_cache__=e.__inline_memoize_cache__||{},o=s(n);return r.hasOwnProperty(o)?r[o]:r[o]=t.apply(void 0,n)},t.g=function(){},t.i=function(e){var t=!1;return function(){if(!t)return t=!0,e.apply(this,arguments)}},t.o=function(e){return"string"==typeof e?e:e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e)},t.c=function(e,t){if(!t)return e;if(Object.assign)return Object.assign(e,t);for(var n in t)t.hasOwnProperty(n)&&(e[n]=t[n]);return e},t.l=function(e,t,n){var r=[];return e.replace(t,function(e){r.push(n?n.apply(null,arguments):e)}),r},t.p=function(e){return"data:image/svg+xml;base64,"+a(e)},t.h=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Boolean,n={};for(var r in e)e.hasOwnProperty(r)&&t(e[r],r)&&(n[r]=e[r]);return n},t.m=function(e,t){var n=[];return e.replace(t,function(e){return n.push(e),""}),n},t.j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,n=void 0,o=void 0;return function(){o&&clearTimeout(o);var i=n=n||new r.a;return o=setTimeout(function(){n=null,o=null,r.a.try(e).then(function(e){i.resolve(e)},function(e){i.reject(e)})},t),i}},t.n=function(e,t){var n=void 0;return function r(){n=setTimeout(function(){e(),r()},t)}(),{cancel:function(){clearTimeout(n)}}},t.a=function(e){return e.charAt(0).toUpperCase()+e.slice(1).toLowerCase()},t.b=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:100,n=void 0;return function(){var r=this,o=arguments;clearTimeout(n),n=setTimeout(function(){return e.apply(r,o)},t)}};var r=n(1),o=n(5),i="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};function a(e){return window.btoa(e)}function c(){var e="0123456789abcdef";return"xxxxxxxxxx".replace(/./g,function(){return e.charAt(Math.floor(Math.random()*e.length))})+"_"+a((new Date).toISOString().slice(11,19).replace("T",".")).replace(/[^a-zA-Z0-9]/g,"").toLowerCase()}var u=void 0;function s(e){try{return JSON.stringify(Array.prototype.slice.call(e),function(e,t){return"function"==typeof t?"memoize["+function(e){if(u=u||new o.a,null===e||void 0===e||"object"!==(void 0===e?"undefined":i(e))&&"function"!=typeof e)throw new Error("Invalid object");var t=u.get(e);return t||(t=(void 0===e?"undefined":i(e))+":"+c(),u.set(e,t)),t}(t)+"]":t})}catch(e){throw new Error("Arguments not serializable -- can not be used to memoize")}}},function(e,t,n){"use strict";function r(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var t={}.toString;if(t){var n=t.call(e);if("[object Window]"===n||"[object global]"===n||"[object DOMWindow]"===n)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}function o(){var e=void 0;if("undefined"!=typeof window)e=window;else{if("undefined"==typeof window)throw new TypeError("Can not find global");e=window}var t=e.__zalgopromise__=e.__zalgopromise__||{};return t.flushPromises=t.flushPromises||[],t.activeCount=t.activeCount||0,t.possiblyUnhandledPromiseHandlers=t.possiblyUnhandledPromiseHandlers||[],t.dispatchedErrors=t.dispatchedErrors||[],t}var i=function(){function e(t){var n=this;if(function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var r=void 0,o=void 0,i=!1,a=!1,c=!1;try{t(function(e){c?n.resolve(e):(i=!0,r=e)},function(e){c?n.reject(e):(a=!0,o=e)})}catch(e){return void this.reject(e)}c=!0,i?this.resolve(r):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var t=this;if(this.resolved||this.rejected)return this;if(r(e))throw new Error("Can not reject promise with another promise");if(!e){var n=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+n)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){t.errorHandled||function(e,t){if(-1===o().dispatchedErrors.indexOf(e)){o().dispatchedErrors.push(e),setTimeout(function(){throw e},1);for(var n=0;n<o().possiblyUnhandledPromiseHandlers.length;n++)o().possiblyUnhandledPromiseHandlers[n](e,t)}}(e,t)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){this.errorHandled=!0,this.reject(e)},e.prototype.dispatch=function(){var t=this,n=this.dispatching,i=this.resolved,a=this.rejected,c=this.handlers;if(!n&&(i||a)){this.dispatching=!0,o().activeCount+=1;for(var u=function(n){var o=c[n],u=o.onSuccess,s=o.onError,f=o.promise,l=void 0;if(i)try{l=u?u(t.value):t.value}catch(e){return f.reject(e),"continue"}else if(a){if(!s)return f.reject(t.error),"continue";try{l=s(t.error)}catch(e){return f.reject(e),"continue"}}l instanceof e&&(l.resolved||l.rejected)?(l.resolved?f.resolve(l.value):f.reject(l.error),l.errorHandled=!0):r(l)?l instanceof e&&(l.resolved||l.rejected)?l.resolved?f.resolve(l.value):f.reject(l.error):l.then(function(e){f.resolve(e)},function(e){f.reject(e)}):f.resolve(l)},s=0;s<c.length;s++)u(s);c.length=0,this.dispatching=!1,o().activeCount-=1,0===o().activeCount&&e.flushQueue()}},e.prototype.then=function(t,n){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for success handler");if(n&&"function"!=typeof n&&!n.call)throw new Error("Promise.then expected a function for error handler");var r=new e;return this.handlers.push({promise:r,onSuccess:t,onError:n}),this.errorHandled=!0,this.dispatch(),r},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(t){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(n){return e.try(t).then(function(){return n})},function(n){return e.try(t).then(function(){throw n})})},e.prototype.timeout=function(e,t){var n=this;if(this.resolved||this.rejected)return this;var r=setTimeout(function(){n.resolved||n.rejected||n.reject(t||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(r),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(t){return t instanceof e?t:r(t)?new e(function(e,n){return t.then(e,n)}):(new e).resolve(t)},e.reject=function(t){return(new e).reject(t)},e.all=function(t){var n=new e,o=t.length,i=[];if(!o)return n.resolve(i),n;for(var a=function(a){var c=t[a];if(c instanceof e){if(c.resolved)return i[a]=c.value,o-=1,"continue"}else if(!r(c))return i[a]=c,o-=1,"continue";e.resolve(c).then(function(e){i[a]=e,0==(o-=1)&&n.resolve(i)},function(e){n.reject(e)})},c=0;c<t.length;c++)a(c);return 0===o&&n.resolve(i),n},e.hash=function(t){var n={};return e.all(Object.keys(t).map(function(r){return e.resolve(t[r]).then(function(e){n[r]=e})})).then(function(){return n})},e.map=function(t,n){return e.all(t.map(n))},e.onPossiblyUnhandledException=function(e){return function(e){return o().possiblyUnhandledPromiseHandlers.push(e),{cancel:function(){o().possiblyUnhandledPromiseHandlers.splice(o().possiblyUnhandledPromiseHandlers.indexOf(e),1)}}}(e)},e.try=function(t,n,r){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.try expected a function");var o=void 0;try{o=t.apply(n,r||[])}catch(t){return e.reject(t)}return e.resolve(o)},e.delay=function(t){return new e(function(e){setTimeout(e,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||r(t)},e.flush=function(){var t=new e;return o().flushPromises.push(t),0===o().activeCount&&e.flushQueue(),t},e.flushQueue=function(){var e=o().flushPromises;o().flushPromises=[];for(var t=0,n=null==e?0:e.length;t<n;t++)e[t].resolve()},e}();n.d(t,"a",function(){return i})},function(e,t,n){"use strict";n(1),n(3),n(5);var r=n(0);n(4),t.c=function(){return"undefined"!=typeof window},t.d=function e(){return Object(r.e)(e,function(){try{if("undefined"==typeof window)return!1;if(window.localStorage){var e=Math.random().toString();window.localStorage.setItem("__test__localStorage__",e);var t=window.localStorage.getItem("__test__localStorage__");if(window.localStorage.removeItem("__test__localStorage__"),e===t)return!0}}catch(e){}return!1})},t.a=function(e,t){e.appendChild(t)},t.g=function(e,t){try{e.document.open(),e.document.write(t),e.document.close()}catch(n){try{e.location="javascript: document.open(); document.write("+JSON.stringify(t)+"); document.close();"}catch(e){}}},t.f=function(e,t){var n=t.tagName.toLowerCase();if("html"!==n)throw new Error("Expected element to be html, got "+n);for(var r=e.document.documentElement;r.children&&r.children.length;)r.removeChild(r.children[0]);for(;t.children.length;)r.appendChild(t.children[0])},t.e=function(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:window.document;e.styleSheet?e.styleSheet.cssText=t:e.appendChild(n.createTextNode(t))},t.b=function(e){for(var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document,n=0,r=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:window.document;return Array.prototype.slice.call(t.querySelectorAll(e))}("script",e),o=null==r?0:r.length;n<o;n++){var i=r[n],a=i.parentNode;if(a){var c=t.createElement("script");c.text=i.textContent,a.replaceChild(c,i)}}},"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype)},function(e,t,n){"use strict";var r=n(9);n.d(t,"isWindow",function(){return r.a}),n.d(t,"isWindowClosed",function(){return r.b}),n.d(t,"linkFrameWindow",function(){return r.c});var o=n(10);n.n(o)},function(e,t,n){"use strict";t.a=function(){return!!(window.navigator.mockUserAgent||window.navigator.userAgent).match(/Android|webOS|iPhone|iPad|iPod|bada|Symbian|Palm|CriOS|BlackBerry|IEMobile|WindowsMobile|Opera Mini/i)}},function(e,t,n){"use strict";n.d({},"WeakMap",function(){return c});var r=n(3);function o(e,t){for(var n=0;n<e.length;n++)try{if(e[n]===t)return n}catch(e){}return-1}var i=Object.defineProperty,a=Date.now()%1e9,c=function(){function e(){if(function(t,n){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),a+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+a,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,t={};return Object.freeze(t),e.set(t,"__testvalue__"),"__testvalue__"===e.get(t)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,t=this.keys,n=0;n<t.length;n++){var o=t[n];if(Object(r.isWindow)(o)&&Object(r.isWindowClosed)(o)){if(e)try{e.delete(o)}catch(e){}t.splice(n,1),this.values.splice(n,1),n-=1}}},e.prototype.isSafeToReadWrite=function(e){if(Object(r.isWindow)(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,t){if(!e)throw new Error("WeakMap expected key");var n=this.weakmap;if(n)try{n.set(e,t)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=this.name,a=e[r];a&&a[0]===e?a[1]=t:i(e,r,{value:[e,t],writable:!0})}else{this._cleanupClosedWindows();var c=this.keys,u=this.values,s=o(c,e);-1===s?(c.push(e),u.push(t)):u[s]=t}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(e))return t.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var n=o(this.keys,e);if(-1===n)return;return this.values[n]}var r=e[this.name];if(r&&r[0]===e)return r[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];n&&n[0]===e&&(n[0]=n[1]=void 0)}else{this._cleanupClosedWindows();var r=this.keys,i=o(r,e);-1!==i&&(r.splice(i,1),this.values.splice(i,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{return t.has(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=e[this.name];return!(!n||n[0]!==e)}return this._cleanupClosedWindows(),-1!==o(this.keys,e)},e.prototype.getOrSet=function(e,t){if(this.has(e))return this.get(e);var n=t();return this.set(e,n),n},e}();n.d(t,"a",function(){return c})},function(e,t,n){"use strict";t.a=function e(t){var n=t.name,i=t.version,a=void 0===i?"latest":i,c=t.lifetime,u=void 0===c?3e5:c;return Object(r.e)(e,function(){var e="__"+n+"_"+a+"_storage__",t=void 0;function i(n){var i=Object(o.d)(),a=void 0;if(t&&(a=t),!a&&i){var c=window.localStorage.getItem(e);c&&(a=JSON.parse(c))}a||(a=Object(r.d)()[e]),a||(a={id:Object(r.q)()}),a.id||(a.id=Object(r.q)()),t=a;var u=n(a);return i?window.localStorage.setItem(e,JSON.stringify(a)):Object(r.d)()[e]=a,t=null,u}function c(e){return i(function(t){var n=t.__session__,o=Date.now();return n&&o-n.created>u&&(n=null),n||(n={guid:Object(r.q)(),created:o}),t.__session__=n,e(n)})}return{getState:i,getID:function(){return i(function(e){return e.id})},getSessionState:function(e){return c(function(t){return t.state=t.state||{},e(t.state)})},getSessionID:function(){return c(function(e){return e.guid})}}},[{name:n,version:a,lifetime:u}])};var r=n(0),o=n(2)},function(e,t,n){"use strict";Object.defineProperty(t,"__esModule",{value:!0});var r=n(1),o=n(8),i={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"},a=[i.WARN,i.ERROR],c=[i.ERROR,i.WARN,i.INFO,i.DEBUG],u=6e4,s=i.WARN,f=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var n=arguments[t];for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[r]=n[r])}return e};function l(e){var t=e.url,n=e.method,r=e.headers,i=e.json;return Object(o.request)({url:t,method:n,headers:r,json:i}).then(o.noop)}function d(e,t){for(var n in t)t.hasOwnProperty(n)&&t[n]&&(e[n]=t[n])}function h(e){var t=e.url,n=e.prefix,h=e.logLevel,p=void 0===h?s:h,w=e.transport,v=void 0===w?l:w,y=e.flushInterval,m=void 0===y?u:y,g=[],O=[],b=[],_=[],j=[],E=[];function T(e,t,n){if(Object(o.isBrowser)()&&window.console&&window.console.log){var r=p;if(window.LOG_LEVEL&&-1!==c.indexOf(window.LOG_LEVEL)&&(r=window.LOG_LEVEL),!(c.indexOf(e)>c.indexOf(r))){var i=[t];i.push(n),(n.error||n.warning)&&i.push("\n\n",n.error||n.warning);try{window.console[e]&&window.console[e].apply?window.console[e].apply(window.console,i):window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,i)}catch(e){}}}}function S(){return r.a.try(function(){if(Object(o.isBrowser)()&&(g.length||O.length)){for(var e={},n=0,r=null==_?0:_.length;n<r;n++)d(e,(0,_[n])(e));for(var i={},a=0,c=null==E?0:E.length;a<c;a++)d(i,(0,E[a])(i));var u=v({method:"POST",url:t,headers:i,json:{events:g,meta:e,tracking:O}});return g=[],O=[],u.then(o.noop)}})}var C=Object(o.promiseDebounce)(S);function P(e,t){var r=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(Object(o.isBrowser)()){n&&(t=n+"_"+t);for(var i=f({},Object(o.objFilter)(r),{timestamp:Date.now().toString()}),c=0,u=null==b?0:b.length;c<u;c++)d(i,(0,b[c])(i));!function(e,t,n){g.push({level:e,event:t,payload:n}),-1!==a.indexOf(e)&&C()}(e,t,i),T(e,t,i)}}return Object(o.isBrowser)()&&Object(o.safeInterval)(C,m),{debug:function(e,t){P(i.DEBUG,e,t)},info:function(e,t){P(i.INFO,e,t)},warn:function(e,t){P(i.WARN,e,t)},error:function(e,t){P(i.ERROR,e,t)},track:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(Object(o.isBrowser)()){for(var t=Object(o.objFilter)(e),n=0,r=null==j?0:j.length;n<r;n++)d(t,(0,j[n])(t));T(i.DEBUG,"track",t),O.push(t)}},flush:C,immediateFlush:S,addPayloadBuilder:function(e){b.push(e)},addMetaBuilder:function(e){_.push(e)},addTrackingBuilder:function(e){j.push(e)},addHeaderBuilder:function(e){E.push(e)},setTransport:function(e){v=e}}}n.d(t,"Logger",function(){return h}),n.d(t,"LOG_LEVEL",function(){return i})},function(e,t,n){"use strict";n(4);var r=n(2);n.d(t,"isBrowser",function(){return r.c}),n(11),n(12),n(13),n(6);var o=n(0);n.d(t,"noop",function(){return o.g}),n.d(t,"objFilter",function(){return o.h}),n.d(t,"promiseDebounce",function(){return o.j}),n.d(t,"safeInterval",function(){return o.n});var i=n(14);n.d(t,"request",function(){return i.a});var a=n(15);n.n(a),n(16),n(17)},function(e,t,n){"use strict";t.b=d,t.c=function(e){if(function(){for(var e=0;e<l.length;e++)s(l[e])&&(l.splice(e,1),f.splice(e,1));for(var t=0;t<f.length;t++)d(f[t])&&(l.splice(t,1),f.splice(t,1))}(),e&&e.contentWindow)try{f.push(e.contentWindow),l.push(e)}catch(e){}},t.a=function(e){try{if(e===window)return!0}catch(e){if(e&&e.message===o)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===o)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===o)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===o)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===o)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===o)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1};var r={MOCK_PROTOCOL:"mock:",FILE_PROTOCOL:"file:",ABOUT_PROTOCOL:"about:",WILDCARD:"*"},o="Call was rejected by callee.\r\n";function i(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===r.ABOUT_PROTOCOL}function a(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function c(e){var t=(e=e||window).location;if(!t)throw new Error("Can not read window location");var n=t.protocol;if(!n)throw new Error("Can not read window protocol");if(n===r.FILE_PROTOCOL)return r.FILE_PROTOCOL+"//";if(n===r.ABOUT_PROTOCOL){var o=function(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}(e);return o&&a(o)?c(o):r.ABOUT_PROTOCOL+"//"}var i=t.host;if(!i)throw new Error("Can not read window host");return n+"//"+i}function u(e){var t=c(e=e||window);return t&&e.mockDomain&&0===e.mockDomain.indexOf(r.MOCK_PROTOCOL)?e.mockDomain:t}function s(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var t=e.ownerDocument;return!(!t||!t.documentElement||t.documentElement.contains(e))}var f=[],l=[];function d(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==o}if(t&&function(e){if(!function(e){try{if(e===window)return!0}catch(e){}try{var t=Object.getOwnPropertyDescriptor(e,"location");if(t&&!1===t.enumerable)return!1}catch(e){}try{if(i(e)&&a(e))return!0}catch(e){}try{if(c(e)===c(window))return!0}catch(e){}return!1}(e))return!1;try{if(e===window)return!0;if(i(e)&&a(e))return!0;if(u(window)===u(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var n=function(e,t){for(var n=0;n<e.length;n++)try{if(e[n]===t)return n}catch(e){}return-1}(f,e);if(-1!==n){var r=l[n];if(r&&s(r))return!0}return!1}},function(e,t){},function(e,t,n){"use strict";n(0),n(6)},function(e,t,n){"use strict";n(0)},function(e,t,n){"use strict";function r(e,t){if(!(e instanceof t))throw new TypeError("Cannot call a class as a function")}function o(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").toString().replace(/&/g,"&amp;").replace(/</g,"&lt;").replace(/>/g,"&gt;").replace(/"/g,"&quot;").replace(/'/g,"&#x27;").replace(/\//g,"&#x2F;")}n(0),n(2),"function"==typeof Symbol&&Symbol.iterator,Object.assign,function(e){function t(n){return r(this,t),function(e,t){if(!e)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return!t||"object"!=typeof t&&"function"!=typeof t?e:t}(this,e.call(this,"",{},n))}(function(e,t){if("function"!=typeof t&&null!==t)throw new TypeError("Super expression must either be null or a function, not "+typeof t);e.prototype=Object.create(t&&t.prototype,{constructor:{value:e,enumerable:!1,writable:!0,configurable:!0}}),t&&(Object.setPrototypeOf?Object.setPrototypeOf(e,t):e.__proto__=t)})(t,e),t.prototype.toString=function(){return this.childrenToString()}}(function(){function e(t,n,o){r(this,e),this.name=t,this.props=n,this.children=o}return e.prototype.toString=function(){var e=this.name,t=this.propsToString(),n=this.childrenToString();return"<"+e+(t?" ":"")+t+">"+n+"</"+e+">"},e.prototype.propsToString=function(){var e=this.props;return e?Object.keys(e).filter(function(t){return"innerHTML"!==t&&e&&!1!==e[t]}).map(function(t){if(e){var n=e[t];if(!0===n)return""+o(t);if("string"==typeof n)return o(t)+'="'+o(n)+'"'}return""}).filter(Boolean).join(" "):""},e.prototype.childrenToString=function(){if(this.props&&this.props.innerHTML)return this.props.innerHTML;if(!this.children)return"";var t="";return function n(r){for(var i=0,a=null==r?0:r.length;i<a;i++){var c=r[i];null!==c&&void 0!==c&&(Array.isArray(c)?n(c):t+=c instanceof e?c.toString():o(c))}}(this.children),t},e}())},function(e,t,n){"use strict";t.a=function(e){var t=e.url,n=e.method,a=void 0===n?"get":n,c=e.headers,u=void 0===c?{}:c,s=e.json,f=e.data,l=e.body,d=e.win,h=void 0===d?window:d,p=e.timeout,w=void 0===p?0:p;return new r.a(function(e,n){if(s&&f||s&&l||f&&s)throw new Error("Only options.json or options.data or options.body should be passed");for(var r={},c=0,d=Object.keys(u),p=null==d?0:d.length;c<p;c++){var v=d[c];r[v.toLowerCase()]=u[v]}s?r[o.CONTENT_TYPE]=r[o.CONTENT_TYPE]||"application/json":(f||l)&&(r[o.CONTENT_TYPE]=r[o.CONTENT_TYPE]||"application/x-www-form-urlencoded; charset=utf-8"),r[o.ACCEPT]=r[o.ACCEPT]||"application/json";for(var y=0,m=null==i?0:i.length;y<m;y++)for(var g=(0,i[y])(),O=0,b=Object.keys(g),_=null==b?0:b.length;O<_;O++){var j=b[O];r[j.toLowerCase()]=g[j]}var E=new h.XMLHttpRequest;for(var T in E.addEventListener("load",function(){var r=function(){for(var e={},t=0,n=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split("\n"),r=null==n?0:n.length;t<r;t++){var o=n[t].split(":"),i=o[0],a=o.slice(1);e[i.toLowerCase()]=a.join(":").trim()}return e}(this.getAllResponseHeaders());if(!this.status)return n(new Error("Request to "+a.toLowerCase()+" "+t+" failed: no response status code."));var o=r["content-type"],i=o&&(0===o.indexOf("application/json")||0===o.indexOf("text/json")),c=this.responseText;try{c=JSON.parse(c)}catch(e){if(i)return n(new Error("Invalid json: "+this.responseText+"."))}var u={status:this.status,headers:r,body:c};return e(u)},!1),E.addEventListener("error",function(e){n(new Error("Request to "+a.toLowerCase()+" "+t+" failed: "+e.toString()+"."))},!1),E.open(a,t,!0),r)r.hasOwnProperty(T)&&E.setRequestHeader(T,r[T]);s?l=JSON.stringify(s):f&&(l=Object.keys(f).map(function(e){return encodeURIComponent(e)+"="+(f?encodeURIComponent(f[e]):"")}).join("&")),E.timeout=w,E.ontimeout=function(){n(new Error("Request to "+a.toLowerCase()+" "+t+" has timed out"))},E.send(l)})};var r=n(1),o=(n(3),{CONTENT_TYPE:"content-type",ACCEPT:"accept"}),i=[]},function(e,t){},function(e,t,n){"use strict";n(0)},function(e,t,n){"use strict"}])});
//# sourceMappingURL=beaver-logger.min.js.map
!function(e,t){"object"==typeof exports&&"object"==typeof module?module.exports=t():"function"==typeof define&&define.amd?define("beaver",[],t):"object"==typeof exports?exports.beaver=t():e.beaver=t()}("undefined"!=typeof self?self:this,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,{configurable:!1,enumerable:!0,get: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=0)}([function(e,t,r){"use strict";function n(e){try{if(!e)return!1;if("undefined"!=typeof Promise&&e instanceof Promise)return!0;if("undefined"!=typeof window&&window.Window&&e instanceof window.Window)return!1;if("undefined"!=typeof window&&window.constructor&&e instanceof window.constructor)return!1;var t={}.toString;if(t){var r=t.call(e);if("[object Window]"===r||"[object global]"===r||"[object DOMWindow]"===r)return!1}if("function"==typeof e.then)return!0}catch(e){return!1}return!1}Object.defineProperty(t,"__esModule",{value:!0}),r.d({},"WeakMap",function(){return T});var o=[],i=[],a=0,u=void 0;function c(){if(!a&&u){var e=u;u=null,e.resolve()}}function s(){a+=1}function f(){a-=1,c()}var l=function(){function e(t){var r=this;if(function(t,r){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),this.resolved=!1,this.rejected=!1,this.errorHandled=!1,this.handlers=[],t){var n=void 0,o=void 0,i=!1,a=!1,u=!1;s();try{t(function(e){u?r.resolve(e):(i=!0,n=e)},function(e){u?r.reject(e):(a=!0,o=e)})}catch(e){return f(),void this.reject(e)}f(),u=!0,i?this.resolve(n):a&&this.reject(o)}}return e.prototype.resolve=function(e){if(this.resolved||this.rejected)return this;if(n(e))throw new Error("Can not resolve promise with another promise");return this.resolved=!0,this.value=e,this.dispatch(),this},e.prototype.reject=function(e){var t=this;if(this.resolved||this.rejected)return this;if(n(e))throw new Error("Can not reject promise with another promise");if(!e){var r=e&&"function"==typeof e.toString?e.toString():Object.prototype.toString.call(e);e=new Error("Expected reject to be called with Error, got "+r)}return this.rejected=!0,this.error=e,this.errorHandled||setTimeout(function(){t.errorHandled||function(e,t){if(-1===o.indexOf(e)){o.push(e),setTimeout(function(){throw e},1);for(var r=0;r<i.length;r++)i[r](e,t)}}(e,t)},1),this.dispatch(),this},e.prototype.asyncReject=function(e){return this.errorHandled=!0,this.reject(e),this},e.prototype.dispatch=function(){var t=this,r=this.dispatching,o=this.resolved,i=this.rejected,a=this.handlers;if(!r&&(o||i)){this.dispatching=!0,s();for(var u=function(r){var u=a[r],c=u.onSuccess,s=u.onError,f=u.promise,l=void 0;if(o)try{l=c?c(t.value):t.value}catch(e){return f.reject(e),"continue"}else if(i){if(!s)return f.reject(t.error),"continue";try{l=s(t.error)}catch(e){return f.reject(e),"continue"}}l instanceof e&&(l.resolved||l.rejected)?(l.resolved?f.resolve(l.value):f.reject(l.error),l.errorHandled=!0):n(l)?l instanceof e&&(l.resolved||l.rejected)?l.resolved?f.resolve(l.value):f.reject(l.error):l.then(function(e){f.resolve(e)},function(e){f.reject(e)}):f.resolve(l)},c=0;c<a.length;c++)u(c);a.length=0,this.dispatching=!1,f()}},e.prototype.then=function(t,r){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.then expected a function for success handler");if(r&&"function"!=typeof r&&!r.call)throw new Error("Promise.then expected a function for error handler");var n=new e;return this.handlers.push({promise:n,onSuccess:t,onError:r}),this.errorHandled=!0,this.dispatch(),n},e.prototype.catch=function(e){return this.then(void 0,e)},e.prototype.finally=function(t){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.finally expected a function");return this.then(function(r){return e.try(t).then(function(){return r})},function(r){return e.try(t).then(function(){throw r})})},e.prototype.timeout=function(e,t){var r=this;if(this.resolved||this.rejected)return this;var n=setTimeout(function(){r.resolved||r.rejected||r.reject(t||new Error("Promise timed out after "+e+"ms"))},e);return this.then(function(e){return clearTimeout(n),e})},e.prototype.toPromise=function(){if("undefined"==typeof Promise)throw new TypeError("Could not find Promise");return Promise.resolve(this)},e.resolve=function(t){return t instanceof e?t:n(t)?new e(function(e,r){return t.then(e,r)}):(new e).resolve(t)},e.reject=function(t){return(new e).reject(t)},e.asyncReject=function(t){return(new e).asyncReject(t)},e.all=function(t){var r=new e,o=t.length,i=[];if(!o)return r.resolve(i),r;for(var a=function(a){var u=t[a];if(u instanceof e){if(u.resolved)return i[a]=u.value,o-=1,"continue"}else if(!n(u))return i[a]=u,o-=1,"continue";e.resolve(u).then(function(e){i[a]=e,0==(o-=1)&&r.resolve(i)},function(e){r.reject(e)})},u=0;u<t.length;u++)a(u);return 0===o&&r.resolve(i),r},e.hash=function(t){var r={};return e.all(Object.keys(t).map(function(n){return e.resolve(t[n]).then(function(e){r[n]=e})})).then(function(){return r})},e.map=function(t,r){return e.all(t.map(r))},e.onPossiblyUnhandledException=function(e){return function(e){return i.push(e),{cancel:function(){i.splice(i.indexOf(e),1)}}}(e)},e.try=function(t,r,n){if(t&&"function"!=typeof t&&!t.call)throw new Error("Promise.try expected a function");var o=void 0;s();try{o=t.apply(r,n||[])}catch(t){return f(),e.reject(t)}return f(),e.resolve(o)},e.delay=function(t){return new e(function(e){setTimeout(e,t)})},e.isPromise=function(t){return!!(t&&t instanceof e)||n(t)},e.flush=function(){return t=u=u||new e,c(),t;var t},e}(),d={MOCK:"mock:",FILE:"file:",ABOUT:"about:"},h="Call was rejected by callee.\r\n";function p(){return(arguments.length>0&&void 0!==arguments[0]?arguments[0]:window).location.protocol===d.ABOUT}function w(e){try{return e&&e.location&&e.location.href,!0}catch(e){}return!1}function v(e){var t=(e=e||window).location;if(!t)throw new Error("Can not read window location");var r=t.protocol;if(!r)throw new Error("Can not read window protocol");if(r===d.FILE)return d.FILE+"//";if(r===d.ABOUT){var n=function(e){if(e)try{if(e.parent&&e.parent!==e)return e.parent}catch(e){}}(e);return n&&w(n)?v(n):d.ABOUT+"//"}var o=t.host;if(!o)throw new Error("Can not read window host");return r+"//"+o}function y(e){var t=v(e=e||window);return t&&e.mockDomain&&0===e.mockDomain.indexOf(d.MOCK)?e.mockDomain:t}var m=[],g=[];function j(e){var t=!(arguments.length>1&&void 0!==arguments[1])||arguments[1];try{if(e===window)return!1}catch(e){return!0}try{if(!e)return!0}catch(e){return!0}try{if(e.closed)return!0}catch(e){return!e||e.message!==h}if(t&&function(e){if(!function(e){try{if(e===window)return!0}catch(e){}try{var t=Object.getOwnPropertyDescriptor(e,"location");if(t&&!1===t.enumerable)return!1}catch(e){}try{if(p(e)&&w(e))return!0}catch(e){}try{if(v(e)===v(window))return!0}catch(e){}return!1}(e))return!1;try{if(e===window)return!0;if(p(e)&&w(e))return!0;if(y(window)===y(e))return!0}catch(e){}return!1}(e))try{if(e.mockclosed)return!0}catch(e){}try{if(!e.parent||!e.top)return!0}catch(e){}var r=function(e,t){for(var r=0;r<e.length;r++)try{if(e[r]===t)return r}catch(e){}return-1}(m,e);if(-1!==r){var n=g[r];if(n&&function(e){if(!e.contentWindow)return!0;if(!e.parentNode)return!0;var t=e.ownerDocument;return!(!t||!t.documentElement||t.documentElement.contains(e))}(n))return!0}return!1}function E(e){try{if(e===window)return!0}catch(e){if(e&&e.message===h)return!0}try{if("[object Window]"===Object.prototype.toString.call(e))return!0}catch(e){if(e&&e.message===h)return!0}try{if(window.Window&&e instanceof window.Window)return!0}catch(e){if(e&&e.message===h)return!0}try{if(e&&e.self===e)return!0}catch(e){if(e&&e.message===h)return!0}try{if(e&&e.parent===e)return!0}catch(e){if(e&&e.message===h)return!0}try{if(e&&e.top===e)return!0}catch(e){if(e&&e.message===h)return!0}try{e&&e.__cross_domain_utils_window_check__}catch(e){return!0}return!1}function O(e,t){for(var r=0;r<e.length;r++)try{if(e[r]===t)return r}catch(e){}return-1}var b=Object.defineProperty,k=Date.now()%1e9,T=function(){function e(){if(function(t,r){if(!(t instanceof e))throw new TypeError("Cannot call a class as a function")}(this),k+=1,this.name="__weakmap_"+(1e9*Math.random()>>>0)+"__"+k,function(){if("undefined"==typeof WeakMap)return!1;if(void 0===Object.freeze)return!1;try{var e=new WeakMap,t={};return Object.freeze(t),e.set(t,"__testvalue__"),"__testvalue__"===e.get(t)}catch(e){return!1}}())try{this.weakmap=new WeakMap}catch(e){}this.keys=[],this.values=[]}return e.prototype._cleanupClosedWindows=function(){for(var e=this.weakmap,t=this.keys,r=0;r<t.length;r++){var n=t[r];if(E(n)&&j(n)){if(e)try{e.delete(n)}catch(e){}t.splice(r,1),this.values.splice(r,1),r-=1}}},e.prototype.isSafeToReadWrite=function(e){if(E(e))return!1;try{e&&e.self,e&&e[this.name]}catch(e){return!1}return!0},e.prototype.set=function(e,t){if(!e)throw new Error("WeakMap expected key");var r=this.weakmap;if(r)try{r.set(e,t)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var n=this.name,o=e[n];o&&o[0]===e?o[1]=t:b(e,n,{value:[e,t],writable:!0})}else{this._cleanupClosedWindows();var i=this.keys,a=this.values,u=O(i,e);-1===u?(i.push(e),a.push(t)):a[u]=t}},e.prototype.get=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(e))return t.get(e)}catch(e){delete this.weakmap}if(!this.isSafeToReadWrite(e)){this._cleanupClosedWindows();var r=O(this.keys,e);if(-1===r)return;return this.values[r]}var n=e[this.name];if(n&&n[0]===e)return n[1]},e.prototype.delete=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{t.delete(e)}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];r&&r[0]===e&&(r[0]=r[1]=void 0)}else{this._cleanupClosedWindows();var n=this.keys,o=O(n,e);-1!==o&&(n.splice(o,1),this.values.splice(o,1))}},e.prototype.has=function(e){if(!e)throw new Error("WeakMap expected key");var t=this.weakmap;if(t)try{if(t.has(e))return!0}catch(e){delete this.weakmap}if(this.isSafeToReadWrite(e)){var r=e[this.name];return!(!r||r[0]!==e)}return this._cleanupClosedWindows(),-1!==O(this.keys,e)},e.prototype.getOrSet=function(e,t){if(this.has(e))return this.get(e);var r=t();return this.set(e,r),r},e}();function _(){}function C(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:Boolean,r={};for(var n in e)e.hasOwnProperty(n)&&t(e[n],n)&&(r[n]=e[n]);return r}function x(){return"undefined"!=typeof window}"function"==typeof Symbol&&Symbol.iterator,"function"==typeof Symbol&&Symbol.iterator,Object.assign,Object.create(Error.prototype);var R={CONTENT_TYPE:"content-type",ACCEPT:"accept"},P=[],W={DEBUG:"debug",INFO:"info",WARN:"warn",ERROR:"error"},L=[W.WARN,W.ERROR],S=[W.ERROR,W.WARN,W.INFO,W.DEBUG],N=6e4,M=W.WARN,A=Object.assign||function(e){for(var t=1;t<arguments.length;t++){var r=arguments[t];for(var n in r)Object.prototype.hasOwnProperty.call(r,n)&&(e[n]=r[n])}return e};function B(e){return function(e){var t=e.url,r=e.method,n=void 0===r?"get":r,o=e.headers,i=void 0===o?{}:o,a=e.json,u=e.data,c=e.body,s=e.win,f=void 0===s?window:s,d=e.timeout,h=void 0===d?0:d;return new l(function(e,r){if(a&&u||a&&c||u&&a)throw new Error("Only options.json or options.data or options.body should be passed");for(var o={},s=0,l=Object.keys(i),d=null==l?0:l.length;s<d;s++){var p=l[s];o[p.toLowerCase()]=i[p]}a?o[R.CONTENT_TYPE]=o[R.CONTENT_TYPE]||"application/json":(u||c)&&(o[R.CONTENT_TYPE]=o[R.CONTENT_TYPE]||"application/x-www-form-urlencoded; charset=utf-8"),o[R.ACCEPT]=o[R.ACCEPT]||"application/json";for(var w=0,v=null==P?0:P.length;w<v;w++)for(var y=(0,P[w])(),m=0,g=Object.keys(y),j=null==g?0:g.length;m<j;m++){var E=g[m];o[E.toLowerCase()]=y[E]}var O=new f.XMLHttpRequest;for(var b in O.addEventListener("load",function(){var o=function(){for(var e={},t=0,r=(arguments.length>0&&void 0!==arguments[0]?arguments[0]:"").trim().split("\n"),n=null==r?0:r.length;t<n;t++){var o=r[t].split(":"),i=o[0],a=o.slice(1);e[i.toLowerCase()]=a.join(":").trim()}return e}(this.getAllResponseHeaders());if(!this.status)return r(new Error("Request to "+n.toLowerCase()+" "+t+" failed: no response status code."));var i=o["content-type"],a=i&&(0===i.indexOf("application/json")||0===i.indexOf("text/json")),u=this.responseText;try{u=JSON.parse(u)}catch(e){if(a)return r(new Error("Invalid json: "+this.responseText+"."))}var c={status:this.status,headers:o,body:u};return e(c)},!1),O.addEventListener("error",function(e){r(new Error("Request to "+n.toLowerCase()+" "+t+" failed: "+e.toString()+"."))},!1),O.open(n,t,!0),o)o.hasOwnProperty(b)&&O.setRequestHeader(b,o[b]);a?c=JSON.stringify(a):u&&(c=Object.keys(u).map(function(e){return encodeURIComponent(e)+"="+(u?encodeURIComponent(u[e]):"")}).join("&")),O.timeout=h,O.ontimeout=function(){r(new Error("Request to "+n.toLowerCase()+" "+t+" has timed out"))},O.send(c)})}({url:e.url,method:e.method,headers:e.headers,json:e.json}).then(_)}function D(e,t){for(var r in t)t.hasOwnProperty(r)&&t[r]&&(e[r]=t[r])}function U(e){var t=e.url,r=e.prefix,n=e.logLevel,o=void 0===n?M:n,i=e.transport,a=void 0===i?B:i,u=e.flushInterval,c=void 0===u?N:u,s=[],f=[],d=[],h=[],p=[],w=[];function v(e,t,r){if(x()&&window.console&&window.console.log){var n=o;if(window.LOG_LEVEL&&-1!==S.indexOf(window.LOG_LEVEL)&&(n=window.LOG_LEVEL),!(S.indexOf(e)>S.indexOf(n))){var i=[t];i.push(r),(r.error||r.warning)&&i.push("\n\n",r.error||r.warning);try{window.console[e]&&window.console[e].apply?window.console[e].apply(window.console,i):window.console.log&&window.console.log.apply&&window.console.log.apply(window.console,i)}catch(e){}}}}function y(){return l.try(function(){if(x()&&(s.length||f.length)){for(var e={},r=0,n=null==h?0:h.length;r<n;r++)D(e,(0,h[r])(e));for(var o={},i=0,u=null==w?0:w.length;i<u;i++)D(o,(0,w[i])(o));var c=a({method:"POST",url:t,headers:o,json:{events:s,meta:e,tracking:f}});return s=[],f=[],c.then(_)}})}var m,g,j=function(e){var t=arguments.length>1&&void 0!==arguments[1]?arguments[1]:50,r=void 0,n=void 0;return function(){n&&clearTimeout(n);var o=r=r||new l;return n=setTimeout(function(){r=null,n=null,l.try(e).then(function(e){o.resolve(e)},function(e){o.reject(e)})},t),o}}(y);function E(e,t){var n=arguments.length>2&&void 0!==arguments[2]?arguments[2]:{};if(!x())return b;r&&(t=r+"_"+t);for(var o=A({},C(n),{timestamp:Date.now().toString()}),i=0,a=null==d?0:d.length;i<a;i++)D(o,(0,d[i])(o));return function(e,t,r){s.push({level:e,event:t,payload:r}),-1!==L.indexOf(e)&&j()}(e,t,o),v(e,t,o),b}function O(e,t){return e.push(t),b}x()&&(m=j,g=c,function e(){setTimeout(function(){m(),e()},g)}());var b={debug:function(e,t){return E(W.DEBUG,e,t)},info:function(e,t){return E(W.INFO,e,t)},warn:function(e,t){return E(W.WARN,e,t)},error:function(e,t){return E(W.ERROR,e,t)},track:function(){var e=arguments.length>0&&void 0!==arguments[0]?arguments[0]:{};if(!x())return b;for(var t=C(e),r=0,n=null==p?0:p.length;r<n;r++)D(t,(0,p[r])(t));return v(W.DEBUG,"track",t),f.push(t),b},flush:j,immediateFlush:y,addPayloadBuilder:function(e){return O(d,e)},addMetaBuilder:function(e){return O(h,e)},addTrackingBuilder:function(e){return O(p,e)},addHeaderBuilder:function(e){return O(w,e)},setTransport:function(e){return a=e,b}};return b}r.d(t,"Logger",function(){return U}),r.d(t,"LOG_LEVEL",function(){return W})}])});
//# sourceMappingURL=beaver-logger.min.js.map

@@ -7,4 +7,7 @@ var _extends = Object.assign || function (target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i]; for (var key in source) { if (Object.prototype.hasOwnProperty.call(source, key)) { target[key] = source[key]; } } } return target; };

import { DEFAULT_LOG_LEVEL, LOG_LEVEL_PRIORITY, AUTO_FLUSH_LEVEL, FLUSH_INTERVAL } from './config';
import { LOG_LEVEL } from './constants';
import { LOG_LEVEL } from './constants'; // eslint-disable-line no-use-before-define
// eslint-disable-line no-use-before-define
// eslint-disable-line no-use-before-define
function httpTransport(_ref) {

@@ -143,3 +146,3 @@ var url = _ref.url,

if (!isBrowser()) {
return;
return logger; // eslint-disable-line no-use-before-define
}

@@ -162,34 +165,41 @@

print(level, event, logPayload);
return logger; // eslint-disable-line no-use-before-define
}
function addBuilder(builders, builder) {
builders.push(builder);
return logger; // eslint-disable-line no-use-before-define
}
function addPayloadBuilder(builder) {
payloadBuilders.push(builder);
return addBuilder(payloadBuilders, builder);
}
function addMetaBuilder(builder) {
metaBuilders.push(builder);
return addBuilder(metaBuilders, builder);
}
function addTrackingBuilder(builder) {
trackingBuilders.push(builder);
return addBuilder(trackingBuilders, builder);
}
function addHeaderBuilder(builder) {
headerBuilders.push(builder);
return addBuilder(headerBuilders, builder);
}
function debug(event, payload) {
log(LOG_LEVEL.DEBUG, event, payload);
return log(LOG_LEVEL.DEBUG, event, payload);
}
function info(event, payload) {
log(LOG_LEVEL.INFO, event, payload);
return log(LOG_LEVEL.INFO, event, payload);
}
function warn(event, payload) {
log(LOG_LEVEL.WARN, event, payload);
return log(LOG_LEVEL.WARN, event, payload);
}
function error(event, payload) {
log(LOG_LEVEL.ERROR, event, payload);
return log(LOG_LEVEL.ERROR, event, payload);
}

@@ -201,3 +211,3 @@

if (!isBrowser()) {
return;
return logger; // eslint-disable-line no-use-before-define
}

@@ -214,2 +224,4 @@

tracking.push(trackingPayload);
return logger; // eslint-disable-line no-use-before-define
}

@@ -219,2 +231,3 @@

transport = newTransport;
return logger; // eslint-disable-line no-use-before-define
}

@@ -226,3 +239,3 @@

return {
var logger = {
debug: debug,

@@ -241,2 +254,4 @@ info: info,

};
return logger;
}
{
"name": "beaver-logger",
"version": "4.0.6",
"version": "4.0.7",
"description": "Client side logger.",

@@ -5,0 +5,0 @@ "main": "dist/beaver-logger.js",

@@ -117,3 +117,2 @@ beaver-logger

```javascript
```javascript
var $logger = beaver.Logger({

@@ -120,0 +119,0 @@

@@ -21,7 +21,7 @@ /* @flow */

type Payload = { [string] : string };
type Log = (name : string, payload? : ClientPayload) => void;
type Track = (payload : ClientPayload) => void;
type Log = (name : string, payload? : ClientPayload) => LoggerType; // eslint-disable-line no-use-before-define
type Track = (payload : ClientPayload) => LoggerType; // eslint-disable-line no-use-before-define
type Builder = (Payload) => ClientPayload;
type AddBuilder = (Builder) => void;
type AddBuilder = (Builder) => LoggerType; // eslint-disable-line no-use-before-define

@@ -44,3 +44,3 @@ export type LoggerType = {

setTransport : (Transport) => void
setTransport : (Transport) => LoggerType
};

@@ -158,6 +158,6 @@

function log(level : $Values<typeof LOG_LEVEL>, event : string, payload = {}) {
function log(level : $Values<typeof LOG_LEVEL>, event : string, payload = {}) : LoggerType {
if (!isBrowser()) {
return;
return logger; // eslint-disable-line no-use-before-define
}

@@ -180,39 +180,46 @@

print(level, event, logPayload);
return logger; // eslint-disable-line no-use-before-define
}
function addPayloadBuilder(builder) {
payloadBuilders.push(builder);
function addBuilder(builders, builder) : LoggerType {
builders.push(builder);
return logger; // eslint-disable-line no-use-before-define
}
function addMetaBuilder(builder) {
metaBuilders.push(builder);
function addPayloadBuilder(builder) : LoggerType {
return addBuilder(payloadBuilders, builder);
}
function addTrackingBuilder(builder) {
trackingBuilders.push(builder);
function addMetaBuilder(builder) : LoggerType {
return addBuilder(metaBuilders, builder);
}
function addHeaderBuilder(builder) {
headerBuilders.push(builder);
function addTrackingBuilder(builder) : LoggerType {
return addBuilder(trackingBuilders, builder);
}
function debug(event, payload) {
log(LOG_LEVEL.DEBUG, event, payload);
function addHeaderBuilder(builder) : LoggerType {
return addBuilder(headerBuilders, builder);
}
function info(event, payload) {
log(LOG_LEVEL.INFO, event, payload);
function debug(event, payload) : LoggerType {
return log(LOG_LEVEL.DEBUG, event, payload);
}
function warn(event, payload) {
log(LOG_LEVEL.WARN, event, payload);
function info(event, payload) : LoggerType {
return log(LOG_LEVEL.INFO, event, payload);
}
function error(event, payload) {
log(LOG_LEVEL.ERROR, event, payload);
function warn(event, payload) : LoggerType {
return log(LOG_LEVEL.WARN, event, payload);
}
function track(payload = {}) {
function error(event, payload) : LoggerType {
return log(LOG_LEVEL.ERROR, event, payload);
}
function track(payload = {}) : LoggerType {
if (!isBrowser()) {
return;
return logger; // eslint-disable-line no-use-before-define
}

@@ -228,6 +235,9 @@

tracking.push(trackingPayload);
return logger; // eslint-disable-line no-use-before-define
}
function setTransport(newTransport : Transport) {
function setTransport(newTransport : Transport) : LoggerType {
transport = newTransport;
return logger; // eslint-disable-line no-use-before-define
}

@@ -239,3 +249,3 @@

return {
const logger = {
debug,

@@ -254,2 +264,4 @@ info,

};
return logger;
}

Sorry, the diff of this file is too big to display

Sorry, the diff of this file is not supported yet

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