@vercel/otel 1.14.1 → 1.14.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/edge/index.js +4 -4
- package/dist/edge/index.js.map +3 -3
- package/dist/node/index.js +5 -5
- package/dist/node/index.js.map +3 -3
- package/package.json +5 -2
package/dist/node/index.js
CHANGED
|
@@ -4,18 +4,18 @@ import _nPath from 'path'
|
|
|
4
4
|
const require = topLevelCreateRequire(import.meta.url);
|
|
5
5
|
const __filename = fileURLToPath(import.meta.url);
|
|
6
6
|
const __dirname = _nPath.dirname(__filename);
|
|
7
|
-
var bf=Object.create;var js=Object.defineProperty;var Pf=Object.getOwnPropertyDescriptor;var yf=Object.getOwnPropertyNames;var vf=Object.getPrototypeOf,If=Object.prototype.hasOwnProperty;var z=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _c=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of yf(e))!If.call(r,i)&&i!==t&&js(r,i,{get:()=>e[i],enumerable:!(n=Pf(e,i))||n.enumerable});return r},ht=(r,e,t)=>(Xr(r,e,"default"),t&&Xr(t,e,"default")),Y=(r,e,t)=>(t=r!=null?bf(vf(r)):{},Xr(e||!r||!r.__esModule?js(t,"default",{value:r,enumerable:!0}):t,r)),m=r=>Xr(js({},"__esModule",{value:!0}),r);var d={};import*as sR from"@opentelemetry/api";var h=_c(()=>{ht(d,sR)});var dr=l(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isTracingSuppressed=ye.unsuppressTracing=ye.suppressTracing=void 0;var Mf=(h(),m(d)),Fs=(0,Mf.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Lf(r){return r.setValue(Fs,!0)}ye.suppressTracing=Lf;function Nf(r){return r.deleteValue(Fs)}ye.unsuppressTracing=Nf;function Cf(r){return r.getValue(Fs)===!0}ye.isTracingSuppressed=Cf});var ks=l(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.BAGGAGE_MAX_TOTAL_LENGTH=F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=F.BAGGAGE_MAX_NAME_VALUE_PAIRS=F.BAGGAGE_HEADER=F.BAGGAGE_ITEMS_SEPARATOR=F.BAGGAGE_PROPERTIES_SEPARATOR=F.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;F.BAGGAGE_KEY_PAIR_SEPARATOR="=";F.BAGGAGE_PROPERTIES_SEPARATOR=";";F.BAGGAGE_ITEMS_SEPARATOR=",";F.BAGGAGE_HEADER="baggage";F.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;F.BAGGAGE_MAX_TOTAL_LENGTH=8192});var $s=l(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseKeyPairsIntoRecord=pe.parsePairKeyValue=pe.getKeyPairs=pe.serializeKeyPairs=void 0;var wf=(h(),m(d)),je=ks();function xf(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?je.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>je.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}pe.serializeKeyPairs=xf;function Df(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=je.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}pe.getKeyPairs=Df;function pc(r){let e=r.split(je.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(je.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),s=decodeURIComponent(t.substring(n+1).trim()),o;return e.length>0&&(o=(0,wf.baggageEntryMetadataFromString)(e.join(je.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:s,metadata:o}}pe.parsePairKeyValue=pc;function Uf(r){return typeof r!="string"||r.length===0?{}:r.split(je.BAGGAGE_ITEMS_SEPARATOR).map(e=>pc(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}pe.parseKeyPairsIntoRecord=Uf});var hc=l(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.W3CBaggagePropagator=void 0;var Xs=(h(),m(d)),Bf=dr(),Fe=ks(),Ws=$s(),Ks=class{inject(e,t,n){let i=Xs.propagation.getBaggage(e);if(!i||(0,Bf.isTracingSuppressed)(e))return;let s=(0,Ws.getKeyPairs)(i).filter(a=>a.length<=Fe.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fe.BAGGAGE_MAX_NAME_VALUE_PAIRS),o=(0,Ws.serializeKeyPairs)(s);o.length>0&&n.set(t,Fe.BAGGAGE_HEADER,o)}extract(e,t,n){let i=n.get(t,Fe.BAGGAGE_HEADER),s=Array.isArray(i)?i.join(Fe.BAGGAGE_ITEMS_SEPARATOR):i;if(!s)return e;let o={};return s.length===0||(s.split(Fe.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let c=(0,Ws.parsePairKeyValue)(u);if(c){let _={value:c.value};c.metadata&&(_.metadata=c.metadata),o[c.key]=_}}),Object.entries(o).length===0)?e:Xs.propagation.setBaggage(e,Xs.propagation.createBaggage(o))}fields(){return[Fe.BAGGAGE_HEADER]}};Wr.W3CBaggagePropagator=Ks});var fc=l(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.AnchoredClock=void 0;var zs=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};Kr.AnchoredClock=zs});var Sc=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isAttributeValue=ve.isAttributeKey=ve.sanitizeAttributes=void 0;var Ec=(h(),m(d));function qf(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!mc(t)){Ec.diag.warn(`Invalid attribute key: ${t}`);continue}if(!gc(n)){Ec.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}ve.sanitizeAttributes=qf;function mc(r){return typeof r=="string"&&r.length>0}ve.isAttributeKey=mc;function gc(r){return r==null?!0:Array.isArray(r)?Vf(r):Tc(r)}ve.isAttributeValue=gc;function Vf(r){let e;for(let t of r)if(t!=null){if(!e){if(Tc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Tc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Ys=l(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.loggingErrorHandler=void 0;var Gf=(h(),m(d));function Hf(){return r=>{Gf.diag.error(jf(r))}}zr.loggingErrorHandler=Hf;function jf(r){return typeof r=="string"?r:JSON.stringify(Ff(r))}function Ff(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Qs=l(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.globalErrorHandler=ft.setGlobalErrorHandler=void 0;var kf=Ys(),Ac=(0,kf.loggingErrorHandler)();function $f(r){Ac=r}ft.setGlobalErrorHandler=$f;function Xf(r){try{Ac(r)}catch{}}ft.globalErrorHandler=Xf});var Zs=l(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TracesSamplerValues=void 0;var Wf;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Wf=_r.TracesSamplerValues||(_r.TracesSamplerValues={}))});var Oc=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr._globalThis=void 0;Yr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Qr=l(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getEnvWithoutDefaults=v.parseEnvironment=v.DEFAULT_ENVIRONMENT=v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Ie=(h(),m(d)),Kf=Zs(),zf=Oc(),Yf=",",Qf=["OTEL_SDK_DISABLED"];function Zf(r){return Qf.indexOf(r)>-1}var Jf=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function eE(r){return Jf.indexOf(r)>-1}var tE=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function rE(r){return tE.indexOf(r)>-1}v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;v.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ie.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:Kf.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function nE(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function iE(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let s=Number(t[r]);isNaN(s)||(s<n?e[r]=n:s>i?e[r]=i:e[r]=s)}}function sE(r,e,t,n=Yf){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(s=>s.trim()))}var oE={ALL:Ie.DiagLogLevel.ALL,VERBOSE:Ie.DiagLogLevel.VERBOSE,DEBUG:Ie.DiagLogLevel.DEBUG,INFO:Ie.DiagLogLevel.INFO,WARN:Ie.DiagLogLevel.WARN,ERROR:Ie.DiagLogLevel.ERROR,NONE:Ie.DiagLogLevel.NONE};function aE(r,e,t){let n=t[r];if(typeof n=="string"){let i=oE[n.toUpperCase()];i!=null&&(e[r]=i)}}function Js(r){let e={};for(let t in v.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":aE(n,e,r);break;default:if(Zf(n))nE(n,e,r);else if(eE(n))iE(n,e,r);else if(rE(n))sE(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}v.parseEnvironment=Js;function uE(){return typeof process<"u"&&process&&process.env?Js(process.env):Js(zf._globalThis)}v.getEnvWithoutDefaults=uE});var bc=l(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getEnv=void 0;var cE=z("os"),Rc=Qr();function lE(){let r=(0,Rc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:cE.hostname()},Rc.DEFAULT_ENVIRONMENT,r)}Zr.getEnv=lE});var Pc=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr._globalThis=void 0;Jr._globalThis=typeof globalThis=="object"?globalThis:global});var vc=l(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.hexToBase64=void 0;function yc(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var dE=Buffer.alloc(8),_E=Buffer.alloc(16);function pE(r){let e;r.length===16?e=dE:r.length===32?e=_E:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=yc(r.charCodeAt(n)),s=yc(r.charCodeAt(n+1));e.writeUInt8(i<<4|s,t++)}return e.toString("base64")}en.hexToBase64=pE});var Lc=l(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RandomIdGenerator=void 0;var hE=8,Mc=16,eo=class{constructor(){this.generateTraceId=Ic(Mc),this.generateSpanId=Ic(hE)}};rn.RandomIdGenerator=eo;var tn=Buffer.allocUnsafe(Mc);function Ic(r){return function(){for(let t=0;t<r/4;t++)tn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(tn[t]>0);t++)t===r-1&&(tn[r-1]=1);return tn.toString("hex",0,r)}}});var Nc=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.otperformance=void 0;var fE=z("perf_hooks");nn.otperformance=fE.performance});var to=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.VERSION=void 0;sn.VERSION="1.19.0"});var Cc=l(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.MessageTypeValues=b.RpcGrpcStatusCodeValues=b.MessagingOperationValues=b.MessagingDestinationKindValues=b.HttpFlavorValues=b.NetHostConnectionSubtypeValues=b.NetHostConnectionTypeValues=b.NetTransportValues=b.FaasInvokedProviderValues=b.FaasDocumentOperationValues=b.FaasTriggerValues=b.DbCassandraConsistencyLevelValues=b.DbSystemValues=b.SemanticAttributes=void 0;b.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};b.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};b.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};b.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};b.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};b.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};b.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};b.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};b.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};b.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};b.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};b.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};b.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};b.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var wc=l(ke=>{"use strict";var EE=ke&&ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),mE=ke&&ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&EE(e,r,t)};Object.defineProperty(ke,"__esModule",{value:!0});mE(Cc(),ke)});var xc=l(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.TelemetrySdkLanguageValues=k.OsTypeValues=k.HostArchValues=k.AwsEcsLaunchtypeValues=k.CloudPlatformValues=k.CloudProviderValues=k.SemanticResourceAttributes=void 0;k.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};k.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};k.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};k.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};k.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};k.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};k.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Dc=l($e=>{"use strict";var gE=$e&&$e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),TE=$e&&$e.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gE(e,r,t)};Object.defineProperty($e,"__esModule",{value:!0});TE(xc(),$e)});var Ae=l(Me=>{"use strict";var SE=Me&&Me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Uc=Me&&Me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&SE(e,r,t)};Object.defineProperty(Me,"__esModule",{value:!0});Uc(wc(),Me);Uc(Dc(),Me)});var Bc=l(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.SDK_INFO=void 0;var AE=to(),pr=Ae();on.SDK_INFO={[pr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[pr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[pr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:pr.TelemetrySdkLanguageValues.NODEJS,[pr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:AE.VERSION}});var qc=l(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.unrefTimer=void 0;function OE(r){r.unref()}an.unrefTimer=OE});var Vc=l(ee=>{"use strict";var RE=ee&&ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Xe=ee&&ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&RE(e,r,t)};Object.defineProperty(ee,"__esModule",{value:!0});Xe(bc(),ee);Xe(Pc(),ee);Xe(vc(),ee);Xe(Lc(),ee);Xe(Nc(),ee);Xe(Bc(),ee);Xe(qc(),ee)});var ro=l(We=>{"use strict";var bE=We&&We.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),PE=We&&We.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bE(e,r,t)};Object.defineProperty(We,"__esModule",{value:!0});PE(Vc(),We)});var Fc=l(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.addHrTimes=y.isTimeInput=y.isTimeInputHrTime=y.hrTimeToMicroseconds=y.hrTimeToMilliseconds=y.hrTimeToNanoseconds=y.hrTimeToTimeStamp=y.hrTimeDuration=y.timeInputToHrTime=y.hrTime=y.getTimeOrigin=y.millisToHrTime=void 0;var no=ro(),Gc=9,yE=6,vE=Math.pow(10,yE),un=Math.pow(10,Gc);function hr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*vE);return[t,n]}y.millisToHrTime=hr;function io(){let r=no.otperformance.timeOrigin;if(typeof r!="number"){let e=no.otperformance;r=e.timing&&e.timing.fetchStart}return r}y.getTimeOrigin=io;function Hc(r){let e=hr(io()),t=hr(typeof r=="number"?r:no.otperformance.now());return jc(e,t)}y.hrTime=Hc;function IE(r){if(so(r))return r;if(typeof r=="number")return r<io()?Hc(r):hr(r);if(r instanceof Date)return hr(r.getTime());throw TypeError("Invalid input type")}y.timeInputToHrTime=IE;function ME(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=un),[t,n]}y.hrTimeDuration=ME;function LE(r){let e=Gc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}y.hrTimeToTimeStamp=LE;function NE(r){return r[0]*un+r[1]}y.hrTimeToNanoseconds=NE;function CE(r){return r[0]*1e3+r[1]/1e6}y.hrTimeToMilliseconds=CE;function wE(r){return r[0]*1e6+r[1]/1e3}y.hrTimeToMicroseconds=wE;function so(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}y.isTimeInputHrTime=so;function xE(r){return so(r)||typeof r=="number"||r instanceof Date}y.isTimeInput=xE;function jc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=un&&(t[1]-=un,t[0]+=1),t}y.addHrTimes=jc});var $c=l(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0})});var Xc=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExportResultCode=void 0;var DE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(DE=fr.ExportResultCode||(fr.ExportResultCode={}))});var Kc=l(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.CompositePropagator=void 0;var Wc=(h(),m(d)),oo=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(s){Wc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,t,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,t,n)}catch(o){Wc.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}};cn.CompositePropagator=oo});var zc=l(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateValue=Et.validateKey=void 0;var ao="[_0-9a-z-*/]",UE=`[a-z]${ao}{0,255}`,BE=`[a-z0-9]${ao}{0,240}@[a-z]${ao}{0,13}`,qE=new RegExp(`^(?:${UE}|${BE})$`),VE=/^[ -~]{0,255}[!-~]$/,GE=/,|=/;function HE(r){return qE.test(r)}Et.validateKey=HE;function jE(r){return VE.test(r)&&!GE.test(r)}Et.validateValue=jE});var co=l(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.TraceState=void 0;var Yc=zc(),Qc=32,FE=512,Zc=",",Jc="=",uo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Jc+this.get(t)),e),[]).join(Zc)}_parse(e){e.length>FE||(this._internalState=e.split(Zc).reverse().reduce((t,n)=>{let i=n.trim(),s=i.indexOf(Jc);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);(0,Yc.validateKey)(o)&&(0,Yc.validateValue)(a)&&t.set(o,a)}return t},new Map),this._internalState.size>Qc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};ln.TraceState=uo});var tl=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.W3CTraceContextPropagator=$.parseTraceParent=$.TRACE_STATE_HEADER=$.TRACE_PARENT_HEADER=void 0;var dn=(h(),m(d)),kE=dr(),$E=co();$.TRACE_PARENT_HEADER="traceparent";$.TRACE_STATE_HEADER="tracestate";var XE="00",WE="(?!ff)[\\da-f]{2}",KE="(?![0]{32})[\\da-f]{32}",zE="(?![0]{16})[\\da-f]{16}",YE="[\\da-f]{2}",QE=new RegExp(`^\\s?(${WE})-(${KE})-(${zE})-(${YE})(-.*)?\\s?$`);function el(r){let e=QE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}$.parseTraceParent=el;var lo=class{inject(e,t,n){let i=dn.trace.getSpanContext(e);if(!i||(0,kE.isTracingSuppressed)(e)||!(0,dn.isSpanContextValid)(i))return;let s=`${XE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||dn.TraceFlags.NONE).toString(16)}`;n.set(t,$.TRACE_PARENT_HEADER,s),i.traceState&&n.set(t,$.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,$.TRACE_PARENT_HEADER);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=el(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,$.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=new $E.TraceState(typeof u=="string"?u:void 0)}return dn.trace.setSpanContext(e,o)}fields(){return[$.TRACE_PARENT_HEADER,$.TRACE_STATE_HEADER]}};$.W3CTraceContextPropagator=lo});var nl=l(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0})});var il=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.getRPCMetadata=ue.deleteRPCMetadata=ue.setRPCMetadata=ue.RPCType=void 0;var ZE=(h(),m(d)),_o=(0,ZE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),JE;(function(r){r.HTTP="http"})(JE=ue.RPCType||(ue.RPCType={}));function em(r,e){return r.setValue(_o,e)}ue.setRPCMetadata=em;function tm(r){return r.deleteValue(_o)}ue.deleteRPCMetadata=tm;function rm(r){return r.getValue(_o)}ue.getRPCMetadata=rm});var ho=l(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AlwaysOffSampler=void 0;var nm=(h(),m(d)),po=class{shouldSample(){return{decision:nm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};_n.AlwaysOffSampler=po});var Eo=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOnSampler=void 0;var im=(h(),m(d)),fo=class{shouldSample(){return{decision:im.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};pn.AlwaysOnSampler=fo});var ol=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentBasedSampler=void 0;var hn=(h(),m(d)),sm=Qs(),sl=ho(),mo=Eo(),go=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,sm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new mo.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new mo.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new sl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new mo.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new sl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=hn.trace.getSpanContext(e);return!a||!(0,hn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&hn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&hn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};fn.ParentBasedSampler=go});var al=l(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.TraceIdRatioBasedSampler=void 0;var To=(h(),m(d)),So=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,To.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?To.SamplingDecision.RECORD_AND_SAMPLED:To.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};En.TraceIdRatioBasedSampler=So});var _l=l(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.isPlainObject=void 0;var om="[object Object]",am="[object Null]",um="[object Undefined]",cm=Function.prototype,ul=cm.toString,lm=ul.call(Object),dm=_m(Object.getPrototypeOf,Object),cl=Object.prototype,ll=cl.hasOwnProperty,Ke=Symbol?Symbol.toStringTag:void 0,dl=cl.toString;function _m(r,e){return function(t){return r(e(t))}}function pm(r){if(!hm(r)||fm(r)!==om)return!1;let e=dm(r);if(e===null)return!0;let t=ll.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ul.call(t)===lm}mn.isPlainObject=pm;function hm(r){return r!=null&&typeof r=="object"}function fm(r){return r==null?r===void 0?um:am:Ke&&Ke in Object(r)?Em(r):mm(r)}function Em(r){let e=ll.call(r,Ke),t=r[Ke],n=!1;try{r[Ke]=void 0,n=!0}catch{}let i=dl.call(r);return n&&(e?r[Ke]=t:delete r[Ke]),i}function mm(r){return dl.call(r)}});var ml=l(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.merge=void 0;var pl=_l(),gm=20;function Tm(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=fl(e,r.shift(),0,t);return e}Sn.merge=Tm;function Ao(r){return Tn(r)?r.slice():r}function fl(r,e,t=0,n){let i;if(!(t>gm)){if(t++,gn(r)||gn(e)||El(e))i=Ao(e);else if(Tn(r)){if(i=r.slice(),Tn(e))for(let s=0,o=e.length;s<o;s++)i.push(Ao(e[s]));else if(Er(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o];i[u]=Ao(e[u])}}}else if(Er(r))if(Er(e)){if(!Sm(r,e))return e;i=Object.assign({},r);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o],c=e[u];if(gn(c))typeof c>"u"?delete i[u]:i[u]=c;else{let _=i[u],p=c;if(hl(r,u,n)||hl(e,u,n))delete i[u];else{if(Er(_)&&Er(p)){let f=n.get(_)||[],M=n.get(p)||[];f.push({obj:r,key:u}),M.push({obj:e,key:u}),n.set(_,f),n.set(p,M)}i[u]=fl(i[u],c,t,n)}}}}else i=e;return i}}function hl(r,e,t){let n=t.get(r[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===r)return!0}return!1}function Tn(r){return Array.isArray(r)}function El(r){return typeof r=="function"}function Er(r){return!gn(r)&&!Tn(r)&&!El(r)&&typeof r=="object"}function gn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Sm(r,e){return!(!(0,pl.isPlainObject)(r)||!(0,pl.isPlainObject)(e))}});var gl=l(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.callWithTimeout=mt.TimeoutError=void 0;var An=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};mt.TimeoutError=An;function Am(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new An("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}mt.callWithTimeout=Am});var Sl=l(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isUrlIgnored=gt.urlMatches=void 0;function Tl(r,e){return typeof e=="string"?r===e:!!r.match(e)}gt.urlMatches=Tl;function Om(r,e){if(!e)return!1;for(let t of e)if(Tl(r,t))return!0;return!1}gt.isUrlIgnored=Om});var Al=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isWrapped=void 0;function Rm(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}On.isWrapped=Rm});var Ol=l(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Deferred=void 0;var Oo=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};Rn.Deferred=Oo});var Rl=l(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BindOnceFuture=void 0;var bm=Ol(),Ro=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new bm.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};bn.BindOnceFuture=Ro});var Pl=l(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn._export=void 0;var bl=(h(),m(d)),Pm=dr();function ym(r,e){return new Promise(t=>{bl.context.with((0,Pm.suppressTracing)(bl.context.active()),()=>{r.export(e,n=>{t(n)})})})}Pn._export=ym});var A=l(T=>{"use strict";var vm=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),P=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vm(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;P(hc(),T);P(fc(),T);P(Sc(),T);P(Qs(),T);P(Ys(),T);P(Fc(),T);P($c(),T);P(Xc(),T);T.baggageUtils=$s();P(ro(),T);P(Kc(),T);P(tl(),T);P(nl(),T);P(il(),T);P(ho(),T);P(Eo(),T);P(ol(),T);P(al(),T);P(dr(),T);P(co(),T);P(Qr(),T);P(ml(),T);P(Zs(),T);P(gl(),T);P(Sl(),T);P(Al(),T);P(Rl(),T);P(to(),T);var Im=Pl();T.internal={_export:Im._export}});var yl=l(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ExceptionEventName=void 0;yn.ExceptionEventName="exception"});var Po=l(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Span=void 0;var he=(h(),m(d)),X=A(),ze=Ae(),Mm=yl(),bo=class{constructor(e,t,n,i,s,o,a=[],u,c,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:he.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=a;let p=Date.now();this._performanceStartTime=X.otperformance.now(),this._performanceOffset=p-(this._performanceStartTime+(0,X.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??p),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(he.diag.warn(`Invalid attribute key: ${e}`),this):(0,X.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(he.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return he.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(he.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,X.isTimeInput)(t)&&((0,X.isTimeInput)(n)||(n=t),t=void 0);let i=(0,X.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){he.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,X.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(he.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._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<X.otperformance.now())return(0,X.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,X.millisToHrTime)(e);if(e instanceof Date)return(0,X.millisToHrTime)(e.getTime());if((0,X.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,X.millisToHrTime)(Date.now());let t=X.otperformance.now()-this._performanceStartTime;return(0,X.addHrTimes)(this.startTime,(0,X.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[ze.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[ze.SemanticAttributes.EXCEPTION_TYPE]||n[ze.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(Mm.ExceptionEventName,n,t):he.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&he.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(he.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};vn.Span=bo});var gr=l(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.SamplingDecision=void 0;var Lm;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Lm=mr.SamplingDecision||(mr.SamplingDecision={}))});var Mn=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AlwaysOffSampler=void 0;var Nm=gr(),yo=class{shouldSample(){return{decision:Nm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};In.AlwaysOffSampler=yo});var Nn=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AlwaysOnSampler=void 0;var Cm=gr(),vo=class{shouldSample(){return{decision:Cm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Ln.AlwaysOnSampler=vo});var Lo=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ParentBasedSampler=void 0;var Cn=(h(),m(d)),wm=A(),vl=Mn(),Io=Nn(),Mo=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,wm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Io.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Io.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new vl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new Io.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new vl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=Cn.trace.getSpanContext(e);return!a||!(0,Cn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&Cn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&Cn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};wn.ParentBasedSampler=Mo});var Co=l(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.TraceIdRatioBasedSampler=void 0;var xm=(h(),m(d)),Il=gr(),No=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,xm.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Il.SamplingDecision.RECORD_AND_SAMPLED:Il.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};xn.TraceIdRatioBasedSampler=No});var Do=l(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.buildSamplerFromEnv=St.loadDefaultConfig=void 0;var Dn=(h(),m(d)),H=A(),Ml=Mn(),wo=Nn(),xo=Lo(),Ll=Co(),Dm=(0,H.getEnv)(),Um=H.TracesSamplerValues.AlwaysOn,Tt=1;function Bm(){return{sampler:Cl(Dm),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,H.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,H.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}St.loadDefaultConfig=Bm;function Cl(r=(0,H.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case H.TracesSamplerValues.AlwaysOn:return new wo.AlwaysOnSampler;case H.TracesSamplerValues.AlwaysOff:return new Ml.AlwaysOffSampler;case H.TracesSamplerValues.ParentBasedAlwaysOn:return new xo.ParentBasedSampler({root:new wo.AlwaysOnSampler});case H.TracesSamplerValues.ParentBasedAlwaysOff:return new xo.ParentBasedSampler({root:new Ml.AlwaysOffSampler});case H.TracesSamplerValues.TraceIdRatio:return new Ll.TraceIdRatioBasedSampler(Nl(r));case H.TracesSamplerValues.ParentBasedTraceIdRatio:return new xo.ParentBasedSampler({root:new Ll.TraceIdRatioBasedSampler(Nl(r))});default:return Dn.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Um}".`),new wo.AlwaysOnSampler}}St.buildSamplerFromEnv=Cl;function Nl(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Tt}.`),Tt;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Tt}.`),Tt):e<0||e>1?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Tt}.`),Tt):e}});var Bo=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reconfigureLimits=At.mergeConfig=void 0;var wl=Do(),Uo=A();function qm(r){let e={sampler:(0,wl.buildSamplerFromEnv)()},t=(0,wl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}At.mergeConfig=qm;function Vm(r){var e,t,n,i,s,o,a,u,c,_,p,f;let M=Object.assign({},r.spanLimits),R=(0,Uo.getEnvWithoutDefaults)();return M.attributeCountLimit=(o=(s=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:R.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:R.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Uo.DEFAULT_ATTRIBUTE_COUNT_LIMIT,M.attributeValueLengthLimit=(f=(p=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&_!==void 0?_:R.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:R.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:Uo.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:M})}At.reconfigureLimits=Vm});var xl=l(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.BatchSpanProcessorBase=void 0;var Ot=(h(),m(d)),Ye=A(),qo=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ye.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ye.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ot.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Ot.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Ot.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Ot.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Ot.context.with((0,Ye.suppressTracing)(Ot.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),s=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===Ye.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),o=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);o.length===0?s():Promise.all(o.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(s,a=>{(0,Ye.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,Ye.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ye.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Un.BatchSpanProcessorBase=qo});var Dl=l(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessor=void 0;var Gm=xl(),Vo=class extends Gm.BatchSpanProcessorBase{onShutdown(){}};Bn.BatchSpanProcessor=Vo});var ql=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.RandomIdGenerator=void 0;var Hm=8,Bl=16,Go=class{constructor(){this.generateTraceId=Ul(Bl),this.generateSpanId=Ul(Hm)}};Vn.RandomIdGenerator=Go;var qn=Buffer.allocUnsafe(Bl);function Ul(r){return function(){for(let t=0;t<r/4;t++)qn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(qn[t]>0);t++)t===r-1&&(qn[r-1]=1);return qn.toString("hex",0,r)}}});var Gl=l(Le=>{"use strict";var jm=Le&&Le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Vl=Le&&Le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&jm(e,r,t)};Object.defineProperty(Le,"__esModule",{value:!0});Vl(Dl(),Le);Vl(ql(),Le)});var Gn=l(Qe=>{"use strict";var Fm=Qe&&Qe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),km=Qe&&Qe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fm(e,r,t)};Object.defineProperty(Qe,"__esModule",{value:!0});km(Gl(),Qe)});var Hl=l(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Tracer=void 0;var j=(h(),m(d)),Hn=A(),$m=Po(),Xm=Bo(),Wm=Gn(),Ho=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,Xm.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Wm.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=j.context.active()){var i,s,o;t.root&&(n=j.trace.deleteSpan(n));let a=j.trace.getSpan(n);if((0,Hn.isTracingSuppressed)(n))return j.diag.debug("Instrumentation suppressed, returning Noop Span"),j.trace.wrapSpanContext(j.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),c=this._idGenerator.generateSpanId(),_,p,f;!u||!j.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,p=u.traceState,f=u.spanId);let M=(i=t.kind)!==null&&i!==void 0?i:j.SpanKind.INTERNAL,R=((s=t.links)!==null&&s!==void 0?s:[]).map(pt=>({context:pt.context,attributes:(0,Hn.sanitizeAttributes)(pt.attributes)})),w=(0,Hn.sanitizeAttributes)(t.attributes),U=this._sampler.shouldSample(n,_,e,M,w,R);p=(o=U.traceState)!==null&&o!==void 0?o:p;let S=U.decision===j.SamplingDecision.RECORD_AND_SAMPLED?j.TraceFlags.SAMPLED:j.TraceFlags.NONE,Te={traceId:_,spanId:c,traceFlags:S,traceState:p};if(U.decision===j.SamplingDecision.NOT_RECORD)return j.diag.debug("Recording is off, propagating context in a non-recording span"),j.trace.wrapSpanContext(Te);let Se=(0,Hn.sanitizeAttributes)(Object.assign(w,U.attributes));return new $m.Span(this,n,e,Te,M,f,R,t.startTime,void 0,Se)}startActiveSpan(e,t,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(s=t,a=n):(s=t,o=n,a=i);let u=o??j.context.active(),c=this.startSpan(e,s,u),_=j.trace.setSpan(u,c);return j.context.with(_,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};jn.Tracer=Ho});var jl=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.defaultServiceName=void 0;function Km(){return`unknown_service:${process.argv0}`}Fn.defaultServiceName=Km});var jo=l(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.normalizeType=Rt.normalizeArch=void 0;var zm=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Rt.normalizeArch=zm;var Ym=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Rt.normalizeType=Ym});var $n=l(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.execAsync=void 0;var Qm=z("child_process"),Zm=z("util");kn.execAsync=Zm.promisify(Qm.exec)});var Fl=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMachineId=void 0;var Jm=$n(),eg=(h(),m(d));async function tg(){try{let e=(await(0,Jm.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
8
|
-
`).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){eg.diag.debug(`error reading machine id: ${r}`)}return""}Xn.getMachineId=tg});var kl=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getMachineId=void 0;var rg=z("fs"),ng=(h(),m(d));async function ig(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await rg.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){ng.diag.debug(`error reading machine id: ${t}`)}return""}Wn.getMachineId=ig});var Xl=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var sg=z("fs"),og=$n(),$l=(h(),m(d));async function ag(){try{return(await sg.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,og.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}return""}Kn.getMachineId=ag});var Kl=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var Wl=z("process"),ug=$n(),cg=(h(),m(d));async function lg(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Wl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Wl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,ug.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){cg.diag.debug(`error reading machine id: ${t}`)}return""}zn.getMachineId=lg});var zl=l(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var dg=(h(),m(d));async function _g(){return dg.diag.debug("could not read machine-id: unsupported platform"),""}Yn.getMachineId=_g});var Yl=l(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.getMachineId=void 0;var pg=z("process"),bt;Oe.getMachineId=bt;switch(pg.platform){case"darwin":Oe.getMachineId=bt=Fl().getMachineId;break;case"linux":Oe.getMachineId=bt=kl().getMachineId;break;case"freebsd":Oe.getMachineId=bt=Xl().getMachineId;break;case"win32":Oe.getMachineId=bt=Kl().getMachineId;break;default:Oe.getMachineId=bt=zl().getMachineId}});var $o=l(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.hostDetectorSync=void 0;var Fo=Ae(),hg=Ze(),Ql=z("os"),fg=jo(),Eg=Yl(),ko=class{detect(e){let t={[Fo.SemanticResourceAttributes.HOST_NAME]:(0,Ql.hostname)(),[Fo.SemanticResourceAttributes.HOST_ARCH]:(0,fg.normalizeArch)((0,Ql.arch)())};return new hg.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,Eg.getMachineId)().then(e=>{let t={};return e&&(t[Fo.SemanticResourceAttributes.HOST_ID]=e),t})}};Qn.hostDetectorSync=new ko});var Zl=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetector=void 0;var mg=$o(),Xo=class{detect(e){return Promise.resolve(mg.hostDetectorSync.detect(e))}};Zn.hostDetector=new Xo});var Ko=l(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.osDetectorSync=void 0;var Jl=Ae(),gg=Ze(),ed=z("os"),Tg=jo(),Wo=class{detect(e){let t={[Jl.SemanticResourceAttributes.OS_TYPE]:(0,Tg.normalizeType)((0,ed.platform)()),[Jl.SemanticResourceAttributes.OS_VERSION]:(0,ed.release)()};return new gg.Resource(t)}};Jn.osDetectorSync=new Wo});var td=l(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetector=void 0;var Sg=Ko(),zo=class{detect(e){return Promise.resolve(Sg.osDetectorSync.detect(e))}};ei.osDetector=new zo});var Qo=l(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.processDetectorSync=void 0;var Ag=(h(),m(d)),Re=Ae(),Og=Ze(),Rg=z("os"),Yo=class{detect(e){let t={[Re.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Re.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Re.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Re.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Re.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Re.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=Rg.userInfo();t[Re.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){Ag.diag.debug(`error obtaining process owner: ${n}`)}return new Og.Resource(t)}};ti.processDetectorSync=new Yo});var rd=l(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetector=void 0;var bg=Qo(),Zo=class{detect(e){return Promise.resolve(bg.processDetectorSync.detect(e))}};ri.processDetector=new Zo});var nd=l(te=>{"use strict";var Pg=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Je=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Pg(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Je(jl(),te);Je(Zl(),te);Je(td(),te);Je($o(),te);Je(Ko(),te);Je(rd(),te);Je(Qo(),te)});var Jo=l(et=>{"use strict";var yg=et&&et.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),vg=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yg(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});vg(nd(),et)});var Ze=l(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Resource=void 0;var id=(h(),m(d)),tt=Ae(),ea=A(),Ig=Jo(),Tr=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(id.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[tt.SemanticResourceAttributes.SERVICE_NAME]:(0,Ig.defaultServiceName)(),[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&id.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,o])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),o)});return new r(n,i)}};ni.Resource=Tr;Tr.EMPTY=new Tr({})});var od=l(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0})});var ud=l(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0})});var ld=l(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0})});var dd=l(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.browserDetector=void 0;var Mg=rt(),ta=class{detect(e){return Promise.resolve(Mg.browserDetectorSync.detect(e))}};ii.browserDetector=new ta});var na=l(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetectorSync=void 0;var Lg=(h(),m(d)),Ng=A(),Cg=Ae(),wg=Ze(),ra=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,Ng.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,s=n.OTEL_SERVICE_NAME;if(i)try{let o=this._parseResourceAttributes(i);Object.assign(t,o)}catch(o){Lg.diag.debug(`EnvDetector failed: ${o.message}`)}return s&&(t[Cg.SemanticResourceAttributes.SERVICE_NAME]=s),new wg.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let s=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[o,a]=s;if(o=o.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(o))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[o]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};si.envDetectorSync=new ra});var _d=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.envDetector=void 0;var xg=na(),ia=class{detect(e){return Promise.resolve(xg.envDetectorSync.detect(e))}};oi.envDetector=new ia});var pd=l(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.browserDetectorSync=void 0;var ai=Ae(),sa=rt(),Dg=(h(),m(d)),oa=class{detect(e){if(!(typeof navigator<"u"))return sa.Resource.empty();let n={[ai.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(Dg.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),sa.Resource.empty()):new sa.Resource(Object.assign({},e))}};ui.browserDetectorSync=new oa});var hd=l(fe=>{"use strict";var Ug=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ci=fe&&fe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Ug(e,r,t)};Object.defineProperty(fe,"__esModule",{value:!0});ci(dd(),fe);ci(_d(),fe);ci(pd(),fe);ci(na(),fe)});var fd=l(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.isPromiseLike=void 0;var Bg=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";li.isPromiseLike=Bg});var md=l(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.detectResourcesSync=yt.detectResources=void 0;var Sr=Ze(),Pt=(h(),m(d)),qg=fd(),Vg=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return Pt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return Pt.diag.debug(`${t.constructor.name} failed: ${n.message}`),Sr.Resource.empty()}}));return Ed(e),e.reduce((t,n)=>t.merge(n),Sr.Resource.empty())};yt.detectResources=Vg;var Gg=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let s=i.detect(r),o;if((0,qg.isPromiseLike)(s)){let a=async()=>(await s).attributes;o=new Sr.Resource({},a())}else o=s;return o.waitForAsyncAttributes?o.waitForAsyncAttributes().then(()=>Pt.diag.debug(`${i.constructor.name} found resource.`,o)):Pt.diag.debug(`${i.constructor.name} found resource.`,o),o}catch(s){return Pt.diag.error(`${i.constructor.name} failed: ${s.message}`),Sr.Resource.empty()}}),n=t.reduce((i,s)=>i.merge(s),Sr.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{Ed(t)}),n};yt.detectResourcesSync=Gg;var Ed=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);Pt.diag.verbose(t)}})}});var rt=l(re=>{"use strict";var Hg=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Hg(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});nt(Ze(),re);nt(od(),re);nt(Jo(),re);nt(ud(),re);nt(ld(),re);nt(hd(),re);nt(md(),re)});var gd=l(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.MultiSpanProcessor=void 0;var jg=A(),aa=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,jg.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};di.MultiSpanProcessor=aa});var ca=l(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.NoopSpanProcessor=void 0;var ua=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};_i.NoopSpanProcessor=ua});var Sd=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.BasicTracerProvider=it.ForceFlushState=void 0;var vt=(h(),m(d)),Mt=A(),Td=rt(),Fg=la(),kg=Do(),$g=gd(),Xg=ca(),Wg=Gn(),Kg=Bo(),It;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(It=it.ForceFlushState||(it.ForceFlushState={}));var Ar=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,Mt.merge)({},(0,kg.loadDefaultConfig)(),(0,Kg.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:Td.Resource.empty(),this.resource=Td.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let s=new Wg.BatchSpanProcessor(i);this.activeSpanProcessor=s}else this.activeSpanProcessor=new Xg.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new Fg.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>vt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new $g.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){vt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&vt.context.setGlobalContextManager(e.contextManager),e.propagator&&vt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=It.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==It.timeout&&(s=It.resolved,i(s))}).catch(a=>{clearTimeout(o),s=It.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(s=>{let o=s.filter(a=>a!==It.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,Mt.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let s=this._getPropagator(i);return s||vt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),s}).reduce((i,s)=>(s&&i.push(s),i),[]);if(n.length!==0)return e.length===1?n[0]:new Mt.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,Mt.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||vt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};it.BasicTracerProvider=Ar;Ar._registeredPropagators=new Map([["tracecontext",()=>new Mt.W3CTraceContextPropagator],["baggage",()=>new Mt.W3CBaggagePropagator]]);Ar._registeredExporters=new Map});var Ad=l(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ConsoleSpanExporter=void 0;var da=A(),_a=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,da.hrTimeToMicroseconds)(e.startTime),duration:(0,da.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:da.ExportResultCode.SUCCESS})}};pi.ConsoleSpanExporter=_a});var Rd=l(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InMemorySpanExporter=void 0;var Od=A(),pa=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Od.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Od.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};hi.InMemorySpanExporter=pa});var Pd=l(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0})});var yd=l(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.SimpleSpanProcessor=void 0;var zg=(h(),m(d)),Lt=A(),ha=class{constructor(e){this._exporter=e,this._shutdownOnce=new Lt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&zg.TraceFlags.SAMPLED))return;let i=()=>Lt.internal._export(this._exporter,[e]).then(s=>{var o;s.code!==Lt.ExportResultCode.SUCCESS&&(0,Lt.globalErrorHandler)((o=s.error)!==null&&o!==void 0?o:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Lt.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(s!=null&&this._unresolvedExports.delete(s),i()),o=>(0,Lt.globalErrorHandler)(o));s!=null&&this._unresolvedExports.add(s)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};fi.SimpleSpanProcessor=ha});var Id=l(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0})});var Ld=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0})});var Cd=l(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0})});var xd=l(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0})});var Ud=l(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0})});var la=l(I=>{"use strict";var Yg=I&&I.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),B=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Yg(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});B(Hl(),I);B(Sd(),I);B(Gn(),I);B(Ad(),I);B(Rd(),I);B(Pd(),I);B(yd(),I);B(Id(),I);B(ca(),I);B(Mn(),I);B(Nn(),I);B(Lo(),I);B(Co(),I);B(gr(),I);B(Po(),I);B(Ld(),I);B(Cd(),I);B(xd(),I);B(Ud(),I)});var st={};import*as nP from"@opentelemetry/api-logs";var fa=_c(()=>{ht(st,nP)});var qd=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.disableInstrumentations=Ne.enableInstrumentations=Ne.parseInstrumentationOptions=void 0;function Bd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let s=Bd(i);e=e.concat(s.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}Ne.parseInstrumentationOptions=Bd;function Qg(r,e,t){for(let n=0,i=r.length;n<i;n++){let s=r[n];e&&s.setTracerProvider(e),t&&s.setMeterProvider(t),s.getConfig().enabled||s.enable()}}Ne.enableInstrumentations=Qg;function Zg(r){r.forEach(e=>e.disable())}Ne.disableInstrumentations=Zg});var Gd=l(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.registerInstrumentations=void 0;var Vd=(h(),m(d)),Ea=qd();function Jg(r){let{instrumentations:e}=(0,Ea.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Vd.trace.getTracerProvider(),n=r.meterProvider||Vd.metrics.getMeterProvider();return(0,Ea.enableInstrumentations)(e,t,n),()=>{(0,Ea.disableInstrumentations)(e)}}Ei.registerInstrumentations=Jg});var ga=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.LogRecord=void 0;var eT=(h(),m(d)),Or=(h(),m(d)),mi=A(),ma=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:s,severityNumber:o,severityText:a,body:u,attributes:c={},context:_}=n,p=Date.now();if(this.hrTime=(0,mi.timeInputToHrTime)(i??p),this.hrTimeObserved=(0,mi.timeInputToHrTime)(s??p),_){let f=Or.trace.getSpanContext(_);f&&Or.isSpanContextValid(f)&&(this.spanContext=f)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(Or.diag.warn(`Invalid attribute key: ${e}`),this):!(0,mi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Or.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,mi.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Or.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&eT.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};gi.LogRecord=ma});var Hd=l(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Logger=void 0;var tT=(h(),m(d)),rT=ga(),Ta=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||tT.context.active(),n=new rT.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};Ti.Logger=Ta});var jd=l(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.reconfigureLimits=Nt.loadDefaultConfig=void 0;var Rr=A();function nT(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}Nt.loadDefaultConfig=nT;function iT(r){var e,t,n,i,s,o;let a=(0,Rr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Rr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(o=(s=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:Rr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}Nt.reconfigureLimits=iT});var Fd=l(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.MultiLogRecordProcessor=void 0;var sT=A(),Sa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,sT.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Si.MultiLogRecordProcessor=Sa});var Oa=l(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.NoopLogRecordProcessor=void 0;var Aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Ai.NoopLogRecordProcessor=Aa});var kd=l(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LoggerProviderSharedState=void 0;var oT=Oa(),Ra=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new oT.NoopLogRecordProcessor}};Oi.LoggerProviderSharedState=Ra});var Wd=l(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.LoggerProvider=ot.DEFAULT_LOGGER_NAME=void 0;var br=(h(),m(d)),aT=(fa(),m(st)),uT=rt(),$d=A(),cT=Hd(),Xd=jd(),lT=Fd(),dT=kd();ot.DEFAULT_LOGGER_NAME="unknown";var ba=class{constructor(e={}){let{resource:t=uT.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,$d.merge)({},(0,Xd.loadDefaultConfig)(),e);this._sharedState=new dT.LoggerProviderSharedState(t,i,(0,Xd.reconfigureLimits)(n)),this._shutdownOnce=new $d.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return br.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),aT.NOOP_LOGGER;e||br.diag.warn("Logger requested without instrumentation scope name.");let i=e||ot.DEFAULT_LOGGER_NAME,s=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new cT.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>br.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new lT.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(br.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(br.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};ot.LoggerProvider=ba});var Kd=l(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConsoleLogRecordExporter=void 0;var _T=A(),pT=A(),Pa=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,_T.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:pT.ExportResultCode.SUCCESS})}};Ri.ConsoleLogRecordExporter=Pa});var zd=l(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SimpleLogRecordProcessor=void 0;var ya=A(),va=class{constructor(e){this._exporter=e,this._shutdownOnce=new ya.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==ya.ExportResultCode.SUCCESS){(0,ya.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};bi.SimpleLogRecordProcessor=va});var Qd=l(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InMemoryLogRecordExporter=void 0;var Yd=A(),Ia=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};Pi.InMemoryLogRecordExporter=Ia});var Zd=l(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.BatchLogRecordProcessorBase=void 0;var hT=(h(),m(d)),Ct=A(),Ma=class{constructor(e,t){var n,i,s,o;this._exporter=e,this._finishedLogRecords=[];let a=(0,Ct.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(s=t?.scheduledDelayMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(o=t?.exportTimeoutMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new Ct.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(hT.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let s=0;s<i;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,Ct.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,Ct.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,Ct.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var s;if(i.code!==Ct.ExportResultCode.SUCCESS){n((s=i.error)!==null&&s!==void 0?s:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};yi.BatchLogRecordProcessorBase=Ma});var Jd=l(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessor=void 0;var fT=Zd(),La=class extends fT.BatchLogRecordProcessorBase{onShutdown(){}};vi.BatchLogRecordProcessor=La});var e_=l(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var ET=Jd();Object.defineProperty(Ii,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return ET.BatchLogRecordProcessor}})});var t_=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.BatchLogRecordProcessor=void 0;var mT=e_();Object.defineProperty(Mi,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return mT.BatchLogRecordProcessor}})});var r_=l(W=>{"use strict";Object.defineProperty(W,"__esModule",{value:!0});W.BatchLogRecordProcessor=W.InMemoryLogRecordExporter=W.SimpleLogRecordProcessor=W.ConsoleLogRecordExporter=W.NoopLogRecordProcessor=W.LogRecord=W.LoggerProvider=void 0;var gT=Wd();Object.defineProperty(W,"LoggerProvider",{enumerable:!0,get:function(){return gT.LoggerProvider}});var TT=ga();Object.defineProperty(W,"LogRecord",{enumerable:!0,get:function(){return TT.LogRecord}});var ST=Oa();Object.defineProperty(W,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return ST.NoopLogRecordProcessor}});var AT=Kd();Object.defineProperty(W,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return AT.ConsoleLogRecordExporter}});var OT=zd();Object.defineProperty(W,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return OT.SimpleLogRecordProcessor}});var RT=Qd();Object.defineProperty(W,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return RT.InMemoryLogRecordExporter}});var bT=t_();Object.defineProperty(W,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return bT.BatchLogRecordProcessor}})});var Li=l(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.AggregationTemporality=void 0;var PT;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(PT=Pr.AggregationTemporality||(Pr.AggregationTemporality={}))});var wt=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.DataPointType=void 0;var yT;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(yT=yr.DataPointType||(yr.DataPointType={}))});var Ee=l(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.equalsCaseInsensitive=L.binarySearchLB=L.setEquals=L.FlatMap=L.isPromiseAllSettledRejectionResult=L.PromiseAllSettled=L.callWithTimeout=L.TimeoutError=L.instrumentationScopeId=L.hashAttributes=L.isNotNullish=void 0;function vT(r){return r!=null}L.isNotNullish=vT;function IT(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}L.hashAttributes=IT;function MT(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}L.instrumentationScopeId=MT;var Ni=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};L.TimeoutError=Ni;function LT(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new Ni("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}L.callWithTimeout=LT;async function NT(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}L.PromiseAllSettled=NT;function CT(r){return r.status==="rejected"}L.isPromiseAllSettledRejectionResult=CT;function wT(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}L.FlatMap=wT;function xT(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}L.setEquals=xT;function DT(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}L.binarySearchLB=DT;function UT(r,e){return r.toLowerCase()===e.toLowerCase()}L.equalsCaseInsensitive=UT});var xt=l(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AggregatorKind=void 0;var BT;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(BT=vr.AggregatorKind||(vr.AggregatorKind={}))});var n_=l(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DropAggregator=void 0;var qT=xt(),Na=class{constructor(){this.kind=qT.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};Ci.DropAggregator=Na});var be=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isValidName=ne.isDescriptorCompatibleWith=ne.createInstrumentDescriptorWithView=ne.createInstrumentDescriptor=ne.InstrumentType=void 0;var i_=(h(),m(d)),VT=Ee(),GT;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(GT=ne.InstrumentType||(ne.InstrumentType={}));function HT(r,e,t){var n,i,s,o;return s_(r)||i_.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(s=t?.valueType)!==null&&s!==void 0?s:i_.ValueType.DOUBLE,advice:(o=t?.advice)!==null&&o!==void 0?o:{}}}ne.createInstrumentDescriptor=HT;function jT(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ne.createInstrumentDescriptorWithView=jT;function FT(r,e){return(0,VT.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ne.isDescriptorCompatibleWith=FT;var kT=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function s_(r){return r.match(kT)!=null}ne.isValidName=s_});var o_=l(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.HistogramAggregator=Ut.HistogramAccumulation=void 0;var $T=xt(),XT=wt(),Ca=be(),WT=Ee();function KT(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Dt=class{constructor(e,t,n=!0,i=KT(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,WT.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ut.HistogramAccumulation=Dt;var wa=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=$T.AggregatorKind.HISTOGRAM}createAccumulation(e){return new Dt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let _=0;_<s.length;_++)a[_]=s[_]+o[_];let u=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),c=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,c=n.max):i.hasMinMax&&(u=i.min,c=i.max)),new Dt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:c})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let u=0;u<s.length;u++)a[u]=o[u]-s[u];return new Dt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:XT.DataPointType.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ca.InstrumentType.UP_DOWN_COUNTER||e.type===Ca.InstrumentType.OBSERVABLE_GAUGE||e.type===Ca.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};Ut.HistogramAggregator=wa});var a_=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Buckets=void 0;var xa=class r{constructor(e=new Da,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};wi.Buckets=xa;var Da=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=s}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});var Ba=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getSignificand=Q.getNormalBase2=Q.MIN_VALUE=Q.MAX_NORMAL_EXPONENT=Q.MIN_NORMAL_EXPONENT=Q.SIGNIFICAND_WIDTH=void 0;Q.SIGNIFICAND_WIDTH=52;var zT=2146435072,YT=1048575,Ua=1023;Q.MIN_NORMAL_EXPONENT=-Ua+1;Q.MAX_NORMAL_EXPONENT=Ua;Q.MIN_VALUE=Math.pow(2,-1022);function QT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&zT)>>20)-Ua}Q.getNormalBase2=QT;function ZT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&YT)*Math.pow(2,32)+n}Q.getSignificand=ZT});var xi=l(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.nextGreaterSquare=Bt.ldexp=void 0;function JT(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Bt.ldexp=JT;function eS(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Bt.nextGreaterSquare=eS});var Ui=l(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MappingError=void 0;var qa=class extends Error{};Di.MappingError=qa});var c_=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExponentMapping=void 0;var qt=Ba(),tS=xi(),u_=Ui(),Va=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<qt.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=qt.getNormalBase2(e),n=this._rightShift(qt.getSignificand(e)-1,qt.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new u_.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new u_.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return tS.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=qt.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return qt.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};Bi.ExponentMapping=Va});var __=l(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.LogarithmMapping=void 0;var Vt=Ba(),l_=xi(),d_=Ui(),Ga=class{constructor(e){this._scale=e,this._scaleFactor=l_.ldexp(Math.LOG2E,e),this._inverseFactor=l_.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=Vt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(Vt.getSignificand(e)===0)return(Vt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new d_.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return Vt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new d_.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return Vt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(Vt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};qi.LogarithmMapping=Ga});var f_=l(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.getMapping=void 0;var rS=c_(),nS=__(),iS=Ui(),p_=-10,h_=20,sS=Array.from({length:31},(r,e)=>e>10?new nS.LogarithmMapping(e-10):new rS.ExponentMapping(e-10));function oS(r){if(r>h_||r<p_)throw new iS.MappingError(`expected scale >= ${p_} && <= ${h_}, got: ${r}`);return sS[r+10]}Vi.getMapping=oS});var g_=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ExponentialHistogramAggregator=Ht.ExponentialHistogramAccumulation=void 0;var aS=xt(),uS=wt(),cS=(h(),m(d)),Ha=be(),E_=a_(),m_=f_(),lS=xi(),Gt=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},dS=20,_S=160,ja=2,Gi=class r{constructor(e=e,t=_S,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=new E_.Buckets,_=new E_.Buckets,p=(0,m_.getMapping)(dS)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=u,this._positive=c,this._negative=_,this._mapping=p,this._maxSize<ja&&(cS.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ja}`),this._maxSize=ja)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let i=this._mapping.mapToIndex(t),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let u=this._changeScale(o,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let s=e.indexEnd-t;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=t}else if(t>e.indexEnd){let s=t-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=(0,lS.nextGreaterSquare)(t);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,m_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Gt.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Gt.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Gt(0,-1);let i=t-n;return new Gt(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++){let c=(s+a>>o)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,n.at(a))}e.trim()}};Ht.ExponentialHistogramAccumulation=Gi;var Fa=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=aS.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new Gi(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:uS.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ha.InstrumentType.UP_DOWN_COUNTER||e.type===Ha.InstrumentType.OBSERVABLE_GAUGE||e.type===Ha.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}};Ht.ExponentialHistogramAggregator=Fa});var T_=l(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.LastValueAggregator=Ft.LastValueAccumulation=void 0;var pS=xt(),Ir=A(),hS=wt(),jt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Ir.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ft.LastValueAccumulation=jt;var ka=class{constructor(){this.kind=pS.AggregatorKind.LAST_VALUE}createAccumulation(e){return new jt(e)}merge(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:hS.DataPointType.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}};Ft.LastValueAggregator=ka});var S_=l(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.SumAggregator=kt.SumAccumulation=void 0;var fS=xt(),ES=wt(),Ce=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};kt.SumAccumulation=Ce;var $a=class{constructor(e){this.monotonic=e,this.kind=fS.AggregatorKind.SUM}createAccumulation(e){return new Ce(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new Ce(t.startTime,this.monotonic,i,t.reset):new Ce(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new Ce(t.startTime,this.monotonic,i,!0):new Ce(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:ES.DataPointType.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}};kt.SumAggregator=$a});var A_=l(ce=>{"use strict";var mS=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Mr=ce&&ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mS(e,r,t)};Object.defineProperty(ce,"__esModule",{value:!0});Mr(n_(),ce);Mr(o_(),ce);Mr(g_(),ce);Mr(T_(),ce);Mr(S_(),ce)});var ki=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DefaultAggregation=q.ExponentialHistogramAggregation=q.ExplicitBucketHistogramAggregation=q.HistogramAggregation=q.LastValueAggregation=q.SumAggregation=q.DropAggregation=q.Aggregation=void 0;var gS=(h(),m(d)),at=A_(),Pe=be(),me=class{static Drop(){return O_}static Sum(){return R_}static LastValue(){return b_}static Histogram(){return P_}static ExponentialHistogram(){return TS}static Default(){return SS}};q.Aggregation=me;var Lr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.DropAggregation=Lr;Lr.DEFAULT_INSTANCE=new at.DropAggregator;var $t=class r extends me{createAggregator(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};q.SumAggregation=$t;$t.MONOTONIC_INSTANCE=new at.SumAggregator(!0);$t.NON_MONOTONIC_INSTANCE=new at.SumAggregator(!1);var Nr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.LastValueAggregation=Nr;Nr.DEFAULT_INSTANCE=new at.LastValueAggregator;var Cr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.HistogramAggregation=Cr;Cr.DEFAULT_INSTANCE=new at.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var Hi=class extends me{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new at.HistogramAggregator(this._boundaries,this._recordMinMax)}};q.ExplicitBucketHistogramAggregation=Hi;var ji=class extends me{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new at.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};q.ExponentialHistogramAggregation=ji;var Fi=class extends me{_resolve(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.UP_DOWN_COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return R_;case Pe.InstrumentType.OBSERVABLE_GAUGE:return b_;case Pe.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Hi(e.advice.explicitBucketBoundaries):P_}return gS.diag.warn(`Unable to recognize instrument type: ${e.type}`),O_}createAggregator(e){return this._resolve(e).createAggregator(e)}};q.DefaultAggregation=Fi;var O_=new Lr,R_=new $t,b_=new Nr,P_=new Cr,TS=new ji,SS=new Fi});var Xa=l(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xt.DEFAULT_AGGREGATION_SELECTOR=void 0;var AS=ki(),OS=Li(),RS=r=>AS.Aggregation.Default();Xt.DEFAULT_AGGREGATION_SELECTOR=RS;var bS=r=>OS.AggregationTemporality.CUMULATIVE;Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=bS});var Ka=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.MetricReader=void 0;var y_=(h(),m(d)),$i=Ee(),v_=Xa(),Wa=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:v_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:v_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,$i.FlatMap)(n,a=>a.errors)),s=t.resourceMetrics.resource,o=t.resourceMetrics.scopeMetrics.concat((0,$i.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){y_.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,$i.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){y_.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,$i.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Xi.MetricReader=Wa});var L_=l(Ki=>{"use strict";Object.defineProperty(Ki,"__esModule",{value:!0});Ki.PeriodicExportingMetricReader=void 0;var I_=(h(),m(d)),Wi=A(),PS=Ka(),M_=Ee(),yS=(h(),m(d)),za=class extends PS.MetricReader{constructor(e){var t,n,i,s;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(s=e.exportTimeoutMillis)!==null&&s!==void 0?s:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,M_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof M_.TimeoutError){I_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Wi.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&I_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let s=async()=>{let o=await Wi.internal._export(this._exporter,n);if(o.code!==Wi.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(s,o=>yS.diag.debug("Error while resolving async portion of resource: ",o)):await s()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Wi.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};Ki.PeriodicExportingMetricReader=za});var C_=l(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InMemoryMetricExporter=void 0;var N_=A(),Ya=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:N_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:N_.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}};zi.InMemoryMetricExporter=Ya});var x_=l(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConsoleMetricExporter=void 0;var w_=A(),vS=Xa(),Qa=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:vS.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:w_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:w_.ExportResultCode.SUCCESS})}};Yi.ConsoleMetricExporter=Qa});var D_=l(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ViewRegistry=void 0;var Za=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};Qi.ViewRegistry=Za});var Zi=l(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.isObservableInstrument=D.ObservableUpDownCounterInstrument=D.ObservableGaugeInstrument=D.ObservableCounterInstrument=D.ObservableInstrument=D.HistogramInstrument=D.CounterInstrument=D.UpDownCounterInstrument=D.SyncInstrument=void 0;var Wt=(h(),m(d)),IS=A(),Kt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=Wt.context.active()){if(typeof e!="number"){Wt.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Wt.ValueType.INT&&!Number.isInteger(e)&&(Wt.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,(0,IS.millisToHrTime)(Date.now()))}};D.SyncInstrument=Kt;var Ja=class extends Kt{add(e,t,n){this._record(e,t,n)}};D.UpDownCounterInstrument=Ja;var eu=class extends Kt{add(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.CounterInstrument=eu;var tu=class extends Kt{record(e,t,n){if(e<0){Wt.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.HistogramInstrument=tu;var ut=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};D.ObservableInstrument=ut;var ru=class extends ut{};D.ObservableCounterInstrument=ru;var nu=class extends ut{};D.ObservableGaugeInstrument=nu;var iu=class extends ut{};D.ObservableUpDownCounterInstrument=iu;function MS(r){return r instanceof ut}D.isObservableInstrument=MS});var U_=l(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Meter=void 0;var ie=be(),zt=Zi(),su=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};Ji.Meter=su});var au=l(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MetricStorage=void 0;var LS=be(),ou=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,LS.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};es.MetricStorage=ou});var wr=l(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AttributeHashMap=Yt.HashMap=void 0;var NS=Ee(),ts=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};Yt.HashMap=ts;var uu=class extends ts{constructor(){super(NS.hashAttributes)}};Yt.AttributeHashMap=uu});var du=l(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.DeltaMetricProcessor=void 0;var cu=wr(),lu=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new cu.AttributeHashMap,this._cumulativeMemoStorage=new cu.AttributeHashMap}record(e,t,n,i){let s=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,s])=>{let o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(n,s)){let u=this._cumulativeMemoStorage.get(n,s);a=this._aggregator.diff(u,o)}if(this._activeCollectionStorage.has(n,s)){let u=this._activeCollectionStorage.get(n,s);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,o,s),this._activeCollectionStorage.set(n,a,s)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new cu.AttributeHashMap,e}};rs.DeltaMetricProcessor=lu});var pu=l(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.TemporalMetricProcessor=void 0;var CS=Li(),wS=wr(),_u=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),_=c.collectionTime;a=c.aggregationTemporality,a===CS.AggregationTemporality.CUMULATIVE?o=r.merge(c.accumulations,s,this._aggregator):o=r.calibrateStartTime(c.accumulations,s,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let u=xS(o);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new wS.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,s=t.entries(),o=s.next();for(;o.done!==!0;){let[a,u,c]=o.value;if(e.has(a,c)){let _=e.get(a,c),p=n.merge(_,u);i.set(a,p,c)}else i.set(a,u,c);o=s.next()}return i}static calibrateStartTime(e,t,n){for(let[i,s]of e.keys()){let o=t.get(i,s);o?.setStartTime(n)}return t}};ns.TemporalMetricProcessor=_u;function xS(r){return Array.from(r.entries())}});var B_=l(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.AsyncMetricStorage=void 0;var DS=au(),US=du(),BS=pu(),qS=wr(),hu=class extends DS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new US.DeltaMetricProcessor(t),this._temporalMetricStorage=new BS.TemporalMetricProcessor(t,i)}record(e,t){let n=new qS.AttributeHashMap;Array.from(e.entries()).forEach(([i,s])=>{n.set(this._attributesProcessor.process(i),s)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};is.AsyncMetricStorage=hu});var j_=l(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getConflictResolutionRecipe=Z.getDescriptionResolutionRecipe=Z.getTypeConflictResolutionRecipe=Z.getUnitConflictResolutionRecipe=Z.getValueTypeConflictResolutionRecipe=Z.getIncompatibilityDetails=void 0;function VS(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
|
|
7
|
+
var Pf=Object.create;var js=Object.defineProperty;var yf=Object.getOwnPropertyDescriptor;var vf=Object.getOwnPropertyNames;var If=Object.getPrototypeOf,Mf=Object.prototype.hasOwnProperty;var z=(r=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(r,{get:(e,t)=>(typeof require<"u"?require:e)[t]}):r)(function(r){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+r+'" is not supported')});var _c=(r,e)=>()=>(r&&(e=r(r=0)),e);var l=(r,e)=>()=>(e||r((e={exports:{}}).exports,e),e.exports);var Xr=(r,e,t,n)=>{if(e&&typeof e=="object"||typeof e=="function")for(let i of vf(e))!Mf.call(r,i)&&i!==t&&js(r,i,{get:()=>e[i],enumerable:!(n=yf(e,i))||n.enumerable});return r},ht=(r,e,t)=>(Xr(r,e,"default"),t&&Xr(t,e,"default")),Y=(r,e,t)=>(t=r!=null?Pf(If(r)):{},Xr(e||!r||!r.__esModule?js(t,"default",{value:r,enumerable:!0}):t,r)),m=r=>Xr(js({},"__esModule",{value:!0}),r);var d={};import*as aR from"@opentelemetry/api";var h=_c(()=>{ht(d,aR)});var dr=l(ye=>{"use strict";Object.defineProperty(ye,"__esModule",{value:!0});ye.isTracingSuppressed=ye.unsuppressTracing=ye.suppressTracing=void 0;var Lf=(h(),m(d)),Fs=(0,Lf.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function Nf(r){return r.setValue(Fs,!0)}ye.suppressTracing=Nf;function Cf(r){return r.deleteValue(Fs)}ye.unsuppressTracing=Cf;function wf(r){return r.getValue(Fs)===!0}ye.isTracingSuppressed=wf});var ks=l(F=>{"use strict";Object.defineProperty(F,"__esModule",{value:!0});F.BAGGAGE_MAX_TOTAL_LENGTH=F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=F.BAGGAGE_MAX_NAME_VALUE_PAIRS=F.BAGGAGE_HEADER=F.BAGGAGE_ITEMS_SEPARATOR=F.BAGGAGE_PROPERTIES_SEPARATOR=F.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;F.BAGGAGE_KEY_PAIR_SEPARATOR="=";F.BAGGAGE_PROPERTIES_SEPARATOR=";";F.BAGGAGE_ITEMS_SEPARATOR=",";F.BAGGAGE_HEADER="baggage";F.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;F.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;F.BAGGAGE_MAX_TOTAL_LENGTH=8192});var $s=l(pe=>{"use strict";Object.defineProperty(pe,"__esModule",{value:!0});pe.parseKeyPairsIntoRecord=pe.parsePairKeyValue=pe.getKeyPairs=pe.serializeKeyPairs=void 0;var xf=(h(),m(d)),je=ks();function Df(r){return r.reduce((e,t)=>{let n=`${e}${e!==""?je.BAGGAGE_ITEMS_SEPARATOR:""}${t}`;return n.length>je.BAGGAGE_MAX_TOTAL_LENGTH?e:n},"")}pe.serializeKeyPairs=Df;function Uf(r){return r.getAllEntries().map(([e,t])=>{let n=`${encodeURIComponent(e)}=${encodeURIComponent(t.value)}`;return t.metadata!==void 0&&(n+=je.BAGGAGE_PROPERTIES_SEPARATOR+t.metadata.toString()),n})}pe.getKeyPairs=Uf;function pc(r){let e=r.split(je.BAGGAGE_PROPERTIES_SEPARATOR);if(e.length<=0)return;let t=e.shift();if(!t)return;let n=t.indexOf(je.BAGGAGE_KEY_PAIR_SEPARATOR);if(n<=0)return;let i=decodeURIComponent(t.substring(0,n).trim()),s=decodeURIComponent(t.substring(n+1).trim()),o;return e.length>0&&(o=(0,xf.baggageEntryMetadataFromString)(e.join(je.BAGGAGE_PROPERTIES_SEPARATOR))),{key:i,value:s,metadata:o}}pe.parsePairKeyValue=pc;function Bf(r){return typeof r!="string"||r.length===0?{}:r.split(je.BAGGAGE_ITEMS_SEPARATOR).map(e=>pc(e)).filter(e=>e!==void 0&&e.value.length>0).reduce((e,t)=>(e[t.key]=t.value,e),{})}pe.parseKeyPairsIntoRecord=Bf});var hc=l(Kr=>{"use strict";Object.defineProperty(Kr,"__esModule",{value:!0});Kr.W3CBaggagePropagator=void 0;var Xs=(h(),m(d)),qf=dr(),Fe=ks(),Ks=$s(),Ws=class{inject(e,t,n){let i=Xs.propagation.getBaggage(e);if(!i||(0,qf.isTracingSuppressed)(e))return;let s=(0,Ks.getKeyPairs)(i).filter(a=>a.length<=Fe.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,Fe.BAGGAGE_MAX_NAME_VALUE_PAIRS),o=(0,Ks.serializeKeyPairs)(s);o.length>0&&n.set(t,Fe.BAGGAGE_HEADER,o)}extract(e,t,n){let i=n.get(t,Fe.BAGGAGE_HEADER),s=Array.isArray(i)?i.join(Fe.BAGGAGE_ITEMS_SEPARATOR):i;if(!s)return e;let o={};return s.length===0||(s.split(Fe.BAGGAGE_ITEMS_SEPARATOR).forEach(u=>{let c=(0,Ks.parsePairKeyValue)(u);if(c){let _={value:c.value};c.metadata&&(_.metadata=c.metadata),o[c.key]=_}}),Object.entries(o).length===0)?e:Xs.propagation.setBaggage(e,Xs.propagation.createBaggage(o))}fields(){return[Fe.BAGGAGE_HEADER]}};Kr.W3CBaggagePropagator=Ws});var fc=l(Wr=>{"use strict";Object.defineProperty(Wr,"__esModule",{value:!0});Wr.AnchoredClock=void 0;var zs=class{constructor(e,t){this._monotonicClock=t,this._epochMillis=e.now(),this._performanceMillis=t.now()}now(){let e=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+e}};Wr.AnchoredClock=zs});var Sc=l(ve=>{"use strict";Object.defineProperty(ve,"__esModule",{value:!0});ve.isAttributeValue=ve.isAttributeKey=ve.sanitizeAttributes=void 0;var Ec=(h(),m(d));function Vf(r){let e={};if(typeof r!="object"||r==null)return e;for(let[t,n]of Object.entries(r)){if(!mc(t)){Ec.diag.warn(`Invalid attribute key: ${t}`);continue}if(!gc(n)){Ec.diag.warn(`Invalid attribute value set for key: ${t}`);continue}Array.isArray(n)?e[t]=n.slice():e[t]=n}return e}ve.sanitizeAttributes=Vf;function mc(r){return typeof r=="string"&&r.length>0}ve.isAttributeKey=mc;function gc(r){return r==null?!0:Array.isArray(r)?Gf(r):Tc(r)}ve.isAttributeValue=gc;function Gf(r){let e;for(let t of r)if(t!=null){if(!e){if(Tc(t)){e=typeof t;continue}return!1}if(typeof t!==e)return!1}return!0}function Tc(r){switch(typeof r){case"number":case"boolean":case"string":return!0}return!1}});var Ys=l(zr=>{"use strict";Object.defineProperty(zr,"__esModule",{value:!0});zr.loggingErrorHandler=void 0;var Hf=(h(),m(d));function jf(){return r=>{Hf.diag.error(Ff(r))}}zr.loggingErrorHandler=jf;function Ff(r){return typeof r=="string"?r:JSON.stringify(kf(r))}function kf(r){let e={},t=r;for(;t!==null;)Object.getOwnPropertyNames(t).forEach(n=>{if(e[n])return;let i=t[n];i&&(e[n]=String(i))}),t=Object.getPrototypeOf(t);return e}});var Qs=l(ft=>{"use strict";Object.defineProperty(ft,"__esModule",{value:!0});ft.globalErrorHandler=ft.setGlobalErrorHandler=void 0;var $f=Ys(),Ac=(0,$f.loggingErrorHandler)();function Xf(r){Ac=r}ft.setGlobalErrorHandler=Xf;function Kf(r){try{Ac(r)}catch{}}ft.globalErrorHandler=Kf});var Zs=l(_r=>{"use strict";Object.defineProperty(_r,"__esModule",{value:!0});_r.TracesSamplerValues=void 0;var Wf;(function(r){r.AlwaysOff="always_off",r.AlwaysOn="always_on",r.ParentBasedAlwaysOff="parentbased_always_off",r.ParentBasedAlwaysOn="parentbased_always_on",r.ParentBasedTraceIdRatio="parentbased_traceidratio",r.TraceIdRatio="traceidratio"})(Wf=_r.TracesSamplerValues||(_r.TracesSamplerValues={}))});var Oc=l(Yr=>{"use strict";Object.defineProperty(Yr,"__esModule",{value:!0});Yr._globalThis=void 0;Yr._globalThis=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});var Qr=l(v=>{"use strict";Object.defineProperty(v,"__esModule",{value:!0});v.getEnvWithoutDefaults=v.parseEnvironment=v.DEFAULT_ENVIRONMENT=v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=void 0;var Ie=(h(),m(d)),zf=Zs(),Yf=Oc(),Qf=",",Zf=["OTEL_SDK_DISABLED"];function Jf(r){return Zf.indexOf(r)>-1}var eE=["OTEL_BSP_EXPORT_TIMEOUT","OTEL_BSP_MAX_EXPORT_BATCH_SIZE","OTEL_BSP_MAX_QUEUE_SIZE","OTEL_BSP_SCHEDULE_DELAY","OTEL_BLRP_EXPORT_TIMEOUT","OTEL_BLRP_MAX_EXPORT_BATCH_SIZE","OTEL_BLRP_MAX_QUEUE_SIZE","OTEL_BLRP_SCHEDULE_DELAY","OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT","OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT","OTEL_SPAN_EVENT_COUNT_LIMIT","OTEL_SPAN_LINK_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT","OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT","OTEL_EXPORTER_OTLP_TIMEOUT","OTEL_EXPORTER_OTLP_TRACES_TIMEOUT","OTEL_EXPORTER_OTLP_METRICS_TIMEOUT","OTEL_EXPORTER_OTLP_LOGS_TIMEOUT","OTEL_EXPORTER_JAEGER_AGENT_PORT"];function tE(r){return eE.indexOf(r)>-1}var rE=["OTEL_NO_PATCH_MODULES","OTEL_PROPAGATORS"];function nE(r){return rE.indexOf(r)>-1}v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT=1/0;v.DEFAULT_ATTRIBUTE_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT=128;v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT=128;v.DEFAULT_ENVIRONMENT={OTEL_SDK_DISABLED:!1,CONTAINER_NAME:"",ECS_CONTAINER_METADATA_URI_V4:"",ECS_CONTAINER_METADATA_URI:"",HOSTNAME:"",KUBERNETES_SERVICE_HOST:"",NAMESPACE:"",OTEL_BSP_EXPORT_TIMEOUT:3e4,OTEL_BSP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BSP_MAX_QUEUE_SIZE:2048,OTEL_BSP_SCHEDULE_DELAY:5e3,OTEL_BLRP_EXPORT_TIMEOUT:3e4,OTEL_BLRP_MAX_EXPORT_BATCH_SIZE:512,OTEL_BLRP_MAX_QUEUE_SIZE:2048,OTEL_BLRP_SCHEDULE_DELAY:5e3,OTEL_EXPORTER_JAEGER_AGENT_HOST:"",OTEL_EXPORTER_JAEGER_AGENT_PORT:6832,OTEL_EXPORTER_JAEGER_ENDPOINT:"",OTEL_EXPORTER_JAEGER_PASSWORD:"",OTEL_EXPORTER_JAEGER_USER:"",OTEL_EXPORTER_OTLP_ENDPOINT:"",OTEL_EXPORTER_OTLP_TRACES_ENDPOINT:"",OTEL_EXPORTER_OTLP_METRICS_ENDPOINT:"",OTEL_EXPORTER_OTLP_LOGS_ENDPOINT:"",OTEL_EXPORTER_OTLP_HEADERS:"",OTEL_EXPORTER_OTLP_TRACES_HEADERS:"",OTEL_EXPORTER_OTLP_METRICS_HEADERS:"",OTEL_EXPORTER_OTLP_LOGS_HEADERS:"",OTEL_EXPORTER_OTLP_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_TRACES_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_METRICS_TIMEOUT:1e4,OTEL_EXPORTER_OTLP_LOGS_TIMEOUT:1e4,OTEL_EXPORTER_ZIPKIN_ENDPOINT:"http://localhost:9411/api/v2/spans",OTEL_LOG_LEVEL:Ie.DiagLogLevel.INFO,OTEL_NO_PATCH_MODULES:[],OTEL_PROPAGATORS:["tracecontext","baggage"],OTEL_RESOURCE_ATTRIBUTES:"",OTEL_SERVICE_NAME:"",OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT:v.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT:v.DEFAULT_ATTRIBUTE_COUNT_LIMIT,OTEL_SPAN_EVENT_COUNT_LIMIT:128,OTEL_SPAN_LINK_COUNT_LIMIT:128,OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT:v.DEFAULT_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT,OTEL_TRACES_EXPORTER:"",OTEL_TRACES_SAMPLER:zf.TracesSamplerValues.ParentBasedAlwaysOn,OTEL_TRACES_SAMPLER_ARG:"",OTEL_LOGS_EXPORTER:"",OTEL_EXPORTER_OTLP_INSECURE:"",OTEL_EXPORTER_OTLP_TRACES_INSECURE:"",OTEL_EXPORTER_OTLP_METRICS_INSECURE:"",OTEL_EXPORTER_OTLP_LOGS_INSECURE:"",OTEL_EXPORTER_OTLP_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CERTIFICATE:"",OTEL_EXPORTER_OTLP_COMPRESSION:"",OTEL_EXPORTER_OTLP_TRACES_COMPRESSION:"",OTEL_EXPORTER_OTLP_METRICS_COMPRESSION:"",OTEL_EXPORTER_OTLP_LOGS_COMPRESSION:"",OTEL_EXPORTER_OTLP_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_KEY:"",OTEL_EXPORTER_OTLP_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_TRACES_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_METRICS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_LOGS_CLIENT_CERTIFICATE:"",OTEL_EXPORTER_OTLP_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_TRACES_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_LOGS_PROTOCOL:"http/protobuf",OTEL_EXPORTER_OTLP_METRICS_TEMPORALITY_PREFERENCE:"cumulative"};function iE(r,e,t){if(typeof t[r]>"u")return;let n=String(t[r]);e[r]=n.toLowerCase()==="true"}function sE(r,e,t,n=-1/0,i=1/0){if(typeof t[r]<"u"){let s=Number(t[r]);isNaN(s)||(s<n?e[r]=n:s>i?e[r]=i:e[r]=s)}}function oE(r,e,t,n=Qf){let i=t[r];typeof i=="string"&&(e[r]=i.split(n).map(s=>s.trim()))}var aE={ALL:Ie.DiagLogLevel.ALL,VERBOSE:Ie.DiagLogLevel.VERBOSE,DEBUG:Ie.DiagLogLevel.DEBUG,INFO:Ie.DiagLogLevel.INFO,WARN:Ie.DiagLogLevel.WARN,ERROR:Ie.DiagLogLevel.ERROR,NONE:Ie.DiagLogLevel.NONE};function uE(r,e,t){let n=t[r];if(typeof n=="string"){let i=aE[n.toUpperCase()];i!=null&&(e[r]=i)}}function Js(r){let e={};for(let t in v.DEFAULT_ENVIRONMENT){let n=t;switch(n){case"OTEL_LOG_LEVEL":uE(n,e,r);break;default:if(Jf(n))iE(n,e,r);else if(tE(n))sE(n,e,r);else if(nE(n))oE(n,e,r);else{let i=r[n];typeof i<"u"&&i!==null&&(e[n]=String(i))}}}return e}v.parseEnvironment=Js;function cE(){return typeof process<"u"&&process&&process.env?Js(process.env):Js(Yf._globalThis)}v.getEnvWithoutDefaults=cE});var bc=l(Zr=>{"use strict";Object.defineProperty(Zr,"__esModule",{value:!0});Zr.getEnv=void 0;var lE=z("os"),Rc=Qr();function dE(){let r=(0,Rc.parseEnvironment)(process.env);return Object.assign({HOSTNAME:lE.hostname()},Rc.DEFAULT_ENVIRONMENT,r)}Zr.getEnv=dE});var Pc=l(Jr=>{"use strict";Object.defineProperty(Jr,"__esModule",{value:!0});Jr._globalThis=void 0;Jr._globalThis=typeof globalThis=="object"?globalThis:global});var vc=l(en=>{"use strict";Object.defineProperty(en,"__esModule",{value:!0});en.hexToBase64=void 0;function yc(r){return r>=48&&r<=57?r-48:r>=97&&r<=102?r-87:r-55}var _E=Buffer.alloc(8),pE=Buffer.alloc(16);function hE(r){let e;r.length===16?e=_E:r.length===32?e=pE:e=Buffer.alloc(r.length/2);let t=0;for(let n=0;n<r.length;n+=2){let i=yc(r.charCodeAt(n)),s=yc(r.charCodeAt(n+1));e.writeUInt8(i<<4|s,t++)}return e.toString("base64")}en.hexToBase64=hE});var Lc=l(rn=>{"use strict";Object.defineProperty(rn,"__esModule",{value:!0});rn.RandomIdGenerator=void 0;var fE=8,Mc=16,eo=class{constructor(){this.generateTraceId=Ic(Mc),this.generateSpanId=Ic(fE)}};rn.RandomIdGenerator=eo;var tn=Buffer.allocUnsafe(Mc);function Ic(r){return function(){for(let t=0;t<r/4;t++)tn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(tn[t]>0);t++)t===r-1&&(tn[r-1]=1);return tn.toString("hex",0,r)}}});var Nc=l(nn=>{"use strict";Object.defineProperty(nn,"__esModule",{value:!0});nn.otperformance=void 0;var EE=z("perf_hooks");nn.otperformance=EE.performance});var to=l(sn=>{"use strict";Object.defineProperty(sn,"__esModule",{value:!0});sn.VERSION=void 0;sn.VERSION="1.19.0"});var Cc=l(b=>{"use strict";Object.defineProperty(b,"__esModule",{value:!0});b.MessageTypeValues=b.RpcGrpcStatusCodeValues=b.MessagingOperationValues=b.MessagingDestinationKindValues=b.HttpFlavorValues=b.NetHostConnectionSubtypeValues=b.NetHostConnectionTypeValues=b.NetTransportValues=b.FaasInvokedProviderValues=b.FaasDocumentOperationValues=b.FaasTriggerValues=b.DbCassandraConsistencyLevelValues=b.DbSystemValues=b.SemanticAttributes=void 0;b.SemanticAttributes={AWS_LAMBDA_INVOKED_ARN:"aws.lambda.invoked_arn",DB_SYSTEM:"db.system",DB_CONNECTION_STRING:"db.connection_string",DB_USER:"db.user",DB_JDBC_DRIVER_CLASSNAME:"db.jdbc.driver_classname",DB_NAME:"db.name",DB_STATEMENT:"db.statement",DB_OPERATION:"db.operation",DB_MSSQL_INSTANCE_NAME:"db.mssql.instance_name",DB_CASSANDRA_KEYSPACE:"db.cassandra.keyspace",DB_CASSANDRA_PAGE_SIZE:"db.cassandra.page_size",DB_CASSANDRA_CONSISTENCY_LEVEL:"db.cassandra.consistency_level",DB_CASSANDRA_TABLE:"db.cassandra.table",DB_CASSANDRA_IDEMPOTENCE:"db.cassandra.idempotence",DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:"db.cassandra.speculative_execution_count",DB_CASSANDRA_COORDINATOR_ID:"db.cassandra.coordinator.id",DB_CASSANDRA_COORDINATOR_DC:"db.cassandra.coordinator.dc",DB_HBASE_NAMESPACE:"db.hbase.namespace",DB_REDIS_DATABASE_INDEX:"db.redis.database_index",DB_MONGODB_COLLECTION:"db.mongodb.collection",DB_SQL_TABLE:"db.sql.table",EXCEPTION_TYPE:"exception.type",EXCEPTION_MESSAGE:"exception.message",EXCEPTION_STACKTRACE:"exception.stacktrace",EXCEPTION_ESCAPED:"exception.escaped",FAAS_TRIGGER:"faas.trigger",FAAS_EXECUTION:"faas.execution",FAAS_DOCUMENT_COLLECTION:"faas.document.collection",FAAS_DOCUMENT_OPERATION:"faas.document.operation",FAAS_DOCUMENT_TIME:"faas.document.time",FAAS_DOCUMENT_NAME:"faas.document.name",FAAS_TIME:"faas.time",FAAS_CRON:"faas.cron",FAAS_COLDSTART:"faas.coldstart",FAAS_INVOKED_NAME:"faas.invoked_name",FAAS_INVOKED_PROVIDER:"faas.invoked_provider",FAAS_INVOKED_REGION:"faas.invoked_region",NET_TRANSPORT:"net.transport",NET_PEER_IP:"net.peer.ip",NET_PEER_PORT:"net.peer.port",NET_PEER_NAME:"net.peer.name",NET_HOST_IP:"net.host.ip",NET_HOST_PORT:"net.host.port",NET_HOST_NAME:"net.host.name",NET_HOST_CONNECTION_TYPE:"net.host.connection.type",NET_HOST_CONNECTION_SUBTYPE:"net.host.connection.subtype",NET_HOST_CARRIER_NAME:"net.host.carrier.name",NET_HOST_CARRIER_MCC:"net.host.carrier.mcc",NET_HOST_CARRIER_MNC:"net.host.carrier.mnc",NET_HOST_CARRIER_ICC:"net.host.carrier.icc",PEER_SERVICE:"peer.service",ENDUSER_ID:"enduser.id",ENDUSER_ROLE:"enduser.role",ENDUSER_SCOPE:"enduser.scope",THREAD_ID:"thread.id",THREAD_NAME:"thread.name",CODE_FUNCTION:"code.function",CODE_NAMESPACE:"code.namespace",CODE_FILEPATH:"code.filepath",CODE_LINENO:"code.lineno",HTTP_METHOD:"http.method",HTTP_URL:"http.url",HTTP_TARGET:"http.target",HTTP_HOST:"http.host",HTTP_SCHEME:"http.scheme",HTTP_STATUS_CODE:"http.status_code",HTTP_FLAVOR:"http.flavor",HTTP_USER_AGENT:"http.user_agent",HTTP_REQUEST_CONTENT_LENGTH:"http.request_content_length",HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:"http.request_content_length_uncompressed",HTTP_RESPONSE_CONTENT_LENGTH:"http.response_content_length",HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:"http.response_content_length_uncompressed",HTTP_SERVER_NAME:"http.server_name",HTTP_ROUTE:"http.route",HTTP_CLIENT_IP:"http.client_ip",AWS_DYNAMODB_TABLE_NAMES:"aws.dynamodb.table_names",AWS_DYNAMODB_CONSUMED_CAPACITY:"aws.dynamodb.consumed_capacity",AWS_DYNAMODB_ITEM_COLLECTION_METRICS:"aws.dynamodb.item_collection_metrics",AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:"aws.dynamodb.provisioned_read_capacity",AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:"aws.dynamodb.provisioned_write_capacity",AWS_DYNAMODB_CONSISTENT_READ:"aws.dynamodb.consistent_read",AWS_DYNAMODB_PROJECTION:"aws.dynamodb.projection",AWS_DYNAMODB_LIMIT:"aws.dynamodb.limit",AWS_DYNAMODB_ATTRIBUTES_TO_GET:"aws.dynamodb.attributes_to_get",AWS_DYNAMODB_INDEX_NAME:"aws.dynamodb.index_name",AWS_DYNAMODB_SELECT:"aws.dynamodb.select",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:"aws.dynamodb.global_secondary_indexes",AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:"aws.dynamodb.local_secondary_indexes",AWS_DYNAMODB_EXCLUSIVE_START_TABLE:"aws.dynamodb.exclusive_start_table",AWS_DYNAMODB_TABLE_COUNT:"aws.dynamodb.table_count",AWS_DYNAMODB_SCAN_FORWARD:"aws.dynamodb.scan_forward",AWS_DYNAMODB_SEGMENT:"aws.dynamodb.segment",AWS_DYNAMODB_TOTAL_SEGMENTS:"aws.dynamodb.total_segments",AWS_DYNAMODB_COUNT:"aws.dynamodb.count",AWS_DYNAMODB_SCANNED_COUNT:"aws.dynamodb.scanned_count",AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:"aws.dynamodb.attribute_definitions",AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:"aws.dynamodb.global_secondary_index_updates",MESSAGING_SYSTEM:"messaging.system",MESSAGING_DESTINATION:"messaging.destination",MESSAGING_DESTINATION_KIND:"messaging.destination_kind",MESSAGING_TEMP_DESTINATION:"messaging.temp_destination",MESSAGING_PROTOCOL:"messaging.protocol",MESSAGING_PROTOCOL_VERSION:"messaging.protocol_version",MESSAGING_URL:"messaging.url",MESSAGING_MESSAGE_ID:"messaging.message_id",MESSAGING_CONVERSATION_ID:"messaging.conversation_id",MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:"messaging.message_payload_size_bytes",MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:"messaging.message_payload_compressed_size_bytes",MESSAGING_OPERATION:"messaging.operation",MESSAGING_CONSUMER_ID:"messaging.consumer_id",MESSAGING_RABBITMQ_ROUTING_KEY:"messaging.rabbitmq.routing_key",MESSAGING_KAFKA_MESSAGE_KEY:"messaging.kafka.message_key",MESSAGING_KAFKA_CONSUMER_GROUP:"messaging.kafka.consumer_group",MESSAGING_KAFKA_CLIENT_ID:"messaging.kafka.client_id",MESSAGING_KAFKA_PARTITION:"messaging.kafka.partition",MESSAGING_KAFKA_TOMBSTONE:"messaging.kafka.tombstone",RPC_SYSTEM:"rpc.system",RPC_SERVICE:"rpc.service",RPC_METHOD:"rpc.method",RPC_GRPC_STATUS_CODE:"rpc.grpc.status_code",RPC_JSONRPC_VERSION:"rpc.jsonrpc.version",RPC_JSONRPC_REQUEST_ID:"rpc.jsonrpc.request_id",RPC_JSONRPC_ERROR_CODE:"rpc.jsonrpc.error_code",RPC_JSONRPC_ERROR_MESSAGE:"rpc.jsonrpc.error_message",MESSAGE_TYPE:"message.type",MESSAGE_ID:"message.id",MESSAGE_COMPRESSED_SIZE:"message.compressed_size",MESSAGE_UNCOMPRESSED_SIZE:"message.uncompressed_size"};b.DbSystemValues={OTHER_SQL:"other_sql",MSSQL:"mssql",MYSQL:"mysql",ORACLE:"oracle",DB2:"db2",POSTGRESQL:"postgresql",REDSHIFT:"redshift",HIVE:"hive",CLOUDSCAPE:"cloudscape",HSQLDB:"hsqldb",PROGRESS:"progress",MAXDB:"maxdb",HANADB:"hanadb",INGRES:"ingres",FIRSTSQL:"firstsql",EDB:"edb",CACHE:"cache",ADABAS:"adabas",FIREBIRD:"firebird",DERBY:"derby",FILEMAKER:"filemaker",INFORMIX:"informix",INSTANTDB:"instantdb",INTERBASE:"interbase",MARIADB:"mariadb",NETEZZA:"netezza",PERVASIVE:"pervasive",POINTBASE:"pointbase",SQLITE:"sqlite",SYBASE:"sybase",TERADATA:"teradata",VERTICA:"vertica",H2:"h2",COLDFUSION:"coldfusion",CASSANDRA:"cassandra",HBASE:"hbase",MONGODB:"mongodb",REDIS:"redis",COUCHBASE:"couchbase",COUCHDB:"couchdb",COSMOSDB:"cosmosdb",DYNAMODB:"dynamodb",NEO4J:"neo4j",GEODE:"geode",ELASTICSEARCH:"elasticsearch",MEMCACHED:"memcached",COCKROACHDB:"cockroachdb"};b.DbCassandraConsistencyLevelValues={ALL:"all",EACH_QUORUM:"each_quorum",QUORUM:"quorum",LOCAL_QUORUM:"local_quorum",ONE:"one",TWO:"two",THREE:"three",LOCAL_ONE:"local_one",ANY:"any",SERIAL:"serial",LOCAL_SERIAL:"local_serial"};b.FaasTriggerValues={DATASOURCE:"datasource",HTTP:"http",PUBSUB:"pubsub",TIMER:"timer",OTHER:"other"};b.FaasDocumentOperationValues={INSERT:"insert",EDIT:"edit",DELETE:"delete"};b.FaasInvokedProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};b.NetTransportValues={IP_TCP:"ip_tcp",IP_UDP:"ip_udp",IP:"ip",UNIX:"unix",PIPE:"pipe",INPROC:"inproc",OTHER:"other"};b.NetHostConnectionTypeValues={WIFI:"wifi",WIRED:"wired",CELL:"cell",UNAVAILABLE:"unavailable",UNKNOWN:"unknown"};b.NetHostConnectionSubtypeValues={GPRS:"gprs",EDGE:"edge",UMTS:"umts",CDMA:"cdma",EVDO_0:"evdo_0",EVDO_A:"evdo_a",CDMA2000_1XRTT:"cdma2000_1xrtt",HSDPA:"hsdpa",HSUPA:"hsupa",HSPA:"hspa",IDEN:"iden",EVDO_B:"evdo_b",LTE:"lte",EHRPD:"ehrpd",HSPAP:"hspap",GSM:"gsm",TD_SCDMA:"td_scdma",IWLAN:"iwlan",NR:"nr",NRNSA:"nrnsa",LTE_CA:"lte_ca"};b.HttpFlavorValues={HTTP_1_0:"1.0",HTTP_1_1:"1.1",HTTP_2_0:"2.0",SPDY:"SPDY",QUIC:"QUIC"};b.MessagingDestinationKindValues={QUEUE:"queue",TOPIC:"topic"};b.MessagingOperationValues={RECEIVE:"receive",PROCESS:"process"};b.RpcGrpcStatusCodeValues={OK:0,CANCELLED:1,UNKNOWN:2,INVALID_ARGUMENT:3,DEADLINE_EXCEEDED:4,NOT_FOUND:5,ALREADY_EXISTS:6,PERMISSION_DENIED:7,RESOURCE_EXHAUSTED:8,FAILED_PRECONDITION:9,ABORTED:10,OUT_OF_RANGE:11,UNIMPLEMENTED:12,INTERNAL:13,UNAVAILABLE:14,DATA_LOSS:15,UNAUTHENTICATED:16};b.MessageTypeValues={SENT:"SENT",RECEIVED:"RECEIVED"}});var wc=l(ke=>{"use strict";var mE=ke&&ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),gE=ke&&ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&mE(e,r,t)};Object.defineProperty(ke,"__esModule",{value:!0});gE(Cc(),ke)});var xc=l(k=>{"use strict";Object.defineProperty(k,"__esModule",{value:!0});k.TelemetrySdkLanguageValues=k.OsTypeValues=k.HostArchValues=k.AwsEcsLaunchtypeValues=k.CloudPlatformValues=k.CloudProviderValues=k.SemanticResourceAttributes=void 0;k.SemanticResourceAttributes={CLOUD_PROVIDER:"cloud.provider",CLOUD_ACCOUNT_ID:"cloud.account.id",CLOUD_REGION:"cloud.region",CLOUD_AVAILABILITY_ZONE:"cloud.availability_zone",CLOUD_PLATFORM:"cloud.platform",AWS_ECS_CONTAINER_ARN:"aws.ecs.container.arn",AWS_ECS_CLUSTER_ARN:"aws.ecs.cluster.arn",AWS_ECS_LAUNCHTYPE:"aws.ecs.launchtype",AWS_ECS_TASK_ARN:"aws.ecs.task.arn",AWS_ECS_TASK_FAMILY:"aws.ecs.task.family",AWS_ECS_TASK_REVISION:"aws.ecs.task.revision",AWS_EKS_CLUSTER_ARN:"aws.eks.cluster.arn",AWS_LOG_GROUP_NAMES:"aws.log.group.names",AWS_LOG_GROUP_ARNS:"aws.log.group.arns",AWS_LOG_STREAM_NAMES:"aws.log.stream.names",AWS_LOG_STREAM_ARNS:"aws.log.stream.arns",CONTAINER_NAME:"container.name",CONTAINER_ID:"container.id",CONTAINER_RUNTIME:"container.runtime",CONTAINER_IMAGE_NAME:"container.image.name",CONTAINER_IMAGE_TAG:"container.image.tag",DEPLOYMENT_ENVIRONMENT:"deployment.environment",DEVICE_ID:"device.id",DEVICE_MODEL_IDENTIFIER:"device.model.identifier",DEVICE_MODEL_NAME:"device.model.name",FAAS_NAME:"faas.name",FAAS_ID:"faas.id",FAAS_VERSION:"faas.version",FAAS_INSTANCE:"faas.instance",FAAS_MAX_MEMORY:"faas.max_memory",HOST_ID:"host.id",HOST_NAME:"host.name",HOST_TYPE:"host.type",HOST_ARCH:"host.arch",HOST_IMAGE_NAME:"host.image.name",HOST_IMAGE_ID:"host.image.id",HOST_IMAGE_VERSION:"host.image.version",K8S_CLUSTER_NAME:"k8s.cluster.name",K8S_NODE_NAME:"k8s.node.name",K8S_NODE_UID:"k8s.node.uid",K8S_NAMESPACE_NAME:"k8s.namespace.name",K8S_POD_UID:"k8s.pod.uid",K8S_POD_NAME:"k8s.pod.name",K8S_CONTAINER_NAME:"k8s.container.name",K8S_REPLICASET_UID:"k8s.replicaset.uid",K8S_REPLICASET_NAME:"k8s.replicaset.name",K8S_DEPLOYMENT_UID:"k8s.deployment.uid",K8S_DEPLOYMENT_NAME:"k8s.deployment.name",K8S_STATEFULSET_UID:"k8s.statefulset.uid",K8S_STATEFULSET_NAME:"k8s.statefulset.name",K8S_DAEMONSET_UID:"k8s.daemonset.uid",K8S_DAEMONSET_NAME:"k8s.daemonset.name",K8S_JOB_UID:"k8s.job.uid",K8S_JOB_NAME:"k8s.job.name",K8S_CRONJOB_UID:"k8s.cronjob.uid",K8S_CRONJOB_NAME:"k8s.cronjob.name",OS_TYPE:"os.type",OS_DESCRIPTION:"os.description",OS_NAME:"os.name",OS_VERSION:"os.version",PROCESS_PID:"process.pid",PROCESS_EXECUTABLE_NAME:"process.executable.name",PROCESS_EXECUTABLE_PATH:"process.executable.path",PROCESS_COMMAND:"process.command",PROCESS_COMMAND_LINE:"process.command_line",PROCESS_COMMAND_ARGS:"process.command_args",PROCESS_OWNER:"process.owner",PROCESS_RUNTIME_NAME:"process.runtime.name",PROCESS_RUNTIME_VERSION:"process.runtime.version",PROCESS_RUNTIME_DESCRIPTION:"process.runtime.description",SERVICE_NAME:"service.name",SERVICE_NAMESPACE:"service.namespace",SERVICE_INSTANCE_ID:"service.instance.id",SERVICE_VERSION:"service.version",TELEMETRY_SDK_NAME:"telemetry.sdk.name",TELEMETRY_SDK_LANGUAGE:"telemetry.sdk.language",TELEMETRY_SDK_VERSION:"telemetry.sdk.version",TELEMETRY_AUTO_VERSION:"telemetry.auto.version",WEBENGINE_NAME:"webengine.name",WEBENGINE_VERSION:"webengine.version",WEBENGINE_DESCRIPTION:"webengine.description"};k.CloudProviderValues={ALIBABA_CLOUD:"alibaba_cloud",AWS:"aws",AZURE:"azure",GCP:"gcp"};k.CloudPlatformValues={ALIBABA_CLOUD_ECS:"alibaba_cloud_ecs",ALIBABA_CLOUD_FC:"alibaba_cloud_fc",AWS_EC2:"aws_ec2",AWS_ECS:"aws_ecs",AWS_EKS:"aws_eks",AWS_LAMBDA:"aws_lambda",AWS_ELASTIC_BEANSTALK:"aws_elastic_beanstalk",AZURE_VM:"azure_vm",AZURE_CONTAINER_INSTANCES:"azure_container_instances",AZURE_AKS:"azure_aks",AZURE_FUNCTIONS:"azure_functions",AZURE_APP_SERVICE:"azure_app_service",GCP_COMPUTE_ENGINE:"gcp_compute_engine",GCP_CLOUD_RUN:"gcp_cloud_run",GCP_KUBERNETES_ENGINE:"gcp_kubernetes_engine",GCP_CLOUD_FUNCTIONS:"gcp_cloud_functions",GCP_APP_ENGINE:"gcp_app_engine"};k.AwsEcsLaunchtypeValues={EC2:"ec2",FARGATE:"fargate"};k.HostArchValues={AMD64:"amd64",ARM32:"arm32",ARM64:"arm64",IA64:"ia64",PPC32:"ppc32",PPC64:"ppc64",X86:"x86"};k.OsTypeValues={WINDOWS:"windows",LINUX:"linux",DARWIN:"darwin",FREEBSD:"freebsd",NETBSD:"netbsd",OPENBSD:"openbsd",DRAGONFLYBSD:"dragonflybsd",HPUX:"hpux",AIX:"aix",SOLARIS:"solaris",Z_OS:"z_os"};k.TelemetrySdkLanguageValues={CPP:"cpp",DOTNET:"dotnet",ERLANG:"erlang",GO:"go",JAVA:"java",NODEJS:"nodejs",PHP:"php",PYTHON:"python",RUBY:"ruby",WEBJS:"webjs"}});var Dc=l($e=>{"use strict";var TE=$e&&$e.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),SE=$e&&$e.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&TE(e,r,t)};Object.defineProperty($e,"__esModule",{value:!0});SE(xc(),$e)});var Ae=l(Me=>{"use strict";var AE=Me&&Me.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Uc=Me&&Me.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&AE(e,r,t)};Object.defineProperty(Me,"__esModule",{value:!0});Uc(wc(),Me);Uc(Dc(),Me)});var Bc=l(on=>{"use strict";Object.defineProperty(on,"__esModule",{value:!0});on.SDK_INFO=void 0;var OE=to(),pr=Ae();on.SDK_INFO={[pr.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:"opentelemetry",[pr.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"node",[pr.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:pr.TelemetrySdkLanguageValues.NODEJS,[pr.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:OE.VERSION}});var qc=l(an=>{"use strict";Object.defineProperty(an,"__esModule",{value:!0});an.unrefTimer=void 0;function RE(r){r.unref()}an.unrefTimer=RE});var Vc=l(ee=>{"use strict";var bE=ee&&ee.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Xe=ee&&ee.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&bE(e,r,t)};Object.defineProperty(ee,"__esModule",{value:!0});Xe(bc(),ee);Xe(Pc(),ee);Xe(vc(),ee);Xe(Lc(),ee);Xe(Nc(),ee);Xe(Bc(),ee);Xe(qc(),ee)});var ro=l(Ke=>{"use strict";var PE=Ke&&Ke.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),yE=Ke&&Ke.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&PE(e,r,t)};Object.defineProperty(Ke,"__esModule",{value:!0});yE(Vc(),Ke)});var Fc=l(y=>{"use strict";Object.defineProperty(y,"__esModule",{value:!0});y.addHrTimes=y.isTimeInput=y.isTimeInputHrTime=y.hrTimeToMicroseconds=y.hrTimeToMilliseconds=y.hrTimeToNanoseconds=y.hrTimeToTimeStamp=y.hrTimeDuration=y.timeInputToHrTime=y.hrTime=y.getTimeOrigin=y.millisToHrTime=void 0;var no=ro(),Gc=9,vE=6,IE=Math.pow(10,vE),un=Math.pow(10,Gc);function hr(r){let e=r/1e3,t=Math.trunc(e),n=Math.round(r%1e3*IE);return[t,n]}y.millisToHrTime=hr;function io(){let r=no.otperformance.timeOrigin;if(typeof r!="number"){let e=no.otperformance;r=e.timing&&e.timing.fetchStart}return r}y.getTimeOrigin=io;function Hc(r){let e=hr(io()),t=hr(typeof r=="number"?r:no.otperformance.now());return jc(e,t)}y.hrTime=Hc;function ME(r){if(so(r))return r;if(typeof r=="number")return r<io()?Hc(r):hr(r);if(r instanceof Date)return hr(r.getTime());throw TypeError("Invalid input type")}y.timeInputToHrTime=ME;function LE(r,e){let t=e[0]-r[0],n=e[1]-r[1];return n<0&&(t-=1,n+=un),[t,n]}y.hrTimeDuration=LE;function NE(r){let e=Gc,t=`${"0".repeat(e)}${r[1]}Z`,n=t.substr(t.length-e-1);return new Date(r[0]*1e3).toISOString().replace("000Z",n)}y.hrTimeToTimeStamp=NE;function CE(r){return r[0]*un+r[1]}y.hrTimeToNanoseconds=CE;function wE(r){return r[0]*1e3+r[1]/1e6}y.hrTimeToMilliseconds=wE;function xE(r){return r[0]*1e6+r[1]/1e3}y.hrTimeToMicroseconds=xE;function so(r){return Array.isArray(r)&&r.length===2&&typeof r[0]=="number"&&typeof r[1]=="number"}y.isTimeInputHrTime=so;function DE(r){return so(r)||typeof r=="number"||r instanceof Date}y.isTimeInput=DE;function jc(r,e){let t=[r[0]+e[0],r[1]+e[1]];return t[1]>=un&&(t[1]-=un,t[0]+=1),t}y.addHrTimes=jc});var $c=l(kc=>{"use strict";Object.defineProperty(kc,"__esModule",{value:!0})});var Xc=l(fr=>{"use strict";Object.defineProperty(fr,"__esModule",{value:!0});fr.ExportResultCode=void 0;var UE;(function(r){r[r.SUCCESS=0]="SUCCESS",r[r.FAILED=1]="FAILED"})(UE=fr.ExportResultCode||(fr.ExportResultCode={}))});var Wc=l(cn=>{"use strict";Object.defineProperty(cn,"__esModule",{value:!0});cn.CompositePropagator=void 0;var Kc=(h(),m(d)),oo=class{constructor(e={}){var t;this._propagators=(t=e.propagators)!==null&&t!==void 0?t:[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,i)=>n.concat(i),[])))}inject(e,t,n){for(let i of this._propagators)try{i.inject(e,t,n)}catch(s){Kc.diag.warn(`Failed to inject with ${i.constructor.name}. Err: ${s.message}`)}}extract(e,t,n){return this._propagators.reduce((i,s)=>{try{return s.extract(i,t,n)}catch(o){Kc.diag.warn(`Failed to inject with ${s.constructor.name}. Err: ${o.message}`)}return i},e)}fields(){return this._fields.slice()}};cn.CompositePropagator=oo});var zc=l(Et=>{"use strict";Object.defineProperty(Et,"__esModule",{value:!0});Et.validateValue=Et.validateKey=void 0;var ao="[_0-9a-z-*/]",BE=`[a-z]${ao}{0,255}`,qE=`[a-z0-9]${ao}{0,240}@[a-z]${ao}{0,13}`,VE=new RegExp(`^(?:${BE}|${qE})$`),GE=/^[ -~]{0,255}[!-~]$/,HE=/,|=/;function jE(r){return VE.test(r)}Et.validateKey=jE;function FE(r){return GE.test(r)&&!HE.test(r)}Et.validateValue=FE});var co=l(ln=>{"use strict";Object.defineProperty(ln,"__esModule",{value:!0});ln.TraceState=void 0;var Yc=zc(),Qc=32,kE=512,Zc=",",Jc="=",uo=class r{constructor(e){this._internalState=new Map,e&&this._parse(e)}set(e,t){let n=this._clone();return n._internalState.has(e)&&n._internalState.delete(e),n._internalState.set(e,t),n}unset(e){let t=this._clone();return t._internalState.delete(e),t}get(e){return this._internalState.get(e)}serialize(){return this._keys().reduce((e,t)=>(e.push(t+Jc+this.get(t)),e),[]).join(Zc)}_parse(e){e.length>kE||(this._internalState=e.split(Zc).reverse().reduce((t,n)=>{let i=n.trim(),s=i.indexOf(Jc);if(s!==-1){let o=i.slice(0,s),a=i.slice(s+1,n.length);(0,Yc.validateKey)(o)&&(0,Yc.validateValue)(a)&&t.set(o,a)}return t},new Map),this._internalState.size>Qc&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,Qc))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let e=new r;return e._internalState=new Map(this._internalState),e}};ln.TraceState=uo});var tl=l($=>{"use strict";Object.defineProperty($,"__esModule",{value:!0});$.W3CTraceContextPropagator=$.parseTraceParent=$.TRACE_STATE_HEADER=$.TRACE_PARENT_HEADER=void 0;var dn=(h(),m(d)),$E=dr(),XE=co();$.TRACE_PARENT_HEADER="traceparent";$.TRACE_STATE_HEADER="tracestate";var KE="00",WE="(?!ff)[\\da-f]{2}",zE="(?![0]{32})[\\da-f]{32}",YE="(?![0]{16})[\\da-f]{16}",QE="[\\da-f]{2}",ZE=new RegExp(`^\\s?(${WE})-(${zE})-(${YE})-(${QE})(-.*)?\\s?$`);function el(r){let e=ZE.exec(r);return!e||e[1]==="00"&&e[5]?null:{traceId:e[2],spanId:e[3],traceFlags:parseInt(e[4],16)}}$.parseTraceParent=el;var lo=class{inject(e,t,n){let i=dn.trace.getSpanContext(e);if(!i||(0,$E.isTracingSuppressed)(e)||!(0,dn.isSpanContextValid)(i))return;let s=`${KE}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||dn.TraceFlags.NONE).toString(16)}`;n.set(t,$.TRACE_PARENT_HEADER,s),i.traceState&&n.set(t,$.TRACE_STATE_HEADER,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,$.TRACE_PARENT_HEADER);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=el(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,$.TRACE_STATE_HEADER);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=new XE.TraceState(typeof u=="string"?u:void 0)}return dn.trace.setSpanContext(e,o)}fields(){return[$.TRACE_PARENT_HEADER,$.TRACE_STATE_HEADER]}};$.W3CTraceContextPropagator=lo});var nl=l(rl=>{"use strict";Object.defineProperty(rl,"__esModule",{value:!0})});var il=l(ue=>{"use strict";Object.defineProperty(ue,"__esModule",{value:!0});ue.getRPCMetadata=ue.deleteRPCMetadata=ue.setRPCMetadata=ue.RPCType=void 0;var JE=(h(),m(d)),_o=(0,JE.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),em;(function(r){r.HTTP="http"})(em=ue.RPCType||(ue.RPCType={}));function tm(r,e){return r.setValue(_o,e)}ue.setRPCMetadata=tm;function rm(r){return r.deleteValue(_o)}ue.deleteRPCMetadata=rm;function nm(r){return r.getValue(_o)}ue.getRPCMetadata=nm});var ho=l(_n=>{"use strict";Object.defineProperty(_n,"__esModule",{value:!0});_n.AlwaysOffSampler=void 0;var im=(h(),m(d)),po=class{shouldSample(){return{decision:im.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};_n.AlwaysOffSampler=po});var Eo=l(pn=>{"use strict";Object.defineProperty(pn,"__esModule",{value:!0});pn.AlwaysOnSampler=void 0;var sm=(h(),m(d)),fo=class{shouldSample(){return{decision:sm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};pn.AlwaysOnSampler=fo});var ol=l(fn=>{"use strict";Object.defineProperty(fn,"__esModule",{value:!0});fn.ParentBasedSampler=void 0;var hn=(h(),m(d)),om=Qs(),sl=ho(),mo=Eo(),go=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,om.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new mo.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new mo.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new sl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new mo.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new sl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=hn.trace.getSpanContext(e);return!a||!(0,hn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&hn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&hn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};fn.ParentBasedSampler=go});var al=l(En=>{"use strict";Object.defineProperty(En,"__esModule",{value:!0});En.TraceIdRatioBasedSampler=void 0;var To=(h(),m(d)),So=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,To.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?To.SamplingDecision.RECORD_AND_SAMPLED:To.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};En.TraceIdRatioBasedSampler=So});var _l=l(mn=>{"use strict";Object.defineProperty(mn,"__esModule",{value:!0});mn.isPlainObject=void 0;var am="[object Object]",um="[object Null]",cm="[object Undefined]",lm=Function.prototype,ul=lm.toString,dm=ul.call(Object),_m=pm(Object.getPrototypeOf,Object),cl=Object.prototype,ll=cl.hasOwnProperty,We=Symbol?Symbol.toStringTag:void 0,dl=cl.toString;function pm(r,e){return function(t){return r(e(t))}}function hm(r){if(!fm(r)||Em(r)!==am)return!1;let e=_m(r);if(e===null)return!0;let t=ll.call(e,"constructor")&&e.constructor;return typeof t=="function"&&t instanceof t&&ul.call(t)===dm}mn.isPlainObject=hm;function fm(r){return r!=null&&typeof r=="object"}function Em(r){return r==null?r===void 0?cm:um:We&&We in Object(r)?mm(r):gm(r)}function mm(r){let e=ll.call(r,We),t=r[We],n=!1;try{r[We]=void 0,n=!0}catch{}let i=dl.call(r);return n&&(e?r[We]=t:delete r[We]),i}function gm(r){return dl.call(r)}});var ml=l(Sn=>{"use strict";Object.defineProperty(Sn,"__esModule",{value:!0});Sn.merge=void 0;var pl=_l(),Tm=20;function Sm(...r){let e=r.shift(),t=new WeakMap;for(;r.length>0;)e=fl(e,r.shift(),0,t);return e}Sn.merge=Sm;function Ao(r){return Tn(r)?r.slice():r}function fl(r,e,t=0,n){let i;if(!(t>Tm)){if(t++,gn(r)||gn(e)||El(e))i=Ao(e);else if(Tn(r)){if(i=r.slice(),Tn(e))for(let s=0,o=e.length;s<o;s++)i.push(Ao(e[s]));else if(Er(e)){let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o];i[u]=Ao(e[u])}}}else if(Er(r))if(Er(e)){if(!Am(r,e))return e;i=Object.assign({},r);let s=Object.keys(e);for(let o=0,a=s.length;o<a;o++){let u=s[o],c=e[u];if(gn(c))typeof c>"u"?delete i[u]:i[u]=c;else{let _=i[u],p=c;if(hl(r,u,n)||hl(e,u,n))delete i[u];else{if(Er(_)&&Er(p)){let f=n.get(_)||[],M=n.get(p)||[];f.push({obj:r,key:u}),M.push({obj:e,key:u}),n.set(_,f),n.set(p,M)}i[u]=fl(i[u],c,t,n)}}}}else i=e;return i}}function hl(r,e,t){let n=t.get(r[e])||[];for(let i=0,s=n.length;i<s;i++){let o=n[i];if(o.key===e&&o.obj===r)return!0}return!1}function Tn(r){return Array.isArray(r)}function El(r){return typeof r=="function"}function Er(r){return!gn(r)&&!Tn(r)&&!El(r)&&typeof r=="object"}function gn(r){return typeof r=="string"||typeof r=="number"||typeof r=="boolean"||typeof r>"u"||r instanceof Date||r instanceof RegExp||r===null}function Am(r,e){return!(!(0,pl.isPlainObject)(r)||!(0,pl.isPlainObject)(e))}});var gl=l(mt=>{"use strict";Object.defineProperty(mt,"__esModule",{value:!0});mt.callWithTimeout=mt.TimeoutError=void 0;var An=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};mt.TimeoutError=An;function Om(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new An("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}mt.callWithTimeout=Om});var Sl=l(gt=>{"use strict";Object.defineProperty(gt,"__esModule",{value:!0});gt.isUrlIgnored=gt.urlMatches=void 0;function Tl(r,e){return typeof e=="string"?r===e:!!r.match(e)}gt.urlMatches=Tl;function Rm(r,e){if(!e)return!1;for(let t of e)if(Tl(r,t))return!0;return!1}gt.isUrlIgnored=Rm});var Al=l(On=>{"use strict";Object.defineProperty(On,"__esModule",{value:!0});On.isWrapped=void 0;function bm(r){return typeof r=="function"&&typeof r.__original=="function"&&typeof r.__unwrap=="function"&&r.__wrapped===!0}On.isWrapped=bm});var Ol=l(Rn=>{"use strict";Object.defineProperty(Rn,"__esModule",{value:!0});Rn.Deferred=void 0;var Oo=class{constructor(){this._promise=new Promise((e,t)=>{this._resolve=e,this._reject=t})}get promise(){return this._promise}resolve(e){this._resolve(e)}reject(e){this._reject(e)}};Rn.Deferred=Oo});var Rl=l(bn=>{"use strict";Object.defineProperty(bn,"__esModule",{value:!0});bn.BindOnceFuture=void 0;var Pm=Ol(),Ro=class{constructor(e,t){this._callback=e,this._that=t,this._isCalled=!1,this._deferred=new Pm.Deferred}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...e){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...e)).then(t=>this._deferred.resolve(t),t=>this._deferred.reject(t))}catch(t){this._deferred.reject(t)}}return this._deferred.promise}};bn.BindOnceFuture=Ro});var Pl=l(Pn=>{"use strict";Object.defineProperty(Pn,"__esModule",{value:!0});Pn._export=void 0;var bl=(h(),m(d)),ym=dr();function vm(r,e){return new Promise(t=>{bl.context.with((0,ym.suppressTracing)(bl.context.active()),()=>{r.export(e,n=>{t(n)})})})}Pn._export=vm});var A=l(T=>{"use strict";var Im=T&&T.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),P=T&&T.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Im(e,r,t)};Object.defineProperty(T,"__esModule",{value:!0});T.internal=T.baggageUtils=void 0;P(hc(),T);P(fc(),T);P(Sc(),T);P(Qs(),T);P(Ys(),T);P(Fc(),T);P($c(),T);P(Xc(),T);T.baggageUtils=$s();P(ro(),T);P(Wc(),T);P(tl(),T);P(nl(),T);P(il(),T);P(ho(),T);P(Eo(),T);P(ol(),T);P(al(),T);P(dr(),T);P(co(),T);P(Qr(),T);P(ml(),T);P(Zs(),T);P(gl(),T);P(Sl(),T);P(Al(),T);P(Rl(),T);P(to(),T);var Mm=Pl();T.internal={_export:Mm._export}});var yl=l(yn=>{"use strict";Object.defineProperty(yn,"__esModule",{value:!0});yn.ExceptionEventName=void 0;yn.ExceptionEventName="exception"});var Po=l(vn=>{"use strict";Object.defineProperty(vn,"__esModule",{value:!0});vn.Span=void 0;var he=(h(),m(d)),X=A(),ze=Ae(),Lm=yl(),bo=class{constructor(e,t,n,i,s,o,a=[],u,c,_){this.attributes={},this.links=[],this.events=[],this._droppedAttributesCount=0,this._droppedEventsCount=0,this._droppedLinksCount=0,this.status={code:he.SpanStatusCode.UNSET},this.endTime=[0,0],this._ended=!1,this._duration=[-1,-1],this.name=n,this._spanContext=i,this.parentSpanId=o,this.kind=s,this.links=a;let p=Date.now();this._performanceStartTime=X.otperformance.now(),this._performanceOffset=p-(this._performanceStartTime+(0,X.getTimeOrigin)()),this._startTimeProvided=u!=null,this.startTime=this._getTime(u??p),this.resource=e.resource,this.instrumentationLibrary=e.instrumentationLibrary,this._spanLimits=e.getSpanLimits(),_!=null&&this.setAttributes(_),this._spanProcessor=e.getActiveSpanProcessor(),this._spanProcessor.onStart(this,t),this._attributeValueLengthLimit=this._spanLimits.attributeValueLengthLimit||0}spanContext(){return this._spanContext}setAttribute(e,t){return t==null||this._isSpanEnded()?this:e.length===0?(he.diag.warn(`Invalid attribute key: ${e}`),this):(0,X.isAttributeValue)(t)?Object.keys(this.attributes).length>=this._spanLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?(this._droppedAttributesCount++,this):(this.attributes[e]=this._truncateToSize(t),this):(he.diag.warn(`Invalid attribute value set for key: ${e}`),this)}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}addEvent(e,t,n){if(this._isSpanEnded())return this;if(this._spanLimits.eventCountLimit===0)return he.diag.warn("No events allowed."),this._droppedEventsCount++,this;this.events.length>=this._spanLimits.eventCountLimit&&(he.diag.warn("Dropping extra events."),this.events.shift(),this._droppedEventsCount++),(0,X.isTimeInput)(t)&&((0,X.isTimeInput)(n)||(n=t),t=void 0);let i=(0,X.sanitizeAttributes)(t);return this.events.push({name:e,attributes:i,time:this._getTime(n),droppedAttributesCount:0}),this}setStatus(e){return this._isSpanEnded()?this:(this.status=e,this)}updateName(e){return this._isSpanEnded()?this:(this.name=e,this)}end(e){if(this._isSpanEnded()){he.diag.error(`${this.name} ${this._spanContext.traceId}-${this._spanContext.spanId} - You can only call end() on a span once.`);return}this._ended=!0,this.endTime=this._getTime(e),this._duration=(0,X.hrTimeDuration)(this.startTime,this.endTime),this._duration[0]<0&&(he.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._spanProcessor.onEnd(this)}_getTime(e){if(typeof e=="number"&&e<X.otperformance.now())return(0,X.hrTime)(e+this._performanceOffset);if(typeof e=="number")return(0,X.millisToHrTime)(e);if(e instanceof Date)return(0,X.millisToHrTime)(e.getTime());if((0,X.isTimeInputHrTime)(e))return e;if(this._startTimeProvided)return(0,X.millisToHrTime)(Date.now());let t=X.otperformance.now()-this._performanceStartTime;return(0,X.addHrTimes)(this.startTime,(0,X.millisToHrTime)(t))}isRecording(){return this._ended===!1}recordException(e,t){let n={};typeof e=="string"?n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e:e&&(e.code?n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.code.toString():e.name&&(n[ze.SemanticAttributes.EXCEPTION_TYPE]=e.name),e.message&&(n[ze.SemanticAttributes.EXCEPTION_MESSAGE]=e.message),e.stack&&(n[ze.SemanticAttributes.EXCEPTION_STACKTRACE]=e.stack)),n[ze.SemanticAttributes.EXCEPTION_TYPE]||n[ze.SemanticAttributes.EXCEPTION_MESSAGE]?this.addEvent(Lm.ExceptionEventName,n,t):he.diag.warn(`Failed to record an exception ${e}`)}get duration(){return this._duration}get ended(){return this._ended}get droppedAttributesCount(){return this._droppedAttributesCount}get droppedEventsCount(){return this._droppedEventsCount}get droppedLinksCount(){return this._droppedLinksCount}_isSpanEnded(){return this._ended&&he.diag.warn(`Can not execute the operation on ended Span {traceId: ${this._spanContext.traceId}, spanId: ${this._spanContext.spanId}}`),this._ended}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substr(0,t)}_truncateToSize(e){let t=this._attributeValueLengthLimit;return t<=0?(he.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}};vn.Span=bo});var gr=l(mr=>{"use strict";Object.defineProperty(mr,"__esModule",{value:!0});mr.SamplingDecision=void 0;var Nm;(function(r){r[r.NOT_RECORD=0]="NOT_RECORD",r[r.RECORD=1]="RECORD",r[r.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(Nm=mr.SamplingDecision||(mr.SamplingDecision={}))});var Mn=l(In=>{"use strict";Object.defineProperty(In,"__esModule",{value:!0});In.AlwaysOffSampler=void 0;var Cm=gr(),yo=class{shouldSample(){return{decision:Cm.SamplingDecision.NOT_RECORD}}toString(){return"AlwaysOffSampler"}};In.AlwaysOffSampler=yo});var Nn=l(Ln=>{"use strict";Object.defineProperty(Ln,"__esModule",{value:!0});Ln.AlwaysOnSampler=void 0;var wm=gr(),vo=class{shouldSample(){return{decision:wm.SamplingDecision.RECORD_AND_SAMPLED}}toString(){return"AlwaysOnSampler"}};Ln.AlwaysOnSampler=vo});var Lo=l(wn=>{"use strict";Object.defineProperty(wn,"__esModule",{value:!0});wn.ParentBasedSampler=void 0;var Cn=(h(),m(d)),xm=A(),vl=Mn(),Io=Nn(),Mo=class{constructor(e){var t,n,i,s;this._root=e.root,this._root||((0,xm.globalErrorHandler)(new Error("ParentBasedSampler must have a root sampler configured")),this._root=new Io.AlwaysOnSampler),this._remoteParentSampled=(t=e.remoteParentSampled)!==null&&t!==void 0?t:new Io.AlwaysOnSampler,this._remoteParentNotSampled=(n=e.remoteParentNotSampled)!==null&&n!==void 0?n:new vl.AlwaysOffSampler,this._localParentSampled=(i=e.localParentSampled)!==null&&i!==void 0?i:new Io.AlwaysOnSampler,this._localParentNotSampled=(s=e.localParentNotSampled)!==null&&s!==void 0?s:new vl.AlwaysOffSampler}shouldSample(e,t,n,i,s,o){let a=Cn.trace.getSpanContext(e);return!a||!(0,Cn.isSpanContextValid)(a)?this._root.shouldSample(e,t,n,i,s,o):a.isRemote?a.traceFlags&Cn.TraceFlags.SAMPLED?this._remoteParentSampled.shouldSample(e,t,n,i,s,o):this._remoteParentNotSampled.shouldSample(e,t,n,i,s,o):a.traceFlags&Cn.TraceFlags.SAMPLED?this._localParentSampled.shouldSample(e,t,n,i,s,o):this._localParentNotSampled.shouldSample(e,t,n,i,s,o)}toString(){return`ParentBased{root=${this._root.toString()}, remoteParentSampled=${this._remoteParentSampled.toString()}, remoteParentNotSampled=${this._remoteParentNotSampled.toString()}, localParentSampled=${this._localParentSampled.toString()}, localParentNotSampled=${this._localParentNotSampled.toString()}}`}};wn.ParentBasedSampler=Mo});var Co=l(xn=>{"use strict";Object.defineProperty(xn,"__esModule",{value:!0});xn.TraceIdRatioBasedSampler=void 0;var Dm=(h(),m(d)),Il=gr(),No=class{constructor(e=0){this._ratio=e,this._ratio=this._normalize(e),this._upperBound=Math.floor(this._ratio*4294967295)}shouldSample(e,t){return{decision:(0,Dm.isValidTraceId)(t)&&this._accumulate(t)<this._upperBound?Il.SamplingDecision.RECORD_AND_SAMPLED:Il.SamplingDecision.NOT_RECORD}}toString(){return`TraceIdRatioBased{${this._ratio}}`}_normalize(e){return typeof e!="number"||isNaN(e)?0:e>=1?1:e<=0?0:e}_accumulate(e){let t=0;for(let n=0;n<e.length/8;n++){let i=n*8,s=parseInt(e.slice(i,i+8),16);t=(t^s)>>>0}return t}};xn.TraceIdRatioBasedSampler=No});var Do=l(St=>{"use strict";Object.defineProperty(St,"__esModule",{value:!0});St.buildSamplerFromEnv=St.loadDefaultConfig=void 0;var Dn=(h(),m(d)),H=A(),Ml=Mn(),wo=Nn(),xo=Lo(),Ll=Co(),Um=(0,H.getEnv)(),Bm=H.TracesSamplerValues.AlwaysOn,Tt=1;function qm(){return{sampler:Cl(Um),forceFlushTimeoutMillis:3e4,generalLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_ATTRIBUTE_COUNT_LIMIT},spanLimits:{attributeValueLengthLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT,linkCountLimit:(0,H.getEnv)().OTEL_SPAN_LINK_COUNT_LIMIT,eventCountLimit:(0,H.getEnv)().OTEL_SPAN_EVENT_COUNT_LIMIT,attributePerEventCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_EVENT_COUNT_LIMIT,attributePerLinkCountLimit:(0,H.getEnv)().OTEL_SPAN_ATTRIBUTE_PER_LINK_COUNT_LIMIT}}}St.loadDefaultConfig=qm;function Cl(r=(0,H.getEnv)()){switch(r.OTEL_TRACES_SAMPLER){case H.TracesSamplerValues.AlwaysOn:return new wo.AlwaysOnSampler;case H.TracesSamplerValues.AlwaysOff:return new Ml.AlwaysOffSampler;case H.TracesSamplerValues.ParentBasedAlwaysOn:return new xo.ParentBasedSampler({root:new wo.AlwaysOnSampler});case H.TracesSamplerValues.ParentBasedAlwaysOff:return new xo.ParentBasedSampler({root:new Ml.AlwaysOffSampler});case H.TracesSamplerValues.TraceIdRatio:return new Ll.TraceIdRatioBasedSampler(Nl(r));case H.TracesSamplerValues.ParentBasedTraceIdRatio:return new xo.ParentBasedSampler({root:new Ll.TraceIdRatioBasedSampler(Nl(r))});default:return Dn.diag.error(`OTEL_TRACES_SAMPLER value "${r.OTEL_TRACES_SAMPLER} invalid, defaulting to ${Bm}".`),new wo.AlwaysOnSampler}}St.buildSamplerFromEnv=Cl;function Nl(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${Tt}.`),Tt;let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${Tt}.`),Tt):e<0||e>1?(Dn.diag.error(`OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${Tt}.`),Tt):e}});var Bo=l(At=>{"use strict";Object.defineProperty(At,"__esModule",{value:!0});At.reconfigureLimits=At.mergeConfig=void 0;var wl=Do(),Uo=A();function Vm(r){let e={sampler:(0,wl.buildSamplerFromEnv)()},t=(0,wl.loadDefaultConfig)(),n=Object.assign({},t,e,r);return n.generalLimits=Object.assign({},t.generalLimits,r.generalLimits||{}),n.spanLimits=Object.assign({},t.spanLimits,r.spanLimits||{}),n}At.mergeConfig=Vm;function Gm(r){var e,t,n,i,s,o,a,u,c,_,p,f;let M=Object.assign({},r.spanLimits),R=(0,Uo.getEnvWithoutDefaults)();return M.attributeCountLimit=(o=(s=(i=(t=(e=r.spanLimits)===null||e===void 0?void 0:e.attributeCountLimit)!==null&&t!==void 0?t:(n=r.generalLimits)===null||n===void 0?void 0:n.attributeCountLimit)!==null&&i!==void 0?i:R.OTEL_SPAN_ATTRIBUTE_COUNT_LIMIT)!==null&&s!==void 0?s:R.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&o!==void 0?o:Uo.DEFAULT_ATTRIBUTE_COUNT_LIMIT,M.attributeValueLengthLimit=(f=(p=(_=(u=(a=r.spanLimits)===null||a===void 0?void 0:a.attributeValueLengthLimit)!==null&&u!==void 0?u:(c=r.generalLimits)===null||c===void 0?void 0:c.attributeValueLengthLimit)!==null&&_!==void 0?_:R.OTEL_SPAN_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&p!==void 0?p:R.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&f!==void 0?f:Uo.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT,Object.assign({},r,{spanLimits:M})}At.reconfigureLimits=Gm});var xl=l(Un=>{"use strict";Object.defineProperty(Un,"__esModule",{value:!0});Un.BatchSpanProcessorBase=void 0;var Ot=(h(),m(d)),Ye=A(),qo=class{constructor(e,t){this._exporter=e,this._isExporting=!1,this._finishedSpans=[],this._droppedSpansCount=0;let n=(0,Ye.getEnv)();this._maxExportBatchSize=typeof t?.maxExportBatchSize=="number"?t.maxExportBatchSize:n.OTEL_BSP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=typeof t?.maxQueueSize=="number"?t.maxQueueSize:n.OTEL_BSP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=typeof t?.scheduledDelayMillis=="number"?t.scheduledDelayMillis:n.OTEL_BSP_SCHEDULE_DELAY,this._exportTimeoutMillis=typeof t?.exportTimeoutMillis=="number"?t.exportTimeoutMillis:n.OTEL_BSP_EXPORT_TIMEOUT,this._shutdownOnce=new Ye.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(Ot.diag.warn("BatchSpanProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}onStart(e,t){}onEnd(e){this._shutdownOnce.isCalled||e.spanContext().traceFlags&Ot.TraceFlags.SAMPLED&&this._addToBuffer(e)}shutdown(){return this._shutdownOnce.call()}_shutdown(){return Promise.resolve().then(()=>this.onShutdown()).then(()=>this._flushAll()).then(()=>this._exporter.shutdown())}_addToBuffer(e){if(this._finishedSpans.length>=this._maxQueueSize){this._droppedSpansCount===0&&Ot.diag.debug("maxQueueSize reached, dropping spans"),this._droppedSpansCount++;return}this._droppedSpansCount>0&&(Ot.diag.warn(`Dropped ${this._droppedSpansCount} spans because maxQueueSize reached`),this._droppedSpansCount=0),this._finishedSpans.push(e),this._maybeStartTimer()}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedSpans.length/this._maxExportBatchSize);for(let s=0,o=i;s<o;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedSpans.length===0?Promise.resolve():new Promise((e,t)=>{let n=setTimeout(()=>{t(new Error("Timeout"))},this._exportTimeoutMillis);Ot.context.with((0,Ye.suppressTracing)(Ot.context.active()),()=>{let i=this._finishedSpans.splice(0,this._maxExportBatchSize),s=()=>this._exporter.export(i,a=>{var u;clearTimeout(n),a.code===Ye.ExportResultCode.SUCCESS?e():t((u=a.error)!==null&&u!==void 0?u:new Error("BatchSpanProcessor: span export failed"))}),o=i.map(a=>a.resource).filter(a=>a.asyncAttributesPending);o.length===0?s():Promise.all(o.map(a=>{var u;return(u=a.waitForAsyncAttributes)===null||u===void 0?void 0:u.call(a)})).then(s,a=>{(0,Ye.globalErrorHandler)(a),t(a)})})})}_maybeStartTimer(){if(this._isExporting)return;let e=()=>{this._isExporting=!0,this._flushOneBatch().then(()=>{this._isExporting=!1,this._finishedSpans.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(t=>{this._isExporting=!1,(0,Ye.globalErrorHandler)(t)})};if(this._finishedSpans.length>=this._maxExportBatchSize)return e();this._timer===void 0&&(this._timer=setTimeout(()=>e(),this._scheduledDelayMillis),(0,Ye.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}};Un.BatchSpanProcessorBase=qo});var Dl=l(Bn=>{"use strict";Object.defineProperty(Bn,"__esModule",{value:!0});Bn.BatchSpanProcessor=void 0;var Hm=xl(),Vo=class extends Hm.BatchSpanProcessorBase{onShutdown(){}};Bn.BatchSpanProcessor=Vo});var ql=l(Vn=>{"use strict";Object.defineProperty(Vn,"__esModule",{value:!0});Vn.RandomIdGenerator=void 0;var jm=8,Bl=16,Go=class{constructor(){this.generateTraceId=Ul(Bl),this.generateSpanId=Ul(jm)}};Vn.RandomIdGenerator=Go;var qn=Buffer.allocUnsafe(Bl);function Ul(r){return function(){for(let t=0;t<r/4;t++)qn.writeUInt32BE(Math.random()*2**32>>>0,t*4);for(let t=0;t<r&&!(qn[t]>0);t++)t===r-1&&(qn[r-1]=1);return qn.toString("hex",0,r)}}});var Gl=l(Le=>{"use strict";var Fm=Le&&Le.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Vl=Le&&Le.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Fm(e,r,t)};Object.defineProperty(Le,"__esModule",{value:!0});Vl(Dl(),Le);Vl(ql(),Le)});var Gn=l(Qe=>{"use strict";var km=Qe&&Qe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),$m=Qe&&Qe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&km(e,r,t)};Object.defineProperty(Qe,"__esModule",{value:!0});$m(Gl(),Qe)});var Hl=l(jn=>{"use strict";Object.defineProperty(jn,"__esModule",{value:!0});jn.Tracer=void 0;var j=(h(),m(d)),Hn=A(),Xm=Po(),Km=Bo(),Wm=Gn(),Ho=class{constructor(e,t,n){this._tracerProvider=n;let i=(0,Km.mergeConfig)(t);this._sampler=i.sampler,this._generalLimits=i.generalLimits,this._spanLimits=i.spanLimits,this._idGenerator=t.idGenerator||new Wm.RandomIdGenerator,this.resource=n.resource,this.instrumentationLibrary=e}startSpan(e,t={},n=j.context.active()){var i,s,o;t.root&&(n=j.trace.deleteSpan(n));let a=j.trace.getSpan(n);if((0,Hn.isTracingSuppressed)(n))return j.diag.debug("Instrumentation suppressed, returning Noop Span"),j.trace.wrapSpanContext(j.INVALID_SPAN_CONTEXT);let u=a?.spanContext(),c=this._idGenerator.generateSpanId(),_,p,f;!u||!j.trace.isSpanContextValid(u)?_=this._idGenerator.generateTraceId():(_=u.traceId,p=u.traceState,f=u.spanId);let M=(i=t.kind)!==null&&i!==void 0?i:j.SpanKind.INTERNAL,R=((s=t.links)!==null&&s!==void 0?s:[]).map(pt=>({context:pt.context,attributes:(0,Hn.sanitizeAttributes)(pt.attributes)})),w=(0,Hn.sanitizeAttributes)(t.attributes),U=this._sampler.shouldSample(n,_,e,M,w,R);p=(o=U.traceState)!==null&&o!==void 0?o:p;let S=U.decision===j.SamplingDecision.RECORD_AND_SAMPLED?j.TraceFlags.SAMPLED:j.TraceFlags.NONE,Te={traceId:_,spanId:c,traceFlags:S,traceState:p};if(U.decision===j.SamplingDecision.NOT_RECORD)return j.diag.debug("Recording is off, propagating context in a non-recording span"),j.trace.wrapSpanContext(Te);let Se=(0,Hn.sanitizeAttributes)(Object.assign(w,U.attributes));return new Xm.Span(this,n,e,Te,M,f,R,t.startTime,void 0,Se)}startActiveSpan(e,t,n,i){let s,o,a;if(arguments.length<2)return;arguments.length===2?a=t:arguments.length===3?(s=t,a=n):(s=t,o=n,a=i);let u=o??j.context.active(),c=this.startSpan(e,s,u),_=j.trace.setSpan(u,c);return j.context.with(_,a,void 0,c)}getGeneralLimits(){return this._generalLimits}getSpanLimits(){return this._spanLimits}getActiveSpanProcessor(){return this._tracerProvider.getActiveSpanProcessor()}};jn.Tracer=Ho});var jl=l(Fn=>{"use strict";Object.defineProperty(Fn,"__esModule",{value:!0});Fn.defaultServiceName=void 0;function zm(){return`unknown_service:${process.argv0}`}Fn.defaultServiceName=zm});var jo=l(Rt=>{"use strict";Object.defineProperty(Rt,"__esModule",{value:!0});Rt.normalizeType=Rt.normalizeArch=void 0;var Ym=r=>{switch(r){case"arm":return"arm32";case"ppc":return"ppc32";case"x64":return"amd64";default:return r}};Rt.normalizeArch=Ym;var Qm=r=>{switch(r){case"sunos":return"solaris";case"win32":return"windows";default:return r}};Rt.normalizeType=Qm});var $n=l(kn=>{"use strict";Object.defineProperty(kn,"__esModule",{value:!0});kn.execAsync=void 0;var Zm=z("child_process"),Jm=z("util");kn.execAsync=Jm.promisify(Zm.exec)});var Fl=l(Xn=>{"use strict";Object.defineProperty(Xn,"__esModule",{value:!0});Xn.getMachineId=void 0;var eg=$n(),tg=(h(),m(d));async function rg(){try{let e=(await(0,eg.execAsync)('ioreg -rd1 -c "IOPlatformExpertDevice"')).stdout.split(`
|
|
8
|
+
`).find(n=>n.includes("IOPlatformUUID"));if(!e)return"";let t=e.split('" = "');if(t.length===2)return t[1].slice(0,-1)}catch(r){tg.diag.debug(`error reading machine id: ${r}`)}return""}Xn.getMachineId=rg});var kl=l(Kn=>{"use strict";Object.defineProperty(Kn,"__esModule",{value:!0});Kn.getMachineId=void 0;var ng=z("fs"),ig=(h(),m(d));async function sg(){let r=["/etc/machine-id","/var/lib/dbus/machine-id"];for(let e of r)try{return(await ng.promises.readFile(e,{encoding:"utf8"})).trim()}catch(t){ig.diag.debug(`error reading machine id: ${t}`)}return""}Kn.getMachineId=sg});var Xl=l(Wn=>{"use strict";Object.defineProperty(Wn,"__esModule",{value:!0});Wn.getMachineId=void 0;var og=z("fs"),ag=$n(),$l=(h(),m(d));async function ug(){try{return(await og.promises.readFile("/etc/hostid",{encoding:"utf8"})).trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}try{return(await(0,ag.execAsync)("kenv -q smbios.system.uuid")).stdout.trim()}catch(r){$l.diag.debug(`error reading machine id: ${r}`)}return""}Wn.getMachineId=ug});var Wl=l(zn=>{"use strict";Object.defineProperty(zn,"__esModule",{value:!0});zn.getMachineId=void 0;var Kl=z("process"),cg=$n(),lg=(h(),m(d));async function dg(){let r="QUERY HKEY_LOCAL_MACHINE\\SOFTWARE\\Microsoft\\Cryptography /v MachineGuid",e="%windir%\\System32\\REG.exe";Kl.arch==="ia32"&&"PROCESSOR_ARCHITEW6432"in Kl.env&&(e="%windir%\\sysnative\\cmd.exe /c "+e);try{let n=(await(0,cg.execAsync)(`${e} ${r}`)).stdout.split("REG_SZ");if(n.length===2)return n[1].trim()}catch(t){lg.diag.debug(`error reading machine id: ${t}`)}return""}zn.getMachineId=dg});var zl=l(Yn=>{"use strict";Object.defineProperty(Yn,"__esModule",{value:!0});Yn.getMachineId=void 0;var _g=(h(),m(d));async function pg(){return _g.diag.debug("could not read machine-id: unsupported platform"),""}Yn.getMachineId=pg});var Yl=l(Oe=>{"use strict";Object.defineProperty(Oe,"__esModule",{value:!0});Oe.getMachineId=void 0;var hg=z("process"),bt;Oe.getMachineId=bt;switch(hg.platform){case"darwin":Oe.getMachineId=bt=Fl().getMachineId;break;case"linux":Oe.getMachineId=bt=kl().getMachineId;break;case"freebsd":Oe.getMachineId=bt=Xl().getMachineId;break;case"win32":Oe.getMachineId=bt=Wl().getMachineId;break;default:Oe.getMachineId=bt=zl().getMachineId}});var $o=l(Qn=>{"use strict";Object.defineProperty(Qn,"__esModule",{value:!0});Qn.hostDetectorSync=void 0;var Fo=Ae(),fg=Ze(),Ql=z("os"),Eg=jo(),mg=Yl(),ko=class{detect(e){let t={[Fo.SemanticResourceAttributes.HOST_NAME]:(0,Ql.hostname)(),[Fo.SemanticResourceAttributes.HOST_ARCH]:(0,Eg.normalizeArch)((0,Ql.arch)())};return new fg.Resource(t,this._getAsyncAttributes())}_getAsyncAttributes(){return(0,mg.getMachineId)().then(e=>{let t={};return e&&(t[Fo.SemanticResourceAttributes.HOST_ID]=e),t})}};Qn.hostDetectorSync=new ko});var Zl=l(Zn=>{"use strict";Object.defineProperty(Zn,"__esModule",{value:!0});Zn.hostDetector=void 0;var gg=$o(),Xo=class{detect(e){return Promise.resolve(gg.hostDetectorSync.detect(e))}};Zn.hostDetector=new Xo});var Wo=l(Jn=>{"use strict";Object.defineProperty(Jn,"__esModule",{value:!0});Jn.osDetectorSync=void 0;var Jl=Ae(),Tg=Ze(),ed=z("os"),Sg=jo(),Ko=class{detect(e){let t={[Jl.SemanticResourceAttributes.OS_TYPE]:(0,Sg.normalizeType)((0,ed.platform)()),[Jl.SemanticResourceAttributes.OS_VERSION]:(0,ed.release)()};return new Tg.Resource(t)}};Jn.osDetectorSync=new Ko});var td=l(ei=>{"use strict";Object.defineProperty(ei,"__esModule",{value:!0});ei.osDetector=void 0;var Ag=Wo(),zo=class{detect(e){return Promise.resolve(Ag.osDetectorSync.detect(e))}};ei.osDetector=new zo});var Qo=l(ti=>{"use strict";Object.defineProperty(ti,"__esModule",{value:!0});ti.processDetectorSync=void 0;var Og=(h(),m(d)),Re=Ae(),Rg=Ze(),bg=z("os"),Yo=class{detect(e){let t={[Re.SemanticResourceAttributes.PROCESS_PID]:process.pid,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_NAME]:process.title,[Re.SemanticResourceAttributes.PROCESS_EXECUTABLE_PATH]:process.execPath,[Re.SemanticResourceAttributes.PROCESS_COMMAND_ARGS]:[process.argv[0],...process.execArgv,...process.argv.slice(1)],[Re.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:process.versions.node,[Re.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"nodejs",[Re.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Node.js"};process.argv.length>1&&(t[Re.SemanticResourceAttributes.PROCESS_COMMAND]=process.argv[1]);try{let n=bg.userInfo();t[Re.SemanticResourceAttributes.PROCESS_OWNER]=n.username}catch(n){Og.diag.debug(`error obtaining process owner: ${n}`)}return new Rg.Resource(t)}};ti.processDetectorSync=new Yo});var rd=l(ri=>{"use strict";Object.defineProperty(ri,"__esModule",{value:!0});ri.processDetector=void 0;var Pg=Qo(),Zo=class{detect(e){return Promise.resolve(Pg.processDetectorSync.detect(e))}};ri.processDetector=new Zo});var nd=l(te=>{"use strict";var yg=te&&te.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Je=te&&te.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&yg(e,r,t)};Object.defineProperty(te,"__esModule",{value:!0});Je(jl(),te);Je(Zl(),te);Je(td(),te);Je($o(),te);Je(Wo(),te);Je(rd(),te);Je(Qo(),te)});var Jo=l(et=>{"use strict";var vg=et&&et.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Ig=et&&et.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&vg(e,r,t)};Object.defineProperty(et,"__esModule",{value:!0});Ig(nd(),et)});var Ze=l(ni=>{"use strict";Object.defineProperty(ni,"__esModule",{value:!0});ni.Resource=void 0;var id=(h(),m(d)),tt=Ae(),ea=A(),Mg=Jo(),Tr=class r{constructor(e,t){var n;this._attributes=e,this.asyncAttributesPending=t!=null,this._syncAttributes=(n=this._attributes)!==null&&n!==void 0?n:{},this._asyncAttributesPromise=t?.then(i=>(this._attributes=Object.assign({},this._attributes,i),this.asyncAttributesPending=!1,i),i=>(id.diag.debug("a resource's async attributes promise rejected: %s",i),this.asyncAttributesPending=!1,{}))}static empty(){return r.EMPTY}static default(){return new r({[tt.SemanticResourceAttributes.SERVICE_NAME]:(0,Mg.defaultServiceName)(),[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_LANGUAGE],[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_NAME],[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]:ea.SDK_INFO[tt.SemanticResourceAttributes.TELEMETRY_SDK_VERSION]})}get attributes(){var e;return this.asyncAttributesPending&&id.diag.error("Accessing resource attributes before async attributes settled"),(e=this._attributes)!==null&&e!==void 0?e:{}}async waitForAsyncAttributes(){this.asyncAttributesPending&&await this._asyncAttributesPromise}merge(e){var t;if(!e)return this;let n=Object.assign(Object.assign({},this._syncAttributes),(t=e._syncAttributes)!==null&&t!==void 0?t:e.attributes);if(!this._asyncAttributesPromise&&!e._asyncAttributesPromise)return new r(n);let i=Promise.all([this._asyncAttributesPromise,e._asyncAttributesPromise]).then(([s,o])=>{var a;return Object.assign(Object.assign(Object.assign(Object.assign({},this._syncAttributes),s),(a=e._syncAttributes)!==null&&a!==void 0?a:e.attributes),o)});return new r(n,i)}};ni.Resource=Tr;Tr.EMPTY=new Tr({})});var od=l(sd=>{"use strict";Object.defineProperty(sd,"__esModule",{value:!0})});var ud=l(ad=>{"use strict";Object.defineProperty(ad,"__esModule",{value:!0})});var ld=l(cd=>{"use strict";Object.defineProperty(cd,"__esModule",{value:!0})});var dd=l(ii=>{"use strict";Object.defineProperty(ii,"__esModule",{value:!0});ii.browserDetector=void 0;var Lg=rt(),ta=class{detect(e){return Promise.resolve(Lg.browserDetectorSync.detect(e))}};ii.browserDetector=new ta});var na=l(si=>{"use strict";Object.defineProperty(si,"__esModule",{value:!0});si.envDetectorSync=void 0;var Ng=(h(),m(d)),Cg=A(),wg=Ae(),xg=Ze(),ra=class{constructor(){this._MAX_LENGTH=255,this._COMMA_SEPARATOR=",",this._LABEL_KEY_VALUE_SPLITTER="=",this._ERROR_MESSAGE_INVALID_CHARS="should be a ASCII string with a length greater than 0 and not exceed "+this._MAX_LENGTH+" characters.",this._ERROR_MESSAGE_INVALID_VALUE="should be a ASCII string with a length not exceed "+this._MAX_LENGTH+" characters."}detect(e){let t={},n=(0,Cg.getEnv)(),i=n.OTEL_RESOURCE_ATTRIBUTES,s=n.OTEL_SERVICE_NAME;if(i)try{let o=this._parseResourceAttributes(i);Object.assign(t,o)}catch(o){Ng.diag.debug(`EnvDetector failed: ${o.message}`)}return s&&(t[wg.SemanticResourceAttributes.SERVICE_NAME]=s),new xg.Resource(t)}_parseResourceAttributes(e){if(!e)return{};let t={},n=e.split(this._COMMA_SEPARATOR,-1);for(let i of n){let s=i.split(this._LABEL_KEY_VALUE_SPLITTER,-1);if(s.length!==2)continue;let[o,a]=s;if(o=o.trim(),a=a.trim().split(/^"|"$/).join(""),!this._isValidAndNotEmpty(o))throw new Error(`Attribute key ${this._ERROR_MESSAGE_INVALID_CHARS}`);if(!this._isValid(a))throw new Error(`Attribute value ${this._ERROR_MESSAGE_INVALID_VALUE}`);t[o]=decodeURIComponent(a)}return t}_isValid(e){return e.length<=this._MAX_LENGTH&&this._isBaggageOctetString(e)}_isBaggageOctetString(e){for(let t=0;t<e.length;t++){let n=e.charCodeAt(t);if(n<33||n===44||n===59||n===92||n>126)return!1}return!0}_isValidAndNotEmpty(e){return e.length>0&&this._isValid(e)}};si.envDetectorSync=new ra});var _d=l(oi=>{"use strict";Object.defineProperty(oi,"__esModule",{value:!0});oi.envDetector=void 0;var Dg=na(),ia=class{detect(e){return Promise.resolve(Dg.envDetectorSync.detect(e))}};oi.envDetector=new ia});var pd=l(ui=>{"use strict";Object.defineProperty(ui,"__esModule",{value:!0});ui.browserDetectorSync=void 0;var ai=Ae(),sa=rt(),Ug=(h(),m(d)),oa=class{detect(e){if(!(typeof navigator<"u"))return sa.Resource.empty();let n={[ai.SemanticResourceAttributes.PROCESS_RUNTIME_NAME]:"browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_DESCRIPTION]:"Web Browser",[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]:navigator.userAgent};return this._getResourceAttributes(n,e)}_getResourceAttributes(e,t){return e[ai.SemanticResourceAttributes.PROCESS_RUNTIME_VERSION]===""?(Ug.diag.debug("BrowserDetector failed: Unable to find required browser resources. "),sa.Resource.empty()):new sa.Resource(Object.assign({},e))}};ui.browserDetectorSync=new oa});var hd=l(fe=>{"use strict";var Bg=fe&&fe.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ci=fe&&fe.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Bg(e,r,t)};Object.defineProperty(fe,"__esModule",{value:!0});ci(dd(),fe);ci(_d(),fe);ci(pd(),fe);ci(na(),fe)});var fd=l(li=>{"use strict";Object.defineProperty(li,"__esModule",{value:!0});li.isPromiseLike=void 0;var qg=r=>r!==null&&typeof r=="object"&&typeof r.then=="function";li.isPromiseLike=qg});var md=l(yt=>{"use strict";Object.defineProperty(yt,"__esModule",{value:!0});yt.detectResourcesSync=yt.detectResources=void 0;var Sr=Ze(),Pt=(h(),m(d)),Vg=fd(),Gg=async(r={})=>{let e=await Promise.all((r.detectors||[]).map(async t=>{try{let n=await t.detect(r);return Pt.diag.debug(`${t.constructor.name} found resource.`,n),n}catch(n){return Pt.diag.debug(`${t.constructor.name} failed: ${n.message}`),Sr.Resource.empty()}}));return Ed(e),e.reduce((t,n)=>t.merge(n),Sr.Resource.empty())};yt.detectResources=Gg;var Hg=(r={})=>{var e;let t=((e=r.detectors)!==null&&e!==void 0?e:[]).map(i=>{try{let s=i.detect(r),o;if((0,Vg.isPromiseLike)(s)){let a=async()=>(await s).attributes;o=new Sr.Resource({},a())}else o=s;return o.waitForAsyncAttributes?o.waitForAsyncAttributes().then(()=>Pt.diag.debug(`${i.constructor.name} found resource.`,o)):Pt.diag.debug(`${i.constructor.name} found resource.`,o),o}catch(s){return Pt.diag.error(`${i.constructor.name} failed: ${s.message}`),Sr.Resource.empty()}}),n=t.reduce((i,s)=>i.merge(s),Sr.Resource.empty());return n.waitForAsyncAttributes&&n.waitForAsyncAttributes().then(()=>{Ed(t)}),n};yt.detectResourcesSync=Hg;var Ed=r=>{r.forEach(e=>{if(Object.keys(e.attributes).length>0){let t=JSON.stringify(e.attributes,null,4);Pt.diag.verbose(t)}})}});var rt=l(re=>{"use strict";var jg=re&&re.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),nt=re&&re.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&jg(e,r,t)};Object.defineProperty(re,"__esModule",{value:!0});nt(Ze(),re);nt(od(),re);nt(Jo(),re);nt(ud(),re);nt(ld(),re);nt(hd(),re);nt(md(),re)});var gd=l(di=>{"use strict";Object.defineProperty(di,"__esModule",{value:!0});di.MultiSpanProcessor=void 0;var Fg=A(),aa=class{constructor(e){this._spanProcessors=e}forceFlush(){let e=[];for(let t of this._spanProcessors)e.push(t.forceFlush());return new Promise(t=>{Promise.all(e).then(()=>{t()}).catch(n=>{(0,Fg.globalErrorHandler)(n||new Error("MultiSpanProcessor: forceFlush failed")),t()})})}onStart(e,t){for(let n of this._spanProcessors)n.onStart(e,t)}onEnd(e){for(let t of this._spanProcessors)t.onEnd(e)}shutdown(){let e=[];for(let t of this._spanProcessors)e.push(t.shutdown());return new Promise((t,n)=>{Promise.all(e).then(()=>{t()},n)})}};di.MultiSpanProcessor=aa});var ca=l(_i=>{"use strict";Object.defineProperty(_i,"__esModule",{value:!0});_i.NoopSpanProcessor=void 0;var ua=class{onStart(e,t){}onEnd(e){}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};_i.NoopSpanProcessor=ua});var Sd=l(it=>{"use strict";Object.defineProperty(it,"__esModule",{value:!0});it.BasicTracerProvider=it.ForceFlushState=void 0;var vt=(h(),m(d)),Mt=A(),Td=rt(),kg=la(),$g=Do(),Xg=gd(),Kg=ca(),Wg=Gn(),zg=Bo(),It;(function(r){r[r.resolved=0]="resolved",r[r.timeout=1]="timeout",r[r.error=2]="error",r[r.unresolved=3]="unresolved"})(It=it.ForceFlushState||(it.ForceFlushState={}));var Ar=class{constructor(e={}){var t;this._registeredSpanProcessors=[],this._tracers=new Map;let n=(0,Mt.merge)({},(0,$g.loadDefaultConfig)(),(0,zg.reconfigureLimits)(e));this.resource=(t=n.resource)!==null&&t!==void 0?t:Td.Resource.empty(),this.resource=Td.Resource.default().merge(this.resource),this._config=Object.assign({},n,{resource:this.resource});let i=this._buildExporterFromEnv();if(i!==void 0){let s=new Wg.BatchSpanProcessor(i);this.activeSpanProcessor=s}else this.activeSpanProcessor=new Kg.NoopSpanProcessor}getTracer(e,t,n){let i=`${e}@${t||""}:${n?.schemaUrl||""}`;return this._tracers.has(i)||this._tracers.set(i,new kg.Tracer({name:e,version:t,schemaUrl:n?.schemaUrl},this._config,this)),this._tracers.get(i)}addSpanProcessor(e){this._registeredSpanProcessors.length===0&&this.activeSpanProcessor.shutdown().catch(t=>vt.diag.error("Error while trying to shutdown current span processor",t)),this._registeredSpanProcessors.push(e),this.activeSpanProcessor=new Xg.MultiSpanProcessor(this._registeredSpanProcessors)}getActiveSpanProcessor(){return this.activeSpanProcessor}register(e={}){vt.trace.setGlobalTracerProvider(this),e.propagator===void 0&&(e.propagator=this._buildPropagatorFromEnv()),e.contextManager&&vt.context.setGlobalContextManager(e.contextManager),e.propagator&&vt.propagation.setGlobalPropagator(e.propagator)}forceFlush(){let e=this._config.forceFlushTimeoutMillis,t=this._registeredSpanProcessors.map(n=>new Promise(i=>{let s,o=setTimeout(()=>{i(new Error(`Span processor did not completed within timeout period of ${e} ms`)),s=It.timeout},e);n.forceFlush().then(()=>{clearTimeout(o),s!==It.timeout&&(s=It.resolved,i(s))}).catch(a=>{clearTimeout(o),s=It.error,i(a)})}));return new Promise((n,i)=>{Promise.all(t).then(s=>{let o=s.filter(a=>a!==It.resolved);o.length>0?i(o):n()}).catch(s=>i([s]))})}shutdown(){return this.activeSpanProcessor.shutdown()}_getPropagator(e){var t;return(t=this.constructor._registeredPropagators.get(e))===null||t===void 0?void 0:t()}_getSpanExporter(e){var t;return(t=this.constructor._registeredExporters.get(e))===null||t===void 0?void 0:t()}_buildPropagatorFromEnv(){let e=Array.from(new Set((0,Mt.getEnv)().OTEL_PROPAGATORS)),n=e.map(i=>{let s=this._getPropagator(i);return s||vt.diag.warn(`Propagator "${i}" requested through environment variable is unavailable.`),s}).reduce((i,s)=>(s&&i.push(s),i),[]);if(n.length!==0)return e.length===1?n[0]:new Mt.CompositePropagator({propagators:n})}_buildExporterFromEnv(){let e=(0,Mt.getEnv)().OTEL_TRACES_EXPORTER;if(e==="none"||e==="")return;let t=this._getSpanExporter(e);return t||vt.diag.error(`Exporter "${e}" requested through environment variable is unavailable.`),t}};it.BasicTracerProvider=Ar;Ar._registeredPropagators=new Map([["tracecontext",()=>new Mt.W3CTraceContextPropagator],["baggage",()=>new Mt.W3CBaggagePropagator]]);Ar._registeredExporters=new Map});var Ad=l(pi=>{"use strict";Object.defineProperty(pi,"__esModule",{value:!0});pi.ConsoleSpanExporter=void 0;var da=A(),_a=class{export(e,t){return this._sendSpans(e,t)}shutdown(){return this._sendSpans([]),this.forceFlush()}forceFlush(){return Promise.resolve()}_exportInfo(e){var t;return{traceId:e.spanContext().traceId,parentId:e.parentSpanId,traceState:(t=e.spanContext().traceState)===null||t===void 0?void 0:t.serialize(),name:e.name,id:e.spanContext().spanId,kind:e.kind,timestamp:(0,da.hrTimeToMicroseconds)(e.startTime),duration:(0,da.hrTimeToMicroseconds)(e.duration),attributes:e.attributes,status:e.status,events:e.events,links:e.links}}_sendSpans(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});if(t)return t({code:da.ExportResultCode.SUCCESS})}};pi.ConsoleSpanExporter=_a});var Rd=l(hi=>{"use strict";Object.defineProperty(hi,"__esModule",{value:!0});hi.InMemorySpanExporter=void 0;var Od=A(),pa=class{constructor(){this._finishedSpans=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Od.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedSpans.push(...e),setTimeout(()=>t({code:Od.ExportResultCode.SUCCESS}),0)}shutdown(){return this._stopped=!0,this._finishedSpans=[],this.forceFlush()}forceFlush(){return Promise.resolve()}reset(){this._finishedSpans=[]}getFinishedSpans(){return this._finishedSpans}};hi.InMemorySpanExporter=pa});var Pd=l(bd=>{"use strict";Object.defineProperty(bd,"__esModule",{value:!0})});var yd=l(fi=>{"use strict";Object.defineProperty(fi,"__esModule",{value:!0});fi.SimpleSpanProcessor=void 0;var Yg=(h(),m(d)),Lt=A(),ha=class{constructor(e){this._exporter=e,this._shutdownOnce=new Lt.BindOnceFuture(this._shutdown,this),this._unresolvedExports=new Set}async forceFlush(){await Promise.all(Array.from(this._unresolvedExports)),this._exporter.forceFlush&&await this._exporter.forceFlush()}onStart(e,t){}onEnd(e){var t,n;if(this._shutdownOnce.isCalled||!(e.spanContext().traceFlags&Yg.TraceFlags.SAMPLED))return;let i=()=>Lt.internal._export(this._exporter,[e]).then(s=>{var o;s.code!==Lt.ExportResultCode.SUCCESS&&(0,Lt.globalErrorHandler)((o=s.error)!==null&&o!==void 0?o:new Error(`SimpleSpanProcessor: span export failed (status ${s})`))}).catch(s=>{(0,Lt.globalErrorHandler)(s)});if(e.resource.asyncAttributesPending){let s=(n=(t=e.resource).waitForAsyncAttributes)===null||n===void 0?void 0:n.call(t).then(()=>(s!=null&&this._unresolvedExports.delete(s),i()),o=>(0,Lt.globalErrorHandler)(o));s!=null&&this._unresolvedExports.add(s)}else i()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};fi.SimpleSpanProcessor=ha});var Id=l(vd=>{"use strict";Object.defineProperty(vd,"__esModule",{value:!0})});var Ld=l(Md=>{"use strict";Object.defineProperty(Md,"__esModule",{value:!0})});var Cd=l(Nd=>{"use strict";Object.defineProperty(Nd,"__esModule",{value:!0})});var xd=l(wd=>{"use strict";Object.defineProperty(wd,"__esModule",{value:!0})});var Ud=l(Dd=>{"use strict";Object.defineProperty(Dd,"__esModule",{value:!0})});var la=l(I=>{"use strict";var Qg=I&&I.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),B=I&&I.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&Qg(e,r,t)};Object.defineProperty(I,"__esModule",{value:!0});B(Hl(),I);B(Sd(),I);B(Gn(),I);B(Ad(),I);B(Rd(),I);B(Pd(),I);B(yd(),I);B(Id(),I);B(ca(),I);B(Mn(),I);B(Nn(),I);B(Lo(),I);B(Co(),I);B(gr(),I);B(Po(),I);B(Ld(),I);B(Cd(),I);B(xd(),I);B(Ud(),I)});var st={};import*as sP from"@opentelemetry/api-logs";var fa=_c(()=>{ht(st,sP)});var qd=l(Ne=>{"use strict";Object.defineProperty(Ne,"__esModule",{value:!0});Ne.disableInstrumentations=Ne.enableInstrumentations=Ne.parseInstrumentationOptions=void 0;function Bd(r=[]){let e=[];for(let t=0,n=r.length;t<n;t++){let i=r[t];if(Array.isArray(i)){let s=Bd(i);e=e.concat(s.instrumentations)}else typeof i=="function"?e.push(new i):i.instrumentationName&&e.push(i)}return{instrumentations:e}}Ne.parseInstrumentationOptions=Bd;function Zg(r,e,t){for(let n=0,i=r.length;n<i;n++){let s=r[n];e&&s.setTracerProvider(e),t&&s.setMeterProvider(t),s.getConfig().enabled||s.enable()}}Ne.enableInstrumentations=Zg;function Jg(r){r.forEach(e=>e.disable())}Ne.disableInstrumentations=Jg});var Gd=l(Ei=>{"use strict";Object.defineProperty(Ei,"__esModule",{value:!0});Ei.registerInstrumentations=void 0;var Vd=(h(),m(d)),Ea=qd();function eT(r){let{instrumentations:e}=(0,Ea.parseInstrumentationOptions)(r.instrumentations),t=r.tracerProvider||Vd.trace.getTracerProvider(),n=r.meterProvider||Vd.metrics.getMeterProvider();return(0,Ea.enableInstrumentations)(e,t,n),()=>{(0,Ea.disableInstrumentations)(e)}}Ei.registerInstrumentations=eT});var ga=l(gi=>{"use strict";Object.defineProperty(gi,"__esModule",{value:!0});gi.LogRecord=void 0;var tT=(h(),m(d)),Or=(h(),m(d)),mi=A(),ma=class{constructor(e,t,n){this.attributes={},this.totalAttributesCount=0,this._isReadonly=!1;let{timestamp:i,observedTimestamp:s,severityNumber:o,severityText:a,body:u,attributes:c={},context:_}=n,p=Date.now();if(this.hrTime=(0,mi.timeInputToHrTime)(i??p),this.hrTimeObserved=(0,mi.timeInputToHrTime)(s??p),_){let f=Or.trace.getSpanContext(_);f&&Or.isSpanContextValid(f)&&(this.spanContext=f)}this.severityNumber=o,this.severityText=a,this.body=u,this.resource=e.resource,this.instrumentationScope=t,this._logRecordLimits=e.logRecordLimits,this.setAttributes(c)}set severityText(e){this._isLogRecordReadonly()||(this._severityText=e)}get severityText(){return this._severityText}set severityNumber(e){this._isLogRecordReadonly()||(this._severityNumber=e)}get severityNumber(){return this._severityNumber}set body(e){this._isLogRecordReadonly()||(this._body=e)}get body(){return this._body}get droppedAttributesCount(){return this.totalAttributesCount-Object.keys(this.attributes).length}setAttribute(e,t){return this._isLogRecordReadonly()?this:t===null?this:e.length===0?(Or.diag.warn(`Invalid attribute key: ${e}`),this):!(0,mi.isAttributeValue)(t)&&!(typeof t=="object"&&!Array.isArray(t)&&Object.keys(t).length>0)?(Or.diag.warn(`Invalid attribute value set for key: ${e}`),this):(this.totalAttributesCount+=1,Object.keys(this.attributes).length>=this._logRecordLimits.attributeCountLimit&&!Object.prototype.hasOwnProperty.call(this.attributes,e)?this:((0,mi.isAttributeValue)(t)?this.attributes[e]=this._truncateToSize(t):this.attributes[e]=t,this))}setAttributes(e){for(let[t,n]of Object.entries(e))this.setAttribute(t,n);return this}setBody(e){return this.body=e,this}setSeverityNumber(e){return this.severityNumber=e,this}setSeverityText(e){return this.severityText=e,this}_makeReadonly(){this._isReadonly=!0}_truncateToSize(e){let t=this._logRecordLimits.attributeValueLengthLimit;return t<=0?(Or.diag.warn(`Attribute value limit must be positive, got ${t}`),e):typeof e=="string"?this._truncateToLimitUtil(e,t):Array.isArray(e)?e.map(n=>typeof n=="string"?this._truncateToLimitUtil(n,t):n):e}_truncateToLimitUtil(e,t){return e.length<=t?e:e.substring(0,t)}_isLogRecordReadonly(){return this._isReadonly&&tT.diag.warn("Can not execute the operation on emitted log record"),this._isReadonly}};gi.LogRecord=ma});var Hd=l(Ti=>{"use strict";Object.defineProperty(Ti,"__esModule",{value:!0});Ti.Logger=void 0;var rT=(h(),m(d)),nT=ga(),Ta=class{constructor(e,t){this.instrumentationScope=e,this._sharedState=t}emit(e){let t=e.context||rT.context.active(),n=new nT.LogRecord(this._sharedState,this.instrumentationScope,Object.assign({context:t},e));this._sharedState.activeProcessor.onEmit(n,t),n._makeReadonly()}};Ti.Logger=Ta});var jd=l(Nt=>{"use strict";Object.defineProperty(Nt,"__esModule",{value:!0});Nt.reconfigureLimits=Nt.loadDefaultConfig=void 0;var Rr=A();function iT(){return{forceFlushTimeoutMillis:3e4,logRecordLimits:{attributeValueLengthLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT,attributeCountLimit:(0,Rr.getEnv)().OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT},includeTraceContext:!0}}Nt.loadDefaultConfig=iT;function sT(r){var e,t,n,i,s,o;let a=(0,Rr.getEnvWithoutDefaults)();return{attributeCountLimit:(n=(t=(e=r.attributeCountLimit)!==null&&e!==void 0?e:a.OTEL_LOGRECORD_ATTRIBUTE_COUNT_LIMIT)!==null&&t!==void 0?t:a.OTEL_ATTRIBUTE_COUNT_LIMIT)!==null&&n!==void 0?n:Rr.DEFAULT_ATTRIBUTE_COUNT_LIMIT,attributeValueLengthLimit:(o=(s=(i=r.attributeValueLengthLimit)!==null&&i!==void 0?i:a.OTEL_LOGRECORD_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&s!==void 0?s:a.OTEL_ATTRIBUTE_VALUE_LENGTH_LIMIT)!==null&&o!==void 0?o:Rr.DEFAULT_ATTRIBUTE_VALUE_LENGTH_LIMIT}}Nt.reconfigureLimits=sT});var Fd=l(Si=>{"use strict";Object.defineProperty(Si,"__esModule",{value:!0});Si.MultiLogRecordProcessor=void 0;var oT=A(),Sa=class{constructor(e,t){this.processors=e,this.forceFlushTimeoutMillis=t}async forceFlush(){let e=this.forceFlushTimeoutMillis;await Promise.all(this.processors.map(t=>(0,oT.callWithTimeout)(t.forceFlush(),e)))}onEmit(e,t){this.processors.forEach(n=>n.onEmit(e,t))}async shutdown(){await Promise.all(this.processors.map(e=>e.shutdown()))}};Si.MultiLogRecordProcessor=Sa});var Oa=l(Ai=>{"use strict";Object.defineProperty(Ai,"__esModule",{value:!0});Ai.NoopLogRecordProcessor=void 0;var Aa=class{forceFlush(){return Promise.resolve()}onEmit(e,t){}shutdown(){return Promise.resolve()}};Ai.NoopLogRecordProcessor=Aa});var kd=l(Oi=>{"use strict";Object.defineProperty(Oi,"__esModule",{value:!0});Oi.LoggerProviderSharedState=void 0;var aT=Oa(),Ra=class{constructor(e,t,n){this.resource=e,this.forceFlushTimeoutMillis=t,this.logRecordLimits=n,this.loggers=new Map,this.registeredLogRecordProcessors=[],this.activeProcessor=new aT.NoopLogRecordProcessor}};Oi.LoggerProviderSharedState=Ra});var Kd=l(ot=>{"use strict";Object.defineProperty(ot,"__esModule",{value:!0});ot.LoggerProvider=ot.DEFAULT_LOGGER_NAME=void 0;var br=(h(),m(d)),uT=(fa(),m(st)),cT=rt(),$d=A(),lT=Hd(),Xd=jd(),dT=Fd(),_T=kd();ot.DEFAULT_LOGGER_NAME="unknown";var ba=class{constructor(e={}){let{resource:t=cT.Resource.default(),logRecordLimits:n,forceFlushTimeoutMillis:i}=(0,$d.merge)({},(0,Xd.loadDefaultConfig)(),e);this._sharedState=new _T.LoggerProviderSharedState(t,i,(0,Xd.reconfigureLimits)(n)),this._shutdownOnce=new $d.BindOnceFuture(this._shutdown,this)}getLogger(e,t,n){if(this._shutdownOnce.isCalled)return br.diag.warn("A shutdown LoggerProvider cannot provide a Logger"),uT.NOOP_LOGGER;e||br.diag.warn("Logger requested without instrumentation scope name.");let i=e||ot.DEFAULT_LOGGER_NAME,s=`${i}@${t||""}:${n?.schemaUrl||""}`;return this._sharedState.loggers.has(s)||this._sharedState.loggers.set(s,new lT.Logger({name:i,version:t,schemaUrl:n?.schemaUrl},this._sharedState)),this._sharedState.loggers.get(s)}addLogRecordProcessor(e){this._sharedState.registeredLogRecordProcessors.length===0&&this._sharedState.activeProcessor.shutdown().catch(t=>br.diag.error("Error while trying to shutdown current log record processor",t)),this._sharedState.registeredLogRecordProcessors.push(e),this._sharedState.activeProcessor=new dT.MultiLogRecordProcessor(this._sharedState.registeredLogRecordProcessors,this._sharedState.forceFlushTimeoutMillis)}forceFlush(){return this._shutdownOnce.isCalled?(br.diag.warn("invalid attempt to force flush after LoggerProvider shutdown"),this._shutdownOnce.promise):this._sharedState.activeProcessor.forceFlush()}shutdown(){return this._shutdownOnce.isCalled?(br.diag.warn("shutdown may only be called once per LoggerProvider"),this._shutdownOnce.promise):this._shutdownOnce.call()}_shutdown(){return this._sharedState.activeProcessor.shutdown()}};ot.LoggerProvider=ba});var Wd=l(Ri=>{"use strict";Object.defineProperty(Ri,"__esModule",{value:!0});Ri.ConsoleLogRecordExporter=void 0;var pT=A(),hT=A(),Pa=class{export(e,t){this._sendLogRecords(e,t)}shutdown(){return Promise.resolve()}_exportInfo(e){var t,n,i;return{timestamp:(0,pT.hrTimeToMicroseconds)(e.hrTime),traceId:(t=e.spanContext)===null||t===void 0?void 0:t.traceId,spanId:(n=e.spanContext)===null||n===void 0?void 0:n.spanId,traceFlags:(i=e.spanContext)===null||i===void 0?void 0:i.traceFlags,severityText:e.severityText,severityNumber:e.severityNumber,body:e.body,attributes:e.attributes}}_sendLogRecords(e,t){for(let n of e)console.dir(this._exportInfo(n),{depth:3});t?.({code:hT.ExportResultCode.SUCCESS})}};Ri.ConsoleLogRecordExporter=Pa});var zd=l(bi=>{"use strict";Object.defineProperty(bi,"__esModule",{value:!0});bi.SimpleLogRecordProcessor=void 0;var ya=A(),va=class{constructor(e){this._exporter=e,this._shutdownOnce=new ya.BindOnceFuture(this._shutdown,this)}onEmit(e){this._shutdownOnce.isCalled||this._exporter.export([e],t=>{var n;if(t.code!==ya.ExportResultCode.SUCCESS){(0,ya.globalErrorHandler)((n=t.error)!==null&&n!==void 0?n:new Error(`SimpleLogRecordProcessor: log record export failed (status ${t})`));return}})}forceFlush(){return Promise.resolve()}shutdown(){return this._shutdownOnce.call()}_shutdown(){return this._exporter.shutdown()}};bi.SimpleLogRecordProcessor=va});var Qd=l(Pi=>{"use strict";Object.defineProperty(Pi,"__esModule",{value:!0});Pi.InMemoryLogRecordExporter=void 0;var Yd=A(),Ia=class{constructor(){this._finishedLogRecords=[],this._stopped=!1}export(e,t){if(this._stopped)return t({code:Yd.ExportResultCode.FAILED,error:new Error("Exporter has been stopped")});this._finishedLogRecords.push(...e),t({code:Yd.ExportResultCode.SUCCESS})}shutdown(){return this._stopped=!0,this.reset(),Promise.resolve()}getFinishedLogRecords(){return this._finishedLogRecords}reset(){this._finishedLogRecords=[]}};Pi.InMemoryLogRecordExporter=Ia});var Zd=l(yi=>{"use strict";Object.defineProperty(yi,"__esModule",{value:!0});yi.BatchLogRecordProcessorBase=void 0;var fT=(h(),m(d)),Ct=A(),Ma=class{constructor(e,t){var n,i,s,o;this._exporter=e,this._finishedLogRecords=[];let a=(0,Ct.getEnv)();this._maxExportBatchSize=(n=t?.maxExportBatchSize)!==null&&n!==void 0?n:a.OTEL_BLRP_MAX_EXPORT_BATCH_SIZE,this._maxQueueSize=(i=t?.maxQueueSize)!==null&&i!==void 0?i:a.OTEL_BLRP_MAX_QUEUE_SIZE,this._scheduledDelayMillis=(s=t?.scheduledDelayMillis)!==null&&s!==void 0?s:a.OTEL_BLRP_SCHEDULE_DELAY,this._exportTimeoutMillis=(o=t?.exportTimeoutMillis)!==null&&o!==void 0?o:a.OTEL_BLRP_EXPORT_TIMEOUT,this._shutdownOnce=new Ct.BindOnceFuture(this._shutdown,this),this._maxExportBatchSize>this._maxQueueSize&&(fT.diag.warn("BatchLogRecordProcessor: maxExportBatchSize must be smaller or equal to maxQueueSize, setting maxExportBatchSize to match maxQueueSize"),this._maxExportBatchSize=this._maxQueueSize)}onEmit(e){this._shutdownOnce.isCalled||this._addToBuffer(e)}forceFlush(){return this._shutdownOnce.isCalled?this._shutdownOnce.promise:this._flushAll()}shutdown(){return this._shutdownOnce.call()}async _shutdown(){this.onShutdown(),await this._flushAll(),await this._exporter.shutdown()}_addToBuffer(e){this._finishedLogRecords.length>=this._maxQueueSize||(this._finishedLogRecords.push(e),this._maybeStartTimer())}_flushAll(){return new Promise((e,t)=>{let n=[],i=Math.ceil(this._finishedLogRecords.length/this._maxExportBatchSize);for(let s=0;s<i;s++)n.push(this._flushOneBatch());Promise.all(n).then(()=>{e()}).catch(t)})}_flushOneBatch(){return this._clearTimer(),this._finishedLogRecords.length===0?Promise.resolve():new Promise((e,t)=>{(0,Ct.callWithTimeout)(this._export(this._finishedLogRecords.splice(0,this._maxExportBatchSize)),this._exportTimeoutMillis).then(()=>e()).catch(t)})}_maybeStartTimer(){this._timer===void 0&&(this._timer=setTimeout(()=>{this._flushOneBatch().then(()=>{this._finishedLogRecords.length>0&&(this._clearTimer(),this._maybeStartTimer())}).catch(e=>{(0,Ct.globalErrorHandler)(e)})},this._scheduledDelayMillis),(0,Ct.unrefTimer)(this._timer))}_clearTimer(){this._timer!==void 0&&(clearTimeout(this._timer),this._timer=void 0)}_export(e){return new Promise((t,n)=>{this._exporter.export(e,i=>{var s;if(i.code!==Ct.ExportResultCode.SUCCESS){n((s=i.error)!==null&&s!==void 0?s:new Error(`BatchLogRecordProcessorBase: log record export failed (status ${i})`));return}t(i)})})}};yi.BatchLogRecordProcessorBase=Ma});var Jd=l(vi=>{"use strict";Object.defineProperty(vi,"__esModule",{value:!0});vi.BatchLogRecordProcessor=void 0;var ET=Zd(),La=class extends ET.BatchLogRecordProcessorBase{onShutdown(){}};vi.BatchLogRecordProcessor=La});var e_=l(Ii=>{"use strict";Object.defineProperty(Ii,"__esModule",{value:!0});Ii.BatchLogRecordProcessor=void 0;var mT=Jd();Object.defineProperty(Ii,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return mT.BatchLogRecordProcessor}})});var t_=l(Mi=>{"use strict";Object.defineProperty(Mi,"__esModule",{value:!0});Mi.BatchLogRecordProcessor=void 0;var gT=e_();Object.defineProperty(Mi,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return gT.BatchLogRecordProcessor}})});var r_=l(K=>{"use strict";Object.defineProperty(K,"__esModule",{value:!0});K.BatchLogRecordProcessor=K.InMemoryLogRecordExporter=K.SimpleLogRecordProcessor=K.ConsoleLogRecordExporter=K.NoopLogRecordProcessor=K.LogRecord=K.LoggerProvider=void 0;var TT=Kd();Object.defineProperty(K,"LoggerProvider",{enumerable:!0,get:function(){return TT.LoggerProvider}});var ST=ga();Object.defineProperty(K,"LogRecord",{enumerable:!0,get:function(){return ST.LogRecord}});var AT=Oa();Object.defineProperty(K,"NoopLogRecordProcessor",{enumerable:!0,get:function(){return AT.NoopLogRecordProcessor}});var OT=Wd();Object.defineProperty(K,"ConsoleLogRecordExporter",{enumerable:!0,get:function(){return OT.ConsoleLogRecordExporter}});var RT=zd();Object.defineProperty(K,"SimpleLogRecordProcessor",{enumerable:!0,get:function(){return RT.SimpleLogRecordProcessor}});var bT=Qd();Object.defineProperty(K,"InMemoryLogRecordExporter",{enumerable:!0,get:function(){return bT.InMemoryLogRecordExporter}});var PT=t_();Object.defineProperty(K,"BatchLogRecordProcessor",{enumerable:!0,get:function(){return PT.BatchLogRecordProcessor}})});var Li=l(Pr=>{"use strict";Object.defineProperty(Pr,"__esModule",{value:!0});Pr.AggregationTemporality=void 0;var yT;(function(r){r[r.DELTA=0]="DELTA",r[r.CUMULATIVE=1]="CUMULATIVE"})(yT=Pr.AggregationTemporality||(Pr.AggregationTemporality={}))});var wt=l(yr=>{"use strict";Object.defineProperty(yr,"__esModule",{value:!0});yr.DataPointType=void 0;var vT;(function(r){r[r.HISTOGRAM=0]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=1]="EXPONENTIAL_HISTOGRAM",r[r.GAUGE=2]="GAUGE",r[r.SUM=3]="SUM"})(vT=yr.DataPointType||(yr.DataPointType={}))});var Ee=l(L=>{"use strict";Object.defineProperty(L,"__esModule",{value:!0});L.equalsCaseInsensitive=L.binarySearchLB=L.setEquals=L.FlatMap=L.isPromiseAllSettledRejectionResult=L.PromiseAllSettled=L.callWithTimeout=L.TimeoutError=L.instrumentationScopeId=L.hashAttributes=L.isNotNullish=void 0;function IT(r){return r!=null}L.isNotNullish=IT;function MT(r){let e=Object.keys(r);return e.length===0?"":(e=e.sort(),JSON.stringify(e.map(t=>[t,r[t]])))}L.hashAttributes=MT;function LT(r){var e,t;return`${r.name}:${(e=r.version)!==null&&e!==void 0?e:""}:${(t=r.schemaUrl)!==null&&t!==void 0?t:""}`}L.instrumentationScopeId=LT;var Ni=class r extends Error{constructor(e){super(e),Object.setPrototypeOf(this,r.prototype)}};L.TimeoutError=Ni;function NT(r,e){let t,n=new Promise(function(s,o){t=setTimeout(function(){o(new Ni("Operation timed out."))},e)});return Promise.race([r,n]).then(i=>(clearTimeout(t),i),i=>{throw clearTimeout(t),i})}L.callWithTimeout=NT;async function CT(r){return Promise.all(r.map(async e=>{try{return{status:"fulfilled",value:await e}}catch(t){return{status:"rejected",reason:t}}}))}L.PromiseAllSettled=CT;function wT(r){return r.status==="rejected"}L.isPromiseAllSettledRejectionResult=wT;function xT(r,e){let t=[];return r.forEach(n=>{t.push(...e(n))}),t}L.FlatMap=xT;function DT(r,e){if(r.size!==e.size)return!1;for(let t of r)if(!e.has(t))return!1;return!0}L.setEquals=DT;function UT(r,e){let t=0,n=r.length-1;for(;n-t>1;){let i=Math.trunc((n+t)/2);r[i]<=e?t=i:n=i-1}return r[n]<=e?n:r[t]<=e?t:-1}L.binarySearchLB=UT;function BT(r,e){return r.toLowerCase()===e.toLowerCase()}L.equalsCaseInsensitive=BT});var xt=l(vr=>{"use strict";Object.defineProperty(vr,"__esModule",{value:!0});vr.AggregatorKind=void 0;var qT;(function(r){r[r.DROP=0]="DROP",r[r.SUM=1]="SUM",r[r.LAST_VALUE=2]="LAST_VALUE",r[r.HISTOGRAM=3]="HISTOGRAM",r[r.EXPONENTIAL_HISTOGRAM=4]="EXPONENTIAL_HISTOGRAM"})(qT=vr.AggregatorKind||(vr.AggregatorKind={}))});var n_=l(Ci=>{"use strict";Object.defineProperty(Ci,"__esModule",{value:!0});Ci.DropAggregator=void 0;var VT=xt(),Na=class{constructor(){this.kind=VT.AggregatorKind.DROP}createAccumulation(){}merge(e,t){}diff(e,t){}toMetricData(e,t,n,i){}};Ci.DropAggregator=Na});var be=l(ne=>{"use strict";Object.defineProperty(ne,"__esModule",{value:!0});ne.isValidName=ne.isDescriptorCompatibleWith=ne.createInstrumentDescriptorWithView=ne.createInstrumentDescriptor=ne.InstrumentType=void 0;var i_=(h(),m(d)),GT=Ee(),HT;(function(r){r.COUNTER="COUNTER",r.HISTOGRAM="HISTOGRAM",r.UP_DOWN_COUNTER="UP_DOWN_COUNTER",r.OBSERVABLE_COUNTER="OBSERVABLE_COUNTER",r.OBSERVABLE_GAUGE="OBSERVABLE_GAUGE",r.OBSERVABLE_UP_DOWN_COUNTER="OBSERVABLE_UP_DOWN_COUNTER"})(HT=ne.InstrumentType||(ne.InstrumentType={}));function jT(r,e,t){var n,i,s,o;return s_(r)||i_.diag.warn(`Invalid metric name: "${r}". The metric name should be a ASCII string with a length no greater than 255 characters.`),{name:r,type:e,description:(n=t?.description)!==null&&n!==void 0?n:"",unit:(i=t?.unit)!==null&&i!==void 0?i:"",valueType:(s=t?.valueType)!==null&&s!==void 0?s:i_.ValueType.DOUBLE,advice:(o=t?.advice)!==null&&o!==void 0?o:{}}}ne.createInstrumentDescriptor=jT;function FT(r,e){var t,n;return{name:(t=r.name)!==null&&t!==void 0?t:e.name,description:(n=r.description)!==null&&n!==void 0?n:e.description,type:e.type,unit:e.unit,valueType:e.valueType,advice:e.advice}}ne.createInstrumentDescriptorWithView=FT;function kT(r,e){return(0,GT.equalsCaseInsensitive)(r.name,e.name)&&r.unit===e.unit&&r.type===e.type&&r.valueType===e.valueType}ne.isDescriptorCompatibleWith=kT;var $T=/^[a-z][a-z0-9_.\-/]{0,254}$/i;function s_(r){return r.match($T)!=null}ne.isValidName=s_});var o_=l(Ut=>{"use strict";Object.defineProperty(Ut,"__esModule",{value:!0});Ut.HistogramAggregator=Ut.HistogramAccumulation=void 0;var XT=xt(),KT=wt(),Ca=be(),WT=Ee();function zT(r){let e=r.map(()=>0);return e.push(0),{buckets:{boundaries:r,counts:e},sum:0,count:0,hasMinMax:!1,min:1/0,max:-1/0}}var Dt=class{constructor(e,t,n=!0,i=zT(t)){this.startTime=e,this._boundaries=t,this._recordMinMax=n,this._current=i}record(e){this._current.count+=1,this._current.sum+=e,this._recordMinMax&&(this._current.min=Math.min(e,this._current.min),this._current.max=Math.max(e,this._current.max),this._current.hasMinMax=!0);let t=(0,WT.binarySearchLB)(this._boundaries,e);this._current.buckets.counts[t+1]+=1}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ut.HistogramAccumulation=Dt;var wa=class{constructor(e,t){this._boundaries=e,this._recordMinMax=t,this.kind=XT.AggregatorKind.HISTOGRAM}createAccumulation(e){return new Dt(e,this._boundaries,this._recordMinMax)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let _=0;_<s.length;_++)a[_]=s[_]+o[_];let u=1/0,c=-1/0;return this._recordMinMax&&(n.hasMinMax&&i.hasMinMax?(u=Math.min(n.min,i.min),c=Math.max(n.max,i.max)):n.hasMinMax?(u=n.min,c=n.max):i.hasMinMax&&(u=i.min,c=i.max)),new Dt(e.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:n.count+i.count,sum:n.sum+i.sum,hasMinMax:this._recordMinMax&&(n.hasMinMax||i.hasMinMax),min:u,max:c})}diff(e,t){let n=e.toPointValue(),i=t.toPointValue(),s=n.buckets.counts,o=i.buckets.counts,a=new Array(s.length);for(let u=0;u<s.length;u++)a[u]=o[u]-s[u];return new Dt(t.startTime,n.buckets.boundaries,this._recordMinMax,{buckets:{boundaries:n.buckets.boundaries,counts:a},count:i.count-n.count,sum:i.sum-n.sum,hasMinMax:!1,min:1/0,max:-1/0})}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:KT.DataPointType.HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ca.InstrumentType.UP_DOWN_COUNTER||e.type===Ca.InstrumentType.OBSERVABLE_GAUGE||e.type===Ca.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,buckets:a.buckets,count:a.count}}})}}};Ut.HistogramAggregator=wa});var a_=l(wi=>{"use strict";Object.defineProperty(wi,"__esModule",{value:!0});wi.Buckets=void 0;var xa=class r{constructor(e=new Da,t=0,n=0,i=0){this.backing=e,this.indexBase=t,this.indexStart=n,this.indexEnd=i}get offset(){return this.indexStart}get length(){return this.backing.length===0||this.indexEnd===this.indexStart&&this.at(0)===0?0:this.indexEnd-this.indexStart+1}counts(){return Array.from({length:this.length},(e,t)=>this.at(t))}at(e){let t=this.indexBase-this.indexStart;return e<t&&(e+=this.backing.length),e-=t,this.backing.countAt(e)}incrementBucket(e,t){this.backing.increment(e,t)}decrementBucket(e,t){this.backing.decrement(e,t)}trim(){for(let e=0;e<this.length;e++)if(this.at(e)!==0){this.indexStart+=e;break}else if(e===this.length-1){this.indexStart=this.indexEnd=this.indexBase=0;return}for(let e=this.length-1;e>=0;e--)if(this.at(e)!==0){this.indexEnd-=this.length-e-1;break}this._rotate()}downscale(e){this._rotate();let t=1+this.indexEnd-this.indexStart,n=1<<e,i=0,s=0;for(let o=this.indexStart;o<=this.indexEnd;){let a=o%n;a<0&&(a+=n);for(let u=a;u<n&&i<t;u++)this._relocateBucket(s,i),i++,o++;s++}this.indexStart>>=e,this.indexEnd>>=e,this.indexBase=this.indexStart}clone(){return new r(this.backing.clone(),this.indexBase,this.indexStart,this.indexEnd)}_rotate(){let e=this.indexBase-this.indexStart;e!==0&&(e>0?(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,e),this.backing.reverse(e,this.backing.length)):(this.backing.reverse(0,this.backing.length),this.backing.reverse(0,this.backing.length+e)),this.indexBase=this.indexStart)}_relocateBucket(e,t){e!==t&&this.incrementBucket(e,this.backing.emptyBucket(t))}};wi.Buckets=xa;var Da=class r{constructor(e=[0]){this._counts=e}get length(){return this._counts.length}countAt(e){return this._counts[e]}growTo(e,t,n){let i=new Array(e).fill(0);i.splice(n,this._counts.length-t,...this._counts.slice(t)),i.splice(0,t,...this._counts.slice(0,t)),this._counts=i}reverse(e,t){let n=Math.floor((e+t)/2)-e;for(let i=0;i<n;i++){let s=this._counts[e+i];this._counts[e+i]=this._counts[t-i-1],this._counts[t-i-1]=s}}emptyBucket(e){let t=this._counts[e];return this._counts[e]=0,t}increment(e,t){this._counts[e]+=t}decrement(e,t){this._counts[e]>=t?this._counts[e]-=t:this._counts[e]=0}clone(){return new r([...this._counts])}}});var Ba=l(Q=>{"use strict";Object.defineProperty(Q,"__esModule",{value:!0});Q.getSignificand=Q.getNormalBase2=Q.MIN_VALUE=Q.MAX_NORMAL_EXPONENT=Q.MIN_NORMAL_EXPONENT=Q.SIGNIFICAND_WIDTH=void 0;Q.SIGNIFICAND_WIDTH=52;var YT=2146435072,QT=1048575,Ua=1023;Q.MIN_NORMAL_EXPONENT=-Ua+1;Q.MAX_NORMAL_EXPONENT=Ua;Q.MIN_VALUE=Math.pow(2,-1022);function ZT(r){let e=new DataView(new ArrayBuffer(8));return e.setFloat64(0,r),((e.getUint32(0)&YT)>>20)-Ua}Q.getNormalBase2=ZT;function JT(r){let e=new DataView(new ArrayBuffer(8));e.setFloat64(0,r);let t=e.getUint32(0),n=e.getUint32(4);return(t&QT)*Math.pow(2,32)+n}Q.getSignificand=JT});var xi=l(Bt=>{"use strict";Object.defineProperty(Bt,"__esModule",{value:!0});Bt.nextGreaterSquare=Bt.ldexp=void 0;function eS(r,e){return r===0||r===Number.POSITIVE_INFINITY||r===Number.NEGATIVE_INFINITY||Number.isNaN(r)?r:r*Math.pow(2,e)}Bt.ldexp=eS;function tS(r){return r--,r|=r>>1,r|=r>>2,r|=r>>4,r|=r>>8,r|=r>>16,r++,r}Bt.nextGreaterSquare=tS});var Ui=l(Di=>{"use strict";Object.defineProperty(Di,"__esModule",{value:!0});Di.MappingError=void 0;var qa=class extends Error{};Di.MappingError=qa});var c_=l(Bi=>{"use strict";Object.defineProperty(Bi,"__esModule",{value:!0});Bi.ExponentMapping=void 0;var qt=Ba(),rS=xi(),u_=Ui(),Va=class{constructor(e){this._shift=-e}mapToIndex(e){if(e<qt.MIN_VALUE)return this._minNormalLowerBoundaryIndex();let t=qt.getNormalBase2(e),n=this._rightShift(qt.getSignificand(e)-1,qt.SIGNIFICAND_WIDTH);return t+n>>this._shift}lowerBoundary(e){let t=this._minNormalLowerBoundaryIndex();if(e<t)throw new u_.MappingError(`underflow: ${e} is < minimum lower boundary: ${t}`);let n=this._maxNormalLowerBoundaryIndex();if(e>n)throw new u_.MappingError(`overflow: ${e} is > maximum lower boundary: ${n}`);return rS.ldexp(1,e<<this._shift)}get scale(){return this._shift===0?0:-this._shift}_minNormalLowerBoundaryIndex(){let e=qt.MIN_NORMAL_EXPONENT>>this._shift;return this._shift<2&&e--,e}_maxNormalLowerBoundaryIndex(){return qt.MAX_NORMAL_EXPONENT>>this._shift}_rightShift(e,t){return Math.floor(e*Math.pow(2,-t))}};Bi.ExponentMapping=Va});var __=l(qi=>{"use strict";Object.defineProperty(qi,"__esModule",{value:!0});qi.LogarithmMapping=void 0;var Vt=Ba(),l_=xi(),d_=Ui(),Ga=class{constructor(e){this._scale=e,this._scaleFactor=l_.ldexp(Math.LOG2E,e),this._inverseFactor=l_.ldexp(Math.LN2,-e)}mapToIndex(e){if(e<=Vt.MIN_VALUE)return this._minNormalLowerBoundaryIndex()-1;if(Vt.getSignificand(e)===0)return(Vt.getNormalBase2(e)<<this._scale)-1;let t=Math.floor(Math.log(e)*this._scaleFactor),n=this._maxNormalLowerBoundaryIndex();return t>=n?n:t}lowerBoundary(e){let t=this._maxNormalLowerBoundaryIndex();if(e>=t){if(e===t)return 2*Math.exp((e-(1<<this._scale))/this._scaleFactor);throw new d_.MappingError(`overflow: ${e} is > maximum lower boundary: ${t}`)}let n=this._minNormalLowerBoundaryIndex();if(e<=n){if(e===n)return Vt.MIN_VALUE;if(e===n-1)return Math.exp((e+(1<<this._scale))/this._scaleFactor)/2;throw new d_.MappingError(`overflow: ${e} is < minimum lower boundary: ${n}`)}return Math.exp(e*this._inverseFactor)}get scale(){return this._scale}_minNormalLowerBoundaryIndex(){return Vt.MIN_NORMAL_EXPONENT<<this._scale}_maxNormalLowerBoundaryIndex(){return(Vt.MAX_NORMAL_EXPONENT+1<<this._scale)-1}};qi.LogarithmMapping=Ga});var f_=l(Vi=>{"use strict";Object.defineProperty(Vi,"__esModule",{value:!0});Vi.getMapping=void 0;var nS=c_(),iS=__(),sS=Ui(),p_=-10,h_=20,oS=Array.from({length:31},(r,e)=>e>10?new iS.LogarithmMapping(e-10):new nS.ExponentMapping(e-10));function aS(r){if(r>h_||r<p_)throw new sS.MappingError(`expected scale >= ${p_} && <= ${h_}, got: ${r}`);return oS[r+10]}Vi.getMapping=aS});var g_=l(Ht=>{"use strict";Object.defineProperty(Ht,"__esModule",{value:!0});Ht.ExponentialHistogramAggregator=Ht.ExponentialHistogramAccumulation=void 0;var uS=xt(),cS=wt(),lS=(h(),m(d)),Ha=be(),E_=a_(),m_=f_(),dS=xi(),Gt=class r{constructor(e,t){this.low=e,this.high=t}static combine(e,t){return new r(Math.min(e.low,t.low),Math.max(e.high,t.high))}},_S=20,pS=160,ja=2,Gi=class r{constructor(e=e,t=pS,n=!0,i=0,s=0,o=0,a=Number.POSITIVE_INFINITY,u=Number.NEGATIVE_INFINITY,c=new E_.Buckets,_=new E_.Buckets,p=(0,m_.getMapping)(_S)){this.startTime=e,this._maxSize=t,this._recordMinMax=n,this._sum=i,this._count=s,this._zeroCount=o,this._min=a,this._max=u,this._positive=c,this._negative=_,this._mapping=p,this._maxSize<ja&&(lS.diag.warn(`Exponential Histogram Max Size set to ${this._maxSize}, changing to the minimum size of: ${ja}`),this._maxSize=ja)}record(e){this.updateByIncrement(e,1)}setStartTime(e){this.startTime=e}toPointValue(){return{hasMinMax:this._recordMinMax,min:this.min,max:this.max,sum:this.sum,positive:{offset:this.positive.offset,bucketCounts:this.positive.counts()},negative:{offset:this.negative.offset,bucketCounts:this.negative.counts()},count:this.count,scale:this.scale,zeroCount:this.zeroCount}}get sum(){return this._sum}get min(){return this._min}get max(){return this._max}get count(){return this._count}get zeroCount(){return this._zeroCount}get scale(){return this._count===this._zeroCount?0:this._mapping.scale}get positive(){return this._positive}get negative(){return this._negative}updateByIncrement(e,t){if(e>this._max&&(this._max=e),e<this._min&&(this._min=e),this._count+=t,e===0){this._zeroCount+=t;return}this._sum+=e*t,e>0?this._updateBuckets(this._positive,e,t):this._updateBuckets(this._negative,-e,t)}merge(e){this._count===0?(this._min=e.min,this._max=e.max):e.count!==0&&(e.min<this.min&&(this._min=e.min),e.max>this.max&&(this._max=e.max)),this.startTime=e.startTime,this._sum+=e.sum,this._count+=e.count,this._zeroCount+=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._mergeBuckets(this.positive,e,e.positive,t),this._mergeBuckets(this.negative,e,e.negative,t)}diff(e){this._min=1/0,this._max=-1/0,this._sum-=e.sum,this._count-=e.count,this._zeroCount-=e.zeroCount;let t=this._minScale(e);this._downscale(this.scale-t),this._diffBuckets(this.positive,e,e.positive,t),this._diffBuckets(this.negative,e,e.negative,t)}clone(){return new r(this.startTime,this._maxSize,this._recordMinMax,this._sum,this._count,this._zeroCount,this._min,this._max,this.positive.clone(),this.negative.clone(),this._mapping)}_updateBuckets(e,t,n){let i=this._mapping.mapToIndex(t),s=!1,o=0,a=0;if(e.length===0?(e.indexStart=i,e.indexEnd=e.indexStart,e.indexBase=e.indexStart):i<e.indexStart&&e.indexEnd-i>=this._maxSize?(s=!0,a=i,o=e.indexEnd):i>e.indexEnd&&i-e.indexStart>=this._maxSize&&(s=!0,a=e.indexStart,o=i),s){let u=this._changeScale(o,a);this._downscale(u),i=this._mapping.mapToIndex(t)}this._incrementIndexBy(e,i,n)}_incrementIndexBy(e,t,n){if(n===0)return;if(t<e.indexStart){let s=e.indexEnd-t;s>=e.backing.length&&this._grow(e,s+1),e.indexStart=t}else if(t>e.indexEnd){let s=t-e.indexStart;s>=e.backing.length&&this._grow(e,s+1),e.indexEnd=t}let i=t-e.indexBase;i<0&&(i+=e.backing.length),e.incrementBucket(i,n)}_grow(e,t){let n=e.backing.length,i=e.indexBase-e.indexStart,s=n-i,o=(0,dS.nextGreaterSquare)(t);o>this._maxSize&&(o=this._maxSize);let a=o-i;e.backing.growTo(o,s,a)}_changeScale(e,t){let n=0;for(;e-t>=this._maxSize;)e>>=1,t>>=1,n++;return n}_downscale(e){if(e===0)return;if(e<0)throw new Error(`impossible change of scale: ${this.scale}`);let t=this._mapping.scale-e;this._positive.downscale(e),this._negative.downscale(e),this._mapping=(0,m_.getMapping)(t)}_minScale(e){let t=Math.min(this.scale,e.scale),n=Gt.combine(this._highLowAtScale(this.positive,this.scale,t),this._highLowAtScale(e.positive,e.scale,t)),i=Gt.combine(this._highLowAtScale(this.negative,this.scale,t),this._highLowAtScale(e.negative,e.scale,t));return Math.min(t-this._changeScale(n.high,n.low),t-this._changeScale(i.high,i.low))}_highLowAtScale(e,t,n){if(e.length===0)return new Gt(0,-1);let i=t-n;return new Gt(e.indexStart>>i,e.indexEnd>>i)}_mergeBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++)this._incrementIndexBy(e,s+a>>o,n.at(a))}_diffBuckets(e,t,n,i){let s=n.offset,o=t.scale-i;for(let a=0;a<n.length;a++){let c=(s+a>>o)-e.indexBase;c<0&&(c+=e.backing.length),e.decrementBucket(c,n.at(a))}e.trim()}};Ht.ExponentialHistogramAccumulation=Gi;var Fa=class{constructor(e,t){this._maxSize=e,this._recordMinMax=t,this.kind=uS.AggregatorKind.EXPONENTIAL_HISTOGRAM}createAccumulation(e){return new Gi(e,this._maxSize,this._recordMinMax)}merge(e,t){let n=t.clone();return n.merge(e),n}diff(e,t){let n=t.clone();return n.diff(e),n}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:cS.DataPointType.EXPONENTIAL_HISTOGRAM,dataPoints:n.map(([s,o])=>{let a=o.toPointValue(),u=e.type===Ha.InstrumentType.UP_DOWN_COUNTER||e.type===Ha.InstrumentType.OBSERVABLE_GAUGE||e.type===Ha.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER;return{attributes:s,startTime:o.startTime,endTime:i,value:{min:a.hasMinMax?a.min:void 0,max:a.hasMinMax?a.max:void 0,sum:u?void 0:a.sum,positive:{offset:a.positive.offset,bucketCounts:a.positive.bucketCounts},negative:{offset:a.negative.offset,bucketCounts:a.negative.bucketCounts},count:a.count,scale:a.scale,zeroCount:a.zeroCount}}})}}};Ht.ExponentialHistogramAggregator=Fa});var T_=l(Ft=>{"use strict";Object.defineProperty(Ft,"__esModule",{value:!0});Ft.LastValueAggregator=Ft.LastValueAccumulation=void 0;var hS=xt(),Ir=A(),fS=wt(),jt=class{constructor(e,t=0,n=[0,0]){this.startTime=e,this._current=t,this.sampleTime=n}record(e){this._current=e,this.sampleTime=(0,Ir.millisToHrTime)(Date.now())}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};Ft.LastValueAccumulation=jt;var ka=class{constructor(){this.kind=hS.AggregatorKind.LAST_VALUE}createAccumulation(e){return new jt(e)}merge(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(e.startTime,n.toPointValue(),n.sampleTime)}diff(e,t){let n=(0,Ir.hrTimeToMicroseconds)(t.sampleTime)>=(0,Ir.hrTimeToMicroseconds)(e.sampleTime)?t:e;return new jt(t.startTime,n.toPointValue(),n.sampleTime)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:fS.DataPointType.GAUGE,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()}))}}};Ft.LastValueAggregator=ka});var S_=l(kt=>{"use strict";Object.defineProperty(kt,"__esModule",{value:!0});kt.SumAggregator=kt.SumAccumulation=void 0;var ES=xt(),mS=wt(),Ce=class{constructor(e,t,n=0,i=!1){this.startTime=e,this.monotonic=t,this._current=n,this.reset=i}record(e){this.monotonic&&e<0||(this._current+=e)}setStartTime(e){this.startTime=e}toPointValue(){return this._current}};kt.SumAccumulation=Ce;var $a=class{constructor(e){this.monotonic=e,this.kind=ES.AggregatorKind.SUM}createAccumulation(e){return new Ce(e,this.monotonic)}merge(e,t){let n=e.toPointValue(),i=t.toPointValue();return t.reset?new Ce(t.startTime,this.monotonic,i,t.reset):new Ce(e.startTime,this.monotonic,n+i)}diff(e,t){let n=e.toPointValue(),i=t.toPointValue();return this.monotonic&&n>i?new Ce(t.startTime,this.monotonic,i,!0):new Ce(t.startTime,this.monotonic,i-n)}toMetricData(e,t,n,i){return{descriptor:e,aggregationTemporality:t,dataPointType:mS.DataPointType.SUM,dataPoints:n.map(([s,o])=>({attributes:s,startTime:o.startTime,endTime:i,value:o.toPointValue()})),isMonotonic:this.monotonic}}};kt.SumAggregator=$a});var A_=l(ce=>{"use strict";var gS=ce&&ce.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),Mr=ce&&ce.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&gS(e,r,t)};Object.defineProperty(ce,"__esModule",{value:!0});Mr(n_(),ce);Mr(o_(),ce);Mr(g_(),ce);Mr(T_(),ce);Mr(S_(),ce)});var ki=l(q=>{"use strict";Object.defineProperty(q,"__esModule",{value:!0});q.DefaultAggregation=q.ExponentialHistogramAggregation=q.ExplicitBucketHistogramAggregation=q.HistogramAggregation=q.LastValueAggregation=q.SumAggregation=q.DropAggregation=q.Aggregation=void 0;var TS=(h(),m(d)),at=A_(),Pe=be(),me=class{static Drop(){return O_}static Sum(){return R_}static LastValue(){return b_}static Histogram(){return P_}static ExponentialHistogram(){return SS}static Default(){return AS}};q.Aggregation=me;var Lr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.DropAggregation=Lr;Lr.DEFAULT_INSTANCE=new at.DropAggregator;var $t=class r extends me{createAggregator(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.HISTOGRAM:return r.MONOTONIC_INSTANCE;default:return r.NON_MONOTONIC_INSTANCE}}};q.SumAggregation=$t;$t.MONOTONIC_INSTANCE=new at.SumAggregator(!0);$t.NON_MONOTONIC_INSTANCE=new at.SumAggregator(!1);var Nr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.LastValueAggregation=Nr;Nr.DEFAULT_INSTANCE=new at.LastValueAggregator;var Cr=class r extends me{createAggregator(e){return r.DEFAULT_INSTANCE}};q.HistogramAggregation=Cr;Cr.DEFAULT_INSTANCE=new at.HistogramAggregator([0,5,10,25,50,75,100,250,500,750,1e3,2500,5e3,7500,1e4],!0);var Hi=class extends me{constructor(e,t=!0){if(super(),this._recordMinMax=t,e===void 0||e.length===0)throw new Error("HistogramAggregator should be created with boundaries.");e=e.concat(),e=e.sort((s,o)=>s-o);let n=e.lastIndexOf(-1/0),i=e.indexOf(1/0);i===-1&&(i=void 0),this._boundaries=e.slice(n+1,i)}createAggregator(e){return new at.HistogramAggregator(this._boundaries,this._recordMinMax)}};q.ExplicitBucketHistogramAggregation=Hi;var ji=class extends me{constructor(e=160,t=!0){super(),this._maxSize=e,this._recordMinMax=t}createAggregator(e){return new at.ExponentialHistogramAggregator(this._maxSize,this._recordMinMax)}};q.ExponentialHistogramAggregation=ji;var Fi=class extends me{_resolve(e){switch(e.type){case Pe.InstrumentType.COUNTER:case Pe.InstrumentType.UP_DOWN_COUNTER:case Pe.InstrumentType.OBSERVABLE_COUNTER:case Pe.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER:return R_;case Pe.InstrumentType.OBSERVABLE_GAUGE:return b_;case Pe.InstrumentType.HISTOGRAM:return e.advice.explicitBucketBoundaries?new Hi(e.advice.explicitBucketBoundaries):P_}return TS.diag.warn(`Unable to recognize instrument type: ${e.type}`),O_}createAggregator(e){return this._resolve(e).createAggregator(e)}};q.DefaultAggregation=Fi;var O_=new Lr,R_=new $t,b_=new Nr,P_=new Cr,SS=new ji,AS=new Fi});var Xa=l(Xt=>{"use strict";Object.defineProperty(Xt,"__esModule",{value:!0});Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=Xt.DEFAULT_AGGREGATION_SELECTOR=void 0;var OS=ki(),RS=Li(),bS=r=>OS.Aggregation.Default();Xt.DEFAULT_AGGREGATION_SELECTOR=bS;var PS=r=>RS.AggregationTemporality.CUMULATIVE;Xt.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR=PS});var Wa=l(Xi=>{"use strict";Object.defineProperty(Xi,"__esModule",{value:!0});Xi.MetricReader=void 0;var y_=(h(),m(d)),$i=Ee(),v_=Xa(),Ka=class{constructor(e){var t,n,i;this._shutdown=!1,this._aggregationSelector=(t=e?.aggregationSelector)!==null&&t!==void 0?t:v_.DEFAULT_AGGREGATION_SELECTOR,this._aggregationTemporalitySelector=(n=e?.aggregationTemporalitySelector)!==null&&n!==void 0?n:v_.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR,this._metricProducers=(i=e?.metricProducers)!==null&&i!==void 0?i:[]}setMetricProducer(e){if(this._sdkMetricProducer)throw new Error("MetricReader can not be bound to a MeterProvider again.");this._sdkMetricProducer=e,this.onInitialized()}selectAggregation(e){return this._aggregationSelector(e)}selectAggregationTemporality(e){return this._aggregationTemporalitySelector(e)}onInitialized(){}async collect(e){if(this._sdkMetricProducer===void 0)throw new Error("MetricReader is not bound to a MetricProducer");if(this._shutdown)throw new Error("MetricReader is shutdown");let[t,...n]=await Promise.all([this._sdkMetricProducer.collect({timeoutMillis:e?.timeoutMillis}),...this._metricProducers.map(a=>a.collect({timeoutMillis:e?.timeoutMillis}))]),i=t.errors.concat((0,$i.FlatMap)(n,a=>a.errors)),s=t.resourceMetrics.resource,o=t.resourceMetrics.scopeMetrics.concat((0,$i.FlatMap)(n,a=>a.resourceMetrics.scopeMetrics));return{resourceMetrics:{resource:s,scopeMetrics:o},errors:i}}async shutdown(e){if(this._shutdown){y_.diag.error("Cannot call shutdown twice.");return}e?.timeoutMillis==null?await this.onShutdown():await(0,$i.callWithTimeout)(this.onShutdown(),e.timeoutMillis),this._shutdown=!0}async forceFlush(e){if(this._shutdown){y_.diag.warn("Cannot forceFlush on already shutdown MetricReader.");return}if(e?.timeoutMillis==null){await this.onForceFlush();return}await(0,$i.callWithTimeout)(this.onForceFlush(),e.timeoutMillis)}};Xi.MetricReader=Ka});var L_=l(Wi=>{"use strict";Object.defineProperty(Wi,"__esModule",{value:!0});Wi.PeriodicExportingMetricReader=void 0;var I_=(h(),m(d)),Ki=A(),yS=Wa(),M_=Ee(),vS=(h(),m(d)),za=class extends yS.MetricReader{constructor(e){var t,n,i,s;if(super({aggregationSelector:(t=e.exporter.selectAggregation)===null||t===void 0?void 0:t.bind(e.exporter),aggregationTemporalitySelector:(n=e.exporter.selectAggregationTemporality)===null||n===void 0?void 0:n.bind(e.exporter),metricProducers:e.metricProducers}),e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<=0)throw Error("exportIntervalMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportTimeoutMillis<=0)throw Error("exportTimeoutMillis must be greater than 0");if(e.exportTimeoutMillis!==void 0&&e.exportIntervalMillis!==void 0&&e.exportIntervalMillis<e.exportTimeoutMillis)throw Error("exportIntervalMillis must be greater than or equal to exportTimeoutMillis");this._exportInterval=(i=e.exportIntervalMillis)!==null&&i!==void 0?i:6e4,this._exportTimeout=(s=e.exportTimeoutMillis)!==null&&s!==void 0?s:3e4,this._exporter=e.exporter}async _runOnce(){try{await(0,M_.callWithTimeout)(this._doRun(),this._exportTimeout)}catch(e){if(e instanceof M_.TimeoutError){I_.diag.error("Export took longer than %s milliseconds and timed out.",this._exportTimeout);return}(0,Ki.globalErrorHandler)(e)}}async _doRun(){var e,t;let{resourceMetrics:n,errors:i}=await this.collect({timeoutMillis:this._exportTimeout});i.length>0&&I_.diag.error("PeriodicExportingMetricReader: metrics collection errors",...i);let s=async()=>{let o=await Ki.internal._export(this._exporter,n);if(o.code!==Ki.ExportResultCode.SUCCESS)throw new Error(`PeriodicExportingMetricReader: metrics export failed (error ${o.error})`)};n.resource.asyncAttributesPending?(t=(e=n.resource).waitForAsyncAttributes)===null||t===void 0||t.call(e).then(s,o=>vS.diag.debug("Error while resolving async portion of resource: ",o)):await s()}onInitialized(){this._interval=setInterval(()=>{this._runOnce()},this._exportInterval),(0,Ki.unrefTimer)(this._interval)}async onForceFlush(){await this._runOnce(),await this._exporter.forceFlush()}async onShutdown(){this._interval&&clearInterval(this._interval),await this._exporter.shutdown()}};Wi.PeriodicExportingMetricReader=za});var C_=l(zi=>{"use strict";Object.defineProperty(zi,"__esModule",{value:!0});zi.InMemoryMetricExporter=void 0;var N_=A(),Ya=class{constructor(e){this._shutdown=!1,this._metrics=[],this._aggregationTemporality=e}export(e,t){if(this._shutdown){setTimeout(()=>t({code:N_.ExportResultCode.FAILED}),0);return}this._metrics.push(e),setTimeout(()=>t({code:N_.ExportResultCode.SUCCESS}),0)}getMetrics(){return this._metrics}forceFlush(){return Promise.resolve()}reset(){this._metrics=[]}selectAggregationTemporality(e){return this._aggregationTemporality}shutdown(){return this._shutdown=!0,Promise.resolve()}};zi.InMemoryMetricExporter=Ya});var x_=l(Yi=>{"use strict";Object.defineProperty(Yi,"__esModule",{value:!0});Yi.ConsoleMetricExporter=void 0;var w_=A(),IS=Xa(),Qa=class r{constructor(e){var t;this._shutdown=!1,this._temporalitySelector=(t=e?.temporalitySelector)!==null&&t!==void 0?t:IS.DEFAULT_AGGREGATION_TEMPORALITY_SELECTOR}export(e,t){if(this._shutdown){setImmediate(t,{code:w_.ExportResultCode.FAILED});return}return r._sendMetrics(e,t)}forceFlush(){return Promise.resolve()}selectAggregationTemporality(e){return this._temporalitySelector(e)}shutdown(){return this._shutdown=!0,Promise.resolve()}static _sendMetrics(e,t){for(let n of e.scopeMetrics)for(let i of n.metrics)console.dir({descriptor:i.descriptor,dataPointType:i.dataPointType,dataPoints:i.dataPoints});t({code:w_.ExportResultCode.SUCCESS})}};Yi.ConsoleMetricExporter=Qa});var D_=l(Qi=>{"use strict";Object.defineProperty(Qi,"__esModule",{value:!0});Qi.ViewRegistry=void 0;var Za=class{constructor(){this._registeredViews=[]}addView(e){this._registeredViews.push(e)}findViews(e,t){return this._registeredViews.filter(i=>this._matchInstrument(i.instrumentSelector,e)&&this._matchMeter(i.meterSelector,t))}_matchInstrument(e,t){return(e.getType()===void 0||t.type===e.getType())&&e.getNameFilter().match(t.name)&&e.getUnitFilter().match(t.unit)}_matchMeter(e,t){return e.getNameFilter().match(t.name)&&(t.version===void 0||e.getVersionFilter().match(t.version))&&(t.schemaUrl===void 0||e.getSchemaUrlFilter().match(t.schemaUrl))}};Qi.ViewRegistry=Za});var Zi=l(D=>{"use strict";Object.defineProperty(D,"__esModule",{value:!0});D.isObservableInstrument=D.ObservableUpDownCounterInstrument=D.ObservableGaugeInstrument=D.ObservableCounterInstrument=D.ObservableInstrument=D.HistogramInstrument=D.CounterInstrument=D.UpDownCounterInstrument=D.SyncInstrument=void 0;var Kt=(h(),m(d)),MS=A(),Wt=class{constructor(e,t){this._writableMetricStorage=e,this._descriptor=t}_record(e,t={},n=Kt.context.active()){if(typeof e!="number"){Kt.diag.warn(`non-number value provided to metric ${this._descriptor.name}: ${e}`);return}this._descriptor.valueType===Kt.ValueType.INT&&!Number.isInteger(e)&&(Kt.diag.warn(`INT value type cannot accept a floating-point value for ${this._descriptor.name}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._writableMetricStorage.record(e,t,n,(0,MS.millisToHrTime)(Date.now()))}};D.SyncInstrument=Wt;var Ja=class extends Wt{add(e,t,n){this._record(e,t,n)}};D.UpDownCounterInstrument=Ja;var eu=class extends Wt{add(e,t,n){if(e<0){Kt.diag.warn(`negative value provided to counter ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.CounterInstrument=eu;var tu=class extends Wt{record(e,t,n){if(e<0){Kt.diag.warn(`negative value provided to histogram ${this._descriptor.name}: ${e}`);return}this._record(e,t,n)}};D.HistogramInstrument=tu;var ut=class{constructor(e,t,n){this._observableRegistry=n,this._descriptor=e,this._metricStorages=t}addCallback(e){this._observableRegistry.addCallback(e,this)}removeCallback(e){this._observableRegistry.removeCallback(e,this)}};D.ObservableInstrument=ut;var ru=class extends ut{};D.ObservableCounterInstrument=ru;var nu=class extends ut{};D.ObservableGaugeInstrument=nu;var iu=class extends ut{};D.ObservableUpDownCounterInstrument=iu;function LS(r){return r instanceof ut}D.isObservableInstrument=LS});var U_=l(Ji=>{"use strict";Object.defineProperty(Ji,"__esModule",{value:!0});Ji.Meter=void 0;var ie=be(),zt=Zi(),su=class{constructor(e){this._meterSharedState=e}createHistogram(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.HISTOGRAM,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.HistogramInstrument(i,n)}createCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.CounterInstrument(i,n)}createUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.UP_DOWN_COUNTER,t),i=this._meterSharedState.registerMetricStorage(n);return new zt.UpDownCounterInstrument(i,n)}createObservableGauge(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_GAUGE,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableGaugeInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableCounterInstrument(n,i,this._meterSharedState.observableRegistry)}createObservableUpDownCounter(e,t){let n=(0,ie.createInstrumentDescriptor)(e,ie.InstrumentType.OBSERVABLE_UP_DOWN_COUNTER,t),i=this._meterSharedState.registerAsyncMetricStorage(n);return new zt.ObservableUpDownCounterInstrument(n,i,this._meterSharedState.observableRegistry)}addBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.addBatchCallback(e,t)}removeBatchObservableCallback(e,t){this._meterSharedState.observableRegistry.removeBatchCallback(e,t)}};Ji.Meter=su});var au=l(es=>{"use strict";Object.defineProperty(es,"__esModule",{value:!0});es.MetricStorage=void 0;var NS=be(),ou=class{constructor(e){this._instrumentDescriptor=e}getInstrumentDescriptor(){return this._instrumentDescriptor}updateDescription(e){this._instrumentDescriptor=(0,NS.createInstrumentDescriptor)(this._instrumentDescriptor.name,this._instrumentDescriptor.type,{description:e,valueType:this._instrumentDescriptor.valueType,unit:this._instrumentDescriptor.unit,advice:this._instrumentDescriptor.advice})}};es.MetricStorage=ou});var wr=l(Yt=>{"use strict";Object.defineProperty(Yt,"__esModule",{value:!0});Yt.AttributeHashMap=Yt.HashMap=void 0;var CS=Ee(),ts=class{constructor(e){this._hash=e,this._valueMap=new Map,this._keyMap=new Map}get(e,t){return t??(t=this._hash(e)),this._valueMap.get(t)}getOrDefault(e,t){let n=this._hash(e);if(this._valueMap.has(n))return this._valueMap.get(n);let i=t();return this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,i),i}set(e,t,n){n??(n=this._hash(e)),this._keyMap.has(n)||this._keyMap.set(n,e),this._valueMap.set(n,t)}has(e,t){return t??(t=this._hash(e)),this._valueMap.has(t)}*keys(){let e=this._keyMap.entries(),t=e.next();for(;t.done!==!0;)yield[t.value[1],t.value[0]],t=e.next()}*entries(){let e=this._valueMap.entries(),t=e.next();for(;t.done!==!0;)yield[this._keyMap.get(t.value[0]),t.value[1],t.value[0]],t=e.next()}get size(){return this._valueMap.size}};Yt.HashMap=ts;var uu=class extends ts{constructor(){super(CS.hashAttributes)}};Yt.AttributeHashMap=uu});var du=l(rs=>{"use strict";Object.defineProperty(rs,"__esModule",{value:!0});rs.DeltaMetricProcessor=void 0;var cu=wr(),lu=class{constructor(e){this._aggregator=e,this._activeCollectionStorage=new cu.AttributeHashMap,this._cumulativeMemoStorage=new cu.AttributeHashMap}record(e,t,n,i){let s=this._activeCollectionStorage.getOrDefault(t,()=>this._aggregator.createAccumulation(i));s?.record(e)}batchCumulate(e,t){Array.from(e.entries()).forEach(([n,i,s])=>{let o=this._aggregator.createAccumulation(t);o?.record(i);let a=o;if(this._cumulativeMemoStorage.has(n,s)){let u=this._cumulativeMemoStorage.get(n,s);a=this._aggregator.diff(u,o)}if(this._activeCollectionStorage.has(n,s)){let u=this._activeCollectionStorage.get(n,s);a=this._aggregator.merge(u,a)}this._cumulativeMemoStorage.set(n,o,s),this._activeCollectionStorage.set(n,a,s)})}collect(){let e=this._activeCollectionStorage;return this._activeCollectionStorage=new cu.AttributeHashMap,e}};rs.DeltaMetricProcessor=lu});var pu=l(ns=>{"use strict";Object.defineProperty(ns,"__esModule",{value:!0});ns.TemporalMetricProcessor=void 0;var wS=Li(),xS=wr(),_u=class r{constructor(e,t){this._aggregator=e,this._unreportedAccumulations=new Map,this._reportHistory=new Map,t.forEach(n=>{this._unreportedAccumulations.set(n,[])})}buildMetrics(e,t,n,i){this._stashAccumulations(n);let s=this._getMergedUnreportedAccumulations(e),o=s,a;if(this._reportHistory.has(e)){let c=this._reportHistory.get(e),_=c.collectionTime;a=c.aggregationTemporality,a===wS.AggregationTemporality.CUMULATIVE?o=r.merge(c.accumulations,s,this._aggregator):o=r.calibrateStartTime(c.accumulations,s,_)}else a=e.selectAggregationTemporality(t.type);this._reportHistory.set(e,{accumulations:o,collectionTime:i,aggregationTemporality:a});let u=DS(o);if(u.length!==0)return this._aggregator.toMetricData(t,a,u,i)}_stashAccumulations(e){let t=this._unreportedAccumulations.keys();for(let n of t){let i=this._unreportedAccumulations.get(n);i===void 0&&(i=[],this._unreportedAccumulations.set(n,i)),i.push(e)}}_getMergedUnreportedAccumulations(e){let t=new xS.AttributeHashMap,n=this._unreportedAccumulations.get(e);if(this._unreportedAccumulations.set(e,[]),n===void 0)return t;for(let i of n)t=r.merge(t,i,this._aggregator);return t}static merge(e,t,n){let i=e,s=t.entries(),o=s.next();for(;o.done!==!0;){let[a,u,c]=o.value;if(e.has(a,c)){let _=e.get(a,c),p=n.merge(_,u);i.set(a,p,c)}else i.set(a,u,c);o=s.next()}return i}static calibrateStartTime(e,t,n){for(let[i,s]of e.keys()){let o=t.get(i,s);o?.setStartTime(n)}return t}};ns.TemporalMetricProcessor=_u;function DS(r){return Array.from(r.entries())}});var B_=l(is=>{"use strict";Object.defineProperty(is,"__esModule",{value:!0});is.AsyncMetricStorage=void 0;var US=au(),BS=du(),qS=pu(),VS=wr(),hu=class extends US.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new BS.DeltaMetricProcessor(t),this._temporalMetricStorage=new qS.TemporalMetricProcessor(t,i)}record(e,t){let n=new VS.AttributeHashMap;Array.from(e.entries()).forEach(([i,s])=>{n.set(this._attributesProcessor.process(i),s)}),this._deltaMetricStorage.batchCumulate(n,t)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};is.AsyncMetricStorage=hu});var j_=l(Z=>{"use strict";Object.defineProperty(Z,"__esModule",{value:!0});Z.getConflictResolutionRecipe=Z.getDescriptionResolutionRecipe=Z.getTypeConflictResolutionRecipe=Z.getUnitConflictResolutionRecipe=Z.getValueTypeConflictResolutionRecipe=Z.getIncompatibilityDetails=void 0;function GS(r,e){let t="";return r.unit!==e.unit&&(t+=` - Unit '${r.unit}' does not match '${e.unit}'
|
|
9
9
|
`),r.type!==e.type&&(t+=` - Type '${r.type}' does not match '${e.type}'
|
|
10
10
|
`),r.valueType!==e.valueType&&(t+=` - Value Type '${r.valueType}' does not match '${e.valueType}'
|
|
11
11
|
`),r.description!==e.description&&(t+=` - Description '${r.description}' does not match '${e.description}'
|
|
12
|
-
`),t}Z.getIncompatibilityDetails=
|
|
12
|
+
`),t}Z.getIncompatibilityDetails=GS;function q_(r,e){return` - use valueType '${r.valueType}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getValueTypeConflictResolutionRecipe=q_;function V_(r,e){return` - use unit '${r.unit}' on instrument creation or use an instrument name other than '${e.name}'`}Z.getUnitConflictResolutionRecipe=V_;function G_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'`}Z.getTypeConflictResolutionRecipe=G_;function H_(r,e){let t={name:e.name,type:e.type,unit:e.unit},n=JSON.stringify(t);return` - create a new view with a name other than '${r.name}' and InstrumentSelector '${n}'
|
|
13
13
|
- OR - create a new view with the name ${r.name} and description '${r.description}' and InstrumentSelector ${n}
|
|
14
|
-
- OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Z.getDescriptionResolutionRecipe=H_;function
|
|
14
|
+
- OR - create a new view with the name ${e.name} and description '${r.description}' and InstrumentSelector ${n}`}Z.getDescriptionResolutionRecipe=H_;function HS(r,e){return r.valueType!==e.valueType?q_(r,e):r.unit!==e.unit?V_(r,e):r.type!==e.type?G_(r,e):r.description!==e.description?H_(r,e):""}Z.getConflictResolutionRecipe=HS});var k_=l(os=>{"use strict";Object.defineProperty(os,"__esModule",{value:!0});os.MetricStorageRegistry=void 0;var jS=be(),F_=(h(),m(d)),ss=j_(),fu=class r{constructor(){this._sharedRegistry=new Map,this._perCollectorRegistry=new Map}static create(){return new r}getStorages(e){let t=[];for(let i of this._sharedRegistry.values())t=t.concat(i);let n=this._perCollectorRegistry.get(e);if(n!=null)for(let i of n.values())t=t.concat(i);return t}register(e){this._registerStorage(e,this._sharedRegistry)}registerForCollector(e,t){let n=this._perCollectorRegistry.get(e);n==null&&(n=new Map,this._perCollectorRegistry.set(e,n)),this._registerStorage(t,n)}findOrUpdateCompatibleStorage(e){let t=this._sharedRegistry.get(e.name);return t===void 0?null:this._findOrUpdateCompatibleStorage(e,t)}findOrUpdateCompatibleCollectorStorage(e,t){let n=this._perCollectorRegistry.get(e);if(n===void 0)return null;let i=n.get(t.name);return i===void 0?null:this._findOrUpdateCompatibleStorage(t,i)}_registerStorage(e,t){let n=e.getInstrumentDescriptor(),i=t.get(n.name);if(i===void 0){t.set(n.name,[e]);return}i.push(e)}_findOrUpdateCompatibleStorage(e,t){let n=null;for(let i of t){let s=i.getInstrumentDescriptor();(0,jS.isDescriptorCompatibleWith)(s,e)?(s.description!==e.description&&(e.description.length>s.description.length&&i.updateDescription(e.description),F_.diag.warn("A view or instrument with the name ",e.name,` has already been registered, but has a different description and is incompatible with another registered view.
|
|
15
15
|
`,`Details:
|
|
16
16
|
`,(0,ss.getIncompatibilityDetails)(s,e),`The longer description will be used.
|
|
17
17
|
To resolve the conflict:`,(0,ss.getConflictResolutionRecipe)(s,e))),n=i):F_.diag.warn("A view or instrument with the name ",e.name,` has already been registered and is incompatible with another registered view.
|
|
18
18
|
`,`Details:
|
|
19
19
|
`,(0,ss.getIncompatibilityDetails)(s,e),`To resolve the conflict:
|
|
20
|
-
`,(0,ss.getConflictResolutionRecipe)(s,e))}return n}};os.MetricStorageRegistry=fu});var $_=l(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MultiMetricStorage=void 0;var Eu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};as.MultiMetricStorage=Eu});var W_=l(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.BatchObservableResultImpl=Zt.ObservableResultImpl=void 0;var Qt=(h(),m(d)),X_=wr(),jS=Zi(),mu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new X_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Qt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Qt.ValueType.INT&&!Number.isInteger(e)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}};Zt.ObservableResultImpl=mu;var gu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,jS.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new X_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Qt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Qt.ValueType.INT&&!Number.isInteger(t)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};Zt.BatchObservableResultImpl=gu});var Y_=l(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.ObservableRegistry=void 0;var FS=(h(),m(d)),K_=Zi(),z_=W_(),xr=Ee(),Tu=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(K_.isObservableInstrument));if(n.size===0){FS.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(K_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,xr.PromiseAllSettled)([...n,...i])).filter(xr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new z_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new z_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(c=>{c.record(u,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,xr.setEquals)(n.instruments,t))}};us.ObservableRegistry=Tu});var Q_=l(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.SyncMetricStorage=void 0;var kS=au(),$S=du(),XS=pu(),Su=class extends kS.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new $S.DeltaMetricProcessor(t),this._temporalMetricStorage=new XS.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};cs.SyncMetricStorage=Su});var Ou=l(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.FilteringAttributesProcessor=we.NoopAttributesProcessor=we.AttributesProcessor=void 0;var Dr=class{static Noop(){return WS}};we.AttributesProcessor=Dr;var ls=class extends Dr{process(e,t){return e}};we.NoopAttributesProcessor=ls;var Au=class extends Dr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};we.FilteringAttributesProcessor=Au;var WS=new ls});var Z_=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.MeterSharedState=void 0;var KS=be(),zS=U_(),YS=Ee(),QS=B_(),ZS=k_(),JS=$_(),eA=Y_(),tA=Q_(),rA=Ou(),Ru=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new ZS.MetricStorageRegistry,this.observableRegistry=new eA.ObservableRegistry,this.meter=new zS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,tA.SyncMetricStorage);return t.length===1?t[0]:new JS.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,QS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(YS.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,KS.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),c=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(c),c});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(c!=null)return c;let _=u.createAggregator(e),p=new t(e,_,rA.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,p),p});i=i.concat(o)}return i}};ds.MeterSharedState=Ru});var J_=l(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MeterProviderSharedState=void 0;var nA=Ee(),iA=D_(),sA=Z_(),bu=class{constructor(e){this.resource=e,this.viewRegistry=new iA.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,nA.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new sA.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};_s.MeterProviderSharedState=bu});var ep=l(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.MetricCollector=void 0;var oA=A(),Pu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,oA.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ps.MetricCollector=Pu});var rp=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MeterProvider=void 0;var hs=(h(),m(d)),tp=rt(),aA=J_(),uA=ep(),yu=class{constructor(e){var t;this._shutdown=!1;let n=tp.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:tp.Resource.empty());if(this._sharedState=new aA.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(hs.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,hs.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new uA.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){hs.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){hs.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};fs.MeterProvider=yu});var Es=l(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ExactPredicate=Jt.PatternPredicate=void 0;var cA=/[\^$\\.+?()[\]{}|]/g,vu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(cA,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Jt.PatternPredicate=vu;var Iu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Jt.ExactPredicate=Iu});var ip=l(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.InstrumentSelector=void 0;var np=Es(),Mu=class{constructor(e){var t;this._nameFilter=new np.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new np.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};ms.InstrumentSelector=Mu});var sp=l(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.MeterSelector=void 0;var Lu=Es(),Nu=class{constructor(e){this._nameFilter=new Lu.ExactPredicate(e?.name),this._versionFilter=new Lu.ExactPredicate(e?.version),this._schemaUrlFilter=new Lu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};gs.MeterSelector=Nu});var ap=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.View=void 0;var lA=Es(),op=Ou(),dA=ip(),_A=sp(),pA=ki();function hA(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Cu=class{constructor(e){var t;if(hA(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||lA.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new op.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=op.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:pA.Aggregation.Default(),this.instrumentSelector=new dA.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new _A.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};Ts.View=Cu});var wu=l(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var fA=Li();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return fA.AggregationTemporality}});var EA=wt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return EA.DataPointType}});var mA=Ka();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return mA.MetricReader}});var gA=L_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return gA.PeriodicExportingMetricReader}});var TA=C_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return TA.InMemoryMetricExporter}});var SA=x_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return SA.ConsoleMetricExporter}});var AA=be();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return AA.InstrumentType}});var OA=rp();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return OA.MeterProvider}});var xe=ki();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return xe.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return xe.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return xe.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return xe.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return xe.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return xe.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return xe.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return xe.Aggregation}});var RA=ap();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return RA.View}});var bA=Ee();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return bA.TimeoutError}})});var up=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.AbstractAsyncHooksContextManager=void 0;var PA=z("events"),yA=["addListener","on","once","prependListener","prependOnceListener"],xu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof PA.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),yA.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let c=i.bind(n,o);u.set(o,c),i._wrapped=!0;try{return t.call(this,s,c)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Ss.AbstractAsyncHooksContextManager=xu});var cp=l(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.AsyncLocalStorageContextManager=void 0;var vA=(h(),m(d)),IA=z("async_hooks"),MA=up(),Du=class extends MA.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new IA.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:vA.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};As.AsyncLocalStorageContextManager=Du});var Ur=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.toAnyValue=De.toKeyValue=De.toAttributes=void 0;function DA(r){return Object.keys(r).map(e=>Vu(e,r[e]))}De.toAttributes=DA;function Vu(r,e){return{key:r,value:Gu(e)}}De.toKeyValue=Vu;function Gu(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Gu)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Vu(t,n))}}:{}}De.toAnyValue=Gu});var wp=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var Hu=Ur();function UA(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,Hu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Cp(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Np(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=UA;function Np(r,e){var t;return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Np;function Cp(r,e){return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Cp});var Br=l(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var bs=A(),BA=BigInt(1e9);function ju(r){return BigInt(r[0])*BA+BigInt(r[1])}oe.hrTimeToNanos=ju;function Dp(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=Dp;function Fu(r){let e=ju(r);return Dp(e)}oe.encodeAsLongBits=Fu;function Up(r){return ju(r).toString()}oe.encodeAsString=Up;var qA=typeof BigInt<"u"?Up:bs.hrTimeToNanoseconds;function xp(r){return r}function Bp(r){if(r!==void 0)return(0,bs.hexToBase64)(r)}var VA={encodeHrTime:Fu,encodeSpanContext:bs.hexToBase64,encodeOptionalSpanContext:Bp};function GA(r){var e,t;if(r===void 0)return VA;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?Fu:qA,encodeSpanContext:i?xp:bs.hexToBase64,encodeOptionalSpanContext:i?xp:Bp}}oe.getOtlpEncoder=GA});var ys=l(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.createExportTraceServiceRequest=void 0;var HA=Ur(),jA=wp(),FA=Br();function kA(r,e){let t=(0,FA.getOtlpEncoder)(e);return{resourceSpans:XA(r,t)}}Ps.createExportTraceServiceRequest=kA;function $A(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function XA(r,e){let t=$A(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],c=a.values(),_=c.next();for(;!_.done;){let f=_.value;if(f.length>0){let{name:M,version:R,schemaUrl:w}=f[0].instrumentationLibrary,U=f.map(S=>(0,jA.sdkSpanToOtlpSpan)(S,e));u.push({scope:{name:M,version:R},spans:U,schemaUrl:w})}_=c.next()}let p={resource:{attributes:(0,HA.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(p),s=i.next()}return n}});var Gp=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.parseRetryAfterToMills=N.isExportRetryable=N.invalidTimeout=N.configureExporterTimeout=N.appendRootPathToUrlIfNeeded=N.appendResourcePathToUrl=N.parseHeaders=N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=N.DEFAULT_EXPORT_MAX_BACKOFF=N.DEFAULT_EXPORT_INITIAL_BACKOFF=N.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var ku=(h(),m(d)),qp=A(),Vp=1e4;N.DEFAULT_EXPORT_MAX_ATTEMPTS=5;N.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;N.DEFAULT_EXPORT_MAX_BACKOFF=5e3;N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function WA(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):ku.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}N.parseHeaders=WA;function KA(r,e){return r.endsWith("/")||(r=r+"/"),r+e}N.appendResourcePathToUrl=KA;function zA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return ku.diag.warn(`Could not parse export URL: '${r}'`),r}}N.appendRootPathToUrlIfNeeded=zA;function YA(r){return typeof r=="number"?r<=0?$u(r,Vp):r:QA()}N.configureExporterTimeout=YA;function QA(){var r;let e=Number((r=(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?$u(e,Vp):e}function $u(r,e){return ku.diag.warn("Timeout must be greater than 0",r),e}N.invalidTimeout=$u;function ZA(r){return[429,502,503,504].includes(r)}N.isExportRetryable=ZA;function JA(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}N.parseRetryAfterToMills=JA});var jp=l(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.OTLPExporterBase=void 0;var Hp=(h(),m(d)),qr=A(),eO=Gp(),Xu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new qr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,eO.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:qr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:qr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:qr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:qr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{Hp.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return Hp.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};vs.OTLPExporterBase=Xu});var Xp=l((ky,$p)=>{"use strict";$p.exports=nO;function nO(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f++]=arguments[f];a.apply(null,p)}};try{r.apply(e||null,t)}catch(c){s&&(s=!1,u(c))}})}});var Yp=l(zp=>{"use strict";var Ms=zp;Ms.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var nr=new Array(64),Kp=new Array(123);for(le=0;le<64;)Kp[nr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ms.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var c=e[t++];switch(a){case 0:s[o++]=nr[c>>2],u=(c&3)<<4,a=1;break;case 1:s[o++]=nr[u|c>>4],u=(c&15)<<2,a=2;break;case 2:s[o++]=nr[u|c>>6],s[o++]=nr[c&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=nr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var Wp="invalid encoding";Ms.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=Kp[u])===void 0)throw Error(Wp);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(Wp);return n-i};Ms.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Zp=l((Xy,Qp)=>{"use strict";Qp.exports=Ls;function Ls(){this._listeners={}}Ls.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Ls.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Ls.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var sh=l((Wy,ih)=>{"use strict";ih.exports=Jp(Jp);function Jp(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3]}function s(u,c,_){e[0]=u,c[_]=t[3],c[_+1]=t[2],c[_+2]=t[1],c[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],e[0]}function a(u,c){return t[3]=u[c],t[2]=u[c+1],t[1]=u[c+2],t[0]=u[c+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|c)>>>0,s,o)}}r.writeFloatLE=e.bind(null,eh),r.writeFloatBE=e.bind(null,th);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,c=o&8388607;return u===255?c?NaN:a*(1/0):u===0?a*1401298464324817e-60*c:a*Math.pow(2,u-150)*(c+8388608)}r.readFloatLE=t.bind(null,rh),r.readFloatBE=t.bind(null,nh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3],c[_+4]=t[4],c[_+5]=t[5],c[_+6]=t[6],c[_+7]=t[7]}function s(u,c,_){e[0]=u,c[_]=t[7],c[_+1]=t[6],c[_+2]=t[5],c[_+3]=t[4],c[_+4]=t[3],c[_+5]=t[2],c[_+6]=t[1],c[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],t[4]=u[c+4],t[5]=u[c+5],t[6]=u[c+6],t[7]=u[c+7],e[0]}function a(u,c){return t[7]=u[c],t[6]=u[c+1],t[5]=u[c+2],t[4]=u[c+3],t[3]=u[c+4],t[2]=u[c+5],t[1]=u[c+6],t[0]=u[c+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var c=o<0?1:0;if(c&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((c<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((c<<31|_/4294967296)>>>0,a,u+s);else{var p=Math.floor(Math.log(o)/Math.LN2);p===1024&&(p=1023),_=o*Math.pow(2,-p),n(_*4503599627370496>>>0,a,u+i),n((c<<31|p+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,eh,0,4),r.writeDoubleBE=e.bind(null,th,4,0);function t(n,i,s,o,a){var u=n(o,a+i),c=n(o,a+s),_=(c>>31)*2+1,p=c>>>20&2047,f=4294967296*(c&1048575)+u;return p===2047?f?NaN:_*(1/0):p===0?_*5e-324*f:_*Math.pow(2,p-1075)*(f+4503599627370496)}r.readDoubleLE=t.bind(null,rh,0,4),r.readDoubleBE=t.bind(null,nh,4,0)}(),r}function eh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function th(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function rh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function nh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var oh=l((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var uh=l(ah=>{"use strict";var Ku=ah;Ku.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Ku.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};Ku.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var lh=l((zy,ch)=>{"use strict";ch.exports=iO;function iO(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var c=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),c}}});var _h=l((Yy,dh)=>{"use strict";dh.exports=V;var Vr=qe();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ct=V.zero=new V(0,0);ct.toNumber=function(){return 0};ct.zzEncode=ct.zzDecode=function(){return this};ct.length=function(){return 1};var sO=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ct;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Vr.isString(e))if(Vr.Long)e=Vr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ct};V.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};V.prototype.toLong=function(e){return Vr.Long?new Vr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Be=String.prototype.charCodeAt;V.fromHash=function(e){return e===sO?ct:new V((Be.call(e,0)|Be.call(e,1)<<8|Be.call(e,2)<<16|Be.call(e,3)<<24)>>>0,(Be.call(e,4)|Be.call(e,5)<<8|Be.call(e,6)<<16|Be.call(e,7)<<24)>>>0)};V.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};V.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};V.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};V.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var qe=l(zu=>{"use strict";var E=zu;E.asPromise=Xp();E.base64=Yp();E.EventEmitter=Zp();E.float=sh();E.inquire=oh();E.utf8=uh();E.pool=lh();E.LongBits=_h();E.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);E.global=E.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||zu;E.emptyArray=Object.freeze?Object.freeze([]):[];E.emptyObject=Object.freeze?Object.freeze({}):{};E.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};E.isString=function(e){return typeof e=="string"||e instanceof String};E.isObject=function(e){return e&&typeof e=="object"};E.isset=E.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};E.Buffer=function(){try{var r=E.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();E._Buffer_from=null;E._Buffer_allocUnsafe=null;E.newBuffer=function(e){return typeof e=="number"?E.Buffer?E._Buffer_allocUnsafe(e):new E.Array(e):E.Buffer?E._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};E.Array=typeof Uint8Array<"u"?Uint8Array:Array;E.Long=E.global.dcodeIO&&E.global.dcodeIO.Long||E.global.Long||E.inquire("long");E.key2Re=/^true|false|0|1$/;E.key32Re=/^-?(?:0|[1-9][0-9]*)$/;E.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;E.longToHash=function(e){return e?E.LongBits.from(e).toHash():E.LongBits.zeroHash};E.longFromHash=function(e,t){var n=E.LongBits.fromHash(e);return E.Long?E.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function ph(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}E.merge=ph;E.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function hh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&ph(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}E.newError=hh;E.ProtocolError=hh("ProtocolError");E.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};E.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};E.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};E._configure=function(){var r=E.Buffer;if(!r){E._Buffer_from=E._Buffer_allocUnsafe=null;return}E._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},E._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var rc=l((Zy,gh)=>{"use strict";gh.exports=O;var ae=qe(),Yu,Ns=ae.LongBits,fh=ae.base64,Eh=ae.utf8;function Gr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Zu(){}function oO(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function O(){this.len=0,this.head=new Gr(Zu,0,0),this.tail=this.head,this.states=null}var mh=function(){return ae.Buffer?function(){return(O.create=function(){return new Yu})()}:function(){return new O}};O.create=mh();O.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(O.alloc=ae.pool(O.alloc,ae.Array.prototype.subarray));O.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Gr(e,t,n),this.len+=t,this};function Ju(r,e,t){e[t]=r&255}function aO(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function ec(r,e){this.len=r,this.next=void 0,this.val=e}ec.prototype=Object.create(Gr.prototype);ec.prototype.fn=aO;O.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new ec((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};O.prototype.int32=function(e){return e<0?this._push(tc,10,Ns.fromNumber(e)):this.uint32(e)};O.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function tc(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}O.prototype.uint64=function(e){var t=Ns.from(e);return this._push(tc,t.length(),t)};O.prototype.int64=O.prototype.uint64;O.prototype.sint64=function(e){var t=Ns.from(e).zzEncode();return this._push(tc,t.length(),t)};O.prototype.bool=function(e){return this._push(Ju,1,e?1:0)};function Qu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}O.prototype.fixed32=function(e){return this._push(Qu,4,e>>>0)};O.prototype.sfixed32=O.prototype.fixed32;O.prototype.fixed64=function(e){var t=Ns.from(e);return this._push(Qu,4,t.lo)._push(Qu,4,t.hi)};O.prototype.sfixed64=O.prototype.fixed64;O.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};O.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var uO=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};O.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Ju,1,0);if(ae.isString(e)){var n=O.alloc(t=fh.length(e));fh.decode(e,n,0),e=n}return this.uint32(t)._push(uO,t,e)};O.prototype.string=function(e){var t=Eh.length(e);return t?this.uint32(t)._push(Eh.write,t,e):this._push(Ju,1,0)};O.prototype.fork=function(){return this.states=new oO(this),this.head=this.tail=new Gr(Zu,0,0),this.len=0,this};O.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Gr(Zu,0,0),this.len=0),this};O.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};O.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};O._configure=function(r){Yu=r,O.create=mh(),Yu._configure()}});var Ah=l((Jy,Sh)=>{"use strict";Sh.exports=ge;var Th=rc();(ge.prototype=Object.create(Th.prototype)).constructor=ge;var Ve=qe();function ge(){Th.call(this)}ge._configure=function(){ge.alloc=Ve._Buffer_allocUnsafe,ge.writeBytesBuffer=Ve.Buffer&&Ve.Buffer.prototype instanceof Uint8Array&&Ve.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};ge.prototype.bytes=function(e){Ve.isString(e)&&(e=Ve._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(ge.writeBytesBuffer,t,e),this};function cO(r,e,t){r.length<40?Ve.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}ge.prototype.string=function(e){var t=Ve.Buffer.byteLength(e);return this.uint32(t),t&&this._push(cO,t,e),this};ge._configure()});var sc=l((ev,yh)=>{"use strict";yh.exports=x;var de=qe(),ic,bh=de.LongBits,lO=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function x(r){this.buf=r,this.pos=0,this.len=r.length}var Oh=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new x(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new x(e);throw Error("illegal buffer")},Ph=function(){return de.Buffer?function(t){return(x.create=function(i){return de.Buffer.isBuffer(i)?new ic(i):Oh(i)})(t)}:Oh};x.create=Ph();x.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;x.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,_e(this,10);return e}}();x.prototype.int32=function(){return this.uint32()|0};x.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function nc(){var r=new bh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}x.prototype.bool=function(){return this.uint32()!==0};function Cs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}x.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)};x.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)|0};function Rh(){if(this.pos+8>this.len)throw _e(this,8);return new bh(Cs(this.buf,this.pos+=4),Cs(this.buf,this.pos+=4))}x.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};x.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};x.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};x.prototype.string=function(){var e=this.bytes();return lO.read(e,0,e.length)};x.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};x.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};x._configure=function(r){ic=r,x.create=Ph(),ic._configure();var e=de.Long?"toLong":"toNumber";de.merge(x.prototype,{int64:function(){return nc.call(this)[e](!1)},uint64:function(){return nc.call(this)[e](!0)},sint64:function(){return nc.call(this).zzDecode()[e](!1)},fixed64:function(){return Rh.call(this)[e](!0)},sfixed64:function(){return Rh.call(this)[e](!1)}})}});var Lh=l((tv,Mh)=>{"use strict";Mh.exports=lt;var Ih=sc();(lt.prototype=Object.create(Ih.prototype)).constructor=lt;var vh=qe();function lt(r){Ih.call(this,r)}lt._configure=function(){vh.Buffer&&(lt.prototype._slice=vh.Buffer.prototype.slice)};lt.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};lt._configure()});var Ch=l((rv,Nh)=>{"use strict";Nh.exports=Hr;var oc=qe();(Hr.prototype=Object.create(oc.EventEmitter.prototype)).constructor=Hr;function Hr(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");oc.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Hr.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return oc.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,c){if(u)return o.emit("error",u,e),s(u);if(c===null){o.end(!0);return}if(!(c instanceof n))try{c=n[o.responseDelimited?"decodeDelimited":"decode"](c)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",c,e),s(null,c)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Hr.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var xh=l(wh=>{"use strict";var dO=wh;dO.Service=Ch()});var Uh=l((iv,Dh)=>{"use strict";Dh.exports={}});var Vh=l(qh=>{"use strict";var J=qh;J.build="minimal";J.Writer=rc();J.BufferWriter=Ah();J.Reader=sc();J.BufferReader=Lh();J.util=qe();J.rpc=xh();J.roots=Uh();J.configure=Bh;function Bh(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}Bh()});var Hh=l((ov,Gh)=>{"use strict";Gh.exports=Vh()});var Qh=l(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0})});var Jh=l(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0})});var tf=l(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0})});var rf=l(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ESpanKind=void 0;var LO;(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(LO=Fr.ESpanKind||(Fr.ESpanKind={}))});var sf=l(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0})});var lf=l(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.toMetric=Ge.toScopeMetrics=Ge.toResourceMetrics=void 0;var of=(h(),m(d)),or=wu(),Ds=Ur(),NO=Br();function CO(r,e){let t=(0,NO.getOtlpEncoder)(e);return{resource:{attributes:(0,Ds.toAttributes)(r.resource.attributes),droppedAttributesCount:0},schemaUrl:void 0,scopeMetrics:uf(r.scopeMetrics,t)}}Ge.toResourceMetrics=CO;function uf(r,e){return Array.from(r.map(t=>({scope:{name:t.scope.name,version:t.scope.version},metrics:t.metrics.map(n=>cf(n,e)),schemaUrl:t.scope.schemaUrl})))}Ge.toScopeMetrics=uf;function cf(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},n=UO(r.aggregationTemporality);switch(r.dataPointType){case or.DataPointType.SUM:t.sum={aggregationTemporality:n,isMonotonic:r.isMonotonic,dataPoints:af(r,e)};break;case or.DataPointType.GAUGE:t.gauge={dataPoints:af(r,e)};break;case or.DataPointType.HISTOGRAM:t.histogram={aggregationTemporality:n,dataPoints:xO(r,e)};break;case or.DataPointType.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:n,dataPoints:DO(r,e)};break}return t}Ge.toMetric=cf;function wO(r,e,t){let n={attributes:(0,Ds.toAttributes)(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case of.ValueType.INT:n.asInt=r.value;break;case of.ValueType.DOUBLE:n.asDouble=r.value;break}return n}function af(r,e){return r.dataPoints.map(t=>wO(t,r.descriptor.valueType,e))}function xO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function DO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function UO(r){switch(r){case or.AggregationTemporality.DELTA:return 1;case or.AggregationTemporality.CUMULATIVE:return 2}}});var df=l(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.createExportMetricsServiceRequest=void 0;var BO=lf();function qO(r,e){return{resourceMetrics:r.map(t=>(0,BO.toResourceMetrics)(t,e))}}Us.createExportMetricsServiceRequest=qO});var pf=l(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.toLogAttributes=ar.createExportLogsServiceRequest=void 0;var VO=Br(),lc=Ur();function GO(r,e){let t=(0,VO.getOtlpEncoder)(e);return{resourceLogs:jO(r,t)}}ar.createExportLogsServiceRequest=GO;function HO(r){let e=new Map;for(let t of r){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=t,a=e.get(n);a||(a=new Map,e.set(n,a));let u=`${i}@${s}:${o}`,c=a.get(u);c||(c=[],a.set(u,c)),c.push(t)}return e}function jO(r,e){let t=HO(r);return Array.from(t,([n,i])=>({resource:{attributes:(0,lc.toAttributes)(n.attributes),droppedAttributesCount:0},scopeLogs:Array.from(i,([,s])=>{let{instrumentationScope:{name:o,version:a,schemaUrl:u}}=s[0];return{scope:{name:o,version:a},logRecords:s.map(c=>FO(c,e)),schemaUrl:u}}),schemaUrl:void 0}))}function FO(r,e){var t,n,i;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:(0,lc.toAnyValue)(r.body),attributes:_f(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((n=r.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=r.spanContext)===null||i===void 0?void 0:i.spanId)}}function _f(r){return Object.keys(r).map(e=>(0,lc.toKeyValue)(e,r[e]))}ar.toLogAttributes=_f});var hf=l(G=>{"use strict";var kO=G&&G.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ur=G&&G.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&kO(e,r,t)};Object.defineProperty(G,"__esModule",{value:!0});G.createExportLogsServiceRequest=G.createExportMetricsServiceRequest=G.createExportTraceServiceRequest=void 0;ur(Qh(),G);ur(Br(),G);ur(Jh(),G);ur(tf(),G);ur(rf(),G);ur(sf(),G);var $O=ys();Object.defineProperty(G,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return $O.createExportTraceServiceRequest}});var XO=df();Object.defineProperty(G,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return XO.createExportMetricsServiceRequest}});var WO=pf();Object.defineProperty(G,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return WO.createExportLogsServiceRequest}})});var C=Y(la(),1);h();fa();var Tf=Y(Gd(),1),lr=Y(rt(),1),Sf=Y(r_(),1),Af=Y(wu(),1),Gs=Y(Qr(),1),Of=Y(cp(),1),He=Y(A(),1);h();var LA=Symbol.for("@vercel/request-context");function se(){return globalThis[LA]?.get()}var lp="http.method",dp="http.url",Os="http.host",_p="http.scheme",Uu="http.status_code",pp="http.user_agent",Bu="http.response_content_length_uncompressed",hp="net.peer.port",fp="net.peer.name",Ep="cloud.region";var mp="deployment.environment.name",gp="deployment.id";var Tp="process.runtime.name",Sp="vcs.ref.head.name",Ap="vcs.ref.head.revision",Op="vcs.repository.name",Rp="vcs.repository.ref.revision";var bp="service.name",Pp="service.version";function qu(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function vp({attributes:r,env:e=process.env,runtime:t,serviceName:n}){let i=e.VERCEL_ENV||e.NEXT_PUBLIC_VERCEL_ENV,s=e.VERCEL_DEPLOYMENT_ID,o=e.VERCEL_GIT_COMMIT_SHA||e.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,a=e.VERCEL_REGION,u=e.VERCEL_GIT_COMMIT_REF,c=e.VERCEL_URL||e.NEXT_PUBLIC_VERCEL_URL||void 0,_=e.VERCEL_BRANCH_URL||e.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,p=e.VERCEL_GIT_REPO_SLUG;return qu({[bp]:n,"node.ci":e.CI?!0:void 0,"node.env":e.NODE_ENV,[mp]:i,env:i,[Ep]:a,"vercel.region":a,[Tp]:t,"vercel.runtime":t,[Sp]:u,[Ap]:o,[Op]:p,[Rp]:o,"vercel.sha":o,"vercel.host":c,"vercel.branch_host":_,[gp]:s,"vercel.deployment_id":s,[Pp]:s,"vercel.project_id":e.VERCEL_PROJECT_ID||void 0,...r})}function Ip(r){return r?r.split("::").at(-1):void 0}function Mp(r=se(),e){if(!r)return;let t=e?CA(e,r.headers):void 0;return qu({[Os]:r.headers.host,[pp]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":Ip(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...t})}var NA={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function CA(r,e){if(typeof r=="function")return r(e,NA);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function er(r){return(r&d.TraceFlags.SAMPLED)!==0}var Rs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&er(s)){let a=se(),u=Mp(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let c=new Promise(p=>{this.waitSpanEnd.set(n,p)}),_;await Promise.race([c,new Promise(p=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=er(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=xA(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(c){d.diag.error("@vercel/otel: onEnd failed:",c)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},wA={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function xA(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let c=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":c};let _=r.instrumentationLibrary.name,p=o??s;if(p&&typeof p=="string"){let f=Lp(_,p);return u?{"operation.name":f,"resource.name":c}:{"operation.name":f}}return{"operation.name":Lp(_,e===d.SpanKind.INTERNAL?"":wA[e])}}function Lp(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var kp=Y(ys(),1);var Fp=Y(jp(),1);h();var tr=class extends Fp.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(c){d.diag.warn("@vercel/otel/otlp: no proto",c);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(c=>{d.diag.debug("@vercel/otel/otlp: onSuccess",c.status,c.statusText),t(),c.arrayBuffer().catch(()=>{})}).catch(c=>{d.diag.error("@vercel/otel/otlp: onError",c),n(c)}).finally(()=>{let c=this._sendingPromises.indexOf(u);this._sendingPromises.splice(c,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var tO="v1/traces",rO=`http://localhost:4318/${tO}`;function Is(r){return typeof r.url=="string"?r.url:rO}var rr=class{constructor(e={}){this.impl=new Wu(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Wu=class extends tr{convert(e){return(0,kp.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Is(e)}};var $h=Y(ys(),1);var jh=Y(Hh(),1);function Fh(r){let e=new jh.Writer;return _O(r,e),e.finish()}function _O(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)pO(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function pO(r,e){if(r.resource!=null&&hO(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)fO(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function hO(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function fO(r,e){if(r.scope!=null&&gO(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)TO(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function ir(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&kh(r.value,e.uint32(18).fork()).ldelim(),e}function kh(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&EO(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&mO(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function EO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)kh(r.values[t],e.uint32(10).fork()).ldelim();return e}function mO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)ir(r.values[t],e.uint32(10).fork()).ldelim();return e}function gO(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function TO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)AO(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)OO(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&SO(r.status,e.uint32(122).fork()).ldelim(),e}function SO(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function AO(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function OO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var dt=class{constructor(e={}){this.impl=new ac(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},ac=class extends tr{convert(e){return(0,$h.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Fh(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Is(e)}};h();function Xh(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var sr=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}shouldIgnore(e,t){let n=this.config.ignoreUrls??[];if(t?.opentelemetry?.ignore!==void 0)return t.opentelemetry.ignore;if(n.length===0)return!1;let i=e.toString();return n.some(s=>typeof s=="string"?s==="*"?!0:i.startsWith(s):s.test(i))}shouldPropagate(e,t){let n=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,i=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,s=this.config.propagateContextUrls??[],o=this.config.dontPropagateContextUrls??[];if(t?.opentelemetry?.propagateContext)return t.opentelemetry.propagateContext;let a=e.toString();return o.length>0&&o.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))?!1:n&&e.protocol==="https:"&&(e.host===n||e.host===i||e.host===se()?.headers.host)||!n&&e.protocol==="http:"&&e.hostname==="localhost"?!0:s.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))}startSpan({tracer:e,url:t,fetchType:n,method:i="GET",name:s,attributes:o={}}){let a=this.config.resourceNameTemplate,u={[lp]:i,[dp]:t.toString(),[Os]:t.host,[_p]:t.protocol.replace(":",""),[fp]:t.hostname,[hp]:t.port},c=a?Xh(a,u):PO(t.toString()),_=s??`${n} ${i} ${t.toString()}`,p=d.context.active();return e.startSpan(_,{kind:d.SpanKind.CLIENT,attributes:{...u,"operation.name":`${n}.${i}`,"http.client.name":n,"resource.name":c,...o}},p)}instrumentHttp(e,t){let{tracerProvider:n}=this;if(!n)return;let i=n.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:s,attributesFromResponseHeaders:o}=this.config,a=e.request,u=e.get,c=_=>(p,f,M)=>{let R,w={},U;if(typeof p=="string"||p instanceof URL?(R=new URL(p.toString()),typeof f=="function"?U=f:f&&typeof M=="function"?(w=f,U=M):f&&(w=f)):(w=p,typeof f=="function"&&(U=f),R=vO(w,t)),this.shouldIgnore(R))return _.apply(this,[R,w,U]);let S=this.startSpan({tracer:i,url:R,fetchType:"http",method:w.method||"GET"});if(!S.isRecording()||!er(S.spanContext().traceFlags))return S.end(),_.apply(this,[R,w,U]);if(this.shouldPropagate(R)){let Te=d.context.active(),Se=d.trace.setSpan(Te,S);d.propagation.inject(Se,w.headers||{},bO)}s&&ws(S,s,w.headers||{},Kh);try{let Te=Date.now(),Se=_.apply(this,[R,w,U]);return Se.prependListener("response",K=>{let pt=Date.now()-Te;S.setAttribute("http.response_time",pt),K.statusCode!==void 0?(S.setAttribute(Uu,K.statusCode),K.statusCode>=500&&_t(S,`Status: ${K.statusCode}`)):_t(S,"Response status code is undefined"),o&&ws(S,o,K.headers,Kh),Se.listenerCount("response")<=1&&K.resume(),K.on("end",()=>{let $r,Hs=K.statusCode;K.aborted&&!K.complete?$r={code:d.SpanStatusCode.ERROR}:Hs&&Hs>=100&&Hs<500?$r={code:d.SpanStatusCode.UNSET}:$r={code:d.SpanStatusCode.ERROR},S.setStatus($r),S.isRecording()&&(K.headers["content-length"]&&S.setAttribute(Bu,K.headers["content-length"]),S.end())})}),Se.on("error",K=>{S.isRecording()&&(_t(S,K),S.end())}),Se.on("close",()=>{S.isRecording()&&S.end()}),Se}catch(Te){throw _t(S,Te),S.end(),Te}};e.request=c(a),e.get=c(u)}instrumentFetch(){let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:n,attributesFromResponseHeaders:i}=this.config;process.env.NEXT_OTEL_FETCH_DISABLED="1";let s=globalThis.fetch;this.originalFetch=s;let o=async(a,u)=>{let c=u;if(c?.next?.internal)return s(a,c);let _=new Request(a instanceof Request?a.clone():a,c),p=new URL(_.url);if(this.shouldIgnore(p,c))return s(a,c);let f=this.startSpan({tracer:t,url:p,fetchType:"fetch",method:_.method,name:c?.opentelemetry?.spanName,attributes:c?.opentelemetry?.attributes});if(!f.isRecording()||!er(f.spanContext().traceFlags))return f.end(),s(a,c);if(this.shouldPropagate(p,c)){let M=d.context.active(),R=d.trace.setSpan(M,f);d.propagation.inject(R,_.headers,RO)}n&&ws(f,n,_.headers,Wh);try{let M=Date.now();c?.body&&c.body instanceof FormData&&_.headers.delete("content-type");let R=await s(a,{...c,headers:_.headers}),w=Date.now()-M;return f.setAttribute(Uu,R.status),f.setAttribute("http.response_time",w),i&&ws(f,i,R.headers,Wh),R.status>=500&&_t(f,`Status: ${R.status} (${R.statusText})`),R.body?yO(R).then(U=>{f.isRecording()&&(f.setAttribute(Bu,U),f.end())},U=>{f.isRecording()&&(_t(f,U),f.end())}):f.end(),R}catch(M){throw _t(f,M),f.end(),M}};globalThis.fetch=o}enable(){this.disable(),this.instrumentFetch();try{let e=z("node:http"),t=z("node:https");this.instrumentHttp(e,"http:"),this.instrumentHttp(t,"https:")}catch{}}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},RO={set(r,e,t){r.set(e,t)}},Wh={get(r,e){let t=r.get(e);if(t!==null)return t.includes(",")?t.split(",").map(n=>n.trimStart()):t},keys(r){let e=[];return r.forEach((t,n)=>{e.push(n)}),e}},bO={set(r,e,t){r[e.toLowerCase()]=t}},Kh={get(r,e){return r[e.toLowerCase()]},keys(r){return Object.keys(r)}};function PO(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function yO(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function _t(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function ws(r,e,t,n){for(let[i,s]of Object.entries(e)){let o=n.get(t,s);o!==void 0&&r.setAttribute(i,o)}}function vO(r,e){if(r.socketPath)throw new Error("Cannot construct a network URL: options.socketPath is specified, indicating a Unix domain socket.");let t=r.protocol??e;t&&!t.endsWith(":")&&(t+=":");let n=r.hostname,i=r.port??r.defaultPort;if(!n&&r.host){let c=r.host.split(":");n=c[0];let _=c[1];if(c.length>1&&_&&i===void 0){let p=parseInt(_,10);isNaN(p)||(i=p)}}n||(n="localhost");let s;if(i!==void 0&&i!==""){let c=parseInt(String(i),10);isNaN(c)?s=t==="https:"?443:80:s=c}else s=t==="https:"?443:80;let o=r.path||"/",a=`${t}//${n}:${s}`,u=new URL(o,a);if(r.auth){let c=r.auth.split(":");u.username=decodeURIComponent(c[0]||""),c.length>1&&(u.password=decodeURIComponent(c[1]||""))}return u}h();var zh=Y(A(),1),IO="00",uc="traceparent",cc="tracestate",jr=class{fields(){return[uc,cc]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,zh.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let s=`${IO}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,uc,s),i.traceState&&n.set(t,cc,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,uc);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=MO(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,cc);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,o)}};function MO(r){let[e,t,n,i,s]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&s?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}h();var xs=class{fields(){return[]}inject(){}extract(e){let t=se();if(!t?.telemetry)return d.diag.warn("@vercel/otel: Vercel telemetry extension not found."),e;let{rootSpanContext:n}=t.telemetry;return n?(d.diag.debug("@vercel/otel: Extracted root SpanContext from Vercel request context.",n),d.trace.setSpanContext(e,{...n,isRemote:!0,traceFlags:n.traceFlags||d.TraceFlags.SAMPLED})):e}};h();var Bs=Y(A(),1),ff=Y(hf(),1);var qs=class{export(e,t){let n=se();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:Bs.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,ff.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:Bs.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:Bs.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};h();function dc(){return!!se()?.telemetry?.traceDrains?.length}var Ef=!1,kr=class{constructor(e){this.processor=e}forceFlush(){return this.processor.forceFlush()}shutdown(){return this.processor.shutdown()}onStart(e,t){if(dc()){Ef||(Ef=!0,d.diag.debug("@vercel/otel: skipping automatic exporter due to configured trace drains"));return}this.processor.onStart(e,t)}onEnd(e){dc()||this.processor.onEnd(e)}};var KO={ALL:d.DiagLogLevel.ALL,VERBOSE:d.DiagLogLevel.VERBOSE,DEBUG:d.DiagLogLevel.DEBUG,INFO:d.DiagLogLevel.INFO,WARN:d.DiagLogLevel.WARN,ERROR:d.DiagLogLevel.ERROR,NONE:d.DiagLogLevel.NONE},Vs=class{constructor(e={}){this.configuration=e}start(){let e=zO(),t=this.configuration,n=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(process.env.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:KO[process.env.OTEL_LOG_LEVEL.toUpperCase()]}),i)return;let s=t.idGenerator??new C.RandomIdGenerator,o=t.contextManager??new Of.AsyncLocalStorageContextManager;o.enable(),this.contextManager=o;let a=e.OTEL_SERVICE_NAME||t.serviceName||"app",u=new lr.Resource(vp({attributes:t.attributes,runtime:n,serviceName:a})),c=t.resourceDetectors??[lr.envDetectorSync];if(t.autoDetectResources??!0){let S={detectors:c};u=u.merge((0,lr.detectResourcesSync)(S))}let p=QO(t.propagators,t,e),f=ZO(t.traceSampler,e),M=JO(t.spanProcessors,t,e);M.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let R=t.spanLimits,w=new C.BasicTracerProvider({resource:u,idGenerator:s,sampler:f,spanLimits:R});if(w.addSpanProcessor(new Rs(M,t.attributesFromHeaders)),w.register({contextManager:o,propagator:new He.CompositePropagator({propagators:p})}),this.tracerProvider=w,t.logRecordProcessor){let S=new Sf.LoggerProvider({resource:u});this.loggerProvider=S,S.addLogRecordProcessor(t.logRecordProcessor),st.logs.setGlobalLoggerProvider(S)}if(t.metricReader||t.views){let S=new Af.MeterProvider({resource:u,views:t.views??[]});t.metricReader&&S.addMetricReader(t.metricReader),d.metrics.setGlobalMeterProvider(S),this.meterProvider=S}let U=YO(t.instrumentations,t.instrumentationConfig);this.disableInstrumentations=(0,Tf.registerInstrumentations)({instrumentations:U}),d.diag.info("@vercel/otel: started",a,n)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function zO(){let r=(0,Gs.parseEnvironment)(process.env);return{...Gs.DEFAULT_ENVIRONMENT,...r}}function YO(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new sr(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new sr(e?.fetch)):t).flat()}function QO(r,e,t){let n=process.env.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS.length>0?t.OTEL_PROPAGATORS:void 0;return(r??n??["auto"]).map(i=>{if(i==="none")return[];if(i==="auto"){let s=[];return s.push({name:"tracecontext",propagator:new jr}),s.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),s.push({name:"vercel-runtime",propagator:new xs}),d.diag.debug(`@vercel/otel: Configure propagators: ${s.map(o=>o.name).join(", ")}`),s.map(o=>o.propagator)}if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new jr;if(i==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new He.W3CBaggagePropagator;if(typeof i=="string")throw new Error(`Unknown propagator: "${i}"`);return i}).flat()}var mf="always_on",cr=1;function ZO(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||mf;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new C.AlwaysOnSampler;case"always_off":return new C.AlwaysOffSampler;case"parentbased_always_on":return new C.ParentBasedSampler({root:new C.AlwaysOnSampler});case"parentbased_always_off":return new C.ParentBasedSampler({root:new C.AlwaysOffSampler});case"traceidratio":return new C.TraceIdRatioBasedSampler(gf(e));case"parentbased_traceidratio":return new C.ParentBasedSampler({root:new C.TraceIdRatioBasedSampler(gf(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${mf}".`),new C.AlwaysOnSampler}}function gf(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${cr}.`),cr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${cr}.`),cr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${cr}.`),cr):e}function JO(r,e,t){return[...(r??["auto"]).flatMap(n=>{if(n==="auto"){let i=[new C.BatchSpanProcessor(new qs)];if(process.env.VERCEL_OTEL_ENDPOINTS){let s=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",o=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",s,o);let a={url:`http://localhost:${s}/v1/traces`,headers:{}},u=o==="http/protobuf"?new dt(a):new rr(a);i.push(new kr(new C.BatchSpanProcessor(u)))}else(!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT)&&i.push(new kr(new C.BatchSpanProcessor(eR(t))));return i}return n}).filter(nR),...e.traceExporter&&e.traceExporter!=="auto"?[new C.BatchSpanProcessor(e.traceExporter)]:[]]}function eR(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=rR(r),n={...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new rr({url:t,headers:n});case"http/protobuf":return new dt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new dt}}var Rf="v1/traces",tR=`http://localhost:4318/${Rf}`;function rR(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${Rf}`:tR}function nR(r){return r!=null}function Jv(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Vs(e).start()}export{sr as FetchInstrumentation,rr as OTLPHttpJsonTraceExporter,dt as OTLPHttpProtoTraceExporter,Jv as registerOTel};
|
|
20
|
+
`,(0,ss.getConflictResolutionRecipe)(s,e))}return n}};os.MetricStorageRegistry=fu});var $_=l(as=>{"use strict";Object.defineProperty(as,"__esModule",{value:!0});as.MultiMetricStorage=void 0;var Eu=class{constructor(e){this._backingStorages=e}record(e,t,n,i){this._backingStorages.forEach(s=>{s.record(e,t,n,i)})}};as.MultiMetricStorage=Eu});var K_=l(Zt=>{"use strict";Object.defineProperty(Zt,"__esModule",{value:!0});Zt.BatchObservableResultImpl=Zt.ObservableResultImpl=void 0;var Qt=(h(),m(d)),X_=wr(),FS=Zi(),mu=class{constructor(e,t){this._instrumentName=e,this._valueType=t,this._buffer=new X_.AttributeHashMap}observe(e,t={}){if(typeof e!="number"){Qt.diag.warn(`non-number value provided to metric ${this._instrumentName}: ${e}`);return}this._valueType===Qt.ValueType.INT&&!Number.isInteger(e)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${this._instrumentName}, ignoring the fractional digits.`),e=Math.trunc(e),!Number.isInteger(e))||this._buffer.set(t,e)}};Zt.ObservableResultImpl=mu;var gu=class{constructor(){this._buffer=new Map}observe(e,t,n={}){if(!(0,FS.isObservableInstrument)(e))return;let i=this._buffer.get(e);if(i==null&&(i=new X_.AttributeHashMap,this._buffer.set(e,i)),typeof t!="number"){Qt.diag.warn(`non-number value provided to metric ${e._descriptor.name}: ${t}`);return}e._descriptor.valueType===Qt.ValueType.INT&&!Number.isInteger(t)&&(Qt.diag.warn(`INT value type cannot accept a floating-point value for ${e._descriptor.name}, ignoring the fractional digits.`),t=Math.trunc(t),!Number.isInteger(t))||i.set(n,t)}};Zt.BatchObservableResultImpl=gu});var Y_=l(us=>{"use strict";Object.defineProperty(us,"__esModule",{value:!0});us.ObservableRegistry=void 0;var kS=(h(),m(d)),W_=Zi(),z_=K_(),xr=Ee(),Tu=class{constructor(){this._callbacks=[],this._batchCallbacks=[]}addCallback(e,t){this._findCallback(e,t)>=0||this._callbacks.push({callback:e,instrument:t})}removeCallback(e,t){let n=this._findCallback(e,t);n<0||this._callbacks.splice(n,1)}addBatchCallback(e,t){let n=new Set(t.filter(W_.isObservableInstrument));if(n.size===0){kS.diag.error("BatchObservableCallback is not associated with valid instruments",t);return}this._findBatchCallback(e,n)>=0||this._batchCallbacks.push({callback:e,instruments:n})}removeBatchCallback(e,t){let n=new Set(t.filter(W_.isObservableInstrument)),i=this._findBatchCallback(e,n);i<0||this._batchCallbacks.splice(i,1)}async observe(e,t){let n=this._observeCallbacks(e,t),i=this._observeBatchCallbacks(e,t);return(await(0,xr.PromiseAllSettled)([...n,...i])).filter(xr.isPromiseAllSettledRejectionResult).map(a=>a.reason)}_observeCallbacks(e,t){return this._callbacks.map(async({callback:n,instrument:i})=>{let s=new z_.ObservableResultImpl(i._descriptor.name,i._descriptor.valueType),o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i._metricStorages.forEach(a=>{a.record(s._buffer,e)})})}_observeBatchCallbacks(e,t){return this._batchCallbacks.map(async({callback:n,instruments:i})=>{let s=new z_.BatchObservableResultImpl,o=Promise.resolve(n(s));t!=null&&(o=(0,xr.callWithTimeout)(o,t)),await o,i.forEach(a=>{let u=s._buffer.get(a);u!=null&&a._metricStorages.forEach(c=>{c.record(u,e)})})})}_findCallback(e,t){return this._callbacks.findIndex(n=>n.callback===e&&n.instrument===t)}_findBatchCallback(e,t){return this._batchCallbacks.findIndex(n=>n.callback===e&&(0,xr.setEquals)(n.instruments,t))}};us.ObservableRegistry=Tu});var Q_=l(cs=>{"use strict";Object.defineProperty(cs,"__esModule",{value:!0});cs.SyncMetricStorage=void 0;var $S=au(),XS=du(),KS=pu(),Su=class extends $S.MetricStorage{constructor(e,t,n,i){super(e),this._attributesProcessor=n,this._deltaMetricStorage=new XS.DeltaMetricProcessor(t),this._temporalMetricStorage=new KS.TemporalMetricProcessor(t,i)}record(e,t,n,i){t=this._attributesProcessor.process(t,n),this._deltaMetricStorage.record(e,t,n,i)}collect(e,t){let n=this._deltaMetricStorage.collect();return this._temporalMetricStorage.buildMetrics(e,this._instrumentDescriptor,n,t)}};cs.SyncMetricStorage=Su});var Ou=l(we=>{"use strict";Object.defineProperty(we,"__esModule",{value:!0});we.FilteringAttributesProcessor=we.NoopAttributesProcessor=we.AttributesProcessor=void 0;var Dr=class{static Noop(){return WS}};we.AttributesProcessor=Dr;var ls=class extends Dr{process(e,t){return e}};we.NoopAttributesProcessor=ls;var Au=class extends Dr{constructor(e){super(),this._allowedAttributeNames=e}process(e,t){let n={};return Object.keys(e).filter(i=>this._allowedAttributeNames.includes(i)).forEach(i=>n[i]=e[i]),n}};we.FilteringAttributesProcessor=Au;var WS=new ls});var Z_=l(ds=>{"use strict";Object.defineProperty(ds,"__esModule",{value:!0});ds.MeterSharedState=void 0;var zS=be(),YS=U_(),QS=Ee(),ZS=B_(),JS=k_(),eA=$_(),tA=Y_(),rA=Q_(),nA=Ou(),Ru=class{constructor(e,t){this._meterProviderSharedState=e,this._instrumentationScope=t,this.metricStorageRegistry=new JS.MetricStorageRegistry,this.observableRegistry=new tA.ObservableRegistry,this.meter=new YS.Meter(this)}registerMetricStorage(e){let t=this._registerMetricStorage(e,rA.SyncMetricStorage);return t.length===1?t[0]:new eA.MultiMetricStorage(t)}registerAsyncMetricStorage(e){return this._registerMetricStorage(e,ZS.AsyncMetricStorage)}async collect(e,t,n){let i=await this.observableRegistry.observe(t,n?.timeoutMillis),s=this.metricStorageRegistry.getStorages(e);if(s.length===0)return null;let o=s.map(a=>a.collect(e,t)).filter(QS.isNotNullish);return o.length===0?{errors:i}:{scopeMetrics:{scope:this._instrumentationScope,metrics:o},errors:i}}_registerMetricStorage(e,t){let i=this._meterProviderSharedState.viewRegistry.findViews(e,this._instrumentationScope).map(s=>{let o=(0,zS.createInstrumentDescriptorWithView)(s,e),a=this.metricStorageRegistry.findOrUpdateCompatibleStorage(o);if(a!=null)return a;let u=s.aggregation.createAggregator(o),c=new t(o,u,s.attributesProcessor,this._meterProviderSharedState.metricCollectors);return this.metricStorageRegistry.register(c),c});if(i.length===0){let o=this._meterProviderSharedState.selectAggregations(e.type).map(([a,u])=>{let c=this.metricStorageRegistry.findOrUpdateCompatibleCollectorStorage(a,e);if(c!=null)return c;let _=u.createAggregator(e),p=new t(e,_,nA.AttributesProcessor.Noop(),[a]);return this.metricStorageRegistry.registerForCollector(a,p),p});i=i.concat(o)}return i}};ds.MeterSharedState=Ru});var J_=l(_s=>{"use strict";Object.defineProperty(_s,"__esModule",{value:!0});_s.MeterProviderSharedState=void 0;var iA=Ee(),sA=D_(),oA=Z_(),bu=class{constructor(e){this.resource=e,this.viewRegistry=new sA.ViewRegistry,this.metricCollectors=[],this.meterSharedStates=new Map}getMeterSharedState(e){let t=(0,iA.instrumentationScopeId)(e),n=this.meterSharedStates.get(t);return n==null&&(n=new oA.MeterSharedState(this,e),this.meterSharedStates.set(t,n)),n}selectAggregations(e){let t=[];for(let n of this.metricCollectors)t.push([n,n.selectAggregation(e)]);return t}};_s.MeterProviderSharedState=bu});var ep=l(ps=>{"use strict";Object.defineProperty(ps,"__esModule",{value:!0});ps.MetricCollector=void 0;var aA=A(),Pu=class{constructor(e,t){this._sharedState=e,this._metricReader=t}async collect(e){let t=(0,aA.millisToHrTime)(Date.now()),n=[],i=[],s=Array.from(this._sharedState.meterSharedStates.values()).map(async o=>{let a=await o.collect(this,t,e);a?.scopeMetrics!=null&&n.push(a.scopeMetrics),a?.errors!=null&&i.push(...a.errors)});return await Promise.all(s),{resourceMetrics:{resource:this._sharedState.resource,scopeMetrics:n},errors:i}}async forceFlush(e){await this._metricReader.forceFlush(e)}async shutdown(e){await this._metricReader.shutdown(e)}selectAggregationTemporality(e){return this._metricReader.selectAggregationTemporality(e)}selectAggregation(e){return this._metricReader.selectAggregation(e)}};ps.MetricCollector=Pu});var rp=l(fs=>{"use strict";Object.defineProperty(fs,"__esModule",{value:!0});fs.MeterProvider=void 0;var hs=(h(),m(d)),tp=rt(),uA=J_(),cA=ep(),yu=class{constructor(e){var t;this._shutdown=!1;let n=tp.Resource.default().merge((t=e?.resource)!==null&&t!==void 0?t:tp.Resource.empty());if(this._sharedState=new uA.MeterProviderSharedState(n),e?.views!=null&&e.views.length>0)for(let i of e.views)this._sharedState.viewRegistry.addView(i)}getMeter(e,t="",n={}){return this._shutdown?(hs.diag.warn("A shutdown MeterProvider cannot provide a Meter"),(0,hs.createNoopMeter)()):this._sharedState.getMeterSharedState({name:e,version:t,schemaUrl:n.schemaUrl}).meter}addMetricReader(e){let t=new cA.MetricCollector(this._sharedState,e);e.setMetricProducer(t),this._sharedState.metricCollectors.push(t)}async shutdown(e){if(this._shutdown){hs.diag.warn("shutdown may only be called once per MeterProvider");return}this._shutdown=!0,await Promise.all(this._sharedState.metricCollectors.map(t=>t.shutdown(e)))}async forceFlush(e){if(this._shutdown){hs.diag.warn("invalid attempt to force flush after MeterProvider shutdown");return}await Promise.all(this._sharedState.metricCollectors.map(t=>t.forceFlush(e)))}};fs.MeterProvider=yu});var Es=l(Jt=>{"use strict";Object.defineProperty(Jt,"__esModule",{value:!0});Jt.ExactPredicate=Jt.PatternPredicate=void 0;var lA=/[\^$\\.+?()[\]{}|]/g,vu=class r{constructor(e){e==="*"?(this._matchAll=!0,this._regexp=/.*/):(this._matchAll=!1,this._regexp=new RegExp(r.escapePattern(e)))}match(e){return this._matchAll?!0:this._regexp.test(e)}static escapePattern(e){return`^${e.replace(lA,"\\$&").replace("*",".*")}$`}static hasWildcard(e){return e.includes("*")}};Jt.PatternPredicate=vu;var Iu=class{constructor(e){this._matchAll=e===void 0,this._pattern=e}match(e){return!!(this._matchAll||e===this._pattern)}};Jt.ExactPredicate=Iu});var ip=l(ms=>{"use strict";Object.defineProperty(ms,"__esModule",{value:!0});ms.InstrumentSelector=void 0;var np=Es(),Mu=class{constructor(e){var t;this._nameFilter=new np.PatternPredicate((t=e?.name)!==null&&t!==void 0?t:"*"),this._type=e?.type,this._unitFilter=new np.ExactPredicate(e?.unit)}getType(){return this._type}getNameFilter(){return this._nameFilter}getUnitFilter(){return this._unitFilter}};ms.InstrumentSelector=Mu});var sp=l(gs=>{"use strict";Object.defineProperty(gs,"__esModule",{value:!0});gs.MeterSelector=void 0;var Lu=Es(),Nu=class{constructor(e){this._nameFilter=new Lu.ExactPredicate(e?.name),this._versionFilter=new Lu.ExactPredicate(e?.version),this._schemaUrlFilter=new Lu.ExactPredicate(e?.schemaUrl)}getNameFilter(){return this._nameFilter}getVersionFilter(){return this._versionFilter}getSchemaUrlFilter(){return this._schemaUrlFilter}};gs.MeterSelector=Nu});var ap=l(Ts=>{"use strict";Object.defineProperty(Ts,"__esModule",{value:!0});Ts.View=void 0;var dA=Es(),op=Ou(),_A=ip(),pA=sp(),hA=ki();function fA(r){return r.instrumentName==null&&r.instrumentType==null&&r.instrumentUnit==null&&r.meterName==null&&r.meterVersion==null&&r.meterSchemaUrl==null}var Cu=class{constructor(e){var t;if(fA(e))throw new Error("Cannot create view with no selector arguments supplied");if(e.name!=null&&(e?.instrumentName==null||dA.PatternPredicate.hasWildcard(e.instrumentName)))throw new Error("Views with a specified name must be declared with an instrument selector that selects at most one instrument per meter.");e.attributeKeys!=null?this.attributesProcessor=new op.FilteringAttributesProcessor(e.attributeKeys):this.attributesProcessor=op.AttributesProcessor.Noop(),this.name=e.name,this.description=e.description,this.aggregation=(t=e.aggregation)!==null&&t!==void 0?t:hA.Aggregation.Default(),this.instrumentSelector=new _A.InstrumentSelector({name:e.instrumentName,type:e.instrumentType,unit:e.instrumentUnit}),this.meterSelector=new pA.MeterSelector({name:e.meterName,version:e.meterVersion,schemaUrl:e.meterSchemaUrl})}};Ts.View=Cu});var wu=l(g=>{"use strict";Object.defineProperty(g,"__esModule",{value:!0});g.TimeoutError=g.View=g.Aggregation=g.SumAggregation=g.LastValueAggregation=g.HistogramAggregation=g.DropAggregation=g.ExponentialHistogramAggregation=g.ExplicitBucketHistogramAggregation=g.DefaultAggregation=g.MeterProvider=g.InstrumentType=g.ConsoleMetricExporter=g.InMemoryMetricExporter=g.PeriodicExportingMetricReader=g.MetricReader=g.DataPointType=g.AggregationTemporality=void 0;var EA=Li();Object.defineProperty(g,"AggregationTemporality",{enumerable:!0,get:function(){return EA.AggregationTemporality}});var mA=wt();Object.defineProperty(g,"DataPointType",{enumerable:!0,get:function(){return mA.DataPointType}});var gA=Wa();Object.defineProperty(g,"MetricReader",{enumerable:!0,get:function(){return gA.MetricReader}});var TA=L_();Object.defineProperty(g,"PeriodicExportingMetricReader",{enumerable:!0,get:function(){return TA.PeriodicExportingMetricReader}});var SA=C_();Object.defineProperty(g,"InMemoryMetricExporter",{enumerable:!0,get:function(){return SA.InMemoryMetricExporter}});var AA=x_();Object.defineProperty(g,"ConsoleMetricExporter",{enumerable:!0,get:function(){return AA.ConsoleMetricExporter}});var OA=be();Object.defineProperty(g,"InstrumentType",{enumerable:!0,get:function(){return OA.InstrumentType}});var RA=rp();Object.defineProperty(g,"MeterProvider",{enumerable:!0,get:function(){return RA.MeterProvider}});var xe=ki();Object.defineProperty(g,"DefaultAggregation",{enumerable:!0,get:function(){return xe.DefaultAggregation}});Object.defineProperty(g,"ExplicitBucketHistogramAggregation",{enumerable:!0,get:function(){return xe.ExplicitBucketHistogramAggregation}});Object.defineProperty(g,"ExponentialHistogramAggregation",{enumerable:!0,get:function(){return xe.ExponentialHistogramAggregation}});Object.defineProperty(g,"DropAggregation",{enumerable:!0,get:function(){return xe.DropAggregation}});Object.defineProperty(g,"HistogramAggregation",{enumerable:!0,get:function(){return xe.HistogramAggregation}});Object.defineProperty(g,"LastValueAggregation",{enumerable:!0,get:function(){return xe.LastValueAggregation}});Object.defineProperty(g,"SumAggregation",{enumerable:!0,get:function(){return xe.SumAggregation}});Object.defineProperty(g,"Aggregation",{enumerable:!0,get:function(){return xe.Aggregation}});var bA=ap();Object.defineProperty(g,"View",{enumerable:!0,get:function(){return bA.View}});var PA=Ee();Object.defineProperty(g,"TimeoutError",{enumerable:!0,get:function(){return PA.TimeoutError}})});var up=l(Ss=>{"use strict";Object.defineProperty(Ss,"__esModule",{value:!0});Ss.AbstractAsyncHooksContextManager=void 0;var yA=z("events"),vA=["addListener","on","once","prependListener","prependOnceListener"],xu=class{constructor(){this._kOtListeners=Symbol("OtListeners"),this._wrapped=!1}bind(e,t){return t instanceof yA.EventEmitter?this._bindEventEmitter(e,t):typeof t=="function"?this._bindFunction(e,t):t}_bindFunction(e,t){let n=this,i=function(...s){return n.with(e,()=>t.apply(this,s))};return Object.defineProperty(i,"length",{enumerable:!1,configurable:!0,writable:!1,value:t.length}),i}_bindEventEmitter(e,t){return this._getPatchMap(t)!==void 0||(this._createPatchMap(t),vA.forEach(i=>{t[i]!==void 0&&(t[i]=this._patchAddListener(t,t[i],e))}),typeof t.removeListener=="function"&&(t.removeListener=this._patchRemoveListener(t,t.removeListener)),typeof t.off=="function"&&(t.off=this._patchRemoveListener(t,t.off)),typeof t.removeAllListeners=="function"&&(t.removeAllListeners=this._patchRemoveAllListeners(t,t.removeAllListeners))),t}_patchRemoveListener(e,t){let n=this;return function(i,s){var o;let a=(o=n._getPatchMap(e))===null||o===void 0?void 0:o[i];if(a===void 0)return t.call(this,i,s);let u=a.get(s);return t.call(this,i,u||s)}}_patchRemoveAllListeners(e,t){let n=this;return function(i){let s=n._getPatchMap(e);return s!==void 0&&(arguments.length===0?n._createPatchMap(e):s[i]!==void 0&&delete s[i]),t.apply(this,arguments)}}_patchAddListener(e,t,n){let i=this;return function(s,o){if(i._wrapped)return t.call(this,s,o);let a=i._getPatchMap(e);a===void 0&&(a=i._createPatchMap(e));let u=a[s];u===void 0&&(u=new WeakMap,a[s]=u);let c=i.bind(n,o);u.set(o,c),i._wrapped=!0;try{return t.call(this,s,c)}finally{i._wrapped=!1}}}_createPatchMap(e){let t=Object.create(null);return e[this._kOtListeners]=t,t}_getPatchMap(e){return e[this._kOtListeners]}};Ss.AbstractAsyncHooksContextManager=xu});var cp=l(As=>{"use strict";Object.defineProperty(As,"__esModule",{value:!0});As.AsyncLocalStorageContextManager=void 0;var IA=(h(),m(d)),MA=z("async_hooks"),LA=up(),Du=class extends LA.AbstractAsyncHooksContextManager{constructor(){super(),this._asyncLocalStorage=new MA.AsyncLocalStorage}active(){var e;return(e=this._asyncLocalStorage.getStore())!==null&&e!==void 0?e:IA.ROOT_CONTEXT}with(e,t,n,...i){let s=n==null?t:t.bind(n);return this._asyncLocalStorage.run(e,s,...i)}enable(){return this}disable(){return this._asyncLocalStorage.disable(),this}};As.AsyncLocalStorageContextManager=Du});var Ur=l(De=>{"use strict";Object.defineProperty(De,"__esModule",{value:!0});De.toAnyValue=De.toKeyValue=De.toAttributes=void 0;function UA(r){return Object.keys(r).map(e=>Vu(e,r[e]))}De.toAttributes=UA;function Vu(r,e){return{key:r,value:Gu(e)}}De.toKeyValue=Vu;function Gu(r){let e=typeof r;return e==="string"?{stringValue:r}:e==="number"?Number.isInteger(r)?{intValue:r}:{doubleValue:r}:e==="boolean"?{boolValue:r}:r instanceof Uint8Array?{bytesValue:r}:Array.isArray(r)?{arrayValue:{values:r.map(Gu)}}:e==="object"&&r!=null?{kvlistValue:{values:Object.entries(r).map(([t,n])=>Vu(t,n))}}:{}}De.toAnyValue=Gu});var wp=l(Ue=>{"use strict";Object.defineProperty(Ue,"__esModule",{value:!0});Ue.toOtlpSpanEvent=Ue.toOtlpLink=Ue.sdkSpanToOtlpSpan=void 0;var Hu=Ur();function BA(r,e){var t;let n=r.spanContext(),i=r.status;return{traceId:e.encodeSpanContext(n.traceId),spanId:e.encodeSpanContext(n.spanId),parentSpanId:e.encodeOptionalSpanContext(r.parentSpanId),traceState:(t=n.traceState)===null||t===void 0?void 0:t.serialize(),name:r.name,kind:r.kind==null?0:r.kind+1,startTimeUnixNano:e.encodeHrTime(r.startTime),endTimeUnixNano:e.encodeHrTime(r.endTime),attributes:(0,Hu.toAttributes)(r.attributes),droppedAttributesCount:r.droppedAttributesCount,events:r.events.map(s=>Cp(s,e)),droppedEventsCount:r.droppedEventsCount,status:{code:i.code,message:i.message},links:r.links.map(s=>Np(s,e)),droppedLinksCount:r.droppedLinksCount}}Ue.sdkSpanToOtlpSpan=BA;function Np(r,e){var t;return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],spanId:e.encodeSpanContext(r.context.spanId),traceId:e.encodeSpanContext(r.context.traceId),traceState:(t=r.context.traceState)===null||t===void 0?void 0:t.serialize(),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpLink=Np;function Cp(r,e){return{attributes:r.attributes?(0,Hu.toAttributes)(r.attributes):[],name:r.name,timeUnixNano:e.encodeHrTime(r.time),droppedAttributesCount:r.droppedAttributesCount||0}}Ue.toOtlpSpanEvent=Cp});var Br=l(oe=>{"use strict";Object.defineProperty(oe,"__esModule",{value:!0});oe.getOtlpEncoder=oe.encodeAsString=oe.encodeAsLongBits=oe.toLongBits=oe.hrTimeToNanos=void 0;var bs=A(),qA=BigInt(1e9);function ju(r){return BigInt(r[0])*qA+BigInt(r[1])}oe.hrTimeToNanos=ju;function Dp(r){let e=Number(BigInt.asUintN(32,r)),t=Number(BigInt.asUintN(32,r>>BigInt(32)));return{low:e,high:t}}oe.toLongBits=Dp;function Fu(r){let e=ju(r);return Dp(e)}oe.encodeAsLongBits=Fu;function Up(r){return ju(r).toString()}oe.encodeAsString=Up;var VA=typeof BigInt<"u"?Up:bs.hrTimeToNanoseconds;function xp(r){return r}function Bp(r){if(r!==void 0)return(0,bs.hexToBase64)(r)}var GA={encodeHrTime:Fu,encodeSpanContext:bs.hexToBase64,encodeOptionalSpanContext:Bp};function HA(r){var e,t;if(r===void 0)return GA;let n=(e=r.useLongBits)!==null&&e!==void 0?e:!0,i=(t=r.useHex)!==null&&t!==void 0?t:!1;return{encodeHrTime:n?Fu:VA,encodeSpanContext:i?xp:bs.hexToBase64,encodeOptionalSpanContext:i?xp:Bp}}oe.getOtlpEncoder=HA});var ys=l(Ps=>{"use strict";Object.defineProperty(Ps,"__esModule",{value:!0});Ps.createExportTraceServiceRequest=void 0;var jA=Ur(),FA=wp(),kA=Br();function $A(r,e){let t=(0,kA.getOtlpEncoder)(e);return{resourceSpans:KA(r,t)}}Ps.createExportTraceServiceRequest=$A;function XA(r){let e=new Map;for(let t of r){let n=e.get(t.resource);n||(n=new Map,e.set(t.resource,n));let i=`${t.instrumentationLibrary.name}@${t.instrumentationLibrary.version||""}:${t.instrumentationLibrary.schemaUrl||""}`,s=n.get(i);s||(s=[],n.set(i,s)),s.push(t)}return e}function KA(r,e){let t=XA(r),n=[],i=t.entries(),s=i.next();for(;!s.done;){let[o,a]=s.value,u=[],c=a.values(),_=c.next();for(;!_.done;){let f=_.value;if(f.length>0){let{name:M,version:R,schemaUrl:w}=f[0].instrumentationLibrary,U=f.map(S=>(0,FA.sdkSpanToOtlpSpan)(S,e));u.push({scope:{name:M,version:R},spans:U,schemaUrl:w})}_=c.next()}let p={resource:{attributes:(0,jA.toAttributes)(o.attributes),droppedAttributesCount:0},scopeSpans:u,schemaUrl:void 0};n.push(p),s=i.next()}return n}});var Gp=l(N=>{"use strict";Object.defineProperty(N,"__esModule",{value:!0});N.parseRetryAfterToMills=N.isExportRetryable=N.invalidTimeout=N.configureExporterTimeout=N.appendRootPathToUrlIfNeeded=N.appendResourcePathToUrl=N.parseHeaders=N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=N.DEFAULT_EXPORT_MAX_BACKOFF=N.DEFAULT_EXPORT_INITIAL_BACKOFF=N.DEFAULT_EXPORT_MAX_ATTEMPTS=void 0;var ku=(h(),m(d)),qp=A(),Vp=1e4;N.DEFAULT_EXPORT_MAX_ATTEMPTS=5;N.DEFAULT_EXPORT_INITIAL_BACKOFF=1e3;N.DEFAULT_EXPORT_MAX_BACKOFF=5e3;N.DEFAULT_EXPORT_BACKOFF_MULTIPLIER=1.5;function WA(r={}){let e={};return Object.entries(r).forEach(([t,n])=>{typeof n<"u"?e[t]=String(n):ku.diag.warn(`Header "${t}" has wrong value and will be ignored`)}),e}N.parseHeaders=WA;function zA(r,e){return r.endsWith("/")||(r=r+"/"),r+e}N.appendResourcePathToUrl=zA;function YA(r){try{let e=new URL(r);return e.pathname===""&&(e.pathname=e.pathname+"/"),e.toString()}catch{return ku.diag.warn(`Could not parse export URL: '${r}'`),r}}N.appendRootPathToUrlIfNeeded=YA;function QA(r){return typeof r=="number"?r<=0?$u(r,Vp):r:ZA()}N.configureExporterTimeout=QA;function ZA(){var r;let e=Number((r=(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TRACES_TIMEOUT)!==null&&r!==void 0?r:(0,qp.getEnv)().OTEL_EXPORTER_OTLP_TIMEOUT);return e<=0?$u(e,Vp):e}function $u(r,e){return ku.diag.warn("Timeout must be greater than 0",r),e}N.invalidTimeout=$u;function JA(r){return[429,502,503,504].includes(r)}N.isExportRetryable=JA;function eO(r){if(r==null)return-1;let e=Number.parseInt(r,10);if(Number.isInteger(e))return e>0?e*1e3:-1;let t=new Date(r).getTime()-Date.now();return t>=0?t:0}N.parseRetryAfterToMills=eO});var jp=l(vs=>{"use strict";Object.defineProperty(vs,"__esModule",{value:!0});vs.OTLPExporterBase=void 0;var Hp=(h(),m(d)),qr=A(),tO=Gp(),Xu=class{constructor(e={}){this._sendingPromises=[],this.url=this.getDefaultUrl(e),typeof e.hostname=="string"&&(this.hostname=e.hostname),this.shutdown=this.shutdown.bind(this),this._shutdownOnce=new qr.BindOnceFuture(this._shutdown,this),this._concurrencyLimit=typeof e.concurrencyLimit=="number"?e.concurrencyLimit:30,this.timeoutMillis=(0,tO.configureExporterTimeout)(e.timeoutMillis),this.onInit(e)}export(e,t){if(this._shutdownOnce.isCalled){t({code:qr.ExportResultCode.FAILED,error:new Error("Exporter has been shutdown")});return}if(this._sendingPromises.length>=this._concurrencyLimit){t({code:qr.ExportResultCode.FAILED,error:new Error("Concurrent export limit reached")});return}this._export(e).then(()=>{t({code:qr.ExportResultCode.SUCCESS})}).catch(n=>{t({code:qr.ExportResultCode.FAILED,error:n})})}_export(e){return new Promise((t,n)=>{try{Hp.diag.debug("items to be sent",e),this.send(e,t,n)}catch(i){n(i)}})}shutdown(){return this._shutdownOnce.call()}forceFlush(){return Promise.all(this._sendingPromises).then(()=>{})}_shutdown(){return Hp.diag.debug("shutdown started"),this.onShutdown(),this.forceFlush()}};vs.OTLPExporterBase=Xu});var Xp=l((Xy,$p)=>{"use strict";$p.exports=iO;function iO(r,e){for(var t=new Array(arguments.length-1),n=0,i=2,s=!0;i<arguments.length;)t[n++]=arguments[i++];return new Promise(function(a,u){t[n]=function(_){if(s)if(s=!1,_)u(_);else{for(var p=new Array(arguments.length-1),f=0;f<p.length;)p[f++]=arguments[f];a.apply(null,p)}};try{r.apply(e||null,t)}catch(c){s&&(s=!1,u(c))}})}});var Yp=l(zp=>{"use strict";var Ms=zp;Ms.length=function(e){var t=e.length;if(!t)return 0;for(var n=0;--t%4>1&&e.charAt(t)==="=";)++n;return Math.ceil(e.length*3)/4-n};var nr=new Array(64),Wp=new Array(123);for(le=0;le<64;)Wp[nr[le]=le<26?le+65:le<52?le+71:le<62?le-4:le-59|43]=le++;var le;Ms.encode=function(e,t,n){for(var i=null,s=[],o=0,a=0,u;t<n;){var c=e[t++];switch(a){case 0:s[o++]=nr[c>>2],u=(c&3)<<4,a=1;break;case 1:s[o++]=nr[u|c>>4],u=(c&15)<<2,a=2;break;case 2:s[o++]=nr[u|c>>6],s[o++]=nr[c&63],a=0;break}o>8191&&((i||(i=[])).push(String.fromCharCode.apply(String,s)),o=0)}return a&&(s[o++]=nr[u],s[o++]=61,a===1&&(s[o++]=61)),i?(o&&i.push(String.fromCharCode.apply(String,s.slice(0,o))),i.join("")):String.fromCharCode.apply(String,s.slice(0,o))};var Kp="invalid encoding";Ms.decode=function(e,t,n){for(var i=n,s=0,o,a=0;a<e.length;){var u=e.charCodeAt(a++);if(u===61&&s>1)break;if((u=Wp[u])===void 0)throw Error(Kp);switch(s){case 0:o=u,s=1;break;case 1:t[n++]=o<<2|(u&48)>>4,o=u,s=2;break;case 2:t[n++]=(o&15)<<4|(u&60)>>2,o=u,s=3;break;case 3:t[n++]=(o&3)<<6|u,s=0;break}}if(s===1)throw Error(Kp);return n-i};Ms.test=function(e){return/^(?:[A-Za-z0-9+/]{4})*(?:[A-Za-z0-9+/]{2}==|[A-Za-z0-9+/]{3}=)?$/.test(e)}});var Zp=l((Wy,Qp)=>{"use strict";Qp.exports=Ls;function Ls(){this._listeners={}}Ls.prototype.on=function(e,t,n){return(this._listeners[e]||(this._listeners[e]=[])).push({fn:t,ctx:n||this}),this};Ls.prototype.off=function(e,t){if(e===void 0)this._listeners={};else if(t===void 0)this._listeners[e]=[];else for(var n=this._listeners[e],i=0;i<n.length;)n[i].fn===t?n.splice(i,1):++i;return this};Ls.prototype.emit=function(e){var t=this._listeners[e];if(t){for(var n=[],i=1;i<arguments.length;)n.push(arguments[i++]);for(i=0;i<t.length;)t[i].fn.apply(t[i++].ctx,n)}return this}});var sh=l((zy,ih)=>{"use strict";ih.exports=Jp(Jp);function Jp(r){return typeof Float32Array<"u"?function(){var e=new Float32Array([-0]),t=new Uint8Array(e.buffer),n=t[3]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3]}function s(u,c,_){e[0]=u,c[_]=t[3],c[_+1]=t[2],c[_+2]=t[1],c[_+3]=t[0]}r.writeFloatLE=n?i:s,r.writeFloatBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],e[0]}function a(u,c){return t[3]=u[c],t[2]=u[c+1],t[1]=u[c+2],t[0]=u[c+3],e[0]}r.readFloatLE=n?o:a,r.readFloatBE=n?a:o}():function(){function e(n,i,s,o){var a=i<0?1:0;if(a&&(i=-i),i===0)n(1/i>0?0:2147483648,s,o);else if(isNaN(i))n(2143289344,s,o);else if(i>34028234663852886e22)n((a<<31|2139095040)>>>0,s,o);else if(i<11754943508222875e-54)n((a<<31|Math.round(i/1401298464324817e-60))>>>0,s,o);else{var u=Math.floor(Math.log(i)/Math.LN2),c=Math.round(i*Math.pow(2,-u)*8388608)&8388607;n((a<<31|u+127<<23|c)>>>0,s,o)}}r.writeFloatLE=e.bind(null,eh),r.writeFloatBE=e.bind(null,th);function t(n,i,s){var o=n(i,s),a=(o>>31)*2+1,u=o>>>23&255,c=o&8388607;return u===255?c?NaN:a*(1/0):u===0?a*1401298464324817e-60*c:a*Math.pow(2,u-150)*(c+8388608)}r.readFloatLE=t.bind(null,rh),r.readFloatBE=t.bind(null,nh)}(),typeof Float64Array<"u"?function(){var e=new Float64Array([-0]),t=new Uint8Array(e.buffer),n=t[7]===128;function i(u,c,_){e[0]=u,c[_]=t[0],c[_+1]=t[1],c[_+2]=t[2],c[_+3]=t[3],c[_+4]=t[4],c[_+5]=t[5],c[_+6]=t[6],c[_+7]=t[7]}function s(u,c,_){e[0]=u,c[_]=t[7],c[_+1]=t[6],c[_+2]=t[5],c[_+3]=t[4],c[_+4]=t[3],c[_+5]=t[2],c[_+6]=t[1],c[_+7]=t[0]}r.writeDoubleLE=n?i:s,r.writeDoubleBE=n?s:i;function o(u,c){return t[0]=u[c],t[1]=u[c+1],t[2]=u[c+2],t[3]=u[c+3],t[4]=u[c+4],t[5]=u[c+5],t[6]=u[c+6],t[7]=u[c+7],e[0]}function a(u,c){return t[7]=u[c],t[6]=u[c+1],t[5]=u[c+2],t[4]=u[c+3],t[3]=u[c+4],t[2]=u[c+5],t[1]=u[c+6],t[0]=u[c+7],e[0]}r.readDoubleLE=n?o:a,r.readDoubleBE=n?a:o}():function(){function e(n,i,s,o,a,u){var c=o<0?1:0;if(c&&(o=-o),o===0)n(0,a,u+i),n(1/o>0?0:2147483648,a,u+s);else if(isNaN(o))n(0,a,u+i),n(2146959360,a,u+s);else if(o>17976931348623157e292)n(0,a,u+i),n((c<<31|2146435072)>>>0,a,u+s);else{var _;if(o<22250738585072014e-324)_=o/5e-324,n(_>>>0,a,u+i),n((c<<31|_/4294967296)>>>0,a,u+s);else{var p=Math.floor(Math.log(o)/Math.LN2);p===1024&&(p=1023),_=o*Math.pow(2,-p),n(_*4503599627370496>>>0,a,u+i),n((c<<31|p+1023<<20|_*1048576&1048575)>>>0,a,u+s)}}}r.writeDoubleLE=e.bind(null,eh,0,4),r.writeDoubleBE=e.bind(null,th,4,0);function t(n,i,s,o,a){var u=n(o,a+i),c=n(o,a+s),_=(c>>31)*2+1,p=c>>>20&2047,f=4294967296*(c&1048575)+u;return p===2047?f?NaN:_*(1/0):p===0?_*5e-324*f:_*Math.pow(2,p-1075)*(f+4503599627370496)}r.readDoubleLE=t.bind(null,rh,0,4),r.readDoubleBE=t.bind(null,nh,4,0)}(),r}function eh(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}function th(r,e,t){e[t]=r>>>24,e[t+1]=r>>>16&255,e[t+2]=r>>>8&255,e[t+3]=r&255}function rh(r,e){return(r[e]|r[e+1]<<8|r[e+2]<<16|r[e+3]<<24)>>>0}function nh(r,e){return(r[e]<<24|r[e+1]<<16|r[e+2]<<8|r[e+3])>>>0}});var oh=l((exports,module)=>{"use strict";module.exports=inquire;function inquire(moduleName){try{var mod=eval("quire".replace(/^/,"re"))(moduleName);if(mod&&(mod.length||Object.keys(mod).length))return mod}catch(r){}return null}});var uh=l(ah=>{"use strict";var Wu=ah;Wu.length=function(e){for(var t=0,n=0,i=0;i<e.length;++i)n=e.charCodeAt(i),n<128?t+=1:n<2048?t+=2:(n&64512)===55296&&(e.charCodeAt(i+1)&64512)===56320?(++i,t+=4):t+=3;return t};Wu.read=function(e,t,n){var i=n-t;if(i<1)return"";for(var s=null,o=[],a=0,u;t<n;)u=e[t++],u<128?o[a++]=u:u>191&&u<224?o[a++]=(u&31)<<6|e[t++]&63:u>239&&u<365?(u=((u&7)<<18|(e[t++]&63)<<12|(e[t++]&63)<<6|e[t++]&63)-65536,o[a++]=55296+(u>>10),o[a++]=56320+(u&1023)):o[a++]=(u&15)<<12|(e[t++]&63)<<6|e[t++]&63,a>8191&&((s||(s=[])).push(String.fromCharCode.apply(String,o)),a=0);return s?(a&&s.push(String.fromCharCode.apply(String,o.slice(0,a))),s.join("")):String.fromCharCode.apply(String,o.slice(0,a))};Wu.write=function(e,t,n){for(var i=n,s,o,a=0;a<e.length;++a)s=e.charCodeAt(a),s<128?t[n++]=s:s<2048?(t[n++]=s>>6|192,t[n++]=s&63|128):(s&64512)===55296&&((o=e.charCodeAt(a+1))&64512)===56320?(s=65536+((s&1023)<<10)+(o&1023),++a,t[n++]=s>>18|240,t[n++]=s>>12&63|128,t[n++]=s>>6&63|128,t[n++]=s&63|128):(t[n++]=s>>12|224,t[n++]=s>>6&63|128,t[n++]=s&63|128);return n-i}});var lh=l((Qy,ch)=>{"use strict";ch.exports=sO;function sO(r,e,t){var n=t||8192,i=n>>>1,s=null,o=n;return function(u){if(u<1||u>i)return r(u);o+u>n&&(s=r(n),o=0);var c=e.call(s,o,o+=u);return o&7&&(o=(o|7)+1),c}}});var _h=l((Zy,dh)=>{"use strict";dh.exports=V;var Vr=qe();function V(r,e){this.lo=r>>>0,this.hi=e>>>0}var ct=V.zero=new V(0,0);ct.toNumber=function(){return 0};ct.zzEncode=ct.zzDecode=function(){return this};ct.length=function(){return 1};var oO=V.zeroHash="\0\0\0\0\0\0\0\0";V.fromNumber=function(e){if(e===0)return ct;var t=e<0;t&&(e=-e);var n=e>>>0,i=(e-n)/4294967296>>>0;return t&&(i=~i>>>0,n=~n>>>0,++n>4294967295&&(n=0,++i>4294967295&&(i=0))),new V(n,i)};V.from=function(e){if(typeof e=="number")return V.fromNumber(e);if(Vr.isString(e))if(Vr.Long)e=Vr.Long.fromString(e);else return V.fromNumber(parseInt(e,10));return e.low||e.high?new V(e.low>>>0,e.high>>>0):ct};V.prototype.toNumber=function(e){if(!e&&this.hi>>>31){var t=~this.lo+1>>>0,n=~this.hi>>>0;return t||(n=n+1>>>0),-(t+n*4294967296)}return this.lo+this.hi*4294967296};V.prototype.toLong=function(e){return Vr.Long?new Vr.Long(this.lo|0,this.hi|0,!!e):{low:this.lo|0,high:this.hi|0,unsigned:!!e}};var Be=String.prototype.charCodeAt;V.fromHash=function(e){return e===oO?ct:new V((Be.call(e,0)|Be.call(e,1)<<8|Be.call(e,2)<<16|Be.call(e,3)<<24)>>>0,(Be.call(e,4)|Be.call(e,5)<<8|Be.call(e,6)<<16|Be.call(e,7)<<24)>>>0)};V.prototype.toHash=function(){return String.fromCharCode(this.lo&255,this.lo>>>8&255,this.lo>>>16&255,this.lo>>>24,this.hi&255,this.hi>>>8&255,this.hi>>>16&255,this.hi>>>24)};V.prototype.zzEncode=function(){var e=this.hi>>31;return this.hi=((this.hi<<1|this.lo>>>31)^e)>>>0,this.lo=(this.lo<<1^e)>>>0,this};V.prototype.zzDecode=function(){var e=-(this.lo&1);return this.lo=((this.lo>>>1|this.hi<<31)^e)>>>0,this.hi=(this.hi>>>1^e)>>>0,this};V.prototype.length=function(){var e=this.lo,t=(this.lo>>>28|this.hi<<4)>>>0,n=this.hi>>>24;return n===0?t===0?e<16384?e<128?1:2:e<2097152?3:4:t<16384?t<128?5:6:t<2097152?7:8:n<128?9:10}});var qe=l(zu=>{"use strict";var E=zu;E.asPromise=Xp();E.base64=Yp();E.EventEmitter=Zp();E.float=sh();E.inquire=oh();E.utf8=uh();E.pool=lh();E.LongBits=_h();E.isNode=!!(typeof global<"u"&&global&&global.process&&global.process.versions&&global.process.versions.node);E.global=E.isNode&&global||typeof window<"u"&&window||typeof self<"u"&&self||zu;E.emptyArray=Object.freeze?Object.freeze([]):[];E.emptyObject=Object.freeze?Object.freeze({}):{};E.isInteger=Number.isInteger||function(e){return typeof e=="number"&&isFinite(e)&&Math.floor(e)===e};E.isString=function(e){return typeof e=="string"||e instanceof String};E.isObject=function(e){return e&&typeof e=="object"};E.isset=E.isSet=function(e,t){var n=e[t];return n!=null&&e.hasOwnProperty(t)?typeof n!="object"||(Array.isArray(n)?n.length:Object.keys(n).length)>0:!1};E.Buffer=function(){try{var r=E.inquire("buffer").Buffer;return r.prototype.utf8Write?r:null}catch{return null}}();E._Buffer_from=null;E._Buffer_allocUnsafe=null;E.newBuffer=function(e){return typeof e=="number"?E.Buffer?E._Buffer_allocUnsafe(e):new E.Array(e):E.Buffer?E._Buffer_from(e):typeof Uint8Array>"u"?e:new Uint8Array(e)};E.Array=typeof Uint8Array<"u"?Uint8Array:Array;E.Long=E.global.dcodeIO&&E.global.dcodeIO.Long||E.global.Long||E.inquire("long");E.key2Re=/^true|false|0|1$/;E.key32Re=/^-?(?:0|[1-9][0-9]*)$/;E.key64Re=/^(?:[\\x00-\\xff]{8}|-?(?:0|[1-9][0-9]*))$/;E.longToHash=function(e){return e?E.LongBits.from(e).toHash():E.LongBits.zeroHash};E.longFromHash=function(e,t){var n=E.LongBits.fromHash(e);return E.Long?E.Long.fromBits(n.lo,n.hi,t):n.toNumber(!!t)};function ph(r,e,t){for(var n=Object.keys(e),i=0;i<n.length;++i)(r[n[i]]===void 0||!t)&&(r[n[i]]=e[n[i]]);return r}E.merge=ph;E.lcFirst=function(e){return e.charAt(0).toLowerCase()+e.substring(1)};function hh(r){function e(t,n){if(!(this instanceof e))return new e(t,n);Object.defineProperty(this,"message",{get:function(){return t}}),Error.captureStackTrace?Error.captureStackTrace(this,e):Object.defineProperty(this,"stack",{value:new Error().stack||""}),n&&ph(this,n)}return e.prototype=Object.create(Error.prototype,{constructor:{value:e,writable:!0,enumerable:!1,configurable:!0},name:{get:function(){return r},set:void 0,enumerable:!1,configurable:!0},toString:{value:function(){return this.name+": "+this.message},writable:!0,enumerable:!1,configurable:!0}}),e}E.newError=hh;E.ProtocolError=hh("ProtocolError");E.oneOfGetter=function(e){for(var t={},n=0;n<e.length;++n)t[e[n]]=1;return function(){for(var i=Object.keys(this),s=i.length-1;s>-1;--s)if(t[i[s]]===1&&this[i[s]]!==void 0&&this[i[s]]!==null)return i[s]}};E.oneOfSetter=function(e){return function(t){for(var n=0;n<e.length;++n)e[n]!==t&&delete this[e[n]]}};E.toJSONOptions={longs:String,enums:String,bytes:String,json:!0};E._configure=function(){var r=E.Buffer;if(!r){E._Buffer_from=E._Buffer_allocUnsafe=null;return}E._Buffer_from=r.from!==Uint8Array.from&&r.from||function(t,n){return new r(t,n)},E._Buffer_allocUnsafe=r.allocUnsafe||function(t){return new r(t)}}});var rc=l((ev,gh)=>{"use strict";gh.exports=O;var ae=qe(),Yu,Ns=ae.LongBits,fh=ae.base64,Eh=ae.utf8;function Gr(r,e,t){this.fn=r,this.len=e,this.next=void 0,this.val=t}function Zu(){}function aO(r){this.head=r.head,this.tail=r.tail,this.len=r.len,this.next=r.states}function O(){this.len=0,this.head=new Gr(Zu,0,0),this.tail=this.head,this.states=null}var mh=function(){return ae.Buffer?function(){return(O.create=function(){return new Yu})()}:function(){return new O}};O.create=mh();O.alloc=function(e){return new ae.Array(e)};ae.Array!==Array&&(O.alloc=ae.pool(O.alloc,ae.Array.prototype.subarray));O.prototype._push=function(e,t,n){return this.tail=this.tail.next=new Gr(e,t,n),this.len+=t,this};function Ju(r,e,t){e[t]=r&255}function uO(r,e,t){for(;r>127;)e[t++]=r&127|128,r>>>=7;e[t]=r}function ec(r,e){this.len=r,this.next=void 0,this.val=e}ec.prototype=Object.create(Gr.prototype);ec.prototype.fn=uO;O.prototype.uint32=function(e){return this.len+=(this.tail=this.tail.next=new ec((e=e>>>0)<128?1:e<16384?2:e<2097152?3:e<268435456?4:5,e)).len,this};O.prototype.int32=function(e){return e<0?this._push(tc,10,Ns.fromNumber(e)):this.uint32(e)};O.prototype.sint32=function(e){return this.uint32((e<<1^e>>31)>>>0)};function tc(r,e,t){for(;r.hi;)e[t++]=r.lo&127|128,r.lo=(r.lo>>>7|r.hi<<25)>>>0,r.hi>>>=7;for(;r.lo>127;)e[t++]=r.lo&127|128,r.lo=r.lo>>>7;e[t++]=r.lo}O.prototype.uint64=function(e){var t=Ns.from(e);return this._push(tc,t.length(),t)};O.prototype.int64=O.prototype.uint64;O.prototype.sint64=function(e){var t=Ns.from(e).zzEncode();return this._push(tc,t.length(),t)};O.prototype.bool=function(e){return this._push(Ju,1,e?1:0)};function Qu(r,e,t){e[t]=r&255,e[t+1]=r>>>8&255,e[t+2]=r>>>16&255,e[t+3]=r>>>24}O.prototype.fixed32=function(e){return this._push(Qu,4,e>>>0)};O.prototype.sfixed32=O.prototype.fixed32;O.prototype.fixed64=function(e){var t=Ns.from(e);return this._push(Qu,4,t.lo)._push(Qu,4,t.hi)};O.prototype.sfixed64=O.prototype.fixed64;O.prototype.float=function(e){return this._push(ae.float.writeFloatLE,4,e)};O.prototype.double=function(e){return this._push(ae.float.writeDoubleLE,8,e)};var cO=ae.Array.prototype.set?function(e,t,n){t.set(e,n)}:function(e,t,n){for(var i=0;i<e.length;++i)t[n+i]=e[i]};O.prototype.bytes=function(e){var t=e.length>>>0;if(!t)return this._push(Ju,1,0);if(ae.isString(e)){var n=O.alloc(t=fh.length(e));fh.decode(e,n,0),e=n}return this.uint32(t)._push(cO,t,e)};O.prototype.string=function(e){var t=Eh.length(e);return t?this.uint32(t)._push(Eh.write,t,e):this._push(Ju,1,0)};O.prototype.fork=function(){return this.states=new aO(this),this.head=this.tail=new Gr(Zu,0,0),this.len=0,this};O.prototype.reset=function(){return this.states?(this.head=this.states.head,this.tail=this.states.tail,this.len=this.states.len,this.states=this.states.next):(this.head=this.tail=new Gr(Zu,0,0),this.len=0),this};O.prototype.ldelim=function(){var e=this.head,t=this.tail,n=this.len;return this.reset().uint32(n),n&&(this.tail.next=e.next,this.tail=t,this.len+=n),this};O.prototype.finish=function(){for(var e=this.head.next,t=this.constructor.alloc(this.len),n=0;e;)e.fn(e.val,t,n),n+=e.len,e=e.next;return t};O._configure=function(r){Yu=r,O.create=mh(),Yu._configure()}});var Ah=l((tv,Sh)=>{"use strict";Sh.exports=ge;var Th=rc();(ge.prototype=Object.create(Th.prototype)).constructor=ge;var Ve=qe();function ge(){Th.call(this)}ge._configure=function(){ge.alloc=Ve._Buffer_allocUnsafe,ge.writeBytesBuffer=Ve.Buffer&&Ve.Buffer.prototype instanceof Uint8Array&&Ve.Buffer.prototype.set.name==="set"?function(e,t,n){t.set(e,n)}:function(e,t,n){if(e.copy)e.copy(t,n,0,e.length);else for(var i=0;i<e.length;)t[n++]=e[i++]}};ge.prototype.bytes=function(e){Ve.isString(e)&&(e=Ve._Buffer_from(e,"base64"));var t=e.length>>>0;return this.uint32(t),t&&this._push(ge.writeBytesBuffer,t,e),this};function lO(r,e,t){r.length<40?Ve.utf8.write(r,e,t):e.utf8Write?e.utf8Write(r,t):e.write(r,t)}ge.prototype.string=function(e){var t=Ve.Buffer.byteLength(e);return this.uint32(t),t&&this._push(lO,t,e),this};ge._configure()});var sc=l((rv,yh)=>{"use strict";yh.exports=x;var de=qe(),ic,bh=de.LongBits,dO=de.utf8;function _e(r,e){return RangeError("index out of range: "+r.pos+" + "+(e||1)+" > "+r.len)}function x(r){this.buf=r,this.pos=0,this.len=r.length}var Oh=typeof Uint8Array<"u"?function(e){if(e instanceof Uint8Array||Array.isArray(e))return new x(e);throw Error("illegal buffer")}:function(e){if(Array.isArray(e))return new x(e);throw Error("illegal buffer")},Ph=function(){return de.Buffer?function(t){return(x.create=function(i){return de.Buffer.isBuffer(i)?new ic(i):Oh(i)})(t)}:Oh};x.create=Ph();x.prototype._slice=de.Array.prototype.subarray||de.Array.prototype.slice;x.prototype.uint32=function(){var e=4294967295;return function(){if(e=(this.buf[this.pos]&127)>>>0,this.buf[this.pos++]<128||(e=(e|(this.buf[this.pos]&127)<<7)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<14)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&127)<<21)>>>0,this.buf[this.pos++]<128)||(e=(e|(this.buf[this.pos]&15)<<28)>>>0,this.buf[this.pos++]<128))return e;if((this.pos+=5)>this.len)throw this.pos=this.len,_e(this,10);return e}}();x.prototype.int32=function(){return this.uint32()|0};x.prototype.sint32=function(){var e=this.uint32();return e>>>1^-(e&1)|0};function nc(){var r=new bh(0,0),e=0;if(this.len-this.pos>4){for(;e<4;++e)if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r;if(r.lo=(r.lo|(this.buf[this.pos]&127)<<28)>>>0,r.hi=(r.hi|(this.buf[this.pos]&127)>>4)>>>0,this.buf[this.pos++]<128)return r;e=0}else{for(;e<3;++e){if(this.pos>=this.len)throw _e(this);if(r.lo=(r.lo|(this.buf[this.pos]&127)<<e*7)>>>0,this.buf[this.pos++]<128)return r}return r.lo=(r.lo|(this.buf[this.pos++]&127)<<e*7)>>>0,r}if(this.len-this.pos>4){for(;e<5;++e)if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}else for(;e<5;++e){if(this.pos>=this.len)throw _e(this);if(r.hi=(r.hi|(this.buf[this.pos]&127)<<e*7+3)>>>0,this.buf[this.pos++]<128)return r}throw Error("invalid varint encoding")}x.prototype.bool=function(){return this.uint32()!==0};function Cs(r,e){return(r[e-4]|r[e-3]<<8|r[e-2]<<16|r[e-1]<<24)>>>0}x.prototype.fixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)};x.prototype.sfixed32=function(){if(this.pos+4>this.len)throw _e(this,4);return Cs(this.buf,this.pos+=4)|0};function Rh(){if(this.pos+8>this.len)throw _e(this,8);return new bh(Cs(this.buf,this.pos+=4),Cs(this.buf,this.pos+=4))}x.prototype.float=function(){if(this.pos+4>this.len)throw _e(this,4);var e=de.float.readFloatLE(this.buf,this.pos);return this.pos+=4,e};x.prototype.double=function(){if(this.pos+8>this.len)throw _e(this,4);var e=de.float.readDoubleLE(this.buf,this.pos);return this.pos+=8,e};x.prototype.bytes=function(){var e=this.uint32(),t=this.pos,n=this.pos+e;if(n>this.len)throw _e(this,e);if(this.pos+=e,Array.isArray(this.buf))return this.buf.slice(t,n);if(t===n){var i=de.Buffer;return i?i.alloc(0):new this.buf.constructor(0)}return this._slice.call(this.buf,t,n)};x.prototype.string=function(){var e=this.bytes();return dO.read(e,0,e.length)};x.prototype.skip=function(e){if(typeof e=="number"){if(this.pos+e>this.len)throw _e(this,e);this.pos+=e}else do if(this.pos>=this.len)throw _e(this);while(this.buf[this.pos++]&128);return this};x.prototype.skipType=function(r){switch(r){case 0:this.skip();break;case 1:this.skip(8);break;case 2:this.skip(this.uint32());break;case 3:for(;(r=this.uint32()&7)!==4;)this.skipType(r);break;case 5:this.skip(4);break;default:throw Error("invalid wire type "+r+" at offset "+this.pos)}return this};x._configure=function(r){ic=r,x.create=Ph(),ic._configure();var e=de.Long?"toLong":"toNumber";de.merge(x.prototype,{int64:function(){return nc.call(this)[e](!1)},uint64:function(){return nc.call(this)[e](!0)},sint64:function(){return nc.call(this).zzDecode()[e](!1)},fixed64:function(){return Rh.call(this)[e](!0)},sfixed64:function(){return Rh.call(this)[e](!1)}})}});var Lh=l((nv,Mh)=>{"use strict";Mh.exports=lt;var Ih=sc();(lt.prototype=Object.create(Ih.prototype)).constructor=lt;var vh=qe();function lt(r){Ih.call(this,r)}lt._configure=function(){vh.Buffer&&(lt.prototype._slice=vh.Buffer.prototype.slice)};lt.prototype.string=function(){var e=this.uint32();return this.buf.utf8Slice?this.buf.utf8Slice(this.pos,this.pos=Math.min(this.pos+e,this.len)):this.buf.toString("utf-8",this.pos,this.pos=Math.min(this.pos+e,this.len))};lt._configure()});var Ch=l((iv,Nh)=>{"use strict";Nh.exports=Hr;var oc=qe();(Hr.prototype=Object.create(oc.EventEmitter.prototype)).constructor=Hr;function Hr(r,e,t){if(typeof r!="function")throw TypeError("rpcImpl must be a function");oc.EventEmitter.call(this),this.rpcImpl=r,this.requestDelimited=!!e,this.responseDelimited=!!t}Hr.prototype.rpcCall=function r(e,t,n,i,s){if(!i)throw TypeError("request must be specified");var o=this;if(!s)return oc.asPromise(r,o,e,t,n,i);if(!o.rpcImpl){setTimeout(function(){s(Error("already ended"))},0);return}try{return o.rpcImpl(e,t[o.requestDelimited?"encodeDelimited":"encode"](i).finish(),function(u,c){if(u)return o.emit("error",u,e),s(u);if(c===null){o.end(!0);return}if(!(c instanceof n))try{c=n[o.responseDelimited?"decodeDelimited":"decode"](c)}catch(_){return o.emit("error",_,e),s(_)}return o.emit("data",c,e),s(null,c)})}catch(a){o.emit("error",a,e),setTimeout(function(){s(a)},0);return}};Hr.prototype.end=function(e){return this.rpcImpl&&(e||this.rpcImpl(null,null,null),this.rpcImpl=null,this.emit("end").off()),this}});var xh=l(wh=>{"use strict";var _O=wh;_O.Service=Ch()});var Uh=l((ov,Dh)=>{"use strict";Dh.exports={}});var Vh=l(qh=>{"use strict";var J=qh;J.build="minimal";J.Writer=rc();J.BufferWriter=Ah();J.Reader=sc();J.BufferReader=Lh();J.util=qe();J.rpc=xh();J.roots=Uh();J.configure=Bh;function Bh(){J.util._configure(),J.Writer._configure(J.BufferWriter),J.Reader._configure(J.BufferReader)}Bh()});var Hh=l((uv,Gh)=>{"use strict";Gh.exports=Vh()});var Qh=l(Yh=>{"use strict";Object.defineProperty(Yh,"__esModule",{value:!0})});var Jh=l(Zh=>{"use strict";Object.defineProperty(Zh,"__esModule",{value:!0})});var tf=l(ef=>{"use strict";Object.defineProperty(ef,"__esModule",{value:!0})});var rf=l(Fr=>{"use strict";Object.defineProperty(Fr,"__esModule",{value:!0});Fr.ESpanKind=void 0;var NO;(function(r){r[r.SPAN_KIND_UNSPECIFIED=0]="SPAN_KIND_UNSPECIFIED",r[r.SPAN_KIND_INTERNAL=1]="SPAN_KIND_INTERNAL",r[r.SPAN_KIND_SERVER=2]="SPAN_KIND_SERVER",r[r.SPAN_KIND_CLIENT=3]="SPAN_KIND_CLIENT",r[r.SPAN_KIND_PRODUCER=4]="SPAN_KIND_PRODUCER",r[r.SPAN_KIND_CONSUMER=5]="SPAN_KIND_CONSUMER"})(NO=Fr.ESpanKind||(Fr.ESpanKind={}))});var sf=l(nf=>{"use strict";Object.defineProperty(nf,"__esModule",{value:!0})});var lf=l(Ge=>{"use strict";Object.defineProperty(Ge,"__esModule",{value:!0});Ge.toMetric=Ge.toScopeMetrics=Ge.toResourceMetrics=void 0;var of=(h(),m(d)),or=wu(),Ds=Ur(),CO=Br();function wO(r,e){let t=(0,CO.getOtlpEncoder)(e);return{resource:{attributes:(0,Ds.toAttributes)(r.resource.attributes),droppedAttributesCount:0},schemaUrl:void 0,scopeMetrics:uf(r.scopeMetrics,t)}}Ge.toResourceMetrics=wO;function uf(r,e){return Array.from(r.map(t=>({scope:{name:t.scope.name,version:t.scope.version},metrics:t.metrics.map(n=>cf(n,e)),schemaUrl:t.scope.schemaUrl})))}Ge.toScopeMetrics=uf;function cf(r,e){let t={name:r.descriptor.name,description:r.descriptor.description,unit:r.descriptor.unit},n=BO(r.aggregationTemporality);switch(r.dataPointType){case or.DataPointType.SUM:t.sum={aggregationTemporality:n,isMonotonic:r.isMonotonic,dataPoints:af(r,e)};break;case or.DataPointType.GAUGE:t.gauge={dataPoints:af(r,e)};break;case or.DataPointType.HISTOGRAM:t.histogram={aggregationTemporality:n,dataPoints:DO(r,e)};break;case or.DataPointType.EXPONENTIAL_HISTOGRAM:t.exponentialHistogram={aggregationTemporality:n,dataPoints:UO(r,e)};break}return t}Ge.toMetric=cf;function xO(r,e,t){let n={attributes:(0,Ds.toAttributes)(r.attributes),startTimeUnixNano:t.encodeHrTime(r.startTime),timeUnixNano:t.encodeHrTime(r.endTime)};switch(e){case of.ValueType.INT:n.asInt=r.value;break;case of.ValueType.DOUBLE:n.asDouble=r.value;break}return n}function af(r,e){return r.dataPoints.map(t=>xO(t,r.descriptor.valueType,e))}function DO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),bucketCounts:n.buckets.counts,explicitBounds:n.buckets.boundaries,count:n.count,sum:n.sum,min:n.min,max:n.max,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function UO(r,e){return r.dataPoints.map(t=>{let n=t.value;return{attributes:(0,Ds.toAttributes)(t.attributes),count:n.count,min:n.min,max:n.max,sum:n.sum,positive:{offset:n.positive.offset,bucketCounts:n.positive.bucketCounts},negative:{offset:n.negative.offset,bucketCounts:n.negative.bucketCounts},scale:n.scale,zeroCount:n.zeroCount,startTimeUnixNano:e.encodeHrTime(t.startTime),timeUnixNano:e.encodeHrTime(t.endTime)}})}function BO(r){switch(r){case or.AggregationTemporality.DELTA:return 1;case or.AggregationTemporality.CUMULATIVE:return 2}}});var df=l(Us=>{"use strict";Object.defineProperty(Us,"__esModule",{value:!0});Us.createExportMetricsServiceRequest=void 0;var qO=lf();function VO(r,e){return{resourceMetrics:r.map(t=>(0,qO.toResourceMetrics)(t,e))}}Us.createExportMetricsServiceRequest=VO});var pf=l(ar=>{"use strict";Object.defineProperty(ar,"__esModule",{value:!0});ar.toLogAttributes=ar.createExportLogsServiceRequest=void 0;var GO=Br(),lc=Ur();function HO(r,e){let t=(0,GO.getOtlpEncoder)(e);return{resourceLogs:FO(r,t)}}ar.createExportLogsServiceRequest=HO;function jO(r){let e=new Map;for(let t of r){let{resource:n,instrumentationScope:{name:i,version:s="",schemaUrl:o=""}}=t,a=e.get(n);a||(a=new Map,e.set(n,a));let u=`${i}@${s}:${o}`,c=a.get(u);c||(c=[],a.set(u,c)),c.push(t)}return e}function FO(r,e){let t=jO(r);return Array.from(t,([n,i])=>({resource:{attributes:(0,lc.toAttributes)(n.attributes),droppedAttributesCount:0},scopeLogs:Array.from(i,([,s])=>{let{instrumentationScope:{name:o,version:a,schemaUrl:u}}=s[0];return{scope:{name:o,version:a},logRecords:s.map(c=>kO(c,e)),schemaUrl:u}}),schemaUrl:void 0}))}function kO(r,e){var t,n,i;return{timeUnixNano:e.encodeHrTime(r.hrTime),observedTimeUnixNano:e.encodeHrTime(r.hrTimeObserved),severityNumber:r.severityNumber,severityText:r.severityText,body:(0,lc.toAnyValue)(r.body),attributes:_f(r.attributes),droppedAttributesCount:r.droppedAttributesCount,flags:(t=r.spanContext)===null||t===void 0?void 0:t.traceFlags,traceId:e.encodeOptionalSpanContext((n=r.spanContext)===null||n===void 0?void 0:n.traceId),spanId:e.encodeOptionalSpanContext((i=r.spanContext)===null||i===void 0?void 0:i.spanId)}}function _f(r){return Object.keys(r).map(e=>(0,lc.toKeyValue)(e,r[e]))}ar.toLogAttributes=_f});var hf=l(G=>{"use strict";var $O=G&&G.__createBinding||(Object.create?function(r,e,t,n){n===void 0&&(n=t),Object.defineProperty(r,n,{enumerable:!0,get:function(){return e[t]}})}:function(r,e,t,n){n===void 0&&(n=t),r[n]=e[t]}),ur=G&&G.__exportStar||function(r,e){for(var t in r)t!=="default"&&!Object.prototype.hasOwnProperty.call(e,t)&&$O(e,r,t)};Object.defineProperty(G,"__esModule",{value:!0});G.createExportLogsServiceRequest=G.createExportMetricsServiceRequest=G.createExportTraceServiceRequest=void 0;ur(Qh(),G);ur(Br(),G);ur(Jh(),G);ur(tf(),G);ur(rf(),G);ur(sf(),G);var XO=ys();Object.defineProperty(G,"createExportTraceServiceRequest",{enumerable:!0,get:function(){return XO.createExportTraceServiceRequest}});var KO=df();Object.defineProperty(G,"createExportMetricsServiceRequest",{enumerable:!0,get:function(){return KO.createExportMetricsServiceRequest}});var WO=pf();Object.defineProperty(G,"createExportLogsServiceRequest",{enumerable:!0,get:function(){return WO.createExportLogsServiceRequest}})});var C=Y(la(),1);h();fa();var Sf=Y(Gd(),1),lr=Y(rt(),1),Af=Y(r_(),1),Of=Y(wu(),1),Gs=Y(Qr(),1),Rf=Y(cp(),1),He=Y(A(),1);h();var NA=Symbol.for("@vercel/request-context");function se(){return globalThis[NA]?.get()}var lp="http.method",dp="http.url",Os="http.host",_p="http.scheme",Uu="http.status_code",pp="http.user_agent",Bu="http.response_content_length_uncompressed",hp="net.peer.port",fp="net.peer.name",Ep="cloud.region";var mp="deployment.environment.name",gp="deployment.id";var Tp="process.runtime.name",Sp="vcs.ref.head.name",Ap="vcs.ref.head.revision",Op="vcs.repository.name",Rp="vcs.repository.ref.revision";var bp="service.name",Pp="service.version";function qu(r){return Object.fromEntries(Object.entries(r).filter(([e,t])=>t!==void 0))}function vp({attributes:r,env:e=process.env,runtime:t,serviceName:n}){let i=e.VERCEL_ENV||e.NEXT_PUBLIC_VERCEL_ENV,s=e.VERCEL_DEPLOYMENT_ID,o=e.VERCEL_GIT_COMMIT_SHA||e.NEXT_PUBLIC_VERCEL_GIT_COMMIT_SHA,a=e.VERCEL_REGION,u=e.VERCEL_GIT_COMMIT_REF,c=e.VERCEL_URL||e.NEXT_PUBLIC_VERCEL_URL||void 0,_=e.VERCEL_BRANCH_URL||e.NEXT_PUBLIC_VERCEL_BRANCH_URL||void 0,p=e.VERCEL_GIT_REPO_SLUG;return qu({[bp]:n,"node.ci":e.CI?!0:void 0,"node.env":e.NODE_ENV,[mp]:i,env:i,[Ep]:a,"vercel.region":a,[Tp]:t,"vercel.runtime":t,[Sp]:u,[Ap]:o,[Op]:p,[Rp]:o,"vercel.sha":o,"vercel.host":c,"vercel.branch_host":_,[gp]:s,"vercel.deployment_id":s,[Pp]:s,"vercel.project_id":e.VERCEL_PROJECT_ID||void 0,...r})}function Ip(r){return r?r.split("::").at(-1):void 0}function Mp(r=se(),e){if(!r)return;let t=e?wA(e,r.headers):void 0;return qu({[Os]:r.headers.host,[pp]:r.headers["user-agent"],"http.referer":r.headers.referer,"vercel.request_id":Ip(r.headers["x-vercel-id"]),"vercel.matched_path":r.headers["x-matched-path"],"vercel.edge_region":process.env.VERCEL_REGION,...t})}var CA={keys(r){return[]},get(r,e){return r[e.toLocaleLowerCase()]}};function wA(r,e){if(typeof r=="function")return r(e,CA);let t={};for(let[n,i]of Object.entries(r)){let s=e[i.toLocaleLowerCase()];s!==void 0&&(t[n]=s)}return t}h();function er(r){return(r&d.TraceFlags.SAMPLED)!==0}var Rs=class{constructor(e,t){this.processors=e;this.attributesFromHeaders=t;this.rootSpanIds=new Map;this.waitSpanEnd=new Map}forceFlush(){return Promise.all(this.processors.map(e=>e.forceFlush().catch(t=>{d.diag.error("@vercel/otel: forceFlush failed:",t)}))).then(()=>{})}shutdown(){return Promise.all(this.processors.map(e=>e.shutdown().catch(()=>{}))).then(()=>{})}onStart(e,t){let{traceId:n,spanId:i,traceFlags:s}=e.spanContext(),o=!e.parentSpanId||!this.rootSpanIds.has(n);if(o?this.rootSpanIds.set(n,{rootSpanId:i,open:[]}):this.rootSpanIds.get(n)?.open.push(e),o&&er(s)){let a=se(),u=Mp(a,this.attributesFromHeaders);u&&e.setAttributes(u),a&&a.waitUntil(async()=>{if(this.rootSpanIds.has(n)){let c=new Promise(p=>{this.waitSpanEnd.set(n,p)}),_;await Promise.race([c,new Promise(p=>{_=setTimeout(()=>{this.waitSpanEnd.delete(n),p(void 0)},50)})]),_&&clearTimeout(_)}return this.forceFlush()})}for(let a of this.processors)a.onStart(e,t)}onEnd(e){let{traceId:t,spanId:n,traceFlags:i}=e.spanContext(),s=er(i),o=this.rootSpanIds.get(t),a=o?.rootSpanId===n;if(s){let u=DA(e);u&&Object.assign(e.attributes,u)}if(a){if(this.rootSpanIds.delete(t),o.open.length>0){for(let u of o.open)if(!u.ended&&u.spanContext().spanId!==n)try{u.end()}catch(c){d.diag.error("@vercel/otel: onEnd failed:",c)}}}else if(o)for(let u=0;u<o.open.length;u++)o.open[u]?.spanContext().spanId===n&&o.open.splice(u,1);for(let u of this.processors)u.onEnd(e);if(a){let u=this.waitSpanEnd.get(t);u&&(this.waitSpanEnd.delete(t),u())}}},xA={[d.SpanKind.INTERNAL]:"internal",[d.SpanKind.SERVER]:"server",[d.SpanKind.CLIENT]:"client",[d.SpanKind.PRODUCER]:"producer",[d.SpanKind.CONSUMER]:"consumer"};function DA(r){let{kind:e,attributes:t}=r,{"operation.name":n,"resource.name":i,"span.type":s,"next.span_type":o,"http.method":a,"http.route":u}=t;if(n)return;let c=i??(a&&typeof a=="string"&&u&&typeof u=="string"?`${a} ${u}`:u);if(r.kind===d.SpanKind.SERVER&&a&&u&&typeof a=="string"&&typeof u=="string")return{"operation.name":"web.request","resource.name":c};let _=r.instrumentationLibrary.name,p=o??s;if(p&&typeof p=="string"){let f=Lp(_,p);return u?{"operation.name":f,"resource.name":c}:{"operation.name":f}}return{"operation.name":Lp(_,e===d.SpanKind.INTERNAL?"":xA[e])}}function Lp(r,e){if(!r)return e;let t=r.replace(/[ @./]/g,"_");return t.startsWith("_")&&(t=t.slice(1)),e?`${t}.${e}`:t}var kp=Y(ys(),1);var Fp=Y(jp(),1);h();var tr=class extends Fp.OTLPExporterBase{constructor(e={}){super(e),e.headers&&(this._headers=e.headers)}onShutdown(){d.diag.debug("@vercel/otel/otlp: onShutdown")}onInit(){d.diag.debug("@vercel/otel/otlp: onInit")}send(e,t,n){if(this._shutdownOnce.isCalled){d.diag.debug("@vercel/otel/otlp: Shutdown already started. Cannot send objects");return}let i=this.convert(e),s,o,a;try{({body:s,contentType:o,headers:a}=this.toMessage(i))}catch(c){d.diag.warn("@vercel/otel/otlp: no proto",c);return}let u=fetch(this.url,{method:"POST",body:s,headers:{...this._headers,...a,"Content-Type":o,"User-Agent":"OTel-OTLP-Exporter-JavaScript/0.46.0"},next:{internal:!0}}).then(c=>{d.diag.debug("@vercel/otel/otlp: onSuccess",c.status,c.statusText),t(),c.arrayBuffer().catch(()=>{})}).catch(c=>{d.diag.error("@vercel/otel/otlp: onError",c),n(c)}).finally(()=>{let c=this._sendingPromises.indexOf(u);this._sendingPromises.splice(c,1)});this._sendingPromises.push(u)}getDefaultUrl(e){throw new Error("Method not implemented.")}};var rO="v1/traces",nO=`http://localhost:4318/${rO}`;function Is(r){return typeof r.url=="string"?r.url:nO}var rr=class{constructor(e={}){this.impl=new Ku(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},Ku=class extends tr{convert(e){return(0,kp.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1})}toMessage(e){return{body:JSON.stringify(e),contentType:"application/json"}}getDefaultUrl(e){return Is(e)}};var $h=Y(ys(),1);var jh=Y(Hh(),1);function Fh(r){let e=new jh.Writer;return pO(r,e),e.finish()}function pO(r,e){if(r.resourceSpans!=null&&r.resourceSpans.length)for(let t=0;t<r.resourceSpans.length;++t)hO(r.resourceSpans[t],e.uint32(10).fork()).ldelim();return e}function hO(r,e){if(r.resource!=null&&fO(r.resource,e.uint32(10).fork()).ldelim(),r.scopeSpans!=null&&r.scopeSpans.length)for(let t=0;t<r.scopeSpans.length;++t)EO(r.scopeSpans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function fO(r,e){if(r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(10).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(16).uint32(r.droppedAttributesCount),e}function EO(r,e){if(r.scope!=null&&TO(r.scope,e.uint32(10).fork()).ldelim(),r.spans!=null&&r.spans.length)for(let t=0;t<r.spans.length;++t)SO(r.spans[t],e.uint32(18).fork()).ldelim();return r.schemaUrl!=null&&e.uint32(26).string(r.schemaUrl),e}function ir(r,e){return r.key!=null&&e.uint32(10).string(r.key),r.value!=null&&kh(r.value,e.uint32(18).fork()).ldelim(),e}function kh(r,e){return r.stringValue!=null&&e.uint32(10).string(r.stringValue),r.boolValue!=null&&e.uint32(16).bool(r.boolValue),r.intValue!=null&&e.uint32(24).int64(r.intValue),r.doubleValue!=null&&e.uint32(33).double(r.doubleValue),r.arrayValue!=null&&mO(r.arrayValue,e.uint32(42).fork()).ldelim(),r.kvlistValue!=null&&gO(r.kvlistValue,e.uint32(50).fork()).ldelim(),r.bytesValue!=null&&e.uint32(58).bytes(r.bytesValue),e}function mO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)kh(r.values[t],e.uint32(10).fork()).ldelim();return e}function gO(r,e){if(r.values!=null&&r.values.length)for(let t=0;t<r.values.length;++t)ir(r.values[t],e.uint32(10).fork()).ldelim();return e}function TO(r,e){if(r.name!=null&&e.uint32(10).string(r.name),r.version!=null&&e.uint32(18).string(r.version),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function SO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.parentSpanId!=null&&e.uint32(34).bytes(r.parentSpanId),r.name!=null&&e.uint32(42).string(r.name),r.kind!=null&&e.uint32(48).int32(r.kind),r.startTimeUnixNano!=null&&e.uint32(57).fixed64(r.startTimeUnixNano),r.endTimeUnixNano!=null&&e.uint32(65).fixed64(r.endTimeUnixNano),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(74).fork()).ldelim();if(r.droppedAttributesCount!=null&&e.uint32(80).uint32(r.droppedAttributesCount),r.events!=null&&r.events.length)for(let t=0;t<r.events.length;++t)OO(r.events[t],e.uint32(90).fork()).ldelim();if(r.droppedEventsCount!=null&&e.uint32(96).uint32(r.droppedEventsCount),r.links!=null&&r.links.length)for(let t=0;t<r.links.length;++t)RO(r.links[t],e.uint32(106).fork()).ldelim();return r.droppedLinksCount!=null&&e.uint32(112).uint32(r.droppedLinksCount),r.status!=null&&AO(r.status,e.uint32(122).fork()).ldelim(),e}function AO(r,e){return r.message!=null&&e.uint32(18).string(r.message),r.code!=null&&e.uint32(24).int32(r.code),e}function OO(r,e){if(r.timeUnixNano!=null&&e.uint32(9).fixed64(r.timeUnixNano),r.name!=null&&e.uint32(18).string(r.name),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(26).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(32).uint32(r.droppedAttributesCount),e}function RO(r,e){if(r.traceId!=null&&e.uint32(10).bytes(r.traceId),r.spanId!=null&&e.uint32(18).bytes(r.spanId),r.traceState!=null&&e.uint32(26).string(r.traceState),r.attributes!=null&&r.attributes.length)for(let t=0;t<r.attributes.length;++t)ir(r.attributes[t],e.uint32(34).fork()).ldelim();return r.droppedAttributesCount!=null&&e.uint32(40).uint32(r.droppedAttributesCount),e}var dt=class{constructor(e={}){this.impl=new ac(e)}export(e,t){this.impl.export(e,t)}shutdown(){return this.impl.shutdown()}forceFlush(){return this.impl.forceFlush()}},ac=class extends tr{convert(e){return(0,$h.createExportTraceServiceRequest)(e,void 0)}toMessage(e){return{body:Fh(e),contentType:"application/x-protobuf",headers:{accept:"application/x-protobuf"}}}getDefaultUrl(e){return Is(e)}};h();function Xh(r,e){return r.replace(/\{(?<temp1>[^{}]+)\}/g,(t,n)=>{let i=e[n];return i!==void 0?String(i):t})}var sr=class{constructor(e={}){this.instrumentationName="@vercel/otel/fetch";this.instrumentationVersion="1.0.0";this.config=e}getConfig(){return this.config}setConfig(){}setTracerProvider(e){this.tracerProvider=e}setMeterProvider(){}shouldIgnore(e,t){let n=this.config.ignoreUrls??[];if(t?.opentelemetry?.ignore!==void 0)return t.opentelemetry.ignore;if(n.length===0)return!1;let i=e.toString();return n.some(s=>typeof s=="string"?s==="*"?!0:i.startsWith(s):s.test(i))}shouldPropagate(e,t){let n=process.env.VERCEL_URL||process.env.NEXT_PUBLIC_VERCEL_URL||null,i=process.env.VERCEL_BRANCH_URL||process.env.NEXT_PUBLIC_VERCEL_BRANCH_URL||null,s=this.config.propagateContextUrls??[],o=this.config.dontPropagateContextUrls??[];if(t?.opentelemetry?.propagateContext)return t.opentelemetry.propagateContext;let a=e.toString();return o.length>0&&o.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))?!1:n&&e.protocol==="https:"&&(e.host===n||e.host===i||e.host===se()?.headers.host)||!n&&e.protocol==="http:"&&e.hostname==="localhost"?!0:s.some(u=>typeof u=="string"?u==="*"?!0:a.startsWith(u):u.test(a))}startSpan({tracer:e,url:t,fetchType:n,method:i="GET",name:s,attributes:o={}}){let a=this.config.resourceNameTemplate,u={[lp]:i,[dp]:t.toString(),[Os]:t.host,[_p]:t.protocol.replace(":",""),[fp]:t.hostname,[hp]:t.port},c=a?Xh(a,u):yO(t.toString()),_=s??`${n} ${i} ${t.toString()}`,p=d.context.active();return e.startSpan(_,{kind:d.SpanKind.CLIENT,attributes:{...u,"operation.name":`${n}.${i}`,"http.client.name":n,"resource.name":c,...o}},p)}instrumentHttp(e,t){let{tracerProvider:n}=this;if(!n)return;let i=n.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:s,attributesFromResponseHeaders:o}=this.config,a=e.request,u=e.get,c=_=>(p,f,M)=>{let R,w={},U;if(typeof p=="string"||p instanceof URL?(R=new URL(p.toString()),typeof f=="function"?U=f:f&&typeof M=="function"?(w=f,U=M):f&&(w=f)):(w=p,typeof f=="function"&&(U=f),R=IO(w,t)),this.shouldIgnore(R))return _.apply(this,[R,w,U]);let S=this.startSpan({tracer:i,url:R,fetchType:"http",method:w.method||"GET"});if(!S.isRecording()||!er(S.spanContext().traceFlags))return S.end(),_.apply(this,[R,w,U]);if(this.shouldPropagate(R)){let Te=d.context.active(),Se=d.trace.setSpan(Te,S);d.propagation.inject(Se,w.headers||{},PO)}s&&ws(S,s,w.headers||{},Wh);try{let Te=Date.now(),Se=_.apply(this,[R,w,U]);return Se.prependListener("response",W=>{let pt=Date.now()-Te;S.setAttribute("http.response_time",pt),W.statusCode!==void 0?(S.setAttribute(Uu,W.statusCode),W.statusCode>=500&&_t(S,`Status: ${W.statusCode}`)):_t(S,"Response status code is undefined"),o&&ws(S,o,W.headers,Wh),Se.listenerCount("response")<=1&&W.resume(),W.on("end",()=>{let $r,Hs=W.statusCode;W.aborted&&!W.complete?$r={code:d.SpanStatusCode.ERROR}:Hs&&Hs>=100&&Hs<500?$r={code:d.SpanStatusCode.UNSET}:$r={code:d.SpanStatusCode.ERROR},S.setStatus($r),S.isRecording()&&(W.headers["content-length"]&&S.setAttribute(Bu,W.headers["content-length"]),S.end())})}),Se.on("error",W=>{S.isRecording()&&(_t(S,W),S.end())}),Se.on("close",()=>{S.isRecording()&&S.end()}),Se}catch(Te){throw _t(S,Te),S.end(),Te}};e.request=c(a),e.get=c(u)}instrumentFetch(){let{tracerProvider:e}=this;if(!e)return;let t=e.getTracer(this.instrumentationName,this.instrumentationVersion),{attributesFromRequestHeaders:n,attributesFromResponseHeaders:i}=this.config;process.env.NEXT_OTEL_FETCH_DISABLED="1";let s=globalThis.fetch;this.originalFetch=s;let o=async(a,u)=>{let c=u;if(c?.next?.internal)return s(a,c);let _=new Request(a instanceof Request?a.clone():a,c),p=new URL(_.url);if(this.shouldIgnore(p,c))return s(a,c);let f=this.startSpan({tracer:t,url:p,fetchType:"fetch",method:_.method,name:c?.opentelemetry?.spanName,attributes:c?.opentelemetry?.attributes});if(!f.isRecording()||!er(f.spanContext().traceFlags))return f.end(),s(a,c);if(this.shouldPropagate(p,c)){let M=d.context.active(),R=d.trace.setSpan(M,f);d.propagation.inject(R,_.headers,bO)}n&&ws(f,n,_.headers,Kh);try{let M=Date.now();c?.body&&c.body instanceof FormData&&_.headers.delete("content-type");let R=await s(a,{...c,headers:_.headers}),w=Date.now()-M;return f.setAttribute(Uu,R.status),f.setAttribute("http.response_time",w),i&&ws(f,i,R.headers,Kh),R.status>=500&&_t(f,`Status: ${R.status} (${R.statusText})`),R.body?vO(R).then(U=>{f.isRecording()&&(f.setAttribute(Bu,U),f.end())},U=>{f.isRecording()&&(_t(f,U),f.end())}):f.end(),R}catch(M){throw _t(f,M),f.end(),M}};globalThis.fetch=o}enable(){this.disable(),this.instrumentFetch();try{let e=z("node:http"),t=z("node:https");this.instrumentHttp(e,"http:"),this.instrumentHttp(t,"https:")}catch{}}disable(){this.originalFetch&&(globalThis.fetch=this.originalFetch)}},bO={set(r,e,t){r.set(e,t)}},Kh={get(r,e){let t=r.get(e);if(t!==null)return t.includes(",")?t.split(",").map(n=>n.trimStart()):t},keys(r){let e=[];return r.forEach((t,n)=>{e.push(n)}),e}},PO={set(r,e,t){r[e.toLowerCase()]=t}},Wh={get(r,e){return r[e.toLowerCase()]},keys(r){return Object.keys(r)}};function yO(r){let e=r.indexOf("?");return e===-1?r:r.substring(0,e)}function vO(r){let e=0,n=r.clone().body?.getReader();if(!n)return Promise.resolve(0);let i=()=>n.read().then(({done:s,value:o})=>{if(!s)return e+=o.byteLength,i()});return i().then(()=>e)}function _t(r,e){if(e instanceof Error)r.recordException(e),r.setStatus({code:d.SpanStatusCode.ERROR,message:e.message});else{let t=String(e);r.setStatus({code:d.SpanStatusCode.ERROR,message:t})}}function ws(r,e,t,n){for(let[i,s]of Object.entries(e)){let o=n.get(t,s);o!==void 0&&r.setAttribute(i,o)}}function IO(r,e){if(r.socketPath)throw new Error("Cannot construct a network URL: options.socketPath is specified, indicating a Unix domain socket.");let t=r.protocol??e;t&&!t.endsWith(":")&&(t+=":");let n=r.hostname,i=r.port??r.defaultPort;if(!n&&r.host){let c=r.host.split(":");n=c[0];let _=c[1];if(c.length>1&&_&&i===void 0){let p=parseInt(_,10);isNaN(p)||(i=p)}}n||(n="localhost");let s;if(i!==void 0&&i!==""){let c=parseInt(String(i),10);isNaN(c)?s=t==="https:"?443:80:s=c}else s=t==="https:"?443:80;let o=r.path||"/",a=`${t}//${n}:${s}`,u=new URL(o,a);if(r.auth){let c=r.auth.split(":");u.username=decodeURIComponent(c[0]||""),c.length>1&&(u.password=decodeURIComponent(c[1]||""))}return u}h();var zh=Y(A(),1),MO="00",uc="traceparent",cc="tracestate",jr=class{fields(){return[uc,cc]}inject(e,t,n){let i=d.trace.getSpanContext(e);if(!i||(0,zh.isTracingSuppressed)(e)||!(0,d.isSpanContextValid)(i))return;let s=`${MO}-${i.traceId}-${i.spanId}-0${Number(i.traceFlags||0).toString(16)}`;n.set(t,uc,s),i.traceState&&n.set(t,cc,i.traceState.serialize())}extract(e,t,n){let i=n.get(t,uc);if(!i)return e;let s=Array.isArray(i)?i[0]:i;if(typeof s!="string")return e;let o=LO(s);if(!o)return e;o.isRemote=!0;let a=n.get(t,cc);if(a){let u=Array.isArray(a)?a.join(","):a;o.traceState=(0,d.createTraceState)(typeof u=="string"?u:void 0)}return d.trace.setSpanContext(e,o)}};function LO(r){let[e,t,n,i,s]=r.split("-");return!e||!t||!n||!i||e.length!==2||t.length!==32||n.length!==16||i.length!==2||e==="00"&&s?null:{traceId:t,spanId:n,traceFlags:parseInt(i,16)}}h();var xs=class{fields(){return[]}inject(){}extract(e){let t=se();if(!t?.telemetry)return d.diag.warn("@vercel/otel: Vercel telemetry extension not found."),e;let{rootSpanContext:n}=t.telemetry;return n?(d.diag.debug("@vercel/otel: Extracted root SpanContext from Vercel request context.",n),d.trace.setSpanContext(e,{...n,isRemote:!0,traceFlags:n.traceFlags||d.TraceFlags.SAMPLED})):e}};h();var Bs=Y(A(),1),ff=Y(hf(),1);var qs=class{export(e,t){let n=se();if(!n?.telemetry){d.diag.warn("@vercel/otel: no telemetry context found"),t({code:Bs.ExportResultCode.SUCCESS,error:void 0});return}try{let i=(0,ff.createExportTraceServiceRequest)(e,{useHex:!0,useLongBits:!1});n.telemetry.reportSpans(i),t({code:Bs.ExportResultCode.SUCCESS,error:void 0})}catch(i){t({code:Bs.ExportResultCode.FAILED,error:i instanceof Error?i:new Error(String(i))})}}shutdown(){return Promise.resolve()}forceFlush(){return Promise.resolve()}};h();function dc(){return!!se()?.telemetry?.traceDrains?.length}var Ef=!1,zO=1e4,kr=class{constructor(e){this.processor=e;this.drainedSpanKeys=new Set}forceFlush(){return this.processor.forceFlush()}shutdown(){return this.processor.shutdown()}onStart(e,t){if(dc()){let n=mf(e);if(this.drainedSpanKeys.size>=zO){let i=this.drainedSpanKeys.values().next();i.done||this.drainedSpanKeys.delete(i.value)}this.drainedSpanKeys.add(n),Ef||(Ef=!0,d.diag.debug("@vercel/otel: skipping automatic exporter due to configured trace drains"));return}this.processor.onStart(e,t)}onEnd(e){let t=mf(e);this.drainedSpanKeys.delete(t)||dc()||this.processor.onEnd(e)}};function mf(r){let{traceId:e,spanId:t}=r.spanContext();return`${e}:${t}`}var YO={ALL:d.DiagLogLevel.ALL,VERBOSE:d.DiagLogLevel.VERBOSE,DEBUG:d.DiagLogLevel.DEBUG,INFO:d.DiagLogLevel.INFO,WARN:d.DiagLogLevel.WARN,ERROR:d.DiagLogLevel.ERROR,NONE:d.DiagLogLevel.NONE},Vs=class{constructor(e={}){this.configuration=e}start(){let e=QO(),t=this.configuration,n=process.env.NEXT_RUNTIME||"nodejs",i=!!e.OTEL_SDK_DISABLED;if(process.env.OTEL_LOG_LEVEL&&d.diag.setLogger(new d.DiagConsoleLogger,{logLevel:YO[process.env.OTEL_LOG_LEVEL.toUpperCase()]}),i)return;let s=t.idGenerator??new C.RandomIdGenerator,o=t.contextManager??new Rf.AsyncLocalStorageContextManager;o.enable(),this.contextManager=o;let a=e.OTEL_SERVICE_NAME||t.serviceName||"app",u=new lr.Resource(vp({attributes:t.attributes,runtime:n,serviceName:a})),c=t.resourceDetectors??[lr.envDetectorSync];if(t.autoDetectResources??!0){let S={detectors:c};u=u.merge((0,lr.detectResourcesSync)(S))}let p=JO(t.propagators,t,e),f=eR(t.traceSampler,e),M=tR(t.spanProcessors,t,e);M.length===0&&d.diag.warn("@vercel/otel: No span processors configured. No spans will be exported.");let R=t.spanLimits,w=new C.BasicTracerProvider({resource:u,idGenerator:s,sampler:f,spanLimits:R});if(w.addSpanProcessor(new Rs(M,t.attributesFromHeaders)),w.register({contextManager:o,propagator:new He.CompositePropagator({propagators:p})}),this.tracerProvider=w,t.logRecordProcessor){let S=new Af.LoggerProvider({resource:u});this.loggerProvider=S,S.addLogRecordProcessor(t.logRecordProcessor),st.logs.setGlobalLoggerProvider(S)}if(t.metricReader||t.views){let S=new Of.MeterProvider({resource:u,views:t.views??[]});t.metricReader&&S.addMetricReader(t.metricReader),d.metrics.setGlobalMeterProvider(S),this.meterProvider=S}let U=ZO(t.instrumentations,t.instrumentationConfig);this.disableInstrumentations=(0,Sf.registerInstrumentations)({instrumentations:U}),d.diag.info("@vercel/otel: started",a,n)}async shutdown(){let e=[];this.tracerProvider&&e.push(this.tracerProvider.shutdown()),this.loggerProvider&&e.push(this.loggerProvider.shutdown()),this.meterProvider&&e.push(this.meterProvider.shutdown()),d.diag.info("@vercel/otel: shutting down",e.length,process.env.NEXT_RUNTIME),await Promise.all(e),this.contextManager&&this.contextManager.disable();let{disableInstrumentations:t}=this;t&&t()}};function QO(){let r=(0,Gs.parseEnvironment)(process.env);return{...Gs.DEFAULT_ENVIRONMENT,...r}}function ZO(r,e){return(r??["auto"]).map(t=>t==="auto"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),[new sr(e?.fetch)]):t==="fetch"?(d.diag.debug("@vercel/otel: Configure instrumentations: fetch",e?.fetch),new sr(e?.fetch)):t).flat()}function JO(r,e,t){let n=process.env.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS&&t.OTEL_PROPAGATORS.length>0?t.OTEL_PROPAGATORS:void 0;return(r??n??["auto"]).map(i=>{if(i==="none")return[];if(i==="auto"){let s=[];return s.push({name:"tracecontext",propagator:new jr}),s.push({name:"baggage",propagator:new He.W3CBaggagePropagator}),s.push({name:"vercel-runtime",propagator:new xs}),d.diag.debug(`@vercel/otel: Configure propagators: ${s.map(o=>o.name).join(", ")}`),s.map(o=>o.propagator)}if(i==="tracecontext")return d.diag.debug("@vercel/otel: Configure propagator: tracecontext"),new jr;if(i==="baggage")return d.diag.debug("@vercel/otel: Configure propagator: baggage"),new He.W3CBaggagePropagator;if(typeof i=="string")throw new Error(`Unknown propagator: "${i}"`);return i}).flat()}var gf="always_on",cr=1;function eR(r,e){if(r&&typeof r!="string")return r;let t=r&&r!=="auto"?r:e.OTEL_TRACES_SAMPLER||gf;switch(d.diag.debug("@vercel/otel: Configure sampler: ",t),t){case"always_on":return new C.AlwaysOnSampler;case"always_off":return new C.AlwaysOffSampler;case"parentbased_always_on":return new C.ParentBasedSampler({root:new C.AlwaysOnSampler});case"parentbased_always_off":return new C.ParentBasedSampler({root:new C.AlwaysOffSampler});case"traceidratio":return new C.TraceIdRatioBasedSampler(Tf(e));case"parentbased_traceidratio":return new C.ParentBasedSampler({root:new C.TraceIdRatioBasedSampler(Tf(e))});default:return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER value "${String(e.OTEL_TRACES_SAMPLER)} invalid, defaulting to ${gf}".`),new C.AlwaysOnSampler}}function Tf(r){if(r.OTEL_TRACES_SAMPLER_ARG===void 0||r.OTEL_TRACES_SAMPLER_ARG==="")return d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG is blank, defaulting to ${cr}.`),cr;d.diag.debug("@vercel/otel: Configure sampler probability: ",r.OTEL_TRACES_SAMPLER_ARG);let e=Number(r.OTEL_TRACES_SAMPLER_ARG);return isNaN(e)?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is invalid, defaulting to ${cr}.`),cr):e<0||e>1?(d.diag.error(`@vercel/otel: OTEL_TRACES_SAMPLER_ARG=${r.OTEL_TRACES_SAMPLER_ARG} was given, but it is out of range ([0..1]), defaulting to ${cr}.`),cr):e}function tR(r,e,t){return[...(r??["auto"]).flatMap(n=>{if(n==="auto"){let i=[new C.BatchSpanProcessor(new qs)];if(process.env.VERCEL_OTEL_ENDPOINTS){let s=process.env.VERCEL_OTEL_ENDPOINTS_PORT||"4318",o=process.env.VERCEL_OTEL_ENDPOINTS_PROTOCOL||"http/protobuf";d.diag.debug("@vercel/otel: Configure vercel otel collector on port: ",s,o);let a={url:`http://localhost:${s}/v1/traces`,headers:{}},u=o==="http/protobuf"?new dt(a):new rr(a);i.push(new kr(new C.BatchSpanProcessor(u)))}else(!e.traceExporter||e.traceExporter==="auto"||t.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT||t.OTEL_EXPORTER_OTLP_ENDPOINT)&&i.push(new kr(new C.BatchSpanProcessor(rR(t))));return i}return n}).filter(sR),...e.traceExporter&&e.traceExporter!=="auto"?[new C.BatchSpanProcessor(e.traceExporter)]:[]]}function rR(r){let e=process.env.OTEL_EXPORTER_OTLP_TRACES_PROTOCOL??process.env.OTEL_EXPORTER_OTLP_PROTOCOL??"http/protobuf",t=iR(r),n={...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_HEADERS),...He.baggageUtils.parseKeyPairsIntoRecord(r.OTEL_EXPORTER_OTLP_TRACES_HEADERS)};switch(d.diag.debug("@vercel/otel: Configure trace exporter: ",e,t,`headers: ${Object.keys(n).join(",")||"<none>"}`),e){case"http/json":return new rr({url:t,headers:n});case"http/protobuf":return new dt({url:t,headers:n});default:return d.diag.warn(`@vercel/otel: Unsupported OTLP traces protocol: ${e}. Using http/protobuf.`),new dt}}var bf="v1/traces",nR=`http://localhost:4318/${bf}`;function iR(r){let e=r.OTEL_EXPORTER_OTLP_TRACES_ENDPOINT;if(e&&typeof e=="string")return e;let t=r.OTEL_EXPORTER_OTLP_ENDPOINT;return t&&typeof t=="string"?`${t}/${bf}`:nR}function sR(r){return r!=null}function tI(r){let e;r?typeof r=="string"?e={serviceName:r}:e=r:e={},new Vs(e).start()}export{sr as FetchInstrumentation,rr as OTLPHttpJsonTraceExporter,dt as OTLPHttpProtoTraceExporter,tI as registerOTel};
|
|
21
21
|
//# sourceMappingURL=index.js.map
|