@drenso/homey-log 10.5000.0 → 10.5100.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/build/index.js +18 -18
- package/build/index.mjs +18 -18
- package/package.json +3 -3
package/build/index.mjs
CHANGED
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
import
|
|
2
|
-
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let u=
|
|
1
|
+
import Pp from"node:os";import*as ws from"node:os";var g=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var _=globalThis;var G="10.51.0";function M(){return ee(_),_}function ee(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||G,t[G]=t[G]||{}}function k(e,t,n=_){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[G]=r[G]||{};return o[e]||(o[e]=t())}var ue=["debug","info","warn","error","log","assert","trace"],gi="Sentry Logger ",D={};function b(e){if(!("console"in _))return e();let t=_.console,n={},r=Object.keys(D);r.forEach(o=>{let s=D[o];n[o]=t[o],t[o]=s});try{return e()}finally{r.forEach(o=>{t[o]=n[o]})}}function _i(){rn().enabled=!0}function hi(){rn().enabled=!1}function mr(){return rn().enabled}function Si(...e){nn("log",...e)}function Ei(...e){nn("warn",...e)}function Ti(...e){nn("error",...e)}function nn(e,...t){g&&mr()&&b(()=>{_.console[e](`${gi}[${e}]:`,...t)})}function rn(){return g?k("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var p={enable:_i,disable:hi,isEnabled:mr,log:Si,warn:Ei,error:Ti};var gr=/\(error: (.*)\)/,_r=/captureMessage|captureException/;function Tt(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
|
|
2
|
+
`);for(let a=r;a<i.length;a++){let c=i[a];c.length>1024&&(c=c.slice(0,1024));let u=gr.test(c)?c.replace(gr,"$1"):c;if(!u.includes("Error: ")){for(let l of t){let f=l(u);if(f){s.push(f);break}}if(s.length>=50+o)break}}return hr(s.slice(o))}}function sn(e){return Array.isArray(e)?Tt(...e):e}function hr(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Et(t).function||"")&&t.pop(),t.reverse(),_r.test(Et(t).function||"")&&(t.pop(),_r.test(Et(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||Et(t).filename,function:n.function||"?"}))}function Et(e){return e[e.length-1]||{}}var on="<anonymous>";function Ye(e){try{return!e||typeof e!="function"?on:e.name||on}catch{return on}}function It(e){return"__v_isVNode"in e&&e.__v_isVNode?"[VueVNode]":"[VueViewModel]"}function Sr(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var We={},Er={};function pe(e,t){return We[e]=We[e]||[],We[e].push(t),()=>{let n=We[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function z(e,t){if(!Er[e]){Er[e]=!0;try{t()}catch(n){g&&p.error(`Error while instrumenting ${e}`,n)}}}function H(e,t){let n=e&&We[e];if(n)for(let r of n)try{r(t)}catch(o){g&&p.error(`Error while triggering instrumentation handler.
|
|
3
3
|
Type: ${e}
|
|
4
|
-
Name: ${
|
|
5
|
-
Error:`,o)}}var rn=null;function Sr(e){let t="error";ae(t,e),Y(t,gi)}function gi(){rn=_.onerror,_.onerror=function(e,t,n,r,o){return B("error",{column:r,error:o,line:n,msg:e,url:t}),rn?rn.apply(this,arguments):!1},_.onerror.__SENTRY_INSTRUMENTED__=!0}var on=null;function Er(e){let t="unhandledrejection";ae(t,e),Y(t,_i)}function _i(){on=_.onunhandledrejection,_.onunhandledrejection=function(e){return B("unhandledrejection",e),on?on.apply(this,arguments):!0},_.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var Tr=Object.prototype.toString;function He(e){switch(Tr.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return $(e,Error)}}function Tt(e,t){return Tr.call(e)===`[object ${t}]`}function Ir(e){return Tt(e,"ErrorEvent")}function ce(e){return Tt(e,"String")}function We(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function he(e){return e===null||We(e)||typeof e!="object"&&typeof e!="function"}function q(e){return Tt(e,"Object")}function yr(e){return typeof Event<"u"&&$(e,Event)}function br(e){return typeof Element<"u"&&$(e,Element)}function xr(e){return Tt(e,"RegExp")}function V(e){return!!(e?.then&&typeof e.then=="function")}function Nr(e){return q(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function $(e,t){try{return e instanceof t}catch{return!1}}function It(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}var hi=_,Si=80;function Rr(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,f=Array.isArray(t)?t:t.keyAttrs,l=!Array.isArray(t)&&t.maxStringLength||Si;for(;n&&s++<r&&(u=Ei(n,f),!(u==="html"||s>1&&i+o.length*c+u.length>=l));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function Ei(e,t){let n=e,r=[];if(!n?.tagName)return"";if(hi.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());let o=t?.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&ce(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function Ye(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&yt(o,r);try{e[t]=o}catch{g&&p.log(`Failed to replace method "${t}" in object`,e)}}function Se(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{g&&p.log(`Failed to add non-enumerable property "${t}" to object`,e)}}function yt(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Se(e,"__sentry_original__",t)}catch{}}function sn(e){return e.__sentry_original__}function bt(e){if(He(e))return{message:e.message,name:e.name,stack:e.stack,...Cr(e)};if(yr(e)){let t={type:e.type,target:Ar(e.target),currentTarget:Ar(e.currentTarget),...Cr(e)};return typeof CustomEvent<"u"&&$(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function Ar(e){try{return br(e)?Rr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Cr(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function an(e){let t=Object.keys(bt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var Ee;function Te(e){if(Ee!==void 0)return Ee?Ee(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=_;return t in n&&typeof n[t]=="function"?(Ee=n[t],Ee(e)):(Ee=null,e())}function U(){return Te(()=>Math.random())}function Ie(){return Te(()=>Date.now())}function ye(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function cn(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function un(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{It(o)?n.push(St(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function j(e,t,n=!1){return ce(e)?xr(t)?t.test(e):ce(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function be(e,t=[],n=!1){return t.some(r=>j(e,r,n))}function Ti(){let e=_;return e.crypto||e.msCrypto}var pn;function Ii(){return U()*16}function I(e=Ti()){try{if(e?.randomUUID)return Te(()=>e.randomUUID()).replace(/-/g,"")}catch{}return pn||(pn="10000000100040008000"+1e11),pn.replace(/[018]/g,t=>(t^(Ii()&15)>>t/4).toString(16))}function vr(e){return e.exception?.values?.[0]}function Q(e){let{message:t,event_id:n}=e;if(t)return t;let r=vr(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function ln(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function xe(e,t){let n=vr(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};n.mechanism.data=s}}var yi=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function fn(e){return parseInt(e||"",10)}function dn(e){let t=e.match(yi)||[],n=fn(t[1]),r=fn(t[2]),o=fn(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function xt(e){if(Or(e))return!0;try{Se(e,"__sentry_captured__",!0)}catch{}return!1}function Or(e){try{return e.__sentry_captured__}catch{}}var Mr=1e3;function Z(){return Ie()/Mr}function bi(){let{performance:e}=_;if(!e?.now||!e.timeOrigin)return Z;let t=e.timeOrigin;return()=>(t+Te(()=>e.now()))/Mr}var Lr;function Nt(){return(Lr??(Lr=bi()))()}function Ve(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||Nt(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:I()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function ee(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=ee(r[o],t[o],n-1));return r}function $e(){return I()}function je(){return I().substring(16)}var mn="_sentrySpan";function Ze(e,t){t?Se(e,mn,t):delete e[mn]}function Ne(e){return e[mn]}var xi=100,v=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:$e(),sampleRand:U()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Ze(t,Ne(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ve(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():q(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:f=[],propagationContext:l,conversationId:d}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},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}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Ze(this,void 0),this._attachments=[],this.setPropagationContext({traceId:$e(),sampleRand:U()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:xi;if(r<=0)return this;let o={timestamp:Z(),...t,message:t.message?ye(t.message,2048):t.message};return this._breadcrumbs.push(o),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(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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,span:Ne(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=ee(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||I();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(g&&p.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function ze(){return k("defaultCurrentScope",()=>new v)}function Je(){return k("defaultIsolationScope",()=>new v)}var Ur=e=>e instanceof Promise&&!e[Pr],Pr=Symbol("chained PromiseLike"),kr=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return Ur(r)&&Ur(e)?r:Ni(e,r)},Ni=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Pr]:!0}),t};var gn=class{constructor(t,n){let r;t?r=t:r=new v;let o;n?o=n:o=new v,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return V(r)?kr(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(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function Re(){let e=M(),t=K(e);return t.stack=t.stack||new gn(ze(),Je())}function Ri(e){return Re().withScope(e)}function Ai(e,t){let n=Re();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Dr(e){return Re().withScope(()=>e(Re().getIsolationScope()))}function Fr(){return{withIsolationScope:Dr,withScope:Ri,withSetScope:Ai,withSetIsolationScope:(e,t)=>Dr(t),getCurrentScope:()=>Re().getScope(),getIsolationScope:()=>Re().getIsolationScope()}}function _n(e){let t=M(),n=K(t);n.acs=e}function te(e){let t=K(e);return t.acs?t.acs:Fr()}function Ci(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function vi(e,t){let{value:n,unit:r}=Ci(e)?e:{value:e,unit:void 0},o=Oi(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function hn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let s=vi(o,t);s&&(n[r]=s)}return n}function Sn(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=wr(o[0])*o.length:he(o)?t+=wr(o):t+=100}return t}function wr(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function Oi(e){let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Li;function Br(){return Li?.()}function C(){let e=M();return te(e).getCurrentScope()}function P(){let e=M();return te(e).getIsolationScope()}function Rt(){return k("globalScope",()=>new v)}function ue(...e){let t=M(),n=te(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function T(){return C().getClient()}function Xe(e){let t=Br();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||je()};return o&&(i.parent_span_id=o),i}var Ae="sentry.source",En="sentry.sample_rate",Gr="sentry.previous_trace_sample_rate",Tn="sentry.op",In="sentry.origin";var Hr="sentry.release",Wr="sentry.environment",Yr="sentry.segment.name",Vr="sentry.segment.id",$r="sentry.sdk.name",jr="sentry.sdk.version",Zr="user.id",zr="user.email",Jr="user.ip_address",Xr="user.name";var yn="sentry.profile_id",bn="sentry.exclusive_time";function Kr(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var Mi="_sentryScope",Ui="_sentryIsolationScope";function Ce(e){let t=e;return{scope:t[Mi],isolationScope:Kr(t[Ui])}}var qr="sentry-";function At(e){let t=Pi(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(qr)){let i=o.slice(qr.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Pi(e){if(!(!e||!ce(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=Qr(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):Qr(e)}function Qr(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}var ki=/^o(\d+)\./,Di=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Fi(e){return e==="http"||e==="https"}function O(e,t=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function wi(e){let t=Di.exec(e);if(!t){b(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",s="",i="",a=""]=t.slice(1),c="",u=a,f=u.split("/");if(f.length>1&&(c=f.slice(0,-1).join("/"),u=f.pop()),u){let l=u.match(/^\d+/);l&&(u=l[0])}return eo({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function eo(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Bi(e){if(!g)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(p.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Fi(r)?t&&isNaN(parseInt(t,10))?(p.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function Gi(e){return e.match(ki)?.[1]}function to(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=Gi(n)),r}function no(e){let t=typeof e=="string"?wi(e):eo(e);if(!(!t||!Bi(t)))return t}function Ke(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var ro=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function oo(e){if(!e)return;let t=e.match(ro);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function xn(e,t){let n=oo(e),r=At(t);if(!n?.traceId)return{traceId:$e(),sampleRand:U()};let o=Hi(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function Hi(e,t){let n=Ke(t?.sample_rand);if(n!==void 0)return n;let r=Ke(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?U()*r:r+U()*(1-r):U()}var Nn=1,so=!1;function vt(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:ve(e).parent_span_id,s=Ce(e).scope,i=r?s?.getPropagationContext().propagationSpanId||je():t;return{parent_span_id:o,span_id:i,trace_id:n}}function Vi(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===Nn,attributes:s,...o}))}function $i(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Nn,attributes:o}))}function Ct(e){return typeof e=="number"?io(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?io(e.getTime()):Nt()}function io(e){return e>9999999999?e/1e3:e}function ve(e){if(po(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(uo(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:ao(e),start_timestamp:Ct(o),timestamp:Ct(i)||void 0,status:ji(a),op:r[Tn],origin:r[In],links:Vi(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Rn(e){if(po(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(uo(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:ao(e),start_timestamp:Ct(o),end_timestamp:Ct(i),is_segment:e===qe(e),status:Zi(a),attributes:r,links:$i(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===qe(e)}}function ao(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function co(e){return{...e,attributes:hn(e.attributes),links:e.links?.map(t=>({...t,attributes:hn(t.attributes)}))}}function uo(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function po(e){return typeof e.getSpanJSON=="function"}function Ot(e){let{traceFlags:t}=e.spanContext();return t===Nn}function ji(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Zi(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var zi="_sentryRootSpan";var pe=qe;function qe(e){return e[zi]||e}function Qe(){let e=M(),t=te(e);return t.getActiveSpan?t.getActiveSpan():Ne(C())}function et(){so||(b(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),so=!0)}var fo=!1;function lo(){if(fo)return;function e(){let t=Qe(),n=t&&pe(t);if(n){let r="internal_error";g&&p.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}e.tag="sentry_tracingErrorCallback",fo=!0,Sr(e),Er(e)}function mo(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function go(e){p.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function An(e,t){if(!t?.length||!e.description)return!1;for(let n of t){if(Ji(n)){if(j(e.description,n))return g&&go(e),!0;continue}if(!n.name&&!n.op)continue;let r=n.name?j(e.description,n.name):!0,o=n.op?e.op&&j(e.op,n.op):!0;if(r&&o)return g&&go(e),!0}return!1}function _o(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function Ji(e){return typeof e=="string"||e instanceof RegExp}var Oe="production";var Xi="_frozenDsc";function ho(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Oe,release:n.release,public_key:r,trace_id:e,org_id:to(t)};return t.emit("createDsc",o),o}function Lt(e,t){let n=t.getPropagationContext();return n.dsc||ho(n.traceId,e)}function Le(e){let t=T();if(!t)return{};let n=pe(e),r=ve(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[En]??o[Gr];function a(h){return(typeof i=="number"||typeof i=="string")&&(h.sample_rate=`${i}`),h}let c=n[Xi];if(c)return a(c);let u=s?.get("sentry.dsc"),f=u&&At(u);if(f)return a(f);let l=ho(e.spanContext().traceId,t),d=o[Ae]??o["sentry.span.source"],m=r.description;return d!=="url"&&m&&(l.transaction=m),mo()&&(l.sampled=String(Ot(n)),l.sample_rand=s?.get("sentry.sample_rand")??Ce(n).scope?.getPropagationContext().sampleRand.toString()),a(l),t.emit("createDsc",l,n),l}function Me(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function F(e,t=100,n=1/0){try{return Cn("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function vn(e,t=3,n=100*1024){let r=F(e,t);return ea(r)>n?vn(e,t-1,n):r}function Cn(e,t,n=1/0,r=1/0,o=ta()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=Ki(e,t);if(!a.startsWith("[object "))return a;if(t.__sentry_skip_normalization__)return t;let c=typeof t.__sentry_override_normalization_depth__=="number"?t.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let u=t;if(u&&typeof u.toJSON=="function")try{let m=u.toJSON();return Cn("",m,c-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},l=0,d=bt(t);for(let m in d){if(!Object.prototype.hasOwnProperty.call(d,m))continue;if(l>=r){f[m]="[MaxProperties ~]";break}let h=d[m];f[m]=Cn(m,h,c-1,r,o),l++}return i(t),f}function Ki(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(It(t))return St(t);if(Nr(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ge(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=qi(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function qi(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function Qi(e){return~-encodeURI(e).split(/%..|./).length}function ea(e){return Qi(JSON.stringify(e))}function ta(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function N(e,t=[]){return[e,t]}function Ln(e,t){let[n,r]=e;return[n,[...r,t]]}function tt(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function Mn(e,t){return tt(e,(n,r)=>t.includes(r))}function On(e){let t=K(_);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function nt(e){let[t,n]=e,r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[On(r),s]:r.push(typeof s=="string"?On(s):s)}for(let s of n){let[i,a]=s;if(o(`
|
|
4
|
+
Name: ${Ye(r)}
|
|
5
|
+
Error:`,o)}}var an=null;function Tr(e){let t="error";pe(t,e),z(t,Ii)}function Ii(){an=_.onerror,_.onerror=function(e,t,n,r,o){return H("error",{column:r,error:o,line:n,msg:e,url:t}),an?an.apply(this,arguments):!1},_.onerror.__SENTRY_INSTRUMENTED__=!0}var cn=null;function Ir(e){let t="unhandledrejection";pe(t,e),z(t,yi)}function yi(){cn=_.onunhandledrejection,_.onunhandledrejection=function(e){return H("unhandledrejection",e),cn?cn.apply(this,arguments):!0},_.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var yr=Object.prototype.toString;function Ve(e){switch(yr.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return J(e,Error)}}function yt(e,t){return yr.call(e)===`[object ${t}]`}function br(e){return yt(e,"ErrorEvent")}function fe(e){return yt(e,"String")}function $e(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function Te(e){return e===null||$e(e)||typeof e!="object"&&typeof e!="function"}function te(e){return yt(e,"Object")}function xr(e){return typeof Event<"u"&&J(e,Event)}function Nr(e){return typeof Element<"u"&&J(e,Element)}function Rr(e){return yt(e,"RegExp")}function Z(e){return!!(e?.then&&typeof e.then=="function")}function Ar(e){return te(e)&&"nativeEvent"in e&&"preventDefault"in e&&"stopPropagation"in e}function J(e,t){try{return e instanceof t}catch{return!1}}function bt(e){return!!(typeof e=="object"&&e!==null&&(e.__isVue||e._isVue||e.__v_isVNode))}var bi=_,xi=80;function Cr(e,t={}){if(!e)return"<unknown>";try{let n=e,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,l=Array.isArray(t)?t:t.keyAttrs,f=!Array.isArray(t)&&t.maxStringLength||xi;for(;n&&s++<r&&(u=Ni(n,l),!(u==="html"||s>1&&i+o.length*c+u.length>=f));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function Ni(e,t){let n=e,r=[];if(!n?.tagName)return"";if(bi.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());let o=t?.length?t.filter(s=>n.getAttribute(s)).map(s=>[s,n.getAttribute(s)]):null;if(o?.length)o.forEach(s=>{r.push(`[${s[0]}="${s[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let s=n.className;if(s&&fe(s)){let i=s.split(/\s+/);for(let a of i)r.push(`.${a}`)}}for(let s of["aria-label","type","name","title","alt"]){let i=n.getAttribute(s);i&&r.push(`[${s}="${i}"]`)}return r.join("")}function je(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&xt(o,r);try{e[t]=o}catch{g&&p.log(`Failed to replace method "${t}" in object`,e)}}function Ie(e,t,n){try{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0})}catch{g&&p.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function xt(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,Ie(e,"__sentry_original__",t)}catch{}}function un(e){return e.__sentry_original__}function Nt(e){if(Ve(e))return{message:e.message,name:e.name,stack:e.stack,...Or(e)};if(xr(e)){let t={type:e.type,target:vr(e.target),currentTarget:vr(e.currentTarget),...Or(e)};return typeof CustomEvent<"u"&&J(e,CustomEvent)&&(t.detail=e.detail),t}else return e}function vr(e){try{return Nr(e)?Cr(e):Object.prototype.toString.call(e)}catch{return"<unknown>"}}function Or(e){return typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e)):{}}function pn(e){let t=Object.keys(Nt(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var ye;function be(e){if(ye!==void 0)return ye?ye(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=_;return t in n&&typeof n[t]=="function"?(ye=n[t],ye(e)):(ye=null,e())}function P(){return be(()=>Math.random())}function xe(){return be(()=>Date.now())}function Ne(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function fn(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let o=Math.max(t-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function ln(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let o=e[r];try{bt(o)?n.push(It(o)):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(t)}function Y(e,t,n=!1){return fe(e)?Rr(t)?t.test(e):fe(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function Re(e,t=[],n=!1){return t.some(r=>Y(e,r,n))}function Ri(){let e=_;return e.crypto||e.msCrypto}var dn;function Ai(){return P()*16}function I(e=Ri()){try{if(e?.randomUUID)return be(()=>e.randomUUID()).replace(/-/g,"")}catch{}return dn||(dn="10000000100040008000"+1e11),dn.replace(/[018]/g,t=>(t^(Ai()&15)>>t/4).toString(16))}function Lr(e){return e.exception?.values?.[0]}function ne(e){let{message:t,event_id:n}=e;if(t)return t;let r=Lr(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function gn(e,t,n){let r=e.exception=e.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=t||""),s.type||(s.type=n||"Error")}function Ae(e,t){let n=Lr(e);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...t},t&&"data"in t){let s={...o?.data,...t.data};n.mechanism.data=s}}var Ci=/^(0|[1-9]\d*)\.(0|[1-9]\d*)\.(0|[1-9]\d*)(?:-((?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+([0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/;function mn(e){return parseInt(e||"",10)}function _n(e){let t=e.match(Ci)||[],n=mn(t[1]),r=mn(t[2]),o=mn(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:t[4]}}function Rt(e){if(Mr(e))return!0;try{Ie(e,"__sentry_captured__",!0)}catch{}return!1}function Mr(e){try{return e.__sentry_captured__}catch{}}var Ur=1e3;function X(){return xe()/Ur}function vi(){let{performance:e}=_;if(!e?.now||!e.timeOrigin)return X;let t=e.timeOrigin;return()=>(t+be(()=>e.now()))/Ur}var Pr;function At(){return(Pr??(Pr=vi()))()}function ze(e,t={}){if(t.user&&(!e.ipAddress&&t.user.ip_address&&(e.ipAddress=t.user.ip_address),!e.did&&!t.did&&(e.did=t.user.id||t.user.email||t.user.username)),e.timestamp=t.timestamp||At(),t.abnormal_mechanism&&(e.abnormal_mechanism=t.abnormal_mechanism),t.ignoreDuration&&(e.ignoreDuration=t.ignoreDuration),t.sid&&(e.sid=t.sid.length===32?t.sid:I()),t.init!==void 0&&(e.init=t.init),!e.did&&t.did&&(e.did=`${t.did}`),typeof t.started=="number"&&(e.started=t.started),e.ignoreDuration)e.duration=void 0;else if(typeof t.duration=="number")e.duration=t.duration;else{let n=e.timestamp-e.started;e.duration=n>=0?n:0}t.release&&(e.release=t.release),t.environment&&(e.environment=t.environment),!e.ipAddress&&t.ipAddress&&(e.ipAddress=t.ipAddress),!e.userAgent&&t.userAgent&&(e.userAgent=t.userAgent),typeof t.errors=="number"&&(e.errors=t.errors),t.status&&(e.status=t.status)}function re(e,t,n=2){if(!t||typeof t!="object"||n<=0)return t;if(e&&Object.keys(t).length===0)return e;let r={...e};for(let o in t)Object.prototype.hasOwnProperty.call(t,o)&&(r[o]=re(r[o],t[o],n-1));return r}function Ze(){return I()}function Je(){return I().substring(16)}var hn="_sentrySpan";function Xe(e,t){t?Ie(e,hn,t):delete e[hn]}function Ce(e){return e[hn]}var Oi=100,v=class e{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._attributes={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:Ze(),sampleRand:P()}}clone(){let t=new e;return t._breadcrumbs=[...this._breadcrumbs],t._tags={...this._tags},t._attributes={...this._attributes},t._extra={...this._extra},t._contexts={...this._contexts},this._contexts.flags&&(t._contexts.flags={values:[...this._contexts.flags.values]}),t._user=this._user,t._level=this._level,t._session=this._session,t._transactionName=this._transactionName,t._fingerprint=this._fingerprint,t._eventProcessors=[...this._eventProcessors],t._attachments=[...this._attachments],t._sdkProcessingMetadata={...this._sdkProcessingMetadata},t._propagationContext={...this._propagationContext},t._client=this._client,t._lastEventId=this._lastEventId,t._conversationId=this._conversationId,Xe(t,Ce(this)),t}setClient(t){this._client=t}setLastEventId(t){this._lastEventId=t}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(t){this._scopeListeners.push(t)}addEventProcessor(t){return this._eventProcessors.push(t),this}setUser(t){return this._user=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&ze(this._session,{user:t}),this._notifyScopeListeners(),this}getUser(){return this._user}setConversationId(t){return this._conversationId=t||void 0,this._notifyScopeListeners(),this}setTags(t){return this._tags={...this._tags,...t},this._notifyScopeListeners(),this}setTag(t,n){return this.setTags({[t]:n})}setAttributes(t){return this._attributes={...this._attributes,...t},this._notifyScopeListeners(),this}setAttribute(t,n){return this.setAttributes({[t]:n})}removeAttribute(t){return t in this._attributes&&(delete this._attributes[t],this._notifyScopeListeners()),this}setExtras(t){return this._extra={...this._extra,...t},this._notifyScopeListeners(),this}setExtra(t,n){return this._extra={...this._extra,[t]:n},this._notifyScopeListeners(),this}setFingerprint(t){return this._fingerprint=t,this._notifyScopeListeners(),this}setLevel(t){return this._level=t,this._notifyScopeListeners(),this}setTransactionName(t){return this._transactionName=t,this._notifyScopeListeners(),this}setContext(t,n){return n===null?delete this._contexts[t]:this._contexts[t]=n,this._notifyScopeListeners(),this}setSession(t){return t?this._session=t:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(t){if(!t)return this;let n=typeof t=="function"?t(this):t,r=n instanceof e?n.getScopeData():te(n)?t:void 0,{tags:o,attributes:s,extra:i,user:a,contexts:c,level:u,fingerprint:l=[],propagationContext:f,conversationId:d}=r||{};return this._tags={...this._tags,...o},this._attributes={...this._attributes,...s},this._extra={...this._extra,...i},this._contexts={...this._contexts,...c},a&&Object.keys(a).length&&(this._user=a),u&&(this._level=u),l.length&&(this._fingerprint=l),f&&(this._propagationContext=f),d&&(this._conversationId=d),this}clear(){return this._breadcrumbs=[],this._tags={},this._attributes={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,this._conversationId=void 0,Xe(this,void 0),this._attachments=[],this.setPropagationContext({traceId:Ze(),sampleRand:P()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:Oi;if(r<=0)return this;let o={timestamp:X(),...t,message:t.message?Ne(t.message,2048):t.message};return this._breadcrumbs.push(o),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(t){return this._attachments.push(t),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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,span:Ce(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=re(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:o,...n,event_id:r},this),r}captureMessage(t,n,r){let o=r?.event_id||I();if(!this._client)return g&&p.warn("No client configured on scope - will not capture message!"),o;let s=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:s,...r,event_id:o},this),o}captureEvent(t,n){let r=t.event_id||n?.event_id||I();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(g&&p.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(t=>{t(this)}),this._notifyingListeners=!1)}};function Ke(){return k("defaultCurrentScope",()=>new v)}function qe(){return k("defaultIsolationScope",()=>new v)}var kr=e=>e instanceof Promise&&!e[Dr],Dr=Symbol("chained PromiseLike"),Fr=(e,t,n)=>{let r=e.then(o=>(t(o),o),o=>{throw n(o),o});return kr(r)&&kr(e)?r:Li(e,r)},Li=(e,t)=>{let n=!1;for(let r in e){if(r in t)continue;n=!0;let o=e[r];typeof o=="function"?Object.defineProperty(t,r,{value:(...s)=>o.apply(e,s),enumerable:!0,configurable:!0,writable:!0}):t[r]=o}return n&&Object.assign(t,{[Dr]:!0}),t};var Sn=class{constructor(t,n){let r;t?r=t:r=new v;let o;n?o=n:o=new v,this._stack=[{scope:r}],this._isolationScope=o}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(o){throw this._popScope(),o}return Z(r)?Fr(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(){let t=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:t}),t}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function ve(){let e=M(),t=ee(e);return t.stack=t.stack||new Sn(Ke(),qe())}function Mi(e){return ve().withScope(e)}function Pi(e,t){let n=ve();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function wr(e){return ve().withScope(()=>e(ve().getIsolationScope()))}function Br(){return{withIsolationScope:wr,withScope:Mi,withSetScope:Pi,withSetIsolationScope:(e,t)=>wr(t),getCurrentScope:()=>ve().getScope(),getIsolationScope:()=>ve().getIsolationScope()}}function En(e){let t=M(),n=ee(t);n.acs=e}function oe(e){let t=ee(e);return t.acs?t.acs:Br()}function Ui(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function ki(e,t){let{value:n,unit:r}=Ui(e)?e:{value:e,unit:void 0},o=Di(n),s=r&&typeof r=="string"?{unit:r}:{};if(o)return{...o,...s};if(!t||t==="skip-undefined"&&n===void 0)return;let i="";try{i=JSON.stringify(n)??""}catch{}return{value:i,type:"string",...s}}function Tn(e,t=!1){let n={};for(let[r,o]of Object.entries(e??{})){let s=ki(o,t);s&&(n[r]=s)}return n}function In(e){if(!e)return 0;let t=0;for(let[n,r]of Object.entries(e)){t+=n.length*2,t+=r.type.length*2,t+=(r.unit?.length??0)*2;let o=r.value;Array.isArray(o)?t+=Gr(o[0])*o.length:Te(o)?t+=Gr(o):t+=100}return t}function Gr(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function Di(e){let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Fi;function Hr(){return Fi?.()}function C(){let e=M();return oe(e).getCurrentScope()}function U(){let e=M();return oe(e).getIsolationScope()}function Ct(){return k("globalScope",()=>new v)}function le(...e){let t=M(),n=oe(t);if(e.length===2){let[r,o]=e;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(e[0])}function T(){return C().getClient()}function Qe(e){let t=Hr();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:o,propagationSpanId:s}=n,i={trace_id:r,span_id:s||Je()};return o&&(i.parent_span_id=o),i}var F="sentry.source",yn="sentry.sample_rate",Yr="sentry.previous_trace_sample_rate",w="sentry.op",bn="sentry.origin";var Wr="sentry.release",Vr="sentry.environment",$r="sentry.segment.name",jr="sentry.segment.id",zr="sentry.sdk.name",Zr="sentry.sdk.version",Jr="user.id",Xr="user.email",Kr="user.ip_address",qr="user.name",vt="sentry.custom_span_name",xn="sentry.profile_id",Nn="sentry.exclusive_time";function Qr(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var wi="_sentryScope",Bi="_sentryIsolationScope";function Oe(e){let t=e;return{scope:t[wi],isolationScope:Qr(t[Bi])}}var eo="sentry-";function Ot(e){let t=Gi(e);if(!t)return;let n=Object.entries(t).reduce((r,[o,s])=>{if(o.startsWith(eo)){let i=o.slice(eo.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Gi(e){if(!(!e||!fe(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=to(n);return Object.entries(r).forEach(([o,s])=>{t[o]=s}),t},{}):to(e)}function to(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),o=t.slice(n+1);return[r,o].map(s=>{try{return decodeURIComponent(s.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}var Hi=/^o(\d+)\./,Yi=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Wi(e){return e==="http"||e==="https"}function O(e,t=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=e;return`${a}://${c}${t&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function Vi(e){let t=Yi.exec(e);if(!t){b(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,o="",s="",i="",a=""]=t.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let f=u.match(/^\d+/);f&&(u=f[0])}return no({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function no(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function $i(e){if(!g)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(i=>e[i]?!1:(p.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?Wi(r)?t&&isNaN(parseInt(t,10))?(p.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(p.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(p.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function ji(e){return e.match(Hi)?.[1]}function ro(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=ji(n)),r}function oo(e){let t=typeof e=="string"?Vi(e):no(e);if(!(!t||!$i(t)))return t}function et(e){if(typeof e=="boolean")return Number(e);let t=typeof e=="string"?parseFloat(e):e;if(!(typeof t!="number"||isNaN(t)||t<0||t>1))return t}var so=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function io(e){if(!e)return;let t=e.match(so);if(!t)return;let n;return t[3]==="1"?n=!0:t[3]==="0"&&(n=!1),{traceId:t[1],parentSampled:n,parentSpanId:t[2]}}function Rn(e,t){let n=io(e),r=Ot(t);if(!n?.traceId)return{traceId:Ze(),sampleRand:P()};let o=zi(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function zi(e,t){let n=et(t?.sample_rand);if(n!==void 0)return n;let r=et(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?P()*r:r+P()*(1-r):P()}var An=1,ao=!1;function Mt(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),o=r?t:Le(e).parent_span_id,s=Oe(e).scope,i=r?s?.getPropagationContext().propagationSpanId||Je():t;return{parent_span_id:o,span_id:i,trace_id:n}}function Xi(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:t,trace_id:n,sampled:r===An,attributes:s,...o}))}function Ki(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:o})=>({span_id:t,trace_id:n,sampled:r===An,attributes:o}))}function Lt(e){return typeof e=="number"?co(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?co(e.getTime()):At()}function co(e){return e>9999999999?e/1e3:e}function Le(e){if(lo(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(fo(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{span_id:t,trace_id:n,data:r,description:s,parent_span_id:uo(e),start_timestamp:Lt(o),timestamp:Lt(i)||void 0,status:qi(a),op:r[w],origin:r[bn],links:Xi(c)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function Cn(e){if(lo(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(fo(e)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=e;return{name:s,span_id:t,trace_id:n,parent_span_id:uo(e),start_timestamp:Lt(o),end_timestamp:Lt(i),is_segment:e===tt(e),status:Qi(a),attributes:r,links:Ki(c)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===tt(e)}}function uo(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function po(e){return{...e,attributes:Tn(e.attributes),links:e.links?.map(t=>({...t,attributes:Tn(t.attributes)}))}}function fo(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function lo(e){return typeof e.getSpanJSON=="function"}function Pt(e){let{traceFlags:t}=e.spanContext();return t===An}function qi(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function Qi(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}var ea="_sentryRootSpan";var de=tt;function tt(e){return e[ea]||e}function nt(){let e=M(),t=oe(e);return t.getActiveSpan?t.getActiveSpan():Ce(C())}function rt(){ao||(b(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),ao=!0)}var mo=!1;function go(){if(mo)return;function e(){let t=nt(),n=t&&de(t);if(n){let r="internal_error";g&&p.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}e.tag="sentry_tracingErrorCallback",mo=!0,Tr(e),Ir(e)}function _o(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||T()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function ho(e){p.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function vn(e,t){if(!t?.length)return!1;for(let n of t){if(na(n)){if(e.description&&Y(e.description,n))return g&&ho(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let o=n.name?e.description&&Y(e.description,n.name):!0,s=n.op?e.op&&Y(e.op,n.op):!0,i=n.attributes?Object.entries(n.attributes).every(([a,c])=>ta(e.attributes?.[a],c)):!0;if(o&&s&&i)return g&&ho(e),!0}return!1}function ta(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?Y(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function So(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let o of e)o.parent_span_id===r&&(o.parent_span_id=n)}function na(e){return typeof e=="string"||e instanceof RegExp}var Me="production";var ra="_frozenDsc";function Eo(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},o={environment:n.environment||Me,release:n.release,public_key:r,trace_id:e,org_id:ro(t)};return t.emit("createDsc",o),o}function Ut(e,t){let n=t.getPropagationContext();return n.dsc||Eo(n.traceId,e)}function Pe(e){let t=T();if(!t)return{};let n=de(e),r=Le(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[yn]??o[Yr];function a(h){return(typeof i=="number"||typeof i=="string")&&(h.sample_rate=`${i}`),h}let c=n[ra];if(c)return a(c);let u=s?.get("sentry.dsc"),l=u&&Ot(u);if(l)return a(l);let f=Eo(e.spanContext().traceId,t),d=o[F]??o["sentry.span.source"],m=r.description;return d!=="url"&&m&&(f.transaction=m),_o()&&(f.sampled=String(Pt(n)),f.sample_rand=s?.get("sentry.sample_rand")??Oe(n).scope?.getPropagationContext().sampleRand.toString()),a(f),t.emit("createDsc",f,n),f}function Ue(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}var oa=Symbol.for("sentry.skipNormalization"),sa=Symbol.for("sentry.overrideNormalizationDepth");function To(e){return!!e[oa]}function Io(e){let t=e[sa];return typeof t=="number"?t:void 0}function B(e,t=100,n=1/0){try{return On("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function Ln(e,t=3,n=100*1024){let r=B(e,t);return ua(r)>n?Ln(e,t-1,n):r}function On(e,t,n=1/0,r=1/0,o=pa()){let[s,i]=o;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let a=ia(e,t);if(!a.startsWith("[object "))return a;if(To(t))return t;let c=Io(t),u=c!==void 0?c:n;if(u===0)return a.replace("object ","");if(s(t))return"[Circular ~]";let l=t;if(l&&typeof l.toJSON=="function")try{let h=l.toJSON();return On("",h,u-1,r,o)}catch{}let f=Array.isArray(t)?[]:{},d=0,m=Nt(t);for(let h in m){if(!Object.prototype.hasOwnProperty.call(m,h))continue;if(d>=r){f[h]="[MaxProperties ~]";break}let S=m[h];f[h]=On(h,S,u-1,r,o),d++}return i(t),f}function ia(e,t){try{if(e==="domain"&&t&&typeof t=="object"&&t._events)return"[Domain]";if(e==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&t===global)return"[Global]";if(typeof window<"u"&&t===window)return"[Window]";if(typeof document<"u"&&t===document)return"[Document]";if(bt(t))return It(t);if(Ar(t))return"[SyntheticEvent]";if(typeof t=="number"&&!Number.isFinite(t))return`[${t}]`;if(typeof t=="function")return`[Function: ${Ye(t)}]`;if(typeof t=="symbol")return`[${String(t)}]`;if(typeof t=="bigint")return`[BigInt: ${String(t)}]`;let n=aa(t);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function aa(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function ca(e){return~-encodeURI(e).split(/%..|./).length}function ua(e){return ca(JSON.stringify(e))}function pa(){let e=new WeakSet;function t(r){return e.has(r)?!0:(e.add(r),!1)}function n(r){e.delete(r)}return[t,n]}function N(e,t=[]){return[e,t]}function Pn(e,t){let[n,r]=e;return[n,[...r,t]]}function ot(e,t){let n=e[1];for(let r of n){let o=r[0].type;if(t(r,o))return!0}return!1}function Un(e,t){return ot(e,(n,r)=>t.includes(r))}function Mn(e){let t=ee(_);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function st(e){let[t,n]=e,r=JSON.stringify(t);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[Mn(r),s]:r.push(typeof s=="string"?Mn(s):s)}for(let s of n){let[i,a]=s;if(o(`
|
|
6
6
|
${JSON.stringify(i)}
|
|
7
|
-
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(F(a))}o(c)}}return typeof r=="string"?r:na(r)}function na(e){let t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function Un(e){let t=typeof e.data=="string"?On(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var So={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 ra(e){return e in So}function Mt(e){return ra(e)?So[e]:e}function Ue(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Pn(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:O(r)},...o&&{trace:o}}}function sa(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function Eo(e,t,n,r){let o=Ue(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:O(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return N(s,[i])}function To(e,t,n,r){let o=Ue(n),s=e.type&&e.type!=="replay_event"?e.type:"event";sa(e,n?.sdk);let i=Pn(e,o,r,t);return delete e.sdkProcessingMetadata,N(i,[[{type:s},e]])}function Io(e){return e.getOptions().traceLifecycle==="stream"}var yo="__SENTRY_SUPPRESS_TRACING__";function Ut(e,t){let n=bo();return n.withActiveSpan?n.withActiveSpan(e,t):ue(r=>(Ze(r,e||void 0),t(r)))}function Pe(e){let t=bo();return t.suppressTracing?t.suppressTracing(e):ue(n=>{n.setSDKProcessingMetadata({[yo]:!0});let r=e();return n.setSDKProcessingMetadata({[yo]:void 0}),r})}function bo(){let e=M();return te(e)}function No(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;ia(e,t),r&&ua(e,r),pa(e,n),aa(e,o),ca(e,s)}function xo(e,t){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:f,eventProcessors:l,attachments:d,propagationContext:m,transactionName:h,span:S}=t;rt(e,"extra",n),rt(e,"tags",r),rt(e,"attributes",o),rt(e,"user",s),rt(e,"contexts",i),e.sdkProcessingMetadata=ee(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),S&&(e.span=S),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),f.length&&(e.fingerprint=[...e.fingerprint,...f]),l.length&&(e.eventProcessors=[...e.eventProcessors,...l]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function rt(e,t,n){e[t]=ee(e[t],n,1)}function Pt(e,t){let n=Rt().getScopeData();return e&&xo(n,e.getScopeData()),t&&xo(n,t.getScopeData()),n}function ia(e,t){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function aa(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function ca(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function ua(e,t){e.contexts={trace:vt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Le(t),...e.sdkProcessingMetadata};let n=pe(t),r=ve(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function pa(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Ro(e,t){let n=Rn(e),r=qe(e),o=Rn(r),{isolationScope:s,scope:i}=Ce(e),a=Pt(s,i);fa(n,o,t,a),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);let{beforeSendSpan:c}=t.getOptions(),u=c&&Me(c)?la(n,c):n,f=u.attributes?.[Ae];return f&&Ao(u,{"sentry.span.source":f}),{...co(u),_segmentSpan:r}}function fa(e,t,n,r){let o=n.getSdkMetadata(),{release:s,environment:i,sendDefaultPii:a}=n.getOptions();Ao(e,{[Hr]:s,[Wr]:i,[Yr]:t.name,[Vr]:t.span_id,[$r]:o?.sdk?.name,[jr]:o?.sdk?.version,...a?{[Zr]:r.user?.id,[zr]:r.user?.email,[Jr]:r.user?.ip_address,[Xr]:r.user?.username}:{},...r.attributes})}function la(e,t){let n=t(e);return n||(et(),e)}function Ao(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var kn=0,Co=1,vo=2;function z(e){return new kt(t=>{t(e)})}function ke(e){return new kt((t,n)=>{n(e)})}var kt=class e{constructor(t){this._state=kn,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===kn)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Co&&n[1](this._value),this._state===vo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(s,i)=>{if(this._state===kn){if(V(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Co,s)},o=s=>{n(vo,s)};try{t(r,o)}catch(s){o(s)}}};function Oo(e,t,n,r=0){try{let o=Dn(t,n,e,r);return V(o)?o:z(o)}catch(o){return ke(o)}}function Dn(e,t,n,r){let o=n[r];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&p.log(`Event processor "${o.id||"?"}" dropped event`),V(s)?s.then(i=>Dn(i,t,n,r+1)):Dn(s,t,n,r+1)}var fe,Lo,Mo,ne;function Uo(e){let t=_._sentryDebugIds,n=_._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(ne&&r.length===Lo&&o.length===Mo)return ne;Lo=r.length,Mo=o.length,ne={},fe||(fe={});let s=(i,a)=>{for(let c of i){let u=a[c],f=fe?.[c];if(f&&ne&&u)ne[f[0]]=u,fe&&(fe[c]=[f[0],u]);else if(u){let l=e(c);for(let d=l.length-1;d>=0;d--){let h=l[d]?.filename;if(h&&ne&&fe){ne[h]=u,fe[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),ne}function Po(e,t,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||I(),timestamp:t.timestamp||Z()},u=n.integrations||e.integrations.map(x=>x.name);da(c,e),_a(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&ma(c,e.stackParser);let f=Sa(r,n.captureContext);n.mechanism&&xe(c,n.mechanism);let l=o?o.getEventProcessors():[],d=Pt(s,f),m=[...n.attachments||[],...d.attachments];m.length&&(n.attachments=m),No(c,d);let h=[...l,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?z(c):Oo(h,c,n)).then(x=>(x&&ga(x),typeof i=="number"&&i>0?ha(x,i,a):x))}function da(e,t){let{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Oe,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=ye(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=ye(a.value,s))})}function ma(e,t){let n=Uo(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function ga(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function _a(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function ha(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:F(o.data,t,n)}}))},...e.user&&{user:F(e.user,t,n)},...e.contexts&&{contexts:F(e.contexts,t,n)},...e.extra&&{extra:F(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=F(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:F(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=F(e.contexts.flags,3,n)),r}function Sa(e,t){if(!t)return e;let n=e?e.clone():new v;return n.update(t),n}function ko(e){if(e)return Ea(e)?{captureContext:e}:Ia(e)?{captureContext:e}:e}function Ea(e){return e instanceof v||typeof e=="function"}var Ta=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Ia(e){return Object.keys(e).some(t=>Ta.includes(t))}function re(e,t){return C().captureException(e,ko(t))}function Dt(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return C().captureMessage(e,n,r)}function Ft(e){P().setTags(e)}function wt(e){P().setUser(e)}var ya="7";function ba(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function xa(e){return`${ba(e)}${e.projectId}/envelope/`}function Na(e,t){let n={sentry_version:ya};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Fo(e,t,n){return t||`${xa(e)}?${Na(e,n)}`}var Fn=[];function Ra(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function wn(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Ra(r)}function wo(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Gn(e,r,n)}),n}function Bn(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Gn(e,t,n){if(n[t.name]){g&&p.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Fn.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Fn.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),g&&p.log(`Integration installed: ${t.name}`)}function Bo(e,t){return t?ue(t,()=>{let n=Qe(),r=n?vt(n):Xe(t);return[n?Le(n):Lt(e,t),r]}):[void 0,void 0]}function Aa(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Go(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[Aa(e)])}function De(e,t){let n=t??Ca(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Go(n,r._metadata,r.tunnel,e.getDsn());Ho().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Ca(e){return Ho().get(e)}function Ho(){return k("clientToLogBufferMap",()=>new WeakMap)}function va(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function Wo(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[va(e)])}function Yo(e,t){let n=t??Oa(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Wo(n,r._metadata,r.tunnel,e.getDsn());Vo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Oa(e){return Vo().get(e)}function Vo(){return k("clientToMetricBufferMap",()=>new WeakMap)}function Fe(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var ot=Symbol.for("SentryBufferFullError");function we(e=100){let t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return ke(ot);let a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return z(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(u=>Fe(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var La=60*1e3;function Ma(e,t=Ie()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?La:r-t}function Ua(e,t){return e[t]||e.all||0}function $o(e,t,n=Ie()){return Ua(e,t)>n}function jo(e,{statusCode:t,headers:n},r=Ie()){let o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,f]=a.split(":",5),l=parseInt(c,10),d=(isNaN(l)?60:l)*1e3;if(!u)o.all=r+d;else for(let m of u.split(";"))m==="metric_bucket"?(!f||f.split(";").includes("custom"))&&(o[m]=r+d):o[m]=r+d}else i?o.all=r+Ma(i,r):t===429&&(o.all=r+60*1e3);return o}var st=64;function it(e,t,n=we(e.bufferSize||st)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(tt(i,(l,d)=>{let m=Mt(d);$o(r,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(l)}),a.length===0)return Promise.resolve({});let c=N(i[0],a),u=l=>{if(Mn(c,["client_report"])){g&&p.warn(`Dropping client report. Will not send outcomes (reason: ${l}).`);return}tt(c,(d,m)=>{e.recordDroppedEvent(l,Mt(m))})},f=()=>t({body:nt(c)}).then(l=>l.statusCode===413?(g&&p.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),l):(g&&l.statusCode!==void 0&&(l.statusCode<200||l.statusCode>=300)&&p.warn(`Sentry responded with status code ${l.statusCode} to sent event.`),r=jo(r,l),l),l=>{throw u("network_error"),g&&p.error("Encountered error running transport request:",l),l});return n.add(f).then(l=>l,l=>{if(l===ot)return g&&p.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw l})}return{send:s,flush:o}}function Zo(e,t,n){let r=[{type:"client_report"},{timestamp:n||Z(),discarded_events:e}];return N(t?{dsn:t}:{},[r])}function Bt(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function zo(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[yn],exclusive_time:i?.[bn],measurements:e.measurements,is_segment:!0}}function Jo(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[yn]:e.profile_id},...e.exclusive_time&&{[bn]:e.exclusive_time}}}},measurements:e.measurements}}var Xo="Not capturing exception because it's already been captured.",Ko="Discarded session because of missing or non-string release",rs=Symbol.for("SentryInternalError"),os=Symbol.for("SentryDoNotSendEventError"),Pa=5e3;function Gt(e){return{message:e,[rs]:!0}}function Hn(e){return{message:e,[os]:!0}}function qo(e){return!!e&&typeof e=="object"&&rs in e}function Qo(e){return!!e&&typeof e=="object"&&os in e}function es(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=Fe(setTimeout(()=>{o(e)},Pa)))}),e.on("flush",()=>{o(e)})}var Ht=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=we(t.transportOptions?.bufferSize??st),t.dsn?this._dsn=no(t.dsn):g&&p.warn("No DSN provided, client will not send events."),this._dsn){let r=Fo(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&es(this,"afterCaptureLog","flushLogs",wa,De),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&es(this,"afterCaptureMetric","flushMetrics",Fa,Yo)}captureException(t,n,r){let o=I();if(xt(t))return g&&p.log(Xo),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){let s={event_id:I(),...r},i=We(t)?t:String(t),a=he(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){let o=I();if(n?.originalException&&xt(n.originalException))return g&&p.log(Xo),o;let s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=ts(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),Ve(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(!n)return!0;this.emit("flush");let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){De(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Gn(this,t,this._integrations),n||Bn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=To(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=Ln(r,Un(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){let{release:n,environment:r=Oe}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!n){g&&p.warn(Ko);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){g&&p.warn(Ko);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=Eo(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;g&&p.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return g&&p.error("Error while sending envelope:",n),{}}return g&&p.error("Transport disabled"),{}}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=wo(this,t),Bn(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&r)&&(Ve(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){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(t,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Po(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Xe(r)},...a.contexts};let c=Lt(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=C(),o=P()){return g&&Wn(t)&&p.log(`Captured error event \`${Bt(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{g&&(Qo(s)?p.log(s.message):qo(s)?p.warn(s.message):p.warn(s))})}_processEvent(t,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=ss(t),c=Wn(t),f=`before send for type \`${t.type||"error"}\``,l=typeof i>"u"?void 0:Ke(i);if(c&&typeof l=="number"&&U()>l)return this.recordDroppedEvent("sample_rate","error"),ke(Hn(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let d=ts(t.type);return this._prepareEvent(t,n,r,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),Hn("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let S=Da(this,s,m,n);return ka(S,f)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",d),a){let x=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",x)}throw Hn(`${f} returned \`null\`, will not send event.`)}let h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,x=m.spans?m.spans.length:0,A=E-x;A>0&&this.recordDroppedEvent("before_send","span",A)}let S=m.transaction_info;if(a&&S&&m.transaction!==t.transaction){let E="custom";m.transaction_info={...S,source:E}}return this.sendEvent(m,n),m}).then(null,m=>{throw Qo(m)||qo(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),Gt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
-
Reason: ${m}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===
|
|
9
|
-
Event: ${
|
|
10
|
-
Event: ${
|
|
11
|
-
Event: ${
|
|
12
|
-
Event: ${
|
|
13
|
-
Url: ${
|
|
14
|
-
Event: ${
|
|
15
|
-
Url: ${Wt(e)}`),!0}return!1}function tc(e,t){return t?.length?Bt(e).some(n=>be(n,t)):!1}function nc(e,t){if(!t?.length)return!1;let n=e.transaction;return n?be(n,t):!1}function rc(e,t){if(!t?.length)return!1;let n=Wt(e);return n?be(n,t):!1}function oc(e,t){if(!t?.length)return!0;let n=Wt(e);return n?be(n,t):!0}function sc(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function Wt(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?sc(n):null}catch{return g&&p.error(`Cannot extract url for event ${Q(e)}`),null}}function ic(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Ss(e,t,n,r,o,s){if(!o.exception?.values||!s||!$(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=$n(e,t,r,s.originalException,n,o.exception.values,i,0))}function $n(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if($(r[o],Error)){_s(i,a,r);let u=e(t,r[o]),f=c.length;hs(u,o,f,a),c=$n(e,t,n,r[o],o,[u,...c],u,f)}return Es(r)&&r.errors.forEach((u,f)=>{if($(u,Error)){_s(i,a,r);let l=e(t,u),d=c.length;hs(l,`errors[${f}]`,d,a),c=$n(e,t,n,u,o,[l,...c],l,d)}}),c}function Es(e){return Array.isArray(e.errors)}function _s(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...Es(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function hs(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}var ac="cause",cc=5,uc="LinkedErrors",pc=((e={})=>{let t=e.limit||cc,n=e.key||ac;return{name:uc,preprocessEvent(r,o,s){let i=s.getOptions();Ss(Yn,i.stackParser,n,t,r,o)}}}),pt=pc;function Ts(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{t[s]=i}}n=o+1}return t}var jn=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function Is(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return jn.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?fc(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&lc(s))||null}function fc(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function lc(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var dc={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},mc="RequestData",gc=((e={})=>{let t={...dc,...e.include};return{name:mc,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...t,ip:t.ip??o.getOptions().sendDefaultPii};return i&&_c(n,i,{ipAddress:a},c),n}}}),ft=gc;function _c(e,t,n,r){if(e.request={...e.request,...hc(t,r)},r.ip){let o=t.headers&&Is(t.headers)||n.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function hc(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,t.ip||jn.forEach(o=>{delete r[o]})),n.method=e.method,t.url&&(n.url=e.url),t.cookies){let o=e.cookies||(r?.cookie?Ts(r.cookie):void 0);n.cookies=o||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function ys(e){let t="console";ae(t,e),Y(t,Sc)}function Sc(){"console"in _&&ie.forEach(function(e){e in _.console&&Ye(_.console,e,function(t){return D[e]=t,function(...n){B("console",{args:n,level:e}),D[e]?.apply(_.console,n)}})})}function bs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Ec=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Tc(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Ec.exec(t);return n?n.slice(1):[]}function Zn(e){let t=Tc(e),n=t[0]||"",r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var Ic="Console",zn=(e={})=>{let t=new Set(e.levels||ie);return{name:Ic,setup(n){ys(({args:r,level:o})=>{T()!==n||!t.has(o)||yc(o,r)})}}};function yc(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:bs(e),message:xs(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);n.message=r.length>0?`Assertion failed: ${xs(r)}`:"Assertion failed",n.data.arguments=r}else return;Vn(n,{input:t,level:e})}function xs(e){return"util"in _&&typeof _.util.format=="function"?_.util.format(...e):un(e," ")}function Ns(e,t,n){let r=n.getDsn(),o=n.getOptions().tunnel,s=Ue(n.getOptions()._metadata),i={sent_at:new Date().toISOString(),...bc(t)&&{trace:t},...s&&{sdk:s},...!!o&&r&&{dsn:O(r)}},a=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{items:e}];return N(i,[a])}function bc(e){return!!e.trace_id&&!!e.public_key}function Rs(e){let t=156;if(t+=e.name.length*2,t+=Sn(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?Sn(r):0);t+=o*e.links.length}return t}var As=1e3,xc=5e6,Yt=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=As?r:As,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:xc,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Fe(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=Rs(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(g&&p.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){g&&p.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=Le(o),i=r.map(c=>{let{_segmentSpan:u,...f}=c;return f}),a=Ns(i,s,this._client);g&&p.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&p.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};var Vt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!Io(e)){r.traceLifecycle="static",g&&p.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Me(o)){r.traceLifecycle="static",g&&p.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let s=new Yt(e);e.on("afterSpanEnd",i=>{Ot(i)&&s.add(Ro(i,e))})}});function Os(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function Ls(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,u,f,l;if(i[1]){u=i[1];let S=u.lastIndexOf(".");if(u[S-1]==="."&&S--,S>0){a=u.slice(0,S),c=u.slice(S+1);let E=a.indexOf(".Module");E>0&&(u=u.slice(E+1),a=a.slice(0,E))}f=void 0}c&&(f=a,l=c),c==="<anonymous>"&&(l=void 0,u=void 0),u===void 0&&(l=l||"?",u=f?`${f}.${l}`:l);let d=_r(i[2]),m=i[5]==="native";!d&&i[5]&&!m&&(d=i[5]);let h=d?Nc(d):void 0;return{filename:h??d,module:h&&e?.(h),function:u,lineno:Cs(i[3]),colno:Cs(i[4]),in_app:Os(d||"",m)}}if(o.match(t))return{filename:o}}}function Jn(e){return[90,Ls(e)]}function Cs(e){return parseInt(e||"",10)||void 0}function Nc(e){try{return decodeURI(e)}catch{return}}var oe=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};import{threadId as zc,isMainThread as Jc}from"worker_threads";var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Xc=6e4,$t=class extends at{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||Ms.hostname(),r={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};ct(r,"node-light",["node-core"]),p.log(`Initializing Sentry: process: ${process.pid}, thread: ${Jc?"main":`worker-${zc}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{De(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}async flush(t){return this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(t)}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{R&&p.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??Xc).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};import{execFile as Kc}from"node:child_process";import{readFile as qc,readdir as Qc}from"node:fs";import*as y from"node:os";import{join as eu}from"node:path";import{promisify as Ps}from"node:util";var tu=Ps(qc),nu=Ps(Qc),ru="Context",ou=((e={})=>{let t,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e};async function r(s){t===void 0&&(t=o());let i=su(await t);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await iu()),n.app&&(s.app=cu()),n.device&&(s.device=uu(n.device)),n.culture){let i=au();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=gu()),s}return{name:ru,processEvent(s){return r(s)}}}),Xn=ou;function su(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory=="function"){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=y.freemem()),e}async function iu(){let e=y.platform();switch(e){case"darwin":return du();case"linux":return mu();default:return{name:pu[e]||e,version:y.release()}}}function au(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function cu(){let e=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function uu(e){let t={},n;try{n=y.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=y.arch(),(e===!0||e.memory)&&(t.memory_size=y.totalmem(),t.free_memory=y.freemem()),e===!0||e.cpu){let r=y.cpus(),o=r?.[0];o&&(t.processor_count=r.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var pu={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},fu=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],lu={alpine:e=>e,arch:e=>G(/distrib_release=(.*)/,e),centos:e=>G(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>G(/release (..)/,e),mint:e=>G(/distrib_release=(.*)/,e),red:e=>G(/release ([^ ]+)/,e),suse:e=>G(/VERSION = (.*)\n/,e),ubuntu:e=>G(/distrib_release=(.*)/,e)};function G(e,t){let n=e.exec(t);return n?n[1]:void 0}async function du(){let e={kernel_version:y.release(),name:"Mac OS X",version:`10.${Number(y.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{Kc("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});e.name=G(/^ProductName:\s+(.*)$/m,t),e.version=G(/^ProductVersion:\s+(.*)$/m,t),e.build=G(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Us(e){return e.split(" ")[0].toLowerCase()}async function mu(){let e={kernel_version:y.release(),name:"Linux"};try{let t=await nu("/etc"),n=fu.find(a=>t.includes(a.name));if(!n)return e;let r=eu("/etc",n.name),o=(await tu(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;e.name=s.find(a=>o.indexOf(Us(a))>=0)||s[0];let i=Us(e.name);e.version=lu[i]?.(o)}catch{}return e}function gu(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as _u}from"node:fs";import{createInterface as hu}from"node:readline";var Kn=new oe(10),Fs=new oe(20),Su=7,Eu="ContextLines",Tu=1e3,Iu=1e4;function yu(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function bu(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function xu(e){return e.lineno!==void 0&&e.lineno>Iu||e.colno!==void 0&&e.colno>Tu}function Nu(e,t){let n=Kn.get(e);if(n===void 0)return!1;for(let r=t[0];r<=t[1];r++)if(n[r]===void 0)return!1;return!0}function Ru(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!="number")return[];let o=Ds(r,t),s=[];for(;;){if(n===e.length-1){s.push(o);break}let i=e[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=Ds(i,t)),n++}return s}function Au(e,t,n){return new Promise((r,o)=>{let s=_u(e),i=hu({input:s});function a(){s.destroy(),r()}let c=0,u=0,f=t[u];if(f===void 0){a();return}let l=f[0],d=f[1];function m(h){Fs.set(e,1),R&&p.error(`Failed to read file: ${e}. Error: ${h}`),i.close(),i.removeAllListeners(),a()}s.on("error",m),i.on("error",m),i.on("close",a),i.on("line",h=>{if(c++,!(c<l)&&(n[c]=cn(h,0),c>=d)){if(u===t.length-1){i.close(),i.removeAllListeners();return}u++;let S=t[u];if(S===void 0){i.close(),i.removeAllListeners();return}l=S[0],d=S[1]}})})}async function Cu(e,t){let n={};if(t>0&&e.exception?.values){for(let s of e.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||bu(c)||xu(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return e;let o=[];for(let s of r){if(Fs.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,f)=>u-f);let a=Ru(i,t);if(a.every(u=>Nu(s,u)))continue;let c=yu(Kn,s,{});o.push(Au(s,a,c))}if(await Promise.all(o).catch(()=>{R&&p.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let s of e.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&vu(s.stacktrace.frames,t,Kn);return e}function vu(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;Ou(r.lineno,r,t,o)}}function ks(e){delete e.pre_context,delete e.context_line,delete e.post_context}function Ou(e,t,n,r){if(t.lineno===void 0||r===void 0){R&&p.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=ws(e,n);s<e;s++){let i=r[s];if(i===void 0){ks(t),R&&p.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(r[e]===void 0){ks(t),R&&p.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let o=Bs(e,n);t.post_context=[];for(let s=e+1;s<=o;s++){let i=r[s];if(i===void 0)break;t.post_context.push(i)}}function ws(e,t){return Math.max(1,e-t)}function Bs(e,t){return e+t}function Ds(e,t){return[ws(e,t),Bs(e,t)]}var Lu=((e={})=>{let t=e.frameContextLines!==void 0?e.frameContextLines:Su;return{name:Eu,processEvent(n){return Cu(n,t)}}}),qn=Lu;var jt=dn(process.versions.node),Gs=jt.major,Xh=jt.minor;import{Worker as Mu}from"node:worker_threads";var Zt;async function zt(){if(Zt===void 0)try{Zt=!!(await import("node:inspector")).url()}catch{Zt=!1}return Zt}var lt="__SENTRY_ERROR_LOCAL_VARIABLES__";function Ws(e,t,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>e&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function Hs(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function Jt(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||Hs(e)&&Hs(t)}var Uu="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjUwLjAgKDc4NWU3NTYpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function Ys(...e){p.log("[LocalVariables]",...e)}var Vs=((e={})=>{function t(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,f=i[c],l=a[u];if(!l||!f)break;f.vars===void 0||l.in_app===!1&&e.includeOutOfAppFrames!==!0||!Jt(l.function,f.function)||(l.vars=f.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&< in i.originalException&&Array.isArray(i.originalException[lt])){for(let a of s.exception?.values||[])t(a,i.originalException[lt]);i.originalException[lt]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new Mu(new URL(`data:application/javascript;base64,${Uu}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{Ys("Worker error",a)}),i.once("exit",a=>{Ys("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await zt()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:p.isEnabled()};r().then(()=>{try{o(a)}catch(c){p.error("Failed to start worker",c)}},c=>{p.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function $s(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function Pu(e,t){if(t!==void 0)return $s(e(t,1))}function js(e){let t=[],n=!1;function r(i){t=[],!n&&(n=!0,e(i))}t.push(r);function o(i){t.push(i)}function s(i){let a=t.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var Qn=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("node:inspector");return new e(new n.Session)}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",r=>{t(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,r=>{let{add:o,next:s}=js(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(t,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(t,n,r,o){this._getProperties(t,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(t,n,r,o){this._getProperties(t,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(t,n,r){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?n[t.name]=`<${t.value.value}>`:n[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?n[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(n[t.name]="<undefined>")),r(n)}},ku="LocalVariables",Du=((e={},t)=>{let n=new oe(20),r,o=!1;function s(u){let f=$s(u.stacktrace?.frames);if(f===void 0)return;let l=n.remove(f);if(l===void 0)return;let d=(u.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<d.length;m++){let h=d.length-m-1,S=l[m],E=d[h];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!Jt(E.function,S.function)||(E.vars=S.vars)}}function i(u){for(let f of u.exception?.values||[])s(f);return u}let a;async function c(){let f=T()?.getOptions();if(!f?.includeLocalVariables)return;if(Gs<18){p.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await zt()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await Qn.create(t),m=(S,{params:{reason:E,data:x,callFrames:A}},W)=>{if(E!=="exception"&&E!=="promiseRejection"){W();return}r?.();let me=Pu(S,x.description);if(me==null){W();return}let{add:ge,next:se}=js(L=>{n.set(me,L),W()});for(let L=0;L<Math.min(A.length,5);L++){let{scopeChain:ai,functionName:cr,this:qt}=A[L],ur=ai.find(_e=>_e.type==="local"),pr=qt.className==="global"||!qt.className?cr:`${qt.className}.${cr}`;if(ur?.object.objectId===void 0)ge(_e=>{_e[L]={function:pr},se(_e)});else{let _e=ur.object.objectId;ge(fr=>d.getLocalVariables(_e,ci=>{fr[L]={function:pr,vars:ci},se(fr)}))}}se([])},h=e.captureAllExceptions!==!1;if(d.configureAndConnect((S,E)=>m(f.stackParser,S,E),h),h){let S=e.maxExceptionsPerSecond||50;r=Ws(S,()=>{p.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},E=>{p.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),d.setPauseOnExceptions(!1)})}o=!0}catch(d){p.log("The `LocalVariables` integration failed to start.",d)}}return{name:ku,setupOnce(){a=c()},async processEvent(u){return await a,o?i(u):u},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),Zs=Du;var er=(e={})=>jt.major<19?Zs(e):Vs(e);function zs(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}import{isMainThread as wu}from"worker_threads";var Fu=2e3;function dt(e){b(()=>{console.error(e)});let t=T();if(t===void 0){R&&p.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:Fu;t.close(r).then(o=>{o||R&&p.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{R&&p.error(o)})}var Bu="OnUncaughtException",tr=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:Bu,setup(n){wu&&global.process.on("uncaughtException",Gu(n,t))}}};function Gu(e,t){let r=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let u=dt;t.onFatalError?u=t.onFatalError:a.onFatalError&&(u=a.onFatalError);let l=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m.tag!=="sentry_tracingErrorCallback"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||l;r?d&&(s?(R&&p.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),dt(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,T()===e&&re(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&d&&(s=!0,u(c)))},{_errorHandler:!0})}var Hu="OnUnhandledRejection",Wu=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],Yu=((e={})=>{let t={mode:e.mode??"warn",ignore:[...Wu,...e.ignore??[]]};return{name:Hu,setup(n){global.process.on("unhandledRejection",Zu(n,t))}}}),nr=Yu;function Vu(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,n=typeof t.name=="string"?t.name:"",r=typeof t.message=="string"?t.message:String(e);return{name:n,message:r}}function $u(e,t){let n=e.name===void 0||j(t.name,e.name,!0),r=e.message===void 0||j(t.message,e.message);return n&&r}function ju(e,t){let n=Vu(t);return e.some(r=>$u(r,n))}function Zu(e,t){return function(r,o){if(T()!==e||ju(t.ignore??[],r))return;let s=t.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>Ut(i,c):c=>c())(()=>{re(r,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),zu(r,t.mode)}}function zu(e,t){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";t==="warn"?b(()=>{console.warn(n),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(b(()=>{console.warn(n)}),dt(e))}import*as Js from"node:http";var rr="Spotlight",Ju=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:rr,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&p.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}Xu(n,t)}}}),Xs=Ju;function Xu(e,t){let n=Ku(t.sidecarUrl);if(!n)return;let r=0;e.on("beforeEnvelope",o=>{if(r>3){p.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=nt(o);Pe(()=>{let i=Js.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,p.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function Ku(e){try{return new URL(`${e}`)}catch{p.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var or=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&Y("console",qu),zn(e).setup?.(t)}});function qu(){let e=_?.console;e&&ie.forEach(t=>{t in e&&Qu(e,t)})}function Qu(e,t){let n=e[t];D[t]=n;let r=n,o,s=!1,i=function(...c){if(s){n.apply(e,c);return}s=!0;try{B("console",{args:c,level:t}),r.apply(e,c)}finally{s=!1}};yt(i,n);let a=n.bind(e);D[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(u){u===i?(o!==void 0&&(r=o,o=void 0),c=i):u===a?(o=r,c=a):typeof u=="function"&&!u.__sentry_original__?(r=u,c=i):c=u}})}catch{Ye(e,t,function(c){return D[t]=c,function(...u){B("console",{args:u,level:t}),D[t]?.apply(this,u)}})}}import{posix as ep,sep as tp}from"node:path";function Ks(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function qs(e=process.argv[1]?Zn(process.argv[1]):process.cwd(),t=tp==="\\"){let n=t?Ks(e):e;return r=>{if(!r)return;let o=t?Ks(r):r,{dir:s,base:i,ext:a}=ep.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let f=s.slice(n.length+1).replace(/\//g,".");return f?`${f}:${c}`:c}return c}}function Qs(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(_.SENTRY_RELEASE?.id)return _.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||n||r||e}var ei=ht(Jn(qs()));import*as rp from"node:http";import*as op from"node:https";import{Readable as sp}from"node:stream";import{createGzip as ip}from"node:zlib";import*as J from"node:net";import*as ir from"node:tls";import*as sr from"node:http";var H=Symbol("AgentBaseInternalState"),Xt=class extends sr.Agent{constructor(t){super(t),this[H]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
16
|
-
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(t,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof
|
|
7
|
+
`),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(B(a))}o(c)}}return typeof r=="string"?r:fa(r)}function fa(e){let t=e.reduce((o,s)=>o+s.length,0),n=new Uint8Array(t),r=0;for(let o of e)n.set(o,r),r+=o.length;return n}function kn(e){let t=typeof e.data=="string"?Mn(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var yo={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 la(e){return e in yo}function kt(e){return la(e)?yo[e]:e}function ke(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function Dn(e,t,n,r){let o=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date().toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:O(r)},...o&&{trace:o}}}function ma(e,t){if(!t)return e;let n=e.sdk||{};return e.sdk={...n,name:n.name||t.name,version:n.version||t.version,integrations:[...e.sdk?.integrations||[],...t.integrations||[]],packages:[...e.sdk?.packages||[],...t.packages||[]],settings:e.sdk?.settings||t.settings?{...e.sdk?.settings,...t.settings}:void 0},e}function bo(e,t,n,r){let o=ke(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&t&&{dsn:O(t)}},i="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return N(s,[i])}function xo(e,t,n,r){let o=ke(n),s=e.type&&e.type!=="replay_event"?e.type:"event";ma(e,n?.sdk);let i=Dn(e,o,r,t);return delete e.sdkProcessingMetadata,N(i,[[{type:s},e]])}function No(e){return e.getOptions().traceLifecycle==="stream"}var Ro="__SENTRY_SUPPRESS_TRACING__";function Dt(e,t){let n=Ao();return n.withActiveSpan?n.withActiveSpan(e,t):le(r=>(Xe(r,e||void 0),t(r)))}function De(e){let t=Ao();return t.suppressTracing?t.suppressTracing(e):le(n=>{n.setSDKProcessingMetadata({[Ro]:!0});let r=e();return n.setSDKProcessingMetadata({[Ro]:void 0}),r})}function Ao(){let e=M();return oe(e)}function vo(e,t){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=t;ga(e,t),r&&Sa(e,r),Ea(e,n),_a(e,o),ha(e,s)}function Co(e,t){let{extra:n,tags:r,attributes:o,user:s,contexts:i,level:a,sdkProcessingMetadata:c,breadcrumbs:u,fingerprint:l,eventProcessors:f,attachments:d,propagationContext:m,transactionName:h,span:S}=t;it(e,"extra",n),it(e,"tags",r),it(e,"attributes",o),it(e,"user",s),it(e,"contexts",i),e.sdkProcessingMetadata=re(e.sdkProcessingMetadata,c,2),a&&(e.level=a),h&&(e.transactionName=h),S&&(e.span=S),u.length&&(e.breadcrumbs=[...e.breadcrumbs,...u]),l.length&&(e.fingerprint=[...e.fingerprint,...l]),f.length&&(e.eventProcessors=[...e.eventProcessors,...f]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function it(e,t,n){e[t]=re(e[t],n,1)}function Ft(e,t){let n=Ct().getScopeData();return e&&Co(n,e.getScopeData()),t&&Co(n,t.getScopeData()),n}function ga(e,t){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(o).length&&(e.user={...o,...e.user}),Object.keys(s).length&&(e.contexts={...s,...e.contexts}),i&&(e.level=i),a&&e.type!=="transaction"&&(e.transaction=a)}function _a(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function ha(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function Sa(e,t){e.contexts={trace:Mt(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:Pe(t),...e.sdkProcessingMetadata};let n=de(t),r=Le(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function Ea(e,t){e.fingerprint=e.fingerprint?Array.isArray(e.fingerprint)?e.fingerprint:[e.fingerprint]:[],t&&(e.fingerprint=e.fingerprint.concat(t)),e.fingerprint.length||delete e.fingerprint}function Oo(e,t){let n=Cn(e),r=tt(e),o=Cn(r),{isolationScope:s,scope:i}=Oe(e),a=Ft(s,i);Ta(n,o,t,a);let c=e.kind;xa(n,c),n.is_segment&&t.emit("processSegmentSpan",n),t.emit("processSpan",n);let{beforeSendSpan:u}=t.getOptions(),l=u&&Ue(u)?Ia(n,u):n,f=l.attributes?.[F];return f&&W(l,{"sentry.span.source":f}),{...po(l),_segmentSpan:r}}function Ta(e,t,n,r){let o=n.getSdkMetadata(),{release:s,environment:i,sendDefaultPii:a}=n.getOptions();W(e,{[Wr]:s,[Vr]:i,[$r]:t.name,[jr]:t.span_id,[zr]:o?.sdk?.name,[Zr]:o?.sdk?.version,...a?{[Jr]:r.user?.id,[Xr]:r.user?.email,[Kr]:r.user?.ip_address,[qr]:r.user?.username}:{},...r.attributes})}function Ia(e,t){let n=t(e);return n||(rt(),e)}function W(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,o])=>{o!=null&&!(r in n)&&(n[r]=o)})}var ya=1,ba=2;function xa(e,t){let n=e.attributes;if(!n)return;let r=n["http.request.method"]||n["http.method"];if(r){Na(e,n,t,r);return}let o=n["db.system.name"]||n["db.system"],s=typeof n[w]=="string"&&`${n[w]}`.startsWith("cache.");if(o&&!s){Ra(e,n);return}if(n["rpc.service"]){W(e,{[w]:"rpc"});return}if(n["messaging.system"]){W(e,{[w]:"message"});return}let i=n["faas.trigger"];i&&W(e,{[w]:`${i}`})}function Na(e,t,n,r){let o=["http"];n===ba?o.push("client"):n===ya&&o.push("server"),t["sentry.http.prefetch"]&&o.push("prefetch"),W(e,{[w]:o.join(".")});let s=t[vt];if(typeof s=="string"){e.name=s;return}if(t[F]==="custom")return;let i=t["http.route"];typeof i=="string"?(e.name=`${r} ${i}`,W(e,{[F]:"route"})):W(e,{[F]:"url"})}function Ra(e,t){W(e,{[w]:"db"});let n=t[vt];if(typeof n=="string"){e.name=n;return}if(t[F]==="custom")return;let r=t["db.statement"];r&&(e.name=`${r}`,W(e,{[F]:"task"}))}var Fn=0,Lo=1,Mo=2;function K(e){return new wt(t=>{t(e)})}function Fe(e){return new wt((t,n)=>{n(e)})}var wt=class e{constructor(t){this._state=Fn,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,o)=>{this._handlers.push([!1,s=>{if(!t)r(s);else try{r(t(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,t&&t()},i=>{s=!0,o=i,t&&t()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===Fn)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===Lo&&n[1](this._value),this._state===Mo&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(s,i)=>{if(this._state===Fn){if(Z(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(Lo,s)},o=s=>{n(Mo,s)};try{t(r,o)}catch(s){o(s)}}};function Po(e,t,n,r=0){try{let o=wn(t,n,e,r);return Z(o)?o:K(o)}catch(o){return Fe(o)}}function wn(e,t,n,r){let o=n[r];if(!e||!o)return e;let s=o({...e},t);return g&&s===null&&p.log(`Event processor "${o.id||"?"}" dropped event`),Z(s)?s.then(i=>wn(i,t,n,r+1)):wn(s,t,n,r+1)}var me,Uo,ko,se;function Do(e){let t=_._sentryDebugIds,n=_._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],o=n?Object.keys(n):[];if(se&&r.length===Uo&&o.length===ko)return se;Uo=r.length,ko=o.length,se={},me||(me={});let s=(i,a)=>{for(let c of i){let u=a[c],l=me?.[c];if(l&&se&&u)se[l[0]]=u,me&&(me[c]=[l[0],u]);else if(u){let f=e(c);for(let d=f.length-1;d>=0;d--){let h=f[d]?.filename;if(h&&se&&me){se[h]=u,me[c]=[h,u];break}}}}};return t&&s(r,t),n&&s(o,n),se}function Fo(e,t,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=e,c={...t,event_id:t.event_id||n.event_id||I(),timestamp:t.timestamp||X()},u=n.integrations||e.integrations.map(x=>x.name);Aa(c,e),Oa(c,u),o&&o.emit("applyFrameMetadata",t),t.type===void 0&&Ca(c,e.stackParser);let l=Ma(r,n.captureContext);n.mechanism&&Ae(c,n.mechanism);let f=o?o.getEventProcessors():[],d=Ft(s,l),m=[...n.attachments||[],...d.attachments];m.length&&(n.attachments=m),vo(c,d);let h=[...f,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?K(c):Po(h,c,n)).then(x=>(x&&va(x),typeof i=="number"&&i>0?La(x,i,a):x))}function Aa(e,t){let{environment:n,release:r,dist:o,maxValueLength:s}=t;e.environment=e.environment||n||Me,!e.release&&r&&(e.release=r),!e.dist&&o&&(e.dist=o);let i=e.request;i?.url&&s&&(i.url=Ne(i.url,s)),s&&e.exception?.values?.forEach(a=>{a.value&&(a.value=Ne(a.value,s))})}function Ca(e,t){let n=Do(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function va(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?t[o.abs_path]=o.debug_id:o.filename&&(t[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(t).length===0)return;e.debug_meta=e.debug_meta||{},e.debug_meta.images=e.debug_meta.images||[];let n=e.debug_meta.images;Object.entries(t).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Oa(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function La(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(o=>({...o,...o.data&&{data:B(o.data,t,n)}}))},...e.user&&{user:B(e.user,t,n)},...e.contexts&&{contexts:B(e.contexts,t,n)},...e.extra&&{extra:B(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=B(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(o=>({...o,...o.data&&{data:B(o.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=B(e.contexts.flags,3,n)),r}function Ma(e,t){if(!t)return e;let n=e?e.clone():new v;return n.update(t),n}function wo(e){if(e)return Pa(e)?{captureContext:e}:ka(e)?{captureContext:e}:e}function Pa(e){return e instanceof v||typeof e=="function"}var Ua=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function ka(e){return Object.keys(e).some(t=>Ua.includes(t))}function ie(e,t){return C().captureException(e,wo(t))}function Bt(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return C().captureMessage(e,n,r)}function Gt(e){U().setTags(e)}function Ht(e){U().setUser(e)}var Da="7";function Fa(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function wa(e){return`${Fa(e)}${e.projectId}/envelope/`}function Ba(e,t){let n={sentry_version:Da};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function Go(e,t,n){return t||`${wa(e)}?${Ba(e,n)}`}var Bn=[];function Ga(e){let t={};return e.forEach(n=>{let{name:r}=n,o=t[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Gn(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let o=n(t);r=Array.isArray(o)?o:[o]}else r=t;return Ga(r)}function Ho(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Yn(e,r,n)}),n}function Hn(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Yn(e,t,n){if(n[t.name]){g&&p.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!Bn.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),Bn.push(t.name)),t.setup&&typeof t.setup=="function"&&t.setup(e),typeof t.preprocessEvent=="function"){let r=t.preprocessEvent.bind(t);e.on("preprocessEvent",(o,s)=>r(o,s,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),o=Object.assign((s,i)=>r(s,i,e),{id:t.name});e.addEventProcessor(o)}["processSpan","processSegmentSpan"].forEach(r=>{let o=t[r];typeof o=="function"&&e.on(r,s=>o.call(t,s,e))}),g&&p.log(`Integration installed: ${t.name}`)}function Yo(e,t){return t?le(t,()=>{let n=nt(),r=n?Mt(n):Qe(t);return[n?Pe(n):Ut(e,t),r]}):[void 0,void 0]}function Ha(e){return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{items:e}]}function Wo(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[Ha(e)])}function we(e,t){let n=t??Ya(e)??[];if(n.length===0)return;let r=e.getOptions(),o=Wo(n,r._metadata,r.tunnel,e.getDsn());Vo().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(o)}function Ya(e){return Vo().get(e)}function Vo(){return k("clientToLogBufferMap",()=>new WeakMap)}function Wa(e){return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{items:e}]}function $o(e,t,n,r){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=O(r)),N(o,[Wa(e)])}function jo(e,t){let n=t??Va(e)??[];if(n.length===0)return;let r=e.getOptions(),o=$o(n,r._metadata,r.tunnel,e.getDsn());zo().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(o)}function Va(e){return zo().get(e)}function zo(){return k("clientToMetricBufferMap",()=>new WeakMap)}function Be(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}var at=Symbol.for("SentryBufferFullError");function Ge(e=100){let t=new Set;function n(){return t.size<e}function r(i){t.delete(i)}function o(i){if(!n())return Fe(at);let a=i();return t.add(a),a.then(()=>r(a),()=>r(a)),a}function s(i){if(!t.size)return K(!0);let a=Promise.allSettled(Array.from(t)).then(()=>!0);if(!i)return a;let c=[a,new Promise(u=>Be(setTimeout(()=>u(!1),i)))];return Promise.race(c)}return{get $(){return Array.from(t)},add:o,drain:s}}var $a=60*1e3;function ja(e,t=xe()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?$a:r-t}function za(e,t){return e[t]||e.all||0}function Zo(e,t,n=xe()){return za(e,t)>n}function Jo(e,{statusCode:t,headers:n},r=xe()){let o={...e},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,l]=a.split(":",5),f=parseInt(c,10),d=(isNaN(f)?60:f)*1e3;if(!u)o.all=r+d;else for(let m of u.split(";"))m==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(o[m]=r+d):o[m]=r+d}else i?o.all=r+ja(i,r):t===429&&(o.all=r+60*1e3);return o}var ct=64;function ut(e,t,n=Ge(e.bufferSize||ct)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(ot(i,(f,d)=>{let m=kt(d);Zo(r,m)?e.recordDroppedEvent("ratelimit_backoff",m):a.push(f)}),a.length===0)return Promise.resolve({});let c=N(i[0],a),u=f=>{if(Un(c,["client_report"])){g&&p.warn(`Dropping client report. Will not send outcomes (reason: ${f}).`);return}ot(c,(d,m)=>{e.recordDroppedEvent(f,kt(m))})},l=()=>t({body:st(c)}).then(f=>f.statusCode===413?(g&&p.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),u("send_error"),f):(g&&f.statusCode!==void 0&&(f.statusCode<200||f.statusCode>=300)&&p.warn(`Sentry responded with status code ${f.statusCode} to sent event.`),r=Jo(r,f),f),f=>{throw u("network_error"),g&&p.error("Encountered error running transport request:",f),f});return n.add(l).then(f=>f,f=>{if(f===at)return g&&p.error("Skipped sending event because buffer is full."),u("queue_overflow"),Promise.resolve({});throw f})}return{send:s,flush:o}}function Xo(e,t,n){let r=[{type:"client_report"},{timestamp:n||X(),discarded_events:e}];return N(t?{dsn:t}:{},[r])}function Yt(e){let t=[];e.message&&t.push(e.message);try{let n=e.exception.values[e.exception.values.length-1];n?.value&&(t.push(n.value),n.type&&t.push(`${n.type}: ${n.value}`))}catch{}return t}function Ko(e){let{trace_id:t,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=e.contexts?.trace??{};return{data:i??{},description:e.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:o,timestamp:e.timestamp,trace_id:t??"",origin:s,profile_id:i?.[xn],exclusive_time:i?.[Nn],measurements:e.measurements,is_segment:!0}}function qo(e){return{type:"transaction",timestamp:e.timestamp,start_timestamp:e.start_timestamp,transaction:e.description,contexts:{trace:{trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,op:e.op,status:e.status,origin:e.origin,data:{...e.data,...e.profile_id&&{[xn]:e.profile_id},...e.exclusive_time&&{[Nn]:e.exclusive_time}}}},measurements:e.measurements}}var Qo="Not capturing exception because it's already been captured.",es="Discarded session because of missing or non-string release",is=Symbol.for("SentryInternalError"),as=Symbol.for("SentryDoNotSendEventError"),Za=5e3;function Wt(e){return{message:e,[is]:!0}}function Wn(e){return{message:e,[as]:!0}}function ts(e){return!!e&&typeof e=="object"&&is in e}function ns(e){return!!e&&typeof e=="object"&&as in e}function rs(e,t,n,r,o){let s=0,i,a=!1;e.on(n,()=>{s=0,clearTimeout(i),a=!1}),e.on(t,c=>{s+=r(c),s>=8e5?o(e):a||(a=!0,i=Be(setTimeout(()=>{o(e)},Za)))}),e.on("flush",()=>{o(e)})}var Vt=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=Ge(t.transportOptions?.bufferSize??ct),t.dsn?this._dsn=oo(t.dsn):g&&p.warn("No DSN provided, client will not send events."),this._dsn){let r=Go(this._dsn,t.tunnel,t._metadata?t._metadata.sdk:void 0);this._transport=t.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...t.transportOptions,url:r})}this._options.enableLogs=this._options.enableLogs??this._options._experiments?.enableLogs,this._options.enableLogs&&rs(this,"afterCaptureLog","flushLogs",qa,we),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&rs(this,"afterCaptureMetric","flushMetrics",Ka,jo)}captureException(t,n,r){let o=I();if(Rt(t))return g&&p.log(Qo),o;let s={event_id:o,...n};return this._process(()=>this.eventFromException(t,s).then(i=>this._captureEvent(i,s,r)).then(i=>i),"error"),s.event_id}captureMessage(t,n,r,o){let s={event_id:I(),...r},i=$e(t)?t:String(t),a=Te(t),c=a?this.eventFromMessage(i,n,s):this.eventFromException(t,s);return this._process(()=>c.then(u=>this._captureEvent(u,s,o)),a?"unknown":"error"),s.event_id}captureEvent(t,n,r){let o=I();if(n?.originalException&&Rt(n.originalException))return g&&p.log(Qo),o;let s={event_id:o,...n},i=t.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope,u=os(t.type);return this._process(()=>this._captureEvent(t,s,a||r,c),u),s.event_id}captureSession(t){this.sendSession(t),ze(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(!n)return!0;this.emit("flush");let r=await this._isClientDoneProcessing(t),o=await n.flush(t);return r&&o}async close(t){we(this);let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Yn(this,t,this._integrations),n||Hn(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=xo(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])r=Pn(r,kn(o));this.sendEnvelope(r).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){let{release:n,environment:r=Me}=this._options;if("aggregates"in t){let s=t.attrs||{};if(!s.release&&!n){g&&p.warn(es);return}s.release=s.release||n,s.environment=s.environment||r,t.attrs=s}else{if(!t.release&&!n){g&&p.warn(es);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let o=bo(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let o=`${t}:${n}`;g&&p.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,o=(...s)=>n(...s);return r.add(o),()=>{r.delete(o)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(o=>o(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return g&&p.error("Error while sending envelope:",n),{}}return g&&p.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=Ho(this,t),Hn(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0,r=!1;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=t.status==="ok";(i&&t.errors===0||i&&r)&&(ze(t,{...r&&{status:"crashed"},errors:t.errors||Number(o||r)}),this.captureSession(t))}async _isClientDoneProcessing(t){let n=0;for(;!t||n<t;){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(t,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",t,n),t.type||o.setLastEventId(t.event_id||n.event_id),Fo(s,t,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:{...a.contexts?.trace,...Qe(r)},...a.contexts};let c=Ut(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(t,n={},r=C(),o=U()){return g&&Vn(t)&&p.log(`Captured error event \`${Yt(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,o).then(s=>s.event_id,s=>{g&&(ns(s)?p.log(s.message):ts(s)?p.warn(s.message):p.warn(s))})}_processEvent(t,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=cs(t),c=Vn(t),l=`before send for type \`${t.type||"error"}\``,f=typeof i>"u"?void 0:et(i);if(c&&typeof f=="number"&&P()>f)return this.recordDroppedEvent("sample_rate","error"),Fe(Wn(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let d=os(t.type);return this._prepareEvent(t,n,r,o).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),Wn("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let S=Xa(this,s,m,n);return Ja(S,l)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",d),a){let x=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",x)}throw Wn(`${l} returned \`null\`, will not send event.`)}let h=r.getSession()||o.getSession();if(c&&h&&this._updateSessionFromEvent(h,m),a){let E=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,x=m.spans?m.spans.length:0,A=E-x;A>0&&this.recordDroppedEvent("before_send","span",A)}let S=m.transaction_info;if(a&&S&&m.transaction!==t.transaction){let E="custom";m.transaction_info={...S,source:E}}return this.sendEvent(m,n),m}).then(null,m=>{throw ns(m)||ts(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),Wt(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
8
|
+
Reason: ${m}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===at&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){g&&p.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){g&&p.log("No outcomes to send");return}if(!this._dsn){g&&p.log("No dsn provided, will not send outcomes");return}g&&p.log("Sending outcomes:",t);let n=Xo(t,this._options.tunnel&&O(this._dsn));this.sendEnvelope(n)}};function os(e){return e==="replay_event"?"replay":e||"error"}function Ja(e,t){let n=`${t} must return \`null\` or a valid event.`;if(Z(e))return e.then(r=>{if(!te(r)&&r!==null)throw Wt(n);return r},r=>{throw Wt(`${t} rejected with ${r}`)});if(!te(e)&&e!==null)throw Wt(n);return e}function Xa(e,t,n,r){let{beforeSend:o,beforeSendTransaction:s,ignoreSpans:i}=t,a=!Ue(t.beforeSendSpan)&&t.beforeSendSpan,c=n;if(Vn(c)&&o)return o(c,r);if(cs(c)){if(a||i){let u=Ko(c);if(i?.length&&vn({description:u.description,op:u.op,attributes:u.data},i))return null;if(a){let l=a(u);l?c=re(n,qo(l)):rt()}if(c.spans){let l=[],f=c.spans;for(let m of f){if(i?.length&&vn({description:m.description,op:m.op,attributes:m.data},i)){So(f,m);continue}if(a){let h=a(m);h?l.push(h):(rt(),l.push(m))}else l.push(m)}let d=c.spans.length-l.length;d&&e.recordDroppedEvent("before_send","span",d),c.spans=l}}if(s){if(c.spans){let u=c.spans.length;c.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:u}}return s(c,r)}}return c}function Vn(e){return e.type===void 0}function cs(e){return e.type==="transaction"}function Ka(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+us(e.attributes)}function qa(e){let t=0;return e.message&&(t+=e.message.length*2),t+us(e.attributes)}function us(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*ss(n[0]):Te(n)?t+=ss(n):t+=100}),t}function ss(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function ps(e,t,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=O(o)),t&&(s.trace=t);let i=Qa(e);return N(s,[i])}function Qa(e){return[{type:"check_in"},e]}function fs(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}function ls(e,t){return e(t.stack||"",1)}function ec(e){return Ve(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function tc(e){return ec(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function $n(e,t){let n={type:t.name||t.constructor.name,value:tc(t)},r=ls(e,t);return r.length&&(n.stacktrace={frames:r}),n}function nc(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(n instanceof Error)return n}}function rc(e){if("name"in e&&typeof e.name=="string"){let r=`'${e.name}' captured as exception`;return"message"in e&&typeof e.message=="string"&&(r+=` with message '${e.message}'`),r}else if("message"in e&&typeof e.message=="string")return e.message;let t=pn(e);if(br(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=oc(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function oc(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function sc(e,t,n,r){if(Ve(n))return[n,void 0];if(t.synthetic=!0,te(n)){let s=e?.getOptions().normalizeDepth,i={__serialized__:Ln(n,s)},a=nc(n);if(a)return[a,i];let c=rc(n),u=r?.syntheticException||new Error(c);return u.message=c,[u,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function ds(e,t,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=sc(e,s,n,r),c={exception:{values:[$n(t,i)]}};return a&&(c.extra=a),gn(c,void 0,void 0),Ae(c,s),{...c,event_id:r?.event_id}}function ms(e,t,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=ls(e,r.syntheticException);i.length&&(s.exception={values:[{value:t,stacktrace:{frames:i}}]},Ae(s,{synthetic:!0}))}if($e(t)){let{__sentry_template_string__:i,__sentry_template_values__:a}=t;return s.logentry={message:i,params:a},s}return s.message=t,s}var pt=class e extends Vt{__init(){this._disposeCallbacks=[]}constructor(t){go(),fs(t),super(t),e.prototype.__init.call(this),this._setUpMetricsProcessing()}eventFromException(t,n){let r=ds(this,this._options.stackParser,t,n);return r.level="error",K(r)}eventFromMessage(t,n="info",r){return K(ms(this._options.stackParser,t,n,r,this._options.attachStacktrace))}captureException(t,n,r){return gs(n),super.captureException(t,n,r)}captureEvent(t,n,r){return!t.type&&t.exception?.values&&t.exception.values.length>0&&gs(n),super.captureEvent(t,n,r)}captureCheckIn(t,n,r){let o="checkInId"in t&&t.checkInId?t.checkInId:I();if(!this._isEnabled())return g&&p.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,u={check_in_id:o,monitor_slug:t.monitorSlug,status:t.status,release:i,environment:a};"duration"in t&&(u.duration=t.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[l,f]=Yo(this,r);f&&(u.contexts={trace:f});let d=ps(u,l,this.getSdkMetadata(),c,this.getDsn());return g&&p.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(d),o}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){g&&p.log("Disposing client...");for(let t of this._disposeCallbacks)try{t()}catch{}this._disposeCallbacks.length=0;for(let t of Object.keys(this._hooks))this._hooks[t]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=Ge(ct)}_prepareEvent(t,n,r,o){return this._options.platform&&(t.platform=t.platform||this._options.platform),this._options.runtime&&(t.contexts={...t.contexts,runtime:t.contexts?.runtime||this._options.runtime}),this._options.serverName&&(t.server_name=t.server_name||this._options.serverName),super._prepareEvent(t,n,r,o)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function gs(e){let t=U().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!=="crashed"?t.status="errored":n||(t.status="crashed")}}var ic=new Set(["false","f","n","no","off","0"]),ac=new Set(["true","t","y","yes","on","1"]);function ge(e,t){let n=String(e).toLowerCase();return ic.has(n)?!1:ac.has(n)?!0:t?.strict?null:!!e}function ft(e,t,n=[t],r="npm"){let o=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};o.name||(o.name=`sentry.javascript.${t}`,o.packages=n.map(s=>({name:`${r}:@sentry/${s}`,version:G})),o.version=G)}var cc=100;function jn(e,t){let n=T(),r=U();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=cc}=n.getOptions();if(s<=0)return;let a={timestamp:X(),...e},c=o?b(()=>o(a,t)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,t),r.addBreadcrumb(c,s))}var _s,uc="FunctionToString",hs=new WeakMap,pc=(()=>({name:uc,setupOnce(){_s=Function.prototype.toString;try{Function.prototype.toString=function(...e){let t=un(this),n=hs.has(T())&&t!==void 0?t:this;return _s.apply(n,e)}}catch{}},setup(e){hs.set(e,!0)}})),lt=pc;var fc=[/^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$/],lc="EventFilters",He=(e={})=>{let t;return{name:lc,setup(n){let r=n.getOptions();t=Ss(e,r)},processEvent(n,r,o){if(!t){let s=o.getOptions();t=Ss(e,s)}return mc(n,t)?null:n}}},dc=((e={})=>({...He(e),name:"InboundFilters"}));function Ss(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:fc],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function mc(e,t){if(e.type){if(e.type==="transaction"&&_c(e,t.ignoreTransactions))return g&&p.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
9
|
+
Event: ${ne(e)}`),!0}else{if(gc(e,t.ignoreErrors))return g&&p.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
10
|
+
Event: ${ne(e)}`),!0;if(Tc(e))return g&&p.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
11
|
+
Event: ${ne(e)}`),!0;if(hc(e,t.denyUrls))return g&&p.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
12
|
+
Event: ${ne(e)}.
|
|
13
|
+
Url: ${$t(e)}`),!0;if(!Sc(e,t.allowUrls))return g&&p.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
14
|
+
Event: ${ne(e)}.
|
|
15
|
+
Url: ${$t(e)}`),!0}return!1}function gc(e,t){return t?.length?Yt(e).some(n=>Re(n,t)):!1}function _c(e,t){if(!t?.length)return!1;let n=e.transaction;return n?Re(n,t):!1}function hc(e,t){if(!t?.length)return!1;let n=$t(e);return n?Re(n,t):!1}function Sc(e,t){if(!t?.length)return!0;let n=$t(e);return n?Re(n,t):!0}function Ec(e=[]){for(let t=e.length-1;t>=0;t--){let n=e[t];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function $t(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?Ec(n):null}catch{return g&&p.error(`Cannot extract url for event ${ne(e)}`),null}}function Tc(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function Is(e,t,n,r,o,s){if(!o.exception?.values||!s||!J(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=zn(e,t,r,s.originalException,n,o.exception.values,i,0))}function zn(e,t,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(J(r[o],Error)){Es(i,a,r);let u=e(t,r[o]),l=c.length;Ts(u,o,l,a),c=zn(e,t,n,r[o],o,[u,...c],u,l)}return ys(r)&&r.errors.forEach((u,l)=>{if(J(u,Error)){Es(i,a,r);let f=e(t,u),d=c.length;Ts(f,`errors[${l}]`,d,a),c=zn(e,t,n,u,o,[f,...c],f,d)}}),c}function ys(e){return Array.isArray(e.errors)}function Es(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...ys(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function Ts(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}var Ic="cause",yc=5,bc="LinkedErrors",xc=((e={})=>{let t=e.limit||yc,n=e.key||Ic;return{name:bc,preprocessEvent(r,o,s){let i=s.getOptions();Is($n,i.stackParser,n,t,r,o)}}}),dt=xc;function bs(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let o=e.indexOf(";",n);if(o===-1)o=e.length;else if(o<r){n=e.lastIndexOf(";",r-1)+1;continue}let s=e.slice(n,r).trim();if(t[s]===void 0){let i=e.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{t[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{t[s]=i}}n=o+1}return t}var Zn=["X-Client-IP","X-Forwarded-For","Fly-Client-IP","CF-Connecting-IP","Fastly-Client-Ip","True-Client-Ip","X-Real-IP","X-Cluster-Client-IP","X-Forwarded","Forwarded-For","Forwarded","X-Vercel-Forwarded-For"];function xs(e){let t={};for(let s of Object.keys(e))t[s.toLowerCase()]=e[s];return Zn.map(s=>{let i=t[s.toLowerCase()],a=Array.isArray(i)?i.join(";"):i;return s==="Forwarded"?Nc(a):a?.split(",").map(c=>c.trim())}).reduce((s,i)=>i?s.concat(i):s,[]).find(s=>s!==null&&Rc(s))||null}function Nc(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function Rc(e){return/(?:^(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}$)|(?:^(?:(?:[a-fA-F\d]{1,4}:){7}(?:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){6}(?:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|:[a-fA-F\d]{1,4}|:)|(?:[a-fA-F\d]{1,4}:){5}(?::(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,2}|:)|(?:[a-fA-F\d]{1,4}:){4}(?:(?::[a-fA-F\d]{1,4}){0,1}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,3}|:)|(?:[a-fA-F\d]{1,4}:){3}(?:(?::[a-fA-F\d]{1,4}){0,2}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,4}|:)|(?:[a-fA-F\d]{1,4}:){2}(?:(?::[a-fA-F\d]{1,4}){0,3}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,5}|:)|(?:[a-fA-F\d]{1,4}:){1}(?:(?::[a-fA-F\d]{1,4}){0,4}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,6}|:)|(?::(?:(?::[a-fA-F\d]{1,4}){0,5}:(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)(?:\\.(?:25[0-5]|2[0-4]\d|1\d\d|[1-9]\d|\d)){3}|(?::[a-fA-F\d]{1,4}){1,7}|:)))(?:%[0-9a-zA-Z]{1,})?$)/.test(e)}var Ac={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Cc="RequestData",vc=((e={})=>{let t={...Ac,...e.include};return{name:Cc,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...t,ip:t.ip??o.getOptions().sendDefaultPii};return i&&Oc(n,i,{ipAddress:a},c),n}}}),mt=vc;function Oc(e,t,n,r){if(e.request={...e.request,...Lc(t,r)},r.ip){let o=t.headers&&xs(t.headers)||n.ipAddress;o&&(e.user={...e.user,ip_address:o})}}function Lc(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){let o=new Set(Zn.map(s=>s.toLowerCase()));for(let s of Object.keys(r))o.has(s.toLowerCase())&&delete r[s]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){let o=e.cookies||(r?.cookie?bs(r.cookie):void 0);n.cookies=o||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function Ns(e){let t="console",n=pe(t,e);return z(t,Mc),n}function Mc(){"console"in _&&ue.forEach(function(e){e in _.console&&je(_.console,e,function(t){return D[e]=t,function(...n){H("console",{args:n,level:e}),D[e]?.apply(_.console,n)}})})}function Rs(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var Pc=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Uc(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=Pc.exec(t);return n?n.slice(1):[]}function Jn(e){let t=Uc(e),n=t[0]||"",r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var kc="Console",Xn=(e={})=>{let t=new Set(e.levels||ue);return{name:kc,setup(n){let r=Ns(({args:o,level:s})=>{T()!==n||!t.has(s)||Dc(s,o)});n.registerCleanup(r)}}};function Dc(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:Rs(e),message:As(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);n.message=r.length>0?`Assertion failed: ${As(r)}`:"Assertion failed",n.data.arguments=r}else return;jn(n,{input:t,level:e})}function As(e){return"util"in _&&typeof _.util.format=="function"?_.util.format(...e):ln(e," ")}function Cs(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function vs(){return!Cs()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function Os(){return typeof window<"u"&&(!vs()||Fc())}function Fc(){return _.process?.type==="renderer"}function Ls(e,t,n){let r=n.getOptions(),o=n.getDsn(),s=r.tunnel,i=ke(r._metadata),a={sent_at:new Date().toISOString(),...wc(t)&&{trace:t},...i&&{sdk:i},...!!s&&o&&{dsn:O(o)}},c=r.sendDefaultPii?"auto":"never",u=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...Os()&&{ingest_settings:{infer_ip:c,infer_user_agent:c}},items:e}];return N(a,[u])}function wc(e){return!!e.trace_id&&!!e.public_key}function Ms(e){let t=156;if(t+=e.name.length*2,t+=In(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,o=100+(r?In(r):0);t+=o*e.links.length}return t}var Ps=1e3,Bc=5e6,jt=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:o,maxTraceWeightInBytes:s}=n??{};this._maxSpanLimit=r&&r>0&&r<=Ps?r:Ps,this._flushInterval=o&&o>0?o:5e3,this._maxTraceWeight=s&&s>0?s:Bc,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(i=>{clearTimeout(i.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:Be(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=Ms(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(g&&p.log(`Flushing span tree map with ${this._traceBuckets.size} traces`),this._traceBuckets.forEach((t,n)=>{this.flush(n)}))}flush(t){let n=this._traceBuckets.get(t);if(!n)return;if(!n.spans.size){this._removeTrace(t);return}let r=Array.from(n.spans),o=r[0]?._segmentSpan;if(!o){g&&p.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let s=Pe(o),i=r.map(c=>{let{_segmentSpan:u,...l}=c;return l}),a=Ls(i,s,this._client);g&&p.log(`Sending span envelope for trace ${t} with ${i.length} spans`),this._client.sendEnvelope(a).then(null,c=>{g&&p.error("Error while sending streamed span envelope:",c)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};var zt=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!No(e)){r.traceLifecycle="static",g&&p.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let o=r.beforeSendSpan;if(o&&!Ue(o)){r.traceLifecycle="static",g&&p.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let s=new jt(e);e.on("afterSpanEnd",i=>{Pt(i)&&s.add(Oo(i,e))})}});function Ds(e,t=!1){return!(t||e&&!e.startsWith("/")&&!e.match(/^[A-Z]:/)&&!e.startsWith(".")&&!e.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&e!==void 0&&!e.includes("node_modules/")}function Fs(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return o=>{let s=o.match(r);if(s)return{filename:`<data:${s[2]}>`,function:s[1]};let i=o.match(n);if(i){let a,c,u,l,f;if(i[1]){u=i[1];let S=u.lastIndexOf(".");if(u[S-1]==="."&&S--,S>0){a=u.slice(0,S),c=u.slice(S+1);let E=a.indexOf(".Module");E>0&&(u=u.slice(E+1),a=a.slice(0,E))}l=void 0}c&&(l=a,f=c),c==="<anonymous>"&&(f=void 0,u=void 0),u===void 0&&(f=f||"?",u=l?`${l}.${f}`:f);let d=Sr(i[2]),m=i[5]==="native";!d&&i[5]&&!m&&(d=i[5]);let h=d?Gc(d):void 0;return{filename:h??d,module:h&&e?.(h),function:u,lineno:Us(i[3]),colno:Us(i[4]),in_app:Ds(d||"",m)}}if(o.match(t))return{filename:o}}}function Kn(e){return[90,Fs(e)]}function Us(e){return parseInt(e||"",10)||void 0}function Gc(e){try{return decodeURI(e)}catch{return}}var ae=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};import{threadId as uu,isMainThread as pu}from"worker_threads";var R=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var fu=6e4,Zt=class extends pt{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||ws.hostname(),r={...t,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};ft(r,"node-light",["node-core"]),p.log(`Initializing Sentry: process: ${process.pid}, thread: ${pu?"main":`worker-${uu}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{we(this)},n&&this.on("beforeCaptureLog",o=>{o.attributes={...o.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}async flush(t){return this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(t)}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{R&&p.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??fu).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}};import{execFile as lu}from"node:child_process";import{readFile as du,readdir as mu}from"node:fs";import*as y from"node:os";import{join as gu}from"node:path";import{promisify as Gs}from"node:util";var _u=Gs(du),hu=Gs(mu),Su="Context",Eu=((e={})=>{let t,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e};async function r(s){t===void 0&&(t=o());let i=Tu(await t);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await Iu()),n.app&&(s.app=bu()),n.device&&(s.device=xu(n.device)),n.culture){let i=yu();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=Ou()),s}return{name:Su,processEvent(s){return r(s)}}}),qn=Eu;function Tu(e){if(e.app?.app_memory&&(e.app.app_memory=process.memoryUsage().rss),e.app?.free_memory&&typeof process.availableMemory=="function"){let t=process.availableMemory?.();t!=null&&(e.app.free_memory=t)}return e.device?.free_memory&&(e.device.free_memory=y.freemem()),e}async function Iu(){let e=y.platform();switch(e){case"darwin":return Cu();case"linux":return vu();default:return{name:Nu[e]||e,version:y.release()}}}function yu(){try{if(typeof process.versions.icu!="string")return;let e=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(e)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function bu(){let e=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:e};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function xu(e){let t={},n;try{n=y.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=y.arch(),(e===!0||e.memory)&&(t.memory_size=y.totalmem(),t.free_memory=y.freemem()),e===!0||e.cpu){let r=y.cpus(),o=r?.[0];o&&(t.processor_count=r.length,t.cpu_description=o.model,t.processor_frequency=o.speed)}return t}var Nu={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},Ru=[{name:"fedora-release",distros:["Fedora"]},{name:"redhat-release",distros:["Red Hat Linux","Centos"]},{name:"redhat_version",distros:["Red Hat Linux"]},{name:"SuSE-release",distros:["SUSE Linux"]},{name:"lsb-release",distros:["Ubuntu Linux","Arch Linux"]},{name:"debian_version",distros:["Debian"]},{name:"debian_release",distros:["Debian"]},{name:"arch-release",distros:["Arch Linux"]},{name:"gentoo-release",distros:["Gentoo Linux"]},{name:"novell-release",distros:["SUSE Linux"]},{name:"alpine-release",distros:["Alpine Linux"]}],Au={alpine:e=>e,arch:e=>V(/distrib_release=(.*)/,e),centos:e=>V(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>V(/release (..)/,e),mint:e=>V(/distrib_release=(.*)/,e),red:e=>V(/release ([^ ]+)/,e),suse:e=>V(/VERSION = (.*)\n/,e),ubuntu:e=>V(/distrib_release=(.*)/,e)};function V(e,t){let n=e.exec(t);return n?n[1]:void 0}async function Cu(){let e={kernel_version:y.release(),name:"Mac OS X",version:`10.${Number(y.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{lu("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});e.name=V(/^ProductName:\s+(.*)$/m,t),e.version=V(/^ProductVersion:\s+(.*)$/m,t),e.build=V(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function Bs(e){return e.split(" ")[0].toLowerCase()}async function vu(){let e={kernel_version:y.release(),name:"Linux"};try{let t=await hu("/etc"),n=Ru.find(a=>t.includes(a.name));if(!n)return e;let r=gu("/etc",n.name),o=(await _u(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;e.name=s.find(a=>o.indexOf(Bs(a))>=0)||s[0];let i=Bs(e.name);e.version=Au[i]?.(o)}catch{}return e}function Ou(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as Lu}from"node:fs";import{createInterface as Mu}from"node:readline";var Qn=new ae(10),Ws=new ae(20),Pu=7,Uu="ContextLines",ku=1e3,Du=1e4;function Fu(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function wu(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function Bu(e){return e.lineno!==void 0&&e.lineno>Du||e.colno!==void 0&&e.colno>ku}function Gu(e,t){let n=Qn.get(e);if(n===void 0)return!1;for(let r=t[0];r<=t[1];r++)if(n[r]===void 0)return!1;return!0}function Hu(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!="number")return[];let o=Ys(r,t),s=[];for(;;){if(n===e.length-1){s.push(o);break}let i=e[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+t:(s.push(o),o=Ys(i,t)),n++}return s}function Yu(e,t,n){return new Promise((r,o)=>{let s=Lu(e),i=Mu({input:s});function a(){s.destroy(),r()}let c=0,u=0,l=t[u];if(l===void 0){a();return}let f=l[0],d=l[1];function m(h){Ws.set(e,1),R&&p.error(`Failed to read file: ${e}. Error: ${h}`),i.close(),i.removeAllListeners(),a()}s.on("error",m),i.on("error",m),i.on("close",a),i.on("line",h=>{if(c++,!(c<f)&&(n[c]=fn(h,0),c>=d)){if(u===t.length-1){i.close(),i.removeAllListeners();return}u++;let S=t[u];if(S===void 0){i.close(),i.removeAllListeners();return}f=S[0],d=S[1]}})})}async function Wu(e,t){let n={};if(t>0&&e.exception?.values){for(let s of e.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||wu(c)||Bu(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return e;let o=[];for(let s of r){if(Ws.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,l)=>u-l);let a=Hu(i,t);if(a.every(u=>Gu(s,u)))continue;let c=Fu(Qn,s,{});o.push(Yu(s,a,c))}if(await Promise.all(o).catch(()=>{R&&p.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let s of e.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&Vu(s.stacktrace.frames,t,Qn);return e}function Vu(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;$u(r.lineno,r,t,o)}}function Hs(e){delete e.pre_context,delete e.context_line,delete e.post_context}function $u(e,t,n,r){if(t.lineno===void 0||r===void 0){R&&p.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let s=Vs(e,n);s<e;s++){let i=r[s];if(i===void 0){Hs(t),R&&p.error(`Could not find line ${s} in file ${t.filename}`);return}t.pre_context.push(i)}if(r[e]===void 0){Hs(t),R&&p.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let o=$s(e,n);t.post_context=[];for(let s=e+1;s<=o;s++){let i=r[s];if(i===void 0)break;t.post_context.push(i)}}function Vs(e,t){return Math.max(1,e-t)}function $s(e,t){return e+t}function Ys(e,t){return[Vs(e,t),$s(e,t)]}var ju=((e={})=>{let t=e.frameContextLines!==void 0?e.frameContextLines:Pu;return{name:Uu,processEvent(n){return Wu(n,t)}}}),er=ju;var Jt=_n(process.versions.node),js=Jt.major,ES=Jt.minor;import{Worker as zu}from"node:worker_threads";var Xt;async function Kt(){if(Xt===void 0)try{Xt=!!(await import("node:inspector")).url()}catch{Xt=!1}return Xt}var gt="__SENTRY_ERROR_LOCAL_VARIABLES__";function Zs(e,t,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>e&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function zs(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function qt(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||zs(e)&&zs(t)}var Zu="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjUxLjAgKGRjMGI4MzkpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcHJvbWlzZXMiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIHR9ZnJvbSJub2RlOndvcmtlcl90aHJlYWRzIjtjb25zdCBuPWdsb2JhbFRoaXMsaT17fTtjb25zdCBvPSJfX1NFTlRSWV9FUlJPUl9MT0NBTF9WQVJJQUJMRVNfXyI7Y29uc3QgYT10O2Z1bmN0aW9uIHMoLi4uZSl7YS5kZWJ1ZyYmZnVuY3Rpb24oZSl7aWYoISgiY29uc29sZSJpbiBuKSlyZXR1cm4gZSgpO2NvbnN0IHQ9bi5jb25zb2xlLG89e30sYT1PYmplY3Qua2V5cyhpKTthLmZvckVhY2goZT0+e2NvbnN0IG49aVtlXTtvW2VdPXRbZV0sdFtlXT1ufSk7dHJ5e3JldHVybiBlKCl9ZmluYWxseXthLmZvckVhY2goZT0+e3RbZV09b1tlXX0pfX0oKCk9PmNvbnNvbGUubG9nKCJbTG9jYWxWYXJpYWJsZXMgV29ya2VyXSIsLi4uZSkpfWFzeW5jIGZ1bmN0aW9uIGMoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQuZmlsdGVyKGU9PiJsZW5ndGgiIT09ZS5uYW1lJiYhaXNOYU4ocGFyc2VJbnQoZS5uYW1lLDEwKSkpLnNvcnQoKGUsdCk9PnBhcnNlSW50KGUubmFtZSwxMCktcGFyc2VJbnQodC5uYW1lLDEwKSkubWFwKGU9PmUudmFsdWU/LnZhbHVlKX1hc3luYyBmdW5jdGlvbiByKGUsdCxuLGkpe2NvbnN0IG89YXdhaXQgZS5wb3N0KCJSdW50aW1lLmdldFByb3BlcnRpZXMiLHtvYmplY3RJZDp0LG93blByb3BlcnRpZXM6ITB9KTtpW25dPW8ucmVzdWx0Lm1hcChlPT5bZS5uYW1lLGUudmFsdWU/LnZhbHVlXSkucmVkdWNlKChlLFt0LG5dKT0+KGVbdF09bixlKSx7fSl9ZnVuY3Rpb24gdShlLHQpe2UudmFsdWUmJigidmFsdWUiaW4gZS52YWx1ZT92b2lkIDA9PT1lLnZhbHVlLnZhbHVlfHxudWxsPT09ZS52YWx1ZS52YWx1ZT90W2UubmFtZV09YDwke2UudmFsdWUudmFsdWV9PmA6dFtlLm5hbWVdPWUudmFsdWUudmFsdWU6ImRlc2NyaXB0aW9uImluIGUudmFsdWUmJiJmdW5jdGlvbiIhPT1lLnZhbHVlLnR5cGU/dFtlLm5hbWVdPWA8JHtlLnZhbHVlLmRlc2NyaXB0aW9ufT5gOiJ1bmRlZmluZWQiPT09ZS52YWx1ZS50eXBlJiYodFtlLm5hbWVdPSI8dW5kZWZpbmVkPiIpKX1hc3luYyBmdW5jdGlvbiBsKGUsdCl7Y29uc3Qgbj1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pLGk9e307Zm9yKGNvbnN0IHQgb2Ygbi5yZXN1bHQpaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJBcnJheSI9PT10LnZhbHVlLmNsYXNzTmFtZSl7Y29uc3Qgbj10LnZhbHVlLm9iamVjdElkO2F3YWl0IGMoZSxuLHQubmFtZSxpKX1lbHNlIGlmKHQudmFsdWU/Lm9iamVjdElkJiYiT2JqZWN0Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgcihlLG4sdC5uYW1lLGkpfWVsc2UgdC52YWx1ZSYmdSh0LGkpO3JldHVybiBpfWxldCBmOyhhc3luYyBmdW5jdGlvbigpe2NvbnN0IHQ9bmV3IGU7dC5jb25uZWN0VG9NYWluVGhyZWFkKCkscygiQ29ubmVjdGVkIHRvIG1haW4gdGhyZWFkIik7bGV0IG49ITE7dC5vbigiRGVidWdnZXIucmVzdW1lZCIsKCk9PntuPSExfSksdC5vbigiRGVidWdnZXIucGF1c2VkIixlPT57bj0hMCxhc3luYyBmdW5jdGlvbihlLHtyZWFzb246dCxkYXRhOntvYmplY3RJZDpufSxjYWxsRnJhbWVzOml9KXtpZigiZXhjZXB0aW9uIiE9PXQmJiJwcm9taXNlUmVqZWN0aW9uIiE9PXQpcmV0dXJuO2lmKGY/LigpLG51bGw9PW4pcmV0dXJuO2NvbnN0IGE9W107Zm9yKGxldCB0PTA7dDxpLmxlbmd0aDt0Kyspe2NvbnN0e3Njb3BlQ2hhaW46bixmdW5jdGlvbk5hbWU6byx0aGlzOnN9PWlbdF0sYz1uLmZpbmQoZT0+ImxvY2FsIj09PWUudHlwZSkscj0iZ2xvYmFsIiE9PXMuY2xhc3NOYW1lJiZzLmNsYXNzTmFtZT9gJHtzLmNsYXNzTmFtZX0uJHtvfWA6bztpZih2b2lkIDA9PT1jPy5vYmplY3Qub2JqZWN0SWQpYVt0XT17ZnVuY3Rpb246cn07ZWxzZXtjb25zdCBuPWF3YWl0IGwoZSxjLm9iamVjdC5vYmplY3RJZCk7YVt0XT17ZnVuY3Rpb246cix2YXJzOm59fX1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuY2FsbEZ1bmN0aW9uT24iLHtmdW5jdGlvbkRlY2xhcmF0aW9uOmBmdW5jdGlvbigpIHsgdGhpcy4ke299ID0gdGhpcy4ke299IHx8ICR7SlNPTi5zdHJpbmdpZnkoYSl9OyB9YCxzaWxlbnQ6ITAsb2JqZWN0SWQ6bn0pLGF3YWl0IGUucG9zdCgiUnVudGltZS5yZWxlYXNlT2JqZWN0Iix7b2JqZWN0SWQ6bn0pfSh0LGUucGFyYW1zKS50aGVuKGFzeW5jKCk9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSxhc3luYyBlPT57biYmYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5yZXN1bWUiKX0pfSksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5lbmFibGUiKTtjb25zdCBpPSExIT09YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function Js(...e){p.log("[LocalVariables]",...e)}var Xs=((e={})=>{function t(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,l=i[c],f=a[u];if(!f||!l)break;l.vars===void 0||f.in_app===!1&&e.includeOutOfAppFrames!==!0||!qt(f.function,l.function)||(f.vars=l.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&> in i.originalException&&Array.isArray(i.originalException[gt])){for(let a of s.exception?.values||[])t(a,i.originalException[gt]);i.originalException[gt]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new zu(new URL(`data:application/javascript;base64,${Zu}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{Js("Worker error",a)}),i.once("exit",a=>{Js("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await Kt()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...e,debug:p.isEnabled()};r().then(()=>{try{o(a)}catch(c){p.error("Failed to start worker",c)}},c=>{p.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function Ks(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function Ju(e,t){if(t!==void 0)return Ks(e(t,1))}function qs(e){let t=[],n=!1;function r(i){t=[],!n&&(n=!0,e(i))}t.push(r);function o(i){t.push(i)}function s(i){let a=t.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var tr=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("node:inspector");return new e(new n.Session)}configureAndConnect(t,n){this._session.connect(),this._session.on("Debugger.paused",r=>{t(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(t){this._session.post("Debugger.setPauseOnExceptions",{state:t?"all":"uncaught"})}getLocalVariables(t,n){this._getProperties(t,r=>{let{add:o,next:s}=qs(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(t,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(t,n,r,o){this._getProperties(t,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(t,n,r,o){this._getProperties(t,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(t,n,r){t.value&&("value"in t.value?t.value.value===void 0||t.value.value===null?n[t.name]=`<${t.value.value}>`:n[t.name]=t.value.value:"description"in t.value&&t.value.type!=="function"?n[t.name]=`<${t.value.description}>`:t.value.type==="undefined"&&(n[t.name]="<undefined>")),r(n)}},Xu="LocalVariables",Ku=((e={},t)=>{let n=new ae(20),r,o=!1;function s(u){let l=Ks(u.stacktrace?.frames);if(l===void 0)return;let f=n.remove(l);if(f===void 0)return;let d=(u.stacktrace?.frames||[]).filter(m=>m.function!=="new Promise");for(let m=0;m<d.length;m++){let h=d.length-m-1,S=f[m],E=d[h];if(!E||!S)break;S.vars===void 0||E.in_app===!1&&e.includeOutOfAppFrames!==!0||!qt(E.function,S.function)||(E.vars=S.vars)}}function i(u){for(let l of u.exception?.values||[])s(l);return u}let a;async function c(){let l=T()?.getOptions();if(!l?.includeLocalVariables)return;if(js<18){p.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await Kt()){p.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await tr.create(t),m=(S,{params:{reason:E,data:x,callFrames:A}},j)=>{if(E!=="exception"&&E!=="promiseRejection"){j();return}r?.();let he=Ju(S,x.description);if(he==null){j();return}let{add:Se,next:ce}=qs(L=>{n.set(he,L),j()});for(let L=0;L<Math.min(A.length,5);L++){let{scopeChain:di,functionName:pr,this:tn}=A[L],fr=di.find(Ee=>Ee.type==="local"),lr=tn.className==="global"||!tn.className?pr:`${tn.className}.${pr}`;if(fr?.object.objectId===void 0)Se(Ee=>{Ee[L]={function:lr},ce(Ee)});else{let Ee=fr.object.objectId;Se(dr=>d.getLocalVariables(Ee,mi=>{dr[L]={function:lr,vars:mi},ce(dr)}))}}ce([])},h=e.captureAllExceptions!==!1;if(d.configureAndConnect((S,E)=>m(l.stackParser,S,E),h),h){let S=e.maxExceptionsPerSecond||50;r=Zs(S,()=>{p.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},E=>{p.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${E} seconds.`),d.setPauseOnExceptions(!1)})}o=!0}catch(d){p.log("The `LocalVariables` integration failed to start.",d)}}return{name:Xu,setupOnce(){a=c()},async processEvent(u){return await a,o?i(u):u},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),Qs=Ku;var nr=(e={})=>Jt.major<19?Qs(e):Xs(e);function ei(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}import{isMainThread as Qu}from"worker_threads";var qu=2e3;function _t(e){b(()=>{console.error(e)});let t=T();if(t===void 0){R&&p.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=t.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:qu;t.close(r).then(o=>{o||R&&p.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{R&&p.error(o)})}var ep="OnUncaughtException",rr=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:ep,setup(n){Qu&&global.process.on("uncaughtException",tp(n,t))}}};function tp(e,t){let r=!1,o=!1,s=!1,i,a=e.getOptions();return Object.assign(c=>{let u=_t;t.onFatalError?u=t.onFatalError:a.onFatalError&&(u=a.onFatalError);let f=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m.tag!=="sentry_tracingErrorCallback"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||f;r?d&&(s?(R&&p.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),_t(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,T()===e&&ie(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!s&&d&&(s=!0,u(c)))},{_errorHandler:!0})}var np="OnUnhandledRejection",rp=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],op=((e={})=>{let t={mode:e.mode??"warn",ignore:[...rp,...e.ignore??[]]};return{name:np,setup(n){global.process.on("unhandledRejection",cp(n,t))}}}),or=op;function sp(e){if(typeof e!="object"||e===null)return{name:"",message:String(e??"")};let t=e,n=typeof t.name=="string"?t.name:"",r=typeof t.message=="string"?t.message:String(e);return{name:n,message:r}}function ip(e,t){let n=e.name===void 0||Y(t.name,e.name,!0),r=e.message===void 0||Y(t.message,e.message);return n&&r}function ap(e,t){let n=sp(t);return e.some(r=>ip(r,n))}function cp(e,t){return function(r,o){if(T()!==e||ap(t.ignore??[],r))return;let s=t.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>Dt(i,c):c=>c())(()=>{ie(r,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),up(r,t.mode)}}function up(e,t){let n="This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). The promise rejected with the reason:";t==="warn"?b(()=>{console.warn(n),console.error(e&&typeof e=="object"&&"stack"in e?e.stack:e)}):t==="strict"&&(b(()=>{console.warn(n)}),_t(e))}import*as ti from"node:http";var sr="Spotlight",pp=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:sr,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&p.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}fp(n,t)}}}),ni=pp;function fp(e,t){let n=lp(t.sidecarUrl);if(!n)return;let r=0;e.on("beforeEnvelope",o=>{if(r>3){p.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=st(o);De(()=>{let i=ti.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,p.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function lp(e){try{return new URL(`${e}`)}catch{p.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var ir=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&z("console",dp),Xn(e).setup?.(t)}});function dp(){let e=_?.console;e&&ue.forEach(t=>{t in e&&mp(e,t)})}function mp(e,t){let n=e[t];D[t]=n;let r=n,o,s=!1,i=function(...c){if(s){n.apply(e,c);return}s=!0;try{H("console",{args:c,level:t}),r.apply(e,c)}finally{s=!1}};xt(i,n);let a=n.bind(e);D[t]=a;try{let c=i;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return c},set(u){u===i?(o!==void 0&&(r=o,o=void 0),c=i):u===a?(o=r,c=a):typeof u=="function"&&!u.__sentry_original__?(r=u,c=i):c=u}})}catch{je(e,t,function(c){return D[t]=c,function(...u){H("console",{args:u,level:t}),D[t]?.apply(this,u)}})}}import{posix as gp,sep as _p}from"node:path";function ri(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function oi(e=process.argv[1]?Jn(process.argv[1]):process.cwd(),t=_p==="\\"){let n=t?ri(e):e;return r=>{if(!r)return;let o=t?ri(r):r,{dir:s,base:i,ext:a}=gp.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let l=s.slice(n.length+1).replace(/\//g,".");return l?`${l}:${c}`:c}return c}}function si(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(_.SENTRY_RELEASE?.id)return _.SENTRY_RELEASE.id;let t=process.env.GITHUB_SHA||process.env.CI_MERGE_REQUEST_SOURCE_BRANCH_SHA||process.env.CI_BUILD_REF||process.env.CI_COMMIT_SHA||process.env.BITBUCKET_COMMIT,n=process.env.APPVEYOR_PULL_REQUEST_HEAD_COMMIT||process.env.APPVEYOR_REPO_COMMIT||process.env.CODEBUILD_RESOLVED_SOURCE_VERSION||process.env.AWS_COMMIT_ID||process.env.BUILD_SOURCEVERSION||process.env.GIT_CLONE_COMMIT_HASH||process.env.BUDDY_EXECUTION_REVISION||process.env.BUILDKITE_COMMIT||process.env.CIRCLE_SHA1||process.env.CIRRUS_CHANGE_IN_REPO||process.env.CF_REVISION||process.env.CM_COMMIT||process.env.CF_PAGES_COMMIT_SHA||process.env.DRONE_COMMIT_SHA||process.env.FC_GIT_COMMIT_SHA||process.env.HEROKU_TEST_RUN_COMMIT_VERSION||process.env.HEROKU_BUILD_COMMIT||process.env.HEROKU_SLUG_COMMIT||process.env.RAILWAY_GIT_COMMIT_SHA||process.env.RENDER_GIT_COMMIT||process.env.SEMAPHORE_GIT_SHA||process.env.TRAVIS_PULL_REQUEST_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.VERCEL_GITHUB_COMMIT_SHA||process.env.VERCEL_GITLAB_COMMIT_SHA||process.env.VERCEL_BITBUCKET_COMMIT_SHA||process.env.ZEIT_GITHUB_COMMIT_SHA||process.env.ZEIT_GITLAB_COMMIT_SHA||process.env.ZEIT_BITBUCKET_COMMIT_SHA,r=process.env.CI_COMMIT_ID||process.env.SOURCE_COMMIT||process.env.SOURCE_VERSION||process.env.GIT_COMMIT||process.env.COMMIT_REF||process.env.BUILD_VCS_NUMBER||process.env.CI_COMMIT_SHA;return t||n||r||e}var ii=Tt(Kn(oi()));import*as Sp from"node:http";import*as Ep from"node:https";import{Readable as Tp}from"node:stream";import{createGzip as Ip}from"node:zlib";import*as q from"node:net";import*as cr from"node:tls";import*as ar from"node:http";var $=Symbol("AgentBaseInternalState"),Qt=class extends ar.Agent{constructor(t){super(t),this[$]={}}isSecureEndpoint(t){if(t){if(typeof t.secureEndpoint=="boolean")return t.secureEndpoint;if(typeof t.protocol=="string")return t.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
|
|
16
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(t,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,o)).then(s=>{if(s instanceof ar.Agent)return s.addRequest(t,o);this[$].currentSocket=s,super.createSocket(t,n,r)},r)}createConnection(){let t=this[$].currentSocket;if(this[$].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[$].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[$]&&(this[$].defaultPort=t)}get protocol(){return this[$].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[$]&&(this[$].protocol=t)}};function en(...e){p.log("[https-proxy-agent:parse-proxy-response]",...e)}function ai(e){return new Promise((t,n)=>{let r=0,o=[];function s(){let l=e.read();l?u(l):e.once("readable",s)}function i(){e.removeListener("end",a),e.removeListener("error",c),e.removeListener("readable",s)}function a(){i(),en("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){i(),en("onerror %o",l),n(l)}function u(l){o.push(l),r+=l.length;let f=Buffer.concat(o,r),d=f.indexOf(`\r
|
|
17
17
|
\r
|
|
18
|
-
`);if(d===-1){
|
|
19
|
-
`),h=m.shift();if(!h)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let S=h.split(" "),E=+(S[1]||0),x=S.slice(2).join(" "),A={};for(let
|
|
18
|
+
`);if(d===-1){en("have not received end of HTTP headers yet..."),s();return}let m=f.subarray(0,d).toString("ascii").split(`\r
|
|
19
|
+
`),h=m.shift();if(!h)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let S=h.split(" "),E=+(S[1]||0),x=S.slice(2).join(" "),A={};for(let j of m){if(!j)continue;let he=j.indexOf(":");if(he===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${j}"`));let Se=j.slice(0,he).toLowerCase(),ce=j.slice(he+1).trimStart(),L=A[Se];typeof L=="string"?A[Se]=[L,ce]:Array.isArray(L)?L.push(ce):A[Se]=ce}en("got proxy server response: %o %o",h,A),i(),t({connect:{statusCode:E,statusText:x,headers:A},buffered:f})}e.on("error",c),e.on("end",a),s()})}function ht(...e){p.log("[https-proxy-agent]",...e)}var St=class extends Qt{static __initStatic(){this.protocols=["http","https"]}constructor(t,n){super(n),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=n?.headers??{},ht("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?ci(n,"headers"):null,host:r,port:o}}async connect(t,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){ht("Creating `tls.Socket`: %o",this.connectOpts);let d=this.connectOpts.servername||this.connectOpts.host;o=cr.connect({...this.connectOpts,servername:d&&q.isIP(d)?void 0:d})}else ht("Creating `net.Socket`: %o",this.connectOpts),o=q.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=q.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
|
|
20
20
|
`;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}s.Host=`${i}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(s))a+=`${d}: ${s[d]}\r
|
|
21
|
-
`;let c=
|
|
22
|
-
`);let{connect:u,buffered:
|
|
21
|
+
`;let c=ai(o);o.write(`${a}\r
|
|
22
|
+
`);let{connect:u,buffered:l}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),u.statusCode===200){if(t.once("socket",hp),n.secureEndpoint){ht("Upgrading socket connection to TLS");let d=n.servername||n.host;return cr.connect({...ci(n,"host","path","port"),socket:o,servername:q.isIP(d)?void 0:d})}return o}o.destroy();let f=new q.Socket({writable:!1});return f.readable=!0,t.once("socket",d=>{ht("Replaying proxy buffer for failed request"),d.push(l),d.push(null)}),f}};St.__initStatic();function hp(e){e.resume()}function ci(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var yp=1024*32;function bp(e){return new Tp({read(){this.push(e),this.push(null)}})}function ui(e){let t;try{t=new URL(e.url)}catch{return b(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),ut(e,()=>Promise.resolve({}))}let n=t.protocol==="https:",r=xp(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?Ep:Sp,s=e.keepAlive===void 0?!1:e.keepAlive,i=r?new St(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=Np(e,e.httpModule??o,i);return ut(e,a)}function xp(e,t){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>e.host.endsWith(o)||e.hostname.endsWith(o)))return t}function Np(e,t,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(e.url);return function(u){return new Promise((l,f)=>{De(()=>{let d=bp(u.body),m={...e.headers};u.body.length>yp&&(m["content-encoding"]="gzip",d=d.pipe(Ip()));let h=r.startsWith("["),S=t.request({method:"POST",agent:n,headers:m,hostname:h?r.slice(1,-1):r,path:`${o}${a}`,port:s,protocol:i,ca:e.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let x=E.headers["retry-after"]??null,A=E.headers["x-sentry-rate-limits"]??null;l({statusCode:E.statusCode,headers:{"retry-after":x,"x-sentry-rate-limits":Array.isArray(A)?A[0]||null:A}})});S.on("error",f),d.pipe(S)})})}}function pi(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=ge(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}import{AsyncLocalStorage as Rp}from"node:async_hooks";function fi(){let e=new Rp;function t(){let a=e.getStore();return a||{scope:Ke(),isolationScope:qe()}}function n(a){let c=t().scope.clone(),u=t().isolationScope;return e.run({scope:c,isolationScope:u},()=>a(c))}function r(a,c){let u=t().isolationScope.clone();return e.run({scope:a,isolationScope:u},()=>c(a))}function o(a){let c=t().scope.clone(),u=t().isolationScope.clone();return e.run({scope:c,isolationScope:u},()=>a(u))}function s(a,c){let u=t().scope.clone();return e.run({scope:u,isolationScope:a},()=>c(a))}function i(a){return n(c=>(c.setSDKProcessingMetadata({__SENTRY_SUPPRESS_TRACING__:!0}),a()))}En({suppressTracing:i,withScope:n,withSetScope:r,withIsolationScope:o,withSetIsolationScope:s,getCurrentScope:()=>t().scope,getIsolationScope:()=>t().isolationScope})}function ur(e={}){return Ap(e,()=>[])}function Ap(e={},t){let n=Cp(e,t);n.debug===!0&&(R?p.enable():b(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),fi(),C().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===sr)&&n.integrations.push(ni({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),ft(n,"node-light",["node-core"]);let o=new Zt(n);return C().setClient(o),o.init(),p.log(`SDK initialized from ${ei()?"CommonJS":"ESM"} (light mode)`),o.startClientReportTracking(),Lp(),process.env.VERCEL&&process.on("SIGTERM",async()=>{await o.flush(200)}),o}function Cp(e,t){let n=vp(e.release),r=pi(e.spotlight),o=Op(e.tracesSampleRate),s={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??ui,stackParser:sn(e.stackParser||ii),release:n,tracesSampleRate:o,spotlight:r,debug:ge(e.debug??process.env.SENTRY_DEBUG)},i=e.integrations,a=e.defaultIntegrations??t(s),c=Gn({defaultIntegrations:a,integrations:i});return s.traceLifecycle==="stream"&&!c.some(u=>u.name==="SpanStreaming")&&c.push(zt()),{...s,integrations:c}}function vp(e){if(e!==void 0)return e;let t=si();if(t!==void 0)return t}function Op(e){if(e!==void 0)return e;let t=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!t)return;let n=parseFloat(t);return isFinite(n)?n:void 0}function Lp(){if(ge(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=Rn(e,t);C().setPropagationContext(n)}}import Q from"homey";process.env.HOME||(process.env.HOME=Pp.tmpdir());var li=class e{_capturedMessages=[];_capturedExceptions=[];constructor({homey:t,options:n}){if(typeof t>"u")return e._error("Error: missing `homey` constructor parameter");if(!Q.env)return e._error("Error: could not access `Homey.env`");if(typeof Q.env.HOMEY_LOG_URL!="string")return e._error("Error: expected `HOMEY_LOG_URL` env variable, homey-log is disabled");let r=process.env.DEBUG==="1"&&!e._isLogForced();r&&e._log("App is running in debug mode, not enabling Sentry logging");let o;typeof Q.env.HOMEY_LOG_SENTRY_PROJECT=="string"&&Q.env.HOMEY_LOG_SENTRY_PROJECT.length>0&&(o=`${Q.env.HOMEY_LOG_SENTRY_PROJECT}@${Q.manifest.version}`),this._manifest=Q.manifest,this._homeyVersion=t.version,this._managerCloud=t.cloud,this._homeyPlatform=t.platform,this._homeyPlatformVersion=t.platformVersion,this.init(Q.env.HOMEY_LOG_URL,{enabled:!r,release:o,...n})}init(t,n){return ur({dsn:t,integrations:[He(),lt(),dt(),mt(),ir(),rr(),or(),er(),nr(),qn({app:!1,cloudResource:!1})],maxBreadcrumbs:5,enableMetrics:!1,...n}),this.setTags({appId:this._manifest.id,appVersion:this._manifest.version,homeyVersion:this._homeyVersion,homeyPlatform:this._homeyPlatform,homeyPlatformVersion:this._homeyPlatformVersion}),this._managerCloud.getHomeyId().then(r=>this.setTags({homeyId:r})).catch(r=>e._error("Error: could not get `homeyId`",r)),e._log(`App ${this._manifest.id} v${this._manifest.version} logging on Homey v${this._homeyVersion}...`),this}setTags(t){return Gt(t),this}setUser(t){return Ht(t),this}async captureMessage(t){if(e._log("captureMessage:",t),this._capturedMessages.indexOf(t)>-1){e._log("Prevented sending a duplicate message");return}return this._capturedMessages.push(t),new Promise((n,r)=>{try{n(Bt(t))}catch(o){r(o)}})}async captureException(t){if(e._log("captureException:",t),this._capturedExceptions.indexOf(t)>-1){e._log("Prevented sending a duplicate log");return}return this._capturedExceptions.push(t),new Promise((n,r)=>{try{n(ie(t))}catch(o){r(o)}})}static _log(){console.log.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _error(){console.error.bind(null,e._logTime(),"[homey-log]").apply(null,arguments)}static _logTime(){return`\x1B[35m${new Date().toISOString()}\x1B[0m`}static _isLogForced(){switch(Q.env.HOMEY_LOG_FORCE){case"1":case"true":return!0;default:return!1}}};export{li as Log};
|