From 05fed5c0132631423254cdffee7759b2c19f30e9 Mon Sep 17 00:00:00 2001 From: Stanescu Eduard-Dan Date: Fri, 26 May 2023 21:19:00 +0300 Subject: [PATCH] Cannot parse given Error object --- dist/elmahio.js | 7 ++++--- dist/elmahio.js.map | 2 +- dist/elmahio.min.js | 2 +- dist/elmahio.min.js.map | 2 +- src/elmahio.js | 7 ++++--- 5 files changed, 11 insertions(+), 9 deletions(-) diff --git a/dist/elmahio.js b/dist/elmahio.js index 0afc7e0..e5bb847 100644 --- a/dist/elmahio.js +++ b/dist/elmahio.js @@ -1527,7 +1527,7 @@ publicAPIs.emit('error', xhr.status, xhr.statusText); } if (type !== "Log") { - var stack = error ? ErrorStackParser.parse(error) : null; + var stack = error && error instanceof Error ? ErrorStackParser.parse(error) : null; var jsonData = { "title": message, "source": stack && stack.length > 0 ? stack[0].fileName : null, @@ -1559,14 +1559,15 @@ breadcrumbs = []; } publicAPIs.emit('message', jsonData); - if (error && type !== "Log" && typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) { + if (error && error instanceof Error && type !== "Log" && typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) { stackGPS(error, xhr, jsonData); } else { - if (jsonData.errorObject) { + if (jsonData.errorObject && jsonData.errorObject instanceof Error) { error = jsonData.errorObject; delete jsonData.errorObject; stackGPS(error, xhr, jsonData); } else { + delete jsonData.errorObject; xhr.send(JSON.stringify(jsonData)); } } diff --git a/dist/elmahio.js.map b/dist/elmahio.js.map index 6bdac32..f798753 100644 --- a/dist/elmahio.js.map +++ b/dist/elmahio.js.map @@ -1 +1 @@ -{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\n * elmah.io Javascript Logger - version 3.7.1\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n \"use strict\";\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error(\"Cannot parse given Error object\");\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(\":\") === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf(\"(eval \") > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\n }\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(\" \") || undefined;\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(\" > eval\") > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\n }\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split(\"\\n\");\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split(\"\\n\");\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split(\"@\");\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || \"\";\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\n }\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function stackGPS(error, xhr, jsonData) {\n \tvar errorStack = error.toString().split(\"\\n\")[0];\n \tvar gps = new StackTraceGPS();\n var promise = new Promise(function(resolve) {\n\t var stackframes = ErrorStackParser.parse(error);\n\t resolve(Promise.all(stackframes.map(function(sf) {\n\t return new Promise(function(resolve) {\n\t function resolveOriginal() {\n\t resolve(sf);\n\t }\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n\t });\n\t })));\t\n });\n\n promise.then(function(newFrames){\n \tnewFrames.forEach(function(stackFrame, i){\n\t\t\t\t\tif(stackFrame.functionName) {\n \t\t\tvar fn = stackFrame.functionName + ' ';\n \t\t} else {\n \t\t\tvar fn = '';\n \t\t}\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n \t\tnewFrames[i] = stackString;\n \t});\n \tnewFrames.unshift(errorStack);\n \tjsonData.detail = newFrames.join(\"\\n\");\n \txhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n \t// send message trying to pinpoint stackframes\n \tstackGPS(error.error, xhr, jsonData);\n\t } else {\n\t \t// send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n } else {\n // send message\n if(jsonData.errorObject) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n stackGPS(error, xhr, jsonData);\n } else {\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n }\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.js"} \ No newline at end of file +{"version":3,"names":[],"mappings":"","sources":["elmahio.js"],"sourcesContent":["/*!\n * elmah.io Javascript Logger - version 3.7.1\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n \"use strict\";\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error(\"Cannot parse given Error object\");\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(\":\") === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf(\"(eval \") > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\n }\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(\" \") || undefined;\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(\" > eval\") > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\n }\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split(\"\\n\");\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split(\"\\n\");\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split(\"@\");\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || \"\";\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\n }\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function stackGPS(error, xhr, jsonData) {\n \tvar errorStack = error.toString().split(\"\\n\")[0];\n \tvar gps = new StackTraceGPS();\n var promise = new Promise(function(resolve) {\n\t var stackframes = ErrorStackParser.parse(error);\n\t resolve(Promise.all(stackframes.map(function(sf) {\n\t return new Promise(function(resolve) {\n\t function resolveOriginal() {\n\t resolve(sf);\n\t }\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n\t });\n\t })));\t\n });\n\n promise.then(function(newFrames){\n \tnewFrames.forEach(function(stackFrame, i){\n\t\t\t\t\tif(stackFrame.functionName) {\n \t\t\tvar fn = stackFrame.functionName + ' ';\n \t\t} else {\n \t\t\tvar fn = '';\n \t\t}\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n \t\tnewFrames[i] = stackString;\n \t});\n \tnewFrames.unshift(errorStack);\n \tjsonData.detail = newFrames.join(\"\\n\");\n \txhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n \t// send message trying to pinpoint stackframes\n \tstackGPS(error.error, xhr, jsonData);\n\t } else {\n\t \t// send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n stackGPS(error, xhr, jsonData);\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n }\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.js"} \ No newline at end of file diff --git a/dist/elmahio.min.js b/dist/elmahio.min.js index 68344ce..5e90f7c 100644 --- a/dist/elmahio.min.js +++ b/dist/elmahio.min.js @@ -2,5 +2,5 @@ * elmah.io Javascript Logger - version 3.7.1 * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io */ -!function(e,t){"function"==typeof define&&define.amd?define([],function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.Elmahio=t(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(e){"use strict";for(var t,n,r,o=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=r.concat(o,i,["args"]);function s(e){if(e instanceof Object)for(var n=0;n-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||void 0,i=["eval",""].indexOf(n[0])>-1?void 0:n[0];return new o({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new o({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new o({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,a=n.length;i/,"$2").replace(/\([^\)]*\)/g,"")||void 0;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new o({functionName:a,args:s,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}),a=function(t,n){function r(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("get",e),r.onerror=n,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?t(r.responseText):n(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function o(t){if(void 0!==e&&e.atob)return e.atob(t);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}return function e(a){if(!(this instanceof e))return new e(a);a=a||{},this.sourceCache=a.sourceCache||{},this.sourceMapConsumerCache=a.sourceMapConsumerCache||{},this.ajax=a.ajax||r,this._atob=a.atob||o,this._get=function(e){return new Promise(function(t,n){var r="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(a.offline&&!r)n(new Error("Cannot make network requests in offline mode"));else if(r){var o=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(o){var i=o[0].length,s=e.substr(i),u=this._atob(s);this.sourceCache[e]=u,t(u)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var l=this.ajax(e,{method:"get"});this.sourceCache[e]=l,l.then(t,n)}}.bind(this))},this._getSourceMapConsumer=function(e,n){return new Promise(function(r,o){if(this.sourceMapConsumerCache[e])r(this.sourceMapConsumerCache[e]);else{var i=new Promise(function(r,o){return this._get(e).then(function(e){"string"==typeof e&&(e=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(e.replace(/^\)\]\}'/,""))),void 0===e.sourceRoot&&(e.sourceRoot=n),r(new t.SourceMapConsumer(e))},o)}.bind(this));this.sourceMapConsumerCache[e]=i,r(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,n){this.getMappedLocation(e).then(function(e){function n(){t(e)}this.findFunctionName(e).then(t,n).catch(n)}.bind(this),n)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(t,r){i(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,i=e.columnNumber,a=function(e,t){for(var n=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(t,20),a=0;a=0&&(s=s.substr(0,u)),s){o=s+o;for(var l=n.length,c=0;c=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},t.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var t=Object.create(l.prototype),n=t._names=i.fromArray(e._names.toArray(),!0),o=t._sources=i.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],g=t.__originalMappings=[],p=0,f=a.length;p1&&(n.source=m+i[1],m+=i[1],n.originalLine=f+i[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=h+i[3],h=n.originalColumn,i.length>4&&(n.name=d+i[4],d+=i[4])),C.push(n),"number"==typeof n.originalLine&&O.push(n)}s(C,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,s(O,r.compareByOriginalPositions),this.__originalMappings=O},l.prototype._findMapping=function(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=r.join(this.sourceRoot,i)));var a=r.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=r.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if(null!=this.sourceRoot&&(t=r.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var n={source:t=this._sources.indexOf(t),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=l,g.prototype=Object.create(u.prototype),g.prototype.constructor=u,g.prototype._version=3,Object.defineProperty(g.prototype,"sources",{get:function(){for(var e=[],t=0;t=0;c--)"."===(a=u[c])?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(n=u.join("/"))&&(n=s?"/":"."),r?(r.path=n,i(r)):n}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),s=o(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(n)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function c(e,t){return e===t?0:e>t?1:-1}t.toSetString=s?u:function(e){return l(e)?"$"+e:e},t.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=e.source-t.source;return 0!==r?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)||n?r:0!=(r=e.generatedColumn-t.generatedColumn)?r:0!=(r=e.generatedLine-t.generatedLine)?r:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-t.generatedColumn)||n?r:0!=(r=e.source-t.source)?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)?r:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!=(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=c(e.source,t.source))?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)?n:c(e.name,t.name)}},function(e,t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,r,o){if(0===n.length)return-1;var i=function e(n,r,o,i,a,s){var u=Math.floor((r-n)/2)+n,l=a(o,i[u],!0);return 0===l?u:l>0?r-u>1?e(u,r,o,i,a,s):s==t.LEAST_UPPER_BOUND?r1?e(n,u,o,i,a,s):s==t.LEAST_UPPER_BOUND?u:n<0?-1:n}(-1,n.length,e,n,r,o||t.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(n[i],n[i-1],!0);)--i;return i}},function(e,t,n){var r=n(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,t){for(var n=new i,r=0,o=e.length;r=0&&e>>=5)>0&&(t|=32),o+=r.encode(t)}while(i>0);return o},t.decode=function(e,t,n){var o,i,a,s,u=e.length,l=0,c=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),n.rest=t}},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e ".length;e&&r++<5&&!("html"===(t=w(e))||r>1&&o+n.length*i+t.length>=80);)n.push(t),o+=t.length,e=e.parentNode;return n.reverse().join(" > ")}function w(e){var t,n,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(t=e.className)&&O(t))for(n=t.split(/\s+/),i=0;i=0&&"number"==typeof t.breadcrumbsNumber&&(t.breadcrumbsNumber>25?r=25:t.breadcrumbsNumber<=25&&(r=t.breadcrumbsNumber)),o.length>r&&o.shift()},L=function(e){var t;try{t=C(e.target)}catch(e){t=""}w({severity:"Information",action:"Click",message:t})},N=function(e){var t;try{t=C(e.target)}catch(e){t=""}w({severity:"Information",action:"Form submit",message:t})},E=function(t){var n=null;switch(t.type){case"load":n="Page loaded";break;case"DOMContentLoaded":n="DOMContentLoaded";break;case"pageshow":n="Page shown";break;case"pagehide":n="Page hidden";break;case"popstate":n="Navigated from: "+s+" to: "+e.location.href}w({severity:"Information",action:"Navigation",message:n})},A=function(e){var t=e.oldURL,n=e.newURL,r=null;r=t&&n?"from: '"+S(t)+"' to: '"+S(n)+"'":"to: '"+location.hash+"'",w({severity:"Information",action:"Navigation",message:"Hash changed "+r})},M=function(e,t,a,s,l,p){var f=e,h=t,d=s,v=p,y=l,O=1,C=b();if((null===f||null===h)&&2!==g)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(f=c.apiKey,h=c.logId);var w=new XMLHttpRequest;if(w.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),w.setRequestHeader("Content-type","application/json"),w.onload=function(e){4===w.readyState&&(201===w.status&&a("success",w.statusText),w.status>=400&&w.status<=499&&(a("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){a("error",w.statusText),r.emit("error",w.status,w.statusText)},"Log"!==d){var S=v?i.parse(v):null;L=_(L={title:y,source:S&&S.length>0?S[0].fileName:null,detail:v?v.stack:null,severity:d,type:v?v.name:null,queryString:JSON.parse(JSON.stringify(C))},u())}else var L=v;if(null!==n.filter&&n.filter(L)&&(O=0),1===O)if(L.title){if(o.length>0){if(L.breadcrumbs&&L.breadcrumbs.length>0){o=o.reverse();for(var N=0;N1)if(String(e).match(/%[sdif]/g)){var r=0;n=String(e).replace(/%[sdif]/g,function(e){switch(e){case"%s":return t[++r]?String(t[r]):"%s";case"%d":return t[++r]?d(t[r])||v(t[r])?parseInt(t[r]):"NaN":"%d";case"%i":return t[++r]?d(t[r])||v(t[r])?parseInt(t[r]):"NaN":"%i";case"%f":return t[++r]?d(t[r])||v(t[r])?parseFloat(t[r]):"NaN":"%f";default:return e}});for(var o=t.length,i=t[++r];r=400&&w.status<=499&&(i("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){i("error",w.statusText),r.emit("error",w.status,w.statusText)};var S={title:f,titleTemplate:h,detail:function(e,t,n){for(var r=[],o=0;o0&&(S.breadcrumbs=o,o=[]),null!==n.filter&&n.filter(S)&&(O=0),1===O&&(S.title?(r.emit("message",S),w.send(JSON.stringify(S))):i("missing-title",w.statusText))};return r.error=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Error",e,t)},n.breadcrumbs?100:0)},r.verbose=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Verbose",e,t)},n.breadcrumbs?100:0)},r.debug=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Debug",e,t)},n.breadcrumbs?100:0)},r.information=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Information",e,t)},n.breadcrumbs?100:0)},r.warning=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Warning",e,t)},n.breadcrumbs?100:0)},r.fatal=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Fatal",e,t)},n.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){M(n.apiKey,n.logId,l,"Log",null,e)},n.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var t=e,n=t?i.parse(t):null,r={title:t.message,source:n&&n.length>0?n[0].fileName:null,detail:t?t.stack:null,severity:"Error",type:t?t.name:null,errorObject:t};return r=_(r,u())}(e)},r.addBreadcrumb=function(e,t,n){w({severity:null!=t&&O(t)?t:"Information",action:null!=n&&O(n)?n:"Log",message:null!=e&&O(e)?e:"This is just a test message."})},r.on=function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},r.emit=function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r0&&r<400?o="Information":r>399&&r<500?o="Warning":r>=500&&(o="Error"),w({severity:o,action:"Request",message:"["+t+"] "+n+(r>0?" ("+r+")":"")}))}(n,e,t)},!1),s.apply(this,arguments)}}}if(e.onerror=function(e,t,a,s,f){var h={message:e,source:t,lineno:a,colno:s,error:f};return setTimeout(function(){!function(e,t,a,s){var l=e,f=t,h=s,d=1,v=b(),O=h.error&&0!==y(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||O&&""!==O||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===l||null===f)&&2!==g)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,f=c.logId);var C=new XMLHttpRequest;C.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+l,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&(201===C.status&&a("success",C.statusText),C.status>=400&&C.status<=499&&(a("error",C.statusText),r.emit("error",C.status,C.statusText)))},C.onerror=function(e){a("error",C.statusText),r.emit("error",C.status,C.statusText)};var w={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:O&&O.length>0?O[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(v))};if(h.error&&0===y(h.error.stack)&&void 0===w.detail){var S=typeof s.error,L=S.charAt(0).toUpperCase()+S.slice(1);w.detail=function(e){var t=typeof e.error;return t.charAt(0).toUpperCase()+t.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}(s),w.source=s.source,w.title="Uncaught "+L+": "+s.error}w=_(w,u()),o.length>0&&(w.breadcrumbs=o,o=[]),null!==n.filter&&n.filter(w)&&(d=0),1===d&&(r.emit("message",w),h.error&&"object"==typeof h.error&&0!==y(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?m(h.error,C,w):C.send(JSON.stringify(w)))}else n.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",p.lightCSS,p.warningCSS)}(n.apiKey,n.logId,l,h)},n.breadcrumbs?100:0),!1},t&&"none"!==t.captureConsoleMinimumLevel){if("info"===t.captureConsoleMinimumLevel||"warn"===t.captureConsoleMinimumLevel||"error"===t.captureConsoleMinimumLevel||"debug"===t.captureConsoleMinimumLevel){var d=console.error;if(console.error=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Error",t)},n.breadcrumbs?100:0),d.apply(console,arguments)},"error"!==t.captureConsoleMinimumLevel){var v=console.warn;console.warn=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Warning",t)},n.breadcrumbs?100:0),v.apply(console,arguments)}}}if("info"===t.captureConsoleMinimumLevel||"debug"===t.captureConsoleMinimumLevel){var O=console.info;console.info=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Information",t)},n.breadcrumbs?100:0),O.apply(console,arguments)}}if("debug"===t.captureConsoleMinimumLevel){var C=console.debug;console.debug=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Debug",t)},n.breadcrumbs?100:0),C.apply(console,arguments)}}}},r.init(t),n.debug&&console.log("%c"+p.label,p.labelCSS),r};return g&&c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")?new L:L}); +!function(e,t){"function"==typeof define&&define.amd?define([],function(){return t(e)}):"object"==typeof exports?module.exports=t(e):e.Elmahio=t(e)}("undefined"!=typeof global?global:"undefined"!=typeof window?window:this,function(e){"use strict";for(var t,n,r,o=function(){function e(e){return!isNaN(parseFloat(e))&&isFinite(e)}function t(e){return e.charAt(0).toUpperCase()+e.substring(1)}function n(e){return function(){return this[e]}}var r=["isConstructor","isEval","isNative","isToplevel"],o=["columnNumber","lineNumber"],i=["fileName","functionName","source"],a=r.concat(o,i,["args"]);function s(e){if(e instanceof Object)for(var n=0;n-1&&(e=e.replace(/eval code/g,"eval").replace(/(\(eval at [^\()]*)|(\)\,.*$)/g,""));var t=e.replace(/^\s+/,"").replace(/\(eval code/g,"(").split(/\s+/).slice(1),n=this.extractLocation(t.pop()),r=t.join(" ")||void 0,i=["eval",""].indexOf(n[0])>-1?void 0:n[0];return new o({functionName:r,fileName:i,lineNumber:n[1],columnNumber:n[2],source:e})},this)},parseFFOrSafari:function(e){return e.stack.split("\n").filter(function(e){return!e.match(r)},this).map(function(e){if(e.indexOf(" > eval")>-1&&(e=e.replace(/ line (\d+)(?: > eval line \d+)* > eval\:\d+\:\d+/g,":$1")),-1===e.indexOf("@")&&-1===e.indexOf(":"))return new o({functionName:e});var t=/((.*".+"[^@]*)?[^@]*)(?:@)/,n=e.match(t),r=n&&n[1]?n[1]:void 0,i=this.extractLocation(e.replace(t,""));return new o({functionName:r,fileName:i[0],lineNumber:i[1],columnNumber:i[2],source:e})},this)},parseOpera:function(e){return!e.stacktrace||e.message.indexOf("\n")>-1&&e.message.split("\n").length>e.stacktrace.split("\n").length?this.parseOpera9(e):e.stack?this.parseOpera11(e):this.parseOpera10(e)},parseOpera9:function(e){for(var t=/Line (\d+).*script (?:in )?(\S+)/i,n=e.message.split("\n"),r=[],i=2,a=n.length;i/,"$2").replace(/\([^\)]*\)/g,"")||void 0;i.match(/\(([^\)]*)\)/)&&(t=i.replace(/^[^\(]+\(([^\)]*)\)$/,"$1"));var s=void 0===t||"[arguments not available]"===t?void 0:t.split(",");return new o({functionName:a,args:s,fileName:r[0],lineNumber:r[1],columnNumber:r[2],source:e})},this)}}),a=function(t,n){function r(e){return new Promise(function(t,n){var r=new XMLHttpRequest;r.open("get",e),r.onerror=n,r.onreadystatechange=function(){4===r.readyState&&(r.status>=200&&r.status<300||"file://"===e.substr(0,7)&&r.responseText?t(r.responseText):n(new Error("HTTP status: "+r.status+" retrieving "+e)))},r.send()})}function o(t){if(void 0!==e&&e.atob)return e.atob(t);throw new Error("You must supply a polyfill for window.atob in this environment")}function i(e){if("object"!=typeof e)throw new TypeError("Given StackFrame is not an object");if("string"!=typeof e.fileName)throw new TypeError("Given file name is not a String");if("number"!=typeof e.lineNumber||e.lineNumber%1!=0||e.lineNumber<1)throw new TypeError("Given line number must be a positive integer");if("number"!=typeof e.columnNumber||e.columnNumber%1!=0||e.columnNumber<0)throw new TypeError("Given column number must be a non-negative integer");return!0}return function e(a){if(!(this instanceof e))return new e(a);a=a||{},this.sourceCache=a.sourceCache||{},this.sourceMapConsumerCache=a.sourceMapConsumerCache||{},this.ajax=a.ajax||r,this._atob=a.atob||o,this._get=function(e){return new Promise(function(t,n){var r="data:"===e.substr(0,5);if(this.sourceCache[e])t(this.sourceCache[e]);else if(a.offline&&!r)n(new Error("Cannot make network requests in offline mode"));else if(r){var o=e.match(/^data:application\/json;([\w=:"-]+;)*base64,/);if(o){var i=o[0].length,s=e.substr(i),u=this._atob(s);this.sourceCache[e]=u,t(u)}else n(new Error("The encoding of the inline sourcemap is not supported"))}else{var l=this.ajax(e,{method:"get"});this.sourceCache[e]=l,l.then(t,n)}}.bind(this))},this._getSourceMapConsumer=function(e,n){return new Promise(function(r,o){if(this.sourceMapConsumerCache[e])r(this.sourceMapConsumerCache[e]);else{var i=new Promise(function(r,o){return this._get(e).then(function(e){"string"==typeof e&&(e=function(e){if("undefined"!=typeof JSON&&JSON.parse)return JSON.parse(e);throw new Error("You must supply a polyfill for JSON.parse in this environment")}(e.replace(/^\)\]\}'/,""))),void 0===e.sourceRoot&&(e.sourceRoot=n),r(new t.SourceMapConsumer(e))},o)}.bind(this));this.sourceMapConsumerCache[e]=i,r(i)}}.bind(this))},this.pinpoint=function(e){return new Promise(function(t,n){this.getMappedLocation(e).then(function(e){function n(){t(e)}this.findFunctionName(e).then(t,n).catch(n)}.bind(this),n)}.bind(this))},this.findFunctionName=function(e){return new Promise(function(t,r){i(e),this._get(e.fileName).then(function(r){var o=e.lineNumber,i=e.columnNumber,a=function(e,t){for(var n=[/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*function\b/,/function\s+([^('"`]*?)\s*\(([^)]*)\)/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*(?:eval|new Function)\b/,/\b(?!(?:if|for|switch|while|with|catch)\b)(?:(?:static)\s+)?(\S+)\s*\(.*?\)\s*\{/,/['"]?([$_A-Za-z][$_A-Za-z0-9]*)['"]?\s*[:=]\s*\(.*?\)\s*=>/],r=e.split("\n"),o="",i=Math.min(t,20),a=0;a=0&&(s=s.substr(0,u)),s){o=s+o;for(var l=n.length,c=0;c=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===t&&s.originalColumn==l;)i.push({line:r.getArg(s,"generatedLine",null),column:r.getArg(s,"generatedColumn",null),lastColumn:r.getArg(s,"lastGeneratedColumn",null)}),s=this._originalMappings[++a]}return i},t.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var t=Object.create(l.prototype),n=t._names=i.fromArray(e._names.toArray(),!0),o=t._sources=i.fromArray(e._sources.toArray(),!0);t.sourceRoot=e._sourceRoot,t.sourcesContent=e._generateSourcesContent(t._sources.toArray(),t.sourceRoot),t.file=e._file;for(var a=e._mappings.toArray().slice(),u=t.__generatedMappings=[],g=t.__originalMappings=[],p=0,f=a.length;p1&&(n.source=m+i[1],m+=i[1],n.originalLine=f+i[2],f=n.originalLine,n.originalLine+=1,n.originalColumn=h+i[3],h=n.originalColumn,i.length>4&&(n.name=d+i[4],d+=i[4])),C.push(n),"number"==typeof n.originalLine&&O.push(n)}s(C,r.compareByGeneratedPositionsDeflated),this.__generatedMappings=C,s(O,r.compareByOriginalPositions),this.__originalMappings=O},l.prototype._findMapping=function(e,t,n,r,i,a){if(e[n]<=0)throw new TypeError("Line must be greater than or equal to 1, got "+e[n]);if(e[r]<0)throw new TypeError("Column must be greater than or equal to 0, got "+e[r]);return o.search(e,t,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[n];if(o.generatedLine===t.generatedLine){var i=r.getArg(o,"source",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=r.join(this.sourceRoot,i)));var a=r.getArg(o,"name",null);return null!==a&&(a=this._names.at(a)),{source:i,line:r.getArg(o,"originalLine",null),column:r.getArg(o,"originalColumn",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e})},l.prototype.sourceContentFor=function(e,t){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=r.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var n;if(null!=this.sourceRoot&&(n=r.urlParse(this.sourceRoot))){var o=e.replace(/^file:\/\//,"");if("file"==n.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!n.path||"/"==n.path)&&this._sources.has("/"+e))return this.sourcesContent[this._sources.indexOf("/"+e)]}if(t)return null;throw new Error('"'+e+'" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var t=r.getArg(e,"source");if(null!=this.sourceRoot&&(t=r.relative(this.sourceRoot,t)),!this._sources.has(t))return{line:null,column:null,lastColumn:null};var n={source:t=this._sources.indexOf(t),originalLine:r.getArg(e,"line"),originalColumn:r.getArg(e,"column")},o=this._findMapping(n,this._originalMappings,"originalLine","originalColumn",r.compareByOriginalPositions,r.getArg(e,"bias",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===n.source)return{line:r.getArg(i,"generatedLine",null),column:r.getArg(i,"generatedColumn",null),lastColumn:r.getArg(i,"lastGeneratedColumn",null)}}return{line:null,column:null,lastColumn:null}},t.BasicSourceMapConsumer=l,g.prototype=Object.create(u.prototype),g.prototype.constructor=u,g.prototype._version=3,Object.defineProperty(g.prototype,"sources",{get:function(){for(var e=[],t=0;t=0;c--)"."===(a=u[c])?u.splice(c,1):".."===a?l++:l>0&&(""===a?(u.splice(c+1,l),l=0):(u.splice(c,2),l--));return""===(n=u.join("/"))&&(n=s?"/":"."),r?(r.path=n,i(r)):n}t.urlParse=o,t.urlGenerate=i,t.normalize=a,t.join=function(e,t){""===e&&(e="."),""===t&&(t=".");var n=o(t),s=o(e);if(s&&(e=s.path||"/"),n&&!n.scheme)return s&&(n.scheme=s.scheme),i(n);if(n||t.match(r))return t;if(s&&!s.host&&!s.path)return s.host=t,i(s);var u="/"===t.charAt(0)?t:a(e.replace(/\/+$/,"")+"/"+t);return s?(s.path=u,i(s)):u},t.isAbsolute=function(e){return"/"===e.charAt(0)||!!e.match(n)},t.relative=function(e,t){""===e&&(e="."),e=e.replace(/\/$/,"");for(var n=0;0!==t.indexOf(e+"/");){var r=e.lastIndexOf("/");if(r<0)return t;if((e=e.slice(0,r)).match(/^([^\/]+:\/)?\/*$/))return t;++n}return Array(n+1).join("../")+t.substr(e.length+1)};var s=!("__proto__"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var t=e.length;if(t<9)return!1;if(95!==e.charCodeAt(t-1)||95!==e.charCodeAt(t-2)||111!==e.charCodeAt(t-3)||116!==e.charCodeAt(t-4)||111!==e.charCodeAt(t-5)||114!==e.charCodeAt(t-6)||112!==e.charCodeAt(t-7)||95!==e.charCodeAt(t-8)||95!==e.charCodeAt(t-9))return!1;for(var n=t-10;n>=0;n--)if(36!==e.charCodeAt(n))return!1;return!0}function c(e,t){return e===t?0:e>t?1:-1}t.toSetString=s?u:function(e){return l(e)?"$"+e:e},t.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},t.compareByOriginalPositions=function(e,t,n){var r=e.source-t.source;return 0!==r?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)||n?r:0!=(r=e.generatedColumn-t.generatedColumn)?r:0!=(r=e.generatedLine-t.generatedLine)?r:e.name-t.name},t.compareByGeneratedPositionsDeflated=function(e,t,n){var r=e.generatedLine-t.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-t.generatedColumn)||n?r:0!=(r=e.source-t.source)?r:0!=(r=e.originalLine-t.originalLine)?r:0!=(r=e.originalColumn-t.originalColumn)?r:e.name-t.name},t.compareByGeneratedPositionsInflated=function(e,t){var n=e.generatedLine-t.generatedLine;return 0!==n?n:0!=(n=e.generatedColumn-t.generatedColumn)?n:0!==(n=c(e.source,t.source))?n:0!=(n=e.originalLine-t.originalLine)?n:0!=(n=e.originalColumn-t.originalColumn)?n:c(e.name,t.name)}},function(e,t){t.GREATEST_LOWER_BOUND=1,t.LEAST_UPPER_BOUND=2,t.search=function(e,n,r,o){if(0===n.length)return-1;var i=function e(n,r,o,i,a,s){var u=Math.floor((r-n)/2)+n,l=a(o,i[u],!0);return 0===l?u:l>0?r-u>1?e(u,r,o,i,a,s):s==t.LEAST_UPPER_BOUND?r1?e(n,u,o,i,a,s):s==t.LEAST_UPPER_BOUND?u:n<0?-1:n}(-1,n.length,e,n,r,o||t.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===r(n[i],n[i-1],!0);)--i;return i}},function(e,t,n){var r=n(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,t){for(var n=new i,r=0,o=e.length;r=0&&e>>=5)>0&&(t|=32),o+=r.encode(t)}while(i>0);return o},t.decode=function(e,t,n){var o,i,a,s,u=e.length,l=0,c=0;do{if(t>=u)throw new Error("Expected more digits in base 64 VLQ value.");if(-1===(i=r.decode(e.charCodeAt(t++))))throw new Error("Invalid base64 digit: "+e.charAt(t-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),n.rest=t}},function(e,t){var n="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/".split("");t.encode=function(e){if(0<=e&&e ".length;e&&r++<5&&!("html"===(t=w(e))||r>1&&o+n.length*i+t.length>=80);)n.push(t),o+=t.length,e=e.parentNode;return n.reverse().join(" > ")}function w(e){var t,n,r,o,i,a=[];if(!e||!e.tagName)return"";if(a.push(e.tagName.toLowerCase()),e.id&&a.push("#"+e.id),(t=e.className)&&O(t))for(n=t.split(/\s+/),i=0;i=0&&"number"==typeof t.breadcrumbsNumber&&(t.breadcrumbsNumber>25?r=25:t.breadcrumbsNumber<=25&&(r=t.breadcrumbsNumber)),o.length>r&&o.shift()},L=function(e){var t;try{t=C(e.target)}catch(e){t=""}w({severity:"Information",action:"Click",message:t})},N=function(e){var t;try{t=C(e.target)}catch(e){t=""}w({severity:"Information",action:"Form submit",message:t})},E=function(t){var n=null;switch(t.type){case"load":n="Page loaded";break;case"DOMContentLoaded":n="DOMContentLoaded";break;case"pageshow":n="Page shown";break;case"pagehide":n="Page hidden";break;case"popstate":n="Navigated from: "+s+" to: "+e.location.href}w({severity:"Information",action:"Navigation",message:n})},A=function(e){var t=e.oldURL,n=e.newURL,r=null;r=t&&n?"from: '"+S(t)+"' to: '"+S(n)+"'":"to: '"+location.hash+"'",w({severity:"Information",action:"Navigation",message:"Hash changed "+r})},M=function(e,t,a,s,l,p){var f=e,h=t,d=s,v=p,b=l,O=1,C=y();if((null===f||null===h)&&2!==g)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(f=c.apiKey,h=c.logId);var w=new XMLHttpRequest;if(w.open("POST","https://api.elmah.io/v3/messages/"+h+"?api_key="+f,!0),w.setRequestHeader("Content-type","application/json"),w.onload=function(e){4===w.readyState&&(201===w.status&&a("success",w.statusText),w.status>=400&&w.status<=499&&(a("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){a("error",w.statusText),r.emit("error",w.status,w.statusText)},"Log"!==d){var S=v&&v instanceof Error?i.parse(v):null;L=_(L={title:b,source:S&&S.length>0?S[0].fileName:null,detail:v?v.stack:null,severity:d,type:v?v.name:null,queryString:JSON.parse(JSON.stringify(C))},u())}else var L=v;if(null!==n.filter&&n.filter(L)&&(O=0),1===O)if(L.title){if(o.length>0){if(L.breadcrumbs&&L.breadcrumbs.length>0){o=o.reverse();for(var N=0;N1)if(String(e).match(/%[sdif]/g)){var r=0;n=String(e).replace(/%[sdif]/g,function(e){switch(e){case"%s":return t[++r]?String(t[r]):"%s";case"%d":return t[++r]?d(t[r])||v(t[r])?parseInt(t[r]):"NaN":"%d";case"%i":return t[++r]?d(t[r])||v(t[r])?parseInt(t[r]):"NaN":"%i";case"%f":return t[++r]?d(t[r])||v(t[r])?parseFloat(t[r]):"NaN":"%f";default:return e}});for(var o=t.length,i=t[++r];r=400&&w.status<=499&&(i("error",w.statusText),r.emit("error",w.status,w.statusText)))},w.onerror=function(e){i("error",w.statusText),r.emit("error",w.status,w.statusText)};var S={title:f,titleTemplate:h,detail:function(e,t,n){for(var r=[],o=0;o0&&(S.breadcrumbs=o,o=[]),null!==n.filter&&n.filter(S)&&(O=0),1===O&&(S.title?(r.emit("message",S),w.send(JSON.stringify(S))):i("missing-title",w.statusText))};return r.error=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Error",e,t)},n.breadcrumbs?100:0)},r.verbose=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Verbose",e,t)},n.breadcrumbs?100:0)},r.debug=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Debug",e,t)},n.breadcrumbs?100:0)},r.information=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Information",e,t)},n.breadcrumbs?100:0)},r.warning=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Warning",e,t)},n.breadcrumbs?100:0)},r.fatal=function(e,t){setTimeout(function(){M(n.apiKey,n.logId,l,"Fatal",e,t)},n.breadcrumbs?100:0)},r.log=function(e){setTimeout(function(){M(n.apiKey,n.logId,l,"Log",null,e)},n.breadcrumbs?100:0)},r.message=function(e){return function(e){if(!e)return u();var t=e,n=t?i.parse(t):null,r={title:t.message,source:n&&n.length>0?n[0].fileName:null,detail:t?t.stack:null,severity:"Error",type:t?t.name:null,errorObject:t};return r=_(r,u())}(e)},r.addBreadcrumb=function(e,t,n){w({severity:null!=t&&O(t)?t:"Information",action:null!=n&&O(n)?n:"Log",message:null!=e&&O(e)?e:"This is just a test message."})},r.on=function(e,t,n){var r=this.e||(this.e={});return(r[e]||(r[e]=[])).push({fn:t,ctx:n}),this},r.emit=function(e){for(var t=[].slice.call(arguments,1),n=((this.e||(this.e={}))[e]||[]).slice(),r=0,o=n.length;r0&&r<400?o="Information":r>399&&r<500?o="Warning":r>=500&&(o="Error"),w({severity:o,action:"Request",message:"["+t+"] "+n+(r>0?" ("+r+")":"")}))}(n,e,t)},!1),s.apply(this,arguments)}}}if(e.onerror=function(e,t,a,s,f){var h={message:e,source:t,lineno:a,colno:s,error:f};return setTimeout(function(){!function(e,t,a,s){var l=e,f=t,h=s,d=1,v=y(),O=h.error&&0!==b(h.error.stack)&&"object"==typeof h.error?i.parse(h.error):"";if(!h||0!==h.colno||0!==h.lineno||O&&""!==O||!h.message||"Script error."!==h.message&&"Script error"!==h.message){if((null===l||null===f)&&2!==g)return console.log("Login api error");c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")&&(l=c.apiKey,f=c.logId);var C=new XMLHttpRequest;C.open("POST","https://api.elmah.io/v3/messages/"+f+"?api_key="+l,!0),C.setRequestHeader("Content-type","application/json"),C.onload=function(e){4===C.readyState&&(201===C.status&&a("success",C.statusText),C.status>=400&&C.status<=499&&(a("error",C.statusText),r.emit("error",C.status,C.statusText)))},C.onerror=function(e){a("error",C.statusText),r.emit("error",C.status,C.statusText)};var w={detail:h.error?h.error.stack:null,title:h.message||"Unspecified error",source:O&&O.length>0?O[0].fileName:null,severity:"Error",type:h.error?h.error.name:null,queryString:JSON.parse(JSON.stringify(v))};if(h.error&&0===b(h.error.stack)&&void 0===w.detail){var S=typeof s.error,L=S.charAt(0).toUpperCase()+S.slice(1);w.detail=function(e){var t=typeof e.error;return t.charAt(0).toUpperCase()+t.slice(1)+": "+e.error+"\n at ("+e.source+":"+e.lineno+":"+e.colno+")"}(s),w.source=s.source,w.title="Uncaught "+L+": "+s.error}w=_(w,u()),o.length>0&&(w.breadcrumbs=o,o=[]),null!==n.filter&&n.filter(w)&&(d=0),1===d&&(r.emit("message",w),h.error&&"object"==typeof h.error&&0!==b(h.error.stack)&&"undefined"!=typeof Promise&&-1!==Promise.toString().indexOf("[native code]")?m(h.error,C,w):C.send(JSON.stringify(w)))}else n.debug&&console.log("%c ⯈ Error log: %c 🛈 Ignoring error from external script ",p.lightCSS,p.warningCSS)}(n.apiKey,n.logId,l,h)},n.breadcrumbs?100:0),!1},t&&"none"!==t.captureConsoleMinimumLevel){if("info"===t.captureConsoleMinimumLevel||"warn"===t.captureConsoleMinimumLevel||"error"===t.captureConsoleMinimumLevel||"debug"===t.captureConsoleMinimumLevel){var d=console.error;if(console.error=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Error",t)},n.breadcrumbs?100:0),d.apply(console,arguments)},"error"!==t.captureConsoleMinimumLevel){var v=console.warn;console.warn=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Warning",t)},n.breadcrumbs?100:0),v.apply(console,arguments)}}}if("info"===t.captureConsoleMinimumLevel||"debug"===t.captureConsoleMinimumLevel){var O=console.info;console.info=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Information",t)},n.breadcrumbs?100:0),O.apply(console,arguments)}}if("debug"===t.captureConsoleMinimumLevel){var C=console.debug;console.debug=function(e){var t={message:e,arguments:arguments};setTimeout(function(){x(n.apiKey,n.logId,l,"Debug",t)},n.breadcrumbs?100:0),C.apply(console,arguments)}}}},r.init(t),n.debug&&console.log("%c"+p.label,p.labelCSS),r};return g&&c.hasOwnProperty("apiKey")&&c.hasOwnProperty("logId")?new L:L}); //# sourceMappingURL=elmahio.min.js.map diff --git a/dist/elmahio.min.js.map b/dist/elmahio.min.js.map index 30e7c84..7f8f34d 100644 --- a/dist/elmahio.min.js.map +++ b/dist/elmahio.min.js.map @@ -1 +1 @@ -{"version":3,"sources":["elmahio.js"],"names":["root","factory","define","amd","exports","module","Elmahio","global","window","this","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","StackFrame","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","p","booleanProps","numericProps","stringProps","props","concat","obj","Object","i","length","hasOwnProperty","undefined","prototype","getArgs","args","setArgs","v","toString","call","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFunctionName","join","getFileName","getLineNumber","getColumnNumber","fromString","argsStartIndex","indexOf","argsEndIndex","lastIndexOf","functionName","split","locationString","parts","exec","fileName","lineNumber","columnNumber","Boolean","j","Number","k","String","ErrorStackParser","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","replace","filter","line","map","tokens","slice","locationParts","pop","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","functionCall","shift","StackTraceGPS","SourceMap","_xdr","url","Promise","resolve","reject","req","XMLHttpRequest","open","onerror","onreadystatechange","readyState","status","substr","responseText","send","_atob","b64str","atob","_ensureStackFrameIsLegit","stackframe","opts","sourceCache","sourceMapConsumerCache","ajax","_get","location","isDataUrl","offline","sourceMapStart","encodedSource","xhrPromise","method","then","bind","_getSourceMapConsumer","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","string","JSON","_parseJson","sourceRoot","SourceMapConsumer","pinpoint","getMappedLocation","mappedStackFrame","resolveMappedStackFrame","findFunctionName","guessedFunctionName","syntaxes","code","maxLines","Math","min","commentPos","index","m","_findFunctionName","defineProperty","create","_ensureSupportedEnvironment","lastSourceMappingUrl","matchSourceMappingUrl","sourceMappingUrlRegExp","_findSourceMappingURL","test","sourceMapConsumer","loc","originalPositionFor","column","mappedSource","sourceContentFor","name","_extractLocationInfoFromSourceMapSource","r","t","o","id","loaded","c","ArraySet","a","s","quickSort","u","sections","l","getArg","g","_version","normalize","isAbsolute","relative","_names","fromArray","_sources","sourcesContent","_mappings","file","generatedLine","generatedColumn","originalLine","originalColumn","_sections","generatedOffset","consumer","fromSourceMap","__generatedMappings","get","_parseMappings","__originalMappings","_charIsMappingSeparator","GENERATED_ORDER","ORIGINAL_ORDER","GREATEST_LOWER_BOUND","LEAST_UPPER_BOUND","eachMapping","_generatedMappings","_originalMappings","at","forEach","allGeneratedPositionsFor","has","_findMapping","compareByOriginalPositions","lastColumn","toArray","_sourceRoot","_generateSourcesContent","_file","h","f","d","_","C","A","y","L","decode","value","rest","compareByGeneratedPositionsDeflated","search","computeColumnSpans","lastGeneratedColumn","hasContentsOfAllSources","size","some","urlParse","scheme","path","generatedPositionFor","BasicSourceMapConsumer","constructor","sources","bias","every","add","IndexedSourceMapConsumer","arguments","auth","host","port","splice","urlGenerate","Array","charCodeAt","toSetString","fromSetString","compareByGeneratedPositionsInflated","floor","_array","_set","getOwnPropertyNames","encode","round","random","myScript","scriptFile","document","getElementsByTagName","isMe","params","query","Params","Pairs","KeyVal","key","unescape","val","parseQuery","src","paramsLength","objectLength","debugSettings","label","labelCSS","successCSS","errorCSS","warningCSS","lightCSS","defaults","apiKey","logId","debug","application","captureConsoleMinimumLevel","breadcrumbs","breadcrumbsNumber","extend","extended","deep","merge","prop","scriptElem","getAttribute","isInt","isFloat","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","toLowerCase","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","type","width","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","stackGPS","xhr","jsonData","errorStack","gps","stackframes","all","sf","resolveOriginal","newFrames","stackFrame","fn","stackString","unshift","detail","stringify","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendManualPayload","callback","logType","messageLog","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","errorObject","sendPayloadFromConsole","messageTemplate","values","x","parseInt","format","titleTemplate","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","apply","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","lineno","colno","typeOF","typeOFCapitalized","sendPayload","_error","errMessage","_warning","warn","warnMessage","_info","info","infoMessage","_debug","debugMessage"],"mappings":";;;;CAIA,SAAUA,EAAMC,GACQ,mBAAXC,QAAyBA,OAAOC,IACzCD,OAAO,GAAI,WACT,OAAOD,EAAQD,KAEW,iBAAZI,QAChBC,OAAOD,QAAUH,EAAQD,GAEzBA,EAAKM,QAAUL,EAAQD,GAR3B,CAUqB,oBAAXO,OAAyBA,OAA2B,oBAAXC,OAAyBA,OAASC,KAAM,SAASD,GAClG,aAi+BA,IAh+BA,IAiHME,EACAC,EACAC,EAnHFC,EAAa,WAGf,SAASC,EAAUC,GACjB,OAAQC,MAAMC,WAAWF,KAAOG,SAASH,GAG3C,SAASI,EAAYC,GACnB,OAAOA,EAAIC,OAAO,GAAGC,cAAgBF,EAAIG,UAAU,GAGrD,SAASC,EAAQC,GACf,OAAO,WACL,OAAOhB,KAAKgB,IAGhB,IAAIC,EAAe,CAAC,gBAAiB,SAAU,WAAY,cACvDC,EAAe,CAAC,eAAgB,cAChCC,EAAc,CAAC,WAAY,eAAgB,UAE3CC,EAAQH,EAAaI,OAAOH,EAAcC,EAD7B,CAAC,SAGlB,SAASf,EAAWkB,GAClB,GAAIA,aAA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Q1C,2BAAwC,CAClD,IAAImK,EAAWxF,QAAQyF,KACvBzF,QAAQyF,KAAO,SAASC,GACtB,IAAIlD,EAAW,CACbhV,QAAWkY,EACXpN,UAAaA,WAEfsL,WAAW,WACTT,EAAuBnF,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,UAAW0C,IACnFxE,EAAS1C,YAxyBD,IAwyBkC,GAC7CkK,EAASlB,MAAMtE,QAAS1H,aAI9B,GAA2C,SAAvCyF,EAAQ1C,4BAAgF,UAAvC0C,EAAQ1C,2BAAwC,CACnG,IAAIsK,EAAQ3F,QAAQ4F,KACpB5F,QAAQ4F,KAAO,SAASC,GACtB,IAAIrD,EAAW,CACbhV,QAAWqY,EACXvN,UAAaA,WAEfsL,WAAW,WACTT,EAAuBnF,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,cAAe0C,IACvFxE,EAAS1C,YAtzBC,IAszBgC,GAC7CqK,EAAMrB,MAAMtE,QAAS1H,YAGzB,GAA2C,UAAvCyF,EAAQ1C,2BAAwC,CAClD,IAAIyK,EAAS9F,QAAQ7E,MACrB6E,QAAQ7E,MAAQ,SAAS4K,GACvB,IAAIvD,EAAW,CACbhV,QAAWuY,EACXzN,UAAaA,WAEfsL,WAAW,WACTT,EAAuBnF,EAAS/C,OAAQ+C,EAAS9C,MAAO4E,EAAiB,QAAS0C,IACjFxE,EAAS1C,YAn0BC,IAm0BgC,GAC7CwK,EAAOxB,MAAMtE,QAAS1H,eAK9B2F,EAAWsG,KAAKxG,GACZC,EAAS7C,OACX6E,QAAQC,IAAI,KAAOxF,EAAcC,MAAOD,EAAcE,UAEjDsD,GAET,OAAI1D,GAAgBV,EAAOjQ,eAAe,WAAaiQ,EAAOjQ,eAAe,SACpE,IAAIkU,EAEJA","sourcesContent":["/*!\n * elmah.io Javascript Logger - version 3.7.1\n * (c) 2018 elmah.io, Apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n \"use strict\";\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error(\"Cannot parse given Error object\");\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(\":\") === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf(\"(eval \") > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\n }\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(\" \") || undefined;\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(\" > eval\") > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\n }\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split(\"\\n\");\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split(\"\\n\");\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split(\"@\");\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || \"\";\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\n }\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function stackGPS(error, xhr, jsonData) {\n \tvar errorStack = error.toString().split(\"\\n\")[0];\n \tvar gps = new StackTraceGPS();\n var promise = new Promise(function(resolve) {\n\t var stackframes = ErrorStackParser.parse(error);\n\t resolve(Promise.all(stackframes.map(function(sf) {\n\t return new Promise(function(resolve) {\n\t function resolveOriginal() {\n\t resolve(sf);\n\t }\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n\t });\n\t })));\t\n });\n\n promise.then(function(newFrames){\n \tnewFrames.forEach(function(stackFrame, i){\n\t\t\t\t\tif(stackFrame.functionName) {\n \t\t\tvar fn = stackFrame.functionName + ' ';\n \t\t} else {\n \t\t\tvar fn = '';\n \t\t}\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n \t\tnewFrames[i] = stackString;\n \t});\n \tnewFrames.unshift(errorStack);\n \tjsonData.detail = newFrames.join(\"\\n\");\n \txhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n \t// send message trying to pinpoint stackframes\n \tstackGPS(error.error, xhr, jsonData);\n\t } else {\n\t \t// send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n } else {\n // send message\n if(jsonData.errorObject) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n stackGPS(error, xhr, jsonData);\n } else {\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n }\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.min.js"} \ No newline at end of file +{"version":3,"sources":["elmahio.js"],"names":["root","factory","define","amd","exports","module","Elmahio","global","window","this","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","StackFrame","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","charAt","toUpperCase","substring","_getter","p","booleanProps","numericProps","stringProps","props","concat","obj","Object","i","length","hasOwnProperty","undefined","prototype","getArgs","args","setArgs","v","toString","call","TypeError","getEvalOrigin","evalOrigin","setEvalOrigin","getFunctionName","join","getFileName","getLineNumber","getColumnNumber","fromString","argsStartIndex","indexOf","argsEndIndex","lastIndexOf","functionName","split","locationString","parts","exec","fileName","lineNumber","columnNumber","Boolean","j","Number","k","String","ErrorStackParser","parse","error","stacktrace","parseOpera","stack","match","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","replace","filter","line","map","tokens","slice","locationParts","pop","source","functionNameRegex","matches","e","message","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","result","len","push","argsRaw","functionCall","shift","StackTraceGPS","SourceMap","_xdr","url","Promise","resolve","reject","req","XMLHttpRequest","open","onerror","onreadystatechange","readyState","status","substr","responseText","send","_atob","b64str","atob","_ensureStackFrameIsLegit","stackframe","opts","sourceCache","sourceMapConsumerCache","ajax","_get","location","isDataUrl","offline","sourceMapStart","encodedSource","xhrPromise","method","then","bind","_getSourceMapConsumer","sourceMappingURL","defaultSourceRoot","sourceMapConsumerPromise","sourceMapSource","string","JSON","_parseJson","sourceRoot","SourceMapConsumer","pinpoint","getMappedLocation","mappedStackFrame","resolveMappedStackFrame","findFunctionName","guessedFunctionName","syntaxes","code","maxLines","Math","min","commentPos","index","m","_findFunctionName","defineProperty","create","_ensureSupportedEnvironment","lastSourceMappingUrl","matchSourceMappingUrl","sourceMappingUrlRegExp","_findSourceMappingURL","test","sourceMapConsumer","loc","originalPositionFor","column","mappedSource","sourceContentFor","name","_extractLocationInfoFromSourceMapSource","r","t","o","id","loaded","c","ArraySet","a","s","quickSort","u","sections","l","getArg","g","_version","normalize","isAbsolute","relative","_names","fromArray","_sources","sourcesContent","_mappings","file","generatedLine","generatedColumn","originalLine","originalColumn","_sections","generatedOffset","consumer","fromSourceMap","__generatedMappings","get","_parseMappings","__originalMappings","_charIsMappingSeparator","GENERATED_ORDER","ORIGINAL_ORDER","GREATEST_LOWER_BOUND","LEAST_UPPER_BOUND","eachMapping","_generatedMappings","_originalMappings","at","forEach","allGeneratedPositionsFor","has","_findMapping","compareByOriginalPositions","lastColumn","toArray","_sourceRoot","_generateSourcesContent","_file","h","f","d","_","C","A","y","L","decode","value","rest","compareByGeneratedPositionsDeflated","search","computeColumnSpans","lastGeneratedColumn","hasContentsOfAllSources","size","some","urlParse","scheme","path","generatedPositionFor","BasicSourceMapConsumer","constructor","sources","bias","every","add","IndexedSourceMapConsumer","arguments","auth","host","port","splice","urlGenerate","Array","charCodeAt","toSetString","fromSetString","compareByGeneratedPositionsInflated","floor","_array","_set","getOwnPropertyNames","encode","round","random","myScript","scriptFile","document","getElementsByTagName","isMe","params","query","Params","Pairs","KeyVal","key","unescape","val","parseQuery","src","paramsLength","objectLength","debugSettings","label","labelCSS","successCSS","errorCSS","warningCSS","lightCSS","defaults","apiKey","logId","debug","application","captureConsoleMinimumLevel","breadcrumbs","breadcrumbsNumber","extend","extended","deep","merge","prop","scriptElem","getAttribute","isInt","isFloat","getSearchParameters","prmstr","prmarr","tmparr","transformToAssocArray","merge_objects","obj1","obj2","obj3","attrname1","attrname2","isString","what","cssSelectorString","elem","nextStr","out","height","sepLength","htmlElementAsString","parentNode","reverse","className","classes","attr","tagName","toLowerCase","attrWhitelist","parseHash","Constructor","options","settings","publicAPIs","lastHref","href","getPayload","payload","pathname","payload_data","documentMode","innerWidth","documentElement","clientWidth","innerHeight","clientHeight","screen","msOrientation","orientation","mozOrientation","type","width","colorDepth","data","payload_serverVariables","navigator","language","userAgent","referrer","protocol","hostname","serverVariables","confirmResponse","response","console","log","Date","toLocaleString","stackGPS","xhr","jsonData","errorStack","gps","stackframes","all","sf","resolveOriginal","newFrames","stackFrame","fn","stackString","unshift","detail","stringify","recordBreadcrumb","crumb","dateTime","toISOString","breadcrumbs_number","breadcrumbClickEventHandler","evt","target","severity","action","breadcrumbFormSubmitEventHandler","breadcrumbWindowEventHandler","breadcrumbHashChangeEventHandler","oldURL","newURL","hash","sendManualPayload","callback","logType","messageLog","errorLog","api_key","log_id","queryParams","setRequestHeader","onload","statusText","emit","title","queryString","errorObject","sendPayloadFromConsole","messageTemplate","values","x","parseInt","format","titleTemplate","manipulateStack","msg","setTimeout","verbose","information","warning","fatal","sendPrefilledLogMessage","addBreadcrumb","on","ctx","evtArr","apply","init","addEventListener","attachEvent","history","pushState","replaceState","old_onpopstate","onpopstate","event","breadcrumbXHRHandler","lineno","colno","typeOF","typeOFCapitalized","sendPayload","_error","errMessage","_warning","warn","warnMessage","_info","info","infoMessage","_debug","debugMessage"],"mappings":";;;;CAIA,SAAUA,EAAMC,GACQ,mBAAXC,QAAyBA,OAAOC,IACzCD,OAAO,GAAI,WACT,OAAOD,EAAQD,KAEW,iBAAZI,QAChBC,OAAOD,QAAUH,EAAQD,GAEzBA,EAAKM,QAAUL,EAAQD,GAR3B,CAUqB,oBAAXO,OAAyBA,OAA2B,oBAAXC,OAAyBA,OAASC,KAAM,SAASD,GAClG,aAi+BA,IAh+BA,IAiHME,EACAC,EACAC,EAnHFC,EAAa,WAGf,SAASC,EAAUC,GACjB,OAAQC,MAAMC,WAAWF,KAAOG,SAASH,GAG3C,SAASI,EAAYC,GACnB,OAAOA,EAAIC,OAAO,GAAGC,cAAgBF,EAAIG,UAAU,GAGrD,SAASC,EAAQC,GACf,OAAO,WACL,OAAOhB,KAAKgB,IAGhB,IAAIC,EAAe,CAAC,gBAAiB,SAAU,WAAY,cACvDC,EAAe,CAAC,eAAgB,cAChCC,EAAc,CAAC,WAAY,eAAgB,UAE3CC,EAAQH,EAAaI,OAAOH,EAAcC,EAD7B,CAAC,SAGlB,SAASf,EAAWkB,GAClB,GAAIA,aAAeC,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apache 2.0 License, https://elmah.io\n */\n\n(function (root, factory) {\n if (typeof define === 'function' && define.amd) {\n define([], function () {\n return factory(root);\n });\n } else if (typeof exports === 'object') {\n module.exports = factory(root);\n } else {\n root.Elmahio = factory(root);\n }\n})(typeof global !== 'undefined' ? global : typeof window !== 'undefined' ? window : this, function (window) {\n\n 'use strict';\n\n //\n // ==== STACKFRAME ====\n //\n\n var StackFrame = (function () {\n \"use strict\";\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n function _getter(p) {\n return function () {\n return this[p];\n };\n }\n var booleanProps = [\"isConstructor\", \"isEval\", \"isNative\", \"isToplevel\"];\n var numericProps = [\"columnNumber\", \"lineNumber\"];\n var stringProps = [\"fileName\", \"functionName\", \"source\"];\n var arrayProps = [\"args\"];\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n function StackFrame(obj) {\n if (obj instanceof Object) {\n for (var i = 0; i < props.length; i++) {\n if (obj.hasOwnProperty(props[i]) && obj[props[i]] !== undefined) {\n this[\"set\" + _capitalize(props[i])](obj[props[i]]);\n }\n }\n }\n }\n StackFrame.prototype = {\n getArgs: function () {\n return this.args;\n },\n setArgs: function (v) {\n if (Object.prototype.toString.call(v) !== \"[object Array]\") {\n throw new TypeError(\"Args must be an Array\");\n }\n this.args = v;\n },\n getEvalOrigin: function () {\n return this.evalOrigin;\n },\n setEvalOrigin: function (v) {\n if (v instanceof StackFrame) {\n this.evalOrigin = v;\n } else if (v instanceof Object) {\n this.evalOrigin = new StackFrame(v);\n } else {\n throw new TypeError(\"Eval Origin must be an Object or StackFrame\");\n }\n },\n toString: function () {\n var functionName = this.getFunctionName() || \"{anonymous}\";\n var args = \"(\" + (this.getArgs() || []).join(\",\") + \")\";\n var fileName = this.getFileName() ? \"@\" + this.getFileName() : \"\";\n var lineNumber = _isNumber(this.getLineNumber()) ? \":\" + this.getLineNumber() : \"\";\n var columnNumber = _isNumber(this.getColumnNumber()) ? \":\" + this.getColumnNumber() : \"\";\n return functionName + args + fileName + lineNumber + columnNumber;\n }\n };\n StackFrame.fromString = function StackFrame$$fromString(str) {\n var argsStartIndex = str.indexOf(\"(\");\n var argsEndIndex = str.lastIndexOf(\")\");\n var functionName = str.substring(0, argsStartIndex);\n var args = str.substring(argsStartIndex + 1, argsEndIndex).split(\",\");\n var locationString = str.substring(argsEndIndex + 1);\n if (locationString.indexOf(\"@\") === 0) {\n var parts = /@(.+?)(?::(\\d+))?(?::(\\d+))?$/.exec(locationString, \"\");\n var fileName = parts[1];\n var lineNumber = parts[2];\n var columnNumber = parts[3];\n }\n return new StackFrame({\n functionName: functionName,\n args: args || undefined,\n fileName: fileName,\n lineNumber: lineNumber || undefined,\n columnNumber: columnNumber || undefined\n });\n };\n for (var i = 0; i < booleanProps.length; i++) {\n StackFrame.prototype[\"get\" + _capitalize(booleanProps[i])] = _getter(booleanProps[i]);\n StackFrame.prototype[\"set\" + _capitalize(booleanProps[i])] = function (p) {\n return function (v) {\n this[p] = Boolean(v);\n };\n }(booleanProps[i]);\n }\n for (var j = 0; j < numericProps.length; j++) {\n StackFrame.prototype[\"get\" + _capitalize(numericProps[j])] = _getter(numericProps[j]);\n StackFrame.prototype[\"set\" + _capitalize(numericProps[j])] = function (p) {\n return function (v) {\n if (!_isNumber(v)) {\n throw new TypeError(p + \" must be a Number\");\n }\n this[p] = Number(v);\n };\n }(numericProps[j]);\n }\n for (var k = 0; k < stringProps.length; k++) {\n StackFrame.prototype[\"get\" + _capitalize(stringProps[k])] = _getter(stringProps[k]);\n StackFrame.prototype[\"set\" + _capitalize(stringProps[k])] = function (p) {\n return function (v) {\n this[p] = String(v);\n };\n }(stringProps[k]);\n }\n return StackFrame;\n })();\n\n //\n // ==== ERROR STACK PARSER ====\n //\n\n var ErrorStackParser = (function () {\n \"use strict\";\n var FIREFOX_SAFARI_STACK_REGEXP = /(^|@)\\S+\\:\\d+/;\n var CHROME_IE_STACK_REGEXP = /^\\s*at .*(\\S+\\:\\d+|\\(native\\))/m;\n var SAFARI_NATIVE_CODE_REGEXP = /^(eval@)?(\\[native code\\])?$/;\n return {\n /**\n * Given an Error object, extract the most information from it.\n *\n * @param {Error} error object\n * @return {Array} of StackFrames\n */\n parse: function ErrorStackParser$$parse(error) {\n if (typeof error.stacktrace !== \"undefined\" || typeof error[\"opera#sourceloc\"] !== \"undefined\") {\n return this.parseOpera(error);\n } else if (error.stack && error.stack.match(CHROME_IE_STACK_REGEXP)) {\n return this.parseV8OrIE(error);\n } else if (error.stack) {\n return this.parseFFOrSafari(error);\n } else {\n throw new Error(\"Cannot parse given Error object\");\n }\n },\n // Separate line and column numbers from a string of the form: (URI:Line:Column)\n extractLocation: function ErrorStackParser$$extractLocation(urlLike) {\n // Fail-fast but return locations like \"(native)\"\n if (urlLike.indexOf(\":\") === -1) {\n return [urlLike];\n }\n var regExp = /(.+?)(?:\\:(\\d+))?(?:\\:(\\d+))?$/;\n var parts = regExp.exec(urlLike.replace(/[\\(\\)]/g, \"\"));\n return [parts[1], parts[2] || undefined, parts[3] || undefined];\n },\n parseV8OrIE: function ErrorStackParser$$parseV8OrIE(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(CHROME_IE_STACK_REGEXP);\n }, this);\n return filtered.map(function (line) {\n if (line.indexOf(\"(eval \") > -1) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n line = line.replace(/eval code/g, \"eval\").replace(/(\\(eval at [^\\()]*)|(\\)\\,.*$)/g, \"\");\n }\n var tokens = line.replace(/^\\s+/, \"\").replace(/\\(eval code/g, \"(\").split(/\\s+/).slice(1);\n var locationParts = this.extractLocation(tokens.pop());\n var functionName = tokens.join(\" \") || undefined;\n var fileName = [\"eval\", \"\"].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n return new StackFrame({\n functionName: functionName,\n fileName: fileName,\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n },\n parseFFOrSafari: function ErrorStackParser$$parseFFOrSafari(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !line.match(SAFARI_NATIVE_CODE_REGEXP);\n }, this);\n return filtered.map(function (line) {\n // Throw away eval information until we implement stacktrace.js/stackframe#8\n if (line.indexOf(\" > eval\") > -1) {\n line = line.replace(/ line (\\d+)(?: > eval line \\d+)* > eval\\:\\d+\\:\\d+/g, \":$1\");\n }\n if (line.indexOf(\"@\") === -1 && line.indexOf(\":\") === -1) {\n // Safari eval frames only have function names and nothing else\n return new StackFrame({\n functionName: line\n });\n } else {\n var functionNameRegex = /((.*\".+\"[^@]*)?[^@]*)(?:@)/;\n var matches = line.match(functionNameRegex);\n var functionName = matches && matches[1] ? matches[1] : undefined;\n var locationParts = this.extractLocation(line.replace(functionNameRegex, \"\"));\n return new StackFrame({\n functionName: functionName,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }\n }, this);\n },\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || e.message.indexOf(\"\\n\") > -1 && e.message.split(\"\\n\").length > e.stacktrace.split(\"\\n\").length) {\n return this.parseOpera9(e);\n } else if (!e.stack) {\n return this.parseOpera10(e);\n } else {\n return this.parseOpera11(e);\n }\n },\n parseOpera9: function ErrorStackParser$$parseOpera9(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)/i;\n var lines = e.message.split(\"\\n\");\n var result = [];\n for (var i = 2, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n parseOpera10: function ErrorStackParser$$parseOpera10(e) {\n var lineRE = /Line (\\d+).*script (?:in )?(\\S+)(?:: In function (\\S+))?$/i;\n var lines = e.stacktrace.split(\"\\n\");\n var result = [];\n for (var i = 0, len = lines.length; i < len; i += 2) {\n var match = lineRE.exec(lines[i]);\n if (match) {\n result.push(new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n }));\n }\n }\n return result;\n },\n // Opera 10.65+ Error.stack very similar to FF/Safari\n parseOpera11: function ErrorStackParser$$parseOpera11(error) {\n var filtered = error.stack.split(\"\\n\").filter(function (line) {\n return !!line.match(FIREFOX_SAFARI_STACK_REGEXP) && !line.match(/^Error created at/);\n }, this);\n return filtered.map(function (line) {\n var tokens = line.split(\"@\");\n var locationParts = this.extractLocation(tokens.pop());\n var functionCall = tokens.shift() || \"\";\n var functionName = functionCall.replace(//, \"$2\").replace(/\\([^\\)]*\\)/g, \"\") || undefined;\n var argsRaw;\n if (functionCall.match(/\\(([^\\)]*)\\)/)) {\n argsRaw = functionCall.replace(/^[^\\(]+\\(([^\\)]*)\\)$/, \"$1\");\n }\n var args = argsRaw === undefined || argsRaw === \"[arguments not available]\" ? undefined : argsRaw.split(\",\");\n return new StackFrame({\n functionName: functionName,\n args: args,\n fileName: locationParts[0],\n lineNumber: locationParts[1],\n columnNumber: locationParts[2],\n source: line\n });\n }, this);\n }\n };\n })();\n\n //\n // ==== STACKTRACE-GPS ====\n //\n\n var SourceMap = function(e){var n={};function r(t){if(n[t])return n[t].exports;var o=n[t]={exports:{},id:t,loaded:!1};return e[t].call(o.exports,o,o.exports,r),o.loaded=!0,o.exports}return r.m=e,r.c=n,r.p=\"\",r(0)}([function(e,n,r){var t=r(1),o=r(2),i=r(3).ArraySet,a=r(4),s=r(6).quickSort;function u(e){var n=e;return\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\"))),null!=n.sections?new c(n):new l(n)}function l(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sources\"),a=t.getArg(n,\"names\",[]),s=t.getArg(n,\"sourceRoot\",null),u=t.getArg(n,\"sourcesContent\",null),l=t.getArg(n,\"mappings\"),g=t.getArg(n,\"file\",null);if(r!=this._version)throw new Error(\"Unsupported version: \"+r);o=o.map(String).map(t.normalize).map(function(e){return s&&t.isAbsolute(s)&&t.isAbsolute(e)?t.relative(s,e):e}),this._names=i.fromArray(a.map(String),!0),this._sources=i.fromArray(o,!0),this.sourceRoot=s,this.sourcesContent=u,this._mappings=l,this.file=g}function g(){this.generatedLine=0,this.generatedColumn=0,this.source=null,this.originalLine=null,this.originalColumn=null,this.name=null}function c(e){var n=e;\"string\"==typeof e&&(n=JSON.parse(e.replace(/^\\)\\]\\}'/,\"\")));var r=t.getArg(n,\"version\"),o=t.getArg(n,\"sections\");if(r!=this._version)throw new Error(\"Unsupported version: \"+r);this._sources=new i,this._names=new i;var a={line:-1,column:0};this._sections=o.map(function(e){if(e.url)throw new Error(\"Support for url field in sections not implemented.\");var n=t.getArg(e,\"offset\"),r=t.getArg(n,\"line\"),o=t.getArg(n,\"column\");if(r=0){var s=this._originalMappings[a];if(void 0===e.column)for(var u=s.originalLine;s&&s.originalLine===u;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a];else for(var l=s.originalColumn;s&&s.originalLine===n&&s.originalColumn==l;)i.push({line:t.getArg(s,\"generatedLine\",null),column:t.getArg(s,\"generatedColumn\",null),lastColumn:t.getArg(s,\"lastGeneratedColumn\",null)}),s=this._originalMappings[++a]}return i},n.SourceMapConsumer=u,l.prototype=Object.create(u.prototype),l.prototype.consumer=u,l.fromSourceMap=function(e){var n=Object.create(l.prototype),r=n._names=i.fromArray(e._names.toArray(),!0),o=n._sources=i.fromArray(e._sources.toArray(),!0);n.sourceRoot=e._sourceRoot,n.sourcesContent=e._generateSourcesContent(n._sources.toArray(),n.sourceRoot),n.file=e._file;for(var a=e._mappings.toArray().slice(),u=n.__generatedMappings=[],c=n.__originalMappings=[],p=0,h=a.length;p1&&(r.source=d+i[1],d+=i[1],r.originalLine=h+i[2],h=r.originalLine,r.originalLine+=1,r.originalColumn=f+i[3],f=r.originalColumn,i.length>4&&(r.name=m+i[4],m+=i[4])),L.push(r),\"number\"==typeof r.originalLine&&y.push(r)}s(L,t.compareByGeneratedPositionsDeflated),this.__generatedMappings=L,s(y,t.compareByOriginalPositions),this.__originalMappings=y},l.prototype._findMapping=function(e,n,r,t,i,a){if(e[r]<=0)throw new TypeError(\"Line must be greater than or equal to 1, got \"+e[r]);if(e[t]<0)throw new TypeError(\"Column must be greater than or equal to 0, got \"+e[t]);return o.search(e,n,i,a)},l.prototype.computeColumnSpans=function(){for(var e=0;e=0){var o=this._generatedMappings[r];if(o.generatedLine===n.generatedLine){var i=t.getArg(o,\"source\",null);null!==i&&(i=this._sources.at(i),null!=this.sourceRoot&&(i=t.join(this.sourceRoot,i)));var a=t.getArg(o,\"name\",null);return null!==a&&(a=this._names.at(a)),{source:i,line:t.getArg(o,\"originalLine\",null),column:t.getArg(o,\"originalColumn\",null),name:a}}}return{source:null,line:null,column:null,name:null}},l.prototype.hasContentsOfAllSources=function(){return!!this.sourcesContent&&(this.sourcesContent.length>=this._sources.size()&&!this.sourcesContent.some(function(e){return null==e}))},l.prototype.sourceContentFor=function(e,n){if(!this.sourcesContent)return null;if(null!=this.sourceRoot&&(e=t.relative(this.sourceRoot,e)),this._sources.has(e))return this.sourcesContent[this._sources.indexOf(e)];var r;if(null!=this.sourceRoot&&(r=t.urlParse(this.sourceRoot))){var o=e.replace(/^file:\\/\\//,\"\");if(\"file\"==r.scheme&&this._sources.has(o))return this.sourcesContent[this._sources.indexOf(o)];if((!r.path||\"/\"==r.path)&&this._sources.has(\"/\"+e))return this.sourcesContent[this._sources.indexOf(\"/\"+e)]}if(n)return null;throw new Error('\"'+e+'\" is not in the SourceMap.')},l.prototype.generatedPositionFor=function(e){var n=t.getArg(e,\"source\");if(null!=this.sourceRoot&&(n=t.relative(this.sourceRoot,n)),!this._sources.has(n))return{line:null,column:null,lastColumn:null};var r={source:n=this._sources.indexOf(n),originalLine:t.getArg(e,\"line\"),originalColumn:t.getArg(e,\"column\")},o=this._findMapping(r,this._originalMappings,\"originalLine\",\"originalColumn\",t.compareByOriginalPositions,t.getArg(e,\"bias\",u.GREATEST_LOWER_BOUND));if(o>=0){var i=this._originalMappings[o];if(i.source===r.source)return{line:t.getArg(i,\"generatedLine\",null),column:t.getArg(i,\"generatedColumn\",null),lastColumn:t.getArg(i,\"lastGeneratedColumn\",null)}}return{line:null,column:null,lastColumn:null}},n.BasicSourceMapConsumer=l,c.prototype=Object.create(u.prototype),c.prototype.constructor=u,c.prototype._version=3,Object.defineProperty(c.prototype,\"sources\",{get:function(){for(var e=[],n=0;n=0;g--)\".\"===(a=u[g])?u.splice(g,1):\"..\"===a?l++:l>0&&(\"\"===a?(u.splice(g+1,l),l=0):(u.splice(g,2),l--));return\"\"===(r=u.join(\"/\"))&&(r=s?\"/\":\".\"),t?(t.path=r,i(t)):r}n.urlParse=o,n.urlGenerate=i,n.normalize=a,n.join=function(e,n){\"\"===e&&(e=\".\"),\"\"===n&&(n=\".\");var r=o(n),s=o(e);if(s&&(e=s.path||\"/\"),r&&!r.scheme)return s&&(r.scheme=s.scheme),i(r);if(r||n.match(t))return n;if(s&&!s.host&&!s.path)return s.host=n,i(s);var u=\"/\"===n.charAt(0)?n:a(e.replace(/\\/+$/,\"\")+\"/\"+n);return s?(s.path=u,i(s)):u},n.isAbsolute=function(e){return\"/\"===e.charAt(0)||!!e.match(r)},n.relative=function(e,n){\"\"===e&&(e=\".\"),e=e.replace(/\\/$/,\"\");for(var r=0;0!==n.indexOf(e+\"/\");){var t=e.lastIndexOf(\"/\");if(t<0)return n;if((e=e.slice(0,t)).match(/^([^\\/]+:\\/)?\\/*$/))return n;++r}return Array(r+1).join(\"../\")+n.substr(e.length+1)};var s=!(\"__proto__\"in Object.create(null));function u(e){return e}function l(e){if(!e)return!1;var n=e.length;if(n<9)return!1;if(95!==e.charCodeAt(n-1)||95!==e.charCodeAt(n-2)||111!==e.charCodeAt(n-3)||116!==e.charCodeAt(n-4)||111!==e.charCodeAt(n-5)||114!==e.charCodeAt(n-6)||112!==e.charCodeAt(n-7)||95!==e.charCodeAt(n-8)||95!==e.charCodeAt(n-9))return!1;for(var r=n-10;r>=0;r--)if(36!==e.charCodeAt(r))return!1;return!0}function g(e,n){return e===n?0:e>n?1:-1}n.toSetString=s?u:function(e){return l(e)?\"$\"+e:e},n.fromSetString=s?u:function(e){return l(e)?e.slice(1):e},n.compareByOriginalPositions=function(e,n,r){var t=e.source-n.source;return 0!==t?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)||r?t:0!=(t=e.generatedColumn-n.generatedColumn)?t:0!=(t=e.generatedLine-n.generatedLine)?t:e.name-n.name},n.compareByGeneratedPositionsDeflated=function(e,n,r){var t=e.generatedLine-n.generatedLine;return 0!==t?t:0!=(t=e.generatedColumn-n.generatedColumn)||r?t:0!=(t=e.source-n.source)?t:0!=(t=e.originalLine-n.originalLine)?t:0!=(t=e.originalColumn-n.originalColumn)?t:e.name-n.name},n.compareByGeneratedPositionsInflated=function(e,n){var r=e.generatedLine-n.generatedLine;return 0!==r?r:0!=(r=e.generatedColumn-n.generatedColumn)?r:0!==(r=g(e.source,n.source))?r:0!=(r=e.originalLine-n.originalLine)?r:0!=(r=e.originalColumn-n.originalColumn)?r:g(e.name,n.name)}},function(e,n){n.GREATEST_LOWER_BOUND=1,n.LEAST_UPPER_BOUND=2,n.search=function(e,r,t,o){if(0===r.length)return-1;var i=function e(r,t,o,i,a,s){var u=Math.floor((t-r)/2)+r,l=a(o,i[u],!0);return 0===l?u:l>0?t-u>1?e(u,t,o,i,a,s):s==n.LEAST_UPPER_BOUND?t1?e(r,u,o,i,a,s):s==n.LEAST_UPPER_BOUND?u:r<0?-1:r}(-1,r.length,e,r,t,o||n.GREATEST_LOWER_BOUND);if(i<0)return-1;for(;i-1>=0&&0===t(r[i],r[i-1],!0);)--i;return i}},function(e,n,r){var t=r(1),o=Object.prototype.hasOwnProperty;function i(){this._array=[],this._set=Object.create(null)}i.fromArray=function(e,n){for(var r=new i,t=0,o=e.length;t=0&&e>>=5)>0&&(n|=32),o+=t.encode(n)}while(i>0);return o},n.decode=function(e,n,r){var o,i,a,s,u=e.length,l=0,g=0;do{if(n>=u)throw new Error(\"Expected more digits in base 64 VLQ value.\");if(-1===(i=t.decode(e.charCodeAt(n++))))throw new Error(\"Invalid base64 digit: \"+e.charAt(n-1));o=!!(32&i),l+=(i&=31)<>1,1==(1&a)?-s:s),r.rest=n}},function(e,n){var r=\"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/\".split(\"\");n.encode=function(e){if(0<=e&&e= 200 && req.status < 300 || url.substr(0, 7) === \"file://\" && req.responseText) {\n resolve(req.responseText);\n } else {\n reject(new Error(\"HTTP status: \" + req.status + \" retrieving \" + url));\n }\n }\n };\n req.send();\n });\n }\n /**\n * Convert a Base64-encoded string into its original representation.\n * Used for inline sourcemaps.\n *\n * @param {String} b64str Base-64 encoded string\n * @returns {String} original representation of the base64-encoded string.\n */\n function _atob(b64str) {\n if (typeof window !== \"undefined\" && window.atob) {\n return window.atob(b64str);\n } else {\n throw new Error(\"You must supply a polyfill for window.atob in this environment\");\n }\n }\n function _parseJson(string) {\n if (typeof JSON !== \"undefined\" && JSON.parse) {\n return JSON.parse(string);\n } else {\n throw new Error(\"You must supply a polyfill for JSON.parse in this environment\");\n }\n }\n function _findFunctionName(source, lineNumber) {\n var syntaxes = [ // {name} = function ({args}) TODO args capture\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*function\\b/, // function {name}({args}) m[1]=name m[2]=args\n /function\\s+([^('\"`]*?)\\s*\\(([^)]*)\\)/, // {name} = eval()\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*(?:eval|new Function)\\b/, // fn_name() {\n /\\b(?!(?:if|for|switch|while|with|catch)\\b)(?:(?:static)\\s+)?(\\S+)\\s*\\(.*?\\)\\s*\\{/, // {name} = () => {\n /['\"]?([$_A-Za-z][$_A-Za-z0-9]*)['\"]?\\s*[:=]\\s*\\(.*?\\)\\s*=>/];\n var lines = source.split(\"\\n\");\n // Walk backwards in the source lines until we find the line which matches one of the patterns above\n var code = \"\";\n var maxLines = Math.min(lineNumber, 20);\n for (var i = 0; i < maxLines; ++i) {\n // lineNo is 1-based, source[] is 0-based\n var line = lines[lineNumber - i - 1];\n var commentPos = line.indexOf(\"//\");\n if (commentPos >= 0) {\n line = line.substr(0, commentPos);\n }\n if (line) {\n code = line + code;\n var len = syntaxes.length;\n for (var index = 0; index < len; index++) {\n var m = syntaxes[index].exec(code);\n if (m && m[1]) {\n return m[1];\n }\n }\n }\n }\n return undefined;\n }\n function _ensureSupportedEnvironment() {\n if (typeof Object.defineProperty !== \"function\" || typeof Object.create !== \"function\") {\n throw new Error(\"Unable to consume source maps in older browsers\");\n }\n }\n function _ensureStackFrameIsLegit(stackframe) {\n if (typeof stackframe !== \"object\") {\n throw new TypeError(\"Given StackFrame is not an object\");\n } else if (typeof stackframe.fileName !== \"string\") {\n throw new TypeError(\"Given file name is not a String\");\n } else if (typeof stackframe.lineNumber !== \"number\" || stackframe.lineNumber % 1 !== 0 || stackframe.lineNumber < 1) {\n throw new TypeError(\"Given line number must be a positive integer\");\n } else if (typeof stackframe.columnNumber !== \"number\" || stackframe.columnNumber % 1 !== 0 || stackframe.columnNumber < 0) {\n throw new TypeError(\"Given column number must be a non-negative integer\");\n }\n return true;\n }\n function _findSourceMappingURL(source) {\n var sourceMappingUrlRegExp = /\\/\\/[#@] ?sourceMappingURL=([^\\s'\"]+)\\s*$/gm;\n var lastSourceMappingUrl;\n var matchSourceMappingUrl;\n while (matchSourceMappingUrl = sourceMappingUrlRegExp.exec(source)) {\n // jshint ignore:line\n lastSourceMappingUrl = matchSourceMappingUrl[1];\n }\n if (lastSourceMappingUrl) {\n return lastSourceMappingUrl;\n } else {\n throw new Error(\"sourceMappingURL not found\");\n }\n }\n function _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache) {\n return new Promise(function (resolve, reject) {\n var loc = sourceMapConsumer.originalPositionFor({\n line: stackframe.lineNumber,\n column: stackframe.columnNumber\n });\n if (loc.source) {\n // cache mapped sources\n var mappedSource = sourceMapConsumer.sourceContentFor(loc.source);\n if (mappedSource) {\n sourceCache[loc.source] = mappedSource;\n }\n resolve(// given stackframe and source location, update stackframe\n new StackFrame({\n functionName: loc.name || stackframe.functionName,\n args: stackframe.args,\n fileName: loc.source,\n lineNumber: loc.line,\n columnNumber: loc.column\n }));\n } else {\n reject(new Error(\"Could not get original source for given stackframe and source map\"));\n }\n });\n }\n /**\n * @constructor\n * @param {Object} opts\n * opts.sourceCache = {url: \"Source String\"} => preload source cache\n * opts.sourceMapConsumerCache = {/path/file.js.map: SourceMapConsumer}\n * opts.offline = True to prevent network requests.\n * Best effort without sources or source maps.\n * opts.ajax = Promise returning function to make X-Domain requests\n */\n return function StackTraceGPS(opts) {\n if (!(this instanceof StackTraceGPS)) {\n return new StackTraceGPS(opts);\n }\n opts = opts || {};\n this.sourceCache = opts.sourceCache || {};\n this.sourceMapConsumerCache = opts.sourceMapConsumerCache || {};\n this.ajax = opts.ajax || _xdr;\n this._atob = opts.atob || _atob;\n\n this._get = function _get(location) {\n return new Promise(function (resolve, reject) {\n var isDataUrl = location.substr(0, 5) === \"data:\";\n if (this.sourceCache[location]) {\n resolve(this.sourceCache[location]);\n } else if (opts.offline && !isDataUrl) {\n reject(new Error(\"Cannot make network requests in offline mode\"));\n } else {\n if (isDataUrl) {\n // data URLs can have parameters.\n // see http://tools.ietf.org/html/rfc2397\n var supportedEncodingRegexp = /^data:application\\/json;([\\w=:\"-]+;)*base64,/;\n var match = location.match(supportedEncodingRegexp);\n if (match) {\n var sourceMapStart = match[0].length;\n var encodedSource = location.substr(sourceMapStart);\n var source = this._atob(encodedSource);\n this.sourceCache[location] = source;\n resolve(source);\n } else {\n reject(new Error(\"The encoding of the inline sourcemap is not supported\"));\n }\n } else {\n var xhrPromise = this.ajax(location, {\n method: \"get\"\n });\n // Cache the Promise to prevent duplicate in-flight requests\n this.sourceCache[location] = xhrPromise;\n xhrPromise.then(resolve, reject);\n }\n }\n }.bind(this));\n };\n /**\n * Creating SourceMapConsumers is expensive, so this wraps the creation of a\n * SourceMapConsumer in a per-instance cache.\n *\n * @param {String} sourceMappingURL = URL to fetch source map from\n * @param {String} defaultSourceRoot = Default source root for source map if undefined\n * @returns {Promise} that resolves a SourceMapConsumer\n */\n this._getSourceMapConsumer = function _getSourceMapConsumer(sourceMappingURL, defaultSourceRoot) {\n return new Promise(function (resolve, reject) {\n if (this.sourceMapConsumerCache[sourceMappingURL]) {\n resolve(this.sourceMapConsumerCache[sourceMappingURL]);\n } else {\n var sourceMapConsumerPromise = new Promise(function (resolve, reject) {\n return this._get(sourceMappingURL).then(function (sourceMapSource) {\n if (typeof sourceMapSource === \"string\") {\n sourceMapSource = _parseJson(sourceMapSource.replace(/^\\)\\]\\}'/, \"\"));\n }\n if (typeof sourceMapSource.sourceRoot === \"undefined\") {\n sourceMapSource.sourceRoot = defaultSourceRoot;\n }\n resolve(new SourceMap.SourceMapConsumer(sourceMapSource));\n }, reject);\n }.bind(this));\n this.sourceMapConsumerCache[sourceMappingURL] = sourceMapConsumerPromise;\n resolve(sourceMapConsumerPromise);\n }\n }.bind(this));\n };\n /**\n * Given a StackFrame, enhance function name and use source maps for a\n * better StackFrame.\n *\n * @param {StackFrame} stackframe object\n * @returns {Promise} that resolves with with source-mapped StackFrame\n */\n this.pinpoint = function StackTraceGPS$$pinpoint(stackframe) {\n return new Promise(function (resolve, reject) {\n this.getMappedLocation(stackframe).then(function (mappedStackFrame) {\n function resolveMappedStackFrame() {\n resolve(mappedStackFrame);\n }\n this.findFunctionName(mappedStackFrame).then(resolve, resolveMappedStackFrame)[\"catch\"](resolveMappedStackFrame);\n }.bind(this), reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, guess function name from location information.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.findFunctionName = function StackTraceGPS$$findFunctionName(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureStackFrameIsLegit(stackframe);\n this._get(stackframe.fileName).then(function getSourceCallback(source) {\n var lineNumber = stackframe.lineNumber;\n var columnNumber = stackframe.columnNumber;\n var guessedFunctionName = _findFunctionName(source, lineNumber, columnNumber);\n // Only replace functionName if we found something\n if (guessedFunctionName) {\n resolve(new StackFrame({\n functionName: guessedFunctionName,\n args: stackframe.args,\n fileName: stackframe.fileName,\n lineNumber: lineNumber,\n columnNumber: columnNumber\n }));\n } else {\n resolve(stackframe);\n }\n }, reject)[\"catch\"](reject);\n }.bind(this));\n };\n /**\n * Given a StackFrame, seek source-mapped location and return new enhanced StackFrame.\n *\n * @param {StackFrame} stackframe\n * @returns {Promise} that resolves with enhanced StackFrame.\n */\n this.getMappedLocation = function StackTraceGPS$$getMappedLocation(stackframe) {\n return new Promise(function (resolve, reject) {\n _ensureSupportedEnvironment();\n _ensureStackFrameIsLegit(stackframe);\n var sourceCache = this.sourceCache;\n var fileName = stackframe.fileName;\n this._get(fileName).then(function (source) {\n var sourceMappingURL = _findSourceMappingURL(source);\n var isDataUrl = sourceMappingURL.substr(0, 5) === \"data:\";\n var defaultSourceRoot = fileName.substring(0, fileName.lastIndexOf(\"/\") + 1);\n if (sourceMappingURL[0] !== \"/\" && !isDataUrl && !/^https?:\\/\\/|^\\/\\//i.test(sourceMappingURL)) {\n sourceMappingURL = defaultSourceRoot + sourceMappingURL;\n }\n return this._getSourceMapConsumer(sourceMappingURL, defaultSourceRoot).then(function (sourceMapConsumer) {\n return _extractLocationInfoFromSourceMapSource(stackframe, sourceMapConsumer, sourceCache).then(resolve)[\"catch\"](function () {\n resolve(stackframe);\n });\n });\n }.bind(this), reject)[\"catch\"](reject);\n }.bind(this));\n };\n };\n })(SourceMap, StackFrame);\n\n //\n // Shared Variables\n //\n\n var myScript = null;\n var scriptFile = document.getElementsByTagName('script');\n \n for (var i = 0; i < scriptFile.length; ++i) {\n if(isMe(scriptFile[i])) {\n myScript = scriptFile[i];\n }\n }\n\n var queryString = myScript != null ? myScript.src.replace(/^[^\\?]+\\??/, '') : null;\n var params = parseQuery(queryString);\n var paramsLength = objectLength(params);\n\n var debugSettings = {\n label: ' elmah.io debugger : On ',\n labelCSS: 'background: #06a89c; color: #ffffff; display: inline-block; font-size: 14px;',\n successCSS: 'background: #d4edda; color: #155724; display: inline-block; font-size: 13px;',\n errorCSS: 'background: #f8d7da; color: #721c24; display: inline-block; font-size: 13px;',\n warningCSS: 'background: #fff3cd; color: #856404; display: inline-block; font-size: 13px;',\n lightCSS: 'background: #e2e3e5; color: #383d41; display: inline-block; font-size: 13px;'\n };\n\n var defaults = {\n apiKey: null,\n logId: null,\n debug: false,\n application: null,\n filter: null,\n captureConsoleMinimumLevel: 'none',\n breadcrumbs: false,\n breadcrumbsNumber: 10\n };\n\n var breadcrumbsDelay = 100;\n\n //\n // Shared Methods\n //\n\n var extend = function () {\n\n // Variables\n var extended = {};\n var deep = false;\n var i = 0;\n\n // Check if a deep merge\n if (Object.prototype.toString.call(arguments[0]) === '[object Boolean]') {\n deep = arguments[0];\n i++;\n }\n\n // Merge the object into the extended object\n var merge = function (obj) {\n for (var prop in obj) {\n if (obj.hasOwnProperty(prop)) {\n // If property is an object, merge properties\n if (deep && Object.prototype.toString.call(obj[prop]) === '[object Object]') {\n extended[prop] = extend(extended[prop], obj[prop]);\n } else {\n extended[prop] = obj[prop];\n }\n }\n }\n };\n\n // Loop through each object and conduct a merge\n for (; i < arguments.length; i++) {\n var obj = arguments[i];\n merge(obj);\n }\n\n return extended;\n\n };\n\n //\n // Helpers\n //\n\n function isMe(scriptElem){\n if(scriptElem.getAttribute('src') != null) {\n return scriptElem.getAttribute('src').indexOf('elmahio') != -1 && scriptElem.getAttribute('src').indexOf('apiKey') != -1 && scriptElem.getAttribute('src').indexOf('logId') != -1;\n }\n }\n\n function isInt(n){\n return Number(n) === n && n % 1 === 0;\n }\n\n function isFloat(n){\n return Number(n) === n && n % 1 !== 0;\n }\n\n function parseQuery(query) {\n var Params = new Object();\n if (!query) return Params; // return empty object\n var Pairs = query.split(/[;&]/);\n for (var i = 0; i < Pairs.length; i++) {\n var KeyVal = Pairs[i].split('=');\n if (!KeyVal || KeyVal.length !== 2) continue;\n var key = unescape(KeyVal[0]);\n var val = unescape(KeyVal[1]);\n val = val.replace(/\\+/g, ' ');\n Params[key] = val;\n }\n return Params;\n }\n\n function objectLength(obj) {\n var size = 0, key;\n for (key in obj) {\n if (obj.hasOwnProperty(key)) size++;\n }\n return size;\n };\n\n function getSearchParameters() {\n var prmstr = window.location.search.substr(1);\n return prmstr !== null && prmstr !== \"\" ? transformToAssocArray(prmstr) : {};\n }\n\n function transformToAssocArray(prmstr) {\n var params = [];\n var prmarr = prmstr.split(\"&\");\n for (var i = 0; i < prmarr.length; i++) {\n var tmparr = prmarr[i].split(\"=\");\n params.push({\n 'key': tmparr[0],\n 'value': tmparr[1]\n });\n }\n return params;\n }\n\n function merge_objects(obj1, obj2) {\n var obj3 = {};\n for (var attrname1 in obj1) {\n obj3[attrname1] = obj1[attrname1];\n }\n for (var attrname2 in obj2) {\n obj3[attrname2] = obj2[attrname2];\n }\n\n return obj3;\n }\n\n function isString(what) {\n return Object.prototype.toString.call(what) === '[object String]';\n }\n\n function cssSelectorString(elem) {\n var MAX_TRAVERSE_HEIGHT = 5,\n MAX_OUTPUT_LEN = 80,\n out = [],\n height = 0,\n len = 0,\n separator = ' > ',\n sepLength = separator.length,\n nextStr;\n while (elem && height++ < MAX_TRAVERSE_HEIGHT) {\n nextStr = htmlElementAsString(elem);\n if (nextStr === 'html' || (height > 1 && len + out.length * sepLength + nextStr.length >= MAX_OUTPUT_LEN)) {\n break;\n }\n out.push(nextStr);\n len += nextStr.length;\n elem = elem.parentNode;\n }\n return out.reverse().join(separator);\n }\n \n function htmlElementAsString(elem) {\n var out = [], className, classes, key, attr, i;\n if (!elem || !elem.tagName) {\n return '';\n }\n out.push(elem.tagName.toLowerCase());\n if (elem.id) {\n out.push('#' + elem.id);\n }\n className = elem.className;\n if (className && isString(className)) {\n classes = className.split(/\\s+/);\n for (i = 0; i < classes.length; i++) {\n out.push('.' + classes[i]);\n }\n }\n var attrWhitelist = ['type', 'name', 'title', 'alt'];\n for (i = 0; i < attrWhitelist.length; i++) {\n key = attrWhitelist[i];\n attr = elem.getAttribute(key);\n if (attr) {\n out.push('[' + key + '=\"' + attr + '\"]');\n }\n }\n return out.join('');\n }\n\n var parseHash = function(url) {\n return url.split('#')[1] || '';\n };\n\n //\n // Constructor\n //\n\n var Constructor = function (options) {\n\n //\n // Variables\n //\n\n var publicAPIs = {};\n var settings;\n var breadcrumbs = [];\n var lastHref = window.location && window.location.href;\n\n function getPayload() {\n var payload = {\n \"url\": document.location.pathname || '/',\n \"application\": settings.application\n };\n\n var payload_data = [];\n\n if (document.documentMode) payload_data.push({ \"key\": \"Document-Mode\", \"value\": document.documentMode });\n if (window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth) payload_data.push({ \"key\": \"Browser-Width\", \"value\": window.innerWidth || document.documentElement.clientWidth || document.getElementsByTagName('body')[0].clientWidth });\n if (window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight) payload_data.push({ \"key\": \"Browser-Height\", \"value\": window.innerHeight || document.documentElement.clientHeight || document.getElementsByTagName('body')[0].clientHeight });\n if ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type) !== undefined) payload_data.push({ \"key\": \"Screen-Orientation\", \"value\": ((screen.msOrientation || (screen.orientation || screen.mozOrientation || {}).type).split(\"-\"))[0] });\n if (screen.width) payload_data.push({ \"key\": \"Screen-Width\", \"value\": screen.width });\n if (screen.height) payload_data.push({ \"key\": \"Screen-Height\", \"value\": screen.height });\n if (screen.colorDepth) payload_data.push({ \"key\": \"Color-Depth\", \"value\": screen.colorDepth });\n payload_data.push({ \"key\": \"X-ELMAHIO-SEARCH-isClientside\", \"value\": \"true\" });\n\n payload.data = payload_data;\n\n var payload_serverVariables = [];\n if (navigator.language) payload_serverVariables.push({ \"key\": \"User-Language\", \"value\": navigator.language });\n if (navigator.userAgent) payload_serverVariables.push({ \"key\": \"User-Agent\", \"value\": navigator.userAgent });\n if (document.referrer) payload_serverVariables.push({ \"key\": \"Referer\", \"value\": document.referrer });\n if (document.location.protocol === \"https:\") payload_serverVariables.push({ \"key\": \"HTTPS\", \"value\": 'on' });\n if (document.location.hostname) payload_serverVariables.push({ \"key\": \"Host\", \"value\": document.location.hostname });\n\n payload.serverVariables = payload_serverVariables;\n\n return payload;\n }\n\n function confirmResponse(status, response) {\n if (settings.debug) {\n if (status === 'error') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created ', debugSettings.lightCSS, debugSettings.errorCSS);\n } else if (status === 'success') {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2714 ' + response + ' at ' + new Date().toLocaleString() + ' ', debugSettings.lightCSS, debugSettings.successCSS);\n } else {\n console.log('%c \\u2BC8 Error log: ' + '%c \\u2715 Not created. Title should not be undefined, null or empty ! ', debugSettings.lightCSS, debugSettings.errorCSS);\n }\n }\n }\n\n function stackGPS(error, xhr, jsonData) {\n \tvar errorStack = error.toString().split(\"\\n\")[0];\n \tvar gps = new StackTraceGPS();\n var promise = new Promise(function(resolve) {\n\t var stackframes = ErrorStackParser.parse(error);\n\t resolve(Promise.all(stackframes.map(function(sf) {\n\t return new Promise(function(resolve) {\n\t function resolveOriginal() {\n\t resolve(sf);\n\t }\n\t gps.pinpoint(sf).then(resolve, resolveOriginal)['catch'](resolveOriginal);\n\t });\n\t })));\t\n });\n\n promise.then(function(newFrames){\n \tnewFrames.forEach(function(stackFrame, i){\n\t\t\t\t\tif(stackFrame.functionName) {\n \t\t\tvar fn = stackFrame.functionName + ' ';\n \t\t} else {\n \t\t\tvar fn = '';\n \t\t}\n \t\tvar stackString = ' at ' + fn + '(' + stackFrame.fileName + ':' + stackFrame.lineNumber + ':' + stackFrame.columnNumber + ')';\n \t\tnewFrames[i] = stackString;\n \t});\n \tnewFrames.unshift(errorStack);\n \tjsonData.detail = newFrames.join(\"\\n\");\n \txhr.send(JSON.stringify(jsonData));\n });\n }\n\n function stackString(error) {\n \tvar typeOF = typeof error.error;\n \tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \treturn typeOFCapitalized + ': ' + error.error + '\\n' + ' at ' + '(' + error.source + ':' + error.lineno + ':' + error.colno + ')';\n }\n\n function manipulateStack (errorStack, severity, message) {\n var stack = [];\n for (var i = 0; i < errorStack.length; i++) {\n if(errorStack[i] === \"Error\") {\n stack.push(severity + \": \" + message);\n }\n if(!errorStack[i].match(/elmahio.js|elmahio.min.js/g) && errorStack[i] !== \"Error\") {\n stack.push(errorStack[i]);\n }\n }\n return stack.join('\\n');\n }\n\n // Private methods\n\n var recordBreadcrumb = function(obj) {\n var crumb = merge_objects({'dateTime': new Date().toISOString()}, obj),\n breadcrumbs_number = 10;\n \n breadcrumbs.push(crumb);\n \n if(options.breadcrumbsNumber >= 0 && typeof options.breadcrumbsNumber === \"number\" ) {\n if(options.breadcrumbsNumber > 25) {\n breadcrumbs_number = 25;\n } else if(options.breadcrumbsNumber <= 25) {\n breadcrumbs_number = options.breadcrumbsNumber;\n }\n }\n \n if (breadcrumbs.length > breadcrumbs_number) {\n breadcrumbs.shift();\n }\n }\n\n var breadcrumbClickEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Click\",\n \"message\": target\n });\n }\n\n var breadcrumbFormSubmitEventHandler = function(evt) {\n var target;\n try {\n target = cssSelectorString(evt.target);\n } catch (e) {\n target = \"\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Form submit\",\n \"message\": target\n });\n }\n\n var breadcrumbWindowEventHandler = function(evt) {\n var type = evt.type,\n message = null;\n\n switch (type) {\n case \"load\":\n message = \"Page loaded\"; break;\n case \"DOMContentLoaded\":\n message = \"DOMContentLoaded\"; break;\n case \"pageshow\":\n message = \"Page shown\"; break;\n case \"pagehide\":\n message = \"Page hidden\"; break;\n case \"popstate\":\n message = \"Navigated from: \" + lastHref + \" to: \" + window.location.href; break;\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": message\n });\n }\n\n var breadcrumbHashChangeEventHandler = function(evt) {\n var oldURL = evt.oldURL,\n newURL = evt.newURL,\n from = null,\n to = null,\n message = null;\n\n if (oldURL && newURL) {\n from = parseHash(oldURL);\n to = parseHash(newURL);\n message = \"from: '\" + from + \"' to: '\" + to + \"'\";\n } else {\n to = location.hash;\n message = \"to: '\" + to + \"'\";\n }\n\n recordBreadcrumb({\n \"severity\": \"Information\",\n \"action\": \"Navigation\",\n \"message\": \"Hash changed \" + message\n });\n }\n\n var breadcrumbXHRHandler = function(evt, method, url) {\n var status = evt && evt.target ? evt.target.status : 0,\n severity = null,\n method = method.toUpperCase(),\n url = url,\n regex = /https:\\/\\/api.elmah.io/g;\n\n if(url.match(regex) == null) { \n if (status > 0 && status < 400) {\n severity = \"Information\";\n } else if (status > 399 && status < 500) {\n severity = \"Warning\";\n } else if (status >= 500) {\n severity = \"Error\";\n }\n\n var statusCode = status > 0 ? \" (\" + status + \")\" : \"\";\n\n recordBreadcrumb({\n \"severity\": severity,\n \"action\": \"Request\",\n \"message\": \"[\" + method + \"] \" + url + statusCode\n });\n }\n }\n\n var sendPayload = function (apiKey, logId, callback, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n error = errorLog,\n send = 1,\n queryParams = getSearchParameters(),\n stack = error.error && objectLength(error.error.stack) !== 0 && typeof error.error === \"object\" ? ErrorStackParser.parse(error.error) : '';\n\n // Ignoring error from an external script\n if (error && error.colno === 0 && error.lineno === 0 && (!stack || stack === '') && error.message && (error.message === \"Script error.\" || error.message === \"Script error\")) {\n\t\t\t if (settings.debug) {\n\t\t\t console.log('%c \\u2BC8 Error log: ' + '%c \\uD83D\\uDEC8 Ignoring error from external script ', debugSettings.lightCSS, debugSettings.warningCSS);\n\t\t\t }\n\t\t\t return;\n\t\t\t}\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"detail\": error.error ? error.error.stack : null,\n \"title\": error.message || 'Unspecified error',\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"severity\": \"Error\",\n \"type\": error.error ? error.error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Check if error sent is a string and not an object\n // Then create the articifial stacktrace and pass source & type of the error\n if(error.error && (objectLength(error.error.stack) === 0) && typeof jsonData.detail === \"undefined\") {\n \tvar typeOF = typeof errorLog.error;\n \t\t\tvar typeOFCapitalized = typeOF.charAt(0).toUpperCase() + typeOF.slice(1);\n\n \tjsonData.detail = stackString(errorLog);\n \tjsonData.source = errorLog.source;\n jsonData.title = \"Uncaught \" + typeOFCapitalized + \": \" + errorLog.error;\n }\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error.error && typeof error.error === \"object\" && objectLength(error.error.stack) !== 0 && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n \t// send message trying to pinpoint stackframes\n \tstackGPS(error.error, xhr, jsonData);\n\t } else {\n\t \t// send message\n \txhr.send(JSON.stringify(jsonData));\n\t }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendManualPayload = function (apiKey, logId, callback, logType, messageLog, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n type = logType,\n error = errorLog,\n message = messageLog,\n send = 1,\n queryParams = getSearchParameters();\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n if (type !== \"Log\") {\n\n var stack = error && error instanceof Error ? ErrorStackParser.parse(error) : null;\n\n var jsonData = {\n \"title\": message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": type,\n \"type\": error ? error.name : null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n } else {\n\n var jsonData = error;\n \n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n // If message contains breadcrumbs\n if(jsonData.breadcrumbs && jsonData.breadcrumbs.length > 0) {\n breadcrumbs = breadcrumbs.reverse();\n for (var i = 0; i < breadcrumbs.length; i++) {\n // Add breadcrumbs to jsonData object\n jsonData.breadcrumbs.unshift(breadcrumbs[i]);\n }\n } else {\n jsonData.breadcrumbs = breadcrumbs;\n }\n \n // Reset breadcrumbs\n breadcrumbs = [];\n }\n\n // on message event\n publicAPIs.emit('message', jsonData);\n\n if (error && error instanceof Error && type !== \"Log\" && typeof Promise !== \"undefined\" && Promise.toString().indexOf(\"[native code]\") !== -1) {\n // send message trying to pinpoint stackframes\n stackGPS(error, xhr, jsonData);\n } else {\n // send message\n if(jsonData.errorObject && jsonData.errorObject instanceof Error) {\n error = jsonData.errorObject;\n delete jsonData.errorObject;\n stackGPS(error, xhr, jsonData);\n } else {\n delete jsonData.errorObject;\n xhr.send(JSON.stringify(jsonData));\n }\n }\n\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPayloadFromConsole = function (apiKey, logId, callback, logType, errorLog) {\n var api_key = apiKey,\n log_id = logId,\n message = errorLog.message,\n messageTemplate = errorLog.message,\n type = logType,\n args = Object.values(errorLog.arguments),\n send = 1,\n queryParams = getSearchParameters();\n\n function format(f, args) {\n var formatRegExp = /%[sdif]/g;\n var str = f;\n\n if(args.length > 1) {\n // If message has placeholders (%s, %d, %i, %f), check for arguments and replace them\n if(String(f).match(/%[sdif]/g)) {\n var i = 0;\n str = String(f).replace(formatRegExp, function(x) {\n switch (x) {\n case '%s': i++; return args[i] ? String(args[i]) : '%s';\n case '%d': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%d';\n case '%i': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseInt(args[i]) : 'NaN' : '%i';\n case '%f': i++; return args[i] ? (isInt(args[i]) || isFloat(args[i])) ? parseFloat(args[i]) : 'NaN' : '%f';\n default: return x;\n }\n });\n\n for (var len = args.length, x = args[++i]; i < len; x = args[++i]) {\n if (x === null || typeof x !== 'object') {\n str += ' ' + x;\n } else {\n str += ' ' + String(Object.prototype.toString.call(x));\n }\n }\n } else {\n str = args.join(' ');\n }\n }\n\n return str;\n }\n\n message = format(message, args);\n\n if(typeof message !== \"string\" && message !== undefined){\n message = message.toString();\n }\n\n if(typeof messageTemplate !== \"string\" && messageTemplate !== undefined) {\n messageTemplate = messageTemplate.toString();\n }\n\n if ((api_key !== null && log_id !== null) || (paramsLength === 2)) {\n\n // Priority for parameters\n if (params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n api_key = params['apiKey'];\n log_id = params['logId'];\n }\n\n // get new XHR object\n var xhr = new XMLHttpRequest();\n xhr.open(\"POST\", \"https://api.elmah.io/v3/messages/\" + log_id + \"?api_key=\" + api_key, true);\n xhr.setRequestHeader('Content-type', 'application/json');\n\n xhr.onload = function (e) {\n if (xhr.readyState === 4) {\n if (xhr.status === 201) {\n callback('success', xhr.statusText);\n }\n\n if(xhr.status >= 400 && xhr.status <= 499) {\n callback('error', xhr.statusText);\n\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n }\n };\n\n xhr.onerror = function (e) {\n callback('error', xhr.statusText);\n // on error event\n publicAPIs.emit('error', xhr.status, xhr.statusText);\n }\n\n var jsonData = {\n \"title\": message,\n \"titleTemplate\": messageTemplate,\n \"detail\": manipulateStack(new Error().stack.split('\\n'), type, message),\n \"severity\": type,\n \"type\": null,\n \"queryString\": JSON.parse(JSON.stringify(queryParams))\n };\n\n // Add payload to jsonData\n jsonData = merge_objects(jsonData, getPayload());\n\n // Add breadcrumbs to jsonData\n if(breadcrumbs.length > 0) {\n jsonData.breadcrumbs = breadcrumbs;\n breadcrumbs = [];\n }\n\n // filter callback\n if (settings.filter !== null) {\n if (settings.filter(jsonData)) {\n send = 0;\n }\n }\n\n if (send === 1) {\n if (jsonData.title) {\n // on message event\n publicAPIs.emit('message', jsonData);\n // send message\n xhr.send(JSON.stringify(jsonData));\n } else {\n callback('missing-title', xhr.statusText);\n }\n }\n\n } else {\n return console.log('Login api error');\n }\n };\n\n var sendPrefilledLogMessage = function(errorLog) {\n // without error object\n if(!errorLog) return getPayload();\n\n // with error object\n var error = errorLog;\n var stack = error ? ErrorStackParser.parse(error) : null;\n var jsonData = {\n \"title\": error.message,\n \"source\": stack && stack.length > 0 ? stack[0].fileName : null,\n \"detail\": error ? error.stack : null,\n \"severity\": \"Error\",\n \"type\": error ? error.name : null,\n \"errorObject\": error\n };\n\n jsonData = merge_objects(jsonData, getPayload());\n \n return jsonData;\n };\n\n // Some public methods\n\n publicAPIs.error = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Error', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.verbose = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Verbose', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.debug = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Debug', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.information = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Information', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.warning = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Warning', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.fatal = function (msg, error) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Fatal', msg, error); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.log = function (obj) {\n setTimeout(function() { sendManualPayload(settings.apiKey, settings.logId, confirmResponse, 'Log', null, obj); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n };\n publicAPIs.message = function(error) {\n return sendPrefilledLogMessage(error);\n };\n publicAPIs.addBreadcrumb = function(msg, severity, evt) {\n recordBreadcrumb({\n \"severity\": (severity != undefined && isString(severity)) ? severity : \"Information\",\n \"action\": (evt != undefined && isString(evt)) ? evt : \"Log\",\n \"message\": (msg != undefined && isString(msg)) ? msg : \"This is just a test message.\"\n });\n };\n\n publicAPIs.on = function (name, callback, ctx) {\n var e = this.e || (this.e = {});\n\n (e[name] || (e[name] = [])).push({\n fn: callback,\n ctx: ctx\n });\n\n return this;\n };\n\n publicAPIs.emit = function (name) {\n var data = [].slice.call(arguments, 1);\n var evtArr = ((this.e || (this.e = {}))[name] || []).slice();\n var i = 0;\n var len = evtArr.length;\n\n for (i; i < len; i++) {\n evtArr[i].fn.apply(evtArr[i].ctx, data);\n }\n\n return this;\n };\n\n publicAPIs.init = function (options) {\n\n // -- Merge options into defaults\n settings = extend(defaults, options || {});\n\n // -- Breadcrumbs\n if (settings.breadcrumbs) {\n // Breadcrumbs - Click & Submit form\n if (document.addEventListener) {\n document.addEventListener('click', breadcrumbClickEventHandler, false);\n document.addEventListener('submit', breadcrumbFormSubmitEventHandler, false);\n } else if (document.attachEvent) {\n document.attachEvent('click', breadcrumbClickEventHandler, false);\n document.attachEvent('submit', breadcrumbFormSubmitEventHandler, false);\n }\n\n // Breadcrumbs - Navigation\n if (window.addEventListener) {\n window.addEventListener('load', breadcrumbWindowEventHandler, false);\n window.addEventListener('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.addEventListener('pageshow', breadcrumbWindowEventHandler, false);\n window.addEventListener('pagehide', breadcrumbWindowEventHandler, false);\n window.addEventListener('hashchange', breadcrumbHashChangeEventHandler, false);\n } else if (window.attachEvent) {\n window.attachEvent('load', breadcrumbWindowEventHandler, false);\n window.attachEvent('DOMContentLoaded', breadcrumbWindowEventHandler, false);\n window.attachEvent('pageshow', breadcrumbWindowEventHandler, false);\n window.attachEvent('pagehide', breadcrumbWindowEventHandler, false);\n window.attachEvent('hashchange', breadcrumbHashChangeEventHandler, false);\n }\n\n if(window.history && window.history.pushState && window.history.replaceState) {\n var old_onpopstate = window.onpopstate;\n window.onpopstate = function(evt) {\n breadcrumbWindowEventHandler(evt);\n if (old_onpopstate) {\n return old_onpopstate.apply(this, arguments);\n }\n };\n }\n\n // Breadcrumbs - XHR\n if(window.XMLHttpRequest && window.XMLHttpRequest.prototype) {\n // Store a reference to the native method\n var open = XMLHttpRequest.prototype.open;\n \n // Overwrite the native method\n XMLHttpRequest.prototype.open = function(method, url) {\n // Assign an event listener\n this.addEventListener(\"loadend\", function(event) { breadcrumbXHRHandler(event, method, url); }, false);\n // Call the stored reference to the native method\n open.apply(this, arguments);\n };\n }\n }\n\n // -- Log on window error\n window.onerror = function (message, source, lineno, colno, error) {\n var errorLog = {\n 'message': message,\n 'source': source,\n 'lineno': lineno,\n 'colno': colno,\n 'error': error\n }\n \n setTimeout(function() { sendPayload(settings.apiKey, settings.logId, confirmResponse, errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n\n return false;\n }\n\n // -- Overriding console methods\n // -- Then log messages into the app.elmah.io\n if(options && options.captureConsoleMinimumLevel !== \"none\") {\n\n // If captureConsoleMinimumLevel: info or debug is set (error, warn)\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"warn\" || options.captureConsoleMinimumLevel === \"error\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console errors\n var _error = console.error;\n console.error = function(errMessage){\n var errorLog = {\n \t\t'message': errMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Error', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _error.apply(console, arguments);\n };\n if(options.captureConsoleMinimumLevel !== \"error\") {\n // Log console warnings\n var _warning = console.warn;\n console.warn = function(warnMessage){\n var errorLog = {\n 'message': warnMessage,\n 'arguments': arguments\n }\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Warning', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _warning.apply(console, arguments);\n };\n }\n }\n if(options.captureConsoleMinimumLevel === \"info\" || options.captureConsoleMinimumLevel === \"debug\") {\n // Log console info\n var _info = console.info;\n console.info = function(infoMessage){\n var errorLog = {\n \t\t'message': infoMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Information', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _info.apply(console, arguments);\n };\n }\n if(options.captureConsoleMinimumLevel === \"debug\") {\n // Log console debug\n var _debug = console.debug;\n console.debug = function(debugMessage){\n var errorLog = {\n \t\t'message': debugMessage,\n \t\t'arguments': arguments\n \t}\n setTimeout(function() { sendPayloadFromConsole(settings.apiKey, settings.logId, confirmResponse, 'Debug', errorLog); }, settings.breadcrumbs ? breadcrumbsDelay : 0);\n _debug.apply(console, arguments);\n };\n }\n }\n };\n\n // Initialize the plugin\n publicAPIs.init(options);\n\n if (settings.debug) {\n console.log('%c' + debugSettings.label, debugSettings.labelCSS);\n }\n\n // Return the public APIs\n return publicAPIs;\n\n };\n\n\n //\n // Return the constructor\n //\n\n if (paramsLength && params.hasOwnProperty('apiKey') && params.hasOwnProperty('logId')) {\n // Immediately-Invoked Function Expression (IIFE)\n return new Constructor;\n } else {\n // UMD Constructor\n return Constructor;\n }\n\n});"],"file":"elmahio.min.js"} \ No newline at end of file diff --git a/src/elmahio.js b/src/elmahio.js index f5d945b..46140ef 100644 --- a/src/elmahio.js +++ b/src/elmahio.js @@ -1175,7 +1175,7 @@ if (type !== "Log") { - var stack = error ? ErrorStackParser.parse(error) : null; + var stack = error && error instanceof Error ? ErrorStackParser.parse(error) : null; var jsonData = { "title": message, @@ -1225,16 +1225,17 @@ // on message event publicAPIs.emit('message', jsonData); - if (error && type !== "Log" && typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) { + if (error && error instanceof Error && type !== "Log" && typeof Promise !== "undefined" && Promise.toString().indexOf("[native code]") !== -1) { // send message trying to pinpoint stackframes stackGPS(error, xhr, jsonData); } else { // send message - if(jsonData.errorObject) { + if(jsonData.errorObject && jsonData.errorObject instanceof Error) { error = jsonData.errorObject; delete jsonData.errorObject; stackGPS(error, xhr, jsonData); } else { + delete jsonData.errorObject; xhr.send(JSON.stringify(jsonData)); } }