haiku-atelier-2024/web/app/themes/haiku-atelier-2024/assets/js/gaffe.js
2024-09-06 10:47:20 +02:00

9 lines
59 KiB
JavaScript

const ve=Object.prototype.toString;function Rt(e){switch(ve.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":return!0;default:return C(e,Error)}}function W(e,t){return ve.call(e)===`[object ${t}]`}function Ne(e){return W(e,"ErrorEvent")}function Yt(e){return W(e,"DOMError")}function Qe(e){return W(e,"DOMException")}function w(e){return W(e,"String")}function wt(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Pt(e){return e===null||wt(e)||typeof e!="object"&&typeof e!="function"}function U(e){return W(e,"Object")}function ct(e){return typeof Event<"u"&&C(e,Event)}function tn(e){return typeof Element<"u"&&C(e,Element)}function ut(e){return!!(e&&e.then&&typeof e.then=="function")}function en(e){return U(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function C(e,t){try{return e instanceof t}catch{return!1}}function Oe(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue))}function j(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function qt(e,t){if(!Array.isArray(e))return"";const n=[];for(let r=0;r<e.length;r++){const s=e[r];try{Oe(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function nn(e,t,n=250,r,s,o,i){if(!o.exception||!o.exception.values||!i||!C(i.originalException,Error))return;const a=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;a&&(o.exception.values=rn(_t(e,t,s,i.originalException,r,o.exception.values,a,0),n))}function _t(e,t,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(C(r[s],Error)){Wt(i,a);const u=e(t,r[s]),f=c.length;Kt(u,s,f,a),c=_t(e,t,n,r[s],s,[u,...c],u,f)}return Array.isArray(r.errors)&&r.errors.forEach((u,f)=>{if(C(u,Error)){Wt(i,a);const l=e(t,u),d=c.length;Kt(l,`errors[${f}]`,d,a),c=_t(e,t,n,u,s,[l,...c],l,d)}}),c}function Wt(e,t){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,...e.type==="AggregateError"&&{is_exception_group:!0},exception_id:t}}function Kt(e,t,n,r){e.mechanism=e.mechanism||{type:"generic",handled:!0},e.mechanism={...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function rn(e,t){return e.map(n=>(n.value&&(n.value=j(n.value,t)),n))}const P="8.28.0",m=globalThis;function Ct(e,t,n){const r=m,s=r.__SENTRY__=r.__SENTRY__||{},o=s[P]=s[P]||{};return o[e]||(o[e]=t())}const xt=m,sn=80;function De(e,t={}){if(!e)return"<unknown>";try{let n=e;const r=5,s=[];let o=0,i=0;const a=" > ",c=a.length;let u;const f=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||sn;for(;n&&o++<r&&(u=on(n,f),!(u==="html"||o>1&&i+s.length*c+u.length>=l));)s.push(u),i+=u.length,n=n.parentNode;return s.reverse().join(a)}catch{return"<unknown>"}}function on(e,t){const n=e,r=[];if(!n||!n.tagName)return"";if(xt.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=t&&t.length?t.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(s&&s.length)s.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const i=n.className;if(i&&w(i)){const a=i.split(/\s+/);for(const c of a)r.push(`.${c}`)}}const o=["aria-label","type","name","title","alt"];for(const i of o){const a=n.getAttribute(i);a&&r.push(`[${i}="${a}"]`)}return r.join("")}function an(){try{return xt.document.location.href}catch{return""}}function cn(e){if(!xt.HTMLElement)return null;let t=e;const n=5;for(let r=0;r<n;r++){if(!t)return null;if(t instanceof HTMLElement){if(t.dataset.sentryComponent)return t.dataset.sentryComponent;if(t.dataset.sentryElement)return t.dataset.sentryElement}t=t.parentNode}return null}const K=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,un="Sentry Logger ",mt=["debug","info","warn","error","log","assert","trace"],ot={};function Mt(e){if(!("console"in m))return e();const t=m.console,n={},r=Object.keys(ot);r.forEach(s=>{const o=ot[s];n[s]=t[s],t[s]=o});try{return e()}finally{r.forEach(s=>{t[s]=n[s]})}}function fn(){let e=!1;const t={enable:()=>{e=!0},disable:()=>{e=!1},isEnabled:()=>e};return K?mt.forEach(n=>{t[n]=(...r)=>{e&&Mt(()=>{m.console[n](`${un}[${n}]:`,...r)})}}):mt.forEach(n=>{t[n]=()=>{}}),t}const h=fn(),ln=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function dn(e){return e==="http"||e==="https"}function ft(e,t=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function pn(e){const t=ln.exec(e);if(!t){Mt(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}const[n,r,s="",o="",i="",a=""]=t.slice(1);let c="",u=a;const f=u.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),u=f.pop()),u){const l=u.match(/^\d+/);l&&(u=l[0])}return Re({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Re(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function hn(e){if(!K)return!0;const{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(h.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?dn(r)?t&&isNaN(parseInt(t,10))?(h.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(h.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(h.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function _n(e){const t=typeof e=="string"?pn(e):Re(e);if(!(!t||!hn(t)))return t}class N extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function B(e,t,n){if(!(t in e))return;const r=e[t],s=n(r);typeof s=="function"&&mn(s,r),e[t]=s}function H(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{K&&h.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function mn(e,t){try{const n=t.prototype||{};e.prototype=t.prototype=n,H(e,"__sentry_original__",t)}catch{}}function gn(e){return e.__sentry_original__}function yn(e){return Object.keys(e).map(t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`).join("&")}function we(e){if(Rt(e))return{message:e.message,name:e.name,stack:e.stack,...Jt(e)};if(ct(e)){const t={type:e.type,target:zt(e.target),currentTarget:zt(e.currentTarget),...Jt(e)};return typeof CustomEvent<"u"&&C(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function zt(e){try{return tn(e)?De(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Jt(e){if(typeof e=="object"&&e!==null){const t={};for(const n in e)Object.prototype.hasOwnProperty.call(e,n)&&(t[n]=e[n]);return t}else return{}}function En(e,t=40){const n=Object.keys(we(e));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=t)return j(r,t);for(let s=n.length;s>0;s--){const o=n.slice(0,s).join(", ");if(!(o.length>t))return s===n.length?o:j(o,t)}return""}function k(e){return gt(e,new Map)}function gt(e,t){if(Sn(e)){const n=t.get(e);if(n!==void 0)return n;const r={};t.set(e,r);for(const s of Object.keys(e))typeof e[s]<"u"&&(r[s]=gt(e[s],t));return r}if(Array.isArray(e)){const n=t.get(e);if(n!==void 0)return n;const r=[];return t.set(e,r),e.forEach(s=>{r.push(gt(s,t))}),r}return e}function Sn(e){if(!U(e))return!1;try{const t=Object.getPrototypeOf(e).constructor.name;return!t||t==="Object"}catch{return!0}}const Pe=50,x="?",Xt=/\(error: (.*)\)/,Vt=/captureMessage|captureException/;function bn(...e){const t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const o=[],i=n.split(`
`);for(let a=r;a<i.length;a++){const c=i[a];if(c.length>1024)continue;const u=Xt.test(c)?c.replace(Xt,"$1"):c;if(!u.match(/\S*Error: /)){for(const f of t){const l=f(u);if(l){o.push(l);break}}if(o.length>=Pe+s)break}}return In(o.slice(s))}}function In(e){if(!e.length)return[];const t=Array.from(e);return/sentryWrapped/.test(Z(t).function||"")&&t.pop(),t.reverse(),Vt.test(Z(t).function||"")&&(t.pop(),Vt.test(Z(t).function||"")&&t.pop()),t.slice(0,Pe).map(n=>({...n,filename:n.filename||Z(t).filename,function:n.function||x}))}function Z(e){return e[e.length-1]||{}}const dt="<anonymous>";function Ce(e){try{return!e||typeof e!="function"?dt:e.name||dt}catch{return dt}}function Zt(e){const t=e.exception;if(t){const n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const st={},Qt={};function F(e,t){st[e]=st[e]||[],st[e].push(t)}function L(e,t){Qt[e]||(t(),Qt[e]=!0)}function T(e,t){const n=e&&st[e];if(n)for(const r of n)try{r(t)}catch(s){K&&h.error(`Error while triggering instrumentation handler.
Type: ${e}
Name: ${Ce(r)}
Error:`,s)}}function kn(e){const t="console";F(t,e),L(t,Tn)}function Tn(){"console"in m&&mt.forEach(function(e){e in m.console&&B(m.console,e,function(t){return ot[e]=t,function(...n){T("console",{args:n,level:e});const s=ot[e];s&&s.apply(m.console,n)}})})}const yt=m;function vn(){if(!("fetch"in yt))return!1;try{return new Headers,new Request("http://www.example.com"),new Response,!0}catch{return!1}}function te(e){return e&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(e.toString())}function Nn(){if(typeof EdgeRuntime=="string")return!0;if(!vn())return!1;if(te(yt.fetch))return!0;let e=!1;const t=yt.document;if(t&&typeof t.createElement=="function")try{const n=t.createElement("iframe");n.hidden=!0,t.head.appendChild(n),n.contentWindow&&n.contentWindow.fetch&&(e=te(n.contentWindow.fetch)),t.head.removeChild(n)}catch(n){K&&h.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",n)}return e}const xe=1e3;function z(){return Date.now()/xe}function On(){const{performance:e}=m;if(!e||!e.now)return z;const t=Date.now()-e.now(),n=e.timeOrigin==null?t:e.timeOrigin;return()=>(n+e.now())/xe}const R=On();(()=>{const{performance:e}=m;if(!e||!e.now)return;const t=3600*1e3,n=e.now(),r=Date.now(),s=e.timeOrigin?Math.abs(e.timeOrigin+n-r):t,o=s<t,i=e.timing&&e.timing.navigationStart,c=typeof i=="number"?Math.abs(i+n-r):t,u=c<t;return o||u?s<=c?e.timeOrigin:i:r})();function Dn(e,t){const n="fetch";F(n,e),L(n,()=>Rn(void 0,t))}function Rn(e,t=!1){t&&!Nn()||B(m,"fetch",function(n){return function(...r){const{method:s,url:o}=wn(r),i={args:r,fetchData:{method:s,url:o},startTimestamp:R()*1e3};T("fetch",{...i});const a=new Error().stack;return n.apply(m,r).then(async c=>(T("fetch",{...i,endTimestamp:R()*1e3,response:c}),c),c=>{throw T("fetch",{...i,endTimestamp:R()*1e3,error:c}),Rt(c)&&c.stack===void 0&&(c.stack=a,H(c,"framesToPop",1)),c})}})}function Et(e,t){return!!e&&typeof e=="object"&&!!e[t]}function ee(e){return typeof e=="string"?e:e?Et(e,"url")?e.url:e.toString?e.toString():"":""}function wn(e){if(e.length===0)return{method:"GET",url:""};if(e.length===2){const[n,r]=e;return{url:ee(n),method:Et(r,"method")?String(r.method).toUpperCase():"GET"}}const t=e[0];return{url:ee(t),method:Et(t,"method")?String(t.method).toUpperCase():"GET"}}let Q=null;function Pn(e){const t="error";F(t,e),L(t,Cn)}function Cn(){Q=m.onerror,m.onerror=function(e,t,n,r,s){return T("error",{column:r,error:s,line:n,msg:e,url:t}),Q&&!Q.__SENTRY_LOADER__?Q.apply(this,arguments):!1},m.onerror.__SENTRY_INSTRUMENTED__=!0}let tt=null;function xn(e){const t="unhandledrejection";F(t,e),L(t,Mn)}function Mn(){tt=m.onunhandledrejection,m.onunhandledrejection=function(e){return T("unhandledrejection",e),tt&&!tt.__SENTRY_LOADER__?tt.apply(this,arguments):!0},m.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}function $n(){return"npm"}function An(){const e=typeof WeakSet=="function",t=e?new WeakSet:[];function n(s){if(e)return t.has(s)?!0:(t.add(s),!1);for(let o=0;o<t.length;o++)if(t[o]===s)return!0;return t.push(s),!1}function r(s){if(e)t.delete(s);else for(let o=0;o<t.length;o++)if(t[o]===s){t.splice(o,1);break}}return[n,r]}function v(){const e=m,t=e.crypto||e.msCrypto;let n=()=>Math.random()*16;try{if(t&&t.randomUUID)return t.randomUUID().replace(/-/g,"");t&&t.getRandomValues&&(n=()=>{const r=new Uint8Array(1);return t.getRandomValues(r),r[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,r=>(r^(n()&15)>>r/4).toString(16))}function Me(e){return e.exception&&e.exception.values?e.exception.values[0]:void 0}function Fn(e){const{message:t,event_id:n}=e;if(t)return t;const r=Me(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ne(e,t,n){const r=e.exception=e.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=t||""),o.type||(o.type="Error")}function it(e,t){const n=Me(e);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...t},t&&"data"in t){const o={...s&&s.data,...t.data};n.mechanism.data=o}}function re(e){if(e&&e.__sentry_captured__)return!0;try{H(e,"__sentry_captured__",!0)}catch{}return!1}function Ln(e){return Array.isArray(e)?e:[e]}function D(e,t=100,n=1/0){try{return St("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function $e(e,t=3,n=100*1024){const r=D(e,t);return Hn(r)>n?$e(e,t-1,n):r}function St(e,t,n=1/0,r=1/0,s=An()){const[o,i]=s;if(t==null||["number","boolean","string"].includes(typeof t)&&!Number.isNaN(t))return t;const a=jn(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;const c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(o(t))return"[Circular ~]";const u=t;if(u&&typeof u.toJSON=="function")try{const _=u.toJSON();return St("",_,c-1,r,s)}catch{}const f=Array.isArray(t)?[]:{};let l=0;const d=we(t);for(const _ in d){if(!Object.prototype.hasOwnProperty.call(d,_))continue;if(l>=r){f[_]="[MaxProperties ~]";break}const p=d[_];f[_]=St(_,p,c-1,r,s),l++}return i(t),f}function jn(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(Oe(t))return"[VueViewModel]";if(en(t))return"[SyntheticEvent]";if(typeof t=="number"&&t!==t)return"[NaN]";if(typeof t=="function")return`[Function: ${Ce(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;const n=Un(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Un(e){const t=Object.getPrototypeOf(e);return t?t.constructor.name:"null prototype"}function Bn(e){return~-encodeURI(e).split(/%..|./).length}function Hn(e){return Bn(JSON.stringify(e))}var O;(function(e){e[e.PENDING=0]="PENDING";const n=1;e[e.RESOLVED=n]="RESOLVED";const r=2;e[e.REJECTED=r]="REJECTED"})(O||(O={}));function M(e){return new b(t=>{t(e)})}function Ae(e){return new b((t,n)=>{n(e)})}class b{constructor(t){b.prototype.__init.call(this),b.prototype.__init2.call(this),b.prototype.__init3.call(this),b.prototype.__init4.call(this),this._state=O.PENDING,this._handlers=[];try{t(this._resolve,this._reject)}catch(n){this._reject(n)}}then(t,n){return new b((r,s)=>{this._handlers.push([!1,o=>{if(!t)r(o);else try{r(t(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new b((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,t&&t()},i=>{o=!0,s=i,t&&t()}).then(()=>{if(o){r(s);return}n(s)})})}__init(){this._resolve=t=>{this._setResult(O.RESOLVED,t)}}__init2(){this._reject=t=>{this._setResult(O.REJECTED,t)}}__init3(){this._setResult=(t,n)=>{if(this._state===O.PENDING){if(ut(n)){n.then(this._resolve,this._reject);return}this._state=t,this._value=n,this._executeHandlers()}}}__init4(){this._executeHandlers=()=>{if(this._state===O.PENDING)return;const t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===O.RESOLVED&&n[1](this._value),this._state===O.REJECTED&&n[2](this._value),n[0]=!0)})}}}function Gn(e){const t=[];function n(){return e===void 0||t.length<e}function r(i){return t.splice(t.indexOf(i),1)[0]||Promise.resolve(void 0)}function s(i){if(!n())return Ae(new N("Not adding Promise because buffer limit was reached."));const a=i();return t.indexOf(a)===-1&&t.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function o(i){return new b((a,c)=>{let u=t.length;if(!u)return a(!0);const f=setTimeout(()=>{i&&i>0&&a(!1)},i);t.forEach(l=>{M(l).then(()=>{--u||(clearTimeout(f),a(!0))},c)})})}return{$:t,add:s,drain:o}}function pt(e){if(!e)return{};const t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};const n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}const Yn=["fatal","error","warning","log","info","debug"];function qn(e){return e==="warn"?"warning":Yn.includes(e)?e:"log"}const Wn="sentry-",Kn=/^sentry-/;function zn(e){const t=Jn(e);if(!t)return;const n=Object.entries(t).reduce((r,[s,o])=>{if(s.match(Kn)){const i=s.slice(Wn.length);r[i]=o}return r},{});if(Object.keys(n).length>0)return n}function Jn(e){if(!(!e||!w(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{const r=se(n);return Object.entries(r).forEach(([s,o])=>{t[s]=o}),t},{}):se(e)}function se(e){return e.split(",").map(t=>t.split("=").map(n=>decodeURIComponent(n.trim()))).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function J(e,t=[]){return[e,t]}function Xn(e,t){const[n,r]=e;return[n,[...r,t]]}function oe(e,t){const n=e[1];for(const r of n){const s=r[0].type;if(t(r,s))return!0}return!1}function bt(e){return m.__SENTRY__&&m.__SENTRY__.encodePolyfill?m.__SENTRY__.encodePolyfill(e):new TextEncoder().encode(e)}function Vn(e){const[t,n]=e;let r=JSON.stringify(t);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[bt(r),o]:r.push(typeof o=="string"?bt(o):o)}for(const o of n){const[i,a]=o;if(s(`
${JSON.stringify(i)}
`),typeof a=="string"||a instanceof Uint8Array)s(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(D(a))}s(c)}}return typeof r=="string"?r:Zn(r)}function Zn(e){const t=e.reduce((s,o)=>s+o.length,0),n=new Uint8Array(t);let r=0;for(const s of e)n.set(s,r),r+=s.length;return n}function Qn(e){const t=typeof e.data=="string"?bt(e.data):e.data;return[k({type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType}),t]}const tr={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function ie(e){return tr[e]}function Fe(e){if(!e||!e.sdk)return;const{name:t,version:n}=e.sdk;return{name:t,version:n}}function er(e,t,n,r){const s=e.sdkProcessingMetadata&&e.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:ft(r)},...s&&{trace:k({...s})}}}function nr(e,t,n){const r=[{type:"client_report"},{timestamp:z(),discarded_events:e}];return J(t?{dsn:t}:{},[r])}const rr=60*1e3;function sr(e,t=Date.now()){const n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${e}`);return isNaN(r)?rr:r-t}function or(e,t){return e[t]||e.all||0}function ir(e,t,n=Date.now()){return or(e,t)>n}function ar(e,{statusCode:t,headers:n},r=Date.now()){const s={...e},o=n&&n["x-sentry-rate-limits"],i=n&&n["retry-after"];if(o)for(const a of o.trim().split(",")){const[c,u,,,f]=a.split(":",5),l=parseInt(c,10),d=(isNaN(l)?60:l)*1e3;if(!u)s.all=r+d;else for(const _ of u.split(";"))_==="metric_bucket"?(!f||f.split(";").includes("custom"))&&(s[_]=r+d):s[_]=r+d}else i?s.all=r+sr(i,r):t===429&&(s.all=r+60*1e3);return s}function ae(){return{traceId:v(),spanId:v().substring(16)}}const et=m;function cr(){const e=et.chrome,t=e&&e.app&&e.app.runtime,n="history"in et&&!!et.history.pushState&&!!et.history.replaceState;return!t&&n}const g=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function $t(){return At(m),m}function At(e){const t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||P,t[P]=t[P]||{}}function It(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||R(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:v()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{const n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}const kt="_sentrySpan";function ce(e,t){t?H(e,kt,t):delete e[kt]}function ue(e){return e[kt]}const ur=100;class Ft{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext=ae()}clone(){const t=new Ft;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._extra={...this._extra},t._contexts={...this._contexts},t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._requestSession=this._requestSession,t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,ce(t,ue(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&It(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}getRequestSession(){return this._requestSession}setRequestSession(t){return this._requestSession=t,this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this._tags={...this._tags,[t]:n},this._notifyScopeListeners(),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;const n=typeof t=="function"?t(this):t,[r,s]=n instanceof $?[n.getScopeData(),n.getRequestSession()]:U(n)?[t,t.requestSession]:[],{tags:o,extra:i,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l}=r||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),f.length&&(this._fingerprint=f),l&&(this._propagationContext=l),s&&(this._requestSession=s),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._requestSession=void 0,this._session=void 0,ce(this,void 0),this._attachments=[],this._propagationContext=ae(),this._notifyScopeListeners(),this}addBreadcrumb(t,n){const r=typeof n=="number"?n:ur;if(r<=0)return this;const s={timestamp:z(),...t},o=this._breadcrumbs;return o.push(s),this._breadcrumbs=o.length>r?o.slice(-r):o,this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:ue(this)}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata={...this._sdkProcessingMetadata,...t},this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){const r=n&&n.event_id?n.event_id:v();if(!this._client)return h.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:s,...n,event_id:r},this),r}captureMessage(t,n,r){const s=r&&r.event_id?r.event_id:v();if(!this._client)return h.warn("No client configured on scope - will not capture message!"),s;const o=new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:s},this),s}captureEvent(t,n){const r=n&&n.event_id?n.event_id:v();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(h.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}}const $=Ft;function fr(){return Ct("defaultCurrentScope",()=>new $)}function lr(){return Ct("defaultIsolationScope",()=>new $)}class dr{constructor(t,n){let r;t?r=t:r=new $;let s;n?s=n:s=new $,this._stack=[{scope:r}],this._isolationScope=s}withScope(t){const n=this._pushScope();let r;try{r=t(n)}catch(s){throw this._popScope(),s}return ut(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function G(){const e=$t(),t=At(e);return t.stack=t.stack||new dr(fr(),lr())}function pr(e){return G().withScope(e)}function hr(e,t){const n=G();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function fe(e){return G().withScope(()=>e(G().getIsolationScope()))}function _r(){return{withIsolationScope:fe,withScope:pr,withSetScope:hr,withSetIsolationScope:(e,t)=>fe(t),getCurrentScope:()=>G().getScope(),getIsolationScope:()=>G().getIsolationScope()}}function Le(e){const t=At(e);return t.acs?t.acs:_r()}function Lt(){const e=$t();return Le(e).getCurrentScope()}function je(){const e=$t();return Le(e).getIsolationScope()}function mr(){return Ct("globalScope",()=>new $)}function E(){return Lt().getClient()}const gr="_sentryMetrics";function yr(e){const t=e[gr];if(!t)return;const n={};for(const[,[r,s]]of t)(n[r]||(n[r]=[])).push(k(s));return n}const Er="sentry.source",Sr="sentry.sample_rate",br="sentry.op",Ir="sentry.origin",kr=0,Tr=1,vr=1;function Nr(e){const{spanId:t,traceId:n}=e.spanContext(),{parent_span_id:r}=at(e);return k({parent_span_id:r,span_id:t,trace_id:n})}function le(e){return typeof e=="number"?de(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?de(e.getTime()):R()}function de(e){return e>9999999999?e/1e3:e}function at(e){if(Dr(e))return e.getSpanJSON();try{const{spanId:t,traceId:n}=e.spanContext();if(Or(e)){const{attributes:r,startTime:s,name:o,endTime:i,parentSpanId:a,status:c}=e;return k({span_id:t,trace_id:n,data:r,description:o,parent_span_id:a,start_timestamp:le(s),timestamp:le(i)||void 0,status:wr(c),op:r[br],origin:r[Ir],_metrics_summary:yr(e)})}return{span_id:t,trace_id:n}}catch{return{}}}function Or(e){const t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Dr(e){return typeof e.getSpanJSON=="function"}function Rr(e){const{traceFlags:t}=e.spanContext();return t===vr}function wr(e){if(!(!e||e.code===kr))return e.code===Tr?"ok":e.message||"unknown_error"}const Pr="_sentryRootSpan";function Ue(e){return e[Pr]||e}const Be="production",Cr="_frozenDsc";function He(e,t){const n=t.getOptions(),{publicKey:r}=t.getDsn()||{},s=k({environment:n.environment||Be,release:n.release,public_key:r,trace_id:e});return t.emit("createDsc",s),s}function xr(e){const t=E();if(!t)return{};const n=He(at(e).trace_id||"",t),r=Ue(e),s=r[Cr];if(s)return s;const o=r.spanContext().traceState,i=o&&o.get("sentry.dsc"),a=i&&zn(i);if(a)return a;const c=at(r),u=c.data||{},f=u[Sr];f!=null&&(n.sample_rate=`${f}`);const l=u[Er],d=c.description;return l!=="url"&&d&&(n.transaction=d),n.sampled=String(Rr(r)),t.emit("createDsc",n,r),n}function Mr(e){if(typeof e=="boolean")return Number(e);const t=typeof e=="string"?parseFloat(e):e;if(typeof t!="number"||isNaN(t)||t<0||t>1){g&&h.warn(`[Tracing] Given sample rate is invalid. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(e)} of type ${JSON.stringify(typeof e)}.`);return}return t}function $r(e,t){return t&&(e.sdk=e.sdk||{},e.sdk.name=e.sdk.name||t.name,e.sdk.version=e.sdk.version||t.version,e.sdk.integrations=[...e.sdk.integrations||[],...t.integrations||[]],e.sdk.packages=[...e.sdk.packages||[],...t.packages||[]]),e}function Ar(e,t,n,r){const s=Fe(n),o={sent_at:new Date().toISOString(),...s&&{sdk:s},...!!r&&t&&{dsn:ft(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return J(o,[i])}function Fr(e,t,n,r){const s=Fe(n),o=e.type&&e.type!=="replay_event"?e.type:"event";$r(e,n&&n.sdk);const i=er(e,s,r,t);return delete e.sdkProcessingMetadata,J(i,[[{type:o},e]])}function Tt(e,t,n,r=0){return new b((s,o)=>{const i=e[r];if(t===null||typeof i!="function")s(t);else{const a=i({...t},n);g&&i.id&&a===null&&h.log(`Event processor "${i.id}" dropped event`),ut(a)?a.then(c=>Tt(e,c,n,r+1).then(s)).then(null,o):Tt(e,a,n,r+1).then(s).then(null,o)}})}function Lr(e,t){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:o}=t;jr(e,t),r&&Hr(e,r),Gr(e,n),Ur(e,s),Br(e,o)}function pe(e,t){const{extra:n,tags:r,user:s,contexts:o,level:i,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:f,attachments:l,propagationContext:d,transactionName:_,span:p}=t;Y(e,"extra",n),Y(e,"tags",r),Y(e,"user",s),Y(e,"contexts",o),Y(e,"sdkProcessingMetadata",a),i&&(e.level=i),_&&(e.transactionName=_),p&&(e.span=p),c.length&&(e.breadcrumbs=[...e.breadcrumbs,...c]),u.length&&(e.fingerprint=[...e.fingerprint,...u]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),l.length&&(e.attachments=[...e.attachments,...l]),e.propagationContext={...e.propagationContext,...d}}function Y(e,t,n){if(n&&Object.keys(n).length){e[t]={...e[t]};for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&(e[t][r]=n[r])}}function jr(e,t){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:a}=t,c=k(n);c&&Object.keys(c).length&&(e.extra={...c,...e.extra});const u=k(r);u&&Object.keys(u).length&&(e.tags={...u,...e.tags});const f=k(s);f&&Object.keys(f).length&&(e.user={...f,...e.user});const l=k(o);l&&Object.keys(l).length&&(e.contexts={...l,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function Ur(e,t){const n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function Br(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Hr(e,t){e.contexts={trace:Nr(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:xr(t),...e.sdkProcessingMetadata};const n=Ue(t),r=at(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Gr(e,t){e.fingerprint=e.fingerprint?Ln(e.fingerprint):[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint&&!e.fingerprint.length&&delete e.fingerprint}function Yr(e,t,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||v(),timestamp:t.timestamp||z()},u=n.integrations||e.integrations.map(y=>y.name);qr(c,e),zr(c,u),s&&s.emit("applyFrameMetadata",t),t.type===void 0&&Wr(c,e.stackParser);const f=Xr(r,n.captureContext);n.mechanism&&it(c,n.mechanism);const l=s?s.getEventProcessors():[],d=mr().getScopeData();if(o){const y=o.getScopeData();pe(d,y)}if(f){const y=f.getScopeData();pe(d,y)}const _=[...n.attachments||[],...d.attachments];_.length&&(n.attachments=_),Lr(c,d);const p=[...l,...d.eventProcessors];return Tt(p,c,n).then(y=>(y&&Kr(y),typeof i=="number"&&i>0?Jr(y,i,a):y))}function qr(e,t){const{environment:n,release:r,dist:s,maxValueLength:o=250}=t;"environment"in e||(e.environment="environment"in t?n:Be),e.release===void 0&&r!==void 0&&(e.release=r),e.dist===void 0&&s!==void 0&&(e.dist=s),e.message&&(e.message=j(e.message,o));const i=e.exception&&e.exception.values&&e.exception.values[0];i&&i.value&&(i.value=j(i.value,o));const a=e.request;a&&a.url&&(a.url=j(a.url,o))}const he=new WeakMap;function Wr(e,t){const n=m._sentryDebugIds;if(!n)return;let r;const s=he.get(t);s?r=s:(r=new Map,he.set(t,r));const o=Object.entries(n).reduce((i,[a,c])=>{let u;const f=r.get(a);f?u=f:(u=t(a),r.set(a,u));for(let l=u.length-1;l>=0;l--){const d=u[l];if(d.filename){i[d.filename]=c;break}}return i},{});try{e.exception.values.forEach(i=>{i.stacktrace.frames.forEach(a=>{a.filename&&(a.debug_id=o[a.filename])})})}catch{}}function Kr(e){const t={};try{e.exception.values.forEach(r=>{r.stacktrace.frames.forEach(s=>{s.debug_id&&(s.abs_path?t[s.abs_path]=s.debug_id:s.filename&&(t[s.filename]=s.debug_id),delete s.debug_id)})})}catch{}if(Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];const n=e.debug_meta.images;Object.entries(t).forEach(([r,s])=>{n.push({type:"sourcemap",code_file:r,debug_id:s})})}function zr(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function Jr(e,t,n){if(!e)return null;const r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(s=>({...s,...s.data&&{data:D(s.data,t,n)}}))},...e.user&&{user:D(e.user,t,n)},...e.contexts&&{contexts:D(e.contexts,t,n)},...e.extra&&{extra:D(e.extra,t,n)}};return e.contexts&&e.contexts.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=D(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(s=>({...s,...s.data&&{data:D(s.data,t,n)}}))),r}function Xr(e,t){if(!t)return e;const n=e?e.clone():new $;return n.update(t),n}function Ge(e,t){return Lt().captureEvent(e,t)}const Vr="7";function Zr(e){const t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function Qr(e){return`${Zr(e)}${e.projectId}/envelope/`}function ts(e,t){return yn({sentry_key:e.publicKey,sentry_version:Vr,...t&&{sentry_client:`${t.name}/${t.version}`}})}function es(e,t,n){return t||`${Qr(e)}?${ts(e,n)}`}const _e=[];function ns(e,t){const n={};return t.forEach(r=>{r&&Ye(e,r,n)}),n}function me(e,t){for(const n of t)n&&n.afterAllSetup&&n.afterAllSetup(e)}function Ye(e,t,n){if(n[t.name]){g&&h.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,_e.indexOf(t.name)===-1&&typeof t.setupOnce=="function"&&(t.setupOnce(),_e.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){const r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(s,o)=>r(s,o,e))}if(typeof t.processEvent=="function"){const r=t.processEvent.bind(t),s=Object.assign((o,i)=>r(o,i,e),{id:t.name});e.addEventProcessor(s)}g&&h.log(`Integration installed: ${t.name}`)}const ge="Not capturing exception because it's already been captured.";class rs{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],t.dsn?this._dsn=_n(t.dsn):g&&h.warn("No DSN provided, client will not send events."),this._dsn){const n=es(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:n})}}captureException(t,n,r){const s=v();if(re(t))return g&&h.log(ge),s;const o={event_id:s,...n};return this._process(this.eventFromException(t,o).then(i=>this._captureEvent(i,o,r))),o.event_id}captureMessage(t,n,r,s){const o={event_id:v(),...r},i=wt(t)?t:String(t),a=Pt(t)?this.eventFromMessage(i,n,o):this.eventFromException(t,o);return this._process(a.then(c=>this._captureEvent(c,o,s))),o.event_id}captureEvent(t,n,r){const s=v();if(n&&n.originalException&&re(n.originalException))return g&&h.log(ge),s;const o={event_id:s,...n},a=(t.sdkProcessingMetadata||{}).capturedSpanScope;return this._process(this._captureEvent(t,o,a||r)),o.event_id}captureSession(t){typeof t.release!="string"?g&&h.warn("Discarded session because of missing or non-string release"):(this.sendSession(t),It(t,{init:!1}))}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(t){const n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(t).then(r=>n.flush(t).then(s=>r&&s))):M(!0)}close(t){return this.flush(t).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){const n=this._integrations[t.name];Ye(this,t,this._integrations),n||me(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=Fr(t,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])r=Xn(r,Qn(o));const s=this.sendEnvelope(r);s&&s.then(o=>this.emit("afterSendEvent",t,o),null)}sendSession(t){const n=Ar(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(n)}recordDroppedEvent(t,n,r){if(this._options.sendClientReports){const s=typeof r=="number"?r:1,o=`${t}:${n}`;g&&h.log(`Recording outcome: "${o}"${s>1?` (${s} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+s}}on(t,n){const r=this._hooks[t]=this._hooks[t]||[];return r.push(n),()=>{const s=r.indexOf(n);s>-1&&r.splice(s,1)}}emit(t,...n){const r=this._hooks[t];r&&r.forEach(s=>s(...n))}sendEnvelope(t){return this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport?this._transport.send(t).then(null,n=>(g&&h.error("Error while sending event:",n),n)):(g&&h.error("Transport disabled"),M({}))}_setupIntegrations(){const{integrations:t}=this._options;this._integrations=ns(this,t),me(this,t)}_updateSessionFromEvent(t,n){let r=!1,s=!1;const o=n.exception&&n.exception.values;if(o){s=!0;for(const c of o){const u=c.mechanism;if(u&&u.handled===!1){r=!0;break}}}const i=t.status==="ok";(i&&t.errors===0||i&&r)&&(It(t,{...r&&{status:"crashed"},errors:t.errors||Number(s||r)}),this.captureSession(t))}_isClientDoneProcessing(t){return new b(n=>{let r=0;const s=1,o=setInterval(()=>{this._numProcessing==0?(clearInterval(o),n(!0)):(r+=s,t&&r>=t&&(clearInterval(o),n(!1)))},s)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(t,n,r,s=je()){const o=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i.length>0&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||s.setLastEventId(t.event_id||n.event_id),Yr(o,t,n,r,this,s).then(a=>{if(a===null)return a;const c={...s.getPropagationContext(),...r?r.getPropagationContext():void 0};if(!(a.contexts&&a.contexts.trace)&&c){const{traceId:f,spanId:l,parentSpanId:d,dsc:_}=c;a.contexts={trace:k({trace_id:f,span_id:l,parent_span_id:d}),...a.contexts};const p=_||He(f,this);a.sdkProcessingMetadata={dynamicSamplingContext:p,...a.sdkProcessingMetadata}}return a})}_captureEvent(t,n={},r){return this._processEvent(t,n,r).then(s=>s.event_id,s=>{if(g){const o=s;o.logLevel==="log"?h.log(o.message):h.warn(o)}})}_processEvent(t,n,r){const s=this.getOptions(),{sampleRate:o}=s,i=We(t),a=qe(t),c=t.type||"error",u=`before send for type \`${c}\``,f=typeof o>"u"?void 0:Mr(o);if(a&&typeof f=="number"&&Math.random()>f)return this.recordDroppedEvent("sample_rate","error",t),Ae(new N(`Discarding event because it's not included in the random sample (sampling rate = ${o})`,"log"));const l=c==="replay_event"?"replay":c,_=(t.sdkProcessingMetadata||{}).capturedSpanIsolationScope;return this._prepareEvent(t,n,r,_).then(p=>{if(p===null)throw this.recordDroppedEvent("event_processor",l,t),new N("An event processor returned `null`, will not send event.","log");if(n.data&&n.data.__sentry__===!0)return p;const y=os(this,s,p,n);return ss(y,u)}).then(p=>{if(p===null){if(this.recordDroppedEvent("before_send",l,t),i){const lt=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",lt)}throw new N(`${u} returned \`null\`, will not send event.`,"log")}const X=r&&r.getSession();if(!i&&X&&this._updateSessionFromEvent(X,p),i){const V=p.sdkProcessingMetadata&&p.sdkProcessingMetadata.spanCountBeforeProcessing||0,lt=p.spans?p.spans.length:0,Gt=V-lt;Gt>0&&this.recordDroppedEvent("before_send","span",Gt)}const y=p.transaction_info;if(i&&y&&p.transaction!==t.transaction){const V="custom";p.transaction_info={...y,source:V}}return this.sendEvent(p,n),p}).then(null,p=>{throw p instanceof N?p:(this.captureException(p,{data:{__sentry__:!0},originalException:p}),new N(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(t){this._numProcessing++,t.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){const t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{const[s,o]=n.split(":");return{reason:s,category:o,quantity:r}})}_flushOutcomes(){g&&h.log("Flushing outcomes...");const t=this._clearOutcomes();if(t.length===0){g&&h.log("No outcomes to send");return}if(!this._dsn){g&&h.log("No dsn provided, will not send outcomes");return}g&&h.log("Sending outcomes:",t);const n=nr(t,this._options.tunnel&&ft(this._dsn));this.sendEnvelope(n)}}function ss(e,t){const n=`${t} must return \`null\` or a valid event.`;if(ut(e))return e.then(r=>{if(!U(r)&&r!==null)throw new N(n);return r},r=>{throw new N(`${t} rejected with ${r}`)});if(!U(e)&&e!==null)throw new N(n);return e}function os(e,t,n,r){const{beforeSend:s,beforeSendTransaction:o,beforeSendSpan:i}=t;if(qe(n)&&s)return s(n,r);if(We(n)){if(n.spans&&i){const a=[];for(const c of n.spans){const u=i(c);u?a.push(u):e.recordDroppedEvent("before_send","span")}n.spans=a}if(o){if(n.spans){const a=n.spans.length;n.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:a}}return o(n,r)}}return n}function qe(e){return e.type===void 0}function We(e){return e.type==="transaction"}const is=64;function as(e,t,n=Gn(e.bufferSize||is)){let r={};const s=i=>n.drain(i);function o(i){const a=[];if(oe(i,(l,d)=>{const _=ie(d);if(ir(r,_)){const p=ye(l,d);e.recordDroppedEvent("ratelimit_backoff",_,p)}else a.push(l)}),a.length===0)return M({});const c=J(i[0],a),u=l=>{oe(c,(d,_)=>{const p=ye(d,_);e.recordDroppedEvent(l,ie(_),p)})},f=()=>t({body:Vn(c)}).then(l=>(l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&g&&h.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=ar(r,l),l),l=>{throw u("network_error"),l});return n.add(f).then(l=>l,l=>{if(l instanceof N)return g&&h.error("Skipped sending event because buffer is full."),u("queue_overflow"),M({});throw l})}return{send:o,flush:s}}function ye(e,t){if(!(t!=="event"&&t!=="transaction"))return Array.isArray(e)?e[1]:void 0}function cs(e,t,n=[t],r="npm"){const s=e._metadata||{};s.sdk||(s.sdk={name:`sentry.javascript.${t}`,packages:n.map(o=>({name:`${r}:@sentry/${o}`,version:P})),version:P}),e._metadata=s}const us=100;function A(e,t){const n=E(),r=je();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=us}=n.getOptions();if(o<=0)return;const a={timestamp:z(),...e},c=s?Mt(()=>s(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,o))}let Ee;const fs="FunctionToString",Se=new WeakMap,ls=()=>({name:fs,setupOnce(){Ee=Function.prototype.toString;try{Function.prototype.toString=function(...e){const t=gn(this),n=Se.has(E())&&t!==void 0?t:this;return Ee.apply(n,e)}}catch{}},setup(e){Se.set(e,!0)}}),ds=ls,ps="Dedupe",hs=()=>{let e;return{name:ps,processEvent(t){if(t.type)return t;try{if(ms(t,e))return g&&h.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}},_s=hs;function ms(e,t){return t?!!(gs(e,t)||ys(e,t)):!1}function gs(e,t){const n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!ze(e,t)||!Ke(e,t))}function ys(e,t){const n=be(t),r=be(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!ze(e,t)||!Ke(e,t))}function Ke(e,t){let n=Zt(e),r=Zt(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let s=0;s<r.length;s++){const o=r[s],i=n[s];if(o.filename!==i.filename||o.lineno!==i.lineno||o.colno!==i.colno||o.function!==i.function)return!1}return!0}function ze(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function be(e){return e.exception&&e.exception.values&&e.exception.values[0]}const S=m;let Es=0;function Je(){return Es>0}const jt=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function Ut(e,t){const n=Bt(e,t),r={type:t&&t.name,value:Ts(t)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function Ss(e,t,n,r){const s=E(),o=s&&s.getOptions().normalizeDepth,i=Rs(t),a={__serialized__:$e(t,o)};if(i)return{exception:{values:[Ut(e,i)]},extra:a};const c={exception:{values:[{type:ct(t)?t.constructor.name:r?"UnhandledRejection":"Error",value:Os(t,{isUnhandledRejection:r})}]},extra:a};if(n){const u=Bt(e,n);u.length&&(c.exception.values[0].stacktrace={frames:u})}return c}function ht(e,t){return{exception:{values:[Ut(e,t)]}}}function Bt(e,t){const n=t.stacktrace||t.stack||"",r=Is(t),s=ks(t);try{return e(n,r,s)}catch{}return[]}const bs=/Minified React error #\d+;/i;function Is(e){return e&&bs.test(e.message)?1:0}function ks(e){return typeof e.framesToPop=="number"?e.framesToPop:0}function Ts(e){const t=e&&e.message;return t?t.error&&typeof t.error.message=="string"?t.error.message:t:"No error message"}function vs(e,t,n,r){const s=n&&n.syntheticException||void 0,o=Ht(e,t,s,r);return it(o),o.level="error",n&&n.event_id&&(o.event_id=n.event_id),M(o)}function Ns(e,t,n="info",r,s){const o=r&&r.syntheticException||void 0,i=vt(e,t,o,s);return i.level=n,r&&r.event_id&&(i.event_id=r.event_id),M(i)}function Ht(e,t,n,r,s){let o;if(Ne(t)&&t.error)return ht(e,t.error);if(Yt(t)||Qe(t)){const i=t;if("stack"in t)o=ht(e,t);else{const a=i.name||(Yt(i)?"DOMError":"DOMException"),c=i.message?`${a}: ${i.message}`:a;o=vt(e,c,n,r),ne(o,c)}return"code"in i&&(o.tags={...o.tags,"DOMException.code":`${i.code}`}),o}return Rt(t)?ht(e,t):U(t)||ct(t)?(o=Ss(e,t,n,s),it(o,{synthetic:!0}),o):(o=vt(e,t,n,r),ne(o,`${t}`),it(o,{synthetic:!0}),o)}function vt(e,t,n,r){const s={};if(r&&n){const o=Bt(e,n);o.length&&(s.exception={values:[{value:t,stacktrace:{frames:o}}]})}if(wt(t)){const{__sentry_template_string__:o,__sentry_template_values__:i}=t;return s.logentry={message:o,params:i},s}return s.message=t,s}function Os(e,{isUnhandledRejection:t}){const n=En(e),r=t?"promise rejection":"exception";return Ne(e)?`Event \`ErrorEvent\` captured as ${r} with message \`${e.message}\``:ct(e)?`Event \`${Ds(e)}\` (type=${e.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function Ds(e){try{const t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function Rs(e){for(const t in e)if(Object.prototype.hasOwnProperty.call(e,t)){const n=e[t];if(n instanceof Error)return n}}function ws(e,{metadata:t,tunnel:n,dsn:r}){const s={event_id:e.event_id,sent_at:new Date().toISOString(),...t&&t.sdk&&{sdk:{name:t.sdk.name,version:t.sdk.version}},...!!n&&!!r&&{dsn:ft(r)}},o=Ps(e);return J(s,[o])}function Ps(e){return[{type:"user_report"},e]}class Cs extends rs{constructor(t){const n={parentSpanIsAlwaysRootSpan:!0,...t},r=S.SENTRY_SDK_SOURCE||$n();cs(n,"browser",["browser"],r),super(n),n.sendClientReports&&S.document&&S.document.addEventListener("visibilitychange",()=>{S.document.visibilityState==="hidden"&&this._flushOutcomes()})}eventFromException(t,n){return vs(this._options.stackParser,t,n,this._options.attachStacktrace)}eventFromMessage(t,n="info",r){return Ns(this._options.stackParser,t,n,r,this._options.attachStacktrace)}captureUserFeedback(t){if(!this._isEnabled()){jt&&h.warn("SDK not enabled, will not capture user feedback.");return}const n=ws(t,{metadata:this.getSdkMetadata(),dsn:this.getDsn(),tunnel:this.getOptions().tunnel});this.sendEnvelope(n)}_prepareEvent(t,n,r){return t.platform=t.platform||"javascript",super._prepareEvent(t,n,r)}}const I=m,xs=1e3;let Ie,Nt,Ot;function Ms(e){const t="dom";F(t,e),L(t,$s)}function $s(){if(!I.document)return;const e=T.bind(null,"dom"),t=ke(e,!0);I.document.addEventListener("click",t,!1),I.document.addEventListener("keypress",t,!1),["EventTarget","Node"].forEach(n=>{const r=I[n]&&I[n].prototype;!r||!r.hasOwnProperty||!r.hasOwnProperty("addEventListener")||(B(r,"addEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__=c.__sentry_instrumentation_handlers__||{},f=u[o]=u[o]||{refCount:0};if(!f.handler){const l=ke(e);f.handler=l,s.call(this,o,l,a)}f.refCount++}catch{}return s.call(this,o,i,a)}}),B(r,"removeEventListener",function(s){return function(o,i,a){if(o==="click"||o=="keypress")try{const c=this,u=c.__sentry_instrumentation_handlers__||{},f=u[o];f&&(f.refCount--,f.refCount<=0&&(s.call(this,o,f.handler,a),f.handler=void 0,delete u[o]),Object.keys(u).length===0&&delete c.__sentry_instrumentation_handlers__)}catch{}return s.call(this,o,i,a)}}))})}function As(e){if(e.type!==Nt)return!1;try{if(!e.target||e.target._sentryId!==Ot)return!1}catch{}return!0}function Fs(e,t){return e!=="keypress"?!1:!t||!t.tagName?!0:!(t.tagName==="INPUT"||t.tagName==="TEXTAREA"||t.isContentEditable)}function ke(e,t=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Ls(n);if(Fs(n.type,r))return;H(n,"_sentryCaptured",!0),r&&!r._sentryId&&H(r,"_sentryId",v());const s=n.type==="keypress"?"input":n.type;As(n)||(e({event:n,name:s,global:t}),Nt=n.type,Ot=r?r._sentryId:void 0),clearTimeout(Ie),Ie=I.setTimeout(()=>{Ot=void 0,Nt=void 0},xs)}}function Ls(e){try{return e.target}catch{return null}}let nt;function js(e){const t="history";F(t,e),L(t,Us)}function Us(){if(!cr())return;const e=I.onpopstate;I.onpopstate=function(...n){const r=I.location.href,s=nt;if(nt=r,T("history",{from:s,to:r}),e)try{return e.apply(this,n)}catch{}};function t(n){return function(...r){const s=r.length>2?r[2]:void 0;if(s){const o=nt,i=String(s);nt=i,T("history",{from:o,to:i})}return n.apply(this,r)}}B(I.history,"pushState",t),B(I.history,"replaceState",t)}const q="__sentry_xhr_v3__";function Bs(e){const t="xhr";F(t,e),L(t,Hs)}function Hs(){if(!I.XMLHttpRequest)return;const e=XMLHttpRequest.prototype;e.open=new Proxy(e.open,{apply(t,n,r){const s=R()*1e3,o=w(r[0])?r[0].toUpperCase():void 0,i=Gs(r[1]);if(!o||!i)return t.apply(n,r);n[q]={method:o,url:i,request_headers:{}},o==="POST"&&i.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const a=()=>{const c=n[q];if(c&&n.readyState===4){try{c.status_code=n.status}catch{}const u={endTimestamp:R()*1e3,startTimestamp:s,xhr:n};T("xhr",u)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(c,u,f){return a(),c.apply(u,f)}}):n.addEventListener("readystatechange",a),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(c,u,f){const[l,d]=f,_=u[q];return _&&w(l)&&w(d)&&(_.request_headers[l.toLowerCase()]=d),c.apply(u,f)}}),t.apply(n,r)}}),e.send=new Proxy(e.send,{apply(t,n,r){const s=n[q];if(!s)return t.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const o={startTimestamp:R()*1e3,xhr:n};return T("xhr",o),t.apply(n,r)}})}function Gs(e){if(w(e))return e;try{return e.toString()}catch{}}const Ys=30,qs=50;function Dt(e,t,n,r){const s={filename:e,function:t==="<anonymous>"?x:t,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const Ws=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Ks=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,zs=/\((\S*)(?::(\d+))(?::(\d+))\)/,Js=e=>{const t=Ws.exec(e);if(t){const[,r,s,o]=t;return Dt(r,x,+s,+o)}const n=Ks.exec(e);if(n){if(n[2]&&n[2].indexOf("eval")===0){const i=zs.exec(n[2]);i&&(n[2]=i[1],n[3]=i[2],n[4]=i[3])}const[s,o]=Xe(n[1]||x,n[2]);return Dt(o,s,n[3]?+n[3]:void 0,n[4]?+n[4]:void 0)}},Xs=[Ys,Js],Vs=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Zs=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Qs=e=>{const t=Vs.exec(e);if(t){if(t[3]&&t[3].indexOf(" > eval")>-1){const o=Zs.exec(t[3]);o&&(t[1]=t[1]||"eval",t[3]=o[1],t[4]=o[2],t[5]="")}let r=t[3],s=t[1]||x;return[s,r]=Xe(s,r),Dt(r,s,t[4]?+t[4]:void 0,t[5]?+t[5]:void 0)}},to=[qs,Qs],eo=[Xs,to],no=bn(...eo),Xe=(e,t)=>{const n=e.indexOf("safari-extension")!==-1,r=e.indexOf("safari-web-extension")!==-1;return n||r?[e.indexOf("@")!==-1?e.split("@")[0]:x,n?`safari-extension:${t}`:`safari-web-extension:${t}`]:[e,t]},rt=1024,ro="Breadcrumbs",so=(e={})=>{const t={console:!0,dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...e};return{name:ro,setup(n){t.console&&kn(co(n)),t.dom&&Ms(ao(n,t.dom)),t.xhr&&Bs(uo(n)),t.fetch&&Dn(fo(n)),t.history&&js(lo(n)),t.sentry&&n.on("beforeSendEvent",io(n))}}},oo=so;function io(e){return function(n){E()===e&&A({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:Fn(n)},{event:n})}}function ao(e,t){return function(r){if(E()!==e)return;let s,o,i=typeof t=="object"?t.serializeAttribute:void 0,a=typeof t=="object"&&typeof t.maxStringLength=="number"?t.maxStringLength:void 0;a&&a>rt&&(jt&&h.warn(`\`dom.maxStringLength\` cannot exceed ${rt}, but a value of ${a} was configured. Sentry will use ${rt} instead.`),a=rt),typeof i=="string"&&(i=[i]);try{const u=r.event,f=po(u)?u.target:u;s=De(f,{keyAttrs:i,maxStringLength:a}),o=cn(f)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};o&&(c.data={"ui.component_name":o}),A(c,{event:r.event,name:r.name,global:r.global})}}function co(e){return function(n){if(E()!==e)return;const r={category:"console",data:{arguments:n.args,logger:"console"},level:qn(n.level),message:qt(n.args," ")};if(n.level==="assert")if(n.args[0]===!1)r.message=`Assertion failed: ${qt(n.args.slice(1)," ")||"console.assert"}`,r.data.arguments=n.args.slice(1);else return;A(r,{input:n.args,level:n.level})}}function uo(e){return function(n){if(E()!==e)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[q];if(!r||!s||!o)return;const{method:i,url:a,status_code:c,body:u}=o,f={method:i,url:a,status_code:c},l={xhr:n.xhr,input:u,startTimestamp:r,endTimestamp:s};A({category:"xhr",data:f,type:"http"},l)}}function fo(e){return function(n){if(E()!==e)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const o=n.fetchData,i={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s};A({category:"fetch",data:o,level:"error",type:"http"},i)}else{const o=n.response,i={...n.fetchData,status_code:o&&o.status},a={input:n.args,response:o,startTimestamp:r,endTimestamp:s};A({category:"fetch",data:i,type:"http"},a)}}}function lo(e){return function(n){if(E()!==e)return;let r=n.from,s=n.to;const o=pt(S.location.href);let i=r?pt(r):void 0;const a=pt(s);(!i||!i.path)&&(i=o),o.protocol===a.protocol&&o.host===a.host&&(s=a.relative),o.protocol===i.protocol&&o.host===i.host&&(r=i.relative),A({category:"navigation",data:{from:r,to:s}})}}function po(e){return!!e&&!!e.target}const ho="GlobalHandlers",_o=(e={})=>{const t={onerror:!0,onunhandledrejection:!0,...e};return{name:ho,setupOnce(){Error.stackTraceLimit=50},setup(n){t.onerror&&(go(n),Te("onerror")),t.onunhandledrejection&&(yo(n),Te("onunhandledrejection"))}}},mo=_o;function go(e){Pn(t=>{const{stackParser:n,attachStacktrace:r}=Ve();if(E()!==e||Je())return;const{msg:s,url:o,line:i,column:a,error:c}=t,u=bo(Ht(n,c||s,void 0,r,!1),o,i,a);u.level="error",Ge(u,{originalException:c,mechanism:{handled:!1,type:"onerror"}})})}function yo(e){xn(t=>{const{stackParser:n,attachStacktrace:r}=Ve();if(E()!==e||Je())return;const s=Eo(t),o=Pt(s)?So(s):Ht(n,s,void 0,r,!0);o.level="error",Ge(o,{originalException:s,mechanism:{handled:!1,type:"onunhandledrejection"}})})}function Eo(e){if(Pt(e))return e;try{if("reason"in e)return e.reason;if("detail"in e&&"reason"in e.detail)return e.detail.reason}catch{}return e}function So(e){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(e)}`}]}}}function bo(e,t,n,r){const s=e.exception=e.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[],u=isNaN(parseInt(r,10))?void 0:r,f=isNaN(parseInt(n,10))?void 0:n,l=w(t)&&t.length>0?t:an();return c.length===0&&c.push({colno:u,filename:l,function:x,in_app:!0,lineno:f}),e}function Te(e){jt&&h.log(`Global Handler attached: ${e}`)}function Ve(){const e=E();return e&&e.getOptions()||{stackParser:()=>[],attachStacktrace:!1}}const Io=()=>({name:"HttpContext",preprocessEvent(e){if(!S.navigator&&!S.location&&!S.document)return;const t=e.request&&e.request.url||S.location&&S.location.href,{referrer:n}=S.document||{},{userAgent:r}=S.navigator||{},s={...e.request&&e.request.headers,...n&&{Referer:n},...r&&{"User-Agent":r}},o={...e.request,...t&&{url:t},headers:s};e.request=o}}),ko="cause",To=5,vo="LinkedErrors",No=(e={})=>{const t=e.limit||To,n=e.key||ko;return{name:vo,preprocessEvent(r,s,o){const i=o.getOptions();nn(Ut,i.stackParser,i.maxValueLength,n,t,r,s)}}},Oo=No,Do=e=>as(e,async n=>{const r={body:n.body,headers:e.headers,method:"POST",mode:"no-cors",referrerPolicy:"no-referrer",...e.fetchOptions},s=await fetch(e.url,r);return{headers:{"x-sentry-rate-limits":s.headers.get("X-Sentry-Rate-Limits"),"retry-after":s.headers.get("Retry-After")},statusCode:s.status}}),Ze=new Cs({dsn:"http://212b07a4828c4025aa32a1f2835e3708@localhost:8000/2",environment:"local",integrations:[oo(),_s(),ds(),mo(),Io(),Oo()],stackParser:no,tracesSampleRate:.01,transport:Do});Lt().setClient(Ze);Ze.init();setTimeout(()=>{throw new Error("Test GlitchTip !")},3e3);
//# sourceMappingURL=gaffe.js.map