3 lines
28 KiB
JavaScript
3 lines
28 KiB
JavaScript
/*! Raven.js 3.22.2 (1b6187b) | github.com/getsentry/raven-js */
|
|
!function(a,b){"object"==typeof exports&&"undefined"!=typeof module?module.exports=b():"function"==typeof define&&define.amd?define(b):a.Raven=b()}(this,function(){"use strict";function a(a,b){return b={exports:{}},a(b,b.exports),b.exports}function b(a){return(b="function"==typeof Symbol&&"symbol"==typeof Symbol.iterator?function(a){return typeof a}:function(a){return a&&"function"==typeof Symbol&&a.constructor===Symbol&&a!==Symbol.prototype?"symbol":typeof a})(a)}function c(a){return"object"===b(a)&&null!==a}function d(a){switch({}.toString.call(a)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return a instanceof Error}}function e(a){return l()&&"[object ErrorEvent]"==={}.toString.call(a)}function f(a){return void 0===a}function g(a){return"function"==typeof a}function h(a){return"[object Object]"===Object.prototype.toString.call(a)}function i(a){return"[object String]"===Object.prototype.toString.call(a)}function j(a){return"[object Array]"===Object.prototype.toString.call(a)}function k(a){if(!h(a))return!1;for(var b in a)if(a.hasOwnProperty(b))return!1;return!0}function l(){try{return new ErrorEvent(""),!0}catch(a){return!1}}function m(){if(!("fetch"in O))return!1;try{return new Headers,new Request(""),new Response,!0}catch(a){return!1}}function n(a){function b(b,c){var d=a(b)||b;return c?c(d)||d:d}return b}function o(a,b){var c,d;if(f(a.length))for(c in a)s(a,c)&&b.call(null,c,a[c]);else if(d=a.length)for(c=0;c<d;c++)b.call(null,c,a[c])}function p(a,b){return b?(o(b,function(b,c){a[b]=c}),a):a}function q(a){return!!Object.isFrozen&&Object.isFrozen(a)}function r(a,b){return!b||a.length<=b?a:a.substr(0,b)+"…"}function s(a,b){return Object.prototype.hasOwnProperty.call(a,b)}function t(a){for(var b,c=[],d=0,e=a.length;d<e;d++)b=a[d],i(b)?c.push(b.replace(/([.*+?^=!:${}()|\[\]\/\\])/g,"\\$1")):b&&b.source&&c.push(b.source);return new RegExp(c.join("|"),"i")}function u(a){var b=[];return o(a,function(a,c){b.push(encodeURIComponent(a)+"="+encodeURIComponent(c))}),b.join("&")}function v(a){if("string"!=typeof a)return{};var b=a.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/),c=b[6]||"",d=b[8]||"";return{protocol:b[2],host:b[4],path:b[5],relative:b[5]+c+d}}function w(){var a=O.crypto||O.msCrypto;if(!f(a)&&a.getRandomValues){var b=new Uint16Array(8);a.getRandomValues(b),b[3]=4095&b[3]|16384,b[4]=16383&b[4]|32768;var c=function(a){for(var b=a.toString(16);b.length<4;)b="0"+b;return b};return c(b[0])+c(b[1])+c(b[2])+c(b[3])+c(b[4])+c(b[5])+c(b[6])+c(b[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(a){var b=16*Math.random()|0,c="x"===a?b:3&b|8;return c.toString(16)})}function x(a){for(var b,c=5,d=80,e=[],f=0,g=0,h=" > ",i=h.length;a&&f++<c&&(b=y(a),!("html"===b||f>1&&g+e.length*i+b.length>=d));)e.push(b),g+=b.length,a=a.parentNode;return e.reverse().join(h)}function y(a){var b,c,d,e,f,g=[];if(!a||!a.tagName)return"";if(g.push(a.tagName.toLowerCase()),a.id&&g.push("#"+a.id),b=a.className,b&&i(b))for(c=b.split(/\s+/),f=0;f<c.length;f++)g.push("."+c[f]);var h=["type","name","title","alt"];for(f=0;f<h.length;f++)d=h[f],e=a.getAttribute(d),e&&g.push("["+d+'="'+e+'"]');return g.join("")}function z(a,b){return!!(!!a^!!b)}function A(a,b){return f(a)&&f(b)}function B(a,b){return!z(a,b)&&(a=a.values[0],b=b.values[0],a.type===b.type&&a.value===b.value&&(!A(a.stacktrace,b.stacktrace)&&C(a.stacktrace,b.stacktrace)))}function C(a,b){if(z(a,b))return!1;var c=a.frames,d=b.frames;if(c.length!==d.length)return!1;for(var e,f,g=0;g<c.length;g++)if(e=c[g],f=d[g],e.filename!==f.filename||e.lineno!==f.lineno||e.colno!==f.colno||e["function"]!==f["function"])return!1;return!0}function D(a,b,c,d){var e=a[b];a[b]=c(e),a[b].a=!0,a[b].b=e,d&&d.push([a,b,e])}function E(a,b){if(!j(a))return"";for(var c=[],d=0;d<a.length;d++)try{c.push(String(a[d]))}catch(e){c.push("[value cannot be serialized]")}return c.join(b)}function F(){return"undefined"==typeof document||null==document.location?"":document.location.href}function G(a){this.name="RavenConfigError",this.message=a}function H(){return+new Date}function I(a,b){return ca(b)?function(c){return b(c,a)}:b}function J(){this.c=!("object"!==b(JSON)||!JSON.stringify),this.d=!ba(ya),this.e=!ba(za),this.f=null,this.g=null,this.h=null,this.i=null,this.j=null,this.k=null,this.l={},this.m={release:xa.SENTRY_RELEASE&&xa.SENTRY_RELEASE.id,logger:"javascript",ignoreErrors:[],ignoreUrls:[],whitelistUrls:[],includePaths:[],headers:null,collectWindowErrors:!0,maxMessageLength:0,maxUrlLength:250,stackTraceLimit:50,autoBreadcrumbs:!0,instrument:!0,sampleRate:1},this.n={method:"POST",keepalive:!0,referrerPolicy:"origin"},this.o=0,this.p=!1,this.q=Error.stackTraceLimit,this.r=xa.console||{},this.s={},this.t=[],this.u=H(),this.v=[],this.w=[],this.x=null,this.y=xa.location,this.z=this.y&&this.y.href,this.A();for(var a in this.r)this.s[a]=this.r[a]}function K(a,b,c){b=b||window.console||{},c=c||{};var d=c.levels||["debug","info","warn","error"];"assert"in b&&d.push("assert");for(var e=function(b,c){a.captureMessage(b,c)},f=d.pop();f;)Fa(b,f,e),f=d.pop()}function L(a){}var M="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof self?self:{},N=Object.setPrototypeOf||function(a,b){return a.B=b,a},O=("object"==typeof Reflect&&Reflect.construct||function(a,b,c){var d,e=[null];return e.push.apply(e,b),d=a.bind.apply(a,e),N(new d,c.prototype)},"undefined"!=typeof window?window:"undefined"!=typeof M?M:"undefined"!=typeof self?self:{}),P={isObject:c,isError:d,isErrorEvent:e,isUndefined:f,isFunction:g,isPlainObject:h,isString:i,isArray:j,isEmptyObject:k,supportsErrorEvent:l,supportsFetch:m,wrappedCallback:n,each:o,objectMerge:p,truncate:r,objectFrozen:q,hasKey:s,joinRegExp:t,urlencode:u,uuid4:w,htmlTreeAsString:x,htmlElementAsString:y,isSameException:B,isSameStacktrace:C,parseUrl:v,fill:D,safeJoin:E},Q={collectWindowErrors:!0,debug:!1},R="undefined"!=typeof window?window:"undefined"!=typeof M?M:"undefined"!=typeof self?self:{},S=[].slice,T="?",U=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;Q.report=function(){function a(a){f(),l.push(a)}function b(a){for(var b=l.length-1;b>=0;--b)l[b]===a&&l.splice(b,1)}function c(){g(),l=[]}function d(a,b){var c=null;if(!b||Q.collectWindowErrors){for(var d in l)if(l.hasOwnProperty(d))try{l[d].apply(null,[a].concat(S.call(arguments,2)))}catch(e){c=e}if(c)throw c}}function e(a,b,c,e,f){var g=null,i=P.isErrorEvent(f)?f.error:f,k=P.isErrorEvent(a)?a.message:a;if(o)Q.computeStackTrace.augmentStackTraceWithInitialElement(o,b,c,k),h();else if(i&&P.isError(i))g=Q.computeStackTrace(i),d(g,!0);else{var l,m={url:b,line:c,column:e},n=void 0;if("[object String]"==={}.toString.call(k)){var l=k.match(U);l&&(n=l[1],k=l[2])}m.func=T,g={name:n,message:k,url:F(),stack:[m]},d(g,!0)}return!!j&&j.apply(this,arguments)}function f(){k||(j=R.onerror,R.onerror=e,k=!0)}function g(){k&&(R.onerror=j,k=!1,j=void 0)}function h(){var a=o,b=m;m=null,o=null,n=null,d.apply(null,[a,!1].concat(b))}function i(a,b){var c=S.call(arguments,1);if(o){if(n===a)return;h()}var d=Q.computeStackTrace(a);if(o=d,n=a,m=c,setTimeout(function(){n===a&&h()},d.incomplete?2e3:0),b!==!1)throw a}var j,k,l=[],m=null,n=null,o=null;return i.subscribe=a,i.unsubscribe=b,i.uninstall=c,i}(),Q.computeStackTrace=function(){function a(a){if("undefined"!=typeof a.stack&&a.stack){for(var b,c,d,e=/^\s*at (.*?) ?\(((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,f=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)((?:file|https?|blob|chrome|webpack|resource|\[native).*?|[^@]*bundle)(?::(\d+))?(?::(\d+))?\s*$/i,g=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx(?:-web)|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,h=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,i=/\((\S*)(?::(\d+))(?::(\d+))\)/,j=a.stack.split("\n"),k=[],l=(/^(.*) is undefined$/.exec(a.message),0),m=j.length;l<m;++l){if(c=e.exec(j[l])){var n=c[2]&&0===c[2].indexOf("native"),o=c[2]&&0===c[2].indexOf("eval");o&&(b=i.exec(c[2]))&&(c[2]=b[1],c[3]=b[2],c[4]=b[3]),d={url:n?null:c[2],func:c[1]||T,args:n?[c[2]]:[],line:c[3]?+c[3]:null,column:c[4]?+c[4]:null}}else if(c=g.exec(j[l]))d={url:c[2],func:c[1]||T,args:[],line:+c[3],column:c[4]?+c[4]:null};else{if(!(c=f.exec(j[l])))continue;var o=c[3]&&c[3].indexOf(" > eval")>-1;o&&(b=h.exec(c[3]))?(c[3]=b[1],c[4]=b[2],c[5]=null):0!==l||c[5]||"undefined"==typeof a.columnNumber||(k[0].column=a.columnNumber+1),d={url:c[3],func:c[1]||T,args:c[2]?c[2].split(","):[],line:c[4]?+c[4]:null,column:c[5]?+c[5]:null}}!d.func&&d.line&&(d.func=T),k.push(d)}return k.length?{name:a.name,message:a.message,url:F(),stack:k}:null}}function b(a,b,c,d){var e={url:b,line:c};if(e.url&&e.line){if(a.incomplete=!1,e.func||(e.func=T),a.stack.length>0&&a.stack[0].url===e.url){if(a.stack[0].line===e.line)return!1;if(!a.stack[0].line&&a.stack[0].func===e.func)return a.stack[0].line=e.line,!1}return a.stack.unshift(e),a.partial=!0,!0}return a.incomplete=!0,!1}function c(a,e){for(var f,g,h=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,i=[],j={},k=!1,l=c.caller;l&&!k;l=l.caller)if(l!==d&&l!==Q.report){if(g={url:null,func:T,line:null,column:null},l.name?g.func=l.name:(f=h.exec(l.toString()))&&(g.func=f[1]),"undefined"==typeof g.func)try{g.func=f.input.substring(0,f.input.indexOf("{"))}catch(m){}j[""+l]?k=!0:j[""+l]=!0,i.push(g)}e&&i.splice(0,e);var n={name:a.name,message:a.message,url:F(),stack:i};return b(n,a.sourceURL||a.fileName,a.line||a.lineNumber,a.message||a.description),n}function d(b,d){var e=null;d=null==d?0:+d;try{if(e=a(b))return e}catch(f){if(Q.debug)throw f}try{if(e=c(b,d+1))return e}catch(f){if(Q.debug)throw f}return{name:b.name,message:b.message,url:F()}}return d.augmentStackTraceWithInitialElement=b,d.computeStackTraceFromStackProp=a,d}();var V=Q,W=a(function(a,b){function c(a,b){for(var c=0;c<a.length;++c)if(a[c]===b)return c;return-1}function d(a,b,c,d){return JSON.stringify(a,f(b,d),c)}function e(a){var b={stack:a.stack,message:a.message,name:a.name};for(var c in a)Object.prototype.hasOwnProperty.call(a,c)&&(b[c]=a[c]);return b}function f(a,b){var d=[],f=[];return null==b&&(b=function(a,b){return d[0]===b?"[Circular ~]":"[Circular ~."+f.slice(0,c(d,b)).join(".")+"]"}),function(g,h){if(d.length>0){var i=c(d,this);~i?d.splice(i+1):d.push(this),~i?f.splice(i,1/0,g):f.push(g),~c(d,h)&&(h=b.call(this,g,h))}else d.push(h);return null==a?h instanceof Error?e(h):h:a.call(this,g,h)}}b=a.exports=d,b.getSerialize=f});G.prototype=new Error,G.prototype.constructor=G;var X=G,Y=function(a,b,c){var d=a[b],e=a;if(b in a){var f="warn"===b?"warning":b;a[b]=function(){var a=[].slice.call(arguments),g=P.safeJoin(a," "),h={level:f,logger:"console",extra:{arguments:a}};"assert"===b?a[0]===!1&&(g="Assertion failed: "+(P.safeJoin(a.slice(1)," ")||"console.assert"),h.extra.arguments=a.slice(1),c&&c(g,h)):c&&c(g,h),d&&Function.prototype.apply.call(d,e,a)}}},Z={wrapMethod:Y},$=P.isError,_=P.isObject,aa=P.isErrorEvent,ba=P.isUndefined,ca=P.isFunction,da=P.isString,ea=P.isArray,fa=P.isEmptyObject,ga=P.each,ha=P.objectMerge,ia=P.truncate,ja=P.objectFrozen,ka=P.hasKey,la=P.joinRegExp,ma=P.urlencode,na=P.uuid4,oa=P.htmlTreeAsString,pa=P.isSameException,qa=P.isSameStacktrace,ra=P.parseUrl,sa=P.fill,ta=P.supportsFetch,ua=Z.wrapMethod,va="source protocol user pass host port path".split(" "),wa=/^(?:(\w+):)?\/\/(?:(\w+)(:\w+)?@)?([\w\.-]+)(?::(\d+))?(\/.*)/,xa="undefined"!=typeof window?window:"undefined"!=typeof M?M:"undefined"!=typeof self?self:{},ya=xa.document,za=xa.navigator;J.prototype={VERSION:"3.22.2",debug:!1,TraceKit:V,config:function(a,b){var c=this;if(c.i)return this.C("error","Error: Raven has already been configured"),c;if(!a)return c;var d=c.m;b&&ga(b,function(a,b){"tags"===a||"extra"===a||"user"===a?c.l[a]=b:d[a]=b}),c.setDSN(a),d.ignoreErrors.push(/^Script error\.?$/),d.ignoreErrors.push(/^Javascript error: Script error\.? on line 0$/),d.ignoreErrors=la(d.ignoreErrors),d.ignoreUrls=!!d.ignoreUrls.length&&la(d.ignoreUrls),d.whitelistUrls=!!d.whitelistUrls.length&&la(d.whitelistUrls),d.includePaths=la(d.includePaths),d.maxBreadcrumbs=Math.max(0,Math.min(d.maxBreadcrumbs||100,100));var e={xhr:!0,console:!0,dom:!0,location:!0,sentry:!0},f=d.autoBreadcrumbs;"[object Object]"==={}.toString.call(f)?f=ha(e,f):f!==!1&&(f=e),d.autoBreadcrumbs=f;var g={tryCatch:!0},h=d.instrument;return"[object Object]"==={}.toString.call(h)?h=ha(g,h):h!==!1&&(h=g),d.instrument=h,V.collectWindowErrors=!!d.collectWindowErrors,c},install:function(){var a=this;return a.isSetup()&&!a.p&&(V.report.subscribe(function(){a.D.apply(a,arguments)}),a.E(),a.m.instrument&&a.m.instrument.tryCatch&&a.F(),a.m.autoBreadcrumbs&&a.G(),a.H(),a.p=!0),Error.stackTraceLimit=a.m.stackTraceLimit,this},setDSN:function(a){var b=this,c=b.I(a),d=c.path.lastIndexOf("/"),e=c.path.substr(1,d);b.J=a,b.j=c.user,b.K=c.pass&&c.pass.substr(1),b.k=c.path.substr(d+1),b.i=b.L(c),b.M=b.i+"/"+e+"api/"+b.k+"/store/",this.A()},context:function(a,b,c){return ca(a)&&(c=b||[],b=a,a=void 0),this.wrap(a,b).apply(this,c)},wrap:function(a,b,c){function d(){var d=[],f=arguments.length,g=!a||a&&a.deep!==!1;for(c&&ca(c)&&c.apply(this,arguments);f--;)d[f]=g?e.wrap(a,arguments[f]):arguments[f];try{return b.apply(this,d)}catch(h){throw e.N(),e.captureException(h,a),h}}var e=this;if(ba(b)&&!ca(a))return a;if(ca(a)&&(b=a,a=void 0),!ca(b))return b;try{if(b.a)return b;if(b.O)return b.O}catch(f){return b}for(var g in b)ka(b,g)&&(d[g]=b[g]);return d.prototype=b.prototype,b.O=d,d.a=!0,d.b=b,d},uninstall:function(){return V.report.uninstall(),this.P(),this.Q(),this.R(),Error.stackTraceLimit=this.q,this.p=!1,this},captureException:function(a,b){b=ha({trimHeadFrames:0},b?b:{});var c=!$(a),d=!aa(a),e=aa(a)&&!a.error;if(c&&d||e)return this.captureMessage(a,ha(b,{stacktrace:!0,trimHeadFrames:b.trimHeadFrames+1}));aa(a)&&(a=a.error),this.f=a;try{var f=V.computeStackTrace(a);this.S(f,b)}catch(g){if(a!==g)throw g}return this},captureMessage:function(a,b){if(!this.m.ignoreErrors.test||!this.m.ignoreErrors.test(a)){b=b||{};var c,d=ha({message:a+""},b);try{throw new Error(a)}catch(e){c=e}c.name=null;var f=V.computeStackTrace(c),g=ea(f.stack)&&f.stack[1],h=g&&g.url||"";if((!this.m.ignoreUrls.test||!this.m.ignoreUrls.test(h))&&(!this.m.whitelistUrls.test||this.m.whitelistUrls.test(h))){if(this.m.stacktrace||b&&b.stacktrace){b=ha({fingerprint:a,trimHeadFrames:(b.trimHeadFrames||0)+1},b);var i=this.T(f,b);d.stacktrace={frames:i.reverse()}}return this.U(d),this}}},captureBreadcrumb:function(a){var b=ha({timestamp:H()/1e3},a);if(ca(this.m.breadcrumbCallback)){var c=this.m.breadcrumbCallback(b);if(_(c)&&!fa(c))b=c;else if(c===!1)return this}return this.w.push(b),this.w.length>this.m.maxBreadcrumbs&&this.w.shift(),this},addPlugin:function(a){var b=[].slice.call(arguments,1);return this.t.push([a,b]),this.p&&this.H(),this},setUserContext:function(a){return this.l.user=a,this},setExtraContext:function(a){return this.V("extra",a),this},setTagsContext:function(a){return this.V("tags",a),this},clearContext:function(){return this.l={},this},getContext:function(){return JSON.parse(W(this.l))},setEnvironment:function(a){return this.m.environment=a,this},setRelease:function(a){return this.m.release=a,this},setDataCallback:function(a){var b=this.m.dataCallback;return this.m.dataCallback=I(b,a),this},setBreadcrumbCallback:function(a){var b=this.m.breadcrumbCallback;return this.m.breadcrumbCallback=I(b,a),this},setShouldSendCallback:function(a){var b=this.m.shouldSendCallback;return this.m.shouldSendCallback=I(b,a),this},setTransport:function(a){return this.m.transport=a,this},lastException:function(){return this.f},lastEventId:function(){return this.h},isSetup:function(){return!!this.c&&(!!this.i||(this.ravenNotConfiguredError||(this.ravenNotConfiguredError=!0,this.C("error","Error: Raven has not been configured.")),!1))},afterLoad:function(){var a=xa.RavenConfig;a&&this.config(a.dsn,a.config).install()},showReportDialog:function(a){if(ya){a=a||{};var b=a.eventId||this.lastEventId();if(!b)throw new X("Missing eventId");var c=a.dsn||this.J;if(!c)throw new X("Missing DSN");var d=encodeURIComponent,e="";e+="?eventId="+d(b),e+="&dsn="+d(c);var f=a.user||this.l.user;f&&(f.name&&(e+="&name="+d(f.name)),f.email&&(e+="&email="+d(f.email)));var g=this.L(this.I(c)),h=ya.createElement("script");h.async=!0,h.src=g+"/api/embed/error-page/"+e,(ya.head||ya.body).appendChild(h)}},N:function(){var a=this;this.o+=1,setTimeout(function(){a.o-=1})},W:function(a,b){var c,d;if(this.d){b=b||{},a="raven"+a.substr(0,1).toUpperCase()+a.substr(1),ya.createEvent?(c=ya.createEvent("HTMLEvents"),c.initEvent(a,!0,!0)):(c=ya.createEventObject(),c.eventType=a);for(d in b)ka(b,d)&&(c[d]=b[d]);if(ya.createEvent)ya.dispatchEvent(c);else try{ya.fireEvent("on"+c.eventType.toLowerCase(),c)}catch(e){}}},X:function(a){var b=this;return function(c){if(b.Y=null,b.x!==c){b.x=c;var d;try{d=oa(c.target)}catch(e){d="<unknown>"}b.captureBreadcrumb({category:"ui."+a,message:d})}}},Z:function(){var a=this,b=1e3;return function(c){var d;try{d=c.target}catch(e){return}var f=d&&d.tagName;if(f&&("INPUT"===f||"TEXTAREA"===f||d.isContentEditable)){var g=a.Y;g||a.X("input")(c),clearTimeout(g),a.Y=setTimeout(function(){a.Y=null},b)}}},$:function(a,b){var c=ra(this.y.href),d=ra(b),e=ra(a);this.z=b,c.protocol===d.protocol&&c.host===d.host&&(b=d.relative),c.protocol===e.protocol&&c.host===e.host&&(a=e.relative),this.captureBreadcrumb({category:"navigation",data:{to:b,from:a}})},E:function(){var a=this;a._=Function.prototype.toString,Function.prototype.toString=function(){return"function"==typeof this&&this.a?a._.apply(this.b,arguments):a._.apply(this,arguments)}},P:function(){this._&&(Function.prototype.toString=this._)},F:function(){function a(a){return function(b,d){for(var e=new Array(arguments.length),f=0;f<e.length;++f)e[f]=arguments[f];var g=e[0];return ca(g)&&(e[0]=c.wrap(g)),a.apply?a.apply(this,e):a(e[0],e[1])}}function b(a){var b=xa[a]&&xa[a].prototype;b&&b.hasOwnProperty&&b.hasOwnProperty("addEventListener")&&(sa(b,"addEventListener",function(b){return function(d,f,g,h){try{f&&f.handleEvent&&(f.handleEvent=c.wrap(f.handleEvent))}catch(i){}var j,k,l;return e&&e.dom&&("EventTarget"===a||"Node"===a)&&(k=c.X("click"),l=c.Z(),j=function(a){if(a){var b;try{b=a.type}catch(c){return}return"click"===b?k(a):"keypress"===b?l(a):void 0}}),b.call(this,d,c.wrap(f,void 0,j),g,h)}},d),sa(b,"removeEventListener",function(a){return function(b,c,d,e){try{c=c&&(c.O?c.O:c)}catch(f){}return a.call(this,b,c,d,e)}},d))}var c=this,d=c.v,e=this.m.autoBreadcrumbs;sa(xa,"setTimeout",a,d),sa(xa,"setInterval",a,d),xa.requestAnimationFrame&&sa(xa,"requestAnimationFrame",function(a){return function(b){return a(c.wrap(b))}},d);for(var 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"],g=0;g<f.length;g++)b(f[g])},G:function(){function a(a,c){a in c&&ca(c[a])&&sa(c,a,function(a){return b.wrap(a)})}var b=this,c=this.m.autoBreadcrumbs,d=b.v;if(c.xhr&&"XMLHttpRequest"in xa){var e=XMLHttpRequest.prototype;sa(e,"open",function(a){return function(c,d){return da(d)&&d.indexOf(b.j)===-1&&(this.aa={method:c,url:d,status_code:null}),a.apply(this,arguments)}},d),sa(e,"send",function(c){return function(){function d(){if(e.aa&&4===e.readyState){try{e.aa.status_code=e.status}catch(a){}b.captureBreadcrumb({type:"http",category:"xhr",data:e.aa})}}for(var e=this,f=["onload","onerror","onprogress"],g=0;g<f.length;g++)a(f[g],e);return"onreadystatechange"in e&&ca(e.onreadystatechange)?sa(e,"onreadystatechange",function(a){return b.wrap(a,void 0,d)}):e.onreadystatechange=d,c.apply(this,arguments)}},d)}c.xhr&&ta()&&sa(xa,"fetch",function(a){return function(){for(var c=new Array(arguments.length),d=0;d<c.length;++d)c[d]=arguments[d];var e,f=c[0],g="GET";if("string"==typeof f?e=f:"Request"in xa&&f instanceof xa.Request?(e=f.url,f.method&&(g=f.method)):e=""+f,e.indexOf(b.j)!==-1)return a.apply(this,c);c[1]&&c[1].method&&(g=c[1].method);var h={method:g,url:e,status_code:null};return a.apply(this,c).then(function(a){return h.status_code=a.status,b.captureBreadcrumb({type:"http",category:"fetch",data:h}),a})}},d),c.dom&&this.d&&(ya.addEventListener?(ya.addEventListener("click",b.X("click"),!1),ya.addEventListener("keypress",b.Z(),!1)):(ya.attachEvent("onclick",b.X("click")),ya.attachEvent("onkeypress",b.Z())));var f=xa.chrome,g=f&&f.app&&f.app.runtime,h=!g&&xa.history&&history.pushState&&history.replaceState;if(c.location&&h){var i=xa.onpopstate;xa.onpopstate=function(){var a=b.y.href;if(b.$(b.z,a),i)return i.apply(this,arguments)};var j=function(a){return function(){var c=arguments.length>2?arguments[2]:void 0;return c&&b.$(b.z,c+""),a.apply(this,arguments)}};sa(history,"pushState",j,d),sa(history,"replaceState",j,d)}if(c.console&&"console"in xa&&console.log){var k=function(a,c){b.captureBreadcrumb({message:a,level:c.level,category:"console"})};ga(["debug","info","warn","error","log"],function(a,b){ua(console,b,k)})}},Q:function(){for(var a;this.v.length;){a=this.v.shift();var b=a[0],c=a[1],d=a[2];b[c]=d}},R:function(){for(var a in this.s)this.r[a]=this.s[a]},H:function(){var a=this;ga(this.t,function(b,c){var d=c[0],e=c[1];d.apply(a,[a].concat(e))})},I:function(a){var b=wa.exec(a),c={},d=7;try{for(;d--;)c[va[d]]=b[d]||""}catch(e){throw new X("Invalid DSN: "+a)}if(c.pass&&!this.m.allowSecretKey)throw new X("Do not specify your secret key in the DSN. See: http://bit.ly/raven-secret-key");return c},L:function(a){var b="//"+a.host+(a.port?":"+a.port:"");return a.protocol&&(b=a.protocol+":"+b),b},D:function(){this.o||this.S.apply(this,arguments)},S:function(a,b){var c=this.T(a,b);this.W("handle",{stackInfo:a,options:b}),this.ba(a.name,a.message,a.url,a.lineno,c,b)},T:function(a,b){var c=this,d=[];if(a.stack&&a.stack.length&&(ga(a.stack,function(b,e){var f=c.ca(e,a.url);f&&d.push(f)}),b&&b.trimHeadFrames))for(var e=0;e<b.trimHeadFrames&&e<d.length;e++)d[e].in_app=!1;return d=d.slice(0,this.m.stackTraceLimit)},ca:function(a,b){var c={filename:a.url,lineno:a.line,colno:a.column,"function":a.func||"?"};return a.url||(c.filename=b),c.in_app=!(this.m.includePaths.test&&!this.m.includePaths.test(c.filename)||/(Raven|TraceKit)\./.test(c["function"])||/raven\.(min\.)?js$/.test(c.filename)),c},ba:function(a,b,c,d,e,f){var g=(a?a+": ":"")+(b||"");if(!this.m.ignoreErrors.test||!this.m.ignoreErrors.test(b)&&!this.m.ignoreErrors.test(g)){var h;if(e&&e.length?(c=e[0].filename||c,e.reverse(),h={frames:e}):c&&(h={frames:[{filename:c,lineno:d,in_app:!0}]}),(!this.m.ignoreUrls.test||!this.m.ignoreUrls.test(c))&&(!this.m.whitelistUrls.test||this.m.whitelistUrls.test(c))){var i=ha({exception:{values:[{type:a,value:b,stacktrace:h}]},culprit:c},f);this.U(i)}}},da:function(a){var b=this.m.maxMessageLength;if(a.message&&(a.message=ia(a.message,b)),a.exception){var c=a.exception.values[0];c.value=ia(c.value,b)}var d=a.request;return d&&(d.url&&(d.url=ia(d.url,this.m.maxUrlLength)),d.Referer&&(d.Referer=ia(d.Referer,this.m.maxUrlLength))),a.breadcrumbs&&a.breadcrumbs.values&&this.ea(a.breadcrumbs),a},ea:function(a){for(var b,c,d,e=["to","from","url"],f=0;f<a.values.length;++f)if(c=a.values[f],c.hasOwnProperty("data")&&_(c.data)&&!ja(c.data)){d=ha({},c.data);for(var g=0;g<e.length;++g)b=e[g],d.hasOwnProperty(b)&&d[b]&&(d[b]=ia(d[b],this.m.maxUrlLength));a.values[f].data=d}},fa:function(){if(this.e||this.d){var a={};return this.e&&za.userAgent&&(a.headers={"User-Agent":navigator.userAgent}),xa.location&&xa.location.href&&(a.url=xa.location.href),this.d&&ya.referrer&&(a.headers||(a.headers={}),a.headers.Referer=ya.referrer),a}},A:function(){this.ga=0,this.ha=null},ia:function(){return this.ga&&H()-this.ha<this.ga},ja:function(a){var b=this.g;return!(!b||a.message!==b.message||a.culprit!==b.culprit)&&(a.stacktrace||b.stacktrace?qa(a.stacktrace,b.stacktrace):!a.exception&&!b.exception||pa(a.exception,b.exception))},ka:function(a){if(!this.ia()){var b=a.status;if(400===b||401===b||429===b){var c;try{c=ta()?a.headers.get("Retry-After"):a.getResponseHeader("Retry-After"),c=1e3*parseInt(c,10)}catch(d){}this.ga=c?c:2*this.ga||1e3,this.ha=H()}}},U:function(a){var b=this.m,c={project:this.k,logger:b.logger,platform:"javascript"},d=this.fa();if(d&&(c.request=d),a.trimHeadFrames&&delete a.trimHeadFrames,a=ha(c,a),a.tags=ha(ha({},this.l.tags),a.tags),a.extra=ha(ha({},this.l.extra),a.extra),a.extra["session:duration"]=H()-this.u,this.w&&this.w.length>0&&(a.breadcrumbs={values:[].slice.call(this.w,0)}),this.l.user&&(a.user=this.l.user),b.environment&&(a.environment=b.environment),b.release&&(a.release=b.release),b.serverName&&(a.server_name=b.serverName),Object.keys(a).forEach(function(b){(null==a[b]||""===a[b]||fa(a[b]))&&delete a[b]}),ca(b.dataCallback)&&(a=b.dataCallback(a)||a),a&&!fa(a)&&(!ca(b.shouldSendCallback)||b.shouldSendCallback(a)))return this.ia()?void this.C("warn","Raven dropped error due to backoff: ",a):void("number"==typeof b.sampleRate?Math.random()<b.sampleRate&&this.la(a):this.la(a))},ma:function(){return na()},la:function(a,b){var c=this,d=this.m;if(this.isSetup()){if(a=this.da(a),!this.m.allowDuplicates&&this.ja(a))return void this.C("warn","Raven dropped repeat event: ",a);this.h=a.event_id||(a.event_id=this.ma()),this.g=a,this.C("debug","Raven about to send:",a);var e={sentry_version:"7",sentry_client:"raven-js/"+this.VERSION,sentry_key:this.j};this.K&&(e.sentry_secret=this.K);var f=a.exception&&a.exception.values[0];this.m.autoBreadcrumbs&&this.m.autoBreadcrumbs.sentry&&this.captureBreadcrumb({category:"sentry",message:f?(f.type?f.type+": ":"")+f.value:a.message,event_id:a.event_id,level:a.level||"error"});var g=this.M;(d.transport||this.na).call(this,{url:g,auth:e,data:a,options:d,onSuccess:function(){c.A(),c.W("success",{data:a,src:g}),b&&b()},onError:function(d){c.C("error","Raven transport failed to send: ",d),d.request&&c.ka(d.request),c.W("failure",{data:a,src:g}),d=d||new Error("Raven send failed (no additional details provided)"),b&&b(d)}})}},na:function(a){var b=a.url+"?"+ma(a.auth),c=null,d={};if(a.options.headers&&(c=this.oa(a.options.headers)),a.options.fetchParameters&&(d=this.oa(a.options.fetchParameters)),ta()){d.body=W(a.data);var e=ha({},this.n),f=ha(e,d);return c&&(f.headers=c),xa.fetch(b,f).then(function(b){if(b.ok)a.onSuccess&&a.onSuccess();else{var c=new Error("Sentry error code: "+b.status);c.request=b,a.onError&&a.onError(c)}})["catch"](function(){a.onError&&a.onError(new Error("Sentry error code: network unavailable"))})}var g=xa.XMLHttpRequest&&new xa.XMLHttpRequest;if(g){var h="withCredentials"in g||"undefined"!=typeof XDomainRequest;h&&("withCredentials"in g?g.onreadystatechange=function(){if(4===g.readyState)if(200===g.status)a.onSuccess&&a.onSuccess();else if(a.onError){var b=new Error("Sentry error code: "+g.status);b.request=g,a.onError(b)}}:(g=new XDomainRequest,b=b.replace(/^https?:/,""),a.onSuccess&&(g.onload=a.onSuccess),a.onError&&(g.onerror=function(){var b=new Error("Sentry error code: XDomainRequest");b.request=g,a.onError(b)})),g.open("POST",b),c&&ga(c,function(a,b){g.setRequestHeader(a,b)}),g.send(W(a.data)))}},oa:function(a){var b={};for(var c in a)if(a.hasOwnProperty(c)){var d=a[c];b[c]="function"==typeof d?d():d}return b},C:function(a){this.s[a]&&this.debug&&Function.prototype.apply.call(this.s[a],this.r,[].slice.call(arguments,1))},V:function(a,b){ba(b)?delete this.l[a]:this.l[a]=ha(this.l[a]||{},b)}},J.prototype.setUser=J.prototype.setUserContext,J.prototype.setReleaseContext=J.prototype.setRelease;var Aa=J,Ba="undefined"!=typeof window?window:"undefined"!=typeof M?M:"undefined"!=typeof self?self:{},Ca=Ba.Raven,Da=new Aa;Da.noConflict=function(){return Ba.Raven=Ca,Da},Da.afterLoad();var Ea=Da,Fa=Z.wrapMethod,Ga=K,Ha=L;Ea.addPlugin(Ga).addPlugin(Ha);var Ia={};return Ia});
|
|
//# sourceMappingURL=raven.min.js.map
|