@yukino.js/yukino 0.0.7 → 0.0.8
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/README.md +130 -25
- package/dist/a2a-GBVNBDMY.js +14 -0
- package/dist/{acp-76S2XII3.js → acp-C6VUCEZ6.js} +7 -7
- package/dist/anthropic-ZEQI4K52.js +4 -0
- package/dist/chunk-37IAJFPF.js +4 -0
- package/dist/{chunk-NG62ISUV.js → chunk-3P7BR7SO.js} +8 -8
- package/dist/{chunk-7PPWFSIC.js → chunk-6XDMANXO.js} +1 -1
- package/dist/{chunk-HWDSXNX4.js → chunk-L5C5JBLP.js} +1 -1
- package/dist/chunk-MU6PSBZT.js +358 -0
- package/dist/chunk-WGFROGUC.js +8 -0
- package/dist/{chunk-QRO6H32L.js → chunk-YHE4BT76.js} +148 -148
- package/dist/esm-4KOJC56H.js +225 -0
- package/dist/fe/dist/index.html +21 -0
- package/dist/fe/dist/static/index.css +2 -0
- package/dist/fe/dist/static/index.js +203 -0
- package/dist/lib/{anthropic-CDPTNR5L.js → anthropic-K7VWTSFH.js} +2 -2
- package/dist/lib/{chunk-EO23VPDZ.js → chunk-2NA2RSV7.js} +1 -9
- package/dist/lib/{chunk-PEV5NGQ2.js → chunk-E2DXHLHR.js} +1 -1
- package/dist/lib/{chunk-HE4RUUZP.js → chunk-IIL5NGQF.js} +461 -457
- package/dist/lib/{chunk-OYQY3Q45.js → chunk-K532PPI6.js} +0 -2
- package/dist/lib/{chunk-TKCJSTWI.js → chunk-RJQT6B2O.js} +1 -1
- package/dist/lib/index.d.ts +402 -3616
- package/dist/lib/index.js +2733 -1893
- package/dist/lib/{openai-TEFKPV7T.js → openai-6MPSWGKN.js} +2 -2
- package/dist/lib/{providers-2X5JB2JX.js → providers-N52Y2QTJ.js} +1 -1
- package/dist/lib/{tool-filter-HUVHJN3O.js → tool-filter-F4S25GMJ.js} +1 -1
- package/dist/main.js +366 -237
- package/dist/{openai-RYXW7AKZ.js → openai-VV2RYB77.js} +1 -1
- package/dist/{providers-YG2HYIG6.js → providers-UD3DPALA.js} +1 -1
- package/dist/server-FXK26WN2.js +4 -0
- package/package.json +11 -12
- package/dist/anthropic-WK6EYMUE.js +0 -4
- package/dist/chunk-4GE22WHI.js +0 -4
- package/dist/chunk-7ZBAF7M4.js +0 -4
- package/dist/chunk-QQZCYWYI.js +0 -241
- package/dist/esm-5V3TYPZK.js +0 -229
- package/dist/lib/chunk-EFNPK4SJ.js +0 -137
- package/dist/lib/sandbox-runtime-QDN5SXPM.js +0 -9
- package/dist/sandbox-runtime-ELKAYRIL.js +0 -4
- package/dist/server-66HLMSUR.js +0 -4
|
@@ -0,0 +1,225 @@
|
|
|
1
|
+
#!/usr/bin/env node
|
|
2
|
+
import { createRequire as __yukinoCreateRequire } from "node:module";
|
|
3
|
+
const require = __yukinoCreateRequire(import.meta.url);
|
|
4
|
+
import{b as y2}from"./chunk-WGFROGUC.js";import"./chunk-VU3JWAJR.js";import{a as Ar,c as JN}from"./chunk-JFKC4VCA.js";import{F as p_,G as qN,M as QN,a as Rs,b as Os,d as KN,r as qp}from"./chunk-CU3IISCC.js";import{a as ZN,c as xo,d as Xp,g as Ir,h as XN,k as l_,m as vt,n as Gn,o as pe,p as nn,q as Kp,r as ci,s as he,u as at}from"./chunk-VCIRD267.js";import{a as En,c as jp,d as jN,e as Zp}from"./chunk-7MKA3SHV.js";var Wy=jp((oTe,rk)=>{"use strict";var Fy=En("path").sep;rk.exports=function(e){var t=e.split(Fy),n=t.lastIndexOf("node_modules");if(n!==-1&&t[n+1]){for(var r=t[n+1][0]==="@",i=r?t[n+1]+"/"+t[n+2]:t[n+1],o=r?3:2,s="",c=n+o-1,a=0;a<=c;a++)a===c?s+=t[a]:s+=t[a]+Fy;for(var l="",p=t.length-1,u=n+o;u<=p;u++)u===p?l+=t[u]:l+=t[u]+Fy;return{name:i,basedir:s,path:l}}}});var Zy=jp((sTe,jy)=>{"use strict";var Ua=En("path"),gr=En("module"),gt=y2()("require-in-the-middle"),Gj=Wy();jy.exports=Hl;jy.exports.Hook=Hl;var Vy,qd;if(gr.isBuiltin)qd=gr.isBuiltin;else if(gr.builtinModules)qd=e=>e.startsWith("node:")?!0:(Vy===void 0&&(Vy=new Set(gr.builtinModules)),Vy.has(e));else throw new Error("'require-in-the-middle' requires Node.js >=v9.3.0 or >=v8.10.0");var Uj=/([/\\]index)?(\.js)?$/,Yy=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(t,n){if(this._localCache.has(t))return!0;if(n)return!1;{let r=En.cache[t];return!!(r&&this._kRitmExports in r)}}get(t,n){let r=this._localCache.get(t);if(r!==void 0)return r;if(!n){let i=En.cache[t];return i&&i[this._kRitmExports]}}set(t,n,r){r?this._localCache.set(t,n):t in En.cache?En.cache[t][this._kRitmExports]=n:(gt('non-core module is unexpectedly not in require.cache: "%s"',t),this._localCache.set(t,n))}};function Hl(e,t,n){if(!(this instanceof Hl))return new Hl(e,t,n);if(typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null),typeof gr._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof gr._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at https://github.com/nodejs/require-in-the-middle/issues",process.version);return}this._cache=new Yy,this._unhooked=!1,this._origRequire=gr.prototype.require;let r=this,i=new Set,o=t?t.internals===!0:!1,s=Array.isArray(e);gt("registering require hook"),this._require=gr.prototype.require=function(a){return r._unhooked===!0?(gt("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):c.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(a){return r._unhooked===!0?(gt("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):c.call(this,arguments,!0)});function c(a,l){let p=a[0],u=qd(p),d;if(u){if(d=p,p.startsWith("node:")){let M=p.slice(5);qd(M)&&(d=M)}}else{if(l)return gt("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,a);try{d=gr._resolveFilename(p,this)}catch(M){return gt('Module._resolveFilename("%s") threw %j, calling original Module.require',p,M.message),r._origRequire.apply(this,a)}}let m,_;if(gt("processing %s module require('%s'): %s",u===!0?"core":"non-core",p,d),r._cache.has(d,u)===!0)return gt("returning already patched cached module: %s",d),r._cache.get(d,u);let h=i.has(d);h===!1&&i.add(d);let b=l?r._origGetBuiltinModule.apply(this,a):r._origRequire.apply(this,a);if(h===!0)return gt("module is in the process of being patched already - ignoring: %s",d),b;if(i.delete(d),u===!0){if(s===!0&&e.includes(d)===!1)return gt("ignoring core module not on whitelist: %s",d),b;m=d}else if(s===!0&&e.includes(d)){let M=Ua.parse(d);m=M.name,_=M.dir}else{let M=Gj(d);if(M===void 0)return gt("could not parse filename: %s",d),b;m=M.name,_=M.basedir;let R=Dj(M);gt("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",m,p,R,_);let v=!1;if(s){if(!p.startsWith(".")&&e.includes(p)&&(m=p,v=!0),!e.includes(m)&&!e.includes(R))return b;e.includes(R)&&R!==m&&(m=R,v=!0)}if(!v){let P;try{P=En.resolve(m,{paths:[_]})}catch{return gt("could not resolve module: %s",m),r._cache.set(d,b,u),b}if(P!==d)if(o===!0)m=m+Ua.sep+Ua.relative(_,d),gt("preparing to process require of internal file: %s",m);else return gt("ignoring require of non-main module file: %s",P),r._cache.set(d,b,u),b}}r._cache.set(d,b,u),gt("calling require hook: %s",m);let N=n(b,m,_);return r._cache.set(d,N,u),gt("returning module: %s",m),N}}Hl.prototype.unhook=function(){this._unhooked=!0,this._require===gr.prototype.require?(gr.prototype.require=this._origRequire,gt("require unhook successful")):gt("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,gt("process.getBuiltinModule unhook successful")):gt("process.getBuiltinModule unhook unsuccessful"))};function Dj(e){let t=Ua.sep!=="/"?e.path.split(Ua.sep).join("/"):e.path;return Ua.posix.join(e.name,t).replace(Uj,"")}});var dk=jp(Da=>{"use strict";var Jy=[],lk=new WeakMap,Ky,qy,sk,$y=new Map,zy=[];function ak(e,t){return t==="module.exports"&&!Object.hasOwn(e,t)?e.default:e[t]}function pk(e,t,n){return lk.get(e).write(t,n)}function Fj(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return pk(e,t,n.value)}var Wj={defineProperty:Fj,set:pk};function uk(e,t,n){let r=Ky.get(e)?.[t];return typeof r=="function"?r(n):!0}function Vj(e,t){if(t===Symbol.toStringTag)return"Module";let n=qy.get(e)[t];if(typeof n=="function")return n()}function Yj(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return uk(e,t,n.value)}function jj(e,t,n,r,i){Ky??=new WeakMap,qy??=new WeakMap,sk??={defineProperty:Yj,get:Vj,set:uk},$y.set(e,i),Ky.set(t,n),qy.set(t,r);let o=new Proxy(t,sk);Jy.forEach(s=>s(e,o,i)),zy.push([e,o,i])}function Zj(e,t,n,r,i){if(arguments.length===5){jj(e,t,n,r,i);return}let{namespace:o}=t;$y.set(e,n),lk.set(o,t);let s=new Proxy(o,Wj);Jy.forEach(c=>c(e,s,n)),zy.push([e,s,n])}var ck=[0,10,50],Qy=class{namespace=Object.create(null,{[Symbol.toStringTag]:{value:"Module"}});#r=Object.create(null);#t;#n;#e;constructor(t,n,r,i){if(this.#t=r,n!==void 0)for(let o=0;o<n.length;o++)this.#s(n[o],o,i?.[o]??t)}#s(t,n,r){let i;try{i=ak(r,t),this.#t(n,i),this.namespace[t]=i}catch(o){if(!(o instanceof ReferenceError))throw o}i===void 0&&(this.#e??=[]).push(this.#a(t,n,r)),this.#r[t]=n}write(t,n){let r=this.#r[t];return r!==void 0&&(this.#t(r,n),this.#e!==void 0&&(this.#n??=Object.create(null),this.#n[t]=!0),this.namespace[t]=n),!0}#a(t,n,r){return()=>{if(this.#n?.[t]===!0)return!0;try{let i=ak(r,t);return i!==void 0?(this.#t(n,i),this.namespace[t]=i,!0):!1}catch(i){if(i instanceof ReferenceError)return!1;throw i}}}#i(){let t=this.#e;if(t===void 0)return;let n;for(let r of t)r()!==!0&&(n??=[]).push(r);this.#e=n}flush(){this.#e!==void 0&&queueMicrotask(()=>{this.#i(),this.#o(0)})}#o(t){if(this.#e===void 0)return;if(t>=ck.length){this.#e=void 0;return}let n=setTimeout(()=>{this.#i(),this.#o(t+1)},ck[t]);n&&typeof n.unref=="function"&&n.unref()}};Da.register=Zj;Da.ModuleBinder=Qy;Da.importHooks=Jy;Da.specifiers=$y;Da.toHook=zy});var rS=jp((dTe,Ha)=>{"use strict";var mk=En("path"),Xj=Wy(),{fileURLToPath:Kj}=En("url"),{MessageChannel:qj}=En("worker_threads"),{isBuiltin:eS}=En("module");eS||(eS=()=>!0);var{importHooks:tS,specifiers:fk,toHook:Qj}=dk();function Jj(e,t){if(!(process.env.TURBOPACK??process.argv.includes("--turbo")))return!1;let r=e.slice(0,e.lastIndexOf("-"));return t.endsWith(r)}function gk(e){tS.push(e),Qj.forEach(([t,n,r])=>e(t,n,r))}function _k(e){let t=tS.indexOf(e);t>-1&&tS.splice(t,1)}function Ba(e,t,n,r){let i=e(t,n,r);i&&i!==t&&"default"in t&&(t.default=i)}var nS;function $j(){let{port1:e,port2:t}=new qj,n=0,r;nS=c=>{n++,e.postMessage(c)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function i(){let c=setInterval(()=>{},1e3),a=new Promise(l=>{r=l}).then(()=>{clearInterval(c)});return n===0&&r(),a}let o=t;return{registerOptions:{data:{addHookMessagePort:o,include:[]},transferList:[o]},addHookMessagePort:o,waitForAllMessagesAcknowledged:i}}function Fl(e,t,n){if(!(this instanceof Fl))return new Fl(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let r=t?t.internals===!0:!1;nS&&Array.isArray(e)&&nS(e),this._iitmHook=(i,o,s)=>{let c=i,a=c.startsWith("node:"),l,p;if(a){let u=i.slice(5);eS(u)&&(i=u)}else if(c.startsWith("file://")){let u=Error.stackTraceLimit;Error.stackTraceLimit=0;try{l=Kj(i),i=l}catch{}if(Error.stackTraceLimit=u,l){let d=Xj(l);d&&(i=d.name,p=d.basedir)}}if(e)for(let u of e)if(l&&u===l)Ba(n,o,l,void 0);else if(u===i){if(!p)Ba(n,o,i,p);else if(p.endsWith(fk.get(c))||Jj(fk.get(c),p))Ba(n,o,i,p);else if(r){let d=i+mk.sep+mk.relative(p,l);Ba(n,o,d,p)}}else u===s&&Ba(n,o,s,p);else Ba(n,o,i,p)},gk(this._iitmHook)}Fl.prototype.unhook=function(){_k(this._iitmHook)};Ha.exports=Fl;Ha.exports.Hook=Fl;Ha.exports.addHook=gk;Ha.exports.removeHook=_k;Ha.exports.createAddHookMessageChannel=$j});var E=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var te=globalThis;var q="10.75.3";function Je(){return Jn(te),te}function Jn(e){let t=e.__SENTRY__=e.__SENTRY__||{};return t.version=t.version||q,t[q]=t[q]||{}}function Un(e,t,n=te){let r=n.__SENTRY__=n.__SENTRY__||{},i=r[q]=r[q]||{};return i[e]||(i[e]=t())}var zn=["debug","info","warn","error","log","assert","trace"],S2="Sentry Logger ",$n={};function Me(e){if(!("console"in te))return e();let t=te.console,n={},r=Object.keys($n);r.forEach(i=>{let o=$n[i];n[i]=t[i],t[i]=o});try{return e()}finally{r.forEach(i=>{t[i]=n[i]})}}function E2(){d_().enabled=!0}function T2(){d_().enabled=!1}function $N(){return d_().enabled}function I2(...e){u_("log",...e)}function A2(...e){u_("warn",...e)}function N2(...e){u_("error",...e)}function u_(e,...t){E&&$N()&&Me(()=>{te.console[e](`${S2}[${e}]:`,...t)})}function d_(){return E?Un("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var g={enable:E2,disable:T2,isEnabled:$N,log:I2,warn:A2,error:N2};var zN=/\(error: (.*)\)/,ev=/captureMessage|captureException/;function Jp(...e){let t=e.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,i=0)=>{let o=[],s=n.split(`
|
|
5
|
+
`);for(let c=r;c<s.length;c++){let a=s[c];a.length>1024&&(a=a.slice(0,1024));let l=zN.test(a)?a.replace(zN,"$1"):a;if(!l.includes("Error: ")){for(let p of t){let u=p(l);if(u){o.push(u);break}}if(o.length>=50+i)break}}return tv(o.slice(i))}}function f_(e){return Array.isArray(e)?Jp(...e):e}function tv(e){if(!e.length)return[];let t=Array.from(e);return/sentryWrapped/.test(Qp(t).function||"")&&t.pop(),t.reverse(),ev.test(Qp(t).function||"")&&(t.pop(),ev.test(Qp(t).function||"")&&t.pop()),t.slice(0,50).map(n=>({...n,filename:n.filename||Qp(t).filename,function:n.function||"?"}))}function Qp(e){return e[e.length-1]||{}}var m_="<anonymous>";function Ac(e){try{return!e||typeof e!="function"?m_:e.name||m_}catch{return m_}}function $p(e){let t=e.exception;if(t){let n=[];try{return t.values.forEach(r=>{r.stacktrace.frames&&n.push(...r.stacktrace.frames)}),n}catch{return}}}function nv(e){let t=e?.startsWith("file://")?e.slice(7):e;return t?.match(/\/[A-Z]:/)&&(t=t.slice(1)),t}var Nc={},rv={};function g_(e,t){return Nc[e]=Nc[e]||[],Nc[e].push(t),()=>{let n=Nc[e];if(n){let r=n.indexOf(t);r!==-1&&n.splice(r,1)}}}function vc(e,t){if(!rv[e]){rv[e]=!0;try{t()}catch(n){E&&g.error(`Error while instrumenting ${e}`,n)}}}function Cs(e,t){let n=e&&Nc[e];if(n)for(let r of n)try{r(t)}catch(i){E&&g.error(`Error while triggering instrumentation handler.
|
|
6
|
+
Type: ${e}
|
|
7
|
+
Name: ${Ac(r)}
|
|
8
|
+
Error:`,i)}}var iv=Object.prototype.toString;function et(e){switch(iv.call(e)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return y_(e,Error)}}function zp(e,t){return iv.call(e)===`[object ${t}]`}function __(e){return zp(e,"ErrorEvent")}function xs(e){return zp(e,"String")}function Ui(e){return typeof e=="object"&&e!==null&&"__sentry_template_string__"in e&&"__sentry_template_values__"in e}function er(e){return e===null||Ui(e)||typeof e!="object"&&typeof e!="function"}function Yt(e){return zp(e,"Object")}function V(e){return typeof e=="object"&&e!==null}function h_(e){return typeof Event<"u"&&y_(e,Event)}function b_(e){return zp(e,"RegExp")}function bt(e){return!!(e?.then&&typeof e.then=="function")}function y_(e,t){try{return e instanceof t}catch{return!1}}function kt(e,t,n){if(!(t in e))return;let r=e[t];if(typeof r!="function")return;let i=n(r);typeof i=="function"&&Po(i,r);try{e[t]=i}catch{E&&g.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{E&&g.log(`Failed to add non-enumerable property "${String(t)}" to object`,e)}}function Po(e,t){try{let n=t.prototype||{};e.prototype=t.prototype=n,we(e,"__sentry_original__",t)}catch{}}function Ps(e,t,n,r=!0){let i=e[t];if(typeof i!="function")throw new Error(`Cannot wrap method: ${t} is not a function`);if(Nr(i))throw new Error(`Attempting to wrap method ${t} multiple times`);Po(n,i),Object.defineProperty(e,t,{writable:!0,configurable:!0,enumerable:r,value:n})}function Nr(e){return e.__sentry_original__}function eu(e){if(et(e))return{message:e.message,name:e.name,stack:e.stack,...ov(e)};if(h_(e)){let{type:t,target:n,currentTarget:r,detail:i}=e;return{type:t,target:n,currentTarget:r,...i?{detail:i}:{},...ov(e)}}return e}function ov(e){return V(e)?Object.fromEntries(Object.entries(e)):{}}function S_(e){let t=Object.keys(eu(e));return t.sort(),t[0]?t.join(", "):"[object has no keys]"}var ks;function ko(e){if(ks!==void 0)return ks?ks(e):e();let t=Symbol.for("__SENTRY_SAFE_RANDOM_ID_WRAPPER__"),n=te;return t in n&&typeof n[t]=="function"?(ks=n[t],ks(e)):(ks=null,e())}function ct(){return ko(()=>Math.random())}function tt(){return ko(()=>Date.now())}var sv=Symbol.for("sentry.skipNormalization"),av=Symbol.for("sentry.overrideNormalizationDepth");function cv(e){we(e,sv,!0)}function lv(e,t){we(e,av,t)}function pv(e){return!!e[sv]}function uv(e){let t=e[av];return typeof t=="number"?t:void 0}var dv;function Ke(e,t=100,n=1/0){try{return E_("",e,t,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function T_(e,t=3,n=100*1024){let r=Ke(e,t);return O2(r)>n?T_(e,t-1,n):r}function E_(e,t,n=1/0,r=1/0,i=C2()){let[o,s]=i;if(t==null||["boolean","string"].includes(typeof t)||typeof t=="number"&&Number.isFinite(t))return t;let c=I_(e,t);if(!c.startsWith("[object "))return c;if(pv(t))return t;let a=uv(t),l=a!==void 0?a:n;if(l===0)return c.replace("object ","");if(o(t))return"[Circular ~]";let p=t;if(p&&typeof p.toJSON=="function")try{let _=p.toJSON();return E_("",_,l-1,r,i)}catch{}let u=Array.isArray(t)?[]:{},d=0,m=eu(t);for(let _ in m){if(!Object.prototype.hasOwnProperty.call(m,_))continue;if(d>=r){u[_]="[MaxProperties ~]";break}let h=m[_];u[_]=E_(_,h,l-1,r,i),d++}return s(t),u}function I_(e,t){try{if(dv){let r=dv(t);if(r)return r}return typeof global<"u"&&t===global?"[Global]":typeof t=="number"&&!Number.isFinite(t)?`[${t}]`:typeof t=="function"?`[Function: ${Ac(t)}]`:typeof t=="symbol"?`[${String(t)}]`:typeof t=="bigint"?`[BigInt: ${String(t)}]`:`[object ${v2(t)}]`}catch(n){return`**non-serializable** (${n})`}}function v2(e){let t=Object.getPrototypeOf(e);return t?.constructor?t.constructor.name:"null prototype"}function R2(e){return~-encodeURI(e).split(/%..|./).length}function O2(e){return R2(JSON.stringify(e))}function C2(){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 Ge(e,t="[unserializable]"){if(typeof e=="string")return e;try{return JSON.stringify(e)}catch{return typeof t=="function"?t(e):t}}function mn(e,t=0){return typeof e!="string"||t===0||e.length<=t?e:`${e.slice(0,t)}...`}function A_(e,t){let n=e,r=n.length;if(r<=150)return n;t>r&&(t=r);let i=Math.max(t-60,0);i<5&&(i=0);let o=Math.min(i+140,r);return o>r-5&&(o=r),o===r&&(i=Math.max(o-140,0)),n=n.slice(i,o),i>0&&(n=`'{snip} ${n}`),o<r&&(n+=" {snip}"),n}function Ls(e,t){if(!Array.isArray(e))return"";let n=[];for(let r=0;r<e.length;r++){let i=e[r];er(i)?n.push(String(i)):i instanceof Error?n.push(i.message?`${i.name}: ${i.message}`:i.name):n.push(I_(void 0,i))}return n.join(t)}function vr(e,t,n=!1){return xs(e)?b_(t)?t.test(e):xs(t)?n?e===t:e.includes(t):typeof t=="function"?t(e):!1:!1}function fn(e,t=[],n=!1){for(let r of t)if(vr(e,r,n))return!0;return!1}function x2(){let e=te;return e.crypto||e.msCrypto}var N_;function P2(){return ct()*16}function dt(e=x2()){try{if(e?.randomUUID)return ko(()=>e.randomUUID()).replace(/-/g,"")}catch{}return N_||(N_="10000000100040008000"+1e11),N_.replace(/[018]/g,t=>(t^(P2()&15)>>t/4).toString(16))}function mv(e){return e.exception?.values?.[0]}function Di(e){let{message:t,event_id:n}=e;if(t)return t;let r=mv(e);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function R_(e,t,n){let r=e.exception=e.exception||{},i=r.values=r.values||[],o=i[0]=i[0]||{};o.value||(o.value=t||""),o.type||(o.type=n||"Error")}function Dn(e,t){let n=mv(e);if(!n)return;let r={type:"generic",handled:!0},i=n.mechanism;if(n.mechanism={...r,...i,...t},t&&"data"in t){let o={...i?.data,...t.data};n.mechanism.data=o}}var k2=/^(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 v_(e){return parseInt(e||"",10)}function Ms(e){let t=e.match(k2)||[],n=v_(t[1]),r=v_(t[2]),i=v_(t[3]);return{buildmetadata:t[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(i)?void 0:i,prerelease:t[4]}}function tu(e){if(fv(e))return!0;try{we(e,"__sentry_captured__",!0)}catch{}return!1}function fv(e){try{return e.__sentry_captured__}catch{}}var _v=1e3;function Rr(){return tt()/_v}function L2(){let{performance:e}=te;if(!e?.now||!e.timeOrigin)return Rr;let t=e.timeOrigin;return()=>(t+ko(()=>e.now()))/_v}var gv;function lt(){return(gv??(gv=L2()))()}function hv(e){let t=lt(),n={sid:dt(),init:!0,timestamp:t,started:t,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>M2(n)};return e&&li(n,e),n}function li(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||lt(),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:dt()),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 bv(e,t){let n={};t?n={status:t}:e.status==="ok"&&(n={status:"exited"}),li(e,n)}function M2(e){return{sid:`${e.sid}`,init:e.init,started:new Date(e.started*1e3).toISOString(),timestamp:new Date(e.timestamp*1e3).toISOString(),status:e.status,errors:e.errors,did:typeof e.did=="number"||typeof e.did=="string"?`${e.did}`:void 0,duration:e.duration,abnormal_mechanism:e.abnormal_mechanism,attrs:{release:e.release,environment:e.environment,ip_address:e.ipAddress,user_agent:e.userAgent}}}function Bi(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 i in t)Object.prototype.hasOwnProperty.call(t,i)&&(r[i]=Bi(r[i],t[i],n-1));return r}function yt(){return dt()}function jt(){return dt().substring(16)}function Lo(e){try{let t=te.WeakRef;if(typeof t=="function")return new t(e)}catch{}return e}function Mo(e){if(e){if(typeof e=="object"&&"deref"in e&&typeof e.deref=="function")try{return e.deref()}catch{return}return e}}var O_="_sentrySpan";function Bn(e,t){t?we(e,O_,Lo(t)):delete e[O_]}function tr(e){return Mo(e[O_])}var w2=100,Zt=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:yt(),sampleRand:ct()}}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,Bn(t,tr(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&&li(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():Yt(n)?t:void 0,{tags:i,attributes:o,extra:s,user:c,contexts:a,level:l,fingerprint:p=[],propagationContext:u,conversationId:d}=r||{};return this._tags={...this._tags,...i},this._attributes={...this._attributes,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},c&&Object.keys(c).length&&(this._user=c),l&&(this._level=l),p.length&&(this._fingerprint=p),u&&(this._propagationContext=u),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,Bn(this,void 0),this._attachments=[],this.setPropagationContext({traceId:yt(),sampleRand:ct()}),this._notifyScopeListeners(),this}addBreadcrumb(t,n){let r=typeof n=="number"?n:w2;if(r<=0)return this;let i={timestamp:Rr(),...t,message:t.message?mn(t.message,2048):t.message};return this._breadcrumbs.push(i),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:tr(this),conversationId:this._conversationId}}setSDKProcessingMetadata(t){return this._sdkProcessingMetadata=Bi(this._sdkProcessingMetadata,t,2),this}setPropagationContext(t){return this._propagationContext=t,this}getPropagationContext(){return this._propagationContext}captureException(t,n){let r=n?.event_id||dt();if(!this._client)return E&&g.warn("No client configured on scope - will not capture exception!"),r;let i=new Error("Sentry syntheticException");return this._client.captureException(t,{originalException:t,syntheticException:i,...n,event_id:r},this),r}captureMessage(t,n,r){let i=r?.event_id||dt();if(!this._client)return E&&g.warn("No client configured on scope - will not capture message!"),i;let o=r?.syntheticException??new Error(t);return this._client.captureMessage(t,n,{originalException:t,syntheticException:o,...r,event_id:i},this),i}captureEvent(t,n){let r=t.event_id||n?.event_id||dt();return this._client?(this._client.captureEvent(t,{...n,event_id:r},this),r):(E&&g.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 ws(){return Un("defaultCurrentScope",()=>new Zt)}function Rt(){return Un("defaultIsolationScope",()=>new Zt)}var yv=e=>e instanceof Promise&&!e[Sv],Sv=Symbol("chained PromiseLike"),nu=(e,t,n)=>{let r=e.then(i=>(t(i),i),i=>{throw n(i),i});return yv(r)&&yv(e)?r:G2(e,r)},G2=(e,t)=>{if(!t)return e;let n=!1;for(let r in e){if(r in t)continue;n=!0;let i=e[r];typeof i=="function"?Object.defineProperty(t,r,{value:(...o)=>i.apply(e,o),enumerable:!0,configurable:!0,writable:!0}):t[r]=i}return n&&Object.assign(t,{[Sv]:!0}),t};var C_=class{constructor(t,n){let r;t?r=t:r=new Zt;let i;n?i=n:i=new Zt,this._stack=[{scope:r}],this._isolationScope=i}withScope(t){let n=this._pushScope(),r;try{r=t(n)}catch(i){throw this._popScope(),i}return bt(r)?nu(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 Gs(){let e=Je(),t=Jn(e);return t.stack=t.stack||new C_(ws(),Rt())}function U2(e){return Gs().withScope(e)}function D2(e,t){let n=Gs();return n.withScope(()=>(n.getStackTop().scope=e,t(e)))}function Ev(e){return Gs().withScope(()=>e(Gs().getIsolationScope()))}function Tv(){return{withIsolationScope:Ev,withScope:U2,withSetScope:D2,withSetIsolationScope:(e,t)=>Ev(t),getCurrentScope:()=>Gs().getScope(),getIsolationScope:()=>Gs().getIsolationScope()}}function x_(e){let t=Je(),n=Jn(t);n.acs=e}function St(e){let t=Jn(e);return t.acs?t.acs:Tv()}function B2(e){return typeof e=="object"&&e!=null&&!Array.isArray(e)&&Object.keys(e).includes("value")}function H2(e,t){let{value:n,unit:r}=B2(e)?e:{value:e,unit:void 0},i=F2(n),o=r&&typeof r=="string"?{unit:r}:{};if(i)return{...i,...o};if(!t||t==="skip-undefined"&&n===void 0)return;let s="";try{s=JSON.stringify(n)??""}catch{}return{value:s,type:"string",...o}}function pi(e,t=!1){let n={};for(let[r,i]of Object.entries(e??{})){let o=H2(i,t);o&&(n[r]=o)}return n}function P_(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 i=r.value;Array.isArray(i)?t+=Iv(i[0])*i.length:er(i)?t+=Iv(i):t+=100}return t}function Iv(e){return typeof e=="string"?e.length*2:typeof e=="boolean"?4:typeof e=="number"?8:0}function F2(e){if(Array.isArray(e))return{value:e,type:"array"};let t=typeof e=="string"?"string":typeof e=="boolean"?"boolean":typeof e=="number"&&!Number.isNaN(e)?Number.isInteger(e)?"integer":"double":null;if(t)return{value:e,type:t}}var Av;function Nv(){return Av?.()}function k_(){return Av!==void 0}function ne(){let e=Je();return St(e).getCurrentScope()}function J(){let e=Je();return St(e).getIsolationScope()}function wo(){return Un("globalScope",()=>new Zt)}function Be(...e){let t=Je(),n=St(t);if(e.length===2){let[r,i]=e;return r?n.withSetScope(r,i):n.withScope(i)}return n.withScope(e[0])}function nr(...e){let t=Je(),n=St(t);if(e.length===2){let[r,i]=e;return r?n.withSetIsolationScope(r,i):n.withIsolationScope(i)}return n.withIsolationScope(e[0])}function C(){return ne().getClient()}function Go(e){let t=Nv();if(t)return{trace_id:t.traceId,span_id:t.spanId};let n=e.getPropagationContext(),{traceId:r,parentSpanId:i,propagationSpanId:o}=n,s={trace_id:r,span_id:o||jt()};return i&&(s.parent_span_id=i),s}var ve="sentry.source",Hn="sentry.sample_rate",L_="sentry.previous_trace_sample_rate",B="sentry.op",S="sentry.origin",M_="sentry.status.message";var ru="sentry.measurement_unit",iu="sentry.measurement_value",w_="sentry.release",G_="sentry.environment";var U_="sentry.sdk.integrations",D_="user.id",B_="user.email",Rc="user.ip_address",H_="user.name",gn="sentry.custom_span_name",Us="sentry.profile_id",Ds="sentry.exclusive_time",F_="cache.hit",W_="cache.key",V_="cache.item_size",Y_="http.request.method";var Uo="gen_ai.conversation.id";function Xt(e){if(e<400&&e>=100)return{code:1};if(e>=400&&e<500)switch(e){case 401:return{code:2,message:"unauthenticated"};case 403:return{code:2,message:"permission_denied"};case 404:return{code:2,message:"not_found"};case 409:return{code:2,message:"already_exists"};case 413:return{code:2,message:"failed_precondition"};case 429:return{code:2,message:"resource_exhausted"};case 499:return{code:2,message:"cancelled"};default:return{code:2,message:"invalid_argument"}}if(e>=500&&e<600)switch(e){case 501:return{code:2,message:"unimplemented"};case 503:return{code:2,message:"unavailable"};case 504:return{code:2,message:"deadline_exceeded"};default:return{code:2,message:"internal_error"}}return{code:2,message:"internal_error"}}function Bs(e,t){e.setAttribute("http.response.status_code",t);let n=Xt(t);n.message!=="unknown_error"&&e.setStatus(n)}var vv="_sentryScope",Rv="_sentryIsolationScope",Ov=Symbol.for("sentry.otelSourceInference"),Cv=Symbol.for("sentry.otelSourceExplicitlySet"),xv=Symbol.for("sentry.tracerProviderSpan");function Or(e,t,n){e&&(we(e,Rv,Lo(n)),we(e,vv,t))}function Kt(e){let t=e;return{scope:t[vv],isolationScope:Mo(t[Rv])}}function j_(e){we(e,Ov,!0)}function Hs(e){return e[Ov]===!0}function Z_(e){we(e,Cv,!0)}function X_(e){return e[Cv]===!0}function K_(e){we(e,xv,!0)}function ou(e){return e[xv]===!0}var ui="sentry-";var kv=8192;function rr(e){let t=Fs(e);if(!t)return;let n=Object.entries(t).reduce((r,[i,o])=>{if(i.startsWith(ui)){let s=i.slice(ui.length);r[s]=o}return r},{});if(Object.keys(n).length>0)return n}function Hi(e){if(!e)return;let t=Object.entries(e).reduce((n,[r,i])=>(i&&(n[`${ui}${r}`]=i),n),{});return q_(t)}function Fs(e){if(!(!e||!xs(e)&&!Array.isArray(e)))return Array.isArray(e)?e.reduce((t,n)=>{let r=Pv(n);return Object.entries(r).forEach(([i,o])=>{t[i]=o}),t},{}):Pv(e)}function Pv(e){return e.split(",").map(t=>{let n=t.indexOf("=");if(n===-1)return[];let r=t.slice(0,n),i=t.slice(n+1);return[r,i].map(o=>{try{return decodeURIComponent(o.trim())}catch{return}})}).reduce((t,[n,r])=>(n&&r&&(t[n]=r),t),{})}function q_(e){if(Object.keys(e).length!==0)return Object.entries(e).reduce((t,[n,r],i)=>{let o=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,s=i===0?o:`${t},${o}`;return s.length>kv?(E&&g.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),t):s},"")}function Ws(e,t){if(!e)return t;let n=Fs(e),r=Fs(t);if(!r)return e;let i={},o=!1,s={},c={};for(let[a,l]of Object.entries(r))a.startsWith(ui)?(s[a]=l,o=!0):c[a]=l;if(n)for(let[a,l]of Object.entries(n))(!o||!a.startsWith(ui))&&(i[a]=l);o&&Object.assign(i,s);for(let[a,l]of Object.entries(c))i[a]??(i[a]=l);return q_(i)}var W2=/^o(\d+)\./,V2=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)((?:\[[:.%\w]+\]|[\w.-]+))(?::(\d+))?\/(.+)/;function Y2(e){return e==="http"||e==="https"}function rn(e,t=!1){let{host:n,path:r,pass:i,port:o,projectId:s,protocol:c,publicKey:a}=e;return`${c}://${a}${t&&i?`:${i}`:""}@${n}${o?`:${o}`:""}/${r&&`${r}/`}${s}`}function j2(e){let t=V2.exec(e);if(!t){Me(()=>{console.error(`Invalid Sentry Dsn: ${e}`)});return}let[n,r,i="",o="",s="",c=""]=t.slice(1),a="",l=c,p=l.split("/");if(p.length>1&&(a=p.slice(0,-1).join("/"),l=p.pop()),l){let u=l.match(/^\d+/);u&&(l=u[0])}return Lv({host:o,pass:i,path:a,projectId:l,port:s,protocol:n,publicKey:r})}function Lv(e){return{protocol:e.protocol,publicKey:e.publicKey||"",pass:e.pass||"",host:e.host,port:e.port||"",path:e.path||"",projectId:e.projectId}}function Z2(e){if(!E)return!0;let{port:t,projectId:n,protocol:r}=e;return["protocol","publicKey","host","projectId"].find(s=>e[s]?!1:(g.error(`Invalid Sentry Dsn: ${s} missing`),!0))?!1:n.match(/^\d+$/)?Y2(r)?t&&isNaN(parseInt(t,10))?(g.error(`Invalid Sentry Dsn: Invalid port ${t}`),!1):!0:(g.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(g.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function X2(e){return e.match(W2)?.[1]}function su(e){let t=e.getOptions(),{host:n}=e.getDsn()||{},r;return t.orgId?r=String(t.orgId):n&&(r=X2(n)),r}function Mv(e){let t=typeof e=="string"?j2(e):Lv(e);if(!(!t||!Z2(t)))return t}function Tn(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 au=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function wv(e){if(!e)return;let t=e.match(au);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 Oc(e){return!!e.parentSpanId||!!e.dsc}function In(e,t){let n=wv(e),r=rr(t);if(!n?.traceId)return{traceId:yt(),sampleRand:ct()};let i=K2(n,r);r&&(r.sample_rand=i.toString());let{traceId:o,parentSpanId:s,parentSampled:c}=n;return{traceId:o,parentSpanId:s,sampled:c,dsc:r||{},sampleRand:i}}function Fi(e=yt(),t=jt(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${e}-${t}${r}`}function Wi(e=yt(),t=jt(),n){return`00-${e}-${t}-${n?"01":"00"}`}function K2(e,t){let n=Tn(t?.sample_rand);if(n!==void 0)return n;let r=Tn(t?.sample_rate);return r&&e?.parentSampled!==void 0?e.parentSampled?ct()*r:r+ct()*(1-r):ct()}function Cc(e,t){let n=su(e);return t&&n&&t!==n?(g.log(`Won't continue trace because org IDs don't match (incoming baggage: ${t}, SDK options: ${n})`),!1):(e.getOptions().strictTraceContinuation||!1)&&(t&&!n||!t&&n)?(g.log(`Starting a new trace because strict trace continuation is enabled but one org ID is missing (incoming baggage: ${t}, Sentry client: ${n})`),!1):!0}var lu=0,Pc=1,Gv=!1;function Dv(e){let{spanId:t,traceId:n}=e.spanContext(),{data:r,op:i,parent_span_id:o,status:s,origin:c,links:a}=oe(e);return{parent_span_id:o,span_id:t,trace_id:n,data:r,op:i,status:s,origin:c,links:a}}function xr(e){let{spanId:t,traceId:n,isRemote:r}=e.spanContext(),i=r?t:oe(e).parent_span_id,o=Kt(e).scope,s=r?o?.getPropagationContext().propagationSpanId||jt():t;return{parent_span_id:i,span_id:s,trace_id:n}}function kc(e){let{traceId:t,spanId:n}=e.spanContext(),r=Qt(e);return Fi(t,n,r)}function Bv(e){let{traceId:t,spanId:n}=e.spanContext(),r=Qt(e);return Wi(t,n,r)}function Do(e){if(e&&e.length>0)return e.map(({context:{spanId:t,traceId:n,traceFlags:r,...i},attributes:o})=>({span_id:t,trace_id:n,sampled:r===Pc,attributes:o,...i}))}function J_(e){if(e?.length)return e.map(({context:{spanId:t,traceId:n,traceFlags:r},attributes:i})=>({span_id:t,trace_id:n,sampled:r===Pc,attributes:i}))}function qt(e){return typeof e=="number"?Uv(e):Array.isArray(e)?e[0]+e[1]/1e9:e instanceof Date?Uv(e.getTime()):lt()}function Uv(e){return e>9999999999?e/1e3:e}function oe(e){if(Lc(e))return e.getSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Fv(e)){let{attributes:r,startTime:i,name:o,endTime:s,status:c,links:a}=e;return{span_id:t,trace_id:n,data:r,description:o,parent_span_id:Hv(e),start_timestamp:qt(i),timestamp:qt(s)||void 0,status:Bo(c),op:r[B],origin:r[S],links:Do(a)}}return{span_id:t,trace_id:n,start_timestamp:0,data:{}}}function pu(e){if(Lc(e))return e.getStreamedSpanJSON();let{spanId:t,traceId:n}=e.spanContext();if(Fv(e)){let{attributes:r,startTime:i,name:o,endTime:s,status:c,links:a}=e;return{name:o,span_id:t,trace_id:n,parent_span_id:Hv(e),start_timestamp:qt(i),end_timestamp:qt(s),is_segment:e===Vs(e),status:du(c),attributes:$_(r,c),links:J_(a)}}return{span_id:t,trace_id:n,start_timestamp:0,name:"",end_timestamp:0,status:"ok",is_segment:e===Vs(e)}}function Hv(e){return"parentSpanId"in e?e.parentSpanId:"parentSpanContext"in e?e.parentSpanContext?.spanId:void 0}function uu(e){return{...e,attributes:pi(e.attributes),links:e.links?.map(t=>({...t,attributes:pi(t.attributes)}))}}function Fv(e){let t=e;return!!t.attributes&&!!t.startTime&&!!t.name&&!!t.endTime&&!!t.status}function Lc(e){return typeof e.getSpanJSON=="function"}function Qt(e){let{traceFlags:t}=e.spanContext();return t===Pc}function Bo(e){if(!(!e||e.code===0))return e.code===1?"ok":e.message||"internal_error"}function du(e){return!e||e.code===1||e.code===0||e.message==="cancelled"?"ok":"error"}function $_(e,t){let n=du(t)==="error"?t?.message:void 0;return{...n&&{[M_]:n},...e}}var xc="_sentryChildSpans",Q_="_sentryRootSpan";function di(e,t){let n=e[Q_]||e;we(t,Q_,n),Qt(e)&&(!e.isRecording()&&!n.isRecording()||(e[xc]?e[xc].add(t):we(e,xc,new Set([t]))))}function Mc(e){let t=new Set;function n(r){if(!t.has(r)&&Qt(r)){t.add(r);let i=r[xc]?Array.from(r[xc]):[];for(let o of i)n(o)}}return n(e),Array.from(t)}var Re=Vs;function Vs(e){return e[Q_]||e}function Q(){let e=Je(),t=St(e);return t.getActiveSpan?t.getActiveSpan():tr(ne())}function Ho(){Gv||(Me(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly or use `ignoreSpans`.")}),Gv=!0)}function z_(e,t){e.updateName(t),e.setAttributes({[ve]:"custom",[gn]:t})}function Ue(e){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let t=e||C()?.getOptions();return!!t&&(t.tracesSampleRate!=null||!!t.tracesSampler)}function Wv(e){g.log(`Ignoring span ${e.op} - ${e.description} because it matches \`ignoreSpans\`.`)}function ir(e,t){if(!t?.length)return!1;for(let n of t){if(Q2(n)){if(e.description&&vr(e.description,n))return E&&Wv(e),!0;continue}let r=!!n.attributes&&Object.keys(n.attributes).length>0;if(!n.name&&!n.op&&!r)continue;let i=n.name?e.description&&vr(e.description,n.name):!0,o=n.op?e.op&&vr(e.op,n.op):!0,s=n.attributes?Object.entries(n.attributes).every(([c,a])=>q2(e.attributes?.[c],a)):!0;if(i&&o&&s)return E&&Wv(e),!0}return!1}function q2(e,t){return typeof e=="string"&&(typeof t=="string"||t instanceof RegExp)?vr(e,t):Array.isArray(e)&&Array.isArray(t)?e.length===t.length&&e.every((n,r)=>n===t[r]):e===t}function Vv(e,t){let n=t.parent_span_id,r=t.span_id;if(n)for(let i of e)i.parent_span_id===r&&(i.parent_span_id=n)}function Q2(e){return typeof e=="string"||e instanceof RegExp}var Yv=Symbol.for("sentry.nonRecordingSpan"),Pr=class{constructor(t={}){this._traceId=t.traceId||yt(),this._spanId=t.spanId||jt(),this.dropReason=t.dropReason,we(this,Yv,!0)}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:lu}}end(t){}setAttribute(t,n){return this}setAttributes(t){return this}setStatus(t){return this}updateName(t){return this}isRecording(){return!1}addEvent(t,n,r){return this}addLink(t){return this}addLinks(t){return this}recordException(t,n){}};function Vi(e){return!!e&&e[Yv]===!0}var Yi="production";var jv="_frozenDsc";function eh(e,t){we(e,jv,t)}function th(e,t){let n=t.getOptions(),{publicKey:r}=t.getDsn()||{},i={environment:n.environment||Yi,release:n.release,public_key:r,trace_id:e,org_id:su(t)};return t.emit("createDsc",i),i}function or(e,t){let n=t.getPropagationContext();return n.dsc||th(n.traceId,e)}function nt(e){let t=C();if(!t)return{};let n=Re(e),r=oe(n),i=r.data,o=n.spanContext().traceState,s=o?.get("sentry.sample_rate")??i[Hn]??i[L_];function c(b){return(typeof s=="number"||typeof s=="string")&&(b.sample_rate=`${s}`),b}let a=n[jv];if(a)return c(a);let l=Vi(n),p=l&&n.dropReason==="ignored";if(l&&(!Ue(t.getOptions())||p)){let b=Kt(n).scope;if(b){let N={...or(t,b)};return p&&(N.sampled="false"),c(N)}}let u=o?.get("sentry.dsc"),d=u&&rr(u);if(d)return c(d);let m=th(e.spanContext().traceId,t),_=i[ve]??i["sentry.segment.name.source"],h=r.description;return _!=="url"&&h&&(m.transaction=h),Ue()&&(m.sampled=String(Qt(n)),m.sample_rand=o?.get("sentry.sample_rand")??Kt(n).scope?.getPropagationContext().sampleRand.toString()),c(m),t.emit("createDsc",m,n),m}function nh(e){let t=nt(e);return Hi(t)}function rh(e){return we(e,"_streamed",!0),e}function mi(e){return!!e&&typeof e=="function"&&"_streamed"in e&&!!e._streamed}function Lt(e,t=[]){return[e,t]}function mu(e,t){let[n,r]=e;return[n,[...r,t]]}function wc(e,t){let n=e[1];for(let r of n){let i=r[0].type;if(t(r,i))return!0}return!1}function oh(e,t){return wc(e,(n,r)=>t.includes(r))}function ih(e){let t=Jn(te);return t.encodePolyfill?t.encodePolyfill(e):new TextEncoder().encode(e)}function Gc(e){let[t,n]=e,r=JSON.stringify(t);function i(o){typeof r=="string"?r=typeof o=="string"?r+o:[ih(r),o]:r.push(typeof o=="string"?ih(o):o)}for(let o of n){let[s,c]=o;if(i(`
|
|
9
|
+
${JSON.stringify(s)}
|
|
10
|
+
`),typeof c=="string"||c instanceof Uint8Array)i(c);else{let a;try{a=JSON.stringify(c)}catch{a=JSON.stringify(Ke(c))}i(a)}}return typeof r=="string"?r:J2(r)}function J2(e){let t=e.reduce((i,o)=>i+o.length,0),n=new Uint8Array(t),r=0;for(let i of e)n.set(i,r),r+=i.length;return n}function sh(e){return[{type:"span"},e]}function ah(e){let t=typeof e.data=="string"?ih(e.data):e.data;return[{type:"attachment",length:t.length,filename:e.filename,content_type:e.contentType,attachment_type:e.attachmentType},t]}var Zv={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 $2(e){return e in Zv}function fu(e){return $2(e)?Zv[e]:e}function Ys(e){if(!e?.sdk)return;let{name:t,version:n}=e.sdk;return{name:t,version:n}}function ch(e,t,n,r){let i=e.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:e.event_id,sent_at:new Date(tt()).toISOString(),...t&&{sdk:t},...!!n&&r&&{dsn:rn(r)},...i&&{trace:i}}}function z2(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 Xv(e,t,n,r){let i=Ys(n),o={sent_at:new Date(tt()).toISOString(),...i&&{sdk:i},...!!r&&t&&{dsn:rn(t)}},s="aggregates"in e?[{type:"sessions"},e]:[{type:"session"},e.toJSON()];return Lt(o,[s])}function Kv(e,t,n,r){let i=Ys(n),o=e.type&&e.type!=="replay_event"?e.type:"event";z2(e,n?.sdk);let s=ch(e,i,r,t);return delete e.sdkProcessingMetadata,Lt(s,[[{type:o},e]])}function qv(e,t){function n(m){return!!m.trace_id&&!!m.public_key}let r=nt(e[0]),i=t?.getDsn(),o=t?.getOptions().tunnel,s={sent_at:new Date(tt()).toISOString(),...n(r)&&{trace:r},...!!o&&i&&{dsn:rn(i)}},{beforeSendSpan:c,ignoreSpans:a}=t?.getOptions()||{},l=a?.length?e.filter(m=>{let _=oe(m);return!ir({description:_.description,op:_.op,attributes:_.data},a)}):e,p=e.length-l.length;p&&t?.recordDroppedEvent("before_send","span",p);let u=c?m=>{let _=oe(m),h=mi(c)?_:c(_);return h||(Ho(),_)}:oe,d=[];for(let m of l){let _=u(m);_&&d.push(sh(_))}return Lt(s,d)}function Uc(e){if(!E)return;let{description:t="< unknown name >",op:n="< unknown op >",parent_span_id:r}=oe(e),{spanId:i}=e.spanContext(),o=Qt(e),s=Re(e),c=s===e,a=`[Tracing] Starting ${o?"sampled":"unsampled"} ${c?"root ":""}span`,l=[`op: ${n}`,`name: ${t}`,`ID: ${i}`];if(r&&l.push(`parent ID: ${r}`),!c){let{op:p,description:u}=oe(s);l.push(`root ID: ${s.spanContext().spanId}`),p&&l.push(`root op: ${p}`),u&&l.push(`root description: ${u}`)}g.log(`${a}
|
|
11
|
+
${l.join(`
|
|
12
|
+
`)}`)}function Dc(e){if(!E)return;let{description:t="< unknown name >",op:n="< unknown op >"}=oe(e),{spanId:r}=e.spanContext(),o=Re(e)===e,s=`[Tracing] Finishing "${n}" ${o?"root ":""}span "${t}" with ID ${r}`;g.log(s)}function lh(e,t,n,r=Q()){let i=r&&Re(r);i&&(E&&g.log(`[Measurement] Setting measurement on root span: ${e} = ${t} ${n}`),i.addEvent(e,{[iu]:t,[ru]:n}))}function Fo(e){if(!e||e.length===0)return;let t={};return e.forEach(n=>{let r=n.attributes||{},i=r[ru],o=r[iu];typeof i=="string"&&typeof o=="number"&&(t[n.name]={value:o,unit:i})}),t}function Qv(e){Jn(Je()).segmentSpanCaptureStrategy=e}function Bc(){return Jn(Je()).segmentSpanCaptureStrategy}function rt(e){return e.getOptions().traceLifecycle==="stream"}var Jv=1e3,js=class{constructor(t={}){this._traceId=t.traceId||yt(),this._spanId=t.spanId||jt(),this._startTime=t.startTimestamp||lt(),this._links=t.links,this._attributes={},this.setAttributes({[S]:"manual",[B]:t.op,...t.attributes}),this._name=t.name,t.parentSpanId&&(this._parentSpanId=t.parentSpanId),"sampled"in t&&(this._sampled=t.sampled),t.endTimestamp&&(this._endTime=t.endTimestamp),this._events=[],this._isStandaloneSpan=t.isStandalone,this._endTime&&this._onSpanEnded()}addLink(t){return this._frozen?this:(this._links?this._links.push(t):this._links=[t],this)}addLinks(t){return this._frozen?this:(this._links?this._links.push(...t):this._links=t,this)}recordException(t,n){}spanContext(){let{_spanId:t,_traceId:n,_sampled:r}=this;return{spanId:t,traceId:n,traceFlags:r?Pc:lu}}setAttribute(t,n){return this._frozen?this:(n===void 0?delete this._attributes[t]:this._attributes[t]=n,t===ve&&n!==void 0&&Hs(this)&&Z_(this),this)}setAttributes(t){return Object.keys(t).forEach(n=>this.setAttribute(n,t[n])),this}updateStartTime(t){this._frozen||(this._startTime=qt(t))}setStatus(t){return this._frozen?this:(this._status=t,this)}updateName(t){return this._frozen?this:(this._name=t,Hs(this)||this.setAttribute(ve,"custom"),this)}end(t){if(this._endTime){this._frozen=ou(this);return}this._endTime=qt(t),Dc(this),this._onSpanEnded(),this._frozen=ou(this)}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[B],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:Bo(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[S],profile_id:this._attributes[Us],exclusive_time:this._attributes[Ds],measurements:Fo(this._events),is_segment:this._isStandaloneSpan&&Re(this)===this||void 0,segment_id:this._isStandaloneSpan?Re(this).spanContext().spanId:void 0,links:Do(this._links)}}getStreamedSpanJSON(){return{name:this._name??"",span_id:this._spanId,trace_id:this._traceId,parent_span_id:this._parentSpanId,start_timestamp:this._startTime,end_timestamp:this._endTime??this._startTime,is_segment:this._isStandaloneSpan||this===Re(this),status:du(this._status),attributes:$_(this._attributes,this._status),links:J_(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(t,n,r){if(this._frozen)return this;E&&g.log("[Tracing] Adding an event to span:",t);let i=$v(n)?n:r||lt(),o=$v(n)?{}:n||{},s={name:t,time:qt(i),attributes:o};return this._events.push(s),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let t=C();t&&(t.emit("spanEnd",this),this._isStandaloneSpan||t.emit("afterSpanEnd",this));let n=Re(this),r=this._isStandaloneSpan||this===n;if(this._isStandaloneSpan){this._sampled?tW(qv([this],t)):(E&&g.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),t&&t.recordDroppedEvent("sample_rate","span"));return}if(!r){let s=Bc();if(s){let c=Kt(this).scope||ne();s.onChildSpanEnded(this,n,a=>this._convertSpanToTransaction(a),c)}return}if(t&&rt(t)){t.emit("afterSegmentSpanEnd",this);return}let i=Kt(this).scope||ne(),o=Bc();if(o)o.onSegmentSpanEnded(s=>this._convertSpanToTransaction(s),i);else{let s=this._convertSpanToTransaction();s&&i.captureEvent(s)}}_convertSpanToTransaction(t={}){if(!zv(oe(this)))return;this._name||(E&&g.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:n,isolationScope:r}=Kt(this),i=n?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;t.onSpanCaptured?.(this);let o=[];for(let u of Mc(this)){if(u===this||eW(u)||t.isSpanAlreadyCaptured?.(u))continue;let d=oe(u);zv(d)&&(t.onSpanCaptured?.(u),o.push(d))}let s=this._attributes[ve];delete this._attributes[gn];let c=!1;o.forEach(u=>{delete u.data[gn],u.op?.startsWith("gen_ai.")&&(c=!0)});let a={contexts:{trace:Dv(this)},spans:o.length>Jv?o.sort((u,d)=>u.start_timestamp-d.start_timestamp).slice(0,Jv):o,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:n,capturedSpanIsolationScope:r,dynamicSamplingContext:nt(this),hasGenAiSpans:c},request:i,...s&&{transaction_info:{source:s}}},l=Fo(this._events);return l&&Object.keys(l).length&&(E&&g.log("[Measurements] Adding measurements to transaction event",JSON.stringify(l,void 0,2)),a.measurements=l),a}};function $v(e){return e&&typeof e=="number"||e instanceof Date||Array.isArray(e)}function zv(e){return!!e.start_timestamp&&!!e.timestamp&&!!e.span_id&&!!e.trace_id}function eW(e){return e instanceof js&&e.isStandaloneSpan()}function tW(e){let t=C();if(!t)return;let n=e[1];if(!n||n.length===0){t.recordDroppedEvent("before_send","span");return}t.sendEnvelope(e)}function sr(e,t,n=()=>{},r=()=>{}){let i;try{i=e()}catch(o){throw t(o),n(),o}return nW(i,t,n,r)}function nW(e,t,n,r){return bt(e)?nu(e,i=>{n(),r(i)},i=>{t(i),n()}):(n(),r(e),e)}function Hc(e,t,n){if(!Ue(e))return[!1];let r,i;typeof e.tracesSampler=="function"?(i=e.tracesSampler({...t,inheritOrSampleWith:c=>typeof t.parentSampleRate=="number"?t.parentSampleRate:typeof t.parentSampled=="boolean"?Number(t.parentSampled):c}),r=!0):t.parentSampled!==void 0?i=t.parentSampled:typeof e.tracesSampleRate<"u"&&(i=e.tracesSampleRate,r=!0);let o=Tn(i);if(o===void 0)return E&&g.warn(`[Tracing] Discarding root span because of invalid sample rate. Sample rate must be a boolean or a number between 0 and 1. Got ${JSON.stringify(i)} of type ${JSON.stringify(typeof i)}.`),[!1];if(!o)return E&&g.log(`[Tracing] Discarding transaction because ${typeof e.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,o,r];let s=n<o;return s||E&&g.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(i)})`),[s,o,r]}var Zs="__SENTRY_SUPPRESS_TRACING__";function Se(e,t){let n=Wo();if(n.startSpan)return n.startSpan(e,t);let r=dh(e),{forceTransaction:i,parentSpan:o,scope:s}=e,c=s?.clone();return Be(c,()=>nR(o)(()=>{let l=ne(),p=mh(l,o),u=C(),m=e.onlyIfParent&&!p?ph(l,u):uh({parentSpan:p,spanArguments:r,forceTransaction:i,scope:l});return(!Lr(m)||!p)&&Bn(l,m),sr(()=>t(m),()=>{let{status:_}=oe(m);m.isRecording()&&(!_||_==="ok")&&m.setStatus({code:2,message:"internal_error"})},()=>{m.end()})}))}function ke(e,t){let n=Wo();if(n.startSpanManual)return n.startSpanManual(e,t);let r=dh(e),{forceTransaction:i,parentSpan:o,scope:s}=e,c=s?.clone();return Be(c,()=>nR(o)(()=>{let l=ne(),p=mh(l,o),d=e.onlyIfParent&&!p?ph(l,C()):uh({parentSpan:p,spanArguments:r,forceTransaction:i,scope:l});return(!Lr(d)||!p)&&Bn(l,d),sr(()=>t(d,()=>d.end()),()=>{let{status:m}=oe(d);d.isRecording()&&(!m||m==="ok")&&d.setStatus({code:2,message:"internal_error"})})}))}function k(e){let t=Wo();return t.startInactiveSpan?t.startInactiveSpan(e):tR(e)}function Xs(e){return tR(e)}function tR(e){let t=dh(e),{forceTransaction:n,parentSpan:r}=e;return(e.scope?o=>Be(e.scope,o):r!==void 0?o=>se(r,o):o=>o())(()=>{let o=ne(),s=mh(o,r),c=C();return e.onlyIfParent&&!s?ph(o,c):uh({parentSpan:s,spanArguments:t,forceTransaction:n,scope:o})})}var An=(e,t)=>{let n=Je(),r=St(n);if(r.continueTrace)return r.continueTrace(e,t);let{sentryTrace:i,baggage:o}=e,s=C(),c=rr(o);return s&&!Cc(s,c?.org_id)?Nn(t):Be(a=>{let l=In(i,o);return a.setPropagationContext(l),Bn(a,void 0),t()})};function se(e,t){let n=Wo();return n.withActiveSpan?n.withActiveSpan(e,t):Be(r=>(Bn(r,e||void 0),t(r)))}function Fn(e){let t=Wo();return t.suppressTracing?t.suppressTracing(e):Be(n=>{n.setSDKProcessingMetadata({[Zs]:!0});let r=e();return n.setSDKProcessingMetadata({[Zs]:void 0}),r})}function kr(e=ne()){let t=Wo();return t.isTracingSuppressed?t.isTracingSuppressed(e):e.getScopeData().sdkProcessingMetadata[Zs]===!0}function Nn(e){let t=Wo();return t.startNewTrace?t.startNewTrace(e):Be(n=>(n.setPropagationContext({traceId:yt(),sampleRand:ct()}),E&&g.log(`Starting a new trace with id ${n.getPropagationContext().traceId}`),se(null,e)))}function ph(e,t){t?.recordDroppedEvent("no_parent_span","span");let n=new Pr({traceId:e.getPropagationContext().traceId});return Or(n,e,J()),n}function uh({parentSpan:e,spanArguments:t,forceTransaction:n,scope:r}){let i=J();if(!Ue()){let c=r.getPropagationContext(),a=e?e.spanContext().traceId:c.traceId,l=new Pr({traceId:a});return e&&!n&&di(e,l),Or(l,r,i),l}let o=C();if(iW(o,t)){kr(r)||o?.recordDroppedEvent("ignored","span");let c=new Pr({dropReason:"ignored",traceId:e?.spanContext().traceId??r.getPropagationContext().traceId});return e&&!n&&di(e,c),Or(c,r,i),c}let s;if(e&&!n)s=rW(e,r,t,i),di(e,s);else if(e){let c=nt(e),{traceId:a,spanId:l}=e.spanContext(),p=Qt(e);s=eR({traceId:a,parentSpanId:l,...t},r,i,p),eh(s,c)}else{let{traceId:c,dsc:a,parentSpanId:l,sampled:p}=r.getPropagationContext();s=eR({traceId:c,parentSpanId:l,...t},r,i,p),a&&eh(s,a)}return Uc(s),s}function dh(e){let n={isStandalone:(e.experimental||{}).standalone,...e};if(e.startTime){let r={...n};return r.startTimestamp=qt(e.startTime),delete r.startTime,r}return n}function Wo(){let e=Je();return St(e)}function eR(e,t,n,r){let i=C(),o=i?.getOptions()||{},{name:s=""}=e,c={spanAttributes:{...e.attributes},spanName:s,parentSampled:r};i?.emit("beforeSampling",c,{decision:!1});let a=c.parentSampled??r,l=c.spanAttributes,p=t.getPropagationContext(),u=kr(t),[d,m,_]=u?[!1]:Hc(o,{name:s,parentSampled:a,attributes:l,normalizedRequest:n.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampleRate:Tn(p.dsc?.sample_rate)},p.sampleRand),h=new js({...e,attributes:{[ve]:"custom",[Hn]:m!==void 0&&_?m:void 0,...l},sampled:d});return!d&&i&&!u&&(E&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),i.recordDroppedEvent("sample_rate",rt(i)?"span":"transaction")),Or(h,t,n),i&&i.emit("spanStart",h),h}function rW(e,t,n,r){let{spanId:i,traceId:o}=e.spanContext(),s=kr(t),c=s?!1:Qt(e),a=c?new js({...n,parentSpanId:i,traceId:o,sampled:c}):new Pr({traceId:o});di(e,a),Or(a,t,r);let l=C();return l&&(rt(l)&&Vi(a)&&(Vi(e)&&e.dropReason?(a.dropReason=e.dropReason,l.recordDroppedEvent(e.dropReason,"span")):s||(a.dropReason="sample_rate",l.recordDroppedEvent("sample_rate","span"))),l.emit("spanStart",a),n.endTimestamp&&(l.emit("spanEnd",a),l.emit("afterSpanEnd",a))),a}function mh(e,t){if(t)return t;if(t===null)return;let n=tr(e);if(!n)return;let r=C();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?Re(n):n}function nR(e){return e!==void 0?t=>se(e,t):t=>t()}function iW(e,t){let n=e?.getOptions().ignoreSpans;return!e||!rt(e)||!n?.length?!1:ir({description:t.name||"",op:t.attributes?.[B]||t.op,attributes:t.attributes},n)}function Lr(e){return Vi(e)&&e.dropReason==="ignored"}function Fc(e,t,n){let r,i,o,s=n?.maxWait?Math.max(n.maxWait,t):0,c=n?.setTimeoutImpl||setTimeout;function a(){return l(),r=e(),r}function l(){i!==void 0&&clearTimeout(i),o!==void 0&&clearTimeout(o),i=o=void 0}function p(){return i!==void 0||o!==void 0?a():r}function u(){return i&&clearTimeout(i),i=c(a,t),s&&o===void 0&&(o=c(a,s)),r}return u.cancel=l,u.flush=p,u}var gu=new WeakSet,rR=e=>gu.has(e),iR=e=>{gu.add(e)},_u=new WeakMap;function fh(e){if(Bc()||Qv(oW),_u.has(e))return;let t=new Set,n=Fc(()=>{let r=[...t];t.clear();for(let i of r)i()},1,{maxWait:100});e.on("flush",()=>{n.flush()}),_u.set(e,r=>{t.add(r),n()})}var oW={onSegmentSpanEnded(e,t){let n=t.getClient(),r=n&&_u.get(n);if(!r){let i=e();i&&n?.captureEvent(i);return}r(()=>{let i=e({isSpanAlreadyCaptured:rR,onSpanCaptured:iR});i&&n.captureEvent(i)})},onChildSpanEnded(e,t,n,r){if(gu.has(e)||!gu.has(t))return;let i=r.getClient(),o=i&&_u.get(i),s=()=>{let c=n({isSpanAlreadyCaptured:rR,onSpanCaptured:iR});c?.contexts?.trace?.data&&(c.contexts.trace.data["sentry.parent_span_already_sent"]=!0),c&&i?.captureEvent(c)};o?o(s):s()}};var sW=["addListener","on","once","prependListener","prependOnceListener","addEventListener"],aW=["removeListener","off","removeEventListener"],oR=Symbol("SentryScopeBoundListeners"),Ks;function cW(e){return Ks!==void 0&&(e===Ks||e.listener===Ks)}function _n(e,t=ne()){let n=e;if(hu(n))return e;gh(n);for(let r of sW)typeof n[r]=="function"&&(n[r]=pW(n,n[r],t));for(let r of aW)typeof n[r]=="function"&&(n[r]=uW(n,n[r]));return typeof n.removeAllListeners=="function"&&(n.removeAllListeners=dW(n,n.removeAllListeners)),e}function lW(e,t){return function(...n){return Be(t,()=>e.apply(this,n))}}function sR(e){return typeof e=="function"}function pW(e,t,n){return function(...r){let i=r[0],o=r[1],s=r.slice(2);if(!sR(o)||cW(o))return t.apply(this,r);let c=hu(e)||gh(e),a=c.get(i);a||(a=new WeakMap,c.set(i,a));let l=a.get(o);l||(l=lW(o,n),a.set(o,l));let p=Ks;Ks=l;try{return t.call(this,i,l,...s)}finally{Ks=p}}}function uW(e,t){return function(...n){let r=n[0],i=n[1],o=n.slice(2),s=sR(i)?hu(e)?.get(r)?.get(i):void 0;return s?t.call(this,r,s,...o):t.apply(this,n)}}function dW(e,t){return function(...n){let r=hu(e);if(r)if(n.length===0)gh(e);else{let i=n[0];r.delete(i)}return t.apply(this,n)}}function gh(e){let t=new Map;return e[oR]=t,t}function hu(e){return e[oR]}function hh(e,t){let{fingerprint:n,span:r,breadcrumbs:i,sdkProcessingMetadata:o}=t;mW(e,t),r&&_W(e,r),hW(e,n),fW(e,i),gW(e,o)}function _h(e,t){let{extra:n,tags:r,attributes:i,user:o,contexts:s,level:c,sdkProcessingMetadata:a,breadcrumbs:l,fingerprint:p,eventProcessors:u,attachments:d,propagationContext:m,transactionName:_,span:h}=t;Wc(e,"extra",n),Wc(e,"tags",r),Wc(e,"attributes",i),Wc(e,"user",o),Wc(e,"contexts",s),e.sdkProcessingMetadata=Bi(e.sdkProcessingMetadata,a,2),c&&(e.level=c),_&&(e.transactionName=_),h&&(e.span=h),l.length&&(e.breadcrumbs=[...e.breadcrumbs,...l]),p.length&&(e.fingerprint=[...e.fingerprint,...p]),u.length&&(e.eventProcessors=[...e.eventProcessors,...u]),d.length&&(e.attachments=[...e.attachments,...d]),e.propagationContext={...e.propagationContext,...m}}function Wc(e,t,n){e[t]=Bi(e[t],n,1)}function vn(e,t){let n=wo().getScopeData();return e&&_h(n,e.getScopeData()),t&&_h(n,t.getScopeData()),n}function mW(e,t){let{extra:n,tags:r,user:i,contexts:o,level:s,transactionName:c}=t;Object.keys(n).length&&(e.extra={...n,...e.extra}),Object.keys(r).length&&(e.tags={...r,...e.tags}),Object.keys(i).length&&(e.user={...i,...e.user}),Object.keys(o).length&&(e.contexts={...o,...e.contexts}),s&&(e.level=s),c&&e.type!=="transaction"&&(e.transaction=c)}function fW(e,t){let n=[...e.breadcrumbs||[],...t];e.breadcrumbs=n.length?n:void 0}function gW(e,t){e.sdkProcessingMetadata={...e.sdkProcessingMetadata,...t}}function _W(e,t){e.contexts={trace:xr(t),...e.contexts},e.sdkProcessingMetadata={dynamicSamplingContext:nt(t),...e.sdkProcessingMetadata};let n=Re(t),r=oe(n).description;r&&!e.transaction&&e.type==="transaction"&&(e.transaction=r)}function hW(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 aR(e){let t={},{response:n,profile:r,cloud_resource:i,culture:o,state:s}=e;if(n&&(n.status_code!=null&&(t["http.response.status_code"]=n.status_code),n.body_size!=null&&(t["http.response.body.size"]=n.body_size)),r&&(r.profile_id&&(t["sentry.profile_id"]=r.profile_id),r.profiler_id&&(t["sentry.profiler_id"]=r.profiler_id)),i)for(let[l,p]of Object.entries(i))p!=null&&(t[l]=p);o&&(o.locale&&(t["culture.locale"]=o.locale),o.timezone&&(t["culture.timezone"]=o.timezone)),s?.state&&typeof s.state.type=="string"&&(t["state.type"]=s.state.type);let c=e.angular;if(c){let l=c.version;(typeof l=="string"||typeof l=="number")&&(t["angular.version"]=l)}let a=e.react;if(a){let l=a.version;(typeof l=="string"||typeof l=="number")&&(t["react.version"]=l)}return t}var cR="aws.dynamodb.attribute_definitions",lR="aws.dynamodb.consistent_read",pR="aws.dynamodb.consumed_capacity",uR="aws.dynamodb.count",dR="aws.dynamodb.exclusive_start_table",mR="aws.dynamodb.global_secondary_indexes",fR="aws.dynamodb.global_secondary_index_updates",bh="aws.dynamodb.index_name",gR="aws.dynamodb.item_collection_metrics",_R="aws.dynamodb.limit",hR="aws.dynamodb.local_secondary_indexes",bR="aws.dynamodb.projection",yR="aws.dynamodb.provisioned_read_capacity",SR="aws.dynamodb.provisioned_write_capacity",ER="aws.dynamodb.scanned_count",TR="aws.dynamodb.scan_forward",IR="aws.dynamodb.segment",yh="aws.dynamodb.select",AR="aws.dynamodb.table_count",Sh="aws.dynamodb.table_names",NR="aws.dynamodb.total_segments";var vR="aws.kinesis.stream.name";var RR="aws.request.extended_id";var OR="aws.request.id",CR="aws.s3.bucket",Eh="aws.secretsmanager.secret.arn",Th="aws.sns.topic.arn",xR="aws.step_functions.activity.arn",PR="aws.step_functions.state_machine.arn";var qs="cache.key";var bu="cloud.region";var yu="code.function.name";var Qs="db.collection.name";var Et="db.name",fi="db.namespace",Js="db.operation",$s="db.operation.batch.size",ar="db.operation.name";var Mr="db.query.text";var Ve="db.statement";var Pe="db.system",mt="db.system.name",Mt="db.user";var wr="error.type";var kR="faas.execution";var LR="faas.invoked_name",MR="faas.invoked_provider",wR="faas.invoked_region",GR="faas.name";var Su="faas.trigger";var UR="gen_ai.embeddings.input",DR="gen_ai.function_id",BR="gen_ai.input.messages",Eu="gen_ai.operation.name";var Ih="gen_ai.output.messages";var HR="gen_ai.request.available_tools";var gi="gen_ai.request.max_tokens";var Vc="gen_ai.request.model";var ji="gen_ai.request.stop_sequences",_i="gen_ai.request.temperature";var hi="gen_ai.request.top_p",Ot="gen_ai.response.finish_reasons",FR="gen_ai.response.id",WR="gen_ai.response.model",VR="gen_ai.response.streaming";var Yc="gen_ai.system";var YR="gen_ai.tool.input";var jR="gen_ai.tool.name",ZR="gen_ai.tool.output",XR="gen_ai.tool.type";var Jt="gen_ai.usage.input_tokens";var Tt="gen_ai.usage.output_tokens";var Ah="gen_ai.usage.total_tokens",zs="graphql.document",Tu="graphql.operation.name",Iu="graphql.operation.type";var KR="http.client_ip";var qR="http.flavor";var QR="http.host",Gr="http.method";var Ur="http.request.method";var hn="http.response.status_code";var He="http.route",JR="http.scheme";var bi="http.status_code",Au="http.target",yi="http.url",$R="http.user_agent";var Nu="koa.name",Nh="koa.type";var ea="messaging.batch.message_count",zR="messaging.destination";var Rn="messaging.destination.name";var ta="messaging.message.id";var na="messaging.operation.name",cr="messaging.operation.type";var wt="messaging.system";var e0="network.peer.address",t0="network.peer.port",vh="network.protocol.name",n0="network.protocol.version";var r0="net.host.ip",i0="net.host.name",o0="net.host.port",s0="net.peer.ip",Le="net.peer.name",xe="net.peer.port";var ra="net.transport";var a0="rpc.grpc.status_code",c0="rpc.method";var vu="rpc.service",l0="rpc.system";var Rh="sentry.graphql.operation";var p0="sentry.http.prefetch";var u0="sentry.origin";var d0="sentry.sdk.name",m0="sentry.sdk.version",f0="sentry.segment.id";var g0="sentry.segment.name";var _0="sentry.trace_lifecycle";var _t="server.address";var ht="server.port",Oh="service.name",h0="service.version";var pt="url.full",Zi="url.path";var Ru="url.query";var b0="url.scheme";var y0="user_agent.original";function Ch(e,t){let n=pu(e),r=Vs(e),i=pu(r),{isolationScope:o,scope:s}=Kt(e),c=vn(o,s);SW(n,i,t,c);let a=e.kind;t.emit("preprocessSpan",n,{spanKind:a}),n.is_segment&&(bW(n,c),yW(n,t),t.emit("processSegmentSpan",n)),t.emit("processSpan",n);let{beforeSendSpan:l}=t.getOptions(),p=l&&mi(l)?EW(n,l):n,u=p.attributes?.[ve];return n.is_segment&&u&&Gt(p,{"sentry.segment.name.source":u}),{...uu(p),_segmentSpan:r}}function bW(e,t){let n=aR(t.contexts);Gt(e,n)}function Gt(e,t){let n=e.attributes??(e.attributes={});Object.entries(t).forEach(([r,i])=>{i!=null&&!(r in n)&&(n[r]=i)})}function yW(e,t){let n=t.getIntegrationNames();n.length&&Gt(e,{[U_]:n})}function SW(e,t,n,r){let i=n.getSdkMetadata(),{release:o,environment:s}=n.getOptions();Gt(e,{[_0]:"stream",[g0]:t.name,[f0]:t.span_id,[d0]:i?.sdk?.name,[m0]:i?.sdk?.version,[w_]:o,[G_]:s||Yi,[D_]:r.user?.id,[B_]:r.user?.email,[Rc]:r.user?.ip_address,[H_]:r.user?.username,...r.attributes})}function EW(e,t){let n=t(e);return n||(Ho(),e)}var xh=0,S0=1,E0=2;function Si(e){return new Ou(t=>{t(e)})}function Cu(e){return new Ou((t,n)=>{n(e)})}var Ou=class e{constructor(t){this._state=xh,this._handlers=[],this._runExecutor(t)}then(t,n){return new e((r,i)=>{this._handlers.push([!1,o=>{if(!t)r(o);else try{r(t(o))}catch(s){i(s)}},o=>{if(!n)i(o);else try{r(n(o))}catch(s){i(s)}}]),this._executeHandlers()})}catch(t){return this.then(n=>n,t)}finally(t){return new e((n,r)=>{let i,o;return this.then(s=>{o=!1,i=s,t&&t()},s=>{o=!0,i=s,t&&t()}).then(()=>{if(o){r(i);return}n(i)})})}_executeHandlers(){if(this._state===xh)return;let t=this._handlers.slice();this._handlers=[],t.forEach(n=>{n[0]||(this._state===S0&&n[1](this._value),this._state===E0&&n[2](this._value),n[0]=!0)})}_runExecutor(t){let n=(o,s)=>{if(this._state===xh){if(bt(s)){s.then(r,i);return}this._state=o,this._value=s,this._executeHandlers()}},r=o=>{n(S0,o)},i=o=>{n(E0,o)};try{t(r,i)}catch(o){i(o)}}};function T0(e,t,n,r=0){try{let i=Ph(t,n,e,r);return bt(i)?i:Si(i)}catch(i){return Cu(i)}}function Ph(e,t,n,r){let i=n[r];if(!e||!i)return e;let o=i({...e},t);return E&&o===null&&g.log(`Event processor "${i.id||"?"}" dropped event`),bt(o)?o.then(s=>Ph(s,t,n,r+1)):Ph(o,t,n,r+1)}var Vo,I0,A0,Xi;function jc(e){let t=te._sentryDebugIds,n=te._debugIds;if(!t&&!n)return{};let r=t?Object.keys(t):[],i=n?Object.keys(n):[];if(Xi&&r.length===I0&&i.length===A0)return Xi;I0=r.length,A0=i.length,Xi={},Vo||(Vo={});let o=(s,c)=>{for(let a of s){let l=c[a],p=Vo?.[a];if(p&&Xi&&l)Xi[p[0]]=l,Vo&&(Vo[a]=[p[0],l]);else if(l){let u=e(a);for(let d=u.length-1;d>=0;d--){let _=u[d]?.filename;if(_&&Xi&&Vo){Xi[_]=l,Vo[a]=[_,l];break}}}}};return t&&o(r,t),n&&o(i,n),Xi}function N0(e,t,n,r,i,o){let{normalizeDepth:s=3,normalizeMaxBreadth:c=1e3}=e,a={...t,event_id:t.event_id||n.event_id||dt(),timestamp:t.timestamp||Rr()},l=n.integrations||e.integrations.map(N=>N.name);TW(a,e),NW(a,l),i&&i.emit("applyFrameMetadata",t),t.type===void 0&&IW(a,e.stackParser);let p=RW(r,n.captureContext);n.mechanism&&Dn(a,n.mechanism);let u=i?i.getEventProcessors():[],d=vn(o,p),m=[...n.attachments||[],...d.attachments];m.length&&(n.attachments=m),hh(a,d);let _=[...u,...d.eventProcessors];return(n.data&&n.data.__sentry__===!0?Si(a):T0(_,a,n)).then(N=>(N&&AW(N),typeof s=="number"&&s>0?vW(N,s,c):N))}function TW(e,t){let{environment:n,release:r,dist:i,maxValueLength:o}=t;e.environment=e.environment||n||Yi,!e.release&&r&&(e.release=r),!e.dist&&i&&(e.dist=i);let s=e.request;s?.url&&o&&(s.url=mn(s.url,o)),o&&e.exception?.values?.forEach(c=>{c.value&&(c.value=mn(c.value,o))})}function IW(e,t){let n=jc(t);e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.filename&&(i.debug_id=n[i.filename])})})}function AW(e){let t={};if(e.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(i=>{i.debug_id&&(i.abs_path?t[i.abs_path]=i.debug_id:i.filename&&(t[i.filename]=i.debug_id),delete i.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,i])=>{n.push({type:"sourcemap",code_file:r,debug_id:i})})}function NW(e,t){t.length>0&&(e.sdk=e.sdk||{},e.sdk.integrations=[...e.sdk.integrations||[],...t])}function vW(e,t,n){if(!e)return null;let r={...e,...e.breadcrumbs&&{breadcrumbs:e.breadcrumbs.map(i=>({...i,...i.data&&{data:Ke(i.data,t,n)}}))},...e.user&&{user:Ke(e.user,t,n)},...e.contexts&&{contexts:Ke(e.contexts,t,n)},...e.extra&&{extra:Ke(e.extra,t,n)}};return e.contexts?.trace&&r.contexts&&(r.contexts.trace=e.contexts.trace,e.contexts.trace.data&&(r.contexts.trace.data=Ke(e.contexts.trace.data,t,n))),e.spans&&(r.spans=e.spans.map(i=>({...i,...i.data&&{data:Ke(i.data,t,n)}}))),e.contexts?.flags&&r.contexts&&(r.contexts.flags=Ke(e.contexts.flags,3,n)),r}function RW(e,t){if(!t)return e;let n=e?e.clone():new Zt;return n.update(t),n}function v0(e){if(e)return OW(e)?{captureContext:e}:xW(e)?{captureContext:e}:e}function OW(e){return e instanceof Zt||typeof e=="function"}var CW=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function xW(e){return Object.keys(e).some(t=>CW.includes(t))}function me(e,t){return ne().captureException(e,v0(t))}function Zc(e,t){let n=typeof t=="string"?t:void 0,r=typeof t!="string"?{captureContext:t}:void 0;return ne().captureMessage(e,n,r)}function Xc(e,t){return ne().captureEvent(e,t)}function kh(e,t){J().setContext(e,t)}function Lh(e){J().setExtras(e)}function Mh(e,t){J().setExtra(e,t)}function wh(e){J().setTags(e)}function Gh(e,t){J().setTag(e,t)}function Uh(e){J().setAttributes(e)}function Dh(e,t){J().setAttribute(e,t)}function Bh(e){J().setUser(e)}function R0(e){J().setConversationId(e)}function Hh(){return J().lastEventId()}async function Yo(e){let t=C();return t?t.flush(e):(E&&g.warn("Cannot flush events. No client defined."),Promise.resolve(!1))}async function Fh(e){let t=C();return t?t.close(e):(E&&g.warn("Cannot flush events and disable SDK. No client defined."),Promise.resolve(!1))}function Wh(){return!!C()}function jo(){let e=C();return e?.getOptions().enabled!==!1&&!!e?.getTransport()}function Vh(e){J().addEventProcessor(e)}function Kc(e){let t=J(),{user:n}=vn(t,ne()),{userAgent:r}=te.navigator||{},i=hv({user:n,...r&&{userAgent:r},...e}),o=t.getSession();return o?.status==="ok"&&li(o,{status:"exited"}),Zo(),t.setSession(i),i}function Zo(){let e=J(),n=ne().getSession()||e.getSession();n&&bv(n),O0(),e.setSession()}function O0(){let e=J(),t=C(),n=e.getSession();n&&t&&t.captureSession(n)}function Yh(e=!1){if(e){Zo();return}O0()}function Dr(e,t,n){function r(){let o=qc({monitorSlug:e,status:"in_progress"},n),s=lt();function c(l){qc({monitorSlug:e,status:l,checkInId:o,duration:lt()-s})}let a;try{a=t()}catch(l){throw c("error"),l}return bt(a)?a.then(l=>(c("ok"),l),l=>{throw c("error"),l}):(c("ok"),a)}let i={...ne().getPropagationContext()};return nr(()=>{if(n?.isolateTrace)return Nn(r);let o=ne();return Oc(o.getPropagationContext())||o.setPropagationContext(i),r()})}function qc(e,t){let n=ne(),r=C();if(!r)E&&g.warn("Cannot capture check-in. No client defined.");else if(!r.captureCheckIn)E&&g.warn("Cannot capture check-in. Client does not support sending check-ins.");else return r.captureCheckIn(e,t,n);return dt()}function On(e){return typeof e=="object"&&typeof e.unref=="function"&&e.unref(),e}function ue(e,t=1){if(St(Je()).getTracingChannelBinding?.()){e();return}t&&On(setTimeout(()=>{ue(e,t-1)},1))}var PW="7";function kW(e){let t=e.protocol?`${e.protocol}:`:"",n=e.port?`:${e.port}`:"";return`${t}//${e.host}${n}${e.path?`/${e.path}`:""}/api/`}function LW(e){return`${kW(e)}${e.projectId}/envelope/`}function MW(e,t){let n={sentry_version:PW};return e.publicKey&&(n.sentry_key=e.publicKey),t&&(n.sentry_client=`${t.name}/${t.version}`),new URLSearchParams(n).toString()}function C0(e,t,n){return t||`${LW(e)}?${MW(e,n)}`}var jh=[];function wW(e){let t={};return e.forEach(n=>{let{name:r}=n,i=t[r];i&&!i.isDefaultInstance&&n.isDefaultInstance||(t[r]=n)}),Object.values(t)}function Zh(e){let t=e.defaultIntegrations||[],n=e.integrations;t.forEach(i=>{i.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...t,...n];else if(typeof n=="function"){let i=n(t);r=Array.isArray(i)?i:[i]}else r=t;return wW(r)}function x0(e,t){let n={};return t.forEach(r=>{r?.beforeSetup&&r.beforeSetup(e)}),t.forEach(r=>{r&&Kh(e,r,n)}),n}function Xh(e,t){for(let n of t)n?.afterAllSetup&&n.afterAllSetup(e)}function Kh(e,t,n){if(n[t.name]){E&&g.log(`Integration skipped because it was already installed: ${t.name}`);return}if(n[t.name]=t,!jh.includes(t.name)&&typeof t.setupOnce=="function"&&(t.setupOnce(),jh.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",(i,o)=>r(i,o,e))}if(typeof t.processEvent=="function"){let r=t.processEvent.bind(t),i=Object.assign((o,s)=>r(o,s,e),{id:t.name});e.addEventProcessor(i)}["processSpan","processSegmentSpan"].forEach(r=>{let i=t[r];typeof i=="function"&&e.on(r,o=>i.call(t,o,e))}),E&&g.log(`Integration installed: ${t.name}`)}function qh(e){let t=C();if(!t){E&&g.warn(`Cannot add integration "${e.name}" because no SDK Client is available.`);return}t.addIntegration(e)}function Ut(e,t){let n={...e,...t};for(let r in t){let i=e[r],o=t[r];if(typeof i=="function"&&typeof o=="function"){let s=new Proxy(i,{apply:(c,a,l)=>(Reflect.apply(c,a,l),Reflect.apply(o,a,l))});n[r]=s}}return n}var GW="sentry.timestamp.sequence",Qh=0,Jh;function xu(e){let t=Math.floor(e*1e3);Jh!==void 0&&t!==Jh&&(Qh=0);let n=Qh;return Qh++,Jh=t,{key:GW,value:{value:n,type:"integer"}}}function ia(e,t){return t?Be(t,()=>{let n=Q(),r=n?xr(n):Go(t);return[n?nt(n):or(e,t),r]}):[void 0,void 0]}var P0={trace:1,debug:5,info:9,warn:13,error:17,fatal:21};function k0(){return typeof __SENTRY_BROWSER_BUNDLE__<"u"&&!!__SENTRY_BROWSER_BUNDLE__}function L0(){return!k0()&&Object.prototype.toString.call(typeof process<"u"?process:0)==="[object process]"}function It(){return typeof window<"u"&&(!L0()||UW())}function UW(){return te.process?.type==="renderer"}function DW(e,t){let n=t?"auto":"never";return[{type:"log",item_count:e.length,content_type:"application/vnd.sentry.items.log+json"},{version:2,...It()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function M0(e,t,n,r,i){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=rn(r)),Lt(o,[DW(e,i)])}var BW=100;function Br(e,t,n,r=!0){n&&(!e[t]||r)&&(e[t]=n)}function w0(e,t){let n=zh(),r=G0(e);r===void 0?n.set(e,[t]):r.length>=BW?(oa(e,r),n.set(e,[t])):n.set(e,[...r,t])}function lr(e,t=ne(),n=w0){let r=t?.getClient()??C();if(!r){E&&g.warn("No client available to capture log.");return}let{release:i,environment:o,enableLogs:s=!0,beforeSendLog:c}=r.getOptions();if(!s){E&&g.warn("logging option not enabled, log will not be captured.");return}let[,a]=ia(r,t),l={...e.attributes},{user:{id:p,email:u,username:d},attributes:m={}}=vn(J(),t);Br(l,"user.id",p,!1),Br(l,"user.email",u,!1),Br(l,"user.name",d,!1),Br(l,"sentry.release",i),Br(l,"sentry.environment",o);let{name:_,version:h}=r.getSdkMetadata()?.sdk??{};Br(l,"sentry.sdk.name",_),Br(l,"sentry.sdk.version",h);let b=r.getIntegrationByName("Replay"),N=b?.getReplayId(!0);Br(l,"sentry.replay_id",N),N&&b?.getRecordingMode()==="buffer"&&Br(l,"sentry._internal.replay_is_buffering",!0);let M=e.message;if(Ui(M)){let{__sentry_template_string__:Ne,__sentry_template_values__:Te=[]}=M;Te?.length&&(l["sentry.message.template"]=Ne),Te.forEach((Ce,qe)=>{l[`sentry.message.parameter.${qe}`]=Ce})}let R=tr(t);Br(l,"sentry.trace.parent_span_id",R?.spanContext().spanId);let v={...e,attributes:l};r.emit("beforeCaptureLog",v);let P=c?Me(()=>c(v)):v;if(!P){r.recordDroppedEvent("before_send","log_item",1),E&&g.warn("beforeSendLog returned null, log will not be captured.");return}let{level:D,message:I,attributes:H={},severityNumber:L}=P,G=lt(),ce=xu(G),ge={timestamp:G,level:D,body:$h(String(I)),trace_id:a?.trace_id,severity_number:L??P0[D],attributes:HW({...pi(m),...pi(H,!0),[ce.key]:ce.value})};n(r,ge),r.emit("afterCaptureLog",P)}function oa(e,t){let n=t??G0(e)??[];if(n.length===0)return;let r=e.getOptions(),i=M0(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);zh().set(e,[]),e.emit("flushLogs"),e.sendEnvelope(i)}function G0(e){return zh().get(e)}function zh(){return Un("clientToLogBufferMap",()=>new WeakMap)}function HW(e){let t={};for(let[n,r]of Object.entries(e)){let i=$h(n);r.type==="string"?t[i]={...r,value:$h(r.value)}:t[i]=r}return t}function $h(e){let t=Object(e),n=t.isWellFormed,r=t.toWellFormed;return typeof n=="function"&&typeof r=="function"?n.call(e)?e:r.call(e):e}function FW(e,t){let n=t?"auto":"never";return[{type:"trace_metric",item_count:e.length,content_type:"application/vnd.sentry.items.trace-metric+json"},{version:2,...It()&&{ingest_settings:{infer_ip:n,infer_user_agent:n}},items:e}]}function U0(e,t,n,r,i){let o={};return t?.sdk&&(o.sdk={name:t.sdk.name,version:t.sdk.version}),n&&r&&(o.dsn=rn(r)),Lt(o,[FW(e,i)])}var WW=1e3;function Ei(e,t,n,r=!0){n&&(r||!(t in e))&&(e[t]=n)}function VW(e,t){let n=tb(),r=B0(e);r===void 0?n.set(e,[t]):r.length>=WW?(eb(e,r),n.set(e,[t])):n.set(e,[...r,t])}function YW(e,t,n){let{release:r,environment:i}=t.getOptions(),o={...e.attributes};Ei(o,"user.id",n.id,!1),Ei(o,"user.email",n.email,!1),Ei(o,"user.name",n.username,!1),Ei(o,"sentry.release",r),Ei(o,"sentry.environment",i);let{name:s,version:c}=t.getSdkMetadata()?.sdk??{};Ei(o,"sentry.sdk.name",s),Ei(o,"sentry.sdk.version",c);let a=t.getIntegrationByName("Replay"),l=a?.getReplayId(!0);return Ei(o,"sentry.replay_id",l),l&&a?.getRecordingMode()==="buffer"&&Ei(o,"sentry._internal.replay_is_buffering",!0),{...e,attributes:o}}function jW(e,t,n,r){let[,i]=ia(t,n),o=tr(n),s=o?o.spanContext().traceId:i?.trace_id,c=o?o.spanContext().spanId:void 0,a=lt(),l=xu(a);return{timestamp:a,trace_id:s??"",span_id:c,name:e.name,type:e.type,unit:e.unit,value:e.value,attributes:{...pi(r),...pi(e.attributes,"skip-undefined"),[l.key]:l.value}}}function D0(e,t){let n=t?.scope??ne(),r=t?.captureSerializedMetric??VW,i=n?.getClient()??C();if(!i){E&&g.warn("No client available to capture metric.");return}let{_experiments:o,enableMetrics:s,beforeSendMetric:c}=i.getOptions();if(!(s??o?.enableMetrics??!0)){E&&g.warn("metrics option not enabled, metric will not be captured.");return}let{user:l,attributes:p}=vn(J(),n),u=YW(e,i,l);i.emit("processMetric",u);let d=c||o?.beforeSendMetric,m=d?d(u):u;if(!m){E&&g.log("`beforeSendMetric` returned `null`, will not send metric.");return}let _=jW(m,i,n,p);E&&g.log("[Metric]",_),r(i,_),i.emit("afterCaptureMetric",m)}function eb(e,t){let n=t??B0(e)??[];if(n.length===0)return;let r=e.getOptions(),i=U0(n,r._metadata,r.tunnel,e.getDsn(),e.getDataCollectionOptions().userInfo);tb().set(e,[]),e.emit("flushMetrics"),e.sendEnvelope(i)}function B0(e){return tb().get(e)}function tb(){return Un("clientToMetricBufferMap",()=>new WeakMap)}function H0(e){let t={trace_id:e.trace_id,span_id:e.span_id,parent_span_id:e.parent_span_id,name:e.description||"",start_timestamp:e.start_timestamp,end_timestamp:e.timestamp||e.start_timestamp,status:!e.status||e.status==="ok"||e.status==="cancelled"?"ok":"error",is_segment:!1,attributes:{...e.data},links:e.links};return uu(t)}function F0(e,t){if(e.type!=="transaction"||!e.spans?.length||!e.sdkProcessingMetadata?.hasGenAiSpans||t.getOptions().streamGenAiSpans===!1||rt(t))return;let n=[],r=[];for(let o of e.spans)o.op?.startsWith("gen_ai.")?n.push(H0(o)):r.push(o);if(n.length===0)return;e.spans=r;let i=t.getDataCollectionOptions().userInfo?"auto":"never";return[{type:"span",item_count:n.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...It()&&{ingest_settings:{infer_ip:i,infer_user_agent:i}},items:n}]}var Qc=Symbol.for("SentryBufferFullError");function sa(e=100){let t=new Set;function n(){return t.size<e}function r(s){t.delete(s)}function i(s){if(!n())return Cu(Qc);let c=s();return t.add(c),c.then(()=>r(c),()=>r(c)),c}function o(s){if(!t.size)return Si(!0);let c=Promise.allSettled(Array.from(t)).then(()=>!0);if(!s)return c;let a=[c,new Promise(l=>On(setTimeout(()=>l(!1),s)))];return Promise.race(a)}return{get $(){return Array.from(t)},add:i,drain:o}}var ZW=60*1e3;function XW(e,t=tt()){let n=parseInt(`${e}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${e}`);return isNaN(r)?ZW:r-t}function KW(e,t){return e[t]||e.all||0}function W0(e,t,n=tt()){return KW(e,t)>n}function V0(e,{statusCode:t,headers:n},r=tt()){let i={...e},o=n?.["x-sentry-rate-limits"],s=n?.["retry-after"];if(o)for(let c of o.trim().split(",")){let[a,l,,,p]=c.split(":",5),u=parseInt(a,10),d=(isNaN(u)?60:u)*1e3;if(!l)i.all=r+d;else for(let m of l.split(";"))m==="metric_bucket"?(!p||p.split(";").includes("custom"))&&(i[m]=r+d):i[m]=r+d}else s?i.all=r+XW(s,r):t===429&&(i.all=r+60*1e3);return i}var Jc=64;function aa(e,t,n=sa(e.bufferSize||Jc)){let r={},i=s=>n.drain(s);function o(s){let c=[];if(wc(s,(u,d)=>{let m=fu(d);W0(r,m)?e.recordDroppedEvent("ratelimit_backoff",m):c.push(u)}),c.length===0)return Promise.resolve({});let a=Lt(s[0],c),l=u=>{if(oh(a,["client_report"])){E&&g.warn(`Dropping client report. Will not send outcomes (reason: ${u}).`);return}wc(a,(d,m)=>{e.recordDroppedEvent(u,fu(m))})},p=()=>t({body:Gc(a)}).then(u=>u.statusCode===413?(E&&g.error("Sentry responded with status code 413. Envelope was discarded due to exceeding size limits."),l("send_error"),u):(E&&u.statusCode!==void 0&&(u.statusCode<200||u.statusCode>=300)&&g.warn(`Sentry responded with status code ${u.statusCode} to sent event.`),r=V0(r,u),u),u=>{throw l("network_error"),E&&g.error("Encountered error running transport request:",u),u});return n.add(p).then(u=>u,u=>{if(u===Qc)return E&&g.error("Skipped sending event because buffer is full."),l("queue_overflow"),Promise.resolve({});throw u})}return{send:o,flush:i}}function Y0(e,t,n){let r=[{type:"client_report"},{timestamp:n||Rr(),discarded_events:e}];return Lt(t?{dsn:t}:{},[r])}function Pu(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 j0(e){let{trace_id:t,parent_span_id:n,span_id:r,status:i,origin:o,data:s,op:c}=e.contexts?.trace??{};return{data:s??{},description:e.transaction,op:c,parent_span_id:n,span_id:r??"",start_timestamp:e.start_timestamp??0,status:i,timestamp:e.timestamp,trace_id:t??"",origin:o,profile_id:s?.[Us],exclusive_time:s?.[Ds],measurements:e.measurements,is_segment:!0}}function Z0(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&&{[Us]:e.profile_id},...e.exclusive_time&&{[Ds]:e.exclusive_time}}}},measurements:e.measurements}}var ca="[Filtered]",$c=["forwarded","-ip","remote-","via","-user"],nb=["auth","token","secret","session","password","passwd","pwd","key","jwt","bearer","sso","saml","csrf","xsrf","credentials","sid","identity","set-cookie","cookie"],X0=[".sid","sessid","remember","oidc","pkce","nonce","__secure-","__host-","awsalb","awselb","akamai","__stripe","cognito","firebase","supabase","sb-","mfa","2fa"];function ku(e){return e===!0?{userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:7}:{userInfo:!1,cookies:{deny:$c},httpHeaders:{request:{deny:$c},response:{deny:$c}},httpBodies:[],urlQueryParams:{deny:$c},graphQL:{document:!0,variables:!0},genAI:{inputs:!1,outputs:!1},databaseQueryData:!1,stackFrameVariables:!0,frameContextLines:7}}var qW={userInfo:!0,cookies:!0,httpHeaders:{request:!0,response:!0},httpBodies:["incomingRequest","outgoingRequest","incomingResponse","outgoingResponse"],urlQueryParams:!0,graphQL:{document:!0,variables:!0},genAI:{inputs:!0,outputs:!0},databaseQueryData:!0,stackFrameVariables:!0,frameContextLines:5};function QW(e){return typeof e=="boolean"||"allow"in e||"deny"in e}function JW(e,t){return e===void 0?{...t.httpHeaders}:QW(e)?{request:e,response:e}:{request:e.request??t.httpHeaders.request,response:e.response??t.httpHeaders.response}}function K0(e){let t=e.dataCollection!=null?qW:ku(e.sendDefaultPii),n=e.dataCollection??{};return{userInfo:n.userInfo??t.userInfo,cookies:n.cookies??t.cookies,httpHeaders:JW(n.httpHeaders,t),httpBodies:n.httpBodies??t.httpBodies,urlQueryParams:n.urlQueryParams??n.queryParams??t.urlQueryParams,graphQL:{document:n.graphQL?.document??t.graphQL.document,variables:n.graphQL?.variables??t.graphQL.variables},genAI:{inputs:n.genAI?.inputs??t.genAI.inputs,outputs:n.genAI?.outputs??t.genAI.outputs},databaseQueryData:n.databaseQueryData??t.databaseQueryData,stackFrameVariables:n.stackFrameVariables??t.stackFrameVariables,frameContextLines:n.frameContextLines??t.frameContextLines}}var q0="Not capturing exception because it's already been captured.",Q0="Discarded session because of missing or non-string release",nO=Symbol.for("SentryInternalError"),rO=Symbol.for("SentryDoNotSendEventError"),$W=5e3;function Lu(e){return{message:e,[nO]:!0}}function rb(e){return{message:e,[rO]:!0}}function J0(e){return V(e)&&nO in e}function $0(e){return V(e)&&rO in e}function z0(e,t,n,r,i){let o=0,s,c=!1;e.on(n,()=>{o=0,clearTimeout(s),c=!1}),e.on(t,a=>{if(o+=r(a),o>=8e5)i(e);else if(!c){let l=e.getOptions()._flushInterval??$W;l>0&&(c=!0,s=On(setTimeout(()=>{i(e)},l)))}}),e.on("flush",()=>{i(e)})}var Mu=class{constructor(t){if(this._options=t,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],this._promiseBuffer=sa(t.transportOptions?.bufferSize??Jc),this._dataCollection=K0(t),t.dsn?this._dsn=Mv(t.dsn):E&&g.warn("No DSN provided, client will not send events."),this._dsn){let r=C0(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??!0,this._options.enableLogs&&z0(this,"afterCaptureLog","flushLogs",nV,oa),(this._options.enableMetrics??this._options._experiments?.enableMetrics??!0)&&z0(this,"afterCaptureMetric","flushMetrics",tV,eb)}captureException(t,n,r){let i=dt();if(tu(t))return E&&g.log(q0),i;let o={event_id:i,...n};return this._process(()=>this.eventFromException(t,o).then(s=>this._captureEvent(s,o,r)).then(s=>s),"error"),o.event_id}captureMessage(t,n,r,i){let o={event_id:dt(),...r},s=Ui(t)?t:String(t),c=er(t),a=c?this.eventFromMessage(s,n,o):this.eventFromException(t,o);return this._process(()=>a.then(l=>this._captureEvent(l,o,i)),c?"unknown":"error"),o.event_id}captureEvent(t,n,r){let i=dt();if(n?.originalException&&tu(n.originalException))return E&&g.log(q0),i;let o={event_id:i,...n},s=t.sdkProcessingMetadata||{},c=s.capturedSpanScope,a=s.capturedSpanIsolationScope,l=eO(t.type);return this._process(()=>this._captureEvent(t,o,c||r,a),l),o.event_id}captureSession(t){this.sendSession(t),li(t,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getDataCollectionOptions(){return this._dataCollection}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}async flush(t){let n=this._transport;if(this.emit("flush"),!n)return!0;let r=await this._isClientDoneProcessing(t),i=await n.flush(t);return r&&i}async close(t){let n=await this.flush(t);return this.getOptions().enabled=!1,this.emit("close"),n}getEventProcessors(){return this._eventProcessors}addEventProcessor(t){this._eventProcessors.push(t)}init(){(this._isEnabled()||this._options.integrations.some(({name:t})=>t.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(t){return this._integrations[t]}getIntegrationNames(){return Object.keys(this._integrations)}addIntegration(t){let n=this._integrations[t.name];!n&&t.beforeSetup&&t.beforeSetup(this),Kh(this,t,this._integrations),n||Xh(this,[t])}sendEvent(t,n={}){this.emit("beforeSendEvent",t,n);let r=F0(t,this),i=Kv(t,this._dsn,this._options._metadata,this._options.tunnel);for(let o of n.attachments||[])i=mu(i,ah(o));r&&(i=mu(i,r)),this.sendEnvelope(i).then(o=>this.emit("afterSendEvent",t,o))}sendSession(t){let{release:n,environment:r=Yi}=this._options;if("aggregates"in t){let o=t.attrs||{};if(!o.release&&!n){E&&g.warn(Q0);return}o.release=o.release||n,o.environment=o.environment||r,t.attrs=o}else{if(!t.release&&!n){E&&g.warn(Q0);return}t.release=t.release||n,t.environment=t.environment||r}this.emit("beforeSendSession",t);let i=Xv(t,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(i)}recordDroppedEvent(t,n,r=1){if(this._options.sendClientReports){let i=`${t}:${n}`;E&&g.log(`Recording outcome: "${i}"${r>1?` (${r} times)`:""}`),this._outcomes[i]=(this._outcomes[i]||0)+r}}on(t,n){let r=this._hooks[t]=this._hooks[t]||new Set,i=(...o)=>n(...o);return r.add(i),()=>{r.delete(i)}}emit(t,...n){let r=this._hooks[t];r&&r.forEach(i=>i(...n))}async sendEnvelope(t){if(this.emit("beforeEnvelope",t),this._isEnabled()&&this._transport)try{return await this._transport.send(t)}catch(n){return E&&g.error("Error while sending envelope:",n),{}}return E&&g.error("Transport disabled"),{}}registerCleanup(t){}dispose(){}_setupIntegrations(){let{integrations:t}=this._options;this._integrations=x0(this,t),Xh(this,t)}_updateSessionFromEvent(t,n){let r=n.level==="fatal",i=!1,o=n.exception?.values;if(o){i=!0,r=!1;for(let a of o)if(a.mechanism?.handled===!1){r=!0;break}}let s=t.status==="ok";(s&&t.errors===0||s&&r)&&(li(t,{...r&&{status:"crashed"},errors:t.errors||Number(i||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,i){let o=this.getOptions(),s=this.getIntegrationNames();return!n.integrations&&s.length&&(n.integrations=s),this.emit("preprocessEvent",t,n),t.type||i.setLastEventId(t.event_id||n.event_id),N0(o,t,n,r,this,i).then(c=>{if(c===null)return c;this.emit("postprocessEvent",c,n),c.contexts={trace:{...c.contexts?.trace,...Go(r)},...c.contexts};let a=or(this,r);return c.sdkProcessingMetadata={dynamicSamplingContext:a,...c.sdkProcessingMetadata},c})}_captureEvent(t,n={},r=ne(),i=J()){return E&&ib(t)&&g.log(`Captured error event \`${Pu(t)[0]||"<unknown>"}\``),this._processEvent(t,n,r,i).then(o=>o.event_id,o=>{E&&($0(o)?g.log(o.message):J0(o)?g.warn(o.message):g.warn(o))})}_processEvent(t,n,r,i){let o=this.getOptions(),{sampleRate:s}=o,c=iO(t),a=ib(t),p=`before send for type \`${t.type||"error"}\``,u=typeof s>"u"?void 0:Tn(s),d=eO(t.type);return this._prepareEvent(t,n,r,i).then(m=>{if(m===null)throw this.recordDroppedEvent("event_processor",d),rb("An event processor returned `null`, will not send event.");if(n.data?.__sentry__===!0)return m;let h=eV(this,o,m,n);return zW(h,p)}).then(m=>{if(m===null){if(this.recordDroppedEvent("before_send",d),c){let N=1+(t.spans||[]).length;this.recordDroppedEvent("before_send","span",N)}throw rb(`${p} returned \`null\`, will not send event.`)}let _=r.getSession()||i.getSession();if(a&&_&&this._updateSessionFromEvent(_,m),a&&typeof u=="number"&&ct()>u)throw this.recordDroppedEvent("sample_rate","error"),rb(`Discarding event because it's not included in the random sample (sampling rate = ${s})`);if(c){let b=m.sdkProcessingMetadata?.spanCountBeforeProcessing||0,N=m.spans?m.spans.length:0,M=b-N;M>0&&this.recordDroppedEvent("before_send","span",M)}let h=m.transaction_info;if(c&&h&&m.transaction!==t.transaction){let b="custom";m.transaction_info={...h,source:b}}return this.sendEvent(m,n),m}).then(null,m=>{throw $0(m)||J0(m)?m:(this.captureException(m,{mechanism:{handled:!1,type:"internal"},data:{__sentry__:!0},originalException:m}),Lu(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
|
|
13
|
+
Reason: ${m}`))})}_process(t,n){this._numProcessing++,this._promiseBuffer.add(t).then(r=>(this._numProcessing--,r),r=>(this._numProcessing--,r===Qc&&this.recordDroppedEvent("queue_overflow",n),r))}_clearOutcomes(){let t=this._outcomes;return this._outcomes={},Object.entries(t).map(([n,r])=>{let[i,o]=n.split(":");return{reason:i,category:o,quantity:r}})}_flushOutcomes(){E&&g.log("Flushing outcomes...");let t=this._clearOutcomes();if(t.length===0){E&&g.log("No outcomes to send");return}if(!this._dsn){E&&g.log("No dsn provided, will not send outcomes");return}E&&g.log("Sending outcomes:",t);let n=Y0(t,this._options.tunnel&&rn(this._dsn));this.sendEnvelope(n)}};function eO(e){return e==="replay_event"?"replay":e||"error"}function zW(e,t){let n=`${t} must return \`null\` or a valid event.`;if(bt(e))return e.then(r=>{if(!Yt(r)&&r!==null)throw Lu(n);return r},r=>{throw Lu(`${t} rejected with ${r}`)});if(!Yt(e)&&e!==null)throw Lu(n);return e}function eV(e,t,n,r){let{beforeSend:i,beforeSendTransaction:o,ignoreSpans:s}=t,c=!mi(t.beforeSendSpan)&&t.beforeSendSpan,a=n;if(ib(a)&&i)return i(a,r);if(iO(a)){if(c||s){let l=j0(a);if(s?.length&&ir({description:l.description,op:l.op,attributes:l.data},s))return null;if(c){let p=c(l);p?a=Bi(n,Z0(p)):Ho()}if(a.spans){let p=[],u=a.spans;for(let m of u){if(s?.length&&ir({description:m.description,op:m.op,attributes:m.data},s)){Vv(u,m);continue}if(c){let _=c(m);_?p.push(_):(Ho(),p.push(m))}else p.push(m)}let d=a.spans.length-p.length;d&&e.recordDroppedEvent("before_send","span",d),a.spans=p}}if(o){if(a.spans){let l=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:l}}return o(a,r)}}return a}function ib(e){return e.type===void 0}function iO(e){return e.type==="transaction"}function tV(e){let t=0;return e.name&&(t+=e.name.length*2),t+=8,t+oO(e.attributes)}function nV(e){let t=0;return e.message&&(t+=e.message.length*2),t+oO(e.attributes)}function oO(e){if(!e)return 0;let t=0;return Object.values(e).forEach(n=>{Array.isArray(n)?t+=n.length*tO(n[0]):er(n)?t+=tO(n):t+=100}),t}function tO(e){return typeof e=="string"?e.length*2:typeof e=="number"?8:typeof e=="boolean"?4:0}function ob(e){ne().setClient(e)}var sb=new Set;function Ti(e){e.forEach(t=>{sb.add(t),E&&g.log(`AI provider "${t}" wrapping will be skipped`)})}function Cn(e){return sb.has(e)}function ab(){sb.clear(),E&&g.log("Cleared AI provider skip registrations")}function rV(e,t){return t.some(n=>e.includes(n))}function cb(e,t,n){if(t===!1)return!0;let r=e.toLowerCase(),i=n!=null?[...nb,...n]:nb;if(rV(r,i))return!0;if(t===!0)return!1;let s=("deny"in t?t.deny:t.allow).some(c=>r.includes(c.toLowerCase()));return"deny"in t?s:!s}function la(e,t,n){if(t===!1)return{};let r={};for(let i of Object.keys(e))r[i]=cb(i,t,n)?ca:e[i];return r}function sO(e){let t={},n=0;for(;n<e.length;){let r=e.indexOf("=",n);if(r===-1)break;let i=e.indexOf(";",n);if(i===-1)i=e.length;else if(i<r){n=e.lastIndexOf(";",r-1)+1;continue}let o=e.slice(n,r).trim();if(t[o]===void 0){let s=e.slice(r+1,i).trim();s.charCodeAt(0)===34&&(s=s.slice(1,-1));try{t[o]=s.indexOf("%")!==-1?decodeURIComponent(s):s}catch{t[o]=s}}n=i+1}return t}function pa(e,t){if(!(!e||t===!1))return e.split("&").map(n=>{let r=n.indexOf("="),i=r===-1?n:n.slice(0,r),o=new URLSearchParams(`${i}=`).keys().next().value;return o!==void 0&&cb(o,t)?`${i}=${ca}`:n}).join("&")}function zc(e,t){let n=e.indexOf("#"),r=n===-1?e.length:n,i=e.indexOf("?");if(i===-1||i>r)return e;let o=e.slice(0,i),s=e.slice(i+1,r),c=e.slice(r),a=pa(s,t);return a?`${o}?${a}${c}`:`${o}${c}`}function aO(e){return(e??C())?.getDataCollectionOptions().urlQueryParams??!0}function Ct(e,t){return e===void 0?void 0:zc(e,aO(t))}function Wn(e,t){if(!e)return e;let n=e.startsWith("?"),r=pa(n?e.slice(1):e,aO(t));return r&&n?`?${r}`:r}var iV=new Set(["false","f","n","no","off","0"]),oV=new Set(["true","t","y","yes","on","1"]);function Xo(e,t){let n=String(e).toLowerCase();return iV.has(n)?!1:oV.has(n)?!0:t?.strict?null:!!e}function cO(e,t,n,r,i){let o={sent_at:new Date(tt()).toISOString()};n?.sdk&&(o.sdk={name:n.sdk.name,version:n.sdk.version}),r&&i&&(o.dsn=rn(i)),t&&(o.trace=t);let s=sV(e);return Lt(o,[s])}function sV(e){return[{type:"check_in"},e]}var aV="thismessage:/";function pr(e){return"isRelative"in e}function ur(e,t){let n=e.indexOf("://")<=0&&e.indexOf("//")!==0,r=t??(n?aV:void 0);try{if("canParse"in URL&&!URL.canParse(e,r))return;let i=new URL(e,r);return n?{isRelative:n,pathname:i.pathname,search:i.search,hash:i.hash}:i}catch{}}function lO(e){if(pr(e))return e.pathname;let t=new URL(e);return t.search="",t.hash="",["80","443"].includes(t.port)&&(t.port=""),t.password&&(t.password="%filtered%"),t.username&&(t.username="%filtered%"),t.toString()}function cV(e,t,n,r){let i=n?.method?.toUpperCase()??"GET",o=r||(e?t==="client"?lO(e):e.pathname:"/");return`${i} ${o}`}function lb(e,t,n,r,i,o){let s={[S]:n,[ve]:"url"};return i&&(s[t==="server"?"http.route":"url.template"]=i,s[ve]="route"),r?.method&&(s[Y_]=r.method.toUpperCase()),e&&(e.search&&(s["url.query"]=Wn(e.search,o)),e.hash&&(s["url.fragment"]=e.hash),e.pathname&&(s["url.path"]=e.pathname,e.pathname==="/"&&(s[ve]="route")),pr(e)||(s[pt]=Ct(e.href,o),e.port&&(s["url.port"]=e.port),e.protocol&&(s["url.scheme"]=e.protocol),e.hostname&&(s[t==="server"?"server.address":"url.domain"]=e.hostname))),[cV(e,t,r,i),s]}function Ki(e){if(!e)return{};let t=e.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!t)return{};let n=t[6]||"",r=t[8]||"";return{host:t[4],path:t[5],protocol:t[2],search:n,hash:r,relative:t[5]+n+r}}function dr(e){return e.split(/[?#]/,1)[0]}function qi(e){let{protocol:t,host:n,path:r}=e,i=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${t?`${t}://`:""}${i}${r}`}function el(e,t=!0){if(e.startsWith("data:")){let n=e.match(/^data:([^;,]+)/),r=n?n[1]:"text/plain",i=e.includes(";base64,"),o=e.indexOf(","),s="";if(t&&o!==-1){let c=e.slice(o+1);s=c.length>10?`${c.slice(0,10)}... [truncated]`:c}return`data:${r}${i?",base64":""}${s?`,${s}`:""}`}return e}function pb(e,t){let n=t?.getDsn(),r=t?.getOptions().tunnel;return pV(e,n)||lV(e,r)}function lV(e,t){return t?pO(e)===pO(t):!1}function pV(e,t){let n=ur(e);return!n||pr(n)||!t?!1:uV(n.hostname,t.host)&&/(^|&|\?)sentry_key=/.test(n.search)}function uV(e,t){return e===t||t.length>0&&e.endsWith(`.${t}`)}function pO(e){return e[e.length-1]==="/"?e.slice(0,-1):e}function wu(e,...t){let n=new String(String.raw(e,...t));return n.__sentry_template_string__=e.join("\0").replace(/%/g,"%%").replace(/\0/g,"%s"),n.__sentry_template_values__=t,n}var ub=wu;function Ko(e,t,n=[t],r="npm"){let i=(e._metadata=e._metadata||{}).sdk=e._metadata.sdk||{};i.name||(i.name=`sentry.javascript.${t}`,i.packages=n.map(o=>({name:`${r}:@sentry/${o}`,version:q})),i.version=q)}function $e(e={}){let t=e.client||C();if(!jo()||!t)return{};let n=Je(),r=St(n);if(r.getTraceData)return r.getTraceData(e);let i=e.scope||ne(),o=e.span||Q(),s=Vi(o)&&!Ue(t.getOptions());if(!o&&k_())return{};let c=o&&!s?kc(o):dV(i),a=o?nt(o):or(t,i),l=Hi(a);if(!au.test(c))return g.warn("Invalid sentry-trace data. Cannot generate trace data"),{};let u={"sentry-trace":c,baggage:l};return e.propagateTraceparent&&(u.traceparent=o&&!s?Bv(o):mV(i)),u}function dV(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Fi(t,r,n)}function mV(e){let{traceId:t,sampled:n,propagationSpanId:r}=e.getPropagationContext();return Wi(t,r,n)}var uO="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function qo(e,t,n){if(typeof e!="string"||!t)return!0;let r=n?.get(e);if(r!==void 0)return E&&!r&&g.log(uO,e),r;let i=fn(e,t);return n?.set(e,i),E&&!i&&g.log(uO,e),i}function db(e){return Object.entries(e||$e()).map(([t,n])=>`<meta name="${t}" content="${n}"/>`).join("")}function tl(e){return Array.from(new Set(e))}var dO=1024*1024;function mb(e){return e==="small"?1e3:e==="medium"?1e4:dO}function mO(e){let t={};try{e.forEach((n,r)=>{typeof n=="string"&&(t[r]=n)})}catch{}return t}function Uu(e){let t=Object.create(null);try{Object.entries(e).forEach(([n,r])=>{typeof r=="string"?t[n]=r:typeof r=="number"&&(t[n]=String(r))})}catch{}return t}function Qo(e){let t=e.headers||{},r=(typeof t["x-forwarded-host"]=="string"?t["x-forwarded-host"]:void 0)||(typeof t.host=="string"?t.host:void 0),o=(typeof t["x-forwarded-proto"]=="string"?t["x-forwarded-proto"]:void 0)||e.protocol||(e.socket?.encrypted?"https":"http"),s=e.url||"",c=fV({url:s,host:r,protocol:o}),a=e.body||void 0,l=e.cookies;return{url:c,method:e.method,query_string:fO(s),headers:Uu(t),cookies:l,data:a}}function fV({url:e,protocol:t,host:n}){if(e?.startsWith("http"))return e;if(e&&n)return`${t}://${n}${e}`}function Hr(e,t=!1,n="request"){let r=typeof t=="boolean"?ku(t):t,i=n==="request"?r.httpHeaders.request:r.httpHeaders.response,o=r.cookies,s=`http.${n}.header.`,c={};try{let a={};for(let[l,p]of Object.entries(e)){if(p==null)continue;let u=l.toLowerCase();if(u==="cookie"||u==="set-cookie"){if(o===!1)continue;if(typeof p=="string"&&p!==""){let m=gV(p,u==="set-cookie"),_=la(m,o,X0);for(let[h,b]of Object.entries(_))c[`${s}${Gu(u)}.${Gu(h)}`]=b}else c[`${s}${Gu(u)}`]=ca}else{if(i===!1)continue;Array.isArray(p)?a[u]=p.map(m=>m!=null?String(m):m).join(";"):typeof p=="string"&&(a[u]=p)}}if(i!==!1){let l=la(a,i);for(let[p,u]of Object.entries(l))c[`${s}${Gu(p)}`]=u}}catch{}return c}function Gu(e){return e.replace(/-/g,"_")}function gV(e,t){let n=e.indexOf(";"),r=t&&n!==-1?e.substring(0,n):e,i=t?[r]:r.split("; "),o={};for(let s of i){let c=s.indexOf("="),a=(c!==-1?s.substring(0,c):s).toLowerCase(),l=c!==-1?s.substring(c+1):"";o[a]=l}return o}function fO(e){if(e)try{let t=new URL(e,"http://s.io").search.slice(1);return t.length?t:void 0}catch{return}}var U={INTERNAL:0,SERVER:1,CLIENT:2,PRODUCER:3,CONSUMER:4},_V={[U.INTERNAL]:"INTERNAL",[U.SERVER]:"SERVER",[U.CLIENT]:"CLIENT",[U.PRODUCER]:"PRODUCER",[U.CONSUMER]:"CONSUMER"};function fb(e){return _V[e]}var hV=100;function on(e,t){let n=C(),r=J();if(!n)return;let{beforeBreadcrumb:i=null,maxBreadcrumbs:o=hV}=n.getOptions();if(o<=0)return;let c={timestamp:Rr(),...e},a=i?Me(()=>i(c,t)):c;a!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",a,t),r.addBreadcrumb(a,o))}var bV="FunctionToString",gO=new WeakMap,yV=(()=>({name:bV,setupOnce(){let e=Function.prototype.toString;try{Function.prototype.toString=function(...t){let n=Nr(this),r;try{gO.has(C())&&n!==void 0&&(r=n)}catch{}return e.apply(r??this,t)}}catch{}},setup(e){gO.set(e,!0)}})),nl=yV;var SV=[/^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$/,/Java object is gone$/],EV="EventFilters",Bu=(e={})=>{let t;return{name:EV,setup(n){let r=n.getOptions();t=_O(e,r)},processEvent(n,r,i){if(!t){let o=i.getOptions();t=_O(e,o)}return TV(n,t)?null:n}}},rl=((e={})=>({...Bu(e),name:"InboundFilters"}));function _O(e={},t={}){return{allowUrls:[...e.allowUrls||[],...t.allowUrls||[]],denyUrls:[...e.denyUrls||[],...t.denyUrls||[]],ignoreErrors:[...e.ignoreErrors||[],...t.ignoreErrors||[],...e.disableErrorDefaults?[]:SV],ignoreTransactions:[...e.ignoreTransactions||[],...t.ignoreTransactions||[]]}}function TV(e,t){if(e.type){if(e.type==="transaction"&&AV(e,t.ignoreTransactions))return E&&g.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
|
|
14
|
+
Event: ${Di(e)}`),!0}else{if(IV(e,t.ignoreErrors))return E&&g.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
|
|
15
|
+
Event: ${Di(e)}`),!0;if(OV(e))return E&&g.warn(`Event dropped due to not having an error message, error type or stacktrace.
|
|
16
|
+
Event: ${Di(e)}`),!0;if(NV(e,t.denyUrls))return E&&g.warn(`Event dropped due to being matched by \`denyUrls\` option.
|
|
17
|
+
Event: ${Di(e)}.
|
|
18
|
+
Url: ${Du(e)}`),!0;if(!vV(e,t.allowUrls))return E&&g.warn(`Event dropped due to not being matched by \`allowUrls\` option.
|
|
19
|
+
Event: ${Di(e)}.
|
|
20
|
+
Url: ${Du(e)}`),!0}return!1}function IV(e,t){return t?.length?Pu(e).some(n=>fn(n,t)):!1}function AV(e,t){if(!t?.length)return!1;let n=e.transaction;return n?fn(n,t):!1}function NV(e,t){if(!t?.length)return!1;let n=Du(e);return n?fn(n,t):!1}function vV(e,t){if(!t?.length)return!0;let n=Du(e);return n?fn(n,t):!0}function RV(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 Du(e){try{let n=[...e.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?RV(n):null}catch{return E&&g.error(`Cannot extract url for event ${Di(e)}`),null}}function OV(e){return e.exception?.values?.length?!e.message&&!e.exception.values.some(t=>t.stacktrace||t.type&&t.type!=="Error"||t.value):!1}function yO(e,t,n,r,i,o){if(!i.exception?.values||!o||!et(o.originalException))return;let s=i.exception.values.length>0?i.exception.values[i.exception.values.length-1]:void 0;s&&(i.exception.values=gb(e,t,r,o.originalException,n,i.exception.values,s,0))}function gb(e,t,n,r,i,o,s,c){if(o.length>=n+1)return o;let a=[...o];if(et(r[i])){hO(s,c,r);let l=e(t,r[i]),p=a.length;bO(l,i,p,c),a=gb(e,t,n,r[i],i,[l,...a],l,p)}return SO(r)&&r.errors.forEach((l,p)=>{if(et(l)){hO(s,c,r);let u=e(t,l),d=a.length;bO(u,`errors[${p}]`,d,c),a=gb(e,t,n,l,i,[u,...a],u,d)}}),a}function SO(e){return Array.isArray(e.errors)}function hO(e,t,n){e.mechanism={handled:!0,type:"auto.core.linked_errors",...SO(n)&&{is_exception_group:!0},...e.mechanism,exception_id:t}}function bO(e,t,n,r){e.mechanism={handled:!0,...e.mechanism,type:"chained",source:t,exception_id:n,parent_id:r}}function EO(e,t){return e(t.stack||"",1)}function CV(e){return et(e)&&"__sentry_fetch_url_host__"in e&&typeof e.__sentry_fetch_url_host__=="string"}function xV(e){return CV(e)?`${e.message} (${e.__sentry_fetch_url_host__})`:e.message}function _b(e,t){let n={type:t.name||t.constructor.name,value:xV(t)},r=EO(e,t);return r.length&&(n.stacktrace={frames:r}),n}function PV(e){for(let t in e)if(Object.prototype.hasOwnProperty.call(e,t)){let n=e[t];if(et(n))return n}}function kV(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=S_(e);if(__(e))return`Event \`ErrorEvent\` captured as exception with message \`${e.message}\``;let n=LV(e);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${t}`}function LV(e){try{let t=Object.getPrototypeOf(e);return t?t.constructor.name:void 0}catch{}}function MV(e,t,n,r){if(et(n))return[n,void 0];if(t.synthetic=!0,Yt(n)){let o=e?.getOptions().normalizeDepth,s={__serialized__:T_(n,o)},c=PV(n);if(c)return[c,s];let a=kV(n),l=r?.syntheticException||new Error(a);return l.message=a,[l,s]}let i=r?.syntheticException||new Error(n);return i.message=`${n}`,[i,void 0]}function TO(e,t,n,r){let o=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[s,c]=MV(e,o,n,r),a={exception:{values:[_b(t,s)]}};return c&&(a.extra=c),R_(a,void 0,void 0),Dn(a,o),{...a,event_id:r?.event_id}}function IO(e,t,n="info",r,i){let o={event_id:r?.event_id,level:n};if(i&&r?.syntheticException){let s=EO(e,r.syntheticException);s.length&&(o.exception={values:[{value:t,stacktrace:{frames:s}}]},Dn(o,{synthetic:!0}))}if(Ui(t)){let{__sentry_template_string__:s,__sentry_template_values__:c}=t;return o.logentry={message:s,params:c},o}return o.message=t,o}var wV="cause",GV=5,UV="LinkedErrors",DV=((e={})=>{let t=e.limit||GV,n=e.key||wV;return{name:UV,preprocessEvent(r,i,o){let s=o.getOptions();yO(_b,s.stackParser,n,t,r,i)}}}),il=DV;var hb=["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 bb(e){let t={};for(let o of Object.keys(e))t[o.toLowerCase()]=e[o];return hb.map(o=>{let s=t[o.toLowerCase()],c=Array.isArray(s)?s.join(";"):s;return o==="Forwarded"?BV(c):c?.split(",").map(a=>a.trim())}).reduce((o,s)=>s?o.concat(s):o,[]).find(o=>o!==null&&HV(o))||null}function BV(e){if(!e)return null;for(let t of e.split(";"))if(t.startsWith("for="))return t.slice(4);return null}function HV(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 FV="RequestData",WV=((e={})=>{function t(n){let r=n.getDataCollectionOptions(),i={...r,...e.include?.cookies===!0&&r.cookies===!1&&{cookies:!0},...e.include?.headers===!0&&r.httpHeaders.request===!1&&{httpHeaders:{...r.httpHeaders,request:!0}},...e.include?.query_string===!0&&r.urlQueryParams===!1&&{urlQueryParams:!0}};return{dataCollection:i,include:{cookies:i.cookies!==!1,data:!0,headers:i.httpHeaders.request!==!1,ip:i.userInfo,query_string:i.urlQueryParams!==!1,url:!0,...e.include}}}return{name:FV,processEvent(n,r,i){let{sdkProcessingMetadata:o={}}=n,{normalizedRequest:s,ipAddress:c}=o,{include:a,dataCollection:l}=t(i);return s&&VV(n,s,{ipAddress:c},a,l),n},processSegmentSpan(n,r){let{sdkProcessingMetadata:i={}}=J().getScopeData(),{normalizedRequest:o,ipAddress:s}=i;if(!o)return;let{include:c,dataCollection:a}=t(r);YV(n,o,s,c,a)}}}),ol=WV;function VV(e,t,n,r,i){let o=AO(t,r);if(o.query_string&&(o.query_string=NO(o.query_string,i.urlQueryParams)),o.url&&(o.url=zc(o.url,i.urlQueryParams)),e.request={...e.request,...o},r.ip){let s=t.headers&&bb(t.headers)||n.ipAddress;s&&(e.user={...e.user,ip_address:s})}}function YV(e,t,n,r,i){let o=AO(t,r),s={};if(o.url&&(s[pt]=zc(o.url,i.urlQueryParams)),o.method&&(s["http.request.method"]=o.method),o.query_string&&(s[Ru]=NO(o.query_string,i.urlQueryParams)),Gt(e,s),o.cookies&&Object.keys(o.cookies).length>0){let c=Object.entries(o.cookies).map(([l,p])=>`${l}=${p}`).join("; "),a=Hr({cookie:c},i,"request");Gt(e,a)}if(o.headers){let c=Hr(o.headers,i,"request");Gt(e,c)}if(o.data!=null){let c=typeof o.data=="string"?o.data:JSON.stringify(o.data);c&&Gt(e,{"http.request.body.data":c})}if(r.ip){let c=t.headers&&bb(t.headers)||n||void 0;c&&Gt(e,{[Rc]:c})}}function AO(e,t){let n={},r={...e.headers};if(t.headers&&(n.headers=r,t.cookies||delete r.cookie,!t.ip)){let i=new Set(hb.map(o=>o.toLowerCase()));for(let o of Object.keys(r))i.has(o.toLowerCase())&&delete r[o]}if(n.method=e.method,t.url&&(n.url=e.url),t.cookies){let i=e.cookies||(r?.cookie?sO(r.cookie):void 0);n.cookies=i||{}}return t.query_string&&(n.query_string=e.query_string),t.data&&(n.data=e.data),n}function NO(e,t){let n=jV(e);return n?pa(n,t):void 0}function jV(e){if(typeof e=="string")return e||void 0;let t=Array.isArray(e)?e:Object.entries(e);return new URLSearchParams(t).toString()||void 0}var Hu=new Set([]);function ua(e){let t="console",n=g_(t,e);return vc(t,ZV),n}function RO(e){for(let t of e)Hu.add(t);return()=>{for(let t of e)Hu.delete(t)}}var vO=new Set;function ZV(){"console"in te&&zn.forEach(function(e){vO.has(e)||!(e in te.console)||(vO.add(e),kt(te.console,e,function(t){return $n[e]=t,function(...n){let r=n[0],i=$n[e],o=Hu.size&&typeof r=="string"&&fn(r,Hu);o||Cs("console",{args:n,level:e}),(!o||E&&g.isEnabled())&&i?.apply(te.console,n)}}))})}function Qi(e){return e==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(e)?e:"log"}var XV="CaptureConsole",KV=((e={})=>{let t=e.levels||zn,n=e.handled??!0;return{name:XV,setup(r){"console"in te&&ua(({args:i,level:o})=>{C()!==r||!t.includes(o)||qV(i,o,n)})}}}),yb=KV;function qV(e,t,n){let r=Qi(t),i=new Error,o={level:Qi(t),extra:{arguments:e}};Be(s=>{if(s.addEventProcessor(l=>(l.logger="console",Dn(l,{handled:n,type:"auto.core.capture_console"}),l)),t==="assert"){if(!e[0]){let l=`Assertion failed: ${Ls(e.slice(1)," ")||"console.assert"}`;s.setExtra("arguments",e.slice(1)),s.captureMessage(l,r,{captureContext:o,syntheticException:i})}return}let c=e.find(l=>l instanceof Error);if(c){me(c,o);return}let a=Ls(e," ");s.captureMessage(a,r,{captureContext:o,syntheticException:i})})}var QV="Dedupe",JV=(()=>{let e;return{name:QV,processEvent(t){if(t.type)return t;try{if($V(t,e))return E&&g.warn("Event dropped due to being a duplicate of previously captured event."),null}catch{}return e=t}}}),Sb=JV;function $V(e,t){return t?!!(zV(e,t)||eY(e,t)):!1}function zV(e,t){let n=e.message,r=t.message;return!(!n&&!r||n&&!r||!n&&r||n!==r||!xO(e,t)||!CO(e,t))}function eY(e,t){let n=OO(t),r=OO(e);return!(!n||!r||n.type!==r.type||n.value!==r.value||!xO(e,t)||!CO(e,t))}function CO(e,t){let n=$p(e),r=$p(t);if(!n&&!r)return!0;if(n&&!r||!n&&r||(n=n,r=r,r.length!==n.length))return!1;for(let i=0;i<r.length;i++){let o=r[i],s=n[i];if(o.filename!==s.filename||o.lineno!==s.lineno||o.colno!==s.colno||o.function!==s.function)return!1}return!0}function xO(e,t){let n=e.fingerprint,r=t.fingerprint;if(!n&&!r)return!0;if(n&&!r||!n&&r)return!1;n=n,r=r;try{return n.join("")===r.join("")}catch{return!1}}function OO(e){return e.exception?.values?.[0]}var tY="ExtraErrorData",nY=((e={})=>{let{depth:t=3,captureErrorCause:n=!0}=e;return{name:tY,processEvent(r,i,o){let{maxValueLength:s}=o.getOptions();return rY(r,i,t,n,s)}}}),Eb=nY;function rY(e,t={},n,r,i){if(!t.originalException||!et(t.originalException))return e;let o=t.originalException.name||t.originalException.constructor.name,s=PO(t.originalException,r,i);if(s){let c={...e.contexts},a=Ke(s,n);return Yt(a)&&(cv(a),c[o]=a),{...e,contexts:c}}return e}function PO(e,t,n){try{let r=["name","message","stack","line","column","fileName","lineNumber","columnNumber","toJSON"],i={};for(let o of Object.keys(e)){if(r.indexOf(o)!==-1)continue;let s=e[o];i[o]=et(s)||typeof s=="string"?n?mn(`${s}`,n):`${s}`:s}if(t&&e.cause!==void 0)if(et(e.cause)){let o=e.cause.name||e.cause.constructor.name;i.cause={[o]:PO(e.cause,!1,n)}}else i.cause=e.cause;if(typeof e.toJSON=="function"){let o=e.toJSON();for(let s of Object.keys(o)){let c=o[s];i[s]=et(c)?c.toString():c}}return i}catch(r){E&&g.error("Unable to extract extra data from the Error object:",r)}return null}function iY(e,t){let n=0;for(let r=e.length-1;r>=0;r--){let i=e[r];i==="."?e.splice(r,1):i===".."?(e.splice(r,1),n++):n&&(e.splice(r,1),n--)}if(t)for(;n--;n)e.unshift("..");return e}var oY=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function LO(e){let t=e.length>1024?`<truncated>${e.slice(-1024)}`:e,n=oY.exec(t);return n?n.slice(1):[]}function Tb(...e){let t="",n=!1;for(let r=e.length-1;r>=-1&&!n;r--){let i=r>=0?e[r]:"/";i&&(t=`${i}/${t}`,n=i.charAt(0)==="/")}return t=iY(t.split("/").filter(r=>!!r),!n).join("/"),(n?"/":"")+t||"."}function kO(e){let t=0;for(;t<e.length&&e[t]==="";t++);let n=e.length-1;for(;n>=0&&e[n]==="";n--);return t>n?[]:e.slice(t,n-t+1)}function Ib(e,t){e=Tb(e).slice(1),t=Tb(t).slice(1);let n=kO(e.split("/")),r=kO(t.split("/")),i=Math.min(n.length,r.length),o=i;for(let c=0;c<i;c++)if(n[c]!==r[c]){o=c;break}let s=[];for(let c=o;c<n.length;c++)s.push("..");return s=s.concat(r.slice(o)),s.join("/")}function Ab(e){let t=LO(e),n=t[0]||"",r=t[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}function Nb(e,t){let n=LO(e)[2]||"";return t&&n.slice(t.length*-1)===t&&(n=n.slice(0,n.length-t.length)),n}var sY="RewriteFrames",vb=(e={})=>{let t=e.root,n=e.prefix||"app:///",r="window"in te&&!!te.window,i=e.iteratee||aY({isBrowser:r,root:t,prefix:n});function o(c){try{return{...c,exception:{...c.exception,values:c.exception.values.map(a=>({...a,...a.stacktrace&&{stacktrace:s(a.stacktrace)}}))}}}catch{return c}}function s(c){return{...c,frames:c?.frames?.map(a=>i(a))}}return{name:sY,processEvent(c){let a=c;return c.exception&&Array.isArray(c.exception.values)&&(a=o(a)),a}}};function aY({isBrowser:e,root:t,prefix:n}){return r=>{if(!r.filename)return r;let i=/^[a-zA-Z]:\\/.test(r.filename)||r.filename.includes("\\")&&!r.filename.includes("/"),o=/^\//.test(r.filename);if(e){if(t){let s=r.filename;s.indexOf(t)===0&&(r.filename=s.replace(t,n))}}else if(i||o){let s=i?r.filename.replace(/^[a-zA-Z]:/,"").replace(/\\/g,"/"):r.filename,c=t?Ib(t,s):Nb(s);r.filename=`${n}${c}`}return r}}var cY=["reauthenticate","signInAnonymously","signInWithOAuth","signInWithIdToken","signInWithOtp","signInWithPassword","signInWithSSO","signOut","signUp","verifyOtp"],lY=["createUser","deleteUser","listUsers","getUserById","updateUserById","inviteUserByEmail"],pY={eq:"eq",neq:"neq",gt:"gt",gte:"gte",lt:"lt",lte:"lte",like:"like","like(all)":"likeAllOf","like(any)":"likeAnyOf",ilike:"ilike","ilike(all)":"ilikeAllOf","ilike(any)":"ilikeAnyOf",is:"is",in:"in",cs:"contains",cd:"containedBy",sr:"rangeGt",nxl:"rangeGte",sl:"rangeLt",nxr:"rangeLte",adj:"rangeAdjacent",ov:"overlaps",fts:"",plfts:"plain",phfts:"phrase",wfts:"websearch",not:"not"},wO=["select","insert","upsert","update","delete"];function Fu(e){try{e.__SENTRY_INSTRUMENTED__=!0}catch{}}function Wu(e){try{return e.__SENTRY_INSTRUMENTED__}catch{return!1}}function GO(e,t){if(Object.keys(t).length>0)return t;if(Array.isArray(e)&&e.length>0)return e}function uY(e,t){return GO(e,t)!==void 0}function UO(e,t){if(!e)return;if(typeof e.get=="function")return e.get(t)??void 0;let n=e,r=t.toLowerCase(),i=Object.keys(n).find(o=>o.toLowerCase()===r);return i!==void 0?n[i]:void 0}function dY(e,t={}){switch(e){case"GET":return"select";case"POST":return UO(t,"Prefer")?.includes("resolution=")?"upsert":"insert";case"PATCH":return"update";case"DELETE":return"delete";default:return"<unknown-op>"}}function mY(e,t){if(t===""||t==="*")return"select(*)";if(e==="select")return`select(${t})`;if(e==="or"||e.endsWith(".or"))return`${e}${t}`;let[n,...r]=t.split("."),i;return n?.startsWith("fts")?i="textSearch":n?.startsWith("plfts")?i="textSearch[plain]":n?.startsWith("phfts")?i="textSearch[phrase]":n?.startsWith("wfts")?i="textSearch[websearch]":i=n&&pY[n]||"filter",`${i}(${e}, ${r.join(".")})`}function MO(e,t=!1){return new Proxy(e,{apply(n,r,i){return Se({name:`auth ${t?"(admin) ":""}${e.name}`,attributes:{[S]:"auto.db.supabase",[B]:"db","db.system":"postgresql","db.operation":`auth.${t?"admin.":""}${e.name}`}},o=>Reflect.apply(n,r,i).then(s=>(V(s)&&"error"in s&&s.error?(o.setStatus({code:2}),me(s.error,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}})):o.setStatus({code:1}),o.end(),s)).catch(s=>{throw o.setStatus({code:2}),o.end(),me(s,{mechanism:{handled:!1,type:"auto.db.supabase.auth"}}),s}).then(...i))}})}function fY(e){let t=e.auth;if(!(!t||Wu(e.auth))){for(let n of cY){let r=t[n];r&&typeof e.auth[n]=="function"&&(e.auth[n]=MO(r))}for(let n of lY){let r=t.admin[n];r&&typeof e.auth.admin[n]=="function"&&(e.auth.admin[n]=MO(r,!0))}Fu(e.auth)}}function gY(e,t){Wu(e.prototype.from)||(e.prototype.from=new Proxy(e.prototype.from,{apply(n,r,i){let o=Reflect.apply(n,r,i),s=o.constructor;return hY(s,t),o}}),Fu(e.prototype.from))}function _Y(e,t){Wu(e.prototype.then)||(e.prototype.then=new Proxy(e.prototype.then,{apply(n,r,i){let o=wO,s=r,c=dY(s.method,s.headers);if(!o.includes(c)||!s?.url?.pathname||typeof s.url.pathname!="string")return Reflect.apply(n,r,i);let a=s.url.pathname.split("/"),l=a.length>0?a[a.length-1]:"",p=[];for(let[v,P]of s.url.searchParams.entries())p.push(mY(v,P));let u=Object.create(null);if(Yt(s.body))for(let[v,P]of Object.entries(s.body))u[v]=P;let d=C(),m=t.sendOperationData??d?.getDataCollectionOptions().databaseQueryData===!0,_=GO(s.body,u),h=c==="select"?"":`${c}${uY(s.body,u)?"(...) ":""}`,b=m?p.join(" "):p.length>0?"[redacted]":"",N=[h.trimEnd(),b].filter(Boolean).join(" "),M=N?`${N} from(${l})`:`from(${l})`,R={"db.table":l,"db.schema":s.schema,"db.url":s.url.origin,"db.sdk":UO(s.headers,"X-Client-Info"),"db.system":"postgresql","db.operation":c,[S]:"auto.db.supabase",[B]:"db"};return p.length&&m&&(R["db.query"]=p),_!==void 0&&m&&(R["db.body"]=_),Se({name:M,attributes:R},v=>Reflect.apply(n,r,[]).then(P=>{if(v&&(P&&typeof P=="object"&&"status"in P&&Bs(v,P.status||500),v.end()),P?.error){let H=new Error(P.error.message);P.error.code&&(H.code=P.error.code),P.error.details&&(H.details=P.error.details);let L={};p.length&&m&&(L.query=p),_!==void 0&&m&&(L.body=_),me(H,G=>(G.addEventProcessor(ce=>(Dn(ce,{handled:!1,type:"auto.db.supabase.postgres"}),ce)),G.setContext("supabase",L),G))}let D={type:"supabase",category:`db.${c}`,message:M},I={};return p.length&&m&&(I.query=p),_!==void 0&&m&&(I.body=_),Object.keys(I).length&&(D.data=I),on(D),P},P=>{throw v&&(Bs(v,500),v.end()),P}).then(...i))}}),Fu(e.prototype.then))}function hY(e,t){for(let n of wO)Wu(e.prototype[n])||(e.prototype[n]=new Proxy(e.prototype[n],{apply(r,i,o){let s=Reflect.apply(r,i,o),c=s.constructor;return E&&g.log(`Instrumenting ${n} operation's PostgRESTFilterBuilder`),_Y(c,t),s}}),Fu(e.prototype[n]))}var Vu=(e,t={})=>{if(!e){E&&g.warn("Supabase integration was not installed because no Supabase client was provided.");return}let n=e.constructor===Function?e:e.constructor;gY(n,t),fY(e)},bY="Supabase",yY=((e,t)=>({setupOnce(){Vu(e,t)},name:bY})),Rb=e=>yY(e.supabaseClient,{sendOperationData:e.sendOperationData});var SY=10,EY="ZodErrors";function TY(e){return et(e)&&e.name==="ZodError"&&Array.isArray(e.issues)}function IY(e){return{...e,path:"path"in e&&Array.isArray(e.path)?e.path.join("."):void 0,keys:"keys"in e?JSON.stringify(e.keys):void 0,unionErrors:"unionErrors"in e?JSON.stringify(e.unionErrors):void 0}}function AY(e){return e.map(t=>typeof t=="number"?"<array>":t).join(".")}function NY(e){let t=new Set;for(let r of e.issues){let i=AY(r.path);i.length>0&&t.add(i)}let n=Array.from(t);if(n.length===0){let r="variable";if(e.issues.length>0){let i=e.issues[0];i!==void 0&&"expected"in i&&typeof i.expected=="string"&&(r=i.expected)}return`Failed to validate ${r}`}return`Failed to validate keys: ${mn(n.join(", "),100)}`}function vY(e,t=!1,n,r){if(!n.exception?.values||!r.originalException||!TY(r.originalException)||r.originalException.issues.length===0)return n;try{let o=(t?r.originalException.issues:r.originalException.issues.slice(0,e)).map(IY);return t&&(Array.isArray(r.attachments)||(r.attachments=[]),r.attachments.push({filename:"zod_issues.json",data:JSON.stringify({issues:o})})),{...n,exception:{...n.exception,values:[{...n.exception.values[0],value:NY(r.originalException)},...n.exception.values.slice(1)]},extra:{...n.extra,"zoderror.issues":o.slice(0,e)}}}catch(i){return{...n,extra:{...n.extra,"zoderrors sentry integration parse error":{message:"an exception was thrown while processing ZodError within applyZodErrorsToEvent()",error:i instanceof Error?`${i.name}: ${i.message}
|
|
21
|
+
${i.stack}`:"unknown"}}}}}var RY=((e={})=>{let t=e.limit??SY;return{name:EY,processEvent(n,r){return vY(t,e.saveZodIssuesAsAttachment,n,r)}}}),Ob=RY;var OY="Console",Cb=(e={})=>{let t=new Set(e.levels||zn);return{name:OY,setup(n){let r=ua(({args:i,level:o})=>{C()!==n||!t.has(o)||CY(o,i)});if(n.registerCleanup(r),e.filter){let i=RO(e.filter);n.registerCleanup(i)}}}};function CY(e,t){let n={category:"console",data:{arguments:t,logger:"console"},level:Qi(e),message:DO(t)};if(e==="assert")if(t[0]===!1){let r=t.slice(1);n.message=r.length>0?`Assertion failed: ${DO(r)}`:"Assertion failed",n.data.arguments=r}else return;on(n,{input:t,level:e})}function DO(e){return"util"in te&&typeof te.util.format=="function"?te.util.format(...e):Ls(e," ")}var xY=100,PY=10,Yu="flag.evaluation.";function ju(e){if(e.type)return e;let n=ne().getScopeData().contexts.flags,r=n?n.values:[];return r.length&&(e.contexts===void 0&&(e.contexts={}),e.contexts.flags={values:[...r]}),e}function Zu(e,t,n=xY){let r=ne().getScopeData().contexts;r.flags||(r.flags={values:[]});let i=r.flags.values;kY(i,e,t,n)}function kY(e,t,n,r){if(typeof n!="boolean")return;if(e.length>r){E&&g.error(`[Feature Flags] insertToFlagBuffer called on a buffer larger than maxSize=${r}`);return}let i=e.findIndex(o=>o.flag===t);i!==-1&&e.splice(i,1),e.length===r&&e.shift(),e.push({flag:t,result:n})}function Xu(e,t,n=PY){if(typeof t!="boolean")return;let r=Q();if(!r)return;let i=oe(r).data;if(`${Yu}${e}`in i){r.setAttribute(`${Yu}${e}`,t);return}Object.keys(i).filter(s=>s.startsWith(Yu)).length<n&&r.setAttribute(`${Yu}${e}`,t)}var xb=()=>({name:"FeatureFlags",processEvent(e,t,n){return ju(e)},addFeatureFlag(e,t){Zu(e,t),Xu(e,t)}});var Pb=({growthbookClass:e})=>({name:"GrowthBook",setupOnce(){let t=e.prototype;typeof t.isOn=="function"&&kt(t,"isOn",BO),typeof t.getFeatureValue=="function"&&kt(t,"getFeatureValue",BO)},processEvent(t,n,r){return ju(t)}});function BO(e){return function(...t){let n=t[0],r=e.apply(this,t);return typeof n=="string"&&typeof r=="boolean"&&(Zu(n,r),Xu(n,r)),r}}var LY="ConversationId",MY=(()=>({name:LY,setup(e){e.on("spanStart",t=>{let n=ne().getScopeData(),r=J().getScopeData(),i=n.conversationId||r.conversationId;if(i){let{op:o,data:s,description:c}=oe(t);if(!o?.startsWith("gen_ai.")&&!s["ai.operationId"]&&!c?.startsWith("ai."))return;t.setAttribute(Uo,i)}})}})),kb=MY;function HO(e){return!!e&&typeof e._profiler<"u"&&typeof e._profiler.start=="function"&&typeof e._profiler.stop=="function"}function wY(){let e=C();if(!e){E&&g.warn("No Sentry client available, profiling is not started");return}let t=e.getIntegrationByName("ProfilingIntegration");if(!t){E&&g.warn("ProfilingIntegration is not available");return}if(!HO(t)){E&&g.warn("Profiler is not available on profiling integration.");return}t._profiler.start()}function GY(){let e=C();if(!e){E&&g.warn("No Sentry client available, profiling is not started");return}let t=e.getIntegrationByName("ProfilingIntegration");if(!t){E&&g.warn("ProfilingIntegration is not available");return}if(!HO(t)){E&&g.warn("Profiler is not available on profiling integration.");return}t._profiler.stop()}var Lb={startProfiler:wY,stopProfiler:GY};function Mb(e,t={},n=ne()){let{message:r,name:i,email:o,url:s,source:c,associatedEventId:a,tags:l}=e,p={contexts:{feedback:{contact_email:o,name:i,message:r,url:s,source:c,associated_event_id:a}},type:"feedback",level:"info",tags:l},u=n?.getClient()||C();return u&&u.emit("beforeSendFeedback",p,t),n.captureEvent(p,t)}function da(e,t,n){return"util"in te&&typeof te.util.format=="function"?te.util.format(...e):UY(e,t,n)}function UY(e,t,n){return e.map(r=>er(r)?String(r):JSON.stringify(Ke(r,t,n))).join(" ")}function Ku(e){return/%[sdifocO]/.test(e)}function qu(e,t){let n={},r=new Array(t.length).fill("{}").join(" ");return n["sentry.message.template"]=`${e} ${r}`,t.forEach((i,o)=>{n[`sentry.message.parameter.${o}`]=i}),n}var DY="ConsoleLogs",FO={[S]:"auto.log.console"},BY=((e={})=>{let t=e.levels||zn;return{name:DY,setup(n){let{enableLogs:r,normalizeDepth:i=3,normalizeMaxBreadth:o=1e3}=n.getOptions();if(!r){E&&g.warn("`enableLogs` is not enabled, ConsoleLogs integration disabled");return}let s=ua(({args:c,level:a})=>{if(C()!==n||!t.includes(a))return;let l=c[0],p=c.slice(1);if(a==="assert"){if(!l){let m=p.length>0?`Assertion failed: ${da(p,i,o)}`:"Assertion failed";lr({level:"error",message:m,attributes:FO})}return}let u=a==="log",d={...FO};if(Yt(l)){Object.assign(d,Ke(l,i,o));let m=typeof c[1]=="string"?2:1;c.slice(m).forEach((h,b)=>{d[`sentry.message.parameter.${b}`]=Ke(h,i,o)})}else if(p.length>0&&typeof l=="string"&&!Ku(l)){let _=qu(l,p);for(let[h,b]of Object.entries(_))d[h]=h.startsWith("sentry.message.parameter.")?Ke(b,i,o):b}lr({level:u?"info":a,message:da(c,i,o),severityNumber:u?10:void 0,attributes:d})});n.registerCleanup(s)}}}),wb=BY;var ft={};jN(ft,{count:()=>HY,distribution:()=>WY,gauge:()=>FY});function Gb(e,t,n,r){D0({type:e,name:t,value:n,unit:r?.unit,attributes:r?.attributes},{scope:r?.scope})}function HY(e,t=1,n){Gb("counter",e,t,n)}function FY(e,t,n){Gb("gauge",e,t,n)}function WY(e,t,n){Gb("distribution",e,t,n)}var VY=["trace","debug","info","warn","error","fatal"];function Ub(e={}){let t=new Set(e.levels??VY),n=e.client;return{log(r){let{type:i,level:o,message:s,args:c,tag:a,date:l,...p}=r,u=n||C();if(!u)return;let d=ZY(i,o);if(!t.has(d))return;let{normalizeDepth:m=3,normalizeMaxBreadth:_=1e3}=u.getOptions(),h={};for(let[N,M]of Object.entries(p))h[N]=Ke(M,m,_);h["sentry.origin"]="auto.log.consola",a&&(h["consola.tag"]=a),i&&(h["consola.type"]=i),o!=null&&typeof o=="number"&&(h["consola.level"]=o);let b=KY(XY(c,m,_),m,_);b?.attributes&&Object.assign(h,b.attributes),lr({level:d,message:b?.message||s||c&&da(c,m,_)||"",attributes:h})}}}var YY={silent:"trace",fatal:"fatal",error:"error",warn:"warn",log:"info",info:"info",success:"info",fail:"error",ready:"info",start:"info",box:"info",debug:"debug",trace:"trace",verbose:"debug",critical:"fatal",notice:"info"},jY={0:"fatal",1:"warn",2:"info",3:"info",4:"debug",5:"trace"};function ZY(e,t){if(e==="verbose")return"debug";if(e==="silent")return"trace";if(e){let n=YY[e];if(n)return n}if(typeof t=="number"){let n=jY[t];if(n)return n}return"info"}function XY(e,t,n){if(!e?.length)return{message:""};let r=da(e,t,n),i=e[0];if(Yt(i)){let o=typeof e[1]=="string"?2:1,s=e.slice(o);return{message:r,attributes:i,messageParameters:s}}else{let o=e.slice(1),s=o.length>0&&typeof i=="string"&&!Ku(i);return{message:r,messageTemplate:s?i:void 0,messageParameters:s?o:void 0}}}function KY(e,t,n){let{message:r,attributes:i,messageTemplate:o,messageParameters:s}=e,c={};if(o&&s){let a=qu(o,s);for(let[l,p]of Object.entries(a))c[l]=l.startsWith("sentry.message.parameter.")?Ke(p,t,n):p}else s&&s.length>0&&s.forEach((a,l)=>{c[`sentry.message.parameter.${l}`]=Ke(a,t,n)});return{message:r,attributes:{...Ke(i,t,n),...c}}}var WO="gen_ai.prompt",Fr="gen_ai.system",De="gen_ai.request.model",ma="gen_ai.request.stream",Ji="gen_ai.request.temperature",fa="gen_ai.request.max_tokens",$i="gen_ai.request.frequency_penalty",ga="gen_ai.request.presence_penalty",zi="gen_ai.request.top_p",Qu="gen_ai.request.top_k",Ju="gen_ai.request.encoding_format",$u="gen_ai.request.dimensions",Wr="gen_ai.response.finish_reasons",sn="gen_ai.response.model",eo="gen_ai.response.id",VO="gen_ai.response.stop_reason",it="gen_ai.usage.input_tokens",ut="gen_ai.usage.output_tokens",Dt="gen_ai.usage.total_tokens",ot="gen_ai.operation.name",xt="sentry.sdk_meta.gen_ai.input.messages.original_length",Bt="gen_ai.input.messages",YO="gen_ai.output.messages",$t="gen_ai.system_instructions",zt="gen_ai.response.text",Vn="gen_ai.request.available_tools",jO="gen_ai.response.streaming",bn="gen_ai.response.tool_calls",to="gen_ai.agent.name",ZO="gen_ai.pipeline.name",no="gen_ai.conversation.id",XO="gen_ai.usage.cache_creation_input_tokens",KO="gen_ai.usage.cache_read_input_tokens",Db="gen_ai.usage.input_tokens.cache_write",ro="gen_ai.usage.input_tokens.cached",qO="gen_ai.invoke_agent",io="gen_ai.embeddings.input",Bb="gen_ai.embeddings",Hb="gen_ai.execute_tool",Vr="gen_ai.tool.name",sl="gen_ai.tool.call.id",al="gen_ai.tool.type",_a="gen_ai.tool.input",ha="gen_ai.tool.output",ba="gen_ai.tool.description";function oo(e){return!e||typeof e!="object"?!1:QY(e)||JO(e)||qY(e)||$O(e)||zO(e)||JY(e)||$Y(e)||zY(e)||e5(e)||t5(e)||n5(e)||r5(e)}function qY(e){return"image_url"in e?typeof e.image_url=="string"?e.image_url.startsWith("data:"):QO(e):!1}function QO(e){return"image_url"in e&&!!e.image_url&&typeof e.image_url=="object"&&"url"in e.image_url&&typeof e.image_url.url=="string"&&e.image_url.url.startsWith("data:")}function QY(e){return"type"in e&&typeof e.type=="string"&&"source"in e&&oo(e.source)}function JO(e){return"inlineData"in e&&!!e.inlineData&&typeof e.inlineData=="object"&&"data"in e.inlineData&&typeof e.inlineData.data=="string"}function $O(e){return"type"in e&&e.type==="input_audio"&&"input_audio"in e&&!!e.input_audio&&typeof e.input_audio=="object"&&"data"in e.input_audio&&typeof e.input_audio.data=="string"}function zO(e){return"type"in e&&e.type==="file"&&"file"in e&&!!e.file&&typeof e.file=="object"&&"file_data"in e.file&&typeof e.file.file_data=="string"}function JY(e){return"media_type"in e&&typeof e.media_type=="string"&&"data"in e}function $Y(e){return"type"in e&&e.type==="file"&&"mediaType"in e&&typeof e.mediaType=="string"&&"data"in e&&typeof e.data=="string"&&!e.data.startsWith("http://")&&!e.data.startsWith("https://")}function zY(e){return"type"in e&&e.type==="image"&&"image"in e&&typeof e.image=="string"&&!e.image.startsWith("http://")&&!e.image.startsWith("https://")}function e5(e){return"type"in e&&(e.type==="blob"||e.type==="base64")}function t5(e){return"b64_json"in e}function n5(e){return"type"in e&&"result"in e&&e.type==="image_generation"}function r5(e){return"uri"in e&&typeof e.uri=="string"&&e.uri.startsWith("data:")}var cl="[Blob substitute]",i5=["image_url","data","content","b64_json","result","uri","image"];function Jo(e){let t={...e};oo(t.source)&&(t.source=Jo(t.source)),JO(e)&&(t.inlineData={...e.inlineData,data:cl}),QO(e)&&(t.image_url={...e.image_url,url:cl}),$O(e)&&(t.input_audio={...e.input_audio,data:cl}),zO(e)&&(t.file={...e.file,file_data:cl});for(let n of i5)typeof t[n]=="string"&&(t[n]=cl);return t}var tC=2e4,zu=e=>new TextEncoder().encode(e).length,Wb=e=>zu(JSON.stringify(e));function ed(e,t){if(zu(e)<=t)return e;let n=0,r=e.length,i="";for(;n<=r;){let o=Math.floor((n+r)/2),s=e.slice(0,o);zu(s)<=t?(i=s,n=o+1):r=o-1}return i}function o5(e){return typeof e=="string"?e:"text"in e&&typeof e.text=="string"?e.text:""}function eC(e,t){return typeof e=="string"?t:{...e,text:t}}function s5(e){return e!==null&&typeof e=="object"&&"content"in e&&typeof e.content=="string"}function nC(e){return e!==null&&typeof e=="object"&&"content"in e&&Array.isArray(e.content)}function rC(e){return e!==null&&typeof e=="object"&&"parts"in e&&Array.isArray(e.parts)&&e.parts.length>0}function a5(e,t){let n={...e,content:""},r=Wb(n),i=t-r;if(i<=0)return[];let o=ed(e.content,i);return[{...e,content:o}]}function c5(e){return"parts"in e&&Array.isArray(e.parts)?{key:"parts",items:e.parts}:"content"in e&&Array.isArray(e.content)?{key:"content",items:e.content}:{key:null,items:[]}}function l5(e,t){let{key:n,items:r}=c5(e);if(n===null||r.length===0)return[];let i=r.map(a=>eC(a,"")),o=Wb({...e,[n]:i}),s=t-o;if(s<=0)return[];let c=[];for(let a of r){let l=o5(a),p=zu(l);if(p<=s)c.push(a),s-=p;else if(c.length===0){let u=ed(l,s);u&&c.push(eC(a,u));break}else break}return c.length<=0?[]:[{...e,[n]:c}]}function p5(e,t){if(!e)return[];if(typeof e=="string"){let n=ed(e,t);return n?[n]:[]}return typeof e!="object"?[]:s5(e)?a5(e,t):nC(e)||rC(e)?l5(e,t):[]}function Fb(e){return e.map(n=>{let r;return n&&typeof n=="object"&&(nC(n)?r={...n,content:Fb(n.content)}:"content"in n&&oo(n.content)&&(r={...n,content:Jo(n.content)}),rC(n)&&(r={...r??n,parts:Fb(n.parts)}),oo(r)?r=Jo(r):oo(n)&&(r=Jo(n))),r??n})}function u5(e,t){if(!Array.isArray(e)||e.length===0)return e;let n=t-2,r=e[e.length-1],i=Fb([r]),o=i[0];return Wb(o)<=n?i:p5(o,n)}function iC(e){return u5(e,tC)}function oC(e){return ed(e,tC)}function Ze(e){let t=C()?.getDataCollectionOptions().genAI;return{...e,recordInputs:e?.recordInputs??t?.inputs??!1,recordOutputs:e?.recordOutputs??t?.outputs??!1}}function ze(e){if(e!==void 0)return e;let t=C();return t?!rt(t)&&t.getOptions().streamGenAiSpans===!1:!0}function td(e,t){return e?`${e}.${t}`:t}function sC(e,t,n,r,i){if(t!==void 0&&e.setAttributes({[it]:t}),n!==void 0&&e.setAttributes({[ut]:n}),t!==void 0||n!==void 0||r!==void 0||i!==void 0){let o=(t??0)+(n??0)+(r??0)+(i??0);e.setAttributes({[Dt]:o})}}function $o(e,t,n){if(!e.isRecording())return;let r={[jO]:!0};t.responseId&&(r[eo]=t.responseId),t.responseModel&&(r[sn]=t.responseModel),t.promptTokens!==void 0&&(r[it]=t.promptTokens),t.completionTokens!==void 0&&(r[ut]=t.completionTokens),t.totalTokens!==void 0?r[Dt]=t.totalTokens:(t.promptTokens!==void 0||t.completionTokens!==void 0||t.cacheCreationInputTokens!==void 0||t.cacheReadInputTokens!==void 0)&&(r[Dt]=(t.promptTokens??0)+(t.completionTokens??0)+(t.cacheCreationInputTokens??0)+(t.cacheReadInputTokens??0)),t.finishReasons.length&&(r[Wr]=JSON.stringify(t.finishReasons)),n&&t.responseTexts.length&&(r[zt]=t.responseTexts.join("")),n&&t.toolCalls.length&&(r[bn]=JSON.stringify(t.toolCalls)),e.setAttributes(r),e.end()}function Ht(e){if(typeof e=="string")return oC(e);try{return JSON.stringify(Array.isArray(e)?iC(e):e)}catch{return"[unserializable]"}}function xn(e){if(!Array.isArray(e))return{systemInstructions:void 0,filteredMessages:e};let t=e.findIndex(s=>s&&typeof s=="object"&&"role"in s&&s.role==="system");if(t===-1)return{systemInstructions:void 0,filteredMessages:e};let n=e[t],r=typeof n.content=="string"?n.content:n.content!==void 0?JSON.stringify(n.content):void 0;if(!r)return{systemInstructions:void 0,filteredMessages:e};let i=JSON.stringify([{type:"text",content:r}]),o=[...e.slice(0,t),...e.slice(t+1)];return{systemInstructions:i,filteredMessages:o}}async function d5(e,t){let[n,r]=await Promise.all([t,e]);return r&&typeof r=="object"&&"data"in r?{...r,data:n}:n}function ya(e,t){return bt(e)?new Proxy(e,{get(n,r){let o=r in Promise.prototype||r===Symbol.toStringTag?t:n,s=Reflect.get(o,r);return r==="withResponse"&&typeof s=="function"?function(){let a=s.call(n);return d5(a,t)}:typeof s=="function"?s.bind(o):s}}):t}var aC="WorkersAI";var ll=new Map,nd=new Map,rd=new Map([["ai.generateText","invoke_agent"],["ai.streamText","invoke_agent"],["ai.generateObject","invoke_agent"],["ai.streamObject","invoke_agent"],["ai.generateText.doGenerate","generate_content"],["ai.streamText.doStream","generate_content"],["ai.generateObject.doGenerate","generate_content"],["ai.streamObject.doStream","generate_content"],["ai.embed.doEmbed","embeddings"],["ai.embedMany.doEmbed","embeddings"],["ai.rerank.doRerank","rerank"],["ai.toolCall","execute_tool"]]);var id="operation.name",od="ai.operationId",sd="ai.prompt",cC="ai.schema",lC="ai.response.object",Vb="ai.values",Yb="ai.response.text",jb="ai.response.toolCalls",pC="ai.response.finishReason",zo="ai.prompt.messages",Ii="ai.prompt.tools",pl="ai.model.id",uC="ai.response.providerMetadata",dC="ai.usage.cachedInputTokens",mC="ai.usage.inputTokenDetails.",fC="ai.telemetry.functionId",gC="ai.usage.completionTokens",_C="ai.usage.promptTokens",hC="ai.usage.tokens",Zb="ai.toolCall.name",Xb="ai.toolCall.id",bC="ai.toolCall.args",yC="ai.toolCall.result";function EC(e,t){let n=e.parent_span_id;if(!n)return;let r=e.data[it],i=e.data[ut];if(typeof r=="number"||typeof i=="number"){let o=t.get(n)||{inputTokens:0,outputTokens:0};typeof r=="number"&&(o.inputTokens+=r),typeof i=="number"&&(o.outputTokens+=i),t.set(n,o)}}function Kb(e,t){let n=t.get(e.span_id);!n||!e.data||(n.inputTokens>0&&(e.data[it]=n.inputTokens),n.outputTokens>0&&(e.data[ut]=n.outputTokens),(n.inputTokens>0||n.outputTokens>0)&&(e.data["gen_ai.usage.total_tokens"]=n.inputTokens+n.outputTokens))}function m5(e){let t=new Map;for(let n of e){let r=n.data[Vn];if(typeof r=="string")try{let i=JSON.parse(r);for(let o of i)o.name&&o.description&&!t.has(o.name)&&t.set(o.name,o.description)}catch{}}return t}function TC(e,t){let n=m5(e);for(let r of e){if(r.op==="gen_ai.execute_tool"){let i=r.data[Vr];if(typeof i=="string"){let o=n.get(i);o&&(r.data[ba]=o)}}r.op==="gen_ai.invoke_agent"&&Kb(r,t)}}function qb(e){return ll.get(e)}function Qb(e){ll.delete(e)}function IC(e){let t=e.map(n=>{if(typeof n=="string")try{return JSON.parse(n)}catch{return n}return n});return JSON.stringify(t)}function SC(e){return e.filter(t=>!!t&&typeof t=="object"&&"role"in t&&"content"in t)}function f5(e){try{let t=JSON.parse(e);if(t&&typeof t=="object"){let{messages:n}=t,{prompt:r,system:i}=t,o=[];if(typeof i=="string"&&o.push({role:"system",content:i}),typeof n=="string")try{n=JSON.parse(n)}catch{}if(Array.isArray(n))return o.push(...SC(n)),o;if(Array.isArray(r))return o.push(...SC(r)),o;if(typeof r=="string"&&o.push({role:"user",content:r}),o.length>0)return o}}catch{}return[]}function AC(e,t,n){if(typeof t[sd]=="string"&&!t[Bt]&&!t[zo]){let r=t[sd],i=f5(r);if(i.length){let{systemInstructions:o,filteredMessages:s}=xn(i);o&&e.setAttribute($t,o);let c=Array.isArray(s)?s.length:0,a=n?Ht(s):Ge(s);e.setAttributes({[sd]:a,[Bt]:a,[xt]:c})}}else if(typeof t[zo]=="string"){let r=t[zo];try{let i=JSON.parse(r);if(Array.isArray(i)){let{systemInstructions:o,filteredMessages:s}=xn(i);o&&e.setAttribute($t,o);let c=Array.isArray(s)?s.length:0,a=!n&&s===i?r:n?Ht(s):Ge(s);e.setAttributes({[zo]:a,[Bt]:a,[xt]:c})}}catch{}}}function g5(e){let{data:t,description:n}=oe(e);if(!n)return;if(t[Zb]&&t[Xb]&&n==="ai.toolCall"){E5(e,t);return}if(!t[od]&&!n.startsWith("ai."))return;rd.get(n)==="generate_content"&&Ti([aC]);let i=C()?.getIntegrationByName("VercelAI"),o=ze(i?.options?.enableTruncation);T5(e,n,t,o)}function _5(e){if(e.type==="transaction"&&e.spans){let t=new Map;for(let r of e.spans)y5(r),EC(r,t);TC(e.spans,t);let n=e.contexts?.trace;n?.op==="gen_ai.invoke_agent"&&Kb(n,t)}return e}function h5(e){if(typeof e!="string")return"stop";switch(e){case"tool-calls":return"tool_call";case"stop":case"length":case"content_filter":case"error":return e;default:return e}}function b5(e){let t=e[Yb],n=e[jb],r=e[pC];if(t==null&&n==null)return;let i=[];if(typeof t=="string"&&t.length>0&&i.push({type:"text",content:t}),n!=null)try{let o=typeof n=="string"?JSON.parse(n):n;if(Array.isArray(o)){for(let s of o){let c=s.input??s.args;i.push({type:"tool_call",id:s.toolCallId,name:s.toolName,arguments:typeof c=="string"?c:JSON.stringify(c??{})})}delete e[jb]}}catch{}if(i.length>0){let o={role:"assistant",parts:i,finish_reason:h5(r)};e[YO]=JSON.stringify([o]),delete e[Yb]}}function vC(e){if(Ft(e,gC,ut),Ft(e,_C,it),Ft(e,dC,ro),Ft(e,"ai.usage.inputTokens",it),Ft(e,"ai.usage.outputTokens",ut),Ft(e,hC,it),Ft(e,"ai.response.avgOutputTokensPerSecond","ai.response.avgCompletionTokensPerSecond"),!Object.keys(e).some(n=>n.startsWith(mC))&&typeof e[it]=="number"&&typeof e[ro]=="number"&&(e[it]=e[it]+e[ro]),typeof e[it]=="number"){let n=typeof e[ut]=="number"?e[ut]:0;e[Dt]=n+e[it]}if(e[Ii]&&Array.isArray(e[Ii])&&(e[Ii]=IC(e[Ii])),e[id]){let n=e[od]?e[od]:e[id],r=rd.get(n)??n;e[ot]=r,delete e[id]}if(Ft(e,zo,Bt),b5(e),Ft(e,lC,"gen_ai.response.object"),Ft(e,Ii,"gen_ai.request.available_tools"),Ft(e,bC,_a),Ft(e,yC,ha),Ft(e,cC,"gen_ai.request.schema"),Ft(e,pl,De),Array.isArray(e[Vb])){let n=e[Vb].map(r=>{try{return JSON.parse(r)}catch{return r}});e[io]=n.length===1?n[0]:JSON.stringify(n)}I5(e);for(let n of Object.keys(e))Array.isArray(e[n])&&(e[n]=JSON.stringify(e[n])),n.startsWith("ai.")&&Ft(e,n,`vercel.${n}`)}function y5(e){let{data:t,origin:n}=e;n==="auto.vercelai.otel"&&(e.status&&e.status!=="ok"&&(e.status="internal_error"),vC(t))}function S5(e){let t=e.attributes;if(t?.[S]==="auto.vercelai.otel"){if(vC(t),t[B]==="gen_ai.execute_tool"&&e.parent_span_id){let n=nd.get(e.parent_span_id);if(n){let r=t[Vr];if(typeof r=="string"){let i=n.get(r);i&&(t[ba]=i)}}}nd.delete(e.span_id)}}function Ft(e,t,n){e[t]!=null&&(e[n]=e[t],delete e[t])}function E5(e,t){e.setAttribute(S,"auto.vercelai.otel"),e.setAttribute(B,"gen_ai.execute_tool"),e.setAttribute(ot,"execute_tool"),Ft(t,Zb,Vr),Ft(t,Xb,sl);let n=t[sl];typeof n=="string"&&ll.set(n,e.spanContext()),t[al]||e.setAttribute(al,"function");let r=t[Vr];r&&e.updateName(`execute_tool ${r}`)}function T5(e,t,n,r){e.setAttribute(S,"auto.vercelai.otel");let i=t.replace("ai.","");e.setAttribute("ai.pipeline.name",i),e.updateName(i);let o=n[fC];o&&typeof o=="string"&&e.setAttribute("gen_ai.function_id",o),AC(e,n,r),n[pl]&&!n[sn]&&e.setAttribute(sn,n[pl]),e.setAttribute("ai.streaming",t.includes("stream"));let s=rd.get(t);if(s?e.setAttribute(B,`gen_ai.${s}`):t.startsWith("ai.stream")&&e.setAttribute(B,"ai.run"),s==="invoke_agent"){o&&typeof o=="string"?e.updateName(`invoke_agent ${o}`):e.updateName("invoke_agent");return}let c=n[pl];c&&s&&e.updateName(`${s} ${c}`);let a=C();if(a&&rt(a)&&n[Ii]&&Array.isArray(n[Ii])){let l=new Map;for(let p of n[Ii])try{let u=typeof p=="string"?JSON.parse(p):p;u?.name&&u?.description&&l.set(u.name,u.description)}catch{}if(l.size>0){let p=oe(e).parent_span_id;p&&nd.set(p,l)}}}var NC=new WeakSet;function ad(e){NC.has(e)||(NC.add(e),e.on("spanStart",g5),e.addEventProcessor(Object.assign(_5,{id:"VercelAiEventProcessor"})),e.on("processSpan",t=>{S5(t)}))}function cd(e){let t={};if(!e||typeof e!="object")return t;let n=e,r=n.openai??n.azure;if(r&&(Pn(t,ro,r.cachedPromptTokens),Pn(t,"gen_ai.usage.output_tokens.reasoning",r.reasoningTokens),Pn(t,"gen_ai.usage.output_tokens.prediction_accepted",r.acceptedPredictionTokens),Pn(t,"gen_ai.usage.output_tokens.prediction_rejected",r.rejectedPredictionTokens),Pn(t,no,r.responseId)),n.anthropic){let o=n.anthropic.usage?.cache_read_input_tokens??n.anthropic.cacheReadInputTokens;Pn(t,ro,o);let s=n.anthropic.usage?.cache_creation_input_tokens??n.anthropic.cacheCreationInputTokens;Pn(t,Db,s)}n.bedrock?.usage&&(Pn(t,ro,n.bedrock.usage.cacheReadInputTokens),Pn(t,Db,n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Pn(t,ro,n.deepseek.promptCacheHitTokens),Pn(t,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens));let i=(n.google??n.vertex)?.usageMetadata;return i&&typeof i.thoughtsTokenCount=="number"&&i.thoughtsTokenCount>0&&(t[ut]=(i.candidatesTokenCount??0)+i.thoughtsTokenCount,Pn(t,Dt,i.totalTokenCount),Pn(t,"gen_ai.usage.reasoning.output_tokens",i.thoughtsTokenCount)),t}var ld=new Set([ut,Dt,"gen_ai.usage.reasoning.output_tokens"]);function I5(e){let t=e[uC];if(!t)return;let n=e[ot]==="invoke_agent";try{let r=cd(JSON.parse(t));for(let[i,o]of Object.entries(r))i===no&&e[i]||n&&ld.has(i)||(e[i]=o)}catch{}}function Pn(e,t,n){n!=null&&(e[t]=n)}var Yr="OpenAI",RC={"responses.create":{operation:"chat"},"chat.completions.create":{operation:"chat"},"embeddings.create":{operation:"embeddings"},"conversations.create":{operation:"chat"}},A5=["response.output_item.added","response.function_call_arguments.delta","response.function_call_arguments.done","response.output_item.done"],OC=["response.created","response.in_progress","response.failed","response.completed","response.incomplete","response.queued","response.output_text.delta",...A5];function CC(e){return e!==null&&typeof e=="object"&&"type"in e&&typeof e.type=="string"&&e.type.startsWith("response.")}function xC(e){return e!==null&&typeof e=="object"&&"object"in e&&e.object==="chat.completion.chunk"}function ul(e,t,n){if(!t||typeof t!="object")return;let r=t,i={};if(typeof r.id=="string"&&(i[eo]=r.id),typeof r.model=="string"&&(i[sn]=r.model),r.object==="conversation"&&typeof r.id=="string"&&(i[no]=r.id),r.usage&&typeof r.usage=="object"){let o=r.usage,s=o.prompt_tokens??o.input_tokens;typeof s=="number"&&(i[it]=s);let c=o.completion_tokens??o.output_tokens;typeof c=="number"&&(i[ut]=c),typeof o.total_tokens=="number"&&(i[Dt]=o.total_tokens)}if(Array.isArray(r.choices)){let o=r.choices,s=o.map(c=>c.finish_reason).filter(c=>typeof c=="string");if(s.length>0&&(i[Wr]=JSON.stringify(s)),n){let c=o.map(l=>l.message?.content||"");i[zt]=JSON.stringify(c);let a=o.map(l=>l.message?.tool_calls).filter(l=>Array.isArray(l)&&l.length>0).flat();a.length>0&&(i[bn]=JSON.stringify(a))}}if(typeof r.status=="string"&&(i[Wr]||(i[Wr]=JSON.stringify([r.status]))),n&&(typeof r.output_text=="string"&&!i[zt]&&(i[zt]=r.output_text),Array.isArray(r.output)&&r.output.length>0&&!i[bn])){let o=r.output.filter(s=>s?.type==="function_call");o.length>0&&(i[bn]=JSON.stringify(o))}e.setAttributes(i)}function N5(e){if("conversation"in e&&typeof e.conversation=="string")return e.conversation;if("previous_response_id"in e&&typeof e.previous_response_id=="string")return e.previous_response_id}function Jb(e){let t={[De]:e.model??"unknown"};"temperature"in e&&(t[Ji]=e.temperature),"top_p"in e&&(t[zi]=e.top_p),"frequency_penalty"in e&&(t[$i]=e.frequency_penalty),"presence_penalty"in e&&(t[ga]=e.presence_penalty),"stream"in e&&(t[ma]=e.stream),"encoding_format"in e&&(t[Ju]=e.encoding_format),"dimensions"in e&&(t[$u]=e.dimensions);let n=N5(e);return n&&(t[no]=n),t}function v5(e,t){for(let n of e){let r=n.index;if(!(r===void 0||!n.function))if(!(r in t.chatCompletionToolCalls))t.chatCompletionToolCalls[r]={...n,function:{name:n.function.name,arguments:n.function.arguments||""}};else{let i=t.chatCompletionToolCalls[r];n.function.arguments&&i?.function&&(i.function.arguments+=n.function.arguments)}}}function R5(e,t,n){t.responseId=e.id??t.responseId,t.responseModel=e.model??t.responseModel,e.usage&&(t.promptTokens=e.usage.prompt_tokens,t.completionTokens=e.usage.completion_tokens,t.totalTokens=e.usage.total_tokens);for(let r of e.choices??[])n&&(r.delta?.content&&t.responseTexts.push(r.delta.content),r.delta?.tool_calls&&v5(r.delta.tool_calls,t)),r.finish_reason&&t.finishReasons.push(r.finish_reason)}function O5(e,t,n,r){if(!(e&&typeof e=="object")){t.eventTypes.push("unknown:non-object");return}if(e instanceof Error){r.setStatus({code:2,message:"internal_error"}),me(e,{mechanism:{handled:!1,type:"auto.ai.openai.stream-response"}});return}if(!("type"in e))return;let i=e;if(!OC.includes(i.type)){t.eventTypes.push(i.type);return}if(n&&(i.type==="response.output_item.done"&&"item"in i&&t.responsesApiToolCalls.push(i.item),i.type==="response.output_text.delta"&&"delta"in i&&i.delta)){t.responseTexts.push(i.delta);return}if("response"in i){let{response:o}=i;t.responseId=o.id??t.responseId,t.responseModel=o.model??t.responseModel,o.usage&&(t.promptTokens=o.usage.input_tokens,t.completionTokens=o.usage.output_tokens,t.totalTokens=o.usage.total_tokens),o.status&&t.finishReasons.push(o.status),n&&o.output_text&&t.responseTexts.push(o.output_text)}}async function*dl(e,t,n){let r={eventTypes:[],responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,totalTokens:void 0,chatCompletionToolCalls:{},responsesApiToolCalls:[]};try{for await(let i of e)xC(i)?R5(i,r,n):CC(i)&&O5(i,r,n,t),yield i}finally{let i=[...Object.values(r.chatCompletionToolCalls),...r.responsesApiToolCalls];$o(t,{...r,toolCalls:i},n)}}function C5(e){let t=Array.isArray(e.tools)?e.tools:[],r=e.web_search_options&&typeof e.web_search_options=="object"?[{type:"web_search_options",...e.web_search_options}]:[],i=[...t,...r];if(i.length!==0)try{return JSON.stringify(i)}catch(o){E&&g.error("Failed to serialize OpenAI tools:",o);return}}function pd(e,t){let n={[Fr]:"openai",[ot]:t,[S]:"auto.ai.openai"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let r=e[0],i=C5(r);i&&(n[Vn]=i),Object.assign(n,Jb(r))}else n[De]="unknown";return n}function ml(e,t,n,r){if(n==="embeddings"&&"input"in t){let c=t.input;if(c==null||typeof c=="string"&&c.length===0||Array.isArray(c)&&c.length===0)return;e.setAttribute(io,typeof c=="string"?c:JSON.stringify(c));return}let i="input"in t?t.input:"messages"in t?t.messages:void 0;if(!i||Array.isArray(i)&&i.length===0)return;let{systemInstructions:o,filteredMessages:s}=xn(i);o&&e.setAttribute($t,o),e.setAttribute(Bt,r?Ht(s):Ge(s)),Array.isArray(s)?e.setAttribute(xt,s.length):e.setAttribute(xt,1)}function x5(e,t,n,r,i){return function(...s){let c=n.operation||"unknown",a=pd(s,c),l=a[De]||"unknown",p=s[0],u=p&&typeof p=="object"&&p.stream===!0,d={name:`${c} ${l}`,op:`gen_ai.${c}`,attributes:a};if(u){let h,b=ke(d,N=>(h=e.apply(r,s),i.recordInputs&&p&&ml(N,p,c,ze(i.enableTruncation)),(async()=>{try{let M=await h;return dl(M,N,i.recordOutputs??!1)}catch(M){throw N.setStatus({code:2,message:"internal_error"}),N.end(),M}})()));return ya(h,b)}let m,_=Se(d,h=>(m=e.apply(r,s),i.recordInputs&&p&&ml(h,p,c,ze(i.enableTruncation)),m.then(b=>(ul(h,b,i.recordOutputs),b))));return ya(m,_)}}function PC(e,t="",n){return new Proxy(e,{get(r,i){let o=r[i],s=td(t,String(i)),c=RC[s];return typeof o=="function"&&c?x5(o,s,c,r,n):typeof o=="function"?o.bind(r):o&&typeof o=="object"?PC(o,s,n):o}})}function ud(e,t){return PC(e,"",Ze(t))}var jr="Anthropic_AI",$b={"messages.create":{operation:"chat"},"messages.stream":{operation:"chat",streaming:!0},"messages.countTokens":{operation:"chat"},"models.get":{operation:"models"},"completions.create":{operation:"chat"},"models.retrieve":{operation:"models"},"beta.messages.create":{operation:"chat"}};function kC(e,t,n){if(Array.isArray(t)&&t.length===0)return;let{systemInstructions:r,filteredMessages:i}=xn(t);r&&e.setAttributes({[$t]:r});let o=Array.isArray(i)?i.length:1;e.setAttributes({[Bt]:n?Ht(i):Ge(i),[xt]:o})}var P5={invalid_request_error:"invalid_argument",authentication_error:"unauthenticated",permission_error:"permission_denied",not_found_error:"not_found",request_too_large:"failed_precondition",rate_limit_error:"resource_exhausted",api_error:"internal_error",overloaded_error:"unavailable"};function zb(e){return e&&P5[e]||"internal_error"}function LC(e,t){t.error&&(e.setStatus({code:2,message:zb(t.error.type)}),me(t.error,{mechanism:{handled:!1,type:"auto.ai.anthropic.anthropic_error"}}))}function MC(e){let{system:t,messages:n,input:r}=e,i=typeof t=="string"?[{role:"system",content:e.system}]:[],o=Array.isArray(r)?r:r!=null?[r]:void 0,s=Array.isArray(n)?n:n!=null?[n]:[],c=o??s;return[...i,...c]}function k5(e,t){return"type"in e&&typeof e.type=="string"&&e.type==="error"?(t.setStatus({code:2,message:zb(e.error?.type)}),!0):!1}function L5(e,t){if(e.type==="message_delta"&&(e.usage&&typeof e.usage.output_tokens=="number"&&(t.completionTokens=e.usage.output_tokens),e.delta?.stop_reason&&t.finishReasons.push(e.delta.stop_reason)),e.message){let n=e.message;n.id&&(t.responseId=n.id),n.model&&(t.responseModel=n.model),n.usage&&(typeof n.usage.input_tokens=="number"&&(t.promptTokens=n.usage.input_tokens),typeof n.usage.cache_creation_input_tokens=="number"&&(t.cacheCreationInputTokens=n.usage.cache_creation_input_tokens),typeof n.usage.cache_read_input_tokens=="number"&&(t.cacheReadInputTokens=n.usage.cache_read_input_tokens))}}function M5(e,t){e.type!=="content_block_start"||typeof e.index!="number"||!e.content_block||(e.content_block.type==="tool_use"||e.content_block.type==="server_tool_use")&&(t.activeToolBlocks[e.index]={id:e.content_block.id,name:e.content_block.name,inputJsonParts:[]})}function w5(e,t,n){if(!(e.type!=="content_block_delta"||!e.delta)){if(typeof e.index=="number"&&"partial_json"in e.delta&&typeof e.delta.partial_json=="string"){let r=t.activeToolBlocks[e.index];r&&r.inputJsonParts.push(e.delta.partial_json)}n&&typeof e.delta.text=="string"&&t.responseTexts.push(e.delta.text)}}function G5(e,t){if(e.type!=="content_block_stop"||typeof e.index!="number")return;let n=t.activeToolBlocks[e.index];if(!n)return;let r=n.inputJsonParts.join(""),i;try{i=r?JSON.parse(r):{}}catch{i={__unparsed:r}}t.toolCalls.push({type:"tool_use",id:n.id,name:n.name,input:i}),delete t.activeToolBlocks[e.index]}function wC(e,t,n,r){!(e&&typeof e=="object")||k5(e,r)||(L5(e,t),M5(e,t),w5(e,t,n),G5(e,t))}async function*fl(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};try{for await(let i of e)wC(i,r,n,t),yield i}finally{$o(t,r,n)}}function gl(e,t,n){let r={responseTexts:[],finishReasons:[],responseId:"",responseModel:"",promptTokens:void 0,completionTokens:void 0,cacheCreationInputTokens:void 0,cacheReadInputTokens:void 0,toolCalls:[],activeToolBlocks:{}};return e.on("streamEvent",i=>{wC(i,r,n,t)}),e.on("message",()=>{$o(t,r,n)}),e.on("error",i=>{me(i,{mechanism:{handled:!1,type:"auto.ai.anthropic.stream_error"}}),t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end())}),e}var dd=!1,GC=new WeakSet;function md(e,t,n){let r={[Fr]:"anthropic",[ot]:n,[S]:"auto.ai.anthropic"};if(e.length>0&&typeof e[0]=="object"&&e[0]!==null){let i=e[0];i.tools&&Array.isArray(i.tools)&&(r[Vn]=JSON.stringify(i.tools)),r[De]=i.model??"unknown","temperature"in i&&(r[Ji]=i.temperature),"top_p"in i&&(r[zi]=i.top_p),"stream"in i&&(r[ma]=i.stream),"top_k"in i&&(r[Qu]=i.top_k),"frequency_penalty"in i&&(r[$i]=i.frequency_penalty),"max_tokens"in i&&(r[fa]=i.max_tokens)}else t==="models.retrieve"||t==="models.get"?r[De]=e[0]:r[De]="unknown";return r}function Sa(e,t,n){let r=MC(t);kC(e,r,n),"prompt"in t&&e.setAttributes({[WO]:JSON.stringify(t.prompt)})}function U5(e,t){if("content"in t&&Array.isArray(t.content)){e.setAttributes({[zt]:t.content.map(r=>r.text).filter(r=>!!r).join("")});let n=[];for(let r of t.content)(r.type==="tool_use"||r.type==="server_tool_use")&&n.push(r);n.length>0&&e.setAttributes({[bn]:JSON.stringify(n)})}"completion"in t&&e.setAttributes({[zt]:t.completion}),"input_tokens"in t&&e.setAttributes({[zt]:JSON.stringify(t.input_tokens)})}function D5(e,t){"id"in t&&"model"in t&&(e.setAttributes({[eo]:t.id,[sn]:t.model}),"usage"in t&&t.usage&&sC(e,t.usage.input_tokens,t.usage.output_tokens,t.usage.cache_creation_input_tokens,t.usage.cache_read_input_tokens))}function fd(e,t,n){if(!(!t||typeof t!="object")){if("type"in t&&t.type==="error"){LC(e,t);return}n&&U5(e,t),D5(e,t)}}function UC(e,t){throw t.isRecording()&&(t.setStatus({code:2,message:"internal_error"}),t.end()),e}function B5(e,t,n,r,i,o,s,c,a,l){let p=r[De]??"unknown",u={name:`${i} ${p}`,op:`gen_ai.${i}`,attributes:r};if(a&&!l){let d,m=ke(u,_=>(d=e.apply(t,n),c.recordInputs&&s&&Sa(_,s,ze(c.enableTruncation)),(async()=>{try{let h=await d;return fl(h,_,c.recordOutputs??!1)}catch(h){return UC(h,_)}})()));return ya(d,m)}else return ke(u,d=>{try{c.recordInputs&&s&&Sa(d,s,ze(c.enableTruncation)),dd=!0;let m=e.apply(t,n);return dd=!1,gl(m,d,c.recordOutputs??!1)}catch(m){return dd=!1,UC(m,d)}})}function H5(e,t,n,r,i){return new Proxy(e,{apply(o,s,c){let a=s!==void 0?s:r,l=n.streaming===!0;if(!l&&dd)return o.apply(a,c);let p=n.operation||"unknown",u=md(c,t,p),d=u[De]??"unknown",m=typeof c[0]=="object"?c[0]:void 0,_=!!m?.stream;if(_||l)return B5(o,a,c,u,p,t,m,i,_,l);let h,b=Se({name:`${p} ${d}`,op:`gen_ai.${p}`,attributes:u},N=>(h=o.apply(a,c),i.recordInputs&&m&&Sa(N,m,ze(i.enableTruncation)),h.then(M=>(fd(N,M,i.recordOutputs),M))));return ya(h,b)}})}function F5(e,t){for(let n of Object.keys($b)){let r=n.split("."),i=r.pop(),o=e;for(let a of r)o=o?.[a];if(!o||typeof o[i]!="function")continue;let s=o[i];if(GC.has(s))continue;let c=H5(s,n,$b[n],o,t);GC.add(c),o[i]=c}return e}function gd(e,t){return F5(e,Ze(t))}var Zr="Google_GenAI",DC={"models.generateContent":{operation:"generate_content"},"models.generateContentStream":{operation:"generate_content",streaming:!0},"models.embedContent":{operation:"embeddings"},"chats.create":{proxyResultPath:"chat"},"chat.sendMessage":{operation:"chat"},"chat.sendMessageStream":{operation:"chat",streaming:!0}},BC="google_genai";function W5(e,t){let n=e?.promptFeedback;if(n?.blockReason){let r=n.blockReasonMessage??n.blockReason;return t.setStatus({code:2,message:"internal_error"}),me(`Content blocked: ${r}`,{mechanism:{handled:!1,type:"auto.ai.google_genai"}}),!0}return!1}function V5(e,t){typeof e.responseId=="string"&&(t.responseId=e.responseId),typeof e.modelVersion=="string"&&(t.responseModel=e.modelVersion);let n=e.usageMetadata;n&&(typeof n.promptTokenCount=="number"&&(t.promptTokens=n.promptTokenCount),typeof n.candidatesTokenCount=="number"&&(t.completionTokens=n.candidatesTokenCount),typeof n.totalTokenCount=="number"&&(t.totalTokens=n.totalTokenCount))}function Y5(e,t,n){Array.isArray(e.functionCalls)&&t.toolCalls.push(...e.functionCalls);for(let r of e.candidates??[]){r?.finishReason&&!t.finishReasons.includes(r.finishReason)&&t.finishReasons.push(r.finishReason);for(let i of r?.content?.parts??[])n&&i.text&&t.responseTexts.push(i.text),i.functionCall&&t.toolCalls.push({type:"function",id:i.functionCall.id,name:i.functionCall.name,arguments:i.functionCall.args})}}function j5(e,t,n,r){!e||W5(e,r)||(V5(e,t),Y5(e,t,n))}async function*_l(e,t,n){let r={responseTexts:[],finishReasons:[],toolCalls:[]};try{for await(let i of e)j5(i,r,n,t),yield i}finally{$o(t,r,n)}}function Ea(e,t="user"){return typeof e=="string"?[{role:t,content:e}]:Array.isArray(e)?e.flatMap(n=>Ea(n,t)):typeof e!="object"||!e?[]:"role"in e&&typeof e.role=="string"?[e]:"parts"in e?[{...e,role:t}]:[{role:t,content:e}]}function HC(e,t){if("model"in e&&typeof e.model=="string")return e.model;if(t&&typeof t=="object"){let n=t;if("model"in n&&typeof n.model=="string")return n.model;if("modelVersion"in n&&typeof n.modelVersion=="string")return n.modelVersion}return"unknown"}function Z5(e){let t={};return"temperature"in e&&typeof e.temperature=="number"&&(t[Ji]=e.temperature),"topP"in e&&typeof e.topP=="number"&&(t[zi]=e.topP),"topK"in e&&typeof e.topK=="number"&&(t[Qu]=e.topK),"maxOutputTokens"in e&&typeof e.maxOutputTokens=="number"&&(t[fa]=e.maxOutputTokens),"frequencyPenalty"in e&&typeof e.frequencyPenalty=="number"&&(t[$i]=e.frequencyPenalty),"presencePenalty"in e&&typeof e.presencePenalty=="number"&&(t[ga]=e.presencePenalty),t}function _d(e,t,n){let r={[Fr]:BC,[ot]:e,[S]:"auto.ai.google_genai"};if(t){if(r[De]=HC(t,n),"config"in t&&typeof t.config=="object"&&t.config){let i=t.config;if(Object.assign(r,Z5(i)),"tools"in i&&Array.isArray(i.tools)){let o=i.tools.flatMap(s=>s.functionDeclarations);r[Vn]=JSON.stringify(o)}}}else r[De]=HC({},n);return r}function hl(e,t,n,r){if(n==="embeddings"){let o=t.contents;o!=null&&e.setAttribute(io,typeof o=="string"?o:JSON.stringify(o));return}let i=[];if("config"in t&&t.config&&typeof t.config=="object"&&"systemInstruction"in t.config&&t.config.systemInstruction&&i.push(...Ea(t.config.systemInstruction,"system")),"history"in t&&i.push(...Ea(t.history,"user")),"contents"in t&&i.push(...Ea(t.contents,"user")),"message"in t&&i.push(...Ea(t.message,"user")),Array.isArray(i)&&i.length){let{systemInstructions:o,filteredMessages:s}=xn(i);o&&e.setAttribute($t,o);let c=Array.isArray(s)?s.length:0;e.setAttributes({[xt]:c,[Bt]:r?Ht(s):Ge(s)})}}function hd(e,t,n){if(!(!t||typeof t!="object")){if(t.modelVersion&&e.setAttribute(sn,t.modelVersion),t.usageMetadata&&typeof t.usageMetadata=="object"){let r=t.usageMetadata;typeof r.promptTokenCount=="number"&&e.setAttributes({[it]:r.promptTokenCount}),typeof r.candidatesTokenCount=="number"&&e.setAttributes({[ut]:r.candidatesTokenCount}),typeof r.totalTokenCount=="number"&&e.setAttributes({[Dt]:r.totalTokenCount})}if(n&&Array.isArray(t.candidates)&&t.candidates.length>0){let r=t.candidates.map(i=>i.content?.parts&&Array.isArray(i.content.parts)?i.content.parts.map(o=>typeof o.text=="string"?o.text:"").filter(o=>o.length>0).join(""):"").filter(i=>i.length>0);r.length>0&&e.setAttributes({[zt]:r.join("")})}if(n&&t.functionCalls){let r=t.functionCalls;Array.isArray(r)&&r.length>0&&e.setAttributes({[bn]:JSON.stringify(r)})}}}function X5(e,t,n,r,i){let o=n.operation==="embeddings";return new Proxy(e,{apply(s,c,a){let l=n.operation||"unknown",p=a[0],u=_d(l,p,r),d=u[De]??"unknown";return n.streaming?ke({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u},async m=>{try{i.recordInputs&&p&&hl(m,p,l,ze(i.enableTruncation));let _=await s.apply(r,a);return _l(_,m,!!i.recordOutputs)}catch(_){throw m.setStatus({code:2,message:"internal_error"}),m.end(),_}}):Se({name:`${l} ${d}`,op:`gen_ai.${l}`,attributes:u},m=>(i.recordInputs&&p&&hl(m,p,l,ze(i.enableTruncation)),sr(()=>s.apply(r,a),()=>{},()=>{},_=>{o||hd(m,_,i.recordOutputs)})))}})}function ey(e,t="",n){return new Proxy(e,{get:(r,i,o)=>{let s=Reflect.get(r,i,o),c=td(t,String(i)),a=DC[c];if(typeof s=="function"&&a){let l=a.operation?X5(s,c,a,r,n):s.bind(r);return a.proxyResultPath?function(...p){let u=l(...p);return u&&typeof u=="object"?ey(u,a.proxyResultPath,n):u}:l}return typeof s=="function"?s.bind(r):s&&typeof s=="object"?ey(s,c,n):s}})}function bd(e,t){return ey(e,"",Ze(t))}var Ta="LangChain",Ia="auto.ai.langchain",FC={human:"user",ai:"assistant",assistant:"assistant",system:"system",function:"function",tool:"tool"};var Yn=(e,t,n)=>{n!=null&&(e[t]=n)},kn=(e,t,n)=>{let r=Number(n);Number.isNaN(r)||(e[t]=r)};function Aa(e){if(Array.isArray(e))try{let t=e.map(n=>n&&typeof n=="object"&&oo(n)?Jo(n):n);return JSON.stringify(t)}catch{return String(e)}return Ge(e,String)}function bl(e){let t=e.toLowerCase();return FC[t]??t}function WC(e){return e.includes("System")?"system":e.includes("Human")?"user":e.includes("AI")||e.includes("Assistant")?"assistant":e.includes("Function")?"function":e.includes("Tool")?"tool":"user"}function ty(e){if(!(!e||Array.isArray(e)))return e.invocation_params}function yl(e){return e.map(t=>{let n=t._getType;if(typeof n=="function"){let i=n.call(t);return{role:bl(i),content:Aa(t.content)}}if(t.lc===1&&t.kwargs){let i=t.id,o=Array.isArray(i)&&i.length>0?i[i.length-1]:"",s=typeof o=="string"?WC(o):"user";return{role:bl(s),content:Aa(t.kwargs?.content)}}if(t.type){let i=String(t.type).toLowerCase();return{role:bl(i),content:Aa(t.content)}}if(t.role)return{role:bl(String(t.role)),content:Aa(t.content)};let r=t.constructor?.name;return r&&r!=="Object"?{role:bl(WC(r)),content:Aa(t.content)}:{role:"user",content:Aa(t.content)}})}function K5(e,t,n){let r={},i="kwargs"in e?e.kwargs:void 0,o=t?.temperature??n?.ls_temperature??i?.temperature;kn(r,Ji,o);let s=t?.max_tokens??n?.ls_max_tokens??i?.max_tokens;kn(r,fa,s);let c=t?.top_p??i?.top_p;kn(r,zi,c);let a=t?.frequency_penalty;kn(r,$i,a);let l=t?.presence_penalty;return kn(r,ga,l),t&&"stream"in t&&Yn(r,ma,!!t.stream),r}function YC(e,t,n,r,i){return{[Fr]:Ge(e??"langchain",String),[ot]:"chat",[De]:Ge(t,String),[S]:Ia,...K5(n,r,i)}}function jC(e,t,n,r,i,o){let s=o?.ls_provider,c=i?.model??o?.ls_model_name??"unknown",a=YC(s,c,e,i,o);if(n&&Array.isArray(t)&&t.length>0){Yn(a,xt,t.length);let l=t.map(p=>({role:"user",content:p}));Yn(a,Bt,r?Ht(l):Ge(l))}return a}function ZC(e,t,n,r,i,o){let s=o?.ls_provider??e.id?.[2],c=i?.model??o?.ls_model_name??"unknown",a=YC(s,c,e,i,o);if(n&&Array.isArray(t)&&t.length>0){let l=yl(t.flat()),{systemInstructions:p,filteredMessages:u}=xn(l);p&&Yn(a,$t,p);let d=Array.isArray(u)?u.length:0;Yn(a,xt,d),Yn(a,Bt,r?Ht(u):Ge(u))}return a}function q5(e,t){let n=[],r=e.flat();for(let i of r){let s=i.message?.tool_calls;if(Array.isArray(s)&&s.length>0)n.push(...s);else{let c=i.message?.content;if(Array.isArray(c))for(let a of c){let l=a;l.type==="tool_use"&&n.push(l)}}}n.length>0&&Yn(t,bn,Ge(n,String))}function Q5(e,t){if(!e)return;let n=e.tokenUsage,r=e.usage;if(n)kn(t,it,n.promptTokens),kn(t,ut,n.completionTokens),kn(t,Dt,n.totalTokens);else if(r){kn(t,it,r.input_tokens),kn(t,ut,r.output_tokens);let i=Number(r.input_tokens),o=Number(r.output_tokens),s=(Number.isNaN(i)?0:i)+(Number.isNaN(o)?0:o);s>0&&kn(t,Dt,s),r.cache_creation_input_tokens!==void 0&&kn(t,XO,r.cache_creation_input_tokens),r.cache_read_input_tokens!==void 0&&kn(t,KO,r.cache_read_input_tokens)}}function XC(e,t){if(!e)return;let n={};if(Array.isArray(e.generations)){let l=e.generations.flat().map(p=>p.generationInfo?.finish_reason?p.generationInfo.finish_reason:p.generation_info?.finish_reason?p.generation_info.finish_reason:null).filter(p=>typeof p=="string");if(l.length>0&&Yn(n,Wr,Ge(l,String)),q5(e.generations,n),t){let p=e.generations.flat().map(u=>u.text??u.message?.content).filter(u=>typeof u=="string");p.length>0&&Yn(n,zt,Ge(p,String))}}Q5(e.llmOutput,n);let r=e.llmOutput,o=e.generations?.[0]?.[0]?.message,s=r?.model_name??r?.model??o?.response_metadata?.model_name;s&&Yn(n,sn,s);let c=r?.id??o?.id;c&&Yn(n,eo,c);let a=r?.stop_reason??o?.response_metadata?.finish_reason;return a&&Yn(n,VO,Ge(a,String)),n}function yd(e){let t={},n=e?.lc_agent_name;return typeof n=="string"&&(t[to]=n),t}function KC(e){let t=e?.invocation_params?.tools??e?.options?.tools;if(!Array.isArray(t)||t.length===0)return;let n=t.map(r=>{let i=r.function;return{type:"function",name:r.name??i?.name??"",description:r.description??i?.description}});return JSON.stringify(n)}function J5(e){if(!e||typeof e!="object")return!1;let t=e;return typeof t.addHandler=="function"&&typeof t.copy=="function"}function $5(e){return typeof e=="object"&&e?.name==="SentryCallbackHandler"}function VC(e){return e.some($5)}function es(e,t){if(!e)return[t];if(J5(e)){if(VC(e.handlers??[]))return e;let r=e.copy();return r.addHandler(t,!0),r}let n=Array.isArray(e)?e:[e];return VC(n)?e:[...n,t]}function mr(e={}){let{recordInputs:t,recordOutputs:n}=Ze(e),r=ze(e.enableTruncation),i=new Map,o=c=>{let a=i.get(c);a?.isRecording()&&(a.end(),i.delete(c))},s={lc_serializable:!1,lc_namespace:["langchain_core","callbacks","sentry"],lc_secrets:void 0,lc_attributes:void 0,lc_aliases:void 0,lc_serializable_keys:void 0,lc_id:["langchain_core","callbacks","sentry"],lc_kwargs:{},name:"SentryCallbackHandler",ignoreLLM:!1,ignoreChain:!1,ignoreAgent:!1,ignoreRetriever:!1,ignoreCustomEvent:!1,raiseError:!1,awaitHandlers:!0,handleLLMStart(c,a,l,p,u,d,m,_){let h=ty(d),b=jC(c,a,t,r,h,m),N=b[De],M=b[ot];ke({name:`${M} ${N}`,op:"gen_ai.chat",attributes:{...yd(m),...b,[B]:"gen_ai.chat"}},R=>(i.set(l,R),R))},handleChatModelStart(c,a,l,p,u,d,m,_){let h=ty(d),b=ZC(c,a,t,r,h,m),N=KC(u);N&&(b[Vn]=N);let M=b[De],R=b[ot];ke({name:`${R} ${M}`,op:"gen_ai.chat",attributes:{...yd(m),...b,[B]:"gen_ai.chat"}},v=>(i.set(l,v),v))},handleLLMEnd(c,a,l,p,u){let d=i.get(a);if(d?.isRecording()){let m=XC(c,n);m&&d.setAttributes(m),o(a)}},handleLLMError(c,a){let l=i.get(a);l?.isRecording()&&(l.setStatus({code:2,message:"internal_error"}),o(a))},handleChainStart(c,a,l,p,u,d,m,_){if(d?.__sentry_langgraph__)return;let h=_||c.name||"unknown_chain",b={[S]:"auto.ai.langchain","langchain.chain.name":h};t&&(b["langchain.chain.inputs"]=JSON.stringify(a)),ke({name:`chain ${h}`,op:"gen_ai.invoke_agent",attributes:{...b,[B]:"gen_ai.invoke_agent"}},N=>(i.set(l,N),N))},handleChainEnd(c,a){let l=i.get(a);l?.isRecording()&&(n&&l.setAttributes({"langchain.chain.outputs":JSON.stringify(c)}),o(a))},handleChainError(c,a){let l=i.get(a);l?.isRecording()&&(l.setStatus({code:2,message:"internal_error"}),o(a))},handleToolStart(c,a,l,p,u,d,m){if(d?.__sentry_langgraph__)return;let _=m||c.name||"unknown_tool",h={...yd(d),[S]:Ia,[ot]:"execute_tool",[Vr]:_};t&&(h[_a]=a),ke({name:`execute_tool ${_}`,op:"gen_ai.execute_tool",attributes:{...h,[B]:"gen_ai.execute_tool"}},b=>(i.set(l,b),b))},handleToolEnd(c,a){let l=i.get(a);if(l?.isRecording()){if(n){let p=c,u=p&&typeof p=="object"&&"content"in p?p.content:c;l.setAttributes({[ha]:typeof u=="string"?u:JSON.stringify(u)})}o(a)}},handleToolError(c,a){let l=i.get(a);l?.isRecording()&&(l.setStatus({code:2,message:"internal_error"}),o(a))},copy(){return s},toJSON(){return{lc:1,type:"not_implemented",id:s.lc_id}},toJSONNotImplemented(){return{lc:1,type:"not_implemented",id:s.lc_id}}};return s}function z5(e){let t=e.constructor?.name??"";return t.includes("OpenAI")?"openai":t.includes("Google")?"google_genai":t.includes("Mistral")?"mistralai":t.includes("Vertex")?"google_vertexai":t.includes("Bedrock")?"aws_bedrock":t.includes("Ollama")?"ollama":t.includes("Cloudflare")?"cloudflare":t.includes("Cohere")?"cohere":"langchain"}function e3(e){let t=e??{},n={[S]:Ia,[B]:Bb,[ot]:"embeddings",[De]:t.model??"unknown"};return n[Fr]=z5(t),"dimensions"in t&&(n[$u]=t.dimensions),"encodingFormat"in t&&(n[Ju]=t.encodingFormat),n}function Sd(e,t,n={}){let{recordInputs:r}=Ze(n),i=e3(e),o=i[De]||"unknown";return r&&t!=null&&(i[io]=typeof t=="string"?t:JSON.stringify(t)),{name:`embeddings ${o}`,op:Bb,attributes:i}}function qC(e,t={}){return new Proxy(e,{apply(n,r,i){return Se(Sd(r,i[0],t),()=>Reflect.apply(n,r,i))}})}function Ed(e,t){let n=e;return typeof n.embedQuery=="function"&&(n.embedQuery=qC(n.embedQuery,t)),typeof n.embedDocuments=="function"&&(n.embedDocuments=qC(n.embedDocuments,t)),e}var Na="LangGraph",Sl="auto.ai.langgraph";function El(e){let t=e[0];if(typeof t!="object"||!t||!("llm"in t)||!t.llm||typeof t.llm!="object")return null;let n=t.llm;return typeof n.modelName!="string"&&typeof n.model!="string"?null:n}function va(e){let t=e[0];return typeof t=="object"&&t&&"name"in t&&typeof t.name=="string"?t.name:null}function Tl(e,t,n){let r="__sentry_tool_wrapped__";for(let i of e){if(!i||typeof i!="object")continue;let o=i,s=o.invoke;if(typeof s!="function"||Object.prototype.hasOwnProperty.call(o,r))continue;let c=typeof o.name=="string"?o.name:"unknown_tool",a=typeof o.description=="string"?o.description:void 0,l=new Proxy(s,{apply(p,u,d){let m={[S]:Sl,[B]:Hb,[ot]:"execute_tool",[Vr]:c,[al]:"function"},h=d[1]?.metadata?.lc_agent_name??n;typeof h=="string"&&(m[to]=h),a&&(m[ba]=a);let b=d[0];if(typeof b=="object"&&b&&("id"in b&&typeof b.id=="string"&&(m[sl]=b.id),t.recordInputs)){let N="args"in b&&typeof b.args=="object"?b.args:b;try{m[_a]=JSON.stringify(N)}catch{}}return Se({op:Hb,name:`execute_tool ${c}`,attributes:m},async N=>{try{let M=await Reflect.apply(p,u,d);if(t.recordOutputs)try{let R=M,v=R&&typeof R=="object"&&"content"in R?R.content:M;N.setAttribute(ha,typeof v=="string"?v:JSON.stringify(v))}catch{}return M}catch(M){throw N.setStatus({code:2,message:"internal_error"}),M}})}});o.invoke=l,Object.defineProperty(o,r,{value:!0,enumerable:!1})}return e}function t3(e){if(!e||e.length===0)return null;let t=[];for(let n of e)if(n&&typeof n=="object"){let r=n.tool_calls;r&&Array.isArray(r)&&t.push(...r)}return t.length>0?t:null}function n3(e){let t=e,n=0,r=0,i=0;if(t.usage_metadata&&typeof t.usage_metadata=="object"){let o=t.usage_metadata;return typeof o.input_tokens=="number"&&(n=o.input_tokens),typeof o.output_tokens=="number"&&(r=o.output_tokens),typeof o.total_tokens=="number"&&(i=o.total_tokens),{inputTokens:n,outputTokens:r,totalTokens:i}}if(t.response_metadata&&typeof t.response_metadata=="object"){let o=t.response_metadata;if(o.tokenUsage&&typeof o.tokenUsage=="object"){let s=o.tokenUsage;typeof s.promptTokens=="number"&&(n=s.promptTokens),typeof s.completionTokens=="number"&&(r=s.completionTokens),typeof s.totalTokens=="number"&&(i=s.totalTokens)}}return{inputTokens:n,outputTokens:r,totalTokens:i}}function r3(e,t){let n=t;if(n.response_metadata&&typeof n.response_metadata=="object"){let r=n.response_metadata;r.model_name&&typeof r.model_name=="string"&&e.setAttribute(sn,r.model_name),r.finish_reason&&typeof r.finish_reason=="string"&&e.setAttribute(Wr,[r.finish_reason])}}function QC(e){if(!e.builder?.nodes?.tools?.runnable?.tools)return null;let t=e.builder?.nodes?.tools?.runnable?.tools;return!t||!Array.isArray(t)||t.length===0?null:t.map(n=>({name:n.lc_kwargs?.name,description:n.lc_kwargs?.description,schema:n.lc_kwargs?.schema}))}function JC(e,t,n){let i=n?.messages;if(!i||!Array.isArray(i))return;let o=t?.length??0,s=i.length>o?i.slice(o):[];if(s.length===0)return;let c=t3(s);c&&e.setAttribute(bn,JSON.stringify(c));let a=yl(s);e.setAttribute(zt,JSON.stringify(a));let l=0,p=0,u=0;for(let d of s){let m=n3(d);l+=m.inputTokens,p+=m.outputTokens,u+=m.totalTokens,r3(e,d)}l>0&&e.setAttribute(it,l),p>0&&e.setAttribute(ut,p),u>0&&e.setAttribute(Dt,u)}var ny=!1,Td="__sentry_patched__";function Id(e){let t={[S]:Sl,[B]:"gen_ai.create_agent",[ot]:"create_agent"};return e&&(t[to]=e),{op:"gen_ai.create_agent",name:e?`create_agent ${e}`:"create_agent",attributes:t}}function ry(e,t){if(Object.prototype.hasOwnProperty.call(e,Td))return e;let n=mr(t),r=new Proxy(e,{apply(i,o,s){return ny?Reflect.apply(i,o,s):Se(Id(),c=>{try{let a=Reflect.apply(i,o,s),l=s.length>0?s[0]:{};l?.name&&typeof l.name=="string"&&(c.setAttribute(to,l.name),c.updateName(`create_agent ${l.name}`));let p=a.invoke;return p&&typeof p=="function"&&(a.invoke=Il(p.bind(a),a,l,t,void 0,n)),a}catch(a){throw c.setStatus({code:2,message:"internal_error"}),a}})}});return Object.defineProperty(r,Td,{value:!0,enumerable:!1}),r}function Il(e,t,n,r,i,o){return new Proxy(e,{apply(s,c,a){let l=i?.modelName??i?.model;return Se({op:"gen_ai.invoke_agent",name:"invoke_agent",attributes:{[S]:Sl,[B]:qO,[ot]:"invoke_agent"}},async p=>{try{let u=n?.name;u&&typeof u=="string"&&(p.setAttribute(ZO,u),p.setAttribute(to,u),p.updateName(`invoke_agent ${u}`)),l&&p.setAttribute(De,l);let _=(a.length>1?a[1]:void 0)?.configurable?.thread_id;if(_&&typeof _=="string"&&p.setAttribute(no,_),o){let v=a[1]??{};a[1]=v;let P=v.metadata??{};v.metadata={...P,__sentry_langgraph__:!0,...typeof u=="string"?{lc_agent_name:u}:{}},v.callbacks=es(v.callbacks,o)}let h=QC(t);h&&p.setAttribute(Vn,JSON.stringify(h));let b=r.recordInputs,N=r.recordOutputs,M=a.length>0?a[0]?.messages??[]:[];if(M&&b){let v=yl(M),{systemInstructions:P,filteredMessages:D}=xn(v);P&&p.setAttribute($t,P);let I=ze(r.enableTruncation),H=Array.isArray(D)?D.length:0;p.setAttributes({[Bt]:I?Ht(D):Ge(D),[xt]:H})}let R=await Reflect.apply(s,c,a);return N&&JC(p,M??null,R),R}catch(u){throw p.setStatus({code:2,message:"internal_error"}),u}})}})}function iy(e,t){if(Object.prototype.hasOwnProperty.call(e,Td))return e;let n=Ze(t),r=mr(n),i=new Proxy(e,{apply(o,s,c){let a=El(c),l=va(c),p=c[0];p&&Array.isArray(p.tools)&&p.tools.length>0&&Tl(p.tools,n,l??void 0),ny=!0;let u;try{u=Reflect.apply(o,s,c)}finally{ny=!1}let d=u.invoke;if(d&&typeof d=="function"){let m={};l&&(m.name=l),u.invoke=Il(d.bind(u),u,m,n,a,r)}return u}});return Object.defineProperty(i,Td,{value:!0,enumerable:!1}),i}function Al(e,t){return e.compile=ry(e.compile,Ze(t)),e}var $C=Al;function zC(e,t,n){let r=n.getOptions(),i=n.getDsn(),o=r.tunnel,s=Ys(r._metadata),c={sent_at:new Date(tt()).toISOString(),...i3(t)&&{trace:t},...s&&{sdk:s},...!!o&&i&&{dsn:rn(i)}},a=n.getDataCollectionOptions().userInfo?"auto":"never",l=[{type:"span",item_count:e.length,content_type:"application/vnd.sentry.items.span.v2+json"},{version:2,...It()&&{ingest_settings:{infer_ip:a,infer_user_agent:a}},items:e}];return Lt(c,[l])}function i3(e){return!!e.trace_id&&!!e.public_key}function ex(e){let t=156;if(t+=e.name.length*2,t+=P_(e.attributes),e.links&&e.links.length>0){let r=e.links[0]?.attributes,i=100+(r?P_(r):0);t+=i*e.links.length}return t}var tx=1e3,o3=5e6,Ad=class{constructor(t,n){this._traceBuckets=new Map,this._client=t;let{maxSpanLimit:r,flushInterval:i,maxTraceWeightInBytes:o}=n??{};this._maxSpanLimit=r&&r>0&&r<=tx?r:tx,this._flushInterval=i&&i>0?i:5e3,this._maxTraceWeight=o&&o>0?o:o3,this._client.on("flush",()=>{this.drain()}),this._client.on("close",()=>{this._traceBuckets.forEach(s=>{clearTimeout(s.timeout)}),this._traceBuckets.clear()})}add(t){let n=t.trace_id,r=this._traceBuckets.get(n);r||(r={spans:new Set,size:0,timeout:On(setTimeout(()=>{this.flush(n)},this._flushInterval))},this._traceBuckets.set(n,r)),r.spans.add(t),r.size+=ex(t),(r.spans.size>=this._maxSpanLimit||r.size>=this._maxTraceWeight)&&this.flush(n)}drain(){this._traceBuckets.size&&(E&&g.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),i=r[0]?._segmentSpan;if(!i){E&&g.warn("No segment span reference found on span JSON, cannot compute DSC"),this._removeTrace(t);return}let o=nt(i),s=r.map(a=>{let{_segmentSpan:l,...p}=a;return p}),c=zC(s,o,this._client);E&&g.log(`Sending span envelope for trace ${t} with ${s.length} spans`),this._client.sendEnvelope(c).then(null,a=>{E&&g.error("Error while sending streamed span envelope:",a)}),this._removeTrace(t)}_removeTrace(t){let n=this._traceBuckets.get(t);n&&clearTimeout(n.timeout),this._traceBuckets.delete(t)}};var Nl=()=>({name:"SpanStreaming",setup(e){let t="SpanStreaming integration requires",n="Falling back to static trace lifecycle.",r=e.getOptions();if(!rt(e)){r.traceLifecycle="static",E&&g.warn(`${t} \`traceLifecycle\` to be set to "stream"! ${n}`);return}let i=r.beforeSendSpan;if(i&&!mi(i)){r.traceLifecycle="static",E&&g.warn(`${t} a beforeSendSpan callback using \`withStreamedSpan\`! ${n}`);return}let o=new Ad(e);e.on("afterSpanEnd",s=>{Qt(s)&&o.add(Ch(s,e))})}});function vl(e){if(e!==void 0)return e>=400&&e<500?"warning":e>=500?"error":void 0}function Rl(e,t,n){let r=e[t];if(typeof r=="function"){try{e[t]=n}catch{Object.defineProperty(e,t,{value:n,writable:!0,configurable:!0,enumerable:!0})}if(e.default===r)try{e.default=n}catch{Object.defineProperty(e,"default",{value:n,writable:!0,configurable:!0,enumerable:!0})}}}var Wt=class{constructor(t){this._maxSize=t,this._cache=new Map}get size(){return this._cache.size}get(t){let n=this._cache.get(t);if(n!==void 0)return this._cache.delete(t),this._cache.set(t,n),n}set(t,n){if(this._cache.size>=this._maxSize){let r=this._cache.keys().next().value;this._cache.delete(r)}this._cache.set(t,n)}remove(t){let n=this._cache.get(t);return n&&this._cache.delete(t),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let t=[];return this._cache.forEach(n=>t.push(n)),t}};function nx(e){let t=e._metadata?.sdk,n=t?.name&&t?.version?`${t?.name}/${t?.version}`:void 0;e.transportOptions={...e.transportOptions,headers:{...n&&{"user-agent":n},...e.transportOptions?.headers}}}var Ol=class extends Mu{constructor(t){nx(t),t.traceLifecycle==="stream"&&!t.integrations.some(n=>n.name==="SpanStreaming")&&t.integrations.push(Nl()),super(t),this._disposeCallbacks=[],this._setUpMetricsProcessing()}eventFromException(t,n){let r=TO(this,this._options.stackParser,t,n);return r.level="error",Si(r)}eventFromMessage(t,n="info",r){return Si(IO(this._options.stackParser,t,n,r,this._options.attachStacktrace))}captureException(t,n,r){return rx(n),super.captureException(t,n,r)}captureEvent(t,n,r){return!t.type&&t.exception?.values&&t.exception.values.length>0&&rx(n),super.captureEvent(t,n,r)}captureCheckIn(t,n,r){let i="checkInId"in t&&t.checkInId?t.checkInId:dt();if(!this._isEnabled())return E&&g.warn("SDK not enabled, will not capture check-in."),i;let o=this.getOptions(),{release:s,environment:c,tunnel:a}=o,l={check_in_id:i,monitor_slug:t.monitorSlug,status:t.status,release:s,environment:c};"duration"in t&&(l.duration=t.duration),n&&(l.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[p,u]=ia(this,r);u&&(l.contexts={trace:u});let d=cO(l,p,this.getSdkMetadata(),a,this.getDsn());return E&&g.log("Sending checkin:",t.monitorSlug,t.status),this.sendEnvelope(d),i}registerCleanup(t){this._disposeCallbacks.push(t)}dispose(){E&&g.log("Disposing client...");for(let t of this._disposeCallbacks)try{t()}catch{}this._disposeCallbacks.length=0;for(let t of Object.keys(this._hooks))this._hooks[t]?.clear();this._hooks={},this._eventProcessors.length=0,this._integrations={},this._outcomes={},this._transport=void 0,this._promiseBuffer=sa(Jc)}_prepareEvent(t,n,r,i){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,i)}_setUpMetricsProcessing(){this.on("processMetric",t=>{this._options.serverName&&(t.attributes={"server.address":this._options.serverName,...t.attributes})})}};function rx(e){let t=J().getScopeData().sdkProcessingMetadata.requestSession;if(t){let n=e?.mechanism?.handled??!0;n&&t.status!=="crashed"?t.status="errored":n||(t.status="crashed")}}var ix={mechanism:{handled:!1,type:"auto.rpc.trpc.middleware"}};function s3(e){typeof e=="object"&&e!==null&&"ok"in e&&!e.ok&&"error"in e&&me(e.error,ix)}function oy(e={}){return async function(t){let{path:n,type:r,next:i,rawInput:o,getRawInput:s}=t,c=C(),a=c?.getOptions(),l=c?.getDataCollectionOptions(),p={procedure_path:n,procedure_type:r};if(lv(p,1+(a?.normalizeDepth??5)),(e.attachRpcInput!==void 0?e.attachRpcInput:l?.httpBodies.includes("incomingRequest"))&&(o!==void 0&&(p.input=Ke(o)),s!==void 0&&typeof s=="function"))try{let u=await s();p.input=Ke(u)}catch{}return nr(u=>(u.setContext("trpc",p),ke({name:`trpc/${n}`,op:"rpc.server",attributes:{[ve]:"route",[S]:"auto.rpc.trpc"},forceTransaction:!!e.forceTransaction},async d=>{try{let m=await i();return s3(m),d.end(),m}catch(m){throw me(m,ix),d.end(),m}})))}}function Ai(e,t,n){try{if(!C())return;let i=Q();i?.isRecording()&&i.setStatus({code:2,message:"internal_error"}),me(e,{mechanism:{type:"auto.ai.mcp_server",handled:!1,data:{error_type:t||"handler_execution",...n}}})}catch{}}function Ra(e,t){kt(e,t,n=>function(r,...i){let o=i[i.length-1];if(typeof o!="function")return n.call(this,r,...i);let s=Cl(o,t,r);return n.call(this,r,...i.slice(0,-1),s)})}function Cl(e,t,n){return function(...r){try{return a3.call(this,e,t,n,r)}catch(i){return E&&g.warn("MCP handler wrapping failed:",i),e.apply(this,r)}}}function a3(e,t,n,r){try{let i=e.apply(this,r);return V(i)&&typeof i.then=="function"?Promise.resolve(i).catch(o=>{throw ox(o,t,n),o}):i}catch(i){throw ox(i,t,n),i}}function ox(e,t,n){try{let r={};t==="tool"||t==="registerTool"?(r.tool_name=n,e.name==="ProtocolValidationError"||e.message.includes("validation")||e.message.includes("protocol")?Ai(e,"validation",r):e.name==="ServerTimeoutError"||e.message.includes("timed out")||e.message.includes("timeout")?Ai(e,"timeout",r):Ai(e,"tool_execution",r)):t==="resource"||t==="registerResource"?(r.resource_uri=n,Ai(e,"resource_execution",r)):(t==="prompt"||t==="registerPrompt")&&(r.prompt_name=n,Ai(e,"prompt_execution",r))}catch{}}function c3(e){typeof e.tool=="function"&&Ra(e,"tool"),typeof e.registerTool=="function"&&Ra(e,"registerTool")}function l3(e){typeof e.resource=="function"&&Ra(e,"resource"),typeof e.registerResource=="function"&&Ra(e,"registerResource")}function p3(e){typeof e.prompt=="function"&&Ra(e,"prompt"),typeof e.registerPrompt=="function"&&Ra(e,"registerPrompt")}function sx(e){c3(e),l3(e),p3(e)}function ax(e){let t=e,n=t._registeredTools;if(V(n))for(let[s,c]of Object.entries(n))typeof c.executor=="function"&&(c.executor=Cl(c.executor,"registerTool",s));let r=t._registeredResources;if(V(r))for(let[s,c]of Object.entries(r))typeof c.readCallback=="function"&&(c.readCallback=Cl(c.readCallback,"registerResource",s));let i=t._registeredResourceTemplates;if(V(i))for(let[s,c]of Object.entries(i))typeof c.readCallback=="function"&&(c.readCallback=Cl(c.readCallback,"registerResource",s));let o=t._registeredPrompts;if(V(o))for(let[s,c]of Object.entries(o))typeof c.handler=="function"&&(c.handler=Cl(c.handler,"registerPrompt",s))}var sy="mcp.method.name",cx="mcp.request.id",lx="mcp.session.id",px="mcp.transport",ay="mcp.server.name",cy="mcp.server.title",ly="mcp.server.version",Oa="mcp.protocol.version",ux="mcp.tool.name",so="mcp.resource.uri",dx="mcp.prompt.name",mx="mcp.tool.result.is_error",fx="mcp.tool.result.content_count",gx="mcp.prompt.result.description",_x="mcp.prompt.result.message_count",Nd="mcp.request.argument",hx="mcp.logging.level",bx="mcp.logging.logger",yx="mcp.logging.data_type",Sx="mcp.logging.message",Ex="network.transport",Tx="network.protocol.version",vd="client.address",Rd="client.port",py="mcp.server",Ix="mcp.notification.client_to_server",Ax="mcp.notification.server_to_client",Nx="auto.function.mcp_server",uy="auto.mcp.notification",vx="route";function Rx(e){return V(e)&&"jsonrpc"in e&&e.jsonrpc==="2.0"&&"method"in e&&"id"in e}function dy(e){return V(e)&&"jsonrpc"in e&&e.jsonrpc==="2.0"&&"method"in e&&!("id"in e)}function Ox(e){return V(e)&&"jsonrpc"in e&&e.jsonrpc==="2.0"&&"id"in e&&("result"in e||"error"in e)}function Cx(e){return V(e)&&"connect"in e&&("tool"in e&&"resource"in e&&"prompt"in e||"registerTool"in e&&"registerResource"in e&&"registerPrompt"in e)?!0:(E&&g.warn("Did not patch MCP server. Interface is incompatible."),!1)}function an(e){return V(e)}function u3(e,t){let n={[fx]:e.length};for(let[r,i]of e.entries()){if(!an(i))continue;let o=e.length===1?"mcp.tool.result":`mcp.tool.result.${r}`;if(typeof i.type=="string"&&(n[`${o}.content_type`]=i.type),t){let s=(a,l)=>{typeof l=="string"&&(n[`${o}.${a}`]=l)};s("mime_type",i.mimeType),s("uri",i.uri),s("name",i.name),typeof i.text=="string"&&(n[`${o}.content`]=i.text),typeof i.data=="string"&&(n[`${o}.data_size`]=i.data.length);let c=i.resource;an(c)&&(s("resource_uri",c.uri),s("resource_mime_type",c.mimeType))}}return n}function xx(e,t){if(!an(e))return{};let n=Array.isArray(e.content)?u3(e.content,t):{};return typeof e.isError=="boolean"&&(n[mx]=e.isError),n}function Px(e,t){let n={};if(!an(e))return n;if(t&&typeof e.description=="string"&&(n[gx]=e.description),Array.isArray(e.messages)&&(n[_x]=e.messages.length,t)){let r=e.messages;for(let[i,o]of r.entries()){if(!an(o))continue;let s=r.length===1?"mcp.prompt.result":`mcp.prompt.result.${i}`;if(((a,l)=>{if(typeof l=="string"){let p=r.length===1?`${s}.message_${a}`:`${s}.${a}`;n[p]=l}})("role",o.role),an(o.content)){let a=o.content;if(typeof a.text=="string"){let l=r.length===1?`${s}.message_content`:`${s}.content`;n[l]=a.text}}}}return n}var my=new Map,kx=new WeakMap;function Od(e){let t=e.sessionId;return t?my.get(t):kx.get(e)}function d3(e,t){let n=e.sessionId;n?my.set(n,t):kx.set(e,t)}function Cd(e,t){let n=Od(e)||{};d3(e,{...n,...t})}function Lx(e){return Od(e)?.clientInfo}function Mx(e){return Od(e)?.protocolVersion}function wx(e){return Od(e)}function Gx(e){let t=e.sessionId;t&&my.delete(t)}var Ux="io.modelcontextprotocol/protocolVersion",Dx="io.modelcontextprotocol/clientInfo",Bx="io.modelcontextprotocol/serverInfo";function xd(e){let t={};return an(e)&&(typeof e.name=="string"&&(t.name=e.name),typeof e.title=="string"&&(t.title=e.title),typeof e.version=="string"&&(t.version=e.version)),t}function Hx(e){let t={};return an(e.params)&&(typeof e.params.protocolVersion=="string"&&(t.protocolVersion=e.params.protocolVersion),e.params.clientInfo&&(t.clientInfo=xd(e.params.clientInfo))),t}function Fx(e){let t={};if(an(e.params)&&an(e.params._meta)){let n=e.params._meta;typeof n[Ux]=="string"&&(t.protocolVersion=n[Ux]),n[Dx]&&(t.clientInfo=xd(n[Dx]))}return t}function Wx(e){let t={};return an(e)&&(typeof e.protocolVersion=="string"&&(t.protocolVersion=e.protocolVersion),e.serverInfo&&(t.serverInfo=xd(e.serverInfo))),t}function Vx(e){let t={};return an(e)&&an(e._meta)&&e._meta[Bx]&&(t.serverInfo=xd(e._meta[Bx])),t}function m3(e){let t=Lx(e),n={};return t?.name&&(n["mcp.client.name"]=t.name),t?.title&&(n["mcp.client.title"]=t.title),t?.version&&(n["mcp.client.version"]=t.version),n}function Yx(e){let t={};return e?.name&&(t["mcp.client.name"]=e.name),e?.title&&(t["mcp.client.title"]=e.title),e?.version&&(t["mcp.client.version"]=e.version),t}function f3(e){let t=wx(e)?.serverInfo,n={};return t?.name&&(n[ay]=t.name),t?.title&&(n[cy]=t.title),t?.version&&(n[ly]=t.version),n}function jx(e){let t={};return e?.name&&(t[ay]=e.name),e?.title&&(t[cy]=e.title),e?.version&&(t[ly]=e.version),t}function g3(e){return{address:e?.requestInfo?.remoteAddress||e?.clientAddress||e?.request?.ip||e?.request?.connection?.remoteAddress,port:e?.requestInfo?.remotePort||e?.clientPort||e?.request?.connection?.remotePort}}function _3(e){if(!e?.constructor)return{mcpTransport:"unknown",networkTransport:"unknown"};let t=typeof e.constructor?.name=="string"?e.constructor.name:"unknown",n="unknown",r=t.toLowerCase();return r.includes("stdio")?n="pipe":(r.includes("http")||r.includes("sse"))&&(n="tcp"),{mcpTransport:t,networkTransport:n}}function fy(e,t){let n=e&&"sessionId"in e?e.sessionId:void 0,r=t?g3(t):{},{mcpTransport:i,networkTransport:o}=_3(e),s=m3(e),c=f3(e),a=Mx(e);return{...n&&{[lx]:n},...r.address&&{[vd]:r.address},...r.port&&{[Rd]:r.port},[px]:i,[Ex]:o,[Tx]:"2.0",...a&&{[Oa]:a},...s,...c}}var Pd=new Map,gy=new WeakMap;function Zx(e){let t=e.sessionId;if(t){let r=Pd.get(t);return r||(r=new Map,Pd.set(t,r)),r}let n=gy.get(e);return n||(n=new Map,gy.set(e,n)),n}function Xx(e,t,n,r,i){Zx(e).set(t,{span:n,method:r,capturePolicy:i,startTime:Date.now()})}function Kx(e,t,n,r=!1){let i=Zx(e),o=i.get(t);if(o){let{span:s,method:c}=o,a=c==="initialize"?Wx(n):Vx(n);(a.protocolVersion||a.serverInfo)&&Cd(e,a);let l={...jx(a.serverInfo)};if(a.protocolVersion&&(l[Oa]=a.protocolVersion),Object.keys(l).length>0&&s.setAttributes(l),r)s.setStatus({code:2,message:"internal_error"});else if(c==="tools/call"){let p=xx(n,o.capturePolicy.recordOutputs);s.setAttributes(p)}else if(c==="prompts/get"){let p=Px(n,o.capturePolicy.recordOutputs);s.setAttributes(p)}s.end(),i.delete(t)}}function qx(e){let t=e.sessionId;if(t){let r=Pd.get(t);if(r){for(let[,i]of r)i.span.setStatus({code:2,message:"cancelled"}),i.span.end();Pd.delete(t)}return}let n=gy.get(e);if(n){for(let[,r]of n)r.span.setStatus({code:2,message:"cancelled"}),r.span.end();n.clear()}}var Qx={"tools/call":{targetField:"name",targetAttribute:ux,captureArguments:!0,argumentsField:"arguments"},"resources/read":{targetField:"uri",targetAttribute:so,captureUri:!0},"resources/subscribe":{targetField:"uri",targetAttribute:so},"resources/unsubscribe":{targetField:"uri",targetAttribute:so},"prompts/get":{targetField:"name",targetAttribute:dx,captureName:!0,captureArguments:!0,argumentsField:"arguments"}};function xl(e,t){let n=Qx[e];if(!n)return{attributes:{}};let r=n.targetField&&typeof t?.[n.targetField]=="string"?t[n.targetField]:void 0;return{target:r,attributes:r&&n.targetAttribute?{[n.targetAttribute]:r}:{}}}function Jx(e,t){let n={},r=Qx[e];if(!r)return n;if(r.captureArguments&&r.argumentsField&&t?.[r.argumentsField]){let i=t[r.argumentsField];if(V(i))for(let[o,s]of Object.entries(i))n[`${Nd}.${o.toLowerCase()}`]=JSON.stringify(s)}return r.captureUri&&t?.uri&&(n[`${Nd}.uri`]=JSON.stringify(t.uri)),r.captureName&&t?.name&&(n[`${Nd}.name`]=JSON.stringify(t.name)),n}function h3(e){return typeof e=="string"?e:JSON.stringify(e)}function b3(e,t,n){let r={};switch(e){case"notifications/cancelled":t?.requestId&&(r["mcp.cancelled.request_id"]=String(t.requestId)),t?.reason&&(r["mcp.cancelled.reason"]=String(t.reason));break;case"notifications/message":t?.level&&(r[hx]=String(t.level)),t?.logger&&(r[bx]=String(t.logger)),t?.data!==void 0&&(r[yx]=typeof t.data,n&&(r[Sx]=h3(t.data)));break;case"notifications/progress":t?.progressToken&&(r["mcp.progress.token"]=String(t.progressToken)),typeof t?.progress=="number"&&(r["mcp.progress.current"]=t.progress),typeof t?.total=="number"&&(r["mcp.progress.total"]=t.total,typeof t?.progress=="number"&&(r["mcp.progress.percentage"]=t.progress/t.total*100)),t?.message&&(r["mcp.progress.message"]=String(t.message));break;case"notifications/resources/updated":if(t?.uri){r[so]=String(t.uri);let i=ur(String(t.uri));i&&!pr(i)&&(r["mcp.resource.protocol"]=i.protocol.replace(":",""))}break;case"notifications/initialized":r["mcp.lifecycle.phase"]="initialization_complete",r["mcp.protocol.ready"]=1;break}return r}function _y(e,t,n,r){if(e==="request"){let i=t,o=xl(i.method,n||{});return{...i.id!==void 0&&{[cx]:String(i.id)},...o.attributes,...r?Jx(i.method,n||{}):{}}}return b3(t.method,n||{},r)}var y3=new Set([vd,Rd,so]);function S3(e){return y3.has(e)}function hy(e,t){return t?e:Object.entries(e).reduce((n,[r,i])=>(S3(r)||(n[r]=i),n),{})}function $x(e,t){return t?`${e} ${t}`:e}function zx(e){let t,n;switch(e){case"request":t=py,n=Nx;break;case"notification-incoming":t=Ix,n=uy;break;case"notification-outgoing":t=Ax,n=uy;break}return{[B]:t,[S]:n,[ve]:vx}}function eP(e){let{type:t,message:n,transport:r,extra:i,callback:o,options:s}=e,{method:c}=n,a=n.params,l;if(t==="request"){let _=xl(c,a||{});l=$x(c,_.target)}else l=c;let p={...fy(r,i),[sy]:c,..._y(t,n,a,s?.recordInputs),...zx(t)},d=!!C()?.getDataCollectionOptions().userInfo,m=hy(p,d);return Se({name:l,forceTransaction:!0,attributes:m},o)}function tP(e,t,n,r,i){return eP({type:"notification-incoming",message:e,transport:t,extra:n,callback:i,options:r})}function nP(e,t,n,r){return eP({type:"notification-outgoing",message:e,transport:t,options:n,callback:r})}function rP(e,t,n,r){let{method:i}=e,o=e.params,s=xl(i,o||{}),c=$x(i,s.target),a={...fy(t,n),[sy]:i,..._y("request",e,o,r?.recordInputs),...zx("request")},p=!!C()?.getDataCollectionOptions().userInfo,u=hy(a,p);return{name:c,op:py,forceTransaction:!0,attributes:u}}function by(e){if(e.recordInputs!==void 0&&e.recordOutputs!==void 0)return{recordInputs:e.recordInputs,recordOutputs:e.recordOutputs};let t=C()?.getDataCollectionOptions().genAI;return{recordInputs:e.recordInputs??t?.inputs??!1,recordOutputs:e.recordOutputs??t?.outputs??!1}}function iP(e,t){e.onmessage&&kt(e,"onmessage",n=>function(r,i){let o=Rx(r)?r:void 0,s=dy(r)?r:void 0,c=o||s,a;if(c)try{a=o?.method==="initialize"?Hx(o):Fx(c),(a.protocolVersion||a.clientInfo)&&Cd(e,a)}catch{}if(o){let l=by(t),p=J().clone();return nr(p,()=>{let u=rP(o,e,i,l),d=k(u);return o.method==="initialize"&&a&&d.setAttributes({...Yx(a.clientInfo),...a.protocolVersion&&{[Oa]:a.protocolVersion}}),Xx(e,o.id,d,o.method,l),se(d,()=>n.call(this,o,i))})}if(s){let l=by(t);return tP(s,e,i,l,()=>n.call(this,s,i))}return n.call(this,r,i)})}function oP(e,t){e.send&&kt(e,"send",n=>async function(...r){let[i]=r;if(dy(i)){let o=by(t);return nP(i,e,o,()=>n.call(this,...r))}return Ox(i)&&i.id!==null&&i.id!==void 0&&(i.error&&E3(i.error),Kx(e,i.id,i.result,!!i.error)),n.call(this,...r)})}function sP(e){e.onclose&&kt(e,"onclose",t=>function(...n){return qx(e),Gx(e),t.call(this,...n)})}function aP(e){e.onerror&&kt(e,"onerror",t=>function(n){return T3(n),t.call(this,n)})}function E3(e){try{if(V(e)&&"code"in e&&"message"in e){let t=e;if(t.code===-32603||t.code>=-32099&&t.code<=-32e3){let r=new Error(t.message);r.name=`JsonRpcError_${t.code}`,Ai(r,"protocol")}}}catch{}}function T3(e){try{Ai(e,"transport")}catch{}}var cP=new WeakSet;function yy(e,t){if(cP.has(e)||!Cx(e))return e;let n=e,r={...t};return kt(n,"connect",i=>async function(o,...s){let c=await i.call(this,o,...s);return iP(o,r),oP(o,r),sP(o),aP(o),c}),sx(n),ax(n),cP.add(e),e}function uP(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 dP(e){let t=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/,r=/at (?:async )?(.+?) \(data:(.*?),/;return i=>{let o=i.match(r);if(o)return{filename:`<data:${o[2]}>`,function:o[1]};let s=i.match(n);if(s){let c,a,l,p,u;if(s[1]){l=s[1];let h=l.lastIndexOf(".");if(l[h-1]==="."&&h--,h>0){c=l.slice(0,h),a=l.slice(h+1);let b=c.indexOf(".Module");b>0&&(l=l.slice(b+1),c=c.slice(0,b))}p=void 0}a&&(p=c,u=a),a==="<anonymous>"&&(u=void 0,l=void 0),l===void 0&&(u=u||"?",l=p?`${p}.${u}`:u);let d=nv(s[2]),m=s[5]==="native";!d&&s[5]&&!m&&(d=s[5]);let _=d?I3(d):void 0;return{filename:_??d,module:_&&e?.(_),function:l,lineno:lP(s[3]),colno:lP(s[4]),in_app:uP(d||"",m)}}if(i.match(t))return{filename:i}}}function Sy(e){return[90,dP(e)]}function lP(e){return parseInt(e||"",10)||void 0}function I3(e){try{return decodeURI(e)}catch{return}}var kd=new WeakMap,mP=(e,t)=>{let n=kd.get(e);n?n.push(t):kd.set(e,[t])},Pl=e=>{let t=kd.get(e);return t||(t=[],kd.set(e,t)),t};var ts="express.name",fP="http.route",ns="express.type",Ld="router",gP="middleware",_P="request_handler";var Ey=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];function A3(e){return e.includes(":")||e.includes("*")}var bP=(e,t,n)=>{if(t.name==="router"){let r=yP("",t),i=r||n||e||"/";return{attributes:{[ts]:i,[ns]:Ld},name:`router - ${i}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[ts]:(e||n)??"request handler",[ns]:_P},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[ts]:t.name,[ns]:gP},name:`middleware - ${t.name}`}},yP=(e,t)=>{let n=Array.isArray(t.handle?.stack)?t.handle?.stack?.[0]:void 0;return n?.route?.path?`${e}${n.route.path}`:n&&Array.isArray(n?.handle?.stack)?yP(e,n):e},SP=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(!Array.isArray(n?.ignoreLayers))return!1;try{return fn(e,n.ignoreLayers,!0)}catch{}return!1};function EP(e,t){let n=Pl(e);if(n.length===0)return;if(n.every(o=>o==="/"))return e.originalUrl==="/"?"/":void 0;if(t==="*"||t.includes("/")&&(t.includes(",")||t.includes("\\")||t.includes("*")||t.includes("[")))return t;let r=t.startsWith("/")?t:`/${t}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||A3(r))?r:void 0}function TP(e){let t=Pl(e),n="";for(let r of t)r==="/"||r==="/*"||(n+=!n||n.endsWith("/")?r:`/${r}`);return n.replace(/\/{2,}/g,"/")}var Md=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>hP(n)||"").join(","):hP(t)},hP=e=>typeof e=="string"?e:e instanceof RegExp||typeof e=="number"?String(e):void 0,wd=e=>IP(e?.Router?.prototype),IP=e=>(typeof e=="object"||typeof e=="function")&&!!e&&"route"in e&&typeof e.route=="function",AP=e=>IP(e.Router)&&!wd(e);function N3(e){let t=e.status||e.statusCode||e.status_code||e.output?.statusCode;return t?parseInt(t,10):500}function NP(e){return N3(e)>=500}function kl(e){if(!J()?.getScopeData()?.sdkProcessingMetadata?.normalizedRequest){let n=Qo(e);J().setSDKProcessingMetadata({normalizedRequest:n})}}function Gd(e,t,n){if(!t?.handle)return;let r=t,i=r.handle;if(Nr(i)||i.length===4)return;function o(s,c,...a){let l=e();kl(s);let p=Q();if(!p)return i.apply(this,[s,c,...a]);n&&mP(s,n);let u=Pl(s),d=!!n,m=TP(s),_=EP(s,m);l.onRouteResolved?.(_);let h=bP(m,r,n),b=h.attributes[ts],N=h.attributes[ns],M=Object.assign(h.attributes,{[S]:"auto.http.express",[B]:`${N}.express`});if(_&&(M[fP]=_),SP(h.attributes[ts],N,l))return d&&u.pop(),i.apply(this,[s,c,...a]);let R=J();if(R!==Rt()){if(N==="request_handler"){let v=s.method?s.method.toUpperCase():"GET";R.setTransactionName(`${v} ${m}`)}}else E&&g.warn("Isolation scope is still default isolation scope - skipping setting transactionName");return ke({name:b,attributes:M},v=>{let P=!1;h.attributes[ns]===Ld&&(v.end(),P=!0);let D=()=>{P||(P=!0,v.end())};for(let I=0;I<a.length;I++){let H=a[I];if(typeof H=="function"){a[I]=function(...L){let G=L[0],ce=!!G&&G!=="route"&&G!=="router";if(!P&&ce){let[ge,Ne]=Ey(G);v.setStatus({code:2,message:Ne})}return P||(P=!0,c.removeListener("finish",D),v.end()),!(s.route&&ce)&&d&&u.pop(),se(p,()=>H.apply(this,L))};break}}try{return i.apply(this,[s,c,...a])}catch(I){let[H,L]=Ey(I);throw v.setStatus({code:2,message:L}),I}finally{P||c.once("finish",D)}})}for(let s in i)s in o||Object.defineProperty(o,s,{get(){return i[s]},set(c){i[s]=c}});Po(o,i),Object.defineProperty(r,"handle",{enumerable:!0,configurable:!0,writable:!0,value:o})}function Ud(e){return!!e&&typeof e=="object"&&"default"in e&&e.default||e}function v3(e){return!!e.express}var vP=!1;function R3(){vP||(vP=!0,E&&g.warn("[Express] `patchExpressModule(options)` is deprecated. Use `patchExpressModule(moduleExports, getOptions)` instead."))}function Ty(e,t){let n,r;if(!t&&v3(e)){let{express:p,...u}=e;r=p,n=()=>u,R3()}else{if(typeof t!="function")throw new TypeError("`patchExpressModule(moduleExports, getOptions)` requires a `getOptions` callback");n=t,r=e}let i=Ud(r),o=wd(i)?i.Router.prototype:AP(i)?i.Router:void 0;if(!o)throw new TypeError("no valid Express route function to instrument");let s=o.route;try{Ps(o,"route",function(...u){let d=s.apply(this,u),m=this.stack[this.stack.length-1];return Gd(n,m,Md(u)),d})}catch(p){E&&g.error("Failed to patch express route method:",p)}let c=o.use;try{Ps(o,"use",function(...u){let d=c.apply(this,u),m=this.stack[this.stack.length-1];return m&&Gd(n,m,Md(u)),d})}catch(p){E&&g.error("Failed to patch express use method:",p)}let{application:a}=i,l=a.use;try{Ps(a,"use",function(...u){let d=l.apply(this,u),m=wd(i)?this.router:this._router;if(m){let _=m.stack[m.stack.length-1];_&&Gd(n,_,Md(u))}return d})}catch(p){E&&g.error("Failed to patch express application.use method:",p)}return i}function O3(){return C()?.getIntegrationByName("Express")?.getShouldHandleError?.()}function Iy(e){return function(n,r,i,o){kl(r);let s=e?.shouldHandleError??O3()??NP;if(s===!1){o(n);return}if(s(n)){let c=me(n,{mechanism:{type:"auto.middleware.express",handled:!1}});i.sentry=c}o(n)}}function Ay(e,t){e.use(C3()),e.use(Iy(t))}function C3(){return function(t,n,r){kl(t),r()}}var x3=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,Dd=Symbol("sentryPostgresConnectionContext"),Ny=Symbol.for("sentry.instrumented.postgresjs"),P3=Symbol.for("sentry.query.from.instrumented.sql");function Oy(e,t){return!e||typeof e!="function"?(E&&g.warn("instrumentPostgresJsSql: provided value is not a valid postgres.js sql instance"),e):Ry(e,{requireParentSpan:!0,...t})}function Ry(e,t,n){if(e[Ny])return e;let r=new Proxy(e,{apply(i,o,s){let c=Reflect.apply(i,o,s);return V(c)&&"handle"in c&&RP(c,r,t),c},get(i,o){let s=i[o];return typeof o!="string"||typeof s!="function"?s:o==="unsafe"||o==="file"?k3(s,i,r,t):o==="begin"||o==="reserve"?L3(s,i,r,t):s}});return n?r[Dd]=n:w3(e,r),e[Ny]=!0,r[Ny]=!0,r}function k3(e,t,n,r){return function(...i){let o=Reflect.apply(e,t,i);return V(o)&&"handle"in o&&RP(o,n,r),o}}function L3(e,t,n,r){return function(...i){let o=n[Dd];if(!(typeof i[i.length-1]=="function")){let p=Reflect.apply(e,t,i);return p&&typeof p.then=="function"?p.then(u=>Ry(u,r,o)):p}let c=i.length===1?i[0]:i[1],a=function(p){let u=Ry(p,r,o);return c(u)},l=i.length===1?[a]:[i[0],a];return Reflect.apply(e,t,l)}}function RP(e,t,n){if(e.handle?.__sentryWrapped)return;e[P3]=!0;let r=e.handle,i=async function(...o){if(this.executed||!M3(n))return r.apply(this,o);let s=Bd(e.strings),c=xa(s);return ke({name:c||"postgresjs.query",op:"db"},a=>{a.setAttribute(S,"auto.db.postgresjs"),a.setAttributes({"db.system.name":"postgres","db.query.text":c});let l=t?t[Dd]:void 0;if(Hd(a,l),n.requestHook)try{n.requestHook(a,c,l)}catch(u){a.setAttribute("sentry.hook.error","requestHook failed"),E&&g.error("Error in requestHook for PostgresJs instrumentation:",u)}let p=this;p.resolve=new Proxy(p.resolve,{apply:(u,d,m)=>{try{Ca(a,c,m?.[0]?.command),a.end()}catch(_){E&&g.error("Error ending span in resolve callback:",_)}return Reflect.apply(u,d,m)}}),p.reject=new Proxy(p.reject,{apply:(u,d,m)=>{try{a.setStatus({code:2,message:m?.[0]?.message||"unknown_error"}),a.setAttribute("db.response.status_code",m?.[0]?.code||"unknown"),a.setAttribute("error.type",m?.[0]?.name||"unknown"),Ca(a,c),a.end()}catch(_){E&&g.error("Error ending span in reject callback:",_)}return Reflect.apply(u,d,m)}});try{return r.apply(this,o)}catch(u){throw a.setStatus({code:2,message:u instanceof Error?u.message:"unknown_error"}),a.end(),u}})};i.__sentryWrapped=!0,e.handle=i}function M3(e){return Q()!==void 0||!e.requireParentSpan}function Bd(e){if(e?.length)return e.length===1?e[0]||void 0:e.reduce((t,n,r)=>r===0?n:`${t}$${r}${n}`,"")}var vy;function xa(e){return e?(vy||(vy=new RegExp("(?<!\\$)-?\\b\\d+\\b","g")),e.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(vy,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)")):"Unknown SQL Query"}function Hd(e,t){if(t&&(t.ATTR_DB_NAMESPACE&&e.setAttribute("db.namespace",t.ATTR_DB_NAMESPACE),t.ATTR_SERVER_ADDRESS&&e.setAttribute("server.address",t.ATTR_SERVER_ADDRESS),t.ATTR_SERVER_PORT!==void 0)){let n=parseInt(t.ATTR_SERVER_PORT,10);isNaN(n)||e.setAttribute("server.port",n)}}function Ca(e,t,n){if(n){e.setAttribute("db.operation.name",n);return}let r=t?.match(x3);r?.[1]&&e.setAttribute("db.operation.name",r[1].toUpperCase())}function Fd(e){let t=e.host?.[0]||"localhost",n=e.port?.[0]||5432;return{ATTR_DB_NAMESPACE:typeof e.database=="string"&&e.database!==""?e.database:void 0,ATTR_SERVER_ADDRESS:t,ATTR_SERVER_PORT:String(n)}}function w3(e,t){let n=e;!n.options||typeof n.options!="object"||(t[Dd]=Fd(n.options))}var Xr="@sentry/instrumentation-http",Kr="http.client.request.created",Pa="http.server.request.start";function Wd(e){let t=e.host||"",n=/^(.*):(\d+)$/.exec(t),r=n?n[1]:t,i=e.port??(n?Number(n[2]):void 0);return{method:e.method,port:i,protocol:e.protocol,host:e.host,hostname:r,path:e.path,headers:e.getHeaders()}}function Cy(e){try{return String(OP(e))}catch{return""}}function OP(e){let t=e.protocol||"http:",r=e.headers?.host&&String(e.headers?.host)||e.hostname||e.host||"",i=!e.port||e.port===80||e.port===443||/^(.*):(\d+)$/.test(r)?"":`:${e.port}`,o=e.path?e.path:"/",s=`${t}//${r}${i}`;return new URL(o.startsWith("//")?`${s}${o}`:o,s)}function fr(e){return String(Cy(Wd(e)))}function CP(e,t){let n=fr(e),r=Ki(n),i=t?.statusCode,o=vl(i);on({category:"http",data:{status_code:i,url:qi(r),"http.method":e.method||"GET",...r.search?{"http.query":Wn(r.search)}:{},...r.hash?{"http.fragment":r.hash}:{}},type:"http",level:o},{event:"response",request:e,response:t})}function xP(e){let t=fr(e),[n,r]=lb(ur(t),"client","auto.http.client",e),i=e.getHeader("user-agent");return{name:n,attributes:{[B]:"http.client","otel.kind":"CLIENT","http.url":Ct(t),"http.method":e.method,"http.target":Ct(e.path||"/"),"net.peer.name":e.host,"http.host":e.getHeader("host"),...i?{"user_agent.original":i}:{},...r},onlyIfParent:!0}}function PP(e,t){let{statusCode:n,statusMessage:r,httpVersion:i,socket:o}=e,s=i?.toUpperCase()!=="QUIC"?"ip_tcp":"ip_udp";t.setAttributes({"http.response.status_code":n,"network.protocol.version":i,"http.flavor":i,"network.transport":s,"net.transport":s,"http.status_text":r?.toUpperCase(),"http.status_code":n,...U3(e),...G3(o)})}function G3(e){if(!e)return{};let{remoteAddress:t,remotePort:n}=e;return{"network.peer.address":t,"network.peer.port":n,"net.peer.ip":t,"net.peer.port":n}}function U3(e){let{headers:t}=e,n=t["content-length"],r=n?parseInt(String(n),10):-1,i=t["content-encoding"];return r>=0?i&&i!=="identity"?{"http.response_content_length":r}:{"http.response_content_length_uncompressed":r}:{}}function Vd(e,t){let n=fr(e),r=C()?.getOptions(),{tracePropagationTargets:i,propagateTraceparent:o}=r??{};if(!qo(n,i,t)||!!e.getHeader("sentry-trace"))return;let c=$e({propagateTraceparent:o});if(!c)return;let{"sentry-trace":a,baggage:l,traceparent:p}=c;if(a)try{e.setHeader("sentry-trace",a),E&&g.log(Xr,"Added sentry-trace header")}catch(u){E&&g.error(Xr,"Failed to set sentry-trace header:",et(u)?u.message:"Unknown error")}if(p&&!e.getHeader("traceparent"))try{e.setHeader("traceparent",p),E&&g.log(Xr,"Added traceparent header")}catch(u){E&&g.error(Xr,"Failed to set traceparent header:",et(u)?u.message:"Unknown error")}if(l){let u=Ws(e.getHeader("baggage"),l);if(u)try{e.setHeader("baggage",u),E&&g.log(Xr,"Added baggage header")}catch(d){E&&g.error(Xr,"Failed to set baggage header:",et(d)?d.message:"Unknown error")}}}var kP=e=>typeof e.__unwrap=="function",D3="Double-wrapped http.client detected. Either disable spans in Sentry.httpIntegration, or disable the OpenTelemetry HTTP instrumentation. See: https://docs.sentry.io/platforms/javascript/guides/express/opentelemetry/custom-setup/#custom-http-instrumentation",LP=!1,xy=E?e=>{LP||(kP(e.request)||kP(e.get))&&(LP=!0,g.warn(D3))}:()=>{};function Ll(e){let t=new Wt(100),n=()=>C()?.getOptions(),r=i=>{if(ne().getScopeData().sdkProcessingMetadata[Zs]===!0)return;let o=n(),{errorMonitor:s="error",spans:c=o?Ue(o):!0,propagateTrace:a=!1,breadcrumbs:l=!0,http:p,https:u,suppressOtelWarning:d=!1}=e,{request:m}=i,_=fr(m);if(pb(_,C())||e.ignoreOutgoingRequests?.(_,m))return;let h=!1;function b(D,I){h||(h=!0,CP(D,I))}function N(D){D.on(s,()=>b(D,void 0)),D.prependListener("response",I=>{D.listenerCount("response")<=1&&I.resume(),I.on("end",()=>b(D,I)),I.on(s,()=>b(D,I))})}if(!c){l&&N(m),a&&Vd(m,t);return}d||(p&&xy(p),u&&xy(u));let M=k(xP(m));e.outgoingRequestHook?.(M,m),a&&(M.isRecording()?se(M,()=>{Vd(m,t)}):Vd(m,t));let R=!1;function v(D){R||(R=!0,M.setStatus(D),M.end())}let P=()=>v({code:0});m.on("close",P),m.on(s,D=>{E&&g.log(Xr,"outgoingRequest on request error()",D),l&&b(m,void 0),v({code:2})}),m.prependListener("response",D=>{m.removeListener("close",P),m.listenerCount("response")<=1&&D.resume(),PP(D,M),_n(D),e.outgoingResponseHook?.(M,D);let I=!1;function H(L){if(!I){I=!0,L&&E&&g.log(Xr,"outgoingRequest on response error()",L),l&&b(m,D);let G=D.aborted&&!D.complete,ce=L||typeof D.statusCode!="number"||G?{code:2}:Xt(D.statusCode);e.applyCustomAttributesOnSpan?.(M,m,D),v(ce)}}D.on("end",()=>H()),D.on(s,H)})};return{[Kr]:r}}var MP;function B3(e,t){let n=e.ClientRequest?.prototype;if(typeof n?._storeHeader!="function"||(MP=Ll({...t,http:e})[Kr],Nr(n._storeHeader)))return;let i=n._storeHeader;Ps(n,"_storeHeader",function(...s){try{MP({request:this},Kr)}catch{}return i.apply(this,s)})}function H3(e,t={}){let n=Ud(e);return B3(n,t),e}var Py=(e,t={})=>H3(e,t);function wP(e,t,n,r){let i=0,o=[];E&&g.log(r,"Patching request.on");let s=new WeakMap,c=mb(n);try{e.on=e.addListener=new Proxy(e.on,{apply:(a,l,p)=>{let[u,d,...m]=p;if(u==="data"){E&&g.log(r,`Handling request.on("data") with maximum body size of ${c}b`);let _=new Proxy(d,{apply:(h,b,N)=>{try{let M=N[0],R=Buffer.from(M);i<c?(o.push(R),i+=R.byteLength):E&&g.log(r,`Dropping request body chunk because maximum body length of ${c}b is exceeded.`)}catch{E&&g.error(r,"Encountered error while storing body chunk.")}return Reflect.apply(h,b,N)}});return s.set(d,_),Reflect.apply(a,l,[u,_,...m])}return Reflect.apply(a,l,p)}}),e.off=e.removeListener=new Proxy(e.off,{apply:(a,l,p)=>{let[,u]=p,d=s.get(u);if(d){s.delete(u);let m=p.slice();return m[1]=d,Reflect.apply(a,l,m)}return Reflect.apply(a,l,p)}}),e.on("end",()=>{try{let a=Buffer.concat(o).toString("utf-8");if(a){let p=Buffer.byteLength(a,"utf-8")>c?`${Buffer.from(a).subarray(0,c-3).toString("utf-8")}...`:a;t.setSDKProcessingMetadata({normalizedRequest:{data:p}})}}catch(a){E&&g.error(r,"Error building captured request body",a)}})}catch(a){E&&g.error(r,"Error patching request to capture body",a)}}var ky=new WeakMap;function GP(e,{requestIsolationScope:t,response:n,sessionFlushingDelayMS:r}){t.setSDKProcessingMetadata({requestSession:{status:"ok"}}),n.once("close",()=>{let i=t.getScopeData().sdkProcessingMetadata.requestSession;if(e&&i){E&&g.log(`Recorded request session with status: ${i.status}`);let o=new Date(tt());o.setSeconds(0,0);let s=o.toISOString(),c=ky.get(e),a=c?.[s]||{exited:0,crashed:0,errored:0};if(a[{ok:"exited",crashed:"crashed",errored:"errored"}[i.status]]++,c)c[s]=a;else{E&&g.log("Opened new request session aggregate.");let l={[s]:a};ky.set(e,l);let p=()=>{clearTimeout(d),u(),ky.delete(e);let m=Object.entries(l).map(([_,h])=>({started:_,exited:h.exited,errored:h.errored,crashed:h.crashed}));e.sendSession({aggregates:m})},u=e.on("flush",()=>{E&&g.log("Sending request session aggregate due to client flush"),p()}),d=setTimeout(()=>{E&&g.log("Sending request session aggregate due to flushing schedule"),p()},r);On(d)}}})}var UP="Http.Server",F3="Http.SentryServerSpans",DP=new WeakMap,BP=Symbol.for("sentry_http_server_instrumented");function W3(e){return!e[BP]&&(e[BP]=!0)}function V3(e,t){let n=t.emit,r=DP.get(t);if(n===r)return;let i=new Proxy(n,{apply(o,s,c){let[a,...l]=c;if(a!=="request")return o.apply(s,c);let p=C(),[u,d]=l;if(!p||!W3(u))return o.apply(s,c);E&&g.log(UP,"Handling incoming request");let m=J().clone();m.setClient(p);let _=u.socket?.remoteAddress,h=u.url||"/",b=Qo(u),{maxRequestBodySize:N="medium",ignoreRequestBody:M,sessions:R=!0,sessionFlushingDelayMS:v=6e4}=e;N!=="none"&&!M?.(h,u)&&wP(u,m,N,UP),m.setSDKProcessingMetadata({normalizedRequest:b,ipAddress:_});let P=(u.method||"GET").toUpperCase(),D=dr(h),I=`${P} ${D}`;return m.setTransactionName(I),R&&GP(p,{requestIsolationScope:m,response:d,sessionFlushingDelayMS:v??6e4}),nr(m,()=>{let H=b.headers?.["sentry-trace"],L=b.headers?.baggage,G=Array.isArray(H)?H[0]:H;return An({sentryTrace:G,baggage:Array.isArray(L)?L[0]:L},()=>{let ce=ne().getPropagationContext();ce.propagationSpanId=jt(),G||(ce.traceId=yt(),ce.sampleRand=ct()),d.once("close",()=>{m.setContext("response",{status_code:d.statusCode})});let ge=e.wrapServerEmitRequest,Ne=!1;return ge?ge(u,d,b,()=>{Ne=o.apply(s,c)}):Ne=o.apply(s,c),Ne})})}});DP.set(t,i),t.emit=i}function Ly(e){let t=e.wrapServerEmitRequest,n=Y3(e),r={...e,wrapServerEmitRequest(o,s,c,a){let l=C()?.getOptions();e.spans??(l?Ue(l):!1)?n(o,s,c,a):t?t(o,s,c,a):a()}},i=o=>{let{server:s}=o;V3(r,s)};return{[Pa]:i}}function Y3(e){let{wrapServerEmitRequest:t,ignoreIncomingRequests:n,ignoreStaticAssets:r=!0,onSpanCreated:i,errorMonitor:o="error",onSpanEnd:s}=e;return(c,a,l,p)=>{if(typeof __SENTRY_TRACING__<"u"&&!__SENTRY_TRACING__)return p();return t?t(c,a,l,u):u();function u(){let m=J().getClient();if(!m)return p();if(j3(c,{ignoreStaticAssets:r,ignoreIncomingRequests:n}))return E&&g.log(F3,"Skipping span creation for incoming request",c.url),p();let _=l.url||c.url||"/",h=ur(_),b=h?h.pathname:dr(_),N=(c.method||"GET").toUpperCase(),M=`${N} ${b}`,R=c.headers,v=R["user-agent"],P=R["x-forwarded-for"],D=c.httpVersion,I=R.host,H=I?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",L=_.startsWith("https")?"https":"http",{socket:G}=c,{localAddress:ce,localPort:ge,remoteAddress:Ne,remotePort:Te}=G??{};return ke({name:M,kind:U.SERVER,attributes:{[B]:"http.server",[S]:"auto.http.server",[ve]:"url","http.route":b,"otel.kind":"SERVER","net.host.ip":ce,"net.host.port":ge,"net.peer.ip":Ne,"net.peer.port":Te,"sentry.http.prefetch":Z3(c)||void 0,[pt]:h&&!pr(h)?Ct(h.href,m):void 0,[Zi]:h?.pathname??b,[yi]:Ct(_,m),"http.method":N,"http.target":Ct(h?`${h.pathname}${h.search}`:b,m),"http.host":I,"net.host.name":H,"http.client_ip":typeof P=="string"?P.split(",")[0]:void 0,"http.user_agent":v,"http.scheme":L,"http.flavor":D,"net.transport":D?.toUpperCase()==="QUIC"?"ip_udp":"ip_tcp",...X3(c),...Hr(l.headers||{},m.getDataCollectionOptions())}},Ce=>{i?.(Ce,c,a);let qe=!1;function Nt(Sn){qe||(qe=!0,Ce.setAttributes({"http.status_text":a.statusMessage?.toUpperCase(),"http.response.status_code":a.statusCode,"http.status_code":a.statusCode,...Hr(Uu(a.headers),m?.getDataCollectionOptions()??!1,"response")}),Ce.setStatus(Sn),s?.(Ce,c,a),Ce.end())}a.once("close",()=>{Nt(Xt(a.statusCode))}),a.once(o,()=>{let Sn=Xt(a.statusCode);Nt(Sn.code===2?Sn:{code:2})}),p()})}}}function j3(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){let r=e.url,i=e.method?.toUpperCase();return!!(i==="OPTIONS"||i==="HEAD"||!r||t&&i==="GET"&&HP(r)||n?.(r,e))}function HP(e){let t=dr(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function Z3(e){return e.headers["next-router-prefetch"]==="1"}function X3(e){let{headers:t}=e,n=t["content-length"],r=n?parseInt(String(n),10):-1,i=t["content-encoding"];return r>=0?i&&i!=="identity"?{"http.request_content_length":r}:{"http.request_content_length_uncompressed":r}:{}}at();import{subscribe as K3}from"diagnostics_channel";var We=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var FP=xo("sentry_http_server_instrumented"),q3="Http.Server";function WP(e,t){we(e,"_startSpanCallback",new WeakRef(t))}var Q3=((e={})=>{let t={sessions:e.sessions??!0,sessionFlushingDelayMS:e.sessionFlushingDelayMS??6e4,maxRequestBodySize:e.maxRequestBodySize??"medium",spans:!1,ignoreRequestBody:e.ignoreRequestBody,wrapServerEmitRequest(n,r,i,o){let s=C();if(!s||pe.active().getValue(FP))return o();let c=ci.extract(pe.active(),i.headers).setValue(FP,!0);pe.with(c,()=>{s.emit("httpServerRequest",n,r,i);let a=n._startSpanCallback?.deref();a?a(()=>(o(),!0)):o()})}};return{name:q3,setupOnce(){let{[Pa]:n}=Ly(t);K3(Pa,n)},afterAllSetup(n){We&&n.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerIntegration` while `httpIntegration` is also present. Make sure to remove `httpServerIntegration` when adding `httpIntegration`.")}}}),ka=Q3;at();QN();import{errorMonitor as J3}from"events";var VP="Http.ServerSpans",$3=((e={})=>{let t=e.ignoreStaticAssets??!0,n=e.ignoreIncomingRequests,r=e.ignoreStatusCodes??[[401,404],[301,303],[305,399]],{onSpanCreated:i}=e,{requestHook:o,responseHook:s,applyCustomAttributesOnSpan:c}=e.instrumentation??{};return{name:VP,setup(a){typeof __SENTRY_TRACING__<"u"&&!__SENTRY_TRACING__||a.on("httpServerRequest",(l,p,u)=>{let d=l,m=p;WP(d,h=>{if(tj(d,{ignoreStaticAssets:t,ignoreIncomingRequests:n}))return We&&g.log(VP,"Skipping span creation for incoming request",d.url),h();let b=u.url||d.url||"/",N=ur(b),M=d.headers,R=M["user-agent"],v=M["x-forwarded-for"],P=d.httpVersion,D=M.host,I=D?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",H=b.startsWith("https")?"https":"http",L=u.method||d.method?.toUpperCase()||"GET",G=N?N.pathname:dr(b),ce=`${L} ${G}`,ge=k({name:ce,kind:U.SERVER,attributes:{[B]:"http.server",[S]:"auto.http.otel.http",[p0]:z3(d)||void 0,[pt]:N&&!pr(N)?Ct(N.href,a):void 0,[Zi]:N?.pathname??G,[yi]:Ct(b,a),[Gr]:u.method,[Au]:Ct(N?`${N.pathname}${N.search}`:G,a),[QR]:D,[i0]:I,[KR]:typeof v=="string"?v.split(",")[0]:void 0,[$R]:R,[JR]:H,[qR]:P,[ra]:P?.toUpperCase()==="QUIC"?"ip_udp":"ip_tcp",...nj(d),...Hr(u.headers||{},a.getDataCollectionOptions())}});o?.(ge,d),s?.(ge,m),c?.(ge,d,m),i?.(ge,d,m);let Ne={type:p_.HTTP,span:ge};return se(ge,()=>pe.with(qN(pe.active(),Ne),()=>{_n(d),_n(m);let Te=!1;function Ce(qe){if(Te)return;Te=!0;let Nt=oj(d,m,Ne);ge.setAttributes(Nt),ge.setStatus(qe),ge.end();let Sn=Nt["http.route"];Sn&&J().setTransactionName(`${d.method?.toUpperCase()||"GET"} ${Sn}`)}return m.on("close",()=>{Ce(Xt(m.statusCode))}),m.on(J3,()=>{let qe=Xt(m.statusCode);Ce(qe.code===2?qe:{code:2})}),h()}))})})},processEvent(a){if(a.type==="transaction"){let l=a.contexts?.trace?.data?.["http.response.status_code"];if(typeof l=="number"){if(sj(l,r))return We&&g.log("Dropping transaction due to status code",l),null;a.contexts={...a.contexts,response:{...a.contexts?.response,status_code:l}}}}return a},afterAllSetup(a){We&&(a.getIntegrationByName("Http")&&g.warn("It seems that you have manually added `httpServerSpansIntegration` while `httpIntegration` is also present. Make sure to remove `httpIntegration` when adding `httpServerSpansIntegration`."),a.getIntegrationByName("Http.Server")||g.error("It seems that you have manually added `httpServerSpansIntegration` without adding `httpServerIntegration`. This is a requiement for spans to be created - please add the `httpServerIntegration` integration."))}}}),La=$3;function z3(e){return e.headers["next-router-prefetch"]==="1"}function ej(e){let t=dr(e);return!!(t.match(/\.(ico|png|jpg|jpeg|gif|svg|css|js|woff|woff2|ttf|eot|webp|avif)$/)||t.match(/^\/(robots\.txt|sitemap\.xml|manifest\.json|browserconfig\.xml)$/))}function tj(e,{ignoreStaticAssets:t,ignoreIncomingRequests:n}){if(kr())return!0;let r=e.url,i=e.method?.toUpperCase();return!!(i==="OPTIONS"||i==="HEAD"||!r||t&&i==="GET"&&ej(r)||n?.(r,e))}function nj(e){let t=rj(e.headers);return t==null?{}:ij(e.headers)?{"http.request_content_length":t}:{"http.request_content_length_uncompressed":t}}function rj(e){let t=e["content-length"];if(t===void 0)return null;let n=parseInt(t,10);return isNaN(n)?null:n}function ij(e){let t=e["content-encoding"];return!!t&&t!=="identity"}function oj(e,t,n){let{socket:r}=e,{statusCode:i,statusMessage:o}=t,s={[hn]:i,[bi]:i,"http.status_text":o?.toUpperCase()};if(r){let{localAddress:c,localPort:a,remoteAddress:l,remotePort:p}=r;s[r0]=c,s[o0]=a,s[s0]=l,s[xe]=p}if(s[bi]=i,s["http.status_text"]=(o||"").toUpperCase(),n?.type===p_.HTTP&&n.route!==void 0){let c=n.route;s[He]=c}return s}function sj(e,t){return t.some(n=>{if(typeof n=="number")return n===e;let[r,i]=n;return e>=r&&e<=i})}at();import{subscribe as eZ,unsubscribe as tZ}from"diagnostics_channel";at();var Ml=class{emit(t){}enabled(){return!1}},YP=new Ml;var wl=Symbol.for("io.opentelemetry.js.api.logs"),Ma=globalThis;function jP(e,t,n){return r=>r===e?t:n}var My=1;var wy=class{getLogger(t,n,r){return new Ml}},Yd=new wy;var jd=class{constructor(t,n,r,i){this._provider=t,this.name=n,this.version=r,this.options=i}emit(t){this._getLogger().emit(t)}enabled(t){return this._getLogger().enabled(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):YP}};var Gl=class{getLogger(t,n,r){var i;return(i=this._getDelegateLogger(t,n,r))!==null&&i!==void 0?i:new jd(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Yd}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var i;return(i=this._delegate)===null||i===void 0?void 0:i.getLogger(t,n,r)}};var Zd=class e{constructor(){this._proxyLoggerProvider=new Gl}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Ma[wl]?this.getLoggerProvider():(Ma[wl]=jP(My,t,Yd),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Ma[wl])===null||t===void 0?void 0:t.call(Ma,My))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Ma[wl],this._proxyLoggerProvider=new Gl}};var Xd=Zd.getInstance();function ZP(e,t,n,r){for(let i=0,o=e.length;i<o;i++){let s=e[i];t&&s.setTracerProvider(t),n&&s.setMeterProvider(n),r&&s.setLoggerProvider&&s.setLoggerProvider(r),s.getConfig().enabled||s.enable()}}function XP(e){e.forEach(t=>t.disable())}function wa(e){let t=e.tracerProvider||he.getTracerProvider(),n=e.meterProvider||Kp.getMeterProvider(),r=e.loggerProvider||Xd.getLoggerProvider(),i=e.instrumentations?.flat()??[];return ZP(i,t,n,r),()=>{XP(i)}}import*as Ni from"path";import{types as hk}from"util";at();var $P=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,aj=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,cj={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function zP(e,t,n){if(!lj(e))return nn.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=mj(e);if(!r)return!1;let i=[],o=ek(r,t,i,n);return o&&!n?.includePrerelease?uj(r,i):o}function lj(e){return typeof e=="string"&&$P.test(e)}function ek(e,t,n,r){if(t.includes("||")){let i=t.trim().split("||");for(let o of i)if(Gy(e,o,n,r))return!0;return!1}else if(t.includes(" - "))t=Mj(t,r);else if(t.includes(" ")){let i=t.trim().replace(/\s{2,}/g," ").split(" ");for(let o of i)if(!Gy(e,o,n,r))return!1;return!0}return Gy(e,t,n,r)}function Gy(e,t,n,r){if(t=dj(t,r),t.includes(" "))return ek(e,t,n,r);{let i=fj(t);return n.push(i),pj(e,i)}}function pj(e,t){if(t.invalid)return!1;if(!t.version||Dy(t.version))return!0;let n=qP(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],i=t.prereleaseSegments||[];!r.length&&!i.length?n=0:!r.length&&i.length?n=1:r.length&&!i.length?n=-1:n=qP(r,i)}return cj[t.op]?.includes(n)}function uj(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function dj(e,t){return e=e.trim(),e=kj(e,t),e=Pj(e),e=Lj(e,t),e=e.trim(),e}function cn(e){return!e||e.toLowerCase()==="x"||e==="*"}function mj(e){let t=e.match($P);if(!t){nn.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,i=t.groups.build,o=n.split("."),s=r?.split(".");return{op:void 0,version:n,versionSegments:o,versionSegmentCount:o.length,prerelease:r,prereleaseSegments:s,prereleaseSegmentCount:s?s.length:0,build:i}}function fj(e){if(!e)return{};let t=e.match(aj);if(!t)return nn.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,i=t.groups.prerelease,o=t.groups.build,s=r.split("."),c=i?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:s,versionSegmentCount:s.length,prerelease:i,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:o}}function Dy(e){return e==="*"||e==="x"||e==="X"}function KP(e){let t=parseInt(e,10);return isNaN(t)?e:t}function gj(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function _j(e,t){if(Dy(e)||Dy(t))return 0;let[n,r]=gj(KP(e),KP(t));return n>r?1:n<r?-1:0}function qP(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=_j(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var tk="[a-zA-Z0-9-]",nk="0|[1-9]\\d*",hj=`\\d*[a-zA-Z-]${tk}*`,bj="((?:<|>)?=?)",QP=`(?:${nk}|${hj})`,yj=`(?:-(${QP}(?:\\.${QP})*))`,JP=`${tk}+`,Sj=`(?:\\+(${JP}(?:\\.${JP})*))`,Uy=`${nk}|x|X|\\*`,Ul=`[v=\\s]*(${Uy})(?:\\.(${Uy})(?:\\.(${Uy})(?:${yj})?${Sj}?)?)?`,Ej=`^${bj}\\s*${Ul}$`,Tj=new RegExp(Ej),Ij=`^\\s*(${Ul})\\s+-\\s+(${Ul})\\s*$`,Aj=new RegExp(Ij),Nj="(?:~>?)",vj=`^${Nj}${Ul}$`,Rj=new RegExp(vj),Oj="(?:\\^)",Cj=`^${Oj}${Ul}$`,xj=new RegExp(Cj);function Pj(e){let t=Rj;return e.replace(t,(n,r,i,o,s)=>{let c;return cn(r)?c="":cn(i)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:cn(o)?c=`>=${r}.${i}.0 <${r}.${+i+1}.0-0`:s?c=`>=${r}.${i}.${o}-${s} <${r}.${+i+1}.0-0`:c=`>=${r}.${i}.${o} <${r}.${+i+1}.0-0`,c})}function kj(e,t){let n=xj,r=t?.includePrerelease?"-0":"";return e.replace(n,(i,o,s,c,a)=>{let l;return cn(o)?l="":cn(s)?l=`>=${o}.0.0${r} <${+o+1}.0.0-0`:cn(c)?o==="0"?l=`>=${o}.${s}.0${r} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.0${r} <${+o+1}.0.0-0`:a?o==="0"?s==="0"?l=`>=${o}.${s}.${c}-${a} <${o}.${s}.${+c+1}-0`:l=`>=${o}.${s}.${c}-${a} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${c}-${a} <${+o+1}.0.0-0`:o==="0"?s==="0"?l=`>=${o}.${s}.${c}${r} <${o}.${s}.${+c+1}-0`:l=`>=${o}.${s}.${c}${r} <${o}.${+s+1}.0-0`:l=`>=${o}.${s}.${c} <${+o+1}.0.0-0`,l})}function Lj(e,t){let n=Tj;return e.replace(n,(r,i,o,s,c,a)=>{let l=cn(o),p=l||cn(s),u=p||cn(c),d=u;return i==="="&&d&&(i=""),a=t?.includePrerelease?"-0":"",l?i===">"||i==="<"?r="<0.0.0-0":r="*":i&&d?(p&&(s=0),c=0,i===">"?(i=">=",p?(o=+o+1,s=0,c=0):(s=+s+1,c=0)):i==="<="&&(i="<",p?o=+o+1:s=+s+1),i==="<"&&(a="-0"),r=`${i+o}.${s}.${c}${a}`):p?r=`>=${o}.0.0${a} <${+o+1}.0.0-0`:u&&(r=`>=${o}.${s}.0${a} <${o}.${+s+1}.0-0`),r})}function Mj(e,t){let n=Aj;return e.replace(n,(r,i,o,s,c,a,l,p,u,d,m,_)=>(cn(o)?i="":cn(s)?i=`>=${o}.0.0${t?.includePrerelease?"-0":""}`:cn(c)?i=`>=${o}.${s}.0${t?.includePrerelease?"-0":""}`:a?i=`>=${i}`:i=`>=${i}${t?.includePrerelease?"-0":""}`,cn(u)?p="":cn(d)?p=`<${+u+1}.0.0-0`:cn(m)?p=`<${u}.${+d+1}.0-0`:_?p=`<=${u}.${d}.${m}-${_}`:t?.includePrerelease?p=`<${u}.${d}.${+m+1}-0`:p=`<=${p}`,`${i} ${p}`.trim()))}var ln=console.error.bind(console);function Dl(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var rs=(e,t,n)=>{if(!e||!e[t]){ln("no original function "+String(t)+" to wrap");return}if(!n){ln("no wrapper function"),ln(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ln("original object and wrapper must be functions");return}let i=n(r,t);return Dl(i,"__original",r),Dl(i,"__unwrap",()=>{e[t]===i&&Dl(e,t,r)}),Dl(i,"__wrapped",!0),Dl(e,t,i),i},By=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ln("must provide one or more modules to patch"),ln(new Error().stack);return}if(!(t&&Array.isArray(t))){ln("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(i=>{rs(r,i,n)})})},Ga=(e,t)=>{if(!e||!e[t]){ln("no function to unwrap."),ln(new Error().stack);return}let n=e[t];if(!n.__unwrap)ln("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}},Hy=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ln("must provide one or more modules to patch"),ln(new Error().stack);return}if(!(t&&Array.isArray(t))){ln("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{Ga(n,r)})})};function Bl(e){e&&e.logger&&(typeof e.logger!="function"?ln("new logger isn't a function, not replacing"):ln=e.logger)}Bl.wrap=rs;Bl.massWrap=By;Bl.unwrap=Ga;Bl.massUnwrap=Hy;at();var Kd=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=nn.createComponentLogger({namespace:t}),this._tracer=he.getTracer(t,n),this._meter=Kp.getMeter(t,n),this._logger=Xd.getLogger(t,n),this._updateMetricInstruments()}_wrap=rs;_unwrap=Ga;_massWrap=By;_massUnwrap=Hy;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,i){if(t)try{t(r,i)}catch(o){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},o)}}};var ok=Zp(Zy());import*as Xy from"path";var Qd=class{hooks=[];children=new Map},Jd=class{_trie=new Qd;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split("/")){let i=n.children.get(r);i||(i=new Qd,n.children.set(r,i)),n=i}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let i=this._trie,o=[],s=!0;for(let c of t.split("/")){let a=i.children.get(c);if(!a){s=!1;break}r||o.push(...a.hooks),i=a}return r&&s&&o.push(...i.hooks),o.length===0?[]:o.length===1?[o[0].hook]:(n&&o.sort((c,a)=>c.insertedId-a.insertedId),o.map(({hook:c})=>c))}};var Bj=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),$d=class e{_moduleNameTrie=new Jd;static _instance;constructor(){this._initialize()}_initialize(){new ok.Hook(null,{internals:!0},(t,n,r)=>{let i=Hj(n),o=this._moduleNameTrie.search(i,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:s}of o)t=s(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return Bj?new e:this._instance=this._instance??new e}};function Hj(e){return Xy.sep!=="/"?e.split(Xy.sep).join("/"):e}var yk=Zp(rS());at();var Sk=Zp(Zy());import{readFileSync as zj}from"fs";function qr(e,t,n){let r,i;try{i=e()}catch(o){r=o}finally{if(t(r,i),r&&!n)throw r;return i}}function w(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}var ae=class extends Kd{_modules;_hooks=[];_requireInTheMiddleSingleton=$d.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let i=this.init();i&&!Array.isArray(i)&&(i=[i]),this._modules=i||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if(w(t[n])&&this._unwrap(t,n),hk.isProxy(t)){let i=rs(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:i}),i}else return rs(t,n,r)};_unwrap=(t,n)=>hk.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):Ga(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{nn.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){nn.error("must provide one or more functions to wrap on modules");return}t.forEach(i=>{n.forEach(o=>{this._wrap(i,o,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{nn.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){nn.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(i=>{this._unwrap(r,i)})})};_warnOnPreloadedModules(){let t=globalThis.require;!t?.resolve||!t?.cache||this._modules.forEach(n=>{let{name:r}=n;try{let i=t.resolve(r);t.cache[i]?.loaded&&this._diag.warn(`Module ${r} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${r}`)}catch{}})}_extractPackageVersion(t){try{let n=zj(Ni.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{nn.warn("Failed extracting version",t)}}_onRequire(t,n,r,i){if(!i)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let o=this._extractPackageVersion(i);if(t.moduleVersion=o,t.name===r)return bk(t.supportedVersions,o,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:i}),t.patch(n,t.moduleVersion)):n;let s=t.files??[],c=Ni.normalize(r);return s.filter(l=>l.name===c&&bk(l.supportedVersions,o,t.includePrerelease)).reduce((l,p)=>(p.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:p.name,baseDir:i}),p.patch(l,t.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(s,c,a)=>{if(!a&&Ni.isAbsolute(c)){let l=Ni.parse(c);c=l.name,a=l.dir}return this._onRequire(t,s,c,a)},r=(s,c,a)=>this._onRequire(t,s,c,a),i=Ni.isAbsolute(t.name)?new Sk.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(i);let o=new yk.Hook([t.name],{internals:!0},n);this._hooks.push(o)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};function bk(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>zP(t,r,{includePrerelease:n}))}var re=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,r,i,o){this.files=o||[],this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=i}};var en=Ms(process.versions.node),Fa=en.major,iS=en.minor;import{errorMonitor as nZ}from"events";import*as Ek from"http";var rZ=en.major===22&&en.minor>=12||en.major===23&&en.minor>=2||en.major>=24;function is(e={}){let{outgoingRequestApplyCustomAttributes:t,...n}=e,r={propagateTrace:n.propagateTraceInOutgoingRequests??!0,applyCustomAttributesOnSpan:t,...n,spans:n.createSpansForOutgoingRequests!==!1&&(n.spans??!0),ignoreOutgoingRequests(i,o){return kr()||!!n.ignoreOutgoingRequests?.(i,Wd(o))},outgoingRequestHook(i,o){n.outgoingRequestHook?.(i,o);let s=o.once,c=new Proxy(s,{apply(a,l,p){let[u]=p;if(u!=="response")return a.apply(l,p);let d=pe.active(),m=he.setSpan(d,i);return pe.with(m,()=>a.apply(l,p))}});o.once=c},outgoingResponseHook(i,o){n.outgoingResponseHook?.(i,o)},errorMonitor:nZ,http:Ek};rZ?iZ(r):oZ(r)}var oS;function iZ(e){let{[Kr]:t}=Ll(e);oS&&tZ(Kr,oS),eZ(Kr,t),oS=t}function oZ(e){Py(Ek,e)}var Tk="Http";Object.assign(is,{id:`${Tk}.sentry`});var Ik=(e={})=>{let t=e.spans??!1,n=e.disableIncomingRequestSpans??!1,r=t&&!n,i={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},o={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes},s={breadcrumbs:e.breadcrumbs,propagateTraceInOutgoingRequests:e.tracePropagation??!0,ignoreOutgoingRequests:e.ignoreOutgoingRequests,spans:t},c=ka(i),a=La(o);return{name:Tk,setup(l){r&&a.setup(l)},setupOnce(){c.setupOnce(),is(s)},processEvent(l){return a.processEvent(l)}}};import*as em from"diagnostics_channel";import{URL as uZ}from"url";var sS="sentry-trace",zd="baggage",sZ="traceparent";function lS(e,t,n){let r=Nk(e.origin,e.path),{tracePropagationTargets:i,propagateTraceparent:o}=C()?.getOptions()||{};if(!qo(r,i,t))return;let s=n&&Lr(n)&&Q()?void 0:n,c=s?se(s,()=>$e({propagateTraceparent:o})):$e({propagateTraceparent:o});if(!c)return;let{"sentry-trace":a,baggage:l,traceparent:p}=c,u=Array.isArray(e.headers)?aZ(e.headers):cZ(e.headers);if(aS(u,sS),aS(u,zd),o&&aS(u,sZ),!(cS(u,sS)!==-1)){a&&u.push(sS,a),p&&cS(u,"traceparent")===-1&&u.push("traceparent",p);let m=cS(u,zd);if(l&&m===-1)u.push(zd,l);else if(l){let _=u[m+1],h=Ws(_,l);h&&(u[m+1]=h)}}Array.isArray(e.headers)?e.headers.splice(0,e.headers.length,...u):e.headers=lZ(u)}function aZ(e){let t=[];for(let n=0;n<e.length;n++){let r=e[n];n%2===0?t.push(typeof r=="string"?r:String(r)):t.push(Array.isArray(r)?r.join(", "):r??"")}return t}function cZ(e){let t=e.split(`\r
|
|
22
|
+
`),n=[];for(let r of t)try{let i=r.indexOf(":");if(i===-1)continue;let o=r.slice(0,i).trim(),s=r.slice(i+1).trim();o&&n.push(o,s)}catch{g.warn(`Failed to convert string request header to array header: ${r}`)}return n}function lZ(e){let t=[];for(let n=0;n<e.length;n+=2){let r=e[n],i=e[n+1];!r||i==null||t.push(`${r}: ${i}`)}return t.length?t.join(`\r
|
|
23
|
+
`).concat(`\r
|
|
24
|
+
`):""}function aS(e,t){let n=-1;for(let r=0;r<e.length;r+=2){if(e[r]!==t)continue;if(n===-1){n=r;continue}let i=e[n+1];if(t===zd&&i){let o=Ws(e[r+1],i);o&&(e[n+1]=o)}e.splice(r,2),r-=2}}function cS(e,t){return e.findIndex((n,r)=>r%2===0&&n===t)}function Ak(e,t){let n=pZ(e),r=t.statusCode,i=vl(r);on({category:"http",data:{status_code:r,...n},type:"http",level:i},{event:"response",request:e,response:t})}function pZ(e){try{let t=Nk(e.origin,e.path),n=Ki(t),r={url:qi(n),"http.method":e.method||"GET"};return n.search&&(r["http.query"]=Wn(n.search)),n.hash&&(r["http.fragment"]=n.hash),r}catch{return{}}}function Nk(e,t="/"){try{return new URL(t,e).toString()}catch{let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}}var dZ="http.request.method_original",pS=[],os=new WeakMap,Rk=new WeakMap,vk=new Wt(100);function Vl(e={}){pS.length||(Wl("undici:request:create",t=>mZ(e,t)),Wl("undici:client:sendHeaders",t=>fZ(e,t)),Wl("undici:request:headers",t=>gZ(e,t)),Wl("undici:request:trailers",t=>_Z(t)),Wl("undici:request:error",t=>hZ(t)))}function uS(e,t){try{return e()}catch(n){t(n);return}}function Wl(e,t){let[n=0,r=0]=process.version.replace("v","").split(".").map(o=>Number(o));n>18||n===18&&r>=19?pS.push(em.subscribe?.(e,t)):pS.push(em.channel(e).subscribe(t))}function Ok(e){let t=new Map;if(Array.isArray(e.headers))for(let n=0;n<e.headers.length;n+=2){let r=e.headers[n],i=e.headers[n+1];typeof r=="string"&&i!==void 0&&t.set(r.toLowerCase(),i)}else if(typeof e.headers=="string"){let n=e.headers.split(`\r
|
|
25
|
+
`);for(let r of n){if(!r)continue;let i=r.indexOf(":");if(i===-1)continue;let o=r.substring(0,i).toLowerCase(),s=r.substring(i+1).trim(),c=t.get(o);c&&Array.isArray(c)?c.push(s):c?t.set(o,[c,s]):t.set(o,s)}}return t}function mZ(e,{request:t}){let n=yZ(t.origin,t.path),r=uS(()=>!!e.ignoreOutgoingRequests?.(n),b=>b&&We&&g.error("caught ignoreOutgoingRequests error: ",b)),i=kr()||!!r;if(Rk.set(t,i),!e.spans){e.tracePropagation!==!1&&!i&&lS(t,vk);return}if(t.method==="CONNECT"||r)return;let o;try{o=new uZ(t.path,t.origin)}catch(b){We&&g.warn("could not determine url.full:",b);return}let s=o.protocol.replace(":",""),c=bZ(t.method),a={[Ur]:c,[dZ]:t.method,[pt]:Ct(o.toString()),[Zi]:o.pathname,[Ru]:Wn(o.search),[b0]:s,[S]:"auto.http.otel.node_fetch"};if(n.startsWith("data:")){let b=el(n);a["http.url"]=b,a[pt]=b,a[gn]=`${t.method||"GET"} ${b}`}let l={https:"443",http:"80"},p=o.hostname,u=o.port||l[s];a[_t]=p,u&&!isNaN(Number(u))&&(a[ht]=Number(u));let m=Ok(t).get("user-agent");if(m){let b=Array.isArray(m)?m[m.length-1]:m;a[y0]=b}let _=C(),h=k({name:c==="_OTHER"?"HTTP":c,kind:U.CLIENT,attributes:a,onlyIfParent:!_||!rt(_)});uS(()=>e.requestHook?.(h,t),b=>b&&We&&g.error("caught requestHook error: ",b)),lS(t,vk,h),os.set(t,h)}function fZ(e,{request:t,socket:n}){let r=os.get(t);if(!r)return;let{remoteAddress:i,remotePort:o}=n,s={[e0]:i,[t0]:o};if(e.headersToSpanAttributes?.requestHeaders){let c=new Set(e.headersToSpanAttributes.requestHeaders.map(l=>l.toLowerCase())),a=Ok(t);for(let[l,p]of a.entries())if(c.has(l)){let u=Array.isArray(p)?p:[p];s[`http.request.header.${l}`]=u}}r.setAttributes(s)}function gZ(e,{request:t,response:n}){e.breadcrumbs!==!1&&!Rk.get(t)&&Ak(t,n);let i=os.get(t);if(!i)return;let o={[hn]:n.statusCode};if(uS(()=>e.responseHook?.(i,{request:t,response:n}),s=>s&&We&&g.error("caught responseHook error: ",s)),e.headersToSpanAttributes?.responseHeaders){let s=new Set;e.headersToSpanAttributes?.responseHeaders.forEach(c=>s.add(c.toLowerCase()));for(let c=0;c<n.headers.length;c=c+2){let a=n.headers[c],l=n.headers[c+1];if(a===void 0||l===void 0)continue;let p=a.toString().toLowerCase(),u=l;if(s.has(p)){let d=`http.response.header.${p}`;Object.prototype.hasOwnProperty.call(o,d)?o[d].push(u.toString()):o[d]=[u.toString()]}}}i.setAttributes(o),n.statusCode>=400&&i.setStatus(Xt(n.statusCode))}function _Z({request:e}){let t=os.get(e);t&&(t.end(),os.delete(e))}function hZ({request:e,error:t}){let n=os.get(e);n&&(n.setStatus({code:2,message:t.message}),n.end(),os.delete(e))}function bZ(e){let t={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return e.toUpperCase()in t?e.toUpperCase():"_OTHER"}function yZ(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}var SZ=((e={})=>({name:"NodeFetch",setupOnce(){Vl(e)}})),Ck=SZ;at();at();QN();var AS="sentry.parentIsRemote",ss="sentry.graphql.operation";function NS(e){if("parentSpanId"in e)return e.parentSpanId;if("parentSpanContext"in e)return e.parentSpanContext?.spanId}function im(e){return V(e.attributes)}function Mk(e){return typeof e.kind=="number"}function wk(e){return!!e.status}function dS(e){return!!e.name}function Gk(e){if(!im(e))return{};let t=e.attributes[pt]||e.attributes[yi],n={url:t,"http.method":e.attributes[Ur]||e.attributes[Gr]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof t=="string"){let r=Ki(t);n.url=qi(r);let i=Wn(r.search);i&&(n["http.query"]=i),r.hash&&(n["http.fragment"]=r.hash)}}catch{}return n}function Uk(e){return Mk(e)?e.kind:vt.INTERNAL}var tm="sentry-trace",mS="baggage",om="sentry.dsc",vS="sentry.sampled_not_recording",Dk="sentry.url",EZ="sentry.sample_rand",TZ="sentry.sample_rate",sm="sentry.ignored",Bk="sentry.segment_ignored",am=xo("sentry_scopes"),fS=xo("sentry_fork_isolation_scope"),gS=xo("sentry_fork_set_scope"),nm=xo("sentry_fork_set_isolation_scope"),Hk="_scopeContext";function as(e){return e.getValue(am)}function Fk(e,t){return e.setValue(am,t)}function IZ(e,t){we(e,Hk,Lo(t))}function Wa(e){return Mo(e[Hk])}function Va(e){let{traceFlags:t,traceState:n}=e,r=n?n.get(vS)==="1":!1;if(t===Ir.SAMPLED)return!0;if(r)return!1;let i=n?n.get(om):void 0,o=i?rr(i):void 0;if(o?.sampled==="true")return!0;if(o?.sampled==="false")return!1}function Wk(e,t){let n=e.spanContext(),r=Re(e),i=Va(n);if(i!==void 0)return i;if(Lr(r))return!1;if(!(!Ue(t?.getOptions())||n.isRemote||!Lc(r)))return Qt(e)}function jl(e,t,n){let r=t[Ur]||t[Gr];if(r)return NZ({attributes:t,name:e,kind:n},r);let i=t[mt]||t[Pe],o=typeof t[B]=="string"&&t[B].startsWith("cache.");if(i&&!o)return AZ({attributes:t,name:e});let s=t[ve]==="custom"?"custom":"route";if(t[vu])return{...Yl(e,t,"route"),op:"rpc"};if(t[wt])return{...Yl(e,t,s),op:"message"};let l=t[Su];return l?{...Yl(e,t,s),op:l.toString()}:{op:void 0,description:e,source:"custom"}}function Vk(e){let t,n;if(im(e))t=e.attributes,n=dS(e)?e.name:"<unknown>";else{let i=typeof e.spanContext=="function"?oe(e):void 0;t=i?.data||{},n=dS(e)?e.name:i?.description||"<unknown>"}let r=Uk(e);return jl(n,t,r)}function AZ({attributes:e,name:t}){let n=e[gn];if(typeof n=="string")return{op:"db",description:n,source:e[ve]||"custom"};if(e[ve]==="custom")return{op:"db",description:t,source:"custom"};let r=e[Ve];return{op:"db",description:r?r.toString():t,source:"task"}}function NZ({name:e,kind:t,attributes:n},r){let i=["http"];switch(t){case vt.CLIENT:i.push("client");break;case vt.SERVER:i.push("server");break}n["sentry.http.prefetch"]&&i.push("prefetch");let{urlPath:o,url:s,query:c,fragment:a,hasRoute:l}=RZ(n,t);if(!o)return{...Yl(e,n),op:i.join(".")};let p=n[ss],u=`${r} ${o}`,d=p?`${u} (${vZ(p)})`:u,m=l||o==="/"?"route":"url",_={};s&&(_.url=Ct(s));let h=Wn(c);h&&(_["http.query"]=h.slice(1)),a&&(_["http.fragment"]=a.slice(1));let b=t===vt.CLIENT||t===vt.SERVER,M=!`${n[S]||"manual"}`.startsWith("auto"),R=n[ve]==="custom",v=n[gn],P=!R&&v==null&&(b||!M),{description:D,source:I}=P?{description:d,source:m}:Yl(e,n);return{op:i.join("."),description:D,source:I,data:_}}function vZ(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}function RZ(e,t){let n=e[Au],r=e[yi]||e[pt],i=e[He],o=typeof r=="string"?Ki(r):void 0,s=o?qi(o):void 0,c=o?.search||void 0,a=o?.hash||void 0;return typeof i=="string"?{urlPath:i,url:s,query:c,fragment:a,hasRoute:!0}:t===vt.SERVER&&typeof n=="string"?{urlPath:dr(n),url:s,query:c,fragment:a,hasRoute:!1}:o?{urlPath:s,url:s,query:c,fragment:a,hasRoute:!1}:typeof n=="string"?{urlPath:dr(n),url:s,query:c,fragment:a,hasRoute:!1}:{urlPath:void 0,url:s,query:c,fragment:a,hasRoute:!1}}function Yl(e,t,n="custom"){let r=t[ve]||n,i=t[gn];return i&&typeof i=="string"?{description:i,source:r}:{description:e,source:r}}function RS(e){e.on("createDsc",(t,n)=>{if(!n)return;let r=oe(n),o=r.data[ve],s=Wk(n,e);if(s===!1)delete t.transaction;else if(r.description){let{description:c}=Vk(n);o!=="url"&&c&&(t.transaction=c)}Ue()&&(t.sampled=s==null?void 0:String(s))})}function OS(){return he.getActiveSpan()}var ao=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__,rm=class e{constructor(){this._internalState=new Map}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reverse().map(t=>`${t}=${this._internalState.get(t)}`).join(",")}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};function Yk({dsc:e,sampled:t}){let n=e?Hi(e):void 0,r=new rm,i=n?r.set(om,n):r;return t===!1?i.set(vS,"1"):i}var jk=new Set;function CS(){return Array.from(jk)}function cs(e){jk.add(e)}var Ya=class extends KN{constructor(){super(),cs("SentryPropagator"),this._urlMatchesTargetsMap=new Wt(100)}inject(t,n,r){if(Os(t)){ao&&g.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let i=he.getSpan(t),o=i&&PZ(i),{tracePropagationTargets:s,propagateTraceparent:c}=C()?.getOptions()||{};if(!qo(o,s,this._urlMatchesTargetsMap)){ao&&g.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",o);return}let a=CZ(n),l=xZ(n),p=ci.getBaggage(t)||ci.createBaggage({}),{dynamicSamplingContext:u,traceId:d,spanId:m,sampled:_}=Zk(t);if(a){let h=Fs(a);h&&Object.entries(h).forEach(([b,N])=>{!l&&b.startsWith(ui)||(p=p.setEntry(b,{value:N}))})}!l&&u&&(p=Object.entries(u).reduce((h,[b,N])=>N?h.setEntry(`${ui}${b}`,{value:N}):h,p)),!l&&d&&d!==XN&&(r.set(n,tm,Fi(d,m,_)),c&&r.set(n,"traceparent",Wi(d,m,_))),super.inject(ci.setBaggage(t,p),n,r)}extract(t,n,r){let i=r.get(n,tm),o=r.get(n,mS),s=i?Array.isArray(i)?i[0]:i:void 0;return Kk(Xk(t,{sentryTrace:s,baggage:o}))}fields(){return[tm,mS,"traceparent"]}};function Zk(e,t={}){let n=he.getSpan(e);if(n?.spanContext().isRemote){let c=n.spanContext();return{dynamicSamplingContext:nt(n),traceId:c.traceId,spanId:void 0,sampled:Va(c)}}if(n){let c=n.spanContext();return{dynamicSamplingContext:nt(n),traceId:c.traceId,spanId:c.spanId,sampled:Wk(n,t.client)}}let r=t.scope||as(e)?.scope||ne(),i=t.client||C(),o=r.getPropagationContext();return{dynamicSamplingContext:i?or(i,r):void 0,traceId:o.traceId,spanId:o.propagationSpanId,sampled:o.sampled}}function Xk(e,{sentryTrace:t,baggage:n}){let r=In(t,n),{traceId:i,parentSpanId:o,sampled:s,dsc:c}=r,a=C(),l=rr(n);if(!o||a&&!Cc(a,l?.org_id))return e;let p=kZ({traceId:i,spanId:o,sampled:s,dsc:c});return he.setSpanContext(e,p)}function OZ(e,t,n){let r=Kk(Xk(e,t));return pe.with(r,n)}function Kk(e){let t=as(e),n={scope:t?t.scope:ne().clone(),isolationScope:t?t.isolationScope:J()};return Fk(e,n)}function CZ(e){try{let t=e[mS];return Array.isArray(t)?t.join(","):t}catch{return}}function xZ(e){try{return e[tm]}catch{return}}function PZ(e){let t=oe(e).data,n=t[yi]||t[pt];if(typeof n=="string")return n;let r=e.spanContext().traceState?.get(Dk);if(r)return r}function kZ({spanId:e,traceId:t,sampled:n,dsc:r}){let i=Yk({dsc:r,sampled:n});return{traceId:t,spanId:e,isRemote:!0,traceFlags:n?Ir.SAMPLED:Ir.NONE,traceState:i}}function qk(e,t,n){let r=zk(),{name:i,parentSpan:o}=e;return iL(o)(()=>{let c=nL(e.scope,e.forceTransaction),a=e.onlyIfParent&&!he.getSpan(c),l=a?Rs(c):c;a&&C()?.recordDroppedEvent("no_parent_span","span");let p=eL(e);if(!Ue()){let u=Os(l)?l:Rs(l);return pe.with(u,()=>r.startActiveSpan(i,p,u,d=>(_S(d),pe.with(c,()=>sr(()=>t(d),()=>{oe(d).status===void 0&&d.setStatus({code:Gn.ERROR})},n?()=>d.end():void 0)))))}return r.startActiveSpan(i,p,l,u=>(_S(u),sr(()=>t(u),()=>{oe(u).status===void 0&&u.setStatus({code:Gn.ERROR})},n?()=>u.end():void 0)))})}function Qk(e,t){return qk(e,t,!0)}function Jk(e,t){return qk(e,n=>t(n,()=>n.end()),!1)}function $k(e){let t=zk(),{name:n,parentSpan:r}=e;return iL(r)(()=>{let o=nL(e.scope,e.forceTransaction),s=e.onlyIfParent&&!he.getSpan(o),c=s?Rs(o):o;s&&C()?.recordDroppedEvent("no_parent_span","span");let a=eL(e);Ue()||(c=Os(c)?c:Rs(c));let l=t.startSpan(n,a,c);return _S(l),l})}function xS(e,t){let n=e?he.setSpan(pe.active(),e):he.deleteSpan(pe.active());return pe.with(n,()=>t(ne()))}function zk(){return C()?.tracer||he.getTracer("@sentry/opentelemetry",q)}function eL(e){let{startTime:t,attributes:n,kind:r,op:i,links:o}=e,s=typeof t=="number"?tL(t):t;return{attributes:i?{[B]:i,...n}:n,kind:r,links:o,startTime:s}}function tL(e){return e<9999999999?e*1e3:e}function _S(e){let t=e.end.bind(e);e.end=n=>t(typeof n=="number"?tL(n):n)}function nL(e,t){let n=LZ(e),r=he.getSpan(n);if(!r||!t)return n;let i=he.deleteSpan(n),{spanId:o,traceId:s}=r.spanContext(),c=Va(r.spanContext()),a=Re(r),l=nt(a),p=Yk({dsc:l,sampled:c}),u={traceId:s,spanId:o,isRemote:!0,traceFlags:c?Ir.SAMPLED:Ir.NONE,traceState:p};return he.setSpanContext(i,u)}function LZ(e){if(e){let t=Wa(e);if(t)return t}return pe.active()}function rL(e,t){return OZ(pe.active(),e,t)}function MZ(e){let t=yt(),n=jt(),r={traceId:t,spanId:n,isRemote:!0,traceFlags:Ir.NONE},i=he.setSpanContext(pe.active(),r);return pe.with(i,()=>(ne().setPropagationContext({traceId:t,sampleRand:ct()}),e()))}function PS(e,t){let n=Wa(t),r=n&&he.getSpan(n),i=r?xr(r):Go(t);return[r?nt(r):or(e,t),i]}function iL(e){return e!==void 0?t=>xS(e,t):t=>t()}function oL(e){let t=Rs(pe.active());return pe.with(t,e)}function wZ(e){let t=e?Wa(e):pe.active();return t?Os(t):!1}function kS(e){e.on("preprocessEvent",t=>{let n=OS();if(!n||t.type==="transaction")return;t.contexts={trace:xr(n),...t.contexts};let r=Re(n);return t.sdkProcessingMetadata={dynamicSamplingContext:nt(r),...t.sdkProcessingMetadata},t})}function sL(e,t){let n=he.getSpan(e),r;if(n?.spanContext().traceState?.get(sm)==="1"){let h=he.deleteSpan(e),b=he.getSpan(t);r=b?he.setSpan(h,b):h}else r=e;let i=as(r),o=i?.scope||ne(),s=i?.isolationScope||J(),c=r.getValue(fS)===!0,a=r.getValue(gS),l=r.getValue(nm),p=a||o.clone(),u=l||(c?s.clone():s),_=Fk(r,{scope:p,isolationScope:u}).deleteValue(fS).deleteValue(gS).deleteValue(nm);return IZ(p,_),_}function GZ(e){let t=new Map;for(let n of e)UZ(t,n);return Array.from(t,function([n,r]){return r})}function aL(e){return e.attributes[AS]===!0?void 0:NS(e)}function UZ(e,t){let n=t.spanContext().spanId,r=aL(t);if(!r){hS(e,{id:n,span:t,children:[]});return}let i=DZ(e,r),o=hS(e,{id:n,span:t,parentNode:i,children:[]});i.children.push(o)}function DZ(e,t){let n=e.get(t);return n||hS(e,{id:t,children:[]})}function hS(e,t){let n=e.get(t.id);return n?.span?n:n&&!n.span?(n.span=t.span,n.parentNode=t.parentNode,n):(e.set(t.id,t),t)}var cL={1:"cancelled",2:"unknown_error",3:"invalid_argument",4:"deadline_exceeded",5:"not_found",6:"already_exists",7:"permission_denied",8:"resource_exhausted",9:"failed_precondition",10:"aborted",11:"out_of_range",12:"unimplemented",13:"internal_error",14:"unavailable",15:"data_loss",16:"unauthenticated"},lL=e=>Object.values(cL).includes(e);function pL(e){let t=im(e)?e.attributes:{},n=wk(e)?e.status:void 0;if(n){if(n.code===Gn.OK)return{code:1};if(n.code===Gn.ERROR){if(typeof n.message>"u"){let i=bS(t);if(i)return i}return n.message&&lL(n.message)?{code:2,message:n.message}:{code:2,message:"internal_error"}}}let r=bS(t);return r||(n?.code===Gn.UNSET?{code:1}:{code:2,message:"unknown_error"})}function bS(e){let t=e[hn]||e[bi],n=e[a0],r=typeof t=="number"?t:typeof t=="string"?parseInt(t):void 0;if(typeof r=="number")return Xt(r);if(typeof n=="string")return{code:2,message:cL[n]||"unknown_error"}}var xk=1e3,BZ=300,HZ=1e4,yS=class{constructor(t){this._finishedSpanBucketSize=t?.timeout||BZ,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(tt()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Wt(HZ),this._debouncedFlush=Fc(this.flush.bind(this),1,{maxWait:100})}export(t){let n=Math.floor(tt()/1e3);if(this._lastCleanupTimestampInS!==n){let s=0;this._finishedSpanBuckets.forEach((c,a)=>{c&&c.timestampInS<=n-this._finishedSpanBucketSize&&(s+=c.spans.size,this._finishedSpanBuckets[a]=void 0)}),s>0&&ao&&g.log(`SpanExporter dropped ${s} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let r=n%this._finishedSpanBucketSize,i=this._finishedSpanBuckets[r]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[r]=i,i.spans.add(t),this._spansToBucketEntry.set(t,i);let o=aL(t);(!o||this._sentSpans.get(o))&&this._debouncedFlush()}flush(){let t=this._finishedSpanBuckets.flatMap(o=>o?Array.from(o.spans):[]),n=this._maybeSend(t),r=n.size,i=t.length-r;ao&&g.log(`SpanExporter exported ${r} spans, ${i} spans are waiting for their parent spans to finish`);for(let o of n){this._sentSpans.set(o.spanContext().spanId,1);let s=this._spansToBucketEntry.get(o);s&&s.spans.delete(o)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(t){let n=GZ(t),r=new Set,i=this._getCompletedRootNodes(n);for(let o of i){let s=o.span;r.add(s);let c=WZ(s);if(o.parentNode&&this._sentSpans.get(o.parentNode.id)){let u=c.contexts?.trace?.data;u&&(u["sentry.parent_span_already_sent"]=!0)}let a=c.spans||[],l=!1;for(let u of o.children)SS(u,a,r)&&(l=!0);c.spans=a.length>xk?a.sort((u,d)=>u.start_timestamp-d.start_timestamp).slice(0,xk):a,l&&(c.sdkProcessingMetadata={...c.sdkProcessingMetadata,hasGenAiSpans:!0});let p=Fo(s.events);p&&(c.measurements=p),Xc(c)}return r}_nodeIsCompletedRootNodeOrHasSentParent(t){return!!t.span&&(!t.parentNode||!!this._sentSpans.get(t.parentNode.id))}_getCompletedRootNodes(t){return t.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function FZ(e){let t=e.attributes,n=t[S],r=t[B],i=t[ve];return{origin:n,op:r,source:i}}function WZ(e){let{op:t,description:n,data:r,origin:i="manual",source:o}=uL(e),s=Kt(e),c=e.attributes[Hn],a={[ve]:o,[Hn]:c,[B]:t,[S]:i,...r,...dL(e.attributes)},{links:l}=e,{traceId:p,spanId:u}=e.spanContext(),d=NS(e),m=pL(e),_={parent_span_id:d,span_id:u,trace_id:p,data:a,origin:i,op:t,status:Bo(m),links:Do(l)},h=a[hn],b=typeof h=="number"?{response:{status_code:h}}:void 0;return{contexts:{trace:_,otel:{resource:e.resource.attributes},...b},spans:[],start_timestamp:qt(e.startTime),timestamp:qt(e.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:s.scope,capturedSpanIsolationScope:s.isolationScope,sampleRate:c,dynamicSamplingContext:nt(e)},...o&&{transaction_info:{source:o}}}}function SS(e,t,n){let r=e.span;if(r&&n.add(r),!r){let v=!1;return e.children.forEach(P=>{SS(P,t,n)&&(v=!0)}),v}let o=r.spanContext().spanId,s=r.spanContext().traceId,c=NS(r),{attributes:a,startTime:l,endTime:p,links:u}=r,{op:d,description:m,data:_,origin:h="manual"}=uL(r),b={[S]:h,[B]:d,...dL(a),..._},N=pL(r),M={span_id:o,trace_id:s,data:b,description:m,parent_span_id:c,start_timestamp:qt(l),timestamp:qt(p)||void 0,status:Bo(N),op:d,origin:h,measurements:Fo(r.events),links:Do(u)};t.push(M);let R=!!d?.startsWith("gen_ai.");return e.children.forEach(v=>{SS(v,t,n)&&(R=!0)}),R}function uL(e){let{op:t,source:n,origin:r}=FZ(e),{op:i,description:o,source:s,data:c}=Vk(e),a=t||i,l=n||s,p={...c,...VZ(e)};return{op:a,description:o,source:l,origin:r,data:p}}function dL(e){let t={...e};return delete t[Hn],delete t[AS],delete t[gn],t}function VZ(e){let t=e.attributes,n={};e.kind!==vt.INTERNAL&&(n["otel.kind"]=vt[e.kind]);let r=t[bi];r&&(n[hn]=r);let i=Gk(e);return i.url&&(n.url=i.url),i["http.query"]&&(n["http.query"]=i["http.query"].slice(1)),i["http.fragment"]&&(n["http.fragment"]=i["http.fragment"].slice(1)),n}function cm(e,t){let n=e.attributes??{},r=t?.spanKind??U.INTERNAL,{op:i,description:o,source:s,data:c}=jl(e.name,n,r);e.name=o,Gt(e,{[B]:i,[ve]:s,[u0]:"manual",...c}),r!==U.INTERNAL&&Gt(e,{"otel.kind":fb(r)})}var Zl=class{constructor(t){this._unsubscribePreprocessSpan=void 0,cs("SentrySpanProcessor"),this._exporter=new yS(t),this._client=t?.client??C(),this._client&&rt(this._client)&&(this._unsubscribePreprocessSpan=this._client.on("preprocessSpan",cm))}async forceFlush(){this._exporter.flush()}async shutdown(){this._unsubscribePreprocessSpan?.(),this._exporter.clear()}onStart(t,n){let r=he.getSpan(n),i=as(n);r&&!r.spanContext().isRemote&&di(r,t),r?.spanContext().isRemote&&t.setAttribute(AS,!0),n===Xp&&(i={scope:ws(),isolationScope:Rt()}),i&&Or(t,i.scope,i.isolationScope),Uc(t),this._client?.emit("spanStart",t)}onEnd(t){Dc(t),this._client?.emit("spanEnd",t),this._client&&rt(this._client)?this._client.emit("afterSpanEnd",t):this._exporter.export(t)}},Xl=class{constructor(t){this._client=t,this._isSpanStreaming=rt(t),cs("SentrySampler")}shouldSample(t,n,r,i,o,s){let c=this._client.getOptions(),{ignoreSpans:a}=c,l=ZZ(t),p=l?.spanContext();if(!Ue(c))return vi({decision:void 0,context:t,spanAttributes:o});let u=o[Gr]||o[Ur];if(i===vt.CLIENT&&u&&(!l||p?.isRemote)&&!this._isSpanStreaming)return this._client.recordDroppedEvent("no_parent_span","span"),vi({decision:void 0,context:t,spanAttributes:o});let d=l?YZ(l,n,r):void 0;if(!(!l||p?.isRemote)){if(this._isSpanStreaming){if(d&&a?.length){let{description:ce,op:ge}=jl(r,o,i);if(ir({description:ce,op:o[B]??ge,attributes:o},a))return this._client.recordDroppedEvent("ignored","span"),vi({decision:Ar.NOT_RECORD,context:t,spanAttributes:o,ignoredChildSpan:!0})}if(!d){let ce=p?.traceState?.get(Bk)==="1";this._client.recordDroppedEvent(ce?"ignored":"sample_rate","span")}}return vi({decision:d?Ar.RECORD_AND_SAMPLED:Ar.NOT_RECORD,context:t,spanAttributes:o})}let{description:_,data:h,op:b}=jl(r,o,i),N={...h,...o};if(b&&(N[B]=b),this._isSpanStreaming&&a?.length&&ir({description:_,op:N[B]??b,attributes:N},a))return this._client.recordDroppedEvent("ignored","span"),vi({decision:Ar.NOT_RECORD,context:t,spanAttributes:o,ignoredSegmentSpan:!0});let M={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:N,spanName:_,parentSampled:d,parentContext:p},M),!M.decision)return vi({decision:void 0,context:t,spanAttributes:o});let{isolationScope:R}=as(t)??{},v=p?.traceState?p.traceState.get(om):void 0,P=v?rr(v):void 0,D=Tn(P?.sample_rand)??ct(),[I,H,L]=Hc(c,{name:_,attributes:N,normalizedRequest:R?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:Tn(P?.sample_rate)},D),G=`${u}`.toUpperCase();return G==="OPTIONS"||G==="HEAD"?(ao&&g.log(`[Tracing] Not sampling span because HTTP method is '${G}' for ${r}`),vi({decision:Ar.NOT_RECORD,context:t,spanAttributes:o,sampleRand:D,downstreamTraceSampleRate:0})):(!I&&d===void 0&&(ao&&g.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate",this._isSpanStreaming?"span":"transaction")),{...vi({decision:I?Ar.RECORD_AND_SAMPLED:Ar.NOT_RECORD,context:t,spanAttributes:o,sampleRand:D,downstreamTraceSampleRate:L?H:void 0}),attributes:{[Hn]:L?H:void 0}})}toString(){return"SentrySampler"}};function YZ(e,t,n){let r=e.spanContext();if(l_(r)&&r.traceId===t){if(r.isRemote){let o=Va(e.spanContext());return ao&&g.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${o}`),o}let i=Va(r);return ao&&g.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${i}`),i}}function vi({decision:e,context:t,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:i,ignoredChildSpan:o,ignoredSegmentSpan:s}){let c=jZ(t,n);return i!==void 0&&(c=c.set(TZ,`${i}`)),r!==void 0&&(c=c.set(EZ,`${r}`)),o&&(c=c.set(sm,"1")),s&&(c=c.set(Bk,"1")),e==null?{decision:Ar.NOT_RECORD,traceState:c}:e===Ar.NOT_RECORD?{decision:e,traceState:c.set(vS,"1")}:{decision:e,traceState:c}}function jZ(e,t){let i=he.getSpan(e)?.spanContext()?.traceState||new rm,o=t[yi]||t[pt];return o&&typeof o=="string"&&(i=i.set(Dk,o)),i}function ZZ(e){let t=he.getSpan(e);return t&&l_(t.spanContext())?t:void 0}function lm(e,t={}){let n=oe(e),r=n.data,i=e.kind??vt.INTERNAL,o=Hs(e),s=r[gn]!==void 0,c=o&&!s&&!X_(e),a=c&&r[ve]==="custom"?{...r,[ve]:void 0}:r,l=jl(n.description||"<unknown>",a,i);if(i!==vt.INTERNAL&&r["otel.kind"]===void 0&&e.setAttribute("otel.kind",vt[i]),l.op&&r[B]===void 0&&e.setAttribute(B,l.op),l.source!==void 0&&l.source!=="custom"&&(t.finalizeStatus||l.source!=="url")&&(n.parent_span_id===void 0||i===vt.SERVER)&&(r[ve]===void 0||c)&&e.setAttribute(ve,l.source),l.data&&Object.entries(l.data).forEach(([u,d])=>{d!==void 0&&r[u]===void 0&&e.setAttribute(u,d)}),t.finalizeStatus){qZ(e,r);let u=C();KZ(e,r,n.status,!!u&&rt(u))}o&&l.description!==n.description&&(r[ve]!=="custom"||c)&&e.updateName(l.description)}function XZ(e,t){we(e,"kind",t??vt.INTERNAL)}function KZ(e,t,n,r){if(n===void 0){e.setStatus(bS(t)||{code:1});return}!r&&n!=="ok"&&!lL(n)&&e.setStatus({code:2,message:"internal_error"})}function qZ(e,t){let n=t[bi];t[hn]===void 0&&n!==void 0&&(e.setAttribute(hn,n),t[hn]=n)}var ES=class{startSpan(t,n={},r){let i=r||pe.active(),o=n.root?void 0:he.getSpan(i);if(Os(i))return this._createNonRecordingSpan(o);let s=this._startSentrySpan(t,n,o,r!==void 0);return K_(s),XZ(s,n.kind),n.attributes?.[ve]===void 0&&j_(s),lm(s),s}startActiveSpan(t,n,r,i){let o=typeof n=="function"?{}:n,s=typeof r=="function"||r===void 0?pe.active():r,c=typeof n=="function"?n:typeof r=="function"?r:i,a=this.startSpan(t,o,s),l=Kt(a).isolationScope,p=u=>l?u.setValue(nm,l):u;return Lr(a)&&he.getSpan(s)?pe.with(p(s),()=>c(a)):pe.with(p(he.setSpan(s,a)),()=>(Bn(ne(),a),c(a)))}_startSentrySpan(t,n,r,i){let o={name:t,attributes:n.attributes,links:n.links,startTime:n.startTime};return n.root?Nn(()=>Xs({...o,parentSpan:null})):r?.spanContext().isRemote?this._startRootSpanWithRemoteParent(o,r):r?Xs({...o,parentSpan:r}):Nn(()=>Xs({...o,parentSpan:i?null:void 0}))}_startRootSpanWithRemoteParent(t,n){let{spanId:r,traceId:i,traceState:o}=n.spanContext(),s=nt(n),c=typeof s.sample_rand=="string"?Number(s.sample_rand):void 0,a=!!o?.get(om);return Be(l=>(l.setPropagationContext({traceId:i,parentSpanId:r,sampled:Va(n.spanContext()),dsc:a?s:void 0,sampleRand:typeof c=="number"&&!Number.isNaN(c)?c:ct()}),Bn(l,void 0),Xs({...t,parentSpan:null})))}_createNonRecordingSpan(t){let n=new Pr({traceId:t?.spanContext().traceId});return t&&di(t,n),Or(n,ne(),J()),n}},Kl=class{constructor(t={}){this._tracers=new Map,this.resource=t.resource}getTracer(t,n,r){let i=JSON.stringify([t,n,r]),o=this._tracers.get(i);if(o)return o;let s=new ES;return this._tracers.set(i,s),s}forceFlush(){return Promise.resolve()}shutdown(){return Promise.resolve()}},Pk="telemetry.sdk.language",kk="telemetry.sdk.name",Lk="telemetry.sdk.version",QZ="service.namespace",TS=class e{constructor(t){this._attributes=t}get attributes(){return this._attributes}merge(t){return t?new e({...this._attributes,...t.attributes}):this}getRawAttributes(){return Object.entries(this._attributes)}};function JZ(e){if(!e)return{};let t={};for(let n of e.split(",")){let r=n.indexOf("=");if(r===-1)continue;let i=n.substring(0,r).trim(),o=n.substring(r+1).trim();if(i)try{t[i]=decodeURIComponent(o)}catch{t[i]=o}}return t}function pm(e){let t=typeof process<"u"?process.env:{},n=t.OTEL_SERVICE_NAME,r=JZ(t.OTEL_RESOURCE_ATTRIBUTES);return new TS({[QZ]:"sentry",[Oh]:e,...r,...n?{[Oh]:n}:{},[h0]:q,[Pk]:qp[Pk],[kk]:qp[kk],[Lk]:qp[Lk]})}function $Z({span:e,scope:t,client:n,propagateTraceparent:r}={}){let i=(t&&Wa(t))??pe.active();if(e){let{scope:p}=Kt(e);i=p&&Wa(p)||he.setSpan(pe.active(),e)}let{traceId:o,spanId:s,sampled:c,dynamicSamplingContext:a}=Zk(i,{scope:t,client:n}),l={"sentry-trace":Fi(o,s,c),baggage:Hi(a)};return r&&(l.traceparent=Wi(o,s,c)),l}function mL(e){function t(){let a=pe.active(),l=as(a);return l||{scope:ws(),isolationScope:Rt()}}function n(a){let l=pe.active();return pe.with(l,()=>a(s()))}function r(a,l){let p=Wa(a)||pe.active();return pe.with(p.setValue(gS,a),()=>l(a))}function i(a){let l=pe.active();return pe.with(l.setValue(fS,!0),()=>{let p=s();return Oc(p.getPropagationContext())||p.setPropagationContext({traceId:yt(),sampleRand:ct()}),a(c())})}function o(a,l){let p=pe.active();return pe.with(p.setValue(nm,a),()=>l(c()))}function s(){return t().scope}function c(){return t().isolationScope}x_({withScope:n,withSetScope:r,withSetIsolationScope:o,withIsolationScope:i,getCurrentScope:s,getIsolationScope:c,startSpan:Qk,startSpanManual:Jk,startInactiveSpan:$k,getActiveSpan:OS,suppressTracing:oL,isTracingSuppressed:wZ,getTraceData:$Z,continueTrace:rL,startNewTrace:MZ,withActiveSpan:xS,getTracingChannelBinding:e?.getTracingChannelBinding})}at();at();import{AsyncLocalStorage as fL}from"async_hooks";import{EventEmitter as zZ}from"events";var eX=["addListener","on","once","prependListener","prependOnceListener"],um=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1,cs("SentryContextManager"),this._asyncLocalStorage=St(Je()).getTracingChannelBinding?.()?.asyncLocalStorage??new fL}active(){return this._asyncLocalStorage.getStore()??Xp}with(t,n,r,...i){let o=sL(t,this.active()),s=r==null?n:n.bind(r);return this._asyncLocalStorage.run(o,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}bind(t,n){return n instanceof zZ?this._bindEventEmitter(t,n):typeof n=="function"?this._bindFunction(t,n):n}getAsyncLocalStorageLookup(){return{asyncLocalStorage:this._asyncLocalStorage,contextSymbol:am}}_bindFunction(t,n){let r=this.with.bind(this),i=function(...o){return r(t,()=>n.apply(this,o))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),i}_bindEventEmitter(t,n){if(this._getPatchMap(n)!==void 0)return n;this._createPatchMap(n);for(let r of eX)n[r]!==void 0&&(n[r]=this._patchAddListener(n,n[r],t));return typeof n.removeListener=="function"&&(n.removeListener=this._patchRemoveListener(n,n.removeListener)),typeof n.off=="function"&&(n.off=this._patchRemoveListener(n,n.off)),typeof n.removeAllListeners=="function"&&(n.removeAllListeners=this._patchRemoveAllListeners(n,n.removeAllListeners)),n}_patchRemoveListener(t,n){let r=this;return function(i,o){let s=r._getPatchMap(t)?.[i];if(s===void 0)return n.call(this,i,o);let c=s.get(o);return n.call(this,i,c||o)}}_patchRemoveAllListeners(t,n){let r=this;return function(i){let o=r._getPatchMap(t);return o!==void 0&&(arguments.length===0?r._createPatchMap(t):i!==void 0&&o[i]!==void 0&&delete o[i]),n.apply(this,arguments)}}_patchAddListener(t,n,r){let i=this;return function(o,s){if(i._wrapped)return n.call(this,o,s);let c=i._getPatchMap(t);c===void 0&&(c=i._createPatchMap(t));let a=c[o];a===void 0&&(a=new WeakMap,c[o]=a);let l=i.bind(r,s);a.set(s,l),i._wrapped=!0;try{return n.call(this,o,l)}finally{i._wrapped=!1}}}_createPatchMap(t){let n=Object.create(null);return t[this._kOtListeners]=n,n}_getPatchMap(t){return t[this._kOtListeners]}};function LS(e){mL({getTracingChannelBinding:e?.skipOpenTelemetrySetup?nX():tX()})}function tX(){let e=new fL;return()=>({asyncLocalStorage:e,getStoreWithActiveSpan:gL})}function nX(){return()=>{try{let t=pe._getContextManager()?.getAsyncLocalStorageLookup().asyncLocalStorage;return t?{asyncLocalStorage:t,getStoreWithActiveSpan:gL}:void 0}catch{return}}}function gL(e){let t=pe.active();return Lr(e)&&Re(e)!==e||e.spanContext().traceState?.get(sm)==="1"?t:he.setSpan(t,e)}var ql=um;at();function MS(){nn.disable(),nn.setLogger({error:g.error,warn:g.warn,info:g.log,debug:g.log,verbose:g.log},ZN.DEBUG)}var Ql={};function de(e,t,n){return n?iX(e,t,n):rX(e,t)}function rX(e,t){return Object.assign(n=>{let r=Ql[e];if(r)return n&&r.setConfig(n),r;let i=t(n);return Ql[e]=i,wa({instrumentations:[i]}),i},{id:e})}function iX(e,t,n){return Object.assign(r=>{let i=n(r),o=Ql[e];if(o)return o.setConfig(i),o;let s=new t(i);return Ql[e]=s,wa({instrumentations:[s]}),s},{id:e})}import*as wS from"diagnostics_channel";var oX="ChildProcess",dm=(e={})=>({name:oX,setup(){wS.channel("child_process").subscribe(t=>{V(t)&&"process"in t&&sX(t.process,e)}),wS.channel("worker_threads").subscribe(t=>{V(t)&&"worker"in t&&aX(t.worker,e)})}});function sX(e,t){let n=!1,r;e.on("spawn",()=>{if(e.spawnfile==="/usr/bin/sw_vers"){n=!0;return}r={spawnfile:e.spawnfile},t.includeChildProcessArgs&&(r.spawnargs=e.spawnargs)}).on("exit",i=>{n||(n=!0,i!==null&&i!==0&&on({category:"child_process",message:`Child process exited with code '${i}'`,level:i===0?"info":"warning",data:r}))}).on("error",i=>{n||(n=!0,on({category:"child_process",message:`Child process errored with '${i.message}'`,level:"error",data:r}))})}function aX(e,t){let n;e.on("online",()=>{n=e.threadId}).on("error",r=>{t.captureWorkerErrors!==!1?me(r,{mechanism:{type:"auto.child_process.worker_thread",handled:!1,data:{threadId:String(n)}}}):on({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:n}})})}import{execFile as cX}from"child_process";import{readFile as lX,readdir as pX}from"fs";import*as At from"os";import{join as uX}from"path";import{promisify as bL}from"util";var dX=bL(lX),mX=bL(pX),fX="Context",gX=((e={})=>{let t={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...e},n=t.app?SX():void 0,r=t.device?EX(t.device):void 0,i=t.culture?yX():void 0,o=t.cloudResource?RX():void 0,s=t.os?bX():void 0,c={"process.runtime.engine.name":"v8","process.runtime.engine.version":process.versions.v8,..._L({app:n,device:r,culture:i,cloud_resource:o})};s&&s.then(p=>Object.assign(c,_L({os:p}))).catch(()=>{});let a=(async()=>{let p={};return s&&(p.os=await s),n&&(p.app=n),r&&(p.device=r),i&&(p.culture=i),o&&(p.cloud_resource=o),p})();async function l(p){let u=_X(await a);return p.contexts={...p.contexts,app:{...u.app,...p.contexts?.app},os:{...u.os,...p.contexts?.os},device:{...u.device,...p.contexts?.device},culture:{...u.culture,...p.contexts?.culture},cloud_resource:{...u.cloud_resource,...p.contexts?.cloud_resource}},p}return{name:fX,processEvent(p){return l(p)},processSegmentSpan(p){Gt(p,c),Gt(p,hX(n,r))}}}),mm=gX;function _X(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=At.freemem()),e}function _L(e){let t={},{app:n,device:r,os:i,culture:o,cloud_resource:s}=e;if(n&&n.app_start_time&&(t["app.start_time"]=n.app_start_time),r&&(r.arch&&(t["device.archs"]=[r.arch]),r.boot_time&&(t["device.boot_time"]=r.boot_time),r.memory_size!=null&&(t["device.memory_size"]=r.memory_size),r.processor_count!=null&&(t["device.processor_count"]=r.processor_count),r.cpu_description&&(t["device.cpu_description"]=r.cpu_description),r.processor_frequency!=null&&(t["device.processor_frequency"]=r.processor_frequency)),i&&(i.name&&(t["os.name"]=i.name),i.version&&(t["os.version"]=i.version),i.kernel_version&&(t["os.kernel_version"]=i.kernel_version),i.build&&(t["os.build"]=i.build)),o&&(o.locale&&(t["culture.locale"]=o.locale),o.timezone&&(t["culture.timezone"]=o.timezone)),s)for(let[c,a]of Object.entries(s))a!=null&&(t[c]=a);return t}function hX(e,t){let n={};if(e&&(n["app.memory"]=process.memoryUsage().rss,typeof process.availableMemory=="function")){let r=process.availableMemory?.();r!=null&&(n["app.free_memory"]=r)}return t?.free_memory!=null&&(n["device.free_memory"]=At.freemem()),n}async function bX(){let e=At.platform();switch(e){case"darwin":return NX();case"linux":return vX();default:return{name:TX[e]||e,version:At.release()}}}function yX(){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 SX(){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 EX(e){let t={},n;try{n=At.uptime()}catch{}if(typeof n=="number"&&(t.boot_time=new Date(Date.now()-n*1e3).toISOString()),t.arch=At.arch(),(e===!0||e.memory)&&(t.memory_size=At.totalmem(),t.free_memory=At.freemem()),e===!0||e.cpu){let r=At.cpus(),i=r?.[0];i&&(t.processor_count=r.length,t.cpu_description=i.model,t.processor_frequency=i.speed)}return t}var TX={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows",ohos:"OpenHarmony",android:"Android"},IX=[{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"]}],AX={alpine:e=>e,arch:e=>Qr(/distrib_release=(.*)/,e),centos:e=>Qr(/release ([^ ]+)/,e),debian:e=>e,fedora:e=>Qr(/release (..)/,e),mint:e=>Qr(/distrib_release=(.*)/,e),red:e=>Qr(/release ([^ ]+)/,e),suse:e=>Qr(/VERSION = (.*)\n/,e),ubuntu:e=>Qr(/distrib_release=(.*)/,e)};function Qr(e,t){let n=e.exec(t);return n?n[1]:void 0}async function NX(){let e={kernel_version:At.release(),name:"Mac OS X",version:`10.${Number(At.release().split(".")[0])-4}`};try{let t=await new Promise((n,r)=>{cX("/usr/bin/sw_vers",(i,o)=>{if(i){r(i);return}n(o)})});e.name=Qr(/^ProductName:\s+(.*)$/m,t),e.version=Qr(/^ProductVersion:\s+(.*)$/m,t),e.build=Qr(/^BuildVersion:\s+(.*)$/m,t)}catch{}return e}function hL(e){return e.split(" ")[0].toLowerCase()}async function vX(){let e={kernel_version:At.release(),name:"Linux"};try{let t=await mX("/etc"),n=IX.find(c=>t.includes(c.name));if(!n)return e;let r=uX("/etc",n.name),i=(await dX(r,{encoding:"utf-8"})).toLowerCase(),{distros:o}=n;e.name=o.find(c=>i.indexOf(hL(c))>=0)||o[0];let s=hL(e.name);e.version=AX[s]?.(i)}catch{}return e}function RX(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}import{createReadStream as OX}from"fs";import{createInterface as CX}from"readline";var GS=new Wt(10),EL=new Wt(20),xX=7,PX="ContextLines",kX=1e3,LX=1e4;function MX(e,t,n){let r=e.get(t);return r===void 0?(e.set(t,n),n):r}function wX(e){return!!(e.startsWith("node:")||e.endsWith(".min.js")||e.endsWith(".min.cjs")||e.endsWith(".min.mjs")||e.startsWith("data:"))}function GX(e){return e.lineno!==void 0&&e.lineno>LX||e.colno!==void 0&&e.colno>kX}function UX(e,t){let n=GS.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 DX(e,t){if(!e.length)return[];let n=0,r=e[0];if(typeof r!="number")return[];let i=SL(r,t),o=[];for(;;){if(n===e.length-1){o.push(i);break}let s=e[n+1];if(typeof s!="number")break;s<=i[1]?i[1]=s+t:(o.push(i),i=SL(s,t)),n++}return o}function BX(e,t,n){return new Promise((r,i)=>{let o=OX(e),s=CX({input:o});function c(){o.destroy(),r()}let a=0,l=0,p=t[l];if(p===void 0){c();return}let u=p[0],d=p[1];function m(_){EL.set(e,1),We&&g.error(`Failed to read file: ${e}. Error: ${_}`),s.close(),s.removeAllListeners(),c()}o.on("error",m),s.on("error",m),s.on("close",c),s.on("line",_=>{if(a++,!(a<u)&&(n[a]=A_(_,0),a>=d)){if(l===t.length-1){s.close(),s.removeAllListeners();return}l++;let h=t[l];if(h===void 0){s.close(),s.removeAllListeners();return}u=h[0],d=h[1]}})})}async function HX(e,t){let n={};if(t>0&&e.exception?.values){for(let o of e.exception.values)if(o.stacktrace?.frames?.length)for(let s=o.stacktrace.frames.length-1;s>=0;s--){let c=o.stacktrace.frames[s],a=c?.filename;if(!c||typeof a!="string"||typeof c.lineno!="number"||wX(a)||GX(c))continue;n[a]||(n[a]=[]),n[a].push(c.lineno)}}let r=Object.keys(n);if(r.length==0)return e;let i=[];for(let o of r){if(EL.get(o))continue;let s=n[o];if(!s)continue;s.sort((l,p)=>l-p);let c=DX(s,t);if(c.every(l=>UX(o,l)))continue;let a=MX(GS,o,{});i.push(BX(o,c,a))}if(await Promise.all(i).catch(()=>{We&&g.log("Failed to read one or more source files and resolve context lines")}),t>0&&e.exception?.values)for(let o of e.exception.values)o.stacktrace?.frames&&o.stacktrace.frames.length>0&&FX(o.stacktrace.frames,t,GS);return e}function FX(e,t,n){for(let r of e)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let i=n.get(r.filename);if(i===void 0)continue;WX(r.lineno,r,t,i)}}function yL(e){delete e.pre_context,delete e.context_line,delete e.post_context}function WX(e,t,n,r){if(t.lineno===void 0||r===void 0){We&&g.error("Cannot resolve context for frame with no lineno or file contents");return}t.pre_context=[];for(let o=TL(e,n);o<e;o++){let s=r[o];if(s===void 0){yL(t),We&&g.error(`Could not find line ${o} in file ${t.filename}`);return}t.pre_context.push(s)}if(r[e]===void 0){yL(t),We&&g.error(`Could not find line ${e} in file ${t.filename}`);return}t.context_line=r[e];let i=IL(e,n);t.post_context=[];for(let o=e+1;o<=i;o++){let s=r[o];if(s===void 0)break;t.post_context.push(s)}}function TL(e,t){return Math.max(1,e-t)}function IL(e,t){return e+t}function SL(e,t){return[TL(e,t),IL(e,t)]}var VX=((e={})=>({name:PX,processEvent(t,n,r){let i=e.frameContextLines??r?.getDataCollectionOptions().frameContextLines??xX;return HX(t,i)}})),fm=VX;import{Worker as YX}from"worker_threads";var gm;async function ja(){if(gm===void 0)try{gm=!!(await import("inspector")).url()}catch{gm=!1}return gm}function _m(e,t){return la(e,t)}var Jl="__SENTRY_ERROR_LOCAL_VARIABLES__";function NL(e,t,n){let r=0,i=5,o=0;return setInterval(()=>{o===0?r>e&&(i*=2,n(i),i>86400&&(i=86400),o=i):(o-=1,o===0&&t()),r=0},1e3).unref(),()=>{r+=1}}function AL(e){return e!==void 0&&(e.length===0||e==="?"||e==="<anonymous>")}function hm(e,t){return e===t||`Object.${e}`===t||e===`Object.${t}`||AL(e)&&AL(t)}var jX="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjc1LjMgKDNiMjgyYzEpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyBlfWZyb20ibm9kZTppbnNwZWN0b3IvcH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YS5jYXB0dXJlQWxsRXhjZXB0aW9ucztpZihhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6aT8iYWxsIjoidW5jYXVnaHQifSksaSl7Y29uc3QgZT1hLm1heEV4Y2VwdGlvbnNQZXJTZWNvbmR8fDUwO2Y9ZnVuY3Rpb24oZSx0LG4pe2xldCBpPTAsbz01LGE9MDtyZXR1cm4gc2V0SW50ZXJ2YWwoKCk9PnswPT09YT9pPmUmJihvKj0yLG4obyksbz44NjQwMCYmKG89ODY0MDApLGE9byk6KGEtPTEsMD09PWEmJnQoKSksaT0wfSwxZTMpLnVucmVmKCksKCk9PntpKz0xfX0oZSxhc3luYygpPT57cygiUmF0ZS1saW1pdCBsaWZ0ZWQuIiksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJhbGwifSl9LGFzeW5jIGU9PntzKGBSYXRlLWxpbWl0IGV4Y2VlZGVkLiBEaXNhYmxpbmcgY2FwdHVyaW5nIG9mIGNhdWdodCBleGNlcHRpb25zIGZvciAke2V9IHNlY29uZHMuYCksYXdhaXQgdC5wb3N0KCJEZWJ1Z2dlci5zZXRQYXVzZU9uRXhjZXB0aW9ucyIse3N0YXRlOiJ1bmNhdWdodCJ9KX0pfX0pKCkuY2F0Y2goZT0+e3MoIkZhaWxlZCB0byBzdGFydCBkZWJ1Z2dlciIsZSl9KSxzZXRJbnRlcnZhbCgoKT0+e30sMWU0KTs=";function vL(...e){g.log("[LocalVariables]",...e)}var RL=((e={})=>{function t(o,s,c){if(c===!1)return;let a=(o.stacktrace?.frames||[]).filter(l=>l.function!=="new Promise");for(let l=0;l<a.length;l++){let p=a.length-l-1,u=s[l],d=a[p];if(!d||!u)break;u.vars===void 0||d.in_app===!1&&e.includeOutOfAppFrames!==!0||!hm(d.function,u.function)||(d.vars=_m(u.vars,c))}}function n(o,s){if(s.originalException&&typeof s.originalException=="object"&&Jl in s.originalException&&Array.isArray(s.originalException[Jl])){let c=C()?.getDataCollectionOptions().stackFrameVariables??!0;for(let a of o.exception?.values||[])t(a,s.originalException[Jl],c);s.originalException[Jl]=void 0}return o}async function r(){let o=await import("inspector");o.url()||o.open(0)}function i(o){let s=new YX(new URL(`data:application/javascript;base64,${jX}`),{workerData:o,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{s.terminate()}),s.once("error",c=>{vL("Worker error",c)}),s.once("exit",c=>{vL("Worker exit",c)}),s.unref()}return{name:"LocalVariablesAsync",async setup(o){if(!o.getOptions().includeLocalVariables)return;if(await ja()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}let c={...e,debug:g.isEnabled()};r().then(()=>{try{i(c)}catch(a){g.error("Failed to start worker",a)}},a=>{g.error("Failed to start inspector",a)})},processEvent(o,s){return n(o,s)}}});function OL(e){if(e!==void 0)return e.slice(-10).reduce((t,n)=>`${t},${n.function},${n.lineno},${n.colno}`,"")}function ZX(e,t){if(t!==void 0)return OL(e(t,1))}function CL(e){let t=[],n=!1;function r(s){t=[],!n&&(n=!0,e(s))}t.push(r);function i(s){t.push(s)}function o(s){let c=t.pop()||r;try{c(s)}catch{r(s)}}return{add:i,next:o}}var US=class e{constructor(t){this._session=t}static async create(t){if(t)return t;let n=await import("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:i,next:o}=CL(n);for(let s of r)if(s.value?.objectId&&s.value.className==="Array"){let c=s.value.objectId;i(a=>this._unrollArray(c,s.name,a,o))}else if(s.value?.objectId&&s.value.className==="Object"){let c=s.value.objectId;i(a=>this._unrollObject(c,s.name,a,o))}else s.value&&i(c=>this._unrollOther(s,c,o));o({})})}_getProperties(t,n){this._session.post("Runtime.getProperties",{objectId:t,ownProperties:!0},(r,i)=>{n(r?[]:i.result)})}_unrollArray(t,n,r,i){this._getProperties(t,o=>{r[n]=o.filter(s=>s.name!=="length"&&!isNaN(parseInt(s.name,10))).sort((s,c)=>parseInt(s.name,10)-parseInt(c.name,10)).map(s=>s.value?.value),i(r)})}_unrollObject(t,n,r,i){this._getProperties(t,o=>{r[n]=o.map(s=>[s.name,s.value?.value]).reduce((s,[c,a])=>(s[c]=a,s),{}),i(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)}},XX="LocalVariables",KX=((e={},t)=>{let n=new Wt(20),r,i=!1;function o(l,p){let u=OL(l.stacktrace?.frames);if(u===void 0)return;let d=n.remove(u);if(d===void 0||p===!1)return;let m=(l.stacktrace?.frames||[]).filter(_=>_.function!=="new Promise");for(let _=0;_<m.length;_++){let h=m.length-_-1,b=d[_],N=m[h];if(!N||!b)break;b.vars===void 0||N.in_app===!1&&e.includeOutOfAppFrames!==!0||!hm(N.function,b.function)||(N.vars=_m(b.vars,p))}}function s(l){for(let p of l.exception?.values||[])o(p,C()?.getDataCollectionOptions().stackFrameVariables??!0);return l}let c;async function a(){let p=C()?.getOptions();if(!p?.includeLocalVariables)return;if(Fa<18){g.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await ja()){g.warn("Local variables capture has been disabled because the debugger was already enabled");return}try{let d=await US.create(t),m=(h,{params:{reason:b,data:N,callFrames:M}},R)=>{if(b!=="exception"&&b!=="promiseRejection"){R();return}r?.();let v=ZX(h,N.description);if(v==null){R();return}let{add:P,next:D}=CL(I=>{n.set(v,I),R()});for(let I=0;I<Math.min(M.length,5);I++){let{scopeChain:H,functionName:L,this:G}=M[I],ce=H.find(Ne=>Ne.type==="local"),ge=G.className==="global"||!G.className?L:`${G.className}.${L}`;if(ce?.object.objectId===void 0)P(Ne=>{Ne[I]={function:ge},D(Ne)});else{let Ne=ce.object.objectId;P(Te=>d.getLocalVariables(Ne,Ce=>{Te[I]={function:ge,vars:Ce},D(Te)}))}}D([])},_=e.captureAllExceptions!==!1;if(d.configureAndConnect((h,b)=>m(p.stackParser,h,b),_),_){let h=e.maxExceptionsPerSecond||50;r=NL(h,()=>{g.log("Local variables rate-limit lifted."),d.setPauseOnExceptions(!0)},b=>{g.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${b} seconds.`),d.setPauseOnExceptions(!1)})}i=!0}catch(d){g.log("The `LocalVariables` integration failed to start.",d)}}return{name:XX,setupOnce(){c=a()},async processEvent(l){return await c,i?s(l):l},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),xL=KX;var bm=(e={})=>en.major<19?xL(e):RL(e);import{readFileSync as qX}from"fs";import{join as QX}from"path";var DS,JX="Modules";function $X(){return typeof __SENTRY_SERVER_MODULES__<"u"?__SENTRY_SERVER_MODULES__:te.__SENTRY_SERVER_MODULES__??{}}var zX=(()=>({name:JX,processEvent(e){return e.modules={...e.modules,...PL()},e},getModules:PL})),ym=zX;function eK(){return{...$X(),...nK()}}function PL(){return DS||(DS=eK()),DS}function tK(){try{let e=QX(process.cwd(),"package.json");return JSON.parse(qX(e,"utf8"))}catch{return{}}}function nK(){let e=tK();return{...e.dependencies,...e.devDependencies}}import{isMainThread as iK}from"worker_threads";var rK=2e3,kL=!1;function $l(e){if(kL)return;kL=!0,Me(()=>{console.error(e)});let t=C();if(t===void 0){We&&g.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:rK;t.close(r).then(i=>{i||We&&g.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},i=>{We&&g.error(i),global.process.exit(1)})}var oK="OnUncaughtException",Sm=(e={})=>{let t={exitEvenIfOtherHandlersAreRegistered:!1,...e};return{name:oK,setup(n){iK&&global.process.on("uncaughtException",sK(n,t))}}};function sK(e,t){let r=!1,i=!1,o=!1,s,c=e.getOptions();return Object.assign(a=>{let l=$l;t.onFatalError?l=t.onFatalError:c.onFatalError&&(l=c.onFatalError);let u=global.process.listeners("uncaughtException").filter(m=>m.name!=="domainUncaughtExceptionClear"&&m._errorHandler!==!0).length===0,d=t.exitEvenIfOtherHandlersAreRegistered||u;r?d&&(o?(We&&g.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),$l(a)):i||(i=!0,setTimeout(()=>{o||(o=!0,l(s,a))},2e3))):(s=a,r=!0,C()===e&&me(a,{originalException:a,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"auto.node.onuncaughtexception"}}),!o&&d&&(o=!0,l(a)))},{_errorHandler:!0})}var aK="OnUnhandledRejection",cK=[{name:"AI_NoOutputGeneratedError"},{name:"AbortError"}],lK=((e={})=>{let t={mode:e.mode??"warn",ignore:[...cK,...e.ignore??[]]};return{name:aK,setup(n){global.process.on("unhandledRejection",mK(n,t))}}}),Em=lK;function pK(e){if(!V(e))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 uK(e,t){let n=e.name===void 0||vr(t.name,e.name,!0),r=e.message===void 0||vr(t.message,e.message);return n&&r}function dK(e,t){let n=pK(t);return e.some(r=>uK(r,n))}function mK(e,t){return function(r,i){if(C()!==e||dK(t.ignore??[],r))return;let o=t.mode==="strict"?"fatal":"error",s=V(r)?r._sentry_active_span:void 0;(s?a=>se(s,a):a=>a())(()=>{me(r,{originalException:r,captureContext:{extra:{unhandledPromiseRejection:!0},level:o},mechanism:{handled:!1,type:"auto.node.onunhandledrejection"}})}),fK(r,t.mode)}}function fK(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"?Me(()=>{console.warn(n),console.error(V(e)&&"stack"in e?e.stack:e)}):t==="strict"&&(Me(()=>{console.warn(n)}),$l(e))}var gK="ProcessSession",Tm=()=>({name:gK,setupOnce(){Kc(),process.on("beforeExit",()=>{J().getSession()?.status==="ok"&&Zo()})}});import*as LL from"http";var BS="Spotlight",_K=((e={})=>{let t={sidecarUrl:e.sidecarUrl||"http://localhost:8969/stream"};return{name:BS,setup(n){try{g.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}hK(n,t)}}}),Im=_K;function hK(e,t){let n=bK(t.sidecarUrl);if(!n)return;let r=0;e.on("beforeEnvelope",i=>{if(r>3){g.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let o=Gc(i);Fn(()=>{let s=LL.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},c=>{c.statusCode&&c.statusCode>=200&&c.statusCode<400&&(r=0),c.on("data",()=>{}),c.on("end",()=>{}),c.setEncoding("utf8")});s.on("error",()=>{r++,g.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),s.write(o),s.end()})})}function bK(e){try{return new URL(`${e}`)}catch{g.warn(`[Spotlight] Invalid sidecar URL: ${e}`);return}}var Am=(e={})=>({name:"Console",setup(t){process.env.LAMBDA_TASK_ROOT&&vc("console",yK),Cb({...e,filter:[...e.filter||[],"[DEP0205] DeprecationWarning"]}).setup?.(t)}});function yK(){let e=te?.console;e&&zn.forEach(t=>{t in e&&SK(e,t)})}function SK(e,t){let n=e[t];$n[t]=n;let r=n,i,o=!1,s=function(...a){if(o){n.apply(e,a);return}o=!0;try{Cs("console",{args:a,level:t}),r.apply(e,a)}finally{o=!1}};Po(s,n);let c=n.bind(e);$n[t]=c;try{let a=s;Object.defineProperty(e,t,{configurable:!0,enumerable:!0,get(){return a},set(l){l===s?(i!==void 0&&(r=i,i=void 0),a=s):l===c?(i=r,a=c):typeof l=="function"&&!l.__sentry_original__?(r=l,a=s):a=l}})}catch{kt(e,t,function(a){return $n[t]=a,function(...l){Cs("console",{args:l,level:t}),$n[t]?.apply(this,l)}})}}import*as HS from"util";var EK="NodeSystemError";function TK(e){return!(e instanceof Error)||!("errno"in e)||typeof e.errno!="number"||typeof HS.getSystemErrorMap!="function"?!1:HS.getSystemErrorMap().has(e.errno)}var Nm=(e={})=>({name:EK,processEvent:(t,n,r)=>{if(!TK(n.originalException))return t;let i=n.originalException,o={...i};!r.getDataCollectionOptions().userInfo&&e.includePaths!==!0&&(delete o.path,delete o.dest),t.contexts={...t.contexts,node_system_error:o};for(let s of t.exception?.values||[])s.value&&(i.path&&s.value.includes(i.path)&&(s.value=s.value.replace(`'${i.path}'`,"").trim()),i.dest&&s.value.includes(i.dest)&&(s.value=s.value.replace(`'${i.dest}'`,"").trim()));return t}});import*as AK from"http";import*as NK from"https";import{Readable as vK}from"stream";import{createGzip as RK}from"zlib";import*as Ri from"net";import*as WS from"tls";import*as FS from"http";import"https";var ML,Jr=Symbol("AgentBaseInternalState"),vm=class extends(ML=FS.Agent,ML){constructor(t){super(t),this[Jr]={}}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(`
|
|
26
|
+
`).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(t,n,r){let i={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(t,i)).then(o=>{if(o instanceof FS.Agent)return o.addRequest(t,i);this[Jr].currentSocket=o,super.createSocket(t,n,r)},r)}createConnection(){let t=this[Jr].currentSocket;if(this[Jr].currentSocket=void 0,!t)throw new Error("No socket was returned in the `connect()` function");return t}get defaultPort(){return this[Jr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(t){this[Jr]&&(this[Jr].defaultPort=t)}get protocol(){return this[Jr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(t){this[Jr]&&(this[Jr].protocol=t)}};function Rm(...e){g.log("[https-proxy-agent:parse-proxy-response]",...e)}function wL(e){return new Promise((t,n)=>{let r=0,i=[];function o(){let p=e.read();p?l(p):e.once("readable",o)}function s(){e.removeListener("end",c),e.removeListener("error",a),e.removeListener("readable",o)}function c(){s(),Rm("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function a(p){s(),Rm("onerror %o",p),n(p)}function l(p){i.push(p),r+=p.length;let u=Buffer.concat(i,r),d=u.indexOf(`\r
|
|
27
|
+
\r
|
|
28
|
+
`);if(d===-1){Rm("have not received end of HTTP headers yet..."),o();return}let m=u.subarray(0,d).toString("ascii").split(`\r
|
|
29
|
+
`),_=m.shift();if(!_)return e.destroy(),n(new Error("No header received from proxy CONNECT response"));let h=_.split(" "),b=+(h[1]||0),N=h.slice(2).join(" "),M={};for(let R of m){if(!R)continue;let v=R.indexOf(":");if(v===-1)return e.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${R}"`));let P=R.slice(0,v).toLowerCase(),D=R.slice(v+1).trimStart(),I=M[P];typeof I=="string"?M[P]=[I,D]:Array.isArray(I)?I.push(D):M[P]=D}Rm("got proxy server response: %o %o",_,M),s(),t({connect:{statusCode:b,statusText:N,headers:M},buffered:u})}e.on("error",a),e.on("end",c),o()})}function zl(...e){g.log("[https-proxy-agent]",...e)}var ep=class extends vm{constructor(t,n){super(n),this.options={},this.proxy=typeof t=="string"?new URL(t):t,this.proxyHeaders=n?.headers??{},zl("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),i=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?GL(n,"headers"):null,host:r,port:i}}async connect(t,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let i;if(r.protocol==="https:"){zl("Creating `tls.Socket`: %o",this.connectOpts);let d=this.connectOpts.servername||this.connectOpts.host;i=WS.connect({...this.connectOpts,servername:d&&Ri.isIP(d)?void 0:d})}else zl("Creating `net.Socket`: %o",this.connectOpts),i=Ri.connect(this.connectOpts);let o=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},s=Ri.isIPv6(n.host)?`[${n.host}]`:n.host,c=`CONNECT ${s}:${n.port} HTTP/1.1\r
|
|
30
|
+
`;if(r.username||r.password){let d=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;o["Proxy-Authorization"]=`Basic ${Buffer.from(d).toString("base64")}`}o.Host=`${s}:${n.port}`,o["Proxy-Connection"]||(o["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let d of Object.keys(o))c+=`${d}: ${o[d]}\r
|
|
31
|
+
`;let a=wL(i);i.write(`${c}\r
|
|
32
|
+
`);let{connect:l,buffered:p}=await a;if(t.emit("proxyConnect",l),this.emit("proxyConnect",l,t),l.statusCode===200){if(t.once("socket",IK),n.secureEndpoint){zl("Upgrading socket connection to TLS");let d=n.servername||n.host;return WS.connect({...GL(n,"host","path","port"),socket:i,servername:Ri.isIP(d)?void 0:d})}return i}i.destroy();let u=new Ri.Socket({writable:!1});return u.readable=!0,t.once("socket",d=>{zl("Replaying proxy buffer for failed request"),d.push(p),d.push(null)}),u}};ep.protocols=["http","https"];function IK(e){e.resume()}function GL(e,...t){let n={},r;for(r in e)t.includes(r)||(n[r]=e[r]);return n}var OK=1024*32;function CK(e){return new vK({read(){this.push(e),this.push(null)}})}function Om(e){let t;try{t=new URL(e.url)}catch{return Me(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),aa(e,()=>Promise.resolve({}))}let n=t.protocol==="https:",r=xK(t,e.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),i=n?NK:AK,o=e.keepAlive===void 0?!1:e.keepAlive,s=r?new ep(r):new i.Agent({keepAlive:o,maxSockets:30,timeout:2e3}),c=PK(e,e.httpModule??i,s);return aa(e,c)}function xK(e,t){let{no_proxy:n}=process.env;if(!n?.split(",").some(i=>e.host.endsWith(i)||e.hostname.endsWith(i)))return t}function PK(e,t,n){let{hostname:r,pathname:i,port:o,protocol:s,search:c}=new URL(e.url);return function(l){return new Promise((p,u)=>{Fn(()=>{let d=CK(l.body),m={...e.headers};l.body.length>OK&&(m["content-encoding"]="gzip",d=d.pipe(RK()));let _=r.startsWith("["),h=t.request({method:"POST",agent:n,headers:m,hostname:_?r.slice(1,-1):r,path:`${i}${c}`,port:o,protocol:s,ca:e.caCerts},b=>{b.on("data",()=>{}),b.on("end",()=>{}),b.setEncoding("utf8");let N=b.headers["retry-after"]??null,M=b.headers["x-sentry-rate-limits"]??null;p({statusCode:b.statusCode,headers:{"retry-after":N,"x-sentry-rate-limits":Array.isArray(M)?M[0]||null:M}})});h.on("error",u),d.pipe(h)})})}}function UL(e){if(e===!1)return!1;if(typeof e=="string")return e;let t=Xo(process.env.SENTRY_SPOTLIGHT,{strict:!0}),n=t===null&&process.env.SENTRY_SPOTLIGHT?process.env.SENTRY_SPOTLIGHT:void 0;return e===!0?n??!0:t??n}import{posix as kK,sep as LK}from"path";function DL(e){return e.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function Cm(e=process.argv[1]?Ab(process.argv[1]):process.cwd(),t=LK==="\\"){let n=t?DL(e):e;return r=>{if(!r)return;let i=t?DL(r):r,{dir:o,base:s,ext:c}=kK.parse(i);(c===".js"||c===".mjs"||c===".cjs")&&(s=s.slice(0,c.length*-1));let a=decodeURIComponent(s);o||(o=".");let l=o.lastIndexOf("/node_modules");if(l>-1)return`${o.slice(l+14).replace(/\//g,".")}:${a}`;if(o.startsWith(n)){let p=o.slice(n.length+1).replace(/\//g,".");return p?`${p}:${a}`:a}return a}}function xm(e){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(te.SENTRY_RELEASE?.id)return te.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 Pm=Jp(Sy(Cm()));at();import*as BL from"os";import{threadId as MK,isMainThread as wK}from"worker_threads";var GK=6e4,Za=class extends Ol{constructor(t){let n=t.includeServerName===!1?void 0:t.serverName||global.process.env.SENTRY_NAME||BL.hostname(),r={...t,platform:"node",runtime:t.runtime||{name:"node",version:global.process.version},serverName:n};t.openTelemetryInstrumentations&&wa({instrumentations:t.openTelemetryInstrumentations}),Ko(r,"node"),g.log(`Initializing Sentry: process: ${process.pid}, thread: ${wK?"main":`worker-${MK}`}.`),super(r),this.getOptions().enableLogs&&(this._logOnExitFlushListener=()=>{oa(this)},n&&this.on("beforeCaptureLog",i=>{i.attributes={...i.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener)),fh(this)}get tracer(){if(this._tracer)return this._tracer;let t="@sentry/node",n=q,r=he.getTracer(t,n);return this._tracer=r,r}async flush(t){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(t)}async close(t){this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener);let n=await super.close(t);return this.traceProvider&&await this.traceProvider.shutdown(),n}startClientReportTracking(){let t=this.getOptions();t.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{We&&g.log("Flushing client reports based on interval."),this._flushOutcomes()},t.clientReportFlushInterval??GK).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_setupIntegrations(){ab(),super._setupIntegrations()}_getTraceInfoFromScope(t){return t?PS(this,t):[void 0,void 0]}};var WL=Zp(rS(),1);import*as VL from"module";var HL;function FL(){return Fa>=21||Fa===20&&iS>=6||Fa===18&&iS>=19?!0:(HL||(HL=!0,Me(()=>{console.warn(`[Sentry] You are using Node.js v${process.versions.node} in ESM mode ("import syntax"). The Sentry Node.js SDK is not compatible with ESM in Node.js versions before 18.19.0 or before 20.6.0. Please either build your application with CommonJS ("require() syntax"), or upgrade your Node.js version.`)})),!1)}function tp(){if(FL()&&!te._sentryEsmLoaderHookRegistered){te._sentryEsmLoaderHookRegistered=!0;try{let{addHookMessagePort:e}=(0,WL.createAddHookMessageChannel)();VL.register("import-in-the-middle/hook.mjs",import.meta.url,{data:{addHookMessagePort:e,include:[]},transferList:[e]})}catch(e){g.warn("Failed to register 'import-in-the-middle' hook",e)}}}function km(){return[rl(),nl(),il(),ol(),Nm(),kb(),Am(),Ik(),Ck(),Sm(),Em(),fm(),bm(),mm(),dm(),Tm(),ym()]}function VS(e={}){return UK(e,km)}function UK(e={},t){let n=DK(e,t);n.debug===!0&&(We?g.enable():Me(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),n.registerEsmLoaderHooks!==!1&&tp(),LS(n),ne().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:o})=>o===BS)&&n.integrations.push(Im({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Ko(n,"node-core");let i=new Za(n);return ne().setClient(i),i.init(),g.log("SDK initialized from ESM"),i.startClientReportTracking(),FK(),RS(i),kS(i),process.env.VERCEL&&process.on("SIGTERM",async()=>{await i.flush(200)}),i}function Lm(){if(!We)return;let e=CS(),t=["SentryContextManager","SentryPropagator"],n=e.includes("SentryTracerProvider");Ue()&&!n&&t.push("SentrySpanProcessor");for(let r of t)e.includes(r)||g.error(`You have to set up the ${r}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);!n&&!e.includes("SentrySampler")&&g.warn("You have to set up the SentrySampler. Without this, the OpenTelemetry & Sentry integration may still work, but sample rates set for the Sentry SDK will not be respected. If you use a custom sampler, make sure to use `wrapSamplingDecision`.")}function DK(e,t){let n=BK(e.release),r=UL(e.spotlight),i=HK(e.tracesSampleRate),o={...e,dsn:e.dsn??process.env.SENTRY_DSN,environment:e.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:e.sendClientReports??!0,transport:e.transport??Om,stackParser:f_(e.stackParser||Pm),release:n,tracesSampleRate:i,spotlight:r,debug:Xo(e.debug??process.env.SENTRY_DEBUG)},s=e.integrations,c=e.defaultIntegrations??t(o),a=Zh({defaultIntegrations:c,integrations:s});return{...o,integrations:a}}function BK(e){if(e!==void 0)return e;let t=xm();if(t!==void 0)return t}function HK(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 FK(){if(Xo(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let e=process.env.SENTRY_TRACE,t=process.env.SENTRY_BAGGAGE,n=In(e,t);ne().setPropagationContext(n)}}var YL=e=>{let t;return t=!1,{package:e,"javascript.is_cjs":t}};function _r(e,t){let n=C()?.getOptions();!n?.disableInstrumentationWarnings&&!(w(e)||typeof Nr(e)=="function")&&jo()&&Ue(n)&&(Me(()=>{console.warn(`[Sentry] ${t} is not instrumented. Please make sure to initialize Sentry in a separate file that you \`--import\` when running node, see: https://docs.sentry.io/platforms/javascript/guides/${t}/install/esm/.`)}),wo().setContext("missing_instrumentation",YL(t)))}import{types as WK}from"util";import{Worker as VK}from"worker_threads";var{isPromise:YK}=WK,jK="LyohIEBzZW50cnkvbm9kZS1jb3JlIDEwLjc1LjMgKDNiMjgyYzEpIHwgaHR0cHM6Ly9naXRodWIuY29tL2dldHNlbnRyeS9zZW50cnktamF2YXNjcmlwdCAqLwppbXBvcnR7U2Vzc2lvbiBhcyB0fWZyb20ibm9kZTppbnNwZWN0b3IiO2ltcG9ydHt3b3JrZXJEYXRhIGFzIG4scGFyZW50UG9ydCBhcyBlfWZyb20ibm9kZTp3b3JrZXJfdGhyZWFkcyI7aW1wb3J0e3Bvc2l4IGFzIHIsc2VwIGFzIG99ZnJvbSJub2RlOnBhdGgiO2ltcG9ydCphcyBpIGZyb20ibm9kZTpodHRwIjtpbXBvcnQqYXMgcyBmcm9tIm5vZGU6aHR0cHMiO2ltcG9ydHtSZWFkYWJsZSBhcyBjfWZyb20ibm9kZTpzdHJlYW0iO2ltcG9ydHtjcmVhdGVHemlwIGFzIHV9ZnJvbSJub2RlOnpsaWIiO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CBmYWlsZWQgb24gd2F0Y2hkb2cgdGltZW91dC4iKX0pKX0pO2U/Lm9uKCJtZXNzYWdlIix0PT57dC5zZXNzaW9uJiYoZm49SCh0LnNlc3Npb24pKSx0LmRlYnVnSW1hZ2VzJiYocG49dC5kZWJ1Z0ltYWdlcyksd24oKX0pOw==",ZK=50,XK=5e3;function YS(e,...t){g.log(`[ANR] ${e}`,...t)}function KK(){return te}function qK(){let e=vn(J(),ne());return e.attachments=[],e.eventProcessors=[],e}async function QK(e){let t={message:"ANR"},n={};for(let r of e.getEventProcessors()){if(t===null)break;t=await r(t,n)}return t?.contexts||{}}var jL="Anr",JK=((e={})=>{if(en.major<16||en.major===16&&en.minor<17)throw new Error("ANR detection requires Node 16.17.0 or later");let t,n,r=KK();return r.__SENTRY_GET_SCOPES__=qK,{name:jL,startWorker:()=>{t||n&&(t=$K(n,e))},stopWorker:()=>{t&&t.then(i=>{i(),t=void 0})},async setup(i){n=i,e.captureStackTrace&&await ja()&&(g.warn("ANR captureStackTrace has been disabled because the debugger was already enabled"),e.captureStackTrace=!1),setImmediate(()=>this.startWorker())}}}),ZL=JK;async function $K(e,t){let n=e.getDsn();if(!n)return()=>{};let r=await QK(e);delete r.app?.app_memory,delete r.device?.free_memory;let i=e.getOptions(),o=e.getSdkMetadata()||{};o.sdk&&(o.sdk.integrations=i.integrations.map(l=>l.name));let s={debug:g.isEnabled(),dsn:n,tunnel:i.tunnel,environment:i.environment||"production",release:i.release,dist:i.dist,sdkMetadata:o,appRootPath:t.appRootPath,pollInterval:t.pollInterval||ZK,anrThreshold:t.anrThreshold||XK,captureStackTrace:!!t.captureStackTrace,maxAnrEvents:t.maxAnrEvents||1,staticTags:t.staticTags||{},contexts:r};if(s.captureStackTrace){let l=await import("inspector");l.url()||l.open(0)}let c=new VK(new URL(`data:application/javascript;base64,${jK}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{c.terminate()});let a=setInterval(()=>{try{let l=J().getSession(),p=l?{...l,toJSON:void 0}:void 0;c.postMessage({session:p,debugImages:jc(i.stackParser)})}catch{}},s.pollInterval);return a.unref(),c.on("message",l=>{l==="session-ended"&&(YS("ANR event sent from ANR worker. Clearing session in this thread."),J().setSession(void 0))}),c.once("error",l=>{clearInterval(a),YS("ANR worker error",l)}),c.once("exit",l=>{clearInterval(a),YS("ANR worker exit",l)}),c.unref(),()=>{c.terminate(),clearInterval(a)}}function XL(e){let t=C()?.getIntegrationByName(jL);if(!t)return e();t.stopWorker();let n=e();return YK(n)?n.finally(()=>t.startWorker()):(t.startWorker(),n)}var jS={};jN(jS,{debug:()=>t9,error:()=>i9,fatal:()=>o9,fmt:()=>ub,info:()=>n9,trace:()=>e9,warn:()=>r9});import{format as zK}from"util";function Oi(e,...t){let[n,r,i,o]=t;if(Array.isArray(r)){let s={...i};s["sentry.message.template"]=n,r.forEach((a,l)=>{s[`sentry.message.parameter.${l}`]=a});let c=zK(n,...r);lr({level:e,message:c,attributes:s},o?.scope)}else lr({level:e,message:n,attributes:r},i?.scope??o?.scope)}function e9(...e){Oi("trace",...e)}function t9(...e){Oi("debug",...e)}function n9(...e){Oi("info",...e)}function r9(...e){Oi("warn",...e)}function i9(...e){Oi("error",...e)}function o9(...e){Oi("fatal",...e)}import{monitorEventLoopDelay as s9,performance as ZS}from"perf_hooks";var KL="NodeRuntimeMetrics",qL=3e4,Mm=1e3,QL=10;function XS(e,t,n){return Number.isFinite(e)?e<Mm?(console.warn(`[Sentry] ${t}: collectionIntervalMs (${e}) is below the minimum of ${Mm}ms. Using minimum of ${Mm}ms.`),Mm):e:(console.warn(`[Sentry] ${t}: collectionIntervalMs (${e}) is invalid. Using default of ${n}ms.`),n)}var JL=(e={})=>{let t=XS(e.collectionIntervalMs??qL,KL,qL),n={cpuUtilization:!0,memHeapUsed:!0,memHeapTotal:!0,memRss:!0,eventLoopDelayP50:!0,eventLoopDelayP99:!0,eventLoopUtilization:!0,uptime:!0,cpuTime:!1,memExternal:!1,eventLoopDelayMin:!1,eventLoopDelayMax:!1,eventLoopDelayMean:!1,eventLoopDelayP90:!1,...e.collect},r=n.eventLoopDelayP99||n.eventLoopDelayMin||n.eventLoopDelayMax||n.eventLoopDelayMean||n.eventLoopDelayP50||n.eventLoopDelayP90,i=n.cpuUtilization||n.cpuTime,o,s,c,a=0,l,p=QL*1e6,u=b=>Math.max(0,(b-p)/1e9),d={attributes:{"sentry.origin":"auto.node.runtime_metrics"}},m={unit:"byte",attributes:{"sentry.origin":"auto.node.runtime_metrics"}},_={unit:"second",attributes:{"sentry.origin":"auto.node.runtime_metrics"}};function h(){let b=tt(),N=b-a;if(i&&s!==void 0){let M=process.cpuUsage(s);n.cpuTime&&(ft.gauge("node.runtime.cpu.user",M.user/1e6,_),ft.gauge("node.runtime.cpu.system",M.system/1e6,_)),n.cpuUtilization&&N>0&&ft.gauge("node.runtime.cpu.utilization",(M.user+M.system)/(N*1e3),d),s=process.cpuUsage()}if(n.memRss||n.memHeapUsed||n.memHeapTotal||n.memExternal){let M=process.memoryUsage();n.memRss&&ft.gauge("node.runtime.mem.rss",M.rss,m),n.memHeapUsed&&ft.gauge("node.runtime.mem.heap_used",M.heapUsed,m),n.memHeapTotal&&ft.gauge("node.runtime.mem.heap_total",M.heapTotal,m),n.memExternal&&(ft.gauge("node.runtime.mem.external",M.external,m),ft.gauge("node.runtime.mem.array_buffers",M.arrayBuffers,m))}if(r&&l&&(n.eventLoopDelayMin&&ft.gauge("node.runtime.event_loop.delay.min",u(l.min),_),n.eventLoopDelayMax&&ft.gauge("node.runtime.event_loop.delay.max",u(l.max),_),n.eventLoopDelayMean&&ft.gauge("node.runtime.event_loop.delay.mean",u(l.mean),_),n.eventLoopDelayP50&&ft.gauge("node.runtime.event_loop.delay.p50",u(l.percentile(50)),_),n.eventLoopDelayP90&&ft.gauge("node.runtime.event_loop.delay.p90",u(l.percentile(90)),_),n.eventLoopDelayP99&&ft.gauge("node.runtime.event_loop.delay.p99",u(l.percentile(99)),_),l.reset()),n.eventLoopUtilization&&c!==void 0){let M=ZS.eventLoopUtilization(),R=ZS.eventLoopUtilization(M,c);ft.gauge("node.runtime.event_loop.utilization",R.utilization,d),c=M}n.uptime&&N>0&&ft.count("node.runtime.process.uptime",N/1e3,_),a=b}return{name:KL,setup(){if(r){l?.disable();try{l=s9({resolution:QL}),l.enable()}catch{l=void 0}}i&&(s=process.cpuUsage()),n.eventLoopUtilization&&(c=ZS.eventLoopUtilization()),a=tt(),o&&clearInterval(o),o=On(setInterval(h,t))}}};var a9=["trace","debug","info","warn","error","fatal"],$L=Symbol.for("level"),c9=Symbol.for("message"),l9=Symbol.for("splat");function zL(e,t){class n extends e{constructor(i){super(i),this._levels=new Set(t?.levels??a9)}log(i,o){try{if(setImmediate(()=>{this.emit("logged",i)}),!V(i))return;let s=i[$L],{level:c,message:a,timestamp:l,...p}=i;p[$L]=void 0,p[c9]=void 0,p[l9]=void 0;let u=t?.customLevelMap?.[s],d=p9[s],m=u??d??"info";this._levels.has(m)?Oi(m,a,{...p,"sentry.origin":"auto.log.winston"}):!u&&!d&&We&&g.log(`Winston log level ${s} is not captured by Sentry. Please add ${s} to the "customLevelMap" option of the Sentry Winston transport.`)}catch{}o&&o()}}return n}var p9={silly:"trace",debug:"debug",verbose:"debug",http:"debug",info:"info",notice:"info",warn:"warn",warning:"warn",error:"error",emerg:"fatal",alert:"fatal",crit:"fatal"};import*as nM from"diagnostics_channel";var KS=Symbol("sentry-track-pino-logger");function eM(e,t,n){let r=Object.getOwnPropertySymbols(e),i=`Symbol(${t})`;for(let o of r)if(o.toString()===i){let s=e[o];return typeof s=="string"?s:n}return n}var tM={error:{levels:[],handled:!0},log:{levels:["trace","debug","info","warn","error","fatal"]}};function u9(e){let{level:t,time:n,pid:r,hostname:i,...o}=e;return o}var d9=(e={})=>{let t={autoInstrument:e.autoInstrument!==!1,error:{...tM.error,...e.error},log:{...tM.log,...e.log}};function n(r){let i=r[KS];return i==="track"||i!=="ignore"&&t.autoInstrument}return{name:"Pino",setup:r=>{let i=!!r.getOptions().enableLogs,o=nM.tracingChannel("pino_asJson");function s(c,a,l){if(!n(c))return;let p=u9(l),[u,d,m]=a,_=c?.levels?.labels?.[m]||"info",h=eM(c,"pino.messageKey","msg"),b=d||p?.[h]||"";if(i&&t.log.levels.includes(_)){let N={...p,"sentry.origin":"auto.log.pino","pino.logger.level":m};lr({level:_,message:b,attributes:N})}if(t.error.levels.includes(_)){let N=eM(c,"pino.errorKey","err"),M={};for(let[v,P]of Object.entries(p))v!==N&&v!==h&&(M[v]=P);b&&(M[h]=b);let R={level:Qi(_),contexts:{pino:M}};Be(v=>{v.addEventProcessor(D=>(D.logger="pino",Dn(D,{handled:t.error.handled,type:"auto.log.pino"}),D));let P=u[N];if(P){me(P,R);return}Zc(b,R)})}}o.end.subscribe(c=>{let{instance:a,arguments:l,result:p}=c;s(a,l,JSON.parse(p))})}}},rM=Object.assign(d9,{trackLogger(e){V(e)&&"levels"in e&&(e[KS]="track")},untrackLogger(e){V(e)&&"levels"in e&&(e[KS]="ignore")}});function qS(e,t){e.setAttribute(S,t)}var m9=[["january","1"],["february","2"],["march","3"],["april","4"],["may","5"],["june","6"],["july","7"],["august","8"],["september","9"],["october","10"],["november","11"],["december","12"],["jan","1"],["feb","2"],["mar","3"],["apr","4"],["may","5"],["jun","6"],["jul","7"],["aug","8"],["sep","9"],["oct","10"],["nov","11"],["dec","12"],["sunday","0"],["monday","1"],["tuesday","2"],["wednesday","3"],["thursday","4"],["friday","5"],["saturday","6"],["sun","0"],["mon","1"],["tue","2"],["wed","3"],["thu","4"],["fri","5"],["sat","6"]];function ls(e){return m9.reduce((t,[n,r])=>t.replace(new RegExp(n,"gi"),r),e)}var iM="Automatic instrumentation of CronJob only supports crontab string";function oM(e,t){let n=!1;return new Proxy(e,{construct(r,i){let[o,s,c,a,l,...p]=i;if(typeof o!="string")throw new Error(iM);if(n)throw new Error(`A job named '${t}' has already been scheduled`);n=!0;let u=ls(o);async function d(m,_){return Dr(t,async()=>{try{await s(m,_)}catch(h){throw me(h,{mechanism:{handled:!1,type:"auto.function.cron.instrumentCron"}}),h}},{schedule:{type:"crontab",value:u},timezone:l||void 0})}return new r(o,d,c,a,l,...p)},get(r,i){return i==="from"?o=>{let{cronTime:s,onTick:c,timeZone:a}=o;if(typeof s!="string")throw new Error(iM);if(n)throw new Error(`A job named '${t}' has already been scheduled`);n=!0;let l=ls(s);return o.onTick=async(p,u)=>Dr(t,async()=>{try{await c(p,u)}catch(d){throw me(d,{mechanism:{handled:!1,type:"auto.function.cron.instrumentCron"}}),d}},{schedule:{type:"crontab",value:l},timezone:a||void 0}),r.from(o)}:r[i]}})}function sM(e,t={}){return new Proxy(e,{get(n,r){return r==="schedule"&&n.schedule?new Proxy(n.schedule,{apply(i,o,s){let[c,a,l]=s,p=l?.name,u=l?.timezone;if(!p)throw new Error('Missing "name" for scheduled job. A name is required for Sentry check-in monitoring.');let d=async(...m)=>Dr(p,async()=>{try{return await a(...m)}catch(_){throw me(_,{mechanism:{handled:!1,type:"auto.function.node-cron.instrumentNodeCron"}}),_}},{schedule:{type:"crontab",value:ls(c)},timezone:u,...t});return i.apply(o,[c,d,l])}}):n[r]}})}function aM(e){return new Proxy(e,{get(t,n){return n==="scheduleJob"?new Proxy(t.scheduleJob,{apply(r,i,o){let[s,c,a]=o;if(typeof s!="string"||typeof c!="string"||typeof a!="function")throw new Error("Automatic instrumentation of 'node-schedule' requires the first parameter of 'scheduleJob' to be a job name string and the second parameter to be a crontab string");let l=s,p=c;async function u(){return Dr(l,async()=>{await a?.()},{schedule:{type:"crontab",value:ls(p)}})}return r.apply(i,[l,p,u])}}):t[n]}})}var cM={instrumentCron:oM,instrumentNodeCron:sM,instrumentNodeSchedule:aM};var lM="Http",pM=Object.assign(is,{id:`${lM}.sentry`}),QS=(e={})=>{let t=e.spans??!0,n=e.disableIncomingRequestSpans,r=t&&!n,i={sessions:e.trackIncomingRequestsAsSessions,sessionFlushingDelayMS:e.sessionFlushingDelayMS,ignoreRequestBody:e.ignoreIncomingRequestBody,maxRequestBodySize:e.maxIncomingRequestBodySize},o={ignoreIncomingRequests:e.ignoreIncomingRequests,ignoreStaticAssets:e.ignoreStaticAssets,ignoreStatusCodes:e.dropSpansForIncomingRequestStatusCodes,instrumentation:e.instrumentation,onSpanCreated:e.incomingRequestSpanHook},s=ka(i),c=La(o);return{name:lM,setup(a){let l=a.getOptions();r&&Ue(l)&&c.setup(a)},setupOnce(){s.setupOnce();let a={breadcrumbs:e.breadcrumbs,spans:t,propagateTraceInOutgoingRequests:e.tracePropagation??!0,createSpansForOutgoingRequests:t,ignoreOutgoingRequests:e.ignoreOutgoingRequests,outgoingRequestHook:(l,p)=>{let u=fr(p);if(u.startsWith("data:")){let d=el(u);l.setAttribute("http.url",d),l.setAttribute(pt,d),l.updateName(`${p.method||"GET"} ${d}`)}e.instrumentation?.requestHook?.(l,p)},outgoingResponseHook:e.instrumentation?.responseHook,outgoingRequestApplyCustomAttributes:e.instrumentation?.applyCustomAttributesOnSpan};is(a)},processEvent(a){return c.processEvent(a)}}};var f9=((e={})=>({name:"NodeFetch",setupOnce(){let t=C()?.getOptions();Vl({...e,spans:g9(e,t)})}})),JS=f9;function g9(e,t={}){return e.spans??(!t.skipOpenTelemetrySetup&&Ue(t))}import*as Gm from"fs";import{promisify as h9}from"util";var uM=["access","appendFile","chmod","chown","copyFile","cp","lchown","link","lstat","lutimes","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"],dM=["access","appendFile","chmod","chown","copyFile","cp","exists","lchown","link","lstat","lutimes","mkdir","mkdtemp","open","opendir","readdir","readFile","readlink","realpath","realpath.native","rename","rm","rmdir","stat","symlink","truncate","unlink","utimes","writeFile"],mM=["accessSync","appendFileSync","chmodSync","chownSync","copyFileSync","cpSync","existsSync","lchownSync","linkSync","lstatSync","lutimesSync","mkdirSync","mkdtempSync","opendirSync","openSync","readdirSync","readFileSync","readlinkSync","realpathSync","realpathSync.native","renameSync","rmdirSync","rmSync","statSync","symlinkSync","truncateSync","unlinkSync","utimesSync","writeFileSync"];function _9(e){let t=e.split(".");if(t.length>1){if(t.length!==2)throw Error(`Invalid member function name ${e}`);return t}else return[e]}function $S(e,t){if(!t)throw new Error(JSON.stringify({member:t}));let n=_9(t),[r,i]=n;return i?{objectToPatch:e[r],functionNameToPatch:i}:{objectToPatch:e,functionNameToPatch:r}}var b9="auto.file.fs",y9="file",S9=["rename","renameSync"],E9=["copyFile","cp","copyFileSync","cpSync"],T9=["link","linkSync"],I9=["mkdtemp","mkdtempSync"],A9=["symlink","symlinkSync"],N9=["access","appendFile","chmod","chown","exists","mkdir","lchown","lstat","lutimes","open","opendir","readdir","readFile","readlink","realpath","realpath.native","rm","rmdir","stat","truncate","unlink","utimes","writeFile","accessSync","appendFileSync","chmodSync","chownSync","existsSync","lchownSync","lstatSync","lutimesSync","opendirSync","mkdirSync","openSync","readdirSync","readFileSync","readlinkSync","realpathSync","realpathSync.native","rmdirSync","rmSync","statSync","truncateSync","unlinkSync","utimesSync","writeFileSync"];function Um(e,t,n){let r={[B]:y9,[S]:b9};return n.recordFilePaths&&(typeof t[0]=="string"&&N9.includes(e)?r.path_argument=t[0]:typeof t[0]=="string"&&typeof t[1]=="string"?A9.includes(e)?(r.target_argument=t[0],r.path_argument=t[1]):T9.includes(e)?(r.existing_path_argument=t[0],r.new_path_argument=t[1]):E9.includes(e)?(r.src_argument=t[0],r.dest_argument=t[1]):S9.includes(e)&&(r.old_path_argument=t[0],r.new_path_argument=t[1]):typeof t[0]=="string"&&I9.includes(e)&&(r.prefix_argument=t[0])),r}function Dm(e,t){return Object.assign(e,t)}var fM=new WeakMap;function wm(e,t,n){let r=e[t];if(typeof r!="function")return;let i=fM.get(e);i||(i=new Set,fM.set(e,i)),!i.has(t)&&(i.add(t),e[t]=n(r))}function v9(e,t,n){return Dm(function(...i){let o=Um(e,i,n);return Se({name:`fs.${e}`,onlyIfParent:!0,attributes:o},s=>{try{return Fn(()=>t.apply(this,i))}catch(c){throw np(s,c,n),c}})},t)}function R9(e,t,n){return Dm(function(...i){let o=i.length-1,s=i[o];if(typeof s!="function")return t.apply(this,i);let c=Um(e,i,n),a=k({name:`fs.${e}`,onlyIfParent:!0,attributes:c}),l=Q();i[o]=function(...p){let u=p[0];return u&&np(a,u,n),a.end(),l?se(l,()=>s.apply(this,p)):s.apply(this,p)};try{return Fn(()=>t.apply(this,i))}catch(p){throw np(a,p,n),a.end(),p}},t)}function O9(e,t){let n="exists",i=Dm(function(...s){let c=s.length-1,a=s[c];if(typeof a!="function")return e.apply(this,s);let l=Um(n,s,t),p=k({name:`fs.${n}`,onlyIfParent:!0,attributes:l}),u=Q();s[c]=function(...d){return p.end(),u?se(u,()=>a.apply(this,d)):a.apply(this,d)};try{return Fn(()=>e.apply(this,s))}catch(d){throw np(p,d,t),p.end(),d}},e),o=function(s){return new Promise(c=>i(s,c))};return Object.defineProperty(o,"name",{value:n}),Object.defineProperty(i,h9.custom,{value:o}),i}function C9(e,t,n){return Dm(async function(...i){let o=Um(e,i,n);return Se({name:`fs.${e}`,onlyIfParent:!0,attributes:o},async s=>{try{return await Fn(()=>t.apply(this,i))}catch(c){throw np(s,c,n),c}})},t)}function gM(e={}){for(let n of mM){let{objectToPatch:r,functionNameToPatch:i}=$S(Gm,n);wm(r,i,o=>v9(n,o,e))}for(let n of dM){let{objectToPatch:r,functionNameToPatch:i}=$S(Gm,n);n==="exists"?wm(r,i,o=>O9(o,e)):wm(r,i,o=>R9(n,o,e))}let t=Gm.promises;for(let n of uM)wm(t,n,r=>C9(n,r,e))}function np(e,t,n){e.setStatus({code:2,message:"internal_error"}),n.recordErrorMessagesAsSpanAttributes&&t instanceof Error&&e.setAttribute("fs_error",t.message)}var x9="FileSystem",P9=(e={})=>({name:x9,setupOnce(){gM(e)}});var Ye=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function $r(e){let t=Q();if(!t)return;let n=Re(t);n&&oe(n).data[B]==="http.server"&&n.setAttribute("http.route",e)}var _M="Express",k9=[">=4.0.0 <6"];function L9(e,t){Ay(e,t),_r(e.use,"express")}var eE=de(_M,e=>new zS(e)),zS=class extends ae{constructor(t={}){super("sentry-express",q,t)}init(){return new re("express",k9,n=>{try{Ty(n,()=>({...this.getConfig(),onRouteResolved(r){r&&$r(r)}}))}catch(r){Ye&&g.error("Failed to patch express module:",r)}return n},n=>n)}},M9=(e=>({name:_M,setupOnce(){eE(e)},getShouldHandleError(){return e?.shouldHandleError}})),tE=M9;at();var co=(e=>(e.FASTIFY_NAME="fastify.name",e.FASTIFY_TYPE="fastify.type",e.HOOK_NAME="hook.name",e.PLUGIN_NAME="plugin.name",e))(co||{}),Bm=(e=>(e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler",e))(Bm||{}),Hm=(e=>(e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler",e))(Hm||{});at();var rp=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function nE(e,t,n,r={}){let i=t.startSpan(n,{attributes:r}),o=e[rp]||[];return o.push(i),Object.defineProperty(e,rp,{enumerable:!1,configurable:!0,value:o}),i}function Fm(e,t){let n=e[rp]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:Gn.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[rp])}function bM(e,t,n){let r,i;try{i=e(),hM(i)&&i.then(o=>t(void 0,o),o=>t(o))}catch(o){r=o}finally{if(!hM(i)&&(t(r,i),r))throw r;return i}}function hM(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var w9="@sentry/instrumentation-fastify-v3",yM="anonymous",G9=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),Wm=class extends ae{constructor(t={}){super(w9,q,t)}init(){return[new re("fastify",[">=3.0.0 <3.21.0"],t=>this._patchConstructor(t))]}_hookOnRequest(){let t=this;return function(r,i,o){if(!t.isEnabled())return o();t._wrap(i,"send",t._patchSend());let s=r,c=s.routeOptions?s.routeOptions.url:r.routerPath;c&&$r(c);let a=r.method||"GET";J().setTransactionName(`${a} ${c}`),o()}}_wrapHandler(t,n,r,i){let o=this;return this._diag.debug("Patching fastify route.handler function"),function(...s){if(!o.isEnabled())return r.apply(this,s);let c=r.name||t||yM,a=`${Hm.MIDDLEWARE} - ${c}`,l=s[1],p=nE(l,o.tracer,a,{[co.FASTIFY_TYPE]:Bm.MIDDLEWARE,[co.PLUGIN_NAME]:t,[co.HOOK_NAME]:n}),u=i&&s[s.length-1];return u&&(s[s.length-1]=function(...d){Fm(l),u.apply(this,d)}),pe.with(he.setSpan(pe.active(),p),()=>bM(()=>r.apply(this,s),d=>{d instanceof Error&&(p.setStatus({code:Gn.ERROR,message:d.message}),p.recordException(d)),i||Fm(l)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...i){let o=i[0],s=i[1],c=this.pluginName;if(!G9.has(o))return n.apply(this,i);let a=typeof i[i.length-1]=="function"&&s.constructor.name!=="AsyncFunction";return n.apply(this,[o,t._wrapHandler(c,o,s,a)])}}}_patchConstructor(t){let n=this;function r(...i){let o=t.fastify.apply(this,i);return o.addHook("onRequest",n._hookOnRequest()),o.addHook("preHandler",n._hookPreHandler()),U9(),n._wrap(o,"addHook",n._wrapAddHook()),o}return t.errorCodes!==void 0&&(r.errorCodes=t.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let t=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...o){let s=o[0];return t.isEnabled()?qr(()=>r.apply(this,o),c=>{!c&&s instanceof Error&&(c=s),Fm(this,c)}):r.apply(this,o)}}}_hookPreHandler(){let t=this;return this._diag.debug("Patching fastify preHandler function"),function(r,i,o){if(!t.isEnabled())return o();let s=r,c=s.routeOptions?.handler||s.context?.handler,a=c?.name.startsWith("bound ")?c.name.substring(6):c?.name,l=`${Hm.REQUEST_HANDLER} - ${a||this.pluginName||yM}`,p={[co.PLUGIN_NAME]:this.pluginName,[co.FASTIFY_TYPE]:Bm.REQUEST_HANDLER,[He]:s.routeOptions?s.routeOptions.url:r.routerPath};a&&(p[co.FASTIFY_NAME]=a);let u=nE(i,t.tracer,l,p);SM(u);let{requestHook:d}=t.getConfig();return d&&qr(()=>d(u,{request:r}),m=>{m&&t._diag.error("request hook failed",m)},!0),pe.with(he.setSpan(pe.active(),u),()=>{o()})}}};function U9(){let e=C();e&&e.on("spanStart",t=>{SM(t)})}function SM(e){let t=oe(e).data,n=t["fastify.type"];if(t[B]||!n)return;e.setAttributes({[S]:"auto.http.otel.fastify",[B]:`${n}.fastify`});let r=t["fastify.name"]||t["plugin.name"]||t["hook.name"];if(typeof r=="string"){let i=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(i)}}import*as sE from"diagnostics_channel";var EM="execute_tool";var TM="invoke_agent";var Ci="graphql";var $=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var iE=()=>{};function ee(e,t,n){let r=D9(e,t,n),i=n?.beforeSpanEnd,o=n?.deferSpanEnd,s=p=>typeof n?.captureError=="function"?n.captureError(p):{mechanism:{type:"auto.diagnostic_channels.bind_span",handled:!1}},c=(p,u)=>{n?.captureError&&me(u,s(u));let{message:d,attributes:m}=B9(u);p.setStatus({code:2,message:d}),p.setAttributes(m)},a=(p,u)=>{let d=!1;return m=>{d||(d=!0,m!==void 0&&(c(p,m),u.error=m),rE(u,i))}},l={start:iE,asyncStart:iE,end(p){if("error"in p||"result"in p){let u=p._sentrySpan;if(u&&o?.({span:u,data:p,end:a(u,p)}))return;rE(p,i)}},error(p){let u=p._sentrySpan;u&&c(u,p.error)},asyncEnd(p){let u=p._sentrySpan;u&&o?.({span:u,data:p,end:a(u,p)})||rE(p,i)}};return r.channel.subscribe(l),{channel:r.channel,unbind:()=>{r.channel.unsubscribe(l),r.unbind()}}}function D9(e,t,n){let r=St(Je()).getTracingChannelBinding?.();if(!r)return $&&g.log("[TracingChannel] Could not access async context binding."),{channel:e,unbind:iE};let i=r.asyncLocalStorage;return e.start.bindStore(i,o=>{o._sentryCallerStore=i.getStore();let c=!n?.requiresParentSpan||Q()?t(o):void 0;return c?(o._sentrySpan=c,r.getStoreWithActiveSpan(c)):o._sentryCallerStore}),e.asyncStart.bindStore(i,o=>o._sentryCallerStore),{channel:e,unbind:()=>{e.start.unbindStore(i),e.asyncStart.unbindStore(i)}}}function rE(e,t){let n=e._sentrySpan;n&&(t?.(n,e),n.end())}function B9(e){let t=V(e),n=t?"message"in e?e.message:void 0:e,r=n?String(n):void 0,i=t&&"name"in e?String(e.name):"unknown";return{message:r,attributes:{[wr]:i}}}var oE="original-description",H9=new Set(["Int","Float","String","BlockString"]);function Vm(e,t,n){let r=Re(e);if(r===e)return;let i=oe(r),o=n?`${t} ${n}`:t,s=i.data[Rh],c;Array.isArray(s)?c=[...s,o]:typeof s=="string"?c=[s,o]:c=o,r.setAttribute(Rh,c);let a=i.data[oE]??i.description;i.data[oE]||r.setAttribute(oE,a),r.updateName(`${a} (${F9(c)})`)}function F9(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return e}function Ym(e,t,n){return e&&t?`${e} ${t}`:e||n}function jm(e){if(V(e)&&"errors"in e){let t=e.errors;return Array.isArray(t)&&t.length>0}return!1}function W9(e){let t=e?.loc,n=t?.source?.body;if(!(typeof n!="string"||!t?.startToken))try{let r=[];for(let o=t.startToken;o;o=o.next)H9.has(o.kind)&&r.push({start:o.start,end:o.end,kind:o.kind});let i=n;for(let o=r.length-1;o>=0;o--){let{start:s,end:c,kind:a}=r[o],l=a==="String"||a==="BlockString"?'"*"':"*";i=i.slice(0,s)+l+i.slice(c)}return i}catch{return}}function Xa(e){if(C()?.getDataCollectionOptions().graphQL.document===!0)return W9(e)}var V9="graphql:parse",Y9="graphql:validate",j9="graphql:execute",Z9="graphql:subscribe",X9="graphql:resolve",Zm="auto.graphql.diagnostic_channel",K9="graphql.parse",q9="graphql.validate",Q9="graphql.execute",J9="graphql.subscribe",$9="graphql.resolve",z9="graphql.field.name",eq="graphql.field.path",tq="graphql.field.type",nq="graphql.parent.name";function AM(e,t={}){let n=t.ignoreResolveSpans!==!1,r=t.ignoreTrivialResolveSpans!==!1,i=t.useOperationNameForRootSpan!==!1;rq(e),iq(e),IM(e,j9,Q9,i),IM(e,Z9,J9,i),n||oq(e,r)}function rq(e){ee(e(V9),()=>k({name:K9,attributes:{[S]:Zm,[B]:Ci}}))}function iq(e){ee(e(Y9),t=>k({name:q9,attributes:{[S]:Zm,[B]:Ci,[zs]:Xa(t.document)}}),{beforeSpanEnd:(t,n)=>{Array.isArray(n.result)&&n.result.length>0&&t.setStatus({code:2,message:"invalid_argument"})}})}function IM(e,t,n,r){ee(e(t),i=>{let o=k({name:Ym(i.operationType,i.operationName,n),attributes:{[S]:Zm,[B]:Ci,[Iu]:i.operationType,[Tu]:i.operationName||void 0,[zs]:Xa(i.document)}});return r&&i.operationType&&Vm(o,i.operationType,i.operationName),o},{beforeSpanEnd:(i,o)=>{jm(o.result)&&i.setStatus({code:2,message:"internal_error"})}})}function oq(e,t){ee(e(X9),n=>{if(!(t&&n.isDefaultResolver))return k({name:`${$9} ${n.fieldPath}`,attributes:{[S]:Zm,[B]:Ci,[z9]:n.fieldName,[eq]:n.fieldPath,[tq]:n.fieldType,[nq]:n.parentType}})})}var sq=((e={})=>({name:"Graphql",setupOnce(){sE.tracingChannel&&ue(()=>{AM(sE.tracingChannel,e)})}})),ip=sq;import*as cE from"diagnostics_channel";var aq="mongoose:query",cq="mongoose:aggregate",lq="mongoose:model:save",pq="mongoose:model:insertMany",uq="mongoose:model:bulkWrite",dq="mongoose:cursor:next",mq="auto.db.mongoose.diagnostic_channel",fq="mongodb",gq=10,NM=!1;function Xm(e){if(!NM){NM=!0;try{Ka(e,aq),Ka(e,cq),Ka(e,lq),Ka(e,pq),Ka(e,uq),Ka(e,dq)}catch{$&&g.log("Mongoose node:diagnostics_channel subscription failed.")}}}function Ka(e,t){ee(e(t),n=>{let r=n.collection,i=hq(n.args?.pipeline??n.args?.filter),o=_q(n);return k({name:r?`mongoose.${r}.${n.operation}`:`mongoose.${n.operation}`,attributes:{[S]:mq,[B]:"db",[mt]:fq,[ar]:n.operation,[Qs]:r??void 0,[fi]:n.database??void 0,[Mr]:i??void 0,[$s]:o??void 0,[_t]:n.serverAddress??void 0,[ht]:n.serverPort??void 0}})})}function _q(e){let t=e.args,n=e.operation==="insertMany"?t?.docs:e.operation==="bulkWrite"?t?.ops:void 0;return Array.isArray(n)&&n.length>1?n.length:void 0}function hq(e){if(e!=null)try{let t=aE(e,0),n=JSON.stringify(t);return n==null||n==="{}"||n==="[]"?void 0:n}catch{return}}function aE(e,t){if(t>gq)return"?";if(Array.isArray(e))return e.map(n=>aE(n,t+1));if(V(e)){let n={};for(let r of Object.keys(e))n[r]=aE(e[r],t+1);return n}return"?"}var bq=(()=>({name:"Mongoose",setupOnce(){cE.tracingChannel&&ue(()=>{Xm(cE.tracingChannel)})}})),lE=bq;var yq="db.system",Sq="db.name",vM="db.operation",Eq="db.statement",Tq="db.mongodb.collection",Iq="db.connection_string",Aq="net.peer.name",Nq="net.peer.port",vq="mongodb";function Rq(e){return JSON.stringify(pE(e))}function pE(e){if(Array.isArray(e))return e.map(t=>pE(t));if(Oq(e)){let t={};return Object.entries(e).map(([n,r])=>[n,pE(r)]).reduce((n,r)=>(xq(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function Oq(e){return V(e)&&!Cq(e)}function Cq(e){return typeof Buffer<"u"&&Buffer.isBuffer(e)}function xq(e){return Array.isArray(e)}function op(e,t,n,r,i){let o,s;if(e){let a=typeof e.address=="string"?e.address.split(":"):"";a.length===2&&(o=a[0],s=a[1])}let c;return n?.documents?.[0]?c=n.documents[0]:n?.cursors?c=n.cursors:c=n,RM(t.db,t.collection,o,s,c,r,i)}function RM(e,t,n,r,i,o,s){let c={[S]:s,[yq]:vq,[Sq]:e,[Tq]:t,[vM]:o,[Iq]:`mongodb://${n}:${r}/${e}`};if(n&&r){c[Aq]=n;let a=parseInt(r,10);isNaN(a)||(c[Nq]=a)}if(i)try{c[Eq]=Rq(i)}catch{}return c}function sp(e){if(e.createIndexes!==void 0)return"createIndexes";if(e.findandmodify!==void 0)return"findAndModify";if(e.ismaster!==void 0)return"isMaster";if(e.count!==void 0)return"count";if(e.aggregate!==void 0)return"aggregate"}function ap(e,t,n,r,i){let o,s;if(t?.s&&(o=t.s.options?.host??t.s.host,s=(t.s.options?.port??t.s.port)?.toString(),o==null||s==null)){let p=t.description?.address;if(p){let u=p.split(":");o=u[0],s=u[1]}}let[c,a]=e.toString().split("."),l=n?.query??n?.q??n;return RM(c,a,o,s,l,r,i)}function hr(e){return k({name:`mongodb.${e[vM]||"command"}`,op:"db",kind:U.CLIENT,attributes:e})}import*as uE from"diagnostics_channel";var Pq="mysql2:query",kq="mysql2:execute",Lq="mysql2:connect",Mq="mysql2:pool:connect",xM="auto.db.mysql2.diagnostic_channel",PM="mysql",wq=/^\s*(\w+)/;function Km(e){OM(e,Pq),OM(e,kq),CM(e,Lq,"mysql2.connect"),CM(e,Mq,"mysql2.pool.connect")}function OM(e,t){ee(e(t),n=>{let r=n.query?xa(n.query):void 0,i=r?.match(wq)?.[1]?.toUpperCase();return k({name:r||"mysql2.query",attributes:{[S]:xM,[B]:"db",[mt]:PM,[Mr]:r,[ar]:i,[fi]:n.database||void 0,[_t]:n.serverAddress,[ht]:n.serverPort}})},{requiresParentSpan:!0})}function CM(e,t,n){ee(e(t),r=>k({name:n,attributes:{[S]:xM,[B]:"db",[mt]:PM,[fi]:r.database||void 0,[_t]:r.serverAddress,[ht]:r.serverPort}}),{requiresParentSpan:!0})}var Gq=(()=>({name:"Mysql2",setupOnce(){uE.tracingChannel&&ue(()=>{Km(uE.tracingChannel)})}})),dE=Gq;var Uq="PRISMA_INSTRUMENTATION",Dq="V7_PRISMA_INSTRUMENTATION",kM=globalThis;function LM(e){let t={helper:e};kM[Dq]=t,kM[Uq]=t}var Bq=(()=>{try{return process.env.PRISMA_SHOW_ALL_TRACES==="true"}catch{return!1}})(),Hq="00-10-10-00",Fq="auto.db.otel.prisma",wM=1e3,mE=new Wt(wM),qa=[];function fE(e,t){mE.set(e,t)}function gE(e,t){let n={...t,[S]:Fq};return e==="prisma:engine:db_query"&&n[Pe]==null&&(n[Pe]="prisma"),n}function _E(e,t){let n=t["db.query.text"];return(e==="prisma:engine:db_query"||e==="prisma:client:db_query")&&typeof n=="string"?n:e}function Wq(){let e=!0;for(;e;){e=!1;for(let t=qa.length-1;t>=0;t--){let n=qa[t],r=mE.get(n.parent_span_id);if(!r)continue;let i=gE(n.name,n.attributes),o=k({name:_E(n.name,i),attributes:i,kind:n.kind==="client"?U.CLIENT:U.INTERNAL,startTime:n.start_time,parentSpan:r});fE(n.span_id,o),n.links&&o.addLinks(n.links.flatMap(s=>{let c=mE.get(s.span_id);return c?[{context:c.spanContext()}]:[]})),o.end(n.end_time),qa.splice(t,1),e=!0}}}var qm=class{constructor({ignoreSpanTypes:t}){this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(t){let n=(t??Q())?.spanContext();return n?`00-${n.traceId}-${n.spanId}-0${n.traceFlags}`:Hq}dispatchEngineSpans(t){let n=new Map,r=t.filter(i=>i.parentId===null);for(let i of r)GM(i,t,n,this.ignoreSpanTypes)}createEngineSpan(t){qa.push(...t.spans),Wq();let n=qa.length-wM;n>0&&($&&g.log(`[Prisma] Dropping ${n} unresolved v5 engine span(s) whose parent was never registered.`),qa.splice(0,n))}getActiveContext(){return Q()}runInChildSpan(t,n){let r=typeof t=="string"?{name:t}:t;if(r.internal&&!Bq)return n();let i=`prisma:client:${r.name}`;if(UM(i,this.ignoreSpanTypes))return n();let o=Q(),s=gE(i,r.attributes),c={name:_E(i,s),attributes:s,kind:r.kind,links:r.links,startTime:r.startTime,parentSpan:o};if(r.active===!1){let a=k(c);return fE(a.spanContext().spanId,a),MM(a,()=>n(a,o))}return ke(c,a=>(fE(a.spanContext().spanId,a),MM(a,()=>n(a,o))))}};function GM(e,t,n,r){if(UM(e.name,r))return;let i=gE(e.name,e.attributes);ke({name:_E(e.name,i),attributes:i,kind:e.kind==="client"?U.CLIENT:U.INTERNAL,startTime:e.startTime},o=>{n.set(e.id,o.spanContext().spanId),e.links&&o.addLinks(e.links.flatMap(c=>{let a=n.get(c);return a?{context:{spanId:a,traceId:o.spanContext().traceId,traceFlags:o.spanContext().traceFlags}}:[]}));let s=t.filter(c=>c.parentId===e.id);for(let c of s)GM(c,t,n,r);o.end(e.endTime)})}function MM(e,t){let n;try{n=t()}catch(r){throw e.end(),r}return Vq(n)?n.then(r=>(e.end(),r),r=>{throw e.end(),r}):(e.end(),n)}function Vq(e){return e!=null&&typeof e.then=="function"}function UM(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var Yq="Prisma";function DM(e){LM(new qm({ignoreSpanTypes:e?.instrumentationConfig?.ignoreSpanTypes??[]}))}var jq=(e=>({name:Yq,setupOnce(){DM(e)}})),Qm=jq;import*as yE from"diagnostics_channel";var Zq="node-redis:command",Xq="node-redis:batch",Kq="node-redis:connect",qq="ioredis:command",Qq="ioredis:connect",hE="auto.db.redis.diagnostic_channel",bE="redis";function FM(e,t){BM(e,Zq,n=>n.args.slice(1),t),Jq(e,Xq,n=>n.batchMode==="PIPELINE"?"PIPELINE":"MULTI"),HM(e,Kq),BM(e,qq,n=>n.args,t),HM(e,Qq)}function BM(e,t,n,r){ee(e(t),i=>{let o=n(i),s=o.length?`${i.command} ${o.join(" ")}`:i.command;return k({name:`redis-${i.command}`,attributes:{[S]:hE,[B]:"db.redis",[mt]:bE,[Mr]:s,...i.serverAddress!=null?{[_t]:i.serverAddress}:{},...i.serverPort!=null?{[ht]:i.serverPort}:{}}})},{beforeSpanEnd(i,o){"error"in o||$q(r,i,o.command,n(o),o.result)}})}function Jq(e,t,n){ee(e(t),r=>k({name:n(r),attributes:{[S]:hE,[B]:"db.redis",[mt]:bE,...Number(r.batchSize)>1?{[$s]:r.batchSize}:{},...r.serverAddress!=null?{[_t]:r.serverAddress}:{},...r.serverPort!=null?{[ht]:r.serverPort}:{}}}))}function HM(e,t){ee(e(t),n=>k({name:"redis-connect",attributes:{[S]:hE,[B]:"db.redis.connect",[mt]:bE,...n.serverAddress!=null?{[_t]:n.serverAddress}:{},...n.serverPort!=null?{[ht]:n.serverPort}:{}}}))}function $q(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}var zq=((e={})=>({name:"Redis",setupOnce(){yE.tracingChannel&&ue(()=>{FM(yE.tracingChannel,e.responseHook)})}})),SE=zq;var e4=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],zr=(e,t)=>{if(Array.isArray(t)&&t.length){let n=e4.find(({regex:i})=>i.test(e))?.args??0,r=n>=0?t.slice(0,n):t.slice();return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};function Fe(e){return typeof e=="string"?e:void 0}function Jm(e){return typeof e=="number"&&!isNaN(e)?e:void 0}function EE(e,t){return e===void 0&&t===void 0?void 0:(e??0)+(t??0)}function $m(e){return V(e)&&typeof e.pipeThrough=="function"&&typeof e.getReader=="function"}function zm(e,t,n){let r=e.getReader(),i={toolCalls:[]},o="",s=!1,c=()=>{s||(s=!0,o&&(i.text=o),t(i))},a=l=>{s||(s=!0,n(l))};return new ReadableStream({async pull(l){try{let{done:p,value:u}=await r.read();if(p){c(),l.close();return}o+=t4(i,u)??"",l.enqueue(u)}catch(p){a(p),l.error(p)}},cancel(l){return c(),r.cancel(l)}})}function t4(e,t){if(!V(t))return;let{type:n,delta:r,textDelta:i,id:o,modelId:s,toolCallId:c,toolName:a,input:l,args:p,finishReason:u,usage:d,providerMetadata:m}=t;switch(n){case"text-delta":{let _=r??i;return typeof _=="string"?_:void 0}case"tool-call":e.toolCalls.push({toolCallId:c,toolName:a,input:l??p});return;case"response-metadata":typeof o=="string"&&(e.responseId=o),typeof s=="string"&&(e.responseModel=s);return;case"finish":e.finishReason=u,e.usage=d,m!==void 0&&(e.providerMetadata=m);return;default:return}}var n4="ai:telemetry",VM="auto.vercelai.channel",r4="gen_ai.tool.call.id",i4="gen_ai.tool.description",o4="embeddings",s4="rerank",a4="generate_content",c4="WorkersAI",YM="vercel.ai.operationId",l4="vercel.ai.model.provider",p4="vercel.ai.settings.maxRetries",IE=new Map,ef=new Map,AE=new Map,jM=new Set(["generateText","streamText","generateObject","embed","embedMany","rerank"]);function NE(e){if(!jM.has(e.type))return;let t=Fe(e.event.callId);t&&vE(t)}function vE(e){IE.delete(e),ef.delete(e),AE.delete(e)}function u4(e,t){if(jM.has(t))for(let n of ld)delete e[n]}function d4(e,t){if(!e||!Array.isArray(t))return;let n=ef.get(e);for(let r of t)V(r)&&typeof r.name=="string"&&typeof r.description=="string"&&(n=n??new Map,n.has(r.name)||n.set(r.name,r.description));n&&ef.set(e,n)}function m4(e,t,n){let r=e?ef.get(e)?.get(t):void 0;if(r)return r;if(Array.isArray(n)){let i=n.find(o=>V(o)&&o.name===t);return V(i)?Fe(i.description):void 0}if(V(n)){let i=n[t];return V(i)?Fe(i.description):void 0}}function ZM(e,t={}){ee(e(n4),n=>lp(n,t),{beforeSpanEnd:(n,r)=>{Qa(n,r,t),NE(r)},deferSpanEnd:({data:n,end:r})=>f4(n,t,r)})}function f4(e,t,n){if(e.type!=="languageModelCall"||!V(e.result))return!1;let r=e.result,i=r.stream;if(!$m(i))return!1;let o=Fe(e.event.callId),{recordOutputs:s}=CE(e.event,t);return r.stream=zm(i,c=>{e.result={...r,...RE(c)},n(),g4(o,c,s)},c=>n(c)),!0}function RE(e){let t=[];e.text&&t.push({type:"text",text:e.text});for(let n of e.toolCalls)t.push({type:"tool-call",...n});return{content:t,...e.usage!==void 0?{usage:e.usage}:{},...e.finishReason!==void 0?{finishReason:e.finishReason}:{},...e.providerMetadata!==void 0?{providerMetadata:e.providerMetadata}:{},...e.responseId||e.responseModel?{response:{...e.responseId?{id:e.responseId}:{},...e.responseModel?{modelId:e.responseModel}:{}}}:{}}}function g4(e,t,n){let r=e?AE.get(e):void 0;if(!r)return;let i=V(t.usage)?t.usage:void 0;if(i){let o=jn(i.inputTokens)??jn(i.promptTokens)??jn(i.tokens),s=jn(i.outputTokens)??jn(i.completionTokens);TE(r,Jt,o),TE(r,Tt,s),TE(r,Ah,jn(i.totalTokens)??EE(o,s))}if(n){let o=QM(t.text,t.toolCalls),s=KM(o,XM({finishReason:t.finishReason}));s&&r.setAttribute(Ih,s)}}function TE(e,t,n){if(n===void 0)return;let r=oe(e).data[t];e.setAttribute(t,(typeof r=="number"?r:0)+n)}function lp(e,t){let{type:n,event:r}=e;if(n==="step"||!r||typeof r!="object")return;let{recordInputs:i,enableTruncation:o}=CE(r,t),s=Fe(r.provider),c=Fe(r.modelId),a=Fe(r.callId),l=Jm(r.maxRetries);i&&d4(a,r.tools);let p={[S]:VM,...s?{[Yc]:s,[l4]:s}:{},...c?{[Vc]:c}:{},...l!==void 0?{[p4]:l}:{}};switch(n){case"generateText":case"streamText":case"generateObject":return _4(r,p,i,o,a,n==="streamText");case"languageModelCall":return Ti([c4]),h4(r,p,i,o,a,c);case"executeTool":return b4(r,i);case"embed":case"embedMany":{let u=n==="embedMany"?r.values:r.value;return cp(o4,c,{...p,...i&&u!==void 0?{[UR]:Ge(u)}:{}})}case"rerank":return cp(s4,c,p);default:return}}function cp(e,t,n){return k({name:t?`${e} ${t}`:e,op:`gen_ai.${e}`,attributes:{[Eu]:e,...n}})}function _4(e,t,n,r,i,o){let s=Fe(e.functionId),c=Fe(e.operationId)??(o?"ai.streamText":"ai.generateText");i&&IE.set(i,{operationId:c,isStream:o});let a=cp(TM,s,{...t,[YM]:c,[VR]:o,...s?{[DR]:s}:{},...n?JM(e,r):{}});return o&&i&&AE.set(i,a),a}function h4(e,t,n,r,i,o){let s=i?IE.get(i):void 0,c=s?`${s.operationId}.${s.isStream?"doStream":"doGenerate"}`:"ai.generateText.doGenerate";return cp(a4,o,{...t,[YM]:c,...n?JM(e,r):{},...n&&Array.isArray(e.tools)?{[HR]:Ge(e.tools)}:{}})}function b4(e,t){let n=V(e.toolCall)?e.toolCall:{},r=Fe(n.toolName),i=Fe(e.toolCallId)??Fe(n.toolCallId),o=n.input??n.args,s=t&&r?m4(Fe(e.callId),r,e.tools):void 0;return cp(EM,r,{[S]:VM,[XR]:"function",...r?{[jR]:r}:{},...i?{[r4]:i}:{},...s?{[i4]:s}:{},...t&&o!==void 0?{[YR]:Ge(o)}:{}})}function Qa(e,t,n){let{type:r,result:i}=t;if(!V(i))return;let{recordOutputs:o}=CE(t.event,n);if(r==="executeTool"){o&&e.setAttribute(ZR,Ge(i.output??i));let m=V(i.output)?i.output:void 0;m?.type==="tool-error"&&OE(e,t,m.error);return}let s=V(i.usage)?i.usage:void 0;if(s){let m=jn(s.inputTokens)??jn(s.promptTokens)??jn(s.tokens),_=jn(s.outputTokens)??jn(s.completionTokens),h=jn(s.totalTokens)??EE(m,_);m!==void 0&&e.setAttribute(Jt,m),_!==void 0&&e.setAttribute(Tt,_),h!==void 0&&e.setAttribute(Ah,h)}let c=XM(i);c&&r==="languageModelCall"&&e.setAttribute(Ot,Ge([c]));let a=V(i.response)?i.response:void 0,l=Fe(a?.id)??Fe(i.responseId);l&&e.setAttribute(FR,l);let p=Fe(a?.modelId)??Fe(t.event.modelId);p&&e.setAttribute(WR,p);let u=i.providerMetadata,d=cd(u);if(Uo in d&&oe(e).data[Uo]&&delete d[Uo],u4(d,r),e.setAttributes(d),o){let m=r==="languageModelCall"&&Array.isArray(i.content)?S4(i.content):QM(i.text,i.toolCalls),_=KM(m,c);_&&e.setAttribute(Ih,_)}}function y4(e){return e==="tool-calls"?"tool_call":e??"stop"}function XM(e){let t=e.finishReason;return typeof t=="string"?t:V(t)?Fe(t.unified):void 0}function jn(e){return Jm(e)??(V(e)?Jm(e.total):void 0)}function KM(e,t){if(e.length)return Ge([{role:"assistant",parts:e,finish_reason:y4(t)}])}function qM(e){let t=e.input??e.args;return{type:"tool_call",id:Fe(e.toolCallId),name:Fe(e.toolName),arguments:typeof t=="string"?t:Ge(t??{})}}function S4(e){let t=[];for(let n of e)V(n)&&(n.type==="text"&&typeof n.text=="string"?t.push({type:"text",content:n.text}):n.type==="tool-call"&&t.push(qM(n)));return t}function QM(e,t){let n=[];if(typeof e=="string"&&e.length&&n.push({type:"text",content:e}),Array.isArray(t))for(let r of t)V(r)&&n.push(qM(r));return n}function OE(e,t,n){e.setStatus({code:2,message:n instanceof Error?n.message:"tool_error"});let r=V(t.event.toolCall)?t.event.toolCall:{},i=Fe(r.toolName),o=Fe(t.event.toolCallId)??Fe(r.toolCallId);Be(s=>{s.setContext("trace",xr(e)),i&&s.setTag("vercel.ai.tool.name",i),o&&s.setTag("vercel.ai.tool.callId",o),s.setLevel("error"),me(n instanceof Error?n:new Error(typeof n=="string"?n:"Tool execution failed"),{mechanism:{type:"auto.vercelai.channel",handled:!1}})})}function CE(e,t){let n=C()?.getDataCollectionOptions().genAI;return{recordInputs:WM(t.recordInputs,e.recordInputs,n?.inputs),recordOutputs:WM(t.recordOutputs,e.recordOutputs,n?.outputs),enableTruncation:ze(t.enableTruncation)}}function WM(e,t,n){return typeof e=="boolean"?e:typeof t=="boolean"?t:n===!0}function JM(e,t){let n={},r=Fe(e.instructions);r&&(n[$t]=Ge([{type:"text",content:r}]));let i=e.messages??e.prompt;return i!==void 0&&(n[BR]=t?Ht(i):Ge(i),n[xt]=Array.isArray(i)?i.length:1),n}import*as xE from"diagnostics_channel";var E4=((e={})=>({name:"VercelAI",setupOnce(){xE.tracingChannel&&ue(()=>{ZM(xE.tracingChannel,e)})}})),pp=E4;import*as t1 from"diagnostics_channel";var PE="@sentry/instrumentation-fastify",T4=">=3.21.0 <6",n1="auto.http.otel.fastify",I4="hook.fastify",r1="request_handler.fastify",i1=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],lo="hook.name",po="fastify.type",ps="hook.callback.name",A4="fastify.root",N4="route-hook",Ja="hook",o1="request-handler",uo="anonymous",xi=Symbol("sentry fastify request span"),s1=Symbol("sentry fastify addHook original"),a1=Symbol("sentry fastify setNotFoundHandler original");function c1(e){return e.routeOptions?.url??e.routerPath}function l1(e){return e.routeOptions?.config??e.routeConfig}function v4(e){return V(e)&&!!e.method&&!!e.url&&(!!e.routeOptions||"routerPath"in e)}function p1(e,t,n){e.decorate(s1,e.addHook),e.decorate(a1,e.setNotFoundHandler),e.decorateRequest("opentelemetry",function(){return{span:this[xi]}}),e.decorateRequest(xi,null),e.addHook("onRoute",R4),e.addHook("onRequest",O4),e.addHook("onResponse",C4),e.addHook=k4,e.setNotFoundHandler=L4,n()}var kE=p1;kE[Symbol.for("skip-override")]=!0;kE[Symbol.for("fastify.display-name")]=PE;kE[Symbol.for("plugin-meta")]={fastify:T4,name:PE};function R4(e){if(e.config?.otel!==!1){for(let t of i1){let n=e[t];typeof n=="function"?e[t]=mo(n,t,$M(this.pluginName,t,n,e.url)):Array.isArray(n)&&(e[t]=n.map(r=>mo(r,t,$M(this.pluginName,t,r,e.url))))}e.onSend=zM(e.onSend,x4),e.onError=zM(e.onError,P4),e.handler=mo(e.handler,"handler",{[lo]:`${this.pluginName} - route-handler`,[po]:o1,[He]:e.url,[ps]:e.handler.name.length>0?e.handler.name:uo})}}function $M(e,t,n,r){return{[lo]:`${e} - route -> ${t}`,[po]:N4,[He]:r,[ps]:n.name?.length>0?n.name:uo}}function zM(e,t){return e==null?t:Array.isArray(e)?[...e,t]:[e,t]}function O4(e,t,n){if(l1(e)?.otel===!1)return n();let r={[S]:n1,[A4]:PE,[Ur]:e.method,[Zi]:e.url},i=c1(e);if(i!=null){r[He]=i;let s=Q(),c=s&&Re(s);c&&oe(c).data[B]==="http.server"&&c.setAttribute(He,i)}let o=k({name:"request",op:r1,attributes:r});e[xi]=o,se(o,()=>{n()})}function C4(e,t,n){let r=e[xi];r!=null&&(r.setAttributes({[hn]:t.statusCode}),r.end()),e[xi]=null,n()}function x4(e,t,n,r){let i=e[xi];i!=null&&(t.statusCode>=500&&i.setStatus({code:2}),i.setAttributes({[hn]:t.statusCode}),i.end()),e[xi]=null,r(null,n)}function P4(e,t,n,r){let i=e[xi];i?.setStatus({code:2,message:n.message}),r()}function k4(e,t){let n=this[s1];return i1.includes(e)?n.call(this,e,mo(t,e,{[lo]:`${this.pluginName} - ${e}`,[po]:Ja,[ps]:t.name?.length>0?t.name:uo})):n.call(this,e,t)}function L4(e,t){let n=this[a1];if(typeof e=="function"){n.call(this,mo(e,"notFoundHandler",{[lo]:`${this.pluginName} - not-found-handler`,[po]:Ja,[ps]:e.name?.length>0?e.name:uo}));return}if(e.preValidation!=null&&(e.preValidation=mo(e.preValidation,"notFoundHandler - preValidation",{[lo]:`${this.pluginName} - not-found-handler - preValidation`,[po]:Ja,[ps]:e.preValidation.name?.length>0?e.preValidation.name:uo})),e.preHandler!=null&&(e.preHandler=mo(e.preHandler,"notFoundHandler - preHandler",{[lo]:`${this.pluginName} - not-found-handler - preHandler`,[po]:Ja,[ps]:e.preHandler.name?.length>0?e.preHandler.name:uo})),t==null){n.call(this,e);return}n.call(this,e,mo(t,"notFoundHandler",{[lo]:`${this.pluginName} - not-found-handler`,[po]:Ja,[ps]:t.name?.length>0?t.name:uo}))}function M4(e){for(let t of e)if(v4(t))return t;return null}function mo(e,t,n={}){return function(...i){let o=M4(i);if(o===null||l1(o)?.otel===!1)return e.call(this,...i);let s=o[xi]??void 0,c=e.name?.length>0?e.name:this.pluginName??uo,a=n[po],l=a===Ja?I4:a===o1?r1:void 0,p=l?w4(n[lo]):`${t} - ${c}`;return Se({name:p,op:l,attributes:{...n,[S]:n1},parentSpan:s},()=>e.call(this,...i))}}function w4(e=""){return e.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"").replace(/^@sentry\/instrumentation-fastify -> /,"")}function G4(e){e.addHook("onRequest",async(t,n)=>{let r=c1(t),i=t.method||"GET";J().setTransactionName(`${i} ${r}`)})}var e1=!1,u1=Object.assign(function(){e1||(e1=!0,t1.subscribe("fastify.initialization",t=>{let n=t.fastify;n?.register(p1).after(r=>{r?$&&g.error("Failed to setup Fastify instrumentation",r):n&&G4(n)})}))},{id:"Fastify.v5"});var tf="Fastify";function nf(e,t,n){let r=n.statusCode;return r>=500||r<=299}import*as d1 from"diagnostics_channel";function U4(){return C()?.getIntegrationByName(tf)}function m1(){d1.subscribe("tracing:fastify.request.handler:error",e=>{let{error:t,request:n,reply:r}=e;rf.call(rf,t,n,r,"diagnostics-channel")})}function rf(e,t,n,r){let i=U4()?.getShouldHandleError()||nf;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){$&&g.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}i(e,t,n)&&me(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}var D4=(({shouldHandleError:e}={})=>{let t;return{name:tf,setupOnce(){t=e||nf,m1(),u1()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}}),LE=D4;var of=rf;var B4="db.mongodb.collection",H4="db.name",F4="db.user",W4="net.peer.name",V4="net.peer.port",Y4="db.operation",j4="db.system";function Pi({collection:e,modelName:t,operation:n,origin:r,parentSpan:i}){let o={[B4]:e?.name,[H4]:e?.conn?.name,[F4]:e?.conn?.user,[W4]:e?.conn?.host,[V4]:e?.conn?.port,[Y4]:n,[j4]:"mongoose",[S]:r};return k({name:`mongoose.${t}.${n}`,op:"db",kind:U.CLIENT,attributes:o,parentSpan:i})}var f1="Fastify",ME=de(`${f1}.v3`,()=>new Wm);function Z4(){let e=C();if(e)return e.getIntegrationByName(f1)}var X4=(e=>{let t=LE(e);return Ut(t,{setupOnce(){ME()}})}),wE=(e={})=>X4(e);function K4(e,t){t?.shouldHandleError&&Z4()?.setShouldHandleError(t.shouldHandleError);let n=Object.assign(function(r,i,o){r.addHook("onError",async(s,c,a)=>{of.call(of,a,s,c,"onError-hook")}),o()},{[Symbol.for("skip-override")]:!0,[Symbol.for("fastify.display-name")]:"sentry-fastify-error-handler"});e.register(n)}import{normalize as q4}from"path";var Ae=class{constructor(t,n,r,i){this.name=q4(t),this.supportedVersions=n,this.patch=r,this.unpatch=i}};var GE=(e=>(e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription",e))(GE||{}),fo=(e=>(e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment",e))(fo||{}),ki=(e=>(e.EXECUTE="graphql.execute",e.PARSE="graphql.parse",e.RESOLVE="graphql.resolve",e.VALIDATE="graphql.validate",e.SCHEMA_VALIDATE="graphql.validateSchema",e.SCHEMA_PARSE="graphql.parseSchema",e))(ki||{});var yn=(e=>(e.SOURCE="graphql.source",e.FIELD_NAME="graphql.field.name",e.FIELD_PATH="graphql.field.path",e.FIELD_TYPE="graphql.field.type",e.PARENT_NAME="graphql.parent.name",e.OPERATION_TYPE="graphql.operation.type",e.OPERATION_NAME="graphql.operation.name",e))(yn||{});var up=Symbol.for("opentelemetry.patched"),ei=Symbol.for("opentelemetry.graphql_data");var g1="Operation$operationName$not supported";var _1=Object.values(GE),UE=e=>typeof e?.then=="function";function sf(e,t,n,r){if(C()?.getDataCollectionOptions().graphQL.document===!0){let i=iQ(t,n,r);e.setAttribute(yn.SOURCE,i)}}function Q4(e,t,n){let r=S1(e,n);if(r)return{field:r,spanAdded:!1};let i=z4(e,n);return r={span:J4(e,t,n,i)},$4(e,n,r),{field:r,spanAdded:!0}}function J4(e,t,n,r){let i={[yn.FIELD_NAME]:t.fieldName,[yn.FIELD_PATH]:n.join("."),[yn.FIELD_TYPE]:t.returnType.toString(),[yn.PARENT_NAME]:t.parentType.name},o=k({name:`${ki.RESOLVE} ${i[yn.FIELD_PATH]}`,attributes:i,parentSpan:r}),s=e[ei].source,c=t.fieldNodes.find(a=>a.kind==="Field");return c&&sf(o,s.loc,c.loc?.start,c.loc?.end),o}function us(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}function DE(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>_1.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>_1.indexOf(n?.operation)!==-1)}function $4(e,t,n){return e[ei].fields[t.join(".")]=n}function S1(e,t){return e[ei].fields[t.join(".")]}function z4(e,t){for(let n=t.length-1;n>0;n--){let r=S1(e,t.slice(0,n));if(r)return r.span}return eQ(e)}function eQ(e){return e[ei].span}function tQ(e){let t=[],n=e;for(;n;)t.push(String(n.key)),n=n.prev;return t.reverse()}function nQ(e){return E1(`
|
|
33
|
+
`,e)}function h1(e){return E1(" ",e)}function E1(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var rQ=[fo.FLOAT,fo.STRING,fo.INT,fo.BLOCK_STRING];function iQ(e,t,n){let r="";if(e?.startToken){let i=typeof t=="number"?t:e.start,o=typeof n=="number"?n:e.end,s=e.startToken.next,c=1;for(;s;){if(s.start<i){s=s.next,c=s?.line;continue}if(s.end>o){s=s.next,c=s?.line;continue}let a=s.value||s.kind,l="";rQ.indexOf(s.kind)>=0&&(a="*"),s.kind===fo.STRING&&(a=`"${a}"`),s.kind===fo.EOF&&(a=""),s.line>c?(r+=nQ(s.line-c),c=s.line,l=h1(s.column-1)):s.line===s.prev?.line&&(l=h1(s.start-(s.prev?.end||0))),r+=l+a,s&&(s=s.next)}}return r}function af(e,t){if(!e||e[up])return;let n=e.getFields();e[up]=!0,Object.keys(n).forEach(r=>{let i=n[r];if(i&&(i.resolve&&(i.resolve=BE(t,i.resolve)),i.type)){let o=T1(i.type);for(let s of o)af(s,t)}})}function T1(e){return"ofType"in e?T1(e.ofType):oQ(e)?e.getTypes():sQ(e)?[e]:[]}function oQ(e){return"getTypes"in e&&typeof e.getTypes=="function"}function sQ(e){return"getFields"in e&&typeof e.getFields=="function"}var b1=(e,t,n)=>{n&&(e.setStatus({code:2,message:t.message}),e.end())},y1=(e,t)=>{t&&e.end()};function BE(e,t,n=!1){if(r[up]||typeof t!="function")return t;function r(i,o,s,c){if(!t)return;if(e().ignoreTrivialResolveSpans&&n&&(V(i)||typeof i=="function")&&typeof i[c.fieldName]!="function")return t.call(this,i,o,s,c);if(!s[ei])return t.call(this,i,o,s,c);let l=tQ(c?.path),{field:p,spanAdded:u}=Q4(s,c,l),d=p.span,m=u;return se(d,()=>{try{let _=t.call(this,i,o,s,c);return UE(_)?_.then(h=>(y1(d,m),h),h=>{throw b1(d,h,m),h}):(y1(d,m),_)}catch(_){throw b1(d,_,m),_}})}return r[up]=!0,r}var aQ="@sentry/instrumentation-graphql",cQ="auto.graphql.otel.graphql",I1={ignoreResolveSpans:!1},cf=[">=14.0.0 <17"],lf=class extends ae{constructor(t={}){super(aQ,q,{...I1,...t})}setConfig(t={}){super.setConfig({...I1,...t})}init(){let t=new re("graphql",cf);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new Ae("graphql/execution/execute.js",cf,t=>(w(t.execute)&&this._unwrap(t,"execute"),this._wrap(t,"execute",this._patchExecute(t.defaultFieldResolver)),t),t=>{t&&this._unwrap(t,"execute")})}_addPatchingParser(){return new Ae("graphql/language/parser.js",cf,t=>(w(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new Ae("graphql/validation/validate.js",cf,t=>(w(t.validate)&&this._unwrap(t,"validate"),this._wrap(t,"validate",this._patchValidate()),t),t=>{t&&this._unwrap(t,"validate")})}_patchExecute(t){let n=this;return function(i){return function(){let s;if(arguments.length>=2){let l=arguments;s=n._wrapExecuteArgs(l[0],l[1],l[2],l[3],l[4],l[5],l[6],l[7],t)}else{let l=arguments[0];s=n._wrapExecuteArgs(l.schema,l.document,l.rootValue,l.contextValue,l.variableValues,l.operationName,l.fieldResolver,l.typeResolver,t)}let c=DE(s.document,s.operationName),a=n._createExecuteSpan(c,s);return s.contextValue[ei]={source:s.document?s.document||s.document[ei]:void 0,span:a,fields:{}},se(a,()=>qr(()=>i.apply(this,[s]),(l,p)=>{n._handleExecutionResult(a,l,p)}))}}}_handleExecutionResult(t,n,r){if(r===void 0||n){us(t,n);return}UE(r)?r.then(i=>{this._updateSpanFromResult(t,i),us(t)},i=>{us(t,i)}):(this._updateSpanFromResult(t,r),us(t))}_updateSpanFromResult(t,n){if(n.errors?.length&&!oe(t).status&&t.setStatus({code:2}),!this.getConfig().useOperationNameForRootSpan)return;let r=oe(t).data,i=r[yn.OPERATION_TYPE],o=r[yn.OPERATION_NAME];if(!i)return;let s=Re(t),a=oe(s).data[ss]||[],l=o?`${i} ${o}`:`${i}`;Array.isArray(a)?(a.push(l),s.setAttribute(ss,a)):typeof a=="string"?s.setAttribute(ss,[a,l]):s.setAttribute(ss,l),oe(s).data["original-description"]||s.setAttribute("original-description",oe(s).description),s.updateName(`${oe(s).data["original-description"]} (${lQ(a)})`)}_patchParse(){let t=this;return function(r){return function(o,s){return t._parse(this,r,o,s)}}}_patchValidate(){let t=this;return function(r){return function(o,s,c,a,l){return t._validate(this,r,o,s,c,l,a)}}}_parse(t,n,r,i){let o=k({name:ki.PARSE});return se(o,()=>qr(()=>n.call(t,r,i),(s,c)=>{c&&(DE(c)?c.loc&&sf(o,c.loc):o.updateName(ki.SCHEMA_PARSE)),us(o,s)}))}_validate(t,n,r,i,o,s,c){let a=k({name:ki.VALIDATE});return se(a,()=>qr(()=>n.call(t,r,i,o,c,s),(l,p)=>{i.loc||a.updateName(ki.SCHEMA_VALIDATE),us(a,l)}))}_createExecuteSpan(t,n){let r=k({name:ki.EXECUTE,attributes:{[S]:cQ}});if(t){let{operation:i,name:o}=t;r.setAttribute(yn.OPERATION_TYPE,i);let s=o?.value;s?(r.setAttribute(yn.OPERATION_NAME,s),r.updateName(`${i} ${s}`)):r.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=g1.replace("$operationName$",i),r.setAttribute(yn.OPERATION_NAME,i)}return n.document?.loc&&sf(r,n.document.loc),r}_wrapExecuteArgs(t,n,r,i,o,s,c,a,l){if(i||(i={}),i[ei]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:c,typeResolver:a};let p=c==null;return c=BE(()=>this.getConfig(),c??l,p),t&&(af(t.getQueryType(),()=>this.getConfig()),af(t.getMutationType(),()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:i,variableValues:o,operationName:s,fieldResolver:c,typeResolver:a}}};function lQ(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}var A1="Graphql",FE=de(A1,lf,e=>HE(e)),pQ=((e={})=>Ut(ip(HE(e)),{name:A1,setupOnce(){FE(HE(e))}})),WE=pQ;function HE(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}var $a="messaging.destination.partition.id",VE="messaging.kafka.message.key",YE="messaging.kafka.message.tombstone",N1="messaging.kafka.offset",jE="process",dp="receive",v1="send",ZE="kafka",R1="_OTHER";at();var uQ="auto.kafkajs.otel.producer",dQ="auto.kafkajs.otel.consumer";function mp(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?n[0]?.toString():n.toString()}function O1(e){let t=mp(e,"sentry-trace");if(!t)return;let{traceId:n,parentSpanId:r,sampled:i}=In(t,mp(e,"baggage"));if(r)return[{context:{traceId:n,spanId:r,isRemote:!0,traceFlags:i?Ir.SAMPLED:Ir.NONE}}]}function pf({topic:e,message:t,operationType:n,links:r,attributes:i}){let o=n===dp?"poll":n;return k({name:`${o} ${e}`,kind:n===dp?U.CLIENT:U.CONSUMER,links:r,attributes:{...i,[wt]:ZE,[Rn]:e,[cr]:n,[na]:o,[VE]:t?.key?String(t.key):void 0,[YE]:t?.key&&t.value===null?!0:void 0,[N1]:t?.offset,...t?{[S]:dQ}:{}}})}function XE(e,t){let n=k({name:`send ${e}`,kind:U.PRODUCER,attributes:{[wt]:ZE,[Rn]:e,[VE]:t.key?String(t.key):void 0,[YE]:t.key&&t.value===null?!0:void 0,[$a]:t.partition!==void 0?String(t.partition):void 0,[na]:"send",[cr]:v1,[S]:uQ}});t.headers=t.headers??{};let r=$e({span:n});return r["sentry-trace"]&&(t.headers["sentry-trace"]=r["sentry-trace"]),r.baggage&&(t.headers.baggage=r.baggage),n}function ds(e,t){return Promise.resolve(t).catch(n=>{let r,i=R1;throw typeof n=="string"||n===void 0?r=n:typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"message")&&(r=n.message,i=n.constructor.name),e.forEach(o=>{o.setAttribute(wr,i),o.setStatus({code:2,message:r})}),n}).finally(()=>{e.forEach(n=>n.end())})}var mQ="@sentry/instrumentation-kafkajs",uf=class extends ae{constructor(t={}){super(mQ,q,t)}init(){let t=r=>{w(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),w(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new re("kafkajs",[">=0.3.0 <3"],r=>(t(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),t)}_getConsumerPatch(){let t=this;return n=>function(...i){let o=n.apply(this,i);return w(o.run)&&t._unwrap(o,"run"),t._wrap(o,"run",t._getConsumerRunPatch()),o}}_getProducerPatch(){let t=this;return n=>function(...i){let o=n.apply(this,i);return w(o.sendBatch)&&t._unwrap(o,"sendBatch"),t._wrap(o,"sendBatch",t._getSendBatchPatch()),w(o.send)&&t._unwrap(o,"send"),t._wrap(o,"send",t._getSendPatch()),w(o.transaction)&&t._unwrap(o,"transaction"),t._wrap(o,"transaction",t._getProducerTransactionPatch()),o}}_getConsumerRunPatch(){let t=this;return n=>function(...i){let o=i[0];return o?.eachMessage&&(w(o.eachMessage)&&t._unwrap(o,"eachMessage"),t._wrap(o,"eachMessage",t._getConsumerEachMessagePatch())),o?.eachBatch&&(w(o.eachBatch)&&t._unwrap(o,"eachBatch"),t._wrap(o,"eachBatch",t._getConsumerEachBatchPatch())),n.call(this,o)}}_getConsumerEachMessagePatch(){return t=>function(...r){let i=r[0],o=mp(i.message.headers,"sentry-trace"),s=mp(i.message.headers,"baggage");return An({sentryTrace:o,baggage:s},()=>{let c=pf({topic:i.topic,message:i.message,operationType:jE,attributes:{[$a]:String(i.partition)}}),a=se(c,()=>t.apply(this,r));return ds([c],a)})}}_getConsumerEachBatchPatch(){return t=>function(...r){let i=r[0],o=Nn(()=>pf({topic:i.batch.topic,message:void 0,operationType:dp,attributes:{[ea]:i.batch.messages.length,[$a]:String(i.batch.partition)}}));return se(o,()=>{let s=[o];i.batch.messages.forEach(a=>{s.push(pf({topic:i.batch.topic,message:a,operationType:jE,links:O1(a.headers),attributes:{[$a]:String(i.batch.partition)}}))});let c=t.apply(this,r);return ds(s,c)})}}_getProducerTransactionPatch(){let t=this;return n=>function(...i){let o=k({name:"transaction"}),s=n.apply(this,i);return s.then(c=>{let a=c.send;c.send=function(...m){return se(o,()=>t._getSendPatch()(a).apply(this,m).catch(h=>{throw o.setStatus({code:2,message:h?.message}),h}))};let l=c.sendBatch;c.sendBatch=function(...m){return se(o,()=>t._getSendBatchPatch()(l).apply(this,m).catch(h=>{throw o.setStatus({code:2,message:h?.message}),h}))};let p=c.commit;c.commit=function(...m){let _=p.apply(this,m).then(()=>{o.setStatus({code:1})});return ds([o],_)};let u=c.abort;c.abort=function(...m){let _=u.apply(this,m);return ds([o],_)}}).catch(c=>{o.setStatus({code:2,message:c?.message}),o.end()}),s}}_getSendBatchPatch(){return t=>function(...r){let o=r[0].topicMessages||[],s=[];o.forEach(a=>{a.messages.forEach(l=>{s.push(XE(a.topic,l))})});let c=t.apply(this,r);return ds(s,c)}}_getSendPatch(){return t=>function(...r){let i=r[0],o=i.messages.map(c=>XE(i.topic,c)),s=t.apply(this,r);return ds(o,s)}}};var C1="Kafka",KE=de(C1,()=>new uf),fQ=(()=>({name:C1,setupOnce(){KE()}})),qE=fQ;var gQ="@sentry/instrumentation-lru-memoizer",df=class extends ae{constructor(){super(gQ,q,{})}init(){return[new re("lru-memoizer",[">=1.3 <4"],t=>Object.assign(function(...r){let i=t.apply(this,r);return function(...o){let s=o.pop(),c=ne(),a=typeof s=="function"?function(...l){return Be(c,()=>s.apply(this,l))}:s;return i.apply(this,[...o,a])}},{sync:t.sync}),void 0)]}};var x1="LruMemoizer",QE=de(x1,()=>new df),_Q=(()=>({name:x1,setupOnce(){QE()}})),JE=_Q;var P1="auto.db.otel.mongo";function $E(e,t,n,r){return op(e,t,n,r,P1)}function fp(e,t,n,r){return ap(e,t,n,r,P1)}function ms(e,t){let n=Q(),r=!1;return function(...o){if(!r){r=!0;let s=o[0];e&&(s instanceof Error&&e.setStatus({code:2,message:s.message}),e.end())}return se(n??null,()=>t.apply(this,o))}}function fs(){return!Q()}function mf(e){return t=>function(r,i,o,s,c){let a=typeof s=="function"?s:c;if(fs()||typeof a!="function"||typeof o!="object")return typeof s=="function"?t.call(this,r,i,o,s):t.call(this,r,i,o,s,c);let l=hr(fp(i,r,o[0],e)),p=ms(l,a);return typeof s=="function"?t.call(this,r,i,o,p):t.call(this,r,i,o,s,p)}}function k1(){return e=>function(n,r,i,o,s){let c=typeof o=="function"?o:s;if(fs()||typeof c!="function"||typeof i!="object")return typeof o=="function"?e.call(this,n,r,i,o):e.call(this,n,r,i,o,s);let a=sp(i),l=hr(fp(r,n,i,a)),p=ms(l,c);return typeof o=="function"?e.call(this,n,r,i,p):e.call(this,n,r,i,o,p)}}function L1(){return e=>function(n,r,i,o){let s=o,c=Object.keys(r)[0];if(typeof r!="object"||r.ismaster||r.hello)return e.call(this,n,r,i,o);let a;fs()||(a=hr($E(this,n,r,c)));let l=ms(a,s);return e.call(this,n,r,i,l)}}function M1(){return e=>function(...n){let[r,i]=n,o=Object.keys(i)[0],s=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return e.apply(this,n);let c;fs()||(c=hr($E(this,r,i,o)));let a=ms(c,s),l=e.apply(this,n);return l.then(p=>a(null,p),p=>a(p)),l}}function w1(){return e=>function(n,r,i,o,s,c){let a=typeof s=="function"?s:c;if(fs()||typeof a!="function"||typeof i!="object")return typeof s=="function"?e.call(this,n,r,i,o,s):e.call(this,n,r,i,o,s,c);let l=hr(fp(r,n,i,"find")),p=ms(l,a);return typeof s=="function"?e.call(this,n,r,i,o,p):e.call(this,n,r,i,o,s,p)}}function G1(){return e=>function(n,r,i,o,s,c){let a=typeof s=="function"?s:c;if(fs()||typeof a!="function")return typeof s=="function"?e.call(this,n,r,i,o,s):e.call(this,n,r,i,o,s,c);let l=hr(fp(r,n,i.cmd,"getMore")),p=ms(l,a);return typeof s=="function"?e.call(this,n,r,i,o,p):e.call(this,n,r,i,o,s,p)}}function U1(){return e=>function(n){let r=Q();return e.call(this,function(...i){return se(r??null,()=>n.apply(this,i))})}}var hQ="@sentry/instrumentation-mongodb",ff=class extends ae{constructor(t={}){super(hQ,q,t)}init(){let{v3PatchConnection:t,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnectionCallback:r,v4PatchConnectionPromise:i,v4UnpatchConnection:o}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:s,v4UnpatchConnectionPool:c}=this._getV4ConnectionPoolPatches();return[new re("mongodb",[">=3.3.0 <4"],void 0,void 0,[new Ae("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new re("mongodb",[">=4.0.0 <8"],void 0,void 0,[new Ae("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],r,o),new Ae("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],i,o),new Ae("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],s,c)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>(w(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",mf("insert")),w(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",mf("remove")),w(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",mf("update")),w(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",k1()),w(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",w1()),w(t.getMore)&&this._unwrap(t,"getMore"),this._wrap(t,"getMore",G1()),t),v3UnpatchConnection:t=>{t!==void 0&&(this._unwrap(t,"insert"),this._unwrap(t,"remove"),this._unwrap(t,"update"),this._unwrap(t,"command"),this._unwrap(t,"query"),this._unwrap(t,"getMore"))}}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:t=>{let n=t.ConnectionPool.prototype;return w(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",U1()),t},v4UnpatchConnectionPool:t=>{t!==void 0&&this._unwrap(t.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>(w(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",L1()),t),v4PatchConnectionPromise:t=>(w(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",M1()),t),v4UnpatchConnection:t=>{t!==void 0&&this._unwrap(t.Connection.prototype,"command")}}}};var D1="Mongo",zE=de(D1,()=>new ff),bQ=(()=>({name:D1,setupOnce(){zE()}})),eT=bQ;function B1(e,t){e.setStatus({code:2,message:`${t.message} ${t.code?`
|
|
34
|
+
Mongoose Error Code: ${t.code}`:""}`})}function H1(e,t){return e instanceof Promise?e.catch(n=>{throw B1(t,n),n}).finally(()=>t.end()):(t.end(),e)}function F1(e,t,n,r,i){let o=0;return i.length===2?o=1:i.length===3&&(o=2),i[o]=(s,c)=>(s&&B1(r,s),r.end(),e(s,c)),t.apply(n,i)}var yQ="@sentry/instrumentation-mongoose",gp="auto.db.otel.mongoose",hf=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],SQ=["remove","count","findOneAndRemove",...hf],EQ=["count","findOneAndRemove",...hf],TQ=[...hf];function W1(e){return e?e.startsWith("6.")||e.startsWith("5.")?SQ:e.startsWith("7.")?EQ:TQ:hf}function V1(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function Y1(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}var gf=Symbol("stored-parent-span"),j1=Symbol("already-instrumented"),_f=class extends ae{constructor(t={}){super(yQ,q,t)}init(){return new re("mongoose",[">=5.9.7 <9.7.0"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"&&t.default?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save")),r.Model.prototype.$save=r.Model.prototype.save,V1(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove")),Y1(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne")),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne"))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec()),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec()),W1(n).forEach(o=>{this._wrap(r.Query.prototype,o,this.patchAndCaptureSpanContext(o))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany")),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite")),r}unpatch(t,n){let r=t[Symbol.toStringTag]==="Module"&&t.default?t.default:t,i=W1(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,V1(n)&&this._unwrap(r.Model.prototype,"remove"),Y1(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),i.forEach(o=>{this._unwrap(r.Query.prototype,o)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(){let t=this;return n=>function(i){let o=this[gf],s=Pi({collection:this._model.collection,modelName:this._model?.modelName,operation:"aggregate",origin:gp,parentSpan:o});return t._handleResponse(s,n,this,arguments,i)}}patchQueryExec(){let t=this;return n=>function(i){if(this[j1])return n.apply(this,arguments);let o=this[gf],s=Pi({collection:this.mongooseCollection,modelName:this.model.modelName,operation:this.op,origin:gp,parentSpan:o});return t._handleResponse(s,n,this,arguments,i)}}patchOnModelMethods(t){let n=this;return r=>function(o,s){let c=Pi({collection:this.constructor.collection,modelName:this.constructor.modelName,operation:t,origin:gp});return o instanceof Function&&(s=o),n._handleResponse(c,r,this,arguments,s)}}_patchDocumentUpdateMethods(t){let n=this;return r=>function(o,s,c){let a=c;typeof o=="function"?a=o:typeof s=="function"&&(a=s);let l=Pi({collection:this.constructor.collection,modelName:this.constructor.modelName,operation:t,origin:gp}),p=n._handleResponse(l,r,this,arguments,a);return p&&typeof p=="object"&&(p[j1]=!0),p}}patchModelStatic(t){let n=this;return r=>function(o,s,c){typeof s=="function"&&(c=s);let a=Pi({collection:this.collection,modelName:this.modelName,operation:t,origin:gp});return n._handleResponse(a,r,this,arguments,c)}}patchModelAggregate(){return t=>function(){let r=Q(),i=t.apply(this,arguments);return i&&(i[gf]=r),i}}patchAndCaptureSpanContext(t){return n=>function(){return this[gf]=Q(),n.apply(this,arguments)}}_handleResponse(t,n,r,i,o){return se(t,()=>{if(o instanceof Function)return F1(o,n,r,t,i);{let s=n.apply(r,i);return H1(s,t)}})}};var Z1="Mongoose",tT=de(Z1,()=>new _f),IQ=(()=>Ut(lE(),{name:Z1,setupOnce(){tT()}})),nT=IQ;var X1="db.connection_string",K1="mysql";function q1(e){let t=e?.connectionConfig||e||{},{host:n,port:r,database:i,user:o}=t;return{host:n,port:r,database:i,user:o}}function Q1(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function J1(e){return typeof e=="string"?e:e.sql}function $1(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}var AQ="@sentry/instrumentation-mysql",NQ="auto.db.otel.mysql",bf=class extends ae{constructor(t={}){super(AQ,q,t)}init(){return[new re("mysql",[">=2.0.0 <3"],t=>(w(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),w(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),w(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(i){let o=t(...arguments);return n._wrap(o,"query",n._patchQuery(o)),o}}}_patchCreatePool(){return t=>{let n=this;return function(i){let o=t(...arguments);return n._wrap(o,"query",n._patchQuery(o)),n._wrap(o,"getConnection",n._patchGetConnection(o)),o}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(i){let o=t(...arguments);return n._wrap(o,"getConnection",n._patchGetConnection(o)),o}}}_patchGetConnection(t){return n=>{let r=this;return function(o,s,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof o=="function"){let a=r._getConnectionCallbackPatchFn(o);return n.call(t,a)}if(arguments.length===2&&typeof s=="function"){let a=r._getConnectionCallbackPatchFn(s);return n.call(t,o,a)}if(arguments.length===3&&typeof c=="function"){let a=r._getConnectionCallbackPatchFn(c);return n.call(t,o,s,a)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=ne();return function(i,o){o&&(w(o.query)||n._wrap(o,"query",n._patchQuery(o))),typeof t=="function"&&Be(r,()=>t.call(this,i,o))}}_patchQuery(t){return n=>{let r=this;return function(i,o,s){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let{host:c,port:a,database:l,user:p}=q1(t.config),u=parseInt(String(a),10),d={[S]:NQ,[Pe]:K1,[X1]:Q1(c,a,l),[Et]:l,[Mt]:p,[Ve]:J1(i),[Le]:c};isNaN(u)||(d[xe]=u);let m=k({name:$1(i),kind:U.CLIENT,attributes:d}),_=Array.from(arguments).findIndex(b=>typeof b=="function"),h=ne();if(_===-1){let b=se(m,()=>n.apply(t,arguments));return _n(b,h),b.on("error",N=>{m.setStatus({code:2,message:N.message})}).on("end",()=>{m.end()})}else return r._wrap(arguments,_,r._patchCallbackQuery(m,h)),se(m,()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(i,o,s){return i&&t.setStatus({code:2,message:i.message}),t.end(),Be(n,()=>r(...arguments))}}};var z1="Mysql",rT=de(z1,()=>new bf({})),vQ=(()=>({name:z1,setupOnce(){rT()}})),iT=vQ;var ew="db.connection_string",tw="mysql";function nw(e){let{host:t,port:n,database:r,user:i}=RQ(e),o={[ew]:OQ(t,n,r),[Et]:r,[Mt]:i,[Le]:t},s=parseInt(n,10);return isNaN(s)||(o[xe]=s),o}function RQ(e){let{host:t,port:n,database:r,user:i}=e?.connectionConfig||e||{};return{host:t,port:n,database:r,user:i}}function OQ(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function rw(e,t,n){let[r,i]=typeof e=="string"?[e,n]:[e.sql,CQ(e)?n||e.values:n];try{return t&&i?t(r,i):r}catch{return"Could not determine the query due to an error in formatting"}}function CQ(e){return"values"in e}function iw(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}var ow=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};function oT(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}var xQ="@sentry/instrumentation-mysql2",PQ="auto.db.otel.mysql2",sT=[">=1.4.2 <3.20.0"],yf=class extends ae{constructor(t={}){super(xQ,q,t)}init(){let t;function n(o){!t&&o.format&&(t=o.format)}let r=o=>{w(o.query)&&this._unwrap(o,"query"),this._wrap(o,"query",this._patchQuery(t)),w(o.execute)&&this._unwrap(o,"execute"),this._wrap(o,"execute",this._patchQuery(t))},i=o=>{this._unwrap(o,"query"),this._unwrap(o,"execute")};return[new re("mysql2",sT,o=>(n(o),o),()=>{},[new Ae("mysql2/promise.js",sT,o=>(n(o),o),()=>{}),new Ae("mysql2/lib/connection.js",sT,o=>{let s=oT(o);return r(s),o},o=>{if(o===void 0)return;let s=oT(o);i(s)})])]}_patchQuery(t){let n=this;return r=>function(i,o,s){let c;Array.isArray(o)?c=o:arguments[2]&&(c=[o]);let a={...nw(this.config),[Pe]:tw,[Ve]:rw(i,t,c),[S]:PQ},l=k({name:iw(i),kind:U.CLIENT,attributes:a}),p=ow(u=>{u&&l.setStatus({code:2,message:u.message}),l.end()});if(arguments.length===1){typeof i.onResult=="function"&&n._wrap(i,"onResult",n._patchCallbackQuery(p));let u=r.apply(this,arguments);return u.once("error",d=>{p(d)}).once("result",()=>{p()}),u}return typeof arguments[1]=="function"?n._wrap(arguments,1,n._patchCallbackQuery(p)):typeof arguments[2]=="function"&&n._wrap(arguments,2,n._patchCallbackQuery(p)),r.apply(this,arguments)}}_patchCallbackQuery(t){return n=>function(...r){return t(r[0]),n(...r)}}};var sw="Mysql2",aT=de(sw,()=>new yf),kQ=(()=>Ut(dE(),{name:sw,setupOnce(){aT()}})),cT=kQ;import*as Tw from"diagnostics_channel";var Sf,aw;function cw(e){Sf=e}function za(){return!!Sf}function lT(){if(Sf)return aw??(aw=Sf())}var LQ=["get","set","setex"],pT=["get","mget"],MQ=["set","setex"],uT=["del","unlink"];function gs(e,t){return e.includes(t.toLowerCase())}function dT(e){return gs(pT,e)?"cache.get":gs(MQ,e)?"cache.put":gs(uT,e)?"cache.remove":void 0}function wQ(e,t){return t.some(n=>e.startsWith(n))}function pw(e,t){try{if(t.length===0)return;let n=i=>typeof i=="string"||typeof i=="number"||Buffer.isBuffer(i)?[i.toString()]:Array.isArray(i)?lw(i.map(o=>n(o))):["<unknown>"],r=t[0];return gs(LQ,e)&&r!=null?n(r):lw(t.map(i=>n(i)))}catch{return}}function uw(e,t,n){if(!dT(e))return!1;for(let r of t)if(wQ(r,n))return!0;return!1}function dw(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,r)=>{let i=t(r);return typeof i=="number"?n!==void 0?n+i:i:n},0):t(e)}function lw(e){let t=[],n=r=>{r.forEach(i=>{Array.isArray(i)?n(i):t.push(i)})};return n(e),t}var _p={};function mw(e){_p=e}var _s=(e,t,n,r)=>{let i=pw(t,n),o=dT(t);if(!i||!o||!_p.cachePrefixes||!uw(t,i,_p.cachePrefixes))return;let s=oe(e).data,c=s["net.peer.name"]??s["server.address"],a=s["net.peer.port"]??s["server.port"];a&&c&&e.setAttributes({"network.peer.address":c,"network.peer.port":a});let l=gs(uT,t)?void 0:dw(r);l&&e.setAttribute(V_,l),gs(pT,t)&&l!==void 0&&e.setAttribute(F_,l>0),e.setAttributes({[B]:o,[W_]:i});let p=i.join(", ");e.updateName(_p.maxCacheKeyLength?mn(p,_p.maxCacheKeyLength):p)};var ec="db.connection_string",tc="redis";var GQ="@sentry/instrumentation-ioredis",fw="auto.db.otel.redis",UQ=[">=2.0.0 <5.11.0"];function hs(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}var Ef=class extends ae{constructor(t={}){super(GQ,q,t)}init(){return[new re("ioredis",UQ,t=>{let n=t[Symbol.toStringTag]==="Module"&&t.default?t.default:t;return w(n.prototype.sendCommand)&&this._unwrap(n.prototype,"sendCommand"),this._wrap(n.prototype,"sendCommand",this._patchSendCommand()),w(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"&&t.default?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(){let t=this;return n=>function(...r){let i=r[0];if(r.length<1||typeof i!="object"||!Q())return n.apply(this,r);let{host:o,port:s}=this.options,c={[Pe]:tc,[Ve]:zr(i.name,i.args),[ec]:`redis://${o}:${s}`,[Le]:o,[xe]:s,[S]:fw},a=k({name:i.name,kind:U.CLIENT,attributes:c});try{let l=n.apply(this,r),p=i.resolve;i.resolve=function(d){t._callResponseHook(a,i,d),hs(a,null),p(d)};let u=i.reject;return i.reject=function(d){hs(a,d),u(d)},l}catch(l){throw hs(a,l),l}}}_patchConnection(){return t=>function(...n){if(!Q())return t.apply(this,n);let{host:r,port:i}=this.options,o={[Pe]:tc,[Ve]:"connect",[ec]:`redis://${r}:${i}`,[Le]:r,[xe]:i,[S]:fw},s=k({name:"connect",kind:U.CLIENT,attributes:o});try{let c=t.apply(this,n);return c instanceof Promise?c.then(a=>(hs(s,null),a),a=>(hs(s,a),Promise.reject(a))):(hs(s,null),c)}catch(c){throw hs(s,c),c}}}_callResponseHook(t,n,r){let{responseHook:i}=this.getConfig();if(i)try{i(t,n.name,n.args,r)}catch{}}};var fT="@sentry/instrumentation-redis",hw="auto.db.otel.redis",hp=Symbol("opentelemetry.instrumentation.redis.open_spans"),gw=Symbol("opentelemetry.instrumentation.redis.multi_command_options");function Tf(e,t){t&&e.setStatus({code:2,message:t.message}),e.end()}function bw(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}function DQ(e){if(!(typeof e!="string"||!e))try{let t=new URL(e);return t.searchParams.delete("user_pwd"),t.username="",t.password="",t.href}catch(t){Ye&&g.error("failed to sanitize redis connection url",t)}}function _w(e){return{[Pe]:tc,[Le]:e?.socket?.host,[xe]:e?.socket?.port,[ec]:DQ(e?.url),[S]:hw}}var yw=class Sw extends ae{constructor(t={}){super(fT,q,t)}init(){return[new re("redis",[">=2.6.0 <4"],t=>(w(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),t),t=>{t!==void 0&&this._unwrap(t.RedisClient.prototype,"internal_send_command")})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(o){if(arguments.length!==1||typeof o!="object")return r.apply(this,arguments);let s={[Pe]:tc,[Ve]:zr(o.command,o.args),[S]:hw};this.connection_options&&(s[Le]=this.connection_options.host,s[xe]=this.connection_options.port),this.address&&(s[ec]=`redis://${this.address}`);let c=k({name:`${Sw.COMPONENT}-${o.command}`,kind:U.CLIENT,attributes:s}),a=arguments[0].callback;if(a){let l=Q();arguments[0].callback=function(u,d){return bw(t.getConfig().responseHook,c,o.command,o.args,d),Tf(c,u),se(l??null,()=>a.apply(this,arguments))}}try{return r.apply(this,arguments)}catch(l){throw Tf(c,l),l}}}}};yw.COMPONENT="redis";var BQ=yw,Ew=class mT extends ae{constructor(t={}){super(fT,q,t)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new Ae(`${t}/dist/lib/commander.js`,["^1.0.0"],(o,s)=>{let c=o.transformCommandArguments;if(!c)return Ye&&g.error("internal instrumentation error, missing transformCommandArguments function"),o;let a=s?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return w(o?.[a])&&this._unwrap(o,a),this._wrap(o,a,this._getPatchExtendWithCommands(c)),o},o=>{w(o?.extendWithCommands)&&this._unwrap(o,"extendWithCommands"),w(o?.attachCommands)&&this._unwrap(o,"attachCommands")}),r=new Ae(`${t}/dist/lib/client/multi-command.js`,["^1.0.0",">=5.0.0 <5.12.0"],o=>{let s=o?.default?.prototype;return w(s?.exec)&&this._unwrap(s,"exec"),this._wrap(s,"exec",this._getPatchMultiCommandsExec()),w(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),this._wrap(s,"execAsPipeline",this._getPatchMultiCommandsExec()),w(s?.addCommand)&&this._unwrap(s,"addCommand"),this._wrap(s,"addCommand",this._getPatchMultiCommandsAddCommand()),o},o=>{let s=o?.default?.prototype;w(s?.exec)&&this._unwrap(s,"exec"),w(s?.execAsPipeline)&&this._unwrap(s,"execAsPipeline"),w(s?.addCommand)&&this._unwrap(s,"addCommand")}),i=new Ae(`${t}/dist/lib/client/index.js`,["^1.0.0",">=5.0.0 <5.12.0"],o=>{let s=o?.default?.prototype;return s?.multi&&(w(s?.multi)&&this._unwrap(s,"multi"),this._wrap(s,"multi",this._getPatchRedisClientMulti())),s?.MULTI&&(w(s?.MULTI)&&this._unwrap(s,"MULTI"),this._wrap(s,"MULTI",this._getPatchRedisClientMulti())),w(s?.sendCommand)&&this._unwrap(s,"sendCommand"),this._wrap(s,"sendCommand",this._getPatchRedisClientSendCommand()),w(s?.connect)&&this._unwrap(s,"connect"),this._wrap(s,"connect",this._getPatchedClientConnect()),o},o=>{let s=o?.default?.prototype;w(s?.multi)&&this._unwrap(s,"multi"),w(s?.MULTI)&&this._unwrap(s,"MULTI"),w(s?.sendCommand)&&this._unwrap(s,"sendCommand"),w(s?.connect)&&this._unwrap(s,"connect")});return new re(t,["^1.0.0",">=5.0.0 <5.12.0"],o=>o,()=>{},[n,r,i])}_getPatchExtendWithCommands(t){let n=this;return function(i){return function(s){if(s?.BaseClass?.name!=="RedisClient")return i.apply(this,arguments);let c=s.executor;return s.executor=function(a,l){let p=t(a,l).args;return n._traceClientCommand(c,this,arguments,p)},i.apply(this,arguments)}}}_getPatchMultiCommandsExec(){let t=this;return function(r){return function(){let o=r.apply(this,arguments);return typeof o?.then!="function"?(Ye&&g.error("non-promise result when patching exec/execAsPipeline"),o):o.then(s=>{let c=this[hp];return t._endSpansWithRedisReplies(c,s),s}).catch(s=>{let c=this[hp];if(!c)Ye&&g.error("cannot find open spans to end for multi/pipeline");else{let a=s.constructor.name==="MultiErrorReply"?s.replies:new Array(c.length).fill(s);t._endSpansWithRedisReplies(c,a)}return Promise.reject(s)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(o){return t._traceClientCommand(r,this,arguments,o)}}}_getPatchRedisClientMulti(){return function(n){return function(){let i=n.apply(this,arguments);return i[gw]=this.options,i}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(o){return t._traceClientCommand(r,this,arguments,o)}}}_getPatchedClientConnect(){return function(n){return function(){let i=_w(this.options),o=k({name:`${mT.COMPONENT}-connect`,kind:U.CLIENT,attributes:i});return se(o,()=>n.apply(this)).then(c=>(o.end(),c),c=>(Tf(o,c),Promise.reject(c)))}}}_traceClientCommand(t,n,r,i){let o=n.options||n[gw],s=i[0],c=i.slice(1),a=_w(o),l=zr(s,c);l!=null&&(a[Ve]=l);let p=k({name:`${mT.COMPONENT}-${s}`,kind:U.CLIENT,attributes:a}),u=se(p,()=>t.apply(n,r));if(u instanceof Promise)u.then(d=>{this._endSpanWithResponse(p,s,c,d,void 0)},d=>{this._endSpanWithResponse(p,s,c,null,d)});else{let d=u;d[hp]=d[hp]||[],d[hp].push({span:p,commandName:s,commandArgs:c})}return u}_endSpansWithRedisReplies(t,n){if(!t){Ye&&g.error("cannot find open spans to end for redis multi/pipeline");return}if(n.length!==t.length){Ye&&g.error("number of multi command spans does not match response from redis");return}for(let r=0;r<t.length;r++){let{span:i,commandName:o,commandArgs:s}=t[r],c=n[r],[a,l]=c instanceof Error?[null,c]:[c,void 0];this._endSpanWithResponse(i,o,s,a,l)}}_endSpanWithResponse(t,n,r,i,o){o||bw(this.getConfig().responseHook,t,n,r,i),Tf(t,o)}};Ew.COMPONENT="redis";var HQ=Ew,If=class extends ae{constructor(t={}){super(fT,q,t),this.initialized=!1,this.instrumentationV2_V3=new BQ(this.getConfig()),this.instrumentationV4_V5=new HQ(this.getConfig()),this.initialized=!0}setConfig(t={}){super.setConfig(t),this.initialized&&(this.instrumentationV2_V3.setConfig(t),this.instrumentationV4_V5.setConfig(t))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};var Af="Redis",FQ=de(`${Af}.IORedis`,()=>new Ef({responseHook:_s})),WQ=de(`${Af}.Redis`,()=>new If({responseHook:_s})),gT=Object.assign(()=>{(!za()||!Tw.tracingChannel)&&(FQ(),WQ())},{id:Af}),VQ=((e={})=>Ut(SE({responseHook:_s}),{name:Af,setupOnce(){mw(e),gT()}})),_T=VQ;var bs=(e=>(e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect",e))(bs||{});var bp=(e=>(e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client",e))(bp||{});var hT="db.connection_string",bT="postgresql";var YQ="auto.db.otel.postgres";function jQ(e,t){if(!t)return bs.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:ZQ(t.text);return`${bs.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}function ZQ(e){let t=e.trim(),n=t.indexOf(" "),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}function XQ(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}function Iw(e){if("connectionString"in e&&e.connectionString)return XQ(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}function Aw(e){if(Number.isInteger(e))return e}function yT(e){return{[Pe]:bT,[Et]:e.database,[hT]:Iw(e),[Mt]:e.user,[Le]:e.host,[xe]:Aw(e.port)}}function Nw(e){let t;try{t=e.connectionString?new URL(e.connectionString):void 0}catch{t=void 0}return{[bp.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[bp.MAX_CLIENT]:e.maxClient,[Pe]:bT,[Et]:t?.pathname.slice(1)??e.database,[hT]:Iw(e),[Le]:t?.hostname??e.host,[xe]:Number(t?.port)||Aw(e.port),[Mt]:t?.username??e.user}}function Nf(){return Q()===void 0}function vw(e){let{connectionParameters:t}=this,n=t.database,r=jQ(n,e),i=k({name:r,kind:U.CLIENT,attributes:{...yT(t),[S]:YQ}});return e&&(e.text&&i.setAttribute(Ve,e.text),typeof e.name=="string"&&i.setAttribute(bp.PG_PLAN,e.name)),i}function ST(e,t){return function(r,i){r&&e.setStatus({code:2,message:r.message}),e.end(),t.call(this,r,i)}}function Rw(e,t){return function(r,i,o){r&&e.setStatus({code:2,message:r.message}),e.end(),t.call(this,r,i,o)}}function Ow(e,t){return function(...r){let i=r[0];i instanceof Error&&e.setStatus({code:2,message:i.message}),e.end(),t.apply(this,r)}}function vf(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}function Cw(e){return typeof e=="object"&&typeof e?.text=="string"}var KQ="@sentry/instrumentation-pg";function nc(e){return e[Symbol.toStringTag]==="Module"?e.default:e}function Rf(e,t){return function(...n){return se(e,()=>t.apply(this,n))}}var Of=class extends ae{constructor(t={}){super(KQ,q,t)}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Ae("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new Ae("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new re("pg",t,c=>{let a=nc(c);return this._patchPgClient(a.Client),c},c=>{let a=nc(c);return this._unpatchPgClient(a.Client),c},[i,r]),s=new re("pg-pool",n,c=>{let a=nc(c);return w(a.prototype.connect)&&this._unwrap(a.prototype,"connect"),this._wrap(a.prototype,"connect",this._getPoolConnectPatch()),a},c=>{let a=nc(c);w(a.prototype.connect)&&this._unwrap(a.prototype,"connect")});return[o,s]}_patchPgClient(t){if(!t)return;let n=nc(t);return w(n.prototype.query)&&this._unwrap(n.prototype,"query"),w(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=nc(t);return w(n.prototype.query)&&this._unwrap(n.prototype,"query"),w(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(i){if(Nf()||t.getConfig().ignoreConnectSpans)return n.call(this,i);let o=k({name:bs.CONNECT,kind:U.CLIENT,attributes:yT(this)}),s=i;if(s){let a=Q();s=Ow(o,s),a&&(s=Rf(a,s))}let c=se(o,()=>n.call(this,s));return xw(o,c)}}_getClientQueryPatch(){return t=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...r){if(Nf())return t.apply(this,r);let i=r[0],o=typeof i=="string",s=Cw(i),c=o?{text:i,values:Array.isArray(r[1])?r[1]:void 0}:s?{...i,name:i.name,text:i.text,values:i.values??(Array.isArray(r[1])?r[1]:void 0)}:void 0,a=vw.call(this,c);if(r.length>0){let p=Q();if(typeof r[r.length-1]=="function")r[r.length-1]=ST(a,r[r.length-1]),p&&(r[r.length-1]=Rf(p,r[r.length-1]));else if(typeof c?.callback=="function"){let u=ST(a,c.callback);p&&(u=Rf(p,u)),r[0].callback=u}}let l;try{l=t.apply(this,r)}catch(p){throw a.setStatus({code:2,message:vf(p)}),a.end(),p}return l instanceof Promise?l.then(p=>(a.end(),p)).catch(p=>(a.setStatus({code:2,message:vf(p)}),a.end(),Promise.reject(p))):l})}_getPoolConnectPatch(){let t=this;return n=>function(i){if(Nf()||t.getConfig().ignoreConnectSpans)return n.call(this,i);let o=k({name:bs.POOL_CONNECT,kind:U.CLIENT,attributes:Nw(this.options)}),s=i;if(s){let a=Q();s=Rw(o,s),a&&(s=Rf(a,s))}let c=se(o,()=>n.call(this,s));return xw(o,c)}}};function xw(e,t){return t instanceof Promise?t.then(r=>(e.end(),r)).catch(r=>(e.setStatus({code:2,message:vf(r)}),e.end(),Promise.reject(r))):t}var Pw="Postgres",ET=de(Pw,Of,e=>({ignoreConnectSpans:e?.ignoreConnectSpans??!1})),qQ=(e=>({name:Pw,setupOnce(){ET(e)}})),TT=qQ;at();var AT="PostgresJs",kw=[">=3.0.0 <4"],QQ="db.response.status_code",JQ=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,$Q=Symbol.for("sentry.query.from.instrumented.sql"),NT=de(AT,e=>new IT({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),IT=class extends ae{constructor(t){super("sentry-postgres-js",q,t)}init(){let t=new re("postgres",kw,n=>{try{return this._patchPostgres(n)}catch(r){return Ye&&g.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new Ae(`postgres/${n}/query.js`,kw,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return Ye&&g.warn("postgres module does not export a function. Skipping instrumentation."),t;let i=this,o=function(...s){let c=Reflect.construct(r,s);if(!c||typeof c!="function")return Ye&&g.warn("postgres() did not return a valid instance"),c;let a=i.getConfig();return Oy(c,{requireParentSpan:a.requireParentSpan,requestHook:a.requestHook})};Object.setPrototypeOf(o,r),Object.setPrototypeOf(o.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(o,s,c)}return n?o:(Rl(t,"default",o),t)}_shouldCreateSpans(){let t=this.getConfig();return he.getSpan(pe.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(ar,r);return}let i=n?.match(JQ);i?.[1]&&t.setAttribute(ar,i[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,i)=>i===0?r:`${n}$${i}${r}`,"")}_sanitizeSqlQuery(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...i){if(this.executed||this[$Q])return r.apply(this,i);if(!n._shouldCreateSpans())return r.apply(this,i);let o=n._reconstructQuery(this.strings),s=n._sanitizeSqlQuery(o);return ke({name:s||"postgresjs.query",op:"db"},c=>{qS(c,"auto.db.postgresjs"),c.setAttributes({[mt]:"postgres",[Mr]:s});let a=n.getConfig(),{requestHook:l}=a;l&&qr(()=>l(c,s,void 0),d=>{d&&(c.setAttribute("sentry.hook.error","requestHook failed"),Ye&&g.error(`Error in requestHook for ${AT} integration:`,d))},!0);let p=this.resolve;this.resolve=new Proxy(p,{apply:(d,m,_)=>{try{n._setOperationName(c,s,_?.[0]?.command),c.end()}catch(h){Ye&&g.error("Error ending span in resolve callback:",h)}return Reflect.apply(d,m,_)}});let u=this.reject;this.reject=new Proxy(u,{apply:(d,m,_)=>{try{c.setStatus({code:2,message:_?.[0]?.message||"unknown_error"}),c.setAttribute(QQ,_?.[0]?.code||"unknown"),c.setAttribute(wr,_?.[0]?.name||"unknown"),n._setOperationName(c,s),c.end()}catch(h){Ye&&g.error("Error ending span in reject callback:",h)}return Reflect.apply(d,m,_)}});try{return r.apply(this,i)}catch(d){throw c.setStatus({code:2,message:d instanceof Error?d.message:"unknown_error"}),c.end(),d}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},zQ=(e=>({name:AT,setupOnce(){NT(e)}})),vT=zQ;at();var Ln=(e=>(e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type",e))(Ln||{});var Lw="@hapi/hapi",yp=Symbol("hapi-handler-patched"),Sp={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"},Mw=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"]);function ww(e){return e.name?e.name:e.pkg.name}var Cf=e=>typeof e=="string"&&Mw.has(e),Gw=e=>{let t=e?.type;return t!==void 0&&Cf(t)},Uw=e=>Array.isArray(e)&&e.length<=3&&Cf(e[0])&&typeof e[1]=="function",Dw=e=>!Array.isArray(e),Bw=(e,t)=>{let n={[He]:e.path,[Gr]:e.method},r;return t?(n[Ln.HAPI_TYPE]=Sp.PLUGIN,n[Ln.PLUGIN_NAME]=t,r=`${t}: route - ${e.path}`):(n[Ln.HAPI_TYPE]=Sp.ROUTER,r=`route - ${e.path}`),{attributes:n,name:r}},Hw=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[Ln.EXT_TYPE]:e,[Ln.HAPI_TYPE]:Sp.EXT,[Ln.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[Ln.EXT_TYPE]:e,[Ln.HAPI_TYPE]:Sp.EXT},name:r}},RT=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;var eJ="@sentry/instrumentation-hapi",xf=class extends ae{constructor(t={}){super(eJ,q,t)}init(){return new re(Lw,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return w(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),w(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(o){let s=t.apply(this,[o]);return r._wrap(s,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(s,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(s,"register",n._getServerRegisterPatch.bind(n)),s}}_getServerRegisterPatch(t){let n=this;return function(i,o){if(Array.isArray(i))for(let s of i){let c=RT(s);n._wrapRegisterHandler(c)}else{let s=RT(i);n._wrapRegisterHandler(s)}return t.apply(this,[i,o])}}_getServerExtPatch(t,n){let r=this;return function(...o){if(Array.isArray(o[0])){let s=o[0];for(let c=0;c<s.length;c++){let a=s[c];if(Cf(a.type)){let l=a,p=r._wrapExtMethods(l.method,a.type,n);l.method=p,s[c]=l}}return t.apply(this,o)}else if(Uw(o)){let s=o,c=s[1],a=r._wrapExtMethods(c,s[0],n);return t.apply(this,[s[0],a,s[2]])}else if(Gw(o[0])){let s=o[0],c=r._wrapExtMethods(s.method,s.type,n);return s.method=c,t.call(this,s)}return t.apply(this,o)}}_getServerRoutePatch(t,n){let r=this;return function(i){if(Array.isArray(i))for(let o=0;o<i.length;o++){let s=r._wrapRouteHandler.call(r,i[o],n);i[o]=s}else i=r._wrapRouteHandler.call(r,i,n);return t.apply(this,[i])}}_wrapRegisterHandler(t){let n=this,r=ww(t),i=t.register,o=this,s=function(c,a){return o._wrap(c,"route",l=>n._getServerRoutePatch.bind(n)(l,r)),o._wrap(c,"ext",l=>n._getServerExtPatch.bind(n)(l,r)),i.call(this,c,a)};t.register=s}_wrapExtMethods(t,n,r){let i=this;if(t instanceof Array){for(let o=0;o<t.length;o++)t[o]=i._wrapExtMethods(t[o],n);return t}else if(Dw(t))return t[yp]===!0?t:(t[yp]=!0,function(...s){if(he.getSpan(pe.active())===void 0)return t.apply(this,s);let c=Hw(n,r,t.name);return Se({name:c.name,op:`${c.attributes[Ln.HAPI_TYPE]}.hapi`,attributes:{...c.attributes,[S]:"auto.http.otel.hapi"}},()=>t.apply(void 0,s))});return t}_wrapRouteHandler(t,n){if(t[yp]===!0)return t;t[yp]=!0;let r=i=>function(...o){if(he.getSpan(pe.active())===void 0)return i.call(this,...o);$r(t.path);let s=Bw(t,n);return Se({name:s.name,op:`${s.attributes[Ln.HAPI_TYPE]}.hapi`,attributes:{...s.attributes,[S]:"auto.http.otel.hapi"}},()=>i.call(this,...o))};if(typeof t.handler=="function")t.handler=r(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(o){let s=i(o);return typeof s.handler=="function"&&(s.handler=r(s.handler)),s}}else typeof t.options?.handler=="function"&&(t.options.handler=r(t.options.handler));return t}};var Fw="Hapi",Pf=de(Fw,()=>new xf),tJ=(()=>({name:Fw,setupOnce(){Pf()}})),OT=tJ;function nJ(e){return!!(e&&typeof e=="object"&&"error"in e&&e.error)}function rJ(e){me(e,{mechanism:{type:"auto.function.hapi",handled:!1}})}var iJ={name:"SentryHapiErrorPlugin",version:q,register:async function(e){e.events.on({name:"request",channels:["error"]},(n,r)=>{if(J()!==Rt()){let i=n.route;i.path&&J().setTransactionName(`${i.method.toUpperCase()} ${i.path}`)}else Ye&&g.warn("Isolation scope is still the default isolation scope - skipping setting transactionName");nJ(r)&&rJ(r.error)})}};async function oJ(e){await e.register(iJ),_r(e.register,"hapi")}var go={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},Ep={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"};at();var sJ="@sentry/instrumentation-hono",aJ="0.0.1",kf=class extends ae{constructor(t={}){super(sJ,aJ,t)}init(){return[new re("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...o){super(...o),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...i){if(typeof i[0]=="string"){let o=i[0];if(i.length===1)return n.apply(this,[o]);let s=i.slice(1);return n.apply(this,[o,...s.map(c=>t._wrapHandler(c))])}return n.apply(this,i.map(o=>t._wrapHandler(o)))}}}_patchOnHandler(){let t=this;return function(n){return function(...i){let o=i.slice(2);return n.apply(this,[...i.slice(0,2),...o.map(s=>t._wrapHandler(s))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...i){if(typeof i[0]=="string"){let o=i[0];if(i.length===1)return n.apply(this,[o]);let s=i.slice(1);return n.apply(this,[o,...s.map(c=>t._wrapHandler(c))])}return n.apply(this,i.map(o=>t._wrapHandler(o)))}}}_wrapHandler(t){let n=this;return function(r,i){if(!n.isEnabled())return t.apply(this,[r,i]);let o=r.req.path,s=n.tracer.startSpan(o);return pe.with(he.setSpan(pe.active(),s),()=>n._safeExecute(()=>{let c=t.apply(this,[r,i]);if(bt(c))return c.then(a=>{let l=n._determineHandlerType(a);return s.setAttributes({[go.HONO_TYPE]:l,[go.HONO_NAME]:l===Ep.REQUEST_HANDLER?o:t.name||"anonymous"}),n.getConfig().responseHook?.(s),a});{let a=n._determineHandlerType(c);return s.setAttributes({[go.HONO_TYPE]:a,[go.HONO_NAME]:a===Ep.REQUEST_HANDLER?o:t.name||"anonymous"}),n.getConfig().responseHook?.(s),c}},()=>s.end(),c=>{n._handleError(s,c),s.end()}))}}_safeExecute(t,n,r){try{let i=t();return bt(i)?i.then(()=>n(),o=>r(o)):n(),i}catch(i){throw r(i),i}}_determineHandlerType(t){return t===void 0?Ep.MIDDLEWARE:Ep.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:Gn.ERROR,message:n.message}),t.recordException(n))}};var Ww="Hono";function cJ(e){let t=oe(e).data,n=t[go.HONO_TYPE];if(t[B]||!n)return;e.setAttributes({[S]:"auto.http.otel.hono",[B]:`${n}.hono`});let r=t[go.HONO_NAME];if(typeof r=="string"&&e.updateName(r),J()===Rt()){Ye&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=t[He],o=t[Ur];typeof i=="string"&&typeof o=="string"&&J().setTransactionName(`${o} ${i}`)}var CT=de(Ww,()=>new kf({responseHook:e=>{cJ(e)}})),lJ=(()=>({name:Ww,setupOnce(){CT()}})),xT=lJ;function pJ(){return async function(t,n){let r=Qo(t.req);J().setSDKProcessingMetadata({normalizedRequest:r}),await n()}}function uJ(e){return e.res.status>=500}function dJ(e){return async function(n,r){await r(),(e?.shouldHandleError||uJ)(n)&&(n.res.sentry=me(n.error,{mechanism:{type:"auto.middleware.hono",handled:!1}}))}}function mJ(e,t){e.use(pJ()),e.use(dJ(t)),_r(e.use,"hono")}at();var ys=(e=>(e.ROUTER="router",e.MIDDLEWARE="middleware",e))(ys||{});var _o=(e=>(e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name",e))(_o||{});var Vw=(e,t,n,r)=>n?{attributes:{[_o.KOA_NAME]:r?.toString(),[_o.KOA_TYPE]:ys.ROUTER,[He]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[_o.KOA_NAME]:t.name??"middleware",[_o.KOA_TYPE]:ys.MIDDLEWARE,[yu]:t.name??"middleware"},name:`middleware - ${t.name}`},Yw=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));var PT=Symbol("koa-layer-patched");var fJ="@sentry/instrumentation-koa",Lf=class extends ae{constructor(t={}){super(fJ,q,t)}init(){return new re("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:(w(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;n&&w(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this._patchRouterDispatch.bind(this),r=this._patchLayer.bind(this);return function(o){let s=o.router?n(o):r(o,!1);return t.apply(this,[s])}}_patchRouterDispatch(t){let r=t.router?.stack??[];for(let i of r){let o=i.path,s=i.stack;for(let c=0;c<s.length;c++){let a=s[c];s[c]=this._patchLayer(a,!0,o)}}return t}_patchLayer(t,n,r){let i=n?ys.ROUTER:ys.MIDDLEWARE;return t[PT]===!0||Yw(i,this.getConfig())||t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?t:(t[PT]=!0,(o,s)=>{if(he.getSpan(pe.active())===void 0)return t(o,s);let a=Vw(o,t,n,r);o._matchedRoute&&$r(o._matchedRoute.toString());let l=a.attributes[_o.KOA_NAME],p=typeof l=="string"?l||"< unknown >":a.name;return Se({name:p,op:`${i}.koa`,attributes:{...a.attributes,[S]:"auto.http.otel.koa"}},()=>{let u=a.attributes[He];if(J()===Rt())Ye&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");else if(u){let d=o.request?.method?.toUpperCase()||"GET";J().setTransactionName(`${d} ${u}`)}return t(o,s)})})}};var jw="Koa",kT=de(jw,Lf,(e={})=>({ignoreLayersType:e.ignoreLayersType})),gJ=((e={})=>({name:jw,setupOnce(){kT(e)}})),LT=gJ,_J=e=>{e.use(async(t,n)=>{try{await n()}catch(r){throw me(r,{mechanism:{handled:!1,type:"auto.middleware.koa"}}),r}}),_r(e.use,"koa")};var Mf=(e=>(e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name",e))(Mf||{}),wf=(e=>(e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler",e))(wf||{});var Li=Symbol("opentelemetry.instrumentation-connect.request-route-stack");var Zw=e=>{Array.isArray(e[Li])===!1&&Object.defineProperty(e,Li,{enumerable:!1,value:[]}),e[Li].push("/");let t=e[Li].length;return()=>{t===e[Li].length?e[Li].pop():Ye&&g.warn("Connect: Trying to pop the stack multiple time")}},Xw=(e,t)=>{t&&e[Li].splice(-1,1,t)},Kw=e=>e[Li].reduce((t,n)=>t.replace(/\/+$/,"")+n);var hJ="@sentry/instrumentation-connect",bJ="anonymous",Gf=class extends ae{constructor(t={}){super(hJ,q,t)}init(){return[new re("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){w(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),w(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this._patchApp.bind(this);return function(...r){let i=Reflect.apply(t,this,r);return n(i),i}}_patchNext(t,n,r){return function(o){et(o)&&n.setStatus({code:2,message:"internal_error"});let s=t.apply(this,[o]);return r(),s}}_startSpan(t,n){let r=t?wf.REQUEST_HANDLER:wf.MIDDLEWARE,i=t||n.name||bJ;return k({name:i,op:`${r}.connect`,attributes:{[S]:"auto.http.otel.connect",[He]:t.length>0?t:"/",[Mf.CONNECT_TYPE]:r,[Mf.CONNECT_NAME]:i}})}_patchMiddleware(t,n){let r=this.isEnabled.bind(this),i=this._startSpan.bind(this),o=this._patchNext.bind(this),s=n.length===4;function c(){if(!r())return Reflect.apply(n,this,arguments);let[a,l,p]=s?[1,2,3]:[0,1,2],u=arguments[a],d=arguments[l],m=arguments[p];Xw(u,t),t&&$r(Kw(u));let _=i(t,n),h=!1;function b(){h||(h=!0,_.end()),d.removeListener("close",b)}d.addListener("close",b),arguments[p]=o(m,_,b);try{return Reflect.apply(n,this,arguments)}catch(N){throw _.setStatus({code:2,message:"internal_error"}),b(),N}}return Object.defineProperty(c,"length",{value:n.length,writable:!1,configurable:!0}),c}_patchUse(t){let n=this._patchMiddleware.bind(this);return function(...r){let i=r[r.length-1],o=r[r.length-2]||"";return r[r.length-1]=n(o,i),t.apply(this,r)}}_patchHandle(t){let n=this._patchOut.bind(this);return function(){let[r,i]=[0,2],o=arguments[r],s=arguments[i],c=Zw(o);return typeof s=="function"&&(arguments[i]=n(s,c)),Reflect.apply(t,this,arguments)}}_patchOut(t,n){return function(...i){return n(),Reflect.apply(t,this,i)}}};var qw="Connect",MT=de(qw,()=>new Gf),yJ=(()=>({name:qw,setupOnce(){MT()}})),wT=yJ;function SJ(e,t,n,r){me(e,{mechanism:{handled:!1,type:"auto.middleware.connect"}}),r(e)}var EJ=e=>{e.use(SJ),_r(e.use,"connect")};var Qw="db.sql.table",Jw="sqlite",$w="postgresql";var zw=e=>{if(e){if(e.client){if(e.client._formatQuery)return e.client._formatQuery.bind(e.client);if(e.client.SqlString)return e.client.SqlString.format.bind(e.client.SqlString)}if(e.builder)return e.builder.toString.bind(e.builder)}return()=>"<noop formatter>"},TJ=new Map([["sqlite3",Jw],["pg",$w]]),eG=e=>TJ.get(e)||e,tG=(e,t,n)=>t?n?`${t} ${e}.${n}`:`${t} ${e}`:e,nG=(e,t)=>typeof e=="string"&&typeof t=="number"&&0<t&&t<e.length?`${e.substring(0,t)}..`:e,rG=e=>{if(e)try{return new URL(e).pathname?.replace(/^\//,"")||void 0}catch{return}},iG=e=>{if(e)try{return new URL(e).hostname||void 0}catch{return}},oG=e=>{if(e)try{let t=new URL(e).port;return t?parseInt(t,10):void 0}catch{return}},GT=e=>{let t=e?._single?.table;return typeof t=="object"?GT(t):t};var IJ="@sentry/instrumentation-knex",AJ="auto.db.otel.knex",NJ="knex",UT=[">=0.22.0 <4",">=0.10.0 <0.18.0",">=0.19.0 <0.22.0",">=0.18.0 <0.19.0"],vJ=1022,sG=Symbol("sentry.instrumentation-knex.parent-span"),Uf=class extends ae{constructor(t={}){super(IJ,q,t)}init(){let t=new re(NJ,UT);return t.files.push(this._getClientNodeModuleFileInstrumentation("src"),this._getClientNodeModuleFileInstrumentation("lib"),this._getRunnerNodeModuleFileInstrumentation("src"),this._getRunnerNodeModuleFileInstrumentation("lib"),this._getRunnerNodeModuleFileInstrumentation("lib/execution")),t}_getRunnerNodeModuleFileInstrumentation(t){return new Ae(`knex/${t}/runner.js`,UT,(n,r)=>(this._ensureWrapped(n.prototype,"query",this._createQueryWrapper(r)),n),n=>(this._unwrap(n.prototype,"query"),n))}_getClientNodeModuleFileInstrumentation(t){return new Ae(`knex/${t}/client.js`,UT,n=>(this._ensureWrapped(n.prototype,"queryBuilder",this._storeContext.bind(this)),this._ensureWrapped(n.prototype,"schemaBuilder",this._storeContext.bind(this)),this._ensureWrapped(n.prototype,"raw",this._storeContext.bind(this)),n),n=>(this._unwrap(n.prototype,"queryBuilder"),this._unwrap(n.prototype,"schemaBuilder"),this._unwrap(n.prototype,"raw"),n))}_createQueryWrapper(t){return function(r){return function(o){let s=this.client.config,c=GT(this.builder),a=o?.method,l=s?.connection?.connectionString,p=s?.connection?.filename||s?.connection?.database||rG(l),u={[S]:AJ,"knex.version":t,[Pe]:eG(this.client.driverName),[Qw]:c,[Js]:a,[Mt]:s?.connection?.user,[Et]:p,[Le]:s?.connection?.host??iG(l),[xe]:s?.connection?.port??oG(l),[ra]:s?.connection?.filename===":memory:"?"inproc":void 0,[Ve]:nG(o?.sql,vJ)},d=this.builder[sG]||Q(),m=arguments;return Se({name:tG(p,a,c),kind:U.CLIENT,attributes:u,parentSpan:d,onlyIfParent:!0},_=>r.apply(this,m).catch(h=>{let N=zw(this)(o.sql,o.bindings||[]),M=h.message.replace(`${N} - `,"");throw _.setStatus({code:2,message:M}),h}))}}}_storeContext(t){return function(){let r=t.apply(this,arguments);return Object.defineProperty(r,sG,{value:Q()}),r}}_ensureWrapped(t,n,r){w(t[n])&&this._unwrap(t,n),this._wrap(t,n,r)}};import*as Zn from"diagnostics_channel";var RJ="sentrySubscribeOrchestrionChannel";function fe(e){let t=new Set,n=[];for(let{module:r}of e){let i=`${r.name}\0${r.versionRange}\0${String(r.filePath)}`;t.has(i)||(t.add(i),n.push({channelName:r.name,module:r,astQuery:"Program",transform:RJ}))}return n}var ti={name:"amqplib",versionRange:">=0.5.5 <2"},DT=[{channelName:"publish",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"publish",kind:"Sync"}},{channelName:"confirmPublish",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"ConfirmChannel",methodName:"publish",kind:"Callback"}},{channelName:"consume",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"consume",kind:"Async"}},{channelName:"dispatch",module:{...ti,filePath:"lib/channel.js"},functionQuery:{className:"BaseChannel",methodName:"dispatchMessage",kind:"Sync"}},{channelName:"ack",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"ack",kind:"Sync"}},{channelName:"nack",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"nack",kind:"Sync"}},{channelName:"reject",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"reject",kind:"Sync"}},{channelName:"ackAll",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"ackAll",kind:"Sync"}},{channelName:"nackAll",module:{...ti,filePath:"lib/channel_model.js"},functionQuery:{className:"Channel",methodName:"nackAll",kind:"Sync"}},{channelName:"connect",module:{...ti,filePath:"lib/connect.js"},functionQuery:{functionName:"connect",kind:"Callback"}}],aG={AMQPLIB_PUBLISH:"orchestrion:amqplib:publish",AMQPLIB_CONFIRM_PUBLISH:"orchestrion:amqplib:confirmPublish",AMQPLIB_CONSUME:"orchestrion:amqplib:consume",AMQPLIB_DISPATCH:"orchestrion:amqplib:dispatch",AMQPLIB_ACK:"orchestrion:amqplib:ack",AMQPLIB_NACK:"orchestrion:amqplib:nack",AMQPLIB_REJECT:"orchestrion:amqplib:reject",AMQPLIB_ACK_ALL:"orchestrion:amqplib:ackAll",AMQPLIB_NACK_ALL:"orchestrion:amqplib:nackAll",AMQPLIB_CONNECT:"orchestrion:amqplib:connect"},cG=fe(DT);var BT=[...["resources/messages/messages.js","resources/messages/messages.mjs"].flatMap(e=>["create","countTokens"].map(t=>({channelName:"chat",module:{name:"@anthropic-ai/sdk",versionRange:">=0.19.2 <1",filePath:e},functionQuery:{className:"Messages",methodName:t,kind:"Auto"}}))),...["resources/completions.js","resources/completions.mjs"].map(e=>({channelName:"chat",module:{name:"@anthropic-ai/sdk",versionRange:">=0.19.2 <1",filePath:e},functionQuery:{className:"Completions",methodName:"create",kind:"Auto"}})),...["resources/beta/messages/messages.js","resources/beta/messages/messages.mjs"].map(e=>({channelName:"chat",module:{name:"@anthropic-ai/sdk",versionRange:">=0.19.2 <1",filePath:e},functionQuery:{className:"Messages",methodName:"create",kind:"Auto"}})),...["resources/models.js","resources/models.mjs"].map(e=>({channelName:"models",module:{name:"@anthropic-ai/sdk",versionRange:">=0.19.2 <1",filePath:e},functionQuery:{className:"Models",methodName:"retrieve",kind:"Auto"}})),...["resources/messages/messages.js","resources/messages/messages.mjs"].map(e=>({channelName:"messages-stream",module:{name:"@anthropic-ai/sdk",versionRange:">=0.19.2 <1",filePath:e},functionQuery:{className:"Messages",methodName:"stream",kind:"Sync"}}))],lG={ANTHROPIC_CHAT:"orchestrion:@anthropic-ai/sdk:chat",ANTHROPIC_MODELS:"orchestrion:@anthropic-ai/sdk:models",ANTHROPIC_MESSAGES_STREAM:"orchestrion:@anthropic-ai/sdk:messages-stream"},pG=fe(BT);var HT=[{channelName:"send",module:{name:"@smithy/core",versionRange:">=3.24.0 <4",filePath:"dist-cjs/submodules/client/index.js"},functionQuery:{className:"Client",methodName:"send",kind:"Async"}},{channelName:"send",module:{name:"@smithy/smithy-client",versionRange:">=1.0.3 <5",filePath:"dist-cjs/index.js"},functionQuery:{className:"Client",methodName:"send",kind:"Async"}},{channelName:"send",module:{name:"@aws-sdk/smithy-client",versionRange:"^3.1.0",filePath:"dist-cjs/index.js"},functionQuery:{className:"Client",methodName:"send",kind:"Async"}}],uG={AWS_SMITHY_CORE_SEND:"orchestrion:@smithy/core:send",AWS_SMITHY_CLIENT_SEND:"orchestrion:@smithy/smithy-client:send",AWS_SDK_SMITHY_CLIENT_SEND:"orchestrion:@aws-sdk/smithy-client:send"},dG=fe(HT);var rc={name:"dataloader",versionRange:">=2.0.0 <3",filePath:"index.js"},FT=[{channelName:"construct",module:rc,functionQuery:{functionName:"DataLoader",kind:"Sync"}},{channelName:"load",module:rc,functionQuery:{expressionName:"load",kind:"Async"}},{channelName:"loadMany",module:rc,functionQuery:{expressionName:"loadMany",kind:"Async"}},{channelName:"prime",module:rc,functionQuery:{expressionName:"prime",kind:"Sync"}},{channelName:"clear",module:rc,functionQuery:{expressionName:"clear",kind:"Sync"}},{channelName:"clearAll",module:rc,functionQuery:{expressionName:"clearAll",kind:"Sync"}}],mG={DATALOADER_CONSTRUCT:"orchestrion:dataloader:construct",DATALOADER_LOAD:"orchestrion:dataloader:load",DATALOADER_LOAD_MANY:"orchestrion:dataloader:loadMany",DATALOADER_PRIME:"orchestrion:dataloader:prime",DATALOADER_CLEAR:"orchestrion:dataloader:clear",DATALOADER_CLEAR_ALL:"orchestrion:dataloader:clearAll"},fG=fe(FT);var WT=[{channelName:"handle",module:{name:"express",versionRange:">=4.0.0 <5",filePath:"lib/router/layer.js"},functionQuery:{expressionName:"handle_request",kind:"Callback"}},{channelName:"handle",module:{name:"router",versionRange:">=2.0.0 <3",filePath:"lib/layer.js"},functionQuery:{expressionName:"handleRequest",kind:"Callback"}},{channelName:"register",module:{name:"express",versionRange:">=4.0.0 <5",filePath:"lib/router/index.js"},functionQuery:{expressionName:"route",kind:"Sync"}},{channelName:"register",module:{name:"express",versionRange:">=4.0.0 <5",filePath:"lib/router/index.js"},functionQuery:{expressionName:"use",kind:"Sync"}},{channelName:"register",module:{name:"router",versionRange:">=2.0.0 <3",filePath:"index.js"},functionQuery:{expressionName:"route",kind:"Sync"}},{channelName:"register",module:{name:"router",versionRange:">=2.0.0 <3",filePath:"index.js"},functionQuery:{expressionName:"use",kind:"Sync"}}],gG={EXPRESS_HANDLE:"orchestrion:express:handle",ROUTER_HANDLE:"orchestrion:router:handle",EXPRESS_REGISTER:"orchestrion:express:register",ROUTER_REGISTER:"orchestrion:router:register"},_G=fe(WT);var OJ=">=3.0.0 <5",CJ=/dist\/lite\/(index|common-[^/]+)\.node\.(cjs\.js|mjs)$/,xJ=[{functionName:"addDoc",channelName:"add-doc"},{functionName:"getDocs",channelName:"get-docs"},{functionName:"setDoc",channelName:"set-doc"},{functionName:"deleteDoc",channelName:"delete-doc"}],PJ=">=6.0.0 <7",kJ=[{file:"lib/v2/providers/https.js",functionName:"onRequest",channelName:"http-request"},{file:"lib/v2/providers/https.js",functionName:"onCall",channelName:"http-call"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentCreated",channelName:"firestore-created"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentCreatedWithAuthContext",channelName:"firestore-created"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentUpdated",channelName:"firestore-updated"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentUpdatedWithAuthContext",channelName:"firestore-updated"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentDeleted",channelName:"firestore-deleted"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentDeletedWithAuthContext",channelName:"firestore-deleted"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentWritten",channelName:"firestore-written"},{file:"lib/v2/providers/firestore.js",functionName:"onDocumentWrittenWithAuthContext",channelName:"firestore-written"},{file:"lib/v2/providers/scheduler.js",functionName:"onSchedule",channelName:"scheduler"},{file:"lib/v2/providers/storage.js",functionName:"onObjectFinalized",channelName:"storage-finalized"},{file:"lib/v2/providers/storage.js",functionName:"onObjectArchived",channelName:"storage-archived"},{file:"lib/v2/providers/storage.js",functionName:"onObjectDeleted",channelName:"storage-deleted"},{file:"lib/v2/providers/storage.js",functionName:"onObjectMetadataUpdated",channelName:"storage-metadata-updated"}],VT=[...xJ.map(({functionName:e,channelName:t})=>({channelName:t,module:{name:"@firebase/firestore",versionRange:OJ,filePath:CJ},functionQuery:{functionName:e,kind:"Auto"}})),...kJ.map(({file:e,functionName:t,channelName:n})=>({channelName:n,module:{name:"firebase-functions",versionRange:PJ,filePath:e},functionQuery:{functionName:t,kind:"Sync"}}))],hG={FIREBASE_FIRESTORE_ADD_DOC:"orchestrion:@firebase/firestore:add-doc",FIREBASE_FIRESTORE_GET_DOCS:"orchestrion:@firebase/firestore:get-docs",FIREBASE_FIRESTORE_SET_DOC:"orchestrion:@firebase/firestore:set-doc",FIREBASE_FIRESTORE_DELETE_DOC:"orchestrion:@firebase/firestore:delete-doc",FIREBASE_FUNCTIONS_HTTP_REQUEST:"orchestrion:firebase-functions:http-request",FIREBASE_FUNCTIONS_HTTP_CALL:"orchestrion:firebase-functions:http-call",FIREBASE_FUNCTIONS_FIRESTORE_CREATED:"orchestrion:firebase-functions:firestore-created",FIREBASE_FUNCTIONS_FIRESTORE_UPDATED:"orchestrion:firebase-functions:firestore-updated",FIREBASE_FUNCTIONS_FIRESTORE_DELETED:"orchestrion:firebase-functions:firestore-deleted",FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN:"orchestrion:firebase-functions:firestore-written",FIREBASE_FUNCTIONS_SCHEDULER:"orchestrion:firebase-functions:scheduler",FIREBASE_FUNCTIONS_STORAGE_FINALIZED:"orchestrion:firebase-functions:storage-finalized",FIREBASE_FUNCTIONS_STORAGE_ARCHIVED:"orchestrion:firebase-functions:storage-archived",FIREBASE_FUNCTIONS_STORAGE_DELETED:"orchestrion:firebase-functions:storage-deleted",FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED:"orchestrion:firebase-functions:storage-metadata-updated"},bG=fe(VT);var YT=[{channelName:"acquire",module:{name:"generic-pool",versionRange:">=3.0.0 <4",filePath:"lib/Pool.js"},functionQuery:{className:"Pool",methodName:"acquire",kind:"Auto"}},{channelName:"acquire",module:{name:"generic-pool",versionRange:">=2.4.0 <3",filePath:"lib/generic-pool.js"},functionQuery:{expressionName:"acquire",kind:"Callback"}}],yG={GENERIC_POOL_ACQUIRE:"orchestrion:generic-pool:acquire"},SG=fe(YT);var jT=["dist/node/index.js","dist/node/index.mjs","dist/node/index.cjs"],ZT=[...jT.flatMap(e=>["generateContent","generateContentStream"].map(t=>({channelName:"generate-content",module:{name:"@google/genai",versionRange:">=0.10.0 <2",filePath:e},functionQuery:{expressionName:t,kind:"Auto"}}))),...jT.map(e=>({channelName:"embed-content",module:{name:"@google/genai",versionRange:">=0.10.0 <2",filePath:e},functionQuery:{className:"Models",methodName:"embedContent",kind:"Auto"}})),...jT.flatMap(e=>["sendMessage","sendMessageStream"].map(t=>({channelName:"chat",module:{name:"@google/genai",versionRange:">=0.10.0 <2",filePath:e},functionQuery:{className:"Chat",methodName:t,kind:"Auto"}})))],EG={GOOGLE_GENAI_GENERATE_CONTENT:"orchestrion:@google/genai:generate-content",GOOGLE_GENAI_EMBED_CONTENT:"orchestrion:@google/genai:embed-content",GOOGLE_GENAI_CHAT:"orchestrion:@google/genai:chat"},TG=fe(ZT);var XT=[{channelName:"parse",module:{name:"graphql",versionRange:">=14.0.0 <17",filePath:"language/parser.js"},functionQuery:{functionName:"parse",kind:"Sync"}},{channelName:"validate",module:{name:"graphql",versionRange:">=14.0.0 <17",filePath:"validation/validate.js"},functionQuery:{functionName:"validate",kind:"Sync"}},{channelName:"execute",module:{name:"graphql",versionRange:">=14.0.0 <17",filePath:"execution/execute.js"},functionQuery:{functionName:"execute",kind:"Auto"}}],IG={GRAPHQL_PARSE:"orchestrion:graphql:parse",GRAPHQL_VALIDATE:"orchestrion:graphql:validate",GRAPHQL_EXECUTE:"orchestrion:graphql:execute"},AG=fe(XT);var KT=[{channelName:"route",module:{name:"@hapi/hapi",versionRange:">=17.0.0 <22.0.0",filePath:"lib/server.js"},functionQuery:{methodName:"route",kind:"Sync"}},{channelName:"ext",module:{name:"@hapi/hapi",versionRange:">=17.0.0 <22.0.0",filePath:"lib/server.js"},functionQuery:{methodName:"ext",kind:"Sync"}}],NG={HAPI_ROUTE:"orchestrion:@hapi/hapi:route",HAPI_EXT:"orchestrion:@hapi/hapi:ext"},vG=fe(KT);var qT=[...["lib/redis.js","built/redis.js","built/redis/index.js"].flatMap(e=>[{channelName:"command",module:{name:"ioredis",versionRange:">=2.0.0 <5.0.0",filePath:e},functionQuery:{expressionName:"sendCommand",kind:"Async"}},{channelName:"connect",module:{name:"ioredis",versionRange:">=2.0.0 <5.0.0",filePath:e},functionQuery:{expressionName:"connect",kind:"Async"}}]),{channelName:"command",module:{name:"ioredis",versionRange:">=5.0.0 <5.11.0",filePath:"built/Redis.js"},functionQuery:{className:"Redis",methodName:"sendCommand",kind:"Async"}},{channelName:"connect",module:{name:"ioredis",versionRange:">=5.0.0 <5.11.0",filePath:"built/Redis.js"},functionQuery:{className:"Redis",methodName:"connect",kind:"Async"}}],RG={IOREDIS_COMMAND:"orchestrion:ioredis:command",IOREDIS_CONNECT:"orchestrion:ioredis:connect"},OG=fe(qT);var QT=[{channelName:"send_batch",module:{name:"kafkajs",versionRange:">=2.0.0 <3",filePath:"src/producer/messageProducer.js"},functionQuery:{expressionName:"sendBatch",kind:"Async"}},{channelName:"consumer_run",module:{name:"kafkajs",versionRange:">=2.0.0 <3",filePath:"src/consumer/index.js"},functionQuery:{expressionName:"run",kind:"Async"}}],CG={KAFKAJS_SEND_BATCH:"orchestrion:kafkajs:send_batch",KAFKAJS_CONSUMER_RUN:"orchestrion:kafkajs:consumer_run"},xG=fe(QT);var PG="knex",LJ=[{filePath:"lib/execution/runner.js",versionRange:">=0.22.0 <4"},{filePath:"lib/runner.js",versionRange:">=0.10.0 <0.22.0"},{filePath:"src/runner.js",versionRange:">=0.18.0 <0.19.0"}],MJ=[{filePath:"lib/client.js",versionRange:">=0.10.0 <4"},{filePath:"src/client.js",versionRange:">=0.18.0 <0.19.0"}],wJ=["queryBuilder","schemaBuilder","raw"];function GJ(e,t){return{channelName:"query",module:{name:PG,versionRange:t,filePath:e},functionQuery:{className:"Runner",methodName:"query",kind:"Async"}}}function UJ(e,t,n){return{channelName:e,module:{name:PG,versionRange:n,filePath:t},functionQuery:{className:"Client",methodName:e,kind:"Sync"}}}var JT=[...LJ.map(({filePath:e,versionRange:t})=>GJ(e,t)),...MJ.flatMap(({filePath:e,versionRange:t})=>wJ.map(n=>UJ(n,e,t)))],kG={KNEX_QUERY:"orchestrion:knex:query",KNEX_QUERY_BUILDER:"orchestrion:knex:queryBuilder",KNEX_SCHEMA_BUILDER:"orchestrion:knex:schemaBuilder",KNEX_RAW:"orchestrion:knex:raw"},LG=fe(JT);var $T=[{channelName:"use",module:{name:"koa",versionRange:">=2.0.0 <4",filePath:"lib/application.js"},functionQuery:{className:"Application",methodName:"use",kind:"Sync"}}],MG={KOA_USE:"orchestrion:koa:use"},wG=fe($T);var DJ=["dist/language_models/chat_models.cjs","dist/language_models/chat_models.js"].flatMap(e=>{let t={name:"@langchain/core",versionRange:">=0.1.0 <2.0.0",filePath:e};return[{channelName:"chatModelInvoke",module:t,functionQuery:{className:"BaseChatModel",methodName:"invoke",kind:"Async"}},{channelName:"chatModelStream",module:t,functionQuery:{className:"BaseChatModel",methodName:"_streamIterator",kind:"Async"}}]}),zT="embedQuery",Df="embedDocuments",GG=[{name:"@langchain/openai",versionRange:">=0.1.0 <2.0.0",methods:[zT,Df]},{name:"@langchain/google-genai",versionRange:">=0.1.0 <3.0.0",methods:[zT,Df]},{name:"@langchain/mistralai",versionRange:">=0.1.0 <2.0.0",methods:[zT,Df]},{name:"@langchain/google-common",versionRange:">=0.1.0 <3.0.0",methods:[Df]}],BJ=GG.flatMap(({name:e,versionRange:t,methods:n})=>["dist/embeddings.cjs","dist/embeddings.js"].flatMap(r=>n.map(i=>({channelName:i,module:{name:e,versionRange:t,filePath:r},functionQuery:{methodName:i,kind:"Async"}})))),eI=[...DJ,...BJ],UG=GG.flatMap(({name:e,methods:t})=>t.map(n=>`orchestrion:${e}:${n}`)),DG={LANGCHAIN_CHAT_MODEL_INVOKE:"orchestrion:@langchain/core:chatModelInvoke",LANGCHAIN_CHAT_MODEL_STREAM:"orchestrion:@langchain/core:chatModelStream"},BG=fe(eI);var HG=e=>({name:"@langchain/langgraph",versionRange:">=0.0.0 <2.0.0",filePath:e}),HJ=["dist/graph/state.cjs","dist/graph/state.js"].map(e=>({channelName:"stateGraphCompile",module:HG(e),functionQuery:{className:"StateGraph",methodName:"compile",kind:"Sync"}})),FJ=["dist/prebuilt/react_agent_executor.cjs","dist/prebuilt/react_agent_executor.js"].map(e=>({channelName:"createReactAgent",module:HG(e),functionQuery:{functionName:"createReactAgent",kind:"Sync"}})),tI=[...HJ,...FJ],FG={LANGGRAPH_STATE_GRAPH_COMPILE:"orchestrion:@langchain/langgraph:stateGraphCompile",LANGGRAPH_CREATE_REACT_AGENT:"orchestrion:@langchain/langgraph:createReactAgent"},WG=fe(tI);var nI=[{channelName:"load",module:{name:"lru-memoizer",versionRange:">=2.1.0 <4",filePath:"lib/async.js"},functionQuery:{functionName:"memoizedFunction",kind:"Callback"}}],VG={LRU_MEMOIZER_LOAD:"orchestrion:lru-memoizer:load"},YG=fe(nI);var Ss={name:"mongodb"},rI=[{channelName:"command",module:{...Ss,versionRange:">=6.4.0 <8",filePath:"lib/cmap/connection.js"},functionQuery:{methodName:"command",kind:"Async"}},{channelName:"command",module:{...Ss,versionRange:">=4.0.0 <6.4",filePath:"lib/cmap/connection.js"},functionQuery:{methodName:"command",kind:"Callback"}},{channelName:"checkout",module:{...Ss,versionRange:">=4.0.0 <6.4",filePath:"lib/cmap/connection_pool.js"},functionQuery:{methodName:"checkOut",kind:"Callback"}},...["insert","update","remove"].map(e=>({channelName:`v3_${e}`,module:{...Ss,versionRange:">=3.3.0 <4",filePath:"lib/core/wireprotocol/index.js"},functionQuery:{expressionName:e,kind:"Callback"}})),{channelName:"v3_command",module:{...Ss,versionRange:">=3.3.0 <4",filePath:"lib/core/wireprotocol/command.js"},functionQuery:{functionName:"command",kind:"Callback"}},{channelName:"v3_query",module:{...Ss,versionRange:">=3.3.0 <4",filePath:"lib/core/wireprotocol/query.js"},functionQuery:{functionName:"query",kind:"Callback"}},{channelName:"v3_get_more",module:{...Ss,versionRange:">=3.3.0 <4",filePath:"lib/core/wireprotocol/get_more.js"},functionQuery:{functionName:"getMore",kind:"Callback"}}],jG={MONGODB_COMMAND:"orchestrion:mongodb:command",MONGODB_CHECKOUT:"orchestrion:mongodb:checkout",MONGODB_V3_INSERT:"orchestrion:mongodb:v3_insert",MONGODB_V3_UPDATE:"orchestrion:mongodb:v3_update",MONGODB_V3_REMOVE:"orchestrion:mongodb:v3_remove",MONGODB_V3_COMMAND:"orchestrion:mongodb:v3_command",MONGODB_V3_QUERY:"orchestrion:mongodb:v3_query",MONGODB_V3_GET_MORE:"orchestrion:mongodb:v3_get_more"},ZG=fe(rI);var ho={name:"mongoose",versionRange:">=5.9.7 <9.7.0"},XG=["find","findOne","deleteOne","deleteMany","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace","remove","count","findOneAndRemove"],iI=[{channelName:"query_exec",module:{...ho,filePath:"lib/query.js"},functionQuery:{expressionName:"exec",kind:"Auto"}},{channelName:"aggregate_exec",module:{...ho,filePath:"lib/aggregate.js"},functionQuery:{expressionName:"exec",kind:"Auto"}},{channelName:"model_save",module:{...ho,filePath:"lib/model.js"},functionQuery:{expressionName:"save",kind:"Auto"}},{channelName:"model_insert_many",module:{...ho,filePath:"lib/model.js"},functionQuery:{expressionName:"insertMany",kind:"Auto"}},{channelName:"model_bulk_write",module:{...ho,filePath:"lib/model.js"},functionQuery:{expressionName:"bulkWrite",kind:"Auto"}},{channelName:"model_remove",module:{...ho,filePath:"lib/model.js"},functionQuery:{expressionName:"remove",kind:"Auto"}},{channelName:"model_aggregate",module:{...ho,filePath:"lib/model.js"},functionQuery:{expressionName:"aggregate",kind:"Sync"}},...XG.map(e=>({channelName:`ctx_${e}`,module:{...ho,filePath:"lib/query.js"},functionQuery:{expressionName:e,kind:"Sync"}}))],KG={MONGOOSE_QUERY_EXEC:"orchestrion:mongoose:query_exec",MONGOOSE_AGGREGATE_EXEC:"orchestrion:mongoose:aggregate_exec",MONGOOSE_MODEL_SAVE:"orchestrion:mongoose:model_save",MONGOOSE_MODEL_INSERT_MANY:"orchestrion:mongoose:model_insert_many",MONGOOSE_MODEL_BULK_WRITE:"orchestrion:mongoose:model_bulk_write",MONGOOSE_MODEL_REMOVE:"orchestrion:mongoose:model_remove",MONGOOSE_MODEL_AGGREGATE:"orchestrion:mongoose:model_aggregate"},qG=XG.map(e=>`orchestrion:mongoose:ctx_${e}`),QG=fe(iI);var oI=[{channelName:"query",module:{name:"mysql2",versionRange:">=1.4.2 <3.11.5",filePath:"lib/connection.js"},functionQuery:{className:"Connection",methodName:"query",kind:"Callback"}},{channelName:"execute",module:{name:"mysql2",versionRange:">=1.4.2 <3.11.5",filePath:"lib/connection.js"},functionQuery:{className:"Connection",methodName:"execute",kind:"Callback"}},{channelName:"query",module:{name:"mysql2",versionRange:">=3.11.5 <3.20.0",filePath:"lib/base/connection.js"},functionQuery:{className:"BaseConnection",methodName:"query",kind:"Callback"}},{channelName:"execute",module:{name:"mysql2",versionRange:">=3.11.5 <3.20.0",filePath:"lib/base/connection.js"},functionQuery:{className:"BaseConnection",methodName:"execute",kind:"Callback"}}],JG={MYSQL2_QUERY:"orchestrion:mysql2:query",MYSQL2_EXECUTE:"orchestrion:mysql2:execute"},$G=fe(oI);var sI=[{channelName:"query",module:{name:"mysql",versionRange:">=2.0.0 <3",filePath:"lib/Connection.js"},functionQuery:{expressionName:"query",kind:"Auto"}}],zG={MYSQL_QUERY:"orchestrion:mysql:query"},eU=fe(sI);var aI=[{channelName:"nestFactoryCreate",module:{name:"@nestjs/core",versionRange:">=8.0.0 <12",filePath:"nest-factory.js"},functionQuery:{className:"NestFactoryStatic",methodName:"create",kind:"Async"}},{channelName:"routerExecutionContextCreate",module:{name:"@nestjs/core",versionRange:">=8.0.0 <12",filePath:"router/router-execution-context.js"},functionQuery:{className:"RouterExecutionContext",methodName:"create",kind:"Sync"}},{channelName:"injectableDecorator",module:{name:"@nestjs/common",versionRange:">=8.0.0 <12",filePath:"decorators/core/injectable.decorator.js"},astQuery:'FunctionDeclaration[id.name="Injectable"] ReturnStatement > ArrowFunctionExpression',functionQuery:{kind:"Sync"}},{channelName:"catchDecorator",module:{name:"@nestjs/common",versionRange:">=8.0.0 <12",filePath:"decorators/core/catch.decorator.js"},astQuery:'FunctionDeclaration[id.name="Catch"] ReturnStatement > ArrowFunctionExpression',functionQuery:{kind:"Sync"}},{channelName:"cronDecorator",module:{name:"@nestjs/schedule",versionRange:">=2.0.0",filePath:"dist/decorators/cron.decorator.js"},functionQuery:{functionName:"Cron",kind:"Sync"}},{channelName:"intervalDecorator",module:{name:"@nestjs/schedule",versionRange:">=2.0.0",filePath:"dist/decorators/interval.decorator.js"},functionQuery:{functionName:"Interval",kind:"Sync"}},{channelName:"timeoutDecorator",module:{name:"@nestjs/schedule",versionRange:">=2.0.0",filePath:"dist/decorators/timeout.decorator.js"},functionQuery:{functionName:"Timeout",kind:"Sync"}},{channelName:"onEventDecorator",module:{name:"@nestjs/event-emitter",versionRange:">=2.0.0",filePath:"dist/decorators/on-event.decorator.js"},functionQuery:{expressionName:"OnEvent",kind:"Sync"}},{channelName:"processorDecorator",module:{name:"@nestjs/bullmq",versionRange:">=10.0.0",filePath:"dist/decorators/processor.decorator.js"},functionQuery:{functionName:"Processor",kind:"Sync"}}],tU={NESTJS_APP_CREATION:"orchestrion:@nestjs/core:nestFactoryCreate",NESTJS_ROUTER_CONTEXT:"orchestrion:@nestjs/core:routerExecutionContextCreate",NESTJS_INJECTABLE:"orchestrion:@nestjs/common:injectableDecorator",NESTJS_CATCH:"orchestrion:@nestjs/common:catchDecorator",NESTJS_SCHEDULE_CRON:"orchestrion:@nestjs/schedule:cronDecorator",NESTJS_SCHEDULE_INTERVAL:"orchestrion:@nestjs/schedule:intervalDecorator",NESTJS_SCHEDULE_TIMEOUT:"orchestrion:@nestjs/schedule:timeoutDecorator",NESTJS_ONEVENT:"orchestrion:@nestjs/event-emitter:onEventDecorator",NESTJS_PROCESSOR:"orchestrion:@nestjs/bullmq:processorDecorator"},nU=fe(aI);var cI=[...["resources/chat/completions/completions.js","resources/chat/completions/completions.mjs"].map(e=>({channelName:"chat",module:{name:"openai",versionRange:">=4.0.0 <8",filePath:e},functionQuery:{className:"Completions",methodName:"create",kind:"Auto"}})),...["resources/responses/responses.js","resources/responses/responses.mjs"].map(e=>({channelName:"chat",module:{name:"openai",versionRange:">=4.0.0 <8",filePath:e},functionQuery:{className:"Responses",methodName:"create",kind:"Auto"}})),...["resources/embeddings.js","resources/embeddings.mjs"].map(e=>({channelName:"embeddings",module:{name:"openai",versionRange:">=4.0.0 <8",filePath:e},functionQuery:{className:"Embeddings",methodName:"create",kind:"Auto"}})),...["resources/conversations/conversations.js","resources/conversations/conversations.mjs"].map(e=>({channelName:"chat",module:{name:"openai",versionRange:">=4.0.0 <8",filePath:e},functionQuery:{className:"Conversations",methodName:"create",kind:"Auto"}}))],rU={OPENAI_CHAT:"orchestrion:openai:chat",OPENAI_EMBEDDINGS:"orchestrion:openai:embeddings"},iU=fe(cI);var lI=[{channelName:"query",module:{name:"pg",versionRange:">=8.0.3 <9",filePath:"lib/client.js"},functionQuery:{className:"Client",methodName:"query",kind:"Auto"}},{channelName:"connect",module:{name:"pg",versionRange:">=8.0.3 <9",filePath:"lib/client.js"},functionQuery:{className:"Client",methodName:"connect",kind:"Auto"}},{channelName:"query",module:{name:"pg",versionRange:">=8.0.3 <9",filePath:"lib/native/client.js"},functionQuery:{expressionName:"query",kind:"Auto"}},{channelName:"connect",module:{name:"pg",versionRange:">=8.0.3 <9",filePath:"lib/native/client.js"},functionQuery:{expressionName:"connect",kind:"Auto"}},{channelName:"connect",module:{name:"pg-pool",versionRange:">=2.0.0 <4",filePath:"index.js"},functionQuery:{className:"Pool",methodName:"connect",kind:"Auto"}}],oU={PG_QUERY:"orchestrion:pg:query",PG_CONNECT:"orchestrion:pg:connect",PGPOOL_CONNECT:"orchestrion:pg-pool:connect"},sU=fe(lI);var WJ=e=>[{channelName:"handle",module:{name:"postgres",versionRange:">=3.0.0 <4",filePath:`${e}/query.js`},functionQuery:{className:"Query",methodName:"handle",kind:"Async"}},{channelName:"connection",module:{name:"postgres",versionRange:">=3.0.0 <4",filePath:`${e}/connection.js`},functionQuery:{functionName:"Connection",kind:"Sync"}},{channelName:"execute",module:{name:"postgres",versionRange:">=3.0.0 <4",filePath:`${e}/connection.js`},functionQuery:{functionName:"execute",kind:"Sync"}},{channelName:"connect",module:{name:"postgres",versionRange:">=3.0.0 <4",filePath:`${e}/connection.js`},functionQuery:{methodName:"connect",kind:"Sync"}}],pI=["src","cjs/src"].flatMap(WJ),aU={POSTGRESJS_HANDLE:"orchestrion:postgres:handle",POSTGRESJS_CONNECTION:"orchestrion:postgres:connection",POSTGRESJS_EXECUTE:"orchestrion:postgres:execute",POSTGRESJS_CONNECT:"orchestrion:postgres:connect"},cU=fe(pI);var uI=[{channelName:"command",module:{name:"redis",versionRange:">=2.6.0 <4",filePath:"index.js"},functionQuery:{expressionName:"internal_send_command",kind:"Sync"}},{channelName:"executor",module:{name:"@redis/client",versionRange:"^1.0.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"commandsExecutor",kind:"Async"}},{channelName:"command",module:{name:"@redis/client",versionRange:"^1.0.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"sendCommand",kind:"Async"}},{channelName:"connect",module:{name:"@redis/client",versionRange:"^1.0.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"connect",kind:"Async"}},{channelName:"command",module:{name:"@redis/client",versionRange:">=5.0.0 <5.12.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"sendCommand",kind:"Async"}},{channelName:"connect",module:{name:"@redis/client",versionRange:">=5.0.0 <5.12.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"connect",kind:"Async"}},{channelName:"multi",module:{name:"@redis/client",versionRange:">=5.0.0 <5.12.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"_executeMulti",kind:"Async"}},{channelName:"pipeline",module:{name:"@redis/client",versionRange:">=5.0.0 <5.12.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"_executePipeline",kind:"Async"}},{channelName:"batch",module:{name:"@redis/client",versionRange:"^1.0.0",filePath:"dist/lib/client/index.js"},functionQuery:{className:"RedisClient",methodName:"multiExecutor",kind:"Async"}}],lU={REDIS_COMMAND:"orchestrion:redis:command",NODE_REDIS_COMMAND:"orchestrion:@redis/client:command",NODE_REDIS_EXECUTOR:"orchestrion:@redis/client:executor",NODE_REDIS_CONNECT:"orchestrion:@redis/client:connect",NODE_REDIS_MULTI:"orchestrion:@redis/client:multi",NODE_REDIS_PIPELINE:"orchestrion:@redis/client:pipeline",NODE_REDIS_BATCH:"orchestrion:@redis/client:batch"},pU=fe(uI);var VJ=e=>[{channelName:"requestHandler",module:{name:"@remix-run/server-runtime",versionRange:">=2.0.0 <3",filePath:`${e}/server.js`},astQuery:'FunctionExpression[id.name="requestHandler"]',functionQuery:{kind:"Async"}},{channelName:"matchServerRoutes",module:{name:"@remix-run/server-runtime",versionRange:">=2.0.0 <3",filePath:`${e}/routeMatching.js`},functionQuery:{functionName:"matchServerRoutes",kind:"Sync"}},{channelName:"callRouteLoader",module:{name:"@remix-run/server-runtime",versionRange:">=2.9.0 <3",filePath:`${e}/data.js`},functionQuery:{functionName:"callRouteLoader",kind:"Async"}},{channelName:"callRouteAction",module:{name:"@remix-run/server-runtime",versionRange:">=2.9.0 <3",filePath:`${e}/data.js`},functionQuery:{functionName:"callRouteAction",kind:"Async"}},{channelName:"callRouteLoader",module:{name:"@remix-run/server-runtime",versionRange:">=2.0.0 <2.9.0",filePath:`${e}/data.js`},functionQuery:{functionName:"callRouteLoaderRR",kind:"Async"}},{channelName:"callRouteAction",module:{name:"@remix-run/server-runtime",versionRange:">=2.0.0 <2.9.0",filePath:`${e}/data.js`},functionQuery:{functionName:"callRouteActionRR",kind:"Async"}}],dI=["dist","dist/esm"].flatMap(VJ),uU={REMIX_REQUEST_HANDLER:"orchestrion:@remix-run/server-runtime:requestHandler",REMIX_MATCH_SERVER_ROUTES:"orchestrion:@remix-run/server-runtime:matchServerRoutes",REMIX_CALL_ROUTE_LOADER:"orchestrion:@remix-run/server-runtime:callRouteLoader",REMIX_CALL_ROUTE_ACTION:"orchestrion:@remix-run/server-runtime:callRouteAction"},dU=fe(dI);var YJ="tedious",jJ="lib/connection.js",ZJ=">=1.11.0 <20",XJ=["connect","execSql","execSqlBatch","callProcedure","execBulkLoad","prepare","execute"],mI=XJ.map(e=>({channelName:e,module:{name:YJ,versionRange:ZJ,filePath:jJ},functionQuery:{className:"Connection",methodName:e,kind:"Sync"}})),mU={TEDIOUS_CONNECT:"orchestrion:tedious:connect",TEDIOUS_EXEC_SQL:"orchestrion:tedious:execSql",TEDIOUS_EXEC_SQL_BATCH:"orchestrion:tedious:execSqlBatch",TEDIOUS_CALL_PROCEDURE:"orchestrion:tedious:callProcedure",TEDIOUS_EXEC_BULK_LOAD:"orchestrion:tedious:execBulkLoad",TEDIOUS_PREPARE:"orchestrion:tedious:prepare",TEDIOUS_EXECUTE:"orchestrion:tedious:execute"},fU=fe(mI);var fI=[...Es(">=4.0.0 <7.0.0","generateText","generateText","Async"),...Es(">=4.0.0 <7.0.0","streamText","streamText","Sync"),...Es(">=4.0.0 <7.0.0","generateObject","generateObject","Async"),...Es(">=4.0.0 <7.0.0","embed","embed","Async"),...Es(">=4.0.0 <7.0.0","embedMany","embedMany","Async"),...Es(">=5.0.0 <7.0.0","resolveLanguageModel","resolveLanguageModel","Sync"),...Es(">=6.0.0 <7.0.0","executeToolCall","executeToolCall","Async")],gU={VERCEL_AI_GENERATE_TEXT:"orchestrion:ai:generateText",VERCEL_AI_STREAM_TEXT:"orchestrion:ai:streamText",VERCEL_AI_GENERATE_OBJECT:"orchestrion:ai:generateObject",VERCEL_AI_EMBED:"orchestrion:ai:embed",VERCEL_AI_EMBED_MANY:"orchestrion:ai:embedMany",VERCEL_AI_EXECUTE_TOOL_CALL:"orchestrion:ai:executeToolCall",VERCEL_AI_RESOLVE_LANGUAGE_MODEL:"orchestrion:ai:resolveLanguageModel"};function Es(e,t,n,r){return["dist/index.js","dist/index.mjs"].map(i=>({channelName:t,module:{name:"ai",versionRange:e,filePath:i},functionQuery:{functionName:n,kind:r}}))}var _U=fe(fI);var A={...aG,...lG,...uG,...mG,...gG,...hG,...yG,...EG,...IG,...NG,...RG,...CG,...kG,...MG,...DG,...FG,...VG,...jG,...KG,...JG,...zG,...tU,...rU,...oU,...aU,...lU,...uU,...mU,...gU};var KJ="Amqplib",qJ="auto.amqplib.orchestrion.publisher",QJ="auto.amqplib.orchestrion.consumer",JJ="messaging.operation",NU="messaging.destination",vU="messaging.destination_kind",RU="messaging.rabbitmq.routing_key",hU="messaging.protocol",$J="messaging.protocol_version",zJ="messaging.url",OU="messaging.message_id",CU="messaging.conversation_id",xU="messaging.rabbitmq.destination.routing_key",PU="messaging.message.conversation_id",kU="topic",bU="process",e$="send",LU=1e3*60,Xn={Ack:"ack",AckAll:"ackAll",Reject:"reject",Nack:"nack",NackAll:"nackAll",ChannelClosed:"channel closed",ChannelError:"channel error",InstrumentationTimeout:"instrumentation timeout"},_I=Symbol("sentry.amqplib.message.stored-span"),Ts=Symbol("sentry.amqplib.channel.spans-not-ended"),hI=Symbol("sentry.amqplib.channel.consume-timeout-timer"),yI=Symbol("sentry.amqplib.channel.consumer-info"),bI=Symbol("sentry.amqplib.channel.is-confirm-publishing"),MU=Symbol("sentry.amqplib.connection.attributes"),wU=()=>{},yU=!1,t$=(()=>({name:KJ,setupOnce(){!Zn.tracingChannel||yU||(yU=!0,$&&g.log("[orchestrion:amqplib] subscribing to amqplib tracing channels"),ue(()=>{a$(),n$(),r$(),i$(),o$(),s$()}))}}));function n$(){ee(Zn.tracingChannel(A.AMQPLIB_PUBLISH),e=>{if(!e.self?.[bI])return UU(e)})}function r$(){let e=Zn.tracingChannel(A.AMQPLIB_CONFIRM_PUBLISH);ee(e,t=>(t.self&&(t.self[bI]=!0),UU(t))),e.end.subscribe(t=>{let n=t.self;n&&(n[bI]=!1)})}function i$(){let e=Zn.tracingChannel(A.AMQPLIB_CONSUME);e.start.subscribe(wU),e.asyncEnd.subscribe(t=>{let n=t,r=n.self,o=n.result?.consumerTag;if(!r||!o)return;GU(r);let s=n.arguments[0],c=typeof s=="string"?s:"<unknown>",a=n.arguments[2];r[yI]?.set(o,{noAck:!!a?.noAck,queue:c})})}function o$(){ee(Zn.tracingChannel(A.AMQPLIB_DISPATCH),e=>{let t=e.self,n=e.arguments[0],r=e.arguments[1];if(!t||!r)return;GU(t);let i=n?.consumerTag?t[yI]?.get(n.consumerTag):void 0,o=i?.queue??r.fields?.routingKey??"<unknown>",s=i?.noAck??!1,c=r.properties?.headers,a=AU(c,"sentry-trace"),l=AU(c,"baggage"),p=An({sentryTrace:a,baggage:l},()=>l$(o,r,t));return s||(t[Ts]?.push({msg:r,timeOfConsume:lt()}),r[_I]=p),e._sentryNoAck=s,p},{deferSpanEnd({data:e}){return!e._sentryNoAck}})}function s$(){Zn.tracingChannel(A.AMQPLIB_ACK).start.subscribe(e=>gI(e,!1,Xn.Ack)),Zn.tracingChannel(A.AMQPLIB_NACK).start.subscribe(e=>gI(e,!0,Xn.Nack)),Zn.tracingChannel(A.AMQPLIB_REJECT).start.subscribe(e=>gI(e,!0,Xn.Reject)),Zn.tracingChannel(A.AMQPLIB_ACK_ALL).start.subscribe(e=>{let t=e;t.self&&Bf(t.self,!1,Xn.AckAll,void 0)}),Zn.tracingChannel(A.AMQPLIB_NACK_ALL).start.subscribe(e=>{let t=e;t.self&&Bf(t.self,!0,Xn.NackAll,t.arguments[0])})}function a$(){let e=Zn.tracingChannel(A.AMQPLIB_CONNECT);e.start.subscribe(wU),e.asyncEnd.subscribe(t=>{let n=t,r=n.result;!r||typeof r!="object"||(r[MU]={...u$(n.arguments?.[0]),...p$(r)})})}function gI(e,t,n){let r=e.self;if(!r)return;let i=e.arguments[0];if(!i)return;let o=e.arguments[1],s=e.arguments[2],c=n===Xn.Reject?o:s,a=r[Ts]??[],l=a.findIndex(p=>p.msg===i);if(l<0)Tp(i,t,n,c);else if(n!==Xn.Reject&&o){for(let p=0;p<=l;p++)Tp(a[p].msg,t,n,c);a.splice(0,l+1)}else Tp(i,t,n,c),a.splice(l,1)}function GU(e){if(Object.prototype.hasOwnProperty.call(e,Ts))return;e[Ts]=[],e[yI]=new Map;let t=setInterval(()=>c$(e),LU);t.unref?.(),e[hI]=t,typeof e.on=="function"&&(e.on("close",()=>{Bf(e,!0,Xn.ChannelClosed,void 0),SU(e)}),e.on("error",()=>{Bf(e,!0,Xn.ChannelError,void 0),SU(e)}))}function SU(e){let t=e[hI];t&&(clearInterval(t),e[hI]=void 0)}function c$(e){let t=lt(),n=e[Ts]??[],r;for(r=0;r<n.length;r++){let i=n[r];if((t-i.timeOfConsume)*1e3<LU)break;Tp(i.msg,null,Xn.InstrumentationTimeout,!0)}n.splice(0,r)}function Bf(e,t,n,r){(e[Ts]??[]).forEach(o=>{Tp(o.msg,t,n,r)}),e[Ts]=[]}function Tp(e,t,n,r){let i=e[_I];i&&(t!==!1&&i.setStatus({code:2,message:n!==Xn.ChannelClosed&&n!==Xn.ChannelError?`${n} called on message${r===!0?" with requeue":r===!1?" without requeue":""}`:n}),i.end(),e[_I]=void 0)}function UU(e){let t=e.arguments[0],n=e.arguments[1],r=typeof t=="string"?t:"",i=typeof n=="string"?n:"",o=e.arguments[3],s=k({name:`publish ${d$(r)}`,op:"message",kind:U.PRODUCER,attributes:{...DU(e.self),[NU]:r,[Rn]:r,[vU]:kU,[RU]:i,[xU]:i,[cr]:e$,[OU]:o?.messageId,[ta]:o?.messageId,[CU]:o?.correlationId,[PU]:o?.correlationId,[S]:qJ}});(!o||typeof o!="object")&&(o={},e.arguments[3]=o);let c=o.headers&&typeof o.headers=="object"?o.headers:o.headers={},a=$e({span:s});return a["sentry-trace"]&&(c["sentry-trace"]=a["sentry-trace"]),a.baggage&&(c.baggage=a.baggage),s}function l$(e,t,n){return k({name:`${e} process`,op:"message",kind:U.CONSUMER,attributes:{...DU(n),[NU]:t.fields?.exchange,[Rn]:t.fields?.exchange,[vU]:kU,[RU]:t.fields?.routingKey,[xU]:t.fields?.routingKey,[JJ]:bU,[cr]:bU,[OU]:t.properties?.messageId,[ta]:t.properties?.messageId,[CU]:t.properties?.correlationId,[PU]:t.properties?.correlationId,[S]:QJ}})}function DU(e){let t=e?.connection,n=t?.[MU];if(n)return n;let r=t?.serverProperties?.product??t?.connection?.serverProperties?.product;return typeof r=="string"&&r?{[wt]:r.toLowerCase()}:{}}function p$(e){let t=e.serverProperties?.product??e.connection?.serverProperties?.product;return typeof t=="string"&&t?{[wt]:t.toLowerCase()}:{}}function u$(e){let t={[$J]:"0.9.1",[n0]:"0.9.1"},n=e||"amqp://localhost";if(typeof n=="object"){let r=n,i=TU(r.protocol),o=IU(r.hostname),s=EU(r.port,i);t[hU]=i,t[vh]=i,t[_t]=o,t[ht]=s,t[Le]=o,t[xe]=s}else if(typeof n=="string"){let r=m$(n);t[zJ]=r,t[pt]=r;try{let i=new URL(r),o=TU(i.protocol),s=IU(i.hostname),c=EU(i.port?parseInt(i.port,10):void 0,o);t[hU]=o,t[vh]=o,t[_t]=s,t[ht]=c,t[Le]=s,t[xe]=c}catch{}}return t}function d$(e){return e!==""?e:"<default>"}function m$(e){return e.replace(/:[^:@/]*@/,":***@")}function EU(e,t){return e||(t==="AMQP"?5672:5671)}function TU(e){let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()}function IU(e){return e||"localhost"}function AU(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?String(n[0]):String(n)}var BU=t$;import*as SI from"diagnostics_channel";var FU="Anthropic_AI",f$="auto.ai.orchestrion.anthropic",g$=[{channel:A.ANTHROPIC_CHAT,operation:"chat",methodPath:"messages.create",stream:"async-iterable"},{channel:A.ANTHROPIC_MODELS,operation:"models",methodPath:"models.retrieve",stream:"none"},{channel:A.ANTHROPIC_MESSAGES_STREAM,operation:"chat",methodPath:"messages.stream",stream:"message-stream"}],HU=!1,_$=((e={})=>({name:FU,setupOnce(){!SI.tracingChannel||HU||(HU=!0,ue(()=>{for(let{channel:t,operation:n,methodPath:r,stream:i}of g$)$&&g.log(`[orchestrion:anthropic] subscribing to channel "${t}"`),ee(SI.tracingChannel(t),o=>h$(o,n,r,e),{beforeSpanEnd:(o,s)=>{fd(o,s.result,Ze(e).recordOutputs)},deferSpanEnd:({span:o,data:s})=>S$(o,s,i,e)})}))}}));function h$(e,t,n,r){let i=e.arguments??[];if(Cn(FU)||i[1]?.headers?.["X-Stainless-Helper-Method"]==="stream")return;let s=typeof i[0]=="object"&&i[0]!==null?i[0]:void 0,{recordInputs:c}=Ze(r),a=ze(r.enableTruncation),l=md(i,n,t),p=l[De]||"unknown";l[S]=f$;let u=k({name:`${t} ${p}`,op:`gen_ai.${t}`,attributes:l});return c&&s&&Sa(u,s,a),u}function b$(e){return!!e&&typeof e[Symbol.asyncIterator]=="function"}function y$(e){return!!e&&typeof e.on=="function"}function S$(e,t,n,r){let{recordOutputs:i}=Ze(r),o=t.result;if(n==="async-iterable"&&b$(o)){let s=o[Symbol.asyncIterator].bind(o),c=fl({[Symbol.asyncIterator]:s},e,i);return o[Symbol.asyncIterator]=()=>c,!0}return n==="message-stream"&&y$(o)?(gl(o,e,i),!0):!1}var WU=_$;import*as RI from"diagnostics_channel";var VU="auto.aws.orchestrion.aws_sdk",YU="dynamodb",jU="messaging.destination_kind",ZU="topic",EI="chat",TI="aws.bedrock";var E$=new TextDecoder,Hf=class{requestPreSpanHook(t){switch(t.commandName){case"Converse":return this._requestPreSpanHookConverse(t,!1);case"ConverseStream":return this._requestPreSpanHookConverse(t,!0);case"InvokeModel":return this._requestPreSpanHookInvokeModel(t,!1);case"InvokeModelWithResponseStream":return this._requestPreSpanHookInvokeModel(t,!0)}return{}}responseHook(t,n){let r=t.request.commandName;if(!n.isRecording()){(r==="ConverseStream"||r==="InvokeModelWithResponseStream")&&n.end();return}switch(r){case"Converse":return this._responseHookConverse(t,n);case"ConverseStream":return this._responseHookConverseStream(t,n);case"InvokeModel":return this._responseHookInvokeModel(t,n);case"InvokeModelWithResponseStream":return this._responseHookInvokeModelWithResponseStream(t,n)}}_requestPreSpanHookConverse(t,n){let r=EI,i={[Yc]:TI,[Eu]:EI},o=t.commandInput.modelId;o&&(i[Vc]=o,r&&(r+=` ${o}`));let s=t.commandInput.inferenceConfig;if(s){let{maxTokens:c,temperature:a,topP:l,stopSequences:p}=s;c!==void 0&&(i[gi]=c),a!==void 0&&(i[_i]=a),l!==void 0&&(i[hi]=l),p!==void 0&&(i[ji]=p)}return{spanName:r,isStream:n,spanAttributes:i}}_requestPreSpanHookInvokeModel(t,n){let r={[Yc]:TI},i=t.commandInput?.modelId;if(i&&(r[Vc]=i),t.commandInput?.body){let o=JSON.parse(t.commandInput.body);i.includes("amazon.titan")?(o.textGenerationConfig?.temperature!==void 0&&(r[_i]=o.textGenerationConfig.temperature),o.textGenerationConfig?.topP!==void 0&&(r[hi]=o.textGenerationConfig.topP),o.textGenerationConfig?.maxTokenCount!==void 0&&(r[gi]=o.textGenerationConfig.maxTokenCount),o.textGenerationConfig?.stopSequences!==void 0&&(r[ji]=o.textGenerationConfig.stopSequences)):i.includes("amazon.nova")?(o.inferenceConfig?.temperature!==void 0&&(r[_i]=o.inferenceConfig.temperature),o.inferenceConfig?.top_p!==void 0&&(r[hi]=o.inferenceConfig.top_p),o.inferenceConfig?.max_new_tokens!==void 0&&(r[gi]=o.inferenceConfig.max_new_tokens),o.inferenceConfig?.stopSequences!==void 0&&(r[ji]=o.inferenceConfig.stopSequences)):i.includes("anthropic.claude")?(o.max_tokens!==void 0&&(r[gi]=o.max_tokens),o.temperature!==void 0&&(r[_i]=o.temperature),o.top_p!==void 0&&(r[hi]=o.top_p),o.stop_sequences!==void 0&&(r[ji]=o.stop_sequences)):i.includes("meta.llama")?(o.max_gen_len!==void 0&&(r[gi]=o.max_gen_len),o.temperature!==void 0&&(r[_i]=o.temperature),o.top_p!==void 0&&(r[hi]=o.top_p)):i.includes("cohere.command-r")?(o.max_tokens!==void 0&&(r[gi]=o.max_tokens),o.temperature!==void 0&&(r[_i]=o.temperature),o.p!==void 0&&(r[hi]=o.p),o.message!==void 0&&(r[Jt]=Math.ceil(o.message.length/6)),o.stop_sequences!==void 0&&(r[ji]=o.stop_sequences)):i.includes("cohere.command")?(o.max_tokens!==void 0&&(r[gi]=o.max_tokens),o.temperature!==void 0&&(r[_i]=o.temperature),o.p!==void 0&&(r[hi]=o.p),o.prompt!==void 0&&(r[Jt]=Math.ceil(o.prompt.length/6)),o.stop_sequences!==void 0&&(r[ji]=o.stop_sequences)):i.includes("mistral")&&(o.prompt!==void 0&&(r[Jt]=Math.ceil(o.prompt.length/6)),o.max_tokens!==void 0&&(r[gi]=o.max_tokens),o.temperature!==void 0&&(r[_i]=o.temperature),o.top_p!==void 0&&(r[hi]=o.top_p),o.stop!==void 0&&(r[ji]=o.stop))}return{isStream:n,spanAttributes:r}}_responseHookConverse(t,n){let{stopReason:r,usage:i}=t.data;XU(n,r),KU(n,i)}_responseHookConverseStream(t,n){t.data.stream=I$(t.data.stream,n)}_responseHookInvokeModel(t,n){let r=t.request.commandInput?.modelId;if(t.data?.body){let i=E$.decode(t.data.body),o=JSON.parse(i);r.includes("amazon.titan")?(o.inputTextTokenCount!==void 0&&n.setAttribute(Jt,o.inputTextTokenCount),o.results?.[0]?.tokenCount!==void 0&&n.setAttribute(Tt,o.results[0].tokenCount),o.results?.[0]?.completionReason!==void 0&&n.setAttribute(Ot,[o.results[0].completionReason])):r.includes("amazon.nova")?(o.usage!==void 0&&(o.usage.inputTokens!==void 0&&n.setAttribute(Jt,o.usage.inputTokens),o.usage.outputTokens!==void 0&&n.setAttribute(Tt,o.usage.outputTokens)),o.stopReason!==void 0&&n.setAttribute(Ot,[o.stopReason])):r.includes("anthropic.claude")?(o.usage?.input_tokens!==void 0&&n.setAttribute(Jt,o.usage.input_tokens),o.usage?.output_tokens!==void 0&&n.setAttribute(Tt,o.usage.output_tokens),o.stop_reason!==void 0&&n.setAttribute(Ot,[o.stop_reason])):r.includes("meta.llama")?(o.prompt_token_count!==void 0&&n.setAttribute(Jt,o.prompt_token_count),o.generation_token_count!==void 0&&n.setAttribute(Tt,o.generation_token_count),o.stop_reason!==void 0&&n.setAttribute(Ot,[o.stop_reason])):r.includes("cohere.command-r")?(o.text!==void 0&&n.setAttribute(Tt,Math.ceil(o.text.length/6)),o.finish_reason!==void 0&&n.setAttribute(Ot,[o.finish_reason])):r.includes("cohere.command")?(o.generations?.[0]?.text!==void 0&&n.setAttribute(Tt,Math.ceil(o.generations[0].text.length/6)),o.generations?.[0]?.finish_reason!==void 0&&n.setAttribute(Ot,[o.generations[0].finish_reason])):r.includes("mistral")&&(o.outputs?.[0]?.text!==void 0&&n.setAttribute(Tt,Math.ceil(o.outputs[0].text.length/6)),o.outputs?.[0]?.stop_reason!==void 0&&n.setAttribute(Ot,[o.outputs[0].stop_reason]))}}_responseHookInvokeModelWithResponseStream(t,n){let r=t.data?.body,i=t.request.commandInput?.modelId;if(!r||!i)return;let o=T$(i);t.data.body=(async function*(){try{for await(let s of r){if(o){let c=A$(s?.chunk?.bytes);c&&o(c,n)}yield s}}finally{n.end()}})()}};function T$(e){if(e.includes("amazon.titan"))return R$;if(e.includes("anthropic.claude"))return v$;if(e.includes("amazon.nova"))return N$;if(e.includes("meta.llama"))return O$;if(e.includes("cohere.command-r"))return P$;if(e.includes("cohere.command"))return x$;if(e.includes("mistral"))return C$}async function*I$(e,t){try{let n;for await(let r of e)XU(t,r.messageStop?.stopReason),n=r.metadata?.usage,yield r;KU(t,n)}finally{t.end()}}function XU(e,t){t!==void 0&&e.setAttribute(Ot,[t])}function KU(e,t){if(t){let{inputTokens:n,outputTokens:r}=t;n!==void 0&&e.setAttribute(Jt,n),r!==void 0&&e.setAttribute(Tt,r)}}function A$(e){if(!e||!(e instanceof Uint8Array))return null;try{let t=Buffer.from(e).toString("utf-8");return JSON.parse(t)}catch(t){return $&&g.warn("[orchestrion:aws-sdk] failed to parse streamed bedrock chunk",t),null}}function N$(e,t){e.metadata?.usage!==void 0&&(e.metadata?.usage.inputTokens!==void 0&&t.setAttribute(Jt,e.metadata.usage.inputTokens),e.metadata?.usage.outputTokens!==void 0&&t.setAttribute(Tt,e.metadata.usage.outputTokens)),e.messageStop?.stopReason!==void 0&&t.setAttribute(Ot,[e.messageStop.stopReason])}function v$(e,t){e.message?.usage?.input_tokens!==void 0&&t.setAttribute(Jt,e.message.usage.input_tokens),e.message?.usage?.output_tokens!==void 0&&t.setAttribute(Tt,e.message.usage.output_tokens),e.delta?.stop_reason!==void 0&&t.setAttribute(Ot,[e.delta.stop_reason])}function R$(e,t){e.inputTextTokenCount!==void 0&&t.setAttribute(Jt,e.inputTextTokenCount),e.totalOutputTextTokenCount!==void 0&&t.setAttribute(Tt,e.totalOutputTextTokenCount),e.completionReason!==void 0&&t.setAttribute(Ot,[e.completionReason])}function O$(e,t){e.prompt_token_count!==void 0&&t.setAttribute(Jt,e.prompt_token_count),e.generation_token_count!==void 0&&t.setAttribute(Tt,e.generation_token_count),e.stop_reason!==void 0&&t.setAttribute(Ot,[e.stop_reason])}function C$(e,t){e.outputs?.[0]?.text!==void 0&&t.setAttribute(Tt,Math.ceil(e.outputs[0].text.length/6)),e.outputs?.[0]?.stop_reason!==void 0&&t.setAttribute(Ot,[e.outputs[0].stop_reason])}function x$(e,t){e.generations?.[0]?.text!==void 0&&t.setAttribute(Tt,Math.ceil(e.generations[0].text.length/6)),e.generations?.[0]?.finish_reason!==void 0&&t.setAttribute(Ot,[e.generations[0].finish_reason])}function P$(e,t){e.text!==void 0&&t.setAttribute(Tt,Math.ceil(e.text.length/6)),e.finish_reason!==void 0&&t.setAttribute(Ot,[e.finish_reason])}function ic(e){return Array.isArray(e)?e:[e]}var Ff=class{requestPreSpanHook(t){let n=t.commandName,r=t.commandInput?.TableName,i={};return i[Pe]=YU,i[Et]=r,i[Js]=n,t.commandInput?.TableName?i[Sh]=[t.commandInput.TableName]:t.commandInput?.RequestItems&&(i[Sh]=Object.keys(t.commandInput.RequestItems)),(n==="CreateTable"||n==="UpdateTable")&&t.commandInput?.ProvisionedThroughput&&(i[yR]=t.commandInput.ProvisionedThroughput.ReadCapacityUnits,i[SR]=t.commandInput.ProvisionedThroughput.WriteCapacityUnits),(n==="GetItem"||n==="Scan"||n==="Query")&&t.commandInput?.ConsistentRead&&(i[lR]=t.commandInput.ConsistentRead),(n==="Query"||n==="Scan")&&t.commandInput?.ProjectionExpression&&(i[bR]=t.commandInput.ProjectionExpression),n==="CreateTable"&&(t.commandInput?.GlobalSecondaryIndexes&&(i[mR]=ic(t.commandInput.GlobalSecondaryIndexes).map(o=>JSON.stringify(o))),t.commandInput?.LocalSecondaryIndexes&&(i[hR]=ic(t.commandInput.LocalSecondaryIndexes).map(o=>JSON.stringify(o)))),(n==="ListTables"||n==="Query"||n==="Scan")&&t.commandInput?.Limit&&(i[_R]=t.commandInput.Limit),n==="ListTables"&&t.commandInput?.ExclusiveStartTableName&&(i[dR]=t.commandInput.ExclusiveStartTableName),n==="Query"&&(t.commandInput?.ScanIndexForward&&(i[TR]=t.commandInput.ScanIndexForward),t.commandInput?.IndexName&&(i[bh]=t.commandInput.IndexName),t.commandInput?.Select&&(i[yh]=t.commandInput.Select)),n==="Scan"&&(t.commandInput?.Segment&&(i[IR]=t.commandInput?.Segment),t.commandInput?.TotalSegments&&(i[NR]=t.commandInput?.TotalSegments),t.commandInput?.IndexName&&(i[bh]=t.commandInput.IndexName),t.commandInput?.Select&&(i[yh]=t.commandInput.Select)),n==="UpdateTable"&&(t.commandInput?.AttributeDefinitions&&(i[cR]=ic(t.commandInput.AttributeDefinitions).map(o=>JSON.stringify(o))),t.commandInput?.GlobalSecondaryIndexUpdates&&(i[fR]=ic(t.commandInput.GlobalSecondaryIndexUpdates).map(o=>JSON.stringify(o)))),{spanAttributes:i,spanKind:U.CLIENT,spanOp:"db"}}responseHook(t,n){t.data?.ConsumedCapacity&&n.setAttribute(pR,ic(t.data.ConsumedCapacity).map(r=>JSON.stringify(r))),t.data?.ItemCollectionMetrics&&n.setAttribute(gR,ic(t.data.ItemCollectionMetrics).map(r=>JSON.stringify(r))),t.data?.TableNames&&n.setAttribute(AR,t.data?.TableNames.length),t.data?.Count&&n.setAttribute(uR,t.data?.Count),t.data?.ScannedCount&&n.setAttribute(ER,t.data?.ScannedCount)}};var Wf=class{requestPreSpanHook(t){let n=t.commandInput?.StreamName,r={};return n&&(r[vR]=n),{spanAttributes:r,spanKind:U.CLIENT}}};var Vf="Invoke",Yf=class{requestPreSpanHook(t){let n=t.commandInput?.FunctionName,r={},i;return t.commandName===Vf&&(r[LR]=n,r[MR]="aws",i=`${n} ${Vf}`),{spanAttributes:r,spanKind:U.CLIENT,spanName:i}}requestPostSpanHook(t,n){t.commandName===Vf&&t.commandInput&&(t.commandInput.ClientContext=k$(t.commandInput.ClientContext,n))}responseHook(t,n){t.request.commandName===Vf&&(n.setAttribute(kR,t.requestId),t.request.region&&n.setAttribute(wR,t.request.region))}};function k$(e,t){try{let n=$e({span:t}),r=e?JSON.parse(Buffer.from(e,"base64").toString("utf8")):{},i={...r,custom:{...r.custom,...n}},o=Buffer.from(JSON.stringify(i)).toString("base64");return o.length>3583?($&&g.warn("[orchestrion:aws-sdk] cannot set trace propagation on lambda invoke parameters due to ClientContext length limitations."),e):o}catch(n){return $&&g.log("[orchestrion:aws-sdk] failed to set trace propagation on lambda ClientContext",n),e}}var jf=class{requestPreSpanHook(t){let n=t.commandInput?.Bucket,r={};return n&&(r[CR]=n),{spanAttributes:r,spanKind:U.CLIENT}}};var Zf=class{requestPreSpanHook(t){let n=t.commandInput?.SecretId,r={};return typeof n=="string"&&n.startsWith("arn:aws:secretsmanager:")&&(r[Eh]=n),{spanAttributes:r,spanKind:U.CLIENT}}responseHook(t,n){let r=t.data?.ARN;r&&n.setAttribute(Eh,r)}};var L$=10,II="sentry-trace",AI="baggage",M$=[II,AI];function Ip(e,t){let n=e??{},r=Object.keys(t);if(Object.keys(n).length+r.length<=L$)for(let i of r){let o=t[i];o&&(n[i]={DataType:"String",StringValue:o})}else $&&g.warn("[orchestrion:aws-sdk] cannot set trace propagation on SQS/SNS message due to maximum amount of MessageAttributes");return n}function qU(e){let t=e.MessageAttributes??{},n=t[II]?.StringValue??t[II]?.Value;if(n)return{sentryTrace:n,baggage:t[AI]?.StringValue??t[AI]?.Value}}function QU(e=[]){return tl([...e,...M$])}var Xf=class{requestPreSpanHook(t){let n=U.CLIENT,r=`SNS ${t.commandName}`,i={[wt]:"aws.sns"};if(t.commandName==="Publish"){n=U.PRODUCER,i[jU]=ZU;let{TopicArn:s,TargetArn:c,PhoneNumber:a}=t.commandInput,l=w$(s,c,a);i[zR]=l,i[Rn]=s||c||a||"unknown",r=`${a?"phone_number":l} send`}let o=t.commandInput?.TopicArn;return o&&(i[Th]=o),{spanAttributes:i,spanKind:n,spanName:r}}requestPostSpanHook(t,n){if(t.commandName==="Publish"){let r=t.commandInput.MessageAttributes??{};t.commandInput.MessageAttributes=Ip(r,$e({span:n}))}}responseHook(t,n){let r=t.data?.TopicArn;r&&n.setAttribute(Th,r)}};function w$(e,t,n){if(e||t){let r=e??t;try{return r.substring(r.lastIndexOf(":")+1)}catch{return r}}else return n||"unknown"}var Kf=class{requestPreSpanHook(t){let n=U$(t.commandInput),r=D$(n),i=U.CLIENT,o,s={[wt]:"aws_sqs",[Rn]:r,[pt]:n};switch(t.commandName){case"ReceiveMessage":i=U.CONSUMER,o=`${r} receive`,s[cr]="receive",t.commandInput.MessageAttributeNames=QU(t.commandInput.MessageAttributeNames);break;case"SendMessage":case"SendMessageBatch":i=U.PRODUCER,o=`${r} send`;break}return{spanAttributes:s,spanKind:i,spanName:o}}requestPostSpanHook(t,n){switch(t.commandName){case"SendMessage":{let r=t.commandInput.MessageAttributes??{};t.commandInput.MessageAttributes=Ip(r,$e({span:n}))}break;case"SendMessageBatch":{let r=t.commandInput?.Entries;if(Array.isArray(r)){let i=$e({span:n});r.forEach(o=>{o.MessageAttributes=Ip(o.MessageAttributes??{},i)})}}break}}responseHook(t,n){switch(t.request.commandName){case"SendMessage":n.setAttribute(ta,t?.data?.MessageId);break;case"SendMessageBatch":break;case"ReceiveMessage":{let r=t?.data?.Messages||[];n.setAttribute(ea,r.length);for(let i of r)G$(n,i);break}}}};function G$(e,t){let n=qU(t);if(!n)return;let{parentSpanId:r,traceId:i,sampled:o}=In(n.sentryTrace,n.baggage);i&&r&&e.addLink({context:{traceId:i,spanId:r,traceFlags:o?1:0},attributes:{[ta]:t.MessageId}})}function U$(e){return e?.QueueUrl}function D$(e){if(!e)return;let t=e.split("/");if(t.length!==0)return t[t.length-1]}var qf=class{requestPreSpanHook(t){let n=t.commandInput?.stateMachineArn,r=t.commandInput?.activityArn,i={};return n&&(i[PR]=n),r&&(i[xR]=r),{spanAttributes:i,spanKind:U.CLIENT}}};var Qf=class{constructor(){this._services=new Map([["SecretsManager",new Zf],["SFN",new qf],["SQS",new Kf],["SNS",new Xf],["DynamoDB",new Ff],["Lambda",new Yf],["S3",new jf],["Kinesis",new Wf],["BedrockRuntime",new Hf]])}requestPreSpanHook(t){let n=this._services.get(t.serviceName);return n?n.requestPreSpanHook(t):{}}requestPostSpanHook(t,n){this._services.get(t.serviceName)?.requestPostSpanHook?.(t,n)}responseHook(t,n){this._services.get(t.request.serviceName)?.responseHook?.(t,n)}};function NI(e,t){let n=t.length;return e?.slice(-n)===t?e.slice(0,-n):e}function JU(e,t,n,r){return{serviceName:e?.replace(/\s+/g,""),commandName:NI(t,"Command"),commandInput:n,region:r}}function $U(e){return{[l0]:"aws-api",[c0]:e.commandName,[vu]:e.serviceName,[bu]:e.region}}var B$="Aws";function vI(e){try{return e()}catch(t){$&&g.warn("[orchestrion:aws-sdk] error building span",t);return}}function zU(e,t){t&&(t.requestId&&e.setAttribute(OR,t.requestId),t.httpStatusCode&&e.setAttribute(bi,t.httpStatusCode),t.extendedRequestId&&e.setAttribute(RR,t.extendedRequestId))}var H$=(()=>{let e=new Qf;return{name:B$,setupOnce(){if(!RI.tracingChannel)return;let t=i=>vI(()=>{let o=i.arguments[0],s=o?.constructor?.name;if(!o||!s)return;let c=i.self?.config,a=c?.serviceId??NI(i.self?.constructor?.name||"AWS","Client");o.input||(o.input={});let l=JU(a,s,o.input,void 0),p=e.requestPreSpanHook(l),u=k({name:p.spanName??`${l.serviceName}.${l.commandName}`,kind:p.spanKind??U.CLIENT,op:p.spanOp||"rpc",attributes:{[S]:VU,...$U(l),...p.spanAttributes}});i._sentryNormalizedRequest=l,i._sentryRequestMetadata=p;let d;try{d=c?.region?.()}catch{}let m={settled:!1,promise:Promise.resolve(d).then(_=>{_&&(l.region=_,u.setAttribute(bu,_))}).catch(()=>{}).finally(()=>{m.settled=!0})};return i._sentryRegion=m,vI(()=>e.requestPostSpanHook(l,u)),u}),n={deferSpanEnd({span:i,data:o,end:s}){let c=o._sentryNormalizedRequest,a=o._sentryRequestMetadata;if(!c)return!1;let l="error"in o;if(vI(()=>{if(l){let m=o.error,_=m?.$metadata;zU(i,{requestId:m?.RequestId??_?.requestId,httpStatusCode:_?.httpStatusCode,extendedRequestId:m?.extendedRequestId??_?.extendedRequestId});return}let u=o.result;zU(i,u?.$metadata);let d={data:u,request:c,requestId:u?.$metadata?.requestId};e.responseHook(d,i)}),a?.isStream&&!l)return!0;let p=o._sentryRegion;return p&&!p.settled?(p.promise.then(()=>s()),!0):!1}},r=[A.AWS_SMITHY_CORE_SEND,A.AWS_SMITHY_CLIENT_SEND,A.AWS_SDK_SMITHY_CLIENT_SEND];$&&g.log(`[orchestrion:aws-sdk] subscribing to channels "${r.join('", "')}"`),ue(()=>{for(let i of r)ee(RI.tracingChannel(i),t,n)})}}}),eD=H$;import*as Ap from"diagnostics_channel";var F$="Dataloader",tD="dataloader",W$="auto.db.orchestrion.dataloader",V$="cache.get",nD=Symbol("sentry.dataloader.wrapped");function Y$(e,t){let n=e?.name;return n?`${tD}.${t} ${n}`:`${tD}.${t}`}function j$(e){return Array.isArray(e)?e.map(t=>String(t)):e==null?void 0:[String(e)]}function rD(e,t,n){let r=t==="load"||t==="loadMany"||t==="batch";return{name:Y$(e,t),kind:t==="batch"?void 0:U.CLIENT,op:r?V$:void 0,onlyIfParent:!0,attributes:{[S]:W$,[qs]:r?j$(n):void 0}}}var Z$=(()=>({name:F$,setupOnce(){Ap.tracingChannel&&($&&g.log("[orchestrion:dataloader] subscribing to dataloader tracing channels"),ue(()=>{X$(),K$(),Jf(A.DATALOADER_LOAD_MANY,"loadMany"),Jf(A.DATALOADER_PRIME,"prime"),Jf(A.DATALOADER_CLEAR,"clear"),Jf(A.DATALOADER_CLEAR_ALL,"clearAll")}))}}));function X$(){Ap.tracingChannel(A.DATALOADER_CONSTRUCT).start.subscribe(e=>{let t=e,n=t.arguments[0];if(typeof n!="function"||n[nD])return;let r=n,i=function(...o){return Se({...rD(this,"batch",o[0]),links:this._batch?.spanLinks},()=>r.apply(this,o))};i[nD]=!0,t.arguments[0]=i})}function K$(){let e=Ap.tracingChannel(A.DATALOADER_LOAD);ee(e,t=>iD(t.self,"load",t.arguments[0]),{requiresParentSpan:!0}),e.end.subscribe(t=>{let n=t,r=n._sentrySpan,i=n.self?._batch;r&&i&&r.isRecording()&&(i.spanLinks??(i.spanLinks=[])).push({context:r.spanContext()})})}function Jf(e,t){ee(Ap.tracingChannel(e),n=>iD(n.self,t,n.arguments[0]),{requiresParentSpan:!0})}function iD(e,t,n){return k(rD(e,t,n))}var OI=Z$;import*as CI from"diagnostics_channel";var q$="GenericPool",Q$=(()=>({name:q$,setupOnce(){CI.tracingChannel&&ue(()=>J$())}})),oD=Q$;function J$(){ee(CI.tracingChannel(A.GENERIC_POOL_ACQUIRE),()=>k({name:"generic-pool.acquire",attributes:{[S]:"auto.db.orchestrion.generic_pool"}}))}import*as xI from"diagnostics_channel";var cD="Google_GenAI",sD="auto.ai.orchestrion.google_genai",$$=[{channel:A.GOOGLE_GENAI_GENERATE_CONTENT,operation:"generate_content"},{channel:A.GOOGLE_GENAI_EMBED_CONTENT,operation:"embeddings"},{channel:A.GOOGLE_GENAI_CHAT,operation:"chat"}],aD=!1,z$=((e={})=>({name:cD,setupOnce(){!xI.tracingChannel||aD||(aD=!0,ue(()=>{for(let{channel:t,operation:n}of $$)$&&g.log(`[orchestrion:google-genai] subscribing to channel "${t}"`),ee(xI.tracingChannel(t),r=>ez(r,n,e),{beforeSpanEnd:(r,i)=>{n!=="embeddings"&&hd(r,i.result,Ze(e).recordOutputs)},deferSpanEnd:({span:r,data:i})=>nz(r,i,e)})}))}}));function ez(e,t,n){if(Cn(cD))return;if(t!=="chat"){let p=Q();if(p){let{op:u,origin:d}=oe(p);if(d===sD&&u==="gen_ai.chat")return}}let i=(e.arguments??[])[0],{recordInputs:o}=Ze(n),s=ze(n.enableTruncation),c=_d(t,i,e.self),a=c[De]||"unknown";c[S]=sD;let l=k({name:`${t} ${a}`,op:`gen_ai.${t}`,attributes:c});return o&&i&&hl(l,i,t,s),l}function tz(e){return!!e&&typeof e[Symbol.asyncIterator]=="function"}function nz(e,t,n){let r=t.result;if(!tz(r))return!1;let{recordOutputs:i}=Ze(n),o=r[Symbol.asyncIterator].bind(r),s=_l({[Symbol.asyncIterator]:o},e,i??!1);return r[Symbol.asyncIterator]=()=>s,!0}var lD=z$;import*as Rp from"diagnostics_channel";var $f="auto.graphql.diagnostic_channel",pD="graphql.parse",uD="graphql.validate",dD="graphql.execute",mD="graphql.resolve",fD="graphql.field.name",gD="graphql.field.path",_D="graphql.field.type",hD="graphql.parent.name",bo=Symbol.for("opentelemetry.graphql_data"),Np=Symbol.for("opentelemetry.patched");function rz(e){return typeof e?.then=="function"}function eg(e,t){if(!e||e[Np])return;e[Np]=!0;let n=e.getFields();Object.keys(n).forEach(r=>{let i=n[r];if(i&&(i.resolve&&(i.resolve=PI(t,i.resolve)),i.type))for(let o of yD(i.type))eg(o,t)})}function PI(e,t,n=!1){if(typeof t!="function"||t[Np])return t;function r(i,o,s,c){if(!t)return;let a=s??{};if(e().ignoreTrivialResolveSpans&&n&&(V(i)||typeof i=="function")&&typeof i[c.fieldName]!="function")return t.call(this,i,o,a,c);if(!a[bo])return t.call(this,i,o,a,c);let p=cz(c.path),{field:u,spanAdded:d}=iz(a,c,p),m=u.span;return se(m,()=>{try{let _=t.call(this,i,o,a,c);return rz(_)?_.then(h=>(zf(m,d),h),h=>{throw zf(m,d,h),h}):(zf(m,d),_)}catch(_){throw zf(m,d,_),_}})}return r[Np]=!0,r}function zf(e,t,n){t&&(n&&e.setStatus({code:2,message:n.message}),e.end())}function iz(e,t,n){let r=bD(e,n);if(r)return{field:r,spanAdded:!1};let i={span:oz(t,n,az(e,n))};return sz(e,n,i),{field:i,spanAdded:!0}}function oz(e,t,n){let r={[S]:$f,[B]:Ci,[fD]:e.fieldName,[gD]:t.join("."),[_D]:e.returnType.toString(),[hD]:e.parentType.name};return k({name:`${mD} ${t.join(".")}`,attributes:r,parentSpan:n})}function sz(e,t,n){let r=e[bo];r&&(r.fields[t.join(".")]=n)}function bD(e,t){return e[bo]?.fields[t.join(".")]}function az(e,t){for(let n=t.length-1;n>0;n--){let r=bD(e,t.slice(0,n));if(r)return r.span}return e[bo]?.span}function cz(e){let t=[],n=e;for(;n;)t.push(String(n.key)),n=n.prev;return t.reverse()}function yD(e){return"ofType"in e&&e.ofType?yD(e.ofType):lz(e)?e.getTypes():pz(e)?[e]:[]}function lz(e){return"getTypes"in e&&typeof e.getTypes=="function"}function pz(e){return"getFields"in e&&typeof e.getFields=="function"}function SD(e,t){let n=e?.definitions;if(!n||!Array.isArray(n))return;let r=i=>!!i?.operation&&["query","mutation","subscription"].indexOf(i.operation)!==-1;return t?n.filter(r).find(i=>t===i?.name?.value):n.find(r)}var kI={[S]:$f,[B]:Ci};function ED(){return k({name:pD,attributes:{...kI}})}function TD(e){return k({name:uD,attributes:{...kI,[zs]:Xa(e)}})}function ID(e,t){Array.isArray(t)&&t.length>0&&e.setStatus({code:2,message:"invalid_argument"})}function uz(e){if(e.length>=2)return{schema:e[0],document:e[1],contextValue:e[3]??{},operationName:e[5],fieldResolver:e[6],writeBack:(n,r)=>{e[3]=n,e[6]=r}};let t=e[0]??{};return{schema:t.schema,document:t.document,contextValue:t.contextValue??{},operationName:t.operationName,fieldResolver:t.fieldResolver,writeBack:(n,r)=>{t.contextValue=n,t.fieldResolver=r}}}function AD(e,t,n,r){let i=uz(e),{schema:o,document:s}=i,{contextValue:c,fieldResolver:a}=i,l=!!c[bo];if(!n.ignoreResolveSpans&&!l){let _=a==null,h=t?.defaultFieldResolver,b=a??h;b&&(a=PI(r,b,_)),o&&(eg(o.getQueryType(),r),eg(o.getMutationType(),r))}let p=SD(s,i.operationName),u=p?.operation,d=p?.name?.value??i.operationName??void 0,m=k({name:Ym(u,d||void 0,dD),attributes:{...kI,[Iu]:u,[Tu]:d||void 0,[zs]:Xa(s)}});return n.useOperationNameForRootSpan&&u&&Vm(m,u,d||void 0),c[bo]={source:s,span:m,fields:{}},i.writeBack(c,a),m}function ND(e,t){jm(t)&&e.setStatus({code:2,message:"internal_error"})}var vD="Graphql";function dz(e){return{ignoreResolveSpans:e.ignoreResolveSpans!==!1,ignoreTrivialResolveSpans:e.ignoreTrivialResolveSpans!==!1,useOperationNameForRootSpan:e.useOperationNameForRootSpan!==!1}}function vp(e){try{return e()}catch(t){$&&g.warn("[orchestrion:graphql] error building span",t);return}}var mz=((e={})=>{let t=dz(e),n=()=>t;return{name:vD,setupOnce(){Rp.tracingChannel&&ue(()=>{ee(Rp.tracingChannel(A.GRAPHQL_PARSE),()=>vp(()=>ED())),ee(Rp.tracingChannel(A.GRAPHQL_VALIDATE),r=>vp(()=>TD(r.arguments[1])),{beforeSpanEnd:(r,i)=>{vp(()=>ID(r,i.result))}}),ee(Rp.tracingChannel(A.GRAPHQL_EXECUTE),r=>vp(()=>AD(r.arguments,r.self,t,n)),{beforeSpanEnd:(r,i)=>{vp(()=>ND(r,i.result))}})})}}}),fz=mz,RD=e=>{let t=fz(e);return Ut(ip(e),{name:vD,setupOnce:()=>t.setupOnce?.()})};import*as ng from"diagnostics_channel";var gz=["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"],oc=Symbol("hapi-handler-patched"),Op={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"},OD=new Set(gz),br=(e=>(e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type",e))(br||{});function _z(e){let t=Q();if(!t)return;let n=Re(t);n&&oe(n).data[B]==="http.server"&&n.setAttribute(He,e)}var LI=e=>typeof e=="string"&&OD.has(e),hz=e=>{let t=e?.type;return t!==void 0&&LI(t)},bz=e=>Array.isArray(e)&&e.length<=3&&LI(e[0])&&typeof e[1]=="function",yz=e=>!Array.isArray(e),Sz=(e,t)=>{let n={[He]:e.path,[Gr]:e.method},r;return t?(n[br.HAPI_TYPE]=Op.PLUGIN,n[br.PLUGIN_NAME]=t,r=`${t}: route - ${e.path}`):(n[br.HAPI_TYPE]=Op.ROUTER,r=`route - ${e.path}`),{attributes:n,name:r}},Ez=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[br.EXT_TYPE]:e,[br.HAPI_TYPE]:Op.EXT,[br.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[br.EXT_TYPE]:e,[br.HAPI_TYPE]:Op.EXT},name:r}};function xD(e,t){return Se({name:e.name,op:`${e.attributes[br.HAPI_TYPE]}.hapi`,attributes:{...e.attributes,[S]:"auto.http.orchestrion.hapi"}},t)}function CD(e,t){if(e[oc]===!0)return e;e[oc]=!0;let n=r=>function(...i){if(!Q())return r.call(this,...i);_z(e.path);let o=Sz(e,t);return xD(o,()=>r.call(this,...i))};if(typeof e.handler=="function")e.handler=n(e.handler);else if(typeof e.options=="function"){let r=e.options;e.options=function(i){let o=r(i);return typeof o.handler=="function"&&(o.handler=n(o.handler)),o}}else typeof e.options?.handler=="function"&&(e.options.handler=n(e.options.handler));return e}function tg(e,t,n){if(Array.isArray(e)){for(let r=0;r<e.length;r++)e[r]=tg(e[r],t);return e}else if(yz(e)){if(e[oc]===!0)return e;e[oc]=!0;let r=function(...i){if(!Q())return e.apply(this,i);let o=Ez(t,n,e.name);return xD(o,()=>e.apply(void 0,i))};return r[oc]=!0,r}return e}function PD(e,t){let n=e[0];if(Array.isArray(n))for(let r=0;r<n.length;r++)n[r]=CD(n[r],t);else e[0]=CD(n,t)}function kD(e,t){if(Array.isArray(e[0])){let n=e[0];for(let r=0;r<n.length;r++){let i=n[r];if(LI(i.type)){let o=i,s=tg(o.method,i.type,t);o.method=s,n[r]=o}}return}else if(bz(e)){let n=e,r=n[1],i=tg(r,n[0],t);e[1]=i;return}else if(hz(e[0])){let n=e[0],r=tg(n.method,n.type,t);n.method=r}}var Tz="Hapi",Iz=(()=>({name:Tz,setupOnce(){ng.tracingChannel&&($&&g.log(`[orchestrion:hapi] subscribing to channels "${A.HAPI_ROUTE}" / "${A.HAPI_EXT}"`),ng.tracingChannel(A.HAPI_ROUTE).subscribe({start(e){let t=e;PD(t.arguments,t.self?.realm?.plugin)},end(){},asyncStart(){},asyncEnd(){},error(){}}),ng.tracingChannel(A.HAPI_EXT).subscribe({start(e){let t=e;kD(t.arguments,t.self?.realm?.plugin)},end(){},asyncStart(){},asyncEnd(){},error(){}}))}})),LD=Iz;import*as MI from"diagnostics_channel";var Az="Koa",Nz="auto.http.orchestrion.koa",rg={ROUTER:"router",MIDDLEWARE:"middleware"},MD=Symbol("sentry.koa.layer-patched"),wD=!1,vz=((e={})=>{let t=e.ignoreLayersType??[];return{name:Az,setupOnce(){!MI.tracingChannel||wD||(wD=!0,$&&g.log(`[orchestrion:koa] subscribing to channel "${A.KOA_USE}"`),MI.tracingChannel(A.KOA_USE).subscribe({start(n){Rz(n,t)},end(){},asyncStart(){},asyncEnd(){},error(){}}))}}});function Rz(e,t){let n=e.arguments[0];typeof n=="function"&&(e.arguments[0]=Oz(n,t))}function Oz(e,t){return e.router?Cz(e,t):GD(e,!1,t)}function Cz(e,t){let r=e.router?.stack??[];for(let i of r){let o=i.path,s=i.stack;s.forEach((c,a)=>{s[a]=GD(c,!0,t,o)})}return e}function GD(e,t,n,r){let i=t?rg.ROUTER:rg.MIDDLEWARE;return e[MD]===!0||n.includes(i)||e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?e:(e[MD]=!0,(o,s)=>{if(!Q())return e(o,s);let c=xz(o,e,t,r);o._matchedRoute&&Pz(o._matchedRoute.toString());let a=c.attributes[Nu],l=typeof a=="string"?a||"< unknown >":c.name;return Se({name:l,op:`${i}.koa`,attributes:{...c.attributes,[S]:Nz}},()=>{let p=c.attributes[He];if(J()===Rt())$&&g.warn("Isolation scope is default isolation scope - skipping setting transactionName");else if(p){let u=o.request?.method?.toUpperCase()||"GET";J().setTransactionName(`${u} ${p}`)}return e(o,s)})})}function xz(e,t,n,r){return n?{attributes:{[Nu]:r?.toString(),[Nh]:rg.ROUTER,[He]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[Nu]:t.name||"middleware",[Nh]:rg.MIDDLEWARE,[yu]:t.name||"middleware"},name:`middleware - ${t.name}`}}function Pz(e){let t=Q();if(!t)return;let n=Re(t);n&&oe(n).data[B]==="http.server"&&n.setAttribute(He,e)}var UD=vz;import*as ig from"diagnostics_channel";var kz="IORedis",Lz="auto.db.orchestrion.redis",Mz="db.connection_string";function BD(e){return{host:e?.options?.host,port:e?.options?.port}}function HD(e,t){return{[Pe]:"redis",[Mz]:`redis://${e}:${t}`,[Le]:e,[xe]:t,[S]:Lz}}var DD=new WeakSet;function wz(e){let t=e.arguments?.[0];if(!t||typeof t!="object"||DD.has(t))return;DD.add(t);let{host:n,port:r}=BD(e.self),i=zr(t.name,t.args??[]);return k({name:i,op:"db",attributes:{...HD(n,r),[Ve]:i}})}var Gz=((e={})=>{let t=e.responseHook;return{name:kz,setupOnce(){if(!ig.tracingChannel)return;$&&g.log(`[orchestrion:ioredis] subscribing to "${A.IOREDIS_COMMAND}"/"${A.IOREDIS_CONNECT}"`);let n=ig.tracingChannel(A.IOREDIS_COMMAND),r=ig.tracingChannel(A.IOREDIS_CONNECT);ue(()=>{ee(n,wz,{requiresParentSpan:!0,beforeSpanEnd(i,o){if("error"in o||!t)return;let s=o.arguments?.[0];s&&Uz(t,i,s,o.result)}}),ee(r,i=>{let{host:o,port:s}=BD(i.self);return k({name:"connect",op:"db",attributes:{...HD(o,s),[Ve]:"connect"}})},{requiresParentSpan:!0})})}}});function Uz(e,t,n,r){try{e(t,n.name,n.args,r)}catch{}}var wI=Gz;import*as sg from"diagnostics_channel";var sc="messaging.destination.partition.id",GI="messaging.kafka.message.key",UI="messaging.kafka.message.tombstone",FD="messaging.kafka.offset",DI="process",Cp="receive",WD="send",BI="kafka",VD="_OTHER";var Dz="auto.kafkajs.orchestrion.producer",Bz="auto.kafkajs.orchestrion.consumer",Hz=1,Fz=0;function xp(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?n[0]?.toString():n.toString()}function YD(e){let t=xp(e,"sentry-trace");if(!t)return;let{traceId:n,parentSpanId:r,sampled:i}=In(t,xp(e,"baggage"));if(r)return[{context:{traceId:n,spanId:r,isRemote:!0,traceFlags:i?Hz:Fz}}]}function og({topic:e,message:t,operationType:n,links:r,attributes:i}){let o=n===Cp?"poll":n;return k({name:`${o} ${e}`,op:"message",kind:n===Cp?U.CLIENT:U.CONSUMER,links:r,attributes:{...i,[wt]:BI,[Rn]:e,[cr]:n,[na]:o,[GI]:t?.key?String(t.key):void 0,[UI]:t?.key&&t.value===null?!0:void 0,[FD]:t?.offset,...t?{[S]:Bz}:{}}})}function jD(e,t){let n=k({name:`send ${e}`,op:"message",kind:U.PRODUCER,attributes:{[wt]:BI,[Rn]:e,[GI]:t.key?String(t.key):void 0,[UI]:t.key&&t.value===null?!0:void 0,[sc]:t.partition!==void 0?String(t.partition):void 0,[na]:"send",[cr]:WD,[S]:Dz}});t.headers=t.headers??{};let r=$e({span:n});return r["sentry-trace"]&&(t.headers["sentry-trace"]=r["sentry-trace"]),r.baggage&&(t.headers.baggage=r.baggage),n}function HI(e,t){let n,r=VD;typeof t=="string"||t===void 0?n=t:typeof t=="object"&&t!==null&&Object.prototype.hasOwnProperty.call(t,"message")&&(n=t.message,r=t.constructor.name),e.forEach(i=>{i.setAttribute(wr,r),i.setStatus({code:2,message:n})})}function FI(e,t){return Promise.resolve(t).catch(n=>{throw HI(e,n),n}).finally(()=>{e.forEach(n=>n.end())})}var WI=Symbol("sentry-kafkajs-consumer-callback-wrapped");function VI(e){return typeof e=="function"&&e[WI]===!0}function ZD(e){let t=function(r){let i=xp(r.message.headers,"sentry-trace"),o=xp(r.message.headers,"baggage");return An({sentryTrace:i,baggage:o},()=>{let s=og({topic:r.topic,message:r.message,operationType:DI,attributes:{[sc]:String(r.partition)}}),c=se(s,()=>e.call(this,r));return FI([s],c)})};return t[WI]=!0,t}function XD(e){let t=function(r){let i=Nn(()=>og({topic:r.batch.topic,message:void 0,operationType:Cp,attributes:{[ea]:r.batch.messages.length,[sc]:String(r.batch.partition)}}));return se(i,()=>{let o=[i];r.batch.messages.forEach(c=>{o.push(og({topic:r.batch.topic,message:c,operationType:DI,links:YD(c.headers),attributes:{[sc]:String(r.batch.partition)}}))});let s=e.call(this,r);return FI(o,s)})};return t[WI]=!0,t}var Wz="Kafka";function Vz(){let e=sg.tracingChannel(A.KAFKAJS_SEND_BATCH),t={start(n){let r=[];(n.arguments[0]?.topicMessages??[]).forEach(i=>{i.messages.forEach(o=>{r.push(jD(i.topic,o))})}),n._sentrySpans=r},error(n){n._sentrySpans&&HI(n._sentrySpans,n.error)},asyncEnd(n){n._sentrySpans?.forEach(r=>r.end())}};e.subscribe(t)}function Yz(){let e=sg.tracingChannel(A.KAFKAJS_CONSUMER_RUN),t={start(n){let r=n.arguments[0];!r||typeof r!="object"||(typeof r.eachMessage=="function"&&!VI(r.eachMessage)&&(r.eachMessage=ZD(r.eachMessage)),typeof r.eachBatch=="function"&&!VI(r.eachBatch)&&(r.eachBatch=XD(r.eachBatch)))}};e.subscribe(t)}var jz=(()=>({name:Wz,setupOnce(){sg.tracingChannel&&($&&g.log(`[orchestrion:kafkajs] subscribing to channels "${A.KAFKAJS_SEND_BATCH}", "${A.KAFKAJS_CONSUMER_RUN}"`),Vz(),Yz())}})),KD=jz;import*as ag from"diagnostics_channel";var Zz="Knex",Xz="auto.db.orchestrion.knex",Kz=1021,qz="db.sql.table",Qz="sqlite",Jz="postgresql",jI=Symbol("sentry.orchestrion.knex.parent-span"),$z=(()=>({name:Zz,setupOnce(){ag.tracingChannel&&($&&g.log(`[orchestrion:knex] subscribing to channel "${A.KNEX_QUERY}"`),ue(()=>{YI(A.KNEX_QUERY_BUILDER),YI(A.KNEX_SCHEMA_BUILDER),YI(A.KNEX_RAW),zz()}))}}));function YI(e){ag.tracingChannel(e).end.subscribe(t=>{let n=t.result;if(!n||typeof n!="object"||jI in n)return;let r=Q();r&&Object.defineProperty(n,jI,{value:r})})}function zz(){ee(ag.tracingChannel(A.KNEX_QUERY),e=>{let t=e.self,n=t?.builder,r=n?.[jI]??Q();if(!r)return;let i=e.arguments[0],o=t?.client,s=o?.config?.connection,c=s?.connectionString,a=qD(n),l=i?.method,p=s?.filename||s?.database||i7(c),u={[S]:Xz,"knex.version":e.moduleVersion,[Pe]:n7(o?.driverName),[qz]:a,[Js]:l,[Mt]:s?.user,[Et]:p,[Le]:s?.host??o7(c),[xe]:s?.port??s7(c),[ra]:s?.filename===":memory:"?"inproc":void 0,[Ve]:i?.sql!=null?mn(i.sql,Kz):void 0};return k({name:r7(p,l,a)??"knex.query",kind:U.CLIENT,op:"db",parentSpan:r,attributes:u})},{beforeSpanEnd(e,t){if("error"in t){let n=e7(t);n!==void 0&&e.setStatus({code:2,message:n})}}})}function e7(e){let t=e.error;if(!t||typeof t!="object"||typeof t.message!="string")return;let n=t.message,r=e.arguments[0];if(!r?.sql)return n;try{let o=t7(e.self)(r.sql,r.bindings||[]);return n.replace(`${o} - `,"")}catch{return n}}function t7(e){if(e){let t=e.client;if(t){if(t._formatQuery)return t._formatQuery.bind(t);if(t.SqlString)return t.SqlString.format.bind(t.SqlString)}if(e.builder?.toString)return e.builder.toString.bind(e.builder)}return()=>"<noop formatter>"}function n7(e){return e==="sqlite3"?Qz:e==="pg"?Jz:e}function r7(e,t,n){return t&&e?n?`${t} ${e}.${n}`:`${t} ${e}`:e}function qD(e){let t=e?._single?.table;return t&&typeof t=="object"?qD(t):typeof t=="string"?t:void 0}function i7(e){if(e)try{return new URL(e).pathname?.replace(/^\//,"")||void 0}catch{return}}function o7(e){if(e)try{return new URL(e).hostname||void 0}catch{return}}function s7(e){if(e)try{let t=new URL(e).port;return t?parseInt(t,10):void 0}catch{return}}var ZI=$z;import*as cg from"diagnostics_channel";var a7=Ta,c7=[Yr,jr,Zr],QD=!1;function JD(){Ti(c7)}var l7=((e={})=>({name:a7,setupOnce(){if(!cg.tracingChannel||QD)return;QD=!0;let t=mr(e),n=r=>{JD();let i=r.arguments;if(!Array.isArray(i))return;let o=i[1];(!o||typeof o!="object"||Array.isArray(o))&&(o={},i[1]=o),o.callbacks=es(o.callbacks,t)};for(let r of[A.LANGCHAIN_CHAT_MODEL_INVOKE,A.LANGCHAIN_CHAT_MODEL_STREAM])$&&g.log(`[orchestrion:langchain] subscribing to channel "${r}"`),cg.tracingChannel(r).start.subscribe(n);ue(()=>{for(let r of UG)$&&g.log(`[orchestrion:langchain] subscribing to channel "${r}"`),ee(cg.tracingChannel(r),i=>p7(i,e))})}}));function p7(e,t){JD();let n=(e.arguments??[])[0];return k(Sd(e.self,n,t))}var $D=l7;import*as pg from"diagnostics_channel";var u7=Na,zD=!1,lg=!1,d7=((e={})=>({name:u7,setupOnce(){if(!pg.tracingChannel||zD)return;zD=!0;let t=Ze(e),n=mr(t);ue(()=>{$&&g.log(`[orchestrion:langgraph] subscribing to channel "${A.LANGGRAPH_STATE_GRAPH_COMPILE}"`),ee(pg.tracingChannel(A.LANGGRAPH_STATE_GRAPH_COMPILE),i=>{if(lg)return;let o=XI(i.arguments),s=typeof o?.name=="string"?o.name:void 0;return k(Id(s))},{beforeSpanEnd:(i,o)=>{eB(o.result,XI(o.arguments)??{},t,null,n)}}),$&&g.log(`[orchestrion:langgraph] subscribing to channel "${A.LANGGRAPH_CREATE_REACT_AGENT}"`);let r=pg.tracingChannel(A.LANGGRAPH_CREATE_REACT_AGENT);r.start.subscribe(i=>{lg=!0;try{let{arguments:o}=i,s=XI(o);s&&Array.isArray(s.tools)&&s.tools.length>0&&Tl(s.tools,t,va(o)??void 0)}catch(o){$&&g.error("[orchestrion:langgraph] failed to wrap createReactAgent tools",o)}}),r.end.subscribe(i=>{lg=!1;let{arguments:o,result:s}=i,c=va(o)??void 0;eB(s,c?{name:c}:{},t,El(o),n)}),r.error.subscribe(()=>{lg=!1})})}}));function XI(e){let t=(e??[])[0];return typeof t=="object"&&t!==null?t:void 0}function eB(e,t,n,r,i){if(!e||typeof e!="object")return;let o=e,s=o.invoke;typeof s=="function"&&(o.invoke=Il(s.bind(o),o,t,n,r,i))}var tB=d7;import*as KI from"diagnostics_channel";var m7="LruMemoizer",f7=(()=>({name:m7,setupOnce(){KI.tracingChannel&&($&&g.log(`[orchestrion:lru-memoizer] subscribing to channel "${A.LRU_MEMOIZER_LOAD}"`),ue(()=>{ee(KI.tracingChannel(A.LRU_MEMOIZER_LOAD),()=>{})}))}})),nB=f7;import*as Pp from"diagnostics_channel";var g7="Mongo",rB="auto.db.orchestrion.mongo",_7=new Set(["insert","update","delete","find","getMore","killCursors"]),h7=(()=>({name:g7,setupOnce(){Pp.tracingChannel&&ue(()=>{b7(),y7(),S7()})}}));function b7(){ee(Pp.tracingChannel(A.MONGODB_COMMAND),e=>{let t=e.arguments??[],n=t[0],r=t[1];if(!n||!r||typeof r!="object"||r.ismaster||r.hello)return;let i=Object.keys(r)[0];return hr(op(e.self,n,r,i,rB))},{requiresParentSpan:!0})}function y7(){ee(Pp.tracingChannel(A.MONGODB_CHECKOUT),()=>{})}function S7(){for(let e of["insert","update","remove"]){let t=e==="insert"?A.MONGODB_V3_INSERT:e==="update"?A.MONGODB_V3_UPDATE:A.MONGODB_V3_REMOVE;ug(t,n=>({topology:n[0],ns:n[1],command:n[2]?.[0],operation:e}))}ug(A.MONGODB_V3_COMMAND,e=>{let t=e[2],n=t?Object.keys(t)[0]:void 0;if(!(n&&_7.has(n)))return{topology:e[0],ns:e[1],command:t,operation:t?sp(t):void 0}}),ug(A.MONGODB_V3_QUERY,e=>({topology:e[0],ns:e[1],command:e[2],operation:"find"})),ug(A.MONGODB_V3_GET_MORE,e=>({topology:e[0],ns:e[1],command:e[2]?.cmd,operation:"getMore"}))}function ug(e,t){ee(Pp.tracingChannel(e),n=>{let r=n.arguments;if(!r)return;let i=t(r);if(!(!i||typeof i.ns!="string"))return hr(ap(i.ns,i.topology,i.command,i.operation,rB))},{requiresParentSpan:!0})}var iB=h7;import*as kp from"diagnostics_channel";var E7="Mongoose",T7="auto.db.orchestrion.mongoose",qI=new WeakMap,oB=!1,I7=(()=>({name:E7,setupOnce(){kp.tracingChannel&&ue(()=>{Xm(kp.tracingChannel),A7()})}}));function A7(){if(!oB){oB=!0,$&&g.log("[orchestrion:mongoose] subscribing to injected channels");for(let e of qG)sB(e).subscribe({start(t){aB(t.self)}});sB(A.MONGOOSE_MODEL_AGGREGATE).subscribe({end(e){let t=e.result;t&&typeof t=="object"&&aB(t)}}),cc(A.MONGOOSE_QUERY_EXEC,e=>{let t=e;return ac(t.mongooseCollection,t.model?.modelName,t.op??"exec",qI.get(e))}),cc(A.MONGOOSE_AGGREGATE_EXEC,e=>{let t=e._model;return ac(t?.collection,t?.modelName,"aggregate",qI.get(e))}),cc(A.MONGOOSE_MODEL_SAVE,e=>{let t=e.constructor;return ac(t.collection,t.modelName,"save")}),cc(A.MONGOOSE_MODEL_REMOVE,e=>{let t=e.constructor;return ac(t.collection,t.modelName,"remove")}),cc(A.MONGOOSE_MODEL_INSERT_MANY,e=>{let t=e;return ac(t.collection,t.modelName,"insertMany")}),cc(A.MONGOOSE_MODEL_BULK_WRITE,e=>{let t=e;return ac(t.collection,t.modelName,"bulkWrite")})}}function ac(e,t,n,r){return Pi({collection:e,modelName:t,operation:n,origin:T7,parentSpan:r})}function sB(e){return kp.tracingChannel(e)}function cc(e,t){ee(kp.tracingChannel(e),n=>{let r=n.self;if(r)return t(r)})}function aB(e){let t=Q();e&&t&&qI.set(e,t)}var cB=I7;import*as QI from"diagnostics_channel";var N7="Mysql",v7="db.system",R7="db.connection_string",O7="db.name",C7="db.user",x7="db.statement",P7="net.peer.name",k7="net.peer.port",L7=(()=>({name:N7,setupOnce(){QI.tracingChannel&&($&&g.log(`[orchestrion:mysql] subscribing to channel "${A.MYSQL_QUERY}"`),ue(()=>{ee(QI.tracingChannel(A.MYSQL_QUERY),e=>{let t=w7(e.arguments[0]),{host:n,port:r,database:i,user:o}=G7(e.self),s=typeof r=="string"?parseInt(r,10):r,c=typeof s=="number"&&!isNaN(s);return e._sentryCallerScope=ne(),k({name:t??"mysql.query",kind:U.CLIENT,op:"db",attributes:{[v7]:"mysql",[S]:"auto.db.orchestrion.mysql",[R7]:U7(n,c?s:void 0,i),...i?{[O7]:i}:{},...o?{[C7]:o}:{},...t?{[x7]:t}:{},...n?{[P7]:n}:{},...c?{[k7]:s}:{}}})},{deferSpanEnd({data:e,end:t}){let n=e.result;if(!n||typeof n!="object"||!M7(n))return!1;let r=e._sentryCallerScope;return r&&_n(n,r),n.on("error",i=>t(i)),n.on("end",()=>t()),!0}})}))}}));function M7(e){return"on"in e&&typeof e.on=="function"}function w7(e){if(typeof e=="string")return e;if(V(e)&&"sql"in e){let t=e.sql;return typeof t=="string"?t:void 0}}function G7(e){let t=e?.config?.connectionConfig??e?.config??{};return{host:t.host,port:t.port,database:t.database,user:t.user}}function U7(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),n&&(r+=`/${n}`),r}var lB=L7;import*as dg from"diagnostics_channel";var D7="Mysql2",B7="auto.db.orchestrion.mysql2",H7="mysql";function F7(){Km(dg.tracingChannel),pB(A.MYSQL2_QUERY),pB(A.MYSQL2_EXECUTE)}function pB(e){ee(dg.tracingChannel(e),t=>{let n=W7(t.arguments);return k({name:n??"mysql2.query",kind:U.CLIENT,attributes:{[S]:B7,[B]:"db",[Pe]:H7,...Y7(t.self?.config),[Ve]:n||void 0}})},{requiresParentSpan:!0})}function W7(e){return V7(e[0])}function V7(e){if(typeof e=="string")return e;if(V(e)&&"sql"in e){let t=e.sql;return typeof t=="string"?t:void 0}}function Y7(e){let{host:t,port:n,database:r,user:i}=e?.connectionConfig??e??{},o=typeof n=="string"?parseInt(n,10):n,s=typeof o=="number"&&!isNaN(o);return{[Et]:r||void 0,[Mt]:i||void 0,[Le]:t||void 0,[xe]:s?o:void 0}}var j7=(()=>({name:D7,setupOnce(){dg.tracingChannel&&ue(()=>{F7()})}})),uB=j7;import*as JI from"diagnostics_channel";var mB="OpenAI",Z7="auto.ai.orchestrion.openai",X7=[{channel:A.OPENAI_CHAT,operation:"chat"},{channel:A.OPENAI_EMBEDDINGS,operation:"embeddings"}],dB=!1,K7=((e={})=>({name:mB,setupOnce(){!JI.tracingChannel||dB||(dB=!0,ue(()=>{for(let{channel:t,operation:n}of X7)$&&g.log(`[orchestrion:openai] subscribing to channel "${t}"`),ee(JI.tracingChannel(t),r=>q7(r,n,e),{beforeSpanEnd:(r,i)=>{ul(r,i.result,Ze(e).recordOutputs)},deferSpanEnd:({span:r,data:i})=>J7(r,i,e)})}))}}));function q7(e,t,n){if(Cn(mB))return;let r=e.arguments??[],i=r[0],{recordInputs:o}=Ze(n),s=ze(n.enableTruncation),c=pd(r,t);c[S]=Z7;let a=i?.model||"unknown",l=k({name:`${t} ${a}`,op:`gen_ai.${t}`,attributes:c});return o&&i&&ml(l,i,t,s),l}function Q7(e){return!!e&&typeof e[Symbol.asyncIterator]=="function"}function J7(e,t,n){let r=t.result;if(!Q7(r))return!1;let{recordOutputs:i}=Ze(n),o=r[Symbol.asyncIterator].bind(r),s=dl({[Symbol.asyncIterator]:o},e,i??!1);return r[Symbol.asyncIterator]=()=>s,!0}var fB=K7;import*as zI from"diagnostics_channel";var $7="Postgres",z7="auto.db.orchestrion.postgres",gB="db.system",_B="db.name",hB="db.connection_string",bB="db.user",e6="db.statement",yB="net.peer.name",SB="net.peer.port",t6="db.postgresql.plan",n6="db.postgresql.idle.timeout.millis",r6="db.postgresql.max.client",EB="postgresql",i6="pg.query",o6="pg.connect",s6="pg-pool.connect",a6=((e={})=>({name:$7,setupOnce(){zI.tracingChannel&&ue(()=>{$I(A.PG_QUERY,c6,{deferStreamedResult:!0}),e.ignoreConnectSpans||($I(A.PG_CONNECT,l6),$I(A.PGPOOL_CONNECT,p6))})}}));function $I(e,t,{deferStreamedResult:n=!1}={}){$&&g.log(`[orchestrion:pg] subscribing to channel "${e}"`),ee(zI.tracingChannel(e),r=>(r._sentryCallerScope=ne(),k({...t(r),kind:U.CLIENT})),n?{requiresParentSpan:!0,deferSpanEnd({data:r,end:i}){let o=r.result;if(!o||typeof o!="object"||!u6(o))return!1;let s=r._sentryCallerScope;return s&&_n(o,s),o.on("error",c=>i(c)),o.on("end",()=>i()),!0}}:{requiresParentSpan:!0})}function c6(e){let t=e.self?.connectionParameters??{},n=d6(e.arguments);return{name:n?.text??i6,op:"db",attributes:{...TB(t),[S]:z7,[e6]:n?.text||void 0,[t6]:typeof n?.name=="string"?n.name:void 0}}}function l6(e){let t=e.self?.connectionParameters??{};return{name:o6,op:"db",attributes:TB(t)}}function p6(e){let t=e.self?.options??{};return{name:s6,op:"db",attributes:m6(t)}}function u6(e){return"on"in e&&typeof e.on=="function"}function d6(e){let t=e[0];if(typeof t=="string")return{text:t};if(V(t)&&typeof t.text=="string"){let n=t;return{text:n.text,name:n.name}}}function TB(e){return{[gB]:EB,[hB]:IB(e),[_B]:e.database,[bB]:e.user,[yB]:e.host,[SB]:Number.isInteger(e.port)?e.port:void 0}}function m6(e){let t;try{t=e.connectionString?new URL(e.connectionString):void 0}catch{t=void 0}let n=t?.pathname.slice(1)||e.database,r=t?.hostname||e.host,i=Number(t?.port)||(Number.isInteger(e.port)?e.port:void 0),o=t?.username||e.user;return{[gB]:EB,[hB]:IB(e),[n6]:e.idleTimeoutMillis,[r6]:e.max,[_B]:n,[SB]:i,[yB]:r||void 0,[bB]:o||void 0}}function IB(e){if(e.connectionString)try{let i=new URL(e.connectionString);return i.username="",i.password="",i.toString()}catch{return"postgresql://localhost:5432/"}let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}var AB=a6;import*as lc from"diagnostics_channel";var f6="PostgresJs",g6="auto.db.orchestrion.postgresjs",_6="db.response.status_code",Kn=()=>{},h6=Symbol.for("sentry.query.from.instrumented.sql"),RB=Symbol("sentryPostgresJsSpan"),NB=Symbol("sentryPostgresJsConnectionAttrsSet"),OB=Symbol("sentryPostgresJsSpanEnded"),CB=new WeakMap,mg=[];function b6(e){mg.some(n=>n.ATTR_SERVER_ADDRESS===e.ATTR_SERVER_ADDRESS&&n.ATTR_SERVER_PORT===e.ATTR_SERVER_PORT&&n.ATTR_DB_NAMESPACE===e.ATTR_DB_NAMESPACE)||mg.push(e)}function y6(){return mg.length===1?mg[0]:void 0}function S6(e){let t=e.result,n=e.arguments?.[0];if(!t||typeof t!="object"||!n)return;let r=Fd(n);CB.set(t,r),b6(r)}function xB(e,t,n){let r=t;r[NB]||(r[NB]=!0,Hd(e,n))}function vB(e){let t=e.self,n=e.arguments?.[0];if(!t||!n)return;let r=n[RB],i=CB.get(t);r&&i&&xB(r,n,i)}function E6(e,t,n){let r=e.self;if(!r)return;let i=()=>{e[OB]=!0},o=r.resolve;typeof o=="function"&&(r.resolve=function(...c){i();try{let a=c[0]?.command;Ca(t,n,a),t.end()}catch(a){$&&g.error("[orchestrion:postgresjs] error ending span in resolve:",a)}return o.apply(this,c)});let s=r.reject;typeof s=="function"&&(r.reject=function(...c){i();try{let a=c[0];t.setStatus({code:2,message:a?.message||"unknown_error"}),t.setAttribute(_6,a?.code||"unknown"),t.setAttribute(wr,a?.name||"unknown"),Ca(t,n),t.end()}catch(a){$&&g.error("[orchestrion:postgresjs] error ending span in reject:",a)}return s.apply(this,c)})}var T6=((e={})=>{let{requireParentSpan:t,requestHook:n}=e;return{name:f6,setupOnce(){lc.tracingChannel&&($&&g.log(`[orchestrion:postgresjs] subscribing to "${A.POSTGRESJS_HANDLE}"`),lc.tracingChannel(A.POSTGRESJS_CONNECTION).subscribe({start:Kn,asyncStart:Kn,asyncEnd:Kn,error:Kn,end:S6}),lc.tracingChannel(A.POSTGRESJS_EXECUTE).subscribe({end:Kn,asyncStart:Kn,asyncEnd:Kn,error:Kn,start:vB}),lc.tracingChannel(A.POSTGRESJS_CONNECT).subscribe({end:Kn,asyncStart:Kn,asyncEnd:Kn,error:Kn,start:vB}),ue(()=>{ee(lc.tracingChannel(A.POSTGRESJS_HANDLE),r=>{let i=r.self;if(!i||i.executed===!0||i[h6])return;let o=Bd(i.strings),s=xa(o),c=k({name:s||"postgresjs.query",op:"db",kind:U.CLIENT,attributes:{[S]:g6,[mt]:"postgres",[Mr]:s}});i[RB]=c;let a=y6();if(a&&xB(c,i,a),n)try{n(c,s,a)}catch(l){c.setAttribute("sentry.hook.error","requestHook failed"),$&&g.error("[orchestrion:postgresjs] error in requestHook:",l)}return E6(r,c,s),c},{requiresParentSpan:t!==!1,deferSpanEnd({data:r}){return r[OB]?!0:!("error"in r)}})}))}}}),PB=T6;import{EventEmitter as I6}from"events";import*as gg from"diagnostics_channel";var A6="Tedious",N6="auto.db.orchestrion.tedious",v6="mssql",R6="db.sql.table",LB=Symbol("sentry.orchestrion.tedious.current-database");function fg(e){Object.defineProperty(this,LB,{value:e,writable:!0,configurable:!0})}function kB(){this.removeListener("databaseChange",fg)}function O6(){gg.tracingChannel(A.TEDIOUS_CONNECT).start.subscribe(e=>{let t=e.self;t&&(fg.call(t,t.config?.options?.database),t.removeListener("databaseChange",fg),t.on("databaseChange",fg),t.removeListener("end",kB),t.once("end",kB))})}function pc(e,t){gg.tracingChannel(e).start.subscribe(n=>{let r=n,i=r.self,o=r.arguments[0];if(!i||!(o instanceof I6))return;let s=0,c=0,a=()=>{c++},l=()=>{s++},p=i[LB],u=C6(o),d={[S]:N6,[Pe]:v6,[Et]:p,[Mt]:i.config?.userName??i.config?.authentication?.options?.userName,[Ve]:u,[R6]:o.table,[Le]:i.config?.server,[xe]:i.config?.options?.port},m=k({name:x6(t,p,u,o.table),kind:U.CLIENT,op:"db",attributes:d}),_=P6(h=>{o.removeListener("done",a),o.removeListener("doneInProc",a),o.removeListener("doneProc",l),o.removeListener("error",_),i.removeListener("end",_),m.setAttribute("tedious.procedure_count",s),m.setAttribute("tedious.statement_count",c),h&&m.setStatus({code:2,message:h.message}),m.end()});if(o.on("done",a),o.on("doneInProc",a),o.on("doneProc",l),o.once("error",_),i.on("end",_),typeof o.callback=="function"){let h=o.callback;o.callback=function(...b){return _(b[0]),h.apply(this,b)}}})}function C6(e){if(e.sqlTextOrProcedure==="sp_prepare"&&e.parametersByName?.stmt?.value!=null){let t=e.parametersByName.stmt.value;return typeof t=="string"?t:void 0}return e.sqlTextOrProcedure}function x6(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:e}function P6(e){let t=!1;return(...n)=>{t||(t=!0,e(...n))}}var k6=(()=>({name:A6,setupOnce(){gg.tracingChannel&&($&&g.log(`[orchestrion:tedious] subscribing to channel "${A.TEDIOUS_EXEC_SQL}"`),ue(()=>{O6(),pc(A.TEDIOUS_EXEC_SQL,"execSql"),pc(A.TEDIOUS_EXEC_SQL_BATCH,"execSqlBatch"),pc(A.TEDIOUS_CALL_PROCEDURE,"callProcedure"),pc(A.TEDIOUS_EXEC_BULK_LOAD,"execBulkLoad"),pc(A.TEDIOUS_PREPARE,"prepare"),pc(A.TEDIOUS_EXECUTE,"execute")}))}})),MB=k6;import*as oA from"diagnostics_channel";var wB=Symbol("SentryVercelAiModelPatched"),GB=Symbol("SentryVercelAiToolPatched"),L6=0;function _g(){return`v6-${++L6}`}var hg=new WeakMap,FB=new WeakSet,WB=new WeakSet,rA=new WeakMap,iA=new WeakMap,tA=new WeakMap,VB=new WeakSet,UB=!1;function YB(e,t={}){if(!UB){UB=!0;try{uc(e,A.VERCEL_AI_GENERATE_TEXT,eA("generateText"),t),uc(e,A.VERCEL_AI_STREAM_TEXT,eA("streamText"),t),uc(e,A.VERCEL_AI_GENERATE_OBJECT,eA("generateObject"),t),uc(e,A.VERCEL_AI_EMBED,(n,r)=>({type:"embed",event:{callId:_g(),...nA(n.model),maxRetries:n.maxRetries,value:n.value,...Lp(r)}}),t),uc(e,A.VERCEL_AI_EMBED_MANY,(n,r)=>({type:"embedMany",event:{callId:_g(),...nA(n.model),maxRetries:n.maxRetries,values:n.values,...Lp(r)}}),t),uc(e,A.VERCEL_AI_EXECUTE_TOOL_CALL,(n,r)=>({type:"executeTool",event:{callId:_g(),toolCall:n.toolCall,tools:n.tools,...Lp(r)}}),t),U6(e,A.VERCEL_AI_RESOLVE_LANGUAGE_MODEL,t)}catch{$&&g.log("Vercel AI orchestrion channel subscription failed.")}}}function uc(e,t,n,r){let i=e(t),o=s=>{let c=V(s.arguments[0])?s.arguments[0]:{},a=V(c.experimental_telemetry)?c.experimental_telemetry:{};if(a.isEnabled===!1&&!VB.has(a))return;let l=n(c,a);G6(c,a);let p=Q(),u=lp(l,r);if(u){hg.set(s,l),FB.add(u);let d=V(c.model)&&c.model.specificationVersion==="v1";tA.set(u,{callSiteSpan:p,toolErrorsBubbleToCaller:d}),l.type==="executeTool"&&WB.add(u);let m=Fe(l.event.callId);m&&rA.set(u,m),iA.set(u,Lp(a)),V(c.tools)&&D6(c.tools,r),d&&ZB(c.model,r)}return u};ee(i,s=>o(s),{beforeSpanEnd:(s,c)=>{let a=hg.get(c);if(a){if("error"in c){let l=tA.get(s)?.callSiteSpan;l&&V(c.error)&&we(c.error,"_sentry_active_span",l)}else a.result=a.type==="executeTool"?{output:c.result}:c.result,Qa(s,a,r);a.type!=="streamText"&&NE(a),hg.delete(c)}},deferSpanEnd:({data:s,end:c})=>M6(s,c)})}function M6(e,t){if(hg.get(e)?.type!=="streamText"||"error"in e||!w6(e.result))return!1;let n=e.result;return(async()=>{try{let[r,i,o,s,c]=await Promise.all([n.totalUsage??n.usage,n.text,n.toolCalls,n.finishReason,n.response]);e.result={usage:r,text:i,toolCalls:o,finishReason:s,response:c},t()}catch(r){t(r)}})(),!0}function w6(e){return V(e)&&(DB(e.totalUsage)||DB(e.usage))}function DB(e){return V(e)&&typeof e.then=="function"}function G6(e,t){if(t.isEnabled!==!0)return;let n={...t,isEnabled:!1};VB.add(n),e.experimental_telemetry=n}function U6(e,t,n){e(t).subscribe({end(r){let i=r;V(i.result)&&ZB(i.result,n)},start(){},asyncStart(){},asyncEnd(){},error(){}})}function jB(){let e=Q();return e&&FB.has(e)?e:void 0}function ZB(e,t){e[wB]||(e[wB]=!0,BB(e,"doGenerate",t),BB(e,"doStream",t))}function BB(e,t,n){let r=e[t];typeof r=="function"&&(e[t]=function(...i){let o=jB();if(!o)return Promise.resolve(r.apply(this,i));let s=V(i[0])?i[0]:{},c=rA.get(o),a={type:"languageModelCall",event:{callId:c,provider:e.provider,modelId:e.modelId,tools:s.tools??(V(s.mode)?s.mode.tools:void 0),messages:s.prompt,...iA.get(o)}},l=se(o,()=>lp(a,n));if(!l)return Promise.resolve(r.apply(this,i));let p=()=>{t==="doStream"&&c&&vE(c)},u=d=>{throw l.setStatus({code:2,message:d instanceof Error?d.message:"unknown_error"}),l.end(),p(),d};try{return Promise.resolve(r.apply(this,i)).then(m=>t==="doStream"&&V(m)&&$m(m.stream)?(m.stream=zm(m.stream,_=>{a.result={...m,...RE(_)},Qa(l,a,n),l.end(),p()},_=>{l.setStatus({code:2,message:_ instanceof Error?_.message:"unknown_error"}),l.end(),p()}),m):(a.result=m,Qa(l,a,n),l.end(),p(),m),u)}catch(d){return u(d)}})}function D6(e,t){try{for(let[n,r]of Object.entries(e))V(r)&&B6(n,r,e,t)}catch{$&&g.log("Vercel AI orchestrion tool patching failed.")}}function B6(e,t,n,r){let i=t.execute;typeof i!="function"||t[GB]||(t[GB]=!0,t.execute=function(o,...s){let c=jB();if(!c||WB.has(c))return i.apply(this,[o,...s]);let a=V(s[0])?s[0]:{},l={type:"executeTool",event:{callId:rA.get(c),toolCall:{toolName:e,toolCallId:Fe(a.toolCallId),input:o},tools:n,...iA.get(c)}},p=se(c,()=>lp(l,r));if(!p)return i.apply(this,[o,...s]);let u=d=>{throw tA.get(c)?.toolErrorsBubbleToCaller?p.setStatus({code:2,message:d instanceof Error?d.message:"tool_error"}):OE(p,l,d),p.end(),d};try{return Promise.resolve(i.apply(this,[o,...s])).then(m=>(l.result={output:m},Qa(p,l,r),p.end(),m),u)}catch(d){return u(d)}})}function eA(e){return(t,n)=>({type:e,event:{callId:_g(),operationId:`ai.${e}`,functionId:Fe(n.functionId),...nA(t.model),maxRetries:t.maxRetries,instructions:Fe(t.system),messages:H6(t),...Lp(n)}})}function H6(e){return Array.isArray(e.messages)?e.messages:typeof e.prompt=="string"?[{role:"user",content:e.prompt}]:e.messages??e.prompt}function Lp(e){let t=e.isEnabled===!0?!0:void 0;return{recordInputs:e.recordInputs??t,recordOutputs:e.recordOutputs??t}}function nA(e){return{provider:HB(e,"provider"),modelId:HB(e,"modelId")}}function HB(e,t){return V(e)?Fe(e[t]):void 0}var F6=((e={})=>{let t=pp(e);return Ut(t,{options:e,setupOnce(){oA.tracingChannel&&ue(()=>{YB(oA.tracingChannel,e)})}})}),XB=F6;import*as sA from"diagnostics_channel";var QB=new WeakMap;function JB(e,t){QB.set(e,t)}function $B(e){return QB.get(e)}var KB=new WeakMap;function bg(e){let t=KB.get(e);return t||(t=[],KB.set(e,t)),t}function zB(e,t){bg(e).push(t)}function eH(e){bg(e).pop()}function tH(e){let t=e[0];return Array.isArray(t)?t.map(n=>qB(n)??"").join(","):qB(t)}function qB(e){return typeof e=="string"?e:e instanceof RegExp||typeof e=="number"?String(e):void 0}function nH(e){let t=bg(e),n="";for(let r of t)r==="/"||r==="/*"||(n+=!n||n.endsWith("/")?r:`/${r}`);return n.replace(/\/{2,}/g,"/")}function rH(e,t){let n=bg(e);if(n.length===0)return;let r=typeof e.originalUrl=="string"?e.originalUrl:"";if(n.every(s=>s==="/"))return r==="/"?"/":void 0;if(t==="*"||t.includes("/")&&(t.includes(",")||t.includes("\\")||t.includes("*")||t.includes("[")))return t;let i=t.startsWith("/")?t:`/${t}`;return i.length>0&&(r===i||r.startsWith(i)||W6(i))?i:void 0}function W6(e){return e.includes(":")||e.includes("*")}var V6="auto.http.express",Y6="express.name",j6="express.type",yo=()=>{},iH=!1;function oH(e,t){if(!iH){iH=!0;for(let n of[A.EXPRESS_REGISTER,A.ROUTER_REGISTER])t(n).subscribe({start:yo,asyncStart:yo,asyncEnd:yo,error:yo,end:Z6});for(let n of[A.EXPRESS_HANDLE,A.ROUTER_HANDLE]){$&&g.log(`[orchestrion:express] subscribing to channel "${n}"`);let r=t(n);ee(r,i=>K6(i,e),{beforeSpanEnd(i,o){o._sentryCleanup?.()}}),r.subscribe({start:yo,asyncEnd:yo,end:yo,error:yo,asyncStart:X6})}}}function Z6(e){let t=e.self?.stack;if(!Array.isArray(t))return;let n=t[t.length-1];n&&JB(n,tH(e.arguments??[]))}function X6(e){if(!e._sentryStoredLayer)return;e._sentryStoredLayer=!1;let t=e.arguments?.[0];t&&eH(t)}function K6(e,t){let n=e.self,r=e.arguments;if(!n||!Array.isArray(r)||n.handle?.length===4||n.method&&!n.route)return;let i=r[0],o=r[1];if(!i||!Q())return;let s=q6(n),c=$B(n);c!=null&&(zB(i,c),e._sentryStoredLayer=!0);let a=s==="request_handler"?nH(i):void 0,l=s==="request_handler"&&a!=null?rH(i,a):void 0,p=s==="request_handler"?a||"request handler":s==="router"?n.path??"/":n.name??"<anonymous>";if(l&&Q6(l),s==="request_handler"&&a){let d=J();if(d!==Rt()){let m=typeof i.method=="string"?i.method.toUpperCase():"GET";d.setTransactionName(`${m} ${a}`)}else $&&g.warn("[orchestrion:express] Isolation scope is still default isolation scope - skipping transaction name")}if(J6(p,s,t))return;let u=k({name:p,attributes:{[S]:V6,[B]:`${s}.express`,[Y6]:p,[j6]:s,...l?{[He]:l}:{}}});if(o&&typeof o.once=="function"){let d=()=>{u.end()};o.once("finish",d),e._sentryCleanup=()=>o.removeListener("finish",d)}return u}function q6(e){return e.name==="router"?"router":e.name==="bound dispatch"||e.name==="handle"?"request_handler":"middleware"}function Q6(e){let t=Q(),n=t&&Re(t);n&&oe(n).data[B]==="http.server"&&n.setAttribute(He,e)}function J6(e,t,n){let{ignoreLayers:r,ignoreLayersType:i}=n;if(Array.isArray(i)&&i.includes(t))return!0;if(!Array.isArray(r))return!1;try{return fn(e,r,!0)}catch{return!1}}var $6="Express",z6=((e={})=>({name:$6,setupOnce(){sA.tracingChannel&&ue(()=>{oH(e,sA.tracingChannel)})},getShouldHandleError(){return e.shouldHandleError}})),sH=z6;import*as fH from"diagnostics_channel";import*as aA from"diagnostics_channel";import*as aH from"net";function cH(e,t){return k({name:`${e} ${t.path}`,op:"db.query",kind:U.CLIENT,attributes:{[S]:"auto.firebase.orchestrion.firestore",[ar]:e,...t8(t)}})}function e8(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(aH.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function t8(e){let t=e.firestore.app,n=t.options,r=e.firestore.toJSON()?.settings||{},i={[Qs]:e.path,[fi]:t.name,[mt]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":n.projectId,"firebase.firestore.options.appId":n.appId,"firebase.firestore.options.messagingSenderId":n.messagingSenderId,"firebase.firestore.options.storageBucket":n.storageBucket},{address:o,port:s}=e8(r);return o&&(i[_t]=o),s&&(i[ht]=s),i}var lH="auto.firebase.orchestrion.functions",pH="__sentryFirebaseWrapped";function uH(e,t){let n=e.arguments;if(!Array.isArray(n)||n.length===0)return;let r=typeof n[0]=="function"?0:1,i=n[r];typeof i!="function"||i[pH]||(n[r]=n8(i,t))}function n8(e,t){let n=async function(...r){let i=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",o={[S]:lH,[GR]:i,[Su]:t,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(o["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(o["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),ke({name:`firebase.function.${t}`,op:"function.firebase",kind:U.SERVER,attributes:o},async s=>{try{let c=await e.apply(this,r);return s.end(),c}catch(c){throw s.setStatus({code:2}),me(c,{mechanism:{type:lH,handled:!1}}),s.end(),await Yo(2e3),c}})};return n[pH]=!0,n}var r8=[{channel:A.FIREBASE_FIRESTORE_ADD_DOC,spanName:"addDoc",useParent:!1},{channel:A.FIREBASE_FIRESTORE_GET_DOCS,spanName:"getDocs",useParent:!1},{channel:A.FIREBASE_FIRESTORE_SET_DOC,spanName:"setDoc",useParent:!0},{channel:A.FIREBASE_FIRESTORE_DELETE_DOC,spanName:"deleteDoc",useParent:!0}],i8=[{channel:A.FIREBASE_FUNCTIONS_HTTP_REQUEST,triggerType:"http.request"},{channel:A.FIREBASE_FUNCTIONS_HTTP_CALL,triggerType:"http.call"},{channel:A.FIREBASE_FUNCTIONS_FIRESTORE_CREATED,triggerType:"firestore.document.created"},{channel:A.FIREBASE_FUNCTIONS_FIRESTORE_UPDATED,triggerType:"firestore.document.updated"},{channel:A.FIREBASE_FUNCTIONS_FIRESTORE_DELETED,triggerType:"firestore.document.deleted"},{channel:A.FIREBASE_FUNCTIONS_FIRESTORE_WRITTEN,triggerType:"firestore.document.written"},{channel:A.FIREBASE_FUNCTIONS_SCHEDULER,triggerType:"scheduler.scheduled"},{channel:A.FIREBASE_FUNCTIONS_STORAGE_FINALIZED,triggerType:"storage.object.finalized"},{channel:A.FIREBASE_FUNCTIONS_STORAGE_ARCHIVED,triggerType:"storage.object.archived"},{channel:A.FIREBASE_FUNCTIONS_STORAGE_DELETED,triggerType:"storage.object.deleted"},{channel:A.FIREBASE_FUNCTIONS_STORAGE_METADATA_UPDATED,triggerType:"storage.object.metadataUpdated"}],yg=()=>{};function dH(e){try{return e()}catch(t){$&&g.warn("[orchestrion:firebase] error handling channel event",t);return}}function mH(){for(let{channel:e,spanName:t,useParent:n}of r8)ee(aA.tracingChannel(e),r=>dH(()=>{let i=r.arguments[0];if(!i)return;let o=n&&i.parent||i;return cH(t,o)}));for(let{channel:e,triggerType:t}of i8)aA.tracingChannel(e).subscribe({start:n=>{dH(()=>uH(n,t))},end:yg,asyncStart:yg,asyncEnd:yg,error:yg})}var o8="Firebase",s8=(()=>({name:o8,setupOnce(){fH.tracingChannel&&ue(()=>{mH()})}})),gH=s8;function Mp(){return!!te.__SENTRY_ORCHESTRION__}function cA(){let{runtime:e,bundler:t}=te.__SENTRY_ORCHESTRION__??{};if(!e&&!t){g.warn("[Sentry] No diagnostics-channel injection detected. Channel-based integrations will not record spans. Make sure the diagnostics channels are injected via the runtime `--import` hook or a bundler plugin before the instrumented modules load.");return}g.log(e?`[Sentry] Runtime hook registered, injected libraries=${JSON.stringify(e)}`:"[Sentry] Runtime hook not registered"),g.log(t?`[Sentry] Bundler plugin ran, injected libraries=${JSON.stringify(t)}`:"[Sentry] Bundler plugin did not run")}import*as dc from"diagnostics_channel";var a8="RedisChannel",pA="auto.db.orchestrion.redis",bH="db.connection_string",uA="redis";function _H(e,t){t&&e.setStatus({code:2,message:t instanceof Error?t.message:String(t)}),e.end()}function yH(e,t,n,r,i){if(e)try{e(t,n,r,i)}catch{}}function c8(e){let t=e[0];return V(t)&&Object.getOwnPropertySymbols(t).length>0?e.slice(1):e}function l8(e){if(!(typeof e!="string"||!e))try{let t=new URL(e);return t.searchParams.delete("user_pwd"),t.username="",t.password="",t.href}catch{return}}function SH(e){return{[Pe]:uA,[Le]:e?.socket?.host,[xe]:e?.socket?.port,[bH]:l8(e?.url),[S]:pA}}function EH(e,t,n){return k({name:`redis-${e}`,kind:U.CLIENT,attributes:{...n,[B]:"db",[Ve]:zr(e,t)}})}function p8(e){let t=dc.tracingChannel(A.REDIS_COMMAND),n=()=>{};t.subscribe({end:n,asyncStart:n,asyncEnd:n,start(r){let i=r.arguments?.[0];if(!i||typeof i!="object")return;let o=i.callback;if(typeof o!="function")return;let s=r.self,c={[Pe]:uA,[S]:pA};c[Le]=s?.connection_options?.host,c[xe]=s?.connection_options?.port,s?.address&&(c[bH]=`redis://${s.address}`);let a=EH(i.command,i.args??[],c);r._sentrySpan=a;let l=Q();i.callback=function(p,u){p||yH(e,a,i.command,i.args??[],u),_H(a,p);let d=arguments;return se(l??null,()=>o.apply(this,d))}},error(r){let i=r._sentrySpan;i&&_H(i,r.error)}})}function hH(e,t,n){let r=dc.tracingChannel(e);ee(r,i=>{let o=t(i);if(!o?.length)return;let s=String(o[0]),c=i.self?.options;return EH(s,o.slice(1),SH(c))},{beforeSpanEnd(i,o){if("error"in o||!n)return;let s=t(o);s?.length&&yH(n,i,String(s[0]),s.slice(1),o.result)}})}function u8(e){let t=e.arguments?.[0];return Array.isArray(t)?t:void 0}function d8(e){let t=e.arguments?.[0],n=e.arguments?.[1];if(!(typeof t?.transformArguments!="function"||!Array.isArray(n)))try{return t.transformArguments(...c8(n))}catch{return}}function m8(){let e=dc.tracingChannel(A.NODE_REDIS_CONNECT);ee(e,t=>{let n=t.self?.options;return k({name:"redis-connect",kind:U.CLIENT,attributes:{...SH(n),[B]:"db"}})})}function lA(e,t){let n=dc.tracingChannel(e);ee(n,r=>{let i=r.arguments?.[0],o=Array.isArray(i)?i.length:void 0,s=r.self?.options?.socket;return k({name:t(r),kind:U.CLIENT,attributes:{[S]:pA,[B]:"db.redis",[mt]:uA,...o&&o>1?{[$s]:o}:{},...s?.host!=null?{[_t]:s.host}:{},...s?.port!=null?{[ht]:s.port}:{}}})})}var f8=((e={})=>{let t=e.responseHook;return{name:a8,setupOnce(){dc.tracingChannel&&($&&g.log(`[orchestrion:redis] subscribing to "${A.REDIS_COMMAND}" and node-redis channels`),p8(t),ue(()=>{hH(A.NODE_REDIS_COMMAND,u8,t),hH(A.NODE_REDIS_EXECUTOR,d8,t),m8(),lA(A.NODE_REDIS_MULTI,()=>"MULTI"),lA(A.NODE_REDIS_PIPELINE,()=>"PIPELINE"),lA(A.NODE_REDIS_BATCH,n=>n.arguments?.[2]!==void 0?"MULTI":"PIPELINE")}))}}}),dA=f8;var mA={postgresIntegration:AB,postgresJsIntegration:PB,mongoIntegration:iB,mysqlIntegration:lB,mysql2Integration:uB,genericPoolIntegration:oD,mongooseIntegration:cB,lruMemoizerIntegration:nB,openaiIntegration:fB,anthropicIntegration:WU,googleGenAIIntegration:lD,langChainIntegration:$D,langGraphIntegration:tB,vercelAiIntegration:XB,amqplibIntegration:BU,hapiIntegration:LD,koaIntegration:UD,expressIntegration:sH,graphqlIntegration:RD,kafkajsIntegration:KD,tediousIntegration:MB,awsIntegration:eD,firebaseIntegration:gH};var TH="Knex",g8=de(TH,()=>new Uf),_8=(()=>({name:TH,setupOnce(){Mp()?ZI().setupOnce?.():g8()}})),h8=_8;import{EventEmitter as b8}from"events";var IH="db.sql.table",AH="mssql";function NH(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}var vH=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};var y8="@sentry/instrumentation-tedious",OH=Symbol("opentelemetry.instrumentation-tedious.current-database"),RH=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function Sg(e){Object.defineProperty(this,OH,{value:e,writable:!0})}var CH=class xH extends ae{constructor(t={}){super(y8,q,t)}init(){return[new re(xH.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of RH)w(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r));return w(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of RH)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return Sg.call(this,this.config?.options?.database),this.removeListener("databaseChange",Sg),this.on("databaseChange",Sg),this.once("end",()=>{this.removeListener("databaseChange",Sg)}),t.apply(this,arguments)}}_patchQuery(t){return n=>{let r=this;function i(o){if(!(o instanceof b8))return r._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),n.apply(this,arguments);let s=0,c=0,a=()=>c++,l=()=>s++,p=this[OH],u=(h=>h.sqlTextOrProcedure==="sp_prepare"&&h.parametersByName?.stmt?.value?h.parametersByName.stmt.value:h.sqlTextOrProcedure)(o),d={[S]:"auto.db.otel.tedious",[Pe]:AH,[Et]:p,[Mt]:this.config?.userName??this.config?.authentication?.options?.userName,[Ve]:u,[IH]:o.table,[Le]:this.config?.server,[xe]:this.config?.options?.port},m=k({name:NH(t,p,u,o.table),kind:U.CLIENT,attributes:d}),_=vH(h=>{o.removeListener("done",a),o.removeListener("doneInProc",a),o.removeListener("doneProc",l),o.removeListener("error",_),this.removeListener("end",_),m.setAttribute("tedious.procedure_count",s),m.setAttribute("tedious.statement_count",c),h&&m.setStatus({code:2,message:h.message}),m.end()});return o.on("done",a),o.on("doneInProc",a),o.on("doneProc",l),o.once("error",_),this.on("end",_),typeof o.callback=="function"?r._wrap(o,"callback",r._patchCallbackQuery(_)):r._diag.error("Expected request.callback to be a function"),se(m,()=>n.apply(this,arguments))}return Object.defineProperty(i,"length",{value:n.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,i,o){return t(r),n.apply(this,arguments)}}};CH.COMPONENT="tedious";var PH=CH;var kH="Tedious",fA=de(kH,()=>new PH({})),S8=(()=>({name:kH,setupOnce(){fA()}})),gA=S8;var _A="generic-pool",E8="@sentry/instrumentation-generic-pool",Eg=class extends ae{constructor(t={}){super(E8,q,t),this._isDisabled=!1}init(){return[new re(_A,[">=3.0.0 <4"],t=>{let n=t.Pool;return w(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new re(_A,[">=2.4.0 <3"],t=>{let n=t.Pool;return w(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new re(_A,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,w(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){return function(...r){return Se({name:"generic-pool.acquire",attributes:{[S]:"auto.db.otel.generic_pool"}},()=>t.call(this,...r))}}_poolWrapper(t){let n=this._wrap.bind(this),r=this._acquireWithCallbacksPatcher.bind(this);return function(...o){let s=t.apply(this,o);return n(s,"acquire",r),s}}_acquireWithCallbacksPatcher(t){let n=()=>this._isDisabled;return function(i,o){return n()?t.call(this,i,o):ke({name:"generic-pool.acquire",attributes:{[S]:"auto.db.otel.generic_pool"}},s=>{t.call(this,(c,a)=>{c&&s.setStatus({code:2,message:"internal_error"}),s.end(),i&&i(c,a)},o)})}}};var LH="GenericPool",hA=de(LH,()=>new Eg({})),T8=(()=>({name:LH,setupOnce(){hA()}})),bA=T8;var SA="dataloader",I8="@sentry/instrumentation-dataloader",mc="auto.db.otel.dataloader";function A8(e){return e[Symbol.toStringTag]==="Module"}function MH(e){return A8(e)?e.default:e}function fc(e,t){let n=e.name;return n?`${SA}.${t} ${n}`:`${SA}.${t}`}function gc(e){if(e==="load"||e==="loadMany"||e==="batch")return"cache.get"}function yA(e){return Array.isArray(e)?e.map(t=>String(t)):e==null?void 0:[String(e)]}var Tg=class extends ae{constructor(t={}){super(I8,q,t)}init(){return[new re(SA,[">=2.0.0 <3"],t=>{let n=MH(t);return this._patchLoad(n.prototype),this._patchLoadMany(n.prototype),this._patchPrime(n.prototype),this._patchClear(n.prototype),this._patchClearAll(n.prototype),this._getPatchedConstructor(n)},t=>{let n=MH(t);["load","loadMany","prime","clear","clearAll"].forEach(r=>{w(n.prototype[r])&&this._unwrap(n.prototype,r)})})]}_wrapBatchLoadFn(t){let n=this;return function(...i){return n.isEnabled()?Se({name:fc(this,"batch"),links:this._batch?.spanLinks,attributes:{[S]:mc,[B]:gc("batch"),[qs]:yA(i[0])},onlyIfParent:!0},()=>t.apply(this,i)):t.call(this,...i)}}_getPatchedConstructor(t){let n=this,r=t.prototype;if(!n.isEnabled())return t;function i(...o){return typeof o[0]=="function"&&(w(o[0])&&n._unwrap(o,0),o[0]=n._wrapBatchLoadFn(o[0])),t.apply(this,o)}return i.prototype=r,i}_patchLoad(t){w(t.load)&&this._unwrap(t,"load"),this._wrap(t,"load",this._getPatchedLoad.bind(this))}_getPatchedLoad(t){return function(...r){return Se({name:fc(this,"load"),kind:U.CLIENT,attributes:{[S]:mc,[B]:gc("load"),[qs]:yA(r[0])},onlyIfParent:!0},i=>{let o=t.call(this,...r);return this._batch&&i.isRecording()&&(this._batch.spanLinks||(this._batch.spanLinks=[]),this._batch.spanLinks.push({context:i.spanContext()})),o})}}_patchLoadMany(t){w(t.loadMany)&&this._unwrap(t,"loadMany"),this._wrap(t,"loadMany",this._getPatchedLoadMany.bind(this))}_getPatchedLoadMany(t){return function(...r){return Se({name:fc(this,"loadMany"),kind:U.CLIENT,attributes:{[S]:mc,[B]:gc("loadMany"),[qs]:yA(r[0])},onlyIfParent:!0},()=>t.call(this,...r))}}_patchPrime(t){w(t.prime)&&this._unwrap(t,"prime"),this._wrap(t,"prime",this._getPatchedPrime.bind(this))}_getPatchedPrime(t){return function(...r){return Se({name:fc(this,"prime"),kind:U.CLIENT,attributes:{[S]:mc,[B]:gc("prime")},onlyIfParent:!0},()=>t.call(this,...r))}}_patchClear(t){w(t.clear)&&this._unwrap(t,"clear"),this._wrap(t,"clear",this._getPatchedClear.bind(this))}_getPatchedClear(t){return function(...r){return Se({name:fc(this,"clear"),kind:U.CLIENT,attributes:{[S]:mc,[B]:gc("clear")},onlyIfParent:!0},()=>t.call(this,...r))}}_patchClearAll(t){w(t.clearAll)&&this._unwrap(t,"clearAll"),this._wrap(t,"clearAll",this._getPatchedClearAll.bind(this))}_getPatchedClearAll(t){return function(...r){return Se({name:fc(this,"clearAll"),kind:U.CLIENT,attributes:{[S]:mc,[B]:gc("clearAll")},onlyIfParent:!0},()=>t.call(this,...r))}}};var wH="Dataloader",N8=de(wH,()=>new Tg),v8=(()=>({name:wH,setupOnce(){Mp()?OI().setupOnce?.():N8()}})),R8=v8;var pn=(e=>(e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout",e))(pn||{});at();var GH="messaging.operation",EA="messaging.destination",TA="messaging.destination_kind",IA="messaging.rabbitmq.routing_key",AA="messaging.protocol",UH="messaging.protocol_version",DH="messaging.url",NA="messaging.message_id",vA="messaging.conversation_id",RA="topic",BH="process";var O8="auto.amqplib.otel.publisher",C8="auto.amqplib.otel.consumer",Ig=Symbol("opentelemetry.amqplib.message.stored-span"),So=Symbol("opentelemetry.amqplib.channel.spans-not-ended"),Ag=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer"),Ng=Symbol("opentelemetry.amqplib.connection.attributes"),vg=Symbol("sentry.amqplib.channel.is-confirm-publishing"),x8=e=>e!==""?e:"<default>",P8=e=>e.replace(/:[^:@/]*@/,":***@"),HH=(e,t)=>e||(t==="AMQP"?5672:5671),FH=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},WH=e=>e||"localhost",VH=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[wt]:t}:{}},YH=e=>{let t={[UH]:"0.9.1"},n=e||"amqp://localhost";if(typeof n=="object"){let r=n,i=FH(r?.protocol);t[AA]=i,t[Le]=WH(r?.hostname),t[xe]=HH(r.port,i)}else{let r=P8(n);t[DH]=r;try{let i=new URL(r),o=FH(i.protocol);t[AA]=o,t[Le]=WH(i.hostname),t[xe]=HH(i.port?parseInt(i.port):void 0,o)}catch{}}return t};function OA(e,t){let n=e?.[t];if(n!=null)return Array.isArray(n)?String(n[0]):String(n)}function CA(e,t,n,r){let i=x8(e),o=k({name:`publish ${i}`,kind:vt.PRODUCER,attributes:{...n.connection[Ng],[EA]:e,[TA]:RA,[IA]:t,[NA]:r?.messageId,[vA]:r?.correlationId,[S]:O8}}),s=r??{};s.headers=s.headers??{};let c=$e({span:o});return c["sentry-trace"]&&(s.headers["sentry-trace"]=c["sentry-trace"]),c.baggage&&(s.headers.baggage=c.baggage),{span:o,modifiedOptions:s}}function jH(e,t,n){return k({name:`${e} process`,kind:vt.CONSUMER,attributes:{...n?.connection?.[Ng],[EA]:t.fields?.exchange,[TA]:RA,[IA]:t.fields?.routingKey,[GH]:BH,[NA]:t?.properties.messageId,[vA]:t?.properties.correlationId,[S]:C8}})}var ZH=1e3*60;function wp(e,t,n,r){let i=e[Ig];i&&(t!==!1&&i.setStatus({code:2,message:n!==pn.ChannelClosed&&n!==pn.ChannelError?`${n} called on message${r===!0?" with requeue":r===!1?" without requeue":""}`:n}),i.end(),e[Ig]=void 0)}function xA(e,t,n,r){(e[So]??[]).forEach(o=>{wp(o.msg,t,n,r)}),e[So]=[]}function k8(e){let t=lt(),n=e[So]??[],r;for(r=0;r<n.length;r++){let i=n[r];if((t-i.timeOfConsume)*1e3<ZH)break;wp(i.msg,null,pn.InstrumentationTimeout,!0)}n.splice(0,r)}function XH(e){return function(n,r,i){return e.call(this,n,r,function(o,s){if(o==null){let c=YH(n),a=VH(s);s[Ng]={...c,...a}}i.apply(this,arguments)})}}function KH(e){return function(n){if(n==="close"){xA(this,!0,pn.ChannelClosed,void 0);let r=this[Ag];r&&clearInterval(r),this[Ag]=void 0}else n==="error"&&xA(this,!0,pn.ChannelError,void 0);return e.apply(this,arguments)}}function PA(e,t){return n=>function(i){return xA(this,e,t,i),n.apply(this,arguments)}}function Rg(e,t){return n=>function(i,o,s){let c=this,a=t===pn.Reject?o:s,l=c[So]??[],p=l.findIndex(u=>u.msg===i);if(p<0)wp(i,e,t,a);else if(t!==pn.Reject&&o){for(let u=0;u<=p;u++)wp(l[u].msg,e,t,a);l.splice(0,p+1)}else wp(i,e,t,a),l.splice(p,1);return n.apply(this,arguments)}}function qH(e){return function(n,r,i){let o=this;if(!Object.prototype.hasOwnProperty.call(o,So)){let a=setInterval(()=>{k8(o)},ZH);a.unref(),o[Ag]=a,o[So]=[]}let s=function(a){if(!a)return r.call(this,a);let l=a.properties.headers??{},p=OA(l,"sentry-trace"),u=OA(l,"baggage");An({sentryTrace:p,baggage:u},()=>{let d=jH(n,a,o);i?.noAck||(o[So].push({msg:a,timeOfConsume:lt()}),a[Ig]=d),se(d,()=>{r.call(this,a)}),i?.noAck&&d.end()})},c=Array.prototype.slice.call(arguments);return c[1]=s,e.apply(this,c)}}function QH(e){return function(n,r,i,o,s){let c=this,{span:a,modifiedOptions:l}=CA(n,r,c,o),p=function(d,m){try{se(a,()=>{s?.call(this,d,m)})}finally{d&&a.setStatus({code:2,message:"message confirmation has been nack'ed"}),a.end()}},u=[...arguments];u[3]=l,u[4]=p,c[vg]=!0;try{return e.apply(this,u)}finally{c[vg]=!1}}}function JH(e){return function(n,r,i,o){if(this[vg])return e.apply(this,arguments);let s=this,{span:c,modifiedOptions:a}=CA(n,r,s,o),l=[...arguments];l[3]=a;let p=e.apply(this,l);return c.end(),p}}var L8="@sentry/instrumentation-amqplib",Og=[">=0.5.5 <2"],Cg=class extends ae{constructor(t={}){super(L8,q,t)}init(){let t=new Ae("amqplib/lib/channel_model.js",Og,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Ae("amqplib/lib/callback_model.js",Og,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Ae("amqplib/lib/connect.js",Og,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new re("amqplib",Og,void 0,void 0,[t,r,n])}patchConnect(t){let n=this.unpatchConnect(t);return w(n.connect)||this._wrap(n,"connect",XH),n}unpatchConnect(t){return w(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t){return w(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",JH),w(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",qH),w(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",Rg(!1,pn.Ack)),w(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",Rg(!0,pn.Nack)),w(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",Rg(!0,pn.Reject)),w(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",PA(!1,pn.AckAll)),w(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",PA(!0,pn.NackAll)),w(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",KH),w(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",QH),t}unpatchChannelModel(t){return w(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),w(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),w(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),w(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),w(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),w(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),w(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),w(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),w(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}};var $H="Amqplib",kA=de($H,()=>new Cg),M8=(()=>({name:$H,setupOnce(){kA()}})),LA=M8;var xg="VercelAI";var w8=[">=3.0.0 <7"],zH=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];function G8(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function U8(e){if(typeof e!="object"||e===null||!("content"in e)||typeof e.consumeStream=="function")return;let t=e;Array.isArray(t.content)&&(D8(t.content),B8(t.content))}function D8(e){for(let t of e){if(!G8(t))continue;let n=qb(t.toolCallId);n?Be(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),me(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):Be(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),me(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function B8(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&Qb(t.toolCallId)}function H8(e,t,n,r,i){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,s=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:i;return{recordInputs:o,recordOutputs:s}}var Pg=class extends ae{constructor(t={}){super("@sentry/instrumentation-vercel-ai",q,t),this._isPatched=!1,this._callbacks=[]}init(){return new re("ai",w8,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(i,o,s)=>{let c=s[0].experimental_telemetry||{},a=c.isEnabled,l=C(),p=l?.getIntegrationByName(xg),u=p?.options,d=p?l?.getDataCollectionOptions().genAI:void 0,{recordInputs:m,recordOutputs:_}=H8(u,c,a,!!d?.inputs,!!d?.outputs);return s[0].experimental_telemetry={...c,isEnabled:a!==void 0?a:!0,recordInputs:m,recordOutputs:_},sr(()=>Reflect.apply(i,o,s),h=>{h&&typeof h=="object"&&we(h,"_sentry_active_span",Q())},()=>{},h=>{U8(h)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of zH)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=zH.reduce((i,o)=>(t[o]!=null&&(i[o]=n(t[o])),i),{});return{...t,...r}}}};var MA=de(xg,()=>new Pg({}));function F8(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var W8=((e={})=>{let t,n=pp(e);return Ut(n,{options:e,setupOnce(){t=MA()},afterAllSetup(r){e.force??F8(r)?ad(r):t?.callWhenPatched(()=>ad(r))}})}),wA=W8;var V8=[">=4.0.0 <8"],kg=class extends ae{constructor(t={}){super("@sentry/instrumentation-openai",q,t)}init(){return new re("openai",V8,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let i=this.getConfig(),o=function(...s){if(Cn(Yr))return Reflect.construct(r,s);let c=Reflect.construct(r,s);return ud(c,i)};Object.setPrototypeOf(o,r),Object.setPrototypeOf(o.prototype,r.prototype);for(let s of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(s)){let c=Object.getOwnPropertyDescriptor(r,s);c&&Object.defineProperty(o,s,c)}try{t[n]=o}catch{Object.defineProperty(t,n,{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}};var GA=de(Yr,e=>new kg(e)),Y8=((e={})=>({name:Yr,setupOnce(){GA(e)}})),UA=Y8;var j8=[">=0.19.2 <1.0.0"],Lg=class extends ae{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",q,t)}init(){return new re("@anthropic-ai/sdk",j8,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),i=function(...o){if(Cn(jr))return Reflect.construct(n,o);let s=Reflect.construct(n,o);return gd(s,r)};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let o of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(o)){let s=Object.getOwnPropertyDescriptor(n,o);s&&Object.defineProperty(i,o,s)}try{t.Anthropic=i}catch{Object.defineProperty(t,"Anthropic",{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}};var DA=de(jr,e=>new Lg(e)),Z8=((e={})=>({name:jr,options:e,setupOnce(){DA(e)}})),BA=Z8;var eF=[">=0.10.0 <2"],Mg=class extends ae{constructor(t={}){super("@sentry/instrumentation-google-genai",q,t)}init(){return new re("@google/genai",eF,n=>this._patch(n),n=>n,[new Ae("@google/genai/dist/node/index.cjs",eF,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let i=function(...o){if(Cn(Zr))return Reflect.construct(n,o);let s=Reflect.construct(n,o);return bd(s,r)};Object.setPrototypeOf(i,n),Object.setPrototypeOf(i.prototype,n.prototype);for(let o of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(o)){let s=Object.getOwnPropertyDescriptor(n,o);s&&Object.defineProperty(i,o,s)}return Rl(t,"GoogleGenAI",i),t}};var HA=de(Zr,e=>new Mg(e)),X8=((e={})=>({name:Zr,setupOnce(){HA(e)}})),FA=X8;var wg=[">=0.1.0 <2.0.0"];function K8(e,t,n){return new Proxy(e,{apply(r,i,o){let c=o[1];return(!c||typeof c!="object"||Array.isArray(c))&&(c={},o[1]=c),c.callbacks=es(c.callbacks,t),Reflect.apply(r,i,o)}})}var Gg=class extends ae{constructor(t={}){super("@sentry/instrumentation-langchain",q,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new re(r,wg,this._patch.bind(this),i=>i,[new Ae(`${r}/dist/index.cjs`,wg,this._patch.bind(this),i=>i)]));return t.push(new re("langchain",wg,this._patch.bind(this),r=>r,[new Ae("langchain/dist/chat_models/universal.cjs",wg,this._patch.bind(this),r=>r)])),t}_patch(t){Ti([Yr,jr,Zr]);let n=this.getConfig(),r=mr(n);return this._patchRunnableMethods(t,r),this._patchEmbeddingsMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],i=t.universal_exports??t,o=Object.values(i).find(a=>typeof a=="function"&&r.includes(a.name));if(!o)return;let s=o.prototype;if(s.__sentry_patched__)return;s.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let a of c){let l=s[a];typeof l=="function"&&(s[a]=K8(l,n))}}_patchEmbeddingsMethods(t,n){let r=t.universal_exports??t;for(let i of Object.values(r)){if(typeof i!="function"||!i.prototype)continue;let o=i.prototype;typeof o.embedQuery!="function"||typeof o.embedDocuments!="function"||o.__sentry_patched__||(o.__sentry_patched__=!0,Ed(o,n))}}};var WA=de(Ta,e=>new Gg(e)),q8=((e={})=>({name:Ta,setupOnce(){WA(e)}})),VA=q8;var Gp=[">=0.0.0 <2.0.0"],Ug=class extends ae{constructor(t={}){super("@sentry/instrumentation-langgraph",q,t)}init(){return[new re("@langchain/langgraph",Gp,this._patch.bind(this),t=>t,[new Ae("@langchain/langgraph/dist/index.cjs",Gp,this._patch.bind(this),t=>t),new Ae("@langchain/langgraph/dist/prebuilt/index.cjs",Gp,this._patch.bind(this),t=>t)]),new re("@langchain/langgraph/prebuilt",Gp,this._patch.bind(this),t=>t,[new Ae("@langchain/langgraph/dist/prebuilt/index.cjs",Gp,this._patch.bind(this),t=>t)])]}_patch(t){let r=C()?.getDataCollectionOptions().genAI,i={...this.getConfig(),recordInputs:this.getConfig().recordInputs??r?.inputs??!1,recordOutputs:this.getConfig().recordOutputs??r?.outputs??!1};if(t.StateGraph&&typeof t.StateGraph=="function"&&Al(t.StateGraph.prototype,i),t.createReactAgent&&typeof t.createReactAgent=="function"){let o=t.createReactAgent;Object.defineProperty(t,"createReactAgent",{value:iy(o,i),writable:!0,enumerable:!0,configurable:!0})}return t}};var YA=de(Na,e=>new Ug(e)),Q8=((e={})=>({name:Na,setupOnce(){YA(e)}})),jA=Q8;var J8=e=>(It()||Me(()=>{console.warn("The launchDarklyIntegration() can only be used in the browser.")}),{name:"LaunchDarkly"});function $8(){return It()||Me(()=>{console.warn("The buildLaunchDarklyFlagUsedHandler() can only be used in the browser.")}),{name:"sentry-flag-auditor",type:"flag-used",synchronous:!0,method:()=>null}}var z8=e=>(It()||Me(()=>{console.warn("The openFeatureIntegration() can only be used in the browser.")}),{name:"OpenFeature"}),ZA=class{constructor(){It()||Me(()=>{console.warn("The OpenFeatureIntegrationHook can only be used in the browser.")})}after(){}error(){}};var eee=e=>(It()||Me(()=>{console.warn("The statsigIntegration() can only be used in the browser.")}),{name:"Statsig"});var tee=e=>(It()||Me(()=>{console.warn("The unleashIntegration() can only be used in the browser.")}),{name:"Unleash"});var nee=Pb;import*as nF from"net";function rF(e,t,n){let r=new re("@firebase/firestore",e,o=>tF(o,t,n)),i=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let o of i)r.files.push(new Ae(o,e,s=>tF(s,t,n),s=>iF(s,n)));return r}function tF(e,t,n){return iF(e,n),t(e,"addDoc",ree()),t(e,"getDocs",oee()),t(e,"setDoc",see()),t(e,"deleteDoc",iee()),e}function iF(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])w(e[n])&&t(e,n);return e}function ree(){return function(t){return function(n,r){return Dg("addDoc",n,()=>t(n,r))}}}function iee(){return function(t){return function(n){return Dg("deleteDoc",n.parent||n,()=>t(n))}}}function oee(){return function(t){return function(n){return Dg("getDocs",n,()=>t(n))}}}function see(){return function(t){return function(n,r,i){return Dg("setDoc",n.parent||n,()=>typeof i<"u"?t(n,r,i):t(n,r))}}}function Dg(e,t,n){return Se({name:`${e} ${t.path}`,op:"db.query",kind:U.CLIENT,attributes:{[S]:"auto.firebase.otel.firestore",[ar]:e,...cee(t)}},n)}function aee(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(nF.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function cee(e){let t=e.firestore.app,n=t.options,i=(e.firestore.toJSON()||{}).settings||{},o={[Qs]:e.path,[fi]:t.name,[mt]:"firebase.firestore","firebase.firestore.type":e.type,"firebase.firestore.options.projectId":n.projectId,"firebase.firestore.options.appId":n.appId,"firebase.firestore.options.messagingSenderId":n.messagingSenderId,"firebase.firestore.options.storageBucket":n.storageBucket},{address:s,port:c}=aee(i);return s&&(o[_t]=s),c&&(o[ht]=c),o}function oF(e,t,n){let r=new re("firebase-functions",e);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:o,triggerType:s})=>{r.files.push(new Ae(o,e,c=>lee(c,t,n,s),c=>sF(c,n)))}),r}function un(e){return function(n){return function(...r){let i=typeof r[0]=="function"?r[0]:r[1],o=typeof r[0]=="function"?void 0:r[0];if(!i)return n.call(this,...r);let s=async function(...c){let a=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",l={[S]:"auto.firebase.otel.functions","faas.name":a,"faas.trigger":e,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(l["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(l["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),ke({name:`firebase.function.${e}`,op:"http.request",kind:U.SERVER,attributes:l},async p=>{try{let u=await i.apply(this,c);return p.end(),u}catch(u){throw p.setStatus({code:2}),me(u,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),p.end(),await Yo(2e3),u}})};return o?n.call(this,o,s):n.call(this,s)}}}function lee(e,t,n,r){switch(sF(e,n),r){case"function":t(e,"onRequest",un("http.request")),t(e,"onCall",un("http.call"));break;case"firestore":t(e,"onDocumentCreated",un("firestore.document.created")),t(e,"onDocumentUpdated",un("firestore.document.updated")),t(e,"onDocumentDeleted",un("firestore.document.deleted")),t(e,"onDocumentWritten",un("firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",un("firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",un("firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",un("firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",un("firestore.document.written"));break;case"scheduler":t(e,"onSchedule",un("scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",un("storage.object.finalized")),t(e,"onObjectArchived",un("storage.object.archived")),t(e,"onObjectDeleted",un("storage.object.deleted")),t(e,"onObjectMetadataUpdated",un("storage.object.metadataUpdated"));break}return e}function sF(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)w(e[r])&&t(e,r);return e}var pee=[">=3.0.0 <5"],uee=[">=6.0.0 <7"],Bg=class extends ae{constructor(t={}){super("@sentry/instrumentation-firebase",q,t)}init(){let t=[];return t.push(rF(pee,this._wrap,this._unwrap)),t.push(oF(uee,this._wrap,this._unwrap)),t}};var aF="Firebase",XA=de(aF,()=>new Bg),dee=(()=>({name:aF,setupOnce(){XA()}})),KA=dee;function qA(){return[tE(),wE(),WE(),xT(),eT(),nT(),iT(),cT(),_T(),TT(),Qm(),OT(),LT(),wT(),gA(),bA(),qE(),LA(),JE(),VA(),jA(),wA(),UA(),BA(),FA(),vT(),KA()]}function cF(){return[pM,eE,MT,ME,Pf,CT,KE,kT,QE,zE,tT,rT,aT,ET,Pf,FE,gT,fA,hA,kA,WA,MA,GA,NT,XA,DA,HA,YA]}at();var QA=1e6,Hg=Symbol.for("opentelemetry.js.api.1");function lF(e){if(he.setGlobalTracerProvider(e))return!0;let t=globalThis,n=t[Hg];if(n&&!n.trace){if(Ye&&g.warn("Replaced a pre-existing OpenTelemetry API registry that was created by a different @opentelemetry/api version and would have blocked tracing. If you want to manage OpenTelemetry yourself, set `skipOpenTelemetrySetup: true` in `Sentry.init()`."),t[Hg]=void 0,!he.setGlobalTracerProvider(e))return!1;let r=t[Hg];if(r){let{propagation:i,context:o,...s}=n;t[Hg]={...s,...r}}return!0}return!1}function JA(e,t={}){e.getOptions().debug&&MS();let[n,r]=gee(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function mee(e={}){let{debug:t}=e;t&&g.enable(),tp(),fee(e.integrations).forEach(n=>{n(),t&&g.log(`[Sentry] Preloaded ${n.id} instrumentation`)})}function fee(e){let t=cF();return e?t.filter(n=>{let r=n.id;return e.some(i=>r===i||r.startsWith(`${i}.`))}):t}function gee(e,t={}){if(!(e.getOptions().openTelemetryBasicTracerProvider||!!t.spanProcessors?.length))return _ee(e);let r=new JN({sampler:new Xl(e),resource:pm("node"),forceFlushTimeoutMillis:500,spanProcessors:[new Zl({timeout:hee(e.getOptions().maxSpanWaitDuration),client:e}),...t.spanProcessors||[]]});lF(r),ci.setGlobalPropagator(new Ya);let i=new ql;return pe.setGlobalContextManager(i),[r,i.getAsyncLocalStorageLookup()]}function _ee(e){let t=new Kl({resource:pm("node")});if(!lF(t))return Ye&&g.warn("Could not register SentryTracerProvider because another OpenTelemetry tracer provider is already registered."),[void 0,void 0];cs("SentryTracerProvider"),ci.setGlobalPropagator(new Ya);let n=new ql;return pe.setGlobalContextManager(n),e.on("spanEnd",r=>{lm(r,{finalizeStatus:!0})}),rt(e)&&e.on("preprocessSpan",cm),e.on("preprocessEvent",r=>{r.type==="transaction"&&(r.contexts={...r.contexts,otel:{resource:t.resource?.attributes,...r.contexts?.otel}})}),[t,n.getAsyncLocalStorageLookup()]}function hee(e){if(e!=null){if(e>QA)return Ye&&g.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${QA}`),QA;if(e<=0||Number.isNaN(e)){Ye&&g.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}function pF(){return km().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(QS(),JS())}function uF(e){return[...pF(),...Ue(e)?qA():[]]}function bee(e,t){if(za()&&Ue(t)){let n=lT();if(n){let r=new Set(n.replacedOtelIntegrationNames);return[...e.filter(i=>!r.has(i.name)),...n.integrations]}}return e}function yee(e={}){return dF(e,uF)}function dF(e={},t){Ko(e,"node");let n=za()&&Ue(e)?lT():void 0;n&&n.register();let r=e.defaultIntegrations??t(e);if(n&&Array.isArray(r)&&r.length>0){let o=new Set(n.replacedOtelIntegrationNames);r=[...r.filter(s=>!o.has(s.name)),...n.integrations]}let i=VS({...e,defaultIntegrations:r});return i&&!e.skipOpenTelemetrySetup&&(JA(i,{spanProcessors:e.openTelemetrySpanProcessors}),Lm()),n&&n.detect(),i}function See(e={}){return dF(e,()=>[])}import*as vte from"module";import"url";import{isMainThread as Rte,parentPort as Ote}from"worker_threads";var Up=[...DT,...BT,...HT,...FT,...WT,...VT,...YT,...ZT,...XT,...KT,...qT,...QT,...JT,...$T,...eI,...tI,...nI,...rI,...iI,...oI,...sI,...aI,...cI,...lI,...pI,...uI,...dI,...mI,...fI],E2e=[...cG,...pG,...dG,...fG,..._G,...bG,...SG,...TG,...AG,...vG,...OG,...xG,...LG,...wG,...BG,...WG,...YG,...ZG,...QG,...$G,...eU,...nU,...iU,...sU,...cU,...pU,...dU,...fU,..._U];function Eee(e=[]){return[...tl([...Up,...e].map(t=>t.module.name)),"@remix-run/node"]}var T2e=Eee();function Eo(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fF=Tee;function Tee(e,t){let[n]=gF(e,"");for(let r of Aee(t))if(Iee(r,n))return!0;return!1}function Iee(e,t){for(let[n,r]of e)if(!Ree(t,r,n))return!1;return!0}function mF(e){return e==="latest"&&(e=">=0"),e.match(/^([^\d+]*)(\d.*)$/)||[null,"","*.*.*"]}function Aee(e){let t=[],n=[],r=e.trim().split(/\s+/);for(let i=0;i<r.length;i++){let o=r[i];if(o==="-")continue;if(o==="||"){t.push(n),n=[];continue}if(/^[<>=~v^]+$/.test(o)&&i+1<r.length){r[i+1]=o+r[i+1];continue}let s=mF(o),c=s[1]||"=";c.endsWith("v")&&(c=c.slice(0,-1));let[a,l]=gF(s[2],c);if(i+2<r.length&&r[i+1]==="-"){let p=mF(r[i+2]);r[i+2]="<="+(p[2].indexOf("-")===-1?p[2]+".*.*":p[2]),l=">="}if(l[0]==="~"){let p=s[2].split("-")[0].split(".").length;n.push([">=",a]),n.push(["<",p===1?_c(a,0):_c(a,1)])}else if(l[0]==="^"){let p=a[0]!==0?0:a[1]!==0?1:2;n.push([">=",a]),n.push(["<",p===0?_c(a,0):p===1?_c(a,1):_c(a,2)])}else n.push([l.replace("~","").replace("^",""),a])}return n.length&&t.push(n),t}function _c(e,t){let n=e.slice(0);if(e[t]===-1)return n;for(n[t++]++;t<3;t++)n[t]=0;return n}function Nee(e){return e==="x"||e==="X"||e==="*"||e==="latest"?-1:Number(e)}function vee(e){return/^\d+$/.test(e)?Number(e):e}function To(e,t,n){return n===-1?e!=="<":e==="="?t===n:e===">"?t>n:e===">="?t>=n:e==="<"?t<n:e==="<="?t<=n:!1}function gF(e,t){e=e.split("+")[0];let[n,r]=e.split("-"),i=n.split(".").map(Nee).slice(0,3),o=Math.max(i.length-1,0);return t===">"?(t=">=",i.push(0,0,0),i[o]++):t===""?i.push(0,0,0):i.push(-1,-1,-1),r?[i.slice(0,3).concat(r.split(".").map(vee)),t]:[i.slice(0,3),t]}function Ree(e,t,n){if(!To("=",e[0],t[0]))return To(n,e[0],t[0]);if(!To("=",e[1],t[1]))return To(n,e[1],t[1]);if(!To("=",e[2],t[2])||e.length===3&&t.length===3)return To(n,e[2],t[2]);if(n[0]==="<"&&(t.length===3||e.length===3))return!1;if(n[0]===">"){if(e.length===3)return!0;if(t.length===3)return!1}for(let r=3;r<Math.max(e.length,t.length);r++)if(To(n,e[r]||"",t[r]||""))return!0;return!1}function zA(e,t){(t==null||t>e.length)&&(t=e.length);for(var n=0,r=Array(t);n<t;n++)r[n]=e[n];return r}function tN(e,t){return(function(n){if(Array.isArray(n))return n})(e)||(function(n,r){var i=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(i!=null){var o,s,c,a,l=[],p=!0,u=!1;try{if(c=(i=i.call(n)).next,r!==0)for(;!(p=(o=c.call(i)).done)&&(l.push(o.value),l.length!==r);p=!0);}catch(d){u=!0,s=d}finally{try{if(!p&&i.return!=null&&(a=i.return(),Object(a)!==a))return}finally{if(u)throw s}}return l}})(e,t)||SF(e,t)||(function(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
|
|
35
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Oee(e){return(function(t){if(Array.isArray(t))return zA(t)})(e)||(function(t){if(typeof Symbol<"u"&&t[Symbol.iterator]!=null||t["@@iterator"]!=null)return Array.from(t)})(e)||SF(e)||(function(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
|
|
36
|
+
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)})()}function Dp(e){return(Dp=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function(t){return typeof t}:function(t){return t&&typeof Symbol=="function"&&t.constructor===Symbol&&t!==Symbol.prototype?"symbol":typeof t})(e)}function SF(e,t){if(e){if(typeof e=="string")return zA(e,t);var n={}.toString.call(e).slice(8,-1);return n==="Object"&&e.constructor&&(n=e.constructor.name),n==="Map"||n==="Set"?Array.from(e):n==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)?zA(e,t):void 0}}function EF(e,t){return e(t={exports:{}},t.exports),t.exports}var Fg=EF((function(e,t){(function n(r){var i,o,s,c,a,l;function p(R){var v,P,D={};for(v in R)R.hasOwnProperty(v)&&(P=R[v],D[v]=typeof P=="object"&&P!==null?p(P):P);return D}function u(R,v){this.parent=R,this.key=v}function d(R,v,P,D){this.node=R,this.path=v,this.wrap=P,this.ref=D}function m(){}function _(R){return R!=null&&typeof R=="object"&&typeof R.type=="string"}function h(R,v){return(R===i.ObjectExpression||R===i.ObjectPattern)&&v==="properties"}function b(R,v){for(var P=R.length-1;P>=0;--P)if(R[P].node===v)return!0;return!1}function N(R,v){return new m().traverse(R,v)}function M(R,v){var P;return P=(function(D,I){var H,L,G,ce;for(L=D.length,G=0;L;)I(D[ce=G+(H=L>>>1)])?L=H:(G=ce+1,L-=H+1);return G})(v,(function(D){return D.range[0]>R.range[0]})),R.extendedRange=[R.range[0],R.range[1]],P!==v.length&&(R.extendedRange[1]=v[P].range[0]),(P-=1)>=0&&(R.extendedRange[0]=v[P].range[1]),R}return i={AssignmentExpression:"AssignmentExpression",AssignmentPattern:"AssignmentPattern",ArrayExpression:"ArrayExpression",ArrayPattern:"ArrayPattern",ArrowFunctionExpression:"ArrowFunctionExpression",AwaitExpression:"AwaitExpression",BlockStatement:"BlockStatement",BinaryExpression:"BinaryExpression",BreakStatement:"BreakStatement",CallExpression:"CallExpression",CatchClause:"CatchClause",ChainExpression:"ChainExpression",ClassBody:"ClassBody",ClassDeclaration:"ClassDeclaration",ClassExpression:"ClassExpression",ComprehensionBlock:"ComprehensionBlock",ComprehensionExpression:"ComprehensionExpression",ConditionalExpression:"ConditionalExpression",ContinueStatement:"ContinueStatement",DebuggerStatement:"DebuggerStatement",DirectiveStatement:"DirectiveStatement",DoWhileStatement:"DoWhileStatement",EmptyStatement:"EmptyStatement",ExportAllDeclaration:"ExportAllDeclaration",ExportDefaultDeclaration:"ExportDefaultDeclaration",ExportNamedDeclaration:"ExportNamedDeclaration",ExportSpecifier:"ExportSpecifier",ExpressionStatement:"ExpressionStatement",ForStatement:"ForStatement",ForInStatement:"ForInStatement",ForOfStatement:"ForOfStatement",FunctionDeclaration:"FunctionDeclaration",FunctionExpression:"FunctionExpression",GeneratorExpression:"GeneratorExpression",Identifier:"Identifier",IfStatement:"IfStatement",ImportExpression:"ImportExpression",ImportDeclaration:"ImportDeclaration",ImportDefaultSpecifier:"ImportDefaultSpecifier",ImportNamespaceSpecifier:"ImportNamespaceSpecifier",ImportSpecifier:"ImportSpecifier",Literal:"Literal",LabeledStatement:"LabeledStatement",LogicalExpression:"LogicalExpression",MemberExpression:"MemberExpression",MetaProperty:"MetaProperty",MethodDefinition:"MethodDefinition",ModuleSpecifier:"ModuleSpecifier",NewExpression:"NewExpression",ObjectExpression:"ObjectExpression",ObjectPattern:"ObjectPattern",PrivateIdentifier:"PrivateIdentifier",Program:"Program",Property:"Property",PropertyDefinition:"PropertyDefinition",RestElement:"RestElement",ReturnStatement:"ReturnStatement",SequenceExpression:"SequenceExpression",SpreadElement:"SpreadElement",Super:"Super",SwitchStatement:"SwitchStatement",SwitchCase:"SwitchCase",TaggedTemplateExpression:"TaggedTemplateExpression",TemplateElement:"TemplateElement",TemplateLiteral:"TemplateLiteral",ThisExpression:"ThisExpression",ThrowStatement:"ThrowStatement",TryStatement:"TryStatement",UnaryExpression:"UnaryExpression",UpdateExpression:"UpdateExpression",VariableDeclaration:"VariableDeclaration",VariableDeclarator:"VariableDeclarator",WhileStatement:"WhileStatement",WithStatement:"WithStatement",YieldExpression:"YieldExpression"},s={AssignmentExpression:["left","right"],AssignmentPattern:["left","right"],ArrayExpression:["elements"],ArrayPattern:["elements"],ArrowFunctionExpression:["params","body"],AwaitExpression:["argument"],BlockStatement:["body"],BinaryExpression:["left","right"],BreakStatement:["label"],CallExpression:["callee","arguments"],CatchClause:["param","body"],ChainExpression:["expression"],ClassBody:["body"],ClassDeclaration:["id","superClass","body"],ClassExpression:["id","superClass","body"],ComprehensionBlock:["left","right"],ComprehensionExpression:["blocks","filter","body"],ConditionalExpression:["test","consequent","alternate"],ContinueStatement:["label"],DebuggerStatement:[],DirectiveStatement:[],DoWhileStatement:["body","test"],EmptyStatement:[],ExportAllDeclaration:["source"],ExportDefaultDeclaration:["declaration"],ExportNamedDeclaration:["declaration","specifiers","source"],ExportSpecifier:["exported","local"],ExpressionStatement:["expression"],ForStatement:["init","test","update","body"],ForInStatement:["left","right","body"],ForOfStatement:["left","right","body"],FunctionDeclaration:["id","params","body"],FunctionExpression:["id","params","body"],GeneratorExpression:["blocks","filter","body"],Identifier:[],IfStatement:["test","consequent","alternate"],ImportExpression:["source"],ImportDeclaration:["specifiers","source"],ImportDefaultSpecifier:["local"],ImportNamespaceSpecifier:["local"],ImportSpecifier:["imported","local"],Literal:[],LabeledStatement:["label","body"],LogicalExpression:["left","right"],MemberExpression:["object","property"],MetaProperty:["meta","property"],MethodDefinition:["key","value"],ModuleSpecifier:[],NewExpression:["callee","arguments"],ObjectExpression:["properties"],ObjectPattern:["properties"],PrivateIdentifier:[],Program:["body"],Property:["key","value"],PropertyDefinition:["key","value"],RestElement:["argument"],ReturnStatement:["argument"],SequenceExpression:["expressions"],SpreadElement:["argument"],Super:[],SwitchStatement:["discriminant","cases"],SwitchCase:["test","consequent"],TaggedTemplateExpression:["tag","quasi"],TemplateElement:[],TemplateLiteral:["quasis","expressions"],ThisExpression:[],ThrowStatement:["argument"],TryStatement:["block","handler","finalizer"],UnaryExpression:["argument"],UpdateExpression:["argument"],VariableDeclaration:["declarations"],VariableDeclarator:["id","init"],WhileStatement:["test","body"],WithStatement:["object","body"],YieldExpression:["argument"]},o={Break:c={},Skip:a={},Remove:l={}},u.prototype.replace=function(R){this.parent[this.key]=R},u.prototype.remove=function(){return Array.isArray(this.parent)?(this.parent.splice(this.key,1),!0):(this.replace(null),!1)},m.prototype.path=function(){var R,v,P,D,I;function H(L,G){if(Array.isArray(G))for(P=0,D=G.length;P<D;++P)L.push(G[P]);else L.push(G)}if(!this.__current.path)return null;for(I=[],R=2,v=this.__leavelist.length;R<v;++R)H(I,this.__leavelist[R].path);return H(I,this.__current.path),I},m.prototype.type=function(){return this.current().type||this.__current.wrap},m.prototype.parents=function(){var R,v,P;for(P=[],R=1,v=this.__leavelist.length;R<v;++R)P.push(this.__leavelist[R].node);return P},m.prototype.current=function(){return this.__current.node},m.prototype.__execute=function(R,v){var P,D;return D=void 0,P=this.__current,this.__current=v,this.__state=null,R&&(D=R.call(this,v.node,this.__leavelist[this.__leavelist.length-1].node)),this.__current=P,D},m.prototype.notify=function(R){this.__state=R},m.prototype.skip=function(){this.notify(a)},m.prototype.break=function(){this.notify(c)},m.prototype.remove=function(){this.notify(l)},m.prototype.__initialize=function(R,v){this.visitor=v,this.root=R,this.__worklist=[],this.__leavelist=[],this.__current=null,this.__state=null,this.__fallback=null,v.fallback==="iteration"?this.__fallback=Object.keys:typeof v.fallback=="function"&&(this.__fallback=v.fallback),this.__keys=s,v.keys&&(this.__keys=Object.assign(Object.create(this.__keys),v.keys))},m.prototype.traverse=function(R,v){var P,D,I,H,L,G,ce,ge,Ne,Te,Ce,qe;for(this.__initialize(R,v),qe={},P=this.__worklist,D=this.__leavelist,P.push(new d(R,null,null,null)),D.push(new d(null,null,null,null));P.length;)if((I=P.pop())!==qe){if(I.node){if(G=this.__execute(v.enter,I),this.__state===c||G===c)return;if(P.push(qe),D.push(I),this.__state===a||G===a)continue;if(L=(H=I.node).type||I.wrap,!(Te=this.__keys[L])){if(!this.__fallback)throw new Error("Unknown node type "+L+".");Te=this.__fallback(H)}for(ge=Te.length;(ge-=1)>=0;)if(Ce=H[ce=Te[ge]]){if(Array.isArray(Ce)){for(Ne=Ce.length;(Ne-=1)>=0;)if(Ce[Ne]&&!b(D,Ce[Ne])){if(h(L,Te[ge]))I=new d(Ce[Ne],[ce,Ne],"Property",null);else{if(!_(Ce[Ne]))continue;I=new d(Ce[Ne],[ce,Ne],null,null)}P.push(I)}}else if(_(Ce)){if(b(D,Ce))continue;P.push(new d(Ce,ce,null,null))}}}}else if(I=D.pop(),G=this.__execute(v.leave,I),this.__state===c||G===c)return},m.prototype.replace=function(R,v){var P,D,I,H,L,G,ce,ge,Ne,Te,Ce,qe,Nt;function Sn(ii){var oi,vo,Ro,Ic;if(ii.ref.remove()){for(vo=ii.ref.key,Ic=ii.ref.parent,oi=P.length;oi--;)if((Ro=P[oi]).ref&&Ro.ref.parent===Ic){if(Ro.ref.key<vo)break;--Ro.ref.key}}}for(this.__initialize(R,v),Ce={},P=this.__worklist,D=this.__leavelist,G=new d(R,null,null,new u(qe={root:R},"root")),P.push(G),D.push(G);P.length;)if((G=P.pop())!==Ce){if((L=this.__execute(v.enter,G))!==void 0&&L!==c&&L!==a&&L!==l&&(G.ref.replace(L),G.node=L),this.__state!==l&&L!==l||(Sn(G),G.node=null),this.__state===c||L===c)return qe.root;if((I=G.node)&&(P.push(Ce),D.push(G),this.__state!==a&&L!==a)){if(H=I.type||G.wrap,!(Ne=this.__keys[H])){if(!this.__fallback)throw new Error("Unknown node type "+H+".");Ne=this.__fallback(I)}for(ce=Ne.length;(ce-=1)>=0;)if(Te=I[Nt=Ne[ce]])if(Array.isArray(Te)){for(ge=Te.length;(ge-=1)>=0;)if(Te[ge]){if(h(H,Ne[ce]))G=new d(Te[ge],[Nt,ge],"Property",new u(Te,ge));else{if(!_(Te[ge]))continue;G=new d(Te[ge],[Nt,ge],null,new u(Te,ge))}P.push(G)}}else _(Te)&&P.push(new d(Te,Nt,null,new u(I,Nt)))}}else if(G=D.pop(),(L=this.__execute(v.leave,G))!==void 0&&L!==c&&L!==a&&L!==l&&G.ref.replace(L),this.__state!==l&&L!==l||Sn(G),this.__state===c||L===c)return qe.root;return qe.root},r.Syntax=i,r.traverse=N,r.replace=function(R,v){return new m().replace(R,v)},r.attachComments=function(R,v,P){var D,I,H,L,G=[];if(!R.range)throw new Error("attachComments needs range information");if(!P.length){if(v.length){for(H=0,I=v.length;H<I;H+=1)(D=p(v[H])).extendedRange=[0,R.range[0]],G.push(D);R.leadingComments=G}return R}for(H=0,I=v.length;H<I;H+=1)G.push(M(p(v[H]),P));return L=0,N(R,{enter:function(ce){for(var ge;L<G.length&&!((ge=G[L]).extendedRange[1]>ce.range[0]);)ge.extendedRange[1]===ce.range[0]?(ce.leadingComments||(ce.leadingComments=[]),ce.leadingComments.push(ge),G.splice(L,1)):L+=1;return L===G.length?o.Break:G[L].extendedRange[0]>ce.range[1]?o.Skip:void 0}}),L=0,N(R,{leave:function(ce){for(var ge;L<G.length&&(ge=G[L],!(ce.range[1]<ge.extendedRange[0]));)ce.range[1]===ge.extendedRange[0]?(ce.trailingComments||(ce.trailingComments=[]),ce.trailingComments.push(ge),G.splice(L,1)):L+=1;return L===G.length?o.Break:G[L].extendedRange[0]>ce.range[1]?o.Skip:void 0}}),R},r.VisitorKeys=s,r.VisitorOption=o,r.Controller=m,r.cloneEnvironment=function(){return n({})},r})(t)})),Cee=EF((function(e){e.exports&&(e.exports=(function(){function t(n,r,i,o){this.message=n,this.expected=r,this.found=i,this.location=o,this.name="SyntaxError",typeof Error.captureStackTrace=="function"&&Error.captureStackTrace(this,t)}return(function(n,r){function i(){this.constructor=n}i.prototype=r.prototype,n.prototype=new i})(t,Error),t.buildMessage=function(n,r){var i={literal:function(a){return'"'+s(a.text)+'"'},class:function(a){var l,p="";for(l=0;l<a.parts.length;l++)p+=a.parts[l]instanceof Array?c(a.parts[l][0])+"-"+c(a.parts[l][1]):c(a.parts[l]);return"["+(a.inverted?"^":"")+p+"]"},any:function(a){return"any character"},end:function(a){return"end of input"},other:function(a){return a.description}};function o(a){return a.charCodeAt(0).toString(16).toUpperCase()}function s(a){return a.replace(/\\/g,"\\\\").replace(/"/g,'\\"').replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(l){return"\\x0"+o(l)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(l){return"\\x"+o(l)}))}function c(a){return a.replace(/\\/g,"\\\\").replace(/\]/g,"\\]").replace(/\^/g,"\\^").replace(/-/g,"\\-").replace(/\0/g,"\\0").replace(/\t/g,"\\t").replace(/\n/g,"\\n").replace(/\r/g,"\\r").replace(/[\x00-\x0F]/g,(function(l){return"\\x0"+o(l)})).replace(/[\x10-\x1F\x7F-\x9F]/g,(function(l){return"\\x"+o(l)}))}return"Expected "+(function(a){var l,p,u,d=new Array(a.length);for(l=0;l<a.length;l++)d[l]=(u=a[l],i[u.type](u));if(d.sort(),d.length>0){for(l=1,p=1;l<d.length;l++)d[l-1]!==d[l]&&(d[p]=d[l],p++);d.length=p}switch(d.length){case 1:return d[0];case 2:return d[0]+" or "+d[1];default:return d.slice(0,-1).join(", ")+", or "+d[d.length-1]}})(n)+" but "+(function(a){return a?'"'+s(a)+'"':"end of input"})(r)+" found."},{SyntaxError:t,parse:function(n,r){r=r!==void 0?r:{};var i,o,s,c,a={},l={start:DN},p=DN,u=Xe(" ",!1),d=/^[^ [\],():#!=><~+.]/,m=Er([" ","[","]",",","(",")",":","#","!","=",">","<","~","+","."],!0,!1),_=Xe(">",!1),h=Xe("~",!1),b=Xe("+",!1),N=Xe(",",!1),M=function(T,F){return[T].concat(F.map((function(Y){return Y[3]})))},R=Xe("!",!1),v=Xe("*",!1),P=Xe("#",!1),D=Xe("[",!1),I=Xe("]",!1),H=/^[><!]/,L=Er([">","<","!"],!1,!1),G=Xe("=",!1),ce=function(T){return(T||"")+"="},ge=/^[><]/,Ne=Er([">","<"],!1,!1),Te=Xe(".",!1),Ce=function(T,F,Y){return{type:"attribute",name:T,operator:F,value:Y}},qe=Xe('"',!1),Nt=/^[^\\"]/,Sn=Er(["\\",'"'],!0,!1),ii=Xe("\\",!1),oi={type:"any"},vo=function(T,F){return T+F},Ro=function(T){return{type:"literal",value:(F=T.join(""),F.replace(/\\(.)/g,(function(Y,y){switch(y){case"b":return"\b";case"f":return"\f";case"n":return`
|
|
37
|
+
`;case"r":return"\r";case"t":return" ";case"v":return"\v";default:return y}})))};var F},Ic=Xe("'",!1),AN=/^[^\\']/,NN=Er(["\\","'"],!0,!1),wi=/^[0-9]/,Gi=Er([["0","9"]],!1,!1),l2=Xe("type(",!1),vN=/^[^ )]/,RN=Er([" ",")"],!0,!1),Oo=Xe(")",!1),ON=/^[imsu]/,CN=Er(["i","m","s","u"],!1,!1),xN=Xe("/",!1),PN=/^[^\]\\]/,kN=Er(["]","\\"],!0,!1),LN=/^[^\/\\[]/,MN=Er(["/","\\","["],!0,!1),p2=Xe(":not(",!1),u2=Xe(":matches(",!1),wN=function(T){return{type:"matches",selectors:T}},d2=Xe(":is(",!1),m2=Xe(":has(",!1),f2=Xe(":first-child",!1),g2=Xe(":last-child",!1),_2=Xe(":nth-child(",!1),h2=Xe(":nth-last-child(",!1),b2=Xe(":",!1),f=0,Fp=[{line:1,column:1}],Sr=0,r_=[],z={};if("startRule"in r){if(!(r.startRule in l))throw new Error(`Can't start parsing from rule "`+r.startRule+'".');p=l[r.startRule]}function Xe(T,F){return{type:"literal",text:T,ignoreCase:F}}function Er(T,F,Y){return{type:"class",parts:T,inverted:F,ignoreCase:Y}}function GN(T){var F,Y=Fp[T];if(Y)return Y;for(F=T-1;!Fp[F];)F--;for(Y={line:(Y=Fp[F]).line,column:Y.column};F<T;)n.charCodeAt(F)===10?(Y.line++,Y.column=1):Y.column++,F++;return Fp[T]=Y,Y}function UN(T,F){var Y=GN(T),y=GN(F);return{start:{offset:T,line:Y.line,column:Y.column},end:{offset:F,line:y.line,column:y.column}}}function j(T){f<Sr||(f>Sr&&(Sr=f,r_=[]),r_.push(T))}function DN(){var T,F,Y,y,O=36*f+0,K=z[O];return K?(f=K.nextPos,K.result):(T=f,(F=Oe())!==a&&(Y=Wp())!==a&&Oe()!==a?T=F=(y=Y).length===1?y[0]:{type:"matches",selectors:y}:(f=T,T=a),T===a&&(T=f,(F=Oe())!==a&&(F=void 0),T=F),z[O]={nextPos:f,result:T},T)}function Oe(){var T,F,Y=36*f+1,y=z[Y];if(y)return f=y.nextPos,y.result;for(T=[],n.charCodeAt(f)===32?(F=" ",f++):(F=a,j(u));F!==a;)T.push(F),n.charCodeAt(f)===32?(F=" ",f++):(F=a,j(u));return z[Y]={nextPos:f,result:T},T}function si(){var T,F,Y,y=36*f+2,O=z[y];if(O)return f=O.nextPos,O.result;if(F=[],d.test(n.charAt(f))?(Y=n.charAt(f),f++):(Y=a,j(m)),Y!==a)for(;Y!==a;)F.push(Y),d.test(n.charAt(f))?(Y=n.charAt(f),f++):(Y=a,j(m));else F=a;return F!==a&&(F=F.join("")),T=F,z[y]={nextPos:f,result:T},T}function i_(){var T,F,Y,y=36*f+3,O=z[y];return O?(f=O.nextPos,O.result):(T=f,(F=Oe())!==a?(n.charCodeAt(f)===62?(Y=">",f++):(Y=a,j(_)),Y!==a&&Oe()!==a?T=F="child":(f=T,T=a)):(f=T,T=a),T===a&&(T=f,(F=Oe())!==a?(n.charCodeAt(f)===126?(Y="~",f++):(Y=a,j(h)),Y!==a&&Oe()!==a?T=F="sibling":(f=T,T=a)):(f=T,T=a),T===a&&(T=f,(F=Oe())!==a?(n.charCodeAt(f)===43?(Y="+",f++):(Y=a,j(b)),Y!==a&&Oe()!==a?T=F="adjacent":(f=T,T=a)):(f=T,T=a),T===a&&(T=f,n.charCodeAt(f)===32?(F=" ",f++):(F=a,j(u)),F!==a&&(Y=Oe())!==a?T=F="descendant":(f=T,T=a)))),z[y]={nextPos:f,result:T},T)}function Wp(){var T,F,Y,y,O,K,X,_e,be=36*f+5,ye=z[be];if(ye)return f=ye.nextPos,ye.result;if(T=f,(F=Vp())!==a){for(Y=[],y=f,(O=Oe())!==a?(n.charCodeAt(f)===44?(K=",",f++):(K=a,j(N)),K!==a&&(X=Oe())!==a&&(_e=Vp())!==a?y=O=[O,K,X,_e]:(f=y,y=a)):(f=y,y=a);y!==a;)Y.push(y),y=f,(O=Oe())!==a?(n.charCodeAt(f)===44?(K=",",f++):(K=a,j(N)),K!==a&&(X=Oe())!==a&&(_e=Vp())!==a?y=O=[O,K,X,_e]:(f=y,y=a)):(f=y,y=a);Y!==a?T=F=M(F,Y):(f=T,T=a)}else f=T,T=a;return z[be]={nextPos:f,result:T},T}function o_(){var T,F,Y,y,O,K=36*f+6,X=z[K];return X?(f=X.nextPos,X.result):(T=f,(F=i_())===a&&(F=null),F!==a&&(Y=Vp())!==a?(O=Y,T=F=(y=F)?{type:y,left:{type:"exactNode"},right:O}:O):(f=T,T=a),z[K]={nextPos:f,result:T},T)}function Vp(){var T,F,Y,y,O,K,X,_e=36*f+7,be=z[_e];if(be)return f=be.nextPos,be.result;if(T=f,(F=s_())!==a){for(Y=[],y=f,(O=i_())!==a&&(K=s_())!==a?y=O=[O,K]:(f=y,y=a);y!==a;)Y.push(y),y=f,(O=i_())!==a&&(K=s_())!==a?y=O=[O,K]:(f=y,y=a);Y!==a?(X=F,T=F=Y.reduce((function(ye,st){return{type:st[0],left:ye,right:st[1]}}),X)):(f=T,T=a)}else f=T,T=a;return z[_e]={nextPos:f,result:T},T}function s_(){var T,F,Y,y,O,K,X,_e=36*f+8,be=z[_e];if(be)return f=be.nextPos,be.result;if(T=f,n.charCodeAt(f)===33?(F="!",f++):(F=a,j(R)),F===a&&(F=null),F!==a){if(Y=[],(y=BN())!==a)for(;y!==a;)Y.push(y),y=BN();else Y=a;Y!==a?(O=F,X=(K=Y).length===1?K[0]:{type:"compound",selectors:K},O&&(X.subject=!0),T=F=X):(f=T,T=a)}else f=T,T=a;return z[_e]={nextPos:f,result:T},T}function BN(){var T,F=36*f+9,Y=z[F];return Y?(f=Y.nextPos,Y.result):((T=(function(){var y,O,K=36*f+10,X=z[K];return X?(f=X.nextPos,X.result):(n.charCodeAt(f)===42?(O="*",f++):(O=a,j(v)),O!==a&&(O={type:"wildcard",value:O}),y=O,z[K]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X=36*f+11,_e=z[X];return _e?(f=_e.nextPos,_e.result):(y=f,n.charCodeAt(f)===35?(O="#",f++):(O=a,j(P)),O===a&&(O=null),O!==a&&(K=si())!==a?y=O={type:"identifier",value:K}:(f=y,y=a),z[X]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e=36*f+12,be=z[_e];return be?(f=be.nextPos,be.result):(y=f,n.charCodeAt(f)===91?(O="[",f++):(O=a,j(D)),O!==a&&Oe()!==a&&(K=(function(){var ye,st,Mn,je,Qn=36*f+16,tn=z[Qn];return tn?(f=tn.nextPos,tn.result):(ye=f,(st=a_())!==a&&Oe()!==a&&(Mn=(function(){var Z,le,Ee,W=36*f+14,Ie=z[W];return Ie?(f=Ie.nextPos,Ie.result):(Z=f,n.charCodeAt(f)===33?(le="!",f++):(le=a,j(R)),le===a&&(le=null),le!==a?(n.charCodeAt(f)===61?(Ee="=",f++):(Ee=a,j(G)),Ee!==a?(le=ce(le),Z=le):(f=Z,Z=a)):(f=Z,Z=a),z[W]={nextPos:f,result:Z},Z)})())!==a&&Oe()!==a?((je=(function(){var Z,le,Ee,W,Ie,Qe=36*f+20,wn=z[Qe];if(wn)return f=wn.nextPos,wn.result;if(Z=f,n.substr(f,5)==="type("?(le="type(",f+=5):(le=a,j(l2)),le!==a)if(Oe()!==a){if(Ee=[],vN.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(RN)),W!==a)for(;W!==a;)Ee.push(W),vN.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(RN));else Ee=a;Ee!==a&&(W=Oe())!==a?(n.charCodeAt(f)===41?(Ie=")",f++):(Ie=a,j(Oo)),Ie!==a?(le={type:"type",value:Ee.join("")},Z=le):(f=Z,Z=a)):(f=Z,Z=a)}else f=Z,Z=a;else f=Z,Z=a;return z[Qe]={nextPos:f,result:Z},Z})())===a&&(je=(function(){var Z,le,Ee,W,Ie,Qe,wn=36*f+22,Tr=z[wn];if(Tr)return f=Tr.nextPos,Tr.result;if(Z=f,n.charCodeAt(f)===47?(le="/",f++):(le=a,j(xN)),le!==a){if(Ee=[],(W=HN())===a&&(W=Yp())===a&&(W=FN()),W!==a)for(;W!==a;)Ee.push(W),(W=HN())===a&&(W=Yp())===a&&(W=FN());else Ee=a;Ee!==a?(n.charCodeAt(f)===47?(W="/",f++):(W=a,j(xN)),W!==a?((Ie=(function(){var ai,Co,YN=36*f+21,c_=z[YN];if(c_)return f=c_.nextPos,c_.result;if(ai=[],ON.test(n.charAt(f))?(Co=n.charAt(f),f++):(Co=a,j(CN)),Co!==a)for(;Co!==a;)ai.push(Co),ON.test(n.charAt(f))?(Co=n.charAt(f),f++):(Co=a,j(CN));else ai=a;return z[YN]={nextPos:f,result:ai},ai})())===a&&(Ie=null),Ie!==a?(Qe=Ie,le={type:"regexp",value:new RegExp(Ee.join(""),Qe?Qe.join(""):"")},Z=le):(f=Z,Z=a)):(f=Z,Z=a)):(f=Z,Z=a)}else f=Z,Z=a;return z[wn]={nextPos:f,result:Z},Z})()),je!==a?(st=Ce(st,Mn,je),ye=st):(f=ye,ye=a)):(f=ye,ye=a),ye===a&&(ye=f,(st=a_())!==a&&Oe()!==a&&(Mn=(function(){var Z,le,Ee,W=36*f+13,Ie=z[W];return Ie?(f=Ie.nextPos,Ie.result):(Z=f,H.test(n.charAt(f))?(le=n.charAt(f),f++):(le=a,j(L)),le===a&&(le=null),le!==a?(n.charCodeAt(f)===61?(Ee="=",f++):(Ee=a,j(G)),Ee!==a?(le=ce(le),Z=le):(f=Z,Z=a)):(f=Z,Z=a),Z===a&&(ge.test(n.charAt(f))?(Z=n.charAt(f),f++):(Z=a,j(Ne))),z[W]={nextPos:f,result:Z},Z)})())!==a&&Oe()!==a?((je=(function(){var Z,le,Ee,W,Ie,Qe,wn=36*f+17,Tr=z[wn];if(Tr)return f=Tr.nextPos,Tr.result;if(Z=f,n.charCodeAt(f)===34?(le='"',f++):(le=a,j(qe)),le!==a){for(Ee=[],Nt.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Sn)),W===a&&(W=f,n.charCodeAt(f)===92?(Ie="\\",f++):(Ie=a,j(ii)),Ie!==a?(n.length>f?(Qe=n.charAt(f),f++):(Qe=a,j(oi)),Qe!==a?(Ie=vo(Ie,Qe),W=Ie):(f=W,W=a)):(f=W,W=a));W!==a;)Ee.push(W),Nt.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Sn)),W===a&&(W=f,n.charCodeAt(f)===92?(Ie="\\",f++):(Ie=a,j(ii)),Ie!==a?(n.length>f?(Qe=n.charAt(f),f++):(Qe=a,j(oi)),Qe!==a?(Ie=vo(Ie,Qe),W=Ie):(f=W,W=a)):(f=W,W=a));Ee!==a?(n.charCodeAt(f)===34?(W='"',f++):(W=a,j(qe)),W!==a?(le=Ro(Ee),Z=le):(f=Z,Z=a)):(f=Z,Z=a)}else f=Z,Z=a;if(Z===a)if(Z=f,n.charCodeAt(f)===39?(le="'",f++):(le=a,j(Ic)),le!==a){for(Ee=[],AN.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(NN)),W===a&&(W=f,n.charCodeAt(f)===92?(Ie="\\",f++):(Ie=a,j(ii)),Ie!==a?(n.length>f?(Qe=n.charAt(f),f++):(Qe=a,j(oi)),Qe!==a?(Ie=vo(Ie,Qe),W=Ie):(f=W,W=a)):(f=W,W=a));W!==a;)Ee.push(W),AN.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(NN)),W===a&&(W=f,n.charCodeAt(f)===92?(Ie="\\",f++):(Ie=a,j(ii)),Ie!==a?(n.length>f?(Qe=n.charAt(f),f++):(Qe=a,j(oi)),Qe!==a?(Ie=vo(Ie,Qe),W=Ie):(f=W,W=a)):(f=W,W=a));Ee!==a?(n.charCodeAt(f)===39?(W="'",f++):(W=a,j(Ic)),W!==a?(le=Ro(Ee),Z=le):(f=Z,Z=a)):(f=Z,Z=a)}else f=Z,Z=a;return z[wn]={nextPos:f,result:Z},Z})())===a&&(je=(function(){var Z,le,Ee,W,Ie,Qe,wn,Tr=36*f+18,ai=z[Tr];if(ai)return f=ai.nextPos,ai.result;for(Z=f,le=f,Ee=[],wi.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Gi));W!==a;)Ee.push(W),wi.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Gi));if(Ee!==a?(n.charCodeAt(f)===46?(W=".",f++):(W=a,j(Te)),W!==a?le=Ee=[Ee,W]:(f=le,le=a)):(f=le,le=a),le===a&&(le=null),le!==a){if(Ee=[],wi.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Gi)),W!==a)for(;W!==a;)Ee.push(W),wi.test(n.charAt(f))?(W=n.charAt(f),f++):(W=a,j(Gi));else Ee=a;Ee!==a?(Qe=Ee,wn=(Ie=le)?[].concat.apply([],Ie).join(""):"",le={type:"literal",value:parseFloat(wn+Qe.join(""))},Z=le):(f=Z,Z=a)}else f=Z,Z=a;return z[Tr]={nextPos:f,result:Z},Z})())===a&&(je=(function(){var Z,le,Ee=36*f+19,W=z[Ee];return W?(f=W.nextPos,W.result):((le=si())!==a&&(le={type:"literal",value:le}),Z=le,z[Ee]={nextPos:f,result:Z},Z)})()),je!==a?(st=Ce(st,Mn,je),ye=st):(f=ye,ye=a)):(f=ye,ye=a),ye===a&&(ye=f,(st=a_())!==a&&(st={type:"attribute",name:st}),ye=st)),z[Qn]={nextPos:f,result:ye},ye)})())!==a&&Oe()!==a?(n.charCodeAt(f)===93?(X="]",f++):(X=a,j(I)),X!==a?y=O=K:(f=y,y=a)):(f=y,y=a),z[_e]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e,be,ye,st,Mn=36*f+26,je=z[Mn];if(je)return f=je.nextPos,je.result;if(y=f,n.charCodeAt(f)===46?(O=".",f++):(O=a,j(Te)),O!==a)if((K=si())!==a){for(X=[],_e=f,n.charCodeAt(f)===46?(be=".",f++):(be=a,j(Te)),be!==a&&(ye=si())!==a?_e=be=[be,ye]:(f=_e,_e=a);_e!==a;)X.push(_e),_e=f,n.charCodeAt(f)===46?(be=".",f++):(be=a,j(Te)),be!==a&&(ye=si())!==a?_e=be=[be,ye]:(f=_e,_e=a);X!==a?(st=K,O={type:"field",name:X.reduce((function(Qn,tn){return Qn+tn[0]+tn[1]}),st)},y=O):(f=y,y=a)}else f=y,y=a;else f=y,y=a;return z[Mn]={nextPos:f,result:y},y})())===a&&(T=(function(){var y,O,K,X,_e=36*f+27,be=z[_e];return be?(f=be.nextPos,be.result):(y=f,n.substr(f,5)===":not("?(O=":not(",f+=5):(O=a,j(p2)),O!==a&&Oe()!==a&&(K=Wp())!==a&&Oe()!==a?(n.charCodeAt(f)===41?(X=")",f++):(X=a,j(Oo)),X!==a?y=O={type:"not",selectors:K}:(f=y,y=a)):(f=y,y=a),z[_e]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e=36*f+28,be=z[_e];return be?(f=be.nextPos,be.result):(y=f,n.substr(f,9)===":matches("?(O=":matches(",f+=9):(O=a,j(u2)),O!==a&&Oe()!==a&&(K=Wp())!==a&&Oe()!==a?(n.charCodeAt(f)===41?(X=")",f++):(X=a,j(Oo)),X!==a?(O=wN(K),y=O):(f=y,y=a)):(f=y,y=a),z[_e]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e=36*f+29,be=z[_e];return be?(f=be.nextPos,be.result):(y=f,n.substr(f,4)===":is("?(O=":is(",f+=4):(O=a,j(d2)),O!==a&&Oe()!==a&&(K=Wp())!==a&&Oe()!==a?(n.charCodeAt(f)===41?(X=")",f++):(X=a,j(Oo)),X!==a?(O=wN(K),y=O):(f=y,y=a)):(f=y,y=a),z[_e]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e=36*f+30,be=z[_e];return be?(f=be.nextPos,be.result):(y=f,n.substr(f,5)===":has("?(O=":has(",f+=5):(O=a,j(m2)),O!==a&&Oe()!==a&&(K=(function(){var ye,st,Mn,je,Qn,tn,Z,le,Ee=36*f+4,W=z[Ee];if(W)return f=W.nextPos,W.result;if(ye=f,(st=o_())!==a){for(Mn=[],je=f,(Qn=Oe())!==a?(n.charCodeAt(f)===44?(tn=",",f++):(tn=a,j(N)),tn!==a&&(Z=Oe())!==a&&(le=o_())!==a?je=Qn=[Qn,tn,Z,le]:(f=je,je=a)):(f=je,je=a);je!==a;)Mn.push(je),je=f,(Qn=Oe())!==a?(n.charCodeAt(f)===44?(tn=",",f++):(tn=a,j(N)),tn!==a&&(Z=Oe())!==a&&(le=o_())!==a?je=Qn=[Qn,tn,Z,le]:(f=je,je=a)):(f=je,je=a);Mn!==a?ye=st=M(st,Mn):(f=ye,ye=a)}else f=ye,ye=a;return z[Ee]={nextPos:f,result:ye},ye})())!==a&&Oe()!==a?(n.charCodeAt(f)===41?(X=")",f++):(X=a,j(Oo)),X!==a?y=O={type:"has",selectors:K}:(f=y,y=a)):(f=y,y=a),z[_e]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K=36*f+31,X=z[K];return X?(f=X.nextPos,X.result):(n.substr(f,12)===":first-child"?(O=":first-child",f+=12):(O=a,j(f2)),O!==a&&(O=WN(1)),y=O,z[K]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K=36*f+32,X=z[K];return X?(f=X.nextPos,X.result):(n.substr(f,11)===":last-child"?(O=":last-child",f+=11):(O=a,j(g2)),O!==a&&(O=VN(1)),y=O,z[K]={nextPos:f,result:y},y)})())===a&&(T=(function(){var y,O,K,X,_e,be=36*f+33,ye=z[be];if(ye)return f=ye.nextPos,ye.result;if(y=f,n.substr(f,11)===":nth-child("?(O=":nth-child(",f+=11):(O=a,j(_2)),O!==a)if(Oe()!==a){if(K=[],wi.test(n.charAt(f))?(X=n.charAt(f),f++):(X=a,j(Gi)),X!==a)for(;X!==a;)K.push(X),wi.test(n.charAt(f))?(X=n.charAt(f),f++):(X=a,j(Gi));else K=a;K!==a&&(X=Oe())!==a?(n.charCodeAt(f)===41?(_e=")",f++):(_e=a,j(Oo)),_e!==a?(O=WN(parseInt(K.join(""),10)),y=O):(f=y,y=a)):(f=y,y=a)}else f=y,y=a;else f=y,y=a;return z[be]={nextPos:f,result:y},y})())===a&&(T=(function(){var y,O,K,X,_e,be=36*f+34,ye=z[be];if(ye)return f=ye.nextPos,ye.result;if(y=f,n.substr(f,16)===":nth-last-child("?(O=":nth-last-child(",f+=16):(O=a,j(h2)),O!==a)if(Oe()!==a){if(K=[],wi.test(n.charAt(f))?(X=n.charAt(f),f++):(X=a,j(Gi)),X!==a)for(;X!==a;)K.push(X),wi.test(n.charAt(f))?(X=n.charAt(f),f++):(X=a,j(Gi));else K=a;K!==a&&(X=Oe())!==a?(n.charCodeAt(f)===41?(_e=")",f++):(_e=a,j(Oo)),_e!==a?(O=VN(parseInt(K.join(""),10)),y=O):(f=y,y=a)):(f=y,y=a)}else f=y,y=a;else f=y,y=a;return z[be]={nextPos:f,result:y},y})())===a&&(T=(function(){var y,O,K,X=36*f+35,_e=z[X];return _e?(f=_e.nextPos,_e.result):(y=f,n.charCodeAt(f)===58?(O=":",f++):(O=a,j(b2)),O!==a&&(K=si())!==a?y=O={type:"class",name:K}:(f=y,y=a),z[X]={nextPos:f,result:y},y)})()),z[F]={nextPos:f,result:T},T)}function a_(){var T,F,Y,y,O,K,X,_e,be=36*f+15,ye=z[be];if(ye)return f=ye.nextPos,ye.result;if(T=f,(F=si())!==a){for(Y=[],y=f,n.charCodeAt(f)===46?(O=".",f++):(O=a,j(Te)),O!==a&&(K=si())!==a?y=O=[O,K]:(f=y,y=a);y!==a;)Y.push(y),y=f,n.charCodeAt(f)===46?(O=".",f++):(O=a,j(Te)),O!==a&&(K=si())!==a?y=O=[O,K]:(f=y,y=a);Y!==a?(X=F,_e=Y,T=F=[].concat.apply([X],_e).join("")):(f=T,T=a)}else f=T,T=a;return z[be]={nextPos:f,result:T},T}function HN(){var T,F,Y,y,O=36*f+23,K=z[O];if(K)return f=K.nextPos,K.result;if(T=f,n.charCodeAt(f)===91?(F="[",f++):(F=a,j(D)),F!==a){if(Y=[],PN.test(n.charAt(f))?(y=n.charAt(f),f++):(y=a,j(kN)),y===a&&(y=Yp()),y!==a)for(;y!==a;)Y.push(y),PN.test(n.charAt(f))?(y=n.charAt(f),f++):(y=a,j(kN)),y===a&&(y=Yp());else Y=a;Y!==a?(n.charCodeAt(f)===93?(y="]",f++):(y=a,j(I)),y!==a?T=F="["+Y.join("")+"]":(f=T,T=a)):(f=T,T=a)}else f=T,T=a;return z[O]={nextPos:f,result:T},T}function Yp(){var T,F,Y,y=36*f+24,O=z[y];return O?(f=O.nextPos,O.result):(T=f,n.charCodeAt(f)===92?(F="\\",f++):(F=a,j(ii)),F!==a?(n.length>f?(Y=n.charAt(f),f++):(Y=a,j(oi)),Y!==a?T=F="\\"+Y:(f=T,T=a)):(f=T,T=a),z[y]={nextPos:f,result:T},T)}function FN(){var T,F,Y,y=36*f+25,O=z[y];if(O)return f=O.nextPos,O.result;if(F=[],LN.test(n.charAt(f))?(Y=n.charAt(f),f++):(Y=a,j(MN)),Y!==a)for(;Y!==a;)F.push(Y),LN.test(n.charAt(f))?(Y=n.charAt(f),f++):(Y=a,j(MN));else F=a;return F!==a&&(F=F.join("")),T=F,z[y]={nextPos:f,result:T},T}function WN(T){return{type:"nth-child",index:{type:"literal",value:T}}}function VN(T){return{type:"nth-last-child",index:{type:"literal",value:T}}}if((i=p())!==a&&f===n.length)return i;throw i!==a&&f<n.length&&j({type:"end"}),o=r_,s=Sr<n.length?n.charAt(Sr):null,c=Sr<n.length?UN(Sr,Sr+1):UN(Sr,Sr),new t(t.buildMessage(o,s),o,s,c)}}})())}));function yr(e,t){for(var n=0;n<t.length;++n){if(e==null)return e;e=e[t[n]]}return e}var $A=typeof WeakMap=="function"?new WeakMap:null;function Vt(e){if(e==null)return function(){return!0};if($A!=null){var t=$A.get(e);return t!=null||(t=_F(e),$A.set(e,t)),t}return _F(e)}function _F(e){switch(e.type){case"wildcard":return function(){return!0};case"identifier":var t=e.value.toLowerCase();return function(I,H,L){var G=L&&L.nodeTypeKey||"type";return t===I[G].toLowerCase()};case"exactNode":return function(I,H){return H.length===0};case"field":var n=e.name.split(".");return function(I,H){return(function L(G,ce,ge,Ne){for(var Te=ce,Ce=Ne;Ce<ge.length;++Ce){if(Te==null)return!1;var qe=Te[ge[Ce]];if(Array.isArray(qe)){for(var Nt=0;Nt<qe.length;++Nt)if(L(G,qe[Nt],ge,Ce+1))return!0;return!1}Te=qe}return G===Te})(I,H[n.length-1],n,0)};case"matches":var r=e.selectors.map(Vt);return function(I,H,L){for(var G=0;G<r.length;++G)if(r[G](I,H,L))return!0;return!1};case"compound":var i=e.selectors.map(Vt);return function(I,H,L){for(var G=0;G<i.length;++G)if(!i[G](I,H,L))return!1;return!0};case"not":var o=e.selectors.map(Vt);return function(I,H,L){for(var G=0;G<o.length;++G)if(o[G](I,H,L))return!1;return!0};case"has":var s=e.selectors.map(Vt);return function(I,H,L){var G=!1,ce=[];return Fg.traverse(I,{enter:function(ge,Ne){Ne!=null&&ce.unshift(Ne);for(var Te=0;Te<s.length;++Te)if(s[Te](ge,ce,L))return G=!0,void this.break()},leave:function(){ce.shift()},keys:L&&L.visitorKeys,fallback:L&&L.fallback||"iteration"}),G};case"child":var c=Vt(e.left),a=Vt(e.right);return function(I,H,L){return!!(H.length>0&&a(I,H,L))&&c(H[0],H.slice(1),L)};case"descendant":var l=Vt(e.left),p=Vt(e.right);return function(I,H,L){if(p(I,H,L)){for(var G=0,ce=H.length;G<ce;++G)if(l(H[G],H.slice(G+1),L))return!0}return!1};case"attribute":var u=e.name.split(".");switch(e.operator){case void 0:return function(I){return yr(I,u)!=null};case"=":switch(e.value.type){case"regexp":return function(I){var H=yr(I,u);return typeof H=="string"&&e.value.value.test(H)};case"literal":var d="".concat(e.value.value);return function(I){return d==="".concat(yr(I,u))};case"type":return function(I){return e.value.value===Dp(yr(I,u))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"!=":switch(e.value.type){case"regexp":return function(I){return!e.value.value.test(yr(I,u))};case"literal":var m="".concat(e.value.value);return function(I){return m!=="".concat(yr(I,u))};case"type":return function(I){return e.value.value!==Dp(yr(I,u))}}throw new Error("Unknown selector value type: ".concat(e.value.type));case"<=":return function(I){return yr(I,u)<=e.value.value};case"<":return function(I){return yr(I,u)<e.value.value};case">":return function(I){return yr(I,u)>e.value.value};case">=":return function(I){return yr(I,u)>=e.value.value}}throw new Error("Unknown operator: ".concat(e.operator));case"sibling":var _=Vt(e.left),h=Vt(e.right);return function(I,H,L){return h(I,H,L)&&hF(I,_,H,"LEFT_SIDE",L)||e.left.subject&&_(I,H,L)&&hF(I,h,H,"RIGHT_SIDE",L)};case"adjacent":var b=Vt(e.left),N=Vt(e.right);return function(I,H,L){return N(I,H,L)&&bF(I,b,H,"LEFT_SIDE",L)||e.right.subject&&b(I,H,L)&&bF(I,N,H,"RIGHT_SIDE",L)};case"nth-child":var M=e.index.value,R=Vt(e.right);return function(I,H,L){return R(I,H,L)&&yF(I,H,M,L)};case"nth-last-child":var v=-e.index.value,P=Vt(e.right);return function(I,H,L){return P(I,H,L)&&yF(I,H,v,L)};case"class":var D=e.name.toLowerCase();return function(I,H,L){if(L&&L.matchClass)return L.matchClass(e.name,I,H);if(L&&L.nodeTypeKey)return!1;switch(D){case"statement":if(I.type.slice(-9)==="Statement")return!0;case"declaration":return I.type.slice(-11)==="Declaration";case"pattern":if(I.type.slice(-7)==="Pattern")return!0;case"expression":return I.type.slice(-10)==="Expression"||I.type.slice(-7)==="Literal"||I.type==="Identifier"&&(H.length===0||H[0].type!=="MetaProperty")||I.type==="MetaProperty";case"function":return I.type==="FunctionDeclaration"||I.type==="FunctionExpression"||I.type==="ArrowFunctionExpression"}throw new Error("Unknown class name: ".concat(e.name))}}throw new Error("Unknown selector type: ".concat(e.type))}function nN(e,t){var n=t&&t.nodeTypeKey||"type",r=e[n];return t&&t.visitorKeys&&t.visitorKeys[r]?t.visitorKeys[r]:Fg.VisitorKeys[r]?Fg.VisitorKeys[r]:t&&typeof t.fallback=="function"?t.fallback(e):Object.keys(e).filter((function(i){return i!==n}))}function eN(e,t){var n=t&&t.nodeTypeKey||"type";return e!==null&&Dp(e)==="object"&&typeof e[n]=="string"}function hF(e,t,n,r,i){var o=tN(n,1)[0];if(!o)return!1;for(var s=nN(o,i),c=0;c<s.length;++c){var a=o[s[c]];if(Array.isArray(a)){var l=a.indexOf(e);if(l<0)continue;var p=void 0,u=void 0;r==="LEFT_SIDE"?(p=0,u=l):(p=l+1,u=a.length);for(var d=p;d<u;++d)if(eN(a[d],i)&&t(a[d],n,i))return!0}}return!1}function bF(e,t,n,r,i){var o=tN(n,1)[0];if(!o)return!1;for(var s=nN(o,i),c=0;c<s.length;++c){var a=o[s[c]];if(Array.isArray(a)){var l=a.indexOf(e);if(l<0)continue;if(r==="LEFT_SIDE"&&l>0&&eN(a[l-1],i)&&t(a[l-1],n,i)||r==="RIGHT_SIDE"&&l<a.length-1&&eN(a[l+1],i)&&t(a[l+1],n,i))return!0}}return!1}function yF(e,t,n,r){if(n===0)return!1;var i=tN(t,1)[0];if(!i)return!1;for(var o=nN(i,r),s=0;s<o.length;++s){var c=i[o[s]];if(Array.isArray(c)){var a=n<0?c.length+n:n-1;if(a>=0&&a<c.length&&c[a]===e)return!0}}return!1}function TF(e,t,n,r){if(t){var i=[],o=Vt(t),s=(function c(a,l){if(a==null||Dp(a)!="object")return[];l==null&&(l=a);for(var p=a.subject?[l]:[],u=Object.keys(a),d=0;d<u.length;++d){var m=u[d],_=a[m];p.push.apply(p,Oee(c(_,m==="left"?_:l)))}return p})(t).map(Vt);Fg.traverse(e,{enter:function(c,a){if(a!=null&&i.unshift(a),o(c,i,r))if(s.length)for(var l=0,p=s.length;l<p;++l){s[l](c,i,r)&&n(c,a,i);for(var u=0,d=i.length;u<d;++u){var m=i.slice(u+1);s[l](i[u],m,r)&&n(i[u],a,m)}}else n(c,a,i)},leave:function(){i.shift()},keys:r&&r.visitorKeys,fallback:r&&r.fallback||"iteration"})}}function IF(e,t,n){var r=[];return TF(e,t,(function(i){r.push(i)}),n),r}function AF(e){return Cee.parse(e)}function ni(e,t,n){return IF(e,AF(t),n)}ni.parse=AF,ni.match=IF,ni.traverse=TF,ni.matches=function(e,t,n,r){return!t||!!e&&(n||(n=[]),Vt(t)(e,n,r))},ni.query=ni;var Wg={};var NF={};var rN={exports:{}};var iN=ni,{parse:dn}=Wg,vF=e=>e.declarations?.[0]?.id?.properties?.[0]?.value?.name==="tr_ch_apm_tracingChannel",xee=/[^\w]/g,Is=e=>`tr_ch_apm$${e.replace(xee,"_")}`,oN=rN.exports={tracingChannelImport({dcModule:e,moduleType:t},n){if(n.body.some(vF))return;let r={module:t==="esm"},i=n.body.findIndex(a=>a.directive==="use strict"),o=t==="esm"?`import tr_ch_apm_dc from "${e}"`:`const tr_ch_apm_dc = require("${e}")`;n.body.splice(i+1,0,dn(o,r).body[0],dn("const { tracingChannel: tr_ch_apm_tracingChannel } = tr_ch_apm_dc",r).body[0],dn(`const tr_ch_apm_hasSubscribers = ch => ch.start.hasSubscribers
|
|
38
|
+
|| ch.end.hasSubscribers
|
|
39
|
+
|| ch.asyncStart.hasSubscribers
|
|
40
|
+
|| ch.asyncEnd.hasSubscribers
|
|
41
|
+
|| ch.error.hasSubscribers`,r).body[0])},tracingChannelDeclaration(e,t){let{channelName:n,module:{name:r}}=e,i=Is(n);if(t.body.some(c=>c.declarations?.[0]?.id?.name===i))return;oN.tracingChannelImport(e,t);let o=t.body.findIndex(vF),s=`
|
|
42
|
+
const ${i} = tr_ch_apm_tracingChannel("orchestrion:${r}:${n}")
|
|
43
|
+
`;t.body.splice(o+1,0,dn(s).body[0])},traceCallback:Vg,tracePromise:Vg,traceSync:Vg,traceAuto:Vg};function Pee(e){return[...(e||[]).filter(r=>r.type!=="RestElement"&&r.type!=="AssignmentPattern").map((r,i)=>({type:"Identifier",name:`__apm$arg${i}`})),{type:"RestElement",argument:{type:"Identifier",name:"__apm$args"}}]}function Vg(e,t,n,r){let i=r[r.length-1];t.type==="ClassDeclaration"||t.type==="ClassExpression"?Lee(e,t,i):kee(e,t,i)}function kee(e,t,n){oN.tracingChannelDeclaration(e,n);let{functionQuery:{methodName:r,privateMethodName:i,functionName:o,expressionName:s,propertyName:c}}=e,l=r==="constructor"||!r&&!i&&!o&&!s&&!c?"ArrowFunctionExpression":t.type,p=t.params;t.body=RF(e,{type:l,params:p,body:t.body,async:t.async,expression:!1,generator:t.generator},n),t.params=Pee(p),t.generator=!1,t.async=!1,OF(e,t)}function Lee(e,t,n){let{functionQuery:r,operator:i}=e,{methodName:o}=r;if(!o)return;let s=t.body;if(s.body.some(({key:p})=>p.name===o))return;let c=s.body.find(({kind:p})=>p==="constructor");oN.tracingChannelDeclaration(e,n),c||(c=dn(t.superClass?"class A extends Object { constructor (...args) { super(...args) } }":"class A { constructor () {} }").body[0].body.body[0],s.body.unshift(c));let a=dn(`
|
|
44
|
+
const __apm$${o} = this["${o}"]
|
|
45
|
+
this["${o}"] = function () {}
|
|
46
|
+
if (typeof __apm$${o} === 'function') {
|
|
47
|
+
Object.defineProperty(this["${o}"], 'length', {
|
|
48
|
+
value: __apm$${o}.length,
|
|
49
|
+
configurable: true
|
|
50
|
+
})
|
|
51
|
+
}
|
|
52
|
+
`).body,l=a[1].expression.right;l.params=[{type:"RestElement",argument:{type:"Identifier",name:"__apm$args"}}],l.async=i==="tracePromise",l.body=RF(e,{type:"Identifier",name:`__apm$${o}`},n),OF(e,l),c.value.body.body.push(...a)}function RF(e,t,n){let{operator:r,moduleVersion:i}=e,{returnKind:o}=e.functionQuery,s=o?Uee(e,o,n):"",c;r==="traceCallback"&&(c=CF(e,t,s)),r==="tracePromise"&&(c=xF(e,t,s)),r==="traceSync"&&(c=wee(e,t,s)),r==="traceAuto"&&(c=Mee(e,t,s));let a=(t.params||[]).filter(u=>u.type!=="RestElement"&&u.type!=="AssignmentPattern").map((u,d)=>`__apm$arg${d}`).concat("...__apm$args").join(", "),l=c.body[0].body,p=dn(t.type==="ArrowFunctionExpression"?`
|
|
53
|
+
const __apm$arguments = [${a}];
|
|
54
|
+
const __apm$ctx = {
|
|
55
|
+
arguments: __apm$arguments,
|
|
56
|
+
moduleVersion: ${JSON.stringify(i)}
|
|
57
|
+
};
|
|
58
|
+
const __apm$traced = () => {
|
|
59
|
+
const __apm$wrapped = () => {};
|
|
60
|
+
return __apm$wrapped(...__apm$arguments);
|
|
61
|
+
};
|
|
62
|
+
`:`
|
|
63
|
+
const __apm$arguments = [${a}].slice(0, arguments.length);
|
|
64
|
+
const __apm$ctx = {
|
|
65
|
+
arguments: __apm$arguments,
|
|
66
|
+
self: this,
|
|
67
|
+
moduleVersion: ${JSON.stringify(i)}
|
|
68
|
+
};
|
|
69
|
+
const __apm$traced = () => {
|
|
70
|
+
const __apm$wrapped = () => {};
|
|
71
|
+
return __apm$wrapped.apply(this, __apm$arguments);
|
|
72
|
+
};
|
|
73
|
+
`).body;return l.body.unshift(...p),iN.query(l,"[id.name=__apm$wrapped]")[0].init=t,l}function OF(e,t){let n=new Set;iN.traverse(t.body,iN.parse("[object.type=Super]"),(r,i)=>{let{name:o}=r.property,s;if(i.callee){let{expression:c}=dn(`__apm$super['${o}'].call(this)`).body[0];i.callee=s=c.callee,i.arguments.unshift(...c.arguments)}else i.expression=s=dn(`__apm$super['${o}']`).body[0];s.computed=i.callee.computed,s.optional=i.callee.optional,n.add(o)});for(let r of n){let i=dn(`
|
|
74
|
+
class Wrapper {
|
|
75
|
+
wrapper () {
|
|
76
|
+
__apm$super['${r}'] = super['${r}']
|
|
77
|
+
}
|
|
78
|
+
}
|
|
79
|
+
`).body[0].body.body[0].value.body.body[0];t.body.body.unshift(i)}n.size>0&&t.body.body.unshift(dn("const __apm$super = {}").body[0])}function Mee(e,t,n=""){let r=CF(e,t,n),i=xF(e,t,n),[o,s,c,a,l,p]=r.body[0].body.body,u={type:"IfStatement",test:a.test,consequent:{type:"BlockStatement",body:i.body[0].body.body},alternate:null};return r.body[0].body.body=[o,u,s,c,l,p],r}function CF(e,t,n=""){let{channelName:r,functionQuery:{callbackIndex:i=-1}}=e,o=Is(r);return dn(`
|
|
80
|
+
function wrapper () {
|
|
81
|
+
const __apm$cb = Array.prototype.at.call(__apm$arguments, ${i});
|
|
82
|
+
|
|
83
|
+
if (!${o}.start.hasSubscribers) return __apm$traced();
|
|
84
|
+
|
|
85
|
+
function __apm$wrappedCb(err, res) {
|
|
86
|
+
if (err) {
|
|
87
|
+
__apm$ctx.error = err;
|
|
88
|
+
${o}.error.publish(__apm$ctx);
|
|
89
|
+
} else {
|
|
90
|
+
__apm$ctx.result = res;
|
|
91
|
+
${n}
|
|
92
|
+
}
|
|
93
|
+
|
|
94
|
+
${o}.asyncStart.runStores(__apm$ctx, () => {
|
|
95
|
+
try {
|
|
96
|
+
if (__apm$cb) {
|
|
97
|
+
return __apm$cb.apply(this, arguments);
|
|
98
|
+
}
|
|
99
|
+
} finally {
|
|
100
|
+
${o}.asyncEnd.publish(__apm$ctx);
|
|
101
|
+
}
|
|
102
|
+
});
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
if (typeof __apm$cb !== 'function') {
|
|
106
|
+
return __apm$traced();
|
|
107
|
+
}
|
|
108
|
+
Array.prototype.splice.call(__apm$arguments, ${i}, 1, __apm$wrappedCb);
|
|
109
|
+
|
|
110
|
+
return ${o}.start.runStores(__apm$ctx, () => {
|
|
111
|
+
try {
|
|
112
|
+
return __apm$traced();
|
|
113
|
+
} catch (err) {
|
|
114
|
+
__apm$ctx.error = err;
|
|
115
|
+
${o}.error.publish(__apm$ctx);
|
|
116
|
+
throw err;
|
|
117
|
+
} finally {
|
|
118
|
+
__apm$ctx.self ??= this;
|
|
119
|
+
${o}.end.publish(__apm$ctx);
|
|
120
|
+
}
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
`)}function xF(e,t,n=""){let{channelName:r}=e,i=Is(r);return dn(`
|
|
124
|
+
function wrapper () {
|
|
125
|
+
if (!tr_ch_apm_hasSubscribers(${i})) return __apm$traced();
|
|
126
|
+
|
|
127
|
+
return ${i}.start.runStores(__apm$ctx, () => {
|
|
128
|
+
try {
|
|
129
|
+
let promise = __apm$traced();
|
|
130
|
+
if (typeof promise?.then !== 'function') {
|
|
131
|
+
__apm$ctx.result = promise;
|
|
132
|
+
${n}
|
|
133
|
+
return __apm$ctx.result;
|
|
134
|
+
}
|
|
135
|
+
// Mirror Node.js core diagnostics_channel behaviour: for native Promise
|
|
136
|
+
// instances, chain normally (safe since there is no subclass API to
|
|
137
|
+
// preserve). For Promise subclasses and other thenables, side-chain the
|
|
138
|
+
// callbacks for event publishing and return the original so that any
|
|
139
|
+
// subclass-specific methods (e.g. APIPromise.withResponse()) remain
|
|
140
|
+
// accessible to the caller.
|
|
141
|
+
if (promise instanceof Promise && promise.constructor === Promise) {
|
|
142
|
+
return promise.then(
|
|
143
|
+
result => {
|
|
144
|
+
__apm$ctx.result = result;
|
|
145
|
+
${n}
|
|
146
|
+
${i}.asyncStart.publish(__apm$ctx);
|
|
147
|
+
${i}.asyncEnd.publish(__apm$ctx);
|
|
148
|
+
return __apm$ctx.result;
|
|
149
|
+
},
|
|
150
|
+
err => {
|
|
151
|
+
__apm$ctx.error = err;
|
|
152
|
+
${i}.error.publish(__apm$ctx);
|
|
153
|
+
${i}.asyncStart.publish(__apm$ctx);
|
|
154
|
+
${i}.asyncEnd.publish(__apm$ctx);
|
|
155
|
+
throw err;
|
|
156
|
+
}
|
|
157
|
+
);
|
|
158
|
+
}
|
|
159
|
+
promise.then(
|
|
160
|
+
result => {
|
|
161
|
+
__apm$ctx.result = result;
|
|
162
|
+
${n}
|
|
163
|
+
${i}.asyncStart.publish(__apm$ctx);
|
|
164
|
+
${i}.asyncEnd.publish(__apm$ctx);
|
|
165
|
+
},
|
|
166
|
+
err => {
|
|
167
|
+
__apm$ctx.error = err;
|
|
168
|
+
${i}.error.publish(__apm$ctx);
|
|
169
|
+
${i}.asyncStart.publish(__apm$ctx);
|
|
170
|
+
${i}.asyncEnd.publish(__apm$ctx);
|
|
171
|
+
}
|
|
172
|
+
);
|
|
173
|
+
return promise;
|
|
174
|
+
} catch (err) {
|
|
175
|
+
__apm$ctx.error = err;
|
|
176
|
+
${i}.error.publish(__apm$ctx);
|
|
177
|
+
throw err;
|
|
178
|
+
} finally {
|
|
179
|
+
__apm$ctx.self ??= this;
|
|
180
|
+
${i}.end.publish(__apm$ctx);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
}
|
|
184
|
+
`)}function wee(e,t,n=""){let{channelName:r}=e,i=Is(r);return dn(`
|
|
185
|
+
function wrapper () {
|
|
186
|
+
if (!tr_ch_apm_hasSubscribers(${i})) return __apm$traced();
|
|
187
|
+
|
|
188
|
+
return ${i}.start.runStores(__apm$ctx, () => {
|
|
189
|
+
try {
|
|
190
|
+
__apm$ctx.result = __apm$traced();
|
|
191
|
+
${n}
|
|
192
|
+
} catch (err) {
|
|
193
|
+
__apm$ctx.error = err;
|
|
194
|
+
${i}.error.publish(__apm$ctx);
|
|
195
|
+
throw err;
|
|
196
|
+
} finally {
|
|
197
|
+
__apm$ctx.self ??= this;
|
|
198
|
+
${i}.end.publish(__apm$ctx);
|
|
199
|
+
}
|
|
200
|
+
return __apm$ctx.result;
|
|
201
|
+
});
|
|
202
|
+
}
|
|
203
|
+
`)}function Gee(e,t){let{channelName:n,module:{name:r}}=e,i=Is(n+":next");if(t.body.some(a=>a.declarations?.[0]?.id?.name===i))return;let o=Is(n),s=t.body.findIndex(a=>a.declarations?.[0]?.id?.name===o),c=`const ${i} = tr_ch_apm_tracingChannel("orchestrion:${r}:${n}:next")`;t.body.splice(s+1,0,dn(c).body[0])}function Uee(e,t,n){let{channelName:r}=e,i=t==="Iterator"?"traceSync":"tracePromise",o=Is(r+":next");return Gee(e,n),`
|
|
204
|
+
const __apm$iter = __apm$ctx.result;
|
|
205
|
+
if (__apm$iter != null && typeof __apm$iter.next === 'function') {
|
|
206
|
+
const __apm$patchIter = function (method) {
|
|
207
|
+
const __apm$orig = __apm$iter[method];
|
|
208
|
+
if (typeof __apm$orig !== 'function') return;
|
|
209
|
+
__apm$iter[method] = function () {
|
|
210
|
+
const __apm$iterArgs = Array.prototype.slice.call(arguments);
|
|
211
|
+
if (!tr_ch_apm_hasSubscribers(${o})) return __apm$orig.apply(this, __apm$iterArgs);
|
|
212
|
+
__apm$ctx.method = method;
|
|
213
|
+
__apm$ctx.arguments = __apm$iterArgs;
|
|
214
|
+
return ${o}.${i}(__apm$orig, __apm$ctx, this, ...__apm$iterArgs);
|
|
215
|
+
};
|
|
216
|
+
};
|
|
217
|
+
__apm$patchIter('next');
|
|
218
|
+
__apm$patchIter('throw');
|
|
219
|
+
__apm$patchIter('return');
|
|
220
|
+
}
|
|
221
|
+
`}var PF=rN.exports;var sN={};var MF=e=>{throw TypeError(e)},pN=(e,t,n)=>t.has(e)||MF("Cannot "+n),ri=(e,t,n)=>(pN(e,t,"read from private field"),n?n.call(e):t.get(e)),As=(e,t,n)=>t.has(e)?MF("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),hc=(e,t,n,r)=>(pN(e,t,"write to private field"),t.set(e,n),n),bc=(e,t,n)=>(pN(e,t,"access private method"),n),Bp,jg,Hp,yc,Zg,Xg,Io,wF,GF,UF,cN,DF,kF=ni,{parse:LF}=Wg,{generate:Dee}=NF,Bee=PF,aN,Yg,lN=class{constructor(t,n,r,i,o,s={}){As(this,Io),As(this,Bp,null),As(this,jg,null),As(this,Hp,null),As(this,yc,[]),As(this,Zg,null),As(this,Xg,{}),hc(this,Bp,t),hc(this,jg,n),hc(this,Hp,r),hc(this,yc,i),hc(this,Zg,o),hc(this,Xg,s)}free(){}get moduleName(){return ri(this,Bp)}get filePath(){return ri(this,Hp)}transform(t,n,r){if(Buffer.isBuffer(t)&&(t=t.toString()),!t)return{code:t};let i,o={},s=0;for(let c of ri(this,yc)){let{astQuery:a,functionQuery:l={}}=c;if(!i){let m={loc:!0,ranges:!0,raw:!0,module:n==="esm"};try{i=LF(t,m)}catch{i=LF(t,{...m,module:!m.module})}n==="esm"&&(o=bc(this,Io,UF).call(this,i))}let p=bc(this,Io,cN).call(this,l,o),u=a||bc(this,Io,DF).call(this,p),d={...c,dcModule:ri(this,Zg),moduleType:n,moduleVersion:ri(this,jg),functionQuery:p};d.operator=bc(this,Io,GF).call(this,d),kF.traverse(i,kF.parse(u),(...m)=>{s++,bc(this,Io,wF).call(this,d,...m)})}if(s===0&&ri(this,yc).length>0){let c=ri(this,yc).map(({astQuery:a,functionQuery:l={}})=>{if(a)return a;let p=bc(this,Io,cN).call(this,l,o),d=(h=>h.methodName||h.privateMethodName||h.functionName||h.expressionName||"constructor")(l),m=l.className||l.functionName||l.expressionName,_=p.className||p.functionName||p.expressionName;return m&&m!==_?`${m} (local name: ${_})`:d});throw new Error(`Failed to find injection points for: ${JSON.stringify(c)}`)}if(i){aN??(aN=sN.SourceMapConsumer),Yg??(Yg=sN.SourceMapGenerator);let c=`${ri(this,Bp)}/${ri(this,Hp)}`,a;if(r){let u=new aN(r);u.file=c,a=Yg.fromSourceMap(u)}else a=new Yg({file:c});let l=Dee(i,{sourceMap:a}),p=a.toString();return{code:l,map:p}}return{code:t}}};Bp=new WeakMap;jg=new WeakMap;Hp=new WeakMap;yc=new WeakMap;Zg=new WeakMap;Xg=new WeakMap;Io=new WeakSet;wF=function(e,...t){let n=ri(this,Xg)[e.operator]??Bee[e.operator],{index:r=0}=e.functionQuery,[i]=t,o=i.init?.type||i.type;o!=="ClassDeclaration"&&o!=="ClassExpression"&&(i.type==="VariableDeclarator"||(e.functionIndex=++e.functionIndex||0,r!==null&&r!==e.functionIndex))||n(e,...t)};GF=function({transform:e,functionQuery:{kind:t}}){if(e)return e;switch(t){case"Async":return"tracePromise";case"Auto":return"traceAuto";case"Callback":return"traceCallback";case"Sync":return"traceSync";default:return"traceSync"}};UF=function(e){let t={};for(let n of e.body)if(n.type==="ExportNamedDeclaration"&&!n.source){for(let r of n.specifiers)if(r.exported&&r.local){let i=r.exported.name??r.exported.value,o=r.local.name??r.local.value;i&&o&&(t[i]=o)}}return t};cN=function(e,t){if(!e.isExportAlias)return e;let{functionName:n,expressionName:r,className:i}=e;return n&&t[n]?{...e,functionName:t[n]}:r&&t[r]?{...e,expressionName:t[r]}:i&&t[i]?{...e,className:t[i]}:e};DF=function(e){let{functionName:t,expressionName:n,className:r,objectName:i,propertyName:o}=e,s=e.privateMethodName?"PrivateIdentifier":"Identifier",c=[],a=e.methodName||e.privateMethodName;if(r?(a??(a="constructor"),c.push(`[id.name="${r}"]`,`[id.name="${r}"] > ClassExpression`,`[id.name="${r}"] > ClassBody > [key.name="${a}"][key.type=${s}] > [async]`,`[id.name="${r}"] > ClassExpression > ClassBody > [key.name="${a}"][key.type=${s}] > [async]`)):a&&c.push(`ClassBody > [key.name="${a}"][key.type=${s}] > [async]`,`Property[key.name="${a}"][key.type=${s}] > [async]`),t?c.push(`FunctionDeclaration[id.name="${t}"][async]`):n&&c.push(`FunctionExpression[id.name="${n}"][async]`,`ArrowFunctionExpression[id.name="${n}"][async]`,`VariableDeclarator[id.name="${n}"] > FunctionExpression[async]`,`VariableDeclarator[id.name="${n}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.property.name="${n}"] > FunctionExpression[async]`,`AssignmentExpression[left.property.name="${n}"] > ArrowFunctionExpression[async]`,`AssignmentExpression[left.name="${n}"] > FunctionExpression[async]`,`AssignmentExpression[left.name="${n}"] > ArrowFunctionExpression[async]`),i||o){if(!i||!o)throw new Error(`functionQuery: 'objectName' and 'propertyName' must be used together (got objectName=${i}, propertyName=${o})`);let l=i==="this"?"left.object.type=ThisExpression":`left.object.name="${i}"`;c.push(`AssignmentExpression[${l}][left.property.name="${o}"] > [async]`)}return c.join(", ")};var BF={Transformer:lN};var HF=e=>{throw TypeError(e)},FF=(e,t,n)=>t.has(e)||HF("Cannot "+n),Ao=(e,t,n)=>(FF(e,t,"read from private field"),n?n.call(e):t.get(e)),Kg=(e,t,n)=>t.has(e)?HF("Cannot add the same private member more than once"):t instanceof WeakSet?t.add(e):t.set(e,n),uN=(e,t,n,r)=>(FF(e,t,"write to private field"),t.set(e,n),n),qg,Qg,Ns,Jg,Hee=fF,{Transformer:Fee}=BF,dN=class{constructor(t,n){Kg(this,qg,[]),Kg(this,Qg,null),Kg(this,Ns,{}),Kg(this,Jg,{}),uN(this,qg,t),uN(this,Qg,n||"diagnostics_channel")}free(){uN(this,Ns,{})}addTransform(t,n){Ao(this,Jg)[t]=n}getTransformer(t,n,r){r=r.replace(/\\/g,"/");let i=`${t}/${r}@${n}`;if(Ao(this,Ns)[i])return Ao(this,Ns)[i];let o=Ao(this,qg).filter(({module:s})=>s.name===t&&(typeof s.filePath=="string"?s.filePath===r:s.filePath.test(r))&&Hee(n,s.versionRange));if(o.length!==0)return Ao(this,Ns)[i]=new Fee(t,n,r,o,Ao(this,Qg),Ao(this,Jg)),Ao(this,Ns)[i]}};qg=new WeakMap;Qg=new WeakMap;Ns=new WeakMap;Jg=new WeakMap;var WF={InstrumentationMatcher:dN};var{InstrumentationMatcher:Wee}=WF;function Vee(e,t){return new Wee(e,t)}var VF={create:Vee};var $g=VF;import pte from"module";import Yee from"path";var mN=Yee.sep,fN=function(e){var t=e.split(mN),n=t.lastIndexOf("node_modules");if(n!==-1&&t[n+1]){for(var r=t[n+1][0]==="@",i=r?t[n+1]+"/"+t[n+2]:t[n+1],o=r?3:2,s="",c=n+o-1,a=0;a<=c;a++)a===c?s+=t[a]:s+=t[a]+mN;for(var l="",p=t.length-1,u=n+o;u<=p;u++)u===p?l+=t[u]:l+=t[u]+mN;return{name:i,basedir:s,path:l}}},YF=Eo(fN);import ute from"url";import jee from"fs";import Zee from"path";var{readFileSync:Xee}=jee,{join:Kee}=Zee,gN=new Map;function qee(e){if(gN.has(e))return gN.get(e);try{let t=Kee(e,"package.json"),n=Xee(t),{version:r}=JSON.parse(n);return gN.set(e,r),r}catch{return process.version.slice(1)}}var _N=qee,jF=Eo(_N);var hN;function Qee(e){hN=e}function Jee(e){hN&&hN(e)}var Mi={setDiagnosticsHook:Qee,emitDiagnostics:Jee};var zg={exports:{}};import cte from"tty";import lte from"util";import $ee from"os";import zee from"tty";var ZF=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),i=t.indexOf("--");return r!==-1&&(i===-1||r<i)};var ete=$ee,XF=zee,qn=ZF,{env:Pt}=process,No;qn("no-color")||qn("no-colors")||qn("color=false")||qn("color=never")?No=0:(qn("color")||qn("colors")||qn("color=true")||qn("color=always"))&&(No=1);"FORCE_COLOR"in Pt&&(Pt.FORCE_COLOR==="true"?No=1:Pt.FORCE_COLOR==="false"?No=0:No=Pt.FORCE_COLOR.length===0?1:Math.min(parseInt(Pt.FORCE_COLOR,10),3));function bN(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function yN(e,t){if(No===0)return 0;if(qn("color=16m")||qn("color=full")||qn("color=truecolor"))return 3;if(qn("color=256"))return 2;if(e&&!t&&No===void 0)return 0;let n=No||0;if(Pt.TERM==="dumb")return n;if(process.platform==="win32"){let r=ete.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Pt)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Pt)||Pt.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Pt)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Pt.TEAMCITY_VERSION)?1:0;if(Pt.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Pt){let r=parseInt((Pt.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Pt.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Pt.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Pt.TERM)||"COLORTERM"in Pt?1:n}function tte(e){let t=yN(e,e&&e.isTTY);return bN(t)}var KF={supportsColor:tte,stdout:bN(yN(!0,XF.isatty(1))),stderr:bN(yN(!0,XF.isatty(2)))};var Sc=1e3,Ec=Sc*60,Tc=Ec*60,vs=Tc*24,nte=vs*7,rte=vs*365.25,qF=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return ite(e);if(n==="number"&&isFinite(e))return t.long?ste(e):ote(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function ite(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*rte;case"weeks":case"week":case"w":return n*nte;case"days":case"day":case"d":return n*vs;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Tc;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ec;case"seconds":case"second":case"secs":case"sec":case"s":return n*Sc;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function ote(e){var t=Math.abs(e);return t>=vs?Math.round(e/vs)+"d":t>=Tc?Math.round(e/Tc)+"h":t>=Ec?Math.round(e/Ec)+"m":t>=Sc?Math.round(e/Sc)+"s":e+"ms"}function ste(e){var t=Math.abs(e);return t>=vs?e_(e,t,vs,"day"):t>=Tc?e_(e,t,Tc,"hour"):t>=Ec?e_(e,t,Ec,"minute"):t>=Sc?e_(e,t,Sc,"second"):e+" ms"}function e_(e,t,n,r){var i=t>=n*1.5;return Math.round(e/n)+" "+r+(i?"s":"")}function ate(e){n.debug=n,n.default=n,n.coerce=a,n.disable=s,n.enable=i,n.enabled=c,n.humanize=qF,n.destroy=l,Object.keys(e).forEach(p=>{n[p]=e[p]}),n.names=[],n.skips=[],n.formatters={};function t(p){let u=0;for(let d=0;d<p.length;d++)u=(u<<5)-u+p.charCodeAt(d),u|=0;return n.colors[Math.abs(u)%n.colors.length]}n.selectColor=t;function n(p){let u,d=null,m,_;function h(...b){if(!h.enabled)return;let N=h,M=Number(new Date),R=M-(u||M);N.diff=R,N.prev=u,N.curr=M,u=M,b[0]=n.coerce(b[0]),typeof b[0]!="string"&&b.unshift("%O");let v=0;b[0]=b[0].replace(/%([a-zA-Z%])/g,(D,I)=>{if(D==="%%")return"%";v++;let H=n.formatters[I];if(typeof H=="function"){let L=b[v];D=H.call(N,L),b.splice(v,1),v--}return D}),n.formatArgs.call(N,b),(N.log||n.log).apply(N,b)}return h.namespace=p,h.useColors=n.useColors(),h.color=n.selectColor(p),h.extend=r,h.destroy=n.destroy,Object.defineProperty(h,"enabled",{enumerable:!0,configurable:!1,get:()=>d!==null?d:(m!==n.namespaces&&(m=n.namespaces,_=n.enabled(p)),_),set:b=>{d=b}}),typeof n.init=="function"&&n.init(h),h}function r(p,u){let d=n(this.namespace+(typeof u>"u"?":":u)+p);return d.log=this.log,d}function i(p){n.save(p),n.namespaces=p,n.names=[],n.skips=[];let u=(typeof p=="string"?p:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let d of u)d[0]==="-"?n.skips.push(d.slice(1)):n.names.push(d)}function o(p,u){let d=0,m=0,_=-1,h=0;for(;d<p.length;)if(m<u.length&&(u[m]===p[d]||u[m]==="*"))u[m]==="*"?(_=m,h=d,m++):(d++,m++);else if(_!==-1)m=_+1,h++,d=h;else return!1;for(;m<u.length&&u[m]==="*";)m++;return m===u.length}function s(){let p=[...n.names,...n.skips.map(u=>"-"+u)].join(",");return n.enable(""),p}function c(p){for(let u of n.skips)if(o(p,u))return!1;for(let u of n.names)if(o(p,u))return!0;return!1}function a(p){return p instanceof Error?p.stack||p.message:p}function l(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}var QF=ate;(function(e,t){let n=cte,r=lte;t.init=p,t.log=c,t.formatArgs=o,t.save=a,t.load=l,t.useColors=i,t.destroy=r.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."),t.colors=[6,2,3,4,5,1];try{let d=KF;d&&(d.stderr||d).level>=2&&(t.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}t.inspectOpts=Object.keys(process.env).filter(d=>/^debug_/i.test(d)).reduce((d,m)=>{let _=m.substring(6).toLowerCase().replace(/_([a-z])/g,(b,N)=>N.toUpperCase()),h=process.env[m];return/^(yes|on|true|enabled)$/i.test(h)?h=!0:/^(no|off|false|disabled)$/i.test(h)?h=!1:h==="null"?h=null:h=Number(h),d[_]=h,d},{});function i(){return"colors"in t.inspectOpts?!!t.inspectOpts.colors:n.isatty(process.stderr.fd)}function o(d){let{namespace:m,useColors:_}=this;if(_){let h=this.color,b="\x1B[3"+(h<8?h:"8;5;"+h),N=` ${b};1m${m} \x1B[0m`;d[0]=N+d[0].split(`
|
|
222
|
+
`).join(`
|
|
223
|
+
`+N),d.push(b+"m+"+e.exports.humanize(this.diff)+"\x1B[0m")}else d[0]=s()+m+" "+d[0]}function s(){return t.inspectOpts.hideDate?"":new Date().toISOString()+" "}function c(...d){return process.stderr.write(r.formatWithOptions(t.inspectOpts,...d)+`
|
|
224
|
+
`)}function a(d){d?process.env.DEBUG=d:delete process.env.DEBUG}function l(){return process.env.DEBUG}function p(d){d.inspectOpts={};let m=Object.keys(t.inspectOpts);for(let _=0;_<m.length;_++)d.inspectOpts[m[_]]=t.inspectOpts[m[_]]}e.exports=QF(t);let{formatters:u}=e.exports;u.o=function(d){return this.inspectOpts.colors=this.useColors,r.inspect(d,this.inspectOpts).split(`
|
|
225
|
+
`).map(m=>m.trim()).join(" ")},u.O=function(d){return this.inspectOpts.colors=this.useColors,r.inspect(d,this.inspectOpts)}})(zg,zg.exports);var SN=zg.exports,JF=Eo(SN);import dte from"os";import mte from"path";import fte from"fs";var{create:gte}=$g,EN=pte,_te=fN,{pathToFileURL:$F}=ute,hte=_N,{emitDiagnostics:zF}=Mi,t_=SN("@apm-js-collab/tracing-hooks:module-patch"),TN=class{constructor({instrumentations:t=[]}={}){this.packages=new Set(t.map(n=>n.module.name)),this.instrumentator=gte(t),this.compile=EN.prototype._compile}patch(){let t=this;EN.prototype._compile=function(...r){let[i,o]=r,s=_te(o);if(s&&t.packages.has(s.name)){t_("found resolved module, checking if there is a transformer %s",o);let c=hte(s.basedir,s.name),a=t.instrumentator.getTransformer(s.name,c,s.path);if(a){t_("transforming file %s",o);try{let l=a.transform(i,"cjs");r[0]=l?.code,zF({url:$F(o).href,moduleName:a.moduleName}),process.env.TRACING_DUMP&&bte(r[0],o)}catch(l){t_("Error transforming module %s: %o",o,l),zF({url:$F(o).href,moduleName:a.moduleName,error:l})}finally{a.free()}}}return t.compile.apply(this,r)}}unpatch(){EN.prototype._compile=this.compile}};function bte(e,t){let n=dte,r=mte,i=fte,o=process.env.TRACING_DUMP_DIR??n.tmpdir(),s=r.dirname(t),c=r.basename(t),a=r.join(o,s),l=r.join(a,c);t_("Dumping patched code to: %s",l),i.mkdirSync(a,{recursive:!0}),i.writeFileSync(l,e)}var yte=TN,e2=Eo(yte);import{fileURLToPath as Ste}from"url";import{MessageChannel as Ete}from"worker_threads";import{readFileSync as Tte}from"fs";var t2=JF("@apm-js-collab/tracing-hooks:esm-hook"),n_=null,n2=null,r2=null,IN=Mi.emitDiagnostics;function i2(){let{port1:e,port2:t}=new Ete;return e.on("message",Mi.emitDiagnostics),e.unref(),t}function o2(e={}){let t=e?.instrumentations||[];r2=$g.create(t),n2=new Set(t.map(n=>n.module.name)),n_=new Map,IN=e?.diagnosticsPort?Ite(e.diagnosticsPort):Mi.emitDiagnostics}function Ite(e){return t=>{try{let n=t.error===void 0||t.error instanceof Error?t.error:new Error(String(t.error));e.postMessage({...t,error:n})}catch(n){t2("failed to post diagnostics for %s: %o",t.url,n)}}}function Ate(e){let t=YF(e.url);if(t&&n2.has(t.name)){let n=Ste(t.basedir),r=jF(n),i=r2.getTransformer(t.name,r,t.path);i&&n_.set(e.url,i)}return e}function s2(e,t,n){return Ate(n(e,t))}function a2(e,t,n){let r=n(e,t);if(n_.has(e)===!1)return r;if(r.format==="commonjs"){let i=new URL(r.responseURL??e);r.source??=Tte(i)}return Nte(e,r)}function Nte(e,t){let n=t.source;if(n){let r=n_.get(e);try{let i=t.format==="module"?"esm":t.format==="commonjs"?"cjs":"unknown",o=typeof n=="string"?n:Buffer.from(n).toString("utf8"),s=r.transform(o,i);t.source=s?.code,t.shortCircuit=!0,IN({url:e,moduleName:r.moduleName})}catch(i){t2("Error transforming module %s: %o",e,i),IN({url:e,moduleName:r.moduleName,error:i})}finally{r.free()}}return t}var DWe=Mi.setDiagnosticsHook;function Cte(e){if(e){let{major:r=0,minor:i=0}=Ms(e);return r>2||r===2&&i>=8}let{major:t=0,minor:n=0}=Ms(process.versions.node??"0.0.0");return t>25||t===25&&n>=1||t===24&&n>=13}function c2(e){if(!Rte&&!Ote||te?.__SENTRY_ORCHESTRION__?.runtime)return;let t=globalThis,n=Cte(t.Deno?.version?.deno),r=vte;Mi.setDiagnosticsHook(({moduleName:i,error:o})=>{o?g.warn(`[orchestrion] failed to inject diagnostics-channel into ${i}:`,o):(te.__SENTRY_ORCHESTRION__=te.__SENTRY_ORCHESTRION__||{},te.__SENTRY_ORCHESTRION__.runtime=te.__SENTRY_ORCHESTRION__.runtime||[],te.__SENTRY_ORCHESTRION__.runtime.push(i))});try{if(typeof r.registerHooks=="function"&&n)o2({instrumentations:Up}),r.registerHooks({resolve:s2,load:a2}),g.log("Registered diagnostics-channel injection via Module.registerHooks()");else if(typeof r.register=="function"&&!t.Bun&&!t.Deno){let i=i2(),o;o=import.meta.url,r.register("@sentry/server-utils/orchestrion/hook",{parentURL:o,data:{instrumentations:Up,diagnosticsPort:i},transferList:[i]}),new e2({instrumentations:Up}).patch(),g.log("Registered diagnostics-channel injection via Module.register()")}else{g.warn("No available Node API to register diagnostics-channel injection hooks; skipping.");return}}catch(i){g.warn("Failed to register diagnostics-channel injection hooks; channel-based integrations will not record spans.",i);return}te.__SENTRY_ORCHESTRION__=te.__SENTRY_ORCHESTRION__||{},te.__SENTRY_ORCHESTRION__.runtime=te.__SENTRY_ORCHESTRION__.runtime||[]}function xte(){return mA}function Pte(e){cw(()=>{let t=Object.values(mA).map(r=>r()),n=t.map(r=>r.name);return{integrations:[...t,wI({responseHook:_s}),dA({responseHook:_s})],replacedOtelIntegrationNames:n,register:()=>c2(),detect:cA}})}export{en as NODE_VERSION,Za as NodeClient,ZA as OpenFeatureIntegrationHook,q as SDK_VERSION,B as SEMANTIC_ATTRIBUTE_SENTRY_OP,S as SEMANTIC_ATTRIBUTE_SENTRY_ORIGIN,Hn as SEMANTIC_ATTRIBUTE_SENTRY_SAMPLE_RATE,ve as SEMANTIC_ATTRIBUTE_SENTRY_SOURCE,Zt as Scope,ql as SentryContextManager,XS as _INTERNAL_normalizeCollectionInterval,on as addBreadcrumb,Vh as addEventProcessor,qh as addIntegration,LA as amqplibIntegration,ZL as anrIntegration,BA as anthropicAIIntegration,bee as applyDiagnosticsChannelInjectionIntegrations,_n as bindScopeToEmitter,$8 as buildLaunchDarklyFlagUsedHandler,qc as captureCheckIn,yb as captureConsoleIntegration,Xc as captureEvent,me as captureException,Mb as captureFeedback,Zc as captureMessage,Yh as captureSession,dm as childProcessIntegration,Fh as close,wT as connectIntegration,Am as consoleIntegration,wb as consoleLoggingIntegration,fm as contextLinesIntegration,An as continueTrace,Ub as createConsolaReporter,Cm as createGetModuleFromFilename,mr as createLangChainCallbackHandler,zL as createSentryWinstonTransport,aa as createTransport,cM as cron,R8 as dataloaderIntegration,Sb as dedupeIntegration,Pm as defaultStackParser,xte as diagnosticsChannelInjectionIntegrations,XL as disableAnrDetectionForCallback,Zo as endSession,Bu as eventFiltersIntegration,Pte as experimentalUseDiagnosticsChannelInjection,Iy as expressErrorHandler,tE as expressIntegration,Eb as extraErrorDataIntegration,wE as fastifyIntegration,xb as featureFlagsIntegration,KA as firebaseIntegration,Yo as flush,P9 as fsIntegration,nl as functionToStringIntegration,de as generateInstrumentOnce,bA as genericPoolIntegration,Q as getActiveSpan,qA as getAutoPerformanceIntegrations,C as getClient,ne as getCurrentScope,uF as getDefaultIntegrations,pF as getDefaultIntegrationsWithoutPerformance,wo as getGlobalScope,J as getIsolationScope,Re as getRootSpan,xm as getSentryRelease,Mc as getSpanDescendants,Xt as getSpanStatusFromHttpCode,$e as getTraceData,db as getTraceMetaTags,FA as googleGenAIIntegration,WE as graphqlIntegration,nee as growthbookIntegration,OT as hapiIntegration,xT as honoIntegration,Hr as httpHeadersToSpanAttributes,QS as httpIntegration,ka as httpServerIntegration,La as httpServerSpansIntegration,rl as inboundFiltersIntegration,yee as init,JA as initOpenTelemetry,See as initWithoutDefaultIntegrations,gd as instrumentAnthropicAiClient,bd as instrumentGoogleGenAIClient,Ed as instrumentLangChainEmbeddings,$C as instrumentLangGraph,ud as instrumentOpenAiClient,Al as instrumentStateGraph,ry as instrumentStateGraphCompile,Vu as instrumentSupabaseClient,za as isDiagnosticsChannelInjectionEnabled,jo as isEnabled,Wh as isInitialized,qE as kafkaIntegration,h8 as knexIntegration,LT as koaIntegration,VA as langChainIntegration,jA as langGraphIntegration,Hh as lastEventId,J8 as launchDarklyIntegration,il as linkedErrorsIntegration,bm as localVariablesIntegration,jS as logger,JE as lruMemoizerIntegration,Om as makeNodeTransport,ft as metrics,ym as modulesIntegration,eT as mongoIntegration,nT as mongooseIntegration,cT as mysql2Integration,iT as mysqlIntegration,JS as nativeNodeFetchIntegration,mm as nodeContextIntegration,JL as nodeRuntimeMetricsIntegration,Sm as onUncaughtExceptionIntegration,Em as onUnhandledRejectionIntegration,UA as openAIIntegration,z8 as openFeatureIntegration,wu as parameterize,rM as pinoIntegration,TT as postgresIntegration,vT as postgresJsIntegration,mee as preloadOpenTelemetry,Qm as prismaIntegration,Tm as processSessionIntegration,Lb as profiler,_T as redisIntegration,ol as requestDataIntegration,vb as rewriteFramesIntegration,Dh as setAttribute,Uh as setAttributes,kh as setContext,R0 as setConversationId,ob as setCurrentClient,Mh as setExtra,Lh as setExtras,Bs as setHttpStatus,lh as setMeasurement,LS as setNodeAsyncContextStrategy,Gh as setTag,wh as setTags,Bh as setUser,EJ as setupConnectErrorHandler,L9 as setupExpressErrorHandler,K4 as setupFastifyErrorHandler,oJ as setupHapiErrorHandler,mJ as setupHonoErrorHandler,_J as setupKoaErrorHandler,Nl as spanStreamingIntegration,nh as spanToBaggageHeader,oe as spanToJSON,kc as spanToTraceHeader,Im as spotlightIntegration,k as startInactiveSpan,Nn as startNewTrace,Kc as startSession,Se as startSpan,ke as startSpanManual,eee as statsigIntegration,Rb as supabaseIntegration,Fn as suppressTracing,Nm as systemErrorIntegration,gA as tediousIntegration,oy as trpcMiddleware,tee as unleashIntegration,z_ as updateSpanName,Lm as validateOpenTelemetrySetup,wA as vercelAIIntegration,mO as winterCGHeadersToDict,se as withActiveSpan,nr as withIsolationScope,Dr as withMonitor,Be as withScope,rh as withStreamedSpan,yy as wrapMcpServerWithSentry,Ob as zodErrorsIntegration};
|