UNPKG

@sentry/browser

Version:
2 lines 62.8 kB
/*! @sentry/browser 6.19.7 (5b3a175) | https://github.com/getsentry/sentry-javascript */ var Sentry=function(t){var e;t.Severity=void 0,(e=t.Severity||(t.Severity={})).Fatal="fatal",e.Error="error",e.Warning="warning",e.Log="log",e.Info="info",e.Debug="debug",e.Critical="critical";const n={};function r(){return"undefined"!=typeof window?window:"undefined"!=typeof self?self:n}function i(t,e,n){const i=n||r(),s=i.__SENTRY__=i.__SENTRY__||{};return s[t]||(s[t]=e())}const s=Object.prototype.toString;function o(t){switch(s.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return b(t,Error)}}function c(t,e){return s.call(t)===`[object ${e}]`}function u(t){return c(t,"ErrorEvent")}function a(t){return c(t,"DOMError")}function h(t){return c(t,"String")}function f(t){return null===t||"object"!=typeof t&&"function"!=typeof t}function l(t){return c(t,"Object")}function d(t){return"undefined"!=typeof Event&&b(t,Event)}function p(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function b(t,e){try{return t instanceof e}catch(t){return!1}}function y(t,e){try{let n=t;const r=5,i=80,s=[];let o=0,c=0;const u=" > ",a=u.length;let h;for(;n&&o++<r&&(h=v(n,e),!("html"===h||o>1&&c+s.length*a+h.length>=i));)s.push(h),c+=h.length,n=n.parentNode;return s.reverse().join(u)}catch(t){return"<unknown>"}}function v(t,e){const n=t,r=[];let i,s,o,c,u;if(!n||!n.tagName)return"";r.push(n.tagName.toLowerCase());const a=e&&e.length?e.filter((t=>n.getAttribute(t))).map((t=>[t,n.getAttribute(t)])):null;if(a&&a.length)a.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else if(n.id&&r.push(`#${n.id}`),i=n.className,i&&h(i))for(s=i.split(/\s+/),u=0;u<s.length;u++)r.push(`.${s[u]}`);const f=["type","name","title","alt"];for(u=0;u<f.length;u++)o=f[u],c=n.getAttribute(o),c&&r.push(`[${o}="${c}"]`);return r.join("")}const m=Object.setPrototypeOf||({__proto__:[]}instanceof Array?function(t,e){return t.__proto__=e,t}:function(t,e){for(const n in e)Object.prototype.hasOwnProperty.call(t,n)||(t[n]=e[n]);return t});class g extends Error{constructor(t){super(t),this.message=t,this.name=new.target.prototype.constructor.name,m(this,new.target.prototype)}}const O=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+))?@)([\w.-]+)(?::(\d+))?\/(.+)/;function j(t,e=!1){const{host:n,path:r,pass:i,port:s,projectId:o,protocol:c,publicKey:u}=t;return`${c}://${u}${e&&i?`:${i}`:""}@${n}${s?`:${s}`:""}/${r?`${r}/`:r}${o}`}function w(t){return"user"in t&&!("publicKey"in t)&&(t.publicKey=t.user),{user:t.publicKey||"",protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function E(t){const e="string"==typeof t?function(t){const e=O.exec(t);if(!e)throw new g(`Invalid Sentry Dsn: ${t}`);const[n,r,i="",s,o="",c]=e.slice(1);let u="",a=c;const h=a.split("/");if(h.length>1&&(u=h.slice(0,-1).join("/"),a=h.pop()),a){const t=a.match(/^\d+/);t&&(a=t[0])}return w({host:s,pass:i,path:u,projectId:a,port:o,protocol:n,publicKey:r})}(t):w(t);return function(t){const{port:e,projectId:n,protocol:r}=t;if(["protocol","publicKey","host","projectId"].forEach((e=>{if(!t[e])throw new g(`Invalid Sentry Dsn: ${e} missing`)})),!n.match(/^\d+$/))throw new g(`Invalid Sentry Dsn: Invalid projectId ${n}`);if(!function(t){return"http"===t||"https"===t}(r))throw new g(`Invalid Sentry Dsn: Invalid protocol ${r}`);if(e&&isNaN(parseInt(e,10)))throw new g(`Invalid Sentry Dsn: Invalid port ${e}`)}(e),e}const $=["fatal","error","warning","log","info","debug","critical"],x=r(),S=["debug","info","warn","error","log","assert"];function _(t){const e=r();if(!("console"in e))return t();const n=e.console,i={};S.forEach((t=>{const r=n[t]&&n[t].__sentry_original__;t in e.console&&r&&(i[t]=n[t],n[t]=r)}));try{return t()}finally{Object.keys(i).forEach((t=>{n[t]=i[t]}))}}function k(){let t=!1;const e={enable:()=>{t=!0},disable:()=>{t=!1}};return S.forEach((n=>{e[n]=(...e)=>{t&&_((()=>{x.console[n](`Sentry Logger [${n}]:`,...e)}))}})),e}let T;function D(t,e=0){return"string"!=typeof t||0===e||t.length<=e?t:`${t.substr(0,e)}...`}function R(t,e){if(!Array.isArray(t))return"";const n=[];for(let e=0;e<t.length;e++){const r=t[e];try{n.push(String(r))}catch(t){n.push("[value cannot be serialized]")}}return n.join(e)}function I(t,e){return!!h(t)&&(c(e,"RegExp")?e.test(t):"string"==typeof e&&-1!==t.indexOf(e))}function N(t,e,n){if(!(e in t))return;const r=t[e],i=n(r);if("function"==typeof i)try{M(i,r)}catch(t){}t[e]=i}function C(t,e,n){Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}function M(t,e){const n=e.prototype||{};t.prototype=e.prototype=n,C(t,"__sentry_original__",e)}function q(t){return t.__sentry_original__}function L(t){let e=t;if(o(t))e=Object.assign({message:t.message,name:t.name,stack:t.stack},A(t));else if(d(t)){const n=t;e=Object.assign({type:n.type,target:U(n.target),currentTarget:U(n.currentTarget)},A(n)),"undefined"!=typeof CustomEvent&&b(t,CustomEvent)&&(e.detail=n.detail)}return e}function U(t){try{return e=t,"undefined"!=typeof Element&&b(e,Element)?y(t):Object.prototype.toString.call(t)}catch(t){return"<unknown>"}var e}function A(t){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}function F(t,e=40){const n=Object.keys(L(t));if(n.sort(),!n.length)return"[object has no keys]";if(n[0].length>=e)return D(n[0],e);for(let t=n.length;t>0;t--){const r=n.slice(0,t).join(", ");if(!(r.length>e))return t===n.length?r:D(r,e)}return""}function P(t){if(l(t)){const e={};for(const n of Object.keys(t))void 0!==t[n]&&(e[n]=P(t[n]));return e}return Array.isArray(t)?t.map(P):t}T=i("logger",k);function H(...t){const e=t.sort(((t,e)=>t[0]-e[0])).map((t=>t[1]));return(t,n=0)=>{const r=[];for(const i of t.split("\n").slice(n))for(const t of e){const e=t(i);if(e){r.push(e);break}}return function(t){if(!t.length)return[];let e=t;const n=e[0].function||"",r=e[e.length-1].function||"";-1===n.indexOf("captureMessage")&&-1===n.indexOf("captureException")||(e=e.slice(1));-1!==r.indexOf("sentryWrapped")&&(e=e.slice(0,-1));return e.slice(0,50).map((t=>Object.assign(Object.assign({},t),{filename:t.filename||e[0].filename,function:t.function||"?"}))).reverse()}(r)}}const B="<anonymous>";function X(t){try{return t&&"function"==typeof t&&t.name||B}catch(t){return B}}function z(){if(!("fetch"in r()))return!1;try{return new Headers,new Request(""),new Response,!0}catch(t){return!1}}function J(t){return t&&/^function fetch\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function K(){if(!z())return!1;try{return new Request("_",{referrerPolicy:"origin"}),!0}catch(t){return!1}}const W=r(),G={},V={};function Q(t){if(!V[t])switch(V[t]=!0,t){case"console":!function(){if(!("console"in W))return;S.forEach((function(t){t in W.console&&N(W.console,t,(function(e){return function(...n){Z("console",{args:n,level:t}),e&&e.apply(W.console,n)}}))}))}();break;case"dom":!function(){if(!("document"in W))return;const t=Z.bind(null,"dom"),e=st(t,!0);W.document.addEventListener("click",e,!1),W.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach((e=>{const n=W[e]&&W[e].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(N(n,"addEventListener",(function(e){return function(n,r,i){if("click"===n||"keypress"==n)try{const r=this,s=r.__sentry_instrumentation_handlers__=r.__sentry_instrumentation_handlers__||{},o=s[n]=s[n]||{refCount:0};if(!o.handler){const r=st(t);o.handler=r,e.call(this,n,r,i)}o.refCount+=1}catch(t){}return e.call(this,n,r,i)}})),N(n,"removeEventListener",(function(t){return function(e,n,r){if("click"===e||"keypress"==e)try{const n=this,i=n.__sentry_instrumentation_handlers__||{},s=i[e];s&&(s.refCount-=1,s.refCount<=0&&(t.call(this,e,s.handler,r),s.handler=void 0,delete i[e]),0===Object.keys(i).length&&delete n.__sentry_instrumentation_handlers__)}catch(t){}return t.call(this,e,n,r)}})))}))}();break;case"xhr":!function(){if(!("XMLHttpRequest"in W))return;const t=XMLHttpRequest.prototype;N(t,"open",(function(t){return function(...e){const n=this,r=e[1],i=n.__sentry_xhr__={method:h(e[0])?e[0].toUpperCase():e[0],url:e[1]};h(r)&&"POST"===i.method&&r.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const s=function(){if(4===n.readyState){try{i.status_code=n.status}catch(t){}Z("xhr",{args:e,endTimestamp:Date.now(),startTimestamp:Date.now(),xhr:n})}};return"onreadystatechange"in n&&"function"==typeof n.onreadystatechange?N(n,"onreadystatechange",(function(t){return function(...e){return s(),t.apply(n,e)}})):n.addEventListener("readystatechange",s),t.apply(n,e)}})),N(t,"send",(function(t){return function(...e){return this.__sentry_xhr__&&void 0!==e[0]&&(this.__sentry_xhr__.body=e[0]),Z("xhr",{args:e,startTimestamp:Date.now(),xhr:this}),t.apply(this,e)}}))}();break;case"fetch":!function(){if(!function(){if(!z())return!1;const t=r();if(J(t.fetch))return!0;let e=!1;const n=t.document;if(n&&"function"==typeof n.createElement)try{const t=n.createElement("iframe");t.hidden=!0,n.head.appendChild(t),t.contentWindow&&t.contentWindow.fetch&&(e=J(t.contentWindow.fetch)),n.head.removeChild(t)}catch(t){T.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return e}())return;N(W,"fetch",(function(t){return function(...e){const n={args:e,fetchData:{method:tt(e),url:et(e)},startTimestamp:Date.now()};return Z("fetch",Object.assign({},n)),t.apply(W,e).then((t=>(Z("fetch",Object.assign(Object.assign({},n),{endTimestamp:Date.now(),response:t})),t)),(t=>{throw Z("fetch",Object.assign(Object.assign({},n),{endTimestamp:Date.now(),error:t})),t}))}}))}();break;case"history":!function(){if(!function(){const t=r(),e=t.chrome,n=e&&e.app&&e.app.runtime,i="history"in t&&!!t.history.pushState&&!!t.history.replaceState;return!n&&i}())return;const t=W.onpopstate;function e(t){return function(...e){const n=e.length>2?e[2]:void 0;if(n){const t=nt,e=String(n);nt=e,Z("history",{from:t,to:e})}return t.apply(this,e)}}W.onpopstate=function(...e){const n=W.location.href,r=nt;if(nt=n,Z("history",{from:r,to:n}),t)try{return t.apply(this,e)}catch(t){}},N(W.history,"pushState",e),N(W.history,"replaceState",e)}();break;case"error":ot=W.onerror,W.onerror=function(t,e,n,r,i){return Z("error",{column:r,error:i,line:n,msg:t,url:e}),!!ot&&ot.apply(this,arguments)};break;case"unhandledrejection":ct=W.onunhandledrejection,W.onunhandledrejection=function(t){return Z("unhandledrejection",t),!ct||ct.apply(this,arguments)};break;default:return void T.warn("unknown instrumentation type:",t)}}function Y(t,e){G[t]=G[t]||[],G[t].push(e),Q(t)}function Z(t,e){if(t&&G[t])for(const n of G[t]||[])try{n(e)}catch(e){T.error(`Error while triggering instrumentation handler.\nType: ${t}\nName: ${X(n)}\nError:`,e)}}function tt(t=[]){return"Request"in W&&b(t[0],Request)&&t[0].method?String(t[0].method).toUpperCase():t[1]&&t[1].method?String(t[1].method).toUpperCase():"GET"}function et(t=[]){return"string"==typeof t[0]?t[0]:"Request"in W&&b(t[0],Request)?t[0].url:String(t[0])}let nt;let rt,it;function st(t,e=!1){return n=>{if(!n||it===n)return;if(function(t){if("keypress"!==t.type)return!1;try{const e=t.target;if(!e||!e.tagName)return!0;if("INPUT"===e.tagName||"TEXTAREA"===e.tagName||e.isContentEditable)return!1}catch(t){}return!0}(n))return;const r="keypress"===n.type?"input":n.type;(void 0===rt||function(t,e){if(!t)return!0;if(t.type!==e.type)return!0;try{if(t.target!==e.target)return!0}catch(t){}return!1}(it,n))&&(t({event:n,name:r,global:e}),it=n),clearTimeout(rt),rt=W.setTimeout((()=>{rt=void 0}),1e3)}}let ot=null;let ct=null;function ut(){const t=r(),e=t.crypto||t.msCrypto;if(void 0!==e&&e.getRandomValues){const t=new Uint16Array(8);e.getRandomValues(t),t[3]=4095&t[3]|16384,t[4]=16383&t[4]|32768;const n=t=>{let e=t.toString(16);for(;e.length<4;)e=`0${e}`;return e};return n(t[0])+n(t[1])+n(t[2])+n(t[3])+n(t[4])+n(t[5])+n(t[6])+n(t[7])}return"xxxxxxxxxxxx4xxxyxxxxxxxxxxxxxxx".replace(/[xy]/g,(t=>{const e=16*Math.random()|0;return("x"===t?e:3&e|8).toString(16)}))}function at(t){if(!t)return{};const e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};const n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],relative:e[5]+n+r}}function ht(t){return t.exception&&t.exception.values?t.exception.values[0]:void 0}function ft(t){const{message:e,event_id:n}=t;if(e)return e;const r=ht(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function lt(t,e,n){const r=t.exception=t.exception||{},i=r.values=r.values||[],s=i[0]=i[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function dt(t,e){const n=ht(t);if(!n)return;const r=n.mechanism;if(n.mechanism=Object.assign(Object.assign(Object.assign({},{type:"generic",handled:!0}),r),e),e&&"data"in e){const t=Object.assign(Object.assign({},r&&r.data),e.data);n.mechanism.data=t}}function pt(t){if(t&&t.__sentry_captured__)return!0;try{C(t,"__sentry_captured__",!0)}catch(t){}return!1}function bt(t,e=1/0,n=1/0){try{return vt("",t,e,n)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function yt(t,e=3,n=102400){const r=bt(t,e);return i=r,function(t){return~-encodeURI(t).split(/%..|./).length}(JSON.stringify(i))>n?yt(t,e-1,n):r;var i}function vt(t,e,n=1/0,r=1/0,i=function(){const t="function"==typeof WeakSet,e=t?new WeakSet:[];return[function(n){if(t)return!!e.has(n)||(e.add(n),!1);for(let t=0;t<e.length;t++)if(e[t]===n)return!0;return e.push(n),!1},function(n){if(t)e.delete(n);else for(let t=0;t<e.length;t++)if(e[t]===n){e.splice(t,1);break}}]}()){const[s,c]=i,u=e;if(u&&"function"==typeof u.toJSON)try{return u.toJSON()}catch(t){}if(null===e||["number","boolean","string"].includes(typeof e)&&("number"!=typeof(a=e)||a==a))return e;var a;const h=function(t,e){try{return"domain"===t&&e&&"object"==typeof e&&e.t?"[Domain]":"domainEmitter"===t?"[DomainEmitter]":"undefined"!=typeof global&&e===global?"[Global]":"undefined"!=typeof window&&e===window?"[Window]":"undefined"!=typeof document&&e===document?"[Document]":function(t){return l(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}(e)?"[SyntheticEvent]":"number"==typeof e&&e!=e?"[NaN]":void 0===e?"[undefined]":"function"==typeof e?`[Function: ${X(e)}]`:"symbol"==typeof e?`[${String(e)}]`:"bigint"==typeof e?`[BigInt: ${String(e)}]`:`[object ${Object.getPrototypeOf(e).constructor.name}]`}catch(t){return`**non-serializable** (${t})`}}(t,e);if(!h.startsWith("[object "))return h;if(0===n)return h.replace("object ","");if(s(e))return"[Circular ~]";const f=Array.isArray(e)?[]:{};let p=0;const b=o(e)||d(e)?L(e):e;for(const t in b){if(!Object.prototype.hasOwnProperty.call(b,t))continue;if(p>=r){f[t]="[MaxProperties ~]";break}const e=b[t];f[t]=vt(t,e,n-1,r,i),p+=1}return c(e),f}function mt(t){return new Ot((e=>{e(t)}))}function gt(t){return new Ot(((e,n)=>{n(t)}))}class Ot{constructor(t){this.i=0,this.o=[],this.u=t=>{this.h(1,t)},this.l=t=>{this.h(2,t)},this.h=(t,e)=>{0===this.i&&(p(e)?e.then(this.u,this.l):(this.i=t,this.p=e,this.v()))},this.v=()=>{if(0===this.i)return;const t=this.o.slice();this.o=[],t.forEach((t=>{t[0]||(1===this.i&&t[1](this.p),2===this.i&&t[2](this.p),t[0]=!0)}))};try{t(this.u,this.l)}catch(t){this.l(t)}}then(t,e){return new Ot(((n,r)=>{this.o.push([!1,e=>{if(t)try{n(t(e))}catch(t){r(t)}else n(e)},t=>{if(e)try{n(e(t))}catch(t){r(t)}else r(t)}]),this.v()}))}catch(t){return this.then((t=>t),t)}finally(t){return new Ot(((e,n)=>{let r,i;return this.then((e=>{i=!1,r=e,t&&t()}),(e=>{i=!0,r=e,t&&t()})).then((()=>{i?n(r):e(r)}))}))}}function jt(t){const e=[];function n(t){return e.splice(e.indexOf(t),1)[0]}return{$:e,add:function(r){if(!(void 0===t||e.length<t))return gt(new g("Not adding Promise due to buffer limit reached."));const i=r();return-1===e.indexOf(i)&&e.push(i),i.then((()=>n(i))).then(null,(()=>n(i).then(null,(()=>{})))),i},drain:function(t){return new Ot(((n,r)=>{let i=e.length;if(!i)return n(!0);const s=setTimeout((()=>{t&&t>0&&n(!1)}),t);e.forEach((t=>{mt(t).then((()=>{--i||(clearTimeout(s),n(!0))}),r)}))}))}}}function wt(e){return"warn"===e?t.Severity.Warning:function(t){return-1!==$.indexOf(t)}(e)?e:t.Severity.Log}function Et(t){return t>=200&&t<300?"success":429===t?"rate_limit":t>=400&&t<500?"invalid":t>=500?"failed":"unknown"}const $t={nowSeconds:()=>Date.now()/1e3};const xt=function(){const{performance:t}=r();if(!t||!t.now)return;return{now:()=>t.now(),timeOrigin:Date.now()-t.now()}}(),St=void 0===xt?$t:{nowSeconds:()=>(xt.timeOrigin+xt.now())/1e3},_t=$t.nowSeconds.bind($t),kt=St.nowSeconds.bind(St);function Tt(t,e=[]){return[t,e]}function Dt(t){const[e,n]=t,r=JSON.stringify(e);return n.reduce(((t,e)=>{const[n,r]=e,i=f(r)?String(r):JSON.stringify(r);return`${t}\n${JSON.stringify(n)}\n${i}`}),r)}(()=>{const{performance:t}=r();if(!t||!t.now)return;const e=36e5,n=t.now(),i=Date.now(),s=t.timeOrigin?Math.abs(t.timeOrigin+n-i):e,o=s<e,c=t.timing&&t.timing.navigationStart,u="number"==typeof c?Math.abs(c+n-i):e;(o||u<e)&&(s<=u&&t.timeOrigin)})();function Rt(t,e){return t[e]||t.all||0}function It(t,e,n=Date.now()){return Rt(t,e)>n}function Nt(t,e,n=Date.now()){const r=Object.assign({},t),i=e["x-sentry-rate-limits"],s=e["retry-after"];if(i)for(const t of i.trim().split(",")){const e=t.split(":",2),i=parseInt(e[0],10),s=1e3*(isNaN(i)?60:i);if(e[1])for(const t of e[1].split(";"))r[t]=n+s;else r.all=n+s}else s&&(r.all=n+function(t,e=Date.now()){const n=parseInt(`${t}`,10);if(!isNaN(n))return 1e3*n;const r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}(s,n));return r}class Ct{constructor(){this.m=!1,this.g=[],this.O=[],this.j=[],this.S={},this._={},this.k={},this.T={},this.D={}}static clone(t){const e=new Ct;return t&&(e.j=[...t.j],e._=Object.assign({},t._),e.k=Object.assign({},t.k),e.T=Object.assign({},t.T),e.S=t.S,e.R=t.R,e.I=t.I,e.N=t.N,e.C=t.C,e.M=t.M,e.O=[...t.O],e.q=t.q),e}addScopeListener(t){this.g.push(t)}addEventProcessor(t){return this.O.push(t),this}setUser(t){return this.S=t||{},this.N&&this.N.update({user:t}),this.L(),this}getUser(){return this.S}getRequestSession(){return this.q}setRequestSession(t){return this.q=t,this}setTags(t){return this._=Object.assign(Object.assign({},this._),t),this.L(),this}setTag(t,e){return this._=Object.assign(Object.assign({},this._),{[t]:e}),this.L(),this}setExtras(t){return this.k=Object.assign(Object.assign({},this.k),t),this.L(),this}setExtra(t,e){return this.k=Object.assign(Object.assign({},this.k),{[t]:e}),this.L(),this}setFingerprint(t){return this.M=t,this.L(),this}setLevel(t){return this.R=t,this.L(),this}setTransactionName(t){return this.C=t,this.L(),this}setTransaction(t){return this.setTransactionName(t)}setContext(t,e){return null===e?delete this.T[t]:this.T=Object.assign(Object.assign({},this.T),{[t]:e}),this.L(),this}setSpan(t){return this.I=t,this.L(),this}getSpan(){return this.I}getTransaction(){const t=this.getSpan();return t&&t.transaction}setSession(t){return t?this.N=t:delete this.N,this.L(),this}getSession(){return this.N}update(t){if(!t)return this;if("function"==typeof t){const e=t(this);return e instanceof Ct?e:this}return t instanceof Ct?(this._=Object.assign(Object.assign({},this._),t._),this.k=Object.assign(Object.assign({},this.k),t.k),this.T=Object.assign(Object.assign({},this.T),t.T),t.S&&Object.keys(t.S).length&&(this.S=t.S),t.R&&(this.R=t.R),t.M&&(this.M=t.M),t.q&&(this.q=t.q)):l(t)&&(t=t,this._=Object.assign(Object.assign({},this._),t.tags),this.k=Object.assign(Object.assign({},this.k),t.extra),this.T=Object.assign(Object.assign({},this.T),t.contexts),t.user&&(this.S=t.user),t.level&&(this.R=t.level),t.fingerprint&&(this.M=t.fingerprint),t.requestSession&&(this.q=t.requestSession)),this}clear(){return this.j=[],this._={},this.k={},this.S={},this.T={},this.R=void 0,this.C=void 0,this.M=void 0,this.q=void 0,this.I=void 0,this.N=void 0,this.L(),this}addBreadcrumb(t,e){const n="number"==typeof e?Math.min(e,100):100;if(n<=0)return this;const r=Object.assign({timestamp:_t()},t);return this.j=[...this.j,r].slice(-n),this.L(),this}clearBreadcrumbs(){return this.j=[],this.L(),this}applyToEvent(t,e){if(this.k&&Object.keys(this.k).length&&(t.extra=Object.assign(Object.assign({},this.k),t.extra)),this._&&Object.keys(this._).length&&(t.tags=Object.assign(Object.assign({},this._),t.tags)),this.S&&Object.keys(this.S).length&&(t.user=Object.assign(Object.assign({},this.S),t.user)),this.T&&Object.keys(this.T).length&&(t.contexts=Object.assign(Object.assign({},this.T),t.contexts)),this.R&&(t.level=this.R),this.C&&(t.transaction=this.C),this.I){t.contexts=Object.assign({trace:this.I.getTraceContext()},t.contexts);const e=this.I.transaction&&this.I.transaction.name;e&&(t.tags=Object.assign({transaction:e},t.tags))}return this.U(t),t.breadcrumbs=[...t.breadcrumbs||[],...this.j],t.breadcrumbs=t.breadcrumbs.length>0?t.breadcrumbs:void 0,t.sdkProcessingMetadata=this.D,this.A([...Mt(),...this.O],t,e)}setSDKProcessingMetadata(t){return this.D=Object.assign(Object.assign({},this.D),t),this}A(t,e,n,r=0){return new Ot(((i,s)=>{const o=t[r];if(null===e||"function"!=typeof o)i(e);else{const c=o(Object.assign({},e),n);p(c)?c.then((e=>this.A(t,e,n,r+1).then(i))).then(null,s):this.A(t,c,n,r+1).then(i).then(null,s)}}))}L(){this.m||(this.m=!0,this.g.forEach((t=>{t(this)})),this.m=!1)}U(t){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],this.M&&(t.fingerprint=t.fingerprint.concat(this.M)),t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}}function Mt(){return i("globalEventProcessors",(()=>[]))}function qt(t){Mt().push(t)}class Lt{constructor(t){this.errors=0,this.sid=ut(),this.duration=0,this.status="ok",this.init=!0,this.ignoreDuration=!1;const e=kt();this.timestamp=e,this.started=e,t&&this.update(t)}update(t={}){if(t.user&&(!this.ipAddress&&t.user.ip_address&&(this.ipAddress=t.user.ip_address),this.did||t.did||(this.did=t.user.id||t.user.email||t.user.username)),this.timestamp=t.timestamp||kt(),t.ignoreDuration&&(this.ignoreDuration=t.ignoreDuration),t.sid&&(this.sid=32===t.sid.length?t.sid:ut()),void 0!==t.init&&(this.init=t.init),!this.did&&t.did&&(this.did=`${t.did}`),"number"==typeof t.started&&(this.started=t.started),this.ignoreDuration)this.duration=void 0;else if("number"==typeof t.duration)this.duration=t.duration;else{const t=this.timestamp-this.started;this.duration=t>=0?t:0}t.release&&(this.release=t.release),t.environment&&(this.environment=t.environment),!this.ipAddress&&t.ipAddress&&(this.ipAddress=t.ipAddress),!this.userAgent&&t.userAgent&&(this.userAgent=t.userAgent),"number"==typeof t.errors&&(this.errors=t.errors),t.status&&(this.status=t.status)}close(t){t?this.update({status:t}):"ok"===this.status?this.update({status:"exited"}):this.update()}toJSON(){return P({sid:`${this.sid}`,init:this.init,started:new Date(1e3*this.started).toISOString(),timestamp:new Date(1e3*this.timestamp).toISOString(),status:this.status,errors:this.errors,did:"number"==typeof this.did||"string"==typeof this.did?`${this.did}`:void 0,duration:this.duration,attrs:{release:this.release,environment:this.environment,ip_address:this.ipAddress,user_agent:this.userAgent}})}}const Ut=100;class At{constructor(t,e=new Ct,n=4){this.F=n,this.P=[{}],this.getStackTop().scope=e,t&&this.bindClient(t)}isOlderThan(t){return this.F<t}bindClient(t){this.getStackTop().client=t,t&&t.setupIntegrations&&t.setupIntegrations()}pushScope(){const t=Ct.clone(this.getScope());return this.getStack().push({client:this.getClient(),scope:t}),t}popScope(){return!(this.getStack().length<=1)&&!!this.getStack().pop()}withScope(t){const e=this.pushScope();try{t(e)}finally{this.popScope()}}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getStack(){return this.P}getStackTop(){return this.P[this.P.length-1]}captureException(t,e){const n=this.H=e&&e.event_id?e.event_id:ut();let r=e;if(!e){let e;try{throw new Error("Sentry syntheticException")}catch(t){e=t}r={originalException:t,syntheticException:e}}return this.B("captureException",t,Object.assign(Object.assign({},r),{event_id:n})),n}captureMessage(t,e,n){const r=this.H=n&&n.event_id?n.event_id:ut();let i=n;if(!n){let e;try{throw new Error(t)}catch(t){e=t}i={originalException:t,syntheticException:e}}return this.B("captureMessage",t,e,Object.assign(Object.assign({},i),{event_id:r})),r}captureEvent(t,e){const n=e&&e.event_id?e.event_id:ut();return"transaction"!==t.type&&(this.H=n),this.B("captureEvent",t,Object.assign(Object.assign({},e),{event_id:n})),n}lastEventId(){return this.H}addBreadcrumb(t,e){const{scope:n,client:r}=this.getStackTop();if(!n||!r)return;const{beforeBreadcrumb:i=null,maxBreadcrumbs:s=Ut}=r.getOptions&&r.getOptions()||{};if(s<=0)return;const o=_t(),c=Object.assign({timestamp:o},t),u=i?_((()=>i(c,e))):c;null!==u&&n.addBreadcrumb(u,s)}setUser(t){const e=this.getScope();e&&e.setUser(t)}setTags(t){const e=this.getScope();e&&e.setTags(t)}setExtras(t){const e=this.getScope();e&&e.setExtras(t)}setTag(t,e){const n=this.getScope();n&&n.setTag(t,e)}setExtra(t,e){const n=this.getScope();n&&n.setExtra(t,e)}setContext(t,e){const n=this.getScope();n&&n.setContext(t,e)}configureScope(t){const{scope:e,client:n}=this.getStackTop();e&&n&&t(e)}run(t){const e=Pt(this);try{t(this)}finally{Pt(e)}}getIntegration(t){const e=this.getClient();if(!e)return null;try{return e.getIntegration(t)}catch(e){return T.warn(`Cannot retrieve integration ${t.id} from the current Hub`),null}}startSpan(t){return this.X("startSpan",t)}startTransaction(t,e){return this.X("startTransaction",t,e)}traceHeaders(){return this.X("traceHeaders")}captureSession(t=!1){if(t)return this.endSession();this.J()}endSession(){const t=this.getStackTop(),e=t&&t.scope,n=e&&e.getSession();n&&n.close(),this.J(),e&&e.setSession()}startSession(t){const{scope:e,client:n}=this.getStackTop(),{release:i,environment:s}=n&&n.getOptions()||{},o=r(),{userAgent:c}=o.navigator||{},u=new Lt(Object.assign(Object.assign(Object.assign({release:i,environment:s},e&&{user:e.getUser()}),c&&{userAgent:c}),t));if(e){const t=e.getSession&&e.getSession();t&&"ok"===t.status&&t.update({status:"exited"}),this.endSession(),e.setSession(u)}return u}J(){const{scope:t,client:e}=this.getStackTop();if(!t)return;const n=t.getSession&&t.getSession();n&&e&&e.captureSession&&e.captureSession(n)}B(t,...e){const{scope:n,client:r}=this.getStackTop();r&&r[t]&&r[t](...e,n)}X(t,...e){const n=Ft().__SENTRY__;if(n&&n.extensions&&"function"==typeof n.extensions[t])return n.extensions[t].apply(this,e);T.warn(`Extension method ${t} couldn't be found, doing nothing.`)}}function Ft(){const t=r();return t.__SENTRY__=t.__SENTRY__||{extensions:{},hub:void 0},t}function Pt(t){const e=Ft(),n=Bt(e);return Xt(e,t),n}function Ht(){const t=Ft();var e;return(e=t)&&e.__SENTRY__&&e.__SENTRY__.hub&&!Bt(t).isOlderThan(4)||Xt(t,new At),Bt(t)}function Bt(t){return i("hub",(()=>new At),t)}function Xt(t,e){if(!t)return!1;return(t.__SENTRY__=t.__SENTRY__||{}).hub=e,!0}function zt(t,...e){const n=Ht();if(n&&n[t])return n[t](...e);throw new Error(`No hub defined or ${t} was not found on the hub, please open a bug report.`)}function captureException(t,e){return zt("captureException",t,{captureContext:e,originalException:t,syntheticException:new Error("Sentry syntheticException")})}function Jt(t){zt("withScope",t)}function Kt(t,e,n){return{initDsn:t,metadata:e||{},dsn:E(t),tunnel:n}}function Wt(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Gt(t,e){return`${Wt(t)}${t.projectId}/${e}/`}function Vt(t){return e={sentry_key:t.publicKey,sentry_version:"7"},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}function Qt(t){return`${function(t){return Gt(t,"store")}(t)}?${Vt(t)}`}function Yt(t,e){return e||`${function(t){return Gt(t,"envelope")}(t)}?${Vt(t)}`}const Zt=[];function te(t){return t.reduce(((t,e)=>(t.every((t=>e.name!==t.name))&&t.push(e),t)),[])}function ee(t){const e={};return function(t){const e=t.defaultIntegrations&&[...t.defaultIntegrations]||[],n=t.integrations;let r=[...te(e)];Array.isArray(n)?r=[...r.filter((t=>n.every((e=>e.name!==t.name)))),...te(n)]:"function"==typeof n&&(r=n(r),r=Array.isArray(r)?r:[r]);const i=r.map((t=>t.name)),s="Debug";return-1!==i.indexOf(s)&&r.push(...r.splice(i.indexOf(s),1)),r}(t).forEach((t=>{e[t.name]=t,function(t){-1===Zt.indexOf(t.name)&&(t.setupOnce(qt,Ht),Zt.push(t.name),T.log(`Integration installed: ${t.name}`))}(t)})),C(e,"initialized",!0),e}const ne="Not capturing exception because it's already been captured.";function re(t){if(!t.metadata||!t.metadata.sdk)return;const{name:e,version:n}=t.metadata.sdk;return{name:e,version:n}}function ie(t,e){return e?(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]],t):t}function se(t,e){const n=re(e),r="aggregates"in t?"sessions":"session";return[Tt(Object.assign(Object.assign({sent_at:(new Date).toISOString()},n&&{sdk:n}),!!e.tunnel&&{dsn:j(e.dsn)}),[[{type:r},t]]),r]}class oe{sendEvent(t){return mt({reason:"NoopTransport: Event has been skipped because no Dsn is configured.",status:"skipped"})}close(t){return mt(!0)}}function ce(t,e,n=jt(t.bufferSize||30)){let r={};return{send:function(t){const i=function(t){const[,[[e]]]=t;return e.type}(t),s="event"===i?"error":i,o={category:s,body:Dt(t)};return It(r,s)?gt({status:"rate_limit",reason:ue(r,s)}):n.add((()=>e(o).then((({body:t,headers:e,reason:n,statusCode:i})=>{const o=Et(i);return e&&(r=Nt(r,e)),"success"===o?mt({status:o,reason:n}):gt({status:o,reason:n||t||("rate_limit"===o?ue(r,s):"Unknown transport error")})}))))},flush:t=>n.drain(t)}}function ue(t,e){return`Too many ${e} requests, backing off until: ${new Date(Rt(t,e)).toISOString()}`}const ae="6.19.7";let he;class fe{constructor(){this.name=fe.id}setupOnce(){he=Function.prototype.toString,Function.prototype.toString=function(...t){const e=q(this)||this;return he.apply(e,t)}}}fe.id="FunctionToString";const le=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/];class de{constructor(t={}){this.K=t,this.name=de.id}setupOnce(t,e){t((t=>{const n=e();if(n){const e=n.getIntegration(de);if(e){const r=n.getClient(),i=r?r.getOptions():{},s=function(t={},e={}){return{allowUrls:[...t.whitelistUrls||[],...t.allowUrls||[],...e.whitelistUrls||[],...e.allowUrls||[]],denyUrls:[...t.blacklistUrls||[],...t.denyUrls||[],...e.blacklistUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...le],ignoreInternal:void 0===t.ignoreInternal||t.ignoreInternal}}(e.K,i);return function(t,e){if(e.ignoreInternal&&function(t){try{return"SentryError"===t.exception.values[0].type}catch(t){}return!1}(t))return T.warn(`Event dropped due to being internal Sentry Error.\nEvent: ${ft(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;return function(t){if(t.message)return[t.message];if(t.exception)try{const{type:e="",value:n=""}=t.exception.values&&t.exception.values[0]||{};return[`${n}`,`${e}: ${n}`]}catch(e){return T.error(`Cannot extract message for event ${ft(t)}`),[]}return[]}(t).some((t=>e.some((e=>I(t,e)))))}(t,e.ignoreErrors))return T.warn(`Event dropped due to being matched by \`ignoreErrors\` option.\nEvent: ${ft(t)}`),!0;if(function(t,e){if(!e||!e.length)return!1;const n=be(t);return!!n&&e.some((t=>I(n,t)))}(t,e.denyUrls))return T.warn(`Event dropped due to being matched by \`denyUrls\` option.\nEvent: ${ft(t)}.\nUrl: ${be(t)}`),!0;if(!function(t,e){if(!e||!e.length)return!0;const n=be(t);return!n||e.some((t=>I(n,t)))}(t,e.allowUrls))return T.warn(`Event dropped due to not being matched by \`allowUrls\` option.\nEvent: ${ft(t)}.\nUrl: ${be(t)}`),!0;return!1}(t,s)?null:t}}return t}))}}function pe(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&"<anonymous>"!==n.filename&&"[native code]"!==n.filename)return n.filename||null}return null}function be(t){try{if(t.stacktrace)return pe(t.stacktrace.frames);let e;try{e=t.exception.values[0].stacktrace.frames}catch(t){}return e?pe(e):null}catch(e){return T.error(`Cannot extract url for event ${ft(t)}`),null}}de.id="InboundFilters";var ye=Object.freeze({__proto__:null,FunctionToString:fe,InboundFilters:de});const ve="?";function me(t,e,n,r){const i={filename:t,function:e,in_app:!0};return void 0!==n&&(i.lineno=n),void 0!==r&&(i.colno=r),i}const ge=/^\s*at (?:(.*?) ?\((?:address at )?)?((?:file|https?|blob|chrome-extension|address|native|eval|webpack|<anonymous>|[-a-z]+:|.*bundle|\/).*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Oe=/\((\S*)(?::(\d+))(?::(\d+))\)/,je=[30,t=>{const e=ge.exec(t);if(e){if(e[2]&&0===e[2].indexOf("eval")){const t=Oe.exec(e[2]);t&&(e[2]=t[1],e[3]=t[2],e[4]=t[3])}const[t,n]=Re(e[1]||ve,e[2]);return me(n,t,e[3]?+e[3]:void 0,e[4]?+e[4]:void 0)}}],we=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:file|https?|blob|chrome|webpack|resource|moz-extension|capacitor).*?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Ee=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,$e=[50,t=>{const e=we.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const t=Ee.exec(e[3]);t&&(e[1]=e[1]||"eval",e[3]=t[1],e[4]=t[2],e[5]="")}let t=e[3],n=e[1]||ve;return[n,t]=Re(n,t),me(t,n,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}}],xe=/^\s*at (?:((?:\[object object\])?.+) )?\(?((?:file|ms-appx|https?|webpack|blob):.*?):(\d+)(?::(\d+))?\)?\s*$/i,Se=[40,t=>{const e=xe.exec(t);return e?me(e[2],e[1]||ve,+e[3],e[4]?+e[4]:void 0):void 0}],_e=/ line (\d+).*script (?:in )?(\S+)(?:: in function (\S+))?$/i,ke=[10,t=>{const e=_e.exec(t);return e?me(e[2],e[3]||ve,+e[1]):void 0}],Te=/ line (\d+), column (\d+)\s*(?:in (?:<anonymous function: ([^>]+)>|([^)]+))\(.*\))? in (.*):\s*$/i,De=[20,t=>{const e=Te.exec(t);return e?me(e[5],e[3]||e[4]||ve,+e[1],+e[2]):void 0}],Re=(t,e)=>{const n=-1!==t.indexOf("safari-extension"),r=-1!==t.indexOf("safari-web-extension");return n||r?[-1!==t.indexOf("@")?t.split("@")[0]:ve,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]};function Ie(t){const e=Ce(t),n={type:t&&t.name,value:qe(t)};return e.length&&(n.stacktrace={frames:e}),void 0===n.type&&""===n.value&&(n.value="Unrecoverable error caught"),n}function Ne(t){return{exception:{values:[Ie(t)]}}}function Ce(t){const e=t.stacktrace||t.stack||"",n=function(t){if(t){if("number"==typeof t.framesToPop)return t.framesToPop;if(Me.test(t.message))return 1}return 0}(t);try{return H(ke,De,je,Se,$e)(e,n)}catch(t){}return[]}const Me=/Minified React error #\d+;/i;function qe(t){const e=t&&t.message;return e?e.error&&"string"==typeof e.error.message?e.error.message:e:"No error message"}function Le(e,n,r){const i=Ae(e,n&&n.syntheticException||void 0,r);return dt(i),i.level=t.Severity.Error,n&&n.event_id&&(i.event_id=n.event_id),mt(i)}function Ue(e,n=t.Severity.Info,r,i){const s=Fe(e,r&&r.syntheticException||void 0,i);return s.level=n,r&&r.event_id&&(s.event_id=r.event_id),mt(s)}function Ae(t,e,n,r){let i;if(u(t)&&t.error){return Ne(t.error)}if(a(t)||c(t,"DOMException")){const r=t;if("stack"in t)i=Ne(t);else{const t=r.name||(a(r)?"DOMError":"DOMException"),s=r.message?`${t}: ${r.message}`:t;i=Fe(s,e,n),lt(i,s)}return"code"in r&&(i.tags=Object.assign(Object.assign({},i.tags),{"DOMException.code":`${r.code}`})),i}if(o(t))return Ne(t);if(l(t)||d(t)){return i=function(t,e,n){const r={exception:{values:[{type:d(t)?t.constructor.name:n?"UnhandledRejection":"Error",value:`Non-Error ${n?"promise rejection":"exception"} captured with keys: ${F(t)}`}]},extra:{__serialized__:yt(t)}};if(e){const t=Ce(e);t.length&&(r.stacktrace={frames:t})}return r}(t,e,r),dt(i,{synthetic:!0}),i}return i=Fe(t,e,n),lt(i,`${t}`,void 0),dt(i,{synthetic:!0}),i}function Fe(t,e,n){const r={message:t};if(n&&e){const t=Ce(e);t.length&&(r.stacktrace={frames:t})}return r}const Pe=r();let He;function Be(){if(He)return He;if(J(Pe.fetch))return He=Pe.fetch.bind(Pe);const t=Pe.document;let e=Pe.fetch;if(t&&"function"==typeof t.createElement)try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n);const r=n.contentWindow;r&&r.fetch&&(e=r.fetch),t.head.removeChild(n)}catch(t){T.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",t)}return He=e.bind(Pe)}function Xe(t,e){if("[object Navigator]"===Object.prototype.toString.call(Pe&&Pe.navigator)&&"function"==typeof Pe.navigator.sendBeacon){return Pe.navigator.sendBeacon.bind(Pe.navigator)(t,e)}if(z()){const n=Be();n(t,{body:e,method:"POST",credentials:"omit",keepalive:!0}).then(null,(t=>{console.error(t)}))}else;}function ze(t){return"event"===t?"error":t}const Je=r();class Ke{constructor(t){this.options=t,this.W=jt(30),this.G={},this.V={},this.Y=Kt(t.dsn,t.Z,t.tunnel),this.url=Qt(this.Y.dsn),this.options.sendClientReports&&Je.document&&Je.document.addEventListener("visibilitychange",(()=>{"hidden"===Je.document.visibilityState&&this.tt()}))}sendEvent(t){return this.et(function(t,e){const n=re(e),r=t.type||"event",i="transaction"===r||!!e.tunnel,{transactionSampling:s}=t.sdkProcessingMetadata||{},{method:o,rate:c}=s||{};let u;ie(t,e.metadata.sdk),t.tags=t.tags||{},t.extra=t.extra||{},t.sdkProcessingMetadata&&t.sdkProcessingMetadata.baseClientNormalized||(t.tags.skippedNormalization=!0,t.extra.normalizeDepth=t.sdkProcessingMetadata?t.sdkProcessingMetadata.normalizeDepth:"unset"),delete t.sdkProcessingMetadata;try{u=JSON.stringify(t)}catch(e){t.tags.JSONStringifyError=!0,t.extra.JSONStringifyError=e;try{u=JSON.stringify(bt(t))}catch(t){const e=t;u=JSON.stringify({message:"JSON.stringify error after renormalization",extra:{message:e.message,stack:e.stack}})}}const a={body:u,type:r,url:i?Yt(e.dsn,e.tunnel):Qt(e.dsn)};if(i){const i=Tt(Object.assign(Object.assign({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),!!e.tunnel&&{dsn:j(e.dsn)}),[[{type:r,sample_rates:[{id:o,rate:c}]},a.body]]);a.body=Dt(i)}return a}(t,this.Y),t)}sendSession(t){return this.et(function(t,e){const[n,r]=se(t,e);return{body:Dt(n),type:r,url:Yt(e.dsn,e.tunnel)}}(t,this.Y),t)}close(t){return this.W.drain(t)}recordLostEvent(t,e){var n;if(!this.options.sendClientReports)return;const r=`${ze(e)}:${t}`;T.log(`Adding outcome: ${r}`),this.V[r]=(null!=(n=this.V[r])?n:0)+1}tt(){if(!this.options.sendClientReports)return;const t=this.V;if(this.V={},!Object.keys(t).length)return void T.log("No outcomes to flush");T.log(`Flushing outcomes:\n${JSON.stringify(t,null,2)}`);const e=Yt(this.Y.dsn,this.Y.tunnel),n=Object.keys(t).map((e=>{const[n,r]=e.split(":");return{reason:r,category:n,quantity:t[e]}})),r=(i=n,Tt((s=this.Y.tunnel&&j(this.Y.dsn))?{dsn:s}:{},[[{type:"client_report"},{timestamp:o||_t(),discarded_events:i}]]));var i,s,o;try{Xe(e,Dt(r))}catch(t){T.error(t)}}nt({requestType:t,response:e,headers:n,resolve:r,reject:i}){const s=Et(e.status);this.G=Nt(this.G,n),this.rt(t)&&T.warn(`Too many ${t} requests, backing off until: ${this.it(t)}`),"success"!==s?i(e):r({status:s})}it(t){const e=ze(t);return new Date(Rt(this.G,e))}rt(t){const e=ze(t);return It(this.G,e)}}class We extends Ke{constructor(t,e=Be()){super(t),this.st=e}et(t,e){if(this.rt(t.type))return this.recordLostEvent("ratelimit_backoff",t.type),Promise.reject({event:e,type:t.type,reason:`Transport for ${t.type} requests locked till ${this.it(t.type)} due to too many requests.`,status:429});const n={body:t.body,method:"POST",referrerPolicy:K()?"origin":""};return void 0!==this.options.fetchParameters&&Object.assign(n,this.options.fetchParameters),void 0!==this.options.headers&&(n.headers=this.options.headers),this.W.add((()=>new Ot(((e,r)=>{this.st(t.url,n).then((n=>{const i={"x-sentry-rate-limits":n.headers.get("X-Sentry-Rate-Limits"),"retry-after":n.headers.get("Retry-After")};this.nt({requestType:t.type,response:n,headers:i,resolve:e,reject:r})})).catch(r)})))).then(void 0,(e=>{throw e instanceof g?this.recordLostEvent("queue_overflow",t.type):this.recordLostEvent("network_error",t.type),e}))}}class Ge extends Ke{et(t,e){return this.rt(t.type)?(this.recordLostEvent("ratelimit_backoff",t.type),Promise.reject({event:e,type:t.type,reason:`Transport for ${t.type} requests locked till ${this.it(t.type)} due to too many requests.`,status:429})):this.W.add((()=>new Ot(((e,n)=>{const r=new XMLHttpRequest;r.onreadystatechange=()=>{if(4===r.readyState){const i={"x-sentry-rate-limits":r.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":r.getResponseHeader("Retry-After")};this.nt({requestType:t.type,response:r,headers:i,resolve:e,reject:n})}},r.open("POST",t.url);for(const t in this.options.headers)Object.prototype.hasOwnProperty.call(this.options.headers,t)&&r.setRequestHeader(t,this.options.headers[t]);r.send(t.body)})))).then(void 0,(e=>{throw e instanceof g?this.recordLostEvent("queue_overflow",t.type):this.recordLostEvent("network_error",t.type),e}))}}function Ve(t,e=Be()){return ce({bufferSize:t.bufferSize},(function(n){const r=Object.assign({body:n.body,method:"POST",referrerPolicy:"origin"},t.requestOptions);return e(t.url,r).then((t=>t.text().then((e=>({body:e,headers:{"x-sentry-rate-limits":t.headers.get("X-Sentry-Rate-Limits"),"retry-after":t.headers.get("Retry-After")},reason:t.statusText,statusCode:t.status})))))}))}function Qe(t){return ce({bufferSize:t.bufferSize},(function(e){return new Ot(((n,r)=>{const i=new XMLHttpRequest;i.onreadystatechange=()=>{if(4===i.readyState){const t={body:i.response,headers:{"x-sentry-rate-limits":i.getResponseHeader("X-Sentry-Rate-Limits"),"retry-after":i.getResponseHeader("Retry-After")},reason:i.statusText,statusCode:i.status};n(t)}},i.open("POST",t.url);for(const e in t.headers)Object.prototype.hasOwnProperty.call(t.headers,e)&&i.setRequestHeader(e,t.headers[e]);i.send(e.body)}))}))}var Ye=Object.freeze({__proto__:null,BaseTransport:Ke,FetchTransport:We,XHRTransport:Ge,makeNewFetchTransport:Ve,makeNewXHRTransport:Qe});class Ze extends class{constructor(t){this.K=t,this.K.dsn||T.warn("No DSN provided, backend will not do anything."),this.ot=this.ct()}eventFromException(t,e){throw new g("Backend has to implement `eventFromException` method")}eventFromMessage(t,e,n){throw new g("Backend has to implement `eventFromMessage` method")}sendEvent(t){if(this.ut&&this.K.dsn&&this.K._experiments&&this.K._experiments.newTransport){const e=function(t,e){const n=re(e),r=t.type||"event",{transactionSampling:i}=t.sdkProcessingMetadata||{},{method:s,rate:o}=i||{};return ie(t,e.metadata.sdk),t.tags=t.tags||{},t.extra=t.extra||{},t.sdkProcessingMetadata&&t.sdkProcessingMetadata.baseClientNormalized||(t.tags.skippedNormalization=!0,t.extra.normalizeDepth=t.sdkProcessingMetadata?t.sdkProcessingMetadata.normalizeDepth:"unset"),delete t.sdkProcessingMetadata,Tt(Object.assign(Object.assign({event_id:t.event_id,sent_at:(new Date).toISOString()},n&&{sdk:n}),!!e.tunnel&&{dsn:j(e.dsn)}),[[{type:r,sample_rates:[{id:s,rate:o}]},t]])}(t,Kt(this.K.dsn,this.K.Z,this.K.tunnel));this.ut.send(e).then(null,(t=>{T.error("Error while sending event:",t)}))}else this.ot.sendEvent(t).then(null,(t=>{T.error("Error while sending event:",t)}))}sendSession(t){if(this.ot.sendSession)if(this.ut&&this.K.dsn&&this.K._experiments&&this.K._experiments.newTransport){const e=Kt(this.K.dsn,this.K.Z,this.K.tunnel),[n]=se(t,e);this.ut.send(n).then(null,(t=>{T.error("Error while sending session:",t)}))}else this.ot.sendSession(t).then(null,(t=>{T.error("Error while sending session:",t)}));else T.warn("Dropping session because custom transport doesn't implement sendSession")}getTransport(){return this.ot}ct(){return new oe}}{eventFromException(t,e){return Le(t,e,this.K.attachStacktrace)}eventFromMessage(e,n=t.Severity.Info,r){return Ue(e,n,r,this.K.attachStacktrace)}ct(){if(!this.K.dsn)return super.ct();const t=Object.assign(Object.assign({},this.K.transportOptions),{dsn:this.K.dsn,tunnel:this.K.tunnel,sendClientReports:this.K.sendClientReports,Z:this.K.Z}),e=Kt(t.dsn,t.Z,t.tunnel),n=Yt(e.dsn,e.tunnel);if(this.K.transport)return new this.K.transport(t);if(z()){const e=Object.assign({},t.fetchParameters);return this.ut=Ve({requestOptions:e,url:n}),new We(t)}return this.ut=Qe({url:n,headers:t.headers}),new Ge(t)}}const tn=r();let en=0;function nn(){return en>0}function rn(){en+=1,setTimeout((()=>{en-=1}))}function sn(t,e={},n){if("function"!=typeof t)return t;try{const e=t.__sentry_wrapped__;if(e)return e;if(q(t))return t}catch(e){return t}const sentryWrapped=function(){const r=Array.prototype.slice.call(arguments);try{n&&"function"==typeof n&&n.apply(this,arguments);const i=r.map((t=>sn(t,e)));return t.apply(this,i)}catch(t){throw rn(),Jt((n=>{n.addEventProcessor((t=>(e.mechanism&&(lt(t,void 0,void 0),dt(t,e.mechanism)),t.extra=Object.assign(Object.assign({},t.extra),{arguments:r}),t))),captureException(t)})),t}};try{for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(sentryWrapped[e]=t[e])}catch(t){}M(sentryWrapped,t),C(t,"__sentry_wrapped__",sentryWrapped);try{Object.getOwnPropertyDescriptor(sentryWrapped,"name").configurable&&Object.defineProperty(sentryWrapped,"name",{get:()=>t.name})}catch(t){}return sentryWrapped}function on(t={}){if(!tn.document)return;if(!t.eventId)return void T.error("Missing eventId option in showReportDialog call");if(!t.dsn)return void T.error("Missing dsn option in showReportDialog call");const e=tn.document.createElement("script");e.async=!0,e.src=function(t,e){const n=E(t),r=`${Wt(n)}embed/error-page/`;let i=`dsn=${j(n)}`;for(const t in e)if("dsn"!==t)if("user"===t){if(!e.user)continue;e.user.name&&(i+=`&name=${encodeURIComponent(e.user.name)}`),e.user.email&&(i+=`&email=${encodeURIComponent(e.user.email)}`)}else i+=`&${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`;return`${r}?${i}`}(t.dsn,t),t.onLoad&&(e.onload=t.onLoad);const n=tn.document.head||tn.document.body;n&&n.appendChild(e)}class cn{constructor(t){this.name=cn.id,this.at={onerror:un,onunhandledrejection:an},this.K=Object.assign({onerror:!0,onunhandledrejection:!0},t)}setupOnce(){Error.stackTraceLimit=50;const t=this.K;for(const n in t){const r=this.at[n];r&&t[n]&&(e=n,T.log(`Global Handler attached: ${e}`),r(),this.at[n]=void 0)}var e}}function un(){Y("error",(e=>{const[n,r]=ln();if(!n.getIntegration(cn))return;const{msg:i,url:s,line:o,column:c,error:a}=e;if(nn()||a&&a.__sentry_own_request__)return;const f=void 0===a&&h(i)?function(t,e,n,r){const i=/^(?:[Uu]ncaught (?:exception: )?)?(?:((?:Eval|Internal|Range|Reference|Syntax|Type|URI|)Error): )?(.*)$/i;let s=u(t)?t.message:t,o="Error";const c=s.match(i);c&&(o=c[1],s=c[2]);return hn({exception:{values:[{type:o,value:s}]}},e,n,r)}(i,s,o,c):hn(Ae(a||i,void 0,r,!1),s,o,c);f.level=t.Severity.Error,fn(n,a,f,"onerror")}))}function an(){Y("unhandledrejection",(e=>{const[n,r]=ln();if(!n.getIntegration(cn))return;let i=e;try{"reason"in e?i=e.reason:"detail"in e&&"reason"in e.detail&&(i=e.detail.reason)}catch(t){}if(nn()||i&&i.__sentry_own_request__)return!0;const s=f(i)?{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(i)}`}]}}:Ae(i,void 0,r,!0);s.level=t.Severity.Error,fn(n,i,s,"onunhandledrejection")}))}function hn(t,e,n,i){const s=t.exception=t.exception||{},o=s.values=s.values||[],c=o[0]=o[0]||{},u=c.stacktrace=c.stacktrace||{},a=u.frames=u.frames||[],f=isNaN(parseInt(i,10))?void 0:i,l=isNaN(parseInt(n,10))?void 0:n,d=h(e)&&e.length>0?e:function(){const t=r();try{return t.document.location.href}catch(t){return""}}();return 0===a.length&&a.push({colno:f,filename:d,function:"?",in_app:!0,lineno:l}),t}function fn(t,e,n,r){dt(n,{handled:!1,type:r}),t.captureEvent(n,{originalException:e})}function ln(){const t=Ht(),e=t.getClient();return[t,e&&e.getOptions().attachStacktrace]}cn.id="GlobalHandlers";const dn=["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"];class pn{constructor(t){this.name=pn.id,this.K=Object.assign({XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0},t)}setupOnce(){const t=r();this.K.setTimeout&&N(t,"setTimeout",bn),this.K.setInterval&&N(t,"setInterval",bn),this.K.requestAnimationFrame&&N(t,"requestAnimationFrame",yn),this.K.XMLHttpRequest&&"XMLHttpRequest"in t&&N(XMLHttpRequest.prototype,"send",vn);const e=this.K.eventTarget;if(e){(Array.isArray(e)?e:dn).forEach(mn)}}}function bn(t){return function(...e){const n=e[0];return e[0]=sn(n,{mechanism:{data:{function:X(t)},handled:!0,type:"instrument"}}),t.apply(this,e)}}function yn(t){return function(e){return t.apply(this,[sn(e,{mechanism:{data:{function:"requestAnimationFrame",handler:X(t)},handled:!0,type:"instrument"}})])}}function vn(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach((t=>{t in n&&"function"==typeof n[t]&&N(n,t,(function(e){const n={mechanism:{data:{function:t,handler:X(e)},handled:!0,type:"instrument"}},r=q(e);return r&&(n.mechanism.data.handler=X(r)),sn(e,n)}))})),t.apply(this,e)}}function mn(t){const e=r(),n=e[t]&&e[t].prototype;n&&n.hasOwnProperty&&n.hasOwnProperty("addEventListener")&&(N(n,"addEventListener",(function(e){return function(n,r,i){try{"function"==typeof r.handleEvent&&(r.handleEvent=sn(r.handleEvent.bind(r),{mechanism:{data:{function:"handleEvent",handler:X(r),target:t},handled:!0,type:"instrument"}}))}catch(t){}return e.apply(this,[n,sn(r,{mechanism:{data:{function:"addEventListener",handler:X(r),target:t},handled:!0,type:"instrument"}}),i])}})),N(n,"removeEventListener",(function(t){return function(e,n,r){const i=n;try{const n=i&&i.__sentry_wrapped__;n&&t.call(this,e,n,r)}catch(t){}return t.call(this,e,i