-
Notifications
You must be signed in to change notification settings - Fork 36
/
ng-rollbar.min.js
7 lines (7 loc) · 7.77 KB
/
ng-rollbar.min.js
1
2
3
4
5
6
7
/**
* @license ng-rollbar 2.14.4 (06-02-2020)
* (c) 2015-2017 IdentPro GmbH
* License: MIT
*/
!function(a){a.module("tandibar/ng-rollbar",[]),a.module("tandibar/ng-rollbar").config(["$provide",function(a){a.decorator("$exceptionHandler",["$delegate","$injector","$window",function(a,b,c){return function(d,e){c.Rollbar&&c.Rollbar.error(d,{cause:e},function(a,c){var e=b.get("$rootScope");e.$emit("rollbar:exception",{exception:d,err:a,data:c?c.result:null})}),a(d,e)}}])}]),a.module("tandibar/ng-rollbar").provider("Rollbar",function(){function a(a,c){function d(a){return function(){c.Rollbar[a].apply(c.Rollbar,arguments)}}function e(){a.warn("Rollbar is deactivated")}var f={Rollbar:e,configure:e,critical:e,error:e,warning:e,info:e,debug:e,scope:e,verbose:e,enable:e,disable:e};return b&&(f.Rollbar=c.Rollbar,f.configure=d("configure"),f.critical=d("critical"),f.error=d("error"),f.warning=d("warning"),f.info=d("info"),f.debug=d("debug"),f.scope=d("scope"),f.verbose=function(a){void 0===a&&(a=!0),c.Rollbar.configure({verbose:a})},f.enable=function(){c.Rollbar.configure({enabled:!0})},f.disable=function(){c.Rollbar.configure({enabled:!1})}),f}var b=!0;this.init=function(a){var c=a;b&&!function(a){function b(d){if(c[d])return c[d].exports;var e=c[d]={exports:{},id:d,loaded:!1};return a[d].call(e.exports,e,e.exports,b),e.loaded=!0,e.exports}var c={};return b.m=a,b.c=c,b.p="",b(0)}([function(a,b,d){"use strict";var e=d(1),f=d(4);c=c||{},c.rollbarJsUrl=c.rollbarJsUrl||"https://cdnjs.cloudflare.com/ajax/libs/rollbar.js/2.3.9/rollbar.min.js",c.async=void 0===c.async||c.async;var g=e.setupShim(window,c),h=f(c);window.rollbar=e.Rollbar,g.loadFull(window,document,!c.async,c,h)},function(a,b,c){"use strict";function d(a){return function(){try{return a.apply(this,arguments)}catch(a){try{console.error("[Rollbar]: Internal error",a)}catch(a){}}}}function e(a,b){this.options=a,this._rollbarOldOnError=null;var c=i++;this.shimId=function(){return c},"undefined"!=typeof window&&window._rollbarShims&&(window._rollbarShims[c]={handler:b,messages:[]})}function f(a,b){if(a){var c=b.globalAlias||"Rollbar";if("object"==typeof a[c])return a[c];a._rollbarShims={},a._rollbarWrappedError=null;var e=new l(b);return d(function(){b.captureUncaught&&(e._rollbarOldOnError=a.onerror,h.captureUncaughtExceptions(a,e,!0),h.wrapGlobals(a,e,!0)),b.captureUnhandledRejections&&h.captureUnhandledRejections(a,e,!0);var d=b.autoInstrument;return b.enabled!==!1&&(void 0===d||d===!0||"object"==typeof d&&d.network)&&a.addEventListener&&(a.addEventListener("load",e.captureLoad.bind(e)),a.addEventListener("DOMContentLoaded",e.captureDomContentLoaded.bind(e))),a[c]=e,e})()}}function g(a){return d(function(){var b=this,c=Array.prototype.slice.call(arguments,0),d={shim:b,method:a,args:c,ts:new Date};window._rollbarShims[this.shimId()].messages.push(d)})}var h=c(2),i=0,j=c(3),k=function(a,b){return new e(a,b)},l=j.bind(null,k);e.prototype.loadFull=function(a,b,c,e,f){var g=function(){var b;if(void 0===a._rollbarDidLoad){b=new Error("rollbar.js did not load");for(var c,d,e,g,h=0;c=a._rollbarShims[h++];)for(c=c.messages||[];d=c.shift();)for(e=d.args||[],h=0;h<e.length;++h)if(g=e[h],"function"==typeof g){g(b);break}}"function"==typeof f&&f(b)},h=!1,i=b.createElement("script"),j=b.getElementsByTagName("script")[0],k=j.parentNode;i.crossOrigin="",i.src=e.rollbarJsUrl,c||(i.async=!0),i.onload=i.onreadystatechange=d(function(){if(!(h||this.readyState&&"loaded"!==this.readyState&&"complete"!==this.readyState)){i.onload=i.onreadystatechange=null;try{k.removeChild(i)}catch(a){}h=!0,g()}}),k.insertBefore(i,j)},e.prototype.wrap=function(a,b,c){try{var d;if(d="function"==typeof b?b:function(){return b||{}},"function"!=typeof a)return a;if(a._isWrap)return a;if(!a._rollbar_wrapped&&(a._rollbar_wrapped=function(){b&&"function"==typeof b&&b.apply(this,arguments);try{return a.apply(this,arguments)}catch(b){var c=b;throw"string"==typeof c&&(c=new String(c)),c._rollbarContext=d()||{},c._rollbarContext._wrappedSource=a.toString(),window._rollbarWrappedError=c,c}},a._rollbar_wrapped._isWrap=!0,a.hasOwnProperty))for(var e in a)a.hasOwnProperty(e)&&(a._rollbar_wrapped[e]=a[e]);return a._rollbar_wrapped}catch(b){return a}};for(var m="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,captureEvent,captureDomContentLoaded,captureLoad".split(","),n=0;n<m.length;++n)e.prototype[m[n]]=g(m[n]);a.exports={setupShim:f,Rollbar:l}},function(a,b){"use strict";function c(a,b,c){if(a){var e;"function"==typeof b._rollbarOldOnError?e=b._rollbarOldOnError:a.onerror&&!a.onerror.belongsToShim&&(e=a.onerror,b._rollbarOldOnError=e);var f=function(){var c=Array.prototype.slice.call(arguments,0);d(a,b,e,c)};f.belongsToShim=c,a.onerror=f}}function d(a,b,c,d){a._rollbarWrappedError&&(d[4]||(d[4]=a._rollbarWrappedError),d[5]||(d[5]=a._rollbarWrappedError._rollbarContext),a._rollbarWrappedError=null),b.handleUncaughtException.apply(b,d),c&&c.apply(a,d)}function e(a,b,c){if(a){"function"==typeof a._rollbarURH&&a._rollbarURH.belongsToShim&&a.removeEventListener("unhandledrejection",a._rollbarURH);var d=function(a){var c,d,e;try{c=a.reason}catch(a){c=void 0}try{d=a.promise}catch(a){d="[unhandledrejection] error getting `promise` from event"}try{e=a.detail,!c&&e&&(c=e.reason,d=e.promise)}catch(a){e="[unhandledrejection] error getting `detail` from event"}c||(c="[unhandledrejection] error getting `reason` from event"),b&&b.handleUnhandledRejection&&b.handleUnhandledRejection(c,d)};d.belongsToShim=c,a._rollbarURH=d,a.addEventListener("unhandledrejection",d)}}function f(a,b,c){if(a){var d,e,f="EventTarget,Window,Node,ApplicationCache,AudioTrackList,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(",");for(d=0;d<f.length;++d)e=f[d],a[e]&&a[e].prototype&&g(b,a[e].prototype,c)}}function g(a,b,c){if(b.hasOwnProperty&&b.hasOwnProperty("addEventListener")){for(var d=b.addEventListener;d._rollbarOldAdd&&d.belongsToShim;)d=d._rollbarOldAdd;var e=function(b,c,e){d.call(this,b,a.wrap(c),e)};e._rollbarOldAdd=d,e.belongsToShim=c,b.addEventListener=e;for(var f=b.removeEventListener;f._rollbarOldRemove&&f.belongsToShim;)f=f._rollbarOldRemove;var g=function(a,b,c){f.call(this,a,b&&b._rollbar_wrapped||b,c)};g._rollbarOldRemove=f,g.belongsToShim=c,b.removeEventListener=g}}a.exports={captureUncaughtExceptions:c,captureUnhandledRejections:e,wrapGlobals:f}},function(a,b){"use strict";function c(a,b){this.impl=a(b,this),this.options=b,d(c.prototype)}function d(a){for(var b=function(a){return function(){var b=Array.prototype.slice.call(arguments,0);if(this.impl[a])return this.impl[a].apply(this.impl,b)}},c="log,debug,info,warn,warning,error,critical,global,configure,handleUncaughtException,handleUnhandledRejection,_createItem,wrap,loadFull,shimId,captureEvent,captureDomContentLoaded,captureLoad".split(","),d=0;d<c.length;d++)a[c[d]]=b(c[d])}c.prototype._swapAndProcessMessages=function(a,b){this.impl=a(this.options);for(var c,d,e;c=b.shift();)d=c.method,e=c.args,this[d]&&"function"==typeof this[d]&&("captureDomContentLoaded"===d||"captureLoad"===d?this[d].apply(this,[e[0],c.ts]):this[d].apply(this,e));return this},a.exports=c},function(a,b){"use strict";a.exports=function(a){return function(b){if(!b&&!window._rollbarInitialized){a=a||{};for(var c,d,e=a.globalAlias||"Rollbar",f=window.rollbar,g=function(a){return new f(a)},h=0;c=window._rollbarShims[h++];)d||(d=c.handler),c.handler._swapAndProcessMessages(g,c.messages);window[e]=d,window._rollbarInitialized=!0}}}}])},this.deinit=function(){b=!1},a.$inject=["$log","$window"],this.$get=a})}(angular);
//# sourceMappingURL=ng-rollbar.min.js.map