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