2 lines
29 KiB
JavaScript
Executable file
2 lines
29 KiB
JavaScript
Executable file
function En(){let t=arguments[0];for(let e=1,n=arguments.length;e<n;e++)t=arguments[e](t);return t}const y=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,g=globalThis,A="10.22.0";function P(){return v(g),g}function v(t){const e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||A,e[A]=e[A]||{}}function L(t,e,n=g){const r=n.__SENTRY__=n.__SENTRY__||{},s=r[A]=r[A]||{};return s[t]||(s[t]=e())}const bn=["debug","info","warn","error","log","assert","trace"],Ft="Sentry Logger ",Q={};function V(t){if(!("console"in g))return t();const e=g.console,n={},r=Object.keys(Q);r.forEach(s=>{const i=Q[s];n[s]=e[s],e[s]=i});try{return t()}finally{r.forEach(s=>{e[s]=n[s]})}}function jt(){H().enabled=!0}function $t(){H().enabled=!1}function yt(){return H().enabled}function Ut(...t){Y("log",...t)}function Gt(...t){Y("warn",...t)}function Bt(...t){Y("error",...t)}function Y(t,...e){y&&yt()&&V(()=>{g.console[t](`${Ft}[${t}]:`,...e)})}function H(){return y?L("loggerSettings",()=>({enabled:!1})):{enabled:!1}}const m={enable:jt,disable:$t,isEnabled:yt,log:Ut,warn:Gt,error:Bt},Et=50,zt="?",tt=/\(error: (.*)\)/,et=/captureMessage|captureException/;function In(...t){const e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,s=0)=>{const i=[],o=n.split(`
|
|
`);for(let u=r;u<o.length;u++){let a=o[u];a.length>1024&&(a=a.slice(0,1024));const c=tt.test(a)?a.replace(tt,"$1"):a;if(!c.match(/\S*Error: /)){for(const f of e){const p=f(c);if(p){i.push(p);break}}if(i.length>=Et+s)break}}return Kt(i.slice(s))}}function Kt(t){if(!t.length)return[];const e=Array.from(t);return/sentryWrapped/.test(O(e).function||"")&&e.pop(),e.reverse(),et.test(O(e).function||"")&&(e.pop(),et.test(O(e).function||"")&&e.pop()),e.slice(0,Et).map(n=>({...n,filename:n.filename||O(e).filename,function:n.function||zt}))}function O(t){return t[t.length-1]||{}}const $="<anonymous>";function vt(t){try{return!t||typeof t!="function"?$:t.name||$}catch{return $}}function Tn(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 bt=Object.prototype.toString;function Vt(t){switch(bt.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return N(t,Error)}}function x(t,e){return bt.call(t)===`[object ${e}]`}function Cn(t){return x(t,"ErrorEvent")}function xn(t){return x(t,"DOMError")}function An(t){return x(t,"DOMException")}function k(t){return x(t,"String")}function Yt(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function Dn(t){return t===null||Yt(t)||typeof t!="object"&&typeof t!="function"}function It(t){return x(t,"Object")}function Ht(t){return typeof Event<"u"&&N(t,Event)}function Wt(t){return typeof Element<"u"&&N(t,Element)}function Xt(t){return x(t,"RegExp")}function w(t){return!!(t?.then&&typeof t.then=="function")}function Jt(t){return It(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function N(t,e){try{return t instanceof e}catch{return!1}}function Tt(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}function Nn(t){return typeof Request<"u"&&N(t,Request)}const W=g,qt=80;function Zt(t,e={}){if(!t)return"<unknown>";try{let n=t;const r=5,s=[];let i=0,o=0;const u=" > ",a=u.length;let c;const f=Array.isArray(e)?e:e.keyAttrs,p=!Array.isArray(e)&&e.maxStringLength||qt;for(;n&&i++<r&&(c=Qt(n,f),!(c==="html"||i>1&&o+s.length*a+c.length>=p));)s.push(c),o+=c.length,n=n.parentNode;return s.reverse().join(u)}catch{return"<unknown>"}}function Qt(t,e){const n=t,r=[];if(!n?.tagName)return"";if(W.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());const s=e?.length?e.filter(o=>n.getAttribute(o)).map(o=>[o,n.getAttribute(o)]):null;if(s?.length)s.forEach(o=>{r.push(`[${o[0]}="${o[1]}"]`)});else{n.id&&r.push(`#${n.id}`);const o=n.className;if(o&&k(o)){const u=o.split(/\s+/);for(const a of u)r.push(`.${a}`)}}const i=["aria-label","type","name","title","alt"];for(const o of i){const u=n.getAttribute(o);u&&r.push(`[${o}="${u}"]`)}return r.join("")}function On(){try{return W.document.location.href}catch{return""}}function Rn(t){if(!W.HTMLElement)return null;let e=t;const n=5;for(let r=0;r<n;r++){if(!e)return null;if(e instanceof HTMLElement){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}e=e.parentNode}return null}function M(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function kn(t,e){if(!Array.isArray(t))return"";const n=[];for(let r=0;r<t.length;r++){const s=t[r];try{Tt(s)?n.push("[VueViewModel]"):n.push(String(s))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function Mn(t,e,n=!1){return k(t)?Xt(e)?e.test(t):k(e)?n?t===e:t.includes(e):!1:!1}function Pn(t,e,n){if(!(e in t))return;const r=t[e];if(typeof r!="function")return;const s=n(r);typeof s=="function"&&te(s,r);try{t[e]=s}catch{y&&m.log(`Failed to replace method "${e}" in object`,t)}}function X(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{y&&m.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function te(t,e){try{const n=e.prototype||{};t.prototype=e.prototype=n,X(t,"__sentry_original__",e)}catch{}}function Ln(t){return t.__sentry_original__}function Ct(t){if(Vt(t))return{message:t.message,name:t.name,stack:t.stack,...rt(t)};if(Ht(t)){const e={type:t.type,target:nt(t.target),currentTarget:nt(t.currentTarget),...rt(t)};return typeof CustomEvent<"u"&&N(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function nt(t){try{return Wt(t)?Zt(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function rt(t){if(typeof t=="object"&&t!==null){const e={};for(const n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function wn(t,e=40){const n=Object.keys(Ct(t));n.sort();const r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return M(r,e);for(let s=n.length;s>0;s--){const i=n.slice(0,s).join(", ");if(!(i.length>e))return s===n.length?i:M(i,e)}return""}function ee(){const t=g;return t.crypto||t.msCrypto}let U;function ne(){return Math.random()*16}function T(t=ee()){try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"")}catch{}return U||(U="10000000100040008000"+1e11),U.replace(/[018]/g,e=>(e^(ne()&15)>>e/4).toString(16))}function xt(t){return t.exception?.values?.[0]}function Fn(t){const{message:e,event_id:n}=t;if(e)return e;const r=xt(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function jn(t,e,n){const r=t.exception=t.exception||{},s=r.values=r.values||[],i=s[0]=s[0]||{};i.value||(i.value=e||""),i.type||(i.type="Error")}function re(t,e){const n=xt(t);if(!n)return;const r={type:"generic",handled:!0},s=n.mechanism;if(n.mechanism={...r,...s,...e},e&&"data"in e){const i={...s?.data,...e.data};n.mechanism.data=i}}function $n(t){if(se(t))return!0;try{X(t,"__sentry_captured__",!0)}catch{}return!1}function se(t){try{return t.__sentry_captured__}catch{}}const At=1e3;function J(){return Date.now()/At}function ie(){const{performance:t}=g;if(!t?.now||!t.timeOrigin)return J;const e=t.timeOrigin;return()=>(e+t.now())/At}let st;function Dt(){return(st??(st=ie()))()}function oe(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||Dt(),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:T()),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 F(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]=F(r[s],e[s],n-1));return r}function it(){return T()}function Nt(){return T().substring(16)}const B="_sentrySpan";function ot(t,e){e?X(t,B,e):delete t[B]}function at(t){return t[B]}const ae=100;class S{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:it(),sampleRand:Math.random()}}clone(){const e=new S;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},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,ot(e,at(this)),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&&oe(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},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 S?n.getScopeData():It(n)?e:void 0,{tags:s,extra:i,user:o,contexts:u,level:a,fingerprint:c=[],propagationContext:f}=r||{};return this._tags={...this._tags,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...u},o&&Object.keys(o).length&&(this._user=o),a&&(this._level=a),c.length&&(this._fingerprint=c),f&&(this._propagationContext=f),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,ot(this,void 0),this._attachments=[],this.setPropagationContext({traceId:it(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){const r=typeof n=="number"?n:ae;if(r<=0)return this;const s={timestamp:J(),...e,message:e.message?M(e.message,2048):e.message};return this._breadcrumbs.push(s),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),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,extra:this._extra,user:this._user,level:this._level,fingerprint:this._fingerprint||[],eventProcessors:this._eventProcessors,propagationContext:this._propagationContext,sdkProcessingMetadata:this._sdkProcessingMetadata,transactionName:this._transactionName,span:at(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=F(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){const r=n?.event_id||T();if(!this._client)return y&&m.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?.event_id||T();if(!this._client)return y&&m.warn("No client configured on scope - will not capture message!"),s;const i=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:i,...r,event_id:s},this),s}captureEvent(e,n){const r=n?.event_id||T();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(y&&m.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 ce(){return L("defaultCurrentScope",()=>new S)}function ue(){return L("defaultIsolationScope",()=>new S)}class fe{constructor(e,n){let r;e?r=e:r=new S;let s;n?s=n:s=new S,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 w(r)?r.then(s=>(this._popScope(),s),s=>{throw this._popScope(),s}):(this._popScope(),r)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this._isolationScope}getStackTop(){return this._stack[this._stack.length-1]}_pushScope(){const 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 C(){const t=P(),e=v(t);return e.stack=e.stack||new fe(ce(),ue())}function pe(t){return C().withScope(t)}function le(t,e){const n=C();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function ct(t){return C().withScope(()=>t(C().getIsolationScope()))}function de(){return{withIsolationScope:ct,withScope:pe,withSetScope:le,withSetIsolationScope:(t,e)=>ct(e),getCurrentScope:()=>C().getScope(),getIsolationScope:()=>C().getIsolationScope()}}function q(t){const e=v(t);return e.acs?e.acs:de()}function j(){const t=P();return q(t).getCurrentScope()}function Un(){const t=P();return q(t).getIsolationScope()}function _e(){return L("globalScope",()=>new S)}function Gn(...t){const e=P(),n=q(e);if(t.length===2){const[r,s]=t;return r?n.withSetScope(r,s):n.withScope(s)}return n.withScope(t[0])}function Ot(){return j().getClient()}function Bn(t){const e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:s}=e,i={trace_id:n,span_id:s||Nt()};return r&&(i.parent_span_id=r),i}const ge="sentry.source",he="sentry.sample_rate",me="sentry.previous_trace_sample_rate",Se="sentry.op",ye="sentry.origin",zn="sentry.profile_id",Kn="sentry.exclusive_time",Ee=0,be=1,Ie="_sentryScope",Te="_sentryIsolationScope";function Ce(t){if(t){if(typeof t=="object"&&"deref"in t&&typeof t.deref=="function")try{return t.deref()}catch{return}return t}}function Rt(t){const e=t;return{scope:e[Ie],isolationScope:Ce(e[Te])}}const xe="sentry-",Ae=/^sentry-/;function De(t){const e=Ne(t);if(!e)return;const n=Object.entries(e).reduce((r,[s,i])=>{if(s.match(Ae)){const o=s.slice(xe.length);r[o]=i}return r},{});if(Object.keys(n).length>0)return n}function Ne(t){if(!(!t||!k(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{const r=ut(n);return Object.entries(r).forEach(([s,i])=>{e[s]=i}),e},{}):ut(t)}function ut(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(i=>{try{return decodeURIComponent(i.trim())}catch{return}})}).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}const Oe=/^o(\d+)\./,Re=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function ke(t){return t==="http"||t==="https"}function vn(t,e=!1){const{host:n,path:r,pass:s,port:i,projectId:o,protocol:u,publicKey:a}=t;return`${u}://${a}${e&&s?`:${s}`:""}@${n}${i?`:${i}`:""}/${r&&`${r}/`}${o}`}function Me(t){const e=Re.exec(t);if(!e){V(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}const[n,r,s="",i="",o="",u=""]=e.slice(1);let a="",c=u;const f=c.split("/");if(f.length>1&&(a=f.slice(0,-1).join("/"),c=f.pop()),c){const p=c.match(/^\d+/);p&&(c=p[0])}return kt({host:i,pass:s,path:a,projectId:c,port:o,protocol:n,publicKey:r})}function kt(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function Pe(t){if(!y)return!0;const{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(o=>t[o]?!1:(m.error(`Invalid Sentry Dsn: ${o} missing`),!0))?!1:n.match(/^\d+$/)?ke(r)?e&&isNaN(parseInt(e,10))?(m.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(m.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(m.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Le(t){return t.match(Oe)?.[1]}function we(t){const e=t.getOptions(),{host:n}=t.getDsn()||{};let r;return e.orgId?r=String(e.orgId):n&&(r=Le(n)),r}function Vn(t){const e=typeof t=="string"?Me(t):kt(t);if(!(!e||!Pe(e)))return e}const Mt=1;let ft=!1;function Fe(t){const{spanId:e,traceId:n,isRemote:r}=t.spanContext(),s=r?e:Z(t).parent_span_id,i=Rt(t).scope,o=r?i?.getPropagationContext().propagationSpanId||Nt():e;return{parent_span_id:s,span_id:o,trace_id:n}}function je(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...s},attributes:i})=>({span_id:e,trace_id:n,sampled:r===Mt,attributes:i,...s}))}function pt(t){return typeof t=="number"?lt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?lt(t.getTime()):Dt()}function lt(t){return t>9999999999?t/1e3:t}function Z(t){if(Ue(t))return t.getSpanJSON();const{spanId:e,traceId:n}=t.spanContext();if($e(t)){const{attributes:r,startTime:s,name:i,endTime:o,status:u,links:a}=t,c="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:i,parent_span_id:c,start_timestamp:pt(s),timestamp:pt(o)||void 0,status:Be(u),op:r[Se],origin:r[ye],links:je(a)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function $e(t){const e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function Ue(t){return typeof t.getSpanJSON=="function"}function Ge(t){const{traceFlags:e}=t.spanContext();return e===Mt}function Be(t){if(!(!t||t.code===Ee))return t.code===be?"ok":t.message||"unknown_error"}const ze="_sentryRootSpan";function Pt(t){return t[ze]||t}function Yn(){ft||(V(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ft=!0)}function Ke(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;const e=Ot()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}const Lt="production",ve="_frozenDsc";function wt(t,e){const n=e.getOptions(),{publicKey:r}=e.getDsn()||{},s={environment:n.environment||Lt,release:n.release,public_key:r,trace_id:t,org_id:we(e)};return e.emit("createDsc",s),s}function Hn(t,e){const n=e.getPropagationContext();return n.dsc||wt(n.traceId,t)}function Ve(t){const e=Ot();if(!e)return{};const n=Pt(t),r=Z(n),s=r.data,i=n.spanContext().traceState,o=i?.get("sentry.sample_rate")??s[he]??s[me];function u(_){return(typeof o=="number"||typeof o=="string")&&(_.sample_rate=`${o}`),_}const a=n[ve];if(a)return u(a);const c=i?.get("sentry.dsc"),f=c&&De(c);if(f)return u(f);const p=wt(t.spanContext().traceId,e),l=s[ge],d=r.description;return l!=="url"&&d&&(p.transaction=d),Ke()&&(p.sampled=String(Ge(n)),p.sample_rand=i?.get("sentry.sample_rand")??Rt(n).scope?.getPropagationContext().sampleRand.toString()),u(p),e.emit("createDsc",p,n),p}const dt=globalThis||void 0||self;function b(t,e=100,n=1/0){try{return z("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ye(t,e=3,n=100*1024){const r=b(t,e);return Je(r)>n?Ye(t,e-1,n):r}function z(t,e,n=1/0,r=1/0,s=qe()){const[i,o]=s;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;const u=He(t,e);if(!u.startsWith("[object "))return u;if(e.__sentry_skip_normalization__)return e;const a=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(a===0)return u.replace("object ","");if(i(e))return"[Circular ~]";const c=e;if(c&&typeof c.toJSON=="function")try{const d=c.toJSON();return z("",d,a-1,r,s)}catch{}const f=Array.isArray(e)?[]:{};let p=0;const l=Ct(e);for(const d in l){if(!Object.prototype.hasOwnProperty.call(l,d))continue;if(p>=r){f[d]="[MaxProperties ~]";break}const _=l[d];f[d]=z(d,_,a-1,r,s),p++}return o(e),f}function He(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof dt<"u"&&e===dt)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Tt(e))return"[VueViewModel]";if(Jt(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${vt(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;const n=We(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function We(t){const e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function Xe(t){return~-encodeURI(t).split(/%..|./).length}function Je(t){return Xe(JSON.stringify(t))}function qe(){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]}const G=0,_t=1,gt=2;function Ze(t){return new D(e=>{e(t)})}function Qe(t){return new D((e,n)=>{n(t)})}class D{constructor(e){this._state=G,this._handlers=[],this._runExecutor(e)}then(e,n){return new D((r,s)=>{this._handlers.push([!1,i=>{if(!e)r(i);else try{r(e(i))}catch(o){s(o)}},i=>{if(!n)s(i);else try{r(n(i))}catch(o){s(o)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new D((n,r)=>{let s,i;return this.then(o=>{i=!1,s=o,e&&e()},o=>{i=!0,s=o,e&&e()}).then(()=>{if(i){r(s);return}n(s)})})}_executeHandlers(){if(this._state===G)return;const e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===_t&&n[1](this._value),this._state===gt&&n[2](this._value),n[0]=!0)})}_runExecutor(e){const n=(i,o)=>{if(this._state===G){if(w(o)){o.then(r,s);return}this._state=i,this._value=o,this._executeHandlers()}},r=i=>{n(_t,i)},s=i=>{n(gt,i)};try{e(r,s)}catch(i){s(i)}}}function tn(t,e,n,r=0){try{const s=K(e,n,t,r);return w(s)?s:Ze(s)}catch(s){return Qe(s)}}function K(t,e,n,r){const s=n[r];if(!t||!s)return t;const i=s({...t},e);return y&&i===null&&m.log(`Event processor "${s.id||"?"}" dropped event`),w(i)?i.then(o=>K(o,e,n,r+1)):K(i,e,n,r+1)}function en(t,e){const{fingerprint:n,span:r,breadcrumbs:s,sdkProcessingMetadata:i}=e;nn(t,e),r&&on(t,r),an(t,n),rn(t,s),sn(t,i)}function ht(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,sdkProcessingMetadata:u,breadcrumbs:a,fingerprint:c,eventProcessors:f,attachments:p,propagationContext:l,transactionName:d,span:_}=e;R(t,"extra",n),R(t,"tags",r),R(t,"user",s),R(t,"contexts",i),t.sdkProcessingMetadata=F(t.sdkProcessingMetadata,u,2),o&&(t.level=o),d&&(t.transactionName=d),_&&(t.span=_),a.length&&(t.breadcrumbs=[...t.breadcrumbs,...a]),c.length&&(t.fingerprint=[...t.fingerprint,...c]),f.length&&(t.eventProcessors=[...t.eventProcessors,...f]),p.length&&(t.attachments=[...t.attachments,...p]),t.propagationContext={...t.propagationContext,...l}}function R(t,e,n){t[e]=F(t[e],n,1)}function nn(t,e){const{extra:n,tags:r,user:s,contexts:i,level:o,transactionName:u}=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(i).length&&(t.contexts={...i,...t.contexts}),o&&(t.level=o),u&&t.type!=="transaction"&&(t.transaction=u)}function rn(t,e){const n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function sn(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function on(t,e){t.contexts={trace:Fe(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Ve(e),...t.sdkProcessingMetadata};const n=Pt(e),r=Z(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function an(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}let I,mt,St,E;function cn(t){const e=g._sentryDebugIds,n=g._debugIds;if(!e&&!n)return{};const r=e?Object.keys(e):[],s=n?Object.keys(n):[];if(E&&r.length===mt&&s.length===St)return E;mt=r.length,St=s.length,E={},I||(I={});const i=(o,u)=>{for(const a of o){const c=u[a],f=I?.[a];if(f&&E&&c)E[f[0]]=c,I&&(I[a]=[f[0],c]);else if(c){const p=t(a);for(let l=p.length-1;l>=0;l--){const _=p[l]?.filename;if(_&&E&&I){E[_]=c,I[a]=[_,c];break}}}}};return e&&i(r,e),n&&i(s,n),E}function Wn(t,e,n,r,s,i){const{normalizeDepth:o=3,normalizeMaxBreadth:u=1e3}=t,a={...e,event_id:e.event_id||n.event_id||T(),timestamp:e.timestamp||J()},c=n.integrations||t.integrations.map(h=>h.name);un(a,t),ln(a,c),s&&s.emit("applyFrameMetadata",e),e.type===void 0&&fn(a,t.stackParser);const f=_n(r,n.captureContext);n.mechanism&&re(a,n.mechanism);const p=s?s.getEventProcessors():[],l=_e().getScopeData();if(i){const h=i.getScopeData();ht(l,h)}if(f){const h=f.getScopeData();ht(l,h)}const d=[...n.attachments||[],...l.attachments];d.length&&(n.attachments=d),en(a,l);const _=[...p,...l.eventProcessors];return tn(_,a,n).then(h=>(h&&pn(h),typeof o=="number"&&o>0?dn(h,o,u):h))}function un(t,e){const{environment:n,release:r,dist:s,maxValueLength:i=250}=e;t.environment=t.environment||n||Lt,!t.release&&r&&(t.release=r),!t.dist&&s&&(t.dist=s);const o=t.request;o?.url&&(o.url=M(o.url,i))}function fn(t,e){const n=cn(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.filename&&(s.debug_id=n[s.filename])})})}function pn(t){const e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(s=>{s.debug_id&&(s.abs_path?e[s.abs_path]=s.debug_id:s.filename&&(e[s.filename]=s.debug_id),delete s.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(([r,s])=>{n.push({type:"sourcemap",code_file:r,debug_id:s})})}function ln(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function dn(t,e,n){if(!t)return null;const r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(s=>({...s,...s.data&&{data:b(s.data,e,n)}}))},...t.user&&{user:b(t.user,e,n)},...t.contexts&&{contexts:b(t.contexts,e,n)},...t.extra&&{extra:b(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=b(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(s=>({...s,...s.data&&{data:b(s.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=b(t.contexts.flags,3,n)),r}function _n(t,e){if(!e)return t;const n=t?t.clone():new S;return n.update(e),n}function gn(t){if(t)return hn(t)?{captureContext:t}:Sn(t)?{captureContext:t}:t}function hn(t){return t instanceof S||typeof t=="function"}const mn=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Sn(t){return Object.keys(t).some(e=>mn.includes(e))}function Xn(t,e){return j().captureException(t,gn(e))}function Jn(t,e){const n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return j().captureMessage(t,n,r)}function qn(t,e){return j().captureEvent(t,e)}export{An as $,Ze as A,A as B,Ot as C,y as D,V as E,Ln as F,g as G,N as H,bn as I,Pn as J,Q as K,Gn as L,re as M,kn as N,Jn as O,Xn as P,Tn as Q,Dt as R,Kn as S,Vt as T,X as U,Nn as V,On as W,te as X,jn as Y,Cn as Z,xn as _,vn as a,Ht as a0,Ye as a1,wn as a2,k as a3,In as a4,zt as a5,Fn as a6,Zt as a7,Rn as a8,qn as a9,En as aa,v as b,L as c,m as d,J as e,zn as f,vt as g,$n as h,Mn as i,Dn as j,oe as k,Lt as l,Vn as m,b as n,Bn as o,Wn as p,Hn as q,j as r,Un as s,Qe as t,T as u,Yt as v,Yn as w,F as x,w as y,It as z};
|