@langgenius/syncless-darwin-arm64 0.0.15-beta.0 → 0.0.15-beta.1
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/package.json +1 -1
- package/payload/.env +1 -1
- package/payload/dist/cli.js +3 -3
- package/payload/package.json +1 -1
package/package.json
CHANGED
package/payload/.env
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
OBSERVABILITY_ADAPTERS_CLI=sentry
|
|
2
2
|
OBSERVABILITY_ENABLED=true
|
|
3
3
|
OBSERVABILITY_ENVIRONMENT=production
|
|
4
|
-
OBSERVABILITY_RELEASE=echo@0.0.15-beta.
|
|
4
|
+
OBSERVABILITY_RELEASE=echo@0.0.15-beta.1+cli
|
|
5
5
|
SENTRY_DSN_CLI=https://e16f0ca721670fe0cbb1aee8a0ab689e@o4511154660638720.ingest.us.sentry.io/4511190976167936
|
|
6
6
|
OTEL_ENABLED=false
|
package/payload/dist/cli.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
|
|
3
|
-
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="
|
|
3
|
+
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="ae70dbbe-f8ed-5330-b7f8-bcda9e40a918")}catch(e){}}();
|
|
4
4
|
import{a as __toCommonJS,i as __require,n as __esmMin,o as __toESM,r as __exportAll,t as __commonJSMin$1}from"./chunk-Bdh3yLIe.js";import{$ as WS_RPC_PREFERENCES_CHANNELS,A as createObservedFetch,B as redactHeaders,C as nativeEnum,D as string$2,E as record$1,F as parseObservabilitySinkNames,G as CLI_BRAND,H as redactUrlString,I as resolveAppVersionFromRelease,J as NetworkRpcObservabilityTag,K as NetworkRpcObservabilityErrorMessage,L as trimAndLowercase,M as applyClientScopeSnapshot,N as createCompositeSink,O as union$4,P as createNoopNetworkObservabilityPort,Q as WS_RPC_CHANNELS$1$1,R as trimAndUppercase,S as literal$1,T as object$1,U as sanitizeObservabilityAttributes,V as redactString,W as createNoopSink,X as PRODUCT_DISPLAY_NAME,Y as NetworkRpcObservabilityTransportPhase,Z as WS_RPC_CHANNELS$1,_ as _enum$1,_t as string$1,a as GetSessionResultStatus,at as taskMessageMetadataSchema$1,b as discriminatedUnion$1,ct as _null,dt as boolean,et as WS_RPC_REVIEW_CHANNELS,ft as discriminatedUnion,g as nullAsUndefined,gt as record,h as jsonValueSchema$1,ht as object,i as ReleaseProduct,it as projectTemplateConversationOpenerSchema$1,j as ObservabilitySinkName,k as unknown,l as getSsoAuthorizationCompletion,lt as array$2,m as startSsoAuthorization,mt as number$2,n as CliReleasePlatform,nt as WS_RPC_USER_PIPELINE_SETTING_CHANNELS,o as exchangeCliSessionBootstrap,ot as jsonValueSchema,p as startOAuthAuthorization,pt as literal,q as NetworkRpcObservabilityRpcResult,r as ReleaseChannel,rt as WS_RPC_WORKSPACE_CHANNELS,s as getOAuthAuthorizationCompletion,st as _enum,t as checkForUpdates,tt as WS_RPC_TASK_CHANNELS,u as revokeCliSession,ut as bigint,v as array$3,vt as union$3,w as number$3,x as lazy,y as boolean$1,z as createFrontendObservabilityRuntime}from"./dist-Bu1YPPQW.js";import{i as LoginCycleStatus,n as AuthProvider,r as ConnectionUIStatus,t as EXTERNAL_AUTH_COMPLETION_STATUSES}from"./status-jFJKIUBU-BCgr1MV_.js";import{_ as createContextKey,a as metrics,c as SpanStatusCode,d as INVALID_SPAN_CONTEXT,f as INVALID_TRACEID,g as ROOT_CONTEXT,h as DiagConsoleLogger,i as propagation,l as SpanKind,m as ValueType,n as init_esm$2,o as diag,p as TraceFlags,r as trace,s as context$1,t as esm_exports$2,u as isSpanContextValid,v as DiagLogLevel}from"./esm-DcZNWkvb.js";import{createRequire}from"node:module";import*as fs$1 from"node:fs";import fs,{accessSync,chmodSync,constants,createReadStream,createWriteStream,existsSync,readFile,readFileSync,readdir,statSync}from"node:fs";import path,{basename,delimiter,dirname,isAbsolute,join,posix,resolve,sep}from"node:path";import{fileURLToPath}from"node:url";import{EventEmitter,setMaxListeners}from"events";import*as r from"fs";import{constants as constants$1,realpathSync}from"fs";import*as path$3 from"path";import{basename as basename$1,dirname as dirname$1,isAbsolute as isAbsolute$1,join as join$1,relative,resolve as resolve$1,sep as sep$1}from"path";import{homedir,tmpdir,userInfo}from"os";import{createHash,randomUUID}from"crypto";import*as fs$2 from"node:fs/promises";import{appendFile,cp,mkdir,readFile as readFile$1,readdir as readdir$1,rm,stat,writeFile}from"node:fs/promises";import*as os$5 from"node:os";import os,{homedir as homedir$1,hostname}from"node:os";import{createHash as createHash$1,randomUUID as randomUUID$1}from"node:crypto";import{execFile,spawn}from"child_process";import{promisify}from"util";import*as moduleModule from"module";import{createRequire as createRequire$1}from"module";import{URL as URL$1,fileURLToPath as fileURLToPath$1}from"url";import{isMainThread,threadId}from"worker_threads";import*as diagnosticsChannel from"node:diagnostics_channel";import{subscribe,tracingChannel}from"node:diagnostics_channel";import{EventEmitter as EventEmitter$1,errorMonitor}from"node:events";import*as http from"node:http";import*as https from"node:https";import*as diagch from"diagnostics_channel";import{cwd}from"process";import{AsyncLocalStorage}from"node:async_hooks";import{execFile as execFile$1,execFileSync,spawn as spawn$1}from"node:child_process";import*as util from"node:util";import{promisify as promisify$1}from"node:util";import readline,{createInterface}from"node:readline";import{Worker}from"node:worker_threads";import{PassThrough,Readable,Stream}from"node:stream";import{createGzip}from"node:zlib";import*as net from"node:net";import*as tls from"node:tls";import{Buffer as Buffer$1}from"node:buffer";import process$1,{cwd as cwd$1,env,stderr,stdout}from"node:process";import{appendFile as appendFile$1,copyFile,mkdir as mkdir$1,open,readFile as readFile$2,readdir as readdir$2,realpath,rename,rm as rm$1,rmdir,stat as stat$1,symlink,unlink,writeFile as writeFile$1}from"fs/promises";import{createInterface as createInterface$1}from"readline";import{pipeline}from"node:stream/promises";import tty from"node:tty";import*as zlib from"zlib";import{Readable as Readable$1}from"stream";var __commonJSMin=(n,c)=>()=>(c||(n((c={exports:{}}).exports,c),n=null),c.exports),require_utf8$1=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.utf8Count=c,n.utf8EncodeJs=u,n.utf8EncodeTE=x,n.utf8Encode=w,n.utf8DecodeJs=O,n.utf8DecodeTD=N,n.utf8Decode=I;function c(n){let c=n.length,u=0,p=0;for(;p<c;){let h=n.charCodeAt(p++);if(!(h&4294967168)){u++;continue}else if(!(h&4294965248))u+=2;else{if(h>=55296&&h<=56319&&p<c){let c=n.charCodeAt(p);(c&64512)==56320&&(++p,h=((h&1023)<<10)+(c&1023)+65536)}h&4294901760?u+=4:u+=3}}return u}function u(n,c,u){let p=n.length,h=u,x=0;for(;x<p;){let u=n.charCodeAt(x++);if(!(u&4294967168)){c[h++]=u;continue}else if(!(u&4294965248))c[h++]=u>>6&31|192;else{if(u>=55296&&u<=56319&&x<p){let c=n.charCodeAt(x);(c&64512)==56320&&(++x,u=((u&1023)<<10)+(c&1023)+65536)}u&4294901760?(c[h++]=u>>18&7|240,c[h++]=u>>12&63|128,c[h++]=u>>6&63|128):(c[h++]=u>>12&15|224,c[h++]=u>>6&63|128)}c[h++]=u&63|128}}let p=new TextEncoder,h=50;function x(n,c,u){p.encodeInto(n,c.subarray(u))}function w(n,c,p){n.length>50?x(n,c,p):u(n,c,p)}let T=4096;function O(n,c,u){let p=c,h=p+u,x=[],w=``;for(;p<h;){let c=n[p++];if(!(c&128))x.push(c);else if((c&224)==192){let u=n[p++]&63;x.push((c&31)<<6|u)}else if((c&240)==224){let u=n[p++]&63,h=n[p++]&63;x.push((c&31)<<12|u<<6|h)}else if((c&248)==240){let u=n[p++]&63,h=n[p++]&63,w=n[p++]&63,T=(c&7)<<18|u<<12|h<<6|w;T>65535&&(T-=65536,x.push(T>>>10&1023|55296),T=56320|T&1023),x.push(T)}else x.push(c);x.length>=4096&&(w+=String.fromCharCode(...x),x.length=0)}return x.length>0&&(w+=String.fromCharCode(...x)),w}let A=new TextDecoder,j=200;function N(n,c,u){let p=n.subarray(c,c+u);return A.decode(p)}function I(n,c,u){return u>200?N(n,c,u):O(n,c,u)}})),require_ExtData=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExtData=void 0,n.ExtData=class{type;data;constructor(n,c){this.type=n,this.data=c}}})),require_DecodeError=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.DecodeError=void 0,n.DecodeError=class n extends Error{constructor(c){super(c);let u=Object.create(n.prototype);Object.setPrototypeOf(this,u),Object.defineProperty(this,`name`,{configurable:!0,enumerable:!1,value:n.name})}}})),require_int=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.UINT32_MAX=void 0,n.setUint64=c,n.setInt64=u,n.getInt64=p,n.getUint64=h,n.UINT32_MAX=4294967295;function c(n,c,u){let p=u/4294967296,h=u;n.setUint32(c,p),n.setUint32(c+4,h)}function u(n,c,u){let p=Math.floor(u/4294967296),h=u;n.setUint32(c,p),n.setUint32(c+4,h)}function p(n,c){let u=n.getInt32(c),p=n.getUint32(c+4);return u*4294967296+p}function h(n,c){let u=n.getUint32(c),p=n.getUint32(c+4);return u*4294967296+p}})),require_timestamp=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.timestampExtension=n.EXT_TIMESTAMP=void 0,n.encodeTimeSpecToTimestamp=x,n.encodeDateToTimeSpec=w,n.encodeTimestampExtension=T,n.decodeTimestampToTimeSpec=O,n.decodeTimestampExtension=A;let c=require_DecodeError(),u=require_int();n.EXT_TIMESTAMP=-1;let p=4294967295,h=17179869183;function x({sec:n,nsec:c}){if(n>=0&&c>=0&&n<=17179869183)if(c===0&&n<=4294967295){let c=new Uint8Array(4);return new DataView(c.buffer).setUint32(0,n),c}else{let u=n/4294967296,p=n&4294967295,h=new Uint8Array(8),x=new DataView(h.buffer);return x.setUint32(0,c<<2|u&3),x.setUint32(4,p),h}else{let p=new Uint8Array(12),h=new DataView(p.buffer);return h.setUint32(0,c),(0,u.setInt64)(h,4,n),p}}function w(n){let c=n.getTime(),u=Math.floor(c/1e3),p=(c-u*1e3)*1e6,h=Math.floor(p/1e9);return{sec:u+h,nsec:p-h*1e9}}function T(n){return n instanceof Date?x(w(n)):null}function O(n){let p=new DataView(n.buffer,n.byteOffset,n.byteLength);switch(n.byteLength){case 4:return{sec:p.getUint32(0),nsec:0};case 8:{let n=p.getUint32(0),c=p.getUint32(4);return{sec:(n&3)*4294967296+c,nsec:n>>>2}}case 12:return{sec:(0,u.getInt64)(p,4),nsec:p.getUint32(0)};default:throw new c.DecodeError(`Unrecognized data size for timestamp (expected 4, 8, or 12): ${n.length}`)}}function A(n){let c=O(n);return new Date(c.sec*1e3+c.nsec/1e6)}n.timestampExtension={type:n.EXT_TIMESTAMP,encode:T,decode:A}})),require_ExtensionCodec=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExtensionCodec=void 0;let c=require_ExtData(),u=require_timestamp();n.ExtensionCodec=class n{static defaultCodec=new n;__brand;builtInEncoders=[];builtInDecoders=[];encoders=[];decoders=[];constructor(){this.register(u.timestampExtension)}register({type:n,encode:c,decode:u}){if(n>=0)this.encoders[n]=c,this.decoders[n]=u;else{let p=-1-n;this.builtInEncoders[p]=c,this.builtInDecoders[p]=u}}tryToEncode(n,u){for(let p=0;p<this.builtInEncoders.length;p++){let h=this.builtInEncoders[p];if(h!=null){let x=h(n,u);if(x!=null){let n=-1-p;return new c.ExtData(n,x)}}}for(let p=0;p<this.encoders.length;p++){let h=this.encoders[p];if(h!=null){let x=h(n,u);if(x!=null){let n=p;return new c.ExtData(n,x)}}}return n instanceof c.ExtData?n:null}decode(n,u,p){let h=u<0?this.builtInDecoders[-1-u]:this.decoders[u];return h?h(n,u,p):new c.ExtData(u,n)}}})),require_typedArrays=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ensureUint8Array=u;function c(n){return n instanceof ArrayBuffer||typeof SharedArrayBuffer<`u`&&n instanceof SharedArrayBuffer}function u(n){return n instanceof Uint8Array?n:ArrayBuffer.isView(n)?new Uint8Array(n.buffer,n.byteOffset,n.byteLength):c(n)?new Uint8Array(n):Uint8Array.from(n)}})),require_Encoder=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Encoder=n.DEFAULT_INITIAL_BUFFER_SIZE=n.DEFAULT_MAX_DEPTH=void 0;let c=require_utf8$1(),u=require_ExtensionCodec(),p=require_int(),h=require_typedArrays();n.DEFAULT_MAX_DEPTH=100,n.DEFAULT_INITIAL_BUFFER_SIZE=2048,n.Encoder=class x{extensionCodec;context;useBigInt64;maxDepth;initialBufferSize;sortKeys;forceFloat32;ignoreUndefined;forceIntegerToFloat;pos;view;bytes;entered=!1;constructor(c){this.extensionCodec=c?.extensionCodec??u.ExtensionCodec.defaultCodec,this.context=c?.context,this.useBigInt64=c?.useBigInt64??!1,this.maxDepth=c?.maxDepth??n.DEFAULT_MAX_DEPTH,this.initialBufferSize=c?.initialBufferSize??n.DEFAULT_INITIAL_BUFFER_SIZE,this.sortKeys=c?.sortKeys??!1,this.forceFloat32=c?.forceFloat32??!1,this.ignoreUndefined=c?.ignoreUndefined??!1,this.forceIntegerToFloat=c?.forceIntegerToFloat??!1,this.pos=0,this.view=new DataView(new ArrayBuffer(this.initialBufferSize)),this.bytes=new Uint8Array(this.view.buffer)}clone(){return new x({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,maxDepth:this.maxDepth,initialBufferSize:this.initialBufferSize,sortKeys:this.sortKeys,forceFloat32:this.forceFloat32,ignoreUndefined:this.ignoreUndefined,forceIntegerToFloat:this.forceIntegerToFloat})}reinitializeState(){this.pos=0}encodeSharedRef(n){if(this.entered)return this.clone().encodeSharedRef(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.subarray(0,this.pos)}finally{this.entered=!1}}encode(n){if(this.entered)return this.clone().encode(n);try{return this.entered=!0,this.reinitializeState(),this.doEncode(n,1),this.bytes.slice(0,this.pos)}finally{this.entered=!1}}doEncode(n,c){if(c>this.maxDepth)throw Error(`Too deep objects in depth ${c}`);n==null?this.encodeNil():typeof n==`boolean`?this.encodeBoolean(n):typeof n==`number`?this.forceIntegerToFloat?this.encodeNumberAsFloat(n):this.encodeNumber(n):typeof n==`string`?this.encodeString(n):this.useBigInt64&&typeof n==`bigint`?this.encodeBigInt64(n):this.encodeObject(n,c)}ensureBufferSizeToWrite(n){let c=this.pos+n;this.view.byteLength<c&&this.resizeBuffer(c*2)}resizeBuffer(n){let c=new ArrayBuffer(n),u=new Uint8Array(c),p=new DataView(c);u.set(this.bytes),this.view=p,this.bytes=u}encodeNil(){this.writeU8(192)}encodeBoolean(n){n===!1?this.writeU8(194):this.writeU8(195)}encodeNumber(n){!this.forceIntegerToFloat&&Number.isSafeInteger(n)?n>=0?n<128?this.writeU8(n):n<256?(this.writeU8(204),this.writeU8(n)):n<65536?(this.writeU8(205),this.writeU16(n)):n<4294967296?(this.writeU8(206),this.writeU32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(207),this.writeU64(n)):n>=-32?this.writeU8(224|n+32):n>=-128?(this.writeU8(208),this.writeI8(n)):n>=-32768?(this.writeU8(209),this.writeI16(n)):n>=-2147483648?(this.writeU8(210),this.writeI32(n)):this.useBigInt64?this.encodeNumberAsFloat(n):(this.writeU8(211),this.writeI64(n)):this.encodeNumberAsFloat(n)}encodeNumberAsFloat(n){this.forceFloat32?(this.writeU8(202),this.writeF32(n)):(this.writeU8(203),this.writeF64(n))}encodeBigInt64(n){n>=BigInt(0)?(this.writeU8(207),this.writeBigUint64(n)):(this.writeU8(211),this.writeBigInt64(n))}writeStringHeader(n){if(n<32)this.writeU8(160+n);else if(n<256)this.writeU8(217),this.writeU8(n);else if(n<65536)this.writeU8(218),this.writeU16(n);else if(n<4294967296)this.writeU8(219),this.writeU32(n);else throw Error(`Too long string: ${n} bytes in UTF-8`)}encodeString(n){let u=5,p=(0,c.utf8Count)(n);this.ensureBufferSizeToWrite(5+p),this.writeStringHeader(p),(0,c.utf8Encode)(n,this.bytes,this.pos),this.pos+=p}encodeObject(n,c){let u=this.extensionCodec.tryToEncode(n,this.context);if(u!=null)this.encodeExtension(u);else if(Array.isArray(n))this.encodeArray(n,c);else if(ArrayBuffer.isView(n))this.encodeBinary(n);else if(typeof n==`object`)this.encodeMap(n,c);else throw Error(`Unrecognized object: ${Object.prototype.toString.apply(n)}`)}encodeBinary(n){let c=n.byteLength;if(c<256)this.writeU8(196),this.writeU8(c);else if(c<65536)this.writeU8(197),this.writeU16(c);else if(c<4294967296)this.writeU8(198),this.writeU32(c);else throw Error(`Too large binary: ${c}`);let u=(0,h.ensureUint8Array)(n);this.writeU8a(u)}encodeArray(n,c){let u=n.length;if(u<16)this.writeU8(144+u);else if(u<65536)this.writeU8(220),this.writeU16(u);else if(u<4294967296)this.writeU8(221),this.writeU32(u);else throw Error(`Too large array: ${u}`);for(let u of n)this.doEncode(u,c+1)}countWithoutUndefined(n,c){let u=0;for(let p of c)n[p]!==void 0&&u++;return u}encodeMap(n,c){let u=Object.keys(n);this.sortKeys&&u.sort();let p=this.ignoreUndefined?this.countWithoutUndefined(n,u):u.length;if(p<16)this.writeU8(128+p);else if(p<65536)this.writeU8(222),this.writeU16(p);else if(p<4294967296)this.writeU8(223),this.writeU32(p);else throw Error(`Too large map object: ${p}`);for(let p of u){let u=n[p];this.ignoreUndefined&&u===void 0||(this.encodeString(p),this.doEncode(u,c+1))}}encodeExtension(n){if(typeof n.data==`function`){let c=n.data(this.pos+6),u=c.length;if(u>=4294967296)throw Error(`Too large extension object: ${u}`);this.writeU8(201),this.writeU32(u),this.writeI8(n.type),this.writeU8a(c);return}let c=n.data.length;if(c===1)this.writeU8(212);else if(c===2)this.writeU8(213);else if(c===4)this.writeU8(214);else if(c===8)this.writeU8(215);else if(c===16)this.writeU8(216);else if(c<256)this.writeU8(199),this.writeU8(c);else if(c<65536)this.writeU8(200),this.writeU16(c);else if(c<4294967296)this.writeU8(201),this.writeU32(c);else throw Error(`Too large extension object: ${c}`);this.writeI8(n.type),this.writeU8a(n.data)}writeU8(n){this.ensureBufferSizeToWrite(1),this.view.setUint8(this.pos,n),this.pos++}writeU8a(n){let c=n.length;this.ensureBufferSizeToWrite(c),this.bytes.set(n,this.pos),this.pos+=c}writeI8(n){this.ensureBufferSizeToWrite(1),this.view.setInt8(this.pos,n),this.pos++}writeU16(n){this.ensureBufferSizeToWrite(2),this.view.setUint16(this.pos,n),this.pos+=2}writeI16(n){this.ensureBufferSizeToWrite(2),this.view.setInt16(this.pos,n),this.pos+=2}writeU32(n){this.ensureBufferSizeToWrite(4),this.view.setUint32(this.pos,n),this.pos+=4}writeI32(n){this.ensureBufferSizeToWrite(4),this.view.setInt32(this.pos,n),this.pos+=4}writeF32(n){this.ensureBufferSizeToWrite(4),this.view.setFloat32(this.pos,n),this.pos+=4}writeF64(n){this.ensureBufferSizeToWrite(8),this.view.setFloat64(this.pos,n),this.pos+=8}writeU64(n){this.ensureBufferSizeToWrite(8),(0,p.setUint64)(this.view,this.pos,n),this.pos+=8}writeI64(n){this.ensureBufferSizeToWrite(8),(0,p.setInt64)(this.view,this.pos,n),this.pos+=8}writeBigUint64(n){this.ensureBufferSizeToWrite(8),this.view.setBigUint64(this.pos,n),this.pos+=8}writeBigInt64(n){this.ensureBufferSizeToWrite(8),this.view.setBigInt64(this.pos,n),this.pos+=8}}})),require_encode=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.encode=u;let c=require_Encoder();function u(n,u){return new c.Encoder(u).encodeSharedRef(n)}})),require_prettyByte=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.prettyByte=c;function c(n){return`${n<0?`-`:``}0x${Math.abs(n).toString(16).padStart(2,`0`)}`}})),require_CachedKeyDecoder=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.CachedKeyDecoder=void 0;let c=require_utf8$1(),u=16,p=16;n.CachedKeyDecoder=class{hit=0;miss=0;caches;maxKeyLength;maxLengthPerKey;constructor(n=16,c=16){this.maxKeyLength=n,this.maxLengthPerKey=c,this.caches=[];for(let n=0;n<this.maxKeyLength;n++)this.caches.push([])}canBeCached(n){return n>0&&n<=this.maxKeyLength}find(n,c,u){let p=this.caches[u-1];FIND_CHUNK:for(let h of p){let p=h.bytes;for(let h=0;h<u;h++)if(p[h]!==n[c+h])continue FIND_CHUNK;return h.str}return null}store(n,c){let u=this.caches[n.length-1],p={bytes:n,str:c};u.length>=this.maxLengthPerKey?u[Math.random()*u.length|0]=p:u.push(p)}decode(n,u,p){let h=this.find(n,u,p);if(h!=null)return this.hit++,h;this.miss++;let x=(0,c.utf8DecodeJs)(n,u,p),w=Uint8Array.prototype.slice.call(n,u,u+p);return this.store(w,x),x}}})),require_Decoder=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Decoder=void 0;let c=require_prettyByte(),u=require_ExtensionCodec(),p=require_int(),h=require_utf8$1(),x=require_typedArrays(),w=require_CachedKeyDecoder(),T=require_DecodeError(),O=`array`,A=`map_key`,j=`map_value`,N=n=>{if(typeof n==`string`||typeof n==`number`)return n;throw new T.DecodeError(`The type of key must be string or number but `+typeof n)};var I=class{stack=[];stackHeadPosition=-1;get length(){return this.stackHeadPosition+1}top(){return this.stack[this.stackHeadPosition]}pushArrayState(n){let c=this.getUninitializedStateFromPool();c.type=O,c.position=0,c.size=n,c.array=Array(n)}pushMapState(n){let c=this.getUninitializedStateFromPool();c.type=A,c.readCount=0,c.size=n,c.map={}}getUninitializedStateFromPool(){return this.stackHeadPosition++,this.stackHeadPosition===this.stack.length&&this.stack.push({type:void 0,size:0,array:void 0,position:0,readCount:0,map:void 0,key:null}),this.stack[this.stackHeadPosition]}release(n){if(this.stack[this.stackHeadPosition]!==n)throw Error(`Invalid stack state. Released state is not on top of the stack.`);if(n.type===O){let c=n;c.size=0,c.array=void 0,c.position=0,c.type=void 0}if(n.type===A||n.type===j){let c=n;c.size=0,c.map=void 0,c.readCount=0,c.type=void 0}this.stackHeadPosition--}reset(){this.stack.length=0,this.stackHeadPosition=-1}};let L=-1,z=new DataView(new ArrayBuffer(0)),B=new Uint8Array(z.buffer);try{z.getInt8(0)}catch(n){if(!(n instanceof RangeError))throw Error(`This module is not supported in the current JavaScript engine because DataView does not throw RangeError on out-of-bounds access`)}let V=RangeError(`Insufficient data`),H=new w.CachedKeyDecoder;n.Decoder=class n{extensionCodec;context;useBigInt64;rawStrings;maxStrLength;maxBinLength;maxArrayLength;maxMapLength;maxExtLength;keyDecoder;mapKeyConverter;totalPos=0;pos=0;view=z;bytes=B;headByte=-1;stack=new I;entered=!1;constructor(n){this.extensionCodec=n?.extensionCodec??u.ExtensionCodec.defaultCodec,this.context=n?.context,this.useBigInt64=n?.useBigInt64??!1,this.rawStrings=n?.rawStrings??!1,this.maxStrLength=n?.maxStrLength??p.UINT32_MAX,this.maxBinLength=n?.maxBinLength??p.UINT32_MAX,this.maxArrayLength=n?.maxArrayLength??p.UINT32_MAX,this.maxMapLength=n?.maxMapLength??p.UINT32_MAX,this.maxExtLength=n?.maxExtLength??p.UINT32_MAX,this.keyDecoder=n?.keyDecoder===void 0?H:n.keyDecoder,this.mapKeyConverter=n?.mapKeyConverter??N}clone(){return new n({extensionCodec:this.extensionCodec,context:this.context,useBigInt64:this.useBigInt64,rawStrings:this.rawStrings,maxStrLength:this.maxStrLength,maxBinLength:this.maxBinLength,maxArrayLength:this.maxArrayLength,maxMapLength:this.maxMapLength,maxExtLength:this.maxExtLength,keyDecoder:this.keyDecoder})}reinitializeState(){this.totalPos=0,this.headByte=-1,this.stack.reset()}setBuffer(n){let c=(0,x.ensureUint8Array)(n);this.bytes=c,this.view=new DataView(c.buffer,c.byteOffset,c.byteLength),this.pos=0}appendBuffer(n){if(this.headByte===-1&&!this.hasRemaining(1))this.setBuffer(n);else{let c=this.bytes.subarray(this.pos),u=(0,x.ensureUint8Array)(n),p=new Uint8Array(c.length+u.length);p.set(c),p.set(u,c.length),this.setBuffer(p)}}hasRemaining(n){return this.view.byteLength-this.pos>=n}createExtraByteError(n){let{view:c,pos:u}=this;return RangeError(`Extra ${c.byteLength-u} of ${c.byteLength} byte(s) found at buffer[${n}]`)}decode(n){if(this.entered)return this.clone().decode(n);try{this.entered=!0,this.reinitializeState(),this.setBuffer(n);let c=this.doDecodeSync();if(this.hasRemaining(1))throw this.createExtraByteError(this.pos);return c}finally{this.entered=!1}}*decodeMulti(n){if(this.entered){yield*this.clone().decodeMulti(n);return}try{for(this.entered=!0,this.reinitializeState(),this.setBuffer(n);this.hasRemaining(1);)yield this.doDecodeSync()}finally{this.entered=!1}}async decodeAsync(n){if(this.entered)return this.clone().decodeAsync(n);try{this.entered=!0;let u=!1,p;for await(let c of n){if(u)throw this.entered=!1,this.createExtraByteError(this.totalPos);this.appendBuffer(c);try{p=this.doDecodeSync(),u=!0}catch(n){if(!(n instanceof RangeError))throw n}this.totalPos+=this.pos}if(u){if(this.hasRemaining(1))throw this.createExtraByteError(this.totalPos);return p}let{headByte:h,pos:x,totalPos:w}=this;throw RangeError(`Insufficient data in parsing ${(0,c.prettyByte)(h)} at ${w} (${x} in the current buffer)`)}finally{this.entered=!1}}decodeArrayStream(n){return this.decodeMultiAsync(n,!0)}decodeStream(n){return this.decodeMultiAsync(n,!1)}async*decodeMultiAsync(n,c){if(this.entered){yield*this.clone().decodeMultiAsync(n,c);return}try{this.entered=!0;let u=c,p=-1;for await(let h of n){if(c&&p===0)throw this.createExtraByteError(this.totalPos);this.appendBuffer(h),u&&(p=this.readArraySize(),u=!1,this.complete());try{for(;yield this.doDecodeSync(),--p!==0;);}catch(n){if(!(n instanceof RangeError))throw n}this.totalPos+=this.pos}}finally{this.entered=!1}}doDecodeSync(){DECODE:for(;;){let n=this.readHeadByte(),u;if(n>=224)u=n-256;else if(n<192)if(n<128)u=n;else if(n<144){let c=n-128;if(c!==0){this.pushMapState(c),this.complete();continue DECODE}else u={}}else if(n<160){let c=n-144;if(c!==0){this.pushArrayState(c),this.complete();continue DECODE}else u=[]}else{let c=n-160;u=this.decodeString(c,0)}else if(n===192)u=null;else if(n===194)u=!1;else if(n===195)u=!0;else if(n===202)u=this.readF32();else if(n===203)u=this.readF64();else if(n===204)u=this.readU8();else if(n===205)u=this.readU16();else if(n===206)u=this.readU32();else if(n===207)u=this.useBigInt64?this.readU64AsBigInt():this.readU64();else if(n===208)u=this.readI8();else if(n===209)u=this.readI16();else if(n===210)u=this.readI32();else if(n===211)u=this.useBigInt64?this.readI64AsBigInt():this.readI64();else if(n===217){let n=this.lookU8();u=this.decodeString(n,1)}else if(n===218){let n=this.lookU16();u=this.decodeString(n,2)}else if(n===219){let n=this.lookU32();u=this.decodeString(n,4)}else if(n===220){let n=this.readU16();if(n!==0){this.pushArrayState(n),this.complete();continue DECODE}else u=[]}else if(n===221){let n=this.readU32();if(n!==0){this.pushArrayState(n),this.complete();continue DECODE}else u=[]}else if(n===222){let n=this.readU16();if(n!==0){this.pushMapState(n),this.complete();continue DECODE}else u={}}else if(n===223){let n=this.readU32();if(n!==0){this.pushMapState(n),this.complete();continue DECODE}else u={}}else if(n===196){let n=this.lookU8();u=this.decodeBinary(n,1)}else if(n===197){let n=this.lookU16();u=this.decodeBinary(n,2)}else if(n===198){let n=this.lookU32();u=this.decodeBinary(n,4)}else if(n===212)u=this.decodeExtension(1,0);else if(n===213)u=this.decodeExtension(2,0);else if(n===214)u=this.decodeExtension(4,0);else if(n===215)u=this.decodeExtension(8,0);else if(n===216)u=this.decodeExtension(16,0);else if(n===199){let n=this.lookU8();u=this.decodeExtension(n,1)}else if(n===200){let n=this.lookU16();u=this.decodeExtension(n,2)}else if(n===201){let n=this.lookU32();u=this.decodeExtension(n,4)}else throw new T.DecodeError(`Unrecognized type byte: ${(0,c.prettyByte)(n)}`);this.complete();let p=this.stack;for(;p.length>0;){let n=p.top();if(n.type===O)if(n.array[n.position]=u,n.position++,n.position===n.size)u=n.array,p.release(n);else continue DECODE;else if(n.type===A){if(u===`__proto__`)throw new T.DecodeError(`The key __proto__ is not allowed`);n.key=this.mapKeyConverter(u),n.type=j;continue DECODE}else if(n.map[n.key]=u,n.readCount++,n.readCount===n.size)u=n.map,p.release(n);else{n.key=null,n.type=A;continue DECODE}}return u}}readHeadByte(){return this.headByte===-1&&(this.headByte=this.readU8()),this.headByte}complete(){this.headByte=-1}readArraySize(){let n=this.readHeadByte();switch(n){case 220:return this.readU16();case 221:return this.readU32();default:if(n<160)return n-144;throw new T.DecodeError(`Unrecognized array type byte: ${(0,c.prettyByte)(n)}`)}}pushMapState(n){if(n>this.maxMapLength)throw new T.DecodeError(`Max length exceeded: map length (${n}) > maxMapLengthLength (${this.maxMapLength})`);this.stack.pushMapState(n)}pushArrayState(n){if(n>this.maxArrayLength)throw new T.DecodeError(`Max length exceeded: array length (${n}) > maxArrayLength (${this.maxArrayLength})`);this.stack.pushArrayState(n)}decodeString(n,c){return!this.rawStrings||this.stateIsMapKey()?this.decodeUtf8String(n,c):this.decodeBinary(n,c)}decodeUtf8String(n,c){if(n>this.maxStrLength)throw new T.DecodeError(`Max length exceeded: UTF-8 byte length (${n}) > maxStrLength (${this.maxStrLength})`);if(this.bytes.byteLength<this.pos+c+n)throw V;let u=this.pos+c,p;return p=this.stateIsMapKey()&&this.keyDecoder?.canBeCached(n)?this.keyDecoder.decode(this.bytes,u,n):(0,h.utf8Decode)(this.bytes,u,n),this.pos+=c+n,p}stateIsMapKey(){return this.stack.length>0?this.stack.top().type===A:!1}decodeBinary(n,c){if(n>this.maxBinLength)throw new T.DecodeError(`Max length exceeded: bin length (${n}) > maxBinLength (${this.maxBinLength})`);if(!this.hasRemaining(n+c))throw V;let u=this.pos+c,p=this.bytes.subarray(u,u+n);return this.pos+=c+n,p}decodeExtension(n,c){if(n>this.maxExtLength)throw new T.DecodeError(`Max length exceeded: ext length (${n}) > maxExtLength (${this.maxExtLength})`);let u=this.view.getInt8(this.pos+c),p=this.decodeBinary(n,c+1);return this.extensionCodec.decode(p,u,this.context)}lookU8(){return this.view.getUint8(this.pos)}lookU16(){return this.view.getUint16(this.pos)}lookU32(){return this.view.getUint32(this.pos)}readU8(){let n=this.view.getUint8(this.pos);return this.pos++,n}readI8(){let n=this.view.getInt8(this.pos);return this.pos++,n}readU16(){let n=this.view.getUint16(this.pos);return this.pos+=2,n}readI16(){let n=this.view.getInt16(this.pos);return this.pos+=2,n}readU32(){let n=this.view.getUint32(this.pos);return this.pos+=4,n}readI32(){let n=this.view.getInt32(this.pos);return this.pos+=4,n}readU64(){let n=(0,p.getUint64)(this.view,this.pos);return this.pos+=8,n}readI64(){let n=(0,p.getInt64)(this.view,this.pos);return this.pos+=8,n}readU64AsBigInt(){let n=this.view.getBigUint64(this.pos);return this.pos+=8,n}readI64AsBigInt(){let n=this.view.getBigInt64(this.pos);return this.pos+=8,n}readF32(){let n=this.view.getFloat32(this.pos);return this.pos+=4,n}readF64(){let n=this.view.getFloat64(this.pos);return this.pos+=8,n}}})),require_decode=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.decode=u,n.decodeMulti=p;let c=require_Decoder();function u(n,u){return new c.Decoder(u).decode(n)}function p(n,u){return new c.Decoder(u).decodeMulti(n)}})),require_stream=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isAsyncIterable=c,n.asyncIterableFromStream=u,n.ensureAsyncIterable=p;function c(n){return n[Symbol.asyncIterator]!=null}async function*u(n){let c=n.getReader();try{for(;;){let{done:n,value:u}=await c.read();if(n)return;yield u}}finally{c.releaseLock()}}function p(n){return c(n)?n:u(n)}})),require_decodeAsync=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.decodeAsync=p,n.decodeArrayStream=h,n.decodeMultiStream=x;let c=require_Decoder(),u=require_stream();async function p(n,p){let h=(0,u.ensureAsyncIterable)(n);return new c.Decoder(p).decodeAsync(h)}function h(n,p){let h=(0,u.ensureAsyncIterable)(n);return new c.Decoder(p).decodeArrayStream(h)}function x(n,p){let h=(0,u.ensureAsyncIterable)(n);return new c.Decoder(p).decodeStream(h)}})),import_dist_cjs=__commonJSMin((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.decodeTimestampExtension=n.encodeTimestampExtension=n.decodeTimestampToTimeSpec=n.encodeTimeSpecToTimestamp=n.encodeDateToTimeSpec=n.EXT_TIMESTAMP=n.ExtData=n.ExtensionCodec=n.Encoder=n.DecodeError=n.Decoder=n.decodeMultiStream=n.decodeArrayStream=n.decodeAsync=n.decodeMulti=n.decode=n.encode=void 0;let c=require_encode();Object.defineProperty(n,`encode`,{enumerable:!0,get:function(){return c.encode}});let u=require_decode();Object.defineProperty(n,`decode`,{enumerable:!0,get:function(){return u.decode}}),Object.defineProperty(n,`decodeMulti`,{enumerable:!0,get:function(){return u.decodeMulti}});let p=require_decodeAsync();Object.defineProperty(n,`decodeAsync`,{enumerable:!0,get:function(){return p.decodeAsync}}),Object.defineProperty(n,`decodeArrayStream`,{enumerable:!0,get:function(){return p.decodeArrayStream}}),Object.defineProperty(n,`decodeMultiStream`,{enumerable:!0,get:function(){return p.decodeMultiStream}});let h=require_Decoder();Object.defineProperty(n,`Decoder`,{enumerable:!0,get:function(){return h.Decoder}});let x=require_DecodeError();Object.defineProperty(n,`DecodeError`,{enumerable:!0,get:function(){return x.DecodeError}});let w=require_Encoder();Object.defineProperty(n,`Encoder`,{enumerable:!0,get:function(){return w.Encoder}});let T=require_ExtensionCodec();Object.defineProperty(n,`ExtensionCodec`,{enumerable:!0,get:function(){return T.ExtensionCodec}});let O=require_ExtData();Object.defineProperty(n,`ExtData`,{enumerable:!0,get:function(){return O.ExtData}});let A=require_timestamp();Object.defineProperty(n,`EXT_TIMESTAMP`,{enumerable:!0,get:function(){return A.EXT_TIMESTAMP}}),Object.defineProperty(n,`encodeDateToTimeSpec`,{enumerable:!0,get:function(){return A.encodeDateToTimeSpec}}),Object.defineProperty(n,`encodeTimeSpecToTimestamp`,{enumerable:!0,get:function(){return A.encodeTimeSpecToTimestamp}}),Object.defineProperty(n,`decodeTimestampToTimeSpec`,{enumerable:!0,get:function(){return A.decodeTimestampToTimeSpec}}),Object.defineProperty(n,`encodeTimestampExtension`,{enumerable:!0,get:function(){return A.encodeTimestampExtension}}),Object.defineProperty(n,`decodeTimestampExtension`,{enumerable:!0,get:function(){return A.decodeTimestampExtension}})}))();const encoder=new import_dist_cjs.Encoder({useBigInt64:!0}),decoder=new import_dist_cjs.Decoder({useBigInt64:!0}),messagePackCodec={encode(n){return encoder.encode(n)},decode(n){return decoder.decode(n)}};function encodeMessagePack(n){return messagePackCodec.encode(n)}function decodeMessagePack(n){return messagePackCodec.decode(n)}function encodeEnvelope(n){return encodeMessagePack(n)}function decodeEnvelope(n){return decodeMessagePack(n)}const isFunction$1=n=>typeof n==`function`,dual=function(n,c){if(typeof n==`function`)return function(){return n(arguments)?c.apply(this,arguments):n=>c(n,...arguments)};switch(n){case 0:case 1:throw RangeError(`Invalid arity ${n}`);case 2:return function(n,u){return arguments.length>=2?c(n,u):function(u){return c(u,n)}};case 3:return function(n,u,p){return arguments.length>=3?c(n,u,p):function(p){return c(p,n,u)}};case 4:return function(n,u,p,h){return arguments.length>=4?c(n,u,p,h):function(h){return c(h,n,u,p)}};case 5:return function(n,u,p,h,x){return arguments.length>=5?c(n,u,p,h,x):function(x){return c(x,n,u,p,h)}};default:return function(){if(arguments.length>=n)return c.apply(this,arguments);let u=arguments;return function(n){return c(n,...u)}}}},identity$1=n=>n,constant=n=>()=>n,constTrue=constant(!0),constFalse=constant(!1),constUndefined=constant(void 0),constVoid=constUndefined;function pipe(n,c,u,p,h,x,w,T,O){switch(arguments.length){case 1:return n;case 2:return c(n);case 3:return u(c(n));case 4:return p(u(c(n)));case 5:return h(p(u(c(n))));case 6:return x(h(p(u(c(n)))));case 7:return w(x(h(p(u(c(n))))));case 8:return T(w(x(h(p(u(c(n)))))));case 9:return O(T(w(x(h(p(u(c(n))))))));default:{let n=arguments[0];for(let c=1;c<arguments.length;c++)n=arguments[c](n);return n}}}const make$26=n=>(c,u)=>c===u||n(c,u),mapInput$1=dual(2,(n,c)=>make$26((u,p)=>n(c(u),c(p)))),array$1=n=>make$26((c,u)=>{if(c.length!==u.length)return!1;for(let p=0;p<c.length;p++)if(!n(c[p],u[p]))return!1;return!0}),globalStoreId=`effect/GlobalValue`;let globalStore;const globalValue=(n,c)=>(globalStore||=(globalThis[globalStoreId]??=new Map,globalThis[globalStoreId]),globalStore.has(n)||globalStore.set(n,c()),globalStore.get(n)),isString$2=n=>typeof n==`string`,isNumber=n=>typeof n==`number`,isBigInt=n=>typeof n==`bigint`,isFunction=isFunction$1,isRecordOrArray=n=>typeof n==`object`&&!!n,isObject=n=>isRecordOrArray(n)||isFunction(n),hasProperty=dual(2,(n,c)=>isObject(n)&&c in n),isTagged=dual(2,(n,c)=>hasProperty(n,`_tag`)&&n._tag===c),isNullable=n=>n==null,isIterable=n=>typeof n==`string`||hasProperty(n,Symbol.iterator),isPromiseLike$1=n=>hasProperty(n,`then`)&&isFunction(n.then),getBugErrorMessage=n=>`BUG: ${n} - please report an issue at https://github.com/Effect-TS/effect/issues`;var SingleShotGen$1=class n{self;called=!1;constructor(n){this.self=n}next(n){return this.called?{value:n,done:!0}:(this.called=!0,{value:this.self,done:!1})}return(n){return{value:n,done:!0}}throw(n){throw n}[Symbol.iterator](){return new n(this.self)}};const defaultIncHi=335903614,defaultIncLo=4150755663,MUL_HI=1481765933,MUL_LO=1284865837,BIT_53=9007199254740992,BIT_27=134217728;var PCGRandom=class{_state;constructor(n,c,u,p){return isNullable(c)&&isNullable(n)?(c=Math.random()*4294967295>>>0,n=0):isNullable(c)&&(c=n,n=0),isNullable(p)&&isNullable(u)?(p=this._state?this._state[3]:defaultIncLo,u=this._state?this._state[2]:defaultIncHi):isNullable(p)&&(p=u,u=0),this._state=new Int32Array([0,0,u>>>0,((p||0)|1)>>>0]),this._next(),add64(this._state,this._state[0],this._state[1],n>>>0,c>>>0),this._next(),this}getState(){return[this._state[0],this._state[1],this._state[2],this._state[3]]}setState(n){this._state[0]=n[0],this._state[1]=n[1],this._state[2]=n[2],this._state[3]=n[3]|1}integer(n){return Math.round(this.number()*(2**53-1))%n}number(){let n=(this._next()&67108863)*1,c=(this._next()&134217727)*1;return(n*BIT_27+c)/BIT_53}_next(){let n=this._state[0]>>>0,c=this._state[1]>>>0;mul64(this._state,n,c,MUL_HI,MUL_LO),add64(this._state,this._state[0],this._state[1],this._state[2],this._state[3]);let u=n>>>18,p=(c>>>18|n<<14)>>>0;u=(u^n)>>>0,p=(p^c)>>>0;let h=(p>>>27|u<<5)>>>0,x=n>>>27,w=(-x>>>0&31)>>>0;return(h>>>x|h<<w)>>>0}};function mul64(n,c,u,p,h){let x=(u>>>16)*(h&65535)>>>0,w=(u&65535)*(h>>>16)>>>0,T=(u&65535)*(h&65535)>>>0,O=(u>>>16)*(h>>>16)+((w>>>16)+(x>>>16))>>>0;w=w<<16>>>0,T=T+w>>>0,T>>>0<w>>>0&&(O=O+1>>>0),x=x<<16>>>0,T=T+x>>>0,T>>>0<x>>>0&&(O=O+1>>>0),O=O+Math.imul(u,p)>>>0,O=O+Math.imul(c,h)>>>0,n[0]=O,n[1]=T}function add64(n,c,u,p,h){let x=c+p>>>0,w=u+h>>>0;w>>>0<u>>>0&&(x=x+1|0),n[0]=x,n[1]=w}const YieldWrapTypeId=Symbol.for(`effect/Utils/YieldWrap`);var YieldWrap=class{#e;constructor(n){this.#e=n}[YieldWrapTypeId](){return this.#e}};function yieldWrapGet(n){if(typeof n==`object`&&n&&YieldWrapTypeId in n)return n[YieldWrapTypeId]();throw Error(getBugErrorMessage(`yieldWrapGet`))}const structuralRegionState=globalValue(`effect/Utils/isStructuralRegion`,()=>({enabled:!1,tester:void 0})),standard={effect_internal_function:n=>n()},forced={effect_internal_function:n=>{try{return n()}finally{}}},isNotOptimizedAway=standard.effect_internal_function(()=>Error().stack)?.includes(`effect_internal_function`)===!0,internalCall=isNotOptimizedAway?standard.effect_internal_function:forced.effect_internal_function,genConstructor=function*(){}.constructor,randomHashCache=globalValue(Symbol.for(`effect/Hash/randomHashCache`),()=>new WeakMap),symbol$1=Symbol.for(`effect/Hash`),hash=n=>{if(structuralRegionState.enabled===!0)return 0;switch(typeof n){case`number`:return number$1(n);case`bigint`:return string(n.toString(10));case`boolean`:return string(String(n));case`symbol`:return string(String(n));case`string`:return string(n);case`undefined`:return string(`undefined`);case`function`:case`object`:return n===null?string(`null`):n instanceof Date?Number.isNaN(n.getTime())?string(`Invalid Date`):hash(n.toISOString()):n instanceof URL?hash(n.href):isHash(n)?n[symbol$1]():random(n);default:throw Error(`BUG: unhandled typeof ${typeof n} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},random=n=>(randomHashCache.has(n)||randomHashCache.set(n,number$1(Math.floor(Math.random()*(2**53-1)))),randomHashCache.get(n)),combine$5=n=>c=>c*53^n,optimize=n=>n&3221225471|n>>>1&1073741824,isHash=n=>hasProperty(n,symbol$1),number$1=n=>{if(n!==n||n===1/0)return 0;let c=n|0;for(c!==n&&(c^=n*4294967295);n>4294967295;)c^=n/=4294967295;return optimize(c)},string=n=>{let c=5381,u=n.length;for(;u;)c=c*33^n.charCodeAt(--u);return optimize(c)},structureKeys=(n,c)=>{let u=12289;for(let p=0;p<c.length;p++)u^=pipe(string(c[p]),combine$5(hash(n[c[p]])));return optimize(u)},structure=n=>structureKeys(n,Object.keys(n)),array=n=>{let c=6151;for(let u=0;u<n.length;u++)c=pipe(c,combine$5(hash(n[u])));return optimize(c)},cached=function(){if(arguments.length===1){let n=arguments[0];return function(c){return Object.defineProperty(n,symbol$1,{value(){return c},enumerable:!1}),c}}let n=arguments[0],c=arguments[1];return Object.defineProperty(n,symbol$1,{value(){return c},enumerable:!1}),c},symbol=Symbol.for(`effect/Equal`);function equals$1(){return arguments.length===1?n=>compareBoth(n,arguments[0]):compareBoth(arguments[0],arguments[1])}function compareBoth(n,c){if(n===c)return!0;let u=typeof n;if(u!==typeof c)return!1;if(u===`object`||u===`function`){if(n!==null&&c!==null){if(isEqual(n)&&isEqual(c))return hash(n)===hash(c)&&n[symbol](c)?!0:structuralRegionState.enabled&&structuralRegionState.tester?structuralRegionState.tester(n,c):!1;if(n instanceof Date&&c instanceof Date){let u=n.getTime(),p=c.getTime();return u===p||Number.isNaN(u)&&Number.isNaN(p)}else if(n instanceof URL&&c instanceof URL)return n.href===c.href}if(structuralRegionState.enabled){if(n===null||c===null)return!1;if(Array.isArray(n)&&Array.isArray(c))return n.length===c.length&&n.every((n,u)=>compareBoth(n,c[u]));if(Object.getPrototypeOf(n)===Object.prototype&&Object.getPrototypeOf(c)===Object.prototype){let u=Object.keys(n),p=Object.keys(c);if(u.length===p.length){for(let p of u)if(!(p in c&&compareBoth(n[p],c[p])))return structuralRegionState.tester?structuralRegionState.tester(n,c):!1;return!0}}return structuralRegionState.tester?structuralRegionState.tester(n,c):!1}}return structuralRegionState.enabled&&structuralRegionState.tester?structuralRegionState.tester(n,c):!1}const isEqual=n=>hasProperty(n,symbol),equivalence=()=>equals$1,NodeInspectSymbol=Symbol.for(`nodejs.util.inspect.custom`),toJSON=n=>{try{if(hasProperty(n,`toJSON`)&&isFunction(n.toJSON)&&n.toJSON.length===0)return n.toJSON();if(Array.isArray(n))return n.map(toJSON)}catch{return{}}return redact(n)},format$2=n=>JSON.stringify(n,null,2),toStringUnknown=(n,c=2)=>{if(typeof n==`string`)return n;try{return typeof n==`object`?stringifyCircular(n,c):String(n)}catch{return String(n)}},stringifyCircular=(n,c)=>{let u=[],p=JSON.stringify(n,(n,c)=>typeof c==`object`&&c?u.includes(c)?void 0:u.push(c)&&(redactableState.fiberRefs!==void 0&&isRedactable(c)?c[symbolRedactable](redactableState.fiberRefs):c):c,c);return u=void 0,p},symbolRedactable=Symbol.for(`effect/Inspectable/Redactable`),isRedactable=n=>typeof n==`object`&&!!n&&symbolRedactable in n,redactableState=globalValue(`effect/Inspectable/redactableState`,()=>({fiberRefs:void 0})),withRedactableContext=(n,c)=>{let u=redactableState.fiberRefs;redactableState.fiberRefs=n;try{return c()}finally{redactableState.fiberRefs=u}},redact=n=>isRedactable(n)&&redactableState.fiberRefs!==void 0?n[symbolRedactable](redactableState.fiberRefs):n,pipeArguments=(n,c)=>{switch(c.length){case 0:return n;case 1:return c[0](n);case 2:return c[1](c[0](n));case 3:return c[2](c[1](c[0](n)));case 4:return c[3](c[2](c[1](c[0](n))));case 5:return c[4](c[3](c[2](c[1](c[0](n)))));case 6:return c[5](c[4](c[3](c[2](c[1](c[0](n))))));case 7:return c[6](c[5](c[4](c[3](c[2](c[1](c[0](n)))))));case 8:return c[7](c[6](c[5](c[4](c[3](c[2](c[1](c[0](n))))))));case 9:return c[8](c[7](c[6](c[5](c[4](c[3](c[2](c[1](c[0](n)))))))));default:{let u=n;for(let n=0,p=c.length;n<p;n++)u=c[n](u);return u}}},OP_ASYNC=`Async`,OP_COMMIT=`Commit`,OP_FAILURE=`Failure`,OP_ON_FAILURE=`OnFailure`,OP_ON_SUCCESS=`OnSuccess`,OP_ON_SUCCESS_AND_FAILURE=`OnSuccessAndFailure`,OP_SUCCESS=`Success`,OP_SYNC=`Sync`,OP_TAG=`Tag`,OP_UPDATE_RUNTIME_FLAGS=`UpdateRuntimeFlags`,OP_WHILE=`While`,OP_ITERATOR=`Iterator`,OP_WITH_RUNTIME=`WithRuntime`,OP_YIELD=`Yield`,OP_REVERT_FLAGS=`RevertFlags`;let moduleVersion=`3.21.2`;const getCurrentVersion=()=>moduleVersion,EffectTypeId$1=Symbol.for(`effect/Effect`),StreamTypeId=Symbol.for(`effect/Stream`),SinkTypeId=Symbol.for(`effect/Sink`),ChannelTypeId=Symbol.for(`effect/Channel`),effectVariance={_R:n=>n,_E:n=>n,_A:n=>n,_V:getCurrentVersion()},sinkVariance={_A:n=>n,_In:n=>n,_L:n=>n,_E:n=>n,_R:n=>n},channelVariance={_Env:n=>n,_InErr:n=>n,_InElem:n=>n,_InDone:n=>n,_OutErr:n=>n,_OutElem:n=>n,_OutDone:n=>n},EffectPrototype$1={[EffectTypeId$1]:effectVariance,[StreamTypeId]:effectVariance,[SinkTypeId]:sinkVariance,[ChannelTypeId]:channelVariance,[symbol](n){return this===n},[symbol$1](){return cached(this,random(this))},[Symbol.iterator](){return new SingleShotGen$1(new YieldWrap(this))},pipe(){return pipeArguments(this,arguments)}},StructuralPrototype={[symbol$1](){return cached(this,structure(this))},[symbol](n){let c=Object.keys(this),u=Object.keys(n);if(c.length!==u.length)return!1;for(let u of c)if(!(u in n&&equals$1(this[u],n[u])))return!1;return!0}},CommitPrototype={...EffectPrototype$1,_op:OP_COMMIT},StructuralCommitPrototype={...CommitPrototype,...StructuralPrototype},Base$1=function(){function n(){}return n.prototype=CommitPrototype,n}(),TypeId$11=Symbol.for(`effect/Option`),CommonProto$1={...EffectPrototype$1,[TypeId$11]:{_A:n=>n},[NodeInspectSymbol](){return this.toJSON()},toString(){return format$2(this.toJSON())}},SomeProto=Object.assign(Object.create(CommonProto$1),{_tag:`Some`,_op:`Some`,[symbol](n){return isOption(n)&&isSome$1(n)&&equals$1(this.value,n.value)},[symbol$1](){return cached(this,combine$5(hash(this._tag))(hash(this.value)))},toJSON(){return{_id:`Option`,_tag:this._tag,value:toJSON(this.value)}}}),NoneHash=hash(`None`),NoneProto=Object.assign(Object.create(CommonProto$1),{_tag:`None`,_op:`None`,[symbol](n){return isOption(n)&&isNone$1(n)},[symbol$1](){return NoneHash},toJSON(){return{_id:`Option`,_tag:this._tag}}}),isOption=n=>hasProperty(n,TypeId$11),isNone$1=n=>n._tag===`None`,isSome$1=n=>n._tag===`Some`,none$5=Object.create(NoneProto),some$1=n=>{let c=Object.create(SomeProto);return c.value=n,c},TypeId$10=Symbol.for(`effect/Either`),CommonProto={...EffectPrototype$1,[TypeId$10]:{_R:n=>n},[NodeInspectSymbol](){return this.toJSON()},toString(){return format$2(this.toJSON())}},RightProto=Object.assign(Object.create(CommonProto),{_tag:`Right`,_op:`Right`,[symbol](n){return isEither(n)&&isRight$1(n)&&equals$1(this.right,n.right)},[symbol$1](){return combine$5(hash(this._tag))(hash(this.right))},toJSON(){return{_id:`Either`,_tag:this._tag,right:toJSON(this.right)}}}),LeftProto=Object.assign(Object.create(CommonProto),{_tag:`Left`,_op:`Left`,[symbol](n){return isEither(n)&&isLeft$1(n)&&equals$1(this.left,n.left)},[symbol$1](){return combine$5(hash(this._tag))(hash(this.left))},toJSON(){return{_id:`Either`,_tag:this._tag,left:toJSON(this.left)}}}),isEither=n=>hasProperty(n,TypeId$10),isLeft$1=n=>n._tag===`Left`,isRight$1=n=>n._tag===`Right`,left$1=n=>{let c=Object.create(LeftProto);return c.left=n,c},right$1=n=>{let c=Object.create(RightProto);return c.right=n,c},right=right$1,left=left$1,isLeft=isLeft$1,isRight=isRight$1,match$4=dual(2,(n,{onLeft:c,onRight:u})=>isLeft(n)?c(n.left):u(n.right)),merge$4=match$4({onLeft:identity$1,onRight:identity$1}),isNonEmptyArray$1=n=>n.length>0,make$25=n=>(c,u)=>c===u?0:n(c,u),number=make$25((n,c)=>n<c?-1:1),mapInput=dual(2,(n,c)=>make$25((u,p)=>n(c(u),c(p)))),greaterThan$1=n=>dual(2,(c,u)=>n(c,u)===1),none$4=()=>none$5,some=some$1,isNone=isNone$1,isSome=isSome$1,match$3=dual(2,(n,{onNone:c,onSome:u})=>isNone(n)?c():u(n.value)),getOrElse=dual(2,(n,c)=>isNone(n)?c():n.value),orElseSome=dual(2,(n,c)=>isNone(n)?some(c()):n),fromNullable=n=>n==null?none$4():some(n),getOrUndefined=getOrElse(constUndefined),map$4=dual(2,(n,c)=>isNone(n)?none$4():some(c(n.value))),flatMap$4=dual(2,(n,c)=>isNone(n)?none$4():c(n.value)),containsWith=n=>dual(2,(c,u)=>isNone(c)?!1:n(c.value,u)),_equivalence$3=equivalence(),contains=containsWith(_equivalence$3),make$24=(...n)=>n,allocate=n=>Array(n),makeBy=dual(2,(n,c)=>{let u=Math.max(1,Math.floor(n)),p=Array(u);for(let n=0;n<u;n++)p[n]=c(n);return p}),fromIterable$6=n=>Array.isArray(n)?n:Array.from(n),ensure=n=>Array.isArray(n)?n:[n],prepend$2=dual(2,(n,c)=>[c,...n]),append$2=dual(2,(n,c)=>[...n,c]),appendAll$2=dual(2,(n,c)=>fromIterable$6(n).concat(fromIterable$6(c))),isArray=Array.isArray,isEmptyArray=n=>n.length===0,isEmptyReadonlyArray=isEmptyArray,isNonEmptyArray=isNonEmptyArray$1,isNonEmptyReadonlyArray=isNonEmptyArray$1,isOutOfBounds=(n,c)=>n<0||n>=c.length,clamp$1=(n,c)=>Math.floor(Math.min(Math.max(0,n),c.length)),get$9=dual(2,(n,c)=>{let u=Math.floor(c);return isOutOfBounds(u,n)?none$4():some(n[u])}),unsafeGet$3=dual(2,(n,c)=>{let u=Math.floor(c);if(isOutOfBounds(u,n))throw Error(`Index ${u} out of bounds`);return n[u]}),head$1=get$9(0),headNonEmpty$1=unsafeGet$3(0),last=n=>isNonEmptyReadonlyArray(n)?some(lastNonEmpty(n)):none$4(),lastNonEmpty=n=>n[n.length-1],tailNonEmpty$1=n=>n.slice(1),spanIndex=(n,c)=>{let u=0;for(let p of n){if(!c(p,u))break;u++}return u},span=dual(2,(n,c)=>splitAt(n,spanIndex(n,c))),drop$1=dual(2,(n,c)=>{let u=fromIterable$6(n);return u.slice(clamp$1(c,u),u.length)}),reverse$2=n=>Array.from(n).reverse(),sort=dual(2,(n,c)=>{let u=Array.from(n);return u.sort(c),u}),zip$1=dual(2,(n,c)=>zipWith(n,c,make$24)),zipWith=dual(3,(n,c,u)=>{let p=fromIterable$6(n),h=fromIterable$6(c);if(isNonEmptyReadonlyArray(p)&&isNonEmptyReadonlyArray(h)){let n=[u(headNonEmpty$1(p),headNonEmpty$1(h))],c=Math.min(p.length,h.length);for(let x=1;x<c;x++)n[x]=u(p[x],h[x]);return n}return[]}),_equivalence$2=equivalence(),splitAt=dual(2,(n,c)=>{let u=Array.from(n),p=Math.floor(c);return isNonEmptyReadonlyArray(u)?p>=1?splitNonEmptyAt(u,p):[[],u]:[u,[]]}),splitNonEmptyAt=dual(2,(n,c)=>{let u=Math.max(1,Math.floor(c));return u>=n.length?[copy$2(n),[]]:[prepend$2(n.slice(1,u),headNonEmpty$1(n)),n.slice(u)]}),copy$2=n=>n.slice(),unionWith=dual(3,(n,c,u)=>{let p=fromIterable$6(n),h=fromIterable$6(c);return isNonEmptyReadonlyArray(p)?isNonEmptyReadonlyArray(h)?dedupeWith(u)(appendAll$2(p,h)):p:h}),union$2=dual(2,(n,c)=>unionWith(n,c,_equivalence$2)),empty$20=()=>[],of$2=n=>[n],map$3=dual(2,(n,c)=>n.map(c)),flatMap$3=dual(2,(n,c)=>{if(isEmptyReadonlyArray(n))return[];let u=[];for(let p=0;p<n.length;p++){let h=c(n[p],p);for(let n=0;n<h.length;n++)u.push(h[n])}return u}),flatten$3=flatMap$3(identity$1),filter$1=dual(2,(n,c)=>{let u=fromIterable$6(n),p=[];for(let n=0;n<u.length;n++)c(u[n],n)&&p.push(u[n]);return p}),reduce$6=dual(3,(n,c,u)=>fromIterable$6(n).reduce((n,c,p)=>u(n,c,p),c)),unfold=(n,c)=>{let u=[],p=n,h;for(;isSome(h=c(p));){let[n,c]=h.value;u.push(n),p=c}return u},getEquivalence$2=array$1,dedupeWith=dual(2,(n,c)=>{let u=fromIterable$6(n);if(isNonEmptyReadonlyArray(u)){let n=[headNonEmpty$1(u)],p=tailNonEmpty$1(u);for(let u of p)n.every(n=>!c(u,n))&&n.push(u);return n}return[]}),dedupe=n=>dedupeWith(n,equivalence()),join$3=dual(2,(n,c)=>fromIterable$6(n).join(c)),Order$1=number,escape$4=n=>n.replace(/[/\\^$*+?.()|[\]{}]/g,`\\$&`),TagTypeId=Symbol.for(`effect/Context/Tag`),ReferenceTypeId=Symbol.for(`effect/Context/Reference`),STMSymbolKey=`effect/STM`,STMTypeId=Symbol.for(STMSymbolKey),TagProto={...EffectPrototype$1,_op:`Tag`,[STMTypeId]:effectVariance,[TagTypeId]:{_Service:n=>n,_Identifier:n=>n},toString(){return format$2(this.toJSON())},toJSON(){return{_id:`Tag`,key:this.key,stack:this.stack}},[NodeInspectSymbol](){return this.toJSON()},of(n){return n},context(n){return make$23(this,n)}},ReferenceProto={...TagProto,[ReferenceTypeId]:ReferenceTypeId},makeGenericTag=n=>{let c=Error.stackTraceLimit;Error.stackTraceLimit=2;let u=Error();Error.stackTraceLimit=c;let p=Object.create(TagProto);return Object.defineProperty(p,`stack`,{get(){return u.stack}}),p.key=n,p},Reference$1=()=>(n,c)=>{let u=Error.stackTraceLimit;Error.stackTraceLimit=2;let p=Error();Error.stackTraceLimit=u;function h(){}return Object.setPrototypeOf(h,ReferenceProto),h.key=n,h.defaultValue=c.defaultValue,Object.defineProperty(h,`stack`,{get(){return p.stack}}),h},TypeId$9=Symbol.for(`effect/Context`),ContextProto={[TypeId$9]:{_Services:n=>n},[symbol](n){if(isContext(n)&&this.unsafeMap.size===n.unsafeMap.size){for(let c of this.unsafeMap.keys())if(!n.unsafeMap.has(c)||!equals$1(this.unsafeMap.get(c),n.unsafeMap.get(c)))return!1;return!0}return!1},[symbol$1](){return cached(this,number$1(this.unsafeMap.size))},pipe(){return pipeArguments(this,arguments)},toString(){return format$2(this.toJSON())},toJSON(){return{_id:`Context`,services:Array.from(this.unsafeMap).map(toJSON)}},[NodeInspectSymbol](){return this.toJSON()}},makeContext=n=>{let c=Object.create(ContextProto);return c.unsafeMap=n,c},serviceNotFoundError=n=>{let c=Error(`Service not found${n.key?`: ${String(n.key)}`:``}`);if(n.stack){let u=n.stack.split(`
|
|
5
5
|
`);if(u.length>2){let n=u[2].match(/at (.*)/);n&&(c.message+=` (defined at ${n[1]})`)}}if(c.stack){let n=c.stack.split(`
|
|
6
6
|
`);n.splice(1,3),c.stack=n.join(`
|
|
@@ -496,6 +496,6 @@ To resolve the conflict:`,(0,p.getConflictResolutionRecipe)(h,n))),x=w):u.diag.w
|
|
|
496
496
|
To resolve the conflict:`,(0,p.getConflictResolutionRecipe)(h,n))),x=w):u.diag.warn(`A view or instrument with the name `,n.name,` has already been registered and is incompatible with another registered view.
|
|
497
497
|
`,`Details:
|
|
498
498
|
`,(0,p.getIncompatibilityDetails)(h,n),`To resolve the conflict:
|
|
499
|
-
`,(0,p.getConflictResolutionRecipe)(h,n))}return x}}})),require_MultiWritableMetricStorage=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiMetricStorage=void 0,n.MultiMetricStorage=class{_backingStorages;constructor(n){this._backingStorages=n}record(n,c,u,p){this._backingStorages.forEach(h=>{h.record(n,c,u,p)})}}})),require_ObservableResult=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchObservableResultImpl=n.ObservableResultImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_HashMap(),p=require_Instruments();n.ObservableResultImpl=class{_buffer=new u.AttributeHashMap;_instrumentName;_valueType;constructor(n,c){this._instrumentName=n,this._valueType=c}observe(n,u={}){if(typeof n!=`number`){c.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${n}`);return}this._valueType===c.ValueType.INT&&!Number.isInteger(n)&&(c.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),n=Math.trunc(n),!Number.isInteger(n))||this._buffer.set(u,n)}},n.BatchObservableResultImpl=class{_buffer=new Map;observe(n,h,x={}){if(!(0,p.isObservableInstrument)(n))return;let w=this._buffer.get(n);if(w??(w=new u.AttributeHashMap,this._buffer.set(n,w)),typeof h!=`number`){c.diag.warn(`non-number value provided to metric ${n._descriptor.name}: ${h}`);return}n._descriptor.valueType===c.ValueType.INT&&!Number.isInteger(h)&&(c.diag.warn(`INT value type cannot accept a floating-point value for ${n._descriptor.name}, ignoring the fractional digits.`),h=Math.trunc(h),!Number.isInteger(h))||w.set(x,h)}}})),require_ObservableRegistry=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ObservableRegistry=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Instruments(),p=require_ObservableResult(),h=require_utils$3();n.ObservableRegistry=class{_callbacks=[];_batchCallbacks=[];addCallback(n,c){this._findCallback(n,c)>=0||this._callbacks.push({callback:n,instrument:c})}removeCallback(n,c){let u=this._findCallback(n,c);u<0||this._callbacks.splice(u,1)}addBatchCallback(n,p){let h=new Set(p.filter(u.isObservableInstrument));if(h.size===0){c.diag.error(`BatchObservableCallback is not associated with valid instruments`,p);return}this._findBatchCallback(n,h)>=0||this._batchCallbacks.push({callback:n,instruments:h})}removeBatchCallback(n,c){let p=new Set(c.filter(u.isObservableInstrument)),h=this._findBatchCallback(n,p);h<0||this._batchCallbacks.splice(h,1)}async observe(n,c){let u=this._observeCallbacks(n,c),p=this._observeBatchCallbacks(n,c);return(await Promise.allSettled([...u,...p])).filter(n=>n.status===`rejected`).map(n=>n.reason)}_observeCallbacks(n,c){return this._callbacks.map(async({callback:u,instrument:x})=>{let w=new p.ObservableResultImpl(x._descriptor.name,x._descriptor.valueType),T=Promise.resolve(u(w));c!=null&&(T=(0,h.callWithTimeout)(T,c)),await T,x._metricStorages.forEach(c=>{c.record(w._buffer,n)})})}_observeBatchCallbacks(n,c){return this._batchCallbacks.map(async({callback:u,instruments:x})=>{let w=new p.BatchObservableResultImpl,T=Promise.resolve(u(w));c!=null&&(T=(0,h.callWithTimeout)(T,c)),await T,x.forEach(c=>{let u=w._buffer.get(c);u!=null&&c._metricStorages.forEach(c=>{c.record(u,n)})})})}_findCallback(n,c){return this._callbacks.findIndex(u=>u.callback===n&&u.instrument===c)}_findBatchCallback(n,c){return this._batchCallbacks.findIndex(u=>u.callback===n&&(0,h.setEquals)(u.instruments,c))}}})),require_SyncMetricStorage=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SyncMetricStorage=void 0;let c=require_MetricStorage(),u=require_DeltaMetricProcessor(),p=require_TemporalMetricProcessor();n.SyncMetricStorage=class extends c.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(n,c,h,x,w){super(n),this._aggregationCardinalityLimit=w,this._deltaMetricStorage=new u.DeltaMetricProcessor(c,this._aggregationCardinalityLimit),this._temporalMetricStorage=new p.TemporalMetricProcessor(c,x),this._attributesProcessor=h}record(n,c,u,p){c=this._attributesProcessor.process(c,u),this._deltaMetricStorage.record(n,c,u,p)}collect(n,c){let u=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(n,this._instrumentDescriptor,u,c)}}})),require_AttributesProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.createDenyListAttributesProcessor=n.createAllowListAttributesProcessor=n.createMultiAttributesProcessor=n.createNoopAttributesProcessor=void 0;var c=class{process(n,c){return n}},u=class{_processors;constructor(n){this._processors=n}process(n,c){let u=n;for(let n of this._processors)u=n.process(u,c);return u}},p=class{_allowedAttributeNames;constructor(n){this._allowedAttributeNames=n}process(n,c){let u={};return Object.keys(n).forEach(c=>{this._allowedAttributeNames.includes(c)&&(u[c]=n[c])}),u}},h=class{_deniedAttributeNames;constructor(n){this._deniedAttributeNames=n}process(n,c){let u={};return Object.keys(n).forEach(c=>{this._deniedAttributeNames.includes(c)||(u[c]=n[c])}),u}};function x(){return A}n.createNoopAttributesProcessor=x;function w(n){return new u(n)}n.createMultiAttributesProcessor=w;function T(n){return new p(n)}n.createAllowListAttributesProcessor=T;function O(n){return new h(n)}n.createDenyListAttributesProcessor=O;let A=new c})),require_MeterSharedState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterSharedState=void 0;let c=require_InstrumentDescriptor(),u=require_Meter(),p=require_AsyncMetricStorage(),h=require_MetricStorageRegistry(),x=require_MultiWritableMetricStorage(),w=require_ObservableRegistry(),T=require_SyncMetricStorage(),O=require_AttributesProcessor();n.MeterSharedState=class{metricStorageRegistry=new h.MetricStorageRegistry;observableRegistry=new w.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(n,c){this.meter=new u.Meter(this),this._meterProviderSharedState=n,this._instrumentationScope=c}registerMetricStorage(n){let c=this._registerMetricStorage(n,T.SyncMetricStorage);return c.length===1?c[0]:new x.MultiMetricStorage(c)}registerAsyncMetricStorage(n){return this._registerMetricStorage(n,p.AsyncMetricStorage)}async collect(n,c,u){let p=await this.observableRegistry.observe(c,u?.timeoutMillis),h=this.metricStorageRegistry.getStorages(n);if(h.length===0)return null;let x=[];return h.forEach(u=>{let p=u.collect(n,c);p!=null&&x.push(p)}),x.length===0?{errors:p}:{scopeMetrics:{scope:this._instrumentationScope,metrics:x},errors:p}}_registerMetricStorage(n,u){let p=this._meterProviderSharedState.viewRegistry.findViews(n,this._instrumentationScope).map(p=>{let h=(0,c.createInstrumentDescriptorWithView)(p,n),x=this.metricStorageRegistry.findOrUpdateCompatibleStorage(h);if(x!=null)return x;let w=new u(h,p.aggregation.createAggregator(h),p.attributesProcessor,this._meterProviderSharedState.metricCollectors,p.aggregationCardinalityLimit);return this.metricStorageRegistry.register(w),w});if(p.length===0){let c=this._meterProviderSharedState.selectAggregations(n.type).map(([c,p])=>{let h=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(c,n);if(h!=null)return h;let x=p.createAggregator(n),w=c.selectCardinalityLimit(n.type),T=new u(n,x,(0,O.createNoopAttributesProcessor)(),[c],w);return this.metricStorageRegistry.registerForCollector(c,T),T});p=p.concat(c)}return p}}})),require_MeterProviderSharedState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterProviderSharedState=void 0;let c=require_utils$3(),u=require_ViewRegistry(),p=require_MeterSharedState(),h=require_AggregationOption();n.MeterProviderSharedState=class{viewRegistry=new u.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(n){this.resource=n}getMeterSharedState(n){let u=(0,c.instrumentationScopeId)(n),h=this.meterSharedStates.get(u);return h??(h=new p.MeterSharedState(this,n),this.meterSharedStates.set(u,h)),h}selectAggregations(n){let c=[];for(let u of this.metricCollectors)c.push([u,(0,h.toAggregation)(u.selectAggregation(n))]);return c}}})),require_MetricCollector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MetricCollector=void 0;let c=require_src$18();n.MetricCollector=class{_sharedState;_metricReader;constructor(n,c){this._sharedState=n,this._metricReader=c}async collect(n){let u=(0,c.millisToHrTime)(Date.now()),p=[],h=[],x=Array.from(this._sharedState.meterSharedStates.values()).map(async c=>{let x=await c.collect(this,u,n);x?.scopeMetrics!=null&&p.push(x.scopeMetrics),x?.errors!=null&&h.push(...x.errors)});return await Promise.all(x),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:p},errors:h}}async forceFlush(n){await this._metricReader.forceFlush(n)}async shutdown(n){await this._metricReader.shutdown(n)}selectAggregationTemporality(n){return this._metricReader.selectAggregationTemporality(n)}selectAggregation(n){return this._metricReader.selectAggregation(n)}selectCardinalityLimit(n){return this._metricReader.selectCardinalityLimit?.(n)??2e3}}})),require_Predicate=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExactPredicate=n.PatternPredicate=void 0;let c=/[\^$\\.+?()[\]{}|]/g;n.PatternPredicate=class n{_matchAll;_regexp;constructor(c){c===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(n.escapePattern(c)))}match(n){return this._matchAll?!0:this._regexp.test(n)}static escapePattern(n){return`^${n.replace(c,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(n){return n.includes(`*`)}},n.ExactPredicate=class{_matchAll;_pattern;constructor(n){this._matchAll=n===void 0,this._pattern=n}match(n){return!!(this._matchAll||n===this._pattern)}}})),require_InstrumentSelector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InstrumentSelector=void 0;let c=require_Predicate();n.InstrumentSelector=class{_nameFilter;_type;_unitFilter;constructor(n){this._nameFilter=new c.PatternPredicate(n?.name??`*`),this._type=n?.type,this._unitFilter=new c.ExactPredicate(n?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}})),require_MeterSelector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterSelector=void 0;let c=require_Predicate();n.MeterSelector=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(n){this._nameFilter=new c.ExactPredicate(n?.name),this._versionFilter=new c.ExactPredicate(n?.version),this._schemaUrlFilter=new c.ExactPredicate(n?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}})),require_View=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.View=void 0;let c=require_Predicate(),u=require_AttributesProcessor(),p=require_InstrumentSelector(),h=require_MeterSelector(),x=require_AggregationOption();function w(n){return n.instrumentName==null&&n.instrumentType==null&&n.instrumentUnit==null&&n.meterName==null&&n.meterVersion==null&&n.meterSchemaUrl==null}function T(n){if(w(n))throw Error(`Cannot create view with no selector arguments supplied`);if(n.name!=null&&(n?.instrumentName==null||c.PatternPredicate.hasWildcard(n.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}n.View=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(n){T(n),n.attributesProcessors==null?this.attributesProcessor=(0,u.createNoopAttributesProcessor)():this.attributesProcessor=(0,u.createMultiAttributesProcessor)(n.attributesProcessors),this.name=n.name,this.description=n.description,this.aggregation=(0,x.toAggregation)(n.aggregation??{type:x.AggregationType.DEFAULT}),this.instrumentSelector=new p.InstrumentSelector({name:n.instrumentName,type:n.instrumentType,unit:n.instrumentUnit}),this.meterSelector=new h.MeterSelector({name:n.meterName,version:n.meterVersion,schemaUrl:n.meterSchemaUrl}),this.aggregationCardinalityLimit=n.aggregationCardinalityLimit}}})),require_MeterProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterProvider=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$17(),p=require_MeterProviderSharedState(),h=require_MetricCollector(),x=require_View();n.MeterProvider=class{_sharedState;_shutdown=!1;constructor(n){if(this._sharedState=new p.MeterProviderSharedState(n?.resource??(0,u.defaultResource)()),n?.views!=null&&n.views.length>0)for(let c of n.views)this._sharedState.viewRegistry.addView(new x.View(c));if(n?.readers!=null&&n.readers.length>0)for(let c of n.readers){let n=new h.MetricCollector(this._sharedState,c);c.setMetricProducer(n),this._sharedState.metricCollectors.push(n)}}getMeter(n,u=``,p={}){return this._shutdown?(c.diag.warn(`A shutdown MeterProvider cannot provide a Meter`),(0,c.createNoopMeter)()):this._sharedState.getMeterSharedState({name:n,version:u,schemaUrl:p.schemaUrl}).meter}async shutdown(n){if(this._shutdown){c.diag.warn(`shutdown may only be called once per MeterProvider`);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(c=>c.shutdown(n)))}async forceFlush(n){if(this._shutdown){c.diag.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}await Promise.all(this._sharedState.metricCollectors.map(c=>c.forceFlush(n)))}}})),require_src$5=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TimeoutError=n.createDenyListAttributesProcessor=n.createAllowListAttributesProcessor=n.AggregationType=n.MeterProvider=n.ConsoleMetricExporter=n.InMemoryMetricExporter=n.PeriodicExportingMetricReader=n.MetricReader=n.InstrumentType=n.DataPointType=n.AggregationTemporality=void 0;var c=require_AggregationTemporality();Object.defineProperty(n,`AggregationTemporality`,{enumerable:!0,get:function(){return c.AggregationTemporality}});var u=require_MetricData();Object.defineProperty(n,`DataPointType`,{enumerable:!0,get:function(){return u.DataPointType}}),Object.defineProperty(n,`InstrumentType`,{enumerable:!0,get:function(){return u.InstrumentType}});var p=require_MetricReader();Object.defineProperty(n,`MetricReader`,{enumerable:!0,get:function(){return p.MetricReader}});var h=require_PeriodicExportingMetricReader();Object.defineProperty(n,`PeriodicExportingMetricReader`,{enumerable:!0,get:function(){return h.PeriodicExportingMetricReader}});var x=require_InMemoryMetricExporter();Object.defineProperty(n,`InMemoryMetricExporter`,{enumerable:!0,get:function(){return x.InMemoryMetricExporter}});var w=require_ConsoleMetricExporter();Object.defineProperty(n,`ConsoleMetricExporter`,{enumerable:!0,get:function(){return w.ConsoleMetricExporter}});var T=require_MeterProvider();Object.defineProperty(n,`MeterProvider`,{enumerable:!0,get:function(){return T.MeterProvider}});var O=require_AggregationOption();Object.defineProperty(n,`AggregationType`,{enumerable:!0,get:function(){return O.AggregationType}});var A=require_AttributesProcessor();Object.defineProperty(n,`createAllowListAttributesProcessor`,{enumerable:!0,get:function(){return A.createAllowListAttributesProcessor}}),Object.defineProperty(n,`createDenyListAttributesProcessor`,{enumerable:!0,get:function(){return A.createDenyListAttributesProcessor}});var j=require_utils$3();Object.defineProperty(n,`TimeoutError`,{enumerable:!0,get:function(){return j.TimeoutError}})})),require_enums$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExceptionEventName=void 0,n.ExceptionEventName=`exception`})),require_Span$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SpanImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_enums$1();n.SpanImpl=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(n){let c=Date.now();if(this._spanContext=n.spanContext,this._performanceStartTime=u.otperformance.now(),this._performanceOffset=c-(this._performanceStartTime+u.otperformance.timeOrigin),this._startTimeProvided=n.startTime!=null,this._spanLimits=n.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=n.spanProcessor,this.name=n.name,this.parentSpanContext=n.parentSpanContext,this.kind=n.kind,n.links)for(let c of n.links)this.addLink(c);this.startTime=this._getTime(n.startTime??c),this.resource=n.resource,this.instrumentationScope=n.scope,this._recordEndMetrics=n.recordEndMetrics,n.attributes!=null&&this.setAttributes(n.attributes),this._spanProcessor.onStart(this,n.context)}spanContext(){return this._spanContext}setAttribute(n,p){if(p==null||this._isSpanEnded())return this;if(n.length===0)return c.diag.warn(`Invalid attribute key: ${n}`),this;if(!(0,u.isAttributeValue)(p))return c.diag.warn(`Invalid attribute value set for key: ${n}`),this;let{attributeCountLimit:h}=this._spanLimits,x=!Object.prototype.hasOwnProperty.call(this.attributes,n);return h!==void 0&&this._attributesCount>=h&&x?(this._droppedAttributesCount++,this):(this.attributes[n]=this._truncateToSize(p),x&&this._attributesCount++,this)}setAttributes(n){for(let c in n)Object.prototype.hasOwnProperty.call(n,c)&&this.setAttribute(c,n[c]);return this}addEvent(n,p,h){if(this._isSpanEnded())return this;let{eventCountLimit:x}=this._spanLimits;if(x===0)return c.diag.warn(`No events allowed.`),this._droppedEventsCount++,this;x!==void 0&&this.events.length>=x&&(this._droppedEventsCount===0&&c.diag.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),(0,u.isTimeInput)(p)&&((0,u.isTimeInput)(h)||(h=p),p=void 0);let w=(0,u.sanitizeAttributes)(p),{attributePerEventCountLimit:T}=this._spanLimits,O={},A=0,j=0;for(let n in w){if(!Object.prototype.hasOwnProperty.call(w,n))continue;let c=w[n];if(T!==void 0&&j>=T){A++;continue}O[n]=this._truncateToSize(c),j++}return this.events.push({name:n,attributes:O,time:this._getTime(h),droppedAttributesCount:A}),this}addLink(n){if(this._isSpanEnded())return this;let{linkCountLimit:p}=this._spanLimits;if(p===0)return this._droppedLinksCount++,this;p!==void 0&&this.links.length>=p&&(this._droppedLinksCount===0&&c.diag.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:h}=this._spanLimits,x=(0,u.sanitizeAttributes)(n.attributes),w={},T=0,O=0;for(let n in x){if(!Object.prototype.hasOwnProperty.call(x,n))continue;let c=x[n];if(h!==void 0&&O>=h){T++;continue}w[n]=this._truncateToSize(c),O++}let A={context:n.context};return O>0&&(A.attributes=w),T>0&&(A.droppedAttributesCount=T),this.links.push(A),this}addLinks(n){for(let c of n)this.addLink(c);return this}setStatus(n){if(this._isSpanEnded()||n.code===c.SpanStatusCode.UNSET||this.status.code===c.SpanStatusCode.OK)return this;let u={code:n.code};return n.code===c.SpanStatusCode.ERROR&&(typeof n.message==`string`?u.message=n.message:n.message!=null&&c.diag.warn(`Dropping invalid status.message of type '${typeof n.message}', expected 'string'`)),this.status=u,this}updateName(n){return this._isSpanEnded()||(this.name=n),this}end(n){if(this._isSpanEnded()){c.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(n),this._duration=(0,u.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(c.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&&c.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(n){if(typeof n==`number`&&n<=u.otperformance.now())return(0,u.hrTime)(n+this._performanceOffset);if(typeof n==`number`)return(0,u.millisToHrTime)(n);if(n instanceof Date)return(0,u.millisToHrTime)(n.getTime());if((0,u.isTimeInputHrTime)(n))return n;if(this._startTimeProvided)return(0,u.millisToHrTime)(Date.now());let c=u.otperformance.now()-this._performanceStartTime;return(0,u.addHrTimes)(this.startTime,(0,u.millisToHrTime)(c))}isRecording(){return this._ended===!1}recordException(n,u){let x={};typeof n==`string`?x[p.ATTR_EXCEPTION_MESSAGE]=n:n&&(n.code?x[p.ATTR_EXCEPTION_TYPE]=n.code.toString():n.name&&(x[p.ATTR_EXCEPTION_TYPE]=n.name),n.message&&(x[p.ATTR_EXCEPTION_MESSAGE]=n.message),n.stack&&(x[p.ATTR_EXCEPTION_STACKTRACE]=n.stack)),x[p.ATTR_EXCEPTION_TYPE]||x[p.ATTR_EXCEPTION_MESSAGE]?this.addEvent(h.ExceptionEventName,x,u):c.diag.warn(`Failed to record an exception ${n}`)}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(){if(this._ended){let n=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,n)}return this._ended}_truncateToLimitUtil(n,c){return n.length<=c?n:n.substring(0,c)}_truncateToSize(n){let u=this._attributeValueLengthLimit;return u<=0?(c.diag.warn(`Attribute value limit must be positive, got ${u}`),n):typeof n==`string`?this._truncateToLimitUtil(n,u):Array.isArray(n)?n.map(n=>typeof n==`string`?this._truncateToLimitUtil(n,u):n):n}}})),require_Sampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=void 0,(function(n){n[n.NOT_RECORD=0]=`NOT_RECORD`,n[n.RECORD=1]=`RECORD`,n[n.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(n.SamplingDecision||={})})),require_AlwaysOffSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOffSampler=void 0;let c=require_Sampler$1();n.AlwaysOffSampler=class{shouldSample(){return{decision:c.SamplingDecision.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),require_AlwaysOnSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOnSampler=void 0;let c=require_Sampler$1();n.AlwaysOnSampler=class{shouldSample(){return{decision:c.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),require_ParentBasedSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ParentBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_AlwaysOffSampler$1(),h=require_AlwaysOnSampler$1();n.ParentBasedSampler=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(n){this._root=n.root,this._root||=((0,u.globalErrorHandler)(Error(`ParentBasedSampler must have a root sampler configured`)),new h.AlwaysOnSampler),this._remoteParentSampled=n.remoteParentSampled??new h.AlwaysOnSampler,this._remoteParentNotSampled=n.remoteParentNotSampled??new p.AlwaysOffSampler,this._localParentSampled=n.localParentSampled??new h.AlwaysOnSampler,this._localParentNotSampled=n.localParentNotSampled??new p.AlwaysOffSampler}shouldSample(n,u,p,h,x,w){let T=c.trace.getSpanContext(n);return!T||!(0,c.isSpanContextValid)(T)?this._root.shouldSample(n,u,p,h,x,w):T.isRemote?T.traceFlags&c.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(n,u,p,h,x,w):this._remoteParentNotSampled.shouldSample(n,u,p,h,x,w):T.traceFlags&c.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(n,u,p,h,x,w):this._localParentNotSampled.shouldSample(n,u,p,h,x,w)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),require_TraceIdRatioBasedSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Sampler$1();n.TraceIdRatioBasedSampler=class{_ratio;_upperBound;constructor(n=0){this._ratio=this._normalize(n),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(n,p){return{decision:(0,c.isValidTraceId)(p)&&this._accumulate(p)<this._upperBound?u.SamplingDecision.RECORD_AND_SAMPLED:u.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(n){return typeof n!=`number`||isNaN(n)?0:n>=1?1:n<=0?0:n}_accumulate(n){let c=0;for(let u=0;u<n.length/8;u++){let p=u*8,h=parseInt(n.slice(p,p+8),16);c=(c^h)>>>0}return c}}})),require_config$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.buildSamplerFromEnv=n.loadDefaultConfig=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_AlwaysOffSampler$1(),h=require_AlwaysOnSampler$1(),x=require_ParentBasedSampler$1(),w=require_TraceIdRatioBasedSampler$1();var T;(function(n){n.AlwaysOff=`always_off`,n.AlwaysOn=`always_on`,n.ParentBasedAlwaysOff=`parentbased_always_off`,n.ParentBasedAlwaysOn=`parentbased_always_on`,n.ParentBasedTraceIdRatio=`parentbased_traceidratio`,n.TraceIdRatio=`traceidratio`})(T||={});let O=1;function A(){return{sampler:j(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}n.loadDefaultConfig=A;function j(){let n=(0,u.getStringFromEnv)(`OTEL_TRACES_SAMPLER`)??T.ParentBasedAlwaysOn;switch(n){case T.AlwaysOn:return new h.AlwaysOnSampler;case T.AlwaysOff:return new p.AlwaysOffSampler;case T.ParentBasedAlwaysOn:return new x.ParentBasedSampler({root:new h.AlwaysOnSampler});case T.ParentBasedAlwaysOff:return new x.ParentBasedSampler({root:new p.AlwaysOffSampler});case T.TraceIdRatio:return new w.TraceIdRatioBasedSampler(N());case T.ParentBasedTraceIdRatio:return new x.ParentBasedSampler({root:new w.TraceIdRatioBasedSampler(N())});default:return c.diag.error(`OTEL_TRACES_SAMPLER value "${n}" invalid, defaulting to "${T.ParentBasedAlwaysOn}".`),new x.ParentBasedSampler({root:new h.AlwaysOnSampler})}}n.buildSamplerFromEnv=j;function N(){let n=(0,u.getNumberFromEnv)(`OTEL_TRACES_SAMPLER_ARG`);return n==null?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1):n<0||n>1?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG=${n} was given, but it is out of range ([0..1]), defaulting to 1.`),1):n}})),require_utility$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.reconfigureLimits=n.mergeConfig=n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;let c=require_config$1(),u=require_src$18();n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128,n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function p(n){let u={sampler:(0,c.buildSamplerFromEnv)()},p=(0,c.loadDefaultConfig)(),h=Object.assign({},p,u,n);return h.generalLimits=Object.assign({},p.generalLimits,n.generalLimits||{}),h.spanLimits=Object.assign({},p.spanLimits,n.spanLimits||{}),h}n.mergeConfig=p;function h(c){let p=Object.assign({},c.spanLimits);return p.attributeCountLimit=c.spanLimits?.attributeCountLimit??c.generalLimits?.attributeCountLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??n.DEFAULT_ATTRIBUTE_COUNT_LIMIT,p.attributeValueLengthLimit=c.spanLimits?.attributeValueLengthLimit??c.generalLimits?.attributeValueLengthLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},c,{spanLimits:p})}n.reconfigureLimits=h})),require_BatchSpanProcessorBase$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessorBase=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18();n.BatchSpanProcessorBase=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(n,p){this._exporter=n,this._maxExportBatchSize=typeof p?.maxExportBatchSize==`number`?p.maxExportBatchSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`)??512,this._maxQueueSize=typeof p?.maxQueueSize==`number`?p.maxQueueSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_QUEUE_SIZE`)??2048,this._scheduledDelayMillis=typeof p?.scheduledDelayMillis==`number`?p.scheduledDelayMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_SCHEDULE_DELAY`)??5e3,this._exportTimeoutMillis=typeof p?.exportTimeoutMillis==`number`?p.exportTimeoutMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_EXPORT_TIMEOUT`)??3e4,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.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(n,c){}onEnd(n){this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)!==0&&this._addToBuffer(n)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(n){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&c.diag.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(c.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(n),this._maybeStartTimer()}_flushAll(){return new Promise((n,c)=>{let u=[],p=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,c=p;n<c;n++)u.push(this._flushOneBatch());Promise.all(u).then(()=>{n()}).catch(c)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((n,p)=>{let h=setTimeout(()=>{p(Error(`Timeout`))},this._exportTimeoutMillis);c.context.with((0,u.suppressTracing)(c.context.active()),()=>{let c;this._finishedSpans.length<=this._maxExportBatchSize?(c=this._finishedSpans,this._finishedSpans=[]):c=this._finishedSpans.splice(0,this._maxExportBatchSize);let x=()=>this._exporter.export(c,c=>{clearTimeout(h),c.code===u.ExportResultCode.SUCCESS?n():p(c.error??Error(`BatchSpanProcessor: span export failed`))}),w=null;for(let n=0,u=c.length;n<u;n++){let u=c[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(w??=[],w.push(u.resource.waitForAsyncAttributes()))}w===null?x():Promise.all(w).then(x,n=>{(0,u.globalErrorHandler)(n),p(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let n=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,u.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return n();this._timer===void 0&&(this._timer=setTimeout(()=>n(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),require_BatchSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessor=void 0;let c=require_BatchSpanProcessorBase$1();n.BatchSpanProcessor=class extends c.BatchSpanProcessorBase{onShutdown(){}}})),require_RandomIdGenerator$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=void 0;let c=8,u=16;n.RandomIdGenerator=class{generateTraceId=h(16);generateSpanId=h(8)};let p=Buffer.allocUnsafe(16);function h(n){return function(){for(let c=0;c<n/4;c++)p.writeUInt32BE(Math.random()*2**32>>>0,c*4);for(let c=0;c<n&&!(p[c]>0);c++)c===n-1&&(p[n-1]=1);return p.toString(`hex`,0,n)}}})),require_node$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_BatchSpanProcessor$1();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}});var u=require_RandomIdGenerator$1();Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}})})),require_platform$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_node$3();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return c.RandomIdGenerator}})})),require_semconv$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.METRIC_OTEL_SDK_SPAN_STARTED=n.METRIC_OTEL_SDK_SPAN_LIVE=n.ATTR_OTEL_SPAN_SAMPLING_RESULT=n.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0,n.ATTR_OTEL_SPAN_PARENT_ORIGIN=`otel.span.parent.origin`,n.ATTR_OTEL_SPAN_SAMPLING_RESULT=`otel.span.sampling_result`,n.METRIC_OTEL_SDK_SPAN_LIVE=`otel.sdk.span.live`,n.METRIC_OTEL_SDK_SPAN_STARTED=`otel.sdk.span.started`})),require_TracerMetrics$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TracerMetrics=void 0;let c=require_Sampler$1(),u=require_semconv$3();n.TracerMetrics=class{startedSpans;liveSpans;constructor(n){this.startedSpans=n.createCounter(u.METRIC_OTEL_SDK_SPAN_STARTED,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=n.createUpDownCounter(u.METRIC_OTEL_SDK_SPAN_LIVE,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(n,x){let w=h(x);if(this.startedSpans.add(1,{[u.ATTR_OTEL_SPAN_PARENT_ORIGIN]:p(n),[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w}),x===c.SamplingDecision.NOT_RECORD)return()=>{};let T={[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w};return this.liveSpans.add(1,T),()=>{this.liveSpans.add(-1,T)}}};function p(n){return n?n.isRemote?`remote`:`local`:`none`}function h(n){switch(n){case c.SamplingDecision.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case c.SamplingDecision.RECORD:return`RECORD_ONLY`;case c.SamplingDecision.NOT_RECORD:return`DROP`}}})),require_version$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_Tracer$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Tracer=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_Span$1(),h=require_utility$1(),x=require_platform$3(),w=require_TracerMetrics$1(),T=require_version$2();n.Tracer=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(n,u,p,O){let A=(0,h.mergeConfig)(u);this._sampler=A.sampler,this._generalLimits=A.generalLimits,this._spanLimits=A.spanLimits,this._idGenerator=u.idGenerator||new x.RandomIdGenerator,this._resource=p,this._spanProcessor=O,this.instrumentationScope=n;let j=A.meterProvider?A.meterProvider.getMeter(`@opentelemetry/sdk-trace`,T.VERSION):c.createNoopMeter();this._tracerMetrics=new w.TracerMetrics(j)}startSpan(n,h={},x=c.context.active()){h.root&&(x=c.trace.deleteSpan(x));let w=c.trace.getSpan(x);if((0,u.isTracingSuppressed)(x))return c.diag.debug(`Instrumentation suppressed, returning Noop Span`),c.trace.wrapSpanContext(c.INVALID_SPAN_CONTEXT);let T=w?.spanContext(),O=this._idGenerator.generateSpanId(),A,j,N;!T||!c.trace.isSpanContextValid(T)?j=this._idGenerator.generateTraceId():(j=T.traceId,N=T.traceState,A=T);let I=h.kind??c.SpanKind.INTERNAL,L=(h.links??[]).map(n=>({context:n.context,attributes:(0,u.sanitizeAttributes)(n.attributes)})),z=(0,u.sanitizeAttributes)(h.attributes),B=this._sampler.shouldSample(x,j,n,I,z,L),V=this._tracerMetrics.startSpan(T,B.decision);N=B.traceState??N;let H=B.decision===c.SamplingDecision.RECORD_AND_SAMPLED?c.TraceFlags.SAMPLED:c.TraceFlags.NONE,U={traceId:j,spanId:O,traceFlags:H,traceState:N};if(B.decision===c.SamplingDecision.NOT_RECORD)return c.diag.debug(`Recording is off, propagating context in a non-recording span`),c.trace.wrapSpanContext(U);let W=(0,u.sanitizeAttributes)(Object.assign(z,B.attributes));return new p.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:x,spanContext:U,name:n,kind:I,links:L,parentSpanContext:A,attributes:W,startTime:h.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:V})}startActiveSpan(n,u,p,h){let x,w,T;if(arguments.length<2)return;arguments.length===2?T=u:arguments.length===3?(x=u,T=p):(x=u,w=p,T=h);let O=w??c.context.active(),A=this.startSpan(n,x,O),j=c.trace.setSpan(O,A);return c.context.with(j,T,void 0,A)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),require_MultiSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiSpanProcessor=void 0;let c=require_src$18();n.MultiSpanProcessor=class{_spanProcessors;constructor(n){this._spanProcessors=n}forceFlush(){let n=[];for(let c of this._spanProcessors)n.push(c.forceFlush());return new Promise(u=>{Promise.all(n).then(()=>{u()}).catch(n=>{(0,c.globalErrorHandler)(n||Error(`MultiSpanProcessor: forceFlush failed`)),u()})})}onStart(n,c){for(let u of this._spanProcessors)u.onStart(n,c)}onEnding(n){for(let c of this._spanProcessors)c.onEnding&&c.onEnding(n)}onEnd(n){for(let c of this._spanProcessors)c.onEnd(n)}shutdown(){let n=[];for(let c of this._spanProcessors)n.push(c.shutdown());return new Promise((c,u)=>{Promise.all(n).then(()=>{c()},u)})}}})),require_BasicTracerProvider$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BasicTracerProvider=n.ForceFlushState=void 0;let c=require_src$18(),u=require_src$17(),p=require_Tracer$1(),h=require_config$1(),x=require_MultiSpanProcessor$1(),w=require_utility$1();var T;(function(n){n[n.resolved=0]=`resolved`,n[n.timeout=1]=`timeout`,n[n.error=2]=`error`,n[n.unresolved=3]=`unresolved`})(T=n.ForceFlushState||={}),n.BasicTracerProvider=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(n={}){let p=(0,c.merge)({},(0,h.loadDefaultConfig)(),(0,w.reconfigureLimits)(n));this._resource=p.resource??(0,u.defaultResource)(),this._config=Object.assign({},p,{resource:this._resource});let T=[];n.spanProcessors?.length&&T.push(...n.spanProcessors),this._activeSpanProcessor=new x.MultiSpanProcessor(T)}getTracer(n,c,u){let h=`${n}@${c||``}:${u?.schemaUrl||``}`;return this._tracers.has(h)||this._tracers.set(h,new p.Tracer({name:n,version:c,schemaUrl:u?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(h)}forceFlush(){let n=this._config.forceFlushTimeoutMillis,c=this._activeSpanProcessor._spanProcessors.map(c=>new Promise(u=>{let p,h=setTimeout(()=>{u(Error(`Span processor did not completed within timeout period of ${n} ms`)),p=T.timeout},n);c.forceFlush().then(()=>{clearTimeout(h),p!==T.timeout&&(p=T.resolved,u(p))}).catch(n=>{clearTimeout(h),p=T.error,u(n)})}));return new Promise((n,u)=>{Promise.all(c).then(c=>{let p=c.filter(n=>n!==T.resolved);p.length>0?u(p):n()}).catch(n=>u([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),require_ConsoleSpanExporter$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ConsoleSpanExporter=void 0;let c=require_src$18();n.ConsoleSpanExporter=class{export(n,c){return this._sendSpans(n,c)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(n){return{resource:{attributes:n.resource.attributes},instrumentationScope:n.instrumentationScope,traceId:n.spanContext().traceId,parentSpanContext:n.parentSpanContext,traceState:n.spanContext().traceState?.serialize(),name:n.name,id:n.spanContext().spanId,kind:n.kind,timestamp:(0,c.hrTimeToMicroseconds)(n.startTime),duration:(0,c.hrTimeToMicroseconds)(n.duration),attributes:n.attributes,status:n.status,events:n.events,links:n.links}}_sendSpans(n,u){for(let c of n)console.dir(this._exportInfo(c),{depth:3});if(u)return u({code:c.ExportResultCode.SUCCESS})}}})),require_InMemorySpanExporter$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InMemorySpanExporter=void 0;let c=require_src$18();n.InMemorySpanExporter=class{_finishedSpans=[];_stopped=!1;export(n,u){if(this._stopped)return u({code:c.ExportResultCode.FAILED,error:Error(`Exporter has been stopped`)});this._finishedSpans.push(...n),setTimeout(()=>u({code:c.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}})),require_SimpleSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SimpleSpanProcessor=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18();n.SimpleSpanProcessor=class{_exporter;_shutdownOnce;_pendingExports;constructor(n){this._exporter=n,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(n,c){}onEnd(n){if(this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)===0)return;let p=this._doExport(n).catch(n=>(0,u.globalErrorHandler)(n));this._pendingExports.add(p),p.finally(()=>this._pendingExports.delete(p))}async _doExport(n){n.resource.asyncAttributesPending&&await n.resource.waitForAsyncAttributes?.();let c=await u.internal._export(this._exporter,[n]);if(c.code!==u.ExportResultCode.SUCCESS)throw c.error??Error(`SimpleSpanProcessor: span export failed (status ${c})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}})),require_NoopSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NoopSpanProcessor=void 0,n.NoopSpanProcessor=class{onStart(n,c){}onEnd(n){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}})),require_src$4=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=n.TraceIdRatioBasedSampler=n.ParentBasedSampler=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NoopSpanProcessor=n.SimpleSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.RandomIdGenerator=n.BatchSpanProcessor=n.BasicTracerProvider=void 0;var c=require_BasicTracerProvider$1();Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return c.BasicTracerProvider}});var u=require_platform$3();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}});var p=require_ConsoleSpanExporter$1();Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return p.ConsoleSpanExporter}});var h=require_InMemorySpanExporter$1();Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return h.InMemorySpanExporter}});var x=require_SimpleSpanProcessor$1();Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return x.SimpleSpanProcessor}});var w=require_NoopSpanProcessor$1();Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return w.NoopSpanProcessor}});var T=require_AlwaysOffSampler$1();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return T.AlwaysOffSampler}});var O=require_AlwaysOnSampler$1();Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return O.AlwaysOnSampler}});var A=require_ParentBasedSampler$1();Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return A.ParentBasedSampler}});var j=require_TraceIdRatioBasedSampler$1();Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return j.TraceIdRatioBasedSampler}});var N=require_Sampler$1();Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return N.SamplingDecision}})})),require_suppress_tracing=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isTracingSuppressed=n.unsuppressTracing=n.suppressTracing=void 0;let c=(0,(init_esm$2(),__toCommonJS(esm_exports$2)).createContextKey)(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function u(n){return n.setValue(c,!0)}n.suppressTracing=u;function p(n){return n.deleteValue(c)}n.unsuppressTracing=p;function h(n){return n.getValue(c)===!0}n.isTracingSuppressed=h})),require_constants=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BAGGAGE_MAX_TOTAL_LENGTH=n.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=n.BAGGAGE_MAX_NAME_VALUE_PAIRS=n.BAGGAGE_HEADER=n.BAGGAGE_ITEMS_SEPARATOR=n.BAGGAGE_PROPERTIES_SEPARATOR=n.BAGGAGE_KEY_PAIR_SEPARATOR=void 0,n.BAGGAGE_KEY_PAIR_SEPARATOR=`=`,n.BAGGAGE_PROPERTIES_SEPARATOR=`;`,n.BAGGAGE_ITEMS_SEPARATOR=`,`,n.BAGGAGE_HEADER=`baggage`,n.BAGGAGE_MAX_NAME_VALUE_PAIRS=180,n.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096,n.BAGGAGE_MAX_TOTAL_LENGTH=8192})),require_utils$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.parseKeyPairsIntoRecord=n.parsePairKeyValue=n.getKeyPairs=n.serializeKeyPairs=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_constants();function p(n){return n.reduce((n,c)=>{let p=`${n}${n===``?``:u.BAGGAGE_ITEMS_SEPARATOR}${c}`;return p.length>u.BAGGAGE_MAX_TOTAL_LENGTH?n:p},``)}n.serializeKeyPairs=p;function h(n){return n.getAllEntries().map(([n,c])=>{let p=`${encodeURIComponent(n)}=${encodeURIComponent(c.value)}`;return c.metadata!==void 0&&(p+=u.BAGGAGE_PROPERTIES_SEPARATOR+c.metadata.toString()),p})}n.getKeyPairs=h;function x(n){if(!n)return;let p=n.indexOf(u.BAGGAGE_PROPERTIES_SEPARATOR),h=p===-1?n:n.substring(0,p),x=h.indexOf(u.BAGGAGE_KEY_PAIR_SEPARATOR);if(x<=0)return;let w=h.substring(0,x).trim(),T=h.substring(x+1).trim();if(!w||!T)return;let O,A;try{O=decodeURIComponent(w),A=decodeURIComponent(T)}catch{return}let j;if(p!==-1&&p<n.length-1){let u=n.substring(p+1);j=(0,c.baggageEntryMetadataFromString)(u)}return{key:O,value:A,metadata:j}}n.parsePairKeyValue=x;function w(n){let c={};return typeof n==`string`&&n.length>0&&n.split(u.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let u=x(n);u!==void 0&&u.value.length>0&&(c[u.key]=u.value)}),c}n.parseKeyPairsIntoRecord=w})),require_W3CBaggagePropagator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.W3CBaggagePropagator=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing(),p=require_constants(),h=require_utils$2();n.W3CBaggagePropagator=class{inject(n,x,w){let T=c.propagation.getBaggage(n);if(!T||(0,u.isTracingSuppressed)(n))return;let O=(0,h.getKeyPairs)(T).filter(n=>n.length<=p.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,p.BAGGAGE_MAX_NAME_VALUE_PAIRS),A=(0,h.serializeKeyPairs)(O);A.length>0&&w.set(x,p.BAGGAGE_HEADER,A)}extract(n,u,x){let w=x.get(u,p.BAGGAGE_HEADER),T=Array.isArray(w)?w.join(p.BAGGAGE_ITEMS_SEPARATOR):w;if(!T)return n;let O={};return T.length===0||(T.split(p.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let c=(0,h.parsePairKeyValue)(n);if(c){let n={value:c.value};c.metadata&&(n.metadata=c.metadata),O[c.key]=n}}),Object.entries(O).length===0)?n:c.propagation.setBaggage(n,c.propagation.createBaggage(O))}fields(){return[p.BAGGAGE_HEADER]}}})),require_anchored_clock=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AnchoredClock=void 0,n.AnchoredClock=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(n,c){this._monotonicClock=c,this._epochMillis=n.now(),this._performanceMillis=c.now()}now(){let n=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+n}}})),require_attributes=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isAttributeValue=n.isAttributeKey=n.sanitizeAttributes=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));function u(n){let u={};if(typeof n!=`object`||!n)return u;for(let x in n){if(!Object.prototype.hasOwnProperty.call(n,x))continue;if(!p(x)){c.diag.warn(`Invalid attribute key: ${x}`);continue}let w=n[x];if(!h(w)){c.diag.warn(`Invalid attribute value set for key: ${x}`);continue}Array.isArray(w)?u[x]=w.slice():u[x]=w}return u}n.sanitizeAttributes=u;function p(n){return typeof n==`string`&&n!==``}n.isAttributeKey=p;function h(n){return n==null?!0:Array.isArray(n)?x(n):w(typeof n)}n.isAttributeValue=h;function x(n){let c;for(let u of n){if(u==null)continue;let n=typeof u;if(n!==c){if(!c){if(w(n)){c=n;continue}return!1}return!1}}return!0}function w(n){switch(n){case`number`:case`boolean`:case`string`:return!0}return!1}})),require_logging_error_handler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.loggingErrorHandler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));function u(){return n=>{c.diag.error(p(n))}}n.loggingErrorHandler=u;function p(n){return typeof n==`string`?n:JSON.stringify(h(n))}function h(n){let c={},u=n;for(;u!==null;)Object.getOwnPropertyNames(u).forEach(n=>{if(c[n])return;let p=u[n];p&&(c[n]=String(p))}),u=Object.getPrototypeOf(u);return c}})),require_global_error_handler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.globalErrorHandler=n.setGlobalErrorHandler=void 0;let c=(0,require_logging_error_handler().loggingErrorHandler)();function u(n){c=n}n.setGlobalErrorHandler=u;function p(n){try{c(n)}catch{}}n.globalErrorHandler=p})),require_environment=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getStringListFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=n.getNumberFromEnv=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=__require(`util`);function p(n){let p=process.env[n];if(p==null||p.trim()===``)return;let h=Number(p);if(isNaN(h)){c.diag.warn(`Unknown value ${(0,u.inspect)(p)} for ${n}, expected a number, using defaults`);return}return h}n.getNumberFromEnv=p;function h(n){let c=process.env[n];if(!(c==null||c.trim()===``))return c}n.getStringFromEnv=h;function x(n){let p=process.env[n]?.trim().toLowerCase();return p==null||p===``?!1:p===`true`?!0:(p===`false`||c.diag.warn(`Unknown value ${(0,u.inspect)(p)} for ${n}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}n.getBooleanFromEnv=x;function w(n){return h(n)?.split(`,`).map(n=>n.trim()).filter(n=>n!==``)}n.getStringListFromEnv=w})),require_globalThis=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._globalThis=void 0,n._globalThis=globalThis})),require_version$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_semconv$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ATTR_PROCESS_RUNTIME_NAME=void 0,n.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`})),require_sdk_info=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SDK_INFO=void 0;let c=require_version$1(),u=(init_esm$1(),__toCommonJS(esm_exports$1)),p=require_semconv$2();n.SDK_INFO={[u.ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[p.ATTR_PROCESS_RUNTIME_NAME]:`node`,[u.ATTR_TELEMETRY_SDK_LANGUAGE]:u.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[u.ATTR_TELEMETRY_SDK_VERSION]:c.VERSION}})),require_node$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.otperformance=n.SDK_INFO=n._globalThis=n.getStringListFromEnv=n.getNumberFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=void 0;var c=require_environment();Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return c.getStringFromEnv}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return c.getBooleanFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return c.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return c.getStringListFromEnv}});var u=require_globalThis();Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return u._globalThis}});var p=require_sdk_info();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return p.SDK_INFO}}),n.otperformance=performance})),require_platform$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getStringListFromEnv=n.getNumberFromEnv=n.getStringFromEnv=n.getBooleanFromEnv=n.otperformance=n._globalThis=n.SDK_INFO=void 0;var c=require_node$2();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return c.SDK_INFO}}),Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return c._globalThis}}),Object.defineProperty(n,`otperformance`,{enumerable:!0,get:function(){return c.otperformance}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return c.getBooleanFromEnv}}),Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return c.getStringFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return c.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return c.getStringListFromEnv}})})),require_time=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.addHrTimes=n.isTimeInput=n.isTimeInputHrTime=n.hrTimeToMicroseconds=n.hrTimeToMilliseconds=n.hrTimeToNanoseconds=n.hrTimeToTimeStamp=n.hrTimeDuration=n.timeInputToHrTime=n.hrTime=n.getTimeOrigin=n.millisToHrTime=void 0;let c=require_platform$2(),u=9,p=10**6,h=10**9;function x(n){let c=n/1e3;return[Math.trunc(c),Math.round(n%1e3*p)]}n.millisToHrTime=x;function w(){return c.otperformance.timeOrigin}n.getTimeOrigin=w;function T(n){return V(x(c.otperformance.timeOrigin),x(typeof n==`number`?n:c.otperformance.now()))}n.hrTime=T;function O(n){if(z(n))return n;if(typeof n==`number`)return n<c.otperformance.timeOrigin?T(n):x(n);if(n instanceof Date)return x(n.getTime());throw TypeError(`Invalid input type`)}n.timeInputToHrTime=O;function A(n,c){let u=c[0]-n[0],p=c[1]-n[1];return p<0&&(--u,p+=h),[u,p]}n.hrTimeDuration=A;function j(n){let c=9,u=`${`0`.repeat(9)}${n[1]}Z`,p=u.substring(u.length-9-1);return new Date(n[0]*1e3).toISOString().replace(`000Z`,p)}n.hrTimeToTimeStamp=j;function N(n){return n[0]*h+n[1]}n.hrTimeToNanoseconds=N;function I(n){return n[0]*1e3+n[1]/1e6}n.hrTimeToMilliseconds=I;function L(n){return n[0]*1e6+n[1]/1e3}n.hrTimeToMicroseconds=L;function z(n){return Array.isArray(n)&&n.length===2&&typeof n[0]==`number`&&typeof n[1]==`number`}n.isTimeInputHrTime=z;function B(n){return z(n)||typeof n==`number`||n instanceof Date}n.isTimeInput=B;function V(n,c){let u=[n[0]+c[0],n[1]+c[1]];return u[1]>=h&&(u[1]-=h,u[0]+=1),u}n.addHrTimes=V})),require_timer_util=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.unrefTimer=void 0;function c(n){typeof n!=`number`&&n.unref()}n.unrefTimer=c})),require_ExportResult=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExportResultCode=void 0,(function(n){n[n.SUCCESS=0]=`SUCCESS`,n[n.FAILED=1]=`FAILED`})(n.ExportResultCode||={})})),require_composite=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.CompositePropagator=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));n.CompositePropagator=class{_propagators;_fields;constructor(n={}){this._propagators=n.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields==`function`?n.fields():[]).reduce((n,c)=>n.concat(c),[])))}inject(n,u,p){for(let h of this._propagators)try{h.inject(n,u,p)}catch(n){c.diag.warn(`Failed to inject with ${h.constructor.name}. Err: ${n.message}`)}}extract(n,u,p){return this._propagators.reduce((n,h)=>{try{return h.extract(n,u,p)}catch(n){c.diag.warn(`Failed to extract with ${h.constructor.name}. Err: ${n.message}`)}return n},n)}fields(){return this._fields.slice()}}})),require_validators=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.validateValue=n.validateKey=void 0;let c=`[_0-9a-z-*/]`,u=`[a-z]${c}{0,255}`,p=`[a-z0-9]${c}{0,240}@[a-z]${c}{0,13}`,h=RegExp(`^(?:${u}|${p})$`),x=/^[ -~]{0,255}[!-~]$/,w=/,|=/;function T(n){return h.test(n)}n.validateKey=T;function O(n){return x.test(n)&&!w.test(n)}n.validateValue=O})),require_TraceState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceState=void 0;let c=require_validators(),u=32,p=512,h=`,`,x=`=`;n.TraceState=class n{_internalState=new Map;constructor(n){n&&this._parse(n)}set(n,c){let u=this._clone();return u._internalState.has(n)&&u._internalState.delete(n),u._internalState.set(n,c),u}unset(n){let c=this._clone();return c._internalState.delete(n),c}get(n){return this._internalState.get(n)}serialize(){return this._keys().reduce((n,c)=>(n.push(c+`=`+this.get(c)),n),[]).join(`,`)}_parse(n){n.length>512||(this._internalState=n.split(`,`).reverse().reduce((n,u)=>{let p=u.trim(),h=p.indexOf(`=`);if(h!==-1){let x=p.slice(0,h),w=p.slice(h+1,u.length);(0,c.validateKey)(x)&&(0,c.validateValue)(w)&&n.set(x,w)}return n},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let c=new n;return c._internalState=new Map(this._internalState),c}}})),require_W3CTraceContextPropagator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.W3CTraceContextPropagator=n.parseTraceParent=n.TRACE_STATE_HEADER=n.TRACE_PARENT_HEADER=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing(),p=require_TraceState();n.TRACE_PARENT_HEADER=`traceparent`,n.TRACE_STATE_HEADER=`tracestate`;let h=`00`,x=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function w(n){let c=x.exec(n);return!c||c[1]===`00`&&c[5]?null:{traceId:c[2],spanId:c[3],traceFlags:parseInt(c[4],16)}}n.parseTraceParent=w,n.W3CTraceContextPropagator=class{inject(p,h,x){let w=c.trace.getSpanContext(p);if(!w||(0,u.isTracingSuppressed)(p)||!(0,c.isSpanContextValid)(w))return;let T=`00-${w.traceId}-${w.spanId}-0${Number(w.traceFlags||c.TraceFlags.NONE).toString(16)}`;x.set(h,n.TRACE_PARENT_HEADER,T),w.traceState&&x.set(h,n.TRACE_STATE_HEADER,w.traceState.serialize())}extract(u,h,x){let T=x.get(h,n.TRACE_PARENT_HEADER);if(!T)return u;let O=Array.isArray(T)?T[0]:T;if(typeof O!=`string`)return u;let A=w(O);if(!A)return u;A.isRemote=!0;let j=x.get(h,n.TRACE_STATE_HEADER);if(j){let n=Array.isArray(j)?j.join(`,`):j;A.traceState=new p.TraceState(typeof n==`string`?n:void 0)}return c.trace.setSpanContext(u,A)}fields(){return[n.TRACE_PARENT_HEADER,n.TRACE_STATE_HEADER]}}})),require_rpc_metadata=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getRPCMetadata=n.deleteRPCMetadata=n.setRPCMetadata=n.RPCType=void 0;let c=(0,(init_esm$2(),__toCommonJS(esm_exports$2)).createContextKey)(`OpenTelemetry SDK Context Key RPC_METADATA`);(function(n){n.HTTP=`http`})(n.RPCType||={});function u(n,u){return n.setValue(c,u)}n.setRPCMetadata=u;function p(n){return n.deleteValue(c)}n.deleteRPCMetadata=p;function h(n){return n.getValue(c)}n.getRPCMetadata=h})),require_lodash_merge=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isPlainObject=void 0;let c=`[object Object]`,u=`[object Null]`,p=`[object Undefined]`,h=Function.prototype.toString,x=h.call(Object),w=Object.getPrototypeOf,T=Object.prototype,O=T.hasOwnProperty,A=Symbol?Symbol.toStringTag:void 0,j=T.toString;function N(n){if(!I(n)||L(n)!==`[object Object]`)return!1;let c=w(n);if(c===null)return!0;let u=O.call(c,`constructor`)&&c.constructor;return typeof u==`function`&&u instanceof u&&h.call(u)===x}n.isPlainObject=N;function I(n){return typeof n==`object`&&!!n}function L(n){return n==null?n===void 0?`[object Undefined]`:`[object Null]`:A&&A in Object(n)?z(n):B(n)}function z(n){let c=O.call(n,A),u=n[A],p=!1;try{n[A]=void 0,p=!0}catch{}let h=j.call(n);return p&&(c?n[A]=u:delete n[A]),h}function B(n){return j.call(n)}})),require_merge=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.merge=void 0;let c=require_lodash_merge(),u=20;function p(...n){let c=n.shift(),u=new WeakMap;for(;n.length>0;)c=x(c,n.shift(),0,u);return c}n.merge=p;function h(n){return T(n)?n.slice():n}function x(n,c,u=0,p){let I;if(!(u>20)){if(u++,j(n)||j(c)||O(c))I=h(c);else if(T(n)){if(I=n.slice(),T(c))for(let n=0,u=c.length;n<u;n++)I.push(h(c[n]));else if(A(c)){let n=Object.keys(c);for(let u=0,p=n.length;u<p;u++){let p=n[u];p===`__proto__`||p===`constructor`||p===`prototype`||(I[p]=h(c[p]))}}}else if(A(n))if(A(c)){if(!N(n,c))return c;I=Object.assign({},n);let h=Object.keys(c);for(let T=0,O=h.length;T<O;T++){let O=h[T];if(O===`__proto__`||O===`constructor`||O===`prototype`)continue;let N=c[O];if(j(N))N===void 0?delete I[O]:I[O]=N;else{let h=I[O],T=N;if(w(n,O,p)||w(c,O,p))delete I[O];else{if(A(h)&&A(T)){let u=p.get(h)||[],x=p.get(T)||[];u.push({obj:n,key:O}),x.push({obj:c,key:O}),p.set(h,u),p.set(T,x)}I[O]=x(I[O],N,u,p)}}}}else I=c;return I}}function w(n,c,u){let p=u.get(n[c])||[];for(let u=0,h=p.length;u<h;u++){let h=p[u];if(h.key===c&&h.obj===n)return!0}return!1}function T(n){return Array.isArray(n)}function O(n){return typeof n==`function`}function A(n){return!j(n)&&!T(n)&&!O(n)&&typeof n==`object`}function j(n){return typeof n==`string`||typeof n==`number`||typeof n==`boolean`||n===void 0||n instanceof Date||n instanceof RegExp||n===null}function N(n,u){return!(!(0,c.isPlainObject)(n)||!(0,c.isPlainObject)(u))}})),require_timeout=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.callWithTimeout=n.TimeoutError=void 0;var c=class n extends Error{constructor(c){super(c),Object.setPrototypeOf(this,n.prototype)}};n.TimeoutError=c;function u(n,u){let p,h=new Promise(function(n,h){p=setTimeout(function(){h(new c(`Operation timed out.`))},u)});return Promise.race([n,h]).then(n=>(clearTimeout(p),n),n=>{throw clearTimeout(p),n})}n.callWithTimeout=u})),require_url=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isUrlIgnored=n.urlMatches=void 0;function c(n,c){return typeof c==`string`?n===c:!!n.match(c)}n.urlMatches=c;function u(n,u){if(!u)return!1;for(let p of u)if(c(n,p))return!0;return!1}n.isUrlIgnored=u})),require_promise=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Deferred=void 0,n.Deferred=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((n,c)=>{this._resolve=n,this._reject=c})}get promise(){return this._promise}resolve(n){this._resolve(n)}reject(n){this._reject(n)}}})),require_callback=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BindOnceFuture=void 0;let c=require_promise();n.BindOnceFuture=class{_isCalled=!1;_deferred=new c.Deferred;_callback;_that;constructor(n,c){this._callback=n,this._that=c}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...n){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...n)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}}})),require_configuration=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.diagLogLevelFromString=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u={ALL:c.DiagLogLevel.ALL,VERBOSE:c.DiagLogLevel.VERBOSE,DEBUG:c.DiagLogLevel.DEBUG,INFO:c.DiagLogLevel.INFO,WARN:c.DiagLogLevel.WARN,ERROR:c.DiagLogLevel.ERROR,NONE:c.DiagLogLevel.NONE};function p(n){return n==null?void 0:u[n.toUpperCase()]??(c.diag.warn(`Unknown log level "${n}", expected one of ${Object.keys(u)}, using default`),c.DiagLogLevel.INFO)}n.diagLogLevelFromString=p})),require_exporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._export=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing();function p(n,p){return new Promise(h=>{c.context.with((0,u.suppressTracing)(c.context.active()),()=>{n.export(p,h)})})}n._export=p})),require_src$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.internal=n.diagLogLevelFromString=n.BindOnceFuture=n.urlMatches=n.isUrlIgnored=n.callWithTimeout=n.TimeoutError=n.merge=n.TraceState=n.unsuppressTracing=n.suppressTracing=n.isTracingSuppressed=n.setRPCMetadata=n.getRPCMetadata=n.deleteRPCMetadata=n.RPCType=n.parseTraceParent=n.W3CTraceContextPropagator=n.TRACE_STATE_HEADER=n.TRACE_PARENT_HEADER=n.CompositePropagator=n.otperformance=n.getStringListFromEnv=n.getNumberFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=n._globalThis=n.SDK_INFO=n.parseKeyPairsIntoRecord=n.ExportResultCode=n.unrefTimer=n.timeInputToHrTime=n.millisToHrTime=n.isTimeInputHrTime=n.isTimeInput=n.hrTimeToTimeStamp=n.hrTimeToNanoseconds=n.hrTimeToMilliseconds=n.hrTimeToMicroseconds=n.hrTimeDuration=n.hrTime=n.getTimeOrigin=n.addHrTimes=n.loggingErrorHandler=n.setGlobalErrorHandler=n.globalErrorHandler=n.sanitizeAttributes=n.isAttributeValue=n.AnchoredClock=n.W3CBaggagePropagator=void 0;var c=require_W3CBaggagePropagator();Object.defineProperty(n,`W3CBaggagePropagator`,{enumerable:!0,get:function(){return c.W3CBaggagePropagator}});var u=require_anchored_clock();Object.defineProperty(n,`AnchoredClock`,{enumerable:!0,get:function(){return u.AnchoredClock}});var p=require_attributes();Object.defineProperty(n,`isAttributeValue`,{enumerable:!0,get:function(){return p.isAttributeValue}}),Object.defineProperty(n,`sanitizeAttributes`,{enumerable:!0,get:function(){return p.sanitizeAttributes}});var h=require_global_error_handler();Object.defineProperty(n,`globalErrorHandler`,{enumerable:!0,get:function(){return h.globalErrorHandler}}),Object.defineProperty(n,`setGlobalErrorHandler`,{enumerable:!0,get:function(){return h.setGlobalErrorHandler}});var x=require_logging_error_handler();Object.defineProperty(n,`loggingErrorHandler`,{enumerable:!0,get:function(){return x.loggingErrorHandler}});var w=require_time();Object.defineProperty(n,`addHrTimes`,{enumerable:!0,get:function(){return w.addHrTimes}}),Object.defineProperty(n,`getTimeOrigin`,{enumerable:!0,get:function(){return w.getTimeOrigin}}),Object.defineProperty(n,`hrTime`,{enumerable:!0,get:function(){return w.hrTime}}),Object.defineProperty(n,`hrTimeDuration`,{enumerable:!0,get:function(){return w.hrTimeDuration}}),Object.defineProperty(n,`hrTimeToMicroseconds`,{enumerable:!0,get:function(){return w.hrTimeToMicroseconds}}),Object.defineProperty(n,`hrTimeToMilliseconds`,{enumerable:!0,get:function(){return w.hrTimeToMilliseconds}}),Object.defineProperty(n,`hrTimeToNanoseconds`,{enumerable:!0,get:function(){return w.hrTimeToNanoseconds}}),Object.defineProperty(n,`hrTimeToTimeStamp`,{enumerable:!0,get:function(){return w.hrTimeToTimeStamp}}),Object.defineProperty(n,`isTimeInput`,{enumerable:!0,get:function(){return w.isTimeInput}}),Object.defineProperty(n,`isTimeInputHrTime`,{enumerable:!0,get:function(){return w.isTimeInputHrTime}}),Object.defineProperty(n,`millisToHrTime`,{enumerable:!0,get:function(){return w.millisToHrTime}}),Object.defineProperty(n,`timeInputToHrTime`,{enumerable:!0,get:function(){return w.timeInputToHrTime}});var T=require_timer_util();Object.defineProperty(n,`unrefTimer`,{enumerable:!0,get:function(){return T.unrefTimer}});var O=require_ExportResult();Object.defineProperty(n,`ExportResultCode`,{enumerable:!0,get:function(){return O.ExportResultCode}});var A=require_utils$2();Object.defineProperty(n,`parseKeyPairsIntoRecord`,{enumerable:!0,get:function(){return A.parseKeyPairsIntoRecord}});var j=require_platform$2();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return j.SDK_INFO}}),Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return j._globalThis}}),Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return j.getStringFromEnv}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return j.getBooleanFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return j.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return j.getStringListFromEnv}}),Object.defineProperty(n,`otperformance`,{enumerable:!0,get:function(){return j.otperformance}});var N=require_composite();Object.defineProperty(n,`CompositePropagator`,{enumerable:!0,get:function(){return N.CompositePropagator}});var I=require_W3CTraceContextPropagator();Object.defineProperty(n,`TRACE_PARENT_HEADER`,{enumerable:!0,get:function(){return I.TRACE_PARENT_HEADER}}),Object.defineProperty(n,`TRACE_STATE_HEADER`,{enumerable:!0,get:function(){return I.TRACE_STATE_HEADER}}),Object.defineProperty(n,`W3CTraceContextPropagator`,{enumerable:!0,get:function(){return I.W3CTraceContextPropagator}}),Object.defineProperty(n,`parseTraceParent`,{enumerable:!0,get:function(){return I.parseTraceParent}});var L=require_rpc_metadata();Object.defineProperty(n,`RPCType`,{enumerable:!0,get:function(){return L.RPCType}}),Object.defineProperty(n,`deleteRPCMetadata`,{enumerable:!0,get:function(){return L.deleteRPCMetadata}}),Object.defineProperty(n,`getRPCMetadata`,{enumerable:!0,get:function(){return L.getRPCMetadata}}),Object.defineProperty(n,`setRPCMetadata`,{enumerable:!0,get:function(){return L.setRPCMetadata}});var z=require_suppress_tracing();Object.defineProperty(n,`isTracingSuppressed`,{enumerable:!0,get:function(){return z.isTracingSuppressed}}),Object.defineProperty(n,`suppressTracing`,{enumerable:!0,get:function(){return z.suppressTracing}}),Object.defineProperty(n,`unsuppressTracing`,{enumerable:!0,get:function(){return z.unsuppressTracing}});var B=require_TraceState();Object.defineProperty(n,`TraceState`,{enumerable:!0,get:function(){return B.TraceState}});var V=require_merge();Object.defineProperty(n,`merge`,{enumerable:!0,get:function(){return V.merge}});var H=require_timeout();Object.defineProperty(n,`TimeoutError`,{enumerable:!0,get:function(){return H.TimeoutError}}),Object.defineProperty(n,`callWithTimeout`,{enumerable:!0,get:function(){return H.callWithTimeout}});var U=require_url();Object.defineProperty(n,`isUrlIgnored`,{enumerable:!0,get:function(){return U.isUrlIgnored}}),Object.defineProperty(n,`urlMatches`,{enumerable:!0,get:function(){return U.urlMatches}});var W=require_callback();Object.defineProperty(n,`BindOnceFuture`,{enumerable:!0,get:function(){return W.BindOnceFuture}});var G=require_configuration();Object.defineProperty(n,`diagLogLevelFromString`,{enumerable:!0,get:function(){return G.diagLogLevelFromString}}),n.internal={_export:require_exporter()._export}})),require_default_service_name=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._clearDefaultServiceNameCache=n.defaultServiceName=void 0;let c;function u(){if(c===void 0)try{let n=globalThis.process.argv0;c=n?`unknown_service:${n}`:`unknown_service`}catch{c=`unknown_service`}return c}n.defaultServiceName=u;function p(){c=void 0}n._clearDefaultServiceNameCache=p})),require_utils$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isPromiseLike=void 0,n.isPromiseLike=n=>typeof n==`object`&&!!n&&typeof n.then==`function`})),require_ResourceImpl=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.defaultResource=n.emptyResource=n.resourceFromDetectedResource=n.resourceFromAttributes=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_default_service_name(),x=require_utils$1();var w=class n{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(c,u){let p=new n({},u);return p._rawAttributes=N(c),p._asyncAttributesPending=c.filter(([n,c])=>(0,x.isPromiseLike)(c)).length>0,p}constructor(n,c){let u=n.attributes??{};this._rawAttributes=Object.entries(u).map(([n,c])=>((0,x.isPromiseLike)(c)&&(this._asyncAttributesPending=!0),[n,c])),this._rawAttributes=N(this._rawAttributes),this._schemaUrl=I(c?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let n=0;n<this._rawAttributes.length;n++){let[c,u]=this._rawAttributes[n];this._rawAttributes[n]=[c,(0,x.isPromiseLike)(u)?await u:u]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&c.diag.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let n={};for(let[u,p]of this._rawAttributes){if((0,x.isPromiseLike)(p)){c.diag.debug(`Unsettled resource attribute ${u} skipped`);continue}p!=null&&(n[u]??=p)}return this._asyncAttributesPending||(this._memoizedAttributes=n),n}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(c){if(c==null)return this;let u=L(this,c),p=u?{schemaUrl:u}:void 0;return n.FromAttributeList([...c.getRawAttributes(),...this.getRawAttributes()],p)}};function T(n,c){return w.FromAttributeList(Object.entries(n),c)}n.resourceFromAttributes=T;function O(n,c){return new w(n,c)}n.resourceFromDetectedResource=O;function A(){return T({})}n.emptyResource=A;function j(){return T({[p.ATTR_SERVICE_NAME]:(0,h.defaultServiceName)(),[p.ATTR_TELEMETRY_SDK_LANGUAGE]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_LANGUAGE],[p.ATTR_TELEMETRY_SDK_NAME]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_NAME],[p.ATTR_TELEMETRY_SDK_VERSION]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_VERSION]})}n.defaultResource=j;function N(n){return n.map(([n,u])=>(0,x.isPromiseLike)(u)?[n,u.catch(u=>{c.diag.debug(`promise rejection for resource attribute: %s - %s`,n,u)})]:[n,u])}function I(n){if(typeof n==`string`||n===void 0)return n;c.diag.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,n)}function L(n,u){let p=n?.schemaUrl,h=u?.schemaUrl,x=p===void 0||p===``,w=h===void 0||h===``;if(x)return h;if(w||p===h)return p;c.diag.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,p,h)}})),require_detect_resources=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.detectResources=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_ResourceImpl();n.detectResources=(n={})=>(n.detectors||[]).map(p=>{try{let h=(0,u.resourceFromDetectedResource)(p.detect(n));return c.diag.debug(`${p.constructor.name} found resource.`,h),h}catch(n){return c.diag.debug(`${p.constructor.name} failed: ${n.message}`),(0,u.emptyResource)()}}).reduce((n,c)=>n.merge(c),(0,u.emptyResource)())})),require_EnvDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.envDetector=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=(init_esm$1(),__toCommonJS(esm_exports$1)),p=require_src$3();n.envDetector=new class{_MAX_LENGTH=255;_COMMA_SEPARATOR=`,`;_LABEL_KEY_VALUE_SPLITTER=`=`;detect(n){let h={},x=(0,p.getStringFromEnv)(`OTEL_RESOURCE_ATTRIBUTES`),w=(0,p.getStringFromEnv)(`OTEL_SERVICE_NAME`);if(x)try{let n=this._parseResourceAttributes(x);Object.assign(h,n)}catch(n){c.diag.debug(`EnvDetector failed: ${n instanceof Error?n.message:n}`)}return w&&(h[u.ATTR_SERVICE_NAME]=w),{attributes:h}}_parseResourceAttributes(n){if(!n)return{};let c={},u=n.split(this._COMMA_SEPARATOR).filter(n=>n.trim()!==``);for(let n of u){let u=n.split(this._LABEL_KEY_VALUE_SPLITTER);if(u.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${n}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[p,h]=u,x=p.trim(),w=h.trim();if(x.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${n}".`);let T,O;try{T=decodeURIComponent(x),O=decodeURIComponent(w)}catch(c){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${n}": ${c instanceof Error?c.message:c}`)}if(T.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${T}".`);if(O.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${T}".`);c[T]=O}return c}}})),require_semconv$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ATTR_WEBENGINE_VERSION=n.ATTR_WEBENGINE_NAME=n.ATTR_WEBENGINE_DESCRIPTION=n.ATTR_SERVICE_NAMESPACE=n.ATTR_SERVICE_INSTANCE_ID=n.ATTR_PROCESS_RUNTIME_VERSION=n.ATTR_PROCESS_RUNTIME_NAME=n.ATTR_PROCESS_RUNTIME_DESCRIPTION=n.ATTR_PROCESS_PID=n.ATTR_PROCESS_OWNER=n.ATTR_PROCESS_EXECUTABLE_PATH=n.ATTR_PROCESS_EXECUTABLE_NAME=n.ATTR_PROCESS_COMMAND_ARGS=n.ATTR_PROCESS_COMMAND=n.ATTR_OS_VERSION=n.ATTR_OS_TYPE=n.ATTR_K8S_POD_NAME=n.ATTR_K8S_NAMESPACE_NAME=n.ATTR_K8S_DEPLOYMENT_NAME=n.ATTR_K8S_CLUSTER_NAME=n.ATTR_HOST_TYPE=n.ATTR_HOST_NAME=n.ATTR_HOST_IMAGE_VERSION=n.ATTR_HOST_IMAGE_NAME=n.ATTR_HOST_IMAGE_ID=n.ATTR_HOST_ID=n.ATTR_HOST_ARCH=n.ATTR_CONTAINER_NAME=n.ATTR_CONTAINER_IMAGE_TAGS=n.ATTR_CONTAINER_IMAGE_NAME=n.ATTR_CONTAINER_ID=n.ATTR_CLOUD_REGION=n.ATTR_CLOUD_PROVIDER=n.ATTR_CLOUD_AVAILABILITY_ZONE=n.ATTR_CLOUD_ACCOUNT_ID=void 0,n.ATTR_CLOUD_ACCOUNT_ID=`cloud.account.id`,n.ATTR_CLOUD_AVAILABILITY_ZONE=`cloud.availability_zone`,n.ATTR_CLOUD_PROVIDER=`cloud.provider`,n.ATTR_CLOUD_REGION=`cloud.region`,n.ATTR_CONTAINER_ID=`container.id`,n.ATTR_CONTAINER_IMAGE_NAME=`container.image.name`,n.ATTR_CONTAINER_IMAGE_TAGS=`container.image.tags`,n.ATTR_CONTAINER_NAME=`container.name`,n.ATTR_HOST_ARCH=`host.arch`,n.ATTR_HOST_ID=`host.id`,n.ATTR_HOST_IMAGE_ID=`host.image.id`,n.ATTR_HOST_IMAGE_NAME=`host.image.name`,n.ATTR_HOST_IMAGE_VERSION=`host.image.version`,n.ATTR_HOST_NAME=`host.name`,n.ATTR_HOST_TYPE=`host.type`,n.ATTR_K8S_CLUSTER_NAME=`k8s.cluster.name`,n.ATTR_K8S_DEPLOYMENT_NAME=`k8s.deployment.name`,n.ATTR_K8S_NAMESPACE_NAME=`k8s.namespace.name`,n.ATTR_K8S_POD_NAME=`k8s.pod.name`,n.ATTR_OS_TYPE=`os.type`,n.ATTR_OS_VERSION=`os.version`,n.ATTR_PROCESS_COMMAND=`process.command`,n.ATTR_PROCESS_COMMAND_ARGS=`process.command_args`,n.ATTR_PROCESS_EXECUTABLE_NAME=`process.executable.name`,n.ATTR_PROCESS_EXECUTABLE_PATH=`process.executable.path`,n.ATTR_PROCESS_OWNER=`process.owner`,n.ATTR_PROCESS_PID=`process.pid`,n.ATTR_PROCESS_RUNTIME_DESCRIPTION=`process.runtime.description`,n.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`,n.ATTR_PROCESS_RUNTIME_VERSION=`process.runtime.version`,n.ATTR_SERVICE_INSTANCE_ID=`service.instance.id`,n.ATTR_SERVICE_NAMESPACE=`service.namespace`,n.ATTR_WEBENGINE_DESCRIPTION=`webengine.description`,n.ATTR_WEBENGINE_NAME=`webengine.name`,n.ATTR_WEBENGINE_VERSION=`webengine.version`})),require_getMachineId=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let c=__require(`process`),u;async function p(){if(!u)switch(c.platform){case`darwin`:u=(await import(`./getMachineId-darwin-BVHajbu-.js`).then(n=>__toESM(n.default))).getMachineId;break;case`linux`:u=(await import(`./getMachineId-linux-DF4P4JAH.js`).then(n=>__toESM(n.default))).getMachineId;break;case`freebsd`:u=(await import(`./getMachineId-bsd-C9rTsHCB.js`).then(n=>__toESM(n.default))).getMachineId;break;case`win32`:u=(await import(`./getMachineId-win-DvS6eAIQ.js`).then(n=>__toESM(n.default))).getMachineId;break;default:u=(await import(`./getMachineId-unsupported-BHgtlyRW.js`).then(n=>__toESM(n.default))).getMachineId;break}return u()}n.getMachineId=p})),require_utils=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.normalizeType=n.normalizeArch=void 0,n.normalizeArch=n=>{switch(n){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return n}},n.normalizeType=n=>{switch(n){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return n}}})),require_HostDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.hostDetector=void 0;let c=require_semconv$1(),u=__require(`os`),p=require_getMachineId(),h=require_utils();n.hostDetector=new class{detect(n){return{attributes:{[c.ATTR_HOST_NAME]:(0,u.hostname)(),[c.ATTR_HOST_ARCH]:(0,h.normalizeArch)((0,u.arch)()),[c.ATTR_HOST_ID]:(0,p.getMachineId)()}}}}})),require_OSDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.osDetector=void 0;let c=require_semconv$1(),u=__require(`os`),p=require_utils();n.osDetector=new class{detect(n){return{attributes:{[c.ATTR_OS_TYPE]:(0,p.normalizeType)((0,u.platform)()),[c.ATTR_OS_VERSION]:(0,u.release)()}}}}})),require_ProcessDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.processDetector=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_semconv$1(),p=__require(`os`);n.processDetector=new class{detect(n){let h={[u.ATTR_PROCESS_PID]:process.pid,[u.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[u.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[u.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[u.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[u.ATTR_PROCESS_RUNTIME_NAME]:`nodejs`,[u.ATTR_PROCESS_RUNTIME_DESCRIPTION]:`Node.js`};process.argv.length>1&&(h[u.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let n=p.userInfo();h[u.ATTR_PROCESS_OWNER]=n.username}catch(n){c.diag.debug(`error obtaining process owner: ${n}`)}return{attributes:h}}}})),require_ServiceInstanceIdDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=void 0;let c=require_semconv$1(),u=__require(`crypto`);n.serviceInstanceIdDetector=new class{detect(n){return{attributes:{[c.ATTR_SERVICE_INSTANCE_ID]:(0,u.randomUUID)()}}}}})),require_node$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=void 0;var c=require_HostDetector();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return c.hostDetector}});var u=require_OSDetector();Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}});var p=require_ProcessDetector();Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return p.processDetector}});var h=require_ServiceInstanceIdDetector();Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return h.serviceInstanceIdDetector}})})),require_platform$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=void 0;var c=require_node$1();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return c.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return c.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return c.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return c.serviceInstanceIdDetector}})})),require_NoopDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.noopDetector=n.NoopDetector=void 0;var c=class{detect(){return{attributes:{}}}};n.NoopDetector=c,n.noopDetector=new c})),require_detectors=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.noopDetector=n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=n.envDetector=void 0;var c=require_EnvDetector();Object.defineProperty(n,`envDetector`,{enumerable:!0,get:function(){return c.envDetector}});var u=require_platform$1();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return u.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return u.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return u.serviceInstanceIdDetector}});var p=require_NoopDetector();Object.defineProperty(n,`noopDetector`,{enumerable:!0,get:function(){return p.noopDetector}})})),require_src$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.defaultServiceName=n.emptyResource=n.defaultResource=n.resourceFromAttributes=n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=n.envDetector=n.detectResources=void 0;var c=require_detect_resources();Object.defineProperty(n,`detectResources`,{enumerable:!0,get:function(){return c.detectResources}});var u=require_detectors();Object.defineProperty(n,`envDetector`,{enumerable:!0,get:function(){return u.envDetector}}),Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return u.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return u.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return u.serviceInstanceIdDetector}});var p=require_ResourceImpl();Object.defineProperty(n,`resourceFromAttributes`,{enumerable:!0,get:function(){return p.resourceFromAttributes}}),Object.defineProperty(n,`defaultResource`,{enumerable:!0,get:function(){return p.defaultResource}}),Object.defineProperty(n,`emptyResource`,{enumerable:!0,get:function(){return p.emptyResource}});var h=require_default_service_name();Object.defineProperty(n,`defaultServiceName`,{enumerable:!0,get:function(){return h.defaultServiceName}})})),require_enums=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExceptionEventName=void 0,n.ExceptionEventName=`exception`})),require_Span=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SpanImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_enums();n.SpanImpl=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(n){let c=Date.now();if(this._spanContext=n.spanContext,this._performanceStartTime=u.otperformance.now(),this._performanceOffset=c-(this._performanceStartTime+u.otperformance.timeOrigin),this._startTimeProvided=n.startTime!=null,this._spanLimits=n.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=n.spanProcessor,this.name=n.name,this.parentSpanContext=n.parentSpanContext,this.kind=n.kind,n.links)for(let c of n.links)this.addLink(c);this.startTime=this._getTime(n.startTime??c),this.resource=n.resource,this.instrumentationScope=n.scope,this._recordEndMetrics=n.recordEndMetrics,n.attributes!=null&&this.setAttributes(n.attributes),this._spanProcessor.onStart(this,n.context)}spanContext(){return this._spanContext}setAttribute(n,p){if(p==null||this._isSpanEnded())return this;if(n.length===0)return c.diag.warn(`Invalid attribute key: ${n}`),this;if(!(0,u.isAttributeValue)(p))return c.diag.warn(`Invalid attribute value set for key: ${n}`),this;let{attributeCountLimit:h}=this._spanLimits,x=!Object.prototype.hasOwnProperty.call(this.attributes,n);return h!==void 0&&this._attributesCount>=h&&x?(this._droppedAttributesCount++,this):(this.attributes[n]=this._truncateToSize(p),x&&this._attributesCount++,this)}setAttributes(n){for(let c in n)Object.prototype.hasOwnProperty.call(n,c)&&this.setAttribute(c,n[c]);return this}addEvent(n,p,h){if(this._isSpanEnded())return this;let{eventCountLimit:x}=this._spanLimits;if(x===0)return c.diag.warn(`No events allowed.`),this._droppedEventsCount++,this;x!==void 0&&this.events.length>=x&&(this._droppedEventsCount===0&&c.diag.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),(0,u.isTimeInput)(p)&&((0,u.isTimeInput)(h)||(h=p),p=void 0);let w=(0,u.sanitizeAttributes)(p),{attributePerEventCountLimit:T}=this._spanLimits,O={},A=0,j=0;for(let n in w){if(!Object.prototype.hasOwnProperty.call(w,n))continue;let c=w[n];if(T!==void 0&&j>=T){A++;continue}O[n]=this._truncateToSize(c),j++}return this.events.push({name:n,attributes:O,time:this._getTime(h),droppedAttributesCount:A}),this}addLink(n){if(this._isSpanEnded())return this;let{linkCountLimit:p}=this._spanLimits;if(p===0)return this._droppedLinksCount++,this;p!==void 0&&this.links.length>=p&&(this._droppedLinksCount===0&&c.diag.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:h}=this._spanLimits,x=(0,u.sanitizeAttributes)(n.attributes),w={},T=0,O=0;for(let n in x){if(!Object.prototype.hasOwnProperty.call(x,n))continue;let c=x[n];if(h!==void 0&&O>=h){T++;continue}w[n]=this._truncateToSize(c),O++}let A={context:n.context};return O>0&&(A.attributes=w),T>0&&(A.droppedAttributesCount=T),this.links.push(A),this}addLinks(n){for(let c of n)this.addLink(c);return this}setStatus(n){if(this._isSpanEnded()||n.code===c.SpanStatusCode.UNSET||this.status.code===c.SpanStatusCode.OK)return this;let u={code:n.code};return n.code===c.SpanStatusCode.ERROR&&(typeof n.message==`string`?u.message=n.message:n.message!=null&&c.diag.warn(`Dropping invalid status.message of type '${typeof n.message}', expected 'string'`)),this.status=u,this}updateName(n){return this._isSpanEnded()||(this.name=n),this}end(n){if(this._isSpanEnded()){c.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(n),this._duration=(0,u.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(c.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&&c.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(n){if(typeof n==`number`&&n<=u.otperformance.now())return(0,u.hrTime)(n+this._performanceOffset);if(typeof n==`number`)return(0,u.millisToHrTime)(n);if(n instanceof Date)return(0,u.millisToHrTime)(n.getTime());if((0,u.isTimeInputHrTime)(n))return n;if(this._startTimeProvided)return(0,u.millisToHrTime)(Date.now());let c=u.otperformance.now()-this._performanceStartTime;return(0,u.addHrTimes)(this.startTime,(0,u.millisToHrTime)(c))}isRecording(){return this._ended===!1}recordException(n,u){let x={};typeof n==`string`?x[p.ATTR_EXCEPTION_MESSAGE]=n:n&&(n.code?x[p.ATTR_EXCEPTION_TYPE]=n.code.toString():n.name&&(x[p.ATTR_EXCEPTION_TYPE]=n.name),n.message&&(x[p.ATTR_EXCEPTION_MESSAGE]=n.message),n.stack&&(x[p.ATTR_EXCEPTION_STACKTRACE]=n.stack)),x[p.ATTR_EXCEPTION_TYPE]||x[p.ATTR_EXCEPTION_MESSAGE]?this.addEvent(h.ExceptionEventName,x,u):c.diag.warn(`Failed to record an exception ${n}`)}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(){if(this._ended){let n=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,n)}return this._ended}_truncateToLimitUtil(n,c){return n.length<=c?n:n.substring(0,c)}_truncateToSize(n){let u=this._attributeValueLengthLimit;return u<=0?(c.diag.warn(`Attribute value limit must be positive, got ${u}`),n):typeof n==`string`?this._truncateToLimitUtil(n,u):Array.isArray(n)?n.map(n=>typeof n==`string`?this._truncateToLimitUtil(n,u):n):n}}})),require_Sampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=void 0,(function(n){n[n.NOT_RECORD=0]=`NOT_RECORD`,n[n.RECORD=1]=`RECORD`,n[n.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(n.SamplingDecision||={})})),require_AlwaysOffSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOffSampler=void 0;let c=require_Sampler();n.AlwaysOffSampler=class{shouldSample(){return{decision:c.SamplingDecision.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),require_AlwaysOnSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOnSampler=void 0;let c=require_Sampler();n.AlwaysOnSampler=class{shouldSample(){return{decision:c.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),require_ParentBasedSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ParentBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_AlwaysOffSampler(),h=require_AlwaysOnSampler();n.ParentBasedSampler=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(n){this._root=n.root,this._root||=((0,u.globalErrorHandler)(Error(`ParentBasedSampler must have a root sampler configured`)),new h.AlwaysOnSampler),this._remoteParentSampled=n.remoteParentSampled??new h.AlwaysOnSampler,this._remoteParentNotSampled=n.remoteParentNotSampled??new p.AlwaysOffSampler,this._localParentSampled=n.localParentSampled??new h.AlwaysOnSampler,this._localParentNotSampled=n.localParentNotSampled??new p.AlwaysOffSampler}shouldSample(n,u,p,h,x,w){let T=c.trace.getSpanContext(n);return!T||!(0,c.isSpanContextValid)(T)?this._root.shouldSample(n,u,p,h,x,w):T.isRemote?T.traceFlags&c.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(n,u,p,h,x,w):this._remoteParentNotSampled.shouldSample(n,u,p,h,x,w):T.traceFlags&c.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(n,u,p,h,x,w):this._localParentNotSampled.shouldSample(n,u,p,h,x,w)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),require_TraceIdRatioBasedSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Sampler();n.TraceIdRatioBasedSampler=class{_ratio;_upperBound;constructor(n=0){this._ratio=this._normalize(n),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(n,p){return{decision:(0,c.isValidTraceId)(p)&&this._accumulate(p)<this._upperBound?u.SamplingDecision.RECORD_AND_SAMPLED:u.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(n){return typeof n!=`number`||isNaN(n)?0:n>=1?1:n<=0?0:n}_accumulate(n){let c=0;for(let u=0;u<n.length/8;u++){let p=u*8,h=parseInt(n.slice(p,p+8),16);c=(c^h)>>>0}return c}}})),require_config=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.buildSamplerFromEnv=n.loadDefaultConfig=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_AlwaysOffSampler(),h=require_AlwaysOnSampler(),x=require_ParentBasedSampler(),w=require_TraceIdRatioBasedSampler();var T;(function(n){n.AlwaysOff=`always_off`,n.AlwaysOn=`always_on`,n.ParentBasedAlwaysOff=`parentbased_always_off`,n.ParentBasedAlwaysOn=`parentbased_always_on`,n.ParentBasedTraceIdRatio=`parentbased_traceidratio`,n.TraceIdRatio=`traceidratio`})(T||={});let O=1;function A(){return{sampler:j(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}n.loadDefaultConfig=A;function j(){let n=(0,u.getStringFromEnv)(`OTEL_TRACES_SAMPLER`)??T.ParentBasedAlwaysOn;switch(n){case T.AlwaysOn:return new h.AlwaysOnSampler;case T.AlwaysOff:return new p.AlwaysOffSampler;case T.ParentBasedAlwaysOn:return new x.ParentBasedSampler({root:new h.AlwaysOnSampler});case T.ParentBasedAlwaysOff:return new x.ParentBasedSampler({root:new p.AlwaysOffSampler});case T.TraceIdRatio:return new w.TraceIdRatioBasedSampler(N());case T.ParentBasedTraceIdRatio:return new x.ParentBasedSampler({root:new w.TraceIdRatioBasedSampler(N())});default:return c.diag.error(`OTEL_TRACES_SAMPLER value "${n}" invalid, defaulting to "${T.ParentBasedAlwaysOn}".`),new x.ParentBasedSampler({root:new h.AlwaysOnSampler})}}n.buildSamplerFromEnv=j;function N(){let n=(0,u.getNumberFromEnv)(`OTEL_TRACES_SAMPLER_ARG`);return n==null?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1):n<0||n>1?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG=${n} was given, but it is out of range ([0..1]), defaulting to 1.`),1):n}})),require_utility=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.reconfigureLimits=n.mergeConfig=n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;let c=require_config(),u=require_src$3();n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128,n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function p(n){let u={sampler:(0,c.buildSamplerFromEnv)()},p=(0,c.loadDefaultConfig)(),h=Object.assign({},p,u,n);return h.generalLimits=Object.assign({},p.generalLimits,n.generalLimits||{}),h.spanLimits=Object.assign({},p.spanLimits,n.spanLimits||{}),h}n.mergeConfig=p;function h(c){let p=Object.assign({},c.spanLimits);return p.attributeCountLimit=c.spanLimits?.attributeCountLimit??c.generalLimits?.attributeCountLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??n.DEFAULT_ATTRIBUTE_COUNT_LIMIT,p.attributeValueLengthLimit=c.spanLimits?.attributeValueLengthLimit??c.generalLimits?.attributeValueLengthLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},c,{spanLimits:p})}n.reconfigureLimits=h})),require_BatchSpanProcessorBase=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessorBase=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3();n.BatchSpanProcessorBase=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(n,p){this._exporter=n,this._maxExportBatchSize=typeof p?.maxExportBatchSize==`number`?p.maxExportBatchSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`)??512,this._maxQueueSize=typeof p?.maxQueueSize==`number`?p.maxQueueSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_QUEUE_SIZE`)??2048,this._scheduledDelayMillis=typeof p?.scheduledDelayMillis==`number`?p.scheduledDelayMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_SCHEDULE_DELAY`)??5e3,this._exportTimeoutMillis=typeof p?.exportTimeoutMillis==`number`?p.exportTimeoutMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_EXPORT_TIMEOUT`)??3e4,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.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(n,c){}onEnd(n){this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)!==0&&this._addToBuffer(n)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(n){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&c.diag.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(c.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(n),this._maybeStartTimer()}_flushAll(){return new Promise((n,c)=>{let u=[],p=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,c=p;n<c;n++)u.push(this._flushOneBatch());Promise.all(u).then(()=>{n()}).catch(c)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((n,p)=>{let h=setTimeout(()=>{p(Error(`Timeout`))},this._exportTimeoutMillis);c.context.with((0,u.suppressTracing)(c.context.active()),()=>{let c;this._finishedSpans.length<=this._maxExportBatchSize?(c=this._finishedSpans,this._finishedSpans=[]):c=this._finishedSpans.splice(0,this._maxExportBatchSize);let x=()=>this._exporter.export(c,c=>{clearTimeout(h),c.code===u.ExportResultCode.SUCCESS?n():p(c.error??Error(`BatchSpanProcessor: span export failed`))}),w=null;for(let n=0,u=c.length;n<u;n++){let u=c[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(w??=[],w.push(u.resource.waitForAsyncAttributes()))}w===null?x():Promise.all(w).then(x,n=>{(0,u.globalErrorHandler)(n),p(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let n=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,u.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return n();this._timer===void 0&&(this._timer=setTimeout(()=>n(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),require_BatchSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessor=void 0;let c=require_BatchSpanProcessorBase();n.BatchSpanProcessor=class extends c.BatchSpanProcessorBase{onShutdown(){}}})),require_RandomIdGenerator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=void 0;let c=8,u=16;n.RandomIdGenerator=class{generateTraceId=h(16);generateSpanId=h(8)};let p=Buffer.allocUnsafe(16);function h(n){return function(){for(let c=0;c<n/4;c++)p.writeUInt32BE(Math.random()*2**32>>>0,c*4);for(let c=0;c<n&&!(p[c]>0);c++)c===n-1&&(p[n-1]=1);return p.toString(`hex`,0,n)}}})),require_node=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_BatchSpanProcessor();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}});var u=require_RandomIdGenerator();Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}})})),require_platform=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_node();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return c.RandomIdGenerator}})})),require_semconv=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.METRIC_OTEL_SDK_SPAN_STARTED=n.METRIC_OTEL_SDK_SPAN_LIVE=n.ATTR_OTEL_SPAN_SAMPLING_RESULT=n.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0,n.ATTR_OTEL_SPAN_PARENT_ORIGIN=`otel.span.parent.origin`,n.ATTR_OTEL_SPAN_SAMPLING_RESULT=`otel.span.sampling_result`,n.METRIC_OTEL_SDK_SPAN_LIVE=`otel.sdk.span.live`,n.METRIC_OTEL_SDK_SPAN_STARTED=`otel.sdk.span.started`})),require_TracerMetrics=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TracerMetrics=void 0;let c=require_Sampler(),u=require_semconv();n.TracerMetrics=class{startedSpans;liveSpans;constructor(n){this.startedSpans=n.createCounter(u.METRIC_OTEL_SDK_SPAN_STARTED,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=n.createUpDownCounter(u.METRIC_OTEL_SDK_SPAN_LIVE,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(n,x){let w=h(x);if(this.startedSpans.add(1,{[u.ATTR_OTEL_SPAN_PARENT_ORIGIN]:p(n),[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w}),x===c.SamplingDecision.NOT_RECORD)return()=>{};let T={[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w};return this.liveSpans.add(1,T),()=>{this.liveSpans.add(-1,T)}}};function p(n){return n?n.isRemote?`remote`:`local`:`none`}function h(n){switch(n){case c.SamplingDecision.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case c.SamplingDecision.RECORD:return`RECORD_ONLY`;case c.SamplingDecision.NOT_RECORD:return`DROP`}}})),require_version=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_Tracer=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Tracer=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_Span(),h=require_utility(),x=require_platform(),w=require_TracerMetrics(),T=require_version();n.Tracer=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(n,u,p,O){let A=(0,h.mergeConfig)(u);this._sampler=A.sampler,this._generalLimits=A.generalLimits,this._spanLimits=A.spanLimits,this._idGenerator=u.idGenerator||new x.RandomIdGenerator,this._resource=p,this._spanProcessor=O,this.instrumentationScope=n;let j=A.meterProvider?A.meterProvider.getMeter(`@opentelemetry/sdk-trace`,T.VERSION):c.createNoopMeter();this._tracerMetrics=new w.TracerMetrics(j)}startSpan(n,h={},x=c.context.active()){h.root&&(x=c.trace.deleteSpan(x));let w=c.trace.getSpan(x);if((0,u.isTracingSuppressed)(x))return c.diag.debug(`Instrumentation suppressed, returning Noop Span`),c.trace.wrapSpanContext(c.INVALID_SPAN_CONTEXT);let T=w?.spanContext(),O=this._idGenerator.generateSpanId(),A,j,N;!T||!c.trace.isSpanContextValid(T)?j=this._idGenerator.generateTraceId():(j=T.traceId,N=T.traceState,A=T);let I=h.kind??c.SpanKind.INTERNAL,L=(h.links??[]).map(n=>({context:n.context,attributes:(0,u.sanitizeAttributes)(n.attributes)})),z=(0,u.sanitizeAttributes)(h.attributes),B=this._sampler.shouldSample(x,j,n,I,z,L),V=this._tracerMetrics.startSpan(T,B.decision);N=B.traceState??N;let H=B.decision===c.SamplingDecision.RECORD_AND_SAMPLED?c.TraceFlags.SAMPLED:c.TraceFlags.NONE,U={traceId:j,spanId:O,traceFlags:H,traceState:N};if(B.decision===c.SamplingDecision.NOT_RECORD)return c.diag.debug(`Recording is off, propagating context in a non-recording span`),c.trace.wrapSpanContext(U);let W=(0,u.sanitizeAttributes)(Object.assign(z,B.attributes));return new p.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:x,spanContext:U,name:n,kind:I,links:L,parentSpanContext:A,attributes:W,startTime:h.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:V})}startActiveSpan(n,u,p,h){let x,w,T;if(arguments.length<2)return;arguments.length===2?T=u:arguments.length===3?(x=u,T=p):(x=u,w=p,T=h);let O=w??c.context.active(),A=this.startSpan(n,x,O),j=c.trace.setSpan(O,A);return c.context.with(j,T,void 0,A)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),require_MultiSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiSpanProcessor=void 0;let c=require_src$3();n.MultiSpanProcessor=class{_spanProcessors;constructor(n){this._spanProcessors=n}forceFlush(){let n=[];for(let c of this._spanProcessors)n.push(c.forceFlush());return new Promise(u=>{Promise.all(n).then(()=>{u()}).catch(n=>{(0,c.globalErrorHandler)(n||Error(`MultiSpanProcessor: forceFlush failed`)),u()})})}onStart(n,c){for(let u of this._spanProcessors)u.onStart(n,c)}onEnding(n){for(let c of this._spanProcessors)c.onEnding&&c.onEnding(n)}onEnd(n){for(let c of this._spanProcessors)c.onEnd(n)}shutdown(){let n=[];for(let c of this._spanProcessors)n.push(c.shutdown());return new Promise((c,u)=>{Promise.all(n).then(()=>{c()},u)})}}})),require_BasicTracerProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BasicTracerProvider=n.ForceFlushState=void 0;let c=require_src$3(),u=require_src$2(),p=require_Tracer(),h=require_config(),x=require_MultiSpanProcessor(),w=require_utility();var T;(function(n){n[n.resolved=0]=`resolved`,n[n.timeout=1]=`timeout`,n[n.error=2]=`error`,n[n.unresolved=3]=`unresolved`})(T=n.ForceFlushState||={}),n.BasicTracerProvider=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(n={}){let p=(0,c.merge)({},(0,h.loadDefaultConfig)(),(0,w.reconfigureLimits)(n));this._resource=p.resource??(0,u.defaultResource)(),this._config=Object.assign({},p,{resource:this._resource});let T=[];n.spanProcessors?.length&&T.push(...n.spanProcessors),this._activeSpanProcessor=new x.MultiSpanProcessor(T)}getTracer(n,c,u){let h=`${n}@${c||``}:${u?.schemaUrl||``}`;return this._tracers.has(h)||this._tracers.set(h,new p.Tracer({name:n,version:c,schemaUrl:u?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(h)}forceFlush(){let n=this._config.forceFlushTimeoutMillis,c=this._activeSpanProcessor._spanProcessors.map(c=>new Promise(u=>{let p,h=setTimeout(()=>{u(Error(`Span processor did not completed within timeout period of ${n} ms`)),p=T.timeout},n);c.forceFlush().then(()=>{clearTimeout(h),p!==T.timeout&&(p=T.resolved,u(p))}).catch(n=>{clearTimeout(h),p=T.error,u(n)})}));return new Promise((n,u)=>{Promise.all(c).then(c=>{let p=c.filter(n=>n!==T.resolved);p.length>0?u(p):n()}).catch(n=>u([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),require_ConsoleSpanExporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ConsoleSpanExporter=void 0;let c=require_src$3();n.ConsoleSpanExporter=class{export(n,c){return this._sendSpans(n,c)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(n){return{resource:{attributes:n.resource.attributes},instrumentationScope:n.instrumentationScope,traceId:n.spanContext().traceId,parentSpanContext:n.parentSpanContext,traceState:n.spanContext().traceState?.serialize(),name:n.name,id:n.spanContext().spanId,kind:n.kind,timestamp:(0,c.hrTimeToMicroseconds)(n.startTime),duration:(0,c.hrTimeToMicroseconds)(n.duration),attributes:n.attributes,status:n.status,events:n.events,links:n.links}}_sendSpans(n,u){for(let c of n)console.dir(this._exportInfo(c),{depth:3});if(u)return u({code:c.ExportResultCode.SUCCESS})}}})),require_InMemorySpanExporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InMemorySpanExporter=void 0;let c=require_src$3();n.InMemorySpanExporter=class{_finishedSpans=[];_stopped=!1;export(n,u){if(this._stopped)return u({code:c.ExportResultCode.FAILED,error:Error(`Exporter has been stopped`)});this._finishedSpans.push(...n),setTimeout(()=>u({code:c.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}})),require_SimpleSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SimpleSpanProcessor=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3();n.SimpleSpanProcessor=class{_exporter;_shutdownOnce;_pendingExports;constructor(n){this._exporter=n,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(n,c){}onEnd(n){if(this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)===0)return;let p=this._doExport(n).catch(n=>(0,u.globalErrorHandler)(n));this._pendingExports.add(p),p.finally(()=>this._pendingExports.delete(p))}async _doExport(n){n.resource.asyncAttributesPending&&await n.resource.waitForAsyncAttributes?.();let c=await u.internal._export(this._exporter,[n]);if(c.code!==u.ExportResultCode.SUCCESS)throw c.error??Error(`SimpleSpanProcessor: span export failed (status ${c})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}})),require_NoopSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NoopSpanProcessor=void 0,n.NoopSpanProcessor=class{onStart(n,c){}onEnd(n){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}})),require_src$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=n.TraceIdRatioBasedSampler=n.ParentBasedSampler=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NoopSpanProcessor=n.SimpleSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.RandomIdGenerator=n.BatchSpanProcessor=n.BasicTracerProvider=void 0;var c=require_BasicTracerProvider();Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return c.BasicTracerProvider}});var u=require_platform();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}});var p=require_ConsoleSpanExporter();Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return p.ConsoleSpanExporter}});var h=require_InMemorySpanExporter();Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return h.InMemorySpanExporter}});var x=require_SimpleSpanProcessor();Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return x.SimpleSpanProcessor}});var w=require_NoopSpanProcessor();Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return w.NoopSpanProcessor}});var T=require_AlwaysOffSampler();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return T.AlwaysOffSampler}});var O=require_AlwaysOnSampler();Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return O.AlwaysOnSampler}});var A=require_ParentBasedSampler();Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return A.ParentBasedSampler}});var j=require_TraceIdRatioBasedSampler();Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return j.TraceIdRatioBasedSampler}});var N=require_Sampler();Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return N.SamplingDecision}})})),require_NodeTracerProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NodeTracerProvider=void 0;let c=require_src$15(),u=require_src$1(),p=(init_esm$2(),__toCommonJS(esm_exports$2)),h=require_src$3();function x(n){if(n!==null){if(n===void 0){let n=new c.AsyncLocalStorageContextManager;n.enable(),p.context.setGlobalContextManager(n);return}n.enable(),p.context.setGlobalContextManager(n)}}function w(n){if(n!==null){if(n===void 0){p.propagation.setGlobalPropagator(new h.CompositePropagator({propagators:[new h.W3CTraceContextPropagator,new h.W3CBaggagePropagator]}));return}p.propagation.setGlobalPropagator(n)}}n.NodeTracerProvider=class extends u.BasicTracerProvider{constructor(n={}){super(n)}register(n={}){p.trace.setGlobalTracerProvider(this),x(n.contextManager),w(n.propagator)}}})),require_src=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=n.SimpleSpanProcessor=n.SamplingDecision=n.RandomIdGenerator=n.ParentBasedSampler=n.NoopSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.BatchSpanProcessor=n.BasicTracerProvider=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NodeTracerProvider=void 0;var c=require_NodeTracerProvider();Object.defineProperty(n,`NodeTracerProvider`,{enumerable:!0,get:function(){return c.NodeTracerProvider}});var u=require_src$1();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return u.AlwaysOffSampler}}),Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return u.AlwaysOnSampler}}),Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return u.BasicTracerProvider}}),Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return u.ConsoleSpanExporter}}),Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return u.InMemorySpanExporter}}),Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return u.NoopSpanProcessor}}),Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return u.ParentBasedSampler}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}}),Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return u.SamplingDecision}}),Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return u.SimpleSpanProcessor}}),Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return u.TraceIdRatioBasedSampler}})}));init_esm$2();var import_src=require_src$17(),import_src$1=require_src$16(),import_src$2=require_src$15(),import_src$3=require_src$18(),import_src$4=require_src$10(),import_src$5=require_src$9(),import_src$6=require_src$8(),import_src$7=require_src$7(),import_src$8=require_src$6(),import_src$9=require_src$5(),import_src$10=require_src$4(),import_src$11=require_src();const TRAILING_SLASH_PATTERN=/\/+$/,SIGNAL_SUFFIX_PATTERN=/\/v1\/(logs|metrics|traces)$/,normalizeOtlpSignalEndpoint=(n,c)=>{if(!n)throw Error(`OTEL_EXPORTER_OTLP_ENDPOINT is required when OTEL_ENABLED=true`);let u=n.replace(TRAILING_SLASH_PATTERN,``);return u.endsWith(`/v1/${c}`)?u:SIGNAL_SUFFIX_PATTERN.test(u)?u.replace(SIGNAL_SUFFIX_PATTERN,`/v1/${c}`):`${u}/v1/${c}`},parseOtlpHeaders=n=>{let c=n?.trim();return c?c.split(`,`).map(n=>n.trim()).filter(Boolean).reduce((n,c)=>{let u=c.indexOf(`=`);if(u<=0)return n;let p=c.slice(0,u).trim(),h=c.slice(u+1).trim();return!p||!h||(n[p]=h),n},{}):{}},scopeStorage=new AsyncLocalStorage,compactScopeAttributes=n=>{let c={};for(let[u,p]of Object.entries(n))p!=null&&(c[u]=p);return c},getCurrentScopeAttributes=()=>scopeStorage.getStore()??{},mergeScopeAttributes=(n,c)=>compactScopeAttributes({...n,...c}),runWithScopeAttributes=(n,c)=>{let u=mergeScopeAttributes(getCurrentScopeAttributes(),n);return scopeStorage.run(u,c)},normalizeError=n=>n instanceof Error?{message:n.message,name:n.name,...n.stack?{stack:n.stack}:{}}:{message:String(n),name:`Error`},toExceptionAttributes=n=>{let c=normalizeError(n.error),u=mergeScopeAttributes(getCurrentScopeAttributes(),n.attributes??{}),p={};for(let[n,c]of Object.entries(u))c!=null&&(p[n]=c);return p[`echo.exception.handled`]=n.handled,p[`echo.exception.level`]=n.level,p[`echo.exception.mechanism`]=n.mechanism,p[`error.message`]=c.message,p[`error.type`]=c.name,n.fingerprint&&n.fingerprint.length>0&&(p[`echo.exception.fingerprint`]=n.fingerprint.join(`,`)),p},setSpanErrorStatus=(n,c)=>{let u=normalizeError(c);n.setStatus({code:SpanStatusCode.ERROR,message:u.message})},recordExceptionOnSpan=(n,c)=>{let u=normalizeError(c.error);n.setAttributes(toExceptionAttributes(c)),n.recordException({message:u.message,name:u.name,...u.stack?{stack:u.stack}:{}}),setSpanErrorStatus(n,c.error)},captureExceptionAsSpan=n=>{let c={...n.exception,attributes:mergeScopeAttributes(n.spanAttributes??{},n.exception.attributes??{})},u=trace.getSpan(context$1.active());if(u){recordExceptionOnSpan(u,c);return}let p=trace.getTracer(n.serviceName).startSpan(n.spanName??`observability.exception`,{attributes:toExceptionAttributes(c)});recordExceptionOnSpan(p,c),p.end()},NODE_OTEL_RESOURCE_DETECTORS=[import_src.envDetector,import_src.processDetector,import_src.hostDetector,import_src.osDetector],buildNodeOtelResourceAttributes=n=>({"deployment.environment":n.environment,"echo.client_app":n.clientApp,"echo.runtime":n.runtime,"service.name":n.serviceName,"service.version":n.serviceVersion??`unknown`}),createNodeOtelResource=async n=>{let c=(0,import_src.defaultResource)().merge((0,import_src.detectResources)({detectors:NODE_OTEL_RESOURCE_DETECTORS})).merge((0,import_src.resourceFromAttributes)(buildNodeOtelResourceAttributes(n)));return await c.waitForAsyncAttributes?.(),c},DEFAULT_EXPORT_INTERVAL_MS=5e3,createNoopRuntimeHandle=n=>({forceFlush:async()=>{},shutdown:async()=>{},tracer:trace.getTracer(n)}),startNodeOtelRuntime=async n=>{if(n.sdk.debug&&diag.setLogger(new DiagConsoleLogger,DiagLogLevel.INFO),!n.sdk.enabled)return createNoopRuntimeHandle(n.resource.serviceName);let c=parseOtlpHeaders(n.sdk.exporterHeadersRaw),u=await createNodeOtelResource(n.resource),p=new import_src$11.NodeTracerProvider({resource:u,spanProcessors:[new import_src$10.BatchSpanProcessor(new import_src$6.OTLPTraceExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`traces`)}))],sampler:new import_src$10.TraceIdRatioBasedSampler(n.sdk.traceSamplingRatio)});p.register({contextManager:new import_src$2.AsyncLocalStorageContextManager,propagator:new import_src$3.CompositePropagator({propagators:[new import_src$3.W3CBaggagePropagator,new import_src$3.W3CTraceContextPropagator]})});let h=new import_src$9.MeterProvider({readers:[new import_src$9.PeriodicExportingMetricReader({exporter:new import_src$5.OTLPMetricExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`metrics`)}),exportIntervalMillis:DEFAULT_EXPORT_INTERVAL_MS})],resource:u});metrics.setGlobalMeterProvider(h);let x=new import_src$8.LoggerProvider({processors:[new import_src$8.BatchLogRecordProcessor(new import_src$4.OTLPLogExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`logs`)}))],resource:u});import_src$1.logs.setGlobalLoggerProvider(x);let w=(0,import_src$7.registerInstrumentations)({instrumentations:n.instrumentations??[]}),T=!1;return{forceFlush:async()=>{await Promise.all([p.forceFlush(),h.forceFlush(),x.forceFlush()])},shutdown:async()=>{T||(T=!0,w(),await Promise.all([p.shutdown(),h.shutdown(),x.shutdown()]))},tracer:trace.getTracer(n.resource.serviceName)}},runWithNewSpan=async(n,c)=>{let u=trace.getTracer(n.serviceName),p=n.root?ROOT_CONTEXT:n.parentContext??context$1.active();return await context$1.with(p,async()=>await u.startActiveSpan(n.name,{attributes:n.attributes,kind:n.kind},async n=>{try{return await c()}catch(c){let u=normalizeError(c);throw n.recordException({message:u.message,name:u.name,...u.stack?{stack:u.stack}:{}}),setSpanErrorStatus(n,c),c}finally{n.end()}}))};let EchoNodeRuntime=function(n){return n.BACKEND=`backend`,n.CLI=`cli`,n.DESKTOP_MAIN=`desktop_main`,n}({}),EchoNodeClientApp=function(n){return n.ECHO_BACKEND=`echo-backend`,n.ECHO_CLI=`echo-cli`,n.ECHO_CLIENT=`echo-client`,n.ECHO_SKILLS_SERVICE=`echo-skills-service`,n}({}),NodeOtelExceptionMechanism=function(n){return n.BOOTSTRAP_FAILURE=`bootstrap_failure`,n.COMMAND_FAILURE=`command_failure`,n.IPC_FAILURE=`ipc_failure`,n.UNCAUGHT_EXCEPTION=`uncaughtException`,n.UNHANDLED_REJECTION=`unhandledRejection`,n.WINDOW_FAILURE=`window_failure`,n}({});const FLUSH_TIMEOUT_MS=1500,runtimeState={runtime:null,startPromise:null};let hasRegisteredProcessHandlers=!1;const parseBoolean=n=>{if(typeof n!=`string`)return!1;let c=trimAndLowercase(n);return c===`1`||c===`true`},getCliServiceName=()=>process.env.OTEL_SERVICE_NAME?.trim()||`cli`,getCliEnvironment=()=>process.env.OBSERVABILITY_ENVIRONMENT?.trim()||process.env.NODE_ENV?.trim()||`development`,getCliRuntime=()=>runtimeState.runtime??{backend:`none`},resolveCliObservabilityConfig=()=>({enabled:parseBoolean(process.env.OTEL_ENABLED),environment:getCliEnvironment(),exporterEndpoint:process.env.OTEL_EXPORTER_OTLP_ENDPOINT,exporterHeadersRaw:process.env.OTEL_EXPORTER_OTLP_HEADERS,serviceName:getCliServiceName(),serviceVersion:process.env.npm_package_version,traceSamplingRatio:Number(process.env.OTEL_TRACE_SAMPLING_RATIO??`1`)}),flushWithTimeout=async n=>{let c=getCliRuntime();if(c.backend===`none`)return!0;if(c.backend===`sentry`)return await getCliObservability().flush(n);try{return await Promise.race([c.handle.forceFlush(),new Promise((c,u)=>{setTimeout(()=>{u(Error(`cli otel flush timeout`))},n)})]),!0}catch{return!1}},captureCliOtelException=(n,c,u,p,h)=>{captureExceptionAsSpan({exception:{attributes:h,error:n,handled:u,level:p,mechanism:c},serviceName:getCliServiceName(),spanName:`cli.exception`})},captureCliSentryException=(n,c,u)=>{getCliObservability().captureException(n,{contexts:u?{cli:u}:void 0,level:c,tags:{crash_surface:`cli`}})},captureCliException=(n,c,u,p,h)=>{if(isExpectedNetworkLifecycleError(n))return;let x=getCliRuntime();if(x.backend===`sentry`){captureCliSentryException(n,p,h);return}x.backend===`otel`&&captureCliOtelException(n,c,u,p,h)},registerProcessHandlers=()=>{hasRegisteredProcessHandlers||=(process.on(`uncaughtException`,n=>{captureCliException(n,NodeOtelExceptionMechanism.UNCAUGHT_EXCEPTION,!1,`fatal`,{"echo.command.phase":`process`})}),process.on(`unhandledRejection`,n=>{captureCliException(n,NodeOtelExceptionMechanism.UNHANDLED_REJECTION,!1,`error`,{"echo.command.phase":`process`})}),!0)},startCliObservability=async()=>{if(runtimeState.runtime)return;if(runtimeState.startPromise){await runtimeState.startPromise.catch(()=>void 0);return}let n=(async()=>{let n=resolveCliNodeObservabilityBackendName();if(n===`sentry`)return getCliObservability(),registerProcessHandlers(),{backend:n};if(n===`none`)return registerProcessHandlers(),{backend:n};let c=resolveCliObservabilityConfig(),u=null;try{return u=await startNodeOtelRuntime({resource:{clientApp:EchoNodeClientApp.ECHO_CLI,environment:c.environment,runtime:EchoNodeRuntime.CLI,serviceName:c.serviceName,serviceVersion:c.serviceVersion},sdk:{enabled:c.enabled,exporterEndpoint:c.exporterEndpoint,exporterHeadersRaw:c.exporterHeadersRaw,traceSamplingRatio:c.traceSamplingRatio}}),registerProcessHandlers(),{backend:n,handle:u}}catch(n){throw u&&await u.shutdown().catch(()=>void 0),n}})();runtimeState.startPromise=n;try{runtimeState.runtime=await n}catch(n){console.warn(`Failed to start CLI observability; continuing without telemetry`,n),runtimeState.runtime=null}finally{runtimeState.startPromise===n&&(runtimeState.startPromise=null)}},shutdownCliObservability=async()=>{try{await runtimeState.startPromise}catch{}await flushWithTimeout(FLUSH_TIMEOUT_MS);let n=getCliRuntime();runtimeState.runtime=null,n.backend===`otel`&&await n.handle.shutdown().catch(()=>void 0)},reportCliCommandFailure=async(n,c)=>{captureCliException(n,NodeOtelExceptionMechanism.COMMAND_FAILURE,!0,`error`,{"echo.command.name":c}),await flushWithTimeout(FLUSH_TIMEOUT_MS)},runCliCommandSpan=async(n,c)=>{let u={"echo.command.cwd_basename":path.basename(n.cwd),"echo.command.interactive":n.interactive,"echo.command.name":n.commandName},p=getCliRuntime();if(p.backend===`sentry`){let p=getCliObservability().startSpan({attributes:u,name:`cli.command ${n.commandName}`,op:`cli.command`});try{let n=await c();return p.finish({status:`ok`}),n}catch(n){throw p.finish({status:`internal_error`}),n}}return p.backend===`otel`?await runWithScopeAttributes(u,async()=>await runWithNewSpan({attributes:u,name:`cli.command ${n.commandName}`,root:!0,serviceName:getCliServiceName()},c)):await c()},resolveCliCommandName=n=>{let c=n[0]?.trim();return!c||c.startsWith(`-`)?`default`:c},packageRoot=resolve(dirname(fileURLToPath(import.meta.url)),`..`),loadCliEnv=()=>{for(let n of[resolve(packageRoot,`.env`),resolve(packageRoot,`.env.local`),resolve(process.cwd(),`.env`),resolve(process.cwd(),`.env.local`)])existsSync(n)&&(0,import_main.config)({path:n,override:!1})},buildCli=()=>{let n=cac(CLI_BRAND.command);return n.usage(`[--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--non-interactive`,`Run headless login or runtime output`).option(`--skip-update-check`,`Skip update checks for this command`).option(`--token <token>`,`Bootstrap login token`).option(`--base-url <host[:port][/path]>`,`Backend host[:port][/path] without scheme`).option(`--ssl`,`Use SSL for derived HTTP/WebSocket endpoints`).option(`--method <method>`,`Login method for headless login (${LOGIN_METHOD_OPTIONS_TEXT})`),n.command(``,`Start the interactive TUI shell`).usage(`[--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).action(async n=>{if(n.nonInteractive)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);await runInteractiveApp({initialUpdateState:await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck}),baseUrl:n.baseUrl,ssl:n.ssl,token:n.token})}),n.command(`login`,`Headless login`).usage(`login --non-interactive [--token <token>] [--method <method>] [--base-url <host[:port][/path]>] [--no-ssl]`).action(async n=>{if(n.nonInteractive!==!0)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck}),await runNonInteractiveLoginCommand({baseUrl:n.baseUrl,method:n.method,ssl:n.ssl,token:n.token})}),n.command(`run`,`Headless runtime logs`).usage(`run --non-interactive [--prevent-sleep] [--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--prevent-sleep`,`On macOS, keep the system from idle sleeping while this run process is alive`).action(async n=>{if(n.nonInteractive!==!0)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);let c=await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck});await runNonInteractiveRunCommand({baseUrl:n.baseUrl,initialUpdateState:c,preventSleep:n.preventSleep,ssl:n.ssl,token:n.token})}),n.command(`logout`,`Clear the persisted CLI session`).usage(`logout`).action(async()=>{await runLogoutCommand()}),n.command(`service <action>`,`Manage the Syncless background service`).usage(`service <install|status|logs|stop|uninstall> [--target systemd-user] [--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--target <target>`,`Service manager target (auto, systemd-user)`).option(`--working-directory <path>`,`Working directory published by the service runtime`).option(`--enable-linger`,`Run loginctl enable-linger for the current user after systemd install`).action(async(n,c)=>{await runServiceCommand(n,{baseUrl:c.baseUrl,enableLinger:c.enableLinger===!0,ssl:c.ssl,target:c.target,token:c.token,workingDirectory:c.workingDirectory})}),n.command(`device <action> [deviceCode]`,`Manage the persisted device code`).usage(`device <set|clear> [deviceCode]`).action(async(n,c)=>{if(n===`set`){if(typeof c!=`string`||c.trim().length===0)throw Error(`Usage: ${CLI_BRAND.command} device set <deviceCode>`);await runDeviceSetCommand(c.trim());return}if(n===`clear`){if(typeof c==`string`&&c.trim().length>0)throw Error(`Usage: ${CLI_BRAND.command} device clear`);await runDeviceClearCommand();return}throw Error(`Unknown device command. Use \`${CLI_BRAND.command} device set <deviceCode>\` or \`${CLI_BRAND.command} device clear\`.`)}),n.help(n=>[...n,{title:`Notes`,body:[` \`${CLI_BRAND.command}\` starts the interactive TUI shell.`,` Headless usage is command-first: \`${CLI_BRAND.command} login --non-interactive\` or \`${CLI_BRAND.command} run --non-interactive\`.`,` Pass \`${CLI_BRAND.command} run --non-interactive --prevent-sleep\` or set \`${CLI_BRAND.envPrefix}_PREVENT_SLEEP=1\` to keep macOS from idle sleeping while a headless run is active.`,` Set \`${CLI_BRAND.envPrefix}_SKIP_UPDATE_CHECK=1\` or pass \`--skip-update-check\` to bypass update checks.`].join(`
|
|
499
|
+
`,(0,p.getConflictResolutionRecipe)(h,n))}return x}}})),require_MultiWritableMetricStorage=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiMetricStorage=void 0,n.MultiMetricStorage=class{_backingStorages;constructor(n){this._backingStorages=n}record(n,c,u,p){this._backingStorages.forEach(h=>{h.record(n,c,u,p)})}}})),require_ObservableResult=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchObservableResultImpl=n.ObservableResultImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_HashMap(),p=require_Instruments();n.ObservableResultImpl=class{_buffer=new u.AttributeHashMap;_instrumentName;_valueType;constructor(n,c){this._instrumentName=n,this._valueType=c}observe(n,u={}){if(typeof n!=`number`){c.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${n}`);return}this._valueType===c.ValueType.INT&&!Number.isInteger(n)&&(c.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),n=Math.trunc(n),!Number.isInteger(n))||this._buffer.set(u,n)}},n.BatchObservableResultImpl=class{_buffer=new Map;observe(n,h,x={}){if(!(0,p.isObservableInstrument)(n))return;let w=this._buffer.get(n);if(w??(w=new u.AttributeHashMap,this._buffer.set(n,w)),typeof h!=`number`){c.diag.warn(`non-number value provided to metric ${n._descriptor.name}: ${h}`);return}n._descriptor.valueType===c.ValueType.INT&&!Number.isInteger(h)&&(c.diag.warn(`INT value type cannot accept a floating-point value for ${n._descriptor.name}, ignoring the fractional digits.`),h=Math.trunc(h),!Number.isInteger(h))||w.set(x,h)}}})),require_ObservableRegistry=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ObservableRegistry=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Instruments(),p=require_ObservableResult(),h=require_utils$3();n.ObservableRegistry=class{_callbacks=[];_batchCallbacks=[];addCallback(n,c){this._findCallback(n,c)>=0||this._callbacks.push({callback:n,instrument:c})}removeCallback(n,c){let u=this._findCallback(n,c);u<0||this._callbacks.splice(u,1)}addBatchCallback(n,p){let h=new Set(p.filter(u.isObservableInstrument));if(h.size===0){c.diag.error(`BatchObservableCallback is not associated with valid instruments`,p);return}this._findBatchCallback(n,h)>=0||this._batchCallbacks.push({callback:n,instruments:h})}removeBatchCallback(n,c){let p=new Set(c.filter(u.isObservableInstrument)),h=this._findBatchCallback(n,p);h<0||this._batchCallbacks.splice(h,1)}async observe(n,c){let u=this._observeCallbacks(n,c),p=this._observeBatchCallbacks(n,c);return(await Promise.allSettled([...u,...p])).filter(n=>n.status===`rejected`).map(n=>n.reason)}_observeCallbacks(n,c){return this._callbacks.map(async({callback:u,instrument:x})=>{let w=new p.ObservableResultImpl(x._descriptor.name,x._descriptor.valueType),T=Promise.resolve(u(w));c!=null&&(T=(0,h.callWithTimeout)(T,c)),await T,x._metricStorages.forEach(c=>{c.record(w._buffer,n)})})}_observeBatchCallbacks(n,c){return this._batchCallbacks.map(async({callback:u,instruments:x})=>{let w=new p.BatchObservableResultImpl,T=Promise.resolve(u(w));c!=null&&(T=(0,h.callWithTimeout)(T,c)),await T,x.forEach(c=>{let u=w._buffer.get(c);u!=null&&c._metricStorages.forEach(c=>{c.record(u,n)})})})}_findCallback(n,c){return this._callbacks.findIndex(u=>u.callback===n&&u.instrument===c)}_findBatchCallback(n,c){return this._batchCallbacks.findIndex(u=>u.callback===n&&(0,h.setEquals)(u.instruments,c))}}})),require_SyncMetricStorage=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SyncMetricStorage=void 0;let c=require_MetricStorage(),u=require_DeltaMetricProcessor(),p=require_TemporalMetricProcessor();n.SyncMetricStorage=class extends c.MetricStorage{_aggregationCardinalityLimit;_deltaMetricStorage;_temporalMetricStorage;_attributesProcessor;constructor(n,c,h,x,w){super(n),this._aggregationCardinalityLimit=w,this._deltaMetricStorage=new u.DeltaMetricProcessor(c,this._aggregationCardinalityLimit),this._temporalMetricStorage=new p.TemporalMetricProcessor(c,x),this._attributesProcessor=h}record(n,c,u,p){c=this._attributesProcessor.process(c,u),this._deltaMetricStorage.record(n,c,u,p)}collect(n,c){let u=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(n,this._instrumentDescriptor,u,c)}}})),require_AttributesProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.createDenyListAttributesProcessor=n.createAllowListAttributesProcessor=n.createMultiAttributesProcessor=n.createNoopAttributesProcessor=void 0;var c=class{process(n,c){return n}},u=class{_processors;constructor(n){this._processors=n}process(n,c){let u=n;for(let n of this._processors)u=n.process(u,c);return u}},p=class{_allowedAttributeNames;constructor(n){this._allowedAttributeNames=n}process(n,c){let u={};return Object.keys(n).forEach(c=>{this._allowedAttributeNames.includes(c)&&(u[c]=n[c])}),u}},h=class{_deniedAttributeNames;constructor(n){this._deniedAttributeNames=n}process(n,c){let u={};return Object.keys(n).forEach(c=>{this._deniedAttributeNames.includes(c)||(u[c]=n[c])}),u}};function x(){return A}n.createNoopAttributesProcessor=x;function w(n){return new u(n)}n.createMultiAttributesProcessor=w;function T(n){return new p(n)}n.createAllowListAttributesProcessor=T;function O(n){return new h(n)}n.createDenyListAttributesProcessor=O;let A=new c})),require_MeterSharedState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterSharedState=void 0;let c=require_InstrumentDescriptor(),u=require_Meter(),p=require_AsyncMetricStorage(),h=require_MetricStorageRegistry(),x=require_MultiWritableMetricStorage(),w=require_ObservableRegistry(),T=require_SyncMetricStorage(),O=require_AttributesProcessor();n.MeterSharedState=class{metricStorageRegistry=new h.MetricStorageRegistry;observableRegistry=new w.ObservableRegistry;meter;_meterProviderSharedState;_instrumentationScope;constructor(n,c){this.meter=new u.Meter(this),this._meterProviderSharedState=n,this._instrumentationScope=c}registerMetricStorage(n){let c=this._registerMetricStorage(n,T.SyncMetricStorage);return c.length===1?c[0]:new x.MultiMetricStorage(c)}registerAsyncMetricStorage(n){return this._registerMetricStorage(n,p.AsyncMetricStorage)}async collect(n,c,u){let p=await this.observableRegistry.observe(c,u?.timeoutMillis),h=this.metricStorageRegistry.getStorages(n);if(h.length===0)return null;let x=[];return h.forEach(u=>{let p=u.collect(n,c);p!=null&&x.push(p)}),x.length===0?{errors:p}:{scopeMetrics:{scope:this._instrumentationScope,metrics:x},errors:p}}_registerMetricStorage(n,u){let p=this._meterProviderSharedState.viewRegistry.findViews(n,this._instrumentationScope).map(p=>{let h=(0,c.createInstrumentDescriptorWithView)(p,n),x=this.metricStorageRegistry.findOrUpdateCompatibleStorage(h);if(x!=null)return x;let w=new u(h,p.aggregation.createAggregator(h),p.attributesProcessor,this._meterProviderSharedState.metricCollectors,p.aggregationCardinalityLimit);return this.metricStorageRegistry.register(w),w});if(p.length===0){let c=this._meterProviderSharedState.selectAggregations(n.type).map(([c,p])=>{let h=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(c,n);if(h!=null)return h;let x=p.createAggregator(n),w=c.selectCardinalityLimit(n.type),T=new u(n,x,(0,O.createNoopAttributesProcessor)(),[c],w);return this.metricStorageRegistry.registerForCollector(c,T),T});p=p.concat(c)}return p}}})),require_MeterProviderSharedState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterProviderSharedState=void 0;let c=require_utils$3(),u=require_ViewRegistry(),p=require_MeterSharedState(),h=require_AggregationOption();n.MeterProviderSharedState=class{viewRegistry=new u.ViewRegistry;metricCollectors=[];meterSharedStates=new Map;resource;constructor(n){this.resource=n}getMeterSharedState(n){let u=(0,c.instrumentationScopeId)(n),h=this.meterSharedStates.get(u);return h??(h=new p.MeterSharedState(this,n),this.meterSharedStates.set(u,h)),h}selectAggregations(n){let c=[];for(let u of this.metricCollectors)c.push([u,(0,h.toAggregation)(u.selectAggregation(n))]);return c}}})),require_MetricCollector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MetricCollector=void 0;let c=require_src$18();n.MetricCollector=class{_sharedState;_metricReader;constructor(n,c){this._sharedState=n,this._metricReader=c}async collect(n){let u=(0,c.millisToHrTime)(Date.now()),p=[],h=[],x=Array.from(this._sharedState.meterSharedStates.values()).map(async c=>{let x=await c.collect(this,u,n);x?.scopeMetrics!=null&&p.push(x.scopeMetrics),x?.errors!=null&&h.push(...x.errors)});return await Promise.all(x),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:p},errors:h}}async forceFlush(n){await this._metricReader.forceFlush(n)}async shutdown(n){await this._metricReader.shutdown(n)}selectAggregationTemporality(n){return this._metricReader.selectAggregationTemporality(n)}selectAggregation(n){return this._metricReader.selectAggregation(n)}selectCardinalityLimit(n){return this._metricReader.selectCardinalityLimit?.(n)??2e3}}})),require_Predicate=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExactPredicate=n.PatternPredicate=void 0;let c=/[\^$\\.+?()[\]{}|]/g;n.PatternPredicate=class n{_matchAll;_regexp;constructor(c){c===`*`?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(n.escapePattern(c)))}match(n){return this._matchAll?!0:this._regexp.test(n)}static escapePattern(n){return`^${n.replace(c,`\\$&`).replace(`*`,`.*`)}$`}static hasWildcard(n){return n.includes(`*`)}},n.ExactPredicate=class{_matchAll;_pattern;constructor(n){this._matchAll=n===void 0,this._pattern=n}match(n){return!!(this._matchAll||n===this._pattern)}}})),require_InstrumentSelector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InstrumentSelector=void 0;let c=require_Predicate();n.InstrumentSelector=class{_nameFilter;_type;_unitFilter;constructor(n){this._nameFilter=new c.PatternPredicate(n?.name??`*`),this._type=n?.type,this._unitFilter=new c.ExactPredicate(n?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}}})),require_MeterSelector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterSelector=void 0;let c=require_Predicate();n.MeterSelector=class{_nameFilter;_versionFilter;_schemaUrlFilter;constructor(n){this._nameFilter=new c.ExactPredicate(n?.name),this._versionFilter=new c.ExactPredicate(n?.version),this._schemaUrlFilter=new c.ExactPredicate(n?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}}})),require_View=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.View=void 0;let c=require_Predicate(),u=require_AttributesProcessor(),p=require_InstrumentSelector(),h=require_MeterSelector(),x=require_AggregationOption();function w(n){return n.instrumentName==null&&n.instrumentType==null&&n.instrumentUnit==null&&n.meterName==null&&n.meterVersion==null&&n.meterSchemaUrl==null}function T(n){if(w(n))throw Error(`Cannot create view with no selector arguments supplied`);if(n.name!=null&&(n?.instrumentName==null||c.PatternPredicate.hasWildcard(n.instrumentName)))throw Error(`Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.`)}n.View=class{name;description;aggregation;attributesProcessor;instrumentSelector;meterSelector;aggregationCardinalityLimit;constructor(n){T(n),n.attributesProcessors==null?this.attributesProcessor=(0,u.createNoopAttributesProcessor)():this.attributesProcessor=(0,u.createMultiAttributesProcessor)(n.attributesProcessors),this.name=n.name,this.description=n.description,this.aggregation=(0,x.toAggregation)(n.aggregation??{type:x.AggregationType.DEFAULT}),this.instrumentSelector=new p.InstrumentSelector({name:n.instrumentName,type:n.instrumentType,unit:n.instrumentUnit}),this.meterSelector=new h.MeterSelector({name:n.meterName,version:n.meterVersion,schemaUrl:n.meterSchemaUrl}),this.aggregationCardinalityLimit=n.aggregationCardinalityLimit}}})),require_MeterProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MeterProvider=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$17(),p=require_MeterProviderSharedState(),h=require_MetricCollector(),x=require_View();n.MeterProvider=class{_sharedState;_shutdown=!1;constructor(n){if(this._sharedState=new p.MeterProviderSharedState(n?.resource??(0,u.defaultResource)()),n?.views!=null&&n.views.length>0)for(let c of n.views)this._sharedState.viewRegistry.addView(new x.View(c));if(n?.readers!=null&&n.readers.length>0)for(let c of n.readers){let n=new h.MetricCollector(this._sharedState,c);c.setMetricProducer(n),this._sharedState.metricCollectors.push(n)}}getMeter(n,u=``,p={}){return this._shutdown?(c.diag.warn(`A shutdown MeterProvider cannot provide a Meter`),(0,c.createNoopMeter)()):this._sharedState.getMeterSharedState({name:n,version:u,schemaUrl:p.schemaUrl}).meter}async shutdown(n){if(this._shutdown){c.diag.warn(`shutdown may only be called once per MeterProvider`);return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(c=>c.shutdown(n)))}async forceFlush(n){if(this._shutdown){c.diag.warn(`invalid attempt to force flush after MeterProvider shutdown`);return}await Promise.all(this._sharedState.metricCollectors.map(c=>c.forceFlush(n)))}}})),require_src$5=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TimeoutError=n.createDenyListAttributesProcessor=n.createAllowListAttributesProcessor=n.AggregationType=n.MeterProvider=n.ConsoleMetricExporter=n.InMemoryMetricExporter=n.PeriodicExportingMetricReader=n.MetricReader=n.InstrumentType=n.DataPointType=n.AggregationTemporality=void 0;var c=require_AggregationTemporality();Object.defineProperty(n,`AggregationTemporality`,{enumerable:!0,get:function(){return c.AggregationTemporality}});var u=require_MetricData();Object.defineProperty(n,`DataPointType`,{enumerable:!0,get:function(){return u.DataPointType}}),Object.defineProperty(n,`InstrumentType`,{enumerable:!0,get:function(){return u.InstrumentType}});var p=require_MetricReader();Object.defineProperty(n,`MetricReader`,{enumerable:!0,get:function(){return p.MetricReader}});var h=require_PeriodicExportingMetricReader();Object.defineProperty(n,`PeriodicExportingMetricReader`,{enumerable:!0,get:function(){return h.PeriodicExportingMetricReader}});var x=require_InMemoryMetricExporter();Object.defineProperty(n,`InMemoryMetricExporter`,{enumerable:!0,get:function(){return x.InMemoryMetricExporter}});var w=require_ConsoleMetricExporter();Object.defineProperty(n,`ConsoleMetricExporter`,{enumerable:!0,get:function(){return w.ConsoleMetricExporter}});var T=require_MeterProvider();Object.defineProperty(n,`MeterProvider`,{enumerable:!0,get:function(){return T.MeterProvider}});var O=require_AggregationOption();Object.defineProperty(n,`AggregationType`,{enumerable:!0,get:function(){return O.AggregationType}});var A=require_AttributesProcessor();Object.defineProperty(n,`createAllowListAttributesProcessor`,{enumerable:!0,get:function(){return A.createAllowListAttributesProcessor}}),Object.defineProperty(n,`createDenyListAttributesProcessor`,{enumerable:!0,get:function(){return A.createDenyListAttributesProcessor}});var j=require_utils$3();Object.defineProperty(n,`TimeoutError`,{enumerable:!0,get:function(){return j.TimeoutError}})})),require_enums$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExceptionEventName=void 0,n.ExceptionEventName=`exception`})),require_Span$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SpanImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_enums$1();n.SpanImpl=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(n){let c=Date.now();if(this._spanContext=n.spanContext,this._performanceStartTime=u.otperformance.now(),this._performanceOffset=c-(this._performanceStartTime+u.otperformance.timeOrigin),this._startTimeProvided=n.startTime!=null,this._spanLimits=n.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=n.spanProcessor,this.name=n.name,this.parentSpanContext=n.parentSpanContext,this.kind=n.kind,n.links)for(let c of n.links)this.addLink(c);this.startTime=this._getTime(n.startTime??c),this.resource=n.resource,this.instrumentationScope=n.scope,this._recordEndMetrics=n.recordEndMetrics,n.attributes!=null&&this.setAttributes(n.attributes),this._spanProcessor.onStart(this,n.context)}spanContext(){return this._spanContext}setAttribute(n,p){if(p==null||this._isSpanEnded())return this;if(n.length===0)return c.diag.warn(`Invalid attribute key: ${n}`),this;if(!(0,u.isAttributeValue)(p))return c.diag.warn(`Invalid attribute value set for key: ${n}`),this;let{attributeCountLimit:h}=this._spanLimits,x=!Object.prototype.hasOwnProperty.call(this.attributes,n);return h!==void 0&&this._attributesCount>=h&&x?(this._droppedAttributesCount++,this):(this.attributes[n]=this._truncateToSize(p),x&&this._attributesCount++,this)}setAttributes(n){for(let c in n)Object.prototype.hasOwnProperty.call(n,c)&&this.setAttribute(c,n[c]);return this}addEvent(n,p,h){if(this._isSpanEnded())return this;let{eventCountLimit:x}=this._spanLimits;if(x===0)return c.diag.warn(`No events allowed.`),this._droppedEventsCount++,this;x!==void 0&&this.events.length>=x&&(this._droppedEventsCount===0&&c.diag.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),(0,u.isTimeInput)(p)&&((0,u.isTimeInput)(h)||(h=p),p=void 0);let w=(0,u.sanitizeAttributes)(p),{attributePerEventCountLimit:T}=this._spanLimits,O={},A=0,j=0;for(let n in w){if(!Object.prototype.hasOwnProperty.call(w,n))continue;let c=w[n];if(T!==void 0&&j>=T){A++;continue}O[n]=this._truncateToSize(c),j++}return this.events.push({name:n,attributes:O,time:this._getTime(h),droppedAttributesCount:A}),this}addLink(n){if(this._isSpanEnded())return this;let{linkCountLimit:p}=this._spanLimits;if(p===0)return this._droppedLinksCount++,this;p!==void 0&&this.links.length>=p&&(this._droppedLinksCount===0&&c.diag.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:h}=this._spanLimits,x=(0,u.sanitizeAttributes)(n.attributes),w={},T=0,O=0;for(let n in x){if(!Object.prototype.hasOwnProperty.call(x,n))continue;let c=x[n];if(h!==void 0&&O>=h){T++;continue}w[n]=this._truncateToSize(c),O++}let A={context:n.context};return O>0&&(A.attributes=w),T>0&&(A.droppedAttributesCount=T),this.links.push(A),this}addLinks(n){for(let c of n)this.addLink(c);return this}setStatus(n){if(this._isSpanEnded()||n.code===c.SpanStatusCode.UNSET||this.status.code===c.SpanStatusCode.OK)return this;let u={code:n.code};return n.code===c.SpanStatusCode.ERROR&&(typeof n.message==`string`?u.message=n.message:n.message!=null&&c.diag.warn(`Dropping invalid status.message of type '${typeof n.message}', expected 'string'`)),this.status=u,this}updateName(n){return this._isSpanEnded()||(this.name=n),this}end(n){if(this._isSpanEnded()){c.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(n),this._duration=(0,u.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(c.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&&c.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(n){if(typeof n==`number`&&n<=u.otperformance.now())return(0,u.hrTime)(n+this._performanceOffset);if(typeof n==`number`)return(0,u.millisToHrTime)(n);if(n instanceof Date)return(0,u.millisToHrTime)(n.getTime());if((0,u.isTimeInputHrTime)(n))return n;if(this._startTimeProvided)return(0,u.millisToHrTime)(Date.now());let c=u.otperformance.now()-this._performanceStartTime;return(0,u.addHrTimes)(this.startTime,(0,u.millisToHrTime)(c))}isRecording(){return this._ended===!1}recordException(n,u){let x={};typeof n==`string`?x[p.ATTR_EXCEPTION_MESSAGE]=n:n&&(n.code?x[p.ATTR_EXCEPTION_TYPE]=n.code.toString():n.name&&(x[p.ATTR_EXCEPTION_TYPE]=n.name),n.message&&(x[p.ATTR_EXCEPTION_MESSAGE]=n.message),n.stack&&(x[p.ATTR_EXCEPTION_STACKTRACE]=n.stack)),x[p.ATTR_EXCEPTION_TYPE]||x[p.ATTR_EXCEPTION_MESSAGE]?this.addEvent(h.ExceptionEventName,x,u):c.diag.warn(`Failed to record an exception ${n}`)}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(){if(this._ended){let n=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,n)}return this._ended}_truncateToLimitUtil(n,c){return n.length<=c?n:n.substring(0,c)}_truncateToSize(n){let u=this._attributeValueLengthLimit;return u<=0?(c.diag.warn(`Attribute value limit must be positive, got ${u}`),n):typeof n==`string`?this._truncateToLimitUtil(n,u):Array.isArray(n)?n.map(n=>typeof n==`string`?this._truncateToLimitUtil(n,u):n):n}}})),require_Sampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=void 0,(function(n){n[n.NOT_RECORD=0]=`NOT_RECORD`,n[n.RECORD=1]=`RECORD`,n[n.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(n.SamplingDecision||={})})),require_AlwaysOffSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOffSampler=void 0;let c=require_Sampler$1();n.AlwaysOffSampler=class{shouldSample(){return{decision:c.SamplingDecision.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),require_AlwaysOnSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOnSampler=void 0;let c=require_Sampler$1();n.AlwaysOnSampler=class{shouldSample(){return{decision:c.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),require_ParentBasedSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ParentBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_AlwaysOffSampler$1(),h=require_AlwaysOnSampler$1();n.ParentBasedSampler=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(n){this._root=n.root,this._root||=((0,u.globalErrorHandler)(Error(`ParentBasedSampler must have a root sampler configured`)),new h.AlwaysOnSampler),this._remoteParentSampled=n.remoteParentSampled??new h.AlwaysOnSampler,this._remoteParentNotSampled=n.remoteParentNotSampled??new p.AlwaysOffSampler,this._localParentSampled=n.localParentSampled??new h.AlwaysOnSampler,this._localParentNotSampled=n.localParentNotSampled??new p.AlwaysOffSampler}shouldSample(n,u,p,h,x,w){let T=c.trace.getSpanContext(n);return!T||!(0,c.isSpanContextValid)(T)?this._root.shouldSample(n,u,p,h,x,w):T.isRemote?T.traceFlags&c.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(n,u,p,h,x,w):this._remoteParentNotSampled.shouldSample(n,u,p,h,x,w):T.traceFlags&c.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(n,u,p,h,x,w):this._localParentNotSampled.shouldSample(n,u,p,h,x,w)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),require_TraceIdRatioBasedSampler$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Sampler$1();n.TraceIdRatioBasedSampler=class{_ratio;_upperBound;constructor(n=0){this._ratio=this._normalize(n),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(n,p){return{decision:(0,c.isValidTraceId)(p)&&this._accumulate(p)<this._upperBound?u.SamplingDecision.RECORD_AND_SAMPLED:u.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(n){return typeof n!=`number`||isNaN(n)?0:n>=1?1:n<=0?0:n}_accumulate(n){let c=0;for(let u=0;u<n.length/8;u++){let p=u*8,h=parseInt(n.slice(p,p+8),16);c=(c^h)>>>0}return c}}})),require_config$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.buildSamplerFromEnv=n.loadDefaultConfig=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_AlwaysOffSampler$1(),h=require_AlwaysOnSampler$1(),x=require_ParentBasedSampler$1(),w=require_TraceIdRatioBasedSampler$1();var T;(function(n){n.AlwaysOff=`always_off`,n.AlwaysOn=`always_on`,n.ParentBasedAlwaysOff=`parentbased_always_off`,n.ParentBasedAlwaysOn=`parentbased_always_on`,n.ParentBasedTraceIdRatio=`parentbased_traceidratio`,n.TraceIdRatio=`traceidratio`})(T||={});let O=1;function A(){return{sampler:j(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}n.loadDefaultConfig=A;function j(){let n=(0,u.getStringFromEnv)(`OTEL_TRACES_SAMPLER`)??T.ParentBasedAlwaysOn;switch(n){case T.AlwaysOn:return new h.AlwaysOnSampler;case T.AlwaysOff:return new p.AlwaysOffSampler;case T.ParentBasedAlwaysOn:return new x.ParentBasedSampler({root:new h.AlwaysOnSampler});case T.ParentBasedAlwaysOff:return new x.ParentBasedSampler({root:new p.AlwaysOffSampler});case T.TraceIdRatio:return new w.TraceIdRatioBasedSampler(N());case T.ParentBasedTraceIdRatio:return new x.ParentBasedSampler({root:new w.TraceIdRatioBasedSampler(N())});default:return c.diag.error(`OTEL_TRACES_SAMPLER value "${n}" invalid, defaulting to "${T.ParentBasedAlwaysOn}".`),new x.ParentBasedSampler({root:new h.AlwaysOnSampler})}}n.buildSamplerFromEnv=j;function N(){let n=(0,u.getNumberFromEnv)(`OTEL_TRACES_SAMPLER_ARG`);return n==null?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1):n<0||n>1?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG=${n} was given, but it is out of range ([0..1]), defaulting to 1.`),1):n}})),require_utility$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.reconfigureLimits=n.mergeConfig=n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;let c=require_config$1(),u=require_src$18();n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128,n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function p(n){let u={sampler:(0,c.buildSamplerFromEnv)()},p=(0,c.loadDefaultConfig)(),h=Object.assign({},p,u,n);return h.generalLimits=Object.assign({},p.generalLimits,n.generalLimits||{}),h.spanLimits=Object.assign({},p.spanLimits,n.spanLimits||{}),h}n.mergeConfig=p;function h(c){let p=Object.assign({},c.spanLimits);return p.attributeCountLimit=c.spanLimits?.attributeCountLimit??c.generalLimits?.attributeCountLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??n.DEFAULT_ATTRIBUTE_COUNT_LIMIT,p.attributeValueLengthLimit=c.spanLimits?.attributeValueLengthLimit??c.generalLimits?.attributeValueLengthLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},c,{spanLimits:p})}n.reconfigureLimits=h})),require_BatchSpanProcessorBase$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessorBase=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18();n.BatchSpanProcessorBase=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(n,p){this._exporter=n,this._maxExportBatchSize=typeof p?.maxExportBatchSize==`number`?p.maxExportBatchSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`)??512,this._maxQueueSize=typeof p?.maxQueueSize==`number`?p.maxQueueSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_QUEUE_SIZE`)??2048,this._scheduledDelayMillis=typeof p?.scheduledDelayMillis==`number`?p.scheduledDelayMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_SCHEDULE_DELAY`)??5e3,this._exportTimeoutMillis=typeof p?.exportTimeoutMillis==`number`?p.exportTimeoutMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_EXPORT_TIMEOUT`)??3e4,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.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(n,c){}onEnd(n){this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)!==0&&this._addToBuffer(n)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(n){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&c.diag.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(c.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(n),this._maybeStartTimer()}_flushAll(){return new Promise((n,c)=>{let u=[],p=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,c=p;n<c;n++)u.push(this._flushOneBatch());Promise.all(u).then(()=>{n()}).catch(c)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((n,p)=>{let h=setTimeout(()=>{p(Error(`Timeout`))},this._exportTimeoutMillis);c.context.with((0,u.suppressTracing)(c.context.active()),()=>{let c;this._finishedSpans.length<=this._maxExportBatchSize?(c=this._finishedSpans,this._finishedSpans=[]):c=this._finishedSpans.splice(0,this._maxExportBatchSize);let x=()=>this._exporter.export(c,c=>{clearTimeout(h),c.code===u.ExportResultCode.SUCCESS?n():p(c.error??Error(`BatchSpanProcessor: span export failed`))}),w=null;for(let n=0,u=c.length;n<u;n++){let u=c[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(w??=[],w.push(u.resource.waitForAsyncAttributes()))}w===null?x():Promise.all(w).then(x,n=>{(0,u.globalErrorHandler)(n),p(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let n=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,u.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return n();this._timer===void 0&&(this._timer=setTimeout(()=>n(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),require_BatchSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessor=void 0;let c=require_BatchSpanProcessorBase$1();n.BatchSpanProcessor=class extends c.BatchSpanProcessorBase{onShutdown(){}}})),require_RandomIdGenerator$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=void 0;let c=8,u=16;n.RandomIdGenerator=class{generateTraceId=h(16);generateSpanId=h(8)};let p=Buffer.allocUnsafe(16);function h(n){return function(){for(let c=0;c<n/4;c++)p.writeUInt32BE(Math.random()*2**32>>>0,c*4);for(let c=0;c<n&&!(p[c]>0);c++)c===n-1&&(p[n-1]=1);return p.toString(`hex`,0,n)}}})),require_node$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_BatchSpanProcessor$1();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}});var u=require_RandomIdGenerator$1();Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}})})),require_platform$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_node$3();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return c.RandomIdGenerator}})})),require_semconv$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.METRIC_OTEL_SDK_SPAN_STARTED=n.METRIC_OTEL_SDK_SPAN_LIVE=n.ATTR_OTEL_SPAN_SAMPLING_RESULT=n.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0,n.ATTR_OTEL_SPAN_PARENT_ORIGIN=`otel.span.parent.origin`,n.ATTR_OTEL_SPAN_SAMPLING_RESULT=`otel.span.sampling_result`,n.METRIC_OTEL_SDK_SPAN_LIVE=`otel.sdk.span.live`,n.METRIC_OTEL_SDK_SPAN_STARTED=`otel.sdk.span.started`})),require_TracerMetrics$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TracerMetrics=void 0;let c=require_Sampler$1(),u=require_semconv$3();n.TracerMetrics=class{startedSpans;liveSpans;constructor(n){this.startedSpans=n.createCounter(u.METRIC_OTEL_SDK_SPAN_STARTED,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=n.createUpDownCounter(u.METRIC_OTEL_SDK_SPAN_LIVE,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(n,x){let w=h(x);if(this.startedSpans.add(1,{[u.ATTR_OTEL_SPAN_PARENT_ORIGIN]:p(n),[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w}),x===c.SamplingDecision.NOT_RECORD)return()=>{};let T={[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w};return this.liveSpans.add(1,T),()=>{this.liveSpans.add(-1,T)}}};function p(n){return n?n.isRemote?`remote`:`local`:`none`}function h(n){switch(n){case c.SamplingDecision.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case c.SamplingDecision.RECORD:return`RECORD_ONLY`;case c.SamplingDecision.NOT_RECORD:return`DROP`}}})),require_version$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_Tracer$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Tracer=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18(),p=require_Span$1(),h=require_utility$1(),x=require_platform$3(),w=require_TracerMetrics$1(),T=require_version$2();n.Tracer=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(n,u,p,O){let A=(0,h.mergeConfig)(u);this._sampler=A.sampler,this._generalLimits=A.generalLimits,this._spanLimits=A.spanLimits,this._idGenerator=u.idGenerator||new x.RandomIdGenerator,this._resource=p,this._spanProcessor=O,this.instrumentationScope=n;let j=A.meterProvider?A.meterProvider.getMeter(`@opentelemetry/sdk-trace`,T.VERSION):c.createNoopMeter();this._tracerMetrics=new w.TracerMetrics(j)}startSpan(n,h={},x=c.context.active()){h.root&&(x=c.trace.deleteSpan(x));let w=c.trace.getSpan(x);if((0,u.isTracingSuppressed)(x))return c.diag.debug(`Instrumentation suppressed, returning Noop Span`),c.trace.wrapSpanContext(c.INVALID_SPAN_CONTEXT);let T=w?.spanContext(),O=this._idGenerator.generateSpanId(),A,j,N;!T||!c.trace.isSpanContextValid(T)?j=this._idGenerator.generateTraceId():(j=T.traceId,N=T.traceState,A=T);let I=h.kind??c.SpanKind.INTERNAL,L=(h.links??[]).map(n=>({context:n.context,attributes:(0,u.sanitizeAttributes)(n.attributes)})),z=(0,u.sanitizeAttributes)(h.attributes),B=this._sampler.shouldSample(x,j,n,I,z,L),V=this._tracerMetrics.startSpan(T,B.decision);N=B.traceState??N;let H=B.decision===c.SamplingDecision.RECORD_AND_SAMPLED?c.TraceFlags.SAMPLED:c.TraceFlags.NONE,U={traceId:j,spanId:O,traceFlags:H,traceState:N};if(B.decision===c.SamplingDecision.NOT_RECORD)return c.diag.debug(`Recording is off, propagating context in a non-recording span`),c.trace.wrapSpanContext(U);let W=(0,u.sanitizeAttributes)(Object.assign(z,B.attributes));return new p.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:x,spanContext:U,name:n,kind:I,links:L,parentSpanContext:A,attributes:W,startTime:h.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:V})}startActiveSpan(n,u,p,h){let x,w,T;if(arguments.length<2)return;arguments.length===2?T=u:arguments.length===3?(x=u,T=p):(x=u,w=p,T=h);let O=w??c.context.active(),A=this.startSpan(n,x,O),j=c.trace.setSpan(O,A);return c.context.with(j,T,void 0,A)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),require_MultiSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiSpanProcessor=void 0;let c=require_src$18();n.MultiSpanProcessor=class{_spanProcessors;constructor(n){this._spanProcessors=n}forceFlush(){let n=[];for(let c of this._spanProcessors)n.push(c.forceFlush());return new Promise(u=>{Promise.all(n).then(()=>{u()}).catch(n=>{(0,c.globalErrorHandler)(n||Error(`MultiSpanProcessor: forceFlush failed`)),u()})})}onStart(n,c){for(let u of this._spanProcessors)u.onStart(n,c)}onEnding(n){for(let c of this._spanProcessors)c.onEnding&&c.onEnding(n)}onEnd(n){for(let c of this._spanProcessors)c.onEnd(n)}shutdown(){let n=[];for(let c of this._spanProcessors)n.push(c.shutdown());return new Promise((c,u)=>{Promise.all(n).then(()=>{c()},u)})}}})),require_BasicTracerProvider$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BasicTracerProvider=n.ForceFlushState=void 0;let c=require_src$18(),u=require_src$17(),p=require_Tracer$1(),h=require_config$1(),x=require_MultiSpanProcessor$1(),w=require_utility$1();var T;(function(n){n[n.resolved=0]=`resolved`,n[n.timeout=1]=`timeout`,n[n.error=2]=`error`,n[n.unresolved=3]=`unresolved`})(T=n.ForceFlushState||={}),n.BasicTracerProvider=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(n={}){let p=(0,c.merge)({},(0,h.loadDefaultConfig)(),(0,w.reconfigureLimits)(n));this._resource=p.resource??(0,u.defaultResource)(),this._config=Object.assign({},p,{resource:this._resource});let T=[];n.spanProcessors?.length&&T.push(...n.spanProcessors),this._activeSpanProcessor=new x.MultiSpanProcessor(T)}getTracer(n,c,u){let h=`${n}@${c||``}:${u?.schemaUrl||``}`;return this._tracers.has(h)||this._tracers.set(h,new p.Tracer({name:n,version:c,schemaUrl:u?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(h)}forceFlush(){let n=this._config.forceFlushTimeoutMillis,c=this._activeSpanProcessor._spanProcessors.map(c=>new Promise(u=>{let p,h=setTimeout(()=>{u(Error(`Span processor did not completed within timeout period of ${n} ms`)),p=T.timeout},n);c.forceFlush().then(()=>{clearTimeout(h),p!==T.timeout&&(p=T.resolved,u(p))}).catch(n=>{clearTimeout(h),p=T.error,u(n)})}));return new Promise((n,u)=>{Promise.all(c).then(c=>{let p=c.filter(n=>n!==T.resolved);p.length>0?u(p):n()}).catch(n=>u([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),require_ConsoleSpanExporter$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ConsoleSpanExporter=void 0;let c=require_src$18();n.ConsoleSpanExporter=class{export(n,c){return this._sendSpans(n,c)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(n){return{resource:{attributes:n.resource.attributes},instrumentationScope:n.instrumentationScope,traceId:n.spanContext().traceId,parentSpanContext:n.parentSpanContext,traceState:n.spanContext().traceState?.serialize(),name:n.name,id:n.spanContext().spanId,kind:n.kind,timestamp:(0,c.hrTimeToMicroseconds)(n.startTime),duration:(0,c.hrTimeToMicroseconds)(n.duration),attributes:n.attributes,status:n.status,events:n.events,links:n.links}}_sendSpans(n,u){for(let c of n)console.dir(this._exportInfo(c),{depth:3});if(u)return u({code:c.ExportResultCode.SUCCESS})}}})),require_InMemorySpanExporter$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InMemorySpanExporter=void 0;let c=require_src$18();n.InMemorySpanExporter=class{_finishedSpans=[];_stopped=!1;export(n,u){if(this._stopped)return u({code:c.ExportResultCode.FAILED,error:Error(`Exporter has been stopped`)});this._finishedSpans.push(...n),setTimeout(()=>u({code:c.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}})),require_SimpleSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SimpleSpanProcessor=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$18();n.SimpleSpanProcessor=class{_exporter;_shutdownOnce;_pendingExports;constructor(n){this._exporter=n,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(n,c){}onEnd(n){if(this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)===0)return;let p=this._doExport(n).catch(n=>(0,u.globalErrorHandler)(n));this._pendingExports.add(p),p.finally(()=>this._pendingExports.delete(p))}async _doExport(n){n.resource.asyncAttributesPending&&await n.resource.waitForAsyncAttributes?.();let c=await u.internal._export(this._exporter,[n]);if(c.code!==u.ExportResultCode.SUCCESS)throw c.error??Error(`SimpleSpanProcessor: span export failed (status ${c})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}})),require_NoopSpanProcessor$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NoopSpanProcessor=void 0,n.NoopSpanProcessor=class{onStart(n,c){}onEnd(n){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}})),require_src$4=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=n.TraceIdRatioBasedSampler=n.ParentBasedSampler=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NoopSpanProcessor=n.SimpleSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.RandomIdGenerator=n.BatchSpanProcessor=n.BasicTracerProvider=void 0;var c=require_BasicTracerProvider$1();Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return c.BasicTracerProvider}});var u=require_platform$3();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}});var p=require_ConsoleSpanExporter$1();Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return p.ConsoleSpanExporter}});var h=require_InMemorySpanExporter$1();Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return h.InMemorySpanExporter}});var x=require_SimpleSpanProcessor$1();Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return x.SimpleSpanProcessor}});var w=require_NoopSpanProcessor$1();Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return w.NoopSpanProcessor}});var T=require_AlwaysOffSampler$1();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return T.AlwaysOffSampler}});var O=require_AlwaysOnSampler$1();Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return O.AlwaysOnSampler}});var A=require_ParentBasedSampler$1();Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return A.ParentBasedSampler}});var j=require_TraceIdRatioBasedSampler$1();Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return j.TraceIdRatioBasedSampler}});var N=require_Sampler$1();Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return N.SamplingDecision}})})),require_suppress_tracing=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isTracingSuppressed=n.unsuppressTracing=n.suppressTracing=void 0;let c=(0,(init_esm$2(),__toCommonJS(esm_exports$2)).createContextKey)(`OpenTelemetry SDK Context Key SUPPRESS_TRACING`);function u(n){return n.setValue(c,!0)}n.suppressTracing=u;function p(n){return n.deleteValue(c)}n.unsuppressTracing=p;function h(n){return n.getValue(c)===!0}n.isTracingSuppressed=h})),require_constants=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BAGGAGE_MAX_TOTAL_LENGTH=n.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=n.BAGGAGE_MAX_NAME_VALUE_PAIRS=n.BAGGAGE_HEADER=n.BAGGAGE_ITEMS_SEPARATOR=n.BAGGAGE_PROPERTIES_SEPARATOR=n.BAGGAGE_KEY_PAIR_SEPARATOR=void 0,n.BAGGAGE_KEY_PAIR_SEPARATOR=`=`,n.BAGGAGE_PROPERTIES_SEPARATOR=`;`,n.BAGGAGE_ITEMS_SEPARATOR=`,`,n.BAGGAGE_HEADER=`baggage`,n.BAGGAGE_MAX_NAME_VALUE_PAIRS=180,n.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096,n.BAGGAGE_MAX_TOTAL_LENGTH=8192})),require_utils$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.parseKeyPairsIntoRecord=n.parsePairKeyValue=n.getKeyPairs=n.serializeKeyPairs=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_constants();function p(n){return n.reduce((n,c)=>{let p=`${n}${n===``?``:u.BAGGAGE_ITEMS_SEPARATOR}${c}`;return p.length>u.BAGGAGE_MAX_TOTAL_LENGTH?n:p},``)}n.serializeKeyPairs=p;function h(n){return n.getAllEntries().map(([n,c])=>{let p=`${encodeURIComponent(n)}=${encodeURIComponent(c.value)}`;return c.metadata!==void 0&&(p+=u.BAGGAGE_PROPERTIES_SEPARATOR+c.metadata.toString()),p})}n.getKeyPairs=h;function x(n){if(!n)return;let p=n.indexOf(u.BAGGAGE_PROPERTIES_SEPARATOR),h=p===-1?n:n.substring(0,p),x=h.indexOf(u.BAGGAGE_KEY_PAIR_SEPARATOR);if(x<=0)return;let w=h.substring(0,x).trim(),T=h.substring(x+1).trim();if(!w||!T)return;let O,A;try{O=decodeURIComponent(w),A=decodeURIComponent(T)}catch{return}let j;if(p!==-1&&p<n.length-1){let u=n.substring(p+1);j=(0,c.baggageEntryMetadataFromString)(u)}return{key:O,value:A,metadata:j}}n.parsePairKeyValue=x;function w(n){let c={};return typeof n==`string`&&n.length>0&&n.split(u.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let u=x(n);u!==void 0&&u.value.length>0&&(c[u.key]=u.value)}),c}n.parseKeyPairsIntoRecord=w})),require_W3CBaggagePropagator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.W3CBaggagePropagator=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing(),p=require_constants(),h=require_utils$2();n.W3CBaggagePropagator=class{inject(n,x,w){let T=c.propagation.getBaggage(n);if(!T||(0,u.isTracingSuppressed)(n))return;let O=(0,h.getKeyPairs)(T).filter(n=>n.length<=p.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,p.BAGGAGE_MAX_NAME_VALUE_PAIRS),A=(0,h.serializeKeyPairs)(O);A.length>0&&w.set(x,p.BAGGAGE_HEADER,A)}extract(n,u,x){let w=x.get(u,p.BAGGAGE_HEADER),T=Array.isArray(w)?w.join(p.BAGGAGE_ITEMS_SEPARATOR):w;if(!T)return n;let O={};return T.length===0||(T.split(p.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let c=(0,h.parsePairKeyValue)(n);if(c){let n={value:c.value};c.metadata&&(n.metadata=c.metadata),O[c.key]=n}}),Object.entries(O).length===0)?n:c.propagation.setBaggage(n,c.propagation.createBaggage(O))}fields(){return[p.BAGGAGE_HEADER]}}})),require_anchored_clock=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AnchoredClock=void 0,n.AnchoredClock=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(n,c){this._monotonicClock=c,this._epochMillis=n.now(),this._performanceMillis=c.now()}now(){let n=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+n}}})),require_attributes=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isAttributeValue=n.isAttributeKey=n.sanitizeAttributes=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));function u(n){let u={};if(typeof n!=`object`||!n)return u;for(let x in n){if(!Object.prototype.hasOwnProperty.call(n,x))continue;if(!p(x)){c.diag.warn(`Invalid attribute key: ${x}`);continue}let w=n[x];if(!h(w)){c.diag.warn(`Invalid attribute value set for key: ${x}`);continue}Array.isArray(w)?u[x]=w.slice():u[x]=w}return u}n.sanitizeAttributes=u;function p(n){return typeof n==`string`&&n!==``}n.isAttributeKey=p;function h(n){return n==null?!0:Array.isArray(n)?x(n):w(typeof n)}n.isAttributeValue=h;function x(n){let c;for(let u of n){if(u==null)continue;let n=typeof u;if(n!==c){if(!c){if(w(n)){c=n;continue}return!1}return!1}}return!0}function w(n){switch(n){case`number`:case`boolean`:case`string`:return!0}return!1}})),require_logging_error_handler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.loggingErrorHandler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));function u(){return n=>{c.diag.error(p(n))}}n.loggingErrorHandler=u;function p(n){return typeof n==`string`?n:JSON.stringify(h(n))}function h(n){let c={},u=n;for(;u!==null;)Object.getOwnPropertyNames(u).forEach(n=>{if(c[n])return;let p=u[n];p&&(c[n]=String(p))}),u=Object.getPrototypeOf(u);return c}})),require_global_error_handler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.globalErrorHandler=n.setGlobalErrorHandler=void 0;let c=(0,require_logging_error_handler().loggingErrorHandler)();function u(n){c=n}n.setGlobalErrorHandler=u;function p(n){try{c(n)}catch{}}n.globalErrorHandler=p})),require_environment=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getStringListFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=n.getNumberFromEnv=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=__require(`util`);function p(n){let p=process.env[n];if(p==null||p.trim()===``)return;let h=Number(p);if(isNaN(h)){c.diag.warn(`Unknown value ${(0,u.inspect)(p)} for ${n}, expected a number, using defaults`);return}return h}n.getNumberFromEnv=p;function h(n){let c=process.env[n];if(!(c==null||c.trim()===``))return c}n.getStringFromEnv=h;function x(n){let p=process.env[n]?.trim().toLowerCase();return p==null||p===``?!1:p===`true`?!0:(p===`false`||c.diag.warn(`Unknown value ${(0,u.inspect)(p)} for ${n}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}n.getBooleanFromEnv=x;function w(n){return h(n)?.split(`,`).map(n=>n.trim()).filter(n=>n!==``)}n.getStringListFromEnv=w})),require_globalThis=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._globalThis=void 0,n._globalThis=globalThis})),require_version$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_semconv$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ATTR_PROCESS_RUNTIME_NAME=void 0,n.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`})),require_sdk_info=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SDK_INFO=void 0;let c=require_version$1(),u=(init_esm$1(),__toCommonJS(esm_exports$1)),p=require_semconv$2();n.SDK_INFO={[u.ATTR_TELEMETRY_SDK_NAME]:`opentelemetry`,[p.ATTR_PROCESS_RUNTIME_NAME]:`node`,[u.ATTR_TELEMETRY_SDK_LANGUAGE]:u.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[u.ATTR_TELEMETRY_SDK_VERSION]:c.VERSION}})),require_node$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.otperformance=n.SDK_INFO=n._globalThis=n.getStringListFromEnv=n.getNumberFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=void 0;var c=require_environment();Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return c.getStringFromEnv}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return c.getBooleanFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return c.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return c.getStringListFromEnv}});var u=require_globalThis();Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return u._globalThis}});var p=require_sdk_info();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return p.SDK_INFO}}),n.otperformance=performance})),require_platform$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getStringListFromEnv=n.getNumberFromEnv=n.getStringFromEnv=n.getBooleanFromEnv=n.otperformance=n._globalThis=n.SDK_INFO=void 0;var c=require_node$2();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return c.SDK_INFO}}),Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return c._globalThis}}),Object.defineProperty(n,`otperformance`,{enumerable:!0,get:function(){return c.otperformance}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return c.getBooleanFromEnv}}),Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return c.getStringFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return c.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return c.getStringListFromEnv}})})),require_time=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.addHrTimes=n.isTimeInput=n.isTimeInputHrTime=n.hrTimeToMicroseconds=n.hrTimeToMilliseconds=n.hrTimeToNanoseconds=n.hrTimeToTimeStamp=n.hrTimeDuration=n.timeInputToHrTime=n.hrTime=n.getTimeOrigin=n.millisToHrTime=void 0;let c=require_platform$2(),u=9,p=10**6,h=10**9;function x(n){let c=n/1e3;return[Math.trunc(c),Math.round(n%1e3*p)]}n.millisToHrTime=x;function w(){return c.otperformance.timeOrigin}n.getTimeOrigin=w;function T(n){return V(x(c.otperformance.timeOrigin),x(typeof n==`number`?n:c.otperformance.now()))}n.hrTime=T;function O(n){if(z(n))return n;if(typeof n==`number`)return n<c.otperformance.timeOrigin?T(n):x(n);if(n instanceof Date)return x(n.getTime());throw TypeError(`Invalid input type`)}n.timeInputToHrTime=O;function A(n,c){let u=c[0]-n[0],p=c[1]-n[1];return p<0&&(--u,p+=h),[u,p]}n.hrTimeDuration=A;function j(n){let c=9,u=`${`0`.repeat(9)}${n[1]}Z`,p=u.substring(u.length-9-1);return new Date(n[0]*1e3).toISOString().replace(`000Z`,p)}n.hrTimeToTimeStamp=j;function N(n){return n[0]*h+n[1]}n.hrTimeToNanoseconds=N;function I(n){return n[0]*1e3+n[1]/1e6}n.hrTimeToMilliseconds=I;function L(n){return n[0]*1e6+n[1]/1e3}n.hrTimeToMicroseconds=L;function z(n){return Array.isArray(n)&&n.length===2&&typeof n[0]==`number`&&typeof n[1]==`number`}n.isTimeInputHrTime=z;function B(n){return z(n)||typeof n==`number`||n instanceof Date}n.isTimeInput=B;function V(n,c){let u=[n[0]+c[0],n[1]+c[1]];return u[1]>=h&&(u[1]-=h,u[0]+=1),u}n.addHrTimes=V})),require_timer_util=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.unrefTimer=void 0;function c(n){typeof n!=`number`&&n.unref()}n.unrefTimer=c})),require_ExportResult=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExportResultCode=void 0,(function(n){n[n.SUCCESS=0]=`SUCCESS`,n[n.FAILED=1]=`FAILED`})(n.ExportResultCode||={})})),require_composite=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.CompositePropagator=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2));n.CompositePropagator=class{_propagators;_fields;constructor(n={}){this._propagators=n.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields==`function`?n.fields():[]).reduce((n,c)=>n.concat(c),[])))}inject(n,u,p){for(let h of this._propagators)try{h.inject(n,u,p)}catch(n){c.diag.warn(`Failed to inject with ${h.constructor.name}. Err: ${n.message}`)}}extract(n,u,p){return this._propagators.reduce((n,h)=>{try{return h.extract(n,u,p)}catch(n){c.diag.warn(`Failed to extract with ${h.constructor.name}. Err: ${n.message}`)}return n},n)}fields(){return this._fields.slice()}}})),require_validators=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.validateValue=n.validateKey=void 0;let c=`[_0-9a-z-*/]`,u=`[a-z]${c}{0,255}`,p=`[a-z0-9]${c}{0,240}@[a-z]${c}{0,13}`,h=RegExp(`^(?:${u}|${p})$`),x=/^[ -~]{0,255}[!-~]$/,w=/,|=/;function T(n){return h.test(n)}n.validateKey=T;function O(n){return x.test(n)&&!w.test(n)}n.validateValue=O})),require_TraceState=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceState=void 0;let c=require_validators(),u=32,p=512,h=`,`,x=`=`;n.TraceState=class n{_internalState=new Map;constructor(n){n&&this._parse(n)}set(n,c){let u=this._clone();return u._internalState.has(n)&&u._internalState.delete(n),u._internalState.set(n,c),u}unset(n){let c=this._clone();return c._internalState.delete(n),c}get(n){return this._internalState.get(n)}serialize(){return this._keys().reduce((n,c)=>(n.push(c+`=`+this.get(c)),n),[]).join(`,`)}_parse(n){n.length>512||(this._internalState=n.split(`,`).reverse().reduce((n,u)=>{let p=u.trim(),h=p.indexOf(`=`);if(h!==-1){let x=p.slice(0,h),w=p.slice(h+1,u.length);(0,c.validateKey)(x)&&(0,c.validateValue)(w)&&n.set(x,w)}return n},new Map),this._internalState.size>32&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,32))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let c=new n;return c._internalState=new Map(this._internalState),c}}})),require_W3CTraceContextPropagator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.W3CTraceContextPropagator=n.parseTraceParent=n.TRACE_STATE_HEADER=n.TRACE_PARENT_HEADER=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing(),p=require_TraceState();n.TRACE_PARENT_HEADER=`traceparent`,n.TRACE_STATE_HEADER=`tracestate`;let h=`00`,x=RegExp(`^\\s?((?!ff)[\\da-f]{2})-((?![0]{32})[\\da-f]{32})-((?![0]{16})[\\da-f]{16})-([\\da-f]{2})(-.*)?\\s?$`);function w(n){let c=x.exec(n);return!c||c[1]===`00`&&c[5]?null:{traceId:c[2],spanId:c[3],traceFlags:parseInt(c[4],16)}}n.parseTraceParent=w,n.W3CTraceContextPropagator=class{inject(p,h,x){let w=c.trace.getSpanContext(p);if(!w||(0,u.isTracingSuppressed)(p)||!(0,c.isSpanContextValid)(w))return;let T=`00-${w.traceId}-${w.spanId}-0${Number(w.traceFlags||c.TraceFlags.NONE).toString(16)}`;x.set(h,n.TRACE_PARENT_HEADER,T),w.traceState&&x.set(h,n.TRACE_STATE_HEADER,w.traceState.serialize())}extract(u,h,x){let T=x.get(h,n.TRACE_PARENT_HEADER);if(!T)return u;let O=Array.isArray(T)?T[0]:T;if(typeof O!=`string`)return u;let A=w(O);if(!A)return u;A.isRemote=!0;let j=x.get(h,n.TRACE_STATE_HEADER);if(j){let n=Array.isArray(j)?j.join(`,`):j;A.traceState=new p.TraceState(typeof n==`string`?n:void 0)}return c.trace.setSpanContext(u,A)}fields(){return[n.TRACE_PARENT_HEADER,n.TRACE_STATE_HEADER]}}})),require_rpc_metadata=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getRPCMetadata=n.deleteRPCMetadata=n.setRPCMetadata=n.RPCType=void 0;let c=(0,(init_esm$2(),__toCommonJS(esm_exports$2)).createContextKey)(`OpenTelemetry SDK Context Key RPC_METADATA`);(function(n){n.HTTP=`http`})(n.RPCType||={});function u(n,u){return n.setValue(c,u)}n.setRPCMetadata=u;function p(n){return n.deleteValue(c)}n.deleteRPCMetadata=p;function h(n){return n.getValue(c)}n.getRPCMetadata=h})),require_lodash_merge=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isPlainObject=void 0;let c=`[object Object]`,u=`[object Null]`,p=`[object Undefined]`,h=Function.prototype.toString,x=h.call(Object),w=Object.getPrototypeOf,T=Object.prototype,O=T.hasOwnProperty,A=Symbol?Symbol.toStringTag:void 0,j=T.toString;function N(n){if(!I(n)||L(n)!==`[object Object]`)return!1;let c=w(n);if(c===null)return!0;let u=O.call(c,`constructor`)&&c.constructor;return typeof u==`function`&&u instanceof u&&h.call(u)===x}n.isPlainObject=N;function I(n){return typeof n==`object`&&!!n}function L(n){return n==null?n===void 0?`[object Undefined]`:`[object Null]`:A&&A in Object(n)?z(n):B(n)}function z(n){let c=O.call(n,A),u=n[A],p=!1;try{n[A]=void 0,p=!0}catch{}let h=j.call(n);return p&&(c?n[A]=u:delete n[A]),h}function B(n){return j.call(n)}})),require_merge=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.merge=void 0;let c=require_lodash_merge(),u=20;function p(...n){let c=n.shift(),u=new WeakMap;for(;n.length>0;)c=x(c,n.shift(),0,u);return c}n.merge=p;function h(n){return T(n)?n.slice():n}function x(n,c,u=0,p){let I;if(!(u>20)){if(u++,j(n)||j(c)||O(c))I=h(c);else if(T(n)){if(I=n.slice(),T(c))for(let n=0,u=c.length;n<u;n++)I.push(h(c[n]));else if(A(c)){let n=Object.keys(c);for(let u=0,p=n.length;u<p;u++){let p=n[u];p===`__proto__`||p===`constructor`||p===`prototype`||(I[p]=h(c[p]))}}}else if(A(n))if(A(c)){if(!N(n,c))return c;I=Object.assign({},n);let h=Object.keys(c);for(let T=0,O=h.length;T<O;T++){let O=h[T];if(O===`__proto__`||O===`constructor`||O===`prototype`)continue;let N=c[O];if(j(N))N===void 0?delete I[O]:I[O]=N;else{let h=I[O],T=N;if(w(n,O,p)||w(c,O,p))delete I[O];else{if(A(h)&&A(T)){let u=p.get(h)||[],x=p.get(T)||[];u.push({obj:n,key:O}),x.push({obj:c,key:O}),p.set(h,u),p.set(T,x)}I[O]=x(I[O],N,u,p)}}}}else I=c;return I}}function w(n,c,u){let p=u.get(n[c])||[];for(let u=0,h=p.length;u<h;u++){let h=p[u];if(h.key===c&&h.obj===n)return!0}return!1}function T(n){return Array.isArray(n)}function O(n){return typeof n==`function`}function A(n){return!j(n)&&!T(n)&&!O(n)&&typeof n==`object`}function j(n){return typeof n==`string`||typeof n==`number`||typeof n==`boolean`||n===void 0||n instanceof Date||n instanceof RegExp||n===null}function N(n,u){return!(!(0,c.isPlainObject)(n)||!(0,c.isPlainObject)(u))}})),require_timeout=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.callWithTimeout=n.TimeoutError=void 0;var c=class n extends Error{constructor(c){super(c),Object.setPrototypeOf(this,n.prototype)}};n.TimeoutError=c;function u(n,u){let p,h=new Promise(function(n,h){p=setTimeout(function(){h(new c(`Operation timed out.`))},u)});return Promise.race([n,h]).then(n=>(clearTimeout(p),n),n=>{throw clearTimeout(p),n})}n.callWithTimeout=u})),require_url=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isUrlIgnored=n.urlMatches=void 0;function c(n,c){return typeof c==`string`?n===c:!!n.match(c)}n.urlMatches=c;function u(n,u){if(!u)return!1;for(let p of u)if(c(n,p))return!0;return!1}n.isUrlIgnored=u})),require_promise=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Deferred=void 0,n.Deferred=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((n,c)=>{this._resolve=n,this._reject=c})}get promise(){return this._promise}resolve(n){this._resolve(n)}reject(n){this._reject(n)}}})),require_callback=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BindOnceFuture=void 0;let c=require_promise();n.BindOnceFuture=class{_isCalled=!1;_deferred=new c.Deferred;_callback;_that;constructor(n,c){this._callback=n,this._that=c}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...n){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...n)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}}})),require_configuration=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.diagLogLevelFromString=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u={ALL:c.DiagLogLevel.ALL,VERBOSE:c.DiagLogLevel.VERBOSE,DEBUG:c.DiagLogLevel.DEBUG,INFO:c.DiagLogLevel.INFO,WARN:c.DiagLogLevel.WARN,ERROR:c.DiagLogLevel.ERROR,NONE:c.DiagLogLevel.NONE};function p(n){return n==null?void 0:u[n.toUpperCase()]??(c.diag.warn(`Unknown log level "${n}", expected one of ${Object.keys(u)}, using default`),c.DiagLogLevel.INFO)}n.diagLogLevelFromString=p})),require_exporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._export=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_suppress_tracing();function p(n,p){return new Promise(h=>{c.context.with((0,u.suppressTracing)(c.context.active()),()=>{n.export(p,h)})})}n._export=p})),require_src$3=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.internal=n.diagLogLevelFromString=n.BindOnceFuture=n.urlMatches=n.isUrlIgnored=n.callWithTimeout=n.TimeoutError=n.merge=n.TraceState=n.unsuppressTracing=n.suppressTracing=n.isTracingSuppressed=n.setRPCMetadata=n.getRPCMetadata=n.deleteRPCMetadata=n.RPCType=n.parseTraceParent=n.W3CTraceContextPropagator=n.TRACE_STATE_HEADER=n.TRACE_PARENT_HEADER=n.CompositePropagator=n.otperformance=n.getStringListFromEnv=n.getNumberFromEnv=n.getBooleanFromEnv=n.getStringFromEnv=n._globalThis=n.SDK_INFO=n.parseKeyPairsIntoRecord=n.ExportResultCode=n.unrefTimer=n.timeInputToHrTime=n.millisToHrTime=n.isTimeInputHrTime=n.isTimeInput=n.hrTimeToTimeStamp=n.hrTimeToNanoseconds=n.hrTimeToMilliseconds=n.hrTimeToMicroseconds=n.hrTimeDuration=n.hrTime=n.getTimeOrigin=n.addHrTimes=n.loggingErrorHandler=n.setGlobalErrorHandler=n.globalErrorHandler=n.sanitizeAttributes=n.isAttributeValue=n.AnchoredClock=n.W3CBaggagePropagator=void 0;var c=require_W3CBaggagePropagator();Object.defineProperty(n,`W3CBaggagePropagator`,{enumerable:!0,get:function(){return c.W3CBaggagePropagator}});var u=require_anchored_clock();Object.defineProperty(n,`AnchoredClock`,{enumerable:!0,get:function(){return u.AnchoredClock}});var p=require_attributes();Object.defineProperty(n,`isAttributeValue`,{enumerable:!0,get:function(){return p.isAttributeValue}}),Object.defineProperty(n,`sanitizeAttributes`,{enumerable:!0,get:function(){return p.sanitizeAttributes}});var h=require_global_error_handler();Object.defineProperty(n,`globalErrorHandler`,{enumerable:!0,get:function(){return h.globalErrorHandler}}),Object.defineProperty(n,`setGlobalErrorHandler`,{enumerable:!0,get:function(){return h.setGlobalErrorHandler}});var x=require_logging_error_handler();Object.defineProperty(n,`loggingErrorHandler`,{enumerable:!0,get:function(){return x.loggingErrorHandler}});var w=require_time();Object.defineProperty(n,`addHrTimes`,{enumerable:!0,get:function(){return w.addHrTimes}}),Object.defineProperty(n,`getTimeOrigin`,{enumerable:!0,get:function(){return w.getTimeOrigin}}),Object.defineProperty(n,`hrTime`,{enumerable:!0,get:function(){return w.hrTime}}),Object.defineProperty(n,`hrTimeDuration`,{enumerable:!0,get:function(){return w.hrTimeDuration}}),Object.defineProperty(n,`hrTimeToMicroseconds`,{enumerable:!0,get:function(){return w.hrTimeToMicroseconds}}),Object.defineProperty(n,`hrTimeToMilliseconds`,{enumerable:!0,get:function(){return w.hrTimeToMilliseconds}}),Object.defineProperty(n,`hrTimeToNanoseconds`,{enumerable:!0,get:function(){return w.hrTimeToNanoseconds}}),Object.defineProperty(n,`hrTimeToTimeStamp`,{enumerable:!0,get:function(){return w.hrTimeToTimeStamp}}),Object.defineProperty(n,`isTimeInput`,{enumerable:!0,get:function(){return w.isTimeInput}}),Object.defineProperty(n,`isTimeInputHrTime`,{enumerable:!0,get:function(){return w.isTimeInputHrTime}}),Object.defineProperty(n,`millisToHrTime`,{enumerable:!0,get:function(){return w.millisToHrTime}}),Object.defineProperty(n,`timeInputToHrTime`,{enumerable:!0,get:function(){return w.timeInputToHrTime}});var T=require_timer_util();Object.defineProperty(n,`unrefTimer`,{enumerable:!0,get:function(){return T.unrefTimer}});var O=require_ExportResult();Object.defineProperty(n,`ExportResultCode`,{enumerable:!0,get:function(){return O.ExportResultCode}});var A=require_utils$2();Object.defineProperty(n,`parseKeyPairsIntoRecord`,{enumerable:!0,get:function(){return A.parseKeyPairsIntoRecord}});var j=require_platform$2();Object.defineProperty(n,`SDK_INFO`,{enumerable:!0,get:function(){return j.SDK_INFO}}),Object.defineProperty(n,`_globalThis`,{enumerable:!0,get:function(){return j._globalThis}}),Object.defineProperty(n,`getStringFromEnv`,{enumerable:!0,get:function(){return j.getStringFromEnv}}),Object.defineProperty(n,`getBooleanFromEnv`,{enumerable:!0,get:function(){return j.getBooleanFromEnv}}),Object.defineProperty(n,`getNumberFromEnv`,{enumerable:!0,get:function(){return j.getNumberFromEnv}}),Object.defineProperty(n,`getStringListFromEnv`,{enumerable:!0,get:function(){return j.getStringListFromEnv}}),Object.defineProperty(n,`otperformance`,{enumerable:!0,get:function(){return j.otperformance}});var N=require_composite();Object.defineProperty(n,`CompositePropagator`,{enumerable:!0,get:function(){return N.CompositePropagator}});var I=require_W3CTraceContextPropagator();Object.defineProperty(n,`TRACE_PARENT_HEADER`,{enumerable:!0,get:function(){return I.TRACE_PARENT_HEADER}}),Object.defineProperty(n,`TRACE_STATE_HEADER`,{enumerable:!0,get:function(){return I.TRACE_STATE_HEADER}}),Object.defineProperty(n,`W3CTraceContextPropagator`,{enumerable:!0,get:function(){return I.W3CTraceContextPropagator}}),Object.defineProperty(n,`parseTraceParent`,{enumerable:!0,get:function(){return I.parseTraceParent}});var L=require_rpc_metadata();Object.defineProperty(n,`RPCType`,{enumerable:!0,get:function(){return L.RPCType}}),Object.defineProperty(n,`deleteRPCMetadata`,{enumerable:!0,get:function(){return L.deleteRPCMetadata}}),Object.defineProperty(n,`getRPCMetadata`,{enumerable:!0,get:function(){return L.getRPCMetadata}}),Object.defineProperty(n,`setRPCMetadata`,{enumerable:!0,get:function(){return L.setRPCMetadata}});var z=require_suppress_tracing();Object.defineProperty(n,`isTracingSuppressed`,{enumerable:!0,get:function(){return z.isTracingSuppressed}}),Object.defineProperty(n,`suppressTracing`,{enumerable:!0,get:function(){return z.suppressTracing}}),Object.defineProperty(n,`unsuppressTracing`,{enumerable:!0,get:function(){return z.unsuppressTracing}});var B=require_TraceState();Object.defineProperty(n,`TraceState`,{enumerable:!0,get:function(){return B.TraceState}});var V=require_merge();Object.defineProperty(n,`merge`,{enumerable:!0,get:function(){return V.merge}});var H=require_timeout();Object.defineProperty(n,`TimeoutError`,{enumerable:!0,get:function(){return H.TimeoutError}}),Object.defineProperty(n,`callWithTimeout`,{enumerable:!0,get:function(){return H.callWithTimeout}});var U=require_url();Object.defineProperty(n,`isUrlIgnored`,{enumerable:!0,get:function(){return U.isUrlIgnored}}),Object.defineProperty(n,`urlMatches`,{enumerable:!0,get:function(){return U.urlMatches}});var W=require_callback();Object.defineProperty(n,`BindOnceFuture`,{enumerable:!0,get:function(){return W.BindOnceFuture}});var G=require_configuration();Object.defineProperty(n,`diagLogLevelFromString`,{enumerable:!0,get:function(){return G.diagLogLevelFromString}}),n.internal={_export:require_exporter()._export}})),require_default_service_name=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n._clearDefaultServiceNameCache=n.defaultServiceName=void 0;let c;function u(){if(c===void 0)try{let n=globalThis.process.argv0;c=n?`unknown_service:${n}`:`unknown_service`}catch{c=`unknown_service`}return c}n.defaultServiceName=u;function p(){c=void 0}n._clearDefaultServiceNameCache=p})),require_utils$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.isPromiseLike=void 0,n.isPromiseLike=n=>typeof n==`object`&&!!n&&typeof n.then==`function`})),require_ResourceImpl=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.defaultResource=n.emptyResource=n.resourceFromDetectedResource=n.resourceFromAttributes=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_default_service_name(),x=require_utils$1();var w=class n{_rawAttributes;_asyncAttributesPending=!1;_schemaUrl;_memoizedAttributes;static FromAttributeList(c,u){let p=new n({},u);return p._rawAttributes=N(c),p._asyncAttributesPending=c.filter(([n,c])=>(0,x.isPromiseLike)(c)).length>0,p}constructor(n,c){let u=n.attributes??{};this._rawAttributes=Object.entries(u).map(([n,c])=>((0,x.isPromiseLike)(c)&&(this._asyncAttributesPending=!0),[n,c])),this._rawAttributes=N(this._rawAttributes),this._schemaUrl=I(c?.schemaUrl)}get asyncAttributesPending(){return this._asyncAttributesPending}async waitForAsyncAttributes(){if(this.asyncAttributesPending){for(let n=0;n<this._rawAttributes.length;n++){let[c,u]=this._rawAttributes[n];this._rawAttributes[n]=[c,(0,x.isPromiseLike)(u)?await u:u]}this._asyncAttributesPending=!1}}get attributes(){if(this.asyncAttributesPending&&c.diag.error(`Accessing resource attributes before async attributes settled`),this._memoizedAttributes)return this._memoizedAttributes;let n={};for(let[u,p]of this._rawAttributes){if((0,x.isPromiseLike)(p)){c.diag.debug(`Unsettled resource attribute ${u} skipped`);continue}p!=null&&(n[u]??=p)}return this._asyncAttributesPending||(this._memoizedAttributes=n),n}getRawAttributes(){return this._rawAttributes}get schemaUrl(){return this._schemaUrl}merge(c){if(c==null)return this;let u=L(this,c),p=u?{schemaUrl:u}:void 0;return n.FromAttributeList([...c.getRawAttributes(),...this.getRawAttributes()],p)}};function T(n,c){return w.FromAttributeList(Object.entries(n),c)}n.resourceFromAttributes=T;function O(n,c){return new w(n,c)}n.resourceFromDetectedResource=O;function A(){return T({})}n.emptyResource=A;function j(){return T({[p.ATTR_SERVICE_NAME]:(0,h.defaultServiceName)(),[p.ATTR_TELEMETRY_SDK_LANGUAGE]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_LANGUAGE],[p.ATTR_TELEMETRY_SDK_NAME]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_NAME],[p.ATTR_TELEMETRY_SDK_VERSION]:u.SDK_INFO[p.ATTR_TELEMETRY_SDK_VERSION]})}n.defaultResource=j;function N(n){return n.map(([n,u])=>(0,x.isPromiseLike)(u)?[n,u.catch(u=>{c.diag.debug(`promise rejection for resource attribute: %s - %s`,n,u)})]:[n,u])}function I(n){if(typeof n==`string`||n===void 0)return n;c.diag.warn(`Schema URL must be string or undefined, got %s. Schema URL will be ignored.`,n)}function L(n,u){let p=n?.schemaUrl,h=u?.schemaUrl,x=p===void 0||p===``,w=h===void 0||h===``;if(x)return h;if(w||p===h)return p;c.diag.warn(`Schema URL merge conflict: old resource has "%s", updating resource has "%s". Resulting resource will have undefined Schema URL.`,p,h)}})),require_detect_resources=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.detectResources=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_ResourceImpl();n.detectResources=(n={})=>(n.detectors||[]).map(p=>{try{let h=(0,u.resourceFromDetectedResource)(p.detect(n));return c.diag.debug(`${p.constructor.name} found resource.`,h),h}catch(n){return c.diag.debug(`${p.constructor.name} failed: ${n.message}`),(0,u.emptyResource)()}}).reduce((n,c)=>n.merge(c),(0,u.emptyResource)())})),require_EnvDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.envDetector=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=(init_esm$1(),__toCommonJS(esm_exports$1)),p=require_src$3();n.envDetector=new class{_MAX_LENGTH=255;_COMMA_SEPARATOR=`,`;_LABEL_KEY_VALUE_SPLITTER=`=`;detect(n){let h={},x=(0,p.getStringFromEnv)(`OTEL_RESOURCE_ATTRIBUTES`),w=(0,p.getStringFromEnv)(`OTEL_SERVICE_NAME`);if(x)try{let n=this._parseResourceAttributes(x);Object.assign(h,n)}catch(n){c.diag.debug(`EnvDetector failed: ${n instanceof Error?n.message:n}`)}return w&&(h[u.ATTR_SERVICE_NAME]=w),{attributes:h}}_parseResourceAttributes(n){if(!n)return{};let c={},u=n.split(this._COMMA_SEPARATOR).filter(n=>n.trim()!==``);for(let n of u){let u=n.split(this._LABEL_KEY_VALUE_SPLITTER);if(u.length!==2)throw Error(`Invalid format for OTEL_RESOURCE_ATTRIBUTES: "${n}". Expected format: key=value. The ',' and '=' characters must be percent-encoded in keys and values.`);let[p,h]=u,x=p.trim(),w=h.trim();if(x.length===0)throw Error(`Invalid OTEL_RESOURCE_ATTRIBUTES: empty attribute key in "${n}".`);let T,O;try{T=decodeURIComponent(x),O=decodeURIComponent(w)}catch(c){throw Error(`Failed to percent-decode OTEL_RESOURCE_ATTRIBUTES entry "${n}": ${c instanceof Error?c.message:c}`)}if(T.length>this._MAX_LENGTH)throw Error(`Attribute key exceeds the maximum length of ${this._MAX_LENGTH} characters: "${T}".`);if(O.length>this._MAX_LENGTH)throw Error(`Attribute value exceeds the maximum length of ${this._MAX_LENGTH} characters for key "${T}".`);c[T]=O}return c}}})),require_semconv$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ATTR_WEBENGINE_VERSION=n.ATTR_WEBENGINE_NAME=n.ATTR_WEBENGINE_DESCRIPTION=n.ATTR_SERVICE_NAMESPACE=n.ATTR_SERVICE_INSTANCE_ID=n.ATTR_PROCESS_RUNTIME_VERSION=n.ATTR_PROCESS_RUNTIME_NAME=n.ATTR_PROCESS_RUNTIME_DESCRIPTION=n.ATTR_PROCESS_PID=n.ATTR_PROCESS_OWNER=n.ATTR_PROCESS_EXECUTABLE_PATH=n.ATTR_PROCESS_EXECUTABLE_NAME=n.ATTR_PROCESS_COMMAND_ARGS=n.ATTR_PROCESS_COMMAND=n.ATTR_OS_VERSION=n.ATTR_OS_TYPE=n.ATTR_K8S_POD_NAME=n.ATTR_K8S_NAMESPACE_NAME=n.ATTR_K8S_DEPLOYMENT_NAME=n.ATTR_K8S_CLUSTER_NAME=n.ATTR_HOST_TYPE=n.ATTR_HOST_NAME=n.ATTR_HOST_IMAGE_VERSION=n.ATTR_HOST_IMAGE_NAME=n.ATTR_HOST_IMAGE_ID=n.ATTR_HOST_ID=n.ATTR_HOST_ARCH=n.ATTR_CONTAINER_NAME=n.ATTR_CONTAINER_IMAGE_TAGS=n.ATTR_CONTAINER_IMAGE_NAME=n.ATTR_CONTAINER_ID=n.ATTR_CLOUD_REGION=n.ATTR_CLOUD_PROVIDER=n.ATTR_CLOUD_AVAILABILITY_ZONE=n.ATTR_CLOUD_ACCOUNT_ID=void 0,n.ATTR_CLOUD_ACCOUNT_ID=`cloud.account.id`,n.ATTR_CLOUD_AVAILABILITY_ZONE=`cloud.availability_zone`,n.ATTR_CLOUD_PROVIDER=`cloud.provider`,n.ATTR_CLOUD_REGION=`cloud.region`,n.ATTR_CONTAINER_ID=`container.id`,n.ATTR_CONTAINER_IMAGE_NAME=`container.image.name`,n.ATTR_CONTAINER_IMAGE_TAGS=`container.image.tags`,n.ATTR_CONTAINER_NAME=`container.name`,n.ATTR_HOST_ARCH=`host.arch`,n.ATTR_HOST_ID=`host.id`,n.ATTR_HOST_IMAGE_ID=`host.image.id`,n.ATTR_HOST_IMAGE_NAME=`host.image.name`,n.ATTR_HOST_IMAGE_VERSION=`host.image.version`,n.ATTR_HOST_NAME=`host.name`,n.ATTR_HOST_TYPE=`host.type`,n.ATTR_K8S_CLUSTER_NAME=`k8s.cluster.name`,n.ATTR_K8S_DEPLOYMENT_NAME=`k8s.deployment.name`,n.ATTR_K8S_NAMESPACE_NAME=`k8s.namespace.name`,n.ATTR_K8S_POD_NAME=`k8s.pod.name`,n.ATTR_OS_TYPE=`os.type`,n.ATTR_OS_VERSION=`os.version`,n.ATTR_PROCESS_COMMAND=`process.command`,n.ATTR_PROCESS_COMMAND_ARGS=`process.command_args`,n.ATTR_PROCESS_EXECUTABLE_NAME=`process.executable.name`,n.ATTR_PROCESS_EXECUTABLE_PATH=`process.executable.path`,n.ATTR_PROCESS_OWNER=`process.owner`,n.ATTR_PROCESS_PID=`process.pid`,n.ATTR_PROCESS_RUNTIME_DESCRIPTION=`process.runtime.description`,n.ATTR_PROCESS_RUNTIME_NAME=`process.runtime.name`,n.ATTR_PROCESS_RUNTIME_VERSION=`process.runtime.version`,n.ATTR_SERVICE_INSTANCE_ID=`service.instance.id`,n.ATTR_SERVICE_NAMESPACE=`service.namespace`,n.ATTR_WEBENGINE_DESCRIPTION=`webengine.description`,n.ATTR_WEBENGINE_NAME=`webengine.name`,n.ATTR_WEBENGINE_VERSION=`webengine.version`})),require_getMachineId=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.getMachineId=void 0;let c=__require(`process`),u;async function p(){if(!u)switch(c.platform){case`darwin`:u=(await import(`./getMachineId-darwin-BVHajbu-.js`).then(n=>__toESM(n.default))).getMachineId;break;case`linux`:u=(await import(`./getMachineId-linux-DF4P4JAH.js`).then(n=>__toESM(n.default))).getMachineId;break;case`freebsd`:u=(await import(`./getMachineId-bsd-C9rTsHCB.js`).then(n=>__toESM(n.default))).getMachineId;break;case`win32`:u=(await import(`./getMachineId-win-DvS6eAIQ.js`).then(n=>__toESM(n.default))).getMachineId;break;default:u=(await import(`./getMachineId-unsupported-BHgtlyRW.js`).then(n=>__toESM(n.default))).getMachineId;break}return u()}n.getMachineId=p})),require_utils=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.normalizeType=n.normalizeArch=void 0,n.normalizeArch=n=>{switch(n){case`arm`:return`arm32`;case`ppc`:return`ppc32`;case`x64`:return`amd64`;default:return n}},n.normalizeType=n=>{switch(n){case`sunos`:return`solaris`;case`win32`:return`windows`;default:return n}}})),require_HostDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.hostDetector=void 0;let c=require_semconv$1(),u=__require(`os`),p=require_getMachineId(),h=require_utils();n.hostDetector=new class{detect(n){return{attributes:{[c.ATTR_HOST_NAME]:(0,u.hostname)(),[c.ATTR_HOST_ARCH]:(0,h.normalizeArch)((0,u.arch)()),[c.ATTR_HOST_ID]:(0,p.getMachineId)()}}}}})),require_OSDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.osDetector=void 0;let c=require_semconv$1(),u=__require(`os`),p=require_utils();n.osDetector=new class{detect(n){return{attributes:{[c.ATTR_OS_TYPE]:(0,p.normalizeType)((0,u.platform)()),[c.ATTR_OS_VERSION]:(0,u.release)()}}}}})),require_ProcessDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.processDetector=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_semconv$1(),p=__require(`os`);n.processDetector=new class{detect(n){let h={[u.ATTR_PROCESS_PID]:process.pid,[u.ATTR_PROCESS_EXECUTABLE_NAME]:process.title,[u.ATTR_PROCESS_EXECUTABLE_PATH]:process.execPath,[u.ATTR_PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[u.ATTR_PROCESS_RUNTIME_VERSION]:process.versions.node,[u.ATTR_PROCESS_RUNTIME_NAME]:`nodejs`,[u.ATTR_PROCESS_RUNTIME_DESCRIPTION]:`Node.js`};process.argv.length>1&&(h[u.ATTR_PROCESS_COMMAND]=process.argv[1]);try{let n=p.userInfo();h[u.ATTR_PROCESS_OWNER]=n.username}catch(n){c.diag.debug(`error obtaining process owner: ${n}`)}return{attributes:h}}}})),require_ServiceInstanceIdDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=void 0;let c=require_semconv$1(),u=__require(`crypto`);n.serviceInstanceIdDetector=new class{detect(n){return{attributes:{[c.ATTR_SERVICE_INSTANCE_ID]:(0,u.randomUUID)()}}}}})),require_node$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=void 0;var c=require_HostDetector();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return c.hostDetector}});var u=require_OSDetector();Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}});var p=require_ProcessDetector();Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return p.processDetector}});var h=require_ServiceInstanceIdDetector();Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return h.serviceInstanceIdDetector}})})),require_platform$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=void 0;var c=require_node$1();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return c.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return c.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return c.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return c.serviceInstanceIdDetector}})})),require_NoopDetector=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.noopDetector=n.NoopDetector=void 0;var c=class{detect(){return{attributes:{}}}};n.NoopDetector=c,n.noopDetector=new c})),require_detectors=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.noopDetector=n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=n.envDetector=void 0;var c=require_EnvDetector();Object.defineProperty(n,`envDetector`,{enumerable:!0,get:function(){return c.envDetector}});var u=require_platform$1();Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return u.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return u.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return u.serviceInstanceIdDetector}});var p=require_NoopDetector();Object.defineProperty(n,`noopDetector`,{enumerable:!0,get:function(){return p.noopDetector}})})),require_src$2=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.defaultServiceName=n.emptyResource=n.defaultResource=n.resourceFromAttributes=n.serviceInstanceIdDetector=n.processDetector=n.osDetector=n.hostDetector=n.envDetector=n.detectResources=void 0;var c=require_detect_resources();Object.defineProperty(n,`detectResources`,{enumerable:!0,get:function(){return c.detectResources}});var u=require_detectors();Object.defineProperty(n,`envDetector`,{enumerable:!0,get:function(){return u.envDetector}}),Object.defineProperty(n,`hostDetector`,{enumerable:!0,get:function(){return u.hostDetector}}),Object.defineProperty(n,`osDetector`,{enumerable:!0,get:function(){return u.osDetector}}),Object.defineProperty(n,`processDetector`,{enumerable:!0,get:function(){return u.processDetector}}),Object.defineProperty(n,`serviceInstanceIdDetector`,{enumerable:!0,get:function(){return u.serviceInstanceIdDetector}});var p=require_ResourceImpl();Object.defineProperty(n,`resourceFromAttributes`,{enumerable:!0,get:function(){return p.resourceFromAttributes}}),Object.defineProperty(n,`defaultResource`,{enumerable:!0,get:function(){return p.defaultResource}}),Object.defineProperty(n,`emptyResource`,{enumerable:!0,get:function(){return p.emptyResource}});var h=require_default_service_name();Object.defineProperty(n,`defaultServiceName`,{enumerable:!0,get:function(){return h.defaultServiceName}})})),require_enums=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ExceptionEventName=void 0,n.ExceptionEventName=`exception`})),require_Span=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SpanImpl=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=(init_esm$1(),__toCommonJS(esm_exports$1)),h=require_enums();n.SpanImpl=class{_spanContext;kind;parentSpanContext;attributes={};links=[];events=[];startTime;resource;instrumentationScope;_droppedAttributesCount=0;_droppedEventsCount=0;_droppedLinksCount=0;_attributesCount=0;name;status={code:c.SpanStatusCode.UNSET};endTime=[0,0];_ended=!1;_duration=[-1,-1];_spanProcessor;_spanLimits;_attributeValueLengthLimit;_recordEndMetrics;_performanceStartTime;_performanceOffset;_startTimeProvided;constructor(n){let c=Date.now();if(this._spanContext=n.spanContext,this._performanceStartTime=u.otperformance.now(),this._performanceOffset=c-(this._performanceStartTime+u.otperformance.timeOrigin),this._startTimeProvided=n.startTime!=null,this._spanLimits=n.spanLimits,this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit??0,this._spanProcessor=n.spanProcessor,this.name=n.name,this.parentSpanContext=n.parentSpanContext,this.kind=n.kind,n.links)for(let c of n.links)this.addLink(c);this.startTime=this._getTime(n.startTime??c),this.resource=n.resource,this.instrumentationScope=n.scope,this._recordEndMetrics=n.recordEndMetrics,n.attributes!=null&&this.setAttributes(n.attributes),this._spanProcessor.onStart(this,n.context)}spanContext(){return this._spanContext}setAttribute(n,p){if(p==null||this._isSpanEnded())return this;if(n.length===0)return c.diag.warn(`Invalid attribute key: ${n}`),this;if(!(0,u.isAttributeValue)(p))return c.diag.warn(`Invalid attribute value set for key: ${n}`),this;let{attributeCountLimit:h}=this._spanLimits,x=!Object.prototype.hasOwnProperty.call(this.attributes,n);return h!==void 0&&this._attributesCount>=h&&x?(this._droppedAttributesCount++,this):(this.attributes[n]=this._truncateToSize(p),x&&this._attributesCount++,this)}setAttributes(n){for(let c in n)Object.prototype.hasOwnProperty.call(n,c)&&this.setAttribute(c,n[c]);return this}addEvent(n,p,h){if(this._isSpanEnded())return this;let{eventCountLimit:x}=this._spanLimits;if(x===0)return c.diag.warn(`No events allowed.`),this._droppedEventsCount++,this;x!==void 0&&this.events.length>=x&&(this._droppedEventsCount===0&&c.diag.debug(`Dropping extra events.`),this.events.shift(),this._droppedEventsCount++),(0,u.isTimeInput)(p)&&((0,u.isTimeInput)(h)||(h=p),p=void 0);let w=(0,u.sanitizeAttributes)(p),{attributePerEventCountLimit:T}=this._spanLimits,O={},A=0,j=0;for(let n in w){if(!Object.prototype.hasOwnProperty.call(w,n))continue;let c=w[n];if(T!==void 0&&j>=T){A++;continue}O[n]=this._truncateToSize(c),j++}return this.events.push({name:n,attributes:O,time:this._getTime(h),droppedAttributesCount:A}),this}addLink(n){if(this._isSpanEnded())return this;let{linkCountLimit:p}=this._spanLimits;if(p===0)return this._droppedLinksCount++,this;p!==void 0&&this.links.length>=p&&(this._droppedLinksCount===0&&c.diag.debug(`Dropping extra links.`),this.links.shift(),this._droppedLinksCount++);let{attributePerLinkCountLimit:h}=this._spanLimits,x=(0,u.sanitizeAttributes)(n.attributes),w={},T=0,O=0;for(let n in x){if(!Object.prototype.hasOwnProperty.call(x,n))continue;let c=x[n];if(h!==void 0&&O>=h){T++;continue}w[n]=this._truncateToSize(c),O++}let A={context:n.context};return O>0&&(A.attributes=w),T>0&&(A.droppedAttributesCount=T),this.links.push(A),this}addLinks(n){for(let c of n)this.addLink(c);return this}setStatus(n){if(this._isSpanEnded()||n.code===c.SpanStatusCode.UNSET||this.status.code===c.SpanStatusCode.OK)return this;let u={code:n.code};return n.code===c.SpanStatusCode.ERROR&&(typeof n.message==`string`?u.message=n.message:n.message!=null&&c.diag.warn(`Dropping invalid status.message of type '${typeof n.message}', expected 'string'`)),this.status=u,this}updateName(n){return this._isSpanEnded()||(this.name=n),this}end(n){if(this._isSpanEnded()){c.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this.endTime=this._getTime(n),this._duration=(0,u.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(c.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&&c.diag.warn(`Dropped ${this._droppedEventsCount} events because eventCountLimit reached`),this._droppedLinksCount>0&&c.diag.warn(`Dropped ${this._droppedLinksCount} links because linkCountLimit reached`),this._spanProcessor.onEnding&&this._spanProcessor.onEnding(this),this._recordEndMetrics?.(),this._ended=!0,this._spanProcessor.onEnd(this)}_getTime(n){if(typeof n==`number`&&n<=u.otperformance.now())return(0,u.hrTime)(n+this._performanceOffset);if(typeof n==`number`)return(0,u.millisToHrTime)(n);if(n instanceof Date)return(0,u.millisToHrTime)(n.getTime());if((0,u.isTimeInputHrTime)(n))return n;if(this._startTimeProvided)return(0,u.millisToHrTime)(Date.now());let c=u.otperformance.now()-this._performanceStartTime;return(0,u.addHrTimes)(this.startTime,(0,u.millisToHrTime)(c))}isRecording(){return this._ended===!1}recordException(n,u){let x={};typeof n==`string`?x[p.ATTR_EXCEPTION_MESSAGE]=n:n&&(n.code?x[p.ATTR_EXCEPTION_TYPE]=n.code.toString():n.name&&(x[p.ATTR_EXCEPTION_TYPE]=n.name),n.message&&(x[p.ATTR_EXCEPTION_MESSAGE]=n.message),n.stack&&(x[p.ATTR_EXCEPTION_STACKTRACE]=n.stack)),x[p.ATTR_EXCEPTION_TYPE]||x[p.ATTR_EXCEPTION_MESSAGE]?this.addEvent(h.ExceptionEventName,x,u):c.diag.warn(`Failed to record an exception ${n}`)}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(){if(this._ended){let n=Error(`Operation attempted on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`);c.diag.warn(`Cannot execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`,n)}return this._ended}_truncateToLimitUtil(n,c){return n.length<=c?n:n.substring(0,c)}_truncateToSize(n){let u=this._attributeValueLengthLimit;return u<=0?(c.diag.warn(`Attribute value limit must be positive, got ${u}`),n):typeof n==`string`?this._truncateToLimitUtil(n,u):Array.isArray(n)?n.map(n=>typeof n==`string`?this._truncateToLimitUtil(n,u):n):n}}})),require_Sampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=void 0,(function(n){n[n.NOT_RECORD=0]=`NOT_RECORD`,n[n.RECORD=1]=`RECORD`,n[n.RECORD_AND_SAMPLED=2]=`RECORD_AND_SAMPLED`})(n.SamplingDecision||={})})),require_AlwaysOffSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOffSampler=void 0;let c=require_Sampler();n.AlwaysOffSampler=class{shouldSample(){return{decision:c.SamplingDecision.NOT_RECORD}}toString(){return`AlwaysOffSampler`}}})),require_AlwaysOnSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.AlwaysOnSampler=void 0;let c=require_Sampler();n.AlwaysOnSampler=class{shouldSample(){return{decision:c.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return`AlwaysOnSampler`}}})),require_ParentBasedSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ParentBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_AlwaysOffSampler(),h=require_AlwaysOnSampler();n.ParentBasedSampler=class{_root;_remoteParentSampled;_remoteParentNotSampled;_localParentSampled;_localParentNotSampled;constructor(n){this._root=n.root,this._root||=((0,u.globalErrorHandler)(Error(`ParentBasedSampler must have a root sampler configured`)),new h.AlwaysOnSampler),this._remoteParentSampled=n.remoteParentSampled??new h.AlwaysOnSampler,this._remoteParentNotSampled=n.remoteParentNotSampled??new p.AlwaysOffSampler,this._localParentSampled=n.localParentSampled??new h.AlwaysOnSampler,this._localParentNotSampled=n.localParentNotSampled??new p.AlwaysOffSampler}shouldSample(n,u,p,h,x,w){let T=c.trace.getSpanContext(n);return!T||!(0,c.isSpanContextValid)(T)?this._root.shouldSample(n,u,p,h,x,w):T.isRemote?T.traceFlags&c.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(n,u,p,h,x,w):this._remoteParentNotSampled.shouldSample(n,u,p,h,x,w):T.traceFlags&c.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(n,u,p,h,x,w):this._localParentNotSampled.shouldSample(n,u,p,h,x,w)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}}})),require_TraceIdRatioBasedSampler=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_Sampler();n.TraceIdRatioBasedSampler=class{_ratio;_upperBound;constructor(n=0){this._ratio=this._normalize(n),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(n,p){return{decision:(0,c.isValidTraceId)(p)&&this._accumulate(p)<this._upperBound?u.SamplingDecision.RECORD_AND_SAMPLED:u.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(n){return typeof n!=`number`||isNaN(n)?0:n>=1?1:n<=0?0:n}_accumulate(n){let c=0;for(let u=0;u<n.length/8;u++){let p=u*8,h=parseInt(n.slice(p,p+8),16);c=(c^h)>>>0}return c}}})),require_config=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.buildSamplerFromEnv=n.loadDefaultConfig=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_AlwaysOffSampler(),h=require_AlwaysOnSampler(),x=require_ParentBasedSampler(),w=require_TraceIdRatioBasedSampler();var T;(function(n){n.AlwaysOff=`always_off`,n.AlwaysOn=`always_on`,n.ParentBasedAlwaysOff=`parentbased_always_off`,n.ParentBasedAlwaysOn=`parentbased_always_on`,n.ParentBasedTraceIdRatio=`parentbased_traceidratio`,n.TraceIdRatio=`traceidratio`})(T||={});let O=1;function A(){return{sampler:j(),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??128},spanLimits:{attributeValueLengthLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??1/0,attributeCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??128,linkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_LINK_COUNT_LIMIT`)??128,eventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_EVENT_COUNT_LIMIT`)??128,attributePerEventCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT`)??128,attributePerLinkCountLimit:(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT`)??128}}}n.loadDefaultConfig=A;function j(){let n=(0,u.getStringFromEnv)(`OTEL_TRACES_SAMPLER`)??T.ParentBasedAlwaysOn;switch(n){case T.AlwaysOn:return new h.AlwaysOnSampler;case T.AlwaysOff:return new p.AlwaysOffSampler;case T.ParentBasedAlwaysOn:return new x.ParentBasedSampler({root:new h.AlwaysOnSampler});case T.ParentBasedAlwaysOff:return new x.ParentBasedSampler({root:new p.AlwaysOffSampler});case T.TraceIdRatio:return new w.TraceIdRatioBasedSampler(N());case T.ParentBasedTraceIdRatio:return new x.ParentBasedSampler({root:new w.TraceIdRatioBasedSampler(N())});default:return c.diag.error(`OTEL_TRACES_SAMPLER value "${n}" invalid, defaulting to "${T.ParentBasedAlwaysOn}".`),new x.ParentBasedSampler({root:new h.AlwaysOnSampler})}}n.buildSamplerFromEnv=j;function N(){let n=(0,u.getNumberFromEnv)(`OTEL_TRACES_SAMPLER_ARG`);return n==null?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to 1.`),1):n<0||n>1?(c.diag.error(`OTEL_TRACES_SAMPLER_ARG=${n} was given, but it is out of range ([0..1]), defaulting to 1.`),1):n}})),require_utility=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.reconfigureLimits=n.mergeConfig=n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=void 0;let c=require_config(),u=require_src$3();n.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128,n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;function p(n){let u={sampler:(0,c.buildSamplerFromEnv)()},p=(0,c.loadDefaultConfig)(),h=Object.assign({},p,u,n);return h.generalLimits=Object.assign({},p.generalLimits,n.generalLimits||{}),h.spanLimits=Object.assign({},p.spanLimits,n.spanLimits||{}),h}n.mergeConfig=p;function h(c){let p=Object.assign({},c.spanLimits);return p.attributeCountLimit=c.spanLimits?.attributeCountLimit??c.generalLimits?.attributeCountLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_COUNT_LIMIT`)??n.DEFAULT_ATTRIBUTE_COUNT_LIMIT,p.attributeValueLengthLimit=c.spanLimits?.attributeValueLengthLimit??c.generalLimits?.attributeValueLengthLimit??(0,u.getNumberFromEnv)(`OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??(0,u.getNumberFromEnv)(`OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT`)??n.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},c,{spanLimits:p})}n.reconfigureLimits=h})),require_BatchSpanProcessorBase=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessorBase=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3();n.BatchSpanProcessorBase=class{_maxExportBatchSize;_maxQueueSize;_scheduledDelayMillis;_exportTimeoutMillis;_exporter;_isExporting=!1;_finishedSpans=[];_timer;_shutdownOnce;_droppedSpansCount=0;constructor(n,p){this._exporter=n,this._maxExportBatchSize=typeof p?.maxExportBatchSize==`number`?p.maxExportBatchSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_EXPORT_BATCH_SIZE`)??512,this._maxQueueSize=typeof p?.maxQueueSize==`number`?p.maxQueueSize:(0,u.getNumberFromEnv)(`OTEL_BSP_MAX_QUEUE_SIZE`)??2048,this._scheduledDelayMillis=typeof p?.scheduledDelayMillis==`number`?p.scheduledDelayMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_SCHEDULE_DELAY`)??5e3,this._exportTimeoutMillis=typeof p?.exportTimeoutMillis==`number`?p.exportTimeoutMillis:(0,u.getNumberFromEnv)(`OTEL_BSP_EXPORT_TIMEOUT`)??3e4,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(c.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(n,c){}onEnd(n){this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)!==0&&this._addToBuffer(n)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(n){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&c.diag.debug(`maxQueueSize reached, dropping spans`),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(c.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(n),this._maybeStartTimer()}_flushAll(){return new Promise((n,c)=>{let u=[],p=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let n=0,c=p;n<c;n++)u.push(this._flushOneBatch());Promise.all(u).then(()=>{n()}).catch(c)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((n,p)=>{let h=setTimeout(()=>{p(Error(`Timeout`))},this._exportTimeoutMillis);c.context.with((0,u.suppressTracing)(c.context.active()),()=>{let c;this._finishedSpans.length<=this._maxExportBatchSize?(c=this._finishedSpans,this._finishedSpans=[]):c=this._finishedSpans.splice(0,this._maxExportBatchSize);let x=()=>this._exporter.export(c,c=>{clearTimeout(h),c.code===u.ExportResultCode.SUCCESS?n():p(c.error??Error(`BatchSpanProcessor: span export failed`))}),w=null;for(let n=0,u=c.length;n<u;n++){let u=c[n];u.resource.asyncAttributesPending&&u.resource.waitForAsyncAttributes&&(w??=[],w.push(u.resource.waitForAsyncAttributes()))}w===null?x():Promise.all(w).then(x,n=>{(0,u.globalErrorHandler)(n),p(n)})})})}_maybeStartTimer(){if(this._isExporting)return;let n=()=>{this._isExporting=!0,this._flushOneBatch().finally(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(n=>{this._isExporting=!1,(0,u.globalErrorHandler)(n)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return n();this._timer===void 0&&(this._timer=setTimeout(()=>n(),this._scheduledDelayMillis),typeof this._timer!=`number`&&this._timer.unref())}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}}})),require_BatchSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BatchSpanProcessor=void 0;let c=require_BatchSpanProcessorBase();n.BatchSpanProcessor=class extends c.BatchSpanProcessorBase{onShutdown(){}}})),require_RandomIdGenerator=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=void 0;let c=8,u=16;n.RandomIdGenerator=class{generateTraceId=h(16);generateSpanId=h(8)};let p=Buffer.allocUnsafe(16);function h(n){return function(){for(let c=0;c<n/4;c++)p.writeUInt32BE(Math.random()*2**32>>>0,c*4);for(let c=0;c<n&&!(p[c]>0);c++)c===n-1&&(p[n-1]=1);return p.toString(`hex`,0,n)}}})),require_node=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_BatchSpanProcessor();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}});var u=require_RandomIdGenerator();Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}})})),require_platform=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.RandomIdGenerator=n.BatchSpanProcessor=void 0;var c=require_node();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return c.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return c.RandomIdGenerator}})})),require_semconv=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.METRIC_OTEL_SDK_SPAN_STARTED=n.METRIC_OTEL_SDK_SPAN_LIVE=n.ATTR_OTEL_SPAN_SAMPLING_RESULT=n.ATTR_OTEL_SPAN_PARENT_ORIGIN=void 0,n.ATTR_OTEL_SPAN_PARENT_ORIGIN=`otel.span.parent.origin`,n.ATTR_OTEL_SPAN_SAMPLING_RESULT=`otel.span.sampling_result`,n.METRIC_OTEL_SDK_SPAN_LIVE=`otel.sdk.span.live`,n.METRIC_OTEL_SDK_SPAN_STARTED=`otel.sdk.span.started`})),require_TracerMetrics=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TracerMetrics=void 0;let c=require_Sampler(),u=require_semconv();n.TracerMetrics=class{startedSpans;liveSpans;constructor(n){this.startedSpans=n.createCounter(u.METRIC_OTEL_SDK_SPAN_STARTED,{unit:`{span}`,description:`The number of created spans.`}),this.liveSpans=n.createUpDownCounter(u.METRIC_OTEL_SDK_SPAN_LIVE,{unit:`{span}`,description:`The number of currently live spans.`})}startSpan(n,x){let w=h(x);if(this.startedSpans.add(1,{[u.ATTR_OTEL_SPAN_PARENT_ORIGIN]:p(n),[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w}),x===c.SamplingDecision.NOT_RECORD)return()=>{};let T={[u.ATTR_OTEL_SPAN_SAMPLING_RESULT]:w};return this.liveSpans.add(1,T),()=>{this.liveSpans.add(-1,T)}}};function p(n){return n?n.isRemote?`remote`:`local`:`none`}function h(n){switch(n){case c.SamplingDecision.RECORD_AND_SAMPLED:return`RECORD_AND_SAMPLE`;case c.SamplingDecision.RECORD:return`RECORD_ONLY`;case c.SamplingDecision.NOT_RECORD:return`DROP`}}})),require_version=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.VERSION=void 0,n.VERSION=`2.7.0`})),require_Tracer=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.Tracer=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3(),p=require_Span(),h=require_utility(),x=require_platform(),w=require_TracerMetrics(),T=require_version();n.Tracer=class{_sampler;_generalLimits;_spanLimits;_idGenerator;instrumentationScope;_resource;_spanProcessor;_tracerMetrics;constructor(n,u,p,O){let A=(0,h.mergeConfig)(u);this._sampler=A.sampler,this._generalLimits=A.generalLimits,this._spanLimits=A.spanLimits,this._idGenerator=u.idGenerator||new x.RandomIdGenerator,this._resource=p,this._spanProcessor=O,this.instrumentationScope=n;let j=A.meterProvider?A.meterProvider.getMeter(`@opentelemetry/sdk-trace`,T.VERSION):c.createNoopMeter();this._tracerMetrics=new w.TracerMetrics(j)}startSpan(n,h={},x=c.context.active()){h.root&&(x=c.trace.deleteSpan(x));let w=c.trace.getSpan(x);if((0,u.isTracingSuppressed)(x))return c.diag.debug(`Instrumentation suppressed, returning Noop Span`),c.trace.wrapSpanContext(c.INVALID_SPAN_CONTEXT);let T=w?.spanContext(),O=this._idGenerator.generateSpanId(),A,j,N;!T||!c.trace.isSpanContextValid(T)?j=this._idGenerator.generateTraceId():(j=T.traceId,N=T.traceState,A=T);let I=h.kind??c.SpanKind.INTERNAL,L=(h.links??[]).map(n=>({context:n.context,attributes:(0,u.sanitizeAttributes)(n.attributes)})),z=(0,u.sanitizeAttributes)(h.attributes),B=this._sampler.shouldSample(x,j,n,I,z,L),V=this._tracerMetrics.startSpan(T,B.decision);N=B.traceState??N;let H=B.decision===c.SamplingDecision.RECORD_AND_SAMPLED?c.TraceFlags.SAMPLED:c.TraceFlags.NONE,U={traceId:j,spanId:O,traceFlags:H,traceState:N};if(B.decision===c.SamplingDecision.NOT_RECORD)return c.diag.debug(`Recording is off, propagating context in a non-recording span`),c.trace.wrapSpanContext(U);let W=(0,u.sanitizeAttributes)(Object.assign(z,B.attributes));return new p.SpanImpl({resource:this._resource,scope:this.instrumentationScope,context:x,spanContext:U,name:n,kind:I,links:L,parentSpanContext:A,attributes:W,startTime:h.startTime,spanProcessor:this._spanProcessor,spanLimits:this._spanLimits,recordEndMetrics:V})}startActiveSpan(n,u,p,h){let x,w,T;if(arguments.length<2)return;arguments.length===2?T=u:arguments.length===3?(x=u,T=p):(x=u,w=p,T=h);let O=w??c.context.active(),A=this.startSpan(n,x,O),j=c.trace.setSpan(O,A);return c.context.with(j,T,void 0,A)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}}})),require_MultiSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.MultiSpanProcessor=void 0;let c=require_src$3();n.MultiSpanProcessor=class{_spanProcessors;constructor(n){this._spanProcessors=n}forceFlush(){let n=[];for(let c of this._spanProcessors)n.push(c.forceFlush());return new Promise(u=>{Promise.all(n).then(()=>{u()}).catch(n=>{(0,c.globalErrorHandler)(n||Error(`MultiSpanProcessor: forceFlush failed`)),u()})})}onStart(n,c){for(let u of this._spanProcessors)u.onStart(n,c)}onEnding(n){for(let c of this._spanProcessors)c.onEnding&&c.onEnding(n)}onEnd(n){for(let c of this._spanProcessors)c.onEnd(n)}shutdown(){let n=[];for(let c of this._spanProcessors)n.push(c.shutdown());return new Promise((c,u)=>{Promise.all(n).then(()=>{c()},u)})}}})),require_BasicTracerProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.BasicTracerProvider=n.ForceFlushState=void 0;let c=require_src$3(),u=require_src$2(),p=require_Tracer(),h=require_config(),x=require_MultiSpanProcessor(),w=require_utility();var T;(function(n){n[n.resolved=0]=`resolved`,n[n.timeout=1]=`timeout`,n[n.error=2]=`error`,n[n.unresolved=3]=`unresolved`})(T=n.ForceFlushState||={}),n.BasicTracerProvider=class{_config;_tracers=new Map;_resource;_activeSpanProcessor;constructor(n={}){let p=(0,c.merge)({},(0,h.loadDefaultConfig)(),(0,w.reconfigureLimits)(n));this._resource=p.resource??(0,u.defaultResource)(),this._config=Object.assign({},p,{resource:this._resource});let T=[];n.spanProcessors?.length&&T.push(...n.spanProcessors),this._activeSpanProcessor=new x.MultiSpanProcessor(T)}getTracer(n,c,u){let h=`${n}@${c||``}:${u?.schemaUrl||``}`;return this._tracers.has(h)||this._tracers.set(h,new p.Tracer({name:n,version:c,schemaUrl:u?.schemaUrl},this._config,this._resource,this._activeSpanProcessor)),this._tracers.get(h)}forceFlush(){let n=this._config.forceFlushTimeoutMillis,c=this._activeSpanProcessor._spanProcessors.map(c=>new Promise(u=>{let p,h=setTimeout(()=>{u(Error(`Span processor did not completed within timeout period of ${n} ms`)),p=T.timeout},n);c.forceFlush().then(()=>{clearTimeout(h),p!==T.timeout&&(p=T.resolved,u(p))}).catch(n=>{clearTimeout(h),p=T.error,u(n)})}));return new Promise((n,u)=>{Promise.all(c).then(c=>{let p=c.filter(n=>n!==T.resolved);p.length>0?u(p):n()}).catch(n=>u([n]))})}shutdown(){return this._activeSpanProcessor.shutdown()}}})),require_ConsoleSpanExporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.ConsoleSpanExporter=void 0;let c=require_src$3();n.ConsoleSpanExporter=class{export(n,c){return this._sendSpans(n,c)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(n){return{resource:{attributes:n.resource.attributes},instrumentationScope:n.instrumentationScope,traceId:n.spanContext().traceId,parentSpanContext:n.parentSpanContext,traceState:n.spanContext().traceState?.serialize(),name:n.name,id:n.spanContext().spanId,kind:n.kind,timestamp:(0,c.hrTimeToMicroseconds)(n.startTime),duration:(0,c.hrTimeToMicroseconds)(n.duration),attributes:n.attributes,status:n.status,events:n.events,links:n.links}}_sendSpans(n,u){for(let c of n)console.dir(this._exportInfo(c),{depth:3});if(u)return u({code:c.ExportResultCode.SUCCESS})}}})),require_InMemorySpanExporter=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.InMemorySpanExporter=void 0;let c=require_src$3();n.InMemorySpanExporter=class{_finishedSpans=[];_stopped=!1;export(n,u){if(this._stopped)return u({code:c.ExportResultCode.FAILED,error:Error(`Exporter has been stopped`)});this._finishedSpans.push(...n),setTimeout(()=>u({code:c.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}}})),require_SimpleSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SimpleSpanProcessor=void 0;let c=(init_esm$2(),__toCommonJS(esm_exports$2)),u=require_src$3();n.SimpleSpanProcessor=class{_exporter;_shutdownOnce;_pendingExports;constructor(n){this._exporter=n,this._shutdownOnce=new u.BindOnceFuture(this._shutdown,this),this._pendingExports=new Set}async forceFlush(){await Promise.all(Array.from(this._pendingExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(n,c){}onEnd(n){if(this._shutdownOnce.isCalled||(n.spanContext().traceFlags&c.TraceFlags.SAMPLED)===0)return;let p=this._doExport(n).catch(n=>(0,u.globalErrorHandler)(n));this._pendingExports.add(p),p.finally(()=>this._pendingExports.delete(p))}async _doExport(n){n.resource.asyncAttributesPending&&await n.resource.waitForAsyncAttributes?.();let c=await u.internal._export(this._exporter,[n]);if(c.code!==u.ExportResultCode.SUCCESS)throw c.error??Error(`SimpleSpanProcessor: span export failed (status ${c})`)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}}})),require_NoopSpanProcessor=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NoopSpanProcessor=void 0,n.NoopSpanProcessor=class{onStart(n,c){}onEnd(n){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}}})),require_src$1=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.SamplingDecision=n.TraceIdRatioBasedSampler=n.ParentBasedSampler=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NoopSpanProcessor=n.SimpleSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.RandomIdGenerator=n.BatchSpanProcessor=n.BasicTracerProvider=void 0;var c=require_BasicTracerProvider();Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return c.BasicTracerProvider}});var u=require_platform();Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}});var p=require_ConsoleSpanExporter();Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return p.ConsoleSpanExporter}});var h=require_InMemorySpanExporter();Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return h.InMemorySpanExporter}});var x=require_SimpleSpanProcessor();Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return x.SimpleSpanProcessor}});var w=require_NoopSpanProcessor();Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return w.NoopSpanProcessor}});var T=require_AlwaysOffSampler();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return T.AlwaysOffSampler}});var O=require_AlwaysOnSampler();Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return O.AlwaysOnSampler}});var A=require_ParentBasedSampler();Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return A.ParentBasedSampler}});var j=require_TraceIdRatioBasedSampler();Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return j.TraceIdRatioBasedSampler}});var N=require_Sampler();Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return N.SamplingDecision}})})),require_NodeTracerProvider=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.NodeTracerProvider=void 0;let c=require_src$15(),u=require_src$1(),p=(init_esm$2(),__toCommonJS(esm_exports$2)),h=require_src$3();function x(n){if(n!==null){if(n===void 0){let n=new c.AsyncLocalStorageContextManager;n.enable(),p.context.setGlobalContextManager(n);return}n.enable(),p.context.setGlobalContextManager(n)}}function w(n){if(n!==null){if(n===void 0){p.propagation.setGlobalPropagator(new h.CompositePropagator({propagators:[new h.W3CTraceContextPropagator,new h.W3CBaggagePropagator]}));return}p.propagation.setGlobalPropagator(n)}}n.NodeTracerProvider=class extends u.BasicTracerProvider{constructor(n={}){super(n)}register(n={}){p.trace.setGlobalTracerProvider(this),x(n.contextManager),w(n.propagator)}}})),require_src=__commonJSMin$1((n=>{Object.defineProperty(n,`__esModule`,{value:!0}),n.TraceIdRatioBasedSampler=n.SimpleSpanProcessor=n.SamplingDecision=n.RandomIdGenerator=n.ParentBasedSampler=n.NoopSpanProcessor=n.InMemorySpanExporter=n.ConsoleSpanExporter=n.BatchSpanProcessor=n.BasicTracerProvider=n.AlwaysOnSampler=n.AlwaysOffSampler=n.NodeTracerProvider=void 0;var c=require_NodeTracerProvider();Object.defineProperty(n,`NodeTracerProvider`,{enumerable:!0,get:function(){return c.NodeTracerProvider}});var u=require_src$1();Object.defineProperty(n,`AlwaysOffSampler`,{enumerable:!0,get:function(){return u.AlwaysOffSampler}}),Object.defineProperty(n,`AlwaysOnSampler`,{enumerable:!0,get:function(){return u.AlwaysOnSampler}}),Object.defineProperty(n,`BasicTracerProvider`,{enumerable:!0,get:function(){return u.BasicTracerProvider}}),Object.defineProperty(n,`BatchSpanProcessor`,{enumerable:!0,get:function(){return u.BatchSpanProcessor}}),Object.defineProperty(n,`ConsoleSpanExporter`,{enumerable:!0,get:function(){return u.ConsoleSpanExporter}}),Object.defineProperty(n,`InMemorySpanExporter`,{enumerable:!0,get:function(){return u.InMemorySpanExporter}}),Object.defineProperty(n,`NoopSpanProcessor`,{enumerable:!0,get:function(){return u.NoopSpanProcessor}}),Object.defineProperty(n,`ParentBasedSampler`,{enumerable:!0,get:function(){return u.ParentBasedSampler}}),Object.defineProperty(n,`RandomIdGenerator`,{enumerable:!0,get:function(){return u.RandomIdGenerator}}),Object.defineProperty(n,`SamplingDecision`,{enumerable:!0,get:function(){return u.SamplingDecision}}),Object.defineProperty(n,`SimpleSpanProcessor`,{enumerable:!0,get:function(){return u.SimpleSpanProcessor}}),Object.defineProperty(n,`TraceIdRatioBasedSampler`,{enumerable:!0,get:function(){return u.TraceIdRatioBasedSampler}})}));init_esm$2();var import_src=require_src$17(),import_src$1=require_src$16(),import_src$2=require_src$15(),import_src$3=require_src$18(),import_src$4=require_src$10(),import_src$5=require_src$9(),import_src$6=require_src$8(),import_src$7=require_src$7(),import_src$8=require_src$6(),import_src$9=require_src$5(),import_src$10=require_src$4(),import_src$11=require_src();const TRAILING_SLASH_PATTERN=/\/+$/,SIGNAL_SUFFIX_PATTERN=/\/v1\/(logs|metrics|traces)$/,normalizeOtlpSignalEndpoint=(n,c)=>{if(!n)throw Error(`OTEL_EXPORTER_OTLP_ENDPOINT is required when OTEL_ENABLED=true`);let u=n.replace(TRAILING_SLASH_PATTERN,``);return u.endsWith(`/v1/${c}`)?u:SIGNAL_SUFFIX_PATTERN.test(u)?u.replace(SIGNAL_SUFFIX_PATTERN,`/v1/${c}`):`${u}/v1/${c}`},parseOtlpHeaders=n=>{let c=n?.trim();return c?c.split(`,`).map(n=>n.trim()).filter(Boolean).reduce((n,c)=>{let u=c.indexOf(`=`);if(u<=0)return n;let p=c.slice(0,u).trim(),h=c.slice(u+1).trim();return!p||!h||(n[p]=h),n},{}):{}},scopeStorage=new AsyncLocalStorage,compactScopeAttributes=n=>{let c={};for(let[u,p]of Object.entries(n))p!=null&&(c[u]=p);return c},getCurrentScopeAttributes=()=>scopeStorage.getStore()??{},mergeScopeAttributes=(n,c)=>compactScopeAttributes({...n,...c}),runWithScopeAttributes=(n,c)=>{let u=mergeScopeAttributes(getCurrentScopeAttributes(),n);return scopeStorage.run(u,c)},normalizeError=n=>n instanceof Error?{message:n.message,name:n.name,...n.stack?{stack:n.stack}:{}}:{message:String(n),name:`Error`},toExceptionAttributes=n=>{let c=normalizeError(n.error),u=mergeScopeAttributes(getCurrentScopeAttributes(),n.attributes??{}),p={};for(let[n,c]of Object.entries(u))c!=null&&(p[n]=c);return p[`echo.exception.handled`]=n.handled,p[`echo.exception.level`]=n.level,p[`echo.exception.mechanism`]=n.mechanism,p[`error.message`]=c.message,p[`error.type`]=c.name,n.fingerprint&&n.fingerprint.length>0&&(p[`echo.exception.fingerprint`]=n.fingerprint.join(`,`)),p},setSpanErrorStatus=(n,c)=>{let u=normalizeError(c);n.setStatus({code:SpanStatusCode.ERROR,message:u.message})},recordExceptionOnSpan=(n,c)=>{let u=normalizeError(c.error);n.setAttributes(toExceptionAttributes(c)),n.recordException({message:u.message,name:u.name,...u.stack?{stack:u.stack}:{}}),setSpanErrorStatus(n,c.error)},captureExceptionAsSpan=n=>{let c={...n.exception,attributes:mergeScopeAttributes(n.spanAttributes??{},n.exception.attributes??{})},u=trace.getSpan(context$1.active());if(u){recordExceptionOnSpan(u,c);return}let p=trace.getTracer(n.serviceName).startSpan(n.spanName??`observability.exception`,{attributes:toExceptionAttributes(c)});recordExceptionOnSpan(p,c),p.end()},NODE_OTEL_RESOURCE_DETECTORS=[import_src.envDetector,import_src.processDetector,import_src.hostDetector,import_src.osDetector],buildNodeOtelResourceAttributes=n=>({"deployment.environment":n.environment,"echo.client_app":n.clientApp,"echo.runtime":n.runtime,"service.name":n.serviceName,"service.version":n.serviceVersion??`unknown`}),createNodeOtelResource=async n=>{let c=(0,import_src.defaultResource)().merge((0,import_src.detectResources)({detectors:NODE_OTEL_RESOURCE_DETECTORS})).merge((0,import_src.resourceFromAttributes)(buildNodeOtelResourceAttributes(n)));return await c.waitForAsyncAttributes?.(),c},DEFAULT_EXPORT_INTERVAL_MS=5e3,createNoopRuntimeHandle=n=>({forceFlush:async()=>{},shutdown:async()=>{},tracer:trace.getTracer(n)}),startNodeOtelRuntime=async n=>{if(n.sdk.debug&&diag.setLogger(new DiagConsoleLogger,DiagLogLevel.INFO),!n.sdk.enabled)return createNoopRuntimeHandle(n.resource.serviceName);let c=parseOtlpHeaders(n.sdk.exporterHeadersRaw),u=await createNodeOtelResource(n.resource),p=new import_src$11.NodeTracerProvider({resource:u,spanProcessors:[new import_src$10.BatchSpanProcessor(new import_src$6.OTLPTraceExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`traces`)}))],sampler:new import_src$10.TraceIdRatioBasedSampler(n.sdk.traceSamplingRatio)});p.register({contextManager:new import_src$2.AsyncLocalStorageContextManager,propagator:new import_src$3.CompositePropagator({propagators:[new import_src$3.W3CBaggagePropagator,new import_src$3.W3CTraceContextPropagator]})});let h=new import_src$9.MeterProvider({readers:[new import_src$9.PeriodicExportingMetricReader({exporter:new import_src$5.OTLPMetricExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`metrics`)}),exportIntervalMillis:DEFAULT_EXPORT_INTERVAL_MS})],resource:u});metrics.setGlobalMeterProvider(h);let x=new import_src$8.LoggerProvider({processors:[new import_src$8.BatchLogRecordProcessor(new import_src$4.OTLPLogExporter({headers:c,url:normalizeOtlpSignalEndpoint(n.sdk.exporterEndpoint,`logs`)}))],resource:u});import_src$1.logs.setGlobalLoggerProvider(x);let w=(0,import_src$7.registerInstrumentations)({instrumentations:n.instrumentations??[]}),T=!1;return{forceFlush:async()=>{await Promise.all([p.forceFlush(),h.forceFlush(),x.forceFlush()])},shutdown:async()=>{T||(T=!0,w(),await Promise.all([p.shutdown(),h.shutdown(),x.shutdown()]))},tracer:trace.getTracer(n.resource.serviceName)}},runWithNewSpan=async(n,c)=>{let u=trace.getTracer(n.serviceName),p=n.root?ROOT_CONTEXT:n.parentContext??context$1.active();return await context$1.with(p,async()=>await u.startActiveSpan(n.name,{attributes:n.attributes,kind:n.kind},async n=>{try{return await c()}catch(c){let u=normalizeError(c);throw n.recordException({message:u.message,name:u.name,...u.stack?{stack:u.stack}:{}}),setSpanErrorStatus(n,c),c}finally{n.end()}}))};let EchoNodeRuntime=function(n){return n.BACKEND=`backend`,n.CLI=`cli`,n.DESKTOP_MAIN=`desktop_main`,n}({}),EchoNodeClientApp=function(n){return n.ECHO_BACKEND=`echo-backend`,n.ECHO_CLI=`echo-cli`,n.ECHO_CLIENT=`echo-client`,n.ECHO_SKILLS_SERVICE=`echo-skills-service`,n}({}),NodeOtelExceptionMechanism=function(n){return n.BOOTSTRAP_FAILURE=`bootstrap_failure`,n.COMMAND_FAILURE=`command_failure`,n.IPC_FAILURE=`ipc_failure`,n.UNCAUGHT_EXCEPTION=`uncaughtException`,n.UNHANDLED_REJECTION=`unhandledRejection`,n.WINDOW_FAILURE=`window_failure`,n}({});const FLUSH_TIMEOUT_MS=1500,runtimeState={runtime:null,startPromise:null};let hasRegisteredProcessHandlers=!1;const parseBoolean=n=>{if(typeof n!=`string`)return!1;let c=trimAndLowercase(n);return c===`1`||c===`true`},getCliServiceName=()=>process.env.OTEL_SERVICE_NAME?.trim()||`cli`,getCliEnvironment=()=>process.env.OBSERVABILITY_ENVIRONMENT?.trim()||process.env.NODE_ENV?.trim()||`development`,getCliRuntime=()=>runtimeState.runtime??{backend:`none`},resolveCliObservabilityConfig=()=>({enabled:parseBoolean(process.env.OTEL_ENABLED),environment:getCliEnvironment(),exporterEndpoint:process.env.OTEL_EXPORTER_OTLP_ENDPOINT,exporterHeadersRaw:process.env.OTEL_EXPORTER_OTLP_HEADERS,serviceName:getCliServiceName(),serviceVersion:process.env.npm_package_version,traceSamplingRatio:Number(process.env.OTEL_TRACE_SAMPLING_RATIO??`1`)}),flushWithTimeout=async n=>{let c=getCliRuntime();if(c.backend===`none`)return!0;if(c.backend===`sentry`)return await getCliObservability().flush(n);try{return await Promise.race([c.handle.forceFlush(),new Promise((c,u)=>{setTimeout(()=>{u(Error(`cli otel flush timeout`))},n)})]),!0}catch{return!1}},captureCliOtelException=(n,c,u,p,h)=>{captureExceptionAsSpan({exception:{attributes:h,error:n,handled:u,level:p,mechanism:c},serviceName:getCliServiceName(),spanName:`cli.exception`})},captureCliSentryException=(n,c,u)=>{getCliObservability().captureException(n,{contexts:u?{cli:u}:void 0,level:c,tags:{crash_surface:`cli`}})},captureCliException=(n,c,u,p,h)=>{if(isExpectedNetworkLifecycleError(n))return;let x=getCliRuntime();if(x.backend===`sentry`){captureCliSentryException(n,p,h);return}x.backend===`otel`&&captureCliOtelException(n,c,u,p,h)},registerProcessHandlers=()=>{hasRegisteredProcessHandlers||=(process.on(`uncaughtException`,n=>{captureCliException(n,NodeOtelExceptionMechanism.UNCAUGHT_EXCEPTION,!1,`fatal`,{"echo.command.phase":`process`})}),process.on(`unhandledRejection`,n=>{captureCliException(n,NodeOtelExceptionMechanism.UNHANDLED_REJECTION,!1,`error`,{"echo.command.phase":`process`})}),!0)},startCliObservability=async()=>{if(runtimeState.runtime)return;if(runtimeState.startPromise){await runtimeState.startPromise.catch(()=>void 0);return}let n=(async()=>{let n=resolveCliNodeObservabilityBackendName();if(n===`sentry`)return getCliObservability(),registerProcessHandlers(),{backend:n};if(n===`none`)return registerProcessHandlers(),{backend:n};let c=resolveCliObservabilityConfig(),u=null;try{return u=await startNodeOtelRuntime({resource:{clientApp:EchoNodeClientApp.ECHO_CLI,environment:c.environment,runtime:EchoNodeRuntime.CLI,serviceName:c.serviceName,serviceVersion:c.serviceVersion},sdk:{enabled:c.enabled,exporterEndpoint:c.exporterEndpoint,exporterHeadersRaw:c.exporterHeadersRaw,traceSamplingRatio:c.traceSamplingRatio}}),registerProcessHandlers(),{backend:n,handle:u}}catch(n){throw u&&await u.shutdown().catch(()=>void 0),n}})();runtimeState.startPromise=n;try{runtimeState.runtime=await n}catch(n){console.warn(`Failed to start CLI observability; continuing without telemetry`,n),runtimeState.runtime=null}finally{runtimeState.startPromise===n&&(runtimeState.startPromise=null)}},shutdownCliObservability=async()=>{try{await runtimeState.startPromise}catch{}await flushWithTimeout(FLUSH_TIMEOUT_MS);let n=getCliRuntime();runtimeState.runtime=null,n.backend===`otel`&&await n.handle.shutdown().catch(()=>void 0)},reportCliCommandFailure=async(n,c)=>{captureCliException(n,NodeOtelExceptionMechanism.COMMAND_FAILURE,!0,`error`,{"echo.command.name":c}),await flushWithTimeout(FLUSH_TIMEOUT_MS)},runCliCommandSpan=async(n,c)=>{let u={"echo.command.cwd_basename":path.basename(n.cwd),"echo.command.interactive":n.interactive,"echo.command.name":n.commandName},p=getCliRuntime();if(p.backend===`sentry`){let p=getCliObservability().startSpan({attributes:u,name:`cli.command ${n.commandName}`,op:`cli.command`});try{let n=await c();return p.finish({status:`ok`}),n}catch(n){throw p.finish({status:`internal_error`}),n}}return p.backend===`otel`?await runWithScopeAttributes(u,async()=>await runWithNewSpan({attributes:u,name:`cli.command ${n.commandName}`,root:!0,serviceName:getCliServiceName()},c)):await c()},resolveCliCommandName=n=>{let c=n[0]?.trim();return!c||c.startsWith(`-`)?`default`:c},PREVENT_SLEEP_ARG=`--prevent-sleep`,resolvePreventSleepOption=n=>n.preventSleep===!0||n[`prevent-sleep`]===!0||process.argv.slice(2).includes(PREVENT_SLEEP_ARG)?!0:n.preventSleep??n[`prevent-sleep`],packageRoot=resolve(dirname(fileURLToPath(import.meta.url)),`..`),loadCliEnv=()=>{for(let n of[resolve(packageRoot,`.env`),resolve(packageRoot,`.env.local`),resolve(process.cwd(),`.env`),resolve(process.cwd(),`.env.local`)])existsSync(n)&&(0,import_main.config)({path:n,override:!1})},buildCli=()=>{let n=cac(CLI_BRAND.command);return n.usage(`[--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--non-interactive`,`Run headless login or runtime output`).option(`--skip-update-check`,`Skip update checks for this command`).option(`--token <token>`,`Bootstrap login token`).option(`--base-url <host[:port][/path]>`,`Backend host[:port][/path] without scheme`).option(`--ssl`,`Use SSL for derived HTTP/WebSocket endpoints`).option(`--method <method>`,`Login method for headless login (${LOGIN_METHOD_OPTIONS_TEXT})`),n.command(``,`Start the interactive TUI shell`).usage(`[--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).action(async n=>{if(n.nonInteractive)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);await runInteractiveApp({initialUpdateState:await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck}),baseUrl:n.baseUrl,ssl:n.ssl,token:n.token})}),n.command(`login`,`Headless login`).usage(`login --non-interactive [--token <token>] [--method <method>] [--base-url <host[:port][/path]>] [--no-ssl]`).action(async n=>{if(n.nonInteractive!==!0)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck}),await runNonInteractiveLoginCommand({baseUrl:n.baseUrl,method:n.method,ssl:n.ssl,token:n.token})}),n.command(`run`,`Headless runtime logs`).usage(`run --non-interactive [--prevent-sleep] [--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--prevent-sleep`,`On macOS, keep the system from idle sleeping while this run process is alive`).action(async n=>{if(n.nonInteractive!==!0)throw Error(`Use \`${CLI_BRAND.command} login --non-interactive ...\` or \`${CLI_BRAND.command} run --non-interactive ...\` for headless usage.`);let c=await enforceCliUpdatePolicy({skipUpdateCheck:n.skipUpdateCheck});await runNonInteractiveRunCommand({baseUrl:n.baseUrl,initialUpdateState:c,preventSleep:resolvePreventSleepOption(n),ssl:n.ssl,token:n.token})}),n.command(`logout`,`Clear the persisted CLI session`).usage(`logout`).action(async()=>{await runLogoutCommand()}),n.command(`service <action>`,`Manage the Syncless background service`).usage(`service <install|status|logs|stop|uninstall> [--target systemd-user] [--token <token>] [--base-url <host[:port][/path]>] [--no-ssl]`).option(`--target <target>`,`Service manager target (auto, systemd-user)`).option(`--working-directory <path>`,`Working directory published by the service runtime`).option(`--enable-linger`,`Run loginctl enable-linger for the current user after systemd install`).action(async(n,c)=>{await runServiceCommand(n,{baseUrl:c.baseUrl,enableLinger:c.enableLinger===!0,ssl:c.ssl,target:c.target,token:c.token,workingDirectory:c.workingDirectory})}),n.command(`device <action> [deviceCode]`,`Manage the persisted device code`).usage(`device <set|clear> [deviceCode]`).action(async(n,c)=>{if(n===`set`){if(typeof c!=`string`||c.trim().length===0)throw Error(`Usage: ${CLI_BRAND.command} device set <deviceCode>`);await runDeviceSetCommand(c.trim());return}if(n===`clear`){if(typeof c==`string`&&c.trim().length>0)throw Error(`Usage: ${CLI_BRAND.command} device clear`);await runDeviceClearCommand();return}throw Error(`Unknown device command. Use \`${CLI_BRAND.command} device set <deviceCode>\` or \`${CLI_BRAND.command} device clear\`.`)}),n.help(n=>[...n,{title:`Notes`,body:[` \`${CLI_BRAND.command}\` starts the interactive TUI shell.`,` Headless usage is command-first: \`${CLI_BRAND.command} login --non-interactive\` or \`${CLI_BRAND.command} run --non-interactive\`.`,` Pass \`${CLI_BRAND.command} run --non-interactive --prevent-sleep\` or set \`${CLI_BRAND.envPrefix}_PREVENT_SLEEP=1\` to keep macOS from idle sleeping while a headless run is active.`,` Set \`${CLI_BRAND.envPrefix}_SKIP_UPDATE_CHECK=1\` or pass \`--skip-update-check\` to bypass update checks.`].join(`
|
|
500
500
|
`)}]),n},runCli=async(n=process.argv.slice(2))=>{loadCliEnv(),await startCliObservability();let c=buildCli();c.parse([process.execPath,CLI_BRAND.command,...n],{run:!1}),await runCliCommandSpan({commandName:resolveCliCommandName(n),cwd:process.cwd(),interactive:n.includes(`--non-interactive`)===!1},async()=>{await Promise.resolve(c.runMatchedCommand())})},fail=async n=>{isExpectedNetworkLifecycleError(n)&&(await shutdownCliObservability(),process.exit(0)),await reportCliCommandFailure(n,resolveCliCommandName(process.argv.slice(2))),n instanceof Error?console.error(`Error: ${n.message}`):console.error(`Error: ${String(n)}`),await shutdownCliObservability(),process.exit(1)};process.argv[1]&&resolve(process.argv[1])===fileURLToPath(import.meta.url)&&Promise.resolve(runCli()).then(async()=>{await shutdownCliObservability()}).catch(async n=>{await fail(n)});export{runCli};
|
|
501
|
-
//# debugId=
|
|
501
|
+
//# debugId=ae70dbbe-f8ed-5330-b7f8-bcda9e40a918
|