(function(U){typeof define=="function"&&define.amd?define(U):U()})(function(){"use strict";/*! *****************************************************************************
    Copyright (c) Microsoft Corporation.

    Permission to use, copy, modify, and/or distribute this software for any
    purpose with or without fee is hereby granted.

    THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
    REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
    AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
    INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
    LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
    OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
    PERFORMANCE OF THIS SOFTWARE.
    ***************************************************************************** */var U=function(e,t){return U=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,n){r.__proto__=n}||function(r,n){for(var i in n)n.hasOwnProperty(i)&&(r[i]=n[i])},U(e,t)};function V(e,t){U(e,t);function r(){this.constructor=e}e.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)}var c=function(){return c=Object.assign||function(t){for(var r,n=1,i=arguments.length;n<i;n++){r=arguments[n];for(var o in r)Object.prototype.hasOwnProperty.call(r,o)&&(t[o]=r[o])}return t},c.apply(this,arguments)};function he(e,t){var r={};for(var n in e)Object.prototype.hasOwnProperty.call(e,n)&&t.indexOf(n)<0&&(r[n]=e[n]);if(e!=null&&typeof Object.getOwnPropertySymbols=="function")for(var i=0,n=Object.getOwnPropertySymbols(e);i<n.length;i++)t.indexOf(n[i])<0&&Object.prototype.propertyIsEnumerable.call(e,n[i])&&(r[n[i]]=e[n[i]]);return r}function W(e){var t=typeof Symbol=="function"&&Symbol.iterator,r=t&&e[t],n=0;if(r)return r.call(e);if(e&&typeof e.length=="number")return{next:function(){return e&&n>=e.length&&(e=void 0),{value:e&&e[n++],done:!e}}};throw new TypeError(t?"Object is not iterable.":"Symbol.iterator is not defined.")}function Ct(e,t){var r=typeof Symbol=="function"&&e[Symbol.iterator];if(!r)return e;var n=r.call(e),i,o=[],s;try{for(;(t===void 0||t-- >0)&&!(i=n.next()).done;)o.push(i.value)}catch(a){s={error:a}}finally{try{i&&!i.done&&(r=n.return)&&r.call(n)}finally{if(s)throw s.error}}return o}function g(){for(var e=[],t=0;t<arguments.length;t++)e=e.concat(Ct(arguments[t]));return e}var A;(function(e){e.Ok="ok",e.Exited="exited",e.Crashed="crashed",e.Abnormal="abnormal"})(A||(A={}));var F;(function(e){e.Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical"})(F||(F={})),function(e){function t(r){switch(r){case"debug":return e.Debug;case"info":return e.Info;case"warn":case"warning":return e.Warning;case"error":return e.Error;case"fatal":return e.Fatal;case"critical":return e.Critical;case"log":default:return e.Log}}e.fromString=t}(F||(F={}));var I;(function(e){e.Unknown="unknown",e.Skipped="skipped",e.Success="success",e.RateLimit="rate_limit",e.Invalid="invalid",e.Failed="failed"})(I||(I={})),function(e){function t(r){return r>=200&&r<300?e.Success:r===429?e.RateLimit:r>=400&&r<500?e.Invalid:r>=500?e.Failed:e.Unknown}e.fromHttpCode=t}(I||(I={}));function Pt(e){switch(Object.prototype.toString.call(e)){case"[object Error]":return!0;case"[object Exception]":return!0;case"[object DOMException]":return!0;default:return k(e,Error)}}function Lt(e){return Object.prototype.toString.call(e)==="[object ErrorEvent]"}function Ut(e){return Object.prototype.toString.call(e)==="[object DOMError]"}function ge(e){return Object.prototype.toString.call(e)==="[object DOMException]"}function D(e){return Object.prototype.toString.call(e)==="[object String]"}function Y(e){return e===null||typeof e!="object"&&typeof e!="function"}function Z(e){return Object.prototype.toString.call(e)==="[object Object]"}function ut(e){return typeof Event<"u"&&k(e,Event)}function At(e){return typeof Element<"u"&&k(e,Element)}function ve(e){return Object.prototype.toString.call(e)==="[object RegExp]"}function ct(e){return!!(e&&e.then&&typeof e.then=="function")}function _e(e){return Z(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function k(e,t){try{return e instanceof t}catch{return!1}}function tt(e){try{for(var t=e,r=5,n=80,i=[],o=0,s=0,a=" > ",u=a.length,f=void 0;t&&o++<r&&(f=ye(t),!(f==="html"||o>1&&s+i.length*u+f.length>=n));)i.push(f),s+=f.length,t=t.parentNode;return i.reverse().join(a)}catch{return"<unknown>"}}function ye(e){var t=e,r=[],n,i,o,s,a;if(!t||!t.tagName)return"";if(r.push(t.tagName.toLowerCase()),t.id&&r.push("#"+t.id),n=t.className,n&&D(n))for(i=n.split(/\s+/),a=0;a<i.length;a++)r.push("."+i[a]);var u=["type","name","title","alt"];for(a=0;a<u.length;a++)o=u[a],s=t.getAttribute(o),s&&r.push("["+o+'="'+s+'"]');return r.join("")}var me=Object.setPrototypeOf||({__proto__:[]}instanceof Array?be:Ee);function be(e,t){return e.__proto__=t,e}function Ee(e,t){for(var r in t)e.hasOwnProperty(r)||(e[r]=t[r]);return e}var y=function(e){V(t,e);function t(r){var n=this.constructor,i=e.call(this,r)||this;return i.message=r,i.name=n.prototype.constructor.name,me(i,n.prototype),i}return t}(Error),we=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/,G="Invalid Dsn",Dt=function(){function e(t){typeof t=="string"?this._fromString(t):this._fromComponents(t),this._validate()}return e.prototype.toString=function(t){t===void 0&&(t=!1);var r=this,n=r.host,i=r.path,o=r.pass,s=r.port,a=r.projectId,u=r.protocol,f=r.user;return u+"://"+f+(t&&o?":"+o:"")+("@"+n+(s?":"+s:"")+"/"+(i&&i+"/")+a)},e.prototype._fromString=function(t){var r=we.exec(t);if(!r)throw new y(G);var n=Ct(r.slice(1),6),i=n[0],o=n[1],s=n[2],a=s===void 0?"":s,u=n[3],f=n[4],l=f===void 0?"":f,d=n[5],E="",S=d,j=S.split("/");if(j.length>1&&(E=j.slice(0,-1).join("/"),S=j.pop()),S){var O=S.match(/^\d+/);O&&(S=O[0])}this._fromComponents({host:u,pass:a,path:E,projectId:S,port:l,protocol:i,user:o})},e.prototype._fromComponents=function(t){this.protocol=t.protocol,this.user=t.user,this.pass=t.pass||"",this.host=t.host,this.port=t.port||"",this.path=t.path||"",this.projectId=t.projectId},e.prototype._validate=function(){var t=this;if(["protocol","user","host","projectId"].forEach(function(r){if(!t[r])throw new y(G+": "+r+" missing")}),!this.projectId.match(/^\d+$/))throw new y(G+": Invalid projectId "+this.projectId);if(this.protocol!=="http"&&this.protocol!=="https")throw new y(G+": Invalid protocol "+this.protocol);if(this.port&&isNaN(parseInt(this.port,10)))throw new y(G+": Invalid port "+this.port)},e}(),Se=function(){function e(){this._hasWeakSet=typeof WeakSet=="function",this._inner=this._hasWeakSet?new WeakSet:[]}return e.prototype.memoize=function(t){if(this._hasWeakSet)return this._inner.has(t)?!0:(this._inner.add(t),!1);for(var r=0;r<this._inner.length;r++){var n=this._inner[r];if(n===t)return!0}return this._inner.push(t),!1},e.prototype.unmemoize=function(t){if(this._hasWeakSet)this._inner.delete(t);else for(var r=0;r<this._inner.length;r++)if(this._inner[r]===t){this._inner.splice(r,1);break}},e}(),ft="<anonymous>";function x(e){try{return!e||typeof e!="function"?ft:e.name||ft}catch{return ft}}function $(e,t){return t===void 0&&(t=0),typeof e!="string"||t===0||e.length<=t?e:e.substr(0,t)+"..."}function Ht(e,t){if(!Array.isArray(e))return"";for(var r=[],n=0;n<e.length;n++){var i=e[n];try{r.push(String(i))}catch{r.push("[value cannot be serialized]")}}return r.join(t)}function lt(e,t){return D(e)?ve(t)?t.test(e):typeof t=="string"?e.indexOf(t)!==-1:!1:!1}function _(e,t,r){if(t in e){var n=e[t],i=r(n);if(typeof i=="function")try{i.prototype=i.prototype||{},Object.defineProperties(i,{__sentry_original__:{enumerable:!1,value:n}})}catch{}e[t]=i}}function Fe(e){return Object.keys(e).map(function(t){return encodeURIComponent(t)+"="+encodeURIComponent(e[t])}).join("&")}function Bt(e){if(Pt(e)){var t=e,r={message:t.message,name:t.name,stack:t.stack};for(var n in t)Object.prototype.hasOwnProperty.call(t,n)&&(r[n]=t[n]);return r}if(ut(e)){var i=e,o={};o.type=i.type;try{o.target=At(i.target)?tt(i.target):Object.prototype.toString.call(i.target)}catch{o.target="<unknown>"}try{o.currentTarget=At(i.currentTarget)?tt(i.currentTarget):Object.prototype.toString.call(i.currentTarget)}catch{o.currentTarget="<unknown>"}typeof CustomEvent<"u"&&k(e,CustomEvent)&&(o.detail=i.detail);for(var n in i)Object.prototype.hasOwnProperty.call(i,n)&&(o[n]=i);return o}return e}function Oe(e){return~-encodeURI(e).split(/%..|./).length}function Te(e){return Oe(JSON.stringify(e))}function Mt(e,t,r){t===void 0&&(t=3),r===void 0&&(r=100*1024);var n=X(e,t);return Te(n)>r?Mt(e,t-1,r):n}function ke(e){var t=Object.prototype.toString.call(e);if(typeof e=="string")return e;if(t==="[object Object]")return"[Object]";if(t==="[object Array]")return"[Array]";var r=qt(e);return Y(r)?r:t}function qt(e,t){return t==="domain"&&e&&typeof e=="object"&&e._events?"[Domain]":t==="domainEmitter"?"[DomainEmitter]":typeof global<"u"&&e===global?"[Global]":typeof window<"u"&&e===window?"[Window]":typeof document<"u"&&e===document?"[Document]":_e(e)?"[SyntheticEvent]":typeof e=="number"&&e!==e?"[NaN]":e===void 0?"[undefined]":typeof e=="function"?"[Function: "+x(e)+"]":typeof e=="symbol"?"["+String(e)+"]":typeof e=="bigint"?"[BigInt: "+String(e)+"]":e}function Vt(e,t,r,n){if(r===void 0&&(r=1/0),n===void 0&&(n=new Se),r===0)return ke(t);if(t!=null&&typeof t.toJSON=="function")return t.toJSON();var i=qt(t,e);if(Y(i))return i;var o=Bt(t),s=Array.isArray(t)?[]:{};if(n.memoize(t))return"[Circular ~]";for(var a in o)Object.prototype.hasOwnProperty.call(o,a)&&(s[a]=Vt(a,o[a],r-1,n));return n.unmemoize(t),s}function X(e,t){try{return JSON.parse(JSON.stringify(e,function(r,n){return Vt(r,n,t)}))}catch{return"**non-serializable**"}}function xe(e,t){t===void 0&&(t=40);var r=Object.keys(Bt(e));if(r.sort(),!r.length)return"[object has no keys]";if(r[0].length>=t)return $(r[0],t);for(var n=r.length;n>0;n--){var i=r.slice(0,n).join(", ");if(!(i.length>t))return n===r.length?i:$(i,t)}return""}function et(e){var t,r;if(Z(e)){var n=e,i={};try{for(var o=W(Object.keys(n)),s=o.next();!s.done;s=o.next()){var a=s.value;typeof n[a]<"u"&&(i[a]=et(n[a]))}}catch(u){t={error:u}}finally{try{s&&!s.done&&(r=o.return)&&r.call(o)}finally{if(t)throw t.error}}return i}return Array.isArray(e)?e.map(et):e}function pt(){return Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Re(e,t){return e.require(t)}var je={};function v(){return pt()?global:typeof window<"u"?window:typeof self<"u"?self:je}function H(){var e=v(),t=e.crypto||e.msCrypto;if(t!==void 0&&t.getRandomValues){var r=new Uint16Array(8);t.getRandomValues(r),r[3]=r[3]&4095|16384,r[4]=r[4]&16383|32768;var n=function(i){for(var o=i.toString(16);o.length<4;)o="0"+o;return o};return n(r[0])+n(r[1])+n(r[2])+n(r[3])+n(r[4])+n(r[5])+n(r[6])+n(r[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,function(i){var o=Math.random()*16|0,s=i==="x"?o:o&3|8;return s.toString(16)})}function dt(e){if(!e)return{};var t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};var r=t[6]||"",n=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],relative:t[5]+r+n}}function N(e){if(e.message)return e.message;if(e.exception&&e.exception.values&&e.exception.values[0]){var t=e.exception.values[0];return t.type&&t.value?t.type+": "+t.value:t.type||t.value||e.event_id||"<unknown>"}return e.event_id||"<unknown>"}function rt(e){var t=v(),r=["debug","info","warn","error","log","assert"];if(!("console"in t))return e();var n=t.console,i={};r.forEach(function(s){s in t.console&&n[s].__sentry_original__&&(i[s]=n[s],n[s]=n[s].__sentry_original__)});var o=e();return Object.keys(i).forEach(function(s){n[s]=i[s]}),o}function ht(e,t,r){e.exception=e.exception||{},e.exception.values=e.exception.values||[],e.exception.values[0]=e.exception.values[0]||{},e.exception.values[0].value=e.exception.values[0].value||t||"",e.exception.values[0].type=e.exception.values[0].type||r||"Error"}function B(e,t){t===void 0&&(t={});try{e.exception.values[0].mechanism=e.exception.values[0].mechanism||{},Object.keys(t).forEach(function(r){e.exception.values[0].mechanism[r]=t[r]})}catch{}}function Ie(){try{return document.location.href}catch{return""}}var Wt=60*1e3;function Ne(e,t){if(!t)return Wt;var r=parseInt(""+t,10);if(!isNaN(r))return r*1e3;var n=Date.parse(""+t);return isNaN(n)?Wt:n-e}var C=v(),gt="Sentry Logger ",Ce=function(){function e(){this._enabled=!1}return e.prototype.disable=function(){this._enabled=!1},e.prototype.enable=function(){this._enabled=!0},e.prototype.log=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&rt(function(){C.console.log(gt+"[Log]: "+t.join(" "))})},e.prototype.warn=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&rt(function(){C.console.warn(gt+"[Warn]: "+t.join(" "))})},e.prototype.error=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];this._enabled&&rt(function(){C.console.error(gt+"[Error]: "+t.join(" "))})},e}();C.__SENTRY__=C.__SENTRY__||{};var p=C.__SENTRY__.logger||(C.__SENTRY__.logger=new Ce);function vt(){if(!("fetch"in v()))return!1;try{return new Headers,new Request(""),new Response,!0}catch{return!1}}function Yt(e){return e&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Pe(){if(!vt())return!1;var e=v();if(Yt(e.fetch))return!0;var t=!1,r=e.document;if(r&&typeof r.createElement=="function")try{var n=r.createElement("iframe");n.hidden=!0,r.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(t=Yt(n.contentWindow.fetch)),r.head.removeChild(n)}catch(i){p.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",i)}return t}function Le(){if(!vt())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch{return!1}}function Ue(){var e=v(),t=e.chrome,r=t&&t.app&&t.app.runtime,n="history"in e&&!!e.history.pushState&&!!e.history.replaceState;return!r&&n}var h=v(),J={},Gt={};function Ae(e){if(!Gt[e])switch(Gt[e]=!0,e){case"console":De();break;case"dom":We();break;case"xhr":qe();break;case"fetch":He();break;case"history":Ve();break;case"error":Ge();break;case"unhandledrejection":$e();break;default:p.warn("unknown instrumentation type:",e)}}function P(e){!e||typeof e.type!="string"||typeof e.callback!="function"||(J[e.type]=J[e.type]||[],J[e.type].push(e.callback),Ae(e.type))}function m(e,t){var r,n;if(!(!e||!J[e]))try{for(var i=W(J[e]||[]),o=i.next();!o.done;o=i.next()){var s=o.value;try{s(t)}catch(a){p.error(`Error while triggering instrumentation handler.
Type: `+e+`
Name: `+x(s)+`
Error: `+a)}}}catch(a){r={error:a}}finally{try{o&&!o.done&&(n=i.return)&&n.call(i)}finally{if(r)throw r.error}}}function De(){"console"in h&&["debug","info","warn","error","log","assert"].forEach(function(e){e in h.console&&_(h.console,e,function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];m("console",{args:r,level:e}),t&&Function.prototype.apply.call(t,h.console,r)}})})}function He(){Pe()&&_(h,"fetch",function(e){return function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n={args:t,fetchData:{method:Be(t),url:Me(t)},startTimestamp:Date.now()};return m("fetch",c({},n)),e.apply(h,t).then(function(i){return m("fetch",c(c({},n),{endTimestamp:Date.now(),response:i})),i},function(i){throw m("fetch",c(c({},n),{endTimestamp:Date.now(),error:i})),i})}})}function Be(e){return e===void 0&&(e=[]),"Request"in h&&k(e[0],Request)&&e[0].method?String(e[0].method).toUpperCase():e[1]&&e[1].method?String(e[1].method).toUpperCase():"GET"}function Me(e){return e===void 0&&(e=[]),typeof e[0]=="string"?e[0]:"Request"in h&&k(e[0],Request)?e[0].url:String(e[0])}function qe(){if("XMLHttpRequest"in h){var e=[],t=[],r=XMLHttpRequest.prototype;_(r,"open",function(n){return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];var s=this,a=i[1];s.__sentry_xhr__={method:D(i[0])?i[0].toUpperCase():i[0],url:i[1]},D(a)&&s.__sentry_xhr__.method==="POST"&&a.match(/sentry_key/)&&(s.__sentry_own_request__=!0);var u=function(){if(s.readyState===4){try{s.__sentry_xhr__&&(s.__sentry_xhr__.status_code=s.status)}catch{}try{var f=e.indexOf(s);if(f!==-1){e.splice(f);var l=t.splice(f)[0];s.__sentry_xhr__&&l[0]!==void 0&&(s.__sentry_xhr__.body=l[0])}}catch{}m("xhr",{args:i,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:s})}};return"onreadystatechange"in s&&typeof s.onreadystatechange=="function"?_(s,"onreadystatechange",function(f){return function(){for(var l=[],d=0;d<arguments.length;d++)l[d]=arguments[d];return u(),f.apply(s,l)}}):s.addEventListener("readystatechange",u),n.apply(s,i)}}),_(r,"send",function(n){return function(){for(var i=[],o=0;o<arguments.length;o++)i[o]=arguments[o];return e.push(this),t.push(i),m("xhr",{args:i,startTimestamp:Date.now(),xhr:this}),n.apply(this,i)}})}}var nt;function Ve(){if(!Ue())return;var e=h.onpopstate;h.onpopstate=function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=h.location.href,o=nt;if(nt=i,m("history",{from:o,to:i}),e)return e.apply(this,r)};function t(r){return function(){for(var n=[],i=0;i<arguments.length;i++)n[i]=arguments[i];var o=n.length>2?n[2]:void 0;if(o){var s=nt,a=String(o);nt=a,m("history",{from:s,to:a})}return r.apply(this,n)}}_(h.history,"pushState",t),_(h.history,"replaceState",t)}function We(){"document"in h&&(h.document.addEventListener("click",it("click",m.bind(null,"dom")),!1),h.document.addEventListener("keypress",yt(m.bind(null,"dom")),!1),["EventTarget","Node"].forEach(function(e){var t=h[e]&&h[e].prototype;!t||!t.hasOwnProperty||!t.hasOwnProperty("addEventListener")||(_(t,"addEventListener",function(r){return function(n,i,o){return i&&i.handleEvent?(n==="click"&&_(i,"handleEvent",function(s){return function(a){return it("click",m.bind(null,"dom"))(a),s.call(this,a)}}),n==="keypress"&&_(i,"handleEvent",function(s){return function(a){return yt(m.bind(null,"dom"))(a),s.call(this,a)}})):(n==="click"&&it("click",m.bind(null,"dom"),!0)(this),n==="keypress"&&yt(m.bind(null,"dom"))(this)),r.call(this,n,i,o)}}),_(t,"removeEventListener",function(r){return function(n,i,o){try{r.call(this,n,i.__sentry_wrapped__,o)}catch{}return r.call(this,n,i,o)}}))}))}var Ye=1e3,_t=0,z,$t;function it(e,t,r){return r===void 0&&(r=!1),function(n){z=void 0,!(!n||$t===n)&&($t=n,_t&&clearTimeout(_t),r?_t=setTimeout(function(){t({event:n,name:e})}):t({event:n,name:e}))}}function yt(e){return function(t){var r;try{r=t.target}catch{return}var n=r&&r.tagName;!n||n!=="INPUT"&&n!=="TEXTAREA"&&!r.isContentEditable||(z||it("input",e)(t),clearTimeout(z),z=setTimeout(function(){z=void 0},Ye))}}var mt=null;function Ge(){mt=h.onerror,h.onerror=function(e,t,r,n,i){return m("error",{column:n,error:i,line:r,msg:e,url:t}),mt?mt.apply(this,arguments):!1}}var bt=null;function $e(){bt=h.onunhandledrejection,h.onunhandledrejection=function(e){return m("unhandledrejection",e),bt?bt.apply(this,arguments):!0}}var T;(function(e){e.PENDING="PENDING",e.RESOLVED="RESOLVED",e.REJECTED="REJECTED"})(T||(T={}));var w=function(){function e(t){var r=this;this._state=T.PENDING,this._handlers=[],this._resolve=function(n){r._setResult(T.RESOLVED,n)},this._reject=function(n){r._setResult(T.REJECTED,n)},this._setResult=function(n,i){if(r._state===T.PENDING){if(ct(i)){i.then(r._resolve,r._reject);return}r._state=n,r._value=i,r._executeHandlers()}},this._attachHandler=function(n){r._handlers=r._handlers.concat(n),r._executeHandlers()},this._executeHandlers=function(){if(r._state!==T.PENDING){var n=r._handlers.slice();r._handlers=[],n.forEach(function(i){i.done||(r._state===T.RESOLVED&&i.onfulfilled&&i.onfulfilled(r._value),r._state===T.REJECTED&&i.onrejected&&i.onrejected(r._value),i.done=!0)})}};try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}return e.resolve=function(t){return new e(function(r){r(t)})},e.reject=function(t){return new e(function(r,n){n(t)})},e.all=function(t){return new e(function(r,n){if(!Array.isArray(t)){n(new TypeError("Promise.all requires an array as input."));return}if(t.length===0){r([]);return}var i=t.length,o=[];t.forEach(function(s,a){e.resolve(s).then(function(u){o[a]=u,i-=1,i===0&&r(o)}).then(null,n)})})},e.prototype.then=function(t,r){var n=this;return new e(function(i,o){n._attachHandler({done:!1,onfulfilled:function(s){if(!t){i(s);return}try{i(t(s));return}catch(a){o(a);return}},onrejected:function(s){if(!r){o(s);return}try{i(r(s));return}catch(a){o(a);return}}})})},e.prototype.catch=function(t){return this.then(function(r){return r},t)},e.prototype.finally=function(t){var r=this;return new e(function(n,i){var o,s;return r.then(function(a){s=!1,o=a,t&&t()},function(a){s=!0,o=a,t&&t()}).then(function(){if(s){i(o);return}n(o)})})},e.prototype.toString=function(){return"[object SyncPromise]"},e}(),Xe=function(){function e(t){this._limit=t,this._buffer=[]}return e.prototype.isReady=function(){return this._limit===void 0||this.length()<this._limit},e.prototype.add=function(t){var r=this;return this.isReady()?(this._buffer.indexOf(t)===-1&&this._buffer.push(t),t.then(function(){return r.remove(t)}).then(null,function(){return r.remove(t).then(null,function(){})}),t):w.reject(new y("Not adding Promise due to buffer limit reached."))},e.prototype.remove=function(t){var r=this._buffer.splice(this._buffer.indexOf(t),1)[0];return r},e.prototype.length=function(){return this._buffer.length},e.prototype.drain=function(t){var r=this;return new w(function(n){var i=setTimeout(function(){t&&t>0&&n(!1)},t);w.all(r._buffer).then(function(){clearTimeout(i),n(!0)}).then(null,function(){n(!0)})})},e}(),Et={nowSeconds:function(){return Date.now()/1e3}};function Je(){var e=v().performance;if(!(!e||!e.now)){var t=Date.now()-e.now();return{now:function(){return e.now()},timeOrigin:t}}}function ze(){try{var e=Re(module,"perf_hooks");return e.performance}catch{return}}var wt=pt()?ze():Je(),Xt=wt===void 0?Et:{nowSeconds:function(){return(wt.timeOrigin+wt.now())/1e3}},St=Et.nowSeconds.bind(Et);Xt.nowSeconds.bind(Xt),function(){var e=v().performance;if(e)return e.timeOrigin?e.timeOrigin:e.timing&&e.timing.navigationStart||Date.now()}();var ot=function(){function e(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._user={},this._tags={},this._extra={},this._contexts={}}return e.clone=function(t){var r=new e;return t&&(r._breadcrumbs=g(t._breadcrumbs),r._tags=c({},t._tags),r._extra=c({},t._extra),r._contexts=c({},t._contexts),r._user=t._user,r._level=t._level,r._span=t._span,r._session=t._session,r._transactionName=t._transactionName,r._fingerprint=t._fingerprint,r._eventProcessors=g(t._eventProcessors)),r},e.prototype.addScopeListener=function(t){this._scopeListeners.push(t)},e.prototype.addEventProcessor=function(t){return this._eventProcessors.push(t),this},e.prototype.setUser=function(t){return this._user=t||{},this._session&&this._session.update({user:t}),this._notifyScopeListeners(),this},e.prototype.getUser=function(){return this._user},e.prototype.setTags=function(t){return this._tags=c(c({},this._tags),t),this._notifyScopeListeners(),this},e.prototype.setTag=function(t,r){var n;return this._tags=c(c({},this._tags),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setExtras=function(t){return this._extra=c(c({},this._extra),t),this._notifyScopeListeners(),this},e.prototype.setExtra=function(t,r){var n;return this._extra=c(c({},this._extra),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setFingerprint=function(t){return this._fingerprint=t,this._notifyScopeListeners(),this},e.prototype.setLevel=function(t){return this._level=t,this._notifyScopeListeners(),this},e.prototype.setTransactionName=function(t){return this._transactionName=t,this._notifyScopeListeners(),this},e.prototype.setTransaction=function(t){return this.setTransactionName(t)},e.prototype.setContext=function(t,r){var n;return r===null?delete this._contexts[t]:this._contexts=c(c({},this._contexts),(n={},n[t]=r,n)),this._notifyScopeListeners(),this},e.prototype.setSpan=function(t){return this._span=t,this._notifyScopeListeners(),this},e.prototype.getSpan=function(){return this._span},e.prototype.getTransaction=function(){var t,r,n,i,o=this.getSpan();if(!((t=o)===null||t===void 0)&&t.transaction)return(r=o)===null||r===void 0?void 0:r.transaction;if(!((i=(n=o)===null||n===void 0?void 0:n.spanRecorder)===null||i===void 0)&&i.spans[0])return o.spanRecorder.spans[0]},e.prototype.setSession=function(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this},e.prototype.getSession=function(){return this._session},e.prototype.update=function(t){if(!t)return this;if(typeof t=="function"){var r=t(this);return r instanceof e?r:this}return t instanceof e?(this._tags=c(c({},this._tags),t._tags),this._extra=c(c({},this._extra),t._extra),this._contexts=c(c({},this._contexts),t._contexts),t._user&&Object.keys(t._user).length&&(this._user=t._user),t._level&&(this._level=t._level),t._fingerprint&&(this._fingerprint=t._fingerprint)):Z(t)&&(t=t,this._tags=c(c({},this._tags),t.tags),this._extra=c(c({},this._extra),t.extra),this._contexts=c(c({},this._contexts),t.contexts),t.user&&(this._user=t.user),t.level&&(this._level=t.level),t.fingerprint&&(this._fingerprint=t.fingerprint)),this},e.prototype.clear=function(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._span=void 0,this._session=void 0,this._notifyScopeListeners(),this},e.prototype.addBreadcrumb=function(t,r){var n=c({timestamp:St()},t);return this._breadcrumbs=r!==void 0&&r>=0?g(this._breadcrumbs,[n]).slice(-r):g(this._breadcrumbs,[n]),this._notifyScopeListeners(),this},e.prototype.clearBreadcrumbs=function(){return this._breadcrumbs=[],this._notifyScopeListeners(),this},e.prototype.applyToEvent=function(t,r){var n;if(this._extra&&Object.keys(this._extra).length&&(t.extra=c(c({},this._extra),t.extra)),this._tags&&Object.keys(this._tags).length&&(t.tags=c(c({},this._tags),t.tags)),this._user&&Object.keys(this._user).length&&(t.user=c(c({},this._user),t.user)),this._contexts&&Object.keys(this._contexts).length&&(t.contexts=c(c({},this._contexts),t.contexts)),this._level&&(t.level=this._level),this._transactionName&&(t.transaction=this._transactionName),this._span){t.contexts=c({trace:this._span.getTraceContext()},t.contexts);var i=(n=this._span.transaction)===null||n===void 0?void 0:n.name;i&&(t.tags=c({transaction:i},t.tags))}return this._applyFingerprint(t),t.breadcrumbs=g(t.breadcrumbs||[],this._breadcrumbs),t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,this._notifyEventProcessors(g(Jt(),this._eventProcessors),t,r)},e.prototype._notifyEventProcessors=function(t,r,n,i){var o=this;return i===void 0&&(i=0),new w(function(s,a){var u=t[i];if(r===null||typeof u!="function")s(r);else{var f=u(c({},r),n);ct(f)?f.then(function(l){return o._notifyEventProcessors(t,l,n,i+1).then(s)}).then(null,a):o._notifyEventProcessors(t,f,n,i+1).then(s).then(null,a)}})},e.prototype._notifyScopeListeners=function(){var t=this;this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(function(r){r(t)}),this._notifyingListeners=!1)},e.prototype._applyFingerprint=function(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this._fingerprint&&(t.fingerprint=t.fingerprint.concat(this._fingerprint)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint},e}();function Jt(){var e=v();return e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.globalEventProcessors=e.__SENTRY__.globalEventProcessors||[],e.__SENTRY__.globalEventProcessors}function st(e){Jt().push(e)}var Ke=function(){function e(t){this.errors=0,this.sid=H(),this.timestamp=Date.now(),this.started=Date.now(),this.duration=0,this.status=A.Ok,t&&this.update(t)}return e.prototype.update=function(t){t===void 0&&(t={}),t.user&&(t.user.ip_address&&(this.ipAddress=t.user.ip_address),t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||Date.now(),t.sid&&(this.sid=t.sid.length===32?t.sid:H()),t.did&&(this.did=""+t.did),typeof t.started=="number"&&(this.started=t.started),typeof t.duration=="number"?this.duration=t.duration:this.duration=this.timestamp-this.started,t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),t.ipAddress&&(this.ipAddress=t.ipAddress),t.userAgent&&(this.userAgent=t.userAgent),typeof t.errors=="number"&&(this.errors=t.errors),t.status&&(this.status=t.status)},e.prototype.close=function(t){t?this.update({status:t}):this.status===A.Ok?this.update({status:A.Exited}):this.update()},e.prototype.toJSON=function(){return et({sid:""+this.sid,init:!0,started:new Date(this.started).toISOString(),timestamp:new Date(this.timestamp).toISOString(),status:this.status,errors:this.errors,did:typeof this.did=="number"||typeof this.did=="string"?""+this.did:void 0,duration:this.duration,attrs:et({release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent})})},e}(),Ft=3,Qe=100,Ze=100,Ot=function(){function e(t,r,n){r===void 0&&(r=new ot),n===void 0&&(n=Ft),this._version=n,this._stack=[{}],this.getStackTop().scope=r,this.bindClient(t)}return e.prototype.isOlderThan=function(t){return this._version<t},e.prototype.bindClient=function(t){var r=this.getStackTop();r.client=t,t&&t.setupIntegrations&&t.setupIntegrations()},e.prototype.pushScope=function(){var t=ot.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t},e.prototype.popScope=function(){return this.getStack().length<=1?!1:!!this.getStack().pop()},e.prototype.withScope=function(t){var r=this.pushScope();try{t(r)}finally{this.popScope()}},e.prototype.getClient=function(){return this.getStackTop().client},e.prototype.getScope=function(){return this.getStackTop().scope},e.prototype.getStack=function(){return this._stack},e.prototype.getStackTop=function(){return this._stack[this._stack.length-1]},e.prototype.captureException=function(t,r){var n=this._lastEventId=H(),i=r;if(!r){var o=void 0;try{throw new Error("Sentry syntheticException")}catch(s){o=s}i={originalException:t,syntheticException:o}}return this._invokeClient("captureException",t,c(c({},i),{event_id:n})),n},e.prototype.captureMessage=function(t,r,n){var i=this._lastEventId=H(),o=n;if(!n){var s=void 0;try{throw new Error(t)}catch(a){s=a}o={originalException:t,syntheticException:s}}return this._invokeClient("captureMessage",t,r,c(c({},o),{event_id:i})),i},e.prototype.captureEvent=function(t,r){var n=this._lastEventId=H();return this._invokeClient("captureEvent",t,c(c({},r),{event_id:n})),n},e.prototype.lastEventId=function(){return this._lastEventId},e.prototype.addBreadcrumb=function(t,r){var n=this.getStackTop(),i=n.scope,o=n.client;if(!(!i||!o)){var s=o.getOptions&&o.getOptions()||{},a=s.beforeBreadcrumb,u=a===void 0?null:a,f=s.maxBreadcrumbs,l=f===void 0?Qe:f;if(!(l<=0)){var d=St(),E=c({timestamp:d},t),S=u?rt(function(){return u(E,r)}):E;S!==null&&i.addBreadcrumb(S,Math.min(l,Ze))}}},e.prototype.setUser=function(t){var r=this.getScope();r&&r.setUser(t)},e.prototype.setTags=function(t){var r=this.getScope();r&&r.setTags(t)},e.prototype.setExtras=function(t){var r=this.getScope();r&&r.setExtras(t)},e.prototype.setTag=function(t,r){var n=this.getScope();n&&n.setTag(t,r)},e.prototype.setExtra=function(t,r){var n=this.getScope();n&&n.setExtra(t,r)},e.prototype.setContext=function(t,r){var n=this.getScope();n&&n.setContext(t,r)},e.prototype.configureScope=function(t){var r=this.getStackTop(),n=r.scope,i=r.client;n&&i&&t(n)},e.prototype.run=function(t){var r=zt(this);try{t(this)}finally{zt(r)}},e.prototype.getIntegration=function(t){var r=this.getClient();if(!r)return null;try{return r.getIntegration(t)}catch{return p.warn("Cannot retrieve integration "+t.id+" from the current Hub"),null}},e.prototype.startSpan=function(t){return this._callExtensionMethod("startSpan",t)},e.prototype.startTransaction=function(t,r){return this._callExtensionMethod("startTransaction",t,r)},e.prototype.traceHeaders=function(){return this._callExtensionMethod("traceHeaders")},e.prototype.startSession=function(t){this.endSession();var r=this.getStackTop(),n=r.scope,i=r.client,o=i&&i.getOptions()||{},s=o.release,a=o.environment,u=new Ke(c(c({release:s,environment:a},n&&{user:n.getUser()}),t));return n&&n.setSession(u),u},e.prototype.endSession=function(){var t=this.getStackTop(),r=t.scope,n=t.client;if(r){var i=r.getSession&&r.getSession();i&&(i.close(),n&&n.captureSession&&n.captureSession(i),r.setSession())}},e.prototype._invokeClient=function(t){for(var r,n=[],i=1;i<arguments.length;i++)n[i-1]=arguments[i];var o=this.getStackTop(),s=o.scope,a=o.client;a&&a[t]&&(r=a)[t].apply(r,g(n,[s]))},e.prototype._callExtensionMethod=function(t){for(var r=[],n=1;n<arguments.length;n++)r[n-1]=arguments[n];var i=at(),o=i.__SENTRY__;if(o&&o.extensions&&typeof o.extensions[t]=="function")return o.extensions[t].apply(this,r);p.warn("Extension method "+t+" couldn't be found, doing nothing.")},e}();function at(){var e=v();return e.__SENTRY__=e.__SENTRY__||{extensions:{},hub:void 0},e}function zt(e){var t=at(),r=R(t);return Tt(t,e),r}function b(){var e=at();return(!Kt(e)||R(e).isOlderThan(Ft))&&Tt(e,new Ot),pt()?er(e):R(e)}function tr(){var e=at().__SENTRY__;return e&&e.extensions&&e.extensions.domain&&e.extensions.domain.active}function er(e){try{var t=tr();if(!t)return R(e);if(!Kt(t)||R(t).isOlderThan(Ft)){var r=R(e).getStackTop();Tt(t,new Ot(r.client,ot.clone(r.scope)))}return R(t)}catch{return R(e)}}function Kt(e){return!!(e&&e.__SENTRY__&&e.__SENTRY__.hub)}function R(e){return e&&e.__SENTRY__&&e.__SENTRY__.hub||(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=new Ot),e.__SENTRY__.hub}function Tt(e,t){return e?(e.__SENTRY__=e.__SENTRY__||{},e.__SENTRY__.hub=t,!0):!1}function Qt(e){for(var t=[],r=1;r<arguments.length;r++)t[r-1]=arguments[r];var n=b();if(n&&n[e])return n[e].apply(n,g(t));throw new Error("No hub defined or "+e+" was not found on the hub, please open a bug report.")}function rr(e,t){var r;try{throw new Error("Sentry syntheticException")}catch(n){r=n}return Qt("captureException",e,{captureContext:t,originalException:e,syntheticException:r})}function nr(e){Qt("withScope",e)}var Zt="7",te=function(){function e(t){this.dsn=t,this._dsnObject=new Dt(t)}return e.prototype.getDsn=function(){return this._dsnObject},e.prototype.getBaseApiEndpoint=function(){var t=this._dsnObject,r=t.protocol?t.protocol+":":"",n=t.port?":"+t.port:"";return r+"//"+t.host+n+(t.path?"/"+t.path:"")+"/api/"},e.prototype.getStoreEndpoint=function(){return this._getIngestEndpoint("store")},e.prototype.getStoreEndpointWithUrlEncodedAuth=function(){return this.getStoreEndpoint()+"?"+this._encodedAuth()},e.prototype.getEnvelopeEndpointWithUrlEncodedAuth=function(){return this._getEnvelopeEndpoint()+"?"+this._encodedAuth()},e.prototype.getStoreEndpointPath=function(){var t=this._dsnObject;return(t.path?"/"+t.path:"")+"/api/"+t.projectId+"/store/"},e.prototype.getRequestHeaders=function(t,r){var n=this._dsnObject,i=["Sentry sentry_version="+Zt];return i.push("sentry_client="+t+"/"+r),i.push("sentry_key="+n.user),n.pass&&i.push("sentry_secret="+n.pass),{"Content-Type":"application/json","X-Sentry-Auth":i.join(", ")}},e.prototype.getReportDialogEndpoint=function(t){t===void 0&&(t={});var r=this._dsnObject,n=this.getBaseApiEndpoint()+"embed/error-page/",i=[];i.push("dsn="+r.toString());for(var o in t)if(o!=="dsn")if(o==="user"){if(!t.user)continue;t.user.name&&i.push("name="+encodeURIComponent(t.user.name)),t.user.email&&i.push("email="+encodeURIComponent(t.user.email))}else i.push(encodeURIComponent(o)+"="+encodeURIComponent(t[o]));return i.length?n+"?"+i.join("&"):n},e.prototype._getEnvelopeEndpoint=function(){return this._getIngestEndpoint("envelope")},e.prototype._getIngestEndpoint=function(t){var r=this.getBaseApiEndpoint(),n=this._dsnObject;return""+r+n.projectId+"/"+t+"/"},e.prototype._encodedAuth=function(){var t=this._dsnObject,r={sentry_key:t.user,sentry_version:Zt};return Fe(r)},e}(),ee=[];function ir(e){var t=e.defaultIntegrations&&g(e.defaultIntegrations)||[],r=e.integrations,n=[];if(Array.isArray(r)){var i=r.map(function(u){return u.name}),o=[];t.forEach(function(u){i.indexOf(u.name)===-1&&o.indexOf(u.name)===-1&&(n.push(u),o.push(u.name))}),r.forEach(function(u){o.indexOf(u.name)===-1&&(n.push(u),o.push(u.name))})}else typeof r=="function"?(n=r(t),n=Array.isArray(n)?n:[n]):n=g(t);var s=n.map(function(u){return u.name}),a="Debug";return s.indexOf(a)!==-1&&n.push.apply(n,g(n.splice(s.indexOf(a),1))),n}function or(e){ee.indexOf(e.name)===-1&&(e.setupOnce(st,b),ee.push(e.name),p.log("Integration installed: "+e.name))}function sr(e){var t={};return ir(e).forEach(function(r){t[r.name]=r,or(r)}),t}var ar=function(){function e(t,r){this._integrations={},this._processing=0,this._backend=new t(r),this._options=r,r.dsn&&(this._dsn=new Dt(r.dsn))}return e.prototype.captureException=function(t,r,n){var i=this,o=r&&r.event_id;return this._process(this._getBackend().eventFromException(t,r).then(function(s){return i._captureEvent(s,r,n)}).then(function(s){o=s})),o},e.prototype.captureMessage=function(t,r,n,i){var o=this,s=n&&n.event_id,a=Y(t)?this._getBackend().eventFromMessage(String(t),r,n):this._getBackend().eventFromException(t,n);return this._process(a.then(function(u){return o._captureEvent(u,n,i)}).then(function(u){s=u})),s},e.prototype.captureEvent=function(t,r,n){var i=r&&r.event_id;return this._process(this._captureEvent(t,r,n).then(function(o){i=o})),i},e.prototype.captureSession=function(t){t.release?this._sendSession(t):p.warn("Discarded session because of missing release")},e.prototype.getDsn=function(){return this._dsn},e.prototype.getOptions=function(){return this._options},e.prototype.flush=function(t){var r=this;return this._isClientProcessing(t).then(function(n){return r._getBackend().getTransport().close(t).then(function(i){return n&&i})})},e.prototype.close=function(t){var r=this;return this.flush(t).then(function(n){return r.getOptions().enabled=!1,n})},e.prototype.setupIntegrations=function(){this._isEnabled()&&(this._integrations=sr(this._options))},e.prototype.getIntegration=function(t){try{return this._integrations[t.id]||null}catch{return p.warn("Cannot retrieve integration "+t.id+" from the current Client"),null}},e.prototype._updateSessionFromEvent=function(t,r){var n,i,o=!1,s=!1,a,u=r.exception&&r.exception.values;if(u){s=!0;try{for(var f=W(u),l=f.next();!l.done;l=f.next()){var d=l.value,E=d.mechanism;if(E&&E.handled===!1){o=!0;break}}}catch(L){n={error:L}}finally{try{l&&!l.done&&(i=f.return)&&i.call(f)}finally{if(n)throw n.error}}}var S=r.user;if(!t.userAgent){var j=r.request?r.request.headers:{};for(var O in j)if(O.toLowerCase()==="user-agent"){a=j[O];break}}t.update(c(c({},o&&{status:A.Crashed}),{user:S,userAgent:a,errors:t.errors+Number(s||o)}))},e.prototype._sendSession=function(t){this._getBackend().sendSession(t)},e.prototype._isClientProcessing=function(t){var r=this;return new w(function(n){var i=0,o=1,s=setInterval(function(){r._processing==0?(clearInterval(s),n(!0)):(i+=o,t&&i>=t&&(clearInterval(s),n(!1)))},o)})},e.prototype._getBackend=function(){return this._backend},e.prototype._isEnabled=function(){return this.getOptions().enabled!==!1&&this._dsn!==void 0},e.prototype._prepareEvent=function(t,r,n){var i=this,o=this.getOptions().normalizeDepth,s=o===void 0?3:o,a=c(c({},t),{event_id:t.event_id||(n&&n.event_id?n.event_id:H()),timestamp:t.timestamp||St()});this._applyClientOptions(a),this._applyIntegrationsMetadata(a);var u=r;n&&n.captureContext&&(u=ot.clone(u).update(n.captureContext));var f=w.resolve(a);return u&&(f=u.applyToEvent(a,n)),f.then(function(l){return typeof s=="number"&&s>0?i._normalizeEvent(l,s):l})},e.prototype._normalizeEvent=function(t,r){if(!t)return null;var n=c(c(c(c(c({},t),t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(function(i){return c(c({},i),i.data&&{data:X(i.data,r)})})}),t.user&&{user:X(t.user,r)}),t.contexts&&{contexts:X(t.contexts,r)}),t.extra&&{extra:X(t.extra,r)});return t.contexts&&t.contexts.trace&&(n.contexts.trace=t.contexts.trace),n},e.prototype._applyClientOptions=function(t){var r=this.getOptions(),n=r.environment,i=r.release,o=r.dist,s=r.maxValueLength,a=s===void 0?250:s;"environment"in t||(t.environment="environment"in r?n:"production"),t.release===void 0&&i!==void 0&&(t.release=i),t.dist===void 0&&o!==void 0&&(t.dist=o),t.message&&(t.message=$(t.message,a));var u=t.exception&&t.exception.values&&t.exception.values[0];u&&u.value&&(u.value=$(u.value,a));var f=t.request;f&&f.url&&(f.url=$(f.url,a))},e.prototype._applyIntegrationsMetadata=function(t){var r=t.sdk,n=Object.keys(this._integrations);r&&n.length>0&&(r.integrations=n)},e.prototype._sendEvent=function(t){this._getBackend().sendEvent(t)},e.prototype._captureEvent=function(t,r,n){return this._processEvent(t,r,n).then(function(i){return i.event_id},function(i){p.error(i)})},e.prototype._processEvent=function(t,r,n){var i=this,o=this.getOptions(),s=o.beforeSend,a=o.sampleRate;if(!this._isEnabled())return w.reject(new y("SDK not enabled, will not send event."));var u=t.type==="transaction";return!u&&typeof a=="number"&&Math.random()>a?w.reject(new y("Discarding event because it's not included in the random sample (sampling rate = "+a+")")):this._prepareEvent(t,n,r).then(function(f){if(f===null)throw new y("An event processor returned null, will not send event.");var l=r&&r.data&&r.data.__sentry__===!0;if(l||u||!s)return f;var d=s(f,r);if(typeof d>"u")throw new y("`beforeSend` method has to return `null` or a valid event.");return ct(d)?d.then(function(E){return E},function(E){throw new y("beforeSend rejected with "+E)}):d}).then(function(f){if(f===null)throw new y("`beforeSend` returned `null`, will not send event.");var l=n&&n.getSession&&n.getSession();return!u&&l&&i._updateSessionFromEvent(l,f),i._sendEvent(f),f}).then(null,function(f){throw f instanceof y?f:(i.captureException(f,{data:{__sentry__:!0},originalException:f}),new y(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: `+f))})},e.prototype._process=function(t){var r=this;this._processing+=1,t.then(function(n){return r._processing-=1,n},function(n){return r._processing-=1,n})},e}(),ur=function(){function e(){}return e.prototype.sendEvent=function(t){return w.resolve({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:I.Skipped})},e.prototype.close=function(t){return w.resolve(!0)},e}(),cr=function(){function e(t){this._options=t,this._options.dsn||p.warn("No DSN provided, backend will not do anything."),this._transport=this._setupTransport()}return e.prototype.eventFromException=function(t,r){throw new y("Backend has to implement `eventFromException` method")},e.prototype.eventFromMessage=function(t,r,n){throw new y("Backend has to implement `eventFromMessage` method")},e.prototype.sendEvent=function(t){this._transport.sendEvent(t).then(null,function(r){p.error("Error while sending event: "+r)})},e.prototype.sendSession=function(t){if(!this._transport.sendSession){p.warn("Dropping session because custom transport doesn't implement sendSession");return}this._transport.sendSession(t).then(null,function(r){p.error("Error while sending session: "+r)})},e.prototype.getTransport=function(){return this._transport},e.prototype._setupTransport=function(){return new ur},e}();function re(e,t){var r=JSON.stringify({sent_at:new Date().toISOString()}),n=JSON.stringify({type:"session"});return{body:r+`
`+n+`
`+JSON.stringify(e),type:"session",url:t.getEnvelopeEndpointWithUrlEncodedAuth()}}function ne(e,t){var r=e.tags||{},n=r.__sentry_samplingMethod,i=r.__sentry_sampleRate,o=he(r,["__sentry_samplingMethod","__sentry_sampleRate"]);e.tags=o;var s=e.type==="transaction",a={body:JSON.stringify(e),type:e.type||"event",url:s?t.getEnvelopeEndpointWithUrlEncodedAuth():t.getStoreEndpointWithUrlEncodedAuth()};if(s){var u=JSON.stringify({event_id:e.event_id,sent_at:new Date().toISOString()}),f=JSON.stringify({type:e.type,sample_rates:[{id:n,rate:i}]}),l=u+`
`+f+`
`+a.body;a.body=l}return a}function fr(e,t){t.debug===!0&&p.enable();var r=b(),n=new e(t);r.bindClient(n)}var ie,lr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){ie=Function.prototype.toString,Function.prototype.toString=function(){for(var t=[],r=0;r<arguments.length;r++)t[r]=arguments[r];var n=this.__sentry_original__||this;return ie.apply(n,t)}},e.id="FunctionToString",e}(),pr=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/],dr=function(){function e(t){t===void 0&&(t={}),this._options=t,this.name=e.id}return e.prototype.setupOnce=function(){st(function(t){var r=b();if(!r)return t;var n=r.getIntegration(e);if(n){var i=r.getClient(),o=i?i.getOptions():{},s=n._mergeOptions(o);if(n._shouldDropEvent(t,s))return null}return t})},e.prototype._shouldDropEvent=function(t,r){return this._isSentryError(t,r)?(p.warn(`Event dropped due to being internal Sentry Error.
Event: `+N(t)),!0):this._isIgnoredError(t,r)?(p.warn("Event dropped due to being matched by `ignoreErrors` option.\nEvent: "+N(t)),!0):this._isDeniedUrl(t,r)?(p.warn("Event dropped due to being matched by `denyUrls` option.\nEvent: "+N(t)+`.
Url: `+this._getEventFilterUrl(t)),!0):this._isAllowedUrl(t,r)?!1:(p.warn("Event dropped due to not being matched by `allowUrls` option.\nEvent: "+N(t)+`.
Url: `+this._getEventFilterUrl(t)),!0)},e.prototype._isSentryError=function(t,r){if(!r.ignoreInternal)return!1;try{return t&&t.exception&&t.exception.values&&t.exception.values[0]&&t.exception.values[0].type==="SentryError"||!1}catch{return!1}},e.prototype._isIgnoredError=function(t,r){return!r.ignoreErrors||!r.ignoreErrors.length?!1:this._getPossibleEventMessages(t).some(function(n){return r.ignoreErrors.some(function(i){return lt(n,i)})})},e.prototype._isDeniedUrl=function(t,r){if(!r.denyUrls||!r.denyUrls.length)return!1;var n=this._getEventFilterUrl(t);return n?r.denyUrls.some(function(i){return lt(n,i)}):!1},e.prototype._isAllowedUrl=function(t,r){if(!r.allowUrls||!r.allowUrls.length)return!0;var n=this._getEventFilterUrl(t);return n?r.allowUrls.some(function(i){return lt(n,i)}):!0},e.prototype._mergeOptions=function(t){return t===void 0&&(t={}),{allowUrls:g(this._options.whitelistUrls||[],this._options.allowUrls||[],t.whitelistUrls||[],t.allowUrls||[]),denyUrls:g(this._options.blacklistUrls||[],this._options.denyUrls||[],t.blacklistUrls||[],t.denyUrls||[]),ignoreErrors:g(this._options.ignoreErrors||[],t.ignoreErrors||[],pr),ignoreInternal:typeof this._options.ignoreInternal<"u"?this._options.ignoreInternal:!0}},e.prototype._getPossibleEventMessages=function(t){if(t.message)return[t.message];if(t.exception)try{var r=t.exception.values&&t.exception.values[0]||{},n=r.type,i=n===void 0?"":n,o=r.value,s=o===void 0?"":o;return[""+s,i+": "+s]}catch{return p.error("Cannot extract message for event "+N(t)),[]}return[]},e.prototype._getEventFilterUrl=function(t){try{if(t.stacktrace){var r=t.stacktrace.frames;return r&&r[r.length-1].filename||null}if(t.exception){var n=t.exception.values&&t.exception.values[0].stacktrace&&t.exception.values[0].stacktrace.frames;return n&&n[n.length-1].filename||null}return null}catch{return p.error("Cannot extract url for event "+N(t)),null}},e.id="InboundFilters",e}(),K="?",hr=/^\s*at (?:(.*?) ?\()?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,gr=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,vr=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,_r=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,yr=/\((\S*)(?::(\d+))(?::(\d+))\)/,mr=/Minified React error #\d+;/i;function Q(e){var t=null,r=0;e&&(typeof e.framesToPop=="number"?r=e.framesToPop:mr.test(e.message)&&(r=1));try{if(t=Er(e),t)return oe(t,r)}catch{}try{if(t=br(e),t)return oe(t,r)}catch{}return{message:kt(e),name:e&&e.name,stack:[],failed:!0}}function br(e){if(!e||!e.stack)return null;for(var t=[],r=e.stack.split(`
`),n,i,o,s,a=0;a<r.length;++a){if(o=hr.exec(r[a])){var u=o[2]&&o[2].indexOf("native")===0;n=o[2]&&o[2].indexOf("eval")===0,n&&(i=yr.exec(o[2]))&&(o[2]=i[1],o[3]=i[2],o[4]=i[3]),s={url:o[2]&&o[2].indexOf("address at ")===0?o[2].substr(11):o[2],func:o[1]||K,args:u?[o[2]]:[],line:o[3]?+o[3]:null,column:o[4]?+o[4]:null}}else if(o=vr.exec(r[a]))s={url:o[2],func:o[1]||K,args:[],line:+o[3],column:o[4]?+o[4]:null};else if(o=gr.exec(r[a]))n=o[3]&&o[3].indexOf(" > eval")>-1,n&&(i=_r.exec(o[3]))?(o[1]=o[1]||"eval",o[3]=i[1],o[4]=i[2],o[5]=""):a===0&&!o[5]&&e.columnNumber!==void 0&&(t[0].column=e.columnNumber+1),s={url:o[3],func:o[1]||K,args:o[2]?o[2].split(","):[],line:o[4]?+o[4]:null,column:o[5]?+o[5]:null};else continue;!s.func&&s.line&&(s.func=K),t.push(s)}return t.length?{message:kt(e),name:e.name,stack:t}:null}function Er(e){if(!e||!e.stacktrace)return null;for(var t=e.stacktrace,r=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,n=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\((.*)\))? in (.*):\s*$/i,i=t.split(`
`),o=[],s,a=0;a<i.length;a+=2){var u=null;(s=r.exec(i[a]))?u={url:s[2],func:s[3],args:[],line:+s[1],column:null}:(s=n.exec(i[a]))&&(u={url:s[6],func:s[3]||s[4],args:s[5]?s[5].split(","):[],line:+s[1],column:+s[2]}),u&&(!u.func&&u.line&&(u.func=K),o.push(u))}return o.length?{message:kt(e),name:e.name,stack:o}:null}function oe(e,t){try{return c(c({},e),{stack:e.stack.slice(t)})}catch{return e}}function kt(e){var t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}var wr=50;function se(e){var t=xt(e.stack),r={type:e.name,value:e.message};return t&&t.length&&(r.stacktrace={frames:t}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Sr(e,t,r){var n={exception:{values:[{type:ut(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:"Non-Error "+(r?"promise rejection":"exception")+" captured with keys: "+xe(e)}]},extra:{__serialized__:Mt(e)}};if(t){var i=Q(t),o=xt(i.stack);n.stacktrace={frames:o}}return n}function ae(e){var t=se(e);return{exception:{values:[t]}}}function xt(e){if(!e||!e.length)return[];var t=e,r=t[0].func||"",n=t[t.length-1].func||"";return(r.indexOf("captureMessage")!==-1||r.indexOf("captureException")!==-1)&&(t=t.slice(1)),n.indexOf("sentryWrapped")!==-1&&(t=t.slice(0,-1)),t.slice(0,wr).map(function(i){return{colno:i.column===null?void 0:i.column,filename:i.url||t[0].url,function:i.func||"?",in_app:!0,lineno:i.line===null?void 0:i.line}}).reverse()}function Fr(e,t,r){var n=r&&r.syntheticException||void 0,i=Rt(t,n,{attachStacktrace:e.attachStacktrace});return B(i,{handled:!0,type:"generic"}),i.level=F.Error,r&&r.event_id&&(i.event_id=r.event_id),w.resolve(i)}function Or(e,t,r,n){r===void 0&&(r=F.Info);var i=n&&n.syntheticException||void 0,o=jt(t,i,{attachStacktrace:e.attachStacktrace});return o.level=r,n&&n.event_id&&(o.event_id=n.event_id),w.resolve(o)}function Rt(e,t,r){r===void 0&&(r={});var n;if(Lt(e)&&e.error){var i=e;return e=i.error,n=ae(Q(e)),n}if(Ut(e)||ge(e)){var o=e,s=o.name||(Ut(o)?"DOMError":"DOMException"),a=o.message?s+": "+o.message:s;return n=jt(a,t,r),ht(n,a),"code"in o&&(n.tags=c(c({},n.tags),{"DOMException.code":""+o.code})),n}if(Pt(e))return n=ae(Q(e)),n;if(Z(e)||ut(e)){var u=e;return n=Sr(u,t,r.rejection),B(n,{synthetic:!0}),n}return n=jt(e,t,r),ht(n,""+e,void 0),B(n,{synthetic:!0}),n}function jt(e,t,r){r===void 0&&(r={});var n={message:e};if(r.attachStacktrace&&t){var i=Q(t),o=xt(i.stack);n.stacktrace={frames:o}}return n}var ue=function(){function e(t){this.options=t,this._buffer=new Xe(30),this._rateLimits={},this._api=new te(this.options.dsn),this.url=this._api.getStoreEndpointWithUrlEncodedAuth()}return e.prototype.sendEvent=function(t){throw new y("Transport Class has to implement `sendEvent` method")},e.prototype.close=function(t){return this._buffer.drain(t)},e.prototype._handleResponse=function(t){var r=t.requestType,n=t.response,i=t.headers,o=t.resolve,s=t.reject,a=I.fromHttpCode(n.status),u=this._handleRateLimit(i);if(u&&p.warn("Too many requests, backing off until: "+this._disabledUntil(r)),a===I.Success){o({status:a});return}s(n)},e.prototype._disabledUntil=function(t){return this._rateLimits[t]||this._rateLimits.all},e.prototype._isRateLimited=function(t){return this._disabledUntil(t)>new Date(Date.now())},e.prototype._handleRateLimit=function(t){var r,n,i,o,s=Date.now(),a=t["x-sentry-rate-limits"],u=t["retry-after"];if(a){try{for(var f=W(a.trim().split(",")),l=f.next();!l.done;l=f.next()){var d=l.value,E=d.split(":",2),S=parseInt(E[0],10),j=(isNaN(S)?60:S)*1e3;try{for(var O=(i=void 0,W(E[1].split(";"))),L=O.next();!L.done;L=O.next()){var tn=L.value;this._rateLimits[tn||"all"]=new Date(s+j)}}catch(Nt){i={error:Nt}}finally{try{L&&!L.done&&(o=O.return)&&o.call(O)}finally{if(i)throw i.error}}}}catch(Nt){r={error:Nt}}finally{try{l&&!l.done&&(n=f.return)&&n.call(f)}finally{if(r)throw r.error}}return!0}else if(u)return this._rateLimits.all=new Date(s+Ne(s,u)),!0;return!1},e}(),Tr=v(),kr=function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sendEvent=function(r){return this._sendRequest(ne(r,this._api),r)},t.prototype.sendSession=function(r){return this._sendRequest(re(r,this._api),r)},t.prototype._sendRequest=function(r,n){var i=this;if(this._isRateLimited(r.type))return Promise.reject({event:n,type:r.type,reason:"Transport locked till "+this._disabledUntil(r.type)+" due to too many requests.",status:429});var o={body:r.body,method:"POST",referrerPolicy:Le()?"origin":""};return this.options.fetchParameters!==void 0&&Object.assign(o,this.options.fetchParameters),this.options.headers!==void 0&&(o.headers=this.options.headers),this._buffer.add(new w(function(s,a){Tr.fetch(r.url,o).then(function(u){var f={"x-sentry-rate-limits":u.headers.get("X-Sentry-Rate-Limits"),"retry-after":u.headers.get("Retry-After")};i._handleResponse({requestType:r.type,response:u,headers:f,resolve:s,reject:a})}).catch(a)}))},t}(ue),xr=function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.sendEvent=function(r){return this._sendRequest(ne(r,this._api),r)},t.prototype.sendSession=function(r){return this._sendRequest(re(r,this._api),r)},t.prototype._sendRequest=function(r,n){var i=this;return this._isRateLimited(r.type)?Promise.reject({event:n,type:r.type,reason:"Transport locked till "+this._disabledUntil(r.type)+" due to too many requests.",status:429}):this._buffer.add(new w(function(o,s){var a=new XMLHttpRequest;a.onreadystatechange=function(){if(a.readyState===4){var f={"x-sentry-rate-limits":a.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":a.getResponseHeader("Retry-After")};i._handleResponse({requestType:r.type,response:a,headers:f,resolve:o,reject:s})}},a.open("POST",r.url);for(var u in i.options.headers)i.options.headers.hasOwnProperty(u)&&a.setRequestHeader(u,i.options.headers[u]);a.send(r.body)}))},t}(ue),Rr=function(e){V(t,e);function t(){return e!==null&&e.apply(this,arguments)||this}return t.prototype.eventFromException=function(r,n){return Fr(this._options,r,n)},t.prototype.eventFromMessage=function(r,n,i){return n===void 0&&(n=F.Info),Or(this._options,r,n,i)},t.prototype._setupTransport=function(){if(!this._options.dsn)return e.prototype._setupTransport.call(this);var r=c(c({},this._options.transportOptions),{dsn:this._options.dsn});return this._options.transport?new this._options.transport(r):vt()?new kr(r):new xr(r)},t}(cr),It=0;function ce(){return It>0}function jr(){It+=1,setTimeout(function(){It-=1})}function M(e,t,r){if(t===void 0&&(t={}),typeof e!="function")return e;try{if(e.__sentry__)return e;if(e.__sentry_wrapped__)return e.__sentry_wrapped__}catch{return e}var n=function(){var s=Array.prototype.slice.call(arguments);try{r&&typeof r=="function"&&r.apply(this,arguments);var a=s.map(function(u){return M(u,t)});return e.handleEvent?e.handleEvent.apply(this,a):e.apply(this,a)}catch(u){throw jr(),nr(function(f){f.addEventProcessor(function(l){var d=c({},l);return t.mechanism&&(ht(d,void 0,void 0),B(d,t.mechanism)),d.extra=c(c({},d.extra),{arguments:s}),d}),rr(u)}),u}};try{for(var i in e)Object.prototype.hasOwnProperty.call(e,i)&&(n[i]=e[i])}catch{}e.prototype=e.prototype||{},n.prototype=e.prototype,Object.defineProperty(e,"__sentry_wrapped__",{enumerable:!1,value:n}),Object.defineProperties(n,{__sentry__:{enumerable:!1,value:!0},__sentry_original__:{enumerable:!1,value:e}});try{var o=Object.getOwnPropertyDescriptor(n,"name");o.configurable&&Object.defineProperty(n,"name",{get:function(){return e.name}})}catch{}return n}function Ir(e){if(e===void 0&&(e={}),!e.eventId){p.error("Missing eventId option in showReportDialog call");return}if(!e.dsn){p.error("Missing dsn option in showReportDialog call");return}var t=document.createElement("script");t.async=!0,t.src=new te(e.dsn).getReportDialogEndpoint(e),e.onLoad&&(t.onload=e.onLoad),(document.head||document.body).appendChild(t)}var Nr=function(){function e(t){this.name=e.id,this._onErrorHandlerInstalled=!1,this._onUnhandledRejectionHandlerInstalled=!1,this._options=c({onerror:!0,onunhandledrejection:!0},t)}return e.prototype.setupOnce=function(){Error.stackTraceLimit=50,this._options.onerror&&(p.log("Global Handler attached: onerror"),this._installGlobalOnErrorHandler()),this._options.onunhandledrejection&&(p.log("Global Handler attached: onunhandledrejection"),this._installGlobalOnUnhandledRejectionHandler())},e.prototype._installGlobalOnErrorHandler=function(){var t=this;this._onErrorHandlerInstalled||(P({callback:function(r){var n=r.error,i=b(),o=i.getIntegration(e),s=n&&n.__sentry_own_request__===!0;if(!(!o||ce()||s)){var a=i.getClient(),u=Y(n)?t._eventFromIncompleteOnError(r.msg,r.url,r.line,r.column):t._enhanceEventWithInitialFrame(Rt(n,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!1}),r.url,r.line,r.column);B(u,{handled:!1,type:"onerror"}),i.captureEvent(u,{originalException:n})}},type:"error"}),this._onErrorHandlerInstalled=!0)},e.prototype._installGlobalOnUnhandledRejectionHandler=function(){var t=this;this._onUnhandledRejectionHandlerInstalled||(P({callback:function(r){var n=r;try{"reason"in r?n=r.reason:"detail"in r&&"reason"in r.detail&&(n=r.detail.reason)}catch{}var i=b(),o=i.getIntegration(e),s=n&&n.__sentry_own_request__===!0;if(!o||ce()||s)return!0;var a=i.getClient(),u=Y(n)?t._eventFromRejectionWithPrimitive(n):Rt(n,void 0,{attachStacktrace:a&&a.getOptions().attachStacktrace,rejection:!0});u.level=F.Error,B(u,{handled:!1,type:"onunhandledrejection"}),i.captureEvent(u,{originalException:n})},type:"unhandledrejection"}),this._onUnhandledRejectionHandlerInstalled=!0)},e.prototype._eventFromIncompleteOnError=function(t,r,n,i){var o=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i,s=Lt(t)?t.message:t,a;if(D(s)){var u=s.match(o);u&&(a=u[1],s=u[2])}var f={exception:{values:[{type:a||"Error",value:s}]}};return this._enhanceEventWithInitialFrame(f,r,n,i)},e.prototype._eventFromRejectionWithPrimitive=function(t){return{exception:{values:[{type:"UnhandledRejection",value:"Non-Error promise rejection captured with value: "+String(t)}]}}},e.prototype._enhanceEventWithInitialFrame=function(t,r,n,i){t.exception=t.exception||{},t.exception.values=t.exception.values||[],t.exception.values[0]=t.exception.values[0]||{},t.exception.values[0].stacktrace=t.exception.values[0].stacktrace||{},t.exception.values[0].stacktrace.frames=t.exception.values[0].stacktrace.frames||[];var o=isNaN(parseInt(i,10))?void 0:i,s=isNaN(parseInt(n,10))?void 0:n,a=D(r)&&r.length>0?r:Ie();return t.exception.values[0].stacktrace.frames.length===0&&t.exception.values[0].stacktrace.frames.push({colno:o,filename:a,function:"?",in_app:!0,lineno:s}),t},e.id="GlobalHandlers",e}(),Cr=["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"],Pr=function(){function e(t){this.name=e.id,this._options=c({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}return e.prototype.setupOnce=function(){var t=v();if(this._options.setTimeout&&_(t,"setTimeout",this._wrapTimeFunction.bind(this)),this._options.setInterval&&_(t,"setInterval",this._wrapTimeFunction.bind(this)),this._options.requestAnimationFrame&&_(t,"requestAnimationFrame",this._wrapRAF.bind(this)),this._options.XMLHttpRequest&&"XMLHttpRequest"in t&&_(XMLHttpRequest.prototype,"send",this._wrapXHR.bind(this)),this._options.eventTarget){var r=Array.isArray(this._options.eventTarget)?this._options.eventTarget:Cr;r.forEach(this._wrapEventTarget.bind(this))}},e.prototype._wrapTimeFunction=function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=r[0];return r[0]=M(i,{mechanism:{data:{function:x(t)},handled:!0,type:"instrument"}}),t.apply(this,r)}},e.prototype._wrapRAF=function(t){return function(r){return t.call(this,M(r,{mechanism:{data:{function:"requestAnimationFrame",handler:x(t)},handled:!0,type:"instrument"}}))}},e.prototype._wrapEventTarget=function(t){var r=v(),n=r[t]&&r[t].prototype;!n||!n.hasOwnProperty||!n.hasOwnProperty("addEventListener")||(_(n,"addEventListener",function(i){return function(o,s,a){try{typeof s.handleEvent=="function"&&(s.handleEvent=M(s.handleEvent.bind(s),{mechanism:{data:{function:"handleEvent",handler:x(s),target:t},handled:!0,type:"instrument"}}))}catch{}return i.call(this,o,M(s,{mechanism:{data:{function:"addEventListener",handler:x(s),target:t},handled:!0,type:"instrument"}}),a)}}),_(n,"removeEventListener",function(i){return function(o,s,a){var u,f=s;try{var l=(u=f)===null||u===void 0?void 0:u.__sentry_wrapped__;l&&i.call(this,o,l,a)}catch{}return i.call(this,o,f,a)}}))},e.prototype._wrapXHR=function(t){return function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];var i=this,o=["onload","onerror","onprogress","onreadystatechange"];return o.forEach(function(s){s in i&&typeof i[s]=="function"&&_(i,s,function(a){var u={mechanism:{data:{function:s,handler:x(a)},handled:!0,type:"instrument"}};return a.__sentry_original__&&(u.mechanism.data.handler=x(a.__sentry_original__)),M(a,u)})}),t.apply(this,r)}},e.id="TryCatch",e}(),fe=function(){function e(t){this.name=e.id,this._options=c({console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0},t)}return e.prototype.addSentryBreadcrumb=function(t){this._options.sentry&&b().addBreadcrumb({category:"sentry."+(t.type==="transaction"?"transaction":"event"),event_id:t.event_id,level:t.level,message:N(t)},{event:t})},e.prototype.setupOnce=function(){var t=this;this._options.console&&P({callback:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];t._consoleBreadcrumb.apply(t,g(r))},type:"console"}),this._options.dom&&P({callback:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];t._domBreadcrumb.apply(t,g(r))},type:"dom"}),this._options.xhr&&P({callback:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];t._xhrBreadcrumb.apply(t,g(r))},type:"xhr"}),this._options.fetch&&P({callback:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];t._fetchBreadcrumb.apply(t,g(r))},type:"fetch"}),this._options.history&&P({callback:function(){for(var r=[],n=0;n<arguments.length;n++)r[n]=arguments[n];t._historyBreadcrumb.apply(t,g(r))},type:"history"})},e.prototype._consoleBreadcrumb=function(t){var r={category:"console",data:{arguments:t.args,logger:"console"},level:F.fromString(t.level),message:Ht(t.args," ")};if(t.level==="assert")if(t.args[0]===!1)r.message="Assertion failed: "+(Ht(t.args.slice(1)," ")||"console.assert"),r.data.arguments=t.args.slice(1);else return;b().addBreadcrumb(r,{input:t.args,level:t.level})},e.prototype._domBreadcrumb=function(t){var r;try{r=t.event.target?tt(t.event.target):tt(t.event)}catch{r="<unknown>"}r.length!==0&&b().addBreadcrumb({category:"ui."+t.name,message:r},{event:t.event,name:t.name})},e.prototype._xhrBreadcrumb=function(t){if(t.endTimestamp){if(t.xhr.__sentry_own_request__)return;var r=t.xhr.__sentry_xhr__||{},n=r.method,i=r.url,o=r.status_code,s=r.body;b().addBreadcrumb({category:"xhr",data:{method:n,url:i,status_code:o},type:"http"},{xhr:t.xhr,input:s});return}},e.prototype._fetchBreadcrumb=function(t){t.endTimestamp&&(t.fetchData.url.match(/sentry_key/)&&t.fetchData.method==="POST"||(t.error?b().addBreadcrumb({category:"fetch",data:t.fetchData,level:F.Error,type:"http"},{data:t.error,input:t.args}):b().addBreadcrumb({category:"fetch",data:c(c({},t.fetchData),{status_code:t.response.status}),type:"http"},{input:t.args,response:t.response})))},e.prototype._historyBreadcrumb=function(t){var r=v(),n=t.from,i=t.to,o=dt(r.location.href),s=dt(n),a=dt(i);s.path||(s=o),o.protocol===a.protocol&&o.host===a.host&&(i=a.relative),o.protocol===s.protocol&&o.host===s.host&&(n=s.relative),b().addBreadcrumb({category:"navigation",data:{from:n,to:i}})},e.id="Breadcrumbs",e}(),Lr="cause",Ur=5,Ar=function(){function e(t){t===void 0&&(t={}),this.name=e.id,this._key=t.key||Lr,this._limit=t.limit||Ur}return e.prototype.setupOnce=function(){st(function(t,r){var n=b().getIntegration(e);return n?n._handler(t,r):t})},e.prototype._handler=function(t,r){if(!t.exception||!t.exception.values||!r||!k(r.originalException,Error))return t;var n=this._walkErrorTree(r.originalException,this._key);return t.exception.values=g(n,t.exception.values),t},e.prototype._walkErrorTree=function(t,r,n){if(n===void 0&&(n=[]),!k(t[r],Error)||n.length+1>=this._limit)return n;var i=Q(t[r]),o=se(i);return this._walkErrorTree(t[r],r,g([o],n))},e.id="LinkedErrors",e}(),q=v(),Dr=function(){function e(){this.name=e.id}return e.prototype.setupOnce=function(){st(function(t){var r,n,i;if(b().getIntegration(e)){if(!q.navigator&&!q.location&&!q.document)return t;var o=((r=t.request)===null||r===void 0?void 0:r.url)||((n=q.location)===null||n===void 0?void 0:n.href),s=(q.document||{}).referrer,a=(q.navigator||{}).userAgent,u=c(c(c({},(i=t.request)===null||i===void 0?void 0:i.headers),s&&{Referer:s}),a&&{"User-Agent":a}),f=c(c({},o&&{url:o}),{headers:u});return c(c({},t),{request:f})}return t})},e.id="UserAgent",e}(),Hr="sentry.javascript.browser",le="5.30.0",Br=function(e){V(t,e);function t(r){return r===void 0&&(r={}),e.call(this,Rr,r)||this}return t.prototype.showReportDialog=function(r){r===void 0&&(r={});var n=v().document;if(n){if(!this._isEnabled()){p.error("Trying to call showReportDialog with Sentry Client disabled");return}Ir(c(c({},r),{dsn:r.dsn||this.getDsn()}))}},t.prototype._prepareEvent=function(r,n,i){return r.platform=r.platform||"javascript",r.sdk=c(c({},r.sdk),{name:Hr,packages:g(r.sdk&&r.sdk.packages||[],[{name:"npm:@sentry/browser",version:le}]),version:le}),e.prototype._prepareEvent.call(this,r,n,i)},t.prototype._sendEvent=function(r){var n=this.getIntegration(fe);n&&n.addSentryBreadcrumb(r),e.prototype._sendEvent.call(this,r)},t}(ar),Mr=[new dr,new lr,new Pr,new fe,new Nr,new Ar,new Dr];function qr(e){if(e===void 0&&(e={}),e.defaultIntegrations===void 0&&(e.defaultIntegrations=Mr),e.release===void 0){var t=v();t.SENTRY_RELEASE&&t.SENTRY_RELEASE.id&&(e.release=t.SENTRY_RELEASE.id)}e.autoSessionTracking===void 0&&(e.autoSessionTracking=!1),fr(Br,e),e.autoSessionTracking&&Vr()}function Vr(){var e=v(),t=b(),r=document.readyState==="complete",n=!1,i=function(){n&&r&&t.endSession()},o=function(){r=!0,i(),e.removeEventListener("load",o)};t.startSession(),r||e.addEventListener("load",o);try{var s=new PerformanceObserver(function(u,f){u.getEntries().forEach(function(l){l.name==="first-contentful-paint"&&l.startTime<a&&(f.disconnect(),n=!0,i())})}),a=document.visibilityState==="hidden"?0:1/0;document.addEventListener("visibilitychange",function(u){a=Math.min(a,u.timeStamp)},{once:!0}),s.observe({type:"paint",buffered:!0})}catch{n=!0,i()}}function pe(e,t,r,n){if(!(e instanceof Error))throw e;if(!(typeof window>"u"&&t||n))throw e.message+=" on line "+r,e;var i,o,s,a;try{n=n||require("fs").readFileSync(t,{encoding:"utf8"}),i=3,o=n.split(`
`),s=Math.max(r-i,0),a=Math.min(o.length,r+i)}catch(u){return e.message+=" - could not read from "+t+" ("+u.message+")",void pe(e,null,r)}i=o.slice(s,a).map(function(u,f){var l=f+s+1;return(l==r?"  > ":"    ")+l+"| "+u}).join(`
`),e.path=t;try{e.message=(t||"Pug")+":"+r+`
`+i+`

`+e.message}catch{}throw e}function Wr(e){var t="",r,n;try{n=1,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<div class="g-config-breadcrumb-container"></div>',n=2,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<p class="g-sentry-description">',n=3,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+"To track errors in Sentry, enter your Sentry project DSNs here.</p>",n=4,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<form id="g-sentry-server-form" role="form">',n=5,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<div class="form-group">',n=6,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<label class="control-label" for="g-sentry-server-dsn">',n=6,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+"Sentry Server DSN</label>",n=7,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<input class="input-sm form-control" id="g-sentry-server-dsn" type="text" placeholder="Tracking ID"/></div>',n=9,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<p class="g-validation-failed-message" id="g-sentry-server-error-message"></p>',n=10,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<input class="btn btn-sm btn-primary" type="submit" value="Save"/></form>',n=12,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<form id="g-sentry-client-form" role="form">',n=13,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<div class="form-group">',n=14,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<label class="control-label" for="g-sentry-client-dsn">',n=14,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+"Sentry Client DSN</label>",n=15,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<input class="input-sm form-control" id="g-sentry-client-dsn" type="text" placeholder="Tracking ID"/></div>',n=17,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<p class="g-validation-failed-message" id="g-sentry-client-error-message"></p>',n=18,r="/home/circleci/project/girder/plugins/sentry/girder_sentry/web_client/templates/configView.pug",t=t+'<input class="btn btn-sm btn-primary" type="submit" value="Save"/></form>'}catch(i){pe(i,r,n)}return t}const en="",Yr=girder.views.widgets.PluginConfigBreadcrumbWidget,Gr=girder.views.View,{restRequest:de}=girder.rest,$r=girder.events;var Xr=Gr.extend({events:{"submit #g-sentry-server-form":function(e){e.preventDefault(),this.$("#g-sentry-server-error-message").empty(),this._saveSettings([{key:"sentry.backend_dsn",value:this.$("#g-sentry-server-dsn").val().trim()}],{errorTarget:"#g-sentry-server-error-message"})},"submit #g-sentry-client-form":function(e){e.preventDefault(),this.$("#g-sentry-client-error-message").empty(),this._saveSettings([{key:"sentry.frontend_dsn",value:this.$("#g-sentry-client-dsn").val().trim()}],{errorTarget:"#g-sentry-client-error-message"})}},initialize:function(){de({method:"GET",url:"system/setting",data:{list:JSON.stringify(["sentry.backend_dsn","sentry.frontend_dsn"])}}).done(e=>{this.render(),this.$("#g-sentry-server-dsn").val(e["sentry.backend_dsn"]),this.$("#g-sentry-client-dsn").val(e["sentry.frontend_dsn"])})},render:function(){return this.$el.html(Wr()),this.breadcrumb||(this.breadcrumb=new Yr({pluginName:"Sentry",el:this.$(".g-config-breadcrumb-container"),parentView:this}).render()),this},_saveSettings:function(e,t){de({method:"PUT",url:"system/setting",data:{list:JSON.stringify(e)},error:null}).done(()=>{$r.trigger("g:alert",{icon:"ok",text:"Settings saved.",type:"success",timeout:4e3})}).fail(r=>{this.$(t.errorTarget).text(r.responseJSON.message)})}});const Jr=girder.router,zr=girder.events,{exposePluginConfig:Kr}=girder.utilities.PluginUtils;Kr("sentry","plugins/sentry/config"),Jr.route("plugins/sentry/config","SentryConfig",function(){zr.trigger("g:navigateTo",Xr)});const Qr=girder.events,{restRequest:Zr}=girder.rest;Qr.on("g:appload.after",function(){Zr({method:"GET",url:"sentry/dsn"}).done(e=>{e.sentry_dsn&&qr({dsn:e.sentry_dsn})})})});
