presseportale/public/build/portal/error-reporting-sdk-Ca8cRdCE.js
Kevin Adametz e316734e35 build: Assets für v1.1.1
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-10-06 10:12:09 +00:00

15 lines
90 KiB
JavaScript

const h=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,m=globalThis,q="11.3.0";function et(){return gt(m),m}function gt(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||q,e[q]=e[q]||{}}function nt(t,e,n=m){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[q]=r[q]||{};return s[t]||(s[t]=e())}const Nn=["debug","info","warn","error","log","assert","trace"],Dr="Sentry Logger ",wt={};function U(t){if(!("console"in m))return t();const e=m.console,n={},r=Object.keys(wt);r.forEach(s=>{const o=wt[s];n[s]=e[s],e[s]=o});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function Lr(){pe().enabled=!0}function Pr(){pe().enabled=!1}function On(){return pe().enabled}function Mr(...t){de("log",...t)}function $r(...t){de("warn",...t)}function Fr(...t){de("error",...t)}function de(t,...e){h&&On()&&U(()=>{m.console[t](`${Dr}[${t}]:`,...e)})}function pe(){return h?nt("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const g={enable:Lr,disable:Pr,isEnabled:On,log:Mr,warn:$r,error:Fr},Cn=50,G="?",ke=/\(error: (.*)\)/,we=/captureMessage|captureException/;function An(...t){const e=t.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++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));const u=ke.test(c)?c.replace(ke,"$1"):c;if(!u.includes("Error: ")){for(const f of e){const l=f(u);if(l){o.push(l);break}}if(o.length>=Cn+s)break}}return Br(o.slice(s))}}function jr(t){return Array.isArray(t)?An(...t):t}function Br(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(St(e).function||"")&&e.pop(),e.reverse(),we.test(St(e).function||"")&&(e.pop(),we.test(St(e).function||"")&&e.pop()),e.slice(0,Cn).map(n=>({...n,filename:n.filename||St(e).filename,function:n.function||G}))}function St(t){return t[t.length-1]||{}}const Ft="<anonymous>";function j(t){try{return!t||typeof t!="function"?Ft:t.name||Ft}catch{return Ft}}function Re(t){const e=t.exception;if(e){const n=[];try{return e.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}const ut={},Ne={};function Y(t,e){return ut[t]=ut[t]||[],ut[t].push(e),()=>{const n=ut[t];if(n){const r=n.indexOf(e);r!==-1&&n.splice(r,1)}}}function K(t,e){if(!Ne[t]){Ne[t]=!0;try{e()}catch(n){h&&g.error(`Error while instrumenting ${t}`,n)}}}function R(t,e){const n=t&&ut[t];if(n)for(const r of n)try{r(e)}catch(s){h&&g.error(`Error while triggering instrumentation handler.
Type: ${t}
Name: ${j(r)}
Error:`,s)}}let jt=null;function Ur(t){const e="error";Y(e,t),K(e,Hr)}function Hr(){jt=m.onerror,m.onerror=function(t,e,n,r,s){return R("error",{column:r,error:s,line:n,msg:t,url:e}),jt?jt.apply(this,arguments):!1},m.onerror.__SENTRY_INSTRUMENTED__=!0}let Bt=null;function Wr(t){const e="unhandledrejection";Y(e,t),K(e,qr)}function qr(){Bt=m.onunhandledrejection,m.onunhandledrejection=function(t){return R("unhandledrejection",t),Bt?Bt.apply(this,arguments):!0},m.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}const xn=Object.prototype.toString;function L(t){switch(xn.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return he(t,Error)}}function rt(t,e){return xn.call(t)===`[object ${e}]`}function Dn(t){return rt(t,"ErrorEvent")}function Oe(t){return rt(t,"DOMError")}function Gr(t){return rt(t,"DOMException")}function x(t){return rt(t,"String")}function ge(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function st(t){return t===null||ge(t)||typeof t!="object"&&typeof t!="function"}function Rt(t){return rt(t,"Object")}function Ct(t){return typeof t=="object"&&t!==null}function At(t){return typeof Event<"u"&&he(t,Event)}function zr(t){return rt(t,"RegExp")}function ot(t){return!!(t!=null&&t.then&&typeof t.then=="function")}function he(t,e){try{return t instanceof e}catch{return!1}}function Ln(t){return typeof Request<"u"&&he(t,Request)}function T(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&Pn(s,r);try{t[e]=s}catch{h&&g.log(`Failed to replace method "${e}" in object`,t)}}function B(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{h&&g.log(`Failed to add non-enumerable property "${String(e)}" to object`,t)}}function Pn(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,B(t,"__sentry_original__",e)}catch{}}function _e(t){return t.__sentry_original__}function Mn(t){if(L(t))return{message:t.message,name:t.name,stack:t.stack,...Ce(t)};if(At(t)){const{type:e,target:n,currentTarget:r,detail:s}=t;return{type:e,target:n,currentTarget:r,...s?{detail:s}:{},...Ce(t)}}return t}function Ce(t){return Ct(t)?Object.fromEntries(Object.entries(t)):{}}function Yr(t){const e=Object.keys(Mn(t));return e.sort(),e[0]?e.join(", "):"[object has no keys]"}let X;function xt(t){if(X!==void 0)return X?X(t):t();const e=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=m;return e in n&&typeof n[e]=="function"?(X=n[e],X(t)):(X=null,t())}function me(){return xt(()=>Math.random())}function it(){return xt(()=>Date.now())}const Kr=Symbol.for("sentry.skipNormalization"),Vr=Symbol.for("sentry.overrideNormalizationDepth");function Xr(t){return!!t[Kr]}function Jr(t){const e=t[Vr];return typeof e=="number"?e:void 0}let Yt;function Qr(t){Yt=t}function A(t,e=100,n=1/0){try{return Kt("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function $n(t,e=3,n=100*1024){const r=A(t,e);return es(r)>n?$n(t,e-1,n):r}function Kt(t,e,n=1/0,r=1/0,s=ns()){const[o,i]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const a=Fn(t,e);if(!a.startsWith("[object "))return a;if(Xr(e))return e;const c=Jr(e),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(o(e))return"[Circular ~]";const f=e;if(f&&typeof f.toJSON=="function")try{const p=f.toJSON();return Kt("",p,u-1,r,s)}catch{}const l=Array.isArray(e)?[]:{};let d=0;const _=Mn(e);for(const p in _){if(!Object.prototype.hasOwnProperty.call(_,p))continue;if(d>=r){l[p]="[MaxProperties ~]";break}const I=_[p];l[p]=Kt(p,I,u-1,r,s),d++}return i(e),l}function Fn(t,e){try{if(Yt){const r=Yt(e);if(r)return r}return typeof global<"u"&&e===global?"[Global]":typeof e=="number"&&!Number.isFinite(e)?`[${e}]`:typeof e=="function"?`[Function: ${j(e)}]`:typeof e=="symbol"?`[${String(e)}]`:typeof e=="bigint"?`[BigInt: ${String(e)}]`:`[object ${Zr(e)}]`}catch(n){return`**non-serializable** (${n})`}}function Zr(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function ts(t){return~-encodeURI(t).split(/%..|./).length}function es(t){return ts(JSON.stringify(t))}function ns(){const t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Vt(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function rs(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];st(s)?n.push(String(s)):s instanceof Error?n.push(s.message?`${s.name}: ${s.message}`:s.name):n.push(Fn(void 0,s))}return n.join(e)}function lt(t,e,n=!1){return x(t)?zr(e)?e.test(t):x(e)?n?t===e:t.includes(e):typeof e=="function"?e(t):!1:!1}function ht(t,e=[],n=!1){for(const r of e)if(lt(t,r,n))return!0;return!1}function ss(){const t=m;return t.crypto||t.msCrypto}let Ut;function os(){return me()*16}function w(t=ss()){try{if(t!=null&&t.randomUUID)return xt(()=>t.randomUUID()).replace(/-/g,"")}catch{}return Ut||(Ut="10000000100040008000"+1e11),Ut.replace(/[018]/g,e=>(e^(os()&15)>>e/4).toString(16))}function jn(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}function W(t){const{message:e,event_id:n}=t;if(e)return e;const r=jn(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function Xt(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],o=s[0]=s[0]||{};o.value||(o.value=e||""),o.type||(o.type="Error")}function J(t,e){const n=jn(t);n&&Bn(n,e)}function is(t,e){var s;const n=(s=t.exception)==null?void 0:s.values,r=(n==null?void 0:n.find(o=>{var i;return((i=o.mechanism)==null?void 0:i.exception_id)===0}))??(n==null?void 0:n[0]);r&&Bn(r,e)}function Bn(t,e){const n={type:"generic",handled:!0},r=t.mechanism;t.mechanism={...n,...r,...e},e&&"data"in e&&(t.mechanism.data={...r==null?void 0:r.data,...e.data})}function Ae(t){if(as(t))return!0;try{B(t,"__sentry_captured__",!0)}catch{}return!1}function as(t){try{return t.__sentry_captured__}catch{}}const Un=1e3;function _t(){return it()/Un}function cs(){const{performance:t}=m;if(!(t!=null&&t.now)||!t.timeOrigin)return _t;const e=t.timeOrigin;return()=>(e+xt(()=>t.now()))/Un}let xe;function D(){return(xe??(xe=cs()))()}function us(t){const e=D(),n={sid:w(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>ls(n)};return t&&Q(n,t),n}function Q(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||D(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:w()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function fs(t,e){let n={};t.status==="ok"&&(n={status:"exited"}),Q(t,n)}function ls(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function mt(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;const r={...t};for(const s in e)Object.prototype.hasOwnProperty.call(e,s)&&(r[s]=mt(r[s],e[s],n-1));return r}function ds(){return w()}function Hn(){return w().substring(16)}const ps=100;class N{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},B(this,"refs",{}),this._propagationContext={traceId:ds(),sampleRand:me()}}clone(){const e=new N;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._attributes={...this._attributes},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,e._conversationId=this._conversationId,e.refs={...this.refs},e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Q(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(e){return this._conversationId=e||void 0,this._notifyScopeListeners(),this}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this.setTags({[e]:n})}setAttributes(e){return this._attributes={...this._attributes,...e},this._notifyScopeListeners(),this}setAttribute(e,n){return this.setAttributes({[e]:n})}removeAttribute(e){return e in this._attributes&&(delete this._attributes[e],this._notifyScopeListeners()),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;const n=typeof e=="function"?e(this):e,r=n instanceof N?n.getScopeData():Rt(n)?e:void 0,{tags:s,attributes:o,extra:i,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l,conversationId:d}=r||{};return this._tags={...this._tags,...s},this._attributes={...this._attributes,...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),d&&(this._conversationId=d),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:ps;if(r<=0)return this;const s={timestamp:_t(),...e,message:e.message?Vt(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r)),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,attributes:this._attributes,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,conversationId:this._conversationId}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=mt(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=(n==null?void 0:n.event_id)||w();if(!this._client)return h&&g.warn("No client configured on scope - will not capture exception!"),r;const s=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:s,...n,event_id:r},this),r}captureMessage(e,n,r){const s=(r==null?void 0:r.event_id)||w();if(!this._client)return h&&g.warn("No client configured on scope - will not capture message!"),s;const o=(r==null?void 0:r.syntheticException)??new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:o,...r,event_id:s},this),s}captureEvent(e,n){const r=e.event_id||(n==null?void 0:n.event_id)||w();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(h&&g.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}}function gs(){return nt("defaultCurrentScope",()=>new N)}function hs(){return nt("defaultIsolationScope",()=>new N)}const De="__SENTRY_SUPPRESS_TRACING__",Le=t=>t instanceof Promise&&!t[Wn],Wn=Symbol("chained PromiseLike"),_s=(t,e,n)=>{const r=t.then(s=>(e(s),s),s=>{throw n(s),s});return Le(r)&&Le(t)?r:ms(t,r)},ms=(t,e)=>{if(!e)return t;let n=!1;for(const r in t){if(r in e)continue;n=!0;const s=t[r];typeof s=="function"?Object.defineProperty(e,r,{value:(...o)=>s.apply(t,o),enumerable:!0,configurable:!0,writable:!0}):e[r]=s}return n&&Object.assign(e,{[Wn]:!0}),e};class ys{constructor(e,n){let r;e?r=e:r=new N;let s;n?s=n:s=new N,this._stack=[{scope:r}],this._isolationScope=s}withScope(e){const n=this._pushScope();let r;try{r=e(n)}catch(s){throw this._popScope(),s}return ot(r)?_s(r,()=>this._popScope(),()=>this._popScope()):(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}}function Z(){const t=et(),e=gt(t);return e.stack=e.stack||new ys(gs(),hs())}function qn(t){return Z().withScope(t)}function Es(t,e){const n=Z();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function Pe(t){return Z().withScope(()=>t(Z().getIsolationScope()))}function Ss(){return{suppressTracing:bs,withIsolationScope:Pe,withScope:qn,withSetScope:Es,withSetIsolationScope:(t,e)=>Pe(e),getCurrentScope:()=>Z().getScope(),getIsolationScope:()=>Z().getIsolationScope()}}function bs(t){return qn(e=>{e.setSDKProcessingMetadata({[De]:!0});const n=t();return e.setSDKProcessingMetadata({[De]:void 0}),n})}function Dt(t){const e=gt(t);return e.acs?e.acs:Ss()}function vs(t){return typeof t=="object"&&t!=null&&!Array.isArray(t)&&Object.keys(t).includes("value")}function Is(t,e){const{value:n,unit:r}=vs(t)?t:{value:t,unit:void 0},s=Ts(n),o=r&&typeof r=="string"?{unit:r}:{};if(s)return{...s,...o};if(!e||e==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...o}}function Me(t,e=!1){const n={};for(const[r,s]of Object.entries(t??{})){const o=Is(s,e);o&&(n[r]=o)}return n}function Ts(t){if(Array.isArray(t))return{value:t,type:"array"};const e=typeof t=="string"?"string":typeof t=="boolean"?"boolean":typeof t=="number"&&!Number.isNaN(t)?Number.isInteger(t)?"integer":"double":null;if(e)return{value:t,type:e}}function Gn(){var t,e;return(e=(t=gt(et())).externalPropagationContextProvider)==null?void 0:e.call(t)}function O(){const t=et();return Dt(t).getCurrentScope()}function P(){const t=et();return Dt(t).getIsolationScope()}function ks(){return nt("globalScope",()=>new N)}function ws(...t){const e=et(),n=Dt(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function S(){return O().getClient()}function zn(t){const e=Gn();if(e)return{trace_id:e.traceId,span_id:e.spanId};const n=t.getPropagationContext(),{traceId:r,parentSpanId:s,propagationSpanId:o}=n,i={trace_id:r,span_id:o||Hn()};return s&&(i.parent_span_id=s),i}const Rs="gen_ai.conversation.id",Ns="http.request.header",Yn="sentry.exclusive_time",Os="sentry.is_localhost",Cs="sentry.op",Kn="sentry.profile_id",As="sentry.segment.name.source",xs="url.full",Ds="user_agent.original",Ls="sentry.sample_rate",Ps="sentry.previous_trace_sample_rate",Ms="sentry.op",$s="sentry.origin",Fs=["ok","deadline_exceeded","unauthenticated","permission_denied","not_found","resource_exhausted","invalid_argument","unimplemented","unavailable","internal_error","unknown_error","cancelled","already_exists","failed_precondition","aborted","out_of_range","data_loss"],js=0,Bs=1;function Us(t){return t!=="ok"&&Fs.includes(t)}function Vn(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}const Hs="_sentryScope",Ws="_sentryIsolationScope";function Jt(t){const e=t;return{scope:e[Hs],isolationScope:Vn(e[Ws])}}const $e="sentry-";function qs(t){const e=Gs(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,o])=>{if(s.startsWith($e)){const i=s.slice($e.length);r[i]=o}return r},{});if(Object.keys(n).length>0)return n}function Gs(t){if(!(!t||!x(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=Fe(n);return Object.entries(r).forEach(([s,o])=>{e[s]=o}),e},{}):Fe(t)}function Fe(t){return t.split(",").map(e=>{const n=e.indexOf("=");if(n===-1)return[];const r=e.slice(0,n),s=e.slice(n+1);return[r,s].map(o=>{try{return decodeURIComponent(o.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const zs=/^o(\d+)\./,Ys=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Ks(t){return t==="http"||t==="https"}function yt(t,e=!1){const{host:n,path:r,pass:s,port:o,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&s?`:${s}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${i}`}function Vs(t){const e=Ys.exec(t);if(!e){U(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",o="",i="",a=""]=e.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 Xn({host:o,pass:s,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function Xn(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Xs(t){if(!h)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(g.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Ks(r)?e&&isNaN(parseInt(e,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Js(t){const e=t.match(zs);return e==null?void 0:e[1]}function Qs(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=Js(n)),r}function Zs(t){const e=typeof t=="string"?Vs(t):Xn(t);if(!(!e||!Xs(e)))return e}function to(t){if(typeof t=="boolean")return Number(t);const e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}const eo="span";function no(t){return Vn(t.refs[eo])}const Jn=1;function ro(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:Lt(t).parent_span_id,o=Jt(t).scope,i=r?(o==null?void 0:o.getPropagationContext().propagationSpanId)||Hn():e;return{parent_span_id:s,span_id:i,trace_id:n}}function so(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:o})=>({span_id:e,trace_id:n,sampled:r===Jn,attributes:o,...s}))}function je(t){return typeof t=="number"?Be(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Be(t.getTime()):D()}function Be(t){return t>9999999999?t/1e3:t}function Lt(t){if(co(t))return t.getStaticSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if(ao(t)){const{attributes:r,startTime:s,name:o,endTime:i,status:a,links:c}=t;return{span_id:e,trace_id:n,data:r,description:o,parent_span_id:oo(t),start_timestamp:je(s),timestamp:je(i)||void 0,status:fo(a),op:r[Ms],origin:r[$s],links:so(c)}}return{span_id:e,trace_id:n,start_timestamp:0,status:"ok",data:{}}}function oo(t){var e;return"parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?(e=t.parentSpanContext)==null?void 0:e.spanId:void 0}function io(t){var e;return{...t,end_timestamp:t.end_timestamp??t.start_timestamp,attributes:Me(t.attributes),links:(e=t.links)==null?void 0:e.map(n=>({...n,attributes:Me(n.attributes)}))}}function ao(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function co(t){return typeof t.getSpanJSON=="function"}function uo(t){const{traceFlags:e}=t.spanContext();return e===Jn}function fo(t){return!t||t.code===js||t.code===Bs?"ok":t.message&&Us(t.message)?t.message:"internal_error"}const lo="_sentryRootSpan",Qn=po;function po(t){return t[lo]||t}function go(t){const e=et(),n=Dt(e);return n.getActiveSpan?n.getActiveSpan(t):no(t||O())}function Ue(t){var n;if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=t||((n=S())==null?void 0:n.getOptions());return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}function He(t){g.log(`Ignoring span ${t.op} - ${t.description} because it matches \`ignoreSpans\`.`)}function We(t,e){if(!(e!=null&&e.length))return!1;for(const n of e){if(mo(n)){if(t.description&&lt(t.description,n))return h&&He(t),!0;continue}const r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;const s=n.name?t.description&&lt(t.description,n.name):!0,o=n.op?t.op&&lt(t.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>{var u;return ho((u=t.attributes)==null?void 0:u[a],c)}):!0;if(s&&o&&i)return h&&He(t),!0}return!1}function ho(t,e){return typeof t=="string"&&(typeof e=="string"||e instanceof RegExp)?lt(t,e):Array.isArray(t)&&Array.isArray(e)?t.length===e.length&&t.every((n,r)=>n===e[r]):t===e}function _o(t,e){const n=e.parent_span_id,r=e.span_id;if(n)for(const s of t)s.parent_span_id===r&&(s.parent_span_id=n)}function mo(t){return typeof t=="string"||t instanceof RegExp}const qe=[];function yo(t){const e={};return t.forEach(n=>{const{name:r}=n,s=e[r];s&&!s.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function Eo(t){const e=t.defaultIntegrations||[],n=t.integrations;e.forEach(s=>{s.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){const s=n(e);r=Array.isArray(s)?s:[s]}else r=e;return yo(r)}function So(t,e){const n={};return e.forEach(r=>{r!=null&&r.beforeSetup&&r.beforeSetup(t)}),e.forEach(r=>{r&&Zn(t,r,n)}),n}function Ge(t,e){for(const n of e)n!=null&&n.afterAllSetup&&n.afterAllSetup(t)}function Zn(t,e,n){if(n[e.name]){h&&g.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,!qe.includes(e.name)&&typeof e.setupOnce=="function"&&(e.setupOnce(),qe.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){const r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(s,o)=>r(s,o,t))}if(typeof e.processEvent=="function"){const r=e.processEvent.bind(e),s=Object.assign((o,i)=>r(o,i,t),{id:e.name});t.addEventProcessor(s)}["processSpan","processSegmentSpan"].forEach(r=>{const s=e[r];typeof s=="function"&&t.on(r,o=>s.call(e,o,t))}),h&&g.log(`Integration installed: ${e.name}`)}const ye="production",bo=Symbol.for("sentry.nonRecordingSpan");function vo(t){return!!t&&t[bo]===!0}const Io="_frozenDsc";function tr(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||ye,release:n.release,public_key:r,trace_id:t,org_id:Qs(e)};return e.emit("createDsc",s),s}function er(t,e){if(Gn())return;const n=e.getPropagationContext();return n.dsc||tr(n.traceId,t)}function To(t){var M;const e=S();if(!e)return{};const n=Qn(t),r=Lt(n),s=r.data,o=n.spanContext().traceState,i=(o==null?void 0:o.get("sentry.sample_rate"))??s[Ls]??s[Ps];function a(k){return(typeof i=="number"||typeof i=="string")&&(k.sample_rate=`${i}`),k}const c=n[Io];if(c)return a(c);const u=vo(n),f=u&&n.dropReason==="ignored";if(u&&(!Ue(e.getOptions())||f)){const k=Jt(n).scope,b=k&&er(e,k);if(b){const V={...b};return f&&(V.sampled="false"),a(V)}}const l=o==null?void 0:o.get("sentry.dsc"),d=l&&qs(l);if(d)return a(d);const _=tr(t.spanContext().traceId,e),p=s[As],I=r.description;return p!=="url"&&I&&(_.transaction=I),Ue()&&(_.sampled=String(uo(n)),_.sample_rand=(o==null?void 0:o.get("sentry.sample_rand"))??((M=Jt(n).scope)==null?void 0:M.getPropagationContext().sampleRand.toString())),a(_),e.emit("createDsc",_,n),_}function ko(t,e){const{fingerprint:n,breadcrumbs:r,sdkProcessingMetadata:s}=e;wo(t,e),Co(t,n),Ro(t,r),No(t,s)}function ze(t,e){const{extra:n,tags:r,attributes:s,user:o,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:f,eventProcessors:l,attachments:d,propagationContext:_,transactionName:p}=e;ct(t,"extra",n),ct(t,"tags",r),ct(t,"attributes",s),ct(t,"user",o),ct(t,"contexts",i),t.sdkProcessingMetadata=mt(t.sdkProcessingMetadata,c,2),a&&(t.level=a),p&&(t.transactionName=p),u.length&&(t.breadcrumbs=[...t.breadcrumbs,...u]),f.length&&(t.fingerprint=[...t.fingerprint,...f]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,..._}}function ct(t,e,n){t[e]=mt(t[e],n,1)}function nr(t,e){const n=ks().getScopeData();return t&&ze(n,t.getScopeData()),e&&ze(n,e.getScopeData()),n}function wo(t,e){const{extra:n,tags:r,user:s,contexts:o,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(s).length&&(t.user={...s,...t.user}),Object.keys(o).length&&(t.contexts={...o,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function Ro(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function No(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Oo(t,e){t.contexts={trace:ro(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:To(e),...t.sdkProcessingMetadata};const n=Qn(e),r=Lt(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Co(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}function dt(t,e,n){let r;try{r=e()}catch(s){return Ye(t,s,n)}return ot(r)?r.then(void 0,s=>Ye(t,s,n)):r}function Ye(t,e,n){return h&&g.error(t,e),n(e)}function rr(t){return!!t&&typeof t=="function"&&"_static"in t&&!!t._static}let Ke=!1;function Ve(t,e){const n=dt(h?"The `beforeSendSpan` callback threw an error, sending the span unmodified:":"",()=>e(t),()=>t);return n||(Ke||(U(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Ke=!0),t)}function Ao(t){const e={trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,name:t.description||"",start_timestamp:t.start_timestamp,end_timestamp:t.timestamp,status:!t.status||t.status==="ok"||t.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...t.data},links:t.links};return io(e)}function sr(t,e){const n=t.attributes??(t.attributes={});Object.entries(e).forEach(([r,s])=>{s!=null&&!(r in n)&&(n[r]=s)})}function xo(t){return t.getOptions().traceLifecycle==="stream"}function or(t){return typeof t=="object"&&typeof t.unref=="function"&&t.unref(),t}function at(t,e=[]){return[t,e]}function Xe(t,e){const[n,r]=t;return[n,[...r,e]]}function Qt(t,e){const n=t[1];for(const r of n){const s=r[0].type;if(e(r,s))return!0}return!1}function Do(t,e){return Qt(t,(n,r)=>e.includes(r))}function Zt(t){const e=gt(m);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Lo(t){const[e,n]=t;let r=JSON.stringify(e);function s(o){typeof r=="string"?r=typeof o=="string"?r+o:[Zt(r),o]:r.push(typeof o=="string"?Zt(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(A(a))}s(c)}}return typeof r=="string"?r:Po(r)}function Po(t){const e=t.reduce((s,o)=>s+o.length,0),n=new Uint8Array(e);let r=0;for(const s of t)n.set(s,r),r+=s.length;return n}function Mo(t){const e=typeof t.data=="string"?Zt(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}const ir={sessions:"session",event:"error",client_report:"internal",user_report:"default",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",raw_security:"security",log:"log_item",trace_metric:"metric"};function $o(t){return t in ir}function Je(t){return $o(t)?ir[t]:t}function ar(t){if(!(t!=null&&t.sdk))return;const{name:e,version:n}=t.sdk;return{name:e,version:n}}function Fo(t,e,n,r){var o;const s=(o=t.sdkProcessingMetadata)==null?void 0:o.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date(it()).toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:yt(r)},...s&&{trace:s}}}function te(t){return t==="replay_event"?"replay":t||"error"}function jo(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function Bo(){/*! __SENTRY_SDK_SOURCE__ */return"npm"}function Uo(){return!jo()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Pt(){return typeof window<"u"&&(!Uo()||Ho())}function Ho(){const t=m.process;return(t==null?void 0:t.type)==="renderer"}function Wo(t,e){const n=e.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:t.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,ingest_settings:Pt()?{infer_ip:n,infer_user_agent:n}:void 0,items:t}]}const qo=new WeakMap;function Go(t){return st(t)?void 0:t}function zo(t,e,n){var a;const r=Go(e.originalException),s=r&&qo.get(r);if(!s)return;const o=(a=t.contexts)==null?void 0:a.trace;((o==null?void 0:o.trace_id)??(n&&zn(n).trace_id))===s.trace_id&&(t.contexts={...t.contexts,trace:{...o,...s}})}function Yo(t,e){var r,s,o,i;if(!e)return t;const n=t.sdk||{};return t.sdk={...n,name:n.name||e.name,version:n.version||e.version,integrations:[...((r=t.sdk)==null?void 0:r.integrations)||[],...e.integrations||[]],packages:[...((s=t.sdk)==null?void 0:s.packages)||[],...e.packages||[]],settings:(o=t.sdk)!=null&&o.settings||e.settings?{...(i=t.sdk)==null?void 0:i.settings,...e.settings}:void 0},t}function Ko(t,e,n,r){const s=ar(n),o={sent_at:new Date(it()).toISOString(),...s&&{sdk:s},...!!r&&e&&{dsn:yt(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return at(o,[i])}function Vo(t,e,n,r){const s=ar(n),o=t.type&&t.type!=="replay_event"?t.type:"event";Yo(t,n==null?void 0:n.sdk);const i=Fo(t,s,r,e);return delete t.sdkProcessingMetadata,at(i,[[{type:o},t]])}const Ht=0,Qe=1,Ze=2;function Et(t){return new pt(e=>{e(t)})}function cr(t){return new pt((e,n)=>{n(t)})}class pt{constructor(e){this._state=Ht,this._handlers=[],this._runExecutor(e)}then(e,n){return new pt((r,s)=>{this._handlers.push([!1,o=>{if(!e)r(o);else try{r(e(o))}catch(i){s(i)}},o=>{if(!n)s(o);else try{r(n(o))}catch(i){s(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new pt((n,r)=>{let s,o;return this.then(i=>{o=!1,s=i,e&&e()},i=>{o=!0,s=i,e&&e()}).then(()=>{if(o){r(s);return}n(s)})})}_executeHandlers(){if(this._state===Ht)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===Qe&&n[1](this._value),this._state===Ze&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(o,i)=>{if(this._state===Ht){if(ot(i)){i.then(r,s);return}this._state=o,this._value=i,this._executeHandlers()}},r=o=>{n(Qe,o)},s=o=>{n(Ze,o)};try{e(r,s)}catch(o){s(o)}}}function Xo(t,e,n,r=0,s){try{const o=ee(e,n,t,r,s);return ot(o)?o:Et(o)}catch(o){return cr(o)}}function ee(t,e,n,r,s){const o=n[r];if(!t||!o)return t;const i=`Event processor "${o.id||"?"}"`;let a=!1;const c=dt(h?`${i} threw an error, dropping event:`:"",()=>o({...t},e),()=>(a=!0,null));return h&&c===null&&g.log(`${i} dropped event`),ot(c)?c.then(u=>u?ee(u,e,n,r+1,s):(s==null||s(a?"callback_error":"event_processor"),null)):c?ee(c,e,n,r+1,s):(s==null||s(a?"callback_error":"event_processor"),null)}let C,tn,en,$;function Jo(t){const e=m._sentryDebugIds,n=m._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if($&&r.length===tn&&s.length===en)return $;tn=r.length,en=s.length,$={},C||(C={});const o=(i,a)=>{for(const c of i){const u=a[c],f=C==null?void 0:C[c];if(f&&$&&u)$[f[0]]=u,C&&(C[c]=[f[0],u]);else if(u){const l=t(c);for(let d=l.length-1;d>=0;d--){const _=l[d],p=_==null?void 0:_.filename;if(p&&$&&C){$[p]=u,C[c]=[p,u];break}}}}};return e&&o(r,e),n&&o(s,n),$}function Qo(t,e,n,r,s,o){const{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||w(),timestamp:e.timestamp||_t()},u=n.integrations||t.integrations.map(b=>b.name);Zo(c,t),ni(c,u),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&ti(c,t.stackParser);const f=si(r,n.captureContext);n.mechanism&&is(c,n.mechanism);const l=s?s.getEventProcessors():[],d=nr(o,f),_=[...n.attachments||[],...d.attachments];_.length&&(n.attachments=_),ko(c,d);const p=go(f);p&&Oo(c,p),zo(c,n,f);const I=[...l,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?Et(c):Xo(I,c,n,0,b=>{s&&(s.recordDroppedEvent(b,te(e.type)),e.type==="transaction"&&s.recordDroppedEvent(b,"span",1+(e.spans||[]).length))})).then(b=>b?(ei(b),typeof i=="number"&&i>0?ri(b,i,a):b):null)}function Zo(t,e){var a,c;const{environment:n,release:r,dist:s,maxValueLength:o}=e;t.environment=t.environment||n||ye,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const i=t.request;i!=null&&i.url&&o&&(i.url=Vt(i.url,o)),o&&((c=(a=t.exception)==null?void 0:a.values)==null||c.forEach(u=>{u.value&&(u.value=Vt(u.value,o))}))}function ti(t,e){var r,s;const n=Jo(e);(s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var i,a;(a=(i=o.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.filename&&(c.debug_id=n[c.filename])})})}function ei(t){var r,s;const e={};if((s=(r=t.exception)==null?void 0:r.values)==null||s.forEach(o=>{var i,a;(a=(i=o.stacktrace)==null?void 0:i.frames)==null||a.forEach(c=>{c.debug_id&&(c.abs_path?e[c.abs_path]=c.debug_id:c.filename&&(e[c.filename]=c.debug_id),delete c.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];const n=t.debug_meta.images;Object.entries(e).forEach(([o,i])=>{n.push({type:"sourcemap",code_file:o,debug_id:i})})}function ni(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function ri(t,e,n){var s,o;if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(i=>({...i,...i.data&&{data:A(i.data,e,n)}}))},...t.user&&{user:A(t.user,e,n)},...t.contexts&&{contexts:A(t.contexts,e,n)},...t.extra&&{extra:A(t.extra,e,n)}};return(s=t.contexts)!=null&&s.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=A(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(i=>({...i,...i.data&&{data:A(i.data,e,n)}}))),(o=t.contexts)!=null&&o.flags&&r.contexts&&(r.contexts.flags=A(t.contexts.flags,3,n)),r}function si(t,e){if(!e)return t;const n=t?t.clone():new N;return n.update(e),n}function oi(t){if(t)return ii(t)?{captureContext:t}:ci(t)?{captureContext:t}:t}function ii(t){return t instanceof N||typeof t=="function"}const ai=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ci(t){return Object.keys(t).some(e=>ai.includes(e))}function ui(t,e){return O().captureException(t,oi(e))}function ur(t,e){return O().captureEvent(t,e)}function Ru(t,e){P().setTag(t,e)}function Nu(t){P().setUser(t)}function nn(t){const e=P(),{user:n}=nr(e,O()),{userAgent:r}=m.navigator||{},s=us({user:n,...r&&{userAgent:r},...t}),o=e.getSession();return(o==null?void 0:o.status)==="ok"&&Q(o,{status:"exited"}),fr(),e.setSession(s),s}function fr(){const t=P(),n=O().getSession()||t.getSession();n&&fs(n),lr(),t.setSession()}function lr(){const t=P(),e=S(),n=t.getSession();n&&e&&e.captureSession(n)}function Wt(t=!1){if(t){fr();return}lr()}const fi="7";function li(t){const e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function di(t){return`${li(t)}${t.projectId}/envelope/`}function pi(t,e){const n={sentry_version:fi};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function gi(t,e,n){return e||`${di(t)}?${pi(t,n)}`}function hi(t,e){const n=e?"auto":"never";return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...Pt()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function _i(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=yt(r)),at(o,[hi(t,s)])}function mi(t,e){const n=e??yi(t)??[];if(n.length===0)return;const r=t.getOptions(),s=_i(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);dr().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(s)}function yi(t){return dr().get(t)}function dr(){return nt("clientToLogBufferMap",()=>new WeakMap)}function Ei(t,e){const n=e?"auto":"never";return[{type:"trace_metric",item_count:t.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...Pt()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:t}]}function Si(t,e,n,r,s){const o={};return e!=null&&e.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=yt(r)),at(o,[Ei(t,s)])}function bi(t,e){const n=e??vi(t)??[];if(n.length===0)return;const r=t.getOptions(),s=Si(n,r._metadata,r.tunnel,t.getDsn(),t.getDataCollectionOptions().userInfo);pr().set(t,[]),t.emit("flushMetrics"),t.sendEnvelope(s)}function vi(t){return pr().get(t)}function pr(){return nt("clientToMetricBufferMap",()=>new WeakMap)}function Ii(t,e){var s,o,i;if(t.type!=="transaction"||!((s=t.spans)!=null&&s.length)||!((o=t.sdkProcessingMetadata)!=null&&o.hasGenAiSpans)||xo(e))return;const n=[],r=[];for(const a of t.spans)(i=a.op)!=null&&i.startsWith("gen_ai.")?n.push(Ao(a)):r.push(a);if(n.length!==0)return t.spans=r,Wo(n,e)}const Ee=Symbol.for("SentryBufferFullError");function Se(t=100){const e=new Set;function n(){return e.size<t}function r(i){e.delete(i)}function s(i){if(!n())return cr(Ee);const a=i();return e.add(a),a.then(()=>r(a),()=>r(a)),a}function o(i){if(!e.size)return Et(!0);const a=Promise.allSettled(Array.from(e)).then(()=>!0);if(!i)return a;const c=[a,new Promise(u=>or(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(e)},add:s,drain:o}}const Ti=60*1e3;function ki(t,e=it()){const n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;const r=Date.parse(`${t}`);return isNaN(r)?Ti:r-e}function wi(t,e){return t[e]||t.all||0}function Ri(t,e,n=it()){return wi(t,e)>n}function Ni(t,{statusCode:e,headers:n},r=it()){const s={...t},o=n==null?void 0:n["x-sentry-rate-limits"],i=n==null?void 0: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+ki(i,r):e===429&&(s.all=r+60*1e3);return s}const gr=64;function Oi(t,e,n=Se(t.bufferSize||gr)){let r={};const s=i=>n.drain(i);function o(i){const a=[];if(Qt(i,(l,d)=>{const _=Je(d);Ri(r,_)?t.recordDroppedEvent("ratelimit_backoff",_):a.push(l)}),a.length===0)return Promise.resolve({});const c=at(i[0],a),u=l=>{if(Do(c,["client_report"])){h&&g.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}Qt(c,(d,_)=>{t.recordDroppedEvent(l,Je(_))})},f=()=>e({body:Lo(c)}).then(l=>l.statusCode===413?(h&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(h&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&g.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=Ni(r,l),l),l=>{throw u("network_error"),h&&g.error("Encountered error running transport request:",l),l});return n.add(f).then(l=>l,l=>{if(l===Ee)return h&&g.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:o,flush:s}}function Ci(t,e,n){const r=[{type:"client_report"},{timestamp:_t(),discarded_events:t}];return at(e?{dsn:e}:{},[r])}function hr(t){const e=[];t.message&&e.push(t.message);try{const n=t.exception.values[t.exception.values.length-1];n!=null&&n.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function Ai(t){var c;const{trace_id:e,parent_span_id:n,span_id:r,status:s,origin:o,data:i,op:a}=((c=t.contexts)==null?void 0:c.trace)??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:s??"ok",timestamp:t.timestamp,trace_id:e??"",origin:o,profile_id:i==null?void 0:i[Kn],exclusive_time:i==null?void 0:i[Yn],measurements:t.measurements,is_segment:!0}}function xi(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[Kn]:t.profile_id},...t.exclusive_time&&{[Yn]:t.exclusive_time}}}},measurements:t.measurements}}function Di(t){var e;t.traceLifecycle!=="stream"||!(t.beforeSendTransaction||(e=t.ignoreTransactions)!=null&&e.length)||U(()=>{console.warn("[Sentry] `beforeSendTransaction` and `ignoreTransactions` are ignored with `traceLifecycle: 'stream'` (enabled by default). Use `beforeSendSpan` and `ignoreSpans` instead, or set `traceLifecycle: 'static'`.")})}const v={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,queues:!0,stackFrameVariables:!0,frameContextLines:5};function Li(t){return typeof t=="boolean"||"allow"in t||"deny"in t}function Pi(t){return t===void 0?{...v.httpHeaders}:Li(t)?{request:t,response:t}:{request:t.request??v.httpHeaders.request,response:t.response??v.httpHeaders.response}}function Mi(t){var n,r,s,o;const e=t.dataCollection??{};return{userInfo:e.userInfo??v.userInfo,cookies:e.cookies??v.cookies,httpHeaders:Pi(e.httpHeaders),httpBodies:e.httpBodies??v.httpBodies,urlQueryParams:e.urlQueryParams??v.urlQueryParams,graphQL:{document:((n=e.graphQL)==null?void 0:n.document)??v.graphQL.document,variables:((r=e.graphQL)==null?void 0:r.variables)??v.graphQL.variables},genAI:{inputs:((s=e.genAI)==null?void 0:s.inputs)??v.genAI.inputs,outputs:((o=e.genAI)==null?void 0:o.outputs)??v.genAI.outputs},databaseQueryData:e.databaseQueryData??v.databaseQueryData,queues:e.queues??v.queues,stackFrameVariables:e.stackFrameVariables??v.stackFrameVariables,frameContextLines:e.frameContextLines??v.frameContextLines}}const rn="Not capturing exception because it's already been captured.",sn="Discarded session because of missing or non-string release",_r=Symbol.for("SentryInternalError"),mr=Symbol.for("SentryDoNotSendEventError"),$i=5e3;function It(t){return{message:t,[_r]:!0}}function qt(t){return{message:t,[mr]:!0}}function on(t){return Ct(t)&&_r in t}function an(t){return Ct(t)&&mr in t}function cn(t,e,n,r,s){let o=0,i,a=!1;t.on(n,()=>{o=0,clearTimeout(i),a=!1}),t.on(e,c=>{if(o+=r(c),o>=8e5)s(t);else if(!a){const u=t.getOptions()._flushInterval??$i;u>0&&(a=!0,i=or(setTimeout(()=>{s(t)},u)))}}),t.on("flush",()=>{s(t)})}class Fi{constructor(e){var s;this._options={attachStacktrace:!0,...e,traceLifecycle:e.traceLifecycle==="static"?"static":"stream"},this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Se(((s=e.transportOptions)==null?void 0:s.bufferSize)??gr),this._dataCollection=Mi(e),this._unhandledSessionStatus="crashed",e.dsn?this._dsn=Zs(e.dsn):h&&g.warn("No DSN provided, client will not send events.");const{beforeSendSpan:n,traceLifecycle:r}=this._options;if(h&&n&&rr(n)!==(r==="static")&&U(()=>{console.warn(`Ignoring \`beforeSendSpan\`: ${r==="static"?"wrap it with":"remove"} \`Sentry.withStaticSpan\` to use it with \`traceLifecycle: "${r}"\`.`)}),this._dsn){const o=gi(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:o})}cn(this,"afterCaptureLog","flushLogs",Hi,mi),cn(this,"afterCaptureMetric","flushMetrics",Ui,bi)}captureException(e,n,r){const s=w();if(Ae(e))return h&&g.log(rn),s;const o={event_id:s,...n};return this._process(()=>this.eventFromException(e,o).then(i=>this._captureEvent(i,o,r)).then(i=>i),"error"),o.event_id}captureMessage(e,n,r,s){const o={event_id:w(),...r},i=ge(e)?e:String(e),a=st(e),c=a?this.eventFromMessage(i,n,o):this.eventFromException(e,o);return this._process(()=>c.then(u=>this._captureEvent(u,o,s)),a?"unknown":"error"),o.event_id}captureEvent(e,n,r){const s=w();if(n!=null&&n.originalException&&Ae(n.originalException))return h&&g.log(rn),s;const o={event_id:s,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=te(e.type);return this._process(()=>this._captureEvent(e,o,a||r,c),u),o.event_id}captureSession(e){this.sendSession(e),Q(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(e){const n=this._transport;if(this.emit("flush"),!n)return!0;const r=await this._isClientDoneProcessing(e),s=await n.flush(e);return r&&s}async close(e){const n=await this.flush(e);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&(this._setupIntegrations(),Di(this._options))}getIntegrationByName(e){return this._integrations[e]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(e){const n=this._integrations[e.name];!n&&e.beforeSetup&&e.beforeSetup(this),Zn(this,e,this._integrations),n||Ge(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);const r=Ii(e,this);let s=Vo(e,this._dsn,this._options._metadata,this._options.tunnel);for(const o of n.attachments||[])s=Xe(s,Mo(o));r&&(s=Xe(s,r)),this.sendEnvelope(s).then(o=>this.emit("afterSendEvent",e,o))}sendSession(e){const{release:n,environment:r=ye}=this._options;if("aggregates"in e){const o=e.attrs||{};if(!o.release&&!n){h&&g.warn(sn);return}o.release=o.release||n,o.environment=o.environment||r,e.attrs=o}else{if(!e.release&&!n){h&&g.warn(sn);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);const s=Ko(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(s)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){const s=`${e}:${n}`;h&&g.log(`Recording outcome: "${s}"${r>1?` (${r} times)`:""}`),this._outcomes[s]=(this._outcomes[s]||0)+r}}on(e,n){const r=this._hooks[e]=this._hooks[e]||new Set,s=(...o)=>n(...o);return r.add(s),()=>{r.delete(s)}}emit(e,...n){const r=this._hooks[e];r&&r.forEach(s=>s(...n))}async sendEnvelope(e){if(this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport)try{const n=await this._transport.send(e);return this.emit("afterEnvelope",e),n}catch(n){return h&&g.error("Error while sending envelope:",n),{}}return h&&g.error("Transport disabled"),{}}registerCleanup(e){}dispose(){}_setupIntegrations(){const{integrations:e}=this._options;this._integrations=So(this,e),Ge(this,e)}_updateSessionFromEvent(e,n){var c,u;let r=n.level==="fatal",s=!1;const o=(c=n.exception)==null?void 0:c.values;if(o){s=!0,r=!1;for(const f of o)if(((u=f.mechanism)==null?void 0:u.handled)===!1){r=!0;break}}const i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Q(e,{...r&&{status:this._unhandledSessionStatus},errors:e.errors||Number(s||r)}),this.captureSession(e))}async _isClientDoneProcessing(e){let n=0;for(;!e||n<e;){if(await new Promise(r=>setTimeout(r,1)),!this._numProcessing)return!0;n++}return!1}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,s){const o=this.getOptions(),i=this.getIntegrationNames();return!n.integrations&&i.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||s.setLastEventId(e.event_id||n.event_id),Qo(o,e,n,r,this,s).then(a=>{var u;if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...(u=a.contexts)==null?void 0:u.trace,...zn(r)},...a.contexts};const c=er(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=O(),s=P()){return h&&ne(e)&&g.log(`Captured error event \`${hr(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,s).then(o=>o.event_id,o=>{h&&(an(o)?g.log(o.message):on(o)?g.warn(o.message):g.warn(o))})}_processEvent(e,n,r,s){const o=this.getOptions(),{sampleRate:i}=o,a=yr(e),c=ne(e),f=`before send for type \`${e.type||"error"}\``;let l="before_send";const d=typeof i>"u"?void 0:to(i),_=te(e.type);return this._prepareEvent(e,n,r,s).then(p=>{var k;if(p===null)throw qt("An event processor returned `null`, will not send event.");if(((k=n.data)==null?void 0:k.__sentry__)===!0)return p;const M=Bi(this,o,p,n,()=>{l="callback_error"});return ji(M,f)}).then(p=>{var k;if(p===null){if(this.recordDroppedEvent(l,_),a){const V=e.spans||[];this.recordDroppedEvent(l,"span",1+V.length)}throw qt(`${f} ${l==="callback_error"?"threw an error":"returned `null`"}, will not send event.`)}const I=r.getSession()||s.getSession();if(c&&I&&this._updateSessionFromEvent(I,p),c&&typeof d=="number"&&me()>d)throw this.recordDroppedEvent("sample_rate","error"),qt(`Discarding event because it's not included in the random sample (sampling rate = ${i})`);if(a){const b=((k=p.sdkProcessingMetadata)==null?void 0:k.spanCountBeforeProcessing)||0,V=p.spans?p.spans.length:0,Te=b-V;Te>0&&this.recordDroppedEvent("before_send","span",Te)}const M=p.transaction_info;if(a&&M&&p.transaction!==e.transaction){const b="custom";p.transaction_info={...M,source:b}}return this.sendEvent(p,n),p}).then(null,p=>{throw an(p)||on(p)?p:(this.captureException(p,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:p}),It(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
Reason: ${p}`))})}_process(e,n){this._numProcessing++,this._promiseBuffer.add(e).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Ee&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){const e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{const[s,o]=n.split(":");return{reason:s,category:o,quantity:r}})}_flushOutcomes(){h&&g.log("Flushing outcomes...");const e=this._clearOutcomes();if(e.length===0){h&&g.log("No outcomes to send");return}if(!this._dsn){h&&g.log("No dsn provided, will not send outcomes");return}h&&g.log("Sending outcomes:",e);const n=Ci(e,this._options.tunnel&&yt(this._dsn));this.sendEnvelope(n)}}function ji(t,e){const n=`${e} must return \`null\` or a valid event.`;if(ot(t))return t.then(r=>{if(!Rt(r)&&r!==null)throw It(n);return r},r=>{throw It(`${e} rejected with ${r}`)});if(!Rt(t)&&t!==null)throw It(n);return t}function Bi(t,e,n,r,s){const{beforeSend:o,ignoreSpans:i,beforeSendTransaction:a}=e,c=rr(e.beforeSendSpan)&&e.beforeSendSpan;let u=n;if(ne(u)&&o){const f=u;return dt(h?"The `beforeSend` callback threw an error, dropping the event:":"",()=>o(f,r),()=>(s(),null))}if(yr(u)){if(c||i){const f=Ai(u);if(i!=null&&i.length&&We({description:f.description,op:f.op,attributes:f.data},i))return null;if(c){const l=Ve(f,c);u=mt(n,xi(l))}if(u.spans){const l=[],d=u.spans;for(const p of d){if(i!=null&&i.length&&We({description:p.description,op:p.op,attributes:p.data},i)){_o(d,p);continue}c?l.push(Ve(p,c)):l.push(p)}const _=u.spans.length-l.length;_&&t.recordDroppedEvent("before_send","span",_),u.spans=l}}if(a){if(u.spans){const f=u.spans.length;u.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:f}}return dt(h?"The `beforeSendTransaction` callback threw an error, dropping the event:":"",()=>a(u,r),()=>(s(),null))}}return u}function ne(t){return t.type===void 0}function yr(t){return t.type==="transaction"}function Ui(t){let e=0;return t.name&&(e+=t.name.length*2),e+=8,e+Er(t.attributes)}function Hi(t){let e=0;return t.message&&(e+=t.message.length*2),e+Er(t.attributes)}function Er(t){if(!t)return 0;let e=0;return Object.values(t).forEach(n=>{Array.isArray(n)?e+=n.length*un(n[0]):st(n)?e+=un(n):e+=100}),e}function un(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}function Wi(t,e){e.debug===!0&&(h?g.enable():U(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),O().update(e.initialScope);const r=new t(e);return qi(r),r.init(),r}function qi(t){O().setClient(t)}const Sr="[Filtered]",Gi=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"];function zi(t,e){return e.some(n=>t.includes(n))}function br(t,e,n){if(e===!1)return!0;const r=t.toLowerCase();if(zi(r,Gi))return!0;if(e===!0)return!1;const i=("deny"in e?e.deny:e.allow).some(a=>r.includes(a.toLowerCase()));return"deny"in e?i:!i}function fn(t,e,n){if(e===!1)return{};const r={};for(const s of Object.keys(t))r[s]=br(s,e)?Sr:t[s];return r}function Yi(t,e){if(!(!t||e===!1))return t.split("&").map(n=>{const r=n.indexOf("="),s=r===-1?n:n.slice(0,r),o=new URLSearchParams(`${s}=`).keys().next().value;return o!==void 0&&br(o,e)?`${s}=${Sr}`:n}).join("&")}function Ki(t,e){const n=t.indexOf("#"),r=n===-1?t.length:n,s=t.indexOf("?");if(s===-1||s>r)return t;const o=t.slice(0,s),i=t.slice(s+1,r),a=t.slice(r),c=Yi(i,e);return c?`${o}?${c}${a}`:`${o}${a}`}function Vi(t){var e;return((e=t??S())==null?void 0:e.getDataCollectionOptions().urlQueryParams)??!0}function Xi(t,e){return t===void 0?void 0:Ki(t,Vi(e))}function Gt(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],search:n,hash:r,relative:e[5]+n+r}}function Ji(t,e=!0){if(t.startsWith("data:")){const n=t.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",s=t.includes(";base64,"),o=t.indexOf(",");let i="";if(e&&o!==-1){const a=t.slice(o+1);i=a.length>10?`${a.slice(0,10)}... [truncated]`:a}return`data:${r}${s?",base64":""}${i?`,${i}`:""}`}return t}function Qi(t){var e;"aggregates"in t?((e=t.attrs)==null?void 0:e.ip_address)===void 0&&(t.attrs={...t.attrs,ip_address:"{{auto}}"}):t.ipAddress===void 0&&(t.ipAddress="{{auto}}")}function Zi(t,e,n=[e],r="npm"){const s=(t._metadata=t._metadata||{}).sdk=t._metadata.sdk||{};s.name||(s.name=`sentry.javascript.${e}`,s.packages=n.map(o=>({name:`${r}:@sentry/${o}`,version:q})),s.version=q)}const ta=100;function z(t,e){const n=S(),r=P();if(!n)return;const{beforeBreadcrumb:s=null,maxBreadcrumbs:o=ta}=n.getOptions();if(o<=0)return;const a={timestamp:_t(),...t},c=s?dt(h?"The `beforeBreadcrumb` callback threw an error, dropping the breadcrumb:":"",()=>U(()=>s(a,e)),()=>null):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,o))}const ea="FunctionToString",ln=new WeakMap,na=(()=>({name:ea,setupOnce(){const t=Function.prototype.toString;try{Function.prototype.toString=function(...e){const n=_e(this);let r;try{ln.has(S())&&n!==void 0&&(r=n)}catch{}return t.apply(r??this,e)}}catch{}},setup(t){ln.set(t,!0)}})),ra=na,sa=[/^Script error\.?$/,/^Javascript error: Script error\.? on line 0$/,/^ResizeObserver loop completed with undelivered notifications.$/,/^Cannot redefine property: googletag$/,/^Can't find variable: gmo$/,/^undefined is not an object \(evaluating 'a\.[A-Z]'\)$/,/can't redefine non-configurable property "solana"/,/vv\(\)\.getRestrictions is not a function/,/Can't find variable: _AutofillCallbackHandler/,/Object Not Found Matching Id:\d+, MethodName:simulateEvent/,/Java exception was raised during method invocation$/,/Java object is gone$/],oa="EventFilters",ia=(t={})=>{let e;return{name:oa,setup(n){const r=n.getOptions();e=dn(t,r)},processEvent(n,r,s){if(!e){const o=s.getOptions();e=dn(t,o)}return aa(n,e)?null:n}}};function dn(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:sa],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function aa(t,e){if(t.type){if(t.type==="transaction"&&ua(t,e.ignoreTransactions))return h&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
Event: ${W(t)}`),!0}else{if(ca(t,e.ignoreErrors))return h&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
Event: ${W(t)}`),!0;if(pa(t))return h&&g.warn(`Event dropped due to not having an error message, error type or stacktrace.
Event: ${W(t)}`),!0;if(fa(t,e.denyUrls))return h&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
Event: ${W(t)}.
Url: ${Nt(t)}`),!0;if(!la(t,e.allowUrls))return h&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
Event: ${W(t)}.
Url: ${Nt(t)}`),!0}return!1}function ca(t,e){return e!=null&&e.length?hr(t).some(n=>ht(n,e)):!1}function ua(t,e){if(!(e!=null&&e.length))return!1;const n=t.transaction;return n?ht(n,e):!1}function fa(t,e){if(!(e!=null&&e.length))return!1;const n=Nt(t);return n?ht(n,e):!1}function la(t,e){if(!(e!=null&&e.length))return!0;const n=Nt(t);return n?ht(n,e):!0}function da(t=[]){for(let e=t.length-1;e>=0;e--){const n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Nt(t){var e,n;try{const r=[...((e=t.exception)==null?void 0:e.values)??[]].reverse().find(o=>{var i,a,c;return((i=o.mechanism)==null?void 0:i.parent_id)===void 0&&((c=(a=o.stacktrace)==null?void 0:a.frames)==null?void 0:c.length)}),s=(n=r==null?void 0:r.stacktrace)==null?void 0:n.frames;return s?da(s):null}catch{return h&&g.error(`Cannot extract url for event ${W(t)}`),null}}function pa(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)!=null&&n.length?!t.message&&!t.exception.values.some(r=>r.stacktrace||r.type&&r.type!=="Error"||r.value):!1}function ga(t,e,n,r,s,o){var a;if(!((a=s.exception)!=null&&a.values)||!o||!L(o.originalException))return;const i=s.exception.values.length>0?s.exception.values[s.exception.values.length-1]:void 0;i&&(s.exception.values=re(t,e,r,o.originalException,n,s.exception.values,i,0))}function re(t,e,n,r,s,o,i,a){if(o.length>=n+1)return o;let c=[...o];if(L(r[s])){pn(i,a,r);const u=t(e,r[s]),f=c.length;gn(u,s,f,a),c=re(t,e,n,r[s],s,[u,...c],u,f)}return vr(r)&&r.errors.forEach((u,f)=>{if(L(u)){pn(i,a,r);const l=t(e,u),d=c.length;gn(l,`errors[${f}]`,d,a),c=re(t,e,n,u,s,[l,...c],l,d)}}),c}function vr(t){return Array.isArray(t.errors)}function pn(t,e,n){t.mechanism={handled:!0,type:"auto.core.linked_errors",...vr(n)&&{is_exception_group:!0},...t.mechanism,exception_id:e}}function gn(t,e,n,r){t.mechanism={handled:!0,...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}function ha(t){return L(t)&&"__sentry_fetch_url_host__"in t&&typeof t.__sentry_fetch_url_host__=="string"}function hn(t){return ha(t)?`${t.message} (${t.__sentry_fetch_url_host__})`:t.message}const Ot=new Set([]);function _a(t){const e="console",n=Y(e,t);return K(e,ya),n}function ma(t){for(const e of t)Ot.add(e);return()=>{for(const e of t)Ot.delete(e)}}const _n=new Set;function ya(){"console"in m&&Nn.forEach(function(t){_n.has(t)||!(t in m.console)||(_n.add(t),T(m.console,t,function(e){return wt[t]=e,function(...n){const r=n[0],s=wt[t],o=Ot.size&&typeof r=="string"&&ht(r,Ot);o||R("console",{args:n,level:t}),(!o||h&&g.isEnabled())&&(s==null||s.apply(m.console,n))}}))})}function Ea(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}const Sa="Dedupe",ba=(()=>{let t;return{name:Sa,processEvent(e){if(e.type)return e;try{if(Ia(e,t))return h&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return t=e}}}),va=ba;function Ia(t,e){return e?!!(Ta(t,e)||ka(t,e)):!1}function Ta(t,e){const n=t.message,r=e.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!Tr(t,e)||!Ir(t,e))}function ka(t,e){const n=mn(e),r=mn(t);return!(!n||!r||n.type!==r.type||n.value!==r.value||!Tr(t,e)||!Ir(t,e))}function Ir(t,e){const n=Re(t),r=Re(e);if(!n||!r)return!n&&!r;if(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 Tr(t,e){const n=t.fingerprint,r=e.fingerprint;if(!n||!r)return!n&&!r;try{return n.join("")===r.join("")}catch{return!1}}function mn(t){var e,n;return(n=(e=t.exception)==null?void 0:e.values)==null?void 0:n[0]}const wa="Console",Ra=(t={})=>{const e=new Set(t.levels||Nn);return{name:wa,setup(n){const r=_a(({args:s,level:o})=>{S()!==n||!e.has(o)||Na(o,s)});if(n.registerCleanup(r),t.filter){const s=ma(t.filter);n.registerCleanup(s)}}}};function Na(t,e){const n={category:"console",data:{arguments:e,logger:"console"},level:Ea(t),message:yn(e)};if(t==="assert")if(e[0]===!1){const r=e.slice(1);n.message=r.length>0?`Assertion failed: ${yn(r)}`:"Assertion failed",n.data.arguments=r}else return;z(n,{input:e,level:t})}function yn(t){return"util"in m&&typeof m.util.format=="function"?m.util.format(...t):rs(t," ")}const Oa="ConversationId",Ca=(()=>({name:Oa,setup(t){t.on("spanStart",e=>{const n=O().getScopeData(),r=P().getScopeData(),s=n.conversationId||r.conversationId;if(s){const{op:o,data:i,description:a}=Lt(e);if(!(o!=null&&o.startsWith("gen_ai."))&&!i["ai.operationId"]&&!(a!=null&&a.startsWith("ai.")))return;e.setAttribute(Rs,s)}})}})),Aa=Ca,se=m;function xa(){if(!("fetch"in se))return!1;try{return new Headers,new Request("data:,"),new Response,!0}catch{return!1}}function oe(t){return t&&/^function\s+\w+\(\)\s+\{\s+\[native code\]\s+\}$/.test(t.toString())}function Da(){var n;if(typeof EdgeRuntime=="string")return!0;if(!xa())return!1;if(oe(se.fetch))return!0;let t=!1;const e=se.document;if(e&&typeof e.createElement=="function")try{const r=e.createElement("iframe");r.hidden=!0,e.head.appendChild(r),(n=r.contentWindow)!=null&&n.fetch&&(t=oe(r.contentWindow.fetch)),e.head.removeChild(r)}catch(r){h&&g.warn("Could not create sandbox iframe for pure fetch check, bailing to window.fetch: ",r)}return t}function La(t){const e="fetch",n=Y(e,t);return K(e,()=>Pa()),n}function Pa(t){Pt()&&!Da()||T(m,"fetch",function(e){return new Proxy(e,{apply(n,r,s){const o=new Error,{method:i,url:a}=Ma(s),c={args:s,fetchData:{method:i,url:a},startTimestamp:D()*1e3,virtualError:o,headers:$a(s)};return R("fetch",{...c}),Reflect.apply(n,m,s).then(async u=>(R("fetch",{...c,endTimestamp:D()*1e3,response:u}),u),u=>{R("fetch",{...c,endTimestamp:D()*1e3,error:u}),L(u)&&u.stack===void 0&&(u.stack=o.stack,B(u,"framesToPop",1));const f=S(),l=(f==null?void 0:f.getOptions().enhanceFetchErrorMessages)??"always";if(l!==!1&&L(u)&&u.name==="TypeError"&&(u.message==="Failed to fetch"||u.message==="Load failed"||u.message==="NetworkError when attempting to fetch resource."))try{const p=new URL(c.fetchData.url).host;l==="always"?u.message=`${u.message} (${p})`:B(u,"__sentry_fetch_url_host__",p)}catch{}throw u})}})})}function Tt(t,e){return Ct(t)&&!!t[e]}function En(t){return typeof t=="string"?t:t?Tt(t,"url")?t.url:t.toString?t.toString():"":""}function Ma(t){if(t.length===0)return{method:"GET",url:""};if(t.length===2){const[n,r]=t;return{url:En(n),method:Tt(r,"method")?String(r.method).toUpperCase():Ln(n)&&Tt(n,"method")?String(n.method).toUpperCase():"GET"}}const e=t[0];return{url:En(e),method:Tt(e,"method")?String(e.method).toUpperCase():"GET"}}function $a(t){const[e,n]=t;try{if(typeof n=="object"&&n!==null&&"headers"in n&&n.headers)return new Headers(n.headers);if(Ln(e))return new Headers(e.headers)}catch{}}function kr(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}const ie=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,E=m,Fa=80,H={};try{typeof Node<"u"&&(H.parentNode=Object.getOwnPropertyDescriptor(Node.prototype,"parentNode").get),typeof Element<"u"&&(H.tagName=Object.getOwnPropertyDescriptor(Element.prototype,"tagName").get,H.id=Object.getOwnPropertyDescriptor(Element.prototype,"id").get,H.className=Object.getOwnPropertyDescriptor(Element.prototype,"className").get,H.getAttribute=Element.prototype.getAttribute),typeof HTMLElement<"u"&&(H.dataset=Object.getOwnPropertyDescriptor(HTMLElement.prototype,"dataset").get)}catch{}function F(t,e,n){const r=H[e];if(r)try{return r.call(t,n)}catch{}const s=t[e];return typeof s=="function"?s.call(t,n):s}function wr(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let o=0,i=0;const a=" > ",c=a.length;let u;const f=Array.isArray(e)?e:e.keyAttrs,l=!Array.isArray(e)&&e.maxStringLength||Fa;for(;n&&o++<r&&(u=ja(n,f),!(u==="html"||o>1&&i+s.length*c+u.length>=l));)s.push(u),i+=u.length,n=F(n,"parentNode");return s.reverse().join(a)}catch{return"<unknown>"}}function ja(t,e){const n=[],r=F(t,"tagName");if(!r)return"";if(typeof HTMLElement<"u"&&t instanceof HTMLElement){const o=F(t,"dataset");if(o){if(o.sentryComponent)return o.sentryComponent;if(o.sentryElement)return o.sentryElement}}n.push(r.toLowerCase());const s=e!=null&&e.length?e.filter(o=>F(t,"getAttribute",o)).map(o=>[o,F(t,"getAttribute",o)]):null;if(s!=null&&s.length)s.forEach(o=>{n.push(`[${o[0]}="${o[1]}"]`)});else{const o=F(t,"id");o&&n.push(`#${o}`);const i=F(t,"className");if(i&&x(i)){const a=i.split(/\s+/);for(const c of a)n.push(`.${c}`)}}for(const o of["aria-label","type","name","title","alt"]){const i=F(t,"getAttribute",o);i&&n.push(`[${o}="${i}"]`)}return n.join("")}function Ba(t,e,n){E.document&&E.addEventListener(t,e,n)}function Ua(t,e,n){E.document&&E.removeEventListener(t,e,n)}const Ha=t=>{var n;const e=E.requestIdleCallback||E.setTimeout;if(((n=E.document)==null?void 0:n.visibilityState)==="hidden")t();else{let r=!1;const s=()=>{r||(t(),r=!0)};Ba("visibilitychange",s,{once:!0,capture:!0}),e(()=>{s(),Ua("visibilitychange",s,{capture:!0})})}};function Wa(t,e=5){if(!m.HTMLElement)return null;let n=t;for(let r=0;r<e;r++){if(!n)return null;if(n instanceof HTMLElement){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}n=n.parentNode}return null}function be(){var t;try{return((t=E.document)==null?void 0:t.location.href)??""}catch{return""}}const Rr=new WeakMap;function qa(t,e=S()){if(!e){ie&&g.warn("Cannot set a route provider without a client.");return}ie&&Ga(e)&&g.warn("A route provider is already registered for this client and will be replaced. Routes only the previous provider knows about will no longer resolve."),Rr.set(e,t)}function Ga(t=S()){return t&&Rr.get(t)}const za=1e3;let Sn,ae,ce;function bn(t){return typeof t=="boolean"?t:!!(t!=null&&t.capture)}function Ya(t){Y("dom",t),K("dom",Ka)}function Ka(){if(!E.document)return;const t=R.bind(null,"dom"),e=vn(t,!0);E.document.addEventListener("click",e,!1),E.document.addEventListener("keypress",e,!1),["EventTarget","Node"].forEach(n=>{var o,i;const s=(o=E[n])==null?void 0:o.prototype;(i=s==null?void 0:s.hasOwnProperty)!=null&&i.call(s,"addEventListener")&&(T(s,"addEventListener",function(a){return function(c,u,f){if((c==="click"||c=="keypress")&&u)try{const l=this.__sentry_instrumentation_handlers__=this.__sentry_instrumentation_handlers__||{},d=l[c]=l[c]||{captureListeners:new WeakSet,bubbleListeners:new WeakSet,listenerCount:0},_=bn(f);if(!d.handler){const I=vn(t);d.handler=I,d.capture=_,a.call(this,c,I,d.capture)}const p=d[_?"captureListeners":"bubbleListeners"];p.has(u)||(typeof f=="object"&&(f!=null&&f.once||f!=null&&f.signal)?d.sticky=!0:(p.add(u),d.listenerCount++))}catch{}return a.call(this,c,u,f)}}),T(s,"removeEventListener",function(a){return function(c,u,f){if((c==="click"||c=="keypress")&&u)try{const l=this.__sentry_instrumentation_handlers__||{},d=l[c];d!=null&&d[bn(f)?"captureListeners":"bubbleListeners"].delete(u)&&(!--d.listenerCount&&!d.sticky&&(a.call(this,c,d.handler,d.capture),d.handler=void 0,delete l[c]),Object.keys(l).length===0&&delete this.__sentry_instrumentation_handlers__)}catch{}return a.call(this,c,u,f)}}))})}function Va(t){if(t.type!==ae)return!1;try{if(!t.target||t.target._sentryId!==ce)return!1}catch{}return!0}function Xa(t,e){return t!=="keypress"?!1:e!=null&&e.tagName?!(e.tagName==="INPUT"||e.tagName==="TEXTAREA"||e.isContentEditable):!0}function vn(t,e=!1){return n=>{if(!n||n._sentryCaptured)return;const r=Ja(n);if(Xa(n.type,r))return;B(n,"_sentryCaptured",!0),r&&!r._sentryId&&B(r,"_sentryId",w());const s=n.type==="keypress"?"input":n.type;Va(n)||(t({event:n,name:s,global:e}),ae=n.type,ce=r?r._sentryId:void 0),clearTimeout(Sn),Sn=E.setTimeout(()=>{ce=void 0,ae=void 0},za)}}function Ja(t){try{return t.target}catch{return null}}let bt;function Qa(){return"history"in E&&!!E.history}function Nr(t){const e="history";Y(e,t),K(e,Za)}function Za(){if(E.addEventListener("popstate",()=>{const e=E.location.href,n=bt;if(bt=e,n===e)return;R("history",{from:n,to:e})}),!Qa())return;function t(e){return function(...n){const r=n.length>2?n[2]:void 0;if(r){const s=bt,o=tc(String(r));if(bt=o,s===o)return e.apply(this,n);R("history",{from:s,to:o})}return e.apply(this,n)}}T(E.history,"pushState",t),T(E.history,"replaceState",t)}function tc(t){try{return new URL(t,E.location.origin).toString()}catch{return t}}const kt={};function ec(t){const e=kt[t];if(e)return e;let n=E[t];if(oe(n))return kt[t]=n.bind(E);const r=E.document;if(r&&typeof r.createElement=="function")try{const s=r.createElement("iframe");s.hidden=!0,r.head.appendChild(s);const o=s.contentWindow;o!=null&&o[t]&&(n=o[t]),r.head.removeChild(s)}catch(s){ie&&g.warn(`Could not create sandbox iframe for ${t} check, bailing to window.${t}: `,s)}return n&&(kt[t]=n.bind(E))}function nc(t){kt[t]=void 0}const ft="__sentry_xhr_v3__";function rc(t){Y("xhr",t),K("xhr",sc)}function sc(){if(!E.XMLHttpRequest)return;const t=XMLHttpRequest.prototype;t.open=new Proxy(t.open,{apply(e,n,r){let s=new Error;const o=D()*1e3,i=x(r[0])?r[0].toUpperCase():void 0,a=oc(r[1]);if(!i||!a)return e.apply(n,r);n[ft]={method:i,url:a,request_headers:{}},i==="POST"&&a.match(/sentry_key/)&&(n.__sentry_own_request__=!0);const c=()=>{const u=n[ft];if(u&&n.readyState===4){try{u.status_code=n.status}catch{}const f={endTimestamp:D()*1e3,startTimestamp:o,xhr:n,virtualError:s};R("xhr",f),s=void 0,n.removeEventListener("readystatechange",c)}};return"onreadystatechange"in n&&typeof n.onreadystatechange=="function"?n.onreadystatechange=new Proxy(n.onreadystatechange,{apply(u,f,l){return c(),u.apply(f,l)}}):n.addEventListener("readystatechange",c),n.setRequestHeader=new Proxy(n.setRequestHeader,{apply(u,f,l){const[d,_]=l,p=f[ft];return p&&x(d)&&x(_)&&(p.request_headers[d.toLowerCase()]=_),u.apply(f,l)}}),e.apply(n,r)}}),t.send=new Proxy(t.send,{apply(e,n,r){const s=n[ft];if(!s)return e.apply(n,r);r[0]!==void 0&&(s.body=r[0]);const o={startTimestamp:D()*1e3,xhr:n};return R("xhr",o),e.apply(n,r)}})}function oc(t){if(x(t))return t;try{return t.toString()}catch{}}function ic(t){if(typeof Element>"u")return!1;try{return t instanceof Element}catch{return!1}}const y=m;let ue=0;const In=[];function Or(t){if(ue>0)return!0;const e=t?In.findIndex(n=>ac(n,t)):-1;return e===-1?!1:(In.splice(e,1),!0)}function ac(t,e){return t.msg===e.msg&&t.url===e.url&&t.line===e.line&&t.column===e.column}function cc(){ue++,setTimeout(()=>{ue--})}function tt(t,e={}){function n(s){return typeof s=="function"}if(!n(t))return t;try{if(Object.prototype.hasOwnProperty.call(t,"__sentry_wrapped__")){const o=t.__sentry_wrapped__;return typeof o=="function"?o:t}if(_e(t))return t}catch{return t}const r=function(...s){m._sentryWrappedDepth=(m._sentryWrappedDepth||0)+1;try{const o=s.map(i=>tt(i,e));return t.apply(this,o)}catch(o){throw cc(),ws(i=>{i.addEventProcessor(a=>(e.mechanism&&(Xt(a,void 0),J(a,e.mechanism)),a.extra={...a.extra,arguments:s},a)),ui(o)}),o}finally{m._sentryWrappedDepth=(m._sentryWrappedDepth||0)-1}};try{for(const s in t)Object.prototype.hasOwnProperty.call(t,s)&&(r[s]=t[s])}catch{}Pn(r,t),B(t,"__sentry_wrapped__",r);try{Object.getOwnPropertyDescriptor(r,"name").configurable&&Object.defineProperty(r,"name",{get(){return t.name}})}catch{}return r}function Tn(){const t=be(),{referrer:e}=y.document||{},{userAgent:n}=y.navigator||{},r={...e&&{Referer:e},...n&&{"User-Agent":n}};return{url:t,headers:r}}function ve(t,e){const n=Mt(t,e),r={type:pc(e),value:gc(e)};return n.length&&(r.stacktrace={frames:n}),r.type===void 0&&r.value===""&&(r.value="Unrecoverable error caught"),r}function uc(t,e,n,r){const s=S(),o=s==null?void 0:s.getOptions().normalizeDepth,i=Ec(e),a={__serialized__:$n(e,o)};if(i)return{exception:{values:[ve(t,i)]},extra:a};const u={exception:{values:[{type:At(e)?e.constructor.name:r?"UnhandledRejection":"Error",value:mc(e,{isUnhandledRejection:r})}]},extra:a};if(n){const f=Mt(t,n);f.length&&(u.exception.values[0].stacktrace={frames:f})}return u}function zt(t,e){return{exception:{values:[ve(t,e)]}}}function Mt(t,e){const n=e.stacktrace||e.stack||"",r=lc(e),s=dc(e);try{return t(n,r,s)}catch{}return[]}const fc=/Minified React error #\d+;/i;function lc(t){return t&&fc.test(t.message)?1:0}function dc(t){return typeof t.framesToPop=="number"?t.framesToPop:0}function Cr(t){return typeof WebAssembly<"u"&&typeof WebAssembly.Exception<"u"?t instanceof WebAssembly.Exception:!1}function pc(t){const e=t==null?void 0:t.name;return!e&&Cr(t)?t.message&&Array.isArray(t.message)&&t.message.length==2?t.message[0]:"WebAssembly.Exception":e}function gc(t){const e=t==null?void 0:t.message;return Cr(t)?Array.isArray(t.message)&&t.message.length==2?t.message[1]:"wasm exception":e?e.error&&typeof e.error.message=="string"?hn(e.error):hn(t):"No error message"}function hc(t,e,n,r){const s=(n==null?void 0:n.syntheticException)||void 0,o=Ie(t,e,s,r);return J(o),o.level="error",n!=null&&n.event_id&&(o.event_id=n.event_id),Et(o)}function _c(t,e,n="info",r,s){const o=(r==null?void 0:r.syntheticException)||void 0,i=fe(t,e,o,s);return i.level=n,r!=null&&r.event_id&&(i.event_id=r.event_id),Et(i)}function Ie(t,e,n,r,s){var a,c;let o;if(Dn(e)&&e.error)return zt(t,e.error);if(Oe(e)||Gr(e)){const u=e;if("stack"in e){o=zt(t,e);const f=(c=(a=o.exception)==null?void 0:a.values)==null?void 0:c[0];if(r&&n&&f&&!f.stacktrace){const l=Mt(t,n);l.length&&(f.stacktrace={frames:l},J(o,{synthetic:!0}))}}else{const f=u.name||(Oe(u)?"DOMError":"DOMException"),l=u.message?`${f}: ${u.message}`:f;o=fe(t,l,n,r),Xt(o,l)}return o}if(L(e))return zt(t,e);if(Rt(e)||At(e))return o=uc(t,e,n,s),J(o,{synthetic:!0}),o;const i=String(e);return o=fe(t,i,n,r),Xt(o,i),J(o,{synthetic:!0}),o}function fe(t,e,n,r){const s={};if(r&&n){const o=Mt(t,n);o.length&&(s.exception={values:[{value:e,stacktrace:{frames:o}}]}),J(s,{synthetic:!0})}if(ge(e)){const{__sentry_template_string__:o,__sentry_template_values__:i}=e;return s.logentry={message:o,params:i},s}return s.message=e,s}function mc(t,{isUnhandledRejection:e}){const n=Yr(t),r=e?"promise rejection":"exception";return Dn(t)?`Event \`ErrorEvent\` captured as ${r} with message \`${t.message}\``:At(t)?`Event \`${yc(t)}\` (type=${t.type}) captured as ${r}`:`Object captured as ${r} with keys: ${n}`}function yc(t){try{const e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Ec(t){return Object.values(t).find(L)}class Sc extends Fi{constructor(e){var i;const n=bc(e),r=y.SENTRY_SDK_SOURCE||Bo();Zi(n,"browser",["browser"],r),super(n),n.routeProvider&&qa(n.routeProvider,this),this._unhandledSessionStatus="unhandled";const{userInfo:s}=this.getDataCollectionOptions();(i=n._metadata)!=null&&i.sdk&&(n._metadata.sdk.settings={infer_ip:s?"auto":"never",...n._metadata.sdk.settings});const{sendClientReports:o}=this._options;y.document&&y.document.addEventListener("visibilitychange",()=>{y.document.visibilityState==="hidden"&&(o&&this._flushOutcomes(),queueMicrotask(()=>{this.flush()}))}),s&&this.on("beforeSendSession",Qi)}eventFromException(e,n){return hc(this._options.stackParser,e,n,this._options.attachStacktrace)}eventFromMessage(e,n="info",r){return _c(this._options.stackParser,e,n,r,this._options.attachStacktrace)}_prepareEvent(e,n,r,s){return e.platform=e.platform||"javascript",super._prepareEvent(e,n,r,s)}}function bc(t){var e;return{release:typeof __SENTRY_RELEASE__=="string"?__SENTRY_RELEASE__:(e=y.SENTRY_RELEASE)==null?void 0:e.id,sendClientReports:!0,parentSpanIsAlwaysRootSpan:!0,...t}}const vc=40;function Ic(t,e=ec("fetch")){let n=0,r=0;async function s(o){const i=o.body.length;n+=i,r++;const a={body:o.body,method:"POST",referrerPolicy:"strict-origin",headers:t.headers,keepalive:n<=6e4&&r<15,...t.fetchOptions};try{const c=await e(t.url,a);return{statusCode:c.status,headers:{"x-sentry-rate-limits":c.headers.get("X-Sentry-Rate-Limits"),"retry-after":c.headers.get("Retry-After")}}}catch(c){throw nc("fetch"),c}finally{n-=i,r--}}return Oi(t,s,Se(t.bufferSize||vc))}const $t=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,Tc=30,kc=50;function le(t,e,n,r){const s={filename:t,function:e==="<anonymous>"?G:e,in_app:!0};return n!==void 0&&(s.lineno=n),r!==void 0&&(s.colno=r),s}const wc=/^\s*at (\S+?)(?::(\d+))(?::(\d+))\s*$/i,Rc=/^\s*at (?:(.+?\)(?: \[.+\])?|.*?) ?\((?:address at )?)?(?:async )?((?:<anonymous>|[-a-z]+:|.*bundle|\/)?.*?)(?::(\d+))?(?::(\d+))?\)?\s*$/i,Nc=/\((\S*)(?::(\d+))(?::(\d+))\)/,Oc=/at (.+?) ?\(data:(.+?),/,Cc=t=>{var s;const e=t.match(Oc);if(e)return{filename:`<data:${e[2]}>`,function:e[1]};const n=wc.exec(t);if(n){const[,o,i,a]=n;return le(o,G,+i,+a)}const r=Rc.exec(t);if(r){if(((s=r[2])==null?void 0:s.indexOf("eval"))===0){const c=Nc.exec(r[2]);c&&(r[2]=c[1],r[3]=c[2],r[4]=c[3])}const[i,a]=Ar(r[1]||G,r[2]);return le(a,i,r[3]?+r[3]:void 0,r[4]?+r[4]:void 0)}},Ac=[Tc,Cc],xc=/^\s*(.*?)(?:\((.*?)\))?(?:^|@)?((?:[-a-z]+)?:\/.*?|\[native code\]|[^@]*(?:bundle|\d+\.js)|\/[\w\-. /=]+)(?::(\d+))?(?::(\d+))?\s*$/i,Dc=/(\S+) line (\d+)(?: > eval line \d+)* > eval/i,Lc=t=>{const e=xc.exec(t);if(e){if(e[3]&&e[3].indexOf(" > eval")>-1){const o=Dc.exec(e[3]);o&&(e[1]=e[1]||"eval",e[3]=o[1],e[4]=o[2],e[5]="")}let r=e[3],s=e[1]||G;return[s,r]=Ar(s,r),le(r,s,e[4]?+e[4]:void 0,e[5]?+e[5]:void 0)}},Pc=[kc,Lc],Mc=[Ac,Pc],$c=An(...Mc),Ar=(t,e)=>{const n=t.indexOf("safari-extension")!==-1,r=t.indexOf("safari-web-extension")!==-1;return n||r?[t.indexOf("@")!==-1?t.split("@")[0]:G,n?`safari-extension:${e}`:`safari-web-extension:${e}`]:[t,e]},vt=1024,Fc="Breadcrumbs",jc=((t={})=>{const e={dom:!0,fetch:!0,history:!0,sentry:!0,xhr:!0,...t};return{name:Fc,setup(n){e.dom&&Ya(Hc(n,e.dom)),e.xhr&&rc(Wc(n)),e.fetch&&La(qc(n)),e.history&&Nr(Gc(n)),e.sentry&&n.on("beforeSendEvent",Uc(n))}}}),Bc=jc;function Uc(t){return function(n){S()===t&&z({category:`sentry.${n.type==="transaction"?"transaction":"event"}`,event_id:n.event_id,level:n.level,message:W(n)},{event:n})}}function Hc(t,e){return function(r){if(S()!==t)return;let s,o,i=typeof e=="object"?e.serializeAttribute:void 0,a=typeof e=="object"&&typeof e.maxStringLength=="number"?e.maxStringLength:void 0;a&&a>vt&&($t&&g.warn(`\`dom.maxStringLength\` cannot exceed ${vt}, but a value of ${a} was configured. Sentry will use ${vt} instead.`),a=vt),typeof i=="string"&&(i=[i]);try{const u=r.event,f=zc(u)?u.target:u;s=wr(f,{keyAttrs:i,maxStringLength:a}),o=Wa(f)}catch{s="<unknown>"}if(s.length===0)return;const c={category:`ui.${r.name}`,message:s};o&&(c.data={"ui.component_name":o}),z(c,{event:r.event,name:r.name,global:r.global})}}function Wc(t){return function(n){if(S()!==t)return;const{startTimestamp:r,endTimestamp:s}=n,o=n.xhr[ft];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},d={category:"xhr",data:f,type:"http",level:kr(c)};t.emit("beforeOutgoingRequestBreadcrumb",d,l),z(d,l)}}function qc(t){return function(n){if(S()!==t)return;const{startTimestamp:r,endTimestamp:s}=n;if(s&&!(n.fetchData.url.match(/sentry_key/)&&n.fetchData.method==="POST"))if(n.error){const o={data:n.error,input:n.args,startTimestamp:r,endTimestamp:s},i={category:"fetch",data:n.fetchData,level:"error",type:"http"};t.emit("beforeOutgoingRequestBreadcrumb",i,o),z(i,o)}else{const o=n.response,i={...n.fetchData,status_code:o==null?void 0:o.status},a={input:n.args,response:o,startTimestamp:r,endTimestamp:s},c={category:"fetch",data:i,type:"http",level:kr(i.status_code)};t.emit("beforeOutgoingRequestBreadcrumb",c,a),z(c,a)}}}function Gc(t){return function(n){if(S()!==t)return;let r=n.from,s=n.to;const o=Gt(y.location.href);let i=r?Gt(r):void 0;const a=Gt(s);i!=null&&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),z({category:"navigation",data:{from:r,to:s}})}}function zc(t){return!!t&&!!t.target}const Yc="EventTarget,Window,Node,ApplicationCache,AudioTrackList,BroadcastChannel,ChannelMergerNode,CryptoOperation,EventSource,FileReader,HTMLUnknownElement,IDBDatabase,IDBRequest,IDBTransaction,KeyOperation,MediaController,MessagePort,ModalWindow,Notification,SVGElementInstance,Screen,SharedWorker,TextTrack,TextTrackCue,TextTrackList,WebSocket,WebSocketWorker,Worker,XMLHttpRequest,XMLHttpRequestEventTarget,XMLHttpRequestUpload".split(","),Kc="BrowserApiErrors",Vc=((t={})=>{const e={XMLHttpRequest:!0,eventTarget:!0,requestAnimationFrame:!0,setInterval:!0,setTimeout:!0,unregisterOriginalCallbacks:!1,...t};return{name:Kc,setupOnce(){e.setTimeout&&T(y,"setTimeout",kn),e.setInterval&&T(y,"setInterval",kn),e.requestAnimationFrame&&T(y,"requestAnimationFrame",Jc),e.XMLHttpRequest&&"XMLHttpRequest"in y&&T(XMLHttpRequest.prototype,"send",Qc);const n=e.eventTarget;n&&(Array.isArray(n)?n:Yc).forEach(s=>Zc(s,e))}}}),Xc=Vc;function kn(t){return function(...e){const n=e[0];return e[0]=tt(n,{mechanism:{handled:!1,type:`auto.browser.browserapierrors.${j(t)}`}}),t.apply(this,e)}}function Jc(t){return function(e){return t.apply(this,[tt(e,{mechanism:{data:{handler:j(t)},handled:!1,type:"auto.browser.browserapierrors.requestAnimationFrame"}})])}}function Qc(t){return function(...e){const n=this;return["onload","onerror","onprogress","onreadystatechange"].forEach(s=>{s in n&&typeof n[s]=="function"&&T(n,s,function(o){const i={mechanism:{data:{handler:j(o)},handled:!1,type:`auto.browser.browserapierrors.xhr.${s}`}},a=_e(o);return a&&(i.mechanism.data.handler=j(a)),tt(o,i)})}),t.apply(this,e)}}function Zc(t,e){var s,o;const r=(s=y[t])==null?void 0:s.prototype;(o=r==null?void 0:r.hasOwnProperty)!=null&&o.call(r,"addEventListener")&&(T(r,"addEventListener",function(i){return function(a,c,u){try{tu(c)&&(c.handleEvent=tt(c.handleEvent,{mechanism:{data:{handler:j(c),target:t},handled:!1,type:"auto.browser.browserapierrors.handleEvent"}}))}catch{}return e.unregisterOriginalCallbacks&&eu(this,a,c),i.apply(this,[a,tt(c,{mechanism:{data:{handler:j(c),target:t},handled:!1,type:"auto.browser.browserapierrors.addEventListener"}}),u])}}),T(r,"removeEventListener",function(i){return function(a,c,u){try{if(Object.prototype.hasOwnProperty.call(c,"__sentry_wrapped__")){const f=c.__sentry_wrapped__;f&&i.call(this,a,f,u)}}catch{}return i.call(this,a,c,u)}}))}function tu(t){return typeof t.handleEvent=="function"}function eu(t,e,n){t&&typeof t=="object"&&"removeEventListener"in t&&typeof t.removeEventListener=="function"&&t.removeEventListener(e,n)}const nu=(t={})=>{const e=t.lifecycle??"page";return{name:"BrowserSession",setupOnce(){if(typeof y.document>"u"){$t&&g.warn("Using the `browserSessionIntegration` in non-browser environments is not supported.");return}nn({ignoreDuration:!0});let n=!1;Ha(()=>{n||(Wt(),n=!0)});const r=P();let s=r.getUser();r.addScopeListener(o=>{const i=o.getUser();((s==null?void 0:s.id)!==(i==null?void 0:i.id)||(s==null?void 0:s.ip_address)!==(i==null?void 0:i.ip_address))&&(s=i,n&&Wt())}),e==="route"&&Nr(({from:o,to:i})=>{o!==i&&(nn({ignoreDuration:!0}),Wt(),n=!0)})}}},ru="CultureContext",su=(()=>({name:ru,preprocessEvent(t){var n;const e=wn();e&&(t.contexts={...t.contexts,culture:{...e,...(n=t.contexts)==null?void 0:n.culture}})},processSegmentSpan(t){const e=wn();e&&sr(t,{"culture.locale":e.locale,"culture.timezone":e.timezone,"culture.calendar":e.calendar})}})),ou=su;function wn(){try{const t=y.Intl;if(!t)return;const e=t.DateTimeFormat().resolvedOptions();return{locale:e.locale,timezone:e.timeZone,calendar:e.calendar}}catch{return}}const iu="GlobalHandlers",au=((t={})=>{const e={onerror:!0,onunhandledrejection:!0,...t};return{name:iu,setupOnce(){Error.stackTraceLimit=50},setup(n){e.onerror&&(uu(n),Rn("onerror")),e.onunhandledrejection&&(fu(n),Rn("onunhandledrejection"))}}}),cu=au;function uu(t){Ur(e=>{const{stackParser:n,attachStacktrace:r}=xr();if(S()!==t||Or(e))return;const{msg:s,url:o,line:i,column:a,error:c}=e,u=pu(Ie(n,c||s,void 0,r,!1),o,i,a);u.level="error",ur(u,{originalException:c,mechanism:{handled:!1,type:"auto.browser.global_handlers.onerror"}})})}function fu(t){Wr(e=>{const{stackParser:n,attachStacktrace:r}=xr();if(S()!==t||Or())return;const s=lu(e),o=st(s)?du(s):Ie(n,s,void 0,r,!0);o.level="error",ur(o,{originalException:s,mechanism:{handled:!1,type:"auto.browser.global_handlers.onunhandledrejection"}})})}function lu(t){if(st(t))return t;try{if("reason"in t)return t.reason;if("detail"in t&&"reason"in t.detail)return t.detail.reason}catch{}return t}function du(t){return{exception:{values:[{type:"UnhandledRejection",value:`Non-Error promise rejection captured with value: ${String(t)}`}]}}}function pu(t,e,n,r){const s=t.exception=t.exception||{},o=s.values=s.values||[],i=o[0]=o[0]||{},a=i.stacktrace=i.stacktrace||{},c=a.frames=a.frames||[];return c.length===0&&c.push({colno:r,lineno:n,filename:gu(e)??be(),function:G,in_app:!0}),t}function Rn(t){$t&&g.log(`Global Handler attached: ${t}`)}function xr(){const t=S();return(t==null?void 0:t.getOptions())||{stackParser:()=>[],attachStacktrace:!1}}function gu(t){if(!(!x(t)||t.length===0))return t.startsWith("data:")?`<${Ji(t,!1)}>`:t}const hu=()=>({name:"HttpContext",preprocessEvent(t,e,n){var c;if(!y.navigator&&!y.location&&!y.document)return;const{url:r,headers:s}=Tn(),o=n.getDataCollectionOptions().httpHeaders.request,i=Object.entries(((c=t.request)==null?void 0:c.headers)??{}).filter(([u])=>!(u in s)),a={...fn(s,o),...Object.fromEntries(i)};t.request={url:r,...t.request,...Object.keys(a).length>0?{headers:a}:{headers:void 0}}},processSpan(t,e){var a;if(!y.navigator&&!y.location&&!y.document)return;const n=Tn(),r=fn(n.headers,e.getDataCollectionOptions().httpHeaders.request),s=r.Referer,{hostname:o,protocol:i}=y.location||{};sr(t,{[Ds]:r["User-Agent"],[Os]:i==="file:"||o==="localhost"||o==="127.0.0.1"||o==="[::1]"||!!(o!=null&&o.endsWith(".localhost")),...t.is_segment&&{[xs]:((a=t.attributes)==null?void 0:a[Cs])!=="http.client"?Xi(n.url):void 0,[`${Ns}.referer`]:s?[s]:void 0}})}}),_u="cause",mu=5,yu="LinkedErrors",Eu=((t={})=>{const e=t.limit||mu,n=t.key||_u;return{name:yu,preprocessEvent(r,s,o){const i=o.getOptions();ga(ve,i.stackParser,n,e,r,s)}}}),Su=Eu,bu=/^HTML(\w*)Element$/;function vu(t){if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(ic(t)){const e=Iu(t);if(bu.test(e))return`[HTMLElement: ${wr(t)}]`}}function Iu(t){const e=Object.getPrototypeOf(t);return e!=null&&e.constructor?e.constructor.name:"null prototype"}function Tu(){return ku()?($t&&U(()=>{console.error("[Sentry] You cannot use Sentry.init() in a browser extension, see: https://docs.sentry.io/platforms/javascript/best-practices/browser-extensions/")}),!0):!1}function ku(){var s;if(typeof y.window>"u")return!1;const t=y;if(t.nw)return!1;const e=t.chrome||t.browser;if(!((s=e==null?void 0:e.runtime)!=null&&s.id))return!1;const n=be();return!(y===y.top&&/^(?:chrome-extension|moz-extension|ms-browser-extension|safari-web-extension):\/\//.test(n))}function wu(t){return[ia(),ra(),Aa(),Xc(),Bc(),Ra(),cu(),Su(),va(),hu(),ou(),nu()]}function Ou(t={}){const e=!t.skipBrowserExtensionCheck&&Tu();let n=t.defaultIntegrations==null?wu():t.defaultIntegrations;const r=Eo({integrations:t.integrations,defaultIntegrations:n}),s={...t,enabled:e?!1:t.enabled,stackParser:jr(t.stackParser||$c),integrations:r,transport:t.transport||Ic};return Qr(vu),Wi(Sc,s)}export{ui as captureException,Ou as init,Ru as setTag,Nu as setUser};