/*! @sentry/node 8.38.0 (396e2f9) | https://github.com/getsentry/sentry-javascript */ import{Session as t}from"node:inspector";import{parentPort as n,workerData as e}from"node:worker_threads";import{posix as r,sep as o}from"node:path";import*as s from"node:http";import*as i from"node:https";import{Readable as c}from"node:stream";import{createGzip as u}from"node:zlib";import*as a from"node:net";import*as f from"node:tls";const h=Object.prototype.toString;function p(t,n){return h.call(t)===`[object ${n}]`}function l(t){return p(t,"String")}function d(t){return p(t,"Object")}function m(t){return Boolean(t&&t.then&&"function"==typeof t.then)}function y(t,n){try{return t instanceof n}catch(t){return!1}}const g="8.38.0",b=globalThis;function _(t,n,e){const r=b,o=r.__SENTRY__=r.__SENTRY__||{},s=o[g]=o[g]||{};return s[t]||(s[t]=n())}const v=b,w=80;function S(t,n){const e=t,r=[];if(!e||!e.tagName)return"";if(v.HTMLElement&&e instanceof HTMLElement&&e.dataset){if(e.dataset.sentryComponent)return e.dataset.sentryComponent;if(e.dataset.sentryElement)return e.dataset.sentryElement}r.push(e.tagName.toLowerCase());const o=n&&n.length?n.filter((t=>e.getAttribute(t))).map((t=>[t,e.getAttribute(t)])):null;if(o&&o.length)o.forEach((t=>{r.push(`[${t[0]}="${t[1]}"]`)}));else{e.id&&r.push(`#${e.id}`);const t=e.className;if(t&&l(t)){const n=t.split(/\s+/);for(const t of n)r.push(`.${t}`)}}const s=["aria-label","type","name","title","alt"];for(const t of s){const n=e.getAttribute(t);n&&r.push(`[${t}="${n}"]`)}return r.join("")}const $="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__,E=["debug","info","warn","error","log","assert","trace"],x={};function N(t){if(!("console"in b))return t();const n=b.console,e={},r=Object.keys(x);r.forEach((t=>{const r=x[t];e[t]=n[t],n[t]=r}));try{return t()}finally{r.forEach((t=>{n[t]=e[t]}))}}const C=_("logger",(function(){let t=!1;const n={enable:()=>{t=!0},disable:()=>{t=!1},isEnabled:()=>t};return $?E.forEach((e=>{n[e]=(...n)=>{t&&N((()=>{b.console[e](`Sentry Logger [${e}]:`,...n)}))}})):E.forEach((t=>{n[t]=()=>{}})),n}));function T(t,n=!1){const{host:e,path:r,pass:o,port:s,projectId:i,protocol:c,publicKey:u}=t;return`${c}://${u}${n&&o?`:${o}`:""}@${e}${s?`:${s}`:""}/${r?`${r}/`:r}${i}`}class k extends Error{constructor(t,n="warn"){super(t),this.message=t,this.name=new.target.prototype.constructor.name,Object.setPrototypeOf(this,new.target.prototype),this.logLevel=n}}function R(t){if(function(t){switch(h.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return y(t,Error)}}(t))return{message:t.message,name:t.name,stack:t.stack,...D(t)};if(n=t,"undefined"!=typeof Event&&y(n,Event)){const n={type:t.type,target:j(t.target),currentTarget:j(t.currentTarget),...D(t)};return"undefined"!=typeof CustomEvent&&y(t,CustomEvent)&&(n.detail=t.detail),n}return t;var n}function j(t){try{return n=t,"undefined"!=typeof Element&&y(n,Element)?function(t,n={}){if(!t)return"";try{let e=t;const r=5,o=[];let s=0,i=0;const c=" > ",u=c.length;let a;const f=Array.isArray(n)?n:n.keyAttrs,h=!Array.isArray(n)&&n.maxStringLength||w;for(;e&&s++1&&i+o.length*u+a.length>=h));)o.push(a),i+=a.length,e=e.parentNode;return o.reverse().join(c)}catch(t){return""}}(t):Object.prototype.toString.call(t)}catch(t){return""}var n}function D(t){if("object"==typeof t&&null!==t){const n={};for(const e in t)Object.prototype.hasOwnProperty.call(t,e)&&(n[e]=t[e]);return n}return{}}function O(t){return A(t,new Map)}function A(t,n){if(function(t){if(!d(t))return!1;try{const n=Object.getPrototypeOf(t).constructor.name;return!n||"Object"===n}catch(t){return!0}}(t)){const e=n.get(t);if(void 0!==e)return e;const r={};n.set(t,r);for(const e of Object.getOwnPropertyNames(t))void 0!==t[e]&&(r[e]=A(t[e],n));return r}if(Array.isArray(t)){const e=n.get(t);if(void 0!==e)return e;const r=[];return n.set(t,r),t.forEach((t=>{r.push(A(t,n))})),r}return t}const I=50,P="?",U=/captureMessage|captureException/;function M(t){return t[t.length-1]||{}}const L="";const B=1e3;function G(){return Date.now()/B}const J=function(){const{performance:t}=b;if(!t||!t.now)return G;const n=Date.now()-t.now(),e=null==t.timeOrigin?n:t.timeOrigin;return()=>(e+t.now())/B}();function Y(){const t=b,n=t.crypto||t.msCrypto;let e=()=>16*Math.random();try{if(n&&n.randomUUID)return n.randomUUID().replace(/-/g,"");n&&n.getRandomValues&&(e=()=>{const t=new Uint8Array(1);return n.getRandomValues(t),t[0]})}catch(t){}return([1e7]+1e3+4e3+8e3+1e11).replace(/[018]/g,(t=>(t^(15&e())>>t/4).toString(16)))}function z(t,n=100,e=1/0){try{return H("",t,n,e)}catch(t){return{ERROR:`**non-serializable** (${t})`}}}function H(t,n,e=1/0,r=1/0,o=function(){const t="function"==typeof WeakSet,n=t?new WeakSet:[];return[function(e){if(t)return!!n.has(e)||(n.add(e),!1);for(let t=0;t=r){f[t]="[MaxProperties ~]";break}const n=p[t];f[t]=H(t,n,u-1,r,o),h++}return i(n),f}function W(t,n){const e=n.replace(/\\/g,"/").replace(/[|\\{}()[\]^$+*?.]/g,"\\$&");let r=t;try{r=decodeURI(t)}catch(t){}return r.replace(/\\/g,"/").replace(/webpack:\/?/g,"").replace(new RegExp(`(file://)?/*${e}/*`,"ig"),"app:///")}(()=>{const{performance:t}=b;if(!t||!t.now)return;const n=36e5,e=t.now(),r=Date.now(),o=t.timeOrigin?Math.abs(t.timeOrigin+e-r):n,s=o1024?`${t.slice(-1024)}`:t,e=F.exec(n);return e?e.slice(1):[]}(t),e=n[0]||"";let r=n[1];return e||r?(r&&(r=r.slice(0,r.length-1)),e+r):"."}var V;function Z(t){return new q((n=>{n(t)}))}!function(t){t[t.PENDING=0]="PENDING";t[t.RESOLVED=1]="RESOLVED";t[t.REJECTED=2]="REJECTED"}(V||(V={}));class q{constructor(t){q.prototype.__init.call(this),q.prototype.__init2.call(this),q.prototype.__init3.call(this),q.prototype.__init4.call(this),this.i=V.PENDING,this.u=[];try{t(this.h,this.p)}catch(t){this.p(t)}}then(t,n){return new q(((e,r)=>{this.u.push([!1,n=>{if(t)try{e(t(n))}catch(t){r(t)}else e(n)},t=>{if(n)try{e(n(t))}catch(t){r(t)}else r(t)}]),this.l()}))}catch(t){return this.then((t=>t),t)}finally(t){return new q(((n,e)=>{let r,o;return this.then((n=>{o=!1,r=n,t&&t()}),(n=>{o=!0,r=n,t&&t()})).then((()=>{o?e(r):n(r)}))}))}__init(){this.h=t=>{this.m(V.RESOLVED,t)}}__init2(){this.p=t=>{this.m(V.REJECTED,t)}}__init3(){this.m=(t,n)=>{this.i===V.PENDING&&(m(n)?n.then(this.h,this.p):(this.i=t,this._=n,this.l()))}}__init4(){this.l=()=>{if(this.i===V.PENDING)return;const t=this.u.slice();this.u=[],t.forEach((t=>{t[0]||(this.i===V.RESOLVED&&t[1](this._),this.i===V.REJECTED&&t[2](this._),t[0]=!0)}))}}}function Q(t){const n=[];function e(t){return n.splice(n.indexOf(t),1)[0]||Promise.resolve(void 0)}return{$:n,add:function(r){if(!(void 0===t||n.length{n(o)}));var o;const s=r();return-1===n.indexOf(s)&&n.push(s),s.then((()=>e(s))).then(null,(()=>e(s).then(null,(()=>{})))),s},drain:function(t){return new q(((e,r)=>{let o=n.length;if(!o)return e(!0);const s=setTimeout((()=>{t&&t>0&&e(!1)}),t);n.forEach((t=>{Z(t).then((()=>{--o||(clearTimeout(s),e(!0))}),r)}))}))}}}function X(t,n=!1){return!(n||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&void 0!==t&&!t.includes("node_modules/")}const tt="sentry-",nt=/^sentry-/;function et(t){const n=function(t){if(!t||!l(t)&&!Array.isArray(t))return;if(Array.isArray(t))return t.reduce(((t,n)=>{const e=rt(n);return Object.entries(e).forEach((([n,e])=>{t[n]=e})),t}),{});return rt(t)}(t);if(!n)return;const e=Object.entries(n).reduce(((t,[n,e])=>{if(n.match(nt)){t[n.slice(tt.length)]=e}return t}),{});return Object.keys(e).length>0?e:void 0}function rt(t){return t.split(",").map((t=>t.split("=").map((t=>decodeURIComponent(t.trim()))))).reduce(((t,[n,e])=>(n&&e&&(t[n]=e),t)),{})}function ot(t,n=[]){return[t,n]}function st(t,n){const e=t[1];for(const t of e){if(n(t,t[0].type))return!0}return!1}function it(t){return b.__SENTRY__&&b.__SENTRY__.encodePolyfill?b.__SENTRY__.encodePolyfill(t):(new TextEncoder).encode(t)}function ct(t){const[n,e]=t;let r=JSON.stringify(n);function o(t){"string"==typeof r?r="string"==typeof t?r+t:[it(r),t]:r.push("string"==typeof t?it(t):t)}for(const t of e){const[n,e]=t;if(o(`\n${JSON.stringify(n)}\n`),"string"==typeof e||e instanceof Uint8Array)o(e);else{let t;try{t=JSON.stringify(e)}catch(n){t=JSON.stringify(z(e))}o(t)}}return"string"==typeof r?r:function(t){const n=t.reduce(((t,n)=>t+n.length),0),e=new Uint8Array(n);let r=0;for(const n of t)e.set(n,r),r+=n.length;return e}(r)}const ut={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",statsd:"metric_bucket"};function at(t){if(!t||!t.sdk)return;const{name:n,version:e}=t.sdk;return{name:n,version:e}}const ft=6e4;function ht(t,{statusCode:n,headers:e},r=Date.now()){const o={...t},s=e&&e["x-sentry-rate-limits"],i=e&&e["retry-after"];if(s)for(const t of s.trim().split(",")){const[n,e,,,s]=t.split(":",5),i=parseInt(n,10),c=1e3*(isNaN(i)?60:i);if(e)for(const t of e.split(";"))"metric_bucket"===t&&s&&!s.split(";").includes("custom")||(o[t]=r+c);else o.all=r+c}else i?o.all=r+function(t,n=Date.now()){const e=parseInt(`${t}`,10);if(!isNaN(e))return 1e3*e;const r=Date.parse(`${t}`);return isNaN(r)?ft:r-n}(i,r):429===n&&(o.all=r+6e4);return o}function pt(){return{traceId:Y(),spanId:Y().substring(16)}}const lt="undefined"==typeof __SENTRY_DEBUG__||__SENTRY_DEBUG__;function dt(){return mt(b),b}function mt(t){const n=t.__SENTRY__=t.__SENTRY__||{};return n.version=n.version||g,n[g]=n[g]||{}}function yt(t){const n=J(),e={sid:Y(),init:!0,timestamp:n,started:n,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>function(t){return O({sid:`${t.sid}`,init:t.init,started:new Date(1e3*t.started).toISOString(),timestamp:new Date(1e3*t.timestamp).toISOString(),status:t.status,errors:t.errors,did:"number"==typeof t.did||"string"==typeof t.did?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}})}(e)};return t&>(e,t),e}function gt(t,n={}){if(n.user&&(!t.ipAddress&&n.user.ip_address&&(t.ipAddress=n.user.ip_address),t.did||n.did||(t.did=n.user.id||n.user.email||n.user.username)),t.timestamp=n.timestamp||J(),n.abnormal_mechanism&&(t.abnormal_mechanism=n.abnormal_mechanism),n.ignoreDuration&&(t.ignoreDuration=n.ignoreDuration),n.sid&&(t.sid=32===n.sid.length?n.sid:Y()),void 0!==n.init&&(t.init=n.init),!t.did&&n.did&&(t.did=`${n.did}`),"number"==typeof n.started&&(t.started=n.started),t.ignoreDuration)t.duration=void 0;else if("number"==typeof n.duration)t.duration=n.duration;else{const n=t.timestamp-t.started;t.duration=n>=0?n:0}n.release&&(t.release=n.release),n.environment&&(t.environment=n.environment),!t.ipAddress&&n.ipAddress&&(t.ipAddress=n.ipAddress),!t.userAgent&&n.userAgent&&(t.userAgent=n.userAgent),"number"==typeof n.errors&&(t.errors=n.errors),n.status&&(t.status=n.status)}const bt="_sentrySpan";function _t(t,n){n?function(t,n,e){try{Object.defineProperty(t,n,{value:e,writable:!0,configurable:!0})}catch(e){$&&C.log(`Failed to add non-enumerable property "${n}" to object`,t)}}(t,bt,n):delete t[bt]}function vt(t){return t[bt]}class wt{constructor(){this.v=!1,this.S=[],this.N=[],this.C=[],this.T=[],this.k={},this.R={},this.j={},this.D={},this.O={},this.A=pt()}clone(){const t=new wt;return t.C=[...this.C],t.R={...this.R},t.j={...this.j},t.D={...this.D},t.k=this.k,t.I=this.I,t.P=this.P,t.U=this.U,t.M=this.M,t.N=[...this.N],t.L=this.L,t.T=[...this.T],t.O={...this.O},t.A={...this.A},t.B=this.B,t.G=this.G,_t(t,vt(this)),t}setClient(t){this.B=t}setLastEventId(t){this.G=t}getClient(){return this.B}lastEventId(){return this.G}addScopeListener(t){this.S.push(t)}addEventProcessor(t){return this.N.push(t),this}setUser(t){return this.k=t||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this.P&>(this.P,{user:t}),this.J(),this}getUser(){return this.k}getRequestSession(){return this.L}setRequestSession(t){return this.L=t,this}setTags(t){return this.R={...this.R,...t},this.J(),this}setTag(t,n){return this.R={...this.R,[t]:n},this.J(),this}setExtras(t){return this.j={...this.j,...t},this.J(),this}setExtra(t,n){return this.j={...this.j,[t]:n},this.J(),this}setFingerprint(t){return this.M=t,this.J(),this}setLevel(t){return this.I=t,this.J(),this}setTransactionName(t){return this.U=t,this.J(),this}setContext(t,n){return null===n?delete this.D[t]:this.D[t]=n,this.J(),this}setSession(t){return t?this.P=t:delete this.P,this.J(),this}getSession(){return this.P}update(t){if(!t)return this;const n="function"==typeof t?t(this):t,[e,r]=n instanceof St?[n.getScopeData(),n.getRequestSession()]:d(n)?[t,t.requestSession]:[],{tags:o,extra:s,user:i,contexts:c,level:u,fingerprint:a=[],propagationContext:f}=e||{};return this.R={...this.R,...o},this.j={...this.j,...s},this.D={...this.D,...c},i&&Object.keys(i).length&&(this.k=i),u&&(this.I=u),a.length&&(this.M=a),f&&(this.A=f),r&&(this.L=r),this}clear(){return this.C=[],this.R={},this.j={},this.k={},this.D={},this.I=void 0,this.U=void 0,this.M=void 0,this.L=void 0,this.P=void 0,_t(this,void 0),this.T=[],this.A=pt(),this.J(),this}addBreadcrumb(t,n){const e="number"==typeof n?n:100;if(e<=0)return this;const r={timestamp:G(),...t},o=this.C;return o.push(r),this.C=o.length>e?o.slice(-e):o,this.J(),this}getLastBreadcrumb(){return this.C[this.C.length-1]}clearBreadcrumbs(){return this.C=[],this.J(),this}addAttachment(t){return this.T.push(t),this}clearAttachments(){return this.T=[],this}getScopeData(){return{breadcrumbs:this.C,attachments:this.T,contexts:this.D,tags:this.R,extra:this.j,user:this.k,level:this.I,fingerprint:this.M||[],eventProcessors:this.N,propagationContext:this.A,sdkProcessingMetadata:this.O,transactionName:this.U,span:vt(this)}}setSDKProcessingMetadata(t){return this.O={...this.O,...t},this}setPropagationContext(t){return this.A=t,this}getPropagationContext(){return this.A}captureException(t,n){const e=n&&n.event_id?n.event_id:Y();if(!this.B)return C.warn("No client configured on scope - will not capture exception!"),e;const r=new Error("Sentry syntheticException");return this.B.captureException(t,{originalException:t,syntheticException:r,...n,event_id:e},this),e}captureMessage(t,n,e){const r=e&&e.event_id?e.event_id:Y();if(!this.B)return C.warn("No client configured on scope - will not capture message!"),r;const o=new Error(t);return this.B.captureMessage(t,n,{originalException:t,syntheticException:o,...e,event_id:r},this),r}captureEvent(t,n){const e=n&&n.event_id?n.event_id:Y();return this.B?(this.B.captureEvent(t,{...n,event_id:e},this),e):(C.warn("No client configured on scope - will not capture event!"),e)}J(){this.v||(this.v=!0,this.S.forEach((t=>{t(this)})),this.v=!1)}}const St=wt;class $t{constructor(t,n){let e,r;e=t||new St,r=n||new St,this.Y=[{scope:e}],this.H=r}withScope(t){const n=this.W();let e;try{e=t(n)}catch(t){throw this.F(),t}return m(e)?e.then((t=>(this.F(),t)),(t=>{throw this.F(),t})):(this.F(),e)}getClient(){return this.getStackTop().client}getScope(){return this.getStackTop().scope}getIsolationScope(){return this.H}getStackTop(){return this.Y[this.Y.length-1]}W(){const t=this.getScope().clone();return this.Y.push({client:this.getClient(),scope:t}),t}F(){return!(this.Y.length<=1)&&!!this.Y.pop()}}function Et(){const t=mt(dt());return t.stack=t.stack||new $t(_("defaultCurrentScope",(()=>new St)),_("defaultIsolationScope",(()=>new St)))}function xt(t){return Et().withScope(t)}function Nt(t,n){const e=Et();return e.withScope((()=>(e.getStackTop().scope=t,n(t))))}function Ct(t){return Et().withScope((()=>t(Et().getIsolationScope())))}function Tt(t){const n=mt(t);return n.acs?n.acs:{withIsolationScope:Ct,withScope:xt,withSetScope:Nt,withSetIsolationScope:(t,n)=>Ct(n),getCurrentScope:()=>Et().getScope(),getIsolationScope:()=>Et().getIsolationScope()}}function kt(){return Tt(dt()).getCurrentScope().getClient()}const Rt="_sentryMetrics";function jt(t){const n=t[Rt];if(!n)return;const e={};for(const[,[t,r]]of n){(e[t]||(e[t]=[])).push(O(r))}return e}const Dt="sentry.source",Ot="sentry.sample_rate",At="sentry.op",It="sentry.origin",Pt=0,Ut=1,Mt=1;function Lt(t){const{spanId:n,traceId:e}=t.spanContext(),{parent_span_id:r}=Jt(t);return O({parent_span_id:r,span_id:n,trace_id:e})}function Bt(t){return"number"==typeof t?Gt(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?Gt(t.getTime()):J()}function Gt(t){return t>9999999999?t/1e3:t}function Jt(t){if(function(t){return"function"==typeof t.getSpanJSON}(t))return t.getSpanJSON();try{const{spanId:n,traceId:e}=t.spanContext();if(function(t){const n=t;return!!(n.attributes&&n.startTime&&n.name&&n.endTime&&n.status)}(t)){const{attributes:r,startTime:o,name:s,endTime:i,parentSpanId:c,status:u}=t;return O({span_id:n,trace_id:e,data:r,description:s,parent_span_id:c,start_timestamp:Bt(o),timestamp:Bt(i)||void 0,status:Yt(u),op:r[At],origin:r[It],_metrics_summary:jt(t)})}return{span_id:n,trace_id:e}}catch(t){return{}}}function Yt(t){if(t&&t.code!==Pt)return t.code===Ut?"ok":t.message||"unknown_error"}const zt="_sentryRootSpan";function Ht(t){return t[zt]||t}const Wt="production",Ft="_frozenDsc";function Kt(t){const n=kt();if(!n)return{};const e=function(t,n){const e=n.getOptions(),{publicKey:r}=n.getDsn()||{},o=O({environment:e.environment||Wt,release:e.release,public_key:r,trace_id:t});return n.emit("createDsc",o),o}(Jt(t).trace_id||"",n),r=Ht(t),o=r[Ft];if(o)return o;const s=r.spanContext().traceState,i=s&&s.get("sentry.dsc"),c=i&&et(i);if(c)return c;const u=Jt(r),a=u.data||{},f=a[Ot];null!=f&&(e.sample_rate=`${f}`);const h=a[Dt],p=u.description;return"url"!==h&&p&&(e.transaction=p),function(t){if("boolean"==typeof __SENTRY_TRACING__&&!__SENTRY_TRACING__)return!1;const n=kt(),e=n&&n.getOptions();return!!e&&(e.enableTracing||"tracesSampleRate"in e||"tracesSampler"in e)}()&&(e.sampled=String(function(t){const{traceFlags:n}=t.spanContext();return n===Mt}(r))),n.emit("createDsc",e,r),e}function Vt(t,n,e,r){const o=at(e),s=t.type&&"replay_event"!==t.type?t.type:"event";!function(t,n){n&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||n.name,t.sdk.version=t.sdk.version||n.version,t.sdk.integrations=[...t.sdk.integrations||[],...n.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...n.packages||[]])}(t,e&&e.sdk);const i=function(t,n,e,r){const o=t.sdkProcessingMetadata&&t.sdkProcessingMetadata.dynamicSamplingContext;return{event_id:t.event_id,sent_at:(new Date).toISOString(),...n&&{sdk:n},...!!e&&r&&{dsn:T(r)},...o&&{trace:O({...o})}}}(t,o,r,n);delete t.sdkProcessingMetadata;return ot(i,[[{type:s},t]])}const Zt="__SENTRY_SUPPRESS_TRACING__";function qt(t){const n=Tt(dt());return n.suppressTracing?n.suppressTracing(t):function(...t){const n=Tt(dt());if(2===t.length){const[e,r]=t;return e?n.withSetScope(e,r):n.withScope(r)}return n.withScope(t[0])}((n=>(n.setSDKProcessingMetadata({[Zt]:!0}),t())))}function Qt(t,n){const{fingerprint:e,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=n;!function(t,n){const{extra:e,tags:r,user:o,contexts:s,level:i,transactionName:c}=n,u=O(e);u&&Object.keys(u).length&&(t.extra={...u,...t.extra});const a=O(r);a&&Object.keys(a).length&&(t.tags={...a,...t.tags});const f=O(o);f&&Object.keys(f).length&&(t.user={...f,...t.user});const h=O(s);h&&Object.keys(h).length&&(t.contexts={...h,...t.contexts});i&&(t.level=i);c&&"transaction"!==t.type&&(t.transaction=c)}(t,n),r&&function(t,n){t.contexts={trace:Lt(n),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Kt(n),...t.sdkProcessingMetadata};const e=Ht(n),r=Jt(e).description;r&&!t.transaction&&"transaction"===t.type&&(t.transaction=r)}(t,r),function(t,n){t.fingerprint=t.fingerprint?function(t){return Array.isArray(t)?t:[t]}(t.fingerprint):[],n&&(t.fingerprint=t.fingerprint.concat(n));t.fingerprint&&!t.fingerprint.length&&delete t.fingerprint}(t,e),function(t,n){const e=[...t.breadcrumbs||[],...n];t.breadcrumbs=e.length?e:void 0}(t,o),function(t,n){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...n}}(t,s)}const Xt="7";function tn(t,n){return e={sentry_key:t.publicKey,sentry_version:Xt,...n&&{sentry_client:`${n.name}/${n.version}`}},Object.keys(e).map((t=>`${encodeURIComponent(t)}=${encodeURIComponent(e[t])}`)).join("&");var e}const nn=64;function en(t,n,e=Q(t.bufferSize||nn)){let r={};return{send:function(t){const o=[];if(st(t,((t,n)=>{const e=function(t){return ut[t]}(n);(function(t,n,e=Date.now()){return function(t,n){return t[n]||t.all||0}(t,n)>e})(r,e)||o.push(t)})),0===o.length)return Z({});const s=ot(t[0],o),i=t=>{st(s,((t,n)=>{}))};return e.add((()=>n({body:ct(s)}).then((t=>(void 0!==t.statusCode&&(t.statusCode<200||t.statusCode>=300)&<&&C.warn(`Sentry responded with status code ${t.statusCode} to sent event.`),r=ht(r,t),t)),(t=>{throw i(),t})))).then((t=>t),(t=>{if(t instanceof k)return lt&&C.error("Skipped sending event because buffer is full."),i(),Z({});throw t}))},flush:t=>e.drain(t)}}const rn=Symbol("AgentBaseInternalState");class on extends s.Agent{[rn];options;keepAlive;constructor(t){super(t),this[rn]={}}isSecureEndpoint(t){if(t){if("boolean"==typeof t.secureEndpoint)return t.secureEndpoint;if("string"==typeof t.protocol)return"https:"===t.protocol}const{stack:n}=new Error;return"string"==typeof n&&n.split("\n").some((t=>-1!==t.indexOf("(https.js:")||-1!==t.indexOf("node:https:")))}createSocket(t,n,e){const r={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then((()=>this.connect(t,r))).then((o=>{if(o instanceof s.Agent)return o.addRequest(t,r);this[rn].currentSocket=o,super.createSocket(t,n,e)}),e)}createConnection(){const t=this[rn].currentSocket;if(this[rn].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[rn].defaultPort??("https:"===this.protocol?443:80)}set defaultPort(t){this[rn]&&(this[rn].defaultPort=t)}get protocol(){return this[rn].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[rn]&&(this[rn].protocol=t)}}function sn(...t){C.log("[https-proxy-agent:parse-proxy-response]",...t)}function cn(t){return new Promise(((n,e)=>{let r=0;const o=[];function s(){const c=t.read();c?function(c){o.push(c),r+=c.length;const u=Buffer.concat(o,r),a=u.indexOf("\r\n\r\n");if(-1===a)return sn("have not received end of HTTP headers yet..."),void s();const f=u.slice(0,a).toString("ascii").split("\r\n"),h=f.shift();if(!h)return t.destroy(),e(new Error("No header received from proxy CONNECT response"));const p=h.split(" "),l=+(p[1]||0),d=p.slice(2).join(" "),m={};for(const n of f){if(!n)continue;const r=n.indexOf(":");if(-1===r)return t.destroy(),e(new Error(`Invalid header from proxy CONNECT response: "${n}"`));const o=n.slice(0,r).toLowerCase(),s=n.slice(r+1).trimStart(),i=m[o];"string"==typeof i?m[o]=[i,s]:Array.isArray(i)?i.push(s):m[o]=s}sn("got proxy server response: %o %o",h,m),i(),n({connect:{statusCode:l,statusText:d,headers:m},buffered:u})}(c):t.once("readable",s)}function i(){t.removeListener("end",c),t.removeListener("error",u),t.removeListener("readable",s)}function c(){i(),sn("onend"),e(new Error("Proxy connection ended before receiving CONNECT response"))}function u(t){i(),sn("onerror %o",t),e(t)}t.on("error",u),t.on("end",c),s()}))}function un(...t){C.log("[https-proxy-agent]",...t)}class an extends on{static protocols=["http","https"];proxy;proxyHeaders;connectOpts;constructor(t,n){super(n),this.options={},this.proxy="string"==typeof t?new URL(t):t,this.proxyHeaders=n?.headers??{},un("Creating new HttpsProxyAgent instance: %o",this.proxy.href);const e=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),r=this.proxy.port?parseInt(this.proxy.port,10):"https:"===this.proxy.protocol?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?hn(n,"headers"):null,host:e,port:r}}async connect(t,n){const{proxy:e}=this;if(!n.host)throw new TypeError('No "host" provided');let r;if("https:"===e.protocol){un("Creating `tls.Socket`: %o",this.connectOpts);const t=this.connectOpts.servername||this.connectOpts.host;r=f.connect({...this.connectOpts,servername:t&&a.isIP(t)?void 0:t})}else un("Creating `net.Socket`: %o",this.connectOpts),r=a.connect(this.connectOpts);const o="function"==typeof this.proxyHeaders?this.proxyHeaders():{...this.proxyHeaders},s=a.isIPv6(n.host)?`[${n.host}]`:n.host;let i=`CONNECT ${s}:${n.port} HTTP/1.1\r\n`;if(e.username||e.password){const t=`${decodeURIComponent(e.username)}:${decodeURIComponent(e.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(t).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(const t of Object.keys(o))i+=`${t}: ${o[t]}\r\n`;const c=cn(r);r.write(`${i}\r\n`);const{connect:u,buffered:h}=await c;if(t.emit("proxyConnect",u),this.emit("proxyConnect",u,t),200===u.statusCode){if(t.once("socket",fn),n.secureEndpoint){un("Upgrading socket connection to TLS");const t=n.servername||n.host;return f.connect({...hn(n,"host","path","port"),socket:r,servername:a.isIP(t)?void 0:t})}return r}r.destroy();const p=new a.Socket({writable:!1});return p.readable=!0,t.once("socket",(t=>{un("Replaying proxy buffer for failed request"),t.push(h),t.push(null)})),p}}function fn(t){t.resume()}function hn(t,...n){const e={};let r;for(r in t)n.includes(r)||(e[r]=t[r]);return e}const pn=32768;function ln(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}const dn=e;let mn,yn=!1,gn={};function bn(t){dn.debug&&console.log(`[ANR Worker] ${t}`)}var _n,vn,wn;const Sn=function(t){let n;try{n=new URL(t.url)}catch(n){return N((()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")})),en(t,(()=>Promise.resolve({})))}const e="https:"===n.protocol,r=function(t,n){const{no_proxy:e}=process.env;return e&&e.split(",").some((n=>t.host.endsWith(n)||t.hostname.endsWith(n)))?void 0:n}(n,t.proxy||(e?process.env.https_proxy:void 0)||process.env.http_proxy),o=e?i:s,a=void 0!==t.keepAlive&&t.keepAlive,f=r?new an(r):new o.Agent({keepAlive:a,maxSockets:30,timeout:2e3}),h=function(t,n,e){const{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(f){return new Promise(((h,p)=>{qt((()=>{let l=function(t){return new c({read(){this.push(t),this.push(null)}})}(f.body);const d={...t.headers};f.body.length>pn&&(d["content-encoding"]="gzip",l=l.pipe(u()));const m=n.request({method:"POST",agent:e,headers:d,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},(t=>{t.on("data",(()=>{})),t.on("end",(()=>{})),t.setEncoding("utf8");const n=t.headers["retry-after"]??null,e=t.headers["x-sentry-rate-limits"]??null;h({statusCode:t.statusCode,headers:{"retry-after":n,"x-sentry-rate-limits":Array.isArray(e)?e[0]||null:e}})}));m.on("error",p),l.pipe(m)}))}))}}(t,t.httpModule??o,f);return en(t,h)}({url:(_n=dn.dsn,vn=dn.tunnel,wn=dn.sdkMetadata.sdk,vn||`${function(t){return`${function(t){const n=t.protocol?`${t.protocol}:`:"",e=t.port?`:${t.port}`:"";return`${n}//${t.host}${e}${t.path?`/${t.path}`:""}/api/`}(t)}${t.projectId}/envelope/`}(_n)}?${tn(_n,wn)}`),recordDroppedEvent:()=>{}});async function $n(){if(mn){bn("Sending abnormal session"),gt(mn,{status:"abnormal",abnormal_mechanism:"anr_foreground"});const t=function(t,n,e,r){const o=at(e);return ot({sent_at:(new Date).toISOString(),...o&&{sdk:o},...!!r&&n&&{dsn:T(n)}},["aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()]])}(mn,dn.dsn,dn.sdkMetadata,dn.tunnel);bn(JSON.stringify(t)),await Sn.send(t);try{n?.postMessage("session-ended")}catch(t){}}}function En(t){if(!t)return;const n=function(t){if(!t.length)return[];const n=Array.from(t);return/sentryWrapped/.test(M(n).function||"")&&n.pop(),n.reverse(),U.test(M(n).function||"")&&(n.pop(),U.test(M(n).function||"")&&n.pop()),n.slice(0,I).map((t=>({...t,filename:t.filename||M(n).filename,function:t.function||P})))}(t);if(dn.appRootPath)for(const t of n)t.filename&&(t.filename=W(t.filename,dn.appRootPath));return n}async function xn(t,n){if(yn)return;yn=!0,await $n(),bn("Sending event");const e={event_id:Y(),contexts:dn.contexts,release:dn.release,environment:dn.environment,dist:dn.dist,platform:"node",level:"error",exception:{values:[{type:"ApplicationNotResponding",value:`Application Not Responding for at least ${dn.anrThreshold} ms`,stacktrace:{frames:En(t)},mechanism:{type:"ANR"}}]},tags:dn.staticTags};n&&function(t,n){if(Qt(t,n),!t.contexts?.trace){const{traceId:e,spanId:r,parentSpanId:o}=n.propagationContext;t.contexts={trace:{trace_id:e,span_id:r,parent_span_id:o},...t.contexts}}}(e,n),function(t){if(0===Object.keys(gn).length)return;const n=new Map;for(const e of t.exception?.values||[])for(const t of e.stacktrace?.frames||[]){const e=t.abs_path||t.filename;e&&gn[e]&&n.set(e,gn[e])}if(n.size>0){const e=[];for(const[t,r]of n.entries())e.push({type:"sourcemap",code_file:t,debug_id:r});t.debug_meta={images:e}}}(e);const r=Vt(e,dn.dsn,dn.sdkMetadata,dn.tunnel);bn(JSON.stringify(r)),await Sn.send(r),await Sn.flush(2e3),setTimeout((()=>{process.exit(0)}),5e3)}let Nn;if(bn("Started"),dn.captureStackTrace){bn("Connecting to debugger");const n=new t;n.connectToMainThread(),bn("Connected to debugger");const e=new Map;n.on("Debugger.scriptParsed",(t=>{e.set(t.params.scriptId,t.params.url)})),n.on("Debugger.paused",(t=>{if("other"===t.params.reason)try{bn("Debugger paused");const s=[...t.params.callFrames],i=dn.appRootPath?function(t=(process.argv[1]?K(process.argv[1]):process.cwd()),n="\\"===o){const e=n?ln(t):t;return t=>{if(!t)return;const o=n?ln(t):t;let{dir:s,base:i,ext:c}=r.parse(o);".js"!==c&&".mjs"!==c&&".cjs"!==c||(i=i.slice(0,-1*c.length)),s||(s=".");const u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${i}`;if(s.startsWith(e)){let t=s.slice(e.length+1).replace(/\//g,".");return t&&(t+=":"),t+=i,t}return i}}(dn.appRootPath):()=>{},c=s.map((t=>function(t,n,e){const r=n?n.replace(/^file:\/\//,""):void 0,o=t.location.columnNumber?t.location.columnNumber+1:void 0,s=t.location.lineNumber?t.location.lineNumber+1:void 0;return O({filename:r,module:e(r),function:t.functionName||P,colno:o,lineno:s,in_app:r?X(r):void 0})}(t,e.get(t.location.scriptId),i))),u=setTimeout((()=>{xn(c).then(null,(()=>{bn("Sending ANR event failed.")}))}),5e3);n.post("Runtime.evaluate",{expression:"global.__SENTRY_GET_SCOPES__();",silent:!0,returnByValue:!0},((t,e)=>{t&&bn(`Error executing script: '${t.message}'`),clearTimeout(u);const r=e&&e.result?e.result.value:void 0;n.post("Debugger.resume"),n.post("Debugger.disable"),xn(c,r).then(null,(()=>{bn("Sending ANR event failed.")}))}))}catch(t){throw n.post("Debugger.resume"),n.post("Debugger.disable"),t}})),Nn=()=>{try{n.post("Debugger.enable",(()=>{n.post("Debugger.pause")}))}catch(t){}}}const{poll:Cn}=function(t,n,e,r){const o=t();let s=!1,i=!0;return setInterval((()=>{const t=o.getTimeMs();!1===s&&t>n+e&&(s=!0,i&&r()),t{o.reset()},enabled:t=>{i=t}}}((function(){let t=process.hrtime();return{getTimeMs:()=>{const[n,e]=process.hrtime(t);return Math.floor(1e3*n+e/1e6)},reset:()=>{t=process.hrtime()}}}),dn.pollInterval,dn.anrThreshold,(function(){bn("Watchdog timeout"),Nn?(bn("Pausing debugger to capture stack trace"),Nn()):(bn("Capturing event without a stack trace"),xn().then(null,(()=>{bn("Sending ANR event failed on watchdog timeout.")})))}));n?.on("message",(t=>{t.session&&(mn=yt(t.session)),t.debugImages&&(gn=t.debugImages),Cn()}));