mirror of
https://github.com/overleaf/overleaf.git
synced 2024-12-02 18:50:19 -05:00
3 lines
15 KiB
JavaScript
3 lines
15 KiB
JavaScript
|
/*! Raven.js 1.1.22 (77b210b) | github.com/getsentry/raven-js */
|
||
|
!function(a,b){"use strict";function c(a,b){var c,d;b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),document.createEvent?(c=document.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=document.createEventObject(),c.eventType=a);for(d in b)l(b,d)&&(c[d]=b[d]);if(document.createEvent)document.dispatchEvent(c);else try{document.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}function d(a){this.name="RavenConfigError",this.message=a}function e(a){var b=Y.exec(a),c={},e=7;try{for(;e--;)c[X[e]]=b[e]||""}catch(f){throw new d("Invalid DSN: "+a)}if(c.pass)throw new d("Do not specify your private key in the DSN!");return c}function f(a){return void 0===a}function g(a){return"function"==typeof a}function h(a){return"[object String]"===R.toString.call(a)}function i(a){return"object"==typeof a&&null!==a}function j(a){for(var b in a)return!1;return!0}function k(a){return i(a)&&"[object Error]"===R.toString.call(a)||a instanceof Error}function l(a,b){return R.hasOwnProperty.call(a,b)}function m(a,b){var c,d;if(f(a.length))for(c in a)l(a,c)&&b.call(null,c,a[c]);else if(d=a.length)for(c=0;d>c;c++)b.call(null,c,a[c])}function n(a,b){var d=[];a.stack&&a.stack.length&&m(a.stack,function(a,b){var c=o(b);c&&d.push(c)}),c("handle",{stackInfo:a,options:b}),q(a.name,a.message,a.url,a.lineno,d,b)}function o(a){if(a.url){var b,c={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"},d=p(a);if(d){var e=["pre_context","context_line","post_context"];for(b=3;b--;)c[e[b]]=d[b]}return c.in_app=!(P.includePaths.test&&!P.includePaths.test(c.filename)||/(Raven|TraceKit)\./.test(c["function"])||/raven\.(min\.)?js$/.test(c.filename)),c}}function p(a){if(a.context&&P.fetchContext){for(var b=a.context,c=~~(b.length/2),d=b.length,e=!1;d--;)if(b[d].length>300){e=!0;break}if(e){if(f(a.column))return;return[[],b[c].substr(a.column,50),[]]}return[b.slice(0,c),b[c],b.slice(c+1)]}}function q(a,b,c,d,e,f){var g,h;P.ignoreErrors.test&&P.ignoreErrors.test(b)||(b+="",b=s(b,P.maxMessageLength),h=a+": "+b,h=s(h,P.maxMessageLength),e&&e.length?(c=e[0].filename||c,e.reverse(),g={frames:e}):c&&(g={frames:[{filename:c,lineno:d,in_app:!0}]}),P.ignoreUrls.test&&P.ignoreUrls.test(c)||(!P.whitelistUrls.test||P.whitelistUrls.test(c))&&v(r({exception:{type:a,value:b},stacktrace:g,culprit:c,message:h},f)))}function r(a,b){return b?(m(b,function(b,c){a[b]=c}),a):a}function s(a,b){return a.length<=b?a:a.substr(0,b)+"…"}function t(){return+new Date}function u(){if(document.location&&document.location.href){var a={headers:{"User-Agent":navigator.userAgent}};return a.url=document.location.href,document.referrer&&(a.headers.Referer=document.referrer),a}}function v(a){var b={project:M,logger:P.logger,platform:"javascript"},d=u();d&&(b.request=d),a=r(b,a),a.tags=r(r({},P.tags),a.tags),a.extra=r(r({},P.extra),a.extra),a.extra=r({"session:duration":t()-U},a.extra),j(a.tags)&&delete a.tags,K&&(a.user=K),P.release&&(a.release=P.release),g(P.dataCallback)&&(a=P.dataCallback(a)||a),a&&!j(a)&&(!g(P.shouldSendCallback)||P.shouldSendCallback(a))&&(I=a.event_id||(a.event_id=A()),B("debug","Raven about to send:",a),y()&&(P.transport||w)({url:J,auth:{sentry_version:"4",sentry_client:"raven-js/"+W.VERSION,sentry_key:L},data:a,options:P,onSuccess:function(){c("success",{data:a,src:J})},onError:function(){c("failure",{data:a,src:J})}}))}function w(a){a.auth.sentry_data=JSON.stringify(a.data);var b=x(),c=a.url+"?"+D(a.auth);(a.options.crossOrigin||""===a.options.crossOrigin)&&(b.crossOrigin=a.options.crossOrigin),b.onload=a.onSuccess,b.onerror=b.onabort=a.onError,b.src=c}function x(){return document.createElement("img")}function y(){return O?J?!0:(Z||B("error","Error: Raven has not been configured."),Z=!0,!1):!1}function z(a){for(var b,c=[],d=0,e=a.length;e>d;d++)b=a[d],h(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function A(){var b=a.crypto||a.msCrypto;if(!f(b)&&b.getRandomValues){var c=new Uint16Array(8);b.getRandomValues(c),c[3]=4095&c[3]|16384,c[4]=16383&c[4]|32768;var d=function(a){for(var
|
||
|
//# sourceMappingURL=raven.min.map
|