sentry.js 50 KB

12
  1. /*! @sentry/browser 5.5.0 (994247d6) | https://github.com/getsentry/sentry-javascript */
  2. var Sentry=function(n){var t=function(n,r){return(t=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(n,t){n.__proto__=t}||function(n,t){for(var r in t)t.hasOwnProperty(r)&&(n[r]=t[r])})(n,r)};function r(n,r){function e(){this.constructor=n}t(n,r),n.prototype=null===r?Object.create(r):(e.prototype=r.prototype,new e)}var e,i,o,u=function(){return(u=Object.assign||function(n){for(var t,r=1,e=arguments.length;r<e;r++)for(var i in t=arguments[r])Object.prototype.hasOwnProperty.call(t,i)&&(n[i]=t[i]);return n}).apply(this,arguments)};function c(n,t){var r="function"==typeof Symbol&&n[Symbol.iterator];if(!r)return n;var e,i,o=r.call(n),u=[];try{for(;(void 0===t||t-- >0)&&!(e=o.next()).done;)u.push(e.value)}catch(n){i={error:n}}finally{try{e&&!e.done&&(r=o.return)&&r.call(o)}finally{if(i)throw i.error}}return u}function s(){for(var n=[],t=0;t<arguments.length;t++)n=n.concat(c(arguments[t]));return n}!function(n){n[n.None=0]="None",n[n.Error=1]="Error",n[n.Debug=2]="Debug",n[n.Verbose=3]="Verbose"}(e||(e={})),(i=n.Severity||(n.Severity={})).Fatal="fatal",i.Error="error",i.Warning="warning",i.Log="log",i.Info="info",i.Debug="debug",i.Critical="critical",function(n){n.fromString=function(t){switch(t){case"debug":return n.Debug;case"info":return n.Info;case"warn":case"warning":return n.Warning;case"error":return n.Error;case"fatal":return n.Fatal;case"critical":return n.Critical;case"log":default:return n.Log}}}(n.Severity||(n.Severity={})),(o=n.Status||(n.Status={})).Unknown="unknown",o.Skipped="skipped",o.Success="success",o.RateLimit="rate_limit",o.Invalid="invalid",o.Failed="failed",function(n){n.fromHttpCode=function(t){return t>=200&&t<300?n.Success:429===t?n.RateLimit:t>=400&&t<500?n.Invalid:t>=500?n.Failed:n.Unknown}}(n.Status||(n.Status={}));var a=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(n,t){return n.__proto__=t,n}:function(n,t){for(var r in t)n.hasOwnProperty(r)||(n[r]=t[r]);return n});var f=function(n){function t(t){var r=this.constructor,e=n.call(this,t)||this;return e.message=t,e.name=r.prototype.constructor.name,a(e,r.prototype),e}return r(t,n),t}(Error);function h(n){switch(Object.prototype.toString.call(n)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return n instanceof Error}}function l(n){return"[object ErrorEvent]"===Object.prototype.toString.call(n)}function v(n){return"[object DOMError]"===Object.prototype.toString.call(n)}function d(n){return"[object String]"===Object.prototype.toString.call(n)}function p(n){return null===n||"object"!=typeof n&&"function"!=typeof n}function m(n){return"[object Object]"===Object.prototype.toString.call(n)}function y(n){return Boolean(n&&n.then&&"function"==typeof n.then)}var b={};function w(){return"[object process]"===Object.prototype.toString.call("undefined"!=typeof process?process:0)?global:"undefined"!=typeof window?window:"undefined"!=typeof self?self:b}function g(){var n=w(),t=n.crypto||n.msCrypto;if(void 0!==t&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=4095&r[3]|16384,r[4]=16383&r[4]|32768;var e=function(n){for(var t=n.toString(16);t.length<4;)t="0"+t;return t};return e(r[0])+e(r[1])+e(r[2])+e(r[3])+e(r[4])+e(r[5])+e(r[6])+e(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(n){var t=16*Math.random()|0;return("x"===n?t:3&t|8).toString(16)})}function E(n){if(!n)return{};var t=n.match(/^(([^:\/?#]+):)?(\/\/([^\/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",e=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+e}}function x(n){if(n.message)return n.message;if(n.exception&&n.exception.values&&n.exception.values[0]){var t=n.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||n.event_id||"<unknown>"}return n.event_id||"<unknown>"}function j(n){var t=w();if(!("console"in t))return n();var r=t.console,e={};["debug","info","warn","error","log","assert"].forEach(function(n){n in t.console&&r[n].__sentry__&&(e[n]=r[n].__sentry_wrapped__,r[n]=r[n].__sentry_original__)});var i=n();return Object.keys(e).forEach(function(n){r[n]=e[n]}),i}function _(n,t,r,e){void 0===e&&(e={handled:!0,type:"generic"}),n.exception=n.exception||{},n.exception.values=n.exception.values||[],n.exception.values[0]=n.exception.values[0]||{},n.exception.values[0].value=n.exception.values[0].value||t||"",n.exception.values[0].type=n.exception.values[0].type||r||"Error",n.exception.values[0].mechanism=n.exception.values[0].mechanism||e}var S=w(),O="Sentry Logger ",k=function(){function n(){this.t=!1}return n.prototype.disable=function(){this.t=!1},n.prototype.enable=function(){this.t=!0},n.prototype.log=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.t&&j(function(){S.console.log(O+"[Log]: "+n.join(" "))})},n.prototype.warn=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.t&&j(function(){S.console.warn(O+"[Warn]: "+n.join(" "))})},n.prototype.error=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];this.t&&j(function(){S.console.error(O+"[Error]: "+n.join(" "))})},n}();S.__SENTRY__=S.__SENTRY__||{};var T=S.__SENTRY__.logger||(S.__SENTRY__.logger=new k),R=function(){function n(){this.i="function"==typeof WeakSet,this.o=this.i?new WeakSet:[]}return n.prototype.memoize=function(n){if(this.i)return!!this.o.has(n)||(this.o.add(n),!1);for(var t=0;t<this.o.length;t++){if(this.o[t]===n)return!0}return this.o.push(n),!1},n.prototype.unmemoize=function(n){if(this.i)this.o.delete(n);else for(var t=0;t<this.o.length;t++)if(this.o[t]===n){this.o.splice(t,1);break}},n}();function D(n,t,r){if(t in n){var e=n[t],i=r(e);if("function"==typeof i)try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e},__sentry_wrapped__:{enumerable:!1,value:i}})}catch(n){}n[t]=i}}function I(n){return function(n){return~-encodeURI(n).split(/%..|./).length}(JSON.stringify(n))}function C(n,t,r){void 0===t&&(t=3),void 0===r&&(r=102400);var e=L(n,t);return I(e)>r?C(n,t-1,r):e}function N(n,t){return"domain"===t&&"object"==typeof n&&n.u?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&n===global?"[Global]":"undefined"!=typeof window&&n===window?"[Window]":"undefined"!=typeof document&&n===document?"[Document]":"undefined"!=typeof Event&&n instanceof Event?Object.getPrototypeOf(n)?n.constructor.name:"Event":m(r=n)&&"nativeEvent"in r&&"preventDefault"in r&&"stopPropagation"in r?"[SyntheticEvent]":Number.isNaN(n)?"[NaN]":void 0===n?"[undefined]":"function"==typeof n?"[Function: "+(n.name||"<unknown-function-name>")+"]":n;var r}function A(n,t,r,e){if(void 0===r&&(r=1/0),void 0===e&&(e=new R),0===r)return function(n){var t=Object.prototype.toString.call(n);if("string"==typeof n)return n;if("[object Object]"===t)return"[Object]";if("[object Array]"===t)return"[Array]";var r=N(n);return p(r)?r:t}(t);if(null!=t&&"function"==typeof t.toJSON)return t.toJSON();var i=N(t,n);if(p(i))return i;var o=h(t)?function(n){var t={message:n.message,name:n.name,stack:n.stack};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&(t[r]=n[r]);return t}(t):t,u=Array.isArray(t)?[]:{};if(e.memoize(t))return"[Circular ~]";for(var c in o)Object.prototype.hasOwnProperty.call(o,c)&&(u[c]=A(c,o[c],r-1,e));return e.unmemoize(t),u}function L(n,t){try{return JSON.parse(JSON.stringify(n,function(n,r){return A(n,r,t)}))}catch(n){return"**non-serializable**"}}var M,U=function(){function n(n){this.s=n,this.h=[]}return n.prototype.isReady=function(){return void 0===this.s||this.length()<this.s},n.prototype.add=function(n){var t=this;return this.isReady()?(-1===this.h.indexOf(n)&&this.h.push(n),n.then(function(){return t.remove(n)}).catch(function(){return t.remove(n).catch(function(){})}),n):Promise.reject(new f("Not adding Promise due to buffer limit reached."))},n.prototype.remove=function(n){return this.h.splice(this.h.indexOf(n),1)[0]},n.prototype.length=function(){return this.h.length},n.prototype.drain=function(n){var t=this;return new Promise(function(r){var e=setTimeout(function(){n&&n>0&&r(!1)},n);Promise.all(t.h).then(function(){clearTimeout(e),r(!0)}).catch(function(){r(!0)})})},n}();function F(n,t){return void 0===t&&(t=0),"string"!=typeof n||0===t?n:n.length<=t?n:n.substr(0,t)+"..."}function P(n,t){if(!Array.isArray(n))return"";for(var r=[],e=0;e<n.length;e++){var i=n[e];try{r.push(String(i))}catch(n){r.push("[value cannot be serialized]")}}return r.join(t)}function $(n,t){if(void 0===t&&(t=40),!n.length)return"[object has no keys]";if(n[0].length>=t)return F(n[0],t);for(var r=n.length;r>0;r--){var e=n.slice(0,r).join(", ");if(!(e.length>t))return r===n.length?e:F(e,t)}return""}function q(n,t){return r=t,"[object RegExp]"===Object.prototype.toString.call(r)?t.test(n):"string"==typeof t&&n.includes(t);var r}function H(){if(!("fetch"in w()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(n){return!1}}function W(){if(!H())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(n){return!1}}!function(n){n.PENDING="PENDING",n.RESOLVED="RESOLVED",n.REJECTED="REJECTED"}(M||(M={}));var B=function(){function n(n){var t=this;this.l=M.PENDING,this.v=[],this.p=function(n){t.m(n,M.RESOLVED)},this.g=function(n){t.m(n,M.REJECTED)},this.m=function(n,r){t.l===M.PENDING&&(y(n)?n.then(t.p,t.g):(t.j=n,t.l=r,t._()))},this._=function(){t.l!==M.PENDING&&(t.l===M.REJECTED?t.v.forEach(function(n){return n.onFail&&n.onFail(t.j)}):t.v.forEach(function(n){return n.onSuccess&&n.onSuccess(t.j)}),t.v=[])},this.S=function(n){t.v=t.v.concat(n),t._()};try{n(this.p,this.g)}catch(n){this.g(n)}}return n.prototype.then=function(t,r){var e=this;return new n(function(n,i){e.S({onFail:function(t){if(r)try{return void n(r(t))}catch(n){return void i(n)}else i(t)},onSuccess:function(r){if(t)try{return void n(t(r))}catch(n){return void i(n)}else n(r)}})})},n.prototype.catch=function(n){return this.then(function(n){return n},n)},n.prototype.toString=function(){return"[object SyncPromise]"},n.resolve=function(t){return new n(function(n){n(t)})},n.reject=function(t){return new n(function(n,r){r(t)})},n}(),J=/^[ \t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \t]*$/,X=function(){function n(n,t,r,e){void 0===n&&(n=g()),void 0===t&&(t=g().substring(16)),this.O=n,this.k=t,this.T=r,this.R=e}return n.prototype.setParent=function(n){return this.R=n,this},n.prototype.setSampled=function(n){return this.T=n,this},n.fromTraceparent=function(t){var r=t.match(J);if(r){var e=void 0;"1"===r[3]?e=!0:"0"===r[3]&&(e=!1);var i=new n(r[1],r[2],e);return new n(r[1],void 0,e,i)}},n.prototype.toTraceparent=function(){var n="";return!0===this.T?n="-1":!1===this.T&&(n="-0"),this.O+"-"+this.k+n},n.prototype.toJSON=function(){return{parent:this.R&&this.R.toJSON()||void 0,sampled:this.T,span_id:this.k,trace_id:this.O}},n}(),G=function(){function n(){this.D=!1,this.I=[],this.C=[],this.N=[],this.A={},this.L={},this.M={},this.U={}}return n.prototype.addScopeListener=function(n){this.I.push(n)},n.prototype.addEventProcessor=function(n){return this.C.push(n),this},n.prototype.F=function(){var n=this;this.D||(this.D=!0,setTimeout(function(){n.I.forEach(function(t){t(n)}),n.D=!1}))},n.prototype.P=function(n,t,r,e){var i=this;return void 0===e&&(e=0),new B(function(o,c){var s=n[e];if(null===t||"function"!=typeof s)o(t);else{var a=s(u({},t),r);y(a)?a.then(function(t){return i.P(n,t,r,e+1).then(o)}).catch(c):i.P(n,a,r,e+1).then(o).catch(c)}})},n.prototype.setUser=function(n){return this.A=L(n),this.F(),this},n.prototype.setTags=function(n){return this.L=u({},this.L,L(n)),this.F(),this},n.prototype.setTag=function(n,t){var r;return this.L=u({},this.L,((r={})[n]=L(t),r)),this.F(),this},n.prototype.setExtras=function(n){return this.M=u({},this.M,L(n)),this.F(),this},n.prototype.setExtra=function(n,t){var r;return this.M=u({},this.M,((r={})[n]=L(t),r)),this.F(),this},n.prototype.setFingerprint=function(n){return this.$=L(n),this.F(),this},n.prototype.setLevel=function(n){return this.q=L(n),this.F(),this},n.prototype.setTransaction=function(n){return this.H=n,this.F(),this},n.prototype.setContext=function(n,t){return this.U[n]=t?L(t):void 0,this.F(),this},n.prototype.setSpan=function(n){return this.W=n,this.F(),this},n.prototype.startSpan=function(n){var t=new X;return t.setParent(n),this.setSpan(t),t},n.prototype.getSpan=function(){return this.W},n.clone=function(t){var r=new n;return Object.assign(r,t,{I:[]}),t&&(r.N=s(t.N),r.L=u({},t.L),r.M=u({},t.M),r.U=u({},t.U),r.A=t.A,r.q=t.q,r.W=t.W,r.H=t.H,r.$=t.$,r.C=s(t.C)),r},n.prototype.clear=function(){return this.N=[],this.L={},this.M={},this.A={},this.U={},this.q=void 0,this.H=void 0,this.$=void 0,this.W=void 0,this.F(),this},n.prototype.addBreadcrumb=function(n,t){var r=(new Date).getTime()/1e3,e=u({timestamp:r},n);return this.N=void 0!==t&&t>=0?s(this.N,[L(e)]).slice(-t):s(this.N,[L(e)]),this.F(),this},n.prototype.clearBreadcrumbs=function(){return this.N=[],this.F(),this},n.prototype.B=function(n){n.fingerprint=n.fingerprint?Array.isArray(n.fingerprint)?n.fingerprint:[n.fingerprint]:[],this.$&&(n.fingerprint=n.fingerprint.concat(this.$)),n.fingerprint&&!n.fingerprint.length&&delete n.fingerprint},n.prototype.applyToEvent=function(n,t){return this.M&&Object.keys(this.M).length&&(n.extra=u({},this.M,n.extra)),this.L&&Object.keys(this.L).length&&(n.tags=u({},this.L,n.tags)),this.A&&Object.keys(this.A).length&&(n.user=u({},this.A,n.user)),this.U&&Object.keys(this.U).length&&(n.contexts=u({},this.U,n.contexts)),this.q&&(n.level=this.q),this.H&&(n.transaction=this.H),this.W&&(n.contexts=n.contexts||{},n.contexts.trace=this.W),this.B(n),n.breadcrumbs=s(n.breadcrumbs||[],this.N),n.breadcrumbs=n.breadcrumbs.length>0?n.breadcrumbs:void 0,this.P(s(z(),this.C),n,t)},n}();function z(){var n=w();return n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.globalEventProcessors=n.__SENTRY__.globalEventProcessors||[],n.__SENTRY__.globalEventProcessors}function V(n){z().push(n)}var K=3,Z=function(){function n(n,t,r){void 0===t&&(t=new G),void 0===r&&(r=K),this.J=r,this.X=[],this.X.push({client:n,scope:t})}return n.prototype.G=function(n){for(var t,r=[],e=1;e<arguments.length;e++)r[e-1]=arguments[e];var i=this.getStackTop();i&&i.client&&i.client[n]&&(t=i.client)[n].apply(t,s(r,[i.scope]))},n.prototype.isOlderThan=function(n){return this.J<n},n.prototype.bindClient=function(n){this.getStackTop().client=n},n.prototype.pushScope=function(){var n=this.getStack(),t=n.length>0?n[n.length-1].scope:void 0,r=G.clone(t);return this.getStack().push({client:this.getClient(),scope:r}),r},n.prototype.popScope=function(){return void 0!==this.getStack().pop()},n.prototype.withScope=function(n){var t=this.pushScope();try{n(t)}finally{this.popScope()}},n.prototype.getClient=function(){return this.getStackTop().client},n.prototype.getScope=function(){return this.getStackTop().scope},n.prototype.getStack=function(){return this.X},n.prototype.getStackTop=function(){return this.X[this.X.length-1]},n.prototype.captureException=function(n,t){var r=this.V=g(),e=t;if(!t){var i=void 0;try{throw new Error("Sentry syntheticException")}catch(n){i=n}e={originalException:n,syntheticException:i}}return this.G("captureException",n,u({},e,{event_id:r})),r},n.prototype.captureMessage=function(n,t,r){var e=this.V=g(),i=r;if(!r){var o=void 0;try{throw new Error(n)}catch(n){o=n}i={originalException:n,syntheticException:o}}return this.G("captureMessage",n,t,u({},i,{event_id:e})),e},n.prototype.captureEvent=function(n,t){var r=this.V=g();return this.G("captureEvent",n,u({},t,{event_id:r})),r},n.prototype.lastEventId=function(){return this.V},n.prototype.addBreadcrumb=function(n,t){var r=this.getStackTop();if(r.scope&&r.client){var e=r.client.getOptions&&r.client.getOptions()||{},i=e.beforeBreadcrumb,o=void 0===i?null:i,c=e.maxBreadcrumbs,s=void 0===c?30:c;if(!(s<=0)){var a=(new Date).getTime()/1e3,f=u({timestamp:a},n),h=o?j(function(){return o(f,t)}):f;null!==h&&r.scope.addBreadcrumb(h,Math.min(s,100))}}},n.prototype.setUser=function(n){var t=this.getStackTop();t.scope&&t.scope.setUser(n)},n.prototype.setTags=function(n){var t=this.getStackTop();t.scope&&t.scope.setTags(n)},n.prototype.setExtras=function(n){var t=this.getStackTop();t.scope&&t.scope.setExtras(n)},n.prototype.setTag=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setTag(n,t)},n.prototype.setExtra=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setExtra(n,t)},n.prototype.setContext=function(n,t){var r=this.getStackTop();r.scope&&r.scope.setContext(n,t)},n.prototype.configureScope=function(n){var t=this.getStackTop();t.scope&&t.client&&n(t.scope)},n.prototype.run=function(n){var t=Y(this);try{n(this)}finally{Y(t)}},n.prototype.getIntegration=function(n){var t=this.getClient();if(!t)return null;try{return t.getIntegration(n)}catch(t){return T.warn("Cannot retrieve integration "+n.id+" from the current Hub"),null}},n.prototype.traceHeaders=function(){var n=this.getStackTop();if(n.scope&&n.client){var t=n.scope.getSpan();if(t)return{"sentry-trace":t.toTraceparent()}}return{}},n}();function Q(){var n=w();return n.__SENTRY__=n.__SENTRY__||{hub:void 0},n}function Y(n){var t=Q(),r=rn(t);return en(t,n),r}function nn(){var n,t,r=Q();tn(r)&&!rn(r).isOlderThan(K)||en(r,new Z);try{var e=(n=module,t="domain",n.require(t)).active;if(!e)return rn(r);if(!tn(e)||rn(e).isOlderThan(K)){var i=rn(r).getStackTop();en(e,new Z(i.client,G.clone(i.scope)))}return rn(e)}catch(n){return rn(r)}}function tn(n){return!!(n&&n.__SENTRY__&&n.__SENTRY__.hub)}function rn(n){return n&&n.__SENTRY__&&n.__SENTRY__.hub?n.__SENTRY__.hub:(n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.hub=new Z,n.__SENTRY__.hub)}function en(n,t){return!!n&&(n.__SENTRY__=n.__SENTRY__||{},n.__SENTRY__.hub=t,!0)}function on(n){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var e=nn();if(e&&e[n])return e[n].apply(e,s(t));throw new Error("No hub defined or "+n+" was not found on the hub, please open a bug report.")}function captureException(n){var t;try{throw new Error("Sentry syntheticException")}catch(n){t=n}return on("captureException",n,{originalException:n,syntheticException:t})}function un(n){on("withScope",n)}var cn=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w\.-]+)(?::(\d+))?\/(.+)/,sn=function(){function n(n){"string"==typeof n?this.K(n):this.Z(n),this.Y()}return n.prototype.toString=function(n){void 0===n&&(n=!1);var t=this,r=t.host,e=t.path,i=t.pass,o=t.port,u=t.projectId;return t.protocol+"://"+t.user+(n&&i?":"+i:"")+"@"+r+(o?":"+o:"")+"/"+(e?e+"/":e)+u},n.prototype.K=function(n){var t=cn.exec(n);if(!t)throw new f("Invalid Dsn");var r=c(t.slice(1),6),e=r[0],i=r[1],o=r[2],u=void 0===o?"":o,s=r[3],a=r[4],h=void 0===a?"":a,l="",v=r[5],d=v.split("/");d.length>1&&(l=d.slice(0,-1).join("/"),v=d.pop()),Object.assign(this,{host:s,pass:u,path:l,projectId:v,port:h,protocol:e,user:i})},n.prototype.Z=function(n){this.protocol=n.protocol,this.user=n.user,this.pass=n.pass||"",this.host=n.host,this.port=n.port||"",this.path=n.path||"",this.projectId=n.projectId},n.prototype.Y=function(){var n=this;if(["protocol","user","host","projectId"].forEach(function(t){if(!n[t])throw new f("Invalid Dsn")}),"http"!==this.protocol&&"https"!==this.protocol)throw new f("Invalid Dsn");if(this.port&&Number.isNaN(parseInt(this.port,10)))throw new f("Invalid Dsn")},n}(),an=function(){function n(n){this.dsn=n,this.nn=new sn(n)}return n.prototype.getDsn=function(){return this.nn},n.prototype.getStoreEndpoint=function(){return""+this.tn()+this.getStoreEndpointPath()},n.prototype.getStoreEndpointWithUrlEncodedAuth=function(){var n,t={sentry_key:this.nn.user,sentry_version:"7"};return this.getStoreEndpoint()+"?"+(n=t,Object.keys(n).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(n[t])}).join("&"))},n.prototype.tn=function(){var n=this.nn,t=n.protocol?n.protocol+":":"",r=n.port?":"+n.port:"";return t+"//"+n.host+r},n.prototype.getStoreEndpointPath=function(){var n=this.nn;return(n.path?"/"+n.path:"")+"/api/"+n.projectId+"/store/"},n.prototype.getRequestHeaders=function(n,t){var r=this.nn,e=["Sentry sentry_version=7"];return e.push("sentry_timestamp="+(new Date).getTime()),e.push("sentry_client="+n+"/"+t),e.push("sentry_key="+r.user),r.pass&&e.push("sentry_secret="+r.pass),{"Content-Type":"application/json","X-Sentry-Auth":e.join(", ")}},n.prototype.getReportDialogEndpoint=function(n){void 0===n&&(n={});var t=this.nn,r=this.tn()+(t.path?"/"+t.path:"")+"/api/embed/error-page/",e=[];for(var i in e.push("dsn="+t.toString()),n)if("user"===i){if(!n.user)continue;n.user.name&&e.push("name="+encodeURIComponent(n.user.name)),n.user.email&&e.push("email="+encodeURIComponent(n.user.email))}else e.push(encodeURIComponent(i)+"="+encodeURIComponent(n[i]));return e.length?r+"?"+e.join("&"):r},n}(),fn=[];function hn(n){var t={};return function(n){var t=n.defaultIntegrations&&s(n.defaultIntegrations)||[],r=n.integrations,e=[];if(Array.isArray(r)){var i=r.map(function(n){return n.name}),o=[];t.forEach(function(n){-1===i.indexOf(n.name)&&-1===o.indexOf(n.name)&&(e.push(n),o.push(n.name))}),r.forEach(function(n){-1===o.indexOf(n.name)&&(e.push(n),o.push(n.name))})}else{if("function"!=typeof r)return s(t);e=r(t),e=Array.isArray(e)?e:[e]}return e}(n).forEach(function(n){t[n.name]=n,function(n){-1===fn.indexOf(n.name)&&(n.setupOnce(V,nn),fn.push(n.name),T.log("Integration installed: "+n.name))}(n)}),t}var ln,vn=function(){function n(n,t){this.rn=!1,this.en=new n(t),this.in=t,t.dsn&&(this.on=new sn(t.dsn)),this.un=hn(this.in)}return n.prototype.captureException=function(n,t,r){var e=this,i=t&&t.event_id;return this.rn=!0,this.cn().eventFromException(n,t).then(function(n){return e.sn(n,t,r)}).then(function(n){i=n&&n.event_id,e.rn=!1}).catch(function(n){T.error(n),e.rn=!1}),i},n.prototype.captureMessage=function(n,t,r,e){var i=this,o=r&&r.event_id;return this.rn=!0,(p(n)?this.cn().eventFromMessage(""+n,t,r):this.cn().eventFromException(n,r)).then(function(n){return i.sn(n,r,e)}).then(function(n){o=n&&n.event_id,i.rn=!1}).catch(function(n){T.error(n),i.rn=!1}),o},n.prototype.captureEvent=function(n,t,r){var e=this,i=t&&t.event_id;return this.rn=!0,this.sn(n,t,r).then(function(n){i=n&&n.event_id,e.rn=!1}).catch(function(n){T.error(n),e.rn=!1}),i},n.prototype.getDsn=function(){return this.on},n.prototype.getOptions=function(){return this.in},n.prototype.flush=function(n){var t=this;return this.an(n).then(function(r){return clearInterval(r.interval),t.cn().getTransport().close(n).then(function(n){return r.ready&&n})})},n.prototype.close=function(n){var t=this;return this.flush(n).then(function(n){return t.getOptions().enabled=!1,n})},n.prototype.getIntegrations=function(){return this.un||{}},n.prototype.getIntegration=function(n){try{return this.un[n.id]||null}catch(t){return T.warn("Cannot retrieve integration "+n.id+" from the current Client"),null}},n.prototype.an=function(n){var t=this;return new Promise(function(r){var e=0,i=0;clearInterval(i),i=setInterval(function(){t.rn?(e+=1,n&&e>=n&&r({interval:i,ready:!1})):r({interval:i,ready:!0})},1)})},n.prototype.cn=function(){return this.en},n.prototype.fn=function(){return!1!==this.getOptions().enabled&&void 0!==this.on},n.prototype.hn=function(n,t,r){var e=this.getOptions(),i=e.environment,o=e.release,c=e.dist,s=e.maxValueLength,a=void 0===s?250:s,f=u({},n);void 0===f.environment&&void 0!==i&&(f.environment=i),void 0===f.release&&void 0!==o&&(f.release=o),void 0===f.dist&&void 0!==c&&(f.dist=c),f.message&&(f.message=F(f.message,a));var h=f.exception&&f.exception.values&&f.exception.values[0];h&&h.value&&(h.value=F(h.value,a));var l=f.request;l&&l.url&&(l.url=F(l.url,a)),void 0===f.event_id&&(f.event_id=g()),this.ln(f.sdk);var v=B.resolve(f);return t&&(v=t.applyToEvent(f,r)),v},n.prototype.ln=function(n){var t=Object.keys(this.un);n&&t.length>0&&(n.integrations=t)},n.prototype.sn=function(n,t,r){var e=this,i=this.getOptions(),o=i.beforeSend,u=i.sampleRate;return this.fn()?"number"==typeof u&&Math.random()>u?B.reject("This event has been sampled, will not send event."):new B(function(i,u){e.hn(n,r,t).then(function(n){if(null!==n){var r=n;try{if(t&&t.data&&!0===t.data.__sentry__||!o)return e.cn().sendEvent(r),void i(r);var c=o(n,t);if(void 0===c)T.error("`beforeSend` method has to return `null` or a valid event.");else if(y(c))e.vn(c,i,u);else{if(null===(r=c))return T.log("`beforeSend` returned `null`, will not send event."),void i(null);e.cn().sendEvent(r),i(r)}}catch(n){e.captureException(n,{data:{__sentry__:!0},originalException:n}),u("`beforeSend` throw an error, will not send event.")}}else u("An event processor returned null, will not send event.")})}):B.reject("SDK not enabled, will not send event.")},n.prototype.vn=function(n,t,r){var e=this;n.then(function(n){null!==n?(e.cn().sendEvent(n),t(n)):r("`beforeSend` returned `null`, will not send event.")}).catch(function(n){r("beforeSend rejected with "+n)})},n}(),dn=function(){function t(){}return t.prototype.sendEvent=function(t){return Promise.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:n.Status.Skipped})},t.prototype.close=function(n){return Promise.resolve(!0)},t}(),pn=function(){function n(n){this.in=n,this.in.dsn||T.warn("No DSN provided, backend will not do anything."),this.dn=this.pn()}return n.prototype.pn=function(){return new dn},n.prototype.eventFromException=function(n,t){throw new f("Backend has to implement `eventFromException` method")},n.prototype.eventFromMessage=function(n,t,r){throw new f("Backend has to implement `eventFromMessage` method")},n.prototype.sendEvent=function(n){this.dn.sendEvent(n).catch(function(n){T.error("Error while sending event: "+n)})},n.prototype.getTransport=function(){return this.dn},n}();var mn=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){ln=Function.prototype.toString,Function.prototype.toString=function(){for(var n=[],t=0;t<arguments.length;t++)n[t]=arguments[t];var r=this.__sentry__?this.__sentry_original__:this;return ln.apply(r,n)}},n.id="FunctionToString",n}(),yn=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],bn=function(){function n(t){void 0===t&&(t={}),this.in=t,this.name=n.id}return n.prototype.setupOnce=function(){V(function(t){var r=nn();if(!r)return t;var e=r.getIntegration(n);if(e){var i=r.getClient(),o=i?i.getOptions():{},u=e.mn(o);if(e.yn(t,u))return null}return t})},n.prototype.yn=function(n,t){return this.bn(n,t)?(T.warn("Event dropped due to being internal Sentry Error.\nEvent: "+x(n)),!0):this.wn(n,t)?(T.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+x(n)),!0):this.gn(n,t)?(T.warn("Event dropped due to being matched by `blacklistUrls` option.\nEvent: "+x(n)+".\nUrl: "+this.En(n)),!0):!this.xn(n,t)&&(T.warn("Event dropped due to not being matched by `whitelistUrls` option.\nEvent: "+x(n)+".\nUrl: "+this.En(n)),!0)},n.prototype.bn=function(n,t){if(void 0===t&&(t={}),!t.ignoreInternal)return!1;try{return"SentryError"===n.exception.values[0].type}catch(n){return!1}},n.prototype.wn=function(n,t){return void 0===t&&(t={}),!(!t.ignoreErrors||!t.ignoreErrors.length)&&this.jn(n).some(function(n){return t.ignoreErrors.some(function(t){return q(n,t)})})},n.prototype.gn=function(n,t){if(void 0===t&&(t={}),!t.blacklistUrls||!t.blacklistUrls.length)return!1;var r=this.En(n);return!!r&&t.blacklistUrls.some(function(n){return q(r,n)})},n.prototype.xn=function(n,t){if(void 0===t&&(t={}),!t.whitelistUrls||!t.whitelistUrls.length)return!0;var r=this.En(n);return!r||t.whitelistUrls.some(function(n){return q(r,n)})},n.prototype.mn=function(n){return void 0===n&&(n={}),{blacklistUrls:s(this.in.blacklistUrls||[],n.blacklistUrls||[]),ignoreErrors:s(this.in.ignoreErrors||[],n.ignoreErrors||[],yn),ignoreInternal:void 0===this.in.ignoreInternal||this.in.ignoreInternal,whitelistUrls:s(this.in.whitelistUrls||[],n.whitelistUrls||[])}},n.prototype.jn=function(n){if(n.message)return[n.message];if(n.exception)try{var t=n.exception.values[0],r=t.type,e=t.value;return[""+e,r+": "+e]}catch(t){return T.error("Cannot extract message for event "+x(n)),[]}return[]},n.prototype.En=function(n){try{if(n.stacktrace){var t=n.stacktrace.frames;return t[t.length-1].filename}if(n.exception){var r=n.exception.values[0].stacktrace.frames;return r[r.length-1].filename}return null}catch(t){return T.error("Cannot extract url for event "+x(n)),null}},n.id="InboundFilters",n}(),wn=Object.freeze({FunctionToString:mn,InboundFilters:bn}),gn=w(),En={_n:!1,Sn:!1,On:!1,kn:!1},xn="?",jn=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/;function _n(n,t){return Object.prototype.hasOwnProperty.call(n,t)}function Sn(){return"undefined"==typeof document||null==document.location?"":document.location.href}En._n=function(){var n,t,r=[],e=null,i=null;function o(n,t,e){var i=null;if(!t||En.Sn){for(var o in r)if(_n(r,o))try{r[o](n,t,e)}catch(n){i=n}if(i)throw i}}function c(t,r,e,c,s){var f=null;if(s=l(s)?s.error:s,t=l(t)?t.message:t,i)En.On.Tn(i,r,e,t),a();else if(s&&h(s))(f=En.On(s)).mechanism="onerror",o(f,!0,s);else{var v,d={url:r,line:e,column:c},p=t;if("[object String]"==={}.toString.call(t)){var m=t.match(jn);m&&(v=m[1],p=m[2])}d.func=xn,d.context=null,o(f={name:v,message:p,mode:"onerror",mechanism:"onerror",stack:[u({},d,{url:d.url||Sn()})]},!0,null)}return!!n&&n.apply(this,arguments)}function s(n){var t=n&&(n.detail?n.detail.reason:n.reason)||n,r=En.On(t);r.mechanism="onunhandledrejection",r.message||(r.message=JSON.stringify(L(t))),o(r,!0,t)}function a(){var n=i,t=e;i=null,e=null,o(n,!1,t)}function f(n){if(i){if(e===n)return;a()}var t=En.On(n);throw i=t,e=n,setTimeout(function(){e===n&&a()},t.incomplete?2e3:0),n}return f.Rn=function(n){r.push(n)},f.Dn=function(){!0!==t&&(n=gn.onerror,gn.onerror=c,t=!0)},f.In=function(){gn.onunhandledrejection=s},f}(),En.On=function(){function n(n){if(!n||!n.stack)return null;for(var t,r,e,i=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|native|eval|webpack|<anonymous>|[a-z]:|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,o=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js))(?::(\d+))?(?::(\d+))?\s*$/i,u=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,c=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,s=/\((\S*)(?::(\d+))(?::(\d+))\)/,a=n.stack.split("\n"),f=[],h=/^(.*) is undefined$/.exec(n.message),l=0,v=a.length;l<v;++l){if(r=i.exec(a[l])){var d=r[2]&&0===r[2].indexOf("native");r[2]&&0===r[2].indexOf("eval")&&(t=s.exec(r[2]))&&(r[2]=t[1],r[3]=t[2],r[4]=t[3]),e={url:r[2],func:r[1]||xn,args:d?[r[2]]:[],line:r[3]?+r[3]:null,column:r[4]?+r[4]:null}}else if(r=u.exec(a[l]))e={url:r[2],func:r[1]||xn,args:[],line:+r[3],column:r[4]?+r[4]:null};else{if(!(r=o.exec(a[l])))continue;r[3]&&r[3].indexOf(" > eval")>-1&&(t=c.exec(r[3]))?(r[1]=r[1]||"eval",r[3]=t[1],r[4]=t[2],r[5]=""):0!==l||r[5]||void 0===n.columnNumber||(f[0].column=n.columnNumber+1),e={url:r[3],func:r[1]||xn,args:r[2]?r[2].split(","):[],line:r[4]?+r[4]:null,column:r[5]?+r[5]:null}}!e.func&&e.line&&(e.func=xn),e.context=null,f.push(e)}return f.length?(f[0]&&f[0].line&&!f[0].column&&h&&(f[0].column=null),{mode:"stack",name:n.name,message:n.message,stack:f}):null}function t(n,t,r,e){var i={url:t,line:r};if(i.url&&i.line){if(n.incomplete=!1,i.func||(i.func=xn),i.context||(i.context=null),/ '([^']+)' /.exec(e)&&(i.column=null),n.stack.length>0&&n.stack[0].url===i.url){if(n.stack[0].line===i.line)return!1;if(!n.stack[0].line&&n.stack[0].func===i.func)return n.stack[0].line=i.line,n.stack[0].context=i.context,!1}return n.stack.unshift(i),n.partial=!0,!0}return n.incomplete=!0,!1}function r(n,e){for(var i,o,u=/function\s+([_$a-zA-Z\xA0-\uFFFF][_$a-zA-Z0-9\xA0-\uFFFF]*)?\s*\(/i,c=[],s={},a=!1,f=r.caller;f&&!a;f=f.caller)if(f!==Rn&&f!==En._n){if(o={url:null,func:xn,args:[],line:null,column:null},f.name?o.func=f.name:(i=u.exec(f.toString()))&&(o.func=i[1]),void 0===o.func)try{o.func=i.input.substring(0,i.input.indexOf("{"))}catch(n){}s[""+f]?a=!0:s[""+f]=!0,c.push(o)}e&&c.splice(0,e);var h={mode:"callers",name:n.name,message:n.message,stack:c};return t(h,n.sourceURL||n.fileName,n.line||n.lineNumber,n.message||n.description),h}function e(t,e){var i=null;e=null==e?0:+e;try{if(i=function(n){var t=n.stacktrace;if(t){for(var r,e=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,i=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^\)]+))\((.*)\))? in (.*):\s*$/i,o=t.split("\n"),u=[],c=0;c<o.length;c+=2){var s=null;(r=e.exec(o[c]))?s={url:r[2],line:+r[1],column:null,func:r[3],args:[]}:(r=i.exec(o[c]))&&(s={url:r[6],line:+r[1],column:+r[2],func:r[3]||r[4],args:r[5]?r[5].split(","):[]}),s&&(!s.func&&s.line&&(s.func=xn),s.line&&(s.context=null),s.context||(s.context=[o[c+1]]),u.push(s))}return u.length?{mode:"stacktrace",name:n.name,message:n.message,stack:u}:null}}(t))return i}catch(n){}try{if(i=n(t))return i}catch(n){}try{if(i=function(n){var t=n.message.split("\n");if(t.length<4)return null;var r,e=/^\s*Line (\d+) of linked script ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,i=/^\s*Line (\d+) of inline#(\d+) script in ((?:file|https?|blob)\S+)(?:: in function (\S+))?\s*$/i,o=/^\s*Line (\d+) of function script\s*$/i,u=[],c=gn&&gn.document&&gn.document.getElementsByTagName("script"),s=[];for(var a in c)_n(c,a)&&!c[a].src&&s.push(c[a]);for(var f=2;f<t.length;f+=2){var h=null;(r=e.exec(t[f]))?h={url:r[2],func:r[3],args:[],line:+r[1],column:null}:(r=i.exec(t[f]))?h={url:r[3],func:r[4],args:[],line:+r[1],column:null}:(r=o.exec(t[f]))&&(h={url:Sn().replace(/#.*$/,""),func:"",args:[],line:r[1],column:null}),h&&(h.func||(h.func=xn),h.context=[t[f+1]],u.push(h))}return u.length?{mode:"multiline",name:n.name,message:t[0],stack:u}:null}(t))return i}catch(n){}try{if(i=r(t,e+1))return i}catch(n){}return{original:t,name:t.name,message:t.message,mode:"failed"}}return e.Tn=t,e.Cn=n,e}(),En.Sn=!0,En.kn=11;var On=En._n.Rn,kn=En._n.Dn,Tn=En._n.In,Rn=En.On,Dn=50;function In(n){var t=Nn(n.stack),r={type:n.name,value:n.message};return t&&t.length&&(r.stacktrace={frames:t}),void 0===r.type&&""===r.value&&(r.value="Unrecoverable error caught"),r}function Cn(n){return{exception:{values:[In(n)]}}}function Nn(n){if(!n||!n.length)return[];var t=n,r=t[0].func||"",e=t[t.length-1].func||"";return(r.includes("captureMessage")||r.includes("captureException"))&&(t=t.slice(1)),e.includes("sentryWrapped")&&(t=t.slice(0,-1)),t.map(function(n){return{colno:n.column,filename:n.url||t[0].url,function:n.func||"?",in_app:!0,lineno:n.line}}).slice(0,Dn).reverse()}var An,Ln,Mn=function(){function n(n){this.options=n,this.h=new U(30),this.url=new an(this.options.dsn).getStoreEndpointWithUrlEncodedAuth()}return n.prototype.sendEvent=function(n){throw new f("Transport Class has to implement `sendEvent` method")},n.prototype.close=function(n){return this.h.drain(n)},n}(),Un=w(),Fn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.sendEvent=function(t){var r={body:JSON.stringify(t),method:"POST",referrerPolicy:W()?"origin":""};return this.h.add(Un.fetch(this.url,r).then(function(t){return{status:n.Status.fromHttpCode(t.status)}}))},e}(Mn),Pn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.sendEvent=function(t){var r=this;return this.h.add(new Promise(function(e,i){var o=new XMLHttpRequest;o.onreadystatechange=function(){4===o.readyState&&(200===o.status&&e({status:n.Status.fromHttpCode(o.status)}),i(o))},o.open("POST",r.url),o.send(JSON.stringify(t))}))},e}(Mn),$n=Object.freeze({BaseTransport:Mn,FetchTransport:Fn,XHRTransport:Pn}),qn=function(t){function e(){return null!==t&&t.apply(this,arguments)||this}return r(e,t),e.prototype.pn=function(){if(!this.in.dsn)return t.prototype.pn.call(this);var n=u({},this.in.transportOptions,{dsn:this.in.dsn});return this.in.transport?new this.in.transport(n):H()?new Fn(n):new Pn(n)},e.prototype.eventFromException=function(t,r){var e,i,o=this;if(l(t)&&t.error)return t=t.error,e=Cn(Rn(t)),B.resolve(this.Nn(e,r));if(v(t)||(i=t,"[object DOMException]"===Object.prototype.toString.call(i))){var u=t,c=u.name||(v(u)?"DOMError":"DOMException"),s=u.message?c+": "+u.message:c;return this.eventFromMessage(s,n.Severity.Error,r).then(function(n){return _(n,s),B.resolve(o.Nn(n,r))})}if(h(t))return e=Cn(Rn(t)),B.resolve(this.Nn(e,r));if(m(t)&&r&&r.syntheticException)return _(e=function(n,t){var r=Object.keys(n).sort(),e={extra:{__serialized__:C(n)},message:"Non-Error exception captured with keys: "+$(r)};if(t){var i=Nn(Rn(t).stack);e.stacktrace={frames:i}}return e}(t,r.syntheticException),"Custom Object",void 0,{handled:!0,synthetic:!0,type:"generic"}),e.level=n.Severity.Error,B.resolve(this.Nn(e,r));var a=t;return this.eventFromMessage(a,void 0,r).then(function(t){return _(t,""+a,void 0,{handled:!0,synthetic:!0,type:"generic"}),t.level=n.Severity.Error,B.resolve(o.Nn(t,r))})},e.prototype.Nn=function(n,t){return u({},n,{event_id:t&&t.event_id})},e.prototype.eventFromMessage=function(t,r,e){void 0===r&&(r=n.Severity.Info);var i={event_id:e&&e.event_id,level:r,message:t};if(this.in.attachStacktrace&&e&&e.syntheticException){var o=Nn(Rn(e.syntheticException).stack);i.stacktrace={frames:o}}return B.resolve(i)},e}(pn),Hn="sentry.javascript.browser",Wn=function(n){function t(t){return void 0===t&&(t={}),n.call(this,qn,t)||this}return r(t,n),t.prototype.hn=function(t,r,e){return t.platform=t.platform||"javascript",t.sdk=u({},t.sdk,{name:Hn,packages:s(t.sdk&&t.sdk.packages||[],[{name:"npm:@sentry/browser",version:"5.5.0"}]),version:"5.5.0"}),n.prototype.hn.call(this,t,r,e)},t.prototype.showReportDialog=function(n){void 0===n&&(n={});var t=w().document;if(t)if(this.fn()){var r=n.dsn||this.getDsn();if(n.eventId)if(r){var e=t.createElement("script");e.async=!0,e.src=new an(r).getReportDialogEndpoint(n),n.onLoad&&(e.onload=n.onLoad),(t.head||t.body).appendChild(e)}else T.error("Missing `Dsn` option in showReportDialog call");else T.error("Missing `eventId` option in showReportDialog call")}else T.error("Trying to call showReportDialog with Sentry Client is disabled")},t}(vn),Bn=1e3,Jn=0;function Xn(n,t,r){if(void 0===t&&(t={}),"function"!=typeof n)return n;try{if(n.__sentry__)return n;if(n.__sentry_wrapped__)return n.__sentry_wrapped__}catch(t){return n}var sentryWrapped=function(){r&&"function"==typeof r&&r.apply(this,arguments);var e=Array.prototype.slice.call(arguments);try{var i=e.map(function(n){return Xn(n,t)});return n.handleEvent?n.handleEvent.apply(this,i):n.apply(this,i)}catch(n){throw Jn+=1,setTimeout(function(){Jn-=1}),un(function(r){r.addEventProcessor(function(n){var r=u({},n);return t.mechanism&&_(r,void 0,void 0,t.mechanism),r.extra=u({},r.extra,{arguments:L(e,3)}),r}),captureException(n)}),n}};try{for(var e in n)Object.prototype.hasOwnProperty.call(n,e)&&(sentryWrapped[e]=n[e])}catch(n){}n.prototype=n.prototype||{},sentryWrapped.prototype=n.prototype,Object.defineProperty(n,"__sentry_wrapped__",{enumerable:!1,value:sentryWrapped}),Object.defineProperties(sentryWrapped,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:n}});try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:function(){return n.name}})}catch(n){}return sentryWrapped}var Gn=0;function zn(n,t){return void 0===t&&(t=!1),function(r){if(An=void 0,r&&Ln!==r){Ln=r;var e=function(){var t;try{t=r.target?Kn(r.target):Kn(r)}catch(n){t="<unknown>"}0!==t.length&&nn().addBreadcrumb({category:"ui."+n,message:t},{event:r,name:n})};Gn&&clearTimeout(Gn),t?Gn=setTimeout(e):e()}}}function Vn(){return function(n){var t;try{t=n.target}catch(n){return}var r=t&&t.tagName;r&&("INPUT"===r||"TEXTAREA"===r||t.isContentEditable)&&(An||zn("input")(n),clearTimeout(An),An=setTimeout(function(){An=void 0},Bn))}}function Kn(n){for(var t,r=n,e=[],i=0,o=0,u=" > ".length;r&&i++<5&&!("html"===(t=Zn(r))||i>1&&o+e.length*u+t.length>=80);)e.push(t),o+=t.length,r=r.parentNode;return e.reverse().join(" > ")}function Zn(n){var t,r,e,i,o,u=[];if(!n||!n.tagName)return"";if(u.push(n.tagName.toLowerCase()),n.id&&u.push("#"+n.id),(t=n.className)&&d(t))for(r=t.split(/\s+/),o=0;o<r.length;o++)u.push("."+r[o]);var c=["type","name","title","alt"];for(o=0;o<c.length;o++)e=c[o],(i=n.getAttribute(e))&&u.push("["+e+'="'+i+'"]');return u.join("")}var Qn=function(){function n(t){this.name=n.id,this.in=u({onerror:!0,onunhandledrejection:!0},t)}return n.prototype.setupOnce=function(){Error.stackTraceLimit=50,On(function(t,r,e){if(!(Jn>0)){var i=nn().getIntegration(n);i&&nn().captureEvent(i.An(t),{data:{stack:t},originalException:e})}}),this.in.onerror&&(T.log("Global Handler attached: onerror"),kn()),this.in.onunhandledrejection&&(T.log("Global Handler attached: onunhandledrejection"),Tn())},n.prototype.An=function(n){if(!d(n.message)&&"onunhandledrejection"!==n.mechanism){var t=n.message;n.message=t.error&&d(t.error.message)?t.error.message:"No error message"}var r=Cn(n),e={mode:n.mode};n.message&&(e.message=n.message),n.name&&(e.name=n.name);var i=nn().getClient(),o=i&&i.getOptions().maxValueLength||250;return _(r,n.original?F(JSON.stringify(L(n.original)),o):"","onunhandledrejection"===n.mechanism?"UnhandledRejection":"Error",{data:e,handled:!1,type:n.mechanism}),r},n.id="GlobalHandlers",n}(),Yn=function(){function n(){this.Ln=0,this.name=n.id}return n.prototype.Mn=function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[0];return t[0]=Xn(e,{mechanism:{data:{function:nt(n)},handled:!0,type:"instrument"}}),n.apply(this,t)}},n.prototype.Un=function(n){return function(t){return n(Xn(t,{mechanism:{data:{function:"requestAnimationFrame",handler:nt(n)},handled:!0,type:"instrument"}}))}},n.prototype.Fn=function(n){var t=w(),r=t[n]&&t[n].prototype;r&&r.hasOwnProperty&&r.hasOwnProperty("addEventListener")&&(D(r,"addEventListener",function(t){return function(r,e,i){try{"function"==typeof e.handleEvent&&(e.handleEvent=Xn(e.handleEvent.bind(e),{mechanism:{data:{function:"handleEvent",handler:nt(e),target:n},handled:!0,type:"instrument"}}))}catch(n){}return t.call(this,r,Xn(e,{mechanism:{data:{function:"addEventListener",handler:nt(e),target:n},handled:!0,type:"instrument"}}),i)}}),D(r,"removeEventListener",function(n){return function(t,r,e){var i=r;try{i=i&&(i.__sentry_wrapped__||i)}catch(n){}return n.call(this,t,i,e)}}))},n.prototype.setupOnce=function(){this.Ln=this.Ln;var n=w();D(n,"setTimeout",this.Mn.bind(this)),D(n,"setInterval",this.Mn.bind(this)),D(n,"requestAnimationFrame",this.Un.bind(this)),["EventTarget","Window","Node","ApplicationCache","AudioTrackList","ChannelMergerNode","CryptoOperation","EventSource","FileReader","HTMLUnknownElement","IDBDatabase","IDBRequest","IDBTransaction","KeyOperation","MediaController","MessagePort","ModalWindow","Notification","SVGElementInstance","Screen","TextTrack","TextTrackCue","TextTrackList","WebSocket","WebSocketWorker","Worker","XMLHttpRequest","XMLHttpRequestEventTarget","XMLHttpRequestUpload"].forEach(this.Fn.bind(this))},n.id="TryCatch",n}();function nt(n){try{return n&&n.name||"<anonymous>"}catch(n){return"<anonymous>"}}var tt,rt=w(),et=function(){function t(n){this.name=t.id,this.in=u({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},n)}return t.prototype.Pn=function(){"console"in rt&&["debug","info","warn","error","log","assert"].forEach(function(r){r in rt.console&&D(rt.console,r,function(e){return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var u={category:"console",data:{extra:{arguments:L(i,3)},logger:"console"},level:n.Severity.fromString(r),message:P(i," ")};"assert"===r&&!1===i[0]&&(u.message="Assertion failed: "+(P(i.slice(1)," ")||"console.assert"),u.data.extra.arguments=L(i.slice(1),3)),t.addBreadcrumb(u,{input:i,level:r}),e&&Function.prototype.apply.call(e,rt.console,i)}})})},t.prototype.$n=function(){"document"in rt&&(rt.document.addEventListener("click",zn("click"),!1),rt.document.addEventListener("keypress",Vn(),!1),["EventTarget","Node"].forEach(function(n){var t=rt[n]&&rt[n].prototype;t&&t.hasOwnProperty&&t.hasOwnProperty("addEventListener")&&(D(t,"addEventListener",function(n){return function(t,r,e){return r&&r.handleEvent?("click"===t&&D(r,"handleEvent",function(n){return function(t){return zn("click")(t),n.call(this,t)}}),"keypress"===t&&D(r,"handleEvent",function(n){return function(t){return Vn()(t),n.call(this,t)}})):("click"===t&&zn("click",!0)(this),"keypress"===t&&Vn()(this)),n.call(this,t,r,e)}}),D(t,"removeEventListener",function(n){return function(t,r,e){var i=r;try{i=i&&(i.__sentry_wrapped__||i)}catch(n){}return n.call(this,t,i,e)}}))}))},t.prototype.qn=function(){(function(){if(!H())return!1;var n=function(n){return-1!==n.toString().indexOf("native")},t=w(),r=null,e=t.document;if(e){var i=e.createElement("iframe");i.hidden=!0;try{e.head.appendChild(i),i.contentWindow&&i.contentWindow.fetch&&(r=n(i.contentWindow.fetch)),e.head.removeChild(i)}catch(n){T.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}}return null===r&&(r=n(t.fetch)),r})()&&D(rt,"fetch",function(r){return function(){for(var e=[],i=0;i<arguments.length;i++)e[i]=arguments[i];var o,u=e[0],c="GET";"string"==typeof u?o=u:"Request"in rt&&u instanceof Request?(o=u.url,u.method&&(c=u.method)):o=String(u),e[1]&&e[1].method&&(c=e[1].method);var s=nn().getClient(),a=s&&s.getDsn();if(a){var f=new an(a).getStoreEndpoint();if(f&&o.includes(f))return"POST"===c&&e[1]&&e[1].body&&it(e[1].body),r.apply(rt,e)}var h={method:c,url:o};return r.apply(rt,e).then(function(n){return h.status_code=n.status,t.addBreadcrumb({category:"fetch",data:h,type:"http"},{input:e,response:n}),n}).catch(function(r){throw t.addBreadcrumb({category:"fetch",data:h,level:n.Severity.Error,type:"http"},{error:r,input:e}),r})}})},t.prototype.Hn=function(){var n=this;if(r=w(),e=r.chrome,i=e&&e.app&&e.app.runtime,o="history"in r&&!!r.history.pushState&&!!r.history.replaceState,!i&&o){var r,e,i,o,u=function(n,r){var e=E(rt.location.href),i=E(r),o=E(n);o.path||(o=e),tt=r,e.protocol===i.protocol&&e.host===i.host&&(r=i.relative),e.protocol===o.protocol&&e.host===o.host&&(n=o.relative),t.addBreadcrumb({category:"navigation",data:{from:n,to:r}})},c=rt.onpopstate;rt.onpopstate=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=rt.location.href;if(u(tt,e),c)return c.apply(n,t)},D(rt.history,"pushState",s),D(rt.history,"replaceState",s)}function s(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t.length>2?t[2]:void 0;return e&&u(tt,String(e)),n.apply(this,t)}}},t.prototype.Wn=function(){if("XMLHttpRequest"in rt){var n=XMLHttpRequest.prototype;D(n,"open",function(n){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var e=t[1];this.__sentry_xhr__={method:t[0],url:t[1]};var i=nn().getClient(),o=i&&i.getDsn();if(o){var u=new an(o).getStoreEndpoint();d(e)&&u&&e.includes(u)&&(this.__sentry_own_request__=!0)}return n.apply(this,t)}}),D(n,"send",function(n){return function(){for(var r=[],e=0;e<arguments.length;e++)r[e]=arguments[e];var i=this;function o(){if(4===i.readyState){if(i.__sentry_own_request__)return;try{i.__sentry_xhr__&&(i.__sentry_xhr__.status_code=i.status)}catch(n){}t.addBreadcrumb({category:"xhr",data:i.__sentry_xhr__,type:"http"},{xhr:i})}}return i.__sentry_own_request__&&it(r[0]),["onload","onerror","onprogress"].forEach(function(n){!function(n,t){n in t&&"function"==typeof t[n]&&D(t,n,function(t){return Xn(t,{mechanism:{data:{function:n,handler:t&&t.name||"<anonymous>"},handled:!0,type:"instrument"}})})}(n,i)}),"onreadystatechange"in i&&"function"==typeof i.onreadystatechange?D(i,"onreadystatechange",function(n){return Xn(n,{mechanism:{data:{function:"onreadystatechange",handler:n&&n.name||"<anonymous>"},handled:!0,type:"instrument"}},o)}):i.onreadystatechange=o,n.apply(this,r)}})}},t.addBreadcrumb=function(n,r){nn().getIntegration(t)&&nn().addBreadcrumb(n,r)},t.prototype.setupOnce=function(){this.in.console&&this.Pn(),this.in.dom&&this.$n(),this.in.xhr&&this.Wn(),this.in.fetch&&this.qn(),this.in.history&&this.Hn()},t.id="Breadcrumbs",t}();function it(t){try{var r=JSON.parse(t);et.addBreadcrumb({category:"sentry",event_id:r.event_id,level:r.level||n.Severity.fromString("error"),message:x(r)},{event:r})}catch(n){T.error("Error while adding sentry type breadcrumb")}}var ot="cause",ut=5,ct=function(){function n(t){void 0===t&&(t={}),this.name=n.id,this.Bn=t.key||ot,this.s=t.limit||ut}return n.prototype.setupOnce=function(){V(function(t,r){var e=nn().getIntegration(n);return e?e.Jn(t,r):t})},n.prototype.Jn=function(n,t){if(!(n.exception&&n.exception.values&&t&&t.originalException instanceof Error))return n;var r=this.Xn(t.originalException,this.Bn);return n.exception.values=s(r,n.exception.values),n},n.prototype.Xn=function(n,t,r){if(void 0===r&&(r=[]),!(n[t]instanceof Error)||r.length+1>=this.s)return r;var e=In(Rn(n[t]));return this.Xn(n[t],t,s([e],r))},n.id="LinkedErrors",n}(),st=w(),at=function(){function n(){this.name=n.id}return n.prototype.setupOnce=function(){V(function(t){if(nn().getIntegration(n)){if(!st.navigator||!st.location)return t;var r=t.request||{};return r.url=r.url||st.location.href,r.headers=r.headers||{},r.headers["User-Agent"]=st.navigator.userAgent,u({},t,{request:r})}return t})},n.id="UserAgent",n}(),ft=Object.freeze({GlobalHandlers:Qn,TryCatch:Yn,Breadcrumbs:et,LinkedErrors:ct,UserAgent:at}),ht=[new bn,new mn,new Yn,new et,new Qn,new ct,new at];var lt={},vt=w();vt.Sentry&&vt.Sentry.Integrations&&(lt=vt.Sentry.Integrations);var dt=u({},lt,wn,ft);return n.BrowserClient=Wn,n.Hub=Z,n.Integrations=dt,n.SDK_NAME=Hn,n.SDK_VERSION="5.5.0",n.Scope=G,n.Span=X,n.Transports=$n,n.addBreadcrumb=function(n){on("addBreadcrumb",n)},n.addGlobalEventProcessor=V,n.captureEvent=function(n){return on("captureEvent",n)},n.captureException=captureException,n.captureMessage=function(n,t){var r;try{throw new Error(n)}catch(n){r=n}return on("captureMessage",n,t,{originalException:n,syntheticException:r})},n.close=function(n){var t=nn().getClient();return t?t.close(n):Promise.reject(!1)},n.configureScope=function(n){on("configureScope",n)},n.defaultIntegrations=ht,n.flush=function(n){var t=nn().getClient();return t?t.flush(n):Promise.reject(!1)},n.forceLoad=function(){},n.getCurrentHub=nn,n.getHubFromCarrier=rn,n.init=function(n){if(void 0===n&&(n={}),void 0===n.defaultIntegrations&&(n.defaultIntegrations=ht),void 0===n.release){var t=w();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(n.release=t.SENTRY_RELEASE.id)}!function(n,t){!0===t.debug&&T.enable(),nn().bindClient(new n(t))}(Wn,n)},n.lastEventId=function(){return nn().lastEventId()},n.onLoad=function(n){n()},n.setContext=function(n,t){on("setContext",n,t)},n.setExtra=function(n,t){on("setExtra",n,t)},n.setExtras=function(n){on("setExtras",n)},n.setTag=function(n,t){on("setTag",n,t)},n.setTags=function(n){on("setTags",n)},n.setUser=function(n){on("setUser",n)},n.showReportDialog=function(n){void 0===n&&(n={}),n.eventId||(n.eventId=nn().lastEventId());var t=nn().getClient();t&&t.showReportDialog(n)},n.withScope=un,n.wrap=function(n){Xn(n)()},n}({});