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