{"version":3,"sources":["../node_modules/@bugsnag/js/browser/notifier.js","../../../node_modules/browser-pack-flat/_prelude","../../core/lib/breadcrumb-types.js","../../core/lib/es-utils/reduce.js","../../core/lib/es-utils/filter.js","../../core/lib/es-utils/includes.js","../../core/lib/es-utils/is-array.js","../../core/lib/es-utils/keys.js","../../core/lib/validators/int-range.js","../../core/lib/validators/list-of-functions.js","../../core/lib/validators/string-with-length.js","../../core/config.js","../../core/lib/es-utils/assign.js","../../core/lib/es-utils/map.js","config.js","../../core/breadcrumb.js","../../core/node_modules/stackframe/stackframe.js","../../core/node_modules/error-stack-parser/error-stack-parser.js","../../core/lib/error-stack-parser.js","../../core/node_modules/@bugsnag/safe-json-stringify/index.js","../../core/lib/feature-flag-delegate.js","../../core/lib/has-stack.js","../../core/node_modules/iserror/index.js","../../core/lib/iserror.js","../../core/lib/metadata-delegate.js","../../core/node_modules/stack-generator/stack-generator.js","../../core/event.js","../../core/lib/async-every.js","../../core/lib/callback-runner.js","../../core/lib/sync-callback-runner.js","../../core/node_modules/@bugsnag/cuid/lib/pad.js","../../core/node_modules/@bugsnag/cuid/lib/fingerprint.browser.js","../../core/node_modules/@bugsnag/cuid/index.js","../../core/session.js","../../core/client.js","../../core/lib/json-payload.js","../../delivery-x-domain-request/delivery.js","../../delivery-xml-http-request/delivery.js","../../plugin-app-duration/app.js","../../plugin-browser-context/context.js","../../plugin-browser-device/device.js","../../plugin-browser-request/request.js","../../plugin-browser-session/session.js","../../plugin-client-ip/client-ip.js","../../plugin-console-breadcrumbs/console-breadcrumbs.js","../../plugin-inline-script-content/inline-script-content.js","../../plugin-interaction-breadcrumbs/interaction-breadcrumbs.js","../../plugin-navigation-breadcrumbs/navigation-breadcrumbs.js","../../plugin-network-breadcrumbs/network-breadcrumbs.js","../../plugin-simple-throttle/throttle.js","../../plugin-strip-query-string/strip-query-string.js","../../plugin-window-onerror/onerror.js","../../plugin-window-unhandled-rejection/unhandled-rejection.js","notifier.js","../../../node_modules/browser-pack-flat/_postlude","index.js"],"names":["module","exports","require","arr","fn","accum","val","i","len","item","x","obj","Object","_hasDontEnumBug","toString","_dontEnums","result","prop","min","max","value","parseInt","f","defaultErrorTypes","unhandledExceptions","unhandledRejections","apiKey","defaultValue","message","validate","appVersion","appType","autoDetectErrors","enabledErrorTypes","allowPartialObject","providedKeys","defaultKeys","k","onError","onSession","onBreadcrumb","endpoints","notify","sessions","autoTrackSessions","enabledReleaseStages","releaseStage","maxBreadcrumbs","enabledBreadcrumbTypes","context","user","metadata","logger","redactedKeys","s","plugins","p","featureFlags","feature","arguments","source","target","schema","test","window","console","getPrefixedConsole","undefined","consoleLog","consoleMethod","timestamp","Date","this","type","toJSON","name","metaData","define","factory","root","_isNumber","n","isNaN","parseFloat","isFinite","_capitalize","str","_getter","booleanProps","numericProps","stringProps","arrayProps","props","StackFrame","getArgs","setArgs","TypeError","args","v","getEvalOrigin","setEvalOrigin","evalOrigin","getFunctionName","getFileName","Boolean","j","Number","String","FIREFOX_SAFARI_STACK_REGEXP","CHROME_IE_STACK_REGEXP","SAFARI_NATIVE_CODE_REGEXP","parse","error","parseOpera","parseV8OrIE","parseFFOrSafari","Error","extractLocation","urlLike","parts","line","sanitizedLine","location","tokens","locationParts","functionName","fileName","indexOf","lineNumber","columnNumber","functionNameRegex","matches","e","parseOpera9","parseOpera11","parseOpera10","lineRE","lines","match","argsRaw","functionCall","opts","redactedPaths","JSON","prepareObjForSerialization","data","MAX_DEPTH","MAX_EDGES","MIN_PRESERVED_DEPTH","REPLACEMENT_NODE","isError","o","throwsMessage","err","find","haystack","isDescendent","paths","path","shouldRedact","patterns","key","safelyGetProp","seen","edges","visit","edgesExceeded","fResult","eResult","aResult","add","variant","existingFeatures","merge","newFeatures","toEventApi","flag","featureFlag","state","section","keyOrObj","maybeVal","clear","updates","get","backtrace","stack","maxStackSize","curr","Array","RegExp","Event","stacktrace","handledState","defaultHandledState","groupingHash","originalError","_handledState","severity","unhandled","app","device","request","breadcrumbs","threads","_metadata","_features","_user","_session","errors","errorClass","ensureString","errorMessage","formatStackframe","addMetadata","getMetadata","clearMetadata","addFeatureFlag","addFeatureFlags","clearFeatureFlag","clearFeatureFlags","getUser","setUser","id","email","payloadVersion","exceptions","er","severityReason","session","frame","file","method","normaliseFunctionName","code","inProject","errorFramesToSkip","backtraceFramesToSkip","maybeError","tolerateNonErrors","component","normaliseError","internalFrames","event","makeSerialisable","createAndLogInputError","reason","hasNecessaryFields","cb","index","next","callbacks","onCallbackError","runMaybeAsyncCallback","ret","setTimeout","callbackArg","callbackType","ignore","cbs","env","globalCount","mimeTypesLength","navigator","clientId","c","blockSize","base","discreteValues","Math","randomBlock","safeCounter","cuid","Session","startedAt","_handled","_unhandled","events","handled","_track","noop","Client","internalPlugins","_notifier","_config","_schema","_delivery","sendSession","sendEvent","_logger","debug","info","warn","_plugins","_breadcrumbs","_context","_cbs","sp","b","Breadcrumb","_configure","configuration","pl","_depth","self","getContext","setContext","plugin","config","concat","generateConfigErrorMessage","_loadPlugin","getPlugin","_setDelivery","d","startSession","_sessionDelegate","addOnError","front","removeOnError","_addOnSessionPayload","push","addOnSession","removeOnSession","addOnBreadcrumb","removeOnBreadcrumb","pauseSession","resumeSession","leaveBreadcrumb","crumb","length","slice","_isBreadcrumbTypeEnabled","types","_notify","version","originalSeverity","notifier","rawInput","stringify","EVENT_REDACTION_PATHS","payload","win","url","getApiUrl","client","req","endpoint","isoDate","matchPageProtocol","encodeURIComponent","pageProtocol","appStart","reset","load","now","BUGSNAG_ANONYMOUS_ID_KEY","getDeviceId","storage","nav","screen","locale","userAgent","document","setDefaultUserId","time","configSchema","generateAnonymousId","eventOrSession","href","sessionDelegate","sessionClient","clientIp","collectUserIp","CONSOLE_LOG_METHODS","original","stringified","MAX_LINE_LENGTH","MAX_SCRIPT_LENGTH","doc","originalLocation","html","DOMContentLoaded","getHtml","prev","_lastScript","updateLastScript","script","getCurrentScript","scripts","addSurroundingCode","htmlLines","zeroBasedLine","start","end","currentScript","content","_setTimeout","__proxy","__traceOriginalScript","replace","eventTargetCallbackAccessor","alsoCallOriginal","call","cba","callbackAccessor","trackInlineScripts","host","replacement","replacer","isEventHandlerObj","targetText","getNodeText","targetSelector","getNodeSelector","el","text","truncate","ommision","drop","from","relativeLocation","to","getCurrentState","wrapHistoryFn","a","stateChangeToMetadata","title","currentPath","prevState","orig","BREADCRUMB_TYPE","REQUEST_SETUP_KEY","REQUEST_URL_KEY","REQUEST_METHOD_KEY","_ignoredUrls","ignoredUrls","monkeyPatchXMLHttpRequest","monkeyPatchFetch","handleFetchSuccess","response","status","handleFetchError","nativeOpen","removeEventListener","handleXHRLoad","handleXHRError","addEventListener","oldFetch","urlOrRequest","options","Promise","resolve","reject","maxEvents","strip","allFrames","prevOnError","onerror","lineNo","decorateStack","messageOrEvent","extraParameters","charNo","culprit","isActualNumber","listener","evt","isBluebird","fixBluebirdStacktrace","detail","promise","Bugsnag","_client","createClient","bugsnag","globalReact","lazy","React","ErrorBoundary","createClass","BugsnagPluginReactLazyInitializer","formatComponentStack","setState","FallbackComponent","clearError","handleClearError","_$src_1"],"mappings":"gJAAAA,EAAOC,QAAUC,EAAQ,O,qBCAzB,2BCAA,EAAiB,CAAC,aAAc,UAAW,UAAW,MAAO,OAAQ,QAAS,QAA9E,UCCA,EAAiB,SAACC,EAAKC,EAAIC,GAEzB,IADA,IAAIC,EAAJ,EACSC,EAAJ,EAAWC,EAAML,EAAtB,OAAkCI,EAAlC,EAA2CA,IAAKD,EAAMF,EAAGE,EAAKH,EAAN,KAAR,GAChD,OAAOG,GCDT,EAAiB,SAACH,EAAKC,GAAN,OACf,EAAOD,GAAK,yBAA0BC,EAAGK,EAAMF,EAAV,GAA4BF,EAAA,OAArD,GAAyB,IADtB,KCDjB,EAAiB,SAACF,EAAKO,GAAN,OACf,EAAOP,GAAK,yBAAyB,IAAAE,GAAkBI,IAA3C,KADG,ICDjB,EAAiB,SAAAE,GAAG,yBAAIC,OAAA,4BCAlBC,GAAoB,CAAEC,SAAU,MAAb,q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D,EAAQnD,EAAA,MAAd,aACIwK,EAAJ,GACStI,EAAJ,EAAchH,EAAMiI,EAAzB,OAAuCjB,EAAvC,EAAmDA,IAC7CiB,EAAAjB,GAAJ,SAAwBsI,IAAUA,EAAA,YAAP,IAAgCrH,EAAnC,IAE1B,OAAOqH,GAGHkO,EAAc,SAACF,EAAOrI,GAAR,mBAClB,cAAoB,aAClB,wBACA,MAAa,CACXzO,MADW,KAEXmL,KAAM,MAER,mBAAwB,0BAAxB,IANkB,EADF,mDAUlB,WACE3N,KAAK2Z,SAAS,CAAEnX,MAAF,KAAemL,KAAM,QAXnB,oBAclB,cACE,IAAQ7P,EAAYkC,KAApB,cACMyH,EAAe,CAAEK,SAAF,QAAqBC,WAArB,EAAsC6B,eAAgB,CAAE3J,KAAM,uBAC7E0K,EAAQsG,EAAA,oBAAd,GAMItD,GAAQA,EAAZ,iBAAiCA,EAAA,eAAsB+L,EAAqB/L,EAA3C,iBACjChD,EAAA,uBACAsG,EAAA,aACAjR,KAAK2Z,SAAS,CAAEnX,MAAF,EAASmL,UA1BP,SA6BlB,WAEE,GADkB3N,KAAlB,YACW,CACT,IAAQ4Z,EAAsB5Z,KAA9B,wBACA,OAAI4Z,EAA0BN,EAAA,qBAA4CtZ,KAA5C,OAAwD6Z,WAAY7Z,KAAK8Z,oBAChG,KAET,OAAO9Z,KAAKoB,MAAZ,UApCgB,GAA+CkY,EAA/C,YDlDpB,OC0FA,yBACA,YD3FOS,ErDDP","file":"static/js/186.5930b91e.chunk.js","sourcesContent":["module.exports = require('@bugsnag/browser')\n","(function(f){if(typeof exports===\"object\"&&typeof module!==\"undefined\"){module.exports=f()}else if(typeof define===\"function\"&&define.amd){define([],f)}else{var g;if(typeof window!==\"undefined\"){g=window}else if(typeof global!==\"undefined\"){g=global}else if(typeof self!==\"undefined\"){g=self}else{g=this}g.BugsnagPluginReact = f()}})(function(){var define,module,exports;\n","module.exports = ['navigation', 'request', 'process', 'log', 'user', 'state', 'error', 'manual']\n","// Array#reduce\nmodule.exports = (arr, fn, accum) => {\n let val = accum\n for (let i = 0, len = arr.length; i < len; i++) val = fn(val, arr[i], i, arr)\n return val\n}\n","const reduce = require('./reduce')\n\n// Array#filter\nmodule.exports = (arr, fn) =>\n reduce(arr, (accum, item, i, arr) => !fn(item, i, arr) ? accum : accum.concat(item), [])\n","const reduce = require('./reduce')\n// Array#includes\nmodule.exports = (arr, x) =>\n reduce(arr, (accum, item, i, arr) => accum === true || item === x, false)\n","// Array#isArray\nmodule.exports = obj => Object.prototype.toString.call(obj) === '[object Array]'\n","/* eslint-disable-next-line no-prototype-builtins */\nconst _hasDontEnumBug = !({ toString: null }).propertyIsEnumerable('toString')\nconst _dontEnums = [\n 'toString', 'toLocaleString', 'valueOf', 'hasOwnProperty',\n 'isPrototypeOf', 'propertyIsEnumerable', 'constructor'\n]\n\n// Object#keys\nmodule.exports = obj => {\n // stripped down version of\n // https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Object/Keys\n const result = []\n let prop\n for (prop in obj) {\n if (Object.prototype.hasOwnProperty.call(obj, prop)) result.push(prop)\n }\n if (!_hasDontEnumBug) return result\n for (let i = 0, len = _dontEnums.length; i < len; i++) {\n if (Object.prototype.hasOwnProperty.call(obj, _dontEnums[i])) result.push(_dontEnums[i])\n }\n return result\n}\n","module.exports = (min = 1, max = Infinity) => value =>\n typeof value === 'number' &&\n parseInt('' + value, 10) === value &&\n value >= min && value <= max\n","const filter = require('../es-utils/filter')\nconst isArray = require('../es-utils/is-array')\n\nmodule.exports = value => typeof value === 'function' || (isArray(value) && filter(value, f => typeof f === 'function').length === value.length)\n","module.exports = value => typeof value === 'string' && !!value.length\n","const filter = require('./lib/es-utils/filter')\nconst reduce = require('./lib/es-utils/reduce')\nconst keys = require('./lib/es-utils/keys')\nconst isArray = require('./lib/es-utils/is-array')\nconst includes = require('./lib/es-utils/includes')\nconst intRange = require('./lib/validators/int-range')\nconst stringWithLength = require('./lib/validators/string-with-length')\nconst listOfFunctions = require('./lib/validators/list-of-functions')\n\nconst BREADCRUMB_TYPES = require('./lib/breadcrumb-types')\nconst defaultErrorTypes = () => ({ unhandledExceptions: true, unhandledRejections: true })\n\nmodule.exports.schema = {\n apiKey: {\n defaultValue: () => null,\n message: 'is required',\n validate: stringWithLength\n },\n appVersion: {\n defaultValue: () => undefined,\n message: 'should be a string',\n validate: value => value === undefined || stringWithLength(value)\n },\n appType: {\n defaultValue: () => undefined,\n message: 'should be a string',\n validate: value => value === undefined || stringWithLength(value)\n },\n autoDetectErrors: {\n defaultValue: () => true,\n message: 'should be true|false',\n validate: value => value === true || value === false\n },\n enabledErrorTypes: {\n defaultValue: () => defaultErrorTypes(),\n message: 'should be an object containing the flags { unhandledExceptions:true|false, unhandledRejections:true|false }',\n allowPartialObject: true,\n validate: value => {\n // ensure we have an object\n if (typeof value !== 'object' || !value) return false\n const providedKeys = keys(value)\n const defaultKeys = keys(defaultErrorTypes())\n // ensure it only has a subset of the allowed keys\n if (filter(providedKeys, k => includes(defaultKeys, k)).length < providedKeys.length) return false\n // ensure all of the values are boolean\n if (filter(keys(value), k => typeof value[k] !== 'boolean').length > 0) return false\n return true\n }\n },\n onError: {\n defaultValue: () => [],\n message: 'should be a function or array of functions',\n validate: listOfFunctions\n },\n onSession: {\n defaultValue: () => [],\n message: 'should be a function or array of functions',\n validate: listOfFunctions\n },\n onBreadcrumb: {\n defaultValue: () => [],\n message: 'should be a function or array of functions',\n validate: listOfFunctions\n },\n endpoints: {\n defaultValue: () => ({\n notify: 'https://notify.bugsnag.com',\n sessions: 'https://sessions.bugsnag.com'\n }),\n message: 'should be an object containing endpoint URLs { notify, sessions }',\n validate: val =>\n // first, ensure it's an object\n (val && typeof val === 'object') &&\n (\n // notify and sessions must always be set\n stringWithLength(val.notify) && stringWithLength(val.sessions)\n ) &&\n // ensure no keys other than notify/session are set on endpoints object\n filter(keys(val), k => !includes(['notify', 'sessions'], k)).length === 0\n },\n autoTrackSessions: {\n defaultValue: val => true,\n message: 'should be true|false',\n validate: val => val === true || val === false\n },\n enabledReleaseStages: {\n defaultValue: () => null,\n message: 'should be an array of strings',\n validate: value => value === null || (isArray(value) && filter(value, f => typeof f === 'string').length === value.length)\n },\n releaseStage: {\n defaultValue: () => 'production',\n message: 'should be a string',\n validate: value => typeof value === 'string' && value.length\n },\n maxBreadcrumbs: {\n defaultValue: () => 25,\n message: 'should be a number ≤100',\n validate: value => intRange(0, 100)(value)\n },\n enabledBreadcrumbTypes: {\n defaultValue: () => BREADCRUMB_TYPES,\n message: `should be null or a list of available breadcrumb types (${BREADCRUMB_TYPES.join(',')})`,\n validate: value => value === null || (isArray(value) && reduce(value, (accum, maybeType) => {\n if (accum === false) return accum\n return includes(BREADCRUMB_TYPES, maybeType)\n }, true))\n },\n context: {\n defaultValue: () => undefined,\n message: 'should be a string',\n validate: value => value === undefined || typeof value === 'string'\n },\n user: {\n defaultValue: () => ({}),\n message: 'should be an object with { id, email, name } properties',\n validate: value =>\n (value === null) ||\n (value && reduce(\n keys(value),\n (accum, key) => accum && includes(['id', 'email', 'name'], key),\n true\n ))\n },\n metadata: {\n defaultValue: () => ({}),\n message: 'should be an object',\n validate: (value) => typeof value === 'object' && value !== null\n },\n logger: {\n defaultValue: () => undefined,\n message: 'should be null or an object with methods { debug, info, warn, error }',\n validate: value =>\n (!value) ||\n (value && reduce(\n ['debug', 'info', 'warn', 'error'],\n (accum, method) => accum && typeof value[method] === 'function',\n true\n ))\n },\n redactedKeys: {\n defaultValue: () => ['password'],\n message: 'should be an array of strings|regexes',\n validate: value =>\n isArray(value) && value.length === filter(value, s =>\n (typeof s === 'string' || (s && typeof s.test === 'function'))\n ).length\n },\n plugins: {\n defaultValue: () => ([]),\n message: 'should be an array of plugin objects',\n validate: value =>\n isArray(value) && value.length === filter(value, p =>\n (p && typeof p === 'object' && typeof p.load === 'function')\n ).length\n },\n featureFlags: {\n defaultValue: () => [],\n message: 'should be an array of objects that have a \"name\" property',\n validate: value =>\n isArray(value) && value.length === filter(value, feature =>\n feature && typeof feature === 'object' && typeof feature.name === 'string'\n ).length\n }\n}\n","// extends helper from babel\n// https://github.com/babel/babel/blob/916429b516e6466fd06588ee820e40e025d7f3a3/packages/babel-helpers/src/helpers.js#L377-L393\nmodule.exports = function (target) {\n for (var i = 1; i < arguments.length; i++) {\n var source = arguments[i]\n for (var key in source) {\n if (Object.prototype.hasOwnProperty.call(source, key)) {\n target[key] = source[key]\n }\n }\n }\n return target\n}\n","const reduce = require('./reduce')\n\n// Array#map\nmodule.exports = (arr, fn) =>\n reduce(arr, (accum, item, i, arr) => accum.concat(fn(item, i, arr)), [])\n","const { schema } = require('@bugsnag/core/config')\nconst map = require('@bugsnag/core/lib/es-utils/map')\nconst assign = require('@bugsnag/core/lib/es-utils/assign')\n\nmodule.exports = {\n releaseStage: assign({}, schema.releaseStage, {\n defaultValue: () => {\n if (/^localhost(:\\d+)?$/.test(window.location.host)) return 'development'\n return 'production'\n }\n }),\n appType: {\n ...schema.appType,\n defaultValue: () => 'browser'\n },\n logger: assign({}, schema.logger, {\n defaultValue: () =>\n // set logger based on browser capability\n (typeof console !== 'undefined' && typeof console.debug === 'function')\n ? getPrefixedConsole()\n : undefined\n })\n}\n\nconst getPrefixedConsole = () => {\n const logger = {}\n const consoleLog = console.log\n map(['debug', 'info', 'warn', 'error'], (method) => {\n const consoleMethod = console[method]\n logger[method] = typeof consoleMethod === 'function'\n ? consoleMethod.bind(console, '[bugsnag]')\n : consoleLog.bind(console, '[bugsnag]')\n })\n return logger\n}\n","class Breadcrumb {\n constructor (message, metadata, type, timestamp = new Date()) {\n this.type = type\n this.message = message\n this.metadata = metadata\n this.timestamp = timestamp\n }\n\n toJSON () {\n return {\n type: this.type,\n name: this.message,\n timestamp: this.timestamp,\n metaData: this.metadata\n }\n }\n}\n\nmodule.exports = Breadcrumb\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stackframe', [], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory();\n } else {\n root.StackFrame = factory();\n }\n}(this, function() {\n 'use strict';\n function _isNumber(n) {\n return !isNaN(parseFloat(n)) && isFinite(n);\n }\n\n function _capitalize(str) {\n return str.charAt(0).toUpperCase() + str.substring(1);\n }\n\n function _getter(p) {\n return function() {\n return this[p];\n };\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\n var props = booleanProps.concat(numericProps, stringProps, arrayProps);\n\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\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\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\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\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\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\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\n return StackFrame;\n}));\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('error-stack-parser', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.ErrorStackParser = factory(root.StackFrame);\n }\n}(this, function ErrorStackParser(StackFrame) {\n 'use strict';\n\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\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\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\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\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\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 sanitizedLine = line.replace(/^\\s+/, '').replace(/\\(eval code/g, '(');\n\n // capture and preseve the parenthesized location \"(/foo/my bar.js:12:87)\" in\n // case it has spaces in it, as the string is split on \\s+ later on\n var location = sanitizedLine.match(/ (\\((.+):(\\d+):(\\d+)\\)$)/);\n\n // remove the parenthesized location from the line, if it was matched\n sanitizedLine = location ? sanitizedLine.replace(location[0], '') : sanitizedLine;\n\n var tokens = sanitizedLine.split(/\\s+/).slice(1);\n // if a location was matched, pass it to extractLocation() otherwise pop the last token\n var locationParts = this.extractLocation(location ? location[1] : tokens.pop());\n var functionName = tokens.join(' ') || undefined;\n var fileName = ['eval', ''].indexOf(locationParts[0]) > -1 ? undefined : locationParts[0];\n\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\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\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\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\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\n parseOpera: function ErrorStackParser$$parseOpera(e) {\n if (!e.stacktrace || (e.message.indexOf('\\n') > -1 &&\n 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\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\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\n return result;\n },\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\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(\n new StackFrame({\n functionName: match[3] || undefined,\n fileName: match[2],\n lineNumber: match[1],\n source: lines[i]\n })\n );\n }\n }\n\n return result;\n },\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\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\n .replace(//, '$2')\n .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]') ?\n undefined : argsRaw.split(',');\n\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","module.exports = require('error-stack-parser')\n","module.exports = function (data, replacer, space, opts) {\n var redactedKeys = opts && opts.redactedKeys ? opts.redactedKeys : []\n var redactedPaths = opts && opts.redactedPaths ? opts.redactedPaths : []\n return JSON.stringify(\n prepareObjForSerialization(data, redactedKeys, redactedPaths),\n replacer,\n space\n )\n}\n\nvar MAX_DEPTH = 20\nvar MAX_EDGES = 25000\nvar MIN_PRESERVED_DEPTH = 8\n\nvar REPLACEMENT_NODE = '...'\n\nfunction isError (o) {\n return o instanceof Error ||\n /^\\[object (Error|(Dom)?Exception)\\]$/.test(Object.prototype.toString.call(o))\n}\n\nfunction throwsMessage (err) {\n return '[Throws: ' + (err ? err.message : '?') + ']'\n}\n\nfunction find (haystack, needle) {\n for (var i = 0, len = haystack.length; i < len; i++) {\n if (haystack[i] === needle) return true\n }\n return false\n}\n\n// returns true if the string `path` starts with any of the provided `paths`\nfunction isDescendent (paths, path) {\n for (var i = 0, len = paths.length; i < len; i++) {\n if (path.indexOf(paths[i]) === 0) return true\n }\n return false\n}\n\nfunction shouldRedact (patterns, key) {\n for (var i = 0, len = patterns.length; i < len; i++) {\n if (typeof patterns[i] === 'string' && patterns[i].toLowerCase() === key.toLowerCase()) return true\n if (patterns[i] && typeof patterns[i].test === 'function' && patterns[i].test(key)) return true\n }\n return false\n}\n\nfunction isArray (obj) {\n return Object.prototype.toString.call(obj) === '[object Array]'\n}\n\nfunction safelyGetProp (obj, prop) {\n try {\n return obj[prop]\n } catch (err) {\n return throwsMessage(err)\n }\n}\n\nfunction prepareObjForSerialization (obj, redactedKeys, redactedPaths) {\n var seen = [] // store references to objects we have seen before\n var edges = 0\n\n function visit (obj, path) {\n function edgesExceeded () {\n return path.length > MIN_PRESERVED_DEPTH && edges > MAX_EDGES\n }\n\n edges++\n\n if (path.length > MAX_DEPTH) return REPLACEMENT_NODE\n if (edgesExceeded()) return REPLACEMENT_NODE\n if (obj === null || typeof obj !== 'object') return obj\n if (find(seen, obj)) return '[Circular]'\n\n seen.push(obj)\n\n if (typeof obj.toJSON === 'function') {\n try {\n // we're not going to count this as an edge because it\n // replaces the value of the currently visited object\n edges--\n var fResult = visit(obj.toJSON(), path)\n seen.pop()\n return fResult\n } catch (err) {\n return throwsMessage(err)\n }\n }\n\n var er = isError(obj)\n if (er) {\n edges--\n var eResult = visit({ name: obj.name, message: obj.message }, path)\n seen.pop()\n return eResult\n }\n\n if (isArray(obj)) {\n var aResult = []\n for (var i = 0, len = obj.length; i < len; i++) {\n if (edgesExceeded()) {\n aResult.push(REPLACEMENT_NODE)\n break\n }\n aResult.push(visit(obj[i], path.concat('[]')))\n }\n seen.pop()\n return aResult\n }\n\n var result = {}\n try {\n for (var prop in obj) {\n if (!Object.prototype.hasOwnProperty.call(obj, prop)) continue\n if (isDescendent(redactedPaths, path.join('.')) && shouldRedact(redactedKeys, prop)) {\n result[prop] = '[REDACTED]'\n continue\n }\n if (edgesExceeded()) {\n result[prop] = REPLACEMENT_NODE\n break\n }\n result[prop] = visit(safelyGetProp(obj, prop), path.concat(prop))\n }\n } catch (e) {}\n seen.pop()\n return result\n }\n\n return visit(obj, [])\n}\n","const map = require('./es-utils/map')\nconst keys = require('./es-utils/keys')\nconst isArray = require('./es-utils/is-array')\nconst jsonStringify = require('@bugsnag/safe-json-stringify')\n\nfunction add (existingFeatures, name, variant) {\n if (typeof name !== 'string') {\n return\n }\n\n if (variant === undefined) {\n variant = null\n } else if (variant !== null && typeof variant !== 'string') {\n variant = jsonStringify(variant)\n }\n\n existingFeatures[name] = variant\n}\n\nfunction merge (existingFeatures, newFeatures) {\n if (!isArray(newFeatures)) {\n return\n }\n\n for (let i = 0; i < newFeatures.length; ++i) {\n const feature = newFeatures[i]\n\n if (feature === null || typeof feature !== 'object') {\n continue\n }\n\n // 'add' will handle if 'name' doesn't exist & 'variant' is optional\n add(existingFeatures, feature.name, feature.variant)\n }\n}\n\n// convert feature flags from a map of 'name -> variant' into the format required\n// by the Bugsnag Event API:\n// [{ featureFlag: 'name', variant: 'variant' }, { featureFlag: 'name 2' }]\nfunction toEventApi (featureFlags) {\n return map(\n keys(featureFlags),\n name => {\n const flag = { featureFlag: name }\n\n // don't add a 'variant' property unless there's actually a value\n if (typeof featureFlags[name] === 'string') {\n flag.variant = featureFlags[name]\n }\n\n return flag\n }\n )\n}\n\nmodule.exports = { add, merge, toEventApi }\n","// Given `err` which may be an error, does it have a stack property which is a string?\nmodule.exports = err =>\n !!err &&\n (!!err.stack || !!err.stacktrace || !!err['opera#sourceloc']) &&\n typeof (err.stack || err.stacktrace || err['opera#sourceloc']) === 'string' &&\n err.stack !== `${err.name}: ${err.message}`\n","\n/**\n * Expose `isError`.\n */\n\nmodule.exports = isError;\n\n/**\n * Test whether `value` is error object.\n *\n * @param {*} value\n * @returns {boolean}\n */\n\nfunction isError(value) {\n switch (Object.prototype.toString.call(value)) {\n case '[object Error]': return true;\n case '[object Exception]': return true;\n case '[object DOMException]': return true;\n default: return value instanceof Error;\n }\n}\n","module.exports = require('iserror')\n","const assign = require('./es-utils/assign')\n\nconst add = (state, section, keyOrObj, maybeVal) => {\n if (!section) return\n let updates\n\n // addMetadata(\"section\", null) -> clears section\n if (keyOrObj === null) return clear(state, section)\n\n // normalise the two supported input types into object form\n if (typeof keyOrObj === 'object') updates = keyOrObj\n if (typeof keyOrObj === 'string') updates = { [keyOrObj]: maybeVal }\n\n // exit if we don't have an updates object at this point\n if (!updates) return\n\n // ensure a section with this name exists\n if (!state[section]) state[section] = {}\n\n // merge the updates with the existing section\n state[section] = assign({}, state[section], updates)\n}\n\nconst get = (state, section, key) => {\n if (typeof section !== 'string') return undefined\n if (!key) {\n return state[section]\n }\n if (state[section]) {\n return state[section][key]\n }\n return undefined\n}\n\nconst clear = (state, section, key) => {\n if (typeof section !== 'string') return\n\n // clear an entire section\n if (!key) {\n delete state[section]\n return\n }\n\n // clear a single value from a section\n if (state[section]) {\n delete state[section][key]\n }\n}\n\nmodule.exports = { add, get, clear }\n","(function(root, factory) {\n 'use strict';\n // Universal Module Definition (UMD) to support AMD, CommonJS/Node.js, Rhino, and browsers.\n\n /* istanbul ignore next */\n if (typeof define === 'function' && define.amd) {\n define('stack-generator', ['stackframe'], factory);\n } else if (typeof exports === 'object') {\n module.exports = factory(require('stackframe'));\n } else {\n root.StackGenerator = factory(root.StackFrame);\n }\n}(this, function(StackFrame) {\n return {\n backtrace: function StackGenerator$$backtrace(opts) {\n var stack = [];\n var maxStackSize = 10;\n\n if (typeof opts === 'object' && typeof opts.maxStackSize === 'number') {\n maxStackSize = opts.maxStackSize;\n }\n\n var curr = arguments.callee;\n while (curr && stack.length < maxStackSize && curr['arguments']) {\n // Allow V8 optimizations\n var args = new Array(curr['arguments'].length);\n for (var i = 0; i < args.length; ++i) {\n args[i] = curr['arguments'][i];\n }\n if (/function(?:\\s+([\\w$]+))+\\s*\\(/.test(curr.toString())) {\n stack.push(new StackFrame({functionName: RegExp.$1 || undefined, args: args}));\n } else {\n stack.push(new StackFrame({args: args}));\n }\n\n try {\n curr = curr.caller;\n } catch (e) {\n break;\n }\n }\n return stack;\n }\n };\n}));\n","const ErrorStackParser = require('./lib/error-stack-parser')\nconst StackGenerator = require('stack-generator')\nconst hasStack = require('./lib/has-stack')\nconst map = require('./lib/es-utils/map')\nconst reduce = require('./lib/es-utils/reduce')\nconst filter = require('./lib/es-utils/filter')\nconst assign = require('./lib/es-utils/assign')\nconst metadataDelegate = require('./lib/metadata-delegate')\nconst featureFlagDelegate = require('./lib/feature-flag-delegate')\nconst isError = require('./lib/iserror')\n\nclass Event {\n constructor (errorClass, errorMessage, stacktrace = [], handledState = defaultHandledState(), originalError) {\n this.apiKey = undefined\n this.context = undefined\n this.groupingHash = undefined\n this.originalError = originalError\n\n this._handledState = handledState\n this.severity = this._handledState.severity\n this.unhandled = this._handledState.unhandled\n\n this.app = {}\n this.device = {}\n this.request = {}\n\n this.breadcrumbs = []\n this.threads = []\n\n this._metadata = {}\n this._features = {}\n this._user = {}\n this._session = undefined\n\n this.errors = [\n {\n errorClass: ensureString(errorClass),\n errorMessage: ensureString(errorMessage),\n type: Event.__type,\n stacktrace: reduce(stacktrace, (accum, frame) => {\n const f = formatStackframe(frame)\n // don't include a stackframe if none of its properties are defined\n try {\n if (JSON.stringify(f) === '{}') return accum\n return accum.concat(f)\n } catch (e) {\n return accum\n }\n }, [])\n }\n ]\n\n // Flags.\n // Note these are not initialised unless they are used\n // to save unnecessary bytes in the browser bundle\n\n /* this.attemptImmediateDelivery, default: true */\n }\n\n addMetadata (section, keyOrObj, maybeVal) {\n return metadataDelegate.add(this._metadata, section, keyOrObj, maybeVal)\n }\n\n getMetadata (section, key) {\n return metadataDelegate.get(this._metadata, section, key)\n }\n\n clearMetadata (section, key) {\n return metadataDelegate.clear(this._metadata, section, key)\n }\n\n addFeatureFlag (name, variant = null) {\n featureFlagDelegate.add(this._features, name, variant)\n }\n\n addFeatureFlags (featureFlags) {\n featureFlagDelegate.merge(this._features, featureFlags)\n }\n\n clearFeatureFlag (name) {\n delete this._features[name]\n }\n\n clearFeatureFlags () {\n this._features = {}\n }\n\n getUser () {\n return this._user\n }\n\n setUser (id, email, name) {\n this._user = { id, email, name }\n }\n\n toJSON () {\n return {\n payloadVersion: '4',\n exceptions: map(this.errors, er => assign({}, er, { message: er.errorMessage })),\n severity: this.severity,\n unhandled: this._handledState.unhandled,\n severityReason: this._handledState.severityReason,\n app: this.app,\n device: this.device,\n request: this.request,\n breadcrumbs: this.breadcrumbs,\n context: this.context,\n groupingHash: this.groupingHash,\n metaData: this._metadata,\n user: this._user,\n session: this._session,\n featureFlags: featureFlagDelegate.toEventApi(this._features)\n }\n }\n}\n\n// takes a stacktrace.js style stackframe (https://github.com/stacktracejs/stackframe)\n// and returns a Bugsnag compatible stackframe (https://docs.bugsnag.com/api/error-reporting/#json-payload)\nconst formatStackframe = frame => {\n const f = {\n file: frame.fileName,\n method: normaliseFunctionName(frame.functionName),\n lineNumber: frame.lineNumber,\n columnNumber: frame.columnNumber,\n code: undefined,\n inProject: undefined\n }\n // Some instances result in no file:\n // - calling notify() from chrome's terminal results in no file/method.\n // - non-error exception thrown from global code in FF\n // This adds one.\n if (f.lineNumber > -1 && !f.file && !f.method) {\n f.file = 'global code'\n }\n return f\n}\n\nconst normaliseFunctionName = name => /^global code$/i.test(name) ? 'global code' : name\n\nconst defaultHandledState = () => ({\n unhandled: false,\n severity: 'warning',\n severityReason: { type: 'handledException' }\n})\n\nconst ensureString = (str) => typeof str === 'string' ? str : ''\n\n// Helpers\n\nEvent.getStacktrace = function (error, errorFramesToSkip, backtraceFramesToSkip) {\n if (hasStack(error)) return ErrorStackParser.parse(error).slice(errorFramesToSkip)\n // error wasn't provided or didn't have a stacktrace so try to walk the callstack\n try {\n return filter(StackGenerator.backtrace(), frame =>\n (frame.functionName || '').indexOf('StackGenerator$$') === -1\n ).slice(1 + backtraceFramesToSkip)\n } catch (e) {\n return []\n }\n}\n\nEvent.create = function (maybeError, tolerateNonErrors, handledState, component, errorFramesToSkip = 0, logger) {\n const [error, internalFrames] = normaliseError(maybeError, tolerateNonErrors, component, logger)\n let event\n try {\n const stacktrace = Event.getStacktrace(\n error,\n // if an error was created/throw in the normaliseError() function, we need to\n // tell the getStacktrace() function to skip the number of frames we know will\n // be from our own functions. This is added to the number of frames deep we\n // were told about\n internalFrames > 0 ? 1 + internalFrames + errorFramesToSkip : 0,\n // if there's no stacktrace, the callstack may be walked to generated one.\n // this is how many frames should be removed because they come from our library\n 1 + errorFramesToSkip\n )\n event = new Event(error.name, error.message, stacktrace, handledState, maybeError)\n } catch (e) {\n event = new Event(error.name, error.message, [], handledState, maybeError)\n }\n if (error.name === 'InvalidError') {\n event.addMetadata(`${component}`, 'non-error parameter', makeSerialisable(maybeError))\n }\n return event\n}\n\nconst makeSerialisable = (err) => {\n if (err === null) return 'null'\n if (err === undefined) return 'undefined'\n return err\n}\n\nconst normaliseError = (maybeError, tolerateNonErrors, component, logger) => {\n let error\n let internalFrames = 0\n\n const createAndLogInputError = (reason) => {\n if (logger) logger.warn(`${component} received a non-error: \"${reason}\"`)\n const err = new Error(`${component} received a non-error. See \"${component}\" tab for more detail.`)\n err.name = 'InvalidError'\n return err\n }\n\n // In some cases:\n //\n // - the promise rejection handler (both in the browser and node)\n // - the node uncaughtException handler\n //\n // We are really limited in what we can do to get a stacktrace. So we use the\n // tolerateNonErrors option to ensure that the resulting error communicates as\n // such.\n if (!tolerateNonErrors) {\n if (isError(maybeError)) {\n error = maybeError\n } else {\n error = createAndLogInputError(typeof maybeError)\n internalFrames += 2\n }\n } else {\n switch (typeof maybeError) {\n case 'string':\n case 'number':\n case 'boolean':\n error = new Error(String(maybeError))\n internalFrames += 1\n break\n case 'function':\n error = createAndLogInputError('function')\n internalFrames += 2\n break\n case 'object':\n if (maybeError !== null && isError(maybeError)) {\n error = maybeError\n } else if (maybeError !== null && hasNecessaryFields(maybeError)) {\n error = new Error(maybeError.message || maybeError.errorMessage)\n error.name = maybeError.name || maybeError.errorClass\n internalFrames += 1\n } else {\n error = createAndLogInputError(maybeError === null ? 'null' : 'unsupported object')\n internalFrames += 2\n }\n break\n default:\n error = createAndLogInputError('nothing')\n internalFrames += 2\n }\n }\n\n if (!hasStack(error)) {\n // in IE10/11 a new Error() doesn't have a stacktrace until you throw it, so try that here\n try {\n throw error\n } catch (e) {\n if (hasStack(e)) {\n error = e\n // if the error only got a stacktrace after we threw it here, we know it\n // will only have one extra internal frame from this function, regardless\n // of whether it went through createAndLogInputError() or not\n internalFrames = 1\n }\n }\n }\n\n return [error, internalFrames]\n}\n\n// default value for stacktrace.type\nEvent.__type = 'browserjs'\n\nconst hasNecessaryFields = error =>\n (typeof error.name === 'string' || typeof error.errorClass === 'string') &&\n (typeof error.message === 'string' || typeof error.errorMessage === 'string')\n\nmodule.exports = Event\n","// This is a heavily modified/simplified version of\n// https://github.com/othiym23/async-some\n// with the logic flipped so that it is akin to the\n// synchronous \"every\" method instead of \"some\".\n\n// run the asynchronous test function (fn) over each item in the array (arr)\n// in series until:\n// - fn(item, cb) => calls cb(null, false)\n// - or the end of the array is reached\n// the callback (cb) will be passed (null, false) if any of the items in arr\n// caused fn to call back with false, otherwise it will be passed (null, true)\nmodule.exports = (arr, fn, cb) => {\n let index = 0\n\n const next = () => {\n if (index >= arr.length) return cb(null, true)\n fn(arr[index], (err, result) => {\n if (err) return cb(err)\n if (result === false) return cb(null, false)\n index++\n next()\n })\n }\n\n next()\n}\n","const some = require('./async-every')\n\nmodule.exports = (callbacks, event, onCallbackError, cb) => {\n // This function is how we support different kinds of callback:\n // - synchronous - return value\n // - node-style async with callback - cb(err, value)\n // - promise/thenable - resolve(value)\n // It normalises each of these into the lowest common denominator – a node-style callback\n const runMaybeAsyncCallback = (fn, cb) => {\n if (typeof fn !== 'function') return cb(null)\n try {\n // if function appears sync…\n if (fn.length !== 2) {\n const ret = fn(event)\n // check if it returned a \"thenable\" (promise)\n if (ret && typeof ret.then === 'function') {\n return ret.then(\n // resolve\n val => setTimeout(() => cb(null, val)),\n // reject\n err => {\n setTimeout(() => {\n onCallbackError(err)\n return cb(null, true)\n })\n }\n )\n }\n return cb(null, ret)\n }\n // if function is async…\n fn(event, (err, result) => {\n if (err) {\n onCallbackError(err)\n return cb(null)\n }\n cb(null, result)\n })\n } catch (e) {\n onCallbackError(e)\n cb(null)\n }\n }\n\n some(callbacks, runMaybeAsyncCallback, cb)\n}\n","module.exports = (callbacks, callbackArg, callbackType, logger) => {\n let ignore = false\n const cbs = callbacks.slice()\n while (!ignore) {\n if (!cbs.length) break\n try {\n ignore = cbs.pop()(callbackArg) === false\n } catch (e) {\n logger.error(`Error occurred in ${callbackType} callback, continuing anyway…`)\n logger.error(e)\n }\n }\n return ignore\n}\n","module.exports = function pad (num, size) {\n var s = '000000000' + num;\n return s.substr(s.length - size);\n};\n","var pad = require('./pad.js');\n\nvar env = typeof window === 'object' ? window : self;\nvar globalCount = 0;\nfor (var prop in env) {\n if (Object.hasOwnProperty.call(env, prop)) globalCount++;\n}\nvar mimeTypesLength = navigator.mimeTypes ? navigator.mimeTypes.length : 0;\nvar clientId = pad((mimeTypesLength +\n navigator.userAgent.length).toString(36) +\n globalCount.toString(36), 4);\n\nmodule.exports = function fingerprint () {\n return clientId;\n};\n","/**\n * cuid.js\n * Collision-resistant UID generator for browsers and node.\n * Sequential for fast db lookups and recency sorting.\n * Safe for element IDs and server-side lookups.\n *\n * Extracted from CLCTR\n *\n * Copyright (c) Eric Elliott 2012\n * MIT License\n */\n\nvar fingerprint = require('./lib/fingerprint.js');\nvar pad = require('./lib/pad.js');\n\nvar c = 0,\n blockSize = 4,\n base = 36,\n discreteValues = Math.pow(base, blockSize);\n\nfunction randomBlock () {\n return pad((Math.random() *\n discreteValues << 0)\n .toString(base), blockSize);\n}\n\nfunction safeCounter () {\n c = c < discreteValues ? c : 0;\n c++; // this is not subliminal\n return c - 1;\n}\n\nfunction cuid () {\n // Starting with a lowercase letter makes\n // it HTML element ID friendly.\n var letter = 'c', // hard-coded allows for sequential access\n\n // timestamp\n // warning: this exposes the exact date and time\n // that the uid was created.\n timestamp = (new Date().getTime()).toString(base),\n\n // Prevent same-machine collisions.\n counter = pad(safeCounter().toString(base), blockSize),\n\n // A few chars to generate distinct ids for different\n // clients (so different computers are far less\n // likely to generate the same id)\n print = fingerprint(),\n\n // Grab some more chars from Math.random()\n random = randomBlock() + randomBlock();\n\n return letter + timestamp + counter + print + random;\n}\n\ncuid.fingerprint = fingerprint;\n\nmodule.exports = cuid;\n","const cuid = require('@bugsnag/cuid')\n\nclass Session {\n constructor () {\n this.id = cuid()\n this.startedAt = new Date()\n this._handled = 0\n this._unhandled = 0\n this._user = {}\n this.app = {}\n this.device = {}\n }\n\n getUser () {\n return this._user\n }\n\n setUser (id, email, name) {\n this._user = { id, email, name }\n }\n\n toJSON () {\n return {\n id: this.id,\n startedAt: this.startedAt,\n events: { handled: this._handled, unhandled: this._unhandled }\n }\n }\n\n _track (event) {\n this[event._handledState.unhandled ? '_unhandled' : '_handled'] += 1\n }\n}\n\nmodule.exports = Session\n","const config = require('./config')\nconst Event = require('./event')\nconst Breadcrumb = require('./breadcrumb')\nconst Session = require('./session')\nconst map = require('./lib/es-utils/map')\nconst includes = require('./lib/es-utils/includes')\nconst filter = require('./lib/es-utils/filter')\nconst reduce = require('./lib/es-utils/reduce')\nconst keys = require('./lib/es-utils/keys')\nconst assign = require('./lib/es-utils/assign')\nconst runCallbacks = require('./lib/callback-runner')\nconst featureFlagDelegate = require('./lib/feature-flag-delegate')\nconst metadataDelegate = require('./lib/metadata-delegate')\nconst runSyncCallbacks = require('./lib/sync-callback-runner')\nconst BREADCRUMB_TYPES = require('./lib/breadcrumb-types')\n\nconst noop = () => {}\n\nclass Client {\n constructor (configuration, schema = config.schema, internalPlugins = [], notifier) {\n // notifier id\n this._notifier = notifier\n\n // intialise opts and config\n this._config = {}\n this._schema = schema\n\n // i/o\n this._delivery = { sendSession: noop, sendEvent: noop }\n this._logger = { debug: noop, info: noop, warn: noop, error: noop }\n\n // plugins\n this._plugins = {}\n\n // state\n this._breadcrumbs = []\n this._session = null\n this._metadata = {}\n this._features = {}\n this._context = undefined\n this._user = {}\n\n // callbacks:\n // e: onError\n // s: onSession\n // sp: onSessionPayload\n // b: onBreadcrumb\n // (note these names are minified by hand because object\n // properties are not safe to minify automatically)\n this._cbs = {\n e: [],\n s: [],\n sp: [],\n b: []\n }\n\n // expose internal constructors\n this.Client = Client\n this.Event = Event\n this.Breadcrumb = Breadcrumb\n this.Session = Session\n\n this._config = this._configure(configuration, internalPlugins)\n map(internalPlugins.concat(this._config.plugins), pl => {\n if (pl) this._loadPlugin(pl)\n })\n\n // when notify() is called we need to know how many frames are from our own source\n // this inital value is 1 not 0 because we wrap notify() to ensure it is always\n // bound to have the client as its `this` value – see below.\n this._depth = 1\n\n const self = this\n const notify = this.notify\n this.notify = function () {\n return notify.apply(self, arguments)\n }\n }\n\n addMetadata (section, keyOrObj, maybeVal) {\n return metadataDelegate.add(this._metadata, section, keyOrObj, maybeVal)\n }\n\n getMetadata (section, key) {\n return metadataDelegate.get(this._metadata, section, key)\n }\n\n clearMetadata (section, key) {\n return metadataDelegate.clear(this._metadata, section, key)\n }\n\n addFeatureFlag (name, variant = null) {\n featureFlagDelegate.add(this._features, name, variant)\n }\n\n addFeatureFlags (featureFlags) {\n featureFlagDelegate.merge(this._features, featureFlags)\n }\n\n clearFeatureFlag (name) {\n delete this._features[name]\n }\n\n clearFeatureFlags () {\n this._features = {}\n }\n\n getContext () {\n return this._context\n }\n\n setContext (c) {\n this._context = c\n }\n\n _configure (opts, internalPlugins) {\n const schema = reduce(internalPlugins, (schema, plugin) => {\n if (plugin && plugin.configSchema) return assign({}, schema, plugin.configSchema)\n return schema\n }, this._schema)\n\n // accumulate configuration and error messages\n const { errors, config } = reduce(keys(schema), (accum, key) => {\n const defaultValue = schema[key].defaultValue(opts[key])\n\n if (opts[key] !== undefined) {\n const valid = schema[key].validate(opts[key])\n if (!valid) {\n accum.errors[key] = schema[key].message\n accum.config[key] = defaultValue\n } else {\n if (schema[key].allowPartialObject) {\n accum.config[key] = assign(defaultValue, opts[key])\n } else {\n accum.config[key] = opts[key]\n }\n }\n } else {\n accum.config[key] = defaultValue\n }\n\n return accum\n }, { errors: {}, config: {} })\n\n if (schema.apiKey) {\n // missing api key is the only fatal error\n if (!config.apiKey) throw new Error('No Bugsnag API Key set')\n // warn about an apikey that is not of the expected format\n if (!/^[0-9a-f]{32}$/i.test(config.apiKey)) errors.apiKey = 'should be a string of 32 hexadecimal characters'\n }\n\n // update and elevate some options\n this._metadata = assign({}, config.metadata)\n featureFlagDelegate.merge(this._features, config.featureFlags)\n this._user = assign({}, config.user)\n this._context = config.context\n if (config.logger) this._logger = config.logger\n\n // add callbacks\n if (config.onError) this._cbs.e = this._cbs.e.concat(config.onError)\n if (config.onBreadcrumb) this._cbs.b = this._cbs.b.concat(config.onBreadcrumb)\n if (config.onSession) this._cbs.s = this._cbs.s.concat(config.onSession)\n\n // finally warn about any invalid config where we fell back to the default\n if (keys(errors).length) {\n this._logger.warn(generateConfigErrorMessage(errors, opts))\n }\n\n return config\n }\n\n getUser () {\n return this._user\n }\n\n setUser (id, email, name) {\n this._user = { id, email, name }\n }\n\n _loadPlugin (plugin) {\n const result = plugin.load(this)\n // JS objects are not the safest way to store arbitrarily keyed values,\n // so bookend the key with some characters that prevent tampering with\n // stuff like __proto__ etc. (only store the result if the plugin had a\n // name)\n if (plugin.name) this._plugins[`~${plugin.name}~`] = result\n return this\n }\n\n getPlugin (name) {\n return this._plugins[`~${name}~`]\n }\n\n _setDelivery (d) {\n this._delivery = d(this)\n }\n\n startSession () {\n const session = new Session()\n\n session.app.releaseStage = this._config.releaseStage\n session.app.version = this._config.appVersion\n session.app.type = this._config.appType\n\n session._user = assign({}, this._user)\n\n // run onSession callbacks\n const ignore = runSyncCallbacks(this._cbs.s, session, 'onSession', this._logger)\n\n if (ignore) {\n this._logger.debug('Session not started due to onSession callback')\n return this\n }\n return this._sessionDelegate.startSession(this, session)\n }\n\n addOnError (fn, front = false) {\n this._cbs.e[front ? 'unshift' : 'push'](fn)\n }\n\n removeOnError (fn) {\n this._cbs.e = filter(this._cbs.e, f => f !== fn)\n }\n\n _addOnSessionPayload (fn) {\n this._cbs.sp.push(fn)\n }\n\n addOnSession (fn) {\n this._cbs.s.push(fn)\n }\n\n removeOnSession (fn) {\n this._cbs.s = filter(this._cbs.s, f => f !== fn)\n }\n\n addOnBreadcrumb (fn, front = false) {\n this._cbs.b[front ? 'unshift' : 'push'](fn)\n }\n\n removeOnBreadcrumb (fn) {\n this._cbs.b = filter(this._cbs.b, f => f !== fn)\n }\n\n pauseSession () {\n return this._sessionDelegate.pauseSession(this)\n }\n\n resumeSession () {\n return this._sessionDelegate.resumeSession(this)\n }\n\n leaveBreadcrumb (message, metadata, type) {\n // coerce bad values so that the defaults get set\n message = typeof message === 'string' ? message : ''\n type = (typeof type === 'string' && includes(BREADCRUMB_TYPES, type)) ? type : 'manual'\n metadata = typeof metadata === 'object' && metadata !== null ? metadata : {}\n\n // if no message, discard\n if (!message) return\n\n const crumb = new Breadcrumb(message, metadata, type)\n\n // run onBreadcrumb callbacks\n const ignore = runSyncCallbacks(this._cbs.b, crumb, 'onBreadcrumb', this._logger)\n\n if (ignore) {\n this._logger.debug('Breadcrumb not attached due to onBreadcrumb callback')\n return\n }\n\n // push the valid crumb onto the queue and maintain the length\n this._breadcrumbs.push(crumb)\n if (this._breadcrumbs.length > this._config.maxBreadcrumbs) {\n this._breadcrumbs = this._breadcrumbs.slice(this._breadcrumbs.length - this._config.maxBreadcrumbs)\n }\n }\n\n _isBreadcrumbTypeEnabled (type) {\n const types = this._config.enabledBreadcrumbTypes\n\n return types === null || includes(types, type)\n }\n\n notify (maybeError, onError, cb = noop) {\n const event = Event.create(maybeError, true, undefined, 'notify()', this._depth + 1, this._logger)\n this._notify(event, onError, cb)\n }\n\n _notify (event, onError, cb = noop) {\n event.app = assign({}, event.app, {\n releaseStage: this._config.releaseStage,\n version: this._config.appVersion,\n type: this._config.appType\n })\n event.context = event.context || this._context\n event._metadata = assign({}, event._metadata, this._metadata)\n event._features = assign({}, event._features, this._features)\n event._user = assign({}, event._user, this._user)\n event.breadcrumbs = this._breadcrumbs.slice()\n\n // exit early if events should not be sent on the current releaseStage\n if (this._config.enabledReleaseStages !== null && !includes(this._config.enabledReleaseStages, this._config.releaseStage)) {\n this._logger.warn('Event not sent due to releaseStage/enabledReleaseStages configuration')\n return cb(null, event)\n }\n\n const originalSeverity = event.severity\n\n const onCallbackError = err => {\n // errors in callbacks are tolerated but we want to log them out\n this._logger.error('Error occurred in onError callback, continuing anyway…')\n this._logger.error(err)\n }\n\n const callbacks = [].concat(this._cbs.e).concat(onError)\n runCallbacks(callbacks, event, onCallbackError, (err, shouldSend) => {\n if (err) onCallbackError(err)\n\n if (!shouldSend) {\n this._logger.debug('Event not sent due to onError callback')\n return cb(null, event)\n }\n\n if (this._isBreadcrumbTypeEnabled('error')) {\n // only leave a crumb for the error if actually got sent\n Client.prototype.leaveBreadcrumb.call(this, event.errors[0].errorClass, {\n errorClass: event.errors[0].errorClass,\n errorMessage: event.errors[0].errorMessage,\n severity: event.severity\n }, 'error')\n }\n\n if (originalSeverity !== event.severity) {\n event._handledState.severityReason = { type: 'userCallbackSetSeverity' }\n }\n\n if (event.unhandled !== event._handledState.unhandled) {\n event._handledState.severityReason.unhandledOverridden = true\n event._handledState.unhandled = event.unhandled\n }\n\n if (this._session) {\n this._session._track(event)\n event._session = this._session\n }\n\n this._delivery.sendEvent({\n apiKey: event.apiKey || this._config.apiKey,\n notifier: this._notifier,\n events: [event]\n }, (err) => cb(err, event))\n })\n }\n}\n\nconst generateConfigErrorMessage = (errors, rawInput) => {\n const er = new Error(\n `Invalid configuration\\n${map(keys(errors), key => ` - ${key} ${errors[key]}, got ${stringify(rawInput[key])}`).join('\\n\\n')}`)\n return er\n}\n\nconst stringify = val => {\n switch (typeof val) {\n case 'string':\n case 'number':\n case 'object':\n return JSON.stringify(val)\n default: return String(val)\n }\n}\n\nmodule.exports = Client\n","const jsonStringify = require('@bugsnag/safe-json-stringify')\nconst EVENT_REDACTION_PATHS = [\n 'events.[].metaData',\n 'events.[].breadcrumbs.[].metaData',\n 'events.[].request'\n]\n\nmodule.exports.event = (event, redactedKeys) => {\n let payload = jsonStringify(event, null, null, { redactedPaths: EVENT_REDACTION_PATHS, redactedKeys })\n if (payload.length > 10e5) {\n event.events[0]._metadata = {\n notifier:\n`WARNING!\nSerialized payload was ${payload.length / 10e5}MB (limit = 1MB)\nmetadata was removed`\n }\n payload = jsonStringify(event, null, null, { redactedPaths: EVENT_REDACTION_PATHS, redactedKeys })\n if (payload.length > 10e5) throw new Error('payload exceeded 1MB limit')\n }\n return payload\n}\n\nmodule.exports.session = (event, redactedKeys) => {\n const payload = jsonStringify(event, null, null)\n if (payload.length > 10e5) throw new Error('payload exceeded 1MB limit')\n return payload\n}\n","const payload = require('@bugsnag/core/lib/json-payload')\n\nmodule.exports = (client, win = window) => ({\n sendEvent: (event, cb = () => {}) => {\n const url = getApiUrl(client._config, 'notify', '4', win)\n const req = new win.XDomainRequest()\n req.onload = function () {\n cb(null)\n }\n req.open('POST', url)\n setTimeout(() => {\n try {\n req.send(payload.event(event, client._config.redactedKeys))\n } catch (e) {\n client._logger.error(e)\n cb(e)\n }\n }, 0)\n },\n sendSession: (session, cb = () => {}) => {\n const url = getApiUrl(client._config, 'sessions', '1', win)\n const req = new win.XDomainRequest()\n req.onload = function () {\n cb(null)\n }\n req.open('POST', url)\n setTimeout(() => {\n try {\n req.send(payload.session(session, client._config.redactedKeys))\n } catch (e) {\n client._logger.error(e)\n cb(e)\n }\n }, 0)\n }\n})\n\nconst getApiUrl = (config, endpoint, version, win) => {\n // IE8 doesn't support Date.prototype.toISOstring(), but it does convert a date\n // to an ISO string when you use JSON stringify. Simply parsing the result of\n // JSON.stringify is smaller than using a toISOstring() polyfill.\n const isoDate = JSON.parse(JSON.stringify(new Date()))\n const url = matchPageProtocol(config.endpoints[endpoint], win.location.protocol)\n return `${url}?apiKey=${encodeURIComponent(config.apiKey)}&payloadVersion=${version}&sentAt=${encodeURIComponent(isoDate)}`\n}\n\nconst matchPageProtocol = module.exports._matchPageProtocol = (endpoint, pageProtocol) =>\n pageProtocol === 'http:'\n ? endpoint.replace(/^https:/, 'http:')\n : endpoint\n","const payload = require('@bugsnag/core/lib/json-payload')\n\nmodule.exports = (client, win = window) => ({\n sendEvent: (event, cb = () => {}) => {\n try {\n const url = client._config.endpoints.notify\n const req = new win.XMLHttpRequest()\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) cb(null)\n }\n req.open('POST', url)\n req.setRequestHeader('Content-Type', 'application/json')\n req.setRequestHeader('Bugsnag-Api-Key', event.apiKey || client._config.apiKey)\n req.setRequestHeader('Bugsnag-Payload-Version', '4')\n req.setRequestHeader('Bugsnag-Sent-At', (new Date()).toISOString())\n req.send(payload.event(event, client._config.redactedKeys))\n } catch (e) {\n client._logger.error(e)\n }\n },\n sendSession: (session, cb = () => {}) => {\n try {\n const url = client._config.endpoints.sessions\n const req = new win.XMLHttpRequest()\n req.onreadystatechange = function () {\n if (req.readyState === win.XMLHttpRequest.DONE) cb(null)\n }\n req.open('POST', url)\n req.setRequestHeader('Content-Type', 'application/json')\n req.setRequestHeader('Bugsnag-Api-Key', client._config.apiKey)\n req.setRequestHeader('Bugsnag-Payload-Version', '1')\n req.setRequestHeader('Bugsnag-Sent-At', (new Date()).toISOString())\n req.send(payload.session(session, client._config.redactedKeys))\n } catch (e) {\n client._logger.error(e)\n }\n }\n})\n","let appStart = new Date()\nconst reset = () => { appStart = new Date() }\n\nmodule.exports = {\n name: 'appDuration',\n load: client => {\n client.addOnError(event => {\n const now = new Date()\n\n event.app.duration = now - appStart\n }, true)\n\n return { reset }\n }\n}\n","/*\n * Sets the default context to be the current URL\n */\nmodule.exports = (win = window) => ({\n load: (client) => {\n client.addOnError(event => {\n if (event.context !== undefined) return\n event.context = win.location.pathname\n }, true)\n }\n})\n","const cuid = require('@bugsnag/cuid')\nconst assign = require('@bugsnag/core/lib/es-utils/assign')\nconst BUGSNAG_ANONYMOUS_ID_KEY = 'bugsnag-anonymous-id'\n\nconst getDeviceId = () => {\n try {\n const storage = window.localStorage\n\n let id = storage.getItem(BUGSNAG_ANONYMOUS_ID_KEY)\n\n // If we get an ID, make sure it looks like a valid cuid. The length can\n // fluctuate slightly, so some leeway is built in\n if (id && /^c[a-z0-9]{20,32}$/.test(id)) {\n return id\n }\n\n id = cuid()\n\n storage.setItem(BUGSNAG_ANONYMOUS_ID_KEY, id)\n\n return id\n } catch (err) {\n // If localStorage is not available (e.g. because it's disabled) then give up\n }\n}\n\n/*\n * Automatically detects browser device details\n */\nmodule.exports = (nav = navigator, screen = window.screen) => ({\n load: (client) => {\n const device = {\n locale: nav.browserLanguage || nav.systemLanguage || nav.userLanguage || nav.language,\n userAgent: nav.userAgent\n }\n\n if (screen && screen.orientation && screen.orientation.type) {\n device.orientation = screen.orientation.type\n } else {\n device.orientation =\n document.documentElement.clientWidth > document.documentElement.clientHeight\n ? 'landscape'\n : 'portrait'\n }\n\n if (client._config.generateAnonymousId) {\n device.id = getDeviceId()\n }\n\n client.addOnSession(session => {\n session.device = assign({}, session.device, device)\n // only set device id if collectUserIp is false\n if (!client._config.collectUserIp) setDefaultUserId(session)\n })\n\n // add time just as the event is sent\n client.addOnError((event) => {\n event.device = assign({},\n event.device,\n device,\n { time: new Date() }\n )\n if (!client._config.collectUserIp) setDefaultUserId(event)\n }, true)\n },\n configSchema: {\n generateAnonymousId: {\n validate: value => value === true || value === false,\n defaultValue: () => true,\n message: 'should be true|false'\n }\n }\n})\n\nconst setDefaultUserId = (eventOrSession) => {\n // device id is also used to populate the user id field, if it's not already set\n const user = eventOrSession.getUser()\n if (!user || !user.id) {\n eventOrSession.setUser(eventOrSession.device.id)\n }\n}\n","const assign = require('@bugsnag/core/lib/es-utils/assign')\n\n/*\n * Sets the event request: { url } to be the current href\n */\nmodule.exports = (win = window) => ({\n load: (client) => {\n client.addOnError(event => {\n if (event.request && event.request.url) return\n event.request = assign({}, event.request, { url: win.location.href })\n }, true)\n }\n})\n","const includes = require('@bugsnag/core/lib/es-utils/includes')\n\nmodule.exports = {\n load: client => { client._sessionDelegate = sessionDelegate }\n}\n\nconst sessionDelegate = {\n startSession: (client, session) => {\n const sessionClient = client\n sessionClient._session = session\n sessionClient._pausedSession = null\n\n // exit early if the current releaseStage is not enabled\n if (sessionClient._config.enabledReleaseStages !== null && !includes(sessionClient._config.enabledReleaseStages, sessionClient._config.releaseStage)) {\n sessionClient._logger.warn('Session not sent due to releaseStage/enabledReleaseStages configuration')\n return sessionClient\n }\n\n sessionClient._delivery.sendSession({\n notifier: sessionClient._notifier,\n device: session.device,\n app: session.app,\n sessions: [\n {\n id: session.id,\n startedAt: session.startedAt,\n user: session._user\n }\n ]\n })\n return sessionClient\n },\n resumeSession: (client) => {\n // Do nothing if there's already an active session\n if (client._session) {\n return client\n }\n\n // If we have a paused session then make it the active session\n if (client._pausedSession) {\n client._session = client._pausedSession\n client._pausedSession = null\n\n return client\n }\n\n // Otherwise start a new session\n return client.startSession()\n },\n pauseSession: (client) => {\n client._pausedSession = client._session\n client._session = null\n }\n}\n","const assign = require('@bugsnag/core/lib/es-utils/assign')\n\n/*\n * Prevent collection of user IPs\n */\nmodule.exports = {\n load: (client) => {\n if (client._config.collectUserIp) return\n\n client.addOnError(event => {\n // If user.id is explicitly undefined, it will be missing from the payload. It needs\n // removing so that the following line replaces it\n if (event._user && typeof event._user.id === 'undefined') delete event._user.id\n event._user = assign({ id: '[REDACTED]' }, event._user)\n event.request = assign({ clientIp: '[REDACTED]' }, event.request)\n })\n },\n configSchema: {\n collectUserIp: {\n defaultValue: () => true,\n message: 'should be true|false',\n validate: value => value === true || value === false\n }\n }\n}\n","const map = require('@bugsnag/core/lib/es-utils/map')\nconst reduce = require('@bugsnag/core/lib/es-utils/reduce')\nconst filter = require('@bugsnag/core/lib/es-utils/filter')\n\n/*\n * Leaves breadcrumbs when console log methods are called\n */\nexports.load = (client) => {\n const isDev = /^(local-)?dev(elopment)?$/.test(client._config.releaseStage)\n\n if (isDev || !client._isBreadcrumbTypeEnabled('log')) return\n\n map(CONSOLE_LOG_METHODS, method => {\n const original = console[method]\n console[method] = (...args) => {\n client.leaveBreadcrumb('Console output', reduce(args, (accum, arg, i) => {\n // do the best/simplest stringification of each argument\n let stringified = '[Unknown value]'\n // this may fail if the input is:\n // - an object whose [[Prototype]] is null (no toString)\n // - an object with a broken toString or @@toPrimitive implementation\n try { stringified = String(arg) } catch (e) {}\n // if it stringifies to [object Object] attempt to JSON stringify\n if (stringified === '[object Object]') {\n // catch stringify errors and fallback to [object Object]\n try { stringified = JSON.stringify(arg) } catch (e) {}\n }\n accum[`[${i}]`] = stringified\n return accum\n }, {\n severity: method.indexOf('group') === 0 ? 'log' : method\n }), 'log')\n original.apply(console, args)\n }\n console[method]._restore = () => { console[method] = original }\n })\n}\n\nif (process.env.NODE_ENV !== 'production') {\n exports.destroy = () => CONSOLE_LOG_METHODS.forEach(method => {\n if (typeof console[method]._restore === 'function') console[method]._restore()\n })\n}\n\nconst CONSOLE_LOG_METHODS = filter(['log', 'debug', 'info', 'warn', 'error'], method =>\n typeof console !== 'undefined' && typeof console[method] === 'function'\n)\n","const map = require('@bugsnag/core/lib/es-utils/map')\nconst reduce = require('@bugsnag/core/lib/es-utils/reduce')\nconst filter = require('@bugsnag/core/lib/es-utils/filter')\n\nconst MAX_LINE_LENGTH = 200\nconst MAX_SCRIPT_LENGTH = 500000\n\nmodule.exports = (doc = document, win = window) => ({\n load: (client) => {\n if (!client._config.trackInlineScripts) return\n\n const originalLocation = win.location.href\n let html = ''\n\n // in IE8-10 the 'interactive' state can fire too soon (before scripts have finished executing), so in those\n // we wait for the 'complete' state before assuming that synchronous scripts are no longer executing\n const isOldIe = !!doc.attachEvent\n let DOMContentLoaded = isOldIe ? doc.readyState === 'complete' : doc.readyState !== 'loading'\n const getHtml = () => doc.documentElement.outerHTML\n\n // get whatever HTML exists at this point in time\n html = getHtml()\n const prev = doc.onreadystatechange\n // then update it when the DOM content has loaded\n doc.onreadystatechange = function () {\n // IE8 compatible alternative to document#DOMContentLoaded\n if (doc.readyState === 'interactive') {\n html = getHtml()\n DOMContentLoaded = true\n }\n try { prev.apply(this, arguments) } catch (e) {}\n }\n\n let _lastScript = null\n const updateLastScript = script => {\n _lastScript = script\n }\n\n const getCurrentScript = () => {\n let script = doc.currentScript || _lastScript\n if (!script && !DOMContentLoaded) {\n const scripts = doc.scripts || doc.getElementsByTagName('script')\n script = scripts[scripts.length - 1]\n }\n return script\n }\n\n const addSurroundingCode = lineNumber => {\n // get whatever html has rendered at this point\n if (!DOMContentLoaded || !html) html = getHtml()\n // simulate the raw html\n const htmlLines = [''].concat(html.split('\\n'))\n const zeroBasedLine = lineNumber - 1\n const start = Math.max(zeroBasedLine - 3, 0)\n const end = Math.min(zeroBasedLine + 3, htmlLines.length)\n return reduce(htmlLines.slice(start, end), (accum, line, i) => {\n accum[start + 1 + i] = line.length <= MAX_LINE_LENGTH ? line : line.substr(0, MAX_LINE_LENGTH)\n return accum\n }, {})\n }\n\n client.addOnError(event => {\n // remove any of our own frames that may be part the stack this\n // happens before the inline script check as it happens for all errors\n event.errors[0].stacktrace = filter(event.errors[0].stacktrace, f => !(/__trace__$/.test(f.method)))\n\n const frame = event.errors[0].stacktrace[0]\n\n // if frame.file exists and is not the original location of the page, this can't be an inline script\n if (frame && frame.file && frame.file.replace(/#.*$/, '') !== originalLocation.replace(/#.*$/, '')) return\n\n // grab the last script known to have run\n const currentScript = getCurrentScript()\n if (currentScript) {\n const content = currentScript.innerHTML\n event.addMetadata(\n 'script',\n 'content',\n content.length <= MAX_SCRIPT_LENGTH ? content : content.substr(0, MAX_SCRIPT_LENGTH)\n )\n\n // only attempt to grab some surrounding code if we have a line number\n if (frame && frame.lineNumber) {\n frame.code = addSurroundingCode(frame.lineNumber)\n }\n }\n }, true)\n\n // Proxy all the timer functions whose callback is their 0th argument.\n // Keep a reference to the original setTimeout because we need it later\n const [_setTimeout] = map([\n 'setTimeout',\n 'setInterval',\n 'setImmediate',\n 'requestAnimationFrame'\n ], fn =>\n __proxy(win, fn, original =>\n __traceOriginalScript(original, args => ({\n get: () => args[0],\n replace: fn => { args[0] = fn }\n }))\n )\n )\n\n // Proxy all the host objects whose prototypes have an addEventListener function\n map([\n 'EventTarget', 'Window', 'Node', 'ApplicationCache', 'AudioTrackList', 'ChannelMergerNode',\n 'CryptoOperation', 'EventSource', 'FileReader', 'HTMLUnknownElement', 'IDBDatabase',\n 'IDBRequest', 'IDBTransaction', 'KeyOperation', 'MediaController', 'MessagePort', 'ModalWindow',\n 'Notification', 'SVGElementInstance', 'Screen', 'TextTrack', 'TextTrackCue', 'TextTrackList',\n 'WebSocket', 'WebSocketWorker', 'Worker', 'XMLHttpRequest', 'XMLHttpRequestEventTarget', 'XMLHttpRequestUpload'\n ], o => {\n if (!win[o] || !win[o].prototype || !Object.prototype.hasOwnProperty.call(win[o].prototype, 'addEventListener')) return\n __proxy(win[o].prototype, 'addEventListener', original =>\n __traceOriginalScript(original, eventTargetCallbackAccessor)\n )\n __proxy(win[o].prototype, 'removeEventListener', original =>\n __traceOriginalScript(original, eventTargetCallbackAccessor, true)\n )\n })\n\n function __traceOriginalScript (fn, callbackAccessor, alsoCallOriginal = false) {\n return function () {\n // this is required for removeEventListener to remove anything added with\n // addEventListener before the functions started being wrapped by Bugsnag\n const args = [].slice.call(arguments)\n try {\n const cba = callbackAccessor(args)\n const cb = cba.get()\n if (alsoCallOriginal) fn.apply(this, args)\n if (typeof cb !== 'function') return fn.apply(this, args)\n if (cb.__trace__) {\n cba.replace(cb.__trace__)\n } else {\n const script = getCurrentScript()\n // this function mustn't be annonymous due to a bug in the stack\n // generation logic, meaning it gets tripped up\n // see: https://github.com/stacktracejs/stack-generator/issues/6\n cb.__trace__ = function __trace__ () {\n // set the script that called this function\n updateLastScript(script)\n // immediately unset the currentScript synchronously below, however\n // if this cb throws an error the line after will not get run so schedule\n // an almost-immediate aysnc update too\n _setTimeout(function () { updateLastScript(null) }, 0)\n const ret = cb.apply(this, arguments)\n updateLastScript(null)\n return ret\n }\n cb.__trace__.__trace__ = cb.__trace__\n cba.replace(cb.__trace__)\n }\n } catch (e) {\n // swallow these errors on Selenium:\n // Permission denied to access property '__trace__'\n // WebDriverException: Message: Permission denied to access property \"handleEvent\"\n }\n // IE8 doesn't let you call .apply() on setTimeout/setInterval\n if (fn.apply) return fn.apply(this, args)\n switch (args.length) {\n case 1: return fn(args[0])\n case 2: return fn(args[0], args[1])\n default: return fn()\n }\n }\n }\n },\n configSchema: {\n trackInlineScripts: {\n validate: value => value === true || value === false,\n defaultValue: () => true,\n message: 'should be true|false'\n }\n }\n})\n\nfunction __proxy (host, name, replacer) {\n const original = host[name]\n if (!original) return original\n const replacement = replacer(original)\n host[name] = replacement\n return original\n}\n\nfunction eventTargetCallbackAccessor (args) {\n const isEventHandlerObj = !!args[1] && typeof args[1].handleEvent === 'function'\n return {\n get: function () {\n return isEventHandlerObj ? args[1].handleEvent : args[1]\n },\n replace: function (fn) {\n if (isEventHandlerObj) {\n args[1].handleEvent = fn\n } else {\n args[1] = fn\n }\n }\n }\n}\n","/*\n * Leaves breadcrumbs when the user interacts with the DOM\n */\nmodule.exports = (win = window) => ({\n load: (client) => {\n if (!('addEventListener' in win)) return\n if (!client._isBreadcrumbTypeEnabled('user')) return\n\n win.addEventListener('click', (event) => {\n let targetText, targetSelector\n try {\n targetText = getNodeText(event.target)\n targetSelector = getNodeSelector(event.target, win)\n } catch (e) {\n targetText = '[hidden]'\n targetSelector = '[hidden]'\n client._logger.error('Cross domain error when tracking click event. See docs: https://tinyurl.com/yy3rn63z')\n }\n client.leaveBreadcrumb('UI click', { targetText, targetSelector }, 'user')\n }, true)\n }\n})\n\n// extract text content from a element\nconst getNodeText = el => {\n let text = el.textContent || el.innerText || ''\n if (!text && (el.type === 'submit' || el.type === 'button')) text = el.value\n text = text.replace(/^\\s+|\\s+$/g, '') // trim whitespace\n return truncate(text, 140)\n}\n\n// Create a label from tagname, id and css class of the element\nfunction getNodeSelector (el, win) {\n const parts = [el.tagName]\n if (el.id) parts.push('#' + el.id)\n if (el.className && el.className.length) parts.push(`.${el.className.split(' ').join('.')}`)\n // Can't get much more advanced with the current browser\n if (!win.document.querySelectorAll || !Array.prototype.indexOf) return parts.join('')\n try {\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('')\n } catch (e) {\n // Sometimes the query selector can be invalid just return it as-is\n return parts.join('')\n }\n // try to get a more specific selector if this one matches more than one element\n if (el.parentNode.childNodes.length > 1) {\n const index = Array.prototype.indexOf.call(el.parentNode.childNodes, el) + 1\n parts.push(`:nth-child(${index})`)\n }\n if (win.document.querySelectorAll(parts.join('')).length === 1) return parts.join('')\n // try prepending the parent node selector\n if (el.parentNode) return `${getNodeSelector(el.parentNode, win)} > ${parts.join('')}`\n return parts.join('')\n}\n\nfunction truncate (value, length) {\n const ommision = '(...)'\n if (value && value.length <= length) return value\n return value.slice(0, length - ommision.length) + ommision\n}\n","/*\n* Leaves breadcrumbs when navigation methods are called or events are emitted\n*/\nmodule.exports = (win = window) => {\n const plugin = {\n load: (client) => {\n if (!('addEventListener' in win)) return\n if (!client._isBreadcrumbTypeEnabled('navigation')) return\n\n // returns a function that will drop a breadcrumb with a given name\n const drop = name => () => client.leaveBreadcrumb(name, {}, 'navigation')\n\n // simple drops – just names, no meta\n win.addEventListener('pagehide', drop('Page hidden'), true)\n win.addEventListener('pageshow', drop('Page shown'), true)\n win.addEventListener('load', drop('Page loaded'), true)\n win.document.addEventListener('DOMContentLoaded', drop('DOMContentLoaded'), true)\n // some browsers like to emit popstate when the page loads, so only add the popstate listener after that\n win.addEventListener('load', () => win.addEventListener('popstate', drop('Navigated back'), true))\n\n // hashchange has some metadata that we care about\n win.addEventListener('hashchange', event => {\n const metadata = event.oldURL\n ? { from: relativeLocation(event.oldURL, win), to: relativeLocation(event.newURL, win), state: getCurrentState(win) }\n : { to: relativeLocation(win.location.href, win) }\n client.leaveBreadcrumb('Hash changed', metadata, 'navigation')\n }, true)\n\n // the only way to know about replaceState/pushState is to wrap them… >_<\n\n if (win.history.replaceState) wrapHistoryFn(client, win.history, 'replaceState', win)\n if (win.history.pushState) wrapHistoryFn(client, win.history, 'pushState', win)\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n plugin.destroy = (win = window) => {\n win.history.replaceState._restore()\n win.history.pushState._restore()\n }\n }\n\n return plugin\n}\n\nif (process.env.NODE_ENV !== 'production') {\n exports.destroy = (win = window) => {\n win.history.replaceState._restore()\n win.history.pushState._restore()\n }\n}\n\n// takes a full url like http://foo.com:1234/pages/01.html?yes=no#section-2 and returns\n// just the path and hash parts, e.g. /pages/01.html?yes=no#section-2\nconst relativeLocation = (url, win) => {\n const a = win.document.createElement('A')\n a.href = url\n return `${a.pathname}${a.search}${a.hash}`\n}\n\nconst stateChangeToMetadata = (win, state, title, url) => {\n const currentPath = relativeLocation(win.location.href, win)\n return { title, state, prevState: getCurrentState(win), to: url || currentPath, from: currentPath }\n}\n\nconst wrapHistoryFn = (client, target, fn, win) => {\n const orig = target[fn]\n target[fn] = (state, title, url) => {\n client.leaveBreadcrumb(`History ${fn}`, stateChangeToMetadata(win, state, title, url), 'navigation')\n // if throttle plugin is in use, reset the event sent count\n if (typeof client.resetEventCount === 'function') client.resetEventCount()\n // if the client is operating in auto session-mode, a new route should trigger a new session\n if (client._config.autoTrackSessions) client.startSession()\n // Internet Explorer will convert `undefined` to a string when passed, causing an unintended redirect\n // to '/undefined'. therefore we only pass the url if it's not undefined.\n orig.apply(target, [state, title].concat(url !== undefined ? url : []))\n }\n if (process.env.NODE_ENV !== 'production') {\n target[fn]._restore = () => { target[fn] = orig }\n }\n}\n\nconst getCurrentState = (win) => {\n try {\n return win.history.state\n } catch (e) {}\n}\n","const BREADCRUMB_TYPE = 'request'\n\n// keys to safely store metadata on the request object\nconst REQUEST_SETUP_KEY = 'BS~~S'\nconst REQUEST_URL_KEY = 'BS~~U'\nconst REQUEST_METHOD_KEY = 'BS~~M'\n\nconst includes = require('@bugsnag/core/lib/es-utils/includes')\n\n/*\n * Leaves breadcrumbs when network requests occur\n */\nmodule.exports = (_ignoredUrls = [], win = window) => {\n let restoreFunctions = []\n const plugin = {\n load: client => {\n if (!client._isBreadcrumbTypeEnabled('request')) return\n\n const ignoredUrls = [\n client._config.endpoints.notify,\n client._config.endpoints.sessions\n ].concat(_ignoredUrls)\n\n monkeyPatchXMLHttpRequest()\n monkeyPatchFetch()\n\n // XMLHttpRequest monkey patch\n function monkeyPatchXMLHttpRequest () {\n if (!('addEventListener' in win.XMLHttpRequest.prototype)) return\n const nativeOpen = win.XMLHttpRequest.prototype.open\n\n // override native open()\n win.XMLHttpRequest.prototype.open = function open (method, url) {\n // store url and HTTP method for later\n this[REQUEST_URL_KEY] = url\n this[REQUEST_METHOD_KEY] = method\n\n // if we have already setup listeners, it means open() was called twice, we need to remove\n // the listeners and recreate them\n if (this[REQUEST_SETUP_KEY]) {\n this.removeEventListener('load', handleXHRLoad)\n this.removeEventListener('error', handleXHRError)\n }\n\n // attach load event listener\n this.addEventListener('load', handleXHRLoad)\n // attach error event listener\n this.addEventListener('error', handleXHRError)\n\n this[REQUEST_SETUP_KEY] = true\n\n nativeOpen.apply(this, arguments)\n }\n\n if (process.env.NODE_ENV !== 'production') {\n restoreFunctions.push(() => {\n win.XMLHttpRequest.prototype.open = nativeOpen\n })\n }\n }\n\n function handleXHRLoad () {\n const url = this[REQUEST_URL_KEY]\n\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.')\n return\n }\n\n // an XMLHttpRequest's URL can be an object as long as its 'toString'\n // returns a URL, e.g. a HTMLAnchorElement\n if (typeof url === 'string' && includes(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return\n }\n const metadata = {\n status: this.status,\n request: `${this[REQUEST_METHOD_KEY]} ${this[REQUEST_URL_KEY]}`\n }\n if (this.status >= 400) {\n // contacted server but got an error response\n client.leaveBreadcrumb('XMLHttpRequest failed', metadata, BREADCRUMB_TYPE)\n } else {\n client.leaveBreadcrumb('XMLHttpRequest succeeded', metadata, BREADCRUMB_TYPE)\n }\n }\n\n function handleXHRError () {\n const url = this[REQUEST_URL_KEY]\n\n if (url === undefined) {\n client._logger.warn('The request URL is no longer present on this XMLHttpRequest. A breadcrumb cannot be left for this request.')\n return\n }\n\n if (typeof url === 'string' && includes(ignoredUrls, url.replace(/\\?.*$/, ''))) {\n // don't leave a network breadcrumb from bugsnag notify calls\n return\n }\n\n // failed to contact server\n client.leaveBreadcrumb('XMLHttpRequest error', {\n request: `${this[REQUEST_METHOD_KEY]} ${this[REQUEST_URL_KEY]}`\n }, BREADCRUMB_TYPE)\n }\n\n // window.fetch monkey patch\n function monkeyPatchFetch () {\n // only patch it if it exists and if it is not a polyfill (patching a polyfilled\n // fetch() results in duplicate breadcrumbs for the same request because the\n // implementation uses XMLHttpRequest which is also patched)\n if (!('fetch' in win) || win.fetch.polyfill) return\n\n const oldFetch = win.fetch\n win.fetch = function fetch () {\n const urlOrRequest = arguments[0]\n const options = arguments[1]\n\n let method\n let url = null\n\n if (urlOrRequest && typeof urlOrRequest === 'object') {\n url = urlOrRequest.url\n if (options && 'method' in options) {\n method = options.method\n } else if (urlOrRequest && 'method' in urlOrRequest) {\n method = urlOrRequest.method\n }\n } else {\n url = urlOrRequest\n if (options && 'method' in options) {\n method = options.method\n }\n }\n\n if (method === undefined) {\n method = 'GET'\n }\n\n return new Promise((resolve, reject) => {\n // pass through to native fetch\n oldFetch(...arguments)\n .then(response => {\n handleFetchSuccess(response, method, url)\n resolve(response)\n })\n .catch(error => {\n handleFetchError(method, url)\n reject(error)\n })\n })\n }\n\n if (process.env.NODE_ENV !== 'production') {\n restoreFunctions.push(() => {\n win.fetch = oldFetch\n })\n }\n }\n\n const handleFetchSuccess = (response, method, url) => {\n const metadata = {\n status: response.status,\n request: `${method} ${url}`\n }\n if (response.status >= 400) {\n // when the request comes back with a 4xx or 5xx status it does not reject the fetch promise,\n client.leaveBreadcrumb('fetch() failed', metadata, BREADCRUMB_TYPE)\n } else {\n client.leaveBreadcrumb('fetch() succeeded', metadata, BREADCRUMB_TYPE)\n }\n }\n\n const handleFetchError = (method, url) => {\n client.leaveBreadcrumb('fetch() error', { request: `${method} ${url}` }, BREADCRUMB_TYPE)\n }\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n plugin.destroy = () => {\n restoreFunctions.forEach(fn => fn())\n restoreFunctions = []\n }\n }\n\n return plugin\n}\n","const intRange = require('@bugsnag/core/lib/validators/int-range')\n\n/*\n * Throttles and dedupes events\n */\n\nmodule.exports = {\n load: (client) => {\n // track sent events for each init of the plugin\n let n = 0\n\n // add onError hook\n client.addOnError((event) => {\n // have max events been sent already?\n if (n >= client._config.maxEvents) return false\n n++\n })\n\n client.resetEventCount = () => { n = 0 }\n },\n configSchema: {\n maxEvents: {\n defaultValue: () => 10,\n message: 'should be a positive integer ≤100',\n validate: val => intRange(1, 100)(val)\n }\n }\n}\n","/*\n * Remove query strings (and fragments) from stacktraces\n */\nconst map = require('@bugsnag/core/lib/es-utils/map')\nconst reduce = require('@bugsnag/core/lib/es-utils/reduce')\n\nmodule.exports = {\n load: (client) => {\n client.addOnError(event => {\n const allFrames = reduce(event.errors, (accum, er) => accum.concat(er.stacktrace), [])\n map(allFrames, frame => {\n frame.file = strip(frame.file)\n })\n })\n }\n}\n\nconst strip = module.exports._strip = str =>\n typeof str === 'string'\n ? str.replace(/\\?.*$/, '').replace(/#.*$/, '')\n : str\n","/*\n * Automatically notifies Bugsnag when window.onerror is called\n */\n\nmodule.exports = (win = window) => ({\n load: (client) => {\n if (!client._config.autoDetectErrors) return\n if (!client._config.enabledErrorTypes.unhandledExceptions) return\n function onerror (messageOrEvent, url, lineNo, charNo, error) {\n // Ignore errors with no info due to CORS settings\n if (lineNo === 0 && /Script error\\.?/.test(messageOrEvent)) {\n client._logger.warn('Ignoring cross-domain or eval script error. See docs: https://tinyurl.com/yy3rn63z')\n } else {\n // any error sent to window.onerror is unhandled and has severity=error\n const handledState = { severity: 'error', unhandled: true, severityReason: { type: 'unhandledException' } }\n\n let event\n\n // window.onerror can be called in a number of ways. This big if-else is how we\n // figure out which arguments were supplied, and what kind of values it received.\n\n if (error) {\n // if the last parameter (error) was supplied, this is a modern browser's\n // way of saying \"this value was thrown and not caught\"\n event = client.Event.create(error, true, handledState, 'window onerror', 1)\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo)\n } else if (\n // This complex case detects \"error\" events that are typically synthesised\n // by jquery's trigger method (although can be created in other ways). In\n // order to detect this:\n // - the first argument (message) must exist and be an object (most likely it's a jQuery event)\n // - the second argument (url) must either not exist or be something other than a string (if it\n // exists and is not a string, it'll be the extraParameters argument from jQuery's trigger()\n // function)\n // - the third, fourth and fifth arguments must not exist (lineNo, charNo and error)\n (typeof messageOrEvent === 'object' && messageOrEvent !== null) &&\n (!url || typeof url !== 'string') &&\n !lineNo && !charNo && !error\n ) {\n // The jQuery event may have a \"type\" property, if so use it as part of the error message\n const name = messageOrEvent.type ? `Event: ${messageOrEvent.type}` : 'Error'\n // attempt to find a message from one of the conventional properties, but\n // default to empty string (the event will fill it with a placeholder)\n const message = messageOrEvent.message || messageOrEvent.detail || ''\n\n event = client.Event.create({ name, message }, true, handledState, 'window onerror', 1)\n\n // provide the original thing onerror received – not our error-like object we passed to _notify\n event.originalError = messageOrEvent\n\n // include the raw input as metadata – it might contain more info than we extracted\n event.addMetadata('window onerror', { event: messageOrEvent, extraParameters: url })\n } else {\n // Lastly, if there was no \"error\" parameter this event was probably from an old\n // browser that doesn't support that. Instead we need to generate a stacktrace.\n event = client.Event.create(messageOrEvent, true, handledState, 'window onerror', 1)\n decorateStack(event.errors[0].stacktrace, url, lineNo, charNo)\n }\n\n client._notify(event)\n }\n\n if (typeof prevOnError === 'function') prevOnError.apply(this, arguments)\n }\n\n const prevOnError = win.onerror\n win.onerror = onerror\n }\n})\n\n// Sometimes the stacktrace has less information than was passed to window.onerror.\n// This function will augment the first stackframe with any useful info that was\n// received as arguments to the onerror callback.\nconst decorateStack = (stack, url, lineNo, charNo) => {\n if (!stack[0]) stack.push({})\n const culprit = stack[0]\n if (!culprit.file && typeof url === 'string') culprit.file = url\n if (!culprit.lineNumber && isActualNumber(lineNo)) culprit.lineNumber = lineNo\n if (!culprit.columnNumber) {\n if (isActualNumber(charNo)) {\n culprit.columnNumber = charNo\n } else if (window.event && isActualNumber(window.event.errorCharacter)) {\n culprit.columnNumber = window.event.errorCharacter\n }\n }\n}\n\nconst isActualNumber = (n) => typeof n === 'number' && String.call(n) !== 'NaN'\n","const map = require('@bugsnag/core/lib/es-utils/map')\nconst isError = require('@bugsnag/core/lib/iserror')\n\nlet _listener\n/*\n * Automatically notifies Bugsnag when window.onunhandledrejection is called\n */\nmodule.exports = (win = window) => {\n const plugin = {\n load: (client) => {\n if (!client._config.autoDetectErrors || !client._config.enabledErrorTypes.unhandledRejections) return\n const listener = evt => {\n let error = evt.reason\n let isBluebird = false\n\n // accessing properties on evt.detail can throw errors (see #394)\n try {\n if (evt.detail && evt.detail.reason) {\n error = evt.detail.reason\n isBluebird = true\n }\n } catch (e) {}\n\n const event = client.Event.create(error, false, {\n severity: 'error',\n unhandled: true,\n severityReason: { type: 'unhandledPromiseRejection' }\n }, 'unhandledrejection handler', 1, client._logger)\n\n if (isBluebird) {\n map(event.errors[0].stacktrace, fixBluebirdStacktrace(error))\n }\n\n client._notify(event, (event) => {\n if (isError(event.originalError) && !event.originalError.stack) {\n event.addMetadata('unhandledRejection handler', {\n [Object.prototype.toString.call(event.originalError)]: {\n name: event.originalError.name,\n message: event.originalError.message,\n code: event.originalError.code\n }\n })\n }\n })\n }\n if ('addEventListener' in win) {\n win.addEventListener('unhandledrejection', listener)\n } else {\n win.onunhandledrejection = (reason, promise) => {\n listener({ detail: { reason, promise } })\n }\n }\n _listener = listener\n }\n }\n\n if (process.env.NODE_ENV !== 'production') {\n plugin.destroy = (win = window) => {\n if (_listener) {\n if ('addEventListener' in win) {\n win.removeEventListener('unhandledrejection', _listener)\n } else {\n win.onunhandledrejection = null\n }\n }\n _listener = null\n }\n }\n\n return plugin\n}\n\n// The stack parser on bluebird stacks in FF get a suprious first frame:\n//\n// Error: derp\n// b@http://localhost:5000/bluebird.html:22:24\n// a@http://localhost:5000/bluebird.html:18:9\n// @http://localhost:5000/bluebird.html:14:9\n//\n// results in\n// […]\n// 0: Object { file: \"Error: derp\", method: undefined, lineNumber: undefined, … }\n// 1: Object { file: \"http://localhost:5000/bluebird.html\", method: \"b\", lineNumber: 22, … }\n// 2: Object { file: \"http://localhost:5000/bluebird.html\", method: \"a\", lineNumber: 18, … }\n// 3: Object { file: \"http://localhost:5000/bluebird.html\", lineNumber: 14, columnNumber: 9, … }\n//\n// so the following reduce/accumulator function removes such frames\n//\n// Bluebird pads method names with spaces so trim that too…\n// https://github.com/petkaantonov/bluebird/blob/b7f21399816d02f979fe434585334ce901dcaf44/src/debuggability.js#L568-L571\nconst fixBluebirdStacktrace = (error) => (frame) => {\n if (frame.file === error.toString()) return\n if (frame.method) {\n frame.method = frame.method.replace(/^\\s+/, '')\n }\n}\n","const name = 'Bugsnag JavaScript'\nconst version = '7.16.1'\nconst url = 'https://github.com/bugsnag/bugsnag-js'\n\nconst Client = require('@bugsnag/core/client')\nconst Event = require('@bugsnag/core/event')\nconst Session = require('@bugsnag/core/session')\nconst Breadcrumb = require('@bugsnag/core/breadcrumb')\n\nconst map = require('@bugsnag/core/lib/es-utils/map')\nconst keys = require('@bugsnag/core/lib/es-utils/keys')\nconst assign = require('@bugsnag/core/lib/es-utils/assign')\n\n// extend the base config schema with some browser-specific options\nconst schema = assign({}, require('@bugsnag/core/config').schema, require('./config'))\n\nconst pluginWindowOnerror = require('@bugsnag/plugin-window-onerror')\nconst pluginUnhandledRejection = require('@bugsnag/plugin-window-unhandled-rejection')\nconst pluginApp = require('@bugsnag/plugin-app-duration')\nconst pluginDevice = require('@bugsnag/plugin-browser-device')\nconst pluginContext = require('@bugsnag/plugin-browser-context')\nconst pluginRequest = require('@bugsnag/plugin-browser-request')\nconst pluginThrottle = require('@bugsnag/plugin-simple-throttle')\nconst pluginConsoleBreadcrumbs = require('@bugsnag/plugin-console-breadcrumbs')\nconst pluginNetworkBreadcrumbs = require('@bugsnag/plugin-network-breadcrumbs')\nconst pluginNavigationBreadcrumbs = require('@bugsnag/plugin-navigation-breadcrumbs')\nconst pluginInteractionBreadcrumbs = require('@bugsnag/plugin-interaction-breadcrumbs')\nconst pluginInlineScriptContent = require('@bugsnag/plugin-inline-script-content')\nconst pluginSession = require('@bugsnag/plugin-browser-session')\nconst pluginIp = require('@bugsnag/plugin-client-ip')\nconst pluginStripQueryString = require('@bugsnag/plugin-strip-query-string')\n\n// delivery mechanisms\nconst dXDomainRequest = require('@bugsnag/delivery-x-domain-request')\nconst dXMLHttpRequest = require('@bugsnag/delivery-xml-http-request')\n\nconst Bugsnag = {\n _client: null,\n createClient: (opts) => {\n // handle very simple use case where user supplies just the api key as a string\n if (typeof opts === 'string') opts = { apiKey: opts }\n if (!opts) opts = {}\n\n const internalPlugins = [\n // add browser-specific plugins\n pluginApp,\n pluginDevice(),\n pluginContext(),\n pluginRequest(),\n pluginThrottle,\n pluginSession,\n pluginIp,\n pluginStripQueryString,\n pluginWindowOnerror(),\n pluginUnhandledRejection(),\n pluginNavigationBreadcrumbs(),\n pluginInteractionBreadcrumbs(),\n pluginNetworkBreadcrumbs(),\n pluginConsoleBreadcrumbs,\n\n // this one added last to avoid wrapping functionality before bugsnag uses it\n pluginInlineScriptContent()\n ]\n\n // configure a client with user supplied options\n const bugsnag = new Client(opts, schema, internalPlugins, { name, version, url })\n\n // set delivery based on browser capability (IE 8+9 have an XDomainRequest object)\n bugsnag._setDelivery(window.XDomainRequest ? dXDomainRequest : dXMLHttpRequest)\n\n bugsnag._logger.debug('Loaded!')\n bugsnag.leaveBreadcrumb('Bugsnag loaded', {}, 'state')\n\n return bugsnag._config.autoTrackSessions\n ? bugsnag.startSession()\n : bugsnag\n },\n start: (opts) => {\n if (Bugsnag._client) {\n Bugsnag._client._logger.warn('Bugsnag.start() was called more than once. Ignoring.')\n return Bugsnag._client\n }\n Bugsnag._client = Bugsnag.createClient(opts)\n return Bugsnag._client\n }\n}\n\nmap(['resetEventCount'].concat(keys(Client.prototype)), (m) => {\n if (/^_/.test(m)) return\n Bugsnag[m] = function () {\n if (!Bugsnag._client) return console.log(`Bugsnag.${m}() was called before Bugsnag.start()`)\n Bugsnag._client._depth += 1\n const ret = Bugsnag._client[m].apply(Bugsnag._client, arguments)\n Bugsnag._client._depth -= 1\n return ret\n }\n})\n\nmodule.exports = Bugsnag\n\nmodule.exports.Client = Client\nmodule.exports.Event = Event\nmodule.exports.Session = Session\nmodule.exports.Breadcrumb = Breadcrumb\n\n// Export a \"default\" property for compatibility with ESM imports\nmodule.exports.default = Bugsnag\n","\nreturn _$src_1;\n\n});\n","module.exports = class BugsnagPluginReact {\n constructor (...args) {\n // Fetch React from the window object, if it exists\n const globalReact = typeof window !== 'undefined' && window.React\n\n this.name = 'react'\n this.lazy = args.length === 0 && !globalReact\n\n if (!this.lazy) {\n this.React = args[0] || globalReact\n if (!this.React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined')\n }\n }\n\n load (client) {\n if (!this.lazy) {\n const ErrorBoundary = createClass(this.React, client)\n ErrorBoundary.createErrorBoundary = () => ErrorBoundary\n return ErrorBoundary\n }\n\n const BugsnagPluginReactLazyInitializer = function () {\n throw new Error(`@bugsnag/plugin-react was used incorrectly. Valid usage is as follows:\nPass React to the plugin constructor\n\n \\`Bugsnag.start({ plugins: [new BugsnagPluginReact(React)] })\\`\nand then call \\`const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary()\\`\n\nOr if React is not available until after Bugsnag has started,\nconstruct the plugin with no arguments\n \\`Bugsnag.start({ plugins: [new BugsnagPluginReact()] })\\`,\nthen pass in React when available to construct your error boundary\n \\`const ErrorBoundary = Bugsnag.getPlugin('react').createErrorBoundary(React)\\``)\n }\n BugsnagPluginReactLazyInitializer.createErrorBoundary = (React) => {\n if (!React) throw new Error('@bugsnag/plugin-react reference to `React` was undefined')\n return createClass(React, client)\n }\n return BugsnagPluginReactLazyInitializer\n }\n}\n\nconst formatComponentStack = str => {\n const lines = str.split(/\\s*\\n\\s*/g)\n let ret = ''\n for (let line = 0, len = lines.length; line < len; line++) {\n if (lines[line].length) ret += `${ret.length ? '\\n' : ''}${lines[line]}`\n }\n return ret\n}\n\nconst createClass = (React, client) => class ErrorBoundary extends React.Component {\n constructor (props) {\n super(props)\n this.state = {\n error: null,\n info: null\n }\n this.handleClearError = this.handleClearError.bind(this)\n }\n\n handleClearError () {\n this.setState({ error: null, info: null })\n }\n\n componentDidCatch (error, info) {\n const { onError } = this.props\n const handledState = { severity: 'error', unhandled: true, severityReason: { type: 'unhandledException' } }\n const event = client.Event.create(\n error,\n true,\n handledState,\n 1\n )\n if (info && info.componentStack) info.componentStack = formatComponentStack(info.componentStack)\n event.addMetadata('react', info)\n client._notify(event, onError)\n this.setState({ error, info })\n }\n\n render () {\n const { error } = this.state\n if (error) {\n const { FallbackComponent } = this.props\n if (FallbackComponent) return React.createElement(FallbackComponent, { ...this.state, clearError: this.handleClearError })\n return null\n }\n return this.props.children\n }\n}\n\nmodule.exports.formatComponentStack = formatComponentStack\nmodule.exports.default = module.exports\n"],"sourceRoot":""}