@visa/cli 2.0.0-rc.37 → 2.0.0-rc.39

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/dist/cli.js CHANGED
@@ -1,18 +1,18 @@
1
- "use strict";var j6=Object.create;var Yd=Object.defineProperty;var q6=Object.getOwnPropertyDescriptor;var Y6=Object.getOwnPropertyNames;var K6=Object.getPrototypeOf,W6=Object.prototype.hasOwnProperty;var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kd=(t,e)=>{for(var n in e)Yd(t,n,{get:e[n],enumerable:!0})},XN=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of Y6(e))!W6.call(t,o)&&o!==n&&Yd(t,o,{get:()=>e[o],enumerable:!(r=q6(e,o))||r.enumerable});return t};var v=(t,e,n)=>(n=t!=null?j6(K6(t)):{},XN(e||!t||!t.__esModule?Yd(n,"default",{value:t,enumerable:!0}):n,t)),I=t=>XN(Yd({},"__esModule",{value:!0}),t);var Zd=m((sBe,aJ)=>{aJ.exports={name:"@visa/cli",version:"2.0.0-rc.37",description:"AI-powered payments for Claude Code",bin:{"visa-cli":"./bin/visa-cli.js"},scripts:{prebuild:"pnpm --filter @visa/money build && pnpm --filter @visa-cli/tools build",build:"tsc --noEmit && node esbuild.config.js",dev:"tsc --watch",pretest:"pnpm build",start:"node dist/mcp-server/index.js",test:"jest --config jest.config.js","test:unit":"jest --config jest.config.js","test:unit:watch":"jest --config jest.config.js --watch","test:unit:coverage":"jest --config jest.config.js --coverage","test:smoke":"VISA_AUTH_URL=https://auth.visacli.sh jest --config jest.smoke.config.js","test:integration":"jest --config jest.integration.config.js","test:e2e":"jest --config jest.e2e.config.js","test:catalog-e2e":"jest --config jest.catalog-e2e.config.js","test:all":"npm run test:unit && npm run test:integration && npm run test:e2e",prepublishOnly:"npm run build && npm test",lint:"eslint src/**/*.ts",format:'prettier --write "src/**/*.ts"',"format:check":'prettier --check "src/**/*.ts"'},keywords:["visa","checkout","mcp","ai-agent","payments","click-to-pay","usdc","stablecoin"],author:"Visa Crypto Labs",license:"SEE LICENSE IN LICENSE",dependencies:{"@modelcontextprotocol/sdk":"^1.0.0",commander:"^12.1.0",zod:"^3.23.0"},devDependencies:{"@visa/money":"workspace:*","@visa/observability":"workspace:*","@visa-cli/tools":"workspace:*","@changesets/changelog-git":"^0.2.1","@changesets/cli":"^2.31.0","@types/jest":"^30.0.0","@types/node":"^25.6.0","@typescript-eslint/eslint-plugin":"^8.59.2","@typescript-eslint/parser":"^8.59.1","@types/express":"^5.0.0",esbuild:"^0.27.4",express:"^4.21.0",eslint:"^10.0.2","eslint-config-prettier":"^10.1.8",jest:"^29.7.0",prettier:"^3.8.3","ts-jest":"^29.2.0",typescript:"^5.7.0"},engines:{node:">=18.0.0"},mcpName:"io.github.visa-crypto-labs/visa-cli",files:["bin/visa-cli.js","dist/","install.ps1","native/visa-keychain.m","server.json","README.md","LICENSE"]}});var ET=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.micros=oZ;ct.fromCents=sZ;ct.fromUsdc=iZ;ct.fromUsd=aZ;ct.toCents=cZ;ct.toCentsForAcquirer=uZ;ct.toUsdc=lZ;ct.toWire=dZ;ct.fromWire=pZ;ct.toDisplay=_Z;ct.toUsdRounded2dp=fZ;ct.add=mZ;ct.sub=EZ;ct.clampNonNegative=SZ;ct.isNonNegative=TZ;ct.max=gZ;ct.min=hZ;var lo=10000n,ZC=1000000n;function oZ(t){return t}function sZ(t){if(!Number.isFinite(t)||!Number.isInteger(t)||!Number.isSafeInteger(t))throw new TypeError(`fromCents: expected safe integer, got ${t}`);return BigInt(t)*lo}function iZ(t){return t}function aZ(t){if(!Number.isFinite(t))throw new TypeError(`fromUsd: expected finite number, got ${t}`);return BigInt(Math.round(t*1e6))}function cZ(t){if(t>=0n)return Number(t/lo);let e=t/lo,n=t%lo;return Number(n===0n?e:e-1n)}function uZ(t){if(t<0n)throw new RangeError(`toCentsForAcquirer: refusing negative micros (${t}); card charges are non-negative`);return Number(t/lo)}function lZ(t){return t}function dZ(t){return t.toString()}function pZ(t){if(typeof t!="string"||t.length===0)throw new TypeError(`fromWire: expected non-empty string, got ${typeof t} ${JSON.stringify(t)}`);if(!/^-?\d+$/.test(t))throw new TypeError(`fromWire: not a valid micros integer: ${JSON.stringify(t)}`);return BigInt(t)}function _Z(t,e={}){let n=e.decimals??2,r=e.symbol??"$",o=t<0n,s=o?-t:t,i=s/ZC,a=s%ZC,c=o?"-":"";if(n===0)return`${c}${r}${i.toString()}`;let u=a.toString().padStart(6,"0").slice(0,n);return`${c}${r}${i.toString()}.${u}`}function fZ(t){let e=t<0n,n=e?-t:t,r=n/lo,s=n%lo*2n,i;s<lo?i=r:s>lo?i=r+1n:i=r%2n===0n?r:r+1n;let a=Number(i)/100;return e?-a:a}function mZ(t,e){return t+e}function EZ(t,e){return t-e}function SZ(t){return t<0n?0n:t}function TZ(t){return t>=0n}function gZ(t,e){return t>e?t:e}function hZ(t,e){return t<e?t:e}});var Eo,qT=B(()=>{Eo="1.9.1"});function U7(t){let e=new Set([t]),n=new Set,r=t.match(Kv);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(n.has(c))return!1;let u=c.match(Kv);if(!u)return s(c);let l={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return l.prerelease!=null||o.major!==l.major?s(c):o.major===0?o.minor===l.minor&&o.patch<=l.patch?i(c):s(c):o.minor<=l.minor?i(c):s(c)}}var Kv,Wv,zv=B(()=>{qT();Kv=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;Wv=U7(Eo)});function Lr(t,e,n,r=!1){var o;let s=$u[Fu]=(o=$u[Fu])!==null&&o!==void 0?o:{version:Eo};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==Eo){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Eo}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${Eo}.`),!0}function Rn(t){var e,n;let r=(e=$u[Fu])===null||e===void 0?void 0:e.version;if(!(!r||!Wv(r)))return(n=$u[Fu])===null||n===void 0?void 0:n[t]}function xr(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Eo}.`);let n=$u[Fu];n&&delete n[t]}var w7,Fu,$u,hi=B(()=>{qT();zv();w7=Eo.split(".")[0],Fu=Symbol.for(`opentelemetry.js.api.${w7}`),$u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function ju(t,e,n){let r=Rn("diag");if(r)return r[t](e,...n)}var bp,Xv=B(()=>{hi();bp=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return ju("debug",this._namespace,e)}error(...e){return ju("error",this._namespace,e)}info(...e){return ju("info",this._namespace,e)}warn(...e){return ju("warn",this._namespace,e)}verbose(...e){return ju("verbose",this._namespace,e)}}});var lt,Mp=B(()=>{(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(lt||(lt={}))});function Jv(t,e){t<lt.NONE?t=lt.NONE:t>lt.ALL&&(t=lt.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",lt.ERROR),warn:n("warn",lt.WARN),info:n("info",lt.INFO),debug:n("debug",lt.DEBUG),verbose:n("verbose",lt.VERBOSE)}}var Zv=B(()=>{Mp()});var k7,St,Ai=B(()=>{Xv();Zv();Mp();hi();k7="diag",St=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=Rn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:lt.INFO})=>{var i,a,c;if(o===n){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=d.stack)!==null&&i!==void 0?i:d.message),!1}typeof s=="number"&&(s={logLevel:s});let u=Rn("diag"),l=Jv((a=s.logLevel)!==null&&a!==void 0?a:lt.INFO,o);if(u&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";u.warn(`Current logger will be overwritten from ${d}`),l.warn(`Current logger will overwrite one already registered from ${d}`)}return Lr("diag",l,n,!0)};n.setLogger=r,n.disable=()=>{xr(k7,n)},n.createComponentLogger=o=>new bp(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var Lp,Qv=B(()=>{Lp=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var eI,tI=B(()=>{eI=Symbol("BaggageEntryMetadata")});function nI(t={}){return new Lp(new Map(Object.entries(t)))}function rI(t){return typeof t!="string"&&(V7.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:eI,toString(){return t}}}var V7,YT=B(()=>{Ai();Qv();tI();V7=St.instance()});function sr(t){return Symbol.for(t)}var KT,Ma,qu=B(()=>{KT=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},Ma=new KT});var WT,zT,xp,oI=B(()=>{WT=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],zT={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(zT[e]=console[e])}xp=class{constructor(){function e(n){return function(...r){let o=zT[n];if(typeof o!="function"&&(o=zT.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<WT.length;n++)this[WT[n].n]=e(WT[n].c)}}});function sI(){return og}var XT,La,JT,ZT,QT,eg,Yu,tg,ng,rg,og,B7,G7,H7,F7,$7,j7,q7,sg=B(()=>{XT=class{constructor(){}createGauge(e,n){return G7}createHistogram(e,n){return H7}createCounter(e,n){return B7}createUpDownCounter(e,n){return F7}createObservableGauge(e,n){return j7}createObservableCounter(e,n){return $7}createObservableUpDownCounter(e,n){return q7}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},La=class{},JT=class extends La{add(e,n){}},ZT=class extends La{add(e,n){}},QT=class extends La{record(e,n){}},eg=class extends La{record(e,n){}},Yu=class{addCallback(e){}removeCallback(e){}},tg=class extends Yu{},ng=class extends Yu{},rg=class extends Yu{},og=new XT,B7=new JT,G7=new QT,H7=new eg,F7=new ZT,$7=new tg,j7=new ng,q7=new rg});var Dp,iI=B(()=>{(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Dp||(Dp={}))});var Up,wp,ig=B(()=>{Up={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},wp={set(t,e,n){t!=null&&(t[e]=n)}}});var kp,aI=B(()=>{qu();kp=class{active(){return Ma}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var ag,Y7,Dr,Ku=B(()=>{aI();hi();Ai();ag="context",Y7=new kp,Dr=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return Lr(ag,e,St.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return Rn(ag)||Y7}disable(){this._getContextManager().disable(),xr(ag,St.instance())}}});var wn,cg=B(()=>{(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(wn||(wn={}))});var Wu,Ri,Vp,Bp=B(()=>{cg();Wu="0000000000000000",Ri="00000000000000000000000000000000",Vp={traceId:Ri,spanId:Wu,traceFlags:wn.NONE}});var Ur,Gp=B(()=>{Bp();Ur=class{constructor(e=Vp){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function Hp(t){return t.getValue(ug)||void 0}function cI(){return Hp(Dr.getInstance().active())}function zu(t,e){return t.setValue(ug,e)}function uI(t){return t.deleteValue(ug)}function lI(t,e){return zu(t,new Ur(e))}function Fp(t){var e;return(e=Hp(t))===null||e===void 0?void 0:e.spanContext()}var ug,lg=B(()=>{qu();Gp();Ku();ug=sr("OpenTelemetry Context Key SPAN")});function dI(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=($p[t.charCodeAt(r)]|0)+($p[t.charCodeAt(r+1)]|0)+($p[t.charCodeAt(r+2)]|0)+($p[t.charCodeAt(r+3)]|0);return n===e}function dg(t){return dI(t,32)&&t!==Ri}function pg(t){return dI(t,16)&&t!==Wu}function So(t){return dg(t.traceId)&&pg(t.spanId)}function pI(t){return new Ur(t)}var $p,jp=B(()=>{Bp();Gp();$p=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function K7(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var _g,xa,fg=B(()=>{Ku();lg();Gp();jp();_g=Dr.getInstance(),xa=class{startSpan(e,n,r=_g.active()){if(!!n?.root)return new Ur;let s=r&&Fp(r);return K7(s)&&So(s)?new Ur(s):new Ur}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??_g.active(),u=this.startSpan(e,s,c),l=zu(c,u);return _g.with(l,a,void 0,u)}}});var W7,Da,mg=B(()=>{fg();W7=new xa,Da=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):W7}}});var qp,_I=B(()=>{fg();qp=class{getTracer(e,n,r){return new xa}}});var z7,yi,Eg=B(()=>{mg();_I();z7=new qp,yi=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new Da(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:z7}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var Yp,fI=B(()=>{(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Yp||(Yp={}))});var It,mI=B(()=>{(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(It||(It={}))});var ve,EI=B(()=>{(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(ve||(ve={}))});function SI(t){return Z7.test(t)}function TI(t){return Q7.test(t)&&!eee.test(t)}var Sg,X7,J7,Z7,Q7,eee,gI=B(()=>{Sg="[_0-9a-z-*/]",X7=`[a-z]${Sg}{0,255}`,J7=`[a-z0-9]${Sg}{0,240}@[a-z]${Sg}{0,13}`,Z7=new RegExp(`^(?:${X7}|${J7})$`),Q7=/^[ -~]{0,255}[!-~]$/,eee=/,|=/});var hI,tee,AI,RI,Kp,yI=B(()=>{gI();hI=32,tee=512,AI=",",RI="=",Kp=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+RI+this.get(n)),e),[]).join(AI)}_parse(e){e.length>tee||(this._internalState=e.split(AI).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(RI);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);SI(i)&&TI(a)&&n.set(i,a)}return n},new Map),this._internalState.size>hI&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,hI))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function OI(t){return new Kp(t)}var NI=B(()=>{yI()});var K,CI=B(()=>{Ku();K=Dr.getInstance()});var yn,vI=B(()=>{Ai();yn=St.instance()});var Tg,II,PI=B(()=>{sg();Tg=class{getMeter(e,n,r){return og}},II=new Tg});var gg,Wp,bI=B(()=>{PI();hi();Ai();gg="metrics",Wp=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return Lr(gg,e,St.instance())}getMeterProvider(){return Rn(gg)||II}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){xr(gg,St.instance())}}});var hg,MI=B(()=>{bI();hg=Wp.getInstance()});var zp,LI=B(()=>{zp=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function Rg(t){return t.getValue(Ag)||void 0}function xI(){return Rg(Dr.getInstance().active())}function DI(t,e){return t.setValue(Ag,e)}function UI(t){return t.deleteValue(Ag)}var Ag,wI=B(()=>{Ku();qu();Ag=sr("OpenTelemetry Baggage Key")});var yg,nee,Xp,kI=B(()=>{hi();LI();ig();wI();YT();Ai();yg="propagation",nee=new zp,Xp=class t{constructor(){this.createBaggage=nI,this.getBaggage=Rg,this.getActiveBaggage=xI,this.setBaggage=DI,this.deleteBaggage=UI}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return Lr(yg,e,St.instance())}inject(e,n,r=wp){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=Up){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){xr(yg,St.instance())}_getGlobalPropagator(){return Rn(yg)||nee}}});var Xt,VI=B(()=>{kI();Xt=Xp.getInstance()});var Og,Jp,BI=B(()=>{hi();Eg();jp();lg();Ai();Og="trace",Jp=class t{constructor(){this._proxyTracerProvider=new yi,this.wrapSpanContext=pI,this.isSpanContextValid=So,this.deleteSpan=uI,this.getSpan=Hp,this.getActiveSpan=cI,this.getSpanContext=Fp,this.setSpan=zu,this.setSpanContext=lI}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=Lr(Og,this._proxyTracerProvider,St.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return Rn(Og)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){xr(Og,St.instance()),this._proxyTracerProvider=new yi}}});var ne,GI=B(()=>{BI();ne=Jp.getInstance()});var V={};Kd(V,{DiagConsoleLogger:()=>xp,DiagLogLevel:()=>lt,INVALID_SPANID:()=>Wu,INVALID_SPAN_CONTEXT:()=>Vp,INVALID_TRACEID:()=>Ri,ProxyTracer:()=>Da,ProxyTracerProvider:()=>yi,ROOT_CONTEXT:()=>Ma,SamplingDecision:()=>Yp,SpanKind:()=>It,SpanStatusCode:()=>ve,TraceFlags:()=>wn,ValueType:()=>Dp,baggageEntryMetadataFromString:()=>rI,context:()=>K,createContextKey:()=>sr,createNoopMeter:()=>sI,createTraceState:()=>OI,default:()=>ree,defaultTextMapGetter:()=>Up,defaultTextMapSetter:()=>wp,diag:()=>yn,isSpanContextValid:()=>So,isValidSpanId:()=>pg,isValidTraceId:()=>dg,metrics:()=>hg,propagation:()=>Xt,trace:()=>ne});var ree,L=B(()=>{YT();qu();oI();Mp();sg();iI();ig();mg();Eg();fI();mI();EI();cg();NI();jp();Bp();CI();vI();MI();VI();GI();ree={context:K,diag:yn,metrics:hg,propagation:Xt,trace:ne}});var Xu=m(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.isTracingSuppressed=Zo.unsuppressTracing=Zo.suppressTracing=void 0;var oee=(L(),I(V)),Ng=(0,oee.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function see(t){return t.setValue(Ng,!0)}Zo.suppressTracing=see;function iee(t){return t.deleteValue(Ng)}Zo.unsuppressTracing=iee;function aee(t){return t.getValue(Ng)===!0}Zo.isTracingSuppressed=aee});var Cg=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.BAGGAGE_MAX_TOTAL_LENGTH=wt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=wt.BAGGAGE_MAX_NAME_VALUE_PAIRS=wt.BAGGAGE_HEADER=wt.BAGGAGE_ITEMS_SEPARATOR=wt.BAGGAGE_PROPERTIES_SEPARATOR=wt.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;wt.BAGGAGE_KEY_PAIR_SEPARATOR="=";wt.BAGGAGE_PROPERTIES_SEPARATOR=";";wt.BAGGAGE_ITEMS_SEPARATOR=",";wt.BAGGAGE_HEADER="baggage";wt.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;wt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;wt.BAGGAGE_MAX_TOTAL_LENGTH=8192});var vg=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.parseKeyPairsIntoRecord=wr.parsePairKeyValue=wr.getKeyPairs=wr.serializeKeyPairs=void 0;var cee=(L(),I(V)),Oi=Cg();function uee(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?Oi.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Oi.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}wr.serializeKeyPairs=uee;function lee(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Oi.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}wr.getKeyPairs=lee;function HI(t){let e=t.split(Oi.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let n=e.shift();if(!n)return;let r=n.indexOf(Oi.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim()),i;return e.length>0&&(i=(0,cee.baggageEntryMetadataFromString)(e.join(Oi.BAGGAGE_PROPERTIES_SEPARATOR))),{key:o,value:s,metadata:i}}wr.parsePairKeyValue=HI;function dee(t){return typeof t!="string"||t.length===0?{}:t.split(Oi.BAGGAGE_ITEMS_SEPARATOR).map(e=>HI(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,n)=>(e[n.key]=n.value,e),{})}wr.parseKeyPairsIntoRecord=dee});var FI=m(Zp=>{"use strict";Object.defineProperty(Zp,"__esModule",{value:!0});Zp.W3CBaggagePropagator=void 0;var Ig=(L(),I(V)),pee=Xu(),Ni=Cg(),Pg=vg(),bg=class{inject(e,n,r){let o=Ig.propagation.getBaggage(e);if(!o||(0,pee.isTracingSuppressed)(e))return;let s=(0,Pg.getKeyPairs)(o).filter(a=>a.length<=Ni.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Ni.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,Pg.serializeKeyPairs)(s);i.length>0&&r.set(n,Ni.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,Ni.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(Ni.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(Ni.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let u=(0,Pg.parsePairKeyValue)(c);if(u){let l={value:u.value};u.metadata&&(l.metadata=u.metadata),i[u.key]=l}}),Object.entries(i).length===0)?e:Ig.propagation.setBaggage(e,Ig.propagation.createBaggage(i))}fields(){return[Ni.BAGGAGE_HEADER]}};Zp.W3CBaggagePropagator=bg});var $I=m(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.AnchoredClock=void 0;var Mg=class{constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};Qp.AnchoredClock=Mg});var WI=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.isAttributeValue=Qo.isAttributeKey=Qo.sanitizeAttributes=void 0;var jI=(L(),I(V));function _ee(t){let e={};if(typeof t!="object"||t==null)return e;for(let[n,r]of Object.entries(t)){if(!qI(n)){jI.diag.warn(`Invalid attribute key: ${n}`);continue}if(!YI(r)){jI.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}Qo.sanitizeAttributes=_ee;function qI(t){return typeof t=="string"&&t.length>0}Qo.isAttributeKey=qI;function YI(t){return t==null?!0:Array.isArray(t)?fee(t):KI(t)}Qo.isAttributeValue=YI;function fee(t){let e;for(let n of t)if(n!=null){if(!e){if(KI(n)){e=typeof n;continue}return!1}if(typeof n!==e)return!1}return!0}function KI(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}});var Lg=m(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.loggingErrorHandler=void 0;var mee=(L(),I(V));function Eee(){return t=>{mee.diag.error(See(t))}}e_.loggingErrorHandler=Eee;function See(t){return typeof t=="string"?t:JSON.stringify(Tee(t))}function Tee(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var xg=m(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.globalErrorHandler=Ua.setGlobalErrorHandler=void 0;var gee=Lg(),zI=(0,gee.loggingErrorHandler)();function hee(t){zI=t}Ua.setGlobalErrorHandler=hee;function Aee(t){try{zI(t)}catch{}}Ua.globalErrorHandler=Aee});var Dg=m(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.TracesSamplerValues=void 0;var Ree;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(Ree=Ju.TracesSamplerValues||(Ju.TracesSamplerValues={}))});var Ug=m(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseEnvironment=Ue.DEFAULT_ENVIRONMENT=Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT=Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var es=(L(),I(V)),yee=Dg(),Oee=",",Nee=["OTEL_SDK_DISABLED"];function Cee(t){return Nee.indexOf(t)>-1}var vee=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function Iee(t){return vee.indexOf(t)>-1}var Pee=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];function bee(t){return Pee.indexOf(t)>-1}Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;Ue.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:es.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:yee.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};function Mee(t,e,n){if(typeof n[t]>"u")return;let r=String(n[t]);e[t]=r.toLowerCase()==="true"}function Lee(t,e,n,r=-1/0,o=1/0){if(typeof n[t]<"u"){let s=Number(n[t]);isNaN(s)||(s<r?e[t]=r:s>o?e[t]=o:e[t]=s)}}function xee(t,e,n,r=Oee){let o=n[t];typeof o=="string"&&(e[t]=o.split(r).map(s=>s.trim()))}var Dee={ALL:es.DiagLogLevel.ALL,VERBOSE:es.DiagLogLevel.VERBOSE,DEBUG:es.DiagLogLevel.DEBUG,INFO:es.DiagLogLevel.INFO,WARN:es.DiagLogLevel.WARN,ERROR:es.DiagLogLevel.ERROR,NONE:es.DiagLogLevel.NONE};function Uee(t,e,n){let r=n[t];if(typeof r=="string"){let o=Dee[r.toUpperCase()];o!=null&&(e[t]=o)}}function wee(t){let e={};for(let n in Ue.DEFAULT_ENVIRONMENT){let r=n;switch(r){case"OTEL_LOG_LEVEL":Uee(r,e,t);break;default:if(Cee(r))Mee(r,e,t);else if(Iee(r))Lee(r,e,t);else if(bee(r))xee(r,e,t);else{let o=t[r];typeof o<"u"&&o!==null&&(e[r]=String(o))}}}return e}Ue.parseEnvironment=wee});var XI=m(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.getEnvWithoutDefaults=wa.getEnv=void 0;var wg=Ug();function kee(){let t=(0,wg.parseEnvironment)(process.env);return Object.assign({},wg.DEFAULT_ENVIRONMENT,t)}wa.getEnv=kee;function Vee(){return(0,wg.parseEnvironment)(process.env)}wa.getEnvWithoutDefaults=Vee});var JI=m(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_._globalThis=void 0;t_._globalThis=typeof globalThis=="object"?globalThis:global});var kg=m(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});n_.hexToBinary=void 0;function ZI(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function Bee(t){let e=new Uint8Array(t.length/2),n=0;for(let r=0;r<t.length;r+=2){let o=ZI(t.charCodeAt(r)),s=ZI(t.charCodeAt(r+1));e[n++]=o<<4|s}return e}n_.hexToBinary=Bee});var QI=m(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.hexToBase64=void 0;var Gee=kg();function Hee(t){return Buffer.from((0,Gee.hexToBinary)(t)).toString("base64")}r_.hexToBase64=Hee});var nP=m(s_=>{"use strict";Object.defineProperty(s_,"__esModule",{value:!0});s_.RandomIdGenerator=void 0;var Fee=8,tP=16,Vg=class{constructor(){this.generateTraceId=eP(tP),this.generateSpanId=eP(Fee)}};s_.RandomIdGenerator=Vg;var o_=Buffer.allocUnsafe(tP);function eP(t){return function(){for(let n=0;n<t/4;n++)o_.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(o_[n]>0);n++)n===t-1&&(o_[t-1]=1);return o_.toString("hex",0,t)}}});var rP=m(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});i_.otperformance=void 0;var $ee=require("perf_hooks");i_.otperformance=$ee.performance});var Bg=m(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});a_.VERSION=void 0;a_.VERSION="1.30.1"});function ze(t){for(var e={},n=t.length,r=0;r<n;r++){var o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var Gg=B(()=>{});var oP,sP,iP,aP,cP,uP,lP,dP,pP,_P,fP,mP,EP,SP,TP,gP,hP,AP,RP,yP,OP,NP,CP,vP,IP,PP,bP,MP,LP,xP,DP,UP,wP,kP,VP,BP,GP,HP,FP,$P,jP,qP,YP,KP,WP,zP,XP,JP,ZP,QP,eb,tb,nb,rb,ob,sb,ib,ab,cb,ub,lb,db,pb,_b,fb,mb,Eb,Sb,Tb,gb,hb,Ab,Rb,yb,Ob,Nb,Cb,vb,Ib,Pb,bb,Mb,Lb,xb,Db,Ub,wb,kb,Vb,Bb,Gb,Hb,Fb,$b,jb,qb,Yb,Kb,Wb,zb,Xb,Jb,Zb,Qb,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,dM,pM,_M,fM,mM,EM,SM,TM,gM,hM,AM,RM,yM,jee,qee,Yee,Kee,Wee,zee,Xee,Jee,Zee,Qee,ete,tte,nte,rte,ote,ste,ite,ate,cte,ute,lte,dte,pte,_te,fte,mte,Ete,Ste,Tte,gte,hte,Ate,Rte,yte,Ote,Nte,Cte,vte,Ite,Pte,bte,Mte,Lte,xte,Dte,Ute,wte,kte,Vte,Bte,Gte,Hte,Fte,$te,jte,qte,Yte,Kte,Wte,zte,Xte,Jte,Zte,Qte,ene,tne,nne,rne,one,sne,ine,ane,cne,une,lne,dne,pne,_ne,fne,mne,Ene,Sne,Tne,gne,hne,Ane,Rne,yne,One,Nne,Cne,vne,Ine,Pne,bne,Mne,Lne,xne,Dne,Une,wne,kne,Vne,Bne,Gne,Hne,Fne,$ne,jne,qne,Yne,Kne,Wne,zne,Xne,Jne,Zne,Qne,ere,tre,nre,rre,ore,sre,ire,are,cre,ure,lre,OM,NM,CM,vM,IM,PM,bM,MM,LM,xM,DM,UM,wM,kM,VM,BM,GM,HM,FM,$M,jM,qM,YM,KM,WM,zM,XM,JM,ZM,QM,eL,tL,nL,rL,oL,sL,iL,aL,cL,uL,lL,dL,pL,_L,fL,mL,EL,dre,pre,_re,fre,mre,Ere,Sre,Tre,gre,hre,Are,Rre,yre,Ore,Nre,Cre,vre,Ire,Pre,bre,Mre,Lre,xre,Dre,Ure,wre,kre,Vre,Bre,Gre,Hre,Fre,$re,jre,qre,Yre,Kre,Wre,zre,Xre,Jre,Zre,Qre,eoe,toe,noe,roe,ooe,SL,TL,gL,hL,AL,RL,yL,OL,NL,CL,vL,soe,ioe,aoe,coe,uoe,loe,doe,poe,_oe,foe,moe,Eoe,IL,PL,bL,ML,LL,Soe,Toe,goe,hoe,Aoe,Roe,xL,DL,UL,yoe,Ooe,Noe,Coe,wL,kL,VL,BL,voe,Ioe,Poe,boe,Moe,GL,HL,FL,$L,jL,qL,YL,Loe,xoe,Doe,Uoe,woe,koe,Voe,Boe,KL,WL,zL,XL,JL,Goe,Hoe,Foe,$oe,joe,qoe,ZL,QL,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,dx,px,_x,fx,mx,Ex,Sx,Tx,Yoe,Koe,Woe,zoe,Xoe,Joe,Zoe,Qoe,ese,tse,nse,rse,ose,sse,ise,ase,cse,use,lse,dse,pse,_se,gx,hx,Ax,Rx,yx,fse,mse,Ese,Sse,Tse,gse,Ox,Nx,hse,Ase,Rse,Cx,vx,yse,Ose,Nse,Ix,Px,bx,Mx,Lx,xx,Dx,Ux,wx,kx,Vx,Bx,Gx,Hx,Fx,$x,jx,Cse,vse,Ise,Pse,bse,Mse,Lse,xse,Dse,Use,wse,kse,Vse,Bse,Gse,Hse,Fse,$se,qx,Yx,jse,qse,Yse,Kx=B(()=>{Gg();oP="aws.lambda.invoked_arn",sP="db.system",iP="db.connection_string",aP="db.user",cP="db.jdbc.driver_classname",uP="db.name",lP="db.statement",dP="db.operation",pP="db.mssql.instance_name",_P="db.cassandra.keyspace",fP="db.cassandra.page_size",mP="db.cassandra.consistency_level",EP="db.cassandra.table",SP="db.cassandra.idempotence",TP="db.cassandra.speculative_execution_count",gP="db.cassandra.coordinator.id",hP="db.cassandra.coordinator.dc",AP="db.hbase.namespace",RP="db.redis.database_index",yP="db.mongodb.collection",OP="db.sql.table",NP="exception.type",CP="exception.message",vP="exception.stacktrace",IP="exception.escaped",PP="faas.trigger",bP="faas.execution",MP="faas.document.collection",LP="faas.document.operation",xP="faas.document.time",DP="faas.document.name",UP="faas.time",wP="faas.cron",kP="faas.coldstart",VP="faas.invoked_name",BP="faas.invoked_provider",GP="faas.invoked_region",HP="net.transport",FP="net.peer.ip",$P="net.peer.port",jP="net.peer.name",qP="net.host.ip",YP="net.host.port",KP="net.host.name",WP="net.host.connection.type",zP="net.host.connection.subtype",XP="net.host.carrier.name",JP="net.host.carrier.mcc",ZP="net.host.carrier.mnc",QP="net.host.carrier.icc",eb="peer.service",tb="enduser.id",nb="enduser.role",rb="enduser.scope",ob="thread.id",sb="thread.name",ib="code.function",ab="code.namespace",cb="code.filepath",ub="code.lineno",lb="http.method",db="http.url",pb="http.target",_b="http.host",fb="http.scheme",mb="http.status_code",Eb="http.flavor",Sb="http.user_agent",Tb="http.request_content_length",gb="http.request_content_length_uncompressed",hb="http.response_content_length",Ab="http.response_content_length_uncompressed",Rb="http.server_name",yb="http.route",Ob="http.client_ip",Nb="aws.dynamodb.table_names",Cb="aws.dynamodb.consumed_capacity",vb="aws.dynamodb.item_collection_metrics",Ib="aws.dynamodb.provisioned_read_capacity",Pb="aws.dynamodb.provisioned_write_capacity",bb="aws.dynamodb.consistent_read",Mb="aws.dynamodb.projection",Lb="aws.dynamodb.limit",xb="aws.dynamodb.attributes_to_get",Db="aws.dynamodb.index_name",Ub="aws.dynamodb.select",wb="aws.dynamodb.global_secondary_indexes",kb="aws.dynamodb.local_secondary_indexes",Vb="aws.dynamodb.exclusive_start_table",Bb="aws.dynamodb.table_count",Gb="aws.dynamodb.scan_forward",Hb="aws.dynamodb.segment",Fb="aws.dynamodb.total_segments",$b="aws.dynamodb.count",jb="aws.dynamodb.scanned_count",qb="aws.dynamodb.attribute_definitions",Yb="aws.dynamodb.global_secondary_index_updates",Kb="messaging.system",Wb="messaging.destination",zb="messaging.destination_kind",Xb="messaging.temp_destination",Jb="messaging.protocol",Zb="messaging.protocol_version",Qb="messaging.url",eM="messaging.message_id",tM="messaging.conversation_id",nM="messaging.message_payload_size_bytes",rM="messaging.message_payload_compressed_size_bytes",oM="messaging.operation",sM="messaging.consumer_id",iM="messaging.rabbitmq.routing_key",aM="messaging.kafka.message_key",cM="messaging.kafka.consumer_group",uM="messaging.kafka.client_id",lM="messaging.kafka.partition",dM="messaging.kafka.tombstone",pM="rpc.system",_M="rpc.service",fM="rpc.method",mM="rpc.grpc.status_code",EM="rpc.jsonrpc.version",SM="rpc.jsonrpc.request_id",TM="rpc.jsonrpc.error_code",gM="rpc.jsonrpc.error_message",hM="message.type",AM="message.id",RM="message.compressed_size",yM="message.uncompressed_size",jee=oP,qee=sP,Yee=iP,Kee=aP,Wee=cP,zee=uP,Xee=lP,Jee=dP,Zee=pP,Qee=_P,ete=fP,tte=mP,nte=EP,rte=SP,ote=TP,ste=gP,ite=hP,ate=AP,cte=RP,ute=yP,lte=OP,dte=NP,pte=CP,_te=vP,fte=IP,mte=PP,Ete=bP,Ste=MP,Tte=LP,gte=xP,hte=DP,Ate=UP,Rte=wP,yte=kP,Ote=VP,Nte=BP,Cte=GP,vte=HP,Ite=FP,Pte=$P,bte=jP,Mte=qP,Lte=YP,xte=KP,Dte=WP,Ute=zP,wte=XP,kte=JP,Vte=ZP,Bte=QP,Gte=eb,Hte=tb,Fte=nb,$te=rb,jte=ob,qte=sb,Yte=ib,Kte=ab,Wte=cb,zte=ub,Xte=lb,Jte=db,Zte=pb,Qte=_b,ene=fb,tne=mb,nne=Eb,rne=Sb,one=Tb,sne=gb,ine=hb,ane=Ab,cne=Rb,une=yb,lne=Ob,dne=Nb,pne=Cb,_ne=vb,fne=Ib,mne=Pb,Ene=bb,Sne=Mb,Tne=Lb,gne=xb,hne=Db,Ane=Ub,Rne=wb,yne=kb,One=Vb,Nne=Bb,Cne=Gb,vne=Hb,Ine=Fb,Pne=$b,bne=jb,Mne=qb,Lne=Yb,xne=Kb,Dne=Wb,Une=zb,wne=Xb,kne=Jb,Vne=Zb,Bne=Qb,Gne=eM,Hne=tM,Fne=nM,$ne=rM,jne=oM,qne=sM,Yne=iM,Kne=aM,Wne=cM,zne=uM,Xne=lM,Jne=dM,Zne=pM,Qne=_M,ere=fM,tre=mM,nre=EM,rre=SM,ore=TM,sre=gM,ire=hM,are=AM,cre=RM,ure=yM,lre=ze([oP,sP,iP,aP,cP,uP,lP,dP,pP,_P,fP,mP,EP,SP,TP,gP,hP,AP,RP,yP,OP,NP,CP,vP,IP,PP,bP,MP,LP,xP,DP,UP,wP,kP,VP,BP,GP,HP,FP,$P,jP,qP,YP,KP,WP,zP,XP,JP,ZP,QP,eb,tb,nb,rb,ob,sb,ib,ab,cb,ub,lb,db,pb,_b,fb,mb,Eb,Sb,Tb,gb,hb,Ab,Rb,yb,Ob,Nb,Cb,vb,Ib,Pb,bb,Mb,Lb,xb,Db,Ub,wb,kb,Vb,Bb,Gb,Hb,Fb,$b,jb,qb,Yb,Kb,Wb,zb,Xb,Jb,Zb,Qb,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,dM,pM,_M,fM,mM,EM,SM,TM,gM,hM,AM,RM,yM]),OM="other_sql",NM="mssql",CM="mysql",vM="oracle",IM="db2",PM="postgresql",bM="redshift",MM="hive",LM="cloudscape",xM="hsqldb",DM="progress",UM="maxdb",wM="hanadb",kM="ingres",VM="firstsql",BM="edb",GM="cache",HM="adabas",FM="firebird",$M="derby",jM="filemaker",qM="informix",YM="instantdb",KM="interbase",WM="mariadb",zM="netezza",XM="pervasive",JM="pointbase",ZM="sqlite",QM="sybase",eL="teradata",tL="vertica",nL="h2",rL="coldfusion",oL="cassandra",sL="hbase",iL="mongodb",aL="redis",cL="couchbase",uL="couchdb",lL="cosmosdb",dL="dynamodb",pL="neo4j",_L="geode",fL="elasticsearch",mL="memcached",EL="cockroachdb",dre=OM,pre=NM,_re=CM,fre=vM,mre=IM,Ere=PM,Sre=bM,Tre=MM,gre=LM,hre=xM,Are=DM,Rre=UM,yre=wM,Ore=kM,Nre=VM,Cre=BM,vre=GM,Ire=HM,Pre=FM,bre=$M,Mre=jM,Lre=qM,xre=YM,Dre=KM,Ure=WM,wre=zM,kre=XM,Vre=JM,Bre=ZM,Gre=QM,Hre=eL,Fre=tL,$re=nL,jre=rL,qre=oL,Yre=sL,Kre=iL,Wre=aL,zre=cL,Xre=uL,Jre=lL,Zre=dL,Qre=pL,eoe=_L,toe=fL,noe=mL,roe=EL,ooe=ze([OM,NM,CM,vM,IM,PM,bM,MM,LM,xM,DM,UM,wM,kM,VM,BM,GM,HM,FM,$M,jM,qM,YM,KM,WM,zM,XM,JM,ZM,QM,eL,tL,nL,rL,oL,sL,iL,aL,cL,uL,lL,dL,pL,_L,fL,mL,EL]),SL="all",TL="each_quorum",gL="quorum",hL="local_quorum",AL="one",RL="two",yL="three",OL="local_one",NL="any",CL="serial",vL="local_serial",soe=SL,ioe=TL,aoe=gL,coe=hL,uoe=AL,loe=RL,doe=yL,poe=OL,_oe=NL,foe=CL,moe=vL,Eoe=ze([SL,TL,gL,hL,AL,RL,yL,OL,NL,CL,vL]),IL="datasource",PL="http",bL="pubsub",ML="timer",LL="other",Soe=IL,Toe=PL,goe=bL,hoe=ML,Aoe=LL,Roe=ze([IL,PL,bL,ML,LL]),xL="insert",DL="edit",UL="delete",yoe=xL,Ooe=DL,Noe=UL,Coe=ze([xL,DL,UL]),wL="alibaba_cloud",kL="aws",VL="azure",BL="gcp",voe=wL,Ioe=kL,Poe=VL,boe=BL,Moe=ze([wL,kL,VL,BL]),GL="ip_tcp",HL="ip_udp",FL="ip",$L="unix",jL="pipe",qL="inproc",YL="other",Loe=GL,xoe=HL,Doe=FL,Uoe=$L,woe=jL,koe=qL,Voe=YL,Boe=ze([GL,HL,FL,$L,jL,qL,YL]),KL="wifi",WL="wired",zL="cell",XL="unavailable",JL="unknown",Goe=KL,Hoe=WL,Foe=zL,$oe=XL,joe=JL,qoe=ze([KL,WL,zL,XL,JL]),ZL="gprs",QL="edge",ex="umts",tx="cdma",nx="evdo_0",rx="evdo_a",ox="cdma2000_1xrtt",sx="hsdpa",ix="hsupa",ax="hspa",cx="iden",ux="evdo_b",lx="lte",dx="ehrpd",px="hspap",_x="gsm",fx="td_scdma",mx="iwlan",Ex="nr",Sx="nrnsa",Tx="lte_ca",Yoe=ZL,Koe=QL,Woe=ex,zoe=tx,Xoe=nx,Joe=rx,Zoe=ox,Qoe=sx,ese=ix,tse=ax,nse=cx,rse=ux,ose=lx,sse=dx,ise=px,ase=_x,cse=fx,use=mx,lse=Ex,dse=Sx,pse=Tx,_se=ze([ZL,QL,ex,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,dx,px,_x,fx,mx,Ex,Sx,Tx]),gx="1.0",hx="1.1",Ax="2.0",Rx="SPDY",yx="QUIC",fse=gx,mse=hx,Ese=Ax,Sse=Rx,Tse=yx,gse={HTTP_1_0:gx,HTTP_1_1:hx,HTTP_2_0:Ax,SPDY:Rx,QUIC:yx},Ox="queue",Nx="topic",hse=Ox,Ase=Nx,Rse=ze([Ox,Nx]),Cx="receive",vx="process",yse=Cx,Ose=vx,Nse=ze([Cx,vx]),Ix=0,Px=1,bx=2,Mx=3,Lx=4,xx=5,Dx=6,Ux=7,wx=8,kx=9,Vx=10,Bx=11,Gx=12,Hx=13,Fx=14,$x=15,jx=16,Cse=Ix,vse=Px,Ise=bx,Pse=Mx,bse=Lx,Mse=xx,Lse=Dx,xse=Ux,Dse=wx,Use=kx,wse=Vx,kse=Bx,Vse=Gx,Bse=Hx,Gse=Fx,Hse=$x,Fse=jx,$se={OK:Ix,CANCELLED:Px,UNKNOWN:bx,INVALID_ARGUMENT:Mx,DEADLINE_EXCEEDED:Lx,NOT_FOUND:xx,ALREADY_EXISTS:Dx,PERMISSION_DENIED:Ux,RESOURCE_EXHAUSTED:wx,FAILED_PRECONDITION:kx,ABORTED:Vx,OUT_OF_RANGE:Bx,UNIMPLEMENTED:Gx,INTERNAL:Hx,UNAVAILABLE:Fx,DATA_LOSS:$x,UNAUTHENTICATED:jx},qx="SENT",Yx="RECEIVED",jse=qx,qse=Yx,Yse=ze([qx,Yx])});var Wx=B(()=>{Kx()});var zx,Xx,Jx,Zx,Qx,e0,t0,n0,r0,o0,s0,i0,a0,c0,u0,l0,d0,p0,_0,f0,m0,E0,S0,T0,g0,h0,A0,R0,y0,O0,N0,C0,v0,I0,P0,b0,M0,L0,x0,D0,U0,w0,k0,V0,B0,G0,H0,F0,$0,j0,q0,Y0,K0,W0,z0,X0,J0,Z0,Q0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,dD,pD,_D,fD,mD,ED,SD,TD,gD,hD,AD,Kse,Wse,zse,Xse,Jse,Zse,Qse,eie,tie,nie,rie,oie,sie,iie,aie,cie,uie,lie,die,pie,_ie,fie,mie,Eie,Sie,Tie,gie,hie,Aie,Rie,yie,Oie,Nie,Cie,vie,Iie,Pie,bie,Mie,Lie,xie,Die,Uie,wie,kie,Vie,Bie,Gie,Hie,Fie,$ie,jie,qie,Yie,Kie,Wie,zie,Xie,Jie,Zie,Qie,eae,tae,nae,rae,oae,sae,iae,aae,cae,uae,lae,dae,pae,_ae,fae,mae,Eae,Sae,Tae,gae,hae,RD,yD,OD,ND,Aae,Rae,yae,Oae,Nae,CD,vD,ID,PD,bD,MD,LD,xD,DD,UD,wD,kD,VD,BD,GD,HD,FD,Cae,vae,Iae,Pae,bae,Mae,Lae,xae,Dae,Uae,wae,kae,Vae,Bae,Gae,Hae,Fae,$ae,$D,jD,jae,qae,Yae,qD,YD,KD,WD,zD,XD,JD,Kae,Wae,zae,Xae,Jae,Zae,Qae,ece,ZD,QD,eU,tU,nU,rU,oU,sU,iU,aU,cU,tce,nce,rce,oce,sce,ice,ace,cce,uce,lce,dce,pce,uU,lU,dU,pU,_U,fU,mU,EU,SU,TU,_ce,fce,mce,Ece,Sce,Tce,gce,hce,Ace,Rce,yce,gU=B(()=>{Gg();zx="cloud.provider",Xx="cloud.account.id",Jx="cloud.region",Zx="cloud.availability_zone",Qx="cloud.platform",e0="aws.ecs.container.arn",t0="aws.ecs.cluster.arn",n0="aws.ecs.launchtype",r0="aws.ecs.task.arn",o0="aws.ecs.task.family",s0="aws.ecs.task.revision",i0="aws.eks.cluster.arn",a0="aws.log.group.names",c0="aws.log.group.arns",u0="aws.log.stream.names",l0="aws.log.stream.arns",d0="container.name",p0="container.id",_0="container.runtime",f0="container.image.name",m0="container.image.tag",E0="deployment.environment",S0="device.id",T0="device.model.identifier",g0="device.model.name",h0="faas.name",A0="faas.id",R0="faas.version",y0="faas.instance",O0="faas.max_memory",N0="host.id",C0="host.name",v0="host.type",I0="host.arch",P0="host.image.name",b0="host.image.id",M0="host.image.version",L0="k8s.cluster.name",x0="k8s.node.name",D0="k8s.node.uid",U0="k8s.namespace.name",w0="k8s.pod.uid",k0="k8s.pod.name",V0="k8s.container.name",B0="k8s.replicaset.uid",G0="k8s.replicaset.name",H0="k8s.deployment.uid",F0="k8s.deployment.name",$0="k8s.statefulset.uid",j0="k8s.statefulset.name",q0="k8s.daemonset.uid",Y0="k8s.daemonset.name",K0="k8s.job.uid",W0="k8s.job.name",z0="k8s.cronjob.uid",X0="k8s.cronjob.name",J0="os.type",Z0="os.description",Q0="os.name",eD="os.version",tD="process.pid",nD="process.executable.name",rD="process.executable.path",oD="process.command",sD="process.command_line",iD="process.command_args",aD="process.owner",cD="process.runtime.name",uD="process.runtime.version",lD="process.runtime.description",dD="service.name",pD="service.namespace",_D="service.instance.id",fD="service.version",mD="telemetry.sdk.name",ED="telemetry.sdk.language",SD="telemetry.sdk.version",TD="telemetry.auto.version",gD="webengine.name",hD="webengine.version",AD="webengine.description",Kse=zx,Wse=Xx,zse=Jx,Xse=Zx,Jse=Qx,Zse=e0,Qse=t0,eie=n0,tie=r0,nie=o0,rie=s0,oie=i0,sie=a0,iie=c0,aie=u0,cie=l0,uie=d0,lie=p0,die=_0,pie=f0,_ie=m0,fie=E0,mie=S0,Eie=T0,Sie=g0,Tie=h0,gie=A0,hie=R0,Aie=y0,Rie=O0,yie=N0,Oie=C0,Nie=v0,Cie=I0,vie=P0,Iie=b0,Pie=M0,bie=L0,Mie=x0,Lie=D0,xie=U0,Die=w0,Uie=k0,wie=V0,kie=B0,Vie=G0,Bie=H0,Gie=F0,Hie=$0,Fie=j0,$ie=q0,jie=Y0,qie=K0,Yie=W0,Kie=z0,Wie=X0,zie=J0,Xie=Z0,Jie=Q0,Zie=eD,Qie=tD,eae=nD,tae=rD,nae=oD,rae=sD,oae=iD,sae=aD,iae=cD,aae=uD,cae=lD,uae=dD,lae=pD,dae=_D,pae=fD,_ae=mD,fae=ED,mae=SD,Eae=TD,Sae=gD,Tae=hD,gae=AD,hae=ze([zx,Xx,Jx,Zx,Qx,e0,t0,n0,r0,o0,s0,i0,a0,c0,u0,l0,d0,p0,_0,f0,m0,E0,S0,T0,g0,h0,A0,R0,y0,O0,N0,C0,v0,I0,P0,b0,M0,L0,x0,D0,U0,w0,k0,V0,B0,G0,H0,F0,$0,j0,q0,Y0,K0,W0,z0,X0,J0,Z0,Q0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,dD,pD,_D,fD,mD,ED,SD,TD,gD,hD,AD]),RD="alibaba_cloud",yD="aws",OD="azure",ND="gcp",Aae=RD,Rae=yD,yae=OD,Oae=ND,Nae=ze([RD,yD,OD,ND]),CD="alibaba_cloud_ecs",vD="alibaba_cloud_fc",ID="aws_ec2",PD="aws_ecs",bD="aws_eks",MD="aws_lambda",LD="aws_elastic_beanstalk",xD="azure_vm",DD="azure_container_instances",UD="azure_aks",wD="azure_functions",kD="azure_app_service",VD="gcp_compute_engine",BD="gcp_cloud_run",GD="gcp_kubernetes_engine",HD="gcp_cloud_functions",FD="gcp_app_engine",Cae=CD,vae=vD,Iae=ID,Pae=PD,bae=bD,Mae=MD,Lae=LD,xae=xD,Dae=DD,Uae=UD,wae=wD,kae=kD,Vae=VD,Bae=BD,Gae=GD,Hae=HD,Fae=FD,$ae=ze([CD,vD,ID,PD,bD,MD,LD,xD,DD,UD,wD,kD,VD,BD,GD,HD,FD]),$D="ec2",jD="fargate",jae=$D,qae=jD,Yae=ze([$D,jD]),qD="amd64",YD="arm32",KD="arm64",WD="ia64",zD="ppc32",XD="ppc64",JD="x86",Kae=qD,Wae=YD,zae=KD,Xae=WD,Jae=zD,Zae=XD,Qae=JD,ece=ze([qD,YD,KD,WD,zD,XD,JD]),ZD="windows",QD="linux",eU="darwin",tU="freebsd",nU="netbsd",rU="openbsd",oU="dragonflybsd",sU="hpux",iU="aix",aU="solaris",cU="z_os",tce=ZD,nce=QD,rce=eU,oce=tU,sce=nU,ice=rU,ace=oU,cce=sU,uce=iU,lce=aU,dce=cU,pce=ze([ZD,QD,eU,tU,nU,rU,oU,sU,iU,aU,cU]),uU="cpp",lU="dotnet",dU="erlang",pU="go",_U="java",fU="nodejs",mU="php",EU="python",SU="ruby",TU="webjs",_ce=uU,fce=lU,mce=dU,Ece=pU,Sce=_U,Tce=fU,gce=mU,hce=EU,Ace=SU,Rce=TU,yce=ze([uU,lU,dU,pU,_U,fU,mU,EU,SU,TU])});var hU=B(()=>{gU()});var Oce,Nce,Cce,vce,Ice,Pce,bce,Mce,Lce,xce,Dce,Uce,wce,kce,Vce,Bce,Gce,Hce,Fce,$ce,jce,qce,Yce,Kce,Wce,zce,Xce,Jce,Zce,Qce,eue,tue,nue,rue,oue,sue,iue,aue,cue,uue,lue,due,pue,_ue,fue,mue,Eue,Sue,Tue,gue,hue,Aue,Rue,yue,Oue,Nue,Cue,vue,Iue,Pue,bue,Mue,Lue,xue,Due,Uue,wue,kue,Vue,Bue,Gue,Hue,Fue,$ue,jue,que,Yue,Kue,Wue,zue,Xue,Jue,Zue,Que,ele,tle,nle,rle,ole,sle,ile,ale,cle,ule,lle,dle,ple,_le,fle,mle,Ele,Sle,Tle,gle,hle,Ale,Rle,yle,Ole,Nle,AU=B(()=>{Oce="aspnetcore.rate_limiting.result",Nce="acquired",Cce="endpoint_limiter",vce="global_limiter",Ice="request_canceled",Pce="telemetry.sdk.language",bce="cpp",Mce="dotnet",Lce="erlang",xce="go",Dce="java",Uce="nodejs",wce="php",kce="python",Vce="ruby",Bce="rust",Gce="swift",Hce="webjs",Fce="telemetry.sdk.name",$ce="telemetry.sdk.version",jce="aspnetcore.diagnostics.handler.type",qce="aspnetcore.diagnostics.exception.result",Yce="aborted",Kce="handled",Wce="skipped",zce="unhandled",Xce="aspnetcore.rate_limiting.policy",Jce="aspnetcore.request.is_unhandled",Zce="aspnetcore.routing.is_fallback",Qce="aspnetcore.routing.match_status",eue="failure",tue="success",nue="client.address",rue="client.port",oue="error.type",sue="_OTHER",iue="exception.escaped",aue="exception.message",cue="exception.stacktrace",uue="exception.type",lue=function(t){return"http.request.header."+t},due="http.request.method",pue="_OTHER",_ue="CONNECT",fue="DELETE",mue="GET",Eue="HEAD",Sue="OPTIONS",Tue="PATCH",gue="POST",hue="PUT",Aue="TRACE",Rue="http.request.method_original",yue="http.request.resend_count",Oue=function(t){return"http.response.header."+t},Nue="http.response.status_code",Cue="http.route",vue="jvm.gc.action",Iue="jvm.gc.name",Pue="jvm.memory.pool.name",bue="jvm.memory.type",Mue="heap",Lue="non_heap",xue="jvm.thread.daemon",Due="jvm.thread.state",Uue="blocked",wue="new",kue="runnable",Vue="terminated",Bue="timed_waiting",Gue="waiting",Hue="network.local.address",Fue="network.local.port",$ue="network.peer.address",jue="network.peer.port",que="network.protocol.name",Yue="network.protocol.version",Kue="network.transport",Wue="pipe",zue="quic",Xue="tcp",Jue="udp",Zue="unix",Que="network.type",ele="ipv4",tle="ipv6",nle="otel.scope.name",rle="otel.scope.version",ole="otel.status_code",sle="ERROR",ile="OK",ale="otel.status_description",cle="server.address",ule="server.port",lle="service.name",dle="service.version",ple="signalr.connection.status",_le="app_shutdown",fle="normal_closure",mle="timeout",Ele="signalr.transport",Sle="long_polling",Tle="server_sent_events",gle="web_sockets",hle="url.fragment",Ale="url.full",Rle="url.path",yle="url.query",Ole="url.scheme",Nle="user_agent.original"});var Cle,vle,Ile,Ple,ble,Mle,Lle,xle,Dle,Ule,wle,kle,Vle,Ble,Gle,Hle,Fle,$le,jle,qle,Yle,Kle,Wle,zle,Xle,Jle,Zle,Qle,ede,tde,nde,RU=B(()=>{Cle="aspnetcore.diagnostics.exceptions",vle="aspnetcore.rate_limiting.active_request_leases",Ile="aspnetcore.rate_limiting.queued_requests",Ple="aspnetcore.rate_limiting.request.time_in_queue",ble="aspnetcore.rate_limiting.request_lease.duration",Mle="aspnetcore.rate_limiting.requests",Lle="aspnetcore.routing.match_attempts",xle="http.client.request.duration",Dle="http.server.request.duration",Ule="jvm.class.count",wle="jvm.class.loaded",kle="jvm.class.unloaded",Vle="jvm.cpu.count",Ble="jvm.cpu.recent_utilization",Gle="jvm.cpu.time",Hle="jvm.gc.duration",Fle="jvm.memory.committed",$le="jvm.memory.limit",jle="jvm.memory.used",qle="jvm.memory.used_after_last_gc",Yle="jvm.thread.count",Kle="kestrel.active_connections",Wle="kestrel.active_tls_handshakes",zle="kestrel.connection.duration",Xle="kestrel.queued_connections",Jle="kestrel.queued_requests",Zle="kestrel.rejected_connections",Qle="kestrel.tls_handshake.duration",ede="kestrel.upgraded_connections",tde="signalr.server.active_connections",nde="signalr.server.connection.duration"});var kn={};Kd(kn,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Yce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Kce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Wce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>zce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>Nce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Cce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>vce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ice,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>eue,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>tue,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>qce,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>jce,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Xce,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Oce,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>Jce,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>Zce,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Qce,ATTR_CLIENT_ADDRESS:()=>nue,ATTR_CLIENT_PORT:()=>rue,ATTR_ERROR_TYPE:()=>oue,ATTR_EXCEPTION_ESCAPED:()=>iue,ATTR_EXCEPTION_MESSAGE:()=>aue,ATTR_EXCEPTION_STACKTRACE:()=>cue,ATTR_EXCEPTION_TYPE:()=>uue,ATTR_HTTP_REQUEST_HEADER:()=>lue,ATTR_HTTP_REQUEST_METHOD:()=>due,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>Rue,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>yue,ATTR_HTTP_RESPONSE_HEADER:()=>Oue,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>Nue,ATTR_HTTP_ROUTE:()=>Cue,ATTR_JVM_GC_ACTION:()=>vue,ATTR_JVM_GC_NAME:()=>Iue,ATTR_JVM_MEMORY_POOL_NAME:()=>Pue,ATTR_JVM_MEMORY_TYPE:()=>bue,ATTR_JVM_THREAD_DAEMON:()=>xue,ATTR_JVM_THREAD_STATE:()=>Due,ATTR_NETWORK_LOCAL_ADDRESS:()=>Hue,ATTR_NETWORK_LOCAL_PORT:()=>Fue,ATTR_NETWORK_PEER_ADDRESS:()=>$ue,ATTR_NETWORK_PEER_PORT:()=>jue,ATTR_NETWORK_PROTOCOL_NAME:()=>que,ATTR_NETWORK_PROTOCOL_VERSION:()=>Yue,ATTR_NETWORK_TRANSPORT:()=>Kue,ATTR_NETWORK_TYPE:()=>Que,ATTR_OTEL_SCOPE_NAME:()=>nle,ATTR_OTEL_SCOPE_VERSION:()=>rle,ATTR_OTEL_STATUS_CODE:()=>ole,ATTR_OTEL_STATUS_DESCRIPTION:()=>ale,ATTR_SERVER_ADDRESS:()=>cle,ATTR_SERVER_PORT:()=>ule,ATTR_SERVICE_NAME:()=>lle,ATTR_SERVICE_VERSION:()=>dle,ATTR_SIGNALR_CONNECTION_STATUS:()=>ple,ATTR_SIGNALR_TRANSPORT:()=>Ele,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Pce,ATTR_TELEMETRY_SDK_NAME:()=>Fce,ATTR_TELEMETRY_SDK_VERSION:()=>$ce,ATTR_URL_FRAGMENT:()=>hle,ATTR_URL_FULL:()=>Ale,ATTR_URL_PATH:()=>Rle,ATTR_URL_QUERY:()=>yle,ATTR_URL_SCHEME:()=>Ole,ATTR_USER_AGENT_ORIGINAL:()=>Nle,AWSECSLAUNCHTYPEVALUES_EC2:()=>jae,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>qae,AwsEcsLaunchtypeValues:()=>Yae,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Cae,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>vae,CLOUDPLATFORMVALUES_AWS_EC2:()=>Iae,CLOUDPLATFORMVALUES_AWS_ECS:()=>Pae,CLOUDPLATFORMVALUES_AWS_EKS:()=>bae,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Lae,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Mae,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Uae,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>kae,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Dae,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>wae,CLOUDPLATFORMVALUES_AZURE_VM:()=>xae,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Fae,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Hae,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>Bae,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Vae,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Gae,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Aae,CLOUDPROVIDERVALUES_AWS:()=>Rae,CLOUDPROVIDERVALUES_AZURE:()=>yae,CLOUDPROVIDERVALUES_GCP:()=>Oae,CloudPlatformValues:()=>$ae,CloudProviderValues:()=>Nae,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>soe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>_oe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>ioe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>poe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>coe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>moe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>uoe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>aoe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>foe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>doe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>loe,DBSYSTEMVALUES_ADABAS:()=>Ire,DBSYSTEMVALUES_CACHE:()=>vre,DBSYSTEMVALUES_CASSANDRA:()=>qre,DBSYSTEMVALUES_CLOUDSCAPE:()=>gre,DBSYSTEMVALUES_COCKROACHDB:()=>roe,DBSYSTEMVALUES_COLDFUSION:()=>jre,DBSYSTEMVALUES_COSMOSDB:()=>Jre,DBSYSTEMVALUES_COUCHBASE:()=>zre,DBSYSTEMVALUES_COUCHDB:()=>Xre,DBSYSTEMVALUES_DB2:()=>mre,DBSYSTEMVALUES_DERBY:()=>bre,DBSYSTEMVALUES_DYNAMODB:()=>Zre,DBSYSTEMVALUES_EDB:()=>Cre,DBSYSTEMVALUES_ELASTICSEARCH:()=>toe,DBSYSTEMVALUES_FILEMAKER:()=>Mre,DBSYSTEMVALUES_FIREBIRD:()=>Pre,DBSYSTEMVALUES_FIRSTSQL:()=>Nre,DBSYSTEMVALUES_GEODE:()=>eoe,DBSYSTEMVALUES_H2:()=>$re,DBSYSTEMVALUES_HANADB:()=>yre,DBSYSTEMVALUES_HBASE:()=>Yre,DBSYSTEMVALUES_HIVE:()=>Tre,DBSYSTEMVALUES_HSQLDB:()=>hre,DBSYSTEMVALUES_INFORMIX:()=>Lre,DBSYSTEMVALUES_INGRES:()=>Ore,DBSYSTEMVALUES_INSTANTDB:()=>xre,DBSYSTEMVALUES_INTERBASE:()=>Dre,DBSYSTEMVALUES_MARIADB:()=>Ure,DBSYSTEMVALUES_MAXDB:()=>Rre,DBSYSTEMVALUES_MEMCACHED:()=>noe,DBSYSTEMVALUES_MONGODB:()=>Kre,DBSYSTEMVALUES_MSSQL:()=>pre,DBSYSTEMVALUES_MYSQL:()=>_re,DBSYSTEMVALUES_NEO4J:()=>Qre,DBSYSTEMVALUES_NETEZZA:()=>wre,DBSYSTEMVALUES_ORACLE:()=>fre,DBSYSTEMVALUES_OTHER_SQL:()=>dre,DBSYSTEMVALUES_PERVASIVE:()=>kre,DBSYSTEMVALUES_POINTBASE:()=>Vre,DBSYSTEMVALUES_POSTGRESQL:()=>Ere,DBSYSTEMVALUES_PROGRESS:()=>Are,DBSYSTEMVALUES_REDIS:()=>Wre,DBSYSTEMVALUES_REDSHIFT:()=>Sre,DBSYSTEMVALUES_SQLITE:()=>Bre,DBSYSTEMVALUES_SYBASE:()=>Gre,DBSYSTEMVALUES_TERADATA:()=>Hre,DBSYSTEMVALUES_VERTICA:()=>Fre,DbCassandraConsistencyLevelValues:()=>Eoe,DbSystemValues:()=>ooe,ERROR_TYPE_VALUE_OTHER:()=>sue,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>Noe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Ooe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>yoe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>voe,FAASINVOKEDPROVIDERVALUES_AWS:()=>Ioe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Poe,FAASINVOKEDPROVIDERVALUES_GCP:()=>boe,FAASTRIGGERVALUES_DATASOURCE:()=>Soe,FAASTRIGGERVALUES_HTTP:()=>Toe,FAASTRIGGERVALUES_OTHER:()=>Aoe,FAASTRIGGERVALUES_PUBSUB:()=>goe,FAASTRIGGERVALUES_TIMER:()=>hoe,FaasDocumentOperationValues:()=>Coe,FaasInvokedProviderValues:()=>Moe,FaasTriggerValues:()=>Roe,HOSTARCHVALUES_AMD64:()=>Kae,HOSTARCHVALUES_ARM32:()=>Wae,HOSTARCHVALUES_ARM64:()=>zae,HOSTARCHVALUES_IA64:()=>Xae,HOSTARCHVALUES_PPC32:()=>Jae,HOSTARCHVALUES_PPC64:()=>Zae,HOSTARCHVALUES_X86:()=>Qae,HTTPFLAVORVALUES_HTTP_1_0:()=>fse,HTTPFLAVORVALUES_HTTP_1_1:()=>mse,HTTPFLAVORVALUES_HTTP_2_0:()=>Ese,HTTPFLAVORVALUES_QUIC:()=>Tse,HTTPFLAVORVALUES_SPDY:()=>Sse,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>_ue,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>fue,HTTP_REQUEST_METHOD_VALUE_GET:()=>mue,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Eue,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Sue,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>pue,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>Tue,HTTP_REQUEST_METHOD_VALUE_POST:()=>gue,HTTP_REQUEST_METHOD_VALUE_PUT:()=>hue,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Aue,HostArchValues:()=>ece,HttpFlavorValues:()=>gse,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Mue,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>Lue,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Uue,JVM_THREAD_STATE_VALUE_NEW:()=>wue,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>kue,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Vue,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>Bue,JVM_THREAD_STATE_VALUE_WAITING:()=>Gue,MESSAGETYPEVALUES_RECEIVED:()=>qse,MESSAGETYPEVALUES_SENT:()=>jse,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>hse,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Ase,MESSAGINGOPERATIONVALUES_PROCESS:()=>Ose,MESSAGINGOPERATIONVALUES_RECEIVE:()=>yse,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Cle,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>vle,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Ile,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Mle,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>ble,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Ple,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Lle,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>xle,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Dle,METRIC_JVM_CLASS_COUNT:()=>Ule,METRIC_JVM_CLASS_LOADED:()=>wle,METRIC_JVM_CLASS_UNLOADED:()=>kle,METRIC_JVM_CPU_COUNT:()=>Vle,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>Ble,METRIC_JVM_CPU_TIME:()=>Gle,METRIC_JVM_GC_DURATION:()=>Hle,METRIC_JVM_MEMORY_COMMITTED:()=>Fle,METRIC_JVM_MEMORY_LIMIT:()=>$le,METRIC_JVM_MEMORY_USED:()=>jle,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>qle,METRIC_JVM_THREAD_COUNT:()=>Yle,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Kle,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Wle,METRIC_KESTREL_CONNECTION_DURATION:()=>zle,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>Xle,METRIC_KESTREL_QUEUED_REQUESTS:()=>Jle,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Zle,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>Qle,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>ede,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>tde,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>nde,MessageTypeValues:()=>Yse,MessagingDestinationKindValues:()=>Rse,MessagingOperationValues:()=>Nse,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>zoe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>Zoe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Koe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>sse,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>Xoe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>Joe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>rse,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Yoe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>ase,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>Qoe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>tse,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>ise,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>ese,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>nse,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>use,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>ose,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>pse,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>lse,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>dse,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>cse,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Woe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Foe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>$oe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>joe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>Goe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Hoe,NETTRANSPORTVALUES_INPROC:()=>koe,NETTRANSPORTVALUES_IP:()=>Doe,NETTRANSPORTVALUES_IP_TCP:()=>Loe,NETTRANSPORTVALUES_IP_UDP:()=>xoe,NETTRANSPORTVALUES_OTHER:()=>Voe,NETTRANSPORTVALUES_PIPE:()=>woe,NETTRANSPORTVALUES_UNIX:()=>Uoe,NETWORK_TRANSPORT_VALUE_PIPE:()=>Wue,NETWORK_TRANSPORT_VALUE_QUIC:()=>zue,NETWORK_TRANSPORT_VALUE_TCP:()=>Xue,NETWORK_TRANSPORT_VALUE_UDP:()=>Jue,NETWORK_TRANSPORT_VALUE_UNIX:()=>Zue,NETWORK_TYPE_VALUE_IPV4:()=>ele,NETWORK_TYPE_VALUE_IPV6:()=>tle,NetHostConnectionSubtypeValues:()=>_se,NetHostConnectionTypeValues:()=>qoe,NetTransportValues:()=>Boe,OSTYPEVALUES_AIX:()=>uce,OSTYPEVALUES_DARWIN:()=>rce,OSTYPEVALUES_DRAGONFLYBSD:()=>ace,OSTYPEVALUES_FREEBSD:()=>oce,OSTYPEVALUES_HPUX:()=>cce,OSTYPEVALUES_LINUX:()=>nce,OSTYPEVALUES_NETBSD:()=>sce,OSTYPEVALUES_OPENBSD:()=>ice,OSTYPEVALUES_SOLARIS:()=>lce,OSTYPEVALUES_WINDOWS:()=>tce,OSTYPEVALUES_Z_OS:()=>dce,OTEL_STATUS_CODE_VALUE_ERROR:()=>sle,OTEL_STATUS_CODE_VALUE_OK:()=>ile,OsTypeValues:()=>pce,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>wse,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>Lse,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>vse,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Hse,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>bse,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Use,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>Bse,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Pse,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>Mse,RPCGRPCSTATUSCODEVALUES_OK:()=>Cse,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>kse,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>xse,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Dse,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Fse,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>Gse,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>Vse,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>Ise,RpcGrpcStatusCodeValues:()=>$se,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>gne,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>Mne,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Ene,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>pne,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Pne,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>One,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>Rne,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>Lne,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>hne,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>_ne,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>Tne,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>yne,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Sne,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>fne,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>mne,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>bne,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Cne,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>vne,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Ane,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>Nne,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>dne,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>Ine,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>jee,SEMATTRS_CODE_FILEPATH:()=>Wte,SEMATTRS_CODE_FUNCTION:()=>Yte,SEMATTRS_CODE_LINENO:()=>zte,SEMATTRS_CODE_NAMESPACE:()=>Kte,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>tte,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>ite,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>ste,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>rte,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>Qee,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>ete,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>ote,SEMATTRS_DB_CASSANDRA_TABLE:()=>nte,SEMATTRS_DB_CONNECTION_STRING:()=>Yee,SEMATTRS_DB_HBASE_NAMESPACE:()=>ate,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Wee,SEMATTRS_DB_MONGODB_COLLECTION:()=>ute,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>Zee,SEMATTRS_DB_NAME:()=>zee,SEMATTRS_DB_OPERATION:()=>Jee,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>cte,SEMATTRS_DB_SQL_TABLE:()=>lte,SEMATTRS_DB_STATEMENT:()=>Xee,SEMATTRS_DB_SYSTEM:()=>qee,SEMATTRS_DB_USER:()=>Kee,SEMATTRS_ENDUSER_ID:()=>Hte,SEMATTRS_ENDUSER_ROLE:()=>Fte,SEMATTRS_ENDUSER_SCOPE:()=>$te,SEMATTRS_EXCEPTION_ESCAPED:()=>fte,SEMATTRS_EXCEPTION_MESSAGE:()=>pte,SEMATTRS_EXCEPTION_STACKTRACE:()=>_te,SEMATTRS_EXCEPTION_TYPE:()=>dte,SEMATTRS_FAAS_COLDSTART:()=>yte,SEMATTRS_FAAS_CRON:()=>Rte,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Ste,SEMATTRS_FAAS_DOCUMENT_NAME:()=>hte,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>Tte,SEMATTRS_FAAS_DOCUMENT_TIME:()=>gte,SEMATTRS_FAAS_EXECUTION:()=>Ete,SEMATTRS_FAAS_INVOKED_NAME:()=>Ote,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>Nte,SEMATTRS_FAAS_INVOKED_REGION:()=>Cte,SEMATTRS_FAAS_TIME:()=>Ate,SEMATTRS_FAAS_TRIGGER:()=>mte,SEMATTRS_HTTP_CLIENT_IP:()=>lne,SEMATTRS_HTTP_FLAVOR:()=>nne,SEMATTRS_HTTP_HOST:()=>Qte,SEMATTRS_HTTP_METHOD:()=>Xte,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>one,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>sne,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>ine,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>ane,SEMATTRS_HTTP_ROUTE:()=>une,SEMATTRS_HTTP_SCHEME:()=>ene,SEMATTRS_HTTP_SERVER_NAME:()=>cne,SEMATTRS_HTTP_STATUS_CODE:()=>tne,SEMATTRS_HTTP_TARGET:()=>Zte,SEMATTRS_HTTP_URL:()=>Jte,SEMATTRS_HTTP_USER_AGENT:()=>rne,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>cre,SEMATTRS_MESSAGE_ID:()=>are,SEMATTRS_MESSAGE_TYPE:()=>ire,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>ure,SEMATTRS_MESSAGING_CONSUMER_ID:()=>qne,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Hne,SEMATTRS_MESSAGING_DESTINATION:()=>Dne,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Une,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>zne,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Wne,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Kne,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>Xne,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Jne,SEMATTRS_MESSAGING_MESSAGE_ID:()=>Gne,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>$ne,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Fne,SEMATTRS_MESSAGING_OPERATION:()=>jne,SEMATTRS_MESSAGING_PROTOCOL:()=>kne,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>Vne,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Yne,SEMATTRS_MESSAGING_SYSTEM:()=>xne,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>wne,SEMATTRS_MESSAGING_URL:()=>Bne,SEMATTRS_NET_HOST_CARRIER_ICC:()=>Bte,SEMATTRS_NET_HOST_CARRIER_MCC:()=>kte,SEMATTRS_NET_HOST_CARRIER_MNC:()=>Vte,SEMATTRS_NET_HOST_CARRIER_NAME:()=>wte,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Ute,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Dte,SEMATTRS_NET_HOST_IP:()=>Mte,SEMATTRS_NET_HOST_NAME:()=>xte,SEMATTRS_NET_HOST_PORT:()=>Lte,SEMATTRS_NET_PEER_IP:()=>Ite,SEMATTRS_NET_PEER_NAME:()=>bte,SEMATTRS_NET_PEER_PORT:()=>Pte,SEMATTRS_NET_TRANSPORT:()=>vte,SEMATTRS_PEER_SERVICE:()=>Gte,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>tre,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>ore,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>sre,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>rre,SEMATTRS_RPC_JSONRPC_VERSION:()=>nre,SEMATTRS_RPC_METHOD:()=>ere,SEMATTRS_RPC_SERVICE:()=>Qne,SEMATTRS_RPC_SYSTEM:()=>Zne,SEMATTRS_THREAD_ID:()=>jte,SEMATTRS_THREAD_NAME:()=>qte,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>Qse,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>Zse,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>eie,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>tie,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>nie,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>rie,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>oie,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>iie,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>sie,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>cie,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>aie,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Wse,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>Xse,SEMRESATTRS_CLOUD_PLATFORM:()=>Jse,SEMRESATTRS_CLOUD_PROVIDER:()=>Kse,SEMRESATTRS_CLOUD_REGION:()=>zse,SEMRESATTRS_CONTAINER_ID:()=>lie,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>pie,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>_ie,SEMRESATTRS_CONTAINER_NAME:()=>uie,SEMRESATTRS_CONTAINER_RUNTIME:()=>die,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>fie,SEMRESATTRS_DEVICE_ID:()=>mie,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Eie,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Sie,SEMRESATTRS_FAAS_ID:()=>gie,SEMRESATTRS_FAAS_INSTANCE:()=>Aie,SEMRESATTRS_FAAS_MAX_MEMORY:()=>Rie,SEMRESATTRS_FAAS_NAME:()=>Tie,SEMRESATTRS_FAAS_VERSION:()=>hie,SEMRESATTRS_HOST_ARCH:()=>Cie,SEMRESATTRS_HOST_ID:()=>yie,SEMRESATTRS_HOST_IMAGE_ID:()=>Iie,SEMRESATTRS_HOST_IMAGE_NAME:()=>vie,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Pie,SEMRESATTRS_HOST_NAME:()=>Oie,SEMRESATTRS_HOST_TYPE:()=>Nie,SEMRESATTRS_K8S_CLUSTER_NAME:()=>bie,SEMRESATTRS_K8S_CONTAINER_NAME:()=>wie,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Wie,SEMRESATTRS_K8S_CRONJOB_UID:()=>Kie,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>jie,SEMRESATTRS_K8S_DAEMONSET_UID:()=>$ie,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>Gie,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>Bie,SEMRESATTRS_K8S_JOB_NAME:()=>Yie,SEMRESATTRS_K8S_JOB_UID:()=>qie,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>xie,SEMRESATTRS_K8S_NODE_NAME:()=>Mie,SEMRESATTRS_K8S_NODE_UID:()=>Lie,SEMRESATTRS_K8S_POD_NAME:()=>Uie,SEMRESATTRS_K8S_POD_UID:()=>Die,SEMRESATTRS_K8S_REPLICASET_NAME:()=>Vie,SEMRESATTRS_K8S_REPLICASET_UID:()=>kie,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Fie,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Hie,SEMRESATTRS_OS_DESCRIPTION:()=>Xie,SEMRESATTRS_OS_NAME:()=>Jie,SEMRESATTRS_OS_TYPE:()=>zie,SEMRESATTRS_OS_VERSION:()=>Zie,SEMRESATTRS_PROCESS_COMMAND:()=>nae,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>oae,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>rae,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>eae,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>tae,SEMRESATTRS_PROCESS_OWNER:()=>sae,SEMRESATTRS_PROCESS_PID:()=>Qie,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>cae,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>iae,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>aae,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>dae,SEMRESATTRS_SERVICE_NAME:()=>uae,SEMRESATTRS_SERVICE_NAMESPACE:()=>lae,SEMRESATTRS_SERVICE_VERSION:()=>pae,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Eae,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>fae,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>_ae,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>mae,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>gae,SEMRESATTRS_WEBENGINE_NAME:()=>Sae,SEMRESATTRS_WEBENGINE_VERSION:()=>Tae,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>_le,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>fle,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>mle,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Sle,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Tle,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>gle,SemanticAttributes:()=>lre,SemanticResourceAttributes:()=>hae,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>_ce,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>fce,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>mce,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Ece,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Sce,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>Tce,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>gce,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>hce,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Ace,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>Rce,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>bce,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Mce,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Lce,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>xce,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Dce,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Uce,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>wce,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>kce,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Vce,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Bce,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Gce,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Hce,TelemetrySdkLanguageValues:()=>yce});var Vn=B(()=>{Wx();hU();AU();RU()});var yU=m(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.SDK_INFO=void 0;var rde=Bg(),Zu=(Vn(),I(kn));c_.SDK_INFO={[Zu.SEMRESATTRS_TELEMETRY_SDK_NAME]:"opentelemetry",[Zu.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"node",[Zu.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]:Zu.TELEMETRYSDKLANGUAGEVALUES_NODEJS,[Zu.SEMRESATTRS_TELEMETRY_SDK_VERSION]:rde.VERSION}});var OU=m(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.unrefTimer=void 0;function ode(t){t.unref()}u_.unrefTimer=ode});var CU=m(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.unrefTimer=Tt.SDK_INFO=Tt.otperformance=Tt.RandomIdGenerator=Tt.hexToBase64=Tt._globalThis=Tt.getEnv=Tt.getEnvWithoutDefaults=void 0;var NU=XI();Object.defineProperty(Tt,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return NU.getEnvWithoutDefaults}});Object.defineProperty(Tt,"getEnv",{enumerable:!0,get:function(){return NU.getEnv}});var sde=JI();Object.defineProperty(Tt,"_globalThis",{enumerable:!0,get:function(){return sde._globalThis}});var ide=QI();Object.defineProperty(Tt,"hexToBase64",{enumerable:!0,get:function(){return ide.hexToBase64}});var ade=nP();Object.defineProperty(Tt,"RandomIdGenerator",{enumerable:!0,get:function(){return ade.RandomIdGenerator}});var cde=rP();Object.defineProperty(Tt,"otperformance",{enumerable:!0,get:function(){return cde.otperformance}});var ude=yU();Object.defineProperty(Tt,"SDK_INFO",{enumerable:!0,get:function(){return ude.SDK_INFO}});var lde=OU();Object.defineProperty(Tt,"unrefTimer",{enumerable:!0,get:function(){return lde.unrefTimer}})});var Hg=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.unrefTimer=gt.otperformance=gt.hexToBase64=gt.getEnvWithoutDefaults=gt.getEnv=gt._globalThis=gt.SDK_INFO=gt.RandomIdGenerator=void 0;var ts=CU();Object.defineProperty(gt,"RandomIdGenerator",{enumerable:!0,get:function(){return ts.RandomIdGenerator}});Object.defineProperty(gt,"SDK_INFO",{enumerable:!0,get:function(){return ts.SDK_INFO}});Object.defineProperty(gt,"_globalThis",{enumerable:!0,get:function(){return ts._globalThis}});Object.defineProperty(gt,"getEnv",{enumerable:!0,get:function(){return ts.getEnv}});Object.defineProperty(gt,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return ts.getEnvWithoutDefaults}});Object.defineProperty(gt,"hexToBase64",{enumerable:!0,get:function(){return ts.hexToBase64}});Object.defineProperty(gt,"otperformance",{enumerable:!0,get:function(){return ts.otperformance}});Object.defineProperty(gt,"unrefTimer",{enumerable:!0,get:function(){return ts.unrefTimer}})});var bU=m(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.addHrTimes=Ce.isTimeInput=Ce.isTimeInputHrTime=Ce.hrTimeToMicroseconds=Ce.hrTimeToMilliseconds=Ce.hrTimeToNanoseconds=Ce.hrTimeToTimeStamp=Ce.hrTimeDuration=Ce.timeInputToHrTime=Ce.hrTime=Ce.getTimeOrigin=Ce.millisToHrTime=void 0;var Fg=Hg(),vU=9,dde=6,pde=Math.pow(10,dde),l_=Math.pow(10,vU);function Qu(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*pde);return[n,r]}Ce.millisToHrTime=Qu;function $g(){let t=Fg.otperformance.timeOrigin;if(typeof t!="number"){let e=Fg.otperformance;t=e.timing&&e.timing.fetchStart}return t}Ce.getTimeOrigin=$g;function IU(t){let e=Qu($g()),n=Qu(typeof t=="number"?t:Fg.otperformance.now());return PU(e,n)}Ce.hrTime=IU;function _de(t){if(jg(t))return t;if(typeof t=="number")return t<$g()?IU(t):Qu(t);if(t instanceof Date)return Qu(t.getTime());throw TypeError("Invalid input type")}Ce.timeInputToHrTime=_de;function fde(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=l_),[n,r]}Ce.hrTimeDuration=fde;function mde(t){let e=vU,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}Ce.hrTimeToTimeStamp=mde;function Ede(t){return t[0]*l_+t[1]}Ce.hrTimeToNanoseconds=Ede;function Sde(t){return t[0]*1e3+t[1]/1e6}Ce.hrTimeToMilliseconds=Sde;function Tde(t){return t[0]*1e6+t[1]/1e3}Ce.hrTimeToMicroseconds=Tde;function jg(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}Ce.isTimeInputHrTime=jg;function gde(t){return jg(t)||typeof t=="number"||t instanceof Date}Ce.isTimeInput=gde;function PU(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=l_&&(n[1]-=l_,n[0]+=1),n}Ce.addHrTimes=PU});var MU=m(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ExportResultCode=void 0;var hde;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(hde=el.ExportResultCode||(el.ExportResultCode={}))});var xU=m(d_=>{"use strict";Object.defineProperty(d_,"__esModule",{value:!0});d_.CompositePropagator=void 0;var LU=(L(),I(V)),qg=class{constructor(e={}){var n;this._propagators=(n=e.propagators)!==null&&n!==void 0?n:[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,o)=>r.concat(o),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){LU.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){LU.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};d_.CompositePropagator=qg});var DU=m(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.validateValue=ka.validateKey=void 0;var Yg="[_0-9a-z-*/]",Ade=`[a-z]${Yg}{0,255}`,Rde=`[a-z0-9]${Yg}{0,240}@[a-z]${Yg}{0,13}`,yde=new RegExp(`^(?:${Ade}|${Rde})$`),Ode=/^[ -~]{0,255}[!-~]$/,Nde=/,|=/;function Cde(t){return yde.test(t)}ka.validateKey=Cde;function vde(t){return Ode.test(t)&&!Nde.test(t)}ka.validateValue=vde});var Wg=m(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.TraceState=void 0;var UU=DU(),wU=32,Ide=512,kU=",",VU="=",Kg=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+VU+this.get(n)),e),[]).join(kU)}_parse(e){e.length>Ide||(this._internalState=e.split(kU).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(VU);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,UU.validateKey)(i)&&(0,UU.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>wU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,wU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};p_.TraceState=Kg});var GU=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.W3CTraceContextPropagator=kt.parseTraceParent=kt.TRACE_STATE_HEADER=kt.TRACE_PARENT_HEADER=void 0;var __=(L(),I(V)),Pde=Xu(),bde=Wg();kt.TRACE_PARENT_HEADER="traceparent";kt.TRACE_STATE_HEADER="tracestate";var Mde="00",Lde="(?!ff)[\\da-f]{2}",xde="(?![0]{32})[\\da-f]{32}",Dde="(?![0]{16})[\\da-f]{16}",Ude="[\\da-f]{2}",wde=new RegExp(`^\\s?(${Lde})-(${xde})-(${Dde})-(${Ude})(-.*)?\\s?$`);function BU(t){let e=wde.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}kt.parseTraceParent=BU;var zg=class{inject(e,n,r){let o=__.trace.getSpanContext(e);if(!o||(0,Pde.isTracingSuppressed)(e)||!(0,__.isSpanContextValid)(o))return;let s=`${Mde}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||__.TraceFlags.NONE).toString(16)}`;r.set(n,kt.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,kt.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,kt.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=BU(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,kt.TRACE_STATE_HEADER);if(a){let c=Array.isArray(a)?a.join(","):a;i.traceState=new bde.TraceState(typeof c=="string"?c:void 0)}return __.trace.setSpanContext(e,i)}fields(){return[kt.TRACE_PARENT_HEADER,kt.TRACE_STATE_HEADER]}};kt.W3CTraceContextPropagator=zg});var HU=m(ir=>{"use strict";Object.defineProperty(ir,"__esModule",{value:!0});ir.getRPCMetadata=ir.deleteRPCMetadata=ir.setRPCMetadata=ir.RPCType=void 0;var kde=(L(),I(V)),Xg=(0,kde.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Vde;(function(t){t.HTTP="http"})(Vde=ir.RPCType||(ir.RPCType={}));function Bde(t,e){return t.setValue(Xg,e)}ir.setRPCMetadata=Bde;function Gde(t){return t.deleteValue(Xg)}ir.deleteRPCMetadata=Gde;function Hde(t){return t.getValue(Xg)}ir.getRPCMetadata=Hde});var Zg=m(f_=>{"use strict";Object.defineProperty(f_,"__esModule",{value:!0});f_.AlwaysOffSampler=void 0;var Fde=(L(),I(V)),Jg=class{shouldSample(){return{decision:Fde.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};f_.AlwaysOffSampler=Jg});var eh=m(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.AlwaysOnSampler=void 0;var $de=(L(),I(V)),Qg=class{shouldSample(){return{decision:$de.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};m_.AlwaysOnSampler=Qg});var $U=m(S_=>{"use strict";Object.defineProperty(S_,"__esModule",{value:!0});S_.ParentBasedSampler=void 0;var E_=(L(),I(V)),jde=xg(),FU=Zg(),th=eh(),nh=class{constructor(e){var n,r,o,s;this._root=e.root,this._root||((0,jde.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new th.AlwaysOnSampler),this._remoteParentSampled=(n=e.remoteParentSampled)!==null&&n!==void 0?n:new th.AlwaysOnSampler,this._remoteParentNotSampled=(r=e.remoteParentNotSampled)!==null&&r!==void 0?r:new FU.AlwaysOffSampler,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new th.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new FU.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=E_.trace.getSpanContext(e);return!a||!(0,E_.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&E_.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&E_.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};S_.ParentBasedSampler=nh});var jU=m(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_.TraceIdRatioBasedSampler=void 0;var rh=(L(),I(V)),oh=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,rh.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?rh.SamplingDecision.RECORD_AND_SAMPLED:rh.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};T_.TraceIdRatioBasedSampler=oh});var zU=m(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.isPlainObject=void 0;var qde="[object Object]",Yde="[object Null]",Kde="[object Undefined]",Wde=Function.prototype,qU=Wde.toString,zde=qU.call(Object),Xde=Jde(Object.getPrototypeOf,Object),YU=Object.prototype,KU=YU.hasOwnProperty,Ci=Symbol?Symbol.toStringTag:void 0,WU=YU.toString;function Jde(t,e){return function(n){return t(e(n))}}function Zde(t){if(!Qde(t)||epe(t)!==qde)return!1;let e=Xde(t);if(e===null)return!0;let n=KU.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&qU.call(n)===zde}g_.isPlainObject=Zde;function Qde(t){return t!=null&&typeof t=="object"}function epe(t){return t==null?t===void 0?Kde:Yde:Ci&&Ci in Object(t)?tpe(t):npe(t)}function tpe(t){let e=KU.call(t,Ci),n=t[Ci],r=!1;try{t[Ci]=void 0,r=!0}catch{}let o=WU.call(t);return r&&(e?t[Ci]=n:delete t[Ci]),o}function npe(t){return WU.call(t)}});var ew=m(R_=>{"use strict";Object.defineProperty(R_,"__esModule",{value:!0});R_.merge=void 0;var XU=zU(),rpe=20;function ope(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=ZU(e,t.shift(),0,n);return e}R_.merge=ope;function sh(t){return A_(t)?t.slice():t}function ZU(t,e,n=0,r){let o;if(!(n>rpe)){if(n++,h_(t)||h_(e)||QU(e))o=sh(e);else if(A_(t)){if(o=t.slice(),A_(e))for(let s=0,i=e.length;s<i;s++)o.push(sh(e[s]));else if(tl(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i];o[c]=sh(e[c])}}}else if(tl(t))if(tl(e)){if(!spe(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i],u=e[c];if(h_(u))typeof u>"u"?delete o[c]:o[c]=u;else{let l=o[c],d=u;if(JU(t,c,r)||JU(e,c,r))delete o[c];else{if(tl(l)&&tl(d)){let p=r.get(l)||[],_=r.get(d)||[];p.push({obj:t,key:c}),_.push({obj:e,key:c}),r.set(l,p),r.set(d,_)}o[c]=ZU(o[c],u,n,r)}}}}else o=e;return o}}function JU(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function A_(t){return Array.isArray(t)}function QU(t){return typeof t=="function"}function tl(t){return!h_(t)&&!A_(t)&&!QU(t)&&typeof t=="object"}function h_(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function spe(t,e){return!(!(0,XU.isPlainObject)(t)||!(0,XU.isPlainObject)(e))}});var tw=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.callWithTimeout=Va.TimeoutError=void 0;var y_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};Va.TimeoutError=y_;function ipe(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new y_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}Va.callWithTimeout=ipe});var rw=m(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.isUrlIgnored=Ba.urlMatches=void 0;function nw(t,e){return typeof e=="string"?t===e:!!t.match(e)}Ba.urlMatches=nw;function ape(t,e){if(!e)return!1;for(let n of e)if(nw(t,n))return!0;return!1}Ba.isUrlIgnored=ape});var ow=m(O_=>{"use strict";Object.defineProperty(O_,"__esModule",{value:!0});O_.isWrapped=void 0;function cpe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}O_.isWrapped=cpe});var sw=m(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.Deferred=void 0;var ih=class{constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};N_.Deferred=ih});var iw=m(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.BindOnceFuture=void 0;var upe=sw(),ah=class{constructor(e,n){this._callback=e,this._that=n,this._isCalled=!1,this._deferred=new upe.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};C_.BindOnceFuture=ah});var cw=m(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_._export=void 0;var aw=(L(),I(V)),lpe=Xu();function dpe(t,e){return new Promise(n=>{aw.context.with((0,lpe.suppressTracing)(aw.context.active()),()=>{t.export(e,r=>{n(r)})})})}v_._export=dpe});var fe=m(A=>{"use strict";Object.defineProperty(A,"__esModule",{value:!0});A.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=A.DEFAULT_ATTRIBUTE_COUNT_LIMIT=A.TraceState=A.unsuppressTracing=A.suppressTracing=A.isTracingSuppressed=A.TraceIdRatioBasedSampler=A.ParentBasedSampler=A.AlwaysOnSampler=A.AlwaysOffSampler=A.setRPCMetadata=A.getRPCMetadata=A.deleteRPCMetadata=A.RPCType=A.parseTraceParent=A.W3CTraceContextPropagator=A.TRACE_STATE_HEADER=A.TRACE_PARENT_HEADER=A.CompositePropagator=A.unrefTimer=A.otperformance=A.hexToBase64=A.getEnvWithoutDefaults=A.getEnv=A._globalThis=A.SDK_INFO=A.RandomIdGenerator=A.baggageUtils=A.ExportResultCode=A.hexToBinary=A.timeInputToHrTime=A.millisToHrTime=A.isTimeInputHrTime=A.isTimeInput=A.hrTimeToTimeStamp=A.hrTimeToNanoseconds=A.hrTimeToMilliseconds=A.hrTimeToMicroseconds=A.hrTimeDuration=A.hrTime=A.getTimeOrigin=A.addHrTimes=A.loggingErrorHandler=A.setGlobalErrorHandler=A.globalErrorHandler=A.sanitizeAttributes=A.isAttributeValue=A.isAttributeKey=A.AnchoredClock=A.W3CBaggagePropagator=void 0;A.internal=A.VERSION=A.BindOnceFuture=A.isWrapped=A.urlMatches=A.isUrlIgnored=A.callWithTimeout=A.TimeoutError=A.TracesSamplerValues=A.merge=A.parseEnvironment=A.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=A.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=A.DEFAULT_ENVIRONMENT=void 0;var ppe=FI();Object.defineProperty(A,"W3CBaggagePropagator",{enumerable:!0,get:function(){return ppe.W3CBaggagePropagator}});var _pe=$I();Object.defineProperty(A,"AnchoredClock",{enumerable:!0,get:function(){return _pe.AnchoredClock}});var ch=WI();Object.defineProperty(A,"isAttributeKey",{enumerable:!0,get:function(){return ch.isAttributeKey}});Object.defineProperty(A,"isAttributeValue",{enumerable:!0,get:function(){return ch.isAttributeValue}});Object.defineProperty(A,"sanitizeAttributes",{enumerable:!0,get:function(){return ch.sanitizeAttributes}});var uw=xg();Object.defineProperty(A,"globalErrorHandler",{enumerable:!0,get:function(){return uw.globalErrorHandler}});Object.defineProperty(A,"setGlobalErrorHandler",{enumerable:!0,get:function(){return uw.setGlobalErrorHandler}});var fpe=Lg();Object.defineProperty(A,"loggingErrorHandler",{enumerable:!0,get:function(){return fpe.loggingErrorHandler}});var Bn=bU();Object.defineProperty(A,"addHrTimes",{enumerable:!0,get:function(){return Bn.addHrTimes}});Object.defineProperty(A,"getTimeOrigin",{enumerable:!0,get:function(){return Bn.getTimeOrigin}});Object.defineProperty(A,"hrTime",{enumerable:!0,get:function(){return Bn.hrTime}});Object.defineProperty(A,"hrTimeDuration",{enumerable:!0,get:function(){return Bn.hrTimeDuration}});Object.defineProperty(A,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Bn.hrTimeToMicroseconds}});Object.defineProperty(A,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Bn.hrTimeToMilliseconds}});Object.defineProperty(A,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Bn.hrTimeToNanoseconds}});Object.defineProperty(A,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Bn.hrTimeToTimeStamp}});Object.defineProperty(A,"isTimeInput",{enumerable:!0,get:function(){return Bn.isTimeInput}});Object.defineProperty(A,"isTimeInputHrTime",{enumerable:!0,get:function(){return Bn.isTimeInputHrTime}});Object.defineProperty(A,"millisToHrTime",{enumerable:!0,get:function(){return Bn.millisToHrTime}});Object.defineProperty(A,"timeInputToHrTime",{enumerable:!0,get:function(){return Bn.timeInputToHrTime}});var mpe=kg();Object.defineProperty(A,"hexToBinary",{enumerable:!0,get:function(){return mpe.hexToBinary}});var Epe=MU();Object.defineProperty(A,"ExportResultCode",{enumerable:!0,get:function(){return Epe.ExportResultCode}});var I_=vg();A.baggageUtils={getKeyPairs:I_.getKeyPairs,serializeKeyPairs:I_.serializeKeyPairs,parseKeyPairsIntoRecord:I_.parseKeyPairsIntoRecord,parsePairKeyValue:I_.parsePairKeyValue};var ns=Hg();Object.defineProperty(A,"RandomIdGenerator",{enumerable:!0,get:function(){return ns.RandomIdGenerator}});Object.defineProperty(A,"SDK_INFO",{enumerable:!0,get:function(){return ns.SDK_INFO}});Object.defineProperty(A,"_globalThis",{enumerable:!0,get:function(){return ns._globalThis}});Object.defineProperty(A,"getEnv",{enumerable:!0,get:function(){return ns.getEnv}});Object.defineProperty(A,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return ns.getEnvWithoutDefaults}});Object.defineProperty(A,"hexToBase64",{enumerable:!0,get:function(){return ns.hexToBase64}});Object.defineProperty(A,"otperformance",{enumerable:!0,get:function(){return ns.otperformance}});Object.defineProperty(A,"unrefTimer",{enumerable:!0,get:function(){return ns.unrefTimer}});var Spe=xU();Object.defineProperty(A,"CompositePropagator",{enumerable:!0,get:function(){return Spe.CompositePropagator}});var P_=GU();Object.defineProperty(A,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return P_.TRACE_PARENT_HEADER}});Object.defineProperty(A,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return P_.TRACE_STATE_HEADER}});Object.defineProperty(A,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return P_.W3CTraceContextPropagator}});Object.defineProperty(A,"parseTraceParent",{enumerable:!0,get:function(){return P_.parseTraceParent}});var b_=HU();Object.defineProperty(A,"RPCType",{enumerable:!0,get:function(){return b_.RPCType}});Object.defineProperty(A,"deleteRPCMetadata",{enumerable:!0,get:function(){return b_.deleteRPCMetadata}});Object.defineProperty(A,"getRPCMetadata",{enumerable:!0,get:function(){return b_.getRPCMetadata}});Object.defineProperty(A,"setRPCMetadata",{enumerable:!0,get:function(){return b_.setRPCMetadata}});var Tpe=Zg();Object.defineProperty(A,"AlwaysOffSampler",{enumerable:!0,get:function(){return Tpe.AlwaysOffSampler}});var gpe=eh();Object.defineProperty(A,"AlwaysOnSampler",{enumerable:!0,get:function(){return gpe.AlwaysOnSampler}});var hpe=$U();Object.defineProperty(A,"ParentBasedSampler",{enumerable:!0,get:function(){return hpe.ParentBasedSampler}});var Ape=jU();Object.defineProperty(A,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Ape.TraceIdRatioBasedSampler}});var uh=Xu();Object.defineProperty(A,"isTracingSuppressed",{enumerable:!0,get:function(){return uh.isTracingSuppressed}});Object.defineProperty(A,"suppressTracing",{enumerable:!0,get:function(){return uh.suppressTracing}});Object.defineProperty(A,"unsuppressTracing",{enumerable:!0,get:function(){return uh.unsuppressTracing}});var Rpe=Wg();Object.defineProperty(A,"TraceState",{enumerable:!0,get:function(){return Rpe.TraceState}});var Ga=Ug();Object.defineProperty(A,"DEFAULT_ATTRIBUTE_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_ATTRIBUTE_COUNT_LIMIT}});Object.defineProperty(A,"DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}});Object.defineProperty(A,"DEFAULT_ENVIRONMENT",{enumerable:!0,get:function(){return Ga.DEFAULT_ENVIRONMENT}});Object.defineProperty(A,"DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT}});Object.defineProperty(A,"DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}});Object.defineProperty(A,"parseEnvironment",{enumerable:!0,get:function(){return Ga.parseEnvironment}});var ype=ew();Object.defineProperty(A,"merge",{enumerable:!0,get:function(){return ype.merge}});var Ope=Dg();Object.defineProperty(A,"TracesSamplerValues",{enumerable:!0,get:function(){return Ope.TracesSamplerValues}});var lw=tw();Object.defineProperty(A,"TimeoutError",{enumerable:!0,get:function(){return lw.TimeoutError}});Object.defineProperty(A,"callWithTimeout",{enumerable:!0,get:function(){return lw.callWithTimeout}});var dw=rw();Object.defineProperty(A,"isUrlIgnored",{enumerable:!0,get:function(){return dw.isUrlIgnored}});Object.defineProperty(A,"urlMatches",{enumerable:!0,get:function(){return dw.urlMatches}});var Npe=ow();Object.defineProperty(A,"isWrapped",{enumerable:!0,get:function(){return Npe.isWrapped}});var Cpe=iw();Object.defineProperty(A,"BindOnceFuture",{enumerable:!0,get:function(){return Cpe.BindOnceFuture}});var vpe=Bg();Object.defineProperty(A,"VERSION",{enumerable:!0,get:function(){return vpe.VERSION}});var Ipe=cw();A.internal={_export:Ipe._export}});var nl=m((jqe,pw)=>{"use strict";var Ppe="2.0.0",bpe=Number.MAX_SAFE_INTEGER||9007199254740991,Mpe=16,Lpe=250,xpe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];pw.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:Mpe,MAX_SAFE_BUILD_LENGTH:Lpe,MAX_SAFE_INTEGER:bpe,RELEASE_TYPES:xpe,SEMVER_SPEC_VERSION:Ppe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var rl=m((qqe,_w)=>{"use strict";var Dpe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};_w.exports=Dpe});var Ha=m((kr,fw)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:lh,MAX_SAFE_BUILD_LENGTH:Upe,MAX_LENGTH:wpe}=nl(),kpe=rl();kr=fw.exports={};var Vpe=kr.re=[],Bpe=kr.safeRe=[],U=kr.src=[],Gpe=kr.safeSrc=[],w=kr.t={},Hpe=0,dh="[a-zA-Z0-9-]",Fpe=[["\\s",1],["\\d",wpe],[dh,Upe]],$pe=t=>{for(let[e,n]of Fpe)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},ee=(t,e,n)=>{let r=$pe(e),o=Hpe++;kpe(t,o,e),w[t]=o,U[o]=e,Gpe[o]=r,Vpe[o]=new RegExp(e,n?"g":void 0),Bpe[o]=new RegExp(r,n?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${dh}*`);ee("MAINVERSION",`(${U[w.NUMERICIDENTIFIER]})\\.(${U[w.NUMERICIDENTIFIER]})\\.(${U[w.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${U[w.NUMERICIDENTIFIERLOOSE]})\\.(${U[w.NUMERICIDENTIFIERLOOSE]})\\.(${U[w.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${U[w.NONNUMERICIDENTIFIER]}|${U[w.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${U[w.NONNUMERICIDENTIFIER]}|${U[w.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${U[w.PRERELEASEIDENTIFIER]}(?:\\.${U[w.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${U[w.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${U[w.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${dh}+`);ee("BUILD",`(?:\\+(${U[w.BUILDIDENTIFIER]}(?:\\.${U[w.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${U[w.MAINVERSION]}${U[w.PRERELEASE]}?${U[w.BUILD]}?`);ee("FULL",`^${U[w.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${U[w.MAINVERSIONLOOSE]}${U[w.PRERELEASELOOSE]}?${U[w.BUILD]}?`);ee("LOOSE",`^${U[w.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${U[w.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${U[w.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${U[w.XRANGEIDENTIFIER]})(?:\\.(${U[w.XRANGEIDENTIFIER]})(?:\\.(${U[w.XRANGEIDENTIFIER]})(?:${U[w.PRERELEASE]})?${U[w.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${U[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[w.XRANGEIDENTIFIERLOOSE]})(?:${U[w.PRERELEASELOOSE]})?${U[w.BUILD]}?)?)?`);ee("XRANGE",`^${U[w.GTLT]}\\s*${U[w.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${U[w.GTLT]}\\s*${U[w.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${lh}})(?:\\.(\\d{1,${lh}}))?(?:\\.(\\d{1,${lh}}))?`);ee("COERCE",`${U[w.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",U[w.COERCEPLAIN]+`(?:${U[w.PRERELEASE]})?(?:${U[w.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",U[w.COERCE],!0);ee("COERCERTLFULL",U[w.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${U[w.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace="$1~";ee("TILDE",`^${U[w.LONETILDE]}${U[w.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${U[w.LONETILDE]}${U[w.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${U[w.LONECARET]}\\s+`,!0);kr.caretTrimReplace="$1^";ee("CARET",`^${U[w.LONECARET]}${U[w.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${U[w.LONECARET]}${U[w.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${U[w.GTLT]}\\s*(${U[w.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${U[w.GTLT]}\\s*(${U[w.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${U[w.GTLT]}\\s*(${U[w.LOOSEPLAIN]}|${U[w.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${U[w.XRANGEPLAIN]})\\s+-\\s+(${U[w.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${U[w.XRANGEPLAINLOOSE]})\\s+-\\s+(${U[w.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var M_=m((Yqe,mw)=>{"use strict";var jpe=Object.freeze({loose:!0}),qpe=Object.freeze({}),Ype=t=>t?typeof t!="object"?jpe:t:qpe;mw.exports=Ype});var ph=m((Kqe,Tw)=>{"use strict";var Ew=/^[0-9]+$/,Sw=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=Ew.test(t),r=Ew.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Kpe=(t,e)=>Sw(e,t);Tw.exports={compareIdentifiers:Sw,rcompareIdentifiers:Kpe}});var Vt=m((Wqe,hw)=>{"use strict";var L_=rl(),{MAX_LENGTH:gw,MAX_SAFE_INTEGER:x_}=nl(),{safeRe:D_,t:U_}=Ha(),Wpe=M_(),{compareIdentifiers:_h}=ph(),fh=class t{constructor(e,n){if(n=Wpe(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>gw)throw new TypeError(`version is longer than ${gw} characters`);L_("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?D_[U_.LOOSE]:D_[U_.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>x_||this.major<0)throw new TypeError("Invalid major version");if(this.minor>x_||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>x_||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<x_)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(L_("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(L_("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return _h(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(L_("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return _h(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?D_[U_.PRERELEASELOOSE]:D_[U_.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),_h(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};hw.exports=fh});var vi=m((zqe,Rw)=>{"use strict";var Aw=Vt(),zpe=(t,e,n=!1)=>{if(t instanceof Aw)return t;try{return new Aw(t,e)}catch(r){if(!n)return null;throw r}};Rw.exports=zpe});var Ow=m((Xqe,yw)=>{"use strict";var Xpe=vi(),Jpe=(t,e)=>{let n=Xpe(t,e);return n?n.version:null};yw.exports=Jpe});var Cw=m((Jqe,Nw)=>{"use strict";var Zpe=vi(),Qpe=(t,e)=>{let n=Zpe(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};Nw.exports=Qpe});var Pw=m((Zqe,Iw)=>{"use strict";var vw=Vt(),e_e=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new vw(t instanceof vw?t.version:t,n).inc(e,r,o).version}catch{return null}};Iw.exports=e_e});var Lw=m((Qqe,Mw)=>{"use strict";var bw=vi(),t_e=(t,e)=>{let n=bw(t,null,!0),r=bw(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};Mw.exports=t_e});var Dw=m((eYe,xw)=>{"use strict";var n_e=Vt(),r_e=(t,e)=>new n_e(t,e).major;xw.exports=r_e});var ww=m((tYe,Uw)=>{"use strict";var o_e=Vt(),s_e=(t,e)=>new o_e(t,e).minor;Uw.exports=s_e});var Vw=m((nYe,kw)=>{"use strict";var i_e=Vt(),a_e=(t,e)=>new i_e(t,e).patch;kw.exports=a_e});var Gw=m((rYe,Bw)=>{"use strict";var c_e=vi(),u_e=(t,e)=>{let n=c_e(t,e);return n&&n.prerelease.length?n.prerelease:null};Bw.exports=u_e});var Gn=m((oYe,Fw)=>{"use strict";var Hw=Vt(),l_e=(t,e,n)=>new Hw(t,n).compare(new Hw(e,n));Fw.exports=l_e});var jw=m((sYe,$w)=>{"use strict";var d_e=Gn(),p_e=(t,e,n)=>d_e(e,t,n);$w.exports=p_e});var Yw=m((iYe,qw)=>{"use strict";var __e=Gn(),f_e=(t,e)=>__e(t,e,!0);qw.exports=f_e});var w_=m((aYe,Ww)=>{"use strict";var Kw=Vt(),m_e=(t,e,n)=>{let r=new Kw(t,n),o=new Kw(e,n);return r.compare(o)||r.compareBuild(o)};Ww.exports=m_e});var Xw=m((cYe,zw)=>{"use strict";var E_e=w_(),S_e=(t,e)=>t.sort((n,r)=>E_e(n,r,e));zw.exports=S_e});var Zw=m((uYe,Jw)=>{"use strict";var T_e=w_(),g_e=(t,e)=>t.sort((n,r)=>T_e(r,n,e));Jw.exports=g_e});var ol=m((lYe,Qw)=>{"use strict";var h_e=Gn(),A_e=(t,e,n)=>h_e(t,e,n)>0;Qw.exports=A_e});var k_=m((dYe,e1)=>{"use strict";var R_e=Gn(),y_e=(t,e,n)=>R_e(t,e,n)<0;e1.exports=y_e});var mh=m((pYe,t1)=>{"use strict";var O_e=Gn(),N_e=(t,e,n)=>O_e(t,e,n)===0;t1.exports=N_e});var Eh=m((_Ye,n1)=>{"use strict";var C_e=Gn(),v_e=(t,e,n)=>C_e(t,e,n)!==0;n1.exports=v_e});var V_=m((fYe,r1)=>{"use strict";var I_e=Gn(),P_e=(t,e,n)=>I_e(t,e,n)>=0;r1.exports=P_e});var B_=m((mYe,o1)=>{"use strict";var b_e=Gn(),M_e=(t,e,n)=>b_e(t,e,n)<=0;o1.exports=M_e});var Sh=m((EYe,s1)=>{"use strict";var L_e=mh(),x_e=Eh(),D_e=ol(),U_e=V_(),w_e=k_(),k_e=B_(),V_e=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return L_e(t,n,r);case"!=":return x_e(t,n,r);case">":return D_e(t,n,r);case">=":return U_e(t,n,r);case"<":return w_e(t,n,r);case"<=":return k_e(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};s1.exports=V_e});var a1=m((SYe,i1)=>{"use strict";var B_e=Vt(),G_e=vi(),{safeRe:G_,t:H_}=Ha(),H_e=(t,e)=>{if(t instanceof B_e)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?G_[H_.COERCEFULL]:G_[H_.COERCE]);else{let c=e.includePrerelease?G_[H_.COERCERTLFULL]:G_[H_.COERCERTL],u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return G_e(`${r}.${o}.${s}${i}${a}`,e)};i1.exports=H_e});var u1=m((TYe,c1)=>{"use strict";var Th=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};c1.exports=Th});var Hn=m((gYe,_1)=>{"use strict";var F_e=/\s+/g,gh=class t{constructor(e,n){if(n=j_e(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof hh)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(F_e," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!d1(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&J_e(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&z_e)|(this.options.loose&&X_e))+":"+e,o=l1.get(r);if(o)return o;let s=this.options.loose,i=s?Jt[Bt.HYPHENRANGELOOSE]:Jt[Bt.HYPHENRANGE];e=e.replace(i,afe(this.options.includePrerelease)),Ie("hyphen replace",e),e=e.replace(Jt[Bt.COMPARATORTRIM],Y_e),Ie("comparator trim",e),e=e.replace(Jt[Bt.TILDETRIM],K_e),Ie("tilde trim",e),e=e.replace(Jt[Bt.CARETTRIM],W_e),Ie("caret trim",e);let a=e.split(" ").map(d=>Z_e(d,this.options)).join(" ").split(/\s+/).map(d=>ife(d,this.options));s&&(a=a.filter(d=>(Ie("loose invalid filter",d,this.options),!!d.match(Jt[Bt.COMPARATORLOOSE])))),Ie("range list",a);let c=new Map,u=a.map(d=>new hh(d,this.options));for(let d of u){if(d1(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return l1.set(r,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>p1(r,n)&&e.set.some(o=>p1(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new q_e(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(cfe(this.set[n],e,this.options))return!0;return!1}};_1.exports=gh;var $_e=u1(),l1=new $_e,j_e=M_(),hh=sl(),Ie=rl(),q_e=Vt(),{safeRe:Jt,t:Bt,comparatorTrimReplace:Y_e,tildeTrimReplace:K_e,caretTrimReplace:W_e}=Ha(),{FLAG_INCLUDE_PRERELEASE:z_e,FLAG_LOOSE:X_e}=nl(),d1=t=>t.value==="<0.0.0-0",J_e=t=>t.value==="",p1=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},Z_e=(t,e)=>(t=t.replace(Jt[Bt.BUILD],""),Ie("comp",t,e),t=tfe(t,e),Ie("caret",t),t=Q_e(t,e),Ie("tildes",t),t=rfe(t,e),Ie("xrange",t),t=sfe(t,e),Ie("stars",t),t),Zt=t=>!t||t.toLowerCase()==="x"||t==="*",Q_e=(t,e)=>t.trim().split(/\s+/).map(n=>efe(n,e)).join(" "),efe=(t,e)=>{let n=e.loose?Jt[Bt.TILDELOOSE]:Jt[Bt.TILDE];return t.replace(n,(r,o,s,i,a)=>{Ie("tilde",t,r,o,s,i,a);let c;return Zt(o)?c="":Zt(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:Zt(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(Ie("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,Ie("tilde return",c),c})},tfe=(t,e)=>t.trim().split(/\s+/).map(n=>nfe(n,e)).join(" "),nfe=(t,e)=>{Ie("caret",t,e);let n=e.loose?Jt[Bt.CARETLOOSE]:Jt[Bt.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{Ie("caret",t,o,s,i,a,c);let u;return Zt(s)?u="":Zt(i)?u=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Zt(a)?s==="0"?u=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(Ie("replaceCaret pr",c),s==="0"?i==="0"?u=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:u=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(Ie("no pr"),s==="0"?i==="0"?u=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:u=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),Ie("caret return",u),u})},rfe=(t,e)=>(Ie("replaceXRanges",t,e),t.split(/\s+/).map(n=>ofe(n,e)).join(" ")),ofe=(t,e)=>{t=t.trim();let n=e.loose?Jt[Bt.XRANGELOOSE]:Jt[Bt.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{Ie("xRange",t,r,o,s,i,a,c);let u=Zt(s),l=u||Zt(i),d=l||Zt(a),p=d;return o==="="&&p&&(o=""),c=e.includePrerelease?"-0":"",u?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&p?(l&&(i=0),a=0,o===">"?(o=">=",l?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",l?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),Ie("xRange return",r),r})},sfe=(t,e)=>(Ie("replaceStars",t,e),t.trim().replace(Jt[Bt.STAR],"")),ife=(t,e)=>(Ie("replaceGTE0",t,e),t.trim().replace(Jt[e.includePrerelease?Bt.GTE0PRE:Bt.GTE0],"")),afe=t=>(e,n,r,o,s,i,a,c,u,l,d,p)=>(Zt(r)?n="":Zt(o)?n=`>=${r}.0.0${t?"-0":""}`:Zt(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Zt(u)?c="":Zt(l)?c=`<${+u+1}.0.0-0`:Zt(d)?c=`<${u}.${+l+1}.0-0`:p?c=`<=${u}.${l}.${d}-${p}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),cfe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(Ie(t[r].semver),t[r].semver!==hh.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var sl=m((hYe,g1)=>{"use strict";var il=Symbol("SemVer ANY"),yh=class t{static get ANY(){return il}constructor(e,n){if(n=f1(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),Rh("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===il?this.value="":this.value=this.operator+this.semver.version,Rh("comp",this)}parse(e){let n=this.options.loose?m1[E1.COMPARATORLOOSE]:m1[E1.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new S1(r[2],this.options.loose):this.semver=il}toString(){return this.value}test(e){if(Rh("Comparator.test",e,this.options.loose),this.semver===il||e===il)return!0;if(typeof e=="string")try{e=new S1(e,this.options)}catch{return!1}return Ah(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new T1(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new T1(this.value,n).test(e.semver):(n=f1(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Ah(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Ah(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};g1.exports=yh;var f1=M_(),{safeRe:m1,t:E1}=Ha(),Ah=Sh(),Rh=rl(),S1=Vt(),T1=Hn()});var al=m((AYe,h1)=>{"use strict";var ufe=Hn(),lfe=(t,e,n)=>{try{e=new ufe(e,n)}catch{return!1}return e.test(t)};h1.exports=lfe});var R1=m((RYe,A1)=>{"use strict";var dfe=Hn(),pfe=(t,e)=>new dfe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));A1.exports=pfe});var O1=m((yYe,y1)=>{"use strict";var _fe=Vt(),ffe=Hn(),mfe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new ffe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new _fe(r,n))}),r};y1.exports=mfe});var C1=m((OYe,N1)=>{"use strict";var Efe=Vt(),Sfe=Hn(),Tfe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Sfe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new Efe(r,n))}),r};N1.exports=Tfe});var P1=m((NYe,I1)=>{"use strict";var Oh=Vt(),gfe=Hn(),v1=ol(),hfe=(t,e)=>{t=new gfe(t,e);let n=new Oh("0.0.0");if(t.test(n)||(n=new Oh("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new Oh(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||v1(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||v1(n,s))&&(n=s)}return n&&t.test(n)?n:null};I1.exports=hfe});var M1=m((CYe,b1)=>{"use strict";var Afe=Hn(),Rfe=(t,e)=>{try{return new Afe(t,e).range||"*"}catch{return null}};b1.exports=Rfe});var F_=m((vYe,U1)=>{"use strict";var yfe=Vt(),D1=sl(),{ANY:Ofe}=D1,Nfe=Hn(),Cfe=al(),L1=ol(),x1=k_(),vfe=B_(),Ife=V_(),Pfe=(t,e,n,r)=>{t=new yfe(t,r),e=new Nfe(e,r);let o,s,i,a,c;switch(n){case">":o=L1,s=vfe,i=x1,a=">",c=">=";break;case"<":o=x1,s=Ife,i=L1,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Cfe(t,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,p=null;if(l.forEach(_=>{_.semver===Ofe&&(_=new D1(">=0.0.0")),d=d||_,p=p||_,o(_.semver,d.semver,r)?d=_:i(_.semver,p.semver,r)&&(p=_)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&s(t,p.semver))return!1;if(p.operator===c&&i(t,p.semver))return!1}return!0};U1.exports=Pfe});var k1=m((IYe,w1)=>{"use strict";var bfe=F_(),Mfe=(t,e,n)=>bfe(t,e,">",n);w1.exports=Mfe});var B1=m((PYe,V1)=>{"use strict";var Lfe=F_(),xfe=(t,e,n)=>Lfe(t,e,"<",n);V1.exports=xfe});var F1=m((bYe,H1)=>{"use strict";var G1=Hn(),Dfe=(t,e,n)=>(t=new G1(t,n),e=new G1(e,n),t.intersects(e,n));H1.exports=Dfe});var j1=m((MYe,$1)=>{"use strict";var Ufe=al(),wfe=Gn();$1.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((l,d)=>wfe(l,d,n));for(let l of i)Ufe(l,e,n)?(s=l,o||(o=l)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[l,d]of r)l===d?a.push(l):!d&&l===i[0]?a.push("*"):d?l===i[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var X1=m((LYe,z1)=>{"use strict";var q1=Hn(),Ch=sl(),{ANY:Nh}=Ch,cl=al(),vh=Gn(),kfe=(t,e,n={})=>{if(t===e)return!0;t=new q1(t,n),e=new q1(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=Bfe(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},Vfe=[new Ch(">=0.0.0-0")],Y1=[new Ch(">=0.0.0")],Bfe=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Nh){if(e.length===1&&e[0].semver===Nh)return!0;n.includePrerelease?t=Vfe:t=Y1}if(e.length===1&&e[0].semver===Nh){if(n.includePrerelease)return!0;e=Y1}let r=new Set,o,s;for(let _ of t)_.operator===">"||_.operator===">="?o=K1(o,_,n):_.operator==="<"||_.operator==="<="?s=W1(s,_,n):r.add(_.semver);if(r.size>1)return null;let i;if(o&&s){if(i=vh(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let _ of r){if(o&&!cl(_,String(o),n)||s&&!cl(_,String(s),n))return null;for(let f of e)if(!cl(_,String(f),n))return!1;return!0}let a,c,u,l,d=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let _ of e){if(l=l||_.operator===">"||_.operator===">=",u=u||_.operator==="<"||_.operator==="<=",o){if(p&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===p.major&&_.semver.minor===p.minor&&_.semver.patch===p.patch&&(p=!1),_.operator===">"||_.operator===">="){if(a=K1(o,_,n),a===_&&a!==o)return!1}else if(o.operator===">="&&!cl(o.semver,String(_),n))return!1}if(s){if(d&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===d.major&&_.semver.minor===d.minor&&_.semver.patch===d.patch&&(d=!1),_.operator==="<"||_.operator==="<="){if(c=W1(s,_,n),c===_&&c!==s)return!1}else if(s.operator==="<="&&!cl(s.semver,String(_),n))return!1}if(!_.operator&&(s||o)&&i!==0)return!1}return!(o&&u&&!s&&i!==0||s&&l&&!o&&i!==0||p||d)},K1=(t,e,n)=>{if(!t)return e;let r=vh(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},W1=(t,e,n)=>{if(!t)return e;let r=vh(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};z1.exports=kfe});var Ph=m((xYe,Q1)=>{"use strict";var Ih=Ha(),J1=nl(),Gfe=Vt(),Z1=ph(),Hfe=vi(),Ffe=Ow(),$fe=Cw(),jfe=Pw(),qfe=Lw(),Yfe=Dw(),Kfe=ww(),Wfe=Vw(),zfe=Gw(),Xfe=Gn(),Jfe=jw(),Zfe=Yw(),Qfe=w_(),eme=Xw(),tme=Zw(),nme=ol(),rme=k_(),ome=mh(),sme=Eh(),ime=V_(),ame=B_(),cme=Sh(),ume=a1(),lme=sl(),dme=Hn(),pme=al(),_me=R1(),fme=O1(),mme=C1(),Eme=P1(),Sme=M1(),Tme=F_(),gme=k1(),hme=B1(),Ame=F1(),Rme=j1(),yme=X1();Q1.exports={parse:Hfe,valid:Ffe,clean:$fe,inc:jfe,diff:qfe,major:Yfe,minor:Kfe,patch:Wfe,prerelease:zfe,compare:Xfe,rcompare:Jfe,compareLoose:Zfe,compareBuild:Qfe,sort:eme,rsort:tme,gt:nme,lt:rme,eq:ome,neq:sme,gte:ime,lte:ame,cmp:cme,coerce:ume,Comparator:lme,Range:dme,satisfies:pme,toComparators:_me,maxSatisfying:fme,minSatisfying:mme,minVersion:Eme,validRange:Sme,outside:Tme,gtr:gme,ltr:hme,intersects:Ame,simplifyRange:Rme,subset:yme,SemVer:Gfe,re:Ih.re,src:Ih.src,tokens:Ih.t,SEMVER_SPEC_VERSION:J1.SEMVER_SPEC_VERSION,RELEASE_TYPES:J1.RELEASE_TYPES,compareIdentifiers:Z1.compareIdentifiers,rcompareIdentifiers:Z1.rcompareIdentifiers}});var ek=m($_=>{"use strict";Object.defineProperty($_,"__esModule",{value:!0});$_.VERSION=void 0;$_.VERSION="0.57.2"});var tk=m(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.SeverityNumber=void 0;var Ome;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Ome=ul.SeverityNumber||(ul.SeverityNumber={}))});var q_=m(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.NOOP_LOGGER=Fa.NoopLogger=void 0;var j_=class{emit(e){}};Fa.NoopLogger=j_;Fa.NOOP_LOGGER=new j_});var K_=m($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.NOOP_LOGGER_PROVIDER=$a.NoopLoggerProvider=void 0;var Nme=q_(),Y_=class{getLogger(e,n,r){return new Nme.NoopLogger}};$a.NoopLoggerProvider=Y_;$a.NOOP_LOGGER_PROVIDER=new Y_});var Mh=m(W_=>{"use strict";Object.defineProperty(W_,"__esModule",{value:!0});W_.ProxyLogger=void 0;var Cme=q_(),bh=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Cme.NOOP_LOGGER}};W_.ProxyLogger=bh});var xh=m(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.ProxyLoggerProvider=void 0;var vme=K_(),Ime=Mh(),Lh=class{getLogger(e,n,r){var o;return(o=this.getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new Ime.ProxyLogger(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:vme.NOOP_LOGGER_PROVIDER}setDelegate(e){this._delegate=e}getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};z_.ProxyLoggerProvider=Lh});var nk=m(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_._globalThis=void 0;X_._globalThis=typeof globalThis=="object"?globalThis:global});var rk=m(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});J_._globalThis=void 0;var Pme=nk();Object.defineProperty(J_,"_globalThis",{enumerable:!0,get:function(){return Pme._globalThis}})});var ok=m(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_._globalThis=void 0;var bme=rk();Object.defineProperty(Z_,"_globalThis",{enumerable:!0,get:function(){return bme._globalThis}})});var sk=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.API_BACKWARDS_COMPATIBILITY_VERSION=Vr.makeGetter=Vr._global=Vr.GLOBAL_LOGS_API_KEY=void 0;var Mme=ok();Vr.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Vr._global=Mme._globalThis;function Lme(t,e,n){return r=>r===t?e:n}Vr.makeGetter=Lme;Vr.API_BACKWARDS_COMPATIBILITY_VERSION=1});var ak=m(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_.LogsAPI=void 0;var Fn=sk(),xme=K_(),ik=xh(),Dh=class t{constructor(){this._proxyLoggerProvider=new ik.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return Fn._global[Fn.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Fn._global[Fn.GLOBAL_LOGS_API_KEY]=(0,Fn.makeGetter)(Fn.API_BACKWARDS_COMPATIBILITY_VERSION,e,xme.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=Fn._global[Fn.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call(Fn._global,Fn.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete Fn._global[Fn.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new ik.ProxyLoggerProvider}};Q_.LogsAPI=Dh});var Uh=m(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.logs=ht.ProxyLoggerProvider=ht.ProxyLogger=ht.NoopLoggerProvider=ht.NOOP_LOGGER_PROVIDER=ht.NoopLogger=ht.NOOP_LOGGER=ht.SeverityNumber=void 0;var Dme=tk();Object.defineProperty(ht,"SeverityNumber",{enumerable:!0,get:function(){return Dme.SeverityNumber}});var ck=q_();Object.defineProperty(ht,"NOOP_LOGGER",{enumerable:!0,get:function(){return ck.NOOP_LOGGER}});Object.defineProperty(ht,"NoopLogger",{enumerable:!0,get:function(){return ck.NoopLogger}});var uk=K_();Object.defineProperty(ht,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return uk.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ht,"NoopLoggerProvider",{enumerable:!0,get:function(){return uk.NoopLoggerProvider}});var Ume=Mh();Object.defineProperty(ht,"ProxyLogger",{enumerable:!0,get:function(){return Ume.ProxyLogger}});var wme=xh();Object.defineProperty(ht,"ProxyLoggerProvider",{enumerable:!0,get:function(){return wme.ProxyLoggerProvider}});var kme=ak();ht.logs=kme.LogsAPI.getInstance()});var lk=m(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.disableInstrumentations=ja.enableInstrumentations=void 0;function Vme(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ja.enableInstrumentations=Vme;function Bme(t){t.forEach(e=>e.disable())}ja.disableInstrumentations=Bme});var _k=m(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.registerInstrumentations=void 0;var dk=(L(),I(V)),Gme=Uh(),pk=lk();function Hme(t){var e,n;let r=t.tracerProvider||dk.trace.getTracerProvider(),o=t.meterProvider||dk.metrics.getMeterProvider(),s=t.loggerProvider||Gme.logs.getLoggerProvider(),i=(n=(e=t.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&n!==void 0?n:[];return(0,pk.enableInstrumentations)(i,r,o,s),()=>{(0,pk.disableInstrumentations)(i)}}ef.registerInstrumentations=Hme});var kh=m((WYe,Ek)=>{"use strict";function wh(t){return typeof t=="function"}var Qt=console.error.bind(console);function ll(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function dl(t){t&&t.logger&&(wh(t.logger)?Qt=t.logger:Qt("new logger isn't a function, not replacing"))}function fk(t,e,n){if(!t||!t[e]){Qt("no original function "+e+" to wrap");return}if(!n){Qt("no wrapper function"),Qt(new Error().stack);return}if(!wh(t[e])||!wh(n)){Qt("original object and wrapper must be functions");return}var r=t[e],o=n(r,e);return ll(o,"__original",r),ll(o,"__unwrap",function(){t[e]===o&&ll(t,e,r)}),ll(o,"__wrapped",!0),ll(t,e,o),o}function Fme(t,e,n){if(t)Array.isArray(t)||(t=[t]);else{Qt("must provide one or more modules to patch"),Qt(new Error().stack);return}if(!(e&&Array.isArray(e))){Qt("must provide one or more functions to wrap on modules");return}t.forEach(function(r){e.forEach(function(o){fk(r,o,n)})})}function mk(t,e){if(!t||!t[e]){Qt("no function to unwrap."),Qt(new Error().stack);return}if(!t[e].__unwrap)Qt("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}function $me(t,e){if(t)Array.isArray(t)||(t=[t]);else{Qt("must provide one or more modules to patch"),Qt(new Error().stack);return}if(!(e&&Array.isArray(e))){Qt("must provide one or more functions to unwrap on modules");return}t.forEach(function(n){e.forEach(function(r){mk(n,r)})})}dl.wrap=fk;dl.massWrap=Fme;dl.unwrap=mk;dl.massUnwrap=$me;Ek.exports=dl});var Sk=m(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0});nf.InstrumentationAbstract=void 0;var Vh=(L(),I(V)),jme=Uh(),tf=kh(),Bh=class{constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this._config={},this._wrap=tf.wrap,this._unwrap=tf.unwrap,this._massWrap=tf.massWrap,this._massUnwrap=tf.massUnwrap,this.setConfig(r),this._diag=Vh.diag.createComponentLogger({namespace:e}),this._tracer=Vh.trace.getTracer(e,n),this._meter=Vh.metrics.getMeter(e,n),this._logger=jme.logs.getLogger(e,n),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let n=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(n)?n:[n]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};nf.InstrumentationAbstract=Bh});var gk=m((XYe,Tk)=>{var qa=1e3,Ya=qa*60,Ka=Ya*60,Ii=Ka*24,qme=Ii*7,Yme=Ii*365.25;Tk.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Kme(t);if(n==="number"&&isFinite(t))return e.long?zme(t):Wme(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Kme(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Yme;case"weeks":case"week":case"w":return n*qme;case"days":case"day":case"d":return n*Ii;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ka;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ya;case"seconds":case"second":case"secs":case"sec":case"s":return n*qa;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Wme(t){var e=Math.abs(t);return e>=Ii?Math.round(t/Ii)+"d":e>=Ka?Math.round(t/Ka)+"h":e>=Ya?Math.round(t/Ya)+"m":e>=qa?Math.round(t/qa)+"s":t+"ms"}function zme(t){var e=Math.abs(t);return e>=Ii?rf(t,e,Ii,"day"):e>=Ka?rf(t,e,Ka,"hour"):e>=Ya?rf(t,e,Ya,"minute"):e>=qa?rf(t,e,qa,"second"):t+" ms"}function rf(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var Gh=m((JYe,hk)=>{function Xme(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=gk(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let d=0;for(let p=0;p<l.length;p++)d=(d<<5)-d+l.charCodeAt(p),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=e;function n(l){let d,p=null,_,f;function E(...S){if(!E.enabled)return;let g=E,h=Number(new Date),O=h-(d||h);g.diff=O,g.prev=d,g.curr=h,d=h,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let N=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(M,P)=>{if(M==="%%")return"%";N++;let J=n.formatters[P];if(typeof J=="function"){let X=S[N];M=J.call(g,X),S.splice(N,1),N--}return M}),n.formatArgs.call(g,S),(g.log||n.log).apply(g,S)}return E.namespace=l,E.useColors=n.useColors(),E.color=n.selectColor(l),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(_!==n.namespaces&&(_=n.namespaces,f=n.enabled(l)),f),set:S=>{p=S}}),typeof n.init=="function"&&n.init(E),E}function r(l,d){let p=n(this.namespace+(typeof d>"u"?":":d)+l);return p.log=this.log,p}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of d)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function s(l,d){let p=0,_=0,f=-1,E=0;for(;p<l.length;)if(_<d.length&&(d[_]===l[p]||d[_]==="*"))d[_]==="*"?(f=_,E=p,_++):(p++,_++);else if(f!==-1)_=f+1,E++,p=E;else return!1;for(;_<d.length&&d[_]==="*";)_++;return _===d.length}function i(){let l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(let d of n.skips)if(s(l,d))return!1;for(let d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){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}hk.exports=Xme});var Ak=m((pn,of)=>{pn.formatArgs=Zme;pn.save=Qme;pn.load=eEe;pn.useColors=Jme;pn.storage=tEe();pn.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();pn.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function Jme(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Zme(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+of.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}pn.log=console.debug||console.log||(()=>{});function Qme(t){try{t?pn.storage.setItem("debug",t):pn.storage.removeItem("debug")}catch{}}function eEe(){let t;try{t=pn.storage.getItem("debug")||pn.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function tEe(){try{return localStorage}catch{}}of.exports=Gh()(pn);var{formatters:nEe}=of.exports;nEe.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var yk=m((ZYe,Rk)=>{"use strict";Rk.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var Ck=m((QYe,Nk)=>{"use strict";var rEe=require("os"),Ok=require("tty"),$n=yk(),{env:At}=process,rs;$n("no-color")||$n("no-colors")||$n("color=false")||$n("color=never")?rs=0:($n("color")||$n("colors")||$n("color=true")||$n("color=always"))&&(rs=1);"FORCE_COLOR"in At&&(At.FORCE_COLOR==="true"?rs=1:At.FORCE_COLOR==="false"?rs=0:rs=At.FORCE_COLOR.length===0?1:Math.min(parseInt(At.FORCE_COLOR,10),3));function Hh(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function Fh(t,e){if(rs===0)return 0;if($n("color=16m")||$n("color=full")||$n("color=truecolor"))return 3;if($n("color=256"))return 2;if(t&&!e&&rs===void 0)return 0;let n=rs||0;if(At.TERM==="dumb")return n;if(process.platform==="win32"){let r=rEe.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in At)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in At)||At.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in At)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(At.TEAMCITY_VERSION)?1:0;if(At.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in At){let r=parseInt((At.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(At.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(At.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(At.TERM)||"COLORTERM"in At?1:n}function oEe(t){let e=Fh(t,t&&t.isTTY);return Hh(e)}Nk.exports={supportsColor:oEe,stdout:Hh(Fh(!0,Ok.isatty(1))),stderr:Hh(Fh(!0,Ok.isatty(2)))}});var Ik=m((Rt,af)=>{var sEe=require("tty"),sf=require("util");Rt.init=pEe;Rt.log=uEe;Rt.formatArgs=aEe;Rt.save=lEe;Rt.load=dEe;Rt.useColors=iEe;Rt.destroy=sf.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Rt.colors=[6,2,3,4,5,1];try{let t=Ck();t&&(t.stderr||t).level>=2&&(Rt.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{}Rt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function iEe(){return"colors"in Rt.inspectOpts?!!Rt.inspectOpts.colors:sEe.isatty(process.stderr.fd)}function aEe(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
1
+ "use strict";var K6=Object.create;var Yd=Object.defineProperty;var W6=Object.getOwnPropertyDescriptor;var z6=Object.getOwnPropertyNames;var X6=Object.getPrototypeOf,J6=Object.prototype.hasOwnProperty;var B=(t,e)=>()=>(t&&(e=t(t=0)),e);var m=(t,e)=>()=>(e||t((e={exports:{}}).exports,e),e.exports),Kd=(t,e)=>{for(var n in e)Yd(t,n,{get:e[n],enumerable:!0})},JN=(t,e,n,r)=>{if(e&&typeof e=="object"||typeof e=="function")for(let o of z6(e))!J6.call(t,o)&&o!==n&&Yd(t,o,{get:()=>e[o],enumerable:!(r=W6(e,o))||r.enumerable});return t};var v=(t,e,n)=>(n=t!=null?K6(X6(t)):{},JN(e||!t||!t.__esModule?Yd(n,"default",{value:t,enumerable:!0}):n,t)),I=t=>JN(Yd({},"__esModule",{value:!0}),t);var Zd=m((lBe,lJ)=>{lJ.exports={name:"@visa/cli",version:"2.0.0-rc.39",description:"AI-powered payments for Claude Code",bin:{"visa-cli":"./bin/visa-cli.js"},scripts:{prebuild:"pnpm --filter @visa/money build && pnpm --filter @visa-cli/tools build",build:"tsc --noEmit && node esbuild.config.js",dev:"tsc --watch",pretest:"pnpm build",start:"node dist/mcp-server/index.js",test:"jest --config jest.config.js","test:unit":"jest --config jest.config.js","test:unit:watch":"jest --config jest.config.js --watch","test:unit:coverage":"jest --config jest.config.js --coverage","test:smoke":"VISA_AUTH_URL=https://auth.visacli.sh jest --config jest.smoke.config.js","test:integration":"jest --config jest.integration.config.js","test:e2e":"jest --config jest.e2e.config.js","test:catalog-e2e":"jest --config jest.catalog-e2e.config.js","test:all":"npm run test:unit && npm run test:integration && npm run test:e2e",prepublishOnly:"npm run build && npm test",lint:"eslint src/**/*.ts",format:'prettier --write "src/**/*.ts"',"format:check":'prettier --check "src/**/*.ts"'},keywords:["visa","checkout","mcp","ai-agent","payments","click-to-pay","usdc","stablecoin"],author:"Visa Crypto Labs",license:"SEE LICENSE IN LICENSE",dependencies:{"@modelcontextprotocol/sdk":"^1.0.0",commander:"^12.1.0",zod:"^3.23.0"},devDependencies:{"@visa/money":"workspace:*","@visa/observability":"workspace:*","@visa-cli/tools":"workspace:*","@changesets/changelog-git":"^0.2.1","@changesets/cli":"^2.31.0","@types/jest":"^30.0.0","@types/node":"^25.6.0","@typescript-eslint/eslint-plugin":"^8.59.2","@typescript-eslint/parser":"^8.59.1","@types/express":"^5.0.0",esbuild:"^0.27.4",express:"^4.21.0",eslint:"^10.0.2","eslint-config-prettier":"^10.1.8",jest:"^29.7.0",prettier:"^3.8.3","ts-jest":"^29.2.0",typescript:"^5.7.0"},engines:{node:">=18.0.0"},mcpName:"io.github.visa-crypto-labs/visa-cli",files:["bin/visa-cli.js","dist/","install.ps1","native/visa-keychain.m","server.json","README.md","LICENSE"]}});var ST=m(ct=>{"use strict";Object.defineProperty(ct,"__esModule",{value:!0});ct.micros=uZ;ct.fromCents=lZ;ct.fromUsdc=dZ;ct.fromUsd=pZ;ct.toCents=_Z;ct.toCentsForAcquirer=fZ;ct.toUsdc=mZ;ct.toWire=EZ;ct.fromWire=SZ;ct.toDisplay=TZ;ct.toUsdRounded2dp=gZ;ct.add=hZ;ct.sub=AZ;ct.clampNonNegative=RZ;ct.isNonNegative=yZ;ct.max=OZ;ct.min=NZ;var lo=10000n,tv=1000000n;function uZ(t){return t}function lZ(t){if(!Number.isFinite(t)||!Number.isInteger(t)||!Number.isSafeInteger(t))throw new TypeError(`fromCents: expected safe integer, got ${t}`);return BigInt(t)*lo}function dZ(t){return t}function pZ(t){if(!Number.isFinite(t))throw new TypeError(`fromUsd: expected finite number, got ${t}`);return BigInt(Math.round(t*1e6))}function _Z(t){if(t>=0n)return Number(t/lo);let e=t/lo,n=t%lo;return Number(n===0n?e:e-1n)}function fZ(t){if(t<0n)throw new RangeError(`toCentsForAcquirer: refusing negative micros (${t}); card charges are non-negative`);return Number(t/lo)}function mZ(t){return t}function EZ(t){return t.toString()}function SZ(t){if(typeof t!="string"||t.length===0)throw new TypeError(`fromWire: expected non-empty string, got ${typeof t} ${JSON.stringify(t)}`);if(!/^-?\d+$/.test(t))throw new TypeError(`fromWire: not a valid micros integer: ${JSON.stringify(t)}`);return BigInt(t)}function TZ(t,e={}){let n=e.decimals??2,r=e.symbol??"$",o=t<0n,s=o?-t:t,i=s/tv,a=s%tv,c=o?"-":"";if(n===0)return`${c}${r}${i.toString()}`;let u=a.toString().padStart(6,"0").slice(0,n);return`${c}${r}${i.toString()}.${u}`}function gZ(t){let e=t<0n,n=e?-t:t,r=n/lo,s=n%lo*2n,i;s<lo?i=r:s>lo?i=r+1n:i=r%2n===0n?r:r+1n;let a=Number(i)/100;return e?-a:a}function hZ(t,e){return t+e}function AZ(t,e){return t-e}function RZ(t){return t<0n?0n:t}function yZ(t){return t>=0n}function OZ(t,e){return t>e?t:e}function NZ(t,e){return t<e?t:e}});var Eo,YT=B(()=>{Eo="1.9.1"});function G7(t){let e=new Set([t]),n=new Set,r=t.match(Xv);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(c){return c===t};function s(a){return n.add(a),!1}function i(a){return e.add(a),!0}return function(c){if(e.has(c))return!0;if(n.has(c))return!1;let u=c.match(Xv);if(!u)return s(c);let l={major:+u[1],minor:+u[2],patch:+u[3],prerelease:u[4]};return l.prerelease!=null||o.major!==l.major?s(c):o.major===0?o.minor===l.minor&&o.patch<=l.patch?i(c):s(c):o.minor<=l.minor?i(c):s(c)}}var Xv,Jv,Zv=B(()=>{YT();Xv=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;Jv=G7(Eo)});function Lr(t,e,n,r=!1){var o;let s=$u[Fu]=(o=$u[Fu])!==null&&o!==void 0?o:{version:Eo};if(!r&&s[t]){let i=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${t}`);return n.error(i.stack||i.message),!1}if(s.version!==Eo){let i=new Error(`@opentelemetry/api: Registration of version v${s.version} for ${t} does not match previously registered API v${Eo}`);return n.error(i.stack||i.message),!1}return s[t]=e,n.debug(`@opentelemetry/api: Registered a global for ${t} v${Eo}.`),!0}function yn(t){var e,n;let r=(e=$u[Fu])===null||e===void 0?void 0:e.version;if(!(!r||!Jv(r)))return(n=$u[Fu])===null||n===void 0?void 0:n[t]}function xr(t,e){e.debug(`@opentelemetry/api: Unregistering a global for ${t} v${Eo}.`);let n=$u[Fu];n&&delete n[t]}var H7,Fu,$u,hi=B(()=>{YT();Zv();H7=Eo.split(".")[0],Fu=Symbol.for(`opentelemetry.js.api.${H7}`),$u=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function ju(t,e,n){let r=yn("diag");if(r)return r[t](e,...n)}var Mp,Qv=B(()=>{hi();Mp=class{constructor(e){this._namespace=e.namespace||"DiagComponentLogger"}debug(...e){return ju("debug",this._namespace,e)}error(...e){return ju("error",this._namespace,e)}info(...e){return ju("info",this._namespace,e)}warn(...e){return ju("warn",this._namespace,e)}verbose(...e){return ju("verbose",this._namespace,e)}}});var lt,Lp=B(()=>{(function(t){t[t.NONE=0]="NONE",t[t.ERROR=30]="ERROR",t[t.WARN=50]="WARN",t[t.INFO=60]="INFO",t[t.DEBUG=70]="DEBUG",t[t.VERBOSE=80]="VERBOSE",t[t.ALL=9999]="ALL"})(lt||(lt={}))});function eI(t,e){t<lt.NONE?t=lt.NONE:t>lt.ALL&&(t=lt.ALL),e=e||{};function n(r,o){let s=e[r];return typeof s=="function"&&t>=o?s.bind(e):function(){}}return{error:n("error",lt.ERROR),warn:n("warn",lt.WARN),info:n("info",lt.INFO),debug:n("debug",lt.DEBUG),verbose:n("verbose",lt.VERBOSE)}}var tI=B(()=>{Lp()});var F7,St,Ai=B(()=>{Qv();tI();Lp();hi();F7="diag",St=class t{static instance(){return this._instance||(this._instance=new t),this._instance}constructor(){function e(o){return function(...s){let i=yn("diag");if(i)return i[o](...s)}}let n=this,r=(o,s={logLevel:lt.INFO})=>{var i,a,c;if(o===n){let d=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((i=d.stack)!==null&&i!==void 0?i:d.message),!1}typeof s=="number"&&(s={logLevel:s});let u=yn("diag"),l=eI((a=s.logLevel)!==null&&a!==void 0?a:lt.INFO,o);if(u&&!s.suppressOverrideMessage){let d=(c=new Error().stack)!==null&&c!==void 0?c:"<failed to generate stacktrace>";u.warn(`Current logger will be overwritten from ${d}`),l.warn(`Current logger will overwrite one already registered from ${d}`)}return Lr("diag",l,n,!0)};n.setLogger=r,n.disable=()=>{xr(F7,n)},n.createComponentLogger=o=>new Mp(o),n.verbose=e("verbose"),n.debug=e("debug"),n.info=e("info"),n.warn=e("warn"),n.error=e("error")}}});var xp,nI=B(()=>{xp=class t{constructor(e){this._entries=e?new Map(e):new Map}getEntry(e){let n=this._entries.get(e);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(e,n){let r=new t(this._entries);return r._entries.set(e,n),r}removeEntry(e){let n=new t(this._entries);return n._entries.delete(e),n}removeEntries(...e){let n=new t(this._entries);for(let r of e)n._entries.delete(r);return n}clear(){return new t}}});var rI,oI=B(()=>{rI=Symbol("BaggageEntryMetadata")});function sI(t={}){return new xp(new Map(Object.entries(t)))}function iI(t){return typeof t!="string"&&($7.error(`Cannot create baggage metadata from unknown type: ${typeof t}`),t=""),{__TYPE__:rI,toString(){return t}}}var $7,KT=B(()=>{Ai();nI();oI();$7=St.instance()});function ir(t){return Symbol.for(t)}var WT,Ma,qu=B(()=>{WT=class t{constructor(e){let n=this;n._currentContext=e?new Map(e):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let s=new t(n._currentContext);return s._currentContext.set(r,o),s},n.deleteValue=r=>{let o=new t(n._currentContext);return o._currentContext.delete(r),o}}},Ma=new WT});var zT,XT,Dp,aI=B(()=>{zT=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],XT={};if(typeof console<"u"){let t=["error","warn","info","debug","trace","log"];for(let e of t)typeof console[e]=="function"&&(XT[e]=console[e])}Dp=class{constructor(){function e(n){return function(...r){let o=XT[n];if(typeof o!="function"&&(o=XT.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<zT.length;n++)this[zT[n].n]=e(zT[n].c)}}});function cI(){return sg}var JT,La,ZT,QT,eg,tg,Yu,ng,rg,og,sg,j7,q7,Y7,K7,W7,z7,X7,ig=B(()=>{JT=class{constructor(){}createGauge(e,n){return q7}createHistogram(e,n){return Y7}createCounter(e,n){return j7}createUpDownCounter(e,n){return K7}createObservableGauge(e,n){return z7}createObservableCounter(e,n){return W7}createObservableUpDownCounter(e,n){return X7}addBatchObservableCallback(e,n){}removeBatchObservableCallback(e){}},La=class{},ZT=class extends La{add(e,n){}},QT=class extends La{add(e,n){}},eg=class extends La{record(e,n){}},tg=class extends La{record(e,n){}},Yu=class{addCallback(e){}removeCallback(e){}},ng=class extends Yu{},rg=class extends Yu{},og=class extends Yu{},sg=new JT,j7=new ZT,q7=new eg,Y7=new tg,K7=new QT,W7=new ng,z7=new rg,X7=new og});var Up,uI=B(()=>{(function(t){t[t.INT=0]="INT",t[t.DOUBLE=1]="DOUBLE"})(Up||(Up={}))});var wp,kp,ag=B(()=>{wp={get(t,e){if(t!=null)return t[e]},keys(t){return t==null?[]:Object.keys(t)}},kp={set(t,e,n){t!=null&&(t[e]=n)}}});var Vp,lI=B(()=>{qu();Vp=class{active(){return Ma}with(e,n,r,...o){return n.call(r,...o)}bind(e,n){return n}enable(){return this}disable(){return this}}});var cg,J7,Dr,Ku=B(()=>{lI();hi();Ai();cg="context",J7=new Vp,Dr=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalContextManager(e){return Lr(cg,e,St.instance())}active(){return this._getContextManager().active()}with(e,n,r,...o){return this._getContextManager().with(e,n,r,...o)}bind(e,n){return this._getContextManager().bind(e,n)}_getContextManager(){return yn(cg)||J7}disable(){this._getContextManager().disable(),xr(cg,St.instance())}}});var kn,ug=B(()=>{(function(t){t[t.NONE=0]="NONE",t[t.SAMPLED=1]="SAMPLED"})(kn||(kn={}))});var Wu,Ri,Bp,Gp=B(()=>{ug();Wu="0000000000000000",Ri="00000000000000000000000000000000",Bp={traceId:Ri,spanId:Wu,traceFlags:kn.NONE}});var Ur,Hp=B(()=>{Gp();Ur=class{constructor(e=Bp){this._spanContext=e}spanContext(){return this._spanContext}setAttribute(e,n){return this}setAttributes(e){return this}addEvent(e,n){return this}addLink(e){return this}addLinks(e){return this}setStatus(e){return this}updateName(e){return this}end(e){}isRecording(){return!1}recordException(e,n){}}});function Fp(t){return t.getValue(lg)||void 0}function dI(){return Fp(Dr.getInstance().active())}function zu(t,e){return t.setValue(lg,e)}function pI(t){return t.deleteValue(lg)}function _I(t,e){return zu(t,new Ur(e))}function $p(t){var e;return(e=Fp(t))===null||e===void 0?void 0:e.spanContext()}var lg,dg=B(()=>{qu();Hp();Ku();lg=ir("OpenTelemetry Context Key SPAN")});function fI(t,e){if(typeof t!="string"||t.length!==e)return!1;let n=0;for(let r=0;r<t.length;r+=4)n+=(jp[t.charCodeAt(r)]|0)+(jp[t.charCodeAt(r+1)]|0)+(jp[t.charCodeAt(r+2)]|0)+(jp[t.charCodeAt(r+3)]|0);return n===e}function pg(t){return fI(t,32)&&t!==Ri}function _g(t){return fI(t,16)&&t!==Wu}function So(t){return pg(t.traceId)&&_g(t.spanId)}function mI(t){return new Ur(t)}var jp,qp=B(()=>{Gp();Hp();jp=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function Z7(t){return t!==null&&typeof t=="object"&&"spanId"in t&&typeof t.spanId=="string"&&"traceId"in t&&typeof t.traceId=="string"&&"traceFlags"in t&&typeof t.traceFlags=="number"}var fg,xa,mg=B(()=>{Ku();dg();Hp();qp();fg=Dr.getInstance(),xa=class{startSpan(e,n,r=fg.active()){if(!!n?.root)return new Ur;let s=r&&$p(r);return Z7(s)&&So(s)?new Ur(s):new Ur}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??fg.active(),u=this.startSpan(e,s,c),l=zu(c,u);return fg.with(l,a,void 0,u)}}});var Q7,Da,Eg=B(()=>{mg();Q7=new xa,Da=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}startSpan(e,n,r){return this._getTracer().startSpan(e,n,r)}startActiveSpan(e,n,r,o){let s=this._getTracer();return Reflect.apply(s.startActiveSpan,s,arguments)}_getTracer(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateTracer(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Q7}}});var Yp,EI=B(()=>{mg();Yp=class{getTracer(e,n,r){return new xa}}});var eee,yi,Sg=B(()=>{Eg();EI();eee=new Yp,yi=class{getTracer(e,n,r){var o;return(o=this.getDelegateTracer(e,n,r))!==null&&o!==void 0?o:new Da(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:eee}setDelegate(e){this._delegate=e}getDelegateTracer(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(e,n,r)}}});var Kp,SI=B(()=>{(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Kp||(Kp={}))});var It,TI=B(()=>{(function(t){t[t.INTERNAL=0]="INTERNAL",t[t.SERVER=1]="SERVER",t[t.CLIENT=2]="CLIENT",t[t.PRODUCER=3]="PRODUCER",t[t.CONSUMER=4]="CONSUMER"})(It||(It={}))});var ve,gI=B(()=>{(function(t){t[t.UNSET=0]="UNSET",t[t.OK=1]="OK",t[t.ERROR=2]="ERROR"})(ve||(ve={}))});function hI(t){return ree.test(t)}function AI(t){return oee.test(t)&&!see.test(t)}var Tg,tee,nee,ree,oee,see,RI=B(()=>{Tg="[_0-9a-z-*/]",tee=`[a-z]${Tg}{0,255}`,nee=`[a-z0-9]${Tg}{0,240}@[a-z]${Tg}{0,13}`,ree=new RegExp(`^(?:${tee}|${nee})$`),oee=/^[ -~]{0,255}[!-~]$/,see=/,|=/});var yI,iee,OI,NI,Wp,CI=B(()=>{RI();yI=32,iee=512,OI=",",NI="=",Wp=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return Array.from(this._internalState.keys()).reduceRight((e,n)=>(e.push(n+NI+this.get(n)),e),[]).join(OI)}_parse(e){e.length>iee||(this._internalState=e.split(OI).reduceRight((n,r)=>{let o=r.trim(),s=o.indexOf(NI);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);hI(i)&&AI(a)&&n.set(i,a)}return n},new Map),this._internalState.size>yI&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,yI))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}}});function vI(t){return new Wp(t)}var II=B(()=>{CI()});var K,PI=B(()=>{Ku();K=Dr.getInstance()});var On,bI=B(()=>{Ai();On=St.instance()});var gg,MI,LI=B(()=>{ig();gg=class{getMeter(e,n,r){return sg}},MI=new gg});var hg,zp,xI=B(()=>{LI();hi();Ai();hg="metrics",zp=class t{constructor(){}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalMeterProvider(e){return Lr(hg,e,St.instance())}getMeterProvider(){return yn(hg)||MI}getMeter(e,n,r){return this.getMeterProvider().getMeter(e,n,r)}disable(){xr(hg,St.instance())}}});var Ag,DI=B(()=>{xI();Ag=zp.getInstance()});var Xp,UI=B(()=>{Xp=class{inject(e,n){}extract(e,n){return e}fields(){return[]}}});function yg(t){return t.getValue(Rg)||void 0}function wI(){return yg(Dr.getInstance().active())}function kI(t,e){return t.setValue(Rg,e)}function VI(t){return t.deleteValue(Rg)}var Rg,BI=B(()=>{Ku();qu();Rg=ir("OpenTelemetry Baggage Key")});var Og,aee,Jp,GI=B(()=>{hi();UI();ag();BI();KT();Ai();Og="propagation",aee=new Xp,Jp=class t{constructor(){this.createBaggage=sI,this.getBaggage=yg,this.getActiveBaggage=wI,this.setBaggage=kI,this.deleteBaggage=VI}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalPropagator(e){return Lr(Og,e,St.instance())}inject(e,n,r=kp){return this._getGlobalPropagator().inject(e,n,r)}extract(e,n,r=wp){return this._getGlobalPropagator().extract(e,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){xr(Og,St.instance())}_getGlobalPropagator(){return yn(Og)||aee}}});var Xt,HI=B(()=>{GI();Xt=Jp.getInstance()});var Ng,Zp,FI=B(()=>{hi();Sg();qp();dg();Ai();Ng="trace",Zp=class t{constructor(){this._proxyTracerProvider=new yi,this.wrapSpanContext=mI,this.isSpanContextValid=So,this.deleteSpan=pI,this.getSpan=Fp,this.getActiveSpan=dI,this.getSpanContext=$p,this.setSpan=zu,this.setSpanContext=_I}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalTracerProvider(e){let n=Lr(Ng,this._proxyTracerProvider,St.instance());return n&&this._proxyTracerProvider.setDelegate(e),n}getTracerProvider(){return yn(Ng)||this._proxyTracerProvider}getTracer(e,n){return this.getTracerProvider().getTracer(e,n)}disable(){xr(Ng,St.instance()),this._proxyTracerProvider=new yi}}});var ne,$I=B(()=>{FI();ne=Zp.getInstance()});var V={};Kd(V,{DiagConsoleLogger:()=>Dp,DiagLogLevel:()=>lt,INVALID_SPANID:()=>Wu,INVALID_SPAN_CONTEXT:()=>Bp,INVALID_TRACEID:()=>Ri,ProxyTracer:()=>Da,ProxyTracerProvider:()=>yi,ROOT_CONTEXT:()=>Ma,SamplingDecision:()=>Kp,SpanKind:()=>It,SpanStatusCode:()=>ve,TraceFlags:()=>kn,ValueType:()=>Up,baggageEntryMetadataFromString:()=>iI,context:()=>K,createContextKey:()=>ir,createNoopMeter:()=>cI,createTraceState:()=>vI,default:()=>cee,defaultTextMapGetter:()=>wp,defaultTextMapSetter:()=>kp,diag:()=>On,isSpanContextValid:()=>So,isValidSpanId:()=>_g,isValidTraceId:()=>pg,metrics:()=>Ag,propagation:()=>Xt,trace:()=>ne});var cee,L=B(()=>{KT();qu();aI();Lp();ig();uI();ag();Eg();Sg();SI();TI();gI();ug();II();qp();Gp();PI();bI();DI();HI();$I();cee={context:K,diag:On,metrics:Ag,propagation:Xt,trace:ne}});var Xu=m(Zo=>{"use strict";Object.defineProperty(Zo,"__esModule",{value:!0});Zo.isTracingSuppressed=Zo.unsuppressTracing=Zo.suppressTracing=void 0;var uee=(L(),I(V)),Cg=(0,uee.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function lee(t){return t.setValue(Cg,!0)}Zo.suppressTracing=lee;function dee(t){return t.deleteValue(Cg)}Zo.unsuppressTracing=dee;function pee(t){return t.getValue(Cg)===!0}Zo.isTracingSuppressed=pee});var vg=m(wt=>{"use strict";Object.defineProperty(wt,"__esModule",{value:!0});wt.BAGGAGE_MAX_TOTAL_LENGTH=wt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=wt.BAGGAGE_MAX_NAME_VALUE_PAIRS=wt.BAGGAGE_HEADER=wt.BAGGAGE_ITEMS_SEPARATOR=wt.BAGGAGE_PROPERTIES_SEPARATOR=wt.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;wt.BAGGAGE_KEY_PAIR_SEPARATOR="=";wt.BAGGAGE_PROPERTIES_SEPARATOR=";";wt.BAGGAGE_ITEMS_SEPARATOR=",";wt.BAGGAGE_HEADER="baggage";wt.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;wt.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;wt.BAGGAGE_MAX_TOTAL_LENGTH=8192});var Ig=m(wr=>{"use strict";Object.defineProperty(wr,"__esModule",{value:!0});wr.parseKeyPairsIntoRecord=wr.parsePairKeyValue=wr.getKeyPairs=wr.serializeKeyPairs=void 0;var _ee=(L(),I(V)),Oi=vg();function fee(t){return t.reduce((e,n)=>{let r=`${e}${e!==""?Oi.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>Oi.BAGGAGE_MAX_TOTAL_LENGTH?e:r},"")}wr.serializeKeyPairs=fee;function mee(t){return t.getAllEntries().map(([e,n])=>{let r=`${encodeURIComponent(e)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=Oi.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}wr.getKeyPairs=mee;function jI(t){let e=t.split(Oi.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let n=e.shift();if(!n)return;let r=n.indexOf(Oi.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=decodeURIComponent(n.substring(0,r).trim()),s=decodeURIComponent(n.substring(r+1).trim()),i;return e.length>0&&(i=(0,_ee.baggageEntryMetadataFromString)(e.join(Oi.BAGGAGE_PROPERTIES_SEPARATOR))),{key:o,value:s,metadata:i}}wr.parsePairKeyValue=jI;function Eee(t){return typeof t!="string"||t.length===0?{}:t.split(Oi.BAGGAGE_ITEMS_SEPARATOR).map(e=>jI(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,n)=>(e[n.key]=n.value,e),{})}wr.parseKeyPairsIntoRecord=Eee});var qI=m(Qp=>{"use strict";Object.defineProperty(Qp,"__esModule",{value:!0});Qp.W3CBaggagePropagator=void 0;var Pg=(L(),I(V)),See=Xu(),Ni=vg(),bg=Ig(),Mg=class{inject(e,n,r){let o=Pg.propagation.getBaggage(e);if(!o||(0,See.isTracingSuppressed)(e))return;let s=(0,bg.getKeyPairs)(o).filter(a=>a.length<=Ni.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Ni.BAGGAGE_MAX_NAME_VALUE_PAIRS),i=(0,bg.serializeKeyPairs)(s);i.length>0&&r.set(n,Ni.BAGGAGE_HEADER,i)}extract(e,n,r){let o=r.get(n,Ni.BAGGAGE_HEADER),s=Array.isArray(o)?o.join(Ni.BAGGAGE_ITEMS_SEPARATOR):o;if(!s)return e;let i={};return s.length===0||(s.split(Ni.BAGGAGE_ITEMS_SEPARATOR).forEach(c=>{let u=(0,bg.parsePairKeyValue)(c);if(u){let l={value:u.value};u.metadata&&(l.metadata=u.metadata),i[u.key]=l}}),Object.entries(i).length===0)?e:Pg.propagation.setBaggage(e,Pg.propagation.createBaggage(i))}fields(){return[Ni.BAGGAGE_HEADER]}};Qp.W3CBaggagePropagator=Mg});var YI=m(e_=>{"use strict";Object.defineProperty(e_,"__esModule",{value:!0});e_.AnchoredClock=void 0;var Lg=class{constructor(e,n){this._monotonicClock=n,this._epochMillis=e.now(),this._performanceMillis=n.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};e_.AnchoredClock=Lg});var JI=m(Qo=>{"use strict";Object.defineProperty(Qo,"__esModule",{value:!0});Qo.isAttributeValue=Qo.isAttributeKey=Qo.sanitizeAttributes=void 0;var KI=(L(),I(V));function Tee(t){let e={};if(typeof t!="object"||t==null)return e;for(let[n,r]of Object.entries(t)){if(!WI(n)){KI.diag.warn(`Invalid attribute key: ${n}`);continue}if(!zI(r)){KI.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?e[n]=r.slice():e[n]=r}return e}Qo.sanitizeAttributes=Tee;function WI(t){return typeof t=="string"&&t.length>0}Qo.isAttributeKey=WI;function zI(t){return t==null?!0:Array.isArray(t)?gee(t):XI(t)}Qo.isAttributeValue=zI;function gee(t){let e;for(let n of t)if(n!=null){if(!e){if(XI(n)){e=typeof n;continue}return!1}if(typeof n!==e)return!1}return!0}function XI(t){switch(typeof t){case"number":case"boolean":case"string":return!0}return!1}});var xg=m(t_=>{"use strict";Object.defineProperty(t_,"__esModule",{value:!0});t_.loggingErrorHandler=void 0;var hee=(L(),I(V));function Aee(){return t=>{hee.diag.error(Ree(t))}}t_.loggingErrorHandler=Aee;function Ree(t){return typeof t=="string"?t:JSON.stringify(yee(t))}function yee(t){let e={},n=t;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(e[r])return;let o=n[r];o&&(e[r]=String(o))}),n=Object.getPrototypeOf(n);return e}});var Dg=m(Ua=>{"use strict";Object.defineProperty(Ua,"__esModule",{value:!0});Ua.globalErrorHandler=Ua.setGlobalErrorHandler=void 0;var Oee=xg(),ZI=(0,Oee.loggingErrorHandler)();function Nee(t){ZI=t}Ua.setGlobalErrorHandler=Nee;function Cee(t){try{ZI(t)}catch{}}Ua.globalErrorHandler=Cee});var Ug=m(Ju=>{"use strict";Object.defineProperty(Ju,"__esModule",{value:!0});Ju.TracesSamplerValues=void 0;var vee;(function(t){t.AlwaysOff="always_off",t.AlwaysOn="always_on",t.ParentBasedAlwaysOff="parentbased_always_off",t.ParentBasedAlwaysOn="parentbased_always_on",t.ParentBasedTraceIdRatio="parentbased_traceidratio",t.TraceIdRatio="traceidratio"})(vee=Ju.TracesSamplerValues||(Ju.TracesSamplerValues={}))});var wg=m(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.parseEnvironment=Ue.DEFAULT_ENVIRONMENT=Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT=Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var es=(L(),I(V)),Iee=Ug(),Pee=",",bee=["OTEL_SDK_DISABLED"];function Mee(t){return bee.indexOf(t)>-1}var Lee=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function xee(t){return Lee.indexOf(t)>-1}var Dee=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS","OTEL_SEMCONV_STABILITY_OPT_IN"];function Uee(t){return Dee.indexOf(t)>-1}Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;Ue.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:es.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:Ue.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:Ue.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:Ue.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:Ue.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Iee.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative",OTEL_SEMCONV_STABILITY_OPT_IN:[]};function wee(t,e,n){if(typeof n[t]>"u")return;let r=String(n[t]);e[t]=r.toLowerCase()==="true"}function kee(t,e,n,r=-1/0,o=1/0){if(typeof n[t]<"u"){let s=Number(n[t]);isNaN(s)||(s<r?e[t]=r:s>o?e[t]=o:e[t]=s)}}function Vee(t,e,n,r=Pee){let o=n[t];typeof o=="string"&&(e[t]=o.split(r).map(s=>s.trim()))}var Bee={ALL:es.DiagLogLevel.ALL,VERBOSE:es.DiagLogLevel.VERBOSE,DEBUG:es.DiagLogLevel.DEBUG,INFO:es.DiagLogLevel.INFO,WARN:es.DiagLogLevel.WARN,ERROR:es.DiagLogLevel.ERROR,NONE:es.DiagLogLevel.NONE};function Gee(t,e,n){let r=n[t];if(typeof r=="string"){let o=Bee[r.toUpperCase()];o!=null&&(e[t]=o)}}function Hee(t){let e={};for(let n in Ue.DEFAULT_ENVIRONMENT){let r=n;switch(r){case"OTEL_LOG_LEVEL":Gee(r,e,t);break;default:if(Mee(r))wee(r,e,t);else if(xee(r))kee(r,e,t);else if(Uee(r))Vee(r,e,t);else{let o=t[r];typeof o<"u"&&o!==null&&(e[r]=String(o))}}}return e}Ue.parseEnvironment=Hee});var QI=m(wa=>{"use strict";Object.defineProperty(wa,"__esModule",{value:!0});wa.getEnvWithoutDefaults=wa.getEnv=void 0;var kg=wg();function Fee(){let t=(0,kg.parseEnvironment)(process.env);return Object.assign({},kg.DEFAULT_ENVIRONMENT,t)}wa.getEnv=Fee;function $ee(){return(0,kg.parseEnvironment)(process.env)}wa.getEnvWithoutDefaults=$ee});var eP=m(n_=>{"use strict";Object.defineProperty(n_,"__esModule",{value:!0});n_._globalThis=void 0;n_._globalThis=typeof globalThis=="object"?globalThis:global});var Vg=m(r_=>{"use strict";Object.defineProperty(r_,"__esModule",{value:!0});r_.hexToBinary=void 0;function tP(t){return t>=48&&t<=57?t-48:t>=97&&t<=102?t-87:t-55}function jee(t){let e=new Uint8Array(t.length/2),n=0;for(let r=0;r<t.length;r+=2){let o=tP(t.charCodeAt(r)),s=tP(t.charCodeAt(r+1));e[n++]=o<<4|s}return e}r_.hexToBinary=jee});var nP=m(o_=>{"use strict";Object.defineProperty(o_,"__esModule",{value:!0});o_.hexToBase64=void 0;var qee=Vg();function Yee(t){return Buffer.from((0,qee.hexToBinary)(t)).toString("base64")}o_.hexToBase64=Yee});var sP=m(i_=>{"use strict";Object.defineProperty(i_,"__esModule",{value:!0});i_.RandomIdGenerator=void 0;var Kee=8,oP=16,Bg=class{constructor(){this.generateTraceId=rP(oP),this.generateSpanId=rP(Kee)}};i_.RandomIdGenerator=Bg;var s_=Buffer.allocUnsafe(oP);function rP(t){return function(){for(let n=0;n<t/4;n++)s_.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(s_[n]>0);n++)n===t-1&&(s_[t-1]=1);return s_.toString("hex",0,t)}}});var iP=m(a_=>{"use strict";Object.defineProperty(a_,"__esModule",{value:!0});a_.otperformance=void 0;var Wee=require("perf_hooks");a_.otperformance=Wee.performance});var Gg=m(c_=>{"use strict";Object.defineProperty(c_,"__esModule",{value:!0});c_.VERSION=void 0;c_.VERSION="1.30.1"});function ze(t){for(var e={},n=t.length,r=0;r<n;r++){var o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var Hg=B(()=>{});var aP,cP,uP,lP,dP,pP,_P,fP,mP,EP,SP,TP,gP,hP,AP,RP,yP,OP,NP,CP,vP,IP,PP,bP,MP,LP,xP,DP,UP,wP,kP,VP,BP,GP,HP,FP,$P,jP,qP,YP,KP,WP,zP,XP,JP,ZP,QP,eb,tb,nb,rb,ob,sb,ib,ab,cb,ub,lb,db,pb,_b,fb,mb,Eb,Sb,Tb,gb,hb,Ab,Rb,yb,Ob,Nb,Cb,vb,Ib,Pb,bb,Mb,Lb,xb,Db,Ub,wb,kb,Vb,Bb,Gb,Hb,Fb,$b,jb,qb,Yb,Kb,Wb,zb,Xb,Jb,Zb,Qb,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,dM,pM,_M,fM,mM,EM,SM,TM,gM,hM,AM,RM,yM,OM,NM,CM,zee,Xee,Jee,Zee,Qee,ete,tte,nte,rte,ote,ste,ite,ate,cte,ute,lte,dte,pte,_te,fte,mte,Ete,Ste,Tte,gte,hte,Ate,Rte,yte,Ote,Nte,Cte,vte,Ite,Pte,bte,Mte,Lte,xte,Dte,Ute,wte,kte,Vte,Bte,Gte,Hte,Fte,$te,jte,qte,Yte,Kte,Wte,zte,Xte,Jte,Zte,Qte,ene,tne,nne,rne,one,sne,ine,ane,cne,une,lne,dne,pne,_ne,fne,mne,Ene,Sne,Tne,gne,hne,Ane,Rne,yne,One,Nne,Cne,vne,Ine,Pne,bne,Mne,Lne,xne,Dne,Une,wne,kne,Vne,Bne,Gne,Hne,Fne,$ne,jne,qne,Yne,Kne,Wne,zne,Xne,Jne,Zne,Qne,ere,tre,nre,rre,ore,sre,ire,are,cre,ure,lre,dre,pre,_re,fre,mre,vM,IM,PM,bM,MM,LM,xM,DM,UM,wM,kM,VM,BM,GM,HM,FM,$M,jM,qM,YM,KM,WM,zM,XM,JM,ZM,QM,eL,tL,nL,rL,oL,sL,iL,aL,cL,uL,lL,dL,pL,_L,fL,mL,EL,SL,TL,gL,Ere,Sre,Tre,gre,hre,Are,Rre,yre,Ore,Nre,Cre,vre,Ire,Pre,bre,Mre,Lre,xre,Dre,Ure,wre,kre,Vre,Bre,Gre,Hre,Fre,$re,jre,qre,Yre,Kre,Wre,zre,Xre,Jre,Zre,Qre,eoe,toe,noe,roe,ooe,soe,ioe,aoe,coe,uoe,hL,AL,RL,yL,OL,NL,CL,vL,IL,PL,bL,loe,doe,poe,_oe,foe,moe,Eoe,Soe,Toe,goe,hoe,Aoe,ML,LL,xL,DL,UL,Roe,yoe,Ooe,Noe,Coe,voe,wL,kL,VL,Ioe,Poe,boe,Moe,BL,GL,HL,FL,Loe,xoe,Doe,Uoe,woe,$L,jL,qL,YL,KL,WL,zL,koe,Voe,Boe,Goe,Hoe,Foe,$oe,joe,XL,JL,ZL,QL,ex,qoe,Yoe,Koe,Woe,zoe,Xoe,tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,dx,px,_x,fx,mx,Ex,Sx,Tx,gx,hx,Ax,Joe,Zoe,Qoe,ese,tse,nse,rse,ose,sse,ise,ase,cse,use,lse,dse,pse,_se,fse,mse,Ese,Sse,Tse,Rx,yx,Ox,Nx,Cx,gse,hse,Ase,Rse,yse,Ose,vx,Ix,Nse,Cse,vse,Px,bx,Ise,Pse,bse,Mx,Lx,xx,Dx,Ux,wx,kx,Vx,Bx,Gx,Hx,Fx,$x,jx,qx,Yx,Kx,Mse,Lse,xse,Dse,Use,wse,kse,Vse,Bse,Gse,Hse,Fse,$se,jse,qse,Yse,Kse,Wse,Wx,zx,zse,Xse,Jse,Xx=B(()=>{Hg();aP="aws.lambda.invoked_arn",cP="db.system",uP="db.connection_string",lP="db.user",dP="db.jdbc.driver_classname",pP="db.name",_P="db.statement",fP="db.operation",mP="db.mssql.instance_name",EP="db.cassandra.keyspace",SP="db.cassandra.page_size",TP="db.cassandra.consistency_level",gP="db.cassandra.table",hP="db.cassandra.idempotence",AP="db.cassandra.speculative_execution_count",RP="db.cassandra.coordinator.id",yP="db.cassandra.coordinator.dc",OP="db.hbase.namespace",NP="db.redis.database_index",CP="db.mongodb.collection",vP="db.sql.table",IP="exception.type",PP="exception.message",bP="exception.stacktrace",MP="exception.escaped",LP="faas.trigger",xP="faas.execution",DP="faas.document.collection",UP="faas.document.operation",wP="faas.document.time",kP="faas.document.name",VP="faas.time",BP="faas.cron",GP="faas.coldstart",HP="faas.invoked_name",FP="faas.invoked_provider",$P="faas.invoked_region",jP="net.transport",qP="net.peer.ip",YP="net.peer.port",KP="net.peer.name",WP="net.host.ip",zP="net.host.port",XP="net.host.name",JP="net.host.connection.type",ZP="net.host.connection.subtype",QP="net.host.carrier.name",eb="net.host.carrier.mcc",tb="net.host.carrier.mnc",nb="net.host.carrier.icc",rb="peer.service",ob="enduser.id",sb="enduser.role",ib="enduser.scope",ab="thread.id",cb="thread.name",ub="code.function",lb="code.namespace",db="code.filepath",pb="code.lineno",_b="http.method",fb="http.url",mb="http.target",Eb="http.host",Sb="http.scheme",Tb="http.status_code",gb="http.flavor",hb="http.user_agent",Ab="http.request_content_length",Rb="http.request_content_length_uncompressed",yb="http.response_content_length",Ob="http.response_content_length_uncompressed",Nb="http.server_name",Cb="http.route",vb="http.client_ip",Ib="aws.dynamodb.table_names",Pb="aws.dynamodb.consumed_capacity",bb="aws.dynamodb.item_collection_metrics",Mb="aws.dynamodb.provisioned_read_capacity",Lb="aws.dynamodb.provisioned_write_capacity",xb="aws.dynamodb.consistent_read",Db="aws.dynamodb.projection",Ub="aws.dynamodb.limit",wb="aws.dynamodb.attributes_to_get",kb="aws.dynamodb.index_name",Vb="aws.dynamodb.select",Bb="aws.dynamodb.global_secondary_indexes",Gb="aws.dynamodb.local_secondary_indexes",Hb="aws.dynamodb.exclusive_start_table",Fb="aws.dynamodb.table_count",$b="aws.dynamodb.scan_forward",jb="aws.dynamodb.segment",qb="aws.dynamodb.total_segments",Yb="aws.dynamodb.count",Kb="aws.dynamodb.scanned_count",Wb="aws.dynamodb.attribute_definitions",zb="aws.dynamodb.global_secondary_index_updates",Xb="messaging.system",Jb="messaging.destination",Zb="messaging.destination_kind",Qb="messaging.temp_destination",eM="messaging.protocol",tM="messaging.protocol_version",nM="messaging.url",rM="messaging.message_id",oM="messaging.conversation_id",sM="messaging.message_payload_size_bytes",iM="messaging.message_payload_compressed_size_bytes",aM="messaging.operation",cM="messaging.consumer_id",uM="messaging.rabbitmq.routing_key",lM="messaging.kafka.message_key",dM="messaging.kafka.consumer_group",pM="messaging.kafka.client_id",_M="messaging.kafka.partition",fM="messaging.kafka.tombstone",mM="rpc.system",EM="rpc.service",SM="rpc.method",TM="rpc.grpc.status_code",gM="rpc.jsonrpc.version",hM="rpc.jsonrpc.request_id",AM="rpc.jsonrpc.error_code",RM="rpc.jsonrpc.error_message",yM="message.type",OM="message.id",NM="message.compressed_size",CM="message.uncompressed_size",zee=aP,Xee=cP,Jee=uP,Zee=lP,Qee=dP,ete=pP,tte=_P,nte=fP,rte=mP,ote=EP,ste=SP,ite=TP,ate=gP,cte=hP,ute=AP,lte=RP,dte=yP,pte=OP,_te=NP,fte=CP,mte=vP,Ete=IP,Ste=PP,Tte=bP,gte=MP,hte=LP,Ate=xP,Rte=DP,yte=UP,Ote=wP,Nte=kP,Cte=VP,vte=BP,Ite=GP,Pte=HP,bte=FP,Mte=$P,Lte=jP,xte=qP,Dte=YP,Ute=KP,wte=WP,kte=zP,Vte=XP,Bte=JP,Gte=ZP,Hte=QP,Fte=eb,$te=tb,jte=nb,qte=rb,Yte=ob,Kte=sb,Wte=ib,zte=ab,Xte=cb,Jte=ub,Zte=lb,Qte=db,ene=pb,tne=_b,nne=fb,rne=mb,one=Eb,sne=Sb,ine=Tb,ane=gb,cne=hb,une=Ab,lne=Rb,dne=yb,pne=Ob,_ne=Nb,fne=Cb,mne=vb,Ene=Ib,Sne=Pb,Tne=bb,gne=Mb,hne=Lb,Ane=xb,Rne=Db,yne=Ub,One=wb,Nne=kb,Cne=Vb,vne=Bb,Ine=Gb,Pne=Hb,bne=Fb,Mne=$b,Lne=jb,xne=qb,Dne=Yb,Une=Kb,wne=Wb,kne=zb,Vne=Xb,Bne=Jb,Gne=Zb,Hne=Qb,Fne=eM,$ne=tM,jne=nM,qne=rM,Yne=oM,Kne=sM,Wne=iM,zne=aM,Xne=cM,Jne=uM,Zne=lM,Qne=dM,ere=pM,tre=_M,nre=fM,rre=mM,ore=EM,sre=SM,ire=TM,are=gM,cre=hM,ure=AM,lre=RM,dre=yM,pre=OM,_re=NM,fre=CM,mre=ze([aP,cP,uP,lP,dP,pP,_P,fP,mP,EP,SP,TP,gP,hP,AP,RP,yP,OP,NP,CP,vP,IP,PP,bP,MP,LP,xP,DP,UP,wP,kP,VP,BP,GP,HP,FP,$P,jP,qP,YP,KP,WP,zP,XP,JP,ZP,QP,eb,tb,nb,rb,ob,sb,ib,ab,cb,ub,lb,db,pb,_b,fb,mb,Eb,Sb,Tb,gb,hb,Ab,Rb,yb,Ob,Nb,Cb,vb,Ib,Pb,bb,Mb,Lb,xb,Db,Ub,wb,kb,Vb,Bb,Gb,Hb,Fb,$b,jb,qb,Yb,Kb,Wb,zb,Xb,Jb,Zb,Qb,eM,tM,nM,rM,oM,sM,iM,aM,cM,uM,lM,dM,pM,_M,fM,mM,EM,SM,TM,gM,hM,AM,RM,yM,OM,NM,CM]),vM="other_sql",IM="mssql",PM="mysql",bM="oracle",MM="db2",LM="postgresql",xM="redshift",DM="hive",UM="cloudscape",wM="hsqldb",kM="progress",VM="maxdb",BM="hanadb",GM="ingres",HM="firstsql",FM="edb",$M="cache",jM="adabas",qM="firebird",YM="derby",KM="filemaker",WM="informix",zM="instantdb",XM="interbase",JM="mariadb",ZM="netezza",QM="pervasive",eL="pointbase",tL="sqlite",nL="sybase",rL="teradata",oL="vertica",sL="h2",iL="coldfusion",aL="cassandra",cL="hbase",uL="mongodb",lL="redis",dL="couchbase",pL="couchdb",_L="cosmosdb",fL="dynamodb",mL="neo4j",EL="geode",SL="elasticsearch",TL="memcached",gL="cockroachdb",Ere=vM,Sre=IM,Tre=PM,gre=bM,hre=MM,Are=LM,Rre=xM,yre=DM,Ore=UM,Nre=wM,Cre=kM,vre=VM,Ire=BM,Pre=GM,bre=HM,Mre=FM,Lre=$M,xre=jM,Dre=qM,Ure=YM,wre=KM,kre=WM,Vre=zM,Bre=XM,Gre=JM,Hre=ZM,Fre=QM,$re=eL,jre=tL,qre=nL,Yre=rL,Kre=oL,Wre=sL,zre=iL,Xre=aL,Jre=cL,Zre=uL,Qre=lL,eoe=dL,toe=pL,noe=_L,roe=fL,ooe=mL,soe=EL,ioe=SL,aoe=TL,coe=gL,uoe=ze([vM,IM,PM,bM,MM,LM,xM,DM,UM,wM,kM,VM,BM,GM,HM,FM,$M,jM,qM,YM,KM,WM,zM,XM,JM,ZM,QM,eL,tL,nL,rL,oL,sL,iL,aL,cL,uL,lL,dL,pL,_L,fL,mL,EL,SL,TL,gL]),hL="all",AL="each_quorum",RL="quorum",yL="local_quorum",OL="one",NL="two",CL="three",vL="local_one",IL="any",PL="serial",bL="local_serial",loe=hL,doe=AL,poe=RL,_oe=yL,foe=OL,moe=NL,Eoe=CL,Soe=vL,Toe=IL,goe=PL,hoe=bL,Aoe=ze([hL,AL,RL,yL,OL,NL,CL,vL,IL,PL,bL]),ML="datasource",LL="http",xL="pubsub",DL="timer",UL="other",Roe=ML,yoe=LL,Ooe=xL,Noe=DL,Coe=UL,voe=ze([ML,LL,xL,DL,UL]),wL="insert",kL="edit",VL="delete",Ioe=wL,Poe=kL,boe=VL,Moe=ze([wL,kL,VL]),BL="alibaba_cloud",GL="aws",HL="azure",FL="gcp",Loe=BL,xoe=GL,Doe=HL,Uoe=FL,woe=ze([BL,GL,HL,FL]),$L="ip_tcp",jL="ip_udp",qL="ip",YL="unix",KL="pipe",WL="inproc",zL="other",koe=$L,Voe=jL,Boe=qL,Goe=YL,Hoe=KL,Foe=WL,$oe=zL,joe=ze([$L,jL,qL,YL,KL,WL,zL]),XL="wifi",JL="wired",ZL="cell",QL="unavailable",ex="unknown",qoe=XL,Yoe=JL,Koe=ZL,Woe=QL,zoe=ex,Xoe=ze([XL,JL,ZL,QL,ex]),tx="gprs",nx="edge",rx="umts",ox="cdma",sx="evdo_0",ix="evdo_a",ax="cdma2000_1xrtt",cx="hsdpa",ux="hsupa",lx="hspa",dx="iden",px="evdo_b",_x="lte",fx="ehrpd",mx="hspap",Ex="gsm",Sx="td_scdma",Tx="iwlan",gx="nr",hx="nrnsa",Ax="lte_ca",Joe=tx,Zoe=nx,Qoe=rx,ese=ox,tse=sx,nse=ix,rse=ax,ose=cx,sse=ux,ise=lx,ase=dx,cse=px,use=_x,lse=fx,dse=mx,pse=Ex,_se=Sx,fse=Tx,mse=gx,Ese=hx,Sse=Ax,Tse=ze([tx,nx,rx,ox,sx,ix,ax,cx,ux,lx,dx,px,_x,fx,mx,Ex,Sx,Tx,gx,hx,Ax]),Rx="1.0",yx="1.1",Ox="2.0",Nx="SPDY",Cx="QUIC",gse=Rx,hse=yx,Ase=Ox,Rse=Nx,yse=Cx,Ose={HTTP_1_0:Rx,HTTP_1_1:yx,HTTP_2_0:Ox,SPDY:Nx,QUIC:Cx},vx="queue",Ix="topic",Nse=vx,Cse=Ix,vse=ze([vx,Ix]),Px="receive",bx="process",Ise=Px,Pse=bx,bse=ze([Px,bx]),Mx=0,Lx=1,xx=2,Dx=3,Ux=4,wx=5,kx=6,Vx=7,Bx=8,Gx=9,Hx=10,Fx=11,$x=12,jx=13,qx=14,Yx=15,Kx=16,Mse=Mx,Lse=Lx,xse=xx,Dse=Dx,Use=Ux,wse=wx,kse=kx,Vse=Vx,Bse=Bx,Gse=Gx,Hse=Hx,Fse=Fx,$se=$x,jse=jx,qse=qx,Yse=Yx,Kse=Kx,Wse={OK:Mx,CANCELLED:Lx,UNKNOWN:xx,INVALID_ARGUMENT:Dx,DEADLINE_EXCEEDED:Ux,NOT_FOUND:wx,ALREADY_EXISTS:kx,PERMISSION_DENIED:Vx,RESOURCE_EXHAUSTED:Bx,FAILED_PRECONDITION:Gx,ABORTED:Hx,OUT_OF_RANGE:Fx,UNIMPLEMENTED:$x,INTERNAL:jx,UNAVAILABLE:qx,DATA_LOSS:Yx,UNAUTHENTICATED:Kx},Wx="SENT",zx="RECEIVED",zse=Wx,Xse=zx,Jse=ze([Wx,zx])});var Jx=B(()=>{Xx()});var Zx,Qx,e0,t0,n0,r0,o0,s0,i0,a0,c0,u0,l0,d0,p0,_0,f0,m0,E0,S0,T0,g0,h0,A0,R0,y0,O0,N0,C0,v0,I0,P0,b0,M0,L0,x0,D0,U0,w0,k0,V0,B0,G0,H0,F0,$0,j0,q0,Y0,K0,W0,z0,X0,J0,Z0,Q0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,dD,pD,_D,fD,mD,ED,SD,TD,gD,hD,AD,RD,yD,OD,Zse,Qse,eie,tie,nie,rie,oie,sie,iie,aie,cie,uie,lie,die,pie,_ie,fie,mie,Eie,Sie,Tie,gie,hie,Aie,Rie,yie,Oie,Nie,Cie,vie,Iie,Pie,bie,Mie,Lie,xie,Die,Uie,wie,kie,Vie,Bie,Gie,Hie,Fie,$ie,jie,qie,Yie,Kie,Wie,zie,Xie,Jie,Zie,Qie,eae,tae,nae,rae,oae,sae,iae,aae,cae,uae,lae,dae,pae,_ae,fae,mae,Eae,Sae,Tae,gae,hae,Aae,Rae,yae,Oae,Nae,ND,CD,vD,ID,Cae,vae,Iae,Pae,bae,PD,bD,MD,LD,xD,DD,UD,wD,kD,VD,BD,GD,HD,FD,$D,jD,qD,Mae,Lae,xae,Dae,Uae,wae,kae,Vae,Bae,Gae,Hae,Fae,$ae,jae,qae,Yae,Kae,Wae,YD,KD,zae,Xae,Jae,WD,zD,XD,JD,ZD,QD,eU,Zae,Qae,ece,tce,nce,rce,oce,sce,tU,nU,rU,oU,sU,iU,aU,cU,uU,lU,dU,ice,ace,cce,uce,lce,dce,pce,_ce,fce,mce,Ece,Sce,pU,_U,fU,mU,EU,SU,TU,gU,hU,AU,Tce,gce,hce,Ace,Rce,yce,Oce,Nce,Cce,vce,Ice,RU=B(()=>{Hg();Zx="cloud.provider",Qx="cloud.account.id",e0="cloud.region",t0="cloud.availability_zone",n0="cloud.platform",r0="aws.ecs.container.arn",o0="aws.ecs.cluster.arn",s0="aws.ecs.launchtype",i0="aws.ecs.task.arn",a0="aws.ecs.task.family",c0="aws.ecs.task.revision",u0="aws.eks.cluster.arn",l0="aws.log.group.names",d0="aws.log.group.arns",p0="aws.log.stream.names",_0="aws.log.stream.arns",f0="container.name",m0="container.id",E0="container.runtime",S0="container.image.name",T0="container.image.tag",g0="deployment.environment",h0="device.id",A0="device.model.identifier",R0="device.model.name",y0="faas.name",O0="faas.id",N0="faas.version",C0="faas.instance",v0="faas.max_memory",I0="host.id",P0="host.name",b0="host.type",M0="host.arch",L0="host.image.name",x0="host.image.id",D0="host.image.version",U0="k8s.cluster.name",w0="k8s.node.name",k0="k8s.node.uid",V0="k8s.namespace.name",B0="k8s.pod.uid",G0="k8s.pod.name",H0="k8s.container.name",F0="k8s.replicaset.uid",$0="k8s.replicaset.name",j0="k8s.deployment.uid",q0="k8s.deployment.name",Y0="k8s.statefulset.uid",K0="k8s.statefulset.name",W0="k8s.daemonset.uid",z0="k8s.daemonset.name",X0="k8s.job.uid",J0="k8s.job.name",Z0="k8s.cronjob.uid",Q0="k8s.cronjob.name",eD="os.type",tD="os.description",nD="os.name",rD="os.version",oD="process.pid",sD="process.executable.name",iD="process.executable.path",aD="process.command",cD="process.command_line",uD="process.command_args",lD="process.owner",dD="process.runtime.name",pD="process.runtime.version",_D="process.runtime.description",fD="service.name",mD="service.namespace",ED="service.instance.id",SD="service.version",TD="telemetry.sdk.name",gD="telemetry.sdk.language",hD="telemetry.sdk.version",AD="telemetry.auto.version",RD="webengine.name",yD="webengine.version",OD="webengine.description",Zse=Zx,Qse=Qx,eie=e0,tie=t0,nie=n0,rie=r0,oie=o0,sie=s0,iie=i0,aie=a0,cie=c0,uie=u0,lie=l0,die=d0,pie=p0,_ie=_0,fie=f0,mie=m0,Eie=E0,Sie=S0,Tie=T0,gie=g0,hie=h0,Aie=A0,Rie=R0,yie=y0,Oie=O0,Nie=N0,Cie=C0,vie=v0,Iie=I0,Pie=P0,bie=b0,Mie=M0,Lie=L0,xie=x0,Die=D0,Uie=U0,wie=w0,kie=k0,Vie=V0,Bie=B0,Gie=G0,Hie=H0,Fie=F0,$ie=$0,jie=j0,qie=q0,Yie=Y0,Kie=K0,Wie=W0,zie=z0,Xie=X0,Jie=J0,Zie=Z0,Qie=Q0,eae=eD,tae=tD,nae=nD,rae=rD,oae=oD,sae=sD,iae=iD,aae=aD,cae=cD,uae=uD,lae=lD,dae=dD,pae=pD,_ae=_D,fae=fD,mae=mD,Eae=ED,Sae=SD,Tae=TD,gae=gD,hae=hD,Aae=AD,Rae=RD,yae=yD,Oae=OD,Nae=ze([Zx,Qx,e0,t0,n0,r0,o0,s0,i0,a0,c0,u0,l0,d0,p0,_0,f0,m0,E0,S0,T0,g0,h0,A0,R0,y0,O0,N0,C0,v0,I0,P0,b0,M0,L0,x0,D0,U0,w0,k0,V0,B0,G0,H0,F0,$0,j0,q0,Y0,K0,W0,z0,X0,J0,Z0,Q0,eD,tD,nD,rD,oD,sD,iD,aD,cD,uD,lD,dD,pD,_D,fD,mD,ED,SD,TD,gD,hD,AD,RD,yD,OD]),ND="alibaba_cloud",CD="aws",vD="azure",ID="gcp",Cae=ND,vae=CD,Iae=vD,Pae=ID,bae=ze([ND,CD,vD,ID]),PD="alibaba_cloud_ecs",bD="alibaba_cloud_fc",MD="aws_ec2",LD="aws_ecs",xD="aws_eks",DD="aws_lambda",UD="aws_elastic_beanstalk",wD="azure_vm",kD="azure_container_instances",VD="azure_aks",BD="azure_functions",GD="azure_app_service",HD="gcp_compute_engine",FD="gcp_cloud_run",$D="gcp_kubernetes_engine",jD="gcp_cloud_functions",qD="gcp_app_engine",Mae=PD,Lae=bD,xae=MD,Dae=LD,Uae=xD,wae=DD,kae=UD,Vae=wD,Bae=kD,Gae=VD,Hae=BD,Fae=GD,$ae=HD,jae=FD,qae=$D,Yae=jD,Kae=qD,Wae=ze([PD,bD,MD,LD,xD,DD,UD,wD,kD,VD,BD,GD,HD,FD,$D,jD,qD]),YD="ec2",KD="fargate",zae=YD,Xae=KD,Jae=ze([YD,KD]),WD="amd64",zD="arm32",XD="arm64",JD="ia64",ZD="ppc32",QD="ppc64",eU="x86",Zae=WD,Qae=zD,ece=XD,tce=JD,nce=ZD,rce=QD,oce=eU,sce=ze([WD,zD,XD,JD,ZD,QD,eU]),tU="windows",nU="linux",rU="darwin",oU="freebsd",sU="netbsd",iU="openbsd",aU="dragonflybsd",cU="hpux",uU="aix",lU="solaris",dU="z_os",ice=tU,ace=nU,cce=rU,uce=oU,lce=sU,dce=iU,pce=aU,_ce=cU,fce=uU,mce=lU,Ece=dU,Sce=ze([tU,nU,rU,oU,sU,iU,aU,cU,uU,lU,dU]),pU="cpp",_U="dotnet",fU="erlang",mU="go",EU="java",SU="nodejs",TU="php",gU="python",hU="ruby",AU="webjs",Tce=pU,gce=_U,hce=fU,Ace=mU,Rce=EU,yce=SU,Oce=TU,Nce=gU,Cce=hU,vce=AU,Ice=ze([pU,_U,fU,mU,EU,SU,TU,gU,hU,AU])});var yU=B(()=>{RU()});var Pce,bce,Mce,Lce,xce,Dce,Uce,wce,kce,Vce,Bce,Gce,Hce,Fce,$ce,jce,qce,Yce,Kce,Wce,zce,Xce,Jce,Zce,Qce,eue,tue,nue,rue,oue,sue,iue,aue,cue,uue,lue,due,pue,_ue,fue,mue,Eue,Sue,Tue,gue,hue,Aue,Rue,yue,Oue,Nue,Cue,vue,Iue,Pue,bue,Mue,Lue,xue,Due,Uue,wue,kue,Vue,Bue,Gue,Hue,Fue,$ue,jue,que,Yue,Kue,Wue,zue,Xue,Jue,Zue,Que,ele,tle,nle,rle,ole,sle,ile,ale,cle,ule,lle,dle,ple,_le,fle,mle,Ele,Sle,Tle,gle,hle,Ale,Rle,yle,Ole,Nle,Cle,vle,Ile,Ple,ble,OU=B(()=>{Pce="aspnetcore.rate_limiting.result",bce="acquired",Mce="endpoint_limiter",Lce="global_limiter",xce="request_canceled",Dce="telemetry.sdk.language",Uce="cpp",wce="dotnet",kce="erlang",Vce="go",Bce="java",Gce="nodejs",Hce="php",Fce="python",$ce="ruby",jce="rust",qce="swift",Yce="webjs",Kce="telemetry.sdk.name",Wce="telemetry.sdk.version",zce="aspnetcore.diagnostics.handler.type",Xce="aspnetcore.diagnostics.exception.result",Jce="aborted",Zce="handled",Qce="skipped",eue="unhandled",tue="aspnetcore.rate_limiting.policy",nue="aspnetcore.request.is_unhandled",rue="aspnetcore.routing.is_fallback",oue="aspnetcore.routing.match_status",sue="failure",iue="success",aue="client.address",cue="client.port",uue="error.type",lue="_OTHER",due="exception.escaped",pue="exception.message",_ue="exception.stacktrace",fue="exception.type",mue=function(t){return"http.request.header."+t},Eue="http.request.method",Sue="_OTHER",Tue="CONNECT",gue="DELETE",hue="GET",Aue="HEAD",Rue="OPTIONS",yue="PATCH",Oue="POST",Nue="PUT",Cue="TRACE",vue="http.request.method_original",Iue="http.request.resend_count",Pue=function(t){return"http.response.header."+t},bue="http.response.status_code",Mue="http.route",Lue="jvm.gc.action",xue="jvm.gc.name",Due="jvm.memory.pool.name",Uue="jvm.memory.type",wue="heap",kue="non_heap",Vue="jvm.thread.daemon",Bue="jvm.thread.state",Gue="blocked",Hue="new",Fue="runnable",$ue="terminated",jue="timed_waiting",que="waiting",Yue="network.local.address",Kue="network.local.port",Wue="network.peer.address",zue="network.peer.port",Xue="network.protocol.name",Jue="network.protocol.version",Zue="network.transport",Que="pipe",ele="quic",tle="tcp",nle="udp",rle="unix",ole="network.type",sle="ipv4",ile="ipv6",ale="otel.scope.name",cle="otel.scope.version",ule="otel.status_code",lle="ERROR",dle="OK",ple="otel.status_description",_le="server.address",fle="server.port",mle="service.name",Ele="service.version",Sle="signalr.connection.status",Tle="app_shutdown",gle="normal_closure",hle="timeout",Ale="signalr.transport",Rle="long_polling",yle="server_sent_events",Ole="web_sockets",Nle="url.fragment",Cle="url.full",vle="url.path",Ile="url.query",Ple="url.scheme",ble="user_agent.original"});var Mle,Lle,xle,Dle,Ule,wle,kle,Vle,Ble,Gle,Hle,Fle,$le,jle,qle,Yle,Kle,Wle,zle,Xle,Jle,Zle,Qle,ede,tde,nde,rde,ode,sde,ide,ade,NU=B(()=>{Mle="aspnetcore.diagnostics.exceptions",Lle="aspnetcore.rate_limiting.active_request_leases",xle="aspnetcore.rate_limiting.queued_requests",Dle="aspnetcore.rate_limiting.request.time_in_queue",Ule="aspnetcore.rate_limiting.request_lease.duration",wle="aspnetcore.rate_limiting.requests",kle="aspnetcore.routing.match_attempts",Vle="http.client.request.duration",Ble="http.server.request.duration",Gle="jvm.class.count",Hle="jvm.class.loaded",Fle="jvm.class.unloaded",$le="jvm.cpu.count",jle="jvm.cpu.recent_utilization",qle="jvm.cpu.time",Yle="jvm.gc.duration",Kle="jvm.memory.committed",Wle="jvm.memory.limit",zle="jvm.memory.used",Xle="jvm.memory.used_after_last_gc",Jle="jvm.thread.count",Zle="kestrel.active_connections",Qle="kestrel.active_tls_handshakes",ede="kestrel.connection.duration",tde="kestrel.queued_connections",nde="kestrel.queued_requests",rde="kestrel.rejected_connections",ode="kestrel.tls_handshake.duration",sde="kestrel.upgraded_connections",ide="signalr.server.active_connections",ade="signalr.server.connection.duration"});var Vn={};Kd(Vn,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Jce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>Zce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>Qce,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>eue,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>bce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Mce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Lce,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>xce,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>sue,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>iue,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>Xce,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>zce,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>tue,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Pce,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>nue,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>rue,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>oue,ATTR_CLIENT_ADDRESS:()=>aue,ATTR_CLIENT_PORT:()=>cue,ATTR_ERROR_TYPE:()=>uue,ATTR_EXCEPTION_ESCAPED:()=>due,ATTR_EXCEPTION_MESSAGE:()=>pue,ATTR_EXCEPTION_STACKTRACE:()=>_ue,ATTR_EXCEPTION_TYPE:()=>fue,ATTR_HTTP_REQUEST_HEADER:()=>mue,ATTR_HTTP_REQUEST_METHOD:()=>Eue,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>vue,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Iue,ATTR_HTTP_RESPONSE_HEADER:()=>Pue,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>bue,ATTR_HTTP_ROUTE:()=>Mue,ATTR_JVM_GC_ACTION:()=>Lue,ATTR_JVM_GC_NAME:()=>xue,ATTR_JVM_MEMORY_POOL_NAME:()=>Due,ATTR_JVM_MEMORY_TYPE:()=>Uue,ATTR_JVM_THREAD_DAEMON:()=>Vue,ATTR_JVM_THREAD_STATE:()=>Bue,ATTR_NETWORK_LOCAL_ADDRESS:()=>Yue,ATTR_NETWORK_LOCAL_PORT:()=>Kue,ATTR_NETWORK_PEER_ADDRESS:()=>Wue,ATTR_NETWORK_PEER_PORT:()=>zue,ATTR_NETWORK_PROTOCOL_NAME:()=>Xue,ATTR_NETWORK_PROTOCOL_VERSION:()=>Jue,ATTR_NETWORK_TRANSPORT:()=>Zue,ATTR_NETWORK_TYPE:()=>ole,ATTR_OTEL_SCOPE_NAME:()=>ale,ATTR_OTEL_SCOPE_VERSION:()=>cle,ATTR_OTEL_STATUS_CODE:()=>ule,ATTR_OTEL_STATUS_DESCRIPTION:()=>ple,ATTR_SERVER_ADDRESS:()=>_le,ATTR_SERVER_PORT:()=>fle,ATTR_SERVICE_NAME:()=>mle,ATTR_SERVICE_VERSION:()=>Ele,ATTR_SIGNALR_CONNECTION_STATUS:()=>Sle,ATTR_SIGNALR_TRANSPORT:()=>Ale,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Dce,ATTR_TELEMETRY_SDK_NAME:()=>Kce,ATTR_TELEMETRY_SDK_VERSION:()=>Wce,ATTR_URL_FRAGMENT:()=>Nle,ATTR_URL_FULL:()=>Cle,ATTR_URL_PATH:()=>vle,ATTR_URL_QUERY:()=>Ile,ATTR_URL_SCHEME:()=>Ple,ATTR_USER_AGENT_ORIGINAL:()=>ble,AWSECSLAUNCHTYPEVALUES_EC2:()=>zae,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>Xae,AwsEcsLaunchtypeValues:()=>Jae,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Mae,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Lae,CLOUDPLATFORMVALUES_AWS_EC2:()=>xae,CLOUDPLATFORMVALUES_AWS_ECS:()=>Dae,CLOUDPLATFORMVALUES_AWS_EKS:()=>Uae,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>kae,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>wae,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Gae,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Fae,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Bae,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Hae,CLOUDPLATFORMVALUES_AZURE_VM:()=>Vae,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Kae,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Yae,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>jae,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>$ae,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>qae,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Cae,CLOUDPROVIDERVALUES_AWS:()=>vae,CLOUDPROVIDERVALUES_AZURE:()=>Iae,CLOUDPROVIDERVALUES_GCP:()=>Pae,CloudPlatformValues:()=>Wae,CloudProviderValues:()=>bae,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>loe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>Toe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>doe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>Soe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>_oe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>hoe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>foe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>poe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>goe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>Eoe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>moe,DBSYSTEMVALUES_ADABAS:()=>xre,DBSYSTEMVALUES_CACHE:()=>Lre,DBSYSTEMVALUES_CASSANDRA:()=>Xre,DBSYSTEMVALUES_CLOUDSCAPE:()=>Ore,DBSYSTEMVALUES_COCKROACHDB:()=>coe,DBSYSTEMVALUES_COLDFUSION:()=>zre,DBSYSTEMVALUES_COSMOSDB:()=>noe,DBSYSTEMVALUES_COUCHBASE:()=>eoe,DBSYSTEMVALUES_COUCHDB:()=>toe,DBSYSTEMVALUES_DB2:()=>hre,DBSYSTEMVALUES_DERBY:()=>Ure,DBSYSTEMVALUES_DYNAMODB:()=>roe,DBSYSTEMVALUES_EDB:()=>Mre,DBSYSTEMVALUES_ELASTICSEARCH:()=>ioe,DBSYSTEMVALUES_FILEMAKER:()=>wre,DBSYSTEMVALUES_FIREBIRD:()=>Dre,DBSYSTEMVALUES_FIRSTSQL:()=>bre,DBSYSTEMVALUES_GEODE:()=>soe,DBSYSTEMVALUES_H2:()=>Wre,DBSYSTEMVALUES_HANADB:()=>Ire,DBSYSTEMVALUES_HBASE:()=>Jre,DBSYSTEMVALUES_HIVE:()=>yre,DBSYSTEMVALUES_HSQLDB:()=>Nre,DBSYSTEMVALUES_INFORMIX:()=>kre,DBSYSTEMVALUES_INGRES:()=>Pre,DBSYSTEMVALUES_INSTANTDB:()=>Vre,DBSYSTEMVALUES_INTERBASE:()=>Bre,DBSYSTEMVALUES_MARIADB:()=>Gre,DBSYSTEMVALUES_MAXDB:()=>vre,DBSYSTEMVALUES_MEMCACHED:()=>aoe,DBSYSTEMVALUES_MONGODB:()=>Zre,DBSYSTEMVALUES_MSSQL:()=>Sre,DBSYSTEMVALUES_MYSQL:()=>Tre,DBSYSTEMVALUES_NEO4J:()=>ooe,DBSYSTEMVALUES_NETEZZA:()=>Hre,DBSYSTEMVALUES_ORACLE:()=>gre,DBSYSTEMVALUES_OTHER_SQL:()=>Ere,DBSYSTEMVALUES_PERVASIVE:()=>Fre,DBSYSTEMVALUES_POINTBASE:()=>$re,DBSYSTEMVALUES_POSTGRESQL:()=>Are,DBSYSTEMVALUES_PROGRESS:()=>Cre,DBSYSTEMVALUES_REDIS:()=>Qre,DBSYSTEMVALUES_REDSHIFT:()=>Rre,DBSYSTEMVALUES_SQLITE:()=>jre,DBSYSTEMVALUES_SYBASE:()=>qre,DBSYSTEMVALUES_TERADATA:()=>Yre,DBSYSTEMVALUES_VERTICA:()=>Kre,DbCassandraConsistencyLevelValues:()=>Aoe,DbSystemValues:()=>uoe,ERROR_TYPE_VALUE_OTHER:()=>lue,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>boe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>Poe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>Ioe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>Loe,FAASINVOKEDPROVIDERVALUES_AWS:()=>xoe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>Doe,FAASINVOKEDPROVIDERVALUES_GCP:()=>Uoe,FAASTRIGGERVALUES_DATASOURCE:()=>Roe,FAASTRIGGERVALUES_HTTP:()=>yoe,FAASTRIGGERVALUES_OTHER:()=>Coe,FAASTRIGGERVALUES_PUBSUB:()=>Ooe,FAASTRIGGERVALUES_TIMER:()=>Noe,FaasDocumentOperationValues:()=>Moe,FaasInvokedProviderValues:()=>woe,FaasTriggerValues:()=>voe,HOSTARCHVALUES_AMD64:()=>Zae,HOSTARCHVALUES_ARM32:()=>Qae,HOSTARCHVALUES_ARM64:()=>ece,HOSTARCHVALUES_IA64:()=>tce,HOSTARCHVALUES_PPC32:()=>nce,HOSTARCHVALUES_PPC64:()=>rce,HOSTARCHVALUES_X86:()=>oce,HTTPFLAVORVALUES_HTTP_1_0:()=>gse,HTTPFLAVORVALUES_HTTP_1_1:()=>hse,HTTPFLAVORVALUES_HTTP_2_0:()=>Ase,HTTPFLAVORVALUES_QUIC:()=>yse,HTTPFLAVORVALUES_SPDY:()=>Rse,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>Tue,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>gue,HTTP_REQUEST_METHOD_VALUE_GET:()=>hue,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>Aue,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>Rue,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>Sue,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>yue,HTTP_REQUEST_METHOD_VALUE_POST:()=>Oue,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Nue,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>Cue,HostArchValues:()=>sce,HttpFlavorValues:()=>Ose,JVM_MEMORY_TYPE_VALUE_HEAP:()=>wue,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>kue,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Gue,JVM_THREAD_STATE_VALUE_NEW:()=>Hue,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>Fue,JVM_THREAD_STATE_VALUE_TERMINATED:()=>$ue,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>jue,JVM_THREAD_STATE_VALUE_WAITING:()=>que,MESSAGETYPEVALUES_RECEIVED:()=>Xse,MESSAGETYPEVALUES_SENT:()=>zse,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>Nse,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>Cse,MESSAGINGOPERATIONVALUES_PROCESS:()=>Pse,MESSAGINGOPERATIONVALUES_RECEIVE:()=>Ise,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Mle,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Lle,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>xle,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>wle,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Ule,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Dle,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>kle,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Vle,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Ble,METRIC_JVM_CLASS_COUNT:()=>Gle,METRIC_JVM_CLASS_LOADED:()=>Hle,METRIC_JVM_CLASS_UNLOADED:()=>Fle,METRIC_JVM_CPU_COUNT:()=>$le,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>jle,METRIC_JVM_CPU_TIME:()=>qle,METRIC_JVM_GC_DURATION:()=>Yle,METRIC_JVM_MEMORY_COMMITTED:()=>Kle,METRIC_JVM_MEMORY_LIMIT:()=>Wle,METRIC_JVM_MEMORY_USED:()=>zle,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>Xle,METRIC_JVM_THREAD_COUNT:()=>Jle,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>Zle,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>Qle,METRIC_KESTREL_CONNECTION_DURATION:()=>ede,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>tde,METRIC_KESTREL_QUEUED_REQUESTS:()=>nde,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>rde,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>ode,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>sde,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>ide,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>ade,MessageTypeValues:()=>Jse,MessagingDestinationKindValues:()=>vse,MessagingOperationValues:()=>bse,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>ese,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>rse,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>Zoe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>lse,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>tse,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>nse,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>cse,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>Joe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>pse,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>ose,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>ise,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>dse,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>sse,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>ase,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>fse,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>use,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>Sse,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>mse,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>Ese,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>_se,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>Qoe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>Koe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>Woe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>zoe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>qoe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>Yoe,NETTRANSPORTVALUES_INPROC:()=>Foe,NETTRANSPORTVALUES_IP:()=>Boe,NETTRANSPORTVALUES_IP_TCP:()=>koe,NETTRANSPORTVALUES_IP_UDP:()=>Voe,NETTRANSPORTVALUES_OTHER:()=>$oe,NETTRANSPORTVALUES_PIPE:()=>Hoe,NETTRANSPORTVALUES_UNIX:()=>Goe,NETWORK_TRANSPORT_VALUE_PIPE:()=>Que,NETWORK_TRANSPORT_VALUE_QUIC:()=>ele,NETWORK_TRANSPORT_VALUE_TCP:()=>tle,NETWORK_TRANSPORT_VALUE_UDP:()=>nle,NETWORK_TRANSPORT_VALUE_UNIX:()=>rle,NETWORK_TYPE_VALUE_IPV4:()=>sle,NETWORK_TYPE_VALUE_IPV6:()=>ile,NetHostConnectionSubtypeValues:()=>Tse,NetHostConnectionTypeValues:()=>Xoe,NetTransportValues:()=>joe,OSTYPEVALUES_AIX:()=>fce,OSTYPEVALUES_DARWIN:()=>cce,OSTYPEVALUES_DRAGONFLYBSD:()=>pce,OSTYPEVALUES_FREEBSD:()=>uce,OSTYPEVALUES_HPUX:()=>_ce,OSTYPEVALUES_LINUX:()=>ace,OSTYPEVALUES_NETBSD:()=>lce,OSTYPEVALUES_OPENBSD:()=>dce,OSTYPEVALUES_SOLARIS:()=>mce,OSTYPEVALUES_WINDOWS:()=>ice,OSTYPEVALUES_Z_OS:()=>Ece,OTEL_STATUS_CODE_VALUE_ERROR:()=>lle,OTEL_STATUS_CODE_VALUE_OK:()=>dle,OsTypeValues:()=>Sce,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>Hse,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>kse,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>Lse,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>Yse,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>Use,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>Gse,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>jse,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>Dse,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>wse,RPCGRPCSTATUSCODEVALUES_OK:()=>Mse,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>Fse,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>Vse,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>Bse,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>Kse,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>qse,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>$se,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>xse,RpcGrpcStatusCodeValues:()=>Wse,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>One,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>wne,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>Ane,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>Sne,SEMATTRS_AWS_DYNAMODB_COUNT:()=>Dne,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>Pne,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>vne,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>kne,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>Nne,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>Tne,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>yne,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>Ine,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>Rne,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>gne,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>hne,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>Une,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>Mne,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>Lne,SEMATTRS_AWS_DYNAMODB_SELECT:()=>Cne,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>bne,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>Ene,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>xne,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>zee,SEMATTRS_CODE_FILEPATH:()=>Qte,SEMATTRS_CODE_FUNCTION:()=>Jte,SEMATTRS_CODE_LINENO:()=>ene,SEMATTRS_CODE_NAMESPACE:()=>Zte,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>ite,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>dte,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>lte,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>cte,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>ote,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>ste,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>ute,SEMATTRS_DB_CASSANDRA_TABLE:()=>ate,SEMATTRS_DB_CONNECTION_STRING:()=>Jee,SEMATTRS_DB_HBASE_NAMESPACE:()=>pte,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Qee,SEMATTRS_DB_MONGODB_COLLECTION:()=>fte,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>rte,SEMATTRS_DB_NAME:()=>ete,SEMATTRS_DB_OPERATION:()=>nte,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>_te,SEMATTRS_DB_SQL_TABLE:()=>mte,SEMATTRS_DB_STATEMENT:()=>tte,SEMATTRS_DB_SYSTEM:()=>Xee,SEMATTRS_DB_USER:()=>Zee,SEMATTRS_ENDUSER_ID:()=>Yte,SEMATTRS_ENDUSER_ROLE:()=>Kte,SEMATTRS_ENDUSER_SCOPE:()=>Wte,SEMATTRS_EXCEPTION_ESCAPED:()=>gte,SEMATTRS_EXCEPTION_MESSAGE:()=>Ste,SEMATTRS_EXCEPTION_STACKTRACE:()=>Tte,SEMATTRS_EXCEPTION_TYPE:()=>Ete,SEMATTRS_FAAS_COLDSTART:()=>Ite,SEMATTRS_FAAS_CRON:()=>vte,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>Rte,SEMATTRS_FAAS_DOCUMENT_NAME:()=>Nte,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>yte,SEMATTRS_FAAS_DOCUMENT_TIME:()=>Ote,SEMATTRS_FAAS_EXECUTION:()=>Ate,SEMATTRS_FAAS_INVOKED_NAME:()=>Pte,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>bte,SEMATTRS_FAAS_INVOKED_REGION:()=>Mte,SEMATTRS_FAAS_TIME:()=>Cte,SEMATTRS_FAAS_TRIGGER:()=>hte,SEMATTRS_HTTP_CLIENT_IP:()=>mne,SEMATTRS_HTTP_FLAVOR:()=>ane,SEMATTRS_HTTP_HOST:()=>one,SEMATTRS_HTTP_METHOD:()=>tne,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>une,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>lne,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>dne,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>pne,SEMATTRS_HTTP_ROUTE:()=>fne,SEMATTRS_HTTP_SCHEME:()=>sne,SEMATTRS_HTTP_SERVER_NAME:()=>_ne,SEMATTRS_HTTP_STATUS_CODE:()=>ine,SEMATTRS_HTTP_TARGET:()=>rne,SEMATTRS_HTTP_URL:()=>nne,SEMATTRS_HTTP_USER_AGENT:()=>cne,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>_re,SEMATTRS_MESSAGE_ID:()=>pre,SEMATTRS_MESSAGE_TYPE:()=>dre,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>fre,SEMATTRS_MESSAGING_CONSUMER_ID:()=>Xne,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>Yne,SEMATTRS_MESSAGING_DESTINATION:()=>Bne,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>Gne,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>ere,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Qne,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Zne,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>tre,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>nre,SEMATTRS_MESSAGING_MESSAGE_ID:()=>qne,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>Wne,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>Kne,SEMATTRS_MESSAGING_OPERATION:()=>zne,SEMATTRS_MESSAGING_PROTOCOL:()=>Fne,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>$ne,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Jne,SEMATTRS_MESSAGING_SYSTEM:()=>Vne,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>Hne,SEMATTRS_MESSAGING_URL:()=>jne,SEMATTRS_NET_HOST_CARRIER_ICC:()=>jte,SEMATTRS_NET_HOST_CARRIER_MCC:()=>Fte,SEMATTRS_NET_HOST_CARRIER_MNC:()=>$te,SEMATTRS_NET_HOST_CARRIER_NAME:()=>Hte,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>Gte,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>Bte,SEMATTRS_NET_HOST_IP:()=>wte,SEMATTRS_NET_HOST_NAME:()=>Vte,SEMATTRS_NET_HOST_PORT:()=>kte,SEMATTRS_NET_PEER_IP:()=>xte,SEMATTRS_NET_PEER_NAME:()=>Ute,SEMATTRS_NET_PEER_PORT:()=>Dte,SEMATTRS_NET_TRANSPORT:()=>Lte,SEMATTRS_PEER_SERVICE:()=>qte,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>ire,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>ure,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>lre,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>cre,SEMATTRS_RPC_JSONRPC_VERSION:()=>are,SEMATTRS_RPC_METHOD:()=>sre,SEMATTRS_RPC_SERVICE:()=>ore,SEMATTRS_RPC_SYSTEM:()=>rre,SEMATTRS_THREAD_ID:()=>zte,SEMATTRS_THREAD_NAME:()=>Xte,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>oie,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>rie,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>sie,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>iie,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>aie,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>cie,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>uie,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>die,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>lie,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>_ie,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>pie,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>Qse,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>tie,SEMRESATTRS_CLOUD_PLATFORM:()=>nie,SEMRESATTRS_CLOUD_PROVIDER:()=>Zse,SEMRESATTRS_CLOUD_REGION:()=>eie,SEMRESATTRS_CONTAINER_ID:()=>mie,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>Sie,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>Tie,SEMRESATTRS_CONTAINER_NAME:()=>fie,SEMRESATTRS_CONTAINER_RUNTIME:()=>Eie,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>gie,SEMRESATTRS_DEVICE_ID:()=>hie,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>Aie,SEMRESATTRS_DEVICE_MODEL_NAME:()=>Rie,SEMRESATTRS_FAAS_ID:()=>Oie,SEMRESATTRS_FAAS_INSTANCE:()=>Cie,SEMRESATTRS_FAAS_MAX_MEMORY:()=>vie,SEMRESATTRS_FAAS_NAME:()=>yie,SEMRESATTRS_FAAS_VERSION:()=>Nie,SEMRESATTRS_HOST_ARCH:()=>Mie,SEMRESATTRS_HOST_ID:()=>Iie,SEMRESATTRS_HOST_IMAGE_ID:()=>xie,SEMRESATTRS_HOST_IMAGE_NAME:()=>Lie,SEMRESATTRS_HOST_IMAGE_VERSION:()=>Die,SEMRESATTRS_HOST_NAME:()=>Pie,SEMRESATTRS_HOST_TYPE:()=>bie,SEMRESATTRS_K8S_CLUSTER_NAME:()=>Uie,SEMRESATTRS_K8S_CONTAINER_NAME:()=>Hie,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Qie,SEMRESATTRS_K8S_CRONJOB_UID:()=>Zie,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>zie,SEMRESATTRS_K8S_DAEMONSET_UID:()=>Wie,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>qie,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>jie,SEMRESATTRS_K8S_JOB_NAME:()=>Jie,SEMRESATTRS_K8S_JOB_UID:()=>Xie,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>Vie,SEMRESATTRS_K8S_NODE_NAME:()=>wie,SEMRESATTRS_K8S_NODE_UID:()=>kie,SEMRESATTRS_K8S_POD_NAME:()=>Gie,SEMRESATTRS_K8S_POD_UID:()=>Bie,SEMRESATTRS_K8S_REPLICASET_NAME:()=>$ie,SEMRESATTRS_K8S_REPLICASET_UID:()=>Fie,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>Kie,SEMRESATTRS_K8S_STATEFULSET_UID:()=>Yie,SEMRESATTRS_OS_DESCRIPTION:()=>tae,SEMRESATTRS_OS_NAME:()=>nae,SEMRESATTRS_OS_TYPE:()=>eae,SEMRESATTRS_OS_VERSION:()=>rae,SEMRESATTRS_PROCESS_COMMAND:()=>aae,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>uae,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>cae,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>sae,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>iae,SEMRESATTRS_PROCESS_OWNER:()=>lae,SEMRESATTRS_PROCESS_PID:()=>oae,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>_ae,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>dae,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>pae,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Eae,SEMRESATTRS_SERVICE_NAME:()=>fae,SEMRESATTRS_SERVICE_NAMESPACE:()=>mae,SEMRESATTRS_SERVICE_VERSION:()=>Sae,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Aae,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>gae,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Tae,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>hae,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Oae,SEMRESATTRS_WEBENGINE_NAME:()=>Rae,SEMRESATTRS_WEBENGINE_VERSION:()=>yae,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Tle,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>gle,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>hle,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Rle,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>yle,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Ole,SemanticAttributes:()=>mre,SemanticResourceAttributes:()=>Nae,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>Tce,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>gce,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>hce,TELEMETRYSDKLANGUAGEVALUES_GO:()=>Ace,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>Rce,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>yce,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>Oce,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>Nce,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>Cce,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>vce,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>Uce,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>wce,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>kce,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>Vce,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Bce,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Gce,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>Hce,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Fce,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>$ce,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>jce,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>qce,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Yce,TelemetrySdkLanguageValues:()=>Ice});var Bn=B(()=>{Jx();yU();OU();NU()});var CU=m(u_=>{"use strict";Object.defineProperty(u_,"__esModule",{value:!0});u_.SDK_INFO=void 0;var cde=Gg(),Zu=(Bn(),I(Vn));u_.SDK_INFO={[Zu.SEMRESATTRS_TELEMETRY_SDK_NAME]:"opentelemetry",[Zu.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"node",[Zu.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]:Zu.TELEMETRYSDKLANGUAGEVALUES_NODEJS,[Zu.SEMRESATTRS_TELEMETRY_SDK_VERSION]:cde.VERSION}});var vU=m(l_=>{"use strict";Object.defineProperty(l_,"__esModule",{value:!0});l_.unrefTimer=void 0;function ude(t){t.unref()}l_.unrefTimer=ude});var PU=m(Tt=>{"use strict";Object.defineProperty(Tt,"__esModule",{value:!0});Tt.unrefTimer=Tt.SDK_INFO=Tt.otperformance=Tt.RandomIdGenerator=Tt.hexToBase64=Tt._globalThis=Tt.getEnv=Tt.getEnvWithoutDefaults=void 0;var IU=QI();Object.defineProperty(Tt,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return IU.getEnvWithoutDefaults}});Object.defineProperty(Tt,"getEnv",{enumerable:!0,get:function(){return IU.getEnv}});var lde=eP();Object.defineProperty(Tt,"_globalThis",{enumerable:!0,get:function(){return lde._globalThis}});var dde=nP();Object.defineProperty(Tt,"hexToBase64",{enumerable:!0,get:function(){return dde.hexToBase64}});var pde=sP();Object.defineProperty(Tt,"RandomIdGenerator",{enumerable:!0,get:function(){return pde.RandomIdGenerator}});var _de=iP();Object.defineProperty(Tt,"otperformance",{enumerable:!0,get:function(){return _de.otperformance}});var fde=CU();Object.defineProperty(Tt,"SDK_INFO",{enumerable:!0,get:function(){return fde.SDK_INFO}});var mde=vU();Object.defineProperty(Tt,"unrefTimer",{enumerable:!0,get:function(){return mde.unrefTimer}})});var Fg=m(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.unrefTimer=gt.otperformance=gt.hexToBase64=gt.getEnvWithoutDefaults=gt.getEnv=gt._globalThis=gt.SDK_INFO=gt.RandomIdGenerator=void 0;var ts=PU();Object.defineProperty(gt,"RandomIdGenerator",{enumerable:!0,get:function(){return ts.RandomIdGenerator}});Object.defineProperty(gt,"SDK_INFO",{enumerable:!0,get:function(){return ts.SDK_INFO}});Object.defineProperty(gt,"_globalThis",{enumerable:!0,get:function(){return ts._globalThis}});Object.defineProperty(gt,"getEnv",{enumerable:!0,get:function(){return ts.getEnv}});Object.defineProperty(gt,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return ts.getEnvWithoutDefaults}});Object.defineProperty(gt,"hexToBase64",{enumerable:!0,get:function(){return ts.hexToBase64}});Object.defineProperty(gt,"otperformance",{enumerable:!0,get:function(){return ts.otperformance}});Object.defineProperty(gt,"unrefTimer",{enumerable:!0,get:function(){return ts.unrefTimer}})});var xU=m(Ce=>{"use strict";Object.defineProperty(Ce,"__esModule",{value:!0});Ce.addHrTimes=Ce.isTimeInput=Ce.isTimeInputHrTime=Ce.hrTimeToMicroseconds=Ce.hrTimeToMilliseconds=Ce.hrTimeToNanoseconds=Ce.hrTimeToTimeStamp=Ce.hrTimeDuration=Ce.timeInputToHrTime=Ce.hrTime=Ce.getTimeOrigin=Ce.millisToHrTime=void 0;var $g=Fg(),bU=9,Ede=6,Sde=Math.pow(10,Ede),d_=Math.pow(10,bU);function Qu(t){let e=t/1e3,n=Math.trunc(e),r=Math.round(t%1e3*Sde);return[n,r]}Ce.millisToHrTime=Qu;function jg(){let t=$g.otperformance.timeOrigin;if(typeof t!="number"){let e=$g.otperformance;t=e.timing&&e.timing.fetchStart}return t}Ce.getTimeOrigin=jg;function MU(t){let e=Qu(jg()),n=Qu(typeof t=="number"?t:$g.otperformance.now());return LU(e,n)}Ce.hrTime=MU;function Tde(t){if(qg(t))return t;if(typeof t=="number")return t<jg()?MU(t):Qu(t);if(t instanceof Date)return Qu(t.getTime());throw TypeError("Invalid input type")}Ce.timeInputToHrTime=Tde;function gde(t,e){let n=e[0]-t[0],r=e[1]-t[1];return r<0&&(n-=1,r+=d_),[n,r]}Ce.hrTimeDuration=gde;function hde(t){let e=bU,n=`${"0".repeat(e)}${t[1]}Z`,r=n.substring(n.length-e-1);return new Date(t[0]*1e3).toISOString().replace("000Z",r)}Ce.hrTimeToTimeStamp=hde;function Ade(t){return t[0]*d_+t[1]}Ce.hrTimeToNanoseconds=Ade;function Rde(t){return t[0]*1e3+t[1]/1e6}Ce.hrTimeToMilliseconds=Rde;function yde(t){return t[0]*1e6+t[1]/1e3}Ce.hrTimeToMicroseconds=yde;function qg(t){return Array.isArray(t)&&t.length===2&&typeof t[0]=="number"&&typeof t[1]=="number"}Ce.isTimeInputHrTime=qg;function Ode(t){return qg(t)||typeof t=="number"||t instanceof Date}Ce.isTimeInput=Ode;function LU(t,e){let n=[t[0]+e[0],t[1]+e[1]];return n[1]>=d_&&(n[1]-=d_,n[0]+=1),n}Ce.addHrTimes=LU});var DU=m(el=>{"use strict";Object.defineProperty(el,"__esModule",{value:!0});el.ExportResultCode=void 0;var Nde;(function(t){t[t.SUCCESS=0]="SUCCESS",t[t.FAILED=1]="FAILED"})(Nde=el.ExportResultCode||(el.ExportResultCode={}))});var wU=m(p_=>{"use strict";Object.defineProperty(p_,"__esModule",{value:!0});p_.CompositePropagator=void 0;var UU=(L(),I(V)),Yg=class{constructor(e={}){var n;this._propagators=(n=e.propagators)!==null&&n!==void 0?n:[],this._fields=Array.from(new Set(this._propagators.map(r=>typeof r.fields=="function"?r.fields():[]).reduce((r,o)=>r.concat(o),[])))}inject(e,n,r){for(let o of this._propagators)try{o.inject(e,n,r)}catch(s){UU.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${s.message}`)}}extract(e,n,r){return this._propagators.reduce((o,s)=>{try{return s.extract(o,n,r)}catch(i){UU.diag.warn(`Failed to extract with ${s.constructor.name}. Err: ${i.message}`)}return o},e)}fields(){return this._fields.slice()}};p_.CompositePropagator=Yg});var kU=m(ka=>{"use strict";Object.defineProperty(ka,"__esModule",{value:!0});ka.validateValue=ka.validateKey=void 0;var Kg="[_0-9a-z-*/]",Cde=`[a-z]${Kg}{0,255}`,vde=`[a-z0-9]${Kg}{0,240}@[a-z]${Kg}{0,13}`,Ide=new RegExp(`^(?:${Cde}|${vde})$`),Pde=/^[ -~]{0,255}[!-~]$/,bde=/,|=/;function Mde(t){return Ide.test(t)}ka.validateKey=Mde;function Lde(t){return Pde.test(t)&&!bde.test(t)}ka.validateValue=Lde});var zg=m(__=>{"use strict";Object.defineProperty(__,"__esModule",{value:!0});__.TraceState=void 0;var VU=kU(),BU=32,xde=512,GU=",",HU="=",Wg=class t{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,n){let r=this._clone();return r._internalState.has(e)&&r._internalState.delete(e),r._internalState.set(e,n),r}unset(e){let n=this._clone();return n._internalState.delete(e),n}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,n)=>(e.push(n+HU+this.get(n)),e),[]).join(GU)}_parse(e){e.length>xde||(this._internalState=e.split(GU).reverse().reduce((n,r)=>{let o=r.trim(),s=o.indexOf(HU);if(s!==-1){let i=o.slice(0,s),a=o.slice(s+1,r.length);(0,VU.validateKey)(i)&&(0,VU.validateValue)(a)&&n.set(i,a)}return n},new Map),this._internalState.size>BU&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,BU))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new t;return e._internalState=new Map(this._internalState),e}};__.TraceState=Wg});var $U=m(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.W3CTraceContextPropagator=kt.parseTraceParent=kt.TRACE_STATE_HEADER=kt.TRACE_PARENT_HEADER=void 0;var f_=(L(),I(V)),Dde=Xu(),Ude=zg();kt.TRACE_PARENT_HEADER="traceparent";kt.TRACE_STATE_HEADER="tracestate";var wde="00",kde="(?!ff)[\\da-f]{2}",Vde="(?![0]{32})[\\da-f]{32}",Bde="(?![0]{16})[\\da-f]{16}",Gde="[\\da-f]{2}",Hde=new RegExp(`^\\s?(${kde})-(${Vde})-(${Bde})-(${Gde})(-.*)?\\s?$`);function FU(t){let e=Hde.exec(t);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}kt.parseTraceParent=FU;var Xg=class{inject(e,n,r){let o=f_.trace.getSpanContext(e);if(!o||(0,Dde.isTracingSuppressed)(e)||!(0,f_.isSpanContextValid)(o))return;let s=`${wde}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||f_.TraceFlags.NONE).toString(16)}`;r.set(n,kt.TRACE_PARENT_HEADER,s),o.traceState&&r.set(n,kt.TRACE_STATE_HEADER,o.traceState.serialize())}extract(e,n,r){let o=r.get(n,kt.TRACE_PARENT_HEADER);if(!o)return e;let s=Array.isArray(o)?o[0]:o;if(typeof s!="string")return e;let i=FU(s);if(!i)return e;i.isRemote=!0;let a=r.get(n,kt.TRACE_STATE_HEADER);if(a){let c=Array.isArray(a)?a.join(","):a;i.traceState=new Ude.TraceState(typeof c=="string"?c:void 0)}return f_.trace.setSpanContext(e,i)}fields(){return[kt.TRACE_PARENT_HEADER,kt.TRACE_STATE_HEADER]}};kt.W3CTraceContextPropagator=Xg});var jU=m(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.getRPCMetadata=ar.deleteRPCMetadata=ar.setRPCMetadata=ar.RPCType=void 0;var Fde=(L(),I(V)),Jg=(0,Fde.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),$de;(function(t){t.HTTP="http"})($de=ar.RPCType||(ar.RPCType={}));function jde(t,e){return t.setValue(Jg,e)}ar.setRPCMetadata=jde;function qde(t){return t.deleteValue(Jg)}ar.deleteRPCMetadata=qde;function Yde(t){return t.getValue(Jg)}ar.getRPCMetadata=Yde});var Qg=m(m_=>{"use strict";Object.defineProperty(m_,"__esModule",{value:!0});m_.AlwaysOffSampler=void 0;var Kde=(L(),I(V)),Zg=class{shouldSample(){return{decision:Kde.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};m_.AlwaysOffSampler=Zg});var th=m(E_=>{"use strict";Object.defineProperty(E_,"__esModule",{value:!0});E_.AlwaysOnSampler=void 0;var Wde=(L(),I(V)),eh=class{shouldSample(){return{decision:Wde.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};E_.AlwaysOnSampler=eh});var YU=m(T_=>{"use strict";Object.defineProperty(T_,"__esModule",{value:!0});T_.ParentBasedSampler=void 0;var S_=(L(),I(V)),zde=Dg(),qU=Qg(),nh=th(),rh=class{constructor(e){var n,r,o,s;this._root=e.root,this._root||((0,zde.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new nh.AlwaysOnSampler),this._remoteParentSampled=(n=e.remoteParentSampled)!==null&&n!==void 0?n:new nh.AlwaysOnSampler,this._remoteParentNotSampled=(r=e.remoteParentNotSampled)!==null&&r!==void 0?r:new qU.AlwaysOffSampler,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new nh.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new qU.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=S_.trace.getSpanContext(e);return!a||!(0,S_.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&S_.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&S_.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};T_.ParentBasedSampler=rh});var KU=m(g_=>{"use strict";Object.defineProperty(g_,"__esModule",{value:!0});g_.TraceIdRatioBasedSampler=void 0;var oh=(L(),I(V)),sh=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,oh.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?oh.SamplingDecision.RECORD_AND_SAMPLED:oh.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};g_.TraceIdRatioBasedSampler=sh});var ZU=m(h_=>{"use strict";Object.defineProperty(h_,"__esModule",{value:!0});h_.isPlainObject=void 0;var Xde="[object Object]",Jde="[object Null]",Zde="[object Undefined]",Qde=Function.prototype,WU=Qde.toString,epe=WU.call(Object),tpe=npe(Object.getPrototypeOf,Object),zU=Object.prototype,XU=zU.hasOwnProperty,Ci=Symbol?Symbol.toStringTag:void 0,JU=zU.toString;function npe(t,e){return function(n){return t(e(n))}}function rpe(t){if(!ope(t)||spe(t)!==Xde)return!1;let e=tpe(t);if(e===null)return!0;let n=XU.call(e,"constructor")&&e.constructor;return typeof n=="function"&&n instanceof n&&WU.call(n)===epe}h_.isPlainObject=rpe;function ope(t){return t!=null&&typeof t=="object"}function spe(t){return t==null?t===void 0?Zde:Jde:Ci&&Ci in Object(t)?ipe(t):ape(t)}function ipe(t){let e=XU.call(t,Ci),n=t[Ci],r=!1;try{t[Ci]=void 0,r=!0}catch{}let o=JU.call(t);return r&&(e?t[Ci]=n:delete t[Ci]),o}function ape(t){return JU.call(t)}});var rw=m(y_=>{"use strict";Object.defineProperty(y_,"__esModule",{value:!0});y_.merge=void 0;var QU=ZU(),cpe=20;function upe(...t){let e=t.shift(),n=new WeakMap;for(;t.length>0;)e=tw(e,t.shift(),0,n);return e}y_.merge=upe;function ih(t){return R_(t)?t.slice():t}function tw(t,e,n=0,r){let o;if(!(n>cpe)){if(n++,A_(t)||A_(e)||nw(e))o=ih(e);else if(R_(t)){if(o=t.slice(),R_(e))for(let s=0,i=e.length;s<i;s++)o.push(ih(e[s]));else if(tl(e)){let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i];o[c]=ih(e[c])}}}else if(tl(t))if(tl(e)){if(!lpe(t,e))return e;o=Object.assign({},t);let s=Object.keys(e);for(let i=0,a=s.length;i<a;i++){let c=s[i],u=e[c];if(A_(u))typeof u>"u"?delete o[c]:o[c]=u;else{let l=o[c],d=u;if(ew(t,c,r)||ew(e,c,r))delete o[c];else{if(tl(l)&&tl(d)){let p=r.get(l)||[],_=r.get(d)||[];p.push({obj:t,key:c}),_.push({obj:e,key:c}),r.set(l,p),r.set(d,_)}o[c]=tw(o[c],u,n,r)}}}}else o=e;return o}}function ew(t,e,n){let r=n.get(t[e])||[];for(let o=0,s=r.length;o<s;o++){let i=r[o];if(i.key===e&&i.obj===t)return!0}return!1}function R_(t){return Array.isArray(t)}function nw(t){return typeof t=="function"}function tl(t){return!A_(t)&&!R_(t)&&!nw(t)&&typeof t=="object"}function A_(t){return typeof t=="string"||typeof t=="number"||typeof t=="boolean"||typeof t>"u"||t instanceof Date||t instanceof RegExp||t===null}function lpe(t,e){return!(!(0,QU.isPlainObject)(t)||!(0,QU.isPlainObject)(e))}});var ow=m(Va=>{"use strict";Object.defineProperty(Va,"__esModule",{value:!0});Va.callWithTimeout=Va.TimeoutError=void 0;var O_=class t extends Error{constructor(e){super(e),Object.setPrototypeOf(this,t.prototype)}};Va.TimeoutError=O_;function dpe(t,e){let n,r=new Promise(function(s,i){n=setTimeout(function(){i(new O_("Operation timed out."))},e)});return Promise.race([t,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}Va.callWithTimeout=dpe});var iw=m(Ba=>{"use strict";Object.defineProperty(Ba,"__esModule",{value:!0});Ba.isUrlIgnored=Ba.urlMatches=void 0;function sw(t,e){return typeof e=="string"?t===e:!!t.match(e)}Ba.urlMatches=sw;function ppe(t,e){if(!e)return!1;for(let n of e)if(sw(t,n))return!0;return!1}Ba.isUrlIgnored=ppe});var aw=m(N_=>{"use strict";Object.defineProperty(N_,"__esModule",{value:!0});N_.isWrapped=void 0;function _pe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}N_.isWrapped=_pe});var cw=m(C_=>{"use strict";Object.defineProperty(C_,"__esModule",{value:!0});C_.Deferred=void 0;var ah=class{constructor(){this._promise=new Promise((e,n)=>{this._resolve=e,this._reject=n})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};C_.Deferred=ah});var uw=m(v_=>{"use strict";Object.defineProperty(v_,"__esModule",{value:!0});v_.BindOnceFuture=void 0;var fpe=cw(),ch=class{constructor(e,n){this._callback=e,this._that=n,this._isCalled=!1,this._deferred=new fpe.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};v_.BindOnceFuture=ch});var dw=m(I_=>{"use strict";Object.defineProperty(I_,"__esModule",{value:!0});I_._export=void 0;var lw=(L(),I(V)),mpe=Xu();function Epe(t,e){return new Promise(n=>{lw.context.with((0,mpe.suppressTracing)(lw.context.active()),()=>{t.export(e,r=>{n(r)})})})}I_._export=Epe});var fe=m(R=>{"use strict";Object.defineProperty(R,"__esModule",{value:!0});R.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=R.DEFAULT_ATTRIBUTE_COUNT_LIMIT=R.TraceState=R.unsuppressTracing=R.suppressTracing=R.isTracingSuppressed=R.TraceIdRatioBasedSampler=R.ParentBasedSampler=R.AlwaysOnSampler=R.AlwaysOffSampler=R.setRPCMetadata=R.getRPCMetadata=R.deleteRPCMetadata=R.RPCType=R.parseTraceParent=R.W3CTraceContextPropagator=R.TRACE_STATE_HEADER=R.TRACE_PARENT_HEADER=R.CompositePropagator=R.unrefTimer=R.otperformance=R.hexToBase64=R.getEnvWithoutDefaults=R.getEnv=R._globalThis=R.SDK_INFO=R.RandomIdGenerator=R.baggageUtils=R.ExportResultCode=R.hexToBinary=R.timeInputToHrTime=R.millisToHrTime=R.isTimeInputHrTime=R.isTimeInput=R.hrTimeToTimeStamp=R.hrTimeToNanoseconds=R.hrTimeToMilliseconds=R.hrTimeToMicroseconds=R.hrTimeDuration=R.hrTime=R.getTimeOrigin=R.addHrTimes=R.loggingErrorHandler=R.setGlobalErrorHandler=R.globalErrorHandler=R.sanitizeAttributes=R.isAttributeValue=R.isAttributeKey=R.AnchoredClock=R.W3CBaggagePropagator=void 0;R.internal=R.VERSION=R.BindOnceFuture=R.isWrapped=R.urlMatches=R.isUrlIgnored=R.callWithTimeout=R.TimeoutError=R.TracesSamplerValues=R.merge=R.parseEnvironment=R.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=R.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=R.DEFAULT_ENVIRONMENT=void 0;var Spe=qI();Object.defineProperty(R,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Spe.W3CBaggagePropagator}});var Tpe=YI();Object.defineProperty(R,"AnchoredClock",{enumerable:!0,get:function(){return Tpe.AnchoredClock}});var uh=JI();Object.defineProperty(R,"isAttributeKey",{enumerable:!0,get:function(){return uh.isAttributeKey}});Object.defineProperty(R,"isAttributeValue",{enumerable:!0,get:function(){return uh.isAttributeValue}});Object.defineProperty(R,"sanitizeAttributes",{enumerable:!0,get:function(){return uh.sanitizeAttributes}});var pw=Dg();Object.defineProperty(R,"globalErrorHandler",{enumerable:!0,get:function(){return pw.globalErrorHandler}});Object.defineProperty(R,"setGlobalErrorHandler",{enumerable:!0,get:function(){return pw.setGlobalErrorHandler}});var gpe=xg();Object.defineProperty(R,"loggingErrorHandler",{enumerable:!0,get:function(){return gpe.loggingErrorHandler}});var Gn=xU();Object.defineProperty(R,"addHrTimes",{enumerable:!0,get:function(){return Gn.addHrTimes}});Object.defineProperty(R,"getTimeOrigin",{enumerable:!0,get:function(){return Gn.getTimeOrigin}});Object.defineProperty(R,"hrTime",{enumerable:!0,get:function(){return Gn.hrTime}});Object.defineProperty(R,"hrTimeDuration",{enumerable:!0,get:function(){return Gn.hrTimeDuration}});Object.defineProperty(R,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Gn.hrTimeToMicroseconds}});Object.defineProperty(R,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Gn.hrTimeToMilliseconds}});Object.defineProperty(R,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Gn.hrTimeToNanoseconds}});Object.defineProperty(R,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Gn.hrTimeToTimeStamp}});Object.defineProperty(R,"isTimeInput",{enumerable:!0,get:function(){return Gn.isTimeInput}});Object.defineProperty(R,"isTimeInputHrTime",{enumerable:!0,get:function(){return Gn.isTimeInputHrTime}});Object.defineProperty(R,"millisToHrTime",{enumerable:!0,get:function(){return Gn.millisToHrTime}});Object.defineProperty(R,"timeInputToHrTime",{enumerable:!0,get:function(){return Gn.timeInputToHrTime}});var hpe=Vg();Object.defineProperty(R,"hexToBinary",{enumerable:!0,get:function(){return hpe.hexToBinary}});var Ape=DU();Object.defineProperty(R,"ExportResultCode",{enumerable:!0,get:function(){return Ape.ExportResultCode}});var P_=Ig();R.baggageUtils={getKeyPairs:P_.getKeyPairs,serializeKeyPairs:P_.serializeKeyPairs,parseKeyPairsIntoRecord:P_.parseKeyPairsIntoRecord,parsePairKeyValue:P_.parsePairKeyValue};var ns=Fg();Object.defineProperty(R,"RandomIdGenerator",{enumerable:!0,get:function(){return ns.RandomIdGenerator}});Object.defineProperty(R,"SDK_INFO",{enumerable:!0,get:function(){return ns.SDK_INFO}});Object.defineProperty(R,"_globalThis",{enumerable:!0,get:function(){return ns._globalThis}});Object.defineProperty(R,"getEnv",{enumerable:!0,get:function(){return ns.getEnv}});Object.defineProperty(R,"getEnvWithoutDefaults",{enumerable:!0,get:function(){return ns.getEnvWithoutDefaults}});Object.defineProperty(R,"hexToBase64",{enumerable:!0,get:function(){return ns.hexToBase64}});Object.defineProperty(R,"otperformance",{enumerable:!0,get:function(){return ns.otperformance}});Object.defineProperty(R,"unrefTimer",{enumerable:!0,get:function(){return ns.unrefTimer}});var Rpe=wU();Object.defineProperty(R,"CompositePropagator",{enumerable:!0,get:function(){return Rpe.CompositePropagator}});var b_=$U();Object.defineProperty(R,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return b_.TRACE_PARENT_HEADER}});Object.defineProperty(R,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return b_.TRACE_STATE_HEADER}});Object.defineProperty(R,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return b_.W3CTraceContextPropagator}});Object.defineProperty(R,"parseTraceParent",{enumerable:!0,get:function(){return b_.parseTraceParent}});var M_=jU();Object.defineProperty(R,"RPCType",{enumerable:!0,get:function(){return M_.RPCType}});Object.defineProperty(R,"deleteRPCMetadata",{enumerable:!0,get:function(){return M_.deleteRPCMetadata}});Object.defineProperty(R,"getRPCMetadata",{enumerable:!0,get:function(){return M_.getRPCMetadata}});Object.defineProperty(R,"setRPCMetadata",{enumerable:!0,get:function(){return M_.setRPCMetadata}});var ype=Qg();Object.defineProperty(R,"AlwaysOffSampler",{enumerable:!0,get:function(){return ype.AlwaysOffSampler}});var Ope=th();Object.defineProperty(R,"AlwaysOnSampler",{enumerable:!0,get:function(){return Ope.AlwaysOnSampler}});var Npe=YU();Object.defineProperty(R,"ParentBasedSampler",{enumerable:!0,get:function(){return Npe.ParentBasedSampler}});var Cpe=KU();Object.defineProperty(R,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Cpe.TraceIdRatioBasedSampler}});var lh=Xu();Object.defineProperty(R,"isTracingSuppressed",{enumerable:!0,get:function(){return lh.isTracingSuppressed}});Object.defineProperty(R,"suppressTracing",{enumerable:!0,get:function(){return lh.suppressTracing}});Object.defineProperty(R,"unsuppressTracing",{enumerable:!0,get:function(){return lh.unsuppressTracing}});var vpe=zg();Object.defineProperty(R,"TraceState",{enumerable:!0,get:function(){return vpe.TraceState}});var Ga=wg();Object.defineProperty(R,"DEFAULT_ATTRIBUTE_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_ATTRIBUTE_COUNT_LIMIT}});Object.defineProperty(R,"DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}});Object.defineProperty(R,"DEFAULT_ENVIRONMENT",{enumerable:!0,get:function(){return Ga.DEFAULT_ENVIRONMENT}});Object.defineProperty(R,"DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT}});Object.defineProperty(R,"DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT",{enumerable:!0,get:function(){return Ga.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}});Object.defineProperty(R,"parseEnvironment",{enumerable:!0,get:function(){return Ga.parseEnvironment}});var Ipe=rw();Object.defineProperty(R,"merge",{enumerable:!0,get:function(){return Ipe.merge}});var Ppe=Ug();Object.defineProperty(R,"TracesSamplerValues",{enumerable:!0,get:function(){return Ppe.TracesSamplerValues}});var _w=ow();Object.defineProperty(R,"TimeoutError",{enumerable:!0,get:function(){return _w.TimeoutError}});Object.defineProperty(R,"callWithTimeout",{enumerable:!0,get:function(){return _w.callWithTimeout}});var fw=iw();Object.defineProperty(R,"isUrlIgnored",{enumerable:!0,get:function(){return fw.isUrlIgnored}});Object.defineProperty(R,"urlMatches",{enumerable:!0,get:function(){return fw.urlMatches}});var bpe=aw();Object.defineProperty(R,"isWrapped",{enumerable:!0,get:function(){return bpe.isWrapped}});var Mpe=uw();Object.defineProperty(R,"BindOnceFuture",{enumerable:!0,get:function(){return Mpe.BindOnceFuture}});var Lpe=Gg();Object.defineProperty(R,"VERSION",{enumerable:!0,get:function(){return Lpe.VERSION}});var xpe=dw();R.internal={_export:xpe._export}});var nl=m((Jqe,mw)=>{"use strict";var Dpe="2.0.0",Upe=Number.MAX_SAFE_INTEGER||9007199254740991,wpe=16,kpe=250,Vpe=["major","premajor","minor","preminor","patch","prepatch","prerelease"];mw.exports={MAX_LENGTH:256,MAX_SAFE_COMPONENT_LENGTH:wpe,MAX_SAFE_BUILD_LENGTH:kpe,MAX_SAFE_INTEGER:Upe,RELEASE_TYPES:Vpe,SEMVER_SPEC_VERSION:Dpe,FLAG_INCLUDE_PRERELEASE:1,FLAG_LOOSE:2}});var rl=m((Zqe,Ew)=>{"use strict";var Bpe=typeof process=="object"&&process.env&&process.env.NODE_DEBUG&&/\bsemver\b/i.test(process.env.NODE_DEBUG)?(...t)=>console.error("SEMVER",...t):()=>{};Ew.exports=Bpe});var Ha=m((kr,Sw)=>{"use strict";var{MAX_SAFE_COMPONENT_LENGTH:dh,MAX_SAFE_BUILD_LENGTH:Gpe,MAX_LENGTH:Hpe}=nl(),Fpe=rl();kr=Sw.exports={};var $pe=kr.re=[],jpe=kr.safeRe=[],U=kr.src=[],qpe=kr.safeSrc=[],w=kr.t={},Ype=0,ph="[a-zA-Z0-9-]",Kpe=[["\\s",1],["\\d",Hpe],[ph,Gpe]],Wpe=t=>{for(let[e,n]of Kpe)t=t.split(`${e}*`).join(`${e}{0,${n}}`).split(`${e}+`).join(`${e}{1,${n}}`);return t},ee=(t,e,n)=>{let r=Wpe(e),o=Ype++;Fpe(t,o,e),w[t]=o,U[o]=e,qpe[o]=r,$pe[o]=new RegExp(e,n?"g":void 0),jpe[o]=new RegExp(r,n?"g":void 0)};ee("NUMERICIDENTIFIER","0|[1-9]\\d*");ee("NUMERICIDENTIFIERLOOSE","\\d+");ee("NONNUMERICIDENTIFIER",`\\d*[a-zA-Z-]${ph}*`);ee("MAINVERSION",`(${U[w.NUMERICIDENTIFIER]})\\.(${U[w.NUMERICIDENTIFIER]})\\.(${U[w.NUMERICIDENTIFIER]})`);ee("MAINVERSIONLOOSE",`(${U[w.NUMERICIDENTIFIERLOOSE]})\\.(${U[w.NUMERICIDENTIFIERLOOSE]})\\.(${U[w.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASEIDENTIFIER",`(?:${U[w.NONNUMERICIDENTIFIER]}|${U[w.NUMERICIDENTIFIER]})`);ee("PRERELEASEIDENTIFIERLOOSE",`(?:${U[w.NONNUMERICIDENTIFIER]}|${U[w.NUMERICIDENTIFIERLOOSE]})`);ee("PRERELEASE",`(?:-(${U[w.PRERELEASEIDENTIFIER]}(?:\\.${U[w.PRERELEASEIDENTIFIER]})*))`);ee("PRERELEASELOOSE",`(?:-?(${U[w.PRERELEASEIDENTIFIERLOOSE]}(?:\\.${U[w.PRERELEASEIDENTIFIERLOOSE]})*))`);ee("BUILDIDENTIFIER",`${ph}+`);ee("BUILD",`(?:\\+(${U[w.BUILDIDENTIFIER]}(?:\\.${U[w.BUILDIDENTIFIER]})*))`);ee("FULLPLAIN",`v?${U[w.MAINVERSION]}${U[w.PRERELEASE]}?${U[w.BUILD]}?`);ee("FULL",`^${U[w.FULLPLAIN]}$`);ee("LOOSEPLAIN",`[v=\\s]*${U[w.MAINVERSIONLOOSE]}${U[w.PRERELEASELOOSE]}?${U[w.BUILD]}?`);ee("LOOSE",`^${U[w.LOOSEPLAIN]}$`);ee("GTLT","((?:<|>)?=?)");ee("XRANGEIDENTIFIERLOOSE",`${U[w.NUMERICIDENTIFIERLOOSE]}|x|X|\\*`);ee("XRANGEIDENTIFIER",`${U[w.NUMERICIDENTIFIER]}|x|X|\\*`);ee("XRANGEPLAIN",`[v=\\s]*(${U[w.XRANGEIDENTIFIER]})(?:\\.(${U[w.XRANGEIDENTIFIER]})(?:\\.(${U[w.XRANGEIDENTIFIER]})(?:${U[w.PRERELEASE]})?${U[w.BUILD]}?)?)?`);ee("XRANGEPLAINLOOSE",`[v=\\s]*(${U[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[w.XRANGEIDENTIFIERLOOSE]})(?:\\.(${U[w.XRANGEIDENTIFIERLOOSE]})(?:${U[w.PRERELEASELOOSE]})?${U[w.BUILD]}?)?)?`);ee("XRANGE",`^${U[w.GTLT]}\\s*${U[w.XRANGEPLAIN]}$`);ee("XRANGELOOSE",`^${U[w.GTLT]}\\s*${U[w.XRANGEPLAINLOOSE]}$`);ee("COERCEPLAIN",`(^|[^\\d])(\\d{1,${dh}})(?:\\.(\\d{1,${dh}}))?(?:\\.(\\d{1,${dh}}))?`);ee("COERCE",`${U[w.COERCEPLAIN]}(?:$|[^\\d])`);ee("COERCEFULL",U[w.COERCEPLAIN]+`(?:${U[w.PRERELEASE]})?(?:${U[w.BUILD]})?(?:$|[^\\d])`);ee("COERCERTL",U[w.COERCE],!0);ee("COERCERTLFULL",U[w.COERCEFULL],!0);ee("LONETILDE","(?:~>?)");ee("TILDETRIM",`(\\s*)${U[w.LONETILDE]}\\s+`,!0);kr.tildeTrimReplace="$1~";ee("TILDE",`^${U[w.LONETILDE]}${U[w.XRANGEPLAIN]}$`);ee("TILDELOOSE",`^${U[w.LONETILDE]}${U[w.XRANGEPLAINLOOSE]}$`);ee("LONECARET","(?:\\^)");ee("CARETTRIM",`(\\s*)${U[w.LONECARET]}\\s+`,!0);kr.caretTrimReplace="$1^";ee("CARET",`^${U[w.LONECARET]}${U[w.XRANGEPLAIN]}$`);ee("CARETLOOSE",`^${U[w.LONECARET]}${U[w.XRANGEPLAINLOOSE]}$`);ee("COMPARATORLOOSE",`^${U[w.GTLT]}\\s*(${U[w.LOOSEPLAIN]})$|^$`);ee("COMPARATOR",`^${U[w.GTLT]}\\s*(${U[w.FULLPLAIN]})$|^$`);ee("COMPARATORTRIM",`(\\s*)${U[w.GTLT]}\\s*(${U[w.LOOSEPLAIN]}|${U[w.XRANGEPLAIN]})`,!0);kr.comparatorTrimReplace="$1$2$3";ee("HYPHENRANGE",`^\\s*(${U[w.XRANGEPLAIN]})\\s+-\\s+(${U[w.XRANGEPLAIN]})\\s*$`);ee("HYPHENRANGELOOSE",`^\\s*(${U[w.XRANGEPLAINLOOSE]})\\s+-\\s+(${U[w.XRANGEPLAINLOOSE]})\\s*$`);ee("STAR","(<|>)?=?\\s*\\*");ee("GTE0","^\\s*>=\\s*0\\.0\\.0\\s*$");ee("GTE0PRE","^\\s*>=\\s*0\\.0\\.0-0\\s*$")});var L_=m((Qqe,Tw)=>{"use strict";var zpe=Object.freeze({loose:!0}),Xpe=Object.freeze({}),Jpe=t=>t?typeof t!="object"?zpe:t:Xpe;Tw.exports=Jpe});var _h=m((eYe,Aw)=>{"use strict";var gw=/^[0-9]+$/,hw=(t,e)=>{if(typeof t=="number"&&typeof e=="number")return t===e?0:t<e?-1:1;let n=gw.test(t),r=gw.test(e);return n&&r&&(t=+t,e=+e),t===e?0:n&&!r?-1:r&&!n?1:t<e?-1:1},Zpe=(t,e)=>hw(e,t);Aw.exports={compareIdentifiers:hw,rcompareIdentifiers:Zpe}});var Vt=m((tYe,yw)=>{"use strict";var x_=rl(),{MAX_LENGTH:Rw,MAX_SAFE_INTEGER:D_}=nl(),{safeRe:U_,t:w_}=Ha(),Qpe=L_(),{compareIdentifiers:fh}=_h(),mh=class t{constructor(e,n){if(n=Qpe(n),e instanceof t){if(e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease)return e;e=e.version}else if(typeof e!="string")throw new TypeError(`Invalid version. Must be a string. Got type "${typeof e}".`);if(e.length>Rw)throw new TypeError(`version is longer than ${Rw} characters`);x_("SemVer",e,n),this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease;let r=e.trim().match(n.loose?U_[w_.LOOSE]:U_[w_.FULL]);if(!r)throw new TypeError(`Invalid Version: ${e}`);if(this.raw=e,this.major=+r[1],this.minor=+r[2],this.patch=+r[3],this.major>D_||this.major<0)throw new TypeError("Invalid major version");if(this.minor>D_||this.minor<0)throw new TypeError("Invalid minor version");if(this.patch>D_||this.patch<0)throw new TypeError("Invalid patch version");r[4]?this.prerelease=r[4].split(".").map(o=>{if(/^[0-9]+$/.test(o)){let s=+o;if(s>=0&&s<D_)return s}return o}):this.prerelease=[],this.build=r[5]?r[5].split("."):[],this.format()}format(){return this.version=`${this.major}.${this.minor}.${this.patch}`,this.prerelease.length&&(this.version+=`-${this.prerelease.join(".")}`),this.version}toString(){return this.version}compare(e){if(x_("SemVer.compare",this.version,this.options,e),!(e instanceof t)){if(typeof e=="string"&&e===this.version)return 0;e=new t(e,this.options)}return e.version===this.version?0:this.compareMain(e)||this.comparePre(e)}compareMain(e){return e instanceof t||(e=new t(e,this.options)),this.major<e.major?-1:this.major>e.major?1:this.minor<e.minor?-1:this.minor>e.minor?1:this.patch<e.patch?-1:this.patch>e.patch?1:0}comparePre(e){if(e instanceof t||(e=new t(e,this.options)),this.prerelease.length&&!e.prerelease.length)return-1;if(!this.prerelease.length&&e.prerelease.length)return 1;if(!this.prerelease.length&&!e.prerelease.length)return 0;let n=0;do{let r=this.prerelease[n],o=e.prerelease[n];if(x_("prerelease compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return fh(r,o)}while(++n)}compareBuild(e){e instanceof t||(e=new t(e,this.options));let n=0;do{let r=this.build[n],o=e.build[n];if(x_("build compare",n,r,o),r===void 0&&o===void 0)return 0;if(o===void 0)return 1;if(r===void 0)return-1;if(r===o)continue;return fh(r,o)}while(++n)}inc(e,n,r){if(e.startsWith("pre")){if(!n&&r===!1)throw new Error("invalid increment argument: identifier is empty");if(n){let o=`-${n}`.match(this.options.loose?U_[w_.PRERELEASELOOSE]:U_[w_.PRERELEASE]);if(!o||o[1]!==n)throw new Error(`invalid identifier: ${n}`)}}switch(e){case"premajor":this.prerelease.length=0,this.patch=0,this.minor=0,this.major++,this.inc("pre",n,r);break;case"preminor":this.prerelease.length=0,this.patch=0,this.minor++,this.inc("pre",n,r);break;case"prepatch":this.prerelease.length=0,this.inc("patch",n,r),this.inc("pre",n,r);break;case"prerelease":this.prerelease.length===0&&this.inc("patch",n,r),this.inc("pre",n,r);break;case"release":if(this.prerelease.length===0)throw new Error(`version ${this.raw} is not a prerelease`);this.prerelease.length=0;break;case"major":(this.minor!==0||this.patch!==0||this.prerelease.length===0)&&this.major++,this.minor=0,this.patch=0,this.prerelease=[];break;case"minor":(this.patch!==0||this.prerelease.length===0)&&this.minor++,this.patch=0,this.prerelease=[];break;case"patch":this.prerelease.length===0&&this.patch++,this.prerelease=[];break;case"pre":{let o=Number(r)?1:0;if(this.prerelease.length===0)this.prerelease=[o];else{let s=this.prerelease.length;for(;--s>=0;)typeof this.prerelease[s]=="number"&&(this.prerelease[s]++,s=-2);if(s===-1){if(n===this.prerelease.join(".")&&r===!1)throw new Error("invalid increment argument: identifier already exists");this.prerelease.push(o)}}if(n){let s=[n,o];r===!1&&(s=[n]),fh(this.prerelease[0],n)===0?isNaN(this.prerelease[1])&&(this.prerelease=s):this.prerelease=s}break}default:throw new Error(`invalid increment argument: ${e}`)}return this.raw=this.format(),this.build.length&&(this.raw+=`+${this.build.join(".")}`),this}};yw.exports=mh});var vi=m((nYe,Nw)=>{"use strict";var Ow=Vt(),e_e=(t,e,n=!1)=>{if(t instanceof Ow)return t;try{return new Ow(t,e)}catch(r){if(!n)return null;throw r}};Nw.exports=e_e});var vw=m((rYe,Cw)=>{"use strict";var t_e=vi(),n_e=(t,e)=>{let n=t_e(t,e);return n?n.version:null};Cw.exports=n_e});var Pw=m((oYe,Iw)=>{"use strict";var r_e=vi(),o_e=(t,e)=>{let n=r_e(t.trim().replace(/^[=v]+/,""),e);return n?n.version:null};Iw.exports=o_e});var Lw=m((sYe,Mw)=>{"use strict";var bw=Vt(),s_e=(t,e,n,r,o)=>{typeof n=="string"&&(o=r,r=n,n=void 0);try{return new bw(t instanceof bw?t.version:t,n).inc(e,r,o).version}catch{return null}};Mw.exports=s_e});var Uw=m((iYe,Dw)=>{"use strict";var xw=vi(),i_e=(t,e)=>{let n=xw(t,null,!0),r=xw(e,null,!0),o=n.compare(r);if(o===0)return null;let s=o>0,i=s?n:r,a=s?r:n,c=!!i.prerelease.length;if(!!a.prerelease.length&&!c){if(!a.patch&&!a.minor)return"major";if(a.compareMain(i)===0)return a.minor&&!a.patch?"minor":"patch"}let l=c?"pre":"";return n.major!==r.major?l+"major":n.minor!==r.minor?l+"minor":n.patch!==r.patch?l+"patch":"prerelease"};Dw.exports=i_e});var kw=m((aYe,ww)=>{"use strict";var a_e=Vt(),c_e=(t,e)=>new a_e(t,e).major;ww.exports=c_e});var Bw=m((cYe,Vw)=>{"use strict";var u_e=Vt(),l_e=(t,e)=>new u_e(t,e).minor;Vw.exports=l_e});var Hw=m((uYe,Gw)=>{"use strict";var d_e=Vt(),p_e=(t,e)=>new d_e(t,e).patch;Gw.exports=p_e});var $w=m((lYe,Fw)=>{"use strict";var __e=vi(),f_e=(t,e)=>{let n=__e(t,e);return n&&n.prerelease.length?n.prerelease:null};Fw.exports=f_e});var Hn=m((dYe,qw)=>{"use strict";var jw=Vt(),m_e=(t,e,n)=>new jw(t,n).compare(new jw(e,n));qw.exports=m_e});var Kw=m((pYe,Yw)=>{"use strict";var E_e=Hn(),S_e=(t,e,n)=>E_e(e,t,n);Yw.exports=S_e});var zw=m((_Ye,Ww)=>{"use strict";var T_e=Hn(),g_e=(t,e)=>T_e(t,e,!0);Ww.exports=g_e});var k_=m((fYe,Jw)=>{"use strict";var Xw=Vt(),h_e=(t,e,n)=>{let r=new Xw(t,n),o=new Xw(e,n);return r.compare(o)||r.compareBuild(o)};Jw.exports=h_e});var Qw=m((mYe,Zw)=>{"use strict";var A_e=k_(),R_e=(t,e)=>t.sort((n,r)=>A_e(n,r,e));Zw.exports=R_e});var t1=m((EYe,e1)=>{"use strict";var y_e=k_(),O_e=(t,e)=>t.sort((n,r)=>y_e(r,n,e));e1.exports=O_e});var ol=m((SYe,n1)=>{"use strict";var N_e=Hn(),C_e=(t,e,n)=>N_e(t,e,n)>0;n1.exports=C_e});var V_=m((TYe,r1)=>{"use strict";var v_e=Hn(),I_e=(t,e,n)=>v_e(t,e,n)<0;r1.exports=I_e});var Eh=m((gYe,o1)=>{"use strict";var P_e=Hn(),b_e=(t,e,n)=>P_e(t,e,n)===0;o1.exports=b_e});var Sh=m((hYe,s1)=>{"use strict";var M_e=Hn(),L_e=(t,e,n)=>M_e(t,e,n)!==0;s1.exports=L_e});var B_=m((AYe,i1)=>{"use strict";var x_e=Hn(),D_e=(t,e,n)=>x_e(t,e,n)>=0;i1.exports=D_e});var G_=m((RYe,a1)=>{"use strict";var U_e=Hn(),w_e=(t,e,n)=>U_e(t,e,n)<=0;a1.exports=w_e});var Th=m((yYe,c1)=>{"use strict";var k_e=Eh(),V_e=Sh(),B_e=ol(),G_e=B_(),H_e=V_(),F_e=G_(),$_e=(t,e,n,r)=>{switch(e){case"===":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t===n;case"!==":return typeof t=="object"&&(t=t.version),typeof n=="object"&&(n=n.version),t!==n;case"":case"=":case"==":return k_e(t,n,r);case"!=":return V_e(t,n,r);case">":return B_e(t,n,r);case">=":return G_e(t,n,r);case"<":return H_e(t,n,r);case"<=":return F_e(t,n,r);default:throw new TypeError(`Invalid operator: ${e}`)}};c1.exports=$_e});var l1=m((OYe,u1)=>{"use strict";var j_e=Vt(),q_e=vi(),{safeRe:H_,t:F_}=Ha(),Y_e=(t,e)=>{if(t instanceof j_e)return t;if(typeof t=="number"&&(t=String(t)),typeof t!="string")return null;e=e||{};let n=null;if(!e.rtl)n=t.match(e.includePrerelease?H_[F_.COERCEFULL]:H_[F_.COERCE]);else{let c=e.includePrerelease?H_[F_.COERCERTLFULL]:H_[F_.COERCERTL],u;for(;(u=c.exec(t))&&(!n||n.index+n[0].length!==t.length);)(!n||u.index+u[0].length!==n.index+n[0].length)&&(n=u),c.lastIndex=u.index+u[1].length+u[2].length;c.lastIndex=-1}if(n===null)return null;let r=n[2],o=n[3]||"0",s=n[4]||"0",i=e.includePrerelease&&n[5]?`-${n[5]}`:"",a=e.includePrerelease&&n[6]?`+${n[6]}`:"";return q_e(`${r}.${o}.${s}${i}${a}`,e)};u1.exports=Y_e});var p1=m((NYe,d1)=>{"use strict";var gh=class{constructor(){this.max=1e3,this.map=new Map}get(e){let n=this.map.get(e);if(n!==void 0)return this.map.delete(e),this.map.set(e,n),n}delete(e){return this.map.delete(e)}set(e,n){if(!this.delete(e)&&n!==void 0){if(this.map.size>=this.max){let o=this.map.keys().next().value;this.delete(o)}this.map.set(e,n)}return this}};d1.exports=gh});var Fn=m((CYe,E1)=>{"use strict";var K_e=/\s+/g,hh=class t{constructor(e,n){if(n=z_e(n),e instanceof t)return e.loose===!!n.loose&&e.includePrerelease===!!n.includePrerelease?e:new t(e.raw,n);if(e instanceof Ah)return this.raw=e.value,this.set=[[e]],this.formatted=void 0,this;if(this.options=n,this.loose=!!n.loose,this.includePrerelease=!!n.includePrerelease,this.raw=e.trim().replace(K_e," "),this.set=this.raw.split("||").map(r=>this.parseRange(r.trim())).filter(r=>r.length),!this.set.length)throw new TypeError(`Invalid SemVer Range: ${this.raw}`);if(this.set.length>1){let r=this.set[0];if(this.set=this.set.filter(o=>!f1(o[0])),this.set.length===0)this.set=[r];else if(this.set.length>1){for(let o of this.set)if(o.length===1&&nfe(o[0])){this.set=[o];break}}}this.formatted=void 0}get range(){if(this.formatted===void 0){this.formatted="";for(let e=0;e<this.set.length;e++){e>0&&(this.formatted+="||");let n=this.set[e];for(let r=0;r<n.length;r++)r>0&&(this.formatted+=" "),this.formatted+=n[r].toString().trim()}}return this.formatted}format(){return this.range}toString(){return this.range}parseRange(e){let r=((this.options.includePrerelease&&efe)|(this.options.loose&&tfe))+":"+e,o=_1.get(r);if(o)return o;let s=this.options.loose,i=s?Jt[Bt.HYPHENRANGELOOSE]:Jt[Bt.HYPHENRANGE];e=e.replace(i,pfe(this.options.includePrerelease)),Ie("hyphen replace",e),e=e.replace(Jt[Bt.COMPARATORTRIM],J_e),Ie("comparator trim",e),e=e.replace(Jt[Bt.TILDETRIM],Z_e),Ie("tilde trim",e),e=e.replace(Jt[Bt.CARETTRIM],Q_e),Ie("caret trim",e);let a=e.split(" ").map(d=>rfe(d,this.options)).join(" ").split(/\s+/).map(d=>dfe(d,this.options));s&&(a=a.filter(d=>(Ie("loose invalid filter",d,this.options),!!d.match(Jt[Bt.COMPARATORLOOSE])))),Ie("range list",a);let c=new Map,u=a.map(d=>new Ah(d,this.options));for(let d of u){if(f1(d))return[d];c.set(d.value,d)}c.size>1&&c.has("")&&c.delete("");let l=[...c.values()];return _1.set(r,l),l}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Range is required");return this.set.some(r=>m1(r,n)&&e.set.some(o=>m1(o,n)&&r.every(s=>o.every(i=>s.intersects(i,n)))))}test(e){if(!e)return!1;if(typeof e=="string")try{e=new X_e(e,this.options)}catch{return!1}for(let n=0;n<this.set.length;n++)if(_fe(this.set[n],e,this.options))return!0;return!1}};E1.exports=hh;var W_e=p1(),_1=new W_e,z_e=L_(),Ah=sl(),Ie=rl(),X_e=Vt(),{safeRe:Jt,t:Bt,comparatorTrimReplace:J_e,tildeTrimReplace:Z_e,caretTrimReplace:Q_e}=Ha(),{FLAG_INCLUDE_PRERELEASE:efe,FLAG_LOOSE:tfe}=nl(),f1=t=>t.value==="<0.0.0-0",nfe=t=>t.value==="",m1=(t,e)=>{let n=!0,r=t.slice(),o=r.pop();for(;n&&r.length;)n=r.every(s=>o.intersects(s,e)),o=r.pop();return n},rfe=(t,e)=>(t=t.replace(Jt[Bt.BUILD],""),Ie("comp",t,e),t=ife(t,e),Ie("caret",t),t=ofe(t,e),Ie("tildes",t),t=cfe(t,e),Ie("xrange",t),t=lfe(t,e),Ie("stars",t),t),Zt=t=>!t||t.toLowerCase()==="x"||t==="*",ofe=(t,e)=>t.trim().split(/\s+/).map(n=>sfe(n,e)).join(" "),sfe=(t,e)=>{let n=e.loose?Jt[Bt.TILDELOOSE]:Jt[Bt.TILDE];return t.replace(n,(r,o,s,i,a)=>{Ie("tilde",t,r,o,s,i,a);let c;return Zt(o)?c="":Zt(s)?c=`>=${o}.0.0 <${+o+1}.0.0-0`:Zt(i)?c=`>=${o}.${s}.0 <${o}.${+s+1}.0-0`:a?(Ie("replaceTilde pr",a),c=`>=${o}.${s}.${i}-${a} <${o}.${+s+1}.0-0`):c=`>=${o}.${s}.${i} <${o}.${+s+1}.0-0`,Ie("tilde return",c),c})},ife=(t,e)=>t.trim().split(/\s+/).map(n=>afe(n,e)).join(" "),afe=(t,e)=>{Ie("caret",t,e);let n=e.loose?Jt[Bt.CARETLOOSE]:Jt[Bt.CARET],r=e.includePrerelease?"-0":"";return t.replace(n,(o,s,i,a,c)=>{Ie("caret",t,o,s,i,a,c);let u;return Zt(s)?u="":Zt(i)?u=`>=${s}.0.0${r} <${+s+1}.0.0-0`:Zt(a)?s==="0"?u=`>=${s}.${i}.0${r} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.0${r} <${+s+1}.0.0-0`:c?(Ie("replaceCaret pr",c),s==="0"?i==="0"?u=`>=${s}.${i}.${a}-${c} <${s}.${i}.${+a+1}-0`:u=`>=${s}.${i}.${a}-${c} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.${a}-${c} <${+s+1}.0.0-0`):(Ie("no pr"),s==="0"?i==="0"?u=`>=${s}.${i}.${a}${r} <${s}.${i}.${+a+1}-0`:u=`>=${s}.${i}.${a}${r} <${s}.${+i+1}.0-0`:u=`>=${s}.${i}.${a} <${+s+1}.0.0-0`),Ie("caret return",u),u})},cfe=(t,e)=>(Ie("replaceXRanges",t,e),t.split(/\s+/).map(n=>ufe(n,e)).join(" ")),ufe=(t,e)=>{t=t.trim();let n=e.loose?Jt[Bt.XRANGELOOSE]:Jt[Bt.XRANGE];return t.replace(n,(r,o,s,i,a,c)=>{Ie("xRange",t,r,o,s,i,a,c);let u=Zt(s),l=u||Zt(i),d=l||Zt(a),p=d;return o==="="&&p&&(o=""),c=e.includePrerelease?"-0":"",u?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&p?(l&&(i=0),a=0,o===">"?(o=">=",l?(s=+s+1,i=0,a=0):(i=+i+1,a=0)):o==="<="&&(o="<",l?s=+s+1:i=+i+1),o==="<"&&(c="-0"),r=`${o+s}.${i}.${a}${c}`):l?r=`>=${s}.0.0${c} <${+s+1}.0.0-0`:d&&(r=`>=${s}.${i}.0${c} <${s}.${+i+1}.0-0`),Ie("xRange return",r),r})},lfe=(t,e)=>(Ie("replaceStars",t,e),t.trim().replace(Jt[Bt.STAR],"")),dfe=(t,e)=>(Ie("replaceGTE0",t,e),t.trim().replace(Jt[e.includePrerelease?Bt.GTE0PRE:Bt.GTE0],"")),pfe=t=>(e,n,r,o,s,i,a,c,u,l,d,p)=>(Zt(r)?n="":Zt(o)?n=`>=${r}.0.0${t?"-0":""}`:Zt(s)?n=`>=${r}.${o}.0${t?"-0":""}`:i?n=`>=${n}`:n=`>=${n}${t?"-0":""}`,Zt(u)?c="":Zt(l)?c=`<${+u+1}.0.0-0`:Zt(d)?c=`<${u}.${+l+1}.0-0`:p?c=`<=${u}.${l}.${d}-${p}`:t?c=`<${u}.${l}.${+d+1}-0`:c=`<=${c}`,`${n} ${c}`.trim()),_fe=(t,e,n)=>{for(let r=0;r<t.length;r++)if(!t[r].test(e))return!1;if(e.prerelease.length&&!n.includePrerelease){for(let r=0;r<t.length;r++)if(Ie(t[r].semver),t[r].semver!==Ah.ANY&&t[r].semver.prerelease.length>0){let o=t[r].semver;if(o.major===e.major&&o.minor===e.minor&&o.patch===e.patch)return!0}return!1}return!0}});var sl=m((vYe,R1)=>{"use strict";var il=Symbol("SemVer ANY"),Oh=class t{static get ANY(){return il}constructor(e,n){if(n=S1(n),e instanceof t){if(e.loose===!!n.loose)return e;e=e.value}e=e.trim().split(/\s+/).join(" "),yh("comparator",e,n),this.options=n,this.loose=!!n.loose,this.parse(e),this.semver===il?this.value="":this.value=this.operator+this.semver.version,yh("comp",this)}parse(e){let n=this.options.loose?T1[g1.COMPARATORLOOSE]:T1[g1.COMPARATOR],r=e.match(n);if(!r)throw new TypeError(`Invalid comparator: ${e}`);this.operator=r[1]!==void 0?r[1]:"",this.operator==="="&&(this.operator=""),r[2]?this.semver=new h1(r[2],this.options.loose):this.semver=il}toString(){return this.value}test(e){if(yh("Comparator.test",e,this.options.loose),this.semver===il||e===il)return!0;if(typeof e=="string")try{e=new h1(e,this.options)}catch{return!1}return Rh(e,this.operator,this.semver,this.options)}intersects(e,n){if(!(e instanceof t))throw new TypeError("a Comparator is required");return this.operator===""?this.value===""?!0:new A1(e.value,n).test(this.value):e.operator===""?e.value===""?!0:new A1(this.value,n).test(e.semver):(n=S1(n),n.includePrerelease&&(this.value==="<0.0.0-0"||e.value==="<0.0.0-0")||!n.includePrerelease&&(this.value.startsWith("<0.0.0")||e.value.startsWith("<0.0.0"))?!1:!!(this.operator.startsWith(">")&&e.operator.startsWith(">")||this.operator.startsWith("<")&&e.operator.startsWith("<")||this.semver.version===e.semver.version&&this.operator.includes("=")&&e.operator.includes("=")||Rh(this.semver,"<",e.semver,n)&&this.operator.startsWith(">")&&e.operator.startsWith("<")||Rh(this.semver,">",e.semver,n)&&this.operator.startsWith("<")&&e.operator.startsWith(">")))}};R1.exports=Oh;var S1=L_(),{safeRe:T1,t:g1}=Ha(),Rh=Th(),yh=rl(),h1=Vt(),A1=Fn()});var al=m((IYe,y1)=>{"use strict";var ffe=Fn(),mfe=(t,e,n)=>{try{e=new ffe(e,n)}catch{return!1}return e.test(t)};y1.exports=mfe});var N1=m((PYe,O1)=>{"use strict";var Efe=Fn(),Sfe=(t,e)=>new Efe(t,e).set.map(n=>n.map(r=>r.value).join(" ").trim().split(" "));O1.exports=Sfe});var v1=m((bYe,C1)=>{"use strict";var Tfe=Vt(),gfe=Fn(),hfe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new gfe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===-1)&&(r=i,o=new Tfe(r,n))}),r};C1.exports=hfe});var P1=m((MYe,I1)=>{"use strict";var Afe=Vt(),Rfe=Fn(),yfe=(t,e,n)=>{let r=null,o=null,s=null;try{s=new Rfe(e,n)}catch{return null}return t.forEach(i=>{s.test(i)&&(!r||o.compare(i)===1)&&(r=i,o=new Afe(r,n))}),r};I1.exports=yfe});var L1=m((LYe,M1)=>{"use strict";var Nh=Vt(),Ofe=Fn(),b1=ol(),Nfe=(t,e)=>{t=new Ofe(t,e);let n=new Nh("0.0.0");if(t.test(n)||(n=new Nh("0.0.0-0"),t.test(n)))return n;n=null;for(let r=0;r<t.set.length;++r){let o=t.set[r],s=null;o.forEach(i=>{let a=new Nh(i.semver.version);switch(i.operator){case">":a.prerelease.length===0?a.patch++:a.prerelease.push(0),a.raw=a.format();case"":case">=":(!s||b1(a,s))&&(s=a);break;case"<":case"<=":break;default:throw new Error(`Unexpected operation: ${i.operator}`)}}),s&&(!n||b1(n,s))&&(n=s)}return n&&t.test(n)?n:null};M1.exports=Nfe});var D1=m((xYe,x1)=>{"use strict";var Cfe=Fn(),vfe=(t,e)=>{try{return new Cfe(t,e).range||"*"}catch{return null}};x1.exports=vfe});var $_=m((DYe,V1)=>{"use strict";var Ife=Vt(),k1=sl(),{ANY:Pfe}=k1,bfe=Fn(),Mfe=al(),U1=ol(),w1=V_(),Lfe=G_(),xfe=B_(),Dfe=(t,e,n,r)=>{t=new Ife(t,r),e=new bfe(e,r);let o,s,i,a,c;switch(n){case">":o=U1,s=Lfe,i=w1,a=">",c=">=";break;case"<":o=w1,s=xfe,i=U1,a="<",c="<=";break;default:throw new TypeError('Must provide a hilo val of "<" or ">"')}if(Mfe(t,e,r))return!1;for(let u=0;u<e.set.length;++u){let l=e.set[u],d=null,p=null;if(l.forEach(_=>{_.semver===Pfe&&(_=new k1(">=0.0.0")),d=d||_,p=p||_,o(_.semver,d.semver,r)?d=_:i(_.semver,p.semver,r)&&(p=_)}),d.operator===a||d.operator===c||(!p.operator||p.operator===a)&&s(t,p.semver))return!1;if(p.operator===c&&i(t,p.semver))return!1}return!0};V1.exports=Dfe});var G1=m((UYe,B1)=>{"use strict";var Ufe=$_(),wfe=(t,e,n)=>Ufe(t,e,">",n);B1.exports=wfe});var F1=m((wYe,H1)=>{"use strict";var kfe=$_(),Vfe=(t,e,n)=>kfe(t,e,"<",n);H1.exports=Vfe});var q1=m((kYe,j1)=>{"use strict";var $1=Fn(),Bfe=(t,e,n)=>(t=new $1(t,n),e=new $1(e,n),t.intersects(e,n));j1.exports=Bfe});var K1=m((VYe,Y1)=>{"use strict";var Gfe=al(),Hfe=Hn();Y1.exports=(t,e,n)=>{let r=[],o=null,s=null,i=t.sort((l,d)=>Hfe(l,d,n));for(let l of i)Gfe(l,e,n)?(s=l,o||(o=l)):(s&&r.push([o,s]),s=null,o=null);o&&r.push([o,null]);let a=[];for(let[l,d]of r)l===d?a.push(l):!d&&l===i[0]?a.push("*"):d?l===i[0]?a.push(`<=${d}`):a.push(`${l} - ${d}`):a.push(`>=${l}`);let c=a.join(" || "),u=typeof e.raw=="string"?e.raw:String(e);return c.length<u.length?c:e}});var Q1=m((BYe,Z1)=>{"use strict";var W1=Fn(),vh=sl(),{ANY:Ch}=vh,cl=al(),Ih=Hn(),Ffe=(t,e,n={})=>{if(t===e)return!0;t=new W1(t,n),e=new W1(e,n);let r=!1;e:for(let o of t.set){for(let s of e.set){let i=jfe(o,s,n);if(r=r||i!==null,i)continue e}if(r)return!1}return!0},$fe=[new vh(">=0.0.0-0")],z1=[new vh(">=0.0.0")],jfe=(t,e,n)=>{if(t===e)return!0;if(t.length===1&&t[0].semver===Ch){if(e.length===1&&e[0].semver===Ch)return!0;n.includePrerelease?t=$fe:t=z1}if(e.length===1&&e[0].semver===Ch){if(n.includePrerelease)return!0;e=z1}let r=new Set,o,s;for(let _ of t)_.operator===">"||_.operator===">="?o=X1(o,_,n):_.operator==="<"||_.operator==="<="?s=J1(s,_,n):r.add(_.semver);if(r.size>1)return null;let i;if(o&&s){if(i=Ih(o.semver,s.semver,n),i>0)return null;if(i===0&&(o.operator!==">="||s.operator!=="<="))return null}for(let _ of r){if(o&&!cl(_,String(o),n)||s&&!cl(_,String(s),n))return null;for(let f of e)if(!cl(_,String(f),n))return!1;return!0}let a,c,u,l,d=s&&!n.includePrerelease&&s.semver.prerelease.length?s.semver:!1,p=o&&!n.includePrerelease&&o.semver.prerelease.length?o.semver:!1;d&&d.prerelease.length===1&&s.operator==="<"&&d.prerelease[0]===0&&(d=!1);for(let _ of e){if(l=l||_.operator===">"||_.operator===">=",u=u||_.operator==="<"||_.operator==="<=",o){if(p&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===p.major&&_.semver.minor===p.minor&&_.semver.patch===p.patch&&(p=!1),_.operator===">"||_.operator===">="){if(a=X1(o,_,n),a===_&&a!==o)return!1}else if(o.operator===">="&&!cl(o.semver,String(_),n))return!1}if(s){if(d&&_.semver.prerelease&&_.semver.prerelease.length&&_.semver.major===d.major&&_.semver.minor===d.minor&&_.semver.patch===d.patch&&(d=!1),_.operator==="<"||_.operator==="<="){if(c=J1(s,_,n),c===_&&c!==s)return!1}else if(s.operator==="<="&&!cl(s.semver,String(_),n))return!1}if(!_.operator&&(s||o)&&i!==0)return!1}return!(o&&u&&!s&&i!==0||s&&l&&!o&&i!==0||p||d)},X1=(t,e,n)=>{if(!t)return e;let r=Ih(t.semver,e.semver,n);return r>0?t:r<0||e.operator===">"&&t.operator===">="?e:t},J1=(t,e,n)=>{if(!t)return e;let r=Ih(t.semver,e.semver,n);return r<0?t:r>0||e.operator==="<"&&t.operator==="<="?e:t};Z1.exports=Ffe});var bh=m((GYe,nk)=>{"use strict";var Ph=Ha(),ek=nl(),qfe=Vt(),tk=_h(),Yfe=vi(),Kfe=vw(),Wfe=Pw(),zfe=Lw(),Xfe=Uw(),Jfe=kw(),Zfe=Bw(),Qfe=Hw(),eme=$w(),tme=Hn(),nme=Kw(),rme=zw(),ome=k_(),sme=Qw(),ime=t1(),ame=ol(),cme=V_(),ume=Eh(),lme=Sh(),dme=B_(),pme=G_(),_me=Th(),fme=l1(),mme=sl(),Eme=Fn(),Sme=al(),Tme=N1(),gme=v1(),hme=P1(),Ame=L1(),Rme=D1(),yme=$_(),Ome=G1(),Nme=F1(),Cme=q1(),vme=K1(),Ime=Q1();nk.exports={parse:Yfe,valid:Kfe,clean:Wfe,inc:zfe,diff:Xfe,major:Jfe,minor:Zfe,patch:Qfe,prerelease:eme,compare:tme,rcompare:nme,compareLoose:rme,compareBuild:ome,sort:sme,rsort:ime,gt:ame,lt:cme,eq:ume,neq:lme,gte:dme,lte:pme,cmp:_me,coerce:fme,Comparator:mme,Range:Eme,satisfies:Sme,toComparators:Tme,maxSatisfying:gme,minSatisfying:hme,minVersion:Ame,validRange:Rme,outside:yme,gtr:Ome,ltr:Nme,intersects:Cme,simplifyRange:vme,subset:Ime,SemVer:qfe,re:Ph.re,src:Ph.src,tokens:Ph.t,SEMVER_SPEC_VERSION:ek.SEMVER_SPEC_VERSION,RELEASE_TYPES:ek.RELEASE_TYPES,compareIdentifiers:tk.compareIdentifiers,rcompareIdentifiers:tk.rcompareIdentifiers}});var rk=m(j_=>{"use strict";Object.defineProperty(j_,"__esModule",{value:!0});j_.VERSION=void 0;j_.VERSION="0.57.2"});var ok=m(ul=>{"use strict";Object.defineProperty(ul,"__esModule",{value:!0});ul.SeverityNumber=void 0;var Pme;(function(t){t[t.UNSPECIFIED=0]="UNSPECIFIED",t[t.TRACE=1]="TRACE",t[t.TRACE2=2]="TRACE2",t[t.TRACE3=3]="TRACE3",t[t.TRACE4=4]="TRACE4",t[t.DEBUG=5]="DEBUG",t[t.DEBUG2=6]="DEBUG2",t[t.DEBUG3=7]="DEBUG3",t[t.DEBUG4=8]="DEBUG4",t[t.INFO=9]="INFO",t[t.INFO2=10]="INFO2",t[t.INFO3=11]="INFO3",t[t.INFO4=12]="INFO4",t[t.WARN=13]="WARN",t[t.WARN2=14]="WARN2",t[t.WARN3=15]="WARN3",t[t.WARN4=16]="WARN4",t[t.ERROR=17]="ERROR",t[t.ERROR2=18]="ERROR2",t[t.ERROR3=19]="ERROR3",t[t.ERROR4=20]="ERROR4",t[t.FATAL=21]="FATAL",t[t.FATAL2=22]="FATAL2",t[t.FATAL3=23]="FATAL3",t[t.FATAL4=24]="FATAL4"})(Pme=ul.SeverityNumber||(ul.SeverityNumber={}))});var Y_=m(Fa=>{"use strict";Object.defineProperty(Fa,"__esModule",{value:!0});Fa.NOOP_LOGGER=Fa.NoopLogger=void 0;var q_=class{emit(e){}};Fa.NoopLogger=q_;Fa.NOOP_LOGGER=new q_});var W_=m($a=>{"use strict";Object.defineProperty($a,"__esModule",{value:!0});$a.NOOP_LOGGER_PROVIDER=$a.NoopLoggerProvider=void 0;var bme=Y_(),K_=class{getLogger(e,n,r){return new bme.NoopLogger}};$a.NoopLoggerProvider=K_;$a.NOOP_LOGGER_PROVIDER=new K_});var Lh=m(z_=>{"use strict";Object.defineProperty(z_,"__esModule",{value:!0});z_.ProxyLogger=void 0;var Mme=Y_(),Mh=class{constructor(e,n,r,o){this._provider=e,this.name=n,this.version=r,this.options=o}emit(e){this._getLogger().emit(e)}_getLogger(){if(this._delegate)return this._delegate;let e=this._provider.getDelegateLogger(this.name,this.version,this.options);return e?(this._delegate=e,this._delegate):Mme.NOOP_LOGGER}};z_.ProxyLogger=Mh});var Dh=m(X_=>{"use strict";Object.defineProperty(X_,"__esModule",{value:!0});X_.ProxyLoggerProvider=void 0;var Lme=W_(),xme=Lh(),xh=class{getLogger(e,n,r){var o;return(o=this.getDelegateLogger(e,n,r))!==null&&o!==void 0?o:new xme.ProxyLogger(this,e,n,r)}getDelegate(){var e;return(e=this._delegate)!==null&&e!==void 0?e:Lme.NOOP_LOGGER_PROVIDER}setDelegate(e){this._delegate=e}getDelegateLogger(e,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(e,n,r)}};X_.ProxyLoggerProvider=xh});var sk=m(J_=>{"use strict";Object.defineProperty(J_,"__esModule",{value:!0});J_._globalThis=void 0;J_._globalThis=typeof globalThis=="object"?globalThis:global});var ik=m(Z_=>{"use strict";Object.defineProperty(Z_,"__esModule",{value:!0});Z_._globalThis=void 0;var Dme=sk();Object.defineProperty(Z_,"_globalThis",{enumerable:!0,get:function(){return Dme._globalThis}})});var ak=m(Q_=>{"use strict";Object.defineProperty(Q_,"__esModule",{value:!0});Q_._globalThis=void 0;var Ume=ik();Object.defineProperty(Q_,"_globalThis",{enumerable:!0,get:function(){return Ume._globalThis}})});var ck=m(Vr=>{"use strict";Object.defineProperty(Vr,"__esModule",{value:!0});Vr.API_BACKWARDS_COMPATIBILITY_VERSION=Vr.makeGetter=Vr._global=Vr.GLOBAL_LOGS_API_KEY=void 0;var wme=ak();Vr.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");Vr._global=wme._globalThis;function kme(t,e,n){return r=>r===t?e:n}Vr.makeGetter=kme;Vr.API_BACKWARDS_COMPATIBILITY_VERSION=1});var lk=m(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0});ef.LogsAPI=void 0;var $n=ck(),Vme=W_(),uk=Dh(),Uh=class t{constructor(){this._proxyLoggerProvider=new uk.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new t),this._instance}setGlobalLoggerProvider(e){return $n._global[$n.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():($n._global[$n.GLOBAL_LOGS_API_KEY]=(0,$n.makeGetter)($n.API_BACKWARDS_COMPATIBILITY_VERSION,e,Vme.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider.setDelegate(e),e)}getLoggerProvider(){var e,n;return(n=(e=$n._global[$n.GLOBAL_LOGS_API_KEY])===null||e===void 0?void 0:e.call($n._global,$n.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(e,n,r){return this.getLoggerProvider().getLogger(e,n,r)}disable(){delete $n._global[$n.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new uk.ProxyLoggerProvider}};ef.LogsAPI=Uh});var wh=m(ht=>{"use strict";Object.defineProperty(ht,"__esModule",{value:!0});ht.logs=ht.ProxyLoggerProvider=ht.ProxyLogger=ht.NoopLoggerProvider=ht.NOOP_LOGGER_PROVIDER=ht.NoopLogger=ht.NOOP_LOGGER=ht.SeverityNumber=void 0;var Bme=ok();Object.defineProperty(ht,"SeverityNumber",{enumerable:!0,get:function(){return Bme.SeverityNumber}});var dk=Y_();Object.defineProperty(ht,"NOOP_LOGGER",{enumerable:!0,get:function(){return dk.NOOP_LOGGER}});Object.defineProperty(ht,"NoopLogger",{enumerable:!0,get:function(){return dk.NoopLogger}});var pk=W_();Object.defineProperty(ht,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return pk.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ht,"NoopLoggerProvider",{enumerable:!0,get:function(){return pk.NoopLoggerProvider}});var Gme=Lh();Object.defineProperty(ht,"ProxyLogger",{enumerable:!0,get:function(){return Gme.ProxyLogger}});var Hme=Dh();Object.defineProperty(ht,"ProxyLoggerProvider",{enumerable:!0,get:function(){return Hme.ProxyLoggerProvider}});var Fme=lk();ht.logs=Fme.LogsAPI.getInstance()});var _k=m(ja=>{"use strict";Object.defineProperty(ja,"__esModule",{value:!0});ja.disableInstrumentations=ja.enableInstrumentations=void 0;function $me(t,e,n,r){for(let o=0,s=t.length;o<s;o++){let i=t[o];e&&i.setTracerProvider(e),n&&i.setMeterProvider(n),r&&i.setLoggerProvider&&i.setLoggerProvider(r),i.getConfig().enabled||i.enable()}}ja.enableInstrumentations=$me;function jme(t){t.forEach(e=>e.disable())}ja.disableInstrumentations=jme});var Ek=m(tf=>{"use strict";Object.defineProperty(tf,"__esModule",{value:!0});tf.registerInstrumentations=void 0;var fk=(L(),I(V)),qme=wh(),mk=_k();function Yme(t){var e,n;let r=t.tracerProvider||fk.trace.getTracerProvider(),o=t.meterProvider||fk.metrics.getMeterProvider(),s=t.loggerProvider||qme.logs.getLoggerProvider(),i=(n=(e=t.instrumentations)===null||e===void 0?void 0:e.flat())!==null&&n!==void 0?n:[];return(0,mk.enableInstrumentations)(i,r,o,s),()=>{(0,mk.disableInstrumentations)(i)}}tf.registerInstrumentations=Yme});var Vh=m((tKe,gk)=>{"use strict";function kh(t){return typeof t=="function"}var Qt=console.error.bind(console);function ll(t,e,n){var r=!!t[e]&&t.propertyIsEnumerable(e);Object.defineProperty(t,e,{configurable:!0,enumerable:r,writable:!0,value:n})}function dl(t){t&&t.logger&&(kh(t.logger)?Qt=t.logger:Qt("new logger isn't a function, not replacing"))}function Sk(t,e,n){if(!t||!t[e]){Qt("no original function "+e+" to wrap");return}if(!n){Qt("no wrapper function"),Qt(new Error().stack);return}if(!kh(t[e])||!kh(n)){Qt("original object and wrapper must be functions");return}var r=t[e],o=n(r,e);return ll(o,"__original",r),ll(o,"__unwrap",function(){t[e]===o&&ll(t,e,r)}),ll(o,"__wrapped",!0),ll(t,e,o),o}function Kme(t,e,n){if(t)Array.isArray(t)||(t=[t]);else{Qt("must provide one or more modules to patch"),Qt(new Error().stack);return}if(!(e&&Array.isArray(e))){Qt("must provide one or more functions to wrap on modules");return}t.forEach(function(r){e.forEach(function(o){Sk(r,o,n)})})}function Tk(t,e){if(!t||!t[e]){Qt("no function to unwrap."),Qt(new Error().stack);return}if(!t[e].__unwrap)Qt("no original to unwrap to -- has "+e+" already been unwrapped?");else return t[e].__unwrap()}function Wme(t,e){if(t)Array.isArray(t)||(t=[t]);else{Qt("must provide one or more modules to patch"),Qt(new Error().stack);return}if(!(e&&Array.isArray(e))){Qt("must provide one or more functions to unwrap on modules");return}t.forEach(function(n){e.forEach(function(r){Tk(n,r)})})}dl.wrap=Sk;dl.massWrap=Kme;dl.unwrap=Tk;dl.massUnwrap=Wme;gk.exports=dl});var hk=m(rf=>{"use strict";Object.defineProperty(rf,"__esModule",{value:!0});rf.InstrumentationAbstract=void 0;var Bh=(L(),I(V)),zme=wh(),nf=Vh(),Gh=class{constructor(e,n,r){this.instrumentationName=e,this.instrumentationVersion=n,this._config={},this._wrap=nf.wrap,this._unwrap=nf.unwrap,this._massWrap=nf.massWrap,this._massUnwrap=nf.massUnwrap,this.setConfig(r),this._diag=Bh.diag.createComponentLogger({namespace:e}),this._tracer=Bh.trace.getTracer(e,n),this._meter=Bh.metrics.getMeter(e,n),this._logger=zme.logs.getLogger(e,n),this._updateMetricInstruments()}get meter(){return this._meter}setMeterProvider(e){this._meter=e.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(e){this._logger=e.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){var e;let n=(e=this.init())!==null&&e!==void 0?e:[];return Array.isArray(n)?n:[n]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(e){this._config=Object.assign({enabled:!0},e)}setTracerProvider(e){this._tracer=e.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(e,n,r,o){if(e)try{e(r,o)}catch(s){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},s)}}};rf.InstrumentationAbstract=Gh});var Rk=m((rKe,Ak)=>{var qa=1e3,Ya=qa*60,Ka=Ya*60,Ii=Ka*24,Xme=Ii*7,Jme=Ii*365.25;Ak.exports=function(t,e){e=e||{};var n=typeof t;if(n==="string"&&t.length>0)return Zme(t);if(n==="number"&&isFinite(t))return e.long?eEe(t):Qme(t);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(t))};function Zme(t){if(t=String(t),!(t.length>100)){var e=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(t);if(e){var n=parseFloat(e[1]),r=(e[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Jme;case"weeks":case"week":case"w":return n*Xme;case"days":case"day":case"d":return n*Ii;case"hours":case"hour":case"hrs":case"hr":case"h":return n*Ka;case"minutes":case"minute":case"mins":case"min":case"m":return n*Ya;case"seconds":case"second":case"secs":case"sec":case"s":return n*qa;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Qme(t){var e=Math.abs(t);return e>=Ii?Math.round(t/Ii)+"d":e>=Ka?Math.round(t/Ka)+"h":e>=Ya?Math.round(t/Ya)+"m":e>=qa?Math.round(t/qa)+"s":t+"ms"}function eEe(t){var e=Math.abs(t);return e>=Ii?of(t,e,Ii,"day"):e>=Ka?of(t,e,Ka,"hour"):e>=Ya?of(t,e,Ya,"minute"):e>=qa?of(t,e,qa,"second"):t+" ms"}function of(t,e,n,r){var o=e>=n*1.5;return Math.round(t/n)+" "+r+(o?"s":"")}});var Hh=m((oKe,yk)=>{function tEe(t){n.debug=n,n.default=n,n.coerce=c,n.disable=i,n.enable=o,n.enabled=a,n.humanize=Rk(),n.destroy=u,Object.keys(t).forEach(l=>{n[l]=t[l]}),n.names=[],n.skips=[],n.formatters={};function e(l){let d=0;for(let p=0;p<l.length;p++)d=(d<<5)-d+l.charCodeAt(p),d|=0;return n.colors[Math.abs(d)%n.colors.length]}n.selectColor=e;function n(l){let d,p=null,_,f;function E(...S){if(!E.enabled)return;let g=E,h=Number(new Date),O=h-(d||h);g.diff=O,g.prev=d,g.curr=h,d=h,S[0]=n.coerce(S[0]),typeof S[0]!="string"&&S.unshift("%O");let N=0;S[0]=S[0].replace(/%([a-zA-Z%])/g,(M,P)=>{if(M==="%%")return"%";N++;let J=n.formatters[P];if(typeof J=="function"){let X=S[N];M=J.call(g,X),S.splice(N,1),N--}return M}),n.formatArgs.call(g,S),(g.log||n.log).apply(g,S)}return E.namespace=l,E.useColors=n.useColors(),E.color=n.selectColor(l),E.extend=r,E.destroy=n.destroy,Object.defineProperty(E,"enabled",{enumerable:!0,configurable:!1,get:()=>p!==null?p:(_!==n.namespaces&&(_=n.namespaces,f=n.enabled(l)),f),set:S=>{p=S}}),typeof n.init=="function"&&n.init(E),E}function r(l,d){let p=n(this.namespace+(typeof d>"u"?":":d)+l);return p.log=this.log,p}function o(l){n.save(l),n.namespaces=l,n.names=[],n.skips=[];let d=(typeof l=="string"?l:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let p of d)p[0]==="-"?n.skips.push(p.slice(1)):n.names.push(p)}function s(l,d){let p=0,_=0,f=-1,E=0;for(;p<l.length;)if(_<d.length&&(d[_]===l[p]||d[_]==="*"))d[_]==="*"?(f=_,E=p,_++):(p++,_++);else if(f!==-1)_=f+1,E++,p=E;else return!1;for(;_<d.length&&d[_]==="*";)_++;return _===d.length}function i(){let l=[...n.names,...n.skips.map(d=>"-"+d)].join(",");return n.enable(""),l}function a(l){for(let d of n.skips)if(s(l,d))return!1;for(let d of n.names)if(s(l,d))return!0;return!1}function c(l){return l instanceof Error?l.stack||l.message:l}function u(){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}yk.exports=tEe});var Ok=m((pn,sf)=>{pn.formatArgs=rEe;pn.save=oEe;pn.load=sEe;pn.useColors=nEe;pn.storage=iEe();pn.destroy=(()=>{let t=!1;return()=>{t||(t=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();pn.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function nEe(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let t;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(t=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(t[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function rEe(t){if(t[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+t[0]+(this.useColors?"%c ":" ")+"+"+sf.exports.humanize(this.diff),!this.useColors)return;let e="color: "+this.color;t.splice(1,0,e,"color: inherit");let n=0,r=0;t[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),t.splice(r,0,e)}pn.log=console.debug||console.log||(()=>{});function oEe(t){try{t?pn.storage.setItem("debug",t):pn.storage.removeItem("debug")}catch{}}function sEe(){let t;try{t=pn.storage.getItem("debug")||pn.storage.getItem("DEBUG")}catch{}return!t&&typeof process<"u"&&"env"in process&&(t=process.env.DEBUG),t}function iEe(){try{return localStorage}catch{}}sf.exports=Hh()(pn);var{formatters:aEe}=sf.exports;aEe.j=function(t){try{return JSON.stringify(t)}catch(e){return"[UnexpectedJSONParseError]: "+e.message}}});var Ck=m((sKe,Nk)=>{"use strict";Nk.exports=(t,e=process.argv)=>{let n=t.startsWith("-")?"":t.length===1?"-":"--",r=e.indexOf(n+t),o=e.indexOf("--");return r!==-1&&(o===-1||r<o)}});var Pk=m((iKe,Ik)=>{"use strict";var cEe=require("os"),vk=require("tty"),jn=Ck(),{env:At}=process,rs;jn("no-color")||jn("no-colors")||jn("color=false")||jn("color=never")?rs=0:(jn("color")||jn("colors")||jn("color=true")||jn("color=always"))&&(rs=1);"FORCE_COLOR"in At&&(At.FORCE_COLOR==="true"?rs=1:At.FORCE_COLOR==="false"?rs=0:rs=At.FORCE_COLOR.length===0?1:Math.min(parseInt(At.FORCE_COLOR,10),3));function Fh(t){return t===0?!1:{level:t,hasBasic:!0,has256:t>=2,has16m:t>=3}}function $h(t,e){if(rs===0)return 0;if(jn("color=16m")||jn("color=full")||jn("color=truecolor"))return 3;if(jn("color=256"))return 2;if(t&&!e&&rs===void 0)return 0;let n=rs||0;if(At.TERM==="dumb")return n;if(process.platform==="win32"){let r=cEe.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in At)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in At)||At.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in At)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(At.TEAMCITY_VERSION)?1:0;if(At.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in At){let r=parseInt((At.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(At.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(At.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(At.TERM)||"COLORTERM"in At?1:n}function uEe(t){let e=$h(t,t&&t.isTTY);return Fh(e)}Ik.exports={supportsColor:uEe,stdout:Fh($h(!0,vk.isatty(1))),stderr:Fh($h(!0,vk.isatty(2)))}});var Mk=m((Rt,cf)=>{var lEe=require("tty"),af=require("util");Rt.init=SEe;Rt.log=fEe;Rt.formatArgs=pEe;Rt.save=mEe;Rt.load=EEe;Rt.useColors=dEe;Rt.destroy=af.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");Rt.colors=[6,2,3,4,5,1];try{let t=Pk();t&&(t.stderr||t).level>=2&&(Rt.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{}Rt.inspectOpts=Object.keys(process.env).filter(t=>/^debug_/i.test(t)).reduce((t,e)=>{let n=e.substring(6).toLowerCase().replace(/_([a-z])/g,(o,s)=>s.toUpperCase()),r=process.env[e];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),t[n]=r,t},{});function dEe(){return"colors"in Rt.inspectOpts?!!Rt.inspectOpts.colors:lEe.isatty(process.stderr.fd)}function pEe(t){let{namespace:e,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),s=` ${o};1m${e} \x1B[0m`;t[0]=s+t[0].split(`
2
2
  `).join(`
3
- `+s),t.push(o+"m+"+af.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=cEe()+e+" "+t[0]}function cEe(){return Rt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function uEe(...t){return process.stderr.write(sf.formatWithOptions(Rt.inspectOpts,...t)+`
4
- `)}function lEe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function dEe(){return process.env.DEBUG}function pEe(t){t.inspectOpts={};let e=Object.keys(Rt.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=Rt.inspectOpts[e[n]]}af.exports=Gh()(Rt);var{formatters:vk}=af.exports;vk.o=function(t){return this.inspectOpts.colors=this.useColors,sf.inspect(t,this.inspectOpts).split(`
5
- `).map(e=>e.trim()).join(" ")};vk.O=function(t){return this.inspectOpts.colors=this.useColors,sf.inspect(t,this.inspectOpts)}});var Pk=m((eKe,$h)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?$h.exports=Ak():$h.exports=Ik()});var qh=m((tKe,bk)=>{"use strict";var jh=require("path").sep;bk.exports=function(t){var e=t.split(jh),n=e.lastIndexOf("node_modules");if(n!==-1&&e[n+1]){for(var r=e[n+1][0]==="@",o=r?e[n+1]+"/"+e[n+2]:e[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)c===a?i+=e[c]:i+=e[c]+jh;for(var u="",l=e.length-1,d=n+s;d<=l;d++)d===l?u+=e[d]:u+=e[d]+jh;return{name:o,basedir:i,path:u}}}});var Yh=m((nKe,Mk)=>{"use strict";var _Ee=require("os");Mk.exports=_Ee.homedir||function(){var e=process.env.HOME,n=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE&&process.env.HOMEPATH&&process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(n?"/Users/"+n:null):process.platform==="linux"?e||(process.getuid()===0?"/root":n?"/home/"+n:null):e||null}});var cf=m((rKe,Lk)=>{"use strict";Lk.exports=Error});var Kh=m((oKe,xk)=>{"use strict";var uf=cf();xk.exports=function(){var t=uf.prepareStackTrace;uf.prepareStackTrace=function(n,r){return r};var e=new uf().stack;return uf.prepareStackTrace=t,e[2].getFileName()}});var Dk=m((sKe,pl)=>{"use strict";var fEe=process.platform==="win32",mEe=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,Wh={};function EEe(t){return mEe.exec(t).slice(1)}Wh.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=EEe(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var SEe=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,zh={};function TEe(t){return SEe.exec(t).slice(1)}zh.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=TEe(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};fEe?pl.exports=Wh.parse:pl.exports=zh.parse;pl.exports.posix=zh.parse;pl.exports.win32=Wh.parse});var Xh=m((iKe,Vk)=>{var kk=require("path"),Uk=kk.parse||Dk(),gEe=/^([A-Za-z]:)/,hEe=/^\\\\/;function wk(t,e){var n="/";gEe.test(t)?n="":hEe.test(t)&&(n="\\\\");for(var r=[t],o=Uk(t);o.dir!==r[r.length-1];)r.push(o.dir),o=Uk(o.dir);return r.reduce(function(s,i){return s.concat(e.map(function(a){return kk.resolve(n,i,a)}))},[])}Vk.exports=function(e,n,r){var o=n&&n.moduleDirectory?[].concat(n.moduleDirectory):["node_modules"];if(n&&typeof n.paths=="function")return n.paths(r,e,function(){return wk(e,o)},n);var s=wk(e,o);return n&&n.paths?s.concat(n.paths):s}});var Jh=m((aKe,Bk)=>{Bk.exports=function(t,e){return e||{}}});var Fk=m((cKe,Hk)=>{"use strict";var AEe="Function.prototype.bind called on incompatible ",REe=Object.prototype.toString,yEe=Math.max,OEe="[object Function]",Gk=function(e,n){for(var r=[],o=0;o<e.length;o+=1)r[o]=e[o];for(var s=0;s<n.length;s+=1)r[s+e.length]=n[s];return r},NEe=function(e,n){for(var r=[],o=n||0,s=0;o<e.length;o+=1,s+=1)r[s]=e[o];return r},CEe=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n};Hk.exports=function(e){var n=this;if(typeof n!="function"||REe.apply(n)!==OEe)throw new TypeError(AEe+n);for(var r=NEe(arguments,1),o,s=function(){if(this instanceof o){var l=n.apply(this,Gk(r,arguments));return Object(l)===l?l:this}return n.apply(e,Gk(r,arguments))},i=yEe(0,n.length-r.length),a=[],c=0;c<i;c++)a[c]="$"+c;if(o=Function("binder","return function ("+CEe(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var u=function(){};u.prototype=n.prototype,o.prototype=new u,u.prototype=null}return o}});var jk=m((uKe,$k)=>{"use strict";var vEe=Fk();$k.exports=Function.prototype.bind||vEe});var Yk=m((lKe,qk)=>{"use strict";var IEe=Function.prototype.call,PEe=Object.prototype.hasOwnProperty,bEe=jk();qk.exports=bEe.call(IEe,PEe)});var Kk=m((dKe,MEe)=>{MEe.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var _l=m((pKe,Xk)=>{"use strict";var LEe=Yk();function xEe(t,e){for(var n=t.split("."),r=e.split(" "),o=r.length>1?r[0]:"=",s=(r.length>1?r[1]:r[0]).split("."),i=0;i<3;++i){var a=parseInt(n[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return o==="<"?a<c:o===">="?a>=c:!1}return o===">="}function Wk(t,e){var n=e.split(/ ?&& ?/);if(n.length===0)return!1;for(var r=0;r<n.length;++r)if(!xEe(t,n[r]))return!1;return!0}function DEe(t,e){if(typeof e=="boolean")return e;var n=typeof t>"u"?process.versions&&process.versions.node:t;if(typeof n!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var r=0;r<e.length;++r)if(Wk(n,e[r]))return!0;return!1}return Wk(n,e)}var zk=Kk();Xk.exports=function(e,n){return LEe(zk,e)&&DEe(n,zk[e])}});var Zh=m((_Ke,Jk)=>{"use strict";Jk.exports=TypeError});var eV=m((fKe,Qk)=>{var Pi=require("fs"),UEe=Yh(),nt=require("path"),wEe=Kh(),kEe=Xh(),VEe=Jh(),BEe=_l(),Zk=cf(),Qh=Zh(),GEe=process.platform!=="win32"&&Pi.realpath&&typeof Pi.realpath.native=="function"?Pi.realpath.native:Pi.realpath,HEe=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,FEe=/^\w:[/\\]*$/,$Ee=/[/\\]node_modules[/\\]*$/,eA=UEe();function jEe(){return eA?[nt.join(eA,".node_modules"),nt.join(eA,".node_libraries")]:[]}var qEe=function(e,n){Pi.stat(e,function(r,o){return r?r.code==="ENOENT"||r.code==="ENOTDIR"?n(null,!1):n(r):n(null,o.isFile()||o.isFIFO())})},YEe=function(e,n){Pi.stat(e,function(r,o){return r?r.code==="ENOENT"||r.code==="ENOTDIR"?n(null,!1):n(r):n(null,o.isDirectory())})},KEe=function(e,n){GEe(e,function(r,o){r&&r.code!=="ENOENT"?n(r):n(null,r?e:o)})};function fl(t,e,n,r){n&&n.preserveSymlinks===!1?t(e,r):r(null,e)}function WEe(t,e,n){t(e,function(r,o){if(r)n(r);else try{var s=JSON.parse(o);n(null,s)}catch{n(null)}})}function zEe(t,e,n){for(var r=kEe(e,n,t),o=0;o<r.length;o++)r[o]=nt.join(r[o],t);return r}Qk.exports=function(e,n,r){var o=r,s=n;if(typeof n=="function"&&(o=s,s={}),typeof e!="string"){var i=new Qh("Path must be a string.");return process.nextTick(function(){o(i)})}s=VEe(e,s);var a=s.isFile||qEe,c=s.isDirectory||YEe,u=s.readFile||Pi.readFile,l=s.realpath||KEe,d=s.readPackage||WEe;if(s.readFile&&s.readPackage){var p=new Qh("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){o(p)})}var _=s.packageIterator,f=s.extensions||[".js"],E=s.includeCoreModules!==!1,S=s.basedir||nt.dirname(wEe()),g=s.filename||S;s.paths=s.paths||jEe();var h=nt.resolve(S);fl(l,h,s,function(H,ae){H?o(H):N(ae)});var O;function N(H){if(HEe.test(e))O=nt.resolve(H,e),(e==="."||e===".."||e.slice(-1)==="/")&&(O+="/"),e.slice(-1)==="/"&&O===H?J(O,s.package,R):M(O,s.package,R);else{if(E&&BEe(e))return o(null,e);Ye(e,H,function(ae,De,pe){if(ae)o(ae);else{if(De)return fl(l,De,s,function(Mn,Ke){Mn?o(Mn):o(null,Ke,pe)});var Be=new Zk("Cannot find module '"+e+"' from '"+g+"'");Be.code="MODULE_NOT_FOUND",o(Be)}})}}function R(H,ae,De){H?o(H):ae?o(null,ae,De):J(O,function(pe,Be,Mn){if(pe)o(pe);else if(Be)fl(l,Be,s,function(Ge,an){Ge?o(Ge):o(null,an,Mn)});else{var Ke=new Zk("Cannot find module '"+e+"' from '"+g+"'");Ke.code="MODULE_NOT_FOUND",o(Ke)}})}function M(H,ae,De){var pe=ae,Be=De;typeof pe=="function"&&(Be=pe,pe=void 0);var Mn=[""].concat(f);Ke(Mn,H,pe);function Ke(Ge,an,so){if(Ge.length===0)return Be(null,void 0,so);var Zs=an+Ge[0],yr=so;yr?Lt(null,yr):P(nt.dirname(Zs),Lt);function Lt($o,ua,io){if(yr=ua,$o)return Be($o);if(io&&yr&&s.pathFilter){var jd=nt.relative(io,Zs),qd=jd.slice(0,jd.length-Ge[0].length),yu=s.pathFilter(yr,an,qd);if(yu)return Ke([""].concat(f),nt.resolve(io,yu),yr)}a(Zs,$d)}function $d($o,ua){if($o)return Be($o);if(ua)return Be(null,Zs,yr);Ke(Ge.slice(1),an,yr)}}}function P(H,ae){if(H===""||H==="/"||process.platform==="win32"&&FEe.test(H)||$Ee.test(H))return ae(null);fl(l,H,s,function(De,pe){if(De)return P(nt.dirname(H),ae);var Be=nt.join(pe,"package.json");a(Be,function(Mn,Ke){if(!Ke)return P(nt.dirname(H),ae);d(u,Be,function(Ge,an){if(Ge)return ae(Ge);var so=an;so&&s.packageFilter&&(so=s.packageFilter(so,Be)),ae(null,so,H)})})})}function J(H,ae,De){var pe=De,Be=ae;typeof Be=="function"&&(pe=Be,Be=s.package),fl(l,H,s,function(Mn,Ke){if(Mn)return pe(Mn);var Ge=nt.join(Ke,"package.json");a(Ge,function(an,so){if(an)return pe(an);if(!so)return M(nt.join(H,"index"),Be,pe);d(u,Ge,function(Zs,yr){if(Zs)return pe(Zs);var Lt=yr;if(Lt&&s.packageFilter&&(Lt=s.packageFilter(Lt,Ge)),Lt&&Lt.main){if(typeof Lt.main!="string"){var $d=new Qh("package \u201C"+Lt.name+"\u201D `main` must be a string");return $d.code="INVALID_PACKAGE_MAIN",pe($d)}(Lt.main==="."||Lt.main==="./")&&(Lt.main="index"),M(nt.resolve(H,Lt.main),Lt,function($o,ua,io){if($o)return pe($o);if(ua)return pe(null,ua,io);if(!io)return M(nt.join(H,"index"),io,pe);var jd=nt.resolve(H,io.main);J(jd,io,function(qd,yu,zN){if(qd)return pe(qd);if(yu)return pe(null,yu,zN);M(nt.join(H,"index"),zN,pe)})});return}M(nt.join(H,"/index"),Lt,pe)})})})}function X(H,ae){if(ae.length===0)return H(null,void 0);var De=ae[0];c(nt.dirname(De),pe);function pe(Ke,Ge){if(Ke)return H(Ke);if(!Ge)return X(H,ae.slice(1));M(De,s.package,Be)}function Be(Ke,Ge,an){if(Ke)return H(Ke);if(Ge)return H(null,Ge,an);J(De,s.package,Mn)}function Mn(Ke,Ge,an){if(Ke)return H(Ke);if(Ge)return H(null,Ge,an);X(H,ae.slice(1))}}function Ye(H,ae,De){var pe=function(){return zEe(H,ae,s)};X(De,_?_(H,ae,pe,s):pe())}}});var tV=m((mKe,XEe)=>{XEe.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var sV=m((EKe,oV)=>{"use strict";var JEe=_l(),nV=tV(),rV={};for(lf in nV)Object.prototype.hasOwnProperty.call(nV,lf)&&(rV[lf]=JEe(lf));var lf;oV.exports=rV});var aV=m((SKe,iV)=>{var ZEe=_l();iV.exports=function(e){return ZEe(e)}});var uV=m((TKe,cV)=>{var QEe=_l(),bi=require("fs"),Gt=require("path"),eSe=cf(),tA=Zh(),tSe=Yh(),nSe=Kh(),rSe=Xh(),oSe=Jh(),sSe=process.platform!=="win32"&&bi.realpathSync&&typeof bi.realpathSync.native=="function"?bi.realpathSync.native:bi.realpathSync,iSe=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,aSe=/^\w:[/\\]*$/,cSe=/[/\\]node_modules[/\\]*$/,nA=tSe();function uSe(){return nA?[Gt.join(nA,".node_modules"),Gt.join(nA,".node_libraries")]:[]}var lSe=function(e){try{var n=bi.statSync(e,{throwIfNoEntry:!1})}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return!1;throw r}return!!n&&(n.isFile()||n.isFIFO())},dSe=function(e){try{var n=bi.statSync(e,{throwIfNoEntry:!1})}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return!1;throw r}return!!n&&n.isDirectory()},pSe=function(e){try{return sSe(e)}catch(n){if(n.code!=="ENOENT")throw n}return e};function ml(t,e,n){return n&&n.preserveSymlinks===!1?t(e):e}function _Se(t,e){var n=t(e);try{var r=JSON.parse(n);return r}catch{}}function fSe(t,e,n){for(var r=rSe(e,n,t),o=0;o<r.length;o++)r[o]=Gt.join(r[o],t);return r}cV.exports=function(e,n){if(typeof e!="string")throw new tA("Path must be a string.");var r=oSe(e,n),o=r.isFile||lSe,s=r.readFileSync||bi.readFileSync,i=r.isDirectory||dSe,a=r.realpathSync||pSe,c=r.readPackageSync||_Se;if(r.readFileSync&&r.readPackageSync)throw new tA("`readFileSync` and `readPackageSync` are mutually exclusive.");var u=r.packageIterator,l=r.extensions||[".js"],d=r.includeCoreModules!==!1,p=r.basedir||Gt.dirname(nSe()),_=r.filename||p;r.paths=r.paths||uSe();var f=ml(a,Gt.resolve(p),r);if(iSe.test(e)){var E=Gt.resolve(f,e);(e==="."||e===".."||e.slice(-1)==="/")&&(E+="/");var S=O(E)||R(E);if(S)return ml(a,S,r)}else{if(d&&QEe(e))return e;var g=M(e,f);if(g)return ml(a,g,r)}var h=new eSe("Cannot find module '"+e+"' from '"+_+"'");throw h.code="MODULE_NOT_FOUND",h;function O(P){var J=N(Gt.dirname(P));if(J&&J.dir&&J.pkg&&r.pathFilter){var X=Gt.relative(J.dir,P),Ye=r.pathFilter(J.pkg,P,X);Ye&&(P=Gt.resolve(J.dir,Ye))}if(o(P))return P;for(var H=0;H<l.length;H++){var ae=P+l[H];if(o(ae))return ae}}function N(P){if(!(P===""||P==="/")&&!(process.platform==="win32"&&aSe.test(P))&&!cSe.test(P)){var J=Gt.join(ml(a,P,r),"package.json");if(!o(J))return N(Gt.dirname(P));var X=c(s,J);return X&&r.packageFilter&&(X=r.packageFilter(X,P)),{pkg:X,dir:P}}}function R(P){var J=Gt.join(ml(a,P,r),"/package.json");if(o(J)){try{var X=c(s,J)}catch{}if(X&&r.packageFilter&&(X=r.packageFilter(X,P)),X&&X.main){if(typeof X.main!="string"){var Ye=new tA("package \u201C"+X.name+"\u201D `main` must be a string");throw Ye.code="INVALID_PACKAGE_MAIN",Ye}(X.main==="."||X.main==="./")&&(X.main="index");try{var H=O(Gt.resolve(P,X.main));if(H)return H;var ae=R(Gt.resolve(P,X.main));if(ae)return ae}catch{}}}return O(Gt.join(P,"/index"))}function M(P,J){for(var X=function(){return fSe(P,J,r)},Ye=u?u(P,J,X,r):X(),H=0;H<Ye.length;H++){var ae=Ye[H];if(i(Gt.dirname(ae))){var De=O(ae);if(De)return De;var pe=R(ae);if(pe)return pe}}}}});var rA=m((gKe,lV)=>{var df=eV();df.core=sV();df.isCore=aV();df.sync=uV();lV.exports=df});var dV=m((hKe,mSe)=>{mSe.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var aA=m((AKe,iA)=>{"use strict";var za=require("path"),ar=require("module"),Xe=Pk()("require-in-the-middle"),ESe=qh();iA.exports=El;iA.exports.Hook=El;var oA,Wa;if(ar.isBuiltin)Wa=ar.isBuiltin;else if(ar.builtinModules)Wa=t=>t.startsWith("node:")?!0:(oA===void 0&&(oA=new Set(ar.builtinModules)),oA.has(t));else{let t=rA(),[e,n]=process.versions.node.split(".").map(Number);e===8&&n<8?Wa=r=>r==="http2"?!0:!!t.core[r]:Wa=r=>!!t.core[r]}var pf;function SSe(t,e){if(!pf)if(require.resolve&&require.resolve.paths)pf=function(n,r){return require.resolve(n,{paths:[r]})};else{let n=rA();pf=function(r,o){return n.sync(r,{basedir:o})}}return pf(t,e)}var TSe=/([/\\]index)?(\.js)?$/,sA=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,n){if(this._localCache.has(e))return!0;if(n)return!1;{let r=require.cache[e];return!!(r&&this._kRitmExports in r)}}get(e,n){let r=this._localCache.get(e);if(r!==void 0)return r;if(!n){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,n,r){r?this._localCache.set(e,n):e in require.cache?require.cache[e][this._kRitmExports]=n:(Xe('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,n))}};function El(t,e,n){if(!(this instanceof El))return new El(t,e,n);if(typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null),typeof ar._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof ar._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,dV().bugs.url);return}this._cache=new sA,this._unhooked=!1,this._origRequire=ar.prototype.require;let r=this,o=new Set,s=e?e.internals===!0:!1,i=Array.isArray(t);Xe("registering require hook"),this._require=ar.prototype.require=function(c){return r._unhooked===!0?(Xe("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return r._unhooked===!0?(Xe("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,u){let l=c[0],d=Wa(l),p;if(d){if(p=l,l.startsWith("node:")){let h=l.slice(5);Wa(h)&&(p=h)}}else{if(u)return Xe("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,c);try{p=ar._resolveFilename(l,this)}catch(h){return Xe('Module._resolveFilename("%s") threw %j, calling original Module.require',l,h.message),r._origRequire.apply(this,c)}}let _,f;if(Xe("processing %s module require('%s'): %s",d===!0?"core":"non-core",l,p),r._cache.has(p,d)===!0)return Xe("returning already patched cached module: %s",p),r._cache.get(p,d);let E=o.has(p);E===!1&&o.add(p);let S=u?r._origGetBuiltinModule.apply(this,c):r._origRequire.apply(this,c);if(E===!0)return Xe("module is in the process of being patched already - ignoring: %s",p),S;if(o.delete(p),d===!0){if(i===!0&&t.includes(p)===!1)return Xe("ignoring core module not on whitelist: %s",p),S;_=p}else if(i===!0&&t.includes(p)){let h=za.parse(p);_=h.name,f=h.dir}else{let h=ESe(p);if(h===void 0)return Xe("could not parse filename: %s",p),S;_=h.name,f=h.basedir;let O=gSe(h);Xe("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",_,l,O,f);let N=!1;if(i){if(!l.startsWith(".")&&t.includes(l)&&(_=l,N=!0),!t.includes(_)&&!t.includes(O))return S;t.includes(O)&&O!==_&&(_=O,N=!0)}if(!N){let R;try{R=SSe(_,f)}catch{return Xe("could not resolve module: %s",_),r._cache.set(p,S,d),S}if(R!==p)if(s===!0)_=_+za.sep+za.relative(f,p),Xe("preparing to process require of internal file: %s",_);else return Xe("ignoring require of non-main module file: %s",R),r._cache.set(p,S,d),S}}r._cache.set(p,S,d),Xe("calling require hook: %s",_);let g=n(S,_,f);return r._cache.set(p,g,d),Xe("returning module: %s",_),g}}El.prototype.unhook=function(){this._unhooked=!0,this._require===ar.prototype.require?(ar.prototype.require=this._origRequire,Xe("require unhook successful")):Xe("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Xe("process.getBuiltinModule unhook successful")):Xe("process.getBuiltinModule unhook unsuccessful"))};function gSe(t){let e=za.sep!=="/"?t.path.split(za.sep).join("/"):t.path;return za.posix.join(t.name,e).replace(TSe,"")}});var pV=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ModuleNameTrie=os.ModuleNameSeparator=void 0;os.ModuleNameSeparator="/";var _f=class{constructor(){this.hooks=[],this.children=new Map}},cA=class{constructor(){this._trie=new _f,this._counter=0}insert(e){let n=this._trie;for(let r of e.moduleName.split(os.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new _f,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(os.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};os.ModuleNameTrie=cA});var fV=m(ff=>{"use strict";Object.defineProperty(ff,"__esModule",{value:!0});ff.RequireInTheMiddleSingleton=void 0;var hSe=aA(),_V=require("path"),uA=pV(),ASe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),lA=class t{constructor(){this._moduleNameTrie=new uA.ModuleNameTrie,this._initialize()}_initialize(){new hSe.Hook(null,{internals:!0},(e,n,r)=>{let o=RSe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){var e;return ASe?new t:this._instance=(e=this._instance)!==null&&e!==void 0?e:new t}};ff.RequireInTheMiddleSingleton=lA;function RSe(t){return _V.sep!==uA.ModuleNameSeparator?t.split(_V.sep).join(uA.ModuleNameSeparator):t}});var hV=m(Mi=>{var mV=[],dA=new WeakMap,EV=new WeakMap,SV=new Map,TV=[],ySe={set(t,e,n){return dA.get(t)[e](n)},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=EV.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return dA.get(t)[e](n.value)}};function OSe(t,e,n,r,o){SV.set(t,o),dA.set(e,n),EV.set(e,r);let s=new Proxy(e,ySe);mV.forEach(i=>i(t,s)),TV.push([t,s])}var gV=!1;function NSe(){return gV}function CSe(t){gV=t}Mi.register=OSe;Mi.importHooks=mV;Mi.specifiers=SV;Mi.toHook=TV;Mi.getExperimentalPatchInternals=NSe;Mi.setExperimentalPatchInternals=CSe});var mf=m((NKe,Xa)=>{var AV=require("path"),vSe=qh(),{fileURLToPath:RV}=require("url"),{MessageChannel:ISe}=require("worker_threads"),{importHooks:pA,specifiers:PSe,toHook:bSe,getExperimentalPatchInternals:MSe}=hV();function OV(t){pA.push(t),bSe.forEach(([e,n])=>t(e,n))}function NV(t){let e=pA.indexOf(t);e>-1&&pA.splice(e,1)}function yV(t,e,n,r){let o=t(e,n,r);o&&o!==e&&(e.default=o)}var _A;function LSe(){let{port1:t,port2:e}=new ISe,n=0,r;_A=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(u=>{r=u}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function Sl(t,e,n){if(!(this instanceof Sl))return new Sl(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;_A&&Array.isArray(t)&&_A(t),this._iitmHook=(o,s)=>{let i=o,a=o.startsWith("node:"),c;if(a)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=RV(o)}catch{}let u=vSe(o);u&&(o=u.name,c=u.basedir)}if(t){for(let u of t)if(u===o){if(c){if(r)o=o+AV.sep+AV.relative(c,RV(i));else if(!MSe()&&!c.endsWith(PSe.get(i)))continue}yV(n,s,o,c)}}else yV(n,s,o,c)},OV(this._iitmHook)}Sl.prototype.unhook=function(){NV(this._iitmHook)};Xa.exports=Sl;Xa.exports.Hook=Sl;Xa.exports.addHook=OV;Xa.exports.removeHook=NV;Xa.exports.createAddHookMessageChannel=LSe});var fA=m(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.isWrapped=ss.safeExecuteInTheMiddleAsync=ss.safeExecuteInTheMiddle=void 0;function xSe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ss.safeExecuteInTheMiddle=xSe;async function DSe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ss.safeExecuteInTheMiddleAsync=DSe;function USe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}ss.isWrapped=USe});var IV=m(Ef=>{"use strict";Object.defineProperty(Ef,"__esModule",{value:!0});Ef.InstrumentationBase=void 0;var Tl=require("path"),CV=require("util"),wSe=Ph(),mA=kh(),kSe=Sk(),VSe=fV(),BSe=mf(),gl=(L(),I(V)),GSe=aA(),HSe=require("fs"),FSe=fA(),EA=class extends kSe.InstrumentationAbstract{constructor(e,n,r){super(e,n,r),this._hooks=[],this._requireInTheMiddleSingleton=VSe.RequireInTheMiddleSingleton.getInstance(),this._enabled=!1,this._wrap=(s,i,a)=>{if((0,FSe.isWrapped)(s[i])&&this._unwrap(s,i),CV.types.isProxy(s)){let c=(0,mA.wrap)(Object.assign({},s),i,a);return Object.defineProperty(s,i,{value:c}),c}else return(0,mA.wrap)(s,i,a)},this._unwrap=(s,i)=>CV.types.isProxy(s)?Object.defineProperty(s,i,{value:s[i]}):(0,mA.unwrap)(s,i),this._massWrap=(s,i,a)=>{if(s)Array.isArray(s)||(s=[s]);else{gl.diag.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){gl.diag.error("must provide one or more functions to wrap on modules");return}s.forEach(c=>{i.forEach(u=>{this._wrap(c,u,a)})})},this._massUnwrap=(s,i)=>{if(s)Array.isArray(s)||(s=[s]);else{gl.diag.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){gl.diag.error("must provide one or more functions to wrap on modules");return}s.forEach(a=>{i.forEach(c=>{this._unwrap(a,c)})})};let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,HSe.readFileSync)(Tl.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{gl.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){var s;if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let i=this._extractPackageVersion(o);if(e.moduleVersion=i,e.name===r)return vV(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let a=(s=e.files)!==null&&s!==void 0?s:[],c=Tl.normalize(r);return a.filter(l=>l.name===c).filter(l=>vV(l.supportedVersions,i,e.includePrerelease)).reduce((l,d)=>(d.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:d.name,baseDir:o}),d.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Tl.isAbsolute(a)){let u=Tl.parse(a);a=u.name,c=u.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Tl.isAbsolute(e.name)?new GSe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new BSe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};Ef.InstrumentationBase=EA;function vV(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,wSe.satisfies)(e,r,{includePrerelease:n}))}});var PV=m(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.normalize=void 0;var $Se=require("path");Object.defineProperty(Sf,"normalize",{enumerable:!0,get:function(){return $Se.normalize}})});var bV=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.normalize=Ja.InstrumentationBase=void 0;var jSe=IV();Object.defineProperty(Ja,"InstrumentationBase",{enumerable:!0,get:function(){return jSe.InstrumentationBase}});var qSe=PV();Object.defineProperty(Ja,"normalize",{enumerable:!0,get:function(){return qSe.normalize}})});var SA=m(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.normalize=Za.InstrumentationBase=void 0;var MV=bV();Object.defineProperty(Za,"InstrumentationBase",{enumerable:!0,get:function(){return MV.InstrumentationBase}});Object.defineProperty(Za,"normalize",{enumerable:!0,get:function(){return MV.normalize}})});var LV=m(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.InstrumentationNodeModuleDefinition=void 0;var TA=class{constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};Tf.InstrumentationNodeModuleDefinition=TA});var xV=m(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.InstrumentationNodeModuleFile=void 0;var YSe=SA(),gA=class{constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,YSe.normalize)(e)}};gf.InstrumentationNodeModuleFile=gA});var de=m(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.safeExecuteInTheMiddleAsync=Ht.safeExecuteInTheMiddle=Ht.isWrapped=Ht.InstrumentationNodeModuleFile=Ht.InstrumentationNodeModuleDefinition=Ht.InstrumentationBase=Ht.registerInstrumentations=void 0;var KSe=_k();Object.defineProperty(Ht,"registerInstrumentations",{enumerable:!0,get:function(){return KSe.registerInstrumentations}});var WSe=SA();Object.defineProperty(Ht,"InstrumentationBase",{enumerable:!0,get:function(){return WSe.InstrumentationBase}});var zSe=LV();Object.defineProperty(Ht,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return zSe.InstrumentationNodeModuleDefinition}});var XSe=xV();Object.defineProperty(Ht,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return XSe.InstrumentationNodeModuleFile}});var hA=fA();Object.defineProperty(Ht,"isWrapped",{enumerable:!0,get:function(){return hA.isWrapped}});Object.defineProperty(Ht,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return hA.safeExecuteInTheMiddle}});Object.defineProperty(Ht,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return hA.safeExecuteInTheMiddleAsync}})});var DV=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.AttributeNames=void 0;var JSe;(function(t){t.HTTP_ERROR_NAME="http.error_name",t.HTTP_ERROR_MESSAGE="http.error_message",t.HTTP_STATUS_TEXT="http.status_text"})(JSe=hl.AttributeNames||(hl.AttributeNames={}))});var wV=m((UKe,UV)=>{"use strict";var ZSe=require("util");function AA(t,e){Error.captureStackTrace(this,AA),this.name=this.constructor.name,this.message=t,this.input=e}ZSe.inherits(AA,Error);UV.exports=AA});var VV=m((wKe,kV)=>{"use strict";function QSe(t){return t===34||t===40||t===41||t===44||t===47||t>=58&&t<=64||t>=91&&t<=93||t===123||t===125}function eTe(t){return t===33||t>=35&&t<=39||t===42||t===43||t===45||t===46||t>=48&&t<=57||t>=65&&t<=90||t>=94&&t<=122||t===124||t===126}function tTe(t){return t>=32&&t<=126}function nTe(t){return t>=128&&t<=255}kV.exports={isDelimiter:QSe,isTokenChar:eTe,isExtended:nTe,isPrint:tTe}});var $V=m((kKe,FV)=>{"use strict";var rTe=require("util"),Qa=wV(),hf=VV(),oTe=hf.isDelimiter,BV=hf.isTokenChar,GV=hf.isExtended,sTe=hf.isPrint;function HV(t){return t.replace(/\\(.)/g,"$1")}function Al(t,e){return rTe.format("Unexpected character '%s' at index %d",t.charAt(e),e)}function iTe(t){for(var e=!1,n=!1,r=!1,o={},s=[],i=-1,a=-1,c,u,l=0;l<t.length;l++)if(u=t.charCodeAt(l),c===void 0){if(l!==0&&i===-1&&(u===32||u===9))continue;if(BV(u))i===-1&&(i=l);else if(u===61&&i!==-1)c=t.slice(i,l).toLowerCase(),i=-1;else throw new Qa(Al(t,l),t)}else if(n&&(u===9||sTe(u)||GV(u)))n=!1;else if(BV(u)){if(a!==-1)throw new Qa(Al(t,l),t);i===-1&&(i=l)}else if(oTe(u)||GV(u))if(r)u===34?(r=!1,a=l):u===92?(i===-1&&(i=l),n=e=!0):i===-1&&(i=l);else if(u===34&&t.charCodeAt(l-1)===61)r=!0;else if((u===44||u===59)&&(i!==-1||a!==-1))i!==-1?(a===-1&&(a=l),o[c]=e?HV(t.slice(i,a)):t.slice(i,a)):o[c]="",u===44&&(s.push(o),o={}),c=void 0,i=a=-1;else throw new Qa(Al(t,l),t);else if(u===32||u===9){if(a!==-1)continue;if(r)i===-1&&(i=l);else if(i!==-1)a=l;else throw new Qa(Al(t,l),t)}else throw new Qa(Al(t,l),t);if(c===void 0||r||i===-1&&a===-1||u===32||u===9)throw new Qa("Unexpected end of input",t);return i!==-1?(a===-1&&(a=l),o[c]=e?HV(t.slice(i,a)):t.slice(i,a)):o[c]="",s.push(o),s}FV.exports=iTe});var zV=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.headerCapture=$.getIncomingStableRequestMetricAttributesOnResponse=$.getIncomingRequestMetricAttributesOnResponse=$.getIncomingRequestAttributesOnResponse=$.getIncomingRequestMetricAttributes=$.getIncomingRequestAttributes=$.getRemoteClientAddress=$.getOutgoingRequestMetricAttributesOnResponse=$.getOutgoingRequestAttributesOnResponse=$.setAttributesFromHttpKind=$.getOutgoingRequestMetricAttributes=$.getOutgoingRequestAttributes=$.extractHostnameAndPort=$.isValidOptionsType=$.getRequestInfo=$.isCompressed=$.setResponseContentLengthAttribute=$.setRequestContentLengthAttribute=$.setSpanWithError=$.satisfiesPattern=$.parseResponseStatus=$.getAbsoluteUrl=void 0;var Rl=(L(),I(V)),b=(Vn(),I(kn)),jV=fe(),aTe=require("url"),Af=DV(),cTe=$V(),uTe=(t,e,n="http:")=>{let r=t||{},o=r.protocol||n,s=(r.port||"").toString(),i=r.path||"/",a=r.host||r.hostname||e.host||"localhost";return a.indexOf(":")===-1&&s&&s!=="80"&&s!=="443"&&(a+=`:${s}`),`${o}//${a}${i}`};$.getAbsoluteUrl=uTe;var lTe=(t,e)=>{let n=t===Rl.SpanKind.CLIENT?400:500;return e&&e>=100&&e<n?Rl.SpanStatusCode.UNSET:Rl.SpanStatusCode.ERROR};$.parseResponseStatus=lTe;var dTe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")};$.satisfiesPattern=dTe;var pTe=(t,e,n)=>{let r=e.message;(n&2)===2&&(t.setAttribute(Af.AttributeNames.HTTP_ERROR_NAME,e.name),t.setAttribute(Af.AttributeNames.HTTP_ERROR_MESSAGE,r)),(n&1)===1&&t.setAttribute(b.ATTR_ERROR_TYPE,e.name),t.setStatus({code:Rl.SpanStatusCode.ERROR,message:r}),t.recordException(e)};$.setSpanWithError=pTe;var _Te=(t,e)=>{let n=qV(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[b.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH]=n:e[b.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setRequestContentLengthAttribute=_Te;var fTe=(t,e)=>{let n=qV(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[b.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH]=n:e[b.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setResponseContentLengthAttribute=fTe;function qV(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}var mTe=t=>{let e=t["content-encoding"];return!!e&&e!=="identity"};$.isCompressed=mTe;function ETe(t){let{hostname:e,pathname:n,port:r,username:o,password:s,search:i,protocol:a,hash:c,href:u,origin:l,host:d}=new URL(t),p={protocol:a,hostname:e&&e[0]==="["?e.slice(1,-1):e,hash:c,search:i,pathname:n,path:`${n||""}${i||""}`,href:u,origin:l,host:d};return r!==""&&(p.port=Number(r)),(o||s)&&(p.auth=`${decodeURIComponent(o)}:${decodeURIComponent(s)}`),p}var STe=(t,e,n)=>{let r,o,s,i=!1;if(typeof e=="string"){try{let c=ETe(e);s=c,r=c.pathname||"/"}catch(c){i=!0,t.verbose("Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:",c),s={path:e},r=s.path||"/"}o=`${s.protocol||"http:"}//${s.host}`,n!==void 0&&Object.assign(s,n)}else if(e instanceof aTe.URL)s={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,path:`${e.pathname||""}${e.search||""}`},e.port!==""&&(s.port=Number(e.port)),(e.username||e.password)&&(s.auth=`${e.username}:${e.password}`),r=e.pathname,o=e.origin,n!==void 0&&Object.assign(s,n);else{s=Object.assign({protocol:e.host?"http:":void 0},e);let c=s.host||(s.port!=null?`${s.hostname}${s.port}`:s.hostname);if(o=`${s.protocol||"http:"}//${c}`,r=e.pathname,!r&&s.path)try{r=new URL(s.path,o).pathname||"/"}catch{r="/"}}let a=s.method?s.method.toUpperCase():"GET";return{origin:o,pathname:r,method:a,optionsParsed:s,invalidUrl:i}};$.getRequestInfo=STe;var TTe=t=>{if(!t)return!1;let e=typeof t;return e==="string"||e==="object"&&!Array.isArray(t)};$.isValidOptionsType=TTe;var gTe=t=>{var e;if(t.hostname&&t.port)return{hostname:t.hostname,port:t.port};let n=((e=t.host)===null||e===void 0?void 0:e.match(/^([^:/ ]+)(:\d{1,5})?/))||null,r=t.hostname||(n===null?"localhost":n[1]),o=t.port;return o||(n&&n[2]?o=n[2].substring(1):o=t.protocol==="https:"?"443":"80"),{hostname:r,port:o}};$.extractHostnameAndPort=gTe;var hTe=(t,e,n)=>{var r,o;let s=e.hostname,i=e.port,a=(r=t.method)!==null&&r!==void 0?r:"GET",c=KV(a),u=t.headers||{},l=u["user-agent"],d=(0,$.getAbsoluteUrl)(t,u,`${e.component}:`),p={[b.SEMATTRS_HTTP_URL]:d,[b.SEMATTRS_HTTP_METHOD]:a,[b.SEMATTRS_HTTP_TARGET]:t.path||"/",[b.SEMATTRS_NET_PEER_NAME]:s,[b.SEMATTRS_HTTP_HOST]:(o=u.host)!==null&&o!==void 0?o:`${s}:${i}`},_={[b.ATTR_HTTP_REQUEST_METHOD]:c,[b.ATTR_SERVER_ADDRESS]:s,[b.ATTR_SERVER_PORT]:Number(i),[b.ATTR_URL_FULL]:d};switch(a!==c&&(_[b.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=a),l!==void 0&&(p[b.SEMATTRS_HTTP_USER_AGENT]=l),n){case 1:return Object.assign(_,e.hookAttributes);case 2:return Object.assign(p,e.hookAttributes)}return Object.assign(p,_,e.hookAttributes)};$.getOutgoingRequestAttributes=hTe;var ATe=t=>{let e={};return e[b.SEMATTRS_HTTP_METHOD]=t[b.SEMATTRS_HTTP_METHOD],e[b.SEMATTRS_NET_PEER_NAME]=t[b.SEMATTRS_NET_PEER_NAME],e};$.getOutgoingRequestMetricAttributes=ATe;var RTe=(t,e)=>{t&&(e[b.SEMATTRS_HTTP_FLAVOR]=t,t.toUpperCase()!=="QUIC"?e[b.SEMATTRS_NET_TRANSPORT]=b.NETTRANSPORTVALUES_IP_TCP:e[b.SEMATTRS_NET_TRANSPORT]=b.NETTRANSPORTVALUES_IP_UDP)};$.setAttributesFromHttpKind=RTe;var yTe=(t,e)=>{let{statusCode:n,statusMessage:r,httpVersion:o,socket:s}=t,i={},a={};if(n!=null&&(a[b.ATTR_HTTP_RESPONSE_STATUS_CODE]=n),s){let{remoteAddress:c,remotePort:u}=s;i[b.SEMATTRS_NET_PEER_IP]=c,i[b.SEMATTRS_NET_PEER_PORT]=u,a[b.ATTR_NETWORK_PEER_ADDRESS]=c,a[b.ATTR_NETWORK_PEER_PORT]=u,a[b.ATTR_NETWORK_PROTOCOL_VERSION]=t.httpVersion}switch((0,$.setResponseContentLengthAttribute)(t,i),n&&(i[b.SEMATTRS_HTTP_STATUS_CODE]=n,i[Af.AttributeNames.HTTP_STATUS_TEXT]=(r||"").toUpperCase()),(0,$.setAttributesFromHttpKind)(o,i),e){case 1:return a;case 2:return i}return Object.assign(i,a)};$.getOutgoingRequestAttributesOnResponse=yTe;var OTe=t=>{let e={};return e[b.SEMATTRS_NET_PEER_PORT]=t[b.SEMATTRS_NET_PEER_PORT],e[b.SEMATTRS_HTTP_STATUS_CODE]=t[b.SEMATTRS_HTTP_STATUS_CODE],e[b.SEMATTRS_HTTP_FLAVOR]=t[b.SEMATTRS_HTTP_FLAVOR],e};$.getOutgoingRequestMetricAttributesOnResponse=OTe;function is(t,e){let n=t.split(":");if(n.length===1)return e==="http"?{host:n[0],port:"80"}:e==="https"?{host:n[0],port:"443"}:{host:n[0]};if(n.length===2)return{host:n[0],port:n[1]};if(n[0].startsWith("[")){if(n[n.length-1].endsWith("]")){if(e==="http")return{host:t,port:"80"};if(e==="https")return{host:t,port:"443"}}else if(n[n.length-2].endsWith("]"))return{host:n.slice(0,-1).join(":"),port:n[n.length-1]}}return{host:t}}function NTe(t,e){let n=t.headers.forwarded;if(n){for(let s of WV(n))if(s.host)return is(s.host,s.proto)}let r=t.headers["x-forwarded-host"];if(typeof r=="string")return typeof t.headers["x-forwarded-proto"]=="string"?is(r,t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?is(r,t.headers["x-forwarded-proto"][0]):is(r);if(Array.isArray(r)&&typeof r[0]=="string"&&r[0].length>0)return typeof t.headers["x-forwarded-proto"]=="string"?is(r[0],t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?is(r[0],t.headers["x-forwarded-proto"][0]):is(r[0]);let o=t.headers.host;return typeof o=="string"&&o.length>0?is(o,e):null}function YV(t){let e=t.headers.forwarded;if(e){for(let o of WV(e))if(o.for)return o.for}let n=t.headers["x-forwarded-for"];if(typeof n=="string")return n;if(Array.isArray(n))return n[0];let r=t.socket.remoteAddress;return r||null}$.getRemoteClientAddress=YV;function CTe(t,e,n){var r,o;try{if(e.headers.host)return new URL((r=e.url)!==null&&r!==void 0?r:"/",`${t}://${e.headers.host}`);{let s=new URL((o=e.url)!==null&&o!==void 0?o:"/",`${t}://localhost`);return{pathname:s.pathname,search:s.search,toString:function(){return s.pathname+s.search}}}}catch(s){return n.verbose("Unable to get URL from request",s),{}}}var vTe=(t,e,n)=>{let r=t.headers,o=r["user-agent"],s=r["x-forwarded-for"],i=t.httpVersion,a=r.host,c=a?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",u=t.method,l=KV(u),d=NTe(t,e.component),p=e.serverName,_=YV(t),f={[b.ATTR_HTTP_REQUEST_METHOD]:l,[b.ATTR_URL_SCHEME]:e.component,[b.ATTR_SERVER_ADDRESS]:d?.host,[b.ATTR_NETWORK_PEER_ADDRESS]:t.socket.remoteAddress,[b.ATTR_NETWORK_PEER_PORT]:t.socket.remotePort,[b.ATTR_NETWORK_PROTOCOL_VERSION]:t.httpVersion,[b.ATTR_USER_AGENT_ORIGINAL]:o},E=CTe(e.component,t,n);E?.pathname!=null&&(f[b.ATTR_URL_PATH]=E.pathname),_!=null&&(f[b.ATTR_CLIENT_ADDRESS]=_),d?.port!=null&&(f[b.ATTR_SERVER_PORT]=Number(d.port)),u!==l&&(f[b.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=u);let S={[b.SEMATTRS_HTTP_URL]:E.toString(),[b.SEMATTRS_HTTP_HOST]:a,[b.SEMATTRS_NET_HOST_NAME]:c,[b.SEMATTRS_HTTP_METHOD]:u,[b.SEMATTRS_HTTP_SCHEME]:e.component};switch(typeof s=="string"&&(S[b.SEMATTRS_HTTP_CLIENT_IP]=s.split(",")[0]),typeof p=="string"&&(S[b.SEMATTRS_HTTP_SERVER_NAME]=p),E?.pathname&&(S[b.SEMATTRS_HTTP_TARGET]=E?.pathname+E?.search||"/"),o!==void 0&&(S[b.SEMATTRS_HTTP_USER_AGENT]=o),(0,$.setRequestContentLengthAttribute)(t,S),(0,$.setAttributesFromHttpKind)(i,S),e.semconvStability){case 1:return Object.assign(f,e.hookAttributes);case 2:return Object.assign(S,e.hookAttributes)}return Object.assign(S,f,e.hookAttributes)};$.getIncomingRequestAttributes=vTe;var ITe=t=>{let e={};return e[b.SEMATTRS_HTTP_SCHEME]=t[b.SEMATTRS_HTTP_SCHEME],e[b.SEMATTRS_HTTP_METHOD]=t[b.SEMATTRS_HTTP_METHOD],e[b.SEMATTRS_NET_HOST_NAME]=t[b.SEMATTRS_NET_HOST_NAME],e[b.SEMATTRS_HTTP_FLAVOR]=t[b.SEMATTRS_HTTP_FLAVOR],e};$.getIncomingRequestMetricAttributes=ITe;var PTe=(t,e,n)=>{let{socket:r}=t,{statusCode:o,statusMessage:s}=e,i={[b.ATTR_HTTP_RESPONSE_STATUS_CODE]:o},a=(0,jV.getRPCMetadata)(Rl.context.active()),c={};if(r){let{localAddress:u,localPort:l,remoteAddress:d,remotePort:p}=r;c[b.SEMATTRS_NET_HOST_IP]=u,c[b.SEMATTRS_NET_HOST_PORT]=l,c[b.SEMATTRS_NET_PEER_IP]=d,c[b.SEMATTRS_NET_PEER_PORT]=p}switch(c[b.SEMATTRS_HTTP_STATUS_CODE]=o,c[Af.AttributeNames.HTTP_STATUS_TEXT]=(s||"").toUpperCase(),a?.type===jV.RPCType.HTTP&&a.route!==void 0&&(c[b.SEMATTRS_HTTP_ROUTE]=a.route,i[b.ATTR_HTTP_ROUTE]=a.route),n){case 1:return i;case 2:return c}return Object.assign(c,i)};$.getIncomingRequestAttributesOnResponse=PTe;var bTe=t=>{let e={};return e[b.SEMATTRS_HTTP_STATUS_CODE]=t[b.SEMATTRS_HTTP_STATUS_CODE],e[b.SEMATTRS_NET_HOST_PORT]=t[b.SEMATTRS_NET_HOST_PORT],t[b.SEMATTRS_HTTP_ROUTE]!==void 0&&(e[b.SEMATTRS_HTTP_ROUTE]=t[b.SEMATTRS_HTTP_ROUTE]),e};$.getIncomingRequestMetricAttributesOnResponse=bTe;var MTe=t=>{let e={};return t[b.ATTR_HTTP_ROUTE]!==void 0&&(e[b.ATTR_HTTP_ROUTE]=t[b.SEMATTRS_HTTP_ROUTE]),t[b.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[b.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[b.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getIncomingStableRequestMetricAttributesOnResponse=MTe;function LTe(t,e){let n=new Map;for(let r=0,o=e.length;r<o;r++){let s=e[r].toLowerCase();n.set(s,s.replace(/-/g,"_"))}return(r,o)=>{for(let s of n.keys()){let i=o(s);if(i===void 0)continue;let a=n.get(s),c=`http.${t}.header.${a}`;typeof i=="string"?r.setAttribute(c,[i]):Array.isArray(i)?r.setAttribute(c,i):r.setAttribute(c,[i])}}}$.headerCapture=LTe;var xTe=new Set(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]);function KV(t){if(t==null)return"GET";let e=t.toUpperCase();return xTe.has(e)?e:"_OTHER"}function WV(t){try{return cTe(t)}catch{return[]}}});var JV=m(Rf=>{"use strict";Object.defineProperty(Rf,"__esModule",{value:!0});Rf.HttpInstrumentation=void 0;var z=(L(),I(V)),ec=fe(),XV=Ph(),DTe=require("url"),UTe=ek(),jn=de(),RA=fe(),yA=require("events"),He=(Vn(),I(kn)),we=zV(),OA=class extends jn.InstrumentationBase{constructor(e={}){super("@opentelemetry/instrumentation-http",UTe.VERSION,e),this._spanNotEnded=new WeakSet,this._semconvStability=2,this._headerCapture=this._createHeaderCapture();for(let n of(0,RA.getEnv)().OTEL_SEMCONV_STABILITY_OPT_IN)if(n.toLowerCase()==="http/dup"){this._semconvStability=3;break}else n.toLowerCase()==="http"&&(this._semconvStability=1)}_updateMetricInstruments(){this._oldHttpServerDurationHistogram=this.meter.createHistogram("http.server.duration",{description:"Measures the duration of inbound HTTP requests.",unit:"ms",valueType:z.ValueType.DOUBLE}),this._oldHttpClientDurationHistogram=this.meter.createHistogram("http.client.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"ms",valueType:z.ValueType.DOUBLE}),this._stableHttpServerDurationHistogram=this.meter.createHistogram(He.METRIC_HTTP_SERVER_REQUEST_DURATION,{description:"Duration of HTTP server requests.",unit:"s",valueType:z.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}}),this._stableHttpClientDurationHistogram=this.meter.createHistogram(He.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Duration of HTTP client requests.",unit:"s",valueType:z.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}_recordServerDuration(e,n,r){(this._semconvStability&2)===2&&this._oldHttpServerDurationHistogram.record(e,n),(this._semconvStability&1)===1&&this._stableHttpServerDurationHistogram.record(e/1e3,r)}_recordClientDuration(e,n,r){(this._semconvStability&2)===2&&this._oldHttpClientDurationHistogram.record(e,n),(this._semconvStability&1)===1&&this._stableHttpClientDurationHistogram.record(e/1e3,r)}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture()}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new jn.InstrumentationNodeModuleDefinition("http",["*"],e=>{let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchOutgoingRequestFunction("http")),o=this._wrap(e,"get",this._getPatchOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("http")),e},e=>{e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getHttpsInstrumentation(){return new jn.InstrumentationNodeModuleDefinition("https",["*"],e=>{let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchHttpsOutgoingRequestFunction("https")),o=this._wrap(e,"get",this._getPatchHttpsOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("https")),e},e=>{e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getPatchIncomingRequestFunction(e){return n=>this._incomingRequestFunction(e,n)}_getPatchOutgoingRequestFunction(e){return n=>this._outgoingRequestFunction(e,n)}_getPatchOutgoingGetFunction(e){return n=>function(o,...s){let i=e(o,...s);return i.end(),i}}_getPatchHttpsOutgoingRequestFunction(e){return n=>{let r=this;return function(s,...i){var a;return e==="https"&&typeof s=="object"&&((a=s?.constructor)===null||a===void 0?void 0:a.name)!=="URL"&&(s=Object.assign({},s),r._setDefaultOptions(s)),r._getPatchOutgoingRequestFunction(e)(n)(s,...i)}}}_setDefaultOptions(e){e.protocol=e.protocol||"https:",e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return n=>{let r=this;return function(s,...i){return r._getPatchOutgoingGetFunction(e)(n)(s,...i)}}}_traceClientRequest(e,n,r,o,s){this.getConfig().requestHook&&this._callRequestHook(n,e);let i=!1;return e.prependListener("response",a=>{this._diag.debug("outgoingRequest on response()"),e.listenerCount("response")<=1&&a.resume();let c=(0,we.getOutgoingRequestAttributesOnResponse)(a,this._semconvStability);n.setAttributes(c),o=Object.assign(o,(0,we.getOutgoingRequestMetricAttributesOnResponse)(c)),this.getConfig().responseHook&&this._callResponseHook(n,a),this._headerCapture.client.captureRequestHeaders(n,l=>e.getHeader(l)),this._headerCapture.client.captureResponseHeaders(n,l=>a.headers[l]),z.context.bind(z.context.active(),a);let u=()=>{if(this._diag.debug("outgoingRequest on end()"),i)return;i=!0;let l;a.aborted&&!a.complete?l={code:z.SpanStatusCode.ERROR}:l={code:(0,we.parseResponseStatus)(z.SpanKind.CLIENT,a.statusCode)},n.setStatus(l),this.getConfig().applyCustomAttributesOnSpan&&(0,jn.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,a),()=>{},!0),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s)};a.on("end",u),XV.lt(process.version,"16.0.0")&&a.on("close",u),a.on(yA.errorMonitor,l=>{this._diag.debug("outgoingRequest on error()",l),!i&&(i=!0,(0,we.setSpanWithError)(n,l,this._semconvStability),n.setStatus({code:z.SpanStatusCode.ERROR,message:l.message}),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))})}),e.on("close",()=>{this._diag.debug("outgoingRequest on request close()"),!(e.aborted||i)&&(i=!0,this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))}),e.on(yA.errorMonitor,a=>{this._diag.debug("outgoingRequest on request error()",a),!i&&(i=!0,(0,we.setSpanWithError)(n,a,this._semconvStability),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))}),this._diag.debug("http.ClientRequest return request"),e}_incomingRequestFunction(e,n){let r=this;return function(s,...i){if(s!=="request")return n.apply(this,[s,...i]);let a=i[0],c=i[1],u=a.method||"GET";if(r._diag.debug(`${e} instrumentation incomingRequest`),(0,jn.safeExecuteInTheMiddle)(()=>{var O,N;return(N=(O=r.getConfig()).ignoreIncomingRequestHook)===null||N===void 0?void 0:N.call(O,a)},O=>{O!=null&&r._diag.error("caught ignoreIncomingRequestHook error: ",O)},!0))return z.context.with((0,ec.suppressTracing)(z.context.active()),()=>(z.context.bind(z.context.active(),a),z.context.bind(z.context.active(),c),n.apply(this,[s,...i])));let l=a.headers,d=(0,we.getIncomingRequestAttributes)(a,{component:e,serverName:r.getConfig().serverName,hookAttributes:r._callStartSpanHook(a,r.getConfig().startIncomingSpanHook),semconvStability:r._semconvStability},r._diag),p={kind:z.SpanKind.SERVER,attributes:d},_=(0,ec.hrTime)(),f=(0,we.getIncomingRequestMetricAttributes)(d),E={[He.ATTR_HTTP_REQUEST_METHOD]:d[He.ATTR_HTTP_REQUEST_METHOD],[He.ATTR_URL_SCHEME]:d[He.ATTR_URL_SCHEME]};d[He.ATTR_NETWORK_PROTOCOL_VERSION]&&(E[He.ATTR_NETWORK_PROTOCOL_VERSION]=d[He.ATTR_NETWORK_PROTOCOL_VERSION]);let S=z.propagation.extract(z.ROOT_CONTEXT,l),g=r._startHttpSpan(u,p,S),h={type:RA.RPCType.HTTP,span:g};return z.context.with((0,RA.setRPCMetadata)(z.trace.setSpan(S,g),h),()=>{z.context.bind(z.context.active(),a),z.context.bind(z.context.active(),c),r.getConfig().requestHook&&r._callRequestHook(g,a),r.getConfig().responseHook&&r._callResponseHook(g,c),r._headerCapture.server.captureRequestHeaders(g,N=>a.headers[N]);let O=!1;return c.on("close",()=>{O||r._onServerResponseFinish(a,c,g,f,E,_)}),c.on(yA.errorMonitor,N=>{O=!0,r._onServerResponseError(g,f,E,_,N)}),(0,jn.safeExecuteInTheMiddle)(()=>n.apply(this,[s,...i]),N=>{if(N)throw(0,we.setSpanWithError)(g,N,r._semconvStability),r._closeHttpSpan(g,z.SpanKind.SERVER,_,f,E),N})})}}_outgoingRequestFunction(e,n){let r=this;return function(s,...i){if(!(0,we.isValidOptionsType)(s))return n.apply(this,[s,...i]);let a=typeof i[0]=="object"&&(typeof s=="string"||s instanceof DTe.URL)?i.shift():void 0,{method:c,invalidUrl:u,optionsParsed:l}=(0,we.getRequestInfo)(r._diag,s,a);if(e==="http"&&XV.lt(process.version,"9.0.0")&&l.protocol==="https:")return n.apply(this,[l,...i]);if((0,jn.safeExecuteInTheMiddle)(()=>{var R,M;return(M=(R=r.getConfig()).ignoreOutgoingRequestHook)===null||M===void 0?void 0:M.call(R,l)},R=>{R!=null&&r._diag.error("caught ignoreOutgoingRequestHook error: ",R)},!0))return n.apply(this,[l,...i]);let{hostname:d,port:p}=(0,we.extractHostnameAndPort)(l),_=(0,we.getOutgoingRequestAttributes)(l,{component:e,port:p,hostname:d,hookAttributes:r._callStartSpanHook(l,r.getConfig().startOutgoingSpanHook)},r._semconvStability),f=(0,ec.hrTime)(),E=(0,we.getOutgoingRequestMetricAttributes)(_),S={[He.ATTR_HTTP_REQUEST_METHOD]:_[He.ATTR_HTTP_REQUEST_METHOD],[He.ATTR_SERVER_ADDRESS]:_[He.ATTR_SERVER_ADDRESS],[He.ATTR_SERVER_PORT]:_[He.ATTR_SERVER_PORT]};_[He.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(S[He.ATTR_HTTP_RESPONSE_STATUS_CODE]=_[He.ATTR_HTTP_RESPONSE_STATUS_CODE]),_[He.ATTR_NETWORK_PROTOCOL_VERSION]&&(S[He.ATTR_NETWORK_PROTOCOL_VERSION]=_[He.ATTR_NETWORK_PROTOCOL_VERSION]);let g={kind:z.SpanKind.CLIENT,attributes:_},h=r._startHttpSpan(c,g),O=z.context.active(),N=z.trace.setSpan(O,h);return l.headers?l.headers=Object.assign({},l.headers):l.headers={},z.propagation.inject(N,l.headers),z.context.with(N,()=>{let R=i[i.length-1];typeof R=="function"&&(i[i.length-1]=z.context.bind(O,R));let M=(0,jn.safeExecuteInTheMiddle)(()=>u?n.apply(this,[s,...i]):n.apply(this,[l,...i]),P=>{if(P)throw(0,we.setSpanWithError)(h,P,r._semconvStability),r._closeHttpSpan(h,z.SpanKind.CLIENT,f,E,S),P});return r._diag.debug(`${e} instrumentation outgoingRequest`),z.context.bind(O,M),r._traceClientRequest(M,h,f,E,S)})}}_onServerResponseFinish(e,n,r,o,s,i){let a=(0,we.getIncomingRequestAttributesOnResponse)(e,n,this._semconvStability);o=Object.assign(o,(0,we.getIncomingRequestMetricAttributesOnResponse)(a)),s=Object.assign(s,(0,we.getIncomingStableRequestMetricAttributesOnResponse)(a)),this._headerCapture.server.captureResponseHeaders(r,u=>n.getHeader(u)),r.setAttributes(a).setStatus({code:(0,we.parseResponseStatus)(z.SpanKind.SERVER,n.statusCode)});let c=a[He.SEMATTRS_HTTP_ROUTE];c&&r.updateName(`${e.method||"GET"} ${c}`),this.getConfig().applyCustomAttributesOnSpan&&(0,jn.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(r,e,n),()=>{},!0),this._closeHttpSpan(r,z.SpanKind.SERVER,i,o,s)}_onServerResponseError(e,n,r,o,s){(0,we.setSpanWithError)(e,s,this._semconvStability),this._closeHttpSpan(e,z.SpanKind.SERVER,o,n,r)}_startHttpSpan(e,n,r=z.context.active()){let o=n.kind===z.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,s,i=z.trace.getSpan(r);return o===!0&&i===void 0?s=z.trace.wrapSpanContext(z.INVALID_SPAN_CONTEXT):o===!0&&i?.spanContext().isRemote?s=i:s=this.tracer.startSpan(e,n,r),this._spanNotEnded.add(s),s}_closeHttpSpan(e,n,r,o,s){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let i=(0,ec.hrTimeToMilliseconds)((0,ec.hrTimeDuration)(r,(0,ec.hrTime)()));n===z.SpanKind.SERVER?this._recordServerDuration(i,o,s):n===z.SpanKind.CLIENT&&this._recordClientDuration(i,o,s)}_callResponseHook(e,n){(0,jn.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,n),()=>{},!0)}_callRequestHook(e,n){(0,jn.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,n),()=>{},!0)}_callStartSpanHook(e,n){if(typeof n=="function")return(0,jn.safeExecuteInTheMiddle)(()=>n(e),()=>{},!0)}_createHeaderCapture(){var e,n,r,o,s,i,a,c,u,l,d,p;let _=this.getConfig();return{client:{captureRequestHeaders:(0,we.headerCapture)("request",(r=(n=(e=_.headersToSpanAttributes)===null||e===void 0?void 0:e.client)===null||n===void 0?void 0:n.requestHeaders)!==null&&r!==void 0?r:[]),captureResponseHeaders:(0,we.headerCapture)("response",(i=(s=(o=_.headersToSpanAttributes)===null||o===void 0?void 0:o.client)===null||s===void 0?void 0:s.responseHeaders)!==null&&i!==void 0?i:[])},server:{captureRequestHeaders:(0,we.headerCapture)("request",(u=(c=(a=_.headersToSpanAttributes)===null||a===void 0?void 0:a.server)===null||c===void 0?void 0:c.requestHeaders)!==null&&u!==void 0?u:[]),captureResponseHeaders:(0,we.headerCapture)("response",(p=(d=(l=_.headersToSpanAttributes)===null||l===void 0?void 0:l.server)===null||d===void 0?void 0:d.responseHeaders)!==null&&p!==void 0?p:[])}}}};Rf.HttpInstrumentation=OA});var ZV=m(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.HttpInstrumentation=void 0;var wTe=JV();Object.defineProperty(yf,"HttpInstrumentation",{enumerable:!0,get:function(){return wTe.HttpInstrumentation}})});function Qe(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var xR=B(()=>{});var yH,OH,NH,CH,vH,IH,PH,bH,MH,LH,xH,DH,UH,wH,kH,VH,BH,GH,HH,FH,$H,jH,qH,YH,KH,WH,zH,XH,JH,ZH,QH,eF,tF,nF,rF,oF,sF,iF,aF,cF,uF,lF,dF,pF,_F,fF,mF,EF,SF,TF,gF,hF,AF,RF,yF,OF,NF,CF,vF,IF,PF,bF,MF,LF,xF,DF,UF,wF,kF,VF,BF,GF,HF,FF,$F,jF,qF,YF,KF,WF,zF,XF,JF,ZF,QF,e$,t$,n$,r$,o$,s$,i$,a$,c$,u$,l$,d$,p$,_$,f$,m$,E$,S$,T$,g$,h$,A$,R$,y$,O$,N$,C$,v$,I$,P$,b$,M$,L$,x$,D$,U$,w$,k$,V$,B$,G$,H$,F$,TAe,DR,gAe,hAe,AAe,RAe,UR,yAe,OAe,NAe,CAe,vAe,IAe,PAe,bAe,MAe,LAe,xAe,DAe,UAe,wAe,kAe,VAe,BAe,GAe,wR,HAe,FAe,$Ae,jAe,qAe,YAe,KAe,WAe,zAe,XAe,JAe,ZAe,QAe,eRe,tRe,nRe,rRe,oRe,sRe,iRe,aRe,cRe,uRe,lRe,dRe,pRe,_Re,fRe,mRe,ERe,SRe,TRe,gRe,hRe,jl,gc,kR,ARe,RRe,Em,yRe,ORe,NRe,CRe,vRe,IRe,PRe,ql,bRe,MRe,LRe,xRe,DRe,URe,wRe,kRe,VRe,BRe,GRe,HRe,FRe,$Re,jRe,qRe,YRe,KRe,WRe,zRe,XRe,JRe,ZRe,VR,QRe,eye,tye,nye,rye,oye,sye,iye,aye,cye,uye,lye,dye,pye,_ye,fye,mye,Eye,Sye,BR,Tye,GR,gye,hye,Aye,Rye,yye,Oye,Nye,Cye,vye,$$,j$,q$,Y$,K$,W$,z$,X$,J$,Z$,Q$,ej,tj,nj,rj,oj,sj,ij,aj,cj,uj,lj,dj,pj,_j,fj,mj,Ej,Sj,Tj,gj,hj,Aj,Rj,yj,Oj,Nj,Cj,vj,Ij,Pj,bj,Mj,Lj,xj,Dj,Uj,Iye,Pye,bye,Mye,Lye,xye,Dye,Uye,wye,kye,Vye,Bye,Gye,Hye,Fye,$ye,jye,qye,Yye,Kye,Wye,zye,Xye,Jye,Zye,Qye,eOe,tOe,nOe,rOe,oOe,sOe,iOe,aOe,cOe,uOe,lOe,dOe,pOe,_Oe,fOe,mOe,EOe,SOe,TOe,gOe,hOe,AOe,wj,kj,Vj,Bj,Gj,Hj,Fj,$j,jj,qj,Yj,ROe,yOe,OOe,NOe,COe,vOe,IOe,POe,bOe,MOe,LOe,xOe,Kj,Wj,zj,Xj,Jj,DOe,UOe,wOe,kOe,VOe,BOe,Zj,Qj,eq,GOe,HOe,FOe,$Oe,tq,nq,rq,oq,jOe,qOe,YOe,KOe,WOe,sq,iq,aq,cq,uq,lq,dq,zOe,XOe,JOe,ZOe,QOe,eNe,tNe,nNe,pq,_q,fq,mq,Eq,rNe,oNe,sNe,iNe,aNe,cNe,Sq,Tq,gq,hq,Aq,Rq,yq,Oq,Nq,Cq,vq,Iq,Pq,bq,Mq,Lq,xq,Dq,Uq,wq,kq,uNe,lNe,dNe,pNe,_Ne,fNe,mNe,ENe,SNe,TNe,gNe,hNe,ANe,RNe,yNe,ONe,NNe,CNe,vNe,INe,PNe,bNe,Vq,Bq,Gq,Hq,Fq,MNe,LNe,xNe,DNe,UNe,wNe,$q,jq,kNe,VNe,BNe,qq,Yq,GNe,HNe,FNe,Kq,Wq,zq,Xq,Jq,Zq,Qq,eY,tY,nY,rY,oY,sY,iY,aY,cY,uY,$Ne,jNe,qNe,YNe,KNe,WNe,zNe,XNe,JNe,ZNe,QNe,eCe,tCe,nCe,rCe,oCe,sCe,iCe,lY,dY,aCe,cCe,uCe,pY=B(()=>{xR();yH="aws.lambda.invoked_arn",OH="db.system",NH="db.connection_string",CH="db.user",vH="db.jdbc.driver_classname",IH="db.name",PH="db.statement",bH="db.operation",MH="db.mssql.instance_name",LH="db.cassandra.keyspace",xH="db.cassandra.page_size",DH="db.cassandra.consistency_level",UH="db.cassandra.table",wH="db.cassandra.idempotence",kH="db.cassandra.speculative_execution_count",VH="db.cassandra.coordinator.id",BH="db.cassandra.coordinator.dc",GH="db.hbase.namespace",HH="db.redis.database_index",FH="db.mongodb.collection",$H="db.sql.table",jH="exception.type",qH="exception.message",YH="exception.stacktrace",KH="exception.escaped",WH="faas.trigger",zH="faas.execution",XH="faas.document.collection",JH="faas.document.operation",ZH="faas.document.time",QH="faas.document.name",eF="faas.time",tF="faas.cron",nF="faas.coldstart",rF="faas.invoked_name",oF="faas.invoked_provider",sF="faas.invoked_region",iF="net.transport",aF="net.peer.ip",cF="net.peer.port",uF="net.peer.name",lF="net.host.ip",dF="net.host.port",pF="net.host.name",_F="net.host.connection.type",fF="net.host.connection.subtype",mF="net.host.carrier.name",EF="net.host.carrier.mcc",SF="net.host.carrier.mnc",TF="net.host.carrier.icc",gF="peer.service",hF="enduser.id",AF="enduser.role",RF="enduser.scope",yF="thread.id",OF="thread.name",NF="code.function",CF="code.namespace",vF="code.filepath",IF="code.lineno",PF="http.method",bF="http.url",MF="http.target",LF="http.host",xF="http.scheme",DF="http.status_code",UF="http.flavor",wF="http.user_agent",kF="http.request_content_length",VF="http.request_content_length_uncompressed",BF="http.response_content_length",GF="http.response_content_length_uncompressed",HF="http.server_name",FF="http.route",$F="http.client_ip",jF="aws.dynamodb.table_names",qF="aws.dynamodb.consumed_capacity",YF="aws.dynamodb.item_collection_metrics",KF="aws.dynamodb.provisioned_read_capacity",WF="aws.dynamodb.provisioned_write_capacity",zF="aws.dynamodb.consistent_read",XF="aws.dynamodb.projection",JF="aws.dynamodb.limit",ZF="aws.dynamodb.attributes_to_get",QF="aws.dynamodb.index_name",e$="aws.dynamodb.select",t$="aws.dynamodb.global_secondary_indexes",n$="aws.dynamodb.local_secondary_indexes",r$="aws.dynamodb.exclusive_start_table",o$="aws.dynamodb.table_count",s$="aws.dynamodb.scan_forward",i$="aws.dynamodb.segment",a$="aws.dynamodb.total_segments",c$="aws.dynamodb.count",u$="aws.dynamodb.scanned_count",l$="aws.dynamodb.attribute_definitions",d$="aws.dynamodb.global_secondary_index_updates",p$="messaging.system",_$="messaging.destination",f$="messaging.destination_kind",m$="messaging.temp_destination",E$="messaging.protocol",S$="messaging.protocol_version",T$="messaging.url",g$="messaging.message_id",h$="messaging.conversation_id",A$="messaging.message_payload_size_bytes",R$="messaging.message_payload_compressed_size_bytes",y$="messaging.operation",O$="messaging.consumer_id",N$="messaging.rabbitmq.routing_key",C$="messaging.kafka.message_key",v$="messaging.kafka.consumer_group",I$="messaging.kafka.client_id",P$="messaging.kafka.partition",b$="messaging.kafka.tombstone",M$="rpc.system",L$="rpc.service",x$="rpc.method",D$="rpc.grpc.status_code",U$="rpc.jsonrpc.version",w$="rpc.jsonrpc.request_id",k$="rpc.jsonrpc.error_code",V$="rpc.jsonrpc.error_message",B$="message.type",G$="message.id",H$="message.compressed_size",F$="message.uncompressed_size",TAe=yH,DR=OH,gAe=NH,hAe=CH,AAe=vH,RAe=IH,UR=PH,yAe=bH,OAe=MH,NAe=LH,CAe=xH,vAe=DH,IAe=UH,PAe=wH,bAe=kH,MAe=VH,LAe=BH,xAe=GH,DAe=HH,UAe=FH,wAe=$H,kAe=jH,VAe=qH,BAe=YH,GAe=KH,wR=WH,HAe=zH,FAe=XH,$Ae=JH,jAe=ZH,qAe=QH,YAe=eF,KAe=tF,WAe=nF,zAe=rF,XAe=oF,JAe=sF,ZAe=iF,QAe=aF,eRe=cF,tRe=uF,nRe=lF,rRe=dF,oRe=pF,sRe=_F,iRe=fF,aRe=mF,cRe=EF,uRe=SF,lRe=TF,dRe=gF,pRe=hF,_Re=AF,fRe=RF,mRe=yF,ERe=OF,SRe=NF,TRe=CF,gRe=vF,hRe=IF,jl=PF,gc=bF,kR=MF,ARe=LF,RRe=xF,Em=DF,yRe=UF,ORe=wF,NRe=kF,CRe=VF,vRe=BF,IRe=GF,PRe=HF,ql=FF,bRe=$F,MRe=jF,LRe=qF,xRe=YF,DRe=KF,URe=WF,wRe=zF,kRe=XF,VRe=JF,BRe=ZF,GRe=QF,HRe=e$,FRe=t$,$Re=n$,jRe=r$,qRe=o$,YRe=s$,KRe=i$,WRe=a$,zRe=c$,XRe=u$,JRe=l$,ZRe=d$,VR=p$,QRe=_$,eye=f$,tye=m$,nye=E$,rye=S$,oye=T$,sye=g$,iye=h$,aye=A$,cye=R$,uye=y$,lye=O$,dye=N$,pye=C$,_ye=v$,fye=I$,mye=P$,Eye=b$,Sye=M$,BR=L$,Tye=x$,GR=D$,gye=U$,hye=w$,Aye=k$,Rye=V$,yye=B$,Oye=G$,Nye=H$,Cye=F$,vye=Qe([yH,OH,NH,CH,vH,IH,PH,bH,MH,LH,xH,DH,UH,wH,kH,VH,BH,GH,HH,FH,$H,jH,qH,YH,KH,WH,zH,XH,JH,ZH,QH,eF,tF,nF,rF,oF,sF,iF,aF,cF,uF,lF,dF,pF,_F,fF,mF,EF,SF,TF,gF,hF,AF,RF,yF,OF,NF,CF,vF,IF,PF,bF,MF,LF,xF,DF,UF,wF,kF,VF,BF,GF,HF,FF,$F,jF,qF,YF,KF,WF,zF,XF,JF,ZF,QF,e$,t$,n$,r$,o$,s$,i$,a$,c$,u$,l$,d$,p$,_$,f$,m$,E$,S$,T$,g$,h$,A$,R$,y$,O$,N$,C$,v$,I$,P$,b$,M$,L$,x$,D$,U$,w$,k$,V$,B$,G$,H$,F$]),$$="other_sql",j$="mssql",q$="mysql",Y$="oracle",K$="db2",W$="postgresql",z$="redshift",X$="hive",J$="cloudscape",Z$="hsqldb",Q$="progress",ej="maxdb",tj="hanadb",nj="ingres",rj="firstsql",oj="edb",sj="cache",ij="adabas",aj="firebird",cj="derby",uj="filemaker",lj="informix",dj="instantdb",pj="interbase",_j="mariadb",fj="netezza",mj="pervasive",Ej="pointbase",Sj="sqlite",Tj="sybase",gj="teradata",hj="vertica",Aj="h2",Rj="coldfusion",yj="cassandra",Oj="hbase",Nj="mongodb",Cj="redis",vj="couchbase",Ij="couchdb",Pj="cosmosdb",bj="dynamodb",Mj="neo4j",Lj="geode",xj="elasticsearch",Dj="memcached",Uj="cockroachdb",Iye=$$,Pye=j$,bye=q$,Mye=Y$,Lye=K$,xye=W$,Dye=z$,Uye=X$,wye=J$,kye=Z$,Vye=Q$,Bye=ej,Gye=tj,Hye=nj,Fye=rj,$ye=oj,jye=sj,qye=ij,Yye=aj,Kye=cj,Wye=uj,zye=lj,Xye=dj,Jye=pj,Zye=_j,Qye=fj,eOe=mj,tOe=Ej,nOe=Sj,rOe=Tj,oOe=gj,sOe=hj,iOe=Aj,aOe=Rj,cOe=yj,uOe=Oj,lOe=Nj,dOe=Cj,pOe=vj,_Oe=Ij,fOe=Pj,mOe=bj,EOe=Mj,SOe=Lj,TOe=xj,gOe=Dj,hOe=Uj,AOe=Qe([$$,j$,q$,Y$,K$,W$,z$,X$,J$,Z$,Q$,ej,tj,nj,rj,oj,sj,ij,aj,cj,uj,lj,dj,pj,_j,fj,mj,Ej,Sj,Tj,gj,hj,Aj,Rj,yj,Oj,Nj,Cj,vj,Ij,Pj,bj,Mj,Lj,xj,Dj,Uj]),wj="all",kj="each_quorum",Vj="quorum",Bj="local_quorum",Gj="one",Hj="two",Fj="three",$j="local_one",jj="any",qj="serial",Yj="local_serial",ROe=wj,yOe=kj,OOe=Vj,NOe=Bj,COe=Gj,vOe=Hj,IOe=Fj,POe=$j,bOe=jj,MOe=qj,LOe=Yj,xOe=Qe([wj,kj,Vj,Bj,Gj,Hj,Fj,$j,jj,qj,Yj]),Kj="datasource",Wj="http",zj="pubsub",Xj="timer",Jj="other",DOe=Kj,UOe=Wj,wOe=zj,kOe=Xj,VOe=Jj,BOe=Qe([Kj,Wj,zj,Xj,Jj]),Zj="insert",Qj="edit",eq="delete",GOe=Zj,HOe=Qj,FOe=eq,$Oe=Qe([Zj,Qj,eq]),tq="alibaba_cloud",nq="aws",rq="azure",oq="gcp",jOe=tq,qOe=nq,YOe=rq,KOe=oq,WOe=Qe([tq,nq,rq,oq]),sq="ip_tcp",iq="ip_udp",aq="ip",cq="unix",uq="pipe",lq="inproc",dq="other",zOe=sq,XOe=iq,JOe=aq,ZOe=cq,QOe=uq,eNe=lq,tNe=dq,nNe=Qe([sq,iq,aq,cq,uq,lq,dq]),pq="wifi",_q="wired",fq="cell",mq="unavailable",Eq="unknown",rNe=pq,oNe=_q,sNe=fq,iNe=mq,aNe=Eq,cNe=Qe([pq,_q,fq,mq,Eq]),Sq="gprs",Tq="edge",gq="umts",hq="cdma",Aq="evdo_0",Rq="evdo_a",yq="cdma2000_1xrtt",Oq="hsdpa",Nq="hsupa",Cq="hspa",vq="iden",Iq="evdo_b",Pq="lte",bq="ehrpd",Mq="hspap",Lq="gsm",xq="td_scdma",Dq="iwlan",Uq="nr",wq="nrnsa",kq="lte_ca",uNe=Sq,lNe=Tq,dNe=gq,pNe=hq,_Ne=Aq,fNe=Rq,mNe=yq,ENe=Oq,SNe=Nq,TNe=Cq,gNe=vq,hNe=Iq,ANe=Pq,RNe=bq,yNe=Mq,ONe=Lq,NNe=xq,CNe=Dq,vNe=Uq,INe=wq,PNe=kq,bNe=Qe([Sq,Tq,gq,hq,Aq,Rq,yq,Oq,Nq,Cq,vq,Iq,Pq,bq,Mq,Lq,xq,Dq,Uq,wq,kq]),Vq="1.0",Bq="1.1",Gq="2.0",Hq="SPDY",Fq="QUIC",MNe=Vq,LNe=Bq,xNe=Gq,DNe=Hq,UNe=Fq,wNe={HTTP_1_0:Vq,HTTP_1_1:Bq,HTTP_2_0:Gq,SPDY:Hq,QUIC:Fq},$q="queue",jq="topic",kNe=$q,VNe=jq,BNe=Qe([$q,jq]),qq="receive",Yq="process",GNe=qq,HNe=Yq,FNe=Qe([qq,Yq]),Kq=0,Wq=1,zq=2,Xq=3,Jq=4,Zq=5,Qq=6,eY=7,tY=8,nY=9,rY=10,oY=11,sY=12,iY=13,aY=14,cY=15,uY=16,$Ne=Kq,jNe=Wq,qNe=zq,YNe=Xq,KNe=Jq,WNe=Zq,zNe=Qq,XNe=eY,JNe=tY,ZNe=nY,QNe=rY,eCe=oY,tCe=sY,nCe=iY,rCe=aY,oCe=cY,sCe=uY,iCe={OK:Kq,CANCELLED:Wq,UNKNOWN:zq,INVALID_ARGUMENT:Xq,DEADLINE_EXCEEDED:Jq,NOT_FOUND:Zq,ALREADY_EXISTS:Qq,PERMISSION_DENIED:eY,RESOURCE_EXHAUSTED:tY,FAILED_PRECONDITION:nY,ABORTED:rY,OUT_OF_RANGE:oY,UNIMPLEMENTED:sY,INTERNAL:iY,UNAVAILABLE:aY,DATA_LOSS:cY,UNAUTHENTICATED:uY},lY="SENT",dY="RECEIVED",aCe=lY,cCe=dY,uCe=Qe([lY,dY])});var _Y=B(()=>{pY()});var fY,mY,EY,SY,TY,gY,hY,AY,RY,yY,OY,NY,CY,vY,IY,PY,bY,MY,LY,xY,DY,UY,wY,kY,VY,BY,GY,HY,FY,$Y,jY,qY,YY,KY,WY,zY,XY,JY,ZY,QY,eK,tK,nK,rK,oK,sK,iK,aK,cK,uK,lK,dK,pK,_K,fK,mK,EK,SK,TK,gK,hK,AK,RK,yK,OK,NK,CK,vK,IK,PK,bK,MK,LK,xK,DK,UK,wK,kK,VK,BK,GK,lCe,dCe,pCe,_Ce,fCe,mCe,ECe,SCe,TCe,gCe,hCe,ACe,RCe,yCe,OCe,NCe,CCe,vCe,ICe,PCe,bCe,MCe,LCe,xCe,DCe,UCe,wCe,kCe,VCe,BCe,GCe,HCe,FCe,$Ce,jCe,qCe,YCe,KCe,WCe,zCe,XCe,JCe,ZCe,QCe,eve,tve,nve,rve,ove,sve,ive,ave,cve,uve,lve,dve,pve,_ve,fve,mve,Eve,Sve,Tve,gve,hve,Ave,Rve,yve,Ove,Nve,Cve,HR,vve,Ive,Pve,bve,Mve,Lve,xve,Dve,Uve,wve,HK,FK,$K,jK,kve,Vve,Bve,Gve,Hve,qK,YK,KK,WK,zK,XK,JK,ZK,QK,eW,tW,nW,rW,oW,sW,iW,aW,Fve,$ve,jve,qve,Yve,Kve,Wve,zve,Xve,Jve,Zve,Qve,eIe,tIe,nIe,rIe,oIe,sIe,cW,uW,iIe,aIe,cIe,lW,dW,pW,_W,fW,mW,EW,uIe,lIe,dIe,pIe,_Ie,fIe,mIe,EIe,SW,TW,gW,hW,AW,RW,yW,OW,NW,CW,vW,SIe,TIe,gIe,hIe,AIe,RIe,yIe,OIe,NIe,CIe,vIe,IIe,IW,PW,bW,MW,LW,xW,DW,UW,wW,kW,PIe,bIe,MIe,LIe,xIe,DIe,UIe,wIe,kIe,VIe,BIe,VW=B(()=>{xR();fY="cloud.provider",mY="cloud.account.id",EY="cloud.region",SY="cloud.availability_zone",TY="cloud.platform",gY="aws.ecs.container.arn",hY="aws.ecs.cluster.arn",AY="aws.ecs.launchtype",RY="aws.ecs.task.arn",yY="aws.ecs.task.family",OY="aws.ecs.task.revision",NY="aws.eks.cluster.arn",CY="aws.log.group.names",vY="aws.log.group.arns",IY="aws.log.stream.names",PY="aws.log.stream.arns",bY="container.name",MY="container.id",LY="container.runtime",xY="container.image.name",DY="container.image.tag",UY="deployment.environment",wY="device.id",kY="device.model.identifier",VY="device.model.name",BY="faas.name",GY="faas.id",HY="faas.version",FY="faas.instance",$Y="faas.max_memory",jY="host.id",qY="host.name",YY="host.type",KY="host.arch",WY="host.image.name",zY="host.image.id",XY="host.image.version",JY="k8s.cluster.name",ZY="k8s.node.name",QY="k8s.node.uid",eK="k8s.namespace.name",tK="k8s.pod.uid",nK="k8s.pod.name",rK="k8s.container.name",oK="k8s.replicaset.uid",sK="k8s.replicaset.name",iK="k8s.deployment.uid",aK="k8s.deployment.name",cK="k8s.statefulset.uid",uK="k8s.statefulset.name",lK="k8s.daemonset.uid",dK="k8s.daemonset.name",pK="k8s.job.uid",_K="k8s.job.name",fK="k8s.cronjob.uid",mK="k8s.cronjob.name",EK="os.type",SK="os.description",TK="os.name",gK="os.version",hK="process.pid",AK="process.executable.name",RK="process.executable.path",yK="process.command",OK="process.command_line",NK="process.command_args",CK="process.owner",vK="process.runtime.name",IK="process.runtime.version",PK="process.runtime.description",bK="service.name",MK="service.namespace",LK="service.instance.id",xK="service.version",DK="telemetry.sdk.name",UK="telemetry.sdk.language",wK="telemetry.sdk.version",kK="telemetry.auto.version",VK="webengine.name",BK="webengine.version",GK="webengine.description",lCe=fY,dCe=mY,pCe=EY,_Ce=SY,fCe=TY,mCe=gY,ECe=hY,SCe=AY,TCe=RY,gCe=yY,hCe=OY,ACe=NY,RCe=CY,yCe=vY,OCe=IY,NCe=PY,CCe=bY,vCe=MY,ICe=LY,PCe=xY,bCe=DY,MCe=UY,LCe=wY,xCe=kY,DCe=VY,UCe=BY,wCe=GY,kCe=HY,VCe=FY,BCe=$Y,GCe=jY,HCe=qY,FCe=YY,$Ce=KY,jCe=WY,qCe=zY,YCe=XY,KCe=JY,WCe=ZY,zCe=QY,XCe=eK,JCe=tK,ZCe=nK,QCe=rK,eve=oK,tve=sK,nve=iK,rve=aK,ove=cK,sve=uK,ive=lK,ave=dK,cve=pK,uve=_K,lve=fK,dve=mK,pve=EK,_ve=SK,fve=TK,mve=gK,Eve=hK,Sve=AK,Tve=RK,gve=yK,hve=OK,Ave=NK,Rve=CK,yve=vK,Ove=IK,Nve=PK,Cve=bK,HR=MK,vve=LK,Ive=xK,Pve=DK,bve=UK,Mve=wK,Lve=kK,xve=VK,Dve=BK,Uve=GK,wve=Qe([fY,mY,EY,SY,TY,gY,hY,AY,RY,yY,OY,NY,CY,vY,IY,PY,bY,MY,LY,xY,DY,UY,wY,kY,VY,BY,GY,HY,FY,$Y,jY,qY,YY,KY,WY,zY,XY,JY,ZY,QY,eK,tK,nK,rK,oK,sK,iK,aK,cK,uK,lK,dK,pK,_K,fK,mK,EK,SK,TK,gK,hK,AK,RK,yK,OK,NK,CK,vK,IK,PK,bK,MK,LK,xK,DK,UK,wK,kK,VK,BK,GK]),HK="alibaba_cloud",FK="aws",$K="azure",jK="gcp",kve=HK,Vve=FK,Bve=$K,Gve=jK,Hve=Qe([HK,FK,$K,jK]),qK="alibaba_cloud_ecs",YK="alibaba_cloud_fc",KK="aws_ec2",WK="aws_ecs",zK="aws_eks",XK="aws_lambda",JK="aws_elastic_beanstalk",ZK="azure_vm",QK="azure_container_instances",eW="azure_aks",tW="azure_functions",nW="azure_app_service",rW="gcp_compute_engine",oW="gcp_cloud_run",sW="gcp_kubernetes_engine",iW="gcp_cloud_functions",aW="gcp_app_engine",Fve=qK,$ve=YK,jve=KK,qve=WK,Yve=zK,Kve=XK,Wve=JK,zve=ZK,Xve=QK,Jve=eW,Zve=tW,Qve=nW,eIe=rW,tIe=oW,nIe=sW,rIe=iW,oIe=aW,sIe=Qe([qK,YK,KK,WK,zK,XK,JK,ZK,QK,eW,tW,nW,rW,oW,sW,iW,aW]),cW="ec2",uW="fargate",iIe=cW,aIe=uW,cIe=Qe([cW,uW]),lW="amd64",dW="arm32",pW="arm64",_W="ia64",fW="ppc32",mW="ppc64",EW="x86",uIe=lW,lIe=dW,dIe=pW,pIe=_W,_Ie=fW,fIe=mW,mIe=EW,EIe=Qe([lW,dW,pW,_W,fW,mW,EW]),SW="windows",TW="linux",gW="darwin",hW="freebsd",AW="netbsd",RW="openbsd",yW="dragonflybsd",OW="hpux",NW="aix",CW="solaris",vW="z_os",SIe=SW,TIe=TW,gIe=gW,hIe=hW,AIe=AW,RIe=RW,yIe=yW,OIe=OW,NIe=NW,CIe=CW,vIe=vW,IIe=Qe([SW,TW,gW,hW,AW,RW,yW,OW,NW,CW,vW]),IW="cpp",PW="dotnet",bW="erlang",MW="go",LW="java",xW="nodejs",DW="php",UW="python",wW="ruby",kW="webjs",PIe=IW,bIe=PW,MIe=bW,LIe=MW,xIe=LW,DIe=xW,UIe=DW,wIe=UW,kIe=wW,VIe=kW,BIe=Qe([IW,PW,bW,MW,LW,xW,DW,UW,wW,kW])});var BW=B(()=>{VW()});var GIe,HIe,FIe,$Ie,jIe,qIe,YIe,KIe,WIe,zIe,XIe,JIe,ZIe,QIe,ePe,tPe,nPe,rPe,oPe,sPe,iPe,aPe,cPe,uPe,lPe,dPe,FR,pPe,$R,_Pe,jR,qR,fPe,YR,mPe,EPe,SPe,TPe,gPe,hPe,APe,RPe,z9e,X9e,KR,yPe,OPe,NPe,CPe,vPe,IPe,Fi,PPe,bPe,MPe,J9e,LPe,xPe,DPe,UPe,Z9e,wPe,kPe,VPe,BPe,hs,Wr,GPe,HPe,FPe,$Pe,jPe,qPe,YPe,KPe,WPe,Q9e,zPe,XPe,JPe,ZPe,QPe,ebe,tbe,nbe,rbe,obe,sbe,ibe,abe,e8e,t8e,cbe,ube,lbe,dbe,pbe,_be,fbe,mbe,n8e,Ebe,WR,zR,Sbe,In,Tbe,XR,gbe,hbe,Abe,Rbe,ybe,Obe,Nbe,Cbe,vbe,r8e,Ibe,Pbe,o8e,bbe,Mbe,s8e,Lbe,xbe,Dbe,Ube,wbe,kbe,Vbe,Bbe,hc,Gbe,Hbe,Fbe,$be,GW=B(()=>{GIe="aspnetcore.diagnostics.exception.result",HIe="aborted",FIe="handled",$Ie="skipped",jIe="unhandled",qIe="aspnetcore.diagnostics.handler.type",YIe="aspnetcore.rate_limiting.policy",KIe="aspnetcore.rate_limiting.result",WIe="acquired",zIe="endpoint_limiter",XIe="global_limiter",JIe="request_canceled",ZIe="aspnetcore.request.is_unhandled",QIe="aspnetcore.routing.is_fallback",ePe="aspnetcore.routing.match_status",tPe="failure",nPe="success",rPe="aspnetcore.user.is_authenticated",oPe="client.address",sPe="client.port",iPe="code.column.number",aPe="code.file.path",cPe="code.function.name",uPe="code.line.number",lPe="code.stacktrace",dPe="db.collection.name",FR="db.namespace",pPe="db.operation.batch.size",$R="db.operation.name",_Pe="db.query.summary",jR="db.query.text",qR="db.response.status_code",fPe="db.stored_procedure.name",YR="db.system.name",mPe="mariadb",EPe="microsoft.sql_server",SPe="mysql",TPe="postgresql",gPe="dotnet.gc.heap.generation",hPe="gen0",APe="gen1",RPe="gen2",z9e="loh",X9e="poh",KR="error.type",yPe="_OTHER",OPe="exception.escaped",NPe="exception.message",CPe="exception.stacktrace",vPe="exception.type",IPe=t=>`http.request.header.${t}`,Fi="http.request.method",PPe="_OTHER",bPe="CONNECT",MPe="DELETE",J9e="GET",LPe="HEAD",xPe="OPTIONS",DPe="PATCH",UPe="POST",Z9e="PUT",wPe="TRACE",kPe="http.request.method_original",VPe="http.request.resend_count",BPe=t=>`http.response.header.${t}`,hs="http.response.status_code",Wr="http.route",GPe="jvm.gc.action",HPe="jvm.gc.name",FPe="jvm.memory.pool.name",$Pe="jvm.memory.type",jPe="heap",qPe="non_heap",YPe="jvm.thread.daemon",KPe="jvm.thread.state",WPe="blocked",Q9e="new",zPe="runnable",XPe="terminated",JPe="timed_waiting",ZPe="waiting",QPe="network.local.address",ebe="network.local.port",tbe="network.peer.address",nbe="network.peer.port",rbe="network.protocol.name",obe="network.protocol.version",sbe="network.transport",ibe="pipe",abe="quic",e8e="tcp",t8e="udp",cbe="unix",ube="network.type",lbe="ipv4",dbe="ipv6",pbe="otel.scope.name",_be="otel.scope.version",fbe="otel.status_code",mbe="ERROR",n8e="OK",Ebe="otel.status_description",WR="server.address",zR="server.port",Sbe="service.instance.id",In="service.name",Tbe="service.namespace",XR="service.version",gbe="signalr.connection.status",hbe="app_shutdown",Abe="normal_closure",Rbe="timeout",ybe="signalr.transport",Obe="long_polling",Nbe="server_sent_events",Cbe="web_sockets",vbe="telemetry.sdk.language",r8e="cpp",Ibe="dotnet",Pbe="erlang",o8e="go",bbe="java",Mbe="nodejs",s8e="php",Lbe="python",xbe="ruby",Dbe="rust",Ube="swift",wbe="webjs",kbe="telemetry.sdk.name",Vbe="telemetry.sdk.version",Bbe="url.fragment",hc="url.full",Gbe="url.path",Hbe="url.query",Fbe="url.scheme",$be="user_agent.original"});var jbe,qbe,Ybe,Kbe,Wbe,zbe,Xbe,Jbe,Zbe,Qbe,eMe,tMe,nMe,rMe,oMe,sMe,iMe,aMe,cMe,uMe,lMe,dMe,pMe,_Me,fMe,mMe,EMe,SMe,TMe,gMe,hMe,AMe,RMe,yMe,OMe,NMe,CMe,vMe,IMe,PMe,bMe,MMe,LMe,xMe,DMe,UMe,wMe,kMe,VMe,BMe,GMe,HW=B(()=>{jbe="aspnetcore.diagnostics.exceptions",qbe="aspnetcore.rate_limiting.active_request_leases",Ybe="aspnetcore.rate_limiting.queued_requests",Kbe="aspnetcore.rate_limiting.request.time_in_queue",Wbe="aspnetcore.rate_limiting.request_lease.duration",zbe="aspnetcore.rate_limiting.requests",Xbe="aspnetcore.routing.match_attempts",Jbe="db.client.operation.duration",Zbe="dotnet.assembly.count",Qbe="dotnet.exceptions",eMe="dotnet.gc.collections",tMe="dotnet.gc.heap.total_allocated",nMe="dotnet.gc.last_collection.heap.fragmentation.size",rMe="dotnet.gc.last_collection.heap.size",oMe="dotnet.gc.last_collection.memory.committed_size",sMe="dotnet.gc.pause.time",iMe="dotnet.jit.compilation.time",aMe="dotnet.jit.compiled_il.size",cMe="dotnet.jit.compiled_methods",uMe="dotnet.monitor.lock_contentions",lMe="dotnet.process.cpu.count",dMe="dotnet.process.cpu.time",pMe="dotnet.process.memory.working_set",_Me="dotnet.thread_pool.queue.length",fMe="dotnet.thread_pool.thread.count",mMe="dotnet.thread_pool.work_item.count",EMe="dotnet.timer.count",SMe="http.client.request.duration",TMe="http.server.request.duration",gMe="jvm.class.count",hMe="jvm.class.loaded",AMe="jvm.class.unloaded",RMe="jvm.cpu.count",yMe="jvm.cpu.recent_utilization",OMe="jvm.cpu.time",NMe="jvm.gc.duration",CMe="jvm.memory.committed",vMe="jvm.memory.limit",IMe="jvm.memory.used",PMe="jvm.memory.used_after_last_gc",bMe="jvm.thread.count",MMe="kestrel.active_connections",LMe="kestrel.active_tls_handshakes",xMe="kestrel.connection.duration",DMe="kestrel.queued_connections",UMe="kestrel.queued_requests",wMe="kestrel.rejected_connections",kMe="kestrel.tls_handshake.duration",VMe="kestrel.upgraded_connections",BMe="signalr.server.active_connections",GMe="signalr.server.connection.duration"});var HMe,FW=B(()=>{HMe="exception"});var et={};Kd(et,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>HIe,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>FIe,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>$Ie,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>jIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>WIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>zIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>XIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>JIe,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>tPe,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>nPe,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>GIe,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>qIe,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>YIe,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>KIe,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>ZIe,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>QIe,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>ePe,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>rPe,ATTR_CLIENT_ADDRESS:()=>oPe,ATTR_CLIENT_PORT:()=>sPe,ATTR_CODE_COLUMN_NUMBER:()=>iPe,ATTR_CODE_FILE_PATH:()=>aPe,ATTR_CODE_FUNCTION_NAME:()=>cPe,ATTR_CODE_LINE_NUMBER:()=>uPe,ATTR_CODE_STACKTRACE:()=>lPe,ATTR_DB_COLLECTION_NAME:()=>dPe,ATTR_DB_NAMESPACE:()=>FR,ATTR_DB_OPERATION_BATCH_SIZE:()=>pPe,ATTR_DB_OPERATION_NAME:()=>$R,ATTR_DB_QUERY_SUMMARY:()=>_Pe,ATTR_DB_QUERY_TEXT:()=>jR,ATTR_DB_RESPONSE_STATUS_CODE:()=>qR,ATTR_DB_STORED_PROCEDURE_NAME:()=>fPe,ATTR_DB_SYSTEM_NAME:()=>YR,ATTR_DOTNET_GC_HEAP_GENERATION:()=>gPe,ATTR_ERROR_TYPE:()=>KR,ATTR_EXCEPTION_ESCAPED:()=>OPe,ATTR_EXCEPTION_MESSAGE:()=>NPe,ATTR_EXCEPTION_STACKTRACE:()=>CPe,ATTR_EXCEPTION_TYPE:()=>vPe,ATTR_HTTP_REQUEST_HEADER:()=>IPe,ATTR_HTTP_REQUEST_METHOD:()=>Fi,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>kPe,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>VPe,ATTR_HTTP_RESPONSE_HEADER:()=>BPe,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>hs,ATTR_HTTP_ROUTE:()=>Wr,ATTR_JVM_GC_ACTION:()=>GPe,ATTR_JVM_GC_NAME:()=>HPe,ATTR_JVM_MEMORY_POOL_NAME:()=>FPe,ATTR_JVM_MEMORY_TYPE:()=>$Pe,ATTR_JVM_THREAD_DAEMON:()=>YPe,ATTR_JVM_THREAD_STATE:()=>KPe,ATTR_NETWORK_LOCAL_ADDRESS:()=>QPe,ATTR_NETWORK_LOCAL_PORT:()=>ebe,ATTR_NETWORK_PEER_ADDRESS:()=>tbe,ATTR_NETWORK_PEER_PORT:()=>nbe,ATTR_NETWORK_PROTOCOL_NAME:()=>rbe,ATTR_NETWORK_PROTOCOL_VERSION:()=>obe,ATTR_NETWORK_TRANSPORT:()=>sbe,ATTR_NETWORK_TYPE:()=>ube,ATTR_OTEL_SCOPE_NAME:()=>pbe,ATTR_OTEL_SCOPE_VERSION:()=>_be,ATTR_OTEL_STATUS_CODE:()=>fbe,ATTR_OTEL_STATUS_DESCRIPTION:()=>Ebe,ATTR_SERVER_ADDRESS:()=>WR,ATTR_SERVER_PORT:()=>zR,ATTR_SERVICE_INSTANCE_ID:()=>Sbe,ATTR_SERVICE_NAME:()=>In,ATTR_SERVICE_NAMESPACE:()=>Tbe,ATTR_SERVICE_VERSION:()=>XR,ATTR_SIGNALR_CONNECTION_STATUS:()=>gbe,ATTR_SIGNALR_TRANSPORT:()=>ybe,ATTR_TELEMETRY_SDK_LANGUAGE:()=>vbe,ATTR_TELEMETRY_SDK_NAME:()=>kbe,ATTR_TELEMETRY_SDK_VERSION:()=>Vbe,ATTR_URL_FRAGMENT:()=>Bbe,ATTR_URL_FULL:()=>hc,ATTR_URL_PATH:()=>Gbe,ATTR_URL_QUERY:()=>Hbe,ATTR_URL_SCHEME:()=>Fbe,ATTR_USER_AGENT_ORIGINAL:()=>$be,AWSECSLAUNCHTYPEVALUES_EC2:()=>iIe,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>aIe,AwsEcsLaunchtypeValues:()=>cIe,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Fve,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>$ve,CLOUDPLATFORMVALUES_AWS_EC2:()=>jve,CLOUDPLATFORMVALUES_AWS_ECS:()=>qve,CLOUDPLATFORMVALUES_AWS_EKS:()=>Yve,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Wve,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Kve,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Jve,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>Qve,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Xve,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>Zve,CLOUDPLATFORMVALUES_AZURE_VM:()=>zve,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>oIe,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>rIe,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>tIe,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>eIe,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>nIe,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>kve,CLOUDPROVIDERVALUES_AWS:()=>Vve,CLOUDPROVIDERVALUES_AZURE:()=>Bve,CLOUDPROVIDERVALUES_GCP:()=>Gve,CloudPlatformValues:()=>sIe,CloudProviderValues:()=>Hve,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>ROe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>bOe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>yOe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>POe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>NOe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>LOe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>COe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>OOe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>MOe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>IOe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>vOe,DBSYSTEMVALUES_ADABAS:()=>qye,DBSYSTEMVALUES_CACHE:()=>jye,DBSYSTEMVALUES_CASSANDRA:()=>cOe,DBSYSTEMVALUES_CLOUDSCAPE:()=>wye,DBSYSTEMVALUES_COCKROACHDB:()=>hOe,DBSYSTEMVALUES_COLDFUSION:()=>aOe,DBSYSTEMVALUES_COSMOSDB:()=>fOe,DBSYSTEMVALUES_COUCHBASE:()=>pOe,DBSYSTEMVALUES_COUCHDB:()=>_Oe,DBSYSTEMVALUES_DB2:()=>Lye,DBSYSTEMVALUES_DERBY:()=>Kye,DBSYSTEMVALUES_DYNAMODB:()=>mOe,DBSYSTEMVALUES_EDB:()=>$ye,DBSYSTEMVALUES_ELASTICSEARCH:()=>TOe,DBSYSTEMVALUES_FILEMAKER:()=>Wye,DBSYSTEMVALUES_FIREBIRD:()=>Yye,DBSYSTEMVALUES_FIRSTSQL:()=>Fye,DBSYSTEMVALUES_GEODE:()=>SOe,DBSYSTEMVALUES_H2:()=>iOe,DBSYSTEMVALUES_HANADB:()=>Gye,DBSYSTEMVALUES_HBASE:()=>uOe,DBSYSTEMVALUES_HIVE:()=>Uye,DBSYSTEMVALUES_HSQLDB:()=>kye,DBSYSTEMVALUES_INFORMIX:()=>zye,DBSYSTEMVALUES_INGRES:()=>Hye,DBSYSTEMVALUES_INSTANTDB:()=>Xye,DBSYSTEMVALUES_INTERBASE:()=>Jye,DBSYSTEMVALUES_MARIADB:()=>Zye,DBSYSTEMVALUES_MAXDB:()=>Bye,DBSYSTEMVALUES_MEMCACHED:()=>gOe,DBSYSTEMVALUES_MONGODB:()=>lOe,DBSYSTEMVALUES_MSSQL:()=>Pye,DBSYSTEMVALUES_MYSQL:()=>bye,DBSYSTEMVALUES_NEO4J:()=>EOe,DBSYSTEMVALUES_NETEZZA:()=>Qye,DBSYSTEMVALUES_ORACLE:()=>Mye,DBSYSTEMVALUES_OTHER_SQL:()=>Iye,DBSYSTEMVALUES_PERVASIVE:()=>eOe,DBSYSTEMVALUES_POINTBASE:()=>tOe,DBSYSTEMVALUES_POSTGRESQL:()=>xye,DBSYSTEMVALUES_PROGRESS:()=>Vye,DBSYSTEMVALUES_REDIS:()=>dOe,DBSYSTEMVALUES_REDSHIFT:()=>Dye,DBSYSTEMVALUES_SQLITE:()=>nOe,DBSYSTEMVALUES_SYBASE:()=>rOe,DBSYSTEMVALUES_TERADATA:()=>oOe,DBSYSTEMVALUES_VERTICA:()=>sOe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>mPe,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>EPe,DB_SYSTEM_NAME_VALUE_MYSQL:()=>SPe,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>TPe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>hPe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>APe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>RPe,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>z9e,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>X9e,DbCassandraConsistencyLevelValues:()=>xOe,DbSystemValues:()=>AOe,ERROR_TYPE_VALUE_OTHER:()=>yPe,EVENT_EXCEPTION:()=>HMe,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>FOe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>HOe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>GOe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>jOe,FAASINVOKEDPROVIDERVALUES_AWS:()=>qOe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>YOe,FAASINVOKEDPROVIDERVALUES_GCP:()=>KOe,FAASTRIGGERVALUES_DATASOURCE:()=>DOe,FAASTRIGGERVALUES_HTTP:()=>UOe,FAASTRIGGERVALUES_OTHER:()=>VOe,FAASTRIGGERVALUES_PUBSUB:()=>wOe,FAASTRIGGERVALUES_TIMER:()=>kOe,FaasDocumentOperationValues:()=>$Oe,FaasInvokedProviderValues:()=>WOe,FaasTriggerValues:()=>BOe,HOSTARCHVALUES_AMD64:()=>uIe,HOSTARCHVALUES_ARM32:()=>lIe,HOSTARCHVALUES_ARM64:()=>dIe,HOSTARCHVALUES_IA64:()=>pIe,HOSTARCHVALUES_PPC32:()=>_Ie,HOSTARCHVALUES_PPC64:()=>fIe,HOSTARCHVALUES_X86:()=>mIe,HTTPFLAVORVALUES_HTTP_1_0:()=>MNe,HTTPFLAVORVALUES_HTTP_1_1:()=>LNe,HTTPFLAVORVALUES_HTTP_2_0:()=>xNe,HTTPFLAVORVALUES_QUIC:()=>UNe,HTTPFLAVORVALUES_SPDY:()=>DNe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>bPe,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>MPe,HTTP_REQUEST_METHOD_VALUE_GET:()=>J9e,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>LPe,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>xPe,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>PPe,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>DPe,HTTP_REQUEST_METHOD_VALUE_POST:()=>UPe,HTTP_REQUEST_METHOD_VALUE_PUT:()=>Z9e,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>wPe,HostArchValues:()=>EIe,HttpFlavorValues:()=>wNe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>jPe,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>qPe,JVM_THREAD_STATE_VALUE_BLOCKED:()=>WPe,JVM_THREAD_STATE_VALUE_NEW:()=>Q9e,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>zPe,JVM_THREAD_STATE_VALUE_TERMINATED:()=>XPe,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>JPe,JVM_THREAD_STATE_VALUE_WAITING:()=>ZPe,MESSAGETYPEVALUES_RECEIVED:()=>cCe,MESSAGETYPEVALUES_SENT:()=>aCe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>kNe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>VNe,MESSAGINGOPERATIONVALUES_PROCESS:()=>HNe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>GNe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>jbe,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>qbe,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Ybe,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>zbe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Wbe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Kbe,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>Xbe,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Jbe,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Zbe,METRIC_DOTNET_EXCEPTIONS:()=>Qbe,METRIC_DOTNET_GC_COLLECTIONS:()=>eMe,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>tMe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>nMe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>rMe,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>oMe,METRIC_DOTNET_GC_PAUSE_TIME:()=>sMe,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>iMe,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>aMe,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>cMe,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>uMe,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>lMe,METRIC_DOTNET_PROCESS_CPU_TIME:()=>dMe,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>pMe,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>_Me,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>fMe,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>mMe,METRIC_DOTNET_TIMER_COUNT:()=>EMe,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>SMe,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>TMe,METRIC_JVM_CLASS_COUNT:()=>gMe,METRIC_JVM_CLASS_LOADED:()=>hMe,METRIC_JVM_CLASS_UNLOADED:()=>AMe,METRIC_JVM_CPU_COUNT:()=>RMe,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>yMe,METRIC_JVM_CPU_TIME:()=>OMe,METRIC_JVM_GC_DURATION:()=>NMe,METRIC_JVM_MEMORY_COMMITTED:()=>CMe,METRIC_JVM_MEMORY_LIMIT:()=>vMe,METRIC_JVM_MEMORY_USED:()=>IMe,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>PMe,METRIC_JVM_THREAD_COUNT:()=>bMe,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>MMe,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>LMe,METRIC_KESTREL_CONNECTION_DURATION:()=>xMe,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>DMe,METRIC_KESTREL_QUEUED_REQUESTS:()=>UMe,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>wMe,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>kMe,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>VMe,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>BMe,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>GMe,MessageTypeValues:()=>uCe,MessagingDestinationKindValues:()=>BNe,MessagingOperationValues:()=>FNe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>pNe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>mNe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>lNe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>RNe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>_Ne,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>fNe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>hNe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>uNe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>ONe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>ENe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>TNe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>yNe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>SNe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>gNe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>CNe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>ANe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>PNe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>vNe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>INe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>NNe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>dNe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>sNe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>iNe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>aNe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>rNe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>oNe,NETTRANSPORTVALUES_INPROC:()=>eNe,NETTRANSPORTVALUES_IP:()=>JOe,NETTRANSPORTVALUES_IP_TCP:()=>zOe,NETTRANSPORTVALUES_IP_UDP:()=>XOe,NETTRANSPORTVALUES_OTHER:()=>tNe,NETTRANSPORTVALUES_PIPE:()=>QOe,NETTRANSPORTVALUES_UNIX:()=>ZOe,NETWORK_TRANSPORT_VALUE_PIPE:()=>ibe,NETWORK_TRANSPORT_VALUE_QUIC:()=>abe,NETWORK_TRANSPORT_VALUE_TCP:()=>e8e,NETWORK_TRANSPORT_VALUE_UDP:()=>t8e,NETWORK_TRANSPORT_VALUE_UNIX:()=>cbe,NETWORK_TYPE_VALUE_IPV4:()=>lbe,NETWORK_TYPE_VALUE_IPV6:()=>dbe,NetHostConnectionSubtypeValues:()=>bNe,NetHostConnectionTypeValues:()=>cNe,NetTransportValues:()=>nNe,OSTYPEVALUES_AIX:()=>NIe,OSTYPEVALUES_DARWIN:()=>gIe,OSTYPEVALUES_DRAGONFLYBSD:()=>yIe,OSTYPEVALUES_FREEBSD:()=>hIe,OSTYPEVALUES_HPUX:()=>OIe,OSTYPEVALUES_LINUX:()=>TIe,OSTYPEVALUES_NETBSD:()=>AIe,OSTYPEVALUES_OPENBSD:()=>RIe,OSTYPEVALUES_SOLARIS:()=>CIe,OSTYPEVALUES_WINDOWS:()=>SIe,OSTYPEVALUES_Z_OS:()=>vIe,OTEL_STATUS_CODE_VALUE_ERROR:()=>mbe,OTEL_STATUS_CODE_VALUE_OK:()=>n8e,OsTypeValues:()=>IIe,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>QNe,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>zNe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>jNe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>oCe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>KNe,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>ZNe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>nCe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>YNe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>WNe,RPCGRPCSTATUSCODEVALUES_OK:()=>$Ne,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>eCe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>XNe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>JNe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>sCe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>rCe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>tCe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>qNe,RpcGrpcStatusCodeValues:()=>iCe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>BRe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>JRe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>wRe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>LRe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>zRe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>jRe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>FRe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>ZRe,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>GRe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>xRe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>VRe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>$Re,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>kRe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>DRe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>URe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>XRe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>YRe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>KRe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>HRe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>qRe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>MRe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>WRe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>TAe,SEMATTRS_CODE_FILEPATH:()=>gRe,SEMATTRS_CODE_FUNCTION:()=>SRe,SEMATTRS_CODE_LINENO:()=>hRe,SEMATTRS_CODE_NAMESPACE:()=>TRe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>vAe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>LAe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>MAe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>PAe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>NAe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>CAe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>bAe,SEMATTRS_DB_CASSANDRA_TABLE:()=>IAe,SEMATTRS_DB_CONNECTION_STRING:()=>gAe,SEMATTRS_DB_HBASE_NAMESPACE:()=>xAe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>AAe,SEMATTRS_DB_MONGODB_COLLECTION:()=>UAe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>OAe,SEMATTRS_DB_NAME:()=>RAe,SEMATTRS_DB_OPERATION:()=>yAe,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>DAe,SEMATTRS_DB_SQL_TABLE:()=>wAe,SEMATTRS_DB_STATEMENT:()=>UR,SEMATTRS_DB_SYSTEM:()=>DR,SEMATTRS_DB_USER:()=>hAe,SEMATTRS_ENDUSER_ID:()=>pRe,SEMATTRS_ENDUSER_ROLE:()=>_Re,SEMATTRS_ENDUSER_SCOPE:()=>fRe,SEMATTRS_EXCEPTION_ESCAPED:()=>GAe,SEMATTRS_EXCEPTION_MESSAGE:()=>VAe,SEMATTRS_EXCEPTION_STACKTRACE:()=>BAe,SEMATTRS_EXCEPTION_TYPE:()=>kAe,SEMATTRS_FAAS_COLDSTART:()=>WAe,SEMATTRS_FAAS_CRON:()=>KAe,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>FAe,SEMATTRS_FAAS_DOCUMENT_NAME:()=>qAe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>$Ae,SEMATTRS_FAAS_DOCUMENT_TIME:()=>jAe,SEMATTRS_FAAS_EXECUTION:()=>HAe,SEMATTRS_FAAS_INVOKED_NAME:()=>zAe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>XAe,SEMATTRS_FAAS_INVOKED_REGION:()=>JAe,SEMATTRS_FAAS_TIME:()=>YAe,SEMATTRS_FAAS_TRIGGER:()=>wR,SEMATTRS_HTTP_CLIENT_IP:()=>bRe,SEMATTRS_HTTP_FLAVOR:()=>yRe,SEMATTRS_HTTP_HOST:()=>ARe,SEMATTRS_HTTP_METHOD:()=>jl,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>NRe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>CRe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>vRe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>IRe,SEMATTRS_HTTP_ROUTE:()=>ql,SEMATTRS_HTTP_SCHEME:()=>RRe,SEMATTRS_HTTP_SERVER_NAME:()=>PRe,SEMATTRS_HTTP_STATUS_CODE:()=>Em,SEMATTRS_HTTP_TARGET:()=>kR,SEMATTRS_HTTP_URL:()=>gc,SEMATTRS_HTTP_USER_AGENT:()=>ORe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>Nye,SEMATTRS_MESSAGE_ID:()=>Oye,SEMATTRS_MESSAGE_TYPE:()=>yye,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Cye,SEMATTRS_MESSAGING_CONSUMER_ID:()=>lye,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>iye,SEMATTRS_MESSAGING_DESTINATION:()=>QRe,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>eye,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>fye,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>_ye,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>pye,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>mye,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Eye,SEMATTRS_MESSAGING_MESSAGE_ID:()=>sye,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>cye,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>aye,SEMATTRS_MESSAGING_OPERATION:()=>uye,SEMATTRS_MESSAGING_PROTOCOL:()=>nye,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>rye,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>dye,SEMATTRS_MESSAGING_SYSTEM:()=>VR,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>tye,SEMATTRS_MESSAGING_URL:()=>oye,SEMATTRS_NET_HOST_CARRIER_ICC:()=>lRe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>cRe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>uRe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>aRe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>iRe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>sRe,SEMATTRS_NET_HOST_IP:()=>nRe,SEMATTRS_NET_HOST_NAME:()=>oRe,SEMATTRS_NET_HOST_PORT:()=>rRe,SEMATTRS_NET_PEER_IP:()=>QAe,SEMATTRS_NET_PEER_NAME:()=>tRe,SEMATTRS_NET_PEER_PORT:()=>eRe,SEMATTRS_NET_TRANSPORT:()=>ZAe,SEMATTRS_PEER_SERVICE:()=>dRe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>GR,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Aye,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>Rye,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>hye,SEMATTRS_RPC_JSONRPC_VERSION:()=>gye,SEMATTRS_RPC_METHOD:()=>Tye,SEMATTRS_RPC_SERVICE:()=>BR,SEMATTRS_RPC_SYSTEM:()=>Sye,SEMATTRS_THREAD_ID:()=>mRe,SEMATTRS_THREAD_NAME:()=>ERe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>ECe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>mCe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>SCe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>TCe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>gCe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>hCe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>ACe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>yCe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>RCe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>NCe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>OCe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>dCe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>_Ce,SEMRESATTRS_CLOUD_PLATFORM:()=>fCe,SEMRESATTRS_CLOUD_PROVIDER:()=>lCe,SEMRESATTRS_CLOUD_REGION:()=>pCe,SEMRESATTRS_CONTAINER_ID:()=>vCe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>PCe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>bCe,SEMRESATTRS_CONTAINER_NAME:()=>CCe,SEMRESATTRS_CONTAINER_RUNTIME:()=>ICe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>MCe,SEMRESATTRS_DEVICE_ID:()=>LCe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>xCe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>DCe,SEMRESATTRS_FAAS_ID:()=>wCe,SEMRESATTRS_FAAS_INSTANCE:()=>VCe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>BCe,SEMRESATTRS_FAAS_NAME:()=>UCe,SEMRESATTRS_FAAS_VERSION:()=>kCe,SEMRESATTRS_HOST_ARCH:()=>$Ce,SEMRESATTRS_HOST_ID:()=>GCe,SEMRESATTRS_HOST_IMAGE_ID:()=>qCe,SEMRESATTRS_HOST_IMAGE_NAME:()=>jCe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>YCe,SEMRESATTRS_HOST_NAME:()=>HCe,SEMRESATTRS_HOST_TYPE:()=>FCe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>KCe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>QCe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>dve,SEMRESATTRS_K8S_CRONJOB_UID:()=>lve,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>ave,SEMRESATTRS_K8S_DAEMONSET_UID:()=>ive,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>rve,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>nve,SEMRESATTRS_K8S_JOB_NAME:()=>uve,SEMRESATTRS_K8S_JOB_UID:()=>cve,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>XCe,SEMRESATTRS_K8S_NODE_NAME:()=>WCe,SEMRESATTRS_K8S_NODE_UID:()=>zCe,SEMRESATTRS_K8S_POD_NAME:()=>ZCe,SEMRESATTRS_K8S_POD_UID:()=>JCe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>tve,SEMRESATTRS_K8S_REPLICASET_UID:()=>eve,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>sve,SEMRESATTRS_K8S_STATEFULSET_UID:()=>ove,SEMRESATTRS_OS_DESCRIPTION:()=>_ve,SEMRESATTRS_OS_NAME:()=>fve,SEMRESATTRS_OS_TYPE:()=>pve,SEMRESATTRS_OS_VERSION:()=>mve,SEMRESATTRS_PROCESS_COMMAND:()=>gve,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Ave,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>hve,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Sve,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>Tve,SEMRESATTRS_PROCESS_OWNER:()=>Rve,SEMRESATTRS_PROCESS_PID:()=>Eve,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>Nve,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>yve,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Ove,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>vve,SEMRESATTRS_SERVICE_NAME:()=>Cve,SEMRESATTRS_SERVICE_NAMESPACE:()=>HR,SEMRESATTRS_SERVICE_VERSION:()=>Ive,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>Lve,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>bve,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Pve,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>Mve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Uve,SEMRESATTRS_WEBENGINE_NAME:()=>xve,SEMRESATTRS_WEBENGINE_VERSION:()=>Dve,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>hbe,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Abe,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Rbe,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Obe,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>Nbe,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Cbe,SemanticAttributes:()=>vye,SemanticResourceAttributes:()=>wve,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>PIe,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>bIe,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>MIe,TELEMETRYSDKLANGUAGEVALUES_GO:()=>LIe,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>xIe,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>DIe,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>UIe,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>wIe,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>kIe,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>VIe,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>r8e,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>Ibe,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Pbe,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>o8e,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>bbe,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>Mbe,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>s8e,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>Lbe,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>xbe,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Dbe,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Ube,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>wbe,TelemetrySdkLanguageValues:()=>BIe});var Re=B(()=>{_Y();BW();GW();HW();FW()});var $W=m(Sm=>{"use strict";Object.defineProperty(Sm,"__esModule",{value:!0});Sm.ExceptionEventName=void 0;Sm.ExceptionEventName="exception"});var ZR=m(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.Span=void 0;var Yn=(L(),I(V)),Ft=fe(),$i=(Vn(),I(kn)),FMe=$W(),JR=class{constructor(e,n,r,o,s,i,a=[],c,u,l){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:Yn.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=r,this._spanContext=o,this.parentSpanId=i,this.kind=s,this.links=a;let d=Date.now();this._performanceStartTime=Ft.otperformance.now(),this._performanceOffset=d-(this._performanceStartTime+(0,Ft.getTimeOrigin)()),this._startTimeProvided=c!=null,this.startTime=this._getTime(c??d),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,l!=null&&this.setAttributes(l),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,n)}spanContext(){return this._spanContext}setAttribute(e,n){return n==null||this._isSpanEnded()?this:e.length===0?(Yn.diag.warn(`Invalid attribute key: ${e}`),this):(0,Ft.isAttributeValue)(n)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(n),this):(Yn.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[n,r]of Object.entries(e))this.setAttribute(n,r);return this}addEvent(e,n,r){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return Yn.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Yn.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,Ft.isTimeInput)(n)&&((0,Ft.isTimeInput)(r)||(r=n),n=void 0);let o=(0,Ft.sanitizeAttributes)(n);return this.events.push({name:e,attributes:o,time:this._getTime(r),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&&typeof e.message!="string"&&(Yn.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Yn.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,Ft.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(Yn.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Yn.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Ft.otperformance.now())return(0,Ft.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,Ft.millisToHrTime)(e);if(e instanceof Date)return(0,Ft.millisToHrTime)(e.getTime());if((0,Ft.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,Ft.millisToHrTime)(Date.now());let n=Ft.otperformance.now()-this._performanceStartTime;return(0,Ft.addHrTimes)(this.startTime,(0,Ft.millisToHrTime)(n))}isRecording(){return this._ended===!1}recordException(e,n){let r={};typeof e=="string"?r[$i.SEMATTRS_EXCEPTION_MESSAGE]=e:e&&(e.code?r[$i.SEMATTRS_EXCEPTION_TYPE]=e.code.toString():e.name&&(r[$i.SEMATTRS_EXCEPTION_TYPE]=e.name),e.message&&(r[$i.SEMATTRS_EXCEPTION_MESSAGE]=e.message),e.stack&&(r[$i.SEMATTRS_EXCEPTION_STACKTRACE]=e.stack)),r[$i.SEMATTRS_EXCEPTION_TYPE]||r[$i.SEMATTRS_EXCEPTION_MESSAGE]?this.addEvent(FMe.ExceptionEventName,r,n):Yn.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&Yn.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,n){return e.length<=n?e:e.substring(0,n)}_truncateToSize(e){let n=this._attributeValueLengthLimit;return n<=0?(Yn.diag.warn(`Attribute value limit must be positive, got ${n}`),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(r=>typeof r=="string"?this._truncateToLimitUtil(r,n):r):e}};Tm.Span=JR});var Kl=m(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.SamplingDecision=void 0;var $Me;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})($Me=Yl.SamplingDecision||(Yl.SamplingDecision={}))});var hm=m(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.AlwaysOffSampler=void 0;var jMe=Kl(),QR=class{shouldSample(){return{decision:jMe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};gm.AlwaysOffSampler=QR});var Rm=m(Am=>{"use strict";Object.defineProperty(Am,"__esModule",{value:!0});Am.AlwaysOnSampler=void 0;var qMe=Kl(),ey=class{shouldSample(){return{decision:qMe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Am.AlwaysOnSampler=ey});var ry=m(Om=>{"use strict";Object.defineProperty(Om,"__esModule",{value:!0});Om.ParentBasedSampler=void 0;var ym=(L(),I(V)),YMe=fe(),jW=hm(),ty=Rm(),ny=class{constructor(e){var n,r,o,s;this._root=e.root,this._root||((0,YMe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ty.AlwaysOnSampler),this._remoteParentSampled=(n=e.remoteParentSampled)!==null&&n!==void 0?n:new ty.AlwaysOnSampler,this._remoteParentNotSampled=(r=e.remoteParentNotSampled)!==null&&r!==void 0?r:new jW.AlwaysOffSampler,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new ty.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new jW.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=ym.trace.getSpanContext(e);return!a||!(0,ym.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&ym.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&ym.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};Om.ParentBasedSampler=ny});var sy=m(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.TraceIdRatioBasedSampler=void 0;var KMe=(L(),I(V)),qW=Kl(),oy=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,KMe.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?qW.SamplingDecision.RECORD_AND_SAMPLED:qW.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};Nm.TraceIdRatioBasedSampler=oy});var cy=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.buildSamplerFromEnv=Rc.loadDefaultConfig=void 0;var Cm=(L(),I(V)),Oo=fe(),YW=hm(),iy=Rm(),ay=ry(),KW=sy(),WMe=Oo.TracesSamplerValues.AlwaysOn,Ac=1;function zMe(){let t=(0,Oo.getEnv)();return{sampler:zW(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}Rc.loadDefaultConfig=zMe;function zW(t=(0,Oo.getEnv)()){switch(t.OTEL_TRACES_SAMPLER){case Oo.TracesSamplerValues.AlwaysOn:return new iy.AlwaysOnSampler;case Oo.TracesSamplerValues.AlwaysOff:return new YW.AlwaysOffSampler;case Oo.TracesSamplerValues.ParentBasedAlwaysOn:return new ay.ParentBasedSampler({root:new iy.AlwaysOnSampler});case Oo.TracesSamplerValues.ParentBasedAlwaysOff:return new ay.ParentBasedSampler({root:new YW.AlwaysOffSampler});case Oo.TracesSamplerValues.TraceIdRatio:return new KW.TraceIdRatioBasedSampler(WW(t));case Oo.TracesSamplerValues.ParentBasedTraceIdRatio:return new ay.ParentBasedSampler({root:new KW.TraceIdRatioBasedSampler(WW(t))});default:return Cm.diag.error(`OTEL_TRACES_SAMPLER value "${t.OTEL_TRACES_SAMPLER} invalid, defaulting to ${WMe}".`),new iy.AlwaysOnSampler}}Rc.buildSamplerFromEnv=zW;function WW(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return Cm.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ac}.`),Ac;let e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Cm.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ac}.`),Ac):e<0||e>1?(Cm.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ac}.`),Ac):e}});var ly=m(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.reconfigureLimits=yc.mergeConfig=void 0;var XW=cy(),uy=fe();function XMe(t){let e={sampler:(0,XW.buildSamplerFromEnv)()},n=(0,XW.loadDefaultConfig)(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}yc.mergeConfig=XMe;function JMe(t){var e,n,r,o,s,i,a,c,u,l,d,p;let _=Object.assign({},t.spanLimits),f=(0,uy.getEnvWithoutDefaults)();return _.attributeCountLimit=(i=(s=(o=(n=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&n!==void 0?n:(r=t.generalLimits)===null||r===void 0?void 0:r.attributeCountLimit)!==null&&o!==void 0?o:f.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:f.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:uy.DEFAULT_ATTRIBUTE_COUNT_LIMIT,_.attributeValueLengthLimit=(p=(d=(l=(c=(a=t.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&c!==void 0?c:(u=t.generalLimits)===null||u===void 0?void 0:u.attributeValueLengthLimit)!==null&&l!==void 0?l:f.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&d!==void 0?d:f.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:uy.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:_})}yc.reconfigureLimits=JMe});var JW=m(vm=>{"use strict";Object.defineProperty(vm,"__esModule",{value:!0});vm.BatchSpanProcessorBase=void 0;var Oc=(L(),I(V)),ji=fe(),dy=class{constructor(e,n){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let r=(0,ji.getEnv)();this._maxExportBatchSize=typeof n?.maxExportBatchSize=="number"?n.maxExportBatchSize:r.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof n?.maxQueueSize=="number"?n.maxQueueSize:r.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof n?.scheduledDelayMillis=="number"?n.scheduledDelayMillis:r.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof n?.exportTimeoutMillis=="number"?n.exportTimeoutMillis:r.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new ji.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Oc.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,n){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Oc.TraceFlags.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Oc.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Oc.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,n)=>{let r=[],o=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,i=o;s<i;s++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(n)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,n)=>{let r=setTimeout(()=>{n(new Error("Timeout"))},this._exportTimeoutMillis);Oc.context.with((0,ji.suppressTracing)(Oc.context.active()),()=>{let o;this._finishedSpans.length<=this._maxExportBatchSize?(o=this._finishedSpans,this._finishedSpans=[]):o=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(o,a=>{var c;clearTimeout(r),a.code===ji.ExportResultCode.SUCCESS?e():n((c=a.error)!==null&&c!==void 0?c:new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let a=0,c=o.length;a<c;a++){let u=o[a];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(i??(i=[]),i.push(u.resource.waitForAsyncAttributes()))}i===null?s():Promise.all(i).then(s,a=>{(0,ji.globalErrorHandler)(a),n(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,ji.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,ji.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};vm.BatchSpanProcessorBase=dy});var ZW=m(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.BatchSpanProcessor=void 0;var ZMe=JW(),py=class extends ZMe.BatchSpanProcessorBase{onShutdown(){}};Im.BatchSpanProcessor=py});var t2=m(bm=>{"use strict";Object.defineProperty(bm,"__esModule",{value:!0});bm.RandomIdGenerator=void 0;var QMe=8,e2=16,_y=class{constructor(){this.generateTraceId=QW(e2),this.generateSpanId=QW(QMe)}};bm.RandomIdGenerator=_y;var Pm=Buffer.allocUnsafe(e2);function QW(t){return function(){for(let n=0;n<t/4;n++)Pm.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(Pm[n]>0);n++)n===t-1&&(Pm[t-1]=1);return Pm.toString("hex",0,t)}}});var n2=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.RandomIdGenerator=Nc.BatchSpanProcessor=void 0;var eLe=ZW();Object.defineProperty(Nc,"BatchSpanProcessor",{enumerable:!0,get:function(){return eLe.BatchSpanProcessor}});var tLe=t2();Object.defineProperty(Nc,"RandomIdGenerator",{enumerable:!0,get:function(){return tLe.RandomIdGenerator}})});var Mm=m(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.RandomIdGenerator=Cc.BatchSpanProcessor=void 0;var r2=n2();Object.defineProperty(Cc,"BatchSpanProcessor",{enumerable:!0,get:function(){return r2.BatchSpanProcessor}});Object.defineProperty(Cc,"RandomIdGenerator",{enumerable:!0,get:function(){return r2.RandomIdGenerator}})});var my=m(xm=>{"use strict";Object.defineProperty(xm,"__esModule",{value:!0});xm.Tracer=void 0;var Pt=(L(),I(V)),Lm=fe(),nLe=ZR(),rLe=ly(),oLe=Mm(),fy=class{constructor(e,n,r){this._tracerProvider=r;let o=(0,rLe.mergeConfig)(n);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=n.idGenerator||new oLe.RandomIdGenerator,this.resource=r.resource,this.instrumentationLibrary=e}startSpan(e,n={},r=Pt.context.active()){var o,s,i;n.root&&(r=Pt.trace.deleteSpan(r));let a=Pt.trace.getSpan(r);if((0,Lm.isTracingSuppressed)(r))return Pt.diag.debug("Instrumentation suppressed, returning Noop Span"),Pt.trace.wrapSpanContext(Pt.INVALID_SPAN_CONTEXT);let c=a?.spanContext(),u=this._idGenerator.generateSpanId(),l,d,p;!c||!Pt.trace.isSpanContextValid(c)?l=this._idGenerator.generateTraceId():(l=c.traceId,d=c.traceState,p=c.spanId);let _=(o=n.kind)!==null&&o!==void 0?o:Pt.SpanKind.INTERNAL,f=((s=n.links)!==null&&s!==void 0?s:[]).map(R=>({context:R.context,attributes:(0,Lm.sanitizeAttributes)(R.attributes)})),E=(0,Lm.sanitizeAttributes)(n.attributes),S=this._sampler.shouldSample(r,l,e,_,E,f);d=(i=S.traceState)!==null&&i!==void 0?i:d;let g=S.decision===Pt.SamplingDecision.RECORD_AND_SAMPLED?Pt.TraceFlags.SAMPLED:Pt.TraceFlags.NONE,h={traceId:l,spanId:u,traceFlags:g,traceState:d};if(S.decision===Pt.SamplingDecision.NOT_RECORD)return Pt.diag.debug("Recording is off, propagating context in a non-recording span"),Pt.trace.wrapSpanContext(h);let O=(0,Lm.sanitizeAttributes)(Object.assign(E,S.attributes));return new nLe.Span(this,r,e,h,_,p,f,n.startTime,void 0,O)}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??Pt.context.active(),u=this.startSpan(e,s,c),l=Pt.trace.setSpan(c,u);return Pt.context.with(l,a,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};xm.Tracer=fy});var o2=m(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.defaultServiceName=void 0;function sLe(){return`unknown_service:${process.argv0}`}Dm.defaultServiceName=sLe});var s2=m(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.defaultServiceName=void 0;var iLe=o2();Object.defineProperty(Um,"defaultServiceName",{enumerable:!0,get:function(){return iLe.defaultServiceName}})});var Ey=m(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.defaultServiceName=void 0;var aLe=s2();Object.defineProperty(wm,"defaultServiceName",{enumerable:!0,get:function(){return aLe.defaultServiceName}})});var No=m(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.Resource=void 0;var i2=(L(),I(V)),qi=(Vn(),I(kn)),Sy=fe(),cLe=Ey(),Wl=class t{constructor(e,n){var r;this._attributes=e,this.asyncAttributesPending=n!=null,this._syncAttributes=(r=this._attributes)!==null&&r!==void 0?r:{},this._asyncAttributesPromise=n?.then(o=>(this._attributes=Object.assign({},this._attributes,o),this.asyncAttributesPending=!1,o),o=>(i2.diag.debug("a resource's async attributes promise rejected: %s",o),this.asyncAttributesPending=!1,{}))}static empty(){return t.EMPTY}static default(){return new t({[qi.SEMRESATTRS_SERVICE_NAME]:(0,cLe.defaultServiceName)(),[qi.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]:Sy.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE],[qi.SEMRESATTRS_TELEMETRY_SDK_NAME]:Sy.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_NAME],[qi.SEMRESATTRS_TELEMETRY_SDK_VERSION]:Sy.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&i2.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var n;if(!e)return this;let r=Object.assign(Object.assign({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(r);let o=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,i])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),i)});return new t(r,o)}};km.Resource=Wl;Wl.EMPTY=new Wl({})});var Ty=m(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.normalizeType=vc.normalizeArch=void 0;var uLe=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};vc.normalizeArch=uLe;var lLe=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};vc.normalizeType=lLe});var Bm=m(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.execAsync=void 0;var dLe=require("child_process"),pLe=require("util");Vm.execAsync=pLe.promisify(dLe.exec)});var a2=m(Gm=>{"use strict";Object.defineProperty(Gm,"__esModule",{value:!0});Gm.getMachineId=void 0;var _Le=Bm(),fLe=(L(),I(V));async function mLe(){try{let e=(await(0,_Le.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
6
- `).find(r=>r.includes("IOPlatformUUID"));if(!e)return"";let n=e.split('" = "');if(n.length===2)return n[1].slice(0,-1)}catch(t){fLe.diag.debug(`error reading machine id: ${t}`)}return""}Gm.getMachineId=mLe});var c2=m(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.getMachineId=void 0;var ELe=require("fs"),SLe=(L(),I(V));async function TLe(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await ELe.promises.readFile(e,{encoding:"utf8"})).trim()}catch(n){SLe.diag.debug(`error reading machine id: ${n}`)}return""}Hm.getMachineId=TLe});var l2=m(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.getMachineId=void 0;var gLe=require("fs"),hLe=Bm(),u2=(L(),I(V));async function ALe(){try{return(await gLe.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){u2.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,hLe.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){u2.diag.debug(`error reading machine id: ${t}`)}return""}Fm.getMachineId=ALe});var p2=m($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.getMachineId=void 0;var d2=require("process"),RLe=Bm(),yLe=(L(),I(V));async function OLe(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";d2.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in d2.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let r=(await(0,RLe.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(r.length===2)return r[1].trim()}catch(n){yLe.diag.debug(`error reading machine id: ${n}`)}return""}$m.getMachineId=OLe});var _2=m(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});jm.getMachineId=void 0;var NLe=(L(),I(V));async function CLe(){return NLe.diag.debug("could not read machine-id: unsupported platform"),""}jm.getMachineId=CLe});var f2=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.getMachineId=void 0;var vLe=require("process"),Ic;Co.getMachineId=Ic;switch(vLe.platform){case"darwin":Co.getMachineId=Ic=a2().getMachineId;break;case"linux":Co.getMachineId=Ic=c2().getMachineId;break;case"freebsd":Co.getMachineId=Ic=l2().getMachineId;break;case"win32":Co.getMachineId=Ic=p2().getMachineId;break;default:Co.getMachineId=Ic=_2().getMachineId}});var Ay=m(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.hostDetectorSync=void 0;var gy=(Vn(),I(kn)),ILe=No(),m2=require("os"),PLe=Ty(),bLe=f2(),hy=class{detect(e){let n={[gy.SEMRESATTRS_HOST_NAME]:(0,m2.hostname)(),[gy.SEMRESATTRS_HOST_ARCH]:(0,PLe.normalizeArch)((0,m2.arch)())};return new ILe.Resource(n,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,bLe.getMachineId)().then(e=>{let n={};return e&&(n[gy.SEMRESATTRS_HOST_ID]=e),n})}};qm.hostDetectorSync=new hy});var E2=m(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.hostDetector=void 0;var MLe=Ay(),Ry=class{detect(e){return Promise.resolve(MLe.hostDetectorSync.detect(e))}};Ym.hostDetector=new Ry});var Oy=m(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.osDetectorSync=void 0;var S2=(Vn(),I(kn)),LLe=No(),T2=require("os"),xLe=Ty(),yy=class{detect(e){let n={[S2.SEMRESATTRS_OS_TYPE]:(0,xLe.normalizeType)((0,T2.platform)()),[S2.SEMRESATTRS_OS_VERSION]:(0,T2.release)()};return new LLe.Resource(n)}};Km.osDetectorSync=new yy});var g2=m(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.osDetector=void 0;var DLe=Oy(),Ny=class{detect(e){return Promise.resolve(DLe.osDetectorSync.detect(e))}};Wm.osDetector=new Ny});var vy=m(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.processDetectorSync=void 0;var ULe=(L(),I(V)),vo=(Vn(),I(kn)),wLe=No(),kLe=require("os"),Cy=class{detect(e){let n={[vo.SEMRESATTRS_PROCESS_PID]:process.pid,[vo.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]:process.title,[vo.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]:process.execPath,[vo.SEMRESATTRS_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[vo.SEMRESATTRS_PROCESS_RUNTIME_VERSION]:process.versions.node,[vo.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"nodejs",[vo.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(n[vo.SEMRESATTRS_PROCESS_COMMAND]=process.argv[1]);try{let r=kLe.userInfo();n[vo.SEMRESATTRS_PROCESS_OWNER]=r.username}catch(r){ULe.diag.debug(`error obtaining process owner: ${r}`)}return new wLe.Resource(n)}};zm.processDetectorSync=new Cy});var h2=m(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.processDetector=void 0;var VLe=vy(),Iy=class{detect(e){return Promise.resolve(VLe.processDetectorSync.detect(e))}};Xm.processDetector=new Iy});var A2=m(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.serviceInstanceIdDetectorSync=void 0;var BLe=(Vn(),I(kn)),GLe=No(),HLe=require("crypto"),Py=class{detect(e){let n={[BLe.SEMRESATTRS_SERVICE_INSTANCE_ID]:(0,HLe.randomUUID)()};return new GLe.Resource(n)}};Jm.serviceInstanceIdDetectorSync=new Py});var R2=m($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.serviceInstanceIdDetectorSync=$t.processDetectorSync=$t.processDetector=$t.osDetectorSync=$t.osDetector=$t.hostDetectorSync=$t.hostDetector=void 0;var FLe=E2();Object.defineProperty($t,"hostDetector",{enumerable:!0,get:function(){return FLe.hostDetector}});var $Le=Ay();Object.defineProperty($t,"hostDetectorSync",{enumerable:!0,get:function(){return $Le.hostDetectorSync}});var jLe=g2();Object.defineProperty($t,"osDetector",{enumerable:!0,get:function(){return jLe.osDetector}});var qLe=Oy();Object.defineProperty($t,"osDetectorSync",{enumerable:!0,get:function(){return qLe.osDetectorSync}});var YLe=h2();Object.defineProperty($t,"processDetector",{enumerable:!0,get:function(){return YLe.processDetector}});var KLe=vy();Object.defineProperty($t,"processDetectorSync",{enumerable:!0,get:function(){return KLe.processDetectorSync}});var WLe=A2();Object.defineProperty($t,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return WLe.serviceInstanceIdDetectorSync}})});var y2=m(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.serviceInstanceIdDetectorSync=jt.processDetectorSync=jt.processDetector=jt.osDetectorSync=jt.osDetector=jt.hostDetectorSync=jt.hostDetector=void 0;var Yi=R2();Object.defineProperty(jt,"hostDetector",{enumerable:!0,get:function(){return Yi.hostDetector}});Object.defineProperty(jt,"hostDetectorSync",{enumerable:!0,get:function(){return Yi.hostDetectorSync}});Object.defineProperty(jt,"osDetector",{enumerable:!0,get:function(){return Yi.osDetector}});Object.defineProperty(jt,"osDetectorSync",{enumerable:!0,get:function(){return Yi.osDetectorSync}});Object.defineProperty(jt,"processDetector",{enumerable:!0,get:function(){return Yi.processDetector}});Object.defineProperty(jt,"processDetectorSync",{enumerable:!0,get:function(){return Yi.processDetectorSync}});Object.defineProperty(jt,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return Yi.serviceInstanceIdDetectorSync}})});var Ly=m(Qm=>{"use strict";Object.defineProperty(Qm,"__esModule",{value:!0});Qm.browserDetectorSync=void 0;var Zm=(Vn(),I(kn)),zLe=(L(),I(V)),by=No(),My=class{detect(e){var n,r,o;if(!(typeof navigator<"u"&&((r=(n=global.process)===null||n===void 0?void 0:n.versions)===null||r===void 0?void 0:r.node)===void 0&&((o=global.Bun)===null||o===void 0?void 0:o.version)===void 0))return by.Resource.empty();let i={[Zm.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"browser",[Zm.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[Zm.SEMRESATTRS_PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,n){return e[Zm.SEMRESATTRS_PROCESS_RUNTIME_VERSION]===""?(zLe.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),by.Resource.empty()):new by.Resource(Object.assign({},e))}};Qm.browserDetectorSync=new My});var O2=m(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.browserDetector=void 0;var XLe=Ly(),xy=class{detect(e){return Promise.resolve(XLe.browserDetectorSync.detect(e))}};eE.browserDetector=new xy});var Uy=m(tE=>{"use strict";Object.defineProperty(tE,"__esModule",{value:!0});tE.envDetectorSync=void 0;var JLe=(L(),I(V)),ZLe=fe(),QLe=(Vn(),I(kn)),exe=No(),Dy=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let n={},r=(0,ZLe.getEnv)(),o=r.OTEL_RESOURCE_ATTRIBUTES,s=r.OTEL_SERVICE_NAME;if(o)try{let i=this._parseResourceAttributes(o);Object.assign(n,i)}catch(i){JLe.diag.debug(`EnvDetector failed: ${i.message}`)}return s&&(n[QLe.SEMRESATTRS_SERVICE_NAME]=s),new exe.Resource(n)}_parseResourceAttributes(e){if(!e)return{};let n={},r=e.split(this._COMMA_SEPARATOR,-1);for(let o of r){let s=o.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[i,a]=s;if(i=i.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);n[i]=decodeURIComponent(a)}return n}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<33||r===44||r===59||r===92||r>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};tE.envDetectorSync=new Dy});var N2=m(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.envDetector=void 0;var txe=Uy(),wy=class{detect(e){return Promise.resolve(txe.envDetectorSync.detect(e))}};nE.envDetector=new wy});var C2=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.envDetectorSync=xe.browserDetectorSync=xe.envDetector=xe.browserDetector=xe.serviceInstanceIdDetectorSync=xe.processDetectorSync=xe.processDetector=xe.osDetectorSync=xe.osDetector=xe.hostDetectorSync=xe.hostDetector=void 0;var Ki=y2();Object.defineProperty(xe,"hostDetector",{enumerable:!0,get:function(){return Ki.hostDetector}});Object.defineProperty(xe,"hostDetectorSync",{enumerable:!0,get:function(){return Ki.hostDetectorSync}});Object.defineProperty(xe,"osDetector",{enumerable:!0,get:function(){return Ki.osDetector}});Object.defineProperty(xe,"osDetectorSync",{enumerable:!0,get:function(){return Ki.osDetectorSync}});Object.defineProperty(xe,"processDetector",{enumerable:!0,get:function(){return Ki.processDetector}});Object.defineProperty(xe,"processDetectorSync",{enumerable:!0,get:function(){return Ki.processDetectorSync}});Object.defineProperty(xe,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return Ki.serviceInstanceIdDetectorSync}});var nxe=O2();Object.defineProperty(xe,"browserDetector",{enumerable:!0,get:function(){return nxe.browserDetector}});var rxe=N2();Object.defineProperty(xe,"envDetector",{enumerable:!0,get:function(){return rxe.envDetector}});var oxe=Ly();Object.defineProperty(xe,"browserDetectorSync",{enumerable:!0,get:function(){return oxe.browserDetectorSync}});var sxe=Uy();Object.defineProperty(xe,"envDetectorSync",{enumerable:!0,get:function(){return sxe.envDetectorSync}})});var v2=m(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});rE.isPromiseLike=void 0;var ixe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";rE.isPromiseLike=ixe});var P2=m(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.detectResourcesSync=bc.detectResources=void 0;var zl=No(),Pc=(L(),I(V)),axe=v2(),cxe=async(t={})=>{let e=await Promise.all((t.detectors||[]).map(async n=>{try{let r=await n.detect(t);return Pc.diag.debug(`${n.constructor.name} found resource.`,r),r}catch(r){return Pc.diag.debug(`${n.constructor.name} failed: ${r.message}`),zl.Resource.empty()}}));return I2(e),e.reduce((n,r)=>n.merge(r),zl.Resource.empty())};bc.detectResources=cxe;var uxe=(t={})=>{var e;let n=((e=t.detectors)!==null&&e!==void 0?e:[]).map(o=>{try{let s=o.detect(t),i;if((0,axe.isPromiseLike)(s)){let a=async()=>{var c;let u=await s;return await((c=u.waitForAsyncAttributes)===null||c===void 0?void 0:c.call(u)),u.attributes};i=new zl.Resource({},a())}else i=s;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=>Pc.diag.debug(`${o.constructor.name} found resource.`,i)):Pc.diag.debug(`${o.constructor.name} found resource.`,i),i}catch(s){return Pc.diag.error(`${o.constructor.name} failed: ${s.message}`),zl.Resource.empty()}}),r=n.reduce((o,s)=>o.merge(s),zl.Resource.empty());return r.waitForAsyncAttributes&&r.waitForAsyncAttributes().then(()=>{I2(n)}),r};bc.detectResourcesSync=uxe;var I2=t=>{t.forEach(e=>{if(Object.keys(e.attributes).length>0){let n=JSON.stringify(e.attributes,null,4);Pc.diag.verbose(n)}})}});var ky=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.detectResources=me.detectResourcesSync=me.serviceInstanceIdDetectorSync=me.processDetectorSync=me.processDetector=me.osDetectorSync=me.osDetector=me.hostDetectorSync=me.hostDetector=me.envDetectorSync=me.envDetector=me.browserDetectorSync=me.browserDetector=me.defaultServiceName=me.Resource=void 0;var lxe=No();Object.defineProperty(me,"Resource",{enumerable:!0,get:function(){return lxe.Resource}});var dxe=Ey();Object.defineProperty(me,"defaultServiceName",{enumerable:!0,get:function(){return dxe.defaultServiceName}});var Tr=C2();Object.defineProperty(me,"browserDetector",{enumerable:!0,get:function(){return Tr.browserDetector}});Object.defineProperty(me,"browserDetectorSync",{enumerable:!0,get:function(){return Tr.browserDetectorSync}});Object.defineProperty(me,"envDetector",{enumerable:!0,get:function(){return Tr.envDetector}});Object.defineProperty(me,"envDetectorSync",{enumerable:!0,get:function(){return Tr.envDetectorSync}});Object.defineProperty(me,"hostDetector",{enumerable:!0,get:function(){return Tr.hostDetector}});Object.defineProperty(me,"hostDetectorSync",{enumerable:!0,get:function(){return Tr.hostDetectorSync}});Object.defineProperty(me,"osDetector",{enumerable:!0,get:function(){return Tr.osDetector}});Object.defineProperty(me,"osDetectorSync",{enumerable:!0,get:function(){return Tr.osDetectorSync}});Object.defineProperty(me,"processDetector",{enumerable:!0,get:function(){return Tr.processDetector}});Object.defineProperty(me,"processDetectorSync",{enumerable:!0,get:function(){return Tr.processDetectorSync}});Object.defineProperty(me,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return Tr.serviceInstanceIdDetectorSync}});var b2=P2();Object.defineProperty(me,"detectResourcesSync",{enumerable:!0,get:function(){return b2.detectResourcesSync}});Object.defineProperty(me,"detectResources",{enumerable:!0,get:function(){return b2.detectResources}})});var M2=m(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.MultiSpanProcessor=void 0;var pxe=fe(),Vy=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let n of this._spanProcessors)e.push(n.forceFlush());return new Promise(n=>{Promise.all(e).then(()=>{n()}).catch(r=>{(0,pxe.globalErrorHandler)(r||new Error("MultiSpanProcessor: forceFlush failed")),n()})})}onStart(e,n){for(let r of this._spanProcessors)r.onStart(e,n)}onEnd(e){for(let n of this._spanProcessors)n.onEnd(e)}shutdown(){let e=[];for(let n of this._spanProcessors)e.push(n.shutdown());return new Promise((n,r)=>{Promise.all(e).then(()=>{n()},r)})}};oE.MultiSpanProcessor=Vy});var Gy=m(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});sE.NoopSpanProcessor=void 0;var By=class{onStart(e,n){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};sE.NoopSpanProcessor=By});var D2=m(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.BasicTracerProvider=Wi.ForceFlushState=void 0;var Mc=(L(),I(V)),xc=fe(),L2=ky(),_xe=my(),fxe=cy(),x2=M2(),mxe=Gy(),Exe=Mm(),Sxe=ly(),Lc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Lc=Wi.ForceFlushState||(Wi.ForceFlushState={}));var Xl=class{constructor(e={}){var n,r;this._registeredSpanProcessors=[],this._tracers=new Map;let o=(0,xc.merge)({},(0,fxe.loadDefaultConfig)(),(0,Sxe.reconfigureLimits)(e));if(this.resource=(n=o.resource)!==null&&n!==void 0?n:L2.Resource.empty(),o.mergeResourceWithDefaults&&(this.resource=L2.Resource.default().merge(this.resource)),this._config=Object.assign({},o,{resource:this.resource}),!((r=e.spanProcessors)===null||r===void 0)&&r.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new x2.MultiSpanProcessor(this._registeredSpanProcessors);else{let s=this._buildExporterFromEnv();if(s!==void 0){let i=new Exe.BatchSpanProcessor(s);this.activeSpanProcessor=i}else this.activeSpanProcessor=new mxe.NoopSpanProcessor}}getTracer(e,n,r){let o=`${e}@${n||""}:${r?.schemaUrl||""}`;return this._tracers.has(o)||this._tracers.set(o,new _xe.Tracer({name:e,version:n,schemaUrl:r?.schemaUrl},this._config,this)),this._tracers.get(o)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(n=>Mc.diag.error("Error while trying to shutdown current span processor",n)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new x2.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){Mc.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&Mc.context.setGlobalContextManager(e.contextManager),e.propagator&&Mc.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,n=this._registeredSpanProcessors.map(r=>new Promise(o=>{let s,i=setTimeout(()=>{o(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=Lc.timeout},e);r.forceFlush().then(()=>{clearTimeout(i),s!==Lc.timeout&&(s=Lc.resolved,o(s))}).catch(a=>{clearTimeout(i),s=Lc.error,o(a)})}));return new Promise((r,o)=>{Promise.all(n).then(s=>{let i=s.filter(a=>a!==Lc.resolved);i.length>0?o(i):r()}).catch(s=>o([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var n;return(n=this.constructor._registeredPropagators.get(e))===null||n===void 0?void 0:n()}_getSpanExporter(e){var n;return(n=this.constructor._registeredExporters.get(e))===null||n===void 0?void 0:n()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,xc.getEnv)().OTEL_PROPAGATORS)),r=e.map(o=>{let s=this._getPropagator(o);return s||Mc.diag.warn(`Propagator "${o}" requested through environment variable is unavailable.`),s}).reduce((o,s)=>(s&&o.push(s),o),[]);if(r.length!==0)return e.length===1?r[0]:new xc.CompositePropagator({propagators:r})}_buildExporterFromEnv(){let e=(0,xc.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let n=this._getSpanExporter(e);return n||Mc.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),n}};Wi.BasicTracerProvider=Xl;Xl._registeredPropagators=new Map([["tracecontext",()=>new xc.W3CTraceContextPropagator],["baggage",()=>new xc.W3CBaggagePropagator]]);Xl._registeredExporters=new Map});var U2=m(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});iE.ConsoleSpanExporter=void 0;var Hy=fe(),Fy=class{export(e,n){return this._sendSpans(e,n)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var n;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(n=e.spanContext().traceState)===null||n===void 0?void 0:n.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,Hy.hrTimeToMicroseconds)(e.startTime),duration:(0,Hy.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,n){for(let r of e)console.dir(this._exportInfo(r),{depth:3});if(n)return n({code:Hy.ExportResultCode.SUCCESS})}};iE.ConsoleSpanExporter=Fy});var k2=m(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});aE.InMemorySpanExporter=void 0;var w2=fe(),$y=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,n){if(this._stopped)return n({code:w2.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>n({code:w2.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};aE.InMemorySpanExporter=$y});var V2=m(cE=>{"use strict";Object.defineProperty(cE,"__esModule",{value:!0});cE.SimpleSpanProcessor=void 0;var Txe=(L(),I(V)),Dc=fe(),jy=class{constructor(e){this._exporter=e,this._shutdownOnce=new Dc.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,n){}onEnd(e){var n,r;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Txe.TraceFlags.SAMPLED)===0)return;let o=()=>Dc.internal._export(this._exporter,[e]).then(s=>{var i;s.code!==Dc.ExportResultCode.SUCCESS&&(0,Dc.globalErrorHandler)((i=s.error)!==null&&i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Dc.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(r=(n=e.resource).waitForAsyncAttributes)===null||r===void 0?void 0:r.call(n).then(()=>(s!=null&&this._unresolvedExports.delete(s),o()),i=>(0,Dc.globalErrorHandler)(i));s!=null&&this._unresolvedExports.add(s)}else o()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};cE.SimpleSpanProcessor=jy});var qy=m(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.Span=Ee.SamplingDecision=Ee.TraceIdRatioBasedSampler=Ee.ParentBasedSampler=Ee.AlwaysOnSampler=Ee.AlwaysOffSampler=Ee.NoopSpanProcessor=Ee.SimpleSpanProcessor=Ee.InMemorySpanExporter=Ee.ConsoleSpanExporter=Ee.RandomIdGenerator=Ee.BatchSpanProcessor=Ee.ForceFlushState=Ee.BasicTracerProvider=Ee.Tracer=void 0;var gxe=my();Object.defineProperty(Ee,"Tracer",{enumerable:!0,get:function(){return gxe.Tracer}});var B2=D2();Object.defineProperty(Ee,"BasicTracerProvider",{enumerable:!0,get:function(){return B2.BasicTracerProvider}});Object.defineProperty(Ee,"ForceFlushState",{enumerable:!0,get:function(){return B2.ForceFlushState}});var G2=Mm();Object.defineProperty(Ee,"BatchSpanProcessor",{enumerable:!0,get:function(){return G2.BatchSpanProcessor}});Object.defineProperty(Ee,"RandomIdGenerator",{enumerable:!0,get:function(){return G2.RandomIdGenerator}});var hxe=U2();Object.defineProperty(Ee,"ConsoleSpanExporter",{enumerable:!0,get:function(){return hxe.ConsoleSpanExporter}});var Axe=k2();Object.defineProperty(Ee,"InMemorySpanExporter",{enumerable:!0,get:function(){return Axe.InMemorySpanExporter}});var Rxe=V2();Object.defineProperty(Ee,"SimpleSpanProcessor",{enumerable:!0,get:function(){return Rxe.SimpleSpanProcessor}});var yxe=Gy();Object.defineProperty(Ee,"NoopSpanProcessor",{enumerable:!0,get:function(){return yxe.NoopSpanProcessor}});var Oxe=hm();Object.defineProperty(Ee,"AlwaysOffSampler",{enumerable:!0,get:function(){return Oxe.AlwaysOffSampler}});var Nxe=Rm();Object.defineProperty(Ee,"AlwaysOnSampler",{enumerable:!0,get:function(){return Nxe.AlwaysOnSampler}});var Cxe=ry();Object.defineProperty(Ee,"ParentBasedSampler",{enumerable:!0,get:function(){return Cxe.ParentBasedSampler}});var vxe=sy();Object.defineProperty(Ee,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return vxe.TraceIdRatioBasedSampler}});var Ixe=Kl();Object.defineProperty(Ee,"SamplingDecision",{enumerable:!0,get:function(){return Ixe.SamplingDecision}});var Pxe=ZR();Object.defineProperty(Ee,"Span",{enumerable:!0,get:function(){return Pxe.Span}})});var gO=m(TE=>{"use strict";Object.defineProperty(TE,"__esModule",{value:!0});TE.AbstractAsyncHooksContextManager=void 0;var NDe=require("events"),CDe=["addListener","on","once","prependListener","prependOnceListener"],TO=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,n){return n instanceof NDe.EventEmitter?this._bindEventEmitter(e,n):typeof n=="function"?this._bindFunction(e,n):n}_bindFunction(e,n){let r=this,o=function(...s){return r.with(e,()=>n.apply(this,s))};return Object.defineProperty(o,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),o}_bindEventEmitter(e,n){return this._getPatchMap(n)!==void 0||(this._createPatchMap(n),CDe.forEach(o=>{n[o]!==void 0&&(n[o]=this._patchAddListener(n,n[o],e))}),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(e,n){let r=this;return function(o,s){var i;let a=(i=r._getPatchMap(e))===null||i===void 0?void 0:i[o];if(a===void 0)return n.call(this,o,s);let c=a.get(s);return n.call(this,o,c||s)}}_patchRemoveAllListeners(e,n){let r=this;return function(o){let s=r._getPatchMap(e);return s!==void 0&&(arguments.length===0?r._createPatchMap(e):s[o]!==void 0&&delete s[o]),n.apply(this,arguments)}}_patchAddListener(e,n,r){let o=this;return function(s,i){if(o._wrapped)return n.call(this,s,i);let a=o._getPatchMap(e);a===void 0&&(a=o._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let u=o.bind(r,i);c.set(i,u),o._wrapped=!0;try{return n.call(this,s,u)}finally{o._wrapped=!1}}}_createPatchMap(e){let n=Object.create(null);return e[this._kOtListeners]=n,n}_getPatchMap(e){return e[this._kOtListeners]}};TE.AbstractAsyncHooksContextManager=TO});var e5=m(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.AsyncHooksContextManager=void 0;var vDe=(L(),I(V)),IDe=require("async_hooks"),PDe=gO(),hO=class extends PDe.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=IDe.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:vDe.ROOT_CONTEXT}with(e,n,r,...o){this._enterContext(e);try{return n.call(r,...o)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,n){if(n==="TIMERWRAP")return;let r=this._stack[this._stack.length-1];r!==void 0&&this._contexts.set(e,r)}_destroy(e){this._contexts.delete(e)}_before(e){let n=this._contexts.get(e);n!==void 0&&this._enterContext(n)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};gE.AsyncHooksContextManager=hO});var t5=m(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.AsyncLocalStorageContextManager=void 0;var bDe=(L(),I(V)),MDe=require("async_hooks"),LDe=gO(),AO=class extends LDe.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new MDe.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:bDe.ROOT_CONTEXT}with(e,n,r,...o){let s=r==null?n:n.bind(r);return this._asyncLocalStorage.run(e,s,...o)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};hE.AsyncLocalStorageContextManager=AO});var n5=m(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AsyncLocalStorageContextManager=Fc.AsyncHooksContextManager=void 0;var xDe=e5();Object.defineProperty(Fc,"AsyncHooksContextManager",{enumerable:!0,get:function(){return xDe.AsyncHooksContextManager}});var DDe=t5();Object.defineProperty(Fc,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return DDe.AsyncLocalStorageContextManager}})});var R5=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.PACKAGE_NAME=$c.PACKAGE_VERSION=void 0;$c.PACKAGE_VERSION="0.10.1";$c.PACKAGE_NAME="@opentelemetry/instrumentation-undici"});var y5=m(IE=>{"use strict";Object.defineProperty(IE,"__esModule",{value:!0});IE.SemanticAttributes=void 0;IE.SemanticAttributes={HTTP_CONNECTION_STATE:"http.connection.state",ERROR_TYPE:"error.type",HTTP_REQUEST_BODY_SIZE:"http.request.body.size",HTTP_REQUEST_METHOD:"http.request.method",HTTP_REQUEST_METHOD_ORIGINAL:"http.request.method_original",HTTP_REQUEST_RESEND_COUNT:"http.request.resend_count",HTTP_RESPONSE_BODY_SIZE:"http.response.body.size",HTTP_RESPONSE_STATUS_CODE:"http.response.status_code",HTTP_ROUTE:"http.route",NETWORK_PEER_ADDRESS:"network.peer.address",NETWORK_PEER_PORT:"network.peer.port",NETWORK_PROTOCOL_NAME:"network.protocol.name",NETWORK_PROTOCOL_VERSION:"network.protocol.version",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port",URL_FULL:"url.full",URL_PATH:"url.path",URL_QUERY:"url.query",URL_SCHEME:"url.scheme",USER_AGENT_ORIGINAL:"user_agent.original"}});var N5=m(bE=>{"use strict";Object.defineProperty(bE,"__esModule",{value:!0});bE.UndiciInstrumentation=void 0;var ud=require("diagnostics_channel"),oUe=require("url"),ld=de(),Pn=(L(),I(V)),O5=R5(),_t=y5(),PE=fe(),PO=class extends ld.InstrumentationBase{constructor(e={}){super(O5.PACKAGE_NAME,O5.PACKAGE_VERSION,e),this._recordFromReq=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel("undici:request:create",this.onRequestCreated.bind(this)),this.subscribeToChannel("undici:client:sendHeaders",this.onRequestHeaders.bind(this)),this.subscribeToChannel("undici:request:headers",this.onResponseHeaders.bind(this)),this.subscribeToChannel("undici:request:trailers",this.onDone.bind(this)),this.subscribeToChannel("undici:request:error",this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram("http.client.request.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"s",valueType:Pn.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(e,n){var r;let[o,s]=process.version.replace("v","").split(".").map(c=>Number(c)),i=o>18||o===18&&s>=19,a;if(i)(r=ud.subscribe)===null||r===void 0||r.call(ud,e,n),a=()=>{var c;return(c=ud.unsubscribe)===null||c===void 0?void 0:c.call(ud,e,n)};else{let c=ud.channel(e);c.subscribe(n),a=()=>c.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:a})}onRequestCreated({request:e}){let n=this.getConfig(),r=n.enabled!==!1;if((0,ld.safeExecuteInTheMiddle)(()=>{var R;return!r||e.method==="CONNECT"||((R=n.ignoreRequestHook)===null||R===void 0?void 0:R.call(n,e))},R=>R&&this._diag.error("caught ignoreRequestHook error: ",R),!0))return;let s=(0,PE.hrTime)(),i;try{i=new oUe.URL(e.path,e.origin)}catch(R){this._diag.warn("could not determine url.full:",R);return}let a=i.protocol.replace(":",""),c=this.getRequestMethod(e.method),u={[_t.SemanticAttributes.HTTP_REQUEST_METHOD]:c,[_t.SemanticAttributes.HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[_t.SemanticAttributes.URL_FULL]:i.toString(),[_t.SemanticAttributes.URL_PATH]:i.pathname,[_t.SemanticAttributes.URL_QUERY]:i.search,[_t.SemanticAttributes.URL_SCHEME]:a},l={https:"443",http:"80"},d=i.hostname,p=i.port||l[a];u[_t.SemanticAttributes.SERVER_ADDRESS]=d,p&&!isNaN(Number(p))&&(u[_t.SemanticAttributes.SERVER_PORT]=Number(p));let _;if(Array.isArray(e.headers)){let R=e.headers.findIndex(M=>M.toLowerCase()==="user-agent");R>=0&&(_=e.headers[R+1])}else if(typeof e.headers=="string"){let M=e.headers.split(`\r
7
- `).find(P=>P.toLowerCase().startsWith("user-agent"));_=M&&M.substring(M.indexOf(":")+1).trim()}_&&(u[_t.SemanticAttributes.USER_AGENT_ORIGINAL]=_);let f=(0,ld.safeExecuteInTheMiddle)(()=>{var R;return(R=n.startSpanHook)===null||R===void 0?void 0:R.call(n,e)},R=>R&&this._diag.error("caught startSpanHook error: ",R),!0);f&&Object.entries(f).forEach(([R,M])=>{u[R]=M});let E=Pn.context.active(),S=Pn.trace.getSpan(E),g;n.requireParentforSpans&&(!S||!Pn.trace.isSpanContextValid(S.spanContext()))?g=Pn.trace.wrapSpanContext(Pn.INVALID_SPAN_CONTEXT):g=this.tracer.startSpan(c==="_OTHER"?"HTTP":c,{kind:Pn.SpanKind.CLIENT,attributes:u},E),(0,ld.safeExecuteInTheMiddle)(()=>{var R;return(R=n.requestHook)===null||R===void 0?void 0:R.call(n,g,e)},R=>R&&this._diag.error("caught requestHook error: ",R),!0);let h=Pn.trace.setSpan(Pn.context.active(),g),O={};Pn.propagation.inject(h,O);let N=Object.entries(O);for(let R=0;R<N.length;R++){let[M,P]=N[R];typeof e.addHeader=="function"?e.addHeader(M,P):typeof e.headers=="string"?e.headers+=`${M}: ${P}\r
3
+ `+s),t.push(o+"m+"+cf.exports.humanize(this.diff)+"\x1B[0m")}else t[0]=_Ee()+e+" "+t[0]}function _Ee(){return Rt.inspectOpts.hideDate?"":new Date().toISOString()+" "}function fEe(...t){return process.stderr.write(af.formatWithOptions(Rt.inspectOpts,...t)+`
4
+ `)}function mEe(t){t?process.env.DEBUG=t:delete process.env.DEBUG}function EEe(){return process.env.DEBUG}function SEe(t){t.inspectOpts={};let e=Object.keys(Rt.inspectOpts);for(let n=0;n<e.length;n++)t.inspectOpts[e[n]]=Rt.inspectOpts[e[n]]}cf.exports=Hh()(Rt);var{formatters:bk}=cf.exports;bk.o=function(t){return this.inspectOpts.colors=this.useColors,af.inspect(t,this.inspectOpts).split(`
5
+ `).map(e=>e.trim()).join(" ")};bk.O=function(t){return this.inspectOpts.colors=this.useColors,af.inspect(t,this.inspectOpts)}});var Lk=m((aKe,jh)=>{typeof process>"u"||process.type==="renderer"||process.browser===!0||process.__nwjs?jh.exports=Ok():jh.exports=Mk()});var Yh=m((cKe,xk)=>{"use strict";var qh=require("path").sep;xk.exports=function(t){var e=t.split(qh),n=e.lastIndexOf("node_modules");if(n!==-1&&e[n+1]){for(var r=e[n+1][0]==="@",o=r?e[n+1]+"/"+e[n+2]:e[n+1],s=r?3:2,i="",a=n+s-1,c=0;c<=a;c++)c===a?i+=e[c]:i+=e[c]+qh;for(var u="",l=e.length-1,d=n+s;d<=l;d++)d===l?u+=e[d]:u+=e[d]+qh;return{name:o,basedir:i,path:u}}}});var Kh=m((uKe,Dk)=>{"use strict";var TEe=require("os");Dk.exports=TEe.homedir||function(){var e=process.env.HOME,n=process.env.LOGNAME||process.env.USER||process.env.LNAME||process.env.USERNAME;return process.platform==="win32"?process.env.USERPROFILE||process.env.HOMEDRIVE&&process.env.HOMEPATH&&process.env.HOMEDRIVE+process.env.HOMEPATH||e||null:process.platform==="darwin"?e||(n?"/Users/"+n:null):process.platform==="linux"?e||(process.getuid()===0?"/root":n?"/home/"+n:null):e||null}});var uf=m((lKe,Uk)=>{"use strict";Uk.exports=Error});var Wh=m((dKe,wk)=>{"use strict";var lf=uf();wk.exports=function(){var t=lf.prepareStackTrace;lf.prepareStackTrace=function(n,r){return r};var e=new lf().stack;return lf.prepareStackTrace=t,e[2].getFileName()}});var kk=m((pKe,pl)=>{"use strict";var gEe=process.platform==="win32",hEe=/^(((?:[a-zA-Z]:|[\\\/]{2}[^\\\/]+[\\\/]+[^\\\/]+)?[\\\/]?)(?:[^\\\/]*[\\\/])*)((\.{1,2}|[^\\\/]+?|)(\.[^.\/\\]*|))[\\\/]*$/,zh={};function AEe(t){return hEe.exec(t).slice(1)}zh.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=AEe(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0]===e[1]?e[0]:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};var REe=/^((\/?)(?:[^\/]*\/)*)((\.{1,2}|[^\/]+?|)(\.[^.\/]*|))[\/]*$/,Xh={};function yEe(t){return REe.exec(t).slice(1)}Xh.parse=function(t){if(typeof t!="string")throw new TypeError("Parameter 'pathString' must be a string, not "+typeof t);var e=yEe(t);if(!e||e.length!==5)throw new TypeError("Invalid path '"+t+"'");return{root:e[1],dir:e[0].slice(0,-1),base:e[2],ext:e[4],name:e[3]}};gEe?pl.exports=zh.parse:pl.exports=Xh.parse;pl.exports.posix=Xh.parse;pl.exports.win32=zh.parse});var Jh=m((_Ke,Hk)=>{var Gk=require("path"),Vk=Gk.parse||kk(),OEe=/^([A-Za-z]:)/,NEe=/^\\\\/;function Bk(t,e){var n="/";OEe.test(t)?n="":NEe.test(t)&&(n="\\\\");for(var r=[t],o=Vk(t);o.dir!==r[r.length-1];)r.push(o.dir),o=Vk(o.dir);return r.reduce(function(s,i){return s.concat(e.map(function(a){return Gk.resolve(n,i,a)}))},[])}Hk.exports=function(e,n,r){var o=n&&n.moduleDirectory?[].concat(n.moduleDirectory):["node_modules"];if(n&&typeof n.paths=="function")return n.paths(r,e,function(){return Bk(e,o)},n);var s=Bk(e,o);return n&&n.paths?s.concat(n.paths):s}});var Zh=m((fKe,Fk)=>{Fk.exports=function(t,e){return e||{}}});var qk=m((mKe,jk)=>{"use strict";var CEe="Function.prototype.bind called on incompatible ",vEe=Object.prototype.toString,IEe=Math.max,PEe="[object Function]",$k=function(e,n){for(var r=[],o=0;o<e.length;o+=1)r[o]=e[o];for(var s=0;s<n.length;s+=1)r[s+e.length]=n[s];return r},bEe=function(e,n){for(var r=[],o=n||0,s=0;o<e.length;o+=1,s+=1)r[s]=e[o];return r},MEe=function(t,e){for(var n="",r=0;r<t.length;r+=1)n+=t[r],r+1<t.length&&(n+=e);return n};jk.exports=function(e){var n=this;if(typeof n!="function"||vEe.apply(n)!==PEe)throw new TypeError(CEe+n);for(var r=bEe(arguments,1),o,s=function(){if(this instanceof o){var l=n.apply(this,$k(r,arguments));return Object(l)===l?l:this}return n.apply(e,$k(r,arguments))},i=IEe(0,n.length-r.length),a=[],c=0;c<i;c++)a[c]="$"+c;if(o=Function("binder","return function ("+MEe(a,",")+"){ return binder.apply(this,arguments); }")(s),n.prototype){var u=function(){};u.prototype=n.prototype,o.prototype=new u,u.prototype=null}return o}});var Kk=m((EKe,Yk)=>{"use strict";var LEe=qk();Yk.exports=Function.prototype.bind||LEe});var zk=m((SKe,Wk)=>{"use strict";var xEe=Function.prototype.call,DEe=Object.prototype.hasOwnProperty,UEe=Kk();Wk.exports=UEe.call(xEe,DEe)});var Xk=m((TKe,wEe)=>{wEe.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var _l=m((gKe,Qk)=>{"use strict";var kEe=zk();function VEe(t,e){for(var n=t.split("."),r=e.split(" "),o=r.length>1?r[0]:"=",s=(r.length>1?r[1]:r[0]).split("."),i=0;i<3;++i){var a=parseInt(n[i]||0,10),c=parseInt(s[i]||0,10);if(a!==c)return o==="<"?a<c:o===">="?a>=c:!1}return o===">="}function Jk(t,e){var n=e.split(/ ?&& ?/);if(n.length===0)return!1;for(var r=0;r<n.length;++r)if(!VEe(t,n[r]))return!1;return!0}function BEe(t,e){if(typeof e=="boolean")return e;var n=typeof t>"u"?process.versions&&process.versions.node:t;if(typeof n!="string")throw new TypeError(typeof t>"u"?"Unable to determine current node version":"If provided, a valid node version is required");if(e&&typeof e=="object"){for(var r=0;r<e.length;++r)if(Jk(n,e[r]))return!0;return!1}return Jk(n,e)}var Zk=Xk();Qk.exports=function(e,n){return kEe(Zk,e)&&BEe(n,Zk[e])}});var Qh=m((hKe,eV)=>{"use strict";eV.exports=TypeError});var rV=m((AKe,nV)=>{var Pi=require("fs"),GEe=Kh(),nt=require("path"),HEe=Wh(),FEe=Jh(),$Ee=Zh(),jEe=_l(),tV=uf(),eA=Qh(),qEe=process.platform!=="win32"&&Pi.realpath&&typeof Pi.realpath.native=="function"?Pi.realpath.native:Pi.realpath,YEe=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,KEe=/^\w:[/\\]*$/,WEe=/[/\\]node_modules[/\\]*$/,tA=GEe();function zEe(){return tA?[nt.join(tA,".node_modules"),nt.join(tA,".node_libraries")]:[]}var XEe=function(e,n){Pi.stat(e,function(r,o){return r?r.code==="ENOENT"||r.code==="ENOTDIR"?n(null,!1):n(r):n(null,o.isFile()||o.isFIFO())})},JEe=function(e,n){Pi.stat(e,function(r,o){return r?r.code==="ENOENT"||r.code==="ENOTDIR"?n(null,!1):n(r):n(null,o.isDirectory())})},ZEe=function(e,n){qEe(e,function(r,o){r&&r.code!=="ENOENT"?n(r):n(null,r?e:o)})};function fl(t,e,n,r){n&&n.preserveSymlinks===!1?t(e,r):r(null,e)}function QEe(t,e,n){t(e,function(r,o){if(r)n(r);else try{var s=JSON.parse(o);n(null,s)}catch{n(null)}})}function eSe(t,e,n){for(var r=FEe(e,n,t),o=0;o<r.length;o++)r[o]=nt.join(r[o],t);return r}nV.exports=function(e,n,r){var o=r,s=n;if(typeof n=="function"&&(o=s,s={}),typeof e!="string"){var i=new eA("Path must be a string.");return process.nextTick(function(){o(i)})}s=$Ee(e,s);var a=s.isFile||XEe,c=s.isDirectory||JEe,u=s.readFile||Pi.readFile,l=s.realpath||ZEe,d=s.readPackage||QEe;if(s.readFile&&s.readPackage){var p=new eA("`readFile` and `readPackage` are mutually exclusive.");return process.nextTick(function(){o(p)})}var _=s.packageIterator,f=s.extensions||[".js"],E=s.includeCoreModules!==!1,S=s.basedir||nt.dirname(HEe()),g=s.filename||S;s.paths=s.paths||zEe();var h=nt.resolve(S);fl(l,h,s,function(H,ae){H?o(H):N(ae)});var O;function N(H){if(YEe.test(e))O=nt.resolve(H,e),(e==="."||e===".."||e.slice(-1)==="/")&&(O+="/"),e.slice(-1)==="/"&&O===H?J(O,s.package,A):M(O,s.package,A);else{if(E&&jEe(e))return o(null,e);Ye(e,H,function(ae,De,pe){if(ae)o(ae);else{if(De)return fl(l,De,s,function(Ln,Ke){Ln?o(Ln):o(null,Ke,pe)});var Be=new tV("Cannot find module '"+e+"' from '"+g+"'");Be.code="MODULE_NOT_FOUND",o(Be)}})}}function A(H,ae,De){H?o(H):ae?o(null,ae,De):J(O,function(pe,Be,Ln){if(pe)o(pe);else if(Be)fl(l,Be,s,function(Ge,an){Ge?o(Ge):o(null,an,Ln)});else{var Ke=new tV("Cannot find module '"+e+"' from '"+g+"'");Ke.code="MODULE_NOT_FOUND",o(Ke)}})}function M(H,ae,De){var pe=ae,Be=De;typeof pe=="function"&&(Be=pe,pe=void 0);var Ln=[""].concat(f);Ke(Ln,H,pe);function Ke(Ge,an,so){if(Ge.length===0)return Be(null,void 0,so);var Zs=an+Ge[0],Or=so;Or?Lt(null,Or):P(nt.dirname(Zs),Lt);function Lt($o,ua,io){if(Or=ua,$o)return Be($o);if(io&&Or&&s.pathFilter){var jd=nt.relative(io,Zs),qd=jd.slice(0,jd.length-Ge[0].length),yu=s.pathFilter(Or,an,qd);if(yu)return Ke([""].concat(f),nt.resolve(io,yu),Or)}a(Zs,$d)}function $d($o,ua){if($o)return Be($o);if(ua)return Be(null,Zs,Or);Ke(Ge.slice(1),an,Or)}}}function P(H,ae){if(H===""||H==="/"||process.platform==="win32"&&KEe.test(H)||WEe.test(H))return ae(null);fl(l,H,s,function(De,pe){if(De)return P(nt.dirname(H),ae);var Be=nt.join(pe,"package.json");a(Be,function(Ln,Ke){if(!Ke)return P(nt.dirname(H),ae);d(u,Be,function(Ge,an){if(Ge)return ae(Ge);var so=an;so&&s.packageFilter&&(so=s.packageFilter(so,Be)),ae(null,so,H)})})})}function J(H,ae,De){var pe=De,Be=ae;typeof Be=="function"&&(pe=Be,Be=s.package),fl(l,H,s,function(Ln,Ke){if(Ln)return pe(Ln);var Ge=nt.join(Ke,"package.json");a(Ge,function(an,so){if(an)return pe(an);if(!so)return M(nt.join(H,"index"),Be,pe);d(u,Ge,function(Zs,Or){if(Zs)return pe(Zs);var Lt=Or;if(Lt&&s.packageFilter&&(Lt=s.packageFilter(Lt,Ge)),Lt&&Lt.main){if(typeof Lt.main!="string"){var $d=new eA("package \u201C"+Lt.name+"\u201D `main` must be a string");return $d.code="INVALID_PACKAGE_MAIN",pe($d)}(Lt.main==="."||Lt.main==="./")&&(Lt.main="index"),M(nt.resolve(H,Lt.main),Lt,function($o,ua,io){if($o)return pe($o);if(ua)return pe(null,ua,io);if(!io)return M(nt.join(H,"index"),io,pe);var jd=nt.resolve(H,io.main);J(jd,io,function(qd,yu,XN){if(qd)return pe(qd);if(yu)return pe(null,yu,XN);M(nt.join(H,"index"),XN,pe)})});return}M(nt.join(H,"/index"),Lt,pe)})})})}function X(H,ae){if(ae.length===0)return H(null,void 0);var De=ae[0];c(nt.dirname(De),pe);function pe(Ke,Ge){if(Ke)return H(Ke);if(!Ge)return X(H,ae.slice(1));M(De,s.package,Be)}function Be(Ke,Ge,an){if(Ke)return H(Ke);if(Ge)return H(null,Ge,an);J(De,s.package,Ln)}function Ln(Ke,Ge,an){if(Ke)return H(Ke);if(Ge)return H(null,Ge,an);X(H,ae.slice(1))}}function Ye(H,ae,De){var pe=function(){return eSe(H,ae,s)};X(De,_?_(H,ae,pe,s):pe())}}});var oV=m((RKe,tSe)=>{tSe.exports={assert:!0,"node:assert":[">= 14.18 && < 15",">= 16"],"assert/strict":">= 15","node:assert/strict":">= 16",async_hooks:">= 8","node:async_hooks":[">= 14.18 && < 15",">= 16"],buffer_ieee754:">= 0.5 && < 0.9.7",buffer:!0,"node:buffer":[">= 14.18 && < 15",">= 16"],child_process:!0,"node:child_process":[">= 14.18 && < 15",">= 16"],cluster:">= 0.5","node:cluster":[">= 14.18 && < 15",">= 16"],console:!0,"node:console":[">= 14.18 && < 15",">= 16"],constants:!0,"node:constants":[">= 14.18 && < 15",">= 16"],crypto:!0,"node:crypto":[">= 14.18 && < 15",">= 16"],_debug_agent:">= 1 && < 8",_debugger:"< 8",dgram:!0,"node:dgram":[">= 14.18 && < 15",">= 16"],diagnostics_channel:[">= 14.17 && < 15",">= 15.1"],"node:diagnostics_channel":[">= 14.18 && < 15",">= 16"],dns:!0,"node:dns":[">= 14.18 && < 15",">= 16"],"dns/promises":">= 15","node:dns/promises":">= 16",domain:">= 0.7.12","node:domain":[">= 14.18 && < 15",">= 16"],events:!0,"node:events":[">= 14.18 && < 15",">= 16"],freelist:"< 6",fs:!0,"node:fs":[">= 14.18 && < 15",">= 16"],"fs/promises":[">= 10 && < 10.1",">= 14"],"node:fs/promises":[">= 14.18 && < 15",">= 16"],_http_agent:">= 0.11.1","node:_http_agent":[">= 14.18 && < 15",">= 16"],_http_client:">= 0.11.1","node:_http_client":[">= 14.18 && < 15",">= 16"],_http_common:">= 0.11.1","node:_http_common":[">= 14.18 && < 15",">= 16"],_http_incoming:">= 0.11.1","node:_http_incoming":[">= 14.18 && < 15",">= 16"],_http_outgoing:">= 0.11.1","node:_http_outgoing":[">= 14.18 && < 15",">= 16"],_http_server:">= 0.11.1","node:_http_server":[">= 14.18 && < 15",">= 16"],http:!0,"node:http":[">= 14.18 && < 15",">= 16"],http2:">= 8.8","node:http2":[">= 14.18 && < 15",">= 16"],https:!0,"node:https":[">= 14.18 && < 15",">= 16"],inspector:">= 8","node:inspector":[">= 14.18 && < 15",">= 16"],"inspector/promises":[">= 19"],"node:inspector/promises":[">= 19"],_linklist:"< 8",module:!0,"node:module":[">= 14.18 && < 15",">= 16"],net:!0,"node:net":[">= 14.18 && < 15",">= 16"],"node-inspect/lib/_inspect":">= 7.6 && < 12","node-inspect/lib/internal/inspect_client":">= 7.6 && < 12","node-inspect/lib/internal/inspect_repl":">= 7.6 && < 12",os:!0,"node:os":[">= 14.18 && < 15",">= 16"],path:!0,"node:path":[">= 14.18 && < 15",">= 16"],"path/posix":">= 15.3","node:path/posix":">= 16","path/win32":">= 15.3","node:path/win32":">= 16",perf_hooks:">= 8.5","node:perf_hooks":[">= 14.18 && < 15",">= 16"],process:">= 1","node:process":[">= 14.18 && < 15",">= 16"],punycode:">= 0.5","node:punycode":[">= 14.18 && < 15",">= 16"],querystring:!0,"node:querystring":[">= 14.18 && < 15",">= 16"],readline:!0,"node:readline":[">= 14.18 && < 15",">= 16"],"readline/promises":">= 17","node:readline/promises":">= 17",repl:!0,"node:repl":[">= 14.18 && < 15",">= 16"],"node:sea":[">= 20.12 && < 21",">= 21.7"],smalloc:">= 0.11.5 && < 3","node:sqlite":[">= 22.13 && < 23",">= 23.4"],_stream_duplex:">= 0.9.4","node:_stream_duplex":[">= 14.18 && < 15",">= 16"],_stream_transform:">= 0.9.4","node:_stream_transform":[">= 14.18 && < 15",">= 16"],_stream_wrap:">= 1.4.1","node:_stream_wrap":[">= 14.18 && < 15",">= 16"],_stream_passthrough:">= 0.9.4","node:_stream_passthrough":[">= 14.18 && < 15",">= 16"],_stream_readable:">= 0.9.4","node:_stream_readable":[">= 14.18 && < 15",">= 16"],_stream_writable:">= 0.9.4","node:_stream_writable":[">= 14.18 && < 15",">= 16"],stream:!0,"node:stream":[">= 14.18 && < 15",">= 16"],"stream/consumers":">= 16.7","node:stream/consumers":">= 16.7","stream/promises":">= 15","node:stream/promises":">= 16","stream/web":">= 16.5","node:stream/web":">= 16.5",string_decoder:!0,"node:string_decoder":[">= 14.18 && < 15",">= 16"],sys:[">= 0.4 && < 0.7",">= 0.8"],"node:sys":[">= 14.18 && < 15",">= 16"],"test/reporters":">= 19.9 && < 20.2","node:test/reporters":[">= 18.17 && < 19",">= 19.9",">= 20"],"test/mock_loader":">= 22.3 && < 22.7","node:test/mock_loader":">= 22.3 && < 22.7","node:test":[">= 16.17 && < 17",">= 18"],timers:!0,"node:timers":[">= 14.18 && < 15",">= 16"],"timers/promises":">= 15","node:timers/promises":">= 16",_tls_common:">= 0.11.13","node:_tls_common":[">= 14.18 && < 15",">= 16"],_tls_legacy:">= 0.11.3 && < 10",_tls_wrap:">= 0.11.3","node:_tls_wrap":[">= 14.18 && < 15",">= 16"],tls:!0,"node:tls":[">= 14.18 && < 15",">= 16"],trace_events:">= 10","node:trace_events":[">= 14.18 && < 15",">= 16"],tty:!0,"node:tty":[">= 14.18 && < 15",">= 16"],url:!0,"node:url":[">= 14.18 && < 15",">= 16"],util:!0,"node:util":[">= 14.18 && < 15",">= 16"],"util/types":">= 15.3","node:util/types":">= 16","v8/tools/arguments":">= 10 && < 12","v8/tools/codemap":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/consarray":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/csvparser":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/logreader":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/profile_view":[">= 4.4 && < 5",">= 5.2 && < 12"],"v8/tools/splaytree":[">= 4.4 && < 5",">= 5.2 && < 12"],v8:">= 1","node:v8":[">= 14.18 && < 15",">= 16"],vm:!0,"node:vm":[">= 14.18 && < 15",">= 16"],wasi:[">= 13.4 && < 13.5",">= 18.17 && < 19",">= 20"],"node:wasi":[">= 18.17 && < 19",">= 20"],worker_threads:">= 11.7","node:worker_threads":[">= 14.18 && < 15",">= 16"],zlib:">= 0.5","node:zlib":[">= 14.18 && < 15",">= 16"]}});var cV=m((yKe,aV)=>{"use strict";var nSe=_l(),sV=oV(),iV={};for(df in sV)Object.prototype.hasOwnProperty.call(sV,df)&&(iV[df]=nSe(df));var df;aV.exports=iV});var lV=m((OKe,uV)=>{var rSe=_l();uV.exports=function(e){return rSe(e)}});var pV=m((NKe,dV)=>{var oSe=_l(),bi=require("fs"),Gt=require("path"),sSe=uf(),nA=Qh(),iSe=Kh(),aSe=Wh(),cSe=Jh(),uSe=Zh(),lSe=process.platform!=="win32"&&bi.realpathSync&&typeof bi.realpathSync.native=="function"?bi.realpathSync.native:bi.realpathSync,dSe=/^(?:\.\.?(?:\/|$)|\/|([A-Za-z]:)?[/\\])/,pSe=/^\w:[/\\]*$/,_Se=/[/\\]node_modules[/\\]*$/,rA=iSe();function fSe(){return rA?[Gt.join(rA,".node_modules"),Gt.join(rA,".node_libraries")]:[]}var mSe=function(e){try{var n=bi.statSync(e,{throwIfNoEntry:!1})}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return!1;throw r}return!!n&&(n.isFile()||n.isFIFO())},ESe=function(e){try{var n=bi.statSync(e,{throwIfNoEntry:!1})}catch(r){if(r&&(r.code==="ENOENT"||r.code==="ENOTDIR"))return!1;throw r}return!!n&&n.isDirectory()},SSe=function(e){try{return lSe(e)}catch(n){if(n.code!=="ENOENT")throw n}return e};function ml(t,e,n){return n&&n.preserveSymlinks===!1?t(e):e}function TSe(t,e){var n=t(e);try{var r=JSON.parse(n);return r}catch{}}function gSe(t,e,n){for(var r=cSe(e,n,t),o=0;o<r.length;o++)r[o]=Gt.join(r[o],t);return r}dV.exports=function(e,n){if(typeof e!="string")throw new nA("Path must be a string.");var r=uSe(e,n),o=r.isFile||mSe,s=r.readFileSync||bi.readFileSync,i=r.isDirectory||ESe,a=r.realpathSync||SSe,c=r.readPackageSync||TSe;if(r.readFileSync&&r.readPackageSync)throw new nA("`readFileSync` and `readPackageSync` are mutually exclusive.");var u=r.packageIterator,l=r.extensions||[".js"],d=r.includeCoreModules!==!1,p=r.basedir||Gt.dirname(aSe()),_=r.filename||p;r.paths=r.paths||fSe();var f=ml(a,Gt.resolve(p),r);if(dSe.test(e)){var E=Gt.resolve(f,e);(e==="."||e===".."||e.slice(-1)==="/")&&(E+="/");var S=O(E)||A(E);if(S)return ml(a,S,r)}else{if(d&&oSe(e))return e;var g=M(e,f);if(g)return ml(a,g,r)}var h=new sSe("Cannot find module '"+e+"' from '"+_+"'");throw h.code="MODULE_NOT_FOUND",h;function O(P){var J=N(Gt.dirname(P));if(J&&J.dir&&J.pkg&&r.pathFilter){var X=Gt.relative(J.dir,P),Ye=r.pathFilter(J.pkg,P,X);Ye&&(P=Gt.resolve(J.dir,Ye))}if(o(P))return P;for(var H=0;H<l.length;H++){var ae=P+l[H];if(o(ae))return ae}}function N(P){if(!(P===""||P==="/")&&!(process.platform==="win32"&&pSe.test(P))&&!_Se.test(P)){var J=Gt.join(ml(a,P,r),"package.json");if(!o(J))return N(Gt.dirname(P));var X=c(s,J);return X&&r.packageFilter&&(X=r.packageFilter(X,P)),{pkg:X,dir:P}}}function A(P){var J=Gt.join(ml(a,P,r),"/package.json");if(o(J)){try{var X=c(s,J)}catch{}if(X&&r.packageFilter&&(X=r.packageFilter(X,P)),X&&X.main){if(typeof X.main!="string"){var Ye=new nA("package \u201C"+X.name+"\u201D `main` must be a string");throw Ye.code="INVALID_PACKAGE_MAIN",Ye}(X.main==="."||X.main==="./")&&(X.main="index");try{var H=O(Gt.resolve(P,X.main));if(H)return H;var ae=A(Gt.resolve(P,X.main));if(ae)return ae}catch{}}}return O(Gt.join(P,"/index"))}function M(P,J){for(var X=function(){return gSe(P,J,r)},Ye=u?u(P,J,X,r):X(),H=0;H<Ye.length;H++){var ae=Ye[H];if(i(Gt.dirname(ae))){var De=O(ae);if(De)return De;var pe=A(ae);if(pe)return pe}}}}});var oA=m((CKe,_V)=>{var pf=rV();pf.core=cV();pf.isCore=lV();pf.sync=pV();_V.exports=pf});var fV=m((vKe,hSe)=>{hSe.exports={name:"require-in-the-middle",version:"7.5.2",description:"Module to hook into the Node.js require function",main:"index.js",types:"types/index.d.ts",dependencies:{debug:"^4.3.5","module-details-from-path":"^1.0.3",resolve:"^1.22.8"},devDependencies:{"@babel/core":"^7.9.0","@babel/preset-env":"^7.9.5","@babel/preset-typescript":"^7.9.0","@babel/register":"^7.9.0","ipp-printer":"^1.0.0",patterns:"^1.0.3",roundround:"^0.2.0",semver:"^6.3.0",standard:"^14.3.1",tape:"^4.11.0"},scripts:{test:"npm run test:lint && npm run test:tape && npm run test:babel","test:lint":"standard","test:tape":"tape test/*.js","test:babel":"node test/babel/babel-register.js"},repository:{type:"git",url:"git+https://github.com/nodejs/require-in-the-middle.git"},keywords:["require","hook","shim","shimmer","shimming","patch","monkey","monkeypatch","module","load"],files:["types"],author:"Thomas Watson Steen <w@tson.dk> (https://twitter.com/wa7son)",license:"MIT",bugs:{url:"https://github.com/nodejs/require-in-the-middle/issues"},homepage:"https://github.com/nodejs/require-in-the-middle#readme",engines:{node:">=8.6.0"}}});var cA=m((IKe,aA)=>{"use strict";var za=require("path"),cr=require("module"),Xe=Lk()("require-in-the-middle"),ASe=Yh();aA.exports=El;aA.exports.Hook=El;var sA,Wa;if(cr.isBuiltin)Wa=cr.isBuiltin;else if(cr.builtinModules)Wa=t=>t.startsWith("node:")?!0:(sA===void 0&&(sA=new Set(cr.builtinModules)),sA.has(t));else{let t=oA(),[e,n]=process.versions.node.split(".").map(Number);e===8&&n<8?Wa=r=>r==="http2"?!0:!!t.core[r]:Wa=r=>!!t.core[r]}var _f;function RSe(t,e){if(!_f)if(require.resolve&&require.resolve.paths)_f=function(n,r){return require.resolve(n,{paths:[r]})};else{let n=oA();_f=function(r,o){return n.sync(r,{basedir:o})}}return _f(t,e)}var ySe=/([/\\]index)?(\.js)?$/,iA=class{constructor(){this._localCache=new Map,this._kRitmExports=Symbol("RitmExports")}has(e,n){if(this._localCache.has(e))return!0;if(n)return!1;{let r=require.cache[e];return!!(r&&this._kRitmExports in r)}}get(e,n){let r=this._localCache.get(e);if(r!==void 0)return r;if(!n){let o=require.cache[e];return o&&o[this._kRitmExports]}}set(e,n,r){r?this._localCache.set(e,n):e in require.cache?require.cache[e][this._kRitmExports]=n:(Xe('non-core module is unexpectedly not in require.cache: "%s"',e),this._localCache.set(e,n))}};function El(t,e,n){if(!(this instanceof El))return new El(t,e,n);if(typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null),typeof cr._resolveFilename!="function"){console.error("Error: Expected Module._resolveFilename to be a function (was: %s) - aborting!",typeof cr._resolveFilename),console.error("Please report this error as an issue related to Node.js %s at %s",process.version,fV().bugs.url);return}this._cache=new iA,this._unhooked=!1,this._origRequire=cr.prototype.require;let r=this,o=new Set,s=e?e.internals===!0:!1,i=Array.isArray(t);Xe("registering require hook"),this._require=cr.prototype.require=function(c){return r._unhooked===!0?(Xe("ignoring require call - module is soft-unhooked"),r._origRequire.apply(this,arguments)):a.call(this,arguments,!1)},typeof process.getBuiltinModule=="function"&&(this._origGetBuiltinModule=process.getBuiltinModule,this._getBuiltinModule=process.getBuiltinModule=function(c){return r._unhooked===!0?(Xe("ignoring process.getBuiltinModule call - module is soft-unhooked"),r._origGetBuiltinModule.apply(this,arguments)):a.call(this,arguments,!0)});function a(c,u){let l=c[0],d=Wa(l),p;if(d){if(p=l,l.startsWith("node:")){let h=l.slice(5);Wa(h)&&(p=h)}}else{if(u)return Xe("call to process.getBuiltinModule with unknown built-in id"),r._origGetBuiltinModule.apply(this,c);try{p=cr._resolveFilename(l,this)}catch(h){return Xe('Module._resolveFilename("%s") threw %j, calling original Module.require',l,h.message),r._origRequire.apply(this,c)}}let _,f;if(Xe("processing %s module require('%s'): %s",d===!0?"core":"non-core",l,p),r._cache.has(p,d)===!0)return Xe("returning already patched cached module: %s",p),r._cache.get(p,d);let E=o.has(p);E===!1&&o.add(p);let S=u?r._origGetBuiltinModule.apply(this,c):r._origRequire.apply(this,c);if(E===!0)return Xe("module is in the process of being patched already - ignoring: %s",p),S;if(o.delete(p),d===!0){if(i===!0&&t.includes(p)===!1)return Xe("ignoring core module not on whitelist: %s",p),S;_=p}else if(i===!0&&t.includes(p)){let h=za.parse(p);_=h.name,f=h.dir}else{let h=ASe(p);if(h===void 0)return Xe("could not parse filename: %s",p),S;_=h.name,f=h.basedir;let O=OSe(h);Xe("resolved filename to module: %s (id: %s, resolved: %s, basedir: %s)",_,l,O,f);let N=!1;if(i){if(!l.startsWith(".")&&t.includes(l)&&(_=l,N=!0),!t.includes(_)&&!t.includes(O))return S;t.includes(O)&&O!==_&&(_=O,N=!0)}if(!N){let A;try{A=RSe(_,f)}catch{return Xe("could not resolve module: %s",_),r._cache.set(p,S,d),S}if(A!==p)if(s===!0)_=_+za.sep+za.relative(f,p),Xe("preparing to process require of internal file: %s",_);else return Xe("ignoring require of non-main module file: %s",A),r._cache.set(p,S,d),S}}r._cache.set(p,S,d),Xe("calling require hook: %s",_);let g=n(S,_,f);return r._cache.set(p,g,d),Xe("returning module: %s",_),g}}El.prototype.unhook=function(){this._unhooked=!0,this._require===cr.prototype.require?(cr.prototype.require=this._origRequire,Xe("require unhook successful")):Xe("require unhook unsuccessful"),process.getBuiltinModule!==void 0&&(this._getBuiltinModule===process.getBuiltinModule?(process.getBuiltinModule=this._origGetBuiltinModule,Xe("process.getBuiltinModule unhook successful")):Xe("process.getBuiltinModule unhook unsuccessful"))};function OSe(t){let e=za.sep!=="/"?t.path.split(za.sep).join("/"):t.path;return za.posix.join(t.name,e).replace(ySe,"")}});var mV=m(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.ModuleNameTrie=os.ModuleNameSeparator=void 0;os.ModuleNameSeparator="/";var ff=class{constructor(){this.hooks=[],this.children=new Map}},uA=class{constructor(){this._trie=new ff,this._counter=0}insert(e){let n=this._trie;for(let r of e.moduleName.split(os.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new ff,n.children.set(r,o)),n=o}n.hooks.push({hook:e,insertedId:this._counter++})}search(e,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,s=[],i=!0;for(let a of e.split(os.ModuleNameSeparator)){let c=o.children.get(a);if(!c){i=!1;break}r||s.push(...c.hooks),o=c}return r&&i&&s.push(...o.hooks),s.length===0?[]:s.length===1?[s[0].hook]:(n&&s.sort((a,c)=>a.insertedId-c.insertedId),s.map(({hook:a})=>a))}};os.ModuleNameTrie=uA});var SV=m(mf=>{"use strict";Object.defineProperty(mf,"__esModule",{value:!0});mf.RequireInTheMiddleSingleton=void 0;var NSe=cA(),EV=require("path"),lA=mV(),CSe=["afterEach","after","beforeEach","before","describe","it"].every(t=>typeof global[t]=="function"),dA=class t{constructor(){this._moduleNameTrie=new lA.ModuleNameTrie,this._initialize()}_initialize(){new NSe.Hook(null,{internals:!0},(e,n,r)=>{let o=vSe(n),s=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:i}of s)e=i(e,n,r);return e})}register(e,n){let r={moduleName:e,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){var e;return CSe?new t:this._instance=(e=this._instance)!==null&&e!==void 0?e:new t}};mf.RequireInTheMiddleSingleton=dA;function vSe(t){return EV.sep!==lA.ModuleNameSeparator?t.split(EV.sep).join(lA.ModuleNameSeparator):t}});var yV=m(Mi=>{var TV=[],pA=new WeakMap,gV=new WeakMap,hV=new Map,AV=[],ISe={set(t,e,n){return pA.get(t)[e](n)},get(t,e){if(e===Symbol.toStringTag)return"Module";let n=gV.get(t)[e];if(typeof n=="function")return n()},defineProperty(t,e,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");return pA.get(t)[e](n.value)}};function PSe(t,e,n,r,o){hV.set(t,o),pA.set(e,n),gV.set(e,r);let s=new Proxy(e,ISe);TV.forEach(i=>i(t,s)),AV.push([t,s])}var RV=!1;function bSe(){return RV}function MSe(t){RV=t}Mi.register=PSe;Mi.importHooks=TV;Mi.specifiers=hV;Mi.toHook=AV;Mi.getExperimentalPatchInternals=bSe;Mi.setExperimentalPatchInternals=MSe});var Ef=m((LKe,Xa)=>{var OV=require("path"),LSe=Yh(),{fileURLToPath:NV}=require("url"),{MessageChannel:xSe}=require("worker_threads"),{importHooks:_A,specifiers:DSe,toHook:USe,getExperimentalPatchInternals:wSe}=yV();function vV(t){_A.push(t),USe.forEach(([e,n])=>t(e,n))}function IV(t){let e=_A.indexOf(t);e>-1&&_A.splice(e,1)}function CV(t,e,n,r){let o=t(e,n,r);o&&o!==e&&(e.default=o)}var fA;function kSe(){let{port1:t,port2:e}=new xSe,n=0,r;fA=a=>{n++,t.postMessage(a)},t.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let a=setInterval(()=>{},1e3),c=new Promise(u=>{r=u}).then(()=>{clearInterval(a)});return n===0&&r(),c}let s=e;return{registerOptions:{data:{addHookMessagePort:s,include:[]},transferList:[s]},addHookMessagePort:s,waitForAllMessagesAcknowledged:o}}function Sl(t,e,n){if(!(this instanceof Sl))return new Sl(t,e,n);typeof t=="function"?(n=t,t=null,e=null):typeof e=="function"&&(n=e,e=null);let r=e?e.internals===!0:!1;fA&&Array.isArray(t)&&fA(t),this._iitmHook=(o,s)=>{let i=o,a=o.startsWith("node:"),c;if(a)o=o.replace(/^node:/,"");else{if(o.startsWith("file://"))try{o=NV(o)}catch{}let u=LSe(o);u&&(o=u.name,c=u.basedir)}if(t){for(let u of t)if(u===o){if(c){if(r)o=o+OV.sep+OV.relative(c,NV(i));else if(!wSe()&&!c.endsWith(DSe.get(i)))continue}CV(n,s,o,c)}}else CV(n,s,o,c)},vV(this._iitmHook)}Sl.prototype.unhook=function(){IV(this._iitmHook)};Xa.exports=Sl;Xa.exports.Hook=Sl;Xa.exports.addHook=vV;Xa.exports.removeHook=IV;Xa.exports.createAddHookMessageChannel=kSe});var mA=m(ss=>{"use strict";Object.defineProperty(ss,"__esModule",{value:!0});ss.isWrapped=ss.safeExecuteInTheMiddleAsync=ss.safeExecuteInTheMiddle=void 0;function VSe(t,e,n){let r,o;try{o=t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ss.safeExecuteInTheMiddle=VSe;async function BSe(t,e,n){let r,o;try{o=await t()}catch(s){r=s}finally{if(e(r,o),r&&!n)throw r;return o}}ss.safeExecuteInTheMiddleAsync=BSe;function GSe(t){return typeof t=="function"&&typeof t.__original=="function"&&typeof t.__unwrap=="function"&&t.__wrapped===!0}ss.isWrapped=GSe});var MV=m(Sf=>{"use strict";Object.defineProperty(Sf,"__esModule",{value:!0});Sf.InstrumentationBase=void 0;var Tl=require("path"),PV=require("util"),HSe=bh(),EA=Vh(),FSe=hk(),$Se=SV(),jSe=Ef(),gl=(L(),I(V)),qSe=cA(),YSe=require("fs"),KSe=mA(),SA=class extends FSe.InstrumentationAbstract{constructor(e,n,r){super(e,n,r),this._hooks=[],this._requireInTheMiddleSingleton=$Se.RequireInTheMiddleSingleton.getInstance(),this._enabled=!1,this._wrap=(s,i,a)=>{if((0,KSe.isWrapped)(s[i])&&this._unwrap(s,i),PV.types.isProxy(s)){let c=(0,EA.wrap)(Object.assign({},s),i,a);return Object.defineProperty(s,i,{value:c}),c}else return(0,EA.wrap)(s,i,a)},this._unwrap=(s,i)=>PV.types.isProxy(s)?Object.defineProperty(s,i,{value:s[i]}):(0,EA.unwrap)(s,i),this._massWrap=(s,i,a)=>{if(s)Array.isArray(s)||(s=[s]);else{gl.diag.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){gl.diag.error("must provide one or more functions to wrap on modules");return}s.forEach(c=>{i.forEach(u=>{this._wrap(c,u,a)})})},this._massUnwrap=(s,i)=>{if(s)Array.isArray(s)||(s=[s]);else{gl.diag.error("must provide one or more modules to patch");return}if(!(i&&Array.isArray(i))){gl.diag.error("must provide one or more functions to wrap on modules");return}s.forEach(a=>{i.forEach(c=>{this._unwrap(a,c)})})};let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_warnOnPreloadedModules(){this._modules.forEach(e=>{let{name:n}=e;try{let r=require.resolve(n);require.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(e){try{let n=(0,YSe.readFileSync)(Tl.join(e,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{gl.diag.warn("Failed extracting version",e)}}_onRequire(e,n,r,o){var s;if(!o)return typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:e.name}),e.patch(n)):n;let i=this._extractPackageVersion(o);if(e.moduleVersion=i,e.name===r)return bV(e.supportedVersions,i,e.includePrerelease)&&typeof e.patch=="function"&&(e.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:e.name,version:e.moduleVersion,baseDir:o}),e.patch(n,e.moduleVersion)):n;let a=(s=e.files)!==null&&s!==void 0?s:[],c=Tl.normalize(r);return a.filter(l=>l.name===c).filter(l=>bV(l.supportedVersions,i,e.includePrerelease)).reduce((l,d)=>(d.moduleExports=l,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:e.name,version:e.moduleVersion,fileName:d.name,baseDir:o}),d.patch(l,e.moduleVersion)):l),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let e of this._modules){typeof e.patch=="function"&&e.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:e.name,version:e.moduleVersion}),e.patch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,e.moduleVersion))}return}this._warnOnPreloadedModules();for(let e of this._modules){let n=(i,a,c)=>{if(!c&&Tl.isAbsolute(a)){let u=Tl.parse(a);a=u.name,c=u.dir}return this._onRequire(e,i,a,c)},r=(i,a,c)=>this._onRequire(e,i,a,c),o=Tl.isAbsolute(e.name)?new qSe.Hook([e.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(e.name,r);this._hooks.push(o);let s=new jSe.Hook([e.name],{internals:!1},n);this._hooks.push(s)}}}disable(){if(this._enabled){this._enabled=!1;for(let e of this._modules){typeof e.unpatch=="function"&&e.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:e.name,version:e.moduleVersion}),e.unpatch(e.moduleExports,e.moduleVersion));for(let n of e.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:e.name,version:e.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,e.moduleVersion))}}}isEnabled(){return this._enabled}};Sf.InstrumentationBase=SA;function bV(t,e,n){return typeof e>"u"?t.includes("*"):t.some(r=>(0,HSe.satisfies)(e,r,{includePrerelease:n}))}});var LV=m(Tf=>{"use strict";Object.defineProperty(Tf,"__esModule",{value:!0});Tf.normalize=void 0;var WSe=require("path");Object.defineProperty(Tf,"normalize",{enumerable:!0,get:function(){return WSe.normalize}})});var xV=m(Ja=>{"use strict";Object.defineProperty(Ja,"__esModule",{value:!0});Ja.normalize=Ja.InstrumentationBase=void 0;var zSe=MV();Object.defineProperty(Ja,"InstrumentationBase",{enumerable:!0,get:function(){return zSe.InstrumentationBase}});var XSe=LV();Object.defineProperty(Ja,"normalize",{enumerable:!0,get:function(){return XSe.normalize}})});var TA=m(Za=>{"use strict";Object.defineProperty(Za,"__esModule",{value:!0});Za.normalize=Za.InstrumentationBase=void 0;var DV=xV();Object.defineProperty(Za,"InstrumentationBase",{enumerable:!0,get:function(){return DV.InstrumentationBase}});Object.defineProperty(Za,"normalize",{enumerable:!0,get:function(){return DV.normalize}})});var UV=m(gf=>{"use strict";Object.defineProperty(gf,"__esModule",{value:!0});gf.InstrumentationNodeModuleDefinition=void 0;var gA=class{constructor(e,n,r,o,s){this.name=e,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=s||[]}};gf.InstrumentationNodeModuleDefinition=gA});var wV=m(hf=>{"use strict";Object.defineProperty(hf,"__esModule",{value:!0});hf.InstrumentationNodeModuleFile=void 0;var JSe=TA(),hA=class{constructor(e,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,JSe.normalize)(e)}};hf.InstrumentationNodeModuleFile=hA});var de=m(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.safeExecuteInTheMiddleAsync=Ht.safeExecuteInTheMiddle=Ht.isWrapped=Ht.InstrumentationNodeModuleFile=Ht.InstrumentationNodeModuleDefinition=Ht.InstrumentationBase=Ht.registerInstrumentations=void 0;var ZSe=Ek();Object.defineProperty(Ht,"registerInstrumentations",{enumerable:!0,get:function(){return ZSe.registerInstrumentations}});var QSe=TA();Object.defineProperty(Ht,"InstrumentationBase",{enumerable:!0,get:function(){return QSe.InstrumentationBase}});var eTe=UV();Object.defineProperty(Ht,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return eTe.InstrumentationNodeModuleDefinition}});var tTe=wV();Object.defineProperty(Ht,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return tTe.InstrumentationNodeModuleFile}});var AA=mA();Object.defineProperty(Ht,"isWrapped",{enumerable:!0,get:function(){return AA.isWrapped}});Object.defineProperty(Ht,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return AA.safeExecuteInTheMiddle}});Object.defineProperty(Ht,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return AA.safeExecuteInTheMiddleAsync}})});var kV=m(hl=>{"use strict";Object.defineProperty(hl,"__esModule",{value:!0});hl.AttributeNames=void 0;var nTe;(function(t){t.HTTP_ERROR_NAME="http.error_name",t.HTTP_ERROR_MESSAGE="http.error_message",t.HTTP_STATUS_TEXT="http.status_text"})(nTe=hl.AttributeNames||(hl.AttributeNames={}))});var BV=m((FKe,VV)=>{"use strict";var rTe=require("util");function RA(t,e){Error.captureStackTrace(this,RA),this.name=this.constructor.name,this.message=t,this.input=e}rTe.inherits(RA,Error);VV.exports=RA});var HV=m(($Ke,GV)=>{"use strict";function oTe(t){return t===34||t===40||t===41||t===44||t===47||t>=58&&t<=64||t>=91&&t<=93||t===123||t===125}function sTe(t){return t===33||t>=35&&t<=39||t===42||t===43||t===45||t===46||t>=48&&t<=57||t>=65&&t<=90||t>=94&&t<=122||t===124||t===126}function iTe(t){return t>=32&&t<=126}function aTe(t){return t>=128&&t<=255}GV.exports={isDelimiter:oTe,isTokenChar:sTe,isExtended:aTe,isPrint:iTe}});var YV=m((jKe,qV)=>{"use strict";var cTe=require("util"),Qa=BV(),Af=HV(),uTe=Af.isDelimiter,FV=Af.isTokenChar,$V=Af.isExtended,lTe=Af.isPrint;function jV(t){return t.replace(/\\(.)/g,"$1")}function Al(t,e){return cTe.format("Unexpected character '%s' at index %d",t.charAt(e),e)}function dTe(t){for(var e=!1,n=!1,r=!1,o={},s=[],i=-1,a=-1,c,u,l=0;l<t.length;l++)if(u=t.charCodeAt(l),c===void 0){if(l!==0&&i===-1&&(u===32||u===9))continue;if(FV(u))i===-1&&(i=l);else if(u===61&&i!==-1)c=t.slice(i,l).toLowerCase(),i=-1;else throw new Qa(Al(t,l),t)}else if(n&&(u===9||lTe(u)||$V(u)))n=!1;else if(FV(u)){if(a!==-1)throw new Qa(Al(t,l),t);i===-1&&(i=l)}else if(uTe(u)||$V(u))if(r)u===34?(r=!1,a=l):u===92?(i===-1&&(i=l),n=e=!0):i===-1&&(i=l);else if(u===34&&t.charCodeAt(l-1)===61)r=!0;else if((u===44||u===59)&&(i!==-1||a!==-1))i!==-1?(a===-1&&(a=l),o[c]=e?jV(t.slice(i,a)):t.slice(i,a)):o[c]="",u===44&&(s.push(o),o={}),c=void 0,i=a=-1;else throw new Qa(Al(t,l),t);else if(u===32||u===9){if(a!==-1)continue;if(r)i===-1&&(i=l);else if(i!==-1)a=l;else throw new Qa(Al(t,l),t)}else throw new Qa(Al(t,l),t);if(c===void 0||r||i===-1&&a===-1||u===32||u===9)throw new Qa("Unexpected end of input",t);return i!==-1?(a===-1&&(a=l),o[c]=e?jV(t.slice(i,a)):t.slice(i,a)):o[c]="",s.push(o),s}qV.exports=dTe});var ZV=m($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.headerCapture=$.getIncomingStableRequestMetricAttributesOnResponse=$.getIncomingRequestMetricAttributesOnResponse=$.getIncomingRequestAttributesOnResponse=$.getIncomingRequestMetricAttributes=$.getIncomingRequestAttributes=$.getRemoteClientAddress=$.getOutgoingRequestMetricAttributesOnResponse=$.getOutgoingRequestAttributesOnResponse=$.setAttributesFromHttpKind=$.getOutgoingRequestMetricAttributes=$.getOutgoingRequestAttributes=$.extractHostnameAndPort=$.isValidOptionsType=$.getRequestInfo=$.isCompressed=$.setResponseContentLengthAttribute=$.setRequestContentLengthAttribute=$.setSpanWithError=$.satisfiesPattern=$.parseResponseStatus=$.getAbsoluteUrl=void 0;var Rl=(L(),I(V)),b=(Bn(),I(Vn)),KV=fe(),pTe=require("url"),Rf=kV(),_Te=YV(),fTe=(t,e,n="http:")=>{let r=t||{},o=r.protocol||n,s=(r.port||"").toString(),i=r.path||"/",a=r.host||r.hostname||e.host||"localhost";return a.indexOf(":")===-1&&s&&s!=="80"&&s!=="443"&&(a+=`:${s}`),`${o}//${a}${i}`};$.getAbsoluteUrl=fTe;var mTe=(t,e)=>{let n=t===Rl.SpanKind.CLIENT?400:500;return e&&e>=100&&e<n?Rl.SpanStatusCode.UNSET:Rl.SpanStatusCode.ERROR};$.parseResponseStatus=mTe;var ETe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")};$.satisfiesPattern=ETe;var STe=(t,e,n)=>{let r=e.message;(n&2)===2&&(t.setAttribute(Rf.AttributeNames.HTTP_ERROR_NAME,e.name),t.setAttribute(Rf.AttributeNames.HTTP_ERROR_MESSAGE,r)),(n&1)===1&&t.setAttribute(b.ATTR_ERROR_TYPE,e.name),t.setStatus({code:Rl.SpanStatusCode.ERROR,message:r}),t.recordException(e)};$.setSpanWithError=STe;var TTe=(t,e)=>{let n=WV(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[b.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH]=n:e[b.SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setRequestContentLengthAttribute=TTe;var gTe=(t,e)=>{let n=WV(t.headers);n!==null&&((0,$.isCompressed)(t.headers)?e[b.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH]=n:e[b.SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED]=n)};$.setResponseContentLengthAttribute=gTe;function WV(t){let e=t["content-length"];if(e===void 0)return null;let n=parseInt(e,10);return isNaN(n)?null:n}var hTe=t=>{let e=t["content-encoding"];return!!e&&e!=="identity"};$.isCompressed=hTe;function ATe(t){let{hostname:e,pathname:n,port:r,username:o,password:s,search:i,protocol:a,hash:c,href:u,origin:l,host:d}=new URL(t),p={protocol:a,hostname:e&&e[0]==="["?e.slice(1,-1):e,hash:c,search:i,pathname:n,path:`${n||""}${i||""}`,href:u,origin:l,host:d};return r!==""&&(p.port=Number(r)),(o||s)&&(p.auth=`${decodeURIComponent(o)}:${decodeURIComponent(s)}`),p}var RTe=(t,e,n)=>{let r,o,s,i=!1;if(typeof e=="string"){try{let c=ATe(e);s=c,r=c.pathname||"/"}catch(c){i=!0,t.verbose("Unable to parse URL provided to HTTP request, using fallback to determine path. Original error:",c),s={path:e},r=s.path||"/"}o=`${s.protocol||"http:"}//${s.host}`,n!==void 0&&Object.assign(s,n)}else if(e instanceof pTe.URL)s={protocol:e.protocol,hostname:typeof e.hostname=="string"&&e.hostname.startsWith("[")?e.hostname.slice(1,-1):e.hostname,path:`${e.pathname||""}${e.search||""}`},e.port!==""&&(s.port=Number(e.port)),(e.username||e.password)&&(s.auth=`${e.username}:${e.password}`),r=e.pathname,o=e.origin,n!==void 0&&Object.assign(s,n);else{s=Object.assign({protocol:e.host?"http:":void 0},e);let c=s.host||(s.port!=null?`${s.hostname}${s.port}`:s.hostname);if(o=`${s.protocol||"http:"}//${c}`,r=e.pathname,!r&&s.path)try{r=new URL(s.path,o).pathname||"/"}catch{r="/"}}let a=s.method?s.method.toUpperCase():"GET";return{origin:o,pathname:r,method:a,optionsParsed:s,invalidUrl:i}};$.getRequestInfo=RTe;var yTe=t=>{if(!t)return!1;let e=typeof t;return e==="string"||e==="object"&&!Array.isArray(t)};$.isValidOptionsType=yTe;var OTe=t=>{var e;if(t.hostname&&t.port)return{hostname:t.hostname,port:t.port};let n=((e=t.host)===null||e===void 0?void 0:e.match(/^([^:/ ]+)(:\d{1,5})?/))||null,r=t.hostname||(n===null?"localhost":n[1]),o=t.port;return o||(n&&n[2]?o=n[2].substring(1):o=t.protocol==="https:"?"443":"80"),{hostname:r,port:o}};$.extractHostnameAndPort=OTe;var NTe=(t,e,n)=>{var r,o;let s=e.hostname,i=e.port,a=(r=t.method)!==null&&r!==void 0?r:"GET",c=XV(a),u=t.headers||{},l=u["user-agent"],d=(0,$.getAbsoluteUrl)(t,u,`${e.component}:`),p={[b.SEMATTRS_HTTP_URL]:d,[b.SEMATTRS_HTTP_METHOD]:a,[b.SEMATTRS_HTTP_TARGET]:t.path||"/",[b.SEMATTRS_NET_PEER_NAME]:s,[b.SEMATTRS_HTTP_HOST]:(o=u.host)!==null&&o!==void 0?o:`${s}:${i}`},_={[b.ATTR_HTTP_REQUEST_METHOD]:c,[b.ATTR_SERVER_ADDRESS]:s,[b.ATTR_SERVER_PORT]:Number(i),[b.ATTR_URL_FULL]:d};switch(a!==c&&(_[b.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=a),l!==void 0&&(p[b.SEMATTRS_HTTP_USER_AGENT]=l),n){case 1:return Object.assign(_,e.hookAttributes);case 2:return Object.assign(p,e.hookAttributes)}return Object.assign(p,_,e.hookAttributes)};$.getOutgoingRequestAttributes=NTe;var CTe=t=>{let e={};return e[b.SEMATTRS_HTTP_METHOD]=t[b.SEMATTRS_HTTP_METHOD],e[b.SEMATTRS_NET_PEER_NAME]=t[b.SEMATTRS_NET_PEER_NAME],e};$.getOutgoingRequestMetricAttributes=CTe;var vTe=(t,e)=>{t&&(e[b.SEMATTRS_HTTP_FLAVOR]=t,t.toUpperCase()!=="QUIC"?e[b.SEMATTRS_NET_TRANSPORT]=b.NETTRANSPORTVALUES_IP_TCP:e[b.SEMATTRS_NET_TRANSPORT]=b.NETTRANSPORTVALUES_IP_UDP)};$.setAttributesFromHttpKind=vTe;var ITe=(t,e)=>{let{statusCode:n,statusMessage:r,httpVersion:o,socket:s}=t,i={},a={};if(n!=null&&(a[b.ATTR_HTTP_RESPONSE_STATUS_CODE]=n),s){let{remoteAddress:c,remotePort:u}=s;i[b.SEMATTRS_NET_PEER_IP]=c,i[b.SEMATTRS_NET_PEER_PORT]=u,a[b.ATTR_NETWORK_PEER_ADDRESS]=c,a[b.ATTR_NETWORK_PEER_PORT]=u,a[b.ATTR_NETWORK_PROTOCOL_VERSION]=t.httpVersion}switch((0,$.setResponseContentLengthAttribute)(t,i),n&&(i[b.SEMATTRS_HTTP_STATUS_CODE]=n,i[Rf.AttributeNames.HTTP_STATUS_TEXT]=(r||"").toUpperCase()),(0,$.setAttributesFromHttpKind)(o,i),e){case 1:return a;case 2:return i}return Object.assign(i,a)};$.getOutgoingRequestAttributesOnResponse=ITe;var PTe=t=>{let e={};return e[b.SEMATTRS_NET_PEER_PORT]=t[b.SEMATTRS_NET_PEER_PORT],e[b.SEMATTRS_HTTP_STATUS_CODE]=t[b.SEMATTRS_HTTP_STATUS_CODE],e[b.SEMATTRS_HTTP_FLAVOR]=t[b.SEMATTRS_HTTP_FLAVOR],e};$.getOutgoingRequestMetricAttributesOnResponse=PTe;function is(t,e){let n=t.split(":");if(n.length===1)return e==="http"?{host:n[0],port:"80"}:e==="https"?{host:n[0],port:"443"}:{host:n[0]};if(n.length===2)return{host:n[0],port:n[1]};if(n[0].startsWith("[")){if(n[n.length-1].endsWith("]")){if(e==="http")return{host:t,port:"80"};if(e==="https")return{host:t,port:"443"}}else if(n[n.length-2].endsWith("]"))return{host:n.slice(0,-1).join(":"),port:n[n.length-1]}}return{host:t}}function bTe(t,e){let n=t.headers.forwarded;if(n){for(let s of JV(n))if(s.host)return is(s.host,s.proto)}let r=t.headers["x-forwarded-host"];if(typeof r=="string")return typeof t.headers["x-forwarded-proto"]=="string"?is(r,t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?is(r,t.headers["x-forwarded-proto"][0]):is(r);if(Array.isArray(r)&&typeof r[0]=="string"&&r[0].length>0)return typeof t.headers["x-forwarded-proto"]=="string"?is(r[0],t.headers["x-forwarded-proto"]):Array.isArray(t.headers["x-forwarded-proto"])?is(r[0],t.headers["x-forwarded-proto"][0]):is(r[0]);let o=t.headers.host;return typeof o=="string"&&o.length>0?is(o,e):null}function zV(t){let e=t.headers.forwarded;if(e){for(let o of JV(e))if(o.for)return o.for}let n=t.headers["x-forwarded-for"];if(typeof n=="string")return n;if(Array.isArray(n))return n[0];let r=t.socket.remoteAddress;return r||null}$.getRemoteClientAddress=zV;function MTe(t,e,n){var r,o;try{if(e.headers.host)return new URL((r=e.url)!==null&&r!==void 0?r:"/",`${t}://${e.headers.host}`);{let s=new URL((o=e.url)!==null&&o!==void 0?o:"/",`${t}://localhost`);return{pathname:s.pathname,search:s.search,toString:function(){return s.pathname+s.search}}}}catch(s){return n.verbose("Unable to get URL from request",s),{}}}var LTe=(t,e,n)=>{let r=t.headers,o=r["user-agent"],s=r["x-forwarded-for"],i=t.httpVersion,a=r.host,c=a?.replace(/^(.*)(:[0-9]{1,5})/,"$1")||"localhost",u=t.method,l=XV(u),d=bTe(t,e.component),p=e.serverName,_=zV(t),f={[b.ATTR_HTTP_REQUEST_METHOD]:l,[b.ATTR_URL_SCHEME]:e.component,[b.ATTR_SERVER_ADDRESS]:d?.host,[b.ATTR_NETWORK_PEER_ADDRESS]:t.socket.remoteAddress,[b.ATTR_NETWORK_PEER_PORT]:t.socket.remotePort,[b.ATTR_NETWORK_PROTOCOL_VERSION]:t.httpVersion,[b.ATTR_USER_AGENT_ORIGINAL]:o},E=MTe(e.component,t,n);E?.pathname!=null&&(f[b.ATTR_URL_PATH]=E.pathname),_!=null&&(f[b.ATTR_CLIENT_ADDRESS]=_),d?.port!=null&&(f[b.ATTR_SERVER_PORT]=Number(d.port)),u!==l&&(f[b.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]=u);let S={[b.SEMATTRS_HTTP_URL]:E.toString(),[b.SEMATTRS_HTTP_HOST]:a,[b.SEMATTRS_NET_HOST_NAME]:c,[b.SEMATTRS_HTTP_METHOD]:u,[b.SEMATTRS_HTTP_SCHEME]:e.component};switch(typeof s=="string"&&(S[b.SEMATTRS_HTTP_CLIENT_IP]=s.split(",")[0]),typeof p=="string"&&(S[b.SEMATTRS_HTTP_SERVER_NAME]=p),E?.pathname&&(S[b.SEMATTRS_HTTP_TARGET]=E?.pathname+E?.search||"/"),o!==void 0&&(S[b.SEMATTRS_HTTP_USER_AGENT]=o),(0,$.setRequestContentLengthAttribute)(t,S),(0,$.setAttributesFromHttpKind)(i,S),e.semconvStability){case 1:return Object.assign(f,e.hookAttributes);case 2:return Object.assign(S,e.hookAttributes)}return Object.assign(S,f,e.hookAttributes)};$.getIncomingRequestAttributes=LTe;var xTe=t=>{let e={};return e[b.SEMATTRS_HTTP_SCHEME]=t[b.SEMATTRS_HTTP_SCHEME],e[b.SEMATTRS_HTTP_METHOD]=t[b.SEMATTRS_HTTP_METHOD],e[b.SEMATTRS_NET_HOST_NAME]=t[b.SEMATTRS_NET_HOST_NAME],e[b.SEMATTRS_HTTP_FLAVOR]=t[b.SEMATTRS_HTTP_FLAVOR],e};$.getIncomingRequestMetricAttributes=xTe;var DTe=(t,e,n)=>{let{socket:r}=t,{statusCode:o,statusMessage:s}=e,i={[b.ATTR_HTTP_RESPONSE_STATUS_CODE]:o},a=(0,KV.getRPCMetadata)(Rl.context.active()),c={};if(r){let{localAddress:u,localPort:l,remoteAddress:d,remotePort:p}=r;c[b.SEMATTRS_NET_HOST_IP]=u,c[b.SEMATTRS_NET_HOST_PORT]=l,c[b.SEMATTRS_NET_PEER_IP]=d,c[b.SEMATTRS_NET_PEER_PORT]=p}switch(c[b.SEMATTRS_HTTP_STATUS_CODE]=o,c[Rf.AttributeNames.HTTP_STATUS_TEXT]=(s||"").toUpperCase(),a?.type===KV.RPCType.HTTP&&a.route!==void 0&&(c[b.SEMATTRS_HTTP_ROUTE]=a.route,i[b.ATTR_HTTP_ROUTE]=a.route),n){case 1:return i;case 2:return c}return Object.assign(c,i)};$.getIncomingRequestAttributesOnResponse=DTe;var UTe=t=>{let e={};return e[b.SEMATTRS_HTTP_STATUS_CODE]=t[b.SEMATTRS_HTTP_STATUS_CODE],e[b.SEMATTRS_NET_HOST_PORT]=t[b.SEMATTRS_NET_HOST_PORT],t[b.SEMATTRS_HTTP_ROUTE]!==void 0&&(e[b.SEMATTRS_HTTP_ROUTE]=t[b.SEMATTRS_HTTP_ROUTE]),e};$.getIncomingRequestMetricAttributesOnResponse=UTe;var wTe=t=>{let e={};return t[b.ATTR_HTTP_ROUTE]!==void 0&&(e[b.ATTR_HTTP_ROUTE]=t[b.SEMATTRS_HTTP_ROUTE]),t[b.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(e[b.ATTR_HTTP_RESPONSE_STATUS_CODE]=t[b.ATTR_HTTP_RESPONSE_STATUS_CODE]),e};$.getIncomingStableRequestMetricAttributesOnResponse=wTe;function kTe(t,e){let n=new Map;for(let r=0,o=e.length;r<o;r++){let s=e[r].toLowerCase();n.set(s,s.replace(/-/g,"_"))}return(r,o)=>{for(let s of n.keys()){let i=o(s);if(i===void 0)continue;let a=n.get(s),c=`http.${t}.header.${a}`;typeof i=="string"?r.setAttribute(c,[i]):Array.isArray(i)?r.setAttribute(c,i):r.setAttribute(c,[i])}}}$.headerCapture=kTe;var VTe=new Set(["GET","HEAD","POST","PUT","DELETE","CONNECT","OPTIONS","TRACE","PATCH"]);function XV(t){if(t==null)return"GET";let e=t.toUpperCase();return VTe.has(e)?e:"_OTHER"}function JV(t){try{return _Te(t)}catch{return[]}}});var eB=m(yf=>{"use strict";Object.defineProperty(yf,"__esModule",{value:!0});yf.HttpInstrumentation=void 0;var z=(L(),I(V)),ec=fe(),QV=bh(),BTe=require("url"),GTe=rk(),qn=de(),yA=fe(),OA=require("events"),He=(Bn(),I(Vn)),we=ZV(),NA=class extends qn.InstrumentationBase{constructor(e={}){super("@opentelemetry/instrumentation-http",GTe.VERSION,e),this._spanNotEnded=new WeakSet,this._semconvStability=2,this._headerCapture=this._createHeaderCapture();for(let n of(0,yA.getEnv)().OTEL_SEMCONV_STABILITY_OPT_IN)if(n.toLowerCase()==="http/dup"){this._semconvStability=3;break}else n.toLowerCase()==="http"&&(this._semconvStability=1)}_updateMetricInstruments(){this._oldHttpServerDurationHistogram=this.meter.createHistogram("http.server.duration",{description:"Measures the duration of inbound HTTP requests.",unit:"ms",valueType:z.ValueType.DOUBLE}),this._oldHttpClientDurationHistogram=this.meter.createHistogram("http.client.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"ms",valueType:z.ValueType.DOUBLE}),this._stableHttpServerDurationHistogram=this.meter.createHistogram(He.METRIC_HTTP_SERVER_REQUEST_DURATION,{description:"Duration of HTTP server requests.",unit:"s",valueType:z.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}}),this._stableHttpClientDurationHistogram=this.meter.createHistogram(He.METRIC_HTTP_CLIENT_REQUEST_DURATION,{description:"Duration of HTTP client requests.",unit:"s",valueType:z.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}_recordServerDuration(e,n,r){(this._semconvStability&2)===2&&this._oldHttpServerDurationHistogram.record(e,n),(this._semconvStability&1)===1&&this._stableHttpServerDurationHistogram.record(e/1e3,r)}_recordClientDuration(e,n,r){(this._semconvStability&2)===2&&this._oldHttpClientDurationHistogram.record(e,n),(this._semconvStability&1)===1&&this._stableHttpClientDurationHistogram.record(e/1e3,r)}setConfig(e={}){super.setConfig(e),this._headerCapture=this._createHeaderCapture()}init(){return[this._getHttpsInstrumentation(),this._getHttpInstrumentation()]}_getHttpInstrumentation(){return new qn.InstrumentationNodeModuleDefinition("http",["*"],e=>{let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchOutgoingRequestFunction("http")),o=this._wrap(e,"get",this._getPatchOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("http")),e},e=>{e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getHttpsInstrumentation(){return new qn.InstrumentationNodeModuleDefinition("https",["*"],e=>{let n=e[Symbol.toStringTag]==="Module";if(!this.getConfig().disableOutgoingRequestInstrumentation){let r=this._wrap(e,"request",this._getPatchHttpsOutgoingRequestFunction("https")),o=this._wrap(e,"get",this._getPatchHttpsOutgoingGetFunction(r));n&&(e.default.request=r,e.default.get=o)}return this.getConfig().disableIncomingRequestInstrumentation||this._wrap(e.Server.prototype,"emit",this._getPatchIncomingRequestFunction("https")),e},e=>{e!==void 0&&(this.getConfig().disableOutgoingRequestInstrumentation||(this._unwrap(e,"request"),this._unwrap(e,"get")),this.getConfig().disableIncomingRequestInstrumentation||this._unwrap(e.Server.prototype,"emit"))})}_getPatchIncomingRequestFunction(e){return n=>this._incomingRequestFunction(e,n)}_getPatchOutgoingRequestFunction(e){return n=>this._outgoingRequestFunction(e,n)}_getPatchOutgoingGetFunction(e){return n=>function(o,...s){let i=e(o,...s);return i.end(),i}}_getPatchHttpsOutgoingRequestFunction(e){return n=>{let r=this;return function(s,...i){var a;return e==="https"&&typeof s=="object"&&((a=s?.constructor)===null||a===void 0?void 0:a.name)!=="URL"&&(s=Object.assign({},s),r._setDefaultOptions(s)),r._getPatchOutgoingRequestFunction(e)(n)(s,...i)}}}_setDefaultOptions(e){e.protocol=e.protocol||"https:",e.port=e.port||443}_getPatchHttpsOutgoingGetFunction(e){return n=>{let r=this;return function(s,...i){return r._getPatchOutgoingGetFunction(e)(n)(s,...i)}}}_traceClientRequest(e,n,r,o,s){this.getConfig().requestHook&&this._callRequestHook(n,e);let i=!1;return e.prependListener("response",a=>{this._diag.debug("outgoingRequest on response()"),e.listenerCount("response")<=1&&a.resume();let c=(0,we.getOutgoingRequestAttributesOnResponse)(a,this._semconvStability);n.setAttributes(c),o=Object.assign(o,(0,we.getOutgoingRequestMetricAttributesOnResponse)(c)),this.getConfig().responseHook&&this._callResponseHook(n,a),this._headerCapture.client.captureRequestHeaders(n,l=>e.getHeader(l)),this._headerCapture.client.captureResponseHeaders(n,l=>a.headers[l]),z.context.bind(z.context.active(),a);let u=()=>{if(this._diag.debug("outgoingRequest on end()"),i)return;i=!0;let l;a.aborted&&!a.complete?l={code:z.SpanStatusCode.ERROR}:l={code:(0,we.parseResponseStatus)(z.SpanKind.CLIENT,a.statusCode)},n.setStatus(l),this.getConfig().applyCustomAttributesOnSpan&&(0,qn.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(n,e,a),()=>{},!0),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s)};a.on("end",u),QV.lt(process.version,"16.0.0")&&a.on("close",u),a.on(OA.errorMonitor,l=>{this._diag.debug("outgoingRequest on error()",l),!i&&(i=!0,(0,we.setSpanWithError)(n,l,this._semconvStability),n.setStatus({code:z.SpanStatusCode.ERROR,message:l.message}),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))})}),e.on("close",()=>{this._diag.debug("outgoingRequest on request close()"),!(e.aborted||i)&&(i=!0,this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))}),e.on(OA.errorMonitor,a=>{this._diag.debug("outgoingRequest on request error()",a),!i&&(i=!0,(0,we.setSpanWithError)(n,a,this._semconvStability),this._closeHttpSpan(n,z.SpanKind.CLIENT,r,o,s))}),this._diag.debug("http.ClientRequest return request"),e}_incomingRequestFunction(e,n){let r=this;return function(s,...i){if(s!=="request")return n.apply(this,[s,...i]);let a=i[0],c=i[1],u=a.method||"GET";if(r._diag.debug(`${e} instrumentation incomingRequest`),(0,qn.safeExecuteInTheMiddle)(()=>{var O,N;return(N=(O=r.getConfig()).ignoreIncomingRequestHook)===null||N===void 0?void 0:N.call(O,a)},O=>{O!=null&&r._diag.error("caught ignoreIncomingRequestHook error: ",O)},!0))return z.context.with((0,ec.suppressTracing)(z.context.active()),()=>(z.context.bind(z.context.active(),a),z.context.bind(z.context.active(),c),n.apply(this,[s,...i])));let l=a.headers,d=(0,we.getIncomingRequestAttributes)(a,{component:e,serverName:r.getConfig().serverName,hookAttributes:r._callStartSpanHook(a,r.getConfig().startIncomingSpanHook),semconvStability:r._semconvStability},r._diag),p={kind:z.SpanKind.SERVER,attributes:d},_=(0,ec.hrTime)(),f=(0,we.getIncomingRequestMetricAttributes)(d),E={[He.ATTR_HTTP_REQUEST_METHOD]:d[He.ATTR_HTTP_REQUEST_METHOD],[He.ATTR_URL_SCHEME]:d[He.ATTR_URL_SCHEME]};d[He.ATTR_NETWORK_PROTOCOL_VERSION]&&(E[He.ATTR_NETWORK_PROTOCOL_VERSION]=d[He.ATTR_NETWORK_PROTOCOL_VERSION]);let S=z.propagation.extract(z.ROOT_CONTEXT,l),g=r._startHttpSpan(u,p,S),h={type:yA.RPCType.HTTP,span:g};return z.context.with((0,yA.setRPCMetadata)(z.trace.setSpan(S,g),h),()=>{z.context.bind(z.context.active(),a),z.context.bind(z.context.active(),c),r.getConfig().requestHook&&r._callRequestHook(g,a),r.getConfig().responseHook&&r._callResponseHook(g,c),r._headerCapture.server.captureRequestHeaders(g,N=>a.headers[N]);let O=!1;return c.on("close",()=>{O||r._onServerResponseFinish(a,c,g,f,E,_)}),c.on(OA.errorMonitor,N=>{O=!0,r._onServerResponseError(g,f,E,_,N)}),(0,qn.safeExecuteInTheMiddle)(()=>n.apply(this,[s,...i]),N=>{if(N)throw(0,we.setSpanWithError)(g,N,r._semconvStability),r._closeHttpSpan(g,z.SpanKind.SERVER,_,f,E),N})})}}_outgoingRequestFunction(e,n){let r=this;return function(s,...i){if(!(0,we.isValidOptionsType)(s))return n.apply(this,[s,...i]);let a=typeof i[0]=="object"&&(typeof s=="string"||s instanceof BTe.URL)?i.shift():void 0,{method:c,invalidUrl:u,optionsParsed:l}=(0,we.getRequestInfo)(r._diag,s,a);if(e==="http"&&QV.lt(process.version,"9.0.0")&&l.protocol==="https:")return n.apply(this,[l,...i]);if((0,qn.safeExecuteInTheMiddle)(()=>{var A,M;return(M=(A=r.getConfig()).ignoreOutgoingRequestHook)===null||M===void 0?void 0:M.call(A,l)},A=>{A!=null&&r._diag.error("caught ignoreOutgoingRequestHook error: ",A)},!0))return n.apply(this,[l,...i]);let{hostname:d,port:p}=(0,we.extractHostnameAndPort)(l),_=(0,we.getOutgoingRequestAttributes)(l,{component:e,port:p,hostname:d,hookAttributes:r._callStartSpanHook(l,r.getConfig().startOutgoingSpanHook)},r._semconvStability),f=(0,ec.hrTime)(),E=(0,we.getOutgoingRequestMetricAttributes)(_),S={[He.ATTR_HTTP_REQUEST_METHOD]:_[He.ATTR_HTTP_REQUEST_METHOD],[He.ATTR_SERVER_ADDRESS]:_[He.ATTR_SERVER_ADDRESS],[He.ATTR_SERVER_PORT]:_[He.ATTR_SERVER_PORT]};_[He.ATTR_HTTP_RESPONSE_STATUS_CODE]&&(S[He.ATTR_HTTP_RESPONSE_STATUS_CODE]=_[He.ATTR_HTTP_RESPONSE_STATUS_CODE]),_[He.ATTR_NETWORK_PROTOCOL_VERSION]&&(S[He.ATTR_NETWORK_PROTOCOL_VERSION]=_[He.ATTR_NETWORK_PROTOCOL_VERSION]);let g={kind:z.SpanKind.CLIENT,attributes:_},h=r._startHttpSpan(c,g),O=z.context.active(),N=z.trace.setSpan(O,h);return l.headers?l.headers=Object.assign({},l.headers):l.headers={},z.propagation.inject(N,l.headers),z.context.with(N,()=>{let A=i[i.length-1];typeof A=="function"&&(i[i.length-1]=z.context.bind(O,A));let M=(0,qn.safeExecuteInTheMiddle)(()=>u?n.apply(this,[s,...i]):n.apply(this,[l,...i]),P=>{if(P)throw(0,we.setSpanWithError)(h,P,r._semconvStability),r._closeHttpSpan(h,z.SpanKind.CLIENT,f,E,S),P});return r._diag.debug(`${e} instrumentation outgoingRequest`),z.context.bind(O,M),r._traceClientRequest(M,h,f,E,S)})}}_onServerResponseFinish(e,n,r,o,s,i){let a=(0,we.getIncomingRequestAttributesOnResponse)(e,n,this._semconvStability);o=Object.assign(o,(0,we.getIncomingRequestMetricAttributesOnResponse)(a)),s=Object.assign(s,(0,we.getIncomingStableRequestMetricAttributesOnResponse)(a)),this._headerCapture.server.captureResponseHeaders(r,u=>n.getHeader(u)),r.setAttributes(a).setStatus({code:(0,we.parseResponseStatus)(z.SpanKind.SERVER,n.statusCode)});let c=a[He.SEMATTRS_HTTP_ROUTE];c&&r.updateName(`${e.method||"GET"} ${c}`),this.getConfig().applyCustomAttributesOnSpan&&(0,qn.safeExecuteInTheMiddle)(()=>this.getConfig().applyCustomAttributesOnSpan(r,e,n),()=>{},!0),this._closeHttpSpan(r,z.SpanKind.SERVER,i,o,s)}_onServerResponseError(e,n,r,o,s){(0,we.setSpanWithError)(e,s,this._semconvStability),this._closeHttpSpan(e,z.SpanKind.SERVER,o,n,r)}_startHttpSpan(e,n,r=z.context.active()){let o=n.kind===z.SpanKind.CLIENT?this.getConfig().requireParentforOutgoingSpans:this.getConfig().requireParentforIncomingSpans,s,i=z.trace.getSpan(r);return o===!0&&i===void 0?s=z.trace.wrapSpanContext(z.INVALID_SPAN_CONTEXT):o===!0&&i?.spanContext().isRemote?s=i:s=this.tracer.startSpan(e,n,r),this._spanNotEnded.add(s),s}_closeHttpSpan(e,n,r,o,s){if(!this._spanNotEnded.has(e))return;e.end(),this._spanNotEnded.delete(e);let i=(0,ec.hrTimeToMilliseconds)((0,ec.hrTimeDuration)(r,(0,ec.hrTime)()));n===z.SpanKind.SERVER?this._recordServerDuration(i,o,s):n===z.SpanKind.CLIENT&&this._recordClientDuration(i,o,s)}_callResponseHook(e,n){(0,qn.safeExecuteInTheMiddle)(()=>this.getConfig().responseHook(e,n),()=>{},!0)}_callRequestHook(e,n){(0,qn.safeExecuteInTheMiddle)(()=>this.getConfig().requestHook(e,n),()=>{},!0)}_callStartSpanHook(e,n){if(typeof n=="function")return(0,qn.safeExecuteInTheMiddle)(()=>n(e),()=>{},!0)}_createHeaderCapture(){var e,n,r,o,s,i,a,c,u,l,d,p;let _=this.getConfig();return{client:{captureRequestHeaders:(0,we.headerCapture)("request",(r=(n=(e=_.headersToSpanAttributes)===null||e===void 0?void 0:e.client)===null||n===void 0?void 0:n.requestHeaders)!==null&&r!==void 0?r:[]),captureResponseHeaders:(0,we.headerCapture)("response",(i=(s=(o=_.headersToSpanAttributes)===null||o===void 0?void 0:o.client)===null||s===void 0?void 0:s.responseHeaders)!==null&&i!==void 0?i:[])},server:{captureRequestHeaders:(0,we.headerCapture)("request",(u=(c=(a=_.headersToSpanAttributes)===null||a===void 0?void 0:a.server)===null||c===void 0?void 0:c.requestHeaders)!==null&&u!==void 0?u:[]),captureResponseHeaders:(0,we.headerCapture)("response",(p=(d=(l=_.headersToSpanAttributes)===null||l===void 0?void 0:l.server)===null||d===void 0?void 0:d.responseHeaders)!==null&&p!==void 0?p:[])}}}};yf.HttpInstrumentation=NA});var tB=m(Of=>{"use strict";Object.defineProperty(Of,"__esModule",{value:!0});Of.HttpInstrumentation=void 0;var HTe=eB();Object.defineProperty(Of,"HttpInstrumentation",{enumerable:!0,get:function(){return HTe.HttpInstrumentation}})});function Qe(t){let e={},n=t.length;for(let r=0;r<n;r++){let o=t[r];o&&(e[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return e}var DR=B(()=>{});var CH,vH,IH,PH,bH,MH,LH,xH,DH,UH,wH,kH,VH,BH,GH,HH,FH,$H,jH,qH,YH,KH,WH,zH,XH,JH,ZH,QH,eF,tF,nF,rF,oF,sF,iF,aF,cF,uF,lF,dF,pF,_F,fF,mF,EF,SF,TF,gF,hF,AF,RF,yF,OF,NF,CF,vF,IF,PF,bF,MF,LF,xF,DF,UF,wF,kF,VF,BF,GF,HF,FF,$F,jF,qF,YF,KF,WF,zF,XF,JF,ZF,QF,e$,t$,n$,r$,o$,s$,i$,a$,c$,u$,l$,d$,p$,_$,f$,m$,E$,S$,T$,g$,h$,A$,R$,y$,O$,N$,C$,v$,I$,P$,b$,M$,L$,x$,D$,U$,w$,k$,V$,B$,G$,H$,F$,$$,j$,q$,yAe,UR,OAe,NAe,CAe,vAe,wR,IAe,PAe,bAe,MAe,LAe,xAe,DAe,UAe,wAe,kAe,VAe,BAe,GAe,HAe,FAe,$Ae,jAe,qAe,kR,YAe,KAe,WAe,zAe,XAe,JAe,ZAe,QAe,eRe,tRe,nRe,rRe,oRe,sRe,iRe,aRe,cRe,uRe,lRe,dRe,pRe,_Re,fRe,mRe,ERe,SRe,TRe,gRe,hRe,ARe,RRe,yRe,ORe,NRe,jl,gc,VR,CRe,vRe,Sm,IRe,PRe,bRe,MRe,LRe,xRe,DRe,ql,URe,wRe,kRe,VRe,BRe,GRe,HRe,FRe,$Re,jRe,qRe,YRe,KRe,WRe,zRe,XRe,JRe,ZRe,QRe,eye,tye,nye,rye,BR,oye,sye,iye,aye,cye,uye,lye,dye,pye,_ye,fye,mye,Eye,Sye,Tye,gye,hye,Aye,Rye,GR,yye,HR,Oye,Nye,Cye,vye,Iye,Pye,bye,Mye,Lye,Y$,K$,W$,z$,X$,J$,Z$,Q$,ej,tj,nj,rj,oj,sj,ij,aj,cj,uj,lj,dj,pj,_j,fj,mj,Ej,Sj,Tj,gj,hj,Aj,Rj,yj,Oj,Nj,Cj,vj,Ij,Pj,bj,Mj,Lj,xj,Dj,Uj,wj,kj,Vj,xye,Dye,Uye,wye,kye,Vye,Bye,Gye,Hye,Fye,$ye,jye,qye,Yye,Kye,Wye,zye,Xye,Jye,Zye,Qye,eOe,tOe,nOe,rOe,oOe,sOe,iOe,aOe,cOe,uOe,lOe,dOe,pOe,_Oe,fOe,mOe,EOe,SOe,TOe,gOe,hOe,AOe,ROe,yOe,OOe,NOe,COe,Bj,Gj,Hj,Fj,$j,jj,qj,Yj,Kj,Wj,zj,vOe,IOe,POe,bOe,MOe,LOe,xOe,DOe,UOe,wOe,kOe,VOe,Xj,Jj,Zj,Qj,eq,BOe,GOe,HOe,FOe,$Oe,jOe,tq,nq,rq,qOe,YOe,KOe,WOe,oq,sq,iq,aq,zOe,XOe,JOe,ZOe,QOe,cq,uq,lq,dq,pq,_q,fq,eNe,tNe,nNe,rNe,oNe,sNe,iNe,aNe,mq,Eq,Sq,Tq,gq,cNe,uNe,lNe,dNe,pNe,_Ne,hq,Aq,Rq,yq,Oq,Nq,Cq,vq,Iq,Pq,bq,Mq,Lq,xq,Dq,Uq,wq,kq,Vq,Bq,Gq,fNe,mNe,ENe,SNe,TNe,gNe,hNe,ANe,RNe,yNe,ONe,NNe,CNe,vNe,INe,PNe,bNe,MNe,LNe,xNe,DNe,UNe,Hq,Fq,$q,jq,qq,wNe,kNe,VNe,BNe,GNe,HNe,Yq,Kq,FNe,$Ne,jNe,Wq,zq,qNe,YNe,KNe,Xq,Jq,Zq,Qq,eY,tY,nY,rY,oY,sY,iY,aY,cY,uY,lY,dY,pY,WNe,zNe,XNe,JNe,ZNe,QNe,eCe,tCe,nCe,rCe,oCe,sCe,iCe,aCe,cCe,uCe,lCe,dCe,_Y,fY,pCe,_Ce,fCe,mY=B(()=>{DR();CH="aws.lambda.invoked_arn",vH="db.system",IH="db.connection_string",PH="db.user",bH="db.jdbc.driver_classname",MH="db.name",LH="db.statement",xH="db.operation",DH="db.mssql.instance_name",UH="db.cassandra.keyspace",wH="db.cassandra.page_size",kH="db.cassandra.consistency_level",VH="db.cassandra.table",BH="db.cassandra.idempotence",GH="db.cassandra.speculative_execution_count",HH="db.cassandra.coordinator.id",FH="db.cassandra.coordinator.dc",$H="db.hbase.namespace",jH="db.redis.database_index",qH="db.mongodb.collection",YH="db.sql.table",KH="exception.type",WH="exception.message",zH="exception.stacktrace",XH="exception.escaped",JH="faas.trigger",ZH="faas.execution",QH="faas.document.collection",eF="faas.document.operation",tF="faas.document.time",nF="faas.document.name",rF="faas.time",oF="faas.cron",sF="faas.coldstart",iF="faas.invoked_name",aF="faas.invoked_provider",cF="faas.invoked_region",uF="net.transport",lF="net.peer.ip",dF="net.peer.port",pF="net.peer.name",_F="net.host.ip",fF="net.host.port",mF="net.host.name",EF="net.host.connection.type",SF="net.host.connection.subtype",TF="net.host.carrier.name",gF="net.host.carrier.mcc",hF="net.host.carrier.mnc",AF="net.host.carrier.icc",RF="peer.service",yF="enduser.id",OF="enduser.role",NF="enduser.scope",CF="thread.id",vF="thread.name",IF="code.function",PF="code.namespace",bF="code.filepath",MF="code.lineno",LF="http.method",xF="http.url",DF="http.target",UF="http.host",wF="http.scheme",kF="http.status_code",VF="http.flavor",BF="http.user_agent",GF="http.request_content_length",HF="http.request_content_length_uncompressed",FF="http.response_content_length",$F="http.response_content_length_uncompressed",jF="http.server_name",qF="http.route",YF="http.client_ip",KF="aws.dynamodb.table_names",WF="aws.dynamodb.consumed_capacity",zF="aws.dynamodb.item_collection_metrics",XF="aws.dynamodb.provisioned_read_capacity",JF="aws.dynamodb.provisioned_write_capacity",ZF="aws.dynamodb.consistent_read",QF="aws.dynamodb.projection",e$="aws.dynamodb.limit",t$="aws.dynamodb.attributes_to_get",n$="aws.dynamodb.index_name",r$="aws.dynamodb.select",o$="aws.dynamodb.global_secondary_indexes",s$="aws.dynamodb.local_secondary_indexes",i$="aws.dynamodb.exclusive_start_table",a$="aws.dynamodb.table_count",c$="aws.dynamodb.scan_forward",u$="aws.dynamodb.segment",l$="aws.dynamodb.total_segments",d$="aws.dynamodb.count",p$="aws.dynamodb.scanned_count",_$="aws.dynamodb.attribute_definitions",f$="aws.dynamodb.global_secondary_index_updates",m$="messaging.system",E$="messaging.destination",S$="messaging.destination_kind",T$="messaging.temp_destination",g$="messaging.protocol",h$="messaging.protocol_version",A$="messaging.url",R$="messaging.message_id",y$="messaging.conversation_id",O$="messaging.message_payload_size_bytes",N$="messaging.message_payload_compressed_size_bytes",C$="messaging.operation",v$="messaging.consumer_id",I$="messaging.rabbitmq.routing_key",P$="messaging.kafka.message_key",b$="messaging.kafka.consumer_group",M$="messaging.kafka.client_id",L$="messaging.kafka.partition",x$="messaging.kafka.tombstone",D$="rpc.system",U$="rpc.service",w$="rpc.method",k$="rpc.grpc.status_code",V$="rpc.jsonrpc.version",B$="rpc.jsonrpc.request_id",G$="rpc.jsonrpc.error_code",H$="rpc.jsonrpc.error_message",F$="message.type",$$="message.id",j$="message.compressed_size",q$="message.uncompressed_size",yAe=CH,UR=vH,OAe=IH,NAe=PH,CAe=bH,vAe=MH,wR=LH,IAe=xH,PAe=DH,bAe=UH,MAe=wH,LAe=kH,xAe=VH,DAe=BH,UAe=GH,wAe=HH,kAe=FH,VAe=$H,BAe=jH,GAe=qH,HAe=YH,FAe=KH,$Ae=WH,jAe=zH,qAe=XH,kR=JH,YAe=ZH,KAe=QH,WAe=eF,zAe=tF,XAe=nF,JAe=rF,ZAe=oF,QAe=sF,eRe=iF,tRe=aF,nRe=cF,rRe=uF,oRe=lF,sRe=dF,iRe=pF,aRe=_F,cRe=fF,uRe=mF,lRe=EF,dRe=SF,pRe=TF,_Re=gF,fRe=hF,mRe=AF,ERe=RF,SRe=yF,TRe=OF,gRe=NF,hRe=CF,ARe=vF,RRe=IF,yRe=PF,ORe=bF,NRe=MF,jl=LF,gc=xF,VR=DF,CRe=UF,vRe=wF,Sm=kF,IRe=VF,PRe=BF,bRe=GF,MRe=HF,LRe=FF,xRe=$F,DRe=jF,ql=qF,URe=YF,wRe=KF,kRe=WF,VRe=zF,BRe=XF,GRe=JF,HRe=ZF,FRe=QF,$Re=e$,jRe=t$,qRe=n$,YRe=r$,KRe=o$,WRe=s$,zRe=i$,XRe=a$,JRe=c$,ZRe=u$,QRe=l$,eye=d$,tye=p$,nye=_$,rye=f$,BR=m$,oye=E$,sye=S$,iye=T$,aye=g$,cye=h$,uye=A$,lye=R$,dye=y$,pye=O$,_ye=N$,fye=C$,mye=v$,Eye=I$,Sye=P$,Tye=b$,gye=M$,hye=L$,Aye=x$,Rye=D$,GR=U$,yye=w$,HR=k$,Oye=V$,Nye=B$,Cye=G$,vye=H$,Iye=F$,Pye=$$,bye=j$,Mye=q$,Lye=Qe([CH,vH,IH,PH,bH,MH,LH,xH,DH,UH,wH,kH,VH,BH,GH,HH,FH,$H,jH,qH,YH,KH,WH,zH,XH,JH,ZH,QH,eF,tF,nF,rF,oF,sF,iF,aF,cF,uF,lF,dF,pF,_F,fF,mF,EF,SF,TF,gF,hF,AF,RF,yF,OF,NF,CF,vF,IF,PF,bF,MF,LF,xF,DF,UF,wF,kF,VF,BF,GF,HF,FF,$F,jF,qF,YF,KF,WF,zF,XF,JF,ZF,QF,e$,t$,n$,r$,o$,s$,i$,a$,c$,u$,l$,d$,p$,_$,f$,m$,E$,S$,T$,g$,h$,A$,R$,y$,O$,N$,C$,v$,I$,P$,b$,M$,L$,x$,D$,U$,w$,k$,V$,B$,G$,H$,F$,$$,j$,q$]),Y$="other_sql",K$="mssql",W$="mysql",z$="oracle",X$="db2",J$="postgresql",Z$="redshift",Q$="hive",ej="cloudscape",tj="hsqldb",nj="progress",rj="maxdb",oj="hanadb",sj="ingres",ij="firstsql",aj="edb",cj="cache",uj="adabas",lj="firebird",dj="derby",pj="filemaker",_j="informix",fj="instantdb",mj="interbase",Ej="mariadb",Sj="netezza",Tj="pervasive",gj="pointbase",hj="sqlite",Aj="sybase",Rj="teradata",yj="vertica",Oj="h2",Nj="coldfusion",Cj="cassandra",vj="hbase",Ij="mongodb",Pj="redis",bj="couchbase",Mj="couchdb",Lj="cosmosdb",xj="dynamodb",Dj="neo4j",Uj="geode",wj="elasticsearch",kj="memcached",Vj="cockroachdb",xye=Y$,Dye=K$,Uye=W$,wye=z$,kye=X$,Vye=J$,Bye=Z$,Gye=Q$,Hye=ej,Fye=tj,$ye=nj,jye=rj,qye=oj,Yye=sj,Kye=ij,Wye=aj,zye=cj,Xye=uj,Jye=lj,Zye=dj,Qye=pj,eOe=_j,tOe=fj,nOe=mj,rOe=Ej,oOe=Sj,sOe=Tj,iOe=gj,aOe=hj,cOe=Aj,uOe=Rj,lOe=yj,dOe=Oj,pOe=Nj,_Oe=Cj,fOe=vj,mOe=Ij,EOe=Pj,SOe=bj,TOe=Mj,gOe=Lj,hOe=xj,AOe=Dj,ROe=Uj,yOe=wj,OOe=kj,NOe=Vj,COe=Qe([Y$,K$,W$,z$,X$,J$,Z$,Q$,ej,tj,nj,rj,oj,sj,ij,aj,cj,uj,lj,dj,pj,_j,fj,mj,Ej,Sj,Tj,gj,hj,Aj,Rj,yj,Oj,Nj,Cj,vj,Ij,Pj,bj,Mj,Lj,xj,Dj,Uj,wj,kj,Vj]),Bj="all",Gj="each_quorum",Hj="quorum",Fj="local_quorum",$j="one",jj="two",qj="three",Yj="local_one",Kj="any",Wj="serial",zj="local_serial",vOe=Bj,IOe=Gj,POe=Hj,bOe=Fj,MOe=$j,LOe=jj,xOe=qj,DOe=Yj,UOe=Kj,wOe=Wj,kOe=zj,VOe=Qe([Bj,Gj,Hj,Fj,$j,jj,qj,Yj,Kj,Wj,zj]),Xj="datasource",Jj="http",Zj="pubsub",Qj="timer",eq="other",BOe=Xj,GOe=Jj,HOe=Zj,FOe=Qj,$Oe=eq,jOe=Qe([Xj,Jj,Zj,Qj,eq]),tq="insert",nq="edit",rq="delete",qOe=tq,YOe=nq,KOe=rq,WOe=Qe([tq,nq,rq]),oq="alibaba_cloud",sq="aws",iq="azure",aq="gcp",zOe=oq,XOe=sq,JOe=iq,ZOe=aq,QOe=Qe([oq,sq,iq,aq]),cq="ip_tcp",uq="ip_udp",lq="ip",dq="unix",pq="pipe",_q="inproc",fq="other",eNe=cq,tNe=uq,nNe=lq,rNe=dq,oNe=pq,sNe=_q,iNe=fq,aNe=Qe([cq,uq,lq,dq,pq,_q,fq]),mq="wifi",Eq="wired",Sq="cell",Tq="unavailable",gq="unknown",cNe=mq,uNe=Eq,lNe=Sq,dNe=Tq,pNe=gq,_Ne=Qe([mq,Eq,Sq,Tq,gq]),hq="gprs",Aq="edge",Rq="umts",yq="cdma",Oq="evdo_0",Nq="evdo_a",Cq="cdma2000_1xrtt",vq="hsdpa",Iq="hsupa",Pq="hspa",bq="iden",Mq="evdo_b",Lq="lte",xq="ehrpd",Dq="hspap",Uq="gsm",wq="td_scdma",kq="iwlan",Vq="nr",Bq="nrnsa",Gq="lte_ca",fNe=hq,mNe=Aq,ENe=Rq,SNe=yq,TNe=Oq,gNe=Nq,hNe=Cq,ANe=vq,RNe=Iq,yNe=Pq,ONe=bq,NNe=Mq,CNe=Lq,vNe=xq,INe=Dq,PNe=Uq,bNe=wq,MNe=kq,LNe=Vq,xNe=Bq,DNe=Gq,UNe=Qe([hq,Aq,Rq,yq,Oq,Nq,Cq,vq,Iq,Pq,bq,Mq,Lq,xq,Dq,Uq,wq,kq,Vq,Bq,Gq]),Hq="1.0",Fq="1.1",$q="2.0",jq="SPDY",qq="QUIC",wNe=Hq,kNe=Fq,VNe=$q,BNe=jq,GNe=qq,HNe={HTTP_1_0:Hq,HTTP_1_1:Fq,HTTP_2_0:$q,SPDY:jq,QUIC:qq},Yq="queue",Kq="topic",FNe=Yq,$Ne=Kq,jNe=Qe([Yq,Kq]),Wq="receive",zq="process",qNe=Wq,YNe=zq,KNe=Qe([Wq,zq]),Xq=0,Jq=1,Zq=2,Qq=3,eY=4,tY=5,nY=6,rY=7,oY=8,sY=9,iY=10,aY=11,cY=12,uY=13,lY=14,dY=15,pY=16,WNe=Xq,zNe=Jq,XNe=Zq,JNe=Qq,ZNe=eY,QNe=tY,eCe=nY,tCe=rY,nCe=oY,rCe=sY,oCe=iY,sCe=aY,iCe=cY,aCe=uY,cCe=lY,uCe=dY,lCe=pY,dCe={OK:Xq,CANCELLED:Jq,UNKNOWN:Zq,INVALID_ARGUMENT:Qq,DEADLINE_EXCEEDED:eY,NOT_FOUND:tY,ALREADY_EXISTS:nY,PERMISSION_DENIED:rY,RESOURCE_EXHAUSTED:oY,FAILED_PRECONDITION:sY,ABORTED:iY,OUT_OF_RANGE:aY,UNIMPLEMENTED:cY,INTERNAL:uY,UNAVAILABLE:lY,DATA_LOSS:dY,UNAUTHENTICATED:pY},_Y="SENT",fY="RECEIVED",pCe=_Y,_Ce=fY,fCe=Qe([_Y,fY])});var EY=B(()=>{mY()});var SY,TY,gY,hY,AY,RY,yY,OY,NY,CY,vY,IY,PY,bY,MY,LY,xY,DY,UY,wY,kY,VY,BY,GY,HY,FY,$Y,jY,qY,YY,KY,WY,zY,XY,JY,ZY,QY,eK,tK,nK,rK,oK,sK,iK,aK,cK,uK,lK,dK,pK,_K,fK,mK,EK,SK,TK,gK,hK,AK,RK,yK,OK,NK,CK,vK,IK,PK,bK,MK,LK,xK,DK,UK,wK,kK,VK,BK,GK,HK,FK,$K,mCe,ECe,SCe,TCe,gCe,hCe,ACe,RCe,yCe,OCe,NCe,CCe,vCe,ICe,PCe,bCe,MCe,LCe,xCe,DCe,UCe,wCe,kCe,VCe,BCe,GCe,HCe,FCe,$Ce,jCe,qCe,YCe,KCe,WCe,zCe,XCe,JCe,ZCe,QCe,eve,tve,nve,rve,ove,sve,ive,ave,cve,uve,lve,dve,pve,_ve,fve,mve,Eve,Sve,Tve,gve,hve,Ave,Rve,yve,Ove,Nve,Cve,vve,Ive,Pve,bve,Mve,FR,Lve,xve,Dve,Uve,wve,kve,Vve,Bve,Gve,Hve,jK,qK,YK,KK,Fve,$ve,jve,qve,Yve,WK,zK,XK,JK,ZK,QK,eW,tW,nW,rW,oW,sW,iW,aW,cW,uW,lW,Kve,Wve,zve,Xve,Jve,Zve,Qve,eIe,tIe,nIe,rIe,oIe,sIe,iIe,aIe,cIe,uIe,lIe,dW,pW,dIe,pIe,_Ie,_W,fW,mW,EW,SW,TW,gW,fIe,mIe,EIe,SIe,TIe,gIe,hIe,AIe,hW,AW,RW,yW,OW,NW,CW,vW,IW,PW,bW,RIe,yIe,OIe,NIe,CIe,vIe,IIe,PIe,bIe,MIe,LIe,xIe,MW,LW,xW,DW,UW,wW,kW,VW,BW,GW,DIe,UIe,wIe,kIe,VIe,BIe,GIe,HIe,FIe,$Ie,jIe,HW=B(()=>{DR();SY="cloud.provider",TY="cloud.account.id",gY="cloud.region",hY="cloud.availability_zone",AY="cloud.platform",RY="aws.ecs.container.arn",yY="aws.ecs.cluster.arn",OY="aws.ecs.launchtype",NY="aws.ecs.task.arn",CY="aws.ecs.task.family",vY="aws.ecs.task.revision",IY="aws.eks.cluster.arn",PY="aws.log.group.names",bY="aws.log.group.arns",MY="aws.log.stream.names",LY="aws.log.stream.arns",xY="container.name",DY="container.id",UY="container.runtime",wY="container.image.name",kY="container.image.tag",VY="deployment.environment",BY="device.id",GY="device.model.identifier",HY="device.model.name",FY="faas.name",$Y="faas.id",jY="faas.version",qY="faas.instance",YY="faas.max_memory",KY="host.id",WY="host.name",zY="host.type",XY="host.arch",JY="host.image.name",ZY="host.image.id",QY="host.image.version",eK="k8s.cluster.name",tK="k8s.node.name",nK="k8s.node.uid",rK="k8s.namespace.name",oK="k8s.pod.uid",sK="k8s.pod.name",iK="k8s.container.name",aK="k8s.replicaset.uid",cK="k8s.replicaset.name",uK="k8s.deployment.uid",lK="k8s.deployment.name",dK="k8s.statefulset.uid",pK="k8s.statefulset.name",_K="k8s.daemonset.uid",fK="k8s.daemonset.name",mK="k8s.job.uid",EK="k8s.job.name",SK="k8s.cronjob.uid",TK="k8s.cronjob.name",gK="os.type",hK="os.description",AK="os.name",RK="os.version",yK="process.pid",OK="process.executable.name",NK="process.executable.path",CK="process.command",vK="process.command_line",IK="process.command_args",PK="process.owner",bK="process.runtime.name",MK="process.runtime.version",LK="process.runtime.description",xK="service.name",DK="service.namespace",UK="service.instance.id",wK="service.version",kK="telemetry.sdk.name",VK="telemetry.sdk.language",BK="telemetry.sdk.version",GK="telemetry.auto.version",HK="webengine.name",FK="webengine.version",$K="webengine.description",mCe=SY,ECe=TY,SCe=gY,TCe=hY,gCe=AY,hCe=RY,ACe=yY,RCe=OY,yCe=NY,OCe=CY,NCe=vY,CCe=IY,vCe=PY,ICe=bY,PCe=MY,bCe=LY,MCe=xY,LCe=DY,xCe=UY,DCe=wY,UCe=kY,wCe=VY,kCe=BY,VCe=GY,BCe=HY,GCe=FY,HCe=$Y,FCe=jY,$Ce=qY,jCe=YY,qCe=KY,YCe=WY,KCe=zY,WCe=XY,zCe=JY,XCe=ZY,JCe=QY,ZCe=eK,QCe=tK,eve=nK,tve=rK,nve=oK,rve=sK,ove=iK,sve=aK,ive=cK,ave=uK,cve=lK,uve=dK,lve=pK,dve=_K,pve=fK,_ve=mK,fve=EK,mve=SK,Eve=TK,Sve=gK,Tve=hK,gve=AK,hve=RK,Ave=yK,Rve=OK,yve=NK,Ove=CK,Nve=vK,Cve=IK,vve=PK,Ive=bK,Pve=MK,bve=LK,Mve=xK,FR=DK,Lve=UK,xve=wK,Dve=kK,Uve=VK,wve=BK,kve=GK,Vve=HK,Bve=FK,Gve=$K,Hve=Qe([SY,TY,gY,hY,AY,RY,yY,OY,NY,CY,vY,IY,PY,bY,MY,LY,xY,DY,UY,wY,kY,VY,BY,GY,HY,FY,$Y,jY,qY,YY,KY,WY,zY,XY,JY,ZY,QY,eK,tK,nK,rK,oK,sK,iK,aK,cK,uK,lK,dK,pK,_K,fK,mK,EK,SK,TK,gK,hK,AK,RK,yK,OK,NK,CK,vK,IK,PK,bK,MK,LK,xK,DK,UK,wK,kK,VK,BK,GK,HK,FK,$K]),jK="alibaba_cloud",qK="aws",YK="azure",KK="gcp",Fve=jK,$ve=qK,jve=YK,qve=KK,Yve=Qe([jK,qK,YK,KK]),WK="alibaba_cloud_ecs",zK="alibaba_cloud_fc",XK="aws_ec2",JK="aws_ecs",ZK="aws_eks",QK="aws_lambda",eW="aws_elastic_beanstalk",tW="azure_vm",nW="azure_container_instances",rW="azure_aks",oW="azure_functions",sW="azure_app_service",iW="gcp_compute_engine",aW="gcp_cloud_run",cW="gcp_kubernetes_engine",uW="gcp_cloud_functions",lW="gcp_app_engine",Kve=WK,Wve=zK,zve=XK,Xve=JK,Jve=ZK,Zve=QK,Qve=eW,eIe=tW,tIe=nW,nIe=rW,rIe=oW,oIe=sW,sIe=iW,iIe=aW,aIe=cW,cIe=uW,uIe=lW,lIe=Qe([WK,zK,XK,JK,ZK,QK,eW,tW,nW,rW,oW,sW,iW,aW,cW,uW,lW]),dW="ec2",pW="fargate",dIe=dW,pIe=pW,_Ie=Qe([dW,pW]),_W="amd64",fW="arm32",mW="arm64",EW="ia64",SW="ppc32",TW="ppc64",gW="x86",fIe=_W,mIe=fW,EIe=mW,SIe=EW,TIe=SW,gIe=TW,hIe=gW,AIe=Qe([_W,fW,mW,EW,SW,TW,gW]),hW="windows",AW="linux",RW="darwin",yW="freebsd",OW="netbsd",NW="openbsd",CW="dragonflybsd",vW="hpux",IW="aix",PW="solaris",bW="z_os",RIe=hW,yIe=AW,OIe=RW,NIe=yW,CIe=OW,vIe=NW,IIe=CW,PIe=vW,bIe=IW,MIe=PW,LIe=bW,xIe=Qe([hW,AW,RW,yW,OW,NW,CW,vW,IW,PW,bW]),MW="cpp",LW="dotnet",xW="erlang",DW="go",UW="java",wW="nodejs",kW="php",VW="python",BW="ruby",GW="webjs",DIe=MW,UIe=LW,wIe=xW,kIe=DW,VIe=UW,BIe=wW,GIe=kW,HIe=VW,FIe=BW,$Ie=GW,jIe=Qe([MW,LW,xW,DW,UW,wW,kW,VW,BW,GW])});var FW=B(()=>{HW()});var qIe,YIe,KIe,WIe,zIe,XIe,JIe,ZIe,QIe,ePe,tPe,nPe,rPe,oPe,sPe,iPe,aPe,cPe,uPe,lPe,dPe,pPe,_Pe,fPe,mPe,EPe,$R,SPe,jR,TPe,qR,YR,gPe,KR,hPe,APe,RPe,yPe,OPe,NPe,CPe,vPe,n8e,r8e,WR,IPe,PPe,bPe,MPe,LPe,xPe,Fi,DPe,UPe,wPe,o8e,kPe,VPe,BPe,GPe,s8e,HPe,FPe,$Pe,jPe,hs,Wr,qPe,YPe,KPe,WPe,zPe,XPe,JPe,ZPe,QPe,i8e,ebe,tbe,nbe,rbe,obe,sbe,ibe,abe,cbe,ube,lbe,dbe,pbe,a8e,c8e,_be,fbe,mbe,Ebe,Sbe,Tbe,gbe,hbe,u8e,Abe,zR,XR,Rbe,Pn,ybe,JR,Obe,Nbe,Cbe,vbe,Ibe,Pbe,bbe,Mbe,Lbe,l8e,xbe,Dbe,d8e,Ube,wbe,p8e,kbe,Vbe,Bbe,Gbe,Hbe,Fbe,$be,jbe,hc,qbe,Ybe,Kbe,Wbe,$W=B(()=>{qIe="aspnetcore.diagnostics.exception.result",YIe="aborted",KIe="handled",WIe="skipped",zIe="unhandled",XIe="aspnetcore.diagnostics.handler.type",JIe="aspnetcore.rate_limiting.policy",ZIe="aspnetcore.rate_limiting.result",QIe="acquired",ePe="endpoint_limiter",tPe="global_limiter",nPe="request_canceled",rPe="aspnetcore.request.is_unhandled",oPe="aspnetcore.routing.is_fallback",sPe="aspnetcore.routing.match_status",iPe="failure",aPe="success",cPe="aspnetcore.user.is_authenticated",uPe="client.address",lPe="client.port",dPe="code.column.number",pPe="code.file.path",_Pe="code.function.name",fPe="code.line.number",mPe="code.stacktrace",EPe="db.collection.name",$R="db.namespace",SPe="db.operation.batch.size",jR="db.operation.name",TPe="db.query.summary",qR="db.query.text",YR="db.response.status_code",gPe="db.stored_procedure.name",KR="db.system.name",hPe="mariadb",APe="microsoft.sql_server",RPe="mysql",yPe="postgresql",OPe="dotnet.gc.heap.generation",NPe="gen0",CPe="gen1",vPe="gen2",n8e="loh",r8e="poh",WR="error.type",IPe="_OTHER",PPe="exception.escaped",bPe="exception.message",MPe="exception.stacktrace",LPe="exception.type",xPe=t=>`http.request.header.${t}`,Fi="http.request.method",DPe="_OTHER",UPe="CONNECT",wPe="DELETE",o8e="GET",kPe="HEAD",VPe="OPTIONS",BPe="PATCH",GPe="POST",s8e="PUT",HPe="TRACE",FPe="http.request.method_original",$Pe="http.request.resend_count",jPe=t=>`http.response.header.${t}`,hs="http.response.status_code",Wr="http.route",qPe="jvm.gc.action",YPe="jvm.gc.name",KPe="jvm.memory.pool.name",WPe="jvm.memory.type",zPe="heap",XPe="non_heap",JPe="jvm.thread.daemon",ZPe="jvm.thread.state",QPe="blocked",i8e="new",ebe="runnable",tbe="terminated",nbe="timed_waiting",rbe="waiting",obe="network.local.address",sbe="network.local.port",ibe="network.peer.address",abe="network.peer.port",cbe="network.protocol.name",ube="network.protocol.version",lbe="network.transport",dbe="pipe",pbe="quic",a8e="tcp",c8e="udp",_be="unix",fbe="network.type",mbe="ipv4",Ebe="ipv6",Sbe="otel.scope.name",Tbe="otel.scope.version",gbe="otel.status_code",hbe="ERROR",u8e="OK",Abe="otel.status_description",zR="server.address",XR="server.port",Rbe="service.instance.id",Pn="service.name",ybe="service.namespace",JR="service.version",Obe="signalr.connection.status",Nbe="app_shutdown",Cbe="normal_closure",vbe="timeout",Ibe="signalr.transport",Pbe="long_polling",bbe="server_sent_events",Mbe="web_sockets",Lbe="telemetry.sdk.language",l8e="cpp",xbe="dotnet",Dbe="erlang",d8e="go",Ube="java",wbe="nodejs",p8e="php",kbe="python",Vbe="ruby",Bbe="rust",Gbe="swift",Hbe="webjs",Fbe="telemetry.sdk.name",$be="telemetry.sdk.version",jbe="url.fragment",hc="url.full",qbe="url.path",Ybe="url.query",Kbe="url.scheme",Wbe="user_agent.original"});var zbe,Xbe,Jbe,Zbe,Qbe,eMe,tMe,nMe,rMe,oMe,sMe,iMe,aMe,cMe,uMe,lMe,dMe,pMe,_Me,fMe,mMe,EMe,SMe,TMe,gMe,hMe,AMe,RMe,yMe,OMe,NMe,CMe,vMe,IMe,PMe,bMe,MMe,LMe,xMe,DMe,UMe,wMe,kMe,VMe,BMe,GMe,HMe,FMe,$Me,jMe,qMe,jW=B(()=>{zbe="aspnetcore.diagnostics.exceptions",Xbe="aspnetcore.rate_limiting.active_request_leases",Jbe="aspnetcore.rate_limiting.queued_requests",Zbe="aspnetcore.rate_limiting.request.time_in_queue",Qbe="aspnetcore.rate_limiting.request_lease.duration",eMe="aspnetcore.rate_limiting.requests",tMe="aspnetcore.routing.match_attempts",nMe="db.client.operation.duration",rMe="dotnet.assembly.count",oMe="dotnet.exceptions",sMe="dotnet.gc.collections",iMe="dotnet.gc.heap.total_allocated",aMe="dotnet.gc.last_collection.heap.fragmentation.size",cMe="dotnet.gc.last_collection.heap.size",uMe="dotnet.gc.last_collection.memory.committed_size",lMe="dotnet.gc.pause.time",dMe="dotnet.jit.compilation.time",pMe="dotnet.jit.compiled_il.size",_Me="dotnet.jit.compiled_methods",fMe="dotnet.monitor.lock_contentions",mMe="dotnet.process.cpu.count",EMe="dotnet.process.cpu.time",SMe="dotnet.process.memory.working_set",TMe="dotnet.thread_pool.queue.length",gMe="dotnet.thread_pool.thread.count",hMe="dotnet.thread_pool.work_item.count",AMe="dotnet.timer.count",RMe="http.client.request.duration",yMe="http.server.request.duration",OMe="jvm.class.count",NMe="jvm.class.loaded",CMe="jvm.class.unloaded",vMe="jvm.cpu.count",IMe="jvm.cpu.recent_utilization",PMe="jvm.cpu.time",bMe="jvm.gc.duration",MMe="jvm.memory.committed",LMe="jvm.memory.limit",xMe="jvm.memory.used",DMe="jvm.memory.used_after_last_gc",UMe="jvm.thread.count",wMe="kestrel.active_connections",kMe="kestrel.active_tls_handshakes",VMe="kestrel.connection.duration",BMe="kestrel.queued_connections",GMe="kestrel.queued_requests",HMe="kestrel.rejected_connections",FMe="kestrel.tls_handshake.duration",$Me="kestrel.upgraded_connections",jMe="signalr.server.active_connections",qMe="signalr.server.connection.duration"});var YMe,qW=B(()=>{YMe="exception"});var et={};Kd(et,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>YIe,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>KIe,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>WIe,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>zIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>QIe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>ePe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>tPe,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>nPe,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>iPe,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>aPe,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>qIe,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>XIe,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>JIe,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>ZIe,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>rPe,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>oPe,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>sPe,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>cPe,ATTR_CLIENT_ADDRESS:()=>uPe,ATTR_CLIENT_PORT:()=>lPe,ATTR_CODE_COLUMN_NUMBER:()=>dPe,ATTR_CODE_FILE_PATH:()=>pPe,ATTR_CODE_FUNCTION_NAME:()=>_Pe,ATTR_CODE_LINE_NUMBER:()=>fPe,ATTR_CODE_STACKTRACE:()=>mPe,ATTR_DB_COLLECTION_NAME:()=>EPe,ATTR_DB_NAMESPACE:()=>$R,ATTR_DB_OPERATION_BATCH_SIZE:()=>SPe,ATTR_DB_OPERATION_NAME:()=>jR,ATTR_DB_QUERY_SUMMARY:()=>TPe,ATTR_DB_QUERY_TEXT:()=>qR,ATTR_DB_RESPONSE_STATUS_CODE:()=>YR,ATTR_DB_STORED_PROCEDURE_NAME:()=>gPe,ATTR_DB_SYSTEM_NAME:()=>KR,ATTR_DOTNET_GC_HEAP_GENERATION:()=>OPe,ATTR_ERROR_TYPE:()=>WR,ATTR_EXCEPTION_ESCAPED:()=>PPe,ATTR_EXCEPTION_MESSAGE:()=>bPe,ATTR_EXCEPTION_STACKTRACE:()=>MPe,ATTR_EXCEPTION_TYPE:()=>LPe,ATTR_HTTP_REQUEST_HEADER:()=>xPe,ATTR_HTTP_REQUEST_METHOD:()=>Fi,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>FPe,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>$Pe,ATTR_HTTP_RESPONSE_HEADER:()=>jPe,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>hs,ATTR_HTTP_ROUTE:()=>Wr,ATTR_JVM_GC_ACTION:()=>qPe,ATTR_JVM_GC_NAME:()=>YPe,ATTR_JVM_MEMORY_POOL_NAME:()=>KPe,ATTR_JVM_MEMORY_TYPE:()=>WPe,ATTR_JVM_THREAD_DAEMON:()=>JPe,ATTR_JVM_THREAD_STATE:()=>ZPe,ATTR_NETWORK_LOCAL_ADDRESS:()=>obe,ATTR_NETWORK_LOCAL_PORT:()=>sbe,ATTR_NETWORK_PEER_ADDRESS:()=>ibe,ATTR_NETWORK_PEER_PORT:()=>abe,ATTR_NETWORK_PROTOCOL_NAME:()=>cbe,ATTR_NETWORK_PROTOCOL_VERSION:()=>ube,ATTR_NETWORK_TRANSPORT:()=>lbe,ATTR_NETWORK_TYPE:()=>fbe,ATTR_OTEL_SCOPE_NAME:()=>Sbe,ATTR_OTEL_SCOPE_VERSION:()=>Tbe,ATTR_OTEL_STATUS_CODE:()=>gbe,ATTR_OTEL_STATUS_DESCRIPTION:()=>Abe,ATTR_SERVER_ADDRESS:()=>zR,ATTR_SERVER_PORT:()=>XR,ATTR_SERVICE_INSTANCE_ID:()=>Rbe,ATTR_SERVICE_NAME:()=>Pn,ATTR_SERVICE_NAMESPACE:()=>ybe,ATTR_SERVICE_VERSION:()=>JR,ATTR_SIGNALR_CONNECTION_STATUS:()=>Obe,ATTR_SIGNALR_TRANSPORT:()=>Ibe,ATTR_TELEMETRY_SDK_LANGUAGE:()=>Lbe,ATTR_TELEMETRY_SDK_NAME:()=>Fbe,ATTR_TELEMETRY_SDK_VERSION:()=>$be,ATTR_URL_FRAGMENT:()=>jbe,ATTR_URL_FULL:()=>hc,ATTR_URL_PATH:()=>qbe,ATTR_URL_QUERY:()=>Ybe,ATTR_URL_SCHEME:()=>Kbe,ATTR_USER_AGENT_ORIGINAL:()=>Wbe,AWSECSLAUNCHTYPEVALUES_EC2:()=>dIe,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>pIe,AwsEcsLaunchtypeValues:()=>_Ie,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Kve,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>Wve,CLOUDPLATFORMVALUES_AWS_EC2:()=>zve,CLOUDPLATFORMVALUES_AWS_ECS:()=>Xve,CLOUDPLATFORMVALUES_AWS_EKS:()=>Jve,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>Qve,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Zve,CLOUDPLATFORMVALUES_AZURE_AKS:()=>nIe,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>oIe,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>tIe,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>rIe,CLOUDPLATFORMVALUES_AZURE_VM:()=>eIe,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>uIe,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>cIe,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>iIe,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>sIe,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>aIe,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>Fve,CLOUDPROVIDERVALUES_AWS:()=>$ve,CLOUDPROVIDERVALUES_AZURE:()=>jve,CLOUDPROVIDERVALUES_GCP:()=>qve,CloudPlatformValues:()=>lIe,CloudProviderValues:()=>Yve,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>vOe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>UOe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>IOe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>DOe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>bOe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>kOe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>MOe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>POe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>wOe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>xOe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>LOe,DBSYSTEMVALUES_ADABAS:()=>Xye,DBSYSTEMVALUES_CACHE:()=>zye,DBSYSTEMVALUES_CASSANDRA:()=>_Oe,DBSYSTEMVALUES_CLOUDSCAPE:()=>Hye,DBSYSTEMVALUES_COCKROACHDB:()=>NOe,DBSYSTEMVALUES_COLDFUSION:()=>pOe,DBSYSTEMVALUES_COSMOSDB:()=>gOe,DBSYSTEMVALUES_COUCHBASE:()=>SOe,DBSYSTEMVALUES_COUCHDB:()=>TOe,DBSYSTEMVALUES_DB2:()=>kye,DBSYSTEMVALUES_DERBY:()=>Zye,DBSYSTEMVALUES_DYNAMODB:()=>hOe,DBSYSTEMVALUES_EDB:()=>Wye,DBSYSTEMVALUES_ELASTICSEARCH:()=>yOe,DBSYSTEMVALUES_FILEMAKER:()=>Qye,DBSYSTEMVALUES_FIREBIRD:()=>Jye,DBSYSTEMVALUES_FIRSTSQL:()=>Kye,DBSYSTEMVALUES_GEODE:()=>ROe,DBSYSTEMVALUES_H2:()=>dOe,DBSYSTEMVALUES_HANADB:()=>qye,DBSYSTEMVALUES_HBASE:()=>fOe,DBSYSTEMVALUES_HIVE:()=>Gye,DBSYSTEMVALUES_HSQLDB:()=>Fye,DBSYSTEMVALUES_INFORMIX:()=>eOe,DBSYSTEMVALUES_INGRES:()=>Yye,DBSYSTEMVALUES_INSTANTDB:()=>tOe,DBSYSTEMVALUES_INTERBASE:()=>nOe,DBSYSTEMVALUES_MARIADB:()=>rOe,DBSYSTEMVALUES_MAXDB:()=>jye,DBSYSTEMVALUES_MEMCACHED:()=>OOe,DBSYSTEMVALUES_MONGODB:()=>mOe,DBSYSTEMVALUES_MSSQL:()=>Dye,DBSYSTEMVALUES_MYSQL:()=>Uye,DBSYSTEMVALUES_NEO4J:()=>AOe,DBSYSTEMVALUES_NETEZZA:()=>oOe,DBSYSTEMVALUES_ORACLE:()=>wye,DBSYSTEMVALUES_OTHER_SQL:()=>xye,DBSYSTEMVALUES_PERVASIVE:()=>sOe,DBSYSTEMVALUES_POINTBASE:()=>iOe,DBSYSTEMVALUES_POSTGRESQL:()=>Vye,DBSYSTEMVALUES_PROGRESS:()=>$ye,DBSYSTEMVALUES_REDIS:()=>EOe,DBSYSTEMVALUES_REDSHIFT:()=>Bye,DBSYSTEMVALUES_SQLITE:()=>aOe,DBSYSTEMVALUES_SYBASE:()=>cOe,DBSYSTEMVALUES_TERADATA:()=>uOe,DBSYSTEMVALUES_VERTICA:()=>lOe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>hPe,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>APe,DB_SYSTEM_NAME_VALUE_MYSQL:()=>RPe,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>yPe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>NPe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>CPe,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>vPe,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>n8e,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>r8e,DbCassandraConsistencyLevelValues:()=>VOe,DbSystemValues:()=>COe,ERROR_TYPE_VALUE_OTHER:()=>IPe,EVENT_EXCEPTION:()=>YMe,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>KOe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>YOe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>qOe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>zOe,FAASINVOKEDPROVIDERVALUES_AWS:()=>XOe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>JOe,FAASINVOKEDPROVIDERVALUES_GCP:()=>ZOe,FAASTRIGGERVALUES_DATASOURCE:()=>BOe,FAASTRIGGERVALUES_HTTP:()=>GOe,FAASTRIGGERVALUES_OTHER:()=>$Oe,FAASTRIGGERVALUES_PUBSUB:()=>HOe,FAASTRIGGERVALUES_TIMER:()=>FOe,FaasDocumentOperationValues:()=>WOe,FaasInvokedProviderValues:()=>QOe,FaasTriggerValues:()=>jOe,HOSTARCHVALUES_AMD64:()=>fIe,HOSTARCHVALUES_ARM32:()=>mIe,HOSTARCHVALUES_ARM64:()=>EIe,HOSTARCHVALUES_IA64:()=>SIe,HOSTARCHVALUES_PPC32:()=>TIe,HOSTARCHVALUES_PPC64:()=>gIe,HOSTARCHVALUES_X86:()=>hIe,HTTPFLAVORVALUES_HTTP_1_0:()=>wNe,HTTPFLAVORVALUES_HTTP_1_1:()=>kNe,HTTPFLAVORVALUES_HTTP_2_0:()=>VNe,HTTPFLAVORVALUES_QUIC:()=>GNe,HTTPFLAVORVALUES_SPDY:()=>BNe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>UPe,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>wPe,HTTP_REQUEST_METHOD_VALUE_GET:()=>o8e,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>kPe,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>VPe,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>DPe,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>BPe,HTTP_REQUEST_METHOD_VALUE_POST:()=>GPe,HTTP_REQUEST_METHOD_VALUE_PUT:()=>s8e,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>HPe,HostArchValues:()=>AIe,HttpFlavorValues:()=>HNe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>zPe,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>XPe,JVM_THREAD_STATE_VALUE_BLOCKED:()=>QPe,JVM_THREAD_STATE_VALUE_NEW:()=>i8e,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>ebe,JVM_THREAD_STATE_VALUE_TERMINATED:()=>tbe,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>nbe,JVM_THREAD_STATE_VALUE_WAITING:()=>rbe,MESSAGETYPEVALUES_RECEIVED:()=>_Ce,MESSAGETYPEVALUES_SENT:()=>pCe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>FNe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>$Ne,MESSAGINGOPERATIONVALUES_PROCESS:()=>YNe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>qNe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>zbe,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Xbe,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Jbe,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>eMe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>Qbe,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>Zbe,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>tMe,METRIC_DB_CLIENT_OPERATION_DURATION:()=>nMe,METRIC_DOTNET_ASSEMBLY_COUNT:()=>rMe,METRIC_DOTNET_EXCEPTIONS:()=>oMe,METRIC_DOTNET_GC_COLLECTIONS:()=>sMe,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>iMe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>aMe,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>cMe,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>uMe,METRIC_DOTNET_GC_PAUSE_TIME:()=>lMe,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>dMe,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>pMe,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>_Me,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>fMe,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>mMe,METRIC_DOTNET_PROCESS_CPU_TIME:()=>EMe,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>SMe,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>TMe,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>gMe,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>hMe,METRIC_DOTNET_TIMER_COUNT:()=>AMe,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>RMe,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>yMe,METRIC_JVM_CLASS_COUNT:()=>OMe,METRIC_JVM_CLASS_LOADED:()=>NMe,METRIC_JVM_CLASS_UNLOADED:()=>CMe,METRIC_JVM_CPU_COUNT:()=>vMe,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>IMe,METRIC_JVM_CPU_TIME:()=>PMe,METRIC_JVM_GC_DURATION:()=>bMe,METRIC_JVM_MEMORY_COMMITTED:()=>MMe,METRIC_JVM_MEMORY_LIMIT:()=>LMe,METRIC_JVM_MEMORY_USED:()=>xMe,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>DMe,METRIC_JVM_THREAD_COUNT:()=>UMe,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>wMe,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>kMe,METRIC_KESTREL_CONNECTION_DURATION:()=>VMe,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>BMe,METRIC_KESTREL_QUEUED_REQUESTS:()=>GMe,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>HMe,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>FMe,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>$Me,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>jMe,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>qMe,MessageTypeValues:()=>fCe,MessagingDestinationKindValues:()=>jNe,MessagingOperationValues:()=>KNe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>SNe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>hNe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>mNe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>vNe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>TNe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>gNe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>NNe,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>fNe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>PNe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>ANe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>yNe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>INe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>RNe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>ONe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>MNe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>CNe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>DNe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>LNe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>xNe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>bNe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>ENe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>lNe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>dNe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>pNe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>cNe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>uNe,NETTRANSPORTVALUES_INPROC:()=>sNe,NETTRANSPORTVALUES_IP:()=>nNe,NETTRANSPORTVALUES_IP_TCP:()=>eNe,NETTRANSPORTVALUES_IP_UDP:()=>tNe,NETTRANSPORTVALUES_OTHER:()=>iNe,NETTRANSPORTVALUES_PIPE:()=>oNe,NETTRANSPORTVALUES_UNIX:()=>rNe,NETWORK_TRANSPORT_VALUE_PIPE:()=>dbe,NETWORK_TRANSPORT_VALUE_QUIC:()=>pbe,NETWORK_TRANSPORT_VALUE_TCP:()=>a8e,NETWORK_TRANSPORT_VALUE_UDP:()=>c8e,NETWORK_TRANSPORT_VALUE_UNIX:()=>_be,NETWORK_TYPE_VALUE_IPV4:()=>mbe,NETWORK_TYPE_VALUE_IPV6:()=>Ebe,NetHostConnectionSubtypeValues:()=>UNe,NetHostConnectionTypeValues:()=>_Ne,NetTransportValues:()=>aNe,OSTYPEVALUES_AIX:()=>bIe,OSTYPEVALUES_DARWIN:()=>OIe,OSTYPEVALUES_DRAGONFLYBSD:()=>IIe,OSTYPEVALUES_FREEBSD:()=>NIe,OSTYPEVALUES_HPUX:()=>PIe,OSTYPEVALUES_LINUX:()=>yIe,OSTYPEVALUES_NETBSD:()=>CIe,OSTYPEVALUES_OPENBSD:()=>vIe,OSTYPEVALUES_SOLARIS:()=>MIe,OSTYPEVALUES_WINDOWS:()=>RIe,OSTYPEVALUES_Z_OS:()=>LIe,OTEL_STATUS_CODE_VALUE_ERROR:()=>hbe,OTEL_STATUS_CODE_VALUE_OK:()=>u8e,OsTypeValues:()=>xIe,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>oCe,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>eCe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>zNe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>uCe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>ZNe,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>rCe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>aCe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>JNe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>QNe,RPCGRPCSTATUSCODEVALUES_OK:()=>WNe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>sCe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>tCe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>nCe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>lCe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>cCe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>iCe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>XNe,RpcGrpcStatusCodeValues:()=>dCe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>jRe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>nye,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>HRe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>kRe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>eye,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>zRe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>KRe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>rye,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>qRe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>VRe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>$Re,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>WRe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>FRe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>BRe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>GRe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>tye,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>JRe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>ZRe,SEMATTRS_AWS_DYNAMODB_SELECT:()=>YRe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>XRe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>wRe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>QRe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>yAe,SEMATTRS_CODE_FILEPATH:()=>ORe,SEMATTRS_CODE_FUNCTION:()=>RRe,SEMATTRS_CODE_LINENO:()=>NRe,SEMATTRS_CODE_NAMESPACE:()=>yRe,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>LAe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>kAe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>wAe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>DAe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>bAe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>MAe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>UAe,SEMATTRS_DB_CASSANDRA_TABLE:()=>xAe,SEMATTRS_DB_CONNECTION_STRING:()=>OAe,SEMATTRS_DB_HBASE_NAMESPACE:()=>VAe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>CAe,SEMATTRS_DB_MONGODB_COLLECTION:()=>GAe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>PAe,SEMATTRS_DB_NAME:()=>vAe,SEMATTRS_DB_OPERATION:()=>IAe,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>BAe,SEMATTRS_DB_SQL_TABLE:()=>HAe,SEMATTRS_DB_STATEMENT:()=>wR,SEMATTRS_DB_SYSTEM:()=>UR,SEMATTRS_DB_USER:()=>NAe,SEMATTRS_ENDUSER_ID:()=>SRe,SEMATTRS_ENDUSER_ROLE:()=>TRe,SEMATTRS_ENDUSER_SCOPE:()=>gRe,SEMATTRS_EXCEPTION_ESCAPED:()=>qAe,SEMATTRS_EXCEPTION_MESSAGE:()=>$Ae,SEMATTRS_EXCEPTION_STACKTRACE:()=>jAe,SEMATTRS_EXCEPTION_TYPE:()=>FAe,SEMATTRS_FAAS_COLDSTART:()=>QAe,SEMATTRS_FAAS_CRON:()=>ZAe,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>KAe,SEMATTRS_FAAS_DOCUMENT_NAME:()=>XAe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>WAe,SEMATTRS_FAAS_DOCUMENT_TIME:()=>zAe,SEMATTRS_FAAS_EXECUTION:()=>YAe,SEMATTRS_FAAS_INVOKED_NAME:()=>eRe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>tRe,SEMATTRS_FAAS_INVOKED_REGION:()=>nRe,SEMATTRS_FAAS_TIME:()=>JAe,SEMATTRS_FAAS_TRIGGER:()=>kR,SEMATTRS_HTTP_CLIENT_IP:()=>URe,SEMATTRS_HTTP_FLAVOR:()=>IRe,SEMATTRS_HTTP_HOST:()=>CRe,SEMATTRS_HTTP_METHOD:()=>jl,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>bRe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>MRe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>LRe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>xRe,SEMATTRS_HTTP_ROUTE:()=>ql,SEMATTRS_HTTP_SCHEME:()=>vRe,SEMATTRS_HTTP_SERVER_NAME:()=>DRe,SEMATTRS_HTTP_STATUS_CODE:()=>Sm,SEMATTRS_HTTP_TARGET:()=>VR,SEMATTRS_HTTP_URL:()=>gc,SEMATTRS_HTTP_USER_AGENT:()=>PRe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>bye,SEMATTRS_MESSAGE_ID:()=>Pye,SEMATTRS_MESSAGE_TYPE:()=>Iye,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>Mye,SEMATTRS_MESSAGING_CONSUMER_ID:()=>mye,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>dye,SEMATTRS_MESSAGING_DESTINATION:()=>oye,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>sye,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>gye,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>Tye,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>Sye,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>hye,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>Aye,SEMATTRS_MESSAGING_MESSAGE_ID:()=>lye,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>_ye,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>pye,SEMATTRS_MESSAGING_OPERATION:()=>fye,SEMATTRS_MESSAGING_PROTOCOL:()=>aye,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>cye,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>Eye,SEMATTRS_MESSAGING_SYSTEM:()=>BR,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>iye,SEMATTRS_MESSAGING_URL:()=>uye,SEMATTRS_NET_HOST_CARRIER_ICC:()=>mRe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>_Re,SEMATTRS_NET_HOST_CARRIER_MNC:()=>fRe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>pRe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>dRe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>lRe,SEMATTRS_NET_HOST_IP:()=>aRe,SEMATTRS_NET_HOST_NAME:()=>uRe,SEMATTRS_NET_HOST_PORT:()=>cRe,SEMATTRS_NET_PEER_IP:()=>oRe,SEMATTRS_NET_PEER_NAME:()=>iRe,SEMATTRS_NET_PEER_PORT:()=>sRe,SEMATTRS_NET_TRANSPORT:()=>rRe,SEMATTRS_PEER_SERVICE:()=>ERe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>HR,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>Cye,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>vye,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>Nye,SEMATTRS_RPC_JSONRPC_VERSION:()=>Oye,SEMATTRS_RPC_METHOD:()=>yye,SEMATTRS_RPC_SERVICE:()=>GR,SEMATTRS_RPC_SYSTEM:()=>Rye,SEMATTRS_THREAD_ID:()=>hRe,SEMATTRS_THREAD_NAME:()=>ARe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>ACe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>hCe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>RCe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>yCe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>OCe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>NCe,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>CCe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>ICe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>vCe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>bCe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>PCe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>ECe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>TCe,SEMRESATTRS_CLOUD_PLATFORM:()=>gCe,SEMRESATTRS_CLOUD_PROVIDER:()=>mCe,SEMRESATTRS_CLOUD_REGION:()=>SCe,SEMRESATTRS_CONTAINER_ID:()=>LCe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>DCe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>UCe,SEMRESATTRS_CONTAINER_NAME:()=>MCe,SEMRESATTRS_CONTAINER_RUNTIME:()=>xCe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>wCe,SEMRESATTRS_DEVICE_ID:()=>kCe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>VCe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>BCe,SEMRESATTRS_FAAS_ID:()=>HCe,SEMRESATTRS_FAAS_INSTANCE:()=>$Ce,SEMRESATTRS_FAAS_MAX_MEMORY:()=>jCe,SEMRESATTRS_FAAS_NAME:()=>GCe,SEMRESATTRS_FAAS_VERSION:()=>FCe,SEMRESATTRS_HOST_ARCH:()=>WCe,SEMRESATTRS_HOST_ID:()=>qCe,SEMRESATTRS_HOST_IMAGE_ID:()=>XCe,SEMRESATTRS_HOST_IMAGE_NAME:()=>zCe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>JCe,SEMRESATTRS_HOST_NAME:()=>YCe,SEMRESATTRS_HOST_TYPE:()=>KCe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>ZCe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>ove,SEMRESATTRS_K8S_CRONJOB_NAME:()=>Eve,SEMRESATTRS_K8S_CRONJOB_UID:()=>mve,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>pve,SEMRESATTRS_K8S_DAEMONSET_UID:()=>dve,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>cve,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>ave,SEMRESATTRS_K8S_JOB_NAME:()=>fve,SEMRESATTRS_K8S_JOB_UID:()=>_ve,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>tve,SEMRESATTRS_K8S_NODE_NAME:()=>QCe,SEMRESATTRS_K8S_NODE_UID:()=>eve,SEMRESATTRS_K8S_POD_NAME:()=>rve,SEMRESATTRS_K8S_POD_UID:()=>nve,SEMRESATTRS_K8S_REPLICASET_NAME:()=>ive,SEMRESATTRS_K8S_REPLICASET_UID:()=>sve,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>lve,SEMRESATTRS_K8S_STATEFULSET_UID:()=>uve,SEMRESATTRS_OS_DESCRIPTION:()=>Tve,SEMRESATTRS_OS_NAME:()=>gve,SEMRESATTRS_OS_TYPE:()=>Sve,SEMRESATTRS_OS_VERSION:()=>hve,SEMRESATTRS_PROCESS_COMMAND:()=>Ove,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>Cve,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>Nve,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>Rve,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>yve,SEMRESATTRS_PROCESS_OWNER:()=>vve,SEMRESATTRS_PROCESS_PID:()=>Ave,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>bve,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>Ive,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>Pve,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>Lve,SEMRESATTRS_SERVICE_NAME:()=>Mve,SEMRESATTRS_SERVICE_NAMESPACE:()=>FR,SEMRESATTRS_SERVICE_VERSION:()=>xve,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>kve,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>Uve,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>Dve,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>wve,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>Gve,SEMRESATTRS_WEBENGINE_NAME:()=>Vve,SEMRESATTRS_WEBENGINE_VERSION:()=>Bve,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Nbe,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Cbe,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>vbe,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>Pbe,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>bbe,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>Mbe,SemanticAttributes:()=>Lye,SemanticResourceAttributes:()=>Hve,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>DIe,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>UIe,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>wIe,TELEMETRYSDKLANGUAGEVALUES_GO:()=>kIe,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>VIe,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>BIe,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>GIe,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>HIe,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>FIe,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>$Ie,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>l8e,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>xbe,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>Dbe,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>d8e,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>Ube,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>wbe,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>p8e,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>kbe,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>Vbe,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>Bbe,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Gbe,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>Hbe,TelemetrySdkLanguageValues:()=>jIe});var Re=B(()=>{EY();FW();$W();jW();qW()});var YW=m(Tm=>{"use strict";Object.defineProperty(Tm,"__esModule",{value:!0});Tm.ExceptionEventName=void 0;Tm.ExceptionEventName="exception"});var QR=m(gm=>{"use strict";Object.defineProperty(gm,"__esModule",{value:!0});gm.Span=void 0;var Kn=(L(),I(V)),Ft=fe(),$i=(Bn(),I(Vn)),KMe=YW(),ZR=class{constructor(e,n,r,o,s,i,a=[],c,u,l){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:Kn.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=r,this._spanContext=o,this.parentSpanId=i,this.kind=s,this.links=a;let d=Date.now();this._performanceStartTime=Ft.otperformance.now(),this._performanceOffset=d-(this._performanceStartTime+(0,Ft.getTimeOrigin)()),this._startTimeProvided=c!=null,this.startTime=this._getTime(c??d),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0,l!=null&&this.setAttributes(l),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,n)}spanContext(){return this._spanContext}setAttribute(e,n){return n==null||this._isSpanEnded()?this:e.length===0?(Kn.diag.warn(`Invalid attribute key: ${e}`),this):(0,Ft.isAttributeValue)(n)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(n),this):(Kn.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[n,r]of Object.entries(e))this.setAttribute(n,r);return this}addEvent(e,n,r){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return Kn.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(this._droppedEventsCount===0&&Kn.diag.debug("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,Ft.isTimeInput)(n)&&((0,Ft.isTimeInput)(r)||(r=n),n=void 0);let o=(0,Ft.sanitizeAttributes)(n);return this.events.push({name:e,attributes:o,time:this._getTime(r),droppedAttributesCount:0}),this}addLink(e){return this.links.push(e),this}addLinks(e){return this.links.push(...e),this}setStatus(e){return this._isSpanEnded()?this:(this.status=Object.assign({},e),this.status.message!=null&&typeof e.message!="string"&&(Kn.diag.warn(`Dropping invalid status.message of type '${typeof e.message}', expected 'string'`),delete this.status.message),this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){Kn.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,Ft.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(Kn.diag.warn("Inconsistent start and end time, startTime > endTime. Setting span duration to 0ms.",this.startTime,this.endTime),this.endTime=this.startTime.slice(),this._duration=[0,0]),this._droppedEventsCount>0&&Kn.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<=Ft.otperformance.now())return(0,Ft.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,Ft.millisToHrTime)(e);if(e instanceof Date)return(0,Ft.millisToHrTime)(e.getTime());if((0,Ft.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,Ft.millisToHrTime)(Date.now());let n=Ft.otperformance.now()-this._performanceStartTime;return(0,Ft.addHrTimes)(this.startTime,(0,Ft.millisToHrTime)(n))}isRecording(){return this._ended===!1}recordException(e,n){let r={};typeof e=="string"?r[$i.SEMATTRS_EXCEPTION_MESSAGE]=e:e&&(e.code?r[$i.SEMATTRS_EXCEPTION_TYPE]=e.code.toString():e.name&&(r[$i.SEMATTRS_EXCEPTION_TYPE]=e.name),e.message&&(r[$i.SEMATTRS_EXCEPTION_MESSAGE]=e.message),e.stack&&(r[$i.SEMATTRS_EXCEPTION_STACKTRACE]=e.stack)),r[$i.SEMATTRS_EXCEPTION_TYPE]||r[$i.SEMATTRS_EXCEPTION_MESSAGE]?this.addEvent(KMe.ExceptionEventName,r,n):Kn.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&Kn.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,n){return e.length<=n?e:e.substring(0,n)}_truncateToSize(e){let n=this._attributeValueLengthLimit;return n<=0?(Kn.diag.warn(`Attribute value limit must be positive, got ${n}`),e):typeof e=="string"?this._truncateToLimitUtil(e,n):Array.isArray(e)?e.map(r=>typeof r=="string"?this._truncateToLimitUtil(r,n):r):e}};gm.Span=ZR});var Kl=m(Yl=>{"use strict";Object.defineProperty(Yl,"__esModule",{value:!0});Yl.SamplingDecision=void 0;var WMe;(function(t){t[t.NOT_RECORD=0]="NOT_RECORD",t[t.RECORD=1]="RECORD",t[t.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(WMe=Yl.SamplingDecision||(Yl.SamplingDecision={}))});var Am=m(hm=>{"use strict";Object.defineProperty(hm,"__esModule",{value:!0});hm.AlwaysOffSampler=void 0;var zMe=Kl(),ey=class{shouldSample(){return{decision:zMe.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};hm.AlwaysOffSampler=ey});var ym=m(Rm=>{"use strict";Object.defineProperty(Rm,"__esModule",{value:!0});Rm.AlwaysOnSampler=void 0;var XMe=Kl(),ty=class{shouldSample(){return{decision:XMe.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Rm.AlwaysOnSampler=ty});var oy=m(Nm=>{"use strict";Object.defineProperty(Nm,"__esModule",{value:!0});Nm.ParentBasedSampler=void 0;var Om=(L(),I(V)),JMe=fe(),KW=Am(),ny=ym(),ry=class{constructor(e){var n,r,o,s;this._root=e.root,this._root||((0,JMe.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new ny.AlwaysOnSampler),this._remoteParentSampled=(n=e.remoteParentSampled)!==null&&n!==void 0?n:new ny.AlwaysOnSampler,this._remoteParentNotSampled=(r=e.remoteParentNotSampled)!==null&&r!==void 0?r:new KW.AlwaysOffSampler,this._localParentSampled=(o=e.localParentSampled)!==null&&o!==void 0?o:new ny.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new KW.AlwaysOffSampler}shouldSample(e,n,r,o,s,i){let a=Om.trace.getSpanContext(e);return!a||!(0,Om.isSpanContextValid)(a)?this._root.shouldSample(e,n,r,o,s,i):a.isRemote?a.traceFlags&Om.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,n,r,o,s,i):this._remoteParentNotSampled.shouldSample(e,n,r,o,s,i):a.traceFlags&Om.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,n,r,o,s,i):this._localParentNotSampled.shouldSample(e,n,r,o,s,i)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};Nm.ParentBasedSampler=ry});var iy=m(Cm=>{"use strict";Object.defineProperty(Cm,"__esModule",{value:!0});Cm.TraceIdRatioBasedSampler=void 0;var ZMe=(L(),I(V)),WW=Kl(),sy=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,n){return{decision:(0,ZMe.isValidTraceId)(n)&&this._accumulate(n)<this._upperBound?WW.SamplingDecision.RECORD_AND_SAMPLED:WW.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let n=0;for(let r=0;r<e.length/8;r++){let o=r*8,s=parseInt(e.slice(o,o+8),16);n=(n^s)>>>0}return n}};Cm.TraceIdRatioBasedSampler=sy});var uy=m(Rc=>{"use strict";Object.defineProperty(Rc,"__esModule",{value:!0});Rc.buildSamplerFromEnv=Rc.loadDefaultConfig=void 0;var vm=(L(),I(V)),Oo=fe(),zW=Am(),ay=ym(),cy=oy(),XW=iy(),QMe=Oo.TracesSamplerValues.AlwaysOn,Ac=1;function eLe(){let t=(0,Oo.getEnv)();return{sampler:ZW(t),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:t.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:t.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:t.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:t.OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:t.OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:t.OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT},mergeResourceWithDefaults:!0}}Rc.loadDefaultConfig=eLe;function ZW(t=(0,Oo.getEnv)()){switch(t.OTEL_TRACES_SAMPLER){case Oo.TracesSamplerValues.AlwaysOn:return new ay.AlwaysOnSampler;case Oo.TracesSamplerValues.AlwaysOff:return new zW.AlwaysOffSampler;case Oo.TracesSamplerValues.ParentBasedAlwaysOn:return new cy.ParentBasedSampler({root:new ay.AlwaysOnSampler});case Oo.TracesSamplerValues.ParentBasedAlwaysOff:return new cy.ParentBasedSampler({root:new zW.AlwaysOffSampler});case Oo.TracesSamplerValues.TraceIdRatio:return new XW.TraceIdRatioBasedSampler(JW(t));case Oo.TracesSamplerValues.ParentBasedTraceIdRatio:return new cy.ParentBasedSampler({root:new XW.TraceIdRatioBasedSampler(JW(t))});default:return vm.diag.error(`OTEL_TRACES_SAMPLER value "${t.OTEL_TRACES_SAMPLER} invalid, defaulting to ${QMe}".`),new ay.AlwaysOnSampler}}Rc.buildSamplerFromEnv=ZW;function JW(t){if(t.OTEL_TRACES_SAMPLER_ARG===void 0||t.OTEL_TRACES_SAMPLER_ARG==="")return vm.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Ac}.`),Ac;let e=Number(t.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(vm.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Ac}.`),Ac):e<0||e>1?(vm.diag.error(`OTEL_TRACES_SAMPLER_ARG=${t.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Ac}.`),Ac):e}});var dy=m(yc=>{"use strict";Object.defineProperty(yc,"__esModule",{value:!0});yc.reconfigureLimits=yc.mergeConfig=void 0;var QW=uy(),ly=fe();function tLe(t){let e={sampler:(0,QW.buildSamplerFromEnv)()},n=(0,QW.loadDefaultConfig)(),r=Object.assign({},n,e,t);return r.generalLimits=Object.assign({},n.generalLimits,t.generalLimits||{}),r.spanLimits=Object.assign({},n.spanLimits,t.spanLimits||{}),r}yc.mergeConfig=tLe;function nLe(t){var e,n,r,o,s,i,a,c,u,l,d,p;let _=Object.assign({},t.spanLimits),f=(0,ly.getEnvWithoutDefaults)();return _.attributeCountLimit=(i=(s=(o=(n=(e=t.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&n!==void 0?n:(r=t.generalLimits)===null||r===void 0?void 0:r.attributeCountLimit)!==null&&o!==void 0?o:f.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:f.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&i!==void 0?i:ly.DEFAULT_ATTRIBUTE_COUNT_LIMIT,_.attributeValueLengthLimit=(p=(d=(l=(c=(a=t.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&c!==void 0?c:(u=t.generalLimits)===null||u===void 0?void 0:u.attributeValueLengthLimit)!==null&&l!==void 0?l:f.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&d!==void 0?d:f.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:ly.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},t,{spanLimits:_})}yc.reconfigureLimits=nLe});var e2=m(Im=>{"use strict";Object.defineProperty(Im,"__esModule",{value:!0});Im.BatchSpanProcessorBase=void 0;var Oc=(L(),I(V)),ji=fe(),py=class{constructor(e,n){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let r=(0,ji.getEnv)();this._maxExportBatchSize=typeof n?.maxExportBatchSize=="number"?n.maxExportBatchSize:r.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof n?.maxQueueSize=="number"?n.maxQueueSize:r.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof n?.scheduledDelayMillis=="number"?n.scheduledDelayMillis:r.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof n?.exportTimeoutMillis=="number"?n.exportTimeoutMillis:r.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new ji.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Oc.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,n){}onEnd(e){this._shutdownOnce.isCalled||(e.spanContext().traceFlags&Oc.TraceFlags.SAMPLED)!==0&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Oc.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Oc.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,n)=>{let r=[],o=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,i=o;s<i;s++)r.push(this._flushOneBatch());Promise.all(r).then(()=>{e()}).catch(n)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,n)=>{let r=setTimeout(()=>{n(new Error("Timeout"))},this._exportTimeoutMillis);Oc.context.with((0,ji.suppressTracing)(Oc.context.active()),()=>{let o;this._finishedSpans.length<=this._maxExportBatchSize?(o=this._finishedSpans,this._finishedSpans=[]):o=this._finishedSpans.splice(0,this._maxExportBatchSize);let s=()=>this._exporter.export(o,a=>{var c;clearTimeout(r),a.code===ji.ExportResultCode.SUCCESS?e():n((c=a.error)!==null&&c!==void 0?c:new Error("BatchSpanProcessor: span export failed"))}),i=null;for(let a=0,c=o.length;a<c;a++){let u=o[a];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(i??(i=[]),i.push(u.resource.waitForAsyncAttributes()))}i===null?s():Promise.all(i).then(s,a=>{(0,ji.globalErrorHandler)(a),n(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,ji.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,ji.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Im.BatchSpanProcessorBase=py});var t2=m(Pm=>{"use strict";Object.defineProperty(Pm,"__esModule",{value:!0});Pm.BatchSpanProcessor=void 0;var rLe=e2(),_y=class extends rLe.BatchSpanProcessorBase{onShutdown(){}};Pm.BatchSpanProcessor=_y});var o2=m(Mm=>{"use strict";Object.defineProperty(Mm,"__esModule",{value:!0});Mm.RandomIdGenerator=void 0;var oLe=8,r2=16,fy=class{constructor(){this.generateTraceId=n2(r2),this.generateSpanId=n2(oLe)}};Mm.RandomIdGenerator=fy;var bm=Buffer.allocUnsafe(r2);function n2(t){return function(){for(let n=0;n<t/4;n++)bm.writeUInt32BE(Math.random()*2**32>>>0,n*4);for(let n=0;n<t&&!(bm[n]>0);n++)n===t-1&&(bm[t-1]=1);return bm.toString("hex",0,t)}}});var s2=m(Nc=>{"use strict";Object.defineProperty(Nc,"__esModule",{value:!0});Nc.RandomIdGenerator=Nc.BatchSpanProcessor=void 0;var sLe=t2();Object.defineProperty(Nc,"BatchSpanProcessor",{enumerable:!0,get:function(){return sLe.BatchSpanProcessor}});var iLe=o2();Object.defineProperty(Nc,"RandomIdGenerator",{enumerable:!0,get:function(){return iLe.RandomIdGenerator}})});var Lm=m(Cc=>{"use strict";Object.defineProperty(Cc,"__esModule",{value:!0});Cc.RandomIdGenerator=Cc.BatchSpanProcessor=void 0;var i2=s2();Object.defineProperty(Cc,"BatchSpanProcessor",{enumerable:!0,get:function(){return i2.BatchSpanProcessor}});Object.defineProperty(Cc,"RandomIdGenerator",{enumerable:!0,get:function(){return i2.RandomIdGenerator}})});var Ey=m(Dm=>{"use strict";Object.defineProperty(Dm,"__esModule",{value:!0});Dm.Tracer=void 0;var Pt=(L(),I(V)),xm=fe(),aLe=QR(),cLe=dy(),uLe=Lm(),my=class{constructor(e,n,r){this._tracerProvider=r;let o=(0,cLe.mergeConfig)(n);this._sampler=o.sampler,this._generalLimits=o.generalLimits,this._spanLimits=o.spanLimits,this._idGenerator=n.idGenerator||new uLe.RandomIdGenerator,this.resource=r.resource,this.instrumentationLibrary=e}startSpan(e,n={},r=Pt.context.active()){var o,s,i;n.root&&(r=Pt.trace.deleteSpan(r));let a=Pt.trace.getSpan(r);if((0,xm.isTracingSuppressed)(r))return Pt.diag.debug("Instrumentation suppressed, returning Noop Span"),Pt.trace.wrapSpanContext(Pt.INVALID_SPAN_CONTEXT);let c=a?.spanContext(),u=this._idGenerator.generateSpanId(),l,d,p;!c||!Pt.trace.isSpanContextValid(c)?l=this._idGenerator.generateTraceId():(l=c.traceId,d=c.traceState,p=c.spanId);let _=(o=n.kind)!==null&&o!==void 0?o:Pt.SpanKind.INTERNAL,f=((s=n.links)!==null&&s!==void 0?s:[]).map(A=>({context:A.context,attributes:(0,xm.sanitizeAttributes)(A.attributes)})),E=(0,xm.sanitizeAttributes)(n.attributes),S=this._sampler.shouldSample(r,l,e,_,E,f);d=(i=S.traceState)!==null&&i!==void 0?i:d;let g=S.decision===Pt.SamplingDecision.RECORD_AND_SAMPLED?Pt.TraceFlags.SAMPLED:Pt.TraceFlags.NONE,h={traceId:l,spanId:u,traceFlags:g,traceState:d};if(S.decision===Pt.SamplingDecision.NOT_RECORD)return Pt.diag.debug("Recording is off, propagating context in a non-recording span"),Pt.trace.wrapSpanContext(h);let O=(0,xm.sanitizeAttributes)(Object.assign(E,S.attributes));return new aLe.Span(this,r,e,h,_,p,f,n.startTime,void 0,O)}startActiveSpan(e,n,r,o){let s,i,a;if(arguments.length<2)return;arguments.length===2?a=n:arguments.length===3?(s=n,a=r):(s=n,i=r,a=o);let c=i??Pt.context.active(),u=this.startSpan(e,s,c),l=Pt.trace.setSpan(c,u);return Pt.context.with(l,a,void 0,u)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};Dm.Tracer=my});var a2=m(Um=>{"use strict";Object.defineProperty(Um,"__esModule",{value:!0});Um.defaultServiceName=void 0;function lLe(){return`unknown_service:${process.argv0}`}Um.defaultServiceName=lLe});var c2=m(wm=>{"use strict";Object.defineProperty(wm,"__esModule",{value:!0});wm.defaultServiceName=void 0;var dLe=a2();Object.defineProperty(wm,"defaultServiceName",{enumerable:!0,get:function(){return dLe.defaultServiceName}})});var Sy=m(km=>{"use strict";Object.defineProperty(km,"__esModule",{value:!0});km.defaultServiceName=void 0;var pLe=c2();Object.defineProperty(km,"defaultServiceName",{enumerable:!0,get:function(){return pLe.defaultServiceName}})});var No=m(Vm=>{"use strict";Object.defineProperty(Vm,"__esModule",{value:!0});Vm.Resource=void 0;var u2=(L(),I(V)),qi=(Bn(),I(Vn)),Ty=fe(),_Le=Sy(),Wl=class t{constructor(e,n){var r;this._attributes=e,this.asyncAttributesPending=n!=null,this._syncAttributes=(r=this._attributes)!==null&&r!==void 0?r:{},this._asyncAttributesPromise=n?.then(o=>(this._attributes=Object.assign({},this._attributes,o),this.asyncAttributesPending=!1,o),o=>(u2.diag.debug("a resource's async attributes promise rejected: %s",o),this.asyncAttributesPending=!1,{}))}static empty(){return t.EMPTY}static default(){return new t({[qi.SEMRESATTRS_SERVICE_NAME]:(0,_Le.defaultServiceName)(),[qi.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE]:Ty.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_LANGUAGE],[qi.SEMRESATTRS_TELEMETRY_SDK_NAME]:Ty.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_NAME],[qi.SEMRESATTRS_TELEMETRY_SDK_VERSION]:Ty.SDK_INFO[qi.SEMRESATTRS_TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&u2.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var n;if(!e)return this;let r=Object.assign(Object.assign({},this._syncAttributes),(n=e._syncAttributes)!==null&&n!==void 0?n:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new t(r);let o=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,i])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),i)});return new t(r,o)}};Vm.Resource=Wl;Wl.EMPTY=new Wl({})});var gy=m(vc=>{"use strict";Object.defineProperty(vc,"__esModule",{value:!0});vc.normalizeType=vc.normalizeArch=void 0;var fLe=t=>{switch(t){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return t}};vc.normalizeArch=fLe;var mLe=t=>{switch(t){case"sunos":return"solaris";case"win32":return"windows";default:return t}};vc.normalizeType=mLe});var Gm=m(Bm=>{"use strict";Object.defineProperty(Bm,"__esModule",{value:!0});Bm.execAsync=void 0;var ELe=require("child_process"),SLe=require("util");Bm.execAsync=SLe.promisify(ELe.exec)});var l2=m(Hm=>{"use strict";Object.defineProperty(Hm,"__esModule",{value:!0});Hm.getMachineId=void 0;var TLe=Gm(),gLe=(L(),I(V));async function hLe(){try{let e=(await(0,TLe.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
6
+ `).find(r=>r.includes("IOPlatformUUID"));if(!e)return"";let n=e.split('" = "');if(n.length===2)return n[1].slice(0,-1)}catch(t){gLe.diag.debug(`error reading machine id: ${t}`)}return""}Hm.getMachineId=hLe});var d2=m(Fm=>{"use strict";Object.defineProperty(Fm,"__esModule",{value:!0});Fm.getMachineId=void 0;var ALe=require("fs"),RLe=(L(),I(V));async function yLe(){let t=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of t)try{return(await ALe.promises.readFile(e,{encoding:"utf8"})).trim()}catch(n){RLe.diag.debug(`error reading machine id: ${n}`)}return""}Fm.getMachineId=yLe});var _2=m($m=>{"use strict";Object.defineProperty($m,"__esModule",{value:!0});$m.getMachineId=void 0;var OLe=require("fs"),NLe=Gm(),p2=(L(),I(V));async function CLe(){try{return(await OLe.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(t){p2.diag.debug(`error reading machine id: ${t}`)}try{return(await(0,NLe.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(t){p2.diag.debug(`error reading machine id: ${t}`)}return""}$m.getMachineId=CLe});var m2=m(jm=>{"use strict";Object.defineProperty(jm,"__esModule",{value:!0});jm.getMachineId=void 0;var f2=require("process"),vLe=Gm(),ILe=(L(),I(V));async function PLe(){let t="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";f2.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in f2.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let r=(await(0,vLe.execAsync)(`${e} ${t}`)).stdout.split("REG_SZ");if(r.length===2)return r[1].trim()}catch(n){ILe.diag.debug(`error reading machine id: ${n}`)}return""}jm.getMachineId=PLe});var E2=m(qm=>{"use strict";Object.defineProperty(qm,"__esModule",{value:!0});qm.getMachineId=void 0;var bLe=(L(),I(V));async function MLe(){return bLe.diag.debug("could not read machine-id: unsupported platform"),""}qm.getMachineId=MLe});var S2=m(Co=>{"use strict";Object.defineProperty(Co,"__esModule",{value:!0});Co.getMachineId=void 0;var LLe=require("process"),Ic;Co.getMachineId=Ic;switch(LLe.platform){case"darwin":Co.getMachineId=Ic=l2().getMachineId;break;case"linux":Co.getMachineId=Ic=d2().getMachineId;break;case"freebsd":Co.getMachineId=Ic=_2().getMachineId;break;case"win32":Co.getMachineId=Ic=m2().getMachineId;break;default:Co.getMachineId=Ic=E2().getMachineId}});var Ry=m(Ym=>{"use strict";Object.defineProperty(Ym,"__esModule",{value:!0});Ym.hostDetectorSync=void 0;var hy=(Bn(),I(Vn)),xLe=No(),T2=require("os"),DLe=gy(),ULe=S2(),Ay=class{detect(e){let n={[hy.SEMRESATTRS_HOST_NAME]:(0,T2.hostname)(),[hy.SEMRESATTRS_HOST_ARCH]:(0,DLe.normalizeArch)((0,T2.arch)())};return new xLe.Resource(n,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,ULe.getMachineId)().then(e=>{let n={};return e&&(n[hy.SEMRESATTRS_HOST_ID]=e),n})}};Ym.hostDetectorSync=new Ay});var g2=m(Km=>{"use strict";Object.defineProperty(Km,"__esModule",{value:!0});Km.hostDetector=void 0;var wLe=Ry(),yy=class{detect(e){return Promise.resolve(wLe.hostDetectorSync.detect(e))}};Km.hostDetector=new yy});var Ny=m(Wm=>{"use strict";Object.defineProperty(Wm,"__esModule",{value:!0});Wm.osDetectorSync=void 0;var h2=(Bn(),I(Vn)),kLe=No(),A2=require("os"),VLe=gy(),Oy=class{detect(e){let n={[h2.SEMRESATTRS_OS_TYPE]:(0,VLe.normalizeType)((0,A2.platform)()),[h2.SEMRESATTRS_OS_VERSION]:(0,A2.release)()};return new kLe.Resource(n)}};Wm.osDetectorSync=new Oy});var R2=m(zm=>{"use strict";Object.defineProperty(zm,"__esModule",{value:!0});zm.osDetector=void 0;var BLe=Ny(),Cy=class{detect(e){return Promise.resolve(BLe.osDetectorSync.detect(e))}};zm.osDetector=new Cy});var Iy=m(Xm=>{"use strict";Object.defineProperty(Xm,"__esModule",{value:!0});Xm.processDetectorSync=void 0;var GLe=(L(),I(V)),vo=(Bn(),I(Vn)),HLe=No(),FLe=require("os"),vy=class{detect(e){let n={[vo.SEMRESATTRS_PROCESS_PID]:process.pid,[vo.SEMRESATTRS_PROCESS_EXECUTABLE_NAME]:process.title,[vo.SEMRESATTRS_PROCESS_EXECUTABLE_PATH]:process.execPath,[vo.SEMRESATTRS_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[vo.SEMRESATTRS_PROCESS_RUNTIME_VERSION]:process.versions.node,[vo.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"nodejs",[vo.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(n[vo.SEMRESATTRS_PROCESS_COMMAND]=process.argv[1]);try{let r=FLe.userInfo();n[vo.SEMRESATTRS_PROCESS_OWNER]=r.username}catch(r){GLe.diag.debug(`error obtaining process owner: ${r}`)}return new HLe.Resource(n)}};Xm.processDetectorSync=new vy});var y2=m(Jm=>{"use strict";Object.defineProperty(Jm,"__esModule",{value:!0});Jm.processDetector=void 0;var $Le=Iy(),Py=class{detect(e){return Promise.resolve($Le.processDetectorSync.detect(e))}};Jm.processDetector=new Py});var O2=m(Zm=>{"use strict";Object.defineProperty(Zm,"__esModule",{value:!0});Zm.serviceInstanceIdDetectorSync=void 0;var jLe=(Bn(),I(Vn)),qLe=No(),YLe=require("crypto"),by=class{detect(e){let n={[jLe.SEMRESATTRS_SERVICE_INSTANCE_ID]:(0,YLe.randomUUID)()};return new qLe.Resource(n)}};Zm.serviceInstanceIdDetectorSync=new by});var N2=m($t=>{"use strict";Object.defineProperty($t,"__esModule",{value:!0});$t.serviceInstanceIdDetectorSync=$t.processDetectorSync=$t.processDetector=$t.osDetectorSync=$t.osDetector=$t.hostDetectorSync=$t.hostDetector=void 0;var KLe=g2();Object.defineProperty($t,"hostDetector",{enumerable:!0,get:function(){return KLe.hostDetector}});var WLe=Ry();Object.defineProperty($t,"hostDetectorSync",{enumerable:!0,get:function(){return WLe.hostDetectorSync}});var zLe=R2();Object.defineProperty($t,"osDetector",{enumerable:!0,get:function(){return zLe.osDetector}});var XLe=Ny();Object.defineProperty($t,"osDetectorSync",{enumerable:!0,get:function(){return XLe.osDetectorSync}});var JLe=y2();Object.defineProperty($t,"processDetector",{enumerable:!0,get:function(){return JLe.processDetector}});var ZLe=Iy();Object.defineProperty($t,"processDetectorSync",{enumerable:!0,get:function(){return ZLe.processDetectorSync}});var QLe=O2();Object.defineProperty($t,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return QLe.serviceInstanceIdDetectorSync}})});var C2=m(jt=>{"use strict";Object.defineProperty(jt,"__esModule",{value:!0});jt.serviceInstanceIdDetectorSync=jt.processDetectorSync=jt.processDetector=jt.osDetectorSync=jt.osDetector=jt.hostDetectorSync=jt.hostDetector=void 0;var Yi=N2();Object.defineProperty(jt,"hostDetector",{enumerable:!0,get:function(){return Yi.hostDetector}});Object.defineProperty(jt,"hostDetectorSync",{enumerable:!0,get:function(){return Yi.hostDetectorSync}});Object.defineProperty(jt,"osDetector",{enumerable:!0,get:function(){return Yi.osDetector}});Object.defineProperty(jt,"osDetectorSync",{enumerable:!0,get:function(){return Yi.osDetectorSync}});Object.defineProperty(jt,"processDetector",{enumerable:!0,get:function(){return Yi.processDetector}});Object.defineProperty(jt,"processDetectorSync",{enumerable:!0,get:function(){return Yi.processDetectorSync}});Object.defineProperty(jt,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return Yi.serviceInstanceIdDetectorSync}})});var xy=m(eE=>{"use strict";Object.defineProperty(eE,"__esModule",{value:!0});eE.browserDetectorSync=void 0;var Qm=(Bn(),I(Vn)),exe=(L(),I(V)),My=No(),Ly=class{detect(e){var n,r,o;if(!(typeof navigator<"u"&&((r=(n=global.process)===null||n===void 0?void 0:n.versions)===null||r===void 0?void 0:r.node)===void 0&&((o=global.Bun)===null||o===void 0?void 0:o.version)===void 0))return My.Resource.empty();let i={[Qm.SEMRESATTRS_PROCESS_RUNTIME_NAME]:"browser",[Qm.SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[Qm.SEMRESATTRS_PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(i,e)}_getResourceAttributes(e,n){return e[Qm.SEMRESATTRS_PROCESS_RUNTIME_VERSION]===""?(exe.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),My.Resource.empty()):new My.Resource(Object.assign({},e))}};eE.browserDetectorSync=new Ly});var v2=m(tE=>{"use strict";Object.defineProperty(tE,"__esModule",{value:!0});tE.browserDetector=void 0;var txe=xy(),Dy=class{detect(e){return Promise.resolve(txe.browserDetectorSync.detect(e))}};tE.browserDetector=new Dy});var wy=m(nE=>{"use strict";Object.defineProperty(nE,"__esModule",{value:!0});nE.envDetectorSync=void 0;var nxe=(L(),I(V)),rxe=fe(),oxe=(Bn(),I(Vn)),sxe=No(),Uy=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let n={},r=(0,rxe.getEnv)(),o=r.OTEL_RESOURCE_ATTRIBUTES,s=r.OTEL_SERVICE_NAME;if(o)try{let i=this._parseResourceAttributes(o);Object.assign(n,i)}catch(i){nxe.diag.debug(`EnvDetector failed: ${i.message}`)}return s&&(n[oxe.SEMRESATTRS_SERVICE_NAME]=s),new sxe.Resource(n)}_parseResourceAttributes(e){if(!e)return{};let n={},r=e.split(this._COMMA_SEPARATOR,-1);for(let o of r){let s=o.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[i,a]=s;if(i=i.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(i))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);n[i]=decodeURIComponent(a)}return n}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let n=0;n<e.length;n++){let r=e.charCodeAt(n);if(r<33||r===44||r===59||r===92||r>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};nE.envDetectorSync=new Uy});var I2=m(rE=>{"use strict";Object.defineProperty(rE,"__esModule",{value:!0});rE.envDetector=void 0;var ixe=wy(),ky=class{detect(e){return Promise.resolve(ixe.envDetectorSync.detect(e))}};rE.envDetector=new ky});var P2=m(xe=>{"use strict";Object.defineProperty(xe,"__esModule",{value:!0});xe.envDetectorSync=xe.browserDetectorSync=xe.envDetector=xe.browserDetector=xe.serviceInstanceIdDetectorSync=xe.processDetectorSync=xe.processDetector=xe.osDetectorSync=xe.osDetector=xe.hostDetectorSync=xe.hostDetector=void 0;var Ki=C2();Object.defineProperty(xe,"hostDetector",{enumerable:!0,get:function(){return Ki.hostDetector}});Object.defineProperty(xe,"hostDetectorSync",{enumerable:!0,get:function(){return Ki.hostDetectorSync}});Object.defineProperty(xe,"osDetector",{enumerable:!0,get:function(){return Ki.osDetector}});Object.defineProperty(xe,"osDetectorSync",{enumerable:!0,get:function(){return Ki.osDetectorSync}});Object.defineProperty(xe,"processDetector",{enumerable:!0,get:function(){return Ki.processDetector}});Object.defineProperty(xe,"processDetectorSync",{enumerable:!0,get:function(){return Ki.processDetectorSync}});Object.defineProperty(xe,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return Ki.serviceInstanceIdDetectorSync}});var axe=v2();Object.defineProperty(xe,"browserDetector",{enumerable:!0,get:function(){return axe.browserDetector}});var cxe=I2();Object.defineProperty(xe,"envDetector",{enumerable:!0,get:function(){return cxe.envDetector}});var uxe=xy();Object.defineProperty(xe,"browserDetectorSync",{enumerable:!0,get:function(){return uxe.browserDetectorSync}});var lxe=wy();Object.defineProperty(xe,"envDetectorSync",{enumerable:!0,get:function(){return lxe.envDetectorSync}})});var b2=m(oE=>{"use strict";Object.defineProperty(oE,"__esModule",{value:!0});oE.isPromiseLike=void 0;var dxe=t=>t!==null&&typeof t=="object"&&typeof t.then=="function";oE.isPromiseLike=dxe});var L2=m(bc=>{"use strict";Object.defineProperty(bc,"__esModule",{value:!0});bc.detectResourcesSync=bc.detectResources=void 0;var zl=No(),Pc=(L(),I(V)),pxe=b2(),_xe=async(t={})=>{let e=await Promise.all((t.detectors||[]).map(async n=>{try{let r=await n.detect(t);return Pc.diag.debug(`${n.constructor.name} found resource.`,r),r}catch(r){return Pc.diag.debug(`${n.constructor.name} failed: ${r.message}`),zl.Resource.empty()}}));return M2(e),e.reduce((n,r)=>n.merge(r),zl.Resource.empty())};bc.detectResources=_xe;var fxe=(t={})=>{var e;let n=((e=t.detectors)!==null&&e!==void 0?e:[]).map(o=>{try{let s=o.detect(t),i;if((0,pxe.isPromiseLike)(s)){let a=async()=>{var c;let u=await s;return await((c=u.waitForAsyncAttributes)===null||c===void 0?void 0:c.call(u)),u.attributes};i=new zl.Resource({},a())}else i=s;return i.waitForAsyncAttributes?i.waitForAsyncAttributes().then(()=>Pc.diag.debug(`${o.constructor.name} found resource.`,i)):Pc.diag.debug(`${o.constructor.name} found resource.`,i),i}catch(s){return Pc.diag.error(`${o.constructor.name} failed: ${s.message}`),zl.Resource.empty()}}),r=n.reduce((o,s)=>o.merge(s),zl.Resource.empty());return r.waitForAsyncAttributes&&r.waitForAsyncAttributes().then(()=>{M2(n)}),r};bc.detectResourcesSync=fxe;var M2=t=>{t.forEach(e=>{if(Object.keys(e.attributes).length>0){let n=JSON.stringify(e.attributes,null,4);Pc.diag.verbose(n)}})}});var Vy=m(me=>{"use strict";Object.defineProperty(me,"__esModule",{value:!0});me.detectResources=me.detectResourcesSync=me.serviceInstanceIdDetectorSync=me.processDetectorSync=me.processDetector=me.osDetectorSync=me.osDetector=me.hostDetectorSync=me.hostDetector=me.envDetectorSync=me.envDetector=me.browserDetectorSync=me.browserDetector=me.defaultServiceName=me.Resource=void 0;var mxe=No();Object.defineProperty(me,"Resource",{enumerable:!0,get:function(){return mxe.Resource}});var Exe=Sy();Object.defineProperty(me,"defaultServiceName",{enumerable:!0,get:function(){return Exe.defaultServiceName}});var gr=P2();Object.defineProperty(me,"browserDetector",{enumerable:!0,get:function(){return gr.browserDetector}});Object.defineProperty(me,"browserDetectorSync",{enumerable:!0,get:function(){return gr.browserDetectorSync}});Object.defineProperty(me,"envDetector",{enumerable:!0,get:function(){return gr.envDetector}});Object.defineProperty(me,"envDetectorSync",{enumerable:!0,get:function(){return gr.envDetectorSync}});Object.defineProperty(me,"hostDetector",{enumerable:!0,get:function(){return gr.hostDetector}});Object.defineProperty(me,"hostDetectorSync",{enumerable:!0,get:function(){return gr.hostDetectorSync}});Object.defineProperty(me,"osDetector",{enumerable:!0,get:function(){return gr.osDetector}});Object.defineProperty(me,"osDetectorSync",{enumerable:!0,get:function(){return gr.osDetectorSync}});Object.defineProperty(me,"processDetector",{enumerable:!0,get:function(){return gr.processDetector}});Object.defineProperty(me,"processDetectorSync",{enumerable:!0,get:function(){return gr.processDetectorSync}});Object.defineProperty(me,"serviceInstanceIdDetectorSync",{enumerable:!0,get:function(){return gr.serviceInstanceIdDetectorSync}});var x2=L2();Object.defineProperty(me,"detectResourcesSync",{enumerable:!0,get:function(){return x2.detectResourcesSync}});Object.defineProperty(me,"detectResources",{enumerable:!0,get:function(){return x2.detectResources}})});var D2=m(sE=>{"use strict";Object.defineProperty(sE,"__esModule",{value:!0});sE.MultiSpanProcessor=void 0;var Sxe=fe(),By=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let n of this._spanProcessors)e.push(n.forceFlush());return new Promise(n=>{Promise.all(e).then(()=>{n()}).catch(r=>{(0,Sxe.globalErrorHandler)(r||new Error("MultiSpanProcessor: forceFlush failed")),n()})})}onStart(e,n){for(let r of this._spanProcessors)r.onStart(e,n)}onEnd(e){for(let n of this._spanProcessors)n.onEnd(e)}shutdown(){let e=[];for(let n of this._spanProcessors)e.push(n.shutdown());return new Promise((n,r)=>{Promise.all(e).then(()=>{n()},r)})}};sE.MultiSpanProcessor=By});var Hy=m(iE=>{"use strict";Object.defineProperty(iE,"__esModule",{value:!0});iE.NoopSpanProcessor=void 0;var Gy=class{onStart(e,n){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};iE.NoopSpanProcessor=Gy});var k2=m(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.BasicTracerProvider=Wi.ForceFlushState=void 0;var Mc=(L(),I(V)),xc=fe(),U2=Vy(),Txe=Ey(),gxe=uy(),w2=D2(),hxe=Hy(),Axe=Lm(),Rxe=dy(),Lc;(function(t){t[t.resolved=0]="resolved",t[t.timeout=1]="timeout",t[t.error=2]="error",t[t.unresolved=3]="unresolved"})(Lc=Wi.ForceFlushState||(Wi.ForceFlushState={}));var Xl=class{constructor(e={}){var n,r;this._registeredSpanProcessors=[],this._tracers=new Map;let o=(0,xc.merge)({},(0,gxe.loadDefaultConfig)(),(0,Rxe.reconfigureLimits)(e));if(this.resource=(n=o.resource)!==null&&n!==void 0?n:U2.Resource.empty(),o.mergeResourceWithDefaults&&(this.resource=U2.Resource.default().merge(this.resource)),this._config=Object.assign({},o,{resource:this.resource}),!((r=e.spanProcessors)===null||r===void 0)&&r.length)this._registeredSpanProcessors=[...e.spanProcessors],this.activeSpanProcessor=new w2.MultiSpanProcessor(this._registeredSpanProcessors);else{let s=this._buildExporterFromEnv();if(s!==void 0){let i=new Axe.BatchSpanProcessor(s);this.activeSpanProcessor=i}else this.activeSpanProcessor=new hxe.NoopSpanProcessor}}getTracer(e,n,r){let o=`${e}@${n||""}:${r?.schemaUrl||""}`;return this._tracers.has(o)||this._tracers.set(o,new Txe.Tracer({name:e,version:n,schemaUrl:r?.schemaUrl},this._config,this)),this._tracers.get(o)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(n=>Mc.diag.error("Error while trying to shutdown current span processor",n)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new w2.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){Mc.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&Mc.context.setGlobalContextManager(e.contextManager),e.propagator&&Mc.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,n=this._registeredSpanProcessors.map(r=>new Promise(o=>{let s,i=setTimeout(()=>{o(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=Lc.timeout},e);r.forceFlush().then(()=>{clearTimeout(i),s!==Lc.timeout&&(s=Lc.resolved,o(s))}).catch(a=>{clearTimeout(i),s=Lc.error,o(a)})}));return new Promise((r,o)=>{Promise.all(n).then(s=>{let i=s.filter(a=>a!==Lc.resolved);i.length>0?o(i):r()}).catch(s=>o([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var n;return(n=this.constructor._registeredPropagators.get(e))===null||n===void 0?void 0:n()}_getSpanExporter(e){var n;return(n=this.constructor._registeredExporters.get(e))===null||n===void 0?void 0:n()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,xc.getEnv)().OTEL_PROPAGATORS)),r=e.map(o=>{let s=this._getPropagator(o);return s||Mc.diag.warn(`Propagator "${o}" requested through environment variable is unavailable.`),s}).reduce((o,s)=>(s&&o.push(s),o),[]);if(r.length!==0)return e.length===1?r[0]:new xc.CompositePropagator({propagators:r})}_buildExporterFromEnv(){let e=(0,xc.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let n=this._getSpanExporter(e);return n||Mc.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),n}};Wi.BasicTracerProvider=Xl;Xl._registeredPropagators=new Map([["tracecontext",()=>new xc.W3CTraceContextPropagator],["baggage",()=>new xc.W3CBaggagePropagator]]);Xl._registeredExporters=new Map});var V2=m(aE=>{"use strict";Object.defineProperty(aE,"__esModule",{value:!0});aE.ConsoleSpanExporter=void 0;var Fy=fe(),$y=class{export(e,n){return this._sendSpans(e,n)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var n;return{resource:{attributes:e.resource.attributes},instrumentationScope:e.instrumentationLibrary,traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(n=e.spanContext().traceState)===null||n===void 0?void 0:n.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,Fy.hrTimeToMicroseconds)(e.startTime),duration:(0,Fy.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,n){for(let r of e)console.dir(this._exportInfo(r),{depth:3});if(n)return n({code:Fy.ExportResultCode.SUCCESS})}};aE.ConsoleSpanExporter=$y});var G2=m(cE=>{"use strict";Object.defineProperty(cE,"__esModule",{value:!0});cE.InMemorySpanExporter=void 0;var B2=fe(),jy=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,n){if(this._stopped)return n({code:B2.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>n({code:B2.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};cE.InMemorySpanExporter=jy});var H2=m(uE=>{"use strict";Object.defineProperty(uE,"__esModule",{value:!0});uE.SimpleSpanProcessor=void 0;var yxe=(L(),I(V)),Dc=fe(),qy=class{constructor(e){this._exporter=e,this._shutdownOnce=new Dc.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,n){}onEnd(e){var n,r;if(this._shutdownOnce.isCalled||(e.spanContext().traceFlags&yxe.TraceFlags.SAMPLED)===0)return;let o=()=>Dc.internal._export(this._exporter,[e]).then(s=>{var i;s.code!==Dc.ExportResultCode.SUCCESS&&(0,Dc.globalErrorHandler)((i=s.error)!==null&&i!==void 0?i:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Dc.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(r=(n=e.resource).waitForAsyncAttributes)===null||r===void 0?void 0:r.call(n).then(()=>(s!=null&&this._unresolvedExports.delete(s),o()),i=>(0,Dc.globalErrorHandler)(i));s!=null&&this._unresolvedExports.add(s)}else o()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};uE.SimpleSpanProcessor=qy});var Yy=m(Ee=>{"use strict";Object.defineProperty(Ee,"__esModule",{value:!0});Ee.Span=Ee.SamplingDecision=Ee.TraceIdRatioBasedSampler=Ee.ParentBasedSampler=Ee.AlwaysOnSampler=Ee.AlwaysOffSampler=Ee.NoopSpanProcessor=Ee.SimpleSpanProcessor=Ee.InMemorySpanExporter=Ee.ConsoleSpanExporter=Ee.RandomIdGenerator=Ee.BatchSpanProcessor=Ee.ForceFlushState=Ee.BasicTracerProvider=Ee.Tracer=void 0;var Oxe=Ey();Object.defineProperty(Ee,"Tracer",{enumerable:!0,get:function(){return Oxe.Tracer}});var F2=k2();Object.defineProperty(Ee,"BasicTracerProvider",{enumerable:!0,get:function(){return F2.BasicTracerProvider}});Object.defineProperty(Ee,"ForceFlushState",{enumerable:!0,get:function(){return F2.ForceFlushState}});var $2=Lm();Object.defineProperty(Ee,"BatchSpanProcessor",{enumerable:!0,get:function(){return $2.BatchSpanProcessor}});Object.defineProperty(Ee,"RandomIdGenerator",{enumerable:!0,get:function(){return $2.RandomIdGenerator}});var Nxe=V2();Object.defineProperty(Ee,"ConsoleSpanExporter",{enumerable:!0,get:function(){return Nxe.ConsoleSpanExporter}});var Cxe=G2();Object.defineProperty(Ee,"InMemorySpanExporter",{enumerable:!0,get:function(){return Cxe.InMemorySpanExporter}});var vxe=H2();Object.defineProperty(Ee,"SimpleSpanProcessor",{enumerable:!0,get:function(){return vxe.SimpleSpanProcessor}});var Ixe=Hy();Object.defineProperty(Ee,"NoopSpanProcessor",{enumerable:!0,get:function(){return Ixe.NoopSpanProcessor}});var Pxe=Am();Object.defineProperty(Ee,"AlwaysOffSampler",{enumerable:!0,get:function(){return Pxe.AlwaysOffSampler}});var bxe=ym();Object.defineProperty(Ee,"AlwaysOnSampler",{enumerable:!0,get:function(){return bxe.AlwaysOnSampler}});var Mxe=oy();Object.defineProperty(Ee,"ParentBasedSampler",{enumerable:!0,get:function(){return Mxe.ParentBasedSampler}});var Lxe=iy();Object.defineProperty(Ee,"TraceIdRatioBasedSampler",{enumerable:!0,get:function(){return Lxe.TraceIdRatioBasedSampler}});var xxe=Kl();Object.defineProperty(Ee,"SamplingDecision",{enumerable:!0,get:function(){return xxe.SamplingDecision}});var Dxe=QR();Object.defineProperty(Ee,"Span",{enumerable:!0,get:function(){return Dxe.Span}})});var hO=m(gE=>{"use strict";Object.defineProperty(gE,"__esModule",{value:!0});gE.AbstractAsyncHooksContextManager=void 0;var bDe=require("events"),MDe=["addListener","on","once","prependListener","prependOnceListener"],gO=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,n){return n instanceof bDe.EventEmitter?this._bindEventEmitter(e,n):typeof n=="function"?this._bindFunction(e,n):n}_bindFunction(e,n){let r=this,o=function(...s){return r.with(e,()=>n.apply(this,s))};return Object.defineProperty(o,"length",{enumerable:!1,configurable:!0,writable:!1,value:n.length}),o}_bindEventEmitter(e,n){return this._getPatchMap(n)!==void 0||(this._createPatchMap(n),MDe.forEach(o=>{n[o]!==void 0&&(n[o]=this._patchAddListener(n,n[o],e))}),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(e,n){let r=this;return function(o,s){var i;let a=(i=r._getPatchMap(e))===null||i===void 0?void 0:i[o];if(a===void 0)return n.call(this,o,s);let c=a.get(s);return n.call(this,o,c||s)}}_patchRemoveAllListeners(e,n){let r=this;return function(o){let s=r._getPatchMap(e);return s!==void 0&&(arguments.length===0?r._createPatchMap(e):s[o]!==void 0&&delete s[o]),n.apply(this,arguments)}}_patchAddListener(e,n,r){let o=this;return function(s,i){if(o._wrapped)return n.call(this,s,i);let a=o._getPatchMap(e);a===void 0&&(a=o._createPatchMap(e));let c=a[s];c===void 0&&(c=new WeakMap,a[s]=c);let u=o.bind(r,i);c.set(i,u),o._wrapped=!0;try{return n.call(this,s,u)}finally{o._wrapped=!1}}}_createPatchMap(e){let n=Object.create(null);return e[this._kOtListeners]=n,n}_getPatchMap(e){return e[this._kOtListeners]}};gE.AbstractAsyncHooksContextManager=gO});var r5=m(hE=>{"use strict";Object.defineProperty(hE,"__esModule",{value:!0});hE.AsyncHooksContextManager=void 0;var LDe=(L(),I(V)),xDe=require("async_hooks"),DDe=hO(),AO=class extends DDe.AbstractAsyncHooksContextManager{constructor(){super(),this._contexts=new Map,this._stack=[],this._asyncHook=xDe.createHook({init:this._init.bind(this),before:this._before.bind(this),after:this._after.bind(this),destroy:this._destroy.bind(this),promiseResolve:this._destroy.bind(this)})}active(){var e;return(e=this._stack[this._stack.length-1])!==null&&e!==void 0?e:LDe.ROOT_CONTEXT}with(e,n,r,...o){this._enterContext(e);try{return n.call(r,...o)}finally{this._exitContext()}}enable(){return this._asyncHook.enable(),this}disable(){return this._asyncHook.disable(),this._contexts.clear(),this._stack=[],this}_init(e,n){if(n==="TIMERWRAP")return;let r=this._stack[this._stack.length-1];r!==void 0&&this._contexts.set(e,r)}_destroy(e){this._contexts.delete(e)}_before(e){let n=this._contexts.get(e);n!==void 0&&this._enterContext(n)}_after(){this._exitContext()}_enterContext(e){this._stack.push(e)}_exitContext(){this._stack.pop()}};hE.AsyncHooksContextManager=AO});var o5=m(AE=>{"use strict";Object.defineProperty(AE,"__esModule",{value:!0});AE.AsyncLocalStorageContextManager=void 0;var UDe=(L(),I(V)),wDe=require("async_hooks"),kDe=hO(),RO=class extends kDe.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new wDe.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:UDe.ROOT_CONTEXT}with(e,n,r,...o){let s=r==null?n:n.bind(r);return this._asyncLocalStorage.run(e,s,...o)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};AE.AsyncLocalStorageContextManager=RO});var s5=m(Fc=>{"use strict";Object.defineProperty(Fc,"__esModule",{value:!0});Fc.AsyncLocalStorageContextManager=Fc.AsyncHooksContextManager=void 0;var VDe=r5();Object.defineProperty(Fc,"AsyncHooksContextManager",{enumerable:!0,get:function(){return VDe.AsyncHooksContextManager}});var BDe=o5();Object.defineProperty(Fc,"AsyncLocalStorageContextManager",{enumerable:!0,get:function(){return BDe.AsyncLocalStorageContextManager}})});var N5=m($c=>{"use strict";Object.defineProperty($c,"__esModule",{value:!0});$c.PACKAGE_NAME=$c.PACKAGE_VERSION=void 0;$c.PACKAGE_VERSION="0.10.1";$c.PACKAGE_NAME="@opentelemetry/instrumentation-undici"});var C5=m(PE=>{"use strict";Object.defineProperty(PE,"__esModule",{value:!0});PE.SemanticAttributes=void 0;PE.SemanticAttributes={HTTP_CONNECTION_STATE:"http.connection.state",ERROR_TYPE:"error.type",HTTP_REQUEST_BODY_SIZE:"http.request.body.size",HTTP_REQUEST_METHOD:"http.request.method",HTTP_REQUEST_METHOD_ORIGINAL:"http.request.method_original",HTTP_REQUEST_RESEND_COUNT:"http.request.resend_count",HTTP_RESPONSE_BODY_SIZE:"http.response.body.size",HTTP_RESPONSE_STATUS_CODE:"http.response.status_code",HTTP_ROUTE:"http.route",NETWORK_PEER_ADDRESS:"network.peer.address",NETWORK_PEER_PORT:"network.peer.port",NETWORK_PROTOCOL_NAME:"network.protocol.name",NETWORK_PROTOCOL_VERSION:"network.protocol.version",SERVER_ADDRESS:"server.address",SERVER_PORT:"server.port",URL_FULL:"url.full",URL_PATH:"url.path",URL_QUERY:"url.query",URL_SCHEME:"url.scheme",USER_AGENT_ORIGINAL:"user_agent.original"}});var I5=m(ME=>{"use strict";Object.defineProperty(ME,"__esModule",{value:!0});ME.UndiciInstrumentation=void 0;var ud=require("diagnostics_channel"),uUe=require("url"),ld=de(),bn=(L(),I(V)),v5=N5(),_t=C5(),bE=fe(),bO=class extends ld.InstrumentationBase{constructor(e={}){super(v5.PACKAGE_NAME,v5.PACKAGE_VERSION,e),this._recordFromReq=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs.length=0}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this.subscribeToChannel("undici:request:create",this.onRequestCreated.bind(this)),this.subscribeToChannel("undici:client:sendHeaders",this.onRequestHeaders.bind(this)),this.subscribeToChannel("undici:request:headers",this.onResponseHeaders.bind(this)),this.subscribeToChannel("undici:request:trailers",this.onDone.bind(this)),this.subscribeToChannel("undici:request:error",this.onError.bind(this)))}_updateMetricInstruments(){this._httpClientDurationHistogram=this.meter.createHistogram("http.client.request.duration",{description:"Measures the duration of outbound HTTP requests.",unit:"s",valueType:bn.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10]}})}subscribeToChannel(e,n){var r;let[o,s]=process.version.replace("v","").split(".").map(c=>Number(c)),i=o>18||o===18&&s>=19,a;if(i)(r=ud.subscribe)===null||r===void 0||r.call(ud,e,n),a=()=>{var c;return(c=ud.unsubscribe)===null||c===void 0?void 0:c.call(ud,e,n)};else{let c=ud.channel(e);c.subscribe(n),a=()=>c.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:a})}onRequestCreated({request:e}){let n=this.getConfig(),r=n.enabled!==!1;if((0,ld.safeExecuteInTheMiddle)(()=>{var A;return!r||e.method==="CONNECT"||((A=n.ignoreRequestHook)===null||A===void 0?void 0:A.call(n,e))},A=>A&&this._diag.error("caught ignoreRequestHook error: ",A),!0))return;let s=(0,bE.hrTime)(),i;try{i=new uUe.URL(e.path,e.origin)}catch(A){this._diag.warn("could not determine url.full:",A);return}let a=i.protocol.replace(":",""),c=this.getRequestMethod(e.method),u={[_t.SemanticAttributes.HTTP_REQUEST_METHOD]:c,[_t.SemanticAttributes.HTTP_REQUEST_METHOD_ORIGINAL]:e.method,[_t.SemanticAttributes.URL_FULL]:i.toString(),[_t.SemanticAttributes.URL_PATH]:i.pathname,[_t.SemanticAttributes.URL_QUERY]:i.search,[_t.SemanticAttributes.URL_SCHEME]:a},l={https:"443",http:"80"},d=i.hostname,p=i.port||l[a];u[_t.SemanticAttributes.SERVER_ADDRESS]=d,p&&!isNaN(Number(p))&&(u[_t.SemanticAttributes.SERVER_PORT]=Number(p));let _;if(Array.isArray(e.headers)){let A=e.headers.findIndex(M=>M.toLowerCase()==="user-agent");A>=0&&(_=e.headers[A+1])}else if(typeof e.headers=="string"){let M=e.headers.split(`\r
7
+ `).find(P=>P.toLowerCase().startsWith("user-agent"));_=M&&M.substring(M.indexOf(":")+1).trim()}_&&(u[_t.SemanticAttributes.USER_AGENT_ORIGINAL]=_);let f=(0,ld.safeExecuteInTheMiddle)(()=>{var A;return(A=n.startSpanHook)===null||A===void 0?void 0:A.call(n,e)},A=>A&&this._diag.error("caught startSpanHook error: ",A),!0);f&&Object.entries(f).forEach(([A,M])=>{u[A]=M});let E=bn.context.active(),S=bn.trace.getSpan(E),g;n.requireParentforSpans&&(!S||!bn.trace.isSpanContextValid(S.spanContext()))?g=bn.trace.wrapSpanContext(bn.INVALID_SPAN_CONTEXT):g=this.tracer.startSpan(c==="_OTHER"?"HTTP":c,{kind:bn.SpanKind.CLIENT,attributes:u},E),(0,ld.safeExecuteInTheMiddle)(()=>{var A;return(A=n.requestHook)===null||A===void 0?void 0:A.call(n,g,e)},A=>A&&this._diag.error("caught requestHook error: ",A),!0);let h=bn.trace.setSpan(bn.context.active(),g),O={};bn.propagation.inject(h,O);let N=Object.entries(O);for(let A=0;A<N.length;A++){let[M,P]=N[A];typeof e.addHeader=="function"?e.addHeader(M,P):typeof e.headers=="string"?e.headers+=`${M}: ${P}\r
8
8
  `:Array.isArray(e.headers)&&e.headers.push(M,P)}this._recordFromReq.set(e,{span:g,attributes:u,startTime:s})}onRequestHeaders({request:e,socket:n}){var r;let o=this._recordFromReq.get(e);if(!o)return;let s=this.getConfig(),{span:i}=o,{remoteAddress:a,remotePort:c}=n,u={[_t.SemanticAttributes.NETWORK_PEER_ADDRESS]:a,[_t.SemanticAttributes.NETWORK_PEER_PORT]:c};if(!((r=s.headersToSpanAttributes)===null||r===void 0)&&r.requestHeaders){let l=new Set(s.headersToSpanAttributes.requestHeaders.map(p=>p.toLowerCase())),d=Array.isArray(e.headers)?e.headers:e.headers.split(`\r
9
- `);d.forEach((p,_)=>{let f=p.indexOf(":"),E=f!==-1,S=(E?p.substring(0,f):p).toLowerCase(),g=E?p.substring(f+1):d[_+1];l.has(S)&&(u[`http.request.header.${S}`]=g.trim())})}i.setAttributes(u)}onResponseHeaders({request:e,response:n}){var r,o;let s=this._recordFromReq.get(e);if(!s)return;let{span:i,attributes:a}=s,c={[_t.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE]:n.statusCode},u=this.getConfig();(0,ld.safeExecuteInTheMiddle)(()=>{var d;return(d=u.responseHook)===null||d===void 0?void 0:d.call(u,i,{request:e,response:n})},d=>d&&this._diag.error("caught responseHook error: ",d),!0);let l=new Set;!((r=u.headersToSpanAttributes)===null||r===void 0)&&r.responseHeaders&&((o=u.headersToSpanAttributes)===null||o===void 0||o.responseHeaders.forEach(d=>l.add(d.toLowerCase())));for(let d=0;d<n.headers.length;d=d+2){let p=n.headers[d].toString().toLowerCase(),_=n.headers[d+1];if(l.has(p)&&(c[`http.response.header.${p}`]=_.toString()),p==="content-length"){let f=Number(_.toString());isNaN(f)||(c["http.response.header.content-length"]=f)}}i.setAttributes(c),i.setStatus({code:n.statusCode>=400?Pn.SpanStatusCode.ERROR:Pn.SpanStatusCode.UNSET}),s.attributes=Object.assign(a,c)}onDone({request:e}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:o,startTime:s}=n;r.end(),this._recordFromReq.delete(e),this.recordRequestDuration(o,s)}onError({request:e,error:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s,startTime:i}=r;o.recordException(n),o.setStatus({code:Pn.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(e),s[_t.SemanticAttributes.ERROR_TYPE]=n.message,this.recordRequestDuration(s,i)}recordRequestDuration(e,n){let r={};[_t.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,_t.SemanticAttributes.HTTP_REQUEST_METHOD,_t.SemanticAttributes.SERVER_ADDRESS,_t.SemanticAttributes.SERVER_PORT,_t.SemanticAttributes.URL_SCHEME,_t.SemanticAttributes.ERROR_TYPE].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,PE.hrTimeToMilliseconds)((0,PE.hrTimeDuration)(n,(0,PE.hrTime)()))/1e3;this._httpClientDurationHistogram.record(s,r)}getRequestMethod(e){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0};return e.toUpperCase()in n?e.toUpperCase():"_OTHER"}};bE.UndiciInstrumentation=PO});var v5=m(C5=>{"use strict";Object.defineProperty(C5,"__esModule",{value:!0})});var P5=m(Rs=>{"use strict";var sUe=Rs&&Rs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),I5=Rs&&Rs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&sUe(e,t,n)};Object.defineProperty(Rs,"__esModule",{value:!0});I5(N5(),Rs);I5(v5(),Rs)});var ME=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ExpressLayerType=void 0;var pUe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(pUe=dd.ExpressLayerType||(dd.ExpressLayerType={}))});var LE=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.AttributeNames=void 0;var _Ue;(function(t){t.EXPRESS_TYPE="express.type",t.EXPRESS_NAME="express.name"})(_Ue=pd.AttributeNames||(pd.AttributeNames={}))});var bO=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc._LAYERS_STORE_PROPERTY=jc.kLayerPatched=void 0;jc.kLayerPatched=Symbol("express-layer-patched");jc._LAYERS_STORE_PROPERTY="__ot_middlewares"});var D5=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.getLayerPath=qt.asErrorAndMessage=qt.isLayerIgnored=qt.getLayerMetadata=qt.getRouterPath=qt.storeLayerPath=void 0;var MO=ME(),qc=LE(),LO=bO(),fUe=(t,e)=>{Array.isArray(t[LO._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,LO._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e!==void 0&&t[LO._LAYERS_STORE_PROPERTY].push(e)};qt.storeLayerPath=fUe;var mUe=(t,e)=>{var n,r,o,s;let i=(r=(n=e.handle)===null||n===void 0?void 0:n.stack)===null||r===void 0?void 0:r[0];return!((o=i?.route)===null||o===void 0)&&o.path?`${t}${i.route.path}`:!((s=i?.handle)===null||s===void 0)&&s.stack?(0,qt.getRouterPath)(t,i):t};qt.getRouterPath=mUe;var EUe=(t,e,n)=>{var r;if(e.name==="router"){let o=(0,qt.getRouterPath)("",e),s=o||n||t||"/";return{attributes:{[qc.AttributeNames.EXPRESS_NAME]:s,[qc.AttributeNames.EXPRESS_TYPE]:MO.ExpressLayerType.ROUTER},name:`router - ${s}`}}else return e.name==="bound dispatch"?{attributes:{[qc.AttributeNames.EXPRESS_NAME]:(r=t||n)!==null&&r!==void 0?r:"request handler",[qc.AttributeNames.EXPRESS_TYPE]:MO.ExpressLayerType.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[qc.AttributeNames.EXPRESS_NAME]:e.name,[qc.AttributeNames.EXPRESS_TYPE]:MO.ExpressLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};qt.getLayerMetadata=EUe;var SUe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},TUe=(t,e,n)=>{var r;if(Array.isArray(n?.ignoreLayersType)&&(!((r=n?.ignoreLayersType)===null||r===void 0)&&r.includes(e)))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let o of n.ignoreLayers)if(SUe(t,o))return!0}catch{}return!1};qt.isLayerIgnored=TUe;var gUe=t=>t instanceof Error?[t,t.message]:[String(t),String(t)];qt.asErrorAndMessage=gUe;var hUe=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>x5(n)||"").join(","):x5(e)};qt.getLayerPath=hUe;var x5=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()}});var U5=m(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.PACKAGE_NAME=Yc.PACKAGE_VERSION=void 0;Yc.PACKAGE_VERSION="0.47.1";Yc.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var G5=m(xE=>{"use strict";Object.defineProperty(xE,"__esModule",{value:!0});xE.ExpressInstrumentation=void 0;var w5=fe(),Zi=(L(),I(V)),k5=ME(),V5=LE(),ys=D5(),B5=U5(),Kc=de(),AUe=(Re(),I(et)),_d=bO(),xO=class extends Kc.InstrumentationBase{constructor(e={}){super(B5.PACKAGE_NAME,B5.PACKAGE_VERSION,e)}init(){return[new Kc.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <5"],e=>{let n=e.Router;return(0,Kc.isWrapped)(n.route)&&this._unwrap(n,"route"),this._wrap(n,"route",this._getRoutePatch()),(0,Kc.isWrapped)(n.use)&&this._unwrap(n,"use"),this._wrap(n,"use",this._getRouterUsePatch()),(0,Kc.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch()),e},e=>{if(e===void 0)return;let n=e.Router;this._unwrap(n,"route"),this._unwrap(n,"use"),this._unwrap(e.application,"use")})]}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_getAppUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this._router.stack[this._router.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_applyPatch(e,n){let r=this;e[_d.kLayerPatched]!==!0&&(e[_d.kLayerPatched]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){(0,ys.storeLayerPath)(i,n);let c=i[_d._LAYERS_STORE_PROPERTY].filter(N=>N!=="/"&&N!=="/*").join("").replace(/\/{2,}/g,"/"),u={[AUe.SEMATTRS_HTTP_ROUTE]:c.length>0?c:"/"},l=(0,ys.getLayerMetadata)(c,e,n),d=l.attributes[V5.AttributeNames.EXPRESS_TYPE],p=(0,w5.getRPCMetadata)(Zi.context.active());if(p?.type===w5.RPCType.HTTP&&(p.route=c||"/"),(0,ys.isLayerIgnored)(l.name,d,r.getConfig()))return d===k5.ExpressLayerType.MIDDLEWARE&&i[_d._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Zi.trace.getSpan(Zi.context.active())===void 0)return o.apply(this,arguments);let _=r._getSpanName({request:i,layerType:d,route:c},l.name),f=r.tracer.startSpan(_,{attributes:Object.assign(u,l.attributes)}),{requestHook:E}=r.getConfig();E&&(0,Kc.safeExecuteInTheMiddle)(()=>E(f,{request:i,layerType:d,route:c}),N=>{N&&Zi.diag.error("express instrumentation: request hook failed",N)},!0);let S=!1;l.attributes[V5.AttributeNames.EXPRESS_TYPE]!==k5.ExpressLayerType.MIDDLEWARE&&(f.end(),S=!0);let g=()=>{S===!1&&(S=!0,f.end())},h=Array.from(arguments),O=h.findIndex(N=>typeof N=="function");O>=0&&(arguments[O]=function(){var N;let R=arguments[0],M=![void 0,null,"route","router"].includes(R);if(!S&&M){let[J,X]=(0,ys.asErrorAndMessage)(R);f.recordException(J),f.setStatus({code:Zi.SpanStatusCode.ERROR,message:X})}return S===!1&&(S=!0,(N=i.res)===null||N===void 0||N.removeListener("finish",g),f.end()),i.route&&M||i[_d._LAYERS_STORE_PROPERTY].pop(),h[O].apply(this,arguments)});try{return o.apply(this,arguments)}catch(N){let[R,M]=(0,ys.asErrorAndMessage)(N);throw f.recordException(R),f.setStatus({code:Zi.SpanStatusCode.ERROR,message:M}),N}finally{S||a.once("finish",g)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){var r;let{spanNameHook:o}=this.getConfig();if(!(o instanceof Function))return n;try{return(r=o(e,n))!==null&&r!==void 0?r:n}catch(s){return Zi.diag.error("express instrumentation: error calling span name rewrite hook",s),n}}};xE.ExpressInstrumentation=xO});var F5=m(H5=>{"use strict";Object.defineProperty(H5,"__esModule",{value:!0})});var $5=m(Qr=>{"use strict";var RUe=Qr&&Qr.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),DE=Qr&&Qr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&RUe(e,t,n)};Object.defineProperty(Qr,"__esModule",{value:!0});DE(G5(),Qr);DE(ME(),Qr);DE(LE(),Qr);DE(F5(),Qr)});var s3=m((NQe,o3)=>{"use strict";o3.exports=n3;function n3(t,e,n){t instanceof RegExp&&(t=t3(t,n)),e instanceof RegExp&&(e=t3(e,n));var r=r3(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function t3(t,e){var n=e.match(t);return n?n[0]:null}n3.range=r3;function r3(t,e,n){var r,o,s,i,a,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],s=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),u]:(o=r.pop(),o<s&&(s=o,i=u),u=n.indexOf(e,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[s,i])}return a}});var _3=m((CQe,p3)=>{var i3=s3();p3.exports=bUe;var a3="\0SLASH"+Math.random()+"\0",c3="\0OPEN"+Math.random()+"\0",BO="\0CLOSE"+Math.random()+"\0",u3="\0COMMA"+Math.random()+"\0",l3="\0PERIOD"+Math.random()+"\0";function VO(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function IUe(t){return t.split("\\\\").join(a3).split("\\{").join(c3).split("\\}").join(BO).split("\\,").join(u3).split("\\.").join(l3)}function PUe(t){return t.split(a3).join("\\").split(c3).join("{").split(BO).join("}").split(u3).join(",").split(l3).join(".")}function d3(t){if(!t)return[""];var e=[],n=i3("{","}",t);if(!n)return t.split(",");var r=n.pre,o=n.body,s=n.post,i=r.split(",");i[i.length-1]+="{"+o+"}";var a=d3(s);return s.length&&(i[i.length-1]+=a.shift(),i.push.apply(i,a)),e.push.apply(e,i),e}function bUe(t,e){if(!t)return[];e=e||{};var n=e.max==null?1/0:e.max;return t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),fd(IUe(t),n,!0).map(PUe)}function MUe(t){return"{"+t+"}"}function LUe(t){return/^-?0\d/.test(t)}function xUe(t,e){return t<=e}function DUe(t,e){return t>=e}function fd(t,e,n){var r=[],o=i3("{","}",t);if(!o)return[t];var s=o.pre,i=o.post.length?fd(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(var a=0;a<i.length&&a<e;a++){var c=s+"{"+o.body+"}"+i[a];r.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),d=u||l,p=o.body.indexOf(",")>=0;if(!d&&!p)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+BO+o.post,fd(t,e,!0)):[t];var _;if(d)_=o.body.split(/\.\./);else if(_=d3(o.body),_.length===1&&(_=fd(_[0],e,!1).map(MUe),_.length===1))return i.map(function(H){return o.pre+_[0]+H});var f;if(d){var E=VO(_[0]),S=VO(_[1]),g=Math.max(_[0].length,_[1].length),h=_.length==3?Math.max(Math.abs(VO(_[2])),1):1,O=xUe,N=S<E;N&&(h*=-1,O=DUe);var R=_.some(LUe);f=[];for(var M=E;O(M,S);M+=h){var P;if(l)P=String.fromCharCode(M),P==="\\"&&(P="");else if(P=String(M),R){var J=g-P.length;if(J>0){var X=new Array(J+1).join("0");M<0?P="-"+X+P.slice(1):P=X+P}}f.push(P)}}else{f=[];for(var Ye=0;Ye<_.length;Ye++)f.push.apply(f,fd(_[Ye],e,!1))}for(var Ye=0;Ye<f.length;Ye++)for(var a=0;a<i.length&&r.length<e;a++){var c=s+f[Ye]+i[a];(!n||d||c)&&r.push(c)}}return r}});var YO=m(gr=>{"use strict";Object.defineProperty(gr,"__esModule",{value:!0});gr.SpanNames=gr.TokenKind=gr.AllowedOperationTypes=void 0;var xwe;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(xwe=gr.AllowedOperationTypes||(gr.AllowedOperationTypes={}));var Dwe;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(Dwe=gr.TokenKind||(gr.TokenKind={}));var Uwe;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(Uwe=gr.SpanNames||(gr.SpanNames={}))});var KO=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.AttributeNames=void 0;var wwe;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(wwe=Ad.AttributeNames||(Ad.AttributeNames={}))});var qE=m(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.OTEL_GRAPHQL_DATA_SYMBOL=zc.OTEL_PATCHED_SYMBOL=void 0;zc.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");zc.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var $3=m(YE=>{"use strict";Object.defineProperty(YE,"__esModule",{value:!0});YE.OPERATION_NOT_SUPPORTED=void 0;var p7e=qE();YE.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var tz=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.wrapFieldResolver=ft.wrapFields=ft.getSourceFromLocation=ft.getOperation=ft.endSpan=ft.addSpanSource=ft.addInputVariableAttributes=ft.isPromise=void 0;var Jc=(L(),I(V)),Is=YO(),Xc=KO(),Lo=qE(),j3=Object.values(Is.AllowedOperationTypes),kwe=t=>typeof t?.then=="function";ft.isPromise=kwe;var Vwe=t=>typeof t=="object"&&t!==null;function WO(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{WO(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{WO(t,`${e}.${r}`,o)}):t.setAttribute(`${Xc.AttributeNames.VARIABLES}${String(e)}`,n)}function Bwe(t,e){Object.entries(e).forEach(([n,r])=>{WO(t,n,r)})}ft.addInputVariableAttributes=Bwe;function W3(t,e,n,r,o){let s=Z3(e,n,r,o);t.setAttribute(Xc.AttributeNames.SOURCE,s)}ft.addSpanSource=W3;function Gwe(t,e,n,r,o){let s=z3(n,o),i=!1;if(!s){i=!0;let a=X3(n,o);s={parent:a,span:Hwe(t,e,n,r,o,a.span),error:null},jwe(n,o,s)}return{spanAdded:i,field:s}}function Hwe(t,e,n,r,o,s){var i,a;let c={[Xc.AttributeNames.FIELD_NAME]:r.fieldName,[Xc.AttributeNames.FIELD_PATH]:o.join("."),[Xc.AttributeNames.FIELD_TYPE]:r.returnType.toString()},u=t.startSpan(`${Is.SpanNames.RESOLVE} ${c[Xc.AttributeNames.FIELD_PATH]}`,{attributes:c},s?Jc.trace.setSpan(Jc.context.active(),s):void 0),l=n[Lo.OTEL_GRAPHQL_DATA_SYMBOL].source,d=r.fieldNodes.find(p=>p.kind==="Field");return d&&W3(u,l.loc,e().allowValues,(i=d.loc)===null||i===void 0?void 0:i.start,(a=d.loc)===null||a===void 0?void 0:a.end),u}function Fwe(t,e){e&&t.recordException(e),t.end()}ft.endSpan=Fwe;function $we(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>{var r;return j3.indexOf((r=n)===null||r===void 0?void 0:r.operation)!==-1}).find(n=>{var r,o;return e===((o=(r=n)===null||r===void 0?void 0:r.name)===null||o===void 0?void 0:o.value)}):t.definitions.find(n=>{var r;return j3.indexOf((r=n)===null||r===void 0?void 0:r.operation)!==-1})}ft.getOperation=$we;function jwe(t,e,n){return t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function z3(t,e){return t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function X3(t,e){for(let n=e.length-1;n>0;n--){let r=z3(t,e.slice(0,n));if(r)return r}return{span:t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].span}}function qwe(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function Ywe(t){return J3(`
10
- `,t)}function q3(t){return J3(" ",t)}function J3(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var Kwe=[Is.TokenKind.FLOAT,Is.TokenKind.STRING,Is.TokenKind.INT,Is.TokenKind.BLOCK_STRING];function Z3(t,e=!1,n,r){var o,s;let i="";if(t?.startToken){let a=typeof n=="number"?n:t.start,c=typeof r=="number"?r:t.end,u=t.startToken.next,l=1;for(;u;){if(u.start<a){u=u.next,l=u?.line;continue}if(u.end>c){u=u.next,l=u?.line;continue}let d=u.value||u.kind,p="";!e&&Kwe.indexOf(u.kind)>=0&&(d="*"),u.kind===Is.TokenKind.STRING&&(d=`"${d}"`),u.kind===Is.TokenKind.EOF&&(d=""),u.line>l?(i+=Ywe(u.line-l),l=u.line,p=q3(u.column-1)):u.line===((o=u.prev)===null||o===void 0?void 0:o.line)&&(p=q3(u.start-(((s=u.prev)===null||s===void 0?void 0:s.end)||0))),i+=p+d,u&&(u=u.next)}}return i}ft.getSourceFromLocation=Z3;function Q3(t,e,n){if(!t||typeof t.getFields!="function"||t[Lo.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[Lo.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=ez(e,n,s.resolve)),s.type)){let i=s.type;for(;i.ofType;)i=i.ofType;Q3(i,e,n)}})}ft.wrapFields=Q3;var Y3=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:Jc.SpanStatusCode.ERROR,message:e.message}),t.end())},K3=(t,e)=>{e&&t.end()};function ez(t,e,n,r=!1){if(o[Lo.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let u=e();if(u.ignoreTrivialResolveSpans&&r&&(Vwe(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[Lo.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let l=qwe(u.mergeItems,c&&c.path),d=l.filter(f=>typeof f=="string").length,p,_=!1;if(u.depth>=0&&u.depth<d)p=X3(a,l);else{let f=Gwe(t,e,a,c,l);p=f.field,_=f.spanAdded}return Jc.context.with(Jc.trace.setSpan(Jc.context.active(),p.span),()=>{try{let f=n.call(this,s,i,a,c);return(0,ft.isPromise)(f)?f.then(E=>(K3(p.span,_),E),E=>{throw Y3(p.span,E,_),E}):(K3(p.span,_),f)}catch(f){throw Y3(p.span,f,_),f}})}return o[Lo.OTEL_PATCHED_SYMBOL]=!0,o}ft.wrapFieldResolver=ez});var nz=m(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.PACKAGE_NAME=Zc.PACKAGE_VERSION=void 0;Zc.PACKAGE_VERSION="0.47.1";Zc.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var sz=m(zE=>{"use strict";Object.defineProperty(zE,"__esModule",{value:!0});zE.GraphQLInstrumentation=void 0;var xo=(L(),I(V)),Xn=de(),Rd=YO(),KE=KO(),zO=qE(),Wwe=$3(),Kt=tz(),rz=nz(),oz={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},WE=[">=14.0.0 <17"],XO=class extends Xn.InstrumentationBase{constructor(e={}){super(rz.PACKAGE_NAME,rz.PACKAGE_VERSION,Object.assign(Object.assign({},oz),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},oz),e))}init(){let e=new Xn.InstrumentationNodeModuleDefinition("graphql",WE);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new Xn.InstrumentationNodeModuleFile("graphql/execution/execute.js",WE,e=>((0,Xn.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new Xn.InstrumentationNodeModuleFile("graphql/language/parser.js",WE,e=>((0,Xn.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new Xn.InstrumentationNodeModuleFile("graphql/validation/validate.js",WE,e=>((0,Xn.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let u=arguments;i=n._wrapExecuteArgs(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],e)}else{let u=arguments[0];i=n._wrapExecuteArgs(u.schema,u.document,u.rootValue,u.contextValue,u.variableValues,u.operationName,u.fieldResolver,u.typeResolver,e)}let a=(0,Kt.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[zO.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[zO.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},xo.context.with(xo.trace.setSpan(xo.context.active(),c),()=>(0,Xn.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(u,l)=>{n._handleExecutionResult(c,u,l)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,Kt.endSpan)(e,n);return}if((0,Kt.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,Kt.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,Xn.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,Kt.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,u){return e._validate(this,r,s,i,a,u,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(Rd.SpanNames.PARSE);return xo.context.with(xo.trace.setSpan(xo.context.active(),i),()=>(0,Xn.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,Kt.getOperation)(c)?c.loc&&(0,Kt.addSpanSource)(i,c.loc,s.allowValues):i.updateName(Rd.SpanNames.SCHEMA_PARSE)),(0,Kt.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(Rd.SpanNames.VALIDATE,{});return xo.context.with(xo.trace.setSpan(xo.context.active(),c),()=>(0,Xn.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(u,l)=>{o.loc||c.updateName(Rd.SpanNames.SCHEMA_VALIDATE),l&&l.length&&c.recordException({name:KE.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(l)}),(0,Kt.endSpan)(c,u)}))}_createExecuteSpan(e,n){var r;let o=this.getConfig(),s=this.tracer.startSpan(Rd.SpanNames.EXECUTE,{});if(e){let{operation:i,name:a}=e;s.setAttribute(KE.AttributeNames.OPERATION_TYPE,i);let c=a?.value;c?(s.setAttribute(KE.AttributeNames.OPERATION_NAME,c),s.updateName(`${i} ${c}`)):s.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=Wwe.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),s.setAttribute(KE.AttributeNames.OPERATION_NAME,i)}return!((r=n.document)===null||r===void 0)&&r.loc&&(0,Kt.addSpanSource)(s,n.document.loc,o.allowValues),n.variableValues&&o.allowValues&&(0,Kt.addInputVariableAttributes)(s,n.variableValues),s}_wrapExecuteArgs(e,n,r,o,s,i,a,c,u){if(o||(o={}),o[zO.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let l=a==null,d=a??u;return a=(0,Kt.wrapFieldResolver)(this.tracer,()=>this.getConfig(),d,l),e&&((0,Kt.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,Kt.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};zE.GraphQLInstrumentation=XO});var az=m(iz=>{"use strict";Object.defineProperty(iz,"__esModule",{value:!0})});var uz=m(Ps=>{"use strict";var zwe=Ps&&Ps.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),cz=Ps&&Ps.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&zwe(e,t,n)};Object.defineProperty(Ps,"__esModule",{value:!0});cz(sz(),Ps);cz(az(),Ps)});var mz=m(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.PACKAGE_NAME=Qc.PACKAGE_VERSION=void 0;Qc.PACKAGE_VERSION="0.7.1";Qc.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var Ez=m(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.bufferTextMapGetter=void 0;XE.bufferTextMapGetter={get(t,e){var n;if(!t)return;let r=Object.keys(t);for(let o of r)if(o===e||o.toLowerCase()===e)return(n=t[o])===null||n===void 0?void 0:n.toString()},keys(t){return t?Object.keys(t):[]}}});var gz=m(JE=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0});JE.KafkaJsInstrumentation=void 0;var Mt=(L(),I(V)),bs=(Re(),I(et)),Sz=mz(),Tz=Ez(),hr=de(),JO=class extends hr.InstrumentationBase{constructor(e={}){super(Sz.PACKAGE_NAME,Sz.PACKAGE_VERSION,e)}init(){let e=r=>{var o,s;(0,hr.isWrapped)((o=r?.Kafka)===null||o===void 0?void 0:o.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,hr.isWrapped)((s=r?.Kafka)===null||s===void 0?void 0:s.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new hr.InstrumentationNodeModuleDefinition("kafkajs",[">=0.1.0 <3"],r=>{var o,s;return e(r),this._wrap((o=r?.Kafka)===null||o===void 0?void 0:o.prototype,"producer",this._getProducerPatch()),this._wrap((s=r?.Kafka)===null||s===void 0?void 0:s.prototype,"consumer",this._getConsumerPatch()),r},e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,hr.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),s}}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,hr.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getProducerSendBatchPatch()),(0,hr.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getProducerSendPatch()),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,hr.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,hr.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=Mt.propagation.extract(Mt.ROOT_CONTEXT,s.message.headers,Tz.bufferTextMapGetter),a=e._startConsumerSpan(s.topic,s.message,bs.MESSAGINGOPERATIONVALUES_PROCESS,i),c=Mt.context.with(Mt.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan(s.batch.topic,void 0,bs.MESSAGINGOPERATIONVALUES_RECEIVE,Mt.ROOT_CONTEXT);return Mt.context.with(Mt.trace.setSpan(Mt.context.active(),i),()=>{let a=s.batch.messages.map(u=>{var l;let d=Mt.propagation.extract(Mt.ROOT_CONTEXT,u.headers,Tz.bufferTextMapGetter),p=(l=Mt.trace.getSpan(d))===null||l===void 0?void 0:l.spanContext(),_;return p&&(_={context:p}),n._startConsumerSpan(s.batch.topic,u,bs.MESSAGINGOPERATIONVALUES_PROCESS,void 0,_)}),c=e.apply(this,o);return a.unshift(i),n._endSpansOnPromise(a,c)})}}}_getProducerSendBatchPatch(){let e=this;return n=>function(...o){let a=(o[0].topicMessages||[]).map(u=>u.messages.map(l=>e._startProducerSpan(u.topic,l))).reduce((u,l)=>u.concat(l),[]),c=n.apply(this,o);return e._endSpansOnPromise(a,c)}}_getProducerSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(c=>e._startProducerSpan(s.topic,c)),a=n.apply(this,o);return e._endSpansOnPromise(i,a)}}_endSpansOnPromise(e,n){return Promise.resolve(n).catch(r=>{let o;throw typeof r=="string"?o=r:typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"message")&&(o=r.message),e.forEach(s=>s.setStatus({code:Mt.SpanStatusCode.ERROR,message:o})),r}).finally(()=>{e.forEach(r=>r.end())})}_startConsumerSpan(e,n,r,o,s){let i=this.tracer.startSpan(e,{kind:Mt.SpanKind.CONSUMER,attributes:{[bs.SEMATTRS_MESSAGING_SYSTEM]:"kafka",[bs.SEMATTRS_MESSAGING_DESTINATION]:e,[bs.SEMATTRS_MESSAGING_OPERATION]:r},links:s?[s]:[]},o),{consumerHook:a}=this.getConfig();return a&&n&&(0,hr.safeExecuteInTheMiddle)(()=>a(i,{topic:e,message:n}),c=>{c&&this._diag.error("consumerHook error",c)},!0),i}_startProducerSpan(e,n){var r;let o=this.tracer.startSpan(e,{kind:Mt.SpanKind.PRODUCER,attributes:{[bs.SEMATTRS_MESSAGING_SYSTEM]:"kafka",[bs.SEMATTRS_MESSAGING_DESTINATION]:e}});n.headers=(r=n.headers)!==null&&r!==void 0?r:{},Mt.propagation.inject(Mt.trace.setSpan(Mt.context.active(),o),n.headers);let{producerHook:s}=this.getConfig();return s&&(0,hr.safeExecuteInTheMiddle)(()=>s(o,{topic:e,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),o}};JE.KafkaJsInstrumentation=JO});var Az=m(hz=>{"use strict";Object.defineProperty(hz,"__esModule",{value:!0})});var yz=m(Ms=>{"use strict";var Zwe=Ms&&Ms.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Rz=Ms&&Ms.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Zwe(e,t,n)};Object.defineProperty(Ms,"__esModule",{value:!0});Rz(gz(),Ms);Rz(Az(),Ms)});var Iz=m(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.PACKAGE_NAME=eu.PACKAGE_VERSION=void 0;eu.PACKAGE_VERSION="0.44.1";eu.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var Lz=m(ZE=>{"use strict";Object.defineProperty(ZE,"__esModule",{value:!0});ZE.LruMemoizerInstrumentation=void 0;var Pz=(L(),I(V)),bz=de(),Mz=Iz(),ZO=class extends bz.InstrumentationBase{constructor(e={}){super(Mz.PACKAGE_NAME,Mz.PACKAGE_VERSION,e)}init(){return[new bz.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <3"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?Pz.context.bind(Pz.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};ZE.LruMemoizerInstrumentation=ZO});var xz=m(ta=>{"use strict";var e1e=ta&&ta.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),t1e=ta&&ta.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&e1e(e,t,n)};Object.defineProperty(ta,"__esModule",{value:!0});t1e(Lz(),ta)});var Vz=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.MongodbCommandType=void 0;var r1e;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(r1e=yd.MongodbCommandType||(yd.MongodbCommandType={}))});var Bz=m(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.PACKAGE_NAME=tu.PACKAGE_VERSION=void 0;tu.PACKAGE_VERSION="0.52.0";tu.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var Fz=m(QE=>{"use strict";Object.defineProperty(QE,"__esModule",{value:!0});QE.MongoDBInstrumentation=void 0;var ke=(L(),I(V)),Me=de(),Do=(Re(),I(et)),Ls=Vz(),Gz=Bz(),Hz={requireParentSpan:!0},QO=class t extends Me.InstrumentationBase{constructor(e={}){super(Gz.PACKAGE_NAME,Gz.PACKAGE_VERSION,Object.assign(Object.assign({},Hz),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},Hz),e))}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter("db.client.connections.usage",{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:u}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:l,v4UnpatchSessions:d}=this._getV4SessionsPatches();return[new Me.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new Me.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new Me.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <7"],void 0,void 0,[new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <7"],i,a),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,u),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <7"],r,o),new Me.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <7"],l,d)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,Me.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,Me.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,Me.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,Me.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,Me.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,Me.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,Me.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,Me.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,Me.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,Me.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connectionsUsage.add(1,{state:"used","pool.name":e._poolName}):o-1===i&&(e._connectionsUsage.add(-1,{state:"idle","pool.name":e._poolName}),e._connectionsUsage.add(1,{state:"used","pool.name":e._poolName})),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connectionsUsage.add(-1,{state:"used","pool.name":e._poolName}),e._connectionsUsage.add(1,{state:"idle","pool.name":e._poolName}),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,Me.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,Me.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=ke.context.bind(ke.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,Me.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,Me.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=n._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,u);let _=n.tracer.startSpan(`mongodb.${e}`,{kind:ke.SpanKind.CLIENT});n._populateV3Attributes(_,i,s,a[0],e);let f=n._patchEnd(_,p);return typeof c=="function"?r.call(this,s,i,a,f):r.call(this,s,i,a,c,f)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let u=ke.trace.getSpan(ke.context.active()),l=e._checkSkipInstrumentation(u),d=typeof a=="function"?a:c;if(l||typeof d!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let p=t._getCommandType(i),_=p===Ls.MongodbCommandType.UNKNOWN?"command":p,f=e.tracer.startSpan(`mongodb.${_}`,{kind:ke.SpanKind.CLIENT}),E=p===Ls.MongodbCommandType.UNKNOWN?void 0:p;e._populateV3Attributes(f,s,o,i,E);let S=e._patchEnd(f,d);return typeof a=="function"?n.call(this,o,s,i,S):n.call(this,o,s,i,a,S)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=ke.trace.getSpan(ke.context.active()),u=e._checkSkipInstrumentation(c),l=a,d=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let p;u||(p=e.tracer.startSpan(`mongodb.${d}`,{kind:ke.SpanKind.CLIENT}),e._populateV4Attributes(p,this,o,s,d));let _=e._patchEnd(p,l,this.id,d);return n.call(this,o,s,i,_)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=ke.trace.getSpan(ke.context.active()),c=e._checkSkipInstrumentation(a),u=Object.keys(i)[0],l=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let d;c||(d=e.tracer.startSpan(`mongodb.${u}`,{kind:ke.SpanKind.CLIENT}),e._populateV4Attributes(d,this,s,i,u));let p=e._patchEnd(d,l,this.id,u),_=n.apply(this,o);return _.then(f=>p(null,f),f=>p(f)),_}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=e._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,u);let _=e.tracer.startSpan("mongodb.find",{kind:ke.SpanKind.CLIENT});e._populateV3Attributes(_,s,o,i,"find");let f=e._patchEnd(_,p);return typeof c=="function"?n.call(this,o,s,i,a,f):n.call(this,o,s,i,a,c,f)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=e._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,u);let _=e.tracer.startSpan("mongodb.getMore",{kind:ke.SpanKind.CLIENT});e._populateV3Attributes(_,s,o,i.cmd,"getMore");let f=e._patchEnd(_,p);return typeof c=="function"?n.call(this,o,s,i,a,f):n.call(this,o,s,i,a,c,f)}}static _getCommandType(e){return e.createIndexes!==void 0?Ls.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?Ls.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?Ls.MongodbCommandType.IS_MASTER:e.count!==void 0?Ls.MongodbCommandType.COUNT:e.aggregate!==void 0?Ls.MongodbCommandType.AGGREGATE:Ls.MongodbCommandType.UNKNOWN}_populateV4Attributes(e,n,r,o,s){let i,a;if(n){let u=typeof n.address=="string"?n.address.split(":"):"";u.length===2&&(i=u[0],a=u[1])}let c;o?.documents&&o.documents[0]?c=o.documents[0]:o?.cursors?c=o.cursors:c=o,this._addAllSpanAttributes(e,r.db,r.collection,i,a,c,s)}_populateV3Attributes(e,n,r,o,s){var i,a,c,u,l,d,p,_;let f,E;if(r&&r.s&&(f=(a=(i=r.s.options)===null||i===void 0?void 0:i.host)!==null&&a!==void 0?a:r.s.host,E=(l=(u=(c=r.s.options)===null||c===void 0?void 0:c.port)!==null&&u!==void 0?u:r.s.port)===null||l===void 0?void 0:l.toString(),f==null||E==null)){let O=(d=r.description)===null||d===void 0?void 0:d.address;if(O){let N=O.split(":");f=N[0],E=N[1]}}let[S,g]=n.toString().split("."),h=(_=(p=o?.query)!==null&&p!==void 0?p:o?.q)!==null&&_!==void 0?_:o;this._addAllSpanAttributes(e,S,g,f,E,h,s)}_addAllSpanAttributes(e,n,r,o,s,i,a){if(e.setAttributes({[Do.SEMATTRS_DB_SYSTEM]:Do.DBSYSTEMVALUES_MONGODB,[Do.SEMATTRS_DB_NAME]:n,[Do.SEMATTRS_DB_MONGODB_COLLECTION]:r,[Do.SEMATTRS_DB_OPERATION]:a,[Do.SEMATTRS_DB_CONNECTION_STRING]:`mongodb://${o}:${s}/${n}`}),o&&s){e.setAttribute(Do.SEMATTRS_NET_PEER_NAME,o);let l=parseInt(s,10);isNaN(l)||e.setAttribute(Do.SEMATTRS_NET_PEER_PORT,l)}if(!i)return;let{dbStatementSerializer:c}=this.getConfig(),u=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,Me.safeExecuteInTheMiddle)(()=>{let l=u(i);e.setAttribute(Do.SEMATTRS_DB_STATEMENT,l)},l=>{l&&this._diag.error("Error running dbStatementSerializer hook",l)},!0)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig(),r=n?e:this._scrubStatement(e);return JSON.stringify(r)}_scrubStatement(e){return Array.isArray(e)?e.map(n=>this._scrubStatement(n)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this._scrubStatement(r)])):"?"}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,Me.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=ke.context.active(),i=this;return function(...c){let u=c[0];if(e){if(u instanceof Error)e?.setStatus({code:ke.SpanStatusCode.ERROR,message:u.message});else{let l=c[1];i._handleExecutionResult(e,l)}e.end()}return ke.context.with(s,()=>(o==="endSessions"&&i._connectionsUsage.add(-1,{state:"idle","pool.name":i._poolName}),n.apply(this,c)))}}setPoolName(e){var n,r;let o=(n=e.hostAddress)===null||n===void 0?void 0:n.host,s=(r=e.hostAddress)===null||r===void 0?void 0:r.port,i=e.dbName,a=`mongodb://${o}:${s}/${i}`;this._poolName=a}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};QE.MongoDBInstrumentation=QO});var $z=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.MongodbCommandType=void 0;var o1e;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(o1e=Od.MongodbCommandType||(Od.MongodbCommandType={}))});var qz=m(xs=>{"use strict";var s1e=xs&&xs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),jz=xs&&xs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&s1e(e,t,n)};Object.defineProperty(xs,"__esModule",{value:!0});jz(Fz(),xs);jz($z(),xs)});var Zz=m(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.handleCallbackResponse=Ds.handlePromiseResponse=Ds.getAttributesFromCollection=void 0;var Xz=(L(),I(V)),d1e=de(),Nd=(Re(),I(et));function p1e(t){return{[Nd.SEMATTRS_DB_MONGODB_COLLECTION]:t.name,[Nd.SEMATTRS_DB_NAME]:t.conn.name,[Nd.SEMATTRS_DB_USER]:t.conn.user,[Nd.SEMATTRS_NET_PEER_NAME]:t.conn.host,[Nd.SEMATTRS_NET_PEER_PORT]:t.conn.port}}Ds.getAttributesFromCollection=p1e;function Jz(t,e={}){t.recordException(e),t.setStatus({code:Xz.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
11
- Mongoose Error Code: ${e.code}`:""}`})}function tN(t,e,n,r=void 0){n&&(0,d1e.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&Xz.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function _1e(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(tN(e,o,n,r),o)).catch(o=>{throw Jz(e,o),o}).finally(()=>e.end()):(tN(e,t,n,r),e.end(),t)}Ds.handlePromiseResponse=_1e;function f1e(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2&&(a=1),o[a]=(c,u)=>(c?Jz(r,c):tN(r,u,s,i),r.end(),t(c,u)),e.apply(n,o)}Ds.handleCallbackResponse=f1e});var Qz=m(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.PACKAGE_NAME=nu.PACKAGE_VERSION=void 0;nu.PACKAGE_VERSION="0.46.1";nu.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var oX=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.MongooseInstrumentation=no._STORED_PARENT_SPAN=void 0;var rn=(L(),I(V)),m1e=fe(),nN=Zz(),eX=de(),tX=Qz(),Cd=(Re(),I(et)),eS=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],E1e=["remove","count","findOneAndRemove",...eS],S1e=["count","findOneAndRemove",...eS],T1e=[...eS];function nX(t){return t?t.startsWith("6.")||t.startsWith("5.")?E1e:t.startsWith("7.")?S1e:T1e:eS}function rX(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}no._STORED_PARENT_SPAN=Symbol("stored-parent-span");var rN=class extends eX.InstrumentationBase{constructor(e={}){super(tX.PACKAGE_NAME,tX.PACKAGE_VERSION,e)}init(){return new eX.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){return this._wrap(e.Model.prototype,"save",this.patchOnModelMethods("save",n)),e.Model.prototype.$save=e.Model.prototype.save,rX(n)&&this._wrap(e.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),this._wrap(e.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(e.Aggregate.prototype,"exec",this.patchAggregateExec(n)),nX(n).forEach(o=>{this._wrap(e.Query.prototype,o,this.patchAndCaptureSpanContext(o))}),this._wrap(e.Model,"aggregate",this.patchModelAggregate()),e}unpatch(e,n){let r=nX(n);this._unwrap(e.Model.prototype,"save"),e.Model.prototype.$save=e.Model.prototype.save,rX(n)&&this._unwrap(e.Model.prototype,"remove"),this._unwrap(e.Query.prototype,"exec"),this._unwrap(e.Aggregate.prototype,"exec"),r.forEach(o=>{this._unwrap(e.Query.prototype,o)}),this._unwrap(e.Model,"aggregate")}patchAggregateExec(e){let n=this;return r=>function(s){var i;if(n.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return r.apply(this,arguments);let a=this[no._STORED_PARENT_SPAN],c={},{dbStatementSerializer:u}=n.getConfig();u&&(c[Cd.SEMATTRS_DB_STATEMENT]=u("aggregate",{options:this.options,aggregatePipeline:this._pipeline}));let l=n._startSpan(this._model.collection,(i=this._model)===null||i===void 0?void 0:i.modelName,"aggregate",c,a);return n._handleResponse(l,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return r.apply(this,arguments);let i=this[no._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();c&&(a[Cd.SEMATTRS_DB_STATEMENT]=c(this.op,{condition:this._conditions,updates:this._update,options:this.options,fields:this._fields}));let u=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(u,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let u={},{dbStatementSerializer:l}=r.getConfig();l&&(u[Cd.SEMATTRS_DB_STATEMENT]=l(e,c));let d=r._startSpan(this.constructor.collection,this.constructor.modelName,e,u);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(d,o,this,arguments,a,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=rn.trace.getSpan(rn.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[no._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[no._STORED_PARENT_SPAN]=rn.trace.getSpan(rn.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){return this.tracer.startSpan(`mongoose.${n}.${r}`,{kind:rn.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},o),(0,nN.getAttributesFromCollection)(e)),{[Cd.SEMATTRS_DB_OPERATION]:r,[Cd.SEMATTRS_DB_SYSTEM]:"mongoose"})},s?rn.trace.setSpan(rn.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,nN.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,nN.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?rn.context.with((0,m1e.suppressTracing)(rn.context.active()),e):e()}};no.MongooseInstrumentation=rN});var iX=m(sX=>{"use strict";Object.defineProperty(sX,"__esModule",{value:!0})});var cX=m(Us=>{"use strict";var g1e=Us&&Us.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),aX=Us&&Us.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&g1e(e,t,n)};Object.defineProperty(Us,"__esModule",{value:!0});aX(oX(),Us);aX(iX(),Us)});var _X=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.AttributeNames=void 0;var A1e;(function(t){t.MYSQL_VALUES="db.mysql.values"})(A1e=vd.AttributeNames||(vd.AttributeNames={}))});var mX=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.getPoolName=Tn.arrayStringifyHelper=Tn.getSpanName=Tn.getDbValues=Tn.getDbStatement=Tn.getConnectionAttributes=void 0;var Uo=(Re(),I(et));function R1e(t){let{host:e,port:n,database:r,user:o}=y1e(t),s=parseInt(n,10);return isNaN(s)?{[Uo.SEMATTRS_NET_PEER_NAME]:e,[Uo.SEMATTRS_DB_CONNECTION_STRING]:fX(e,n,r),[Uo.SEMATTRS_DB_NAME]:r,[Uo.SEMATTRS_DB_USER]:o}:{[Uo.SEMATTRS_NET_PEER_NAME]:e,[Uo.SEMATTRS_NET_PEER_PORT]:s,[Uo.SEMATTRS_DB_CONNECTION_STRING]:fX(e,n,r),[Uo.SEMATTRS_DB_NAME]:r,[Uo.SEMATTRS_DB_USER]:o}}Tn.getConnectionAttributes=R1e;function y1e(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function fX(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function O1e(t){return typeof t=="string"?t:t.sql}Tn.getDbStatement=O1e;function N1e(t,e){return oN(typeof t=="string"?e:e||t.values)}Tn.getDbValues=N1e;function C1e(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Tn.getSpanName=C1e;function oN(t){return t?`[${t.toString()}]`:""}Tn.arrayStringifyHelper=oN;function v1e(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Tn.getPoolName=v1e});var EX=m(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.PACKAGE_NAME=ru.PACKAGE_VERSION=void 0;ru.PACKAGE_VERSION="0.45.1";ru.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var TX=m(nS=>{"use strict";Object.defineProperty(nS,"__esModule",{value:!0});nS.MySQLInstrumentation=void 0;var gn=(L(),I(V)),ou=de(),sN=(Re(),I(et)),I1e=_X(),su=mX(),SX=EX(),tS=class t extends ou.InstrumentationBase{constructor(e={}){super(SX.PACKAGE_NAME,SX.PACKAGE_VERSION,e),this._setMetricInstruments()}setMeterProvider(e){super.setMeterProvider(e),this._setMetricInstruments()}_setMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter("db.client.connections.usage",{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}init(){return[new ou.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,ou.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,ou.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,ou.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolcallbacks(s,n,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,u=(0,su.getPoolName)(e);r._connectionsUsage.add(-c,{state:"used",name:u}),r._connectionsUsage.add(-a,{state:"idle",name:u}),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),u=a[c].pool;r._setPoolcallbacks(u,r,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=gn.context.active();return function(o,s){s&&((0,ou.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&gn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a=r.tracer.startSpan((0,su.getSpanName)(o),{kind:gn.SpanKind.CLIENT,attributes:Object.assign(Object.assign({},t.COMMON_ATTRIBUTES),(0,su.getConnectionAttributes)(e.config))});if(a.setAttribute(sN.SEMATTRS_DB_STATEMENT,(0,su.getDbStatement)(o)),r.getConfig().enhancedDatabaseReporting){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]),a.setAttribute(I1e.AttributeNames.MYSQL_VALUES,(0,su.getDbValues)(o,l))}let c=Array.from(arguments).findIndex(l=>typeof l=="function"),u=gn.context.active();if(c===-1){let l=gn.context.with(gn.trace.setSpan(gn.context.active(),a),()=>n.apply(e,arguments));return gn.context.bind(u,l),l.on("error",d=>a.setStatus({code:gn.SpanStatusCode.ERROR,message:d.message})).on("end",()=>{a.end()})}else return r._wrap(arguments,c,r._patchCallbackQuery(a,u)),gn.context.with(gn.trace.setSpan(gn.context.active(),a),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:gn.SpanStatusCode.ERROR,message:o.message}),e.end(),gn.context.with(n,()=>r(...arguments))}}_setPoolcallbacks(e,n,r){let o=r||(0,su.getPoolName)(e);e.on("connection",s=>{n._connectionsUsage.add(1,{state:"idle",name:o})}),e.on("acquire",s=>{n._connectionsUsage.add(-1,{state:"idle",name:o}),n._connectionsUsage.add(1,{state:"used",name:o})}),e.on("release",s=>{n._connectionsUsage.add(-1,{state:"used",name:o}),n._connectionsUsage.add(1,{state:"idle",name:o})})}};nS.MySQLInstrumentation=tS;tS.COMMON_ATTRIBUTES={[sN.SEMATTRS_DB_SYSTEM]:sN.DBSYSTEMVALUES_MYSQL}});var hX=m(gX=>{"use strict";Object.defineProperty(gX,"__esModule",{value:!0})});var RX=m(ws=>{"use strict";var P1e=ws&&ws.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),AX=ws&&ws.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&P1e(e,t,n)};Object.defineProperty(ws,"__esModule",{value:!0});AX(TX(),ws);AX(hX(),ws)});var aN=m(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});rS.addSqlCommenterComment=void 0;var iN=(L(),I(V)),M1e=fe();function L1e(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function x1e(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function D1e(t,e){if(typeof e!="string"||e.length===0||L1e(e))return e;let n=new M1e.W3CTraceContextPropagator,r={};n.inject(iN.trace.setSpan(iN.ROOT_CONTEXT,t),r,iN.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=x1e(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}rS.addSqlCommenterComment=D1e});var IX=m(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.getConnectionPrototypeToInstrument=Jn.once=Jn.getSpanName=Jn.getDbStatement=Jn.getConnectionAttributes=void 0;var wo=(Re(),I(et));function U1e(t){let{host:e,port:n,database:r,user:o}=w1e(t),s=parseInt(n,10);return isNaN(s)?{[wo.SEMATTRS_NET_PEER_NAME]:e,[wo.SEMATTRS_DB_CONNECTION_STRING]:vX(e,n,r),[wo.SEMATTRS_DB_NAME]:r,[wo.SEMATTRS_DB_USER]:o}:{[wo.SEMATTRS_NET_PEER_NAME]:e,[wo.SEMATTRS_NET_PEER_PORT]:s,[wo.SEMATTRS_DB_CONNECTION_STRING]:vX(e,n,r),[wo.SEMATTRS_DB_NAME]:r,[wo.SEMATTRS_DB_USER]:o}}Jn.getConnectionAttributes=U1e;function w1e(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function vX(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function k1e(t,e,n){return e?typeof t=="string"?n?e(t,n):t:n||t.values?e(t.sql,n||t.values):t.sql:typeof t=="string"?t:t.sql}Jn.getDbStatement=k1e;function V1e(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Jn.getSpanName=V1e;var B1e=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Jn.once=B1e;function G1e(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}Jn.getConnectionPrototypeToInstrument=G1e});var PX=m(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.PACKAGE_NAME=iu.PACKAGE_VERSION=void 0;iu.PACKAGE_VERSION="0.45.2";iu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var xX=m(sS=>{"use strict";Object.defineProperty(sS,"__esModule",{value:!0});sS.MySQL2Instrumentation=void 0;var bX=(L(),I(V)),na=de(),uN=(Re(),I(et)),MX=aN(),au=IX(),LX=PX(),cN=[">=1.4.2 <4"],oS=class t extends na.InstrumentationBase{constructor(e={}){super(LX.PACKAGE_NAME,LX.PACKAGE_VERSION,e)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,na.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,na.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new na.InstrumentationNodeModuleDefinition("mysql2",cN,s=>(n(s),s),()=>{},[new na.InstrumentationNodeModuleFile("mysql2/promise.js",cN,s=>(n(s),s),()=>{}),new na.InstrumentationNodeModuleFile("mysql2/lib/connection.js",cN,s=>{let i=(0,au.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,au.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let u=o.tracer.startSpan((0,au.getSpanName)(s),{kind:bX.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},t.COMMON_ATTRIBUTES),(0,au.getConnectionAttributes)(this.config)),{[uN.SEMATTRS_DB_STATEMENT]:(0,au.getDbStatement)(s,e,c)})});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,MX.addSqlCommenterComment)(u,s):Object.assign(s,{sql:(0,MX.addSqlCommenterComment)(u,s.sql)}));let l=(0,au.once)((d,p)=>{if(d)u.setStatus({code:bX.SpanStatusCode.ERROR,message:d.message});else{let{responseHook:_}=o.getConfig();typeof _=="function"&&(0,na.safeExecuteInTheMiddle)(()=>{_(u,{queryResults:p})},f=>{f&&o._diag.warn("Failed executing responseHook",f)},!0)}u.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(l));let d=r.apply(this,arguments);return d.once("error",p=>{l(p)}).once("result",p=>{l(void 0,p)}),d}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(l)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(l)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};sS.MySQL2Instrumentation=oS;oS.COMMON_ATTRIBUTES={[uN.SEMATTRS_DB_SYSTEM]:uN.DBSYSTEMVALUES_MYSQL}});var UX=m(DX=>{"use strict";Object.defineProperty(DX,"__esModule",{value:!0})});var kX=m(ks=>{"use strict";var H1e=ks&&ks.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),wX=ks&&ks.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&H1e(e,t,n)};Object.defineProperty(ks,"__esModule",{value:!0});wX(xX(),ks);wX(UX(),ks)});var FX=m(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.endSpan=void 0;var $1e=(L(),I(V)),j1e=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:$1e.SpanStatusCode.ERROR,message:e.message})),t.end()};iS.endSpan=j1e});var lN=m(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.defaultDbStatementSerializer=void 0;var q1e=[{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}],Y1e=(t,e)=>{var n,r;if(Array.isArray(e)&&e.length){let o=(r=(n=q1e.find(({regex:i})=>i.test(t)))===null||n===void 0?void 0:n.args)!==null&&r!==void 0?r:0,s=o>=0?e.slice(0,o):e;return e.length>s.length&&s.push(`[${e.length-o} other arguments]`),`${t} ${s.join(" ")}`}return t};aS.defaultDbStatementSerializer=Y1e});var $X=m(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.PACKAGE_NAME=cu.PACKAGE_VERSION=void 0;cu.PACKAGE_VERSION="0.47.1";cu.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var KX=m(uS=>{"use strict";Object.defineProperty(uS,"__esModule",{value:!0});uS.IORedisInstrumentation=void 0;var Vs=(L(),I(V)),cS=de(),Zn=(Re(),I(et)),jX=de(),Id=FX(),K1e=lN(),qX=$X(),YX={requireParentSpan:!0},dN=class extends cS.InstrumentationBase{constructor(e={}){super(qX.PACKAGE_NAME,qX.PACKAGE_VERSION,Object.assign(Object.assign({},YX),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},YX),e))}init(){return[new cS.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,cS.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,cS.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||K1e.defaultDbStatementSerializer,a=Vs.trace.getSpan(Vs.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c=r.tracer.startSpan(o.name,{kind:Vs.SpanKind.CLIENT,attributes:{[Zn.SEMATTRS_DB_SYSTEM]:Zn.DBSYSTEMVALUES_REDIS,[Zn.SEMATTRS_DB_STATEMENT]:i(o.name,o.args)}}),{requestHook:u}=s;u&&(0,jX.safeExecuteInTheMiddle)(()=>u(c,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),p=>{p&&Vs.diag.error("ioredis instrumentation: request hook failed",p)},!0);let{host:l,port:d}=this.options;c.setAttributes({[Zn.SEMATTRS_NET_PEER_NAME]:l,[Zn.SEMATTRS_NET_PEER_PORT]:d,[Zn.SEMATTRS_DB_CONNECTION_STRING]:`redis://${l}:${d}`});try{let p=e.apply(this,arguments),_=o.resolve;o.resolve=function(E){(0,jX.safeExecuteInTheMiddle)(()=>{var S;return(S=s.responseHook)===null||S===void 0?void 0:S.call(s,c,o.name,o.args,E)},S=>{S&&Vs.diag.error("ioredis instrumentation: response hook failed",S)},!0),(0,Id.endSpan)(c,null),_(E)};let f=o.reject;return o.reject=function(E){(0,Id.endSpan)(c,E),f(E)},p}catch(p){throw(0,Id.endSpan)(c,p),p}}}_traceConnection(e){let n=this;return function(){let r=Vs.trace.getSpan(Vs.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o=n.tracer.startSpan("connect",{kind:Vs.SpanKind.CLIENT,attributes:{[Zn.SEMATTRS_DB_SYSTEM]:Zn.DBSYSTEMVALUES_REDIS,[Zn.SEMATTRS_DB_STATEMENT]:"connect"}}),{host:s,port:i}=this.options;o.setAttributes({[Zn.SEMATTRS_NET_PEER_NAME]:s,[Zn.SEMATTRS_NET_PEER_PORT]:i,[Zn.SEMATTRS_DB_CONNECTION_STRING]:`redis://${s}:${i}`});try{let a=e.apply(this,arguments);return(0,Id.endSpan)(o,null),a}catch(a){throw(0,Id.endSpan)(o,a),a}}}};uS.IORedisInstrumentation=dN});var zX=m(WX=>{"use strict";Object.defineProperty(WX,"__esModule",{value:!0})});var JX=m(Bs=>{"use strict";var W1e=Bs&&Bs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),XX=Bs&&Bs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&W1e(e,t,n)};Object.defineProperty(Bs,"__esModule",{value:!0});XX(KX(),Bs);XX(zX(),Bs)});var ZX=m(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});lS.getClientAttributes=void 0;var Pd=(Re(),I(et));function z1e(t,e){var n,r;return{[Pd.SEMATTRS_DB_SYSTEM]:Pd.DBSYSTEMVALUES_REDIS,[Pd.SEMATTRS_NET_PEER_NAME]:(n=e?.socket)===null||n===void 0?void 0:n.host,[Pd.SEMATTRS_NET_PEER_PORT]:(r=e?.socket)===null||r===void 0?void 0:r.port,[Pd.SEMATTRS_DB_CONNECTION_STRING]:X1e(t,e?.url)}}lS.getClientAttributes=z1e;function X1e(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var QX=m(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.PACKAGE_NAME=uu.PACKAGE_VERSION=void 0;uu.PACKAGE_VERSION="0.46.1";uu.PACKAGE_NAME="@opentelemetry/instrumentation-redis-4"});var o9=m(pS=>{"use strict";Object.defineProperty(pS,"__esModule",{value:!0});pS.RedisInstrumentation=void 0;var Qn=(L(),I(V)),Nt=de(),e9=ZX(),J1e=lN(),t9=QX(),Z1e=(Re(),I(et)),bd=Symbol("opentelemetry.instrumentation.redis.open_spans"),n9=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),r9={requireParentSpan:!1},dS=class t extends Nt.InstrumentationBase{constructor(e={}){super(t9.PACKAGE_NAME,t9.PACKAGE_VERSION,Object.assign(Object.assign({},r9),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},r9),e))}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Nt.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,Nt.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,Nt.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0"],s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;return(0,Nt.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec()),(0,Nt.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;(0,Nt.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,Nt.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0"],s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;return a?.multi&&((0,Nt.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,Nt.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,Nt.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),s},s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;(0,Nt.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,Nt.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,Nt.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new Nt.InstrumentationNodeModuleDefinition(e,["^1.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){var a;if(((a=i?.BaseClass)===null||a===void 0?void 0:a.name)!=="RedisClient")return o.apply(this,arguments);let c=i.executor;return i.executor=function(u,l){let d=e(u,l).args;return n._traceClientCommand(c,this,arguments,d)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(){let e=this;return function(r){return function(){let s=r.apply(this,arguments);return typeof s?.then!="function"?(e._diag.error("got non promise result when patching RedisClientMultiCommand.exec"),s):s.then(i=>{let a=this[bd];return e._endSpansWithRedisReplies(a,i),i}).catch(i=>{let a=this[bd];if(!a)e._diag.error("cannot find open spans to end for redis multi command");else{let c=i.constructor.name==="MultiErrorReply"?i.replies:new Array(a.length).fill(i);e._endSpansWithRedisReplies(a,c)}return Promise.reject(i)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[n9]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,e9.getClientAttributes)(e._diag,s),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:Qn.SpanKind.CLIENT,attributes:i});return Qn.context.with(Qn.trace.setSpan(Qn.context.active(),a),()=>r.apply(this)).then(u=>(a.end(),u)).catch(u=>(a.recordException(u),a.setStatus({code:Qn.SpanStatusCode.ERROR,message:u.message}),a.end(),Promise.reject(u)))}}}_traceClientCommand(e,n,r,o){if(Qn.trace.getSpan(Qn.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[n9],a=o[0],c=o.slice(1),u=this.getConfig().dbStatementSerializer||J1e.defaultDbStatementSerializer,l=(0,e9.getClientAttributes)(this._diag,i);try{let _=u(a,c);_!=null&&(l[Z1e.SEMATTRS_DB_STATEMENT]=_)}catch(_){this._diag.error("dbStatementSerializer throw an exception",_,{commandName:a})}let d=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:Qn.SpanKind.CLIENT,attributes:l}),p=Qn.context.with(Qn.trace.setSpan(Qn.context.active(),d),()=>e.apply(n,r));if(typeof p?.then=="function")p.then(_=>{this._endSpanWithResponse(d,a,c,_,void 0)},_=>{this._endSpanWithResponse(d,a,c,null,_)});else{let _=p;_[bd]=_[bd]||[],_[bd].push({span:d,commandName:a,commandArgs:c})}return p}_endSpansWithRedisReplies(e,n){if(!e)return this._diag.error("cannot find open spans to end for redis multi command");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");for(let r=0;r<e.length;r++){let{span:o,commandName:s,commandArgs:i}=e[r],a=n[r],[c,u]=a instanceof Error?[null,a]:[a,void 0];this._endSpanWithResponse(o,s,i,c,u)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:Qn.SpanStatusCode.ERROR,message:s?.message})),e.end()}};pS.RedisInstrumentation=dS;dS.COMPONENT="redis"});var i9=m(s9=>{"use strict";Object.defineProperty(s9,"__esModule",{value:!0})});var c9=m(Gs=>{"use strict";var Q1e=Gs&&Gs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),a9=Gs&&Gs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Q1e(e,t,n)};Object.defineProperty(Gs,"__esModule",{value:!0});a9(o9(),Gs);a9(i9(),Gs)});var g9=m(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});_S.EVENT_LISTENERS_SET=void 0;_S.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var mN=m(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.AttributeNames=void 0;var ike;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(ike=Ld.AttributeNames||(Ld.AttributeNames={}))});var EN=m(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.METRIC_DB_CLIENT_OPERATION_DURATION=ot.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=ot.METRIC_DB_CLIENT_CONNECTION_COUNT=ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED=ot.ATTR_DB_OPERATION_NAME=ot.ATTR_DB_NAMESPACE=ot.ATTR_DB_CLIENT_CONNECTION_STATE=ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";ot.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";ot.ATTR_DB_NAMESPACE="db.namespace";ot.ATTR_DB_OPERATION_NAME="db.operation.name";ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";ot.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";ot.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests";ot.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration"});var SN=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.SpanNames=void 0;var ake;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(ake=xd.SpanNames||(xd.SpanNames={}))});var C9=m(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.isObjectWithTextString=Se.getErrorMessage=Se.patchClientConnectCallback=Se.patchCallbackPGPool=Se.updateCounter=Se.getPoolName=Se.patchCallback=Se.handleExecutionResult=Se.handleConfigQuery=Se.shouldSkipInstrumentation=Se.getSemanticAttributesFromPool=Se.getSemanticAttributesFromConnection=Se.getConnectionString=Se.parseNormalizedOperationName=Se.getQuerySpanName=void 0;var Hs=(L(),I(V)),fS=mN(),Wt=(Re(),I(et)),ra=EN(),cke=de(),h9=SN();function A9(t,e){if(!e)return h9.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:R9(e.text);return`${h9.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Se.getQuerySpanName=A9;function R9(t){let e=t.indexOf(" "),n=e===-1?t:t.slice(0,e);return n=n.toUpperCase(),n.endsWith(";")?n.slice(0,-1):n}Se.parseNormalizedOperationName=R9;function TN(t){let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Se.getConnectionString=TN;function y9(t){if(Number.isInteger(t))return t}function O9(t){return{[Wt.SEMATTRS_DB_SYSTEM]:Wt.DBSYSTEMVALUES_POSTGRESQL,[Wt.SEMATTRS_DB_NAME]:t.database,[Wt.SEMATTRS_DB_CONNECTION_STRING]:TN(t),[Wt.SEMATTRS_NET_PEER_NAME]:t.host,[Wt.SEMATTRS_NET_PEER_PORT]:y9(t.port),[Wt.SEMATTRS_DB_USER]:t.user}}Se.getSemanticAttributesFromConnection=O9;function uke(t){return{[Wt.SEMATTRS_DB_SYSTEM]:Wt.DBSYSTEMVALUES_POSTGRESQL,[Wt.SEMATTRS_DB_NAME]:t.database,[Wt.SEMATTRS_DB_CONNECTION_STRING]:TN(t),[Wt.SEMATTRS_NET_PEER_NAME]:t.host,[Wt.SEMATTRS_NET_PEER_PORT]:y9(t.port),[Wt.SEMATTRS_DB_USER]:t.user,[fS.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[fS.AttributeNames.MAX_CLIENT]:t.maxClient}}Se.getSemanticAttributesFromPool=uke;function lke(t){return t.requireParentSpan===!0&&Hs.trace.getSpan(Hs.context.active())===void 0}Se.shouldSkipInstrumentation=lke;function dke(t,e,n){let{connectionParameters:r}=this,o=r.database,s=A9(o,n),i=t.startSpan(s,{kind:Hs.SpanKind.CLIENT,attributes:O9(r)});if(!n)return i;if(n.text&&i.setAttribute(Wt.SEMATTRS_DB_STATEMENT,n.text),e.enhancedDatabaseReporting&&Array.isArray(n.values))try{let a=n.values.map(c=>c==null?"null":c instanceof Buffer?c.toString():typeof c=="object"?typeof c.toPostgres=="function"?c.toPostgres():JSON.stringify(c):c.toString());i.setAttribute(fS.AttributeNames.PG_VALUES,a)}catch(a){Hs.diag.error("failed to stringify ",n.values,a)}return typeof n.name=="string"&&i.setAttribute(fS.AttributeNames.PG_PLAN,n.name),i}Se.handleConfigQuery=dke;function N9(t,e,n){typeof t.responseHook=="function"&&(0,cke.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&Hs.diag.error("Error running response hook",r)},!0)}Se.handleExecutionResult=N9;function pke(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Wt.ATTR_ERROR_TYPE]=i.code),e.setStatus({code:Hs.SpanStatusCode.ERROR,message:i.message})):N9(t,e,a),o(),e.end(),n.call(this,i,a)}}Se.patchCallback=pke;function _ke(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Se.getPoolName=_ke;function fke(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[ra.ATTR_DB_CLIENT_CONNECTION_STATE]:ra.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[ra.ATTR_DB_CLIENT_CONNECTION_STATE]:ra.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Se.updateCounter=fke;function mke(t,e){return function(r,o,s){r&&t.setStatus({code:Hs.SpanStatusCode.ERROR,message:r.message}),t.end(),e.call(this,r,o,s)}}Se.patchCallbackPGPool=mke;function Eke(t,e){return function(r){r&&t.setStatus({code:Hs.SpanStatusCode.ERROR,message:r.message}),t.end(),e.apply(this,arguments)}}Se.patchClientConnectCallback=Eke;function Ske(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Se.getErrorMessage=Ske;function Tke(t){var e;return typeof t=="object"&&typeof((e=t)===null||e===void 0?void 0:e.text)=="string"}Se.isObjectWithTextString=Tke});var v9=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.PACKAGE_NAME=lu.PACKAGE_VERSION=void 0;lu.PACKAGE_VERSION="0.51.1";lu.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var x9=m(SS=>{"use strict";Object.defineProperty(SS,"__esModule",{value:!0});SS.PgInstrumentation=void 0;var er=de(),ye=(L(),I(V)),I9=g9(),st=C9(),P9=aN(),b9=v9(),M9=SN(),mS=fe(),Fs=(Re(),I(et)),oa=EN();function ES(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var gN=class extends er.InstrumentationBase{constructor(e={}){super(b9.PACKAGE_NAME,b9.PACKAGE_VERSION,e),this._connectionsCounter={used:0,idle:0,pending:0}}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(oa.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:ye.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(oa.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(oa.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=new er.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),r=new er.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new er.InstrumentationNodeModuleDefinition("pg",e,i=>{let a=ES(i);return this._patchPgClient(a.Client),i},i=>{let a=ES(i);return this._unpatchPgClient(a.Client),i},[r,n]),s=new er.InstrumentationNodeModuleDefinition("pg-pool",[">=2.0.0 <4"],i=>((0,er.isWrapped)(i.prototype.connect)&&this._unwrap(i.prototype,"connect"),this._wrap(i.prototype,"connect",this._getPoolConnectPatch()),i),i=>{(0,er.isWrapped)(i.prototype.connect)&&this._unwrap(i.prototype,"connect")});return[o,s]}_patchPgClient(e){if(!e)return;let n=ES(e);return(0,er.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,er.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=ES(e);return(0,er.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,er.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.call(this,o);let s=e.tracer.startSpan(M9.SpanNames.CONNECT,{kind:ye.SpanKind.CLIENT,attributes:st.getSemanticAttributesFromConnection(this)});if(o){let a=ye.trace.getSpan(ye.context.active());o=st.patchClientConnectCallback(s,o),a&&(o=ye.context.bind(ye.context.active(),o))}let i=ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>n.call(this,o));return L9(s,i)}}recordOperationDuration(e,n){let r={};[Fs.SEMATTRS_DB_SYSTEM,oa.ATTR_DB_NAMESPACE,Fs.ATTR_ERROR_TYPE,Fs.ATTR_SERVER_PORT,Fs.ATTR_SERVER_ADDRESS,oa.ATTR_DB_OPERATION_NAME].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,mS.hrTimeToMilliseconds)((0,mS.hrTimeDuration)(n,(0,mS.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,mS.hrTime)(),i=o[0],a=typeof i=="string",c=st.isObjectWithTextString(i),u=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?i:void 0,l={[Fs.SEMATTRS_DB_SYSTEM]:Fs.DBSYSTEMVALUES_POSTGRESQL,[oa.ATTR_DB_NAMESPACE]:this.database,[Fs.ATTR_SERVER_PORT]:this.connectionParameters.port,[Fs.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};u?.text&&(l[oa.ATTR_DB_OPERATION_NAME]=st.parseNormalizedOperationName(u?.text));let d=()=>{e.recordOperationDuration(l,s)},p=e.getConfig(),_=st.handleConfigQuery.call(this,e.tracer,p,u);if(p.addSqlCommenterCommentToQueries&&(a?o[0]=(0,P9.addSqlCommenterComment)(_,i):c&&!("name"in i)&&(o[0]=Object.assign(Object.assign({},i),{text:(0,P9.addSqlCommenterComment)(_,i.text)}))),o.length>0){let S=ye.trace.getSpan(ye.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=st.patchCallback(p,_,o[o.length-1],l,d),S&&(o[o.length-1]=ye.context.bind(ye.context.active(),o[o.length-1]));else if(typeof u?.callback=="function"){let g=st.patchCallback(e.getConfig(),_,u.callback,l,d);S&&(g=ye.context.bind(ye.context.active(),g)),o[0].callback=g}}let{requestHook:f}=p;typeof f=="function"&&u&&(0,er.safeExecuteInTheMiddle)(()=>{let{database:S,host:g,port:h,user:O}=this.connectionParameters;f(_,{connection:{database:S,host:g,port:h,user:O},query:{text:u.text,values:u.values,name:u.name}})},S=>{S&&e._diag.error("Error running query hook",S)},!0);let E;try{E=n.apply(this,o)}catch(S){throw _.setStatus({code:ye.SpanStatusCode.ERROR,message:st.getErrorMessage(S)}),_.end(),S}return E instanceof Promise?E.then(S=>new Promise(g=>{st.handleExecutionResult(e.getConfig(),_,S),d(),_.end(),g(S)})).catch(S=>new Promise((g,h)=>{_.setStatus({code:ye.SpanStatusCode.ERROR,message:S.message}),d(),_.end(),h(S)})):E})}_setPoolConnectEventListeners(e){if(e[I9.EVENT_LISTENERS_SET])return;let n=st.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[I9.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.call(this,o);let s=e.tracer.startSpan(M9.SpanNames.POOL_CONNECT,{kind:ye.SpanKind.CLIENT,attributes:st.getSemanticAttributesFromPool(this.options)});if(e._setPoolConnectEventListeners(this),o){let a=ye.trace.getSpan(ye.context.active());o=st.patchCallbackPGPool(s,o),a&&(o=ye.context.bind(ye.context.active(),o))}let i=ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>n.call(this,o));return L9(s,i)}}};SS.PgInstrumentation=gN;function L9(t,e){if(!(e instanceof Promise))return e;let n=e;return ye.context.bind(ye.context.active(),n.then(r=>(t.end(),r)).catch(r=>(t.setStatus({code:ye.SpanStatusCode.ERROR,message:st.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var U9=m(D9=>{"use strict";Object.defineProperty(D9,"__esModule",{value:!0})});var w9=m(ko=>{"use strict";var gke=ko&&ko.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),hN=ko&&ko.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&gke(e,t,n)};Object.defineProperty(ko,"__esModule",{value:!0});hN(x9(),ko);hN(U9(),ko);hN(mN(),ko)});var Q9=m(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.PACKAGE_NAME=du.PACKAGE_VERSION=void 0;du.PACKAGE_VERSION="0.45.2";du.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var CN=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.HapiLifecycleMethodNames=ro.HapiLayerType=ro.handlerPatched=ro.HapiComponentName=void 0;ro.HapiComponentName="@hapi/hapi";ro.handlerPatched=Symbol("hapi-handler-patched");ro.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ro.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var vN=m(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AttributeNames=void 0;var Lke;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(Lke=Dd.AttributeNames||(Dd.AttributeNames={}))});var e8=m(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.getPluginFromInput=it.getExtMetadata=it.getRouteMetadata=it.isPatchableExtMethod=it.isDirectExtInput=it.isLifecycleExtEventObj=it.isLifecycleExtType=it.getPluginName=void 0;var gS=(Re(),I(et)),Ud=CN(),$s=vN();function xke(t){return t.name?t.name:t.pkg.name}it.getPluginName=xke;var Dke=t=>typeof t=="string"&&Ud.HapiLifecycleMethodNames.has(t);it.isLifecycleExtType=Dke;var Uke=t=>{var e;let n=(e=t)===null||e===void 0?void 0:e.type;return n!==void 0&&(0,it.isLifecycleExtType)(n)};it.isLifecycleExtEventObj=Uke;var wke=t=>Array.isArray(t)&&t.length<=3&&(0,it.isLifecycleExtType)(t[0])&&typeof t[1]=="function";it.isDirectExtInput=wke;var kke=t=>!Array.isArray(t);it.isPatchableExtMethod=kke;var Vke=(t,e)=>e?{attributes:{[gS.SEMATTRS_HTTP_ROUTE]:t.path,[gS.SEMATTRS_HTTP_METHOD]:t.method,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.PLUGIN,[$s.AttributeNames.PLUGIN_NAME]:e},name:`${e}: route - ${t.path}`}:{attributes:{[gS.SEMATTRS_HTTP_ROUTE]:t.path,[gS.SEMATTRS_HTTP_METHOD]:t.method,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.ROUTER},name:`route - ${t.path}`};it.getRouteMetadata=Vke;var Bke=(t,e)=>e?{attributes:{[$s.AttributeNames.EXT_TYPE]:t,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT,[$s.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[$s.AttributeNames.EXT_TYPE]:t,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT},name:`ext - ${t}`};it.getExtMetadata=Bke;var Gke=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;it.getPluginFromInput=Gke});var r8=m(AS=>{"use strict";Object.defineProperty(AS,"__esModule",{value:!0});AS.HapiInstrumentation=void 0;var bn=(L(),I(V)),t8=fe(),hS=de(),n8=Q9(),wd=CN(),Bo=e8(),IN=class extends hS.InstrumentationBase{constructor(e={}){super(n8.PACKAGE_NAME,n8.PACKAGE_VERSION,e)}init(){return new hS.InstrumentationNodeModuleDefinition(wd.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,hS.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,hS.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Bo.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Bo.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Bo.isLifecycleExtType)(c.type)){let u=c,l=r._wrapExtMethods(u.method,c.type,n);u.method=l,i[a]=u}}return e.apply(this,s)}else if((0,Bo.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Bo.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Bo.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",u=>n._getServerRoutePatch.bind(n)(u,r)),s._wrap(a,"ext",u=>n._getServerExtPatch.bind(n)(u,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Bo.isPatchableExtMethod)(e))return e[wd.handlerPatched]===!0?e:(e[wd.handlerPatched]=!0,async function(...i){if(bn.trace.getSpan(bn.context.active())===void 0)return await e.apply(this,i);let a=(0,Bo.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await bn.context.with(bn.trace.setSpan(bn.context.active(),c),e,void 0,...i)}catch(u){throw c.recordException(u),c.setStatus({code:bn.SpanStatusCode.ERROR,message:u.message}),u}finally{c.end()}});return e}_wrapRouteHandler(e,n){var r;let o=this;if(e[wd.handlerPatched]===!0)return e;e[wd.handlerPatched]=!0;let s=i=>async function(...a){if(bn.trace.getSpan(bn.context.active())===void 0)return await i.call(this,...a);let c=(0,t8.getRPCMetadata)(bn.context.active());c?.type===t8.RPCType.HTTP&&(c.route=e.path);let u=(0,Bo.getRouteMetadata)(e,n),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await bn.context.with(bn.trace.setSpan(bn.context.active(),l),()=>i.call(this,...a))}catch(d){throw l.recordException(d),l.setStatus({code:bn.SpanStatusCode.ERROR,message:d.message}),d}finally{l.end()}};if(typeof e.handler=="function")e.handler=s(e.handler);else if(typeof e.options=="function"){let i=e.options;e.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=s(c.handler)),c}}else typeof((r=e.options)===null||r===void 0?void 0:r.handler)=="function"&&(e.options.handler=s(e.options.handler));return e}};AS.HapiInstrumentation=IN});var s8=m(js=>{"use strict";var Hke=js&&js.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),o8=js&&js.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Hke(e,t,n)};Object.defineProperty(js,"__esModule",{value:!0});o8(r8(),js);o8(vN(),js)});var RS=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.KoaLayerType=void 0;var $ke;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})($ke=kd.KoaLayerType||(kd.KoaLayerType={}))});var l8=m(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.PACKAGE_NAME=pu.PACKAGE_VERSION=void 0;pu.PACKAGE_VERSION="0.47.1";pu.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var PN=m(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.AttributeNames=void 0;var jke;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(jke=Vd.AttributeNames||(Vd.AttributeNames={}))});var p8=m(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.isLayerIgnored=_u.getMiddlewareMetadata=void 0;var d8=RS(),yS=PN(),qke=(Re(),I(et)),Yke=(t,e,n,r)=>{var o;return n?{attributes:{[yS.AttributeNames.KOA_NAME]:r?.toString(),[yS.AttributeNames.KOA_TYPE]:d8.KoaLayerType.ROUTER,[qke.SEMATTRS_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[yS.AttributeNames.KOA_NAME]:(o=e.name)!==null&&o!==void 0?o:"middleware",[yS.AttributeNames.KOA_TYPE]:d8.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};_u.getMiddlewareMetadata=Yke;var Kke=(t,e)=>{var n;return!!(Array.isArray(e?.ignoreLayersType)&&(!((n=e?.ignoreLayersType)===null||n===void 0)&&n.includes(t)))};_u.isLayerIgnored=Kke});var _8=m(OS=>{"use strict";Object.defineProperty(OS,"__esModule",{value:!0});OS.kLayerPatched=void 0;OS.kLayerPatched=Symbol("koa-layer-patched")});var g8=m(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});NS.KoaInstrumentation=void 0;var oo=(L(),I(V)),Bd=de(),f8=RS(),m8=l8(),E8=p8(),S8=fe(),T8=_8(),bN=class extends Bd.InstrumentationBase{constructor(e={}){super(m8.PACKAGE_NAME,m8.PACKAGE_VERSION,e)}init(){return new Bd.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <3"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Bd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Bd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){var n;oo.diag.debug("Patching @koa/router dispatch");let r=e.router,o=(n=r?.stack)!==null&&n!==void 0?n:[];for(let s of o){let i=s.path,a=s.stack;for(let c=0;c<a.length;c++){let u=a[c];a[c]=this._patchLayer(u,!0,i)}}return e}_patchLayer(e,n,r){let o=n?f8.KoaLayerType.ROUTER:f8.KoaLayerType.MIDDLEWARE;return e[T8.kLayerPatched]===!0||(0,E8.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(oo.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[T8.kLayerPatched]=!0,oo.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(oo.trace.getSpan(oo.context.active())===void 0)return e(s,i);let c=(0,E8.getMiddlewareMetadata)(s,e,n,r),u=this.tracer.startSpan(c.name,{attributes:c.attributes}),l=(0,S8.getRPCMetadata)(oo.context.active());l?.type===S8.RPCType.HTTP&&s._matchedRoute&&(l.route=s._matchedRoute.toString());let{requestHook:d}=this.getConfig();d&&(0,Bd.safeExecuteInTheMiddle)(()=>d(u,{context:s,middlewareLayer:e,layerType:o}),_=>{_&&oo.diag.error("koa instrumentation: request hook failed",_)},!0);let p=oo.trace.setSpan(oo.context.active(),u);return oo.context.with(p,async()=>{try{return await e(s,i)}catch(_){throw u.recordException(_),_}finally{u.end()}})})}};NS.KoaInstrumentation=bN});var h8=m(Go=>{"use strict";var Wke=Go&&Go.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),MN=Go&&Go.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Wke(e,t,n)};Object.defineProperty(Go,"__esModule",{value:!0});MN(g8(),Go);MN(RS(),Go);MN(PN(),Go)});var LN=m(Ar=>{"use strict";Object.defineProperty(Ar,"__esModule",{value:!0});Ar.ConnectNames=Ar.ConnectTypes=Ar.AttributeNames=void 0;var Xke;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(Xke=Ar.AttributeNames||(Ar.AttributeNames={}));var Jke;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(Jke=Ar.ConnectTypes||(Ar.ConnectTypes={}));var Zke;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(Zke=Ar.ConnectNames||(Ar.ConnectNames={}))});var N8=m(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.PACKAGE_NAME=fu.PACKAGE_VERSION=void 0;fu.PACKAGE_VERSION="0.43.1";fu.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var C8=m(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});CS._LAYERS_STORE_PROPERTY=void 0;CS._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var v8=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.generateRoute=Ys.replaceCurrentStackRoute=Ys.addNewStackLayer=void 0;var Qke=(L(),I(V)),qs=C8(),eVe=t=>{Array.isArray(t[qs._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,qs._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[qs._LAYERS_STORE_PROPERTY].push("/");let e=t[qs._LAYERS_STORE_PROPERTY].length;return()=>{e===t[qs._LAYERS_STORE_PROPERTY].length?t[qs._LAYERS_STORE_PROPERTY].pop():Qke.diag.warn("Connect: Trying to pop the stack multiple time")}};Ys.addNewStackLayer=eVe;var tVe=(t,e)=>{e&&t[qs._LAYERS_STORE_PROPERTY].splice(-1,1,e)};Ys.replaceCurrentStackRoute=tVe;var nVe=t=>t[qs._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);Ys.generateRoute=nVe});var b8=m(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ConnectInstrumentation=Ks.ANONYMOUS_NAME=void 0;var rVe=(L(),I(V)),I8=fe(),mu=LN(),P8=N8(),vS=de(),oVe=(Re(),I(et)),xN=v8();Ks.ANONYMOUS_NAME="anonymous";var DN=class extends vS.InstrumentationBase{constructor(e={}){super(P8.PACKAGE_NAME,P8.PACKAGE_VERSION,e)}init(){return[new vS.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,vS.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,vS.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=mu.ConnectTypes.REQUEST_HANDLER,s=mu.ConnectNames.REQUEST_HANDLER,o=e):(r=mu.ConnectTypes.MIDDLEWARE,s=mu.ConnectNames.MIDDLEWARE,o=n.name||Ks.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[oVe.SEMATTRS_HTTP_ROUTE]:e.length>0?e:"/",[mu.AttributeNames.CONNECT_TYPE]:r,[mu.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],u=arguments[i],l=arguments[a],d=arguments[c];(0,xN.replaceCurrentStackRoute)(u,e);let p=(0,I8.getRPCMetadata)(rVe.context.active());e&&p?.type===I8.RPCType.HTTP&&(p.route=(0,xN.generateRoute)(u));let _="";e?_=`request handler - ${e}`:_=`middleware - ${n.name||Ks.ANONYMOUS_NAME}`;let f=r._startSpan(e,n);r._diag.debug("start span",_);let E=!1;function S(){E?r._diag.debug(`span ${f.name} - already finished`):(E=!0,r._diag.debug(`finishing span ${f.name}`),f.end()),l.removeListener("close",S)}return l.addListener("close",S),arguments[c]=r._patchNext(d,S),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,xN.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};Ks.ConnectInstrumentation=DN});var L8=m(Ws=>{"use strict";var sVe=Ws&&Ws.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),M8=Ws&&Ws.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&sVe(e,t,n)};Object.defineProperty(Ws,"__esModule",{value:!0});M8(LN(),Ws);M8(b8(),Ws)});var k8=m(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.once=Eu.getSpanName=void 0;function aVe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}Eu.getSpanName=aVe;var cVe=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Eu.once=cVe});var V8=m(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.PACKAGE_NAME=Su.PACKAGE_VERSION=void 0;Su.PACKAGE_VERSION="0.18.1";Su.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var $8=m(MS=>{"use strict";Object.defineProperty(MS,"__esModule",{value:!0});MS.TediousInstrumentation=void 0;var Gd=(L(),I(V)),uVe=require("events"),IS=de(),zs=(Re(),I(et)),B8=k8(),G8=V8(),F8=Symbol("opentelemetry.instrumentation-tedious.current-database"),H8=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function PS(t){Object.defineProperty(this,F8,{value:t,writable:!0})}var bS=class t extends IS.InstrumentationBase{constructor(e={}){super(G8.PACKAGE_NAME,G8.PACKAGE_VERSION,e)}init(){return[new IS.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of H8)(0,IS.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r));return(0,IS.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of H8)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){var r,o;return PS.call(this,(o=(r=this.config)===null||r===void 0?void 0:r.options)===null||o===void 0?void 0:o.database),this.removeListener("databaseChange",PS),this.on("databaseChange",PS),this.once("end",()=>{this.removeListener("databaseChange",PS)}),e.apply(this,arguments)}}_patchQuery(e){return n=>{let r=this;function o(s){var i,a,c,u,l,d,p,_;if(!(s instanceof uVe.EventEmitter))return r._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),n.apply(this,arguments);let f=0,E=0,S=()=>E++,g=()=>f++,h=this[F8],O=(M=>{var P,J;return M.sqlTextOrProcedure==="sp_prepare"&&(!((J=(P=M.parametersByName)===null||P===void 0?void 0:P.stmt)===null||J===void 0)&&J.value)?M.parametersByName.stmt.value:M.sqlTextOrProcedure})(s),N=r.tracer.startSpan((0,B8.getSpanName)(e,h,O,s.table),{kind:Gd.SpanKind.CLIENT,attributes:{[zs.SEMATTRS_DB_SYSTEM]:zs.DBSYSTEMVALUES_MSSQL,[zs.SEMATTRS_DB_NAME]:h,[zs.SEMATTRS_NET_PEER_PORT]:(a=(i=this.config)===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.port,[zs.SEMATTRS_NET_PEER_NAME]:(c=this.config)===null||c===void 0?void 0:c.server,[zs.SEMATTRS_DB_USER]:(l=(u=this.config)===null||u===void 0?void 0:u.userName)!==null&&l!==void 0?l:(_=(p=(d=this.config)===null||d===void 0?void 0:d.authentication)===null||p===void 0?void 0:p.options)===null||_===void 0?void 0:_.userName,[zs.SEMATTRS_DB_STATEMENT]:O,[zs.SEMATTRS_DB_SQL_TABLE]:s.table}}),R=(0,B8.once)(M=>{s.removeListener("done",S),s.removeListener("doneInProc",S),s.removeListener("doneProc",g),s.removeListener("error",R),this.removeListener("end",R),N.setAttribute("tedious.procedure_count",f),N.setAttribute("tedious.statement_count",E),M&&N.setStatus({code:Gd.SpanStatusCode.ERROR,message:M.message}),N.end()});return s.on("done",S),s.on("doneInProc",S),s.on("doneProc",g),s.once("error",R),this.on("end",R),typeof s.callback=="function"?r._wrap(s,"callback",r._patchCallbackQuery(R)):r._diag.error("Expected request.callback to be a function"),Gd.context.with(Gd.trace.setSpan(Gd.context.active(),N),n,this,...arguments)}return Object.defineProperty(o,"length",{value:n.length,writable:!1}),o}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};MS.TediousInstrumentation=bS;bS.COMPONENT="tedious"});var q8=m(j8=>{"use strict";Object.defineProperty(j8,"__esModule",{value:!0})});var K8=m(Xs=>{"use strict";var lVe=Xs&&Xs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Y8=Xs&&Xs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&lVe(e,t,n)};Object.defineProperty(Xs,"__esModule",{value:!0});Y8($8(),Xs);Y8(q8(),Xs)});var Z8=m(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.PACKAGE_NAME=Tu.PACKAGE_VERSION=void 0;Tu.PACKAGE_VERSION="0.43.1";Tu.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var e6=m(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.GenericPoolInstrumentation=void 0;var gu=(L(),I(V)),sa=de(),Q8=Z8(),UN="generic-pool",wN=class extends sa.InstrumentationBase{constructor(e={}){super(Q8.PACKAGE_NAME,Q8.PACKAGE_VERSION,e),this._isDisabled=!1}init(){return[new sa.InstrumentationNodeModuleDefinition(UN,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,sa.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new sa.InstrumentationNodeModuleDefinition(UN,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,sa.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new sa.InstrumentationNodeModuleDefinition(UN,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,sa.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=gu.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return gu.context.with(gu.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=gu.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return gu.context.with(gu.trace.setSpan(i,a),()=>{e.call(this,(c,u)=>{if(a.end(),o)return o(c,u)},s)})}}};LS.GenericPoolInstrumentation=wN});var t6=m(ia=>{"use strict";var _Ve=ia&&ia.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),fVe=ia&&ia.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&_Ve(e,t,n)};Object.defineProperty(ia,"__esModule",{value:!0});fVe(e6(),ia)});var kN=m(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.DEFAULT_CONFIG=aa.EndOperation=void 0;var EVe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(EVe=aa.EndOperation||(aa.EndOperation={}));aa.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var u6=m(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isConfirmChannelTracing=je.unmarkConfirmChannelTracing=je.markConfirmChannelTracing=je.getConnectionAttributesFromUrl=je.getConnectionAttributesFromServer=je.normalizeExchange=je.CONNECTION_ATTRIBUTES=je.CHANNEL_CONSUME_TIMEOUT_TIMER=je.CHANNEL_SPANS_NOT_ENDED=je.MESSAGE_STORED_SPAN=void 0;var VN=(L(),I(V)),Ho=(Re(),I(et));je.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");je.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");je.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");je.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var BN=(0,VN.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),SVe=t=>t!==""?t:"<default>";je.normalizeExchange=SVe;var TVe=t=>t.replace(/:[^:@/]*@/,":***@"),i6=(t,e)=>t||(e==="AMQP"?5672:5671),a6=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},c6=t=>t||"localhost",hu=(t,e,n,r)=>n?{[e]:n}:(VN.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),gVe=t=>{var e,n;let r=(n=(e=t.serverProperties.product)===null||e===void 0?void 0:e.toLowerCase)===null||n===void 0?void 0:n.call(e);return r?{[Ho.SEMATTRS_MESSAGING_SYSTEM]:r}:{}};je.getConnectionAttributesFromServer=gVe;var hVe=t=>{let e={[Ho.SEMATTRS_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let n=t,r=a6(n?.protocol);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_MESSAGING_PROTOCOL,r,"protocol")));let o=c6(n?.hostname);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_NET_PEER_NAME,o,"hostname")));let s=i6(n.port,r);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_NET_PEER_PORT,s,"port")))}else{let n=TVe(t);e[Ho.SEMATTRS_MESSAGING_URL]=n;try{let r=new URL(n),o=a6(r.protocol);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_MESSAGING_PROTOCOL,o,"protocol")));let s=c6(r.hostname);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_NET_PEER_NAME,s,"hostname")));let i=i6(r.port?parseInt(r.port):void 0,o);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_NET_PEER_PORT,i,"port")))}catch(r){VN.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:n,err:r})}}return e};je.getConnectionAttributesFromUrl=hVe;var AVe=t=>t.setValue(BN,!0);je.markConfirmChannelTracing=AVe;var RVe=t=>t.deleteValue(BN);je.unmarkConfirmChannelTracing=RVe;var yVe=t=>t.getValue(BN)===!0;je.isConfirmChannelTracing=yVe});var l6=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.PACKAGE_NAME=Au.PACKAGE_VERSION=void 0;Au.PACKAGE_VERSION="0.46.1";Au.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var p6=m(US=>{"use strict";Object.defineProperty(US,"__esModule",{value:!0});US.AmqplibInstrumentation=void 0;var Ve=(L(),I(V)),xS=fe(),he=de(),hn=(Re(),I(et)),on=kN(),qe=u6(),d6=l6(),DS=[">=0.5.5 <1"],GN=class extends he.InstrumentationBase{constructor(e={}){super(d6.PACKAGE_NAME,d6.PACKAGE_VERSION,Object.assign(Object.assign({},on.DEFAULT_CONFIG),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},on.DEFAULT_CONFIG),e))}init(){let e=new he.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new he.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",DS,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new he.InstrumentationNodeModuleFile("amqplib/lib/connect.js",DS,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new he.InstrumentationNodeModuleDefinition("amqplib",DS,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,he.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,he.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,he.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,he.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,he.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,on.EndOperation.Ack)),(0,he.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,on.EndOperation.Nack)),(0,he.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,on.EndOperation.Reject)),(0,he.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,on.EndOperation.AckAll)),(0,he.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,on.EndOperation.NackAll)),(0,he.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,he.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,he.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,he.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,he.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,he.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,he.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,he.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,he.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,he.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,he.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){return function(r,o,s){return e.call(this,r,o,function(i,a){if(i==null){let c=(0,qe.getConnectionAttributesFromUrl)(r),u=(0,qe.getConnectionAttributesFromServer)(a);a[qe.CONNECTION_ATTRIBUTES]=Object.assign(Object.assign({},c),u)}s.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,on.EndOperation.ChannelClosed,void 0);let s=this[qe.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[qe.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,on.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){var u;let l=this,d=n===on.EndOperation.Reject?a:c,p=(u=l[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&u!==void 0?u:[],_=p.findIndex(f=>f.msg===i);if(_<0)o.endConsumerSpan(i,e,n,d);else if(n!==on.EndOperation.Reject&&a){for(let f=0;f<=_;f++)o.endConsumerSpan(p[f].msg,e,n,d);p.splice(0,_+1)}else o.endConsumerSpan(i,e,n,d),p.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,qe.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:l}=r.getConfig();if(l){let d=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},l);d.unref(),c[qe.CHANNEL_CONSUME_TIMEOUT_TIMER]=d}c[qe.CHANNEL_SPANS_NOT_ENDED]=[]}let u=function(l){var d,p,_,f,E;if(!l)return i.call(this,l);let S=(d=l.properties.headers)!==null&&d!==void 0?d:{},g=Ve.propagation.extract(Ve.ROOT_CONTEXT,S),h=(p=l.fields)===null||p===void 0?void 0:p.exchange,O;if(r._config.useLinksForConsume){let P=g?(_=Ve.trace.getSpan(g))===null||_===void 0?void 0:_.spanContext():void 0;g=void 0,P&&(O=[{context:P}])}let N=r.tracer.startSpan(`${s} process`,{kind:Ve.SpanKind.CONSUMER,attributes:Object.assign(Object.assign({},(f=c?.connection)===null||f===void 0?void 0:f[qe.CONNECTION_ATTRIBUTES]),{[hn.SEMATTRS_MESSAGING_DESTINATION]:h,[hn.SEMATTRS_MESSAGING_DESTINATION_KIND]:hn.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[hn.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:(E=l.fields)===null||E===void 0?void 0:E.routingKey,[hn.SEMATTRS_MESSAGING_OPERATION]:hn.MESSAGINGOPERATIONVALUES_PROCESS,[hn.SEMATTRS_MESSAGING_MESSAGE_ID]:l?.properties.messageId,[hn.SEMATTRS_MESSAGING_CONVERSATION_ID]:l?.properties.correlationId}),links:O},g),{consumeHook:R}=r.getConfig();R&&(0,he.safeExecuteInTheMiddle)(()=>R(N,{moduleVersion:e,msg:l}),P=>{P&&Ve.diag.error("amqplib instrumentation: consumerHook error",P)},!0),a?.noAck||(c[qe.CHANNEL_SPANS_NOT_ENDED].push({msg:l,timeOfConsume:(0,xS.hrTime)()}),l[qe.MESSAGE_STORED_SPAN]=N);let M=g||Ve.ROOT_CONTEXT;Ve.context.with(Ve.trace.setSpan(M,N),()=>{i.call(this,l)}),a?.noAck&&(r.callConsumeEndHook(N,l,!1,on.EndOperation.AutoAck),N.end())};return arguments[1]=u,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,u){let l=this,{span:d,modifiedOptions:p}=r.createPublishSpan(r,s,i,l,c),{publishHook:_}=r.getConfig();_&&(0,he.safeExecuteInTheMiddle)(()=>_(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:p,isConfirmChannel:!0}),g=>{g&&Ve.diag.error("amqplib instrumentation: publishHook error",g)},!0);let f=function(g,h){try{u?.call(this,g,h)}finally{let{publishConfirmHook:O}=r.getConfig();O&&(0,he.safeExecuteInTheMiddle)(()=>O(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:g}),N=>{N&&Ve.diag.error("amqplib instrumentation: publishConfirmHook error",N)},!0),g&&d.setStatus({code:Ve.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),d.end()}},E=(0,qe.markConfirmChannelTracing)(Ve.context.active()),S=[...arguments];return S[3]=p,S[4]=Ve.context.bind((0,qe.unmarkConfirmChannelTracing)(Ve.trace.setSpan(E,d)),f),Ve.context.with(E,n.bind(this,...S))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,qe.isConfirmChannelTracing)(Ve.context.active()))return n.apply(this,arguments);{let u=this,{span:l,modifiedOptions:d}=r.createPublishSpan(r,s,i,u,c),{publishHook:p}=r.getConfig();p&&(0,he.safeExecuteInTheMiddle)(()=>p(l,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:d,isConfirmChannel:!1}),E=>{E&&Ve.diag.error("amqplib instrumentation: publishHook error",E)},!0);let _=[...arguments];_[3]=d;let f=n.apply(this,_);return l.end(),f}}}createPublishSpan(e,n,r,o,s){var i;let a=(0,qe.normalizeExchange)(n),c=e.tracer.startSpan(`publish ${a}`,{kind:Ve.SpanKind.PRODUCER,attributes:Object.assign(Object.assign({},o.connection[qe.CONNECTION_ATTRIBUTES]),{[hn.SEMATTRS_MESSAGING_DESTINATION]:n,[hn.SEMATTRS_MESSAGING_DESTINATION_KIND]:hn.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[hn.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[hn.SEMATTRS_MESSAGING_MESSAGE_ID]:s?.messageId,[hn.SEMATTRS_MESSAGING_CONVERSATION_ID]:s?.correlationId})}),u=s??{};return u.headers=(i=u.headers)!==null&&i!==void 0?i:{},Ve.propagation.inject(Ve.trace.setSpan(Ve.context.active(),c),u.headers),{span:c,modifiedOptions:u}}endConsumerSpan(e,n,r,o){let s=e[qe.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:Ve.SpanStatusCode.ERROR,message:r!==on.EndOperation.ChannelClosed&&r!==on.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[qe.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){var s;((s=e[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&s!==void 0?s:[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),e[qe.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,he.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&Ve.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){var n;let r=(0,xS.hrTime)(),o=(n=e[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&n!==void 0?n:[],s,{consumeTimeoutMs:i}=this.getConfig();for(s=0;s<o.length;s++){let a=o[s],c=(0,xS.hrTimeDuration)(a.timeOfConsume,r);if((0,xS.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,on.EndOperation.InstrumentationTimeout,!0)}o.splice(0,s)}};US.AmqplibInstrumentation=GN});var f6=m(Js=>{"use strict";var OVe=Js&&Js.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),_6=Js&&Js.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&OVe(e,t,n)};Object.defineProperty(Js,"__esModule",{value:!0});_6(p6(),Js);_6(kN(),Js)});var U6=require("commander"),HS=v(require("crypto")),Rr=v(require("fs")),at=v(require("os")),Fo=v(require("path")),w6=require("child_process"),k6=require("util");var Xd=require("child_process"),JN=require("util"),qo=v(require("fs")),Jd=v(require("os")),YS=v(require("path"));var ao="6820f6e91b762e645c9bf020c0d3673bb99d4a25a824880c0d548e10bb9bc7b1";var Or=(0,JN.promisify)(Xd.execFile),KS=YS.join(Jd.homedir(),".visa-mcp"),Ou=YS.join(KS,"session-token"),Ln="visa-cli",jo="session-token",Wd="rc-access",z6=5e3,zd=class extends Error{constructor(e){super(e),this.name="CredentialAccessError"}};function X6(t){let e=t;return[e?.message,e?.stderr].filter(n=>typeof n=="string").join(`
12
- `)}function ZN(t){let e=t;if(e?.code==="EPERM"||e?.code==="EACCES")return!0;let n=X6(t).toLowerCase();return n.includes("operation not permitted")||n.includes("permission denied")}async function J6(){try{let{stdout:t}=await Or("security",["find-generic-password","-s",Ln,"-a",jo,"-w"],{timeout:5e3});return t.trim()||null}catch(t){if(ZN(t))throw new zd("Unable to read Visa CLI credentials from macOS Keychain. In sandboxed agents such as Codex, rerun with keychain access or run this command outside the sandbox.");return null}}async function Z6(t){try{try{await Or("security",["delete-generic-password","-s",Ln,"-a",jo],{timeout:5e3})}catch{}return await Or("security",["add-generic-password","-s",Ln,"-a",jo,"-w",t],{timeout:5e3}),!0}catch{return!1}}async function Q6(){try{await Or("security",["delete-generic-password","-s",Ln,"-a",jo],{timeout:5e3})}catch{}}async function eJ(){if(!WS())return null;try{let{stdout:t}=await Or("secret-tool",["lookup","service",Ln,"account",jo],{timeout:5e3});return t.trim()||null}catch{return null}}async function tJ(t){if(!WS())return!1;try{let e=(0,Xd.execFile)("secret-tool",["store","--label",`${Ln} ${jo}`,"service",Ln,"account",jo]);return e.stdin?(e.stdin.write(t),e.stdin.end(),await Promise.race([new Promise((n,r)=>{e.on("exit",o=>o===0?n():r(new Error(`secret-tool exited ${o}`))),e.on("error",r)}),new Promise((n,r)=>setTimeout(()=>{e.kill(),r(new Error("secret-tool timed out"))},z6))]),!0):!1}catch{return!1}}async function nJ(){if(WS())try{await Or("secret-tool",["clear","service",Ln,"account",jo],{timeout:5e3})}catch{}}function WS(){return!!process.env.DBUS_SESSION_BUS_ADDRESS}async function rJ(){try{let{stdout:t}=await Or("security",["find-generic-password","-s",Ln,"-a",Wd,"-w"],{timeout:5e3});return t.trim()||null}catch{return null}}async function oJ(t){try{try{await Or("security",["delete-generic-password","-s",Ln,"-a",Wd],{timeout:5e3})}catch{}await Or("security",["add-generic-password","-s",Ln,"-a",Wd,"-w",t],{timeout:5e3})}catch{}}async function sJ(){try{await Or("security",["delete-generic-password","-s",Ln,"-a",Wd],{timeout:5e3})}catch{}}function jS(){try{return qo.readFileSync(Ou,"utf-8").trim()||null}catch(t){if(ZN(t))throw new zd(`Unable to read Visa CLI credentials from ${Ou}. Check file permissions or rerun with access to the Visa CLI credential directory.`);return null}}function QN(t){qo.mkdirSync(KS,{recursive:!0,mode:448}),qo.writeFileSync(Ou,t,{mode:384}),process.platform==="win32"&&iJ(Ou)}function qS(){try{qo.unlinkSync(Ou)}catch{}}function iJ(t){try{let e=Jd.userInfo().username;(0,Xd.execFile)("icacls",[t,"/inheritance:r","/grant:r",`${e}:F`],{timeout:5e3},n=>{n&&console.error(`[visa-cli] icacls ACL restriction failed: ${n.message}`)})}catch(e){console.error(`[visa-cli] Failed to invoke icacls: ${e instanceof Error?e.message:String(e)}`)}}function $S(){switch(process.platform){case"darwin":return{get:J6,store:Z6,delete:Q6};case"linux":return{get:eJ,store:tJ,delete:nJ};default:return{get:async()=>jS(),store:async t=>{try{return QN(t),!0}catch{return!1}},delete:async()=>qS(),storesInSessionFile:!0}}}var Ne=class{static async getSessionToken(){if(process.env.VISA_MOCK_KEYCHAIN==="true")return Promise.resolve("mock-session-token-for-testing");let e=$S(),n=await e.get();if(n)return n;let r=jS();return r?(await e.store(r),r):null}static async saveSessionToken(e){if(process.env.VISA_MOCK_KEYCHAIN==="true")return;let n=$S();if(await n.store(e)){if(await n.get()===e){n.storesInSessionFile||qS();return}await n.delete()}if(QN(e),jS()!==e)throw new Error("Failed to persist session token. "+(process.platform==="darwin"?'Check Keychain Access permissions for "visa-cli".':`Ensure ${KS} is writable.`))}static async getRcAccessToken(){return process.env.VISA_MOCK_KEYCHAIN==="true"?ao:rJ()}static async saveRcAccessToken(e){process.env.VISA_MOCK_KEYCHAIN!=="true"&&await oJ(e)}static async deleteSessionToken(){if(process.env.VISA_MOCK_KEYCHAIN==="true")return;await $S().delete(),qS()}static async clearAll(){await this.deleteSessionToken(),await sJ()}};var Qd=v(require("crypto")),ep=v(require("tty")),tp=v(require("fs"));function cJ(t){return/-rc\.|-beta\./.test(t)}function zS(t){return Qd.createHash("sha256").update(t.trim()).digest("hex")}function eC(t){return ao==="SKIP"?!0:Qd.timingSafeEqual(Buffer.from(zS(t)),Buffer.from(ao))}function uJ(){try{let t=tp.openSync("/dev/tty","r+"),e=new ep.ReadStream(t),n=new ep.WriteStream(t),r=!1;return{input:e,output:n,cleanupStreams:()=>{if(!r){r=!0;try{e.destroy()}catch{}try{n.destroy()}catch{}try{tp.closeSync(t)}catch{}}}}}catch{if(!process.stdin.isTTY)throw new Error("No interactive terminal available. Set VISA_RC_CODE env var instead.");return{input:process.stdin,output:process.stderr,cleanupStreams:()=>{}}}}function lJ(t){return new Promise((e,n)=>{let r;try{r=uJ()}catch(l){n(l);return}let{input:o,output:s,cleanupStreams:i}=r,a=()=>{o.off("data",u);try{o.setRawMode?.(!1)}catch{}i()};s.write(t),o.setRawMode?.(!0),o.resume(),o.setEncoding("utf8");let c="",u=l=>{l==="\r"||l===`
9
+ `);d.forEach((p,_)=>{let f=p.indexOf(":"),E=f!==-1,S=(E?p.substring(0,f):p).toLowerCase(),g=E?p.substring(f+1):d[_+1];l.has(S)&&(u[`http.request.header.${S}`]=g.trim())})}i.setAttributes(u)}onResponseHeaders({request:e,response:n}){var r,o;let s=this._recordFromReq.get(e);if(!s)return;let{span:i,attributes:a}=s,c={[_t.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE]:n.statusCode},u=this.getConfig();(0,ld.safeExecuteInTheMiddle)(()=>{var d;return(d=u.responseHook)===null||d===void 0?void 0:d.call(u,i,{request:e,response:n})},d=>d&&this._diag.error("caught responseHook error: ",d),!0);let l=new Set;!((r=u.headersToSpanAttributes)===null||r===void 0)&&r.responseHeaders&&((o=u.headersToSpanAttributes)===null||o===void 0||o.responseHeaders.forEach(d=>l.add(d.toLowerCase())));for(let d=0;d<n.headers.length;d=d+2){let p=n.headers[d].toString().toLowerCase(),_=n.headers[d+1];if(l.has(p)&&(c[`http.response.header.${p}`]=_.toString()),p==="content-length"){let f=Number(_.toString());isNaN(f)||(c["http.response.header.content-length"]=f)}}i.setAttributes(c),i.setStatus({code:n.statusCode>=400?bn.SpanStatusCode.ERROR:bn.SpanStatusCode.UNSET}),s.attributes=Object.assign(a,c)}onDone({request:e}){let n=this._recordFromReq.get(e);if(!n)return;let{span:r,attributes:o,startTime:s}=n;r.end(),this._recordFromReq.delete(e),this.recordRequestDuration(o,s)}onError({request:e,error:n}){let r=this._recordFromReq.get(e);if(!r)return;let{span:o,attributes:s,startTime:i}=r;o.recordException(n),o.setStatus({code:bn.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(e),s[_t.SemanticAttributes.ERROR_TYPE]=n.message,this.recordRequestDuration(s,i)}recordRequestDuration(e,n){let r={};[_t.SemanticAttributes.HTTP_RESPONSE_STATUS_CODE,_t.SemanticAttributes.HTTP_REQUEST_METHOD,_t.SemanticAttributes.SERVER_ADDRESS,_t.SemanticAttributes.SERVER_PORT,_t.SemanticAttributes.URL_SCHEME,_t.SemanticAttributes.ERROR_TYPE].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,bE.hrTimeToMilliseconds)((0,bE.hrTimeDuration)(n,(0,bE.hrTime)()))/1e3;this._httpClientDurationHistogram.record(s,r)}getRequestMethod(e){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0};return e.toUpperCase()in n?e.toUpperCase():"_OTHER"}};ME.UndiciInstrumentation=bO});var b5=m(P5=>{"use strict";Object.defineProperty(P5,"__esModule",{value:!0})});var L5=m(Rs=>{"use strict";var lUe=Rs&&Rs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),M5=Rs&&Rs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&lUe(e,t,n)};Object.defineProperty(Rs,"__esModule",{value:!0});M5(I5(),Rs);M5(b5(),Rs)});var LE=m(dd=>{"use strict";Object.defineProperty(dd,"__esModule",{value:!0});dd.ExpressLayerType=void 0;var SUe;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(SUe=dd.ExpressLayerType||(dd.ExpressLayerType={}))});var xE=m(pd=>{"use strict";Object.defineProperty(pd,"__esModule",{value:!0});pd.AttributeNames=void 0;var TUe;(function(t){t.EXPRESS_TYPE="express.type",t.EXPRESS_NAME="express.name"})(TUe=pd.AttributeNames||(pd.AttributeNames={}))});var MO=m(jc=>{"use strict";Object.defineProperty(jc,"__esModule",{value:!0});jc._LAYERS_STORE_PROPERTY=jc.kLayerPatched=void 0;jc.kLayerPatched=Symbol("express-layer-patched");jc._LAYERS_STORE_PROPERTY="__ot_middlewares"});var k5=m(qt=>{"use strict";Object.defineProperty(qt,"__esModule",{value:!0});qt.getLayerPath=qt.asErrorAndMessage=qt.isLayerIgnored=qt.getLayerMetadata=qt.getRouterPath=qt.storeLayerPath=void 0;var LO=LE(),qc=xE(),xO=MO(),gUe=(t,e)=>{Array.isArray(t[xO._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,xO._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e!==void 0&&t[xO._LAYERS_STORE_PROPERTY].push(e)};qt.storeLayerPath=gUe;var hUe=(t,e)=>{var n,r,o,s;let i=(r=(n=e.handle)===null||n===void 0?void 0:n.stack)===null||r===void 0?void 0:r[0];return!((o=i?.route)===null||o===void 0)&&o.path?`${t}${i.route.path}`:!((s=i?.handle)===null||s===void 0)&&s.stack?(0,qt.getRouterPath)(t,i):t};qt.getRouterPath=hUe;var AUe=(t,e,n)=>{var r;if(e.name==="router"){let o=(0,qt.getRouterPath)("",e),s=o||n||t||"/";return{attributes:{[qc.AttributeNames.EXPRESS_NAME]:s,[qc.AttributeNames.EXPRESS_TYPE]:LO.ExpressLayerType.ROUTER},name:`router - ${s}`}}else return e.name==="bound dispatch"?{attributes:{[qc.AttributeNames.EXPRESS_NAME]:(r=t||n)!==null&&r!==void 0?r:"request handler",[qc.AttributeNames.EXPRESS_TYPE]:LO.ExpressLayerType.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[qc.AttributeNames.EXPRESS_NAME]:e.name,[qc.AttributeNames.EXPRESS_TYPE]:LO.ExpressLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};qt.getLayerMetadata=AUe;var RUe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},yUe=(t,e,n)=>{var r;if(Array.isArray(n?.ignoreLayersType)&&(!((r=n?.ignoreLayersType)===null||r===void 0)&&r.includes(e)))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let o of n.ignoreLayers)if(RUe(t,o))return!0}catch{}return!1};qt.isLayerIgnored=yUe;var OUe=t=>t instanceof Error?[t,t.message]:[String(t),String(t)];qt.asErrorAndMessage=OUe;var NUe=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>w5(n)||"").join(","):w5(e)};qt.getLayerPath=NUe;var w5=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()}});var V5=m(Yc=>{"use strict";Object.defineProperty(Yc,"__esModule",{value:!0});Yc.PACKAGE_NAME=Yc.PACKAGE_VERSION=void 0;Yc.PACKAGE_VERSION="0.47.1";Yc.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var $5=m(DE=>{"use strict";Object.defineProperty(DE,"__esModule",{value:!0});DE.ExpressInstrumentation=void 0;var B5=fe(),Zi=(L(),I(V)),G5=LE(),H5=xE(),ys=k5(),F5=V5(),Kc=de(),CUe=(Re(),I(et)),_d=MO(),DO=class extends Kc.InstrumentationBase{constructor(e={}){super(F5.PACKAGE_NAME,F5.PACKAGE_VERSION,e)}init(){return[new Kc.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <5"],e=>{let n=e.Router;return(0,Kc.isWrapped)(n.route)&&this._unwrap(n,"route"),this._wrap(n,"route",this._getRoutePatch()),(0,Kc.isWrapped)(n.use)&&this._unwrap(n,"use"),this._wrap(n,"use",this._getRouterUsePatch()),(0,Kc.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch()),e},e=>{if(e===void 0)return;let n=e.Router;this._unwrap(n,"route"),this._unwrap(n,"use"),this._unwrap(e.application,"use")})]}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_getAppUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this._router.stack[this._router.stack.length-1];return e._applyPatch(i,(0,ys.getLayerPath)(o)),s}}}_applyPatch(e,n){let r=this;e[_d.kLayerPatched]!==!0&&(e[_d.kLayerPatched]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){(0,ys.storeLayerPath)(i,n);let c=i[_d._LAYERS_STORE_PROPERTY].filter(N=>N!=="/"&&N!=="/*").join("").replace(/\/{2,}/g,"/"),u={[CUe.SEMATTRS_HTTP_ROUTE]:c.length>0?c:"/"},l=(0,ys.getLayerMetadata)(c,e,n),d=l.attributes[H5.AttributeNames.EXPRESS_TYPE],p=(0,B5.getRPCMetadata)(Zi.context.active());if(p?.type===B5.RPCType.HTTP&&(p.route=c||"/"),(0,ys.isLayerIgnored)(l.name,d,r.getConfig()))return d===G5.ExpressLayerType.MIDDLEWARE&&i[_d._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Zi.trace.getSpan(Zi.context.active())===void 0)return o.apply(this,arguments);let _=r._getSpanName({request:i,layerType:d,route:c},l.name),f=r.tracer.startSpan(_,{attributes:Object.assign(u,l.attributes)}),{requestHook:E}=r.getConfig();E&&(0,Kc.safeExecuteInTheMiddle)(()=>E(f,{request:i,layerType:d,route:c}),N=>{N&&Zi.diag.error("express instrumentation: request hook failed",N)},!0);let S=!1;l.attributes[H5.AttributeNames.EXPRESS_TYPE]!==G5.ExpressLayerType.MIDDLEWARE&&(f.end(),S=!0);let g=()=>{S===!1&&(S=!0,f.end())},h=Array.from(arguments),O=h.findIndex(N=>typeof N=="function");O>=0&&(arguments[O]=function(){var N;let A=arguments[0],M=![void 0,null,"route","router"].includes(A);if(!S&&M){let[J,X]=(0,ys.asErrorAndMessage)(A);f.recordException(J),f.setStatus({code:Zi.SpanStatusCode.ERROR,message:X})}return S===!1&&(S=!0,(N=i.res)===null||N===void 0||N.removeListener("finish",g),f.end()),i.route&&M||i[_d._LAYERS_STORE_PROPERTY].pop(),h[O].apply(this,arguments)});try{return o.apply(this,arguments)}catch(N){let[A,M]=(0,ys.asErrorAndMessage)(N);throw f.recordException(A),f.setStatus({code:Zi.SpanStatusCode.ERROR,message:M}),N}finally{S||a.once("finish",g)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){var r;let{spanNameHook:o}=this.getConfig();if(!(o instanceof Function))return n;try{return(r=o(e,n))!==null&&r!==void 0?r:n}catch(s){return Zi.diag.error("express instrumentation: error calling span name rewrite hook",s),n}}};DE.ExpressInstrumentation=DO});var q5=m(j5=>{"use strict";Object.defineProperty(j5,"__esModule",{value:!0})});var Y5=m(Qr=>{"use strict";var vUe=Qr&&Qr.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),UE=Qr&&Qr.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&vUe(e,t,n)};Object.defineProperty(Qr,"__esModule",{value:!0});UE($5(),Qr);UE(LE(),Qr);UE(xE(),Qr);UE(q5(),Qr)});var c3=m((LQe,a3)=>{"use strict";a3.exports=s3;function s3(t,e,n){t instanceof RegExp&&(t=o3(t,n)),e instanceof RegExp&&(e=o3(e,n));var r=i3(t,e,n);return r&&{start:r[0],end:r[1],pre:n.slice(0,r[0]),body:n.slice(r[0]+t.length,r[1]),post:n.slice(r[1]+e.length)}}function o3(t,e){var n=e.match(t);return n?n[0]:null}s3.range=i3;function i3(t,e,n){var r,o,s,i,a,c=n.indexOf(t),u=n.indexOf(e,c+1),l=c;if(c>=0&&u>0){if(t===e)return[c,u];for(r=[],s=n.length;l>=0&&!a;)l==c?(r.push(l),c=n.indexOf(t,l+1)):r.length==1?a=[r.pop(),u]:(o=r.pop(),o<s&&(s=o,i=u),u=n.indexOf(e,l+1)),l=c<u&&c>=0?c:u;r.length&&(a=[s,i])}return a}});var E3=m((xQe,m3)=>{var u3=c3();m3.exports=UUe;var l3="\0SLASH"+Math.random()+"\0",d3="\0OPEN"+Math.random()+"\0",GO="\0CLOSE"+Math.random()+"\0",p3="\0COMMA"+Math.random()+"\0",_3="\0PERIOD"+Math.random()+"\0";function BO(t){return parseInt(t,10)==t?parseInt(t,10):t.charCodeAt(0)}function xUe(t){return t.split("\\\\").join(l3).split("\\{").join(d3).split("\\}").join(GO).split("\\,").join(p3).split("\\.").join(_3)}function DUe(t){return t.split(l3).join("\\").split(d3).join("{").split(GO).join("}").split(p3).join(",").split(_3).join(".")}function f3(t){if(!t)return[""];var e=[],n=u3("{","}",t);if(!n)return t.split(",");var r=n.pre,o=n.body,s=n.post,i=r.split(",");i[i.length-1]+="{"+o+"}";var a=f3(s);return s.length&&(i[i.length-1]+=a.shift(),i.push.apply(i,a)),e.push.apply(e,i),e}function UUe(t,e){if(!t)return[];e=e||{};var n=e.max==null?1/0:e.max;return t.substr(0,2)==="{}"&&(t="\\{\\}"+t.substr(2)),fd(xUe(t),n,!0).map(DUe)}function wUe(t){return"{"+t+"}"}function kUe(t){return/^-?0\d/.test(t)}function VUe(t,e){return t<=e}function BUe(t,e){return t>=e}function fd(t,e,n){var r=[],o=u3("{","}",t);if(!o)return[t];var s=o.pre,i=o.post.length?fd(o.post,e,!1):[""];if(/\$$/.test(o.pre))for(var a=0;a<i.length&&a<e;a++){var c=s+"{"+o.body+"}"+i[a];r.push(c)}else{var u=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),l=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),d=u||l,p=o.body.indexOf(",")>=0;if(!d&&!p)return o.post.match(/,(?!,).*\}/)?(t=o.pre+"{"+o.body+GO+o.post,fd(t,e,!0)):[t];var _;if(d)_=o.body.split(/\.\./);else if(_=f3(o.body),_.length===1&&(_=fd(_[0],e,!1).map(wUe),_.length===1))return i.map(function(H){return o.pre+_[0]+H});var f;if(d){var E=BO(_[0]),S=BO(_[1]),g=Math.max(_[0].length,_[1].length),h=_.length==3?Math.max(Math.abs(BO(_[2])),1):1,O=VUe,N=S<E;N&&(h*=-1,O=BUe);var A=_.some(kUe);f=[];for(var M=E;O(M,S);M+=h){var P;if(l)P=String.fromCharCode(M),P==="\\"&&(P="");else if(P=String(M),A){var J=g-P.length;if(J>0){var X=new Array(J+1).join("0");M<0?P="-"+X+P.slice(1):P=X+P}}f.push(P)}}else{f=[];for(var Ye=0;Ye<_.length;Ye++)f.push.apply(f,fd(_[Ye],e,!1))}for(var Ye=0;Ye<f.length;Ye++)for(var a=0;a<i.length&&r.length<e;a++){var c=s+f[Ye]+i[a];(!n||d||c)&&r.push(c)}}return r}});var KO=m(hr=>{"use strict";Object.defineProperty(hr,"__esModule",{value:!0});hr.SpanNames=hr.TokenKind=hr.AllowedOperationTypes=void 0;var Vwe;(function(t){t.QUERY="query",t.MUTATION="mutation",t.SUBSCRIPTION="subscription"})(Vwe=hr.AllowedOperationTypes||(hr.AllowedOperationTypes={}));var Bwe;(function(t){t.SOF="<SOF>",t.EOF="<EOF>",t.BANG="!",t.DOLLAR="$",t.AMP="&",t.PAREN_L="(",t.PAREN_R=")",t.SPREAD="...",t.COLON=":",t.EQUALS="=",t.AT="@",t.BRACKET_L="[",t.BRACKET_R="]",t.BRACE_L="{",t.PIPE="|",t.BRACE_R="}",t.NAME="Name",t.INT="Int",t.FLOAT="Float",t.STRING="String",t.BLOCK_STRING="BlockString",t.COMMENT="Comment"})(Bwe=hr.TokenKind||(hr.TokenKind={}));var Gwe;(function(t){t.EXECUTE="graphql.execute",t.PARSE="graphql.parse",t.RESOLVE="graphql.resolve",t.VALIDATE="graphql.validate",t.SCHEMA_VALIDATE="graphql.validateSchema",t.SCHEMA_PARSE="graphql.parseSchema"})(Gwe=hr.SpanNames||(hr.SpanNames={}))});var WO=m(Ad=>{"use strict";Object.defineProperty(Ad,"__esModule",{value:!0});Ad.AttributeNames=void 0;var Hwe;(function(t){t.SOURCE="graphql.source",t.FIELD_NAME="graphql.field.name",t.FIELD_PATH="graphql.field.path",t.FIELD_TYPE="graphql.field.type",t.OPERATION_TYPE="graphql.operation.type",t.OPERATION_NAME="graphql.operation.name",t.VARIABLES="graphql.variables.",t.ERROR_VALIDATION_NAME="graphql.validation.error"})(Hwe=Ad.AttributeNames||(Ad.AttributeNames={}))});var YE=m(zc=>{"use strict";Object.defineProperty(zc,"__esModule",{value:!0});zc.OTEL_GRAPHQL_DATA_SYMBOL=zc.OTEL_PATCHED_SYMBOL=void 0;zc.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");zc.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var Y3=m(KE=>{"use strict";Object.defineProperty(KE,"__esModule",{value:!0});KE.OPERATION_NOT_SUPPORTED=void 0;var g7e=YE();KE.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var oz=m(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.wrapFieldResolver=ft.wrapFields=ft.getSourceFromLocation=ft.getOperation=ft.endSpan=ft.addSpanSource=ft.addInputVariableAttributes=ft.isPromise=void 0;var Jc=(L(),I(V)),Is=KO(),Xc=WO(),Lo=YE(),K3=Object.values(Is.AllowedOperationTypes),Fwe=t=>typeof t?.then=="function";ft.isPromise=Fwe;var $we=t=>typeof t=="object"&&t!==null;function zO(t,e,n){Array.isArray(n)?n.forEach((r,o)=>{zO(t,`${e}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{zO(t,`${e}.${r}`,o)}):t.setAttribute(`${Xc.AttributeNames.VARIABLES}${String(e)}`,n)}function jwe(t,e){Object.entries(e).forEach(([n,r])=>{zO(t,n,r)})}ft.addInputVariableAttributes=jwe;function J3(t,e,n,r,o){let s=tz(e,n,r,o);t.setAttribute(Xc.AttributeNames.SOURCE,s)}ft.addSpanSource=J3;function qwe(t,e,n,r,o){let s=Z3(n,o),i=!1;if(!s){i=!0;let a=Q3(n,o);s={parent:a,span:Ywe(t,e,n,r,o,a.span),error:null},zwe(n,o,s)}return{spanAdded:i,field:s}}function Ywe(t,e,n,r,o,s){var i,a;let c={[Xc.AttributeNames.FIELD_NAME]:r.fieldName,[Xc.AttributeNames.FIELD_PATH]:o.join("."),[Xc.AttributeNames.FIELD_TYPE]:r.returnType.toString()},u=t.startSpan(`${Is.SpanNames.RESOLVE} ${c[Xc.AttributeNames.FIELD_PATH]}`,{attributes:c},s?Jc.trace.setSpan(Jc.context.active(),s):void 0),l=n[Lo.OTEL_GRAPHQL_DATA_SYMBOL].source,d=r.fieldNodes.find(p=>p.kind==="Field");return d&&J3(u,l.loc,e().allowValues,(i=d.loc)===null||i===void 0?void 0:i.start,(a=d.loc)===null||a===void 0?void 0:a.end),u}function Kwe(t,e){e&&t.recordException(e),t.end()}ft.endSpan=Kwe;function Wwe(t,e){if(!(!t||!Array.isArray(t.definitions)))return e?t.definitions.filter(n=>{var r;return K3.indexOf((r=n)===null||r===void 0?void 0:r.operation)!==-1}).find(n=>{var r,o;return e===((o=(r=n)===null||r===void 0?void 0:r.name)===null||o===void 0?void 0:o.value)}):t.definitions.find(n=>{var r;return K3.indexOf((r=n)===null||r===void 0?void 0:r.operation)!==-1})}ft.getOperation=Wwe;function zwe(t,e,n){return t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]=n}function Z3(t,e){return t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].fields[e.join(".")]}function Q3(t,e){for(let n=e.length-1;n>0;n--){let r=Z3(t,e.slice(0,n));if(r)return r}return{span:t[Lo.OTEL_GRAPHQL_DATA_SYMBOL].span}}function Xwe(t,e){let n=[],r=e;for(;r;){let o=r.key;t&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function Jwe(t){return ez(`
10
+ `,t)}function W3(t){return ez(" ",t)}function ez(t,e){let n="";for(let r=0;r<e;r++)n+=t;return n}var Zwe=[Is.TokenKind.FLOAT,Is.TokenKind.STRING,Is.TokenKind.INT,Is.TokenKind.BLOCK_STRING];function tz(t,e=!1,n,r){var o,s;let i="";if(t?.startToken){let a=typeof n=="number"?n:t.start,c=typeof r=="number"?r:t.end,u=t.startToken.next,l=1;for(;u;){if(u.start<a){u=u.next,l=u?.line;continue}if(u.end>c){u=u.next,l=u?.line;continue}let d=u.value||u.kind,p="";!e&&Zwe.indexOf(u.kind)>=0&&(d="*"),u.kind===Is.TokenKind.STRING&&(d=`"${d}"`),u.kind===Is.TokenKind.EOF&&(d=""),u.line>l?(i+=Jwe(u.line-l),l=u.line,p=W3(u.column-1)):u.line===((o=u.prev)===null||o===void 0?void 0:o.line)&&(p=W3(u.start-(((s=u.prev)===null||s===void 0?void 0:s.end)||0))),i+=p+d,u&&(u=u.next)}}return i}ft.getSourceFromLocation=tz;function nz(t,e,n){if(!t||typeof t.getFields!="function"||t[Lo.OTEL_PATCHED_SYMBOL])return;let r=t.getFields();t[Lo.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let s=r[o];if(s&&(s.resolve&&(s.resolve=rz(e,n,s.resolve)),s.type)){let i=s.type;for(;i.ofType;)i=i.ofType;nz(i,e,n)}})}ft.wrapFields=nz;var z3=(t,e,n)=>{n&&(t.recordException(e),t.setStatus({code:Jc.SpanStatusCode.ERROR,message:e.message}),t.end())},X3=(t,e)=>{e&&t.end()};function rz(t,e,n,r=!1){if(o[Lo.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(s,i,a,c){if(!n)return;let u=e();if(u.ignoreTrivialResolveSpans&&r&&($we(s)||typeof s=="function")&&typeof s[c.fieldName]!="function")return n.call(this,s,i,a,c);if(!a[Lo.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,s,i,a,c);let l=Xwe(u.mergeItems,c&&c.path),d=l.filter(f=>typeof f=="string").length,p,_=!1;if(u.depth>=0&&u.depth<d)p=Q3(a,l);else{let f=qwe(t,e,a,c,l);p=f.field,_=f.spanAdded}return Jc.context.with(Jc.trace.setSpan(Jc.context.active(),p.span),()=>{try{let f=n.call(this,s,i,a,c);return(0,ft.isPromise)(f)?f.then(E=>(X3(p.span,_),E),E=>{throw z3(p.span,E,_),E}):(X3(p.span,_),f)}catch(f){throw z3(p.span,f,_),f}})}return o[Lo.OTEL_PATCHED_SYMBOL]=!0,o}ft.wrapFieldResolver=rz});var sz=m(Zc=>{"use strict";Object.defineProperty(Zc,"__esModule",{value:!0});Zc.PACKAGE_NAME=Zc.PACKAGE_VERSION=void 0;Zc.PACKAGE_VERSION="0.47.1";Zc.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var cz=m(XE=>{"use strict";Object.defineProperty(XE,"__esModule",{value:!0});XE.GraphQLInstrumentation=void 0;var xo=(L(),I(V)),Jn=de(),Rd=KO(),WE=WO(),XO=YE(),Qwe=Y3(),Kt=oz(),iz=sz(),az={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},zE=[">=14.0.0 <17"],JO=class extends Jn.InstrumentationBase{constructor(e={}){super(iz.PACKAGE_NAME,iz.PACKAGE_VERSION,Object.assign(Object.assign({},az),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},az),e))}init(){let e=new Jn.InstrumentationNodeModuleDefinition("graphql",zE);return e.files.push(this._addPatchingExecute()),e.files.push(this._addPatchingParser()),e.files.push(this._addPatchingValidate()),e}_addPatchingExecute(){return new Jn.InstrumentationNodeModuleFile("graphql/execution/execute.js",zE,e=>((0,Jn.isWrapped)(e.execute)&&this._unwrap(e,"execute"),this._wrap(e,"execute",this._patchExecute(e.defaultFieldResolver)),e),e=>{e&&this._unwrap(e,"execute")})}_addPatchingParser(){return new Jn.InstrumentationNodeModuleFile("graphql/language/parser.js",zE,e=>((0,Jn.isWrapped)(e.parse)&&this._unwrap(e,"parse"),this._wrap(e,"parse",this._patchParse()),e),e=>{e&&this._unwrap(e,"parse")})}_addPatchingValidate(){return new Jn.InstrumentationNodeModuleFile("graphql/validation/validate.js",zE,e=>((0,Jn.isWrapped)(e.validate)&&this._unwrap(e,"validate"),this._wrap(e,"validate",this._patchValidate()),e),e=>{e&&this._unwrap(e,"validate")})}_patchExecute(e){let n=this;return function(o){return function(){let i;if(arguments.length>=2){let u=arguments;i=n._wrapExecuteArgs(u[0],u[1],u[2],u[3],u[4],u[5],u[6],u[7],e)}else{let u=arguments[0];i=n._wrapExecuteArgs(u.schema,u.document,u.rootValue,u.contextValue,u.variableValues,u.operationName,u.fieldResolver,u.typeResolver,e)}let a=(0,Kt.getOperation)(i.document,i.operationName),c=n._createExecuteSpan(a,i);return i.contextValue[XO.OTEL_GRAPHQL_DATA_SYMBOL]={source:i.document?i.document||i.document[XO.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:c,fields:{}},xo.context.with(xo.trace.setSpan(xo.context.active(),c),()=>(0,Jn.safeExecuteInTheMiddle)(()=>o.apply(this,[i]),(u,l)=>{n._handleExecutionResult(c,u,l)}))}}}_handleExecutionResult(e,n,r){let o=this.getConfig();if(r===void 0||n){(0,Kt.endSpan)(e,n);return}if((0,Kt.isPromise)(r))r.then(s=>{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,s)},s=>{(0,Kt.endSpan)(e,s)});else{if(typeof o.responseHook!="function"){(0,Kt.endSpan)(e);return}this._executeResponseHook(e,r)}}_executeResponseHook(e,n){let{responseHook:r}=this.getConfig();r&&(0,Jn.safeExecuteInTheMiddle)(()=>{r(e,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,Kt.endSpan)(e,void 0)},!0)}_patchParse(){let e=this;return function(r){return function(s,i){return e._parse(this,r,s,i)}}}_patchValidate(){let e=this;return function(r){return function(s,i,a,c,u){return e._validate(this,r,s,i,a,u,c)}}}_parse(e,n,r,o){let s=this.getConfig(),i=this.tracer.startSpan(Rd.SpanNames.PARSE);return xo.context.with(xo.trace.setSpan(xo.context.active(),i),()=>(0,Jn.safeExecuteInTheMiddle)(()=>n.call(e,r,o),(a,c)=>{c&&((0,Kt.getOperation)(c)?c.loc&&(0,Kt.addSpanSource)(i,c.loc,s.allowValues):i.updateName(Rd.SpanNames.SCHEMA_PARSE)),(0,Kt.endSpan)(i,a)}))}_validate(e,n,r,o,s,i,a){let c=this.tracer.startSpan(Rd.SpanNames.VALIDATE,{});return xo.context.with(xo.trace.setSpan(xo.context.active(),c),()=>(0,Jn.safeExecuteInTheMiddle)(()=>n.call(e,r,o,s,a,i),(u,l)=>{o.loc||c.updateName(Rd.SpanNames.SCHEMA_VALIDATE),l&&l.length&&c.recordException({name:WE.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(l)}),(0,Kt.endSpan)(c,u)}))}_createExecuteSpan(e,n){var r;let o=this.getConfig(),s=this.tracer.startSpan(Rd.SpanNames.EXECUTE,{});if(e){let{operation:i,name:a}=e;s.setAttribute(WE.AttributeNames.OPERATION_TYPE,i);let c=a?.value;c?(s.setAttribute(WE.AttributeNames.OPERATION_NAME,c),s.updateName(`${i} ${c}`)):s.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=Qwe.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),s.setAttribute(WE.AttributeNames.OPERATION_NAME,i)}return!((r=n.document)===null||r===void 0)&&r.loc&&(0,Kt.addSpanSource)(s,n.document.loc,o.allowValues),n.variableValues&&o.allowValues&&(0,Kt.addInputVariableAttributes)(s,n.variableValues),s}_wrapExecuteArgs(e,n,r,o,s,i,a,c,u){if(o||(o={}),o[XO.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c};let l=a==null,d=a??u;return a=(0,Kt.wrapFieldResolver)(this.tracer,()=>this.getConfig(),d,l),e&&((0,Kt.wrapFields)(e.getQueryType(),this.tracer,()=>this.getConfig()),(0,Kt.wrapFields)(e.getMutationType(),this.tracer,()=>this.getConfig())),{schema:e,document:n,rootValue:r,contextValue:o,variableValues:s,operationName:i,fieldResolver:a,typeResolver:c}}};XE.GraphQLInstrumentation=JO});var lz=m(uz=>{"use strict";Object.defineProperty(uz,"__esModule",{value:!0})});var pz=m(Ps=>{"use strict";var e1e=Ps&&Ps.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),dz=Ps&&Ps.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&e1e(e,t,n)};Object.defineProperty(Ps,"__esModule",{value:!0});dz(cz(),Ps);dz(lz(),Ps)});var Tz=m(Qc=>{"use strict";Object.defineProperty(Qc,"__esModule",{value:!0});Qc.PACKAGE_NAME=Qc.PACKAGE_VERSION=void 0;Qc.PACKAGE_VERSION="0.7.1";Qc.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var gz=m(JE=>{"use strict";Object.defineProperty(JE,"__esModule",{value:!0});JE.bufferTextMapGetter=void 0;JE.bufferTextMapGetter={get(t,e){var n;if(!t)return;let r=Object.keys(t);for(let o of r)if(o===e||o.toLowerCase()===e)return(n=t[o])===null||n===void 0?void 0:n.toString()},keys(t){return t?Object.keys(t):[]}}});var Rz=m(ZE=>{"use strict";Object.defineProperty(ZE,"__esModule",{value:!0});ZE.KafkaJsInstrumentation=void 0;var Mt=(L(),I(V)),bs=(Re(),I(et)),hz=Tz(),Az=gz(),Ar=de(),ZO=class extends Ar.InstrumentationBase{constructor(e={}){super(hz.PACKAGE_NAME,hz.PACKAGE_VERSION,e)}init(){let e=r=>{var o,s;(0,Ar.isWrapped)((o=r?.Kafka)===null||o===void 0?void 0:o.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,Ar.isWrapped)((s=r?.Kafka)===null||s===void 0?void 0:s.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new Ar.InstrumentationNodeModuleDefinition("kafkajs",[">=0.1.0 <3"],r=>{var o,s;return e(r),this._wrap((o=r?.Kafka)===null||o===void 0?void 0:o.prototype,"producer",this._getProducerPatch()),this._wrap((s=r?.Kafka)===null||s===void 0?void 0:s.prototype,"consumer",this._getConsumerPatch()),r},e)}_getConsumerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Ar.isWrapped)(s.run)&&e._unwrap(s,"run"),e._wrap(s,"run",e._getConsumerRunPatch()),s}}_getProducerPatch(){let e=this;return n=>function(...o){let s=n.apply(this,o);return(0,Ar.isWrapped)(s.sendBatch)&&e._unwrap(s,"sendBatch"),e._wrap(s,"sendBatch",e._getProducerSendBatchPatch()),(0,Ar.isWrapped)(s.send)&&e._unwrap(s,"send"),e._wrap(s,"send",e._getProducerSendPatch()),s}}_getConsumerRunPatch(){let e=this;return n=>function(...o){let s=o[0];return s?.eachMessage&&((0,Ar.isWrapped)(s.eachMessage)&&e._unwrap(s,"eachMessage"),e._wrap(s,"eachMessage",e._getConsumerEachMessagePatch())),s?.eachBatch&&((0,Ar.isWrapped)(s.eachBatch)&&e._unwrap(s,"eachBatch"),e._wrap(s,"eachBatch",e._getConsumerEachBatchPatch())),n.call(this,s)}}_getConsumerEachMessagePatch(){let e=this;return n=>function(...o){let s=o[0],i=Mt.propagation.extract(Mt.ROOT_CONTEXT,s.message.headers,Az.bufferTextMapGetter),a=e._startConsumerSpan(s.topic,s.message,bs.MESSAGINGOPERATIONVALUES_PROCESS,i),c=Mt.context.with(Mt.trace.setSpan(i,a),()=>n.apply(this,o));return e._endSpansOnPromise([a],c)}}_getConsumerEachBatchPatch(){return e=>{let n=this;return function(...o){let s=o[0],i=n._startConsumerSpan(s.batch.topic,void 0,bs.MESSAGINGOPERATIONVALUES_RECEIVE,Mt.ROOT_CONTEXT);return Mt.context.with(Mt.trace.setSpan(Mt.context.active(),i),()=>{let a=s.batch.messages.map(u=>{var l;let d=Mt.propagation.extract(Mt.ROOT_CONTEXT,u.headers,Az.bufferTextMapGetter),p=(l=Mt.trace.getSpan(d))===null||l===void 0?void 0:l.spanContext(),_;return p&&(_={context:p}),n._startConsumerSpan(s.batch.topic,u,bs.MESSAGINGOPERATIONVALUES_PROCESS,void 0,_)}),c=e.apply(this,o);return a.unshift(i),n._endSpansOnPromise(a,c)})}}}_getProducerSendBatchPatch(){let e=this;return n=>function(...o){let a=(o[0].topicMessages||[]).map(u=>u.messages.map(l=>e._startProducerSpan(u.topic,l))).reduce((u,l)=>u.concat(l),[]),c=n.apply(this,o);return e._endSpansOnPromise(a,c)}}_getProducerSendPatch(){let e=this;return n=>function(...o){let s=o[0],i=s.messages.map(c=>e._startProducerSpan(s.topic,c)),a=n.apply(this,o);return e._endSpansOnPromise(i,a)}}_endSpansOnPromise(e,n){return Promise.resolve(n).catch(r=>{let o;throw typeof r=="string"?o=r:typeof r=="object"&&Object.prototype.hasOwnProperty.call(r,"message")&&(o=r.message),e.forEach(s=>s.setStatus({code:Mt.SpanStatusCode.ERROR,message:o})),r}).finally(()=>{e.forEach(r=>r.end())})}_startConsumerSpan(e,n,r,o,s){let i=this.tracer.startSpan(e,{kind:Mt.SpanKind.CONSUMER,attributes:{[bs.SEMATTRS_MESSAGING_SYSTEM]:"kafka",[bs.SEMATTRS_MESSAGING_DESTINATION]:e,[bs.SEMATTRS_MESSAGING_OPERATION]:r},links:s?[s]:[]},o),{consumerHook:a}=this.getConfig();return a&&n&&(0,Ar.safeExecuteInTheMiddle)(()=>a(i,{topic:e,message:n}),c=>{c&&this._diag.error("consumerHook error",c)},!0),i}_startProducerSpan(e,n){var r;let o=this.tracer.startSpan(e,{kind:Mt.SpanKind.PRODUCER,attributes:{[bs.SEMATTRS_MESSAGING_SYSTEM]:"kafka",[bs.SEMATTRS_MESSAGING_DESTINATION]:e}});n.headers=(r=n.headers)!==null&&r!==void 0?r:{},Mt.propagation.inject(Mt.trace.setSpan(Mt.context.active(),o),n.headers);let{producerHook:s}=this.getConfig();return s&&(0,Ar.safeExecuteInTheMiddle)(()=>s(o,{topic:e,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),o}};ZE.KafkaJsInstrumentation=ZO});var Oz=m(yz=>{"use strict";Object.defineProperty(yz,"__esModule",{value:!0})});var Cz=m(Ms=>{"use strict";var r1e=Ms&&Ms.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Nz=Ms&&Ms.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&r1e(e,t,n)};Object.defineProperty(Ms,"__esModule",{value:!0});Nz(Rz(),Ms);Nz(Oz(),Ms)});var Mz=m(eu=>{"use strict";Object.defineProperty(eu,"__esModule",{value:!0});eu.PACKAGE_NAME=eu.PACKAGE_VERSION=void 0;eu.PACKAGE_VERSION="0.44.1";eu.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var Uz=m(QE=>{"use strict";Object.defineProperty(QE,"__esModule",{value:!0});QE.LruMemoizerInstrumentation=void 0;var Lz=(L(),I(V)),xz=de(),Dz=Mz(),QO=class extends xz.InstrumentationBase{constructor(e={}){super(Dz.PACKAGE_NAME,Dz.PACKAGE_VERSION,e)}init(){return[new xz.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <3"],e=>{let n=function(){let r=e.apply(this,arguments);return function(){let o=[...arguments],s=o.pop(),i=typeof s=="function"?Lz.context.bind(Lz.context.active(),s):s;return o.push(i),r.apply(this,o)}};return n.sync=e.sync,n},void 0)]}};QE.LruMemoizerInstrumentation=QO});var wz=m(ta=>{"use strict";var s1e=ta&&ta.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),i1e=ta&&ta.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&s1e(e,t,n)};Object.defineProperty(ta,"__esModule",{value:!0});i1e(Uz(),ta)});var Hz=m(yd=>{"use strict";Object.defineProperty(yd,"__esModule",{value:!0});yd.MongodbCommandType=void 0;var c1e;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.AGGREGATE="aggregate",t.UNKNOWN="unknown"})(c1e=yd.MongodbCommandType||(yd.MongodbCommandType={}))});var Fz=m(tu=>{"use strict";Object.defineProperty(tu,"__esModule",{value:!0});tu.PACKAGE_NAME=tu.PACKAGE_VERSION=void 0;tu.PACKAGE_VERSION="0.52.0";tu.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var qz=m(eS=>{"use strict";Object.defineProperty(eS,"__esModule",{value:!0});eS.MongoDBInstrumentation=void 0;var ke=(L(),I(V)),Me=de(),Do=(Re(),I(et)),Ls=Hz(),$z=Fz(),jz={requireParentSpan:!0},eN=class t extends Me.InstrumentationBase{constructor(e={}){super($z.PACKAGE_NAME,$z.PACKAGE_VERSION,Object.assign(Object.assign({},jz),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},jz),e))}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter("db.client.connections.usage",{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}init(){let{v3PatchConnection:e,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:s,v4PatchConnectionPromise:i,v4UnpatchConnection:a}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:c,v4UnpatchConnectionPool:u}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:l,v4UnpatchSessions:d}=this._getV4SessionsPatches();return[new Me.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new Me.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],e,n)]),new Me.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <7"],void 0,void 0,[new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],s,a),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <7"],i,a),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],c,u),new Me.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <7"],r,o),new Me.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <7"],l,d)])]}_getV3ConnectionPatches(){return{v3PatchConnection:e=>((0,Me.isWrapped)(e.insert)&&this._unwrap(e,"insert"),this._wrap(e,"insert",this._getV3PatchOperation("insert")),(0,Me.isWrapped)(e.remove)&&this._unwrap(e,"remove"),this._wrap(e,"remove",this._getV3PatchOperation("remove")),(0,Me.isWrapped)(e.update)&&this._unwrap(e,"update"),this._wrap(e,"update",this._getV3PatchOperation("update")),(0,Me.isWrapped)(e.command)&&this._unwrap(e,"command"),this._wrap(e,"command",this._getV3PatchCommand()),(0,Me.isWrapped)(e.query)&&this._unwrap(e,"query"),this._wrap(e,"query",this._getV3PatchFind()),(0,Me.isWrapped)(e.getMore)&&this._unwrap(e,"getMore"),this._wrap(e,"getMore",this._getV3PatchCursor()),e),v3UnpatchConnection:e=>{e!==void 0&&(this._unwrap(e,"insert"),this._unwrap(e,"remove"),this._unwrap(e,"update"),this._unwrap(e,"command"),this._unwrap(e,"query"),this._unwrap(e,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:e=>((0,Me.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),this._wrap(e.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,Me.isWrapped)(e.release)&&this._unwrap(e,"release"),this._wrap(e.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),e),v4UnpatchSessions:e=>{e!==void 0&&((0,Me.isWrapped)(e.acquire)&&this._unwrap(e,"acquire"),(0,Me.isWrapped)(e.release)&&this._unwrap(e,"release"))}}}_getV4AcquireCommand(){let e=this;return n=>function(){let o=this.sessions.length,s=n.call(this),i=this.sessions.length;return o===i?e._connectionsUsage.add(1,{state:"used","pool.name":e._poolName}):o-1===i&&(e._connectionsUsage.add(-1,{state:"idle","pool.name":e._poolName}),e._connectionsUsage.add(1,{state:"used","pool.name":e._poolName})),s}}_getV4ReleaseCommand(){let e=this;return n=>function(o){let s=n.call(this,o);return e._connectionsUsage.add(-1,{state:"used","pool.name":e._poolName}),e._connectionsUsage.add(1,{state:"idle","pool.name":e._poolName}),s}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:e=>{let n=e.ConnectionPool.prototype;return(0,Me.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),e},v4UnpatchConnectionPool:e=>{e!==void 0&&this._unwrap(e.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:e=>((0,Me.isWrapped)(e.connect)&&this._unwrap(e,"connect"),this._wrap(e,"connect",this._getV4ConnectCommand()),e),v4UnpatchConnect:e=>{e!==void 0&&this._unwrap(e,"connect")}}}_getV4ConnectionPoolCheckOut(){return e=>function(r){let o=ke.context.bind(ke.context.active(),r);return e.call(this,o)}}_getV4ConnectCommand(){let e=this;return n=>function(o,s){if(n.length===1){let a=n.call(this,o);return a&&typeof a.then=="function"&&a.then(()=>e.setPoolName(o),()=>{}),a}let i=function(a,c){if(a||!c){s(a,c);return}e.setPoolName(o),s(a,c)};return n.call(this,o,i)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:e=>((0,Me.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandCallback()),e),v4PatchConnectionPromise:e=>((0,Me.isWrapped)(e.Connection.prototype.command)&&this._unwrap(e.Connection.prototype,"command"),this._wrap(e.Connection.prototype,"command",this._getV4PatchCommandPromise()),e),v4UnpatchConnection:e=>{e!==void 0&&this._unwrap(e.Connection.prototype,"command")}}}_getV3PatchOperation(e){let n=this;return r=>function(s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=n._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function"||typeof a!="object")return typeof c=="function"?r.call(this,s,i,a,c):r.call(this,s,i,a,c,u);let _=n.tracer.startSpan(`mongodb.${e}`,{kind:ke.SpanKind.CLIENT});n._populateV3Attributes(_,i,s,a[0],e);let f=n._patchEnd(_,p);return typeof c=="function"?r.call(this,s,i,a,f):r.call(this,s,i,a,c,f)}}_getV3PatchCommand(){let e=this;return n=>function(o,s,i,a,c){let u=ke.trace.getSpan(ke.context.active()),l=e._checkSkipInstrumentation(u),d=typeof a=="function"?a:c;if(l||typeof d!="function"||typeof i!="object")return typeof a=="function"?n.call(this,o,s,i,a):n.call(this,o,s,i,a,c);let p=t._getCommandType(i),_=p===Ls.MongodbCommandType.UNKNOWN?"command":p,f=e.tracer.startSpan(`mongodb.${_}`,{kind:ke.SpanKind.CLIENT}),E=p===Ls.MongodbCommandType.UNKNOWN?void 0:p;e._populateV3Attributes(f,s,o,i,E);let S=e._patchEnd(f,d);return typeof a=="function"?n.call(this,o,s,i,S):n.call(this,o,s,i,a,S)}}_getV4PatchCommandCallback(){let e=this;return n=>function(o,s,i,a){let c=ke.trace.getSpan(ke.context.active()),u=e._checkSkipInstrumentation(c),l=a,d=Object.keys(s)[0];if(typeof s!="object"||s.ismaster||s.hello)return n.call(this,o,s,i,a);let p;u||(p=e.tracer.startSpan(`mongodb.${d}`,{kind:ke.SpanKind.CLIENT}),e._populateV4Attributes(p,this,o,s,d));let _=e._patchEnd(p,l,this.id,d);return n.call(this,o,s,i,_)}}_getV4PatchCommandPromise(){let e=this;return n=>function(...o){let[s,i]=o,a=ke.trace.getSpan(ke.context.active()),c=e._checkSkipInstrumentation(a),u=Object.keys(i)[0],l=()=>{};if(typeof i!="object"||i.ismaster||i.hello)return n.apply(this,o);let d;c||(d=e.tracer.startSpan(`mongodb.${u}`,{kind:ke.SpanKind.CLIENT}),e._populateV4Attributes(d,this,s,i,u));let p=e._patchEnd(d,l,this.id,u),_=n.apply(this,o);return _.then(f=>p(null,f),f=>p(f)),_}}_getV3PatchFind(){let e=this;return n=>function(o,s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=e._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function"||typeof i!="object")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,u);let _=e.tracer.startSpan("mongodb.find",{kind:ke.SpanKind.CLIENT});e._populateV3Attributes(_,s,o,i,"find");let f=e._patchEnd(_,p);return typeof c=="function"?n.call(this,o,s,i,a,f):n.call(this,o,s,i,a,c,f)}}_getV3PatchCursor(){let e=this;return n=>function(o,s,i,a,c,u){let l=ke.trace.getSpan(ke.context.active()),d=e._checkSkipInstrumentation(l),p=typeof c=="function"?c:u;if(d||typeof p!="function")return typeof c=="function"?n.call(this,o,s,i,a,c):n.call(this,o,s,i,a,c,u);let _=e.tracer.startSpan("mongodb.getMore",{kind:ke.SpanKind.CLIENT});e._populateV3Attributes(_,s,o,i.cmd,"getMore");let f=e._patchEnd(_,p);return typeof c=="function"?n.call(this,o,s,i,a,f):n.call(this,o,s,i,a,c,f)}}static _getCommandType(e){return e.createIndexes!==void 0?Ls.MongodbCommandType.CREATE_INDEXES:e.findandmodify!==void 0?Ls.MongodbCommandType.FIND_AND_MODIFY:e.ismaster!==void 0?Ls.MongodbCommandType.IS_MASTER:e.count!==void 0?Ls.MongodbCommandType.COUNT:e.aggregate!==void 0?Ls.MongodbCommandType.AGGREGATE:Ls.MongodbCommandType.UNKNOWN}_populateV4Attributes(e,n,r,o,s){let i,a;if(n){let u=typeof n.address=="string"?n.address.split(":"):"";u.length===2&&(i=u[0],a=u[1])}let c;o?.documents&&o.documents[0]?c=o.documents[0]:o?.cursors?c=o.cursors:c=o,this._addAllSpanAttributes(e,r.db,r.collection,i,a,c,s)}_populateV3Attributes(e,n,r,o,s){var i,a,c,u,l,d,p,_;let f,E;if(r&&r.s&&(f=(a=(i=r.s.options)===null||i===void 0?void 0:i.host)!==null&&a!==void 0?a:r.s.host,E=(l=(u=(c=r.s.options)===null||c===void 0?void 0:c.port)!==null&&u!==void 0?u:r.s.port)===null||l===void 0?void 0:l.toString(),f==null||E==null)){let O=(d=r.description)===null||d===void 0?void 0:d.address;if(O){let N=O.split(":");f=N[0],E=N[1]}}let[S,g]=n.toString().split("."),h=(_=(p=o?.query)!==null&&p!==void 0?p:o?.q)!==null&&_!==void 0?_:o;this._addAllSpanAttributes(e,S,g,f,E,h,s)}_addAllSpanAttributes(e,n,r,o,s,i,a){if(e.setAttributes({[Do.SEMATTRS_DB_SYSTEM]:Do.DBSYSTEMVALUES_MONGODB,[Do.SEMATTRS_DB_NAME]:n,[Do.SEMATTRS_DB_MONGODB_COLLECTION]:r,[Do.SEMATTRS_DB_OPERATION]:a,[Do.SEMATTRS_DB_CONNECTION_STRING]:`mongodb://${o}:${s}/${n}`}),o&&s){e.setAttribute(Do.SEMATTRS_NET_PEER_NAME,o);let l=parseInt(s,10);isNaN(l)||e.setAttribute(Do.SEMATTRS_NET_PEER_PORT,l)}if(!i)return;let{dbStatementSerializer:c}=this.getConfig(),u=typeof c=="function"?c:this._defaultDbStatementSerializer.bind(this);(0,Me.safeExecuteInTheMiddle)(()=>{let l=u(i);e.setAttribute(Do.SEMATTRS_DB_STATEMENT,l)},l=>{l&&this._diag.error("Error running dbStatementSerializer hook",l)},!0)}_defaultDbStatementSerializer(e){let{enhancedDatabaseReporting:n}=this.getConfig(),r=n?e:this._scrubStatement(e);return JSON.stringify(r)}_scrubStatement(e){return Array.isArray(e)?e.map(n=>this._scrubStatement(n)):typeof e=="object"&&e!==null?Object.fromEntries(Object.entries(e).map(([n,r])=>[n,this._scrubStatement(r)])):"?"}_handleExecutionResult(e,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,Me.safeExecuteInTheMiddle)(()=>{r(e,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(e,n,r,o){let s=ke.context.active(),i=this;return function(...c){let u=c[0];if(e){if(u instanceof Error)e?.setStatus({code:ke.SpanStatusCode.ERROR,message:u.message});else{let l=c[1];i._handleExecutionResult(e,l)}e.end()}return ke.context.with(s,()=>(o==="endSessions"&&i._connectionsUsage.add(-1,{state:"idle","pool.name":i._poolName}),n.apply(this,c)))}}setPoolName(e){var n,r;let o=(n=e.hostAddress)===null||n===void 0?void 0:n.host,s=(r=e.hostAddress)===null||r===void 0?void 0:r.port,i=e.dbName,a=`mongodb://${o}:${s}/${i}`;this._poolName=a}_checkSkipInstrumentation(e){return this.getConfig().requireParentSpan===!0&&e===void 0}};eS.MongoDBInstrumentation=eN});var Yz=m(Od=>{"use strict";Object.defineProperty(Od,"__esModule",{value:!0});Od.MongodbCommandType=void 0;var u1e;(function(t){t.CREATE_INDEXES="createIndexes",t.FIND_AND_MODIFY="findAndModify",t.IS_MASTER="isMaster",t.COUNT="count",t.UNKNOWN="unknown"})(u1e=Od.MongodbCommandType||(Od.MongodbCommandType={}))});var Wz=m(xs=>{"use strict";var l1e=xs&&xs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),Kz=xs&&xs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&l1e(e,t,n)};Object.defineProperty(xs,"__esModule",{value:!0});Kz(qz(),xs);Kz(Yz(),xs)});var tX=m(Ds=>{"use strict";Object.defineProperty(Ds,"__esModule",{value:!0});Ds.handleCallbackResponse=Ds.handlePromiseResponse=Ds.getAttributesFromCollection=void 0;var Qz=(L(),I(V)),E1e=de(),Nd=(Re(),I(et));function S1e(t){return{[Nd.SEMATTRS_DB_MONGODB_COLLECTION]:t.name,[Nd.SEMATTRS_DB_NAME]:t.conn.name,[Nd.SEMATTRS_DB_USER]:t.conn.user,[Nd.SEMATTRS_NET_PEER_NAME]:t.conn.host,[Nd.SEMATTRS_NET_PEER_PORT]:t.conn.port}}Ds.getAttributesFromCollection=S1e;function eX(t,e={}){t.recordException(e),t.setStatus({code:Qz.SpanStatusCode.ERROR,message:`${e.message} ${e.code?`
11
+ Mongoose Error Code: ${e.code}`:""}`})}function nN(t,e,n,r=void 0){n&&(0,E1e.safeExecuteInTheMiddle)(()=>n(t,{moduleVersion:r,response:e}),o=>{o&&Qz.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function T1e(t,e,n,r=void 0){return t instanceof Promise?t.then(o=>(nN(e,o,n,r),o)).catch(o=>{throw eX(e,o),o}).finally(()=>e.end()):(nN(e,t,n,r),e.end(),t)}Ds.handlePromiseResponse=T1e;function g1e(t,e,n,r,o,s,i=void 0){let a=0;return o.length===2&&(a=1),o[a]=(c,u)=>(c?eX(r,c):nN(r,u,s,i),r.end(),t(c,u)),e.apply(n,o)}Ds.handleCallbackResponse=g1e});var nX=m(nu=>{"use strict";Object.defineProperty(nu,"__esModule",{value:!0});nu.PACKAGE_NAME=nu.PACKAGE_VERSION=void 0;nu.PACKAGE_VERSION="0.46.1";nu.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var aX=m(no=>{"use strict";Object.defineProperty(no,"__esModule",{value:!0});no.MongooseInstrumentation=no._STORED_PARENT_SPAN=void 0;var rn=(L(),I(V)),h1e=fe(),rN=tX(),rX=de(),oX=nX(),Cd=(Re(),I(et)),tS=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],A1e=["remove","count","findOneAndRemove",...tS],R1e=["count","findOneAndRemove",...tS],y1e=[...tS];function sX(t){return t?t.startsWith("6.")||t.startsWith("5.")?A1e:t.startsWith("7.")?R1e:y1e:tS}function iX(t){return t&&(t.startsWith("5.")||t.startsWith("6."))||!1}no._STORED_PARENT_SPAN=Symbol("stored-parent-span");var oN=class extends rX.InstrumentationBase{constructor(e={}){super(oX.PACKAGE_NAME,oX.PACKAGE_VERSION,e)}init(){return new rX.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <9"],this.patch.bind(this),this.unpatch.bind(this))}patch(e,n){return this._wrap(e.Model.prototype,"save",this.patchOnModelMethods("save",n)),e.Model.prototype.$save=e.Model.prototype.save,iX(n)&&this._wrap(e.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),this._wrap(e.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(e.Aggregate.prototype,"exec",this.patchAggregateExec(n)),sX(n).forEach(o=>{this._wrap(e.Query.prototype,o,this.patchAndCaptureSpanContext(o))}),this._wrap(e.Model,"aggregate",this.patchModelAggregate()),e}unpatch(e,n){let r=sX(n);this._unwrap(e.Model.prototype,"save"),e.Model.prototype.$save=e.Model.prototype.save,iX(n)&&this._unwrap(e.Model.prototype,"remove"),this._unwrap(e.Query.prototype,"exec"),this._unwrap(e.Aggregate.prototype,"exec"),r.forEach(o=>{this._unwrap(e.Query.prototype,o)}),this._unwrap(e.Model,"aggregate")}patchAggregateExec(e){let n=this;return r=>function(s){var i;if(n.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return r.apply(this,arguments);let a=this[no._STORED_PARENT_SPAN],c={},{dbStatementSerializer:u}=n.getConfig();u&&(c[Cd.SEMATTRS_DB_STATEMENT]=u("aggregate",{options:this.options,aggregatePipeline:this._pipeline}));let l=n._startSpan(this._model.collection,(i=this._model)===null||i===void 0?void 0:i.modelName,"aggregate",c,a);return n._handleResponse(l,r,this,arguments,s,e)}}patchQueryExec(e){let n=this;return r=>function(s){if(n.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return r.apply(this,arguments);let i=this[no._STORED_PARENT_SPAN],a={},{dbStatementSerializer:c}=n.getConfig();c&&(a[Cd.SEMATTRS_DB_STATEMENT]=c(this.op,{condition:this._conditions,updates:this._update,options:this.options,fields:this._fields}));let u=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,a,i);return n._handleResponse(u,r,this,arguments,s,e)}}patchOnModelMethods(e,n){let r=this;return o=>function(i,a){if(r.getConfig().requireParentSpan&&rn.trace.getSpan(rn.context.active())===void 0)return o.apply(this,arguments);let c={document:this};i&&!(i instanceof Function)&&(c.options=i);let u={},{dbStatementSerializer:l}=r.getConfig();l&&(u[Cd.SEMATTRS_DB_STATEMENT]=l(e,c));let d=r._startSpan(this.constructor.collection,this.constructor.modelName,e,u);return i instanceof Function&&(a=i,i=void 0),r._handleResponse(d,o,this,arguments,a,n)}}patchModelAggregate(){let e=this;return n=>function(){let o=rn.trace.getSpan(rn.context.active()),s=e._callOriginalFunction(()=>n.apply(this,arguments));return s&&(s[no._STORED_PARENT_SPAN]=o),s}}patchAndCaptureSpanContext(e){let n=this;return r=>function(){return this[no._STORED_PARENT_SPAN]=rn.trace.getSpan(rn.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(e,n,r,o,s){return this.tracer.startSpan(`mongoose.${n}.${r}`,{kind:rn.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},o),(0,rN.getAttributesFromCollection)(e)),{[Cd.SEMATTRS_DB_OPERATION]:r,[Cd.SEMATTRS_DB_SYSTEM]:"mongoose"})},s?rn.trace.setSpan(rn.context.active(),s):void 0)}_handleResponse(e,n,r,o,s,i=void 0){let a=this;if(s instanceof Function)return a._callOriginalFunction(()=>(0,rN.handleCallbackResponse)(s,n,r,e,o,a.getConfig().responseHook,i));{let c=a._callOriginalFunction(()=>n.apply(r,o));return(0,rN.handlePromiseResponse)(c,e,a.getConfig().responseHook,i)}}_callOriginalFunction(e){return this.getConfig().suppressInternalInstrumentation?rn.context.with((0,h1e.suppressTracing)(rn.context.active()),e):e()}};no.MongooseInstrumentation=oN});var uX=m(cX=>{"use strict";Object.defineProperty(cX,"__esModule",{value:!0})});var dX=m(Us=>{"use strict";var O1e=Us&&Us.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),lX=Us&&Us.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&O1e(e,t,n)};Object.defineProperty(Us,"__esModule",{value:!0});lX(aX(),Us);lX(uX(),Us)});var EX=m(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0});vd.AttributeNames=void 0;var C1e;(function(t){t.MYSQL_VALUES="db.mysql.values"})(C1e=vd.AttributeNames||(vd.AttributeNames={}))});var TX=m(Tn=>{"use strict";Object.defineProperty(Tn,"__esModule",{value:!0});Tn.getPoolName=Tn.arrayStringifyHelper=Tn.getSpanName=Tn.getDbValues=Tn.getDbStatement=Tn.getConnectionAttributes=void 0;var Uo=(Re(),I(et));function v1e(t){let{host:e,port:n,database:r,user:o}=I1e(t),s=parseInt(n,10);return isNaN(s)?{[Uo.SEMATTRS_NET_PEER_NAME]:e,[Uo.SEMATTRS_DB_CONNECTION_STRING]:SX(e,n,r),[Uo.SEMATTRS_DB_NAME]:r,[Uo.SEMATTRS_DB_USER]:o}:{[Uo.SEMATTRS_NET_PEER_NAME]:e,[Uo.SEMATTRS_NET_PEER_PORT]:s,[Uo.SEMATTRS_DB_CONNECTION_STRING]:SX(e,n,r),[Uo.SEMATTRS_DB_NAME]:r,[Uo.SEMATTRS_DB_USER]:o}}Tn.getConnectionAttributes=v1e;function I1e(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function SX(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function P1e(t){return typeof t=="string"?t:t.sql}Tn.getDbStatement=P1e;function b1e(t,e){return sN(typeof t=="string"?e:e||t.values)}Tn.getDbValues=b1e;function M1e(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Tn.getSpanName=M1e;function sN(t){return t?`[${t.toString()}]`:""}Tn.arrayStringifyHelper=sN;function L1e(t){let e=t.config.connectionConfig,n="";return n+=e.host?`host: '${e.host}', `:"",n+=e.port?`port: ${e.port}, `:"",n+=e.database?`database: '${e.database}', `:"",n+=e.user?`user: '${e.user}'`:"",e.user||(n=n.substring(0,n.length-2)),n.trim()}Tn.getPoolName=L1e});var gX=m(ru=>{"use strict";Object.defineProperty(ru,"__esModule",{value:!0});ru.PACKAGE_NAME=ru.PACKAGE_VERSION=void 0;ru.PACKAGE_VERSION="0.45.1";ru.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var AX=m(rS=>{"use strict";Object.defineProperty(rS,"__esModule",{value:!0});rS.MySQLInstrumentation=void 0;var gn=(L(),I(V)),ou=de(),iN=(Re(),I(et)),x1e=EX(),su=TX(),hX=gX(),nS=class t extends ou.InstrumentationBase{constructor(e={}){super(hX.PACKAGE_NAME,hX.PACKAGE_VERSION,e),this._setMetricInstruments()}setMeterProvider(e){super.setMeterProvider(e),this._setMetricInstruments()}_setMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter("db.client.connections.usage",{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}init(){return[new ou.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],e=>((0,ou.isWrapped)(e.createConnection)&&this._unwrap(e,"createConnection"),this._wrap(e,"createConnection",this._patchCreateConnection()),(0,ou.isWrapped)(e.createPool)&&this._unwrap(e,"createPool"),this._wrap(e,"createPool",this._patchCreatePool()),(0,ou.isWrapped)(e.createPoolCluster)&&this._unwrap(e,"createPoolCluster"),this._wrap(e,"createPoolCluster",this._patchCreatePoolCluster()),e),e=>{e!==void 0&&(this._unwrap(e,"createConnection"),this._unwrap(e,"createPool"),this._unwrap(e,"createPoolCluster"))})]}_patchCreateConnection(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),s}}}_patchCreatePool(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"query",n._patchQuery(s)),n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"end",n._patchPoolEnd(s)),n._setPoolcallbacks(s,n,""),s}}}_patchPoolEnd(e){return n=>{let r=this;return function(s){let i=e._allConnections.length,a=e._freeConnections.length,c=i-a,u=(0,su.getPoolName)(e);r._connectionsUsage.add(-c,{state:"used",name:u}),r._connectionsUsage.add(-a,{state:"idle",name:u}),n.apply(e,arguments)}}}_patchCreatePoolCluster(){return e=>{let n=this;return function(o){let s=e(...arguments);return n._wrap(s,"getConnection",n._patchGetConnection(s)),n._wrap(s,"add",n._patchAdd(s)),s}}}_patchAdd(e){return n=>{let r=this;return function(s,i){if(!r._enabled)return r._unwrap(e,"add"),n.apply(e,arguments);n.apply(e,arguments);let a=e._nodes;if(a){let c=typeof s=="object"?"CLUSTER::"+e._lastId:String(s),u=a[c].pool;r._setPoolcallbacks(u,r,s)}}}}_patchGetConnection(e){return n=>{let r=this;return function(s,i,a){if(!r._enabled)return r._unwrap(e,"getConnection"),n.apply(e,arguments);if(arguments.length===1&&typeof s=="function"){let c=r._getConnectionCallbackPatchFn(s);return n.call(e,c)}if(arguments.length===2&&typeof i=="function"){let c=r._getConnectionCallbackPatchFn(i);return n.call(e,s,c)}if(arguments.length===3&&typeof a=="function"){let c=r._getConnectionCallbackPatchFn(a);return n.call(e,s,i,c)}return n.apply(e,arguments)}}}_getConnectionCallbackPatchFn(e){let n=this,r=gn.context.active();return function(o,s){s&&((0,ou.isWrapped)(s.query)||n._wrap(s,"query",n._patchQuery(s))),typeof e=="function"&&gn.context.with(r,e,this,o,s)}}_patchQuery(e){return n=>{let r=this;return function(o,s,i){if(!r._enabled)return r._unwrap(e,"query"),n.apply(e,arguments);let a=r.tracer.startSpan((0,su.getSpanName)(o),{kind:gn.SpanKind.CLIENT,attributes:Object.assign(Object.assign({},t.COMMON_ATTRIBUTES),(0,su.getConnectionAttributes)(e.config))});if(a.setAttribute(iN.SEMATTRS_DB_STATEMENT,(0,su.getDbStatement)(o)),r.getConfig().enhancedDatabaseReporting){let l;Array.isArray(s)?l=s:arguments[2]&&(l=[s]),a.setAttribute(x1e.AttributeNames.MYSQL_VALUES,(0,su.getDbValues)(o,l))}let c=Array.from(arguments).findIndex(l=>typeof l=="function"),u=gn.context.active();if(c===-1){let l=gn.context.with(gn.trace.setSpan(gn.context.active(),a),()=>n.apply(e,arguments));return gn.context.bind(u,l),l.on("error",d=>a.setStatus({code:gn.SpanStatusCode.ERROR,message:d.message})).on("end",()=>{a.end()})}else return r._wrap(arguments,c,r._patchCallbackQuery(a,u)),gn.context.with(gn.trace.setSpan(gn.context.active(),a),()=>n.apply(e,arguments))}}}_patchCallbackQuery(e,n){return r=>function(o,s,i){return o&&e.setStatus({code:gn.SpanStatusCode.ERROR,message:o.message}),e.end(),gn.context.with(n,()=>r(...arguments))}}_setPoolcallbacks(e,n,r){let o=r||(0,su.getPoolName)(e);e.on("connection",s=>{n._connectionsUsage.add(1,{state:"idle",name:o})}),e.on("acquire",s=>{n._connectionsUsage.add(-1,{state:"idle",name:o}),n._connectionsUsage.add(1,{state:"used",name:o})}),e.on("release",s=>{n._connectionsUsage.add(-1,{state:"used",name:o}),n._connectionsUsage.add(1,{state:"idle",name:o})})}};rS.MySQLInstrumentation=nS;nS.COMMON_ATTRIBUTES={[iN.SEMATTRS_DB_SYSTEM]:iN.DBSYSTEMVALUES_MYSQL}});var yX=m(RX=>{"use strict";Object.defineProperty(RX,"__esModule",{value:!0})});var NX=m(ws=>{"use strict";var D1e=ws&&ws.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),OX=ws&&ws.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&D1e(e,t,n)};Object.defineProperty(ws,"__esModule",{value:!0});OX(AX(),ws);OX(yX(),ws)});var cN=m(oS=>{"use strict";Object.defineProperty(oS,"__esModule",{value:!0});oS.addSqlCommenterComment=void 0;var aN=(L(),I(V)),w1e=fe();function k1e(t){let e=t.indexOf("--");if(e>=0)return!0;if(t.indexOf("/*")<0)return!1;let r=t.indexOf("*/");return e<r}function V1e(t){return encodeURIComponent(t).replace(/[!'()*]/g,e=>`%${e.charCodeAt(0).toString(16).toUpperCase()}`)}function B1e(t,e){if(typeof e!="string"||e.length===0||k1e(e))return e;let n=new w1e.W3CTraceContextPropagator,r={};n.inject(aN.trace.setSpan(aN.ROOT_CONTEXT,t),r,aN.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return e;let s=o.map(i=>{let a=V1e(r[i]);return`${i}='${a}'`}).join(",");return`${e} /*${s}*/`}oS.addSqlCommenterComment=B1e});var MX=m(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.getConnectionPrototypeToInstrument=Zn.once=Zn.getSpanName=Zn.getDbStatement=Zn.getConnectionAttributes=void 0;var wo=(Re(),I(et));function G1e(t){let{host:e,port:n,database:r,user:o}=H1e(t),s=parseInt(n,10);return isNaN(s)?{[wo.SEMATTRS_NET_PEER_NAME]:e,[wo.SEMATTRS_DB_CONNECTION_STRING]:bX(e,n,r),[wo.SEMATTRS_DB_NAME]:r,[wo.SEMATTRS_DB_USER]:o}:{[wo.SEMATTRS_NET_PEER_NAME]:e,[wo.SEMATTRS_NET_PEER_PORT]:s,[wo.SEMATTRS_DB_CONNECTION_STRING]:bX(e,n,r),[wo.SEMATTRS_DB_NAME]:r,[wo.SEMATTRS_DB_USER]:o}}Zn.getConnectionAttributes=G1e;function H1e(t){let{host:e,port:n,database:r,user:o}=t&&t.connectionConfig||t||{};return{host:e,port:n,database:r,user:o}}function bX(t,e,n){let r=`jdbc:mysql://${t||"localhost"}`;return typeof e=="number"&&(r+=`:${e}`),typeof n=="string"&&(r+=`/${n}`),r}function F1e(t,e,n){return e?typeof t=="string"?n?e(t,n):t:n||t.values?e(t.sql,n||t.values):t.sql:typeof t=="string"?t:t.sql}Zn.getDbStatement=F1e;function $1e(t){let e=typeof t=="object"?t.sql:t,n=e?.indexOf(" ");return typeof n=="number"&&n!==-1?e?.substring(0,n):e}Zn.getSpanName=$1e;var j1e=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Zn.once=j1e;function q1e(t){let e=t.prototype,n=Object.getPrototypeOf(e);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:e}Zn.getConnectionPrototypeToInstrument=q1e});var LX=m(iu=>{"use strict";Object.defineProperty(iu,"__esModule",{value:!0});iu.PACKAGE_NAME=iu.PACKAGE_VERSION=void 0;iu.PACKAGE_VERSION="0.45.2";iu.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var wX=m(iS=>{"use strict";Object.defineProperty(iS,"__esModule",{value:!0});iS.MySQL2Instrumentation=void 0;var xX=(L(),I(V)),na=de(),lN=(Re(),I(et)),DX=cN(),au=MX(),UX=LX(),uN=[">=1.4.2 <4"],sS=class t extends na.InstrumentationBase{constructor(e={}){super(UX.PACKAGE_NAME,UX.PACKAGE_VERSION,e)}init(){let e;function n(s){!e&&s.format&&(e=s.format)}let r=s=>{(0,na.isWrapped)(s.query)&&this._unwrap(s,"query"),this._wrap(s,"query",this._patchQuery(e,!1)),(0,na.isWrapped)(s.execute)&&this._unwrap(s,"execute"),this._wrap(s,"execute",this._patchQuery(e,!0))},o=s=>{this._unwrap(s,"query"),this._unwrap(s,"execute")};return[new na.InstrumentationNodeModuleDefinition("mysql2",uN,s=>(n(s),s),()=>{},[new na.InstrumentationNodeModuleFile("mysql2/promise.js",uN,s=>(n(s),s),()=>{}),new na.InstrumentationNodeModuleFile("mysql2/lib/connection.js",uN,s=>{let i=(0,au.getConnectionPrototypeToInstrument)(s);return r(i),s},s=>{if(s===void 0)return;let i=(0,au.getConnectionPrototypeToInstrument)(s);o(i)})])]}_patchQuery(e,n){return r=>{let o=this;return function(s,i,a){let c;Array.isArray(i)?c=i:arguments[2]&&(c=[i]);let u=o.tracer.startSpan((0,au.getSpanName)(s),{kind:xX.SpanKind.CLIENT,attributes:Object.assign(Object.assign(Object.assign({},t.COMMON_ATTRIBUTES),(0,au.getConnectionAttributes)(this.config)),{[lN.SEMATTRS_DB_STATEMENT]:(0,au.getDbStatement)(s,e,c)})});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=s=typeof s=="string"?(0,DX.addSqlCommenterComment)(u,s):Object.assign(s,{sql:(0,DX.addSqlCommenterComment)(u,s.sql)}));let l=(0,au.once)((d,p)=>{if(d)u.setStatus({code:xX.SpanStatusCode.ERROR,message:d.message});else{let{responseHook:_}=o.getConfig();typeof _=="function"&&(0,na.safeExecuteInTheMiddle)(()=>{_(u,{queryResults:p})},f=>{f&&o._diag.warn("Failed executing responseHook",f)},!0)}u.end()});if(arguments.length===1){typeof s.onResult=="function"&&o._wrap(s,"onResult",o._patchCallbackQuery(l));let d=r.apply(this,arguments);return d.once("error",p=>{l(p)}).once("result",p=>{l(void 0,p)}),d}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(l)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(l)),r.apply(this,arguments)}}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r,o),n(...arguments)}}};iS.MySQL2Instrumentation=sS;sS.COMMON_ATTRIBUTES={[lN.SEMATTRS_DB_SYSTEM]:lN.DBSYSTEMVALUES_MYSQL}});var VX=m(kX=>{"use strict";Object.defineProperty(kX,"__esModule",{value:!0})});var GX=m(ks=>{"use strict";var Y1e=ks&&ks.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),BX=ks&&ks.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Y1e(e,t,n)};Object.defineProperty(ks,"__esModule",{value:!0});BX(wX(),ks);BX(VX(),ks)});var qX=m(aS=>{"use strict";Object.defineProperty(aS,"__esModule",{value:!0});aS.endSpan=void 0;var W1e=(L(),I(V)),z1e=(t,e)=>{e&&(t.recordException(e),t.setStatus({code:W1e.SpanStatusCode.ERROR,message:e.message})),t.end()};aS.endSpan=z1e});var dN=m(cS=>{"use strict";Object.defineProperty(cS,"__esModule",{value:!0});cS.defaultDbStatementSerializer=void 0;var X1e=[{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}],J1e=(t,e)=>{var n,r;if(Array.isArray(e)&&e.length){let o=(r=(n=X1e.find(({regex:i})=>i.test(t)))===null||n===void 0?void 0:n.args)!==null&&r!==void 0?r:0,s=o>=0?e.slice(0,o):e;return e.length>s.length&&s.push(`[${e.length-o} other arguments]`),`${t} ${s.join(" ")}`}return t};cS.defaultDbStatementSerializer=J1e});var YX=m(cu=>{"use strict";Object.defineProperty(cu,"__esModule",{value:!0});cu.PACKAGE_NAME=cu.PACKAGE_VERSION=void 0;cu.PACKAGE_VERSION="0.47.1";cu.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var XX=m(lS=>{"use strict";Object.defineProperty(lS,"__esModule",{value:!0});lS.IORedisInstrumentation=void 0;var Vs=(L(),I(V)),uS=de(),Qn=(Re(),I(et)),KX=de(),Id=qX(),Z1e=dN(),WX=YX(),zX={requireParentSpan:!0},pN=class extends uS.InstrumentationBase{constructor(e={}){super(WX.PACKAGE_NAME,WX.PACKAGE_VERSION,Object.assign(Object.assign({},zX),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},zX),e))}init(){return[new uS.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(e,n)=>{let r=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,uS.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,uS.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),e},e=>{if(e===void 0)return;let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(e){return n=>this._traceSendCommand(n,e)}_patchConnection(){return e=>this._traceConnection(e)}_traceSendCommand(e,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return e.apply(this,arguments);let s=r.getConfig(),i=s.dbStatementSerializer||Z1e.defaultDbStatementSerializer,a=Vs.trace.getSpan(Vs.context.active())===void 0;if(s.requireParentSpan===!0&&a)return e.apply(this,arguments);let c=r.tracer.startSpan(o.name,{kind:Vs.SpanKind.CLIENT,attributes:{[Qn.SEMATTRS_DB_SYSTEM]:Qn.DBSYSTEMVALUES_REDIS,[Qn.SEMATTRS_DB_STATEMENT]:i(o.name,o.args)}}),{requestHook:u}=s;u&&(0,KX.safeExecuteInTheMiddle)(()=>u(c,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),p=>{p&&Vs.diag.error("ioredis instrumentation: request hook failed",p)},!0);let{host:l,port:d}=this.options;c.setAttributes({[Qn.SEMATTRS_NET_PEER_NAME]:l,[Qn.SEMATTRS_NET_PEER_PORT]:d,[Qn.SEMATTRS_DB_CONNECTION_STRING]:`redis://${l}:${d}`});try{let p=e.apply(this,arguments),_=o.resolve;o.resolve=function(E){(0,KX.safeExecuteInTheMiddle)(()=>{var S;return(S=s.responseHook)===null||S===void 0?void 0:S.call(s,c,o.name,o.args,E)},S=>{S&&Vs.diag.error("ioredis instrumentation: response hook failed",S)},!0),(0,Id.endSpan)(c,null),_(E)};let f=o.reject;return o.reject=function(E){(0,Id.endSpan)(c,E),f(E)},p}catch(p){throw(0,Id.endSpan)(c,p),p}}}_traceConnection(e){let n=this;return function(){let r=Vs.trace.getSpan(Vs.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return e.apply(this,arguments);let o=n.tracer.startSpan("connect",{kind:Vs.SpanKind.CLIENT,attributes:{[Qn.SEMATTRS_DB_SYSTEM]:Qn.DBSYSTEMVALUES_REDIS,[Qn.SEMATTRS_DB_STATEMENT]:"connect"}}),{host:s,port:i}=this.options;o.setAttributes({[Qn.SEMATTRS_NET_PEER_NAME]:s,[Qn.SEMATTRS_NET_PEER_PORT]:i,[Qn.SEMATTRS_DB_CONNECTION_STRING]:`redis://${s}:${i}`});try{let a=e.apply(this,arguments);return(0,Id.endSpan)(o,null),a}catch(a){throw(0,Id.endSpan)(o,a),a}}}};lS.IORedisInstrumentation=pN});var ZX=m(JX=>{"use strict";Object.defineProperty(JX,"__esModule",{value:!0})});var e9=m(Bs=>{"use strict";var Q1e=Bs&&Bs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),QX=Bs&&Bs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Q1e(e,t,n)};Object.defineProperty(Bs,"__esModule",{value:!0});QX(XX(),Bs);QX(ZX(),Bs)});var t9=m(dS=>{"use strict";Object.defineProperty(dS,"__esModule",{value:!0});dS.getClientAttributes=void 0;var Pd=(Re(),I(et));function eke(t,e){var n,r;return{[Pd.SEMATTRS_DB_SYSTEM]:Pd.DBSYSTEMVALUES_REDIS,[Pd.SEMATTRS_NET_PEER_NAME]:(n=e?.socket)===null||n===void 0?void 0:n.host,[Pd.SEMATTRS_NET_PEER_PORT]:(r=e?.socket)===null||r===void 0?void 0:r.port,[Pd.SEMATTRS_DB_CONNECTION_STRING]:tke(t,e?.url)}}dS.getClientAttributes=eke;function tke(t,e){if(!(typeof e!="string"||!e))try{let n=new URL(e);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){t.error("failed to sanitize redis connection url",n)}}});var n9=m(uu=>{"use strict";Object.defineProperty(uu,"__esModule",{value:!0});uu.PACKAGE_NAME=uu.PACKAGE_VERSION=void 0;uu.PACKAGE_VERSION="0.46.1";uu.PACKAGE_NAME="@opentelemetry/instrumentation-redis-4"});var a9=m(_S=>{"use strict";Object.defineProperty(_S,"__esModule",{value:!0});_S.RedisInstrumentation=void 0;var er=(L(),I(V)),Nt=de(),r9=t9(),nke=dN(),o9=n9(),rke=(Re(),I(et)),bd=Symbol("opentelemetry.instrumentation.redis.open_spans"),s9=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),i9={requireParentSpan:!1},pS=class t extends Nt.InstrumentationBase{constructor(e={}){super(o9.PACKAGE_NAME,o9.PACKAGE_VERSION,Object.assign(Object.assign({},i9),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},i9),e))}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(e){let n=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/commander.js`,["^1.0.0"],(s,i)=>{let a=s.transformCommandArguments;if(!a)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),s;let c=i?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,Nt.isWrapped)(s?.[c])&&this._unwrap(s,c),this._wrap(s,c,this._getPatchExtendWithCommands(a)),s},s=>{(0,Nt.isWrapped)(s?.extendWithCommands)&&this._unwrap(s,"extendWithCommands"),(0,Nt.isWrapped)(s?.attachCommands)&&this._unwrap(s,"attachCommands")}),r=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/client/multi-command.js`,["^1.0.0"],s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;return(0,Nt.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec()),(0,Nt.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),s},s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;(0,Nt.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,Nt.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new Nt.InstrumentationNodeModuleFile(`${e}/dist/lib/client/index.js`,["^1.0.0"],s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;return a?.multi&&((0,Nt.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,Nt.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,Nt.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),s},s=>{var i;let a=(i=s?.default)===null||i===void 0?void 0:i.prototype;(0,Nt.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,Nt.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,Nt.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new Nt.InstrumentationNodeModuleDefinition(e,["^1.0.0"],s=>s,()=>{},[n,r,o])}_getPatchExtendWithCommands(e){let n=this;return function(o){return function(i){var a;if(((a=i?.BaseClass)===null||a===void 0?void 0:a.name)!=="RedisClient")return o.apply(this,arguments);let c=i.executor;return i.executor=function(u,l){let d=e(u,l).args;return n._traceClientCommand(c,this,arguments,d)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(){let e=this;return function(r){return function(){let s=r.apply(this,arguments);return typeof s?.then!="function"?(e._diag.error("got non promise result when patching RedisClientMultiCommand.exec"),s):s.then(i=>{let a=this[bd];return e._endSpansWithRedisReplies(a,i),i}).catch(i=>{let a=this[bd];if(!a)e._diag.error("cannot find open spans to end for redis multi command");else{let c=i.constructor.name==="MultiErrorReply"?i.replies:new Array(a.length).fill(i);e._endSpansWithRedisReplies(a,c)}return Promise.reject(i)})}}}_getPatchMultiCommandsAddCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[s9]=this.options,o}}}_getPatchRedisClientSendCommand(){let e=this;return function(r){return function(s){return e._traceClientCommand(r,this,arguments,s)}}}_getPatchedClientConnect(){let e=this;return function(r){return function(){let s=this.options,i=(0,r9.getClientAttributes)(e._diag,s),a=e.tracer.startSpan(`${t.COMPONENT}-connect`,{kind:er.SpanKind.CLIENT,attributes:i});return er.context.with(er.trace.setSpan(er.context.active(),a),()=>r.apply(this)).then(u=>(a.end(),u)).catch(u=>(a.recordException(u),a.setStatus({code:er.SpanStatusCode.ERROR,message:u.message}),a.end(),Promise.reject(u)))}}}_traceClientCommand(e,n,r,o){if(er.trace.getSpan(er.context.active())===void 0&&this.getConfig().requireParentSpan)return e.apply(n,r);let i=n.options||n[s9],a=o[0],c=o.slice(1),u=this.getConfig().dbStatementSerializer||nke.defaultDbStatementSerializer,l=(0,r9.getClientAttributes)(this._diag,i);try{let _=u(a,c);_!=null&&(l[rke.SEMATTRS_DB_STATEMENT]=_)}catch(_){this._diag.error("dbStatementSerializer throw an exception",_,{commandName:a})}let d=this.tracer.startSpan(`${t.COMPONENT}-${a}`,{kind:er.SpanKind.CLIENT,attributes:l}),p=er.context.with(er.trace.setSpan(er.context.active(),d),()=>e.apply(n,r));if(typeof p?.then=="function")p.then(_=>{this._endSpanWithResponse(d,a,c,_,void 0)},_=>{this._endSpanWithResponse(d,a,c,null,_)});else{let _=p;_[bd]=_[bd]||[],_[bd].push({span:d,commandName:a,commandArgs:c})}return p}_endSpansWithRedisReplies(e,n){if(!e)return this._diag.error("cannot find open spans to end for redis multi command");if(n.length!==e.length)return this._diag.error("number of multi command spans does not match response from redis");for(let r=0;r<e.length;r++){let{span:o,commandName:s,commandArgs:i}=e[r],a=n[r],[c,u]=a instanceof Error?[null,a]:[a,void 0];this._endSpanWithResponse(o,s,i,c,u)}}_endSpanWithResponse(e,n,r,o,s){let{responseHook:i}=this.getConfig();if(!s&&i)try{i(e,n,r,o)}catch(a){this._diag.error("responseHook throw an exception",a)}s&&(e.recordException(s),e.setStatus({code:er.SpanStatusCode.ERROR,message:s?.message})),e.end()}};_S.RedisInstrumentation=pS;pS.COMPONENT="redis"});var u9=m(c9=>{"use strict";Object.defineProperty(c9,"__esModule",{value:!0})});var d9=m(Gs=>{"use strict";var oke=Gs&&Gs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),l9=Gs&&Gs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&oke(e,t,n)};Object.defineProperty(Gs,"__esModule",{value:!0});l9(a9(),Gs);l9(u9(),Gs)});var R9=m(fS=>{"use strict";Object.defineProperty(fS,"__esModule",{value:!0});fS.EVENT_LISTENERS_SET=void 0;fS.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var EN=m(Ld=>{"use strict";Object.defineProperty(Ld,"__esModule",{value:!0});Ld.AttributeNames=void 0;var dke;(function(t){t.PG_VALUES="db.postgresql.values",t.PG_PLAN="db.postgresql.plan",t.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",t.MAX_CLIENT="db.postgresql.max.client"})(dke=Ld.AttributeNames||(Ld.AttributeNames={}))});var SN=m(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.METRIC_DB_CLIENT_OPERATION_DURATION=ot.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=ot.METRIC_DB_CLIENT_CONNECTION_COUNT=ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED=ot.ATTR_DB_OPERATION_NAME=ot.ATTR_DB_NAMESPACE=ot.ATTR_DB_CLIENT_CONNECTION_STATE=ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;ot.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";ot.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";ot.ATTR_DB_NAMESPACE="db.namespace";ot.ATTR_DB_OPERATION_NAME="db.operation.name";ot.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";ot.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";ot.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";ot.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests";ot.METRIC_DB_CLIENT_OPERATION_DURATION="db.client.operation.duration"});var TN=m(xd=>{"use strict";Object.defineProperty(xd,"__esModule",{value:!0});xd.SpanNames=void 0;var pke;(function(t){t.QUERY_PREFIX="pg.query",t.CONNECT="pg.connect",t.POOL_CONNECT="pg-pool.connect"})(pke=xd.SpanNames||(xd.SpanNames={}))});var P9=m(Se=>{"use strict";Object.defineProperty(Se,"__esModule",{value:!0});Se.isObjectWithTextString=Se.getErrorMessage=Se.patchClientConnectCallback=Se.patchCallbackPGPool=Se.updateCounter=Se.getPoolName=Se.patchCallback=Se.handleExecutionResult=Se.handleConfigQuery=Se.shouldSkipInstrumentation=Se.getSemanticAttributesFromPool=Se.getSemanticAttributesFromConnection=Se.getConnectionString=Se.parseNormalizedOperationName=Se.getQuerySpanName=void 0;var Hs=(L(),I(V)),mS=EN(),Wt=(Re(),I(et)),ra=SN(),_ke=de(),y9=TN();function O9(t,e){if(!e)return y9.SpanNames.QUERY_PREFIX;let n=typeof e.name=="string"&&e.name?e.name:N9(e.text);return`${y9.SpanNames.QUERY_PREFIX}:${n}${t?` ${t}`:""}`}Se.getQuerySpanName=O9;function N9(t){let e=t.indexOf(" "),n=e===-1?t:t.slice(0,e);return n=n.toUpperCase(),n.endsWith(";")?n.slice(0,-1):n}Se.parseNormalizedOperationName=N9;function gN(t){let e=t.host||"localhost",n=t.port||5432,r=t.database||"";return`postgresql://${e}:${n}/${r}`}Se.getConnectionString=gN;function C9(t){if(Number.isInteger(t))return t}function v9(t){return{[Wt.SEMATTRS_DB_SYSTEM]:Wt.DBSYSTEMVALUES_POSTGRESQL,[Wt.SEMATTRS_DB_NAME]:t.database,[Wt.SEMATTRS_DB_CONNECTION_STRING]:gN(t),[Wt.SEMATTRS_NET_PEER_NAME]:t.host,[Wt.SEMATTRS_NET_PEER_PORT]:C9(t.port),[Wt.SEMATTRS_DB_USER]:t.user}}Se.getSemanticAttributesFromConnection=v9;function fke(t){return{[Wt.SEMATTRS_DB_SYSTEM]:Wt.DBSYSTEMVALUES_POSTGRESQL,[Wt.SEMATTRS_DB_NAME]:t.database,[Wt.SEMATTRS_DB_CONNECTION_STRING]:gN(t),[Wt.SEMATTRS_NET_PEER_NAME]:t.host,[Wt.SEMATTRS_NET_PEER_PORT]:C9(t.port),[Wt.SEMATTRS_DB_USER]:t.user,[mS.AttributeNames.IDLE_TIMEOUT_MILLIS]:t.idleTimeoutMillis,[mS.AttributeNames.MAX_CLIENT]:t.maxClient}}Se.getSemanticAttributesFromPool=fke;function mke(t){return t.requireParentSpan===!0&&Hs.trace.getSpan(Hs.context.active())===void 0}Se.shouldSkipInstrumentation=mke;function Eke(t,e,n){let{connectionParameters:r}=this,o=r.database,s=O9(o,n),i=t.startSpan(s,{kind:Hs.SpanKind.CLIENT,attributes:v9(r)});if(!n)return i;if(n.text&&i.setAttribute(Wt.SEMATTRS_DB_STATEMENT,n.text),e.enhancedDatabaseReporting&&Array.isArray(n.values))try{let a=n.values.map(c=>c==null?"null":c instanceof Buffer?c.toString():typeof c=="object"?typeof c.toPostgres=="function"?c.toPostgres():JSON.stringify(c):c.toString());i.setAttribute(mS.AttributeNames.PG_VALUES,a)}catch(a){Hs.diag.error("failed to stringify ",n.values,a)}return typeof n.name=="string"&&i.setAttribute(mS.AttributeNames.PG_PLAN,n.name),i}Se.handleConfigQuery=Eke;function I9(t,e,n){typeof t.responseHook=="function"&&(0,_ke.safeExecuteInTheMiddle)(()=>{t.responseHook(e,{data:n})},r=>{r&&Hs.diag.error("Error running response hook",r)},!0)}Se.handleExecutionResult=I9;function Ske(t,e,n,r,o){return function(i,a){i?(Object.prototype.hasOwnProperty.call(i,"code")&&(r[Wt.ATTR_ERROR_TYPE]=i.code),e.setStatus({code:Hs.SpanStatusCode.ERROR,message:i.message})):I9(t,e,a),o(),e.end(),n.call(this,i,a)}}Se.patchCallback=Ske;function Tke(t){let e="";return e+=(t?.host?`${t.host}`:"unknown_host")+":",e+=(t?.port?`${t.port}`:"unknown_port")+"/",e+=t?.database?`${t.database}`:"unknown_database",e.trim()}Se.getPoolName=Tke;function gke(t,e,n,r,o){let s=e.totalCount,i=e.waitingCount,a=e.idleCount,c=s-a;return n.add(c-o.used,{[ra.ATTR_DB_CLIENT_CONNECTION_STATE]:ra.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),n.add(a-o.idle,{[ra.ATTR_DB_CLIENT_CONNECTION_STATE]:ra.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),r.add(i-o.pending,{[ra.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:t}),{used:c,idle:a,pending:i}}Se.updateCounter=gke;function hke(t,e){return function(r,o,s){r&&t.setStatus({code:Hs.SpanStatusCode.ERROR,message:r.message}),t.end(),e.call(this,r,o,s)}}Se.patchCallbackPGPool=hke;function Ake(t,e){return function(r){r&&t.setStatus({code:Hs.SpanStatusCode.ERROR,message:r.message}),t.end(),e.apply(this,arguments)}}Se.patchClientConnectCallback=Ake;function Rke(t){return typeof t=="object"&&t!==null&&"message"in t?String(t.message):void 0}Se.getErrorMessage=Rke;function yke(t){var e;return typeof t=="object"&&typeof((e=t)===null||e===void 0?void 0:e.text)=="string"}Se.isObjectWithTextString=yke});var b9=m(lu=>{"use strict";Object.defineProperty(lu,"__esModule",{value:!0});lu.PACKAGE_NAME=lu.PACKAGE_VERSION=void 0;lu.PACKAGE_VERSION="0.51.1";lu.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var w9=m(TS=>{"use strict";Object.defineProperty(TS,"__esModule",{value:!0});TS.PgInstrumentation=void 0;var tr=de(),ye=(L(),I(V)),M9=R9(),st=P9(),L9=cN(),x9=b9(),D9=TN(),ES=fe(),Fs=(Re(),I(et)),oa=SN();function SS(t){return t[Symbol.toStringTag]==="Module"?t.default:t}var hN=class extends tr.InstrumentationBase{constructor(e={}){super(x9.PACKAGE_NAME,x9.PACKAGE_VERSION,e),this._connectionsCounter={used:0,idle:0,pending:0}}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(oa.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:ye.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(oa.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(oa.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let e=[">=8.0.3 <9"],n=new tr.InstrumentationNodeModuleFile("pg/lib/native/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),r=new tr.InstrumentationNodeModuleFile("pg/lib/client.js",e,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new tr.InstrumentationNodeModuleDefinition("pg",e,i=>{let a=SS(i);return this._patchPgClient(a.Client),i},i=>{let a=SS(i);return this._unpatchPgClient(a.Client),i},[r,n]),s=new tr.InstrumentationNodeModuleDefinition("pg-pool",[">=2.0.0 <4"],i=>((0,tr.isWrapped)(i.prototype.connect)&&this._unwrap(i.prototype,"connect"),this._wrap(i.prototype,"connect",this._getPoolConnectPatch()),i),i=>{(0,tr.isWrapped)(i.prototype.connect)&&this._unwrap(i.prototype,"connect")});return[o,s]}_patchPgClient(e){if(!e)return;let n=SS(e);return(0,tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),e}_unpatchPgClient(e){let n=SS(e);return(0,tr.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,tr.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),e}_getClientConnectPatch(){let e=this;return n=>function(o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.call(this,o);let s=e.tracer.startSpan(D9.SpanNames.CONNECT,{kind:ye.SpanKind.CLIENT,attributes:st.getSemanticAttributesFromConnection(this)});if(o){let a=ye.trace.getSpan(ye.context.active());o=st.patchClientConnectCallback(s,o),a&&(o=ye.context.bind(ye.context.active(),o))}let i=ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>n.call(this,o));return U9(s,i)}}recordOperationDuration(e,n){let r={};[Fs.SEMATTRS_DB_SYSTEM,oa.ATTR_DB_NAMESPACE,Fs.ATTR_ERROR_TYPE,Fs.ATTR_SERVER_PORT,Fs.ATTR_SERVER_ADDRESS,oa.ATTR_DB_OPERATION_NAME].forEach(i=>{i in e&&(r[i]=e[i])});let s=(0,ES.hrTimeToMilliseconds)((0,ES.hrTimeDuration)(n,(0,ES.hrTime)()))/1e3;this._operationDuration.record(s,r)}_getClientQueryPatch(){let e=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.apply(this,o);let s=(0,ES.hrTime)(),i=o[0],a=typeof i=="string",c=st.isObjectWithTextString(i),u=a?{text:i,values:Array.isArray(o[1])?o[1]:void 0}:c?i:void 0,l={[Fs.SEMATTRS_DB_SYSTEM]:Fs.DBSYSTEMVALUES_POSTGRESQL,[oa.ATTR_DB_NAMESPACE]:this.database,[Fs.ATTR_SERVER_PORT]:this.connectionParameters.port,[Fs.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};u?.text&&(l[oa.ATTR_DB_OPERATION_NAME]=st.parseNormalizedOperationName(u?.text));let d=()=>{e.recordOperationDuration(l,s)},p=e.getConfig(),_=st.handleConfigQuery.call(this,e.tracer,p,u);if(p.addSqlCommenterCommentToQueries&&(a?o[0]=(0,L9.addSqlCommenterComment)(_,i):c&&!("name"in i)&&(o[0]=Object.assign(Object.assign({},i),{text:(0,L9.addSqlCommenterComment)(_,i.text)}))),o.length>0){let S=ye.trace.getSpan(ye.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=st.patchCallback(p,_,o[o.length-1],l,d),S&&(o[o.length-1]=ye.context.bind(ye.context.active(),o[o.length-1]));else if(typeof u?.callback=="function"){let g=st.patchCallback(e.getConfig(),_,u.callback,l,d);S&&(g=ye.context.bind(ye.context.active(),g)),o[0].callback=g}}let{requestHook:f}=p;typeof f=="function"&&u&&(0,tr.safeExecuteInTheMiddle)(()=>{let{database:S,host:g,port:h,user:O}=this.connectionParameters;f(_,{connection:{database:S,host:g,port:h,user:O},query:{text:u.text,values:u.values,name:u.name}})},S=>{S&&e._diag.error("Error running query hook",S)},!0);let E;try{E=n.apply(this,o)}catch(S){throw _.setStatus({code:ye.SpanStatusCode.ERROR,message:st.getErrorMessage(S)}),_.end(),S}return E instanceof Promise?E.then(S=>new Promise(g=>{st.handleExecutionResult(e.getConfig(),_,S),d(),_.end(),g(S)})).catch(S=>new Promise((g,h)=>{_.setStatus({code:ye.SpanStatusCode.ERROR,message:S.message}),d(),_.end(),h(S)})):E})}_setPoolConnectEventListeners(e){if(e[M9.EVENT_LISTENERS_SET])return;let n=st.getPoolName(e.options);e.on("connect",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("acquire",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("remove",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e.on("release",()=>{this._connectionsCounter=st.updateCounter(n,e,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),e[M9.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let e=this;return n=>function(o){if(st.shouldSkipInstrumentation(e.getConfig()))return n.call(this,o);let s=e.tracer.startSpan(D9.SpanNames.POOL_CONNECT,{kind:ye.SpanKind.CLIENT,attributes:st.getSemanticAttributesFromPool(this.options)});if(e._setPoolConnectEventListeners(this),o){let a=ye.trace.getSpan(ye.context.active());o=st.patchCallbackPGPool(s,o),a&&(o=ye.context.bind(ye.context.active(),o))}let i=ye.context.with(ye.trace.setSpan(ye.context.active(),s),()=>n.call(this,o));return U9(s,i)}}};TS.PgInstrumentation=hN;function U9(t,e){if(!(e instanceof Promise))return e;let n=e;return ye.context.bind(ye.context.active(),n.then(r=>(t.end(),r)).catch(r=>(t.setStatus({code:ye.SpanStatusCode.ERROR,message:st.getErrorMessage(r)}),t.end(),Promise.reject(r))))}});var V9=m(k9=>{"use strict";Object.defineProperty(k9,"__esModule",{value:!0})});var B9=m(ko=>{"use strict";var Oke=ko&&ko.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),AN=ko&&ko.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Oke(e,t,n)};Object.defineProperty(ko,"__esModule",{value:!0});AN(w9(),ko);AN(V9(),ko);AN(EN(),ko)});var n8=m(du=>{"use strict";Object.defineProperty(du,"__esModule",{value:!0});du.PACKAGE_NAME=du.PACKAGE_VERSION=void 0;du.PACKAGE_VERSION="0.45.2";du.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var vN=m(ro=>{"use strict";Object.defineProperty(ro,"__esModule",{value:!0});ro.HapiLifecycleMethodNames=ro.HapiLayerType=ro.handlerPatched=ro.HapiComponentName=void 0;ro.HapiComponentName="@hapi/hapi";ro.handlerPatched=Symbol("hapi-handler-patched");ro.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};ro.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var IN=m(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0});Dd.AttributeNames=void 0;var kke;(function(t){t.HAPI_TYPE="hapi.type",t.PLUGIN_NAME="hapi.plugin.name",t.EXT_TYPE="server.ext.type"})(kke=Dd.AttributeNames||(Dd.AttributeNames={}))});var r8=m(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.getPluginFromInput=it.getExtMetadata=it.getRouteMetadata=it.isPatchableExtMethod=it.isDirectExtInput=it.isLifecycleExtEventObj=it.isLifecycleExtType=it.getPluginName=void 0;var hS=(Re(),I(et)),Ud=vN(),$s=IN();function Vke(t){return t.name?t.name:t.pkg.name}it.getPluginName=Vke;var Bke=t=>typeof t=="string"&&Ud.HapiLifecycleMethodNames.has(t);it.isLifecycleExtType=Bke;var Gke=t=>{var e;let n=(e=t)===null||e===void 0?void 0:e.type;return n!==void 0&&(0,it.isLifecycleExtType)(n)};it.isLifecycleExtEventObj=Gke;var Hke=t=>Array.isArray(t)&&t.length<=3&&(0,it.isLifecycleExtType)(t[0])&&typeof t[1]=="function";it.isDirectExtInput=Hke;var Fke=t=>!Array.isArray(t);it.isPatchableExtMethod=Fke;var $ke=(t,e)=>e?{attributes:{[hS.SEMATTRS_HTTP_ROUTE]:t.path,[hS.SEMATTRS_HTTP_METHOD]:t.method,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.PLUGIN,[$s.AttributeNames.PLUGIN_NAME]:e},name:`${e}: route - ${t.path}`}:{attributes:{[hS.SEMATTRS_HTTP_ROUTE]:t.path,[hS.SEMATTRS_HTTP_METHOD]:t.method,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.ROUTER},name:`route - ${t.path}`};it.getRouteMetadata=$ke;var jke=(t,e)=>e?{attributes:{[$s.AttributeNames.EXT_TYPE]:t,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT,[$s.AttributeNames.PLUGIN_NAME]:e},name:`${e}: ext - ${t}`}:{attributes:{[$s.AttributeNames.EXT_TYPE]:t,[$s.AttributeNames.HAPI_TYPE]:Ud.HapiLayerType.EXT},name:`ext - ${t}`};it.getExtMetadata=jke;var qke=t=>"plugin"in t?"plugin"in t.plugin?t.plugin.plugin:t.plugin:t;it.getPluginFromInput=qke});var i8=m(RS=>{"use strict";Object.defineProperty(RS,"__esModule",{value:!0});RS.HapiInstrumentation=void 0;var Mn=(L(),I(V)),o8=fe(),AS=de(),s8=n8(),wd=vN(),Bo=r8(),PN=class extends AS.InstrumentationBase{constructor(e={}){super(s8.PACKAGE_NAME,s8.PACKAGE_VERSION,e)}init(){return new AS.InstrumentationNodeModuleDefinition(wd.HapiComponentName,[">=17.0.0 <22"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return(0,AS.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,AS.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;this._massUnwrap([n],["server","Server"])})}_getServerPatch(e){let n=this,r=this;return function(s){let i=e.apply(this,[s]);return r._wrap(i,"route",a=>n._getServerRoutePatch.bind(n)(a)),r._wrap(i,"ext",a=>n._getServerExtPatch.bind(n)(a)),r._wrap(i,"register",n._getServerRegisterPatch.bind(n)),i}}_getServerRegisterPatch(e){let n=this;return function(o,s){if(Array.isArray(o))for(let i of o){let a=(0,Bo.getPluginFromInput)(i);n._wrapRegisterHandler(a)}else{let i=(0,Bo.getPluginFromInput)(o);n._wrapRegisterHandler(i)}return e.apply(this,[o,s])}}_getServerExtPatch(e,n){let r=this;return function(...s){if(Array.isArray(s[0])){let i=s[0];for(let a=0;a<i.length;a++){let c=i[a];if((0,Bo.isLifecycleExtType)(c.type)){let u=c,l=r._wrapExtMethods(u.method,c.type,n);u.method=l,i[a]=u}}return e.apply(this,s)}else if((0,Bo.isDirectExtInput)(s)){let i=s,a=i[1],c=r._wrapExtMethods(a,i[0],n);return e.apply(this,[i[0],c,i[2]])}else if((0,Bo.isLifecycleExtEventObj)(s[0])){let i=s[0],a=r._wrapExtMethods(i.method,i.type,n);return i.method=a,e.call(this,i)}return e.apply(this,s)}}_getServerRoutePatch(e,n){let r=this;return function(o){if(Array.isArray(o))for(let s=0;s<o.length;s++){let i=r._wrapRouteHandler.call(r,o[s],n);o[s]=i}else o=r._wrapRouteHandler.call(r,o,n);return e.apply(this,[o])}}_wrapRegisterHandler(e){let n=this,r=(0,Bo.getPluginName)(e),o=e.register,s=this,i=function(a,c){return s._wrap(a,"route",u=>n._getServerRoutePatch.bind(n)(u,r)),s._wrap(a,"ext",u=>n._getServerExtPatch.bind(n)(u,r)),o.call(this,a,c)};e.register=i}_wrapExtMethods(e,n,r){let o=this;if(e instanceof Array){for(let s=0;s<e.length;s++)e[s]=o._wrapExtMethods(e[s],n);return e}else if((0,Bo.isPatchableExtMethod)(e))return e[wd.handlerPatched]===!0?e:(e[wd.handlerPatched]=!0,async function(...i){if(Mn.trace.getSpan(Mn.context.active())===void 0)return await e.apply(this,i);let a=(0,Bo.getExtMetadata)(n,r),c=o.tracer.startSpan(a.name,{attributes:a.attributes});try{return await Mn.context.with(Mn.trace.setSpan(Mn.context.active(),c),e,void 0,...i)}catch(u){throw c.recordException(u),c.setStatus({code:Mn.SpanStatusCode.ERROR,message:u.message}),u}finally{c.end()}});return e}_wrapRouteHandler(e,n){var r;let o=this;if(e[wd.handlerPatched]===!0)return e;e[wd.handlerPatched]=!0;let s=i=>async function(...a){if(Mn.trace.getSpan(Mn.context.active())===void 0)return await i.call(this,...a);let c=(0,o8.getRPCMetadata)(Mn.context.active());c?.type===o8.RPCType.HTTP&&(c.route=e.path);let u=(0,Bo.getRouteMetadata)(e,n),l=o.tracer.startSpan(u.name,{attributes:u.attributes});try{return await Mn.context.with(Mn.trace.setSpan(Mn.context.active(),l),()=>i.call(this,...a))}catch(d){throw l.recordException(d),l.setStatus({code:Mn.SpanStatusCode.ERROR,message:d.message}),d}finally{l.end()}};if(typeof e.handler=="function")e.handler=s(e.handler);else if(typeof e.options=="function"){let i=e.options;e.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=s(c.handler)),c}}else typeof((r=e.options)===null||r===void 0?void 0:r.handler)=="function"&&(e.options.handler=s(e.options.handler));return e}};RS.HapiInstrumentation=PN});var c8=m(js=>{"use strict";var Yke=js&&js.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),a8=js&&js.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Yke(e,t,n)};Object.defineProperty(js,"__esModule",{value:!0});a8(i8(),js);a8(IN(),js)});var yS=m(kd=>{"use strict";Object.defineProperty(kd,"__esModule",{value:!0});kd.KoaLayerType=void 0;var Wke;(function(t){t.ROUTER="router",t.MIDDLEWARE="middleware"})(Wke=kd.KoaLayerType||(kd.KoaLayerType={}))});var _8=m(pu=>{"use strict";Object.defineProperty(pu,"__esModule",{value:!0});pu.PACKAGE_NAME=pu.PACKAGE_VERSION=void 0;pu.PACKAGE_VERSION="0.47.1";pu.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var bN=m(Vd=>{"use strict";Object.defineProperty(Vd,"__esModule",{value:!0});Vd.AttributeNames=void 0;var zke;(function(t){t.KOA_TYPE="koa.type",t.KOA_NAME="koa.name"})(zke=Vd.AttributeNames||(Vd.AttributeNames={}))});var m8=m(_u=>{"use strict";Object.defineProperty(_u,"__esModule",{value:!0});_u.isLayerIgnored=_u.getMiddlewareMetadata=void 0;var f8=yS(),OS=bN(),Xke=(Re(),I(et)),Jke=(t,e,n,r)=>{var o;return n?{attributes:{[OS.AttributeNames.KOA_NAME]:r?.toString(),[OS.AttributeNames.KOA_TYPE]:f8.KoaLayerType.ROUTER,[Xke.SEMATTRS_HTTP_ROUTE]:r?.toString()},name:t._matchedRouteName||`router - ${r}`}:{attributes:{[OS.AttributeNames.KOA_NAME]:(o=e.name)!==null&&o!==void 0?o:"middleware",[OS.AttributeNames.KOA_TYPE]:f8.KoaLayerType.MIDDLEWARE},name:`middleware - ${e.name}`}};_u.getMiddlewareMetadata=Jke;var Zke=(t,e)=>{var n;return!!(Array.isArray(e?.ignoreLayersType)&&(!((n=e?.ignoreLayersType)===null||n===void 0)&&n.includes(t)))};_u.isLayerIgnored=Zke});var E8=m(NS=>{"use strict";Object.defineProperty(NS,"__esModule",{value:!0});NS.kLayerPatched=void 0;NS.kLayerPatched=Symbol("koa-layer-patched")});var R8=m(CS=>{"use strict";Object.defineProperty(CS,"__esModule",{value:!0});CS.KoaInstrumentation=void 0;var oo=(L(),I(V)),Bd=de(),S8=yS(),T8=_8(),g8=m8(),h8=fe(),A8=E8(),MN=class extends Bd.InstrumentationBase{constructor(e={}){super(T8.PACKAGE_NAME,T8.PACKAGE_VERSION,e)}init(){return new Bd.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <3"],e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;return n==null?n:((0,Bd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),e)},e=>{let n=e[Symbol.toStringTag]==="Module"?e.default:e;(0,Bd.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(e){let n=this;return function(o){let s;return o.router?s=n._patchRouterDispatch(o):s=n._patchLayer(o,!1),e.apply(this,[s])}}_patchRouterDispatch(e){var n;oo.diag.debug("Patching @koa/router dispatch");let r=e.router,o=(n=r?.stack)!==null&&n!==void 0?n:[];for(let s of o){let i=s.path,a=s.stack;for(let c=0;c<a.length;c++){let u=a[c];a[c]=this._patchLayer(u,!0,i)}}return e}_patchLayer(e,n,r){let o=n?S8.KoaLayerType.ROUTER:S8.KoaLayerType.MIDDLEWARE;return e[A8.kLayerPatched]===!0||(0,g8.isLayerIgnored)(o,this.getConfig())?e:e.constructor.name==="GeneratorFunction"||e.constructor.name==="AsyncGeneratorFunction"?(oo.diag.debug("ignoring generator-based Koa middleware layer"),e):(e[A8.kLayerPatched]=!0,oo.diag.debug("patching Koa middleware layer"),async(s,i)=>{if(oo.trace.getSpan(oo.context.active())===void 0)return e(s,i);let c=(0,g8.getMiddlewareMetadata)(s,e,n,r),u=this.tracer.startSpan(c.name,{attributes:c.attributes}),l=(0,h8.getRPCMetadata)(oo.context.active());l?.type===h8.RPCType.HTTP&&s._matchedRoute&&(l.route=s._matchedRoute.toString());let{requestHook:d}=this.getConfig();d&&(0,Bd.safeExecuteInTheMiddle)(()=>d(u,{context:s,middlewareLayer:e,layerType:o}),_=>{_&&oo.diag.error("koa instrumentation: request hook failed",_)},!0);let p=oo.trace.setSpan(oo.context.active(),u);return oo.context.with(p,async()=>{try{return await e(s,i)}catch(_){throw u.recordException(_),_}finally{u.end()}})})}};CS.KoaInstrumentation=MN});var y8=m(Go=>{"use strict";var Qke=Go&&Go.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),LN=Go&&Go.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&Qke(e,t,n)};Object.defineProperty(Go,"__esModule",{value:!0});LN(R8(),Go);LN(yS(),Go);LN(bN(),Go)});var xN=m(Rr=>{"use strict";Object.defineProperty(Rr,"__esModule",{value:!0});Rr.ConnectNames=Rr.ConnectTypes=Rr.AttributeNames=void 0;var tVe;(function(t){t.CONNECT_TYPE="connect.type",t.CONNECT_NAME="connect.name"})(tVe=Rr.AttributeNames||(Rr.AttributeNames={}));var nVe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request_handler"})(nVe=Rr.ConnectTypes||(Rr.ConnectTypes={}));var rVe;(function(t){t.MIDDLEWARE="middleware",t.REQUEST_HANDLER="request handler"})(rVe=Rr.ConnectNames||(Rr.ConnectNames={}))});var I8=m(fu=>{"use strict";Object.defineProperty(fu,"__esModule",{value:!0});fu.PACKAGE_NAME=fu.PACKAGE_VERSION=void 0;fu.PACKAGE_VERSION="0.43.1";fu.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var P8=m(vS=>{"use strict";Object.defineProperty(vS,"__esModule",{value:!0});vS._LAYERS_STORE_PROPERTY=void 0;vS._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var b8=m(Ys=>{"use strict";Object.defineProperty(Ys,"__esModule",{value:!0});Ys.generateRoute=Ys.replaceCurrentStackRoute=Ys.addNewStackLayer=void 0;var oVe=(L(),I(V)),qs=P8(),sVe=t=>{Array.isArray(t[qs._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(t,qs._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t[qs._LAYERS_STORE_PROPERTY].push("/");let e=t[qs._LAYERS_STORE_PROPERTY].length;return()=>{e===t[qs._LAYERS_STORE_PROPERTY].length?t[qs._LAYERS_STORE_PROPERTY].pop():oVe.diag.warn("Connect: Trying to pop the stack multiple time")}};Ys.addNewStackLayer=sVe;var iVe=(t,e)=>{e&&t[qs._LAYERS_STORE_PROPERTY].splice(-1,1,e)};Ys.replaceCurrentStackRoute=iVe;var aVe=t=>t[qs._LAYERS_STORE_PROPERTY].reduce((e,n)=>e.replace(/\/+$/,"")+n);Ys.generateRoute=aVe});var x8=m(Ks=>{"use strict";Object.defineProperty(Ks,"__esModule",{value:!0});Ks.ConnectInstrumentation=Ks.ANONYMOUS_NAME=void 0;var cVe=(L(),I(V)),M8=fe(),mu=xN(),L8=I8(),IS=de(),uVe=(Re(),I(et)),DN=b8();Ks.ANONYMOUS_NAME="anonymous";var UN=class extends IS.InstrumentationBase{constructor(e={}){super(L8.PACKAGE_NAME,L8.PACKAGE_VERSION,e)}init(){return[new IS.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_patchApp(e){(0,IS.isWrapped)(e.use)||this._wrap(e,"use",this._patchUse.bind(this)),(0,IS.isWrapped)(e.handle)||this._wrap(e,"handle",this._patchHandle.bind(this))}_patchConstructor(e){let n=this;return function(...r){let o=e.apply(this,r);return n._patchApp(o),o}}_patchNext(e,n){return function(o){let s=e.apply(this,[o]);return n(),s}}_startSpan(e,n){let r,o,s;e?(r=mu.ConnectTypes.REQUEST_HANDLER,s=mu.ConnectNames.REQUEST_HANDLER,o=e):(r=mu.ConnectTypes.MIDDLEWARE,s=mu.ConnectNames.MIDDLEWARE,o=n.name||Ks.ANONYMOUS_NAME);let i=`${s} - ${o}`,a={attributes:{[uVe.SEMATTRS_HTTP_ROUTE]:e.length>0?e:"/",[mu.AttributeNames.CONNECT_TYPE]:r,[mu.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(i,a)}_patchMiddleware(e,n){let r=this,o=n.length===4;function s(){if(!r.isEnabled())return n.apply(this,arguments);let[i,a,c]=o?[1,2,3]:[0,1,2],u=arguments[i],l=arguments[a],d=arguments[c];(0,DN.replaceCurrentStackRoute)(u,e);let p=(0,M8.getRPCMetadata)(cVe.context.active());e&&p?.type===M8.RPCType.HTTP&&(p.route=(0,DN.generateRoute)(u));let _="";e?_=`request handler - ${e}`:_=`middleware - ${n.name||Ks.ANONYMOUS_NAME}`;let f=r._startSpan(e,n);r._diag.debug("start span",_);let E=!1;function S(){E?r._diag.debug(`span ${f.name} - already finished`):(E=!0,r._diag.debug(`finishing span ${f.name}`),f.end()),l.removeListener("close",S)}return l.addListener("close",S),arguments[c]=r._patchNext(d,S),n.apply(this,arguments)}return Object.defineProperty(s,"length",{value:n.length,writable:!1,configurable:!0}),s}_patchUse(e){let n=this;return function(...r){let o=r[r.length-1],s=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(s,o),e.apply(this,r)}}_patchHandle(e){let n=this;return function(){let[r,o]=[0,2],s=arguments[r],i=arguments[o],a=(0,DN.addNewStackLayer)(s);return typeof i=="function"&&(arguments[o]=n._patchOut(i,a)),e.apply(this,arguments)}}_patchOut(e,n){return function(...o){return n(),Reflect.apply(e,this,o)}}};Ks.ConnectInstrumentation=UN});var U8=m(Ws=>{"use strict";var lVe=Ws&&Ws.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),D8=Ws&&Ws.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&lVe(e,t,n)};Object.defineProperty(Ws,"__esModule",{value:!0});D8(xN(),Ws);D8(x8(),Ws)});var G8=m(Eu=>{"use strict";Object.defineProperty(Eu,"__esModule",{value:!0});Eu.once=Eu.getSpanName=void 0;function pVe(t,e,n,r){return t==="execBulkLoad"&&r&&e?`${t} ${r} ${e}`:t==="callProcedure"?e?`${t} ${n} ${e}`:`${t} ${n}`:e?`${t} ${e}`:`${t}`}Eu.getSpanName=pVe;var _Ve=t=>{let e=!1;return(...n)=>{if(!e)return e=!0,t(...n)}};Eu.once=_Ve});var H8=m(Su=>{"use strict";Object.defineProperty(Su,"__esModule",{value:!0});Su.PACKAGE_NAME=Su.PACKAGE_VERSION=void 0;Su.PACKAGE_VERSION="0.18.1";Su.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var Y8=m(LS=>{"use strict";Object.defineProperty(LS,"__esModule",{value:!0});LS.TediousInstrumentation=void 0;var Gd=(L(),I(V)),fVe=require("events"),PS=de(),zs=(Re(),I(et)),F8=G8(),$8=H8(),q8=Symbol("opentelemetry.instrumentation-tedious.current-database"),j8=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function bS(t){Object.defineProperty(this,q8,{value:t,writable:!0})}var MS=class t extends PS.InstrumentationBase{constructor(e={}){super($8.PACKAGE_NAME,$8.PACKAGE_VERSION,e)}init(){return[new PS.InstrumentationNodeModuleDefinition(t.COMPONENT,[">=1.11.0 <20"],e=>{let n=e.Connection.prototype;for(let r of j8)(0,PS.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r));return(0,PS.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),e},e=>{if(e===void 0)return;let n=e.Connection.prototype;for(let r of j8)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(e){return function(){var r,o;return bS.call(this,(o=(r=this.config)===null||r===void 0?void 0:r.options)===null||o===void 0?void 0:o.database),this.removeListener("databaseChange",bS),this.on("databaseChange",bS),this.once("end",()=>{this.removeListener("databaseChange",bS)}),e.apply(this,arguments)}}_patchQuery(e){return n=>{let r=this;function o(s){var i,a,c,u,l,d,p,_;if(!(s instanceof fVe.EventEmitter))return r._diag.warn(`Unexpected invocation of patched ${e} method. Span not recorded`),n.apply(this,arguments);let f=0,E=0,S=()=>E++,g=()=>f++,h=this[q8],O=(M=>{var P,J;return M.sqlTextOrProcedure==="sp_prepare"&&(!((J=(P=M.parametersByName)===null||P===void 0?void 0:P.stmt)===null||J===void 0)&&J.value)?M.parametersByName.stmt.value:M.sqlTextOrProcedure})(s),N=r.tracer.startSpan((0,F8.getSpanName)(e,h,O,s.table),{kind:Gd.SpanKind.CLIENT,attributes:{[zs.SEMATTRS_DB_SYSTEM]:zs.DBSYSTEMVALUES_MSSQL,[zs.SEMATTRS_DB_NAME]:h,[zs.SEMATTRS_NET_PEER_PORT]:(a=(i=this.config)===null||i===void 0?void 0:i.options)===null||a===void 0?void 0:a.port,[zs.SEMATTRS_NET_PEER_NAME]:(c=this.config)===null||c===void 0?void 0:c.server,[zs.SEMATTRS_DB_USER]:(l=(u=this.config)===null||u===void 0?void 0:u.userName)!==null&&l!==void 0?l:(_=(p=(d=this.config)===null||d===void 0?void 0:d.authentication)===null||p===void 0?void 0:p.options)===null||_===void 0?void 0:_.userName,[zs.SEMATTRS_DB_STATEMENT]:O,[zs.SEMATTRS_DB_SQL_TABLE]:s.table}}),A=(0,F8.once)(M=>{s.removeListener("done",S),s.removeListener("doneInProc",S),s.removeListener("doneProc",g),s.removeListener("error",A),this.removeListener("end",A),N.setAttribute("tedious.procedure_count",f),N.setAttribute("tedious.statement_count",E),M&&N.setStatus({code:Gd.SpanStatusCode.ERROR,message:M.message}),N.end()});return s.on("done",S),s.on("doneInProc",S),s.on("doneProc",g),s.once("error",A),this.on("end",A),typeof s.callback=="function"?r._wrap(s,"callback",r._patchCallbackQuery(A)):r._diag.error("Expected request.callback to be a function"),Gd.context.with(Gd.trace.setSpan(Gd.context.active(),N),n,this,...arguments)}return Object.defineProperty(o,"length",{value:n.length,writable:!1}),o}}_patchCallbackQuery(e){return n=>function(r,o,s){return e(r),n.apply(this,arguments)}}};LS.TediousInstrumentation=MS;MS.COMPONENT="tedious"});var W8=m(K8=>{"use strict";Object.defineProperty(K8,"__esModule",{value:!0})});var X8=m(Xs=>{"use strict";var mVe=Xs&&Xs.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),z8=Xs&&Xs.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&mVe(e,t,n)};Object.defineProperty(Xs,"__esModule",{value:!0});z8(Y8(),Xs);z8(W8(),Xs)});var t6=m(Tu=>{"use strict";Object.defineProperty(Tu,"__esModule",{value:!0});Tu.PACKAGE_NAME=Tu.PACKAGE_VERSION=void 0;Tu.PACKAGE_VERSION="0.43.1";Tu.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var r6=m(xS=>{"use strict";Object.defineProperty(xS,"__esModule",{value:!0});xS.GenericPoolInstrumentation=void 0;var gu=(L(),I(V)),sa=de(),n6=t6(),wN="generic-pool",kN=class extends sa.InstrumentationBase{constructor(e={}){super(n6.PACKAGE_NAME,n6.PACKAGE_VERSION,e),this._isDisabled=!1}init(){return[new sa.InstrumentationNodeModuleDefinition(wN,[">=3.0.0 <4"],e=>{let n=e.Pool;return(0,sa.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new sa.InstrumentationNodeModuleDefinition(wN,[">=2.4.0 <3"],e=>{let n=e.Pool;return(0,sa.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),e},e=>{let n=e.Pool;return this._unwrap(n.prototype,"acquire"),e}),new sa.InstrumentationNodeModuleDefinition(wN,[">=2.0.0 <2.4"],e=>(this._isDisabled=!1,(0,sa.isWrapped)(e.Pool)&&this._unwrap(e,"Pool"),this._wrap(e,"Pool",this._poolWrapper.bind(this)),e),e=>(this._isDisabled=!0,e))]}_acquirePatcher(e){let n=this;return function(...o){let s=gu.context.active(),i=n.tracer.startSpan("generic-pool.acquire",{},s);return gu.context.with(gu.trace.setSpan(s,i),()=>e.call(this,...o).then(a=>(i.end(),a),a=>{throw i.recordException(a),i.end(),a}))}}_poolWrapper(e){let n=this;return function(){let o=e.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(e){let n=this;return function(o,s){if(n._isDisabled)return e.call(this,o,s);let i=gu.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return gu.context.with(gu.trace.setSpan(i,a),()=>{e.call(this,(c,u)=>{if(a.end(),o)return o(c,u)},s)})}}};xS.GenericPoolInstrumentation=kN});var o6=m(ia=>{"use strict";var TVe=ia&&ia.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),gVe=ia&&ia.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&TVe(e,t,n)};Object.defineProperty(ia,"__esModule",{value:!0});gVe(r6(),ia)});var VN=m(aa=>{"use strict";Object.defineProperty(aa,"__esModule",{value:!0});aa.DEFAULT_CONFIG=aa.EndOperation=void 0;var AVe;(function(t){t.AutoAck="auto ack",t.Ack="ack",t.AckAll="ackAll",t.Reject="reject",t.Nack="nack",t.NackAll="nackAll",t.ChannelClosed="channel closed",t.ChannelError="channel error",t.InstrumentationTimeout="instrumentation timeout"})(AVe=aa.EndOperation||(aa.EndOperation={}));aa.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var p6=m(je=>{"use strict";Object.defineProperty(je,"__esModule",{value:!0});je.isConfirmChannelTracing=je.unmarkConfirmChannelTracing=je.markConfirmChannelTracing=je.getConnectionAttributesFromUrl=je.getConnectionAttributesFromServer=je.normalizeExchange=je.CONNECTION_ATTRIBUTES=je.CHANNEL_CONSUME_TIMEOUT_TIMER=je.CHANNEL_SPANS_NOT_ENDED=je.MESSAGE_STORED_SPAN=void 0;var BN=(L(),I(V)),Ho=(Re(),I(et));je.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");je.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");je.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");je.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var GN=(0,BN.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),RVe=t=>t!==""?t:"<default>";je.normalizeExchange=RVe;var yVe=t=>t.replace(/:[^:@/]*@/,":***@"),u6=(t,e)=>t||(e==="AMQP"?5672:5671),l6=t=>{let e=t||"amqp";return(e.endsWith(":")?e.substring(0,e.length-1):e).toUpperCase()},d6=t=>t||"localhost",hu=(t,e,n,r)=>n?{[e]:n}:(BN.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:t}),{}),OVe=t=>{var e,n;let r=(n=(e=t.serverProperties.product)===null||e===void 0?void 0:e.toLowerCase)===null||n===void 0?void 0:n.call(e);return r?{[Ho.SEMATTRS_MESSAGING_SYSTEM]:r}:{}};je.getConnectionAttributesFromServer=OVe;var NVe=t=>{let e={[Ho.SEMATTRS_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(t=t||"amqp://localhost",typeof t=="object"){let n=t,r=l6(n?.protocol);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_MESSAGING_PROTOCOL,r,"protocol")));let o=d6(n?.hostname);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_NET_PEER_NAME,o,"hostname")));let s=u6(n.port,r);Object.assign(e,Object.assign({},hu(t,Ho.SEMATTRS_NET_PEER_PORT,s,"port")))}else{let n=yVe(t);e[Ho.SEMATTRS_MESSAGING_URL]=n;try{let r=new URL(n),o=l6(r.protocol);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_MESSAGING_PROTOCOL,o,"protocol")));let s=d6(r.hostname);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_NET_PEER_NAME,s,"hostname")));let i=u6(r.port?parseInt(r.port):void 0,o);Object.assign(e,Object.assign({},hu(n,Ho.SEMATTRS_NET_PEER_PORT,i,"port")))}catch(r){BN.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:n,err:r})}}return e};je.getConnectionAttributesFromUrl=NVe;var CVe=t=>t.setValue(GN,!0);je.markConfirmChannelTracing=CVe;var vVe=t=>t.deleteValue(GN);je.unmarkConfirmChannelTracing=vVe;var IVe=t=>t.getValue(GN)===!0;je.isConfirmChannelTracing=IVe});var _6=m(Au=>{"use strict";Object.defineProperty(Au,"__esModule",{value:!0});Au.PACKAGE_NAME=Au.PACKAGE_VERSION=void 0;Au.PACKAGE_VERSION="0.46.1";Au.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var m6=m(wS=>{"use strict";Object.defineProperty(wS,"__esModule",{value:!0});wS.AmqplibInstrumentation=void 0;var Ve=(L(),I(V)),DS=fe(),he=de(),hn=(Re(),I(et)),on=VN(),qe=p6(),f6=_6(),US=[">=0.5.5 <1"],HN=class extends he.InstrumentationBase{constructor(e={}){super(f6.PACKAGE_NAME,f6.PACKAGE_VERSION,Object.assign(Object.assign({},on.DEFAULT_CONFIG),e))}setConfig(e={}){super.setConfig(Object.assign(Object.assign({},on.DEFAULT_CONFIG),e))}init(){let e=new he.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",US,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new he.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",US,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new he.InstrumentationNodeModuleFile("amqplib/lib/connect.js",US,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new he.InstrumentationNodeModuleDefinition("amqplib",US,void 0,void 0,[e,r,n])}patchConnect(e){return e=this.unpatchConnect(e),(0,he.isWrapped)(e.connect)||this._wrap(e,"connect",this.getConnectPatch.bind(this)),e}unpatchConnect(e){return(0,he.isWrapped)(e.connect)&&this._unwrap(e,"connect"),e}patchChannelModel(e,n){return(0,he.isWrapped)(e.Channel.prototype.publish)||this._wrap(e.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,he.isWrapped)(e.Channel.prototype.consume)||this._wrap(e.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,he.isWrapped)(e.Channel.prototype.ack)||this._wrap(e.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,on.EndOperation.Ack)),(0,he.isWrapped)(e.Channel.prototype.nack)||this._wrap(e.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,on.EndOperation.Nack)),(0,he.isWrapped)(e.Channel.prototype.reject)||this._wrap(e.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,on.EndOperation.Reject)),(0,he.isWrapped)(e.Channel.prototype.ackAll)||this._wrap(e.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,on.EndOperation.AckAll)),(0,he.isWrapped)(e.Channel.prototype.nackAll)||this._wrap(e.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,on.EndOperation.NackAll)),(0,he.isWrapped)(e.Channel.prototype.emit)||this._wrap(e.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,he.isWrapped)(e.ConfirmChannel.prototype.publish)||this._wrap(e.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),e}unpatchChannelModel(e){return(0,he.isWrapped)(e.Channel.prototype.publish)&&this._unwrap(e.Channel.prototype,"publish"),(0,he.isWrapped)(e.Channel.prototype.consume)&&this._unwrap(e.Channel.prototype,"consume"),(0,he.isWrapped)(e.Channel.prototype.ack)&&this._unwrap(e.Channel.prototype,"ack"),(0,he.isWrapped)(e.Channel.prototype.nack)&&this._unwrap(e.Channel.prototype,"nack"),(0,he.isWrapped)(e.Channel.prototype.reject)&&this._unwrap(e.Channel.prototype,"reject"),(0,he.isWrapped)(e.Channel.prototype.ackAll)&&this._unwrap(e.Channel.prototype,"ackAll"),(0,he.isWrapped)(e.Channel.prototype.nackAll)&&this._unwrap(e.Channel.prototype,"nackAll"),(0,he.isWrapped)(e.Channel.prototype.emit)&&this._unwrap(e.Channel.prototype,"emit"),(0,he.isWrapped)(e.ConfirmChannel.prototype.publish)&&this._unwrap(e.ConfirmChannel.prototype,"publish"),e}getConnectPatch(e){return function(r,o,s){return e.call(this,r,o,function(i,a){if(i==null){let c=(0,qe.getConnectionAttributesFromUrl)(r),u=(0,qe.getConnectionAttributesFromServer)(a);a[qe.CONNECTION_ATTRIBUTES]=Object.assign(Object.assign({},c),u)}s.apply(this,arguments)})}}getChannelEmitPatch(e){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,on.EndOperation.ChannelClosed,void 0);let s=this[qe.CHANNEL_CONSUME_TIMEOUT_TIMER];s&&clearInterval(s),this[qe.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,on.EndOperation.ChannelError,void 0);return e.apply(this,arguments)}}getAckAllPatch(e,n,r){let o=this;return function(i){return o.endAllSpansOnChannel(this,e,n,i),r.apply(this,arguments)}}getAckPatch(e,n,r){let o=this;return function(i,a,c){var u;let l=this,d=n===on.EndOperation.Reject?a:c,p=(u=l[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&u!==void 0?u:[],_=p.findIndex(f=>f.msg===i);if(_<0)o.endConsumerSpan(i,e,n,d);else if(n!==on.EndOperation.Reject&&a){for(let f=0;f<=_;f++)o.endConsumerSpan(p[f].msg,e,n,d);p.splice(0,_+1)}else o.endConsumerSpan(i,e,n,d),p.splice(_,1);return r.apply(this,arguments)}}getConsumePatch(e,n){let r=this;return function(s,i,a){let c=this;if(!Object.prototype.hasOwnProperty.call(c,qe.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:l}=r.getConfig();if(l){let d=setInterval(()=>{r.checkConsumeTimeoutOnChannel(c)},l);d.unref(),c[qe.CHANNEL_CONSUME_TIMEOUT_TIMER]=d}c[qe.CHANNEL_SPANS_NOT_ENDED]=[]}let u=function(l){var d,p,_,f,E;if(!l)return i.call(this,l);let S=(d=l.properties.headers)!==null&&d!==void 0?d:{},g=Ve.propagation.extract(Ve.ROOT_CONTEXT,S),h=(p=l.fields)===null||p===void 0?void 0:p.exchange,O;if(r._config.useLinksForConsume){let P=g?(_=Ve.trace.getSpan(g))===null||_===void 0?void 0:_.spanContext():void 0;g=void 0,P&&(O=[{context:P}])}let N=r.tracer.startSpan(`${s} process`,{kind:Ve.SpanKind.CONSUMER,attributes:Object.assign(Object.assign({},(f=c?.connection)===null||f===void 0?void 0:f[qe.CONNECTION_ATTRIBUTES]),{[hn.SEMATTRS_MESSAGING_DESTINATION]:h,[hn.SEMATTRS_MESSAGING_DESTINATION_KIND]:hn.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[hn.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:(E=l.fields)===null||E===void 0?void 0:E.routingKey,[hn.SEMATTRS_MESSAGING_OPERATION]:hn.MESSAGINGOPERATIONVALUES_PROCESS,[hn.SEMATTRS_MESSAGING_MESSAGE_ID]:l?.properties.messageId,[hn.SEMATTRS_MESSAGING_CONVERSATION_ID]:l?.properties.correlationId}),links:O},g),{consumeHook:A}=r.getConfig();A&&(0,he.safeExecuteInTheMiddle)(()=>A(N,{moduleVersion:e,msg:l}),P=>{P&&Ve.diag.error("amqplib instrumentation: consumerHook error",P)},!0),a?.noAck||(c[qe.CHANNEL_SPANS_NOT_ENDED].push({msg:l,timeOfConsume:(0,DS.hrTime)()}),l[qe.MESSAGE_STORED_SPAN]=N);let M=g||Ve.ROOT_CONTEXT;Ve.context.with(Ve.trace.setSpan(M,N),()=>{i.call(this,l)}),a?.noAck&&(r.callConsumeEndHook(N,l,!1,on.EndOperation.AutoAck),N.end())};return arguments[1]=u,n.apply(this,arguments)}}getConfirmedPublishPatch(e,n){let r=this;return function(s,i,a,c,u){let l=this,{span:d,modifiedOptions:p}=r.createPublishSpan(r,s,i,l,c),{publishHook:_}=r.getConfig();_&&(0,he.safeExecuteInTheMiddle)(()=>_(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:p,isConfirmChannel:!0}),g=>{g&&Ve.diag.error("amqplib instrumentation: publishHook error",g)},!0);let f=function(g,h){try{u?.call(this,g,h)}finally{let{publishConfirmHook:O}=r.getConfig();O&&(0,he.safeExecuteInTheMiddle)(()=>O(d,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:c,isConfirmChannel:!0,confirmError:g}),N=>{N&&Ve.diag.error("amqplib instrumentation: publishConfirmHook error",N)},!0),g&&d.setStatus({code:Ve.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),d.end()}},E=(0,qe.markConfirmChannelTracing)(Ve.context.active()),S=[...arguments];return S[3]=p,S[4]=Ve.context.bind((0,qe.unmarkConfirmChannelTracing)(Ve.trace.setSpan(E,d)),f),Ve.context.with(E,n.bind(this,...S))}}getPublishPatch(e,n){let r=this;return function(s,i,a,c){if((0,qe.isConfirmChannelTracing)(Ve.context.active()))return n.apply(this,arguments);{let u=this,{span:l,modifiedOptions:d}=r.createPublishSpan(r,s,i,u,c),{publishHook:p}=r.getConfig();p&&(0,he.safeExecuteInTheMiddle)(()=>p(l,{moduleVersion:e,exchange:s,routingKey:i,content:a,options:d,isConfirmChannel:!1}),E=>{E&&Ve.diag.error("amqplib instrumentation: publishHook error",E)},!0);let _=[...arguments];_[3]=d;let f=n.apply(this,_);return l.end(),f}}}createPublishSpan(e,n,r,o,s){var i;let a=(0,qe.normalizeExchange)(n),c=e.tracer.startSpan(`publish ${a}`,{kind:Ve.SpanKind.PRODUCER,attributes:Object.assign(Object.assign({},o.connection[qe.CONNECTION_ATTRIBUTES]),{[hn.SEMATTRS_MESSAGING_DESTINATION]:n,[hn.SEMATTRS_MESSAGING_DESTINATION_KIND]:hn.MESSAGINGDESTINATIONKINDVALUES_TOPIC,[hn.SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[hn.SEMATTRS_MESSAGING_MESSAGE_ID]:s?.messageId,[hn.SEMATTRS_MESSAGING_CONVERSATION_ID]:s?.correlationId})}),u=s??{};return u.headers=(i=u.headers)!==null&&i!==void 0?i:{},Ve.propagation.inject(Ve.trace.setSpan(Ve.context.active(),c),u.headers),{span:c,modifiedOptions:u}}endConsumerSpan(e,n,r,o){let s=e[qe.MESSAGE_STORED_SPAN];s&&(n!==!1&&s.setStatus({code:Ve.SpanStatusCode.ERROR,message:r!==on.EndOperation.ChannelClosed&&r!==on.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(s,e,n,r),s.end(),e[qe.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(e,n,r,o){var s;((s=e[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&s!==void 0?s:[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),e[qe.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(e,n,r,o){let{consumeEndHook:s}=this.getConfig();s&&(0,he.safeExecuteInTheMiddle)(()=>s(e,{msg:n,rejected:r,endOperation:o}),i=>{i&&Ve.diag.error("amqplib instrumentation: consumerEndHook error",i)},!0)}checkConsumeTimeoutOnChannel(e){var n;let r=(0,DS.hrTime)(),o=(n=e[qe.CHANNEL_SPANS_NOT_ENDED])!==null&&n!==void 0?n:[],s,{consumeTimeoutMs:i}=this.getConfig();for(s=0;s<o.length;s++){let a=o[s],c=(0,DS.hrTimeDuration)(a.timeOfConsume,r);if((0,DS.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,on.EndOperation.InstrumentationTimeout,!0)}o.splice(0,s)}};wS.AmqplibInstrumentation=HN});var S6=m(Js=>{"use strict";var PVe=Js&&Js.__createBinding||(Object.create?(function(t,e,n,r){r===void 0&&(r=n),Object.defineProperty(t,r,{enumerable:!0,get:function(){return e[n]}})}):(function(t,e,n,r){r===void 0&&(r=n),t[r]=e[n]})),E6=Js&&Js.__exportStar||function(t,e){for(var n in t)n!=="default"&&!Object.prototype.hasOwnProperty.call(e,n)&&PVe(e,t,n)};Object.defineProperty(Js,"__esModule",{value:!0});E6(m6(),Js);E6(VN(),Js)});var V6=require("commander"),FS=v(require("crypto")),yr=v(require("fs")),at=v(require("os")),Fo=v(require("path")),B6=require("child_process"),G6=require("util");var Xd=require("child_process"),ZN=require("util"),qo=v(require("fs")),Jd=v(require("os")),KS=v(require("path"));var ao="6820f6e91b762e645c9bf020c0d3673bb99d4a25a824880c0d548e10bb9bc7b1";var Nr=(0,ZN.promisify)(Xd.execFile),WS=KS.join(Jd.homedir(),".visa-mcp"),Ou=KS.join(WS,"session-token"),xn="visa-cli",jo="session-token",Wd="rc-access",Z6=5e3,zd=class extends Error{constructor(e){super(e),this.name="CredentialAccessError"}};function Q6(t){let e=t;return[e?.message,e?.stderr].filter(n=>typeof n=="string").join(`
12
+ `)}function QN(t){let e=t;if(e?.code==="EPERM"||e?.code==="EACCES")return!0;let n=Q6(t).toLowerCase();return n.includes("operation not permitted")||n.includes("permission denied")}async function eJ(){try{let{stdout:t}=await Nr("security",["find-generic-password","-s",xn,"-a",jo,"-w"],{timeout:5e3});return t.trim()||null}catch(t){if(QN(t))throw new zd("Unable to read Visa CLI credentials from macOS Keychain. In sandboxed agents such as Codex, rerun with keychain access or run this command outside the sandbox.");return null}}async function tJ(t){try{try{await Nr("security",["delete-generic-password","-s",xn,"-a",jo],{timeout:5e3})}catch{}return await Nr("security",["add-generic-password","-s",xn,"-a",jo,"-w",t],{timeout:5e3}),!0}catch{return!1}}async function nJ(){try{await Nr("security",["delete-generic-password","-s",xn,"-a",jo],{timeout:5e3})}catch{}}async function rJ(){if(!zS())return null;try{let{stdout:t}=await Nr("secret-tool",["lookup","service",xn,"account",jo],{timeout:5e3});return t.trim()||null}catch{return null}}async function oJ(t){if(!zS())return!1;try{let e=(0,Xd.execFile)("secret-tool",["store","--label",`${xn} ${jo}`,"service",xn,"account",jo]);return e.stdin?(e.stdin.write(t),e.stdin.end(),await Promise.race([new Promise((n,r)=>{e.on("exit",o=>o===0?n():r(new Error(`secret-tool exited ${o}`))),e.on("error",r)}),new Promise((n,r)=>setTimeout(()=>{e.kill(),r(new Error("secret-tool timed out"))},Z6))]),!0):!1}catch{return!1}}async function sJ(){if(zS())try{await Nr("secret-tool",["clear","service",xn,"account",jo],{timeout:5e3})}catch{}}function zS(){return!!process.env.DBUS_SESSION_BUS_ADDRESS}async function iJ(){try{let{stdout:t}=await Nr("security",["find-generic-password","-s",xn,"-a",Wd,"-w"],{timeout:5e3});return t.trim()||null}catch{return null}}async function aJ(t){try{try{await Nr("security",["delete-generic-password","-s",xn,"-a",Wd],{timeout:5e3})}catch{}await Nr("security",["add-generic-password","-s",xn,"-a",Wd,"-w",t],{timeout:5e3})}catch{}}async function cJ(){try{await Nr("security",["delete-generic-password","-s",xn,"-a",Wd],{timeout:5e3})}catch{}}function qS(){try{return qo.readFileSync(Ou,"utf-8").trim()||null}catch(t){if(QN(t))throw new zd(`Unable to read Visa CLI credentials from ${Ou}. Check file permissions or rerun with access to the Visa CLI credential directory.`);return null}}function eC(t){qo.mkdirSync(WS,{recursive:!0,mode:448}),qo.writeFileSync(Ou,t,{mode:384}),process.platform==="win32"&&uJ(Ou)}function YS(){try{qo.unlinkSync(Ou)}catch{}}function uJ(t){try{let e=Jd.userInfo().username;(0,Xd.execFile)("icacls",[t,"/inheritance:r","/grant:r",`${e}:F`],{timeout:5e3},n=>{n&&console.error(`[visa-cli] icacls ACL restriction failed: ${n.message}`)})}catch(e){console.error(`[visa-cli] Failed to invoke icacls: ${e instanceof Error?e.message:String(e)}`)}}function jS(){switch(process.platform){case"darwin":return{get:eJ,store:tJ,delete:nJ};case"linux":return{get:rJ,store:oJ,delete:sJ};default:return{get:async()=>qS(),store:async t=>{try{return eC(t),!0}catch{return!1}},delete:async()=>YS(),storesInSessionFile:!0}}}var Ne=class{static async getSessionToken(){if(process.env.VISA_MOCK_KEYCHAIN==="true")return Promise.resolve("mock-session-token-for-testing");let e=jS(),n=await e.get();if(n)return n;let r=qS();return r?(await e.store(r),r):null}static async saveSessionToken(e){if(process.env.VISA_MOCK_KEYCHAIN==="true")return;let n=jS();if(await n.store(e)){if(await n.get()===e){n.storesInSessionFile||YS();return}await n.delete()}if(eC(e),qS()!==e)throw new Error("Failed to persist session token. "+(process.platform==="darwin"?'Check Keychain Access permissions for "visa-cli".':`Ensure ${WS} is writable.`))}static async getRcAccessToken(){return process.env.VISA_MOCK_KEYCHAIN==="true"?ao:iJ()}static async saveRcAccessToken(e){process.env.VISA_MOCK_KEYCHAIN!=="true"&&await aJ(e)}static async deleteSessionToken(){if(process.env.VISA_MOCK_KEYCHAIN==="true")return;await jS().delete(),YS()}static async clearAll(){await this.deleteSessionToken(),await cJ()}};var Qd=v(require("crypto")),ep=v(require("tty")),tp=v(require("fs"));function dJ(t){return/-rc\.|-beta\./.test(t)}function XS(t){return Qd.createHash("sha256").update(t.trim()).digest("hex")}function tC(t){return ao==="SKIP"?!0:Qd.timingSafeEqual(Buffer.from(XS(t)),Buffer.from(ao))}function pJ(){try{let t=tp.openSync("/dev/tty","r+"),e=new ep.ReadStream(t),n=new ep.WriteStream(t),r=!1;return{input:e,output:n,cleanupStreams:()=>{if(!r){r=!0;try{e.destroy()}catch{}try{n.destroy()}catch{}try{tp.closeSync(t)}catch{}}}}}catch{if(!process.stdin.isTTY)throw new Error("No interactive terminal available. Set VISA_RC_CODE env var instead.");return{input:process.stdin,output:process.stderr,cleanupStreams:()=>{}}}}function _J(t){return new Promise((e,n)=>{let r;try{r=pJ()}catch(l){n(l);return}let{input:o,output:s,cleanupStreams:i}=r,a=()=>{o.off("data",u);try{o.setRawMode?.(!1)}catch{}i()};s.write(t),o.setRawMode?.(!0),o.resume(),o.setEncoding("utf8");let c="",u=l=>{l==="\r"||l===`
13
13
  `?(s.write(`
14
14
  `),a(),e(c)):l===""?(s.write(`
15
- `),a(),n(new Error("Cancelled"))):l==="\x7F"||l==="\b"?c.length>0&&(c=c.slice(0,-1),s.write("\b \b")):(c+=l,s.write("\u2022"))};o.on("data",u)})}var dJ=`
15
+ `),a(),n(new Error("Cancelled"))):l==="\x7F"||l==="\b"?c.length>0&&(c=c.slice(0,-1),s.write("\b \b")):(c+=l,s.write("\u2022"))};o.on("data",u)})}var fJ=`
16
16
  \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
17
17
  \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
18
18
  \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2551
@@ -21,34 +21,34 @@ Mongoose Error Code: ${e.code}`:""}`})}function tN(t,e,n,r=void 0){n&&(0,d1e.saf
21
21
  \u255A\u2550\u2550\u2550\u255D \u255A\u2550\u255D\u255A\u2550\u2550\u2550\u2550\u2550\u2550\u255D\u255A\u2550\u255D \u255A\u2550\u255D
22
22
 
23
23
  This is a Release Candidate build. Access is restricted to Visa employees.
24
- `;async function tC(t={}){let e=t.version??Zd().version;if(!cJ(e))return;let n=process.env.VISA_RC_CODE;if(n&&eC(n)){await Ne.saveRcAccessToken(zS(n));return}if(t.isMcp??!1){let i=await Ne.getRcAccessToken();if(i&&(ao==="SKIP"||i===ao))return;process.stderr.write(`[visa-cli] RC build requires access. Run: visa-cli setup
25
- `),process.exit(1)}let o=await Ne.getRcAccessToken();if(o&&(ao==="SKIP"||o===ao))return;console.log(dJ);let s=3;for(let i=1;i<=s;i++){let a;try{a=await lJ(" Enter RC access code: ")}catch{process.exit(1)}if(eC(a)){await Ne.saveRcAccessToken(zS(a)),console.log(`
24
+ `;async function nC(t={}){let e=t.version??Zd().version;if(!dJ(e))return;let n=process.env.VISA_RC_CODE;if(n&&tC(n)){await Ne.saveRcAccessToken(XS(n));return}if(t.isMcp??!1){let i=await Ne.getRcAccessToken();if(i&&(ao==="SKIP"||i===ao))return;process.stderr.write(`[visa-cli] RC build requires access. Run: visa-cli setup
25
+ `),process.exit(1)}let o=await Ne.getRcAccessToken();if(o&&(ao==="SKIP"||o===ao))return;console.log(fJ);let s=3;for(let i=1;i<=s;i++){let a;try{a=await _J(" Enter RC access code: ")}catch{process.exit(1)}if(tC(a)){await Ne.saveRcAccessToken(XS(a)),console.log(`
26
26
  Access granted. Welcome.
27
27
  `);return}i<s&&console.log(`
28
28
  Invalid code. ${s-i} attempt(s) remaining.
29
29
  `)}console.log(`
30
30
  Invalid code. Contact your team lead.
31
- `),process.exit(1)}var nC=require("child_process");function rC(t=process.env,e=process.platform){return t.VISA_CLI_NO_BROWSER==="1"||t.VISA_CLI_NO_BROWSER==="true"?{headless:!0,reason:"VISA_CLI_NO_BROWSER is set"}:t.CI==="true"||t.CI==="1"?{headless:!0,reason:"CI environment detected"}:t.SSH_CONNECTION||t.SSH_TTY?{headless:!0,reason:"SSH session detected"}:e==="linux"&&!t.DISPLAY&&!t.WAYLAND_DISPLAY?{headless:!0,reason:"Linux with no $DISPLAY or $WAYLAND_DISPLAY"}:{headless:!1}}function pJ(t){let n=t.length+4;return[`\u250C${"\u2500".repeat(n)}\u2510`,`\u2502${" ".repeat(2)}${t}${" ".repeat(2)}\u2502`,`\u2514${"\u2500".repeat(n)}\u2518`].join(`
32
- `)}function oC(t,e=process.platform){return e==="darwin"?{cmd:"open",args:[t]}:e==="win32"?{cmd:"cmd",args:["/c","start","",t]}:e==="linux"?{cmd:"xdg-open",args:[t]}:null}async function sC(t,e={}){let n=e.log??(c=>console.log(c)),r=e.env??process.env,o=e.platform??process.platform,s=e.spawn??((c,u,l)=>{(0,nC.execFile)(c,u,d=>l(d))});n(""),n(" Sign in to Visa CLI by opening this URL in your browser:"),n("");for(let c of pJ(t).split(`
33
- `))n(` ${c}`);n("");let i=rC(r,o);if(i.headless){n(` (${i.reason} \u2014 skipping browser auto-open.)`),n(" Open the URL above on any device with a browser. The CLI will"),n(" continue waiting for you to complete sign-in."),n("");return}let a=oC(t,o);if(!a){n(` No known browser-open command for platform "${o}".`),n(" Open the URL above manually to continue."),n("");return}await new Promise(c=>{s(a.cmd,a.args,u=>{u?(n(` Could not open browser automatically (${u.message}).`),n(" Open the URL above manually to continue."),n("")):(n(" Opened browser. Waiting for you to sign in..."),n("")),c()})})}var aC=v(require("crypto")),cn=v(require("fs")),np=v(require("path"));function cC(t,e){cn.mkdirSync(np.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.${aC.randomBytes(8).toString("hex")}.tmp`;try{cn.writeFileSync(n,JSON.stringify(e,null,2)+`
34
- `),cn.renameSync(n,t)}catch(r){try{cn.unlinkSync(n)}catch{}throw r}}function iC(t){return`'${t.replace(/'/g,"'\\''")}'`}var uC="# visa-cli-hud-v1";function _J(t,e){let n=t??process.execPath,r=e??process.argv[1]??"",o=r?np.resolve(r):"";return`${o?`${iC(n)} ${iC(o)} statusline`:"visa-cli statusline"} ${uC}`}function la(t){return typeof t!="string"?!1:t.includes(uC)?!0:t.includes("visa-cli")&&t.includes("statusline")}function rp(t,e=_J){let n={},r=!1;if(cn.existsSync(t)){r=!0;try{n=JSON.parse(cn.readFileSync(t,"utf-8"))}catch(o){return{installed:"malformed-json",message:`~/.claude/settings.json is not valid JSON (${o.message}). Fix the file manually, then run: visa-cli hud enable claude`}}}if(n.statusLine){let o=typeof n.statusLine=="object"?n.statusLine.command:"";return la(o)?{installed:"already-visa",message:"Visa HUD already registered in ~/.claude/settings.json."}:{installed:"other-hud-present",message:"Another HUD is already configured (keeping it). To switch to Visa HUD, edit ~/.claude/settings.json \u2192 statusLine.command"}}try{return n.statusLine={type:"command",command:e()},cC(t,n),{installed:"new",message:`Visa HUD registered in ~/.claude/settings.json${r?"":" (new file)"}. Restart Claude Code to see it pinned below the input.`}}catch(o){return{installed:"error",message:`Failed to write settings: ${o.message}. Enable manually later with: visa-cli hud enable claude`}}}function XS(t){if(!cn.existsSync(t))return{removed:!1,message:"No ~/.claude/settings.json found."};let e;try{e=JSON.parse(cn.readFileSync(t,"utf-8"))}catch(r){return{removed:!1,message:`~/.claude/settings.json is not valid JSON: ${r.message}`}}if(!e.statusLine)return{removed:!1,message:"No statusLine configured."};let n=typeof e.statusLine=="object"?e.statusLine.command:"";return la(n)?(delete e.statusLine,cC(t,e),{removed:!0,message:"Visa HUD removed from ~/.claude/settings.json. Restart Claude Code to take effect."}):{removed:!1,message:"statusLine is owned by another tool \u2014 leaving it alone."}}var co=v(require("fs")),uo=v(require("path")),fJ=1,Qs={CLAUDE_CODE:"claude-code",CODEX:"codex",UNKNOWN:"unknown"},mJ=["terminal","claude","claude-code","codex","all"];function nT(t){let e=t.toLowerCase();return mJ.includes(e)?e:null}var EJ=50,SJ=64*1024,lC=10,JS=80;function TJ(){let t=(process.env.COLORTERM??"").toLowerCase();if(t==="truecolor"||t==="24bit")return!0;let e=(process.env.TERM??"").toLowerCase();return e.includes("truecolor")||e.includes("24bit")}var ZS=TJ(),Z={reset:"\x1B[0m",visaBlue:ZS?"\x1B[38;2;20;52;203m":"\x1B[38;5;27m",visaBlueSoft:ZS?"\x1B[38;2;97;126;229m":"\x1B[38;5;111m",visaGold:ZS?"\x1B[38;2;247;182;0m":"\x1B[38;5;220m",green:"\x1B[38;5;48m",dim:"\x1B[2m"};function oe(t,e){return t.length===0||process.env.NO_COLOR?t:`${e}${t}${Z.reset}`}function dC(t){return t.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/[\u0000-\u001F\u007F]/g,"").length}async function EC(t=process.stdin){return t.isTTY?null:new Promise(e=>{let n=[],r=!1,o=()=>{t.removeListener("data",i),t.removeListener("end",a),t.removeListener("error",c),clearTimeout(u)},s=l=>{r||(r=!0,o(),e(l))},i=l=>{n.push(typeof l=="string"?Buffer.from(l):l)},a=()=>{let l=Buffer.concat(n).toString("utf-8").trim();if(!l)return s(null);try{let d=JSON.parse(l);s(d&&typeof d=="object"?d:null)}catch{s(null)}},c=()=>s(null),u=setTimeout(()=>{n.length>0?a():s(null)},EJ);t.on("data",i),t.on("end",a),t.on("error",c)})}function op(t){let n=Math.round(Math.max(0,Math.min(1,t))*10),r="\u2588".repeat(n),o="\u2591".repeat(10-n);return`${oe(r||"",Z.visaBlueSoft)}${oe(o||"",Z.dim)}`}function QS(t){return!Number.isFinite(t)||t<0?"0":t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}k`:String(Math.round(t))}function pC(t){if(PJ(t))return gJ(t);let e=` ${oe("\u2502",Z.dim)} `,n=eT(t)||"claude",r=t.cwd?Ct(uo.basename(t.cwd)):"",o=rT(t.workspace),s=r||o,i=o&&o!==s?` ${oe(`@${o}`,Z.visaBlueSoft)}`:"",a=[oe(`[${n}]`,Z.visaBlueSoft)];s&&a.push(`${oe(s,Z.visaGold)}${i}`);let c=a.join(e),u=Number(t.context_window?.context_window_size??0),l=typeof t.context_window?.used_percentage=="number"?t.context_window.used_percentage:typeof t.context_window?.remaining_percentage=="number"?100-t.context_window.remaining_percentage:null,d=t.context_window?.current_usage,p=[d?.input_tokens,d?.output_tokens,d?.cache_creation_input_tokens,d?.cache_read_input_tokens].filter(R=>typeof R=="number"&&Number.isFinite(R)),_=p.length>0?p.reduce((R,M)=>R+M,0):null,f=Number(t.context_window?.total_input_tokens??_??d?.input_tokens??0),E=l!==null?Math.max(0,Math.min(1,l/100)):u>0?Math.max(0,Math.min(1,f/u)):0,S=l!==null&&u>0?Math.round(E*u):f,g;if(u>0||l!==null){let R=`${String(Math.round(E*100)).padStart(2," ")}%`,M=u>0?` ${oe(`(${QS(S)}/${QS(u)})`,Z.dim)}`:"";g=`${oe("Context",Z.dim)} ${op(E)} ${oe(R,Z.green)}${M}`}else g=`${oe("Context",Z.dim)} ${oe("-",Z.dim)}`;let h=AJ(t.rate_limits),O=[g];h&&O.push(h);let N=O.join(e);return`${c}
35
- ${N}`}function gJ(t){let e=` ${oe("\u2502",Z.dim)} `,n=NC(t),r=n.model||"codex",o=[oe(`[${r}]`,Z.visaBlueSoft)];n.project&&o.push(oe(n.project,Z.visaGold)),n.gitBranch&&o.push(`${oe("git",Z.dim)} ${oe(n.gitBranch,Z.visaGold)}`);let s=o.join(e),i=[];if(typeof n.contextUsedPercent=="number"){let c=Math.max(0,Math.min(1,n.contextUsedPercent/100));i.push(`${oe("Context",Z.dim)} ${op(c)} ${oe(`${Math.round(n.contextUsedPercent)}%`,Z.green)}`)}else if(typeof n.contextRemainingPercent=="number"){let c=100-n.contextRemainingPercent,u=Math.max(0,Math.min(1,c/100));i.push(`${oe("Context",Z.dim)} ${op(u)} ${oe(`${Math.round(c)}%`,Z.green)}`)}typeof n.usedTokens=="number"&&i.push(`${oe("Tokens",Z.dim)} ${QS(n.usedTokens)}`),n.status&&i.push(`${oe("Status",Z.dim)} ${oe(n.status,Z.visaBlueSoft)}`),n.threadTitle&&i.push(`${oe("Thread",Z.dim)} ${oe(n.threadTitle,Z.visaBlueSoft)}`);let a=i.length>0?i.join(e):`${oe("Context",Z.dim)} ${oe("-",Z.dim)}`;return`${s}
36
- ${a}`}function hJ(t){if(typeof t!="number"||t<=0)return"";let n=(t>1e12?t:t*1e3)-Date.now();if(n<=0||n>=10080*60*1e3)return"";let r=Math.floor(n/6e4),o=Math.floor(r/60),s=r%60;return o>0?`${o}h ${s}m`:`${s}m`}function _C(t,e){if(!t||typeof t.used_percentage!="number")return null;let n=Math.max(0,Math.min(100,t.used_percentage)),r=n/100,o=op(r),s=n>=90?"\x1B[38;5;196m":n>=70?Z.visaGold:Z.green,i=`${String(Math.round(n)).padStart(2," ")}%`,a=hJ(t.resets_at),c=a?` ${oe(`(${a} / ${e})`,Z.dim)}`:` ${oe(`(${e})`,Z.dim)}`;return`${o} ${oe(i,s)}${c}`}function AJ(t){if(!t)return null;let e=_C(t.five_hour,"5h"),n=typeof t.seven_day?.used_percentage=="number"?t.seven_day.used_percentage:null,r=n!==null&&n>=90?_C(t.seven_day,"7d"):null;if(!e&&!r)return null;let o=` ${oe("\u2502",Z.dim)} `,s=[e,r].filter(Boolean);return`${oe("Usage",Z.dim)} ${s.join(o)}`}function SC(t){let e;try{let n=co.statSync(t);if(!n.isFile())return null;let r=n.size;if(r===0)return null;let o=Math.min(r,SJ),s=r-o;e=co.openSync(t,"r");let i=Buffer.alloc(o);co.readSync(e,i,0,o,s);let a=i.toString("utf-8");if(s>0){let c=Buffer.alloc(1);if(co.readSync(e,c,0,1,s-1),c[0]!==10){let u=a.indexOf(`
37
- `);u>=0&&(a=a.slice(u+1))}}return a}catch{return null}finally{if(e!==void 0)try{co.closeSync(e)}catch{}}}function RJ(t){if(!t||typeof t!="object")return;let e=t,n=["file_path","path","notebook_path","pattern","command","url"];for(let r of n){let o=e[r];if(typeof o=="string"&&o.length>0){if(r.endsWith("_path")||r==="path"){let s=uo.basename(uo.dirname(o)),i=uo.basename(o);return s&&s!=="."&&s!=="/"?`${s}/${i}`:i}return o}}}function yJ(t){let e=t.split(`
38
- `),n=[],r=new Set;for(let o=e.length-1;o>=0&&n.length<lC*3;o-=1){let s=e[o].trim();if(!s)continue;let i;try{i=JSON.parse(s)}catch{continue}if(!i||typeof i!="object")continue;let c=i.message;if(!c||typeof c!="object")continue;let u=c.content;if(Array.isArray(u))for(let l of u){if(!l||typeof l!="object")continue;let d=l;if(d.type==="tool_result"&&typeof d.tool_use_id=="string")r.add(d.tool_use_id);else if(d.type==="tool_use"&&typeof d.name=="string"){let p=typeof d.id=="string"?d.id:"",_=p.length>0?!r.has(p):!1;n.push({name:d.name,target:RJ(d.input),running:_})}}}return n.reverse(),n.slice(Math.max(0,n.length-lC))}function OJ(t){let e=[];for(let n of t){let r=e[e.length-1];r&&!r.running&&!n.running&&r.name===n.name&&r.target===void 0&&n.target===void 0?r.count+=1:e.push({...n,count:1})}return e}function NJ(t){let e=t.running?oe("\u25D0",Z.visaGold):oe("\u2713",Z.green),n=t.running?Z.visaGold:Z.visaBlueSoft,r=oe(Ct(t.name),n),o=t.target?Ct(t.target):"",s=o?`${oe(":",Z.dim)} ${oe(o,Z.dim)}`:"",i=t.count>1?` ${oe(`\xD7${t.count}`,Z.dim)}`:"";return s?`${e} ${r}${s}${i}`:`${e} ${r}${i}`}function CJ(t){let e=` ${oe("\u2502",Z.dim)} `,n=dC(e),r=t.slice();for(;r.length>0;){let c=r.join(e);if(dC(c)<=JS)return c;r=r.slice(1)}if(t.length===0)return"";let o="\u2026",i=t[t.length-1].replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,""),a=i.length>JS-n-1?i.slice(0,JS-n-1)+o:i;return`${oe(o,Z.dim)}${e}${a}`}async function fC(t){if(!t||typeof t!="string")return null;let e=SC(t);if(!e)return null;let n;try{n=yJ(e)}catch{return null}if(n.length===0)return null;let o=OJ(n).map(NJ);return CJ(o)||null}async function TC(t,e,n){return(await hC(t,e,n)).join(`
39
- `)}function gC(t,e,n){let r=!!e?.activeSession||t.includes("in session"),o=n?IJ(n):!1;return{isActive:r||o,hasSession:r,hasToolActivity:o}}async function hC(t,e,n){let{isActive:r}=gC(t,n,e?.transcript_path);if(e&&!r){let s=[],i=pC(e);if(i&&s.push(...i.split(`
40
- `)),e.transcript_path){let c=await fC(e.transcript_path);c&&s.push(...c.split(`
41
- `))}let a=oe(tT(t),Z.dim);return s.push(a),s}let o=[t];if(e){let s=pC(e);if(s&&o.push(...s.split(`
42
- `)),e.transcript_path){let i=await fC(e.transcript_path);i&&o.push(...i.split(`
43
- `))}}return o}var vJ=["generate_image","generate_video","generate_music","generate_audio","generate_3d","upscale_image","run_llm","transcribe_audio","pay","get_status","buy_credits","get_cards","add_card","set_session_mode","query_onchain_prices","allium_explorer"];function IJ(t){let e=SC(t);if(!e)return!1;let n=e.slice(-16384).toLowerCase();return vJ.some(r=>n.includes(`"${r}"`))}async function AC(t,e,n){let r=await hC(t,e,n),o=r.join(`
44
- `),{isActive:s}=gC(t,n,e?.transcript_path);return{schemaVersion:fJ,client:e?OC(e):Qs.UNKNOWN,rendered:o,lines:r.map(tT),visa:{spendLine:tT(t),balanceCents:n?.balanceCents,balanceUsd:n?.amountUsd,sessionMode:n?.sessionMode,activeSession:n?.activeSession,isVisaActive:s},context:e?NC(e):{}}}function Ct(t){return t?t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ").trim():""}function rT(t){if(typeof t=="string")return Ct(uo.basename(t));if(!t||typeof t!="object")return"";let e=typeof t.current_dir=="string"?t.current_dir:typeof t.path=="string"?t.path:"";return Ct(e?uo.basename(e):t.name)}function RC(t){return Ct(t.app_name??t.appName??t.app??t.client)}function eT(t){return Ct(t.model?.display_name??t.model?.id??t.model_name??t.modelName)}function yC(t){return Ct(t.cwd??t.current_dir??t.project_root)}function mC(t){let e=Ct(t.project);if(e)return e;let n=yC(t);if(n)return Ct(uo.basename(n));let r=rT(t.workspace);return r||""}function tr(t){if(!(typeof t!="number"||!Number.isFinite(t)))return t}function OC(t){let e=RC(t).toLowerCase();return e.includes("codex")?Qs.CODEX:e.includes("claude")||t.model?.display_name||t.transcript_path||t.rate_limits?Qs.CLAUDE_CODE:t.run_state||t.runState||t.thread_title||t.threadTitle||t.git_branch||tr(t.context_used)!==void 0?Qs.CODEX:Qs.UNKNOWN}function PJ(t){return OC(t)===Qs.CODEX}function NC(t){let e=RC(t),n=yC(t),r=rT(t.workspace),o=tr(t.context_used)??tr(t.context_window?.used_percentage??void 0),s=tr(t.context_remaining)??tr(t.context_window?.remaining_percentage??void 0);return{...e?{app:e}:{},...eT(t)?{model:eT(t)}:{},...mC(t)?{project:mC(t)}:{},...r?{workspace:r}:{},...n?{cwd:n}:{},...Ct(t.git_branch??t.branch)?{gitBranch:Ct(t.git_branch??t.branch)}:{},...Ct(t.status??t.run_state??t.runState)?{status:Ct(t.status??t.run_state??t.runState)}:{},...Ct(t.thread_title??t.threadTitle)?{threadTitle:Ct(t.thread_title??t.threadTitle)}:{},...o!==void 0?{contextUsedPercent:o}:{},...s!==void 0?{contextRemainingPercent:s}:{},...tr(t.used_tokens)!==void 0?{usedTokens:tr(t.used_tokens)}:{},...tr(t.total_input_tokens)!==void 0?{totalInputTokens:tr(t.total_input_tokens)}:{},...tr(t.total_output_tokens)!==void 0?{totalOutputTokens:tr(t.total_output_tokens)}:{}}}function tT(t){return t.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"")}async function da(t,e){let n=e?.timeoutMs??3e4,r=new AbortController,o=setTimeout(()=>r.abort(),n);try{let{timeoutMs:s,...i}=e??{};return await fetch(t,{...i,signal:r.signal})}finally{clearTimeout(o)}}var pa=class extends Error{retryable;code;reason;paymentErrorClass;correlationId;transactionId;retryAfter;constructor(e,n,r,o,s,i,a,c){super(e),this.name="CardDeclinedError",this.retryable=n,this.code=r,this.reason=o,this.paymentErrorClass=s,this.correlationId=i,this.transactionId=a,this.retryAfter=c}};var CC={ENOTFOUND:"Cannot resolve the Visa CLI server hostname (DNS error). Check your internet connection or the auth.serverUrl setting.",EAI_AGAIN:"DNS lookup for the Visa CLI server failed temporarily. Check your internet connection and try again.",ECONNREFUSED:"The Visa CLI server refused the connection. The service may be down \u2014 check https://visacli.sh for status.",ECONNRESET:"The connection to the Visa CLI server was reset mid-request. Try again in a moment.",EHOSTUNREACH:"The Visa CLI server is unreachable from this network. Check your internet connection.",ETIMEDOUT:"The connection to the Visa CLI server timed out. Try again or check https://visacli.sh for status.",CERT_HAS_EXPIRED:"The Visa CLI server's TLS certificate is expired. Check https://visacli.sh for status; do not bypass the cert.",UND_ERR_CONNECT_TIMEOUT:"The connection to the Visa CLI server timed out before it could be established. Try again in a moment.",UND_ERR_SOCKET:"The connection to the Visa CLI server was interrupted. Try again in a moment."};function oT(t){let e=t&&typeof t=="object"?t:{};if(e.name==="AbortError"||typeof e.message=="string"&&e.message.includes("aborted"))return"The request timed out. The server may be under heavy load. Please try again.";let n=(e.cause&&typeof e.cause=="object"?e.cause.code:void 0)??(typeof e.code=="string"?e.code:void 0);return n&&CC[n]?CC[n]:`Network error contacting the Visa CLI server (${n?`${n}: ${typeof e.message=="string"?e.message:"unknown"}`:typeof e.message=="string"&&e.message.length>0?e.message:"unknown error"}). Check https://visacli.sh for status.`}var bJ=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;function IC(t,e){let n=vC(t),r=vC(e);if(!n||!r)return!1;for(let o=0;o<3;o++)if(n.main[o]!==r.main[o])return n.main[o]>r.main[o];return n.pre&&!r.pre?!1:!n.pre&&r.pre?!0:!n.pre&&!r.pre?!1:MJ(n.pre,r.pre)>0}function vC(t){if(typeof t!="string")return null;let n=t.trim().replace(/^v/,"").match(bJ);return n?{main:[Number(n[1]),Number(n[2]),Number(n[3])],pre:n[4]??null}:null}function MJ(t,e){let n=t.split("."),r=e.split("."),o=Math.max(n.length,r.length);for(let s=0;s<o;s++){if(s>=n.length)return-1;if(s>=r.length)return 1;let i=n[s],a=r[s],c=/^\d+$/.test(i),u=/^\d+$/.test(a);if(c&&u){let l=Number(i)-Number(a);if(l!==0)return l}else{if(c)return-1;if(u)return 1;if(i<a)return-1;if(i>a)return 1}}return 0}function Nr(){return!!(PC(process.env.VISA_CLI_NO_UPDATE_CHECK)||PC(process.env.CI)||process.env.NODE_ENV==="test")}function PC(t){if(t===void 0)return!1;let e=t.trim().toLowerCase();return!(e===""||e==="0"||e==="false"||e==="no"||e==="off")}var Yo=v(require("fs")),LC=v(require("path"));var sp=v(require("fs")),bC=v(require("path")),MC=v(require("os"));var sT=bC.join(MC.homedir(),".visa-mcp"),Nu=class{static ensureConfigDir(){sp.existsSync(sT)||sp.mkdirSync(sT,{recursive:!0,mode:448})}static getConfigDir(){return sT}static TOOL_STATES={login:!0,get_status:!0,get_cards:!0,add_card:!0,pay:!1,transaction_history:!0,update_spending_controls:!0,enroll_device:!1,verify_otp:!1,reset:!0,batch:!0,generate_x402_image:!1,browser_launch:!1,browser_navigate:!1,browser_snapshot:!1,browser_click:!1,browser_type:!1,browser_scroll:!1,generate_music_card:!1,generate_image_card:!1,query_onchain_prices_card:!1,generate_music_tempo_card:!1,check_music_status_tempo_card:!1,generate_image_fast_card:!1,generate_video_tempo_card:!1};static loadToolStates(){return{...this.TOOL_STATES}}static getDisabledTools(){let e=new Set;for(let[n,r]of Object.entries(this.TOOL_STATES))r||e.add(n);return e}static isToolDisabled(e){return this.TOOL_STATES[e]===!1}};var LJ="settings.json";function Cu(){return LC.join(Nu.getConfigDir(),LJ)}var fa={"auth.serverUrl":{type:"string",description:"Auth server base URL. Override for staging / self-hosted backends.",requiresRestart:!0,validate:t=>{if(typeof t!="string")throw new Error("auth.serverUrl must be a string");let e;try{e=new URL(t)}catch{throw new Error(`auth.serverUrl must be a valid URL (got: ${JSON.stringify(t)})`)}if(e.protocol!=="https:"&&e.protocol!=="http:")throw new Error(`auth.serverUrl must use http or https (got: ${e.protocol})`)}},"ui.suppressBrowser":{type:"boolean",description:"When true, the CLI/MCP server stops auto-opening result URLs in your browser."},"ui.suppressFeed":{type:"boolean",description:"When true, generated images/music are not auto-submitted to the public Made-with-Visa feed."},"tools.meta":{type:"boolean",description:"Show category meta-tools (generate_image, generate_music, ...). Restart required.",requiresRestart:!0},"tools.discover":{type:"boolean",description:"Show the dynamic-catalog tools (discover_tools, execute_tool). Restart required.",requiresRestart:!0},"merchants.discover":{type:"string",description:'Platform-merchant JIT tool discovery: "all" = every live merchant, "off" = none, comma-separated slugs = exactly those. Equivalent to VISA_MERCHANT_DISCOVER / VISA_MERCHANT_SLUGS env. Restart required.',requiresRestart:!0,validate:t=>{if(typeof t!="string")throw new Error("merchants.discover must be a string");let e=t.trim().toLowerCase();if(e===""||e==="all"||e==="off"||e==="*")return;let n=/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/,r=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of r)if(!n.test(o))throw new Error(`merchants.discover: "${o}" is not a valid merchant slug`)}},"credit.sessionCapCents":{type:"number",description:"Default cap (in cents) for start_session and pay-as-you-go one-shot approvals. Server clamps to [100, 10000] = $1\u2013$100. Default 500 ($5).",validate:t=>{if(typeof t!="number"||!Number.isFinite(t))throw new Error("credit.sessionCapCents must be a number");if(!Number.isInteger(t))throw new Error("credit.sessionCapCents must be a whole number of cents (no fractional cents)");if(t<100||t>1e4)throw new Error("credit.sessionCapCents must be between 100 ($1) and 10000 ($100)")}}},xC=500,ip={"tools.specific":"Legacy direct _card MCP tools are retired. Use category meta-tools or discover_tools/execute_tool.","credit.sessionMode":"The session-mode toggle is retired. Use start_session, close_session, and get_session_status."};function ei(){let t=Cu();if(!Yo.existsSync(t))return{};try{let e=Yo.readFileSync(t,"utf-8"),n=JSON.parse(e);return!n||typeof n!="object"||Array.isArray(n)?{}:n}catch{return{}}}function iT(t){Nu.ensureConfigDir();let e=Cu(),n=`${e}.tmp`,r=JSON.stringify(t,null,2)+`
45
- `;Yo.writeFileSync(n,r,{mode:384}),Yo.renameSync(n,e)}function aT(t){let e=ei()[t];return typeof e=="string"?e:void 0}function DC(t){let e=ei()[t];if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function UC(t){let e=ei()[t];if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim().length>0){let n=Number(e);if(Number.isFinite(n))return n}}var ti=class extends Error{constructor(e){let n=Object.keys(fa).sort().join(", ");super(`Unknown setting "${e}". Settable keys: ${n}. For server-controlled values (biometric.*, spending.*) use the dedicated tools (biometric_on/off, update_spending_controls).`),this.name="UnknownSettingKeyError"}},ni=class extends Error{constructor(e){let n="";e.startsWith("biometric.")?n="biometric_on / biometric_off":e.startsWith("spending.")?n="update_spending_controls":e.startsWith("cards.")?n="add_card / remove_card / set_default_card":e.startsWith("account.")&&(n="login / reset"),super(`"${e}" is a server-controlled value and cannot be set via config set. `+(n?`Use ${n} instead.`:"No client-side override is supported.")),this.name="ServerOnlySettingError"}},_a=class extends Error{constructor(e){super(`"${e}" is retired and ignored. Remove it with \`visa-cli config unset ${e}\`. `+ip[e]),this.name="RetiredSettingKeyError"}},wC=["biometric.","spending.","account.","cards.","biometric"];function cT(t,e){if(wC.some(s=>t.startsWith(s)))throw new ni(t);if(t in ip)throw new _a(t);let n=fa[t];if(!n)throw new ti(t);let r;if(n.type==="boolean")if(typeof e=="boolean")r=e;else if(typeof e=="string"){let s=e.toLowerCase();if(s==="true")r=!0;else if(s==="false")r=!1;else throw new Error(`${t} expects true or false (got: ${JSON.stringify(e)})`)}else throw new Error(`${t} expects a boolean (got: ${typeof e})`);else if(n.type==="number")if(typeof e=="number")r=e;else if(typeof e=="string"&&e.trim().length>0){let s=Number(e);if(!Number.isFinite(s))throw new Error(`${t} expects a number (got: ${JSON.stringify(e)})`);r=s}else throw new Error(`${t} expects a number (got: ${typeof e})`);else{if(typeof e!="string"||e.length===0)throw new Error(`${t} expects a non-empty string`);r=e}n.validate&&n.validate(r);let o=ei();return o[t]=r,iT(o),{key:t,value:r,requiresRestart:!!n.requiresRestart,path:Cu()}}function uT(t){if(wC.some(s=>t.startsWith(s)))throw new ni(t);let e=fa[t];if(t in ip){let s=ei(),i=t in s;return i&&(delete s[t],iT(s)),{key:t,removed:i,requiresRestart:!1,path:Cu()}}if(!e)throw new ti(t);let r=ei(),o=t in r;return o&&(delete r[t],iT(r)),{key:t,removed:o,requiresRestart:o&&!!e.requiresRestart,path:Cu()}}function kC(){let t=ei();return Object.entries(ip).filter(([e])=>e in t).map(([e,n])=>({key:e,value:t[e],hint:n}))}var xJ="https://auth.visacli.sh",DJ="https://auth-visa-code-preview.up.railway.app";function UJ(t){return typeof t=="string"&&/-(?:rc|alpha|beta)\./i.test(t)}function wJ(){try{let t=Zd();return UJ(t.version)}catch{return!1}}function kJ(t){return t.envVar!==void 0&&t.envVar!==""?t.envVar:t.settingValue!==void 0?t.settingValue:t.isPrerelease?DJ:xJ}function Cr(){return kJ({envVar:process.env.VISA_AUTH_URL,settingValue:aT("auth.serverUrl"),isPrerelease:wJ()})}var vu="2.0.0-rc.37",VJ=/^vk_[A-Za-z0-9_-]{32,}$/;function VC(t=process.env,e=process.stdin.isTTY){let n=["Not logged in. No local Visa CLI session credentials were found."],r=t.VISA_CLI_API_KEY?.trim();return r?VJ.test(r)?(n.push("VISA_CLI_API_KEY is set, but MCP bearer tools currently require a local session from visa-cli setup."),n.push("For headless API-key use, call the /v1/api/* HTTP routes with X-Api-Key instead of MCP bearer tools.")):(n.push("VISA_CLI_API_KEY is set but has invalid format (expected vk_<32+ base64url chars>)."),n.push("Create a new key with: visa-cli api-key create <app-name>")):n.push("Run `visa-cli setup` in an interactive terminal to authenticate."),e===!1&&n.push("This process appears to be running without a TTY; complete setup in a normal terminal, then restart the MCP client."),n.join(`
46
- `)}var nr=class{constructor(e){this.getSessionToken=e;this.baseUrl=Cr()}getSessionToken;baseUrl;lastSignals={};parseServerSignals(e){if(this.lastSignals={},!Nr()){let r=e.headers.get("X-Latest-Version");r&&IC(r,vu)&&(this.lastSignals.updateAvailable={currentVersion:vu,latestVersion:r})}let n=e.headers.get("X-Feedback-Prompt");if(n)try{this.lastSignals.feedbackPrompt=JSON.parse(n)}catch{}}getClientVersion(){return vu}async request(e,n,r,o,s,i){let a=await this.getSessionToken();if(!a)throw new Error(VC());let c={Authorization:`Bearer ${a}`};s&&(e==="GET"?c["X-User-Context"]=encodeURIComponent(s.replace(/[\r\n\0]/g," ").slice(0,1e3)):r={...r||{},user_context:s}),i&&(c["X-Visa-Meta-Tool"]=i),r&&(c["Content-Type"]="application/json");let u;try{u=await da(`${this.baseUrl}${n}`,{method:e,headers:{...c,"X-Visa-CLI-Version":vu,"X-Source":"cli"},body:r?JSON.stringify(r):void 0,timeoutMs:o})}catch(d){throw new Error(oT(d))}if(this.parseServerSignals(u),u.status===401)throw new Error("Your session has expired. Run: visa-cli setup");if(u.status===429){let d=u.headers.get("Retry-After")||"3";throw new Error(`Rate limited \u2014 wait ${d}s. Tip: use the batch tool to combine multiple requests into one.`)}if(u.status===503)throw new Error("Visa CLI is temporarily unavailable. Check https://visacli.sh for status.");let l;try{l=await u.json()}catch{throw u.status===500?new Error(`Server error on ${n}. Try again or check https://visacli.sh for status.`):new Error(`Unexpected response from ${n}. Try again.`)}if(!u.ok){if(u.status===500)throw new Error(`Server error on ${n}. Try again or check https://visacli.sh for status.`);if(l?.declined){let d=Number(l.retryAfter??u.headers.get("Retry-After"));throw new pa(l.error||"Your card was declined.",!!l.retryable,l.code,l.reason,l.payment_error_class,l.correlation_id,l.transactionId,Number.isFinite(d)&&d>0?d:void 0)}if(u.status===402){let d=l?.error||"Gateway returned 402";throw new Error(`${d}. This usually means your daily or per-transaction spending limit has been reached. Check your limits with get_status or run: visa-cli update-spending-controls`)}throw new Error(l?.error||`Request failed (${u.status}). Try again.`)}return l}async pay(e,n){return this.request("POST","/v1/pay",e,void 0,n)}async shortcut(e,n,r,o,s){return this.request("POST",`/v1/shortcuts/${encodeURIComponent(e)}`,n,r,o,s)}async shortcutWithSession(e,n,r,o,s,i){let a=`/v1/shortcuts/${encodeURIComponent(e)}`,c=await this.getSessionToken();if(!c)throw new Error(VC());let u={Authorization:`Bearer ${c}`,"X-Visa-CLI-Version":vu,"X-Source":"cli","Content-Type":"application/json"};i&&(u["X-Visa-Meta-Tool"]=i);let l={...n,...r};s&&(l.user_context=s.replace(/[\r\n\0]/g," ").slice(0,1e3));let d;try{d=await da(`${this.baseUrl}${a}`,{method:"POST",headers:u,body:JSON.stringify(l),timeoutMs:o})}catch(f){throw new Error(oT(f))}if(this.parseServerSignals(d),d.status===401)throw new Error("Your session has expired. Run: visa-cli setup");if(d.status===429){let f=d.headers.get("Retry-After")||"3";throw new Error(`Rate limited \u2014 wait ${f}s. Tip: use the batch tool to combine multiple requests into one.`)}if(d.status===503)throw new Error("Visa CLI is temporarily unavailable. Check https://visacli.sh for status.");let p=d.headers.get("X-Voucher-Receipt"),_;try{_=await d.json()}catch{throw d.status===500?new Error(`Server error on ${a}. Try again or check https://visacli.sh for status.`):new Error(`Unexpected response from ${a}. Try again.`)}if(!d.ok){if(d.status===500)throw new Error(`Server error on ${a}. Try again or check https://visacli.sh for status.`);if(_?.declined){let f=Number(_.retryAfter??d.headers.get("Retry-After"));throw new pa(_.error||"Your card was declined.",!!_.retryable,_.code,_.reason,_.payment_error_class,_.correlation_id,_.transactionId,Number.isFinite(f)&&f>0?f:void 0)}throw new Error(_?.error||`Request failed (${d.status}). Try again.`)}return{data:_,voucherReceiptHeader:p}}async batch(e,n,r){return this.request("POST","/v1/batch",e,n,r)}async emitTelemetry(e){return this.request("POST","/v1/telemetry",{rows:e})}async catalogSearch(e,n,r){let o=r??"discover_tools",s=new URLSearchParams;e&&s.set("q",e),n&&s.set("category",n);let i=s.toString();return this.request("GET",`/v1/catalog${i?`?${i}`:""}`,void 0,void 0,void 0,o)}async catalogTool(e,n){let r=n??"discover_tools";try{return await this.request("GET",`/v1/catalog/${encodeURIComponent(e)}`,void 0,void 0,void 0,r)}catch{return null}}async discoverMerchantRoutes(e){try{return await this.request("GET",`/v1/platform/discover/${encodeURIComponent(e)}`)}catch{return null}}async listPublicMerchants(){try{let e=await da(`${this.baseUrl}/v1/platform/merchants/public`,{method:"GET",timeoutMs:8e3});if(!e.ok)return[];let n=await e.json();return Array.isArray(n.merchants)?n.merchants:[]}catch{return[]}}async getPublicMerchantDiscover(e){try{let n=await da(`${this.baseUrl}/v1/platform/discover/${encodeURIComponent(e)}`,{method:"GET",timeoutMs:8e3});return n.ok?await n.json():null}catch{return null}}async paymentPreview(e,n){return this.request("POST","/v1/payment-preview",e,void 0,n)}async getBalance(){return this.request("GET","/v1/balance")}async topupBalance(e){return this.request("POST","/v1/balance/topup",e)}async createSessionBudget(e){return this.request("POST","/v1/session-budget/create",{...e,mode:"prepaid"})}async closeSession(e){return this.request("POST","/v1/session/close",{session_budget_id:e})}async getSessionBudget(e){return this.request("GET",`/v1/session-budget/${encodeURIComponent(e)}`)}async getSessionLedger(e){return this.request("GET",`/v1/session/${encodeURIComponent(e)}/ledger`)}async getStatus(e){return this.request("GET","/v1/status",void 0,void 0,e)}async getFeatureFlags(){return this.request("GET","/v1/feature-flags")}async getVisaSmi(e,n){return this.request("POST","/v1/visa/smi",e,6e4,n)}async getTransactions(e,n){let r=new URLSearchParams;e?.limit!=null&&r.set("limit",String(e.limit)),e?.offset!=null&&r.set("offset",String(e.offset));let o=r.toString(),s=o?`/v1/transactions?${o}`:"/v1/transactions";return this.request("GET",s,void 0,void 0,n)}async updateSpendingControls(e,n){return this.request("POST","/v1/spending-controls",e,void 0,n)}async removeCard(e,n,r){return this.request("DELETE",`/v1/cards/${encodeURIComponent(String(e))}`,n,void 0,r)}async setDefaultCard(e,n,r){return this.request("POST",`/v1/cards/${encodeURIComponent(String(e))}/default`,n,void 0,r)}async getAttestationChallenge(){return this.request("GET","/v1/attestation-challenge")}async registerAttestationKey(e){return this.request("POST","/v1/attestation-key",{publicKey:e})}async setBiometricPreference(e,n){return this.request("POST","/v1/biometric-preference",{...e,confirm:!0},void 0,n)}async logout(e,n){return this.request("POST","/v1/logout",e,void 0,n)}async feedback(e,n,r){return this.request("POST","/v1/feedback",{message:e,...n&&{transaction_id:n}},void 0,r)}async createAppApiKey(e){return this.request("POST","/v1/api/keys",e)}async listAppApiKeys(){return this.request("GET","/v1/api/keys")}async revokeAppApiKey(e){return this.request("DELETE",`/v1/api/keys/${encodeURIComponent(String(e))}`)}async feedSubmit(e){return this.request("POST","/v1/feed",e)}async feedList(e){let n=new URLSearchParams;e?.tab&&n.set("tab",e.tab),e?.limit&&n.set("limit",String(e.limit)),e?.offset&&n.set("offset",String(e.offset));let r=n.toString();return this.request("GET",`/v1/feed${r?"?"+r:""}`)}async feedVote(e,n){return this.request("POST",`/v1/feed/${encodeURIComponent(e)}/vote`,{direction:n})}async feedApprove(e){return this.request("POST",`/v1/feed/${encodeURIComponent(e)}/approve`)}async feedDelete(e){return this.request("DELETE",`/v1/feed/${encodeURIComponent(e)}`)}async feedPending(){return this.request("GET","/v1/feed/pending")}async submitFeedback(e,n,r){return this.request("POST","/v1/feedback",{message:e,...n&&{transaction_id:n}},void 0,r)}async getFeedback(e,n){let r=new URLSearchParams;e&&r.set("limit",String(e));let o=r.toString();return this.request("GET",`/v1/feedback${o?"?"+o:""}`,void 0,void 0,n)}async submitRatedFeedback(e){return this.request("POST","/v1/feedback",e)}};var fT=require("child_process"),jC=require("util"),qC=v(require("crypto")),xt=v(require("fs")),YC=v(require("os")),Ir=v(require("path"));var un=v(require("fs")),pT=v(require("path")),BC=v(require("os")),dT=pT.join(BC.homedir(),".visa-mcp"),Iu=pT.join(dT,"mcp-server.log"),BJ=5*1024*1024,lT=null;function GJ(){un.existsSync(dT)||un.mkdirSync(dT,{recursive:!0,mode:448})}function HJ(){if(!lT){if(GJ(),un.existsSync(Iu)&&un.statSync(Iu).size>BJ){let e=Iu+".1";un.existsSync(e)&&un.unlinkSync(e),un.renameSync(Iu,e)}lT=un.createWriteStream(Iu,{flags:"a"})}return lT}function FJ(t){return t==="WARN"||t==="ERROR"?!0:process.env.VISA_CLI_DEBUG==="1"||process.env.VISA_VERBOSE==="1"}function ap(t,...e){let n=new Date().toISOString(),r=e.map(s=>typeof s=="string"?s:JSON.stringify(s,null,2)).join(" "),o=`[${n}] [${t}] ${r}
47
- `;FJ(t)&&process.stderr.write(o),HJ().write(o)}var vr={debug:(...t)=>ap("DEBUG",...t),info:(...t)=>ap("INFO",...t),warn:(...t)=>ap("WARN",...t),error:(...t)=>ap("ERROR",...t)};var ma=(0,jC.promisify)(fT.execFile),lp=Ir.join(YC.homedir(),".visa-mcp","bin"),ri=Ir.join(lp,"Visa CLI"),$J=Ir.join(__dirname,"..","native"),GC="5",HC=Ir.join(lp,"visa-keychain.version"),FC=Ir.join(lp,"visa-keychain.sha256");function $C(t){let e=xt.readFileSync(t);return qC.createHash("sha256").update(e).digest("hex")}async function KC(){try{if(xt.readFileSync(HC,"utf-8").trim()===GC&&xt.existsSync(ri)){let r=xt.readFileSync(FC,"utf-8").trim();if($C(ri)!==r)vr.warn("binary:hash-mismatch",{message:"Binary hash mismatch \u2014 possible tampering detected. Recompiling from source."}),xt.unlinkSync(ri);else return ri}}catch{}let t=Ir.join($J,"visa-keychain.m");if(xt.existsSync(t)||(t=Ir.resolve(__dirname,"..","..","native","visa-keychain.m")),xt.existsSync(t)||(t=Ir.resolve(__dirname,"..","native","visa-keychain.m")),!xt.existsSync(t))throw new Error("visa-keychain.m source not found. Reinstall Visa CLI.");xt.mkdirSync(lp,{recursive:!0,mode:448});try{await ma("clang",["-framework","Security","-framework","LocalAuthentication","-framework","Foundation","-framework","AppKit","-o",ri,t],{timeout:3e4})}catch(n){throw n.code==="ENOENT"?new Error("Xcode Command Line Tools required. Install: xcode-select --install"):n}let e=$C(ri);return xt.writeFileSync(FC,e,{mode:384}),xt.writeFileSync(HC,GC,{mode:384}),ri}async function WC(t){let e=await KC(),n;try{n=(await ma(e,t,{timeout:6e4})).stdout}catch(s){n=s.stdout||"";let i=n.trim();throw i.startsWith("ERROR:")?new Error(i.slice(6)):new Error(s.stderr?.trim()||s.message||"Unknown error")}let r=n.trim();if(r.startsWith("OK:"))return r.slice(3);if(r==="OK")return;let o=r.startsWith("ERROR:")?r.slice(6):"Unknown error";throw new Error(o)}var _T=null;function zt(){return process.env.VISA_MOCK_TOUCHID==="true"?!0:process.platform!=="darwin"?!1:_T!==null?_T:(_T=!0,!0)}var cp="visa-cli",up="attestation-key";async function jJ(t){try{await ma("security",["delete-generic-password","-s",cp,"-a",up],{timeout:5e3})}catch{}await ma("security",["add-generic-password","-s",cp,"-a",up,"-w",t],{timeout:5e3})}async function qJ(){try{let{stdout:t}=await ma("security",["find-generic-password","-s",cp,"-a",up,"-w"],{timeout:5e3});return t.trim()||null}catch{return null}}async function dp(){let t=await WC(["generate-key"]);if(!t)throw new Error("Key generation returned no output");let e=t.indexOf(":");if(e<0)throw new Error("Unexpected generate-key output format");let n=t.slice(0,e),r=t.slice(e+1);return await jJ(n),r}async function pp(t,e){if(process.env.VISA_MOCK_TOUCHID==="true")return Promise.resolve("mock-ecdsa-signature-for-testing");let n=await qJ();if(!n)throw new Error("Attestation key not found. Run setup to generate a new key.");let r=await KC(),o=["sign",t];return e&&o.push(e),new Promise((s,i)=>{let a=(0,fT.execFile)(r,o,{timeout:6e4},(c,u)=>{let l=(u||"").trim();if(c){l.startsWith("ERROR:")?i(new Error(l.slice(6))):i(new Error(c.stderr?.trim()||c.message||"Unknown error"));return}l.startsWith("OK:")?s(l.slice(3)):i(new Error(l.startsWith("ERROR:")?l.slice(6):"Unknown error"))});a.stdin.write(n),a.stdin.end()})}async function mT(){try{await ma("security",["delete-generic-password","-s",cp,"-a",up],{timeout:5e3})}catch{}try{await WC(["delete-key"])}catch{}}var YJ=["npm","pnpm","yarn","bun"],KJ=/\s+/;function WJ(){let t=process.env.npm_config_user_agent;if(!t)return;let e=t.trim();if(e==="")return;let n=e.split(KJ)[0]??"",r=n.indexOf("/"),o=r===-1?n:n.slice(0,r);return YJ.includes(o)?o:void 0}function Ea(t,e){let n=e??WJ()??"npm",o=`@visa/cli@${t??"latest"}`;switch(n){case"npm":return`npm install -g ${o}`;case"pnpm":return`pnpm add -g ${o}`;case"yarn":return`yarn global add ${o}`;case"bun":return`bun add -g ${o}`}}function zC(t,e=process.stderr){if(Nr()||!t?.updateAvailable)return!1;let{latestVersion:n}=t.updateAvailable;if(!n)return!1;let r=`Update available: v${n}. Run: ${Ea()}`;return e.write(`
31
+ `),process.exit(1)}var rC=require("child_process");function oC(t=process.env,e=process.platform){return t.VISA_CLI_NO_BROWSER==="1"||t.VISA_CLI_NO_BROWSER==="true"?{headless:!0,reason:"VISA_CLI_NO_BROWSER is set"}:t.CI==="true"||t.CI==="1"?{headless:!0,reason:"CI environment detected"}:t.SSH_CONNECTION||t.SSH_TTY?{headless:!0,reason:"SSH session detected"}:e==="linux"&&!t.DISPLAY&&!t.WAYLAND_DISPLAY?{headless:!0,reason:"Linux with no $DISPLAY or $WAYLAND_DISPLAY"}:{headless:!1}}function mJ(t){let n=t.length+4;return[`\u250C${"\u2500".repeat(n)}\u2510`,`\u2502${" ".repeat(2)}${t}${" ".repeat(2)}\u2502`,`\u2514${"\u2500".repeat(n)}\u2518`].join(`
32
+ `)}function sC(t,e=process.platform){return e==="darwin"?{cmd:"open",args:[t]}:e==="win32"?{cmd:"cmd",args:["/c","start","",t]}:e==="linux"?{cmd:"xdg-open",args:[t]}:null}async function iC(t,e={}){let n=e.log??(c=>console.log(c)),r=e.env??process.env,o=e.platform??process.platform,s=e.spawn??((c,u,l)=>{(0,rC.execFile)(c,u,d=>l(d))});n(""),n(" Sign in to Visa CLI by opening this URL in your browser:"),n("");for(let c of mJ(t).split(`
33
+ `))n(` ${c}`);n("");let i=oC(r,o);if(i.headless){n(` (${i.reason} \u2014 skipping browser auto-open.)`),n(" Open the URL above on any device with a browser. The CLI will"),n(" continue waiting for you to complete sign-in."),n("");return}let a=sC(t,o);if(!a){n(` No known browser-open command for platform "${o}".`),n(" Open the URL above manually to continue."),n("");return}await new Promise(c=>{s(a.cmd,a.args,u=>{u?(n(` Could not open browser automatically (${u.message}).`),n(" Open the URL above manually to continue."),n("")):(n(" Opened browser. Waiting for you to sign in..."),n("")),c()})})}function EJ(t){return new Promise(e=>setTimeout(e,t))}function aC(t){if(typeof t=="number"&&Number.isFinite(t)&&t>0)return t*1e3;if(typeof t!="string"||t.trim()==="")return null;let e=Number(t);if(Number.isFinite(e)&&e>0)return e*1e3;let n=Date.parse(t);return Number.isFinite(n)?Math.max(n-Date.now(),0):null}function cC(t){return!Number.isFinite(t)||t===null||t<=0?1e3:Math.min(Math.max(Math.ceil(t),1e3),3e4)}async function SJ(t,e=Math.random()*250){let n=o=>Math.min(o+Math.max(0,Math.ceil(e)),3e4);if(!t||t.status!==429)return n(1e3);let r=aC(t.headers?.get("Retry-After"));if(r!==null)return n(cC(r));if(typeof t.json=="function")try{let o=await t.json();return n(cC(aC(o?.retryAfter)))}catch{return n(1e3)}return n(1e3)}async function np(t,e){let n=await SJ(t);return e?.(n),await EJ(n),n}var lC=v(require("crypto")),cn=v(require("fs")),rp=v(require("path"));function dC(t,e){cn.mkdirSync(rp.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.${lC.randomBytes(8).toString("hex")}.tmp`;try{cn.writeFileSync(n,JSON.stringify(e,null,2)+`
34
+ `),cn.renameSync(n,t)}catch(r){try{cn.unlinkSync(n)}catch{}throw r}}function uC(t){return`'${t.replace(/'/g,"'\\''")}'`}var pC="# visa-cli-hud-v1";function TJ(t,e){let n=t??process.execPath,r=e??process.argv[1]??"",o=r?rp.resolve(r):"";return`${o?`${uC(n)} ${uC(o)} statusline`:"visa-cli statusline"} ${pC}`}function la(t){return typeof t!="string"?!1:t.includes(pC)?!0:t.includes("visa-cli")&&t.includes("statusline")}function op(t,e=TJ){let n={},r=!1;if(cn.existsSync(t)){r=!0;try{n=JSON.parse(cn.readFileSync(t,"utf-8"))}catch(o){return{installed:"malformed-json",message:`~/.claude/settings.json is not valid JSON (${o.message}). Fix the file manually, then run: visa-cli hud enable claude`}}}if(n.statusLine){let o=typeof n.statusLine=="object"?n.statusLine.command:"";return la(o)?{installed:"already-visa",message:"Visa HUD already registered in ~/.claude/settings.json."}:{installed:"other-hud-present",message:"Another HUD is already configured (keeping it). To switch to Visa HUD, edit ~/.claude/settings.json \u2192 statusLine.command"}}try{return n.statusLine={type:"command",command:e()},dC(t,n),{installed:"new",message:`Visa HUD registered in ~/.claude/settings.json${r?"":" (new file)"}. Restart Claude Code to see it pinned below the input.`}}catch(o){return{installed:"error",message:`Failed to write settings: ${o.message}. Enable manually later with: visa-cli hud enable claude`}}}function JS(t){if(!cn.existsSync(t))return{removed:!1,message:"No ~/.claude/settings.json found."};let e;try{e=JSON.parse(cn.readFileSync(t,"utf-8"))}catch(r){return{removed:!1,message:`~/.claude/settings.json is not valid JSON: ${r.message}`}}if(!e.statusLine)return{removed:!1,message:"No statusLine configured."};let n=typeof e.statusLine=="object"?e.statusLine.command:"";return la(n)?(delete e.statusLine,dC(t,e),{removed:!0,message:"Visa HUD removed from ~/.claude/settings.json. Restart Claude Code to take effect."}):{removed:!1,message:"statusLine is owned by another tool \u2014 leaving it alone."}}var co=v(require("fs")),uo=v(require("path")),gJ=1,Qs={CLAUDE_CODE:"claude-code",CODEX:"codex",UNKNOWN:"unknown"},hJ=["terminal","claude","claude-code","codex","all"];function rT(t){let e=t.toLowerCase();return hJ.includes(e)?e:null}var AJ=50,RJ=64*1024,_C=10,ZS=80;function yJ(){let t=(process.env.COLORTERM??"").toLowerCase();if(t==="truecolor"||t==="24bit")return!0;let e=(process.env.TERM??"").toLowerCase();return e.includes("truecolor")||e.includes("24bit")}var QS=yJ(),Z={reset:"\x1B[0m",visaBlue:QS?"\x1B[38;2;20;52;203m":"\x1B[38;5;27m",visaBlueSoft:QS?"\x1B[38;2;97;126;229m":"\x1B[38;5;111m",visaGold:QS?"\x1B[38;2;247;182;0m":"\x1B[38;5;220m",green:"\x1B[38;5;48m",dim:"\x1B[2m"};function oe(t,e){return t.length===0||process.env.NO_COLOR?t:`${e}${t}${Z.reset}`}function fC(t){return t.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/[\u0000-\u001F\u007F]/g,"").length}async function gC(t=process.stdin){return t.isTTY?null:new Promise(e=>{let n=[],r=!1,o=()=>{t.removeListener("data",i),t.removeListener("end",a),t.removeListener("error",c),clearTimeout(u)},s=l=>{r||(r=!0,o(),e(l))},i=l=>{n.push(typeof l=="string"?Buffer.from(l):l)},a=()=>{let l=Buffer.concat(n).toString("utf-8").trim();if(!l)return s(null);try{let d=JSON.parse(l);s(d&&typeof d=="object"?d:null)}catch{s(null)}},c=()=>s(null),u=setTimeout(()=>{n.length>0?a():s(null)},AJ);t.on("data",i),t.on("end",a),t.on("error",c)})}function sp(t){let n=Math.round(Math.max(0,Math.min(1,t))*10),r="\u2588".repeat(n),o="\u2591".repeat(10-n);return`${oe(r||"",Z.visaBlueSoft)}${oe(o||"",Z.dim)}`}function eT(t){return!Number.isFinite(t)||t<0?"0":t>=1e6?`${(t/1e6).toFixed(1)}M`:t>=1e3?`${Math.round(t/1e3)}k`:String(Math.round(t))}function mC(t){if(DJ(t))return OJ(t);let e=` ${oe("\u2502",Z.dim)} `,n=tT(t)||"claude",r=t.cwd?Ct(uo.basename(t.cwd)):"",o=oT(t.workspace),s=r||o,i=o&&o!==s?` ${oe(`@${o}`,Z.visaBlueSoft)}`:"",a=[oe(`[${n}]`,Z.visaBlueSoft)];s&&a.push(`${oe(s,Z.visaGold)}${i}`);let c=a.join(e),u=Number(t.context_window?.context_window_size??0),l=typeof t.context_window?.used_percentage=="number"?t.context_window.used_percentage:typeof t.context_window?.remaining_percentage=="number"?100-t.context_window.remaining_percentage:null,d=t.context_window?.current_usage,p=[d?.input_tokens,d?.output_tokens,d?.cache_creation_input_tokens,d?.cache_read_input_tokens].filter(A=>typeof A=="number"&&Number.isFinite(A)),_=p.length>0?p.reduce((A,M)=>A+M,0):null,f=Number(t.context_window?.total_input_tokens??_??d?.input_tokens??0),E=l!==null?Math.max(0,Math.min(1,l/100)):u>0?Math.max(0,Math.min(1,f/u)):0,S=l!==null&&u>0?Math.round(E*u):f,g;if(u>0||l!==null){let A=`${String(Math.round(E*100)).padStart(2," ")}%`,M=u>0?` ${oe(`(${eT(S)}/${eT(u)})`,Z.dim)}`:"";g=`${oe("Context",Z.dim)} ${sp(E)} ${oe(A,Z.green)}${M}`}else g=`${oe("Context",Z.dim)} ${oe("-",Z.dim)}`;let h=CJ(t.rate_limits),O=[g];h&&O.push(h);let N=O.join(e);return`${c}
35
+ ${N}`}function OJ(t){let e=` ${oe("\u2502",Z.dim)} `,n=IC(t),r=n.model||"codex",o=[oe(`[${r}]`,Z.visaBlueSoft)];n.project&&o.push(oe(n.project,Z.visaGold)),n.gitBranch&&o.push(`${oe("git",Z.dim)} ${oe(n.gitBranch,Z.visaGold)}`);let s=o.join(e),i=[];if(typeof n.contextUsedPercent=="number"){let c=Math.max(0,Math.min(1,n.contextUsedPercent/100));i.push(`${oe("Context",Z.dim)} ${sp(c)} ${oe(`${Math.round(n.contextUsedPercent)}%`,Z.green)}`)}else if(typeof n.contextRemainingPercent=="number"){let c=100-n.contextRemainingPercent,u=Math.max(0,Math.min(1,c/100));i.push(`${oe("Context",Z.dim)} ${sp(u)} ${oe(`${Math.round(c)}%`,Z.green)}`)}typeof n.usedTokens=="number"&&i.push(`${oe("Tokens",Z.dim)} ${eT(n.usedTokens)}`),n.status&&i.push(`${oe("Status",Z.dim)} ${oe(n.status,Z.visaBlueSoft)}`),n.threadTitle&&i.push(`${oe("Thread",Z.dim)} ${oe(n.threadTitle,Z.visaBlueSoft)}`);let a=i.length>0?i.join(e):`${oe("Context",Z.dim)} ${oe("-",Z.dim)}`;return`${s}
36
+ ${a}`}function NJ(t){if(typeof t!="number"||t<=0)return"";let n=(t>1e12?t:t*1e3)-Date.now();if(n<=0||n>=10080*60*1e3)return"";let r=Math.floor(n/6e4),o=Math.floor(r/60),s=r%60;return o>0?`${o}h ${s}m`:`${s}m`}function EC(t,e){if(!t||typeof t.used_percentage!="number")return null;let n=Math.max(0,Math.min(100,t.used_percentage)),r=n/100,o=sp(r),s=n>=90?"\x1B[38;5;196m":n>=70?Z.visaGold:Z.green,i=`${String(Math.round(n)).padStart(2," ")}%`,a=NJ(t.resets_at),c=a?` ${oe(`(${a} / ${e})`,Z.dim)}`:` ${oe(`(${e})`,Z.dim)}`;return`${o} ${oe(i,s)}${c}`}function CJ(t){if(!t)return null;let e=EC(t.five_hour,"5h"),n=typeof t.seven_day?.used_percentage=="number"?t.seven_day.used_percentage:null,r=n!==null&&n>=90?EC(t.seven_day,"7d"):null;if(!e&&!r)return null;let o=` ${oe("\u2502",Z.dim)} `,s=[e,r].filter(Boolean);return`${oe("Usage",Z.dim)} ${s.join(o)}`}function hC(t){let e;try{let n=co.statSync(t);if(!n.isFile())return null;let r=n.size;if(r===0)return null;let o=Math.min(r,RJ),s=r-o;e=co.openSync(t,"r");let i=Buffer.alloc(o);co.readSync(e,i,0,o,s);let a=i.toString("utf-8");if(s>0){let c=Buffer.alloc(1);if(co.readSync(e,c,0,1,s-1),c[0]!==10){let u=a.indexOf(`
37
+ `);u>=0&&(a=a.slice(u+1))}}return a}catch{return null}finally{if(e!==void 0)try{co.closeSync(e)}catch{}}}function vJ(t){if(!t||typeof t!="object")return;let e=t,n=["file_path","path","notebook_path","pattern","command","url"];for(let r of n){let o=e[r];if(typeof o=="string"&&o.length>0){if(r.endsWith("_path")||r==="path"){let s=uo.basename(uo.dirname(o)),i=uo.basename(o);return s&&s!=="."&&s!=="/"?`${s}/${i}`:i}return o}}}function IJ(t){let e=t.split(`
38
+ `),n=[],r=new Set;for(let o=e.length-1;o>=0&&n.length<_C*3;o-=1){let s=e[o].trim();if(!s)continue;let i;try{i=JSON.parse(s)}catch{continue}if(!i||typeof i!="object")continue;let c=i.message;if(!c||typeof c!="object")continue;let u=c.content;if(Array.isArray(u))for(let l of u){if(!l||typeof l!="object")continue;let d=l;if(d.type==="tool_result"&&typeof d.tool_use_id=="string")r.add(d.tool_use_id);else if(d.type==="tool_use"&&typeof d.name=="string"){let p=typeof d.id=="string"?d.id:"",_=p.length>0?!r.has(p):!1;n.push({name:d.name,target:vJ(d.input),running:_})}}}return n.reverse(),n.slice(Math.max(0,n.length-_C))}function PJ(t){let e=[];for(let n of t){let r=e[e.length-1];r&&!r.running&&!n.running&&r.name===n.name&&r.target===void 0&&n.target===void 0?r.count+=1:e.push({...n,count:1})}return e}function bJ(t){let e=t.running?oe("\u25D0",Z.visaGold):oe("\u2713",Z.green),n=t.running?Z.visaGold:Z.visaBlueSoft,r=oe(Ct(t.name),n),o=t.target?Ct(t.target):"",s=o?`${oe(":",Z.dim)} ${oe(o,Z.dim)}`:"",i=t.count>1?` ${oe(`\xD7${t.count}`,Z.dim)}`:"";return s?`${e} ${r}${s}${i}`:`${e} ${r}${i}`}function MJ(t){let e=` ${oe("\u2502",Z.dim)} `,n=fC(e),r=t.slice();for(;r.length>0;){let c=r.join(e);if(fC(c)<=ZS)return c;r=r.slice(1)}if(t.length===0)return"";let o="\u2026",i=t[t.length-1].replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,""),a=i.length>ZS-n-1?i.slice(0,ZS-n-1)+o:i;return`${oe(o,Z.dim)}${e}${a}`}async function SC(t){if(!t||typeof t!="string")return null;let e=hC(t);if(!e)return null;let n;try{n=IJ(e)}catch{return null}if(n.length===0)return null;let o=PJ(n).map(bJ);return MJ(o)||null}async function AC(t,e,n){return(await yC(t,e,n)).join(`
39
+ `)}function RC(t,e,n){let r=!!e?.activeSession||t.includes("in session"),o=n?xJ(n):!1;return{isActive:r||o,hasSession:r,hasToolActivity:o}}async function yC(t,e,n){let{isActive:r}=RC(t,n,e?.transcript_path);if(e&&!r){let s=[],i=mC(e);if(i&&s.push(...i.split(`
40
+ `)),e.transcript_path){let c=await SC(e.transcript_path);c&&s.push(...c.split(`
41
+ `))}let a=oe(nT(t),Z.dim);return s.push(a),s}let o=[t];if(e){let s=mC(e);if(s&&o.push(...s.split(`
42
+ `)),e.transcript_path){let i=await SC(e.transcript_path);i&&o.push(...i.split(`
43
+ `))}}return o}var LJ=["generate_image","generate_video","generate_music","generate_audio","generate_3d","upscale_image","run_llm","transcribe_audio","pay","get_status","buy_credits","get_cards","add_card","set_session_mode","query_onchain_prices","allium_explorer"];function xJ(t){let e=hC(t);if(!e)return!1;let n=e.slice(-16384).toLowerCase();return LJ.some(r=>n.includes(`"${r}"`))}async function OC(t,e,n){let r=await yC(t,e,n),o=r.join(`
44
+ `),{isActive:s}=RC(t,n,e?.transcript_path);return{schemaVersion:gJ,client:e?vC(e):Qs.UNKNOWN,rendered:o,lines:r.map(nT),visa:{spendLine:nT(t),balanceCents:n?.balanceCents,balanceUsd:n?.amountUsd,sessionMode:n?.sessionMode,activeSession:n?.activeSession,isVisaActive:s},context:e?IC(e):{}}}function Ct(t){return t?t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ").trim():""}function oT(t){if(typeof t=="string")return Ct(uo.basename(t));if(!t||typeof t!="object")return"";let e=typeof t.current_dir=="string"?t.current_dir:typeof t.path=="string"?t.path:"";return Ct(e?uo.basename(e):t.name)}function NC(t){return Ct(t.app_name??t.appName??t.app??t.client)}function tT(t){return Ct(t.model?.display_name??t.model?.id??t.model_name??t.modelName)}function CC(t){return Ct(t.cwd??t.current_dir??t.project_root)}function TC(t){let e=Ct(t.project);if(e)return e;let n=CC(t);if(n)return Ct(uo.basename(n));let r=oT(t.workspace);return r||""}function nr(t){if(!(typeof t!="number"||!Number.isFinite(t)))return t}function vC(t){let e=NC(t).toLowerCase();return e.includes("codex")?Qs.CODEX:e.includes("claude")||t.model?.display_name||t.transcript_path||t.rate_limits?Qs.CLAUDE_CODE:t.run_state||t.runState||t.thread_title||t.threadTitle||t.git_branch||nr(t.context_used)!==void 0?Qs.CODEX:Qs.UNKNOWN}function DJ(t){return vC(t)===Qs.CODEX}function IC(t){let e=NC(t),n=CC(t),r=oT(t.workspace),o=nr(t.context_used)??nr(t.context_window?.used_percentage??void 0),s=nr(t.context_remaining)??nr(t.context_window?.remaining_percentage??void 0);return{...e?{app:e}:{},...tT(t)?{model:tT(t)}:{},...TC(t)?{project:TC(t)}:{},...r?{workspace:r}:{},...n?{cwd:n}:{},...Ct(t.git_branch??t.branch)?{gitBranch:Ct(t.git_branch??t.branch)}:{},...Ct(t.status??t.run_state??t.runState)?{status:Ct(t.status??t.run_state??t.runState)}:{},...Ct(t.thread_title??t.threadTitle)?{threadTitle:Ct(t.thread_title??t.threadTitle)}:{},...o!==void 0?{contextUsedPercent:o}:{},...s!==void 0?{contextRemainingPercent:s}:{},...nr(t.used_tokens)!==void 0?{usedTokens:nr(t.used_tokens)}:{},...nr(t.total_input_tokens)!==void 0?{totalInputTokens:nr(t.total_input_tokens)}:{},...nr(t.total_output_tokens)!==void 0?{totalOutputTokens:nr(t.total_output_tokens)}:{}}}function nT(t){return t.replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"")}async function da(t,e){let n=e?.timeoutMs??3e4,r=new AbortController,o=setTimeout(()=>r.abort(),n);try{let{timeoutMs:s,...i}=e??{};return await fetch(t,{...i,signal:r.signal})}finally{clearTimeout(o)}}var pa=class extends Error{retryable;code;reason;paymentErrorClass;correlationId;transactionId;retryAfter;constructor(e,n,r,o,s,i,a,c){super(e),this.name="CardDeclinedError",this.retryable=n,this.code=r,this.reason=o,this.paymentErrorClass=s,this.correlationId=i,this.transactionId=a,this.retryAfter=c}};var PC={ENOTFOUND:"Cannot resolve the Visa CLI server hostname (DNS error). Check your internet connection or the auth.serverUrl setting.",EAI_AGAIN:"DNS lookup for the Visa CLI server failed temporarily. Check your internet connection and try again.",ECONNREFUSED:"The Visa CLI server refused the connection. The service may be down \u2014 check https://visacli.sh for status.",ECONNRESET:"The connection to the Visa CLI server was reset mid-request. Try again in a moment.",EHOSTUNREACH:"The Visa CLI server is unreachable from this network. Check your internet connection.",ETIMEDOUT:"The connection to the Visa CLI server timed out. Try again or check https://visacli.sh for status.",CERT_HAS_EXPIRED:"The Visa CLI server's TLS certificate is expired. Check https://visacli.sh for status; do not bypass the cert.",UND_ERR_CONNECT_TIMEOUT:"The connection to the Visa CLI server timed out before it could be established. Try again in a moment.",UND_ERR_SOCKET:"The connection to the Visa CLI server was interrupted. Try again in a moment."};function sT(t){let e=t&&typeof t=="object"?t:{};if(e.name==="AbortError"||typeof e.message=="string"&&e.message.includes("aborted"))return"The request timed out. The server may be under heavy load. Please try again.";let n=(e.cause&&typeof e.cause=="object"?e.cause.code:void 0)??(typeof e.code=="string"?e.code:void 0);return n&&PC[n]?PC[n]:`Network error contacting the Visa CLI server (${n?`${n}: ${typeof e.message=="string"?e.message:"unknown"}`:typeof e.message=="string"&&e.message.length>0?e.message:"unknown error"}). Check https://visacli.sh for status.`}var UJ=/^(\d+)\.(\d+)\.(\d+)(?:-([0-9A-Za-z.-]+))?(?:\+[0-9A-Za-z.-]+)?$/;function MC(t,e){let n=bC(t),r=bC(e);if(!n||!r)return!1;for(let o=0;o<3;o++)if(n.main[o]!==r.main[o])return n.main[o]>r.main[o];return n.pre&&!r.pre?!1:!n.pre&&r.pre?!0:!n.pre&&!r.pre?!1:wJ(n.pre,r.pre)>0}function bC(t){if(typeof t!="string")return null;let n=t.trim().replace(/^v/,"").match(UJ);return n?{main:[Number(n[1]),Number(n[2]),Number(n[3])],pre:n[4]??null}:null}function wJ(t,e){let n=t.split("."),r=e.split("."),o=Math.max(n.length,r.length);for(let s=0;s<o;s++){if(s>=n.length)return-1;if(s>=r.length)return 1;let i=n[s],a=r[s],c=/^\d+$/.test(i),u=/^\d+$/.test(a);if(c&&u){let l=Number(i)-Number(a);if(l!==0)return l}else{if(c)return-1;if(u)return 1;if(i<a)return-1;if(i>a)return 1}}return 0}function Cr(){return!!(LC(process.env.VISA_CLI_NO_UPDATE_CHECK)||LC(process.env.CI)||process.env.NODE_ENV==="test")}function LC(t){if(t===void 0)return!1;let e=t.trim().toLowerCase();return!(e===""||e==="0"||e==="false"||e==="no"||e==="off")}var Yo=v(require("fs")),UC=v(require("path"));var ip=v(require("fs")),xC=v(require("path")),DC=v(require("os"));var iT=xC.join(DC.homedir(),".visa-mcp"),Nu=class{static ensureConfigDir(){ip.existsSync(iT)||ip.mkdirSync(iT,{recursive:!0,mode:448})}static getConfigDir(){return iT}static TOOL_STATES={login:!0,get_status:!0,get_cards:!0,add_card:!0,pay:!1,transaction_history:!0,update_spending_controls:!0,enroll_device:!1,verify_otp:!1,reset:!0,batch:!0,generate_x402_image:!1,browser_launch:!1,browser_navigate:!1,browser_snapshot:!1,browser_click:!1,browser_type:!1,browser_scroll:!1,generate_music_card:!1,generate_image_card:!1,query_onchain_prices_card:!1,generate_music_tempo_card:!1,check_music_status_tempo_card:!1,generate_image_fast_card:!1,generate_video_tempo_card:!1};static loadToolStates(){return{...this.TOOL_STATES}}static getDisabledTools(){let e=new Set;for(let[n,r]of Object.entries(this.TOOL_STATES))r||e.add(n);return e}static isToolDisabled(e){return this.TOOL_STATES[e]===!1}};var kJ="settings.json";function Cu(){return UC.join(Nu.getConfigDir(),kJ)}var fa={"auth.serverUrl":{type:"string",description:"Auth server base URL. Override for staging / self-hosted backends.",requiresRestart:!0,validate:t=>{if(typeof t!="string")throw new Error("auth.serverUrl must be a string");let e;try{e=new URL(t)}catch{throw new Error(`auth.serverUrl must be a valid URL (got: ${JSON.stringify(t)})`)}if(e.protocol!=="https:"&&e.protocol!=="http:")throw new Error(`auth.serverUrl must use http or https (got: ${e.protocol})`)}},"ui.suppressBrowser":{type:"boolean",description:"When true, the CLI/MCP server stops auto-opening result URLs in your browser."},"ui.suppressFeed":{type:"boolean",description:"When true, generated images/music are not auto-submitted to the public Made-with-Visa feed."},"tools.meta":{type:"boolean",description:"Show category meta-tools (generate_image, generate_music, ...). Restart required.",requiresRestart:!0},"tools.discover":{type:"boolean",description:"Show the dynamic-catalog tools (discover_tools, execute_tool). Restart required.",requiresRestart:!0},"merchants.discover":{type:"string",description:'Platform-merchant JIT tool discovery: "all" = every live merchant, "off" = none, comma-separated slugs = exactly those. Equivalent to VISA_MERCHANT_DISCOVER / VISA_MERCHANT_SLUGS env. Restart required.',requiresRestart:!0,validate:t=>{if(typeof t!="string")throw new Error("merchants.discover must be a string");let e=t.trim().toLowerCase();if(e===""||e==="all"||e==="off"||e==="*")return;let n=/^[a-z0-9](?:[a-z0-9-]{0,62}[a-z0-9])?$/,r=t.split(",").map(o=>o.trim()).filter(Boolean);for(let o of r)if(!n.test(o))throw new Error(`merchants.discover: "${o}" is not a valid merchant slug`)}},"credit.sessionCapCents":{type:"number",description:"Default cap (in cents) for start_session and pay-as-you-go one-shot approvals. Server clamps to [100, 10000] = $1\u2013$100. Default 500 ($5).",validate:t=>{if(typeof t!="number"||!Number.isFinite(t))throw new Error("credit.sessionCapCents must be a number");if(!Number.isInteger(t))throw new Error("credit.sessionCapCents must be a whole number of cents (no fractional cents)");if(t<100||t>1e4)throw new Error("credit.sessionCapCents must be between 100 ($1) and 10000 ($100)")}}},wC=500,ap={"tools.specific":"Legacy direct _card MCP tools are retired. Use category meta-tools or discover_tools/execute_tool.","credit.sessionMode":"The session-mode toggle is retired. Use start_session, close_session, and get_session_status."};function ei(){let t=Cu();if(!Yo.existsSync(t))return{};try{let e=Yo.readFileSync(t,"utf-8"),n=JSON.parse(e);return!n||typeof n!="object"||Array.isArray(n)?{}:n}catch{return{}}}function aT(t){Nu.ensureConfigDir();let e=Cu(),n=`${e}.tmp`,r=JSON.stringify(t,null,2)+`
45
+ `;Yo.writeFileSync(n,r,{mode:384}),Yo.renameSync(n,e)}function cT(t){let e=ei()[t];return typeof e=="string"?e:void 0}function kC(t){let e=ei()[t];if(typeof e=="boolean")return e;if(e==="true")return!0;if(e==="false")return!1}function VC(t){let e=ei()[t];if(typeof e=="number"&&Number.isFinite(e))return e;if(typeof e=="string"&&e.trim().length>0){let n=Number(e);if(Number.isFinite(n))return n}}var ti=class extends Error{constructor(e){let n=Object.keys(fa).sort().join(", ");super(`Unknown setting "${e}". Settable keys: ${n}. For server-controlled values (biometric.*, spending.*) use the dedicated tools (biometric_on/off, update_spending_controls).`),this.name="UnknownSettingKeyError"}},ni=class extends Error{constructor(e){let n="";e.startsWith("biometric.")?n="biometric_on / biometric_off":e.startsWith("spending.")?n="update_spending_controls":e.startsWith("cards.")?n="add_card / remove_card / set_default_card":e.startsWith("account.")&&(n="login / reset"),super(`"${e}" is a server-controlled value and cannot be set via config set. `+(n?`Use ${n} instead.`:"No client-side override is supported.")),this.name="ServerOnlySettingError"}},_a=class extends Error{constructor(e){super(`"${e}" is retired and ignored. Remove it with \`visa-cli config unset ${e}\`. `+ap[e]),this.name="RetiredSettingKeyError"}},BC=["biometric.","spending.","account.","cards.","biometric"];function uT(t,e){if(BC.some(s=>t.startsWith(s)))throw new ni(t);if(t in ap)throw new _a(t);let n=fa[t];if(!n)throw new ti(t);let r;if(n.type==="boolean")if(typeof e=="boolean")r=e;else if(typeof e=="string"){let s=e.toLowerCase();if(s==="true")r=!0;else if(s==="false")r=!1;else throw new Error(`${t} expects true or false (got: ${JSON.stringify(e)})`)}else throw new Error(`${t} expects a boolean (got: ${typeof e})`);else if(n.type==="number")if(typeof e=="number")r=e;else if(typeof e=="string"&&e.trim().length>0){let s=Number(e);if(!Number.isFinite(s))throw new Error(`${t} expects a number (got: ${JSON.stringify(e)})`);r=s}else throw new Error(`${t} expects a number (got: ${typeof e})`);else{if(typeof e!="string"||e.length===0)throw new Error(`${t} expects a non-empty string`);r=e}n.validate&&n.validate(r);let o=ei();return o[t]=r,aT(o),{key:t,value:r,requiresRestart:!!n.requiresRestart,path:Cu()}}function lT(t){if(BC.some(s=>t.startsWith(s)))throw new ni(t);let e=fa[t];if(t in ap){let s=ei(),i=t in s;return i&&(delete s[t],aT(s)),{key:t,removed:i,requiresRestart:!1,path:Cu()}}if(!e)throw new ti(t);let r=ei(),o=t in r;return o&&(delete r[t],aT(r)),{key:t,removed:o,requiresRestart:o&&!!e.requiresRestart,path:Cu()}}function GC(){let t=ei();return Object.entries(ap).filter(([e])=>e in t).map(([e,n])=>({key:e,value:t[e],hint:n}))}var VJ="https://auth.visacli.sh",BJ="https://auth-visa-code-preview.up.railway.app";function GJ(t){return typeof t=="string"&&/-(?:rc|alpha|beta)\./i.test(t)}function HJ(){try{let t=Zd();return GJ(t.version)}catch{return!1}}function FJ(t){return t.envVar!==void 0&&t.envVar!==""?t.envVar:t.settingValue!==void 0?t.settingValue:t.isPrerelease?BJ:VJ}function vr(){return FJ({envVar:process.env.VISA_AUTH_URL,settingValue:cT("auth.serverUrl"),isPrerelease:HJ()})}var vu="2.0.0-rc.39",$J=/^vk_[A-Za-z0-9_-]{32,}$/;function HC(t=process.env,e=process.stdin.isTTY){let n=["Not logged in. No local Visa CLI session credentials were found."],r=t.VISA_CLI_API_KEY?.trim();return r?$J.test(r)?(n.push("VISA_CLI_API_KEY is set, but MCP bearer tools currently require a local session from visa-cli setup."),n.push("For headless API-key use, call the /v1/api/* HTTP routes with X-Api-Key instead of MCP bearer tools.")):(n.push("VISA_CLI_API_KEY is set but has invalid format (expected vk_<32+ base64url chars>)."),n.push("Create a new key with: visa-cli api-key create <app-name>")):n.push("Run `visa-cli setup` in an interactive terminal to authenticate."),e===!1&&n.push("This process appears to be running without a TTY; complete setup in a normal terminal, then restart the MCP client."),n.join(`
46
+ `)}var rr=class{constructor(e){this.getSessionToken=e;this.baseUrl=vr()}getSessionToken;baseUrl;lastSignals={};parseServerSignals(e){if(this.lastSignals={},!Cr()){let r=e.headers.get("X-Latest-Version");r&&MC(r,vu)&&(this.lastSignals.updateAvailable={currentVersion:vu,latestVersion:r})}let n=e.headers.get("X-Feedback-Prompt");if(n)try{this.lastSignals.feedbackPrompt=JSON.parse(n)}catch{}}getClientVersion(){return vu}async request(e,n,r,o,s,i){let a=await this.getSessionToken();if(!a)throw new Error(HC());let c={Authorization:`Bearer ${a}`};s&&(e==="GET"?c["X-User-Context"]=encodeURIComponent(s.replace(/[\r\n\0]/g," ").slice(0,1e3)):r={...r||{},user_context:s}),i&&(c["X-Visa-Meta-Tool"]=i),r&&(c["Content-Type"]="application/json");let u;try{u=await da(`${this.baseUrl}${n}`,{method:e,headers:{...c,"X-Visa-CLI-Version":vu,"X-Source":"cli"},body:r?JSON.stringify(r):void 0,timeoutMs:o})}catch(d){throw new Error(sT(d))}if(this.parseServerSignals(u),u.status===401)throw new Error("Your session has expired. Run: visa-cli setup");if(u.status===429){let d=u.headers.get("Retry-After")||"3";throw new Error(`Rate limited \u2014 wait ${d}s. Tip: use the batch tool to combine multiple requests into one.`)}if(u.status===503)throw new Error("Visa CLI is temporarily unavailable. Check https://visacli.sh for status.");let l;try{l=await u.json()}catch{throw u.status===500?new Error(`Server error on ${n}. Try again or check https://visacli.sh for status.`):new Error(`Unexpected response from ${n}. Try again.`)}if(!u.ok){if(u.status===500)throw new Error(`Server error on ${n}. Try again or check https://visacli.sh for status.`);if(l?.declined){let d=Number(l.retryAfter??u.headers.get("Retry-After"));throw new pa(l.error||"Your card was declined.",!!l.retryable,l.code,l.reason,l.payment_error_class,l.correlation_id,l.transactionId,Number.isFinite(d)&&d>0?d:void 0)}if(u.status===402){let d=l?.error||"Gateway returned 402";throw new Error(`${d}. This usually means your daily or per-transaction spending limit has been reached. Check your limits with get_status or run: visa-cli update-spending-controls`)}throw new Error(l?.error||`Request failed (${u.status}). Try again.`)}return l}async pay(e,n){return this.request("POST","/v1/pay",e,void 0,n)}async shortcut(e,n,r,o,s){return this.request("POST",`/v1/shortcuts/${encodeURIComponent(e)}`,n,r,o,s)}async shortcutWithSession(e,n,r,o,s,i){let a=`/v1/shortcuts/${encodeURIComponent(e)}`,c=await this.getSessionToken();if(!c)throw new Error(HC());let u={Authorization:`Bearer ${c}`,"X-Visa-CLI-Version":vu,"X-Source":"cli","Content-Type":"application/json"};i&&(u["X-Visa-Meta-Tool"]=i);let l={...n,...r};s&&(l.user_context=s.replace(/[\r\n\0]/g," ").slice(0,1e3));let d;try{d=await da(`${this.baseUrl}${a}`,{method:"POST",headers:u,body:JSON.stringify(l),timeoutMs:o})}catch(f){throw new Error(sT(f))}if(this.parseServerSignals(d),d.status===401)throw new Error("Your session has expired. Run: visa-cli setup");if(d.status===429){let f=d.headers.get("Retry-After")||"3";throw new Error(`Rate limited \u2014 wait ${f}s. Tip: use the batch tool to combine multiple requests into one.`)}if(d.status===503)throw new Error("Visa CLI is temporarily unavailable. Check https://visacli.sh for status.");let p=d.headers.get("X-Voucher-Receipt"),_;try{_=await d.json()}catch{throw d.status===500?new Error(`Server error on ${a}. Try again or check https://visacli.sh for status.`):new Error(`Unexpected response from ${a}. Try again.`)}if(!d.ok){if(d.status===500)throw new Error(`Server error on ${a}. Try again or check https://visacli.sh for status.`);if(_?.declined){let f=Number(_.retryAfter??d.headers.get("Retry-After"));throw new pa(_.error||"Your card was declined.",!!_.retryable,_.code,_.reason,_.payment_error_class,_.correlation_id,_.transactionId,Number.isFinite(f)&&f>0?f:void 0)}throw new Error(_?.error||`Request failed (${d.status}). Try again.`)}return{data:_,voucherReceiptHeader:p}}async batch(e,n,r){return this.request("POST","/v1/batch",e,n,r)}async emitTelemetry(e){return this.request("POST","/v1/telemetry",{rows:e})}async catalogSearch(e,n,r){let o=r??"discover_tools",s=new URLSearchParams;e&&s.set("q",e),n&&s.set("category",n);let i=s.toString();return this.request("GET",`/v1/catalog${i?`?${i}`:""}`,void 0,void 0,void 0,o)}async catalogTool(e,n){let r=n??"discover_tools";try{return await this.request("GET",`/v1/catalog/${encodeURIComponent(e)}`,void 0,void 0,void 0,r)}catch{return null}}async discoverMerchantRoutes(e){try{return await this.request("GET",`/v1/platform/discover/${encodeURIComponent(e)}`)}catch{return null}}async listPublicMerchants(){try{let e=await da(`${this.baseUrl}/v1/platform/merchants/public`,{method:"GET",timeoutMs:8e3});if(!e.ok)return[];let n=await e.json();return Array.isArray(n.merchants)?n.merchants:[]}catch{return[]}}async getPublicMerchantDiscover(e){try{let n=await da(`${this.baseUrl}/v1/platform/discover/${encodeURIComponent(e)}`,{method:"GET",timeoutMs:8e3});return n.ok?await n.json():null}catch{return null}}async paymentPreview(e,n){return this.request("POST","/v1/payment-preview",e,void 0,n)}async getBalance(){return this.request("GET","/v1/balance")}async topupBalance(e){return this.request("POST","/v1/balance/topup",e)}async createSessionBudget(e){return this.request("POST","/v1/session-budget/create",{...e,mode:"prepaid"})}async closeSession(e){return this.request("POST","/v1/session/close",{session_budget_id:e})}async getSessionBudget(e){return this.request("GET",`/v1/session-budget/${encodeURIComponent(e)}`)}async getSessionLedger(e){return this.request("GET",`/v1/session/${encodeURIComponent(e)}/ledger`)}async getStatus(e){return this.request("GET","/v1/status",void 0,void 0,e)}async getFeatureFlags(){return this.request("GET","/v1/feature-flags")}async getVisaSmi(e,n){return this.request("POST","/v1/visa/smi",e,6e4,n)}async getTransactions(e,n){let r=new URLSearchParams;e?.limit!=null&&r.set("limit",String(e.limit)),e?.offset!=null&&r.set("offset",String(e.offset));let o=r.toString(),s=o?`/v1/transactions?${o}`:"/v1/transactions";return this.request("GET",s,void 0,void 0,n)}async updateSpendingControls(e,n){return this.request("POST","/v1/spending-controls",e,void 0,n)}async removeCard(e,n,r){return this.request("DELETE",`/v1/cards/${encodeURIComponent(String(e))}`,n,void 0,r)}async setDefaultCard(e,n,r){return this.request("POST",`/v1/cards/${encodeURIComponent(String(e))}/default`,n,void 0,r)}async getAttestationChallenge(){return this.request("GET","/v1/attestation-challenge")}async registerAttestationKey(e){return this.request("POST","/v1/attestation-key",{publicKey:e})}async setBiometricPreference(e,n){return this.request("POST","/v1/biometric-preference",{...e,confirm:!0},void 0,n)}async logout(e,n){return this.request("POST","/v1/logout",e,void 0,n)}async feedback(e,n,r){return this.request("POST","/v1/feedback",{message:e,...n&&{transaction_id:n}},void 0,r)}async createAppApiKey(e){return this.request("POST","/v1/api/keys",e)}async listAppApiKeys(){return this.request("GET","/v1/api/keys")}async revokeAppApiKey(e){return this.request("DELETE",`/v1/api/keys/${encodeURIComponent(String(e))}`)}async feedSubmit(e){return this.request("POST","/v1/feed",e)}async feedList(e){let n=new URLSearchParams;e?.tab&&n.set("tab",e.tab),e?.limit&&n.set("limit",String(e.limit)),e?.offset&&n.set("offset",String(e.offset));let r=n.toString();return this.request("GET",`/v1/feed${r?"?"+r:""}`)}async feedVote(e,n){return this.request("POST",`/v1/feed/${encodeURIComponent(e)}/vote`,{direction:n})}async feedApprove(e){return this.request("POST",`/v1/feed/${encodeURIComponent(e)}/approve`)}async feedDelete(e){return this.request("DELETE",`/v1/feed/${encodeURIComponent(e)}`)}async feedPending(){return this.request("GET","/v1/feed/pending")}async submitFeedback(e,n,r){return this.request("POST","/v1/feedback",{message:e,...n&&{transaction_id:n}},void 0,r)}async getFeedback(e,n){let r=new URLSearchParams;e&&r.set("limit",String(e));let o=r.toString();return this.request("GET",`/v1/feedback${o?"?"+o:""}`,void 0,void 0,n)}async submitRatedFeedback(e){return this.request("POST","/v1/feedback",e)}};var un=v(require("fs")),_T=v(require("path")),FC=v(require("os")),pT=_T.join(FC.homedir(),".visa-mcp"),Iu=_T.join(pT,"mcp-server.log"),jJ=5*1024*1024,dT=null;function qJ(){un.existsSync(pT)||un.mkdirSync(pT,{recursive:!0,mode:448})}function YJ(){if(!dT){if(qJ(),un.existsSync(Iu)&&un.statSync(Iu).size>jJ){let e=Iu+".1";un.existsSync(e)&&un.unlinkSync(e),un.renameSync(Iu,e)}dT=un.createWriteStream(Iu,{flags:"a"})}return dT}function KJ(t){return t==="WARN"||t==="ERROR"?!0:process.env.VISA_CLI_DEBUG==="1"||process.env.VISA_VERBOSE==="1"}function cp(t,...e){let n=new Date().toISOString(),r=e.map(s=>typeof s=="string"?s:JSON.stringify(s,null,2)).join(" "),o=`[${n}] [${t}] ${r}
47
+ `;KJ(t)&&process.stderr.write(o),YJ().write(o)}var An={debug:(...t)=>cp("DEBUG",...t),info:(...t)=>cp("INFO",...t),warn:(...t)=>cp("WARN",...t),error:(...t)=>cp("ERROR",...t)};var mT=require("child_process"),KC=require("util"),WC=v(require("crypto")),xt=v(require("fs")),zC=v(require("os")),Ir=v(require("path"));var ma=(0,KC.promisify)(mT.execFile),dp=Ir.join(zC.homedir(),".visa-mcp","bin"),ri=Ir.join(dp,"Visa CLI"),WJ=Ir.join(__dirname,"..","native"),$C="5",jC=Ir.join(dp,"visa-keychain.version"),qC=Ir.join(dp,"visa-keychain.sha256");function YC(t){let e=xt.readFileSync(t);return WC.createHash("sha256").update(e).digest("hex")}async function XC(){try{if(xt.readFileSync(jC,"utf-8").trim()===$C&&xt.existsSync(ri)){let r=xt.readFileSync(qC,"utf-8").trim();if(YC(ri)!==r)An.warn("binary:hash-mismatch",{message:"Binary hash mismatch \u2014 possible tampering detected. Recompiling from source."}),xt.unlinkSync(ri);else return ri}}catch{}let t=Ir.join(WJ,"visa-keychain.m");if(xt.existsSync(t)||(t=Ir.resolve(__dirname,"..","..","native","visa-keychain.m")),xt.existsSync(t)||(t=Ir.resolve(__dirname,"..","native","visa-keychain.m")),!xt.existsSync(t))throw new Error("visa-keychain.m source not found. Reinstall Visa CLI.");xt.mkdirSync(dp,{recursive:!0,mode:448});try{await ma("clang",["-framework","Security","-framework","LocalAuthentication","-framework","Foundation","-framework","AppKit","-o",ri,t],{timeout:3e4})}catch(n){throw n.code==="ENOENT"?new Error("Xcode Command Line Tools required. Install: xcode-select --install"):n}let e=YC(ri);return xt.writeFileSync(qC,e,{mode:384}),xt.writeFileSync(jC,$C,{mode:384}),ri}async function JC(t){let e=await XC(),n;try{n=(await ma(e,t,{timeout:6e4})).stdout}catch(s){n=s.stdout||"";let i=n.trim();throw i.startsWith("ERROR:")?new Error(i.slice(6)):new Error(s.stderr?.trim()||s.message||"Unknown error")}let r=n.trim();if(r.startsWith("OK:"))return r.slice(3);if(r==="OK")return;let o=r.startsWith("ERROR:")?r.slice(6):"Unknown error";throw new Error(o)}var fT=null;function zt(){return process.env.VISA_MOCK_TOUCHID==="true"?!0:process.platform!=="darwin"?!1:fT!==null?fT:(fT=!0,!0)}var up="visa-cli",lp="attestation-key";async function zJ(t){try{await ma("security",["delete-generic-password","-s",up,"-a",lp],{timeout:5e3})}catch{}await ma("security",["add-generic-password","-s",up,"-a",lp,"-w",t],{timeout:5e3})}async function XJ(){try{let{stdout:t}=await ma("security",["find-generic-password","-s",up,"-a",lp,"-w"],{timeout:5e3});return t.trim()||null}catch{return null}}async function pp(){let t=await JC(["generate-key"]);if(!t)throw new Error("Key generation returned no output");let e=t.indexOf(":");if(e<0)throw new Error("Unexpected generate-key output format");let n=t.slice(0,e),r=t.slice(e+1);return await zJ(n),r}async function _p(t,e){if(process.env.VISA_MOCK_TOUCHID==="true")return Promise.resolve("mock-ecdsa-signature-for-testing");let n=await XJ();if(!n)throw new Error("Attestation key not found. Run setup to generate a new key.");let r=await XC(),o=["sign",t];return e&&o.push(e),new Promise((s,i)=>{let a=(0,mT.execFile)(r,o,{timeout:6e4},(c,u)=>{let l=(u||"").trim();if(c){l.startsWith("ERROR:")?i(new Error(l.slice(6))):i(new Error(c.stderr?.trim()||c.message||"Unknown error"));return}l.startsWith("OK:")?s(l.slice(3)):i(new Error(l.startsWith("ERROR:")?l.slice(6):"Unknown error"))});a.stdin.write(n),a.stdin.end()})}async function ET(){try{await ma("security",["delete-generic-password","-s",up,"-a",lp],{timeout:5e3})}catch{}try{await JC(["delete-key"])}catch{}}var JJ=["npm","pnpm","yarn","bun"],ZJ=/\s+/;function QJ(){let t=process.env.npm_config_user_agent;if(!t)return;let e=t.trim();if(e==="")return;let n=e.split(ZJ)[0]??"",r=n.indexOf("/"),o=r===-1?n:n.slice(0,r);return JJ.includes(o)?o:void 0}function Ea(t,e){let n=e??QJ()??"npm",o=`@visa/cli@${t??"latest"}`;switch(n){case"npm":return`npm install -g ${o}`;case"pnpm":return`pnpm add -g ${o}`;case"yarn":return`yarn global add ${o}`;case"bun":return`bun add -g ${o}`}}function ZC(t,e=process.stderr){if(Cr()||!t?.updateAvailable)return!1;let{latestVersion:n}=t.updateAvailable;if(!n)return!1;let r=`Update available: v${n}. Run: ${Ea()}`;return e.write(`
48
48
  \x1B[33m\u2191 ${r}\x1B[0m
49
- `),!0}var zJ=20;function JC(t,e,n,r){let o=r.currentVersion==="0.0.0"&&t.version?t.version:r.currentVersion,i=nZ(t.spendingControls).dailyLimit,a=Math.max(0,bu(t.dailySpent)),c=i>0?Math.min(i,Math.max(0,bu(t.dailyRemaining??i-a))):0,u=i>0?Math.min(1,a/i):0,d=(Array.isArray(e)?e:[]).filter(ZJ),p=d.slice(0,3),_=QJ(d,3),f=(t.cards??[]).slice(0,3),E=r.latestVersion?Pu(r.latestVersion):"",S=r.updateCheckDisabled?"update checks disabled":E?`update ready: v${E}`:"up to date",g=Math.round(u*100),h=Ko(t.status,t.enrolled?"approved":"not enrolled"),N=["VISA CLI",`Status: ${t.enrolled?"Visa ready":"Visa setup needed"} | account: ${h} | touch id: ${n?"ready":"unavailable"}`,`Version: v${o} | ${S}`,`Spend meter: ${XC(u)} ${String(g).padStart(3," ")}% | remaining ${Sa(c)}/day | daily cap ${Sa(i)}`,"","Spend",` Remaining ${Sa(c)} / ${Sa(i)}`,` Usage ${XC(u)} ${g}%`,` Spent today ${Sa(a)}`,` Attestation key ${t.hasAttestationKey?"registered":"missing"}`,"","Cards",...f.length>0?f.map(R=>` ${tZ(R)}`):[" No cards enrolled"],"","Last 3 services",..._.length>0?_.map((R,M)=>` ${M+1}. ${R}`):[" No paid services yet"],"","Recent receipts",...p.length>0?p.map(R=>` ${eZ(R)}`):[" No receipts yet"]];if(E&&!r.updateCheckDisabled){let R=Pu(Ea(E));N.push("",`Update: v${E} ready \u2014 run \`${R}\``),r.updateMessage&&N.push(` ${Pu(r.updateMessage)}`)}else r.updateMessage&&N.push("",`Update: ${Pu(r.updateMessage)}`);return`${N.join(`
49
+ `),!0}var eZ=20;function ev(t,e,n,r){let o=r.currentVersion==="0.0.0"&&t.version?t.version:r.currentVersion,i=aZ(t.spendingControls).dailyLimit,a=Math.max(0,bu(t.dailySpent)),c=i>0?Math.min(i,Math.max(0,bu(t.dailyRemaining??i-a))):0,u=i>0?Math.min(1,a/i):0,d=(Array.isArray(e)?e:[]).filter(rZ),p=d.slice(0,3),_=oZ(d,3),f=(t.cards??[]).slice(0,3),E=r.latestVersion?Pu(r.latestVersion):"",S=r.updateCheckDisabled?"update checks disabled":E?`update ready: v${E}`:"up to date",g=Math.round(u*100),h=Ko(t.status,t.enrolled?"approved":"not enrolled"),N=["VISA CLI",`Status: ${t.enrolled?"Visa ready":"Visa setup needed"} | account: ${h} | touch id: ${n?"ready":"unavailable"}`,`Version: v${o} | ${S}`,`Spend meter: ${QC(u)} ${String(g).padStart(3," ")}% | remaining ${Sa(c)}/day | daily cap ${Sa(i)}`,"","Spend",` Remaining ${Sa(c)} / ${Sa(i)}`,` Usage ${QC(u)} ${g}%`,` Spent today ${Sa(a)}`,` Attestation key ${t.hasAttestationKey?"registered":"missing"}`,"","Cards",...f.length>0?f.map(A=>` ${iZ(A)}`):[" No cards enrolled"],"","Last 3 services",..._.length>0?_.map((A,M)=>` ${M+1}. ${A}`):[" No paid services yet"],"","Recent receipts",...p.length>0?p.map(A=>` ${sZ(A)}`):[" No receipts yet"]];if(E&&!r.updateCheckDisabled){let A=Pu(Ea(E));N.push("",`Update: v${E} ready \u2014 run \`${A}\``),r.updateMessage&&N.push(` ${Pu(r.updateMessage)}`)}else r.updateMessage&&N.push("",`Update: ${Pu(r.updateMessage)}`);return`${N.join(`
50
50
  `)}
51
- `}function XJ(t){return t.tool_name!=null}function JJ(t){return bu(t.amount)===0&&t.status==="failed"}function ZJ(t){return XJ(t)&&!JJ(t)}function QJ(t,e=1/0){let n=new Set,r=[];for(let o of t){if(r.length>=e)break;let s=Ko(o.merchant_name,"Unknown merchant"),i=Ko(o.tool_name,"unknown_tool"),a=`${s} :: ${i}`;n.has(a)||(n.add(a),r.push(`${s} [${i}]`))}return r}function eZ(t){let e=Ko(t.merchant_name,"Unknown merchant"),n=Ko(t.tool_name,"unknown_tool"),r=Sa(bu(t.amount)),o=Ko(t.status,"unknown"),s=rZ(t.created_at);return`${r} ${o.padEnd(9)} ${e} [${n}] ${s}`}function tZ(t){let e=Ko(t.brand?.toUpperCase(),"CARD"),n=t.isDefault?" default":"";return`${Number.isInteger(t.id)?`#${t.id} `:""}${e} ****${t.last4}${n}`}function nZ(t){return{dailyLimit:bu(t?.daily_limit??t?.dailyLimit??0)}}function bu(t){let e=Number(typeof t=="string"?t:t??0);return Number.isFinite(e)?e:0}function Sa(t){return`$${t.toFixed(2)}`}function XC(t,e=zJ){let n=Math.max(0,Math.min(1,t)),r=Math.round(n*e);return`[${"\u2588".repeat(r)}${"\u2591".repeat(e-r)}]`}function Ko(t,e){let n=Pu(t??"").trim();return n.length>0?n:e}function rZ(t){if(!t)return"unknown time";let e=new Date(t);return Number.isNaN(e.getTime())?Ko(t,"unknown time"):e.toISOString().slice(0,16).replace("T"," ")}function Pu(t){return t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ")}var FS=v(ET());var Ae=v(require("fs")),Ep=v(require("os")),Le=v(require("path")),ev=require("child_process");var AZ=2,Mu="# >>> visa-cli shell hud v2 >>>",fp="# <<< visa-cli shell hud v2 <<<",tv="# >>> visa-cli shell hud >>>",RZ="# <<< visa-cli shell hud <<<",nv=3e4,yZ="VISA | HUD not ready \u2014 run: visa-cli hud doctor",OZ={currentVersion:"0.0.0"},NZ=3e4;function gT(){try{return Le.join(NT(),".visa-cli")}catch{return Le.join(Ep.tmpdir(),".visa-cli")}}function ga(){return Le.join(gT(),"shell-hud.json")}function Sp(){return Le.join(gT(),"shell-hud.line")}function rv(){return Le.join(gT(),"shell-hud.lock")}function Aa(t){let e=t??process.env.SHELL;if(!e)return null;let n=Le.basename(e.replace(/\\/g,"/")).toLowerCase();return n==="zsh"?"zsh":n==="bash"?"bash":n==="pwsh"||n==="pwsh.exe"||n==="powershell"||n==="powershell.exe"?"powershell":null}function xu(t){let e=NT();if(t==="zsh")return Le.join(e,".zshrc");if(t==="bash")return Le.join(e,".bashrc");let n=(process.platform==="win32","PowerShell");return Le.join(e,"Documents",n,"Microsoft.PowerShell_profile.ps1")}function CZ(t){let e=NT(),n=[{shell:"zsh",rcPath:Le.join(e,".zshrc")},{shell:"bash",rcPath:Le.join(e,".bashrc")},{shell:"bash",rcPath:Le.join(e,".bash_profile")},{shell:"powershell",rcPath:Le.join(e,"Documents","PowerShell","Microsoft.PowerShell_profile.ps1")}];if(!t)return n;let r=n.filter(s=>s.shell===t),o=n.filter(s=>s.shell!==t);return[...r,...o]}function vZ(t){let e="$HOME/.visa-cli/shell-hud.line",n=kZ(t),r=VZ(t);if(t==="zsh")return`${Mu}
51
+ `}function tZ(t){return t.tool_name!=null}function nZ(t){return bu(t.amount)===0&&t.status==="failed"}function rZ(t){return tZ(t)&&!nZ(t)}function oZ(t,e=1/0){let n=new Set,r=[];for(let o of t){if(r.length>=e)break;let s=Ko(o.merchant_name,"Unknown merchant"),i=Ko(o.tool_name,"unknown_tool"),a=`${s} :: ${i}`;n.has(a)||(n.add(a),r.push(`${s} [${i}]`))}return r}function sZ(t){let e=Ko(t.merchant_name,"Unknown merchant"),n=Ko(t.tool_name,"unknown_tool"),r=Sa(bu(t.amount)),o=Ko(t.status,"unknown"),s=cZ(t.created_at);return`${r} ${o.padEnd(9)} ${e} [${n}] ${s}`}function iZ(t){let e=Ko(t.brand?.toUpperCase(),"CARD"),n=t.isDefault?" default":"";return`${e} ****${t.last4}${n}`}function aZ(t){return{dailyLimit:bu(t?.daily_limit??t?.dailyLimit??0)}}function bu(t){let e=Number(typeof t=="string"?t:t??0);return Number.isFinite(e)?e:0}function Sa(t){return`$${t.toFixed(2)}`}function QC(t,e=eZ){let n=Math.max(0,Math.min(1,t)),r=Math.round(n*e);return`[${"\u2588".repeat(r)}${"\u2591".repeat(e-r)}]`}function Ko(t,e){let n=Pu(t??"").trim();return n.length>0?n:e}function cZ(t){if(!t)return"unknown time";let e=new Date(t);return Number.isNaN(e.getTime())?Ko(t,"unknown time"):e.toISOString().slice(0,16).replace("T"," ")}function Pu(t){return t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ")}var $S=v(ST());var Ae=v(require("fs")),Sp=v(require("os")),Le=v(require("path")),rv=require("child_process");var CZ=2,Mu="# >>> visa-cli shell hud v2 >>>",mp="# <<< visa-cli shell hud v2 <<<",ov="# >>> visa-cli shell hud >>>",vZ="# <<< visa-cli shell hud <<<",sv=3e4,IZ="VISA | HUD not ready \u2014 run: visa-cli hud doctor",PZ={currentVersion:"0.0.0"},bZ=3e4;function hT(){try{return Le.join(CT(),".visa-cli")}catch{return Le.join(Sp.tmpdir(),".visa-cli")}}function ga(){return Le.join(hT(),"shell-hud.json")}function Tp(){return Le.join(hT(),"shell-hud.line")}function iv(){return Le.join(hT(),"shell-hud.lock")}function Aa(t){let e=t??process.env.SHELL;if(!e)return null;let n=Le.basename(e.replace(/\\/g,"/")).toLowerCase();return n==="zsh"?"zsh":n==="bash"?"bash":n==="pwsh"||n==="pwsh.exe"||n==="powershell"||n==="powershell.exe"?"powershell":null}function xu(t){let e=CT();if(t==="zsh")return Le.join(e,".zshrc");if(t==="bash")return Le.join(e,".bashrc");let n=(process.platform==="win32","PowerShell");return Le.join(e,"Documents",n,"Microsoft.PowerShell_profile.ps1")}function MZ(t){let e=CT(),n=[{shell:"zsh",rcPath:Le.join(e,".zshrc")},{shell:"bash",rcPath:Le.join(e,".bashrc")},{shell:"bash",rcPath:Le.join(e,".bash_profile")},{shell:"powershell",rcPath:Le.join(e,"Documents","PowerShell","Microsoft.PowerShell_profile.ps1")}];if(!t)return n;let r=n.filter(s=>s.shell===t),o=n.filter(s=>s.shell!==t);return[...r,...o]}function LZ(t){let e="$HOME/.visa-cli/shell-hud.line",n=FZ(t),r=$Z(t);if(t==="zsh")return`${Mu}
52
52
  _visa_cli_shell_hud_precmd() {
53
53
  setopt localoptions no_bg_nice
54
54
  if [[ -f "${e}" ]]; then
@@ -65,7 +65,7 @@ autoload -Uz add-zsh-hook
65
65
  if [[ -z "\${precmd_functions[(r)_visa_cli_shell_hud_precmd]}" ]]; then
66
66
  add-zsh-hook precmd _visa_cli_shell_hud_precmd
67
67
  fi
68
- ${fp}`;if(t==="powershell"){let o="(Join-Path $HOME '.visa-cli/shell-hud.line')";return`${Mu}
68
+ ${mp}`;if(t==="powershell"){let o="(Join-Path $HOME '.visa-cli/shell-hud.line')";return`${Mu}
69
69
  if (-not (Test-Path Function:\\global:__visa_cli_original_prompt)) {
70
70
  $function:global:__visa_cli_original_prompt = if (Test-Path Function:\\prompt) { $function:prompt } else { { '' } }
71
71
  }
@@ -84,7 +84,7 @@ function global:prompt {
84
84
  }
85
85
  & $function:global:__visa_cli_original_prompt
86
86
  }
87
- ${fp}`}return`${Mu}
87
+ ${mp}`}return`${Mu}
88
88
  __visa_cli_shell_hud_precmd() {
89
89
  if [ -f "${e}" ]; then
90
90
  cat "${e}"
@@ -101,64 +101,64 @@ case ";$PROMPT_COMMAND;" in
101
101
  *";__visa_cli_shell_hud_precmd;"*) ;;
102
102
  *) PROMPT_COMMAND="__visa_cli_shell_hud_precmd\${PROMPT_COMMAND:+;$PROMPT_COMMAND}" ;;
103
103
  esac
104
- ${fp}`}function ov(t){let e=t;for(let[n,r]of[[Mu,fp],[tv,RZ]])e=e.replace(new RegExp(`\\n?${QC(n)}[\\s\\S]*?${QC(r)}\\n?`,"g"),"");return e.trimEnd()}function IZ(t,e){let n=ov(t).trimEnd(),r=vZ(e);return n.length>0?`${n}
104
+ ${mp}`}function av(t){let e=t;for(let[n,r]of[[Mu,mp],[ov,vZ]])e=e.replace(new RegExp(`\\n?${nv(n)}[\\s\\S]*?${nv(r)}\\n?`,"g"),"");return e.trimEnd()}function xZ(t,e){let n=av(t).trimEnd(),r=LZ(e);return n.length>0?`${n}
105
105
 
106
106
  ${r}
107
107
  `:`${r}
108
- `}function hT(t=Aa()){if(!t)return!1;try{let e=xu(t),n=Ae.readFileSync(e,"utf-8");return n.includes(Mu)||n.includes(tv)}catch{return!1}}function Tp(t=Aa()){if(!t)return{installed:!1,changed:!1,shell:null,message:"Shell HUD auto-install skipped: supported shells are zsh, bash, and PowerShell."};let e;try{e=xu(t);let n=Ae.existsSync(e)?Ae.readFileSync(e,"utf-8"):"",r=IZ(n,t),o=r!==n;return o&&mp(e,r),{installed:!0,changed:o,shell:t,rcPath:e,message:o?`Persistent shell HUD installed in ${e}. Open a new terminal to start seeing it. Disable it any time with: visa-cli shell-hud disable`:`Persistent shell HUD already installed in ${e}. Disable it any time with: visa-cli shell-hud disable`}}catch(n){return{installed:!1,changed:!1,shell:t,rcPath:e,message:`Failed to install persistent shell HUD in ${e}: ${TT(n)}`}}}function gp(t=Aa()){let e=[],n=[],r=[];try{for(let o of CZ(t))if(n.push(o.rcPath),!!Ae.existsSync(o.rcPath))try{let s=Ae.readFileSync(o.rcPath,"utf-8"),i=ov(s);if(i===s.trimEnd())continue;mp(o.rcPath,i.length>0?`${i}
109
- `:""),e.push(o.rcPath)}catch(s){r.push(`${o.rcPath}: ${TT(s)}`)}return e.length>0?{removed:!0,shell:t,rcPath:e[0],rcPaths:e,message:r.length>0?`Removed persistent shell HUD from ${e.join(", ")}. Some rc files could not be updated: ${r.join("; ")}.`:`Removed persistent shell HUD from ${e.join(", ")}.`}:r.length>0?{removed:!1,shell:t,rcPath:n[0],rcPaths:n,message:`Failed to remove persistent shell HUD: ${r.join("; ")}`}:{removed:!0,shell:t,rcPath:n[0],rcPaths:n,message:"Persistent shell HUD was not installed in any supported shell rc file."}}catch(o){return{removed:!1,shell:t,message:`Failed to remove persistent shell HUD: ${TT(o)}`}}}function AT(t,e){let n=e??OZ,r=n.currentVersion==="0.0.0"&&t.version?t.version:n.currentVersion,o=ha(r),s=` ${Et("\u2502",ut.dim)} `,i=sv(n),a=MZ(n,i),c=a||n.updateCheckDisabled?"":i,u=bZ(o,c);if(!t.enrolled)return[u,Et("setup needed",ut.visaGold),a].filter(Boolean).join(s);let l=UZ(t),d=PZ(t);return[u,Et(l,ut.visaGold),d,a].filter(Boolean).join(s)}function PZ(t){let e=typeof t.balanceCents=="number"?t.balanceCents:null,n=t.activeSession;if(e===null)return Et("balance unknown",ut.dim);let r=e/100;if(n){let s=Math.max(0,n.capCents),i=Math.max(0,n.estimatedRemainingCents),a=Math.max(0,s-i),c=s>0?Math.max(0,Math.min(1,a/s)):0;return`${DZ(c)} ${Et(`${Ta(i/100)} in session`,ut.green)} ${Et(`(${Ta(a/100)}/${Ta(s/100)} cap)`,ut.dim)} ${Et("\xB7",ut.dim)} ${Et(`${Ta(r)} balance`,ut.dim)}`}return e>=100?Et(`${Ta(r)} balance`,ut.green):Et(`${Ta(r)} balance \u2014 top up via buy_credits`,ut.visaGold)}function bZ(t,e){let n=`${Et("VISA CLI",ut.visaBlue)} ${Et(`v${t}`,ut.visaBlueSoft)}`;return e?`${n} ${Et("\u2B06 update",ut.visaGold)} ${Et(`v${e}`,ut.visaGold)}`:n}function MZ(t,e){if(e&&!t.updateCheckDisabled){let n=ha(Ea(e));return Et(`run: ${n}`,ut.visaGold)}return e?null:LZ(t)}function sv(t){return t.latestVersion?ha(t.latestVersion):""}function LZ(t){let e=sv(t);return e?Et(`update ready v${e}`,ut.visaGold):null}function iv(){let t=OT();return!(!t||Date.now()-t.renderedAt>nv||t.cwd&&t.cwd!==process.cwd())}function RT(){let t=OT();if(t&&Date.now()-t.renderedAt<=nv||(xZ(),t?.line))return t.line;try{let e=Sp();if(Ae.existsSync(e))return Ae.readFileSync(e,"utf-8").trimEnd()}catch{}return yZ}function yT(t,e){try{let n=Le.dirname(ga());Ae.mkdirSync(n,{recursive:!0});let r=ha(t),o={hudVersion:AZ,renderedAt:Date.now(),line:r,cwd:process.cwd(),status:e};mp(ga(),JSON.stringify(o)+`
110
- `),mp(Sp(),r+`
111
- `)}catch{}}function Lu(){try{Ae.unlinkSync(rv())}catch{}}function OT(){let t=ga();if(!Ae.existsSync(t))return null;try{return JSON.parse(Ae.readFileSync(t,"utf-8"))}catch{return null}}function av(){return OT()?.status??null}function xZ(){if(process.env.JEST_WORKER_ID)return;let t=rv();try{if(Ae.mkdirSync(Le.dirname(t),{recursive:!0}),!BZ(t))return;let e=process.argv[1]?Le.resolve(process.argv[1]):"";if(!e){Lu();return}let n=(0,ev.spawn)(process.execPath,[e,"shell-hud","refresh"],{detached:!0,stdio:"ignore",env:{...process.env,VISA_CLI_SHELL_HUD_BACKGROUND:"1"}});n.once("error",Lu),n.unref()}catch{Lu()}}function ha(t){return t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ").trim()}function DZ(t){let n=Math.round(Math.max(0,Math.min(1,t))*10),r="\u2588".repeat(n),o="\u2591".repeat(10-n);return`${Et(r||"",ut.green)}${Et(o||"",ut.dim)}`}function Ta(t){return`$${t.toFixed(2)}`}function UZ(t){let e=t.cards?.find(a=>a.isDefault)??t.cards?.[0];if(!e)return"card none";let n=typeof e.brand=="string"?e.brand:"card",r=typeof e.last4=="string"?e.last4:"????",o=ha(n.toUpperCase()),s=ha(r);return`${e.isDefault?"default":"active"} ${o} ****${s}`}function wZ(){let t=(process.env.COLORTERM??"").toLowerCase();if(t==="truecolor"||t==="24bit")return!0;let e=(process.env.TERM??"").toLowerCase();return e.includes("truecolor")||e.includes("24bit")}var ST=wZ(),ut={reset:"\x1B[0m",visaBlue:ST?"\x1B[38;2;20;52;203m":"\x1B[38;5;27m",visaBlueSoft:ST?"\x1B[38;2;97;126;229m":"\x1B[38;5;111m",visaGold:ST?"\x1B[38;2;247;182;0m":"\x1B[38;5;220m",green:"\x1B[38;5;48m",dim:"\x1B[2m"};function Et(t,e){return t.length===0||process.env.NO_COLOR?t:`${e}${t}${ut.reset}`}function QC(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function NT(){let t=Ep.homedir();if(!t||!Le.isAbsolute(t))throw new Error("unable to determine a valid home directory");return Le.resolve(t)}function kZ(t){return t==="powershell"?"& visa-cli shell-hud refresh":"visa-cli shell-hud refresh"}function VZ(t){return t==="powershell"?"Get-Command visa-cli -ErrorAction SilentlyContinue -CommandType Application":"command -v visa-cli >/dev/null 2>&1"}function BZ(t){for(let e=0;e<2;e+=1){let n;try{return n=Ae.openSync(t,"wx"),Ae.writeFileSync(n,String(Date.now())),!0}catch(r){if(r?.code!=="EEXIST")return!1;try{let o=Ae.statSync(t);if(Date.now()-o.mtimeMs<=NZ)return!1;Ae.unlinkSync(t)}catch{}}finally{n!==void 0&&Ae.closeSync(n)}}return!1}function TT(t){return t instanceof Error?t.message:"unknown file system error"}function mp(t,e){Ae.mkdirSync(Le.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.${Date.now()}.tmp`;Ae.writeFileSync(n,e),Ae.renameSync(n,t)}async function hp(t,e){try{return await e()}catch(n){if(n.message==="Invalid signature"&&zt()){vr.warn("attestation:key-mismatch",{action:"reregistering"});try{let r=await dp();await t.registerAttestationKey(r),vr.info("attestation:key-reregistered")}catch(r){throw vr.error("attestation:reregister-failure",{error:r.message}),n}return await e()}throw n}}function cv(t=process.env){let e=t.VISA_DRY_RUN;return e==="true"||e==="1"||e==="mock"?"mock":e==="preflight"?"preflight":null}function uv(t=process.env){return cv(t)!==null}var lv="2.0.0-rc.37";function CT(t,e){return e?{kind:"env",var:t}:{kind:"default"}}function Ap(t,e,n){let r=process.env[t];if(r!==void 0)return{value:n==="opt-in"?r==="true":r!=="false",source:{kind:"env",var:t}};let o=DC(e);return o!==void 0?{value:o,source:{kind:"settings"}}:{value:n!=="opt-in",source:{kind:"default"}}}function An(t){return t==null?"\u2014":t?"yes":"no"}function Rp(t){return t==null?"\u2014":`$${t.toFixed(2)}`}function GZ(t){return t==null?"\u2014":`$${(t/100).toFixed(2)}`}function HZ(){let t=process.env.VISA_CREDIT_SESSION_CAP_CENTS;if(t!==void 0){let n=Number(t);if(Number.isFinite(n)&&n>=100&&n<=1e4)return{value:Math.floor(n),source:{kind:"env",var:"VISA_CREDIT_SESSION_CAP_CENTS"}}}let e=UC("credit.sessionCapCents");return e!==void 0&&e>=100&&e<=1e4?{value:Math.floor(e),source:{kind:"settings"}}:{value:xC,source:{kind:"default"}}}async function vT(t){let e=null,n=null;try{e=await t.api.getStatus()}catch(P){n=P?.message||"unknown error"}let r=[],o=process.env.VISA_AUTH_URL,s=aT("auth.serverUrl"),i=Cr(),a=o!==void 0&&o!==""?{kind:"env",var:"VISA_AUTH_URL"}:s!==void 0?{kind:"settings"}:{kind:"default"};r.push({key:"auth.serverUrl",value:i,formatted:i,source:a,hint:a.kind==="default"?"Persist with `visa-cli config set auth.serverUrl <url>` (or set VISA_AUTH_URL for one-off overrides).":void 0}),r.push({key:"account.enrolled",value:e?.enrolled??null,formatted:An(e?.enrolled),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),e?.githubUser&&r.push({key:"account.githubUser",value:e.githubUser,formatted:e.githubUser,source:{kind:"server"}});let c=e?e.attestationRequired!==!1:void 0;r.push({key:"biometric.required",value:c,formatted:An(c),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"},hint:c===!1?"Touch ID prompts are suppressed. Re-enable with `visa-cli biometric on`.":void 0}),r.push({key:"biometric.keyRegistered",value:e?.hasAttestationKey??null,formatted:An(e?.hasAttestationKey),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"biometric.deviceAvailable",value:zt(),formatted:An(zt()),source:{kind:"device"}});let u=e?.spendingControls,l=u?u.max_transaction_amount??u.maxTransactionAmount??null:null,d=u?u.daily_limit??u.dailyLimit??null:null;r.push({key:"spending.maxPerTxn",value:l,formatted:Rp(l),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailyLimit",value:d,formatted:Rp(d),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailySpent",value:e?.dailySpent??null,formatted:Rp(e?.dailySpent),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailyRemaining",value:e?.dailyRemaining??null,formatted:Rp(e?.dailyRemaining),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"cards.count",value:e?.cardCount??null,formatted:e?.cardCount!=null?String(e.cardCount):"\u2014",source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}});let p=e?.cards?.find(P=>P.isDefault)??e?.cards?.[0];p&&r.push({key:"cards.default",value:{brand:p.brand??null,last4:p.last4},formatted:`${p.brand||"card"} \u2022\u2022\u2022\u2022 ${p.last4}`,source:{kind:"server"}});let _=HZ();r.push({key:"credit.sessionCapCents",value:_.value,formatted:GZ(_.value),source:_.source});let f=kC();f.length>0&&r.push({key:"settings.retired",value:f.map(P=>P.key),formatted:f.map(P=>P.key).join(", "),source:{kind:"settings"},hint:`Ignored retired settings found. Remove with: ${f.map(P=>`visa-cli config unset ${P.key}`).join(" && ")}`});let E=Ap("VISA_SUPPRESS_BROWSER","ui.suppressBrowser","opt-in");r.push({key:"ui.suppressBrowser",value:E.value,formatted:An(E.value),source:E.source,hint:"Persist with `visa-cli config set ui.suppressBrowser true` to stop auto-opening result URLs."});let S=Ap("VISA_SUPPRESS_FEED","ui.suppressFeed","opt-in");r.push({key:"ui.suppressFeed",value:S.value,formatted:An(S.value),source:S.source});let g=Nr(),h;process.env.VISA_CLI_NO_UPDATE_CHECK?h={kind:"env",var:"VISA_CLI_NO_UPDATE_CHECK"}:process.env.CI?h={kind:"env",var:"CI"}:process.env.NODE_ENV==="test"?h={kind:"env",var:"NODE_ENV"}:h={kind:"default"},r.push({key:"ui.updateCheck",value:!g,formatted:An(!g),source:h});let O=Ap("VISA_META_TOOLS","tools.meta","opt-out");r.push({key:"tools.meta",value:O.value,formatted:An(O.value),source:O.source,hint:"Persist with `visa-cli config set tools.meta false`. Restart Claude Code for changes to take effect."});let N=Ap("VISA_DISCOVER_TOOLS","tools.discover","opt-out");r.push({key:"tools.discover",value:N.value,formatted:An(N.value),source:N.source});let R=process.env.VISA_DRY_RUN,M=uv();if(r.push({key:"tools.dryRun",value:M,formatted:An(M),source:R===void 0?{kind:"default"}:{kind:"env",var:"VISA_DRY_RUN"},hint:"VISA_DRY_RUN=true|1|mock returns deterministic paid-tool fixtures (no card, no upstream). VISA_DRY_RUN=preflight makes a real zero-cost OpenRouter call for LLM tools (image/video still mocked)."}),r.push({key:"client.version",value:lv,formatted:lv,source:{kind:"default"}}),t.includeDev){let P=process.env.VISA_MOCK_KEYCHAIN;r.push({key:"dev.mockKeychain",value:P==="true",formatted:An(P==="true"),source:CT("VISA_MOCK_KEYCHAIN",!!P)});let J=process.env.VISA_MOCK_TOUCHID;r.push({key:"dev.mockTouchid",value:J==="true",formatted:An(J==="true"),source:CT("VISA_MOCK_TOUCHID",!!J)});let X=process.env.VISA_CLI_DEBUG;r.push({key:"dev.debug",value:!!X,formatted:An(!!X),source:CT("VISA_CLI_DEBUG",!!X)})}return{entries:r,statusError:n}}function FZ(t){switch(t.kind){case"default":return"default";case"env":return`env ${t.var}`;case"settings":return"settings.json";case"server":return"server";case"device":return"device";case"unset":return"unset";case"unknown":return`unknown (${t.reason})`}}function dv(t,e={}){if(t.length===0)return"";let n=Math.max(...t.map(s=>s.key.length)),r=Math.max(...t.map(s=>s.formatted.length)),o=[];for(let s of t){let i=s.key.padEnd(n+2),a=s.formatted.padEnd(r+2);o.push(`${i}${a}(${FZ(s.source)})`),e.verbose&&s.hint&&o.push(` ${"\u21B3".padStart(n)} ${s.hint}`)}return o.join(`
112
- `)}function pv(t){return JSON.stringify({config:t.entries.map(e=>({key:e.key,value:e.value,source:e.source,hint:e.hint})),statusError:t.statusError},null,2)}var y={};Kd(y,{BRAND:()=>fQ,DIRTY:()=>oi,EMPTY_PATH:()=>YZ,INVALID:()=>Y,NEVER:()=>ZQ,OK:()=>Dt,ParseStatus:()=>vt,Schema:()=>ce,ZodAny:()=>Xo,ZodArray:()=>mo,ZodBigInt:()=>ii,ZodBoolean:()=>ai,ZodBranded:()=>Uu,ZodCatch:()=>Ti,ZodDate:()=>ci,ZodDefault:()=>Si,ZodDiscriminatedUnion:()=>Np,ZodEffects:()=>Un,ZodEnum:()=>mi,ZodError:()=>ln,ZodFirstPartyTypeKind:()=>W,ZodFunction:()=>vp,ZodIntersection:()=>pi,ZodIssueCode:()=>C,ZodLazy:()=>_i,ZodLiteral:()=>fi,ZodMap:()=>va,ZodNaN:()=>Pa,ZodNativeEnum:()=>Ei,ZodNever:()=>rr,ZodNull:()=>li,ZodNullable:()=>Mr,ZodNumber:()=>si,ZodObject:()=>dn,ZodOptional:()=>xn,ZodParsedType:()=>D,ZodPipeline:()=>wu,ZodPromise:()=>Jo,ZodReadonly:()=>gi,ZodRecord:()=>Cp,ZodSchema:()=>ce,ZodSet:()=>Ia,ZodString:()=>zo,ZodSymbol:()=>Na,ZodTransformer:()=>Un,ZodTuple:()=>br,ZodType:()=>ce,ZodUndefined:()=>ui,ZodUnion:()=>di,ZodUnknown:()=>fo,ZodVoid:()=>Ca,addIssueToContext:()=>x,any:()=>yQ,array:()=>vQ,bigint:()=>TQ,boolean:()=>yv,coerce:()=>JQ,custom:()=>hv,date:()=>gQ,datetimeRegex:()=>Tv,defaultErrorMap:()=>po,discriminatedUnion:()=>MQ,effect:()=>$Q,enum:()=>GQ,function:()=>kQ,getErrorMap:()=>Ra,getParsedType:()=>Pr,instanceof:()=>EQ,intersection:()=>LQ,isAborted:()=>yp,isAsync:()=>ya,isDirty:()=>Op,isValid:()=>Wo,late:()=>mQ,lazy:()=>VQ,literal:()=>BQ,makeIssue:()=>Du,map:()=>UQ,nan:()=>SQ,nativeEnum:()=>HQ,never:()=>NQ,null:()=>RQ,nullable:()=>qQ,number:()=>Rv,object:()=>IQ,objectUtil:()=>IT,oboolean:()=>XQ,onumber:()=>zQ,optional:()=>jQ,ostring:()=>WQ,pipeline:()=>KQ,preprocess:()=>YQ,promise:()=>FQ,quotelessJson:()=>$Z,record:()=>DQ,set:()=>wQ,setErrorMap:()=>qZ,strictObject:()=>PQ,string:()=>Av,symbol:()=>hQ,transformer:()=>$Q,tuple:()=>xQ,undefined:()=>AQ,union:()=>bQ,unknown:()=>OQ,util:()=>ue,void:()=>CQ});var ue;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ue||(ue={}));var IT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(IT||(IT={}));var D=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var C=ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),$Z=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ln=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ln.create=t=>new ln(t);var jZ=(t,e)=>{let n;switch(t.code){case C.invalid_type:t.received===D.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case C.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case C.invalid_union:n="Invalid input";break;case C.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case C.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case C.invalid_arguments:n="Invalid function arguments";break;case C.invalid_return_type:n="Invalid function return type";break;case C.invalid_date:n="Invalid date";break;case C.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case C.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case C.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case C.custom:n="Invalid input";break;case C.invalid_intersection_types:n="Intersection results could not be merged";break;case C.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case C.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},po=jZ;var _v=po;function qZ(t){_v=t}function Ra(){return _v}var Du=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},YZ=[];function x(t,e){let n=Ra(),r=Du({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===po?void 0:po].filter(o=>!!o)});t.common.issues.push(r)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return Y;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Y;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},Y=Object.freeze({status:"aborted"}),oi=t=>({status:"dirty",value:t}),Dt=t=>({status:"valid",value:t}),yp=t=>t.status==="aborted",Op=t=>t.status==="dirty",Wo=t=>t.status==="valid",ya=t=>typeof Promise<"u"&&t instanceof Promise;var G;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(G||(G={}));var Dn=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},fv=(t,e)=>{if(Wo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ln(t.common.issues);return this._error=n,this._error}}};function te(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}var ce=class{get description(){return this._def.description}_getType(e){return Pr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ya(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)},o=this._parseSync({data:e,path:r.path,parent:r});return fv(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Wo(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Wo(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(ya(o)?o:Promise.resolve(o));return fv(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:C.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new Un({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return xn.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mo.create(this)}promise(){return Jo.create(this,this._def)}or(e){return di.create([this,e],this._def)}and(e){return pi.create(this,e,this._def)}transform(e){return new Un({...te(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Si({...te(this._def),innerType:this,defaultValue:n,typeName:W.ZodDefault})}brand(){return new Uu({typeName:W.ZodBranded,type:this,...te(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ti({...te(this._def),innerType:this,catchValue:n,typeName:W.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return wu.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},KZ=/^c[^\s-]{8,}$/i,WZ=/^[0-9a-z]+$/,zZ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,XZ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,JZ=/^[a-z0-9_-]{21}$/i,ZZ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,QZ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,eQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,tQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",PT,nQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,rQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,oQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,sQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,iQ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,aQ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,Ev="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",cQ=new RegExp(`^${Ev}$`);function Sv(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function uQ(t){return new RegExp(`^${Sv(t)}$`)}function Tv(t){let e=`${Ev}T${Sv(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function lQ(t,e){return!!((e==="v4"||!e)&&nQ.test(t)||(e==="v6"||!e)&&oQ.test(t))}function dQ(t,e){if(!ZZ.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function pQ(t,e){return!!((e==="v4"||!e)&&rQ.test(t)||(e==="v6"||!e)&&sQ.test(t))}var zo=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.string,received:s.parsedType}),Y}let r=new vt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?x(o,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&x(o,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")eQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")PT||(PT=new RegExp(tQ,"u")),PT.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")XZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")JZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")KZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")WZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")zZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:C.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:C.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Tv(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?cQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?uQ(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?QZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?lQ(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?dQ(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?pQ(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?iQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?aQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:C.invalid_string,message:s.message}),r.dirty()):ue.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:C.invalid_string,...G.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...G.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...G.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...G.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...G.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...G.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...G.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...G.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...G.errToObj(n)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};zo.create=t=>new zo({checks:[],typeName:W.ZodString,coerce:t?.coerce??!1,...te(t)});function _Q(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var si=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.number,received:s.parsedType}),Y}let r,o=new vt;for(let s of this._def.checks)s.kind==="int"?ue.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:C.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?_Q(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_finite,message:s.message}),o.dirty()):ue.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};si.create=t=>new si({checks:[],typeName:W.ZodNumber,coerce:t?.coerce||!1,...te(t)});var ii=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let r,o=new vt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ue.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:C.invalid_type,expected:D.bigint,received:n.parsedType}),Y}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ii.create=t=>new ii({checks:[],typeName:W.ZodBigInt,coerce:t?.coerce??!1,...te(t)});var ai=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.boolean,received:r.parsedType}),Y}return Dt(e.data)}};ai.create=t=>new ai({typeName:W.ZodBoolean,coerce:t?.coerce||!1,...te(t)});var ci=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.date,received:s.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_date}),Y}let r=new vt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ue.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ci.create=t=>new ci({checks:[],coerce:t?.coerce||!1,typeName:W.ZodDate,...te(t)});var Na=class extends ce{_parse(e){if(this._getType(e)!==D.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.symbol,received:r.parsedType}),Y}return Dt(e.data)}};Na.create=t=>new Na({typeName:W.ZodSymbol,...te(t)});var ui=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.undefined,received:r.parsedType}),Y}return Dt(e.data)}};ui.create=t=>new ui({typeName:W.ZodUndefined,...te(t)});var li=class extends ce{_parse(e){if(this._getType(e)!==D.null){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.null,received:r.parsedType}),Y}return Dt(e.data)}};li.create=t=>new li({typeName:W.ZodNull,...te(t)});var Xo=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Dt(e.data)}};Xo.create=t=>new Xo({typeName:W.ZodAny,...te(t)});var fo=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Dt(e.data)}};fo.create=t=>new fo({typeName:W.ZodUnknown,...te(t)});var rr=class extends ce{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:C.invalid_type,expected:D.never,received:n.parsedType}),Y}};rr.create=t=>new rr({typeName:W.ZodNever,...te(t)});var Ca=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.void,received:r.parsedType}),Y}return Dt(e.data)}};Ca.create=t=>new Ca({typeName:W.ZodVoid,...te(t)});var mo=class t extends ce{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==D.array)return x(n,{code:C.invalid_type,expected:D.array,received:n.parsedType}),Y;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(x(n,{code:i?C.too_big:C.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:C.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:C.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Dn(n,i,n.path,a)))).then(i=>vt.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Dn(n,i,n.path,a)));return vt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:G.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:G.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:G.toString(n)}})}nonempty(e){return this.min(1,e)}};mo.create=(t,e)=>new mo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...te(e)});function Oa(t){if(t instanceof dn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=xn.create(Oa(r))}return new dn({...t._def,shape:()=>e})}else return t instanceof mo?new mo({...t._def,type:Oa(t.element)}):t instanceof xn?xn.create(Oa(t.unwrap())):t instanceof Mr?Mr.create(Oa(t.unwrap())):t instanceof br?br.create(t.items.map(e=>Oa(e))):t}var dn=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==D.object){let u=this._getOrReturnCtx(e);return x(u,{code:C.invalid_type,expected:D.object,received:u.parsedType}),Y}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof rr&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Dn(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof rr){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(x(o,{code:C.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Dn(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>vt.mergeObjectSync(r,u)):vt.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:G.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ue.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ue.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Oa(this)}partial(e){let n={};for(let r of ue.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ue.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof xn;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return gv(ue.objectKeys(this.shape))}};dn.create=(t,e)=>new dn({shape:()=>t,unknownKeys:"strip",catchall:rr.create(),typeName:W.ZodObject,...te(e)});dn.strictCreate=(t,e)=>new dn({shape:()=>t,unknownKeys:"strict",catchall:rr.create(),typeName:W.ZodObject,...te(e)});dn.lazycreate=(t,e)=>new dn({shape:t,unknownKeys:"strip",catchall:rr.create(),typeName:W.ZodObject,...te(e)});var di=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new ln(a.ctx.common.issues));return x(n,{code:C.invalid_union,unionErrors:i}),Y}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new ln(c));return x(n,{code:C.invalid_union,unionErrors:a}),Y}}get options(){return this._def.options}};di.create=(t,e)=>new di({options:t,typeName:W.ZodUnion,...te(e)});var _o=t=>t instanceof _i?_o(t.schema):t instanceof Un?_o(t.innerType()):t instanceof fi?[t.value]:t instanceof mi?t.options:t instanceof Ei?ue.objectValues(t.enum):t instanceof Si?_o(t._def.innerType):t instanceof ui?[void 0]:t instanceof li?[null]:t instanceof xn?[void 0,..._o(t.unwrap())]:t instanceof Mr?[null,..._o(t.unwrap())]:t instanceof Uu||t instanceof gi?_o(t.unwrap()):t instanceof Ti?_o(t._def.innerType):[],Np=class t extends ce{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return x(n,{code:C.invalid_type,expected:D.object,received:n.parsedType}),Y;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=_o(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:W.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...te(r)})}};function bT(t,e){let n=Pr(t),r=Pr(e);if(t===e)return{valid:!0,data:t};if(n===D.object&&r===D.object){let o=ue.objectKeys(e),s=ue.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=bT(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===D.array&&r===D.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=bT(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===D.date&&r===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pi=class extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(yp(s)||yp(i))return Y;let a=bT(s.value,i.value);return a.valid?((Op(s)||Op(i))&&n.dirty(),{status:n.value,value:a.data}):(x(r,{code:C.invalid_intersection_types}),Y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};pi.create=(t,e,n)=>new pi({left:t,right:e,typeName:W.ZodIntersection,...te(n)});var br=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.array)return x(r,{code:C.invalid_type,expected:D.array,received:r.parsedType}),Y;if(r.data.length<this._def.items.length)return x(r,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Dn(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>vt.mergeArray(n,i)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};br.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new br({items:t,typeName:W.ZodTuple,rest:null,...te(e)})};var Cp=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return x(r,{code:C.invalid_type,expected:D.object,received:r.parsedType}),Y;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Dn(r,a,r.path,a)),value:i._parse(new Dn(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?vt.mergeObjectAsync(n,o):vt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ce?new t({keyType:e,valueType:n,typeName:W.ZodRecord,...te(r)}):new t({keyType:zo.create(),valueType:e,typeName:W.ZodRecord,...te(n)})}},va=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.map)return x(r,{code:C.invalid_type,expected:D.map,received:r.parsedType}),Y;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:o._parse(new Dn(r,a,r.path,[u,"key"])),value:s._parse(new Dn(r,c,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return Y;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return Y;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}};va.create=(t,e,n)=>new va({valueType:e,keyType:t,typeName:W.ZodMap,...te(n)});var Ia=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.set)return x(r,{code:C.invalid_type,expected:D.set,received:r.parsedType}),Y;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:C.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:C.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return Y;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((c,u)=>s._parse(new Dn(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:G.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:G.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ia.create=(t,e)=>new Ia({valueType:t,minSize:null,maxSize:null,typeName:W.ZodSet,...te(e)});var vp=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.function)return x(n,{code:C.invalid_type,expected:D.function,received:n.parsedType}),Y;function r(a,c){return Du({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ra(),po].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:c}})}function o(a,c){return Du({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ra(),po].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Jo){let a=this;return Dt(async function(...c){let u=new ln([]),l=await a._def.args.parseAsync(c,s).catch(_=>{throw u.addIssue(r(c,_)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(_=>{throw u.addIssue(o(d,_)),u})})}else{let a=this;return Dt(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new ln([r(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new ln([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:br.create(e).rest(fo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||br.create([]).rest(fo.create()),returns:n||fo.create(),typeName:W.ZodFunction,...te(r)})}},_i=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};_i.create=(t,e)=>new _i({getter:t,typeName:W.ZodLazy,...te(e)});var fi=class extends ce{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:C.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};fi.create=(t,e)=>new fi({value:t,typeName:W.ZodLiteral,...te(e)});function gv(t,e){return new mi({values:t,typeName:W.ZodEnum,...te(e)})}var mi=class t extends ce{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:ue.joinValues(r),received:n.parsedType,code:C.invalid_type}),Y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:C.invalid_enum_value,options:r}),Y}return Dt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};mi.create=gv;var Ei=class extends ce{_parse(e){let n=ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==D.string&&r.parsedType!==D.number){let o=ue.objectValues(n);return x(r,{expected:ue.joinValues(o),received:r.parsedType,code:C.invalid_type}),Y}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ue.objectValues(n);return x(r,{received:r.data,code:C.invalid_enum_value,options:o}),Y}return Dt(e.data)}get enum(){return this._def.values}};Ei.create=(t,e)=>new Ei({values:t,typeName:W.ZodNativeEnum,...te(e)});var Jo=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.promise&&n.common.async===!1)return x(n,{code:C.invalid_type,expected:D.promise,received:n.parsedType}),Y;let r=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return Dt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Jo.create=(t,e)=>new Jo({type:t,typeName:W.ZodPromise,...te(e)});var Un=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{x(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Y;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Y:c.status==="dirty"?oi(c.value):n.value==="dirty"?oi(c.value):c});{if(n.value==="aborted")return Y;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Y:a.status==="dirty"?oi(a.value):n.value==="dirty"?oi(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Y:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Y:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wo(i))return Y;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Wo(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Y);ue.assertNever(o)}};Un.create=(t,e,n)=>new Un({schema:t,typeName:W.ZodEffects,effect:e,...te(n)});Un.createWithPreprocess=(t,e,n)=>new Un({schema:e,effect:{type:"preprocess",transform:t},typeName:W.ZodEffects,...te(n)});var xn=class extends ce{_parse(e){return this._getType(e)===D.undefined?Dt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};xn.create=(t,e)=>new xn({innerType:t,typeName:W.ZodOptional,...te(e)});var Mr=class extends ce{_parse(e){return this._getType(e)===D.null?Dt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:W.ZodNullable,...te(e)});var Si=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===D.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Si.create=(t,e)=>new Si({innerType:t,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});var Ti=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ya(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ln(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ln(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ti.create=(t,e)=>new Ti({innerType:t,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});var Pa=class extends ce{_parse(e){if(this._getType(e)!==D.nan){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.nan,received:r.parsedType}),Y}return{status:"valid",value:e.data}}};Pa.create=t=>new Pa({typeName:W.ZodNaN,...te(t)});var fQ=Symbol("zod_brand"),Uu=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},wu=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Y:s.status==="dirty"?(n.dirty(),oi(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Y:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:W.ZodPipeline})}},gi=class extends ce{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Wo(o)&&(o.value=Object.freeze(o.value)),o);return ya(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:W.ZodReadonly,...te(e)});function mv(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function hv(t,e={},n){return t?Xo.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=mv(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=mv(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Xo.create()}var mQ={object:dn.lazycreate},W;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(W||(W={}));var EQ=(t,e={message:`Input not instance of ${t.name}`})=>hv(n=>n instanceof t,e),Av=zo.create,Rv=si.create,SQ=Pa.create,TQ=ii.create,yv=ai.create,gQ=ci.create,hQ=Na.create,AQ=ui.create,RQ=li.create,yQ=Xo.create,OQ=fo.create,NQ=rr.create,CQ=Ca.create,vQ=mo.create,IQ=dn.create,PQ=dn.strictCreate,bQ=di.create,MQ=Np.create,LQ=pi.create,xQ=br.create,DQ=Cp.create,UQ=va.create,wQ=Ia.create,kQ=vp.create,VQ=_i.create,BQ=fi.create,GQ=mi.create,HQ=Ei.create,FQ=Jo.create,$Q=Un.create,jQ=xn.create,qQ=Mr.create,YQ=Un.createWithPreprocess,KQ=wu.create,WQ=()=>Av().optional(),zQ=()=>Rv().optional(),XQ=()=>yv().optional(),JQ={string:(t=>zo.create({...t,coerce:!0})),number:(t=>si.create({...t,coerce:!0})),boolean:(t=>ai.create({...t,coerce:!0})),bigint:(t=>ii.create({...t,coerce:!0})),date:(t=>ci.create({...t,coerce:!0}))};var ZQ=Y;var Ov=["tempo","mpp_self","merchant_self"];var MT=y.object({inputPerMillion:y.number().positive(),outputPerMillion:y.number().positive(),contextWindow:y.number().int().positive().optional(),maxOutput:y.number().int().positive().optional()}),QQ=y.object({strategy:y.enum(["flat","token","band"]).optional(),pricingModel:y.enum(["per-call","per-token","band"]).optional(),priceCents:y.number().nonnegative().optional(),currency:y.string().optional(),display:y.string().optional(),estimate:y.boolean().optional(),source:y.string().optional(),priceBand:y.record(y.unknown()).optional(),tokenPricing:MT.optional()}).passthrough(),LT=y.discriminatedUnion("type",[y.object({type:y.literal("shortcut"),routedPath:y.string().min(1).startsWith("/")}),y.object({type:y.literal("custom"),merchantSlug:y.string().min(1),subPath:y.string().optional()}),y.object({type:y.literal("local"),fn:y.string().min(1)}),y.object({type:y.literal("read")})]),xT=y.object({amount:y.number().nonnegative(),currency:y.string().length(3).optional(),display:y.string().optional(),free:y.boolean().optional(),batchDiscount:y.number().min(0).max(100).optional()}),Nv=y.object({attestation:y.boolean().optional(),rateLimitMs:y.number().positive().optional()}),Cv=y.object({displayName:y.string().optional(),feedbackEligible:y.boolean().optional(),suggestionEligible:y.boolean().optional(),batchable:y.boolean().optional()}),e7=y.enum(["image","video","audio","3d","llm","upscale","tts","transcription","utility","onchain"]),DT={id:y.string().min(1),name:y.string().min(1),description:y.string().min(1),provider:y.string().min(1),model:y.string().min(1),category:e7,priceCents:y.number().nonnegative(),inputSchema:y.record(y.unknown()),gatewayUrl:y.string().min(1),merchantName:y.string().min(1),isAsync:y.boolean().optional(),pollUrl:y.string().optional(),pollInterval:y.number().positive().optional(),pollTimeout:y.number().positive().optional(),tags:y.array(y.string()).optional(),tokenPricing:MT.optional(),priceDisplay:y.string().optional(),pricingModel:y.enum(["per-call","per-token","band"]).optional(),pricingInfo:QQ.optional(),status:y.enum(["available","unavailable"]).optional(),handler:LT.optional(),pricing:xT.optional(),security:Nv.optional(),engagement:Cv.optional(),enabled:y.boolean().optional(),beta:y.boolean().optional(),deprecated:y.boolean().optional(),replacementTool:y.string().optional(),minCliVersion:y.string().optional(),sunsetAt:y.string().optional(),rail:y.enum(Ov).optional(),pricingStrategy:y.enum(["flat","token","band"]).optional()},vv=y.object({...DT,dispatch:y.literal("routed"),routedPath:y.string().min(1).startsWith("/")}).strict(),Iv=y.object({...DT,dispatch:y.literal("enveloped")}).strict(),Pv=y.object({...DT,handler:LT,pricing:xT}).strict(),bv=y.union([y.discriminatedUnion("dispatch",[vv,Iv]),Pv]);var UT=/^[a-z0-9][a-z0-9_-]*$/;var xv="https://fal.run",n7="https://openrouter.mpp.tempo.xyz";function r7(t){let{attestation:e,tool_id:n,...r}=t;return r}var Mv={"1:1":"square_hd","16:9":"landscape_16_9","9:16":"portrait_16_9","4:3":"landscape_4_3","3:4":"portrait_4_3"};function Ip(t){let{attestation:e,tool_id:n,aspect_ratio:r,image_size:o,...s}=t,i={...s};return typeof o=="string"&&o.length>0?(i.image_size=o,i):(typeof r=="string"&&Mv[r]&&(i.image_size=Mv[r]),i)}function tt(t,e,n,r,o,s,i,a){return{dispatch:"routed",id:t,name:e,description:n,provider:"fal",model:r,category:o,priceCents:s,inputSchema:i,routedPath:`/api/v1/fal/${r}`,gatewayUrl:`${xv}/${r}`,merchantName:"fal.ai",buildBody:r7,tags:[],...a}}function o7(t){return e=>{let{attestation:n,tool_id:r,prompt:o,system_prompt:s,max_tokens:i,temperature:a,...c}=e;return{model:t,messages:[...s?[{role:"system",content:s}]:[],{role:"user",content:o}],max_tokens:i??1024,temperature:a??.7,...c}}}function Ut(t,e,n,r,o,s,i){let a=5e-4*o*100,c=500/1e6*s*100,u=Math.max(1,Math.ceil(a+c));return{dispatch:"routed",id:t,name:e,description:n,provider:"openrouter",model:r,category:"llm",priceCents:u,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt or question to send to the model"},system_prompt:{type:"string",description:"Optional system prompt to set model behavior"},max_tokens:{type:"integer",description:"Maximum tokens in response (default: 1024)",minimum:1,maximum:8192},temperature:{type:"number",description:"Sampling temperature 0-2 (default: 0.7)",minimum:0,maximum:2}},required:["prompt"]},routedPath:"/api/v1/chat/completions",gatewayUrl:`${n7}/v1/chat/completions`,merchantName:"OpenRouter",buildBody:o7(r),tags:["llm","chat","text"],tokenPricing:{inputPerMillion:o,outputPerMillion:s},...i}}var Dv=[tt("fal-flux-pro-ultra","FLUX Pro Ultra","Highest quality image generation. Best for detailed, photorealistic images.","fal-ai/flux-pro/v1.1-ultra","image",6,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},{tags:["image","flux","photorealistic","high-quality"]}),tt("fal-flux-pro","FLUX Pro","Fast, high-quality image generation. Good balance of speed and quality.","fal-ai/flux-pro/v1.1","image",4,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},{tags:["image","flux","fast"],buildBody:Ip}),tt("fal-flux-dev","FLUX Dev","Open-source image generation. Cheaper, good for experimentation.","fal-ai/flux/dev","image",3,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["image","flux","open-source","cheap"],buildBody:Ip}),tt("fal-flux-schnell","FLUX Schnell","Fastest image generation. Ultra-cheap, great for drafts and iteration.","fal-ai/flux/schnell","image",1,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["image","flux","fast","cheap","draft"],buildBody:Ip}),tt("fal-recraft-v3","Recraft V3","Design-focused image generation. Great for illustrations, icons, and graphic design.","fal-ai/recraft/v3/text-to-image","image",5,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},style:{type:"string",description:"Style preset: realistic_image, digital_illustration, vector_illustration, icon"}},required:["prompt"]},{tags:["image","design","illustration","icon","vector"]}),tt("fal-ideogram-v2","Ideogram V2","Excellent text rendering in images. Best for logos, posters, and text-heavy visuals.","fal-ai/ideogram/v2","image",8,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"1:1"}},required:["prompt"]},{tags:["image","text-rendering","logo","poster","typography"]}),tt("fal-ideogram-v2-turbo","Ideogram V2 Turbo","Fast text rendering in images. Good balance of speed and text accuracy.","fal-ai/ideogram/v2/turbo","image",5,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"1:1"}},required:["prompt"]},{tags:["image","text-rendering","fast"]}),tt("fal-fast-sdxl","Fast SDXL","Ultra-fast Stable Diffusion. 4-step inference, cheapest option.","fal-ai/fast-sdxl","image",1,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"}},required:["prompt"]},{tags:["image","stable-diffusion","fast","cheap"]}),tt("fal-wan-video","Wan Video","Text-to-video generation. Create short video clips from text descriptions.","fal-ai/wan/v2.1/1.3b/text-to-video","video",10,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"},num_frames:{type:"number",description:"Number of frames (default: 81)"}},required:["prompt"]},{tags:["video","text-to-video","wan"]}),tt("fal-minimax-video","MiniMax Video","High-quality video generation with excellent motion and coherence.","fal-ai/minimax-video/video-01-live","video",15,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"}},required:["prompt"]},{tags:["video","text-to-video","high-quality"]}),tt("fal-kling-video","Kling Video","Professional video generation with cinematic quality.","fal-ai/kling-video/v2/master/text-to-video","video",20,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"},duration:{type:"string",description:"Duration: 5 or 10 seconds",default:"5"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["video","text-to-video","cinematic","professional"]}),tt("fal-kling-i2v","Kling Image-to-Video","Animate a still image into a 5\u201310s video clip. Cinematic motion quality.","fal-ai/kling-video/v1.6/standard/image-to-video","video",35,{type:"object",properties:{image_url:{type:"string",description:"URL of the source image (jpg, png, webp, gif, avif)"},prompt:{type:"string",description:"Text description of the motion to animate"},duration:{type:"string",description:"Duration: 5 or 10 seconds",default:"5"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 9:16, 1:1)",default:"16:9"},negative_prompt:{type:"string",description:"Elements to avoid in the generated motion"},cfg_scale:{type:"number",description:"Classifier-free guidance (default 0.5)",default:.5}},required:["image_url","prompt"]},{tags:["video","image-to-video","kling","cinematic"]}),tt("fal-stable-audio","Stable Audio","Generate music and sound effects from text descriptions.","fal-ai/stable-audio","audio",4,{type:"object",properties:{prompt:{type:"string",description:"Description of the audio to generate"},seconds_total:{type:"number",description:"Duration in seconds (max 47)",default:30}},required:["prompt"]},{tags:["audio","music","sound-effects"]}),tt("suno-music","Suno Music","AI music generation. Create full songs with vocals or instrumentals.","suno/v4","audio",10,{type:"object",properties:{prompt:{type:"string",description:"Description of the song (genre, mood, instruments)"},instrumental:{type:"boolean",description:"Instrumental only, no vocals",default:!1}},required:["prompt"]},{tags:["music","song","vocals","instrumental"],merchantName:"Suno AI",isAsync:!0,pollUrl:`${xv}/suno/v4/requests/{requestId}/status`}),tt("fal-trellis-3d","Trellis 3D","Generate 3D models from images. Upload a photo, get a 3D asset.","fal-ai/trellis","3d",8,{type:"object",properties:{image_url:{type:"string",description:"URL of the image to convert to 3D"}},required:["image_url"]},{tags:["3d","model","image-to-3d"]}),tt("fal-aura-sr","Aura SR","Upscale images to higher resolution. 4x upscaling with detail enhancement.","fal-ai/aura-sr","upscale",3,{type:"object",properties:{image_url:{type:"string",description:"URL of the image to upscale"}},required:["image_url"]},{tags:["upscale","super-resolution","enhance"]}),tt("fal-metavoice","MetaVoice Voice Cloning","Voice cloning TTS \u2014 clone any voice from an audio sample. Provide text and a voice sample URL.","fal-ai/metavoice-v1","tts",3,{type:"object",properties:{text:{type:"string",description:"Text to convert to speech"},audio_url:{type:"string",description:"URL of the voice sample to clone"}},required:["text","audio_url"]},{tags:["tts","voice","voice-cloning","speech"]}),tt("fal-whisper","Whisper Transcription","Transcribe audio to text. Supports multiple languages.","fal-ai/whisper","transcription",2,{type:"object",properties:{audio_url:{type:"string",description:"URL of the audio to transcribe"},language:{type:"string",description:"Language code (e.g. en, es, fr)"}},required:["audio_url"]},{tags:["transcription","speech-to-text","whisper"]}),Ut("or-gpt-4o","GPT-4o","OpenAI's flagship multimodal model. Best for complex reasoning and analysis.","openai/gpt-4o",2.5,10,{tags:["llm","gpt","openai","multimodal","reasoning"]}),Ut("or-gpt-4o-mini","GPT-4o Mini","Fast, affordable GPT-4o. Great for everyday tasks, chat, and simple analysis.","openai/gpt-4o-mini",.15,.6,{tags:["llm","gpt","openai","fast","cheap"]}),Ut("or-claude-opus","Claude Opus 4.7","Anthropic's most capable model. 1M context, reasoning, best for complex tasks.","anthropic/claude-opus-4.7",15,75,{tags:["llm","claude","anthropic","reasoning","coding"]}),Ut("or-claude-sonnet","Claude Sonnet 4.6","Anthropic's best balance of intelligence and speed. Excellent for coding and analysis.","anthropic/claude-sonnet-4.6",3,15,{tags:["llm","claude","anthropic","coding","analysis"]}),Ut("or-claude-opus-fast","Claude Opus 4.6 Fast","Fast Opus variant with lower latency.","anthropic/claude-opus-4.6-fast",15,75,{tags:["llm","claude","anthropic","fast"]}),Ut("or-claude-haiku","Claude 3.5 Haiku","Anthropic's fastest model. Great for quick tasks, chat, and simple reasoning.","anthropic/claude-3.5-haiku",.8,4,{tags:["llm","claude","anthropic","fast"]}),Ut("or-gemini-pro","Gemini 2.0 Flash","Google's fast multimodal model. Good for general tasks with long context.","google/gemini-2.0-flash-001",.1,.4,{tags:["llm","gemini","google","multimodal","fast","cheap"]}),Ut("or-llama-70b","Llama 3.3 70B","Meta's best open model. Strong reasoning, fully open-source.","meta-llama/llama-3.3-70b-instruct",.3,.4,{tags:["llm","llama","meta","open-source","reasoning"]}),Ut("or-llama-8b","Llama 3.1 8B","Fast, lightweight open model. Great for simple tasks at minimal cost.","meta-llama/llama-3.1-8b-instruct",.05,.08,{tags:["llm","llama","meta","open-source","fast","cheap"]}),Ut("or-mistral-large","Mistral Large","Mistral's flagship model. Strong at multilingual and European languages.","mistralai/mistral-large-2411",2,6,{tags:["llm","mistral","multilingual","european"]}),Ut("or-mistral-small","Mistral Small","Fast, efficient Mistral model. Good for everyday tasks.","mistralai/mistral-small-3.1-24b-instruct",.1,.3,{tags:["llm","mistral","fast","cheap"]}),Ut("or-deepseek-chat","DeepSeek Chat V3","Strong reasoning model at very low cost. Excellent for coding and math.","deepseek/deepseek-chat-v3-0324",.3,.88,{tags:["llm","deepseek","coding","math","cheap","reasoning"]}),Ut("or-deepseek-r1","DeepSeek R1","Advanced reasoning model with chain-of-thought. Best for complex problems.","deepseek/deepseek-r1",.55,2.19,{tags:["llm","deepseek","reasoning","chain-of-thought","math"]}),Ut("or-qwen-72b","Qwen 2.5 72B","Alibaba's large model. Strong at coding, math, and multilingual tasks.","qwen/qwen-2.5-72b-instruct",.3,.4,{tags:["llm","qwen","alibaba","coding","multilingual"]}),Ut("or-phi-4","Phi-4","Microsoft's compact reasoning model. Punches above its weight for size.","microsoft/phi-4",.07,.14,{tags:["llm","phi","microsoft","compact","cheap","reasoning"]}),Ut("or-perplexity-sonar","Perplexity Sonar","Search-augmented LLM. Answers with real-time web sources and citations.","perplexity/sonar",1,1,{tags:["llm","perplexity","search","web","citations","real-time"]}),{dispatch:"enveloped",id:"generate_image_card",name:"Generate Image (Ultra)",description:"Generate a high-quality AI image (FLUX Pro Ultra, 2K, ~$0.06).",provider:"fal",model:"fal-ai/flux-pro/v1.1-ultra",category:"image",priceCents:6,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Text description of the image"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux-pro/v1.1-ultra",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),e},tags:["image","flux","ultra","legacy"]},{dispatch:"enveloped",id:"generate_image_fast_card",name:"Generate Image (Fast)",description:"Generate an AI image (FLUX Pro v1.1, 1K, ~$0.04).",provider:"fal",model:"fal-ai/flux-pro/v1.1",category:"image",priceCents:4,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Text description of the image"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux-pro/v1.1",merchantName:"fal.ai",buildBody:t=>Ip({prompt:t.prompt,aspect_ratio:t.aspect_ratio}),tags:["image","flux","legacy"]},{dispatch:"enveloped",id:"generate_image_schnell_card",name:"Generate Image (Cheap)",description:"Cheap, fast FLUX image generation (~$0.01).",provider:"fal",model:"fal-ai/flux/schnell",category:"image",priceCents:1,inputSchema:{type:"object",properties:{prompt:{type:"string"},image_size:{type:"string"},num_inference_steps:{type:"number"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux/schnell",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.image_size&&(e.image_size=t.image_size),t.num_inference_steps!==void 0&&(e.num_inference_steps=t.num_inference_steps),t.seed!==void 0&&(e.seed=t.seed),e},tags:["image","flux","schnell","legacy"]},{dispatch:"enveloped",id:"generate_image_recraft_card",name:"Generate Image (Recraft)",description:"Recraft V3 image generation with style control.",provider:"fal",model:"fal-ai/recraft-v3",category:"image",priceCents:5,inputSchema:{type:"object",properties:{prompt:{type:"string"},style:{type:"string"},image_size:{type:"string"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/recraft-v3",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.style&&(e.style=t.style),t.image_size&&(e.image_size=t.image_size),e},tags:["image","recraft","legacy"]},{dispatch:"enveloped",id:"generate_image_ideogram_card",name:"Generate Image (Ideogram)",description:"Ideogram V2 image generation, strong with text rendering.",provider:"fal",model:"fal-ai/ideogram/v2",category:"image",priceCents:8,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},style_type:{type:"string"},negative_prompt:{type:"string"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/ideogram/v2",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.style_type&&(e.style_type=t.style_type),t.negative_prompt&&(e.negative_prompt=t.negative_prompt),e},tags:["image","ideogram","text","legacy"]},tt("upscale_image_card","Upscale Image","Upscale an image using ESRGAN.","fal-ai/esrgan","upscale",2,{type:"object",properties:{image_url:{type:"string"},scale:{type:"number"}},required:["image_url"]},{buildBody:t=>{let e={image_url:t.image_url};return t.scale!==void 0&&(e.scale=t.scale),e},tags:["upscale","esrgan"]}),tt("edit_image_seed_card","Edit Image (SeedEdit)","Inpaint/edit an image with a prompt using SeedEdit.","fal-ai/bytedance/seededit","image",5,{type:"object",properties:{image_url:{type:"string"},prompt:{type:"string"},seed:{type:"number"}},required:["image_url","prompt"]},{buildBody:t=>{let e={image_url:t.image_url,prompt:t.prompt};return t.seed!==void 0&&(e.seed=t.seed),e},tags:["image","edit","inpaint","seededit"]}),{dispatch:"enveloped",id:"generate_video_tempo_card",name:"Generate Video (Grok)",description:"Generate a video from a text prompt using Grok Imagine Video.",provider:"fal",model:"xai/grok-imagine-video/text-to-video",category:"video",priceCents:30,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},duration:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/xai/grok-imagine-video/text-to-video",merchantName:"Grok Video via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.duration&&(e.duration=t.duration),e},tags:["video","grok","legacy"]},{dispatch:"enveloped",id:"generate_video_kling_card",name:"Generate Video (Kling)",description:"Generate a video using Kling v1.6 (async, ~$0.40).",provider:"fal",model:"fal-ai/kling-video/v1.6/standard/text-to-video",category:"video",priceCents:40,inputSchema:{type:"object",properties:{prompt:{type:"string"},negative_prompt:{type:"string"},aspect_ratio:{type:"string"},duration:{type:"number"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/kling-video/v1.6/standard/text-to-video",merchantName:"Kling via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.duration&&(e.duration=t.duration),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","kling","legacy"]},{dispatch:"enveloped",id:"generate_video_wan_card",name:"Generate Video (Wan)",description:"Generate a video using Wan T2V (async, ~$0.25).",provider:"fal",model:"fal-ai/wan/t2v-1.3b",category:"video",priceCents:25,inputSchema:{type:"object",properties:{prompt:{type:"string"},negative_prompt:{type:"string"},aspect_ratio:{type:"string"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/wan/t2v-1.3b",merchantName:"Wan T2V via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","wan","legacy"]},{dispatch:"enveloped",id:"generate_video_minimax_card",name:"Generate Video (MiniMax)",description:"Generate a video using MiniMax (async, ~$0.35).",provider:"fal",model:"fal-ai/minimax/video-01",category:"video",priceCents:35,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/minimax/video-01",merchantName:"MiniMax via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","minimax","legacy"]},{dispatch:"enveloped",id:"check_fal_status_card",name:"Check fal Async Job Status",description:"Poll an async fal.ai queue job for completion.",provider:"fal",model:"queue-status",category:"image",priceCents:0,inputSchema:{type:"object",properties:{model_path:{type:"string",description:"Model path (e.g. fal-ai/kling-video/v1.6/standard/text-to-video)"},request_id:{type:"string"}},required:["model_path","request_id"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue",merchantName:"fal.ai",buildUrl:t=>`https://fal.mpp.tempo.xyz/queue/${t.model_path}/requests/${t.request_id}`,buildBody:()=>({}),tags:["status","fal","async","legacy"]},{dispatch:"enveloped",id:"generate_3d_card",name:"Generate 3D Model",description:"Generate a 3D mesh from a text prompt using Meshy (async, ~$0.50).",provider:"fal",model:"fal-ai/meshy-ai/text-to-3d",category:"3d",priceCents:50,inputSchema:{type:"object",properties:{object_prompt:{type:"string"},style_prompt:{type:"string"},negative_prompt:{type:"string"},art_style:{type:"string"},seed:{type:"number"}},required:["object_prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/meshy-ai/text-to-3d",merchantName:"Meshy via fal.ai",buildBody:t=>{let e={object_prompt:t.object_prompt};return t.style_prompt&&(e.style_prompt=t.style_prompt),t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.art_style&&(e.art_style=t.art_style),t.seed!==void 0&&(e.seed=t.seed),e},tags:["3d","mesh","meshy","legacy"]},{dispatch:"enveloped",id:"generate_speech_card",name:"Generate Speech",description:"Text-to-speech using F5-TTS with optional voice cloning.",provider:"fal",model:"fal-ai/f5-tts",category:"tts",priceCents:3,inputSchema:{type:"object",properties:{gen_text:{type:"string",description:"Text to synthesize"},ref_audio_url:{type:"string",description:"Reference audio URL (for voice cloning)"},ref_text:{type:"string",description:"Transcription of ref audio"},remove_silence:{type:"boolean"}},required:["gen_text"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/f5-tts",merchantName:"fal.ai",buildBody:t=>{let e={gen_text:t.gen_text};return t.ref_audio_url&&(e.ref_audio_url=t.ref_audio_url),t.ref_text&&(e.ref_text=t.ref_text),t.remove_silence!==void 0&&(e.remove_silence=t.remove_silence),e},tags:["tts","speech","f5-tts","legacy"]},{dispatch:"enveloped",id:"generate_music_tempo_card",name:"Generate Music (Suno)",description:"Generate a music track using Suno (async, ~$0.50).",provider:"suno",model:"suno-v4",category:"audio",priceCents:50,inputSchema:{type:"object",properties:{prompt:{type:"string"},instrumental:{type:"boolean"},model:{type:"string",default:"V4"}},required:["prompt"]},gatewayUrl:"https://suno.mpp.paywithlocus.com/suno/generate-music",merchantName:"Suno via Tempo",buildBody:t=>({prompt:t.prompt,customMode:!1,instrumental:t.instrumental??!1,model:t.model||"V4"}),isAsync:!0,pollUrl:"https://suno.mpp.paywithlocus.com/suno/get-music-status",pollInterval:15e3,pollTimeout:3e5,tags:["music","audio","suno","async","legacy"]},{dispatch:"enveloped",id:"check_music_status_tempo_card",name:"Check Music Status",description:"Poll a Suno music generation task for completion.",provider:"suno",model:"suno-status",category:"audio",priceCents:0,inputSchema:{type:"object",properties:{taskId:{type:"string"}},required:["taskId"]},gatewayUrl:"https://suno.mpp.paywithlocus.com/suno/get-music-status",merchantName:"Suno Status",buildBody:t=>({taskId:t.taskId}),tags:["music","status","suno","legacy"]},{dispatch:"enveloped",id:"query_onchain_prices_card",name:"Query On-Chain Prices",description:"Query real-time or historical on-chain token prices via Allium. Use this for current prices, price history over any date range, price trends, comparisons between time periods, and analytics like monthly/weekly price charts. Supports hourly, daily, and weekly granularity.",provider:"allium",model:"allium-prices",category:"llm",priceCents:1,inputSchema:{type:"object",properties:{chain:{type:"string",description:"Chain name (e.g. ethereum, solana, base, polygon)"},token_address:{type:"string",description:"Token contract address. Use the native token address for chain-native assets (e.g. ETH, SOL)."},start_timestamp:{type:"string",description:"ISO 8601 timestamp for historical range start (e.g. '2024-01-01T00:00:00Z'). Omit for current price only."},end_timestamp:{type:"string",description:"ISO 8601 timestamp for historical range end. Defaults to now if start_timestamp is set."},time_granularity:{type:"string",description:"Data resolution: '1h' (hourly), '1d' (daily), or '1w' (weekly). Auto-selected based on date range if omitted."}},required:["chain","token_address"]},gatewayUrl:"https://agents.allium.so/api/v1/developer/prices",merchantName:"Allium",buildUrl:t=>t.start_timestamp?"https://agents.allium.so/api/v1/developer/prices/history":"https://agents.allium.so/api/v1/developer/prices",buildBody:t=>{let e={chain:t.chain,token_address:t.token_address};if(t.start_timestamp){let n=t.end_timestamp||new Date().toISOString(),r=t.time_granularity;if(!r){let o=new Date(t.start_timestamp).getTime();(new Date(n).getTime()-o)/(1e3*60*60*24)<=2?r="1h":r="1d"}return{addresses:[e],start_timestamp:t.start_timestamp,end_timestamp:n,time_granularity:r}}return[e]},tags:["onchain","prices","allium","crypto","legacy"]}];var Uv=1,wv=["pick_one","fan_out"],kv=["concat","dedupe_by_url","top_k_by_score"],i7=8,a7=y.object({type:y.string().min(1),description:y.string().min(1),enum:y.array(y.string()).optional(),default:y.unknown().optional(),minimum:y.number().optional(),maximum:y.number().optional()}),c7=y.object({toolId:y.string().min(1),notes:y.string().min(1)}),u7=y.object({providers:y.array(y.string().min(1)).min(1).max(i7),merge:y.enum(kv),maxResults:y.number().int().positive().optional()}),Vv=y.object({mode:y.enum(wv).default("pick_one"),intro:y.string().min(1),defaultTier:y.string().min(1),tiers:y.record(y.string(),c7).refine(t=>Object.keys(t).length>0,{message:"must have at least one tier"}),fanOut:u7.optional(),guidance:y.string().min(1),inputProperties:y.record(y.string(),a7),required:y.array(y.string())}).refine(t=>t.tiers[t.defaultTier]!==void 0,{message:"defaultTier must exist in tiers",path:["defaultTier"]}).refine(t=>t.mode!=="fan_out"||t.fanOut!==void 0,{message:"fan_out mode requires fanOut config",path:["fanOut"]}).refine(t=>t.required.every(e=>e in t.inputProperties),{message:"required entries must exist in inputProperties",path:["required"]}),l7=y.object({version:y.literal(Uv),generatedAt:y.string().datetime(),tools:y.record(y.string().regex(UT,"tool name must match MCP naming rules"),Vv).refine(t=>Object.keys(t).length>0,{message:"manifest must have at least one tool"})});var Bv=require("os"),wT=require("path"),f7=(0,wT.join)((0,Bv.homedir)(),".visa-mcp"),sHe=(0,wT.join)(f7,"mcp-session-budget.json");var aHe=Promise.resolve();var gHe=Promise.resolve();var T7=v(ET());var QHe=Promise.resolve();var tFe=new nr(()=>Ne.getSessionToken());var nFe=["","","You're ready to go! Try:","","Core:",'\u2022 "Show my account status" \u2192 get_status','\u2022 "List my enrolled cards" \u2192 get_cards','\u2022 "Show my paid tool use history" \u2192 transaction_history','\u2022 "Set my daily limit to $50" \u2192 update_spending_controls','\u2022 "Generate 3 variations in parallel" \u2192 batch',"","Category tools:",'\u2022 "Generate an image of a sunset over Tokyo" \u2192 generate_image','\u2022 "Make a 4-second video of a penguin juggling" \u2192 generate_video','\u2022 "Make a song about coding late at night" \u2192 generate_music','\u2022 "Create a sound effect for a checkout chime" \u2192 generate_audio','\u2022 "Create a 3D asset from this product sketch" \u2192 generate_3d','\u2022 "Upscale this product image" \u2192 upscale_image','\u2022 "Transcribe this meeting recording" \u2192 transcribe_audio','\u2022 "Run a reasoning model on this prompt" \u2192 run_llm',"","Tool catalog:",'\u2022 "Find an image upscaler" \u2192 discover_tools','\u2022 "Run fal-aura-sr on this URL" \u2192 execute_tool'].join(`
113
- `);var rFe=16*1024,oFe=50*1024*1024;var g7=["generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card"],aFe=[...g7.map(t=>({id:`legacy.${t}`,match:{kind:"exact_tool",toolId:t},targetToolId:t,rail:"tempo",reason:"Preserve legacy Tempo _card target while the top-level MCP surface is opt-in."}))];var R7={generate_image:{intro:"Generate an AI image.",tiers:{balanced:{toolId:"fal-flux-pro",notes:"FLUX Pro v1.1, 1K, ~10s (DEFAULT \u2014 good quality/speed tradeoff)"},fast:{toolId:"fal-flux-schnell",notes:"FLUX Schnell, 1K, ~3s (drafts, iteration, cheapest)"},pro:{toolId:"fal-flux-pro-ultra",notes:"FLUX Pro Ultra, 2K, ~30s (hero images, detail)"},text_heavy:{toolId:"fal-ideogram-v2",notes:"Ideogram V2 \u2014 best when the image contains rendered text/logos"},vector:{toolId:"fal-recraft-v3",notes:"Recraft V3 \u2014 vector/flat/illustration styles"}},guidance:"If the user didn't specify a tier, pick 'balanced' unless the prompt clearly signals otherwise (text \u2192 text_heavy, logo/icon \u2192 vector, quick test \u2192 fast, hero/print \u2192 pro).",inputProperties:{prompt:{type:"string",description:"Text description of the image to generate."},aspect_ratio:{type:"string",description:'Aspect ratio, e.g. "16:9", "1:1", "9:16".',default:"16:9"}},required:["prompt"]},generate_video:{intro:"Generate an AI video from a text prompt.",tiers:{balanced:{toolId:"fal-minimax-video",notes:"MiniMax \u2014 good quality/price balance (DEFAULT)"},fast:{toolId:"fal-wan-video",notes:"Wan \u2014 cheapest, shorter clips"},pro:{toolId:"fal-kling-video",notes:"Kling \u2014 highest quality, cinematic"}},guidance:"Show the tier menu with prices unless the user specified one. Videos take 60-180s to generate and are processed asynchronously. The response includes a request_id and model_path. Call check_fal_status_card with those values to poll for completion. Do not poll more than once per 30 seconds.",inputProperties:{prompt:{type:"string",description:"Text description of the video scene."},aspect_ratio:{type:"string",description:'Aspect ratio, e.g. "16:9" or "9:16".',default:"16:9"}},required:["prompt"]},generate_music:{intro:"Generate an original music track from a prompt.",tiers:{suno:{toolId:"suno-music",notes:"Suno v4 \u2014 songs with vocals, lyrics, full arrangement"}},guidance:"Takes ~60-90s. Returns an audio URL the user can play.",inputProperties:{prompt:{type:"string",description:"Musical style / mood / lyrics hint."},instrumental:{type:"boolean",description:"True for instrumental (no vocals), false for vocal track.",default:!1}},required:["prompt"]},generate_audio:{intro:"Generate speech (voice cloning) or sound effects.",tiers:{tts:{toolId:"fal-metavoice",notes:"MetaVoice \u2014 voice cloning TTS (requires a voice sample URL)"},sfx:{toolId:"fal-stable-audio",notes:"Stable Audio \u2014 sound effects and ambient from a prompt"}},guidance:"For tts: provide text + audio_url (voice sample to clone). For sfx: provide prompt describing the sound.",inputProperties:{prompt:{type:"string",description:"Description of sound to generate (sfx tier)."},text:{type:"string",description:"Text to speak aloud (tts tier)."},audio_url:{type:"string",description:"URL of a voice sample to clone (tts tier, required for MetaVoice)."}},required:[]},generate_3d:{intro:"Generate a 3D model from an image.",tiers:{trellis:{toolId:"fal-trellis-3d",notes:"Trellis \u2014 image-to-3D, returns a GLB mesh URL"}},guidance:"Pass an image URL. Takes ~30-60s. Returns a downloadable 3D mesh URL.",inputProperties:{image_url:{type:"string",description:"URL of the image to convert to a 3D model."}},required:["image_url"]},upscale_image:{intro:"Upscale an image to higher resolution.",tiers:{aura:{toolId:"fal-aura-sr",notes:"Aura SR \u2014 default; preserves detail without hallucination"}},guidance:"Pass the existing image URL. Returns an upscaled version.",inputProperties:{image_url:{type:"string",description:"URL of the image to upscale."}},required:["image_url"]},transcribe_audio:{intro:"Transcribe speech in an audio/video URL to text.",tiers:{whisper:{toolId:"fal-whisper",notes:"OpenAI Whisper \u2014 fast, multilingual"}},guidance:"Pass the URL. Returns the transcript text.",inputProperties:{audio_url:{type:"string",description:"URL of the audio or video file to transcribe."}},required:["audio_url"]},run_llm:{intro:"Run a text prompt through an LLM (OpenRouter). Token-metered pricing is shown per model.",tiers:{fast:{toolId:"or-gpt-4o-mini",notes:"GPT-4o Mini. Fastest, cheapest, good general-purpose (DEFAULT)"},reasoning:{toolId:"or-claude-sonnet",notes:"Claude Sonnet. Strong reasoning, long-context. Warn user it is materially pricier than `fast`."},deep_reasoning:{toolId:"or-deepseek-r1",notes:"DeepSeek R1. Deep chain-of-thought reasoning, mid-range pricing."},search:{toolId:"or-perplexity-sonar",notes:"Perplexity Sonar. Search-augmented, web-grounded with citations."},open_source:{toolId:"or-llama-70b",notes:"Llama 3.3 70B. Open-source large model."},coding:{toolId:"or-deepseek-chat",notes:"DeepSeek Chat V3. Strong at code generation."}},guidance:"Pick based on the user's need: fast (most questions, cheapest), reasoning (complex analysis; warn user it is materially pricier than fast), search (questions about current events), coding (code generation), deep_reasoning (hard math/logic problems).",inputProperties:{prompt:{type:"string",description:"The user query."},system_prompt:{type:"string",description:"Optional system prompt to set model behavior."},max_tokens:{type:"number",description:"Maximum output tokens.",default:1024,minimum:1,maximum:8192},temperature:{type:"number",description:"Sampling temperature \u2014 0 is deterministic, higher is more creative.",default:.7,minimum:0,maximum:2}},required:["prompt"]}};var ku=Object.keys(R7);var y7=["get_status","add_card","pay","get_visa_smi","get_cards","remove_card","set_default_card","buy_credits","transaction_history","update_spending_controls","config_list","config_set","config_unset","biometric_status","biometric_on","biometric_off","reset","login","start_session","close_session","get_session_status","set_session_mode","generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card","feedback","suggest_meme_templates","batch","discover_tools","execute_tool"];function O7(){let t=new Set;for(let e of y7)t.add(e),t.add(e.replace(/-/g,"_")),t.add(e.replace(/_/g,"-"));for(let e of ku)t.add(e),t.add(e.replace(/-/g,"_")),t.add(e.replace(/_/g,"-"));return t}var AFe=O7();var kT=new Set(["generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card"]);var vFe=new Set(ku),IFe=new Set(["batch","buy_credits","execute_tool","get_visa_smi",...kT,...ku]);var _e=v(require("fs")),se=v(require("path")),Gv=v(require("os")),We=Gv.homedir(),N7=["Claude_","Anthropic.ClaudeDesktop_"],ba=class extends Error{constructor(n,r,o){super(v7(n,r,o));this.client=n;this.configPath=r;this.name="McpConfigAccessError"}client;configPath};function Hv(t){let e=t;return[e?.message,e?.stderr].filter(n=>typeof n=="string").join(`
114
- `)}function C7(t){let e=t;if(e?.code==="EPERM"||e?.code==="EACCES")return!0;let n=Hv(t).toLowerCase();return n.includes("operation not permitted")||n.includes("permission denied")}function v7(t,e,n){let r=e.replace(We,"~"),o=Hv(n).split(`
115
- `).find(Boolean),s=o?` (${o})`:"";return t.id==="codex"?`Could not update Codex MCP config at ${r}: filesystem access was denied${s}. In Codex, rerun with elevated filesystem access or run \`visa-cli install codex\` outside the sandbox.`:`Could not update ${t.displayName} MCP config at ${r}: filesystem access was denied${s}.`}function Vu(){return process.env.APPDATA||se.join(We,"AppData","Roaming")}function I7(){return process.env.LOCALAPPDATA||se.join(We,"AppData","Local")}function VT(t){return process.platform==="win32"?t.win32:t.posix}function Fv(){if(process.platform!=="win32")return;let t=se.join(I7(),"Packages");if(_e.existsSync(t))try{let e=_e.readdirSync(t,"utf-8");for(let n of N7){let r=e.filter(o=>o.startsWith(n)).sort()[0];if(r)return se.join(t,r,"LocalCache","Roaming","Claude")}}catch{return}}function $v(){if(process.platform==="win32"){let t=Fv();return t?se.join(t,"claude_desktop_config.json"):se.join(Vu(),"Claude","claude_desktop_config.json")}return se.join(We,"Library","Application Support","Claude","claude_desktop_config.json")}function jv(){if(process.platform!=="win32")return[se.join(We,"Library","Application Support","Claude")];let t=[se.join(Vu(),"Claude")],e=Fv();return e&&t.push(e),t}function Pp(t){return t.id==="claude-desktop"?$v():t.globalConfigPath}function P7(t){return t.id==="claude-desktop"?jv():t.detectPaths}var or=[{id:"claude",displayName:"Claude Code",globalConfigPath:se.join(We,".claude.json"),configKey:"mcpServers",detectPaths:[se.join(We,".claude.json")],postInstallHint:"Restart Claude Code or run /mcp to connect."},{id:"claude-desktop",displayName:"Claude Desktop",globalConfigPath:$v(),configKey:"mcpServers",detectPaths:jv(),postInstallHint:"Restart the Claude desktop app to connect."},{id:"cursor",displayName:"Cursor",globalConfigPath:se.join(We,".cursor","mcp.json"),configKey:"mcpServers",detectPaths:[se.join(We,".cursor")],postInstallHint:"Restart Cursor to connect."},{id:"windsurf",displayName:"Windsurf",globalConfigPath:se.join(We,".codeium","windsurf","mcp_config.json"),configKey:"mcpServers",detectPaths:[se.join(We,".codeium","windsurf")],postInstallHint:"Restart Windsurf to connect."},{id:"cline",displayName:"Cline",globalConfigPath:se.join(We,".vscode","mcp.json"),configKey:"mcpServers",detectPaths:[se.join(We,".vscode","extensions","saoudrizwan.claude-dev-*")],postInstallHint:"Restart VS Code to connect."},{id:"roo-code",displayName:"Roo Code",globalConfigPath:VT({win32:se.join(Vu(),"Roo","mcp_settings.json"),posix:se.join(We,".config","Roo","mcp_settings.json")}),configKey:"mcpServers",detectPaths:[se.join(We,".vscode","extensions","RooVeterinaryInc.roo-cline-*")],postInstallHint:"Restart VS Code to connect."},{id:"copilot",displayName:"VS Code Copilot",globalConfigPath:se.join(We,".vscode","mcp.json"),configKey:"servers",detectPaths:[se.join(We,".vscode")],postInstallHint:"Restart VS Code to connect."},{id:"zed",displayName:"Zed",globalConfigPath:VT({win32:se.join(Vu(),"Zed","settings.json"),posix:se.join(We,".config","zed","settings.json")}),configKey:"context_servers",detectPaths:VT({win32:[se.join(Vu(),"Zed")],posix:[se.join(We,".config","zed")]}),postInstallHint:"Restart Zed to connect.",buildEntry:t=>({source:"custom",...t})},{id:"codex",displayName:"Codex",globalConfigPath:se.join(We,".codex","config.toml"),configKey:"mcp_servers",configFormat:"toml",detectPaths:[se.join(We,".codex")],postInstallHint:"Restart Codex to connect. For the terminal HUD, run: visa-cli hud enable"}];function BT(t){return or.find(e=>e.id===t)}function Bu(t){return P7(t).some(e=>{if(e.includes("*")){let n=se.dirname(e),r=se.basename(e).replaceAll("*","");if(!_e.existsSync(n))return!1;try{return _e.readdirSync(n).some(o=>o.startsWith(r))}catch{return!1}}return _e.existsSync(e)})}function qv(){return{command:"node",args:[se.resolve(__dirname,"mcp-server/index.js")]}}function GT(t,e){return e==="project"?"json":t.configFormat??"json"}function b7(t){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;if(t.startsWith('"')&&t.endsWith('"'))return t.slice(1,-1);if(t.startsWith("[")&&t.endsWith("]")){let n=t.slice(1,-1).trim();return n.length===0?[]:n.split(",").map(r=>r.trim()).filter(Boolean).map(r=>r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):r)}let e=Number(t);return isNaN(e)?t:e}function HT(t,e){let n=`[mcp_servers.${e}]`,r=t.findIndex(s=>s.trim()===n);if(r===-1)return;let o=r+1;for(;o<t.length&&!t[o].trim().startsWith("[");)o++;return{start:r,end:o}}function FT(t,e){let n=t.split(`
116
- `),r=HT(n,e);if(!r)return;let o={};for(let s=r.start+1;s<r.end;s++){let i=n[s].trim().match(/^(\w+)\s*=\s*(.+)$/);i&&(o[i[1]]=b7(i[2]))}return Object.keys(o).length>0?o:void 0}function M7(t,e,n){let r=`[${n.args.map(c=>`"${c}"`).join(", ")}]`,o=[`[mcp_servers.${e}]`,`command = "${n.command}"`,`args = ${r}`],s=t.split(`
117
- `),i=HT(s,e);if(i){s.splice(i.start,i.end-i.start,...o);let c=s.join(`
108
+ `}function AT(t=Aa()){if(!t)return!1;try{let e=xu(t),n=Ae.readFileSync(e,"utf-8");return n.includes(Mu)||n.includes(ov)}catch{return!1}}function gp(t=Aa()){if(!t)return{installed:!1,changed:!1,shell:null,message:"Shell HUD auto-install skipped: supported shells are zsh, bash, and PowerShell."};let e;try{e=xu(t);let n=Ae.existsSync(e)?Ae.readFileSync(e,"utf-8"):"",r=xZ(n,t),o=r!==n;return o&&Ep(e,r),{installed:!0,changed:o,shell:t,rcPath:e,message:o?`Persistent shell HUD installed in ${e}. Open a new terminal to start seeing it. Disable it any time with: visa-cli shell-hud disable`:`Persistent shell HUD already installed in ${e}. Disable it any time with: visa-cli shell-hud disable`}}catch(n){return{installed:!1,changed:!1,shell:t,rcPath:e,message:`Failed to install persistent shell HUD in ${e}: ${gT(n)}`}}}function hp(t=Aa()){let e=[],n=[],r=[];try{for(let o of MZ(t))if(n.push(o.rcPath),!!Ae.existsSync(o.rcPath))try{let s=Ae.readFileSync(o.rcPath,"utf-8"),i=av(s);if(i===s.trimEnd())continue;Ep(o.rcPath,i.length>0?`${i}
109
+ `:""),e.push(o.rcPath)}catch(s){r.push(`${o.rcPath}: ${gT(s)}`)}return e.length>0?{removed:!0,shell:t,rcPath:e[0],rcPaths:e,message:r.length>0?`Removed persistent shell HUD from ${e.join(", ")}. Some rc files could not be updated: ${r.join("; ")}.`:`Removed persistent shell HUD from ${e.join(", ")}.`}:r.length>0?{removed:!1,shell:t,rcPath:n[0],rcPaths:n,message:`Failed to remove persistent shell HUD: ${r.join("; ")}`}:{removed:!0,shell:t,rcPath:n[0],rcPaths:n,message:"Persistent shell HUD was not installed in any supported shell rc file."}}catch(o){return{removed:!1,shell:t,message:`Failed to remove persistent shell HUD: ${gT(o)}`}}}function RT(t,e){let n=e??PZ,r=n.currentVersion==="0.0.0"&&t.version?t.version:n.currentVersion,o=ha(r),s=` ${Et("\u2502",ut.dim)} `,i=cv(n),a=wZ(n,i),c=a||n.updateCheckDisabled?"":i,u=UZ(o,c);if(!t.enrolled)return[u,Et("setup needed",ut.visaGold),a].filter(Boolean).join(s);let l=GZ(t),d=DZ(t);return[u,Et(l,ut.visaGold),d,a].filter(Boolean).join(s)}function DZ(t){let e=typeof t.balanceCents=="number"?t.balanceCents:null,n=t.activeSession;if(e===null)return Et("balance unknown",ut.dim);let r=e/100;if(n){let s=Math.max(0,n.capCents),i=Math.max(0,n.estimatedRemainingCents),a=Math.max(0,s-i),c=s>0?Math.max(0,Math.min(1,a/s)):0;return`${BZ(c)} ${Et(`${Ta(i/100)} in session`,ut.green)} ${Et(`(${Ta(a/100)}/${Ta(s/100)} cap)`,ut.dim)} ${Et("\xB7",ut.dim)} ${Et(`${Ta(r)} balance`,ut.dim)}`}return e>=100?Et(`${Ta(r)} balance`,ut.green):Et(`${Ta(r)} balance \u2014 top up via buy_credits`,ut.visaGold)}function UZ(t,e){let n=`${Et("VISA CLI",ut.visaBlue)} ${Et(`v${t}`,ut.visaBlueSoft)}`;return e?`${n} ${Et("\u2B06 update",ut.visaGold)} ${Et(`v${e}`,ut.visaGold)}`:n}function wZ(t,e){if(e&&!t.updateCheckDisabled){let n=ha(Ea(e));return Et(`run: ${n}`,ut.visaGold)}return e?null:kZ(t)}function cv(t){return t.latestVersion?ha(t.latestVersion):""}function kZ(t){let e=cv(t);return e?Et(`update ready v${e}`,ut.visaGold):null}function uv(){let t=NT();return!(!t||Date.now()-t.renderedAt>sv||t.cwd&&t.cwd!==process.cwd())}function yT(){let t=NT();if(t&&Date.now()-t.renderedAt<=sv||(VZ(),t?.line))return t.line;try{let e=Tp();if(Ae.existsSync(e))return Ae.readFileSync(e,"utf-8").trimEnd()}catch{}return IZ}function OT(t,e){try{let n=Le.dirname(ga());Ae.mkdirSync(n,{recursive:!0});let r=ha(t),o={hudVersion:CZ,renderedAt:Date.now(),line:r,cwd:process.cwd(),status:e};Ep(ga(),JSON.stringify(o)+`
110
+ `),Ep(Tp(),r+`
111
+ `)}catch{}}function Lu(){try{Ae.unlinkSync(iv())}catch{}}function NT(){let t=ga();if(!Ae.existsSync(t))return null;try{return JSON.parse(Ae.readFileSync(t,"utf-8"))}catch{return null}}function lv(){return NT()?.status??null}function VZ(){if(process.env.JEST_WORKER_ID)return;let t=iv();try{if(Ae.mkdirSync(Le.dirname(t),{recursive:!0}),!jZ(t))return;let e=process.argv[1]?Le.resolve(process.argv[1]):"";if(!e){Lu();return}let n=(0,rv.spawn)(process.execPath,[e,"shell-hud","refresh"],{detached:!0,stdio:"ignore",env:{...process.env,VISA_CLI_SHELL_HUD_BACKGROUND:"1"}});n.once("error",Lu),n.unref()}catch{Lu()}}function ha(t){return t.replace(/\u001B\][^\u0007]*(?:\u0007|\u001B\\)/g,"").replace(/\u001B\[[0-?]*[ -/]*[@-~]/g,"").replace(/\u001B[P_^][^\u001B]*(?:\u001B\\|\u0007)/g,"").replace(/[\u0000-\u0008\u000B-\u001F\u007F-\u009F]/g,"").replace(/\s+/g," ").trim()}function BZ(t){let n=Math.round(Math.max(0,Math.min(1,t))*10),r="\u2588".repeat(n),o="\u2591".repeat(10-n);return`${Et(r||"",ut.green)}${Et(o||"",ut.dim)}`}function Ta(t){return`$${t.toFixed(2)}`}function GZ(t){let e=t.cards?.find(a=>a.isDefault)??t.cards?.[0];if(!e)return"card none";let n=typeof e.brand=="string"?e.brand:"card",r=typeof e.last4=="string"?e.last4:"????",o=ha(n.toUpperCase()),s=ha(r);return`${e.isDefault?"default":"active"} ${o} ****${s}`}function HZ(){let t=(process.env.COLORTERM??"").toLowerCase();if(t==="truecolor"||t==="24bit")return!0;let e=(process.env.TERM??"").toLowerCase();return e.includes("truecolor")||e.includes("24bit")}var TT=HZ(),ut={reset:"\x1B[0m",visaBlue:TT?"\x1B[38;2;20;52;203m":"\x1B[38;5;27m",visaBlueSoft:TT?"\x1B[38;2;97;126;229m":"\x1B[38;5;111m",visaGold:TT?"\x1B[38;2;247;182;0m":"\x1B[38;5;220m",green:"\x1B[38;5;48m",dim:"\x1B[2m"};function Et(t,e){return t.length===0||process.env.NO_COLOR?t:`${e}${t}${ut.reset}`}function nv(t){return t.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function CT(){let t=Sp.homedir();if(!t||!Le.isAbsolute(t))throw new Error("unable to determine a valid home directory");return Le.resolve(t)}function FZ(t){return t==="powershell"?"& visa-cli shell-hud refresh":"visa-cli shell-hud refresh"}function $Z(t){return t==="powershell"?"Get-Command visa-cli -ErrorAction SilentlyContinue -CommandType Application":"command -v visa-cli >/dev/null 2>&1"}function jZ(t){for(let e=0;e<2;e+=1){let n;try{return n=Ae.openSync(t,"wx"),Ae.writeFileSync(n,String(Date.now())),!0}catch(r){if(r?.code!=="EEXIST")return!1;try{let o=Ae.statSync(t);if(Date.now()-o.mtimeMs<=bZ)return!1;Ae.unlinkSync(t)}catch{}}finally{n!==void 0&&Ae.closeSync(n)}}return!1}function gT(t){return t instanceof Error?t.message:"unknown file system error"}function Ep(t,e){Ae.mkdirSync(Le.dirname(t),{recursive:!0});let n=`${t}.${process.pid}.${Date.now()}.tmp`;Ae.writeFileSync(n,e),Ae.renameSync(n,t)}async function Ap(t,e){try{return await e()}catch(n){if(n.message==="Invalid signature"&&zt()){An.warn("attestation:key-mismatch",{action:"reregistering"});try{let r=await pp();await t.registerAttestationKey(r),An.info("attestation:key-reregistered")}catch(r){throw An.error("attestation:reregister-failure",{error:r.message}),n}return await e()}throw n}}function dv(t=process.env){let e=t.VISA_DRY_RUN;return e==="true"||e==="1"||e==="mock"?"mock":e==="preflight"?"preflight":null}function pv(t=process.env){return dv(t)!==null}var _v="2.0.0-rc.39";function vT(t,e){return e?{kind:"env",var:t}:{kind:"default"}}function Rp(t,e,n){let r=process.env[t];if(r!==void 0)return{value:n==="opt-in"?r==="true":r!=="false",source:{kind:"env",var:t}};let o=kC(e);return o!==void 0?{value:o,source:{kind:"settings"}}:{value:n!=="opt-in",source:{kind:"default"}}}function Rn(t){return t==null?"\u2014":t?"yes":"no"}function yp(t){return t==null?"\u2014":`$${t.toFixed(2)}`}function qZ(t){return t==null?"\u2014":`$${(t/100).toFixed(2)}`}function YZ(){let t=process.env.VISA_CREDIT_SESSION_CAP_CENTS;if(t!==void 0){let n=Number(t);if(Number.isFinite(n)&&n>=100&&n<=1e4)return{value:Math.floor(n),source:{kind:"env",var:"VISA_CREDIT_SESSION_CAP_CENTS"}}}let e=VC("credit.sessionCapCents");return e!==void 0&&e>=100&&e<=1e4?{value:Math.floor(e),source:{kind:"settings"}}:{value:wC,source:{kind:"default"}}}async function IT(t){let e=null,n=null;try{e=await t.api.getStatus()}catch(P){n=P?.message||"unknown error"}let r=[],o=process.env.VISA_AUTH_URL,s=cT("auth.serverUrl"),i=vr(),a=o!==void 0&&o!==""?{kind:"env",var:"VISA_AUTH_URL"}:s!==void 0?{kind:"settings"}:{kind:"default"};r.push({key:"auth.serverUrl",value:i,formatted:i,source:a,hint:a.kind==="default"?"Persist with `visa-cli config set auth.serverUrl <url>` (or set VISA_AUTH_URL for one-off overrides).":void 0}),r.push({key:"account.enrolled",value:e?.enrolled??null,formatted:Rn(e?.enrolled),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),e?.githubUser&&r.push({key:"account.githubUser",value:e.githubUser,formatted:e.githubUser,source:{kind:"server"}});let c=e?e.attestationRequired!==!1:void 0;r.push({key:"biometric.required",value:c,formatted:Rn(c),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"},hint:c===!1?"Touch ID prompts are suppressed. Re-enable with `visa-cli biometric on`.":void 0}),r.push({key:"biometric.keyRegistered",value:e?.hasAttestationKey??null,formatted:Rn(e?.hasAttestationKey),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"biometric.deviceAvailable",value:zt(),formatted:Rn(zt()),source:{kind:"device"}});let u=e?.spendingControls,l=u?u.max_transaction_amount??u.maxTransactionAmount??null:null,d=u?u.daily_limit??u.dailyLimit??null:null;r.push({key:"spending.maxPerTxn",value:l,formatted:yp(l),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailyLimit",value:d,formatted:yp(d),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailySpent",value:e?.dailySpent??null,formatted:yp(e?.dailySpent),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"spending.dailyRemaining",value:e?.dailyRemaining??null,formatted:yp(e?.dailyRemaining),source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}}),r.push({key:"cards.count",value:e?.cardCount??null,formatted:e?.cardCount!=null?String(e.cardCount):"\u2014",source:e?{kind:"server"}:{kind:"unknown",reason:n||"offline"}});let p=e?.cards?.find(P=>P.isDefault)??e?.cards?.[0];p&&r.push({key:"cards.default",value:{brand:p.brand??null,last4:p.last4},formatted:`${p.brand||"card"} \u2022\u2022\u2022\u2022 ${p.last4}`,source:{kind:"server"}});let _=YZ();r.push({key:"credit.sessionCapCents",value:_.value,formatted:qZ(_.value),source:_.source});let f=GC();f.length>0&&r.push({key:"settings.retired",value:f.map(P=>P.key),formatted:f.map(P=>P.key).join(", "),source:{kind:"settings"},hint:`Ignored retired settings found. Remove with: ${f.map(P=>`visa-cli config unset ${P.key}`).join(" && ")}`});let E=Rp("VISA_SUPPRESS_BROWSER","ui.suppressBrowser","opt-in");r.push({key:"ui.suppressBrowser",value:E.value,formatted:Rn(E.value),source:E.source,hint:"Persist with `visa-cli config set ui.suppressBrowser true` to stop auto-opening result URLs."});let S=Rp("VISA_SUPPRESS_FEED","ui.suppressFeed","opt-in");r.push({key:"ui.suppressFeed",value:S.value,formatted:Rn(S.value),source:S.source});let g=Cr(),h;process.env.VISA_CLI_NO_UPDATE_CHECK?h={kind:"env",var:"VISA_CLI_NO_UPDATE_CHECK"}:process.env.CI?h={kind:"env",var:"CI"}:process.env.NODE_ENV==="test"?h={kind:"env",var:"NODE_ENV"}:h={kind:"default"},r.push({key:"ui.updateCheck",value:!g,formatted:Rn(!g),source:h});let O=Rp("VISA_META_TOOLS","tools.meta","opt-out");r.push({key:"tools.meta",value:O.value,formatted:Rn(O.value),source:O.source,hint:"Persist with `visa-cli config set tools.meta false`. Restart Claude Code for changes to take effect."});let N=Rp("VISA_DISCOVER_TOOLS","tools.discover","opt-out");r.push({key:"tools.discover",value:N.value,formatted:Rn(N.value),source:N.source});let A=process.env.VISA_DRY_RUN,M=pv();if(r.push({key:"tools.dryRun",value:M,formatted:Rn(M),source:A===void 0?{kind:"default"}:{kind:"env",var:"VISA_DRY_RUN"},hint:"VISA_DRY_RUN=true|1|mock returns deterministic paid-tool fixtures (no card, no upstream). VISA_DRY_RUN=preflight makes a real zero-cost OpenRouter call for LLM tools (image/video still mocked)."}),r.push({key:"client.version",value:_v,formatted:_v,source:{kind:"default"}}),t.includeDev){let P=process.env.VISA_MOCK_KEYCHAIN;r.push({key:"dev.mockKeychain",value:P==="true",formatted:Rn(P==="true"),source:vT("VISA_MOCK_KEYCHAIN",!!P)});let J=process.env.VISA_MOCK_TOUCHID;r.push({key:"dev.mockTouchid",value:J==="true",formatted:Rn(J==="true"),source:vT("VISA_MOCK_TOUCHID",!!J)});let X=process.env.VISA_CLI_DEBUG;r.push({key:"dev.debug",value:!!X,formatted:Rn(!!X),source:vT("VISA_CLI_DEBUG",!!X)})}return{entries:r,statusError:n}}function KZ(t){switch(t.kind){case"default":return"default";case"env":return`env ${t.var}`;case"settings":return"settings.json";case"server":return"server";case"device":return"device";case"unset":return"unset";case"unknown":return`unknown (${t.reason})`}}function fv(t,e={}){if(t.length===0)return"";let n=Math.max(...t.map(s=>s.key.length)),r=Math.max(...t.map(s=>s.formatted.length)),o=[];for(let s of t){let i=s.key.padEnd(n+2),a=s.formatted.padEnd(r+2);o.push(`${i}${a}(${KZ(s.source)})`),e.verbose&&s.hint&&o.push(` ${"\u21B3".padStart(n)} ${s.hint}`)}return o.join(`
112
+ `)}function mv(t){return JSON.stringify({config:t.entries.map(e=>({key:e.key,value:e.value,source:e.source,hint:e.hint})),statusError:t.statusError},null,2)}var y={};Kd(y,{BRAND:()=>gQ,DIRTY:()=>oi,EMPTY_PATH:()=>JZ,INVALID:()=>Y,NEVER:()=>r7,OK:()=>Dt,ParseStatus:()=>vt,Schema:()=>ce,ZodAny:()=>Xo,ZodArray:()=>mo,ZodBigInt:()=>ii,ZodBoolean:()=>ai,ZodBranded:()=>Uu,ZodCatch:()=>Ti,ZodDate:()=>ci,ZodDefault:()=>Si,ZodDiscriminatedUnion:()=>Cp,ZodEffects:()=>wn,ZodEnum:()=>mi,ZodError:()=>ln,ZodFirstPartyTypeKind:()=>W,ZodFunction:()=>Ip,ZodIntersection:()=>pi,ZodIssueCode:()=>C,ZodLazy:()=>_i,ZodLiteral:()=>fi,ZodMap:()=>va,ZodNaN:()=>Pa,ZodNativeEnum:()=>Ei,ZodNever:()=>or,ZodNull:()=>li,ZodNullable:()=>Mr,ZodNumber:()=>si,ZodObject:()=>dn,ZodOptional:()=>Dn,ZodParsedType:()=>D,ZodPipeline:()=>wu,ZodPromise:()=>Jo,ZodReadonly:()=>gi,ZodRecord:()=>vp,ZodSchema:()=>ce,ZodSet:()=>Ia,ZodString:()=>zo,ZodSymbol:()=>Na,ZodTransformer:()=>wn,ZodTuple:()=>br,ZodType:()=>ce,ZodUndefined:()=>ui,ZodUnion:()=>di,ZodUnknown:()=>fo,ZodVoid:()=>Ca,addIssueToContext:()=>x,any:()=>IQ,array:()=>LQ,bigint:()=>yQ,boolean:()=>Cv,coerce:()=>n7,custom:()=>yv,date:()=>OQ,datetimeRegex:()=>Av,defaultErrorMap:()=>po,discriminatedUnion:()=>wQ,effect:()=>WQ,enum:()=>qQ,function:()=>FQ,getErrorMap:()=>Ra,getParsedType:()=>Pr,instanceof:()=>AQ,intersection:()=>kQ,isAborted:()=>Op,isAsync:()=>ya,isDirty:()=>Np,isValid:()=>Wo,late:()=>hQ,lazy:()=>$Q,literal:()=>jQ,makeIssue:()=>Du,map:()=>GQ,nan:()=>RQ,nativeEnum:()=>YQ,never:()=>bQ,null:()=>vQ,nullable:()=>XQ,number:()=>Nv,object:()=>xQ,objectUtil:()=>PT,oboolean:()=>t7,onumber:()=>e7,optional:()=>zQ,ostring:()=>QQ,pipeline:()=>ZQ,preprocess:()=>JQ,promise:()=>KQ,quotelessJson:()=>WZ,record:()=>BQ,set:()=>HQ,setErrorMap:()=>XZ,strictObject:()=>DQ,string:()=>Ov,symbol:()=>NQ,transformer:()=>WQ,tuple:()=>VQ,undefined:()=>CQ,union:()=>UQ,unknown:()=>PQ,util:()=>ue,void:()=>MQ});var ue;(function(t){t.assertEqual=o=>{};function e(o){}t.assertIs=e;function n(o){throw new Error}t.assertNever=n,t.arrayToEnum=o=>{let s={};for(let i of o)s[i]=i;return s},t.getValidEnumValues=o=>{let s=t.objectKeys(o).filter(a=>typeof o[o[a]]!="number"),i={};for(let a of s)i[a]=o[a];return t.objectValues(i)},t.objectValues=o=>t.objectKeys(o).map(function(s){return o[s]}),t.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let s=[];for(let i in o)Object.prototype.hasOwnProperty.call(o,i)&&s.push(i);return s},t.find=(o,s)=>{for(let i of o)if(s(i))return i},t.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&Number.isFinite(o)&&Math.floor(o)===o;function r(o,s=" | "){return o.map(i=>typeof i=="string"?`'${i}'`:i).join(s)}t.joinValues=r,t.jsonStringifyReplacer=(o,s)=>typeof s=="bigint"?s.toString():s})(ue||(ue={}));var PT;(function(t){t.mergeShapes=(e,n)=>({...e,...n})})(PT||(PT={}));var D=ue.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),Pr=t=>{switch(typeof t){case"undefined":return D.undefined;case"string":return D.string;case"number":return Number.isNaN(t)?D.nan:D.number;case"boolean":return D.boolean;case"function":return D.function;case"bigint":return D.bigint;case"symbol":return D.symbol;case"object":return Array.isArray(t)?D.array:t===null?D.null:t.then&&typeof t.then=="function"&&t.catch&&typeof t.catch=="function"?D.promise:typeof Map<"u"&&t instanceof Map?D.map:typeof Set<"u"&&t instanceof Set?D.set:typeof Date<"u"&&t instanceof Date?D.date:D.object;default:return D.unknown}};var C=ue.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),WZ=t=>JSON.stringify(t,null,2).replace(/"([^"]+)":/g,"$1:"),ln=class t extends Error{get errors(){return this.issues}constructor(e){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=e}format(e){let n=e||function(s){return s.message},r={_errors:[]},o=s=>{for(let i of s.issues)if(i.code==="invalid_union")i.unionErrors.map(o);else if(i.code==="invalid_return_type")o(i.returnTypeError);else if(i.code==="invalid_arguments")o(i.argumentsError);else if(i.path.length===0)r._errors.push(n(i));else{let a=r,c=0;for(;c<i.path.length;){let u=i.path[c];c===i.path.length-1?(a[u]=a[u]||{_errors:[]},a[u]._errors.push(n(i))):a[u]=a[u]||{_errors:[]},a=a[u],c++}}};return o(this),r}static assert(e){if(!(e instanceof t))throw new Error(`Not a ZodError: ${e}`)}toString(){return this.message}get message(){return JSON.stringify(this.issues,ue.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(e=n=>n.message){let n={},r=[];for(let o of this.issues)if(o.path.length>0){let s=o.path[0];n[s]=n[s]||[],n[s].push(e(o))}else r.push(e(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};ln.create=t=>new ln(t);var zZ=(t,e)=>{let n;switch(t.code){case C.invalid_type:t.received===D.undefined?n="Required":n=`Expected ${t.expected}, received ${t.received}`;break;case C.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(t.expected,ue.jsonStringifyReplacer)}`;break;case C.unrecognized_keys:n=`Unrecognized key(s) in object: ${ue.joinValues(t.keys,", ")}`;break;case C.invalid_union:n="Invalid input";break;case C.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${ue.joinValues(t.options)}`;break;case C.invalid_enum_value:n=`Invalid enum value. Expected ${ue.joinValues(t.options)}, received '${t.received}'`;break;case C.invalid_arguments:n="Invalid function arguments";break;case C.invalid_return_type:n="Invalid function return type";break;case C.invalid_date:n="Invalid date";break;case C.invalid_string:typeof t.validation=="object"?"includes"in t.validation?(n=`Invalid input: must include "${t.validation.includes}"`,typeof t.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${t.validation.position}`)):"startsWith"in t.validation?n=`Invalid input: must start with "${t.validation.startsWith}"`:"endsWith"in t.validation?n=`Invalid input: must end with "${t.validation.endsWith}"`:ue.assertNever(t.validation):t.validation!=="regex"?n=`Invalid ${t.validation}`:n="Invalid";break;case C.too_small:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at least":"more than"} ${t.minimum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at least":"over"} ${t.minimum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="bigint"?n=`Number must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${t.minimum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly equal to ":t.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(t.minimum))}`:n="Invalid input";break;case C.too_big:t.type==="array"?n=`Array must contain ${t.exact?"exactly":t.inclusive?"at most":"less than"} ${t.maximum} element(s)`:t.type==="string"?n=`String must contain ${t.exact?"exactly":t.inclusive?"at most":"under"} ${t.maximum} character(s)`:t.type==="number"?n=`Number must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="bigint"?n=`BigInt must be ${t.exact?"exactly":t.inclusive?"less than or equal to":"less than"} ${t.maximum}`:t.type==="date"?n=`Date must be ${t.exact?"exactly":t.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(t.maximum))}`:n="Invalid input";break;case C.custom:n="Invalid input";break;case C.invalid_intersection_types:n="Intersection results could not be merged";break;case C.not_multiple_of:n=`Number must be a multiple of ${t.multipleOf}`;break;case C.not_finite:n="Number must be finite";break;default:n=e.defaultError,ue.assertNever(t)}return{message:n}},po=zZ;var Ev=po;function XZ(t){Ev=t}function Ra(){return Ev}var Du=t=>{let{data:e,path:n,errorMaps:r,issueData:o}=t,s=[...n,...o.path||[]],i={...o,path:s};if(o.message!==void 0)return{...o,path:s,message:o.message};let a="",c=r.filter(u=>!!u).slice().reverse();for(let u of c)a=u(i,{data:e,defaultError:a}).message;return{...o,path:s,message:a}},JZ=[];function x(t,e){let n=Ra(),r=Du({issueData:e,data:t.data,path:t.path,errorMaps:[t.common.contextualErrorMap,t.schemaErrorMap,n,n===po?void 0:po].filter(o=>!!o)});t.common.issues.push(r)}var vt=class t{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(e,n){let r=[];for(let o of n){if(o.status==="aborted")return Y;o.status==="dirty"&&e.dirty(),r.push(o.value)}return{status:e.value,value:r}}static async mergeObjectAsync(e,n){let r=[];for(let o of n){let s=await o.key,i=await o.value;r.push({key:s,value:i})}return t.mergeObjectSync(e,r)}static mergeObjectSync(e,n){let r={};for(let o of n){let{key:s,value:i}=o;if(s.status==="aborted"||i.status==="aborted")return Y;s.status==="dirty"&&e.dirty(),i.status==="dirty"&&e.dirty(),s.value!=="__proto__"&&(typeof i.value<"u"||o.alwaysSet)&&(r[s.value]=i.value)}return{status:e.value,value:r}}},Y=Object.freeze({status:"aborted"}),oi=t=>({status:"dirty",value:t}),Dt=t=>({status:"valid",value:t}),Op=t=>t.status==="aborted",Np=t=>t.status==="dirty",Wo=t=>t.status==="valid",ya=t=>typeof Promise<"u"&&t instanceof Promise;var G;(function(t){t.errToObj=e=>typeof e=="string"?{message:e}:e||{},t.toString=e=>typeof e=="string"?e:e?.message})(G||(G={}));var Un=class{constructor(e,n,r,o){this._cachedPath=[],this.parent=e,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(Array.isArray(this._key)?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},Sv=(t,e)=>{if(Wo(e))return{success:!0,data:e.value};if(!t.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new ln(t.common.issues);return this._error=n,this._error}}};function te(t){if(!t)return{};let{errorMap:e,invalid_type_error:n,required_error:r,description:o}=t;if(e&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return e?{errorMap:e,description:o}:{errorMap:(i,a)=>{let{message:c}=t;return i.code==="invalid_enum_value"?{message:c??a.defaultError}:typeof a.data>"u"?{message:c??r??a.defaultError}:i.code!=="invalid_type"?{message:a.defaultError}:{message:c??n??a.defaultError}},description:o}}var ce=class{get description(){return this._def.description}_getType(e){return Pr(e.data)}_getOrReturnCtx(e,n){return n||{common:e.parent.common,data:e.data,parsedType:Pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}_processInputParams(e){return{status:new vt,ctx:{common:e.parent.common,data:e.data,parsedType:Pr(e.data),schemaErrorMap:this._def.errorMap,path:e.path,parent:e.parent}}}_parseSync(e){let n=this._parse(e);if(ya(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(e){let n=this._parse(e);return Promise.resolve(n)}parse(e,n){let r=this.safeParse(e,n);if(r.success)return r.data;throw r.error}safeParse(e,n){let r={common:{issues:[],async:n?.async??!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)},o=this._parseSync({data:e,path:r.path,parent:r});return Sv(r,o)}"~validate"(e){let n={common:{issues:[],async:!!this["~standard"].async},path:[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)};if(!this["~standard"].async)try{let r=this._parseSync({data:e,path:[],parent:n});return Wo(r)?{value:r.value}:{issues:n.common.issues}}catch(r){r?.message?.toLowerCase()?.includes("encountered")&&(this["~standard"].async=!0),n.common={issues:[],async:!0}}return this._parseAsync({data:e,path:[],parent:n}).then(r=>Wo(r)?{value:r.value}:{issues:n.common.issues})}async parseAsync(e,n){let r=await this.safeParseAsync(e,n);if(r.success)return r.data;throw r.error}async safeParseAsync(e,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:e,parsedType:Pr(e)},o=this._parse({data:e,path:r.path,parent:r}),s=await(ya(o)?o:Promise.resolve(o));return Sv(r,s)}refine(e,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,s)=>{let i=e(o),a=()=>s.addIssue({code:C.custom,...r(o)});return typeof Promise<"u"&&i instanceof Promise?i.then(c=>c?!0:(a(),!1)):i?!0:(a(),!1)})}refinement(e,n){return this._refinement((r,o)=>e(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(e){return new wn({schema:this,typeName:W.ZodEffects,effect:{type:"refinement",refinement:e}})}superRefine(e){return this._refinement(e)}constructor(e){this.spa=this.safeParseAsync,this._def=e,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this),this["~standard"]={version:1,vendor:"zod",validate:n=>this["~validate"](n)}}optional(){return Dn.create(this,this._def)}nullable(){return Mr.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return mo.create(this)}promise(){return Jo.create(this,this._def)}or(e){return di.create([this,e],this._def)}and(e){return pi.create(this,e,this._def)}transform(e){return new wn({...te(this._def),schema:this,typeName:W.ZodEffects,effect:{type:"transform",transform:e}})}default(e){let n=typeof e=="function"?e:()=>e;return new Si({...te(this._def),innerType:this,defaultValue:n,typeName:W.ZodDefault})}brand(){return new Uu({typeName:W.ZodBranded,type:this,...te(this._def)})}catch(e){let n=typeof e=="function"?e:()=>e;return new Ti({...te(this._def),innerType:this,catchValue:n,typeName:W.ZodCatch})}describe(e){let n=this.constructor;return new n({...this._def,description:e})}pipe(e){return wu.create(this,e)}readonly(){return gi.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},ZZ=/^c[^\s-]{8,}$/i,QZ=/^[0-9a-z]+$/,eQ=/^[0-9A-HJKMNP-TV-Z]{26}$/i,tQ=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,nQ=/^[a-z0-9_-]{21}$/i,rQ=/^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/,oQ=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,sQ=/^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,iQ="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$",bT,aQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,cQ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/,uQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/,lQ=/^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,dQ=/^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/,pQ=/^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/,gv="((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))",_Q=new RegExp(`^${gv}$`);function hv(t){let e="[0-5]\\d";t.precision?e=`${e}\\.\\d{${t.precision}}`:t.precision==null&&(e=`${e}(\\.\\d+)?`);let n=t.precision?"+":"?";return`([01]\\d|2[0-3]):[0-5]\\d(:${e})${n}`}function fQ(t){return new RegExp(`^${hv(t)}$`)}function Av(t){let e=`${gv}T${hv(t)}`,n=[];return n.push(t.local?"Z?":"Z"),t.offset&&n.push("([+-]\\d{2}:?\\d{2})"),e=`${e}(${n.join("|")})`,new RegExp(`^${e}$`)}function mQ(t,e){return!!((e==="v4"||!e)&&aQ.test(t)||(e==="v6"||!e)&&uQ.test(t))}function EQ(t,e){if(!rQ.test(t))return!1;try{let[n]=t.split(".");if(!n)return!1;let r=n.replace(/-/g,"+").replace(/_/g,"/").padEnd(n.length+(4-n.length%4)%4,"="),o=JSON.parse(atob(r));return!(typeof o!="object"||o===null||"typ"in o&&o?.typ!=="JWT"||!o.alg||e&&o.alg!==e)}catch{return!1}}function SQ(t,e){return!!((e==="v4"||!e)&&cQ.test(t)||(e==="v6"||!e)&&lQ.test(t))}var zo=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=String(e.data)),this._getType(e)!==D.string){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.string,received:s.parsedType}),Y}let r=new vt,o;for(let s of this._def.checks)if(s.kind==="min")e.data.length<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="max")e.data.length>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!1,message:s.message}),r.dirty());else if(s.kind==="length"){let i=e.data.length>s.value,a=e.data.length<s.value;(i||a)&&(o=this._getOrReturnCtx(e,o),i?x(o,{code:C.too_big,maximum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}):a&&x(o,{code:C.too_small,minimum:s.value,type:"string",inclusive:!0,exact:!0,message:s.message}),r.dirty())}else if(s.kind==="email")sQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"email",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="emoji")bT||(bT=new RegExp(iQ,"u")),bT.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"emoji",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="uuid")tQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"uuid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="nanoid")nQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"nanoid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid")ZZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="cuid2")QZ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cuid2",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="ulid")eQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ulid",code:C.invalid_string,message:s.message}),r.dirty());else if(s.kind==="url")try{new URL(e.data)}catch{o=this._getOrReturnCtx(e,o),x(o,{validation:"url",code:C.invalid_string,message:s.message}),r.dirty()}else s.kind==="regex"?(s.regex.lastIndex=0,s.regex.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"regex",code:C.invalid_string,message:s.message}),r.dirty())):s.kind==="trim"?e.data=e.data.trim():s.kind==="includes"?e.data.includes(s.value,s.position)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{includes:s.value,position:s.position},message:s.message}),r.dirty()):s.kind==="toLowerCase"?e.data=e.data.toLowerCase():s.kind==="toUpperCase"?e.data=e.data.toUpperCase():s.kind==="startsWith"?e.data.startsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{startsWith:s.value},message:s.message}),r.dirty()):s.kind==="endsWith"?e.data.endsWith(s.value)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:{endsWith:s.value},message:s.message}),r.dirty()):s.kind==="datetime"?Av(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"datetime",message:s.message}),r.dirty()):s.kind==="date"?_Q.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"date",message:s.message}),r.dirty()):s.kind==="time"?fQ(s).test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{code:C.invalid_string,validation:"time",message:s.message}),r.dirty()):s.kind==="duration"?oQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"duration",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="ip"?mQ(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"ip",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="jwt"?EQ(e.data,s.alg)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"jwt",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="cidr"?SQ(e.data,s.version)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"cidr",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="base64"?dQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64",code:C.invalid_string,message:s.message}),r.dirty()):s.kind==="base64url"?pQ.test(e.data)||(o=this._getOrReturnCtx(e,o),x(o,{validation:"base64url",code:C.invalid_string,message:s.message}),r.dirty()):ue.assertNever(s);return{status:r.value,value:e.data}}_regex(e,n,r){return this.refinement(o=>e.test(o),{validation:n,code:C.invalid_string,...G.errToObj(r)})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}email(e){return this._addCheck({kind:"email",...G.errToObj(e)})}url(e){return this._addCheck({kind:"url",...G.errToObj(e)})}emoji(e){return this._addCheck({kind:"emoji",...G.errToObj(e)})}uuid(e){return this._addCheck({kind:"uuid",...G.errToObj(e)})}nanoid(e){return this._addCheck({kind:"nanoid",...G.errToObj(e)})}cuid(e){return this._addCheck({kind:"cuid",...G.errToObj(e)})}cuid2(e){return this._addCheck({kind:"cuid2",...G.errToObj(e)})}ulid(e){return this._addCheck({kind:"ulid",...G.errToObj(e)})}base64(e){return this._addCheck({kind:"base64",...G.errToObj(e)})}base64url(e){return this._addCheck({kind:"base64url",...G.errToObj(e)})}jwt(e){return this._addCheck({kind:"jwt",...G.errToObj(e)})}ip(e){return this._addCheck({kind:"ip",...G.errToObj(e)})}cidr(e){return this._addCheck({kind:"cidr",...G.errToObj(e)})}datetime(e){return typeof e=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,local:!1,message:e}):this._addCheck({kind:"datetime",precision:typeof e?.precision>"u"?null:e?.precision,offset:e?.offset??!1,local:e?.local??!1,...G.errToObj(e?.message)})}date(e){return this._addCheck({kind:"date",message:e})}time(e){return typeof e=="string"?this._addCheck({kind:"time",precision:null,message:e}):this._addCheck({kind:"time",precision:typeof e?.precision>"u"?null:e?.precision,...G.errToObj(e?.message)})}duration(e){return this._addCheck({kind:"duration",...G.errToObj(e)})}regex(e,n){return this._addCheck({kind:"regex",regex:e,...G.errToObj(n)})}includes(e,n){return this._addCheck({kind:"includes",value:e,position:n?.position,...G.errToObj(n?.message)})}startsWith(e,n){return this._addCheck({kind:"startsWith",value:e,...G.errToObj(n)})}endsWith(e,n){return this._addCheck({kind:"endsWith",value:e,...G.errToObj(n)})}min(e,n){return this._addCheck({kind:"min",value:e,...G.errToObj(n)})}max(e,n){return this._addCheck({kind:"max",value:e,...G.errToObj(n)})}length(e,n){return this._addCheck({kind:"length",value:e,...G.errToObj(n)})}nonempty(e){return this.min(1,G.errToObj(e))}trim(){return new t({...this._def,checks:[...this._def.checks,{kind:"trim"}]})}toLowerCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]})}toUpperCase(){return new t({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}get isDatetime(){return!!this._def.checks.find(e=>e.kind==="datetime")}get isDate(){return!!this._def.checks.find(e=>e.kind==="date")}get isTime(){return!!this._def.checks.find(e=>e.kind==="time")}get isDuration(){return!!this._def.checks.find(e=>e.kind==="duration")}get isEmail(){return!!this._def.checks.find(e=>e.kind==="email")}get isURL(){return!!this._def.checks.find(e=>e.kind==="url")}get isEmoji(){return!!this._def.checks.find(e=>e.kind==="emoji")}get isUUID(){return!!this._def.checks.find(e=>e.kind==="uuid")}get isNANOID(){return!!this._def.checks.find(e=>e.kind==="nanoid")}get isCUID(){return!!this._def.checks.find(e=>e.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(e=>e.kind==="cuid2")}get isULID(){return!!this._def.checks.find(e=>e.kind==="ulid")}get isIP(){return!!this._def.checks.find(e=>e.kind==="ip")}get isCIDR(){return!!this._def.checks.find(e=>e.kind==="cidr")}get isBase64(){return!!this._def.checks.find(e=>e.kind==="base64")}get isBase64url(){return!!this._def.checks.find(e=>e.kind==="base64url")}get minLength(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxLength(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};zo.create=t=>new zo({checks:[],typeName:W.ZodString,coerce:t?.coerce??!1,...te(t)});function TQ(t,e){let n=(t.toString().split(".")[1]||"").length,r=(e.toString().split(".")[1]||"").length,o=n>r?n:r,s=Number.parseInt(t.toFixed(o).replace(".","")),i=Number.parseInt(e.toFixed(o).replace(".",""));return s%i/10**o}var si=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(e){if(this._def.coerce&&(e.data=Number(e.data)),this._getType(e)!==D.number){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.number,received:s.parsedType}),Y}let r,o=new vt;for(let s of this._def.checks)s.kind==="int"?ue.isInteger(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:C.invalid_type,expected:"integer",received:"float",message:s.message}),o.dirty()):s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_small,minimum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_big,maximum:s.value,type:"number",inclusive:s.inclusive,exact:!1,message:s.message}),o.dirty()):s.kind==="multipleOf"?TQ(e.data,s.value)!==0&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):s.kind==="finite"?Number.isFinite(e.data)||(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_finite,message:s.message}),o.dirty()):ue.assertNever(s);return{status:o.value,value:e.data}}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}int(e){return this._addCheck({kind:"int",message:G.toString(e)})}positive(e){return this._addCheck({kind:"min",value:0,inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:0,inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:0,inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:0,inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}finite(e){return this._addCheck({kind:"finite",message:G.toString(e)})}safe(e){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:G.toString(e)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:G.toString(e)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}get isInt(){return!!this._def.checks.find(e=>e.kind==="int"||e.kind==="multipleOf"&&ue.isInteger(e.value))}get isFinite(){let e=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(e===null||r.value<e)&&(e=r.value)}return Number.isFinite(n)&&Number.isFinite(e)}};si.create=t=>new si({checks:[],typeName:W.ZodNumber,coerce:t?.coerce||!1,...te(t)});var ii=class t extends ce{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(e){if(this._def.coerce)try{e.data=BigInt(e.data)}catch{return this._getInvalidInput(e)}if(this._getType(e)!==D.bigint)return this._getInvalidInput(e);let r,o=new vt;for(let s of this._def.checks)s.kind==="min"?(s.inclusive?e.data<s.value:e.data<=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_small,type:"bigint",minimum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="max"?(s.inclusive?e.data>s.value:e.data>=s.value)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.too_big,type:"bigint",maximum:s.value,inclusive:s.inclusive,message:s.message}),o.dirty()):s.kind==="multipleOf"?e.data%s.value!==BigInt(0)&&(r=this._getOrReturnCtx(e,r),x(r,{code:C.not_multiple_of,multipleOf:s.value,message:s.message}),o.dirty()):ue.assertNever(s);return{status:o.value,value:e.data}}_getInvalidInput(e){let n=this._getOrReturnCtx(e);return x(n,{code:C.invalid_type,expected:D.bigint,received:n.parsedType}),Y}gte(e,n){return this.setLimit("min",e,!0,G.toString(n))}gt(e,n){return this.setLimit("min",e,!1,G.toString(n))}lte(e,n){return this.setLimit("max",e,!0,G.toString(n))}lt(e,n){return this.setLimit("max",e,!1,G.toString(n))}setLimit(e,n,r,o){return new t({...this._def,checks:[...this._def.checks,{kind:e,value:n,inclusive:r,message:G.toString(o)}]})}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}positive(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:G.toString(e)})}negative(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:G.toString(e)})}nonpositive(e){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:G.toString(e)})}nonnegative(e){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:G.toString(e)})}multipleOf(e,n){return this._addCheck({kind:"multipleOf",value:e,message:G.toString(n)})}get minValue(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e}get maxValue(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e}};ii.create=t=>new ii({checks:[],typeName:W.ZodBigInt,coerce:t?.coerce??!1,...te(t)});var ai=class extends ce{_parse(e){if(this._def.coerce&&(e.data=!!e.data),this._getType(e)!==D.boolean){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.boolean,received:r.parsedType}),Y}return Dt(e.data)}};ai.create=t=>new ai({typeName:W.ZodBoolean,coerce:t?.coerce||!1,...te(t)});var ci=class t extends ce{_parse(e){if(this._def.coerce&&(e.data=new Date(e.data)),this._getType(e)!==D.date){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_type,expected:D.date,received:s.parsedType}),Y}if(Number.isNaN(e.data.getTime())){let s=this._getOrReturnCtx(e);return x(s,{code:C.invalid_date}),Y}let r=new vt,o;for(let s of this._def.checks)s.kind==="min"?e.data.getTime()<s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_small,message:s.message,inclusive:!0,exact:!1,minimum:s.value,type:"date"}),r.dirty()):s.kind==="max"?e.data.getTime()>s.value&&(o=this._getOrReturnCtx(e,o),x(o,{code:C.too_big,message:s.message,inclusive:!0,exact:!1,maximum:s.value,type:"date"}),r.dirty()):ue.assertNever(s);return{status:r.value,value:new Date(e.data.getTime())}}_addCheck(e){return new t({...this._def,checks:[...this._def.checks,e]})}min(e,n){return this._addCheck({kind:"min",value:e.getTime(),message:G.toString(n)})}max(e,n){return this._addCheck({kind:"max",value:e.getTime(),message:G.toString(n)})}get minDate(){let e=null;for(let n of this._def.checks)n.kind==="min"&&(e===null||n.value>e)&&(e=n.value);return e!=null?new Date(e):null}get maxDate(){let e=null;for(let n of this._def.checks)n.kind==="max"&&(e===null||n.value<e)&&(e=n.value);return e!=null?new Date(e):null}};ci.create=t=>new ci({checks:[],coerce:t?.coerce||!1,typeName:W.ZodDate,...te(t)});var Na=class extends ce{_parse(e){if(this._getType(e)!==D.symbol){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.symbol,received:r.parsedType}),Y}return Dt(e.data)}};Na.create=t=>new Na({typeName:W.ZodSymbol,...te(t)});var ui=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.undefined,received:r.parsedType}),Y}return Dt(e.data)}};ui.create=t=>new ui({typeName:W.ZodUndefined,...te(t)});var li=class extends ce{_parse(e){if(this._getType(e)!==D.null){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.null,received:r.parsedType}),Y}return Dt(e.data)}};li.create=t=>new li({typeName:W.ZodNull,...te(t)});var Xo=class extends ce{constructor(){super(...arguments),this._any=!0}_parse(e){return Dt(e.data)}};Xo.create=t=>new Xo({typeName:W.ZodAny,...te(t)});var fo=class extends ce{constructor(){super(...arguments),this._unknown=!0}_parse(e){return Dt(e.data)}};fo.create=t=>new fo({typeName:W.ZodUnknown,...te(t)});var or=class extends ce{_parse(e){let n=this._getOrReturnCtx(e);return x(n,{code:C.invalid_type,expected:D.never,received:n.parsedType}),Y}};or.create=t=>new or({typeName:W.ZodNever,...te(t)});var Ca=class extends ce{_parse(e){if(this._getType(e)!==D.undefined){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.void,received:r.parsedType}),Y}return Dt(e.data)}};Ca.create=t=>new Ca({typeName:W.ZodVoid,...te(t)});var mo=class t extends ce{_parse(e){let{ctx:n,status:r}=this._processInputParams(e),o=this._def;if(n.parsedType!==D.array)return x(n,{code:C.invalid_type,expected:D.array,received:n.parsedType}),Y;if(o.exactLength!==null){let i=n.data.length>o.exactLength.value,a=n.data.length<o.exactLength.value;(i||a)&&(x(n,{code:i?C.too_big:C.too_small,minimum:a?o.exactLength.value:void 0,maximum:i?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(x(n,{code:C.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(x(n,{code:C.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((i,a)=>o.type._parseAsync(new Un(n,i,n.path,a)))).then(i=>vt.mergeArray(r,i));let s=[...n.data].map((i,a)=>o.type._parseSync(new Un(n,i,n.path,a)));return vt.mergeArray(r,s)}get element(){return this._def.type}min(e,n){return new t({...this._def,minLength:{value:e,message:G.toString(n)}})}max(e,n){return new t({...this._def,maxLength:{value:e,message:G.toString(n)}})}length(e,n){return new t({...this._def,exactLength:{value:e,message:G.toString(n)}})}nonempty(e){return this.min(1,e)}};mo.create=(t,e)=>new mo({type:t,minLength:null,maxLength:null,exactLength:null,typeName:W.ZodArray,...te(e)});function Oa(t){if(t instanceof dn){let e={};for(let n in t.shape){let r=t.shape[n];e[n]=Dn.create(Oa(r))}return new dn({...t._def,shape:()=>e})}else return t instanceof mo?new mo({...t._def,type:Oa(t.element)}):t instanceof Dn?Dn.create(Oa(t.unwrap())):t instanceof Mr?Mr.create(Oa(t.unwrap())):t instanceof br?br.create(t.items.map(e=>Oa(e))):t}var dn=class t extends ce{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let e=this._def.shape(),n=ue.objectKeys(e);return this._cached={shape:e,keys:n},this._cached}_parse(e){if(this._getType(e)!==D.object){let u=this._getOrReturnCtx(e);return x(u,{code:C.invalid_type,expected:D.object,received:u.parsedType}),Y}let{status:r,ctx:o}=this._processInputParams(e),{shape:s,keys:i}=this._getCached(),a=[];if(!(this._def.catchall instanceof or&&this._def.unknownKeys==="strip"))for(let u in o.data)i.includes(u)||a.push(u);let c=[];for(let u of i){let l=s[u],d=o.data[u];c.push({key:{status:"valid",value:u},value:l._parse(new Un(o,d,o.path,u)),alwaysSet:u in o.data})}if(this._def.catchall instanceof or){let u=this._def.unknownKeys;if(u==="passthrough")for(let l of a)c.push({key:{status:"valid",value:l},value:{status:"valid",value:o.data[l]}});else if(u==="strict")a.length>0&&(x(o,{code:C.unrecognized_keys,keys:a}),r.dirty());else if(u!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let u=this._def.catchall;for(let l of a){let d=o.data[l];c.push({key:{status:"valid",value:l},value:u._parse(new Un(o,d,o.path,l)),alwaysSet:l in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let u=[];for(let l of c){let d=await l.key,p=await l.value;u.push({key:d,value:p,alwaysSet:l.alwaysSet})}return u}).then(u=>vt.mergeObjectSync(r,u)):vt.mergeObjectSync(r,c)}get shape(){return this._def.shape()}strict(e){return G.errToObj,new t({...this._def,unknownKeys:"strict",...e!==void 0?{errorMap:(n,r)=>{let o=this._def.errorMap?.(n,r).message??r.defaultError;return n.code==="unrecognized_keys"?{message:G.errToObj(e).message??o}:{message:o}}}:{}})}strip(){return new t({...this._def,unknownKeys:"strip"})}passthrough(){return new t({...this._def,unknownKeys:"passthrough"})}extend(e){return new t({...this._def,shape:()=>({...this._def.shape(),...e})})}merge(e){return new t({unknownKeys:e._def.unknownKeys,catchall:e._def.catchall,shape:()=>({...this._def.shape(),...e._def.shape()}),typeName:W.ZodObject})}setKey(e,n){return this.augment({[e]:n})}catchall(e){return new t({...this._def,catchall:e})}pick(e){let n={};for(let r of ue.objectKeys(e))e[r]&&this.shape[r]&&(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}omit(e){let n={};for(let r of ue.objectKeys(this.shape))e[r]||(n[r]=this.shape[r]);return new t({...this._def,shape:()=>n})}deepPartial(){return Oa(this)}partial(e){let n={};for(let r of ue.objectKeys(this.shape)){let o=this.shape[r];e&&!e[r]?n[r]=o:n[r]=o.optional()}return new t({...this._def,shape:()=>n})}required(e){let n={};for(let r of ue.objectKeys(this.shape))if(e&&!e[r])n[r]=this.shape[r];else{let s=this.shape[r];for(;s instanceof Dn;)s=s._def.innerType;n[r]=s}return new t({...this._def,shape:()=>n})}keyof(){return Rv(ue.objectKeys(this.shape))}};dn.create=(t,e)=>new dn({shape:()=>t,unknownKeys:"strip",catchall:or.create(),typeName:W.ZodObject,...te(e)});dn.strictCreate=(t,e)=>new dn({shape:()=>t,unknownKeys:"strict",catchall:or.create(),typeName:W.ZodObject,...te(e)});dn.lazycreate=(t,e)=>new dn({shape:t,unknownKeys:"strip",catchall:or.create(),typeName:W.ZodObject,...te(e)});var di=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=this._def.options;function o(s){for(let a of s)if(a.result.status==="valid")return a.result;for(let a of s)if(a.result.status==="dirty")return n.common.issues.push(...a.ctx.common.issues),a.result;let i=s.map(a=>new ln(a.ctx.common.issues));return x(n,{code:C.invalid_union,unionErrors:i}),Y}if(n.common.async)return Promise.all(r.map(async s=>{let i={...n,common:{...n.common,issues:[]},parent:null};return{result:await s._parseAsync({data:n.data,path:n.path,parent:i}),ctx:i}})).then(o);{let s,i=[];for(let c of r){let u={...n,common:{...n.common,issues:[]},parent:null},l=c._parseSync({data:n.data,path:n.path,parent:u});if(l.status==="valid")return l;l.status==="dirty"&&!s&&(s={result:l,ctx:u}),u.common.issues.length&&i.push(u.common.issues)}if(s)return n.common.issues.push(...s.ctx.common.issues),s.result;let a=i.map(c=>new ln(c));return x(n,{code:C.invalid_union,unionErrors:a}),Y}}get options(){return this._def.options}};di.create=(t,e)=>new di({options:t,typeName:W.ZodUnion,...te(e)});var _o=t=>t instanceof _i?_o(t.schema):t instanceof wn?_o(t.innerType()):t instanceof fi?[t.value]:t instanceof mi?t.options:t instanceof Ei?ue.objectValues(t.enum):t instanceof Si?_o(t._def.innerType):t instanceof ui?[void 0]:t instanceof li?[null]:t instanceof Dn?[void 0,..._o(t.unwrap())]:t instanceof Mr?[null,..._o(t.unwrap())]:t instanceof Uu||t instanceof gi?_o(t.unwrap()):t instanceof Ti?_o(t._def.innerType):[],Cp=class t extends ce{_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.object)return x(n,{code:C.invalid_type,expected:D.object,received:n.parsedType}),Y;let r=this.discriminator,o=n.data[r],s=this.optionsMap.get(o);return s?n.common.async?s._parseAsync({data:n.data,path:n.path,parent:n}):s._parseSync({data:n.data,path:n.path,parent:n}):(x(n,{code:C.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),Y)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(e,n,r){let o=new Map;for(let s of n){let i=_o(s.shape[e]);if(!i.length)throw new Error(`A discriminator value for key \`${e}\` could not be extracted from all schema options`);for(let a of i){if(o.has(a))throw new Error(`Discriminator property ${String(e)} has duplicate value ${String(a)}`);o.set(a,s)}}return new t({typeName:W.ZodDiscriminatedUnion,discriminator:e,options:n,optionsMap:o,...te(r)})}};function MT(t,e){let n=Pr(t),r=Pr(e);if(t===e)return{valid:!0,data:t};if(n===D.object&&r===D.object){let o=ue.objectKeys(e),s=ue.objectKeys(t).filter(a=>o.indexOf(a)!==-1),i={...t,...e};for(let a of s){let c=MT(t[a],e[a]);if(!c.valid)return{valid:!1};i[a]=c.data}return{valid:!0,data:i}}else if(n===D.array&&r===D.array){if(t.length!==e.length)return{valid:!1};let o=[];for(let s=0;s<t.length;s++){let i=t[s],a=e[s],c=MT(i,a);if(!c.valid)return{valid:!1};o.push(c.data)}return{valid:!0,data:o}}else return n===D.date&&r===D.date&&+t==+e?{valid:!0,data:t}:{valid:!1}}var pi=class extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=(s,i)=>{if(Op(s)||Op(i))return Y;let a=MT(s.value,i.value);return a.valid?((Np(s)||Np(i))&&n.dirty(),{status:n.value,value:a.data}):(x(r,{code:C.invalid_intersection_types}),Y)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([s,i])=>o(s,i)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};pi.create=(t,e,n)=>new pi({left:t,right:e,typeName:W.ZodIntersection,...te(n)});var br=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.array)return x(r,{code:C.invalid_type,expected:D.array,received:r.parsedType}),Y;if(r.data.length<this._def.items.length)return x(r,{code:C.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),Y;!this._def.rest&&r.data.length>this._def.items.length&&(x(r,{code:C.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let s=[...r.data].map((i,a)=>{let c=this._def.items[a]||this._def.rest;return c?c._parse(new Un(r,i,r.path,a)):null}).filter(i=>!!i);return r.common.async?Promise.all(s).then(i=>vt.mergeArray(n,i)):vt.mergeArray(n,s)}get items(){return this._def.items}rest(e){return new t({...this._def,rest:e})}};br.create=(t,e)=>{if(!Array.isArray(t))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new br({items:t,typeName:W.ZodTuple,rest:null,...te(e)})};var vp=class t extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.object)return x(r,{code:C.invalid_type,expected:D.object,received:r.parsedType}),Y;let o=[],s=this._def.keyType,i=this._def.valueType;for(let a in r.data)o.push({key:s._parse(new Un(r,a,r.path,a)),value:i._parse(new Un(r,r.data[a],r.path,a)),alwaysSet:a in r.data});return r.common.async?vt.mergeObjectAsync(n,o):vt.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(e,n,r){return n instanceof ce?new t({keyType:e,valueType:n,typeName:W.ZodRecord,...te(r)}):new t({keyType:zo.create(),valueType:e,typeName:W.ZodRecord,...te(n)})}},va=class extends ce{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.map)return x(r,{code:C.invalid_type,expected:D.map,received:r.parsedType}),Y;let o=this._def.keyType,s=this._def.valueType,i=[...r.data.entries()].map(([a,c],u)=>({key:o._parse(new Un(r,a,r.path,[u,"key"])),value:s._parse(new Un(r,c,r.path,[u,"value"]))}));if(r.common.async){let a=new Map;return Promise.resolve().then(async()=>{for(let c of i){let u=await c.key,l=await c.value;if(u.status==="aborted"||l.status==="aborted")return Y;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}})}else{let a=new Map;for(let c of i){let u=c.key,l=c.value;if(u.status==="aborted"||l.status==="aborted")return Y;(u.status==="dirty"||l.status==="dirty")&&n.dirty(),a.set(u.value,l.value)}return{status:n.value,value:a}}}};va.create=(t,e,n)=>new va({valueType:e,keyType:t,typeName:W.ZodMap,...te(n)});var Ia=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.parsedType!==D.set)return x(r,{code:C.invalid_type,expected:D.set,received:r.parsedType}),Y;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(x(r,{code:C.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(x(r,{code:C.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let s=this._def.valueType;function i(c){let u=new Set;for(let l of c){if(l.status==="aborted")return Y;l.status==="dirty"&&n.dirty(),u.add(l.value)}return{status:n.value,value:u}}let a=[...r.data.values()].map((c,u)=>s._parse(new Un(r,c,r.path,u)));return r.common.async?Promise.all(a).then(c=>i(c)):i(a)}min(e,n){return new t({...this._def,minSize:{value:e,message:G.toString(n)}})}max(e,n){return new t({...this._def,maxSize:{value:e,message:G.toString(n)}})}size(e,n){return this.min(e,n).max(e,n)}nonempty(e){return this.min(1,e)}};Ia.create=(t,e)=>new Ia({valueType:t,minSize:null,maxSize:null,typeName:W.ZodSet,...te(e)});var Ip=class t extends ce{constructor(){super(...arguments),this.validate=this.implement}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.function)return x(n,{code:C.invalid_type,expected:D.function,received:n.parsedType}),Y;function r(a,c){return Du({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ra(),po].filter(u=>!!u),issueData:{code:C.invalid_arguments,argumentsError:c}})}function o(a,c){return Du({data:a,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,Ra(),po].filter(u=>!!u),issueData:{code:C.invalid_return_type,returnTypeError:c}})}let s={errorMap:n.common.contextualErrorMap},i=n.data;if(this._def.returns instanceof Jo){let a=this;return Dt(async function(...c){let u=new ln([]),l=await a._def.args.parseAsync(c,s).catch(_=>{throw u.addIssue(r(c,_)),u}),d=await Reflect.apply(i,this,l);return await a._def.returns._def.type.parseAsync(d,s).catch(_=>{throw u.addIssue(o(d,_)),u})})}else{let a=this;return Dt(function(...c){let u=a._def.args.safeParse(c,s);if(!u.success)throw new ln([r(c,u.error)]);let l=Reflect.apply(i,this,u.data),d=a._def.returns.safeParse(l,s);if(!d.success)throw new ln([o(l,d.error)]);return d.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...e){return new t({...this._def,args:br.create(e).rest(fo.create())})}returns(e){return new t({...this._def,returns:e})}implement(e){return this.parse(e)}strictImplement(e){return this.parse(e)}static create(e,n,r){return new t({args:e||br.create([]).rest(fo.create()),returns:n||fo.create(),typeName:W.ZodFunction,...te(r)})}},_i=class extends ce{get schema(){return this._def.getter()}_parse(e){let{ctx:n}=this._processInputParams(e);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};_i.create=(t,e)=>new _i({getter:t,typeName:W.ZodLazy,...te(e)});var fi=class extends ce{_parse(e){if(e.data!==this._def.value){let n=this._getOrReturnCtx(e);return x(n,{received:n.data,code:C.invalid_literal,expected:this._def.value}),Y}return{status:"valid",value:e.data}}get value(){return this._def.value}};fi.create=(t,e)=>new fi({value:t,typeName:W.ZodLiteral,...te(e)});function Rv(t,e){return new mi({values:t,typeName:W.ZodEnum,...te(e)})}var mi=class t extends ce{_parse(e){if(typeof e.data!="string"){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{expected:ue.joinValues(r),received:n.parsedType,code:C.invalid_type}),Y}if(this._cache||(this._cache=new Set(this._def.values)),!this._cache.has(e.data)){let n=this._getOrReturnCtx(e),r=this._def.values;return x(n,{received:n.data,code:C.invalid_enum_value,options:r}),Y}return Dt(e.data)}get options(){return this._def.values}get enum(){let e={};for(let n of this._def.values)e[n]=n;return e}get Values(){let e={};for(let n of this._def.values)e[n]=n;return e}get Enum(){let e={};for(let n of this._def.values)e[n]=n;return e}extract(e,n=this._def){return t.create(e,{...this._def,...n})}exclude(e,n=this._def){return t.create(this.options.filter(r=>!e.includes(r)),{...this._def,...n})}};mi.create=Rv;var Ei=class extends ce{_parse(e){let n=ue.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(e);if(r.parsedType!==D.string&&r.parsedType!==D.number){let o=ue.objectValues(n);return x(r,{expected:ue.joinValues(o),received:r.parsedType,code:C.invalid_type}),Y}if(this._cache||(this._cache=new Set(ue.getValidEnumValues(this._def.values))),!this._cache.has(e.data)){let o=ue.objectValues(n);return x(r,{received:r.data,code:C.invalid_enum_value,options:o}),Y}return Dt(e.data)}get enum(){return this._def.values}};Ei.create=(t,e)=>new Ei({values:t,typeName:W.ZodNativeEnum,...te(e)});var Jo=class extends ce{unwrap(){return this._def.type}_parse(e){let{ctx:n}=this._processInputParams(e);if(n.parsedType!==D.promise&&n.common.async===!1)return x(n,{code:C.invalid_type,expected:D.promise,received:n.parsedType}),Y;let r=n.parsedType===D.promise?n.data:Promise.resolve(n.data);return Dt(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};Jo.create=(t,e)=>new Jo({type:t,typeName:W.ZodPromise,...te(e)});var wn=class extends ce{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===W.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(e){let{status:n,ctx:r}=this._processInputParams(e),o=this._def.effect||null,s={addIssue:i=>{x(r,i),i.fatal?n.abort():n.dirty()},get path(){return r.path}};if(s.addIssue=s.addIssue.bind(s),o.type==="preprocess"){let i=o.transform(r.data,s);if(r.common.async)return Promise.resolve(i).then(async a=>{if(n.value==="aborted")return Y;let c=await this._def.schema._parseAsync({data:a,path:r.path,parent:r});return c.status==="aborted"?Y:c.status==="dirty"?oi(c.value):n.value==="dirty"?oi(c.value):c});{if(n.value==="aborted")return Y;let a=this._def.schema._parseSync({data:i,path:r.path,parent:r});return a.status==="aborted"?Y:a.status==="dirty"?oi(a.value):n.value==="dirty"?oi(a.value):a}}if(o.type==="refinement"){let i=a=>{let c=o.refinement(a,s);if(r.common.async)return Promise.resolve(c);if(c instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return a};if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return a.status==="aborted"?Y:(a.status==="dirty"&&n.dirty(),i(a.value),{status:n.value,value:a.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>a.status==="aborted"?Y:(a.status==="dirty"&&n.dirty(),i(a.value).then(()=>({status:n.value,value:a.value}))))}if(o.type==="transform")if(r.common.async===!1){let i=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!Wo(i))return Y;let a=o.transform(i.value,s);if(a instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:a}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(i=>Wo(i)?Promise.resolve(o.transform(i.value,s)).then(a=>({status:n.value,value:a})):Y);ue.assertNever(o)}};wn.create=(t,e,n)=>new wn({schema:t,typeName:W.ZodEffects,effect:e,...te(n)});wn.createWithPreprocess=(t,e,n)=>new wn({schema:e,effect:{type:"preprocess",transform:t},typeName:W.ZodEffects,...te(n)});var Dn=class extends ce{_parse(e){return this._getType(e)===D.undefined?Dt(void 0):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Dn.create=(t,e)=>new Dn({innerType:t,typeName:W.ZodOptional,...te(e)});var Mr=class extends ce{_parse(e){return this._getType(e)===D.null?Dt(null):this._def.innerType._parse(e)}unwrap(){return this._def.innerType}};Mr.create=(t,e)=>new Mr({innerType:t,typeName:W.ZodNullable,...te(e)});var Si=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return n.parsedType===D.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Si.create=(t,e)=>new Si({innerType:t,typeName:W.ZodDefault,defaultValue:typeof e.default=="function"?e.default:()=>e.default,...te(e)});var Ti=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return ya(o)?o.then(s=>({status:"valid",value:s.status==="valid"?s.value:this._def.catchValue({get error(){return new ln(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new ln(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};Ti.create=(t,e)=>new Ti({innerType:t,typeName:W.ZodCatch,catchValue:typeof e.catch=="function"?e.catch:()=>e.catch,...te(e)});var Pa=class extends ce{_parse(e){if(this._getType(e)!==D.nan){let r=this._getOrReturnCtx(e);return x(r,{code:C.invalid_type,expected:D.nan,received:r.parsedType}),Y}return{status:"valid",value:e.data}}};Pa.create=t=>new Pa({typeName:W.ZodNaN,...te(t)});var gQ=Symbol("zod_brand"),Uu=class extends ce{_parse(e){let{ctx:n}=this._processInputParams(e),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},wu=class t extends ce{_parse(e){let{status:n,ctx:r}=this._processInputParams(e);if(r.common.async)return(async()=>{let s=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return s.status==="aborted"?Y:s.status==="dirty"?(n.dirty(),oi(s.value)):this._def.out._parseAsync({data:s.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?Y:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(e,n){return new t({in:e,out:n,typeName:W.ZodPipeline})}},gi=class extends ce{_parse(e){let n=this._def.innerType._parse(e),r=o=>(Wo(o)&&(o.value=Object.freeze(o.value)),o);return ya(n)?n.then(o=>r(o)):r(n)}unwrap(){return this._def.innerType}};gi.create=(t,e)=>new gi({innerType:t,typeName:W.ZodReadonly,...te(e)});function Tv(t,e){let n=typeof t=="function"?t(e):typeof t=="string"?{message:t}:t;return typeof n=="string"?{message:n}:n}function yv(t,e={},n){return t?Xo.create().superRefine((r,o)=>{let s=t(r);if(s instanceof Promise)return s.then(i=>{if(!i){let a=Tv(e,r),c=a.fatal??n??!0;o.addIssue({code:"custom",...a,fatal:c})}});if(!s){let i=Tv(e,r),a=i.fatal??n??!0;o.addIssue({code:"custom",...i,fatal:a})}}):Xo.create()}var hQ={object:dn.lazycreate},W;(function(t){t.ZodString="ZodString",t.ZodNumber="ZodNumber",t.ZodNaN="ZodNaN",t.ZodBigInt="ZodBigInt",t.ZodBoolean="ZodBoolean",t.ZodDate="ZodDate",t.ZodSymbol="ZodSymbol",t.ZodUndefined="ZodUndefined",t.ZodNull="ZodNull",t.ZodAny="ZodAny",t.ZodUnknown="ZodUnknown",t.ZodNever="ZodNever",t.ZodVoid="ZodVoid",t.ZodArray="ZodArray",t.ZodObject="ZodObject",t.ZodUnion="ZodUnion",t.ZodDiscriminatedUnion="ZodDiscriminatedUnion",t.ZodIntersection="ZodIntersection",t.ZodTuple="ZodTuple",t.ZodRecord="ZodRecord",t.ZodMap="ZodMap",t.ZodSet="ZodSet",t.ZodFunction="ZodFunction",t.ZodLazy="ZodLazy",t.ZodLiteral="ZodLiteral",t.ZodEnum="ZodEnum",t.ZodEffects="ZodEffects",t.ZodNativeEnum="ZodNativeEnum",t.ZodOptional="ZodOptional",t.ZodNullable="ZodNullable",t.ZodDefault="ZodDefault",t.ZodCatch="ZodCatch",t.ZodPromise="ZodPromise",t.ZodBranded="ZodBranded",t.ZodPipeline="ZodPipeline",t.ZodReadonly="ZodReadonly"})(W||(W={}));var AQ=(t,e={message:`Input not instance of ${t.name}`})=>yv(n=>n instanceof t,e),Ov=zo.create,Nv=si.create,RQ=Pa.create,yQ=ii.create,Cv=ai.create,OQ=ci.create,NQ=Na.create,CQ=ui.create,vQ=li.create,IQ=Xo.create,PQ=fo.create,bQ=or.create,MQ=Ca.create,LQ=mo.create,xQ=dn.create,DQ=dn.strictCreate,UQ=di.create,wQ=Cp.create,kQ=pi.create,VQ=br.create,BQ=vp.create,GQ=va.create,HQ=Ia.create,FQ=Ip.create,$Q=_i.create,jQ=fi.create,qQ=mi.create,YQ=Ei.create,KQ=Jo.create,WQ=wn.create,zQ=Dn.create,XQ=Mr.create,JQ=wn.createWithPreprocess,ZQ=wu.create,QQ=()=>Ov().optional(),e7=()=>Nv().optional(),t7=()=>Cv().optional(),n7={string:(t=>zo.create({...t,coerce:!0})),number:(t=>si.create({...t,coerce:!0})),boolean:(t=>ai.create({...t,coerce:!0})),bigint:(t=>ii.create({...t,coerce:!0})),date:(t=>ci.create({...t,coerce:!0}))};var r7=Y;var vv=["tempo","mpp_self","merchant_self"];var LT=y.object({inputPerMillion:y.number().positive(),outputPerMillion:y.number().positive(),contextWindow:y.number().int().positive().optional(),maxOutput:y.number().int().positive().optional()}),o7=y.object({strategy:y.enum(["flat","token","band"]).optional(),pricingModel:y.enum(["per-call","per-token","band"]).optional(),priceCents:y.number().nonnegative().optional(),currency:y.string().optional(),display:y.string().optional(),estimate:y.boolean().optional(),source:y.string().optional(),priceBand:y.record(y.unknown()).optional(),tokenPricing:LT.optional()}).passthrough(),xT=y.discriminatedUnion("type",[y.object({type:y.literal("shortcut"),routedPath:y.string().min(1).startsWith("/")}),y.object({type:y.literal("custom"),merchantSlug:y.string().min(1),subPath:y.string().optional()}),y.object({type:y.literal("local"),fn:y.string().min(1)}),y.object({type:y.literal("read")})]),DT=y.object({amount:y.number().nonnegative(),currency:y.string().length(3).optional(),display:y.string().optional(),free:y.boolean().optional(),batchDiscount:y.number().min(0).max(100).optional()}),Iv=y.object({attestation:y.boolean().optional(),rateLimitMs:y.number().positive().optional()}),Pv=y.object({displayName:y.string().optional(),feedbackEligible:y.boolean().optional(),suggestionEligible:y.boolean().optional(),batchable:y.boolean().optional()}),s7=y.enum(["image","video","audio","3d","llm","upscale","tts","transcription","utility","onchain"]),UT={id:y.string().min(1),name:y.string().min(1),description:y.string().min(1),provider:y.string().min(1),model:y.string().min(1),category:s7,priceCents:y.number().nonnegative(),inputSchema:y.record(y.unknown()),gatewayUrl:y.string().min(1),merchantName:y.string().min(1),isAsync:y.boolean().optional(),pollUrl:y.string().optional(),pollInterval:y.number().positive().optional(),pollTimeout:y.number().positive().optional(),tags:y.array(y.string()).optional(),tokenPricing:LT.optional(),priceDisplay:y.string().optional(),pricingModel:y.enum(["per-call","per-token","band"]).optional(),pricingInfo:o7.optional(),status:y.enum(["available","unavailable"]).optional(),handler:xT.optional(),pricing:DT.optional(),security:Iv.optional(),engagement:Pv.optional(),enabled:y.boolean().optional(),beta:y.boolean().optional(),deprecated:y.boolean().optional(),replacementTool:y.string().optional(),minCliVersion:y.string().optional(),sunsetAt:y.string().optional(),rail:y.enum(vv).optional(),pricingStrategy:y.enum(["flat","token","band"]).optional()},bv=y.object({...UT,dispatch:y.literal("routed"),routedPath:y.string().min(1).startsWith("/")}).strict(),Mv=y.object({...UT,dispatch:y.literal("enveloped")}).strict(),Lv=y.object({...UT,handler:xT,pricing:DT}).strict(),xv=y.union([y.discriminatedUnion("dispatch",[bv,Mv]),Lv]);var wT=/^[a-z0-9][a-z0-9_-]*$/;var wv="https://fal.run",a7="https://openrouter.mpp.tempo.xyz";function c7(t){let{attestation:e,tool_id:n,...r}=t;return r}var Dv={"1:1":"square_hd","16:9":"landscape_16_9","9:16":"portrait_16_9","4:3":"landscape_4_3","3:4":"portrait_4_3"};function Pp(t){let{attestation:e,tool_id:n,aspect_ratio:r,image_size:o,...s}=t,i={...s};return typeof o=="string"&&o.length>0?(i.image_size=o,i):(typeof r=="string"&&Dv[r]&&(i.image_size=Dv[r]),i)}function tt(t,e,n,r,o,s,i,a){return{dispatch:"routed",id:t,name:e,description:n,provider:"fal",model:r,category:o,priceCents:s,inputSchema:i,routedPath:`/api/v1/fal/${r}`,gatewayUrl:`${wv}/${r}`,merchantName:"fal.ai",buildBody:c7,tags:[],...a}}function u7(t){return e=>{let{attestation:n,tool_id:r,prompt:o,system_prompt:s,max_tokens:i,temperature:a,...c}=e;return{model:t,messages:[...s?[{role:"system",content:s}]:[],{role:"user",content:o}],max_tokens:i??1024,temperature:a??.7,...c}}}function Ut(t,e,n,r,o,s,i){let a=5e-4*o*100,c=500/1e6*s*100,u=Math.max(1,Math.ceil(a+c));return{dispatch:"routed",id:t,name:e,description:n,provider:"openrouter",model:r,category:"llm",priceCents:u,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"The prompt or question to send to the model"},system_prompt:{type:"string",description:"Optional system prompt to set model behavior"},max_tokens:{type:"integer",description:"Maximum tokens in response (default: 1024)",minimum:1,maximum:8192},temperature:{type:"number",description:"Sampling temperature 0-2 (default: 0.7)",minimum:0,maximum:2}},required:["prompt"]},routedPath:"/api/v1/chat/completions",gatewayUrl:`${a7}/v1/chat/completions`,merchantName:"OpenRouter",buildBody:u7(r),tags:["llm","chat","text"],tokenPricing:{inputPerMillion:o,outputPerMillion:s},...i}}var kv=[tt("fal-flux-pro-ultra","FLUX Pro Ultra","Highest quality image generation. Best for detailed, photorealistic images.","fal-ai/flux-pro/v1.1-ultra","image",6,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},{tags:["image","flux","photorealistic","high-quality"]}),tt("fal-flux-pro","FLUX Pro","Fast, high-quality image generation. Good balance of speed and quality.","fal-ai/flux-pro/v1.1","image",4,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},{tags:["image","flux","fast"],buildBody:Pp}),tt("fal-flux-dev","FLUX Dev","Open-source image generation. Cheaper, good for experimentation.","fal-ai/flux/dev","image",3,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["image","flux","open-source","cheap"],buildBody:Pp}),tt("fal-flux-schnell","FLUX Schnell","Fastest image generation. Ultra-cheap, great for drafts and iteration.","fal-ai/flux/schnell","image",1,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["image","flux","fast","cheap","draft"],buildBody:Pp}),tt("fal-recraft-v3","Recraft V3","Design-focused image generation. Great for illustrations, icons, and graphic design.","fal-ai/recraft/v3/text-to-image","image",5,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},style:{type:"string",description:"Style preset: realistic_image, digital_illustration, vector_illustration, icon"}},required:["prompt"]},{tags:["image","design","illustration","icon","vector"]}),tt("fal-ideogram-v2","Ideogram V2","Excellent text rendering in images. Best for logos, posters, and text-heavy visuals.","fal-ai/ideogram/v2","image",8,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"1:1"}},required:["prompt"]},{tags:["image","text-rendering","logo","poster","typography"]}),tt("fal-ideogram-v2-turbo","Ideogram V2 Turbo","Fast text rendering in images. Good balance of speed and text accuracy.","fal-ai/ideogram/v2/turbo","image",5,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"1:1"}},required:["prompt"]},{tags:["image","text-rendering","fast"]}),tt("fal-fast-sdxl","Fast SDXL","Ultra-fast Stable Diffusion. 4-step inference, cheapest option.","fal-ai/fast-sdxl","image",1,{type:"object",properties:{prompt:{type:"string",description:"Text description of the image to generate"}},required:["prompt"]},{tags:["image","stable-diffusion","fast","cheap"]}),tt("fal-wan-video","Wan Video","Text-to-video generation. Create short video clips from text descriptions.","fal-ai/wan/v2.1/1.3b/text-to-video","video",10,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"},num_frames:{type:"number",description:"Number of frames (default: 81)"}},required:["prompt"]},{tags:["video","text-to-video","wan"]}),tt("fal-minimax-video","MiniMax Video","High-quality video generation with excellent motion and coherence.","fal-ai/minimax-video/video-01-live","video",15,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"}},required:["prompt"]},{tags:["video","text-to-video","high-quality"]}),tt("fal-kling-video","Kling Video","Professional video generation with cinematic quality.","fal-ai/kling-video/v2/master/text-to-video","video",20,{type:"object",properties:{prompt:{type:"string",description:"Text description of the video to generate"},duration:{type:"string",description:"Duration: 5 or 10 seconds",default:"5"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},{tags:["video","text-to-video","cinematic","professional"]}),tt("fal-kling-i2v","Kling Image-to-Video","Animate a still image into a 5\u201310s video clip. Cinematic motion quality.","fal-ai/kling-video/v1.6/standard/image-to-video","video",35,{type:"object",properties:{image_url:{type:"string",description:"URL of the source image (jpg, png, webp, gif, avif)"},prompt:{type:"string",description:"Text description of the motion to animate"},duration:{type:"string",description:"Duration: 5 or 10 seconds",default:"5"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 9:16, 1:1)",default:"16:9"},negative_prompt:{type:"string",description:"Elements to avoid in the generated motion"},cfg_scale:{type:"number",description:"Classifier-free guidance (default 0.5)",default:.5}},required:["image_url","prompt"]},{tags:["video","image-to-video","kling","cinematic"]}),tt("fal-stable-audio","Stable Audio","Generate music and sound effects from text descriptions.","fal-ai/stable-audio","audio",4,{type:"object",properties:{prompt:{type:"string",description:"Description of the audio to generate"},seconds_total:{type:"number",description:"Duration in seconds (max 47)",default:30}},required:["prompt"]},{tags:["audio","music","sound-effects"]}),tt("suno-music","Suno Music","AI music generation. Create full songs with vocals or instrumentals.","suno/v4","audio",10,{type:"object",properties:{prompt:{type:"string",description:"Description of the song (genre, mood, instruments)"},instrumental:{type:"boolean",description:"Instrumental only, no vocals",default:!1}},required:["prompt"]},{tags:["music","song","vocals","instrumental"],merchantName:"Suno AI",isAsync:!0,pollUrl:`${wv}/suno/v4/requests/{requestId}/status`}),tt("fal-trellis-3d","Trellis 3D","Generate 3D models from images. Upload a photo, get a 3D asset.","fal-ai/trellis","3d",8,{type:"object",properties:{image_url:{type:"string",description:"URL of the image to convert to 3D"}},required:["image_url"]},{tags:["3d","model","image-to-3d"]}),tt("fal-aura-sr","Aura SR","Upscale images to higher resolution. 4x upscaling with detail enhancement.","fal-ai/aura-sr","upscale",3,{type:"object",properties:{image_url:{type:"string",description:"URL of the image to upscale"}},required:["image_url"]},{tags:["upscale","super-resolution","enhance"]}),tt("fal-metavoice","MetaVoice Voice Cloning","Voice cloning TTS \u2014 clone any voice from an audio sample. Provide text and a voice sample URL.","fal-ai/metavoice-v1","tts",3,{type:"object",properties:{text:{type:"string",description:"Text to convert to speech"},audio_url:{type:"string",description:"URL of the voice sample to clone"}},required:["text","audio_url"]},{tags:["tts","voice","voice-cloning","speech"]}),tt("fal-whisper","Whisper Transcription","Transcribe audio to text. Supports multiple languages.","fal-ai/whisper","transcription",2,{type:"object",properties:{audio_url:{type:"string",description:"URL of the audio to transcribe"},language:{type:"string",description:"Language code (e.g. en, es, fr)"}},required:["audio_url"]},{tags:["transcription","speech-to-text","whisper"]}),Ut("or-gpt-4o","GPT-4o","OpenAI's flagship multimodal model. Best for complex reasoning and analysis.","openai/gpt-4o",2.5,10,{tags:["llm","gpt","openai","multimodal","reasoning"]}),Ut("or-gpt-4o-mini","GPT-4o Mini","Fast, affordable GPT-4o. Great for everyday tasks, chat, and simple analysis.","openai/gpt-4o-mini",.15,.6,{tags:["llm","gpt","openai","fast","cheap"]}),Ut("or-claude-opus","Claude Opus 4.7","Anthropic's most capable model. 1M context, reasoning, best for complex tasks.","anthropic/claude-opus-4.7",15,75,{tags:["llm","claude","anthropic","reasoning","coding"]}),Ut("or-claude-sonnet","Claude Sonnet 4.6","Anthropic's best balance of intelligence and speed. Excellent for coding and analysis.","anthropic/claude-sonnet-4.6",3,15,{tags:["llm","claude","anthropic","coding","analysis"]}),Ut("or-claude-opus-fast","Claude Opus 4.6 Fast","Fast Opus variant with lower latency.","anthropic/claude-opus-4.6-fast",15,75,{tags:["llm","claude","anthropic","fast"]}),Ut("or-claude-haiku","Claude 3.5 Haiku","Anthropic's fastest model. Great for quick tasks, chat, and simple reasoning.","anthropic/claude-3.5-haiku",.8,4,{tags:["llm","claude","anthropic","fast"]}),Ut("or-gemini-pro","Gemini 2.0 Flash","Google's fast multimodal model. Good for general tasks with long context.","google/gemini-2.0-flash-001",.1,.4,{tags:["llm","gemini","google","multimodal","fast","cheap"]}),Ut("or-llama-70b","Llama 3.3 70B","Meta's best open model. Strong reasoning, fully open-source.","meta-llama/llama-3.3-70b-instruct",.3,.4,{tags:["llm","llama","meta","open-source","reasoning"]}),Ut("or-llama-8b","Llama 3.1 8B","Fast, lightweight open model. Great for simple tasks at minimal cost.","meta-llama/llama-3.1-8b-instruct",.05,.08,{tags:["llm","llama","meta","open-source","fast","cheap"]}),Ut("or-mistral-large","Mistral Large","Mistral's flagship model. Strong at multilingual and European languages.","mistralai/mistral-large-2411",2,6,{tags:["llm","mistral","multilingual","european"]}),Ut("or-mistral-small","Mistral Small","Fast, efficient Mistral model. Good for everyday tasks.","mistralai/mistral-small-3.1-24b-instruct",.1,.3,{tags:["llm","mistral","fast","cheap"]}),Ut("or-deepseek-chat","DeepSeek Chat V3","Strong reasoning model at very low cost. Excellent for coding and math.","deepseek/deepseek-chat-v3-0324",.3,.88,{tags:["llm","deepseek","coding","math","cheap","reasoning"]}),Ut("or-deepseek-r1","DeepSeek R1","Advanced reasoning model with chain-of-thought. Best for complex problems.","deepseek/deepseek-r1",.55,2.19,{tags:["llm","deepseek","reasoning","chain-of-thought","math"]}),Ut("or-qwen-72b","Qwen 2.5 72B","Alibaba's large model. Strong at coding, math, and multilingual tasks.","qwen/qwen-2.5-72b-instruct",.3,.4,{tags:["llm","qwen","alibaba","coding","multilingual"]}),Ut("or-phi-4","Phi-4","Microsoft's compact reasoning model. Punches above its weight for size.","microsoft/phi-4",.07,.14,{tags:["llm","phi","microsoft","compact","cheap","reasoning"]}),Ut("or-perplexity-sonar","Perplexity Sonar","Search-augmented LLM. Answers with real-time web sources and citations.","perplexity/sonar",1,1,{tags:["llm","perplexity","search","web","citations","real-time"]}),{dispatch:"enveloped",id:"generate_image_card",name:"Generate Image (Ultra)",description:"Generate a high-quality AI image (FLUX Pro Ultra, 2K, ~$0.06).",provider:"fal",model:"fal-ai/flux-pro/v1.1-ultra",category:"image",priceCents:6,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Text description of the image"},aspect_ratio:{type:"string",description:"Aspect ratio (e.g. 16:9, 1:1, 9:16)",default:"16:9"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux-pro/v1.1-ultra",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),e},tags:["image","flux","ultra","legacy"]},{dispatch:"enveloped",id:"generate_image_fast_card",name:"Generate Image (Fast)",description:"Generate an AI image (FLUX Pro v1.1, 1K, ~$0.04).",provider:"fal",model:"fal-ai/flux-pro/v1.1",category:"image",priceCents:4,inputSchema:{type:"object",properties:{prompt:{type:"string",description:"Text description of the image"},aspect_ratio:{type:"string",description:"Aspect ratio",default:"16:9"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux-pro/v1.1",merchantName:"fal.ai",buildBody:t=>Pp({prompt:t.prompt,aspect_ratio:t.aspect_ratio}),tags:["image","flux","legacy"]},{dispatch:"enveloped",id:"generate_image_schnell_card",name:"Generate Image (Cheap)",description:"Cheap, fast FLUX image generation (~$0.01).",provider:"fal",model:"fal-ai/flux/schnell",category:"image",priceCents:1,inputSchema:{type:"object",properties:{prompt:{type:"string"},image_size:{type:"string"},num_inference_steps:{type:"number"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/flux/schnell",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.image_size&&(e.image_size=t.image_size),t.num_inference_steps!==void 0&&(e.num_inference_steps=t.num_inference_steps),t.seed!==void 0&&(e.seed=t.seed),e},tags:["image","flux","schnell","legacy"]},{dispatch:"enveloped",id:"generate_image_recraft_card",name:"Generate Image (Recraft)",description:"Recraft V3 image generation with style control.",provider:"fal",model:"fal-ai/recraft-v3",category:"image",priceCents:5,inputSchema:{type:"object",properties:{prompt:{type:"string"},style:{type:"string"},image_size:{type:"string"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/recraft-v3",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.style&&(e.style=t.style),t.image_size&&(e.image_size=t.image_size),e},tags:["image","recraft","legacy"]},{dispatch:"enveloped",id:"generate_image_ideogram_card",name:"Generate Image (Ideogram)",description:"Ideogram V2 image generation, strong with text rendering.",provider:"fal",model:"fal-ai/ideogram/v2",category:"image",priceCents:8,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},style_type:{type:"string"},negative_prompt:{type:"string"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/ideogram/v2",merchantName:"fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.style_type&&(e.style_type=t.style_type),t.negative_prompt&&(e.negative_prompt=t.negative_prompt),e},tags:["image","ideogram","text","legacy"]},tt("upscale_image_card","Upscale Image","Upscale an image using ESRGAN.","fal-ai/esrgan","upscale",2,{type:"object",properties:{image_url:{type:"string"},scale:{type:"number"}},required:["image_url"]},{buildBody:t=>{let e={image_url:t.image_url};return t.scale!==void 0&&(e.scale=t.scale),e},tags:["upscale","esrgan"]}),tt("edit_image_seed_card","Edit Image (SeedEdit)","Inpaint/edit an image with a prompt using SeedEdit.","fal-ai/bytedance/seededit","image",5,{type:"object",properties:{image_url:{type:"string"},prompt:{type:"string"},seed:{type:"number"}},required:["image_url","prompt"]},{buildBody:t=>{let e={image_url:t.image_url,prompt:t.prompt};return t.seed!==void 0&&(e.seed=t.seed),e},tags:["image","edit","inpaint","seededit"]}),{dispatch:"enveloped",id:"generate_video_tempo_card",name:"Generate Video (Grok)",description:"Generate a video from a text prompt using Grok Imagine Video.",provider:"fal",model:"xai/grok-imagine-video/text-to-video",category:"video",priceCents:30,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},duration:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/xai/grok-imagine-video/text-to-video",merchantName:"Grok Video via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.duration&&(e.duration=t.duration),e},tags:["video","grok","legacy"]},{dispatch:"enveloped",id:"generate_video_kling_card",name:"Generate Video (Kling)",description:"Generate a video using Kling v1.6 (async, ~$0.40).",provider:"fal",model:"fal-ai/kling-video/v1.6/standard/text-to-video",category:"video",priceCents:40,inputSchema:{type:"object",properties:{prompt:{type:"string"},negative_prompt:{type:"string"},aspect_ratio:{type:"string"},duration:{type:"number"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/kling-video/v1.6/standard/text-to-video",merchantName:"Kling via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.duration&&(e.duration=t.duration),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","kling","legacy"]},{dispatch:"enveloped",id:"generate_video_wan_card",name:"Generate Video (Wan)",description:"Generate a video using Wan T2V (async, ~$0.25).",provider:"fal",model:"fal-ai/wan/t2v-1.3b",category:"video",priceCents:25,inputSchema:{type:"object",properties:{prompt:{type:"string"},negative_prompt:{type:"string"},aspect_ratio:{type:"string"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/wan/t2v-1.3b",merchantName:"Wan T2V via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","wan","legacy"]},{dispatch:"enveloped",id:"generate_video_minimax_card",name:"Generate Video (MiniMax)",description:"Generate a video using MiniMax (async, ~$0.35).",provider:"fal",model:"fal-ai/minimax/video-01",category:"video",priceCents:35,inputSchema:{type:"object",properties:{prompt:{type:"string"},aspect_ratio:{type:"string"},seed:{type:"number"}},required:["prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/minimax/video-01",merchantName:"MiniMax via fal.ai",buildBody:t=>{let e={prompt:t.prompt};return t.aspect_ratio&&(e.aspect_ratio=t.aspect_ratio),t.seed!==void 0&&(e.seed=t.seed),e},tags:["video","minimax","legacy"]},{dispatch:"enveloped",id:"check_fal_status_card",name:"Check fal Async Job Status",description:"Poll an async fal.ai queue job for completion.",provider:"fal",model:"queue-status",category:"image",priceCents:0,inputSchema:{type:"object",properties:{model_path:{type:"string",description:"Model path (e.g. fal-ai/kling-video/v1.6/standard/text-to-video)"},request_id:{type:"string"}},required:["model_path","request_id"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue",merchantName:"fal.ai",buildUrl:t=>`https://fal.mpp.tempo.xyz/queue/${t.model_path}/requests/${t.request_id}`,buildBody:()=>({}),tags:["status","fal","async","legacy"]},{dispatch:"enveloped",id:"generate_3d_card",name:"Generate 3D Model",description:"Generate a 3D mesh from a text prompt using Meshy (async, ~$0.50).",provider:"fal",model:"fal-ai/meshy-ai/text-to-3d",category:"3d",priceCents:50,inputSchema:{type:"object",properties:{object_prompt:{type:"string"},style_prompt:{type:"string"},negative_prompt:{type:"string"},art_style:{type:"string"},seed:{type:"number"}},required:["object_prompt"]},gatewayUrl:"https://fal.mpp.tempo.xyz/queue/fal-ai/meshy-ai/text-to-3d",merchantName:"Meshy via fal.ai",buildBody:t=>{let e={object_prompt:t.object_prompt};return t.style_prompt&&(e.style_prompt=t.style_prompt),t.negative_prompt&&(e.negative_prompt=t.negative_prompt),t.art_style&&(e.art_style=t.art_style),t.seed!==void 0&&(e.seed=t.seed),e},tags:["3d","mesh","meshy","legacy"]},{dispatch:"enveloped",id:"generate_speech_card",name:"Generate Speech",description:"Text-to-speech using F5-TTS with optional voice cloning.",provider:"fal",model:"fal-ai/f5-tts",category:"tts",priceCents:3,inputSchema:{type:"object",properties:{gen_text:{type:"string",description:"Text to synthesize"},ref_audio_url:{type:"string",description:"Reference audio URL (for voice cloning)"},ref_text:{type:"string",description:"Transcription of ref audio"},remove_silence:{type:"boolean"}},required:["gen_text"]},gatewayUrl:"https://fal.mpp.tempo.xyz/fal-ai/f5-tts",merchantName:"fal.ai",buildBody:t=>{let e={gen_text:t.gen_text};return t.ref_audio_url&&(e.ref_audio_url=t.ref_audio_url),t.ref_text&&(e.ref_text=t.ref_text),t.remove_silence!==void 0&&(e.remove_silence=t.remove_silence),e},tags:["tts","speech","f5-tts","legacy"]},{dispatch:"enveloped",id:"generate_music_tempo_card",name:"Generate Music (Suno)",description:"Generate a music track using Suno (async, ~$0.50).",provider:"suno",model:"suno-v4",category:"audio",priceCents:50,inputSchema:{type:"object",properties:{prompt:{type:"string"},instrumental:{type:"boolean"},model:{type:"string",default:"V4"}},required:["prompt"]},gatewayUrl:"https://suno.mpp.paywithlocus.com/suno/generate-music",merchantName:"Suno via Tempo",buildBody:t=>({prompt:t.prompt,customMode:!1,instrumental:t.instrumental??!1,model:t.model||"V4"}),isAsync:!0,pollUrl:"https://suno.mpp.paywithlocus.com/suno/get-music-status",pollInterval:15e3,pollTimeout:3e5,tags:["music","audio","suno","async","legacy"]},{dispatch:"enveloped",id:"check_music_status_tempo_card",name:"Check Music Status",description:"Poll a Suno music generation task for completion.",provider:"suno",model:"suno-status",category:"audio",priceCents:0,inputSchema:{type:"object",properties:{taskId:{type:"string"}},required:["taskId"]},gatewayUrl:"https://suno.mpp.paywithlocus.com/suno/get-music-status",merchantName:"Suno Status",buildBody:t=>({taskId:t.taskId}),tags:["music","status","suno","legacy"]},{dispatch:"enveloped",id:"query_onchain_prices_card",name:"Query On-Chain Prices",description:"Query real-time or historical on-chain token prices via Allium. Use this for current prices, price history over any date range, price trends, comparisons between time periods, and analytics like monthly/weekly price charts. Supports hourly, daily, and weekly granularity.",provider:"allium",model:"allium-prices",category:"llm",priceCents:1,inputSchema:{type:"object",properties:{chain:{type:"string",description:"Chain name (e.g. ethereum, solana, base, polygon)"},token_address:{type:"string",description:"Token contract address. Use the native token address for chain-native assets (e.g. ETH, SOL)."},start_timestamp:{type:"string",description:"ISO 8601 timestamp for historical range start (e.g. '2024-01-01T00:00:00Z'). Omit for current price only."},end_timestamp:{type:"string",description:"ISO 8601 timestamp for historical range end. Defaults to now if start_timestamp is set."},time_granularity:{type:"string",description:"Data resolution: '1h' (hourly), '1d' (daily), or '1w' (weekly). Auto-selected based on date range if omitted."}},required:["chain","token_address"]},gatewayUrl:"https://agents.allium.so/api/v1/developer/prices",merchantName:"Allium",buildUrl:t=>t.start_timestamp?"https://agents.allium.so/api/v1/developer/prices/history":"https://agents.allium.so/api/v1/developer/prices",buildBody:t=>{let e={chain:t.chain,token_address:t.token_address};if(t.start_timestamp){let n=t.end_timestamp||new Date().toISOString(),r=t.time_granularity;if(!r){let o=new Date(t.start_timestamp).getTime();(new Date(n).getTime()-o)/(1e3*60*60*24)<=2?r="1h":r="1d"}return{addresses:[e],start_timestamp:t.start_timestamp,end_timestamp:n,time_granularity:r}}return[e]},tags:["onchain","prices","allium","crypto","legacy"]}];var Vv=1,Bv=["pick_one","fan_out"],Gv=["concat","dedupe_by_url","top_k_by_score"],d7=8,p7=y.object({type:y.string().min(1),description:y.string().min(1),enum:y.array(y.string()).optional(),default:y.unknown().optional(),minimum:y.number().optional(),maximum:y.number().optional()}),_7=y.object({toolId:y.string().min(1),notes:y.string().min(1)}),f7=y.object({providers:y.array(y.string().min(1)).min(1).max(d7),merge:y.enum(Gv),maxResults:y.number().int().positive().optional()}),Hv=y.object({mode:y.enum(Bv).default("pick_one"),intro:y.string().min(1),defaultTier:y.string().min(1),tiers:y.record(y.string(),_7).refine(t=>Object.keys(t).length>0,{message:"must have at least one tier"}),fanOut:f7.optional(),guidance:y.string().min(1),inputProperties:y.record(y.string(),p7),required:y.array(y.string())}).refine(t=>t.tiers[t.defaultTier]!==void 0,{message:"defaultTier must exist in tiers",path:["defaultTier"]}).refine(t=>t.mode!=="fan_out"||t.fanOut!==void 0,{message:"fan_out mode requires fanOut config",path:["fanOut"]}).refine(t=>t.required.every(e=>e in t.inputProperties),{message:"required entries must exist in inputProperties",path:["required"]}),m7=y.object({version:y.literal(Vv),generatedAt:y.string().datetime(),tools:y.record(y.string().regex(wT,"tool name must match MCP naming rules"),Hv).refine(t=>Object.keys(t).length>0,{message:"manifest must have at least one tool"})});var Fv=require("os"),kT=require("path"),g7=(0,kT.join)((0,Fv.homedir)(),".visa-mcp"),dHe=(0,kT.join)(g7,"mcp-session-budget.json");var _He=Promise.resolve();var NHe=Promise.resolve();var y7=v(ST());var iFe=Promise.resolve();var cFe=new rr(()=>Ne.getSessionToken());var uFe=["","","You're ready to go! Try:","","Core:",'\u2022 "Show my account status" \u2192 get_status','\u2022 "List my enrolled cards" \u2192 get_cards','\u2022 "Show my paid tool use history" \u2192 transaction_history','\u2022 "Set my daily limit to $50" \u2192 update_spending_controls','\u2022 "Generate 3 variations in parallel" \u2192 batch',"","Category tools:",'\u2022 "Generate an image of a sunset over Tokyo" \u2192 generate_image','\u2022 "Make a 4-second video of a penguin juggling" \u2192 generate_video','\u2022 "Make a song about coding late at night" \u2192 generate_music','\u2022 "Create a sound effect for a checkout chime" \u2192 generate_audio','\u2022 "Create a 3D asset from this product sketch" \u2192 generate_3d','\u2022 "Upscale this product image" \u2192 upscale_image','\u2022 "Transcribe this meeting recording" \u2192 transcribe_audio','\u2022 "Run a reasoning model on this prompt" \u2192 run_llm',"","Tool catalog:",'\u2022 "Find an image upscaler" \u2192 discover_tools','\u2022 "Run fal-aura-sr on this URL" \u2192 execute_tool'].join(`
113
+ `);var lFe=16*1024,dFe=50*1024*1024;var O7=["generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card"],fFe=[...O7.map(t=>({id:`legacy.${t}`,match:{kind:"exact_tool",toolId:t},targetToolId:t,rail:"tempo",reason:"Preserve legacy Tempo _card target while the top-level MCP surface is opt-in."}))];var v7={generate_image:{intro:"Generate an AI image.",tiers:{balanced:{toolId:"fal-flux-pro",notes:"FLUX Pro v1.1, 1K, ~10s (DEFAULT \u2014 good quality/speed tradeoff)"},fast:{toolId:"fal-flux-schnell",notes:"FLUX Schnell, 1K, ~3s (drafts, iteration, cheapest)"},pro:{toolId:"fal-flux-pro-ultra",notes:"FLUX Pro Ultra, 2K, ~30s (hero images, detail)"},text_heavy:{toolId:"fal-ideogram-v2",notes:"Ideogram V2 \u2014 best when the image contains rendered text/logos"},vector:{toolId:"fal-recraft-v3",notes:"Recraft V3 \u2014 vector/flat/illustration styles"}},guidance:"If the user didn't specify a tier, pick 'balanced' unless the prompt clearly signals otherwise (text \u2192 text_heavy, logo/icon \u2192 vector, quick test \u2192 fast, hero/print \u2192 pro).",inputProperties:{prompt:{type:"string",description:"Text description of the image to generate."},aspect_ratio:{type:"string",description:'Aspect ratio, e.g. "16:9", "1:1", "9:16".',default:"16:9"}},required:["prompt"]},generate_video:{intro:"Generate an AI video from a text prompt.",tiers:{balanced:{toolId:"fal-minimax-video",notes:"MiniMax \u2014 good quality/price balance (DEFAULT)"},fast:{toolId:"fal-wan-video",notes:"Wan \u2014 cheapest, shorter clips"},pro:{toolId:"fal-kling-video",notes:"Kling \u2014 highest quality, cinematic"}},guidance:"Show the tier menu with prices unless the user specified one. Videos take 60-180s to generate and are processed asynchronously. The response includes a request_id and model_path. Call check_fal_status_card with those values to poll for completion. Do not poll more than once per 30 seconds.",inputProperties:{prompt:{type:"string",description:"Text description of the video scene."},aspect_ratio:{type:"string",description:'Aspect ratio, e.g. "16:9" or "9:16".',default:"16:9"}},required:["prompt"]},generate_music:{intro:"Generate an original music track from a prompt.",tiers:{suno:{toolId:"suno-music",notes:"Suno v4 \u2014 songs with vocals, lyrics, full arrangement"}},guidance:"Takes ~60-90s. Returns an audio URL the user can play.",inputProperties:{prompt:{type:"string",description:"Musical style / mood / lyrics hint."},instrumental:{type:"boolean",description:"True for instrumental (no vocals), false for vocal track.",default:!1}},required:["prompt"]},generate_audio:{intro:"Generate speech (voice cloning) or sound effects.",tiers:{tts:{toolId:"fal-metavoice",notes:"MetaVoice \u2014 voice cloning TTS (requires a voice sample URL)"},sfx:{toolId:"fal-stable-audio",notes:"Stable Audio \u2014 sound effects and ambient from a prompt"}},guidance:"For tts: provide text + audio_url (voice sample to clone). For sfx: provide prompt describing the sound.",inputProperties:{prompt:{type:"string",description:"Description of sound to generate (sfx tier)."},text:{type:"string",description:"Text to speak aloud (tts tier)."},audio_url:{type:"string",description:"URL of a voice sample to clone (tts tier, required for MetaVoice)."}},required:[]},generate_3d:{intro:"Generate a 3D model from an image.",tiers:{trellis:{toolId:"fal-trellis-3d",notes:"Trellis \u2014 image-to-3D, returns a GLB mesh URL"}},guidance:"Pass an image URL. Takes ~30-60s. Returns a downloadable 3D mesh URL.",inputProperties:{image_url:{type:"string",description:"URL of the image to convert to a 3D model."}},required:["image_url"]},upscale_image:{intro:"Upscale an image to higher resolution.",tiers:{aura:{toolId:"fal-aura-sr",notes:"Aura SR \u2014 default; preserves detail without hallucination"}},guidance:"Pass the existing image URL. Returns an upscaled version.",inputProperties:{image_url:{type:"string",description:"URL of the image to upscale."}},required:["image_url"]},transcribe_audio:{intro:"Transcribe speech in an audio/video URL to text.",tiers:{whisper:{toolId:"fal-whisper",notes:"OpenAI Whisper \u2014 fast, multilingual"}},guidance:"Pass the URL. Returns the transcript text.",inputProperties:{audio_url:{type:"string",description:"URL of the audio or video file to transcribe."}},required:["audio_url"]},run_llm:{intro:"Run a text prompt through an LLM (OpenRouter). Token-metered pricing is shown per model.",tiers:{fast:{toolId:"or-gpt-4o-mini",notes:"GPT-4o Mini. Fastest, cheapest, good general-purpose (DEFAULT)"},reasoning:{toolId:"or-claude-sonnet",notes:"Claude Sonnet. Strong reasoning, long-context. Warn user it is materially pricier than `fast`."},deep_reasoning:{toolId:"or-deepseek-r1",notes:"DeepSeek R1. Deep chain-of-thought reasoning, mid-range pricing."},search:{toolId:"or-perplexity-sonar",notes:"Perplexity Sonar. Search-augmented, web-grounded with citations."},open_source:{toolId:"or-llama-70b",notes:"Llama 3.3 70B. Open-source large model."},coding:{toolId:"or-deepseek-chat",notes:"DeepSeek Chat V3. Strong at code generation."}},guidance:"Pick based on the user's need: fast (most questions, cheapest), reasoning (complex analysis; warn user it is materially pricier than fast), search (questions about current events), coding (code generation), deep_reasoning (hard math/logic problems).",inputProperties:{prompt:{type:"string",description:"The user query."},system_prompt:{type:"string",description:"Optional system prompt to set model behavior."},max_tokens:{type:"number",description:"Maximum output tokens.",default:1024,minimum:1,maximum:8192},temperature:{type:"number",description:"Sampling temperature \u2014 0 is deterministic, higher is more creative.",default:.7,minimum:0,maximum:2}},required:["prompt"]}};var ku=Object.keys(v7);var I7=["get_status","add_card","pay","get_visa_smi","get_cards","remove_card","set_default_card","buy_credits","transaction_history","update_spending_controls","config_list","config_set","config_unset","biometric_status","biometric_on","biometric_off","reset","login","start_session","close_session","get_session_status","set_session_mode","generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card","feedback","suggest_meme_templates","batch","discover_tools","execute_tool"];function P7(){let t=new Set;for(let e of I7)t.add(e),t.add(e.replace(/-/g,"_")),t.add(e.replace(/_/g,"-"));for(let e of ku)t.add(e),t.add(e.replace(/-/g,"_")),t.add(e.replace(/_/g,"-"));return t}var IFe=P7();var VT=new Set(["generate_image_card","generate_image_fast_card","generate_video_tempo_card","generate_music_tempo_card","check_music_status_tempo_card","query_onchain_prices_card"]);var DFe=new Set(ku),UFe=new Set(["batch","buy_credits","execute_tool","get_visa_smi",...VT,...ku]);var _e=v(require("fs")),se=v(require("path")),$v=v(require("os")),We=$v.homedir(),b7=["Claude_","Anthropic.ClaudeDesktop_"],ba=class extends Error{constructor(n,r,o){super(L7(n,r,o));this.client=n;this.configPath=r;this.name="McpConfigAccessError"}client;configPath};function jv(t){let e=t;return[e?.message,e?.stderr].filter(n=>typeof n=="string").join(`
114
+ `)}function M7(t){let e=t;if(e?.code==="EPERM"||e?.code==="EACCES")return!0;let n=jv(t).toLowerCase();return n.includes("operation not permitted")||n.includes("permission denied")}function L7(t,e,n){let r=e.replace(We,"~"),o=jv(n).split(`
115
+ `).find(Boolean),s=o?` (${o})`:"";return t.id==="codex"?`Could not update Codex MCP config at ${r}: filesystem access was denied${s}. In Codex, rerun with elevated filesystem access or run \`visa-cli install codex\` outside the sandbox.`:`Could not update ${t.displayName} MCP config at ${r}: filesystem access was denied${s}.`}function Vu(){return process.env.APPDATA||se.join(We,"AppData","Roaming")}function x7(){return process.env.LOCALAPPDATA||se.join(We,"AppData","Local")}function BT(t){return process.platform==="win32"?t.win32:t.posix}function qv(){if(process.platform!=="win32")return;let t=se.join(x7(),"Packages");if(_e.existsSync(t))try{let e=_e.readdirSync(t,"utf-8");for(let n of b7){let r=e.filter(o=>o.startsWith(n)).sort()[0];if(r)return se.join(t,r,"LocalCache","Roaming","Claude")}}catch{return}}function Yv(){if(process.platform==="win32"){let t=qv();return t?se.join(t,"claude_desktop_config.json"):se.join(Vu(),"Claude","claude_desktop_config.json")}return se.join(We,"Library","Application Support","Claude","claude_desktop_config.json")}function Kv(){if(process.platform!=="win32")return[se.join(We,"Library","Application Support","Claude")];let t=[se.join(Vu(),"Claude")],e=qv();return e&&t.push(e),t}function bp(t){return t.id==="claude-desktop"?Yv():t.globalConfigPath}function D7(t){return t.id==="claude-desktop"?Kv():t.detectPaths}var sr=[{id:"claude",displayName:"Claude Code",globalConfigPath:se.join(We,".claude.json"),configKey:"mcpServers",detectPaths:[se.join(We,".claude.json")],postInstallHint:"Restart Claude Code or run /mcp to connect."},{id:"claude-desktop",displayName:"Claude Desktop",globalConfigPath:Yv(),configKey:"mcpServers",detectPaths:Kv(),postInstallHint:"Restart the Claude desktop app to connect."},{id:"cursor",displayName:"Cursor",globalConfigPath:se.join(We,".cursor","mcp.json"),configKey:"mcpServers",detectPaths:[se.join(We,".cursor")],postInstallHint:"Restart Cursor to connect."},{id:"windsurf",displayName:"Windsurf",globalConfigPath:se.join(We,".codeium","windsurf","mcp_config.json"),configKey:"mcpServers",detectPaths:[se.join(We,".codeium","windsurf")],postInstallHint:"Restart Windsurf to connect."},{id:"cline",displayName:"Cline",globalConfigPath:se.join(We,".vscode","mcp.json"),configKey:"mcpServers",detectPaths:[se.join(We,".vscode","extensions","saoudrizwan.claude-dev-*")],postInstallHint:"Restart VS Code to connect."},{id:"roo-code",displayName:"Roo Code",globalConfigPath:BT({win32:se.join(Vu(),"Roo","mcp_settings.json"),posix:se.join(We,".config","Roo","mcp_settings.json")}),configKey:"mcpServers",detectPaths:[se.join(We,".vscode","extensions","RooVeterinaryInc.roo-cline-*")],postInstallHint:"Restart VS Code to connect."},{id:"copilot",displayName:"VS Code Copilot",globalConfigPath:se.join(We,".vscode","mcp.json"),configKey:"servers",detectPaths:[se.join(We,".vscode")],postInstallHint:"Restart VS Code to connect."},{id:"zed",displayName:"Zed",globalConfigPath:BT({win32:se.join(Vu(),"Zed","settings.json"),posix:se.join(We,".config","zed","settings.json")}),configKey:"context_servers",detectPaths:BT({win32:[se.join(Vu(),"Zed")],posix:[se.join(We,".config","zed")]}),postInstallHint:"Restart Zed to connect.",buildEntry:t=>({source:"custom",...t})},{id:"codex",displayName:"Codex",globalConfigPath:se.join(We,".codex","config.toml"),configKey:"mcp_servers",configFormat:"toml",detectPaths:[se.join(We,".codex")],postInstallHint:"Restart Codex to connect. For the terminal HUD, run: visa-cli hud enable"}];function GT(t){return sr.find(e=>e.id===t)}function Bu(t){return D7(t).some(e=>{if(e.includes("*")){let n=se.dirname(e),r=se.basename(e).replaceAll("*","");if(!_e.existsSync(n))return!1;try{return _e.readdirSync(n).some(o=>o.startsWith(r))}catch{return!1}}return _e.existsSync(e)})}function Wv(){return{command:"node",args:[se.resolve(__dirname,"mcp-server/index.js")]}}function HT(t,e){return e==="project"?"json":t.configFormat??"json"}function U7(t){if(t=t.trim(),t==="true")return!0;if(t==="false")return!1;if(t.startsWith('"')&&t.endsWith('"'))return t.slice(1,-1);if(t.startsWith("[")&&t.endsWith("]")){let n=t.slice(1,-1).trim();return n.length===0?[]:n.split(",").map(r=>r.trim()).filter(Boolean).map(r=>r.startsWith('"')&&r.endsWith('"')?r.slice(1,-1):r)}let e=Number(t);return isNaN(e)?t:e}function FT(t,e){let n=`[mcp_servers.${e}]`,r=t.findIndex(s=>s.trim()===n);if(r===-1)return;let o=r+1;for(;o<t.length&&!t[o].trim().startsWith("[");)o++;return{start:r,end:o}}function $T(t,e){let n=t.split(`
116
+ `),r=FT(n,e);if(!r)return;let o={};for(let s=r.start+1;s<r.end;s++){let i=n[s].trim().match(/^(\w+)\s*=\s*(.+)$/);i&&(o[i[1]]=U7(i[2]))}return Object.keys(o).length>0?o:void 0}function w7(t,e,n){let r=`[${n.args.map(c=>`"${c}"`).join(", ")}]`,o=[`[mcp_servers.${e}]`,`command = "${n.command}"`,`args = ${r}`],s=t.split(`
117
+ `),i=FT(s,e);if(i){s.splice(i.start,i.end-i.start,...o);let c=s.join(`
118
118
  `);return c.endsWith(`
119
119
  `)?c:c+`
120
120
  `}let a=t.trimEnd();return a+(a.length>0?`
121
121
 
122
122
  `:"")+o.join(`
123
123
  `)+`
124
- `}function L7(t,e){let n=t.split(`
125
- `),r=HT(n,e);return r?(n.splice(r.start,r.end-r.start),n.join(`
124
+ `}function k7(t,e){let n=t.split(`
125
+ `),r=FT(n,e);return r?(n.splice(r.start,r.end-r.start),n.join(`
126
126
  `).replace(/\n{3,}/g,`
127
127
 
128
- `)):t}function Gu(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):Pp(t);try{let r=se.dirname(n);_e.existsSync(r)||_e.mkdirSync(r,{recursive:!0});let o=GT(t,e),s=qv();if(o==="toml"){let i=_e.existsSync(n)?_e.readFileSync(n,"utf-8"):"",a=M7(i,"visa-cli",s);_e.writeFileSync(n,a)}else{let i={};if(_e.existsSync(n))try{i=JSON.parse(_e.readFileSync(n,"utf-8"))}catch{i={}}i[t.configKey]=i[t.configKey]||{},i[t.configKey]["visa-cli"]=t.buildEntry?t.buildEntry(s):s,_e.writeFileSync(n,JSON.stringify(i,null,2)+`
129
- `)}}catch(r){throw C7(r)?new ba(t,n,r):r}return{installed:!0,configPath:n,message:t.postInstallHint}}function $T(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):Pp(t);if(!_e.existsSync(n))return{removed:!1,configPath:n};if(GT(t,e)==="toml"){let i=_e.readFileSync(n,"utf-8");return FT(i,"visa-cli")?(_e.writeFileSync(n,L7(i,"visa-cli")),{removed:!0,configPath:n}):{removed:!1,configPath:n}}let o;try{o=JSON.parse(_e.readFileSync(n,"utf-8"))}catch{return{removed:!1,configPath:n}}let s=o[t.configKey];return!s||!s["visa-cli"]?{removed:!1,configPath:n}:(delete s["visa-cli"],_e.writeFileSync(n,JSON.stringify(o,null,2)+`
130
- `),{removed:!0,configPath:n})}function Yv(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):Pp(t);if(!_e.existsSync(n))return!1;if(GT(t,e)==="toml")try{let o=_e.readFileSync(n,"utf-8");return!!FT(o,"visa-cli")}catch{return!1}try{return!!JSON.parse(_e.readFileSync(n,"utf-8"))?.[t.configKey]?.["visa-cli"]}catch{return!1}}function x7(t){if(!t||typeof t!="object")return;let e=t;if(e.command!=="node"||!Array.isArray(e.args)||e.args.length===0)return;let n=e.args[e.args.length-1];if(!(typeof n!="string"||n.length===0))return n}function D7(t,e){if(t===e)return!0;let n=se.resolve(t),r=se.resolve(e);if(n===r)return!0;try{let o=_e.realpathSync(n),s=_e.realpathSync(r);return o===s}catch{return!1}}function Hu(){let t=qv(),e=t.args[t.args.length-1],n=[];for(let r of or){let o=Pp(r);if(!_e.existsSync(o))continue;let s=r.configFormat??"json",i;if(s==="toml")try{let u=_e.readFileSync(o,"utf-8");i=FT(u,"visa-cli")}catch{continue}else{let u;try{u=JSON.parse(_e.readFileSync(o,"utf-8"))}catch{continue}i=u?.[r.configKey]?.["visa-cli"]}if(!i)continue;let a=x7(i);if(!a||D7(a,e))continue;let c=_e.existsSync(a)?"mismatch":"missing";n.push({client:r,configPath:o,currentPath:a,expectedPath:e,staleReason:c})}return n}function jT(t){return{configPath:Gu(t.client,"global").configPath}}L();var h5=v(ZV(),1);var k=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Q=globalThis;var Oe="9.47.1";function en(){return as(Q),Q}function as(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Oe,e[Oe]=e[Oe]||{}}function To(t,e,n=Q){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Oe]=r[Oe]||{};return o[t]||(o[t]=e())}var yl=["debug","info","warn","error","log","assert","trace"],kTe="Sentry Logger ",tc={};function Fe(t){if(!("console"in Q))return t();let e=Q.console,n={},r=Object.keys(tc);r.forEach(o=>{let s=tc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function VTe(){CA().enabled=!0}function BTe(){CA().enabled=!1}function QV(){return CA().enabled}function GTe(...t){NA("log",...t)}function HTe(...t){NA("warn",...t)}function FTe(...t){NA("error",...t)}function NA(t,...e){k&&QV()&&Fe(()=>{Q.console[t](`${kTe}[${t}]:`,...e)})}function CA(){return k?To("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var T={enable:VTe,disable:BTe,isEnabled:QV,log:GTe,warn:HTe,error:FTe};var eB=/\(error: (.*)\)/,tB=/captureMessage|captureException/;function Nf(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
131
- `);for(let a=r;a<i.length;a++){let c=i[a];if(c.length>1024)continue;let u=eB.test(c)?c.replace(eB,"$1"):c;if(!u.match(/\S*Error: /)){for(let l of e){let d=l(u);if(d){s.push(d);break}}if(s.length>=50+o)break}}return nB(s.slice(o))}}function IA(t){return Array.isArray(t)?Nf(...t):t}function nB(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Of(e).function||"")&&e.pop(),e.reverse(),tB.test(Of(e).function||"")&&(e.pop(),tB.test(Of(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Of(e).filename,function:n.function||"?"}))}function Of(t){return t[t.length-1]||{}}var vA="<anonymous>";function Ol(t){try{return!t||typeof t!="function"?vA:t.name||vA}catch{return vA}}var Cf={},rB={};function nc(t,e){Cf[t]=Cf[t]||[],Cf[t].push(e)}function rc(t,e){if(!rB[t]){rB[t]=!0;try{e()}catch(n){k&&T.error(`Error while instrumenting ${t}`,n)}}}function oc(t,e){let n=t&&Cf[t];if(n)for(let r of n)try{r(e)}catch(o){k&&T.error(`Error while triggering instrumentation handler.
128
+ `)):t}function Gu(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):bp(t);try{let r=se.dirname(n);_e.existsSync(r)||_e.mkdirSync(r,{recursive:!0});let o=HT(t,e),s=Wv();if(o==="toml"){let i=_e.existsSync(n)?_e.readFileSync(n,"utf-8"):"",a=w7(i,"visa-cli",s);_e.writeFileSync(n,a)}else{let i={};if(_e.existsSync(n))try{i=JSON.parse(_e.readFileSync(n,"utf-8"))}catch{i={}}i[t.configKey]=i[t.configKey]||{},i[t.configKey]["visa-cli"]=t.buildEntry?t.buildEntry(s):s,_e.writeFileSync(n,JSON.stringify(i,null,2)+`
129
+ `)}}catch(r){throw M7(r)?new ba(t,n,r):r}return{installed:!0,configPath:n,message:t.postInstallHint}}function jT(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):bp(t);if(!_e.existsSync(n))return{removed:!1,configPath:n};if(HT(t,e)==="toml"){let i=_e.readFileSync(n,"utf-8");return $T(i,"visa-cli")?(_e.writeFileSync(n,k7(i,"visa-cli")),{removed:!0,configPath:n}):{removed:!1,configPath:n}}let o;try{o=JSON.parse(_e.readFileSync(n,"utf-8"))}catch{return{removed:!1,configPath:n}}let s=o[t.configKey];return!s||!s["visa-cli"]?{removed:!1,configPath:n}:(delete s["visa-cli"],_e.writeFileSync(n,JSON.stringify(o,null,2)+`
130
+ `),{removed:!0,configPath:n})}function zv(t,e="global"){let n=e==="project"?se.join(process.cwd(),".mcp.json"):bp(t);if(!_e.existsSync(n))return!1;if(HT(t,e)==="toml")try{let o=_e.readFileSync(n,"utf-8");return!!$T(o,"visa-cli")}catch{return!1}try{return!!JSON.parse(_e.readFileSync(n,"utf-8"))?.[t.configKey]?.["visa-cli"]}catch{return!1}}function V7(t){if(!t||typeof t!="object")return;let e=t;if(e.command!=="node"||!Array.isArray(e.args)||e.args.length===0)return;let n=e.args[e.args.length-1];if(!(typeof n!="string"||n.length===0))return n}function B7(t,e){if(t===e)return!0;let n=se.resolve(t),r=se.resolve(e);if(n===r)return!0;try{let o=_e.realpathSync(n),s=_e.realpathSync(r);return o===s}catch{return!1}}function Hu(){let t=Wv(),e=t.args[t.args.length-1],n=[];for(let r of sr){let o=bp(r);if(!_e.existsSync(o))continue;let s=r.configFormat??"json",i;if(s==="toml")try{let u=_e.readFileSync(o,"utf-8");i=$T(u,"visa-cli")}catch{continue}else{let u;try{u=JSON.parse(_e.readFileSync(o,"utf-8"))}catch{continue}i=u?.[r.configKey]?.["visa-cli"]}if(!i)continue;let a=V7(i);if(!a||B7(a,e))continue;let c=_e.existsSync(a)?"mismatch":"missing";n.push({client:r,configPath:o,currentPath:a,expectedPath:e,staleReason:c})}return n}function qT(t){return{configPath:Gu(t.client,"global").configPath}}L();var y5=v(tB(),1);var k=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;var Q=globalThis;var Oe="9.47.1";function en(){return as(Q),Q}function as(t){let e=t.__SENTRY__=t.__SENTRY__||{};return e.version=e.version||Oe,e[Oe]=e[Oe]||{}}function To(t,e,n=Q){let r=n.__SENTRY__=n.__SENTRY__||{},o=r[Oe]=r[Oe]||{};return o[t]||(o[t]=e())}var yl=["debug","info","warn","error","log","assert","trace"],FTe="Sentry Logger ",tc={};function Fe(t){if(!("console"in Q))return t();let e=Q.console,n={},r=Object.keys(tc);r.forEach(o=>{let s=tc[o];n[o]=e[o],e[o]=s});try{return t()}finally{r.forEach(o=>{e[o]=n[o]})}}function $Te(){vA().enabled=!0}function jTe(){vA().enabled=!1}function nB(){return vA().enabled}function qTe(...t){CA("log",...t)}function YTe(...t){CA("warn",...t)}function KTe(...t){CA("error",...t)}function CA(t,...e){k&&nB()&&Fe(()=>{Q.console[t](`${FTe}[${t}]:`,...e)})}function vA(){return k?To("loggerSettings",()=>({enabled:!1})):{enabled:!1}}var T={enable:$Te,disable:jTe,isEnabled:nB,log:qTe,warn:YTe,error:KTe};var rB=/\(error: (.*)\)/,oB=/captureMessage|captureException/;function Cf(...t){let e=t.sort((n,r)=>n[0]-r[0]).map(n=>n[1]);return(n,r=0,o=0)=>{let s=[],i=n.split(`
131
+ `);for(let a=r;a<i.length;a++){let c=i[a];if(c.length>1024)continue;let u=rB.test(c)?c.replace(rB,"$1"):c;if(!u.match(/\S*Error: /)){for(let l of e){let d=l(u);if(d){s.push(d);break}}if(s.length>=50+o)break}}return sB(s.slice(o))}}function PA(t){return Array.isArray(t)?Cf(...t):t}function sB(t){if(!t.length)return[];let e=Array.from(t);return/sentryWrapped/.test(Nf(e).function||"")&&e.pop(),e.reverse(),oB.test(Nf(e).function||"")&&(e.pop(),oB.test(Nf(e).function||"")&&e.pop()),e.slice(0,50).map(n=>({...n,filename:n.filename||Nf(e).filename,function:n.function||"?"}))}function Nf(t){return t[t.length-1]||{}}var IA="<anonymous>";function Ol(t){try{return!t||typeof t!="function"?IA:t.name||IA}catch{return IA}}var vf={},iB={};function nc(t,e){vf[t]=vf[t]||[],vf[t].push(e)}function rc(t,e){if(!iB[t]){iB[t]=!0;try{e()}catch(n){k&&T.error(`Error while instrumenting ${t}`,n)}}}function oc(t,e){let n=t&&vf[t];if(n)for(let r of n)try{r(e)}catch(o){k&&T.error(`Error while triggering instrumentation handler.
132
132
  Type: ${t}
133
133
  Name: ${Ol(r)}
134
- Error:`,o)}}var PA=null;function oB(t){let e="error";nc(e,t),rc(e,$Te)}function $Te(){PA=Q.onerror,Q.onerror=function(t,e,n,r,o){return oc("error",{column:r,error:o,line:n,msg:t,url:e}),PA?PA.apply(this,arguments):!1},Q.onerror.__SENTRY_INSTRUMENTED__=!0}var bA=null;function sB(t){let e="unhandledrejection";nc(e,t),rc(e,jTe)}function jTe(){bA=Q.onunhandledrejection,Q.onunhandledrejection=function(t){return oc("unhandledrejection",t),bA?bA.apply(this,arguments):!0},Q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var iB=Object.prototype.toString;function cs(t){switch(iB.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Br(t,Error)}}function vf(t,e){return iB.call(t)===`[object ${e}]`}function MA(t){return vf(t,"ErrorEvent")}function us(t){return vf(t,"String")}function sc(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ic(t){return t===null||sc(t)||typeof t!="object"&&typeof t!="function"}function go(t){return vf(t,"Object")}function LA(t){return typeof Event<"u"&&Br(t,Event)}function xA(t){return typeof Element<"u"&&Br(t,Element)}function DA(t){return vf(t,"RegExp")}function cr(t){return!!(t?.then&&typeof t.then=="function")}function UA(t){return go(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Br(t,e){try{return t instanceof e}catch{return!1}}function Nl(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}var qTe=Q,YTe=80;function aB(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||YTe;for(;n&&s++<r&&(u=KTe(n,l),!(u==="html"||s>1&&i+o.length*c+u.length>=d));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function KTe(t,e){let n=t,r=[];if(!n?.tagName)return"";if(qTe.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=e?.length?e.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&us(i)){let a=i.split(/\s+/);for(let c of a)r.push(`.${c}`)}}let s=["aria-label","type","name","title","alt"];for(let i of s){let a=n.getAttribute(i);a&&r.push(`[${i}="${a}"]`)}return r.join("")}function Gr(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function wA(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function kA(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];try{Nl(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function cB(t,e,n=!1){return us(t)?DA(e)?e.test(t):us(e)?n?t===e:t.includes(e):!1:!1}function ls(t,e=[],n=!1){return e.some(r=>cB(t,r,n))}function VA(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&dB(o,r);try{t[e]=o}catch{k&&T.log(`Failed to replace method "${e}" in object`,t)}}function rt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{k&&T.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function dB(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,rt(t,"__sentry_original__",e)}catch{}}function BA(t){return t.__sentry_original__}function If(t){if(cs(t))return{message:t.message,name:t.name,stack:t.stack,...lB(t)};if(LA(t)){let e={type:t.type,target:uB(t.target),currentTarget:uB(t.currentTarget),...lB(t)};return typeof CustomEvent<"u"&&Br(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function uB(t){try{return xA(t)?aB(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function lB(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function GA(t,e=40){let n=Object.keys(If(t));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Gr(r,e);for(let o=n.length;o>0;o--){let s=n.slice(0,o).join(", ");if(!(s.length>e))return o===n.length?s:Gr(s,e)}return""}function WTe(){let t=Q;return t.crypto||t.msCrypto}function dt(t=WTe()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{let n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(e()&15)>>n/4).toString(16))}function pB(t){return t.exception?.values?.[0]}function ds(t){let{message:e,event_id:n}=t;if(e)return e;let r=pB(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function FA(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function ac(t,e){let n=pB(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let s={...o?.data,...e.data};n.mechanism.data=s}}var zTe=/^(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 HA(t){return parseInt(t||"",10)}function $A(t){let e=t.match(zTe)||[],n=HA(e[1]),r=HA(e[2]),o=HA(e[3]);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:e[4]}}function Pf(t){if(XTe(t))return!0;try{rt(t,"__sentry_captured__",!0)}catch{}return!1}function XTe(t){try{return t.__sentry_captured__}catch{}}var fB=1e3;function ho(){return Date.now()/fB}function JTe(){let{performance:t}=Q;if(!t?.now||!t.timeOrigin)return ho;let e=t.timeOrigin;return()=>(e+t.now())/fB}var _B;function ps(){return(_B??(_B=JTe()))()}function mB(t){let e=ps(),n={sid:dt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>ZTe(n)};return t&&Ao(n,t),n}function Ao(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||ps(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:dt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function EB(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Ao(t,n)}function ZTe(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function _s(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=_s(r[o],e[o],n-1));return r}function ur(){return dt()}function On(){return dt().substring(16)}var jA="_sentrySpan";function Li(t,e){e?rt(t,jA,e):delete t[jA]}function xi(t){return t[jA]}var QTe=100,_n=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:ur(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Li(e,xi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ao(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():go(n)?e:void 0,{tags:o,extra:s,user:i,contexts:a,level:c,fingerprint:u=[],propagationContext:l}=r||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},i&&Object.keys(i).length&&(this._user=i),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Li(this,void 0),this._attachments=[],this.setPropagationContext({traceId:ur(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:QTe;if(r<=0)return this;let o={timestamp:ho(),...e,message:e.message?Gr(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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:xi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=_s(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||dt();if(!this._client)return k&&T.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||dt();if(!this._client)return k&&T.warn("No client configured on scope - will not capture message!"),o;let s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:o},this),o}captureEvent(e,n){let r=n?.event_id||dt();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(k&&T.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function cc(){return To("defaultCurrentScope",()=>new _n)}function Hr(){return To("defaultIsolationScope",()=>new _n)}var qA=class{constructor(e,n){let r;e?r=e:r=new _n;let o;n?o=n:o=new _n,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return cr(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function uc(){let t=en(),e=as(t);return e.stack=e.stack||new qA(cc(),Hr())}function ege(t){return uc().withScope(t)}function tge(t,e){let n=uc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function SB(t){return uc().withScope(()=>t(uc().getIsolationScope()))}function TB(){return{withIsolationScope:SB,withScope:ege,withSetScope:tge,withSetIsolationScope:(t,e)=>SB(e),getCurrentScope:()=>uc().getScope(),getIsolationScope:()=>uc().getIsolationScope()}}function YA(t){let e=en(),n=as(e);n.acs=t}function lr(t){let e=as(t);return e.acs?e.acs:TB()}function ie(){let t=en();return lr(t).getCurrentScope()}function Te(){let t=en();return lr(t).getIsolationScope()}function bf(){return To("globalScope",()=>new _n)}function Fr(...t){let e=en(),n=lr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function Cl(...t){let e=en(),n=lr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function j(){return ie().getClient()}function lc(t){let e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=e,s={trace_id:n,span_id:o||On()};return r&&(s.parent_span_id=r),s}var pt="sentry.source",dr="sentry.sample_rate",KA="sentry.previous_trace_sample_rate",re="sentry.op",ge="sentry.origin";var WA="sentry.measurement_unit",zA="sentry.measurement_value",$r="sentry.custom_span_name",dc="sentry.profile_id",pc="sentry.exclusive_time",XA="cache.hit",JA="cache.key",ZA="cache.item_size";function Mf(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){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:"unknown_error"}}var gB="_sentryScope",hB="_sentryIsolationScope";function vl(t,e,n){t&&(rt(t,hB,n),rt(t,gB,e))}function pr(t){return{scope:t[gB],isolationScope:t[hB]}}var Il="sentry-",RB=/^sentry-/,yB=8192;function fs(t){let e=Ui(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,s])=>{if(o.match(RB)){let i=o.slice(Il.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Di(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${Il}${r}`]=o),n),{});return Lf(e)}function Ui(t){if(!(!t||!us(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=AB(n);return Object.entries(r).forEach(([o,s])=>{e[o]=s}),e},{}):AB(t)}function AB(t){return t.split(",").map(e=>e.split("=").map(n=>{try{return decodeURIComponent(n.trim())}catch{return}})).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function Lf(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${e},${s}`;return i.length>yB?(k&&T.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):i},"")}function Nn(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var xf=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function OB(t){if(!t)return;let e=t.match(xf);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function Pl(t,e){let n=OB(t),r=fs(e);if(!n?.traceId)return{traceId:ur(),sampleRand:Math.random()};let o=nge(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function ms(t=ur(),e=On(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function nge(t,e){let n=Nn(e?.sample_rand);if(n!==void 0)return n;let r=Nn(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?Math.random()*r:r+Math.random()*(1-r):Math.random()}var Uf=0,wf=1,NB=!1;function vB(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=q(t);return{parent_span_id:s,span_id:e,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function Es(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:q(t).parent_span_id,s=pr(t).scope,i=r?s?.getPropagationContext().propagationSpanId||On():e;return{parent_span_id:o,span_id:i,trace_id:n}}function kf(t){let{traceId:e,spanId:n}=t.spanContext(),r=jr(t);return ms(e,n,r)}function wi(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:e,trace_id:n,sampled:r===wf,attributes:s,...o}))}function fn(t){return typeof t=="number"?CB(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?CB(t.getTime()):ps()}function CB(t){return t>9999999999?t/1e3:t}function q(t){if(sge(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(oge(t)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=t,u="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:s,parent_span_id:u,start_timestamp:fn(o),timestamp:fn(i)||void 0,status:ki(a),op:r[re],origin:r[ge],links:wi(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function oge(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function sge(t){return typeof t.getSpanJSON=="function"}function jr(t){let{traceFlags:e}=t.spanContext();return e===wf}function ki(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var bl="_sentryChildSpans",QA="_sentryRootSpan";function _c(t,e){let n=t[QA]||t;rt(e,QA,n),t[bl]?t[bl].add(e):rt(t,bl,new Set([e]))}function Vf(t){let e=new Set;function n(r){if(!e.has(r)&&jr(r)){e.add(r);let o=r[bl]?Array.from(r[bl]):[];for(let s of o)n(s)}}return n(t),Array.from(e)}function $e(t){return t[QA]||t}function qr(){let t=en(),e=lr(t);return e.getActiveSpan?e.getActiveSpan():xi(ie())}function Ml(){NB||(Fe(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),NB=!0)}var IB=!1;function PB(){if(IB)return;function t(){let e=qr(),n=e&&$e(e);if(n){let r="internal_error";k&&T.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}t.tag="sentry_tracingErrorCallback",IB=!0,oB(t),sB(t)}function yt(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||j()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var fc="production";var ige=/^o(\d+)\./,age=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function cge(t){return t==="http"||t==="https"}function fr(t,e=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function uge(t){let e=age.exec(t);if(!e){Fe(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",s="",i="",a=""]=e.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let d=u.match(/^\d+/);d&&(u=d[0])}return bB({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function bB(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function lge(t){if(!k)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(T.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?cge(r)?e&&isNaN(parseInt(e,10))?(T.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(T.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(T.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function MB(t){return t.match(ige)?.[1]}function LB(t){let e=typeof t=="string"?uge(t):bB(t);if(!(!e||!lge(e)))return e}var xB="_frozenDsc";function Bf(t,e){rt(t,xB,e)}function eR(t,e){let n=e.getOptions(),{publicKey:r,host:o}=e.getDsn()||{},s;n.orgId?s=String(n.orgId):o&&(s=MB(o));let i={environment:n.environment||fc,release:n.release,public_key:r,trace_id:t,org_id:s};return e.emit("createDsc",i),i}function Ro(t,e){let n=e.getPropagationContext();return n.dsc||eR(n.traceId,t)}function Je(t){let e=j();if(!e)return{};let n=$e(t),r=q(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[dr]??o[KA];function a(f){return(typeof i=="number"||typeof i=="string")&&(f.sample_rate=`${i}`),f}let c=n[xB];if(c)return a(c);let u=s?.get("sentry.dsc"),l=u&&fs(u);if(l)return a(l);let d=eR(t.spanContext().traceId,e),p=o[pt],_=r.description;return p!=="url"&&_&&(d.transaction=_),yt()&&(d.sampled=String(jr(n)),d.sample_rand=s?.get("sentry.sample_rand")??pr(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}var Vi=class{constructor(e={}){this._traceId=e.traceId||ur(),this._spanId=e.spanId||On()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:Uf}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function mr(t,e=100,n=1/0){try{return tR("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function nR(t,e=3,n=100*1024){let r=mr(t,e);return fge(r)>n?nR(t,e-1,n):r}function tR(t,e,n=1/0,r=1/0,o=mge()){let[s,i]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=dge(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";let u=e;if(u&&typeof u.toJSON=="function")try{let _=u.toJSON();return tR("",_,c-1,r,o)}catch{}let l=Array.isArray(e)?[]:{},d=0,p=If(e);for(let _ in p){if(!Object.prototype.hasOwnProperty.call(p,_))continue;if(d>=r){l[_]="[MaxProperties ~]";break}let f=p[_];l[_]=tR(_,f,c-1,r,o),d++}return i(e),l}function dge(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Nl(e))return"[VueViewModel]";if(UA(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${Ol(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=pge(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function pge(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function _ge(t){return~-encodeURI(t).split(/%..|./).length}function fge(t){return _ge(JSON.stringify(t))}function mge(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function Cn(t,e=[]){return[t,e]}function oR(t,e){let[n,r]=t;return[n,[...r,e]]}function Gf(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function rR(t){let e=as(Q);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Ll(t){let[e,n]=t,r=JSON.stringify(e);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[rR(r),s]:r.push(typeof s=="string"?rR(s):s)}for(let s of n){let[i,a]=s;if(o(`
134
+ Error:`,o)}}var bA=null;function aB(t){let e="error";nc(e,t),rc(e,WTe)}function WTe(){bA=Q.onerror,Q.onerror=function(t,e,n,r,o){return oc("error",{column:r,error:o,line:n,msg:t,url:e}),bA?bA.apply(this,arguments):!1},Q.onerror.__SENTRY_INSTRUMENTED__=!0}var MA=null;function cB(t){let e="unhandledrejection";nc(e,t),rc(e,zTe)}function zTe(){MA=Q.onunhandledrejection,Q.onunhandledrejection=function(t){return oc("unhandledrejection",t),MA?MA.apply(this,arguments):!0},Q.onunhandledrejection.__SENTRY_INSTRUMENTED__=!0}var uB=Object.prototype.toString;function cs(t){switch(uB.call(t)){case"[object Error]":case"[object Exception]":case"[object DOMException]":case"[object WebAssembly.Exception]":return!0;default:return Br(t,Error)}}function If(t,e){return uB.call(t)===`[object ${e}]`}function LA(t){return If(t,"ErrorEvent")}function us(t){return If(t,"String")}function sc(t){return typeof t=="object"&&t!==null&&"__sentry_template_string__"in t&&"__sentry_template_values__"in t}function ic(t){return t===null||sc(t)||typeof t!="object"&&typeof t!="function"}function go(t){return If(t,"Object")}function xA(t){return typeof Event<"u"&&Br(t,Event)}function DA(t){return typeof Element<"u"&&Br(t,Element)}function UA(t){return If(t,"RegExp")}function ur(t){return!!(t?.then&&typeof t.then=="function")}function wA(t){return go(t)&&"nativeEvent"in t&&"preventDefault"in t&&"stopPropagation"in t}function Br(t,e){try{return t instanceof e}catch{return!1}}function Nl(t){return!!(typeof t=="object"&&t!==null&&(t.__isVue||t._isVue))}var XTe=Q,JTe=80;function lB(t,e={}){if(!t)return"<unknown>";try{let n=t,r=5,o=[],s=0,i=0,a=" > ",c=a.length,u,l=Array.isArray(e)?e:e.keyAttrs,d=!Array.isArray(e)&&e.maxStringLength||JTe;for(;n&&s++<r&&(u=ZTe(n,l),!(u==="html"||s>1&&i+o.length*c+u.length>=d));)o.push(u),i+=u.length,n=n.parentNode;return o.reverse().join(a)}catch{return"<unknown>"}}function ZTe(t,e){let n=t,r=[];if(!n?.tagName)return"";if(XTe.HTMLElement&&n instanceof HTMLElement&&n.dataset){if(n.dataset.sentryComponent)return n.dataset.sentryComponent;if(n.dataset.sentryElement)return n.dataset.sentryElement}r.push(n.tagName.toLowerCase());let o=e?.length?e.filter(i=>n.getAttribute(i)).map(i=>[i,n.getAttribute(i)]):null;if(o?.length)o.forEach(i=>{r.push(`[${i[0]}="${i[1]}"]`)});else{n.id&&r.push(`#${n.id}`);let i=n.className;if(i&&us(i)){let a=i.split(/\s+/);for(let c of a)r.push(`.${c}`)}}let s=["aria-label","type","name","title","alt"];for(let i of s){let a=n.getAttribute(i);a&&r.push(`[${i}="${a}"]`)}return r.join("")}function Gr(t,e=0){return typeof t!="string"||e===0||t.length<=e?t:`${t.slice(0,e)}...`}function kA(t,e){let n=t,r=n.length;if(r<=150)return n;e>r&&(e=r);let o=Math.max(e-60,0);o<5&&(o=0);let s=Math.min(o+140,r);return s>r-5&&(s=r),s===r&&(o=Math.max(s-140,0)),n=n.slice(o,s),o>0&&(n=`'{snip} ${n}`),s<r&&(n+=" {snip}"),n}function VA(t,e){if(!Array.isArray(t))return"";let n=[];for(let r=0;r<t.length;r++){let o=t[r];try{Nl(o)?n.push("[VueViewModel]"):n.push(String(o))}catch{n.push("[value cannot be serialized]")}}return n.join(e)}function dB(t,e,n=!1){return us(t)?UA(e)?e.test(t):us(e)?n?t===e:t.includes(e):!1:!1}function ls(t,e=[],n=!1){return e.some(r=>dB(t,r,n))}function BA(t,e,n){if(!(e in t))return;let r=t[e];if(typeof r!="function")return;let o=n(r);typeof o=="function"&&fB(o,r);try{t[e]=o}catch{k&&T.log(`Failed to replace method "${e}" in object`,t)}}function rt(t,e,n){try{Object.defineProperty(t,e,{value:n,writable:!0,configurable:!0})}catch{k&&T.log(`Failed to add non-enumerable property "${e}" to object`,t)}}function fB(t,e){try{let n=e.prototype||{};t.prototype=e.prototype=n,rt(t,"__sentry_original__",e)}catch{}}function GA(t){return t.__sentry_original__}function Pf(t){if(cs(t))return{message:t.message,name:t.name,stack:t.stack,..._B(t)};if(xA(t)){let e={type:t.type,target:pB(t.target),currentTarget:pB(t.currentTarget),..._B(t)};return typeof CustomEvent<"u"&&Br(t,CustomEvent)&&(e.detail=t.detail),e}else return t}function pB(t){try{return DA(t)?lB(t):Object.prototype.toString.call(t)}catch{return"<unknown>"}}function _B(t){if(typeof t=="object"&&t!==null){let e={};for(let n in t)Object.prototype.hasOwnProperty.call(t,n)&&(e[n]=t[n]);return e}else return{}}function HA(t,e=40){let n=Object.keys(Pf(t));n.sort();let r=n[0];if(!r)return"[object has no keys]";if(r.length>=e)return Gr(r,e);for(let o=n.length;o>0;o--){let s=n.slice(0,o).join(", ");if(!(s.length>e))return o===n.length?s:Gr(s,e)}return""}function QTe(){let t=Q;return t.crypto||t.msCrypto}function dt(t=QTe()){let e=()=>Math.random()*16;try{if(t?.randomUUID)return t.randomUUID().replace(/-/g,"");t?.getRandomValues&&(e=()=>{let n=new Uint8Array(1);return t.getRandomValues(n),n[0]})}catch{}return("10000000100040008000"+1e11).replace(/[018]/g,n=>(n^(e()&15)>>n/4).toString(16))}function mB(t){return t.exception?.values?.[0]}function ds(t){let{message:e,event_id:n}=t;if(e)return e;let r=mB(t);return r?r.type&&r.value?`${r.type}: ${r.value}`:r.type||r.value||n||"<unknown>":n||"<unknown>"}function $A(t,e,n){let r=t.exception=t.exception||{},o=r.values=r.values||[],s=o[0]=o[0]||{};s.value||(s.value=e||""),s.type||(s.type=n||"Error")}function ac(t,e){let n=mB(t);if(!n)return;let r={type:"generic",handled:!0},o=n.mechanism;if(n.mechanism={...r,...o,...e},e&&"data"in e){let s={...o?.data,...e.data};n.mechanism.data=s}}var ege=/^(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 FA(t){return parseInt(t||"",10)}function jA(t){let e=t.match(ege)||[],n=FA(e[1]),r=FA(e[2]),o=FA(e[3]);return{buildmetadata:e[5],major:isNaN(n)?void 0:n,minor:isNaN(r)?void 0:r,patch:isNaN(o)?void 0:o,prerelease:e[4]}}function bf(t){if(tge(t))return!0;try{rt(t,"__sentry_captured__",!0)}catch{}return!1}function tge(t){try{return t.__sentry_captured__}catch{}}var SB=1e3;function ho(){return Date.now()/SB}function nge(){let{performance:t}=Q;if(!t?.now||!t.timeOrigin)return ho;let e=t.timeOrigin;return()=>(e+t.now())/SB}var EB;function ps(){return(EB??(EB=nge()))()}function TB(t){let e=ps(),n={sid:dt(),init:!0,timestamp:e,started:e,duration:0,status:"ok",errors:0,ignoreDuration:!1,toJSON:()=>rge(n)};return t&&Ao(n,t),n}function Ao(t,e={}){if(e.user&&(!t.ipAddress&&e.user.ip_address&&(t.ipAddress=e.user.ip_address),!t.did&&!e.did&&(t.did=e.user.id||e.user.email||e.user.username)),t.timestamp=e.timestamp||ps(),e.abnormal_mechanism&&(t.abnormal_mechanism=e.abnormal_mechanism),e.ignoreDuration&&(t.ignoreDuration=e.ignoreDuration),e.sid&&(t.sid=e.sid.length===32?e.sid:dt()),e.init!==void 0&&(t.init=e.init),!t.did&&e.did&&(t.did=`${e.did}`),typeof e.started=="number"&&(t.started=e.started),t.ignoreDuration)t.duration=void 0;else if(typeof e.duration=="number")t.duration=e.duration;else{let n=t.timestamp-t.started;t.duration=n>=0?n:0}e.release&&(t.release=e.release),e.environment&&(t.environment=e.environment),!t.ipAddress&&e.ipAddress&&(t.ipAddress=e.ipAddress),!t.userAgent&&e.userAgent&&(t.userAgent=e.userAgent),typeof e.errors=="number"&&(t.errors=e.errors),e.status&&(t.status=e.status)}function gB(t,e){let n={};e?n={status:e}:t.status==="ok"&&(n={status:"exited"}),Ao(t,n)}function rge(t){return{sid:`${t.sid}`,init:t.init,started:new Date(t.started*1e3).toISOString(),timestamp:new Date(t.timestamp*1e3).toISOString(),status:t.status,errors:t.errors,did:typeof t.did=="number"||typeof t.did=="string"?`${t.did}`:void 0,duration:t.duration,abnormal_mechanism:t.abnormal_mechanism,attrs:{release:t.release,environment:t.environment,ip_address:t.ipAddress,user_agent:t.userAgent}}}function _s(t,e,n=2){if(!e||typeof e!="object"||n<=0)return e;if(t&&Object.keys(e).length===0)return t;let r={...t};for(let o in e)Object.prototype.hasOwnProperty.call(e,o)&&(r[o]=_s(r[o],e[o],n-1));return r}function lr(){return dt()}function Nn(){return dt().substring(16)}var qA="_sentrySpan";function Li(t,e){e?rt(t,qA,e):delete t[qA]}function xi(t){return t[qA]}var oge=100,_n=class t{constructor(){this._notifyingListeners=!1,this._scopeListeners=[],this._eventProcessors=[],this._breadcrumbs=[],this._attachments=[],this._user={},this._tags={},this._extra={},this._contexts={},this._sdkProcessingMetadata={},this._propagationContext={traceId:lr(),sampleRand:Math.random()}}clone(){let e=new t;return e._breadcrumbs=[...this._breadcrumbs],e._tags={...this._tags},e._extra={...this._extra},e._contexts={...this._contexts},this._contexts.flags&&(e._contexts.flags={values:[...this._contexts.flags.values]}),e._user=this._user,e._level=this._level,e._session=this._session,e._transactionName=this._transactionName,e._fingerprint=this._fingerprint,e._eventProcessors=[...this._eventProcessors],e._attachments=[...this._attachments],e._sdkProcessingMetadata={...this._sdkProcessingMetadata},e._propagationContext={...this._propagationContext},e._client=this._client,e._lastEventId=this._lastEventId,Li(e,xi(this)),e}setClient(e){this._client=e}setLastEventId(e){this._lastEventId=e}getClient(){return this._client}lastEventId(){return this._lastEventId}addScopeListener(e){this._scopeListeners.push(e)}addEventProcessor(e){return this._eventProcessors.push(e),this}setUser(e){return this._user=e||{email:void 0,id:void 0,ip_address:void 0,username:void 0},this._session&&Ao(this._session,{user:e}),this._notifyScopeListeners(),this}getUser(){return this._user}setTags(e){return this._tags={...this._tags,...e},this._notifyScopeListeners(),this}setTag(e,n){return this._tags={...this._tags,[e]:n},this._notifyScopeListeners(),this}setExtras(e){return this._extra={...this._extra,...e},this._notifyScopeListeners(),this}setExtra(e,n){return this._extra={...this._extra,[e]:n},this._notifyScopeListeners(),this}setFingerprint(e){return this._fingerprint=e,this._notifyScopeListeners(),this}setLevel(e){return this._level=e,this._notifyScopeListeners(),this}setTransactionName(e){return this._transactionName=e,this._notifyScopeListeners(),this}setContext(e,n){return n===null?delete this._contexts[e]:this._contexts[e]=n,this._notifyScopeListeners(),this}setSession(e){return e?this._session=e:delete this._session,this._notifyScopeListeners(),this}getSession(){return this._session}update(e){if(!e)return this;let n=typeof e=="function"?e(this):e,r=n instanceof t?n.getScopeData():go(n)?e:void 0,{tags:o,extra:s,user:i,contexts:a,level:c,fingerprint:u=[],propagationContext:l}=r||{};return this._tags={...this._tags,...o},this._extra={...this._extra,...s},this._contexts={...this._contexts,...a},i&&Object.keys(i).length&&(this._user=i),c&&(this._level=c),u.length&&(this._fingerprint=u),l&&(this._propagationContext=l),this}clear(){return this._breadcrumbs=[],this._tags={},this._extra={},this._user={},this._contexts={},this._level=void 0,this._transactionName=void 0,this._fingerprint=void 0,this._session=void 0,Li(this,void 0),this._attachments=[],this.setPropagationContext({traceId:lr(),sampleRand:Math.random()}),this._notifyScopeListeners(),this}addBreadcrumb(e,n){let r=typeof n=="number"?n:oge;if(r<=0)return this;let o={timestamp:ho(),...e,message:e.message?Gr(e.message,2048):e.message};return this._breadcrumbs.push(o),this._breadcrumbs.length>r&&(this._breadcrumbs=this._breadcrumbs.slice(-r),this._client?.recordDroppedEvent("buffer_overflow","log_item")),this._notifyScopeListeners(),this}getLastBreadcrumb(){return this._breadcrumbs[this._breadcrumbs.length-1]}clearBreadcrumbs(){return this._breadcrumbs=[],this._notifyScopeListeners(),this}addAttachment(e){return this._attachments.push(e),this}clearAttachments(){return this._attachments=[],this}getScopeData(){return{breadcrumbs:this._breadcrumbs,attachments:this._attachments,contexts:this._contexts,tags:this._tags,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:xi(this)}}setSDKProcessingMetadata(e){return this._sdkProcessingMetadata=_s(this._sdkProcessingMetadata,e,2),this}setPropagationContext(e){return this._propagationContext=e,this}getPropagationContext(){return this._propagationContext}captureException(e,n){let r=n?.event_id||dt();if(!this._client)return k&&T.warn("No client configured on scope - will not capture exception!"),r;let o=new Error("Sentry syntheticException");return this._client.captureException(e,{originalException:e,syntheticException:o,...n,event_id:r},this),r}captureMessage(e,n,r){let o=r?.event_id||dt();if(!this._client)return k&&T.warn("No client configured on scope - will not capture message!"),o;let s=new Error(e);return this._client.captureMessage(e,n,{originalException:e,syntheticException:s,...r,event_id:o},this),o}captureEvent(e,n){let r=n?.event_id||dt();return this._client?(this._client.captureEvent(e,{...n,event_id:r},this),r):(k&&T.warn("No client configured on scope - will not capture event!"),r)}_notifyScopeListeners(){this._notifyingListeners||(this._notifyingListeners=!0,this._scopeListeners.forEach(e=>{e(this)}),this._notifyingListeners=!1)}};function cc(){return To("defaultCurrentScope",()=>new _n)}function Hr(){return To("defaultIsolationScope",()=>new _n)}var YA=class{constructor(e,n){let r;e?r=e:r=new _n;let o;n?o=n:o=new _n,this._stack=[{scope:r}],this._isolationScope=o}withScope(e){let n=this._pushScope(),r;try{r=e(n)}catch(o){throw this._popScope(),o}return ur(r)?r.then(o=>(this._popScope(),o),o=>{throw this._popScope(),o}):(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 e=this.getScope().clone();return this._stack.push({client:this.getClient(),scope:e}),e}_popScope(){return this._stack.length<=1?!1:!!this._stack.pop()}};function uc(){let t=en(),e=as(t);return e.stack=e.stack||new YA(cc(),Hr())}function sge(t){return uc().withScope(t)}function ige(t,e){let n=uc();return n.withScope(()=>(n.getStackTop().scope=t,e(t)))}function hB(t){return uc().withScope(()=>t(uc().getIsolationScope()))}function AB(){return{withIsolationScope:hB,withScope:sge,withSetScope:ige,withSetIsolationScope:(t,e)=>hB(e),getCurrentScope:()=>uc().getScope(),getIsolationScope:()=>uc().getIsolationScope()}}function KA(t){let e=en(),n=as(e);n.acs=t}function dr(t){let e=as(t);return e.acs?e.acs:AB()}function ie(){let t=en();return dr(t).getCurrentScope()}function Te(){let t=en();return dr(t).getIsolationScope()}function Mf(){return To("globalScope",()=>new _n)}function Fr(...t){let e=en(),n=dr(e);if(t.length===2){let[r,o]=t;return r?n.withSetScope(r,o):n.withScope(o)}return n.withScope(t[0])}function Cl(...t){let e=en(),n=dr(e);if(t.length===2){let[r,o]=t;return r?n.withSetIsolationScope(r,o):n.withIsolationScope(o)}return n.withIsolationScope(t[0])}function j(){return ie().getClient()}function lc(t){let e=t.getPropagationContext(),{traceId:n,parentSpanId:r,propagationSpanId:o}=e,s={trace_id:n,span_id:o||Nn()};return r&&(s.parent_span_id=r),s}var pt="sentry.source",pr="sentry.sample_rate",WA="sentry.previous_trace_sample_rate",re="sentry.op",ge="sentry.origin";var zA="sentry.measurement_unit",XA="sentry.measurement_value",$r="sentry.custom_span_name",dc="sentry.profile_id",pc="sentry.exclusive_time",JA="cache.hit",ZA="cache.key",QA="cache.item_size";function Lf(t){if(t<400&&t>=100)return{code:1};if(t>=400&&t<500)switch(t){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(t>=500&&t<600)switch(t){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:"unknown_error"}}var RB="_sentryScope",yB="_sentryIsolationScope";function vl(t,e,n){t&&(rt(t,yB,n),rt(t,RB,e))}function _r(t){return{scope:t[RB],isolationScope:t[yB]}}var Il="sentry-",NB=/^sentry-/,CB=8192;function fs(t){let e=Ui(t);if(!e)return;let n=Object.entries(e).reduce((r,[o,s])=>{if(o.match(NB)){let i=o.slice(Il.length);r[i]=s}return r},{});if(Object.keys(n).length>0)return n}function Di(t){if(!t)return;let e=Object.entries(t).reduce((n,[r,o])=>(o&&(n[`${Il}${r}`]=o),n),{});return xf(e)}function Ui(t){if(!(!t||!us(t)&&!Array.isArray(t)))return Array.isArray(t)?t.reduce((e,n)=>{let r=OB(n);return Object.entries(r).forEach(([o,s])=>{e[o]=s}),e},{}):OB(t)}function OB(t){return t.split(",").map(e=>e.split("=").map(n=>{try{return decodeURIComponent(n.trim())}catch{return}})).reduce((e,[n,r])=>(n&&r&&(e[n]=r),e),{})}function xf(t){if(Object.keys(t).length!==0)return Object.entries(t).reduce((e,[n,r],o)=>{let s=`${encodeURIComponent(n)}=${encodeURIComponent(r)}`,i=o===0?s:`${e},${s}`;return i.length>CB?(k&&T.warn(`Not adding key: ${n} with val: ${r} to baggage header due to exceeding baggage size limits.`),e):i},"")}function Cn(t){if(typeof t=="boolean")return Number(t);let e=typeof t=="string"?parseFloat(t):t;if(!(typeof e!="number"||isNaN(e)||e<0||e>1))return e}var Df=new RegExp("^[ \\t]*([0-9a-f]{32})?-?([0-9a-f]{16})?-?([01])?[ \\t]*$");function vB(t){if(!t)return;let e=t.match(Df);if(!e)return;let n;return e[3]==="1"?n=!0:e[3]==="0"&&(n=!1),{traceId:e[1],parentSampled:n,parentSpanId:e[2]}}function Pl(t,e){let n=vB(t),r=fs(e);if(!n?.traceId)return{traceId:lr(),sampleRand:Math.random()};let o=age(n,r);r&&(r.sample_rand=o.toString());let{traceId:s,parentSpanId:i,parentSampled:a}=n;return{traceId:s,parentSpanId:i,sampled:a,dsc:r||{},sampleRand:o}}function ms(t=lr(),e=Nn(),n){let r="";return n!==void 0&&(r=n?"-1":"-0"),`${t}-${e}${r}`}function age(t,e){let n=Cn(e?.sample_rand);if(n!==void 0)return n;let r=Cn(e?.sample_rate);return r&&t?.parentSampled!==void 0?t.parentSampled?Math.random()*r:r+Math.random()*(1-r):Math.random()}var wf=0,kf=1,IB=!1;function bB(t){let{spanId:e,traceId:n}=t.spanContext(),{data:r,op:o,parent_span_id:s,status:i,origin:a,links:c}=q(t);return{parent_span_id:s,span_id:e,trace_id:n,data:r,op:o,status:i,origin:a,links:c}}function Es(t){let{spanId:e,traceId:n,isRemote:r}=t.spanContext(),o=r?e:q(t).parent_span_id,s=_r(t).scope,i=r?s?.getPropagationContext().propagationSpanId||Nn():e;return{parent_span_id:o,span_id:i,trace_id:n}}function Vf(t){let{traceId:e,spanId:n}=t.spanContext(),r=jr(t);return ms(e,n,r)}function wi(t){if(t&&t.length>0)return t.map(({context:{spanId:e,traceId:n,traceFlags:r,...o},attributes:s})=>({span_id:e,trace_id:n,sampled:r===kf,attributes:s,...o}))}function fn(t){return typeof t=="number"?PB(t):Array.isArray(t)?t[0]+t[1]/1e9:t instanceof Date?PB(t.getTime()):ps()}function PB(t){return t>9999999999?t/1e3:t}function q(t){if(lge(t))return t.getSpanJSON();let{spanId:e,traceId:n}=t.spanContext();if(uge(t)){let{attributes:r,startTime:o,name:s,endTime:i,status:a,links:c}=t,u="parentSpanId"in t?t.parentSpanId:"parentSpanContext"in t?t.parentSpanContext?.spanId:void 0;return{span_id:e,trace_id:n,data:r,description:s,parent_span_id:u,start_timestamp:fn(o),timestamp:fn(i)||void 0,status:ki(a),op:r[re],origin:r[ge],links:wi(c)}}return{span_id:e,trace_id:n,start_timestamp:0,data:{}}}function uge(t){let e=t;return!!e.attributes&&!!e.startTime&&!!e.name&&!!e.endTime&&!!e.status}function lge(t){return typeof t.getSpanJSON=="function"}function jr(t){let{traceFlags:e}=t.spanContext();return e===kf}function ki(t){if(!(!t||t.code===0))return t.code===1?"ok":t.message||"unknown_error"}var bl="_sentryChildSpans",eR="_sentryRootSpan";function _c(t,e){let n=t[eR]||t;rt(e,eR,n),t[bl]?t[bl].add(e):rt(t,bl,new Set([e]))}function Bf(t){let e=new Set;function n(r){if(!e.has(r)&&jr(r)){e.add(r);let o=r[bl]?Array.from(r[bl]):[];for(let s of o)n(s)}}return n(t),Array.from(e)}function $e(t){return t[eR]||t}function qr(){let t=en(),e=dr(t);return e.getActiveSpan?e.getActiveSpan():xi(ie())}function Ml(){IB||(Fe(()=>{console.warn("[Sentry] Returning null from `beforeSendSpan` is disallowed. To drop certain spans, configure the respective integrations directly.")}),IB=!0)}var MB=!1;function LB(){if(MB)return;function t(){let e=qr(),n=e&&$e(e);if(n){let r="internal_error";k&&T.log(`[Tracing] Root span: ${r} -> Global error occurred`),n.setStatus({code:2,message:r})}}t.tag="sentry_tracingErrorCallback",MB=!0,aB(t),cB(t)}function yt(t){if(typeof __SENTRY_TRACING__=="boolean"&&!__SENTRY_TRACING__)return!1;let e=t||j()?.getOptions();return!!e&&(e.tracesSampleRate!=null||!!e.tracesSampler)}var fc="production";var dge=/^o(\d+)\./,pge=/^(?:(\w+):)\/\/(?:(\w+)(?::(\w+)?)?@)([\w.-]+)(?::(\d+))?\/(.+)/;function _ge(t){return t==="http"||t==="https"}function mr(t,e=!1){let{host:n,path:r,pass:o,port:s,projectId:i,protocol:a,publicKey:c}=t;return`${a}://${c}${e&&o?`:${o}`:""}@${n}${s?`:${s}`:""}/${r&&`${r}/`}${i}`}function fge(t){let e=pge.exec(t);if(!e){Fe(()=>{console.error(`Invalid Sentry Dsn: ${t}`)});return}let[n,r,o="",s="",i="",a=""]=e.slice(1),c="",u=a,l=u.split("/");if(l.length>1&&(c=l.slice(0,-1).join("/"),u=l.pop()),u){let d=u.match(/^\d+/);d&&(u=d[0])}return xB({host:s,pass:o,path:c,projectId:u,port:i,protocol:n,publicKey:r})}function xB(t){return{protocol:t.protocol,publicKey:t.publicKey||"",pass:t.pass||"",host:t.host,port:t.port||"",path:t.path||"",projectId:t.projectId}}function mge(t){if(!k)return!0;let{port:e,projectId:n,protocol:r}=t;return["protocol","publicKey","host","projectId"].find(i=>t[i]?!1:(T.error(`Invalid Sentry Dsn: ${i} missing`),!0))?!1:n.match(/^\d+$/)?_ge(r)?e&&isNaN(parseInt(e,10))?(T.error(`Invalid Sentry Dsn: Invalid port ${e}`),!1):!0:(T.error(`Invalid Sentry Dsn: Invalid protocol ${r}`),!1):(T.error(`Invalid Sentry Dsn: Invalid projectId ${n}`),!1)}function DB(t){return t.match(dge)?.[1]}function UB(t){let e=typeof t=="string"?fge(t):xB(t);if(!(!e||!mge(e)))return e}var wB="_frozenDsc";function Gf(t,e){rt(t,wB,e)}function tR(t,e){let n=e.getOptions(),{publicKey:r,host:o}=e.getDsn()||{},s;n.orgId?s=String(n.orgId):o&&(s=DB(o));let i={environment:n.environment||fc,release:n.release,public_key:r,trace_id:t,org_id:s};return e.emit("createDsc",i),i}function Ro(t,e){let n=e.getPropagationContext();return n.dsc||tR(n.traceId,t)}function Je(t){let e=j();if(!e)return{};let n=$e(t),r=q(n),o=r.data,s=n.spanContext().traceState,i=s?.get("sentry.sample_rate")??o[pr]??o[WA];function a(f){return(typeof i=="number"||typeof i=="string")&&(f.sample_rate=`${i}`),f}let c=n[wB];if(c)return a(c);let u=s?.get("sentry.dsc"),l=u&&fs(u);if(l)return a(l);let d=tR(t.spanContext().traceId,e),p=o[pt],_=r.description;return p!=="url"&&_&&(d.transaction=_),yt()&&(d.sampled=String(jr(n)),d.sample_rand=s?.get("sentry.sample_rand")??_r(n).scope?.getPropagationContext().sampleRand.toString()),a(d),e.emit("createDsc",d,n),d}var Vi=class{constructor(e={}){this._traceId=e.traceId||lr(),this._spanId=e.spanId||Nn()}spanContext(){return{spanId:this._spanId,traceId:this._traceId,traceFlags:wf}}end(e){}setAttribute(e,n){return this}setAttributes(e){return this}setStatus(e){return this}updateName(e){return this}isRecording(){return!1}addEvent(e,n,r){return this}addLink(e){return this}addLinks(e){return this}recordException(e,n){}};function Er(t,e=100,n=1/0){try{return nR("",t,e,n)}catch(r){return{ERROR:`**non-serializable** (${r})`}}}function rR(t,e=3,n=100*1024){let r=Er(t,e);return gge(r)>n?rR(t,e-1,n):r}function nR(t,e,n=1/0,r=1/0,o=hge()){let[s,i]=o;if(e==null||["boolean","string"].includes(typeof e)||typeof e=="number"&&Number.isFinite(e))return e;let a=Ege(t,e);if(!a.startsWith("[object "))return a;if(e.__sentry_skip_normalization__)return e;let c=typeof e.__sentry_override_normalization_depth__=="number"?e.__sentry_override_normalization_depth__:n;if(c===0)return a.replace("object ","");if(s(e))return"[Circular ~]";let u=e;if(u&&typeof u.toJSON=="function")try{let _=u.toJSON();return nR("",_,c-1,r,o)}catch{}let l=Array.isArray(e)?[]:{},d=0,p=Pf(e);for(let _ in p){if(!Object.prototype.hasOwnProperty.call(p,_))continue;if(d>=r){l[_]="[MaxProperties ~]";break}let f=p[_];l[_]=nR(_,f,c-1,r,o),d++}return i(e),l}function Ege(t,e){try{if(t==="domain"&&e&&typeof e=="object"&&e._events)return"[Domain]";if(t==="domainEmitter")return"[DomainEmitter]";if(typeof global<"u"&&e===global)return"[Global]";if(typeof window<"u"&&e===window)return"[Window]";if(typeof document<"u"&&e===document)return"[Document]";if(Nl(e))return"[VueViewModel]";if(wA(e))return"[SyntheticEvent]";if(typeof e=="number"&&!Number.isFinite(e))return`[${e}]`;if(typeof e=="function")return`[Function: ${Ol(e)}]`;if(typeof e=="symbol")return`[${String(e)}]`;if(typeof e=="bigint")return`[BigInt: ${String(e)}]`;let n=Sge(e);return/^HTML(\w*)Element$/.test(n)?`[HTMLElement: ${n}]`:`[object ${n}]`}catch(n){return`**non-serializable** (${n})`}}function Sge(t){let e=Object.getPrototypeOf(t);return e?.constructor?e.constructor.name:"null prototype"}function Tge(t){return~-encodeURI(t).split(/%..|./).length}function gge(t){return Tge(JSON.stringify(t))}function hge(){let t=new WeakSet;function e(r){return t.has(r)?!0:(t.add(r),!1)}function n(r){t.delete(r)}return[e,n]}function vn(t,e=[]){return[t,e]}function sR(t,e){let[n,r]=t;return[n,[...r,e]]}function Hf(t,e){let n=t[1];for(let r of n){let o=r[0].type;if(e(r,o))return!0}return!1}function oR(t){let e=as(Q);return e.encodePolyfill?e.encodePolyfill(t):new TextEncoder().encode(t)}function Ll(t){let[e,n]=t,r=JSON.stringify(e);function o(s){typeof r=="string"?r=typeof s=="string"?r+s:[oR(r),s]:r.push(typeof s=="string"?oR(s):s)}for(let s of n){let[i,a]=s;if(o(`
135
135
  ${JSON.stringify(i)}
136
- `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(mr(a))}o(c)}}return typeof r=="string"?r:Ege(r)}function Ege(t){let e=t.reduce((o,s)=>o+s.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function sR(t){return[{type:"span"},t]}function iR(t){let e=typeof t.data=="string"?rR(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var Sge={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Hf(t){return Sge[t]}function Ff(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function aR(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:fr(r)},...o&&{trace:o}}}function Tge(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function DB(t,e,n,r){let o=Ff(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:fr(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return Cn(s,[i])}function UB(t,e,n,r){let o=Ff(n),s=t.type&&t.type!=="replay_event"?t.type:"event";Tge(t,n?.sdk);let i=aR(t,o,r,e);return delete t.sdkProcessingMetadata,Cn(i,[[{type:s},t]])}function wB(t,e){function n(l){return!!l.trace_id&&!!l.public_key}let r=Je(t[0]),o=e?.getDsn(),s=e?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:fr(o)}},a=e?.getOptions().beforeSendSpan,c=a?l=>{let d=q(l),p=a(d);return p||(Ml(),d)}:q,u=[];for(let l of t){let d=c(l);d&&u.push(sR(d))}return Cn(i,u)}function xl(t){if(!k)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=q(t),{spanId:o}=t.spanContext(),s=jr(t),i=$e(t),a=i===t,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){let{op:l,description:d}=q(i);u.push(`root ID: ${i.spanContext().spanId}`),l&&u.push(`root op: ${l}`),d&&u.push(`root description: ${d}`)}T.log(`${c}
136
+ `),typeof a=="string"||a instanceof Uint8Array)o(a);else{let c;try{c=JSON.stringify(a)}catch{c=JSON.stringify(Er(a))}o(c)}}return typeof r=="string"?r:Age(r)}function Age(t){let e=t.reduce((o,s)=>o+s.length,0),n=new Uint8Array(e),r=0;for(let o of t)n.set(o,r),r+=o.length;return n}function iR(t){return[{type:"span"},t]}function aR(t){let e=typeof t.data=="string"?oR(t.data):t.data;return[{type:"attachment",length:e.length,filename:t.filename,content_type:t.contentType,attachment_type:t.attachmentType},e]}var Rge={session:"session",sessions:"session",attachment:"attachment",transaction:"transaction",event:"error",client_report:"internal",user_report:"default",profile:"profile",profile_chunk:"profile",replay_event:"replay",replay_recording:"replay",check_in:"monitor",feedback:"feedback",span:"span",raw_security:"security",log:"log_item"};function Ff(t){return Rge[t]}function $f(t){if(!t?.sdk)return;let{name:e,version:n}=t.sdk;return{name:e,version:n}}function cR(t,e,n,r){let o=t.sdkProcessingMetadata?.dynamicSamplingContext;return{event_id:t.event_id,sent_at:new Date().toISOString(),...e&&{sdk:e},...!!n&&r&&{dsn:mr(r)},...o&&{trace:o}}}function yge(t,e){return e&&(t.sdk=t.sdk||{},t.sdk.name=t.sdk.name||e.name,t.sdk.version=t.sdk.version||e.version,t.sdk.integrations=[...t.sdk.integrations||[],...e.integrations||[]],t.sdk.packages=[...t.sdk.packages||[],...e.packages||[]]),t}function kB(t,e,n,r){let o=$f(n),s={sent_at:new Date().toISOString(),...o&&{sdk:o},...!!r&&e&&{dsn:mr(e)}},i="aggregates"in t?[{type:"sessions"},t]:[{type:"session"},t.toJSON()];return vn(s,[i])}function VB(t,e,n,r){let o=$f(n),s=t.type&&t.type!=="replay_event"?t.type:"event";yge(t,n?.sdk);let i=cR(t,o,r,e);return delete t.sdkProcessingMetadata,vn(i,[[{type:s},t]])}function BB(t,e){function n(l){return!!l.trace_id&&!!l.public_key}let r=Je(t[0]),o=e?.getDsn(),s=e?.getOptions().tunnel,i={sent_at:new Date().toISOString(),...n(r)&&{trace:r},...!!s&&o&&{dsn:mr(o)}},a=e?.getOptions().beforeSendSpan,c=a?l=>{let d=q(l),p=a(d);return p||(Ml(),d)}:q,u=[];for(let l of t){let d=c(l);d&&u.push(iR(d))}return vn(i,u)}function xl(t){if(!k)return;let{description:e="< unknown name >",op:n="< unknown op >",parent_span_id:r}=q(t),{spanId:o}=t.spanContext(),s=jr(t),i=$e(t),a=i===t,c=`[Tracing] Starting ${s?"sampled":"unsampled"} ${a?"root ":""}span`,u=[`op: ${n}`,`name: ${e}`,`ID: ${o}`];if(r&&u.push(`parent ID: ${r}`),!a){let{op:l,description:d}=q(i);u.push(`root ID: ${i.spanContext().spanId}`),l&&u.push(`root op: ${l}`),d&&u.push(`root description: ${d}`)}T.log(`${c}
137
137
  ${u.join(`
138
- `)}`)}function Dl(t){if(!k)return;let{description:e="< unknown name >",op:n="< unknown op >"}=q(t),{spanId:r}=t.spanContext(),s=$e(t)===t,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${e}" with ID ${r}`;T.log(i)}function Bi(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[WA],s=r[zA];typeof o=="string"&&typeof s=="number"&&(e[n.name]={value:s,unit:o})}),e}var kB=1e3,mc=class{constructor(e={}){this._traceId=e.traceId||ur(),this._spanId=e.spanId||On(),this._startTime=e.startTimestamp||ps(),this._links=e.links,this._attributes={},this.setAttributes({[ge]:"manual",[re]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?wf:Uf}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=fn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(pt,"custom"),this}end(e){this._endTime||(this._endTime=fn(e),Dl(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[re],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ki(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ge],profile_id:this._attributes[dc],exclusive_time:this._attributes[pc],measurements:Bi(this._events),is_segment:this._isStandaloneSpan&&$e(this)===this||void 0,segment_id:this._isStandaloneSpan?$e(this).spanContext().spanId:void 0,links:wi(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){k&&T.log("[Tracing] Adding an event to span:",e);let o=VB(n)?n:r||ps(),s=VB(n)?{}:n||{},i={name:e,time:fn(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=j();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===$e(this)))return;if(this._isStandaloneSpan){this._sampled?hge(wB([this],e)):(k&&T.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let r=this._convertSpanToTransaction();r&&(pr(this).scope||ie()).captureEvent(r)}_convertSpanToTransaction(){if(!BB(q(this)))return;this._name||(k&&T.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=pr(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let s=Vf(this).filter(l=>l!==this&&!gge(l)).map(l=>q(l)).filter(BB),i=this._attributes[pt];delete this._attributes[$r],s.forEach(l=>{delete l.data[$r]});let a={contexts:{trace:vB(this)},spans:s.length>kB?s.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,kB):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:Je(this)},request:r,...i&&{transaction_info:{source:i}}},c=Bi(this._events);return c&&Object.keys(c).length&&(k&&T.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}};function VB(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function BB(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function gge(t){return t instanceof mc&&t.isStandaloneSpan()}function hge(t){let e=j();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function yo(t,e,n=()=>{}){let r;try{r=t()}catch(o){throw e(o),n(),o}return Age(r,e,n)}function Age(t,e,n){return cr(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Ul(t,e,n){if(!yt(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let s=Nn(o);if(s===void 0)return k&&T.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(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return k&&T.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];let i=n<s;return i||k&&T.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}var $f="__SENTRY_SUPPRESS_TRACING__";function wl(t,e){let n=qf();if(n.startSpan)return n.startSpan(t,e);let r=FB(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Fr(a,()=>jB(s)(()=>{let u=ie(),l=$B(u,s),p=t.onlyIfParent&&!l?new Vi:HB({parentSpan:l,spanArguments:r,forceTransaction:o,scope:u});return Li(u,p),yo(()=>e(p),()=>{let{status:_}=q(p);p.isRecording()&&(!_||_==="ok")&&p.setStatus({code:2,message:"internal_error"})},()=>{p.end()})}))}function jf(t,e){let n=qf();if(n.startSpanManual)return n.startSpanManual(t,e);let r=FB(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Fr(a,()=>jB(s)(()=>{let u=ie(),l=$B(u,s),p=t.onlyIfParent&&!l?new Vi:HB({parentSpan:l,spanArguments:r,forceTransaction:o,scope:u});return Li(u,p),yo(()=>e(p,()=>p.end()),()=>{let{status:_}=q(p);p.isRecording()&&(!_||_==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function kl(t,e){let n=qf();return n.withActiveSpan?n.withActiveSpan(t,e):Fr(r=>(Li(r,t||void 0),e(r)))}function Ec(t){let e=qf();return e.suppressTracing?e.suppressTracing(t):Fr(n=>{n.setSDKProcessingMetadata({[$f]:!0});let r=t();return n.setSDKProcessingMetadata({[$f]:void 0}),r})}function HB({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!yt()){let i=new Vi;if(n||!t){let a={sampled:"false",sample_rate:"0",transaction:e.name,...Je(i)};Bf(i,a)}return i}let o=Te(),s;if(t&&!n)s=Rge(t,r,e),_c(t,s);else if(t){let i=Je(t),{traceId:a,spanId:c}=t.spanContext(),u=jr(t);s=GB({traceId:a,parentSpanId:c,...e},r,u),Bf(s,i)}else{let{traceId:i,dsc:a,parentSpanId:c,sampled:u}={...o.getPropagationContext(),...r.getPropagationContext()};s=GB({traceId:i,parentSpanId:c,...e},r,u),a&&Bf(s,a)}return xl(s),vl(s,r,o),s}function FB(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=fn(t.startTime),delete r.startTime,r}return n}function qf(){let t=en();return lr(t)}function GB(t,e,n){let r=j(),o=r?.getOptions()||{},{name:s=""}=t,i={spanAttributes:{...t.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});let a=i.parentSampled??n,c=i.spanAttributes,u=e.getPropagationContext(),[l,d,p]=e.getScopeData().sdkProcessingMetadata[$f]?[!1]:Ul(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:Nn(u.dsc?.sample_rate)},u.sampleRand),_=new mc({...t,attributes:{[pt]:"custom",[dr]:d!==void 0&&p?d:void 0,...c},sampled:l});return!l&&r&&(k&&T.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",_),_}function Rge(t,e,n){let{spanId:r,traceId:o}=t.spanContext(),s=e.getScopeData().sdkProcessingMetadata[$f]?!1:jr(t),i=s?new mc({...n,parentSpanId:r,traceId:o,sampled:s}):new Vi({traceId:o});_c(t,i);let a=j();return a&&(a.emit("spanStart",i),n.endTimestamp&&a.emit("spanEnd",i)),i}function $B(t,e){if(e)return e;if(e===null)return;let n=xi(t);if(!n)return;let r=j();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?$e(n):n}function jB(t){return t!==void 0?e=>kl(t,e):e=>e()}var cR=0,qB=1,YB=2;function Er(t){return new Yr(e=>{e(t)})}function Yf(t){return new Yr((e,n)=>{n(t)})}var Yr=class t{constructor(e){this._state=cR,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,e&&e()},i=>{s=!0,o=i,e&&e()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===cR)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===qB&&n[1](this._value),this._state===YB&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(s,i)=>{if(this._state===cR){if(cr(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(qB,s)},o=s=>{n(YB,s)};try{e(r,o)}catch(s){o(s)}}};function Kf(t,e,n,r=0){return new Yr((o,s)=>{let i=t[r];if(e===null||typeof i!="function")o(e);else{let a=i({...e},n);k&&i.id&&a===null&&T.log(`Event processor "${i.id}" dropped event`),cr(a)?a.then(c=>Kf(t,c,n,r+1).then(o)).then(null,s):Kf(t,a,n,r+1).then(o).then(null,s)}})}function KB(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=e;yge(t,e),r&&Cge(t,r),vge(t,n),Oge(t,o),Nge(t,s)}function uR(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:d,propagationContext:p,transactionName:_,span:f}=e;Wf(t,"extra",n),Wf(t,"tags",r),Wf(t,"user",o),Wf(t,"contexts",s),t.sdkProcessingMetadata=_s(t.sdkProcessingMetadata,a,2),i&&(t.level=i),_&&(t.transactionName=_),f&&(t.span=f),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...p}}function Wf(t,e,n){t[e]=_s(t[e],n,1)}function yge(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(s).length&&(t.contexts={...s,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function Oge(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function Nge(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Cge(t,e){t.contexts={trace:Es(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Je(e),...t.sdkProcessingMetadata};let n=$e(e),r=q(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function vge(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}var zf,WB,Xf;function zB(t){let e=Q._sentryDebugIds;if(!e)return{};let n=Object.keys(e);return Xf&&n.length===WB||(WB=n.length,Xf=n.reduce((r,o)=>{zf||(zf={});let s=zf[o];if(s)r[s[0]]=s[1];else{let i=t(o);for(let a=i.length-1;a>=0;a--){let u=i[a]?.filename,l=e[o];if(u&&l){r[u]=l,zf[o]=[u,l];break}}}return r},{})),Xf}function XB(t,e,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||dt(),timestamp:e.timestamp||ho()},u=n.integrations||t.integrations.map(S=>S.name);Ige(c,t),Mge(c,u),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&Pge(c,t.stackParser);let l=xge(r,n.captureContext);n.mechanism&&ac(c,n.mechanism);let d=o?o.getEventProcessors():[],p=bf().getScopeData();if(s){let S=s.getScopeData();uR(p,S)}if(l){let S=l.getScopeData();uR(p,S)}let _=[...n.attachments||[],...p.attachments];_.length&&(n.attachments=_),KB(c,p);let f=[...d,...p.eventProcessors];return Kf(f,c,n).then(S=>(S&&bge(S),typeof i=="number"&&i>0?Lge(S,i,a):S))}function Ige(t,e){let{environment:n,release:r,dist:o,maxValueLength:s=250}=e;t.environment=t.environment||n||fc,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let i=t.request;i?.url&&(i.url=Gr(i.url,s))}function Pge(t,e){let n=zB(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function bge(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function Mge(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function Lge(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:mr(o.data,e,n)}}))},...t.user&&{user:mr(t.user,e,n)},...t.contexts&&{contexts:mr(t.contexts,e,n)},...t.extra&&{extra:mr(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=mr(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:mr(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=mr(t.contexts.flags,3,n)),r}function xge(t,e){if(!e)return t;let n=t?t.clone():new _n;return n.update(e),n}function JB(t){if(t)return Dge(t)?{captureContext:t}:wge(t)?{captureContext:t}:t}function Dge(t){return t instanceof _n||typeof t=="function"}var Uge=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function wge(t){return Object.keys(t).some(e=>Uge.includes(e))}function tn(t,e){return ie().captureException(t,JB(e))}function Jf(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return ie().captureMessage(t,n,r)}function Zf(t,e){return ie().captureEvent(t,e)}function Qf(){let t=j();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function em(t){let e=Te(),n=ie(),{userAgent:r}=Q.navigator||{},o=mB({user:n.getUser()||e.getUser(),...r&&{userAgent:r},...t}),s=e.getSession();return s?.status==="ok"&&Ao(s,{status:"exited"}),Vl(),e.setSession(o),o}function Vl(){let t=Te(),n=ie().getSession()||t.getSession();n&&EB(n),kge(),t.setSession()}function kge(){let t=Te(),e=j(),n=t.getSession();n&&e&&e.captureSession(n)}var Vge="7";function Bge(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function Gge(t){return`${Bge(t)}${t.projectId}/envelope/`}function Hge(t,e){let n={sentry_version:Vge};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function ZB(t,e,n){return e||`${Gge(t)}?${Hge(t,n)}`}var QB=[];function Fge(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function lR(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return Fge(r)}function eG(t,e){let n={};return e.forEach(r=>{r&&pR(t,r,n)}),n}function dR(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function pR(t,e,n){if(n[e.name]){k&&T.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,QB.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),QB.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,s)=>r(o,s,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((s,i)=>r(s,i,t),{id:e.name});t.addEventProcessor(o)}k&&T.log(`Integration installed: ${e.name}`)}function tG(t,e,n){let r=[{type:"client_report"},{timestamp:n||ho(),discarded_events:t}];return Cn(e?{dsn:e}:{},[r])}function tm(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function nG(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=t.contexts?.trace??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:s,profile_id:i?.[dc],exclusive_time:i?.[pc],measurements:t.measurements,is_segment:!0}}function rG(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[dc]:t.profile_id},...t.exclusive_time&&{[pc]:t.exclusive_time}}}},measurements:t.measurements}}var oG="Not capturing exception because it's already been captured.",sG="Discarded session because of missing or non-string release",cG=Symbol.for("SentryInternalError"),uG=Symbol.for("SentryDoNotSendEventError");function nm(t){return{message:t,[cG]:!0}}function _R(t){return{message:t,[uG]:!0}}function iG(t){return!!t&&typeof t=="object"&&cG in t}function aG(t){return!!t&&typeof t=="object"&&uG in t}var rm=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=LB(e.dsn):k&&T.warn("No DSN provided, client will not send events."),this._dsn){let n=ZB(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){let o=dt();if(Pf(e))return k&&T.log(oG),o;let s={event_id:o,...n};return this._process(this.eventFromException(e,s).then(i=>this._captureEvent(i,s,r))),s.event_id}captureMessage(e,n,r,o){let s={event_id:dt(),...r},i=sc(e)?e:String(e),a=ic(e)?this.eventFromMessage(i,n,s):this.eventFromException(e,s);return this._process(a.then(c=>this._captureEvent(c,s,o))),s.event_id}captureEvent(e,n,r){let o=dt();if(n?.originalException&&Pf(n.originalException))return k&&T.log(oG),o;let s={event_id:o,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope;return this._process(this._captureEvent(e,s,a||r,c)),s.event_id}captureSession(e){this.sendSession(e),Ao(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(o=>r&&o))):Er(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];pR(this,e,this._integrations),n||dR(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=UB(e,this._dsn,this._options._metadata,this._options.tunnel);for(let s of n.attachments||[])r=oR(r,iR(s));let o=this.sendEnvelope(r);o&&o.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){let{release:n,environment:r=fc}=this._options;if("aggregates"in e){let s=e.attrs||{};if(!s.release&&!n){k&&T.warn(sG);return}s.release=s.release||n,s.environment=s.environment||r,e.attrs=s}else{if(!e.release&&!n){k&&T.warn(sG);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=DB(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;k&&T.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{let o=r.indexOf(n);o>-1&&r.splice(o,1)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(k&&T.error("Error while sending envelope:",n),n)):(k&&T.error("Transport disabled"),Er({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=eG(this,e),dR(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Ao(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Yr(n=>{let r=0,o=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=o,e&&r>=e&&(clearInterval(s),n(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),XB(s,e,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:lc(r),...a.contexts};let c=Ro(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=ie(),o=Te()){return k&&fR(e)&&T.log(`Captured error event \`${tm(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(s=>s.event_id,s=>{k&&(aG(s)?T.log(s.message):iG(s)?T.warn(s.message):T.warn(s))})}_processEvent(e,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=lG(e),c=fR(e),u=e.type||"error",l=`before send for type \`${u}\``,d=typeof i>"u"?void 0:Nn(i);if(c&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error"),Yf(_R(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let p=u==="replay_event"?"replay":u;return this._prepareEvent(e,n,r,o).then(_=>{if(_===null)throw this.recordDroppedEvent("event_processor",p),_R("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return _;let E=jge(this,s,_,n);return $ge(E,l)}).then(_=>{if(_===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw _R(`${l} returned \`null\`, will not send event.`)}let f=r.getSession()||o.getSession();if(c&&f&&this._updateSessionFromEvent(f,_),a){let S=_.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=_.spans?_.spans.length:0,h=S-g;h>0&&this.recordDroppedEvent("before_send","span",h)}let E=_.transaction_info;if(a&&E&&_.transaction!==e.transaction){let S="custom";_.transaction_info={...E,source:S}}return this.sendEvent(_,n),_}).then(null,_=>{throw aG(_)||iG(_)?_:(this.captureException(_,{data:{__sentry__:!0},originalException:_}),nm(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
139
- Reason: ${_}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){k&&T.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){k&&T.log("No outcomes to send");return}if(!this._dsn){k&&T.log("No dsn provided, will not send outcomes");return}k&&T.log("Sending outcomes:",e);let n=tG(e,this._options.tunnel&&fr(this._dsn));this.sendEnvelope(n)}};function $ge(t,e){let n=`${e} must return \`null\` or a valid event.`;if(cr(t))return t.then(r=>{if(!go(r)&&r!==null)throw nm(n);return r},r=>{throw nm(`${e} rejected with ${r}`)});if(!go(t)&&t!==null)throw nm(n);return t}function jge(t,e,n,r){let{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:i}=e,a=n;if(fR(a)&&o)return o(a,r);if(lG(a)){if(i){let c=i(nG(a));if(c?a=_s(n,rG(c)):Ml(),a.spans){let u=[];for(let l of a.spans){let d=i(l);d?u.push(d):(Ml(),u.push(l))}a.spans=u}}if(s){if(a.spans){let c=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(a,r)}}return a}function fR(t){return t.type===void 0}function lG(t){return t.type==="transaction"}function dG(t,e){return e?Fr(e,()=>{let n=qr(),r=n?Es(n):lc(e);return[n?Je(n):Ro(t,e),r]}):[void 0,void 0]}function pG(t,e,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=fr(o)),e&&(s.trace=e);let i=qge(t);return Cn(s,[i])}function qge(t){return[{type:"check_in"},t]}function Yge(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function _G(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=fr(r)),Cn(o,[Yge(t)])}function Gi(t,e){let n=e??Kge(t)??[];if(n.length===0)return;let r=t.getOptions(),o=_G(n,r._metadata,r.tunnel,t.getDsn());fG().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function Kge(t){return fG().get(t)}function fG(){return To("clientToLogBufferMap",()=>new WeakMap)}function mG(t,e){return t(e.stack||"",1)}function mR(t,e){let n={type:e.name||e.constructor.name,value:e.message},r=mG(t,e);return r.length&&(n.stacktrace={frames:r}),n}function Wge(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}function zge(t){if("name"in t&&typeof t.name=="string"){let r=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(r+=` with message '${t.message}'`),r}else if("message"in t&&typeof t.message=="string")return t.message;let e=GA(t);if(MA(t))return`Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;let n=Xge(t);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${e}`}function Xge(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function Jge(t,e,n,r){if(cs(n))return[n,void 0];if(e.synthetic=!0,go(n)){let s=t?.getOptions().normalizeDepth,i={__serialized__:nR(n,s)},a=Wge(n);if(a)return[a,i];let c=zge(n),u=r?.syntheticException||new Error(c);return u.message=c,[u,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function EG(t,e,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=Jge(t,s,n,r),c={exception:{values:[mR(e,i)]}};return a&&(c.extra=a),FA(c,void 0,void 0),ac(c,s),{...c,event_id:r?.event_id}}function SG(t,e,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=mG(t,r.syntheticException);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]},ac(s,{synthetic:!0}))}if(sc(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return s.logentry={message:i,params:a},s}return s.message=e,s}var Zge=5e3,Bl=class extends rm{constructor(e){if(PB(),super(e),this._logWeight=0,this._isLogTimerActive=!1,this._options.enableLogs??this._options._experiments?.enableLogs){let r=this;r.on("flushLogs",()=>{r._logWeight=0,clearTimeout(r._logFlushIdleTimeout),r._isLogTimerActive=!1}),r.on("afterCaptureLog",o=>{r._logWeight+=Qge(o),r._logWeight>=8e5?Gi(r):r._isLogTimerActive||(r._isLogTimerActive=!0,r._logFlushIdleTimeout=setTimeout(()=>{Gi(r)},Zge))}),r.on("flush",()=>{Gi(r)})}}eventFromException(e,n){let r=EG(this,this._options.stackParser,e,n);return r.level="error",Er(r)}eventFromMessage(e,n="info",r){return Er(SG(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){return TG(n),super.captureException(e,n,r)}captureEvent(e,n,r){return!e.type&&e.exception?.values&&e.exception.values.length>0&&TG(n),super.captureEvent(e,n,r)}captureCheckIn(e,n,r){let o="checkInId"in e&&e.checkInId?e.checkInId:dt();if(!this._isEnabled())return k&&T.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,u={check_in_id:o,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};"duration"in e&&(u.duration=e.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[l,d]=dG(this,r);d&&(u.contexts={trace:d});let p=pG(u,l,this.getSdkMetadata(),c,this.getDsn());return k&&T.log("Sending checkin:",e.monitorSlug,e.status),this.sendEnvelope(p),o}_prepareEvent(e,n,r,o){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r,o)}};function TG(t){let e=Te().getScopeData().sdkProcessingMetadata.requestSession;if(e){let n=t?.mechanism?.handled??!0;n&&e.status!=="crashed"?e.status="errored":n||(e.status="crashed")}}function Qge(t){let e=0;return t.message&&(e+=t.message.length*2),t.attributes&&Object.values(t.attributes).forEach(n=>{Array.isArray(n)?e+=n.length*gG(n[0]):ic(n)?e+=gG(n):e+=100}),e}function gG(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}var ER=Symbol.for("SentryBufferFullError");function hG(t){let e=[];function n(){return t===void 0||e.length<t}function r(i){return e.splice(e.indexOf(i),1)[0]||Promise.resolve(void 0)}function o(i){if(!n())return Yf(ER);let a=i();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(i){return new Yr((a,c)=>{let u=e.length;if(!u)return a(!0);let l=setTimeout(()=>{i&&i>0&&a(!1)},i);e.forEach(d=>{Er(d).then(()=>{--u||(clearTimeout(l),a(!0))},c)})})}return{$:e,add:o,drain:s}}function ehe(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}function the(t,e){return t[e]||t.all||0}function AG(t,e,n=Date.now()){return the(t,e)>n}function RG(t,{statusCode:e,headers:n},r=Date.now()){let o={...t},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,l]=a.split(":",5),d=parseInt(c,10),p=(isNaN(d)?60:d)*1e3;if(!u)o.all=r+p;else for(let _ of u.split(";"))_==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(o[_]=r+p):o[_]=r+p}else i?o.all=r+ehe(i,r):e===429&&(o.all=r+60*1e3);return o}var nhe=64;function Gl(t,e,n=hG(t.bufferSize||nhe)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(Gf(i,(d,p)=>{let _=Hf(p);AG(r,_)?t.recordDroppedEvent("ratelimit_backoff",_):a.push(d)}),a.length===0)return Er({});let c=Cn(i[0],a),u=d=>{Gf(c,(p,_)=>{t.recordDroppedEvent(d,Hf(_))})},l=()=>e({body:Ll(c)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&k&&T.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=RG(r,d),d),d=>{throw u("network_error"),k&&T.error("Encountered error running transport request:",d),d});return n.add(l).then(d=>d,d=>{if(d===ER)return k&&T.error("Skipped sending event because buffer is full."),u("queue_overflow"),Er({});throw d})}return{send:s,flush:o}}function Hi(t,e,n=[e],r="npm"){let o=t._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:Oe})),version:Oe}),t._metadata=o}function Sc(t={}){let e=t.client||j();if(!Qf()||!e)return{};let n=en(),r=lr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||ie(),s=t.span||qr(),i=s?kf(s):rhe(o),a=s?Je(s):Ro(e,o),c=Di(a);return xf.test(i)?{"sentry-trace":i,baggage:c}:(T.warn("Invalid sentry-trace data. Cannot generate trace data"),{})}function rhe(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return ms(e,r,n)}function SR(t,e,n){let r,o,s,i=n?.maxWait?Math.max(n.maxWait,e):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=t(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function l(){return o!==void 0||s!==void 0?c():r}function d(){return o&&clearTimeout(o),o=a(c,e),i&&s===void 0&&(s=a(c,i)),r}return d.cancel=u,d.flush=l,d}function yG(t){let e=Object.create(null);try{Object.entries(t).forEach(([n,r])=>{typeof r=="string"&&(e[n]=r)})}catch{}return e}function om(t){let e=t.headers||{},r=(typeof e["x-forwarded-host"]=="string"?e["x-forwarded-host"]:void 0)||(typeof e.host=="string"?e.host:void 0),s=(typeof e["x-forwarded-proto"]=="string"?e["x-forwarded-proto"]:void 0)||t.protocol||(t.socket?.encrypted?"https":"http"),i=t.url||"",a=ohe({url:i,host:r,protocol:s}),c=t.body||void 0,u=t.cookies;return{url:a,method:t.method,query_string:OG(i),headers:yG(e),cookies:u,data:c}}function ohe({url:t,protocol:e,host:n}){if(t?.startsWith("http"))return t;if(t&&n)return`${e}://${n}${t}`}function OG(t){if(t)try{let e=new URL(t,"http://s.io").search.slice(1);return e.length?e:void 0}catch{return}}var she=100;function vn(t,e){let n=j(),r=Te();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=she}=n.getOptions();if(s<=0)return;let a={timestamp:ho(),...t},c=o?Fe(()=>o(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}var NG,ihe="FunctionToString",CG=new WeakMap,ahe=(()=>({name:ihe,setupOnce(){NG=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=BA(this),n=CG.has(j())&&e!==void 0?e:this;return NG.apply(n,t)}}catch{}},setup(t){CG.set(t,!0)}})),sm=ahe;var che=[/^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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],uhe="EventFilters",TR=(t={})=>{let e;return{name:uhe,setup(n){let r=n.getOptions();e=vG(t,r)},processEvent(n,r,o){if(!e){let s=o.getOptions();e=vG(t,s)}return lhe(n,e)?null:n}}},am=((t={})=>({...TR(t),name:"InboundFilters"}));function vG(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:che],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function lhe(t,e){if(t.type){if(t.type==="transaction"&&phe(t,e.ignoreTransactions))return k&&T.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
140
- Event: ${ds(t)}`),!0}else{if(dhe(t,e.ignoreErrors))return k&&T.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
141
- Event: ${ds(t)}`),!0;if(Ehe(t))return k&&T.warn(`Event dropped due to not having an error message, error type or stacktrace.
142
- Event: ${ds(t)}`),!0;if(_he(t,e.denyUrls))return k&&T.warn(`Event dropped due to being matched by \`denyUrls\` option.
138
+ `)}`)}function Dl(t){if(!k)return;let{description:e="< unknown name >",op:n="< unknown op >"}=q(t),{spanId:r}=t.spanContext(),s=$e(t)===t,i=`[Tracing] Finishing "${n}" ${s?"root ":""}span "${e}" with ID ${r}`;T.log(i)}function Bi(t){if(!t||t.length===0)return;let e={};return t.forEach(n=>{let r=n.attributes||{},o=r[zA],s=r[XA];typeof o=="string"&&typeof s=="number"&&(e[n.name]={value:s,unit:o})}),e}var GB=1e3,mc=class{constructor(e={}){this._traceId=e.traceId||lr(),this._spanId=e.spanId||Nn(),this._startTime=e.startTimestamp||ps(),this._links=e.links,this._attributes={},this.setAttributes({[ge]:"manual",[re]:e.op,...e.attributes}),this._name=e.name,e.parentSpanId&&(this._parentSpanId=e.parentSpanId),"sampled"in e&&(this._sampled=e.sampled),e.endTimestamp&&(this._endTime=e.endTimestamp),this._events=[],this._isStandaloneSpan=e.isStandalone,this._endTime&&this._onSpanEnded()}addLink(e){return this._links?this._links.push(e):this._links=[e],this}addLinks(e){return this._links?this._links.push(...e):this._links=e,this}recordException(e,n){}spanContext(){let{_spanId:e,_traceId:n,_sampled:r}=this;return{spanId:e,traceId:n,traceFlags:r?kf:wf}}setAttribute(e,n){return n===void 0?delete this._attributes[e]:this._attributes[e]=n,this}setAttributes(e){return Object.keys(e).forEach(n=>this.setAttribute(n,e[n])),this}updateStartTime(e){this._startTime=fn(e)}setStatus(e){return this._status=e,this}updateName(e){return this._name=e,this.setAttribute(pt,"custom"),this}end(e){this._endTime||(this._endTime=fn(e),Dl(this),this._onSpanEnded())}getSpanJSON(){return{data:this._attributes,description:this._name,op:this._attributes[re],parent_span_id:this._parentSpanId,span_id:this._spanId,start_timestamp:this._startTime,status:ki(this._status),timestamp:this._endTime,trace_id:this._traceId,origin:this._attributes[ge],profile_id:this._attributes[dc],exclusive_time:this._attributes[pc],measurements:Bi(this._events),is_segment:this._isStandaloneSpan&&$e(this)===this||void 0,segment_id:this._isStandaloneSpan?$e(this).spanContext().spanId:void 0,links:wi(this._links)}}isRecording(){return!this._endTime&&!!this._sampled}addEvent(e,n,r){k&&T.log("[Tracing] Adding an event to span:",e);let o=HB(n)?n:r||ps(),s=HB(n)?{}:n||{},i={name:e,time:fn(o),attributes:s};return this._events.push(i),this}isStandaloneSpan(){return!!this._isStandaloneSpan}_onSpanEnded(){let e=j();if(e&&e.emit("spanEnd",this),!(this._isStandaloneSpan||this===$e(this)))return;if(this._isStandaloneSpan){this._sampled?Nge(BB([this],e)):(k&&T.log("[Tracing] Discarding standalone span because its trace was not chosen to be sampled."),e&&e.recordDroppedEvent("sample_rate","span"));return}let r=this._convertSpanToTransaction();r&&(_r(this).scope||ie()).captureEvent(r)}_convertSpanToTransaction(){if(!FB(q(this)))return;this._name||(k&&T.warn("Transaction has no name, falling back to `<unlabeled transaction>`."),this._name="<unlabeled transaction>");let{scope:e,isolationScope:n}=_r(this),r=e?.getScopeData().sdkProcessingMetadata?.normalizedRequest;if(this._sampled!==!0)return;let s=Bf(this).filter(l=>l!==this&&!Oge(l)).map(l=>q(l)).filter(FB),i=this._attributes[pt];delete this._attributes[$r],s.forEach(l=>{delete l.data[$r]});let a={contexts:{trace:bB(this)},spans:s.length>GB?s.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,GB):s,start_timestamp:this._startTime,timestamp:this._endTime,transaction:this._name,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:e,capturedSpanIsolationScope:n,dynamicSamplingContext:Je(this)},request:r,...i&&{transaction_info:{source:i}}},c=Bi(this._events);return c&&Object.keys(c).length&&(k&&T.log("[Measurements] Adding measurements to transaction event",JSON.stringify(c,void 0,2)),a.measurements=c),a}};function HB(t){return t&&typeof t=="number"||t instanceof Date||Array.isArray(t)}function FB(t){return!!t.start_timestamp&&!!t.timestamp&&!!t.span_id&&!!t.trace_id}function Oge(t){return t instanceof mc&&t.isStandaloneSpan()}function Nge(t){let e=j();if(!e)return;let n=t[1];if(!n||n.length===0){e.recordDroppedEvent("before_send","span");return}e.sendEnvelope(t)}function yo(t,e,n=()=>{}){let r;try{r=t()}catch(o){throw e(o),n(),o}return Cge(r,e,n)}function Cge(t,e,n){return ur(t)?t.then(r=>(n(),r),r=>{throw e(r),n(),r}):(n(),t)}function Ul(t,e,n){if(!yt(t))return[!1];let r,o;typeof t.tracesSampler=="function"?(o=t.tracesSampler({...e,inheritOrSampleWith:a=>typeof e.parentSampleRate=="number"?e.parentSampleRate:typeof e.parentSampled=="boolean"?Number(e.parentSampled):a}),r=!0):e.parentSampled!==void 0?o=e.parentSampled:typeof t.tracesSampleRate<"u"&&(o=t.tracesSampleRate,r=!0);let s=Cn(o);if(s===void 0)return k&&T.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(o)} of type ${JSON.stringify(typeof o)}.`),[!1];if(!s)return k&&T.log(`[Tracing] Discarding transaction because ${typeof t.tracesSampler=="function"?"tracesSampler returned 0 or false":"a negative sampling decision was inherited or tracesSampleRate is set to 0"}`),[!1,s,r];let i=n<s;return i||k&&T.log(`[Tracing] Discarding transaction because it's not included in the random sample (sampling rate = ${Number(o)})`),[i,s,r]}var jf="__SENTRY_SUPPRESS_TRACING__";function wl(t,e){let n=Yf();if(n.startSpan)return n.startSpan(t,e);let r=qB(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Fr(a,()=>KB(s)(()=>{let u=ie(),l=YB(u,s),p=t.onlyIfParent&&!l?new Vi:jB({parentSpan:l,spanArguments:r,forceTransaction:o,scope:u});return Li(u,p),yo(()=>e(p),()=>{let{status:_}=q(p);p.isRecording()&&(!_||_==="ok")&&p.setStatus({code:2,message:"internal_error"})},()=>{p.end()})}))}function qf(t,e){let n=Yf();if(n.startSpanManual)return n.startSpanManual(t,e);let r=qB(t),{forceTransaction:o,parentSpan:s,scope:i}=t,a=i?.clone();return Fr(a,()=>KB(s)(()=>{let u=ie(),l=YB(u,s),p=t.onlyIfParent&&!l?new Vi:jB({parentSpan:l,spanArguments:r,forceTransaction:o,scope:u});return Li(u,p),yo(()=>e(p,()=>p.end()),()=>{let{status:_}=q(p);p.isRecording()&&(!_||_==="ok")&&p.setStatus({code:2,message:"internal_error"})})}))}function kl(t,e){let n=Yf();return n.withActiveSpan?n.withActiveSpan(t,e):Fr(r=>(Li(r,t||void 0),e(r)))}function Ec(t){let e=Yf();return e.suppressTracing?e.suppressTracing(t):Fr(n=>{n.setSDKProcessingMetadata({[jf]:!0});let r=t();return n.setSDKProcessingMetadata({[jf]:void 0}),r})}function jB({parentSpan:t,spanArguments:e,forceTransaction:n,scope:r}){if(!yt()){let i=new Vi;if(n||!t){let a={sampled:"false",sample_rate:"0",transaction:e.name,...Je(i)};Gf(i,a)}return i}let o=Te(),s;if(t&&!n)s=vge(t,r,e),_c(t,s);else if(t){let i=Je(t),{traceId:a,spanId:c}=t.spanContext(),u=jr(t);s=$B({traceId:a,parentSpanId:c,...e},r,u),Gf(s,i)}else{let{traceId:i,dsc:a,parentSpanId:c,sampled:u}={...o.getPropagationContext(),...r.getPropagationContext()};s=$B({traceId:i,parentSpanId:c,...e},r,u),a&&Gf(s,a)}return xl(s),vl(s,r,o),s}function qB(t){let n={isStandalone:(t.experimental||{}).standalone,...t};if(t.startTime){let r={...n};return r.startTimestamp=fn(t.startTime),delete r.startTime,r}return n}function Yf(){let t=en();return dr(t)}function $B(t,e,n){let r=j(),o=r?.getOptions()||{},{name:s=""}=t,i={spanAttributes:{...t.attributes},spanName:s,parentSampled:n};r?.emit("beforeSampling",i,{decision:!1});let a=i.parentSampled??n,c=i.spanAttributes,u=e.getPropagationContext(),[l,d,p]=e.getScopeData().sdkProcessingMetadata[jf]?[!1]:Ul(o,{name:s,parentSampled:a,attributes:c,parentSampleRate:Cn(u.dsc?.sample_rate)},u.sampleRand),_=new mc({...t,attributes:{[pt]:"custom",[pr]:d!==void 0&&p?d:void 0,...c},sampled:l});return!l&&r&&(k&&T.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),r.recordDroppedEvent("sample_rate","transaction")),r&&r.emit("spanStart",_),_}function vge(t,e,n){let{spanId:r,traceId:o}=t.spanContext(),s=e.getScopeData().sdkProcessingMetadata[jf]?!1:jr(t),i=s?new mc({...n,parentSpanId:r,traceId:o,sampled:s}):new Vi({traceId:o});_c(t,i);let a=j();return a&&(a.emit("spanStart",i),n.endTimestamp&&a.emit("spanEnd",i)),i}function YB(t,e){if(e)return e;if(e===null)return;let n=xi(t);if(!n)return;let r=j();return(r?r.getOptions():{}).parentSpanIsAlwaysRootSpan?$e(n):n}function KB(t){return t!==void 0?e=>kl(t,e):e=>e()}var uR=0,WB=1,zB=2;function Sr(t){return new Yr(e=>{e(t)})}function Kf(t){return new Yr((e,n)=>{n(t)})}var Yr=class t{constructor(e){this._state=uR,this._handlers=[],this._runExecutor(e)}then(e,n){return new t((r,o)=>{this._handlers.push([!1,s=>{if(!e)r(s);else try{r(e(s))}catch(i){o(i)}},s=>{if(!n)o(s);else try{r(n(s))}catch(i){o(i)}}]),this._executeHandlers()})}catch(e){return this.then(n=>n,e)}finally(e){return new t((n,r)=>{let o,s;return this.then(i=>{s=!1,o=i,e&&e()},i=>{s=!0,o=i,e&&e()}).then(()=>{if(s){r(o);return}n(o)})})}_executeHandlers(){if(this._state===uR)return;let e=this._handlers.slice();this._handlers=[],e.forEach(n=>{n[0]||(this._state===WB&&n[1](this._value),this._state===zB&&n[2](this._value),n[0]=!0)})}_runExecutor(e){let n=(s,i)=>{if(this._state===uR){if(ur(i)){i.then(r,o);return}this._state=s,this._value=i,this._executeHandlers()}},r=s=>{n(WB,s)},o=s=>{n(zB,s)};try{e(r,o)}catch(s){o(s)}}};function Wf(t,e,n,r=0){return new Yr((o,s)=>{let i=t[r];if(e===null||typeof i!="function")o(e);else{let a=i({...e},n);k&&i.id&&a===null&&T.log(`Event processor "${i.id}" dropped event`),ur(a)?a.then(c=>Wf(t,c,n,r+1).then(o)).then(null,s):Wf(t,a,n,r+1).then(o).then(null,s)}})}function XB(t,e){let{fingerprint:n,span:r,breadcrumbs:o,sdkProcessingMetadata:s}=e;Ige(t,e),r&&Mge(t,r),Lge(t,n),Pge(t,o),bge(t,s)}function lR(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,sdkProcessingMetadata:a,breadcrumbs:c,fingerprint:u,eventProcessors:l,attachments:d,propagationContext:p,transactionName:_,span:f}=e;zf(t,"extra",n),zf(t,"tags",r),zf(t,"user",o),zf(t,"contexts",s),t.sdkProcessingMetadata=_s(t.sdkProcessingMetadata,a,2),i&&(t.level=i),_&&(t.transactionName=_),f&&(t.span=f),c.length&&(t.breadcrumbs=[...t.breadcrumbs,...c]),u.length&&(t.fingerprint=[...t.fingerprint,...u]),l.length&&(t.eventProcessors=[...t.eventProcessors,...l]),d.length&&(t.attachments=[...t.attachments,...d]),t.propagationContext={...t.propagationContext,...p}}function zf(t,e,n){t[e]=_s(t[e],n,1)}function Ige(t,e){let{extra:n,tags:r,user:o,contexts:s,level:i,transactionName:a}=e;Object.keys(n).length&&(t.extra={...n,...t.extra}),Object.keys(r).length&&(t.tags={...r,...t.tags}),Object.keys(o).length&&(t.user={...o,...t.user}),Object.keys(s).length&&(t.contexts={...s,...t.contexts}),i&&(t.level=i),a&&t.type!=="transaction"&&(t.transaction=a)}function Pge(t,e){let n=[...t.breadcrumbs||[],...e];t.breadcrumbs=n.length?n:void 0}function bge(t,e){t.sdkProcessingMetadata={...t.sdkProcessingMetadata,...e}}function Mge(t,e){t.contexts={trace:Es(e),...t.contexts},t.sdkProcessingMetadata={dynamicSamplingContext:Je(e),...t.sdkProcessingMetadata};let n=$e(e),r=q(n).description;r&&!t.transaction&&t.type==="transaction"&&(t.transaction=r)}function Lge(t,e){t.fingerprint=t.fingerprint?Array.isArray(t.fingerprint)?t.fingerprint:[t.fingerprint]:[],e&&(t.fingerprint=t.fingerprint.concat(e)),t.fingerprint.length||delete t.fingerprint}var Xf,JB,Jf;function ZB(t){let e=Q._sentryDebugIds;if(!e)return{};let n=Object.keys(e);return Jf&&n.length===JB||(JB=n.length,Jf=n.reduce((r,o)=>{Xf||(Xf={});let s=Xf[o];if(s)r[s[0]]=s[1];else{let i=t(o);for(let a=i.length-1;a>=0;a--){let u=i[a]?.filename,l=e[o];if(u&&l){r[u]=l,Xf[o]=[u,l];break}}}return r},{})),Jf}function QB(t,e,n,r,o,s){let{normalizeDepth:i=3,normalizeMaxBreadth:a=1e3}=t,c={...e,event_id:e.event_id||n.event_id||dt(),timestamp:e.timestamp||ho()},u=n.integrations||t.integrations.map(S=>S.name);xge(c,t),wge(c,u),o&&o.emit("applyFrameMetadata",e),e.type===void 0&&Dge(c,t.stackParser);let l=Vge(r,n.captureContext);n.mechanism&&ac(c,n.mechanism);let d=o?o.getEventProcessors():[],p=Mf().getScopeData();if(s){let S=s.getScopeData();lR(p,S)}if(l){let S=l.getScopeData();lR(p,S)}let _=[...n.attachments||[],...p.attachments];_.length&&(n.attachments=_),XB(c,p);let f=[...d,...p.eventProcessors];return Wf(f,c,n).then(S=>(S&&Uge(S),typeof i=="number"&&i>0?kge(S,i,a):S))}function xge(t,e){let{environment:n,release:r,dist:o,maxValueLength:s=250}=e;t.environment=t.environment||n||fc,!t.release&&r&&(t.release=r),!t.dist&&o&&(t.dist=o);let i=t.request;i?.url&&(i.url=Gr(i.url,s))}function Dge(t,e){let n=ZB(e);t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.filename&&(o.debug_id=n[o.filename])})})}function Uge(t){let e={};if(t.exception?.values?.forEach(r=>{r.stacktrace?.frames?.forEach(o=>{o.debug_id&&(o.abs_path?e[o.abs_path]=o.debug_id:o.filename&&(e[o.filename]=o.debug_id),delete o.debug_id)})}),Object.keys(e).length===0)return;t.debug_meta=t.debug_meta||{},t.debug_meta.images=t.debug_meta.images||[];let n=t.debug_meta.images;Object.entries(e).forEach(([r,o])=>{n.push({type:"sourcemap",code_file:r,debug_id:o})})}function wge(t,e){e.length>0&&(t.sdk=t.sdk||{},t.sdk.integrations=[...t.sdk.integrations||[],...e])}function kge(t,e,n){if(!t)return null;let r={...t,...t.breadcrumbs&&{breadcrumbs:t.breadcrumbs.map(o=>({...o,...o.data&&{data:Er(o.data,e,n)}}))},...t.user&&{user:Er(t.user,e,n)},...t.contexts&&{contexts:Er(t.contexts,e,n)},...t.extra&&{extra:Er(t.extra,e,n)}};return t.contexts?.trace&&r.contexts&&(r.contexts.trace=t.contexts.trace,t.contexts.trace.data&&(r.contexts.trace.data=Er(t.contexts.trace.data,e,n))),t.spans&&(r.spans=t.spans.map(o=>({...o,...o.data&&{data:Er(o.data,e,n)}}))),t.contexts?.flags&&r.contexts&&(r.contexts.flags=Er(t.contexts.flags,3,n)),r}function Vge(t,e){if(!e)return t;let n=t?t.clone():new _n;return n.update(e),n}function eG(t){if(t)return Bge(t)?{captureContext:t}:Hge(t)?{captureContext:t}:t}function Bge(t){return t instanceof _n||typeof t=="function"}var Gge=["user","level","extra","contexts","tags","fingerprint","propagationContext"];function Hge(t){return Object.keys(t).some(e=>Gge.includes(e))}function tn(t,e){return ie().captureException(t,eG(e))}function Zf(t,e){let n=typeof e=="string"?e:void 0,r=typeof e!="string"?{captureContext:e}:void 0;return ie().captureMessage(t,n,r)}function Qf(t,e){return ie().captureEvent(t,e)}function em(){let t=j();return t?.getOptions().enabled!==!1&&!!t?.getTransport()}function tm(t){let e=Te(),n=ie(),{userAgent:r}=Q.navigator||{},o=TB({user:n.getUser()||e.getUser(),...r&&{userAgent:r},...t}),s=e.getSession();return s?.status==="ok"&&Ao(s,{status:"exited"}),Vl(),e.setSession(o),o}function Vl(){let t=Te(),n=ie().getSession()||t.getSession();n&&gB(n),Fge(),t.setSession()}function Fge(){let t=Te(),e=j(),n=t.getSession();n&&e&&e.captureSession(n)}var $ge="7";function jge(t){let e=t.protocol?`${t.protocol}:`:"",n=t.port?`:${t.port}`:"";return`${e}//${t.host}${n}${t.path?`/${t.path}`:""}/api/`}function qge(t){return`${jge(t)}${t.projectId}/envelope/`}function Yge(t,e){let n={sentry_version:$ge};return t.publicKey&&(n.sentry_key=t.publicKey),e&&(n.sentry_client=`${e.name}/${e.version}`),new URLSearchParams(n).toString()}function tG(t,e,n){return e||`${qge(t)}?${Yge(t,n)}`}var nG=[];function Kge(t){let e={};return t.forEach(n=>{let{name:r}=n,o=e[r];o&&!o.isDefaultInstance&&n.isDefaultInstance||(e[r]=n)}),Object.values(e)}function dR(t){let e=t.defaultIntegrations||[],n=t.integrations;e.forEach(o=>{o.isDefaultInstance=!0});let r;if(Array.isArray(n))r=[...e,...n];else if(typeof n=="function"){let o=n(e);r=Array.isArray(o)?o:[o]}else r=e;return Kge(r)}function rG(t,e){let n={};return e.forEach(r=>{r&&_R(t,r,n)}),n}function pR(t,e){for(let n of e)n?.afterAllSetup&&n.afterAllSetup(t)}function _R(t,e,n){if(n[e.name]){k&&T.log(`Integration skipped because it was already installed: ${e.name}`);return}if(n[e.name]=e,nG.indexOf(e.name)===-1&&typeof e.setupOnce=="function"&&(e.setupOnce(),nG.push(e.name)),e.setup&&typeof e.setup=="function"&&e.setup(t),typeof e.preprocessEvent=="function"){let r=e.preprocessEvent.bind(e);t.on("preprocessEvent",(o,s)=>r(o,s,t))}if(typeof e.processEvent=="function"){let r=e.processEvent.bind(e),o=Object.assign((s,i)=>r(s,i,t),{id:e.name});t.addEventProcessor(o)}k&&T.log(`Integration installed: ${e.name}`)}function oG(t,e,n){let r=[{type:"client_report"},{timestamp:n||ho(),discarded_events:t}];return vn(e?{dsn:e}:{},[r])}function nm(t){let e=[];t.message&&e.push(t.message);try{let n=t.exception.values[t.exception.values.length-1];n?.value&&(e.push(n.value),n.type&&e.push(`${n.type}: ${n.value}`))}catch{}return e}function sG(t){let{trace_id:e,parent_span_id:n,span_id:r,status:o,origin:s,data:i,op:a}=t.contexts?.trace??{};return{data:i??{},description:t.transaction,op:a,parent_span_id:n,span_id:r??"",start_timestamp:t.start_timestamp??0,status:o,timestamp:t.timestamp,trace_id:e??"",origin:s,profile_id:i?.[dc],exclusive_time:i?.[pc],measurements:t.measurements,is_segment:!0}}function iG(t){return{type:"transaction",timestamp:t.timestamp,start_timestamp:t.start_timestamp,transaction:t.description,contexts:{trace:{trace_id:t.trace_id,span_id:t.span_id,parent_span_id:t.parent_span_id,op:t.op,status:t.status,origin:t.origin,data:{...t.data,...t.profile_id&&{[dc]:t.profile_id},...t.exclusive_time&&{[pc]:t.exclusive_time}}}},measurements:t.measurements}}var aG="Not capturing exception because it's already been captured.",cG="Discarded session because of missing or non-string release",dG=Symbol.for("SentryInternalError"),pG=Symbol.for("SentryDoNotSendEventError");function rm(t){return{message:t,[dG]:!0}}function fR(t){return{message:t,[pG]:!0}}function uG(t){return!!t&&typeof t=="object"&&dG in t}function lG(t){return!!t&&typeof t=="object"&&pG in t}var om=class{constructor(e){if(this._options=e,this._integrations={},this._numProcessing=0,this._outcomes={},this._hooks={},this._eventProcessors=[],e.dsn?this._dsn=UB(e.dsn):k&&T.warn("No DSN provided, client will not send events."),this._dsn){let n=tG(this._dsn,e.tunnel,e._metadata?e._metadata.sdk:void 0);this._transport=e.transport({tunnel:this._options.tunnel,recordDroppedEvent:this.recordDroppedEvent.bind(this),...e.transportOptions,url:n})}}captureException(e,n,r){let o=dt();if(bf(e))return k&&T.log(aG),o;let s={event_id:o,...n};return this._process(this.eventFromException(e,s).then(i=>this._captureEvent(i,s,r))),s.event_id}captureMessage(e,n,r,o){let s={event_id:dt(),...r},i=sc(e)?e:String(e),a=ic(e)?this.eventFromMessage(i,n,s):this.eventFromException(e,s);return this._process(a.then(c=>this._captureEvent(c,s,o))),s.event_id}captureEvent(e,n,r){let o=dt();if(n?.originalException&&bf(n.originalException))return k&&T.log(aG),o;let s={event_id:o,...n},i=e.sdkProcessingMetadata||{},a=i.capturedSpanScope,c=i.capturedSpanIsolationScope;return this._process(this._captureEvent(e,s,a||r,c)),s.event_id}captureSession(e){this.sendSession(e),Ao(e,{init:!1})}getDsn(){return this._dsn}getOptions(){return this._options}getSdkMetadata(){return this._options._metadata}getTransport(){return this._transport}flush(e){let n=this._transport;return n?(this.emit("flush"),this._isClientDoneProcessing(e).then(r=>n.flush(e).then(o=>r&&o))):Sr(!0)}close(e){return this.flush(e).then(n=>(this.getOptions().enabled=!1,this.emit("close"),n))}getEventProcessors(){return this._eventProcessors}addEventProcessor(e){this._eventProcessors.push(e)}init(){(this._isEnabled()||this._options.integrations.some(({name:e})=>e.startsWith("Spotlight")))&&this._setupIntegrations()}getIntegrationByName(e){return this._integrations[e]}addIntegration(e){let n=this._integrations[e.name];_R(this,e,this._integrations),n||pR(this,[e])}sendEvent(e,n={}){this.emit("beforeSendEvent",e,n);let r=VB(e,this._dsn,this._options._metadata,this._options.tunnel);for(let s of n.attachments||[])r=sR(r,aR(s));let o=this.sendEnvelope(r);o&&o.then(s=>this.emit("afterSendEvent",e,s),null)}sendSession(e){let{release:n,environment:r=fc}=this._options;if("aggregates"in e){let s=e.attrs||{};if(!s.release&&!n){k&&T.warn(cG);return}s.release=s.release||n,s.environment=s.environment||r,e.attrs=s}else{if(!e.release&&!n){k&&T.warn(cG);return}e.release=e.release||n,e.environment=e.environment||r}this.emit("beforeSendSession",e);let o=kB(e,this._dsn,this._options._metadata,this._options.tunnel);this.sendEnvelope(o)}recordDroppedEvent(e,n,r=1){if(this._options.sendClientReports){let o=`${e}:${n}`;k&&T.log(`Recording outcome: "${o}"${r>1?` (${r} times)`:""}`),this._outcomes[o]=(this._outcomes[o]||0)+r}}on(e,n){let r=this._hooks[e]=this._hooks[e]||[];return r.push(n),()=>{let o=r.indexOf(n);o>-1&&r.splice(o,1)}}emit(e,...n){let r=this._hooks[e];r&&r.forEach(o=>o(...n))}sendEnvelope(e){return this.emit("beforeEnvelope",e),this._isEnabled()&&this._transport?this._transport.send(e).then(null,n=>(k&&T.error("Error while sending envelope:",n),n)):(k&&T.error("Transport disabled"),Sr({}))}_setupIntegrations(){let{integrations:e}=this._options;this._integrations=rG(this,e),pR(this,e)}_updateSessionFromEvent(e,n){let r=n.level==="fatal",o=!1,s=n.exception?.values;if(s){o=!0;for(let c of s)if(c.mechanism?.handled===!1){r=!0;break}}let i=e.status==="ok";(i&&e.errors===0||i&&r)&&(Ao(e,{...r&&{status:"crashed"},errors:e.errors||Number(o||r)}),this.captureSession(e))}_isClientDoneProcessing(e){return new Yr(n=>{let r=0,o=1,s=setInterval(()=>{this._numProcessing==0?(clearInterval(s),n(!0)):(r+=o,e&&r>=e&&(clearInterval(s),n(!1)))},o)})}_isEnabled(){return this.getOptions().enabled!==!1&&this._transport!==void 0}_prepareEvent(e,n,r,o){let s=this.getOptions(),i=Object.keys(this._integrations);return!n.integrations&&i?.length&&(n.integrations=i),this.emit("preprocessEvent",e,n),e.type||o.setLastEventId(e.event_id||n.event_id),QB(s,e,n,r,this,o).then(a=>{if(a===null)return a;this.emit("postprocessEvent",a,n),a.contexts={trace:lc(r),...a.contexts};let c=Ro(this,r);return a.sdkProcessingMetadata={dynamicSamplingContext:c,...a.sdkProcessingMetadata},a})}_captureEvent(e,n={},r=ie(),o=Te()){return k&&mR(e)&&T.log(`Captured error event \`${nm(e)[0]||"<unknown>"}\``),this._processEvent(e,n,r,o).then(s=>s.event_id,s=>{k&&(lG(s)?T.log(s.message):uG(s)?T.warn(s.message):T.warn(s))})}_processEvent(e,n,r,o){let s=this.getOptions(),{sampleRate:i}=s,a=_G(e),c=mR(e),u=e.type||"error",l=`before send for type \`${u}\``,d=typeof i>"u"?void 0:Cn(i);if(c&&typeof d=="number"&&Math.random()>d)return this.recordDroppedEvent("sample_rate","error"),Kf(fR(`Discarding event because it's not included in the random sample (sampling rate = ${i})`));let p=u==="replay_event"?"replay":u;return this._prepareEvent(e,n,r,o).then(_=>{if(_===null)throw this.recordDroppedEvent("event_processor",p),fR("An event processor returned `null`, will not send event.");if(n.data&&n.data.__sentry__===!0)return _;let E=zge(this,s,_,n);return Wge(E,l)}).then(_=>{if(_===null){if(this.recordDroppedEvent("before_send",p),a){let g=1+(e.spans||[]).length;this.recordDroppedEvent("before_send","span",g)}throw fR(`${l} returned \`null\`, will not send event.`)}let f=r.getSession()||o.getSession();if(c&&f&&this._updateSessionFromEvent(f,_),a){let S=_.sdkProcessingMetadata?.spanCountBeforeProcessing||0,g=_.spans?_.spans.length:0,h=S-g;h>0&&this.recordDroppedEvent("before_send","span",h)}let E=_.transaction_info;if(a&&E&&_.transaction!==e.transaction){let S="custom";_.transaction_info={...E,source:S}}return this.sendEvent(_,n),_}).then(null,_=>{throw lG(_)||uG(_)?_:(this.captureException(_,{data:{__sentry__:!0},originalException:_}),rm(`Event processing pipeline threw an error, original event will not be sent. Details have been sent as a new event.
139
+ Reason: ${_}`))})}_process(e){this._numProcessing++,e.then(n=>(this._numProcessing--,n),n=>(this._numProcessing--,n))}_clearOutcomes(){let e=this._outcomes;return this._outcomes={},Object.entries(e).map(([n,r])=>{let[o,s]=n.split(":");return{reason:o,category:s,quantity:r}})}_flushOutcomes(){k&&T.log("Flushing outcomes...");let e=this._clearOutcomes();if(e.length===0){k&&T.log("No outcomes to send");return}if(!this._dsn){k&&T.log("No dsn provided, will not send outcomes");return}k&&T.log("Sending outcomes:",e);let n=oG(e,this._options.tunnel&&mr(this._dsn));this.sendEnvelope(n)}};function Wge(t,e){let n=`${e} must return \`null\` or a valid event.`;if(ur(t))return t.then(r=>{if(!go(r)&&r!==null)throw rm(n);return r},r=>{throw rm(`${e} rejected with ${r}`)});if(!go(t)&&t!==null)throw rm(n);return t}function zge(t,e,n,r){let{beforeSend:o,beforeSendTransaction:s,beforeSendSpan:i}=e,a=n;if(mR(a)&&o)return o(a,r);if(_G(a)){if(i){let c=i(sG(a));if(c?a=_s(n,iG(c)):Ml(),a.spans){let u=[];for(let l of a.spans){let d=i(l);d?u.push(d):(Ml(),u.push(l))}a.spans=u}}if(s){if(a.spans){let c=a.spans.length;a.sdkProcessingMetadata={...n.sdkProcessingMetadata,spanCountBeforeProcessing:c}}return s(a,r)}}return a}function mR(t){return t.type===void 0}function _G(t){return t.type==="transaction"}function fG(t,e){return e?Fr(e,()=>{let n=qr(),r=n?Es(n):lc(e);return[n?Je(n):Ro(t,e),r]}):[void 0,void 0]}function mG(t,e,n,r,o){let s={sent_at:new Date().toISOString()};n?.sdk&&(s.sdk={name:n.sdk.name,version:n.sdk.version}),r&&o&&(s.dsn=mr(o)),e&&(s.trace=e);let i=Xge(t);return vn(s,[i])}function Xge(t){return[{type:"check_in"},t]}function Jge(t){return[{type:"log",item_count:t.length,content_type:"application/vnd.sentry.items.log+json"},{items:t}]}function EG(t,e,n,r){let o={};return e?.sdk&&(o.sdk={name:e.sdk.name,version:e.sdk.version}),n&&r&&(o.dsn=mr(r)),vn(o,[Jge(t)])}function Gi(t,e){let n=e??Zge(t)??[];if(n.length===0)return;let r=t.getOptions(),o=EG(n,r._metadata,r.tunnel,t.getDsn());SG().set(t,[]),t.emit("flushLogs"),t.sendEnvelope(o)}function Zge(t){return SG().get(t)}function SG(){return To("clientToLogBufferMap",()=>new WeakMap)}function TG(t,e){return t(e.stack||"",1)}function ER(t,e){let n={type:e.name||e.constructor.name,value:e.message},r=TG(t,e);return r.length&&(n.stacktrace={frames:r}),n}function Qge(t){for(let e in t)if(Object.prototype.hasOwnProperty.call(t,e)){let n=t[e];if(n instanceof Error)return n}}function ehe(t){if("name"in t&&typeof t.name=="string"){let r=`'${t.name}' captured as exception`;return"message"in t&&typeof t.message=="string"&&(r+=` with message '${t.message}'`),r}else if("message"in t&&typeof t.message=="string")return t.message;let e=HA(t);if(LA(t))return`Event \`ErrorEvent\` captured as exception with message \`${t.message}\``;let n=the(t);return`${n&&n!=="Object"?`'${n}'`:"Object"} captured as exception with keys: ${e}`}function the(t){try{let e=Object.getPrototypeOf(t);return e?e.constructor.name:void 0}catch{}}function nhe(t,e,n,r){if(cs(n))return[n,void 0];if(e.synthetic=!0,go(n)){let s=t?.getOptions().normalizeDepth,i={__serialized__:rR(n,s)},a=Qge(n);if(a)return[a,i];let c=ehe(n),u=r?.syntheticException||new Error(c);return u.message=c,[u,i]}let o=r?.syntheticException||new Error(n);return o.message=`${n}`,[o,void 0]}function gG(t,e,n,r){let s=r?.data&&r.data.mechanism||{handled:!0,type:"generic"},[i,a]=nhe(t,s,n,r),c={exception:{values:[ER(e,i)]}};return a&&(c.extra=a),$A(c,void 0,void 0),ac(c,s),{...c,event_id:r?.event_id}}function hG(t,e,n="info",r,o){let s={event_id:r?.event_id,level:n};if(o&&r?.syntheticException){let i=TG(t,r.syntheticException);i.length&&(s.exception={values:[{value:e,stacktrace:{frames:i}}]},ac(s,{synthetic:!0}))}if(sc(e)){let{__sentry_template_string__:i,__sentry_template_values__:a}=e;return s.logentry={message:i,params:a},s}return s.message=e,s}var rhe=5e3,Bl=class extends om{constructor(e){if(LB(),super(e),this._logWeight=0,this._isLogTimerActive=!1,this._options.enableLogs??this._options._experiments?.enableLogs){let r=this;r.on("flushLogs",()=>{r._logWeight=0,clearTimeout(r._logFlushIdleTimeout),r._isLogTimerActive=!1}),r.on("afterCaptureLog",o=>{r._logWeight+=ohe(o),r._logWeight>=8e5?Gi(r):r._isLogTimerActive||(r._isLogTimerActive=!0,r._logFlushIdleTimeout=setTimeout(()=>{Gi(r)},rhe))}),r.on("flush",()=>{Gi(r)})}}eventFromException(e,n){let r=gG(this,this._options.stackParser,e,n);return r.level="error",Sr(r)}eventFromMessage(e,n="info",r){return Sr(hG(this._options.stackParser,e,n,r,this._options.attachStacktrace))}captureException(e,n,r){return AG(n),super.captureException(e,n,r)}captureEvent(e,n,r){return!e.type&&e.exception?.values&&e.exception.values.length>0&&AG(n),super.captureEvent(e,n,r)}captureCheckIn(e,n,r){let o="checkInId"in e&&e.checkInId?e.checkInId:dt();if(!this._isEnabled())return k&&T.warn("SDK not enabled, will not capture check-in."),o;let s=this.getOptions(),{release:i,environment:a,tunnel:c}=s,u={check_in_id:o,monitor_slug:e.monitorSlug,status:e.status,release:i,environment:a};"duration"in e&&(u.duration=e.duration),n&&(u.monitor_config={schedule:n.schedule,checkin_margin:n.checkinMargin,max_runtime:n.maxRuntime,timezone:n.timezone,failure_issue_threshold:n.failureIssueThreshold,recovery_threshold:n.recoveryThreshold});let[l,d]=fG(this,r);d&&(u.contexts={trace:d});let p=mG(u,l,this.getSdkMetadata(),c,this.getDsn());return k&&T.log("Sending checkin:",e.monitorSlug,e.status),this.sendEnvelope(p),o}_prepareEvent(e,n,r,o){return this._options.platform&&(e.platform=e.platform||this._options.platform),this._options.runtime&&(e.contexts={...e.contexts,runtime:e.contexts?.runtime||this._options.runtime}),this._options.serverName&&(e.server_name=e.server_name||this._options.serverName),super._prepareEvent(e,n,r,o)}};function AG(t){let e=Te().getScopeData().sdkProcessingMetadata.requestSession;if(e){let n=t?.mechanism?.handled??!0;n&&e.status!=="crashed"?e.status="errored":n||(e.status="crashed")}}function ohe(t){let e=0;return t.message&&(e+=t.message.length*2),t.attributes&&Object.values(t.attributes).forEach(n=>{Array.isArray(n)?e+=n.length*RG(n[0]):ic(n)?e+=RG(n):e+=100}),e}function RG(t){return typeof t=="string"?t.length*2:typeof t=="number"?8:typeof t=="boolean"?4:0}var SR=Symbol.for("SentryBufferFullError");function yG(t){let e=[];function n(){return t===void 0||e.length<t}function r(i){return e.splice(e.indexOf(i),1)[0]||Promise.resolve(void 0)}function o(i){if(!n())return Kf(SR);let a=i();return e.indexOf(a)===-1&&e.push(a),a.then(()=>r(a)).then(null,()=>r(a).then(null,()=>{})),a}function s(i){return new Yr((a,c)=>{let u=e.length;if(!u)return a(!0);let l=setTimeout(()=>{i&&i>0&&a(!1)},i);e.forEach(d=>{Sr(d).then(()=>{--u||(clearTimeout(l),a(!0))},c)})})}return{$:e,add:o,drain:s}}function she(t,e=Date.now()){let n=parseInt(`${t}`,10);if(!isNaN(n))return n*1e3;let r=Date.parse(`${t}`);return isNaN(r)?6e4:r-e}function ihe(t,e){return t[e]||t.all||0}function OG(t,e,n=Date.now()){return ihe(t,e)>n}function NG(t,{statusCode:e,headers:n},r=Date.now()){let o={...t},s=n?.["x-sentry-rate-limits"],i=n?.["retry-after"];if(s)for(let a of s.trim().split(",")){let[c,u,,,l]=a.split(":",5),d=parseInt(c,10),p=(isNaN(d)?60:d)*1e3;if(!u)o.all=r+p;else for(let _ of u.split(";"))_==="metric_bucket"?(!l||l.split(";").includes("custom"))&&(o[_]=r+p):o[_]=r+p}else i?o.all=r+she(i,r):e===429&&(o.all=r+60*1e3);return o}var ahe=64;function Gl(t,e,n=yG(t.bufferSize||ahe)){let r={},o=i=>n.drain(i);function s(i){let a=[];if(Hf(i,(d,p)=>{let _=Ff(p);OG(r,_)?t.recordDroppedEvent("ratelimit_backoff",_):a.push(d)}),a.length===0)return Sr({});let c=vn(i[0],a),u=d=>{Hf(c,(p,_)=>{t.recordDroppedEvent(d,Ff(_))})},l=()=>e({body:Ll(c)}).then(d=>(d.statusCode!==void 0&&(d.statusCode<200||d.statusCode>=300)&&k&&T.warn(`Sentry responded with status code ${d.statusCode} to sent event.`),r=NG(r,d),d),d=>{throw u("network_error"),k&&T.error("Encountered error running transport request:",d),d});return n.add(l).then(d=>d,d=>{if(d===SR)return k&&T.error("Skipped sending event because buffer is full."),u("queue_overflow"),Sr({});throw d})}return{send:s,flush:o}}function Hi(t,e,n=[e],r="npm"){let o=t._metadata||{};o.sdk||(o.sdk={name:`sentry.javascript.${e}`,packages:n.map(s=>({name:`${r}:@sentry/${s}`,version:Oe})),version:Oe}),t._metadata=o}function Sc(t={}){let e=t.client||j();if(!em()||!e)return{};let n=en(),r=dr(n);if(r.getTraceData)return r.getTraceData(t);let o=t.scope||ie(),s=t.span||qr(),i=s?Vf(s):che(o),a=s?Je(s):Ro(e,o),c=Di(a);return Df.test(i)?{"sentry-trace":i,baggage:c}:(T.warn("Invalid sentry-trace data. Cannot generate trace data"),{})}function che(t){let{traceId:e,sampled:n,propagationSpanId:r}=t.getPropagationContext();return ms(e,r,n)}function TR(t,e,n){let r,o,s,i=n?.maxWait?Math.max(n.maxWait,e):0,a=n?.setTimeoutImpl||setTimeout;function c(){return u(),r=t(),r}function u(){o!==void 0&&clearTimeout(o),s!==void 0&&clearTimeout(s),o=s=void 0}function l(){return o!==void 0||s!==void 0?c():r}function d(){return o&&clearTimeout(o),o=a(c,e),i&&s===void 0&&(s=a(c,i)),r}return d.cancel=u,d.flush=l,d}function CG(t){let e=Object.create(null);try{Object.entries(t).forEach(([n,r])=>{typeof r=="string"&&(e[n]=r)})}catch{}return e}function sm(t){let e=t.headers||{},r=(typeof e["x-forwarded-host"]=="string"?e["x-forwarded-host"]:void 0)||(typeof e.host=="string"?e.host:void 0),s=(typeof e["x-forwarded-proto"]=="string"?e["x-forwarded-proto"]:void 0)||t.protocol||(t.socket?.encrypted?"https":"http"),i=t.url||"",a=uhe({url:i,host:r,protocol:s}),c=t.body||void 0,u=t.cookies;return{url:a,method:t.method,query_string:vG(i),headers:CG(e),cookies:u,data:c}}function uhe({url:t,protocol:e,host:n}){if(t?.startsWith("http"))return t;if(t&&n)return`${e}://${n}${t}`}function vG(t){if(t)try{let e=new URL(t,"http://s.io").search.slice(1);return e.length?e:void 0}catch{return}}var lhe=100;function In(t,e){let n=j(),r=Te();if(!n)return;let{beforeBreadcrumb:o=null,maxBreadcrumbs:s=lhe}=n.getOptions();if(s<=0)return;let a={timestamp:ho(),...t},c=o?Fe(()=>o(a,e)):a;c!==null&&(n.emit&&n.emit("beforeAddBreadcrumb",c,e),r.addBreadcrumb(c,s))}var IG,dhe="FunctionToString",PG=new WeakMap,phe=(()=>({name:dhe,setupOnce(){IG=Function.prototype.toString;try{Function.prototype.toString=function(...t){let e=GA(this),n=PG.has(j())&&e!==void 0?e:this;return IG.apply(n,t)}}catch{}},setup(t){PG.set(t,!0)}})),im=phe;var _he=[/^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. (In 'vv().getRestrictions(1,a)', 'vv().getRestrictions' is undefined)","Can't find variable: _AutofillCallbackHandler",/^Non-Error promise rejection captured with value: Object Not Found Matching Id:\d+, MethodName:simulateEvent, ParamCount:\d+$/,/^Java exception was raised during method invocation$/],fhe="EventFilters",gR=(t={})=>{let e;return{name:fhe,setup(n){let r=n.getOptions();e=bG(t,r)},processEvent(n,r,o){if(!e){let s=o.getOptions();e=bG(t,s)}return mhe(n,e)?null:n}}},cm=((t={})=>({...gR(t),name:"InboundFilters"}));function bG(t={},e={}){return{allowUrls:[...t.allowUrls||[],...e.allowUrls||[]],denyUrls:[...t.denyUrls||[],...e.denyUrls||[]],ignoreErrors:[...t.ignoreErrors||[],...e.ignoreErrors||[],...t.disableErrorDefaults?[]:_he],ignoreTransactions:[...t.ignoreTransactions||[],...e.ignoreTransactions||[]]}}function mhe(t,e){if(t.type){if(t.type==="transaction"&&She(t,e.ignoreTransactions))return k&&T.warn(`Event dropped due to being matched by \`ignoreTransactions\` option.
140
+ Event: ${ds(t)}`),!0}else{if(Ehe(t,e.ignoreErrors))return k&&T.warn(`Event dropped due to being matched by \`ignoreErrors\` option.
141
+ Event: ${ds(t)}`),!0;if(Ahe(t))return k&&T.warn(`Event dropped due to not having an error message, error type or stacktrace.
142
+ Event: ${ds(t)}`),!0;if(The(t,e.denyUrls))return k&&T.warn(`Event dropped due to being matched by \`denyUrls\` option.
143
143
  Event: ${ds(t)}.
144
- Url: ${im(t)}`),!0;if(!fhe(t,e.allowUrls))return k&&T.warn(`Event dropped due to not being matched by \`allowUrls\` option.
144
+ Url: ${am(t)}`),!0;if(!ghe(t,e.allowUrls))return k&&T.warn(`Event dropped due to not being matched by \`allowUrls\` option.
145
145
  Event: ${ds(t)}.
146
- Url: ${im(t)}`),!0}return!1}function dhe(t,e){return e?.length?tm(t).some(n=>ls(n,e)):!1}function phe(t,e){if(!e?.length)return!1;let n=t.transaction;return n?ls(n,e):!1}function _he(t,e){if(!e?.length)return!1;let n=im(t);return n?ls(n,e):!1}function fhe(t,e){if(!e?.length)return!0;let n=im(t);return n?ls(n,e):!0}function mhe(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function im(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?mhe(n):null}catch{return k&&T.error(`Cannot extract url for event ${ds(t)}`),null}}function Ehe(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function bG(t,e,n,r,o,s){if(!o.exception?.values||!s||!Br(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=gR(t,e,r,s.originalException,n,o.exception.values,i,0))}function gR(t,e,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Br(r[o],Error)){IG(i,a);let u=t(e,r[o]),l=c.length;PG(u,o,l,a),c=gR(t,e,n,r[o],o,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Br(u,Error)){IG(i,a);let d=t(e,u),p=c.length;PG(d,`errors[${l}]`,p,a),c=gR(t,e,n,u,o,[d,...c],d,p)}}),c}function IG(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function PG(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}var She="cause",The=5,ghe="LinkedErrors",hhe=((t={})=>{let e=t.limit||The,n=t.key||She;return{name:ghe,preprocessEvent(r,o,s){let i=s.getOptions();bG(mR,i.stackParser,n,e,r,o)}}}),cm=hhe;function MG(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let s=t.slice(n,r).trim();if(e[s]===void 0){let i=t.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{e[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{e[s]=i}}n=o+1}return e}var hR=["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 LG(t){return hR.map(o=>{let s=t[o],i=Array.isArray(s)?s.join(";"):s;return o==="Forwarded"?Ahe(i):i?.split(",").map(a=>a.trim())}).reduce((o,s)=>s?o.concat(s):o,[]).find(o=>o!==null&&Rhe(o))||null}function Ahe(t){if(!t)return null;for(let e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function Rhe(t){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(t)}var yhe={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Ohe="RequestData",Nhe=((t={})=>{let e={...yhe,...t.include};return{name:Ohe,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...e,ip:e.ip??o.getOptions().sendDefaultPii};return i&&Che(n,i,{ipAddress:a},c),n}}}),um=Nhe;function Che(t,e,n,r){if(t.request={...t.request,...vhe(e,r)},r.ip){let o=e.headers&&LG(e.headers)||n.ipAddress;o&&(t.user={...t.user,ip_address:o})}}function vhe(t,e){let n={},r={...t.headers};if(e.headers&&(n.headers=r,e.cookies||delete r.cookie,e.ip||hR.forEach(o=>{delete r[o]})),n.method=t.method,e.url&&(n.url=t.url),e.cookies){let o=t.cookies||(r?.cookie?MG(r.cookie):void 0);n.cookies=o||{}}return e.query_string&&(n.query_string=t.query_string),e.data&&(n.data=t.data),n}function xG(t){let e="console";nc(e,t),rc(e,Ihe)}function Ihe(){"console"in Q&&yl.forEach(function(t){t in Q.console&&VA(Q.console,t,function(e){return tc[t]=e,function(...n){oc("console",{args:n,level:t}),tc[t]?.apply(Q.console,n)}})})}function DG(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Phe=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function bhe(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=Phe.exec(e);return n?n.slice(1):[]}function AR(t){let e=bhe(t),n=e[0]||"",r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var Mhe="Console",lm=(t={})=>{let e=new Set(t.levels||yl);return{name:Mhe,setup(n){xG(({args:r,level:o})=>{j()!==n||!e.has(o)||Lhe(o,r)})}}};function Lhe(t,e){let n={category:"console",data:{arguments:e,logger:"console"},level:DG(t),message:UG(e)};if(t==="assert")if(e[0]===!1){let r=e.slice(1);n.message=r.length>0?`Assertion failed: ${UG(r)}`:"Assertion failed",n.data.arguments=r}else return;vn(n,{input:e,level:t})}function UG(t){return"util"in Q&&typeof Q.util.format=="function"?Q.util.format(...t):kA(t," ")}function Ss(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Tc(t){return t.split(/[?#]/,1)[0]}function Ts(t){let{protocol:e,host:n,path:r}=t,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${e?`${e}://`:""}${o}${r}`}var RR="ai.prompt",wG="ai.response.object",kG="ai.response.text",VG="ai.response.toolCalls",BG="ai.prompt.messages",GG="ai.prompt.tools",Kr="ai.model.id",HG="ai.model.provider",FG="ai.response.providerMetadata",$G="ai.telemetry.functionId",jG="ai.usage.completionTokens",qG="ai.usage.promptTokens",yR="gen_ai.response.model",dm="gen_ai.usage.input_tokens",pm="gen_ai.usage.output_tokens",OR="ai.toolCall.name",NR="ai.toolCall.id",YG="ai.toolCall.args",KG="ai.toolCall.result";function WG(t,e){t.setAttribute(ge,e)}function xhe(t){let{data:e,description:n}=q(t);if(!n)return;if(e[OR]&&e[NR]&&n==="ai.toolCall"){whe(t,e);return}let r=e[Kr],o=e[HG];typeof r!="string"||typeof o!="string"||!r||!o||khe(t,n,e)}function Dhe(t){if(t.type==="transaction"&&t.spans)for(let e of t.spans)Uhe(e);return t}function Uhe(t){let{data:e,origin:n}=t;if(n==="auto.vercelai.otel"){qn(e,jG,pm),qn(e,qG,dm),typeof e[pm]=="number"&&typeof e[dm]=="number"&&(e["gen_ai.usage.total_tokens"]=e[pm]+e[dm]),qn(e,BG,"gen_ai.request.messages"),qn(e,kG,"gen_ai.response.text"),qn(e,VG,"gen_ai.response.tool_calls"),qn(e,wG,"gen_ai.response.object"),qn(e,GG,"gen_ai.request.available_tools"),qn(e,YG,"gen_ai.tool.input"),qn(e,KG,"gen_ai.tool.output"),Vhe(e);for(let r of Object.keys(e))r.startsWith("ai.")&&qn(e,r,`vercel.${r}`)}}function qn(t,e,n){t[e]!=null&&(t[n]=t[e],delete t[e])}function whe(t,e){WG(t,"auto.vercelai.otel"),t.setAttribute(re,"gen_ai.execute_tool"),qn(e,OR,"gen_ai.tool.name"),qn(e,NR,"gen_ai.tool.call.id"),e["gen_ai.tool.type"]||t.setAttribute("gen_ai.tool.type","function");let n=e["gen_ai.tool.name"];n&&t.updateName(`execute_tool ${n}`)}function khe(t,e,n){WG(t,"auto.vercelai.otel");let r=e.replace("ai.","");t.setAttribute("ai.pipeline.name",r),t.updateName(r);let o=n[$G];if(o&&typeof o=="string"&&e.split(".").length-1===1&&(t.updateName(`${r} ${o}`),t.setAttribute("gen_ai.function_id",o)),n[RR]&&t.setAttribute("gen_ai.prompt",n[RR]),n[Kr]&&!n[yR]&&t.setAttribute(yR,n[Kr]),t.setAttribute("ai.streaming",e.includes("stream")),e==="ai.generateText"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.generateText.doGenerate"){t.setAttribute(re,"gen_ai.generate_text"),t.updateName(`generate_text ${n[Kr]}`);return}if(e==="ai.streamText"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.streamText.doStream"){t.setAttribute(re,"gen_ai.stream_text"),t.updateName(`stream_text ${n[Kr]}`);return}if(e==="ai.generateObject"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.generateObject.doGenerate"){t.setAttribute(re,"gen_ai.generate_object"),t.updateName(`generate_object ${n[Kr]}`);return}if(e==="ai.streamObject"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.streamObject.doStream"){t.setAttribute(re,"gen_ai.stream_object"),t.updateName(`stream_object ${n[Kr]}`);return}if(e==="ai.embed"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.embed.doEmbed"){t.setAttribute(re,"gen_ai.embed"),t.updateName(`embed ${n[Kr]}`);return}if(e==="ai.embedMany"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.embedMany.doEmbed"){t.setAttribute(re,"gen_ai.embed_many"),t.updateName(`embed_many ${n[Kr]}`);return}if(e.startsWith("ai.stream")){t.setAttribute(re,"ai.run");return}}function _m(t){t.on("spanStart",xhe),t.addEventProcessor(Object.assign(Dhe,{id:"VercelAiEventProcessor"}))}function Vhe(t){let e=t[FG];if(e)try{let n=JSON.parse(e);n.openai&&(Sr(t,"gen_ai.usage.input_tokens.cached",n.openai.cachedPromptTokens),Sr(t,"gen_ai.usage.output_tokens.reasoning",n.openai.reasoningTokens),Sr(t,"gen_ai.usage.output_tokens.prediction_accepted",n.openai.acceptedPredictionTokens),Sr(t,"gen_ai.usage.output_tokens.prediction_rejected",n.openai.rejectedPredictionTokens),Sr(t,"gen_ai.conversation.id",n.openai.responseId)),n.anthropic&&(Sr(t,"gen_ai.usage.input_tokens.cached",n.anthropic.cacheReadInputTokens),Sr(t,"gen_ai.usage.input_tokens.cache_write",n.anthropic.cacheCreationInputTokens)),n.bedrock?.usage&&(Sr(t,"gen_ai.usage.input_tokens.cached",n.bedrock.usage.cacheReadInputTokens),Sr(t,"gen_ai.usage.input_tokens.cache_write",n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Sr(t,"gen_ai.usage.input_tokens.cached",n.deepseek.promptCacheHitTokens),Sr(t,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}function Sr(t,e,n){n!=null&&(t[e]=n)}var zG="gen_ai.system",fm="gen_ai.request.model",XG="gen_ai.request.temperature",JG="gen_ai.request.frequency_penalty",ZG="gen_ai.request.presence_penalty",QG="gen_ai.request.top_p",CR="gen_ai.response.finish_reasons",eH="gen_ai.response.model",tH="gen_ai.response.id",nH="gen_ai.usage.input_tokens",rH="gen_ai.usage.output_tokens",oH="gen_ai.usage.total_tokens",sH="gen_ai.operation.name",vR="gen_ai.request.messages",IR="gen_ai.response.text",iH="openai.response.id",aH="openai.response.model",cH="openai.response.timestamp",uH="openai.usage.completion_tokens",lH="openai.usage.prompt_tokens",PR={CHAT:"chat"};var gs="OpenAI",dH=["responses.create","chat.completions.create"];function mm(t){return t.includes("chat.completions")?PR.CHAT:t.includes("responses")?PR.CHAT:t.split(".").pop()||"unknown"}function pH(t){return`gen_ai.${mm(t)}`}function _H(t){return dH.includes(t)}function fH(t,e){return t?`${t}.${e}`:e}function mH(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion"}function EH(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="response"}function Bhe(t,e){let n={[zG]:"openai",[sH]:mm(e)};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0];n[fm]=r.model??"unknown","temperature"in r&&(n[XG]=r.temperature),"top_p"in r&&(n[QG]=r.top_p),"frequency_penalty"in r&&(n[JG]=r.frequency_penalty),"presence_penalty"in r&&(n[ZG]=r.presence_penalty)}else n[fm]="unknown";return n}function SH(t,e,n,r){e!==void 0&&t.setAttributes({[lH]:e,[nH]:e}),n!==void 0&&t.setAttributes({[uH]:n,[rH]:n}),r!==void 0&&t.setAttributes({[oH]:r})}function TH(t,e,n,r){e&&t.setAttributes({[iH]:e,[tH]:e}),n&&t.setAttributes({[aH]:n,[eH]:n}),r&&t.setAttributes({[cH]:new Date(r*1e3).toISOString()})}function Ghe(t,e){if(TH(t,e.id,e.model,e.created),e.usage&&SH(t,e.usage.prompt_tokens,e.usage.completion_tokens,e.usage.total_tokens),Array.isArray(e.choices)){let n=e.choices.map(r=>r.finish_reason).filter(r=>r!==null);n.length>0&&t.setAttributes({[CR]:JSON.stringify(n)})}}function Hhe(t,e){TH(t,e.id,e.model,e.created_at),e.status&&t.setAttributes({[CR]:JSON.stringify([e.status])}),e.usage&&SH(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.total_tokens)}function Fhe(t,e,n){if(!e||typeof e!="object")return;let r=e;if(mH(r)){if(Ghe(t,r),n&&r.choices?.length){let o=r.choices.map(s=>s.message?.content||"");t.setAttributes({[IR]:JSON.stringify(o)})}}else EH(r)&&(Hhe(t,r),n&&r.output_text&&t.setAttributes({[IR]:r.output_text}))}function $he(t,e){"messages"in e&&t.setAttributes({[vR]:JSON.stringify(e.messages)}),"input"in e&&t.setAttributes({[vR]:JSON.stringify(e.input)})}function jhe(){let e=ie().getClient(),n=e?.getIntegrationByName(gs),r=n?!!e?.getOptions().sendDefaultPii:!1;return{recordInputs:n?.options?.recordInputs??r,recordOutputs:n?.options?.recordOutputs??r}}function qhe(t,e,n,r){return async function(...s){let i=r||jhe(),a=Bhe(s,e),c=a[fm]||"unknown",u=mm(e);return wl({name:`${u} ${c}`,op:pH(e),attributes:a},async l=>{try{i.recordInputs&&s[0]&&typeof s[0]=="object"&&$he(l,s[0]);let d=await t.apply(n,s);return Fhe(l,d,i.recordOutputs),d}catch(d){throw tn(d),d}})}}function gH(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=fH(e,String(o));return typeof s=="function"&&_H(i)?qhe(s,i,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?gH(s,i,n):s}})}function bR(t,e){return gH(t,"",e)}function Hl(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}function AH(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function RH(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let o=r.match(n);if(o){let s,i,a,c,u;if(o[1]){a=o[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){s=a.slice(0,p),i=a.slice(p+1);let _=s.indexOf(".Module");_>0&&(a=a.slice(_+1),s=s.slice(0,_))}c=void 0}i&&(c=s,u=i),i==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"?",a=c?`${c}.${u}`:u);let l=o[2]?.startsWith("file://")?o[2].slice(7):o[2],d=o[5]==="native";return l?.match(/\/[A-Z]:/)&&(l=l.slice(1)),!l&&o[5]&&!d&&(l=o[5]),{filename:l?decodeURI(l):void 0,module:t?t(l):void 0,function:a,lineno:hH(o[3]),colno:hH(o[4]),in_app:AH(l||"",d)}}if(r.match(e))return{filename:r}}}function MR(t){return[90,RH(t)]}function hH(t){return parseInt(t||"",10)||void 0}var mn=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let n=this._cache.get(e);if(n!==void 0)return this._cache.delete(e),this._cache.set(e,n),n}set(e,n){this._cache.size>=this._maxSize&&this._cache.delete(this._cache.keys().next().value),this._cache.set(e,n)}remove(e){let n=this._cache.get(e);return n&&this._cache.delete(e),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(n=>e.push(n)),e}};var LR=v(de(),1),Fl={};function F(t,e,n){return n?EAe(t,e,n):mAe(t,e)}function mAe(t,e){return Object.assign(n=>{let r=Fl[t];if(r)return n&&r.setConfig(n),r;let o=e(n);return Fl[t]=o,(0,LR.registerInstrumentations)({instrumentations:[o]}),o},{id:t})}function EAe(t,e,n){return Object.assign(r=>{let o=n(r),s=Fl[t];if(s)return s.setConfig(o),s;let i=new e(o);return Fl[t]=i,(0,LR.registerInstrumentations)({instrumentations:[i]}),i},{id:t})}function $l(t){let e=!1,n=[];if(!SAe(t))e=!0;else{let o=t._wrap;t._wrap=(...s)=>(e=!0,n.forEach(i=>i()),n=[],o(...s))}return o=>{e?o():n.push(o)}}function SAe(t){return typeof t._wrap=="function"}var Xr=require("node:diagnostics_channel");L();var E4=v(fe(),1),td=v(de(),1);Re();L();L();var Kn=v(fe(),1),As=v(qy(),1),eO="sentry.parentIsRemote",kc="sentry.graphql.operation";function tO(t){if("parentSpanId"in t)return t.parentSpanId;if("parentSpanContext"in t)return t.parentSpanContext?.spanId}function nO(t){let e=t;return!!e.attributes&&typeof e.attributes=="object"}function bxe(t){return typeof t.kind=="number"}function Mxe(t){return!!t.status}function q2(t){return!!t.name}function Lxe(t){if(!nO(t))return{};let e=t.attributes[hc]||t.attributes[gc],n={url:e,"http.method":t.attributes[Fi]||t.attributes[jl]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof e=="string"){let r=Ss(e);n.url=Ts(r),r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash)}}catch{}return n}function xxe(t){return bxe(t)?t.kind:It.INTERNAL}var Yy="sentry-trace",Ky="baggage",rO="sentry.dsc",oO="sentry.sampled_not_recording",Y2="sentry.url",Dxe="sentry.sample_rand",Uxe="sentry.sample_rate",K2=sr("sentry_scopes"),Wy=sr("sentry_fork_isolation_scope"),zy=sr("sentry_fork_set_scope"),Xy=sr("sentry_fork_set_isolation_scope"),W2="_scopeContext";function Vc(t){return t.getValue(K2)}function z2(t,e){return t.setValue(K2,e)}function wxe(t,e){rt(t,W2,e)}function Zl(t){return t[W2]}function wc(t){let{traceFlags:e,traceState:n}=t,r=n?n.get(oO)==="1":!1;if(e===wn.SAMPLED)return!0;if(r)return!1;let o=n?n.get(rO):void 0,s=o?fs(o):void 0;if(s?.sampled==="true")return!0;if(s?.sampled==="false")return!1}function X2(t,e,n){let r=e[Fi]||e[jl];if(r)return Vxe({attributes:e,name:t,kind:n},r);let o=e[DR],s=typeof e[re]=="string"&&e[re].startsWith("cache.");if(o&&!s)return kxe({attributes:e,name:t});let i=e[pt]==="custom"?"custom":"route";if(e[BR])return{...Jl(t,e,"route"),op:"rpc"};if(e[VR])return{...Jl(t,e,i),op:"message"};let u=e[wR];return u?{...Jl(t,e,i),op:u.toString()}:{op:void 0,description:t,source:"custom"}}function J2(t){let e=nO(t)?t.attributes:{},n=q2(t)?t.name:"<unknown>",r=xxe(t);return X2(n,e,r)}function kxe({attributes:t,name:e}){let n=t[$r];if(typeof n=="string")return{op:"db",description:n,source:t[pt]||"custom"};if(t[pt]==="custom")return{op:"db",description:e,source:"custom"};let r=t[UR];return{op:"db",description:r?r.toString():e,source:"task"}}function Vxe({name:t,kind:e,attributes:n},r){let o=["http"];switch(e){case It.CLIENT:o.push("client");break;case It.SERVER:o.push("server");break}n["sentry.http.prefetch"]&&o.push("prefetch");let{urlPath:s,url:i,query:a,fragment:c,hasRoute:u}=Gxe(n,e);if(!s)return{...Jl(t,n),op:o.join(".")};let l=n[kc],d=`${r} ${s}`,p=l?`${d} (${Bxe(l)})`:d,_=u||s==="/"?"route":"url",f={};i&&(f.url=i),a&&(f["http.query"]=a),c&&(f["http.fragment"]=c);let E=e===It.CLIENT||e===It.SERVER,g=!`${n[ge]||"manual"}`.startsWith("auto"),h=n[pt]==="custom",O=n[$r],N=!h&&O==null&&(E||!g),{description:R,source:M}=N?{description:p,source:_}:Jl(t,n);return{op:o.join("."),description:R,source:M,data:f}}function Bxe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}function Gxe(t,e){let n=t[kR],r=t[gc]||t[hc],o=t[Wr],s=typeof r=="string"?Ss(r):void 0,i=s?Ts(s):void 0,a=s?.search||void 0,c=s?.hash||void 0;return typeof o=="string"?{urlPath:o,url:i,query:a,fragment:c,hasRoute:!0}:e===It.SERVER&&typeof n=="string"?{urlPath:Tc(n),url:i,query:a,fragment:c,hasRoute:!1}:s?{urlPath:i,url:i,query:a,fragment:c,hasRoute:!1}:typeof n=="string"?{urlPath:Tc(n),url:i,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:i,query:a,fragment:c,hasRoute:!1}}function Jl(t,e,n="custom"){let r=e[pt]||n,o=e[$r];return o&&typeof o=="string"?{description:o,source:r}:{description:t,source:r}}function Z2(t){t.on("createDsc",(e,n)=>{if(!n)return;let s=q(n).data[pt],{description:i}=q2(n)?J2(n):{description:void 0};if(s!=="url"&&i&&(e.transaction=i),yt()){let a=wc(n.spanContext());e.sampled=a==null?void 0:String(a)}})}function Q2(){return ne.getActiveSpan()}var zr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function e4({dsc:t,sampled:e}){let n=t?Di(t):void 0,r=new Kn.TraceState,o=n?r.set(rO,n):r;return e===!1?o.set(oO,"1"):o}var t4=new Set;function n4(){return Array.from(t4)}function pE(t){t4.add(t)}var uE=class extends Kn.W3CBaggagePropagator{constructor(){super(),pE("SentryPropagator"),this._urlMatchesTargetsMap=new mn(100)}inject(e,n,r){if((0,Kn.isTracingSuppressed)(e)){zr&&T.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let o=ne.getSpan(e),s=o&&$xe(o),i=j()?.getOptions()?.tracePropagationTargets;if(!Ql(s,i,this._urlMatchesTargetsMap)){zr&&T.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",s);return}let a=Fxe(n),c=Xt.getBaggage(e)||Xt.createBaggage({}),{dynamicSamplingContext:u,traceId:l,spanId:d,sampled:p}=r4(e);if(a){let _=Ui(a);_&&Object.entries(_).forEach(([f,E])=>{c=c.setEntry(f,{value:E})})}u&&(c=Object.entries(u).reduce((_,[f,E])=>E?_.setEntry(`${Il}${f}`,{value:E}):_,c)),l&&l!==Ri&&r.set(n,Yy,ms(l,d,p)),super.inject(Xt.setBaggage(e,c),n,r)}extract(e,n,r){let o=r.get(n,Yy),s=r.get(n,Ky),i=o?Array.isArray(o)?o[0]:o:void 0;return s4(o4(e,{sentryTrace:i,baggage:s}))}fields(){return[Yy,Ky]}},H2="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function Ql(t,e,n){if(typeof t!="string"||!e)return!0;let r=n?.get(t);if(r!==void 0)return zr&&!r&&T.log(H2,t),r;let o=ls(t,e);return n?.set(t,o),zr&&!o&&T.log(H2,t),o}function r4(t,e={}){let n=ne.getSpan(t);if(n?.spanContext().isRemote){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:void 0,sampled:wc(a)}}if(n){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:a.spanId,sampled:wc(a)}}let r=e.scope||Vc(t)?.scope||ie(),o=e.client||j(),s=r.getPropagationContext();return{dynamicSamplingContext:o?Ro(o,r):void 0,traceId:s.traceId,spanId:s.propagationSpanId,sampled:s.sampled}}function o4(t,{sentryTrace:e,baggage:n}){let r=Pl(e,n),{traceId:o,parentSpanId:s,sampled:i,dsc:a}=r;if(!s)return t;let c=jxe({traceId:o,spanId:s,sampled:i,dsc:a});return ne.setSpanContext(t,c)}function Hxe(t,e,n){let r=s4(o4(t,e));return K.with(r,n)}function s4(t){let e=Vc(t),n={scope:e?e.scope:ie().clone(),isolationScope:e?e.isolationScope:Te()};return z2(t,n)}function Fxe(t){try{let e=t[Ky];return Array.isArray(e)?e.join(","):e}catch{return}}function $xe(t){let e=q(t).data,n=e[gc]||e[hc];if(typeof n=="string")return n;let r=t.spanContext().traceState?.get(Y2);if(r)return r}function jxe({spanId:t,traceId:e,sampled:n,dsc:r}){let o=e4({dsc:r,sampled:n});return{traceId:e,spanId:t,isRemote:!0,traceFlags:n?wn.SAMPLED:wn.NONE,traceState:o}}function qxe(t,e){let n=sO(),{name:r,parentSpan:o}=t;return cO(o)(()=>{let i=aO(t.scope,t.forceTransaction),c=t.onlyIfParent&&!ne.getSpan(i)?(0,Kn.suppressTracing)(i):i,u=iO(t);return n.startActiveSpan(r,u,c,l=>yo(()=>e(l),()=>{q(l).status===void 0&&l.setStatus({code:ve.ERROR})},()=>l.end()))})}function Yxe(t,e){let n=sO(),{name:r,parentSpan:o}=t;return cO(o)(()=>{let i=aO(t.scope,t.forceTransaction),c=t.onlyIfParent&&!ne.getSpan(i)?(0,Kn.suppressTracing)(i):i,u=iO(t);return n.startActiveSpan(r,u,c,l=>yo(()=>e(l,()=>l.end()),()=>{q(l).status===void 0&&l.setStatus({code:ve.ERROR})}))})}function Kxe(t){let e=sO(),{name:n,parentSpan:r}=t;return cO(r)(()=>{let s=aO(t.scope,t.forceTransaction),a=t.onlyIfParent&&!ne.getSpan(s)?(0,Kn.suppressTracing)(s):s,c=iO(t);return e.startSpan(n,c,a)})}function i4(t,e){let n=t?ne.setSpan(K.active(),t):ne.deleteSpan(K.active());return K.with(n,()=>e(ie()))}function sO(){return j()?.tracer||ne.getTracer("@sentry/opentelemetry",Oe)}function iO(t){let{startTime:e,attributes:n,kind:r,op:o,links:s}=t,i=typeof e=="number"?Wxe(e):e;return{attributes:o?{[re]:o,...n}:n,kind:r,links:s,startTime:i}}function Wxe(t){return t<9999999999?t*1e3:t}function aO(t,e){let n=zxe(t),r=ne.getSpan(n);if(!r||!e)return n;let o=ne.deleteSpan(n),{spanId:s,traceId:i}=r.spanContext(),a=wc(r.spanContext()),c=$e(r),u=Je(c),l=e4({dsc:u,sampled:a}),d={traceId:i,spanId:s,isRemote:!0,traceFlags:a?wn.SAMPLED:wn.NONE,traceState:l};return ne.setSpanContext(o,d)}function zxe(t){if(t){let e=Zl(t);if(e)return e}return K.active()}function Xxe(t,e){return Hxe(K.active(),t,e)}function a4(t,e){let n=Zl(e),r=n&&ne.getSpan(n),o=r?Es(r):lc(e);return[r?Je(r):Ro(t,e),o]}function cO(t){return t!==void 0?e=>i4(t,e):e=>e()}function Jxe(t){let e=(0,Kn.suppressTracing)(K.active());return K.with(e,t)}function c4(t){t.on("preprocessEvent",e=>{let n=Q2();if(!n||e.type==="transaction")return;e.contexts={trace:Es(n),...e.contexts};let r=$e(n);return e.sdkProcessingMetadata={dynamicSamplingContext:Je(r),...e.sdkProcessingMetadata},e})}function Zxe({span:t,scope:e,client:n}={}){let r=(e&&Zl(e))??K.active();if(t){let{scope:c}=pr(t);r=c&&Zl(c)||ne.setSpan(K.active(),t)}let{traceId:o,spanId:s,sampled:i,dynamicSamplingContext:a}=r4(r,{scope:e,client:n});return{"sentry-trace":ms(o,s,i),baggage:Di(a)}}function u4(){function t(){let a=K.active(),c=Vc(a);return c||{scope:cc(),isolationScope:Hr()}}function e(a){let c=K.active();return K.with(c,()=>a(s()))}function n(a,c){let u=Zl(a)||K.active();return K.with(u.setValue(zy,a),()=>c(a))}function r(a){let c=K.active();return K.with(c.setValue(Wy,!0),()=>a(i()))}function o(a,c){let u=K.active();return K.with(u.setValue(Xy,a),()=>c(i()))}function s(){return t().scope}function i(){return t().isolationScope}YA({withScope:e,withSetScope:n,withSetIsolationScope:o,withIsolationScope:r,getCurrentScope:s,getIsolationScope:i,startSpan:qxe,startSpanManual:Yxe,startInactiveSpan:Kxe,getActiveSpan:Q2,suppressTracing:Jxe,getTraceData:Zxe,continueTrace:Xxe,withActiveSpan:i4})}function l4(t){class e extends t{constructor(...r){super(...r),pE("SentryContextManager")}with(r,o,s,...i){let a=Vc(r),c=a?.scope||ie(),u=a?.isolationScope||Te(),l=r.getValue(Wy)===!0,d=r.getValue(zy),p=r.getValue(Xy),_=d||c.clone(),f=p||(l?u.clone():u),g=z2(r,{scope:_,isolationScope:f}).deleteValue(Wy).deleteValue(zy).deleteValue(Xy);return wxe(_,g),super.with(g,o,s,...i)}}return e}function Qxe(t){let e=new Map;for(let n of t)e0e(e,n);return Array.from(e,function([n,r]){return r})}function d4(t){return t.attributes[eO]===!0?void 0:tO(t)}function e0e(t,e){let n=e.spanContext().spanId,r=d4(e);if(!r){Jy(t,{id:n,span:e,children:[]});return}let o=t0e(t,r),s=Jy(t,{id:n,span:e,parentNode:o,children:[]});o.children.push(s)}function t0e(t,e){let n=t.get(e);return n||Jy(t,{id:e,children:[]})}function Jy(t,e){let n=t.get(e.id);return n?.span?n:n&&!n.span?(n.span=e.span,n.parentNode=e.parentNode,n):(t.set(e.id,e),e)}var p4={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"},n0e=t=>Object.values(p4).includes(t);function _4(t){let e=nO(t)?t.attributes:{},n=Mxe(t)?t.status:void 0;if(n){if(n.code===ve.OK)return{code:1};if(n.code===ve.ERROR){if(typeof n.message>"u"){let o=F2(e);if(o)return o}return n.message&&n0e(n.message)?{code:2,message:n.message}:{code:2,message:"unknown_error"}}}let r=F2(e);return r||(n?.code===ve.UNSET?{code:1}:{code:2,message:"unknown_error"})}function F2(t){let e=t[hs]||t[Em],n=t[GR],r=typeof e=="number"?e:typeof e=="string"?parseInt(e):void 0;if(typeof r=="number")return Mf(r);if(typeof n=="string")return{code:2,message:p4[n]||"unknown_error"}}var $2=1e3,j2=300,Zy=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||j2,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Date.now()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=SR(this.flush.bind(this),1,{maxWait:100})}export(e){let n=Math.floor(Date.now()/1e3);if(this._lastCleanupTimestampInS!==n){let i=0;this._finishedSpanBuckets.forEach((a,c)=>{a&&a.timestampInS<=n-this._finishedSpanBucketSize&&(i+=a.spans.size,this._finishedSpanBuckets[c]=void 0)}),i>0&&zr&&T.log(`SpanExporter dropped ${i} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let r=n%this._finishedSpanBucketSize,o=this._finishedSpanBuckets[r]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[r]=o,o.spans.add(e),this._spansToBucketEntry.set(e,o);let s=d4(e);(!s||this._sentSpans.has(s))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(i=>i?Array.from(i.spans):[]);this._flushSentSpanCache();let n=this._maybeSend(e),r=n.size,o=e.length-r;zr&&T.log(`SpanExporter exported ${r} spans, ${o} spans are waiting for their parent spans to finish`);let s=Date.now()+j2*1e3;for(let i of n){this._sentSpans.set(i.spanContext().spanId,s);let a=this._spansToBucketEntry.get(i);a&&a.spans.delete(i)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let n=Qxe(e),r=new Set,o=this._getCompletedRootNodes(n);for(let s of o){let i=s.span;r.add(i);let a=o0e(i);if(s.parentNode&&this._sentSpans.has(s.parentNode.id)){let l=a.contexts?.trace?.data;l&&(l["sentry.parent_span_already_sent"]=!0)}let c=a.spans||[];for(let l of s.children)Qy(l,c,r);a.spans=c.length>$2?c.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,$2):c;let u=Bi(i.events);u&&(a.measurements=u),Zf(a)}return r}_flushSentSpanCache(){let e=Date.now();for(let[n,r]of this._sentSpans.entries())r<=e&&this._sentSpans.delete(n)}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||this._sentSpans.has(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function r0e(t){let e=t.attributes,n=e[ge],r=e[re],o=e[pt];return{origin:n,op:r,source:o}}function o0e(t){let{op:e,description:n,data:r,origin:o="manual",source:s}=f4(t),i=pr(t),a=t.attributes[dr],c={[pt]:s,[dr]:a,[re]:e,[ge]:o,...r,...m4(t.attributes)},{links:u}=t,{traceId:l,spanId:d}=t.spanContext(),p=tO(t),_=_4(t),f={parent_span_id:p,span_id:d,trace_id:l,data:c,origin:o,op:e,status:ki(_),links:wi(u)},E=c[hs],S=typeof E=="number"?{response:{status_code:E}}:void 0;return{contexts:{trace:f,otel:{resource:t.resource.attributes},...S},spans:[],start_timestamp:fn(t.startTime),timestamp:fn(t.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:i.scope,capturedSpanIsolationScope:i.isolationScope,sampleRate:a,dynamicSamplingContext:Je(t)},...s&&{transaction_info:{source:s}}}}function Qy(t,e,n){let r=t.span;if(r&&n.add(r),!r){t.children.forEach(O=>{Qy(O,e,n)});return}let s=r.spanContext().spanId,i=r.spanContext().traceId,a=tO(r),{attributes:c,startTime:u,endTime:l,links:d}=r,{op:p,description:_,data:f,origin:E="manual"}=f4(r),S={[ge]:E,[re]:p,...m4(c),...f},g=_4(r),h={span_id:s,trace_id:i,data:S,description:_,parent_span_id:a,start_timestamp:fn(u),timestamp:fn(l)||void 0,status:ki(g),op:p,origin:E,measurements:Bi(r.events),links:wi(d)};e.push(h),t.children.forEach(O=>{Qy(O,e,n)})}function f4(t){let{op:e,source:n,origin:r}=r0e(t),{op:o,description:s,source:i,data:a}=J2(t),c=e||o,u=n||i,l={...a,...s0e(t)};return{op:c,description:s,source:u,origin:r,data:l}}function m4(t){let e={...t};return delete e[dr],delete e[eO],delete e[$r],e}function s0e(t){let e=t.attributes,n={};t.kind!==It.INTERNAL&&(n["otel.kind"]=It[t.kind]);let r=e[Em];r&&(n[hs]=r);let o=Lxe(t);return o.url&&(n.url=o.url),o["http.query"]&&(n["http.query"]=o["http.query"].slice(1)),o["http.fragment"]&&(n["http.fragment"]=o["http.fragment"].slice(1)),n}function i0e(t,e){let n=ne.getSpan(e),r=Vc(e);n&&!n.spanContext().isRemote&&_c(n,t),n?.spanContext().isRemote&&t.setAttribute(eO,!0),e===Ma&&(r={scope:cc(),isolationScope:Hr()}),r&&vl(t,r.scope,r.isolationScope),xl(t),j()?.emit("spanStart",t)}function a0e(t){Dl(t),j()?.emit("spanEnd",t)}var lE=class{constructor(e){pE("SentrySpanProcessor"),this._exporter=new Zy(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,n){i0e(e,n)}onEnd(e){a0e(e),this._exporter.export(e)}},dE=class{constructor(e){this._client=e,pE("SentrySampler")}shouldSample(e,n,r,o,s,i){let a=this._client.getOptions(),c=l0e(e),u=c?.spanContext();if(!yt(a))return Uc({decision:void 0,context:e,spanAttributes:s});let l=s[jl]||s[Fi];if(o===It.CLIENT&&l&&(!c||u?.isRemote))return Uc({decision:void 0,context:e,spanAttributes:s});let d=c?c0e(c,n,r):void 0;if(!(!c||u?.isRemote))return Uc({decision:d?As.SamplingDecision.RECORD_AND_SAMPLED:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s});let{description:_,data:f,op:E}=X2(r,s,o),S={...f,...s};E&&(S[re]=E);let g={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:S,spanName:_,parentSampled:d,parentContext:u},g),!g.decision)return Uc({decision:void 0,context:e,spanAttributes:s});let{isolationScope:h}=Vc(e)??{},O=u?.traceState?u.traceState.get(rO):void 0,N=O?fs(O):void 0,R=Nn(N?.sample_rand)??Math.random(),[M,P,J]=Ul(a,{name:_,attributes:S,normalizedRequest:h?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:Nn(N?.sample_rate)},R),X=`${l}`.toUpperCase();return X==="OPTIONS"||X==="HEAD"?(zr&&T.log(`[Tracing] Not sampling span because HTTP method is '${X}' for ${r}`),Uc({decision:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:R,downstreamTraceSampleRate:0})):(!M&&d===void 0&&(zr&&T.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate","transaction")),{...Uc({decision:M?As.SamplingDecision.RECORD_AND_SAMPLED:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:R,downstreamTraceSampleRate:J?P:void 0}),attributes:{[dr]:J?P:void 0}})}toString(){return"SentrySampler"}};function c0e(t,e,n){let r=t.spanContext();if(So(r)&&r.traceId===e){if(r.isRemote){let s=wc(t.spanContext());return zr&&T.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${s}`),s}let o=wc(r);return zr&&T.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${o}`),o}}function Uc({decision:t,context:e,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:o}){let s=u0e(e,n);return o!==void 0&&(s=s.set(Uxe,`${o}`)),r!==void 0&&(s=s.set(Dxe,`${r}`)),t==null?{decision:As.SamplingDecision.NOT_RECORD,traceState:s}:t===As.SamplingDecision.NOT_RECORD?{decision:t,traceState:s.set(oO,"1")}:{decision:t,traceState:s}}function u0e(t,e){let o=ne.getSpan(t)?.spanContext()?.traceState||new Kn.TraceState,s=e[gc]||e[hc];return s&&typeof s=="string"&&(o=o.set(Y2,s)),o}function l0e(t){let e=ne.getSpan(t);return e&&So(e.spanContext())?e:void 0}var le=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ed(t,e){if(!t)return e;let n=Ui(t),r=Ui(e);if(!r)return t;let o={...n};return Object.entries(r).forEach(([s,i])=>{o[s]||(o[s]=i)}),Lf(o)}function Bc(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var En="@sentry/instrumentation-http",d0e=1024*1024,zi=class extends td.InstrumentationBase{constructor(e={}){super(En,Oe,e),this._propagationDecisionMap=new mn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){let e=!1,n=(c=>{let u=c;this._patchServerEmitOnce(u.server)}),r=(c=>{let u=c;this._onOutgoingRequestFinish(u.request,u.response)}),o=(c=>{let u=c;this._onOutgoingRequestFinish(u.request,void 0)}),s=(c=>{let u=c;this._onOutgoingRequestCreated(u.request)}),i=c=>(e||(e=!0,(0,Xr.subscribe)("http.server.request.start",n),(0,Xr.subscribe)("http.client.response.finish",r),(0,Xr.subscribe)("http.client.request.error",o),this.getConfig().propagateTraceInOutgoingRequests&&(0,Xr.subscribe)("http.client.request.created",s)),c),a=()=>{(0,Xr.unsubscribe)("http.server.request.start",n),(0,Xr.unsubscribe)("http.client.response.finish",r),(0,Xr.unsubscribe)("http.client.request.error",o),(0,Xr.unsubscribe)("http.client.request.created",s)};return[new td.InstrumentationNodeModuleDefinition("http",["*"],i,a),new td.InstrumentationNodeModuleDefinition("https",["*"],i,a)]}_onOutgoingRequestFinish(e,n){le&&T.log(En,"Handling finished outgoing request");let r=this.getConfig().breadcrumbs,o=typeof r>"u"?!0:r,s=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,s),o&&!s&&p0e(e,n)}_onOutgoingRequestCreated(e){let n=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,n),n)return;let r=Bc(e),o=j()?.getOptions().tracePropagationTargets,s=Ql(r,o,this._propagationDecisionMap)?Sc():void 0;if(!s)return;let{"sentry-trace":i,baggage:a}=s;if(i&&!e.getHeader("sentry-trace"))try{e.setHeader("sentry-trace",i),le&&T.log(En,"Added sentry-trace header to outgoing request")}catch(c){le&&T.error(En,"Failed to add sentry-trace header to outgoing request:",cs(c)?c.message:"Unknown error")}if(a){let c=ed(e.getHeader("baggage"),a);if(c)try{e.setHeader("baggage",c),le&&T.log(En,"Added baggage header to outgoing request")}catch(u){le&&T.error(En,"Failed to add baggage header to outgoing request:",cs(u)?u.message:"Unknown error")}}}_patchServerEmitOnce(e){let n=e.emit;if(n.__sentry_patched__)return;le&&T.log(En,"Patching server.emit");let r=this,{ignoreIncomingRequestBody:o,maxIncomingRequestBodySize:s="medium"}=r.getConfig(),i=new Proxy(n,{apply(a,c,u){if(u[0]!=="request")return a.apply(c,u);le&&T.log(En,"Handling incoming request");let l=Te().clone(),d=u[1],p=u[2],_=om(d),f=d.ip||d.socket?.remoteAddress,E=d.url||"/";!o?.(E,d)&&s!=="none"&&f0e(d,l,s),l.setSDKProcessingMetadata({normalizedRequest:_,ipAddress:f});let S=(d.method||"GET").toUpperCase(),g=Tc(E),h=`${S} ${g}`;return l.setTransactionName(h),r.getConfig().trackIncomingRequestsAsSessions!==!1&&E0e({requestIsolationScope:l,response:p,sessionFlushingDelayMS:r.getConfig().sessionFlushingDelayMS??6e4}),Cl(l,()=>{if(ie().getPropagationContext().propagationSpanId=On(),!r.getConfig().extractIncomingTraceFromHeader)return a.apply(c,u);let O=Xt.extract(K.active(),_.headers);return K.with(O,()=>a.apply(c,u))})}});rt(i,"__sentry_patched__",!0),e.emit=i}_shouldIgnoreOutgoingRequest(e){if((0,E4.isTracingSuppressed)(K.active()))return!0;let n=this.getConfig().ignoreOutgoingRequests;if(!n)return!1;let r=m0e(e),o=Bc(e);return n(o,r)}};function p0e(t,e){let n=_0e(t),r=e?.statusCode,o=Hl(r);vn({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function _0e(t){try{let e=t.getHeader("host")||t.host,n=new URL(t.path,`${t.protocol}//${e}`),r=Ss(n.toString()),o={url:Ts(r),"http.method":t.method||"GET"};return r.search&&(o["http.query"]=r.search),r.hash&&(o["http.fragment"]=r.hash),o}catch{return{}}}function f0e(t,e,n){let r=0,o=[];le&&T.log(En,"Patching request.on");let s=new WeakMap,i=n==="small"?1e3:n==="medium"?1e4:d0e;try{t.on=new Proxy(t.on,{apply:(a,c,u)=>{let[l,d,...p]=u;if(l==="data"){le&&T.log(En,`Handling request.on("data") with maximum body size of ${i}b`);let _=new Proxy(d,{apply:(f,E,S)=>{try{let g=S[0],h=Buffer.from(g);r<i?(o.push(h),r+=h.byteLength):le&&T.log(En,`Dropping request body chunk because maximum body length of ${i}b is exceeded.`)}catch{le&&T.error(En,"Encountered error while storing body chunk.")}return Reflect.apply(f,E,S)}});return s.set(d,_),Reflect.apply(a,c,[l,_,...p])}return Reflect.apply(a,c,u)}}),t.off=new Proxy(t.off,{apply:(a,c,u)=>{let[,l]=u,d=s.get(l);if(d){s.delete(l);let p=u.slice();return p[1]=d,Reflect.apply(a,c,p)}return Reflect.apply(a,c,u)}}),t.on("end",()=>{try{let a=Buffer.concat(o).toString("utf-8");if(a){let u=Buffer.byteLength(a,"utf-8")>i?`${Buffer.from(a).subarray(0,i-3).toString("utf-8")}...`:a;e.setSDKProcessingMetadata({normalizedRequest:{data:u}})}}catch(a){le&&T.error(En,"Error building captured request body",a)}})}catch(a){le&&T.error(En,"Error patching request to capture body",a)}}function m0e(t){return{method:t.method,protocol:t.protocol,host:t.host,hostname:t.host,path:t.path,headers:t.getHeaders()}}function E0e({requestIsolationScope:t,response:e,sessionFlushingDelayMS:n}){t.setSDKProcessingMetadata({requestSession:{status:"ok"}}),e.once("close",()=>{let r=j(),o=t.getScopeData().sdkProcessingMetadata.requestSession;if(r&&o){le&&T.log(`Recorded request session with status: ${o.status}`);let s=new Date;s.setSeconds(0,0);let i=s.toISOString(),a=uO.get(r),c=a?.[i]||{exited:0,crashed:0,errored:0};if(c[{ok:"exited",crashed:"crashed",errored:"errored"}[o.status]]++,a)a[i]=c;else{le&&T.log("Opened new request session aggregate.");let u={[i]:c};uO.set(r,u);let l=()=>{clearTimeout(p),d(),uO.delete(r);let _=Object.entries(u).map(([f,E])=>({started:f,exited:E.exited,errored:E.errored,crashed:E.crashed}));r.sendSession({aggregates:_})},d=r.on("flush",()=>{le&&T.log("Sending request session aggregate due to client flush"),l()}),p=setTimeout(()=>{le&&T.log("Sending request session aggregate due to flushing schedule"),l()},n).unref()}}})}var uO=new Map;var S4="Http",S0e=F(`${S4}.sentry`,t=>new zi(t)),T4=(t={})=>{let e=t.dropSpansForIncomingRequestStatusCodes??[[401,404],[300,399]];return{name:S4,setupOnce(){S0e({...t,extractIncomingTraceFromHeader:!0,propagateTraceInOutgoingRequests:!0})},processEvent(n){if(n.type==="transaction"){let r=n.contexts?.trace?.data?.["http.response.status_code"];if(typeof r=="number"&&e.some(o=>{if(typeof o=="number")return o===r;let[s,i]=o;return r>=s&&r<=i}))return null}return n}}};L();var A4=v(fe(),1),R4=v(de(),1);var Gc=v(require("diagnostics_channel"),1);var Xi=$A(process.versions.node),nd=Xi.major,g4=Xi.minor;var _E="sentry-trace",lO="baggage",h4=/baggage: (.*)\r\n/,Ji=class extends R4.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-node-fetch",Oe,e),this._channelSubs=[],this._propagationDecisionMap=new mn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel("undici:request:create",this._onRequestCreated.bind(this)),this._subscribeToChannel("undici:request:headers",this._onResponseHeaders.bind(this)))}_onRequestCreated({request:e}){if(!(this.getConfig().enabled!==!1))return;let o=this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,o),o)return;let s=dO(e.origin,e.path),i=j()?.getOptions().tracePropagationTargets,a=Ql(s,i,this._propagationDecisionMap)?Sc():void 0;if(!a)return;let{"sentry-trace":c,baggage:u}=a;if(Array.isArray(e.headers)){let l=e.headers;c&&!l.includes(_E)&&l.push(_E,c);let d=l.findIndex(p=>p===lO);if(u&&d===-1)l.push(lO,u);else if(u){let p=l[d+1],_=ed(p,u);_&&(l[d+1]=_)}}else{let l=e.headers;c&&!l.includes(`${_E}:`)&&(e.headers+=`${_E}: ${c}\r
147
- `);let d=e.headers.match(h4)?.[1];if(u&&!d)e.headers+=`${lO}: ${u}\r
148
- `;else if(u){let p=ed(d,u);p&&(e.headers=e.headers.replace(h4,`baggage: ${p}\r
149
- `))}}}_onResponseHeaders({request:e,response:n}){let r=this.getConfig();if(!(r.enabled!==!1))return;let s=r.breadcrumbs,i=typeof s>"u"?!0:s,a=this._ignoreOutgoingRequestsMap.get(e);i&&!a&&T0e(e,n)}_subscribeToChannel(e,n){let r=nd>18||nd===18&&g4>=19,o;if(r)Gc.subscribe?.(e,n),o=()=>Gc.unsubscribe?.(e,n);else{let s=Gc.channel(e);s.subscribe(n),o=()=>s.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:o})}_shouldIgnoreOutgoingRequest(e){if((0,A4.isTracingSuppressed)(K.active()))return!0;let n=dO(e.origin,e.path),r=this.getConfig().ignoreOutgoingRequests;return typeof r!="function"||!n?!1:r(n)}};function T0e(t,e){let n=g0e(t),r=e.statusCode,o=Hl(r);vn({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function g0e(t){try{let e=dO(t.origin,t.path),n=Ss(e),r={url:Ts(n),"http.method":t.method||"GET"};return n.search&&(r["http.query"]=n.search),n.hash&&(r["http.fragment"]=n.hash),r}catch{return{}}}function dO(t,e="/"){try{return new URL(e,t).toString()}catch{let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e.slice(1)}`:`${n}${e}`}}var h0e="NodeFetch",A0e=F(`${h0e}.sentry`,Ji,t=>t),R0e=((t={})=>({name:"NodeFetch",setupOnce(){A0e(t)}})),y4=R0e;var N4=require("node:child_process"),fE=require("node:fs"),Ot=v(require("node:os"),1),C4=require("node:path"),pO=require("node:util");var y0e=(0,pO.promisify)(fE.readFile),O0e=(0,pO.promisify)(fE.readdir),N0e="Context",C0e=((t={})=>{let e,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function r(s){e===void 0&&(e=o());let i=v0e(await e);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await I0e()),n.app&&(s.app=b0e()),n.device&&(s.device=M0e(n.device)),n.culture){let i=P0e();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=k0e()),s}return{name:N0e,processEvent(s){return r(s)}}}),v4=C0e;function v0e(t){if(t.app?.app_memory&&(t.app.app_memory=process.memoryUsage().rss),t.app?.free_memory&&typeof process.availableMemory=="function"){let e=process.availableMemory?.();e!=null&&(t.app.free_memory=e)}return t.device?.free_memory&&(t.device.free_memory=Ot.freemem()),t}async function I0e(){let t=Ot.platform();switch(t){case"darwin":return U0e();case"linux":return w0e();default:return{name:L0e[t]||t,version:Ot.release()}}}function P0e(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function b0e(){let t=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function M0e(t){let e={},n;try{n=Ot.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=Ot.arch(),(t===!0||t.memory)&&(e.memory_size=Ot.totalmem(),e.free_memory=Ot.freemem()),t===!0||t.cpu){let r=Ot.cpus(),o=r?.[0];o&&(e.processor_count=r.length,e.cpu_description=o.model,e.processor_frequency=o.speed)}return e}var L0e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},x0e=[{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"]}],D0e={alpine:t=>t,arch:t=>Jr(/distrib_release=(.*)/,t),centos:t=>Jr(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>Jr(/release (..)/,t),mint:t=>Jr(/distrib_release=(.*)/,t),red:t=>Jr(/release ([^ ]+)/,t),suse:t=>Jr(/VERSION = (.*)\n/,t),ubuntu:t=>Jr(/distrib_release=(.*)/,t)};function Jr(t,e){let n=t.exec(e);return n?n[1]:void 0}async function U0e(){let t={kernel_version:Ot.release(),name:"Mac OS X",version:`10.${Number(Ot.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{(0,N4.execFile)("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});t.name=Jr(/^ProductName:\s+(.*)$/m,e),t.version=Jr(/^ProductVersion:\s+(.*)$/m,e),t.build=Jr(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function O4(t){return t.split(" ")[0].toLowerCase()}async function w0e(){let t={kernel_version:Ot.release(),name:"Linux"};try{let e=await O0e("/etc"),n=x0e.find(a=>e.includes(a.name));if(!n)return t;let r=(0,C4.join)("/etc",n.name),o=(await y0e(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find(a=>o.indexOf(O4(a))>=0)||s[0];let i=O4(t.name);t.version=D0e[i]?.(o)}catch{}return t}function k0e(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}var b4=require("node:fs"),M4=require("node:readline");var _O=new mn(10),L4=new mn(20),V0e=7,B0e="ContextLines",G0e=1e3,H0e=1e4;function F0e(t,e,n){let r=t.get(e);return r===void 0?(t.set(e,n),n):r}function $0e(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function j0e(t){return t.lineno!==void 0&&t.lineno>H0e||t.colno!==void 0&&t.colno>G0e}function q0e(t,e){let n=_O.get(t);if(n===void 0)return!1;for(let r=e[0];r<=e[1];r++)if(n[r]===void 0)return!1;return!0}function Y0e(t,e){if(!t.length)return[];let n=0,r=t[0];if(typeof r!="number")return[];let o=P4(r,e),s=[];for(;;){if(n===t.length-1){s.push(o);break}let i=t[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+e:(s.push(o),o=P4(i,e)),n++}return s}function K0e(t,e,n){return new Promise((r,o)=>{let s=(0,b4.createReadStream)(t),i=(0,M4.createInterface)({input:s});function a(){s.destroy(),r()}let c=0,u=0,l=e[u];if(l===void 0){a();return}let d=l[0],p=l[1];function _(f){L4.set(t,1),le&&T.error(`Failed to read file: ${t}. Error: ${f}`),i.close(),i.removeAllListeners(),a()}s.on("error",_),i.on("error",_),i.on("close",a),i.on("line",f=>{if(c++,!(c<d)&&(n[c]=wA(f,0),c>=p)){if(u===e.length-1){i.close(),i.removeAllListeners();return}u++;let E=e[u];if(E===void 0){i.close(),i.removeAllListeners();return}d=E[0],p=E[1]}})})}async function W0e(t,e){let n={};if(e>0&&t.exception?.values){for(let s of t.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||$0e(c)||j0e(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return t;let o=[];for(let s of r){if(L4.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,l)=>u-l);let a=Y0e(i,e);if(a.every(u=>q0e(s,u)))continue;let c=F0e(_O,s,{});o.push(K0e(s,a,c))}if(await Promise.all(o).catch(()=>{le&&T.log("Failed to read one or more source files and resolve context lines")}),e>0&&t.exception?.values)for(let s of t.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&z0e(s.stacktrace.frames,e,_O);return t}function z0e(t,e,n){for(let r of t)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;X0e(r.lineno,r,e,o)}}function I4(t){delete t.pre_context,delete t.context_line,delete t.post_context}function X0e(t,e,n,r){if(e.lineno===void 0||r===void 0){le&&T.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let s=x4(t,n);s<t;s++){let i=r[s];if(i===void 0){I4(e),le&&T.error(`Could not find line ${s} in file ${e.filename}`);return}e.pre_context.push(i)}if(r[t]===void 0){I4(e),le&&T.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=r[t];let o=D4(t,n);e.post_context=[];for(let s=t+1;s<=o;s++){let i=r[s];if(i===void 0)break;e.post_context.push(i)}}function x4(t,e){return Math.max(1,t-e)}function D4(t,e){return t+e}function P4(t,e){return[x4(t,e),D4(t,e)]}var J0e=((t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:V0e;return{name:B0e,processEvent(n){return W0e(n,e)}}}),U4=J0e;var B4=require("node:worker_threads");var mE;async function EE(){if(mE===void 0)try{mE=!!(await import("node:inspector")).url()}catch{mE=!1}return mE}var rd="__SENTRY_ERROR_LOCAL_VARIABLES__";function k4(t,e,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>t&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function w4(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function SE(t,e){return t===e||`Object.${t}`===e||t===`Object.${e}`||w4(t)&&w4(e)}var Z0e="LyohIEBzZW50cnkvbm9kZS1jb3JlIDkuNDcuMSAoNDExZTEwMikgfCBodHRwczovL2dpdGh1Yi5jb20vZ2V0c2VudHJ5L3NlbnRyeS1qYXZhc2NyaXB0ICovCmltcG9ydHtTZXNzaW9uIGFzIGV9ZnJvbSJub2RlOmluc3BlY3Rvci9wcm9taXNlcyI7aW1wb3J0e3dvcmtlckRhdGEgYXMgdH1mcm9tIm5vZGU6d29ya2VyX3RocmVhZHMiO2NvbnN0IG49Z2xvYmFsVGhpcyxpPXt9O2NvbnN0IG89Il9fU0VOVFJZX0VSUk9SX0xPQ0FMX1ZBUklBQkxFU19fIjtjb25zdCBhPXQ7ZnVuY3Rpb24gcyguLi5lKXthLmRlYnVnJiZmdW5jdGlvbihlKXtpZighKCJjb25zb2xlImluIG4pKXJldHVybiBlKCk7Y29uc3QgdD1uLmNvbnNvbGUsbz17fSxhPU9iamVjdC5rZXlzKGkpO2EuZm9yRWFjaChlPT57Y29uc3Qgbj1pW2VdO29bZV09dFtlXSx0W2VdPW59KTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2EuZm9yRWFjaChlPT57dFtlXT1vW2VdfSl9fSgoKT0+Y29uc29sZS5sb2coIltMb2NhbFZhcmlhYmxlcyBXb3JrZXJdIiwuLi5lKSl9YXN5bmMgZnVuY3Rpb24gYyhlLHQsbixpKXtjb25zdCBvPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7aVtuXT1vLnJlc3VsdC5maWx0ZXIoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkuc29ydCgoZSx0KT0+cGFyc2VJbnQoZS5uYW1lLDEwKS1wYXJzZUludCh0Lm5hbWUsMTApKS5tYXAoZT0+ZS52YWx1ZT8udmFsdWUpfWFzeW5jIGZ1bmN0aW9uIHIoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQubWFwKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKS5yZWR1Y2UoKGUsW3Qsbl0pPT4oZVt0XT1uLGUpLHt9KX1mdW5jdGlvbiB1KGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGwoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksaT17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0LnZhbHVlPy5vYmplY3RJZCYmIkFycmF5Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgYyhlLG4sdC5uYW1lLGkpfWVsc2UgaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dC52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCByKGUsbix0Lm5hbWUsaSl9ZWxzZSB0LnZhbHVlJiZ1KHQsaSk7cmV0dXJuIGl9bGV0IGY7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxzKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKT0+e249ITF9KSx0Lm9uKCJEZWJ1Z2dlci5wYXVzZWQiLGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6aX0pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYoZj8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgYT1bXTtmb3IobGV0IHQ9MDt0PGkubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTpvLHRoaXM6c309aVt0XSxjPW4uZmluZChlPT4ibG9jYWwiPT09ZS50eXBlKSxyPSJnbG9iYWwiIT09cy5jbGFzc05hbWUmJnMuY2xhc3NOYW1lP2Ake3MuY2xhc3NOYW1lfS4ke299YDpvO2lmKHZvaWQgMD09PWM/Lm9iamVjdC5vYmplY3RJZClhW3RdPXtmdW5jdGlvbjpyfTtlbHNle2NvbnN0IG49YXdhaXQgbChlLGMub2JqZWN0Lm9iamVjdElkKTthW3RdPXtmdW5jdGlvbjpyLHZhcnM6bn19fWF3YWl0IGUucG9zdCgiUnVudGltZS5jYWxsRnVuY3Rpb25PbiIse2Z1bmN0aW9uRGVjbGFyYXRpb246YGZ1bmN0aW9uKCkgeyB0aGlzLiR7b30gPSB0aGlzLiR7b30gfHwgJHtKU09OLnN0cmluZ2lmeShhKX07IH1gLHNpbGVudDohMCxvYmplY3RJZDpufSksYXdhaXQgZS5wb3N0KCJSdW50aW1lLnJlbGVhc2VPYmplY3QiLHtvYmplY3RJZDpufSl9KHQsZS5wYXJhbXMpLnRoZW4oYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9LGFzeW5jIGU9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSl9KSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLmVuYWJsZSIpO2NvbnN0IGk9ITEhPT1hLmNhcHR1cmVBbGxFeGNlcHRpb25zO2lmKGF3YWl0IHQucG9zdCgiRGVidWdnZXIuc2V0UGF1c2VPbkV4Y2VwdGlvbnMiLHtzdGF0ZTppPyJhbGwiOiJ1bmNhdWdodCJ9KSxpKXtjb25zdCBlPWEubWF4RXhjZXB0aW9uc1BlclNlY29uZHx8NTA7Zj1mdW5jdGlvbihlLHQsbil7bGV0IGk9MCxvPTUsYT0wO3JldHVybiBzZXRJbnRlcnZhbCgoKT0+ezA9PT1hP2k+ZSYmKG8qPTIsbihvKSxvPjg2NDAwJiYobz04NjQwMCksYT1vKTooYS09MSwwPT09YSYmdCgpKSxpPTB9LDFlMykudW5yZWYoKSwoKT0+e2krPTF9fShlLGFzeW5jKCk9PntzKCJSYXRlLWxpbWl0IGxpZnRlZC4iKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6ImFsbCJ9KX0sYXN5bmMgZT0+e3MoYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSl9fSkoKS5jYXRjaChlPT57cygiRmFpbGVkIHRvIHN0YXJ0IGRlYnVnZ2VyIixlKX0pLHNldEludGVydmFsKCgpPT57fSwxZTQpOw==";function V4(...t){T.log("[LocalVariables]",...t)}var G4=((t={})=>{function e(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,l=i[c],d=a[u];if(!d||!l)break;l.vars===void 0||d.in_app===!1||!SE(d.function,l.function)||(d.vars=l.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&&rd in i.originalException&&Array.isArray(i.originalException[rd])){for(let a of s.exception?.values||[])e(a,i.originalException[rd]);i.originalException[rd]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new B4.Worker(new URL(`data:application/javascript;base64,${Z0e}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{V4("Worker error",a)}),i.once("exit",a=>{V4("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await EE()){T.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:T.isEnabled()};r().then(()=>{try{o(a)}catch(c){T.error("Failed to start worker",c)}},c=>{T.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function H4(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function Q0e(t,e){if(e!==void 0)return H4(t(e,1))}function F4(t){let e=[],n=!1;function r(i){e=[],!n&&(n=!0,t(i))}e.push(r);function o(i){e.push(i)}function s(i){let a=e.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var fO=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let n=await import("node:inspector");return new t(new n.Session)}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:o,next:s}=F4(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(e,n,r,o){this._getProperties(e,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(e,n,r,o){this._getProperties(e,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(e,n,r){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?n[e.name]=`<${e.value.value}>`:n[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?n[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(n[e.name]="<undefined>")),r(n)}},eDe="LocalVariables",tDe=((t={},e)=>{let n=new mn(20),r,o=!1;function s(a){let c=H4(a.stacktrace?.frames);if(c===void 0)return;let u=n.remove(c);if(u===void 0)return;let l=(a.stacktrace?.frames||[]).filter(d=>d.function!=="new Promise");for(let d=0;d<l.length;d++){let p=l.length-d-1,_=u[d],f=l[p];if(!f||!_)break;_.vars===void 0||f.in_app===!1||!SE(f.function,_.function)||(f.vars=_.vars)}}function i(a){for(let c of a.exception?.values||[])s(c);return a}return{name:eDe,async setupOnce(){let c=j()?.getOptions();if(!c?.includeLocalVariables)return;if(nd<18){T.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await EE()){T.warn("Local variables capture has been disabled because the debugger was already enabled");return}fO.create(e).then(l=>{function d(_,{params:{reason:f,data:E,callFrames:S}},g){if(f!=="exception"&&f!=="promiseRejection"){g();return}r?.();let h=Q0e(_,E.description);if(h==null){g();return}let{add:O,next:N}=F4(R=>{n.set(h,R),g()});for(let R=0;R<Math.min(S.length,5);R++){let{scopeChain:M,functionName:P,this:J}=S[R],X=M.find(H=>H.type==="local"),Ye=J.className==="global"||!J.className?P:`${J.className}.${P}`;if(X?.object.objectId===void 0)O(H=>{H[R]={function:Ye},N(H)});else{let H=X.object.objectId;O(ae=>l.getLocalVariables(H,De=>{ae[R]={function:Ye,vars:De},N(ae)}))}}N([])}let p=t.captureAllExceptions!==!1;if(l.configureAndConnect((_,f)=>d(c.stackParser,_,f),p),p){let _=t.maxExceptionsPerSecond||50;r=k4(_,()=>{T.log("Local variables rate-limit lifted."),l.setPauseOnExceptions(!0)},f=>{T.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${f} seconds.`),l.setPauseOnExceptions(!1)})}o=!0},l=>{T.log("The `LocalVariables` integration failed to start.",l)})},processEvent(a){return o?i(a):a},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),$4=tDe;var j4=(t={})=>Xi.major<19?$4(t):G4(t);var od=require("node:fs"),sd=require("node:path");function Hc(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var mO,nDe="Modules",rDe=typeof __SENTRY_SERVER_MODULES__>"u"?{}:__SENTRY_SERVER_MODULES__,oDe=(()=>({name:nDe,processEvent(t){return t.modules={...t.modules,...q4()},t},getModules:q4})),Y4=oDe;function sDe(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function iDe(){return{...rDe,...uDe(),...Hc()?aDe():{}}}function aDe(){let t=require.main?.paths||[],e=sDe(),n={},r=new Set;return e.forEach(o=>{let s=o,i=()=>{let a=s;if(s=(0,sd.dirname)(a),!s||a===s||r.has(a))return;if(t.indexOf(s)<0)return i();let c=(0,sd.join)(a,"package.json");if(r.add(a),!(0,od.existsSync)(c))return i();try{let u=JSON.parse((0,od.readFileSync)(c,"utf8"));n[u.name]=u.version}catch{}};i()}),n}function q4(){return mO||(mO=iDe()),mO}function cDe(){try{let t=(0,sd.join)(process.cwd(),"package.json");return JSON.parse((0,od.readFileSync)(t,"utf8"))}catch{return{}}}function uDe(){let t=cDe();return{...t.dependencies,...t.devDependencies}}var lDe=2e3;function id(t){Fe(()=>{console.error(t)});let e=j();if(e===void 0){le&&T.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=e.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:lDe;e.close(r).then(o=>{o||le&&T.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{le&&T.error(o)})}var dDe="OnUncaughtException",K4=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:dDe,setup(n){global.process.on("uncaughtException",pDe(n,e))}}};function pDe(t,e){let r=!1,o=!1,s=!1,i,a=t.getOptions();return Object.assign(c=>{let u=id;e.onFatalError?u=e.onFatalError:a.onFatalError&&(u=a.onFatalError);let d=global.process.listeners("uncaughtException").filter(_=>_.name!=="domainUncaughtExceptionClear"&&_.tag!=="sentry_tracingErrorCallback"&&_._errorHandler!==!0).length===0,p=e.exitEvenIfOtherHandlersAreRegistered||d;r?p&&(s?(le&&T.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),id(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,j()===t&&tn(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"onuncaughtexception"}}),!s&&p&&(s=!0,u(c)))},{_errorHandler:!0})}var _De="OnUnhandledRejection",fDe=((t={})=>{let e={mode:"warn",...t};return{name:_De,setup(n){global.process.on("unhandledRejection",mDe(n,e))}}}),W4=fDe;function mDe(t,e){return function(r,o){if(j()!==t)return;let s=e.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>kl(i,c):c=>c())(()=>{tn(r,{originalException:o,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"onunhandledrejection"}})}),EDe(r,e.mode)}}function EDe(t,e){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:";e==="warn"?Fe(()=>{console.warn(n),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e==="strict"&&(Fe(()=>{console.warn(n)}),id(t))}var z4=v(require("node:http"),1);var EO="Spotlight",SDe=((t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:EO,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&T.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}TDe(n,e)}}}),X4=SDe;function TDe(t,e){let n=gDe(e.sidecarUrl);if(!n)return;let r=0;t.on("beforeEnvelope",o=>{if(r>3){T.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=Ll(o);Ec(()=>{let i=z4.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,T.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function gDe(t){try{return new URL(`${t}`)}catch{T.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}var J4=v(require("node:util"),1);var hDe="NodeSystemError";function ADe(t){return!(t instanceof Error)||!("errno"in t)||typeof t.errno!="number"?!1:J4.getSystemErrorMap().has(t.errno)}var Z4=(t={})=>({name:hDe,processEvent:(e,n,r)=>{if(!ADe(n.originalException))return e;let o=n.originalException,s={...o};!r.getOptions().sendDefaultPii&&t.includePaths!==!0&&(delete s.path,delete s.dest),e.contexts={...e.contexts,node_system_error:s};for(let i of e.exception?.values||[])i.value&&(o.path&&i.value.includes(o.path)&&(i.value=i.value.replace(`'${o.path}'`,"").trim()),o.dest&&i.value.includes(o.dest)&&(i.value=i.value.replace(`'${o.dest}'`,"").trim()));return e}});var SO=v(require("node:diagnostics_channel"),1);var RDe="ChildProcess",Q4=(t={})=>({name:RDe,setup(){SO.channel("child_process").subscribe(e=>{e&&typeof e=="object"&&"process"in e&&yDe(e.process,t)}),SO.channel("worker_threads").subscribe(e=>{e&&typeof e=="object"&&"worker"in e&&ODe(e.worker,t)})}});function yDe(t,e){let n=!1,r;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){n=!0;return}r={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(r.spawnargs=t.spawnargs)}).on("exit",o=>{n||(n=!0,o!==null&&o!==0&&vn({category:"child_process",message:`Child process exited with code '${o}'`,level:o===0?"info":"warning",data:r}))}).on("error",o=>{n||(n=!0,vn({category:"child_process",message:`Child process errored with '${o.message}'`,level:"error",data:r}))})}function ODe(t,e){let n;t.on("online",()=>{n=t.threadId}).on("error",r=>{e.captureWorkerErrors!==!1?tn(r,{mechanism:{type:"instrument",handled:!1,data:{threadId:String(n)}}}):vn({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:n}})})}var r5=v(n5(),1);var RO=l4(r5.AsyncLocalStorageContextManager);L();function yO(){yn.disable(),yn.setLogger({error:T.error,warn:T.warn,info:T.log,debug:T.log,verbose:T.log},lt.DEBUG)}var UDe="ProcessSession",o5=()=>({name:UDe,setupOnce(){em(),process.on("beforeExit",()=>{Te().getSession()?.status!=="ok"&&Vl()})}});var kDe=v(require("node:http"),1),VDe=v(require("node:https"),1),a5=require("node:stream"),c5=require("node:zlib");var Io=v(require("node:net"),1),NO=v(require("node:tls"),1);var OO=v(require("node:http"),1);var Zr=Symbol("AgentBaseInternalState"),AE=class extends OO.Agent{constructor(e){super(e),this[Zr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
150
- `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(e,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(e,o)).then(s=>{if(s instanceof OO.Agent)return s.addRequest(e,o);this[Zr].currentSocket=s,super.createSocket(e,n,r)},r)}createConnection(){let e=this[Zr].currentSocket;if(this[Zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Zr]&&(this[Zr].defaultPort=e)}get protocol(){return this[Zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Zr]&&(this[Zr].protocol=e)}};function RE(...t){T.log("[https-proxy-agent:parse-proxy-response]",...t)}function s5(t){return new Promise((e,n)=>{let r=0,o=[];function s(){let l=t.read();l?u(l):t.once("readable",s)}function i(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){i(),RE("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){i(),RE("onerror %o",l),n(l)}function u(l){o.push(l),r+=l.length;let d=Buffer.concat(o,r),p=d.indexOf(`\r
146
+ Url: ${am(t)}`),!0}return!1}function Ehe(t,e){return e?.length?nm(t).some(n=>ls(n,e)):!1}function She(t,e){if(!e?.length)return!1;let n=t.transaction;return n?ls(n,e):!1}function The(t,e){if(!e?.length)return!1;let n=am(t);return n?ls(n,e):!1}function ghe(t,e){if(!e?.length)return!0;let n=am(t);return n?ls(n,e):!0}function hhe(t=[]){for(let e=t.length-1;e>=0;e--){let n=t[e];if(n&&n.filename!=="<anonymous>"&&n.filename!=="[native code]")return n.filename||null}return null}function am(t){try{let n=[...t.exception?.values??[]].reverse().find(r=>r.mechanism?.parent_id===void 0&&r.stacktrace?.frames?.length)?.stacktrace?.frames;return n?hhe(n):null}catch{return k&&T.error(`Cannot extract url for event ${ds(t)}`),null}}function Ahe(t){return t.exception?.values?.length?!t.message&&!t.exception.values.some(e=>e.stacktrace||e.type&&e.type!=="Error"||e.value):!1}function xG(t,e,n,r,o,s){if(!o.exception?.values||!s||!Br(s.originalException,Error))return;let i=o.exception.values.length>0?o.exception.values[o.exception.values.length-1]:void 0;i&&(o.exception.values=hR(t,e,r,s.originalException,n,o.exception.values,i,0))}function hR(t,e,n,r,o,s,i,a){if(s.length>=n+1)return s;let c=[...s];if(Br(r[o],Error)){MG(i,a);let u=t(e,r[o]),l=c.length;LG(u,o,l,a),c=hR(t,e,n,r[o],o,[u,...c],u,l)}return Array.isArray(r.errors)&&r.errors.forEach((u,l)=>{if(Br(u,Error)){MG(i,a);let d=t(e,u),p=c.length;LG(d,`errors[${l}]`,p,a),c=hR(t,e,n,u,o,[d,...c],d,p)}}),c}function MG(t,e){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,...t.type==="AggregateError"&&{is_exception_group:!0},exception_id:e}}function LG(t,e,n,r){t.mechanism=t.mechanism||{type:"generic",handled:!0},t.mechanism={...t.mechanism,type:"chained",source:e,exception_id:n,parent_id:r}}var Rhe="cause",yhe=5,Ohe="LinkedErrors",Nhe=((t={})=>{let e=t.limit||yhe,n=t.key||Rhe;return{name:Ohe,preprocessEvent(r,o,s){let i=s.getOptions();xG(ER,i.stackParser,n,e,r,o)}}}),um=Nhe;function DG(t){let e={},n=0;for(;n<t.length;){let r=t.indexOf("=",n);if(r===-1)break;let o=t.indexOf(";",n);if(o===-1)o=t.length;else if(o<r){n=t.lastIndexOf(";",r-1)+1;continue}let s=t.slice(n,r).trim();if(e[s]===void 0){let i=t.slice(r+1,o).trim();i.charCodeAt(0)===34&&(i=i.slice(1,-1));try{e[s]=i.indexOf("%")!==-1?decodeURIComponent(i):i}catch{e[s]=i}}n=o+1}return e}var AR=["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 UG(t){return AR.map(o=>{let s=t[o],i=Array.isArray(s)?s.join(";"):s;return o==="Forwarded"?Che(i):i?.split(",").map(a=>a.trim())}).reduce((o,s)=>s?o.concat(s):o,[]).find(o=>o!==null&&vhe(o))||null}function Che(t){if(!t)return null;for(let e of t.split(";"))if(e.startsWith("for="))return e.slice(4);return null}function vhe(t){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(t)}var Ihe={cookies:!0,data:!0,headers:!0,query_string:!0,url:!0},Phe="RequestData",bhe=((t={})=>{let e={...Ihe,...t.include};return{name:Phe,processEvent(n,r,o){let{sdkProcessingMetadata:s={}}=n,{normalizedRequest:i,ipAddress:a}=s,c={...e,ip:e.ip??o.getOptions().sendDefaultPii};return i&&Mhe(n,i,{ipAddress:a},c),n}}}),lm=bhe;function Mhe(t,e,n,r){if(t.request={...t.request,...Lhe(e,r)},r.ip){let o=e.headers&&UG(e.headers)||n.ipAddress;o&&(t.user={...t.user,ip_address:o})}}function Lhe(t,e){let n={},r={...t.headers};if(e.headers&&(n.headers=r,e.cookies||delete r.cookie,e.ip||AR.forEach(o=>{delete r[o]})),n.method=t.method,e.url&&(n.url=t.url),e.cookies){let o=t.cookies||(r?.cookie?DG(r.cookie):void 0);n.cookies=o||{}}return e.query_string&&(n.query_string=t.query_string),e.data&&(n.data=t.data),n}function wG(t){let e="console";nc(e,t),rc(e,xhe)}function xhe(){"console"in Q&&yl.forEach(function(t){t in Q.console&&BA(Q.console,t,function(e){return tc[t]=e,function(...n){oc("console",{args:n,level:t}),tc[t]?.apply(Q.console,n)}})})}function kG(t){return t==="warn"?"warning":["fatal","error","warning","log","info","debug"].includes(t)?t:"log"}var Dhe=/^(\S+:\\|\/?)([\s\S]*?)((?:\.{1,2}|[^/\\]+?|)(\.[^./\\]*|))(?:[/\\]*)$/;function Uhe(t){let e=t.length>1024?`<truncated>${t.slice(-1024)}`:t,n=Dhe.exec(e);return n?n.slice(1):[]}function RR(t){let e=Uhe(t),n=e[0]||"",r=e[1];return!n&&!r?".":(r&&(r=r.slice(0,r.length-1)),n+r)}var whe="Console",dm=(t={})=>{let e=new Set(t.levels||yl);return{name:whe,setup(n){wG(({args:r,level:o})=>{j()!==n||!e.has(o)||khe(o,r)})}}};function khe(t,e){let n={category:"console",data:{arguments:e,logger:"console"},level:kG(t),message:VG(e)};if(t==="assert")if(e[0]===!1){let r=e.slice(1);n.message=r.length>0?`Assertion failed: ${VG(r)}`:"Assertion failed",n.data.arguments=r}else return;In(n,{input:e,level:t})}function VG(t){return"util"in Q&&typeof Q.util.format=="function"?Q.util.format(...t):VA(t," ")}function Ss(t){if(!t)return{};let e=t.match(/^(([^:/?#]+):)?(\/\/([^/?#]*))?([^?#]*)(\?([^#]*))?(#(.*))?$/);if(!e)return{};let n=e[6]||"",r=e[8]||"";return{host:e[4],path:e[5],protocol:e[2],search:n,hash:r,relative:e[5]+n+r}}function Tc(t){return t.split(/[?#]/,1)[0]}function Ts(t){let{protocol:e,host:n,path:r}=t,o=n?.replace(/^.*@/,"[filtered]:[filtered]@").replace(/(:80)$/,"").replace(/(:443)$/,"")||"";return`${e?`${e}://`:""}${o}${r}`}var yR="ai.prompt",BG="ai.response.object",GG="ai.response.text",HG="ai.response.toolCalls",FG="ai.prompt.messages",$G="ai.prompt.tools",Kr="ai.model.id",jG="ai.model.provider",qG="ai.response.providerMetadata",YG="ai.telemetry.functionId",KG="ai.usage.completionTokens",WG="ai.usage.promptTokens",OR="gen_ai.response.model",pm="gen_ai.usage.input_tokens",_m="gen_ai.usage.output_tokens",NR="ai.toolCall.name",CR="ai.toolCall.id",zG="ai.toolCall.args",XG="ai.toolCall.result";function JG(t,e){t.setAttribute(ge,e)}function Vhe(t){let{data:e,description:n}=q(t);if(!n)return;if(e[NR]&&e[CR]&&n==="ai.toolCall"){Hhe(t,e);return}let r=e[Kr],o=e[jG];typeof r!="string"||typeof o!="string"||!r||!o||Fhe(t,n,e)}function Bhe(t){if(t.type==="transaction"&&t.spans)for(let e of t.spans)Ghe(e);return t}function Ghe(t){let{data:e,origin:n}=t;if(n==="auto.vercelai.otel"){Yn(e,KG,_m),Yn(e,WG,pm),typeof e[_m]=="number"&&typeof e[pm]=="number"&&(e["gen_ai.usage.total_tokens"]=e[_m]+e[pm]),Yn(e,FG,"gen_ai.request.messages"),Yn(e,GG,"gen_ai.response.text"),Yn(e,HG,"gen_ai.response.tool_calls"),Yn(e,BG,"gen_ai.response.object"),Yn(e,$G,"gen_ai.request.available_tools"),Yn(e,zG,"gen_ai.tool.input"),Yn(e,XG,"gen_ai.tool.output"),$he(e);for(let r of Object.keys(e))r.startsWith("ai.")&&Yn(e,r,`vercel.${r}`)}}function Yn(t,e,n){t[e]!=null&&(t[n]=t[e],delete t[e])}function Hhe(t,e){JG(t,"auto.vercelai.otel"),t.setAttribute(re,"gen_ai.execute_tool"),Yn(e,NR,"gen_ai.tool.name"),Yn(e,CR,"gen_ai.tool.call.id"),e["gen_ai.tool.type"]||t.setAttribute("gen_ai.tool.type","function");let n=e["gen_ai.tool.name"];n&&t.updateName(`execute_tool ${n}`)}function Fhe(t,e,n){JG(t,"auto.vercelai.otel");let r=e.replace("ai.","");t.setAttribute("ai.pipeline.name",r),t.updateName(r);let o=n[YG];if(o&&typeof o=="string"&&e.split(".").length-1===1&&(t.updateName(`${r} ${o}`),t.setAttribute("gen_ai.function_id",o)),n[yR]&&t.setAttribute("gen_ai.prompt",n[yR]),n[Kr]&&!n[OR]&&t.setAttribute(OR,n[Kr]),t.setAttribute("ai.streaming",e.includes("stream")),e==="ai.generateText"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.generateText.doGenerate"){t.setAttribute(re,"gen_ai.generate_text"),t.updateName(`generate_text ${n[Kr]}`);return}if(e==="ai.streamText"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.streamText.doStream"){t.setAttribute(re,"gen_ai.stream_text"),t.updateName(`stream_text ${n[Kr]}`);return}if(e==="ai.generateObject"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.generateObject.doGenerate"){t.setAttribute(re,"gen_ai.generate_object"),t.updateName(`generate_object ${n[Kr]}`);return}if(e==="ai.streamObject"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.streamObject.doStream"){t.setAttribute(re,"gen_ai.stream_object"),t.updateName(`stream_object ${n[Kr]}`);return}if(e==="ai.embed"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.embed.doEmbed"){t.setAttribute(re,"gen_ai.embed"),t.updateName(`embed ${n[Kr]}`);return}if(e==="ai.embedMany"){t.setAttribute(re,"gen_ai.invoke_agent");return}if(e==="ai.embedMany.doEmbed"){t.setAttribute(re,"gen_ai.embed_many"),t.updateName(`embed_many ${n[Kr]}`);return}if(e.startsWith("ai.stream")){t.setAttribute(re,"ai.run");return}}function fm(t){t.on("spanStart",Vhe),t.addEventProcessor(Object.assign(Bhe,{id:"VercelAiEventProcessor"}))}function $he(t){let e=t[qG];if(e)try{let n=JSON.parse(e);n.openai&&(Tr(t,"gen_ai.usage.input_tokens.cached",n.openai.cachedPromptTokens),Tr(t,"gen_ai.usage.output_tokens.reasoning",n.openai.reasoningTokens),Tr(t,"gen_ai.usage.output_tokens.prediction_accepted",n.openai.acceptedPredictionTokens),Tr(t,"gen_ai.usage.output_tokens.prediction_rejected",n.openai.rejectedPredictionTokens),Tr(t,"gen_ai.conversation.id",n.openai.responseId)),n.anthropic&&(Tr(t,"gen_ai.usage.input_tokens.cached",n.anthropic.cacheReadInputTokens),Tr(t,"gen_ai.usage.input_tokens.cache_write",n.anthropic.cacheCreationInputTokens)),n.bedrock?.usage&&(Tr(t,"gen_ai.usage.input_tokens.cached",n.bedrock.usage.cacheReadInputTokens),Tr(t,"gen_ai.usage.input_tokens.cache_write",n.bedrock.usage.cacheWriteInputTokens)),n.deepseek&&(Tr(t,"gen_ai.usage.input_tokens.cached",n.deepseek.promptCacheHitTokens),Tr(t,"gen_ai.usage.input_tokens.cache_miss",n.deepseek.promptCacheMissTokens))}catch{}}function Tr(t,e,n){n!=null&&(t[e]=n)}var ZG="gen_ai.system",mm="gen_ai.request.model",QG="gen_ai.request.temperature",eH="gen_ai.request.frequency_penalty",tH="gen_ai.request.presence_penalty",nH="gen_ai.request.top_p",vR="gen_ai.response.finish_reasons",rH="gen_ai.response.model",oH="gen_ai.response.id",sH="gen_ai.usage.input_tokens",iH="gen_ai.usage.output_tokens",aH="gen_ai.usage.total_tokens",cH="gen_ai.operation.name",IR="gen_ai.request.messages",PR="gen_ai.response.text",uH="openai.response.id",lH="openai.response.model",dH="openai.response.timestamp",pH="openai.usage.completion_tokens",_H="openai.usage.prompt_tokens",bR={CHAT:"chat"};var gs="OpenAI",fH=["responses.create","chat.completions.create"];function Em(t){return t.includes("chat.completions")?bR.CHAT:t.includes("responses")?bR.CHAT:t.split(".").pop()||"unknown"}function mH(t){return`gen_ai.${Em(t)}`}function EH(t){return fH.includes(t)}function SH(t,e){return t?`${t}.${e}`:e}function TH(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="chat.completion"}function gH(t){return t!==null&&typeof t=="object"&&"object"in t&&t.object==="response"}function jhe(t,e){let n={[ZG]:"openai",[cH]:Em(e)};if(t.length>0&&typeof t[0]=="object"&&t[0]!==null){let r=t[0];n[mm]=r.model??"unknown","temperature"in r&&(n[QG]=r.temperature),"top_p"in r&&(n[nH]=r.top_p),"frequency_penalty"in r&&(n[eH]=r.frequency_penalty),"presence_penalty"in r&&(n[tH]=r.presence_penalty)}else n[mm]="unknown";return n}function hH(t,e,n,r){e!==void 0&&t.setAttributes({[_H]:e,[sH]:e}),n!==void 0&&t.setAttributes({[pH]:n,[iH]:n}),r!==void 0&&t.setAttributes({[aH]:r})}function AH(t,e,n,r){e&&t.setAttributes({[uH]:e,[oH]:e}),n&&t.setAttributes({[lH]:n,[rH]:n}),r&&t.setAttributes({[dH]:new Date(r*1e3).toISOString()})}function qhe(t,e){if(AH(t,e.id,e.model,e.created),e.usage&&hH(t,e.usage.prompt_tokens,e.usage.completion_tokens,e.usage.total_tokens),Array.isArray(e.choices)){let n=e.choices.map(r=>r.finish_reason).filter(r=>r!==null);n.length>0&&t.setAttributes({[vR]:JSON.stringify(n)})}}function Yhe(t,e){AH(t,e.id,e.model,e.created_at),e.status&&t.setAttributes({[vR]:JSON.stringify([e.status])}),e.usage&&hH(t,e.usage.input_tokens,e.usage.output_tokens,e.usage.total_tokens)}function Khe(t,e,n){if(!e||typeof e!="object")return;let r=e;if(TH(r)){if(qhe(t,r),n&&r.choices?.length){let o=r.choices.map(s=>s.message?.content||"");t.setAttributes({[PR]:JSON.stringify(o)})}}else gH(r)&&(Yhe(t,r),n&&r.output_text&&t.setAttributes({[PR]:r.output_text}))}function Whe(t,e){"messages"in e&&t.setAttributes({[IR]:JSON.stringify(e.messages)}),"input"in e&&t.setAttributes({[IR]:JSON.stringify(e.input)})}function zhe(){let e=ie().getClient(),n=e?.getIntegrationByName(gs),r=n?!!e?.getOptions().sendDefaultPii:!1;return{recordInputs:n?.options?.recordInputs??r,recordOutputs:n?.options?.recordOutputs??r}}function Xhe(t,e,n,r){return async function(...s){let i=r||zhe(),a=jhe(s,e),c=a[mm]||"unknown",u=Em(e);return wl({name:`${u} ${c}`,op:mH(e),attributes:a},async l=>{try{i.recordInputs&&s[0]&&typeof s[0]=="object"&&Whe(l,s[0]);let d=await t.apply(n,s);return Khe(l,d,i.recordOutputs),d}catch(d){throw tn(d),d}})}}function RH(t,e="",n){return new Proxy(t,{get(r,o){let s=r[o],i=SH(e,String(o));return typeof s=="function"&&EH(i)?Xhe(s,i,r,n):typeof s=="function"?s.bind(r):s&&typeof s=="object"?RH(s,i,n):s}})}function MR(t,e){return RH(t,"",e)}function Hl(t){if(t!==void 0)return t>=400&&t<500?"warning":t>=500?"error":void 0}function OH(t,e=!1){return!(e||t&&!t.startsWith("/")&&!t.match(/^[A-Z]:/)&&!t.startsWith(".")&&!t.match(/^[a-zA-Z]([a-zA-Z0-9.\-+])*:\/\//))&&t!==void 0&&!t.includes("node_modules/")}function NH(t){let e=/^\s*[-]{4,}$/,n=/at (?:async )?(?:(.+?)\s+\()?(?:(.+):(\d+):(\d+)?|([^)]+))\)?/;return r=>{let o=r.match(n);if(o){let s,i,a,c,u;if(o[1]){a=o[1];let p=a.lastIndexOf(".");if(a[p-1]==="."&&p--,p>0){s=a.slice(0,p),i=a.slice(p+1);let _=s.indexOf(".Module");_>0&&(a=a.slice(_+1),s=s.slice(0,_))}c=void 0}i&&(c=s,u=i),i==="<anonymous>"&&(u=void 0,a=void 0),a===void 0&&(u=u||"?",a=c?`${c}.${u}`:u);let l=o[2]?.startsWith("file://")?o[2].slice(7):o[2],d=o[5]==="native";return l?.match(/\/[A-Z]:/)&&(l=l.slice(1)),!l&&o[5]&&!d&&(l=o[5]),{filename:l?decodeURI(l):void 0,module:t?t(l):void 0,function:a,lineno:yH(o[3]),colno:yH(o[4]),in_app:OH(l||"",d)}}if(r.match(e))return{filename:r}}}function LR(t){return[90,NH(t)]}function yH(t){return parseInt(t||"",10)||void 0}var mn=class{constructor(e){this._maxSize=e,this._cache=new Map}get size(){return this._cache.size}get(e){let n=this._cache.get(e);if(n!==void 0)return this._cache.delete(e),this._cache.set(e,n),n}set(e,n){this._cache.size>=this._maxSize&&this._cache.delete(this._cache.keys().next().value),this._cache.set(e,n)}remove(e){let n=this._cache.get(e);return n&&this._cache.delete(e),n}clear(){this._cache.clear()}keys(){return Array.from(this._cache.keys())}values(){let e=[];return this._cache.forEach(n=>e.push(n)),e}};var xR=v(de(),1),Fl={};function F(t,e,n){return n?AAe(t,e,n):hAe(t,e)}function hAe(t,e){return Object.assign(n=>{let r=Fl[t];if(r)return n&&r.setConfig(n),r;let o=e(n);return Fl[t]=o,(0,xR.registerInstrumentations)({instrumentations:[o]}),o},{id:t})}function AAe(t,e,n){return Object.assign(r=>{let o=n(r),s=Fl[t];if(s)return s.setConfig(o),s;let i=new e(o);return Fl[t]=i,(0,xR.registerInstrumentations)({instrumentations:[i]}),i},{id:t})}function $l(t){let e=!1,n=[];if(!RAe(t))e=!0;else{let o=t._wrap;t._wrap=(...s)=>(e=!0,n.forEach(i=>i()),n=[],o(...s))}return o=>{e?o():n.push(o)}}function RAe(t){return typeof t._wrap=="function"}var Xr=require("node:diagnostics_channel");L();var g4=v(fe(),1),td=v(de(),1);Re();L();L();var Wn=v(fe(),1),As=v(Yy(),1),tO="sentry.parentIsRemote",kc="sentry.graphql.operation";function nO(t){if("parentSpanId"in t)return t.parentSpanId;if("parentSpanContext"in t)return t.parentSpanContext?.spanId}function rO(t){let e=t;return!!e.attributes&&typeof e.attributes=="object"}function Uxe(t){return typeof t.kind=="number"}function wxe(t){return!!t.status}function W2(t){return!!t.name}function kxe(t){if(!rO(t))return{};let e=t.attributes[hc]||t.attributes[gc],n={url:e,"http.method":t.attributes[Fi]||t.attributes[jl]};!n["http.method"]&&n.url&&(n["http.method"]="GET");try{if(typeof e=="string"){let r=Ss(e);n.url=Ts(r),r.search&&(n["http.query"]=r.search),r.hash&&(n["http.fragment"]=r.hash)}}catch{}return n}function Vxe(t){return Uxe(t)?t.kind:It.INTERNAL}var Ky="sentry-trace",Wy="baggage",oO="sentry.dsc",sO="sentry.sampled_not_recording",z2="sentry.url",Bxe="sentry.sample_rand",Gxe="sentry.sample_rate",X2=ir("sentry_scopes"),zy=ir("sentry_fork_isolation_scope"),Xy=ir("sentry_fork_set_scope"),Jy=ir("sentry_fork_set_isolation_scope"),J2="_scopeContext";function Vc(t){return t.getValue(X2)}function Z2(t,e){return t.setValue(X2,e)}function Hxe(t,e){rt(t,J2,e)}function Zl(t){return t[J2]}function wc(t){let{traceFlags:e,traceState:n}=t,r=n?n.get(sO)==="1":!1;if(e===kn.SAMPLED)return!0;if(r)return!1;let o=n?n.get(oO):void 0,s=o?fs(o):void 0;if(s?.sampled==="true")return!0;if(s?.sampled==="false")return!1}function Q2(t,e,n){let r=e[Fi]||e[jl];if(r)return $xe({attributes:e,name:t,kind:n},r);let o=e[UR],s=typeof e[re]=="string"&&e[re].startsWith("cache.");if(o&&!s)return Fxe({attributes:e,name:t});let i=e[pt]==="custom"?"custom":"route";if(e[GR])return{...Jl(t,e,"route"),op:"rpc"};if(e[BR])return{...Jl(t,e,i),op:"message"};let u=e[kR];return u?{...Jl(t,e,i),op:u.toString()}:{op:void 0,description:t,source:"custom"}}function e4(t){let e=rO(t)?t.attributes:{},n=W2(t)?t.name:"<unknown>",r=Vxe(t);return Q2(n,e,r)}function Fxe({attributes:t,name:e}){let n=t[$r];if(typeof n=="string")return{op:"db",description:n,source:t[pt]||"custom"};if(t[pt]==="custom")return{op:"db",description:e,source:"custom"};let r=t[wR];return{op:"db",description:r?r.toString():e,source:"task"}}function $xe({name:t,kind:e,attributes:n},r){let o=["http"];switch(e){case It.CLIENT:o.push("client");break;case It.SERVER:o.push("server");break}n["sentry.http.prefetch"]&&o.push("prefetch");let{urlPath:s,url:i,query:a,fragment:c,hasRoute:u}=qxe(n,e);if(!s)return{...Jl(t,n),op:o.join(".")};let l=n[kc],d=`${r} ${s}`,p=l?`${d} (${jxe(l)})`:d,_=u||s==="/"?"route":"url",f={};i&&(f.url=i),a&&(f["http.query"]=a),c&&(f["http.fragment"]=c);let E=e===It.CLIENT||e===It.SERVER,g=!`${n[ge]||"manual"}`.startsWith("auto"),h=n[pt]==="custom",O=n[$r],N=!h&&O==null&&(E||!g),{description:A,source:M}=N?{description:p,source:_}:Jl(t,n);return{op:o.join("."),description:A,source:M,data:f}}function jxe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}function qxe(t,e){let n=t[VR],r=t[gc]||t[hc],o=t[Wr],s=typeof r=="string"?Ss(r):void 0,i=s?Ts(s):void 0,a=s?.search||void 0,c=s?.hash||void 0;return typeof o=="string"?{urlPath:o,url:i,query:a,fragment:c,hasRoute:!0}:e===It.SERVER&&typeof n=="string"?{urlPath:Tc(n),url:i,query:a,fragment:c,hasRoute:!1}:s?{urlPath:i,url:i,query:a,fragment:c,hasRoute:!1}:typeof n=="string"?{urlPath:Tc(n),url:i,query:a,fragment:c,hasRoute:!1}:{urlPath:void 0,url:i,query:a,fragment:c,hasRoute:!1}}function Jl(t,e,n="custom"){let r=e[pt]||n,o=e[$r];return o&&typeof o=="string"?{description:o,source:r}:{description:t,source:r}}function t4(t){t.on("createDsc",(e,n)=>{if(!n)return;let s=q(n).data[pt],{description:i}=W2(n)?e4(n):{description:void 0};if(s!=="url"&&i&&(e.transaction=i),yt()){let a=wc(n.spanContext());e.sampled=a==null?void 0:String(a)}})}function n4(){return ne.getActiveSpan()}var zr=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function r4({dsc:t,sampled:e}){let n=t?Di(t):void 0,r=new Wn.TraceState,o=n?r.set(oO,n):r;return e===!1?o.set(sO,"1"):o}var o4=new Set;function s4(){return Array.from(o4)}function _E(t){o4.add(t)}var lE=class extends Wn.W3CBaggagePropagator{constructor(){super(),_E("SentryPropagator"),this._urlMatchesTargetsMap=new mn(100)}inject(e,n,r){if((0,Wn.isTracingSuppressed)(e)){zr&&T.log("[Tracing] Not injecting trace data for url because tracing is suppressed.");return}let o=ne.getSpan(e),s=o&&Wxe(o),i=j()?.getOptions()?.tracePropagationTargets;if(!Ql(s,i,this._urlMatchesTargetsMap)){zr&&T.log("[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:",s);return}let a=Kxe(n),c=Xt.getBaggage(e)||Xt.createBaggage({}),{dynamicSamplingContext:u,traceId:l,spanId:d,sampled:p}=i4(e);if(a){let _=Ui(a);_&&Object.entries(_).forEach(([f,E])=>{c=c.setEntry(f,{value:E})})}u&&(c=Object.entries(u).reduce((_,[f,E])=>E?_.setEntry(`${Il}${f}`,{value:E}):_,c)),l&&l!==Ri&&r.set(n,Ky,ms(l,d,p)),super.inject(Xt.setBaggage(e,c),n,r)}extract(e,n,r){let o=r.get(n,Ky),s=r.get(n,Wy),i=o?Array.isArray(o)?o[0]:o:void 0;return c4(a4(e,{sentryTrace:i,baggage:s}))}fields(){return[Ky,Wy]}},j2="[Tracing] Not injecting trace data for url because it does not match tracePropagationTargets:";function Ql(t,e,n){if(typeof t!="string"||!e)return!0;let r=n?.get(t);if(r!==void 0)return zr&&!r&&T.log(j2,t),r;let o=ls(t,e);return n?.set(t,o),zr&&!o&&T.log(j2,t),o}function i4(t,e={}){let n=ne.getSpan(t);if(n?.spanContext().isRemote){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:void 0,sampled:wc(a)}}if(n){let a=n.spanContext();return{dynamicSamplingContext:Je(n),traceId:a.traceId,spanId:a.spanId,sampled:wc(a)}}let r=e.scope||Vc(t)?.scope||ie(),o=e.client||j(),s=r.getPropagationContext();return{dynamicSamplingContext:o?Ro(o,r):void 0,traceId:s.traceId,spanId:s.propagationSpanId,sampled:s.sampled}}function a4(t,{sentryTrace:e,baggage:n}){let r=Pl(e,n),{traceId:o,parentSpanId:s,sampled:i,dsc:a}=r;if(!s)return t;let c=zxe({traceId:o,spanId:s,sampled:i,dsc:a});return ne.setSpanContext(t,c)}function Yxe(t,e,n){let r=c4(a4(t,e));return K.with(r,n)}function c4(t){let e=Vc(t),n={scope:e?e.scope:ie().clone(),isolationScope:e?e.isolationScope:Te()};return Z2(t,n)}function Kxe(t){try{let e=t[Wy];return Array.isArray(e)?e.join(","):e}catch{return}}function Wxe(t){let e=q(t).data,n=e[gc]||e[hc];if(typeof n=="string")return n;let r=t.spanContext().traceState?.get(z2);if(r)return r}function zxe({spanId:t,traceId:e,sampled:n,dsc:r}){let o=r4({dsc:r,sampled:n});return{traceId:e,spanId:t,isRemote:!0,traceFlags:n?kn.SAMPLED:kn.NONE,traceState:o}}function Xxe(t,e){let n=iO(),{name:r,parentSpan:o}=t;return uO(o)(()=>{let i=cO(t.scope,t.forceTransaction),c=t.onlyIfParent&&!ne.getSpan(i)?(0,Wn.suppressTracing)(i):i,u=aO(t);return n.startActiveSpan(r,u,c,l=>yo(()=>e(l),()=>{q(l).status===void 0&&l.setStatus({code:ve.ERROR})},()=>l.end()))})}function Jxe(t,e){let n=iO(),{name:r,parentSpan:o}=t;return uO(o)(()=>{let i=cO(t.scope,t.forceTransaction),c=t.onlyIfParent&&!ne.getSpan(i)?(0,Wn.suppressTracing)(i):i,u=aO(t);return n.startActiveSpan(r,u,c,l=>yo(()=>e(l,()=>l.end()),()=>{q(l).status===void 0&&l.setStatus({code:ve.ERROR})}))})}function Zxe(t){let e=iO(),{name:n,parentSpan:r}=t;return uO(r)(()=>{let s=cO(t.scope,t.forceTransaction),a=t.onlyIfParent&&!ne.getSpan(s)?(0,Wn.suppressTracing)(s):s,c=aO(t);return e.startSpan(n,c,a)})}function u4(t,e){let n=t?ne.setSpan(K.active(),t):ne.deleteSpan(K.active());return K.with(n,()=>e(ie()))}function iO(){return j()?.tracer||ne.getTracer("@sentry/opentelemetry",Oe)}function aO(t){let{startTime:e,attributes:n,kind:r,op:o,links:s}=t,i=typeof e=="number"?Qxe(e):e;return{attributes:o?{[re]:o,...n}:n,kind:r,links:s,startTime:i}}function Qxe(t){return t<9999999999?t*1e3:t}function cO(t,e){let n=e0e(t),r=ne.getSpan(n);if(!r||!e)return n;let o=ne.deleteSpan(n),{spanId:s,traceId:i}=r.spanContext(),a=wc(r.spanContext()),c=$e(r),u=Je(c),l=r4({dsc:u,sampled:a}),d={traceId:i,spanId:s,isRemote:!0,traceFlags:a?kn.SAMPLED:kn.NONE,traceState:l};return ne.setSpanContext(o,d)}function e0e(t){if(t){let e=Zl(t);if(e)return e}return K.active()}function t0e(t,e){return Yxe(K.active(),t,e)}function l4(t,e){let n=Zl(e),r=n&&ne.getSpan(n),o=r?Es(r):lc(e);return[r?Je(r):Ro(t,e),o]}function uO(t){return t!==void 0?e=>u4(t,e):e=>e()}function n0e(t){let e=(0,Wn.suppressTracing)(K.active());return K.with(e,t)}function d4(t){t.on("preprocessEvent",e=>{let n=n4();if(!n||e.type==="transaction")return;e.contexts={trace:Es(n),...e.contexts};let r=$e(n);return e.sdkProcessingMetadata={dynamicSamplingContext:Je(r),...e.sdkProcessingMetadata},e})}function r0e({span:t,scope:e,client:n}={}){let r=(e&&Zl(e))??K.active();if(t){let{scope:c}=_r(t);r=c&&Zl(c)||ne.setSpan(K.active(),t)}let{traceId:o,spanId:s,sampled:i,dynamicSamplingContext:a}=i4(r,{scope:e,client:n});return{"sentry-trace":ms(o,s,i),baggage:Di(a)}}function p4(){function t(){let a=K.active(),c=Vc(a);return c||{scope:cc(),isolationScope:Hr()}}function e(a){let c=K.active();return K.with(c,()=>a(s()))}function n(a,c){let u=Zl(a)||K.active();return K.with(u.setValue(Xy,a),()=>c(a))}function r(a){let c=K.active();return K.with(c.setValue(zy,!0),()=>a(i()))}function o(a,c){let u=K.active();return K.with(u.setValue(Jy,a),()=>c(i()))}function s(){return t().scope}function i(){return t().isolationScope}KA({withScope:e,withSetScope:n,withSetIsolationScope:o,withIsolationScope:r,getCurrentScope:s,getIsolationScope:i,startSpan:Xxe,startSpanManual:Jxe,startInactiveSpan:Zxe,getActiveSpan:n4,suppressTracing:n0e,getTraceData:r0e,continueTrace:t0e,withActiveSpan:u4})}function _4(t){class e extends t{constructor(...r){super(...r),_E("SentryContextManager")}with(r,o,s,...i){let a=Vc(r),c=a?.scope||ie(),u=a?.isolationScope||Te(),l=r.getValue(zy)===!0,d=r.getValue(Xy),p=r.getValue(Jy),_=d||c.clone(),f=p||(l?u.clone():u),g=Z2(r,{scope:_,isolationScope:f}).deleteValue(zy).deleteValue(Xy).deleteValue(Jy);return Hxe(_,g),super.with(g,o,s,...i)}}return e}function o0e(t){let e=new Map;for(let n of t)s0e(e,n);return Array.from(e,function([n,r]){return r})}function f4(t){return t.attributes[tO]===!0?void 0:nO(t)}function s0e(t,e){let n=e.spanContext().spanId,r=f4(e);if(!r){Zy(t,{id:n,span:e,children:[]});return}let o=i0e(t,r),s=Zy(t,{id:n,span:e,parentNode:o,children:[]});o.children.push(s)}function i0e(t,e){let n=t.get(e);return n||Zy(t,{id:e,children:[]})}function Zy(t,e){let n=t.get(e.id);return n?.span?n:n&&!n.span?(n.span=e.span,n.parentNode=e.parentNode,n):(t.set(e.id,e),e)}var m4={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"},a0e=t=>Object.values(m4).includes(t);function E4(t){let e=rO(t)?t.attributes:{},n=wxe(t)?t.status:void 0;if(n){if(n.code===ve.OK)return{code:1};if(n.code===ve.ERROR){if(typeof n.message>"u"){let o=q2(e);if(o)return o}return n.message&&a0e(n.message)?{code:2,message:n.message}:{code:2,message:"unknown_error"}}}let r=q2(e);return r||(n?.code===ve.UNSET?{code:1}:{code:2,message:"unknown_error"})}function q2(t){let e=t[hs]||t[Sm],n=t[HR],r=typeof e=="number"?e:typeof e=="string"?parseInt(e):void 0;if(typeof r=="number")return Lf(r);if(typeof n=="string")return{code:2,message:m4[n]||"unknown_error"}}var Y2=1e3,K2=300,Qy=class{constructor(e){this._finishedSpanBucketSize=e?.timeout||K2,this._finishedSpanBuckets=new Array(this._finishedSpanBucketSize).fill(void 0),this._lastCleanupTimestampInS=Math.floor(Date.now()/1e3),this._spansToBucketEntry=new WeakMap,this._sentSpans=new Map,this._debouncedFlush=TR(this.flush.bind(this),1,{maxWait:100})}export(e){let n=Math.floor(Date.now()/1e3);if(this._lastCleanupTimestampInS!==n){let i=0;this._finishedSpanBuckets.forEach((a,c)=>{a&&a.timestampInS<=n-this._finishedSpanBucketSize&&(i+=a.spans.size,this._finishedSpanBuckets[c]=void 0)}),i>0&&zr&&T.log(`SpanExporter dropped ${i} spans because they were pending for more than ${this._finishedSpanBucketSize} seconds.`),this._lastCleanupTimestampInS=n}let r=n%this._finishedSpanBucketSize,o=this._finishedSpanBuckets[r]||{timestampInS:n,spans:new Set};this._finishedSpanBuckets[r]=o,o.spans.add(e),this._spansToBucketEntry.set(e,o);let s=f4(e);(!s||this._sentSpans.has(s))&&this._debouncedFlush()}flush(){let e=this._finishedSpanBuckets.flatMap(i=>i?Array.from(i.spans):[]);this._flushSentSpanCache();let n=this._maybeSend(e),r=n.size,o=e.length-r;zr&&T.log(`SpanExporter exported ${r} spans, ${o} spans are waiting for their parent spans to finish`);let s=Date.now()+K2*1e3;for(let i of n){this._sentSpans.set(i.spanContext().spanId,s);let a=this._spansToBucketEntry.get(i);a&&a.spans.delete(i)}this._debouncedFlush.cancel()}clear(){this._finishedSpanBuckets=this._finishedSpanBuckets.fill(void 0),this._sentSpans.clear(),this._debouncedFlush.cancel()}_maybeSend(e){let n=o0e(e),r=new Set,o=this._getCompletedRootNodes(n);for(let s of o){let i=s.span;r.add(i);let a=u0e(i);if(s.parentNode&&this._sentSpans.has(s.parentNode.id)){let l=a.contexts?.trace?.data;l&&(l["sentry.parent_span_already_sent"]=!0)}let c=a.spans||[];for(let l of s.children)eO(l,c,r);a.spans=c.length>Y2?c.sort((l,d)=>l.start_timestamp-d.start_timestamp).slice(0,Y2):c;let u=Bi(i.events);u&&(a.measurements=u),Qf(a)}return r}_flushSentSpanCache(){let e=Date.now();for(let[n,r]of this._sentSpans.entries())r<=e&&this._sentSpans.delete(n)}_nodeIsCompletedRootNodeOrHasSentParent(e){return!!e.span&&(!e.parentNode||this._sentSpans.has(e.parentNode.id))}_getCompletedRootNodes(e){return e.filter(n=>this._nodeIsCompletedRootNodeOrHasSentParent(n))}};function c0e(t){let e=t.attributes,n=e[ge],r=e[re],o=e[pt];return{origin:n,op:r,source:o}}function u0e(t){let{op:e,description:n,data:r,origin:o="manual",source:s}=S4(t),i=_r(t),a=t.attributes[pr],c={[pt]:s,[pr]:a,[re]:e,[ge]:o,...r,...T4(t.attributes)},{links:u}=t,{traceId:l,spanId:d}=t.spanContext(),p=nO(t),_=E4(t),f={parent_span_id:p,span_id:d,trace_id:l,data:c,origin:o,op:e,status:ki(_),links:wi(u)},E=c[hs],S=typeof E=="number"?{response:{status_code:E}}:void 0;return{contexts:{trace:f,otel:{resource:t.resource.attributes},...S},spans:[],start_timestamp:fn(t.startTime),timestamp:fn(t.endTime),transaction:n,type:"transaction",sdkProcessingMetadata:{capturedSpanScope:i.scope,capturedSpanIsolationScope:i.isolationScope,sampleRate:a,dynamicSamplingContext:Je(t)},...s&&{transaction_info:{source:s}}}}function eO(t,e,n){let r=t.span;if(r&&n.add(r),!r){t.children.forEach(O=>{eO(O,e,n)});return}let s=r.spanContext().spanId,i=r.spanContext().traceId,a=nO(r),{attributes:c,startTime:u,endTime:l,links:d}=r,{op:p,description:_,data:f,origin:E="manual"}=S4(r),S={[ge]:E,[re]:p,...T4(c),...f},g=E4(r),h={span_id:s,trace_id:i,data:S,description:_,parent_span_id:a,start_timestamp:fn(u),timestamp:fn(l)||void 0,status:ki(g),op:p,origin:E,measurements:Bi(r.events),links:wi(d)};e.push(h),t.children.forEach(O=>{eO(O,e,n)})}function S4(t){let{op:e,source:n,origin:r}=c0e(t),{op:o,description:s,source:i,data:a}=e4(t),c=e||o,u=n||i,l={...a,...l0e(t)};return{op:c,description:s,source:u,origin:r,data:l}}function T4(t){let e={...t};return delete e[pr],delete e[tO],delete e[$r],e}function l0e(t){let e=t.attributes,n={};t.kind!==It.INTERNAL&&(n["otel.kind"]=It[t.kind]);let r=e[Sm];r&&(n[hs]=r);let o=kxe(t);return o.url&&(n.url=o.url),o["http.query"]&&(n["http.query"]=o["http.query"].slice(1)),o["http.fragment"]&&(n["http.fragment"]=o["http.fragment"].slice(1)),n}function d0e(t,e){let n=ne.getSpan(e),r=Vc(e);n&&!n.spanContext().isRemote&&_c(n,t),n?.spanContext().isRemote&&t.setAttribute(tO,!0),e===Ma&&(r={scope:cc(),isolationScope:Hr()}),r&&vl(t,r.scope,r.isolationScope),xl(t),j()?.emit("spanStart",t)}function p0e(t){Dl(t),j()?.emit("spanEnd",t)}var dE=class{constructor(e){_E("SentrySpanProcessor"),this._exporter=new Qy(e)}async forceFlush(){this._exporter.flush()}async shutdown(){this._exporter.clear()}onStart(e,n){d0e(e,n)}onEnd(e){p0e(e),this._exporter.export(e)}},pE=class{constructor(e){this._client=e,_E("SentrySampler")}shouldSample(e,n,r,o,s,i){let a=this._client.getOptions(),c=m0e(e),u=c?.spanContext();if(!yt(a))return Uc({decision:void 0,context:e,spanAttributes:s});let l=s[jl]||s[Fi];if(o===It.CLIENT&&l&&(!c||u?.isRemote))return Uc({decision:void 0,context:e,spanAttributes:s});let d=c?_0e(c,n,r):void 0;if(!(!c||u?.isRemote))return Uc({decision:d?As.SamplingDecision.RECORD_AND_SAMPLED:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s});let{description:_,data:f,op:E}=Q2(r,s,o),S={...f,...s};E&&(S[re]=E);let g={decision:!0};if(this._client.emit("beforeSampling",{spanAttributes:S,spanName:_,parentSampled:d,parentContext:u},g),!g.decision)return Uc({decision:void 0,context:e,spanAttributes:s});let{isolationScope:h}=Vc(e)??{},O=u?.traceState?u.traceState.get(oO):void 0,N=O?fs(O):void 0,A=Cn(N?.sample_rand)??Math.random(),[M,P,J]=Ul(a,{name:_,attributes:S,normalizedRequest:h?.getScopeData().sdkProcessingMetadata.normalizedRequest,parentSampled:d,parentSampleRate:Cn(N?.sample_rate)},A),X=`${l}`.toUpperCase();return X==="OPTIONS"||X==="HEAD"?(zr&&T.log(`[Tracing] Not sampling span because HTTP method is '${X}' for ${r}`),Uc({decision:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:A,downstreamTraceSampleRate:0})):(!M&&d===void 0&&(zr&&T.log("[Tracing] Discarding root span because its trace was not chosen to be sampled."),this._client.recordDroppedEvent("sample_rate","transaction")),{...Uc({decision:M?As.SamplingDecision.RECORD_AND_SAMPLED:As.SamplingDecision.NOT_RECORD,context:e,spanAttributes:s,sampleRand:A,downstreamTraceSampleRate:J?P:void 0}),attributes:{[pr]:J?P:void 0}})}toString(){return"SentrySampler"}};function _0e(t,e,n){let r=t.spanContext();if(So(r)&&r.traceId===e){if(r.isRemote){let s=wc(t.spanContext());return zr&&T.log(`[Tracing] Inheriting remote parent's sampled decision for ${n}: ${s}`),s}let o=wc(r);return zr&&T.log(`[Tracing] Inheriting parent's sampled decision for ${n}: ${o}`),o}}function Uc({decision:t,context:e,spanAttributes:n,sampleRand:r,downstreamTraceSampleRate:o}){let s=f0e(e,n);return o!==void 0&&(s=s.set(Gxe,`${o}`)),r!==void 0&&(s=s.set(Bxe,`${r}`)),t==null?{decision:As.SamplingDecision.NOT_RECORD,traceState:s}:t===As.SamplingDecision.NOT_RECORD?{decision:t,traceState:s.set(sO,"1")}:{decision:t,traceState:s}}function f0e(t,e){let o=ne.getSpan(t)?.spanContext()?.traceState||new Wn.TraceState,s=e[gc]||e[hc];return s&&typeof s=="string"&&(o=o.set(z2,s)),o}function m0e(t){let e=ne.getSpan(t);return e&&So(e.spanContext())?e:void 0}var le=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;function ed(t,e){if(!t)return e;let n=Ui(t),r=Ui(e);if(!r)return t;let o={...n};return Object.entries(r).forEach(([s,i])=>{o[s]||(o[s]=i)}),xf(o)}function Bc(t){let e=t.protocol||"",n=t.hostname||t.host||"",r=!t.port||t.port===80||t.port===443||/^(.*):(\d+)$/.test(n)?"":`:${t.port}`,o=t.path?t.path:"/";return`${e}//${n}${r}${o}`}var En="@sentry/instrumentation-http",E0e=1024*1024,zi=class extends td.InstrumentationBase{constructor(e={}){super(En,Oe,e),this._propagationDecisionMap=new mn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){let e=!1,n=(c=>{let u=c;this._patchServerEmitOnce(u.server)}),r=(c=>{let u=c;this._onOutgoingRequestFinish(u.request,u.response)}),o=(c=>{let u=c;this._onOutgoingRequestFinish(u.request,void 0)}),s=(c=>{let u=c;this._onOutgoingRequestCreated(u.request)}),i=c=>(e||(e=!0,(0,Xr.subscribe)("http.server.request.start",n),(0,Xr.subscribe)("http.client.response.finish",r),(0,Xr.subscribe)("http.client.request.error",o),this.getConfig().propagateTraceInOutgoingRequests&&(0,Xr.subscribe)("http.client.request.created",s)),c),a=()=>{(0,Xr.unsubscribe)("http.server.request.start",n),(0,Xr.unsubscribe)("http.client.response.finish",r),(0,Xr.unsubscribe)("http.client.request.error",o),(0,Xr.unsubscribe)("http.client.request.created",s)};return[new td.InstrumentationNodeModuleDefinition("http",["*"],i,a),new td.InstrumentationNodeModuleDefinition("https",["*"],i,a)]}_onOutgoingRequestFinish(e,n){le&&T.log(En,"Handling finished outgoing request");let r=this.getConfig().breadcrumbs,o=typeof r>"u"?!0:r,s=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);this._ignoreOutgoingRequestsMap.set(e,s),o&&!s&&S0e(e,n)}_onOutgoingRequestCreated(e){let n=this._ignoreOutgoingRequestsMap.get(e)??this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,n),n)return;let r=Bc(e),o=j()?.getOptions().tracePropagationTargets,s=Ql(r,o,this._propagationDecisionMap)?Sc():void 0;if(!s)return;let{"sentry-trace":i,baggage:a}=s;if(i&&!e.getHeader("sentry-trace"))try{e.setHeader("sentry-trace",i),le&&T.log(En,"Added sentry-trace header to outgoing request")}catch(c){le&&T.error(En,"Failed to add sentry-trace header to outgoing request:",cs(c)?c.message:"Unknown error")}if(a){let c=ed(e.getHeader("baggage"),a);if(c)try{e.setHeader("baggage",c),le&&T.log(En,"Added baggage header to outgoing request")}catch(u){le&&T.error(En,"Failed to add baggage header to outgoing request:",cs(u)?u.message:"Unknown error")}}}_patchServerEmitOnce(e){let n=e.emit;if(n.__sentry_patched__)return;le&&T.log(En,"Patching server.emit");let r=this,{ignoreIncomingRequestBody:o,maxIncomingRequestBodySize:s="medium"}=r.getConfig(),i=new Proxy(n,{apply(a,c,u){if(u[0]!=="request")return a.apply(c,u);le&&T.log(En,"Handling incoming request");let l=Te().clone(),d=u[1],p=u[2],_=sm(d),f=d.ip||d.socket?.remoteAddress,E=d.url||"/";!o?.(E,d)&&s!=="none"&&g0e(d,l,s),l.setSDKProcessingMetadata({normalizedRequest:_,ipAddress:f});let S=(d.method||"GET").toUpperCase(),g=Tc(E),h=`${S} ${g}`;return l.setTransactionName(h),r.getConfig().trackIncomingRequestsAsSessions!==!1&&A0e({requestIsolationScope:l,response:p,sessionFlushingDelayMS:r.getConfig().sessionFlushingDelayMS??6e4}),Cl(l,()=>{if(ie().getPropagationContext().propagationSpanId=Nn(),!r.getConfig().extractIncomingTraceFromHeader)return a.apply(c,u);let O=Xt.extract(K.active(),_.headers);return K.with(O,()=>a.apply(c,u))})}});rt(i,"__sentry_patched__",!0),e.emit=i}_shouldIgnoreOutgoingRequest(e){if((0,g4.isTracingSuppressed)(K.active()))return!0;let n=this.getConfig().ignoreOutgoingRequests;if(!n)return!1;let r=h0e(e),o=Bc(e);return n(o,r)}};function S0e(t,e){let n=T0e(t),r=e?.statusCode,o=Hl(r);In({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function T0e(t){try{let e=t.getHeader("host")||t.host,n=new URL(t.path,`${t.protocol}//${e}`),r=Ss(n.toString()),o={url:Ts(r),"http.method":t.method||"GET"};return r.search&&(o["http.query"]=r.search),r.hash&&(o["http.fragment"]=r.hash),o}catch{return{}}}function g0e(t,e,n){let r=0,o=[];le&&T.log(En,"Patching request.on");let s=new WeakMap,i=n==="small"?1e3:n==="medium"?1e4:E0e;try{t.on=new Proxy(t.on,{apply:(a,c,u)=>{let[l,d,...p]=u;if(l==="data"){le&&T.log(En,`Handling request.on("data") with maximum body size of ${i}b`);let _=new Proxy(d,{apply:(f,E,S)=>{try{let g=S[0],h=Buffer.from(g);r<i?(o.push(h),r+=h.byteLength):le&&T.log(En,`Dropping request body chunk because maximum body length of ${i}b is exceeded.`)}catch{le&&T.error(En,"Encountered error while storing body chunk.")}return Reflect.apply(f,E,S)}});return s.set(d,_),Reflect.apply(a,c,[l,_,...p])}return Reflect.apply(a,c,u)}}),t.off=new Proxy(t.off,{apply:(a,c,u)=>{let[,l]=u,d=s.get(l);if(d){s.delete(l);let p=u.slice();return p[1]=d,Reflect.apply(a,c,p)}return Reflect.apply(a,c,u)}}),t.on("end",()=>{try{let a=Buffer.concat(o).toString("utf-8");if(a){let u=Buffer.byteLength(a,"utf-8")>i?`${Buffer.from(a).subarray(0,i-3).toString("utf-8")}...`:a;e.setSDKProcessingMetadata({normalizedRequest:{data:u}})}}catch(a){le&&T.error(En,"Error building captured request body",a)}})}catch(a){le&&T.error(En,"Error patching request to capture body",a)}}function h0e(t){return{method:t.method,protocol:t.protocol,host:t.host,hostname:t.host,path:t.path,headers:t.getHeaders()}}function A0e({requestIsolationScope:t,response:e,sessionFlushingDelayMS:n}){t.setSDKProcessingMetadata({requestSession:{status:"ok"}}),e.once("close",()=>{let r=j(),o=t.getScopeData().sdkProcessingMetadata.requestSession;if(r&&o){le&&T.log(`Recorded request session with status: ${o.status}`);let s=new Date;s.setSeconds(0,0);let i=s.toISOString(),a=lO.get(r),c=a?.[i]||{exited:0,crashed:0,errored:0};if(c[{ok:"exited",crashed:"crashed",errored:"errored"}[o.status]]++,a)a[i]=c;else{le&&T.log("Opened new request session aggregate.");let u={[i]:c};lO.set(r,u);let l=()=>{clearTimeout(p),d(),lO.delete(r);let _=Object.entries(u).map(([f,E])=>({started:f,exited:E.exited,errored:E.errored,crashed:E.crashed}));r.sendSession({aggregates:_})},d=r.on("flush",()=>{le&&T.log("Sending request session aggregate due to client flush"),l()}),p=setTimeout(()=>{le&&T.log("Sending request session aggregate due to flushing schedule"),l()},n).unref()}}})}var lO=new Map;var h4="Http",R0e=F(`${h4}.sentry`,t=>new zi(t)),A4=(t={})=>{let e=t.dropSpansForIncomingRequestStatusCodes??[[401,404],[300,399]];return{name:h4,setupOnce(){R0e({...t,extractIncomingTraceFromHeader:!0,propagateTraceInOutgoingRequests:!0})},processEvent(n){if(n.type==="transaction"){let r=n.contexts?.trace?.data?.["http.response.status_code"];if(typeof r=="number"&&e.some(o=>{if(typeof o=="number")return o===r;let[s,i]=o;return r>=s&&r<=i}))return null}return n}}};L();var O4=v(fe(),1),N4=v(de(),1);var Gc=v(require("diagnostics_channel"),1);var Xi=jA(process.versions.node),nd=Xi.major,R4=Xi.minor;var fE="sentry-trace",dO="baggage",y4=/baggage: (.*)\r\n/,Ji=class extends N4.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-node-fetch",Oe,e),this._channelSubs=[],this._propagationDecisionMap=new mn(100),this._ignoreOutgoingRequestsMap=new WeakMap}init(){}disable(){super.disable(),this._channelSubs.forEach(e=>e.unsubscribe()),this._channelSubs=[]}enable(){super.enable(),this._channelSubs=this._channelSubs||[],!(this._channelSubs.length>0)&&(this._subscribeToChannel("undici:request:create",this._onRequestCreated.bind(this)),this._subscribeToChannel("undici:request:headers",this._onResponseHeaders.bind(this)))}_onRequestCreated({request:e}){if(!(this.getConfig().enabled!==!1))return;let o=this._shouldIgnoreOutgoingRequest(e);if(this._ignoreOutgoingRequestsMap.set(e,o),o)return;let s=pO(e.origin,e.path),i=j()?.getOptions().tracePropagationTargets,a=Ql(s,i,this._propagationDecisionMap)?Sc():void 0;if(!a)return;let{"sentry-trace":c,baggage:u}=a;if(Array.isArray(e.headers)){let l=e.headers;c&&!l.includes(fE)&&l.push(fE,c);let d=l.findIndex(p=>p===dO);if(u&&d===-1)l.push(dO,u);else if(u){let p=l[d+1],_=ed(p,u);_&&(l[d+1]=_)}}else{let l=e.headers;c&&!l.includes(`${fE}:`)&&(e.headers+=`${fE}: ${c}\r
147
+ `);let d=e.headers.match(y4)?.[1];if(u&&!d)e.headers+=`${dO}: ${u}\r
148
+ `;else if(u){let p=ed(d,u);p&&(e.headers=e.headers.replace(y4,`baggage: ${p}\r
149
+ `))}}}_onResponseHeaders({request:e,response:n}){let r=this.getConfig();if(!(r.enabled!==!1))return;let s=r.breadcrumbs,i=typeof s>"u"?!0:s,a=this._ignoreOutgoingRequestsMap.get(e);i&&!a&&y0e(e,n)}_subscribeToChannel(e,n){let r=nd>18||nd===18&&R4>=19,o;if(r)Gc.subscribe?.(e,n),o=()=>Gc.unsubscribe?.(e,n);else{let s=Gc.channel(e);s.subscribe(n),o=()=>s.unsubscribe(n)}this._channelSubs.push({name:e,unsubscribe:o})}_shouldIgnoreOutgoingRequest(e){if((0,O4.isTracingSuppressed)(K.active()))return!0;let n=pO(e.origin,e.path),r=this.getConfig().ignoreOutgoingRequests;return typeof r!="function"||!n?!1:r(n)}};function y0e(t,e){let n=O0e(t),r=e.statusCode,o=Hl(r);In({category:"http",data:{status_code:r,...n},type:"http",level:o},{event:"response",request:t,response:e})}function O0e(t){try{let e=pO(t.origin,t.path),n=Ss(e),r={url:Ts(n),"http.method":t.method||"GET"};return n.search&&(r["http.query"]=n.search),n.hash&&(r["http.fragment"]=n.hash),r}catch{return{}}}function pO(t,e="/"){try{return new URL(e,t).toString()}catch{let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e.slice(1)}`:`${n}${e}`}}var N0e="NodeFetch",C0e=F(`${N0e}.sentry`,Ji,t=>t),v0e=((t={})=>({name:"NodeFetch",setupOnce(){C0e(t)}})),C4=v0e;var I4=require("node:child_process"),mE=require("node:fs"),Ot=v(require("node:os"),1),P4=require("node:path"),_O=require("node:util");var I0e=(0,_O.promisify)(mE.readFile),P0e=(0,_O.promisify)(mE.readdir),b0e="Context",M0e=((t={})=>{let e,n={app:!0,os:!0,device:!0,culture:!0,cloudResource:!0,...t};async function r(s){e===void 0&&(e=o());let i=L0e(await e);return s.contexts={...s.contexts,app:{...i.app,...s.contexts?.app},os:{...i.os,...s.contexts?.os},device:{...i.device,...s.contexts?.device},culture:{...i.culture,...s.contexts?.culture},cloud_resource:{...i.cloud_resource,...s.contexts?.cloud_resource}},s}async function o(){let s={};if(n.os&&(s.os=await x0e()),n.app&&(s.app=U0e()),n.device&&(s.device=w0e(n.device)),n.culture){let i=D0e();i&&(s.culture=i)}return n.cloudResource&&(s.cloud_resource=F0e()),s}return{name:b0e,processEvent(s){return r(s)}}}),b4=M0e;function L0e(t){if(t.app?.app_memory&&(t.app.app_memory=process.memoryUsage().rss),t.app?.free_memory&&typeof process.availableMemory=="function"){let e=process.availableMemory?.();e!=null&&(t.app.free_memory=e)}return t.device?.free_memory&&(t.device.free_memory=Ot.freemem()),t}async function x0e(){let t=Ot.platform();switch(t){case"darwin":return G0e();case"linux":return H0e();default:return{name:k0e[t]||t,version:Ot.release()}}}function D0e(){try{if(typeof process.versions.icu!="string")return;let t=new Date(9e8);if(new Intl.DateTimeFormat("es",{month:"long"}).format(t)==="enero"){let n=Intl.DateTimeFormat().resolvedOptions();return{locale:n.locale,timezone:n.timeZone}}}catch{}}function U0e(){let t=process.memoryUsage().rss,n={app_start_time:new Date(Date.now()-process.uptime()*1e3).toISOString(),app_memory:t};if(typeof process.availableMemory=="function"){let r=process.availableMemory?.();r!=null&&(n.free_memory=r)}return n}function w0e(t){let e={},n;try{n=Ot.uptime()}catch{}if(typeof n=="number"&&(e.boot_time=new Date(Date.now()-n*1e3).toISOString()),e.arch=Ot.arch(),(t===!0||t.memory)&&(e.memory_size=Ot.totalmem(),e.free_memory=Ot.freemem()),t===!0||t.cpu){let r=Ot.cpus(),o=r?.[0];o&&(e.processor_count=r.length,e.cpu_description=o.model,e.processor_frequency=o.speed)}return e}var k0e={aix:"IBM AIX",freebsd:"FreeBSD",openbsd:"OpenBSD",sunos:"SunOS",win32:"Windows"},V0e=[{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"]}],B0e={alpine:t=>t,arch:t=>Jr(/distrib_release=(.*)/,t),centos:t=>Jr(/release ([^ ]+)/,t),debian:t=>t,fedora:t=>Jr(/release (..)/,t),mint:t=>Jr(/distrib_release=(.*)/,t),red:t=>Jr(/release ([^ ]+)/,t),suse:t=>Jr(/VERSION = (.*)\n/,t),ubuntu:t=>Jr(/distrib_release=(.*)/,t)};function Jr(t,e){let n=t.exec(e);return n?n[1]:void 0}async function G0e(){let t={kernel_version:Ot.release(),name:"Mac OS X",version:`10.${Number(Ot.release().split(".")[0])-4}`};try{let e=await new Promise((n,r)=>{(0,I4.execFile)("/usr/bin/sw_vers",(o,s)=>{if(o){r(o);return}n(s)})});t.name=Jr(/^ProductName:\s+(.*)$/m,e),t.version=Jr(/^ProductVersion:\s+(.*)$/m,e),t.build=Jr(/^BuildVersion:\s+(.*)$/m,e)}catch{}return t}function v4(t){return t.split(" ")[0].toLowerCase()}async function H0e(){let t={kernel_version:Ot.release(),name:"Linux"};try{let e=await P0e("/etc"),n=V0e.find(a=>e.includes(a.name));if(!n)return t;let r=(0,P4.join)("/etc",n.name),o=(await I0e(r,{encoding:"utf-8"})).toLowerCase(),{distros:s}=n;t.name=s.find(a=>o.indexOf(v4(a))>=0)||s[0];let i=v4(t.name);t.version=B0e[i]?.(o)}catch{}return t}function F0e(){return process.env.VERCEL?{"cloud.provider":"vercel","cloud.region":process.env.VERCEL_REGION}:process.env.AWS_REGION?{"cloud.provider":"aws","cloud.region":process.env.AWS_REGION,"cloud.platform":process.env.AWS_EXECUTION_ENV}:process.env.GCP_PROJECT?{"cloud.provider":"gcp"}:process.env.ALIYUN_REGION_ID?{"cloud.provider":"alibaba_cloud","cloud.region":process.env.ALIYUN_REGION_ID}:process.env.WEBSITE_SITE_NAME&&process.env.REGION_NAME?{"cloud.provider":"azure","cloud.region":process.env.REGION_NAME}:process.env.IBM_CLOUD_REGION?{"cloud.provider":"ibm_cloud","cloud.region":process.env.IBM_CLOUD_REGION}:process.env.TENCENTCLOUD_REGION?{"cloud.provider":"tencent_cloud","cloud.region":process.env.TENCENTCLOUD_REGION,"cloud.account.id":process.env.TENCENTCLOUD_APPID,"cloud.availability_zone":process.env.TENCENTCLOUD_ZONE}:process.env.NETLIFY?{"cloud.provider":"netlify"}:process.env.FLY_REGION?{"cloud.provider":"fly.io","cloud.region":process.env.FLY_REGION}:process.env.DYNO?{"cloud.provider":"heroku"}:void 0}var x4=require("node:fs"),D4=require("node:readline");var fO=new mn(10),U4=new mn(20),$0e=7,j0e="ContextLines",q0e=1e3,Y0e=1e4;function K0e(t,e,n){let r=t.get(e);return r===void 0?(t.set(e,n),n):r}function W0e(t){return!!(t.startsWith("node:")||t.endsWith(".min.js")||t.endsWith(".min.cjs")||t.endsWith(".min.mjs")||t.startsWith("data:"))}function z0e(t){return t.lineno!==void 0&&t.lineno>Y0e||t.colno!==void 0&&t.colno>q0e}function X0e(t,e){let n=fO.get(t);if(n===void 0)return!1;for(let r=e[0];r<=e[1];r++)if(n[r]===void 0)return!1;return!0}function J0e(t,e){if(!t.length)return[];let n=0,r=t[0];if(typeof r!="number")return[];let o=L4(r,e),s=[];for(;;){if(n===t.length-1){s.push(o);break}let i=t[n+1];if(typeof i!="number")break;i<=o[1]?o[1]=i+e:(s.push(o),o=L4(i,e)),n++}return s}function Z0e(t,e,n){return new Promise((r,o)=>{let s=(0,x4.createReadStream)(t),i=(0,D4.createInterface)({input:s});function a(){s.destroy(),r()}let c=0,u=0,l=e[u];if(l===void 0){a();return}let d=l[0],p=l[1];function _(f){U4.set(t,1),le&&T.error(`Failed to read file: ${t}. Error: ${f}`),i.close(),i.removeAllListeners(),a()}s.on("error",_),i.on("error",_),i.on("close",a),i.on("line",f=>{if(c++,!(c<d)&&(n[c]=kA(f,0),c>=p)){if(u===e.length-1){i.close(),i.removeAllListeners();return}u++;let E=e[u];if(E===void 0){i.close(),i.removeAllListeners();return}d=E[0],p=E[1]}})})}async function Q0e(t,e){let n={};if(e>0&&t.exception?.values){for(let s of t.exception.values)if(s.stacktrace?.frames?.length)for(let i=s.stacktrace.frames.length-1;i>=0;i--){let a=s.stacktrace.frames[i],c=a?.filename;if(!a||typeof c!="string"||typeof a.lineno!="number"||W0e(c)||z0e(a))continue;n[c]||(n[c]=[]),n[c].push(a.lineno)}}let r=Object.keys(n);if(r.length==0)return t;let o=[];for(let s of r){if(U4.get(s))continue;let i=n[s];if(!i)continue;i.sort((u,l)=>u-l);let a=J0e(i,e);if(a.every(u=>X0e(s,u)))continue;let c=K0e(fO,s,{});o.push(Z0e(s,a,c))}if(await Promise.all(o).catch(()=>{le&&T.log("Failed to read one or more source files and resolve context lines")}),e>0&&t.exception?.values)for(let s of t.exception.values)s.stacktrace?.frames&&s.stacktrace.frames.length>0&&eDe(s.stacktrace.frames,e,fO);return t}function eDe(t,e,n){for(let r of t)if(r.filename&&r.context_line===void 0&&typeof r.lineno=="number"){let o=n.get(r.filename);if(o===void 0)continue;tDe(r.lineno,r,e,o)}}function M4(t){delete t.pre_context,delete t.context_line,delete t.post_context}function tDe(t,e,n,r){if(e.lineno===void 0||r===void 0){le&&T.error("Cannot resolve context for frame with no lineno or file contents");return}e.pre_context=[];for(let s=w4(t,n);s<t;s++){let i=r[s];if(i===void 0){M4(e),le&&T.error(`Could not find line ${s} in file ${e.filename}`);return}e.pre_context.push(i)}if(r[t]===void 0){M4(e),le&&T.error(`Could not find line ${t} in file ${e.filename}`);return}e.context_line=r[t];let o=k4(t,n);e.post_context=[];for(let s=t+1;s<=o;s++){let i=r[s];if(i===void 0)break;e.post_context.push(i)}}function w4(t,e){return Math.max(1,t-e)}function k4(t,e){return t+e}function L4(t,e){return[w4(t,e),k4(t,e)]}var nDe=((t={})=>{let e=t.frameContextLines!==void 0?t.frameContextLines:$0e;return{name:j0e,processEvent(n){return Q0e(n,e)}}}),V4=nDe;var F4=require("node:worker_threads");var EE;async function SE(){if(EE===void 0)try{EE=!!(await import("node:inspector")).url()}catch{EE=!1}return EE}var rd="__SENTRY_ERROR_LOCAL_VARIABLES__";function G4(t,e,n){let r=0,o=5,s=0;return setInterval(()=>{s===0?r>t&&(o*=2,n(o),o>86400&&(o=86400),s=o):(s-=1,s===0&&e()),r=0},1e3).unref(),()=>{r+=1}}function B4(t){return t!==void 0&&(t.length===0||t==="?"||t==="<anonymous>")}function TE(t,e){return t===e||`Object.${t}`===e||t===`Object.${e}`||B4(t)&&B4(e)}var rDe="LyohIEBzZW50cnkvbm9kZS1jb3JlIDkuNDcuMSAoNDExZTEwMikgfCBodHRwczovL2dpdGh1Yi5jb20vZ2V0c2VudHJ5L3NlbnRyeS1qYXZhc2NyaXB0ICovCmltcG9ydHtTZXNzaW9uIGFzIGV9ZnJvbSJub2RlOmluc3BlY3Rvci9wcm9taXNlcyI7aW1wb3J0e3dvcmtlckRhdGEgYXMgdH1mcm9tIm5vZGU6d29ya2VyX3RocmVhZHMiO2NvbnN0IG49Z2xvYmFsVGhpcyxpPXt9O2NvbnN0IG89Il9fU0VOVFJZX0VSUk9SX0xPQ0FMX1ZBUklBQkxFU19fIjtjb25zdCBhPXQ7ZnVuY3Rpb24gcyguLi5lKXthLmRlYnVnJiZmdW5jdGlvbihlKXtpZighKCJjb25zb2xlImluIG4pKXJldHVybiBlKCk7Y29uc3QgdD1uLmNvbnNvbGUsbz17fSxhPU9iamVjdC5rZXlzKGkpO2EuZm9yRWFjaChlPT57Y29uc3Qgbj1pW2VdO29bZV09dFtlXSx0W2VdPW59KTt0cnl7cmV0dXJuIGUoKX1maW5hbGx5e2EuZm9yRWFjaChlPT57dFtlXT1vW2VdfSl9fSgoKT0+Y29uc29sZS5sb2coIltMb2NhbFZhcmlhYmxlcyBXb3JrZXJdIiwuLi5lKSl9YXN5bmMgZnVuY3Rpb24gYyhlLHQsbixpKXtjb25zdCBvPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSk7aVtuXT1vLnJlc3VsdC5maWx0ZXIoZT0+Imxlbmd0aCIhPT1lLm5hbWUmJiFpc05hTihwYXJzZUludChlLm5hbWUsMTApKSkuc29ydCgoZSx0KT0+cGFyc2VJbnQoZS5uYW1lLDEwKS1wYXJzZUludCh0Lm5hbWUsMTApKS5tYXAoZT0+ZS52YWx1ZT8udmFsdWUpfWFzeW5jIGZ1bmN0aW9uIHIoZSx0LG4saSl7Y29uc3Qgbz1hd2FpdCBlLnBvc3QoIlJ1bnRpbWUuZ2V0UHJvcGVydGllcyIse29iamVjdElkOnQsb3duUHJvcGVydGllczohMH0pO2lbbl09by5yZXN1bHQubWFwKGU9PltlLm5hbWUsZS52YWx1ZT8udmFsdWVdKS5yZWR1Y2UoKGUsW3Qsbl0pPT4oZVt0XT1uLGUpLHt9KX1mdW5jdGlvbiB1KGUsdCl7ZS52YWx1ZSYmKCJ2YWx1ZSJpbiBlLnZhbHVlP3ZvaWQgMD09PWUudmFsdWUudmFsdWV8fG51bGw9PT1lLnZhbHVlLnZhbHVlP3RbZS5uYW1lXT1gPCR7ZS52YWx1ZS52YWx1ZX0+YDp0W2UubmFtZV09ZS52YWx1ZS52YWx1ZToiZGVzY3JpcHRpb24iaW4gZS52YWx1ZSYmImZ1bmN0aW9uIiE9PWUudmFsdWUudHlwZT90W2UubmFtZV09YDwke2UudmFsdWUuZGVzY3JpcHRpb259PmA6InVuZGVmaW5lZCI9PT1lLnZhbHVlLnR5cGUmJih0W2UubmFtZV09Ijx1bmRlZmluZWQ+IikpfWFzeW5jIGZ1bmN0aW9uIGwoZSx0KXtjb25zdCBuPWF3YWl0IGUucG9zdCgiUnVudGltZS5nZXRQcm9wZXJ0aWVzIix7b2JqZWN0SWQ6dCxvd25Qcm9wZXJ0aWVzOiEwfSksaT17fTtmb3IoY29uc3QgdCBvZiBuLnJlc3VsdClpZih0LnZhbHVlPy5vYmplY3RJZCYmIkFycmF5Ij09PXQudmFsdWUuY2xhc3NOYW1lKXtjb25zdCBuPXQudmFsdWUub2JqZWN0SWQ7YXdhaXQgYyhlLG4sdC5uYW1lLGkpfWVsc2UgaWYodC52YWx1ZT8ub2JqZWN0SWQmJiJPYmplY3QiPT09dC52YWx1ZS5jbGFzc05hbWUpe2NvbnN0IG49dC52YWx1ZS5vYmplY3RJZDthd2FpdCByKGUsbix0Lm5hbWUsaSl9ZWxzZSB0LnZhbHVlJiZ1KHQsaSk7cmV0dXJuIGl9bGV0IGY7KGFzeW5jIGZ1bmN0aW9uKCl7Y29uc3QgdD1uZXcgZTt0LmNvbm5lY3RUb01haW5UaHJlYWQoKSxzKCJDb25uZWN0ZWQgdG8gbWFpbiB0aHJlYWQiKTtsZXQgbj0hMTt0Lm9uKCJEZWJ1Z2dlci5yZXN1bWVkIiwoKT0+e249ITF9KSx0Lm9uKCJEZWJ1Z2dlci5wYXVzZWQiLGU9PntuPSEwLGFzeW5jIGZ1bmN0aW9uKGUse3JlYXNvbjp0LGRhdGE6e29iamVjdElkOm59LGNhbGxGcmFtZXM6aX0pe2lmKCJleGNlcHRpb24iIT09dCYmInByb21pc2VSZWplY3Rpb24iIT09dClyZXR1cm47aWYoZj8uKCksbnVsbD09bilyZXR1cm47Y29uc3QgYT1bXTtmb3IobGV0IHQ9MDt0PGkubGVuZ3RoO3QrKyl7Y29uc3R7c2NvcGVDaGFpbjpuLGZ1bmN0aW9uTmFtZTpvLHRoaXM6c309aVt0XSxjPW4uZmluZChlPT4ibG9jYWwiPT09ZS50eXBlKSxyPSJnbG9iYWwiIT09cy5jbGFzc05hbWUmJnMuY2xhc3NOYW1lP2Ake3MuY2xhc3NOYW1lfS4ke299YDpvO2lmKHZvaWQgMD09PWM/Lm9iamVjdC5vYmplY3RJZClhW3RdPXtmdW5jdGlvbjpyfTtlbHNle2NvbnN0IG49YXdhaXQgbChlLGMub2JqZWN0Lm9iamVjdElkKTthW3RdPXtmdW5jdGlvbjpyLHZhcnM6bn19fWF3YWl0IGUucG9zdCgiUnVudGltZS5jYWxsRnVuY3Rpb25PbiIse2Z1bmN0aW9uRGVjbGFyYXRpb246YGZ1bmN0aW9uKCkgeyB0aGlzLiR7b30gPSB0aGlzLiR7b30gfHwgJHtKU09OLnN0cmluZ2lmeShhKX07IH1gLHNpbGVudDohMCxvYmplY3RJZDpufSksYXdhaXQgZS5wb3N0KCJSdW50aW1lLnJlbGVhc2VPYmplY3QiLHtvYmplY3RJZDpufSl9KHQsZS5wYXJhbXMpLnRoZW4oYXN5bmMoKT0+e24mJmF3YWl0IHQucG9zdCgiRGVidWdnZXIucmVzdW1lIil9LGFzeW5jIGU9PntuJiZhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnJlc3VtZSIpfSl9KSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLmVuYWJsZSIpO2NvbnN0IGk9ITEhPT1hLmNhcHR1cmVBbGxFeGNlcHRpb25zO2lmKGF3YWl0IHQucG9zdCgiRGVidWdnZXIuc2V0UGF1c2VPbkV4Y2VwdGlvbnMiLHtzdGF0ZTppPyJhbGwiOiJ1bmNhdWdodCJ9KSxpKXtjb25zdCBlPWEubWF4RXhjZXB0aW9uc1BlclNlY29uZHx8NTA7Zj1mdW5jdGlvbihlLHQsbil7bGV0IGk9MCxvPTUsYT0wO3JldHVybiBzZXRJbnRlcnZhbCgoKT0+ezA9PT1hP2k+ZSYmKG8qPTIsbihvKSxvPjg2NDAwJiYobz04NjQwMCksYT1vKTooYS09MSwwPT09YSYmdCgpKSxpPTB9LDFlMykudW5yZWYoKSwoKT0+e2krPTF9fShlLGFzeW5jKCk9PntzKCJSYXRlLWxpbWl0IGxpZnRlZC4iKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6ImFsbCJ9KX0sYXN5bmMgZT0+e3MoYFJhdGUtbGltaXQgZXhjZWVkZWQuIERpc2FibGluZyBjYXB0dXJpbmcgb2YgY2F1Z2h0IGV4Y2VwdGlvbnMgZm9yICR7ZX0gc2Vjb25kcy5gKSxhd2FpdCB0LnBvc3QoIkRlYnVnZ2VyLnNldFBhdXNlT25FeGNlcHRpb25zIix7c3RhdGU6InVuY2F1Z2h0In0pfSl9fSkoKS5jYXRjaChlPT57cygiRmFpbGVkIHRvIHN0YXJ0IGRlYnVnZ2VyIixlKX0pLHNldEludGVydmFsKCgpPT57fSwxZTQpOw==";function H4(...t){T.log("[LocalVariables]",...t)}var $4=((t={})=>{function e(s,i){let a=(s.stacktrace?.frames||[]).filter(c=>c.function!=="new Promise");for(let c=0;c<a.length;c++){let u=a.length-c-1,l=i[c],d=a[u];if(!d||!l)break;l.vars===void 0||d.in_app===!1||!TE(d.function,l.function)||(d.vars=l.vars)}}function n(s,i){if(i.originalException&&typeof i.originalException=="object"&&rd in i.originalException&&Array.isArray(i.originalException[rd])){for(let a of s.exception?.values||[])e(a,i.originalException[rd]);i.originalException[rd]=void 0}return s}async function r(){let s=await import("node:inspector");s.url()||s.open(0)}function o(s){let i=new F4.Worker(new URL(`data:application/javascript;base64,${rDe}`),{workerData:s,execArgv:[],env:{...process.env,NODE_OPTIONS:void 0}});process.on("exit",()=>{i.terminate()}),i.once("error",a=>{H4("Worker error",a)}),i.once("exit",a=>{H4("Worker exit",a)}),i.unref()}return{name:"LocalVariablesAsync",async setup(s){if(!s.getOptions().includeLocalVariables)return;if(await SE()){T.warn("Local variables capture has been disabled because the debugger was already enabled");return}let a={...t,debug:T.isEnabled()};r().then(()=>{try{o(a)}catch(c){T.error("Failed to start worker",c)}},c=>{T.error("Failed to start inspector",c)})},processEvent(s,i){return n(s,i)}}});function j4(t){if(t!==void 0)return t.slice(-10).reduce((e,n)=>`${e},${n.function},${n.lineno},${n.colno}`,"")}function oDe(t,e){if(e!==void 0)return j4(t(e,1))}function q4(t){let e=[],n=!1;function r(i){e=[],!n&&(n=!0,t(i))}e.push(r);function o(i){e.push(i)}function s(i){let a=e.pop()||r;try{a(i)}catch{r(i)}}return{add:o,next:s}}var mO=class t{constructor(e){this._session=e}static async create(e){if(e)return e;let n=await import("node:inspector");return new t(new n.Session)}configureAndConnect(e,n){this._session.connect(),this._session.on("Debugger.paused",r=>{e(r,()=>{this._session.post("Debugger.resume")})}),this._session.post("Debugger.enable"),this._session.post("Debugger.setPauseOnExceptions",{state:n?"all":"uncaught"})}setPauseOnExceptions(e){this._session.post("Debugger.setPauseOnExceptions",{state:e?"all":"uncaught"})}getLocalVariables(e,n){this._getProperties(e,r=>{let{add:o,next:s}=q4(n);for(let i of r)if(i.value?.objectId&&i.value.className==="Array"){let a=i.value.objectId;o(c=>this._unrollArray(a,i.name,c,s))}else if(i.value?.objectId&&i.value.className==="Object"){let a=i.value.objectId;o(c=>this._unrollObject(a,i.name,c,s))}else i.value&&o(a=>this._unrollOther(i,a,s));s({})})}_getProperties(e,n){this._session.post("Runtime.getProperties",{objectId:e,ownProperties:!0},(r,o)=>{n(r?[]:o.result)})}_unrollArray(e,n,r,o){this._getProperties(e,s=>{r[n]=s.filter(i=>i.name!=="length"&&!isNaN(parseInt(i.name,10))).sort((i,a)=>parseInt(i.name,10)-parseInt(a.name,10)).map(i=>i.value?.value),o(r)})}_unrollObject(e,n,r,o){this._getProperties(e,s=>{r[n]=s.map(i=>[i.name,i.value?.value]).reduce((i,[a,c])=>(i[a]=c,i),{}),o(r)})}_unrollOther(e,n,r){e.value&&("value"in e.value?e.value.value===void 0||e.value.value===null?n[e.name]=`<${e.value.value}>`:n[e.name]=e.value.value:"description"in e.value&&e.value.type!=="function"?n[e.name]=`<${e.value.description}>`:e.value.type==="undefined"&&(n[e.name]="<undefined>")),r(n)}},sDe="LocalVariables",iDe=((t={},e)=>{let n=new mn(20),r,o=!1;function s(a){let c=j4(a.stacktrace?.frames);if(c===void 0)return;let u=n.remove(c);if(u===void 0)return;let l=(a.stacktrace?.frames||[]).filter(d=>d.function!=="new Promise");for(let d=0;d<l.length;d++){let p=l.length-d-1,_=u[d],f=l[p];if(!f||!_)break;_.vars===void 0||f.in_app===!1||!TE(f.function,_.function)||(f.vars=_.vars)}}function i(a){for(let c of a.exception?.values||[])s(c);return a}return{name:sDe,async setupOnce(){let c=j()?.getOptions();if(!c?.includeLocalVariables)return;if(nd<18){T.log("The `LocalVariables` integration is only supported on Node >= v18.");return}if(await SE()){T.warn("Local variables capture has been disabled because the debugger was already enabled");return}mO.create(e).then(l=>{function d(_,{params:{reason:f,data:E,callFrames:S}},g){if(f!=="exception"&&f!=="promiseRejection"){g();return}r?.();let h=oDe(_,E.description);if(h==null){g();return}let{add:O,next:N}=q4(A=>{n.set(h,A),g()});for(let A=0;A<Math.min(S.length,5);A++){let{scopeChain:M,functionName:P,this:J}=S[A],X=M.find(H=>H.type==="local"),Ye=J.className==="global"||!J.className?P:`${J.className}.${P}`;if(X?.object.objectId===void 0)O(H=>{H[A]={function:Ye},N(H)});else{let H=X.object.objectId;O(ae=>l.getLocalVariables(H,De=>{ae[A]={function:Ye,vars:De},N(ae)}))}}N([])}let p=t.captureAllExceptions!==!1;if(l.configureAndConnect((_,f)=>d(c.stackParser,_,f),p),p){let _=t.maxExceptionsPerSecond||50;r=G4(_,()=>{T.log("Local variables rate-limit lifted."),l.setPauseOnExceptions(!0)},f=>{T.log(`Local variables rate-limit exceeded. Disabling capturing of caught exceptions for ${f} seconds.`),l.setPauseOnExceptions(!1)})}o=!0},l=>{T.log("The `LocalVariables` integration failed to start.",l)})},processEvent(a){return o?i(a):a},_getCachedFramesCount(){return n.size},_getFirstCachedFrame(){return n.values()[0]}}}),Y4=iDe;var K4=(t={})=>Xi.major<19?Y4(t):$4(t);var od=require("node:fs"),sd=require("node:path");function Hc(){try{return typeof module<"u"&&typeof module.exports<"u"}catch{return!1}}var EO,aDe="Modules",cDe=typeof __SENTRY_SERVER_MODULES__>"u"?{}:__SENTRY_SERVER_MODULES__,uDe=(()=>({name:aDe,processEvent(t){return t.modules={...t.modules,...W4()},t},getModules:W4})),z4=uDe;function lDe(){try{return require.cache?Object.keys(require.cache):[]}catch{return[]}}function dDe(){return{...cDe,...fDe(),...Hc()?pDe():{}}}function pDe(){let t=require.main?.paths||[],e=lDe(),n={},r=new Set;return e.forEach(o=>{let s=o,i=()=>{let a=s;if(s=(0,sd.dirname)(a),!s||a===s||r.has(a))return;if(t.indexOf(s)<0)return i();let c=(0,sd.join)(a,"package.json");if(r.add(a),!(0,od.existsSync)(c))return i();try{let u=JSON.parse((0,od.readFileSync)(c,"utf8"));n[u.name]=u.version}catch{}};i()}),n}function W4(){return EO||(EO=dDe()),EO}function _De(){try{let t=(0,sd.join)(process.cwd(),"package.json");return JSON.parse((0,od.readFileSync)(t,"utf8"))}catch{return{}}}function fDe(){let t=_De();return{...t.dependencies,...t.devDependencies}}var mDe=2e3;function id(t){Fe(()=>{console.error(t)});let e=j();if(e===void 0){le&&T.warn("No NodeClient was defined, we are exiting the process now."),global.process.exit(1);return}let n=e.getOptions(),r=n?.shutdownTimeout&&n.shutdownTimeout>0?n.shutdownTimeout:mDe;e.close(r).then(o=>{o||le&&T.warn("We reached the timeout for emptying the request buffer, still exiting now!"),global.process.exit(1)},o=>{le&&T.error(o)})}var EDe="OnUncaughtException",X4=(t={})=>{let e={exitEvenIfOtherHandlersAreRegistered:!1,...t};return{name:EDe,setup(n){global.process.on("uncaughtException",SDe(n,e))}}};function SDe(t,e){let r=!1,o=!1,s=!1,i,a=t.getOptions();return Object.assign(c=>{let u=id;e.onFatalError?u=e.onFatalError:a.onFatalError&&(u=a.onFatalError);let d=global.process.listeners("uncaughtException").filter(_=>_.name!=="domainUncaughtExceptionClear"&&_.tag!=="sentry_tracingErrorCallback"&&_._errorHandler!==!0).length===0,p=e.exitEvenIfOtherHandlersAreRegistered||d;r?p&&(s?(le&&T.warn("uncaught exception after calling fatal error shutdown callback - this is bad! forcing shutdown"),id(c)):o||(o=!0,setTimeout(()=>{s||(s=!0,u(i,c))},2e3))):(i=c,r=!0,j()===t&&tn(c,{originalException:c,captureContext:{level:"fatal"},mechanism:{handled:!1,type:"onuncaughtexception"}}),!s&&p&&(s=!0,u(c)))},{_errorHandler:!0})}var TDe="OnUnhandledRejection",gDe=((t={})=>{let e={mode:"warn",...t};return{name:TDe,setup(n){global.process.on("unhandledRejection",hDe(n,e))}}}),J4=gDe;function hDe(t,e){return function(r,o){if(j()!==t)return;let s=e.mode==="strict"?"fatal":"error",i=r&&typeof r=="object"?r._sentry_active_span:void 0;(i?c=>kl(i,c):c=>c())(()=>{tn(r,{originalException:o,captureContext:{extra:{unhandledPromiseRejection:!0},level:s},mechanism:{handled:!1,type:"onunhandledrejection"}})}),ADe(r,e.mode)}}function ADe(t,e){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:";e==="warn"?Fe(()=>{console.warn(n),console.error(t&&typeof t=="object"&&"stack"in t?t.stack:t)}):e==="strict"&&(Fe(()=>{console.warn(n)}),id(t))}var Z4=v(require("node:http"),1);var SO="Spotlight",RDe=((t={})=>{let e={sidecarUrl:t.sidecarUrl||"http://localhost:8969/stream"};return{name:SO,setup(n){try{process.env.NODE_ENV&&process.env.NODE_ENV!=="development"&&T.warn("[Spotlight] It seems you're not in dev mode. Do you really want to have Spotlight enabled?")}catch{}yDe(n,e)}}}),Q4=RDe;function yDe(t,e){let n=ODe(e.sidecarUrl);if(!n)return;let r=0;t.on("beforeEnvelope",o=>{if(r>3){T.warn("[Spotlight] Disabled Sentry -> Spotlight integration due to too many failed requests");return}let s=Ll(o);Ec(()=>{let i=Z4.request({method:"POST",path:n.pathname,hostname:n.hostname,port:n.port,headers:{"Content-Type":"application/x-sentry-envelope"}},a=>{a.statusCode&&a.statusCode>=200&&a.statusCode<400&&(r=0),a.on("data",()=>{}),a.on("end",()=>{}),a.setEncoding("utf8")});i.on("error",()=>{r++,T.warn("[Spotlight] Failed to send envelope to Spotlight Sidecar")}),i.write(s),i.end()})})}function ODe(t){try{return new URL(`${t}`)}catch{T.warn(`[Spotlight] Invalid sidecar URL: ${t}`);return}}var e5=v(require("node:util"),1);var NDe="NodeSystemError";function CDe(t){return!(t instanceof Error)||!("errno"in t)||typeof t.errno!="number"?!1:e5.getSystemErrorMap().has(t.errno)}var t5=(t={})=>({name:NDe,processEvent:(e,n,r)=>{if(!CDe(n.originalException))return e;let o=n.originalException,s={...o};!r.getOptions().sendDefaultPii&&t.includePaths!==!0&&(delete s.path,delete s.dest),e.contexts={...e.contexts,node_system_error:s};for(let i of e.exception?.values||[])i.value&&(o.path&&i.value.includes(o.path)&&(i.value=i.value.replace(`'${o.path}'`,"").trim()),o.dest&&i.value.includes(o.dest)&&(i.value=i.value.replace(`'${o.dest}'`,"").trim()));return e}});var TO=v(require("node:diagnostics_channel"),1);var vDe="ChildProcess",n5=(t={})=>({name:vDe,setup(){TO.channel("child_process").subscribe(e=>{e&&typeof e=="object"&&"process"in e&&IDe(e.process,t)}),TO.channel("worker_threads").subscribe(e=>{e&&typeof e=="object"&&"worker"in e&&PDe(e.worker,t)})}});function IDe(t,e){let n=!1,r;t.on("spawn",()=>{if(t.spawnfile==="/usr/bin/sw_vers"){n=!0;return}r={spawnfile:t.spawnfile},e.includeChildProcessArgs&&(r.spawnargs=t.spawnargs)}).on("exit",o=>{n||(n=!0,o!==null&&o!==0&&In({category:"child_process",message:`Child process exited with code '${o}'`,level:o===0?"info":"warning",data:r}))}).on("error",o=>{n||(n=!0,In({category:"child_process",message:`Child process errored with '${o.message}'`,level:"error",data:r}))})}function PDe(t,e){let n;t.on("online",()=>{n=t.threadId}).on("error",r=>{e.captureWorkerErrors!==!1?tn(r,{mechanism:{type:"instrument",handled:!1,data:{threadId:String(n)}}}):In({category:"worker_thread",message:`Worker thread errored with '${r.message}'`,level:"error",data:{threadId:n}})})}var i5=v(s5(),1);var yO=_4(i5.AsyncLocalStorageContextManager);L();function OO(){On.disable(),On.setLogger({error:T.error,warn:T.warn,info:T.log,debug:T.log,verbose:T.log},lt.DEBUG)}var GDe="ProcessSession",a5=()=>({name:GDe,setupOnce(){tm(),process.on("beforeExit",()=>{Te().getSession()?.status!=="ok"&&Vl()})}});var FDe=v(require("node:http"),1),$De=v(require("node:https"),1),l5=require("node:stream"),d5=require("node:zlib");var Io=v(require("node:net"),1),CO=v(require("node:tls"),1);var NO=v(require("node:http"),1);var Zr=Symbol("AgentBaseInternalState"),RE=class extends NO.Agent{constructor(e){super(e),this[Zr]={}}isSecureEndpoint(e){if(e){if(typeof e.secureEndpoint=="boolean")return e.secureEndpoint;if(typeof e.protocol=="string")return e.protocol==="https:"}let{stack:n}=new Error;return typeof n!="string"?!1:n.split(`
150
+ `).some(r=>r.indexOf("(https.js:")!==-1||r.indexOf("node:https:")!==-1)}createSocket(e,n,r){let o={...n,secureEndpoint:this.isSecureEndpoint(n)};Promise.resolve().then(()=>this.connect(e,o)).then(s=>{if(s instanceof NO.Agent)return s.addRequest(e,o);this[Zr].currentSocket=s,super.createSocket(e,n,r)},r)}createConnection(){let e=this[Zr].currentSocket;if(this[Zr].currentSocket=void 0,!e)throw new Error("No socket was returned in the `connect()` function");return e}get defaultPort(){return this[Zr].defaultPort??(this.protocol==="https:"?443:80)}set defaultPort(e){this[Zr]&&(this[Zr].defaultPort=e)}get protocol(){return this[Zr].protocol??(this.isSecureEndpoint()?"https:":"http:")}set protocol(e){this[Zr]&&(this[Zr].protocol=e)}};function yE(...t){T.log("[https-proxy-agent:parse-proxy-response]",...t)}function c5(t){return new Promise((e,n)=>{let r=0,o=[];function s(){let l=t.read();l?u(l):t.once("readable",s)}function i(){t.removeListener("end",a),t.removeListener("error",c),t.removeListener("readable",s)}function a(){i(),yE("onend"),n(new Error("Proxy connection ended before receiving CONNECT response"))}function c(l){i(),yE("onerror %o",l),n(l)}function u(l){o.push(l),r+=l.length;let d=Buffer.concat(o,r),p=d.indexOf(`\r
151
151
  \r
152
- `);if(p===-1){RE("have not received end of HTTP headers yet..."),s();return}let _=d.subarray(0,p).toString("ascii").split(`\r
153
- `),f=_.shift();if(!f)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let E=f.split(" "),S=+(E[1]||0),g=E.slice(2).join(" "),h={};for(let O of _){if(!O)continue;let N=O.indexOf(":");if(N===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${O}"`));let R=O.slice(0,N).toLowerCase(),M=O.slice(N+1).trimStart(),P=h[R];typeof P=="string"?h[R]=[P,M]:Array.isArray(P)?P.push(M):h[R]=M}RE("got proxy server response: %o %o",f,h),i(),e({connect:{statusCode:S,statusText:g,headers:h},buffered:d})}t.on("error",c),t.on("end",a),s()})}function ad(...t){T.log("[https-proxy-agent]",...t)}var cd=class extends AE{static __initStatic(){this.protocols=["http","https"]}constructor(e,n){super(n),this.options={},this.proxy=typeof e=="string"?new URL(e):e,this.proxyHeaders=n?.headers??{},ad("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?i5(n,"headers"):null,host:r,port:o}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){ad("Creating `tls.Socket`: %o",this.connectOpts);let p=this.connectOpts.servername||this.connectOpts.host;o=NO.connect({...this.connectOpts,servername:p&&Io.isIP(p)?void 0:p})}else ad("Creating `net.Socket`: %o",this.connectOpts),o=Io.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Io.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
152
+ `);if(p===-1){yE("have not received end of HTTP headers yet..."),s();return}let _=d.subarray(0,p).toString("ascii").split(`\r
153
+ `),f=_.shift();if(!f)return t.destroy(),n(new Error("No header received from proxy CONNECT response"));let E=f.split(" "),S=+(E[1]||0),g=E.slice(2).join(" "),h={};for(let O of _){if(!O)continue;let N=O.indexOf(":");if(N===-1)return t.destroy(),n(new Error(`Invalid header from proxy CONNECT response: "${O}"`));let A=O.slice(0,N).toLowerCase(),M=O.slice(N+1).trimStart(),P=h[A];typeof P=="string"?h[A]=[P,M]:Array.isArray(P)?P.push(M):h[A]=M}yE("got proxy server response: %o %o",f,h),i(),e({connect:{statusCode:S,statusText:g,headers:h},buffered:d})}t.on("error",c),t.on("end",a),s()})}function ad(...t){T.log("[https-proxy-agent]",...t)}var cd=class extends RE{static __initStatic(){this.protocols=["http","https"]}constructor(e,n){super(n),this.options={},this.proxy=typeof e=="string"?new URL(e):e,this.proxyHeaders=n?.headers??{},ad("Creating new HttpsProxyAgent instance: %o",this.proxy.href);let r=(this.proxy.hostname||this.proxy.host).replace(/^\[|\]$/g,""),o=this.proxy.port?parseInt(this.proxy.port,10):this.proxy.protocol==="https:"?443:80;this.connectOpts={ALPNProtocols:["http/1.1"],...n?u5(n,"headers"):null,host:r,port:o}}async connect(e,n){let{proxy:r}=this;if(!n.host)throw new TypeError('No "host" provided');let o;if(r.protocol==="https:"){ad("Creating `tls.Socket`: %o",this.connectOpts);let p=this.connectOpts.servername||this.connectOpts.host;o=CO.connect({...this.connectOpts,servername:p&&Io.isIP(p)?void 0:p})}else ad("Creating `net.Socket`: %o",this.connectOpts),o=Io.connect(this.connectOpts);let s=typeof this.proxyHeaders=="function"?this.proxyHeaders():{...this.proxyHeaders},i=Io.isIPv6(n.host)?`[${n.host}]`:n.host,a=`CONNECT ${i}:${n.port} HTTP/1.1\r
154
154
  `;if(r.username||r.password){let p=`${decodeURIComponent(r.username)}:${decodeURIComponent(r.password)}`;s["Proxy-Authorization"]=`Basic ${Buffer.from(p).toString("base64")}`}s.Host=`${i}:${n.port}`,s["Proxy-Connection"]||(s["Proxy-Connection"]=this.keepAlive?"Keep-Alive":"close");for(let p of Object.keys(s))a+=`${p}: ${s[p]}\r
155
- `;let c=s5(o);o.write(`${a}\r
156
- `);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200){if(e.once("socket",wDe),n.secureEndpoint){ad("Upgrading socket connection to TLS");let p=n.servername||n.host;return NO.connect({...i5(n,"host","path","port"),socket:o,servername:Io.isIP(p)?void 0:p})}return o}o.destroy();let d=new Io.Socket({writable:!1});return d.readable=!0,e.once("socket",p=>{ad("Replaying proxy buffer for failed request"),p.push(l),p.push(null)}),d}};cd.__initStatic();function wDe(t){t.resume()}function i5(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var BDe=1024*32;function GDe(t){return new a5.Readable({read(){this.push(t),this.push(null)}})}function u5(t){let e;try{e=new URL(t.url)}catch{return Fe(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),Gl(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=HDe(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?VDe:kDe,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new cd(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=FDe(t,t.httpModule??o,i);return Gl(t,a)}function HDe(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function FDe(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(u){return new Promise((l,d)=>{Ec(()=>{let p=GDe(u.body),_={...t.headers};u.body.length>BDe&&(_["content-encoding"]="gzip",p=p.pipe((0,c5.createGzip)()));let f=e.request({method:"POST",agent:n,headers:_,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let S=E.headers["retry-after"]??null,g=E.headers["x-sentry-rate-limits"]??null;l({statusCode:E.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(g)?g[0]||null:g}})});f.on("error",d),p.pipe(f)})})}}var $De=new Set(["false","f","n","no","off","0"]),jDe=new Set(["true","t","y","yes","on","1"]);function yE(t,e){let n=String(t).toLowerCase();return $De.has(n)?!1:jDe.has(n)?!0:e?.strict?null:!!t}var OE=require("node:path");function l5(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function d5(t=process.argv[1]?AR(process.argv[1]):process.cwd(),e=OE.sep==="\\"){let n=e?l5(t):t;return r=>{if(!r)return;let o=e?l5(r):r,{dir:s,base:i,ext:a}=OE.posix.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let l=s.slice(n.length+1).replace(/\//g,".");return l?`${l}:${c}`:c}return c}}function p5(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(Q.SENTRY_RELEASE?.id)return Q.SENTRY_RELEASE.id;let e=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_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 e||n||r||t}var _5=Nf(MR(d5()));var f5=v(require("node:os"),1);L();var m5=v(de(),1);var CE=require("worker_threads");var qDe=6e4,NE=class extends Bl{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||f5.hostname(),r={...e,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,m5.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Hi(r,"node"),T.log(`Initializing Sentry: process: ${process.pid}, thread: ${CE.isMainThread?"main":`worker-${CE.threadId}`}.`),super(r);let{enableLogs:o,_experiments:s}=this.getOptions();(o??s?.enableLogs)&&(this._logOnExitFlushListener=()=>{Gi(this)},n&&this.on("beforeCaptureLog",a=>{a.attributes={...a.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=Oe,r=ne.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}close(e){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(e)}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{le&&T.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??qDe).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_getTraceInfoFromScope(e){return e?a4(this,e):[void 0,void 0]}};var E5=v(mf(),1),S5=v(require("module"),1),YDe={};function T5(){let[t=0,e=0]=process.versions.node.split(".").map(Number);if(t>=21||t===20&&e>=6||t===18&&e>=19){if(!Q._sentryEsmLoaderHookRegistered)try{let{addHookMessagePort:n}=(0,E5.createAddHookMessageChannel)();S5.default.register("import-in-the-middle/hook.mjs",YDe.url,{data:{addHookMessagePort:n,include:[]},transferList:[n]})}catch(n){T.warn("Failed to register ESM hook",n)}}else Fe(()=>{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.`)})}function vE(){return[am(),sm(),cm(),um(),Z4(),lm(),T4(),y4(),K4(),W4(),U4(),j4(),v4(),Q4(),o5(),Y4()]}function CO(t={}){return KDe(t,vE)}function KDe(t={},e){let n=WDe(t,e);n.debug===!0&&(le?T.enable():Fe(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),!Hc()&&n.registerEsmLoaderHooks!==!1&&T5(),u4(),ie().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===EO)&&n.integrations.push(X4({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Hi(n,"node-core");let o=new NE(n);return ie().setClient(o),o.init(),T.log(`Running in ${Hc()?"CommonJS":"ESM"} mode.`),o.startClientReportTracking(),JDe(),Z2(o),c4(o),o}function vO(){if(!le)return;let t=n4(),e=["SentryContextManager","SentryPropagator"];yt()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||T.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||T.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 WDe(t,e){let n=zDe(t.release),r=t.spotlight??yE(process.env.SENTRY_SPOTLIGHT,{strict:!0})??process.env.SENTRY_SPOTLIGHT,o=XDe(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??u5,stackParser:IA(t.stackParser||_5),release:n,tracesSampleRate:o,spotlight:r,debug:yE(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:lR({defaultIntegrations:a,integrations:i})}}function zDe(t){if(t!==void 0)return t;let e=p5();if(e!==void 0)return e}function XDe(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function JDe(){if(yE(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=Pl(t,e);ie().setPropagationContext(n)}}function Pe(t,e){t.setAttribute(ge,e)}var IO="Http",g5="@opentelemetry_sentry-patched/instrumentation-http",ZDe=F(`${IO}.sentry`,t=>new zi(t)),QDe=F(IO,t=>{let e=new h5.HttpInstrumentation(t);try{e._diag=yn.createComponentLogger({namespace:g5}),e.instrumentationName=g5}catch{}return e});function eUe(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!yt(e)&&Xi.major>=22)}var A5=(t={})=>{let e=t.dropSpansForIncomingRequestStatusCodes??[[401,404],[300,399]];return{name:IO,setupOnce(){let n=eUe(t,j()?.getOptions());if(ZDe({...t,extractIncomingTraceFromHeader:!n,propagateTraceInOutgoingRequests:!n}),n){let r=rUe(t);QDe(r)}},processEvent(n){if(n.type==="transaction"){let r=n.contexts?.trace?.data?.["http.response.status_code"];if(typeof r=="number"&&e.some(o=>{if(typeof o=="number")return o===r;let[s,i]=o;return r>=s&&r<=i}))return null}return n}}};function tUe(t){return"outputData"in t&&"outputSize"in t&&!("client"in t)&&!("statusCode"in t)}function nUe(t){return t.headers["next-router-prefetch"]==="1"}function rUe(t={}){return{...t.instrumentation?._experimentalConfig,disableIncomingRequestInstrumentation:t.disableIncomingRequestSpans,ignoreOutgoingRequestHook:n=>{let r=Bc(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},ignoreIncomingRequestHook:n=>{let r=n.url,o=n.method?.toUpperCase();if(o==="OPTIONS"||o==="HEAD")return!0;let s=t.ignoreIncomingRequests;return!!(r&&s?.(r,n))},requireParentforOutgoingSpans:!1,requireParentforIncomingSpans:!1,requestHook:(n,r)=>{Pe(n,"auto.http.otel.http"),!tUe(r)&&nUe(r)&&n.setAttribute("sentry.http.prefetch",!0),t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}var b5=v(P5(),1);var M5="NodeFetch",iUe=F(M5,b5.UndiciInstrumentation,t=>dUe(t)),aUe=F(`${M5}.sentry`,Ji,t=>t),cUe=((t={})=>({name:"NodeFetch",setupOnce(){lUe(t,j()?.getOptions())&&iUe(t),aUe(t)}})),L5=cUe;function uUe(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e.slice(1)}`:`${n}${e}`}function lUe(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&yt(e)}function dUe(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=uUe(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:()=>({[ge]:"auto.http.otel.node_fetch"})}}var z5=v($5(),1);var eo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;L();var kE=v(fe(),1),to=v(de(),1);Re();var Wn;(function(t){let e="express.type";t.EXPRESS_TYPE=e;let n="express.name";t.EXPRESS_NAME=n})(Wn||(Wn={}));var Po;(function(t){let e="router";t.ROUTER=e;let n="middleware";t.MIDDLEWARE=n;let r="request_handler";t.REQUEST_HANDLER=r})(Po||(Po={}));var DO=Symbol("express-layer-patched"),Os="__ot_middlewares";var q5=(t,e)=>{Array.isArray(t[Os])===!1&&Object.defineProperty(t,Os,{enumerable:!1,value:[]}),e!==void 0&&t[Os].push(e)},Y5=(t,e)=>{let n=e.handle?.stack?.[0];return n?.route?.path?`${t}${n.route.path}`:n?.handle?.stack?Y5(t,n):t},K5=(t,e,n)=>{if(e.name==="router"){let r=Y5("",e),o=r||n||t||"/";return{attributes:{[Wn.EXPRESS_NAME]:o,[Wn.EXPRESS_TYPE]:Po.ROUTER},name:`router - ${o}`}}else return e.name==="bound dispatch"||e.name==="handle"?{attributes:{[Wn.EXPRESS_NAME]:(t||n)??"request handler",[Wn.EXPRESS_TYPE]:Po.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[Wn.EXPRESS_NAME]:e.name,[Wn.EXPRESS_TYPE]:Po.MIDDLEWARE},name:`middleware - ${e.name}`}},yUe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},W5=(t,e,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(e))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(yUe(t,r))return!0}catch{}return!1},UO=t=>t instanceof Error?[t,t.message]:[String(t),String(t)],UE=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>j5(n)||"").join(","):j5(e)},j5=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()};var OUe="0.1.0",NUe="@sentry/instrumentation-express-v5",wE=class extends to.InstrumentationBase{constructor(e={}){super(NUe,OUe,e)}init(){return[new to.InstrumentationNodeModuleDefinition("express",[">=5.0.0"],e=>this._setup(e),e=>this._tearDown(e))]}_setup(e){let n=e.Router.prototype;return(0,to.isWrapped)(n.route)&&this._unwrap(n,"route"),this._wrap(n,"route",this._getRoutePatch()),(0,to.isWrapped)(n.use)&&this._unwrap(n,"use"),this._wrap(n,"use",this._getRouterUsePatch()),(0,to.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch()),e}_tearDown(e){if(e===void 0)return;let n=e.Router.prototype;this._unwrap(n,"route"),this._unwrap(n,"use"),this._unwrap(e.application,"use")}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,UE(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,UE(o)),s}}}_getAppUsePatch(){let e=this;return function(n){return function(...o){let s=this.router,i=n.apply(this,o);if(s){let a=s.stack[s.stack.length-1];e._applyPatch(a,UE(o))}return i}}}_applyPatch(e,n){let r=this;e[DO]!==!0&&(e[DO]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){q5(i,n);let c=i[Os].filter(R=>R!=="/"&&R!=="/*").join("").replace(/\/{2,}/g,"/"),u=c.length>0?c:void 0,l={[ql]:u},d=K5(c,e,n),p=d.attributes[Wn.EXPRESS_TYPE],_=(0,kE.getRPCMetadata)(K.active());if(_?.type===kE.RPCType.HTTP&&(_.route=u),W5(d.name,p,r.getConfig()))return p===Po.MIDDLEWARE&&i[Os].pop(),o.apply(this,arguments);if(ne.getSpan(K.active())===void 0)return o.apply(this,arguments);let f=r._getSpanName({request:i,layerType:p,route:c},d.name),E=r.tracer.startSpan(f,{attributes:Object.assign(l,d.attributes)}),{requestHook:S}=r.getConfig();S&&(0,to.safeExecuteInTheMiddle)(()=>S(E,{request:i,layerType:p,route:c}),R=>{R&&yn.error("express instrumentation: request hook failed",R)},!0);let g=!1;d.attributes[Wn.EXPRESS_TYPE]!==Po.MIDDLEWARE&&(E.end(),g=!0);let h=()=>{g===!1&&(g=!0,E.end())},O=Array.from(arguments),N=O.findIndex(R=>typeof R=="function");N>=0&&(arguments[N]=function(){let R=arguments[0],M=![void 0,null,"route","router"].includes(R);if(!g&&M){let[J,X]=UO(R);E.recordException(J),E.setStatus({code:ve.ERROR,message:X})}return g===!1&&(g=!0,i.res?.removeListener("finish",h),E.end()),i.route&&M||i[Os].pop(),O[N].apply(this,arguments)});try{return o.apply(this,arguments)}catch(R){let[M,P]=UO(R);throw E.recordException(M),E.setStatus({code:ve.ERROR,message:P}),R}finally{g||a.once("finish",h)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(e,n)??n}catch(o){return yn.error("express instrumentation: error calling span name rewrite hook",o),n}}};var X5="Express",CUe="Express-V5";function J5(t){Pe(t,"auto.http.otel.express");let e=q(t).data,n=e["express.type"];n&&t.setAttribute(re,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function Z5(t,e){if(Te()===Hr())return eo&&T.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";Te().setTransactionName(`${r} ${t.route}`)}return e}var Q5=F(X5,()=>new z5.ExpressInstrumentation({requestHook:t=>J5(t),spanNameHook:(t,e)=>Z5(t,e)})),e3=F(CUe,()=>new wE({requestHook:t=>J5(t),spanNameHook:(t,e)=>Z5(t,e)})),vUe=(()=>({name:X5,setupOnce(){Q5(),e3()}})),kO=vUe;var qO=v(require("node:diagnostics_channel"),1);var $O=v(require("node:diagnostics_channel"),1);L();var HE=v(fe(),1),M3=v(de(),1);Re();var R3=v(_3(),1);var md=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var UUe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ed=t=>t.replace(/[[\]\\-]/g,"\\$&"),wUe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),f3=t=>t.join(""),m3=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],s=n+1,i=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;s<t.length;){let E=t.charAt(s);if((E==="!"||E==="^")&&s===n+1){u=!0,s++;continue}if(E==="]"&&i&&!c){l=s+1;break}if(i=!0,E==="\\"&&!c){c=!0,s++;continue}if(E==="["&&!c){for(let[S,[g,h,O]]of Object.entries(UUe))if(t.startsWith(S,s)){if(d)return["$.",!1,t.length-n,!0];s+=S.length,O?o.push(g):r.push(g),a=a||h;continue e}}if(c=!1,d){E>d?r.push(Ed(d)+"-"+Ed(E)):E===d&&r.push(Ed(E)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(Ed(E+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=E,s+=2;continue}r.push(Ed(E)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let E=r[0].length===2?r[0].slice(-1):r[0];return[wUe(E),!1,l-n,!1]}let p="["+(u?"^":"")+f3(r)+"]",_="["+(u?"":"^")+f3(o)+"]";return[r.length&&o.length?"("+p+"|"+_+")":r.length?p:_,a,l-n,!0]};var Ns=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Sn,kUe=new Set(["!","?","+","*","@"]),GO=t=>kUe.has(t),E3=t=>GO(t.type),VUe=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),BUe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),GUe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),S3=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),HUe="(?!(?:^|/)\\.\\.?(?:$|/))",VE="(?!\\.)",FUe=new Set(["[","."]),$Ue=new Set(["..","."]),jUe=new Set("().*{}+?[]^$\\!"),qUe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),HO="[^/]",T3=HO+"*?",g3=HO+"+?",Qi=class{type;#n;#r;#o=!1;#e=[];#t;#a;#u;#c=!1;#s;#i;#l=!1;constructor(e,n,r={}){this.type=e,e&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#i!==void 0?this.#i:this.type?this.#i=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#i=this.#e.map(e=>String(e)).join("")}#S(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let n=e,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof Sn&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let e=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let n=0;n<this.#a;n++){let r=e.#e[n];if(!(r instanceof Sn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new Sn(this.type,e);for(let r of this.#e)n.copyIn(r);return n}static#d(e,n,r,o,s){let i=o.maxExtglobRecursion??2,a=!1,c=!1,u=-1,l=!1;if(n.type===null){let E=r,S="";for(;E<e.length;){let g=e.charAt(E++);if(a||g==="\\"){a=!a,S+=g;continue}if(c){E===u+1?(g==="^"||g==="!")&&(l=!0):g==="]"&&!(E===u+2&&l)&&(c=!1),S+=g;continue}else if(g==="["){c=!0,u=E,l=!1,S+=g;continue}if(!o.noext&&GO(g)&&e.charAt(E)==="("&&s<=i){n.push(S),S="";let O=new Sn(g,n);E=Sn.#d(e,O,E,o,s+1),n.push(O);continue}S+=g}return n.push(S),E}let d=r+1,p=new Sn(null,n),_=[],f="";for(;d<e.length;){let E=e.charAt(d++);if(a||E==="\\"){a=!a,f+=E;continue}if(c){d===u+1?(E==="^"||E==="!")&&(l=!0):E==="]"&&!(d===u+2&&l)&&(c=!1),f+=E;continue}else if(E==="["){c=!0,u=d,l=!1,f+=E;continue}if(GO(E)&&e.charAt(d)==="("&&(s<=i||n&&n.#p(E))){let g=n&&n.#p(E)?0:1;p.push(f),f="";let h=new Sn(E,p);p.push(h),d=Sn.#d(e,h,d,o,s+g);continue}if(E==="|"){p.push(f),f="",_.push(p),p=new Sn(null,n);continue}if(E===")")return f===""&&n.#e.length===0&&(n.#l=!0),p.push(f),f="",n.push(..._,p),d;f+=E}return n.type=null,n.#r=void 0,n.#e=[e.substring(r-1)],d}#T(e){return this.#f(e,BUe)}#f(e,n=VUe){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(e,n=GUe){return!!n.get(this.type)?.includes(e)}#g(e,n){let r=e.#e[0],o=new Sn(null,r,this.options);o.#e.push(""),r.push(o),this.#m(e,n)}#m(e,n){let r=e.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#i=void 0}#h(e){return!!S3.get(this.type)?.has(e)}#A(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#h(n.type)}#R(e){let n=S3.get(this.type),r=e.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=o,this.#i=void 0,this.#l=!1}#_(){if(E3(this)){let e=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#_(),this.#f(o)?(n=!1,this.#m(o,r)):this.#T(o)?(n=!1,this.#g(o,r)):this.#A(o)&&(n=!1,this.#R(o)))}}while(!n&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#_();this.#i=void 0}static fromGlob(e,n={}){let r=new Sn(null,void 0,n);return Sn.#d(e,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){let n=e??!!this.#s.dot;if(this.#n===this&&(this.#_(),this.#S()),!E3(this)){let c=this.isStart()&&this.isEnd(),u=this.#e.map(_=>{let[f,E,S,g]=typeof _=="string"?Sn.#y(_,this.#r,c):_.toRegExpSource(e);return this.#r=this.#r||S,this.#o=this.#o||g,f}).join(""),l="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&$Ue.has(this.#e[0]))){let f=FUe,E=n&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),S=!n&&!e&&f.has(u.charAt(0));l=E?HUe:S?VE:""}let d="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[l+u+d,Ns(u),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#E(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#e=[c],u.type=null,u.#r=void 0,[c,Ns(this.toString()),!1,!1]}let i=!r||e||n||!VE?"":this.#E(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?VE:"")+g3;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?VE:"")+T3+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;a=o+s+c}return[a,Ns(s),this.#r=!!this.#r,this.#o]}#E(e){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,s,i]=n.toRegExpSource(e);return this.#o=this.#o||i,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#y(e,n,r=!1){let o=!1,s="",i=!1,a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(o){o=!1,s+=(jUe.has(u)?"\\":"")+u,a=!1;continue}if(u==="\\"){c===e.length-1?s+="\\\\":o=!0;continue}if(u==="["){let[l,d,p,_]=m3(e,c);if(p){s+=l,i=i||d,c+=p-1,n=n||_,a=!1;continue}}if(u==="*"){if(a)continue;a=!0,s+=r&&/^[*]+$/.test(e)?g3:T3,n=!0;continue}else a=!1;if(u==="?"){s+=HO,n=!0;continue}s+=qUe(u)}return[s,Ns(e),!!n,i]}};Sn=Qi;var FO=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var bt=(t,e,n={})=>(md(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Wc(e,n).match(t)),YUe=/^\*+([^+@!?\*\[\(]*)$/,KUe=t=>e=>!e.startsWith(".")&&e.endsWith(t),WUe=t=>e=>e.endsWith(t),zUe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),XUe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),JUe=/^\*+\.\*+$/,ZUe=t=>!t.startsWith(".")&&t.includes("."),QUe=t=>t!=="."&&t!==".."&&t.includes("."),ewe=/^\.\*+$/,twe=t=>t!=="."&&t!==".."&&t.startsWith("."),nwe=/^\*+$/,rwe=t=>t.length!==0&&!t.startsWith("."),owe=t=>t.length!==0&&t!=="."&&t!=="..",swe=/^\?+([^+@!?\*\[\(]*)?$/,iwe=([t,e=""])=>{let n=y3([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},awe=([t,e=""])=>{let n=O3([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},cwe=([t,e=""])=>{let n=O3([t]);return e?r=>n(r)&&r.endsWith(e):n},uwe=([t,e=""])=>{let n=y3([t]);return e?r=>n(r)&&r.endsWith(e):n},y3=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},O3=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},N3=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",h3={win32:{sep:"\\"},posix:{sep:"/"}},lwe=N3==="win32"?h3.win32.sep:h3.posix.sep;bt.sep=lwe;var Yt=Symbol("globstar **");bt.GLOBSTAR=Yt;var dwe="[^/]",pwe=dwe+"*?",_we="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",fwe="(?:(?!(?:\\/|^)\\.).)*?",mwe=(t,e={})=>n=>bt(n,t,e);bt.filter=mwe;var zn=(t,e={})=>Object.assign({},t,e),Ewe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return bt;let e=bt;return Object.assign((r,o,s={})=>e(r,o,zn(t,s)),{Minimatch:class extends e.Minimatch{constructor(o,s={}){super(o,zn(t,s))}static defaults(o){return e.defaults(zn(t,o)).Minimatch}},AST:class extends e.AST{constructor(o,s,i={}){super(o,s,zn(t,i))}static fromGlob(o,s={}){return e.AST.fromGlob(o,zn(t,s))}},unescape:(r,o={})=>e.unescape(r,zn(t,o)),escape:(r,o={})=>e.escape(r,zn(t,o)),filter:(r,o={})=>e.filter(r,zn(t,o)),defaults:r=>e.defaults(zn(t,r)),makeRe:(r,o={})=>e.makeRe(r,zn(t,o)),braceExpand:(r,o={})=>e.braceExpand(r,zn(t,o)),match:(r,o,s={})=>e.match(r,o,zn(t,s)),sep:e.sep,GLOBSTAR:Yt})};bt.defaults=Ewe;var C3=(t,e={})=>(md(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,R3.default)(t));bt.braceExpand=C3;var Swe=(t,e={})=>new Wc(t,e).makeRe();bt.makeRe=Swe;var Twe=(t,e,n={})=>{let r=new Wc(e,n);return t=t.filter(o=>r.match(o)),r.options.nonull&&!t.length&&t.push(e),t};bt.match=Twe;var A3=/[?*]|[+@!]\(.*?\)|\[|\]/,gwe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Wc=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){md(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||N3,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!A3.test(s[2]))&&!A3.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(u)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let o=0;o<e[r].length;o++)e[r][o]==="**"&&(e[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,o)=>{let s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let s=e[o];o===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let a=r[o+1],c=r[o+2],u=r[o+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(o,1);let l=r.slice(0);l[o]="**",e.push(l),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){let a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let o=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(o){e[n]=[],e[r]=o;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let o=0,s=0,i=[],a="";for(;o<e.length&&s<n.length;)if(e[o]===n[s])i.push(a==="b"?n[s]:e[o]),o++,s++;else if(r&&e[o]==="**"&&n[s]===e[o+1])i.push(e[o]),o++;else if(r&&n[s]==="**"&&e[o]===n[s+1])i.push(n[s]),s++;else if(e[o]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",i.push(e[o]),o++,s++}else if(n[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(a==="a")return!1;a="b",i.push(n[s]),o++,s++}else return!1;return e.length===n.length&&i}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let o=0;o<e.length&&e.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let o=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),c=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),l=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),d=c?3:a?0:void 0,p=l?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[_,f]=[e[d],n[p]];_.toLowerCase()===f.toLowerCase()&&(n[p]=_,s=p,o=d)}}let{optimizationLevel:i=1}=this.options;return i>=2&&(e=this.levelTwoFileOptimize(e)),n.includes(Yt)?this.#n(e,n,r,o,s):this.#o(e,n,r,o,s)}#n(e,n,r,o,s){let i=n.indexOf(Yt,s),a=n.lastIndexOf(Yt),[c,u,l]=r?[n.slice(s,i),n.slice(i+1),[]]:[n.slice(s,i),n.slice(i+1,a),n.slice(a+1)];if(c.length){let h=e.slice(o,o+c.length);if(!this.#o(h,c,r,0,0))return!1;o+=c.length}let d=0;if(l.length){if(l.length+o>e.length)return!1;let h=e.length-l.length;if(this.#o(e,l,r,h,0))d=l.length;else{if(e[e.length-1]!==""||o+l.length===e.length||(h--,!this.#o(e,l,r,h,0)))return!1;d=l.length+1}}if(!u.length){let h=!!d;for(let O=o;O<e.length-d;O++){let N=String(e[O]);if(h=!0,N==="."||N===".."||!this.options.dot&&N.startsWith("."))return!1}return r||h}let p=[[[],0]],_=p[0],f=0,E=[0];for(let h of u)h===Yt?(E.push(f),_=[[],0],p.push(_)):(_[0].push(h),f++);let S=p.length-1,g=e.length-d;for(let h of p)h[1]=g-(E[S--]+h[0].length);return!!this.#r(e,p,o,0,r,0,!!d)}#r(e,n,r,o,s,i,a){let c=n[o];if(!c){for(let d=r;d<e.length;d++){a=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,l]=c;for(;r<=l;){if(this.#o(e.slice(0,r+u.length),u,s,r,0)&&i<this.maxGlobstarRecursion){let _=this.#r(e,n,r+u.length,o+1,s,i+1,a);if(_!==!1)return _}let p=e[r];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;r++}return s||null}#o(e,n,r,o,s){let i,a,c,u;for(i=o,a=s,u=e.length,c=n.length;i<u&&a<c;i++,a++){this.debug("matchOne loop");let l=n[a],d=e[i];if(this.debug(n,l,d),l===!1||l===Yt)return!1;let p;if(typeof l=="string"?(p=d===l,this.debug("string match",l,d,p)):(p=l.test(d),this.debug("pattern match",l,d,p)),!p)return!1}if(i===u&&a===c)return!0;if(i===u)return r;if(a===c)return i===u-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return C3(this.pattern,this.options)}parse(e){md(e);let n=this.options;if(e==="**")return Yt;if(e==="")return"";let r,o=null;(r=e.match(nwe))?o=n.dot?owe:rwe:(r=e.match(YUe))?o=(n.nocase?n.dot?XUe:zUe:n.dot?WUe:KUe)(r[1]):(r=e.match(swe))?o=(n.nocase?n.dot?awe:iwe:n.dot?cwe:uwe)(r):(r=e.match(JUe))?o=n.dot?QUe:ZUe:(r=e.match(ewe))&&(o=twe);let s=Qi.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?pwe:n.dot?_we:fwe,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let u=c.map(l=>{if(l instanceof RegExp)for(let d of l.flags.split(""))o.add(d);return typeof l=="string"?gwe(l):l===Yt?Yt:l._src});return u.forEach((l,d)=>{let p=u[d+1],_=u[d-1];l!==Yt||_===Yt||(_===void 0?p!==void 0&&p!==Yt?u[d+1]="(?:\\/|"+r+"\\/)?"+p:u[d]=r:p===void 0?u[d-1]=_+"(?:\\/|"+r+")?":p!==Yt&&(u[d-1]=_+"(?:\\/|\\/"+r+"\\/)"+p,u[d+1]=Yt))}),u.filter(l=>l!==Yt).join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],u=o;if(r.matchBase&&c.length===1&&(u=[i]),this.matchOne(u,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return bt.defaults(e).Minimatch}};bt.AST=Qi;bt.Minimatch=Wc;bt.escape=FO;bt.unescape=Ns;var v3="@fastify/otel",Awe="0.8.0",Rwe=">=4.0.0 <6",I3=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],be={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Cs={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},bo="anonymous",nn=Symbol("fastify otel instance"),vs=Symbol("fastify otel request spans"),Sd=Symbol("fastify otel request context"),P3=Symbol("fastify otel addhook original"),b3=Symbol("fastify otel setnotfound original"),BE=Symbol("fastify otel ignore path"),GE=class extends M3.InstrumentationBase{constructor(e){if(super(v3,Awe,e),this.servername=e?.servername??process.env.OTEL_SERVICE_NAME??"fastify",this[BE]=null,this._logger=yn.createComponentLogger({namespace:v3}),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=bt;this[BE]=o=>typeof n=="function"?n(o):r(o.url,n)}}enable(){if(this._handleInitialization===void 0&&this.getConfig().registerOnInitialization){let e=this.plugin();this._handleInitialization=n=>{n.fastify.register(e)},$O.default.subscribe("fastify.initialization",this._handleInitialization)}return super.enable()}disable(){return this._handleInitialization&&($O.default.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:Rwe,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(nn,e),r.decorate(P3,r.addHook),r.decorate(b3,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let p=this[Sd];return{span:this[vs],tracer:e.tracer,context:p,inject:(f,E)=>Xt.inject(p,f,E),extract:(f,E)=>Xt.extract(p,f,E)}}),r.decorateRequest(vs,null),r.decorateRequest(Sd,null),r.addHook("onRoute",function(d){if(e[BE]?.(d)===!0){e._logger.debug(`Ignoring route instrumentation ${d.method} ${d.url} because it matches the ignore path`);return}for(let p of I3)if(d[p]!=null){let _=d[p];if(typeof _=="function")d[p]=l(_,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route -> ${p}`,[be.FASTIFY_TYPE]:Cs.ROUTE,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:bo});else if(Array.isArray(_)){let f=[];for(let E of _)f.push(l(E,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route -> ${p}`,[be.FASTIFY_TYPE]:Cs.ROUTE,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:E.name?.length>0?E.name:bo}));d[p]=f}}d.onSend!=null?d.onSend=Array.isArray(d.onSend)?[...d.onSend,i]:[d.onSend,i]:d.onSend=i,d.onError!=null?d.onError=Array.isArray(d.onError)?[...d.onError,a]:[d.onError,a]:d.onError=a,d.handler=l(d.handler,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route-handler`,[be.FASTIFY_TYPE]:Cs.HANDLER,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:d.handler.name.length>0?d.handler.name:bo})}),r.addHook("onRequest",function(d,p,_){if(this[nn].isEnabled()===!1)return _();if(this[nn][BE]?.({url:d.url,method:d.method})===!0)return this[nn]._logger.debug(`Ignoring request ${d.method} ${d.url} because it matches the ignore path`),_();let f=K.active();ne.getSpan(f)==null&&(f=Xt.extract(f,d.headers));let E=(0,HE.getRPCMetadata)(f);d.routeOptions.url!=null&&E?.type===HE.RPCType.HTTP&&(E.route=d.routeOptions.url);let S=this[nn].tracer.startSpan("request",{attributes:{[In]:r[nn].servername,[be.ROOT]:"@fastify/otel",[Wr]:d.url,[Fi]:d.method}},f);d[Sd]=ne.setSpan(f,S),d[vs]=S,K.with(d[Sd],()=>{_()})}),r.addHook("onResponse",function(d,p,_){let f=d[vs];f!=null&&(f.setStatus({code:ve.OK,message:"OK"}),f.setAttributes({[hs]:404}),f.end()),d[vs]=null,_()}),r.addHook=c,r.setNotFoundHandler=u,s();function i(d,p,_,f){let E=d[vs];E!=null&&(p.statusCode<500&&E.setStatus({code:ve.OK,message:"OK"}),E.setAttributes({[hs]:p.statusCode}),E.end()),d[vs]=null,f(null,_)}function a(d,p,_,f){let E=d[vs];E!=null&&(E.setStatus({code:ve.ERROR,message:_.message}),E.recordException(_)),f()}function c(d,p){let _=this[P3];return I3.includes(d)?_.call(this,d,l(p,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - ${d}`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:p.name?.length>0?p.name:bo})):_.call(this,d,p)}function u(d,p){let _=this[b3];typeof d=="function"?(p=l(d,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.name?.length>0?d.name:bo}),_.call(this,p)):(d.preValidation!=null&&(d.preValidation=l(d.preValidation,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.preValidation.name?.length>0?d.preValidation.name:bo})),d.preHandler!=null&&(d.preHandler=l(d.preHandler,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.preHandler.name?.length>0?d.preHandler.name:bo})),p=l(p,{[In]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:p.name?.length>0?p.name:bo}),_.call(this,d,p))}function l(d,p={}){return function(...f){let E=this[nn],[S]=f;if(E.isEnabled()===!1)return d.call(this,...f);let g=S[Sd]??K.active(),h=E.tracer.startSpan(`handler - ${d.name?.length>0?d.name:this.pluginName??bo}`,{attributes:p},g);return K.with(ne.setSpan(g,h),function(){try{let O=d.call(this,...f);return typeof O?.then=="function"?O.then(N=>(h.end(),N),N=>(h.setStatus({code:ve.ERROR,message:N.message}),h.recordException(N),h.end(),Promise.reject(N))):(h.end(),O)}catch(O){throw h.setStatus({code:ve.ERROR,message:O.message}),h.recordException(O),h.end(),O}},this)}}}}};L();var jE=v(fe(),1),ea=v(de(),1);Re();var Mo;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Mo||(Mo={}));var Td;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(Td||(Td={}));var gd;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(gd||(gd={}));L();var hd=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function jO(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[hd]||[];return s.push(o),Object.defineProperty(t,hd,{enumerable:!1,configurable:!0,value:s}),o}function FE(t,e){let n=t[hd]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:ve.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[hd])}function x3(t,e,n){let r,o;try{o=t(),L3(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!L3(o)&&(e(r,o),r))throw r;return o}}function L3(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var ywe="0.1.0",Owe="@sentry/instrumentation-fastify-v3",D3="anonymous",Nwe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),$E=class extends ea.InstrumentationBase{constructor(e={}){super(Owe,ywe,e)}init(){return[new ea.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,jE.getRPCMetadata)(K.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===jE.RPCType.HTTP&&(a.route=c);let u=r.method||"GET";Te().setTransactionName(`${u} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||D3,c=`${gd.MIDDLEWARE} - ${a}`,u=i[1],l=jO(u,s.tracer,c,{[Mo.FASTIFY_TYPE]:Td.MIDDLEWARE,[Mo.PLUGIN_NAME]:e,[Mo.HOOK_NAME]:n}),d=o&&i[i.length-1];return d&&(i[i.length-1]=function(...p){FE(u),d.apply(this,p)}),K.with(ne.setSpan(K.active(),l),()=>x3(()=>r.apply(this,i),p=>{p instanceof Error&&(l.setStatus({code:ve.ERROR,message:p.message}),l.recordException(p)),o||FE(u)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!Nwe.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),Cwe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,ea.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),FE(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,u=`${gd.REQUEST_HANDLER} - ${c||this.pluginName||D3}`,l={[Mo.PLUGIN_NAME]:this.pluginName,[Mo.FASTIFY_TYPE]:Td.REQUEST_HANDLER,[ql]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(l[Mo.FASTIFY_NAME]=c);let d=jO(o,e.tracer,u,l);U3(d);let{requestHook:p}=e.getConfig();return p&&(0,ea.safeExecuteInTheMiddle)(()=>p(d,{request:r}),_=>{_&&e._diag.error("request hook failed",_)},!0),K.with(ne.setSpan(K.active(),d),()=>{s()})}}};function Cwe(){let t=j();t&&t.on("spanStart",e=>{U3(e)})}function U3(t){let e=q(t).data,n=e["fastify.type"];if(e[re]||!n)return;t.setAttributes({[ge]:"auto.http.otel.fastify",[re]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var k3="Fastify",vwe="Fastify-V5",Iwe="Fastify-V3",V3=F(Iwe,()=>new $E);function Pwe(){let t=j();if(t)return t.getIntegrationByName(k3)}function w3(t,e,n,r){let o=Pwe()?.getShouldHandleError()||H3;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){eo&&T.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&tn(t,{mechanism:{handled:!1,type:"fastify"}})}var B3=F(vwe,()=>{let t=new GE,e=t.plugin();return qO.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?eo&&T.error("Failed to setup Fastify instrumentation",o):(Mwe(),r&&Lwe(r))})}),qO.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;w3.call(w3,r,o,s,"diagnostics-channel")}),t}),bwe=(({shouldHandleError:t})=>{let e;return{name:k3,setupOnce(){e=t||H3,V3(),B3()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}}),G3=(t={})=>bwe(t);function H3(t,e,n){let r=n.statusCode;return r>=500||r<=299}function F3(t){let e=q(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[re]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request-handler":"<unknown>";t.setAttributes({[ge]:"auto.http.otel.fastify",[re]:`${c}.fastify`});let u=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof u=="string"){let l=u.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(l)}}function Mwe(){let t=j();t&&t.on("spanStart",e=>{F3(e)})}function Lwe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&F3(s)}let r=e.routeOptions?.url,o=e.method||"GET";Te().setTransactionName(`${o} ${r}`)})}L();var lz=v(uz(),1);var dz="Graphql",pz=F(dz,lz.GraphQLInstrumentation,t=>{let e=fz(t);return{...e,responseHook(n,r){Pe(n,"auto.graphql.otel.graphql"),r.errors?.length&&!q(n).status&&n.setStatus({code:ve.ERROR});let s=q(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=$e(n),l=q(c).data[kc]||[],d=a?`${i} ${a}`:`${i}`;Array.isArray(l)?(l.push(d),c.setAttribute(kc,l)):typeof l=="string"?c.setAttribute(kc,[l,d]):c.setAttribute(kc,d),q(c).data["original-description"]||c.setAttribute("original-description",q(c).description),c.updateName(`${q(c).data["original-description"]} (${Jwe(l)})`)}}}}),Xwe=((t={})=>({name:dz,setupOnce(){pz(fz(t))}})),_z=Xwe;function fz(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function Jwe(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var Oz=v(yz(),1);var Nz="Kafka",Cz=F(Nz,()=>new Oz.KafkaJsInstrumentation({consumerHook(t){Pe(t,"auto.kafkajs.otel.consumer")},producerHook(t){Pe(t,"auto.kafkajs.otel.producer")}})),Qwe=(()=>({name:Nz,setupOnce(){Cz()}})),vz=Qwe;var Dz=v(xz(),1);var Uz="LruMemoizer",wz=F(Uz,()=>new Dz.LruMemoizerInstrumentation),n1e=(()=>({name:Uz,setupOnce(){wz()}})),kz=n1e;var Yz=v(qz(),1);var Kz="Mongo",Wz=F(Kz,()=>new Yz.MongoDBInstrumentation({dbStatementSerializer:i1e,responseHook(t){Pe(t,"auto.db.otel.mongo")}}));function i1e(t){let e=eN(t);return JSON.stringify(e)}function eN(t){if(Array.isArray(t))return t.map(e=>eN(e));if(a1e(t)){let e={};return Object.entries(t).map(([n,r])=>[n,eN(r)]).reduce((n,r)=>(u1e(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function a1e(t){return typeof t=="object"&&t!==null&&!c1e(t)}function c1e(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function u1e(t){return Array.isArray(t)}var l1e=(()=>({name:Kz,setupOnce(){Wz()}})),zz=l1e;var uX=v(cX(),1);var lX="Mongoose",dX=F(lX,()=>new uX.MongooseInstrumentation({responseHook(t){Pe(t,"auto.db.otel.mongoose")}})),h1e=(()=>({name:lX,setupOnce(){dX()}})),pX=h1e;var yX=v(RX(),1);var OX="Mysql",NX=F(OX,()=>new yX.MySQLInstrumentation({})),b1e=(()=>({name:OX,setupOnce(){NX()}})),CX=b1e;var VX=v(kX(),1);var BX="Mysql2",GX=F(BX,()=>new VX.MySQL2Instrumentation({responseHook(t){Pe(t,"auto.db.otel.mysql2")}})),F1e=(()=>({name:BX,setupOnce(){GX()}})),HX=F1e;var _9=v(JX(),1),f9=v(c9(),1);var eke=["get","set","setex"],pN=["get","mget"],tke=["set","setex"];function Md(t,e){return t.includes(e.toLowerCase())}function _N(t){return Md(pN,t)?"cache.get":Md(tke,t)?"cache.put":void 0}function nke(t,e){return e.some(n=>t.startsWith(n))}function l9(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?u9(o.map(s=>n(s))):["<unknown>"],r=e[0];return Md(eke,t)&&r!=null?n(r):u9(e.map(o=>n(o)))}catch{return}}function d9(t,e,n){if(!_N(t))return!1;for(let r of e)if(nke(r,n))return!0;return!1}function p9(t){let e=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(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function u9(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var m9="Redis",fN={},E9=(t,e,n,r)=>{t.setAttribute(ge,"auto.db.otel.redis");let o=l9(e,n),s=_N(e);if(!o||!s||!fN.cachePrefixes||!d9(e,o,fN.cachePrefixes))return;let i=q(t).data["net.peer.name"],a=q(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=p9(r);c&&t.setAttribute(ZA,c),Md(pN,e)&&c!==void 0&&t.setAttribute(XA,c>0),t.setAttributes({[re]:s,[JA]:o});let u=o.join(", ");t.updateName(Gr(u,1024))},rke=F("IORedis",()=>new _9.IORedisInstrumentation({responseHook:E9})),oke=F("Redis-4",()=>new f9.RedisInstrumentation({responseHook:E9})),S9=Object.assign(()=>{rke(),oke()},{id:m9}),ske=((t={})=>({name:m9,setupOnce(){fN=t,S9()}})),T9=ske;var k9=v(w9(),1);var V9="Postgres",B9=F(V9,()=>new k9.PgInstrumentation({requireParentSpan:!0,requestHook(t){Pe(t,"auto.db.otel.postgres")}})),hke=(()=>({name:V9,setupOnce(){B9()}})),G9=hke;L();var Vo=v(de(),1);Re();var RN="PostgresJs",H9=[">=3.0.0 <4"],F9=F(RN,t=>new AN({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),AN=class extends Vo.InstrumentationBase{constructor(e){super("sentry-postgres-js",Oe,e)}init(){let e=new Vo.InstrumentationNodeModuleDefinition("postgres",H9);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Vo.InstrumentationNodeModuleFile(`postgres/${n}/connection.js`,["*"],this._patchConnection.bind(this),this._unwrap.bind(this))),e.files.push(new Vo.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,H9,this._patchQuery.bind(this),this._unwrap.bind(this)))}),[e]}_shouldCreateSpans(){let e=this.getConfig();return ne.getSpan(K.active())!==void 0||!e.requireParentSpan}_patchReject(e,n){return new Proxy(e,{apply:(r,o,s)=>{n.setStatus({code:2,message:s?.[0]?.message||"unknown_error"});let i=Reflect.apply(r,o,s);return n.setAttribute(qR,s?.[0]?.code||"Unknown error"),n.setAttribute(KR,s?.[0]?.name||"Unknown error"),n.end(),i}})}_patchResolve(e,n){return new Proxy(e,{apply:(r,o,s)=>{let i=Reflect.apply(r,o,s),a=s?.[0]?.command;return a&&n.setAttribute($R,a),n.end(),i}})}_patchQuery(e){return e.Query.prototype.handle=new Proxy(e.Query.prototype.handle,{apply:async(n,r,o)=>{if(!this._shouldCreateSpans())return Reflect.apply(n,r,o);let s=this._sanitizeSqlQuery(r.strings?.[0]);return jf({name:s||"postgresjs.query",op:"db"},i=>{let c=ie().getScopeData().contexts.postgresjsConnection;Pe(i,"auto.db.otel.postgres");let{requestHook:u}=this.getConfig();u&&(0,Vo.safeExecuteInTheMiddle)(()=>u(i,s,c),_=>{_&&T.error(`Error in requestHook for ${RN} integration:`,_)});let l=c?.ATTR_DB_NAMESPACE||"<unknown database>",d=c?.ATTR_SERVER_ADDRESS||"<unknown host>",p=c?.ATTR_SERVER_PORT||"<unknown port>";i.setAttribute(YR,"postgres"),i.setAttribute(FR,l),i.setAttribute(WR,d),i.setAttribute(zR,p),i.setAttribute(jR,s),r.resolve=this._patchResolve(r.resolve,i),r.reject=this._patchReject(r.reject,i);try{return Reflect.apply(n,r,o)}catch(_){throw i.setStatus({code:2}),i.end(),_}})}}),e}_patchConnection(e){return new Proxy(e,{apply:(n,r,o)=>{let s=o[0]?.database||"<unknown database>",i=o[0]?.host?.[0]||"<unknown host>",a=o[0]?.port?.[0]||"<unknown port>";return ie().setContext("postgresjsConnection",{ATTR_DB_NAMESPACE:s,ATTR_SERVER_ADDRESS:i,ATTR_SERVER_PORT:a}),Reflect.apply(n,r,o)}})}_sanitizeSqlQuery(e){return e?e.replace(/\s+/g," ").trim().substring(0,1024).replace(/--.*?(\r?\n|$)/g,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\b\d+\b/g,"?").replace(/\s+/g," ").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/g,"IN (?)"):"Unknown SQL Query"}},Ake=(()=>({name:RN,setupOnce(){F9()}})),$9=Ake;L();var TS=v(de(),1);L();var Rke=process.env.PRISMA_SHOW_ALL_TRACES==="true",yke="00-10-10-00";function Oke(t){return t==="client"?It.CLIENT:It.INTERNAL}var Nke=class{traceMiddleware;tracerProvider;ignoreSpanTypes;constructor({traceMiddleware:t,tracerProvider:e,ignoreSpanTypes:n}){this.traceMiddleware=t,this.tracerProvider=e,this.ignoreSpanTypes=n}isEnabled(){return!0}getTraceParent(t){let e=ne.getSpanContext(t??K.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:yke}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)Y9(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return K.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!Rke||t.middleware&&!this.traceMiddleware)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(K9(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return j9(s,e(s,r))}return n.startActiveSpan(o,t,s=>j9(s,e(s,r)))}};function Y9(t,e,n,r,o){if(K9(e.name,o))return;let s={attributes:e.attributes,kind:Oke(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let u=r.get(c);return u?{context:{spanId:u,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)Y9(t,c,n,r,o);i.end(e.endTime)})}function j9(t,e){return Cke(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function Cke(t){return t!=null&&typeof t.then=="function"}function K9(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var W9={name:"@prisma/instrumentation",version:"6.11.1",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@prisma/internals":"workspace:*","@swc/core":"1.11.5","@types/jest":"29.5.14","@types/node":"18.19.76","@opentelemetry/api":"1.9.0",jest:"29.7.0","jest-junit":"16.0.0",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"jest"},sideEffects:!1},ON=W9.version,vke=ON.split(".")[0],q9="PRISMA_INSTRUMENTATION",yN=`V${vke}_PRISMA_INSTRUMENTATION`,Ike=W9.name,Pke="@prisma/client",z9=class extends TS.InstrumentationBase{tracerProvider;constructor(t={}){super(Ike,ON,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new TS.InstrumentationNodeModuleDefinition(Pke,[ON])]}enable(){let t=this._config,e={helper:new Nke({traceMiddleware:t.middleware??!1,tracerProvider:this.tracerProvider??ne.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]})};global[q9]=e,global[yN]=e}disable(){delete global[q9],delete global[yN]}isEnabled(){return!!global[yN]}};var X9="Prisma";function bke(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function J9(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var NN=class extends z9{constructor(){super()}enable(){super.enable();let e=J9(),n=!1;bke(e)&&(e.createEngineSpan=()=>{Fe(()=>{n||(n=!0,console.warn("[Sentry] The Sentry SDK supports tracing with Prisma version 5 only with limited capabilities. For full tracing capabilities pass `prismaInstrumentation` for version 5 to the Sentry `prismaIntegration`. Read more: https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/"))})})}},Mke=F(X9,t=>t?.prismaInstrumentation?t.prismaInstrumentation:new NN),Z9=({prismaInstrumentation:t}={})=>({name:X9,setupOnce(){Mke({prismaInstrumentation:t})},setup(e){J9()&&e.on("spanStart",n=>{let r=q(n);r.description?.startsWith("prisma:")&&n.setAttribute(ge,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}});var i8=v(s8(),1);var a8="Hapi",c8=F(a8,()=>new i8.HapiInstrumentation),Fke=(()=>({name:a8,setupOnce(){c8()}})),u8=Fke;var A8=v(h8(),1);Re();var R8="Koa",y8=F(R8,A8.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Pe(e,"auto.http.otel.koa");let r=q(e).data,o=r["koa.type"];o&&e.setAttribute(re,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),Te()===Hr()){eo&&T.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[Wr],a=n.context?.request?.method?.toUpperCase()||"GET";i&&Te().setTransactionName(`${a} ${i}`)}})),zke=((t={})=>({name:R8,setupOnce(){y8(t)}})),O8=zke;var x8=v(L8(),1);var D8="Connect",U8=F(D8,()=>new x8.ConnectInstrumentation),iVe=(()=>({name:D8,setupOnce(){U8()}})),w8=iVe;var W8=v(K8(),1);var dVe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),z8="Tedious",X8=F(z8,()=>new W8.TediousInstrumentation({})),pVe=(()=>{let t;return{name:z8,setupOnce(){let e=X8();t=$l(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=q(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";dVe.has(s)&&n.setAttribute(ge,"auto.db.otel.tedious")}))}}}),J8=pVe;var n6=v(t6(),1);var r6="GenericPool",o6=F(r6,()=>new n6.GenericPoolInstrumentation({})),mVe=(()=>{let t;return{name:r6,setupOnce(){let e=o6();t=$l(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=q(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(ge,"auto.db.otel.generic_pool")}))}}}),s6=mVe;var m6=v(f6(),1);var E6="Amqplib",NVe={consumeEndHook:t=>{Pe(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Pe(t,"auto.amqplib.otel.publisher")}},S6=F(E6,()=>new m6.AmqplibInstrumentation(NVe)),CVe=(()=>({name:E6,setupOnce(){S6()}})),T6=CVe;var Hd="VercelAI";var kS=v(de(),1);var g6=["generateText","streamText","generateObject","streamObject","embed","embedMany"];function vVe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var wS=class t extends kS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Oe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new kS.InstrumentationNodeModuleDefinition("ai",[">=3.0.0 <5"],this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];function n(r){return(...o)=>{let s=o[0].experimental_telemetry||{},i=s.isEnabled,a=ie().getClient(),c=a?.getIntegrationByName(Hd),u=c?.options,l=c?!!a?.getOptions().sendDefaultPii:!1,{recordInputs:d,recordOutputs:p}=vVe(u,s,i,l);return o[0].experimental_telemetry={...s,isEnabled:i!==void 0?i:!0,recordInputs:d,recordOutputs:p},yo(()=>r.apply(this,o),_=>{_&&typeof _=="object"&&rt(_,"_sentry_active_span",qr())})}}if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of g6)e[r]=n(e[r]);return e}else{let r=g6.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}};var h6=F(Hd,()=>new wS({}));function IVe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var PVe=((t={})=>{let e;return{name:Hd,options:t,setupOnce(){e=h6()},afterAllSetup(n){t.force??IVe(n)?_m(n):e?.callWhenPatched(()=>_m(n))}}}),A6=PVe;var BS=v(de(),1);var bVe=[">=4.0.0 <6"];function MVe(t,e){let n=t?.recordInputs??e,r=t?.recordOutputs??e;return{recordInputs:n,recordOutputs:r}}var VS=class extends BS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Oe,e)}init(){return new BS.InstrumentationNodeModuleDefinition("openai",bVe,this._patch.bind(this))}_patch(e){let n=e.OpenAI,r=function(...o){let s=Reflect.construct(n,o),i=ie().getClient(),c=i?.getIntegrationByName(gs)?.options,u=!!i?.getOptions().sendDefaultPii,{recordInputs:l,recordOutputs:d}=MVe(c,u);return bR(s,{recordInputs:l,recordOutputs:d})};Object.setPrototypeOf(r,n),Object.setPrototypeOf(r.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(r,o,s)}try{e.OpenAI=r}catch{Object.defineProperty(e,"OpenAI",{value:r,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=r}catch{Object.defineProperty(e,"default",{value:r,writable:!0,configurable:!0,enumerable:!0})}return e}};var R6=F(gs,()=>new VS({})),LVe=((t={})=>({name:gs,options:t,setupOnce(){R6()}})),y6=LVe;function O6(){return[kO(),G3(),_z(),zz(),pX(),CX(),HX(),T9(),G9(),Z9(),u8(),O8(),w8(),J8(),s6(),vz(),T6(),kz(),A6(),y6(),$9()]}L();var N6=v(ky(),1),C6=v(qy(),1);Re();var xVe=v(mf(),1);var HN=1e6;function v6(t,e={}){t.getOptions().debug&&yO();let n=DVe(t,e);t.traceProvider=n}function DVe(t,e={}){let n=new C6.BasicTracerProvider({sampler:new dE(t),resource:new N6.Resource({[In]:"node",[HR]:"sentry",[XR]:Oe}),forceFlushTimeoutMillis:500,spanProcessors:[new lE({timeout:UVe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});return ne.setGlobalTracerProvider(n),Xt.setGlobalPropagator(new uE),K.setGlobalContextManager(new RO),n}function UVe(t){if(t!=null){if(t>HN)return eo&&T.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${HN}`),HN;if(t<=0||Number.isNaN(t)){eo&&T.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function I6(){return vE().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(A5(),L5())}function P6(t){return[...I6(),...yt(t)?O6():[]]}function FN(t={}){return wVe(t,P6)}function wVe(t={},e){Hi(t,"node");let n=CO({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(v6(n,{spanProcessors:t.openTelemetrySpanProcessors}),vO()),n}function VVe(){let t=process.env.SENTRY_RELEASE?.trim();if(t)return t;let n=(process.env.RAILWAY_GIT_COMMIT_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.GITHUB_SHA||process.env.GIT_COMMIT||"").slice(0,7),r=typeof process.env.npm_package_version=="string"?process.env.npm_package_version:"";if(r&&n)return`${r}+${n}`;if(n)return n;if(r)return r}function M6(){let t=process.env.SENTRY_ENVIRONMENT?.trim();return t||(process.env.NODE_ENV==="production"?"production":"development")}function BVe(){let t=process.env.SENTRY_TRACES_SAMPLE_RATE?.trim();if(t===""||t===void 0)return M6()==="production"?.15:1;let e=Number(t);return!Number.isFinite(e)||e<0?0:Math.min(e,1)}var GVe=new Set(["authorization","cookie","x-admin-key","x-api-key","x-platform-web-secret","proxy-authorization"]);function HVe(t){if(!t||typeof t!="object")return t;let e={};for(let[n,r]of Object.entries(t)){let o=n.toLowerCase();e[n]=GVe.has(o)?"[Filtered]":r}return e}function FVe(t){let e=t.request;if(!e)return;e.headers&&typeof e.headers=="object"&&(e.headers=HVe(e.headers));let n=e.url;typeof n=="string"&&n.includes("token=")&&(e.url=n.replace(/([?&]token=)[^&]+/gi,"$1[Filtered]"))}function $Ve(t){try{FVe(t);let n=t.exception?.values?.[0];return n?.value&&typeof n.value=="string"&&(/Bearer\s+\S+/i.test(n.value)&&(n.value=n.value.replace(/Bearer\s+\S+/gi,"Bearer [Filtered]")),/password[=:]\s*\S+/i.test(n.value)&&(n.value="[Filtered]")),t}catch{return t}}function jVe(t){return t.replace(/:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,":?").replace(/:[a-f0-9]{16,}/gi,":?")}var b6=!1;function qVe(t){let e=VVe();return{environment:M6(),...e?{release:e}:{},tracesSampleRate:BVe(),enableLogs:!0,beforeSend(n){if(n.type==="transaction")return n;let r=$Ve(n);return r===null?null:r},beforeSendTransaction(n){try{for(let r of n.spans??[])r.description&&(r.description=jVe(r.description))}catch{}return n},initialScope:n=>(n.setTag("service",t),n)}}function L6(t){if(b6)return;let e=process.env.SENTRY_DSN?.trim();if(!e){t.dsnProvided=!1;return}t.dsnProvided=!0;try{FN({dsn:e,...qVe(t.serviceName)}),b6=!0,console.log(`[visa/observability] Sentry initialized service=${t.serviceName} env=${process.env.SENTRY_ENVIRONMENT??process.env.NODE_ENV??"unknown"}`),Jf(`Sentry initialized: ${t.serviceName}`,"info")}catch(n){console.error("[visa/observability] Sentry.init failed:",n),t.dsnProvided=!1}}process.env.SENTRY_DSN;L6({serviceName:"visa-cli"});var x6=(0,k6.promisify)(w6.execFile);function YVe(t){let e=at.homedir(),n=o=>o.replace(e,"~"),r=t.staleReason==="missing"?"path missing on disk":"path mismatch";return` \u2022 ${t.client.displayName} (${n(t.configPath)})
157
- ${r}: ${n(t.currentPath)}`}function V6(t,e){if(t.length===0){console.log(`${e} \u2713 All MCP client configs are up to date.`);return}console.log(`${e} Found ${t.length} stale MCP config ${t.length===1?"entry":"entries"}:`);for(let n of t)console.log(YVe(n))}function D6(t){console.log(` ! ${t.client.displayName} skipped: ${t.message}`)}var mt=new U6.Command,KVe=new Set(["pay",...kT]),GS=null,Fd=!1;function sn(){return GS=new nr(()=>Ne.getSessionToken()),GS}function jN(t){return`$${(t/100).toFixed(2)}`}function $N(t,e,n=!1){if(!t){let i=jN(e);return n&&e>=0?`+${i}`:i}let r=(0,FS.fromWire)(t),o=r%10000n===0n?2:6,s=(0,FS.toDisplay)(r,{decimals:o});return n&&r>=0n?`+${s}`:s}function WVe(t){return $N(t,0)}function zVe(t){let e=`visa-cli-${at.hostname()||"local"}`,n=(t?.trim()||e).trim();if(!n)throw new Error("API key label is required.");if(n.length>128)throw new Error("API key label must be 128 characters or fewer.");return n}function XVe(t){if(!t)return;let e=t.split(",").map(s=>s.trim()).filter(Boolean),n=Array.from(new Set(e)),r=n.find(s=>s.length>64);if(r)throw new Error(`Tool id is too long: ${r}`);let o=n.find(s=>KVe.has(s));if(o)throw new Error(`Tool id "${o}" is retired for direct API-key access. Use category meta-tools or discover/execute instead.`);return n}function JVe(t){if(!t)return;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("--daily-cap must be a positive USD amount.");let n=Math.round(e*100);if(n<100||n>1e4)throw new Error("--daily-cap must be between 1 and 100 USD.");return n}function B6(t){return t&&t.length>0?t.join(", "):"all tools"}mt.name("visa-cli").description("Visa CLI - AI payment orchestration").version(Zd().version);mt.hook("preAction",async()=>{await tC()});mt.command("setup").description("Register MCP server, authenticate, and generate attestation key").option("--check","Scan MCP client configs for stale visa-cli entries and exit without making changes").option("--yes","Accept setup prompts without asking \u2014 for CI/agent use").option("--hud","Also enable the Claude Code HUD during setup").option("--no-hud","Do not install the HUD during setup (default)").action(async t=>{try{if(t.check){let f=Hu();V6(f,"MCP config check:"),f.length>0&&(console.log("\nRun `visa-cli setup` (or `visa-cli install --repair`) to rewrite these entries."),process.exit(1));return}console.log("Step 1: Registering MCP server...");let e=Hu(),n=new Map(e.map(f=>[f.client.id,f])),r=new Set,o=new Set,s=new Set;for(let f of or)if(Bu(f)){let E;try{E=Gu(f)}catch(h){if(h instanceof ba){D6(h),o.add(f.displayName),s.add(f.id);continue}throw h}let S=n.get(f.id),g=S?` \u2014 repaired stale ${S.staleReason} entry`:"";console.log(` \u2713 ${f.displayName} (${E.configPath.replace(at.homedir(),"~")})${g}`),S&&r.add(f.id)}let i=e.filter(f=>!r.has(f.client.id)&&!s.has(f.client.id)),a=0;for(let f of i){try{jT(f)}catch(E){if(E instanceof ba){D6(E),o.add(f.client.displayName),s.add(f.client.id);continue}throw E}console.log(` \u2713 ${f.client.displayName} (${f.configPath.replace(at.homedir(),"~")}) \u2014 repaired stale ${f.staleReason} entry`),a++}let c=r.size+a;c===0&&o.size===0?console.log(" \u2713 MCP config verified \u2014 nothing to repair."):c>0&&console.log(` \u2713 Repaired ${c} stale MCP config ${c===1?"entry":"entries"}.`),o.size>0&&console.log(` ! Skipped MCP registration for: ${Array.from(o).join(", ")}. Rerun with access to those config files to complete registration.`),console.log(`
158
- Step 2: Checking authentication...`);let u=await Ne.getSessionToken();if(u)try{await new nr(()=>Promise.resolve(u)).getStatus(),console.log(" Already authenticated.")}catch(f){let E=f instanceof Error?f.message:"";E.includes("session has expired")||E.includes("Not logged in")?(console.log(" Existing session expired \u2014 re-authenticating..."),await Ne.clearAll(),u=null):console.log(` Couldn't verify session (${E||"unknown error"}) \u2014 continuing with existing token.`)}if(!u){let f=null;try{let{stdout:E}=await x6("gh",["auth","token"],{timeout:5e3});f=E.trim()}catch{}if(f||(f=process.env.GITHUB_TOKEN||null),f)try{console.log(" Found GitHub token \u2014 attempting headless login...");let E=await globalThis.fetch(`${Cr()}/v1/auth/token-exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({github_token:f}),signal:AbortSignal.timeout(1e4)});if(E.ok){let S=await E.json();if(S.success&&S.sessionToken){let g=S.sessionToken;u=g,await Ne.saveSessionToken(g),console.log(` Signed in as ${S.user} (headless).`)}}else(await E.json().catch(()=>({}))).hint==="card_required"&&console.log(" GitHub token valid but no card on file \u2014 opening browser for card enrollment...")}catch{}}if(u||(console.log(" No session found. Opening browser for GitHub login..."),u=await new Promise(async(f,E)=>{let S=HS.randomBytes(16).toString("hex"),g=`${Cr()}/login?state=${S}`;await sC(g);let h=3e4,O=300*1e3,N=Date.now()+O;for(;Date.now()<N;)try{let R=await globalThis.fetch(`${Cr()}/v1/auth-status`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({state:S,timeout:h}),signal:AbortSignal.timeout(h+5e3)});if(!R.ok)continue;let M=await R.json();if(M.status==="pending")continue;if(M.status==="expired"){E(new Error("Session expired. Please run setup again."));return}if(M.status==="complete"&&M.sessionToken){console.log(` Signed in as ${M.user}.`),f(M.sessionToken);return}}catch{}E(new Error("Login timed out after 5 minutes. Please run setup again."))}),await Ne.saveSessionToken(u),console.log(" Session token saved.")),console.log(`
159
- Step 3: Setting up authentication...`),!zt())console.log(" Not macOS \u2014 skipping biometric setup.");else{try{await x6("clang",["--version"])}catch{console.error(" Xcode Command Line Tools are required for payment authentication."),console.error(" Install them by running: xcode-select --install"),console.error(" Then re-run: visa-cli setup"),process.exit(1)}try{let f=await dp();console.log(" Attestation key generated."),await sn().registerAttestationKey(f),console.log(" Attestation key registered with server.")}catch(f){console.log(` Skipped: ${f.message}`)}}let l=Fo.join(at.homedir(),".claude","settings.json"),d=Rr.existsSync(Fo.join(at.homedir(),".claude.json"));if(t.hud===!0)if(!d)console.log(`
155
+ `;let c=c5(o);o.write(`${a}\r
156
+ `);let{connect:u,buffered:l}=await c;if(e.emit("proxyConnect",u),this.emit("proxyConnect",u,e),u.statusCode===200){if(e.once("socket",HDe),n.secureEndpoint){ad("Upgrading socket connection to TLS");let p=n.servername||n.host;return CO.connect({...u5(n,"host","path","port"),socket:o,servername:Io.isIP(p)?void 0:p})}return o}o.destroy();let d=new Io.Socket({writable:!1});return d.readable=!0,e.once("socket",p=>{ad("Replaying proxy buffer for failed request"),p.push(l),p.push(null)}),d}};cd.__initStatic();function HDe(t){t.resume()}function u5(t,...e){let n={},r;for(r in t)e.includes(r)||(n[r]=t[r]);return n}var jDe=1024*32;function qDe(t){return new l5.Readable({read(){this.push(t),this.push(null)}})}function p5(t){let e;try{e=new URL(t.url)}catch{return Fe(()=>{console.warn("[@sentry/node]: Invalid dsn or tunnel option, will not send any events. The tunnel option must be a full URL when used.")}),Gl(t,()=>Promise.resolve({}))}let n=e.protocol==="https:",r=YDe(e,t.proxy||(n?process.env.https_proxy:void 0)||process.env.http_proxy),o=n?$De:FDe,s=t.keepAlive===void 0?!1:t.keepAlive,i=r?new cd(r):new o.Agent({keepAlive:s,maxSockets:30,timeout:2e3}),a=KDe(t,t.httpModule??o,i);return Gl(t,a)}function YDe(t,e){let{no_proxy:n}=process.env;if(!n?.split(",").some(o=>t.host.endsWith(o)||t.hostname.endsWith(o)))return e}function KDe(t,e,n){let{hostname:r,pathname:o,port:s,protocol:i,search:a}=new URL(t.url);return function(u){return new Promise((l,d)=>{Ec(()=>{let p=qDe(u.body),_={...t.headers};u.body.length>jDe&&(_["content-encoding"]="gzip",p=p.pipe((0,d5.createGzip)()));let f=e.request({method:"POST",agent:n,headers:_,hostname:r,path:`${o}${a}`,port:s,protocol:i,ca:t.caCerts},E=>{E.on("data",()=>{}),E.on("end",()=>{}),E.setEncoding("utf8");let S=E.headers["retry-after"]??null,g=E.headers["x-sentry-rate-limits"]??null;l({statusCode:E.statusCode,headers:{"retry-after":S,"x-sentry-rate-limits":Array.isArray(g)?g[0]||null:g}})});f.on("error",d),p.pipe(f)})})}}var WDe=new Set(["false","f","n","no","off","0"]),zDe=new Set(["true","t","y","yes","on","1"]);function OE(t,e){let n=String(t).toLowerCase();return WDe.has(n)?!1:zDe.has(n)?!0:e?.strict?null:!!t}var NE=require("node:path");function _5(t){return t.replace(/^[A-Z]:/,"").replace(/\\/g,"/")}function f5(t=process.argv[1]?RR(process.argv[1]):process.cwd(),e=NE.sep==="\\"){let n=e?_5(t):t;return r=>{if(!r)return;let o=e?_5(r):r,{dir:s,base:i,ext:a}=NE.posix.parse(o);(a===".js"||a===".mjs"||a===".cjs")&&(i=i.slice(0,a.length*-1));let c=decodeURIComponent(i);s||(s=".");let u=s.lastIndexOf("/node_modules");if(u>-1)return`${s.slice(u+14).replace(/\//g,".")}:${c}`;if(s.startsWith(n)){let l=s.slice(n.length+1).replace(/\//g,".");return l?`${l}:${c}`:c}return c}}function m5(t){if(process.env.SENTRY_RELEASE)return process.env.SENTRY_RELEASE;if(Q.SENTRY_RELEASE?.id)return Q.SENTRY_RELEASE.id;let e=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_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 e||n||r||t}var E5=Cf(LR(f5()));var S5=v(require("node:os"),1);L();var T5=v(de(),1);var vE=require("worker_threads");var XDe=6e4,CE=class extends Bl{constructor(e){let n=e.includeServerName===!1?void 0:e.serverName||global.process.env.SENTRY_NAME||S5.hostname(),r={...e,platform:"node",runtime:{name:"node",version:global.process.version},serverName:n};e.openTelemetryInstrumentations&&(0,T5.registerInstrumentations)({instrumentations:e.openTelemetryInstrumentations}),Hi(r,"node"),T.log(`Initializing Sentry: process: ${process.pid}, thread: ${vE.isMainThread?"main":`worker-${vE.threadId}`}.`),super(r);let{enableLogs:o,_experiments:s}=this.getOptions();(o??s?.enableLogs)&&(this._logOnExitFlushListener=()=>{Gi(this)},n&&this.on("beforeCaptureLog",a=>{a.attributes={...a.attributes,"server.address":n}}),process.on("beforeExit",this._logOnExitFlushListener))}get tracer(){if(this._tracer)return this._tracer;let e="@sentry/node",n=Oe,r=ne.getTracer(e,n);return this._tracer=r,r}async flush(e){return await this.traceProvider?.forceFlush(),this.getOptions().sendClientReports&&this._flushOutcomes(),super.flush(e)}close(e){return this._clientReportInterval&&clearInterval(this._clientReportInterval),this._clientReportOnExitFlushListener&&process.off("beforeExit",this._clientReportOnExitFlushListener),this._logOnExitFlushListener&&process.off("beforeExit",this._logOnExitFlushListener),super.close(e)}startClientReportTracking(){let e=this.getOptions();e.sendClientReports&&(this._clientReportOnExitFlushListener=()=>{this._flushOutcomes()},this._clientReportInterval=setInterval(()=>{le&&T.log("Flushing client reports based on interval."),this._flushOutcomes()},e.clientReportFlushInterval??XDe).unref(),process.on("beforeExit",this._clientReportOnExitFlushListener))}_getTraceInfoFromScope(e){return e?l4(this,e):[void 0,void 0]}};var g5=v(Ef(),1),h5=v(require("module"),1),JDe={};function A5(){let[t=0,e=0]=process.versions.node.split(".").map(Number);if(t>=21||t===20&&e>=6||t===18&&e>=19){if(!Q._sentryEsmLoaderHookRegistered)try{let{addHookMessagePort:n}=(0,g5.createAddHookMessageChannel)();h5.default.register("import-in-the-middle/hook.mjs",JDe.url,{data:{addHookMessagePort:n,include:[]},transferList:[n]})}catch(n){T.warn("Failed to register ESM hook",n)}}else Fe(()=>{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.`)})}function IE(){return[cm(),im(),um(),lm(),t5(),dm(),A4(),C4(),X4(),J4(),V4(),K4(),b4(),n5(),a5(),z4()]}function vO(t={}){return ZDe(t,IE)}function ZDe(t={},e){let n=QDe(t,e);n.debug===!0&&(le?T.enable():Fe(()=>{console.warn("[Sentry] Cannot initialize SDK with `debug` option using a non-debug bundle.")})),!Hc()&&n.registerEsmLoaderHooks!==!1&&A5(),p4(),ie().update(n.initialScope),n.spotlight&&!n.integrations.some(({name:s})=>s===SO)&&n.integrations.push(Q4({sidecarUrl:typeof n.spotlight=="string"?n.spotlight:void 0})),Hi(n,"node-core");let o=new CE(n);return ie().setClient(o),o.init(),T.log(`Running in ${Hc()?"CommonJS":"ESM"} mode.`),o.startClientReportTracking(),nUe(),t4(o),d4(o),o}function IO(){if(!le)return;let t=s4(),e=["SentryContextManager","SentryPropagator"];yt()&&e.push("SentrySpanProcessor");for(let n of e)t.includes(n)||T.error(`You have to set up the ${n}. Without this, the OpenTelemetry & Sentry integration will not work properly.`);t.includes("SentrySampler")||T.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 QDe(t,e){let n=eUe(t.release),r=t.spotlight??OE(process.env.SENTRY_SPOTLIGHT,{strict:!0})??process.env.SENTRY_SPOTLIGHT,o=tUe(t.tracesSampleRate),s={...t,dsn:t.dsn??process.env.SENTRY_DSN,environment:t.environment??process.env.SENTRY_ENVIRONMENT,sendClientReports:t.sendClientReports??!0,transport:t.transport??p5,stackParser:PA(t.stackParser||E5),release:n,tracesSampleRate:o,spotlight:r,debug:OE(t.debug??process.env.SENTRY_DEBUG)},i=t.integrations,a=t.defaultIntegrations??e(s);return{...s,integrations:dR({defaultIntegrations:a,integrations:i})}}function eUe(t){if(t!==void 0)return t;let e=m5();if(e!==void 0)return e}function tUe(t){if(t!==void 0)return t;let e=process.env.SENTRY_TRACES_SAMPLE_RATE;if(!e)return;let n=parseFloat(e);return isFinite(n)?n:void 0}function nUe(){if(OE(process.env.SENTRY_USE_ENVIRONMENT)!==!1){let t=process.env.SENTRY_TRACE,e=process.env.SENTRY_BAGGAGE,n=Pl(t,e);ie().setPropagationContext(n)}}function Pe(t,e){t.setAttribute(ge,e)}var PO="Http",R5="@opentelemetry_sentry-patched/instrumentation-http",rUe=F(`${PO}.sentry`,t=>new zi(t)),oUe=F(PO,t=>{let e=new y5.HttpInstrumentation(t);try{e._diag=On.createComponentLogger({namespace:R5}),e.instrumentationName=R5}catch{}return e});function sUe(t,e={}){return typeof t.spans=="boolean"?t.spans:!(e.skipOpenTelemetrySetup||!yt(e)&&Xi.major>=22)}var O5=(t={})=>{let e=t.dropSpansForIncomingRequestStatusCodes??[[401,404],[300,399]];return{name:PO,setupOnce(){let n=sUe(t,j()?.getOptions());if(rUe({...t,extractIncomingTraceFromHeader:!n,propagateTraceInOutgoingRequests:!n}),n){let r=cUe(t);oUe(r)}},processEvent(n){if(n.type==="transaction"){let r=n.contexts?.trace?.data?.["http.response.status_code"];if(typeof r=="number"&&e.some(o=>{if(typeof o=="number")return o===r;let[s,i]=o;return r>=s&&r<=i}))return null}return n}}};function iUe(t){return"outputData"in t&&"outputSize"in t&&!("client"in t)&&!("statusCode"in t)}function aUe(t){return t.headers["next-router-prefetch"]==="1"}function cUe(t={}){return{...t.instrumentation?._experimentalConfig,disableIncomingRequestInstrumentation:t.disableIncomingRequestSpans,ignoreOutgoingRequestHook:n=>{let r=Bc(n);if(!r)return!1;let o=t.ignoreOutgoingRequests;return!!o?.(r,n)},ignoreIncomingRequestHook:n=>{let r=n.url,o=n.method?.toUpperCase();if(o==="OPTIONS"||o==="HEAD")return!0;let s=t.ignoreIncomingRequests;return!!(r&&s?.(r,n))},requireParentforOutgoingSpans:!1,requireParentforIncomingSpans:!1,requestHook:(n,r)=>{Pe(n,"auto.http.otel.http"),!iUe(r)&&aUe(r)&&n.setAttribute("sentry.http.prefetch",!0),t.instrumentation?.requestHook?.(n,r)},responseHook:(n,r)=>{t.instrumentation?.responseHook?.(n,r)},applyCustomAttributesOnSpan:(n,r,o)=>{t.instrumentation?.applyCustomAttributesOnSpan?.(n,r,o)}}}var x5=v(L5(),1);var D5="NodeFetch",dUe=F(D5,x5.UndiciInstrumentation,t=>EUe(t)),pUe=F(`${D5}.sentry`,Ji,t=>t),_Ue=((t={})=>({name:"NodeFetch",setupOnce(){mUe(t,j()?.getOptions())&&dUe(t),pUe(t)}})),U5=_Ue;function fUe(t,e="/"){let n=`${t}`;return n.endsWith("/")&&e.startsWith("/")?`${n}${e.slice(1)}`:!n.endsWith("/")&&!e.startsWith("/")?`${n}/${e.slice(1)}`:`${n}${e}`}function mUe(t,e={}){return typeof t.spans=="boolean"?t.spans:!e.skipOpenTelemetrySetup&&yt(e)}function EUe(t={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=fUe(n.origin,n.path),o=t.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:()=>({[ge]:"auto.http.otel.node_fetch"})}}var Z5=v(Y5(),1);var eo=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__;L();var VE=v(fe(),1),to=v(de(),1);Re();var zn;(function(t){let e="express.type";t.EXPRESS_TYPE=e;let n="express.name";t.EXPRESS_NAME=n})(zn||(zn={}));var Po;(function(t){let e="router";t.ROUTER=e;let n="middleware";t.MIDDLEWARE=n;let r="request_handler";t.REQUEST_HANDLER=r})(Po||(Po={}));var UO=Symbol("express-layer-patched"),Os="__ot_middlewares";var W5=(t,e)=>{Array.isArray(t[Os])===!1&&Object.defineProperty(t,Os,{enumerable:!1,value:[]}),e!==void 0&&t[Os].push(e)},z5=(t,e)=>{let n=e.handle?.stack?.[0];return n?.route?.path?`${t}${n.route.path}`:n?.handle?.stack?z5(t,n):t},X5=(t,e,n)=>{if(e.name==="router"){let r=z5("",e),o=r||n||t||"/";return{attributes:{[zn.EXPRESS_NAME]:o,[zn.EXPRESS_TYPE]:Po.ROUTER},name:`router - ${o}`}}else return e.name==="bound dispatch"||e.name==="handle"?{attributes:{[zn.EXPRESS_NAME]:(t||n)??"request handler",[zn.EXPRESS_TYPE]:Po.REQUEST_HANDLER},name:`request handler${e.path?` - ${t||n}`:""}`}:{attributes:{[zn.EXPRESS_NAME]:e.name,[zn.EXPRESS_TYPE]:Po.MIDDLEWARE},name:`middleware - ${e.name}`}},IUe=(t,e)=>{if(typeof e=="string")return e===t;if(e instanceof RegExp)return e.test(t);if(typeof e=="function")return e(t);throw new TypeError("Pattern is in unsupported datatype")},J5=(t,e,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(e))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(IUe(t,r))return!0}catch{}return!1},wO=t=>t instanceof Error?[t,t.message]:[String(t),String(t)],wE=t=>{let e=t[0];return Array.isArray(e)?e.map(n=>K5(n)||"").join(","):K5(e)},K5=t=>{if(typeof t=="string")return t;if(t instanceof RegExp||typeof t=="number")return t.toString()};var PUe="0.1.0",bUe="@sentry/instrumentation-express-v5",kE=class extends to.InstrumentationBase{constructor(e={}){super(bUe,PUe,e)}init(){return[new to.InstrumentationNodeModuleDefinition("express",[">=5.0.0"],e=>this._setup(e),e=>this._tearDown(e))]}_setup(e){let n=e.Router.prototype;return(0,to.isWrapped)(n.route)&&this._unwrap(n,"route"),this._wrap(n,"route",this._getRoutePatch()),(0,to.isWrapped)(n.use)&&this._unwrap(n,"use"),this._wrap(n,"use",this._getRouterUsePatch()),(0,to.isWrapped)(e.application.use)&&this._unwrap(e.application,"use"),this._wrap(e.application,"use",this._getAppUsePatch()),e}_tearDown(e){if(e===void 0)return;let n=e.Router.prototype;this._unwrap(n,"route"),this._unwrap(n,"use"),this._unwrap(e.application,"use")}_getRoutePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,wE(o)),s}}}_getRouterUsePatch(){let e=this;return function(n){return function(...o){let s=n.apply(this,o),i=this.stack[this.stack.length-1];return e._applyPatch(i,wE(o)),s}}}_getAppUsePatch(){let e=this;return function(n){return function(...o){let s=this.router,i=n.apply(this,o);if(s){let a=s.stack[s.stack.length-1];e._applyPatch(a,wE(o))}return i}}}_applyPatch(e,n){let r=this;e[UO]!==!0&&(e[UO]=!0,this._wrap(e,"handle",o=>{if(o.length===4)return o;let s=function(i,a){W5(i,n);let c=i[Os].filter(A=>A!=="/"&&A!=="/*").join("").replace(/\/{2,}/g,"/"),u=c.length>0?c:void 0,l={[ql]:u},d=X5(c,e,n),p=d.attributes[zn.EXPRESS_TYPE],_=(0,VE.getRPCMetadata)(K.active());if(_?.type===VE.RPCType.HTTP&&(_.route=u),J5(d.name,p,r.getConfig()))return p===Po.MIDDLEWARE&&i[Os].pop(),o.apply(this,arguments);if(ne.getSpan(K.active())===void 0)return o.apply(this,arguments);let f=r._getSpanName({request:i,layerType:p,route:c},d.name),E=r.tracer.startSpan(f,{attributes:Object.assign(l,d.attributes)}),{requestHook:S}=r.getConfig();S&&(0,to.safeExecuteInTheMiddle)(()=>S(E,{request:i,layerType:p,route:c}),A=>{A&&On.error("express instrumentation: request hook failed",A)},!0);let g=!1;d.attributes[zn.EXPRESS_TYPE]!==Po.MIDDLEWARE&&(E.end(),g=!0);let h=()=>{g===!1&&(g=!0,E.end())},O=Array.from(arguments),N=O.findIndex(A=>typeof A=="function");N>=0&&(arguments[N]=function(){let A=arguments[0],M=![void 0,null,"route","router"].includes(A);if(!g&&M){let[J,X]=wO(A);E.recordException(J),E.setStatus({code:ve.ERROR,message:X})}return g===!1&&(g=!0,i.res?.removeListener("finish",h),E.end()),i.route&&M||i[Os].pop(),O[N].apply(this,arguments)});try{return o.apply(this,arguments)}catch(A){let[M,P]=wO(A);throw E.recordException(M),E.setStatus({code:ve.ERROR,message:P}),A}finally{g||a.once("finish",h)}};for(let i in o)Object.defineProperty(s,i,{get(){return o[i]},set(a){o[i]=a}});return s}))}_getSpanName(e,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(e,n)??n}catch(o){return On.error("express instrumentation: error calling span name rewrite hook",o),n}}};var Q5="Express",MUe="Express-V5";function e3(t){Pe(t,"auto.http.otel.express");let e=q(t).data,n=e["express.type"];n&&t.setAttribute(re,`${n}.express`);let r=e["express.name"];typeof r=="string"&&t.updateName(r)}function t3(t,e){if(Te()===Hr())return eo&&T.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),e;if(t.layerType==="request_handler"){let n=t.request,r=n.method?n.method.toUpperCase():"GET";Te().setTransactionName(`${r} ${t.route}`)}return e}var n3=F(Q5,()=>new Z5.ExpressInstrumentation({requestHook:t=>e3(t),spanNameHook:(t,e)=>t3(t,e)})),r3=F(MUe,()=>new kE({requestHook:t=>e3(t),spanNameHook:(t,e)=>t3(t,e)})),LUe=(()=>({name:Q5,setupOnce(){n3(),r3()}})),VO=LUe;var YO=v(require("node:diagnostics_channel"),1);var jO=v(require("node:diagnostics_channel"),1);L();var FE=v(fe(),1),D3=v(de(),1);Re();var N3=v(E3(),1);var md=t=>{if(typeof t!="string")throw new TypeError("invalid pattern");if(t.length>65536)throw new TypeError("pattern is too long")};var GUe={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},Ed=t=>t.replace(/[[\]\\-]/g,"\\$&"),HUe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),S3=t=>t.join(""),T3=(t,e)=>{let n=e;if(t.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],s=n+1,i=!1,a=!1,c=!1,u=!1,l=n,d="";e:for(;s<t.length;){let E=t.charAt(s);if((E==="!"||E==="^")&&s===n+1){u=!0,s++;continue}if(E==="]"&&i&&!c){l=s+1;break}if(i=!0,E==="\\"&&!c){c=!0,s++;continue}if(E==="["&&!c){for(let[S,[g,h,O]]of Object.entries(GUe))if(t.startsWith(S,s)){if(d)return["$.",!1,t.length-n,!0];s+=S.length,O?o.push(g):r.push(g),a=a||h;continue e}}if(c=!1,d){E>d?r.push(Ed(d)+"-"+Ed(E)):E===d&&r.push(Ed(E)),d="",s++;continue}if(t.startsWith("-]",s+1)){r.push(Ed(E+"-")),s+=2;continue}if(t.startsWith("-",s+1)){d=E,s+=2;continue}r.push(Ed(E)),s++}if(l<s)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,t.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!u){let E=r[0].length===2?r[0].slice(-1):r[0];return[HUe(E),!1,l-n,!1]}let p="["+(u?"^":"")+S3(r)+"]",_="["+(u?"":"^")+S3(o)+"]";return[r.length&&o.length?"("+p+"|"+_+")":r.length?p:_,a,l-n,!0]};var Ns=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/\[([^\/\\])\]/g,"$1"):t.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1");var Sn,FUe=new Set(["!","?","+","*","@"]),HO=t=>FUe.has(t),g3=t=>HO(t.type),$Ue=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),jUe=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),qUe=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),h3=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),YUe="(?!(?:^|/)\\.\\.?(?:$|/))",BE="(?!\\.)",KUe=new Set(["[","."]),WUe=new Set(["..","."]),zUe=new Set("().*{}+?[]^$\\!"),XUe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),FO="[^/]",A3=FO+"*?",R3=FO+"+?",Qi=class{type;#n;#r;#o=!1;#e=[];#t;#a;#u;#c=!1;#s;#i;#l=!1;constructor(e,n,r={}){this.type=e,e&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#s=this.#n===this?r:this.#n.#s,this.#u=this.#n===this?[]:this.#n.#u,e==="!"&&!this.#n.#c&&this.#u.push(this),this.#a=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let e of this.#e)if(typeof e!="string"&&(e.type||e.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#i!==void 0?this.#i:this.type?this.#i=this.type+"("+this.#e.map(e=>String(e)).join("|")+")":this.#i=this.#e.map(e=>String(e)).join("")}#S(){if(this!==this.#n)throw new Error("should only call on root");if(this.#c)return this;this.toString(),this.#c=!0;let e;for(;e=this.#u.pop();){if(e.type!=="!")continue;let n=e,r=n.#t;for(;r;){for(let o=n.#a+1;!r.type&&o<r.#e.length;o++)for(let s of e.#e){if(typeof s=="string")throw new Error("string part in extglob AST??");s.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...e){for(let n of e)if(n!==""){if(typeof n!="string"&&!(n instanceof Sn&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let e=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&e.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#c&&this.#t?.type==="!")&&e.push({}),e}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#a===0)return!0;let e=this.#t;for(let n=0;n<this.#a;n++){let r=e.#e[n];if(!(r instanceof Sn&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let e=this.#t?this.#t.#e.length:0;return this.#a===e-1}copyIn(e){typeof e=="string"?this.push(e):this.push(e.clone(this))}clone(e){let n=new Sn(this.type,e);for(let r of this.#e)n.copyIn(r);return n}static#d(e,n,r,o,s){let i=o.maxExtglobRecursion??2,a=!1,c=!1,u=-1,l=!1;if(n.type===null){let E=r,S="";for(;E<e.length;){let g=e.charAt(E++);if(a||g==="\\"){a=!a,S+=g;continue}if(c){E===u+1?(g==="^"||g==="!")&&(l=!0):g==="]"&&!(E===u+2&&l)&&(c=!1),S+=g;continue}else if(g==="["){c=!0,u=E,l=!1,S+=g;continue}if(!o.noext&&HO(g)&&e.charAt(E)==="("&&s<=i){n.push(S),S="";let O=new Sn(g,n);E=Sn.#d(e,O,E,o,s+1),n.push(O);continue}S+=g}return n.push(S),E}let d=r+1,p=new Sn(null,n),_=[],f="";for(;d<e.length;){let E=e.charAt(d++);if(a||E==="\\"){a=!a,f+=E;continue}if(c){d===u+1?(E==="^"||E==="!")&&(l=!0):E==="]"&&!(d===u+2&&l)&&(c=!1),f+=E;continue}else if(E==="["){c=!0,u=d,l=!1,f+=E;continue}if(HO(E)&&e.charAt(d)==="("&&(s<=i||n&&n.#p(E))){let g=n&&n.#p(E)?0:1;p.push(f),f="";let h=new Sn(E,p);p.push(h),d=Sn.#d(e,h,d,o,s+g);continue}if(E==="|"){p.push(f),f="",_.push(p),p=new Sn(null,n);continue}if(E===")")return f===""&&n.#e.length===0&&(n.#l=!0),p.push(f),f="",n.push(..._,p),d;f+=E}return n.type=null,n.#r=void 0,n.#e=[e.substring(r-1)],d}#T(e){return this.#f(e,jUe)}#f(e,n=$Ue){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null)return!1;let r=e.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(e,n=qUe){return!!n.get(this.type)?.includes(e)}#g(e,n){let r=e.#e[0],o=new Sn(null,r,this.options);o.#e.push(""),r.push(o),this.#m(e,n)}#m(e,n){let r=e.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#i=void 0}#h(e){return!!h3.get(this.type)?.has(e)}#A(e){if(!e||typeof e!="object"||e.type!==null||e.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=e.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#h(n.type)}#R(e){let n=h3.get(this.type),r=e.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let s of this.#e)typeof s=="object"&&(s.#t=this);this.type=o,this.#i=void 0,this.#l=!1}#_(){if(g3(this)){let e=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#_(),this.#f(o)?(n=!1,this.#m(o,r)):this.#T(o)?(n=!1,this.#g(o,r)):this.#A(o)&&(n=!1,this.#R(o)))}}while(!n&&++e<10)}else for(let e of this.#e)typeof e=="object"&&e.#_();this.#i=void 0}static fromGlob(e,n={}){let r=new Sn(null,void 0,n);return Sn.#d(e,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let e=this.toString(),[n,r,o,s]=this.toRegExpSource();if(!(o||this.#r||this.#s.nocase&&!this.#s.nocaseMagicOnly&&e.toUpperCase()!==e.toLowerCase()))return r;let a=(this.#s.nocase?"i":"")+(s?"u":"");return Object.assign(new RegExp(`^${n}$`,a),{_src:n,_glob:e})}get options(){return this.#s}toRegExpSource(e){let n=e??!!this.#s.dot;if(this.#n===this&&(this.#_(),this.#S()),!g3(this)){let c=this.isStart()&&this.isEnd(),u=this.#e.map(_=>{let[f,E,S,g]=typeof _=="string"?Sn.#y(_,this.#r,c):_.toRegExpSource(e);return this.#r=this.#r||S,this.#o=this.#o||g,f}).join(""),l="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&WUe.has(this.#e[0]))){let f=KUe,E=n&&f.has(u.charAt(0))||u.startsWith("\\.")&&f.has(u.charAt(2))||u.startsWith("\\.\\.")&&f.has(u.charAt(4)),S=!n&&!e&&f.has(u.charAt(0));l=E?YUe:S?BE:""}let d="";return this.isEnd()&&this.#n.#c&&this.#t?.type==="!"&&(d="(?:$|\\/)"),[l+u+d,Ns(u),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",s=this.#E(n);if(this.isStart()&&this.isEnd()&&!s&&this.type!=="!"){let c=this.toString(),u=this;return u.#e=[c],u.type=null,u.#r=void 0,[c,Ns(this.toString()),!1,!1]}let i=!r||e||n||!BE?"":this.#E(!0);i===s&&(i=""),i&&(s=`(?:${s})(?:${i})*?`);let a="";if(this.type==="!"&&this.#l)a=(this.isStart()&&!n?BE:"")+R3;else{let c=this.type==="!"?"))"+(this.isStart()&&!n&&!e?BE:"")+A3+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&i?")":this.type==="*"&&i?")?":`)${this.type}`;a=o+s+c}return[a,Ns(s),this.#r=!!this.#r,this.#o]}#E(e){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,s,i]=n.toRegExpSource(e);return this.#o=this.#o||i,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#y(e,n,r=!1){let o=!1,s="",i=!1,a=!1;for(let c=0;c<e.length;c++){let u=e.charAt(c);if(o){o=!1,s+=(zUe.has(u)?"\\":"")+u,a=!1;continue}if(u==="\\"){c===e.length-1?s+="\\\\":o=!0;continue}if(u==="["){let[l,d,p,_]=T3(e,c);if(p){s+=l,i=i||d,c+=p-1,n=n||_,a=!1;continue}}if(u==="*"){if(a)continue;a=!0,s+=r&&/^[*]+$/.test(e)?R3:A3,n=!0;continue}else a=!1;if(u==="?"){s+=FO,n=!0;continue}s+=XUe(u)}return[s,Ns(e),!!n,i]}};Sn=Qi;var $O=(t,{windowsPathsNoEscape:e=!1}={})=>e?t.replace(/[?*()[\]]/g,"[$&]"):t.replace(/[?*()[\]\\]/g,"\\$&");var bt=(t,e,n={})=>(md(e),!n.nocomment&&e.charAt(0)==="#"?!1:new Wc(e,n).match(t)),JUe=/^\*+([^+@!?\*\[\(]*)$/,ZUe=t=>e=>!e.startsWith(".")&&e.endsWith(t),QUe=t=>e=>e.endsWith(t),ewe=t=>(t=t.toLowerCase(),e=>!e.startsWith(".")&&e.toLowerCase().endsWith(t)),twe=t=>(t=t.toLowerCase(),e=>e.toLowerCase().endsWith(t)),nwe=/^\*+\.\*+$/,rwe=t=>!t.startsWith(".")&&t.includes("."),owe=t=>t!=="."&&t!==".."&&t.includes("."),swe=/^\.\*+$/,iwe=t=>t!=="."&&t!==".."&&t.startsWith("."),awe=/^\*+$/,cwe=t=>t.length!==0&&!t.startsWith("."),uwe=t=>t.length!==0&&t!=="."&&t!=="..",lwe=/^\?+([^+@!?\*\[\(]*)?$/,dwe=([t,e=""])=>{let n=C3([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},pwe=([t,e=""])=>{let n=v3([t]);return e?(e=e.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(e)):n},_we=([t,e=""])=>{let n=v3([t]);return e?r=>n(r)&&r.endsWith(e):n},fwe=([t,e=""])=>{let n=C3([t]);return e?r=>n(r)&&r.endsWith(e):n},C3=([t])=>{let e=t.length;return n=>n.length===e&&!n.startsWith(".")},v3=([t])=>{let e=t.length;return n=>n.length===e&&n!=="."&&n!==".."},I3=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",y3={win32:{sep:"\\"},posix:{sep:"/"}},mwe=I3==="win32"?y3.win32.sep:y3.posix.sep;bt.sep=mwe;var Yt=Symbol("globstar **");bt.GLOBSTAR=Yt;var Ewe="[^/]",Swe=Ewe+"*?",Twe="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",gwe="(?:(?!(?:\\/|^)\\.).)*?",hwe=(t,e={})=>n=>bt(n,t,e);bt.filter=hwe;var Xn=(t,e={})=>Object.assign({},t,e),Awe=t=>{if(!t||typeof t!="object"||!Object.keys(t).length)return bt;let e=bt;return Object.assign((r,o,s={})=>e(r,o,Xn(t,s)),{Minimatch:class extends e.Minimatch{constructor(o,s={}){super(o,Xn(t,s))}static defaults(o){return e.defaults(Xn(t,o)).Minimatch}},AST:class extends e.AST{constructor(o,s,i={}){super(o,s,Xn(t,i))}static fromGlob(o,s={}){return e.AST.fromGlob(o,Xn(t,s))}},unescape:(r,o={})=>e.unescape(r,Xn(t,o)),escape:(r,o={})=>e.escape(r,Xn(t,o)),filter:(r,o={})=>e.filter(r,Xn(t,o)),defaults:r=>e.defaults(Xn(t,r)),makeRe:(r,o={})=>e.makeRe(r,Xn(t,o)),braceExpand:(r,o={})=>e.braceExpand(r,Xn(t,o)),match:(r,o,s={})=>e.match(r,o,Xn(t,s)),sep:e.sep,GLOBSTAR:Yt})};bt.defaults=Awe;var P3=(t,e={})=>(md(t),e.nobrace||!/\{(?:(?!\{).)*\}/.test(t)?[t]:(0,N3.default)(t));bt.braceExpand=P3;var Rwe=(t,e={})=>new Wc(t,e).makeRe();bt.makeRe=Rwe;var ywe=(t,e,n={})=>{let r=new Wc(e,n);return t=t.filter(o=>r.match(o)),r.options.nonull&&!t.length&&t.push(e),t};bt.match=ywe;var O3=/[?*]|[+@!]\(.*?\)|\[|\]/,Owe=t=>t.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),Wc=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(e,n={}){md(e),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=e,this.platform=n.platform||I3,this.isWindows=this.platform==="win32",this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n.allowWindowsEscape===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let e of this.set)for(let n of e)if(typeof n!="string")return!0;return!1}debug(...e){}make(){let e=this.pattern,n=this.options;if(!n.nocomment&&e.charAt(0)==="#"){this.comment=!0;return}if(!e){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...s)=>console.error(...s)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(s=>this.slashSplit(s));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((s,i,a)=>{if(this.isWindows&&this.windowsNoMagicRoot){let c=s[0]===""&&s[1]===""&&(s[2]==="?"||!O3.test(s[2]))&&!O3.test(s[3]),u=/^[a-z]:/i.test(s[0]);if(c)return[...s.slice(0,4),...s.slice(4).map(l=>this.parse(l))];if(u)return[s[0],...s.slice(1).map(l=>this.parse(l))]}return s.map(c=>this.parse(c))});if(this.debug(this.pattern,o),this.set=o.filter(s=>s.indexOf(!1)===-1),this.isWindows)for(let s=0;s<this.set.length;s++){let i=this.set[s];i[0]===""&&i[1]===""&&this.globParts[s][2]==="?"&&typeof i[3]=="string"&&/^[a-z]:$/i.test(i[3])&&(i[2]="?")}this.debug(this.pattern,this.set)}preprocess(e){if(this.options.noglobstar)for(let r=0;r<e.length;r++)for(let o=0;o<e[r].length;o++)e[r][o]==="**"&&(e[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(e=this.firstPhasePreProcess(e),e=this.secondPhasePreProcess(e)):n>=1?e=this.levelOneOptimize(e):e=this.adjascentGlobstarOptimize(e),e}adjascentGlobstarOptimize(e){return e.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(e){return e.map(n=>(n=n.reduce((r,o)=>{let s=r[r.length-1];return o==="**"&&s==="**"?r:o===".."&&s&&s!==".."&&s!=="."&&s!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(e){Array.isArray(e)||(e=this.slashSplit(e));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<e.length-1;o++){let s=e[o];o===1&&s===""&&e[0]===""||(s==="."||s==="")&&(n=!0,e.splice(o,1),o--)}e[0]==="."&&e.length===2&&(e[1]==="."||e[1]==="")&&(n=!0,e.pop())}let r=0;for(;(r=e.indexOf("..",r+1))!==-1;){let o=e[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,e.splice(r-1,2),r-=2)}}while(n);return e.length===0?[""]:e}firstPhasePreProcess(e){let n=!1;do{n=!1;for(let r of e){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let i=o;for(;r[i+1]==="**";)i++;i>o&&r.splice(o+1,i-o);let a=r[o+1],c=r[o+2],u=r[o+3];if(a!==".."||!c||c==="."||c===".."||!u||u==="."||u==="..")continue;n=!0,r.splice(o,1);let l=r.slice(0);l[o]="**",e.push(l),o--}if(!this.preserveMultipleSlashes){for(let i=1;i<r.length-1;i++){let a=r[i];i===1&&a===""&&r[0]===""||(a==="."||a==="")&&(n=!0,r.splice(i,1),i--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let s=0;for(;(s=r.indexOf("..",s+1))!==-1;){let i=r[s-1];if(i&&i!=="."&&i!==".."&&i!=="**"){n=!0;let c=s===1&&r[s+1]==="**"?["."]:[];r.splice(s-1,2,...c),r.length===0&&r.push(""),s-=2}}}}while(n);return e}secondPhasePreProcess(e){for(let n=0;n<e.length-1;n++)for(let r=n+1;r<e.length;r++){let o=this.partsMatch(e[n],e[r],!this.preserveMultipleSlashes);if(o){e[n]=[],e[r]=o;break}}return e.filter(n=>n.length)}partsMatch(e,n,r=!1){let o=0,s=0,i=[],a="";for(;o<e.length&&s<n.length;)if(e[o]===n[s])i.push(a==="b"?n[s]:e[o]),o++,s++;else if(r&&e[o]==="**"&&n[s]===e[o+1])i.push(e[o]),o++;else if(r&&n[s]==="**"&&e[o]===n[s+1])i.push(n[s]),s++;else if(e[o]==="*"&&n[s]&&(this.options.dot||!n[s].startsWith("."))&&n[s]!=="**"){if(a==="b")return!1;a="a",i.push(e[o]),o++,s++}else if(n[s]==="*"&&e[o]&&(this.options.dot||!e[o].startsWith("."))&&e[o]!=="**"){if(a==="a")return!1;a="b",i.push(n[s]),o++,s++}else return!1;return e.length===n.length&&i}parseNegate(){if(this.nonegate)return;let e=this.pattern,n=!1,r=0;for(let o=0;o<e.length&&e.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=e.slice(r)),this.negate=n}matchOne(e,n,r=!1){let o=0,s=0;if(this.isWindows){let a=typeof e[0]=="string"&&/^[a-z]:$/i.test(e[0]),c=!a&&e[0]===""&&e[1]===""&&e[2]==="?"&&/^[a-z]:$/i.test(e[3]),u=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),l=!u&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),d=c?3:a?0:void 0,p=l?3:u?0:void 0;if(typeof d=="number"&&typeof p=="number"){let[_,f]=[e[d],n[p]];_.toLowerCase()===f.toLowerCase()&&(n[p]=_,s=p,o=d)}}let{optimizationLevel:i=1}=this.options;return i>=2&&(e=this.levelTwoFileOptimize(e)),n.includes(Yt)?this.#n(e,n,r,o,s):this.#o(e,n,r,o,s)}#n(e,n,r,o,s){let i=n.indexOf(Yt,s),a=n.lastIndexOf(Yt),[c,u,l]=r?[n.slice(s,i),n.slice(i+1),[]]:[n.slice(s,i),n.slice(i+1,a),n.slice(a+1)];if(c.length){let h=e.slice(o,o+c.length);if(!this.#o(h,c,r,0,0))return!1;o+=c.length}let d=0;if(l.length){if(l.length+o>e.length)return!1;let h=e.length-l.length;if(this.#o(e,l,r,h,0))d=l.length;else{if(e[e.length-1]!==""||o+l.length===e.length||(h--,!this.#o(e,l,r,h,0)))return!1;d=l.length+1}}if(!u.length){let h=!!d;for(let O=o;O<e.length-d;O++){let N=String(e[O]);if(h=!0,N==="."||N===".."||!this.options.dot&&N.startsWith("."))return!1}return r||h}let p=[[[],0]],_=p[0],f=0,E=[0];for(let h of u)h===Yt?(E.push(f),_=[[],0],p.push(_)):(_[0].push(h),f++);let S=p.length-1,g=e.length-d;for(let h of p)h[1]=g-(E[S--]+h[0].length);return!!this.#r(e,p,o,0,r,0,!!d)}#r(e,n,r,o,s,i,a){let c=n[o];if(!c){for(let d=r;d<e.length;d++){a=!0;let p=e[d];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1}return a}let[u,l]=c;for(;r<=l;){if(this.#o(e.slice(0,r+u.length),u,s,r,0)&&i<this.maxGlobstarRecursion){let _=this.#r(e,n,r+u.length,o+1,s,i+1,a);if(_!==!1)return _}let p=e[r];if(p==="."||p===".."||!this.options.dot&&p.startsWith("."))return!1;r++}return s||null}#o(e,n,r,o,s){let i,a,c,u;for(i=o,a=s,u=e.length,c=n.length;i<u&&a<c;i++,a++){this.debug("matchOne loop");let l=n[a],d=e[i];if(this.debug(n,l,d),l===!1||l===Yt)return!1;let p;if(typeof l=="string"?(p=d===l,this.debug("string match",l,d,p)):(p=l.test(d),this.debug("pattern match",l,d,p)),!p)return!1}if(i===u&&a===c)return!0;if(i===u)return r;if(a===c)return i===u-1&&e[i]==="";throw new Error("wtf?")}braceExpand(){return P3(this.pattern,this.options)}parse(e){md(e);let n=this.options;if(e==="**")return Yt;if(e==="")return"";let r,o=null;(r=e.match(awe))?o=n.dot?uwe:cwe:(r=e.match(JUe))?o=(n.nocase?n.dot?twe:ewe:n.dot?QUe:ZUe)(r[1]):(r=e.match(lwe))?o=(n.nocase?n.dot?pwe:dwe:n.dot?_we:fwe)(r):(r=e.match(nwe))?o=n.dot?owe:rwe:(r=e.match(swe))&&(o=iwe);let s=Qi.fromGlob(e,this.options).toMMPattern();return o&&typeof s=="object"&&Reflect.defineProperty(s,"test",{value:o}),s}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let e=this.set;if(!e.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?Swe:n.dot?Twe:gwe,o=new Set(n.nocase?["i"]:[]),s=e.map(c=>{let u=c.map(l=>{if(l instanceof RegExp)for(let d of l.flags.split(""))o.add(d);return typeof l=="string"?Owe(l):l===Yt?Yt:l._src});return u.forEach((l,d)=>{let p=u[d+1],_=u[d-1];l!==Yt||_===Yt||(_===void 0?p!==void 0&&p!==Yt?u[d+1]="(?:\\/|"+r+"\\/)?"+p:u[d]=r:p===void 0?u[d-1]=_+"(?:\\/|"+r+")?":p!==Yt&&(u[d-1]=_+"(?:\\/|\\/"+r+"\\/)"+p,u[d+1]=Yt))}),u.filter(l=>l!==Yt).join("/")}).join("|"),[i,a]=e.length>1?["(?:",")"]:["",""];s="^"+i+s+a+"$",this.negate&&(s="^(?!"+s+").+$");try{this.regexp=new RegExp(s,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(e){return this.preserveMultipleSlashes?e.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(e)?["",...e.split(/\/+/)]:e.split(/\/+/)}match(e,n=this.partial){if(this.debug("match",e,this.pattern),this.comment)return!1;if(this.empty)return e==="";if(e==="/"&&n)return!0;let r=this.options;this.isWindows&&(e=e.split("\\").join("/"));let o=this.slashSplit(e);this.debug(this.pattern,"split",o);let s=this.set;this.debug(this.pattern,"set",s);let i=o[o.length-1];if(!i)for(let a=o.length-2;!i&&a>=0;a--)i=o[a];for(let a=0;a<s.length;a++){let c=s[a],u=o;if(r.matchBase&&c.length===1&&(u=[i]),this.matchOne(u,c,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(e){return bt.defaults(e).Minimatch}};bt.AST=Qi;bt.Minimatch=Wc;bt.escape=$O;bt.unescape=Ns;var b3="@fastify/otel",Cwe="0.8.0",vwe=">=4.0.0 <6",M3=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],be={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},Cs={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},bo="anonymous",nn=Symbol("fastify otel instance"),vs=Symbol("fastify otel request spans"),Sd=Symbol("fastify otel request context"),L3=Symbol("fastify otel addhook original"),x3=Symbol("fastify otel setnotfound original"),GE=Symbol("fastify otel ignore path"),HE=class extends D3.InstrumentationBase{constructor(e){if(super(b3,Cwe,e),this.servername=e?.servername??process.env.OTEL_SERVICE_NAME??"fastify",this[GE]=null,this._logger=On.createComponentLogger({namespace:b3}),e?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=e?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=bt;this[GE]=o=>typeof n=="function"?n(o):r(o.url,n)}}enable(){if(this._handleInitialization===void 0&&this.getConfig().registerOnInitialization){let e=this.plugin();this._handleInitialization=n=>{n.fastify.register(e)},jO.default.subscribe("fastify.initialization",this._handleInitialization)}return super.enable()}disable(){return this._handleInitialization&&(jO.default.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let e=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:vwe,name:"@fastify/otel"},n;function n(r,o,s){r.decorate(nn,e),r.decorate(L3,r.addHook),r.decorate(x3,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let p=this[Sd];return{span:this[vs],tracer:e.tracer,context:p,inject:(f,E)=>Xt.inject(p,f,E),extract:(f,E)=>Xt.extract(p,f,E)}}),r.decorateRequest(vs,null),r.decorateRequest(Sd,null),r.addHook("onRoute",function(d){if(e[GE]?.(d)===!0){e._logger.debug(`Ignoring route instrumentation ${d.method} ${d.url} because it matches the ignore path`);return}for(let p of M3)if(d[p]!=null){let _=d[p];if(typeof _=="function")d[p]=l(_,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route -> ${p}`,[be.FASTIFY_TYPE]:Cs.ROUTE,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:_.name?.length>0?_.name:bo});else if(Array.isArray(_)){let f=[];for(let E of _)f.push(l(E,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route -> ${p}`,[be.FASTIFY_TYPE]:Cs.ROUTE,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:E.name?.length>0?E.name:bo}));d[p]=f}}d.onSend!=null?d.onSend=Array.isArray(d.onSend)?[...d.onSend,i]:[d.onSend,i]:d.onSend=i,d.onError!=null?d.onError=Array.isArray(d.onError)?[...d.onError,a]:[d.onError,a]:d.onError=a,d.handler=l(d.handler,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - route-handler`,[be.FASTIFY_TYPE]:Cs.HANDLER,[Wr]:d.url,[be.HOOK_CALLBACK_NAME]:d.handler.name.length>0?d.handler.name:bo})}),r.addHook("onRequest",function(d,p,_){if(this[nn].isEnabled()===!1)return _();if(this[nn][GE]?.({url:d.url,method:d.method})===!0)return this[nn]._logger.debug(`Ignoring request ${d.method} ${d.url} because it matches the ignore path`),_();let f=K.active();ne.getSpan(f)==null&&(f=Xt.extract(f,d.headers));let E=(0,FE.getRPCMetadata)(f);d.routeOptions.url!=null&&E?.type===FE.RPCType.HTTP&&(E.route=d.routeOptions.url);let S=this[nn].tracer.startSpan("request",{attributes:{[Pn]:r[nn].servername,[be.ROOT]:"@fastify/otel",[Wr]:d.url,[Fi]:d.method}},f);d[Sd]=ne.setSpan(f,S),d[vs]=S,K.with(d[Sd],()=>{_()})}),r.addHook("onResponse",function(d,p,_){let f=d[vs];f!=null&&(f.setStatus({code:ve.OK,message:"OK"}),f.setAttributes({[hs]:404}),f.end()),d[vs]=null,_()}),r.addHook=c,r.setNotFoundHandler=u,s();function i(d,p,_,f){let E=d[vs];E!=null&&(p.statusCode<500&&E.setStatus({code:ve.OK,message:"OK"}),E.setAttributes({[hs]:p.statusCode}),E.end()),d[vs]=null,f(null,_)}function a(d,p,_,f){let E=d[vs];E!=null&&(E.setStatus({code:ve.ERROR,message:_.message}),E.recordException(_)),f()}function c(d,p){let _=this[L3];return M3.includes(d)?_.call(this,d,l(p,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - ${d}`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:p.name?.length>0?p.name:bo})):_.call(this,d,p)}function u(d,p){let _=this[x3];typeof d=="function"?(p=l(d,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.name?.length>0?d.name:bo}),_.call(this,p)):(d.preValidation!=null&&(d.preValidation=l(d.preValidation,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.preValidation.name?.length>0?d.preValidation.name:bo})),d.preHandler!=null&&(d.preHandler=l(d.preHandler,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:d.preHandler.name?.length>0?d.preHandler.name:bo})),p=l(p,{[Pn]:r[nn].servername,[be.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[be.FASTIFY_TYPE]:Cs.INSTANCE,[be.HOOK_CALLBACK_NAME]:p.name?.length>0?p.name:bo}),_.call(this,d,p))}function l(d,p={}){return function(...f){let E=this[nn],[S]=f;if(E.isEnabled()===!1)return d.call(this,...f);let g=S[Sd]??K.active(),h=E.tracer.startSpan(`handler - ${d.name?.length>0?d.name:this.pluginName??bo}`,{attributes:p},g);return K.with(ne.setSpan(g,h),function(){try{let O=d.call(this,...f);return typeof O?.then=="function"?O.then(N=>(h.end(),N),N=>(h.setStatus({code:ve.ERROR,message:N.message}),h.recordException(N),h.end(),Promise.reject(N))):(h.end(),O)}catch(O){throw h.setStatus({code:ve.ERROR,message:O.message}),h.recordException(O),h.end(),O}},this)}}}}};L();var qE=v(fe(),1),ea=v(de(),1);Re();var Mo;(function(t){let e="fastify.name";t.FASTIFY_NAME=e;let n="fastify.type";t.FASTIFY_TYPE=n;let r="hook.name";t.HOOK_NAME=r;let o="plugin.name";t.PLUGIN_NAME=o})(Mo||(Mo={}));var Td;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request_handler";t.REQUEST_HANDLER=n})(Td||(Td={}));var gd;(function(t){let e="middleware";t.MIDDLEWARE=e;let n="request handler";t.REQUEST_HANDLER=n})(gd||(gd={}));L();var hd=Symbol("opentelemetry.instrumentation.fastify.request_active_span");function qO(t,e,n,r={}){let o=e.startSpan(n,{attributes:r}),s=t[hd]||[];return s.push(o),Object.defineProperty(t,hd,{enumerable:!1,configurable:!0,value:s}),o}function $E(t,e){let n=t[hd]||[];n.length&&(n.forEach(r=>{e&&(r.setStatus({code:ve.ERROR,message:e.message}),r.recordException(e)),r.end()}),delete t[hd])}function w3(t,e,n){let r,o;try{o=t(),U3(o)&&o.then(s=>e(void 0,s),s=>e(s))}catch(s){r=s}finally{if(!U3(o)&&(e(r,o),r))throw r;return o}}function U3(t){return typeof t=="object"&&t&&typeof Object.getOwnPropertyDescriptor(t,"then")?.value=="function"||!1}var Iwe="0.1.0",Pwe="@sentry/instrumentation-fastify-v3",k3="anonymous",bwe=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),jE=class extends ea.InstrumentationBase{constructor(e={}){super(Pwe,Iwe,e)}init(){return[new ea.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],e=>this._patchConstructor(e))]}_hookOnRequest(){let e=this;return function(r,o,s){if(!e.isEnabled())return s();e._wrap(o,"send",e._patchSend());let i=r,a=(0,qE.getRPCMetadata)(K.active()),c=i.routeOptions?i.routeOptions.url:r.routerPath;c&&a?.type===qE.RPCType.HTTP&&(a.route=c);let u=r.method||"GET";Te().setTransactionName(`${u} ${c}`),s()}}_wrapHandler(e,n,r,o){let s=this;return this._diag.debug("Patching fastify route.handler function"),function(...i){if(!s.isEnabled())return r.apply(this,i);let a=r.name||e||k3,c=`${gd.MIDDLEWARE} - ${a}`,u=i[1],l=qO(u,s.tracer,c,{[Mo.FASTIFY_TYPE]:Td.MIDDLEWARE,[Mo.PLUGIN_NAME]:e,[Mo.HOOK_NAME]:n}),d=o&&i[i.length-1];return d&&(i[i.length-1]=function(...p){$E(u),d.apply(this,p)}),K.with(ne.setSpan(K.active(),l),()=>w3(()=>r.apply(this,i),p=>{p instanceof Error&&(l.setStatus({code:ve.ERROR,message:p.message}),l.recordException(p)),o||$E(u)}))}}_wrapAddHook(){let e=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let s=o[0],i=o[1],a=this.pluginName;if(!bwe.has(s))return n.apply(this,o);let c=typeof o[o.length-1]=="function"&&i.constructor.name!=="AsyncFunction";return n.apply(this,[s,e._wrapHandler(a,s,i,c)])}}}_patchConstructor(e){let n=this;function r(...o){let s=e.fastify.apply(this,o);return s.addHook("onRequest",n._hookOnRequest()),s.addHook("preHandler",n._hookPreHandler()),Mwe(),n._wrap(s,"addHook",n._wrapAddHook()),s}return e.errorCodes!==void 0&&(r.errorCodes=e.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let e=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...s){let i=s[0];return e.isEnabled()?(0,ea.safeExecuteInTheMiddle)(()=>r.apply(this,s),a=>{!a&&i instanceof Error&&(a=i),$E(this,a)}):r.apply(this,s)}}}_hookPreHandler(){let e=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,s){if(!e.isEnabled())return s();let i=r,a=i.routeOptions?.handler||i.context?.handler,c=a?.name.startsWith("bound ")?a.name.substring(6):a?.name,u=`${gd.REQUEST_HANDLER} - ${c||this.pluginName||k3}`,l={[Mo.PLUGIN_NAME]:this.pluginName,[Mo.FASTIFY_TYPE]:Td.REQUEST_HANDLER,[ql]:i.routeOptions?i.routeOptions.url:r.routerPath};c&&(l[Mo.FASTIFY_NAME]=c);let d=qO(o,e.tracer,u,l);V3(d);let{requestHook:p}=e.getConfig();return p&&(0,ea.safeExecuteInTheMiddle)(()=>p(d,{request:r}),_=>{_&&e._diag.error("request hook failed",_)},!0),K.with(ne.setSpan(K.active(),d),()=>{s()})}}};function Mwe(){let t=j();t&&t.on("spanStart",e=>{V3(e)})}function V3(t){let e=q(t).data,n=e["fastify.type"];if(e[re]||!n)return;t.setAttributes({[ge]:"auto.http.otel.fastify",[re]:`${n}.fastify`});let r=e["fastify.name"]||e["plugin.name"]||e["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(o)}}var G3="Fastify",Lwe="Fastify-V5",xwe="Fastify-V3",H3=F(xwe,()=>new jE);function Dwe(){let t=j();if(t)return t.getIntegrationByName(G3)}function B3(t,e,n,r){let o=Dwe()?.getShouldHandleError()||j3;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){eo&&T.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(t,e,n)&&tn(t,{mechanism:{handled:!1,type:"fastify"}})}var F3=F(Lwe,()=>{let t=new HE,e=t.plugin();return YO.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(e).after(o=>{o?eo&&T.error("Failed to setup Fastify instrumentation",o):(wwe(),r&&kwe(r))})}),YO.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:s}=n;B3.call(B3,r,o,s,"diagnostics-channel")}),t}),Uwe=(({shouldHandleError:t})=>{let e;return{name:G3,setupOnce(){e=t||j3,H3(),F3()},getShouldHandleError(){return e},setShouldHandleError(n){e=n}}}),$3=(t={})=>Uwe(t);function j3(t,e,n){let r=n.statusCode;return r>=500||r<=299}function q3(t){let e=q(t),n=e.description,r=e.data,o=r["fastify.type"],s=o==="hook",i=o===n?.startsWith("handler -"),a=n==="request"||o==="request-handler";if(r[re]||!i&&!a&&!s)return;let c=s?"hook":i?"middleware":a?"request-handler":"<unknown>";t.setAttributes({[ge]:"auto.http.otel.fastify",[re]:`${c}.fastify`});let u=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof u=="string"){let l=u.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");t.updateName(l)}}function wwe(){let t=j();t&&t.on("spanStart",e=>{q3(e)})}function kwe(t){t.addHook("onRequest",async(e,n)=>{if(e.opentelemetry){let{span:s}=e.opentelemetry();s&&q3(s)}let r=e.routeOptions?.url,o=e.method||"GET";Te().setTransactionName(`${o} ${r}`)})}L();var _z=v(pz(),1);var fz="Graphql",mz=F(fz,_z.GraphQLInstrumentation,t=>{let e=Sz(t);return{...e,responseHook(n,r){Pe(n,"auto.graphql.otel.graphql"),r.errors?.length&&!q(n).status&&n.setStatus({code:ve.ERROR});let s=q(n).data,i=s["graphql.operation.type"],a=s["graphql.operation.name"];if(e.useOperationNameForRootSpan&&i){let c=$e(n),l=q(c).data[kc]||[],d=a?`${i} ${a}`:`${i}`;Array.isArray(l)?(l.push(d),c.setAttribute(kc,l)):typeof l=="string"?c.setAttribute(kc,[l,d]):c.setAttribute(kc,d),q(c).data["original-description"]||c.setAttribute("original-description",q(c).description),c.updateName(`${q(c).data["original-description"]} (${n1e(l)})`)}}}}),t1e=((t={})=>({name:fz,setupOnce(){mz(Sz(t))}})),Ez=t1e;function Sz(t){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...t}}function n1e(t){if(Array.isArray(t)){let e=t.slice().sort();return e.length<=5?e.join(", "):`${e.slice(0,5).join(", ")}, +${e.length-5}`}return`${t}`}var vz=v(Cz(),1);var Iz="Kafka",Pz=F(Iz,()=>new vz.KafkaJsInstrumentation({consumerHook(t){Pe(t,"auto.kafkajs.otel.consumer")},producerHook(t){Pe(t,"auto.kafkajs.otel.producer")}})),o1e=(()=>({name:Iz,setupOnce(){Pz()}})),bz=o1e;var kz=v(wz(),1);var Vz="LruMemoizer",Bz=F(Vz,()=>new kz.LruMemoizerInstrumentation),a1e=(()=>({name:Vz,setupOnce(){Bz()}})),Gz=a1e;var zz=v(Wz(),1);var Xz="Mongo",Jz=F(Xz,()=>new zz.MongoDBInstrumentation({dbStatementSerializer:d1e,responseHook(t){Pe(t,"auto.db.otel.mongo")}}));function d1e(t){let e=tN(t);return JSON.stringify(e)}function tN(t){if(Array.isArray(t))return t.map(e=>tN(e));if(p1e(t)){let e={};return Object.entries(t).map(([n,r])=>[n,tN(r)]).reduce((n,r)=>(f1e(r)&&(n[r[0]]=r[1]),n),e)}return"?"}function p1e(t){return typeof t=="object"&&t!==null&&!_1e(t)}function _1e(t){let e=!1;return typeof Buffer<"u"&&(e=Buffer.isBuffer(t)),e}function f1e(t){return Array.isArray(t)}var m1e=(()=>({name:Xz,setupOnce(){Jz()}})),Zz=m1e;var pX=v(dX(),1);var _X="Mongoose",fX=F(_X,()=>new pX.MongooseInstrumentation({responseHook(t){Pe(t,"auto.db.otel.mongoose")}})),N1e=(()=>({name:_X,setupOnce(){fX()}})),mX=N1e;var CX=v(NX(),1);var vX="Mysql",IX=F(vX,()=>new CX.MySQLInstrumentation({})),U1e=(()=>({name:vX,setupOnce(){IX()}})),PX=U1e;var HX=v(GX(),1);var FX="Mysql2",$X=F(FX,()=>new HX.MySQL2Instrumentation({responseHook(t){Pe(t,"auto.db.otel.mysql2")}})),K1e=(()=>({name:FX,setupOnce(){$X()}})),jX=K1e;var E9=v(e9(),1),S9=v(d9(),1);var ske=["get","set","setex"],_N=["get","mget"],ike=["set","setex"];function Md(t,e){return t.includes(e.toLowerCase())}function fN(t){return Md(_N,t)?"cache.get":Md(ike,t)?"cache.put":void 0}function ake(t,e){return e.some(n=>t.startsWith(n))}function _9(t,e){try{if(e.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?p9(o.map(s=>n(s))):["<unknown>"],r=e[0];return Md(ske,t)&&r!=null?n(r):p9(e.map(o=>n(o)))}catch{return}}function f9(t,e,n){if(!fN(t))return!1;for(let r of e)if(ake(r,n))return!0;return!1}function m9(t){let e=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(t)?t.reduce((n,r)=>{let o=e(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):e(t)}function p9(t){let e=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):e.push(o)})};return n(t),e}var T9="Redis",mN={},g9=(t,e,n,r)=>{t.setAttribute(ge,"auto.db.otel.redis");let o=_9(e,n),s=fN(e);if(!o||!s||!mN.cachePrefixes||!f9(e,o,mN.cachePrefixes))return;let i=q(t).data["net.peer.name"],a=q(t).data["net.peer.port"];a&&i&&t.setAttributes({"network.peer.address":i,"network.peer.port":a});let c=m9(r);c&&t.setAttribute(QA,c),Md(_N,e)&&c!==void 0&&t.setAttribute(JA,c>0),t.setAttributes({[re]:s,[ZA]:o});let u=o.join(", ");t.updateName(Gr(u,1024))},cke=F("IORedis",()=>new E9.IORedisInstrumentation({responseHook:g9})),uke=F("Redis-4",()=>new S9.RedisInstrumentation({responseHook:g9})),h9=Object.assign(()=>{cke(),uke()},{id:T9}),lke=((t={})=>({name:T9,setupOnce(){mN=t,h9()}})),A9=lke;var G9=v(B9(),1);var H9="Postgres",F9=F(H9,()=>new G9.PgInstrumentation({requireParentSpan:!0,requestHook(t){Pe(t,"auto.db.otel.postgres")}})),Nke=(()=>({name:H9,setupOnce(){F9()}})),$9=Nke;L();var Vo=v(de(),1);Re();var yN="PostgresJs",j9=[">=3.0.0 <4"],q9=F(yN,t=>new RN({requireParentSpan:t?.requireParentSpan??!0,requestHook:t?.requestHook})),RN=class extends Vo.InstrumentationBase{constructor(e){super("sentry-postgres-js",Oe,e)}init(){let e=new Vo.InstrumentationNodeModuleDefinition("postgres",j9);return["src","cf/src","cjs/src"].forEach(n=>{e.files.push(new Vo.InstrumentationNodeModuleFile(`postgres/${n}/connection.js`,["*"],this._patchConnection.bind(this),this._unwrap.bind(this))),e.files.push(new Vo.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,j9,this._patchQuery.bind(this),this._unwrap.bind(this)))}),[e]}_shouldCreateSpans(){let e=this.getConfig();return ne.getSpan(K.active())!==void 0||!e.requireParentSpan}_patchReject(e,n){return new Proxy(e,{apply:(r,o,s)=>{n.setStatus({code:2,message:s?.[0]?.message||"unknown_error"});let i=Reflect.apply(r,o,s);return n.setAttribute(YR,s?.[0]?.code||"Unknown error"),n.setAttribute(WR,s?.[0]?.name||"Unknown error"),n.end(),i}})}_patchResolve(e,n){return new Proxy(e,{apply:(r,o,s)=>{let i=Reflect.apply(r,o,s),a=s?.[0]?.command;return a&&n.setAttribute(jR,a),n.end(),i}})}_patchQuery(e){return e.Query.prototype.handle=new Proxy(e.Query.prototype.handle,{apply:async(n,r,o)=>{if(!this._shouldCreateSpans())return Reflect.apply(n,r,o);let s=this._sanitizeSqlQuery(r.strings?.[0]);return qf({name:s||"postgresjs.query",op:"db"},i=>{let c=ie().getScopeData().contexts.postgresjsConnection;Pe(i,"auto.db.otel.postgres");let{requestHook:u}=this.getConfig();u&&(0,Vo.safeExecuteInTheMiddle)(()=>u(i,s,c),_=>{_&&T.error(`Error in requestHook for ${yN} integration:`,_)});let l=c?.ATTR_DB_NAMESPACE||"<unknown database>",d=c?.ATTR_SERVER_ADDRESS||"<unknown host>",p=c?.ATTR_SERVER_PORT||"<unknown port>";i.setAttribute(KR,"postgres"),i.setAttribute($R,l),i.setAttribute(zR,d),i.setAttribute(XR,p),i.setAttribute(qR,s),r.resolve=this._patchResolve(r.resolve,i),r.reject=this._patchReject(r.reject,i);try{return Reflect.apply(n,r,o)}catch(_){throw i.setStatus({code:2}),i.end(),_}})}}),e}_patchConnection(e){return new Proxy(e,{apply:(n,r,o)=>{let s=o[0]?.database||"<unknown database>",i=o[0]?.host?.[0]||"<unknown host>",a=o[0]?.port?.[0]||"<unknown port>";return ie().setContext("postgresjsConnection",{ATTR_DB_NAMESPACE:s,ATTR_SERVER_ADDRESS:i,ATTR_SERVER_PORT:a}),Reflect.apply(n,r,o)}})}_sanitizeSqlQuery(e){return e?e.replace(/\s+/g," ").trim().substring(0,1024).replace(/--.*?(\r?\n|$)/g,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\b\d+\b/g,"?").replace(/\s+/g," ").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/g,"IN (?)"):"Unknown SQL Query"}},Cke=(()=>({name:yN,setupOnce(){q9()}})),Y9=Cke;L();var gS=v(de(),1);L();var vke=process.env.PRISMA_SHOW_ALL_TRACES==="true",Ike="00-10-10-00";function Pke(t){return t==="client"?It.CLIENT:It.INTERNAL}var bke=class{traceMiddleware;tracerProvider;ignoreSpanTypes;constructor({traceMiddleware:t,tracerProvider:e,ignoreSpanTypes:n}){this.traceMiddleware=t,this.tracerProvider=e,this.ignoreSpanTypes=n}isEnabled(){return!0}getTraceParent(t){let e=ne.getSpanContext(t??K.active());return e?`00-${e.traceId}-${e.spanId}-0${e.traceFlags}`:Ike}dispatchEngineSpans(t){let e=this.tracerProvider.getTracer("prisma"),n=new Map,r=t.filter(o=>o.parentId===null);for(let o of r)z9(e,o,t,n,this.ignoreSpanTypes)}getActiveContext(){return K.active()}runInChildSpan(t,e){if(typeof t=="string"&&(t={name:t}),t.internal&&!vke||t.middleware&&!this.traceMiddleware)return e();let n=this.tracerProvider.getTracer("prisma"),r=t.context??this.getActiveContext(),o=`prisma:client:${t.name}`;if(X9(o,this.ignoreSpanTypes))return e();if(t.active===!1){let s=n.startSpan(o,t,r);return K9(s,e(s,r))}return n.startActiveSpan(o,t,s=>K9(s,e(s,r)))}};function z9(t,e,n,r,o){if(X9(e.name,o))return;let s={attributes:e.attributes,kind:Pke(e.kind),startTime:e.startTime};t.startActiveSpan(e.name,s,i=>{r.set(e.id,i.spanContext().spanId),e.links&&i.addLinks(e.links.flatMap(c=>{let u=r.get(c);return u?{context:{spanId:u,traceId:i.spanContext().traceId,traceFlags:i.spanContext().traceFlags}}:[]}));let a=n.filter(c=>c.parentId===e.id);for(let c of a)z9(t,c,n,r,o);i.end(e.endTime)})}function K9(t,e){return Mke(e)?e.then(n=>(t.end(),n),n=>{throw t.end(),n}):(t.end(),e)}function Mke(t){return t!=null&&typeof t.then=="function"}function X9(t,e){return e.some(n=>typeof n=="string"?n===t:n.test(t))}var J9={name:"@prisma/instrumentation",version:"6.11.1",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@prisma/internals":"workspace:*","@swc/core":"1.11.5","@types/jest":"29.5.14","@types/node":"18.19.76","@opentelemetry/api":"1.9.0",jest:"29.7.0","jest-junit":"16.0.0",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.52.0 || ^0.53.0 || ^0.54.0 || ^0.55.0 || ^0.56.0 || ^0.57.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"jest"},sideEffects:!1},NN=J9.version,Lke=NN.split(".")[0],W9="PRISMA_INSTRUMENTATION",ON=`V${Lke}_PRISMA_INSTRUMENTATION`,xke=J9.name,Dke="@prisma/client",Z9=class extends gS.InstrumentationBase{tracerProvider;constructor(t={}){super(xke,NN,t)}setTracerProvider(t){this.tracerProvider=t}init(){return[new gS.InstrumentationNodeModuleDefinition(Dke,[NN])]}enable(){let t=this._config,e={helper:new bke({traceMiddleware:t.middleware??!1,tracerProvider:this.tracerProvider??ne.getTracerProvider(),ignoreSpanTypes:t.ignoreSpanTypes??[]})};global[W9]=e,global[ON]=e}disable(){delete global[W9],delete global[ON]}isEnabled(){return!!global[ON]}};var Q9="Prisma";function Uke(t){return!!t&&typeof t=="object"&&"dispatchEngineSpans"in t}function e8(){let t=globalThis.PRISMA_INSTRUMENTATION;return t&&typeof t=="object"&&"helper"in t?t.helper:void 0}var CN=class extends Z9{constructor(){super()}enable(){super.enable();let e=e8(),n=!1;Uke(e)&&(e.createEngineSpan=()=>{Fe(()=>{n||(n=!0,console.warn("[Sentry] The Sentry SDK supports tracing with Prisma version 5 only with limited capabilities. For full tracing capabilities pass `prismaInstrumentation` for version 5 to the Sentry `prismaIntegration`. Read more: https://docs.sentry.io/platforms/javascript/guides/node/configuration/integrations/prisma/"))})})}},wke=F(Q9,t=>t?.prismaInstrumentation?t.prismaInstrumentation:new CN),t8=({prismaInstrumentation:t}={})=>({name:Q9,setupOnce(){wke({prismaInstrumentation:t})},setup(e){e8()&&e.on("spanStart",n=>{let r=q(n);r.description?.startsWith("prisma:")&&n.setAttribute(ge,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}});var u8=v(c8(),1);var l8="Hapi",d8=F(l8,()=>new u8.HapiInstrumentation),Kke=(()=>({name:l8,setupOnce(){d8()}})),p8=Kke;var O8=v(y8(),1);Re();var N8="Koa",C8=F(N8,O8.KoaInstrumentation,(t={})=>({ignoreLayersType:t.ignoreLayersType,requestHook(e,n){Pe(e,"auto.http.otel.koa");let r=q(e).data,o=r["koa.type"];o&&e.setAttribute(re,`${o}.koa`);let s=r["koa.name"];if(typeof s=="string"&&e.updateName(s||"< unknown >"),Te()===Hr()){eo&&T.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let i=r[Wr],a=n.context?.request?.method?.toUpperCase()||"GET";i&&Te().setTransactionName(`${a} ${i}`)}})),eVe=((t={})=>({name:N8,setupOnce(){C8(t)}})),v8=eVe;var w8=v(U8(),1);var k8="Connect",V8=F(k8,()=>new w8.ConnectInstrumentation),dVe=(()=>({name:k8,setupOnce(){V8()}})),B8=dVe;var J8=v(X8(),1);var EVe=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),Z8="Tedious",Q8=F(Z8,()=>new J8.TediousInstrumentation({})),SVe=(()=>{let t;return{name:Z8,setupOnce(){let e=Q8();t=$l(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let{description:r,data:o}=q(n);if(!r||o["db.system"]!=="mssql")return;let s=r.split(" ")[0]||"";EVe.has(s)&&n.setAttribute(ge,"auto.db.otel.tedious")}))}}}),e6=SVe;var s6=v(o6(),1);var i6="GenericPool",a6=F(i6,()=>new s6.GenericPoolInstrumentation({})),hVe=(()=>{let t;return{name:i6,setupOnce(){let e=a6();t=$l(e)},setup(e){t?.(()=>e.on("spanStart",n=>{let o=q(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(ge,"auto.db.otel.generic_pool")}))}}}),c6=hVe;var T6=v(S6(),1);var g6="Amqplib",bVe={consumeEndHook:t=>{Pe(t,"auto.amqplib.otel.consumer")},publishHook:t=>{Pe(t,"auto.amqplib.otel.publisher")}},h6=F(g6,()=>new T6.AmqplibInstrumentation(bVe)),MVe=(()=>({name:g6,setupOnce(){h6()}})),A6=MVe;var Hd="VercelAI";var VS=v(de(),1);var R6=["generateText","streamText","generateObject","streamObject","embed","embedMany"];function LVe(t,e,n,r){let o=t?.recordInputs!==void 0?t.recordInputs:e.recordInputs!==void 0?e.recordInputs:n===!0?!0:r,s=t?.recordOutputs!==void 0?t.recordOutputs:e.recordOutputs!==void 0?e.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:s}}var kS=class t extends VS.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(e={}){super("@sentry/instrumentation-vercel-ai",Oe,e),t.prototype.__init.call(this),t.prototype.__init2.call(this)}init(){return new VS.InstrumentationNodeModuleDefinition("ai",[">=3.0.0 <5"],this._patch.bind(this))}callWhenPatched(e){this._isPatched?e():this._callbacks.push(e)}_patch(e){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];function n(r){return(...o)=>{let s=o[0].experimental_telemetry||{},i=s.isEnabled,a=ie().getClient(),c=a?.getIntegrationByName(Hd),u=c?.options,l=c?!!a?.getOptions().sendDefaultPii:!1,{recordInputs:d,recordOutputs:p}=LVe(u,s,i,l);return o[0].experimental_telemetry={...s,isEnabled:i!==void 0?i:!0,recordInputs:d,recordOutputs:p},yo(()=>r.apply(this,o),_=>{_&&typeof _=="object"&&rt(_,"_sentry_active_span",qr())})}}if(Object.prototype.toString.call(e)==="[object Module]"){for(let r of R6)e[r]=n(e[r]);return e}else{let r=R6.reduce((o,s)=>(o[s]=n(e[s]),o),{});return{...e,...r}}}};var y6=F(Hd,()=>new kS({}));function xVe(t){return!!t.getIntegrationByName("Modules")?.getModules?.()?.ai}var DVe=((t={})=>{let e;return{name:Hd,options:t,setupOnce(){e=y6()},afterAllSetup(n){t.force??xVe(n)?fm(n):e?.callWhenPatched(()=>fm(n))}}}),O6=DVe;var GS=v(de(),1);var UVe=[">=4.0.0 <6"];function wVe(t,e){let n=t?.recordInputs??e,r=t?.recordOutputs??e;return{recordInputs:n,recordOutputs:r}}var BS=class extends GS.InstrumentationBase{constructor(e={}){super("@sentry/instrumentation-openai",Oe,e)}init(){return new GS.InstrumentationNodeModuleDefinition("openai",UVe,this._patch.bind(this))}_patch(e){let n=e.OpenAI,r=function(...o){let s=Reflect.construct(n,o),i=ie().getClient(),c=i?.getIntegrationByName(gs)?.options,u=!!i?.getOptions().sendDefaultPii,{recordInputs:l,recordOutputs:d}=wVe(c,u);return MR(s,{recordInputs:l,recordOutputs:d})};Object.setPrototypeOf(r,n),Object.setPrototypeOf(r.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(r,o,s)}try{e.OpenAI=r}catch{Object.defineProperty(e,"OpenAI",{value:r,writable:!0,configurable:!0,enumerable:!0})}if(e.default===n)try{e.default=r}catch{Object.defineProperty(e,"default",{value:r,writable:!0,configurable:!0,enumerable:!0})}return e}};var N6=F(gs,()=>new BS({})),kVe=((t={})=>({name:gs,options:t,setupOnce(){N6()}})),C6=kVe;function v6(){return[VO(),$3(),Ez(),Zz(),mX(),PX(),jX(),A9(),$9(),t8(),p8(),v8(),B8(),e6(),c6(),bz(),A6(),Gz(),O6(),C6(),Y9()]}L();var I6=v(Vy(),1),P6=v(Yy(),1);Re();var VVe=v(Ef(),1);var FN=1e6;function b6(t,e={}){t.getOptions().debug&&OO();let n=BVe(t,e);t.traceProvider=n}function BVe(t,e={}){let n=new P6.BasicTracerProvider({sampler:new pE(t),resource:new I6.Resource({[Pn]:"node",[FR]:"sentry",[JR]:Oe}),forceFlushTimeoutMillis:500,spanProcessors:[new dE({timeout:GVe(t.getOptions().maxSpanWaitDuration)}),...e.spanProcessors||[]]});return ne.setGlobalTracerProvider(n),Xt.setGlobalPropagator(new lE),K.setGlobalContextManager(new yO),n}function GVe(t){if(t!=null){if(t>FN)return eo&&T.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${FN}`),FN;if(t<=0||Number.isNaN(t)){eo&&T.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return t}}function M6(){return IE().filter(e=>e.name!=="Http"&&e.name!=="NodeFetch").concat(O5(),U5())}function L6(t){return[...M6(),...yt(t)?v6():[]]}function $N(t={}){return HVe(t,L6)}function HVe(t={},e){Hi(t,"node");let n=vO({...t,defaultIntegrations:t.defaultIntegrations??e(t)});return n&&!t.skipOpenTelemetrySetup&&(b6(n,{spanProcessors:t.openTelemetrySpanProcessors}),IO()),n}function $Ve(){let t=process.env.SENTRY_RELEASE?.trim();if(t)return t;let n=(process.env.RAILWAY_GIT_COMMIT_SHA||process.env.VERCEL_GIT_COMMIT_SHA||process.env.GITHUB_SHA||process.env.GIT_COMMIT||"").slice(0,7),r=typeof process.env.npm_package_version=="string"?process.env.npm_package_version:"";if(r&&n)return`${r}+${n}`;if(n)return n;if(r)return r}function D6(){let t=process.env.SENTRY_ENVIRONMENT?.trim();return t||(process.env.NODE_ENV==="production"?"production":"development")}function jVe(){let t=process.env.SENTRY_TRACES_SAMPLE_RATE?.trim();if(t===""||t===void 0)return D6()==="production"?.15:1;let e=Number(t);return!Number.isFinite(e)||e<0?0:Math.min(e,1)}var qVe=new Set(["authorization","cookie","x-admin-key","x-api-key","x-platform-web-secret","proxy-authorization"]);function YVe(t){if(!t||typeof t!="object")return t;let e={};for(let[n,r]of Object.entries(t)){let o=n.toLowerCase();e[n]=qVe.has(o)?"[Filtered]":r}return e}function KVe(t){let e=t.request;if(!e)return;e.headers&&typeof e.headers=="object"&&(e.headers=YVe(e.headers));let n=e.url;typeof n=="string"&&n.includes("token=")&&(e.url=n.replace(/([?&]token=)[^&]+/gi,"$1[Filtered]"))}function WVe(t){try{KVe(t);let n=t.exception?.values?.[0];return n?.value&&typeof n.value=="string"&&(/Bearer\s+\S+/i.test(n.value)&&(n.value=n.value.replace(/Bearer\s+\S+/gi,"Bearer [Filtered]")),/password[=:]\s*\S+/i.test(n.value)&&(n.value="[Filtered]")),t}catch{return t}}function zVe(t){return t.replace(/:[0-9a-f]{8}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{4}-[0-9a-f]{12}/gi,":?").replace(/:[a-f0-9]{16,}/gi,":?")}var x6=!1;function XVe(t){let e=$Ve();return{environment:D6(),...e?{release:e}:{},tracesSampleRate:jVe(),enableLogs:!0,beforeSend(n){if(n.type==="transaction")return n;let r=WVe(n);return r===null?null:r},beforeSendTransaction(n){try{for(let r of n.spans??[])r.description&&(r.description=zVe(r.description))}catch{}return n},initialScope:n=>(n.setTag("service",t),n)}}function U6(t){if(x6)return;let e=process.env.SENTRY_DSN?.trim();if(!e){t.dsnProvided=!1;return}t.dsnProvided=!0;try{$N({dsn:e,...XVe(t.serviceName)}),x6=!0,console.log(`[visa/observability] Sentry initialized service=${t.serviceName} env=${process.env.SENTRY_ENVIRONMENT??process.env.NODE_ENV??"unknown"}`),Zf(`Sentry initialized: ${t.serviceName}`,"info")}catch(n){console.error("[visa/observability] Sentry.init failed:",n),t.dsnProvided=!1}}process.env.SENTRY_DSN;U6({serviceName:"visa-cli"});var w6=(0,G6.promisify)(B6.execFile);function JVe(t){let e=at.homedir(),n=o=>o.replace(e,"~"),r=t.staleReason==="missing"?"path missing on disk":"path mismatch";return` \u2022 ${t.client.displayName} (${n(t.configPath)})
157
+ ${r}: ${n(t.currentPath)}`}function H6(t,e){if(t.length===0){console.log(`${e} \u2713 All MCP client configs are up to date.`);return}console.log(`${e} Found ${t.length} stale MCP config ${t.length===1?"entry":"entries"}:`);for(let n of t)console.log(JVe(n))}function k6(t){console.log(` ! ${t.client.displayName} skipped: ${t.message}`)}var mt=new V6.Command,ZVe=new Set(["pay",...VT]),HS=null,Fd=!1;function sn(){return HS=new rr(()=>Ne.getSessionToken()),HS}function qN(t){return`$${(t/100).toFixed(2)}`}function jN(t,e,n=!1){if(!t){let i=qN(e);return n&&e>=0?`+${i}`:i}let r=(0,$S.fromWire)(t),o=r%10000n===0n?2:6,s=(0,$S.toDisplay)(r,{decimals:o});return n&&r>=0n?`+${s}`:s}function QVe(t){return jN(t,0)}function eBe(t){let e=`visa-cli-${at.hostname()||"local"}`,n=(t?.trim()||e).trim();if(!n)throw new Error("API key label is required.");if(n.length>128)throw new Error("API key label must be 128 characters or fewer.");return n}function tBe(t){if(!t)return;let e=t.split(",").map(s=>s.trim()).filter(Boolean),n=Array.from(new Set(e)),r=n.find(s=>s.length>64);if(r)throw new Error(`Tool id is too long: ${r}`);let o=n.find(s=>ZVe.has(s));if(o)throw new Error(`Tool id "${o}" is retired for direct API-key access. Use category meta-tools or discover/execute instead.`);return n}function nBe(t){if(!t)return;let e=Number(t);if(!Number.isFinite(e)||e<=0)throw new Error("--daily-cap must be a positive USD amount.");let n=Math.round(e*100);if(n<100||n>1e4)throw new Error("--daily-cap must be between 1 and 100 USD.");return n}function F6(t){return t&&t.length>0?t.join(", "):"all tools"}mt.name("visa-cli").description("Visa CLI - AI payment orchestration").version(Zd().version);mt.hook("preAction",async()=>{await nC()});mt.command("setup").description("Register MCP server, authenticate, and generate attestation key").option("--check","Scan MCP client configs for stale visa-cli entries and exit without making changes").option("--yes","Accept setup prompts without asking \u2014 for CI/agent use").option("--hud","Also enable the Claude Code HUD during setup").option("--no-hud","Do not install the HUD during setup (default)").action(async t=>{try{if(t.check){let f=Hu();H6(f,"MCP config check:"),f.length>0&&(console.log("\nRun `visa-cli setup` (or `visa-cli install --repair`) to rewrite these entries."),process.exit(1));return}console.log("Step 1: Registering MCP server...");let e=Hu(),n=new Map(e.map(f=>[f.client.id,f])),r=new Set,o=new Set,s=new Set;for(let f of sr)if(Bu(f)){let E;try{E=Gu(f)}catch(h){if(h instanceof ba){k6(h),o.add(f.displayName),s.add(f.id);continue}throw h}let S=n.get(f.id),g=S?` \u2014 repaired stale ${S.staleReason} entry`:"";console.log(` \u2713 ${f.displayName} (${E.configPath.replace(at.homedir(),"~")})${g}`),S&&r.add(f.id)}let i=e.filter(f=>!r.has(f.client.id)&&!s.has(f.client.id)),a=0;for(let f of i){try{qT(f)}catch(E){if(E instanceof ba){k6(E),o.add(f.client.displayName),s.add(f.client.id);continue}throw E}console.log(` \u2713 ${f.client.displayName} (${f.configPath.replace(at.homedir(),"~")}) \u2014 repaired stale ${f.staleReason} entry`),a++}let c=r.size+a;c===0&&o.size===0?console.log(" \u2713 MCP config verified \u2014 nothing to repair."):c>0&&console.log(` \u2713 Repaired ${c} stale MCP config ${c===1?"entry":"entries"}.`),o.size>0&&console.log(` ! Skipped MCP registration for: ${Array.from(o).join(", ")}. Rerun with access to those config files to complete registration.`),console.log(`
158
+ Step 2: Checking authentication...`);let u=await Ne.getSessionToken();if(u)try{await new rr(()=>Promise.resolve(u)).getStatus(),console.log(" Already authenticated.")}catch(f){let E=f instanceof Error?f.message:"";E.includes("session has expired")||E.includes("Not logged in")?(console.log(" Existing session expired \u2014 re-authenticating..."),await Ne.clearAll(),u=null):console.log(` Couldn't verify session (${E||"unknown error"}) \u2014 continuing with existing token.`)}if(!u){let f=null;try{let{stdout:E}=await w6("gh",["auth","token"],{timeout:5e3});f=E.trim()}catch{}if(f||(f=process.env.GITHUB_TOKEN||null),f)try{console.log(" Found GitHub token \u2014 attempting headless login...");let E=await globalThis.fetch(`${vr()}/v1/auth/token-exchange`,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({github_token:f}),signal:AbortSignal.timeout(1e4)});if(E.ok){let S=await E.json();if(S.success&&S.sessionToken){let g=S.sessionToken;u=g,await Ne.saveSessionToken(g),console.log(` Signed in as ${S.user} (headless).`)}}else(await E.json().catch(()=>({}))).hint==="card_required"&&console.log(" GitHub token valid but no card on file \u2014 opening browser for card enrollment...")}catch{}}if(u||(console.log(" No session found. Opening browser for GitHub login..."),u=await new Promise(async(f,E)=>{let S=FS.randomBytes(16).toString("hex"),g=`${vr()}/login?state=${S}`;await iC(g);let h=3e4,O=300*1e3,N=Date.now()+O;for(;Date.now()<N;)try{let A=await globalThis.fetch(`${vr()}/v1/auth-status`,{method:"POST",headers:{"Content-Type":"application/json","X-Source":"cli"},body:JSON.stringify({state:S,timeout:h}),signal:AbortSignal.timeout(h+5e3)});if(!A.ok){await np(A,P=>{An.warn("auth_status:retry_after_http_error",{status:A.status,delayMs:P})});continue}let M=await A.json();if(M.status==="pending")continue;if(M.status==="expired"){E(new Error("Session expired. Please run setup again."));return}if(M.status==="complete"&&M.sessionToken){console.log(` Signed in as ${M.user}.`),f(M.sessionToken);return}}catch{await np(void 0,A=>{An.warn("auth_status:retry_after_network_error",{delayMs:A})})}E(new Error("Login timed out after 5 minutes. Please run setup again."))}),await Ne.saveSessionToken(u),console.log(" Session token saved.")),console.log(`
159
+ Step 3: Setting up authentication...`),!zt())console.log(" Not macOS \u2014 skipping biometric setup.");else{try{await w6("clang",["--version"])}catch{console.error(" Xcode Command Line Tools are required for payment authentication."),console.error(" Install them by running: xcode-select --install"),console.error(" Then re-run: visa-cli setup"),process.exit(1)}try{let f=await pp();console.log(" Attestation key generated."),await sn().registerAttestationKey(f),console.log(" Attestation key registered with server.")}catch(f){console.log(` Skipped: ${f.message}`)}}let l=Fo.join(at.homedir(),".claude","settings.json"),d=yr.existsSync(Fo.join(at.homedir(),".claude.json"));if(t.hud===!0)if(!d)console.log(`
160
160
  Step 4: HUD requested, but Claude Code config was not detected.`),console.log(" Skipped. Enable later with: visa-cli hud enable");else{console.log(`
161
- Step 4: Enabling the Visa spend HUD...`);let f=rp(l),E=f.installed==="new"||f.installed==="already-visa"||f.installed==="other-hud-present"?" \u2713 ":" Skipped: ";console.log(`${E}${f.message}`);try{let S=sn(),g=await S.getStatus(),h={currentVersion:S.getClientVersion(),latestVersion:S.lastSignals?.updateAvailable?.latestVersion,updateCheckDisabled:Nr()},O=AT(g,h);yT(O,g),console.log(` Preview: ${O.split(`
161
+ Step 4: Enabling the Visa spend HUD...`);let f=op(l),E=f.installed==="new"||f.installed==="already-visa"||f.installed==="other-hud-present"?" \u2713 ":" Skipped: ";console.log(`${E}${f.message}`);try{let S=sn(),g=await S.getStatus(),h={currentVersion:S.getClientVersion(),latestVersion:S.lastSignals?.updateAvailable?.latestVersion,updateCheckDisabled:Cr()},O=RT(g,h);OT(O,g),console.log(` Preview: ${O.split(`
162
162
  `)[0]}`)}catch{}}let p="\x1B[1m",_="\x1B[0m";console.log(`
163
163
  \u2588\u2588\u2557 \u2588\u2588\u2557\u2588\u2588\u2557\u2588\u2588\u2588\u2588\u2588\u2588\u2588\u2557 \u2588\u2588\u2588\u2588\u2588\u2557
164
164
  \u2588\u2588\u2551 \u2588\u2588\u2551\u2588\u2588\u2551\u2588\u2588\u2554\u2550\u2550\u2550\u2550\u255D\u2588\u2588\u2554\u2550\u2550\u2588\u2588\u2557
@@ -179,40 +179,40 @@ Step 4: Enabling the Visa spend HUD...`);let f=rp(l),E=f.installed==="new"||f.in
179
179
 
180
180
  ${p}Verify:${_} visa-cli status
181
181
  ${p}Docs:${_} https://visacli.sh
182
- `)}catch(e){console.error("Error:",e.message),process.exit(1)}});mt.command("install [client]").description("Register MCP server with an AI client (claude, cursor, windsurf, cline, zed, ...)").option("--all","Install for all detected clients").option("--list","Show supported clients and install status").option("--check","Scan MCP client configs for stale visa-cli entries and exit without making changes").option("--repair","Repair stale MCP client configs without re-running the full setup flow").option("--scope <scope>","Install scope: global or project","global").action(async(t,e)=>{try{if(e.check){let s=Hu();V6(s,"MCP config check:"),s.length>0&&process.exit(1);return}if(e.repair){let s=Hu();if(s.length===0){console.log("\u2713 MCP config verified \u2014 nothing to repair.");return}for(let i of s)jT(i),console.log(` \u2713 ${i.client.displayName} (${i.configPath.replace(at.homedir(),"~")}) \u2014 repaired stale ${i.staleReason} entry`);console.log(`
182
+ `)}catch(e){console.error("Error:",e.message),process.exit(1)}});mt.command("install [client]").description("Register MCP server with an AI client (claude, cursor, windsurf, cline, zed, ...)").option("--all","Install for all detected clients").option("--list","Show supported clients and install status").option("--check","Scan MCP client configs for stale visa-cli entries and exit without making changes").option("--repair","Repair stale MCP client configs without re-running the full setup flow").option("--scope <scope>","Install scope: global or project","global").action(async(t,e)=>{try{if(e.check){let s=Hu();H6(s,"MCP config check:"),s.length>0&&process.exit(1);return}if(e.repair){let s=Hu();if(s.length===0){console.log("\u2713 MCP config verified \u2014 nothing to repair.");return}for(let i of s)qT(i),console.log(` \u2713 ${i.client.displayName} (${i.configPath.replace(at.homedir(),"~")}) \u2014 repaired stale ${i.staleReason} entry`);console.log(`
183
183
  Repaired ${s.length} stale MCP config ${s.length===1?"entry":"entries"}.`);return}if(e.list){console.log(`
184
184
  \x1B[1mSupported MCP Clients\x1B[0m
185
- `),console.log(` ${"Client".padEnd(18)} ${"Detected".padEnd(10)} ${"Installed".padEnd(11)} Config Path`),console.log(` ${"\u2500".repeat(18)} ${"\u2500".repeat(10)} ${"\u2500".repeat(11)} ${"\u2500".repeat(40)}`);for(let a of or){let c=Bu(a),u=Yv(a),l=c?"Yes":"No",d=u?"Yes":"No",p=a.globalConfigPath.replace(at.homedir(),"~");console.log(` ${a.displayName.padEnd(18)} ${l.padEnd(10)} ${d.padEnd(11)} ${p}`)}console.log("");return}let n=e.scope==="project"?"project":"global";if(e.all){let s=[],i=[];for(let a of or){if(!Bu(a)){i.push(a.displayName);continue}Gu(a,n),s.push(a.displayName)}s.length>0&&console.log(`Installed for: ${s.join(", ")}.`),i.length>0&&console.log(`Skipped: ${i.map(a=>`${a} (not detected)`).join(", ")}.`),s.length===0&&i.length===0&&console.log("No supported clients found.");return}t||(console.error("Usage: visa-cli install <client>"),console.error(" visa-cli install --all"),console.error(" visa-cli install --list"),console.error(`
186
- Supported clients: ${or.map(s=>s.id).join(", ")}`),process.exit(1));let r=BT(t);r||(console.error(`Unknown client: ${t}`),console.error(`Supported clients: ${or.map(s=>s.id).join(", ")}`),process.exit(1)),n==="global"&&!Bu(r)&&(console.error(`${r.displayName} not detected on this machine.`),console.error(`Expected: ${r.detectPaths.join(", ")}`),process.exit(1));let o=Gu(r,n);console.log(`Registered visa-cli MCP server in ${o.configPath}`),console.log(o.message)}catch(n){console.error("Error:",n.message),process.exit(1)}});mt.command("uninstall [client]").description("Remove MCP server from an AI client").option("--all","Remove from all clients").option("--scope <scope>","Uninstall scope: global or project","global").action(async(t,e)=>{try{let n=e.scope==="project"?"project":"global";if(e.all){let s=[];for(let i of or)$T(i,n).removed&&s.push(i.displayName);s.length>0?console.log(`Removed visa-cli from: ${s.join(", ")}.`):console.log("visa-cli was not installed in any client.");return}t||(console.error("Usage: visa-cli uninstall <client>"),console.error(" visa-cli uninstall --all"),console.error(`
187
- Supported clients: ${or.map(s=>s.id).join(", ")}`),process.exit(1));let r=BT(t);r||(console.error(`Unknown client: ${t}`),console.error(`Supported clients: ${or.map(s=>s.id).join(", ")}`),process.exit(1));let o=$T(r,n);o.removed?console.log(`Removed visa-cli from ${o.configPath}`):console.log(`visa-cli was not installed for ${r.displayName}.`)}catch(n){console.error("Error:",n.message),process.exit(1)}});mt.command("status").description("Check enrollment, cards, wallet, and spending controls").action(async()=>{Fd=!1;try{let t=sn(),e=await t.getStatus(),n={currentVersion:t.getClientVersion(),latestVersion:t.lastSignals.updateAvailable?.latestVersion,updateCheckDisabled:Nr()},r=await t.getTransactions().catch(o=>{if(process.env.VISA_CLI_DEBUG){let s=o instanceof Error?o.message:String(o);process.stderr.write(`[visa-cli] getTransactions failed (HUD will omit): ${s}
188
- `)}return{transactions:[]}});process.stdout.write(JC(e,Array.isArray(r?.transactions)?r.transactions:[],zt(),n)),Fd=!0}catch(t){Fd=!1,console.error("Error:",t.message),process.exit(1)}});var qN=mt.command("api-key").alias("api-keys").description("Create and manage API keys for apps and agents");function YN(t){let e=t instanceof Error?t.message:String(t);console.error("Error:",e),e.includes("Not logged in")&&(console.error(""),console.error("Hint: if `visa-cli status` or `visa-cli setup` says you are authenticated, this process may not have access to your macOS Keychain."),console.error("In sandboxed agents such as Codex, rerun the api-key command with keychain access or run it from a normal terminal.")),process.exit(1)}qN.command("create [label]").description("Create an API key for the authenticated approved user").option("--tools <ids>","Comma-separated allowed tool ids (default: all tools)").option("--daily-cap <usd>","Daily cap in USD, between 1 and 100 (default: server default)").option("--json","Output raw JSON").action(async(t,e)=>{try{let r=await sn().createAppApiKey({label:zVe(t),allowed_tools:XVe(e.tools),daily_cap_cents:JVe(e.dailyCap)});if(e.json){console.log(JSON.stringify(r,null,2));return}console.log("API key created."),console.log(""),console.log(`Key: ${r.key}`),console.log(`Label: ${r.label}`),console.log(`Owner: ${r.owner}`),console.log(`Allowed tools: ${B6(r.allowed_tools)}`),console.log(`Daily cap: ${jN(r.daily_cap_cents)}/day`),console.log(""),console.log("Store this key now. It will not be shown again."),console.log(""),r.biometric_enabled?(console.log("---------------------------------------------------------------"),console.log("WARNING: Biometric (Touch ID) is currently ON for this account."),console.log("API keys bypass biometric verification. Calls will fail with an"),console.log("attestation error until you disable biometric:"),console.log(""),console.log(" visa-cli biometric off"),console.log("---------------------------------------------------------------"),console.log("")):r.biometric_warning&&(console.log("Note: API keys bypass biometric verification. If you later"),console.log("enable biometric, API key calls will fail until you turn it off."),console.log("")),console.log("Example:"),console.log(` curl -X POST ${Cr()}/v1/api/shortcuts/or-gpt-4o-mini \\`),console.log(` -H "X-Api-Key: ${r.key}" \\`),console.log(' -H "Content-Type: application/json" \\'),console.log(` -d '{"prompt":"Say hello in one sentence."}'`)}catch(n){YN(n)}});qN.command("list").description("List API keys for the authenticated user").option("--json","Output raw JSON").action(async t=>{try{let n=await sn().listAppApiKeys();if(t.json){console.log(JSON.stringify(n,null,2));return}let r=n.keys||[];if(r.length===0){console.log("No API keys found. Create one with: visa-cli api-key create");return}console.log("API keys"),console.log("");for(let o of r)console.log(`${o.id}. ${o.label} (${o.key_prefix})`),console.log(` Status: ${o.status}`),console.log(` Owner: ${o.owner}`),console.log(` Allowed tools: ${B6(o.allowed_tools)}`),console.log(` Daily cap: ${jN(o.daily_cap_cents)}/day`),console.log(` Last used: ${o.last_used_at||"never"}`)}catch(e){YN(e)}});qN.command("revoke <id>").alias("delete").description("Revoke (or delete) an API key by id").action(async t=>{try{let e=Number(t);if(!Number.isInteger(e)||e<=0)throw new Error("API key id must be a positive integer. Run `visa-cli api-key list` first.");let r=await sn().revokeAppApiKey(e);console.log(`Revoked API key ${r.revoked}.`)}catch(e){YN(e)}});mt.command("reset").description("Log out and clear all credentials").action(async()=>{try{console.log(`Resetting Visa CLI...
189
- `);try{await sn().logout(),console.log(" Server session invalidated.")}catch{console.log(" Server logout skipped (no active session).")}if(await Ne.clearAll(),console.log(" Keychain credentials cleared."),zt())try{await mT(),console.log(" Secure Enclave key deleted.")}catch{console.log(" No Secure Enclave key to delete.")}console.log(`
190
- Reset complete.`)}catch(t){console.error("Error:",t.message),process.exit(1)}});var ZVe=100,G6=mt.command("balance").description("Manage prepaid balance");G6.command("show").description("Show prepaid balance + recent ledger entries").action(async()=>{try{let e=await new nr(()=>Ne.getSessionToken()).getBalance();if(console.log(`
191
- Balance: ${$N(e.balanceMicros,e.balanceCents)}
185
+ `),console.log(` ${"Client".padEnd(18)} ${"Detected".padEnd(10)} ${"Installed".padEnd(11)} Config Path`),console.log(` ${"\u2500".repeat(18)} ${"\u2500".repeat(10)} ${"\u2500".repeat(11)} ${"\u2500".repeat(40)}`);for(let a of sr){let c=Bu(a),u=zv(a),l=c?"Yes":"No",d=u?"Yes":"No",p=a.globalConfigPath.replace(at.homedir(),"~");console.log(` ${a.displayName.padEnd(18)} ${l.padEnd(10)} ${d.padEnd(11)} ${p}`)}console.log("");return}let n=e.scope==="project"?"project":"global";if(e.all){let s=[],i=[];for(let a of sr){if(!Bu(a)){i.push(a.displayName);continue}Gu(a,n),s.push(a.displayName)}s.length>0&&console.log(`Installed for: ${s.join(", ")}.`),i.length>0&&console.log(`Skipped: ${i.map(a=>`${a} (not detected)`).join(", ")}.`),s.length===0&&i.length===0&&console.log("No supported clients found.");return}t||(console.error("Usage: visa-cli install <client>"),console.error(" visa-cli install --all"),console.error(" visa-cli install --list"),console.error(`
186
+ Supported clients: ${sr.map(s=>s.id).join(", ")}`),process.exit(1));let r=GT(t);r||(console.error(`Unknown client: ${t}`),console.error(`Supported clients: ${sr.map(s=>s.id).join(", ")}`),process.exit(1)),n==="global"&&!Bu(r)&&(console.error(`${r.displayName} not detected on this machine.`),console.error(`Expected: ${r.detectPaths.join(", ")}`),process.exit(1));let o=Gu(r,n);console.log(`Registered visa-cli MCP server in ${o.configPath}`),console.log(o.message)}catch(n){console.error("Error:",n.message),process.exit(1)}});mt.command("uninstall [client]").description("Remove MCP server from an AI client").option("--all","Remove from all clients").option("--scope <scope>","Uninstall scope: global or project","global").action(async(t,e)=>{try{let n=e.scope==="project"?"project":"global";if(e.all){let s=[];for(let i of sr)jT(i,n).removed&&s.push(i.displayName);s.length>0?console.log(`Removed visa-cli from: ${s.join(", ")}.`):console.log("visa-cli was not installed in any client.");return}t||(console.error("Usage: visa-cli uninstall <client>"),console.error(" visa-cli uninstall --all"),console.error(`
187
+ Supported clients: ${sr.map(s=>s.id).join(", ")}`),process.exit(1));let r=GT(t);r||(console.error(`Unknown client: ${t}`),console.error(`Supported clients: ${sr.map(s=>s.id).join(", ")}`),process.exit(1));let o=jT(r,n);o.removed?console.log(`Removed visa-cli from ${o.configPath}`):console.log(`visa-cli was not installed for ${r.displayName}.`)}catch(n){console.error("Error:",n.message),process.exit(1)}});mt.command("status").description("Check enrollment, cards, wallet, and spending controls").action(async()=>{Fd=!1;try{let t=sn(),e=await t.getStatus(),n={currentVersion:t.getClientVersion(),latestVersion:t.lastSignals.updateAvailable?.latestVersion,updateCheckDisabled:Cr()},r=await t.getTransactions().catch(o=>{if(process.env.VISA_CLI_DEBUG){let s=o instanceof Error?o.message:String(o);process.stderr.write(`[visa-cli] getTransactions failed (HUD will omit): ${s}
188
+ `)}return{transactions:[]}});process.stdout.write(ev(e,Array.isArray(r?.transactions)?r.transactions:[],zt(),n)),Fd=!0}catch(t){Fd=!1,console.error("Error:",t.message),process.exit(1)}});var YN=mt.command("api-key").alias("api-keys").description("Create and manage API keys for apps and agents");function KN(t){let e=t instanceof Error?t.message:String(t);console.error("Error:",e),e.includes("Not logged in")&&(console.error(""),console.error("Hint: if `visa-cli status` or `visa-cli setup` says you are authenticated, this process may not have access to your macOS Keychain."),console.error("In sandboxed agents such as Codex, rerun the api-key command with keychain access or run it from a normal terminal.")),process.exit(1)}YN.command("create [label]").description("Create an API key for the authenticated approved user").option("--tools <ids>","Comma-separated allowed tool ids (default: all tools)").option("--daily-cap <usd>","Daily cap in USD, between 1 and 100 (default: server default)").option("--json","Output raw JSON").action(async(t,e)=>{try{let r=await sn().createAppApiKey({label:eBe(t),allowed_tools:tBe(e.tools),daily_cap_cents:nBe(e.dailyCap)});if(e.json){console.log(JSON.stringify(r,null,2));return}console.log("API key created."),console.log(""),console.log(`Key: ${r.key}`),console.log(`Label: ${r.label}`),console.log(`Owner: ${r.owner}`),console.log(`Allowed tools: ${F6(r.allowed_tools)}`),console.log(`Daily cap: ${qN(r.daily_cap_cents)}/day`),console.log(""),console.log("Store this key now. It will not be shown again."),console.log(""),r.biometric_enabled?(console.log("---------------------------------------------------------------"),console.log("WARNING: Biometric (Touch ID) is currently ON for this account."),console.log("API keys bypass biometric verification. Calls will fail with an"),console.log("attestation error until you disable biometric:"),console.log(""),console.log(" visa-cli biometric off"),console.log("---------------------------------------------------------------"),console.log("")):r.biometric_warning&&(console.log("Note: API keys bypass biometric verification. If you later"),console.log("enable biometric, API key calls will fail until you turn it off."),console.log("")),console.log("Example:"),console.log(` curl -X POST ${vr()}/v1/api/shortcuts/or-gpt-4o-mini \\`),console.log(` -H "X-Api-Key: ${r.key}" \\`),console.log(' -H "Content-Type: application/json" \\'),console.log(` -d '{"prompt":"Say hello in one sentence."}'`)}catch(n){KN(n)}});YN.command("list").description("List API keys for the authenticated user").option("--json","Output raw JSON").action(async t=>{try{let n=await sn().listAppApiKeys();if(t.json){console.log(JSON.stringify(n,null,2));return}let r=n.keys||[];if(r.length===0){console.log("No API keys found. Create one with: visa-cli api-key create");return}console.log("API keys"),console.log("");for(let o of r)console.log(`${o.id}. ${o.label} (${o.key_prefix})`),console.log(` Status: ${o.status}`),console.log(` Owner: ${o.owner}`),console.log(` Allowed tools: ${F6(o.allowed_tools)}`),console.log(` Daily cap: ${qN(o.daily_cap_cents)}/day`),console.log(` Last used: ${o.last_used_at||"never"}`)}catch(e){KN(e)}});YN.command("revoke <id>").alias("delete").description("Revoke (or delete) an API key by id").action(async t=>{try{let e=Number(t);if(!Number.isInteger(e)||e<=0)throw new Error("API key id must be a positive integer. Run `visa-cli api-key list` first.");let r=await sn().revokeAppApiKey(e);console.log(`Revoked API key ${r.revoked}.`)}catch(e){KN(e)}});mt.command("reset").description("Log out and clear all credentials").action(async()=>{try{console.log(`Resetting Visa CLI...
189
+ `);try{await sn().logout(),console.log(" Server session invalidated.")}catch{console.log(" Server logout skipped (no active session).")}if(await Ne.clearAll(),console.log(" Keychain credentials cleared."),zt())try{await ET(),console.log(" Secure Enclave key deleted.")}catch{console.log(" No Secure Enclave key to delete.")}console.log(`
190
+ Reset complete.`)}catch(t){console.error("Error:",t.message),process.exit(1)}});var rBe=100,$6=mt.command("balance").description("Manage prepaid balance");$6.command("show").description("Show prepaid balance + recent ledger entries").action(async()=>{try{let e=await new rr(()=>Ne.getSessionToken()).getBalance();if(console.log(`
191
+ Balance: ${jN(e.balanceMicros,e.balanceCents)}
192
192
  `),e.ledger.length===0){console.log(` (no ledger entries \u2014 top up to begin: visa-cli balance topup --amount 5)
193
- `);return}let n=e.ledger.slice(0,20),r=[],o=e.balanceCents,s=e.balanceMicros?BigInt(e.balanceMicros):null;for(let l of n)r.push(s!=null?s.toString():String(o*1e4)),s!=null&&l.deltaMicros?s-=BigInt(l.deltaMicros):(s=null,o-=l.deltaCents);let i=19,a=11,c=13,u=18;console.log(` ${"TIMESTAMP".padEnd(i)} ${"DELTA".padStart(a)} ${"BALANCE".padStart(c)} ${"REASON".padEnd(u)} TOOL`),console.log(` ${"\u2500".repeat(i)} ${"\u2500".repeat(a)} ${"\u2500".repeat(c)} ${"\u2500".repeat(u)} ${"\u2500".repeat(20)}`),n.forEach((l,d)=>{let p=(l.createdAt||"").slice(0,19),_=$N(l.deltaMicros,l.deltaCents,!0),f=WVe(r[d]),E=(l.reason??"").slice(0,u),S=l.toolName??"";console.log(` ${p.padEnd(i)} ${_.padStart(a)} ${f.padStart(c)} ${E.padEnd(u)} ${S}`)}),console.log()}catch(t){console.error("Error:",t.message),process.exit(1)}});G6.command("topup").description("Top up prepaid balance from your default card (Touch ID required)").requiredOption("-a, --amount <usd>","Amount in USD (e.g. 5 or 1.50)").action(async t=>{try{let e=parseFloat(t.amount);if(!Number.isFinite(e)||e<=0)throw new Error("amount must be a positive number");let n=Math.round(e*100);if(n<ZVe)throw new Error("minimum top-up is $1.00");let r=new nr(()=>Ne.getSessionToken()),s=(await r.getStatus()).attestationRequired!==!1;s&&!zt()&&console.warn("Warning: Touch ID unavailable on this system \u2014 top-up will proceed without biometric attestation.");let i=HS.randomUUID(),a=await hp(r,async()=>{let c;if(s&&zt()){let{nonce:u}=await r.getAttestationChallenge(),l=Buffer.from(JSON.stringify({nonce:u,amount:e,merchant:"Visa CLI Balance",context:"balance-topup"})).toString("base64");c={signature:await pp(l,`top up balance with $${e.toFixed(2)}`),nonce:u,amount:e,merchant:"Visa CLI Balance"}}return r.topupBalance({amount_cents:n,idempotency_key:i,attestation:c})});if(a.success)console.log(`Top-up complete: +$${(n/100).toFixed(2)} \u2192 balance now $${((a.balanceCents??0)/100).toFixed(2)}`),a.transactionId&&console.log(`Transaction: ${a.transactionId}`);else{let c=a.error_code?` [${a.error_code}]`:"";console.error(`Top-up failed${c}: ${a.error||"Unknown error"}`),process.exit(1)}}catch(e){console.error("Error:",e.message),process.exit(1)}});var QVe=mt.command("session").description("Inspect session budgets");QVe.command("inspect <id>").description("Show a session-budget by id (e.g. sb_abc123)").action(async t=>{try{if(!t||t.length===0)throw new Error("session id required");let e=new nr(()=>Ne.getSessionToken()),[n,r]=await Promise.allSettled([e.getSessionBudget(t),e.getSessionLedger(t)]),o=n.status==="fulfilled"?n.value.budget:void 0,s=r.status==="fulfilled"?r.value:void 0;if(!o&&!s?.ledger?.length&&(console.error(`Session not found: ${t}`),process.exit(1)),console.log(`
193
+ `);return}let n=e.ledger.slice(0,20),r=[],o=e.balanceCents,s=e.balanceMicros?BigInt(e.balanceMicros):null;for(let l of n)r.push(s!=null?s.toString():String(o*1e4)),s!=null&&l.deltaMicros?s-=BigInt(l.deltaMicros):(s=null,o-=l.deltaCents);let i=19,a=11,c=13,u=18;console.log(` ${"TIMESTAMP".padEnd(i)} ${"DELTA".padStart(a)} ${"BALANCE".padStart(c)} ${"REASON".padEnd(u)} TOOL`),console.log(` ${"\u2500".repeat(i)} ${"\u2500".repeat(a)} ${"\u2500".repeat(c)} ${"\u2500".repeat(u)} ${"\u2500".repeat(20)}`),n.forEach((l,d)=>{let p=(l.createdAt||"").slice(0,19),_=jN(l.deltaMicros,l.deltaCents,!0),f=QVe(r[d]),E=(l.reason??"").slice(0,u),S=l.toolName??"";console.log(` ${p.padEnd(i)} ${_.padStart(a)} ${f.padStart(c)} ${E.padEnd(u)} ${S}`)}),console.log()}catch(t){console.error("Error:",t.message),process.exit(1)}});$6.command("topup").description("Top up prepaid balance from your default card (Touch ID required)").requiredOption("-a, --amount <usd>","Amount in USD (e.g. 5 or 1.50)").action(async t=>{try{let e=parseFloat(t.amount);if(!Number.isFinite(e)||e<=0)throw new Error("amount must be a positive number");let n=Math.round(e*100);if(n<rBe)throw new Error("minimum top-up is $1.00");let r=new rr(()=>Ne.getSessionToken()),s=(await r.getStatus()).attestationRequired!==!1;s&&!zt()&&console.warn("Warning: Touch ID unavailable on this system \u2014 top-up will proceed without biometric attestation.");let i=FS.randomUUID(),a=await Ap(r,async()=>{let c;if(s&&zt()){let{nonce:u}=await r.getAttestationChallenge(),l=Buffer.from(JSON.stringify({nonce:u,amount:e,merchant:"Visa CLI Balance",context:"balance-topup"})).toString("base64");c={signature:await _p(l,`top up balance with $${e.toFixed(2)}`),nonce:u,amount:e,merchant:"Visa CLI Balance"}}return r.topupBalance({amount_cents:n,idempotency_key:i,attestation:c})});if(a.success)console.log(`Top-up complete: +$${(n/100).toFixed(2)} \u2192 balance now $${((a.balanceCents??0)/100).toFixed(2)}`),a.transactionId&&console.log(`Transaction: ${a.transactionId}`);else{let c=a.error_code?` [${a.error_code}]`:"";console.error(`Top-up failed${c}: ${a.error||"Unknown error"}`),process.exit(1)}}catch(e){console.error("Error:",e.message),process.exit(1)}});var oBe=mt.command("session").description("Inspect session budgets");oBe.command("inspect <id>").description("Show a session-budget by id (e.g. sb_abc123)").action(async t=>{try{if(!t||t.length===0)throw new Error("session id required");let e=new rr(()=>Ne.getSessionToken()),[n,r]=await Promise.allSettled([e.getSessionBudget(t),e.getSessionLedger(t)]),o=n.status==="fulfilled"?n.value.budget:void 0,s=r.status==="fulfilled"?r.value:void 0;if(!o&&!s?.ledger?.length&&(console.error(`Session not found: ${t}`),process.exit(1)),console.log(`
194
194
  Session: ${t}`),o){let i=(o.totalCents/100).toFixed(2),a=(o.cumulativeCents/100).toFixed(2),c=(o.remainingCents/100).toFixed(2);console.log(` Status: ${o.status}${o.expired?" (expired)":""}`),console.log(` Budget: $${i} \xB7 spent $${a} \xB7 remaining $${c}`),console.log(` Created: ${o.createdAt}`),console.log(` Expires: ${o.expiresAt}`)}if(s?.ledger?.length){console.log(`
195
195
  PSP References (CyberSource activity):`);let i=8,a=9,c=36;console.log(` ${"TYPE".padEnd(i)} ${"AMOUNT".padStart(a)} ${"CYBERSOURCE TX ID".padEnd(c)} CREATED`),console.log(` ${"\u2500".repeat(i)} ${"\u2500".repeat(a)} ${"\u2500".repeat(c)} ${"\u2500".repeat(19)}`);for(let u of s.ledger){let l=`$${(u.amountCents/100).toFixed(2)}`;console.log(` ${u.type.padEnd(i)} ${l.padStart(a)} ${(u.transactionId||"").padEnd(c)} ${(u.createdAt||"").slice(0,19)}`)}}else o&&console.log(`
196
- (no PSP references yet \u2014 no holds placed)`);console.log()}catch(e){console.error("Error:",e.message),process.exit(1)}});mt.command("feedback").description("Submit feedback about Visa CLI").argument("[message]","Your feedback message").action(async t=>{(!t||t.trim().length===0)&&(console.log('Usage: visa-cli feedback "your message"'),process.exit(1));try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1)),await sn().feedback(t.trim()),console.log("Feedback submitted. Thanks!")}catch(e){console.error("Error:",e.message),process.exit(1)}});var KN=mt.command("config").description("Inspect the CLI configuration");KN.command("list").description("Show resolved config values (env vars, server state, defaults) with their source").option("--json","Output as JSON for scripting / agent consumption").option("--dev","Include developer/test hooks (VISA_MOCK_*, VISA_CLI_DEBUG)").option("--verbose","Show one-line hints beneath entries that have them").action(async t=>{try{let e=sn(),n=await vT({api:e,includeDev:!!t.dev});if(t.json){console.log(pv(n));return}n.statusError&&(console.error(`Warning: could not reach auth server (${n.statusError}).`),console.error("Server-sourced entries show '\u2014'. Log in with `visa-cli setup` if you expected values here."),console.error("")),console.log(dv(n.entries,{verbose:!!t.verbose}))}catch(e){console.error("Error:",e.message),process.exit(1)}});function eBe(){return Object.entries(fa).map(([t,e])=>` ${t.padEnd(22)} (${e.type}) ${e.description}`).join(`
197
- `)}KN.command("set <key> <value>").description("Persist a CLI setting to ~/.visa-mcp/settings.json").addHelpText("after",`
196
+ (no PSP references yet \u2014 no holds placed)`);console.log()}catch(e){console.error("Error:",e.message),process.exit(1)}});mt.command("feedback").description("Submit feedback about Visa CLI").argument("[message]","Your feedback message").action(async t=>{(!t||t.trim().length===0)&&(console.log('Usage: visa-cli feedback "your message"'),process.exit(1));try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1)),await sn().feedback(t.trim()),console.log("Feedback submitted. Thanks!")}catch(e){console.error("Error:",e.message),process.exit(1)}});var WN=mt.command("config").description("Inspect the CLI configuration");WN.command("list").description("Show resolved config values (env vars, server state, defaults) with their source").option("--json","Output as JSON for scripting / agent consumption").option("--dev","Include developer/test hooks (VISA_MOCK_*, VISA_CLI_DEBUG)").option("--verbose","Show one-line hints beneath entries that have them").action(async t=>{try{let e=sn(),n=await IT({api:e,includeDev:!!t.dev});if(t.json){console.log(mv(n));return}n.statusError&&(console.error(`Warning: could not reach auth server (${n.statusError}).`),console.error("Server-sourced entries show '\u2014'. Log in with `visa-cli setup` if you expected values here."),console.error("")),console.log(fv(n.entries,{verbose:!!t.verbose}))}catch(e){console.error("Error:",e.message),process.exit(1)}});function sBe(){return Object.entries(fa).map(([t,e])=>` ${t.padEnd(22)} (${e.type}) ${e.description}`).join(`
197
+ `)}WN.command("set <key> <value>").description("Persist a CLI setting to ~/.visa-mcp/settings.json").addHelpText("after",`
198
198
  Settable keys:
199
- ${eBe()}`).action((t,e)=>{try{let n=cT(t,e);console.log(`Saved ${n.key}=${JSON.stringify(n.value)} \u2192 ${n.path}`),n.requiresRestart&&console.log("Restart Claude Code (or your MCP-enabled client) for the change to take effect.")}catch(n){n instanceof ti||n instanceof ni||n instanceof _a?console.error(`Error: ${n.message}`):console.error(`Error: ${n.message}`),process.exit(1)}});KN.command("unset <key>").description("Remove a CLI setting from ~/.visa-mcp/settings.json (falls back to env var or default)").action(t=>{try{let e=uT(t);e.removed?(console.log(`Removed ${e.key} from ${e.path}`),e.requiresRestart&&console.log("Restart Claude Code (or your MCP-enabled client) for the change to take effect.")):console.log(`No-op: ${e.key} was not set in ${e.path}.`)}catch(e){console.error(`Error: ${e.message}`),process.exit(1)}});var WN=mt.command("biometric").description("Manage Touch ID / biometric attestation enforcement");WN.command("status").description("Show current biometric enforcement state").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let n=await sn().getStatus(),r=n.attestationRequired!==!1,o=!!n.hasAttestationKey,s=zt();console.log(`Server policy: Touch ID ${r?"REQUIRED":"NOT required"}`),console.log(`Attestation key registered: ${o?"yes":"no"}`),console.log(`Touch ID available on this device: ${s?"yes":"no"}`)}catch(t){console.error("Error:",t.message),process.exit(1)}});WN.command("on").description("Require Touch ID for payments (security upgrade \u2014 no Touch ID needed)").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let e=sn(),n=await e.setBiometricPreference({required:!0});n.success||(console.error(`Failed: ${n.error||"unknown error"}`),process.exit(1)),console.log("Touch ID is now REQUIRED for payments."),(await e.getStatus()).hasAttestationKey||console.warn("Note: no attestation key is registered yet. Run `visa-cli setup` to enroll Touch ID.")}catch(t){console.error("Error:",t.message),process.exit(1)}});WN.command("off").description("Disable Touch ID requirement (security downgrade \u2014 one Touch ID confirmation required)").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let e=sn(),n=await e.getStatus();if(n.attestationRequired===!1){console.log("Touch ID is already disabled.");return}n.hasAttestationKey&&!zt()&&(console.error("Touch ID is unavailable on this device but the server has a registered key."),console.error("Disable Touch ID from a device that can sign, or contact support."),process.exit(1));let r=await hp(e,async()=>{let o;if(n.hasAttestationKey&&zt())try{let{nonce:s}=await e.getAttestationChallenge(),i=0,a="",c=Buffer.from(JSON.stringify({nonce:s,amount:i,merchant:a,context:"biometric-preference"})).toString("base64");o={signature:await pp(c,"disable Touch ID requirement"),nonce:s,amount:i,merchant:a}}catch(s){throw new Error(`Touch ID confirmation failed: ${s?.message||"cancelled"}`)}return e.setBiometricPreference({required:!1,attestation:o})});r.success||(console.error(`Failed: ${r.error||"unknown error"}`),process.exit(1)),console.log("Touch ID is no longer required for payments.")}catch(t){console.error("Error:",t.message),process.exit(1)}});var ca=mt.command("shell-hud").description("Manage the shell prompt HUD (opt-in \u2014 prefer: visa-cli hud enable)");function H6(){let t=Tp();t.installed||(console.error(t.message),process.exit(1)),console.log(t.message)}function F6(){let t=gp();t.removed||(console.error(t.message),process.exit(1)),console.log(t.message)}ca.command("install").description("Install the persistent shell HUD into your zsh or bash rc file").action(H6);ca.command("enable").description("Enable the persistent shell HUD").action(H6);ca.command("uninstall").description("Remove the persistent shell HUD from your shell rc file").action(F6);ca.command("disable").description("Disable the persistent shell HUD").action(F6);ca.command("segment").description("Print the cached shell HUD segment").action(()=>{process.stdout.write(`${RT()}
199
+ ${sBe()}`).action((t,e)=>{try{let n=uT(t,e);console.log(`Saved ${n.key}=${JSON.stringify(n.value)} \u2192 ${n.path}`),n.requiresRestart&&console.log("Restart Claude Code (or your MCP-enabled client) for the change to take effect.")}catch(n){n instanceof ti||n instanceof ni||n instanceof _a?console.error(`Error: ${n.message}`):console.error(`Error: ${n.message}`),process.exit(1)}});WN.command("unset <key>").description("Remove a CLI setting from ~/.visa-mcp/settings.json (falls back to env var or default)").action(t=>{try{let e=lT(t);e.removed?(console.log(`Removed ${e.key} from ${e.path}`),e.requiresRestart&&console.log("Restart Claude Code (or your MCP-enabled client) for the change to take effect.")):console.log(`No-op: ${e.key} was not set in ${e.path}.`)}catch(e){console.error(`Error: ${e.message}`),process.exit(1)}});var zN=mt.command("biometric").description("Manage Touch ID / biometric attestation enforcement");zN.command("status").description("Show current biometric enforcement state").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let n=await sn().getStatus(),r=n.attestationRequired!==!1,o=!!n.hasAttestationKey,s=zt();console.log(`Server policy: Touch ID ${r?"REQUIRED":"NOT required"}`),console.log(`Attestation key registered: ${o?"yes":"no"}`),console.log(`Touch ID available on this device: ${s?"yes":"no"}`)}catch(t){console.error("Error:",t.message),process.exit(1)}});zN.command("on").description("Require Touch ID for payments (security upgrade \u2014 no Touch ID needed)").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let e=sn(),n=await e.setBiometricPreference({required:!0});n.success||(console.error(`Failed: ${n.error||"unknown error"}`),process.exit(1)),console.log("Touch ID is now REQUIRED for payments."),(await e.getStatus()).hasAttestationKey||console.warn("Note: no attestation key is registered yet. Run `visa-cli setup` to enroll Touch ID.")}catch(t){console.error("Error:",t.message),process.exit(1)}});zN.command("off").description("Disable Touch ID requirement (security downgrade \u2014 one Touch ID confirmation required)").action(async()=>{try{await Ne.getSessionToken()||(console.error("Not logged in. Run visa-cli setup first."),process.exit(1));let e=sn(),n=await e.getStatus();if(n.attestationRequired===!1){console.log("Touch ID is already disabled.");return}n.hasAttestationKey&&!zt()&&(console.error("Touch ID is unavailable on this device but the server has a registered key."),console.error("Disable Touch ID from a device that can sign, or contact support."),process.exit(1));let r=await Ap(e,async()=>{let o;if(n.hasAttestationKey&&zt())try{let{nonce:s}=await e.getAttestationChallenge(),i=0,a="",c=Buffer.from(JSON.stringify({nonce:s,amount:i,merchant:a,context:"biometric-preference"})).toString("base64");o={signature:await _p(c,"disable Touch ID requirement"),nonce:s,amount:i,merchant:a}}catch(s){throw new Error(`Touch ID confirmation failed: ${s?.message||"cancelled"}`)}return e.setBiometricPreference({required:!1,attestation:o})});r.success||(console.error(`Failed: ${r.error||"unknown error"}`),process.exit(1)),console.log("Touch ID is no longer required for payments.")}catch(t){console.error("Error:",t.message),process.exit(1)}});var ca=mt.command("shell-hud").description("Manage the shell prompt HUD (opt-in \u2014 prefer: visa-cli hud enable)");function j6(){let t=gp();t.installed||(console.error(t.message),process.exit(1)),console.log(t.message)}function q6(){let t=hp();t.removed||(console.error(t.message),process.exit(1)),console.log(t.message)}ca.command("install").description("Install the persistent shell HUD into your zsh or bash rc file").action(j6);ca.command("enable").description("Enable the persistent shell HUD").action(j6);ca.command("uninstall").description("Remove the persistent shell HUD from your shell rc file").action(q6);ca.command("disable").description("Disable the persistent shell HUD").action(q6);ca.command("segment").description("Print the cached shell HUD segment").action(()=>{process.stdout.write(`${yT()}
200
200
  `)});ca.command("doctor").description("Diagnose shell HUD installation and connectivity").action(async()=>{let{existsSync:t,readFileSync:e}=await import("fs"),n=!0,r=(d,p,_)=>{console.log(` ${p?"\u2713":"\u2717"} ${d}: ${_}`),p||(n=!1)};console.log(`Shell HUD Doctor
201
- `);let o=Aa();if(r("Shell detected",!!o,o??"none (zsh, bash, or PowerShell required)"),o){let d=xu(o),p=t(d);if(r("RC file exists",p,d.replace(at.homedir(),"~")),p){let f=e(d,"utf-8").includes("visa-cli shell hud v2");r("HUD block installed",f,f?"found in rc file":"missing \u2014 run: visa-cli shell-hud install")}}let s=ga(),i=t(s);if(r("Cache file",i,i?s.replace(at.homedir(),"~"):"missing \u2014 HUD has not refreshed yet"),i)try{let d=JSON.parse(e(s,"utf-8")),p=Date.now()-(d.renderedAt??0),_=Math.round(p/1e3),f=_<=30;console.log(` ${f?"\u2713":"\u26A0"} Cache freshness: ${_}s old${f?"":" (stale \u2014 will refresh on next prompt)"}`)}catch{r("Cache readable",!1,"corrupt JSON")}let a=Sp(),c=t(a),u="missing";if(c)try{u=e(a,"utf-8").trim().slice(0,80)}catch{u="unreadable"}r("Line file",c,u);let l=!1;try{l=!!await Ne.getSessionToken()}catch{}if(r("Auth token",l,l?"found in keychain":"missing \u2014 run: visa-cli setup"),l)try{await sn().getStatus(),r("API connectivity",!0,"GET /v1/status OK")}catch(d){let p=d instanceof Error?d.message:"unknown error";r("API connectivity",!1,p)}console.log(n?`
201
+ `);let o=Aa();if(r("Shell detected",!!o,o??"none (zsh, bash, or PowerShell required)"),o){let d=xu(o),p=t(d);if(r("RC file exists",p,d.replace(at.homedir(),"~")),p){let f=e(d,"utf-8").includes("visa-cli shell hud v2");r("HUD block installed",f,f?"found in rc file":"missing \u2014 run: visa-cli shell-hud install")}}let s=ga(),i=t(s);if(r("Cache file",i,i?s.replace(at.homedir(),"~"):"missing \u2014 HUD has not refreshed yet"),i)try{let d=JSON.parse(e(s,"utf-8")),p=Date.now()-(d.renderedAt??0),_=Math.round(p/1e3),f=_<=30;console.log(` ${f?"\u2713":"\u26A0"} Cache freshness: ${_}s old${f?"":" (stale \u2014 will refresh on next prompt)"}`)}catch{r("Cache readable",!1,"corrupt JSON")}let a=Tp(),c=t(a),u="missing";if(c)try{u=e(a,"utf-8").trim().slice(0,80)}catch{u="unreadable"}r("Line file",c,u);let l=!1;try{l=!!await Ne.getSessionToken()}catch{}if(r("Auth token",l,l?"found in keychain":"missing \u2014 run: visa-cli setup"),l)try{await sn().getStatus(),r("API connectivity",!0,"GET /v1/status OK")}catch(d){let p=d instanceof Error?d.message:"unknown error";r("API connectivity",!1,p)}console.log(n?`
202
202
  All checks passed.`:`
203
- Some checks failed \u2014 see above.`),n||process.exit(1)});ca.command("refresh").description("Refresh the shell HUD cache (no-op if cache is fresh unless --force)").option("--force","Bypass the cache freshness gate and always refresh").action(async t=>{if(!(!t.force&&iv()))try{let e=sn(),n=await e.getStatus(),r={currentVersion:e.getClientVersion(),latestVersion:e.lastSignals.updateAvailable?.latestVersion,updateCheckDisabled:Nr()},o=AT(n,r);yT(o,n)}catch{}finally{Lu()}});mt.command("statusline").description("Output the Visa HUD for agent statusline integrations").option("--json","Output structured JSON for clients that render their own HUD").action(async t=>{try{let e=await EC(),r=RT().split(`
204
- `)[0],o=av();if(!e&&r.includes("loading")){process.stdout.write(`VISA | HUD not initialized \u2014 run: visa-cli hud enable
205
- `);return}if(t.json){let i=await AC(r,e,o);process.stdout.write(`${JSON.stringify(i,null,2)}
206
- `);return}let s=await TC(r,e,o);process.stdout.write(`${s}
203
+ Some checks failed \u2014 see above.`),n||process.exit(1)});ca.command("refresh").description("Refresh the shell HUD cache (no-op if cache is fresh unless --force)").option("--force","Bypass the cache freshness gate and always refresh").action(async t=>{if(!(!t.force&&uv()))try{let e=sn(),n=await e.getStatus(),r={currentVersion:e.getClientVersion(),latestVersion:e.lastSignals.updateAvailable?.latestVersion,updateCheckDisabled:Cr()},o=RT(n,r);OT(o,n)}catch{}finally{Lu()}});mt.command("statusline").description("Output the Visa HUD for agent statusline integrations").option("--json","Output structured JSON for clients that render their own HUD").action(async t=>{try{let e=await gC(),r=yT().split(`
204
+ `)[0],o=lv();if(!e&&r.includes("loading")){process.stdout.write(`VISA | HUD not initialized \u2014 run: visa-cli hud enable
205
+ `);return}if(t.json){let i=await OC(r,e,o);process.stdout.write(`${JSON.stringify(i,null,2)}
206
+ `);return}let s=await AC(r,e,o);process.stdout.write(`${s}
207
207
  `)}catch(e){let n=e instanceof Error?e.message:"unknown error";console.error(`Failed to render Visa HUD: ${n}`),process.exit(1)}});var Ru=mt.command("hud").description("Manage the Visa spend HUD \u2014 one command for all surfaces");Ru.description("Show which HUD surfaces are currently enabled").action(()=>{let t="\x1B[1m",e="\x1B[2m",n="\x1B[32m",r="\x1B[33m",o="\x1B[0m";console.log(`
208
208
  ${t}Visa HUD Status${o}
209
- `);let s=Fo.join(at.homedir(),".claude","settings.json"),i=!1,a=!1;try{if(Rr.existsSync(s)){let _=JSON.parse(Rr.readFileSync(s,"utf-8")),f=typeof _.statusLine=="object"?_.statusLine.command:"";i=la(f),a=!!_.statusLine&&!i}}catch{}let c=i?`${n}\u2713${o}`:`${e}\u2717${o}`,u=i?"registered in ~/.claude/settings.json":a?`${r}another HUD is configured${o} \u2014 edit settings.json to switch`:"not enabled";console.log(` ${c} ${t}Claude Code${o} (statusLine) ${u}`);let l=hT(),d=l?`${n}\u2713${o}`:`${e}\u2717${o}`;console.log(` ${d} ${t}Shell prompt${o} ${l?"installed in shell rc file":"not installed (opt-in)"}`),console.log(`
210
- ${t}Quick start:${o}`),i||console.log(` visa-cli hud enable ${e}# Claude Code statusLine (recommended)${o}`),l||console.log(` visa-cli hud enable shell ${e}# zsh/bash prompt line (opt-in)${o}`),i&&l&&console.log(` ${n}All surfaces enabled.${o}`),(i||l)&&console.log(` visa-cli hud disable [shell] ${e}# remove a surface${o}`),console.log(` visa-cli hud doctor ${e}# diagnose connectivity${o}`),console.log()});Ru.command("enable").description("Enable the Visa HUD \u2014 auto-detects Claude Code, or specify: shell, codex, all").argument("[surface]","Target surface: claude (default), shell, codex, or all").action(t=>{let e=t??"claude",n=nT(e);if(e==="shell"||e==="prompt"){let r=Tp();r.installed||(console.error(r.message),process.exit(1)),console.log(r.message);return}if(n||(console.error(`Unknown HUD surface: ${e}`),console.error("Supported: claude (default), shell, codex, all"),process.exit(1)),n==="claude"||n==="claude-code"||n==="all"){let r=Fo.join(at.homedir(),".claude","settings.json"),o=rp(r);console.log(o.message),(o.installed==="error"||o.installed==="malformed-json")&&process.exit(1)}if(n==="codex"||n==="all"){let r=Tp();console.log(r.message),console.log("Codex structured HUD payload is available with: visa-cli statusline --json"),r.installed||process.exit(1)}});Ru.command("disable").description("Disable the Visa HUD from a surface: claude (default), shell, codex, or all").argument("[surface]","Target surface: claude (default), shell, codex, or all").action(t=>{let e=t??"claude";if(e==="shell"||e==="prompt"){let s=gp();s.removed||(console.error(s.message),process.exit(1)),console.log(s.message);return}let n=nT(e);n||(console.error(`Unknown HUD surface: ${e}`),console.error("Supported: claude (default), shell, codex, all"),process.exit(1));let r=!1,o=!1;if(n==="claude"||n==="claude-code"||n==="all"){let s=Fo.join(at.homedir(),".claude","settings.json"),i=XS(s);console.log(i.message),i.removed&&(o=!0),!i.removed&&n!=="all"&&(r=!0)}if(n==="codex"||n==="all"){let s=gp();console.log(s.message),s.removed&&(o=!0),!s.removed&&n!=="all"&&(r=!0)}n==="all"&&!o&&(r=!0),r&&process.exit(1)});Ru.command("doctor").description("Diagnose HUD installation and connectivity across all surfaces").action(async()=>{let t=!0,e=(c,u,l)=>{console.log(` ${u?"\u2713":"\u2717"} ${c}: ${l}`),u||(t=!1)};console.log(`Visa HUD Doctor
211
- `);let n=Fo.join(at.homedir(),".claude","settings.json"),r=!1;try{if(Rr.existsSync(n)){let c=JSON.parse(Rr.readFileSync(n,"utf-8")),u=typeof c.statusLine=="object"?c.statusLine.command:"";r=la(u)}}catch{}e("Claude Code statusLine",r,r?"registered":"not registered \u2014 run: visa-cli hud enable");let o=Aa();if(e("Shell detected",!!o,o??"none (zsh, bash, or PowerShell required)"),o){let c=xu(o),u=Rr.existsSync(c);if(e("RC file exists",u,c.replace(at.homedir(),"~")),u){let d=Rr.readFileSync(c,"utf-8").includes("visa-cli shell hud v2");console.log(` ${d?"\u2713":"\u2013"} Shell HUD block: ${d?"installed":"not installed (opt-in \u2014 run: visa-cli hud enable shell)"}`)}}let s=ga(),i=Rr.existsSync(s);if(e("HUD cache file",i,i?s.replace(at.homedir(),"~"):"missing \u2014 HUD has not refreshed yet"),i)try{let c=JSON.parse(Rr.readFileSync(s,"utf-8")),u=Date.now()-(c.renderedAt??0),l=Math.round(u/1e3),d=l<=30;console.log(` ${d?"\u2713":"\u26A0"} Cache freshness: ${l}s old${d?"":" (stale \u2014 will refresh on next prompt)"}`)}catch{e("Cache readable",!1,"corrupt JSON")}let a=!1;try{a=!!await Ne.getSessionToken()}catch{}if(e("Auth token",a,a?"found in keychain":"missing \u2014 run: visa-cli setup"),a)try{await sn().getStatus(),e("API connectivity",!0,"GET /v1/status OK")}catch(c){let u=c instanceof Error?c.message:"unknown error";e("API connectivity",!1,u)}console.log(t?`
209
+ `);let s=Fo.join(at.homedir(),".claude","settings.json"),i=!1,a=!1;try{if(yr.existsSync(s)){let _=JSON.parse(yr.readFileSync(s,"utf-8")),f=typeof _.statusLine=="object"?_.statusLine.command:"";i=la(f),a=!!_.statusLine&&!i}}catch{}let c=i?`${n}\u2713${o}`:`${e}\u2717${o}`,u=i?"registered in ~/.claude/settings.json":a?`${r}another HUD is configured${o} \u2014 edit settings.json to switch`:"not enabled";console.log(` ${c} ${t}Claude Code${o} (statusLine) ${u}`);let l=AT(),d=l?`${n}\u2713${o}`:`${e}\u2717${o}`;console.log(` ${d} ${t}Shell prompt${o} ${l?"installed in shell rc file":"not installed (opt-in)"}`),console.log(`
210
+ ${t}Quick start:${o}`),i||console.log(` visa-cli hud enable ${e}# Claude Code statusLine (recommended)${o}`),l||console.log(` visa-cli hud enable shell ${e}# zsh/bash prompt line (opt-in)${o}`),i&&l&&console.log(` ${n}All surfaces enabled.${o}`),(i||l)&&console.log(` visa-cli hud disable [shell] ${e}# remove a surface${o}`),console.log(` visa-cli hud doctor ${e}# diagnose connectivity${o}`),console.log()});Ru.command("enable").description("Enable the Visa HUD \u2014 auto-detects Claude Code, or specify: shell, codex, all").argument("[surface]","Target surface: claude (default), shell, codex, or all").action(t=>{let e=t??"claude",n=rT(e);if(e==="shell"||e==="prompt"){let r=gp();r.installed||(console.error(r.message),process.exit(1)),console.log(r.message);return}if(n||(console.error(`Unknown HUD surface: ${e}`),console.error("Supported: claude (default), shell, codex, all"),process.exit(1)),n==="claude"||n==="claude-code"||n==="all"){let r=Fo.join(at.homedir(),".claude","settings.json"),o=op(r);console.log(o.message),(o.installed==="error"||o.installed==="malformed-json")&&process.exit(1)}if(n==="codex"||n==="all"){let r=gp();console.log(r.message),console.log("Codex structured HUD payload is available with: visa-cli statusline --json"),r.installed||process.exit(1)}});Ru.command("disable").description("Disable the Visa HUD from a surface: claude (default), shell, codex, or all").argument("[surface]","Target surface: claude (default), shell, codex, or all").action(t=>{let e=t??"claude";if(e==="shell"||e==="prompt"){let s=hp();s.removed||(console.error(s.message),process.exit(1)),console.log(s.message);return}let n=rT(e);n||(console.error(`Unknown HUD surface: ${e}`),console.error("Supported: claude (default), shell, codex, all"),process.exit(1));let r=!1,o=!1;if(n==="claude"||n==="claude-code"||n==="all"){let s=Fo.join(at.homedir(),".claude","settings.json"),i=JS(s);console.log(i.message),i.removed&&(o=!0),!i.removed&&n!=="all"&&(r=!0)}if(n==="codex"||n==="all"){let s=hp();console.log(s.message),s.removed&&(o=!0),!s.removed&&n!=="all"&&(r=!0)}n==="all"&&!o&&(r=!0),r&&process.exit(1)});Ru.command("doctor").description("Diagnose HUD installation and connectivity across all surfaces").action(async()=>{let t=!0,e=(c,u,l)=>{console.log(` ${u?"\u2713":"\u2717"} ${c}: ${l}`),u||(t=!1)};console.log(`Visa HUD Doctor
211
+ `);let n=Fo.join(at.homedir(),".claude","settings.json"),r=!1;try{if(yr.existsSync(n)){let c=JSON.parse(yr.readFileSync(n,"utf-8")),u=typeof c.statusLine=="object"?c.statusLine.command:"";r=la(u)}}catch{}e("Claude Code statusLine",r,r?"registered":"not registered \u2014 run: visa-cli hud enable");let o=Aa();if(e("Shell detected",!!o,o??"none (zsh, bash, or PowerShell required)"),o){let c=xu(o),u=yr.existsSync(c);if(e("RC file exists",u,c.replace(at.homedir(),"~")),u){let d=yr.readFileSync(c,"utf-8").includes("visa-cli shell hud v2");console.log(` ${d?"\u2713":"\u2013"} Shell HUD block: ${d?"installed":"not installed (opt-in \u2014 run: visa-cli hud enable shell)"}`)}}let s=ga(),i=yr.existsSync(s);if(e("HUD cache file",i,i?s.replace(at.homedir(),"~"):"missing \u2014 HUD has not refreshed yet"),i)try{let c=JSON.parse(yr.readFileSync(s,"utf-8")),u=Date.now()-(c.renderedAt??0),l=Math.round(u/1e3),d=l<=30;console.log(` ${d?"\u2713":"\u26A0"} Cache freshness: ${l}s old${d?"":" (stale \u2014 will refresh on next prompt)"}`)}catch{e("Cache readable",!1,"corrupt JSON")}let a=!1;try{a=!!await Ne.getSessionToken()}catch{}if(e("Auth token",a,a?"found in keychain":"missing \u2014 run: visa-cli setup"),a)try{await sn().getStatus(),e("API connectivity",!0,"GET /v1/status OK")}catch(c){let u=c instanceof Error?c.message:"unknown error";e("API connectivity",!1,u)}console.log(t?`
212
212
  All checks passed.`:`
213
- Some checks failed \u2014 see above.`),t||process.exit(1)});Ru.command("enable-claude").description("Alias for: hud enable claude").action(()=>{let t=Fo.join(at.homedir(),".claude","settings.json"),e=rp(t);console.log(e.message),(e.installed==="error"||e.installed==="malformed-json")&&process.exit(1)});Ru.command("disable-claude").description("Alias for: hud disable claude").action(()=>{let t=Fo.join(at.homedir(),".claude","settings.json"),e=XS(t);console.log(e.message),e.removed||process.exit(1)});var $6=mt.command("merchants").description("List discoverable platform merchants and inspect JIT tool cache guidance");$6.command("list").description("List live platform merchants and the tools they expose").option("--json","Print machine-readable JSON").action(async t=>{try{let e=new nr(()=>Ne.getSessionToken()),n=await e.listPublicMerchants();if(n.length===0){t.json?console.log(JSON.stringify({merchants:[]},null,2)):console.log(`
213
+ Some checks failed \u2014 see above.`),t||process.exit(1)});Ru.command("enable-claude").description("Alias for: hud enable claude").action(()=>{let t=Fo.join(at.homedir(),".claude","settings.json"),e=op(t);console.log(e.message),(e.installed==="error"||e.installed==="malformed-json")&&process.exit(1)});Ru.command("disable-claude").description("Alias for: hud disable claude").action(()=>{let t=Fo.join(at.homedir(),".claude","settings.json"),e=JS(t);console.log(e.message),e.removed||process.exit(1)});var Y6=mt.command("merchants").description("List discoverable platform merchants and inspect JIT tool cache guidance");Y6.command("list").description("List live platform merchants and the tools they expose").option("--json","Print machine-readable JSON").action(async t=>{try{let e=new rr(()=>Ne.getSessionToken()),n=await e.listPublicMerchants();if(n.length===0){t.json?console.log(JSON.stringify({merchants:[]},null,2)):console.log(`
214
214
  No live platform merchants on this auth server.
215
215
  `);return}let r=await Promise.all(n.map(async a=>{let c=await e.getPublicMerchantDiscover(a.slug);return{slug:a.slug,display_name:a.display_name,provider:c?.title??a.display_name,merchant_of_record:c?.merchant_of_record??a.display_name,upstream:c?.upstream,tools:(c?.routes??[]).filter(u=>u.tool_id).map(u=>({tool_id:u.tool_id,mcp_name:u.tool_id.replace(/-/g,"_"),method:u.method,path:u.path,price_cents:u.price_cents,category:u.category??null,description:u.description??null}))}}));if(t.json){console.log(JSON.stringify({merchants:r},null,2));return}let o="\x1B[1m",s="\x1B[2m",i="\x1B[0m";console.log();for(let a of r){let c=a.merchant_of_record!==a.provider?` ${s}(MoR: ${a.merchant_of_record})${i}`:"";if(console.log(` ${o}${a.provider}${i}${c} ${s}\u2014 slug: ${a.slug}${i}`),a.upstream&&console.log(` ${s}upstream: ${a.upstream}${i}`),a.tools.length===0)console.log(` ${s}(no routes with tool_id \u2014 agents can't see this merchant yet)${i}`);else for(let u of a.tools){let l=u.category?` ${s}[${u.category}]${i}`:"",d=`$${(u.price_cents/100).toFixed(2)}`;console.log(` ${u.tool_id}${l} ${s}\u2192 Claude: ${u.mcp_name}${i} ${d} ${s}${u.method} ${u.path}${i}`),u.description&&console.log(` ${s}${u.description}${i}`)}console.log()}console.log(` ${s}To enable JIT tools in your MCP server, set: visa-cli config set merchants.discover all (or =<slug,...>)${i}
216
- `)}catch(e){console.error("Error:",e.message),process.exit(1)}});$6.command("refresh").description("Hint: restart the MCP server (Claude/Cursor) to refresh discovered tools \u2014 discovery is in-process").action(()=>{console.log(`
216
+ `)}catch(e){console.error("Error:",e.message),process.exit(1)}});Y6.command("refresh").description("Hint: restart the MCP server (Claude/Cursor) to refresh discovered tools \u2014 discovery is in-process").action(()=>{console.log(`
217
217
  Platform-merchant tool discovery is cached in-process by the MCP server.`),console.log(" Cache TTL: VISA_MERCHANT_DISCOVER_TTL_MS (default 300000ms = 5min)."),console.log(` To force-refresh now, restart Claude / Cursor \u2014 the next tools/list will re-fetch.
218
- `)});mt.hook("postAction",()=>{if(Fd){Fd=!1;return}GS&&zC(GS.lastSignals)});mt.parse();
218
+ `)});mt.hook("postAction",()=>{if(Fd){Fd=!1;return}HS&&ZC(HS.lastSignals)});mt.parse();