@tanagram/lore 0.1.133 → 0.1.134

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.
Files changed (2) hide show
  1. package/dist/index.js +4 -4
  2. package/package.json +2 -2
package/dist/index.js CHANGED
@@ -1,6 +1,6 @@
1
1
  #!/usr/bin/env node
2
2
  import { createRequire } from 'node:module';const require = createRequire(import.meta.url);
3
- var Xqe=Object.create;var HP=Object.defineProperty;var e7e=Object.getOwnPropertyDescriptor;var t7e=Object.getOwnPropertyNames;var n7e=Object.getPrototypeOf,r7e=Object.prototype.hasOwnProperty;var Ge=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),za=(e,t)=>{for(var n in t)HP(e,n,{get:t[n],enumerable:!0})},hle=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of t7e(t))!r7e.call(e,o)&&o!==n&&HP(e,o,{get:()=>t[o],enumerable:!(r=e7e(t,o))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Xqe(n7e(e)):{},hle(t||!e||!e.__esModule?HP(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>hle(HP({},"__esModule",{value:!0}),e);var m=O(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.133"}}catch{}})()});var Xm,c$=O(()=>{m();Xm="1.9.1"});function o7e(e){let t=new Set([e]),n=new Set,r=e.match(Sle);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(d){return d===e};function i(c){return n.add(c),!1}function a(c){return t.add(c),!0}return function(d){if(t.has(d))return!0;if(n.has(d))return!1;let g=d.match(Sle);if(!g)return i(d);let h={major:+g[1],minor:+g[2],patch:+g[3],prerelease:g[4]};return h.prerelease!=null||o.major!==h.major?i(d):o.major===0?o.minor===h.minor&&o.patch<=h.patch?a(d):i(d):o.minor<=h.minor?a(d):i(d)}}var Sle,yle,Tle=O(()=>{m();c$();Sle=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;yle=o7e(Xm)});function iA(e,t,n,r=!1){var o;let i=Y1[q1]=(o=Y1[q1])!==null&&o!==void 0?o:{version:Xm};if(!r&&i[e]){let a=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(a.stack||a.message),!1}if(i.version!==Xm){let a=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Xm}`);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Xm}.`),!0}function Cl(e){var t,n;let r=(t=Y1[q1])===null||t===void 0?void 0:t.version;if(!(!r||!yle(r)))return(n=Y1[q1])===null||n===void 0?void 0:n[e]}function aA(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Xm}.`);let n=Y1[q1];n&&delete n[e]}var i7e,q1,Y1,IS=O(()=>{m();c$();Tle();i7e=Xm.split(".")[0],q1=Symbol.for(`opentelemetry.js.api.${i7e}`),Y1=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function K1(e,t,n){let r=Cl("diag");if(r)return r[e](t,...n)}var zP,Ile=O(()=>{m();IS();zP=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return K1("debug",this._namespace,t)}error(...t){return K1("error",this._namespace,t)}info(...t){return K1("info",this._namespace,t)}warn(...t){return K1("warn",this._namespace,t)}verbose(...t){return K1("verbose",this._namespace,t)}}});var ha,$P=O(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(ha||(ha={}))});function Cle(e,t){e<ha.NONE?e=ha.NONE:e>ha.ALL&&(e=ha.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",ha.ERROR),warn:n("warn",ha.WARN),info:n("info",ha.INFO),debug:n("debug",ha.DEBUG),verbose:n("verbose",ha.VERBOSE)}}var ble=O(()=>{m();$P()});var a7e,$a,CS=O(()=>{m();Ile();ble();$P();IS();a7e="diag",$a=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let a=Cl("diag");if(a)return a[o](...i)}}let n=this,r=(o,i={logLevel:ha.INFO})=>{var a,c,d;if(o===n){let S=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=S.stack)!==null&&a!==void 0?a:S.message),!1}typeof i=="number"&&(i={logLevel:i});let g=Cl("diag"),h=Cle((c=i.logLevel)!==null&&c!==void 0?c:ha.INFO,o);if(g&&!i.suppressOverrideMessage){let S=(d=new Error().stack)!==null&&d!==void 0?d:"<failed to generate stacktrace>";g.warn(`Current logger will be overwritten from ${S}`),h.warn(`Current logger will overwrite one already registered from ${S}`)}return iA("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{aA(a7e,n)},n.createComponentLogger=o=>new zP(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var VP,vle=O(()=>{m();VP=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var Rle,xle=O(()=>{m();Rle=Symbol("BaggageEntryMetadata")});function Dle(e={}){return new VP(new Map(Object.entries(e)))}function Ble(e){return typeof e!="string"&&(s7e.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Rle,toString(){return e}}}var s7e,l$=O(()=>{m();CS();vle();xle();s7e=$a.instance()});function bl(e){return Symbol.for(e)}var d$,QC,J1=O(()=>{m();d$=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},QC=new d$});var p$,f$,qP,Nle=O(()=>{m();p$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],f$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(f$[t]=console[t])}qP=class{constructor(){function t(n){return function(...r){let o=f$[n];if(typeof o!="function"&&(o=f$.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<p$.length;n++)this[p$[n].n]=t(p$[n].c)}}});function Ole(){return T$}var A$,FC,m$,g$,h$,_$,Z1,E$,S$,y$,T$,u7e,c7e,l7e,d7e,p7e,f7e,A7e,I$=O(()=>{m();A$=class{constructor(){}createGauge(t,n){return c7e}createHistogram(t,n){return l7e}createCounter(t,n){return u7e}createUpDownCounter(t,n){return d7e}createObservableGauge(t,n){return f7e}createObservableCounter(t,n){return p7e}createObservableUpDownCounter(t,n){return A7e}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},FC=class{},m$=class extends FC{add(t,n){}},g$=class extends FC{add(t,n){}},h$=class extends FC{record(t,n){}},_$=class extends FC{record(t,n){}},Z1=class{addCallback(t){}removeCallback(t){}},E$=class extends Z1{},S$=class extends Z1{},y$=class extends Z1{},T$=new A$,u7e=new m$,c7e=new h$,l7e=new _$,d7e=new g$,p7e=new E$,f7e=new S$,A7e=new y$});var YP,wle=O(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(YP||(YP={}))});var KP,JP,C$=O(()=>{m();KP={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},JP={set(e,t,n){e!=null&&(e[t]=n)}}});var ZP,kle=O(()=>{m();J1();ZP=class{active(){return QC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var b$,m7e,sA,W1=O(()=>{m();kle();IS();CS();b$="context",m7e=new ZP,sA=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return iA(b$,t,$a.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return Cl(b$)||m7e}disable(){this._getContextManager().disable(),aA(b$,$a.instance())}}});var Ks,v$=O(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Ks||(Ks={}))});var X1,bS,WP,XP=O(()=>{m();v$();X1="0000000000000000",bS="00000000000000000000000000000000",WP={traceId:bS,spanId:X1,traceFlags:Ks.NONE}});var uA,e2=O(()=>{m();XP();uA=class{constructor(t=WP){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function t2(e){return e.getValue(R$)||void 0}function Mle(){return t2(sA.getInstance().active())}function eB(e,t){return e.setValue(R$,t)}function Ple(e){return e.deleteValue(R$)}function Ule(e,t){return eB(e,new uA(t))}function n2(e){var t;return(t=t2(e))===null||t===void 0?void 0:t.spanContext()}var R$,x$=O(()=>{m();J1();e2();W1();R$=bl("OpenTelemetry Context Key SPAN")});function Lle(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(r2[e.charCodeAt(r)]|0)+(r2[e.charCodeAt(r+1)]|0)+(r2[e.charCodeAt(r+2)]|0)+(r2[e.charCodeAt(r+3)]|0);return n===t}function D$(e){return Lle(e,32)&&e!==bS}function B$(e){return Lle(e,16)&&e!==X1}function eg(e){return D$(e.traceId)&&B$(e.spanId)}function Qle(e){return new uA(e)}var r2,o2=O(()=>{m();XP();e2();r2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function g7e(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var N$,GC,O$=O(()=>{m();W1();x$();e2();o2();N$=sA.getInstance(),GC=class{startSpan(t,n,r=N$.active()){if(!!n?.root)return new uA;let i=r&&n2(r);return g7e(i)&&eg(i)?new uA(i):new uA}startActiveSpan(t,n,r,o){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,a=r,c=o);let d=a??N$.active(),g=this.startSpan(t,i,d),h=eB(d,g);return N$.with(h,c,void 0,g)}}});var h7e,jC,w$=O(()=>{m();O$();h7e=new GC,jC=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):h7e}}});var i2,Fle=O(()=>{m();O$();i2=class{getTracer(t,n,r){return new GC}}});var _7e,vS,k$=O(()=>{m();w$();Fle();_7e=new i2,vS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new jC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:_7e}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var a2,Gle=O(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(a2||(a2={}))});var oo,jle=O(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(oo||(oo={}))});var ui,Hle=O(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(ui||(ui={}))});function zle(e){return y7e.test(e)}function $le(e){return T7e.test(e)&&!I7e.test(e)}var M$,E7e,S7e,y7e,T7e,I7e,Vle=O(()=>{m();M$="[_0-9a-z-*/]",E7e=`[a-z]${M$}{0,255}`,S7e=`[a-z0-9]${M$}{0,240}@[a-z]${M$}{0,13}`,y7e=new RegExp(`^(?:${E7e}|${S7e})$`),T7e=/^[ -~]{0,255}[!-~]$/,I7e=/,|=/});var qle,C7e,Yle,Kle,s2,Jle=O(()=>{m();Vle();qle=32,C7e=512,Yle=",",Kle="=",s2=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+Kle+this.get(n)),t),[]).join(Yle)}_parse(t){t.length>C7e||(this._internalState=t.split(Yle).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(Kle);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);zle(a)&&$le(c)&&n.set(a,c)}return n},new Map),this._internalState.size>qle&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,qle))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function Zle(e){return new s2(e)}var Wle=O(()=>{m();Jle()});var Ke,Xle=O(()=>{m();W1();Ke=sA.getInstance()});var vl,ede=O(()=>{m();CS();vl=$a.instance()});var P$,tde,nde=O(()=>{m();I$();P$=class{getMeter(t,n,r){return T$}},tde=new P$});var U$,u2,rde=O(()=>{m();nde();IS();CS();U$="metrics",u2=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return iA(U$,t,$a.instance())}getMeterProvider(){return Cl(U$)||tde}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){aA(U$,$a.instance())}}});var L$,ode=O(()=>{m();rde();L$=u2.getInstance()});var c2,ide=O(()=>{m();c2=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function F$(e){return e.getValue(Q$)||void 0}function ade(){return F$(sA.getInstance().active())}function sde(e,t){return e.setValue(Q$,t)}function ude(e){return e.deleteValue(Q$)}var Q$,cde=O(()=>{m();W1();J1();Q$=bl("OpenTelemetry Baggage Key")});var G$,b7e,l2,lde=O(()=>{m();IS();ide();C$();cde();l$();CS();G$="propagation",b7e=new c2,l2=class e{constructor(){this.createBaggage=Dle,this.getBaggage=F$,this.getActiveBaggage=ade,this.setBaggage=sde,this.deleteBaggage=ude}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return iA(G$,t,$a.instance())}inject(t,n,r=JP){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=KP){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){aA(G$,$a.instance())}_getGlobalPropagator(){return Cl(G$)||b7e}}});var qp,dde=O(()=>{m();lde();qp=l2.getInstance()});var j$,d2,pde=O(()=>{m();IS();k$();o2();x$();CS();j$="trace",d2=class e{constructor(){this._proxyTracerProvider=new vS,this.wrapSpanContext=Qle,this.isSpanContextValid=eg,this.deleteSpan=Ple,this.getSpan=t2,this.getActiveSpan=Mle,this.getSpanContext=n2,this.setSpan=eB,this.setSpanContext=Ule}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=iA(j$,this._proxyTracerProvider,$a.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Cl(j$)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){aA(j$,$a.instance()),this._proxyTracerProvider=new vS}}});var Ht,fde=O(()=>{m();pde();Ht=d2.getInstance()});var We={};za(We,{DiagConsoleLogger:()=>qP,DiagLogLevel:()=>ha,INVALID_SPANID:()=>X1,INVALID_SPAN_CONTEXT:()=>WP,INVALID_TRACEID:()=>bS,ProxyTracer:()=>jC,ProxyTracerProvider:()=>vS,ROOT_CONTEXT:()=>QC,SamplingDecision:()=>a2,SpanKind:()=>oo,SpanStatusCode:()=>ui,TraceFlags:()=>Ks,ValueType:()=>YP,baggageEntryMetadataFromString:()=>Ble,context:()=>Ke,createContextKey:()=>bl,createNoopMeter:()=>Ole,createTraceState:()=>Zle,default:()=>v7e,defaultTextMapGetter:()=>KP,defaultTextMapSetter:()=>JP,diag:()=>vl,isSpanContextValid:()=>eg,isValidSpanId:()=>B$,isValidTraceId:()=>D$,metrics:()=>L$,propagation:()=>qp,trace:()=>Ht});var v7e,je=O(()=>{m();l$();J1();Nle();$P();I$();wle();C$();w$();k$();Gle();jle();Hle();v$();Wle();o2();XP();Xle();ede();ode();dde();fde();v7e={context:Ke,diag:vl,metrics:L$,propagation:qp,trace:Ht}});var tB=F(Zh=>{"use strict";m();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.isTracingSuppressed=Zh.unsuppressTracing=Zh.suppressTracing=void 0;var R7e=(je(),Me(We)),H$=(0,R7e.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function x7e(e){return e.setValue(H$,!0)}Zh.suppressTracing=x7e;function D7e(e){return e.deleteValue(H$)}Zh.unsuppressTracing=D7e;function B7e(e){return e.getValue(H$)===!0}Zh.isTracingSuppressed=B7e});var z$=F(Js=>{"use strict";m();Object.defineProperty(Js,"__esModule",{value:!0});Js.BAGGAGE_MAX_TOTAL_LENGTH=Js.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Js.BAGGAGE_MAX_NAME_VALUE_PAIRS=Js.BAGGAGE_HEADER=Js.BAGGAGE_ITEMS_SEPARATOR=Js.BAGGAGE_PROPERTIES_SEPARATOR=Js.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Js.BAGGAGE_KEY_PAIR_SEPARATOR="=";Js.BAGGAGE_PROPERTIES_SEPARATOR=";";Js.BAGGAGE_ITEMS_SEPARATOR=",";Js.BAGGAGE_HEADER="baggage";Js.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Js.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Js.BAGGAGE_MAX_TOTAL_LENGTH=8192});var $$=F(cA=>{"use strict";m();Object.defineProperty(cA,"__esModule",{value:!0});cA.parseKeyPairsIntoRecord=cA.parsePairKeyValue=cA.getKeyPairs=cA.serializeKeyPairs=void 0;var N7e=(je(),Me(We)),HC=z$();function O7e(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?HC.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>HC.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}cA.serializeKeyPairs=O7e;function w7e(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=HC.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}cA.getKeyPairs=w7e;function Ade(e){if(!e)return;let t=e.indexOf(HC.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(HC.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let a,c;try{a=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let d;if(t!==-1&&t<e.length-1){let g=e.substring(t+1);d=(0,N7e.baggageEntryMetadataFromString)(g)}return{key:a,value:c,metadata:d}}cA.parsePairKeyValue=Ade;function k7e(e){let t={};return typeof e=="string"&&e.length>0&&e.split(HC.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=Ade(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}cA.parseKeyPairsIntoRecord=k7e});var mde=F(p2=>{"use strict";m();Object.defineProperty(p2,"__esModule",{value:!0});p2.W3CBaggagePropagator=void 0;var V$=(je(),Me(We)),M7e=tB(),RS=z$(),q$=$$(),Y$=class{inject(t,n,r){let o=V$.propagation.getBaggage(t);if(!o||(0,M7e.isTracingSuppressed)(t))return;let i=(0,q$.getKeyPairs)(o).filter(c=>c.length<=RS.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,RS.BAGGAGE_MAX_NAME_VALUE_PAIRS),a=(0,q$.serializeKeyPairs)(i);a.length>0&&r.set(n,RS.BAGGAGE_HEADER,a)}extract(t,n,r){let o=r.get(n,RS.BAGGAGE_HEADER),i=Array.isArray(o)?o.join(RS.BAGGAGE_ITEMS_SEPARATOR):o;if(!i)return t;let a={};return i.length===0||(i.split(RS.BAGGAGE_ITEMS_SEPARATOR).forEach(d=>{let g=(0,q$.parsePairKeyValue)(d);if(g){let h={value:g.value};g.metadata&&(h.metadata=g.metadata),a[g.key]=h}}),Object.entries(a).length===0)?t:V$.propagation.setBaggage(t,V$.propagation.createBaggage(a))}fields(){return[RS.BAGGAGE_HEADER]}};p2.W3CBaggagePropagator=Y$});var gde=F(f2=>{"use strict";m();Object.defineProperty(f2,"__esModule",{value:!0});f2.AnchoredClock=void 0;var K$=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};f2.AnchoredClock=K$});var yde=F(Wh=>{"use strict";m();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.isAttributeValue=Wh.isAttributeKey=Wh.sanitizeAttributes=void 0;var hde=(je(),Me(We));function P7e(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!_de(n)){hde.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ede(r)){hde.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}Wh.sanitizeAttributes=P7e;function _de(e){return typeof e=="string"&&e!==""}Wh.isAttributeKey=_de;function Ede(e){return e==null?!0:Array.isArray(e)?U7e(e):Sde(typeof e)}Wh.isAttributeValue=Ede;function U7e(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(Sde(r)){t=r;continue}return!1}return!1}}return!0}function Sde(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var J$=F(A2=>{"use strict";m();Object.defineProperty(A2,"__esModule",{value:!0});A2.loggingErrorHandler=void 0;var L7e=(je(),Me(We));function Q7e(){return e=>{L7e.diag.error(F7e(e))}}A2.loggingErrorHandler=Q7e;function F7e(e){return typeof e=="string"?e:JSON.stringify(G7e(e))}function G7e(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var Ide=F(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.globalErrorHandler=zC.setGlobalErrorHandler=void 0;var j7e=J$(),Tde=(0,j7e.loggingErrorHandler)();function H7e(e){Tde=e}zC.setGlobalErrorHandler=H7e;function z7e(e){try{Tde(e)}catch{}}zC.globalErrorHandler=z7e});var Rde=F(lA=>{"use strict";m();Object.defineProperty(lA,"__esModule",{value:!0});lA.getStringListFromEnv=lA.getBooleanFromEnv=lA.getStringFromEnv=lA.getNumberFromEnv=void 0;var Cde=(je(),Me(We)),bde=Ge("util");function $7e(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Cde.diag.warn(`Unknown value ${(0,bde.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}lA.getNumberFromEnv=$7e;function vde(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}lA.getStringFromEnv=vde;function V7e(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Cde.diag.warn(`Unknown value ${(0,bde.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}lA.getBooleanFromEnv=V7e;function q7e(e){return vde(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}lA.getStringListFromEnv=q7e});var xde=F(m2=>{"use strict";m();Object.defineProperty(m2,"__esModule",{value:!0});m2._globalThis=void 0;m2._globalThis=globalThis});var Dde=F(g2=>{"use strict";m();Object.defineProperty(g2,"__esModule",{value:!0});g2.VERSION=void 0;g2.VERSION="2.6.1"});function bi(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var Z$=O(()=>{m()});var Bde,Nde,Ode,wde,kde,Mde,Pde,Ude,Lde,Qde,Fde,Gde,jde,Hde,zde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Ipe,Cpe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Mpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,Hpe,zpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Ife,Cfe,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Mfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,Hfe,zfe,$fe,Vfe,qfe,Yfe,Kfe,Y7e,W$,K7e,J7e,Z7e,W7e,X$,X7e,eYe,tYe,nYe,rYe,oYe,iYe,aYe,sYe,uYe,cYe,lYe,dYe,pYe,fYe,AYe,mYe,gYe,e5,hYe,_Ye,EYe,SYe,yYe,TYe,IYe,CYe,bYe,vYe,RYe,xYe,t5,DYe,BYe,n5,r5,NYe,OYe,wYe,kYe,MYe,PYe,UYe,LYe,QYe,FYe,GYe,jYe,HYe,zYe,$Ye,VYe,qYe,nB,$C,o5,YYe,KYe,xS,JYe,ZYe,WYe,XYe,i5,a5,eKe,s5,tKe,nKe,rKe,oKe,iKe,aKe,sKe,uKe,cKe,lKe,dKe,pKe,fKe,AKe,mKe,gKe,hKe,_Ke,EKe,SKe,yKe,TKe,IKe,u5,CKe,bKe,vKe,RKe,xKe,DKe,BKe,NKe,OKe,wKe,kKe,MKe,PKe,UKe,LKe,QKe,FKe,GKe,jKe,c5,HKe,l5,zKe,$Ke,VKe,qKe,YKe,KKe,JKe,ZKe,WKe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,IAe,CAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,kAe,MAe,PAe,UAe,LAe,QAe,FAe,GAe,jAe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,aJe,sJe,uJe,cJe,lJe,dJe,pJe,fJe,AJe,mJe,gJe,hJe,_Je,EJe,SJe,yJe,TJe,IJe,CJe,bJe,vJe,RJe,xJe,DJe,BJe,NJe,OJe,wJe,kJe,MJe,PJe,UJe,LJe,QJe,FJe,GJe,jJe,HJe,zJe,$Je,VJe,HAe,zAe,$Ae,VAe,qAe,YAe,KAe,JAe,ZAe,WAe,XAe,qJe,YJe,KJe,JJe,ZJe,WJe,XJe,eZe,tZe,nZe,rZe,oZe,eme,tme,nme,rme,ome,iZe,aZe,sZe,uZe,cZe,lZe,ime,ame,sme,dZe,pZe,fZe,AZe,ume,cme,lme,dme,mZe,gZe,hZe,_Ze,EZe,pme,fme,Ame,mme,gme,hme,_me,SZe,yZe,TZe,IZe,CZe,bZe,vZe,RZe,Eme,Sme,yme,Tme,Ime,xZe,DZe,BZe,NZe,OZe,wZe,Cme,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Mme,Pme,Ume,Lme,Qme,Fme,Gme,jme,Hme,zme,kZe,MZe,PZe,UZe,LZe,QZe,FZe,GZe,jZe,HZe,zZe,$Ze,VZe,qZe,YZe,KZe,JZe,ZZe,WZe,XZe,eWe,tWe,$me,Vme,qme,Yme,Kme,nWe,rWe,oWe,iWe,aWe,sWe,Jme,Zme,uWe,cWe,lWe,Wme,Xme,dWe,pWe,fWe,ege,tge,nge,rge,oge,ige,age,sge,uge,cge,lge,dge,pge,fge,Age,mge,gge,AWe,mWe,gWe,hWe,_We,EWe,SWe,yWe,TWe,IWe,CWe,bWe,vWe,RWe,xWe,DWe,BWe,NWe,hge,_ge,OWe,wWe,kWe,Ege=O(()=>{m();Z$();Bde="aws.lambda.invoked_arn",Nde="db.system",Ode="db.connection_string",wde="db.user",kde="db.jdbc.driver_classname",Mde="db.name",Pde="db.statement",Ude="db.operation",Lde="db.mssql.instance_name",Qde="db.cassandra.keyspace",Fde="db.cassandra.page_size",Gde="db.cassandra.consistency_level",jde="db.cassandra.table",Hde="db.cassandra.idempotence",zde="db.cassandra.speculative_execution_count",$de="db.cassandra.coordinator.id",Vde="db.cassandra.coordinator.dc",qde="db.hbase.namespace",Yde="db.redis.database_index",Kde="db.mongodb.collection",Jde="db.sql.table",Zde="exception.type",Wde="exception.message",Xde="exception.stacktrace",epe="exception.escaped",tpe="faas.trigger",npe="faas.execution",rpe="faas.document.collection",ope="faas.document.operation",ipe="faas.document.time",ape="faas.document.name",spe="faas.time",upe="faas.cron",cpe="faas.coldstart",lpe="faas.invoked_name",dpe="faas.invoked_provider",ppe="faas.invoked_region",fpe="net.transport",Ape="net.peer.ip",mpe="net.peer.port",gpe="net.peer.name",hpe="net.host.ip",_pe="net.host.port",Epe="net.host.name",Spe="net.host.connection.type",ype="net.host.connection.subtype",Tpe="net.host.carrier.name",Ipe="net.host.carrier.mcc",Cpe="net.host.carrier.mnc",bpe="net.host.carrier.icc",vpe="peer.service",Rpe="enduser.id",xpe="enduser.role",Dpe="enduser.scope",Bpe="thread.id",Npe="thread.name",Ope="code.function",wpe="code.namespace",kpe="code.filepath",Mpe="code.lineno",Ppe="http.method",Upe="http.url",Lpe="http.target",Qpe="http.host",Fpe="http.scheme",Gpe="http.status_code",jpe="http.flavor",Hpe="http.user_agent",zpe="http.request_content_length",$pe="http.request_content_length_uncompressed",Vpe="http.response_content_length",qpe="http.response_content_length_uncompressed",Ype="http.server_name",Kpe="http.route",Jpe="http.client_ip",Zpe="aws.dynamodb.table_names",Wpe="aws.dynamodb.consumed_capacity",Xpe="aws.dynamodb.item_collection_metrics",efe="aws.dynamodb.provisioned_read_capacity",tfe="aws.dynamodb.provisioned_write_capacity",nfe="aws.dynamodb.consistent_read",rfe="aws.dynamodb.projection",ofe="aws.dynamodb.limit",ife="aws.dynamodb.attributes_to_get",afe="aws.dynamodb.index_name",sfe="aws.dynamodb.select",ufe="aws.dynamodb.global_secondary_indexes",cfe="aws.dynamodb.local_secondary_indexes",lfe="aws.dynamodb.exclusive_start_table",dfe="aws.dynamodb.table_count",pfe="aws.dynamodb.scan_forward",ffe="aws.dynamodb.segment",Afe="aws.dynamodb.total_segments",mfe="aws.dynamodb.count",gfe="aws.dynamodb.scanned_count",hfe="aws.dynamodb.attribute_definitions",_fe="aws.dynamodb.global_secondary_index_updates",Efe="messaging.system",Sfe="messaging.destination",yfe="messaging.destination_kind",Tfe="messaging.temp_destination",Ife="messaging.protocol",Cfe="messaging.protocol_version",bfe="messaging.url",vfe="messaging.message_id",Rfe="messaging.conversation_id",xfe="messaging.message_payload_size_bytes",Dfe="messaging.message_payload_compressed_size_bytes",Bfe="messaging.operation",Nfe="messaging.consumer_id",Ofe="messaging.rabbitmq.routing_key",wfe="messaging.kafka.message_key",kfe="messaging.kafka.consumer_group",Mfe="messaging.kafka.client_id",Pfe="messaging.kafka.partition",Ufe="messaging.kafka.tombstone",Lfe="rpc.system",Qfe="rpc.service",Ffe="rpc.method",Gfe="rpc.grpc.status_code",jfe="rpc.jsonrpc.version",Hfe="rpc.jsonrpc.request_id",zfe="rpc.jsonrpc.error_code",$fe="rpc.jsonrpc.error_message",Vfe="message.type",qfe="message.id",Yfe="message.compressed_size",Kfe="message.uncompressed_size",Y7e=Bde,W$=Nde,K7e=Ode,J7e=wde,Z7e=kde,W7e=Mde,X$=Pde,X7e=Ude,eYe=Lde,tYe=Qde,nYe=Fde,rYe=Gde,oYe=jde,iYe=Hde,aYe=zde,sYe=$de,uYe=Vde,cYe=qde,lYe=Yde,dYe=Kde,pYe=Jde,fYe=Zde,AYe=Wde,mYe=Xde,gYe=epe,e5=tpe,hYe=npe,_Ye=rpe,EYe=ope,SYe=ipe,yYe=ape,TYe=spe,IYe=upe,CYe=cpe,bYe=lpe,vYe=dpe,RYe=ppe,xYe=fpe,t5=Ape,DYe=mpe,BYe=gpe,n5=hpe,r5=_pe,NYe=Epe,OYe=Spe,wYe=ype,kYe=Tpe,MYe=Ipe,PYe=Cpe,UYe=bpe,LYe=vpe,QYe=Rpe,FYe=xpe,GYe=Dpe,jYe=Bpe,HYe=Npe,zYe=Ope,$Ye=wpe,VYe=kpe,qYe=Mpe,nB=Ppe,$C=Upe,o5=Lpe,YYe=Qpe,KYe=Fpe,xS=Gpe,JYe=jpe,ZYe=Hpe,WYe=zpe,XYe=$pe,i5=Vpe,a5=qpe,eKe=Ype,s5=Kpe,tKe=Jpe,nKe=Zpe,rKe=Wpe,oKe=Xpe,iKe=efe,aKe=tfe,sKe=nfe,uKe=rfe,cKe=ofe,lKe=ife,dKe=afe,pKe=sfe,fKe=ufe,AKe=cfe,mKe=lfe,gKe=dfe,hKe=pfe,_Ke=ffe,EKe=Afe,SKe=mfe,yKe=gfe,TKe=hfe,IKe=_fe,u5=Efe,CKe=Sfe,bKe=yfe,vKe=Tfe,RKe=Ife,xKe=Cfe,DKe=bfe,BKe=vfe,NKe=Rfe,OKe=xfe,wKe=Dfe,kKe=Bfe,MKe=Nfe,PKe=Ofe,UKe=wfe,LKe=kfe,QKe=Mfe,FKe=Pfe,GKe=Ufe,jKe=Lfe,c5=Qfe,HKe=Ffe,l5=Gfe,zKe=jfe,$Ke=Hfe,VKe=zfe,qKe=$fe,YKe=Vfe,KKe=qfe,JKe=Yfe,ZKe=Kfe,WKe=bi([Bde,Nde,Ode,wde,kde,Mde,Pde,Ude,Lde,Qde,Fde,Gde,jde,Hde,zde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Ipe,Cpe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Mpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,Hpe,zpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Ife,Cfe,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Mfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,Hfe,zfe,$fe,Vfe,qfe,Yfe,Kfe]),Jfe="other_sql",Zfe="mssql",Wfe="mysql",Xfe="oracle",eAe="db2",tAe="postgresql",nAe="redshift",rAe="hive",oAe="cloudscape",iAe="hsqldb",aAe="progress",sAe="maxdb",uAe="hanadb",cAe="ingres",lAe="firstsql",dAe="edb",pAe="cache",fAe="adabas",AAe="firebird",mAe="derby",gAe="filemaker",hAe="informix",_Ae="instantdb",EAe="interbase",SAe="mariadb",yAe="netezza",TAe="pervasive",IAe="pointbase",CAe="sqlite",bAe="sybase",vAe="teradata",RAe="vertica",xAe="h2",DAe="coldfusion",BAe="cassandra",NAe="hbase",OAe="mongodb",wAe="redis",kAe="couchbase",MAe="couchdb",PAe="cosmosdb",UAe="dynamodb",LAe="neo4j",QAe="geode",FAe="elasticsearch",GAe="memcached",jAe="cockroachdb",XKe=Jfe,eJe=Zfe,tJe=Wfe,nJe=Xfe,rJe=eAe,oJe=tAe,iJe=nAe,aJe=rAe,sJe=oAe,uJe=iAe,cJe=aAe,lJe=sAe,dJe=uAe,pJe=cAe,fJe=lAe,AJe=dAe,mJe=pAe,gJe=fAe,hJe=AAe,_Je=mAe,EJe=gAe,SJe=hAe,yJe=_Ae,TJe=EAe,IJe=SAe,CJe=yAe,bJe=TAe,vJe=IAe,RJe=CAe,xJe=bAe,DJe=vAe,BJe=RAe,NJe=xAe,OJe=DAe,wJe=BAe,kJe=NAe,MJe=OAe,PJe=wAe,UJe=kAe,LJe=MAe,QJe=PAe,FJe=UAe,GJe=LAe,jJe=QAe,HJe=FAe,zJe=GAe,$Je=jAe,VJe=bi([Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,IAe,CAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,kAe,MAe,PAe,UAe,LAe,QAe,FAe,GAe,jAe]),HAe="all",zAe="each_quorum",$Ae="quorum",VAe="local_quorum",qAe="one",YAe="two",KAe="three",JAe="local_one",ZAe="any",WAe="serial",XAe="local_serial",qJe=HAe,YJe=zAe,KJe=$Ae,JJe=VAe,ZJe=qAe,WJe=YAe,XJe=KAe,eZe=JAe,tZe=ZAe,nZe=WAe,rZe=XAe,oZe=bi([HAe,zAe,$Ae,VAe,qAe,YAe,KAe,JAe,ZAe,WAe,XAe]),eme="datasource",tme="http",nme="pubsub",rme="timer",ome="other",iZe=eme,aZe=tme,sZe=nme,uZe=rme,cZe=ome,lZe=bi([eme,tme,nme,rme,ome]),ime="insert",ame="edit",sme="delete",dZe=ime,pZe=ame,fZe=sme,AZe=bi([ime,ame,sme]),ume="alibaba_cloud",cme="aws",lme="azure",dme="gcp",mZe=ume,gZe=cme,hZe=lme,_Ze=dme,EZe=bi([ume,cme,lme,dme]),pme="ip_tcp",fme="ip_udp",Ame="ip",mme="unix",gme="pipe",hme="inproc",_me="other",SZe=pme,yZe=fme,TZe=Ame,IZe=mme,CZe=gme,bZe=hme,vZe=_me,RZe=bi([pme,fme,Ame,mme,gme,hme,_me]),Eme="wifi",Sme="wired",yme="cell",Tme="unavailable",Ime="unknown",xZe=Eme,DZe=Sme,BZe=yme,NZe=Tme,OZe=Ime,wZe=bi([Eme,Sme,yme,Tme,Ime]),Cme="gprs",bme="edge",vme="umts",Rme="cdma",xme="evdo_0",Dme="evdo_a",Bme="cdma2000_1xrtt",Nme="hsdpa",Ome="hsupa",wme="hspa",kme="iden",Mme="evdo_b",Pme="lte",Ume="ehrpd",Lme="hspap",Qme="gsm",Fme="td_scdma",Gme="iwlan",jme="nr",Hme="nrnsa",zme="lte_ca",kZe=Cme,MZe=bme,PZe=vme,UZe=Rme,LZe=xme,QZe=Dme,FZe=Bme,GZe=Nme,jZe=Ome,HZe=wme,zZe=kme,$Ze=Mme,VZe=Pme,qZe=Ume,YZe=Lme,KZe=Qme,JZe=Fme,ZZe=Gme,WZe=jme,XZe=Hme,eWe=zme,tWe=bi([Cme,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Mme,Pme,Ume,Lme,Qme,Fme,Gme,jme,Hme,zme]),$me="1.0",Vme="1.1",qme="2.0",Yme="SPDY",Kme="QUIC",nWe=$me,rWe=Vme,oWe=qme,iWe=Yme,aWe=Kme,sWe={HTTP_1_0:$me,HTTP_1_1:Vme,HTTP_2_0:qme,SPDY:Yme,QUIC:Kme},Jme="queue",Zme="topic",uWe=Jme,cWe=Zme,lWe=bi([Jme,Zme]),Wme="receive",Xme="process",dWe=Wme,pWe=Xme,fWe=bi([Wme,Xme]),ege=0,tge=1,nge=2,rge=3,oge=4,ige=5,age=6,sge=7,uge=8,cge=9,lge=10,dge=11,pge=12,fge=13,Age=14,mge=15,gge=16,AWe=ege,mWe=tge,gWe=nge,hWe=rge,_We=oge,EWe=ige,SWe=age,yWe=sge,TWe=uge,IWe=cge,CWe=lge,bWe=dge,vWe=pge,RWe=fge,xWe=Age,DWe=mge,BWe=gge,NWe={OK:ege,CANCELLED:tge,UNKNOWN:nge,INVALID_ARGUMENT:rge,DEADLINE_EXCEEDED:oge,NOT_FOUND:ige,ALREADY_EXISTS:age,PERMISSION_DENIED:sge,RESOURCE_EXHAUSTED:uge,FAILED_PRECONDITION:cge,ABORTED:lge,OUT_OF_RANGE:dge,UNIMPLEMENTED:pge,INTERNAL:fge,UNAVAILABLE:Age,DATA_LOSS:mge,UNAUTHENTICATED:gge},hge="SENT",_ge="RECEIVED",OWe=hge,wWe=_ge,kWe=bi([hge,_ge])});var Sge=O(()=>{m();Ege()});var yge,Tge,Ige,Cge,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,kge,Mge,Pge,Uge,Lge,Qge,Fge,Gge,jge,Hge,zge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Ihe,Che,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Mhe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,Hhe,zhe,$he,Vhe,qhe,MWe,PWe,UWe,LWe,QWe,FWe,GWe,jWe,HWe,zWe,$We,VWe,qWe,YWe,KWe,JWe,ZWe,WWe,XWe,eXe,tXe,nXe,rXe,oXe,iXe,aXe,sXe,uXe,cXe,lXe,dXe,pXe,fXe,AXe,mXe,gXe,hXe,_Xe,EXe,SXe,yXe,TXe,IXe,CXe,bXe,vXe,RXe,xXe,DXe,BXe,NXe,OXe,wXe,kXe,MXe,PXe,UXe,LXe,QXe,FXe,GXe,jXe,HXe,zXe,$Xe,VXe,qXe,YXe,KXe,JXe,ZXe,d5,WXe,XXe,eet,tet,net,ret,oet,iet,aet,set,Yhe,Khe,Jhe,Zhe,uet,cet,det,pet,fet,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,d_e,p_e,f_e,A_e,Aet,met,get,het,_et,Eet,yet,Tet,Iet,Cet,bet,vet,Ret,xet,Det,Bet,Net,Oet,m_e,g_e,wet,ket,Met,h_e,__e,E_e,S_e,y_e,T_e,I_e,Pet,Uet,Let,Qet,Fet,Get,jet,Het,C_e,b_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e,zet,$et,Vet,qet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,M_e,P_e,U_e,L_e,Q_e,F_e,G_e,j_e,H_e,z_e,ntt,rtt,ott,itt,att,stt,utt,ctt,ltt,dtt,ptt,$_e=O(()=>{m();Z$();yge="cloud.provider",Tge="cloud.account.id",Ige="cloud.region",Cge="cloud.availability_zone",bge="cloud.platform",vge="aws.ecs.container.arn",Rge="aws.ecs.cluster.arn",xge="aws.ecs.launchtype",Dge="aws.ecs.task.arn",Bge="aws.ecs.task.family",Nge="aws.ecs.task.revision",Oge="aws.eks.cluster.arn",wge="aws.log.group.names",kge="aws.log.group.arns",Mge="aws.log.stream.names",Pge="aws.log.stream.arns",Uge="container.name",Lge="container.id",Qge="container.runtime",Fge="container.image.name",Gge="container.image.tag",jge="deployment.environment",Hge="device.id",zge="device.model.identifier",$ge="device.model.name",Vge="faas.name",qge="faas.id",Yge="faas.version",Kge="faas.instance",Jge="faas.max_memory",Zge="host.id",Wge="host.name",Xge="host.type",ehe="host.arch",the="host.image.name",nhe="host.image.id",rhe="host.image.version",ohe="k8s.cluster.name",ihe="k8s.node.name",ahe="k8s.node.uid",she="k8s.namespace.name",uhe="k8s.pod.uid",che="k8s.pod.name",lhe="k8s.container.name",dhe="k8s.replicaset.uid",phe="k8s.replicaset.name",fhe="k8s.deployment.uid",Ahe="k8s.deployment.name",mhe="k8s.statefulset.uid",ghe="k8s.statefulset.name",hhe="k8s.daemonset.uid",_he="k8s.daemonset.name",Ehe="k8s.job.uid",She="k8s.job.name",yhe="k8s.cronjob.uid",The="k8s.cronjob.name",Ihe="os.type",Che="os.description",bhe="os.name",vhe="os.version",Rhe="process.pid",xhe="process.executable.name",Dhe="process.executable.path",Bhe="process.command",Nhe="process.command_line",Ohe="process.command_args",whe="process.owner",khe="process.runtime.name",Mhe="process.runtime.version",Phe="process.runtime.description",Uhe="service.name",Lhe="service.namespace",Qhe="service.instance.id",Fhe="service.version",Ghe="telemetry.sdk.name",jhe="telemetry.sdk.language",Hhe="telemetry.sdk.version",zhe="telemetry.auto.version",$he="webengine.name",Vhe="webengine.version",qhe="webengine.description",MWe=yge,PWe=Tge,UWe=Ige,LWe=Cge,QWe=bge,FWe=vge,GWe=Rge,jWe=xge,HWe=Dge,zWe=Bge,$We=Nge,VWe=Oge,qWe=wge,YWe=kge,KWe=Mge,JWe=Pge,ZWe=Uge,WWe=Lge,XWe=Qge,eXe=Fge,tXe=Gge,nXe=jge,rXe=Hge,oXe=zge,iXe=$ge,aXe=Vge,sXe=qge,uXe=Yge,cXe=Kge,lXe=Jge,dXe=Zge,pXe=Wge,fXe=Xge,AXe=ehe,mXe=the,gXe=nhe,hXe=rhe,_Xe=ohe,EXe=ihe,SXe=ahe,yXe=she,TXe=uhe,IXe=che,CXe=lhe,bXe=dhe,vXe=phe,RXe=fhe,xXe=Ahe,DXe=mhe,BXe=ghe,NXe=hhe,OXe=_he,wXe=Ehe,kXe=She,MXe=yhe,PXe=The,UXe=Ihe,LXe=Che,QXe=bhe,FXe=vhe,GXe=Rhe,jXe=xhe,HXe=Dhe,zXe=Bhe,$Xe=Nhe,VXe=Ohe,qXe=whe,YXe=khe,KXe=Mhe,JXe=Phe,ZXe=Uhe,d5=Lhe,WXe=Qhe,XXe=Fhe,eet=Ghe,tet=jhe,net=Hhe,ret=zhe,oet=$he,iet=Vhe,aet=qhe,set=bi([yge,Tge,Ige,Cge,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,kge,Mge,Pge,Uge,Lge,Qge,Fge,Gge,jge,Hge,zge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Ihe,Che,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Mhe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,Hhe,zhe,$he,Vhe,qhe]),Yhe="alibaba_cloud",Khe="aws",Jhe="azure",Zhe="gcp",uet=Yhe,cet=Khe,det=Jhe,pet=Zhe,fet=bi([Yhe,Khe,Jhe,Zhe]),Whe="alibaba_cloud_ecs",Xhe="alibaba_cloud_fc",e_e="aws_ec2",t_e="aws_ecs",n_e="aws_eks",r_e="aws_lambda",o_e="aws_elastic_beanstalk",i_e="azure_vm",a_e="azure_container_instances",s_e="azure_aks",u_e="azure_functions",c_e="azure_app_service",l_e="gcp_compute_engine",d_e="gcp_cloud_run",p_e="gcp_kubernetes_engine",f_e="gcp_cloud_functions",A_e="gcp_app_engine",Aet=Whe,met=Xhe,get=e_e,het=t_e,_et=n_e,Eet=r_e,yet=o_e,Tet=i_e,Iet=a_e,Cet=s_e,bet=u_e,vet=c_e,Ret=l_e,xet=d_e,Det=p_e,Bet=f_e,Net=A_e,Oet=bi([Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,d_e,p_e,f_e,A_e]),m_e="ec2",g_e="fargate",wet=m_e,ket=g_e,Met=bi([m_e,g_e]),h_e="amd64",__e="arm32",E_e="arm64",S_e="ia64",y_e="ppc32",T_e="ppc64",I_e="x86",Pet=h_e,Uet=__e,Let=E_e,Qet=S_e,Fet=y_e,Get=T_e,jet=I_e,Het=bi([h_e,__e,E_e,S_e,y_e,T_e,I_e]),C_e="windows",b_e="linux",v_e="darwin",R_e="freebsd",x_e="netbsd",D_e="openbsd",B_e="dragonflybsd",N_e="hpux",O_e="aix",w_e="solaris",k_e="z_os",zet=C_e,$et=b_e,Vet=v_e,qet=R_e,Yet=x_e,Ket=D_e,Jet=B_e,Zet=N_e,Wet=O_e,Xet=w_e,ett=k_e,ttt=bi([C_e,b_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e]),M_e="cpp",P_e="dotnet",U_e="erlang",L_e="go",Q_e="java",F_e="nodejs",G_e="php",j_e="python",H_e="ruby",z_e="webjs",ntt=M_e,rtt=P_e,ott=U_e,itt=L_e,att=Q_e,stt=F_e,utt=G_e,ctt=j_e,ltt=H_e,dtt=z_e,ptt=bi([M_e,P_e,U_e,L_e,Q_e,F_e,G_e,j_e,H_e,z_e])});var V_e=O(()=>{m();$_e()});var ftt,Att,mtt,gtt,htt,_tt,Ett,Stt,ytt,Ttt,Itt,Ctt,btt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,ktt,Mtt,Ptt,Utt,p5,f5,Ltt,VC,Qtt,A5,m5,Ftt,DS,Gtt,jtt,Htt,ztt,$tt,Vtt,qtt,Ytt,Ktt,Jtt,g5,Ztt,Wtt,Xtt,ent,tnt,nnt,BS,rnt,ont,int,ant,snt,unt,cnt,lnt,dnt,pnt,fnt,Ant,mnt,tg,ng,gnt,hnt,_nt,Ent,Snt,ynt,Tnt,Int,Cnt,bnt,vnt,Rnt,xnt,Dnt,Bnt,Nnt,h5,_5,Ont,E5,S5,wnt,knt,Mnt,Pnt,Unt,Lnt,Qnt,Fnt,Gnt,jnt,Hnt,znt,$nt,Vnt,y5,T5,qnt,I5,Ynt,C5,Knt,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,art,srt,urt,crt,lrt,drt,prt,frt,Art,mrt,grt,hrt,_rt,Xh,Ert,Srt,yrt,b5,q_e=O(()=>{m();ftt="aspnetcore.diagnostics.exception.result",Att="aborted",mtt="handled",gtt="skipped",htt="unhandled",_tt="aspnetcore.diagnostics.handler.type",Ett="aspnetcore.rate_limiting.policy",Stt="aspnetcore.rate_limiting.result",ytt="acquired",Ttt="endpoint_limiter",Itt="global_limiter",Ctt="request_canceled",btt="aspnetcore.request.is_unhandled",vtt="aspnetcore.routing.is_fallback",Rtt="aspnetcore.routing.match_status",xtt="failure",Dtt="success",Btt="aspnetcore.user.is_authenticated",Ntt="client.address",Ott="client.port",wtt="code.column.number",ktt="code.file.path",Mtt="code.function.name",Ptt="code.line.number",Utt="code.stacktrace",p5="db.collection.name",f5="db.namespace",Ltt="db.operation.batch.size",VC="db.operation.name",Qtt="db.query.summary",A5="db.query.text",m5="db.response.status_code",Ftt="db.stored_procedure.name",DS="db.system.name",Gtt="mariadb",jtt="microsoft.sql_server",Htt="mysql",ztt="postgresql",$tt="dotnet.gc.heap.generation",Vtt="gen0",qtt="gen1",Ytt="gen2",Ktt="loh",Jtt="poh",g5="error.type",Ztt="_OTHER",Wtt="exception.escaped",Xtt="exception.message",ent="exception.stacktrace",tnt="exception.type",nnt=e=>`http.request.header.${e}`,BS="http.request.method",rnt="_OTHER",ont="CONNECT",int="DELETE",ant="GET",snt="HEAD",unt="OPTIONS",cnt="PATCH",lnt="POST",dnt="PUT",pnt="TRACE",fnt="http.request.method_original",Ant="http.request.resend_count",mnt=e=>`http.response.header.${e}`,tg="http.response.status_code",ng="http.route",gnt="jvm.gc.action",hnt="jvm.gc.name",_nt="jvm.memory.pool.name",Ent="jvm.memory.type",Snt="heap",ynt="non_heap",Tnt="jvm.thread.daemon",Int="jvm.thread.state",Cnt="blocked",bnt="new",vnt="runnable",Rnt="terminated",xnt="timed_waiting",Dnt="waiting",Bnt="network.local.address",Nnt="network.local.port",h5="network.peer.address",_5="network.peer.port",Ont="network.protocol.name",E5="network.protocol.version",S5="network.transport",wnt="pipe",knt="quic",Mnt="tcp",Pnt="udp",Unt="unix",Lnt="network.type",Qnt="ipv4",Fnt="ipv6",Gnt="otel.scope.name",jnt="otel.scope.version",Hnt="otel.status_code",znt="ERROR",$nt="OK",Vnt="otel.status_description",y5="server.address",T5="server.port",qnt="service.instance.id",I5="service.name",Ynt="service.namespace",C5="service.version",Knt="signalr.connection.status",Jnt="app_shutdown",Znt="normal_closure",Wnt="timeout",Xnt="signalr.transport",ert="long_polling",trt="server_sent_events",nrt="web_sockets",rrt="telemetry.sdk.language",ort="cpp",irt="dotnet",art="erlang",srt="go",urt="java",crt="nodejs",lrt="php",drt="python",prt="ruby",frt="rust",Art="swift",mrt="webjs",grt="telemetry.sdk.name",hrt="telemetry.sdk.version",_rt="url.fragment",Xh="url.full",Ert="url.path",Srt="url.query",yrt="url.scheme",b5="user_agent.original"});var Trt,Irt,Crt,brt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,wrt,krt,Mrt,Prt,Urt,Lrt,Qrt,Frt,Grt,jrt,Hrt,zrt,$rt,Vrt,qrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,rot,oot,iot,aot,sot,uot,cot,lot,dot,pot,fot,Aot,mot,got,hot,_ot,Y_e=O(()=>{m();Trt="aspnetcore.diagnostics.exceptions",Irt="aspnetcore.rate_limiting.active_request_leases",Crt="aspnetcore.rate_limiting.queued_requests",brt="aspnetcore.rate_limiting.request.time_in_queue",vrt="aspnetcore.rate_limiting.request_lease.duration",Rrt="aspnetcore.rate_limiting.requests",xrt="aspnetcore.routing.match_attempts",Drt="db.client.operation.duration",Brt="dotnet.assembly.count",Nrt="dotnet.exceptions",Ort="dotnet.gc.collections",wrt="dotnet.gc.heap.total_allocated",krt="dotnet.gc.last_collection.heap.fragmentation.size",Mrt="dotnet.gc.last_collection.heap.size",Prt="dotnet.gc.last_collection.memory.committed_size",Urt="dotnet.gc.pause.time",Lrt="dotnet.jit.compilation.time",Qrt="dotnet.jit.compiled_il.size",Frt="dotnet.jit.compiled_methods",Grt="dotnet.monitor.lock_contentions",jrt="dotnet.process.cpu.count",Hrt="dotnet.process.cpu.time",zrt="dotnet.process.memory.working_set",$rt="dotnet.thread_pool.queue.length",Vrt="dotnet.thread_pool.thread.count",qrt="dotnet.thread_pool.work_item.count",Yrt="dotnet.timer.count",Krt="http.client.request.duration",Jrt="http.server.request.duration",Zrt="jvm.class.count",Wrt="jvm.class.loaded",Xrt="jvm.class.unloaded",eot="jvm.cpu.count",tot="jvm.cpu.recent_utilization",not="jvm.cpu.time",rot="jvm.gc.duration",oot="jvm.memory.committed",iot="jvm.memory.limit",aot="jvm.memory.used",sot="jvm.memory.used_after_last_gc",uot="jvm.thread.count",cot="kestrel.active_connections",lot="kestrel.active_tls_handshakes",dot="kestrel.connection.duration",pot="kestrel.queued_connections",fot="kestrel.queued_requests",Aot="kestrel.rejected_connections",mot="kestrel.tls_handshake.duration",got="kestrel.upgraded_connections",hot="signalr.server.active_connections",_ot="signalr.server.connection.duration"});var Eot,K_e=O(()=>{m();Eot="exception"});var Ur={};za(Ur,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Att,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>mtt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>gtt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>htt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>ytt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Ttt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Itt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ctt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>xtt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Dtt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>ftt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>_tt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Ett,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Stt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>btt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>vtt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Rtt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Btt,ATTR_CLIENT_ADDRESS:()=>Ntt,ATTR_CLIENT_PORT:()=>Ott,ATTR_CODE_COLUMN_NUMBER:()=>wtt,ATTR_CODE_FILE_PATH:()=>ktt,ATTR_CODE_FUNCTION_NAME:()=>Mtt,ATTR_CODE_LINE_NUMBER:()=>Ptt,ATTR_CODE_STACKTRACE:()=>Utt,ATTR_DB_COLLECTION_NAME:()=>p5,ATTR_DB_NAMESPACE:()=>f5,ATTR_DB_OPERATION_BATCH_SIZE:()=>Ltt,ATTR_DB_OPERATION_NAME:()=>VC,ATTR_DB_QUERY_SUMMARY:()=>Qtt,ATTR_DB_QUERY_TEXT:()=>A5,ATTR_DB_RESPONSE_STATUS_CODE:()=>m5,ATTR_DB_STORED_PROCEDURE_NAME:()=>Ftt,ATTR_DB_SYSTEM_NAME:()=>DS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>$tt,ATTR_ERROR_TYPE:()=>g5,ATTR_EXCEPTION_ESCAPED:()=>Wtt,ATTR_EXCEPTION_MESSAGE:()=>Xtt,ATTR_EXCEPTION_STACKTRACE:()=>ent,ATTR_EXCEPTION_TYPE:()=>tnt,ATTR_HTTP_REQUEST_HEADER:()=>nnt,ATTR_HTTP_REQUEST_METHOD:()=>BS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>fnt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Ant,ATTR_HTTP_RESPONSE_HEADER:()=>mnt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>tg,ATTR_HTTP_ROUTE:()=>ng,ATTR_JVM_GC_ACTION:()=>gnt,ATTR_JVM_GC_NAME:()=>hnt,ATTR_JVM_MEMORY_POOL_NAME:()=>_nt,ATTR_JVM_MEMORY_TYPE:()=>Ent,ATTR_JVM_THREAD_DAEMON:()=>Tnt,ATTR_JVM_THREAD_STATE:()=>Int,ATTR_NETWORK_LOCAL_ADDRESS:()=>Bnt,ATTR_NETWORK_LOCAL_PORT:()=>Nnt,ATTR_NETWORK_PEER_ADDRESS:()=>h5,ATTR_NETWORK_PEER_PORT:()=>_5,ATTR_NETWORK_PROTOCOL_NAME:()=>Ont,ATTR_NETWORK_PROTOCOL_VERSION:()=>E5,ATTR_NETWORK_TRANSPORT:()=>S5,ATTR_NETWORK_TYPE:()=>Lnt,ATTR_OTEL_SCOPE_NAME:()=>Gnt,ATTR_OTEL_SCOPE_VERSION:()=>jnt,ATTR_OTEL_STATUS_CODE:()=>Hnt,ATTR_OTEL_STATUS_DESCRIPTION:()=>Vnt,ATTR_SERVER_ADDRESS:()=>y5,ATTR_SERVER_PORT:()=>T5,ATTR_SERVICE_INSTANCE_ID:()=>qnt,ATTR_SERVICE_NAME:()=>I5,ATTR_SERVICE_NAMESPACE:()=>Ynt,ATTR_SERVICE_VERSION:()=>C5,ATTR_SIGNALR_CONNECTION_STATUS:()=>Knt,ATTR_SIGNALR_TRANSPORT:()=>Xnt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>rrt,ATTR_TELEMETRY_SDK_NAME:()=>grt,ATTR_TELEMETRY_SDK_VERSION:()=>hrt,ATTR_URL_FRAGMENT:()=>_rt,ATTR_URL_FULL:()=>Xh,ATTR_URL_PATH:()=>Ert,ATTR_URL_QUERY:()=>Srt,ATTR_URL_SCHEME:()=>yrt,ATTR_USER_AGENT_ORIGINAL:()=>b5,AWSECSLAUNCHTYPEVALUES_EC2:()=>wet,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>ket,AwsEcsLaunchtypeValues:()=>Met,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Aet,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>met,CLOUDPLATFORMVALUES_AWS_EC2:()=>get,CLOUDPLATFORMVALUES_AWS_ECS:()=>het,CLOUDPLATFORMVALUES_AWS_EKS:()=>_et,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>yet,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Eet,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Cet,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>vet,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Iet,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>bet,CLOUDPLATFORMVALUES_AZURE_VM:()=>Tet,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Net,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Bet,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>xet,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Ret,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Det,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>uet,CLOUDPROVIDERVALUES_AWS:()=>cet,CLOUDPROVIDERVALUES_AZURE:()=>det,CLOUDPROVIDERVALUES_GCP:()=>pet,CloudPlatformValues:()=>Oet,CloudProviderValues:()=>fet,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>qJe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>tZe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>YJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>eZe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>JJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>rZe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>ZJe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>KJe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>nZe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>XJe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>WJe,DBSYSTEMVALUES_ADABAS:()=>gJe,DBSYSTEMVALUES_CACHE:()=>mJe,DBSYSTEMVALUES_CASSANDRA:()=>wJe,DBSYSTEMVALUES_CLOUDSCAPE:()=>sJe,DBSYSTEMVALUES_COCKROACHDB:()=>$Je,DBSYSTEMVALUES_COLDFUSION:()=>OJe,DBSYSTEMVALUES_COSMOSDB:()=>QJe,DBSYSTEMVALUES_COUCHBASE:()=>UJe,DBSYSTEMVALUES_COUCHDB:()=>LJe,DBSYSTEMVALUES_DB2:()=>rJe,DBSYSTEMVALUES_DERBY:()=>_Je,DBSYSTEMVALUES_DYNAMODB:()=>FJe,DBSYSTEMVALUES_EDB:()=>AJe,DBSYSTEMVALUES_ELASTICSEARCH:()=>HJe,DBSYSTEMVALUES_FILEMAKER:()=>EJe,DBSYSTEMVALUES_FIREBIRD:()=>hJe,DBSYSTEMVALUES_FIRSTSQL:()=>fJe,DBSYSTEMVALUES_GEODE:()=>jJe,DBSYSTEMVALUES_H2:()=>NJe,DBSYSTEMVALUES_HANADB:()=>dJe,DBSYSTEMVALUES_HBASE:()=>kJe,DBSYSTEMVALUES_HIVE:()=>aJe,DBSYSTEMVALUES_HSQLDB:()=>uJe,DBSYSTEMVALUES_INFORMIX:()=>SJe,DBSYSTEMVALUES_INGRES:()=>pJe,DBSYSTEMVALUES_INSTANTDB:()=>yJe,DBSYSTEMVALUES_INTERBASE:()=>TJe,DBSYSTEMVALUES_MARIADB:()=>IJe,DBSYSTEMVALUES_MAXDB:()=>lJe,DBSYSTEMVALUES_MEMCACHED:()=>zJe,DBSYSTEMVALUES_MONGODB:()=>MJe,DBSYSTEMVALUES_MSSQL:()=>eJe,DBSYSTEMVALUES_MYSQL:()=>tJe,DBSYSTEMVALUES_NEO4J:()=>GJe,DBSYSTEMVALUES_NETEZZA:()=>CJe,DBSYSTEMVALUES_ORACLE:()=>nJe,DBSYSTEMVALUES_OTHER_SQL:()=>XKe,DBSYSTEMVALUES_PERVASIVE:()=>bJe,DBSYSTEMVALUES_POINTBASE:()=>vJe,DBSYSTEMVALUES_POSTGRESQL:()=>oJe,DBSYSTEMVALUES_PROGRESS:()=>cJe,DBSYSTEMVALUES_REDIS:()=>PJe,DBSYSTEMVALUES_REDSHIFT:()=>iJe,DBSYSTEMVALUES_SQLITE:()=>RJe,DBSYSTEMVALUES_SYBASE:()=>xJe,DBSYSTEMVALUES_TERADATA:()=>DJe,DBSYSTEMVALUES_VERTICA:()=>BJe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Gtt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>jtt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Htt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>ztt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Vtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>qtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Ytt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Ktt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Jtt,DbCassandraConsistencyLevelValues:()=>oZe,DbSystemValues:()=>VJe,ERROR_TYPE_VALUE_OTHER:()=>Ztt,EVENT_EXCEPTION:()=>Eot,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>fZe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>pZe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>dZe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>mZe,FAASINVOKEDPROVIDERVALUES_AWS:()=>gZe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>hZe,FAASINVOKEDPROVIDERVALUES_GCP:()=>_Ze,FAASTRIGGERVALUES_DATASOURCE:()=>iZe,FAASTRIGGERVALUES_HTTP:()=>aZe,FAASTRIGGERVALUES_OTHER:()=>cZe,FAASTRIGGERVALUES_PUBSUB:()=>sZe,FAASTRIGGERVALUES_TIMER:()=>uZe,FaasDocumentOperationValues:()=>AZe,FaasInvokedProviderValues:()=>EZe,FaasTriggerValues:()=>lZe,HOSTARCHVALUES_AMD64:()=>Pet,HOSTARCHVALUES_ARM32:()=>Uet,HOSTARCHVALUES_ARM64:()=>Let,HOSTARCHVALUES_IA64:()=>Qet,HOSTARCHVALUES_PPC32:()=>Fet,HOSTARCHVALUES_PPC64:()=>Get,HOSTARCHVALUES_X86:()=>jet,HTTPFLAVORVALUES_HTTP_1_0:()=>nWe,HTTPFLAVORVALUES_HTTP_1_1:()=>rWe,HTTPFLAVORVALUES_HTTP_2_0:()=>oWe,HTTPFLAVORVALUES_QUIC:()=>aWe,HTTPFLAVORVALUES_SPDY:()=>iWe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>ont,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>int,HTTP_REQUEST_METHOD_VALUE_GET:()=>ant,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>snt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>unt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>rnt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>cnt,HTTP_REQUEST_METHOD_VALUE_POST:()=>lnt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>dnt,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>pnt,HostArchValues:()=>Het,HttpFlavorValues:()=>sWe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Snt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>ynt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Cnt,JVM_THREAD_STATE_VALUE_NEW:()=>bnt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>vnt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Rnt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>xnt,JVM_THREAD_STATE_VALUE_WAITING:()=>Dnt,MESSAGETYPEVALUES_RECEIVED:()=>wWe,MESSAGETYPEVALUES_SENT:()=>OWe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>uWe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>cWe,MESSAGINGOPERATIONVALUES_PROCESS:()=>pWe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>dWe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Trt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Irt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Crt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Rrt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>vrt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>brt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>xrt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Drt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Brt,METRIC_DOTNET_EXCEPTIONS:()=>Nrt,METRIC_DOTNET_GC_COLLECTIONS:()=>Ort,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>wrt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>krt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Mrt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Prt,METRIC_DOTNET_GC_PAUSE_TIME:()=>Urt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Lrt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Qrt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Frt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Grt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>jrt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Hrt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>zrt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>$rt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Vrt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>qrt,METRIC_DOTNET_TIMER_COUNT:()=>Yrt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Krt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Jrt,METRIC_JVM_CLASS_COUNT:()=>Zrt,METRIC_JVM_CLASS_LOADED:()=>Wrt,METRIC_JVM_CLASS_UNLOADED:()=>Xrt,METRIC_JVM_CPU_COUNT:()=>eot,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>tot,METRIC_JVM_CPU_TIME:()=>not,METRIC_JVM_GC_DURATION:()=>rot,METRIC_JVM_MEMORY_COMMITTED:()=>oot,METRIC_JVM_MEMORY_LIMIT:()=>iot,METRIC_JVM_MEMORY_USED:()=>aot,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>sot,METRIC_JVM_THREAD_COUNT:()=>uot,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>cot,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>lot,METRIC_KESTREL_CONNECTION_DURATION:()=>dot,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>pot,METRIC_KESTREL_QUEUED_REQUESTS:()=>fot,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Aot,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>mot,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>got,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>hot,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>_ot,MessageTypeValues:()=>kWe,MessagingDestinationKindValues:()=>lWe,MessagingOperationValues:()=>fWe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>UZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>FZe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>MZe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>qZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>LZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>QZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>$Ze,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>kZe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>KZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>GZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>HZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>YZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>jZe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>zZe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>ZZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>VZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>eWe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>WZe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>XZe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>JZe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>PZe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>BZe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>NZe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>OZe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>xZe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>DZe,NETTRANSPORTVALUES_INPROC:()=>bZe,NETTRANSPORTVALUES_IP:()=>TZe,NETTRANSPORTVALUES_IP_TCP:()=>SZe,NETTRANSPORTVALUES_IP_UDP:()=>yZe,NETTRANSPORTVALUES_OTHER:()=>vZe,NETTRANSPORTVALUES_PIPE:()=>CZe,NETTRANSPORTVALUES_UNIX:()=>IZe,NETWORK_TRANSPORT_VALUE_PIPE:()=>wnt,NETWORK_TRANSPORT_VALUE_QUIC:()=>knt,NETWORK_TRANSPORT_VALUE_TCP:()=>Mnt,NETWORK_TRANSPORT_VALUE_UDP:()=>Pnt,NETWORK_TRANSPORT_VALUE_UNIX:()=>Unt,NETWORK_TYPE_VALUE_IPV4:()=>Qnt,NETWORK_TYPE_VALUE_IPV6:()=>Fnt,NetHostConnectionSubtypeValues:()=>tWe,NetHostConnectionTypeValues:()=>wZe,NetTransportValues:()=>RZe,OSTYPEVALUES_AIX:()=>Wet,OSTYPEVALUES_DARWIN:()=>Vet,OSTYPEVALUES_DRAGONFLYBSD:()=>Jet,OSTYPEVALUES_FREEBSD:()=>qet,OSTYPEVALUES_HPUX:()=>Zet,OSTYPEVALUES_LINUX:()=>$et,OSTYPEVALUES_NETBSD:()=>Yet,OSTYPEVALUES_OPENBSD:()=>Ket,OSTYPEVALUES_SOLARIS:()=>Xet,OSTYPEVALUES_WINDOWS:()=>zet,OSTYPEVALUES_Z_OS:()=>ett,OTEL_STATUS_CODE_VALUE_ERROR:()=>znt,OTEL_STATUS_CODE_VALUE_OK:()=>$nt,OsTypeValues:()=>ttt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>CWe,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>SWe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>mWe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>DWe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>_We,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>IWe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>RWe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>hWe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>EWe,RPCGRPCSTATUSCODEVALUES_OK:()=>AWe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>bWe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>yWe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>TWe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>BWe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>xWe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>vWe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>gWe,RpcGrpcStatusCodeValues:()=>NWe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>lKe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>TKe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>sKe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>rKe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>SKe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>mKe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>fKe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>IKe,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>dKe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>oKe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>cKe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>AKe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>uKe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>iKe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>aKe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>yKe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>hKe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>_Ke,SEMATTRS_AWS_DYNAMODB_SELECT:()=>pKe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>gKe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>nKe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>EKe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Y7e,SEMATTRS_CODE_FILEPATH:()=>VYe,SEMATTRS_CODE_FUNCTION:()=>zYe,SEMATTRS_CODE_LINENO:()=>qYe,SEMATTRS_CODE_NAMESPACE:()=>$Ye,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>rYe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>uYe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>sYe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>iYe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>tYe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>nYe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>aYe,SEMATTRS_DB_CASSANDRA_TABLE:()=>oYe,SEMATTRS_DB_CONNECTION_STRING:()=>K7e,SEMATTRS_DB_HBASE_NAMESPACE:()=>cYe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Z7e,SEMATTRS_DB_MONGODB_COLLECTION:()=>dYe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>eYe,SEMATTRS_DB_NAME:()=>W7e,SEMATTRS_DB_OPERATION:()=>X7e,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>lYe,SEMATTRS_DB_SQL_TABLE:()=>pYe,SEMATTRS_DB_STATEMENT:()=>X$,SEMATTRS_DB_SYSTEM:()=>W$,SEMATTRS_DB_USER:()=>J7e,SEMATTRS_ENDUSER_ID:()=>QYe,SEMATTRS_ENDUSER_ROLE:()=>FYe,SEMATTRS_ENDUSER_SCOPE:()=>GYe,SEMATTRS_EXCEPTION_ESCAPED:()=>gYe,SEMATTRS_EXCEPTION_MESSAGE:()=>AYe,SEMATTRS_EXCEPTION_STACKTRACE:()=>mYe,SEMATTRS_EXCEPTION_TYPE:()=>fYe,SEMATTRS_FAAS_COLDSTART:()=>CYe,SEMATTRS_FAAS_CRON:()=>IYe,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>_Ye,SEMATTRS_FAAS_DOCUMENT_NAME:()=>yYe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>EYe,SEMATTRS_FAAS_DOCUMENT_TIME:()=>SYe,SEMATTRS_FAAS_EXECUTION:()=>hYe,SEMATTRS_FAAS_INVOKED_NAME:()=>bYe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>vYe,SEMATTRS_FAAS_INVOKED_REGION:()=>RYe,SEMATTRS_FAAS_TIME:()=>TYe,SEMATTRS_FAAS_TRIGGER:()=>e5,SEMATTRS_HTTP_CLIENT_IP:()=>tKe,SEMATTRS_HTTP_FLAVOR:()=>JYe,SEMATTRS_HTTP_HOST:()=>YYe,SEMATTRS_HTTP_METHOD:()=>nB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>WYe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>XYe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>i5,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>a5,SEMATTRS_HTTP_ROUTE:()=>s5,SEMATTRS_HTTP_SCHEME:()=>KYe,SEMATTRS_HTTP_SERVER_NAME:()=>eKe,SEMATTRS_HTTP_STATUS_CODE:()=>xS,SEMATTRS_HTTP_TARGET:()=>o5,SEMATTRS_HTTP_URL:()=>$C,SEMATTRS_HTTP_USER_AGENT:()=>ZYe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>JKe,SEMATTRS_MESSAGE_ID:()=>KKe,SEMATTRS_MESSAGE_TYPE:()=>YKe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>ZKe,SEMATTRS_MESSAGING_CONSUMER_ID:()=>MKe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>NKe,SEMATTRS_MESSAGING_DESTINATION:()=>CKe,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>bKe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>QKe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>LKe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>UKe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>FKe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>GKe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>BKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>wKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>OKe,SEMATTRS_MESSAGING_OPERATION:()=>kKe,SEMATTRS_MESSAGING_PROTOCOL:()=>RKe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>xKe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>PKe,SEMATTRS_MESSAGING_SYSTEM:()=>u5,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>vKe,SEMATTRS_MESSAGING_URL:()=>DKe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>UYe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>MYe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>PYe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>kYe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>wYe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>OYe,SEMATTRS_NET_HOST_IP:()=>n5,SEMATTRS_NET_HOST_NAME:()=>NYe,SEMATTRS_NET_HOST_PORT:()=>r5,SEMATTRS_NET_PEER_IP:()=>t5,SEMATTRS_NET_PEER_NAME:()=>BYe,SEMATTRS_NET_PEER_PORT:()=>DYe,SEMATTRS_NET_TRANSPORT:()=>xYe,SEMATTRS_PEER_SERVICE:()=>LYe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>l5,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>VKe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>qKe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>$Ke,SEMATTRS_RPC_JSONRPC_VERSION:()=>zKe,SEMATTRS_RPC_METHOD:()=>HKe,SEMATTRS_RPC_SERVICE:()=>c5,SEMATTRS_RPC_SYSTEM:()=>jKe,SEMATTRS_THREAD_ID:()=>jYe,SEMATTRS_THREAD_NAME:()=>HYe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>GWe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>FWe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>jWe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>HWe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>zWe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>$We,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>VWe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>YWe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>qWe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>JWe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>KWe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>PWe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>LWe,SEMRESATTRS_CLOUD_PLATFORM:()=>QWe,SEMRESATTRS_CLOUD_PROVIDER:()=>MWe,SEMRESATTRS_CLOUD_REGION:()=>UWe,SEMRESATTRS_CONTAINER_ID:()=>WWe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>eXe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>tXe,SEMRESATTRS_CONTAINER_NAME:()=>ZWe,SEMRESATTRS_CONTAINER_RUNTIME:()=>XWe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>nXe,SEMRESATTRS_DEVICE_ID:()=>rXe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>oXe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>iXe,SEMRESATTRS_FAAS_ID:()=>sXe,SEMRESATTRS_FAAS_INSTANCE:()=>cXe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>lXe,SEMRESATTRS_FAAS_NAME:()=>aXe,SEMRESATTRS_FAAS_VERSION:()=>uXe,SEMRESATTRS_HOST_ARCH:()=>AXe,SEMRESATTRS_HOST_ID:()=>dXe,SEMRESATTRS_HOST_IMAGE_ID:()=>gXe,SEMRESATTRS_HOST_IMAGE_NAME:()=>mXe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>hXe,SEMRESATTRS_HOST_NAME:()=>pXe,SEMRESATTRS_HOST_TYPE:()=>fXe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>_Xe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>CXe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>PXe,SEMRESATTRS_K8S_CRONJOB_UID:()=>MXe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>OXe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>NXe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>xXe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>RXe,SEMRESATTRS_K8S_JOB_NAME:()=>kXe,SEMRESATTRS_K8S_JOB_UID:()=>wXe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>yXe,SEMRESATTRS_K8S_NODE_NAME:()=>EXe,SEMRESATTRS_K8S_NODE_UID:()=>SXe,SEMRESATTRS_K8S_POD_NAME:()=>IXe,SEMRESATTRS_K8S_POD_UID:()=>TXe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>vXe,SEMRESATTRS_K8S_REPLICASET_UID:()=>bXe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>BXe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>DXe,SEMRESATTRS_OS_DESCRIPTION:()=>LXe,SEMRESATTRS_OS_NAME:()=>QXe,SEMRESATTRS_OS_TYPE:()=>UXe,SEMRESATTRS_OS_VERSION:()=>FXe,SEMRESATTRS_PROCESS_COMMAND:()=>zXe,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>VXe,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>$Xe,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>jXe,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>HXe,SEMRESATTRS_PROCESS_OWNER:()=>qXe,SEMRESATTRS_PROCESS_PID:()=>GXe,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>JXe,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>YXe,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>KXe,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>WXe,SEMRESATTRS_SERVICE_NAME:()=>ZXe,SEMRESATTRS_SERVICE_NAMESPACE:()=>d5,SEMRESATTRS_SERVICE_VERSION:()=>XXe,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>ret,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>tet,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>eet,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>net,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>aet,SEMRESATTRS_WEBENGINE_NAME:()=>oet,SEMRESATTRS_WEBENGINE_VERSION:()=>iet,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Jnt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Znt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Wnt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>ert,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>trt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>nrt,SemanticAttributes:()=>WKe,SemanticResourceAttributes:()=>set,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>ntt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>rtt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>ott,TELEMETRYSDKLANGUAGEVALUES_GO:()=>itt,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>att,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>stt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>utt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>ctt,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>ltt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>dtt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>ort,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>irt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>art,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>srt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>urt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>crt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>lrt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>drt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>prt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>frt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Art,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>mrt,TelemetrySdkLanguageValues:()=>ptt});var Zn=O(()=>{m();Sge();V_e();q_e();Y_e();K_e()});var J_e=F(h2=>{"use strict";m();Object.defineProperty(h2,"__esModule",{value:!0});h2.ATTR_PROCESS_RUNTIME_NAME=void 0;h2.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var Z_e=F(E2=>{"use strict";m();Object.defineProperty(E2,"__esModule",{value:!0});E2.SDK_INFO=void 0;var Sot=Dde(),_2=(Zn(),Me(Ur)),yot=J_e();E2.SDK_INFO={[_2.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[yot.ATTR_PROCESS_RUNTIME_NAME]:"node",[_2.ATTR_TELEMETRY_SDK_LANGUAGE]:_2.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[_2.ATTR_TELEMETRY_SDK_VERSION]:Sot.VERSION}});var W_e=F(Zs=>{"use strict";m();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.otperformance=Zs.SDK_INFO=Zs._globalThis=Zs.getStringListFromEnv=Zs.getNumberFromEnv=Zs.getBooleanFromEnv=Zs.getStringFromEnv=void 0;var S2=Rde();Object.defineProperty(Zs,"getStringFromEnv",{enumerable:!0,get:function(){return S2.getStringFromEnv}});Object.defineProperty(Zs,"getBooleanFromEnv",{enumerable:!0,get:function(){return S2.getBooleanFromEnv}});Object.defineProperty(Zs,"getNumberFromEnv",{enumerable:!0,get:function(){return S2.getNumberFromEnv}});Object.defineProperty(Zs,"getStringListFromEnv",{enumerable:!0,get:function(){return S2.getStringListFromEnv}});var Tot=xde();Object.defineProperty(Zs,"_globalThis",{enumerable:!0,get:function(){return Tot._globalThis}});var Iot=Z_e();Object.defineProperty(Zs,"SDK_INFO",{enumerable:!0,get:function(){return Iot.SDK_INFO}});Zs.otperformance=performance});var v5=F(Ws=>{"use strict";m();Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getStringListFromEnv=Ws.getNumberFromEnv=Ws.getStringFromEnv=Ws.getBooleanFromEnv=Ws.otperformance=Ws._globalThis=Ws.SDK_INFO=void 0;var NS=W_e();Object.defineProperty(Ws,"SDK_INFO",{enumerable:!0,get:function(){return NS.SDK_INFO}});Object.defineProperty(Ws,"_globalThis",{enumerable:!0,get:function(){return NS._globalThis}});Object.defineProperty(Ws,"otperformance",{enumerable:!0,get:function(){return NS.otperformance}});Object.defineProperty(Ws,"getBooleanFromEnv",{enumerable:!0,get:function(){return NS.getBooleanFromEnv}});Object.defineProperty(Ws,"getStringFromEnv",{enumerable:!0,get:function(){return NS.getStringFromEnv}});Object.defineProperty(Ws,"getNumberFromEnv",{enumerable:!0,get:function(){return NS.getNumberFromEnv}});Object.defineProperty(Ws,"getStringListFromEnv",{enumerable:!0,get:function(){return NS.getStringListFromEnv}})});var nEe=F(io=>{"use strict";m();Object.defineProperty(io,"__esModule",{value:!0});io.addHrTimes=io.isTimeInput=io.isTimeInputHrTime=io.hrTimeToMicroseconds=io.hrTimeToMilliseconds=io.hrTimeToNanoseconds=io.hrTimeToTimeStamp=io.hrTimeDuration=io.timeInputToHrTime=io.hrTime=io.getTimeOrigin=io.millisToHrTime=void 0;var y2=v5(),X_e=9,Cot=6,bot=Math.pow(10,Cot),T2=Math.pow(10,X_e);function rB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*bot);return[n,r]}io.millisToHrTime=rB;function vot(){return y2.otperformance.timeOrigin}io.getTimeOrigin=vot;function eEe(e){let t=rB(y2.otperformance.timeOrigin),n=rB(typeof e=="number"?e:y2.otperformance.now());return tEe(t,n)}io.hrTime=eEe;function Rot(e){if(R5(e))return e;if(typeof e=="number")return e<y2.otperformance.timeOrigin?eEe(e):rB(e);if(e instanceof Date)return rB(e.getTime());throw TypeError("Invalid input type")}io.timeInputToHrTime=Rot;function xot(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=T2),[n,r]}io.hrTimeDuration=xot;function Dot(e){let t=X_e,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}io.hrTimeToTimeStamp=Dot;function Bot(e){return e[0]*T2+e[1]}io.hrTimeToNanoseconds=Bot;function Not(e){return e[0]*1e3+e[1]/1e6}io.hrTimeToMilliseconds=Not;function Oot(e){return e[0]*1e6+e[1]/1e3}io.hrTimeToMicroseconds=Oot;function R5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}io.isTimeInputHrTime=R5;function wot(e){return R5(e)||typeof e=="number"||e instanceof Date}io.isTimeInput=wot;function tEe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=T2&&(n[1]-=T2,n[0]+=1),n}io.addHrTimes=tEe});var rEe=F(I2=>{"use strict";m();Object.defineProperty(I2,"__esModule",{value:!0});I2.unrefTimer=void 0;function kot(e){typeof e!="number"&&e.unref()}I2.unrefTimer=kot});var oEe=F(oB=>{"use strict";m();Object.defineProperty(oB,"__esModule",{value:!0});oB.ExportResultCode=void 0;var Mot;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(Mot=oB.ExportResultCode||(oB.ExportResultCode={}))});var aEe=F(C2=>{"use strict";m();Object.defineProperty(C2,"__esModule",{value:!0});C2.CompositePropagator=void 0;var iEe=(je(),Me(We)),x5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){iEe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(a){iEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return o},t)}fields(){return this._fields.slice()}};C2.CompositePropagator=x5});var sEe=F(qC=>{"use strict";m();Object.defineProperty(qC,"__esModule",{value:!0});qC.validateValue=qC.validateKey=void 0;var D5="[_0-9a-z-*/]",Pot=`[a-z]${D5}{0,255}`,Uot=`[a-z0-9]${D5}{0,240}@[a-z]${D5}{0,13}`,Lot=new RegExp(`^(?:${Pot}|${Uot})$`),Qot=/^[ -~]{0,255}[!-~]$/,Fot=/,|=/;function Got(e){return Lot.test(e)}qC.validateKey=Got;function jot(e){return Qot.test(e)&&!Fot.test(e)}qC.validateValue=jot});var N5=F(b2=>{"use strict";m();Object.defineProperty(b2,"__esModule",{value:!0});b2.TraceState=void 0;var uEe=sEe(),cEe=32,Hot=512,lEe=",",dEe="=",B5=class e{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,n)=>(t.push(n+dEe+this.get(n)),t),[]).join(lEe)}_parse(t){t.length>Hot||(this._internalState=t.split(lEe).reverse().reduce((n,r)=>{let o=r.trim(),i=o.indexOf(dEe);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);(0,uEe.validateKey)(a)&&(0,uEe.validateValue)(c)&&n.set(a,c)}return n},new Map),this._internalState.size>cEe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,cEe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};b2.TraceState=B5});var fEe=F(Xs=>{"use strict";m();Object.defineProperty(Xs,"__esModule",{value:!0});Xs.W3CTraceContextPropagator=Xs.parseTraceParent=Xs.TRACE_STATE_HEADER=Xs.TRACE_PARENT_HEADER=void 0;var v2=(je(),Me(We)),zot=tB(),$ot=N5();Xs.TRACE_PARENT_HEADER="traceparent";Xs.TRACE_STATE_HEADER="tracestate";var Vot="00",qot="(?!ff)[\\da-f]{2}",Yot="(?![0]{32})[\\da-f]{32}",Kot="(?![0]{16})[\\da-f]{16}",Jot="[\\da-f]{2}",Zot=new RegExp(`^\\s?(${qot})-(${Yot})-(${Kot})-(${Jot})(-.*)?\\s?$`);function pEe(e){let t=Zot.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}Xs.parseTraceParent=pEe;var O5=class{inject(t,n,r){let o=v2.trace.getSpanContext(t);if(!o||(0,zot.isTracingSuppressed)(t)||!(0,v2.isSpanContextValid)(o))return;let i=`${Vot}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||v2.TraceFlags.NONE).toString(16)}`;r.set(n,Xs.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,Xs.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,Xs.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let a=pEe(i);if(!a)return t;a.isRemote=!0;let c=r.get(n,Xs.TRACE_STATE_HEADER);if(c){let d=Array.isArray(c)?c.join(","):c;a.traceState=new $ot.TraceState(typeof d=="string"?d:void 0)}return v2.trace.setSpanContext(t,a)}fields(){return[Xs.TRACE_PARENT_HEADER,Xs.TRACE_STATE_HEADER]}};Xs.W3CTraceContextPropagator=O5});var AEe=F(Yp=>{"use strict";m();Object.defineProperty(Yp,"__esModule",{value:!0});Yp.getRPCMetadata=Yp.deleteRPCMetadata=Yp.setRPCMetadata=Yp.RPCType=void 0;var Wot=(je(),Me(We)),w5=(0,Wot.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Xot;(function(e){e.HTTP="http"})(Xot=Yp.RPCType||(Yp.RPCType={}));function eit(e,t){return e.setValue(w5,t)}Yp.setRPCMetadata=eit;function tit(e){return e.deleteValue(w5)}Yp.deleteRPCMetadata=tit;function nit(e){return e.getValue(w5)}Yp.getRPCMetadata=nit});var EEe=F(R2=>{"use strict";m();Object.defineProperty(R2,"__esModule",{value:!0});R2.isPlainObject=void 0;var rit="[object Object]",oit="[object Null]",iit="[object Undefined]",ait=Function.prototype,mEe=ait.toString,sit=mEe.call(Object),uit=Object.getPrototypeOf,gEe=Object.prototype,hEe=gEe.hasOwnProperty,OS=Symbol?Symbol.toStringTag:void 0,_Ee=gEe.toString;function cit(e){if(!lit(e)||dit(e)!==rit)return!1;let t=uit(e);if(t===null)return!0;let n=hEe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&mEe.call(n)===sit}R2.isPlainObject=cit;function lit(e){return e!=null&&typeof e=="object"}function dit(e){return e==null?e===void 0?iit:oit:OS&&OS in Object(e)?pit(e):fit(e)}function pit(e){let t=hEe.call(e,OS),n=e[OS],r=!1;try{e[OS]=void 0,r=!0}catch{}let o=_Ee.call(e);return r&&(t?e[OS]=n:delete e[OS]),o}function fit(e){return _Ee.call(e)}});var CEe=F(B2=>{"use strict";m();Object.defineProperty(B2,"__esModule",{value:!0});B2.merge=void 0;var SEe=EEe(),Ait=20;function mit(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=TEe(t,e.shift(),0,n);return t}B2.merge=mit;function k5(e){return D2(e)?e.slice():e}function TEe(e,t,n=0,r){let o;if(!(n>Ait)){if(n++,x2(e)||x2(t)||IEe(t))o=k5(t);else if(D2(e)){if(o=e.slice(),D2(t))for(let i=0,a=t.length;i<a;i++)o.push(k5(t[i]));else if(iB(t)){let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a];o[d]=k5(t[d])}}}else if(iB(e))if(iB(t)){if(!git(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a],g=t[d];if(x2(g))typeof g>"u"?delete o[d]:o[d]=g;else{let h=o[d],S=g;if(yEe(e,d,r)||yEe(t,d,r))delete o[d];else{if(iB(h)&&iB(S)){let y=r.get(h)||[],C=r.get(S)||[];y.push({obj:e,key:d}),C.push({obj:t,key:d}),r.set(h,y),r.set(S,C)}o[d]=TEe(o[d],g,n,r)}}}}else o=t;return o}}function yEe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let a=r[o];if(a.key===t&&a.obj===e)return!0}return!1}function D2(e){return Array.isArray(e)}function IEe(e){return typeof e=="function"}function iB(e){return!x2(e)&&!D2(e)&&!IEe(e)&&typeof e=="object"}function x2(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function git(e,t){return!(!(0,SEe.isPlainObject)(e)||!(0,SEe.isPlainObject)(t))}});var bEe=F(YC=>{"use strict";m();Object.defineProperty(YC,"__esModule",{value:!0});YC.callWithTimeout=YC.TimeoutError=void 0;var N2=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};YC.TimeoutError=N2;function hit(e,t){let n,r=new Promise(function(i,a){n=setTimeout(function(){a(new N2("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}YC.callWithTimeout=hit});var REe=F(KC=>{"use strict";m();Object.defineProperty(KC,"__esModule",{value:!0});KC.isUrlIgnored=KC.urlMatches=void 0;function vEe(e,t){return typeof t=="string"?e===t:!!e.match(t)}KC.urlMatches=vEe;function _it(e,t){if(!t)return!1;for(let n of t)if(vEe(e,n))return!0;return!1}KC.isUrlIgnored=_it});var xEe=F(O2=>{"use strict";m();Object.defineProperty(O2,"__esModule",{value:!0});O2.Deferred=void 0;var M5=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};O2.Deferred=M5});var DEe=F(w2=>{"use strict";m();Object.defineProperty(w2,"__esModule",{value:!0});w2.BindOnceFuture=void 0;var Eit=xEe(),P5=class{_isCalled=!1;_deferred=new Eit.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};w2.BindOnceFuture=P5});var NEe=F(k2=>{"use strict";m();Object.defineProperty(k2,"__esModule",{value:!0});k2.diagLogLevelFromString=void 0;var rg=(je(),Me(We)),BEe={ALL:rg.DiagLogLevel.ALL,VERBOSE:rg.DiagLogLevel.VERBOSE,DEBUG:rg.DiagLogLevel.DEBUG,INFO:rg.DiagLogLevel.INFO,WARN:rg.DiagLogLevel.WARN,ERROR:rg.DiagLogLevel.ERROR,NONE:rg.DiagLogLevel.NONE};function Sit(e){if(e==null)return;let t=BEe[e.toUpperCase()];return t??(rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(BEe)}, using default`),rg.DiagLogLevel.INFO)}k2.diagLogLevelFromString=Sit});var wEe=F(M2=>{"use strict";m();Object.defineProperty(M2,"__esModule",{value:!0});M2._export=void 0;var OEe=(je(),Me(We)),yit=tB();function Tit(e,t){return new Promise(n=>{OEe.context.with((0,yit.suppressTracing)(OEe.context.active()),()=>{e.export(t,n)})})}M2._export=Tit});var Tr=F(Oe=>{"use strict";m();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.internal=Oe.diagLogLevelFromString=Oe.BindOnceFuture=Oe.urlMatches=Oe.isUrlIgnored=Oe.callWithTimeout=Oe.TimeoutError=Oe.merge=Oe.TraceState=Oe.unsuppressTracing=Oe.suppressTracing=Oe.isTracingSuppressed=Oe.setRPCMetadata=Oe.getRPCMetadata=Oe.deleteRPCMetadata=Oe.RPCType=Oe.parseTraceParent=Oe.W3CTraceContextPropagator=Oe.TRACE_STATE_HEADER=Oe.TRACE_PARENT_HEADER=Oe.CompositePropagator=Oe.otperformance=Oe.getStringListFromEnv=Oe.getNumberFromEnv=Oe.getBooleanFromEnv=Oe.getStringFromEnv=Oe._globalThis=Oe.SDK_INFO=Oe.parseKeyPairsIntoRecord=Oe.ExportResultCode=Oe.unrefTimer=Oe.timeInputToHrTime=Oe.millisToHrTime=Oe.isTimeInputHrTime=Oe.isTimeInput=Oe.hrTimeToTimeStamp=Oe.hrTimeToNanoseconds=Oe.hrTimeToMilliseconds=Oe.hrTimeToMicroseconds=Oe.hrTimeDuration=Oe.hrTime=Oe.getTimeOrigin=Oe.addHrTimes=Oe.loggingErrorHandler=Oe.setGlobalErrorHandler=Oe.globalErrorHandler=Oe.sanitizeAttributes=Oe.isAttributeValue=Oe.AnchoredClock=Oe.W3CBaggagePropagator=void 0;var Iit=mde();Object.defineProperty(Oe,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Iit.W3CBaggagePropagator}});var Cit=gde();Object.defineProperty(Oe,"AnchoredClock",{enumerable:!0,get:function(){return Cit.AnchoredClock}});var kEe=yde();Object.defineProperty(Oe,"isAttributeValue",{enumerable:!0,get:function(){return kEe.isAttributeValue}});Object.defineProperty(Oe,"sanitizeAttributes",{enumerable:!0,get:function(){return kEe.sanitizeAttributes}});var MEe=Ide();Object.defineProperty(Oe,"globalErrorHandler",{enumerable:!0,get:function(){return MEe.globalErrorHandler}});Object.defineProperty(Oe,"setGlobalErrorHandler",{enumerable:!0,get:function(){return MEe.setGlobalErrorHandler}});var bit=J$();Object.defineProperty(Oe,"loggingErrorHandler",{enumerable:!0,get:function(){return bit.loggingErrorHandler}});var Dd=nEe();Object.defineProperty(Oe,"addHrTimes",{enumerable:!0,get:function(){return Dd.addHrTimes}});Object.defineProperty(Oe,"getTimeOrigin",{enumerable:!0,get:function(){return Dd.getTimeOrigin}});Object.defineProperty(Oe,"hrTime",{enumerable:!0,get:function(){return Dd.hrTime}});Object.defineProperty(Oe,"hrTimeDuration",{enumerable:!0,get:function(){return Dd.hrTimeDuration}});Object.defineProperty(Oe,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Dd.hrTimeToMicroseconds}});Object.defineProperty(Oe,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Dd.hrTimeToMilliseconds}});Object.defineProperty(Oe,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Dd.hrTimeToNanoseconds}});Object.defineProperty(Oe,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Dd.hrTimeToTimeStamp}});Object.defineProperty(Oe,"isTimeInput",{enumerable:!0,get:function(){return Dd.isTimeInput}});Object.defineProperty(Oe,"isTimeInputHrTime",{enumerable:!0,get:function(){return Dd.isTimeInputHrTime}});Object.defineProperty(Oe,"millisToHrTime",{enumerable:!0,get:function(){return Dd.millisToHrTime}});Object.defineProperty(Oe,"timeInputToHrTime",{enumerable:!0,get:function(){return Dd.timeInputToHrTime}});var vit=rEe();Object.defineProperty(Oe,"unrefTimer",{enumerable:!0,get:function(){return vit.unrefTimer}});var Rit=oEe();Object.defineProperty(Oe,"ExportResultCode",{enumerable:!0,get:function(){return Rit.ExportResultCode}});var xit=$$();Object.defineProperty(Oe,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return xit.parseKeyPairsIntoRecord}});var wS=v5();Object.defineProperty(Oe,"SDK_INFO",{enumerable:!0,get:function(){return wS.SDK_INFO}});Object.defineProperty(Oe,"_globalThis",{enumerable:!0,get:function(){return wS._globalThis}});Object.defineProperty(Oe,"getStringFromEnv",{enumerable:!0,get:function(){return wS.getStringFromEnv}});Object.defineProperty(Oe,"getBooleanFromEnv",{enumerable:!0,get:function(){return wS.getBooleanFromEnv}});Object.defineProperty(Oe,"getNumberFromEnv",{enumerable:!0,get:function(){return wS.getNumberFromEnv}});Object.defineProperty(Oe,"getStringListFromEnv",{enumerable:!0,get:function(){return wS.getStringListFromEnv}});Object.defineProperty(Oe,"otperformance",{enumerable:!0,get:function(){return wS.otperformance}});var Dit=aEe();Object.defineProperty(Oe,"CompositePropagator",{enumerable:!0,get:function(){return Dit.CompositePropagator}});var P2=fEe();Object.defineProperty(Oe,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return P2.TRACE_PARENT_HEADER}});Object.defineProperty(Oe,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return P2.TRACE_STATE_HEADER}});Object.defineProperty(Oe,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return P2.W3CTraceContextPropagator}});Object.defineProperty(Oe,"parseTraceParent",{enumerable:!0,get:function(){return P2.parseTraceParent}});var U2=AEe();Object.defineProperty(Oe,"RPCType",{enumerable:!0,get:function(){return U2.RPCType}});Object.defineProperty(Oe,"deleteRPCMetadata",{enumerable:!0,get:function(){return U2.deleteRPCMetadata}});Object.defineProperty(Oe,"getRPCMetadata",{enumerable:!0,get:function(){return U2.getRPCMetadata}});Object.defineProperty(Oe,"setRPCMetadata",{enumerable:!0,get:function(){return U2.setRPCMetadata}});var U5=tB();Object.defineProperty(Oe,"isTracingSuppressed",{enumerable:!0,get:function(){return U5.isTracingSuppressed}});Object.defineProperty(Oe,"suppressTracing",{enumerable:!0,get:function(){return U5.suppressTracing}});Object.defineProperty(Oe,"unsuppressTracing",{enumerable:!0,get:function(){return U5.unsuppressTracing}});var Bit=N5();Object.defineProperty(Oe,"TraceState",{enumerable:!0,get:function(){return Bit.TraceState}});var Nit=CEe();Object.defineProperty(Oe,"merge",{enumerable:!0,get:function(){return Nit.merge}});var PEe=bEe();Object.defineProperty(Oe,"TimeoutError",{enumerable:!0,get:function(){return PEe.TimeoutError}});Object.defineProperty(Oe,"callWithTimeout",{enumerable:!0,get:function(){return PEe.callWithTimeout}});var UEe=REe();Object.defineProperty(Oe,"isUrlIgnored",{enumerable:!0,get:function(){return UEe.isUrlIgnored}});Object.defineProperty(Oe,"urlMatches",{enumerable:!0,get:function(){return UEe.urlMatches}});var Oit=DEe();Object.defineProperty(Oe,"BindOnceFuture",{enumerable:!0,get:function(){return Oit.BindOnceFuture}});var wit=NEe();Object.defineProperty(Oe,"diagLogLevelFromString",{enumerable:!0,get:function(){return wit.diagLogLevelFromString}});var kit=wEe();Oe.internal={_export:kit._export}});var LEe=F(L2=>{"use strict";m();Object.defineProperty(L2,"__esModule",{value:!0});L2.VERSION=void 0;L2.VERSION="0.214.0"});var QEe=F(aB=>{"use strict";m();Object.defineProperty(aB,"__esModule",{value:!0});aB.SeverityNumber=void 0;var Mit;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Mit=aB.SeverityNumber||(aB.SeverityNumber={}))});var F2=F(JC=>{"use strict";m();Object.defineProperty(JC,"__esModule",{value:!0});JC.NOOP_LOGGER=JC.NoopLogger=void 0;var Q2=class{emit(t){}};JC.NoopLogger=Q2;JC.NOOP_LOGGER=new Q2});var FEe=F(dA=>{"use strict";m();Object.defineProperty(dA,"__esModule",{value:!0});dA.API_BACKWARDS_COMPATIBILITY_VERSION=dA.makeGetter=dA._global=dA.GLOBAL_LOGS_API_KEY=void 0;dA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");dA._global=globalThis;function Pit(e,t,n){return r=>r===e?t:n}dA.makeGetter=Pit;dA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var L5=F(ZC=>{"use strict";m();Object.defineProperty(ZC,"__esModule",{value:!0});ZC.NOOP_LOGGER_PROVIDER=ZC.NoopLoggerProvider=void 0;var Uit=F2(),G2=class{getLogger(t,n,r){return new Uit.NoopLogger}};ZC.NoopLoggerProvider=G2;ZC.NOOP_LOGGER_PROVIDER=new G2});var GEe=F(j2=>{"use strict";m();Object.defineProperty(j2,"__esModule",{value:!0});j2.ProxyLogger=void 0;var Lit=F2(),Q5=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Lit.NOOP_LOGGER}};j2.ProxyLogger=Q5});var jEe=F(H2=>{"use strict";m();Object.defineProperty(H2,"__esModule",{value:!0});H2.ProxyLoggerProvider=void 0;var Qit=L5(),Fit=GEe(),F5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Fit.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Qit.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};H2.ProxyLoggerProvider=F5});var zEe=F(z2=>{"use strict";m();Object.defineProperty(z2,"__esModule",{value:!0});z2.LogsAPI=void 0;var Bd=FEe(),Git=L5(),HEe=jEe(),G5=class e{constructor(){this._proxyLoggerProvider=new HEe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Bd._global[Bd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Bd._global[Bd.GLOBAL_LOGS_API_KEY]=(0,Bd.makeGetter)(Bd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Git.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Bd._global[Bd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Bd._global,Bd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Bd._global[Bd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new HEe.ProxyLoggerProvider}};z2.LogsAPI=G5});var j5=F(pA=>{"use strict";m();Object.defineProperty(pA,"__esModule",{value:!0});pA.logs=pA.NoopLogger=pA.NOOP_LOGGER=pA.SeverityNumber=void 0;var jit=QEe();Object.defineProperty(pA,"SeverityNumber",{enumerable:!0,get:function(){return jit.SeverityNumber}});var $Ee=F2();Object.defineProperty(pA,"NOOP_LOGGER",{enumerable:!0,get:function(){return $Ee.NOOP_LOGGER}});Object.defineProperty(pA,"NoopLogger",{enumerable:!0,get:function(){return $Ee.NoopLogger}});var Hit=zEe();pA.logs=Hit.LogsAPI.getInstance()});var VEe=F(WC=>{"use strict";m();Object.defineProperty(WC,"__esModule",{value:!0});WC.disableInstrumentations=WC.enableInstrumentations=void 0;function zit(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}WC.enableInstrumentations=zit;function $it(e){e.forEach(t=>t.disable())}WC.disableInstrumentations=$it});var KEe=F($2=>{"use strict";m();Object.defineProperty($2,"__esModule",{value:!0});$2.registerInstrumentations=void 0;var qEe=(je(),Me(We)),Vit=j5(),YEe=VEe();function qit(e){let t=e.tracerProvider||qEe.trace.getTracerProvider(),n=e.meterProvider||qEe.metrics.getMeterProvider(),r=e.loggerProvider||Vit.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,YEe.enableInstrumentations)(o,t,n,r),()=>{(0,YEe.disableInstrumentations)(o)}}$2.registerInstrumentations=qit});var o0e=F(V2=>{"use strict";m();Object.defineProperty(V2,"__esModule",{value:!0});V2.satisfies=void 0;var V5=(je(),Me(We)),e0e=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Yit=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Kit={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Jit(e,t,n){if(!Zit(e))return V5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=tat(e);if(!r)return!1;let o=[],i=t0e(r,t,o,n);return i&&!n?.includePrerelease?Xit(r,o):i}V2.satisfies=Jit;function Zit(e){return typeof e=="string"&&e0e.test(e)}function t0e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(H5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Tat(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!H5(e,i,n,r))return!1;return!0}return H5(e,t,n,r)}function H5(e,t,n,r){if(t=eat(t,r),t.includes(" "))return t0e(e,t,n,r);{let o=nat(t);return n.push(o),Wit(e,o)}}function Wit(e,t){if(t.invalid)return!1;if(!t.version||$5(t.version))return!0;let n=ZEe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=ZEe(r,o)}return Kit[t.op]?.includes(n)}function Xit(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function eat(e,t){return e=e.trim(),e=Sat(e,t),e=Eat(e),e=yat(e,t),e=e.trim(),e}function wu(e){return!e||e.toLowerCase()==="x"||e==="*"}function tat(e){let t=e.match(e0e);if(!t){V5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function nat(e){if(!e)return{};let t=e.match(Yit);if(!t)return V5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function $5(e){return e==="*"||e==="x"||e==="X"}function JEe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function rat(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function oat(e,t){if($5(e)||$5(t))return 0;let[n,r]=rat(JEe(e),JEe(t));return n>r?1:n<r?-1:0}function ZEe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=oat(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var n0e="[a-zA-Z0-9-]",r0e="0|[1-9]\\d*",iat=`\\d*[a-zA-Z-]${n0e}*`,aat="((?:<|>)?=?)",WEe=`(?:${r0e}|${iat})`,sat=`(?:-(${WEe}(?:\\.${WEe})*))`,XEe=`${n0e}+`,uat=`(?:\\+(${XEe}(?:\\.${XEe})*))`,z5=`${r0e}|x|X|\\*`,sB=`[v=\\s]*(${z5})(?:\\.(${z5})(?:\\.(${z5})(?:${sat})?${uat}?)?)?`,cat=`^${aat}\\s*${sB}$`,lat=new RegExp(cat),dat=`^\\s*(${sB})\\s+-\\s+(${sB})\\s*$`,pat=new RegExp(dat),fat="(?:~>?)",Aat=`^${fat}${sB}$`,mat=new RegExp(Aat),gat="(?:\\^)",hat=`^${gat}${sB}$`,_at=new RegExp(hat);function Eat(e){let t=mat;return e.replace(t,(n,r,o,i,a)=>{let c;return wu(r)?c="":wu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:wu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Sat(e,t){let n=_at,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let g;return wu(i)?g="":wu(a)?g=`>=${i}.0.0${r} <${+i+1}.0.0-0`:wu(c)?i==="0"?g=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?g=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?g=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,g})}function yat(e,t){let n=lat;return e.replace(n,(r,o,i,a,c,d)=>{let g=wu(i),h=g||wu(a),S=h||wu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",g?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function Tat(e,t){let n=pat;return e.replace(n,(r,o,i,a,c,d,g,h,S,y,C,v)=>(wu(i)?o="":wu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:wu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,wu(S)?h="":wu(y)?h=`<${+S+1}.0.0-0`:wu(C)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${C}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+C+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var q5=F(Ts=>{"use strict";m();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.massUnwrap=Ts.unwrap=Ts.massWrap=Ts.wrap=void 0;var ku=console.error.bind(console);function uB(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Iat=(e,t,n)=>{if(!e||!e[t]){ku("no original function "+String(t)+" to wrap");return}if(!n){ku("no wrapper function"),ku(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ku("original object and wrapper must be functions");return}let o=n(r,t);return uB(o,"__original",r),uB(o,"__unwrap",()=>{e[t]===o&&uB(e,t,r)}),uB(o,"__wrapped",!0),uB(e,t,o),o};Ts.wrap=Iat;var Cat=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ku("must provide one or more modules to patch"),ku(new Error().stack);return}if(!(t&&Array.isArray(t))){ku("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ts.wrap)(r,o,n)})})};Ts.massWrap=Cat;var bat=(e,t)=>{if(!e||!e[t]){ku("no function to unwrap."),ku(new Error().stack);return}let n=e[t];if(!n.__unwrap)ku("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ts.unwrap=bat;var vat=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ku("must provide one or more modules to patch"),ku(new Error().stack);return}if(!(t&&Array.isArray(t))){ku("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ts.unwrap)(n,r)})})};Ts.massUnwrap=vat;function cB(e){e&&e.logger&&(typeof e.logger!="function"?ku("new logger isn't a function, not replacing"):ku=e.logger)}Ts.default=cB;cB.wrap=Ts.wrap;cB.massWrap=Ts.massWrap;cB.unwrap=Ts.unwrap;cB.massUnwrap=Ts.massUnwrap});var i0e=F(Y2=>{"use strict";m();Object.defineProperty(Y2,"__esModule",{value:!0});Y2.InstrumentationAbstract=void 0;var Y5=(je(),Me(We)),Rat=j5(),q2=q5(),K5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=Y5.diag.createComponentLogger({namespace:t}),this._tracer=Y5.trace.getTracer(t,n),this._meter=Y5.metrics.getMeter(t,n),this._logger=Rat.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=q2.wrap;_unwrap=q2.unwrap;_massWrap=q2.massWrap;_massUnwrap=q2.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};Y2.InstrumentationAbstract=K5});var s0e=F((p7t,a0e)=>{m();var XC=1e3,eb=XC*60,tb=eb*60,kS=tb*24,xat=kS*7,Dat=kS*365.25;a0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Bat(e);if(n==="number"&&isFinite(e))return t.long?Oat(e):Nat(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Bat(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Dat;case"weeks":case"week":case"w":return n*xat;case"days":case"day":case"d":return n*kS;case"hours":case"hour":case"hrs":case"hr":case"h":return n*tb;case"minutes":case"minute":case"mins":case"min":case"m":return n*eb;case"seconds":case"second":case"secs":case"sec":case"s":return n*XC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Nat(e){var t=Math.abs(e);return t>=kS?Math.round(e/kS)+"d":t>=tb?Math.round(e/tb)+"h":t>=eb?Math.round(e/eb)+"m":t>=XC?Math.round(e/XC)+"s":e+"ms"}function Oat(e){var t=Math.abs(e);return t>=kS?K2(e,t,kS,"day"):t>=tb?K2(e,t,tb,"hour"):t>=eb?K2(e,t,eb,"minute"):t>=XC?K2(e,t,XC,"second"):e+" ms"}function K2(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var J5=F((A7t,u0e)=>{m();function wat(e){n.debug=n,n.default=n,n.coerce=d,n.disable=a,n.enable=o,n.enabled=c,n.humanize=s0e(),n.destroy=g,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let S=0;for(let y=0;y<h.length;y++)S=(S<<5)-S+h.charCodeAt(y),S|=0;return n.colors[Math.abs(S)%n.colors.length]}n.selectColor=t;function n(h){let S,y=null,C,v;function x(...N){if(!x.enabled)return;let k=x,Q=Number(new Date),j=Q-(S||Q);k.diff=j,k.prev=S,k.curr=Q,S=Q,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let G=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(oe,ge)=>{if(oe==="%%")return"%";G++;let ye=n.formatters[ge];if(typeof ye=="function"){let be=N[G];oe=ye.call(k,be),N.splice(G,1),G--}return oe}),n.formatArgs.call(k,N),(k.log||n.log).apply(k,N)}return x.namespace=h,x.useColors=n.useColors(),x.color=n.selectColor(h),x.extend=r,x.destroy=n.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(C!==n.namespaces&&(C=n.namespaces,v=n.enabled(h)),v),set:N=>{y=N}}),typeof n.init=="function"&&n.init(x),x}function r(h,S){let y=n(this.namespace+(typeof S>"u"?":":S)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let S=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of S)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,S){let y=0,C=0,v=-1,x=0;for(;y<h.length;)if(C<S.length&&(S[C]===h[y]||S[C]==="*"))S[C]==="*"?(v=C,x=y,C++):(y++,C++);else if(v!==-1)C=v+1,x++,y=x;else return!1;for(;C<S.length&&S[C]==="*";)C++;return C===S.length}function a(){let h=[...n.names,...n.skips.map(S=>"-"+S)].join(",");return n.enable(""),h}function c(h){for(let S of n.skips)if(i(h,S))return!1;for(let S of n.names)if(i(h,S))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}u0e.exports=wat});var c0e=F((xc,J2)=>{m();xc.formatArgs=Mat;xc.save=Pat;xc.load=Uat;xc.useColors=kat;xc.storage=Lat();xc.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xc.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function kat(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Mat(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+J2.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}xc.log=console.debug||console.log||(()=>{});function Pat(e){try{e?xc.storage.setItem("debug",e):xc.storage.removeItem("debug")}catch{}}function Uat(){let e;try{e=xc.storage.getItem("debug")||xc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Lat(){try{return localStorage}catch{}}J2.exports=J5()(xc);var{formatters:Qat}=J2.exports;Qat.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var d0e=F((h7t,l0e)=>{"use strict";m();l0e.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var A0e=F((E7t,f0e)=>{"use strict";m();var Fat=Ge("os"),p0e=Ge("tty"),Nd=d0e(),{env:Va}=process,e_;Nd("no-color")||Nd("no-colors")||Nd("color=false")||Nd("color=never")?e_=0:(Nd("color")||Nd("colors")||Nd("color=true")||Nd("color=always"))&&(e_=1);"FORCE_COLOR"in Va&&(Va.FORCE_COLOR==="true"?e_=1:Va.FORCE_COLOR==="false"?e_=0:e_=Va.FORCE_COLOR.length===0?1:Math.min(parseInt(Va.FORCE_COLOR,10),3));function Z5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function W5(e,t){if(e_===0)return 0;if(Nd("color=16m")||Nd("color=full")||Nd("color=truecolor"))return 3;if(Nd("color=256"))return 2;if(e&&!t&&e_===void 0)return 0;let n=e_||0;if(Va.TERM==="dumb")return n;if(process.platform==="win32"){let r=Fat.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Va)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Va)||Va.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Va)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Va.TEAMCITY_VERSION)?1:0;if(Va.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Va){let r=parseInt((Va.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Va.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Va.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Va.TERM)||"COLORTERM"in Va?1:n}function Gat(e){let t=W5(e,e&&e.isTTY);return Z5(t)}f0e.exports={supportsColor:Gat,stdout:Z5(W5(!0,p0e.isatty(1))),stderr:Z5(W5(!0,p0e.isatty(2)))}});var g0e=F((qa,W2)=>{m();var jat=Ge("tty"),Z2=Ge("util");qa.init=Kat;qa.log=Vat;qa.formatArgs=zat;qa.save=qat;qa.load=Yat;qa.useColors=Hat;qa.destroy=Z2.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");qa.colors=[6,2,3,4,5,1];try{let e=A0e();e&&(e.stderr||e).level>=2&&(qa.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}qa.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[n]=r,e},{});function Hat(){return"colors"in qa.inspectOpts?!!qa.inspectOpts.colors:jat.isatty(process.stderr.fd)}function zat(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
3
+ var Xqe=Object.create;var HP=Object.defineProperty;var e7e=Object.getOwnPropertyDescriptor;var t7e=Object.getOwnPropertyNames;var n7e=Object.getPrototypeOf,r7e=Object.prototype.hasOwnProperty;var Ge=(e=>typeof require<"u"?require:typeof Proxy<"u"?new Proxy(e,{get:(t,n)=>(typeof require<"u"?require:t)[n]}):e)(function(e){if(typeof require<"u")return require.apply(this,arguments);throw Error('Dynamic require of "'+e+'" is not supported')});var O=(e,t)=>()=>(e&&(t=e(e=0)),t);var F=(e,t)=>()=>(t||e((t={exports:{}}).exports,t),t.exports),za=(e,t)=>{for(var n in t)HP(e,n,{get:t[n],enumerable:!0})},hle=(e,t,n,r)=>{if(t&&typeof t=="object"||typeof t=="function")for(let o of t7e(t))!r7e.call(e,o)&&o!==n&&HP(e,o,{get:()=>t[o],enumerable:!(r=e7e(t,o))||r.enumerable});return e};var ie=(e,t,n)=>(n=e!=null?Xqe(n7e(e)):{},hle(t||!e||!e.__esModule?HP(n,"default",{value:e,enumerable:!0}):n,e)),Me=e=>hle(HP({},"__esModule",{value:!0}),e);var m=O(()=>{(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{};e.SENTRY_RELEASE={id:"0.1.134"}}catch{}})()});var Xm,c$=O(()=>{m();Xm="1.9.1"});function o7e(e){let t=new Set([e]),n=new Set,r=e.match(Sle);if(!r)return()=>!1;let o={major:+r[1],minor:+r[2],patch:+r[3],prerelease:r[4]};if(o.prerelease!=null)return function(d){return d===e};function i(c){return n.add(c),!1}function a(c){return t.add(c),!0}return function(d){if(t.has(d))return!0;if(n.has(d))return!1;let g=d.match(Sle);if(!g)return i(d);let h={major:+g[1],minor:+g[2],patch:+g[3],prerelease:g[4]};return h.prerelease!=null||o.major!==h.major?i(d):o.major===0?o.minor===h.minor&&o.patch<=h.patch?a(d):i(d):o.minor<=h.minor?a(d):i(d)}}var Sle,yle,Tle=O(()=>{m();c$();Sle=/^(\d+)\.(\d+)\.(\d+)(-(.+))?$/;yle=o7e(Xm)});function iA(e,t,n,r=!1){var o;let i=Y1[q1]=(o=Y1[q1])!==null&&o!==void 0?o:{version:Xm};if(!r&&i[e]){let a=new Error(`@opentelemetry/api: Attempted duplicate registration of API: ${e}`);return n.error(a.stack||a.message),!1}if(i.version!==Xm){let a=new Error(`@opentelemetry/api: Registration of version v${i.version} for ${e} does not match previously registered API v${Xm}`);return n.error(a.stack||a.message),!1}return i[e]=t,n.debug(`@opentelemetry/api: Registered a global for ${e} v${Xm}.`),!0}function Cl(e){var t,n;let r=(t=Y1[q1])===null||t===void 0?void 0:t.version;if(!(!r||!yle(r)))return(n=Y1[q1])===null||n===void 0?void 0:n[e]}function aA(e,t){t.debug(`@opentelemetry/api: Unregistering a global for ${e} v${Xm}.`);let n=Y1[q1];n&&delete n[e]}var i7e,q1,Y1,IS=O(()=>{m();c$();Tle();i7e=Xm.split(".")[0],q1=Symbol.for(`opentelemetry.js.api.${i7e}`),Y1=typeof globalThis=="object"?globalThis:typeof self=="object"?self:typeof window=="object"?window:typeof global=="object"?global:{}});function K1(e,t,n){let r=Cl("diag");if(r)return r[e](t,...n)}var zP,Ile=O(()=>{m();IS();zP=class{constructor(t){this._namespace=t.namespace||"DiagComponentLogger"}debug(...t){return K1("debug",this._namespace,t)}error(...t){return K1("error",this._namespace,t)}info(...t){return K1("info",this._namespace,t)}warn(...t){return K1("warn",this._namespace,t)}verbose(...t){return K1("verbose",this._namespace,t)}}});var ha,$P=O(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.ERROR=30]="ERROR",e[e.WARN=50]="WARN",e[e.INFO=60]="INFO",e[e.DEBUG=70]="DEBUG",e[e.VERBOSE=80]="VERBOSE",e[e.ALL=9999]="ALL"})(ha||(ha={}))});function Cle(e,t){e<ha.NONE?e=ha.NONE:e>ha.ALL&&(e=ha.ALL),t=t||{};function n(r,o){let i=t[r];return typeof i=="function"&&e>=o?i.bind(t):function(){}}return{error:n("error",ha.ERROR),warn:n("warn",ha.WARN),info:n("info",ha.INFO),debug:n("debug",ha.DEBUG),verbose:n("verbose",ha.VERBOSE)}}var ble=O(()=>{m();$P()});var a7e,$a,CS=O(()=>{m();Ile();ble();$P();IS();a7e="diag",$a=class e{static instance(){return this._instance||(this._instance=new e),this._instance}constructor(){function t(o){return function(...i){let a=Cl("diag");if(a)return a[o](...i)}}let n=this,r=(o,i={logLevel:ha.INFO})=>{var a,c,d;if(o===n){let S=new Error("Cannot use diag as the logger for itself. Please use a DiagLogger implementation like ConsoleDiagLogger or a custom implementation");return n.error((a=S.stack)!==null&&a!==void 0?a:S.message),!1}typeof i=="number"&&(i={logLevel:i});let g=Cl("diag"),h=Cle((c=i.logLevel)!==null&&c!==void 0?c:ha.INFO,o);if(g&&!i.suppressOverrideMessage){let S=(d=new Error().stack)!==null&&d!==void 0?d:"<failed to generate stacktrace>";g.warn(`Current logger will be overwritten from ${S}`),h.warn(`Current logger will overwrite one already registered from ${S}`)}return iA("diag",h,n,!0)};n.setLogger=r,n.disable=()=>{aA(a7e,n)},n.createComponentLogger=o=>new zP(o),n.verbose=t("verbose"),n.debug=t("debug"),n.info=t("info"),n.warn=t("warn"),n.error=t("error")}}});var VP,vle=O(()=>{m();VP=class e{constructor(t){this._entries=t?new Map(t):new Map}getEntry(t){let n=this._entries.get(t);if(n)return Object.assign({},n)}getAllEntries(){return Array.from(this._entries.entries())}setEntry(t,n){let r=new e(this._entries);return r._entries.set(t,n),r}removeEntry(t){let n=new e(this._entries);return n._entries.delete(t),n}removeEntries(...t){let n=new e(this._entries);for(let r of t)n._entries.delete(r);return n}clear(){return new e}}});var Rle,xle=O(()=>{m();Rle=Symbol("BaggageEntryMetadata")});function Dle(e={}){return new VP(new Map(Object.entries(e)))}function Ble(e){return typeof e!="string"&&(s7e.error(`Cannot create baggage metadata from unknown type: ${typeof e}`),e=""),{__TYPE__:Rle,toString(){return e}}}var s7e,l$=O(()=>{m();CS();vle();xle();s7e=$a.instance()});function bl(e){return Symbol.for(e)}var d$,QC,J1=O(()=>{m();d$=class e{constructor(t){let n=this;n._currentContext=t?new Map(t):new Map,n.getValue=r=>n._currentContext.get(r),n.setValue=(r,o)=>{let i=new e(n._currentContext);return i._currentContext.set(r,o),i},n.deleteValue=r=>{let o=new e(n._currentContext);return o._currentContext.delete(r),o}}},QC=new d$});var p$,f$,qP,Nle=O(()=>{m();p$=[{n:"error",c:"error"},{n:"warn",c:"warn"},{n:"info",c:"info"},{n:"debug",c:"debug"},{n:"verbose",c:"trace"}],f$={};if(typeof console<"u"){let e=["error","warn","info","debug","trace","log"];for(let t of e)typeof console[t]=="function"&&(f$[t]=console[t])}qP=class{constructor(){function t(n){return function(...r){let o=f$[n];if(typeof o!="function"&&(o=f$.log),typeof o!="function"&&console&&(o=console[n],typeof o!="function"&&(o=console.log)),typeof o=="function")return o.apply(console,r)}}for(let n=0;n<p$.length;n++)this[p$[n].n]=t(p$[n].c)}}});function Ole(){return T$}var A$,FC,m$,g$,h$,_$,Z1,E$,S$,y$,T$,u7e,c7e,l7e,d7e,p7e,f7e,A7e,I$=O(()=>{m();A$=class{constructor(){}createGauge(t,n){return c7e}createHistogram(t,n){return l7e}createCounter(t,n){return u7e}createUpDownCounter(t,n){return d7e}createObservableGauge(t,n){return f7e}createObservableCounter(t,n){return p7e}createObservableUpDownCounter(t,n){return A7e}addBatchObservableCallback(t,n){}removeBatchObservableCallback(t){}},FC=class{},m$=class extends FC{add(t,n){}},g$=class extends FC{add(t,n){}},h$=class extends FC{record(t,n){}},_$=class extends FC{record(t,n){}},Z1=class{addCallback(t){}removeCallback(t){}},E$=class extends Z1{},S$=class extends Z1{},y$=class extends Z1{},T$=new A$,u7e=new m$,c7e=new h$,l7e=new _$,d7e=new g$,p7e=new E$,f7e=new S$,A7e=new y$});var YP,wle=O(()=>{m();(function(e){e[e.INT=0]="INT",e[e.DOUBLE=1]="DOUBLE"})(YP||(YP={}))});var KP,JP,C$=O(()=>{m();KP={get(e,t){if(e!=null)return e[t]},keys(e){return e==null?[]:Object.keys(e)}},JP={set(e,t,n){e!=null&&(e[t]=n)}}});var ZP,kle=O(()=>{m();J1();ZP=class{active(){return QC}with(t,n,r,...o){return n.call(r,...o)}bind(t,n){return n}enable(){return this}disable(){return this}}});var b$,m7e,sA,W1=O(()=>{m();kle();IS();CS();b$="context",m7e=new ZP,sA=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalContextManager(t){return iA(b$,t,$a.instance())}active(){return this._getContextManager().active()}with(t,n,r,...o){return this._getContextManager().with(t,n,r,...o)}bind(t,n){return this._getContextManager().bind(t,n)}_getContextManager(){return Cl(b$)||m7e}disable(){this._getContextManager().disable(),aA(b$,$a.instance())}}});var Ks,v$=O(()=>{m();(function(e){e[e.NONE=0]="NONE",e[e.SAMPLED=1]="SAMPLED"})(Ks||(Ks={}))});var X1,bS,WP,XP=O(()=>{m();v$();X1="0000000000000000",bS="00000000000000000000000000000000",WP={traceId:bS,spanId:X1,traceFlags:Ks.NONE}});var uA,e2=O(()=>{m();XP();uA=class{constructor(t=WP){this._spanContext=t}spanContext(){return this._spanContext}setAttribute(t,n){return this}setAttributes(t){return this}addEvent(t,n){return this}addLink(t){return this}addLinks(t){return this}setStatus(t){return this}updateName(t){return this}end(t){}isRecording(){return!1}recordException(t,n){}}});function t2(e){return e.getValue(R$)||void 0}function Mle(){return t2(sA.getInstance().active())}function eB(e,t){return e.setValue(R$,t)}function Ple(e){return e.deleteValue(R$)}function Ule(e,t){return eB(e,new uA(t))}function n2(e){var t;return(t=t2(e))===null||t===void 0?void 0:t.spanContext()}var R$,x$=O(()=>{m();J1();e2();W1();R$=bl("OpenTelemetry Context Key SPAN")});function Lle(e,t){if(typeof e!="string"||e.length!==t)return!1;let n=0;for(let r=0;r<e.length;r+=4)n+=(r2[e.charCodeAt(r)]|0)+(r2[e.charCodeAt(r+1)]|0)+(r2[e.charCodeAt(r+2)]|0)+(r2[e.charCodeAt(r+3)]|0);return n===t}function D$(e){return Lle(e,32)&&e!==bS}function B$(e){return Lle(e,16)&&e!==X1}function eg(e){return D$(e.traceId)&&B$(e.spanId)}function Qle(e){return new uA(e)}var r2,o2=O(()=>{m();XP();e2();r2=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1,1,1,1,1,0,0,0,0,0,0,0,1,1,1,1,1,1,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,1,1,1,1,1,1])});function g7e(e){return e!==null&&typeof e=="object"&&"spanId"in e&&typeof e.spanId=="string"&&"traceId"in e&&typeof e.traceId=="string"&&"traceFlags"in e&&typeof e.traceFlags=="number"}var N$,GC,O$=O(()=>{m();W1();x$();e2();o2();N$=sA.getInstance(),GC=class{startSpan(t,n,r=N$.active()){if(!!n?.root)return new uA;let i=r&&n2(r);return g7e(i)&&eg(i)?new uA(i):new uA}startActiveSpan(t,n,r,o){let i,a,c;if(arguments.length<2)return;arguments.length===2?c=n:arguments.length===3?(i=n,c=r):(i=n,a=r,c=o);let d=a??N$.active(),g=this.startSpan(t,i,d),h=eB(d,g);return N$.with(h,c,void 0,g)}}});var h7e,jC,w$=O(()=>{m();O$();h7e=new GC,jC=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}startSpan(t,n,r){return this._getTracer().startSpan(t,n,r)}startActiveSpan(t,n,r,o){let i=this._getTracer();return Reflect.apply(i.startActiveSpan,i,arguments)}_getTracer(){if(this._delegate)return this._delegate;let t=this._provider.getDelegateTracer(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):h7e}}});var i2,Fle=O(()=>{m();O$();i2=class{getTracer(t,n,r){return new GC}}});var _7e,vS,k$=O(()=>{m();w$();Fle();_7e=new i2,vS=class{getTracer(t,n,r){var o;return(o=this.getDelegateTracer(t,n,r))!==null&&o!==void 0?o:new jC(this,t,n,r)}getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:_7e}setDelegate(t){this._delegate=t}getDelegateTracer(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getTracer(t,n,r)}}});var a2,Gle=O(()=>{m();(function(e){e[e.NOT_RECORD=0]="NOT_RECORD",e[e.RECORD=1]="RECORD",e[e.RECORD_AND_SAMPLED=2]="RECORD_AND_SAMPLED"})(a2||(a2={}))});var oo,jle=O(()=>{m();(function(e){e[e.INTERNAL=0]="INTERNAL",e[e.SERVER=1]="SERVER",e[e.CLIENT=2]="CLIENT",e[e.PRODUCER=3]="PRODUCER",e[e.CONSUMER=4]="CONSUMER"})(oo||(oo={}))});var ui,Hle=O(()=>{m();(function(e){e[e.UNSET=0]="UNSET",e[e.OK=1]="OK",e[e.ERROR=2]="ERROR"})(ui||(ui={}))});function zle(e){return y7e.test(e)}function $le(e){return T7e.test(e)&&!I7e.test(e)}var M$,E7e,S7e,y7e,T7e,I7e,Vle=O(()=>{m();M$="[_0-9a-z-*/]",E7e=`[a-z]${M$}{0,255}`,S7e=`[a-z0-9]${M$}{0,240}@[a-z]${M$}{0,13}`,y7e=new RegExp(`^(?:${E7e}|${S7e})$`),T7e=/^[ -~]{0,255}[!-~]$/,I7e=/,|=/});var qle,C7e,Yle,Kle,s2,Jle=O(()=>{m();Vle();qle=32,C7e=512,Yle=",",Kle="=",s2=class e{constructor(t){this._internalState=new Map,t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return Array.from(this._internalState.keys()).reduceRight((t,n)=>(t.push(n+Kle+this.get(n)),t),[]).join(Yle)}_parse(t){t.length>C7e||(this._internalState=t.split(Yle).reduceRight((n,r)=>{let o=r.trim(),i=o.indexOf(Kle);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);zle(a)&&$le(c)&&n.set(a,c)}return n},new Map),this._internalState.size>qle&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,qle))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}}});function Zle(e){return new s2(e)}var Wle=O(()=>{m();Jle()});var Ke,Xle=O(()=>{m();W1();Ke=sA.getInstance()});var vl,ede=O(()=>{m();CS();vl=$a.instance()});var P$,tde,nde=O(()=>{m();I$();P$=class{getMeter(t,n,r){return T$}},tde=new P$});var U$,u2,rde=O(()=>{m();nde();IS();CS();U$="metrics",u2=class e{constructor(){}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalMeterProvider(t){return iA(U$,t,$a.instance())}getMeterProvider(){return Cl(U$)||tde}getMeter(t,n,r){return this.getMeterProvider().getMeter(t,n,r)}disable(){aA(U$,$a.instance())}}});var L$,ode=O(()=>{m();rde();L$=u2.getInstance()});var c2,ide=O(()=>{m();c2=class{inject(t,n){}extract(t,n){return t}fields(){return[]}}});function F$(e){return e.getValue(Q$)||void 0}function ade(){return F$(sA.getInstance().active())}function sde(e,t){return e.setValue(Q$,t)}function ude(e){return e.deleteValue(Q$)}var Q$,cde=O(()=>{m();W1();J1();Q$=bl("OpenTelemetry Baggage Key")});var G$,b7e,l2,lde=O(()=>{m();IS();ide();C$();cde();l$();CS();G$="propagation",b7e=new c2,l2=class e{constructor(){this.createBaggage=Dle,this.getBaggage=F$,this.getActiveBaggage=ade,this.setBaggage=sde,this.deleteBaggage=ude}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalPropagator(t){return iA(G$,t,$a.instance())}inject(t,n,r=JP){return this._getGlobalPropagator().inject(t,n,r)}extract(t,n,r=KP){return this._getGlobalPropagator().extract(t,n,r)}fields(){return this._getGlobalPropagator().fields()}disable(){aA(G$,$a.instance())}_getGlobalPropagator(){return Cl(G$)||b7e}}});var qp,dde=O(()=>{m();lde();qp=l2.getInstance()});var j$,d2,pde=O(()=>{m();IS();k$();o2();x$();CS();j$="trace",d2=class e{constructor(){this._proxyTracerProvider=new vS,this.wrapSpanContext=Qle,this.isSpanContextValid=eg,this.deleteSpan=Ple,this.getSpan=t2,this.getActiveSpan=Mle,this.getSpanContext=n2,this.setSpan=eB,this.setSpanContext=Ule}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalTracerProvider(t){let n=iA(j$,this._proxyTracerProvider,$a.instance());return n&&this._proxyTracerProvider.setDelegate(t),n}getTracerProvider(){return Cl(j$)||this._proxyTracerProvider}getTracer(t,n){return this.getTracerProvider().getTracer(t,n)}disable(){aA(j$,$a.instance()),this._proxyTracerProvider=new vS}}});var Ht,fde=O(()=>{m();pde();Ht=d2.getInstance()});var We={};za(We,{DiagConsoleLogger:()=>qP,DiagLogLevel:()=>ha,INVALID_SPANID:()=>X1,INVALID_SPAN_CONTEXT:()=>WP,INVALID_TRACEID:()=>bS,ProxyTracer:()=>jC,ProxyTracerProvider:()=>vS,ROOT_CONTEXT:()=>QC,SamplingDecision:()=>a2,SpanKind:()=>oo,SpanStatusCode:()=>ui,TraceFlags:()=>Ks,ValueType:()=>YP,baggageEntryMetadataFromString:()=>Ble,context:()=>Ke,createContextKey:()=>bl,createNoopMeter:()=>Ole,createTraceState:()=>Zle,default:()=>v7e,defaultTextMapGetter:()=>KP,defaultTextMapSetter:()=>JP,diag:()=>vl,isSpanContextValid:()=>eg,isValidSpanId:()=>B$,isValidTraceId:()=>D$,metrics:()=>L$,propagation:()=>qp,trace:()=>Ht});var v7e,je=O(()=>{m();l$();J1();Nle();$P();I$();wle();C$();w$();k$();Gle();jle();Hle();v$();Wle();o2();XP();Xle();ede();ode();dde();fde();v7e={context:Ke,diag:vl,metrics:L$,propagation:qp,trace:Ht}});var tB=F(Zh=>{"use strict";m();Object.defineProperty(Zh,"__esModule",{value:!0});Zh.isTracingSuppressed=Zh.unsuppressTracing=Zh.suppressTracing=void 0;var R7e=(je(),Me(We)),H$=(0,R7e.createContextKey)("OpenTelemetry SDK Context Key SUPPRESS_TRACING");function x7e(e){return e.setValue(H$,!0)}Zh.suppressTracing=x7e;function D7e(e){return e.deleteValue(H$)}Zh.unsuppressTracing=D7e;function B7e(e){return e.getValue(H$)===!0}Zh.isTracingSuppressed=B7e});var z$=F(Js=>{"use strict";m();Object.defineProperty(Js,"__esModule",{value:!0});Js.BAGGAGE_MAX_TOTAL_LENGTH=Js.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=Js.BAGGAGE_MAX_NAME_VALUE_PAIRS=Js.BAGGAGE_HEADER=Js.BAGGAGE_ITEMS_SEPARATOR=Js.BAGGAGE_PROPERTIES_SEPARATOR=Js.BAGGAGE_KEY_PAIR_SEPARATOR=void 0;Js.BAGGAGE_KEY_PAIR_SEPARATOR="=";Js.BAGGAGE_PROPERTIES_SEPARATOR=";";Js.BAGGAGE_ITEMS_SEPARATOR=",";Js.BAGGAGE_HEADER="baggage";Js.BAGGAGE_MAX_NAME_VALUE_PAIRS=180;Js.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS=4096;Js.BAGGAGE_MAX_TOTAL_LENGTH=8192});var $$=F(cA=>{"use strict";m();Object.defineProperty(cA,"__esModule",{value:!0});cA.parseKeyPairsIntoRecord=cA.parsePairKeyValue=cA.getKeyPairs=cA.serializeKeyPairs=void 0;var N7e=(je(),Me(We)),HC=z$();function O7e(e){return e.reduce((t,n)=>{let r=`${t}${t!==""?HC.BAGGAGE_ITEMS_SEPARATOR:""}${n}`;return r.length>HC.BAGGAGE_MAX_TOTAL_LENGTH?t:r},"")}cA.serializeKeyPairs=O7e;function w7e(e){return e.getAllEntries().map(([t,n])=>{let r=`${encodeURIComponent(t)}=${encodeURIComponent(n.value)}`;return n.metadata!==void 0&&(r+=HC.BAGGAGE_PROPERTIES_SEPARATOR+n.metadata.toString()),r})}cA.getKeyPairs=w7e;function Ade(e){if(!e)return;let t=e.indexOf(HC.BAGGAGE_PROPERTIES_SEPARATOR),n=t===-1?e:e.substring(0,t),r=n.indexOf(HC.BAGGAGE_KEY_PAIR_SEPARATOR);if(r<=0)return;let o=n.substring(0,r).trim(),i=n.substring(r+1).trim();if(!o||!i)return;let a,c;try{a=decodeURIComponent(o),c=decodeURIComponent(i)}catch{return}let d;if(t!==-1&&t<e.length-1){let g=e.substring(t+1);d=(0,N7e.baggageEntryMetadataFromString)(g)}return{key:a,value:c,metadata:d}}cA.parsePairKeyValue=Ade;function k7e(e){let t={};return typeof e=="string"&&e.length>0&&e.split(HC.BAGGAGE_ITEMS_SEPARATOR).forEach(n=>{let r=Ade(n);r!==void 0&&r.value.length>0&&(t[r.key]=r.value)}),t}cA.parseKeyPairsIntoRecord=k7e});var mde=F(p2=>{"use strict";m();Object.defineProperty(p2,"__esModule",{value:!0});p2.W3CBaggagePropagator=void 0;var V$=(je(),Me(We)),M7e=tB(),RS=z$(),q$=$$(),Y$=class{inject(t,n,r){let o=V$.propagation.getBaggage(t);if(!o||(0,M7e.isTracingSuppressed)(t))return;let i=(0,q$.getKeyPairs)(o).filter(c=>c.length<=RS.BAGGAGE_MAX_PER_NAME_VALUE_PAIRS).slice(0,RS.BAGGAGE_MAX_NAME_VALUE_PAIRS),a=(0,q$.serializeKeyPairs)(i);a.length>0&&r.set(n,RS.BAGGAGE_HEADER,a)}extract(t,n,r){let o=r.get(n,RS.BAGGAGE_HEADER),i=Array.isArray(o)?o.join(RS.BAGGAGE_ITEMS_SEPARATOR):o;if(!i)return t;let a={};return i.length===0||(i.split(RS.BAGGAGE_ITEMS_SEPARATOR).forEach(d=>{let g=(0,q$.parsePairKeyValue)(d);if(g){let h={value:g.value};g.metadata&&(h.metadata=g.metadata),a[g.key]=h}}),Object.entries(a).length===0)?t:V$.propagation.setBaggage(t,V$.propagation.createBaggage(a))}fields(){return[RS.BAGGAGE_HEADER]}};p2.W3CBaggagePropagator=Y$});var gde=F(f2=>{"use strict";m();Object.defineProperty(f2,"__esModule",{value:!0});f2.AnchoredClock=void 0;var K$=class{_monotonicClock;_epochMillis;_performanceMillis;constructor(t,n){this._monotonicClock=n,this._epochMillis=t.now(),this._performanceMillis=n.now()}now(){let t=this._monotonicClock.now()-this._performanceMillis;return this._epochMillis+t}};f2.AnchoredClock=K$});var yde=F(Wh=>{"use strict";m();Object.defineProperty(Wh,"__esModule",{value:!0});Wh.isAttributeValue=Wh.isAttributeKey=Wh.sanitizeAttributes=void 0;var hde=(je(),Me(We));function P7e(e){let t={};if(typeof e!="object"||e==null)return t;for(let n in e){if(!Object.prototype.hasOwnProperty.call(e,n))continue;if(!_de(n)){hde.diag.warn(`Invalid attribute key: ${n}`);continue}let r=e[n];if(!Ede(r)){hde.diag.warn(`Invalid attribute value set for key: ${n}`);continue}Array.isArray(r)?t[n]=r.slice():t[n]=r}return t}Wh.sanitizeAttributes=P7e;function _de(e){return typeof e=="string"&&e!==""}Wh.isAttributeKey=_de;function Ede(e){return e==null?!0:Array.isArray(e)?U7e(e):Sde(typeof e)}Wh.isAttributeValue=Ede;function U7e(e){let t;for(let n of e){if(n==null)continue;let r=typeof n;if(r!==t){if(!t){if(Sde(r)){t=r;continue}return!1}return!1}}return!0}function Sde(e){switch(e){case"number":case"boolean":case"string":return!0}return!1}});var J$=F(A2=>{"use strict";m();Object.defineProperty(A2,"__esModule",{value:!0});A2.loggingErrorHandler=void 0;var L7e=(je(),Me(We));function Q7e(){return e=>{L7e.diag.error(F7e(e))}}A2.loggingErrorHandler=Q7e;function F7e(e){return typeof e=="string"?e:JSON.stringify(G7e(e))}function G7e(e){let t={},n=e;for(;n!==null;)Object.getOwnPropertyNames(n).forEach(r=>{if(t[r])return;let o=n[r];o&&(t[r]=String(o))}),n=Object.getPrototypeOf(n);return t}});var Ide=F(zC=>{"use strict";m();Object.defineProperty(zC,"__esModule",{value:!0});zC.globalErrorHandler=zC.setGlobalErrorHandler=void 0;var j7e=J$(),Tde=(0,j7e.loggingErrorHandler)();function H7e(e){Tde=e}zC.setGlobalErrorHandler=H7e;function z7e(e){try{Tde(e)}catch{}}zC.globalErrorHandler=z7e});var Rde=F(lA=>{"use strict";m();Object.defineProperty(lA,"__esModule",{value:!0});lA.getStringListFromEnv=lA.getBooleanFromEnv=lA.getStringFromEnv=lA.getNumberFromEnv=void 0;var Cde=(je(),Me(We)),bde=Ge("util");function $7e(e){let t=process.env[e];if(t==null||t.trim()==="")return;let n=Number(t);if(isNaN(n)){Cde.diag.warn(`Unknown value ${(0,bde.inspect)(t)} for ${e}, expected a number, using defaults`);return}return n}lA.getNumberFromEnv=$7e;function vde(e){let t=process.env[e];if(!(t==null||t.trim()===""))return t}lA.getStringFromEnv=vde;function V7e(e){let t=process.env[e]?.trim().toLowerCase();return t==null||t===""?!1:t==="true"?!0:(t==="false"||Cde.diag.warn(`Unknown value ${(0,bde.inspect)(t)} for ${e}, expected 'true' or 'false', falling back to 'false' (default)`),!1)}lA.getBooleanFromEnv=V7e;function q7e(e){return vde(e)?.split(",").map(t=>t.trim()).filter(t=>t!=="")}lA.getStringListFromEnv=q7e});var xde=F(m2=>{"use strict";m();Object.defineProperty(m2,"__esModule",{value:!0});m2._globalThis=void 0;m2._globalThis=globalThis});var Dde=F(g2=>{"use strict";m();Object.defineProperty(g2,"__esModule",{value:!0});g2.VERSION=void 0;g2.VERSION="2.6.1"});function bi(e){let t={},n=e.length;for(let r=0;r<n;r++){let o=e[r];o&&(t[String(o).toUpperCase().replace(/[-.]/g,"_")]=o)}return t}var Z$=O(()=>{m()});var Bde,Nde,Ode,wde,kde,Mde,Pde,Ude,Lde,Qde,Fde,Gde,jde,Hde,zde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Ipe,Cpe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Mpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,Hpe,zpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Ife,Cfe,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Mfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,Hfe,zfe,$fe,Vfe,qfe,Yfe,Kfe,Y7e,W$,K7e,J7e,Z7e,W7e,X$,X7e,eYe,tYe,nYe,rYe,oYe,iYe,aYe,sYe,uYe,cYe,lYe,dYe,pYe,fYe,AYe,mYe,gYe,e5,hYe,_Ye,EYe,SYe,yYe,TYe,IYe,CYe,bYe,vYe,RYe,xYe,t5,DYe,BYe,n5,r5,NYe,OYe,wYe,kYe,MYe,PYe,UYe,LYe,QYe,FYe,GYe,jYe,HYe,zYe,$Ye,VYe,qYe,nB,$C,o5,YYe,KYe,xS,JYe,ZYe,WYe,XYe,i5,a5,eKe,s5,tKe,nKe,rKe,oKe,iKe,aKe,sKe,uKe,cKe,lKe,dKe,pKe,fKe,AKe,mKe,gKe,hKe,_Ke,EKe,SKe,yKe,TKe,IKe,u5,CKe,bKe,vKe,RKe,xKe,DKe,BKe,NKe,OKe,wKe,kKe,MKe,PKe,UKe,LKe,QKe,FKe,GKe,jKe,c5,HKe,l5,zKe,$Ke,VKe,qKe,YKe,KKe,JKe,ZKe,WKe,Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,IAe,CAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,kAe,MAe,PAe,UAe,LAe,QAe,FAe,GAe,jAe,XKe,eJe,tJe,nJe,rJe,oJe,iJe,aJe,sJe,uJe,cJe,lJe,dJe,pJe,fJe,AJe,mJe,gJe,hJe,_Je,EJe,SJe,yJe,TJe,IJe,CJe,bJe,vJe,RJe,xJe,DJe,BJe,NJe,OJe,wJe,kJe,MJe,PJe,UJe,LJe,QJe,FJe,GJe,jJe,HJe,zJe,$Je,VJe,HAe,zAe,$Ae,VAe,qAe,YAe,KAe,JAe,ZAe,WAe,XAe,qJe,YJe,KJe,JJe,ZJe,WJe,XJe,eZe,tZe,nZe,rZe,oZe,eme,tme,nme,rme,ome,iZe,aZe,sZe,uZe,cZe,lZe,ime,ame,sme,dZe,pZe,fZe,AZe,ume,cme,lme,dme,mZe,gZe,hZe,_Ze,EZe,pme,fme,Ame,mme,gme,hme,_me,SZe,yZe,TZe,IZe,CZe,bZe,vZe,RZe,Eme,Sme,yme,Tme,Ime,xZe,DZe,BZe,NZe,OZe,wZe,Cme,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Mme,Pme,Ume,Lme,Qme,Fme,Gme,jme,Hme,zme,kZe,MZe,PZe,UZe,LZe,QZe,FZe,GZe,jZe,HZe,zZe,$Ze,VZe,qZe,YZe,KZe,JZe,ZZe,WZe,XZe,eWe,tWe,$me,Vme,qme,Yme,Kme,nWe,rWe,oWe,iWe,aWe,sWe,Jme,Zme,uWe,cWe,lWe,Wme,Xme,dWe,pWe,fWe,ege,tge,nge,rge,oge,ige,age,sge,uge,cge,lge,dge,pge,fge,Age,mge,gge,AWe,mWe,gWe,hWe,_We,EWe,SWe,yWe,TWe,IWe,CWe,bWe,vWe,RWe,xWe,DWe,BWe,NWe,hge,_ge,OWe,wWe,kWe,Ege=O(()=>{m();Z$();Bde="aws.lambda.invoked_arn",Nde="db.system",Ode="db.connection_string",wde="db.user",kde="db.jdbc.driver_classname",Mde="db.name",Pde="db.statement",Ude="db.operation",Lde="db.mssql.instance_name",Qde="db.cassandra.keyspace",Fde="db.cassandra.page_size",Gde="db.cassandra.consistency_level",jde="db.cassandra.table",Hde="db.cassandra.idempotence",zde="db.cassandra.speculative_execution_count",$de="db.cassandra.coordinator.id",Vde="db.cassandra.coordinator.dc",qde="db.hbase.namespace",Yde="db.redis.database_index",Kde="db.mongodb.collection",Jde="db.sql.table",Zde="exception.type",Wde="exception.message",Xde="exception.stacktrace",epe="exception.escaped",tpe="faas.trigger",npe="faas.execution",rpe="faas.document.collection",ope="faas.document.operation",ipe="faas.document.time",ape="faas.document.name",spe="faas.time",upe="faas.cron",cpe="faas.coldstart",lpe="faas.invoked_name",dpe="faas.invoked_provider",ppe="faas.invoked_region",fpe="net.transport",Ape="net.peer.ip",mpe="net.peer.port",gpe="net.peer.name",hpe="net.host.ip",_pe="net.host.port",Epe="net.host.name",Spe="net.host.connection.type",ype="net.host.connection.subtype",Tpe="net.host.carrier.name",Ipe="net.host.carrier.mcc",Cpe="net.host.carrier.mnc",bpe="net.host.carrier.icc",vpe="peer.service",Rpe="enduser.id",xpe="enduser.role",Dpe="enduser.scope",Bpe="thread.id",Npe="thread.name",Ope="code.function",wpe="code.namespace",kpe="code.filepath",Mpe="code.lineno",Ppe="http.method",Upe="http.url",Lpe="http.target",Qpe="http.host",Fpe="http.scheme",Gpe="http.status_code",jpe="http.flavor",Hpe="http.user_agent",zpe="http.request_content_length",$pe="http.request_content_length_uncompressed",Vpe="http.response_content_length",qpe="http.response_content_length_uncompressed",Ype="http.server_name",Kpe="http.route",Jpe="http.client_ip",Zpe="aws.dynamodb.table_names",Wpe="aws.dynamodb.consumed_capacity",Xpe="aws.dynamodb.item_collection_metrics",efe="aws.dynamodb.provisioned_read_capacity",tfe="aws.dynamodb.provisioned_write_capacity",nfe="aws.dynamodb.consistent_read",rfe="aws.dynamodb.projection",ofe="aws.dynamodb.limit",ife="aws.dynamodb.attributes_to_get",afe="aws.dynamodb.index_name",sfe="aws.dynamodb.select",ufe="aws.dynamodb.global_secondary_indexes",cfe="aws.dynamodb.local_secondary_indexes",lfe="aws.dynamodb.exclusive_start_table",dfe="aws.dynamodb.table_count",pfe="aws.dynamodb.scan_forward",ffe="aws.dynamodb.segment",Afe="aws.dynamodb.total_segments",mfe="aws.dynamodb.count",gfe="aws.dynamodb.scanned_count",hfe="aws.dynamodb.attribute_definitions",_fe="aws.dynamodb.global_secondary_index_updates",Efe="messaging.system",Sfe="messaging.destination",yfe="messaging.destination_kind",Tfe="messaging.temp_destination",Ife="messaging.protocol",Cfe="messaging.protocol_version",bfe="messaging.url",vfe="messaging.message_id",Rfe="messaging.conversation_id",xfe="messaging.message_payload_size_bytes",Dfe="messaging.message_payload_compressed_size_bytes",Bfe="messaging.operation",Nfe="messaging.consumer_id",Ofe="messaging.rabbitmq.routing_key",wfe="messaging.kafka.message_key",kfe="messaging.kafka.consumer_group",Mfe="messaging.kafka.client_id",Pfe="messaging.kafka.partition",Ufe="messaging.kafka.tombstone",Lfe="rpc.system",Qfe="rpc.service",Ffe="rpc.method",Gfe="rpc.grpc.status_code",jfe="rpc.jsonrpc.version",Hfe="rpc.jsonrpc.request_id",zfe="rpc.jsonrpc.error_code",$fe="rpc.jsonrpc.error_message",Vfe="message.type",qfe="message.id",Yfe="message.compressed_size",Kfe="message.uncompressed_size",Y7e=Bde,W$=Nde,K7e=Ode,J7e=wde,Z7e=kde,W7e=Mde,X$=Pde,X7e=Ude,eYe=Lde,tYe=Qde,nYe=Fde,rYe=Gde,oYe=jde,iYe=Hde,aYe=zde,sYe=$de,uYe=Vde,cYe=qde,lYe=Yde,dYe=Kde,pYe=Jde,fYe=Zde,AYe=Wde,mYe=Xde,gYe=epe,e5=tpe,hYe=npe,_Ye=rpe,EYe=ope,SYe=ipe,yYe=ape,TYe=spe,IYe=upe,CYe=cpe,bYe=lpe,vYe=dpe,RYe=ppe,xYe=fpe,t5=Ape,DYe=mpe,BYe=gpe,n5=hpe,r5=_pe,NYe=Epe,OYe=Spe,wYe=ype,kYe=Tpe,MYe=Ipe,PYe=Cpe,UYe=bpe,LYe=vpe,QYe=Rpe,FYe=xpe,GYe=Dpe,jYe=Bpe,HYe=Npe,zYe=Ope,$Ye=wpe,VYe=kpe,qYe=Mpe,nB=Ppe,$C=Upe,o5=Lpe,YYe=Qpe,KYe=Fpe,xS=Gpe,JYe=jpe,ZYe=Hpe,WYe=zpe,XYe=$pe,i5=Vpe,a5=qpe,eKe=Ype,s5=Kpe,tKe=Jpe,nKe=Zpe,rKe=Wpe,oKe=Xpe,iKe=efe,aKe=tfe,sKe=nfe,uKe=rfe,cKe=ofe,lKe=ife,dKe=afe,pKe=sfe,fKe=ufe,AKe=cfe,mKe=lfe,gKe=dfe,hKe=pfe,_Ke=ffe,EKe=Afe,SKe=mfe,yKe=gfe,TKe=hfe,IKe=_fe,u5=Efe,CKe=Sfe,bKe=yfe,vKe=Tfe,RKe=Ife,xKe=Cfe,DKe=bfe,BKe=vfe,NKe=Rfe,OKe=xfe,wKe=Dfe,kKe=Bfe,MKe=Nfe,PKe=Ofe,UKe=wfe,LKe=kfe,QKe=Mfe,FKe=Pfe,GKe=Ufe,jKe=Lfe,c5=Qfe,HKe=Ffe,l5=Gfe,zKe=jfe,$Ke=Hfe,VKe=zfe,qKe=$fe,YKe=Vfe,KKe=qfe,JKe=Yfe,ZKe=Kfe,WKe=bi([Bde,Nde,Ode,wde,kde,Mde,Pde,Ude,Lde,Qde,Fde,Gde,jde,Hde,zde,$de,Vde,qde,Yde,Kde,Jde,Zde,Wde,Xde,epe,tpe,npe,rpe,ope,ipe,ape,spe,upe,cpe,lpe,dpe,ppe,fpe,Ape,mpe,gpe,hpe,_pe,Epe,Spe,ype,Tpe,Ipe,Cpe,bpe,vpe,Rpe,xpe,Dpe,Bpe,Npe,Ope,wpe,kpe,Mpe,Ppe,Upe,Lpe,Qpe,Fpe,Gpe,jpe,Hpe,zpe,$pe,Vpe,qpe,Ype,Kpe,Jpe,Zpe,Wpe,Xpe,efe,tfe,nfe,rfe,ofe,ife,afe,sfe,ufe,cfe,lfe,dfe,pfe,ffe,Afe,mfe,gfe,hfe,_fe,Efe,Sfe,yfe,Tfe,Ife,Cfe,bfe,vfe,Rfe,xfe,Dfe,Bfe,Nfe,Ofe,wfe,kfe,Mfe,Pfe,Ufe,Lfe,Qfe,Ffe,Gfe,jfe,Hfe,zfe,$fe,Vfe,qfe,Yfe,Kfe]),Jfe="other_sql",Zfe="mssql",Wfe="mysql",Xfe="oracle",eAe="db2",tAe="postgresql",nAe="redshift",rAe="hive",oAe="cloudscape",iAe="hsqldb",aAe="progress",sAe="maxdb",uAe="hanadb",cAe="ingres",lAe="firstsql",dAe="edb",pAe="cache",fAe="adabas",AAe="firebird",mAe="derby",gAe="filemaker",hAe="informix",_Ae="instantdb",EAe="interbase",SAe="mariadb",yAe="netezza",TAe="pervasive",IAe="pointbase",CAe="sqlite",bAe="sybase",vAe="teradata",RAe="vertica",xAe="h2",DAe="coldfusion",BAe="cassandra",NAe="hbase",OAe="mongodb",wAe="redis",kAe="couchbase",MAe="couchdb",PAe="cosmosdb",UAe="dynamodb",LAe="neo4j",QAe="geode",FAe="elasticsearch",GAe="memcached",jAe="cockroachdb",XKe=Jfe,eJe=Zfe,tJe=Wfe,nJe=Xfe,rJe=eAe,oJe=tAe,iJe=nAe,aJe=rAe,sJe=oAe,uJe=iAe,cJe=aAe,lJe=sAe,dJe=uAe,pJe=cAe,fJe=lAe,AJe=dAe,mJe=pAe,gJe=fAe,hJe=AAe,_Je=mAe,EJe=gAe,SJe=hAe,yJe=_Ae,TJe=EAe,IJe=SAe,CJe=yAe,bJe=TAe,vJe=IAe,RJe=CAe,xJe=bAe,DJe=vAe,BJe=RAe,NJe=xAe,OJe=DAe,wJe=BAe,kJe=NAe,MJe=OAe,PJe=wAe,UJe=kAe,LJe=MAe,QJe=PAe,FJe=UAe,GJe=LAe,jJe=QAe,HJe=FAe,zJe=GAe,$Je=jAe,VJe=bi([Jfe,Zfe,Wfe,Xfe,eAe,tAe,nAe,rAe,oAe,iAe,aAe,sAe,uAe,cAe,lAe,dAe,pAe,fAe,AAe,mAe,gAe,hAe,_Ae,EAe,SAe,yAe,TAe,IAe,CAe,bAe,vAe,RAe,xAe,DAe,BAe,NAe,OAe,wAe,kAe,MAe,PAe,UAe,LAe,QAe,FAe,GAe,jAe]),HAe="all",zAe="each_quorum",$Ae="quorum",VAe="local_quorum",qAe="one",YAe="two",KAe="three",JAe="local_one",ZAe="any",WAe="serial",XAe="local_serial",qJe=HAe,YJe=zAe,KJe=$Ae,JJe=VAe,ZJe=qAe,WJe=YAe,XJe=KAe,eZe=JAe,tZe=ZAe,nZe=WAe,rZe=XAe,oZe=bi([HAe,zAe,$Ae,VAe,qAe,YAe,KAe,JAe,ZAe,WAe,XAe]),eme="datasource",tme="http",nme="pubsub",rme="timer",ome="other",iZe=eme,aZe=tme,sZe=nme,uZe=rme,cZe=ome,lZe=bi([eme,tme,nme,rme,ome]),ime="insert",ame="edit",sme="delete",dZe=ime,pZe=ame,fZe=sme,AZe=bi([ime,ame,sme]),ume="alibaba_cloud",cme="aws",lme="azure",dme="gcp",mZe=ume,gZe=cme,hZe=lme,_Ze=dme,EZe=bi([ume,cme,lme,dme]),pme="ip_tcp",fme="ip_udp",Ame="ip",mme="unix",gme="pipe",hme="inproc",_me="other",SZe=pme,yZe=fme,TZe=Ame,IZe=mme,CZe=gme,bZe=hme,vZe=_me,RZe=bi([pme,fme,Ame,mme,gme,hme,_me]),Eme="wifi",Sme="wired",yme="cell",Tme="unavailable",Ime="unknown",xZe=Eme,DZe=Sme,BZe=yme,NZe=Tme,OZe=Ime,wZe=bi([Eme,Sme,yme,Tme,Ime]),Cme="gprs",bme="edge",vme="umts",Rme="cdma",xme="evdo_0",Dme="evdo_a",Bme="cdma2000_1xrtt",Nme="hsdpa",Ome="hsupa",wme="hspa",kme="iden",Mme="evdo_b",Pme="lte",Ume="ehrpd",Lme="hspap",Qme="gsm",Fme="td_scdma",Gme="iwlan",jme="nr",Hme="nrnsa",zme="lte_ca",kZe=Cme,MZe=bme,PZe=vme,UZe=Rme,LZe=xme,QZe=Dme,FZe=Bme,GZe=Nme,jZe=Ome,HZe=wme,zZe=kme,$Ze=Mme,VZe=Pme,qZe=Ume,YZe=Lme,KZe=Qme,JZe=Fme,ZZe=Gme,WZe=jme,XZe=Hme,eWe=zme,tWe=bi([Cme,bme,vme,Rme,xme,Dme,Bme,Nme,Ome,wme,kme,Mme,Pme,Ume,Lme,Qme,Fme,Gme,jme,Hme,zme]),$me="1.0",Vme="1.1",qme="2.0",Yme="SPDY",Kme="QUIC",nWe=$me,rWe=Vme,oWe=qme,iWe=Yme,aWe=Kme,sWe={HTTP_1_0:$me,HTTP_1_1:Vme,HTTP_2_0:qme,SPDY:Yme,QUIC:Kme},Jme="queue",Zme="topic",uWe=Jme,cWe=Zme,lWe=bi([Jme,Zme]),Wme="receive",Xme="process",dWe=Wme,pWe=Xme,fWe=bi([Wme,Xme]),ege=0,tge=1,nge=2,rge=3,oge=4,ige=5,age=6,sge=7,uge=8,cge=9,lge=10,dge=11,pge=12,fge=13,Age=14,mge=15,gge=16,AWe=ege,mWe=tge,gWe=nge,hWe=rge,_We=oge,EWe=ige,SWe=age,yWe=sge,TWe=uge,IWe=cge,CWe=lge,bWe=dge,vWe=pge,RWe=fge,xWe=Age,DWe=mge,BWe=gge,NWe={OK:ege,CANCELLED:tge,UNKNOWN:nge,INVALID_ARGUMENT:rge,DEADLINE_EXCEEDED:oge,NOT_FOUND:ige,ALREADY_EXISTS:age,PERMISSION_DENIED:sge,RESOURCE_EXHAUSTED:uge,FAILED_PRECONDITION:cge,ABORTED:lge,OUT_OF_RANGE:dge,UNIMPLEMENTED:pge,INTERNAL:fge,UNAVAILABLE:Age,DATA_LOSS:mge,UNAUTHENTICATED:gge},hge="SENT",_ge="RECEIVED",OWe=hge,wWe=_ge,kWe=bi([hge,_ge])});var Sge=O(()=>{m();Ege()});var yge,Tge,Ige,Cge,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,kge,Mge,Pge,Uge,Lge,Qge,Fge,Gge,jge,Hge,zge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Ihe,Che,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Mhe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,Hhe,zhe,$he,Vhe,qhe,MWe,PWe,UWe,LWe,QWe,FWe,GWe,jWe,HWe,zWe,$We,VWe,qWe,YWe,KWe,JWe,ZWe,WWe,XWe,eXe,tXe,nXe,rXe,oXe,iXe,aXe,sXe,uXe,cXe,lXe,dXe,pXe,fXe,AXe,mXe,gXe,hXe,_Xe,EXe,SXe,yXe,TXe,IXe,CXe,bXe,vXe,RXe,xXe,DXe,BXe,NXe,OXe,wXe,kXe,MXe,PXe,UXe,LXe,QXe,FXe,GXe,jXe,HXe,zXe,$Xe,VXe,qXe,YXe,KXe,JXe,ZXe,d5,WXe,XXe,eet,tet,net,ret,oet,iet,aet,set,Yhe,Khe,Jhe,Zhe,uet,cet,det,pet,fet,Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,d_e,p_e,f_e,A_e,Aet,met,get,het,_et,Eet,yet,Tet,Iet,Cet,bet,vet,Ret,xet,Det,Bet,Net,Oet,m_e,g_e,wet,ket,Met,h_e,__e,E_e,S_e,y_e,T_e,I_e,Pet,Uet,Let,Qet,Fet,Get,jet,Het,C_e,b_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e,zet,$et,Vet,qet,Yet,Ket,Jet,Zet,Wet,Xet,ett,ttt,M_e,P_e,U_e,L_e,Q_e,F_e,G_e,j_e,H_e,z_e,ntt,rtt,ott,itt,att,stt,utt,ctt,ltt,dtt,ptt,$_e=O(()=>{m();Z$();yge="cloud.provider",Tge="cloud.account.id",Ige="cloud.region",Cge="cloud.availability_zone",bge="cloud.platform",vge="aws.ecs.container.arn",Rge="aws.ecs.cluster.arn",xge="aws.ecs.launchtype",Dge="aws.ecs.task.arn",Bge="aws.ecs.task.family",Nge="aws.ecs.task.revision",Oge="aws.eks.cluster.arn",wge="aws.log.group.names",kge="aws.log.group.arns",Mge="aws.log.stream.names",Pge="aws.log.stream.arns",Uge="container.name",Lge="container.id",Qge="container.runtime",Fge="container.image.name",Gge="container.image.tag",jge="deployment.environment",Hge="device.id",zge="device.model.identifier",$ge="device.model.name",Vge="faas.name",qge="faas.id",Yge="faas.version",Kge="faas.instance",Jge="faas.max_memory",Zge="host.id",Wge="host.name",Xge="host.type",ehe="host.arch",the="host.image.name",nhe="host.image.id",rhe="host.image.version",ohe="k8s.cluster.name",ihe="k8s.node.name",ahe="k8s.node.uid",she="k8s.namespace.name",uhe="k8s.pod.uid",che="k8s.pod.name",lhe="k8s.container.name",dhe="k8s.replicaset.uid",phe="k8s.replicaset.name",fhe="k8s.deployment.uid",Ahe="k8s.deployment.name",mhe="k8s.statefulset.uid",ghe="k8s.statefulset.name",hhe="k8s.daemonset.uid",_he="k8s.daemonset.name",Ehe="k8s.job.uid",She="k8s.job.name",yhe="k8s.cronjob.uid",The="k8s.cronjob.name",Ihe="os.type",Che="os.description",bhe="os.name",vhe="os.version",Rhe="process.pid",xhe="process.executable.name",Dhe="process.executable.path",Bhe="process.command",Nhe="process.command_line",Ohe="process.command_args",whe="process.owner",khe="process.runtime.name",Mhe="process.runtime.version",Phe="process.runtime.description",Uhe="service.name",Lhe="service.namespace",Qhe="service.instance.id",Fhe="service.version",Ghe="telemetry.sdk.name",jhe="telemetry.sdk.language",Hhe="telemetry.sdk.version",zhe="telemetry.auto.version",$he="webengine.name",Vhe="webengine.version",qhe="webengine.description",MWe=yge,PWe=Tge,UWe=Ige,LWe=Cge,QWe=bge,FWe=vge,GWe=Rge,jWe=xge,HWe=Dge,zWe=Bge,$We=Nge,VWe=Oge,qWe=wge,YWe=kge,KWe=Mge,JWe=Pge,ZWe=Uge,WWe=Lge,XWe=Qge,eXe=Fge,tXe=Gge,nXe=jge,rXe=Hge,oXe=zge,iXe=$ge,aXe=Vge,sXe=qge,uXe=Yge,cXe=Kge,lXe=Jge,dXe=Zge,pXe=Wge,fXe=Xge,AXe=ehe,mXe=the,gXe=nhe,hXe=rhe,_Xe=ohe,EXe=ihe,SXe=ahe,yXe=she,TXe=uhe,IXe=che,CXe=lhe,bXe=dhe,vXe=phe,RXe=fhe,xXe=Ahe,DXe=mhe,BXe=ghe,NXe=hhe,OXe=_he,wXe=Ehe,kXe=She,MXe=yhe,PXe=The,UXe=Ihe,LXe=Che,QXe=bhe,FXe=vhe,GXe=Rhe,jXe=xhe,HXe=Dhe,zXe=Bhe,$Xe=Nhe,VXe=Ohe,qXe=whe,YXe=khe,KXe=Mhe,JXe=Phe,ZXe=Uhe,d5=Lhe,WXe=Qhe,XXe=Fhe,eet=Ghe,tet=jhe,net=Hhe,ret=zhe,oet=$he,iet=Vhe,aet=qhe,set=bi([yge,Tge,Ige,Cge,bge,vge,Rge,xge,Dge,Bge,Nge,Oge,wge,kge,Mge,Pge,Uge,Lge,Qge,Fge,Gge,jge,Hge,zge,$ge,Vge,qge,Yge,Kge,Jge,Zge,Wge,Xge,ehe,the,nhe,rhe,ohe,ihe,ahe,she,uhe,che,lhe,dhe,phe,fhe,Ahe,mhe,ghe,hhe,_he,Ehe,She,yhe,The,Ihe,Che,bhe,vhe,Rhe,xhe,Dhe,Bhe,Nhe,Ohe,whe,khe,Mhe,Phe,Uhe,Lhe,Qhe,Fhe,Ghe,jhe,Hhe,zhe,$he,Vhe,qhe]),Yhe="alibaba_cloud",Khe="aws",Jhe="azure",Zhe="gcp",uet=Yhe,cet=Khe,det=Jhe,pet=Zhe,fet=bi([Yhe,Khe,Jhe,Zhe]),Whe="alibaba_cloud_ecs",Xhe="alibaba_cloud_fc",e_e="aws_ec2",t_e="aws_ecs",n_e="aws_eks",r_e="aws_lambda",o_e="aws_elastic_beanstalk",i_e="azure_vm",a_e="azure_container_instances",s_e="azure_aks",u_e="azure_functions",c_e="azure_app_service",l_e="gcp_compute_engine",d_e="gcp_cloud_run",p_e="gcp_kubernetes_engine",f_e="gcp_cloud_functions",A_e="gcp_app_engine",Aet=Whe,met=Xhe,get=e_e,het=t_e,_et=n_e,Eet=r_e,yet=o_e,Tet=i_e,Iet=a_e,Cet=s_e,bet=u_e,vet=c_e,Ret=l_e,xet=d_e,Det=p_e,Bet=f_e,Net=A_e,Oet=bi([Whe,Xhe,e_e,t_e,n_e,r_e,o_e,i_e,a_e,s_e,u_e,c_e,l_e,d_e,p_e,f_e,A_e]),m_e="ec2",g_e="fargate",wet=m_e,ket=g_e,Met=bi([m_e,g_e]),h_e="amd64",__e="arm32",E_e="arm64",S_e="ia64",y_e="ppc32",T_e="ppc64",I_e="x86",Pet=h_e,Uet=__e,Let=E_e,Qet=S_e,Fet=y_e,Get=T_e,jet=I_e,Het=bi([h_e,__e,E_e,S_e,y_e,T_e,I_e]),C_e="windows",b_e="linux",v_e="darwin",R_e="freebsd",x_e="netbsd",D_e="openbsd",B_e="dragonflybsd",N_e="hpux",O_e="aix",w_e="solaris",k_e="z_os",zet=C_e,$et=b_e,Vet=v_e,qet=R_e,Yet=x_e,Ket=D_e,Jet=B_e,Zet=N_e,Wet=O_e,Xet=w_e,ett=k_e,ttt=bi([C_e,b_e,v_e,R_e,x_e,D_e,B_e,N_e,O_e,w_e,k_e]),M_e="cpp",P_e="dotnet",U_e="erlang",L_e="go",Q_e="java",F_e="nodejs",G_e="php",j_e="python",H_e="ruby",z_e="webjs",ntt=M_e,rtt=P_e,ott=U_e,itt=L_e,att=Q_e,stt=F_e,utt=G_e,ctt=j_e,ltt=H_e,dtt=z_e,ptt=bi([M_e,P_e,U_e,L_e,Q_e,F_e,G_e,j_e,H_e,z_e])});var V_e=O(()=>{m();$_e()});var ftt,Att,mtt,gtt,htt,_tt,Ett,Stt,ytt,Ttt,Itt,Ctt,btt,vtt,Rtt,xtt,Dtt,Btt,Ntt,Ott,wtt,ktt,Mtt,Ptt,Utt,p5,f5,Ltt,VC,Qtt,A5,m5,Ftt,DS,Gtt,jtt,Htt,ztt,$tt,Vtt,qtt,Ytt,Ktt,Jtt,g5,Ztt,Wtt,Xtt,ent,tnt,nnt,BS,rnt,ont,int,ant,snt,unt,cnt,lnt,dnt,pnt,fnt,Ant,mnt,tg,ng,gnt,hnt,_nt,Ent,Snt,ynt,Tnt,Int,Cnt,bnt,vnt,Rnt,xnt,Dnt,Bnt,Nnt,h5,_5,Ont,E5,S5,wnt,knt,Mnt,Pnt,Unt,Lnt,Qnt,Fnt,Gnt,jnt,Hnt,znt,$nt,Vnt,y5,T5,qnt,I5,Ynt,C5,Knt,Jnt,Znt,Wnt,Xnt,ert,trt,nrt,rrt,ort,irt,art,srt,urt,crt,lrt,drt,prt,frt,Art,mrt,grt,hrt,_rt,Xh,Ert,Srt,yrt,b5,q_e=O(()=>{m();ftt="aspnetcore.diagnostics.exception.result",Att="aborted",mtt="handled",gtt="skipped",htt="unhandled",_tt="aspnetcore.diagnostics.handler.type",Ett="aspnetcore.rate_limiting.policy",Stt="aspnetcore.rate_limiting.result",ytt="acquired",Ttt="endpoint_limiter",Itt="global_limiter",Ctt="request_canceled",btt="aspnetcore.request.is_unhandled",vtt="aspnetcore.routing.is_fallback",Rtt="aspnetcore.routing.match_status",xtt="failure",Dtt="success",Btt="aspnetcore.user.is_authenticated",Ntt="client.address",Ott="client.port",wtt="code.column.number",ktt="code.file.path",Mtt="code.function.name",Ptt="code.line.number",Utt="code.stacktrace",p5="db.collection.name",f5="db.namespace",Ltt="db.operation.batch.size",VC="db.operation.name",Qtt="db.query.summary",A5="db.query.text",m5="db.response.status_code",Ftt="db.stored_procedure.name",DS="db.system.name",Gtt="mariadb",jtt="microsoft.sql_server",Htt="mysql",ztt="postgresql",$tt="dotnet.gc.heap.generation",Vtt="gen0",qtt="gen1",Ytt="gen2",Ktt="loh",Jtt="poh",g5="error.type",Ztt="_OTHER",Wtt="exception.escaped",Xtt="exception.message",ent="exception.stacktrace",tnt="exception.type",nnt=e=>`http.request.header.${e}`,BS="http.request.method",rnt="_OTHER",ont="CONNECT",int="DELETE",ant="GET",snt="HEAD",unt="OPTIONS",cnt="PATCH",lnt="POST",dnt="PUT",pnt="TRACE",fnt="http.request.method_original",Ant="http.request.resend_count",mnt=e=>`http.response.header.${e}`,tg="http.response.status_code",ng="http.route",gnt="jvm.gc.action",hnt="jvm.gc.name",_nt="jvm.memory.pool.name",Ent="jvm.memory.type",Snt="heap",ynt="non_heap",Tnt="jvm.thread.daemon",Int="jvm.thread.state",Cnt="blocked",bnt="new",vnt="runnable",Rnt="terminated",xnt="timed_waiting",Dnt="waiting",Bnt="network.local.address",Nnt="network.local.port",h5="network.peer.address",_5="network.peer.port",Ont="network.protocol.name",E5="network.protocol.version",S5="network.transport",wnt="pipe",knt="quic",Mnt="tcp",Pnt="udp",Unt="unix",Lnt="network.type",Qnt="ipv4",Fnt="ipv6",Gnt="otel.scope.name",jnt="otel.scope.version",Hnt="otel.status_code",znt="ERROR",$nt="OK",Vnt="otel.status_description",y5="server.address",T5="server.port",qnt="service.instance.id",I5="service.name",Ynt="service.namespace",C5="service.version",Knt="signalr.connection.status",Jnt="app_shutdown",Znt="normal_closure",Wnt="timeout",Xnt="signalr.transport",ert="long_polling",trt="server_sent_events",nrt="web_sockets",rrt="telemetry.sdk.language",ort="cpp",irt="dotnet",art="erlang",srt="go",urt="java",crt="nodejs",lrt="php",drt="python",prt="ruby",frt="rust",Art="swift",mrt="webjs",grt="telemetry.sdk.name",hrt="telemetry.sdk.version",_rt="url.fragment",Xh="url.full",Ert="url.path",Srt="url.query",yrt="url.scheme",b5="user_agent.original"});var Trt,Irt,Crt,brt,vrt,Rrt,xrt,Drt,Brt,Nrt,Ort,wrt,krt,Mrt,Prt,Urt,Lrt,Qrt,Frt,Grt,jrt,Hrt,zrt,$rt,Vrt,qrt,Yrt,Krt,Jrt,Zrt,Wrt,Xrt,eot,tot,not,rot,oot,iot,aot,sot,uot,cot,lot,dot,pot,fot,Aot,mot,got,hot,_ot,Y_e=O(()=>{m();Trt="aspnetcore.diagnostics.exceptions",Irt="aspnetcore.rate_limiting.active_request_leases",Crt="aspnetcore.rate_limiting.queued_requests",brt="aspnetcore.rate_limiting.request.time_in_queue",vrt="aspnetcore.rate_limiting.request_lease.duration",Rrt="aspnetcore.rate_limiting.requests",xrt="aspnetcore.routing.match_attempts",Drt="db.client.operation.duration",Brt="dotnet.assembly.count",Nrt="dotnet.exceptions",Ort="dotnet.gc.collections",wrt="dotnet.gc.heap.total_allocated",krt="dotnet.gc.last_collection.heap.fragmentation.size",Mrt="dotnet.gc.last_collection.heap.size",Prt="dotnet.gc.last_collection.memory.committed_size",Urt="dotnet.gc.pause.time",Lrt="dotnet.jit.compilation.time",Qrt="dotnet.jit.compiled_il.size",Frt="dotnet.jit.compiled_methods",Grt="dotnet.monitor.lock_contentions",jrt="dotnet.process.cpu.count",Hrt="dotnet.process.cpu.time",zrt="dotnet.process.memory.working_set",$rt="dotnet.thread_pool.queue.length",Vrt="dotnet.thread_pool.thread.count",qrt="dotnet.thread_pool.work_item.count",Yrt="dotnet.timer.count",Krt="http.client.request.duration",Jrt="http.server.request.duration",Zrt="jvm.class.count",Wrt="jvm.class.loaded",Xrt="jvm.class.unloaded",eot="jvm.cpu.count",tot="jvm.cpu.recent_utilization",not="jvm.cpu.time",rot="jvm.gc.duration",oot="jvm.memory.committed",iot="jvm.memory.limit",aot="jvm.memory.used",sot="jvm.memory.used_after_last_gc",uot="jvm.thread.count",cot="kestrel.active_connections",lot="kestrel.active_tls_handshakes",dot="kestrel.connection.duration",pot="kestrel.queued_connections",fot="kestrel.queued_requests",Aot="kestrel.rejected_connections",mot="kestrel.tls_handshake.duration",got="kestrel.upgraded_connections",hot="signalr.server.active_connections",_ot="signalr.server.connection.duration"});var Eot,K_e=O(()=>{m();Eot="exception"});var Ur={};za(Ur,{ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_ABORTED:()=>Att,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_HANDLED:()=>mtt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_SKIPPED:()=>gtt,ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT_VALUE_UNHANDLED:()=>htt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ACQUIRED:()=>ytt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_ENDPOINT_LIMITER:()=>Ttt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_GLOBAL_LIMITER:()=>Itt,ASPNETCORE_RATE_LIMITING_RESULT_VALUE_REQUEST_CANCELED:()=>Ctt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_FAILURE:()=>xtt,ASPNETCORE_ROUTING_MATCH_STATUS_VALUE_SUCCESS:()=>Dtt,ATTR_ASPNETCORE_DIAGNOSTICS_EXCEPTION_RESULT:()=>ftt,ATTR_ASPNETCORE_DIAGNOSTICS_HANDLER_TYPE:()=>_tt,ATTR_ASPNETCORE_RATE_LIMITING_POLICY:()=>Ett,ATTR_ASPNETCORE_RATE_LIMITING_RESULT:()=>Stt,ATTR_ASPNETCORE_REQUEST_IS_UNHANDLED:()=>btt,ATTR_ASPNETCORE_ROUTING_IS_FALLBACK:()=>vtt,ATTR_ASPNETCORE_ROUTING_MATCH_STATUS:()=>Rtt,ATTR_ASPNETCORE_USER_IS_AUTHENTICATED:()=>Btt,ATTR_CLIENT_ADDRESS:()=>Ntt,ATTR_CLIENT_PORT:()=>Ott,ATTR_CODE_COLUMN_NUMBER:()=>wtt,ATTR_CODE_FILE_PATH:()=>ktt,ATTR_CODE_FUNCTION_NAME:()=>Mtt,ATTR_CODE_LINE_NUMBER:()=>Ptt,ATTR_CODE_STACKTRACE:()=>Utt,ATTR_DB_COLLECTION_NAME:()=>p5,ATTR_DB_NAMESPACE:()=>f5,ATTR_DB_OPERATION_BATCH_SIZE:()=>Ltt,ATTR_DB_OPERATION_NAME:()=>VC,ATTR_DB_QUERY_SUMMARY:()=>Qtt,ATTR_DB_QUERY_TEXT:()=>A5,ATTR_DB_RESPONSE_STATUS_CODE:()=>m5,ATTR_DB_STORED_PROCEDURE_NAME:()=>Ftt,ATTR_DB_SYSTEM_NAME:()=>DS,ATTR_DOTNET_GC_HEAP_GENERATION:()=>$tt,ATTR_ERROR_TYPE:()=>g5,ATTR_EXCEPTION_ESCAPED:()=>Wtt,ATTR_EXCEPTION_MESSAGE:()=>Xtt,ATTR_EXCEPTION_STACKTRACE:()=>ent,ATTR_EXCEPTION_TYPE:()=>tnt,ATTR_HTTP_REQUEST_HEADER:()=>nnt,ATTR_HTTP_REQUEST_METHOD:()=>BS,ATTR_HTTP_REQUEST_METHOD_ORIGINAL:()=>fnt,ATTR_HTTP_REQUEST_RESEND_COUNT:()=>Ant,ATTR_HTTP_RESPONSE_HEADER:()=>mnt,ATTR_HTTP_RESPONSE_STATUS_CODE:()=>tg,ATTR_HTTP_ROUTE:()=>ng,ATTR_JVM_GC_ACTION:()=>gnt,ATTR_JVM_GC_NAME:()=>hnt,ATTR_JVM_MEMORY_POOL_NAME:()=>_nt,ATTR_JVM_MEMORY_TYPE:()=>Ent,ATTR_JVM_THREAD_DAEMON:()=>Tnt,ATTR_JVM_THREAD_STATE:()=>Int,ATTR_NETWORK_LOCAL_ADDRESS:()=>Bnt,ATTR_NETWORK_LOCAL_PORT:()=>Nnt,ATTR_NETWORK_PEER_ADDRESS:()=>h5,ATTR_NETWORK_PEER_PORT:()=>_5,ATTR_NETWORK_PROTOCOL_NAME:()=>Ont,ATTR_NETWORK_PROTOCOL_VERSION:()=>E5,ATTR_NETWORK_TRANSPORT:()=>S5,ATTR_NETWORK_TYPE:()=>Lnt,ATTR_OTEL_SCOPE_NAME:()=>Gnt,ATTR_OTEL_SCOPE_VERSION:()=>jnt,ATTR_OTEL_STATUS_CODE:()=>Hnt,ATTR_OTEL_STATUS_DESCRIPTION:()=>Vnt,ATTR_SERVER_ADDRESS:()=>y5,ATTR_SERVER_PORT:()=>T5,ATTR_SERVICE_INSTANCE_ID:()=>qnt,ATTR_SERVICE_NAME:()=>I5,ATTR_SERVICE_NAMESPACE:()=>Ynt,ATTR_SERVICE_VERSION:()=>C5,ATTR_SIGNALR_CONNECTION_STATUS:()=>Knt,ATTR_SIGNALR_TRANSPORT:()=>Xnt,ATTR_TELEMETRY_SDK_LANGUAGE:()=>rrt,ATTR_TELEMETRY_SDK_NAME:()=>grt,ATTR_TELEMETRY_SDK_VERSION:()=>hrt,ATTR_URL_FRAGMENT:()=>_rt,ATTR_URL_FULL:()=>Xh,ATTR_URL_PATH:()=>Ert,ATTR_URL_QUERY:()=>Srt,ATTR_URL_SCHEME:()=>yrt,ATTR_USER_AGENT_ORIGINAL:()=>b5,AWSECSLAUNCHTYPEVALUES_EC2:()=>wet,AWSECSLAUNCHTYPEVALUES_FARGATE:()=>ket,AwsEcsLaunchtypeValues:()=>Met,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_ECS:()=>Aet,CLOUDPLATFORMVALUES_ALIBABA_CLOUD_FC:()=>met,CLOUDPLATFORMVALUES_AWS_EC2:()=>get,CLOUDPLATFORMVALUES_AWS_ECS:()=>het,CLOUDPLATFORMVALUES_AWS_EKS:()=>_et,CLOUDPLATFORMVALUES_AWS_ELASTIC_BEANSTALK:()=>yet,CLOUDPLATFORMVALUES_AWS_LAMBDA:()=>Eet,CLOUDPLATFORMVALUES_AZURE_AKS:()=>Cet,CLOUDPLATFORMVALUES_AZURE_APP_SERVICE:()=>vet,CLOUDPLATFORMVALUES_AZURE_CONTAINER_INSTANCES:()=>Iet,CLOUDPLATFORMVALUES_AZURE_FUNCTIONS:()=>bet,CLOUDPLATFORMVALUES_AZURE_VM:()=>Tet,CLOUDPLATFORMVALUES_GCP_APP_ENGINE:()=>Net,CLOUDPLATFORMVALUES_GCP_CLOUD_FUNCTIONS:()=>Bet,CLOUDPLATFORMVALUES_GCP_CLOUD_RUN:()=>xet,CLOUDPLATFORMVALUES_GCP_COMPUTE_ENGINE:()=>Ret,CLOUDPLATFORMVALUES_GCP_KUBERNETES_ENGINE:()=>Det,CLOUDPROVIDERVALUES_ALIBABA_CLOUD:()=>uet,CLOUDPROVIDERVALUES_AWS:()=>cet,CLOUDPROVIDERVALUES_AZURE:()=>det,CLOUDPROVIDERVALUES_GCP:()=>pet,CloudPlatformValues:()=>Oet,CloudProviderValues:()=>fet,DBCASSANDRACONSISTENCYLEVELVALUES_ALL:()=>qJe,DBCASSANDRACONSISTENCYLEVELVALUES_ANY:()=>tZe,DBCASSANDRACONSISTENCYLEVELVALUES_EACH_QUORUM:()=>YJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_ONE:()=>eZe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_QUORUM:()=>JJe,DBCASSANDRACONSISTENCYLEVELVALUES_LOCAL_SERIAL:()=>rZe,DBCASSANDRACONSISTENCYLEVELVALUES_ONE:()=>ZJe,DBCASSANDRACONSISTENCYLEVELVALUES_QUORUM:()=>KJe,DBCASSANDRACONSISTENCYLEVELVALUES_SERIAL:()=>nZe,DBCASSANDRACONSISTENCYLEVELVALUES_THREE:()=>XJe,DBCASSANDRACONSISTENCYLEVELVALUES_TWO:()=>WJe,DBSYSTEMVALUES_ADABAS:()=>gJe,DBSYSTEMVALUES_CACHE:()=>mJe,DBSYSTEMVALUES_CASSANDRA:()=>wJe,DBSYSTEMVALUES_CLOUDSCAPE:()=>sJe,DBSYSTEMVALUES_COCKROACHDB:()=>$Je,DBSYSTEMVALUES_COLDFUSION:()=>OJe,DBSYSTEMVALUES_COSMOSDB:()=>QJe,DBSYSTEMVALUES_COUCHBASE:()=>UJe,DBSYSTEMVALUES_COUCHDB:()=>LJe,DBSYSTEMVALUES_DB2:()=>rJe,DBSYSTEMVALUES_DERBY:()=>_Je,DBSYSTEMVALUES_DYNAMODB:()=>FJe,DBSYSTEMVALUES_EDB:()=>AJe,DBSYSTEMVALUES_ELASTICSEARCH:()=>HJe,DBSYSTEMVALUES_FILEMAKER:()=>EJe,DBSYSTEMVALUES_FIREBIRD:()=>hJe,DBSYSTEMVALUES_FIRSTSQL:()=>fJe,DBSYSTEMVALUES_GEODE:()=>jJe,DBSYSTEMVALUES_H2:()=>NJe,DBSYSTEMVALUES_HANADB:()=>dJe,DBSYSTEMVALUES_HBASE:()=>kJe,DBSYSTEMVALUES_HIVE:()=>aJe,DBSYSTEMVALUES_HSQLDB:()=>uJe,DBSYSTEMVALUES_INFORMIX:()=>SJe,DBSYSTEMVALUES_INGRES:()=>pJe,DBSYSTEMVALUES_INSTANTDB:()=>yJe,DBSYSTEMVALUES_INTERBASE:()=>TJe,DBSYSTEMVALUES_MARIADB:()=>IJe,DBSYSTEMVALUES_MAXDB:()=>lJe,DBSYSTEMVALUES_MEMCACHED:()=>zJe,DBSYSTEMVALUES_MONGODB:()=>MJe,DBSYSTEMVALUES_MSSQL:()=>eJe,DBSYSTEMVALUES_MYSQL:()=>tJe,DBSYSTEMVALUES_NEO4J:()=>GJe,DBSYSTEMVALUES_NETEZZA:()=>CJe,DBSYSTEMVALUES_ORACLE:()=>nJe,DBSYSTEMVALUES_OTHER_SQL:()=>XKe,DBSYSTEMVALUES_PERVASIVE:()=>bJe,DBSYSTEMVALUES_POINTBASE:()=>vJe,DBSYSTEMVALUES_POSTGRESQL:()=>oJe,DBSYSTEMVALUES_PROGRESS:()=>cJe,DBSYSTEMVALUES_REDIS:()=>PJe,DBSYSTEMVALUES_REDSHIFT:()=>iJe,DBSYSTEMVALUES_SQLITE:()=>RJe,DBSYSTEMVALUES_SYBASE:()=>xJe,DBSYSTEMVALUES_TERADATA:()=>DJe,DBSYSTEMVALUES_VERTICA:()=>BJe,DB_SYSTEM_NAME_VALUE_MARIADB:()=>Gtt,DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER:()=>jtt,DB_SYSTEM_NAME_VALUE_MYSQL:()=>Htt,DB_SYSTEM_NAME_VALUE_POSTGRESQL:()=>ztt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN0:()=>Vtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN1:()=>qtt,DOTNET_GC_HEAP_GENERATION_VALUE_GEN2:()=>Ytt,DOTNET_GC_HEAP_GENERATION_VALUE_LOH:()=>Ktt,DOTNET_GC_HEAP_GENERATION_VALUE_POH:()=>Jtt,DbCassandraConsistencyLevelValues:()=>oZe,DbSystemValues:()=>VJe,ERROR_TYPE_VALUE_OTHER:()=>Ztt,EVENT_EXCEPTION:()=>Eot,FAASDOCUMENTOPERATIONVALUES_DELETE:()=>fZe,FAASDOCUMENTOPERATIONVALUES_EDIT:()=>pZe,FAASDOCUMENTOPERATIONVALUES_INSERT:()=>dZe,FAASINVOKEDPROVIDERVALUES_ALIBABA_CLOUD:()=>mZe,FAASINVOKEDPROVIDERVALUES_AWS:()=>gZe,FAASINVOKEDPROVIDERVALUES_AZURE:()=>hZe,FAASINVOKEDPROVIDERVALUES_GCP:()=>_Ze,FAASTRIGGERVALUES_DATASOURCE:()=>iZe,FAASTRIGGERVALUES_HTTP:()=>aZe,FAASTRIGGERVALUES_OTHER:()=>cZe,FAASTRIGGERVALUES_PUBSUB:()=>sZe,FAASTRIGGERVALUES_TIMER:()=>uZe,FaasDocumentOperationValues:()=>AZe,FaasInvokedProviderValues:()=>EZe,FaasTriggerValues:()=>lZe,HOSTARCHVALUES_AMD64:()=>Pet,HOSTARCHVALUES_ARM32:()=>Uet,HOSTARCHVALUES_ARM64:()=>Let,HOSTARCHVALUES_IA64:()=>Qet,HOSTARCHVALUES_PPC32:()=>Fet,HOSTARCHVALUES_PPC64:()=>Get,HOSTARCHVALUES_X86:()=>jet,HTTPFLAVORVALUES_HTTP_1_0:()=>nWe,HTTPFLAVORVALUES_HTTP_1_1:()=>rWe,HTTPFLAVORVALUES_HTTP_2_0:()=>oWe,HTTPFLAVORVALUES_QUIC:()=>aWe,HTTPFLAVORVALUES_SPDY:()=>iWe,HTTP_REQUEST_METHOD_VALUE_CONNECT:()=>ont,HTTP_REQUEST_METHOD_VALUE_DELETE:()=>int,HTTP_REQUEST_METHOD_VALUE_GET:()=>ant,HTTP_REQUEST_METHOD_VALUE_HEAD:()=>snt,HTTP_REQUEST_METHOD_VALUE_OPTIONS:()=>unt,HTTP_REQUEST_METHOD_VALUE_OTHER:()=>rnt,HTTP_REQUEST_METHOD_VALUE_PATCH:()=>cnt,HTTP_REQUEST_METHOD_VALUE_POST:()=>lnt,HTTP_REQUEST_METHOD_VALUE_PUT:()=>dnt,HTTP_REQUEST_METHOD_VALUE_TRACE:()=>pnt,HostArchValues:()=>Het,HttpFlavorValues:()=>sWe,JVM_MEMORY_TYPE_VALUE_HEAP:()=>Snt,JVM_MEMORY_TYPE_VALUE_NON_HEAP:()=>ynt,JVM_THREAD_STATE_VALUE_BLOCKED:()=>Cnt,JVM_THREAD_STATE_VALUE_NEW:()=>bnt,JVM_THREAD_STATE_VALUE_RUNNABLE:()=>vnt,JVM_THREAD_STATE_VALUE_TERMINATED:()=>Rnt,JVM_THREAD_STATE_VALUE_TIMED_WAITING:()=>xnt,JVM_THREAD_STATE_VALUE_WAITING:()=>Dnt,MESSAGETYPEVALUES_RECEIVED:()=>wWe,MESSAGETYPEVALUES_SENT:()=>OWe,MESSAGINGDESTINATIONKINDVALUES_QUEUE:()=>uWe,MESSAGINGDESTINATIONKINDVALUES_TOPIC:()=>cWe,MESSAGINGOPERATIONVALUES_PROCESS:()=>pWe,MESSAGINGOPERATIONVALUES_RECEIVE:()=>dWe,METRIC_ASPNETCORE_DIAGNOSTICS_EXCEPTIONS:()=>Trt,METRIC_ASPNETCORE_RATE_LIMITING_ACTIVE_REQUEST_LEASES:()=>Irt,METRIC_ASPNETCORE_RATE_LIMITING_QUEUED_REQUESTS:()=>Crt,METRIC_ASPNETCORE_RATE_LIMITING_REQUESTS:()=>Rrt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_LEASE_DURATION:()=>vrt,METRIC_ASPNETCORE_RATE_LIMITING_REQUEST_TIME_IN_QUEUE:()=>brt,METRIC_ASPNETCORE_ROUTING_MATCH_ATTEMPTS:()=>xrt,METRIC_DB_CLIENT_OPERATION_DURATION:()=>Drt,METRIC_DOTNET_ASSEMBLY_COUNT:()=>Brt,METRIC_DOTNET_EXCEPTIONS:()=>Nrt,METRIC_DOTNET_GC_COLLECTIONS:()=>Ort,METRIC_DOTNET_GC_HEAP_TOTAL_ALLOCATED:()=>wrt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_FRAGMENTATION_SIZE:()=>krt,METRIC_DOTNET_GC_LAST_COLLECTION_HEAP_SIZE:()=>Mrt,METRIC_DOTNET_GC_LAST_COLLECTION_MEMORY_COMMITTED_SIZE:()=>Prt,METRIC_DOTNET_GC_PAUSE_TIME:()=>Urt,METRIC_DOTNET_JIT_COMPILATION_TIME:()=>Lrt,METRIC_DOTNET_JIT_COMPILED_IL_SIZE:()=>Qrt,METRIC_DOTNET_JIT_COMPILED_METHODS:()=>Frt,METRIC_DOTNET_MONITOR_LOCK_CONTENTIONS:()=>Grt,METRIC_DOTNET_PROCESS_CPU_COUNT:()=>jrt,METRIC_DOTNET_PROCESS_CPU_TIME:()=>Hrt,METRIC_DOTNET_PROCESS_MEMORY_WORKING_SET:()=>zrt,METRIC_DOTNET_THREAD_POOL_QUEUE_LENGTH:()=>$rt,METRIC_DOTNET_THREAD_POOL_THREAD_COUNT:()=>Vrt,METRIC_DOTNET_THREAD_POOL_WORK_ITEM_COUNT:()=>qrt,METRIC_DOTNET_TIMER_COUNT:()=>Yrt,METRIC_HTTP_CLIENT_REQUEST_DURATION:()=>Krt,METRIC_HTTP_SERVER_REQUEST_DURATION:()=>Jrt,METRIC_JVM_CLASS_COUNT:()=>Zrt,METRIC_JVM_CLASS_LOADED:()=>Wrt,METRIC_JVM_CLASS_UNLOADED:()=>Xrt,METRIC_JVM_CPU_COUNT:()=>eot,METRIC_JVM_CPU_RECENT_UTILIZATION:()=>tot,METRIC_JVM_CPU_TIME:()=>not,METRIC_JVM_GC_DURATION:()=>rot,METRIC_JVM_MEMORY_COMMITTED:()=>oot,METRIC_JVM_MEMORY_LIMIT:()=>iot,METRIC_JVM_MEMORY_USED:()=>aot,METRIC_JVM_MEMORY_USED_AFTER_LAST_GC:()=>sot,METRIC_JVM_THREAD_COUNT:()=>uot,METRIC_KESTREL_ACTIVE_CONNECTIONS:()=>cot,METRIC_KESTREL_ACTIVE_TLS_HANDSHAKES:()=>lot,METRIC_KESTREL_CONNECTION_DURATION:()=>dot,METRIC_KESTREL_QUEUED_CONNECTIONS:()=>pot,METRIC_KESTREL_QUEUED_REQUESTS:()=>fot,METRIC_KESTREL_REJECTED_CONNECTIONS:()=>Aot,METRIC_KESTREL_TLS_HANDSHAKE_DURATION:()=>mot,METRIC_KESTREL_UPGRADED_CONNECTIONS:()=>got,METRIC_SIGNALR_SERVER_ACTIVE_CONNECTIONS:()=>hot,METRIC_SIGNALR_SERVER_CONNECTION_DURATION:()=>_ot,MessageTypeValues:()=>kWe,MessagingDestinationKindValues:()=>lWe,MessagingOperationValues:()=>fWe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA:()=>UZe,NETHOSTCONNECTIONSUBTYPEVALUES_CDMA2000_1XRTT:()=>FZe,NETHOSTCONNECTIONSUBTYPEVALUES_EDGE:()=>MZe,NETHOSTCONNECTIONSUBTYPEVALUES_EHRPD:()=>qZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_0:()=>LZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_A:()=>QZe,NETHOSTCONNECTIONSUBTYPEVALUES_EVDO_B:()=>$Ze,NETHOSTCONNECTIONSUBTYPEVALUES_GPRS:()=>kZe,NETHOSTCONNECTIONSUBTYPEVALUES_GSM:()=>KZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSDPA:()=>GZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPA:()=>HZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSPAP:()=>YZe,NETHOSTCONNECTIONSUBTYPEVALUES_HSUPA:()=>jZe,NETHOSTCONNECTIONSUBTYPEVALUES_IDEN:()=>zZe,NETHOSTCONNECTIONSUBTYPEVALUES_IWLAN:()=>ZZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE:()=>VZe,NETHOSTCONNECTIONSUBTYPEVALUES_LTE_CA:()=>eWe,NETHOSTCONNECTIONSUBTYPEVALUES_NR:()=>WZe,NETHOSTCONNECTIONSUBTYPEVALUES_NRNSA:()=>XZe,NETHOSTCONNECTIONSUBTYPEVALUES_TD_SCDMA:()=>JZe,NETHOSTCONNECTIONSUBTYPEVALUES_UMTS:()=>PZe,NETHOSTCONNECTIONTYPEVALUES_CELL:()=>BZe,NETHOSTCONNECTIONTYPEVALUES_UNAVAILABLE:()=>NZe,NETHOSTCONNECTIONTYPEVALUES_UNKNOWN:()=>OZe,NETHOSTCONNECTIONTYPEVALUES_WIFI:()=>xZe,NETHOSTCONNECTIONTYPEVALUES_WIRED:()=>DZe,NETTRANSPORTVALUES_INPROC:()=>bZe,NETTRANSPORTVALUES_IP:()=>TZe,NETTRANSPORTVALUES_IP_TCP:()=>SZe,NETTRANSPORTVALUES_IP_UDP:()=>yZe,NETTRANSPORTVALUES_OTHER:()=>vZe,NETTRANSPORTVALUES_PIPE:()=>CZe,NETTRANSPORTVALUES_UNIX:()=>IZe,NETWORK_TRANSPORT_VALUE_PIPE:()=>wnt,NETWORK_TRANSPORT_VALUE_QUIC:()=>knt,NETWORK_TRANSPORT_VALUE_TCP:()=>Mnt,NETWORK_TRANSPORT_VALUE_UDP:()=>Pnt,NETWORK_TRANSPORT_VALUE_UNIX:()=>Unt,NETWORK_TYPE_VALUE_IPV4:()=>Qnt,NETWORK_TYPE_VALUE_IPV6:()=>Fnt,NetHostConnectionSubtypeValues:()=>tWe,NetHostConnectionTypeValues:()=>wZe,NetTransportValues:()=>RZe,OSTYPEVALUES_AIX:()=>Wet,OSTYPEVALUES_DARWIN:()=>Vet,OSTYPEVALUES_DRAGONFLYBSD:()=>Jet,OSTYPEVALUES_FREEBSD:()=>qet,OSTYPEVALUES_HPUX:()=>Zet,OSTYPEVALUES_LINUX:()=>$et,OSTYPEVALUES_NETBSD:()=>Yet,OSTYPEVALUES_OPENBSD:()=>Ket,OSTYPEVALUES_SOLARIS:()=>Xet,OSTYPEVALUES_WINDOWS:()=>zet,OSTYPEVALUES_Z_OS:()=>ett,OTEL_STATUS_CODE_VALUE_ERROR:()=>znt,OTEL_STATUS_CODE_VALUE_OK:()=>$nt,OsTypeValues:()=>ttt,RPCGRPCSTATUSCODEVALUES_ABORTED:()=>CWe,RPCGRPCSTATUSCODEVALUES_ALREADY_EXISTS:()=>SWe,RPCGRPCSTATUSCODEVALUES_CANCELLED:()=>mWe,RPCGRPCSTATUSCODEVALUES_DATA_LOSS:()=>DWe,RPCGRPCSTATUSCODEVALUES_DEADLINE_EXCEEDED:()=>_We,RPCGRPCSTATUSCODEVALUES_FAILED_PRECONDITION:()=>IWe,RPCGRPCSTATUSCODEVALUES_INTERNAL:()=>RWe,RPCGRPCSTATUSCODEVALUES_INVALID_ARGUMENT:()=>hWe,RPCGRPCSTATUSCODEVALUES_NOT_FOUND:()=>EWe,RPCGRPCSTATUSCODEVALUES_OK:()=>AWe,RPCGRPCSTATUSCODEVALUES_OUT_OF_RANGE:()=>bWe,RPCGRPCSTATUSCODEVALUES_PERMISSION_DENIED:()=>yWe,RPCGRPCSTATUSCODEVALUES_RESOURCE_EXHAUSTED:()=>TWe,RPCGRPCSTATUSCODEVALUES_UNAUTHENTICATED:()=>BWe,RPCGRPCSTATUSCODEVALUES_UNAVAILABLE:()=>xWe,RPCGRPCSTATUSCODEVALUES_UNIMPLEMENTED:()=>vWe,RPCGRPCSTATUSCODEVALUES_UNKNOWN:()=>gWe,RpcGrpcStatusCodeValues:()=>NWe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTES_TO_GET:()=>lKe,SEMATTRS_AWS_DYNAMODB_ATTRIBUTE_DEFINITIONS:()=>TKe,SEMATTRS_AWS_DYNAMODB_CONSISTENT_READ:()=>sKe,SEMATTRS_AWS_DYNAMODB_CONSUMED_CAPACITY:()=>rKe,SEMATTRS_AWS_DYNAMODB_COUNT:()=>SKe,SEMATTRS_AWS_DYNAMODB_EXCLUSIVE_START_TABLE:()=>mKe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEXES:()=>fKe,SEMATTRS_AWS_DYNAMODB_GLOBAL_SECONDARY_INDEX_UPDATES:()=>IKe,SEMATTRS_AWS_DYNAMODB_INDEX_NAME:()=>dKe,SEMATTRS_AWS_DYNAMODB_ITEM_COLLECTION_METRICS:()=>oKe,SEMATTRS_AWS_DYNAMODB_LIMIT:()=>cKe,SEMATTRS_AWS_DYNAMODB_LOCAL_SECONDARY_INDEXES:()=>AKe,SEMATTRS_AWS_DYNAMODB_PROJECTION:()=>uKe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_READ_CAPACITY:()=>iKe,SEMATTRS_AWS_DYNAMODB_PROVISIONED_WRITE_CAPACITY:()=>aKe,SEMATTRS_AWS_DYNAMODB_SCANNED_COUNT:()=>yKe,SEMATTRS_AWS_DYNAMODB_SCAN_FORWARD:()=>hKe,SEMATTRS_AWS_DYNAMODB_SEGMENT:()=>_Ke,SEMATTRS_AWS_DYNAMODB_SELECT:()=>pKe,SEMATTRS_AWS_DYNAMODB_TABLE_COUNT:()=>gKe,SEMATTRS_AWS_DYNAMODB_TABLE_NAMES:()=>nKe,SEMATTRS_AWS_DYNAMODB_TOTAL_SEGMENTS:()=>EKe,SEMATTRS_AWS_LAMBDA_INVOKED_ARN:()=>Y7e,SEMATTRS_CODE_FILEPATH:()=>VYe,SEMATTRS_CODE_FUNCTION:()=>zYe,SEMATTRS_CODE_LINENO:()=>qYe,SEMATTRS_CODE_NAMESPACE:()=>$Ye,SEMATTRS_DB_CASSANDRA_CONSISTENCY_LEVEL:()=>rYe,SEMATTRS_DB_CASSANDRA_COORDINATOR_DC:()=>uYe,SEMATTRS_DB_CASSANDRA_COORDINATOR_ID:()=>sYe,SEMATTRS_DB_CASSANDRA_IDEMPOTENCE:()=>iYe,SEMATTRS_DB_CASSANDRA_KEYSPACE:()=>tYe,SEMATTRS_DB_CASSANDRA_PAGE_SIZE:()=>nYe,SEMATTRS_DB_CASSANDRA_SPECULATIVE_EXECUTION_COUNT:()=>aYe,SEMATTRS_DB_CASSANDRA_TABLE:()=>oYe,SEMATTRS_DB_CONNECTION_STRING:()=>K7e,SEMATTRS_DB_HBASE_NAMESPACE:()=>cYe,SEMATTRS_DB_JDBC_DRIVER_CLASSNAME:()=>Z7e,SEMATTRS_DB_MONGODB_COLLECTION:()=>dYe,SEMATTRS_DB_MSSQL_INSTANCE_NAME:()=>eYe,SEMATTRS_DB_NAME:()=>W7e,SEMATTRS_DB_OPERATION:()=>X7e,SEMATTRS_DB_REDIS_DATABASE_INDEX:()=>lYe,SEMATTRS_DB_SQL_TABLE:()=>pYe,SEMATTRS_DB_STATEMENT:()=>X$,SEMATTRS_DB_SYSTEM:()=>W$,SEMATTRS_DB_USER:()=>J7e,SEMATTRS_ENDUSER_ID:()=>QYe,SEMATTRS_ENDUSER_ROLE:()=>FYe,SEMATTRS_ENDUSER_SCOPE:()=>GYe,SEMATTRS_EXCEPTION_ESCAPED:()=>gYe,SEMATTRS_EXCEPTION_MESSAGE:()=>AYe,SEMATTRS_EXCEPTION_STACKTRACE:()=>mYe,SEMATTRS_EXCEPTION_TYPE:()=>fYe,SEMATTRS_FAAS_COLDSTART:()=>CYe,SEMATTRS_FAAS_CRON:()=>IYe,SEMATTRS_FAAS_DOCUMENT_COLLECTION:()=>_Ye,SEMATTRS_FAAS_DOCUMENT_NAME:()=>yYe,SEMATTRS_FAAS_DOCUMENT_OPERATION:()=>EYe,SEMATTRS_FAAS_DOCUMENT_TIME:()=>SYe,SEMATTRS_FAAS_EXECUTION:()=>hYe,SEMATTRS_FAAS_INVOKED_NAME:()=>bYe,SEMATTRS_FAAS_INVOKED_PROVIDER:()=>vYe,SEMATTRS_FAAS_INVOKED_REGION:()=>RYe,SEMATTRS_FAAS_TIME:()=>TYe,SEMATTRS_FAAS_TRIGGER:()=>e5,SEMATTRS_HTTP_CLIENT_IP:()=>tKe,SEMATTRS_HTTP_FLAVOR:()=>JYe,SEMATTRS_HTTP_HOST:()=>YYe,SEMATTRS_HTTP_METHOD:()=>nB,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH:()=>WYe,SEMATTRS_HTTP_REQUEST_CONTENT_LENGTH_UNCOMPRESSED:()=>XYe,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH:()=>i5,SEMATTRS_HTTP_RESPONSE_CONTENT_LENGTH_UNCOMPRESSED:()=>a5,SEMATTRS_HTTP_ROUTE:()=>s5,SEMATTRS_HTTP_SCHEME:()=>KYe,SEMATTRS_HTTP_SERVER_NAME:()=>eKe,SEMATTRS_HTTP_STATUS_CODE:()=>xS,SEMATTRS_HTTP_TARGET:()=>o5,SEMATTRS_HTTP_URL:()=>$C,SEMATTRS_HTTP_USER_AGENT:()=>ZYe,SEMATTRS_MESSAGE_COMPRESSED_SIZE:()=>JKe,SEMATTRS_MESSAGE_ID:()=>KKe,SEMATTRS_MESSAGE_TYPE:()=>YKe,SEMATTRS_MESSAGE_UNCOMPRESSED_SIZE:()=>ZKe,SEMATTRS_MESSAGING_CONSUMER_ID:()=>MKe,SEMATTRS_MESSAGING_CONVERSATION_ID:()=>NKe,SEMATTRS_MESSAGING_DESTINATION:()=>CKe,SEMATTRS_MESSAGING_DESTINATION_KIND:()=>bKe,SEMATTRS_MESSAGING_KAFKA_CLIENT_ID:()=>QKe,SEMATTRS_MESSAGING_KAFKA_CONSUMER_GROUP:()=>LKe,SEMATTRS_MESSAGING_KAFKA_MESSAGE_KEY:()=>UKe,SEMATTRS_MESSAGING_KAFKA_PARTITION:()=>FKe,SEMATTRS_MESSAGING_KAFKA_TOMBSTONE:()=>GKe,SEMATTRS_MESSAGING_MESSAGE_ID:()=>BKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_COMPRESSED_SIZE_BYTES:()=>wKe,SEMATTRS_MESSAGING_MESSAGE_PAYLOAD_SIZE_BYTES:()=>OKe,SEMATTRS_MESSAGING_OPERATION:()=>kKe,SEMATTRS_MESSAGING_PROTOCOL:()=>RKe,SEMATTRS_MESSAGING_PROTOCOL_VERSION:()=>xKe,SEMATTRS_MESSAGING_RABBITMQ_ROUTING_KEY:()=>PKe,SEMATTRS_MESSAGING_SYSTEM:()=>u5,SEMATTRS_MESSAGING_TEMP_DESTINATION:()=>vKe,SEMATTRS_MESSAGING_URL:()=>DKe,SEMATTRS_NET_HOST_CARRIER_ICC:()=>UYe,SEMATTRS_NET_HOST_CARRIER_MCC:()=>MYe,SEMATTRS_NET_HOST_CARRIER_MNC:()=>PYe,SEMATTRS_NET_HOST_CARRIER_NAME:()=>kYe,SEMATTRS_NET_HOST_CONNECTION_SUBTYPE:()=>wYe,SEMATTRS_NET_HOST_CONNECTION_TYPE:()=>OYe,SEMATTRS_NET_HOST_IP:()=>n5,SEMATTRS_NET_HOST_NAME:()=>NYe,SEMATTRS_NET_HOST_PORT:()=>r5,SEMATTRS_NET_PEER_IP:()=>t5,SEMATTRS_NET_PEER_NAME:()=>BYe,SEMATTRS_NET_PEER_PORT:()=>DYe,SEMATTRS_NET_TRANSPORT:()=>xYe,SEMATTRS_PEER_SERVICE:()=>LYe,SEMATTRS_RPC_GRPC_STATUS_CODE:()=>l5,SEMATTRS_RPC_JSONRPC_ERROR_CODE:()=>VKe,SEMATTRS_RPC_JSONRPC_ERROR_MESSAGE:()=>qKe,SEMATTRS_RPC_JSONRPC_REQUEST_ID:()=>$Ke,SEMATTRS_RPC_JSONRPC_VERSION:()=>zKe,SEMATTRS_RPC_METHOD:()=>HKe,SEMATTRS_RPC_SERVICE:()=>c5,SEMATTRS_RPC_SYSTEM:()=>jKe,SEMATTRS_THREAD_ID:()=>jYe,SEMATTRS_THREAD_NAME:()=>HYe,SEMRESATTRS_AWS_ECS_CLUSTER_ARN:()=>GWe,SEMRESATTRS_AWS_ECS_CONTAINER_ARN:()=>FWe,SEMRESATTRS_AWS_ECS_LAUNCHTYPE:()=>jWe,SEMRESATTRS_AWS_ECS_TASK_ARN:()=>HWe,SEMRESATTRS_AWS_ECS_TASK_FAMILY:()=>zWe,SEMRESATTRS_AWS_ECS_TASK_REVISION:()=>$We,SEMRESATTRS_AWS_EKS_CLUSTER_ARN:()=>VWe,SEMRESATTRS_AWS_LOG_GROUP_ARNS:()=>YWe,SEMRESATTRS_AWS_LOG_GROUP_NAMES:()=>qWe,SEMRESATTRS_AWS_LOG_STREAM_ARNS:()=>JWe,SEMRESATTRS_AWS_LOG_STREAM_NAMES:()=>KWe,SEMRESATTRS_CLOUD_ACCOUNT_ID:()=>PWe,SEMRESATTRS_CLOUD_AVAILABILITY_ZONE:()=>LWe,SEMRESATTRS_CLOUD_PLATFORM:()=>QWe,SEMRESATTRS_CLOUD_PROVIDER:()=>MWe,SEMRESATTRS_CLOUD_REGION:()=>UWe,SEMRESATTRS_CONTAINER_ID:()=>WWe,SEMRESATTRS_CONTAINER_IMAGE_NAME:()=>eXe,SEMRESATTRS_CONTAINER_IMAGE_TAG:()=>tXe,SEMRESATTRS_CONTAINER_NAME:()=>ZWe,SEMRESATTRS_CONTAINER_RUNTIME:()=>XWe,SEMRESATTRS_DEPLOYMENT_ENVIRONMENT:()=>nXe,SEMRESATTRS_DEVICE_ID:()=>rXe,SEMRESATTRS_DEVICE_MODEL_IDENTIFIER:()=>oXe,SEMRESATTRS_DEVICE_MODEL_NAME:()=>iXe,SEMRESATTRS_FAAS_ID:()=>sXe,SEMRESATTRS_FAAS_INSTANCE:()=>cXe,SEMRESATTRS_FAAS_MAX_MEMORY:()=>lXe,SEMRESATTRS_FAAS_NAME:()=>aXe,SEMRESATTRS_FAAS_VERSION:()=>uXe,SEMRESATTRS_HOST_ARCH:()=>AXe,SEMRESATTRS_HOST_ID:()=>dXe,SEMRESATTRS_HOST_IMAGE_ID:()=>gXe,SEMRESATTRS_HOST_IMAGE_NAME:()=>mXe,SEMRESATTRS_HOST_IMAGE_VERSION:()=>hXe,SEMRESATTRS_HOST_NAME:()=>pXe,SEMRESATTRS_HOST_TYPE:()=>fXe,SEMRESATTRS_K8S_CLUSTER_NAME:()=>_Xe,SEMRESATTRS_K8S_CONTAINER_NAME:()=>CXe,SEMRESATTRS_K8S_CRONJOB_NAME:()=>PXe,SEMRESATTRS_K8S_CRONJOB_UID:()=>MXe,SEMRESATTRS_K8S_DAEMONSET_NAME:()=>OXe,SEMRESATTRS_K8S_DAEMONSET_UID:()=>NXe,SEMRESATTRS_K8S_DEPLOYMENT_NAME:()=>xXe,SEMRESATTRS_K8S_DEPLOYMENT_UID:()=>RXe,SEMRESATTRS_K8S_JOB_NAME:()=>kXe,SEMRESATTRS_K8S_JOB_UID:()=>wXe,SEMRESATTRS_K8S_NAMESPACE_NAME:()=>yXe,SEMRESATTRS_K8S_NODE_NAME:()=>EXe,SEMRESATTRS_K8S_NODE_UID:()=>SXe,SEMRESATTRS_K8S_POD_NAME:()=>IXe,SEMRESATTRS_K8S_POD_UID:()=>TXe,SEMRESATTRS_K8S_REPLICASET_NAME:()=>vXe,SEMRESATTRS_K8S_REPLICASET_UID:()=>bXe,SEMRESATTRS_K8S_STATEFULSET_NAME:()=>BXe,SEMRESATTRS_K8S_STATEFULSET_UID:()=>DXe,SEMRESATTRS_OS_DESCRIPTION:()=>LXe,SEMRESATTRS_OS_NAME:()=>QXe,SEMRESATTRS_OS_TYPE:()=>UXe,SEMRESATTRS_OS_VERSION:()=>FXe,SEMRESATTRS_PROCESS_COMMAND:()=>zXe,SEMRESATTRS_PROCESS_COMMAND_ARGS:()=>VXe,SEMRESATTRS_PROCESS_COMMAND_LINE:()=>$Xe,SEMRESATTRS_PROCESS_EXECUTABLE_NAME:()=>jXe,SEMRESATTRS_PROCESS_EXECUTABLE_PATH:()=>HXe,SEMRESATTRS_PROCESS_OWNER:()=>qXe,SEMRESATTRS_PROCESS_PID:()=>GXe,SEMRESATTRS_PROCESS_RUNTIME_DESCRIPTION:()=>JXe,SEMRESATTRS_PROCESS_RUNTIME_NAME:()=>YXe,SEMRESATTRS_PROCESS_RUNTIME_VERSION:()=>KXe,SEMRESATTRS_SERVICE_INSTANCE_ID:()=>WXe,SEMRESATTRS_SERVICE_NAME:()=>ZXe,SEMRESATTRS_SERVICE_NAMESPACE:()=>d5,SEMRESATTRS_SERVICE_VERSION:()=>XXe,SEMRESATTRS_TELEMETRY_AUTO_VERSION:()=>ret,SEMRESATTRS_TELEMETRY_SDK_LANGUAGE:()=>tet,SEMRESATTRS_TELEMETRY_SDK_NAME:()=>eet,SEMRESATTRS_TELEMETRY_SDK_VERSION:()=>net,SEMRESATTRS_WEBENGINE_DESCRIPTION:()=>aet,SEMRESATTRS_WEBENGINE_NAME:()=>oet,SEMRESATTRS_WEBENGINE_VERSION:()=>iet,SIGNALR_CONNECTION_STATUS_VALUE_APP_SHUTDOWN:()=>Jnt,SIGNALR_CONNECTION_STATUS_VALUE_NORMAL_CLOSURE:()=>Znt,SIGNALR_CONNECTION_STATUS_VALUE_TIMEOUT:()=>Wnt,SIGNALR_TRANSPORT_VALUE_LONG_POLLING:()=>ert,SIGNALR_TRANSPORT_VALUE_SERVER_SENT_EVENTS:()=>trt,SIGNALR_TRANSPORT_VALUE_WEB_SOCKETS:()=>nrt,SemanticAttributes:()=>WKe,SemanticResourceAttributes:()=>set,TELEMETRYSDKLANGUAGEVALUES_CPP:()=>ntt,TELEMETRYSDKLANGUAGEVALUES_DOTNET:()=>rtt,TELEMETRYSDKLANGUAGEVALUES_ERLANG:()=>ott,TELEMETRYSDKLANGUAGEVALUES_GO:()=>itt,TELEMETRYSDKLANGUAGEVALUES_JAVA:()=>att,TELEMETRYSDKLANGUAGEVALUES_NODEJS:()=>stt,TELEMETRYSDKLANGUAGEVALUES_PHP:()=>utt,TELEMETRYSDKLANGUAGEVALUES_PYTHON:()=>ctt,TELEMETRYSDKLANGUAGEVALUES_RUBY:()=>ltt,TELEMETRYSDKLANGUAGEVALUES_WEBJS:()=>dtt,TELEMETRY_SDK_LANGUAGE_VALUE_CPP:()=>ort,TELEMETRY_SDK_LANGUAGE_VALUE_DOTNET:()=>irt,TELEMETRY_SDK_LANGUAGE_VALUE_ERLANG:()=>art,TELEMETRY_SDK_LANGUAGE_VALUE_GO:()=>srt,TELEMETRY_SDK_LANGUAGE_VALUE_JAVA:()=>urt,TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS:()=>crt,TELEMETRY_SDK_LANGUAGE_VALUE_PHP:()=>lrt,TELEMETRY_SDK_LANGUAGE_VALUE_PYTHON:()=>drt,TELEMETRY_SDK_LANGUAGE_VALUE_RUBY:()=>prt,TELEMETRY_SDK_LANGUAGE_VALUE_RUST:()=>frt,TELEMETRY_SDK_LANGUAGE_VALUE_SWIFT:()=>Art,TELEMETRY_SDK_LANGUAGE_VALUE_WEBJS:()=>mrt,TelemetrySdkLanguageValues:()=>ptt});var Zn=O(()=>{m();Sge();V_e();q_e();Y_e();K_e()});var J_e=F(h2=>{"use strict";m();Object.defineProperty(h2,"__esModule",{value:!0});h2.ATTR_PROCESS_RUNTIME_NAME=void 0;h2.ATTR_PROCESS_RUNTIME_NAME="process.runtime.name"});var Z_e=F(E2=>{"use strict";m();Object.defineProperty(E2,"__esModule",{value:!0});E2.SDK_INFO=void 0;var Sot=Dde(),_2=(Zn(),Me(Ur)),yot=J_e();E2.SDK_INFO={[_2.ATTR_TELEMETRY_SDK_NAME]:"opentelemetry",[yot.ATTR_PROCESS_RUNTIME_NAME]:"node",[_2.ATTR_TELEMETRY_SDK_LANGUAGE]:_2.TELEMETRY_SDK_LANGUAGE_VALUE_NODEJS,[_2.ATTR_TELEMETRY_SDK_VERSION]:Sot.VERSION}});var W_e=F(Zs=>{"use strict";m();Object.defineProperty(Zs,"__esModule",{value:!0});Zs.otperformance=Zs.SDK_INFO=Zs._globalThis=Zs.getStringListFromEnv=Zs.getNumberFromEnv=Zs.getBooleanFromEnv=Zs.getStringFromEnv=void 0;var S2=Rde();Object.defineProperty(Zs,"getStringFromEnv",{enumerable:!0,get:function(){return S2.getStringFromEnv}});Object.defineProperty(Zs,"getBooleanFromEnv",{enumerable:!0,get:function(){return S2.getBooleanFromEnv}});Object.defineProperty(Zs,"getNumberFromEnv",{enumerable:!0,get:function(){return S2.getNumberFromEnv}});Object.defineProperty(Zs,"getStringListFromEnv",{enumerable:!0,get:function(){return S2.getStringListFromEnv}});var Tot=xde();Object.defineProperty(Zs,"_globalThis",{enumerable:!0,get:function(){return Tot._globalThis}});var Iot=Z_e();Object.defineProperty(Zs,"SDK_INFO",{enumerable:!0,get:function(){return Iot.SDK_INFO}});Zs.otperformance=performance});var v5=F(Ws=>{"use strict";m();Object.defineProperty(Ws,"__esModule",{value:!0});Ws.getStringListFromEnv=Ws.getNumberFromEnv=Ws.getStringFromEnv=Ws.getBooleanFromEnv=Ws.otperformance=Ws._globalThis=Ws.SDK_INFO=void 0;var NS=W_e();Object.defineProperty(Ws,"SDK_INFO",{enumerable:!0,get:function(){return NS.SDK_INFO}});Object.defineProperty(Ws,"_globalThis",{enumerable:!0,get:function(){return NS._globalThis}});Object.defineProperty(Ws,"otperformance",{enumerable:!0,get:function(){return NS.otperformance}});Object.defineProperty(Ws,"getBooleanFromEnv",{enumerable:!0,get:function(){return NS.getBooleanFromEnv}});Object.defineProperty(Ws,"getStringFromEnv",{enumerable:!0,get:function(){return NS.getStringFromEnv}});Object.defineProperty(Ws,"getNumberFromEnv",{enumerable:!0,get:function(){return NS.getNumberFromEnv}});Object.defineProperty(Ws,"getStringListFromEnv",{enumerable:!0,get:function(){return NS.getStringListFromEnv}})});var nEe=F(io=>{"use strict";m();Object.defineProperty(io,"__esModule",{value:!0});io.addHrTimes=io.isTimeInput=io.isTimeInputHrTime=io.hrTimeToMicroseconds=io.hrTimeToMilliseconds=io.hrTimeToNanoseconds=io.hrTimeToTimeStamp=io.hrTimeDuration=io.timeInputToHrTime=io.hrTime=io.getTimeOrigin=io.millisToHrTime=void 0;var y2=v5(),X_e=9,Cot=6,bot=Math.pow(10,Cot),T2=Math.pow(10,X_e);function rB(e){let t=e/1e3,n=Math.trunc(t),r=Math.round(e%1e3*bot);return[n,r]}io.millisToHrTime=rB;function vot(){return y2.otperformance.timeOrigin}io.getTimeOrigin=vot;function eEe(e){let t=rB(y2.otperformance.timeOrigin),n=rB(typeof e=="number"?e:y2.otperformance.now());return tEe(t,n)}io.hrTime=eEe;function Rot(e){if(R5(e))return e;if(typeof e=="number")return e<y2.otperformance.timeOrigin?eEe(e):rB(e);if(e instanceof Date)return rB(e.getTime());throw TypeError("Invalid input type")}io.timeInputToHrTime=Rot;function xot(e,t){let n=t[0]-e[0],r=t[1]-e[1];return r<0&&(n-=1,r+=T2),[n,r]}io.hrTimeDuration=xot;function Dot(e){let t=X_e,n=`${"0".repeat(t)}${e[1]}Z`,r=n.substring(n.length-t-1);return new Date(e[0]*1e3).toISOString().replace("000Z",r)}io.hrTimeToTimeStamp=Dot;function Bot(e){return e[0]*T2+e[1]}io.hrTimeToNanoseconds=Bot;function Not(e){return e[0]*1e3+e[1]/1e6}io.hrTimeToMilliseconds=Not;function Oot(e){return e[0]*1e6+e[1]/1e3}io.hrTimeToMicroseconds=Oot;function R5(e){return Array.isArray(e)&&e.length===2&&typeof e[0]=="number"&&typeof e[1]=="number"}io.isTimeInputHrTime=R5;function wot(e){return R5(e)||typeof e=="number"||e instanceof Date}io.isTimeInput=wot;function tEe(e,t){let n=[e[0]+t[0],e[1]+t[1]];return n[1]>=T2&&(n[1]-=T2,n[0]+=1),n}io.addHrTimes=tEe});var rEe=F(I2=>{"use strict";m();Object.defineProperty(I2,"__esModule",{value:!0});I2.unrefTimer=void 0;function kot(e){typeof e!="number"&&e.unref()}I2.unrefTimer=kot});var oEe=F(oB=>{"use strict";m();Object.defineProperty(oB,"__esModule",{value:!0});oB.ExportResultCode=void 0;var Mot;(function(e){e[e.SUCCESS=0]="SUCCESS",e[e.FAILED=1]="FAILED"})(Mot=oB.ExportResultCode||(oB.ExportResultCode={}))});var aEe=F(C2=>{"use strict";m();Object.defineProperty(C2,"__esModule",{value:!0});C2.CompositePropagator=void 0;var iEe=(je(),Me(We)),x5=class{_propagators;_fields;constructor(t={}){this._propagators=t.propagators??[],this._fields=Array.from(new Set(this._propagators.map(n=>typeof n.fields=="function"?n.fields():[]).reduce((n,r)=>n.concat(r),[])))}inject(t,n,r){for(let o of this._propagators)try{o.inject(t,n,r)}catch(i){iEe.diag.warn(`Failed to inject with ${o.constructor.name}. Err: ${i.message}`)}}extract(t,n,r){return this._propagators.reduce((o,i)=>{try{return i.extract(o,n,r)}catch(a){iEe.diag.warn(`Failed to extract with ${i.constructor.name}. Err: ${a.message}`)}return o},t)}fields(){return this._fields.slice()}};C2.CompositePropagator=x5});var sEe=F(qC=>{"use strict";m();Object.defineProperty(qC,"__esModule",{value:!0});qC.validateValue=qC.validateKey=void 0;var D5="[_0-9a-z-*/]",Pot=`[a-z]${D5}{0,255}`,Uot=`[a-z0-9]${D5}{0,240}@[a-z]${D5}{0,13}`,Lot=new RegExp(`^(?:${Pot}|${Uot})$`),Qot=/^[ -~]{0,255}[!-~]$/,Fot=/,|=/;function Got(e){return Lot.test(e)}qC.validateKey=Got;function jot(e){return Qot.test(e)&&!Fot.test(e)}qC.validateValue=jot});var N5=F(b2=>{"use strict";m();Object.defineProperty(b2,"__esModule",{value:!0});b2.TraceState=void 0;var uEe=sEe(),cEe=32,Hot=512,lEe=",",dEe="=",B5=class e{_internalState=new Map;constructor(t){t&&this._parse(t)}set(t,n){let r=this._clone();return r._internalState.has(t)&&r._internalState.delete(t),r._internalState.set(t,n),r}unset(t){let n=this._clone();return n._internalState.delete(t),n}get(t){return this._internalState.get(t)}serialize(){return this._keys().reduce((t,n)=>(t.push(n+dEe+this.get(n)),t),[]).join(lEe)}_parse(t){t.length>Hot||(this._internalState=t.split(lEe).reverse().reduce((n,r)=>{let o=r.trim(),i=o.indexOf(dEe);if(i!==-1){let a=o.slice(0,i),c=o.slice(i+1,r.length);(0,uEe.validateKey)(a)&&(0,uEe.validateValue)(c)&&n.set(a,c)}return n},new Map),this._internalState.size>cEe&&(this._internalState=new Map(Array.from(this._internalState.entries()).reverse().slice(0,cEe))))}_keys(){return Array.from(this._internalState.keys()).reverse()}_clone(){let t=new e;return t._internalState=new Map(this._internalState),t}};b2.TraceState=B5});var fEe=F(Xs=>{"use strict";m();Object.defineProperty(Xs,"__esModule",{value:!0});Xs.W3CTraceContextPropagator=Xs.parseTraceParent=Xs.TRACE_STATE_HEADER=Xs.TRACE_PARENT_HEADER=void 0;var v2=(je(),Me(We)),zot=tB(),$ot=N5();Xs.TRACE_PARENT_HEADER="traceparent";Xs.TRACE_STATE_HEADER="tracestate";var Vot="00",qot="(?!ff)[\\da-f]{2}",Yot="(?![0]{32})[\\da-f]{32}",Kot="(?![0]{16})[\\da-f]{16}",Jot="[\\da-f]{2}",Zot=new RegExp(`^\\s?(${qot})-(${Yot})-(${Kot})-(${Jot})(-.*)?\\s?$`);function pEe(e){let t=Zot.exec(e);return!t||t[1]==="00"&&t[5]?null:{traceId:t[2],spanId:t[3],traceFlags:parseInt(t[4],16)}}Xs.parseTraceParent=pEe;var O5=class{inject(t,n,r){let o=v2.trace.getSpanContext(t);if(!o||(0,zot.isTracingSuppressed)(t)||!(0,v2.isSpanContextValid)(o))return;let i=`${Vot}-${o.traceId}-${o.spanId}-0${Number(o.traceFlags||v2.TraceFlags.NONE).toString(16)}`;r.set(n,Xs.TRACE_PARENT_HEADER,i),o.traceState&&r.set(n,Xs.TRACE_STATE_HEADER,o.traceState.serialize())}extract(t,n,r){let o=r.get(n,Xs.TRACE_PARENT_HEADER);if(!o)return t;let i=Array.isArray(o)?o[0]:o;if(typeof i!="string")return t;let a=pEe(i);if(!a)return t;a.isRemote=!0;let c=r.get(n,Xs.TRACE_STATE_HEADER);if(c){let d=Array.isArray(c)?c.join(","):c;a.traceState=new $ot.TraceState(typeof d=="string"?d:void 0)}return v2.trace.setSpanContext(t,a)}fields(){return[Xs.TRACE_PARENT_HEADER,Xs.TRACE_STATE_HEADER]}};Xs.W3CTraceContextPropagator=O5});var AEe=F(Yp=>{"use strict";m();Object.defineProperty(Yp,"__esModule",{value:!0});Yp.getRPCMetadata=Yp.deleteRPCMetadata=Yp.setRPCMetadata=Yp.RPCType=void 0;var Wot=(je(),Me(We)),w5=(0,Wot.createContextKey)("OpenTelemetry SDK Context Key RPC_METADATA"),Xot;(function(e){e.HTTP="http"})(Xot=Yp.RPCType||(Yp.RPCType={}));function eit(e,t){return e.setValue(w5,t)}Yp.setRPCMetadata=eit;function tit(e){return e.deleteValue(w5)}Yp.deleteRPCMetadata=tit;function nit(e){return e.getValue(w5)}Yp.getRPCMetadata=nit});var EEe=F(R2=>{"use strict";m();Object.defineProperty(R2,"__esModule",{value:!0});R2.isPlainObject=void 0;var rit="[object Object]",oit="[object Null]",iit="[object Undefined]",ait=Function.prototype,mEe=ait.toString,sit=mEe.call(Object),uit=Object.getPrototypeOf,gEe=Object.prototype,hEe=gEe.hasOwnProperty,OS=Symbol?Symbol.toStringTag:void 0,_Ee=gEe.toString;function cit(e){if(!lit(e)||dit(e)!==rit)return!1;let t=uit(e);if(t===null)return!0;let n=hEe.call(t,"constructor")&&t.constructor;return typeof n=="function"&&n instanceof n&&mEe.call(n)===sit}R2.isPlainObject=cit;function lit(e){return e!=null&&typeof e=="object"}function dit(e){return e==null?e===void 0?iit:oit:OS&&OS in Object(e)?pit(e):fit(e)}function pit(e){let t=hEe.call(e,OS),n=e[OS],r=!1;try{e[OS]=void 0,r=!0}catch{}let o=_Ee.call(e);return r&&(t?e[OS]=n:delete e[OS]),o}function fit(e){return _Ee.call(e)}});var CEe=F(B2=>{"use strict";m();Object.defineProperty(B2,"__esModule",{value:!0});B2.merge=void 0;var SEe=EEe(),Ait=20;function mit(...e){let t=e.shift(),n=new WeakMap;for(;e.length>0;)t=TEe(t,e.shift(),0,n);return t}B2.merge=mit;function k5(e){return D2(e)?e.slice():e}function TEe(e,t,n=0,r){let o;if(!(n>Ait)){if(n++,x2(e)||x2(t)||IEe(t))o=k5(t);else if(D2(e)){if(o=e.slice(),D2(t))for(let i=0,a=t.length;i<a;i++)o.push(k5(t[i]));else if(iB(t)){let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a];o[d]=k5(t[d])}}}else if(iB(e))if(iB(t)){if(!git(e,t))return t;o=Object.assign({},e);let i=Object.keys(t);for(let a=0,c=i.length;a<c;a++){let d=i[a],g=t[d];if(x2(g))typeof g>"u"?delete o[d]:o[d]=g;else{let h=o[d],S=g;if(yEe(e,d,r)||yEe(t,d,r))delete o[d];else{if(iB(h)&&iB(S)){let y=r.get(h)||[],C=r.get(S)||[];y.push({obj:e,key:d}),C.push({obj:t,key:d}),r.set(h,y),r.set(S,C)}o[d]=TEe(o[d],g,n,r)}}}}else o=t;return o}}function yEe(e,t,n){let r=n.get(e[t])||[];for(let o=0,i=r.length;o<i;o++){let a=r[o];if(a.key===t&&a.obj===e)return!0}return!1}function D2(e){return Array.isArray(e)}function IEe(e){return typeof e=="function"}function iB(e){return!x2(e)&&!D2(e)&&!IEe(e)&&typeof e=="object"}function x2(e){return typeof e=="string"||typeof e=="number"||typeof e=="boolean"||typeof e>"u"||e instanceof Date||e instanceof RegExp||e===null}function git(e,t){return!(!(0,SEe.isPlainObject)(e)||!(0,SEe.isPlainObject)(t))}});var bEe=F(YC=>{"use strict";m();Object.defineProperty(YC,"__esModule",{value:!0});YC.callWithTimeout=YC.TimeoutError=void 0;var N2=class e extends Error{constructor(t){super(t),Object.setPrototypeOf(this,e.prototype)}};YC.TimeoutError=N2;function hit(e,t){let n,r=new Promise(function(i,a){n=setTimeout(function(){a(new N2("Operation timed out."))},t)});return Promise.race([e,r]).then(o=>(clearTimeout(n),o),o=>{throw clearTimeout(n),o})}YC.callWithTimeout=hit});var REe=F(KC=>{"use strict";m();Object.defineProperty(KC,"__esModule",{value:!0});KC.isUrlIgnored=KC.urlMatches=void 0;function vEe(e,t){return typeof t=="string"?e===t:!!e.match(t)}KC.urlMatches=vEe;function _it(e,t){if(!t)return!1;for(let n of t)if(vEe(e,n))return!0;return!1}KC.isUrlIgnored=_it});var xEe=F(O2=>{"use strict";m();Object.defineProperty(O2,"__esModule",{value:!0});O2.Deferred=void 0;var M5=class{_promise;_resolve;_reject;constructor(){this._promise=new Promise((t,n)=>{this._resolve=t,this._reject=n})}get promise(){return this._promise}resolve(t){this._resolve(t)}reject(t){this._reject(t)}};O2.Deferred=M5});var DEe=F(w2=>{"use strict";m();Object.defineProperty(w2,"__esModule",{value:!0});w2.BindOnceFuture=void 0;var Eit=xEe(),P5=class{_isCalled=!1;_deferred=new Eit.Deferred;_callback;_that;constructor(t,n){this._callback=t,this._that=n}get isCalled(){return this._isCalled}get promise(){return this._deferred.promise}call(...t){if(!this._isCalled){this._isCalled=!0;try{Promise.resolve(this._callback.call(this._that,...t)).then(n=>this._deferred.resolve(n),n=>this._deferred.reject(n))}catch(n){this._deferred.reject(n)}}return this._deferred.promise}};w2.BindOnceFuture=P5});var NEe=F(k2=>{"use strict";m();Object.defineProperty(k2,"__esModule",{value:!0});k2.diagLogLevelFromString=void 0;var rg=(je(),Me(We)),BEe={ALL:rg.DiagLogLevel.ALL,VERBOSE:rg.DiagLogLevel.VERBOSE,DEBUG:rg.DiagLogLevel.DEBUG,INFO:rg.DiagLogLevel.INFO,WARN:rg.DiagLogLevel.WARN,ERROR:rg.DiagLogLevel.ERROR,NONE:rg.DiagLogLevel.NONE};function Sit(e){if(e==null)return;let t=BEe[e.toUpperCase()];return t??(rg.diag.warn(`Unknown log level "${e}", expected one of ${Object.keys(BEe)}, using default`),rg.DiagLogLevel.INFO)}k2.diagLogLevelFromString=Sit});var wEe=F(M2=>{"use strict";m();Object.defineProperty(M2,"__esModule",{value:!0});M2._export=void 0;var OEe=(je(),Me(We)),yit=tB();function Tit(e,t){return new Promise(n=>{OEe.context.with((0,yit.suppressTracing)(OEe.context.active()),()=>{e.export(t,n)})})}M2._export=Tit});var Tr=F(Oe=>{"use strict";m();Object.defineProperty(Oe,"__esModule",{value:!0});Oe.internal=Oe.diagLogLevelFromString=Oe.BindOnceFuture=Oe.urlMatches=Oe.isUrlIgnored=Oe.callWithTimeout=Oe.TimeoutError=Oe.merge=Oe.TraceState=Oe.unsuppressTracing=Oe.suppressTracing=Oe.isTracingSuppressed=Oe.setRPCMetadata=Oe.getRPCMetadata=Oe.deleteRPCMetadata=Oe.RPCType=Oe.parseTraceParent=Oe.W3CTraceContextPropagator=Oe.TRACE_STATE_HEADER=Oe.TRACE_PARENT_HEADER=Oe.CompositePropagator=Oe.otperformance=Oe.getStringListFromEnv=Oe.getNumberFromEnv=Oe.getBooleanFromEnv=Oe.getStringFromEnv=Oe._globalThis=Oe.SDK_INFO=Oe.parseKeyPairsIntoRecord=Oe.ExportResultCode=Oe.unrefTimer=Oe.timeInputToHrTime=Oe.millisToHrTime=Oe.isTimeInputHrTime=Oe.isTimeInput=Oe.hrTimeToTimeStamp=Oe.hrTimeToNanoseconds=Oe.hrTimeToMilliseconds=Oe.hrTimeToMicroseconds=Oe.hrTimeDuration=Oe.hrTime=Oe.getTimeOrigin=Oe.addHrTimes=Oe.loggingErrorHandler=Oe.setGlobalErrorHandler=Oe.globalErrorHandler=Oe.sanitizeAttributes=Oe.isAttributeValue=Oe.AnchoredClock=Oe.W3CBaggagePropagator=void 0;var Iit=mde();Object.defineProperty(Oe,"W3CBaggagePropagator",{enumerable:!0,get:function(){return Iit.W3CBaggagePropagator}});var Cit=gde();Object.defineProperty(Oe,"AnchoredClock",{enumerable:!0,get:function(){return Cit.AnchoredClock}});var kEe=yde();Object.defineProperty(Oe,"isAttributeValue",{enumerable:!0,get:function(){return kEe.isAttributeValue}});Object.defineProperty(Oe,"sanitizeAttributes",{enumerable:!0,get:function(){return kEe.sanitizeAttributes}});var MEe=Ide();Object.defineProperty(Oe,"globalErrorHandler",{enumerable:!0,get:function(){return MEe.globalErrorHandler}});Object.defineProperty(Oe,"setGlobalErrorHandler",{enumerable:!0,get:function(){return MEe.setGlobalErrorHandler}});var bit=J$();Object.defineProperty(Oe,"loggingErrorHandler",{enumerable:!0,get:function(){return bit.loggingErrorHandler}});var Dd=nEe();Object.defineProperty(Oe,"addHrTimes",{enumerable:!0,get:function(){return Dd.addHrTimes}});Object.defineProperty(Oe,"getTimeOrigin",{enumerable:!0,get:function(){return Dd.getTimeOrigin}});Object.defineProperty(Oe,"hrTime",{enumerable:!0,get:function(){return Dd.hrTime}});Object.defineProperty(Oe,"hrTimeDuration",{enumerable:!0,get:function(){return Dd.hrTimeDuration}});Object.defineProperty(Oe,"hrTimeToMicroseconds",{enumerable:!0,get:function(){return Dd.hrTimeToMicroseconds}});Object.defineProperty(Oe,"hrTimeToMilliseconds",{enumerable:!0,get:function(){return Dd.hrTimeToMilliseconds}});Object.defineProperty(Oe,"hrTimeToNanoseconds",{enumerable:!0,get:function(){return Dd.hrTimeToNanoseconds}});Object.defineProperty(Oe,"hrTimeToTimeStamp",{enumerable:!0,get:function(){return Dd.hrTimeToTimeStamp}});Object.defineProperty(Oe,"isTimeInput",{enumerable:!0,get:function(){return Dd.isTimeInput}});Object.defineProperty(Oe,"isTimeInputHrTime",{enumerable:!0,get:function(){return Dd.isTimeInputHrTime}});Object.defineProperty(Oe,"millisToHrTime",{enumerable:!0,get:function(){return Dd.millisToHrTime}});Object.defineProperty(Oe,"timeInputToHrTime",{enumerable:!0,get:function(){return Dd.timeInputToHrTime}});var vit=rEe();Object.defineProperty(Oe,"unrefTimer",{enumerable:!0,get:function(){return vit.unrefTimer}});var Rit=oEe();Object.defineProperty(Oe,"ExportResultCode",{enumerable:!0,get:function(){return Rit.ExportResultCode}});var xit=$$();Object.defineProperty(Oe,"parseKeyPairsIntoRecord",{enumerable:!0,get:function(){return xit.parseKeyPairsIntoRecord}});var wS=v5();Object.defineProperty(Oe,"SDK_INFO",{enumerable:!0,get:function(){return wS.SDK_INFO}});Object.defineProperty(Oe,"_globalThis",{enumerable:!0,get:function(){return wS._globalThis}});Object.defineProperty(Oe,"getStringFromEnv",{enumerable:!0,get:function(){return wS.getStringFromEnv}});Object.defineProperty(Oe,"getBooleanFromEnv",{enumerable:!0,get:function(){return wS.getBooleanFromEnv}});Object.defineProperty(Oe,"getNumberFromEnv",{enumerable:!0,get:function(){return wS.getNumberFromEnv}});Object.defineProperty(Oe,"getStringListFromEnv",{enumerable:!0,get:function(){return wS.getStringListFromEnv}});Object.defineProperty(Oe,"otperformance",{enumerable:!0,get:function(){return wS.otperformance}});var Dit=aEe();Object.defineProperty(Oe,"CompositePropagator",{enumerable:!0,get:function(){return Dit.CompositePropagator}});var P2=fEe();Object.defineProperty(Oe,"TRACE_PARENT_HEADER",{enumerable:!0,get:function(){return P2.TRACE_PARENT_HEADER}});Object.defineProperty(Oe,"TRACE_STATE_HEADER",{enumerable:!0,get:function(){return P2.TRACE_STATE_HEADER}});Object.defineProperty(Oe,"W3CTraceContextPropagator",{enumerable:!0,get:function(){return P2.W3CTraceContextPropagator}});Object.defineProperty(Oe,"parseTraceParent",{enumerable:!0,get:function(){return P2.parseTraceParent}});var U2=AEe();Object.defineProperty(Oe,"RPCType",{enumerable:!0,get:function(){return U2.RPCType}});Object.defineProperty(Oe,"deleteRPCMetadata",{enumerable:!0,get:function(){return U2.deleteRPCMetadata}});Object.defineProperty(Oe,"getRPCMetadata",{enumerable:!0,get:function(){return U2.getRPCMetadata}});Object.defineProperty(Oe,"setRPCMetadata",{enumerable:!0,get:function(){return U2.setRPCMetadata}});var U5=tB();Object.defineProperty(Oe,"isTracingSuppressed",{enumerable:!0,get:function(){return U5.isTracingSuppressed}});Object.defineProperty(Oe,"suppressTracing",{enumerable:!0,get:function(){return U5.suppressTracing}});Object.defineProperty(Oe,"unsuppressTracing",{enumerable:!0,get:function(){return U5.unsuppressTracing}});var Bit=N5();Object.defineProperty(Oe,"TraceState",{enumerable:!0,get:function(){return Bit.TraceState}});var Nit=CEe();Object.defineProperty(Oe,"merge",{enumerable:!0,get:function(){return Nit.merge}});var PEe=bEe();Object.defineProperty(Oe,"TimeoutError",{enumerable:!0,get:function(){return PEe.TimeoutError}});Object.defineProperty(Oe,"callWithTimeout",{enumerable:!0,get:function(){return PEe.callWithTimeout}});var UEe=REe();Object.defineProperty(Oe,"isUrlIgnored",{enumerable:!0,get:function(){return UEe.isUrlIgnored}});Object.defineProperty(Oe,"urlMatches",{enumerable:!0,get:function(){return UEe.urlMatches}});var Oit=DEe();Object.defineProperty(Oe,"BindOnceFuture",{enumerable:!0,get:function(){return Oit.BindOnceFuture}});var wit=NEe();Object.defineProperty(Oe,"diagLogLevelFromString",{enumerable:!0,get:function(){return wit.diagLogLevelFromString}});var kit=wEe();Oe.internal={_export:kit._export}});var LEe=F(L2=>{"use strict";m();Object.defineProperty(L2,"__esModule",{value:!0});L2.VERSION=void 0;L2.VERSION="0.214.0"});var QEe=F(aB=>{"use strict";m();Object.defineProperty(aB,"__esModule",{value:!0});aB.SeverityNumber=void 0;var Mit;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Mit=aB.SeverityNumber||(aB.SeverityNumber={}))});var F2=F(JC=>{"use strict";m();Object.defineProperty(JC,"__esModule",{value:!0});JC.NOOP_LOGGER=JC.NoopLogger=void 0;var Q2=class{emit(t){}};JC.NoopLogger=Q2;JC.NOOP_LOGGER=new Q2});var FEe=F(dA=>{"use strict";m();Object.defineProperty(dA,"__esModule",{value:!0});dA.API_BACKWARDS_COMPATIBILITY_VERSION=dA.makeGetter=dA._global=dA.GLOBAL_LOGS_API_KEY=void 0;dA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");dA._global=globalThis;function Pit(e,t,n){return r=>r===e?t:n}dA.makeGetter=Pit;dA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var L5=F(ZC=>{"use strict";m();Object.defineProperty(ZC,"__esModule",{value:!0});ZC.NOOP_LOGGER_PROVIDER=ZC.NoopLoggerProvider=void 0;var Uit=F2(),G2=class{getLogger(t,n,r){return new Uit.NoopLogger}};ZC.NoopLoggerProvider=G2;ZC.NOOP_LOGGER_PROVIDER=new G2});var GEe=F(j2=>{"use strict";m();Object.defineProperty(j2,"__esModule",{value:!0});j2.ProxyLogger=void 0;var Lit=F2(),Q5=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Lit.NOOP_LOGGER}};j2.ProxyLogger=Q5});var jEe=F(H2=>{"use strict";m();Object.defineProperty(H2,"__esModule",{value:!0});H2.ProxyLoggerProvider=void 0;var Qit=L5(),Fit=GEe(),F5=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Fit.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Qit.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};H2.ProxyLoggerProvider=F5});var zEe=F(z2=>{"use strict";m();Object.defineProperty(z2,"__esModule",{value:!0});z2.LogsAPI=void 0;var Bd=FEe(),Git=L5(),HEe=jEe(),G5=class e{constructor(){this._proxyLoggerProvider=new HEe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Bd._global[Bd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Bd._global[Bd.GLOBAL_LOGS_API_KEY]=(0,Bd.makeGetter)(Bd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Git.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Bd._global[Bd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Bd._global,Bd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Bd._global[Bd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new HEe.ProxyLoggerProvider}};z2.LogsAPI=G5});var j5=F(pA=>{"use strict";m();Object.defineProperty(pA,"__esModule",{value:!0});pA.logs=pA.NoopLogger=pA.NOOP_LOGGER=pA.SeverityNumber=void 0;var jit=QEe();Object.defineProperty(pA,"SeverityNumber",{enumerable:!0,get:function(){return jit.SeverityNumber}});var $Ee=F2();Object.defineProperty(pA,"NOOP_LOGGER",{enumerable:!0,get:function(){return $Ee.NOOP_LOGGER}});Object.defineProperty(pA,"NoopLogger",{enumerable:!0,get:function(){return $Ee.NoopLogger}});var Hit=zEe();pA.logs=Hit.LogsAPI.getInstance()});var VEe=F(WC=>{"use strict";m();Object.defineProperty(WC,"__esModule",{value:!0});WC.disableInstrumentations=WC.enableInstrumentations=void 0;function zit(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}WC.enableInstrumentations=zit;function $it(e){e.forEach(t=>t.disable())}WC.disableInstrumentations=$it});var KEe=F($2=>{"use strict";m();Object.defineProperty($2,"__esModule",{value:!0});$2.registerInstrumentations=void 0;var qEe=(je(),Me(We)),Vit=j5(),YEe=VEe();function qit(e){let t=e.tracerProvider||qEe.trace.getTracerProvider(),n=e.meterProvider||qEe.metrics.getMeterProvider(),r=e.loggerProvider||Vit.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,YEe.enableInstrumentations)(o,t,n,r),()=>{(0,YEe.disableInstrumentations)(o)}}$2.registerInstrumentations=qit});var o0e=F(V2=>{"use strict";m();Object.defineProperty(V2,"__esModule",{value:!0});V2.satisfies=void 0;var V5=(je(),Me(We)),e0e=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Yit=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Kit={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function Jit(e,t,n){if(!Zit(e))return V5.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=tat(e);if(!r)return!1;let o=[],i=t0e(r,t,o,n);return i&&!n?.includePrerelease?Xit(r,o):i}V2.satisfies=Jit;function Zit(e){return typeof e=="string"&&e0e.test(e)}function t0e(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(H5(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=Tat(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!H5(e,i,n,r))return!1;return!0}return H5(e,t,n,r)}function H5(e,t,n,r){if(t=eat(t,r),t.includes(" "))return t0e(e,t,n,r);{let o=nat(t);return n.push(o),Wit(e,o)}}function Wit(e,t){if(t.invalid)return!1;if(!t.version||$5(t.version))return!0;let n=ZEe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=ZEe(r,o)}return Kit[t.op]?.includes(n)}function Xit(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function eat(e,t){return e=e.trim(),e=Sat(e,t),e=Eat(e),e=yat(e,t),e=e.trim(),e}function wu(e){return!e||e.toLowerCase()==="x"||e==="*"}function tat(e){let t=e.match(e0e);if(!t){V5.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function nat(e){if(!e)return{};let t=e.match(Yit);if(!t)return V5.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function $5(e){return e==="*"||e==="x"||e==="X"}function JEe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function rat(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function oat(e,t){if($5(e)||$5(t))return 0;let[n,r]=rat(JEe(e),JEe(t));return n>r?1:n<r?-1:0}function ZEe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=oat(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var n0e="[a-zA-Z0-9-]",r0e="0|[1-9]\\d*",iat=`\\d*[a-zA-Z-]${n0e}*`,aat="((?:<|>)?=?)",WEe=`(?:${r0e}|${iat})`,sat=`(?:-(${WEe}(?:\\.${WEe})*))`,XEe=`${n0e}+`,uat=`(?:\\+(${XEe}(?:\\.${XEe})*))`,z5=`${r0e}|x|X|\\*`,sB=`[v=\\s]*(${z5})(?:\\.(${z5})(?:\\.(${z5})(?:${sat})?${uat}?)?)?`,cat=`^${aat}\\s*${sB}$`,lat=new RegExp(cat),dat=`^\\s*(${sB})\\s+-\\s+(${sB})\\s*$`,pat=new RegExp(dat),fat="(?:~>?)",Aat=`^${fat}${sB}$`,mat=new RegExp(Aat),gat="(?:\\^)",hat=`^${gat}${sB}$`,_at=new RegExp(hat);function Eat(e){let t=mat;return e.replace(t,(n,r,o,i,a)=>{let c;return wu(r)?c="":wu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:wu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function Sat(e,t){let n=_at,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let g;return wu(i)?g="":wu(a)?g=`>=${i}.0.0${r} <${+i+1}.0.0-0`:wu(c)?i==="0"?g=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?g=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?g=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,g})}function yat(e,t){let n=lat;return e.replace(n,(r,o,i,a,c,d)=>{let g=wu(i),h=g||wu(a),S=h||wu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",g?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function Tat(e,t){let n=pat;return e.replace(n,(r,o,i,a,c,d,g,h,S,y,C,v)=>(wu(i)?o="":wu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:wu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,wu(S)?h="":wu(y)?h=`<${+S+1}.0.0-0`:wu(C)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${C}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+C+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var q5=F(Ts=>{"use strict";m();Object.defineProperty(Ts,"__esModule",{value:!0});Ts.massUnwrap=Ts.unwrap=Ts.massWrap=Ts.wrap=void 0;var ku=console.error.bind(console);function uB(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var Iat=(e,t,n)=>{if(!e||!e[t]){ku("no original function "+String(t)+" to wrap");return}if(!n){ku("no wrapper function"),ku(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ku("original object and wrapper must be functions");return}let o=n(r,t);return uB(o,"__original",r),uB(o,"__unwrap",()=>{e[t]===o&&uB(e,t,r)}),uB(o,"__wrapped",!0),uB(e,t,o),o};Ts.wrap=Iat;var Cat=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ku("must provide one or more modules to patch"),ku(new Error().stack);return}if(!(t&&Array.isArray(t))){ku("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Ts.wrap)(r,o,n)})})};Ts.massWrap=Cat;var bat=(e,t)=>{if(!e||!e[t]){ku("no function to unwrap."),ku(new Error().stack);return}let n=e[t];if(!n.__unwrap)ku("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Ts.unwrap=bat;var vat=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ku("must provide one or more modules to patch"),ku(new Error().stack);return}if(!(t&&Array.isArray(t))){ku("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Ts.unwrap)(n,r)})})};Ts.massUnwrap=vat;function cB(e){e&&e.logger&&(typeof e.logger!="function"?ku("new logger isn't a function, not replacing"):ku=e.logger)}Ts.default=cB;cB.wrap=Ts.wrap;cB.massWrap=Ts.massWrap;cB.unwrap=Ts.unwrap;cB.massUnwrap=Ts.massUnwrap});var i0e=F(Y2=>{"use strict";m();Object.defineProperty(Y2,"__esModule",{value:!0});Y2.InstrumentationAbstract=void 0;var Y5=(je(),Me(We)),Rat=j5(),q2=q5(),K5=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=Y5.diag.createComponentLogger({namespace:t}),this._tracer=Y5.trace.getTracer(t,n),this._meter=Y5.metrics.getMeter(t,n),this._logger=Rat.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=q2.wrap;_unwrap=q2.unwrap;_massWrap=q2.massWrap;_massUnwrap=q2.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};Y2.InstrumentationAbstract=K5});var s0e=F((p7t,a0e)=>{m();var XC=1e3,eb=XC*60,tb=eb*60,kS=tb*24,xat=kS*7,Dat=kS*365.25;a0e.exports=function(e,t){t=t||{};var n=typeof e;if(n==="string"&&e.length>0)return Bat(e);if(n==="number"&&isFinite(e))return t.long?Oat(e):Nat(e);throw new Error("val is not a non-empty string or a valid number. val="+JSON.stringify(e))};function Bat(e){if(e=String(e),!(e.length>100)){var t=/^(-?(?:\d+)?\.?\d+) *(milliseconds?|msecs?|ms|seconds?|secs?|s|minutes?|mins?|m|hours?|hrs?|h|days?|d|weeks?|w|years?|yrs?|y)?$/i.exec(e);if(t){var n=parseFloat(t[1]),r=(t[2]||"ms").toLowerCase();switch(r){case"years":case"year":case"yrs":case"yr":case"y":return n*Dat;case"weeks":case"week":case"w":return n*xat;case"days":case"day":case"d":return n*kS;case"hours":case"hour":case"hrs":case"hr":case"h":return n*tb;case"minutes":case"minute":case"mins":case"min":case"m":return n*eb;case"seconds":case"second":case"secs":case"sec":case"s":return n*XC;case"milliseconds":case"millisecond":case"msecs":case"msec":case"ms":return n;default:return}}}}function Nat(e){var t=Math.abs(e);return t>=kS?Math.round(e/kS)+"d":t>=tb?Math.round(e/tb)+"h":t>=eb?Math.round(e/eb)+"m":t>=XC?Math.round(e/XC)+"s":e+"ms"}function Oat(e){var t=Math.abs(e);return t>=kS?K2(e,t,kS,"day"):t>=tb?K2(e,t,tb,"hour"):t>=eb?K2(e,t,eb,"minute"):t>=XC?K2(e,t,XC,"second"):e+" ms"}function K2(e,t,n,r){var o=t>=n*1.5;return Math.round(e/n)+" "+r+(o?"s":"")}});var J5=F((A7t,u0e)=>{m();function wat(e){n.debug=n,n.default=n,n.coerce=d,n.disable=a,n.enable=o,n.enabled=c,n.humanize=s0e(),n.destroy=g,Object.keys(e).forEach(h=>{n[h]=e[h]}),n.names=[],n.skips=[],n.formatters={};function t(h){let S=0;for(let y=0;y<h.length;y++)S=(S<<5)-S+h.charCodeAt(y),S|=0;return n.colors[Math.abs(S)%n.colors.length]}n.selectColor=t;function n(h){let S,y=null,C,v;function x(...N){if(!x.enabled)return;let k=x,Q=Number(new Date),j=Q-(S||Q);k.diff=j,k.prev=S,k.curr=Q,S=Q,N[0]=n.coerce(N[0]),typeof N[0]!="string"&&N.unshift("%O");let G=0;N[0]=N[0].replace(/%([a-zA-Z%])/g,(oe,ge)=>{if(oe==="%%")return"%";G++;let ye=n.formatters[ge];if(typeof ye=="function"){let be=N[G];oe=ye.call(k,be),N.splice(G,1),G--}return oe}),n.formatArgs.call(k,N),(k.log||n.log).apply(k,N)}return x.namespace=h,x.useColors=n.useColors(),x.color=n.selectColor(h),x.extend=r,x.destroy=n.destroy,Object.defineProperty(x,"enabled",{enumerable:!0,configurable:!1,get:()=>y!==null?y:(C!==n.namespaces&&(C=n.namespaces,v=n.enabled(h)),v),set:N=>{y=N}}),typeof n.init=="function"&&n.init(x),x}function r(h,S){let y=n(this.namespace+(typeof S>"u"?":":S)+h);return y.log=this.log,y}function o(h){n.save(h),n.namespaces=h,n.names=[],n.skips=[];let S=(typeof h=="string"?h:"").trim().replace(/\s+/g,",").split(",").filter(Boolean);for(let y of S)y[0]==="-"?n.skips.push(y.slice(1)):n.names.push(y)}function i(h,S){let y=0,C=0,v=-1,x=0;for(;y<h.length;)if(C<S.length&&(S[C]===h[y]||S[C]==="*"))S[C]==="*"?(v=C,x=y,C++):(y++,C++);else if(v!==-1)C=v+1,x++,y=x;else return!1;for(;C<S.length&&S[C]==="*";)C++;return C===S.length}function a(){let h=[...n.names,...n.skips.map(S=>"-"+S)].join(",");return n.enable(""),h}function c(h){for(let S of n.skips)if(i(h,S))return!1;for(let S of n.names)if(i(h,S))return!0;return!1}function d(h){return h instanceof Error?h.stack||h.message:h}function g(){console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.")}return n.enable(n.load()),n}u0e.exports=wat});var c0e=F((xc,J2)=>{m();xc.formatArgs=Mat;xc.save=Pat;xc.load=Uat;xc.useColors=kat;xc.storage=Lat();xc.destroy=(()=>{let e=!1;return()=>{e||(e=!0,console.warn("Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`."))}})();xc.colors=["#0000CC","#0000FF","#0033CC","#0033FF","#0066CC","#0066FF","#0099CC","#0099FF","#00CC00","#00CC33","#00CC66","#00CC99","#00CCCC","#00CCFF","#3300CC","#3300FF","#3333CC","#3333FF","#3366CC","#3366FF","#3399CC","#3399FF","#33CC00","#33CC33","#33CC66","#33CC99","#33CCCC","#33CCFF","#6600CC","#6600FF","#6633CC","#6633FF","#66CC00","#66CC33","#9900CC","#9900FF","#9933CC","#9933FF","#99CC00","#99CC33","#CC0000","#CC0033","#CC0066","#CC0099","#CC00CC","#CC00FF","#CC3300","#CC3333","#CC3366","#CC3399","#CC33CC","#CC33FF","#CC6600","#CC6633","#CC9900","#CC9933","#CCCC00","#CCCC33","#FF0000","#FF0033","#FF0066","#FF0099","#FF00CC","#FF00FF","#FF3300","#FF3333","#FF3366","#FF3399","#FF33CC","#FF33FF","#FF6600","#FF6633","#FF9900","#FF9933","#FFCC00","#FFCC33"];function kat(){if(typeof window<"u"&&window.process&&(window.process.type==="renderer"||window.process.__nwjs))return!0;if(typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/(edge|trident)\/(\d+)/))return!1;let e;return typeof document<"u"&&document.documentElement&&document.documentElement.style&&document.documentElement.style.WebkitAppearance||typeof window<"u"&&window.console&&(window.console.firebug||window.console.exception&&window.console.table)||typeof navigator<"u"&&navigator.userAgent&&(e=navigator.userAgent.toLowerCase().match(/firefox\/(\d+)/))&&parseInt(e[1],10)>=31||typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().match(/applewebkit\/(\d+)/)}function Mat(e){if(e[0]=(this.useColors?"%c":"")+this.namespace+(this.useColors?" %c":" ")+e[0]+(this.useColors?"%c ":" ")+"+"+J2.exports.humanize(this.diff),!this.useColors)return;let t="color: "+this.color;e.splice(1,0,t,"color: inherit");let n=0,r=0;e[0].replace(/%[a-zA-Z%]/g,o=>{o!=="%%"&&(n++,o==="%c"&&(r=n))}),e.splice(r,0,t)}xc.log=console.debug||console.log||(()=>{});function Pat(e){try{e?xc.storage.setItem("debug",e):xc.storage.removeItem("debug")}catch{}}function Uat(){let e;try{e=xc.storage.getItem("debug")||xc.storage.getItem("DEBUG")}catch{}return!e&&typeof process<"u"&&"env"in process&&(e=process.env.DEBUG),e}function Lat(){try{return localStorage}catch{}}J2.exports=J5()(xc);var{formatters:Qat}=J2.exports;Qat.j=function(e){try{return JSON.stringify(e)}catch(t){return"[UnexpectedJSONParseError]: "+t.message}}});var d0e=F((h7t,l0e)=>{"use strict";m();l0e.exports=(e,t=process.argv)=>{let n=e.startsWith("-")?"":e.length===1?"-":"--",r=t.indexOf(n+e),o=t.indexOf("--");return r!==-1&&(o===-1||r<o)}});var A0e=F((E7t,f0e)=>{"use strict";m();var Fat=Ge("os"),p0e=Ge("tty"),Nd=d0e(),{env:Va}=process,e_;Nd("no-color")||Nd("no-colors")||Nd("color=false")||Nd("color=never")?e_=0:(Nd("color")||Nd("colors")||Nd("color=true")||Nd("color=always"))&&(e_=1);"FORCE_COLOR"in Va&&(Va.FORCE_COLOR==="true"?e_=1:Va.FORCE_COLOR==="false"?e_=0:e_=Va.FORCE_COLOR.length===0?1:Math.min(parseInt(Va.FORCE_COLOR,10),3));function Z5(e){return e===0?!1:{level:e,hasBasic:!0,has256:e>=2,has16m:e>=3}}function W5(e,t){if(e_===0)return 0;if(Nd("color=16m")||Nd("color=full")||Nd("color=truecolor"))return 3;if(Nd("color=256"))return 2;if(e&&!t&&e_===void 0)return 0;let n=e_||0;if(Va.TERM==="dumb")return n;if(process.platform==="win32"){let r=Fat.release().split(".");return Number(r[0])>=10&&Number(r[2])>=10586?Number(r[2])>=14931?3:2:1}if("CI"in Va)return["TRAVIS","CIRCLECI","APPVEYOR","GITLAB_CI","GITHUB_ACTIONS","BUILDKITE"].some(r=>r in Va)||Va.CI_NAME==="codeship"?1:n;if("TEAMCITY_VERSION"in Va)return/^(9\.(0*[1-9]\d*)\.|\d{2,}\.)/.test(Va.TEAMCITY_VERSION)?1:0;if(Va.COLORTERM==="truecolor")return 3;if("TERM_PROGRAM"in Va){let r=parseInt((Va.TERM_PROGRAM_VERSION||"").split(".")[0],10);switch(Va.TERM_PROGRAM){case"iTerm.app":return r>=3?3:2;case"Apple_Terminal":return 2}}return/-256(color)?$/i.test(Va.TERM)?2:/^screen|^xterm|^vt100|^vt220|^rxvt|color|ansi|cygwin|linux/i.test(Va.TERM)||"COLORTERM"in Va?1:n}function Gat(e){let t=W5(e,e&&e.isTTY);return Z5(t)}f0e.exports={supportsColor:Gat,stdout:Z5(W5(!0,p0e.isatty(1))),stderr:Z5(W5(!0,p0e.isatty(2)))}});var g0e=F((qa,W2)=>{m();var jat=Ge("tty"),Z2=Ge("util");qa.init=Kat;qa.log=Vat;qa.formatArgs=zat;qa.save=qat;qa.load=Yat;qa.useColors=Hat;qa.destroy=Z2.deprecate(()=>{},"Instance method `debug.destroy()` is deprecated and no longer does anything. It will be removed in the next major version of `debug`.");qa.colors=[6,2,3,4,5,1];try{let e=A0e();e&&(e.stderr||e).level>=2&&(qa.colors=[20,21,26,27,32,33,38,39,40,41,42,43,44,45,56,57,62,63,68,69,74,75,76,77,78,79,80,81,92,93,98,99,112,113,128,129,134,135,148,149,160,161,162,163,164,165,166,167,168,169,170,171,172,173,178,179,184,185,196,197,198,199,200,201,202,203,204,205,206,207,208,209,214,215,220,221])}catch{}qa.inspectOpts=Object.keys(process.env).filter(e=>/^debug_/i.test(e)).reduce((e,t)=>{let n=t.substring(6).toLowerCase().replace(/_([a-z])/g,(o,i)=>i.toUpperCase()),r=process.env[t];return/^(yes|on|true|enabled)$/i.test(r)?r=!0:/^(no|off|false|disabled)$/i.test(r)?r=!1:r==="null"?r=null:r=Number(r),e[n]=r,e},{});function Hat(){return"colors"in qa.inspectOpts?!!qa.inspectOpts.colors:jat.isatty(process.stderr.fd)}function zat(e){let{namespace:t,useColors:n}=this;if(n){let r=this.color,o="\x1B[3"+(r<8?r:"8;5;"+r),i=` ${o};1m${t} \x1B[0m`;e[0]=i+e[0].split(`
4
4
  `).join(`
5
5
  `+i),e.push(o+"m+"+W2.exports.humanize(this.diff)+"\x1B[0m")}else e[0]=$at()+t+" "+e[0]}function $at(){return qa.inspectOpts.hideDate?"":new Date().toISOString()+" "}function Vat(...e){return process.stderr.write(Z2.formatWithOptions(qa.inspectOpts,...e)+`
6
6
  `)}function qat(e){e?process.env.DEBUG=e:delete process.env.DEBUG}function Yat(){return process.env.DEBUG}function Kat(e){e.inspectOpts={};let t=Object.keys(qa.inspectOpts);for(let n=0;n<t.length;n++)e.inspectOpts[t[n]]=qa.inspectOpts[t[n]]}W2.exports=J5()(qa);var{formatters:m0e}=W2.exports;m0e.o=function(e){return this.inspectOpts.colors=this.useColors,Z2.inspect(e,this.inspectOpts).split(`
@@ -35,7 +35,7 @@ Url: ${cL(e)}`),!0}return!1}function dlt(e,t){return t?.length?oL(e).some(n=>l_(
35
35
  `);for(let o of r){if(!o)continue;let i=o.indexOf(":");if(i===-1)continue;let a=o.substring(0,i).toLowerCase(),c=o.substring(i+1).trim(),d=n.get(a);d&&Array.isArray(d)?d.push(c):d?n.set(a,[d,c]):n.set(a,c)}}return n}onRequestCreated({request:t}){let n=this.getConfig(),r=n.enabled!==!1;if((0,bN.safeExecuteInTheMiddle)(()=>!r||t.method==="CONNECT"||n.ignoreRequestHook?.(t),oe=>oe&&this._diag.error("caught ignoreRequestHook error: ",oe),!0))return;let i=(0,WQ.hrTime)(),a;try{a=new mht.URL(t.path,t.origin)}catch(oe){this._diag.warn("could not determine url.full:",oe);return}let c=a.protocol.replace(":",""),d=this.getRequestMethod(t.method),g={[Zi.ATTR_HTTP_REQUEST_METHOD]:d,[Zi.ATTR_HTTP_REQUEST_METHOD_ORIGINAL]:t.method,[Zi.ATTR_URL_FULL]:a.toString(),[Zi.ATTR_URL_PATH]:a.pathname,[Zi.ATTR_URL_QUERY]:a.search,[Zi.ATTR_URL_SCHEME]:c},h={https:"443",http:"80"},S=a.hostname,y=a.port||h[c];g[Zi.ATTR_SERVER_ADDRESS]=S,y&&!isNaN(Number(y))&&(g[Zi.ATTR_SERVER_PORT]=Number(y));let v=this.parseRequestHeaders(t).get("user-agent");if(v){let oe=Array.isArray(v)?v[v.length-1]:v;g[Zi.ATTR_USER_AGENT_ORIGINAL]=oe}let x=(0,bN.safeExecuteInTheMiddle)(()=>n.startSpanHook?.(t),oe=>oe&&this._diag.error("caught startSpanHook error: ",oe),!0);x&&Object.entries(x).forEach(([oe,ge])=>{g[oe]=ge});let N=Pl.context.active(),k=Pl.trace.getSpan(N),Q;n.requireParentforSpans&&(!k||!Pl.trace.isSpanContextValid(k.spanContext()))?Q=Pl.trace.wrapSpanContext(Pl.INVALID_SPAN_CONTEXT):Q=this.tracer.startSpan(d==="_OTHER"?"HTTP":d,{kind:Pl.SpanKind.CLIENT,attributes:g},N),(0,bN.safeExecuteInTheMiddle)(()=>n.requestHook?.(Q,t),oe=>oe&&this._diag.error("caught requestHook error: ",oe),!0);let j=Pl.trace.setSpan(Pl.context.active(),Q),G={};Pl.propagation.inject(j,G);let q=Object.entries(G);for(let oe=0;oe<q.length;oe++){let[ge,ye]=q[oe];typeof t.addHeader=="function"?t.addHeader(ge,ye):typeof t.headers=="string"?t.headers+=`${ge}: ${ye}\r
36
36
  `:Array.isArray(t.headers)&&t.headers.push(ge,ye)}this._recordFromReq.set(t,{span:Q,attributes:g,startTime:i})}onRequestHeaders({request:t,socket:n}){let r=this._recordFromReq.get(t);if(!r)return;let o=this.getConfig(),{span:i}=r,{remoteAddress:a,remotePort:c}=n,d={[Zi.ATTR_NETWORK_PEER_ADDRESS]:a,[Zi.ATTR_NETWORK_PEER_PORT]:c};if(o.headersToSpanAttributes?.requestHeaders){let g=new Set(o.headersToSpanAttributes.requestHeaders.map(S=>S.toLowerCase())),h=this.parseRequestHeaders(t);for(let[S,y]of h.entries())if(g.has(S)){let C=Array.isArray(y)?y:[y];d[`http.request.header.${S}`]=C}}i.setAttributes(d)}onResponseHeaders({request:t,response:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i}=r,a={[Zi.ATTR_HTTP_RESPONSE_STATUS_CODE]:n.statusCode},c=this.getConfig();if((0,bN.safeExecuteInTheMiddle)(()=>c.responseHook?.(o,{request:t,response:n}),d=>d&&this._diag.error("caught responseHook error: ",d),!0),c.headersToSpanAttributes?.responseHeaders){let d=new Set;c.headersToSpanAttributes?.responseHeaders.forEach(g=>d.add(g.toLowerCase()));for(let g=0;g<n.headers.length;g=g+2){let h=n.headers[g].toString().toLowerCase(),S=n.headers[g+1];if(d.has(h)){let y=`http.response.header.${h}`;Object.hasOwn(a,y)?a[y].push(S.toString()):a[y]=[S.toString()]}}}o.setAttributes(a),o.setStatus({code:n.statusCode>=400?Pl.SpanStatusCode.ERROR:Pl.SpanStatusCode.UNSET}),r.attributes=Object.assign(i,a)}onDone({request:t}){let n=this._recordFromReq.get(t);if(!n)return;let{span:r,attributes:o,startTime:i}=n;r.end(),this._recordFromReq.delete(t),this.recordRequestDuration(o,i)}onError({request:t,error:n}){let r=this._recordFromReq.get(t);if(!r)return;let{span:o,attributes:i,startTime:a}=r;o.recordException(n),o.setStatus({code:Pl.SpanStatusCode.ERROR,message:n.message}),o.end(),this._recordFromReq.delete(t),i[Zi.ATTR_ERROR_TYPE]=n.message,this.recordRequestDuration(i,a)}recordRequestDuration(t,n){let r={};[Zi.ATTR_HTTP_RESPONSE_STATUS_CODE,Zi.ATTR_HTTP_REQUEST_METHOD,Zi.ATTR_SERVER_ADDRESS,Zi.ATTR_SERVER_PORT,Zi.ATTR_URL_SCHEME,Zi.ATTR_ERROR_TYPE].forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,WQ.hrTimeToMilliseconds)((0,WQ.hrTimeDuration)(n,(0,WQ.hrTime)()))/1e3;this._httpClientDurationHistogram.record(i,r)}getRequestMethod(t){let n={CONNECT:!0,OPTIONS:!0,HEAD:!0,GET:!0,POST:!0,PUT:!0,PATCH:!0,DELETE:!0,TRACE:!0,QUERY:!0};return t.toUpperCase()in n?t.toUpperCase():"_OTHER"}};XQ.UndiciInstrumentation=OY});var _xe=F(e4=>{"use strict";m();Object.defineProperty(e4,"__esModule",{value:!0});e4.UndiciInstrumentation=void 0;var ght=hxe();Object.defineProperty(e4,"UndiciInstrumentation",{enumerable:!0,get:function(){return ght.UndiciInstrumentation}})});function Exe(e,t="/"){let n=`${e}`;return n.endsWith("/")&&t.startsWith("/")?`${n}${t.slice(1)}`:!n.endsWith("/")&&!t.startsWith("/")?`${n}/${t}`:`${n}${t}`}function Sht(e,t={}){return typeof e.spans=="boolean"?e.spans:!t.skipOpenTelemetrySetup&&xi(t)}function yht(e={}){return{requireParentforSpans:!1,ignoreRequestHook:n=>{let r=Exe(n.origin,n.path),o=e.ignoreOutgoingRequests;return!!(o&&r&&o(r))},startSpanHook:n=>{let r=Exe(n.origin,n.path);if(r.startsWith("data:")){let o=wb(r);return{[kt]:"auto.http.otel.node_fetch","http.url":o,[m_]:o,[Md]:`${n.method||"GET"} ${o}`}}return{[kt]:"auto.http.otel.node_fetch"}},requestHook:e.requestHook,responseHook:e.responseHook,headersToSpanAttributes:e.headersToSpanAttributes}}var Sxe,yxe,hht,_ht,Eht,Txe,Ixe=O(()=>{m();Sxe=ie(_xe(),1);dt();mr();yxe="NodeFetch",hht=st(yxe,Sxe.UndiciInstrumentation,e=>yht(e)),_ht=st(`${yxe}.sentry`,ry,e=>e),Eht=(e={})=>({name:"NodeFetch",setupOnce(){Sht(e,gt()?.getOptions())&&hht(e),_ht(e)}}),Txe=Eht});var t4=F(vN=>{"use strict";m();Object.defineProperty(vN,"__esModule",{value:!0});vN.ExpressLayerType=void 0;var Tht;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(Tht=vN.ExpressLayerType||(vN.ExpressLayerType={}))});var n4=F(RN=>{"use strict";m();Object.defineProperty(RN,"__esModule",{value:!0});RN.AttributeNames=void 0;var Iht;(function(e){e.EXPRESS_TYPE="express.type",e.EXPRESS_NAME="express.name"})(Iht=RN.AttributeNames||(RN.AttributeNames={}))});var wY=F(lv=>{"use strict";m();Object.defineProperty(lv,"__esModule",{value:!0});lv._LAYERS_STORE_PROPERTY=lv.kLayerPatched=void 0;lv.kLayerPatched=Symbol("express-layer-patched");lv._LAYERS_STORE_PROPERTY="__ot_middlewares"});var vxe=F(Wi=>{"use strict";m();Object.defineProperty(Wi,"__esModule",{value:!0});Wi.getActualMatchedRoute=Wi.getConstructedRoute=Wi.getLayerPath=Wi.asErrorAndMessage=Wi.isLayerIgnored=Wi.getLayerMetadata=Wi.getRouterPath=Wi.storeLayerPath=void 0;var kY=t4(),dv=n4(),cy=wY(),Cht=(e,t)=>(Array.isArray(e[cy._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,cy._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),t===void 0?{isLayerPathStored:!1}:(e[cy._LAYERS_STORE_PROPERTY].push(t),{isLayerPathStored:!0}));Wi.storeLayerPath=Cht;var bht=(e,t)=>{let n=t.handle?.stack?.[0];return n?.route?.path?`${e}${n.route.path}`:n?.handle?.stack?(0,Wi.getRouterPath)(e,n):e};Wi.getRouterPath=bht;var vht=(e,t,n)=>{if(t.name==="router"){let r=(0,Wi.getRouterPath)("",t),o=r||n||e||"/";return{attributes:{[dv.AttributeNames.EXPRESS_NAME]:o,[dv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.ROUTER},name:`router - ${o}`}}else return t.name==="bound dispatch"||t.name==="handle"?{attributes:{[dv.AttributeNames.EXPRESS_NAME]:(e||n)??"request handler",[dv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.REQUEST_HANDLER},name:`request handler${t.path?` - ${e||n}`:""}`}:{attributes:{[dv.AttributeNames.EXPRESS_NAME]:t.name,[dv.AttributeNames.EXPRESS_TYPE]:kY.ExpressLayerType.MIDDLEWARE},name:`middleware - ${t.name}`}};Wi.getLayerMetadata=vht;var Rht=(e,t)=>{if(typeof t=="string")return t===e;if(t instanceof RegExp)return t.test(e);if(typeof t=="function")return t(e);throw new TypeError("Pattern is in unsupported datatype")},xht=(e,t,n)=>{if(Array.isArray(n?.ignoreLayersType)&&n?.ignoreLayersType?.includes(t))return!0;if(Array.isArray(n?.ignoreLayers)===!1)return!1;try{for(let r of n.ignoreLayers)if(Rht(e,r))return!0}catch{}return!1};Wi.isLayerIgnored=xht;var Dht=e=>e instanceof Error?[e,e.message]:[String(e),String(e)];Wi.asErrorAndMessage=Dht;var Bht=e=>{let t=e[0];return Array.isArray(t)?t.map(n=>Cxe(n)||"").join(","):Cxe(t)};Wi.getLayerPath=Bht;var Cxe=e=>{if(typeof e=="string")return e;if(e instanceof RegExp||typeof e=="number")return e.toString()};function bxe(e){let n=(Array.isArray(e[cy._LAYERS_STORE_PROPERTY])?e[cy._LAYERS_STORE_PROPERTY]:[]).filter(r=>r!=="/"&&r!=="/*");return n.length===1&&n[0]==="*"?"*":n.join("").replace(/\/{2,}/g,"/")}Wi.getConstructedRoute=bxe;function Nht(e){let t=Array.isArray(e[cy._LAYERS_STORE_PROPERTY])?e[cy._LAYERS_STORE_PROPERTY]:[];if(t.length===0)return;if(t.every(i=>i==="/"))return e.originalUrl==="/"?"/":void 0;let n=bxe(e);if(n==="*"||n.includes("/")&&(n.includes(",")||n.includes("\\")||n.includes("*")||n.includes("[")))return n;let r=n.startsWith("/")?n:`/${n}`;return r.length>0&&(e.originalUrl===r||e.originalUrl.startsWith(r)||Oht(r))?r:void 0}Wi.getActualMatchedRoute=Nht;function Oht(e){return e.includes(":")||e.includes("*")}});var Rxe=F(pv=>{"use strict";m();Object.defineProperty(pv,"__esModule",{value:!0});pv.PACKAGE_NAME=pv.PACKAGE_VERSION=void 0;pv.PACKAGE_VERSION="0.62.0";pv.PACKAGE_NAME="@opentelemetry/instrumentation-express"});var Oxe=F(o4=>{"use strict";m();Object.defineProperty(o4,"__esModule",{value:!0});o4.ExpressInstrumentation=void 0;var xxe=Tr(),Mc=(je(),Me(We)),Dxe=t4(),Bxe=n4(),OA=vxe(),Nxe=Rxe(),fv=rn(),wht=(Zn(),Me(Ur)),r4=wY(),MY=class extends fv.InstrumentationBase{constructor(t={}){super(Nxe.PACKAGE_NAME,Nxe.PACKAGE_VERSION,t)}init(){return[new fv.InstrumentationNodeModuleDefinition("express",[">=4.0.0 <6"],t=>{let n=typeof t?.Router?.prototype?.route=="function",r=n?t.Router.prototype:t.Router;return(0,fv.isWrapped)(r.route)&&this._unwrap(r,"route"),this._wrap(r,"route",this._getRoutePatch()),(0,fv.isWrapped)(r.use)&&this._unwrap(r,"use"),this._wrap(r,"use",this._getRouterUsePatch()),(0,fv.isWrapped)(t.application.use)&&this._unwrap(t.application,"use"),this._wrap(t.application,"use",this._getAppUsePatch(n)),t},t=>{if(t===void 0)return;let r=typeof t?.Router?.prototype?.route=="function"?t.Router.prototype:t.Router;this._unwrap(r,"route"),this._unwrap(r,"use"),this._unwrap(t.application,"use")})]}_getRoutePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),a=this.stack[this.stack.length-1];return t._applyPatch(a,(0,OA.getLayerPath)(o)),i}}}_getRouterUsePatch(){let t=this;return function(n){return function(...o){let i=n.apply(this,o),a=this.stack[this.stack.length-1];return t._applyPatch(a,(0,OA.getLayerPath)(o)),i}}}_getAppUsePatch(t){let n=this;return function(r){return function(...i){let a=t?this.router:this._router,c=r.apply(this,i);if(a){let d=a.stack[a.stack.length-1];n._applyPatch(d,(0,OA.getLayerPath)(i))}return c}}}_applyPatch(t,n){let r=this;t[r4.kLayerPatched]!==!0&&(t[r4.kLayerPatched]=!0,this._wrap(t,"handle",o=>{if(o.length===4)return o;let i=function(a,c){let{isLayerPathStored:d}=(0,OA.storeLayerPath)(a,n),g=(0,OA.getConstructedRoute)(a),h=(0,OA.getActualMatchedRoute)(a),S={[wht.ATTR_HTTP_ROUTE]:h},y=(0,OA.getLayerMetadata)(g,t,n),C=y.attributes[Bxe.AttributeNames.EXPRESS_TYPE],v=(0,xxe.getRPCMetadata)(Mc.context.active());if(v?.type===xxe.RPCType.HTTP&&(v.route=h),(0,OA.isLayerIgnored)(y.name,C,r.getConfig()))return C===Dxe.ExpressLayerType.MIDDLEWARE&&a[r4._LAYERS_STORE_PROPERTY].pop(),o.apply(this,arguments);if(Mc.trace.getSpan(Mc.context.active())===void 0)return o.apply(this,arguments);let x=r._getSpanName({request:a,layerType:C,route:g},y.name),N=r.tracer.startSpan(x,{attributes:Object.assign(S,y.attributes)}),k=Mc.context.active(),Q=Mc.trace.setSpan(k,N),{requestHook:j}=r.getConfig();j&&(0,fv.safeExecuteInTheMiddle)(()=>j(N,{request:a,layerType:C,route:g}),ye=>{ye&&Mc.diag.error("express instrumentation: request hook failed",ye)},!0);let G=!1;y.attributes[Bxe.AttributeNames.EXPRESS_TYPE]===Dxe.ExpressLayerType.ROUTER&&(N.end(),G=!0,Q=k);let q=()=>{G===!1&&(G=!0,N.end())},oe=Array.from(arguments),ge=oe.findIndex(ye=>typeof ye=="function");ge>=0&&(arguments[ge]=function(){let ye=arguments[0],be=![void 0,null,"route","router"].includes(ye);if(!G&&be){let[dn,xe]=(0,OA.asErrorAndMessage)(ye);N.recordException(dn),N.setStatus({code:Mc.SpanStatusCode.ERROR,message:xe})}G===!1&&(G=!0,a.res?.removeListener("finish",q),N.end()),!(a.route&&be)&&d&&a[r4._LAYERS_STORE_PROPERTY].pop();let Xe=oe[ge],wt=Mc.context.active(),nt=Mc.trace.getSpan(k),$t=nt?Mc.trace.setSpan(wt,nt):wt;return Mc.context.bind($t,Xe).apply(this,arguments)});try{return Mc.context.bind(Q,o).apply(this,arguments)}catch(ye){let[be,Xe]=(0,OA.asErrorAndMessage)(ye);throw N.recordException(be),N.setStatus({code:Mc.SpanStatusCode.ERROR,message:Xe}),ye}finally{G||c.once("finish",q)}};for(let a in o)Object.defineProperty(i,a,{get(){return o[a]},set(c){o[a]=c}});return i}))}_getSpanName(t,n){let{spanNameHook:r}=this.getConfig();if(!(r instanceof Function))return n;try{return r(t,n)??n}catch(o){return Mc.diag.error("express instrumentation: error calling span name rewrite hook",o),n}}};o4.ExpressInstrumentation=MY});var wxe=F(U_=>{"use strict";m();Object.defineProperty(U_,"__esModule",{value:!0});U_.AttributeNames=U_.ExpressLayerType=U_.ExpressInstrumentation=void 0;var kht=Oxe();Object.defineProperty(U_,"ExpressInstrumentation",{enumerable:!0,get:function(){return kht.ExpressInstrumentation}});var Mht=t4();Object.defineProperty(U_,"ExpressLayerType",{enumerable:!0,get:function(){return Mht.ExpressLayerType}});var Pht=n4();Object.defineProperty(U_,"AttributeNames",{enumerable:!0,get:function(){return Pht.AttributeNames}})});var ya,ly=O(()=>{m();ya=typeof __SENTRY_DEBUG__>"u"||__SENTRY_DEBUG__});function Uht(e){Lr(e,"auto.http.otel.express");let t=Ot(e).data,n=t["express.type"];n&&e.setAttribute(Zt,`${n}.express`);let r=t["express.name"];typeof r=="string"&&e.updateName(r)}function Lht(e,t){if(Cn()===kd())return ya&&J.warn("Isolation scope is still default isolation scope - skipping setting transactionName"),t;if(e.layerType==="request_handler"){let n=e.request,r=n.method?n.method.toUpperCase():"GET";Cn().setTransactionName(`${r} ${e.route}`)}return t}var kxe,Mxe,Pxe,Qht,Uxe,Lxe=O(()=>{m();kxe=ie(wxe(),1);dt();mr();ly();Mxe="Express";Pxe=st(Mxe,()=>new kxe.ExpressInstrumentation({requestHook:e=>Uht(e),spanNameHook:(e,t)=>Lht(e,t)})),Qht=()=>({name:Mxe,setupOnce(){Pxe()}}),Uxe=Qht});var Qxe=F(xN=>{"use strict";m();Object.defineProperty(xN,"__esModule",{value:!0});xN.SeverityNumber=void 0;var Fht;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Fht=xN.SeverityNumber||(xN.SeverityNumber={}))});var s4=F(Av=>{"use strict";m();Object.defineProperty(Av,"__esModule",{value:!0});Av.NOOP_LOGGER=Av.NoopLogger=void 0;var a4=class{emit(t){}};Av.NoopLogger=a4;Av.NOOP_LOGGER=new a4});var Fxe=F(wA=>{"use strict";m();Object.defineProperty(wA,"__esModule",{value:!0});wA.API_BACKWARDS_COMPATIBILITY_VERSION=wA.makeGetter=wA._global=wA.GLOBAL_LOGS_API_KEY=void 0;wA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");wA._global=globalThis;function Ght(e,t,n){return r=>r===e?t:n}wA.makeGetter=Ght;wA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var PY=F(mv=>{"use strict";m();Object.defineProperty(mv,"__esModule",{value:!0});mv.NOOP_LOGGER_PROVIDER=mv.NoopLoggerProvider=void 0;var jht=s4(),u4=class{getLogger(t,n,r){return new jht.NoopLogger}};mv.NoopLoggerProvider=u4;mv.NOOP_LOGGER_PROVIDER=new u4});var Gxe=F(c4=>{"use strict";m();Object.defineProperty(c4,"__esModule",{value:!0});c4.ProxyLogger=void 0;var Hht=s4(),UY=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Hht.NOOP_LOGGER}};c4.ProxyLogger=UY});var jxe=F(l4=>{"use strict";m();Object.defineProperty(l4,"__esModule",{value:!0});l4.ProxyLoggerProvider=void 0;var zht=PY(),$ht=Gxe(),LY=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new $ht.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:zht.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};l4.ProxyLoggerProvider=LY});var zxe=F(d4=>{"use strict";m();Object.defineProperty(d4,"__esModule",{value:!0});d4.LogsAPI=void 0;var Gd=Fxe(),Vht=PY(),Hxe=jxe(),QY=class e{constructor(){this._proxyLoggerProvider=new Hxe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Gd._global[Gd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Gd._global[Gd.GLOBAL_LOGS_API_KEY]=(0,Gd.makeGetter)(Gd.API_BACKWARDS_COMPATIBILITY_VERSION,t,Vht.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Gd._global[Gd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Gd._global,Gd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Gd._global[Gd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new Hxe.ProxyLoggerProvider}};d4.LogsAPI=QY});var FY=F(kA=>{"use strict";m();Object.defineProperty(kA,"__esModule",{value:!0});kA.logs=kA.NoopLogger=kA.NOOP_LOGGER=kA.SeverityNumber=void 0;var qht=Qxe();Object.defineProperty(kA,"SeverityNumber",{enumerable:!0,get:function(){return qht.SeverityNumber}});var $xe=s4();Object.defineProperty(kA,"NOOP_LOGGER",{enumerable:!0,get:function(){return $xe.NOOP_LOGGER}});Object.defineProperty(kA,"NoopLogger",{enumerable:!0,get:function(){return $xe.NoopLogger}});var Yht=zxe();kA.logs=Yht.LogsAPI.getInstance()});var Vxe=F(gv=>{"use strict";m();Object.defineProperty(gv,"__esModule",{value:!0});gv.disableInstrumentations=gv.enableInstrumentations=void 0;function Kht(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}gv.enableInstrumentations=Kht;function Jht(e){e.forEach(t=>t.disable())}gv.disableInstrumentations=Jht});var Kxe=F(p4=>{"use strict";m();Object.defineProperty(p4,"__esModule",{value:!0});p4.registerInstrumentations=void 0;var qxe=(je(),Me(We)),Zht=FY(),Yxe=Vxe();function Wht(e){let t=e.tracerProvider||qxe.trace.getTracerProvider(),n=e.meterProvider||qxe.metrics.getMeterProvider(),r=e.loggerProvider||Zht.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,Yxe.enableInstrumentations)(o,t,n,r),()=>{(0,Yxe.disableInstrumentations)(o)}}p4.registerInstrumentations=Wht});var oDe=F(f4=>{"use strict";m();Object.defineProperty(f4,"__esModule",{value:!0});f4.satisfies=void 0;var zY=(je(),Me(We)),eDe=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,Xht=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,e_t={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function t_t(e,t,n){if(!n_t(e))return zY.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=a_t(e);if(!r)return!1;let o=[],i=tDe(r,t,o,n);return i&&!n?.includePrerelease?o_t(r,o):i}f4.satisfies=t_t;function n_t(e){return typeof e=="string"&&eDe.test(e)}function tDe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(GY(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=R_t(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!GY(e,i,n,r))return!1;return!0}return GY(e,t,n,r)}function GY(e,t,n,r){if(t=i_t(t,r),t.includes(" "))return tDe(e,t,n,r);{let o=s_t(t);return n.push(o),r_t(e,o)}}function r_t(e,t){if(t.invalid)return!1;if(!t.version||HY(t.version))return!0;let n=Zxe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=Zxe(r,o)}return e_t[t.op]?.includes(n)}function o_t(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function i_t(e,t){return e=e.trim(),e=b_t(e,t),e=C_t(e),e=v_t(e,t),e=e.trim(),e}function Gu(e){return!e||e.toLowerCase()==="x"||e==="*"}function a_t(e){let t=e.match(eDe);if(!t){zY.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function s_t(e){if(!e)return{};let t=e.match(Xht);if(!t)return zY.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function HY(e){return e==="*"||e==="x"||e==="X"}function Jxe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function u_t(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function c_t(e,t){if(HY(e)||HY(t))return 0;let[n,r]=u_t(Jxe(e),Jxe(t));return n>r?1:n<r?-1:0}function Zxe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=c_t(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var nDe="[a-zA-Z0-9-]",rDe="0|[1-9]\\d*",l_t=`\\d*[a-zA-Z-]${nDe}*`,d_t="((?:<|>)?=?)",Wxe=`(?:${rDe}|${l_t})`,p_t=`(?:-(${Wxe}(?:\\.${Wxe})*))`,Xxe=`${nDe}+`,f_t=`(?:\\+(${Xxe}(?:\\.${Xxe})*))`,jY=`${rDe}|x|X|\\*`,DN=`[v=\\s]*(${jY})(?:\\.(${jY})(?:\\.(${jY})(?:${p_t})?${f_t}?)?)?`,A_t=`^${d_t}\\s*${DN}$`,m_t=new RegExp(A_t),g_t=`^\\s*(${DN})\\s+-\\s+(${DN})\\s*$`,h_t=new RegExp(g_t),__t="(?:~>?)",E_t=`^${__t}${DN}$`,S_t=new RegExp(E_t),y_t="(?:\\^)",T_t=`^${y_t}${DN}$`,I_t=new RegExp(T_t);function C_t(e){let t=S_t;return e.replace(t,(n,r,o,i,a)=>{let c;return Gu(r)?c="":Gu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:Gu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function b_t(e,t){let n=I_t,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let g;return Gu(i)?g="":Gu(a)?g=`>=${i}.0.0${r} <${+i+1}.0.0-0`:Gu(c)?i==="0"?g=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?g=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?g=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,g})}function v_t(e,t){let n=m_t;return e.replace(n,(r,o,i,a,c,d)=>{let g=Gu(i),h=g||Gu(a),S=h||Gu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",g?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function R_t(e,t){let n=h_t;return e.replace(n,(r,o,i,a,c,d,g,h,S,y,C,v)=>(Gu(i)?o="":Gu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:Gu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,Gu(S)?h="":Gu(y)?h=`<${+S+1}.0.0-0`:Gu(C)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${C}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+C+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var $Y=F(Bs=>{"use strict";m();Object.defineProperty(Bs,"__esModule",{value:!0});Bs.massUnwrap=Bs.unwrap=Bs.massWrap=Bs.wrap=void 0;var ju=console.error.bind(console);function BN(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var x_t=(e,t,n)=>{if(!e||!e[t]){ju("no original function "+String(t)+" to wrap");return}if(!n){ju("no wrapper function"),ju(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){ju("original object and wrapper must be functions");return}let o=n(r,t);return BN(o,"__original",r),BN(o,"__unwrap",()=>{e[t]===o&&BN(e,t,r)}),BN(o,"__wrapped",!0),BN(e,t,o),o};Bs.wrap=x_t;var D_t=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{ju("must provide one or more modules to patch"),ju(new Error().stack);return}if(!(t&&Array.isArray(t))){ju("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Bs.wrap)(r,o,n)})})};Bs.massWrap=D_t;var B_t=(e,t)=>{if(!e||!e[t]){ju("no function to unwrap."),ju(new Error().stack);return}let n=e[t];if(!n.__unwrap)ju("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Bs.unwrap=B_t;var N_t=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{ju("must provide one or more modules to patch"),ju(new Error().stack);return}if(!(t&&Array.isArray(t))){ju("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Bs.unwrap)(n,r)})})};Bs.massUnwrap=N_t;function NN(e){e&&e.logger&&(typeof e.logger!="function"?ju("new logger isn't a function, not replacing"):ju=e.logger)}Bs.default=NN;NN.wrap=Bs.wrap;NN.massWrap=Bs.massWrap;NN.unwrap=Bs.unwrap;NN.massUnwrap=Bs.massUnwrap});var iDe=F(m4=>{"use strict";m();Object.defineProperty(m4,"__esModule",{value:!0});m4.InstrumentationAbstract=void 0;var VY=(je(),Me(We)),O_t=FY(),A4=$Y(),qY=class{_config={};_tracer;_meter;_logger;_diag;instrumentationName;instrumentationVersion;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=VY.diag.createComponentLogger({namespace:t}),this._tracer=VY.trace.getTracer(t,n),this._meter=VY.metrics.getMeter(t,n),this._logger=O_t.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=A4.wrap;_unwrap=A4.unwrap;_massWrap=A4.massWrap;_massUnwrap=A4.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};m4.InstrumentationAbstract=qY});var aDe=F(L_=>{"use strict";m();Object.defineProperty(L_,"__esModule",{value:!0});L_.ModuleNameTrie=L_.ModuleNameSeparator=void 0;L_.ModuleNameSeparator="/";var g4=class{hooks=[];children=new Map},YY=class{_trie=new g4;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(L_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new g4,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(L_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};L_.ModuleNameTrie=YY});var uDe=F(h4=>{"use strict";m();Object.defineProperty(h4,"__esModule",{value:!0});h4.RequireInTheMiddleSingleton=void 0;var w_t=MS(),sDe=Ge("path"),KY=aDe(),k_t=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),JY=class e{_moduleNameTrie=new KY.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new w_t.Hook(null,{internals:!0},(t,n,r)=>{let o=M_t(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return k_t?new e:this._instance=this._instance??new e}};h4.RequireInTheMiddleSingleton=JY;function M_t(e){return sDe.sep!==KY.ModuleNameSeparator?e.split(sDe.sep).join(KY.ModuleNameSeparator):e}});var fDe=F(ON=>{m();var cDe=[],ZY=new WeakMap,lDe=new WeakMap,dDe=new Map,pDe=[],P_t={set(e,t,n){let r=ZY.get(e),o=r&&r[t];return typeof o=="function"?o(n):!0},get(e,t){if(t===Symbol.toStringTag)return"Module";let n=lDe.get(e)[t];if(typeof n=="function")return n()},defineProperty(e,t,n){if(!("value"in n))throw new Error("Getters/setters are not supported for exports property descriptors.");let r=ZY.get(e),o=r&&r[t];return typeof o=="function"?o(n.value):!0}};function U_t(e,t,n,r,o){dDe.set(e,o),ZY.set(t,n),lDe.set(t,r);let i=new Proxy(t,P_t);cDe.forEach(a=>a(e,i,o)),pDe.push([e,i,o])}ON.register=U_t;ON.importHooks=cDe;ON.specifiers=dDe;ON.toHook=pDe});var tK=F((Dmn,_v)=>{m();var ADe=Ge("path"),L_t=X2(),{fileURLToPath:Q_t}=Ge("url"),{MessageChannel:F_t}=Ge("worker_threads"),{isBuiltin:WY}=Ge("module");WY||(WY=()=>!0);var{importHooks:XY,specifiers:G_t,toHook:j_t}=fDe();function mDe(e){XY.push(e),j_t.forEach(([t,n,r])=>e(t,n,r))}function gDe(e){let t=XY.indexOf(e);t>-1&&XY.splice(t,1)}function hv(e,t,n,r){let o=e(t,n,r);o&&o!==t&&"default"in t&&(t.default=o)}var eK;function H_t(){let{port1:e,port2:t}=new F_t,n=0,r;eK=c=>{n++,e.postMessage(c)},e.on("message",()=>{n--,r&&n<=0&&r()}).unref();function o(){let c=setInterval(()=>{},1e3),d=new Promise(g=>{r=g}).then(()=>{clearInterval(c)});return n===0&&r(),d}let i=t;return{registerOptions:{data:{addHookMessagePort:i,include:[]},transferList:[i]},addHookMessagePort:i,waitForAllMessagesAcknowledged:o}}function wN(e,t,n){if(!(this instanceof wN))return new wN(e,t,n);typeof e=="function"?(n=e,e=null,t=null):typeof t=="function"&&(n=t,t=null);let r=t?t.internals===!0:!1;eK&&Array.isArray(e)&&eK(e),this._iitmHook=(o,i,a)=>{let c=o,d=c.startsWith("node:"),g,h;if(d){let S=o.slice(5);WY(S)&&(o=S)}else if(c.startsWith("file://")){let S=Error.stackTraceLimit;Error.stackTraceLimit=0;try{g=Q_t(o),o=g}catch{}if(Error.stackTraceLimit=S,g){let y=L_t(g);y&&(o=y.name,h=y.basedir)}}if(e)for(let S of e)if(g&&S===g)hv(n,i,g,void 0);else if(S===o){if(!h)hv(n,i,o,h);else if(h.endsWith(G_t.get(c)))hv(n,i,o,h);else if(r){let y=o+ADe.sep+ADe.relative(h,g);hv(n,i,y,h)}}else S===a&&hv(n,i,a,h);else hv(n,i,o,h)},mDe(this._iitmHook)}wN.prototype.unhook=function(){gDe(this._iitmHook)};_v.exports=wN;_v.exports.Hook=wN;_v.exports.addHook=mDe;_v.exports.removeHook=gDe;_v.exports.createAddHookMessageChannel=H_t});var nK=F(Q_=>{"use strict";m();Object.defineProperty(Q_,"__esModule",{value:!0});Q_.isWrapped=Q_.safeExecuteInTheMiddleAsync=Q_.safeExecuteInTheMiddle=void 0;function z_t(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}Q_.safeExecuteInTheMiddle=z_t;async function $_t(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(await t(r,o),r&&!n)throw r;return o}}Q_.safeExecuteInTheMiddleAsync=$_t;function V_t(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}Q_.isWrapped=V_t});var EDe=F(_4=>{"use strict";m();Object.defineProperty(_4,"__esModule",{value:!0});_4.InstrumentationBase=void 0;var kN=Ge("path"),hDe=Ge("util"),q_t=oDe(),rK=$Y(),Y_t=iDe(),K_t=uDe(),J_t=tK(),MN=(je(),Me(We)),Z_t=MS(),W_t=Ge("fs"),X_t=nK(),oK=class extends Y_t.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=K_t.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,X_t.isWrapped)(t[n])&&this._unwrap(t,n),hDe.types.isProxy(t)){let o=(0,rK.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,rK.wrap)(t,n,r)};_unwrap=(t,n)=>hDe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,rK.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{MN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){MN.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{MN.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){MN.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ge.resolve(n);Ge.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,W_t.readFileSync)(kN.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{MN.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return _De(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=kN.normalize(r);return a.filter(g=>g.name===c&&_De(g.supportedVersions,i,t.includePrerelease)).reduce((g,h)=>(h.moduleExports=g,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(g,t.moduleVersion)):g),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&kN.isAbsolute(c)){let g=kN.parse(c);c=g.name,d=g.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=kN.isAbsolute(t.name)?new Z_t.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new J_t.Hook([t.name],{internals:!0},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};_4.InstrumentationBase=oK;function _De(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,q_t.satisfies)(t,r,{includePrerelease:n}))}});var SDe=F(E4=>{"use strict";m();Object.defineProperty(E4,"__esModule",{value:!0});E4.normalize=void 0;var eEt=Ge("path");Object.defineProperty(E4,"normalize",{enumerable:!0,get:function(){return eEt.normalize}})});var yDe=F(Ev=>{"use strict";m();Object.defineProperty(Ev,"__esModule",{value:!0});Ev.normalize=Ev.InstrumentationBase=void 0;var tEt=EDe();Object.defineProperty(Ev,"InstrumentationBase",{enumerable:!0,get:function(){return tEt.InstrumentationBase}});var nEt=SDe();Object.defineProperty(Ev,"normalize",{enumerable:!0,get:function(){return nEt.normalize}})});var iK=F(Sv=>{"use strict";m();Object.defineProperty(Sv,"__esModule",{value:!0});Sv.normalize=Sv.InstrumentationBase=void 0;var TDe=yDe();Object.defineProperty(Sv,"InstrumentationBase",{enumerable:!0,get:function(){return TDe.InstrumentationBase}});Object.defineProperty(Sv,"normalize",{enumerable:!0,get:function(){return TDe.normalize}})});var IDe=F(S4=>{"use strict";m();Object.defineProperty(S4,"__esModule",{value:!0});S4.InstrumentationNodeModuleDefinition=void 0;var aK=class{files;name;supportedVersions;patch;unpatch;constructor(t,n,r,o,i){this.files=i||[],this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o}};S4.InstrumentationNodeModuleDefinition=aK});var CDe=F(y4=>{"use strict";m();Object.defineProperty(y4,"__esModule",{value:!0});y4.InstrumentationNodeModuleFile=void 0;var rEt=iK(),sK=class{name;supportedVersions;patch;unpatch;constructor(t,n,r,o){this.name=(0,rEt.normalize)(t),this.supportedVersions=n,this.patch=r,this.unpatch=o}};y4.InstrumentationNodeModuleFile=sK});var bDe=F(dy=>{"use strict";m();Object.defineProperty(dy,"__esModule",{value:!0});dy.semconvStabilityFromStr=dy.SemconvStability=void 0;var T4;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(T4=dy.SemconvStability||(dy.SemconvStability={}));function oEt(e,t){let n=T4.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=T4.DUPLICATE;break}else o.toLowerCase()===e&&(n=T4.STABLE);return n}dy.semconvStabilityFromStr=oEt});var RDe=F(Xi=>{"use strict";m();Object.defineProperty(Xi,"__esModule",{value:!0});Xi.semconvStabilityFromStr=Xi.SemconvStability=Xi.safeExecuteInTheMiddleAsync=Xi.safeExecuteInTheMiddle=Xi.isWrapped=Xi.InstrumentationNodeModuleFile=Xi.InstrumentationNodeModuleDefinition=Xi.InstrumentationBase=Xi.registerInstrumentations=void 0;var iEt=Kxe();Object.defineProperty(Xi,"registerInstrumentations",{enumerable:!0,get:function(){return iEt.registerInstrumentations}});var aEt=iK();Object.defineProperty(Xi,"InstrumentationBase",{enumerable:!0,get:function(){return aEt.InstrumentationBase}});var sEt=IDe();Object.defineProperty(Xi,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return sEt.InstrumentationNodeModuleDefinition}});var uEt=CDe();Object.defineProperty(Xi,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return uEt.InstrumentationNodeModuleFile}});var uK=nK();Object.defineProperty(Xi,"isWrapped",{enumerable:!0,get:function(){return uK.isWrapped}});Object.defineProperty(Xi,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return uK.safeExecuteInTheMiddle}});Object.defineProperty(Xi,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return uK.safeExecuteInTheMiddleAsync}});var vDe=bDe();Object.defineProperty(Xi,"SemconvStability",{enumerable:!0,get:function(){return vDe.SemconvStability}});Object.defineProperty(Xi,"semconvStabilityFromStr",{enumerable:!0,get:function(){return vDe.semconvStabilityFromStr}})});var xDe=F((Jmn,cEt)=>{cEt.exports={name:"@fastify/otel",version:"0.18.0",description:"Official Fastify OpenTelemetry Instrumentation",main:"index.js",type:"commonjs",types:"types/index.d.ts",scripts:{lint:"eslint","lint:fix":"eslint --fix",test:"npm run test:all && npm run test:typescript","test:unit":"c8 --100 node --test","test:all":"npm run test:v4 && npm run test:v5","test:v4":"cross-env FASTIFY_VERSION=fastifyv4 npm run test:unit","test:v5":"cross-env FASTIFY_VERSION=fastify npm run test:unit","test:coverage":"c8 node --test && c8 report --reporter=html","test:typescript":"tsd"},repository:{type:"git",url:"git+https://github.com/fastify/otel.git"},keywords:["plugin","helper","fastify","instrumentation","otel","opentelemetry"],author:"Carlos Fuentes - @metcoder95 (https://metcoder.dev)",license:"MIT",bugs:{url:"https://github.com/fastify/otel/issues"},homepage:"https://github.com/fastify/otel#readme",funding:[{type:"github",url:"https://github.com/sponsors/fastify"},{type:"opencollective",url:"https://opencollective.com/fastify"}],devDependencies:{"@fastify/type-provider-typebox":"^6.1.0","@opentelemetry/context-async-hooks":"^2.0.0","@opentelemetry/contrib-test-utils":"^0.59.0","@opentelemetry/instrumentation-http":"^0.212.0","@opentelemetry/propagator-jaeger":"^2.0.0","@opentelemetry/sdk-trace-base":"^2.0.0","@opentelemetry/sdk-trace-node":"^2.2.0","@types/node":"^25.0.3",c8:"^11.0.0","cross-env":"^10.0.0",eslint:"^9.16.0",fastify:"^5.1.0","fastify-plugin":"^5.1.0",fastifyv4:"npm:fastify@^4.0.0",neostandard:"^0.12.0",tsd:"^0.33.0"},dependencies:{"@opentelemetry/core":"^2.0.0","@opentelemetry/instrumentation":"^0.212.0","@opentelemetry/semantic-conventions":"^1.28.0",minimatch:"^10.2.4"},peerDependencies:{"@opentelemetry/api":"^1.9.0"},tsd:{directory:"types"}}});var BDe=F(py=>{"use strict";m();Object.defineProperty(py,"__esModule",{value:!0});py.range=py.balanced=void 0;var lEt=(e,t,n)=>{let r=e instanceof RegExp?DDe(e,n):e,o=t instanceof RegExp?DDe(t,n):t,i=r!==null&&o!=null&&(0,py.range)(r,o,n);return i&&{start:i[0],end:i[1],pre:n.slice(0,i[0]),body:n.slice(i[0]+r.length,i[1]),post:n.slice(i[1]+o.length)}};py.balanced=lEt;var DDe=(e,t)=>{let n=t.match(e);return n?n[0]:null},dEt=(e,t,n)=>{let r,o,i,a,c,d=n.indexOf(e),g=n.indexOf(t,d+1),h=d;if(d>=0&&g>0){if(e===t)return[d,g];for(r=[],i=n.length;h>=0&&!c;){if(h===d)r.push(h),d=n.indexOf(e,h+1);else if(r.length===1){let S=r.pop();S!==void 0&&(c=[S,g])}else o=r.pop(),o!==void 0&&o<i&&(i=o,a=g),g=n.indexOf(t,h+1);h=d<g&&d>=0?d:g}r.length&&a!==void 0&&(c=[i,a])}return c};py.range=dEt});var UDe=F(yv=>{"use strict";m();Object.defineProperty(yv,"__esModule",{value:!0});yv.EXPANSION_MAX=void 0;yv.expand=CEt;var NDe=BDe(),ODe="\0SLASH"+Math.random()+"\0",wDe="\0OPEN"+Math.random()+"\0",lK="\0CLOSE"+Math.random()+"\0",kDe="\0COMMA"+Math.random()+"\0",MDe="\0PERIOD"+Math.random()+"\0",pEt=new RegExp(ODe,"g"),fEt=new RegExp(wDe,"g"),AEt=new RegExp(lK,"g"),mEt=new RegExp(kDe,"g"),gEt=new RegExp(MDe,"g"),hEt=/\\\\/g,_Et=/\\{/g,EEt=/\\}/g,SEt=/\\,/g,yEt=/\\\./g;yv.EXPANSION_MAX=1e5;function cK(e){return isNaN(e)?e.charCodeAt(0):parseInt(e,10)}function TEt(e){return e.replace(hEt,ODe).replace(_Et,wDe).replace(EEt,lK).replace(SEt,kDe).replace(yEt,MDe)}function IEt(e){return e.replace(pEt,"\\").replace(fEt,"{").replace(AEt,"}").replace(mEt,",").replace(gEt,".")}function PDe(e){if(!e)return[""];let t=[],n=(0,NDe.balanced)("{","}",e);if(!n)return e.split(",");let{pre:r,body:o,post:i}=n,a=r.split(",");a[a.length-1]+="{"+o+"}";let c=PDe(i);return i.length&&(a[a.length-1]+=c.shift(),a.push.apply(a,c)),t.push.apply(t,a),t}function CEt(e,t={}){if(!e)return[];let{max:n=yv.EXPANSION_MAX}=t;return e.slice(0,2)==="{}"&&(e="\\{\\}"+e.slice(2)),PN(TEt(e),n,!0).map(IEt)}function bEt(e){return"{"+e+"}"}function vEt(e){return/^-?0\d/.test(e)}function REt(e,t){return e<=t}function xEt(e,t){return e>=t}function PN(e,t,n){let r=[],o=(0,NDe.balanced)("{","}",e);if(!o)return[e];let i=o.pre,a=o.post.length?PN(o.post,t,!1):[""];if(/\$$/.test(o.pre))for(let c=0;c<a.length&&c<t;c++){let d=i+"{"+o.body+"}"+a[c];r.push(d)}else{let c=/^-?\d+\.\.-?\d+(?:\.\.-?\d+)?$/.test(o.body),d=/^[a-zA-Z]\.\.[a-zA-Z](?:\.\.-?\d+)?$/.test(o.body),g=c||d,h=o.body.indexOf(",")>=0;if(!g&&!h)return o.post.match(/,(?!,).*\}/)?(e=o.pre+"{"+o.body+lK+o.post,PN(e,t,!0)):[e];let S;if(g)S=o.body.split(/\.\./);else if(S=PDe(o.body),S.length===1&&S[0]!==void 0&&(S=PN(S[0],t,!1).map(bEt),S.length===1))return a.map(C=>o.pre+S[0]+C);let y;if(g&&S[0]!==void 0&&S[1]!==void 0){let C=cK(S[0]),v=cK(S[1]),x=Math.max(S[0].length,S[1].length),N=S.length===3&&S[2]!==void 0?Math.abs(cK(S[2])):1,k=REt;v<C&&(N*=-1,k=xEt);let j=S.some(vEt);y=[];for(let G=C;k(G,v);G+=N){let q;if(d)q=String.fromCharCode(G),q==="\\"&&(q="");else if(q=String(G),j){let oe=x-q.length;if(oe>0){let ge=new Array(oe+1).join("0");G<0?q="-"+ge+q.slice(1):q=ge+q}}y.push(q)}}else{y=[];for(let C=0;C<S.length;C++)y.push.apply(y,PN(S[C],t,!1))}for(let C=0;C<y.length;C++)for(let v=0;v<a.length&&r.length<t;v++){let x=i+y[C]+a[v];(!n||g||x)&&r.push(x)}}return r}});var LDe=F(I4=>{"use strict";m();Object.defineProperty(I4,"__esModule",{value:!0});I4.assertValidPattern=void 0;var DEt=1024*64,BEt=e=>{if(typeof e!="string")throw new TypeError("invalid pattern");if(e.length>DEt)throw new TypeError("pattern is too long")};I4.assertValidPattern=BEt});var FDe=F(C4=>{"use strict";m();Object.defineProperty(C4,"__esModule",{value:!0});C4.parseClass=void 0;var NEt={"[:alnum:]":["\\p{L}\\p{Nl}\\p{Nd}",!0],"[:alpha:]":["\\p{L}\\p{Nl}",!0],"[:ascii:]":["\\x00-\\x7f",!1],"[:blank:]":["\\p{Zs}\\t",!0],"[:cntrl:]":["\\p{Cc}",!0],"[:digit:]":["\\p{Nd}",!0],"[:graph:]":["\\p{Z}\\p{C}",!0,!0],"[:lower:]":["\\p{Ll}",!0],"[:print:]":["\\p{C}",!0],"[:punct:]":["\\p{P}",!0],"[:space:]":["\\p{Z}\\t\\r\\n\\v\\f",!0],"[:upper:]":["\\p{Lu}",!0],"[:word:]":["\\p{L}\\p{Nl}\\p{Nd}\\p{Pc}",!0],"[:xdigit:]":["A-Fa-f0-9",!1]},UN=e=>e.replace(/[[\]\\-]/g,"\\$&"),OEt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),QDe=e=>e.join(""),wEt=(e,t)=>{let n=t;if(e.charAt(n)!=="[")throw new Error("not in a brace expression");let r=[],o=[],i=n+1,a=!1,c=!1,d=!1,g=!1,h=n,S="";e:for(;i<e.length;){let x=e.charAt(i);if((x==="!"||x==="^")&&i===n+1){g=!0,i++;continue}if(x==="]"&&a&&!d){h=i+1;break}if(a=!0,x==="\\"&&!d){d=!0,i++;continue}if(x==="["&&!d){for(let[N,[k,Q,j]]of Object.entries(NEt))if(e.startsWith(N,i)){if(S)return["$.",!1,e.length-n,!0];i+=N.length,j?o.push(k):r.push(k),c=c||Q;continue e}}if(d=!1,S){x>S?r.push(UN(S)+"-"+UN(x)):x===S&&r.push(UN(x)),S="",i++;continue}if(e.startsWith("-]",i+1)){r.push(UN(x+"-")),i+=2;continue}if(e.startsWith("-",i+1)){S=x,i+=2;continue}r.push(UN(x)),i++}if(h<i)return["",!1,0,!1];if(!r.length&&!o.length)return["$.",!1,e.length-n,!0];if(o.length===0&&r.length===1&&/^\\?.$/.test(r[0])&&!g){let x=r[0].length===2?r[0].slice(-1):r[0];return[OEt(x),!1,h-n,!1]}let y="["+(g?"^":"")+QDe(r)+"]",C="["+(g?"":"^")+QDe(o)+"]";return[r.length&&o.length?"("+y+"|"+C+")":r.length?y:C,c,h-n,!0]};C4.parseClass=wEt});var v4=F(b4=>{"use strict";m();Object.defineProperty(b4,"__esModule",{value:!0});b4.unescape=void 0;var kEt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!0}={})=>n?t?e.replace(/\[([^\/\\])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\])\]/g,"$1$2").replace(/\\([^\/])/g,"$1"):t?e.replace(/\[([^\/\\{}])\]/g,"$1"):e.replace(/((?!\\).|^)\[([^\/\\{}])\]/g,"$1$2").replace(/\\([^\/{}])/g,"$1");b4.unescape=kEt});var fK=F(B4=>{"use strict";m();var Pc;Object.defineProperty(B4,"__esModule",{value:!0});B4.AST=void 0;var MEt=FDe(),R4=v4(),PEt=new Set(["!","?","+","*","@"]),dK=e=>PEt.has(e),GDe=e=>dK(e.type),UEt=new Map([["!",["@"]],["?",["?","@"]],["@",["@"]],["*",["*","+","?","@"]],["+",["+","@"]]]),LEt=new Map([["!",["?"]],["@",["?"]],["+",["?","*"]]]),QEt=new Map([["!",["?","@"]],["?",["?","@"]],["@",["?","@"]],["*",["*","+","?","@"]],["+",["+","@","?","*"]]]),jDe=new Map([["!",new Map([["!","@"]])],["?",new Map([["*","*"],["+","*"]])],["@",new Map([["!","!"],["?","?"],["@","@"],["*","*"],["+","+"]])],["+",new Map([["?","*"],["*","*"]])]]),FEt="(?!(?:^|/)\\.\\.?(?:$|/))",x4="(?!\\.)",GEt=new Set(["[","."]),jEt=new Set(["..","."]),HEt=new Set("().*{}+?[]^$\\!"),zEt=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),pK="[^/]",HDe=pK+"*?",zDe=pK+"+?",$Et=0,D4=class{type;#n;#r;#o=!1;#e=[];#t;#s;#c;#u=!1;#i;#a;#l=!1;id=++$Et;get depth(){return(this.#t?.depth??-1)+1}[Symbol.for("nodejs.util.inspect.custom")](){return{"@@type":"AST",id:this.id,type:this.type,root:this.#n.id,parent:this.#t?.id,depth:this.depth,partsLength:this.#e.length,parts:this.#e}}constructor(t,n,r={}){this.type=t,t&&(this.#r=!0),this.#t=n,this.#n=this.#t?this.#t.#n:this,this.#i=this.#n===this?r:this.#n.#i,this.#c=this.#n===this?[]:this.#n.#c,t==="!"&&!this.#n.#u&&this.#c.push(this),this.#s=this.#t?this.#t.#e.length:0}get hasMagic(){if(this.#r!==void 0)return this.#r;for(let t of this.#e)if(typeof t!="string"&&(t.type||t.hasMagic))return this.#r=!0;return this.#r}toString(){return this.#a!==void 0?this.#a:this.type?this.#a=this.type+"("+this.#e.map(t=>String(t)).join("|")+")":this.#a=this.#e.map(t=>String(t)).join("")}#h(){if(this!==this.#n)throw new Error("should only call on root");if(this.#u)return this;this.toString(),this.#u=!0;let t;for(;t=this.#c.pop();){if(t.type!=="!")continue;let n=t,r=n.#t;for(;r;){for(let o=n.#s+1;!r.type&&o<r.#e.length;o++)for(let i of t.#e){if(typeof i=="string")throw new Error("string part in extglob AST??");i.copyIn(r.#e[o])}n=r,r=n.#t}}return this}push(...t){for(let n of t)if(n!==""){if(typeof n!="string"&&!(n instanceof Pc&&n.#t===this))throw new Error("invalid part: "+n);this.#e.push(n)}}toJSON(){let t=this.type===null?this.#e.slice().map(n=>typeof n=="string"?n:n.toJSON()):[this.type,...this.#e.map(n=>n.toJSON())];return this.isStart()&&!this.type&&t.unshift([]),this.isEnd()&&(this===this.#n||this.#n.#u&&this.#t?.type==="!")&&t.push({}),t}isStart(){if(this.#n===this)return!0;if(!this.#t?.isStart())return!1;if(this.#s===0)return!0;let t=this.#t;for(let n=0;n<this.#s;n++){let r=t.#e[n];if(!(r instanceof Pc&&r.type==="!"))return!1}return!0}isEnd(){if(this.#n===this||this.#t?.type==="!")return!0;if(!this.#t?.isEnd())return!1;if(!this.type)return this.#t?.isEnd();let t=this.#t?this.#t.#e.length:0;return this.#s===t-1}copyIn(t){typeof t=="string"?this.push(t):this.push(t.clone(this))}clone(t){let n=new Pc(this.type,t);for(let r of this.#e)n.copyIn(r);return n}static#d(t,n,r,o,i){let a=o.maxExtglobRecursion??2,c=!1,d=!1,g=-1,h=!1;if(n.type===null){let x=r,N="";for(;x<t.length;){let k=t.charAt(x++);if(c||k==="\\"){c=!c,N+=k;continue}if(d){x===g+1?(k==="^"||k==="!")&&(h=!0):k==="]"&&!(x===g+2&&h)&&(d=!1),N+=k;continue}else if(k==="["){d=!0,g=x,h=!1,N+=k;continue}if(!o.noext&&dK(k)&&t.charAt(x)==="("&&i<=a){n.push(N),N="";let j=new Pc(k,n);x=Pc.#d(t,j,x,o,i+1),n.push(j);continue}N+=k}return n.push(N),x}let S=r+1,y=new Pc(null,n),C=[],v="";for(;S<t.length;){let x=t.charAt(S++);if(c||x==="\\"){c=!c,v+=x;continue}if(d){S===g+1?(x==="^"||x==="!")&&(h=!0):x==="]"&&!(S===g+2&&h)&&(d=!1),v+=x;continue}else if(x==="["){d=!0,g=S,h=!1,v+=x;continue}if(!o.noext&&dK(x)&&t.charAt(S)==="("&&(i<=a||n&&n.#p(x))){let k=n&&n.#p(x)?0:1;y.push(v),v="";let Q=new Pc(x,y);y.push(Q),S=Pc.#d(t,Q,S,o,i+k);continue}if(x==="|"){y.push(v),v="",C.push(y),y=new Pc(null,n);continue}if(x===")")return v===""&&n.#e.length===0&&(n.#l=!0),y.push(v),v="",n.push(...C,y),S;v+=x}return n.type=null,n.#r=void 0,n.#e=[t.substring(r-1)],S}#_(t){return this.#A(t,LEt)}#A(t,n=UEt){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null)return!1;let r=t.#e[0];return!r||typeof r!="object"||r.type===null?!1:this.#p(r.type,n)}#p(t,n=QEt){return!!n.get(this.type)?.includes(t)}#E(t,n){let r=t.#e[0],o=new Pc(null,r,this.options);o.#e.push(""),r.push(o),this.#m(t,n)}#m(t,n){let r=t.#e[0];this.#e.splice(n,1,...r.#e);for(let o of r.#e)typeof o=="object"&&(o.#t=this);this.#a=void 0}#S(t){return!!jDe.get(this.type)?.has(t)}#y(t){if(!t||typeof t!="object"||t.type!==null||t.#e.length!==1||this.type===null||this.#e.length!==1)return!1;let n=t.#e[0];return!n||typeof n!="object"||n.type===null?!1:this.#S(n.type)}#T(t){let n=jDe.get(this.type),r=t.#e[0],o=n?.get(r.type);if(!o)return!1;this.#e=r.#e;for(let i of this.#e)typeof i=="object"&&(i.#t=this);this.type=o,this.#a=void 0,this.#l=!1}static fromGlob(t,n={}){let r=new Pc(null,void 0,n);return Pc.#d(t,r,0,n,0),r}toMMPattern(){if(this!==this.#n)return this.#n.toMMPattern();let t=this.toString(),[n,r,o,i]=this.toRegExpSource();if(!(o||this.#r||this.#i.nocase&&!this.#i.nocaseMagicOnly&&t.toUpperCase()!==t.toLowerCase()))return r;let c=(this.#i.nocase?"i":"")+(i?"u":"");return Object.assign(new RegExp(`^${n}$`,c),{_src:n,_glob:t})}get options(){return this.#i}toRegExpSource(t){let n=t??!!this.#i.dot;if(this.#n===this&&(this.#f(),this.#h()),!GDe(this)){let d=this.isStart()&&this.isEnd()&&!this.#e.some(C=>typeof C!="string"),g=this.#e.map(C=>{let[v,x,N,k]=typeof C=="string"?Pc.#I(C,this.#r,d):C.toRegExpSource(t);return this.#r=this.#r||N,this.#o=this.#o||k,v}).join(""),h="";if(this.isStart()&&typeof this.#e[0]=="string"&&!(this.#e.length===1&&jEt.has(this.#e[0]))){let v=GEt,x=n&&v.has(g.charAt(0))||g.startsWith("\\.")&&v.has(g.charAt(2))||g.startsWith("\\.\\.")&&v.has(g.charAt(4)),N=!n&&!t&&v.has(g.charAt(0));h=x?FEt:N?x4:""}let S="";return this.isEnd()&&this.#n.#u&&this.#t?.type==="!"&&(S="(?:$|\\/)"),[h+g+S,(0,R4.unescape)(g),this.#r=!!this.#r,this.#o]}let r=this.type==="*"||this.type==="+",o=this.type==="!"?"(?:(?!(?:":"(?:",i=this.#g(n);if(this.isStart()&&this.isEnd()&&!i&&this.type!=="!"){let d=this.toString(),g=this;return g.#e=[d],g.type=null,g.#r=void 0,[d,(0,R4.unescape)(this.toString()),!1,!1]}let a=!r||t||n||!x4?"":this.#g(!0);a===i&&(a=""),a&&(i=`(?:${i})(?:${a})*?`);let c="";if(this.type==="!"&&this.#l)c=(this.isStart()&&!n?x4:"")+zDe;else{let d=this.type==="!"?"))"+(this.isStart()&&!n&&!t?x4:"")+HDe+")":this.type==="@"?")":this.type==="?"?")?":this.type==="+"&&a?")":this.type==="*"&&a?")?":`)${this.type}`;c=o+i+d}return[c,(0,R4.unescape)(i),this.#r=!!this.#r,this.#o]}#f(){if(GDe(this)){let t=0,n=!1;do{n=!0;for(let r=0;r<this.#e.length;r++){let o=this.#e[r];typeof o=="object"&&(o.#f(),this.#A(o)?(n=!1,this.#m(o,r)):this.#_(o)?(n=!1,this.#E(o,r)):this.#y(o)&&(n=!1,this.#T(o)))}}while(!n&&++t<10)}else for(let t of this.#e)typeof t=="object"&&t.#f();this.#a=void 0}#g(t){return this.#e.map(n=>{if(typeof n=="string")throw new Error("string type in extglob ast??");let[r,o,i,a]=n.toRegExpSource(t);return this.#o=this.#o||a,r}).filter(n=>!(this.isStart()&&this.isEnd())||!!n).join("|")}static#I(t,n,r=!1){let o=!1,i="",a=!1,c=!1;for(let d=0;d<t.length;d++){let g=t.charAt(d);if(o){o=!1,i+=(HEt.has(g)?"\\":"")+g;continue}if(g==="*"){if(c)continue;c=!0,i+=r&&/^[*]+$/.test(t)?zDe:HDe,n=!0;continue}else c=!1;if(g==="\\"){d===t.length-1?i+="\\\\":o=!0;continue}if(g==="["){let[h,S,y,C]=(0,MEt.parseClass)(t,d);if(y){i+=h,a=a||S,d+=y-1,n=n||C;continue}}if(g==="?"){i+=pK,n=!0;continue}i+=zEt(g)}return[i,(0,R4.unescape)(t),!!n,a]}};B4.AST=D4;Pc=D4});var AK=F(N4=>{"use strict";m();Object.defineProperty(N4,"__esModule",{value:!0});N4.escape=void 0;var VEt=(e,{windowsPathsNoEscape:t=!1,magicalBraces:n=!1}={})=>n?t?e.replace(/[?*()[\]{}]/g,"[$&]"):e.replace(/[?*()[\]\\{}]/g,"\\$&"):t?e.replace(/[?*()[\]]/g,"[$&]"):e.replace(/[?*()[\]\\]/g,"\\$&");N4.escape=VEt});var ZDe=F(ft=>{"use strict";m();Object.defineProperty(ft,"__esModule",{value:!0});ft.unescape=ft.escape=ft.AST=ft.Minimatch=ft.match=ft.makeRe=ft.braceExpand=ft.defaults=ft.filter=ft.GLOBSTAR=ft.sep=ft.minimatch=void 0;var qEt=UDe(),O4=LDe(),qDe=fK(),YEt=AK(),KEt=v4(),JEt=(e,t,n={})=>((0,O4.assertValidPattern)(t),!n.nocomment&&t.charAt(0)==="#"?!1:new fy(t,n).match(e));ft.minimatch=JEt;var ZEt=/^\*+([^+@!?\*\[\(]*)$/,WEt=e=>t=>!t.startsWith(".")&&t.endsWith(e),XEt=e=>t=>t.endsWith(e),e0t=e=>(e=e.toLowerCase(),t=>!t.startsWith(".")&&t.toLowerCase().endsWith(e)),t0t=e=>(e=e.toLowerCase(),t=>t.toLowerCase().endsWith(e)),n0t=/^\*+\.\*+$/,r0t=e=>!e.startsWith(".")&&e.includes("."),o0t=e=>e!=="."&&e!==".."&&e.includes("."),i0t=/^\.\*+$/,a0t=e=>e!=="."&&e!==".."&&e.startsWith("."),s0t=/^\*+$/,u0t=e=>e.length!==0&&!e.startsWith("."),c0t=e=>e.length!==0&&e!=="."&&e!=="..",l0t=/^\?+([^+@!?\*\[\(]*)?$/,d0t=([e,t=""])=>{let n=YDe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},p0t=([e,t=""])=>{let n=KDe([e]);return t?(t=t.toLowerCase(),r=>n(r)&&r.toLowerCase().endsWith(t)):n},f0t=([e,t=""])=>{let n=KDe([e]);return t?r=>n(r)&&r.endsWith(t):n},A0t=([e,t=""])=>{let n=YDe([e]);return t?r=>n(r)&&r.endsWith(t):n},YDe=([e])=>{let t=e.length;return n=>n.length===t&&!n.startsWith(".")},KDe=([e])=>{let t=e.length;return n=>n.length===t&&n!=="."&&n!==".."},JDe=typeof process=="object"&&process?typeof process.env=="object"&&process.env&&process.env.__MINIMATCH_TESTING_PLATFORM__||process.platform:"posix",$De={win32:{sep:"\\"},posix:{sep:"/"}};ft.sep=JDe==="win32"?$De.win32.sep:$De.posix.sep;ft.minimatch.sep=ft.sep;ft.GLOBSTAR=Symbol("globstar **");ft.minimatch.GLOBSTAR=ft.GLOBSTAR;var m0t="[^/]",g0t=m0t+"*?",h0t="(?:(?!(?:\\/|^)(?:\\.{1,2})($|\\/)).)*?",_0t="(?:(?!(?:\\/|^)\\.).)*?",E0t=(e,t={})=>n=>(0,ft.minimatch)(n,e,t);ft.filter=E0t;ft.minimatch.filter=ft.filter;var jd=(e,t={})=>Object.assign({},e,t),S0t=e=>{if(!e||typeof e!="object"||!Object.keys(e).length)return ft.minimatch;let t=ft.minimatch;return Object.assign((r,o,i={})=>t(r,o,jd(e,i)),{Minimatch:class extends t.Minimatch{constructor(o,i={}){super(o,jd(e,i))}static defaults(o){return t.defaults(jd(e,o)).Minimatch}},AST:class extends t.AST{constructor(o,i,a={}){super(o,i,jd(e,a))}static fromGlob(o,i={}){return t.AST.fromGlob(o,jd(e,i))}},unescape:(r,o={})=>t.unescape(r,jd(e,o)),escape:(r,o={})=>t.escape(r,jd(e,o)),filter:(r,o={})=>t.filter(r,jd(e,o)),defaults:r=>t.defaults(jd(e,r)),makeRe:(r,o={})=>t.makeRe(r,jd(e,o)),braceExpand:(r,o={})=>t.braceExpand(r,jd(e,o)),match:(r,o,i={})=>t.match(r,o,jd(e,i)),sep:t.sep,GLOBSTAR:ft.GLOBSTAR})};ft.defaults=S0t;ft.minimatch.defaults=ft.defaults;var y0t=(e,t={})=>((0,O4.assertValidPattern)(e),t.nobrace||!/\{(?:(?!\{).)*\}/.test(e)?[e]:(0,qEt.expand)(e,{max:t.braceExpandMax}));ft.braceExpand=y0t;ft.minimatch.braceExpand=ft.braceExpand;var T0t=(e,t={})=>new fy(e,t).makeRe();ft.makeRe=T0t;ft.minimatch.makeRe=ft.makeRe;var I0t=(e,t,n={})=>{let r=new fy(t,n);return e=e.filter(o=>r.match(o)),r.options.nonull&&!e.length&&e.push(t),e};ft.match=I0t;ft.minimatch.match=ft.match;var VDe=/[?*]|[+@!]\(.*?\)|\[|\]/,C0t=e=>e.replace(/[-[\]{}()*+?.,\\^$|#\s]/g,"\\$&"),fy=class{options;set;pattern;windowsPathsNoEscape;nonegate;negate;comment;empty;preserveMultipleSlashes;partial;globSet;globParts;nocase;isWindows;platform;windowsNoMagicRoot;maxGlobstarRecursion;regexp;constructor(t,n={}){(0,O4.assertValidPattern)(t),n=n||{},this.options=n,this.maxGlobstarRecursion=n.maxGlobstarRecursion??200,this.pattern=t,this.platform=n.platform||JDe,this.isWindows=this.platform==="win32";let r="allowWindowsEscape";this.windowsPathsNoEscape=!!n.windowsPathsNoEscape||n[r]===!1,this.windowsPathsNoEscape&&(this.pattern=this.pattern.replace(/\\/g,"/")),this.preserveMultipleSlashes=!!n.preserveMultipleSlashes,this.regexp=null,this.negate=!1,this.nonegate=!!n.nonegate,this.comment=!1,this.empty=!1,this.partial=!!n.partial,this.nocase=!!this.options.nocase,this.windowsNoMagicRoot=n.windowsNoMagicRoot!==void 0?n.windowsNoMagicRoot:!!(this.isWindows&&this.nocase),this.globSet=[],this.globParts=[],this.set=[],this.make()}hasMagic(){if(this.options.magicalBraces&&this.set.length>1)return!0;for(let t of this.set)for(let n of t)if(typeof n!="string")return!0;return!1}debug(...t){}make(){let t=this.pattern,n=this.options;if(!n.nocomment&&t.charAt(0)==="#"){this.comment=!0;return}if(!t){this.empty=!0;return}this.parseNegate(),this.globSet=[...new Set(this.braceExpand())],n.debug&&(this.debug=(...i)=>console.error(...i)),this.debug(this.pattern,this.globSet);let r=this.globSet.map(i=>this.slashSplit(i));this.globParts=this.preprocess(r),this.debug(this.pattern,this.globParts);let o=this.globParts.map((i,a,c)=>{if(this.isWindows&&this.windowsNoMagicRoot){let d=i[0]===""&&i[1]===""&&(i[2]==="?"||!VDe.test(i[2]))&&!VDe.test(i[3]),g=/^[a-z]:/i.test(i[0]);if(d)return[...i.slice(0,4),...i.slice(4).map(h=>this.parse(h))];if(g)return[i[0],...i.slice(1).map(h=>this.parse(h))]}return i.map(d=>this.parse(d))});if(this.debug(this.pattern,o),this.set=o.filter(i=>i.indexOf(!1)===-1),this.isWindows)for(let i=0;i<this.set.length;i++){let a=this.set[i];a[0]===""&&a[1]===""&&this.globParts[i][2]==="?"&&typeof a[3]=="string"&&/^[a-z]:$/i.test(a[3])&&(a[2]="?")}this.debug(this.pattern,this.set)}preprocess(t){if(this.options.noglobstar)for(let r=0;r<t.length;r++)for(let o=0;o<t[r].length;o++)t[r][o]==="**"&&(t[r][o]="*");let{optimizationLevel:n=1}=this.options;return n>=2?(t=this.firstPhasePreProcess(t),t=this.secondPhasePreProcess(t)):n>=1?t=this.levelOneOptimize(t):t=this.adjascentGlobstarOptimize(t),t}adjascentGlobstarOptimize(t){return t.map(n=>{let r=-1;for(;(r=n.indexOf("**",r+1))!==-1;){let o=r;for(;n[o+1]==="**";)o++;o!==r&&n.splice(r,o-r)}return n})}levelOneOptimize(t){return t.map(n=>(n=n.reduce((r,o)=>{let i=r[r.length-1];return o==="**"&&i==="**"?r:o===".."&&i&&i!==".."&&i!=="."&&i!=="**"?(r.pop(),r):(r.push(o),r)},[]),n.length===0?[""]:n))}levelTwoFileOptimize(t){Array.isArray(t)||(t=this.slashSplit(t));let n=!1;do{if(n=!1,!this.preserveMultipleSlashes){for(let o=1;o<t.length-1;o++){let i=t[o];o===1&&i===""&&t[0]===""||(i==="."||i==="")&&(n=!0,t.splice(o,1),o--)}t[0]==="."&&t.length===2&&(t[1]==="."||t[1]==="")&&(n=!0,t.pop())}let r=0;for(;(r=t.indexOf("..",r+1))!==-1;){let o=t[r-1];o&&o!=="."&&o!==".."&&o!=="**"&&(n=!0,t.splice(r-1,2),r-=2)}}while(n);return t.length===0?[""]:t}firstPhasePreProcess(t){let n=!1;do{n=!1;for(let r of t){let o=-1;for(;(o=r.indexOf("**",o+1))!==-1;){let a=o;for(;r[a+1]==="**";)a++;a>o&&r.splice(o+1,a-o);let c=r[o+1],d=r[o+2],g=r[o+3];if(c!==".."||!d||d==="."||d===".."||!g||g==="."||g==="..")continue;n=!0,r.splice(o,1);let h=r.slice(0);h[o]="**",t.push(h),o--}if(!this.preserveMultipleSlashes){for(let a=1;a<r.length-1;a++){let c=r[a];a===1&&c===""&&r[0]===""||(c==="."||c==="")&&(n=!0,r.splice(a,1),a--)}r[0]==="."&&r.length===2&&(r[1]==="."||r[1]==="")&&(n=!0,r.pop())}let i=0;for(;(i=r.indexOf("..",i+1))!==-1;){let a=r[i-1];if(a&&a!=="."&&a!==".."&&a!=="**"){n=!0;let d=i===1&&r[i+1]==="**"?["."]:[];r.splice(i-1,2,...d),r.length===0&&r.push(""),i-=2}}}}while(n);return t}secondPhasePreProcess(t){for(let n=0;n<t.length-1;n++)for(let r=n+1;r<t.length;r++){let o=this.partsMatch(t[n],t[r],!this.preserveMultipleSlashes);if(o){t[n]=[],t[r]=o;break}}return t.filter(n=>n.length)}partsMatch(t,n,r=!1){let o=0,i=0,a=[],c="";for(;o<t.length&&i<n.length;)if(t[o]===n[i])a.push(c==="b"?n[i]:t[o]),o++,i++;else if(r&&t[o]==="**"&&n[i]===t[o+1])a.push(t[o]),o++;else if(r&&n[i]==="**"&&t[o]===n[i+1])a.push(n[i]),i++;else if(t[o]==="*"&&n[i]&&(this.options.dot||!n[i].startsWith("."))&&n[i]!=="**"){if(c==="b")return!1;c="a",a.push(t[o]),o++,i++}else if(n[i]==="*"&&t[o]&&(this.options.dot||!t[o].startsWith("."))&&t[o]!=="**"){if(c==="a")return!1;c="b",a.push(n[i]),o++,i++}else return!1;return t.length===n.length&&a}parseNegate(){if(this.nonegate)return;let t=this.pattern,n=!1,r=0;for(let o=0;o<t.length&&t.charAt(o)==="!";o++)n=!n,r++;r&&(this.pattern=t.slice(r)),this.negate=n}matchOne(t,n,r=!1){let o=0,i=0;if(this.isWindows){let c=typeof t[0]=="string"&&/^[a-z]:$/i.test(t[0]),d=!c&&t[0]===""&&t[1]===""&&t[2]==="?"&&/^[a-z]:$/i.test(t[3]),g=typeof n[0]=="string"&&/^[a-z]:$/i.test(n[0]),h=!g&&n[0]===""&&n[1]===""&&n[2]==="?"&&typeof n[3]=="string"&&/^[a-z]:$/i.test(n[3]),S=d?3:c?0:void 0,y=h?3:g?0:void 0;if(typeof S=="number"&&typeof y=="number"){let[C,v]=[t[S],n[y]];C.toLowerCase()===v.toLowerCase()&&(n[y]=C,i=y,o=S)}}let{optimizationLevel:a=1}=this.options;return a>=2&&(t=this.levelTwoFileOptimize(t)),n.includes(ft.GLOBSTAR)?this.#n(t,n,r,o,i):this.#o(t,n,r,o,i)}#n(t,n,r,o,i){let a=n.indexOf(ft.GLOBSTAR,i),c=n.lastIndexOf(ft.GLOBSTAR),[d,g,h]=r?[n.slice(i,a),n.slice(a+1),[]]:[n.slice(i,a),n.slice(a+1,c),n.slice(c+1)];if(d.length){let Q=t.slice(o,o+d.length);if(!this.#o(Q,d,r,0,0))return!1;o+=d.length,i+=d.length}let S=0;if(h.length){if(h.length+o>t.length)return!1;let Q=t.length-h.length;if(this.#o(t,h,r,Q,0))S=h.length;else{if(t[t.length-1]!==""||o+h.length===t.length||(Q--,!this.#o(t,h,r,Q,0)))return!1;S=h.length+1}}if(!g.length){let Q=!!S;for(let j=o;j<t.length-S;j++){let G=String(t[j]);if(Q=!0,G==="."||G===".."||!this.options.dot&&G.startsWith("."))return!1}return r||Q}let y=[[[],0]],C=y[0],v=0,x=[0];for(let Q of g)Q===ft.GLOBSTAR?(x.push(v),C=[[],0],y.push(C)):(C[0].push(Q),v++);let N=y.length-1,k=t.length-S;for(let Q of y)Q[1]=k-(x[N--]+Q[0].length);return!!this.#r(t,y,o,0,r,0,!!S)}#r(t,n,r,o,i,a,c){let d=n[o];if(!d){for(let S=r;S<t.length;S++){c=!0;let y=t[S];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1}return c}let[g,h]=d;for(;r<=h;){if(this.#o(t.slice(0,r+g.length),g,i,r,0)&&a<this.maxGlobstarRecursion){let C=this.#r(t,n,r+g.length,o+1,i,a+1,c);if(C!==!1)return C}let y=t[r];if(y==="."||y===".."||!this.options.dot&&y.startsWith("."))return!1;r++}return i||null}#o(t,n,r,o,i){let a,c,d,g;for(a=o,c=i,g=t.length,d=n.length;a<g&&c<d;a++,c++){this.debug("matchOne loop");let h=n[c],S=t[a];if(this.debug(n,h,S),h===!1||h===ft.GLOBSTAR)return!1;let y;if(typeof h=="string"?(y=S===h,this.debug("string match",h,S,y)):(y=h.test(S),this.debug("pattern match",h,S,y)),!y)return!1}if(a===g&&c===d)return!0;if(a===g)return r;if(c===d)return a===g-1&&t[a]==="";throw new Error("wtf?")}braceExpand(){return(0,ft.braceExpand)(this.pattern,this.options)}parse(t){(0,O4.assertValidPattern)(t);let n=this.options;if(t==="**")return ft.GLOBSTAR;if(t==="")return"";let r,o=null;(r=t.match(s0t))?o=n.dot?c0t:u0t:(r=t.match(ZEt))?o=(n.nocase?n.dot?t0t:e0t:n.dot?XEt:WEt)(r[1]):(r=t.match(l0t))?o=(n.nocase?n.dot?p0t:d0t:n.dot?f0t:A0t)(r):(r=t.match(n0t))?o=n.dot?o0t:r0t:(r=t.match(i0t))&&(o=a0t);let i=qDe.AST.fromGlob(t,this.options).toMMPattern();return o&&typeof i=="object"&&Reflect.defineProperty(i,"test",{value:o}),i}makeRe(){if(this.regexp||this.regexp===!1)return this.regexp;let t=this.set;if(!t.length)return this.regexp=!1,this.regexp;let n=this.options,r=n.noglobstar?g0t:n.dot?h0t:_0t,o=new Set(n.nocase?["i"]:[]),i=t.map(d=>{let g=d.map(S=>{if(S instanceof RegExp)for(let y of S.flags.split(""))o.add(y);return typeof S=="string"?C0t(S):S===ft.GLOBSTAR?ft.GLOBSTAR:S._src});g.forEach((S,y)=>{let C=g[y+1],v=g[y-1];S!==ft.GLOBSTAR||v===ft.GLOBSTAR||(v===void 0?C!==void 0&&C!==ft.GLOBSTAR?g[y+1]="(?:\\/|"+r+"\\/)?"+C:g[y]=r:C===void 0?g[y-1]=v+"(?:\\/|\\/"+r+")?":C!==ft.GLOBSTAR&&(g[y-1]=v+"(?:\\/|\\/"+r+"\\/)"+C,g[y+1]=ft.GLOBSTAR))});let h=g.filter(S=>S!==ft.GLOBSTAR);if(this.partial&&h.length>=1){let S=[];for(let y=1;y<=h.length;y++)S.push(h.slice(0,y).join("/"));return"(?:"+S.join("|")+")"}return h.join("/")}).join("|"),[a,c]=t.length>1?["(?:",")"]:["",""];i="^"+a+i+c+"$",this.partial&&(i="^(?:\\/|"+a+i.slice(1,-1)+c+")$"),this.negate&&(i="^(?!"+i+").+$");try{this.regexp=new RegExp(i,[...o].join(""))}catch{this.regexp=!1}return this.regexp}slashSplit(t){return this.preserveMultipleSlashes?t.split("/"):this.isWindows&&/^\/\/[^\/]+/.test(t)?["",...t.split(/\/+/)]:t.split(/\/+/)}match(t,n=this.partial){if(this.debug("match",t,this.pattern),this.comment)return!1;if(this.empty)return t==="";if(t==="/"&&n)return!0;let r=this.options;this.isWindows&&(t=t.split("\\").join("/"));let o=this.slashSplit(t);this.debug(this.pattern,"split",o);let i=this.set;this.debug(this.pattern,"set",i);let a=o[o.length-1];if(!a)for(let c=o.length-2;!a&&c>=0;c--)a=o[c];for(let c=0;c<i.length;c++){let d=i[c],g=o;if(r.matchBase&&d.length===1&&(g=[a]),this.matchOne(g,d,n))return r.flipNegate?!0:!this.negate}return r.flipNegate?!1:this.negate}static defaults(t){return ft.minimatch.defaults(t).Minimatch}};ft.Minimatch=fy;var b0t=fK();Object.defineProperty(ft,"AST",{enumerable:!0,get:function(){return b0t.AST}});var v0t=AK();Object.defineProperty(ft,"escape",{enumerable:!0,get:function(){return v0t.escape}});var R0t=v4();Object.defineProperty(ft,"unescape",{enumerable:!0,get:function(){return R0t.unescape}});ft.minimatch.AST=qDe.AST;ft.minimatch.Minimatch=fy;ft.minimatch.escape=YEt.escape;ft.minimatch.unescape=KEt.unescape});var o1e=F((mgn,hK)=>{"use strict";m();var WDe=Ge("node:diagnostics_channel"),{context:w4,trace:mK,SpanStatusCode:k4,propagation:gK,diag:x0t}=(je(),Me(We)),{getRPCMetadata:D0t,RPCType:B0t}=Tr(),{ATTR_HTTP_ROUTE:M4,ATTR_HTTP_RESPONSE_STATUS_CODE:XDe,ATTR_HTTP_REQUEST_METHOD:N0t,ATTR_URL_PATH:O0t}=(Zn(),Me(Ur)),{InstrumentationBase:w0t}=RDe(),{version:k0t,name:e1e}=xDe(),M0t=">=4.0.0 <6",t1e=["onRequest","preParsing","preValidation","preHandler","preSerialization","onSend","onResponse","onError"],Eo={HOOK_NAME:"hook.name",FASTIFY_TYPE:"fastify.type",HOOK_CALLBACK_NAME:"hook.callback.name",ROOT:"fastify.root"},F_={ROUTE:"route-hook",INSTANCE:"hook",HANDLER:"request-handler"},Ig="anonymous",G_=Symbol("fastify otel instance"),j_=Symbol("fastify otel request spans"),LN=Symbol("fastify otel request context"),n1e=Symbol("fastify otel addhook original"),r1e=Symbol("fastify otel setnotfound original"),QN=Symbol("fastify otel ignore path"),FN=Symbol("fastify otel record exceptions"),P4=class extends w0t{logger=null;_requestHook=null;_lifecycleHook=null;constructor(t){if(super(e1e,k0t,t),this.logger=x0t.createComponentLogger({namespace:e1e}),this[QN]=null,this[FN]=!0,t?.recordExceptions!=null){if(typeof t.recordExceptions!="boolean")throw new TypeError("recordExceptions must be a boolean");this[FN]=t.recordExceptions}if(typeof t?.requestHook=="function"&&(this._requestHook=t.requestHook),typeof t?.lifecycleHook=="function"&&(this._lifecycleHook=t.lifecycleHook),t?.ignorePaths!=null||process.env.OTEL_FASTIFY_IGNORE_PATHS!=null){let n=t?.ignorePaths??process.env.OTEL_FASTIFY_IGNORE_PATHS;if((typeof n!="string"||n.length===0)&&typeof n!="function")throw new TypeError("ignorePaths must be a string or a function");let r=null;this[QN]=o=>typeof n=="function"?n(o):(r==null&&(r=ZDe().minimatch),r(o.url,n))}}enable(){return this._handleInitialization===void 0&&this.getConfig().registerOnInitialization&&(this._handleInitialization=t=>{this.plugin()(t.fastify,void 0,()=>{});let n=(r,o,i)=>{i()};n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",t.fastify.register(n)},WDe.subscribe("fastify.initialization",this._handleInitialization)),super.enable()}disable(){return this._handleInitialization&&(WDe.unsubscribe("fastify.initialization",this._handleInitialization),this._handleInitialization=void 0),super.disable()}init(){return[]}plugin(){let t=this;return n[Symbol.for("skip-override")]=!0,n[Symbol.for("fastify.display-name")]="@fastify/otel",n[Symbol.for("plugin-meta")]={fastify:M0t,name:"@fastify/otel"},n;function n(r,o,i){r.decorate(G_,t),r.decorate(n1e,r.addHook),r.decorate(r1e,r.setNotFoundHandler),r.decorateRequest("opentelemetry",function(){let C=this[LN],v=this[j_];return{enabled:this.routeOptions.config?.otel!==!1,span:v,tracer:t.tracer,context:C,inject:(x,N)=>gK.inject(C,x,N),extract:(x,N)=>gK.extract(C,x,N)}}),r.decorateRequest(j_,null),r.decorateRequest(LN,null),r.addHook("onRoute",function(C){if(t[QN]?.(C)===!0){t.logger.debug(`Ignoring route instrumentation ${C.method} ${C.url} because it matches the ignore path`);return}if(C.config?.otel===!1){t.logger.debug(`Ignoring route instrumentation ${C.method} ${C.url} because it is disabled`);return}for(let v of t1e)if(C[v]!=null){let x=C[v];if(typeof x=="function")C[v]=S(x,v,{[Eo.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Eo.FASTIFY_TYPE]:F_.ROUTE,[M4]:C.url,[Eo.HOOK_CALLBACK_NAME]:x.name?.length>0?x.name:Ig});else if(Array.isArray(x)){let N=[];for(let k of x)N.push(S(k,v,{[Eo.HOOK_NAME]:`${this.pluginName} - route -> ${v}`,[Eo.FASTIFY_TYPE]:F_.ROUTE,[M4]:C.url,[Eo.HOOK_CALLBACK_NAME]:k.name?.length>0?k.name:Ig}));C[v]=N}}C.onSend!=null?C.onSend=Array.isArray(C.onSend)?[...C.onSend,a]:[C.onSend,a]:C.onSend=a,C.onError!=null?C.onError=Array.isArray(C.onError)?[...C.onError,c]:[C.onError,c]:C.onError=c,C.handler=S(C.handler,"handler",{[Eo.HOOK_NAME]:`${this.pluginName} - route-handler`,[Eo.FASTIFY_TYPE]:F_.HANDLER,[M4]:C.url,[Eo.HOOK_CALLBACK_NAME]:C.handler.name.length>0?C.handler.name:Ig})}),r.addHook("onRequest",function(C,v,x){if(this[G_].isEnabled()===!1||C.routeOptions.config?.otel===!1)return x();if(this[G_][QN]?.({url:C.url,method:C.method})===!0)return this[G_].logger.debug(`Ignoring request ${C.method} ${C.url} because it matches the ignore path`),x();let N=w4.active();mK.getSpan(N)==null&&(N=gK.extract(N,C.headers));let k=D0t(N);C.routeOptions.url!=null&&k?.type===B0t.HTTP&&(k.route=C.routeOptions.url);let Q={[Eo.ROOT]:"@fastify/otel",[N0t]:C.method,[O0t]:C.url};C.routeOptions.url!=null&&(Q[M4]=C.routeOptions.url);let j=this[G_].tracer.startSpan("request",{attributes:Q},N);try{this[G_]._requestHook?.(j,C)}catch(G){this[G_].logger.error({err:G},"requestHook threw")}C[LN]=mK.setSpan(N,j),C[j_]=j,w4.with(C[LN],()=>{x()})}),r.addHook("onResponse",function(C,v,x){let N=C[j_];N!=null&&(N.setAttributes({[XDe]:v.statusCode}),N.end()),C[j_]=null,x()}),r.addHook=d,r.setNotFoundHandler=g,i();function a(y,C,v,x){let N=y[j_];N!=null&&(C.statusCode>=500&&N.setStatus({code:k4.ERROR}),N.setAttributes({[XDe]:C.statusCode}),N.end()),y[j_]=null,x(null,v)}function c(y,C,v,x){let N=y[j_];N!=null&&(N.setStatus({code:k4.ERROR,message:v.message}),t[FN]!==!1&&N.recordException(v)),x()}function d(y,C){let v=this[n1e];return t1e.includes(y)?v.call(this,y,S(C,y,{[Eo.HOOK_NAME]:`${this.pluginName} - ${y}`,[Eo.FASTIFY_TYPE]:F_.INSTANCE,[Eo.HOOK_CALLBACK_NAME]:C.name?.length>0?C.name:Ig})):v.call(this,y,C)}function g(y,C){let v=this[r1e];typeof y=="function"?(C=S(y,"notFoundHandler",{[Eo.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Eo.FASTIFY_TYPE]:F_.INSTANCE,[Eo.HOOK_CALLBACK_NAME]:y.name?.length>0?y.name:Ig}),v.call(this,C)):(y.preValidation!=null&&(y.preValidation=S(y.preValidation,"notFoundHandler - preValidation",{[Eo.HOOK_NAME]:`${this.pluginName} - not-found-handler - preValidation`,[Eo.FASTIFY_TYPE]:F_.INSTANCE,[Eo.HOOK_CALLBACK_NAME]:y.preValidation.name?.length>0?y.preValidation.name:Ig})),y.preHandler!=null&&(y.preHandler=S(y.preHandler,"notFoundHandler - preHandler",{[Eo.HOOK_NAME]:`${this.pluginName} - not-found-handler - preHandler`,[Eo.FASTIFY_TYPE]:F_.INSTANCE,[Eo.HOOK_CALLBACK_NAME]:y.preHandler.name?.length>0?y.preHandler.name:Ig})),C=S(C,"notFoundHandler",{[Eo.HOOK_NAME]:`${this.pluginName} - not-found-handler`,[Eo.FASTIFY_TYPE]:F_.INSTANCE,[Eo.HOOK_CALLBACK_NAME]:C.name?.length>0?C.name:Ig}),v.call(this,y,C))}function h(y){for(let C of y)if(C?.routeOptions&&C.url&&C.method)return C;return null}function S(y,C,v={}){return function(...N){let k=this[G_],Q=h(N);if(Q===null)return k.logger.debug(`Ignoring route instrumentation because ${C} was called without a Fastify request argument`),y.call(this,...N);if(k.isEnabled()===!1||Q.routeOptions.config?.otel===!1)return k.logger.debug(`Ignoring route instrumentation ${Q.routeOptions.method} ${Q.routeOptions.url} because it is disabled`),y.call(this,...N);if(k[QN]?.({url:Q.url,method:Q.method})===!0)return k.logger.debug(`Ignoring route instrumentation ${Q.routeOptions.method} ${Q.routeOptions.url} because it matches the ignore path`),y.call(this,...N);let j=Q[LN]??w4.active(),G=y.name?.length>0?y.name:this.pluginName??Ig,q=k.tracer.startSpan(`${C} - ${G}`,{attributes:v},j);if(k._lifecycleHook!=null)try{k._lifecycleHook(q,{hookName:C,request:Q,handler:G})}catch(oe){k.logger.error({err:oe},"Execution of lifecycleHook failed")}return w4.with(mK.setSpan(j,q),function(){try{let oe=y.call(this,...N);return typeof oe?.then=="function"?oe.then(ge=>(q.end(),ge),ge=>(q.setStatus({code:k4.ERROR,message:ge.message}),k[FN]!==!1&&q.recordException(ge),q.end(),Promise.reject(ge))):(q.end(),oe)}catch(oe){throw q.setStatus({code:k4.ERROR,message:oe.message}),k[FN]!==!1&&q.recordException(oe),q.end(),oe}},this)}}}}};hK.exports=P4;hK.exports.FastifyOtelInstrumentation=P4});var Cg,GN,jN,i1e=O(()=>{m();(function(e){let t="fastify.name";e.FASTIFY_NAME=t;let n="fastify.type";e.FASTIFY_TYPE=n;let r="hook.name";e.HOOK_NAME=r;let o="plugin.name";e.PLUGIN_NAME=o})(Cg||(Cg={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request_handler";e.REQUEST_HANDLER=n})(GN||(GN={}));(function(e){let t="middleware";e.MIDDLEWARE=t;let n="request handler";e.REQUEST_HANDLER=n})(jN||(jN={}))});var HN,a1e=O(()=>{m();HN=Symbol("opentelemetry.instrumentation.fastify.request_active_span")});function _K(e,t,n,r={}){let o=t.startSpan(n,{attributes:r}),i=e[HN]||[];return i.push(o),Object.defineProperty(e,HN,{enumerable:!1,configurable:!0,value:i}),o}function U4(e,t){let n=e[HN]||[];n.length&&(n.forEach(r=>{t&&(r.setStatus({code:ui.ERROR,message:t.message}),r.recordException(t)),r.end()}),delete e[HN])}function u1e(e,t,n){let r,o;try{o=e(),s1e(o)&&o.then(i=>t(void 0,i),i=>t(i))}catch(i){r=i}finally{if(!s1e(o)&&(t(r,o),r))throw r;return o}}function s1e(e){return typeof e=="object"&&e&&typeof Object.getOwnPropertyDescriptor(e,"then")?.value=="function"||!1}var c1e=O(()=>{m();je();a1e()});function Q0t(){let e=gt();e&&e.on("spanStart",t=>{d1e(t)})}function d1e(e){let t=Ot(e).data,n=t["fastify.type"];if(t[Zt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.fastify",[Zt]:`${n}.fastify`});let r=t["fastify.name"]||t["plugin.name"]||t["hook.name"];if(typeof r=="string"){let o=r.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(o)}}var Q4,Ay,P0t,U0t,l1e,L0t,L4,p1e=O(()=>{m();je();Q4=ie(Tr(),1),Ay=ie(rn(),1);Zn();dt();i1e();c1e();P0t="0.1.0",U0t="@sentry/instrumentation-fastify-v3",l1e="anonymous",L0t=new Set(["onTimeout","onRequest","preParsing","preValidation","preSerialization","preHandler","onSend","onResponse","onError"]),L4=class extends Ay.InstrumentationBase{constructor(t={}){super(U0t,P0t,t)}init(){return[new Ay.InstrumentationNodeModuleDefinition("fastify",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_hookOnRequest(){let t=this;return function(r,o,i){if(!t.isEnabled())return i();t._wrap(o,"send",t._patchSend());let a=r,c=(0,Q4.getRPCMetadata)(Ke.active()),d=a.routeOptions?a.routeOptions.url:r.routerPath;d&&c?.type===Q4.RPCType.HTTP&&(c.route=d);let g=r.method||"GET";Cn().setTransactionName(`${g} ${d}`),i()}}_wrapHandler(t,n,r,o){let i=this;return this._diag.debug("Patching fastify route.handler function"),function(...a){if(!i.isEnabled())return r.apply(this,a);let c=r.name||t||l1e,d=`${jN.MIDDLEWARE} - ${c}`,g=a[1],h=_K(g,i.tracer,d,{[Cg.FASTIFY_TYPE]:GN.MIDDLEWARE,[Cg.PLUGIN_NAME]:t,[Cg.HOOK_NAME]:n}),S=o&&a[a.length-1];return S&&(a[a.length-1]=function(...y){U4(g),S.apply(this,y)}),Ke.with(Ht.setSpan(Ke.active(),h),()=>u1e(()=>r.apply(this,a),y=>{y instanceof Error&&(h.setStatus({code:ui.ERROR,message:y.message}),h.recordException(y)),o||U4(g)}))}}_wrapAddHook(){let t=this;return this._diag.debug("Patching fastify server.addHook function"),function(n){return function(...o){let i=o[0],a=o[1],c=this.pluginName;if(!L0t.has(i))return n.apply(this,o);let d=typeof o[o.length-1]=="function"&&a.constructor.name!=="AsyncFunction";return n.apply(this,[i,t._wrapHandler(c,i,a,d)])}}}_patchConstructor(t){let n=this;function r(...o){let i=t.fastify.apply(this,o);return i.addHook("onRequest",n._hookOnRequest()),i.addHook("preHandler",n._hookPreHandler()),Q0t(),n._wrap(i,"addHook",n._wrapAddHook()),i}return t.errorCodes!==void 0&&(r.errorCodes=t.errorCodes),r.fastify=r,r.default=r,r}_patchSend(){let t=this;return this._diag.debug("Patching fastify reply.send function"),function(r){return function(...i){let a=i[0];return t.isEnabled()?(0,Ay.safeExecuteInTheMiddle)(()=>r.apply(this,i),c=>{!c&&a instanceof Error&&(c=a),U4(this,c)}):r.apply(this,i)}}}_hookPreHandler(){let t=this;return this._diag.debug("Patching fastify preHandler function"),function(r,o,i){if(!t.isEnabled())return i();let a=r,c=a.routeOptions?.handler||a.context?.handler,d=c?.name.startsWith("bound ")?c.name.substring(6):c?.name,g=`${jN.REQUEST_HANDLER} - ${d||this.pluginName||l1e}`,h={[Cg.PLUGIN_NAME]:this.pluginName,[Cg.FASTIFY_TYPE]:GN.REQUEST_HANDLER,[s5]:a.routeOptions?a.routeOptions.url:r.routerPath};d&&(h[Cg.FASTIFY_NAME]=d);let S=_K(o,t.tracer,g,h);d1e(S);let{requestHook:y}=t.getConfig();return y&&(0,Ay.safeExecuteInTheMiddle)(()=>y(S,{request:r}),C=>{C&&t._diag.error("request hook failed",C)},!0),Ke.with(Ht.setSpan(Ke.active(),S),()=>{i()})}}}});import*as EK from"node:diagnostics_channel";function F0t(){let e=gt();if(e)return e.getIntegrationByName(F4)}function f1e(e,t,n,r){let o=F0t()?.getShouldHandleError()||_1e;if(r==="diagnostics-channel"&&(this.diagnosticsChannelExists=!0),this.diagnosticsChannelExists&&r==="onError-hook"){ya&&J.warn("Fastify error handler was already registered via diagnostics channel.","You can safely remove `setupFastifyErrorHandler` call and set `shouldHandleError` on the integration options.");return}o(e,t,n)&&tn(e,{mechanism:{handled:!1,type:"auto.function.fastify"}})}function _1e(e,t,n){let r=n.statusCode;return r>=500||r<=299}function E1e(e){let t=Ot(e),n=t.description,r=t.data,o=r["fastify.type"],i=o==="hook",a=o===n?.startsWith("handler -"),c=n==="request"||o==="request-handler";if(r[Zt]||!a&&!c&&!i)return;let d=i?"hook":a?"middleware":c?"request_handler":"<unknown>";e.setAttributes({[kt]:"auto.http.otel.fastify",[Zt]:`${d}.fastify`});let g=r["fastify.name"]||r["plugin.name"]||r["hook.name"];if(typeof g=="string"){let h=g.replace(/^fastify -> /,"").replace(/^@fastify\/otel -> /,"");e.updateName(h)}}function j0t(){let e=gt();e&&e.on("spanStart",t=>{E1e(t)})}function H0t(e){e.addHook("onRequest",async(t,n)=>{if(t.opentelemetry){let{span:i}=t.opentelemetry();i&&E1e(i)}let r=t.routeOptions?.url,o=t.method||"GET";Cn().setTransactionName(`${o} ${r}`)})}var A1e,F4,m1e,g1e,G0t,h1e,S1e=O(()=>{m();A1e=ie(o1e(),1);dt();mr();ly();p1e();F4="Fastify",m1e=st(`${F4}.v3`,()=>new L4);g1e=st(`${F4}.v5`,()=>{let e=new A1e.FastifyOtelInstrumentation,t=e.plugin();return EK.subscribe("fastify.initialization",n=>{let r=n.fastify;r?.register(t).after(o=>{o?ya&&J.error("Failed to setup Fastify instrumentation",o):(j0t(),r&&H0t(r))})}),EK.subscribe("tracing:fastify.request.handler:error",n=>{let{error:r,request:o,reply:i}=n;f1e.call(f1e,r,o,i,"diagnostics-channel")}),e}),G0t=({shouldHandleError:e})=>{let t;return{name:F4,setupOnce(){t=e||_1e,m1e(),g1e()},getShouldHandleError(){return t},setShouldHandleError(n){t=n}}},h1e=(e={})=>G0t(e)});var SK=F(sf=>{"use strict";m();Object.defineProperty(sf,"__esModule",{value:!0});sf.SpanNames=sf.TokenKind=sf.AllowedOperationTypes=void 0;var z0t;(function(e){e.QUERY="query",e.MUTATION="mutation",e.SUBSCRIPTION="subscription"})(z0t=sf.AllowedOperationTypes||(sf.AllowedOperationTypes={}));var $0t;(function(e){e.SOF="<SOF>",e.EOF="<EOF>",e.BANG="!",e.DOLLAR="$",e.AMP="&",e.PAREN_L="(",e.PAREN_R=")",e.SPREAD="...",e.COLON=":",e.EQUALS="=",e.AT="@",e.BRACKET_L="[",e.BRACKET_R="]",e.BRACE_L="{",e.PIPE="|",e.BRACE_R="}",e.NAME="Name",e.INT="Int",e.FLOAT="Float",e.STRING="String",e.BLOCK_STRING="BlockString",e.COMMENT="Comment"})($0t=sf.TokenKind||(sf.TokenKind={}));var V0t;(function(e){e.EXECUTE="graphql.execute",e.PARSE="graphql.parse",e.RESOLVE="graphql.resolve",e.VALIDATE="graphql.validate",e.SCHEMA_VALIDATE="graphql.validateSchema",e.SCHEMA_PARSE="graphql.parseSchema"})(V0t=sf.SpanNames||(sf.SpanNames={}))});var yK=F(zN=>{"use strict";m();Object.defineProperty(zN,"__esModule",{value:!0});zN.AttributeNames=void 0;var q0t;(function(e){e.SOURCE="graphql.source",e.FIELD_NAME="graphql.field.name",e.FIELD_PATH="graphql.field.path",e.FIELD_TYPE="graphql.field.type",e.PARENT_NAME="graphql.parent.name",e.OPERATION_TYPE="graphql.operation.type",e.OPERATION_NAME="graphql.operation.name",e.VARIABLES="graphql.variables.",e.ERROR_VALIDATION_NAME="graphql.validation.error"})(q0t=zN.AttributeNames||(zN.AttributeNames={}))});var G4=F(Tv=>{"use strict";m();Object.defineProperty(Tv,"__esModule",{value:!0});Tv.OTEL_GRAPHQL_DATA_SYMBOL=Tv.OTEL_PATCHED_SYMBOL=void 0;Tv.OTEL_PATCHED_SYMBOL=Symbol.for("opentelemetry.patched");Tv.OTEL_GRAPHQL_DATA_SYMBOL=Symbol.for("opentelemetry.graphql_data")});var y1e=F(j4=>{"use strict";m();Object.defineProperty(j4,"__esModule",{value:!0});j4.OPERATION_NOT_SUPPORTED=void 0;var zgn=G4();j4.OPERATION_NOT_SUPPORTED="Operation$operationName$not supported"});var M1e=F(Ta=>{"use strict";m();Object.defineProperty(Ta,"__esModule",{value:!0});Ta.wrapFieldResolver=Ta.wrapFields=Ta.getSourceFromLocation=Ta.getOperation=Ta.endSpan=Ta.addSpanSource=Ta.addInputVariableAttributes=Ta.isPromise=void 0;var Iv=(je(),Me(We)),H_=SK(),my=yK(),bg=G4(),T1e=Object.values(H_.AllowedOperationTypes),Y0t=e=>typeof e?.then=="function";Ta.isPromise=Y0t;var K0t=e=>typeof e=="object"&&e!==null;function TK(e,t,n){Array.isArray(n)?n.forEach((r,o)=>{TK(e,`${t}.${o}`,r)}):n instanceof Object?Object.entries(n).forEach(([r,o])=>{TK(e,`${t}.${r}`,o)}):e.setAttribute(`${my.AttributeNames.VARIABLES}${String(t)}`,n)}function J0t(e,t){Object.entries(t).forEach(([n,r])=>{TK(e,n,r)})}Ta.addInputVariableAttributes=J0t;function v1e(e,t,n,r,o){let i=N1e(t,n,r,o);e.setAttribute(my.AttributeNames.SOURCE,i)}Ta.addSpanSource=v1e;function Z0t(e,t,n,r,o){let i=R1e(n,o);if(i)return{field:i,spanAdded:!1};let c=t().flatResolveSpans?D1e(n):x1e(n,o);return i={span:W0t(e,t,n,r,o,c)},tSt(n,o,i),{field:i,spanAdded:!0}}function W0t(e,t,n,r,o,i){let a={[my.AttributeNames.FIELD_NAME]:r.fieldName,[my.AttributeNames.FIELD_PATH]:o.join("."),[my.AttributeNames.FIELD_TYPE]:r.returnType.toString(),[my.AttributeNames.PARENT_NAME]:r.parentType.name},c=e.startSpan(`${H_.SpanNames.RESOLVE} ${a[my.AttributeNames.FIELD_PATH]}`,{attributes:a},i?Iv.trace.setSpan(Iv.context.active(),i):void 0),d=n[bg.OTEL_GRAPHQL_DATA_SYMBOL].source,g=r.fieldNodes.find(h=>h.kind==="Field");return g&&v1e(c,d.loc,t().allowValues,g.loc?.start,g.loc?.end),c}function X0t(e,t){t&&e.recordException(t),e.end()}Ta.endSpan=X0t;function eSt(e,t){if(!(!e||!Array.isArray(e.definitions)))return t?e.definitions.filter(n=>T1e.indexOf(n?.operation)!==-1).find(n=>t===n?.name?.value):e.definitions.find(n=>T1e.indexOf(n?.operation)!==-1)}Ta.getOperation=eSt;function tSt(e,t,n){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]=n}function R1e(e,t){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].fields[t.join(".")]}function x1e(e,t){for(let n=t.length-1;n>0;n--){let r=R1e(e,t.slice(0,n));if(r)return r.span}return D1e(e)}function D1e(e){return e[bg.OTEL_GRAPHQL_DATA_SYMBOL].span}function nSt(e,t){let n=[],r=t;for(;r;){let o=r.key;e&&typeof o=="number"&&(o="*"),n.push(String(o)),r=r.prev}return n.reverse()}function rSt(e){return B1e(`
37
37
  `,e)}function I1e(e){return B1e(" ",e)}function B1e(e,t){let n="";for(let r=0;r<t;r++)n+=e;return n}var oSt=[H_.TokenKind.FLOAT,H_.TokenKind.STRING,H_.TokenKind.INT,H_.TokenKind.BLOCK_STRING];function N1e(e,t=!1,n,r){let o="";if(e?.startToken){let i=typeof n=="number"?n:e.start,a=typeof r=="number"?r:e.end,c=e.startToken.next,d=1;for(;c;){if(c.start<i){c=c.next,d=c?.line;continue}if(c.end>a){c=c.next,d=c?.line;continue}let g=c.value||c.kind,h="";!t&&oSt.indexOf(c.kind)>=0&&(g="*"),c.kind===H_.TokenKind.STRING&&(g=`"${g}"`),c.kind===H_.TokenKind.EOF&&(g=""),c.line>d?(o+=rSt(c.line-d),d=c.line,h=I1e(c.column-1)):c.line===c.prev?.line&&(h=I1e(c.start-(c.prev?.end||0))),o+=h+g,c&&(c=c.next)}}return o}Ta.getSourceFromLocation=N1e;function O1e(e,t,n){if(!e||e[bg.OTEL_PATCHED_SYMBOL])return;let r=e.getFields();e[bg.OTEL_PATCHED_SYMBOL]=!0,Object.keys(r).forEach(o=>{let i=r[o];if(i&&(i.resolve&&(i.resolve=k1e(t,n,i.resolve)),i.type)){let a=w1e(i.type);for(let c of a)O1e(c,t,n)}})}Ta.wrapFields=O1e;function w1e(e){return"ofType"in e?w1e(e.ofType):iSt(e)?e.getTypes():aSt(e)?[e]:[]}function iSt(e){return"getTypes"in e&&typeof e.getTypes=="function"}function aSt(e){return"getFields"in e&&typeof e.getFields=="function"}var C1e=(e,t,n)=>{n&&(e.recordException(t),e.setStatus({code:Iv.SpanStatusCode.ERROR,message:t.message}),e.end())},b1e=(e,t)=>{t&&e.end()};function k1e(e,t,n,r=!1){if(o[bg.OTEL_PATCHED_SYMBOL]||typeof n!="function")return n;function o(i,a,c,d){if(!n)return;let g=t();if(g.ignoreTrivialResolveSpans&&r&&(K0t(i)||typeof i=="function")&&typeof i[d.fieldName]!="function")return n.call(this,i,a,c,d);if(!c[bg.OTEL_GRAPHQL_DATA_SYMBOL])return n.call(this,i,a,c,d);let h=nSt(g.mergeItems,d&&d.path),S=h.filter(v=>typeof v=="string").length,y,C=!1;if(g.depth>=0&&g.depth<S)y=x1e(c,h);else{let{field:v,spanAdded:x}=Z0t(e,t,c,d,h);y=v.span,C=x}return Iv.context.with(Iv.trace.setSpan(Iv.context.active(),y),()=>{try{let v=n.call(this,i,a,c,d);return(0,Ta.isPromise)(v)?v.then(x=>(b1e(y,C),x),x=>{throw C1e(y,x,C),x}):(b1e(y,C),v)}catch(v){throw C1e(y,v,C),v}})}return o[bg.OTEL_PATCHED_SYMBOL]=!0,o}Ta.wrapFieldResolver=k1e});var P1e=F(Cv=>{"use strict";m();Object.defineProperty(Cv,"__esModule",{value:!0});Cv.PACKAGE_NAME=Cv.PACKAGE_VERSION=void 0;Cv.PACKAGE_VERSION="0.62.0";Cv.PACKAGE_NAME="@opentelemetry/instrumentation-graphql"});var Q1e=F($4=>{"use strict";m();Object.defineProperty($4,"__esModule",{value:!0});$4.GraphQLInstrumentation=void 0;var vg=(je(),Me(We)),Hd=rn(),$N=SK(),H4=yK(),IK=G4(),sSt=y1e(),ou=M1e(),U1e=P1e(),L1e={mergeItems:!1,depth:-1,allowValues:!1,ignoreResolveSpans:!1},z4=[">=14.0.0 <17"],CK=class extends Hd.InstrumentationBase{constructor(t={}){super(U1e.PACKAGE_NAME,U1e.PACKAGE_VERSION,{...L1e,...t})}setConfig(t={}){super.setConfig({...L1e,...t})}init(){let t=new Hd.InstrumentationNodeModuleDefinition("graphql",z4);return t.files.push(this._addPatchingExecute()),t.files.push(this._addPatchingParser()),t.files.push(this._addPatchingValidate()),t}_addPatchingExecute(){return new Hd.InstrumentationNodeModuleFile("graphql/execution/execute.js",z4,t=>((0,Hd.isWrapped)(t.execute)&&this._unwrap(t,"execute"),this._wrap(t,"execute",this._patchExecute(t.defaultFieldResolver)),t),t=>{t&&this._unwrap(t,"execute")})}_addPatchingParser(){return new Hd.InstrumentationNodeModuleFile("graphql/language/parser.js",z4,t=>((0,Hd.isWrapped)(t.parse)&&this._unwrap(t,"parse"),this._wrap(t,"parse",this._patchParse()),t),t=>{t&&this._unwrap(t,"parse")})}_addPatchingValidate(){return new Hd.InstrumentationNodeModuleFile("graphql/validation/validate.js",z4,t=>((0,Hd.isWrapped)(t.validate)&&this._unwrap(t,"validate"),this._wrap(t,"validate",this._patchValidate()),t),t=>{t&&this._unwrap(t,"validate")})}_patchExecute(t){let n=this;return function(o){return function(){let a;if(arguments.length>=2){let g=arguments;a=n._wrapExecuteArgs(g[0],g[1],g[2],g[3],g[4],g[5],g[6],g[7],t)}else{let g=arguments[0];a=n._wrapExecuteArgs(g.schema,g.document,g.rootValue,g.contextValue,g.variableValues,g.operationName,g.fieldResolver,g.typeResolver,t)}let c=(0,ou.getOperation)(a.document,a.operationName),d=n._createExecuteSpan(c,a);return a.contextValue[IK.OTEL_GRAPHQL_DATA_SYMBOL]={source:a.document?a.document||a.document[IK.OTEL_GRAPHQL_DATA_SYMBOL]:void 0,span:d,fields:{}},vg.context.with(vg.trace.setSpan(vg.context.active(),d),()=>(0,Hd.safeExecuteInTheMiddle)(()=>o.apply(this,[a]),(g,h)=>{n._handleExecutionResult(d,g,h)}))}}}_handleExecutionResult(t,n,r){let o=this.getConfig();if(r===void 0||n){(0,ou.endSpan)(t,n);return}if((0,ou.isPromise)(r))r.then(i=>{if(typeof o.responseHook!="function"){(0,ou.endSpan)(t);return}this._executeResponseHook(t,i)},i=>{(0,ou.endSpan)(t,i)});else{if(typeof o.responseHook!="function"){(0,ou.endSpan)(t);return}this._executeResponseHook(t,r)}}_executeResponseHook(t,n){let{responseHook:r}=this.getConfig();r&&(0,Hd.safeExecuteInTheMiddle)(()=>{r(t,n)},o=>{o&&this._diag.error("Error running response hook",o),(0,ou.endSpan)(t,void 0)},!0)}_patchParse(){let t=this;return function(r){return function(i,a){return t._parse(this,r,i,a)}}}_patchValidate(){let t=this;return function(r){return function(i,a,c,d,g){return t._validate(this,r,i,a,c,g,d)}}}_parse(t,n,r,o){let i=this.getConfig(),a=this.tracer.startSpan($N.SpanNames.PARSE);return vg.context.with(vg.trace.setSpan(vg.context.active(),a),()=>(0,Hd.safeExecuteInTheMiddle)(()=>n.call(t,r,o),(c,d)=>{d&&((0,ou.getOperation)(d)?d.loc&&(0,ou.addSpanSource)(a,d.loc,i.allowValues):a.updateName($N.SpanNames.SCHEMA_PARSE)),(0,ou.endSpan)(a,c)}))}_validate(t,n,r,o,i,a,c){let d=this.tracer.startSpan($N.SpanNames.VALIDATE,{});return vg.context.with(vg.trace.setSpan(vg.context.active(),d),()=>(0,Hd.safeExecuteInTheMiddle)(()=>n.call(t,r,o,i,c,a),(g,h)=>{o.loc||d.updateName($N.SpanNames.SCHEMA_VALIDATE),h&&h.length&&d.recordException({name:H4.AttributeNames.ERROR_VALIDATION_NAME,message:JSON.stringify(h)}),(0,ou.endSpan)(d,g)}))}_createExecuteSpan(t,n){let r=this.getConfig(),o=this.tracer.startSpan($N.SpanNames.EXECUTE,{});if(t){let{operation:i,name:a}=t;o.setAttribute(H4.AttributeNames.OPERATION_TYPE,i);let c=a?.value;c?(o.setAttribute(H4.AttributeNames.OPERATION_NAME,c),o.updateName(`${i} ${c}`)):o.updateName(i)}else{let i=" ";n.operationName&&(i=` "${n.operationName}" `),i=sSt.OPERATION_NOT_SUPPORTED.replace("$operationName$",i),o.setAttribute(H4.AttributeNames.OPERATION_NAME,i)}return n.document?.loc&&(0,ou.addSpanSource)(o,n.document.loc,r.allowValues),n.variableValues&&r.allowValues&&(0,ou.addInputVariableAttributes)(o,n.variableValues),o}_wrapExecuteArgs(t,n,r,o,i,a,c,d,g){if(o||(o={}),o[IK.OTEL_GRAPHQL_DATA_SYMBOL]||this.getConfig().ignoreResolveSpans)return{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:a,fieldResolver:c,typeResolver:d};let h=c==null,S=c??g;return c=(0,ou.wrapFieldResolver)(this.tracer,()=>this.getConfig(),S,h),t&&((0,ou.wrapFields)(t.getQueryType(),this.tracer,()=>this.getConfig()),(0,ou.wrapFields)(t.getMutationType(),this.tracer,()=>this.getConfig())),{schema:t,document:n,rootValue:r,contextValue:o,variableValues:i,operationName:a,fieldResolver:c,typeResolver:d}}};$4.GraphQLInstrumentation=CK});var F1e=F(V4=>{"use strict";m();Object.defineProperty(V4,"__esModule",{value:!0});V4.GraphQLInstrumentation=void 0;var uSt=Q1e();Object.defineProperty(V4,"GraphQLInstrumentation",{enumerable:!0,get:function(){return uSt.GraphQLInstrumentation}})});function $1e(e){return{ignoreResolveSpans:!0,ignoreTrivialResolveSpans:!0,useOperationNameForRootSpan:!0,...e}}function lSt(e){if(Array.isArray(e)){let t=e.slice().sort();return t.length<=5?t.join(", "):`${t.slice(0,5).join(", ")}, +${t.length-5}`}return`${e}`}var G1e,j1e,H1e,cSt,z1e,V1e=O(()=>{m();je();G1e=ie(F1e(),1);dt();mr();uv();j1e="Graphql",H1e=st(j1e,G1e.GraphQLInstrumentation,e=>{let t=$1e(e);return{...t,responseHook(n,r){Lr(n,"auto.graphql.otel.graphql"),r.errors?.length&&!Ot(n).status&&n.setStatus({code:ui.ERROR});let i=Ot(n).data,a=i["graphql.operation.type"],c=i["graphql.operation.name"];if(t.useOperationNameForRootSpan&&a){let d=ci(n),h=Ot(d).data[av]||[],S=c?`${a} ${c}`:`${a}`;Array.isArray(h)?(h.push(S),d.setAttribute(av,h)):typeof h=="string"?d.setAttribute(av,[h,S]):d.setAttribute(av,S),Ot(d).data["original-description"]||d.setAttribute("original-description",Ot(d).description),d.updateName(`${Ot(d).data["original-description"]} (${lSt(h)})`)}}}}),cSt=(e={})=>({name:j1e,setupOnce(){H1e($1e(e))}}),z1e=cSt});var q1e=F(q4=>{"use strict";m();Object.defineProperty(q4,"__esModule",{value:!0});q4.EVENT_LISTENERS_SET=void 0;q4.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.kafkajs.eventListenersSet")});var Y1e=F(Y4=>{"use strict";m();Object.defineProperty(Y4,"__esModule",{value:!0});Y4.bufferTextMapGetter=void 0;Y4.bufferTextMapGetter={get(e,t){if(!e)return;let n=Object.keys(e);for(let r of n)if(r===t||r.toLowerCase()===t)return e[r]?.toString()},keys(e){return e?Object.keys(e):[]}}});var K1e=F(nr=>{"use strict";m();Object.defineProperty(nr,"__esModule",{value:!0});nr.METRIC_MESSAGING_PROCESS_DURATION=nr.METRIC_MESSAGING_CLIENT_SENT_MESSAGES=nr.METRIC_MESSAGING_CLIENT_OPERATION_DURATION=nr.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES=nr.MESSAGING_SYSTEM_VALUE_KAFKA=nr.MESSAGING_OPERATION_TYPE_VALUE_SEND=nr.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE=nr.MESSAGING_OPERATION_TYPE_VALUE_PROCESS=nr.ATTR_MESSAGING_SYSTEM=nr.ATTR_MESSAGING_OPERATION_TYPE=nr.ATTR_MESSAGING_OPERATION_NAME=nr.ATTR_MESSAGING_KAFKA_OFFSET=nr.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE=nr.ATTR_MESSAGING_KAFKA_MESSAGE_KEY=nr.ATTR_MESSAGING_DESTINATION_PARTITION_ID=nr.ATTR_MESSAGING_DESTINATION_NAME=nr.ATTR_MESSAGING_BATCH_MESSAGE_COUNT=void 0;nr.ATTR_MESSAGING_BATCH_MESSAGE_COUNT="messaging.batch.message_count";nr.ATTR_MESSAGING_DESTINATION_NAME="messaging.destination.name";nr.ATTR_MESSAGING_DESTINATION_PARTITION_ID="messaging.destination.partition.id";nr.ATTR_MESSAGING_KAFKA_MESSAGE_KEY="messaging.kafka.message.key";nr.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE="messaging.kafka.message.tombstone";nr.ATTR_MESSAGING_KAFKA_OFFSET="messaging.kafka.offset";nr.ATTR_MESSAGING_OPERATION_NAME="messaging.operation.name";nr.ATTR_MESSAGING_OPERATION_TYPE="messaging.operation.type";nr.ATTR_MESSAGING_SYSTEM="messaging.system";nr.MESSAGING_OPERATION_TYPE_VALUE_PROCESS="process";nr.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE="receive";nr.MESSAGING_OPERATION_TYPE_VALUE_SEND="send";nr.MESSAGING_SYSTEM_VALUE_KAFKA="kafka";nr.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES="messaging.client.consumed.messages";nr.METRIC_MESSAGING_CLIENT_OPERATION_DURATION="messaging.client.operation.duration";nr.METRIC_MESSAGING_CLIENT_SENT_MESSAGES="messaging.client.sent.messages";nr.METRIC_MESSAGING_PROCESS_DURATION="messaging.process.duration"});var J1e=F(bv=>{"use strict";m();Object.defineProperty(bv,"__esModule",{value:!0});bv.PACKAGE_NAME=bv.PACKAGE_VERSION=void 0;bv.PACKAGE_VERSION="0.23.0";bv.PACKAGE_NAME="@opentelemetry/instrumentation-kafkajs"});var nBe=F(J4=>{"use strict";m();Object.defineProperty(J4,"__esModule",{value:!0});J4.KafkaJsInstrumentation=void 0;var Qr=(je(),Me(We)),zd=rn(),vv=(Zn(),Me(Ur)),Z1e=q1e(),W1e=Y1e(),At=K1e(),X1e=J1e();function K4(e,t,n){return r=>{e.add(t,{...n,...r?{[vv.ATTR_ERROR_TYPE]:r}:{}})}}function eBe(e,t,n){return r=>{e.record((Date.now()-t)/1e3,{...n,...r?{[vv.ATTR_ERROR_TYPE]:r}:{}})}}var tBe=[.005,.01,.025,.05,.075,.1,.25,.5,.75,1,2.5,5,7.5,10],bK=class extends zd.InstrumentationBase{constructor(t={}){super(X1e.PACKAGE_NAME,X1e.PACKAGE_VERSION,t)}_updateMetricInstruments(){this._clientDuration=this.meter.createHistogram(At.METRIC_MESSAGING_CLIENT_OPERATION_DURATION,{advice:{explicitBucketBoundaries:tBe}}),this._sentMessages=this.meter.createCounter(At.METRIC_MESSAGING_CLIENT_SENT_MESSAGES),this._consumedMessages=this.meter.createCounter(At.METRIC_MESSAGING_CLIENT_CONSUMED_MESSAGES),this._processDuration=this.meter.createHistogram(At.METRIC_MESSAGING_PROCESS_DURATION,{advice:{explicitBucketBoundaries:tBe}})}init(){let t=r=>{(0,zd.isWrapped)(r?.Kafka?.prototype.producer)&&this._unwrap(r.Kafka.prototype,"producer"),(0,zd.isWrapped)(r?.Kafka?.prototype.consumer)&&this._unwrap(r.Kafka.prototype,"consumer")};return new zd.InstrumentationNodeModuleDefinition("kafkajs",[">=0.3.0 <3"],r=>(t(r),this._wrap(r?.Kafka?.prototype,"producer",this._getProducerPatch()),this._wrap(r?.Kafka?.prototype,"consumer",this._getConsumerPatch()),r),t)}_getConsumerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,zd.isWrapped)(i.run)&&t._unwrap(i,"run"),t._wrap(i,"run",t._getConsumerRunPatch()),t._setKafkaEventListeners(i),i}}_setKafkaEventListeners(t){t[Z1e.EVENT_LISTENERS_SET]||(t.events?.REQUEST&&t.on(t.events.REQUEST,this._recordClientDurationMetric.bind(this)),t[Z1e.EVENT_LISTENERS_SET]=!0)}_recordClientDurationMetric(t){let[n,r]=t.payload.broker.split(":");this._clientDuration.record(t.payload.duration/1e3,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:`${t.payload.apiName}`,[vv.ATTR_SERVER_ADDRESS]:n,[vv.ATTR_SERVER_PORT]:Number.parseInt(r,10)})}_getProducerPatch(){let t=this;return n=>function(...o){let i=n.apply(this,o);return(0,zd.isWrapped)(i.sendBatch)&&t._unwrap(i,"sendBatch"),t._wrap(i,"sendBatch",t._getSendBatchPatch()),(0,zd.isWrapped)(i.send)&&t._unwrap(i,"send"),t._wrap(i,"send",t._getSendPatch()),(0,zd.isWrapped)(i.transaction)&&t._unwrap(i,"transaction"),t._wrap(i,"transaction",t._getProducerTransactionPatch()),t._setKafkaEventListeners(i),i}}_getConsumerRunPatch(){let t=this;return n=>function(...o){let i=o[0];return i?.eachMessage&&((0,zd.isWrapped)(i.eachMessage)&&t._unwrap(i,"eachMessage"),t._wrap(i,"eachMessage",t._getConsumerEachMessagePatch())),i?.eachBatch&&((0,zd.isWrapped)(i.eachBatch)&&t._unwrap(i,"eachBatch"),t._wrap(i,"eachBatch",t._getConsumerEachBatchPatch())),n.call(this,i)}}_getConsumerEachMessagePatch(){let t=this;return n=>function(...o){let i=o[0],a=Qr.propagation.extract(Qr.ROOT_CONTEXT,i.message.headers,W1e.bufferTextMapGetter),c=t._startConsumerSpan({topic:i.topic,message:i.message,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,ctx:a,attributes:{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}}),d=[eBe(t._processDuration,Date.now(),{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)}),K4(t._consumedMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.partition)})],g=Qr.context.with(Qr.trace.setSpan(a,c),()=>n.apply(this,o));return t._endSpansOnPromise([c],d,g)}}_getConsumerEachBatchPatch(){return t=>{let n=this;return function(...o){let i=o[0],a=n._startConsumerSpan({topic:i.batch.topic,message:void 0,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE,ctx:Qr.ROOT_CONTEXT,attributes:{[At.ATTR_MESSAGING_BATCH_MESSAGE_COUNT]:i.batch.messages.length,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}});return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),a),()=>{let c=Date.now(),d=[],g=[K4(n._consumedMessages,i.batch.messages.length,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)})];i.batch.messages.forEach(S=>{let y=Qr.propagation.extract(Qr.ROOT_CONTEXT,S.headers,W1e.bufferTextMapGetter),C=Qr.trace.getSpan(y)?.spanContext(),v;C&&(v={context:C}),d.push(n._startConsumerSpan({topic:i.batch.topic,message:S,operationType:At.MESSAGING_OPERATION_TYPE_VALUE_PROCESS,link:v,attributes:{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}})),g.push(eBe(n._processDuration,c,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"process",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.batch.topic,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(i.batch.partition)}))});let h=t.apply(this,o);return d.unshift(a),n._endSpansOnPromise(d,g,h)})}}}_getProducerTransactionPatch(){let t=this;return n=>function(...o){let i=t.tracer.startSpan("transaction"),a=n.apply(this,o);return a.then(c=>{let d=c.send;c.send=function(...C){return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),i),()=>t._getSendPatch()(d).apply(this,C).catch(x=>{throw i.setStatus({code:Qr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let g=c.sendBatch;c.sendBatch=function(...C){return Qr.context.with(Qr.trace.setSpan(Qr.context.active(),i),()=>t._getSendBatchPatch()(g).apply(this,C).catch(x=>{throw i.setStatus({code:Qr.SpanStatusCode.ERROR,message:x?.message}),i.recordException(x),x}))};let h=c.commit;c.commit=function(...C){let v=h.apply(this,C).then(()=>{i.setStatus({code:Qr.SpanStatusCode.OK})});return t._endSpansOnPromise([i],[],v)};let S=c.abort;c.abort=function(...C){let v=S.apply(this,C);return t._endSpansOnPromise([i],[],v)}}).catch(c=>{i.setStatus({code:Qr.SpanStatusCode.ERROR,message:c?.message}),i.recordException(c),i.end()}),a}}_getSendBatchPatch(){let t=this;return n=>function(...o){let a=o[0].topicMessages||[],c=[],d=[];a.forEach(h=>{h.messages.forEach(S=>{c.push(t._startProducerSpan(h.topic,S)),d.push(K4(t._sentMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_DESTINATION_NAME]:h.topic,...S.partition!==void 0?{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(S.partition)}:{}}))})});let g=n.apply(this,o);return t._endSpansOnPromise(c,d,g)}}_getSendPatch(){let t=this;return n=>function(...o){let i=o[0],a=i.messages.map(g=>t._startProducerSpan(i.topic,g)),c=i.messages.map(g=>K4(t._sentMessages,1,{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_DESTINATION_NAME]:i.topic,...g.partition!==void 0?{[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:String(g.partition)}:{}})),d=n.apply(this,o);return t._endSpansOnPromise(a,c,d)}}_endSpansOnPromise(t,n,r){return Promise.resolve(r).then(o=>(n.forEach(i=>i()),o)).catch(o=>{let i,a=vv.ERROR_TYPE_VALUE_OTHER;throw typeof o=="string"||o===void 0?i=o:typeof o=="object"&&Object.prototype.hasOwnProperty.call(o,"message")&&(i=o.message,a=o.constructor.name),n.forEach(c=>c(a)),t.forEach(c=>{c.setAttribute(vv.ATTR_ERROR_TYPE,a),c.setStatus({code:Qr.SpanStatusCode.ERROR,message:i})}),o}).finally(()=>{t.forEach(o=>o.end())})}_startConsumerSpan({topic:t,message:n,operationType:r,ctx:o,link:i,attributes:a}){let c=r===At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?"poll":r,d=this.tracer.startSpan(`${c} ${t}`,{kind:r===At.MESSAGING_OPERATION_TYPE_VALUE_RECEIVE?Qr.SpanKind.CLIENT:Qr.SpanKind.CONSUMER,attributes:{...a,[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_DESTINATION_NAME]:t,[At.ATTR_MESSAGING_OPERATION_TYPE]:r,[At.ATTR_MESSAGING_OPERATION_NAME]:c,[At.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n?.key?String(n.key):void 0,[At.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n?.key&&n.value===null?!0:void 0,[At.ATTR_MESSAGING_KAFKA_OFFSET]:n?.offset},links:i?[i]:[]},o),{consumerHook:g}=this.getConfig();return g&&n&&(0,zd.safeExecuteInTheMiddle)(()=>g(d,{topic:t,message:n}),h=>{h&&this._diag.error("consumerHook error",h)},!0),d}_startProducerSpan(t,n){let r=this.tracer.startSpan(`send ${t}`,{kind:Qr.SpanKind.PRODUCER,attributes:{[At.ATTR_MESSAGING_SYSTEM]:At.MESSAGING_SYSTEM_VALUE_KAFKA,[At.ATTR_MESSAGING_DESTINATION_NAME]:t,[At.ATTR_MESSAGING_KAFKA_MESSAGE_KEY]:n.key?String(n.key):void 0,[At.ATTR_MESSAGING_KAFKA_MESSAGE_TOMBSTONE]:n.key&&n.value===null?!0:void 0,[At.ATTR_MESSAGING_DESTINATION_PARTITION_ID]:n.partition!==void 0?String(n.partition):void 0,[At.ATTR_MESSAGING_OPERATION_NAME]:"send",[At.ATTR_MESSAGING_OPERATION_TYPE]:At.MESSAGING_OPERATION_TYPE_VALUE_SEND}});n.headers=n.headers??{},Qr.propagation.inject(Qr.trace.setSpan(Qr.context.active(),r),n.headers);let{producerHook:o}=this.getConfig();return o&&(0,zd.safeExecuteInTheMiddle)(()=>o(r,{topic:t,message:n}),i=>{i&&this._diag.error("producerHook error",i)},!0),r}};J4.KafkaJsInstrumentation=bK});var rBe=F(Z4=>{"use strict";m();Object.defineProperty(Z4,"__esModule",{value:!0});Z4.KafkaJsInstrumentation=void 0;var dSt=nBe();Object.defineProperty(Z4,"KafkaJsInstrumentation",{enumerable:!0,get:function(){return dSt.KafkaJsInstrumentation}})});var oBe,iBe,aBe,pSt,sBe,uBe=O(()=>{m();oBe=ie(rBe(),1);mr();iBe="Kafka",aBe=st(iBe,()=>new oBe.KafkaJsInstrumentation({consumerHook(e){Lr(e,"auto.kafkajs.otel.consumer")},producerHook(e){Lr(e,"auto.kafkajs.otel.producer")}})),pSt=()=>({name:iBe,setupOnce(){aBe()}}),sBe=pSt});var cBe=F(Rv=>{"use strict";m();Object.defineProperty(Rv,"__esModule",{value:!0});Rv.PACKAGE_NAME=Rv.PACKAGE_VERSION=void 0;Rv.PACKAGE_VERSION="0.58.0";Rv.PACKAGE_NAME="@opentelemetry/instrumentation-lru-memoizer"});var fBe=F(W4=>{"use strict";m();Object.defineProperty(W4,"__esModule",{value:!0});W4.LruMemoizerInstrumentation=void 0;var lBe=(je(),Me(We)),dBe=rn(),pBe=cBe(),vK=class extends dBe.InstrumentationBase{constructor(t={}){super(pBe.PACKAGE_NAME,pBe.PACKAGE_VERSION,t)}init(){return[new dBe.InstrumentationNodeModuleDefinition("lru-memoizer",[">=1.3 <4"],t=>{let n=function(){let r=t.apply(this,arguments);return function(){let o=[...arguments],i=o.pop(),a=typeof i=="function"?lBe.context.bind(lBe.context.active(),i):i;return o.push(a),r.apply(this,o)}};return n.sync=t.sync,n},void 0)]}};W4.LruMemoizerInstrumentation=vK});var ABe=F(X4=>{"use strict";m();Object.defineProperty(X4,"__esModule",{value:!0});X4.LruMemoizerInstrumentation=void 0;var fSt=fBe();Object.defineProperty(X4,"LruMemoizerInstrumentation",{enumerable:!0,get:function(){return fSt.LruMemoizerInstrumentation}})});var mBe,gBe,hBe,ASt,_Be,EBe=O(()=>{m();mBe=ie(ABe(),1);mr();gBe="LruMemoizer",hBe=st(gBe,()=>new mBe.LruMemoizerInstrumentation),ASt=()=>({name:gBe,setupOnce(){hBe()}}),_Be=ASt});var SBe=F(Bo=>{"use strict";m();Object.defineProperty(Bo,"__esModule",{value:!0});Bo.METRIC_DB_CLIENT_CONNECTIONS_USAGE=Bo.DB_SYSTEM_VALUE_MONGODB=Bo.DB_SYSTEM_NAME_VALUE_MONGODB=Bo.ATTR_NET_PEER_PORT=Bo.ATTR_NET_PEER_NAME=Bo.ATTR_DB_SYSTEM=Bo.ATTR_DB_STATEMENT=Bo.ATTR_DB_OPERATION=Bo.ATTR_DB_NAME=Bo.ATTR_DB_MONGODB_COLLECTION=Bo.ATTR_DB_CONNECTION_STRING=void 0;Bo.ATTR_DB_CONNECTION_STRING="db.connection_string";Bo.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";Bo.ATTR_DB_NAME="db.name";Bo.ATTR_DB_OPERATION="db.operation";Bo.ATTR_DB_STATEMENT="db.statement";Bo.ATTR_DB_SYSTEM="db.system";Bo.ATTR_NET_PEER_NAME="net.peer.name";Bo.ATTR_NET_PEER_PORT="net.peer.port";Bo.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb";Bo.DB_SYSTEM_VALUE_MONGODB="mongodb";Bo.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var yBe=F(VN=>{"use strict";m();Object.defineProperty(VN,"__esModule",{value:!0});VN.MongodbCommandType=void 0;var mSt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.AGGREGATE="aggregate",e.UNKNOWN="unknown"})(mSt=VN.MongodbCommandType||(VN.MongodbCommandType={}))});var TBe=F(xv=>{"use strict";m();Object.defineProperty(xv,"__esModule",{value:!0});xv.PACKAGE_NAME=xv.PACKAGE_VERSION=void 0;xv.PACKAGE_VERSION="0.67.0";xv.PACKAGE_NAME="@opentelemetry/instrumentation-mongodb"});var bBe=F(eF=>{"use strict";m();Object.defineProperty(eF,"__esModule",{value:!0});eF.MongoDBInstrumentation=void 0;var Yo=(je(),Me(We)),rr=rn(),Rg=(Zn(),Me(Ur)),Ul=SBe(),gy=yBe(),IBe=TBe(),CBe={requireParentSpan:!0},RK=class e extends rr.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(IBe.PACKAGE_NAME,IBe.PACKAGE_VERSION,{...CBe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,rr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,rr.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...CBe,...t})}_updateMetricInstruments(){this._connectionsUsage=this.meter.createUpDownCounter(Ul.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsage?.add(t,{"pool.name":n,state:r})}init(){let{v3PatchConnection:t,v3UnpatchConnection:n}=this._getV3ConnectionPatches(),{v4PatchConnect:r,v4UnpatchConnect:o}=this._getV4ConnectPatches(),{v4PatchConnectionCallback:i,v4PatchConnectionPromise:a,v4UnpatchConnection:c}=this._getV4ConnectionPatches(),{v4PatchConnectionPool:d,v4UnpatchConnectionPool:g}=this._getV4ConnectionPoolPatches(),{v4PatchSessions:h,v4UnpatchSessions:S}=this._getV4SessionsPatches();return[new rr.InstrumentationNodeModuleDefinition("mongodb",[">=3.3.0 <4"],void 0,void 0,[new rr.InstrumentationNodeModuleFile("mongodb/lib/core/wireprotocol/index.js",[">=3.3.0 <4"],t,n)]),new rr.InstrumentationNodeModuleDefinition("mongodb",[">=4.0.0 <8"],void 0,void 0,[new rr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=4.0.0 <6.4"],i,c),new rr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection.js",[">=6.4.0 <8"],a,c),new rr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connection_pool.js",[">=4.0.0 <6.4"],d,g),new rr.InstrumentationNodeModuleFile("mongodb/lib/cmap/connect.js",[">=4.0.0 <8"],r,o),new rr.InstrumentationNodeModuleFile("mongodb/lib/sessions.js",[">=4.0.0 <8"],h,S)])]}_getV3ConnectionPatches(){return{v3PatchConnection:t=>((0,rr.isWrapped)(t.insert)&&this._unwrap(t,"insert"),this._wrap(t,"insert",this._getV3PatchOperation("insert")),(0,rr.isWrapped)(t.remove)&&this._unwrap(t,"remove"),this._wrap(t,"remove",this._getV3PatchOperation("remove")),(0,rr.isWrapped)(t.update)&&this._unwrap(t,"update"),this._wrap(t,"update",this._getV3PatchOperation("update")),(0,rr.isWrapped)(t.command)&&this._unwrap(t,"command"),this._wrap(t,"command",this._getV3PatchCommand()),(0,rr.isWrapped)(t.query)&&this._unwrap(t,"query"),this._wrap(t,"query",this._getV3PatchFind()),(0,rr.isWrapped)(t.getMore)&&this._unwrap(t,"getMore"),this._wrap(t,"getMore",this._getV3PatchCursor()),t),v3UnpatchConnection:t=>{t!==void 0&&(this._unwrap(t,"insert"),this._unwrap(t,"remove"),this._unwrap(t,"update"),this._unwrap(t,"command"),this._unwrap(t,"query"),this._unwrap(t,"getMore"))}}}_getV4SessionsPatches(){return{v4PatchSessions:t=>((0,rr.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),this._wrap(t.ServerSessionPool.prototype,"acquire",this._getV4AcquireCommand()),(0,rr.isWrapped)(t.release)&&this._unwrap(t,"release"),this._wrap(t.ServerSessionPool.prototype,"release",this._getV4ReleaseCommand()),t),v4UnpatchSessions:t=>{t!==void 0&&((0,rr.isWrapped)(t.acquire)&&this._unwrap(t,"acquire"),(0,rr.isWrapped)(t.release)&&this._unwrap(t,"release"))}}}_getV4AcquireCommand(){let t=this;return n=>function(){let o=this.sessions.length,i=n.call(this),a=this.sessions.length;return o===a?t._connCountAdd(1,t._poolName,"used"):o-1===a&&(t._connCountAdd(-1,t._poolName,"idle"),t._connCountAdd(1,t._poolName,"used")),i}}_getV4ReleaseCommand(){let t=this;return n=>function(o){let i=n.call(this,o);return t._connCountAdd(-1,t._poolName,"used"),t._connCountAdd(1,t._poolName,"idle"),i}}_getV4ConnectionPoolPatches(){return{v4PatchConnectionPool:t=>{let n=t.ConnectionPool.prototype;return(0,rr.isWrapped)(n.checkOut)&&this._unwrap(n,"checkOut"),this._wrap(n,"checkOut",this._getV4ConnectionPoolCheckOut()),t},v4UnpatchConnectionPool:t=>{t!==void 0&&this._unwrap(t.ConnectionPool.prototype,"checkOut")}}}_getV4ConnectPatches(){return{v4PatchConnect:t=>((0,rr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),this._wrap(t,"connect",this._getV4ConnectCommand()),t),v4UnpatchConnect:t=>{t!==void 0&&this._unwrap(t,"connect")}}}_getV4ConnectionPoolCheckOut(){return t=>function(r){let o=Yo.context.bind(Yo.context.active(),r);return t.call(this,o)}}_getV4ConnectCommand(){let t=this;return n=>function(o,i){if(n.length===1){let c=n.call(this,o);return c&&typeof c.then=="function"&&c.then(()=>t.setPoolName(o),()=>{}),c}let a=function(c,d){if(c||!d){i(c,d);return}t.setPoolName(o),i(c,d)};return n.call(this,o,a)}}_getV4ConnectionPatches(){return{v4PatchConnectionCallback:t=>((0,rr.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandCallback()),t),v4PatchConnectionPromise:t=>((0,rr.isWrapped)(t.Connection.prototype.command)&&this._unwrap(t.Connection.prototype,"command"),this._wrap(t.Connection.prototype,"command",this._getV4PatchCommandPromise()),t),v4UnpatchConnection:t=>{t!==void 0&&this._unwrap(t.Connection.prototype,"command")}}}_getV3PatchOperation(t){let n=this;return r=>function(i,a,c,d,g){let h=Yo.trace.getSpan(Yo.context.active()),S=n._checkSkipInstrumentation(h),y=typeof d=="function"?d:g;if(S||typeof y!="function"||typeof c!="object")return typeof d=="function"?r.call(this,i,a,c,d):r.call(this,i,a,c,d,g);let C=n._getV3SpanAttributes(a,i,c[0],t),v=n._spanNameFromAttrs(C),x=n.tracer.startSpan(v,{kind:Yo.SpanKind.CLIENT,attributes:C}),N=n._patchEnd(x,y);return typeof d=="function"?r.call(this,i,a,c,N):r.call(this,i,a,c,d,N)}}_getV3PatchCommand(){let t=this;return n=>function(o,i,a,c,d){let g=Yo.trace.getSpan(Yo.context.active()),h=t._checkSkipInstrumentation(g),S=typeof c=="function"?c:d;if(h||typeof S!="function"||typeof a!="object")return typeof c=="function"?n.call(this,o,i,a,c):n.call(this,o,i,a,c,d);let y=e._getCommandType(a),C=y===gy.MongodbCommandType.UNKNOWN?void 0:y,v=t._getV3SpanAttributes(i,o,a,C),x=t._spanNameFromAttrs(v),N=t.tracer.startSpan(x,{kind:Yo.SpanKind.CLIENT,attributes:v}),k=t._patchEnd(N,S);return typeof c=="function"?n.call(this,o,i,a,k):n.call(this,o,i,a,c,k)}}_getV4PatchCommandCallback(){let t=this;return n=>function(o,i,a,c){let d=Yo.trace.getSpan(Yo.context.active()),g=t._checkSkipInstrumentation(d),h=c,S=Object.keys(i)[0];if(typeof i!="object"||i.ismaster||i.hello)return n.call(this,o,i,a,c);let y;if(!g){let v=t._getV4SpanAttributes(this,o,i,S),x=t._spanNameFromAttrs(v);y=t.tracer.startSpan(x,{kind:Yo.SpanKind.CLIENT,attributes:v})}let C=t._patchEnd(y,h,this.id,S);return n.call(this,o,i,a,C)}}_getV4PatchCommandPromise(){let t=this;return n=>function(...o){let[i,a]=o,c=Yo.trace.getSpan(Yo.context.active()),d=t._checkSkipInstrumentation(c),g=Object.keys(a)[0],h=()=>{};if(typeof a!="object"||a.ismaster||a.hello)return n.apply(this,o);let S;if(!d){let v=t._getV4SpanAttributes(this,i,a,g),x=t._spanNameFromAttrs(v);S=t.tracer.startSpan(x,{kind:Yo.SpanKind.CLIENT,attributes:v})}let y=t._patchEnd(S,h,this.id,g),C=n.apply(this,o);return C.then(v=>y(null,v),v=>y(v)),C}}_getV3PatchFind(){let t=this;return n=>function(o,i,a,c,d,g){let h=Yo.trace.getSpan(Yo.context.active()),S=t._checkSkipInstrumentation(h),y=typeof d=="function"?d:g;if(S||typeof y!="function"||typeof a!="object")return typeof d=="function"?n.call(this,o,i,a,c,d):n.call(this,o,i,a,c,d,g);let C=t._getV3SpanAttributes(i,o,a,"find"),v=t._spanNameFromAttrs(C),x=t.tracer.startSpan(v,{kind:Yo.SpanKind.CLIENT,attributes:C}),N=t._patchEnd(x,y);return typeof d=="function"?n.call(this,o,i,a,c,N):n.call(this,o,i,a,c,d,N)}}_getV3PatchCursor(){let t=this;return n=>function(o,i,a,c,d,g){let h=Yo.trace.getSpan(Yo.context.active()),S=t._checkSkipInstrumentation(h),y=typeof d=="function"?d:g;if(S||typeof y!="function")return typeof d=="function"?n.call(this,o,i,a,c,d):n.call(this,o,i,a,c,d,g);let C=t._getV3SpanAttributes(i,o,a.cmd,"getMore"),v=t._spanNameFromAttrs(C),x=t.tracer.startSpan(v,{kind:Yo.SpanKind.CLIENT,attributes:C}),N=t._patchEnd(x,y);return typeof d=="function"?n.call(this,o,i,a,c,N):n.call(this,o,i,a,c,d,N)}}static _getCommandType(t){return t.createIndexes!==void 0?gy.MongodbCommandType.CREATE_INDEXES:t.findandmodify!==void 0?gy.MongodbCommandType.FIND_AND_MODIFY:t.ismaster!==void 0?gy.MongodbCommandType.IS_MASTER:t.count!==void 0?gy.MongodbCommandType.COUNT:t.aggregate!==void 0?gy.MongodbCommandType.AGGREGATE:gy.MongodbCommandType.UNKNOWN}_getV4SpanAttributes(t,n,r,o){let i,a;if(t){let d=typeof t.address=="string"?t.address.split(":"):"";d.length===2&&(i=d[0],a=d[1])}let c;return r?.documents&&r.documents[0]?c=r.documents[0]:r?.cursors?c=r.cursors:c=r,this._getSpanAttributes(n.db,n.collection,i,a,c,o)}_getV3SpanAttributes(t,n,r,o){let i,a;if(n&&n.s&&(i=n.s.options?.host??n.s.host,a=(n.s.options?.port??n.s.port)?.toString(),i==null||a==null)){let h=n.description?.address;if(h){let S=h.split(":");i=S[0],a=S[1]}}let[c,d]=t.toString().split("."),g=r?.query??r?.q??r;return this._getSpanAttributes(c,d,i,a,g,o)}_getSpanAttributes(t,n,r,o,i,a){let c={};if(this._dbSemconvStability&rr.SemconvStability.OLD&&(c[Ul.ATTR_DB_SYSTEM]=Ul.DB_SYSTEM_VALUE_MONGODB,c[Ul.ATTR_DB_NAME]=t,c[Ul.ATTR_DB_MONGODB_COLLECTION]=n,c[Ul.ATTR_DB_OPERATION]=a,c[Ul.ATTR_DB_CONNECTION_STRING]=`mongodb://${r}:${o}/${t}`),this._dbSemconvStability&rr.SemconvStability.STABLE&&(c[Rg.ATTR_DB_SYSTEM_NAME]=Ul.DB_SYSTEM_NAME_VALUE_MONGODB,c[Rg.ATTR_DB_NAMESPACE]=t,c[Rg.ATTR_DB_OPERATION_NAME]=a,c[Rg.ATTR_DB_COLLECTION_NAME]=n),r&&o){this._netSemconvStability&rr.SemconvStability.OLD&&(c[Ul.ATTR_NET_PEER_NAME]=r),this._netSemconvStability&rr.SemconvStability.STABLE&&(c[Rg.ATTR_SERVER_ADDRESS]=r);let d=parseInt(o,10);isNaN(d)||(this._netSemconvStability&rr.SemconvStability.OLD&&(c[Ul.ATTR_NET_PEER_PORT]=d),this._netSemconvStability&rr.SemconvStability.STABLE&&(c[Rg.ATTR_SERVER_PORT]=d))}if(i){let{dbStatementSerializer:d}=this.getConfig(),g=typeof d=="function"?d:this._defaultDbStatementSerializer.bind(this);(0,rr.safeExecuteInTheMiddle)(()=>{let h=g(i);this._dbSemconvStability&rr.SemconvStability.OLD&&(c[Ul.ATTR_DB_STATEMENT]=h),this._dbSemconvStability&rr.SemconvStability.STABLE&&(c[Rg.ATTR_DB_QUERY_TEXT]=h)},h=>{h&&this._diag.error("Error running dbStatementSerializer hook",h)},!0)}return c}_spanNameFromAttrs(t){let n;return this._dbSemconvStability&rr.SemconvStability.STABLE?n=[t[Rg.ATTR_DB_OPERATION_NAME],t[Rg.ATTR_DB_COLLECTION_NAME]].filter(r=>r).join(" ")||Ul.DB_SYSTEM_NAME_VALUE_MONGODB:n=`mongodb.${t[Ul.ATTR_DB_OPERATION]||"command"}`,n}_getDefaultDbStatementReplacer(){let t=new WeakSet;return(n,r)=>typeof r!="object"||!r?"?":t.has(r)?"[Circular]":(t.add(r),r)}_defaultDbStatementSerializer(t){let{enhancedDatabaseReporting:n}=this.getConfig();return n?JSON.stringify(t):JSON.stringify(t,this._getDefaultDbStatementReplacer())}_handleExecutionResult(t,n){let{responseHook:r}=this.getConfig();typeof r=="function"&&(0,rr.safeExecuteInTheMiddle)(()=>{r(t,{data:n})},o=>{o&&this._diag.error("Error running response hook",o)},!0)}_patchEnd(t,n,r,o){let i=Yo.context.active(),a=this,c=!1;return function(...g){if(!c){c=!0;let h=g[0];if(t){if(h instanceof Error)t.setStatus({code:Yo.SpanStatusCode.ERROR,message:h.message});else{let S=g[1];a._handleExecutionResult(t,S)}t.end()}o==="endSessions"&&a._connCountAdd(-1,a._poolName,"idle")}return Yo.context.with(i,()=>n.apply(this,g))}}setPoolName(t){let n=t.hostAddress?.host,r=t.hostAddress?.port,o=t.dbName,i=`mongodb://${n}:${r}/${o}`;this._poolName=i}_checkSkipInstrumentation(t){return this.getConfig().requireParentSpan===!0&&t===void 0}};eF.MongoDBInstrumentation=RK});var vBe=F(qN=>{"use strict";m();Object.defineProperty(qN,"__esModule",{value:!0});qN.MongodbCommandType=void 0;var gSt;(function(e){e.CREATE_INDEXES="createIndexes",e.FIND_AND_MODIFY="findAndModify",e.IS_MASTER="isMaster",e.COUNT="count",e.UNKNOWN="unknown"})(gSt=qN.MongodbCommandType||(qN.MongodbCommandType={}))});var RBe=F(Dv=>{"use strict";m();Object.defineProperty(Dv,"__esModule",{value:!0});Dv.MongodbCommandType=Dv.MongoDBInstrumentation=void 0;var hSt=bBe();Object.defineProperty(Dv,"MongoDBInstrumentation",{enumerable:!0,get:function(){return hSt.MongoDBInstrumentation}});var _St=vBe();Object.defineProperty(Dv,"MongodbCommandType",{enumerable:!0,get:function(){return _St.MongodbCommandType}})});function ESt(e){let t=xK(e);return JSON.stringify(t)}function xK(e){if(Array.isArray(e))return e.map(t=>xK(t));if(SSt(e)){let t={};return Object.entries(e).map(([n,r])=>[n,xK(r)]).reduce((n,r)=>(TSt(r)&&(n[r[0]]=r[1]),n),t)}return"?"}function SSt(e){return typeof e=="object"&&e!==null&&!ySt(e)}function ySt(e){let t=!1;return typeof Buffer<"u"&&(t=Buffer.isBuffer(e)),t}function TSt(e){return Array.isArray(e)}var xBe,DBe,BBe,ISt,NBe,OBe=O(()=>{m();xBe=ie(RBe(),1);mr();DBe="Mongo",BBe=st(DBe,()=>new xBe.MongoDBInstrumentation({dbStatementSerializer:ESt,responseHook(e){Lr(e,"auto.db.otel.mongo")}}));ISt=()=>({name:DBe,setupOnce(){BBe()}}),NBe=ISt});var DK=F(ea=>{"use strict";m();Object.defineProperty(ea,"__esModule",{value:!0});ea.DB_SYSTEM_NAME_VALUE_MONGODB=ea.ATTR_NET_PEER_PORT=ea.ATTR_NET_PEER_NAME=ea.ATTR_DB_USER=ea.ATTR_DB_SYSTEM=ea.ATTR_DB_STATEMENT=ea.ATTR_DB_OPERATION=ea.ATTR_DB_NAME=ea.ATTR_DB_MONGODB_COLLECTION=void 0;ea.ATTR_DB_MONGODB_COLLECTION="db.mongodb.collection";ea.ATTR_DB_NAME="db.name";ea.ATTR_DB_OPERATION="db.operation";ea.ATTR_DB_STATEMENT="db.statement";ea.ATTR_DB_SYSTEM="db.system";ea.ATTR_DB_USER="db.user";ea.ATTR_NET_PEER_NAME="net.peer.name";ea.ATTR_NET_PEER_PORT="net.peer.port";ea.DB_SYSTEM_NAME_VALUE_MONGODB="mongodb"});var MBe=F(z_=>{"use strict";m();Object.defineProperty(z_,"__esModule",{value:!0});z_.handleCallbackResponse=z_.handlePromiseResponse=z_.getAttributesFromCollection=void 0;var wBe=(je(),Me(We)),KN=rn(),YN=DK(),tF=(Zn(),Me(Ur));function CSt(e,t,n){let r={};return t&KN.SemconvStability.OLD&&(r[YN.ATTR_DB_MONGODB_COLLECTION]=e.name,r[YN.ATTR_DB_NAME]=e.conn.name,r[YN.ATTR_DB_USER]=e.conn.user),t&KN.SemconvStability.STABLE&&(r[tF.ATTR_DB_COLLECTION_NAME]=e.name,r[tF.ATTR_DB_NAMESPACE]=e.conn.name),n&KN.SemconvStability.OLD&&(r[YN.ATTR_NET_PEER_NAME]=e.conn.host,r[YN.ATTR_NET_PEER_PORT]=e.conn.port),n&KN.SemconvStability.STABLE&&(r[tF.ATTR_SERVER_ADDRESS]=e.conn.host,r[tF.ATTR_SERVER_PORT]=e.conn.port),r}z_.getAttributesFromCollection=CSt;function kBe(e,t={}){e.recordException(t),e.setStatus({code:wBe.SpanStatusCode.ERROR,message:`${t.message} ${t.code?`
38
- Mongoose Error Code: ${t.code}`:""}`})}function BK(e,t,n,r=void 0){n&&(0,KN.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&wBe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function bSt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(BK(t,o,n,r),o)).catch(o=>{throw kBe(t,o),o}).finally(()=>t.end()):(BK(t,e,n,r),t.end(),e)}z_.handlePromiseResponse=bSt;function vSt(e,t,n,r,o,i,a=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(d,g)=>(d?kBe(r,d):BK(r,g,i,a),r.end(),e(d,g)),t.apply(n,o)}z_.handleCallbackResponse=vSt});var PBe=F(Bv=>{"use strict";m();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PACKAGE_NAME=Bv.PACKAGE_VERSION=void 0;Bv.PACKAGE_VERSION="0.60.0";Bv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var GBe=F(Uc=>{"use strict";m();Object.defineProperty(Uc,"__esModule",{value:!0});Uc.MongooseInstrumentation=Uc._ALREADY_INSTRUMENTED=Uc._STORED_PARENT_SPAN=void 0;var Ia=(je(),Me(We)),RSt=Tr(),NK=MBe(),Ns=rn(),UBe=PBe(),$_=DK(),hy=(Zn(),Me(Ur)),nF=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],xSt=["remove","count","findOneAndRemove",...nF],DSt=["count","findOneAndRemove",...nF],BSt=[...nF];function LBe(e){return e?e.startsWith("6.")||e.startsWith("5.")?xSt:e.startsWith("7.")?DSt:BSt:nF}function QBe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function FBe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Uc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Uc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var OK=class extends Ns.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(UBe.PACKAGE_NAME,UBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ns.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ns.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ns.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,QBe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),FBe(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),LBe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=LBe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,QBe(n)&&this._unwrap(r.Model.prototype,"remove"),FBe(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return r.apply(this,arguments);let a=this[Uc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ns.SemconvStability.OLD&&(c[$_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ns.SemconvStability.STABLE&&(c[hy.ATTR_DB_QUERY_TEXT]=h)}let g=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,a);return n._handleResponse(g,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Uc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return r.apply(this,arguments);let a=this[Uc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Ns.SemconvStability.OLD&&(c[$_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ns.SemconvStability.STABLE&&(c[hy.ATTR_DB_QUERY_TEXT]=h)}let g=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,a);return n._handleResponse(g,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(a,c){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);let d={document:this};a&&!(a instanceof Function)&&(d.options=a);let g={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,d);r._dbSemconvStability&Ns.SemconvStability.OLD&&(g[$_.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(g[hy.ATTR_DB_QUERY_TEXT]=y)}let S=r._startSpan(this.constructor.collection,this.constructor.modelName,t,g);return a instanceof Function&&(c=a,a=void 0),r._handleResponse(S,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);let g=d,h=a,S=c;typeof a=="function"?(g=a,h=void 0,S=void 0):typeof c=="function"&&(g=c,S=void 0);let y={},C=r.getConfig().dbStatementSerializer;if(C){let N=C(t,{condition:{_id:this._id},updates:h,options:S});r._dbSemconvStability&Ns.SemconvStability.OLD&&(y[$_.ATTR_DB_STATEMENT]=N),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(y[hy.ATTR_DB_QUERY_TEXT]=N)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),x=r._handleResponse(v,o,this,arguments,g,n);return x&&typeof x=="object"&&(x[Uc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(d=c,c=void 0);let g={};switch(t){case"insertMany":g.documents=a;break;case"bulkWrite":g.operations=a;break;default:g.document=a;break}c!==void 0&&(g.options=c);let h={},{dbStatementSerializer:S}=r.getConfig();if(S){let C=S(t,g);r._dbSemconvStability&Ns.SemconvStability.OLD&&(h[$_.ATTR_DB_STATEMENT]=C),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(h[hy.ATTR_DB_QUERY_TEXT]=C)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,d,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Ia.trace.getSpan(Ia.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Uc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Uc._STORED_PARENT_SPAN]=Ia.trace.getSpan(Ia.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let a={...o,...(0,NK.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ns.SemconvStability.OLD&&(a[$_.ATTR_DB_OPERATION]=r,a[$_.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ns.SemconvStability.STABLE&&(a[hy.ATTR_DB_OPERATION_NAME]=r,a[hy.ATTR_DB_SYSTEM_NAME]=$_.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Ns.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:Ia.SpanKind.CLIENT,attributes:a},i?Ia.trace.setSpan(Ia.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,a=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,NK.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,a));{let d=c._callOriginalFunction(()=>n.apply(r,o));return(0,NK.handlePromiseResponse)(d,t,c.getConfig().responseHook,a)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Ia.context.with((0,RSt.suppressTracing)(Ia.context.active()),t):t()}};Uc.MongooseInstrumentation=OK});var jBe=F(rF=>{"use strict";m();Object.defineProperty(rF,"__esModule",{value:!0});rF.MongooseInstrumentation=void 0;var NSt=GBe();Object.defineProperty(rF,"MongooseInstrumentation",{enumerable:!0,get:function(){return NSt.MongooseInstrumentation}})});var HBe,zBe,$Be,OSt,VBe,qBe=O(()=>{m();HBe=ie(jBe(),1);mr();zBe="Mongoose",$Be=st(zBe,()=>new HBe.MongooseInstrumentation({responseHook(e){Lr(e,"auto.db.otel.mongoose")}})),OSt=()=>({name:zBe,setupOnce(){$Be()}}),VBe=OSt});var YBe=F(ta=>{"use strict";m();Object.defineProperty(ta,"__esModule",{value:!0});ta.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ta.DB_SYSTEM_VALUE_MYSQL=ta.ATTR_NET_PEER_PORT=ta.ATTR_NET_PEER_NAME=ta.ATTR_DB_USER=ta.ATTR_DB_SYSTEM=ta.ATTR_DB_STATEMENT=ta.ATTR_DB_NAME=ta.ATTR_DB_CONNECTION_STRING=void 0;ta.ATTR_DB_CONNECTION_STRING="db.connection_string";ta.ATTR_DB_NAME="db.name";ta.ATTR_DB_STATEMENT="db.statement";ta.ATTR_DB_SYSTEM="db.system";ta.ATTR_DB_USER="db.user";ta.ATTR_NET_PEER_NAME="net.peer.name";ta.ATTR_NET_PEER_PORT="net.peer.port";ta.DB_SYSTEM_VALUE_MYSQL="mysql";ta.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var KBe=F(JN=>{"use strict";m();Object.defineProperty(JN,"__esModule",{value:!0});JN.AttributeNames=void 0;var wSt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(wSt=JN.AttributeNames||(JN.AttributeNames={}))});var JBe=F(iu=>{"use strict";m();Object.defineProperty(iu,"__esModule",{value:!0});iu.getPoolNameOld=iu.arrayStringifyHelper=iu.getSpanName=iu.getDbValues=iu.getDbQueryText=iu.getJDBCString=iu.getConfig=void 0;function kSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}iu.getConfig=kSt;function MSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}iu.getJDBCString=MSt;function PSt(e){return typeof e=="string"?e:e.sql}iu.getDbQueryText=PSt;function USt(e,t){return wK(typeof e=="string"?t:t||e.values)}iu.getDbValues=USt;function LSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}iu.getSpanName=LSt;function wK(e){return e?`[${e.toString()}]`:""}iu.arrayStringifyHelper=wK;function QSt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}iu.getPoolNameOld=QSt});var ZBe=F(Nv=>{"use strict";m();Object.defineProperty(Nv,"__esModule",{value:!0});Nv.PACKAGE_NAME=Nv.PACKAGE_VERSION=void 0;Nv.PACKAGE_VERSION="0.60.0";Nv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var XBe=F(oF=>{"use strict";m();Object.defineProperty(oF,"__esModule",{value:!0});oF.MySQLInstrumentation=void 0;var Lc=(je(),Me(We)),$d=rn(),Ov=(Zn(),Me(Ur)),xg=YBe(),FSt=KBe(),_y=JBe(),WBe=ZBe(),kK=class extends $d.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(WBe.PACKAGE_NAME,WBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$d.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,$d.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new $d.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,$d.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,$d.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,$d.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let a=t._allConnections.length,c=t._freeConnections.length,d=a-c,g=(0,_y.getPoolNameOld)(t);r._connCountAdd(-d,g,"used"),r._connCountAdd(-c,g,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,a){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let d=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),g=c[d].pool;r._setPoolCallbacks(g,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,a,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let d=r._getConnectionCallbackPatchFn(i);return n.call(t,d)}if(arguments.length===2&&typeof a=="function"){let d=r._getConnectionCallbackPatchFn(a);return n.call(t,i,d)}if(arguments.length===3&&typeof c=="function"){let d=r._getConnectionCallbackPatchFn(c);return n.call(t,i,a,d)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Lc.context.active();return function(o,i){i&&((0,$d.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Lc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,a){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:d,port:g,database:h,user:S}=(0,_y.getConfig)(t.config),y=parseInt(g,10),C=(0,_y.getDbQueryText)(o);r._dbSemconvStability&$d.SemconvStability.OLD&&(c[xg.ATTR_DB_SYSTEM]=xg.DB_SYSTEM_VALUE_MYSQL,c[xg.ATTR_DB_CONNECTION_STRING]=(0,_y.getJDBCString)(d,g,h),c[xg.ATTR_DB_NAME]=h,c[xg.ATTR_DB_USER]=S,c[xg.ATTR_DB_STATEMENT]=C),r._dbSemconvStability&$d.SemconvStability.STABLE&&(c[Ov.ATTR_DB_SYSTEM_NAME]=Ov.DB_SYSTEM_NAME_VALUE_MYSQL,c[Ov.ATTR_DB_NAMESPACE]=h,c[Ov.ATTR_DB_QUERY_TEXT]=C),r._netSemconvStability&$d.SemconvStability.OLD&&(c[xg.ATTR_NET_PEER_NAME]=d,isNaN(y)||(c[xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&$d.SemconvStability.STABLE&&(c[Ov.ATTR_SERVER_ADDRESS]=d,isNaN(y)||(c[Ov.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,_y.getSpanName)(o),{kind:Lc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(FSt.AttributeNames.MYSQL_VALUES,(0,_y.getDbValues)(o,k))}let x=Array.from(arguments).findIndex(k=>typeof k=="function"),N=Lc.context.active();if(x===-1){let k=Lc.context.with(Lc.trace.setSpan(Lc.context.active(),v),()=>n.apply(t,arguments));return Lc.context.bind(N,k),k.on("error",Q=>v.setStatus({code:Lc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,N)),Lc.context.with(Lc.trace.setSpan(Lc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,a){return o&&t.setStatus({code:Lc.SpanStatusCode.ERROR,message:o.message}),t.end(),Lc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,_y.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};oF.MySQLInstrumentation=kK});var eNe=F(iF=>{"use strict";m();Object.defineProperty(iF,"__esModule",{value:!0});iF.MySQLInstrumentation=void 0;var GSt=XBe();Object.defineProperty(iF,"MySQLInstrumentation",{enumerable:!0,get:function(){return GSt.MySQLInstrumentation}})});var tNe,nNe,rNe,jSt,oNe,iNe=O(()=>{m();tNe=ie(eNe(),1);mr();nNe="Mysql",rNe=st(nNe,()=>new tNe.MySQLInstrumentation({})),jSt=()=>({name:nNe,setupOnce(){rNe()}}),oNe=jSt});var MK=F(ts=>{"use strict";m();Object.defineProperty(ts,"__esModule",{value:!0});ts.DB_SYSTEM_VALUE_MYSQL=ts.ATTR_NET_PEER_PORT=ts.ATTR_NET_PEER_NAME=ts.ATTR_DB_USER=ts.ATTR_DB_SYSTEM=ts.ATTR_DB_STATEMENT=ts.ATTR_DB_NAME=ts.ATTR_DB_CONNECTION_STRING=void 0;ts.ATTR_DB_CONNECTION_STRING="db.connection_string";ts.ATTR_DB_NAME="db.name";ts.ATTR_DB_STATEMENT="db.statement";ts.ATTR_DB_SYSTEM="db.system";ts.ATTR_DB_USER="db.user";ts.ATTR_NET_PEER_NAME="net.peer.name";ts.ATTR_NET_PEER_PORT="net.peer.port";ts.DB_SYSTEM_VALUE_MYSQL="mysql"});var UK=F(aF=>{"use strict";m();Object.defineProperty(aF,"__esModule",{value:!0});aF.addSqlCommenterComment=void 0;var PK=(je(),Me(We)),HSt=Tr();function zSt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function $St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function VSt(e,t){if(typeof t!="string"||t.length===0||zSt(t))return t;let n=new HSt.W3CTraceContextPropagator,r={};n.inject(PK.trace.setSpan(PK.ROOT_CONTEXT,e),r,PK.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(a=>{let c=$St(r[a]);return`${a}='${c}'`}).join(",");return`${t} /*${i}*/`}aF.addSqlCommenterComment=VSt});var aNe=F(Vd=>{"use strict";m();Object.defineProperty(Vd,"__esModule",{value:!0});Vd.getConnectionPrototypeToInstrument=Vd.once=Vd.getSpanName=Vd.getQueryText=Vd.getConnectionAttributes=void 0;var ZN=MK(),sF=rn(),LK=(Zn(),Me(Ur));function qSt(e,t,n){let{host:r,port:o,database:i,user:a}=YSt(e),c={};t&sF.SemconvStability.OLD&&(c[ZN.ATTR_DB_CONNECTION_STRING]=KSt(r,o,i),c[ZN.ATTR_DB_NAME]=i,c[ZN.ATTR_DB_USER]=a),t&sF.SemconvStability.STABLE&&(c[LK.ATTR_DB_NAMESPACE]=i);let d=parseInt(o,10);return n&sF.SemconvStability.OLD&&(c[ZN.ATTR_NET_PEER_NAME]=r,isNaN(d)||(c[ZN.ATTR_NET_PEER_PORT]=d)),n&sF.SemconvStability.STABLE&&(c[LK.ATTR_SERVER_ADDRESS]=r,isNaN(d)||(c[LK.ATTR_SERVER_PORT]=d)),c}Vd.getConnectionAttributes=qSt;function YSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function KSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function JSt(e,t,n,r=!1,o=ZSt){let[i,a]=typeof e=="string"?[e,n]:[e.sql,WSt(e)?n||e.values:n];try{return r?o(i):t&&a?t(i,a):i}catch{return"Could not determine the query due to an error in masking or formatting"}}Vd.getQueryText=JSt;function ZSt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function WSt(e){return"values"in e}function XSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Vd.getSpanName=XSt;var eyt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Vd.once=eyt;function tyt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}Vd.getConnectionPrototypeToInstrument=tyt});var sNe=F(wv=>{"use strict";m();Object.defineProperty(wv,"__esModule",{value:!0});wv.PACKAGE_NAME=wv.PACKAGE_VERSION=void 0;wv.PACKAGE_VERSION="0.60.0";wv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var dNe=F(uF=>{"use strict";m();Object.defineProperty(uF,"__esModule",{value:!0});uF.MySQL2Instrumentation=void 0;var uNe=(je(),Me(We)),uf=rn(),QK=MK(),cNe=UK(),kv=aNe(),lNe=sNe(),FK=(Zn(),Me(Ur)),GK=[">=1.4.2 <4"],jK=class extends uf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lNe.PACKAGE_NAME,lNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,uf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,uf.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,uf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,uf.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new uf.InstrumentationNodeModuleDefinition("mysql2",GK,i=>(n(i),i),()=>{},[new uf.InstrumentationNodeModuleFile("mysql2/promise.js",GK,i=>(n(i),i),()=>{}),new uf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",GK,i=>{let a=(0,kv.getConnectionPrototypeToInstrument)(i);return r(a),i},i=>{if(i===void 0)return;let a=(0,kv.getConnectionPrototypeToInstrument)(i);o(a)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,a,c){let d;Array.isArray(a)?d=a:arguments[2]&&(d=[a]);let{maskStatement:g,maskStatementHook:h,responseHook:S}=o.getConfig(),y=(0,kv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),C=(0,kv.getQueryText)(i,t,d,g,h);o._dbSemconvStability&uf.SemconvStability.OLD&&(y[QK.ATTR_DB_SYSTEM]=QK.DB_SYSTEM_VALUE_MYSQL,y[QK.ATTR_DB_STATEMENT]=C),o._dbSemconvStability&uf.SemconvStability.STABLE&&(y[FK.ATTR_DB_SYSTEM_NAME]=FK.DB_SYSTEM_NAME_VALUE_MYSQL,y[FK.ATTR_DB_QUERY_TEXT]=C);let v=o.tracer.startSpan((0,kv.getSpanName)(i),{kind:uNe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,cNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,cNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,kv.once)((N,k)=>{N?v.setStatus({code:uNe.SpanStatusCode.ERROR,message:N.message}):typeof S=="function"&&(0,uf.safeExecuteInTheMiddle)(()=>{S(v,{queryResults:k})},Q=>{Q&&o._diag.warn("Failed executing responseHook",Q)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(x));let N=r.apply(this,arguments);return N.once("error",k=>{x(k)}).once("result",k=>{x(void 0,k)}),N}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(x)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(x)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};uF.MySQL2Instrumentation=jK});var pNe=F(cF=>{"use strict";m();Object.defineProperty(cF,"__esModule",{value:!0});cF.MySQL2Instrumentation=void 0;var nyt=dNe();Object.defineProperty(cF,"MySQL2Instrumentation",{enumerable:!0,get:function(){return nyt.MySQL2Instrumentation}})});var fNe,ANe,mNe,ryt,gNe,hNe=O(()=>{m();fNe=ie(pNe(),1);mr();ANe="Mysql2",mNe=st(ANe,()=>new fNe.MySQL2Instrumentation({responseHook(e){Lr(e,"auto.db.otel.mysql2")}})),ryt=()=>({name:ANe,setupOnce(){mNe()}}),gNe=ryt});var _Ne=F(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.DB_SYSTEM_VALUE_REDIS=au.DB_SYSTEM_NAME_VALUE_REDIS=au.ATTR_NET_PEER_PORT=au.ATTR_NET_PEER_NAME=au.ATTR_DB_SYSTEM=au.ATTR_DB_STATEMENT=au.ATTR_DB_CONNECTION_STRING=void 0;au.ATTR_DB_CONNECTION_STRING="db.connection_string";au.ATTR_DB_STATEMENT="db.statement";au.ATTR_DB_SYSTEM="db.system";au.ATTR_NET_PEER_NAME="net.peer.name";au.ATTR_NET_PEER_PORT="net.peer.port";au.DB_SYSTEM_NAME_VALUE_REDIS="redis";au.DB_SYSTEM_VALUE_REDIS="redis"});var ENe=F(lF=>{"use strict";m();Object.defineProperty(lF,"__esModule",{value:!0});lF.endSpan=void 0;var oyt=(je(),Me(We)),iyt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:oyt.SpanStatusCode.ERROR,message:t.message})),e.end()};lF.endSpan=iyt});var pF=F(dF=>{"use strict";m();Object.defineProperty(dF,"__esModule",{value:!0});dF.defaultDbStatementSerializer=void 0;var ayt=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],syt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=ayt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};dF.defaultDbStatementSerializer=syt});var SNe=F(Mv=>{"use strict";m();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.PACKAGE_NAME=Mv.PACKAGE_VERSION=void 0;Mv.PACKAGE_VERSION="0.62.0";Mv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var CNe=F(fF=>{"use strict";m();Object.defineProperty(fF,"__esModule",{value:!0});fF.IORedisInstrumentation=void 0;var V_=(je(),Me(We)),Qc=rn(),q_=(Zn(),Me(Ur)),Fc=_Ne(),yNe=rn(),WN=ENe(),uyt=pF(),TNe=SNe(),INe={requireParentSpan:!0},HK=class extends Qc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(TNe.PACKAGE_NAME,TNe.PACKAGE_VERSION,{...INe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Qc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Qc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...INe,...t})}init(){return[new Qc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Qc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Qc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),a=i.dbStatementSerializer||uyt.defaultDbStatementSerializer,c=V_.trace.getSpan(V_.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let d={},{host:g,port:h}=this.options,S=a(o.name,o.args);r._dbSemconvStability&Qc.SemconvStability.OLD&&(d[Fc.ATTR_DB_SYSTEM]=Fc.DB_SYSTEM_VALUE_REDIS,d[Fc.ATTR_DB_STATEMENT]=S,d[Fc.ATTR_DB_CONNECTION_STRING]=`redis://${g}:${h}`),r._dbSemconvStability&Qc.SemconvStability.STABLE&&(d[q_.ATTR_DB_SYSTEM_NAME]=Fc.DB_SYSTEM_NAME_VALUE_REDIS,d[q_.ATTR_DB_QUERY_TEXT]=S),r._netSemconvStability&Qc.SemconvStability.OLD&&(d[Fc.ATTR_NET_PEER_NAME]=g,d[Fc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Qc.SemconvStability.STABLE&&(d[q_.ATTR_SERVER_ADDRESS]=g,d[q_.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:V_.SpanKind.CLIENT,attributes:d}),{requestHook:C}=i;C&&(0,yNe.safeExecuteInTheMiddle)(()=>C(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&V_.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(k){(0,yNe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,k),Q=>{Q&&V_.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,WN.endSpan)(y,null),x(k)};let N=o.reject;return o.reject=function(k){(0,WN.endSpan)(y,k),N(k)},v}catch(v){throw(0,WN.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=V_.trace.getSpan(V_.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:a}=this.options;n._dbSemconvStability&Qc.SemconvStability.OLD&&(o[Fc.ATTR_DB_SYSTEM]=Fc.DB_SYSTEM_VALUE_REDIS,o[Fc.ATTR_DB_STATEMENT]="connect",o[Fc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${a}`),n._dbSemconvStability&Qc.SemconvStability.STABLE&&(o[q_.ATTR_DB_SYSTEM_NAME]=Fc.DB_SYSTEM_NAME_VALUE_REDIS,o[q_.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Qc.SemconvStability.OLD&&(o[Fc.ATTR_NET_PEER_NAME]=i,o[Fc.ATTR_NET_PEER_PORT]=a),n._netSemconvStability&Qc.SemconvStability.STABLE&&(o[q_.ATTR_SERVER_ADDRESS]=i,o[q_.ATTR_SERVER_PORT]=a);let c=n.tracer.startSpan("connect",{kind:V_.SpanKind.CLIENT,attributes:o});try{let d=t.apply(this,arguments);return(0,WN.endSpan)(c,null),d}catch(d){throw(0,WN.endSpan)(c,d),d}}}};fF.IORedisInstrumentation=HK});var bNe=F(AF=>{"use strict";m();Object.defineProperty(AF,"__esModule",{value:!0});AF.IORedisInstrumentation=void 0;var cyt=CNe();Object.defineProperty(AF,"IORedisInstrumentation",{enumerable:!0,get:function(){return cyt.IORedisInstrumentation}})});var mF=F(Pv=>{"use strict";m();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.PACKAGE_NAME=Pv.PACKAGE_VERSION=void 0;Pv.PACKAGE_VERSION="0.62.0";Pv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var vNe=F(Y_=>{"use strict";m();Object.defineProperty(Y_,"__esModule",{value:!0});Y_.getTracedCreateStreamTrace=Y_.getTracedCreateClient=Y_.endSpan=void 0;var XN=(je(),Me(We)),lyt=(e,t)=>{t&&e.setStatus({code:XN.SpanStatusCode.ERROR,message:t.message}),e.end()};Y_.endSpan=lyt;var dyt=e=>function(){let n=e.apply(this,arguments);return XN.context.bind(XN.context.active(),n)};Y_.getTracedCreateClient=dyt;var pyt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){XN.context.bind(XN.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};Y_.getTracedCreateStreamTrace=pyt});var gF=F(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.DB_SYSTEM_VALUE_REDIS=su.DB_SYSTEM_NAME_VALUE_REDIS=su.ATTR_NET_PEER_PORT=su.ATTR_NET_PEER_NAME=su.ATTR_DB_SYSTEM=su.ATTR_DB_STATEMENT=su.ATTR_DB_CONNECTION_STRING=void 0;su.ATTR_DB_CONNECTION_STRING="db.connection_string";su.ATTR_DB_STATEMENT="db.statement";su.ATTR_DB_SYSTEM="db.system";su.ATTR_NET_PEER_NAME="net.peer.name";su.ATTR_NET_PEER_PORT="net.peer.port";su.DB_SYSTEM_NAME_VALUE_REDIS="redis";su.DB_SYSTEM_VALUE_REDIS="redis"});var xNe=F(_F=>{"use strict";m();Object.defineProperty(_F,"__esModule",{value:!0});_F.RedisInstrumentationV2_V3=void 0;var Ll=rn(),hF=vNe(),RNe=mF(),eO=(je(),Me(We)),tO=(Zn(),Me(Ur)),Ey=gF(),fyt=pF(),zK=class e extends Ll.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(RNe.PACKAGE_NAME,RNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ll.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ll.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Ll.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Ll.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Ll.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Ll.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let a=t.getConfig(),c=eO.trace.getSpan(eO.context.active())===void 0;if(a.requireParentSpan===!0&&c)return r.apply(this,arguments);let d=a?.dbStatementSerializer||fyt.defaultDbStatementSerializer,g={};t._semconvStability&Ll.SemconvStability.OLD&&Object.assign(g,{[Ey.ATTR_DB_SYSTEM]:Ey.DB_SYSTEM_VALUE_REDIS,[Ey.ATTR_DB_STATEMENT]:d(i.command,i.args)}),t._semconvStability&Ll.SemconvStability.STABLE&&Object.assign(g,{[tO.ATTR_DB_SYSTEM_NAME]:Ey.DB_SYSTEM_NAME_VALUE_REDIS,[tO.ATTR_DB_OPERATION_NAME]:i.command,[tO.ATTR_DB_QUERY_TEXT]:d(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:eO.SpanKind.CLIENT,attributes:g});if(this.connection_options){let y={};t._semconvStability&Ll.SemconvStability.OLD&&Object.assign(y,{[Ey.ATTR_NET_PEER_NAME]:this.connection_options.host,[Ey.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Ll.SemconvStability.STABLE&&Object.assign(y,{[tO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[tO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Ll.SemconvStability.OLD&&h.setAttribute(Ey.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let S=arguments[0].callback;if(S){let y=eO.context.active();arguments[0].callback=function(v,x){if(a?.responseHook){let N=a.responseHook;(0,Ll.safeExecuteInTheMiddle)(()=>{N(h,i.command,i.args,x)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,hF.endSpan)(h,v),eO.context.with(y,S,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,hF.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,hF.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,hF.getTracedCreateStreamTrace)(n)}}};_F.RedisInstrumentationV2_V3=zK});var BNe=F(EF=>{"use strict";m();Object.defineProperty(EF,"__esModule",{value:!0});EF.getClientAttributes=void 0;var $K=(Zn(),Me(Ur)),Uv=gF(),DNe=rn();function Ayt(e,t,n){let r={};return n&DNe.SemconvStability.OLD&&Object.assign(r,{[Uv.ATTR_DB_SYSTEM]:Uv.DB_SYSTEM_VALUE_REDIS,[Uv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Uv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Uv.ATTR_DB_CONNECTION_STRING]:myt(e,t?.url)}),n&DNe.SemconvStability.STABLE&&Object.assign(r,{[$K.ATTR_DB_SYSTEM_NAME]:Uv.DB_SYSTEM_NAME_VALUE_REDIS,[$K.ATTR_SERVER_ADDRESS]:t?.socket?.host,[$K.ATTR_SERVER_PORT]:t?.socket?.port}),r}EF.getClientAttributes=Ayt;function myt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var kNe=F(SF=>{"use strict";m();Object.defineProperty(SF,"__esModule",{value:!0});SF.RedisInstrumentationV4_V5=void 0;var qd=(je(),Me(We)),So=rn(),NNe=BNe(),gyt=pF(),ONe=mF(),VK=(Zn(),Me(Ur)),hyt=gF(),nO=Symbol("opentelemetry.instrumentation.redis.open_spans"),wNe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),qK=class e extends So.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(ONe.PACKAGE_NAME,ONe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,So.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,So.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,a)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let d=a?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,So.isWrapped)(i?.[d])&&this._unwrap(i,d),this._wrap(i,d,this._getPatchExtendWithCommands(c)),i},i=>{(0,So.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,So.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return(0,So.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec(!1)),(0,So.isWrapped)(a?.execAsPipeline)&&this._unwrap(a,"execAsPipeline"),this._wrap(a,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,So.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let a=i?.default?.prototype;(0,So.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,So.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return a?.multi&&((0,So.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,So.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,So.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),i},i=>{let a=i?.default?.prototype;(0,So.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,So.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,So.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new So.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(a){if(a?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=a.executor;return a.executor=function(d,g){let h=t(d,g).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let a=o.apply(this,arguments);return typeof a?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),a):a.then(c=>{let d=this[nO];return n._endSpansWithRedisReplies(d,c,t),c}).catch(c=>{let d=this[nO];if(!d)n._diag.error("cannot find open spans to end for multi/pipeline");else{let g=c.constructor.name==="MultiErrorReply"?c.replies:new Array(d.length).fill(c);n._endSpansWithRedisReplies(d,g,t)}return Promise.reject(c)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[wNe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,a=(0,NNe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:qd.SpanKind.CLIENT,attributes:a});return qd.context.with(qd.trace.setSpan(qd.context.active(),c),()=>r.apply(this)).then(g=>(c.end(),g)).catch(g=>(c.recordException(g),c.setStatus({code:qd.SpanStatusCode.ERROR,message:g.message}),c.end(),Promise.reject(g)))}}}_traceClientCommand(t,n,r,o){if(qd.trace.getSpan(qd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let a=n.options||n[wNe],c=o[0],d=o.slice(1),g=this.getConfig().dbStatementSerializer||gyt.defaultDbStatementSerializer,h=(0,NNe.getClientAttributes)(this._diag,a,this._semconvStability);this._semconvStability&So.SemconvStability.STABLE&&(h[VK.ATTR_DB_OPERATION_NAME]=c);try{let C=g(c,d);C!=null&&(this._semconvStability&So.SemconvStability.OLD&&(h[hyt.ATTR_DB_STATEMENT]=C),this._semconvStability&So.SemconvStability.STABLE&&(h[VK.ATTR_DB_QUERY_TEXT]=C))}catch(C){this._diag.error("dbStatementSerializer throw an exception",C,{commandName:c})}let S=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:qd.SpanKind.CLIENT,attributes:h}),y=qd.context.with(qd.trace.setSpan(qd.context.active(),S),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(C=>{this._endSpanWithResponse(S,c,d,C,void 0)},C=>{this._endSpanWithResponse(S,c,d,null,C)});else{let C=y;C[nO]=C[nO]||[],C[nO].push({span:S,commandName:c,commandArgs:d})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(c=>c.commandName),a=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:d,commandArgs:g}=t[c],h=n[c],[S,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&So.SemconvStability.STABLE&&d.setAttribute(VK.ATTR_DB_OPERATION_NAME,a),this._endSpanWithResponse(d,o[c],g,S,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:a}=this.getConfig();if(!i&&a)try{a(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:qd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};SF.RedisInstrumentationV4_V5=qK});var UNe=F(yF=>{"use strict";m();Object.defineProperty(yF,"__esModule",{value:!0});yF.RedisInstrumentation=void 0;var _yt=rn(),MNe=mF(),Eyt=xNe(),Syt=kNe(),PNe={requireParentSpan:!1},YK=class extends _yt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...PNe,...t};super(MNe.PACKAGE_NAME,MNe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new Eyt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new Syt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...PNe,...t};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};yF.RedisInstrumentation=YK});var LNe=F(TF=>{"use strict";m();Object.defineProperty(TF,"__esModule",{value:!0});TF.RedisInstrumentation=void 0;var yyt=UNe();Object.defineProperty(TF,"RedisInstrumentation",{enumerable:!0,get:function(){return yyt.RedisInstrumentation}})});function rO(e,t){return e.includes(t.toLowerCase())}function JK(e){return rO(KK,e)?"cache.get":rO(Iyt,e)?"cache.put":void 0}function Cyt(e,t){return t.some(n=>e.startsWith(n))}function FNe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?QNe(o.map(i=>n(i))):["<unknown>"],r=t[0];return rO(Tyt,e)&&r!=null?n(r):QNe(t.map(o=>n(o)))}catch{return}}function GNe(e,t,n){if(!JK(e))return!1;for(let r of t)if(Cyt(r,n))return!0;return!1}function jNe(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function QNe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var Tyt,KK,Iyt,HNe=O(()=>{m();Tyt=["get","set","setex"],KK=["get","mget"],Iyt=["set","setex"]});var zNe,$Ne,IF,oO,VNe,byt,vyt,qNe,Ryt,YNe,KNe=O(()=>{m();zNe=ie(bNe(),1),$Ne=ie(LNe(),1);dt();mr();HNe();IF="Redis",oO={},VNe=(e,t,n,r)=>{e.setAttribute(kt,"auto.db.otel.redis");let o=FNe(t,n),i=JK(t);if(!o||!i||!oO.cachePrefixes||!GNe(t,o,oO.cachePrefixes))return;let a=Ot(e).data["net.peer.name"],c=Ot(e).data["net.peer.port"];c&&a&&e.setAttributes({"network.peer.address":a,"network.peer.port":c});let d=jNe(r);d&&e.setAttribute(eV,d),rO(KK,t)&&d!==void 0&&e.setAttribute(W9,d>0),e.setAttributes({[Zt]:i,[X9]:o});let g=o.join(", ");e.updateName(oO.maxCacheKeyLength?c_(g,oO.maxCacheKeyLength):g)},byt=st(`${IF}.IORedis`,()=>new zNe.IORedisInstrumentation({responseHook:VNe})),vyt=st(`${IF}.Redis`,()=>new $Ne.RedisInstrumentation({responseHook:VNe})),qNe=Object.assign(()=>{byt(),vyt()},{id:IF}),Ryt=(e={})=>({name:IF,setupOnce(){oO=e,qNe()}}),YNe=Ryt});var JNe=F(CF=>{"use strict";m();Object.defineProperty(CF,"__esModule",{value:!0});CF.EVENT_LISTENERS_SET=void 0;CF.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var ZK=F(iO=>{"use strict";m();Object.defineProperty(iO,"__esModule",{value:!0});iO.AttributeNames=void 0;var xyt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(xyt=iO.AttributeNames||(iO.AttributeNames={}))});var WK=F(xr=>{"use strict";m();Object.defineProperty(xr,"__esModule",{value:!0});xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=xr.METRIC_DB_CLIENT_CONNECTION_COUNT=xr.DB_SYSTEM_VALUE_POSTGRESQL=xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=xr.ATTR_NET_PEER_PORT=xr.ATTR_NET_PEER_NAME=xr.ATTR_DB_USER=xr.ATTR_DB_SYSTEM=xr.ATTR_DB_STATEMENT=xr.ATTR_DB_NAME=xr.ATTR_DB_CONNECTION_STRING=xr.ATTR_DB_CLIENT_CONNECTION_STATE=xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";xr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";xr.ATTR_DB_CONNECTION_STRING="db.connection_string";xr.ATTR_DB_NAME="db.name";xr.ATTR_DB_STATEMENT="db.statement";xr.ATTR_DB_SYSTEM="db.system";xr.ATTR_DB_USER="db.user";xr.ATTR_NET_PEER_NAME="net.peer.name";xr.ATTR_NET_PEER_PORT="net.peer.port";xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";xr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";xr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var XK=F(aO=>{"use strict";m();Object.defineProperty(aO,"__esModule",{value:!0});aO.SpanNames=void 0;var Dyt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(Dyt=aO.SpanNames||(aO.SpanNames={}))});var rOe=F(or=>{"use strict";m();Object.defineProperty(or,"__esModule",{value:!0});or.sanitizedErrorMessage=or.isObjectWithTextString=or.getErrorMessage=or.patchClientConnectCallback=or.patchCallbackPGPool=or.updateCounter=or.getPoolName=or.patchCallback=or.handleExecutionResult=or.handleConfigQuery=or.shouldSkipInstrumentation=or.getSemanticAttributesFromPoolConnection=or.getSemanticAttributesFromConnection=or.getConnectionString=or.parseAndMaskConnectionString=or.parseNormalizedOperationName=or.getQuerySpanName=void 0;var K_=(je(),Me(We)),bF=ZK(),Yd=(Zn(),Me(Ur)),pi=WK(),Sy=rn(),ZNe=XK();function WNe(e,t){if(!t)return ZNe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:XNe(t.text);return`${ZNe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}or.getQuerySpanName=WNe;function XNe(e){let t=e.trim(),n=t.indexOf(" "),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}or.parseNormalizedOperationName=XNe;function eOe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}or.parseAndMaskConnectionString=eOe;function eJ(e){if("connectionString"in e&&e.connectionString)return eOe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}or.getConnectionString=eJ;function vF(e){if(Number.isInteger(e))return e}function tOe(e,t){let n={};return t&Sy.SemconvStability.OLD&&(n={...n,[pi.ATTR_DB_SYSTEM]:pi.DB_SYSTEM_VALUE_POSTGRESQL,[pi.ATTR_DB_NAME]:e.database,[pi.ATTR_DB_CONNECTION_STRING]:eJ(e),[pi.ATTR_DB_USER]:e.user,[pi.ATTR_NET_PEER_NAME]:e.host,[pi.ATTR_NET_PEER_PORT]:vF(e.port)}),t&Sy.SemconvStability.STABLE&&(n={...n,[Yd.ATTR_DB_SYSTEM_NAME]:Yd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Yd.ATTR_DB_NAMESPACE]:e.namespace,[Yd.ATTR_SERVER_ADDRESS]:e.host,[Yd.ATTR_SERVER_PORT]:vF(e.port)}),n}or.getSemanticAttributesFromConnection=tOe;function Byt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[bF.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[bF.AttributeNames.MAX_CLIENT]:e.maxClient};return t&Sy.SemconvStability.OLD&&(r={...r,[pi.ATTR_DB_SYSTEM]:pi.DB_SYSTEM_VALUE_POSTGRESQL,[pi.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[pi.ATTR_DB_CONNECTION_STRING]:eJ(e),[pi.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[pi.ATTR_NET_PEER_PORT]:Number(n?.port)||vF(e.port),[pi.ATTR_DB_USER]:n?.username??e.user}),t&Sy.SemconvStability.STABLE&&(r={...r,[Yd.ATTR_DB_SYSTEM_NAME]:Yd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Yd.ATTR_DB_NAMESPACE]:e.namespace,[Yd.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[Yd.ATTR_SERVER_PORT]:Number(n?.port)||vF(e.port)}),r}or.getSemanticAttributesFromPoolConnection=Byt;function Nyt(e){return e.requireParentSpan===!0&&K_.trace.getSpan(K_.context.active())===void 0}or.shouldSkipInstrumentation=Nyt;function Oyt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,a=WNe(i,r),c=e.startSpan(a,{kind:K_.SpanKind.CLIENT,attributes:tOe(o,n)});if(!r)return c;if(r.text&&(n&Sy.SemconvStability.OLD&&c.setAttribute(pi.ATTR_DB_STATEMENT,r.text),n&Sy.SemconvStability.STABLE&&c.setAttribute(Yd.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let d=r.values.map(g=>g==null?"null":g instanceof Buffer?g.toString():typeof g=="object"?typeof g.toPostgres=="function"?g.toPostgres():JSON.stringify(g):g.toString());c.setAttribute(bF.AttributeNames.PG_VALUES,d)}catch(d){K_.diag.error("failed to stringify ",r.values,d)}return typeof r.name=="string"&&c.setAttribute(bF.AttributeNames.PG_PLAN,r.name),c}or.handleConfigQuery=Oyt;function nOe(e,t,n){typeof e.responseHook=="function"&&(0,Sy.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&K_.diag.error("Error running response hook",r)},!0)}or.handleExecutionResult=nOe;function wyt(e,t,n,r,o){return function(a,c){a?(Object.prototype.hasOwnProperty.call(a,"code")&&(r[Yd.ATTR_ERROR_TYPE]=a.code),a instanceof Error&&t.recordException(RF(a)),t.setStatus({code:K_.SpanStatusCode.ERROR,message:a.message})):nOe(e,t,c),o(),t.end(),n.call(this,a,c)}}or.patchCallback=wyt;function kyt(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}or.getPoolName=kyt;function Myt(e,t,n,r,o){let i=t.totalCount,a=t.waitingCount,c=t.idleCount,d=i-c;return n.add(d-o.used,{[pi.ATTR_DB_CLIENT_CONNECTION_STATE]:pi.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[pi.ATTR_DB_CLIENT_CONNECTION_STATE]:pi.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(a-o.pending,{[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:d,idle:c,pending:a}}or.updateCounter=Myt;function Pyt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(RF(r)),e.setStatus({code:K_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}or.patchCallbackPGPool=Pyt;function Uyt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(RF(r)),e.setStatus({code:K_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}or.patchClientConnectCallback=Uyt;function Lyt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}or.getErrorMessage=Lyt;function Qyt(e){return typeof e=="object"&&typeof e?.text=="string"}or.isObjectWithTextString=Qyt;function RF(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}or.sanitizedErrorMessage=RF});var oOe=F(Lv=>{"use strict";m();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.PACKAGE_NAME=Lv.PACKAGE_VERSION=void 0;Lv.PACKAGE_VERSION="0.66.0";Lv.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var lOe=F(DF=>{"use strict";m();Object.defineProperty(DF,"__esModule",{value:!0});DF.PgInstrumentation=void 0;var Hu=rn(),Fr=(je(),Me(We)),iOe=JNe(),Ko=rOe(),aOe=UK(),sOe=oOe(),uOe=XK(),xF=Tr(),cf=(Zn(),Me(Ur)),sO=WK();function Qv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var tJ=class extends Hu.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(sOe.PACKAGE_NAME,sOe.PACKAGE_VERSION,t),this._semconvStability=(0,Hu.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(cf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Fr.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Hu.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Hu.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new Hu.InstrumentationNodeModuleDefinition("pg",t,c=>{let d=Qv(c);return this._patchPgClient(d.Client),c},c=>{let d=Qv(c);return this._unpatchPgClient(d.Client),c},[o,r]),a=new Hu.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let d=Qv(c);return(0,Hu.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect"),this._wrap(d.prototype,"connect",this._getPoolConnectPatch()),d},c=>{let d=Qv(c);(0,Hu.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect")});return[i,a]}_patchPgClient(t){if(!t)return;let n=Qv(t);return(0,Hu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Hu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=Qv(t);return(0,Hu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Hu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Ko.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(uOe.SpanNames.CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Ko.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Ko.patchClientConnectCallback(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return cOe(a,c)}}recordOperationDuration(t,n){let r={},o=[cf.ATTR_DB_NAMESPACE,cf.ATTR_ERROR_TYPE,cf.ATTR_SERVER_PORT,cf.ATTR_SERVER_ADDRESS,cf.ATTR_DB_OPERATION_NAME];this._semconvStability&Hu.SemconvStability.OLD&&o.push(sO.ATTR_DB_SYSTEM),this._semconvStability&Hu.SemconvStability.STABLE&&o.push(cf.ATTR_DB_SYSTEM_NAME),o.forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,xF.hrTimeToMilliseconds)((0,xF.hrTimeDuration)(n,(0,xF.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Ko.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,xF.hrTime)(),a=o[0],c=typeof a=="string",d=Ko.isObjectWithTextString(a),g=c?{text:a,values:Array.isArray(o[1])?o[1]:void 0}:d?{...a,name:a.name,text:a.text,values:a.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[sO.ATTR_DB_SYSTEM]:sO.DB_SYSTEM_VALUE_POSTGRESQL,[cf.ATTR_DB_NAMESPACE]:this.database,[cf.ATTR_SERVER_PORT]:this.connectionParameters.port,[cf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};g?.text&&(h[cf.ATTR_DB_OPERATION_NAME]=Ko.parseNormalizedOperationName(g?.text));let S=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),C=Ko.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,g);if(y.addSqlCommenterCommentToQueries&&(c?o[0]=(0,aOe.addSqlCommenterComment)(C,a):d&&!("name"in a)&&(o[0]={...a,text:(0,aOe.addSqlCommenterComment)(C,a.text)})),o.length>0){let N=Fr.trace.getSpan(Fr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Ko.patchCallback(y,C,o[o.length-1],h,S),N&&(o[o.length-1]=Fr.context.bind(Fr.context.active(),o[o.length-1]));else if(typeof g?.callback=="function"){let k=Ko.patchCallback(t.getConfig(),C,g.callback,h,S);N&&(k=Fr.context.bind(Fr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=y;typeof v=="function"&&g&&(0,Hu.safeExecuteInTheMiddle)(()=>{let{database:N,host:k,port:Q,user:j}=this.connectionParameters;v(C,{connection:{database:N,host:k,port:Q,user:j},query:{text:g.text,values:g.values,name:g.name}})},N=>{N&&t._diag.error("Error running query hook",N)},!0);let x;try{x=n.apply(this,o)}catch(N){throw N instanceof Error&&C.recordException(Ko.sanitizedErrorMessage(N)),C.setStatus({code:Fr.SpanStatusCode.ERROR,message:Ko.getErrorMessage(N)}),C.end(),N}return x instanceof Promise?x.then(N=>new Promise(k=>{Ko.handleExecutionResult(t.getConfig(),C,N),S(),C.end(),k(N)})).catch(N=>new Promise((k,Q)=>{N instanceof Error&&C.recordException(Ko.sanitizedErrorMessage(N)),C.setStatus({code:Fr.SpanStatusCode.ERROR,message:N.message}),S(),C.end(),Q(N)})):x})}_setPoolConnectEventListeners(t){if(t[iOe.EVENT_LISTENERS_SET])return;let n=Ko.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[iOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Ko.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(uOe.SpanNames.POOL_CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Ko.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Ko.patchCallbackPGPool(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return cOe(a,c)}}};DF.PgInstrumentation=tJ;function cOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Fr.context.bind(Fr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Ko.sanitizedErrorMessage(r)),e.setStatus({code:Fr.SpanStatusCode.ERROR,message:Ko.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var dOe=F(Fv=>{"use strict";m();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.AttributeNames=Fv.PgInstrumentation=void 0;var Fyt=lOe();Object.defineProperty(Fv,"PgInstrumentation",{enumerable:!0,get:function(){return Fyt.PgInstrumentation}});var Gyt=ZK();Object.defineProperty(Fv,"AttributeNames",{enumerable:!0,get:function(){return Gyt.AttributeNames}})});var pOe,fOe,AOe,jyt,mOe,gOe=O(()=>{m();pOe=ie(dOe(),1);mr();fOe="Postgres",AOe=st(fOe,pOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Lr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),jyt=e=>({name:fOe,setupOnce(){AOe(e)}}),mOe=jyt});var J_,rJ,hOe,Hyt,zyt,_Oe,nJ,$yt,EOe,SOe=O(()=>{m();je();J_=ie(rn(),1);Zn();dt();mr();ly();rJ="PostgresJs",hOe=[">=3.0.0 <4"],Hyt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,zyt=Symbol.for("sentry.query.from.instrumented.sql"),_Oe=st(rJ,e=>new nJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),nJ=class extends J_.InstrumentationBase{constructor(t){super("sentry-postgres-js",Wn,t)}init(){let t=new J_.InstrumentationNodeModuleDefinition("postgres",hOe,n=>{try{return this._patchPostgres(n)}catch(r){return ya&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new J_.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,hOe,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return ya&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...a){let c=Reflect.construct(r,a);if(!c||typeof c!="function")return ya&&J.warn("postgres() did not return a valid instance"),c;let d=o.getConfig();return nq(c,{requireParentSpan:d.requireParentSpan,requestHook:d.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}return n?i:(nN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Ht.getSpan(Ke.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(VC,r);return}let o=n?.match(Hyt);o?.[1]&&t.setAttribute(VC,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[zyt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),a=n._sanitizeSqlQuery(i);return Za({name:a||"postgresjs.query",op:"db"},c=>{Lr(c,"auto.db.postgresjs"),c.setAttributes({[DS]:"postgres",[A5]:a});let d=n.getConfig(),{requestHook:g}=d;g&&(0,J_.safeExecuteInTheMiddle)(()=>g(c,a,void 0),y=>{y&&(c.setAttribute("sentry.hook.error","requestHook failed"),ya&&J.error(`Error in requestHook for ${rJ} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,C,v)=>{try{n._setOperationName(c,a,v?.[0]?.command),c.end()}catch(x){ya&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(y,C,v)}});let S=this.reject;this.reject=new Proxy(S,{apply:(y,C,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(m5,v?.[0]?.code||"unknown"),c.setAttribute(g5,v?.[0]?.name||"unknown"),n._setOperationName(c,a),c.end()}catch(x){ya&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(y,C,v)}});try{return r.apply(this,o)}catch(y){throw c.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),c.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},$yt=e=>({name:rJ,setupOnce(){_Oe(e)}}),EOe=$yt});var yOe=F(uO=>{"use strict";m();Object.defineProperty(uO,"__esModule",{value:!0});uO.SeverityNumber=void 0;var Vyt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Vyt=uO.SeverityNumber||(uO.SeverityNumber={}))});var NF=F(Gv=>{"use strict";m();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.NOOP_LOGGER=Gv.NoopLogger=void 0;var BF=class{emit(t){}};Gv.NoopLogger=BF;Gv.NOOP_LOGGER=new BF});var wF=F(jv=>{"use strict";m();Object.defineProperty(jv,"__esModule",{value:!0});jv.NOOP_LOGGER_PROVIDER=jv.NoopLoggerProvider=void 0;var qyt=NF(),OF=class{getLogger(t,n,r){return new qyt.NoopLogger}};jv.NoopLoggerProvider=OF;jv.NOOP_LOGGER_PROVIDER=new OF});var iJ=F(kF=>{"use strict";m();Object.defineProperty(kF,"__esModule",{value:!0});kF.ProxyLogger=void 0;var Yyt=NF(),oJ=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Yyt.NOOP_LOGGER}};kF.ProxyLogger=oJ});var sJ=F(MF=>{"use strict";m();Object.defineProperty(MF,"__esModule",{value:!0});MF.ProxyLoggerProvider=void 0;var Kyt=wF(),Jyt=iJ(),aJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Jyt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Kyt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};MF.ProxyLoggerProvider=aJ});var TOe=F(PF=>{"use strict";m();Object.defineProperty(PF,"__esModule",{value:!0});PF._globalThis=void 0;PF._globalThis=typeof globalThis=="object"?globalThis:global});var IOe=F(UF=>{"use strict";m();Object.defineProperty(UF,"__esModule",{value:!0});UF._globalThis=void 0;var Zyt=TOe();Object.defineProperty(UF,"_globalThis",{enumerable:!0,get:function(){return Zyt._globalThis}})});var COe=F(LF=>{"use strict";m();Object.defineProperty(LF,"__esModule",{value:!0});LF._globalThis=void 0;var Wyt=IOe();Object.defineProperty(LF,"_globalThis",{enumerable:!0,get:function(){return Wyt._globalThis}})});var bOe=F(MA=>{"use strict";m();Object.defineProperty(MA,"__esModule",{value:!0});MA.API_BACKWARDS_COMPATIBILITY_VERSION=MA.makeGetter=MA._global=MA.GLOBAL_LOGS_API_KEY=void 0;var Xyt=COe();MA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");MA._global=Xyt._globalThis;function eTt(e,t,n){return r=>r===e?t:n}MA.makeGetter=eTt;MA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var ROe=F(QF=>{"use strict";m();Object.defineProperty(QF,"__esModule",{value:!0});QF.LogsAPI=void 0;var Kd=bOe(),tTt=wF(),vOe=sJ(),uJ=class e{constructor(){this._proxyLoggerProvider=new vOe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Kd._global[Kd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Kd._global[Kd.GLOBAL_LOGS_API_KEY]=(0,Kd.makeGetter)(Kd.API_BACKWARDS_COMPATIBILITY_VERSION,t,tTt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Kd._global[Kd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Kd._global,Kd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Kd._global[Kd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new vOe.ProxyLoggerProvider}};QF.LogsAPI=uJ});var cJ=F(ns=>{"use strict";m();Object.defineProperty(ns,"__esModule",{value:!0});ns.logs=ns.ProxyLoggerProvider=ns.ProxyLogger=ns.NoopLoggerProvider=ns.NOOP_LOGGER_PROVIDER=ns.NoopLogger=ns.NOOP_LOGGER=ns.SeverityNumber=void 0;var nTt=yOe();Object.defineProperty(ns,"SeverityNumber",{enumerable:!0,get:function(){return nTt.SeverityNumber}});var xOe=NF();Object.defineProperty(ns,"NOOP_LOGGER",{enumerable:!0,get:function(){return xOe.NOOP_LOGGER}});Object.defineProperty(ns,"NoopLogger",{enumerable:!0,get:function(){return xOe.NoopLogger}});var DOe=wF();Object.defineProperty(ns,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return DOe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ns,"NoopLoggerProvider",{enumerable:!0,get:function(){return DOe.NoopLoggerProvider}});var rTt=iJ();Object.defineProperty(ns,"ProxyLogger",{enumerable:!0,get:function(){return rTt.ProxyLogger}});var oTt=sJ();Object.defineProperty(ns,"ProxyLoggerProvider",{enumerable:!0,get:function(){return oTt.ProxyLoggerProvider}});var iTt=ROe();ns.logs=iTt.LogsAPI.getInstance()});var BOe=F(Hv=>{"use strict";m();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.disableInstrumentations=Hv.enableInstrumentations=void 0;function aTt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}Hv.enableInstrumentations=aTt;function sTt(e){e.forEach(t=>t.disable())}Hv.disableInstrumentations=sTt});var wOe=F(FF=>{"use strict";m();Object.defineProperty(FF,"__esModule",{value:!0});FF.registerInstrumentations=void 0;var NOe=(je(),Me(We)),uTt=cJ(),OOe=BOe();function cTt(e){let t=e.tracerProvider||NOe.trace.getTracerProvider(),n=e.meterProvider||NOe.metrics.getMeterProvider(),r=e.loggerProvider||uTt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,OOe.enableInstrumentations)(o,t,n,r),()=>{(0,OOe.disableInstrumentations)(o)}}FF.registerInstrumentations=cTt});var jOe=F(GF=>{"use strict";m();Object.defineProperty(GF,"__esModule",{value:!0});GF.satisfies=void 0;var fJ=(je(),Me(We)),LOe=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,lTt=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,dTt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function pTt(e,t,n){if(!fTt(e))return fJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=hTt(e);if(!r)return!1;let o=[],i=QOe(r,t,o,n);return i&&!n?.includePrerelease?mTt(r,o):i}GF.satisfies=pTt;function fTt(e){return typeof e=="string"&&LOe.test(e)}function QOe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(lJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=LTt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!lJ(e,i,n,r))return!1;return!0}return lJ(e,t,n,r)}function lJ(e,t,n,r){if(t=gTt(t,r),t.includes(" "))return QOe(e,t,n,r);{let o=_Tt(t);return n.push(o),ATt(e,o)}}function ATt(e,t){if(t.invalid)return!1;if(!t.version||pJ(t.version))return!0;let n=MOe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=MOe(r,o)}return dTt[t.op]?.includes(n)}function mTt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function gTt(e,t){return e=e.trim(),e=PTt(e,t),e=MTt(e),e=UTt(e,t),e=e.trim(),e}function zu(e){return!e||e.toLowerCase()==="x"||e==="*"}function hTt(e){let t=e.match(LOe);if(!t){fJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function _Tt(e){if(!e)return{};let t=e.match(lTt);if(!t)return fJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function pJ(e){return e==="*"||e==="x"||e==="X"}function kOe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function ETt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function STt(e,t){if(pJ(e)||pJ(t))return 0;let[n,r]=ETt(kOe(e),kOe(t));return n>r?1:n<r?-1:0}function MOe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=STt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var FOe="[a-zA-Z0-9-]",GOe="0|[1-9]\\d*",yTt=`\\d*[a-zA-Z-]${FOe}*`,TTt="((?:<|>)?=?)",POe=`(?:${GOe}|${yTt})`,ITt=`(?:-(${POe}(?:\\.${POe})*))`,UOe=`${FOe}+`,CTt=`(?:\\+(${UOe}(?:\\.${UOe})*))`,dJ=`${GOe}|x|X|\\*`,cO=`[v=\\s]*(${dJ})(?:\\.(${dJ})(?:\\.(${dJ})(?:${ITt})?${CTt}?)?)?`,bTt=`^${TTt}\\s*${cO}$`,vTt=new RegExp(bTt),RTt=`^\\s*(${cO})\\s+-\\s+(${cO})\\s*$`,xTt=new RegExp(RTt),DTt="(?:~>?)",BTt=`^${DTt}${cO}$`,NTt=new RegExp(BTt),OTt="(?:\\^)",wTt=`^${OTt}${cO}$`,kTt=new RegExp(wTt);function MTt(e){let t=NTt;return e.replace(t,(n,r,o,i,a)=>{let c;return zu(r)?c="":zu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:zu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function PTt(e,t){let n=kTt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let g;return zu(i)?g="":zu(a)?g=`>=${i}.0.0${r} <${+i+1}.0.0-0`:zu(c)?i==="0"?g=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?g=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?g=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,g})}function UTt(e,t){let n=vTt;return e.replace(n,(r,o,i,a,c,d)=>{let g=zu(i),h=g||zu(a),S=h||zu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",g?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function LTt(e,t){let n=xTt;return e.replace(n,(r,o,i,a,c,d,g,h,S,y,C,v)=>(zu(i)?o="":zu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:zu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,zu(S)?h="":zu(y)?h=`<${+S+1}.0.0-0`:zu(C)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${C}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+C+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var AJ=F(Os=>{"use strict";m();Object.defineProperty(Os,"__esModule",{value:!0});Os.massUnwrap=Os.unwrap=Os.massWrap=Os.wrap=void 0;var $u=console.error.bind(console);function lO(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var QTt=(e,t,n)=>{if(!e||!e[t]){$u("no original function "+String(t)+" to wrap");return}if(!n){$u("no wrapper function"),$u(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){$u("original object and wrapper must be functions");return}let o=n(r,t);return lO(o,"__original",r),lO(o,"__unwrap",()=>{e[t]===o&&lO(e,t,r)}),lO(o,"__wrapped",!0),lO(e,t,o),o};Os.wrap=QTt;var FTt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{$u("must provide one or more modules to patch"),$u(new Error().stack);return}if(!(t&&Array.isArray(t))){$u("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Os.wrap)(r,o,n)})})};Os.massWrap=FTt;var GTt=(e,t)=>{if(!e||!e[t]){$u("no function to unwrap."),$u(new Error().stack);return}let n=e[t];if(!n.__unwrap)$u("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Os.unwrap=GTt;var jTt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{$u("must provide one or more modules to patch"),$u(new Error().stack);return}if(!(t&&Array.isArray(t))){$u("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Os.unwrap)(n,r)})})};Os.massUnwrap=jTt;function dO(e){e&&e.logger&&(typeof e.logger!="function"?$u("new logger isn't a function, not replacing"):$u=e.logger)}Os.default=dO;dO.wrap=Os.wrap;dO.massWrap=Os.massWrap;dO.unwrap=Os.unwrap;dO.massUnwrap=Os.massUnwrap});var HOe=F(HF=>{"use strict";m();Object.defineProperty(HF,"__esModule",{value:!0});HF.InstrumentationAbstract=void 0;var mJ=(je(),Me(We)),HTt=cJ(),jF=AJ(),gJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=mJ.diag.createComponentLogger({namespace:t}),this._tracer=mJ.trace.getTracer(t,n),this._meter=mJ.metrics.getMeter(t,n),this._logger=HTt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=jF.wrap;_unwrap=jF.unwrap;_massWrap=jF.massWrap;_massUnwrap=jF.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};HF.InstrumentationAbstract=gJ});var zOe=F(Z_=>{"use strict";m();Object.defineProperty(Z_,"__esModule",{value:!0});Z_.ModuleNameTrie=Z_.ModuleNameSeparator=void 0;Z_.ModuleNameSeparator="/";var zF=class{hooks=[];children=new Map},hJ=class{_trie=new zF;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(Z_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new zF,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(Z_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};Z_.ModuleNameTrie=hJ});var VOe=F($F=>{"use strict";m();Object.defineProperty($F,"__esModule",{value:!0});$F.RequireInTheMiddleSingleton=void 0;var zTt=MS(),$Oe=Ge("path"),_J=zOe(),$Tt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),EJ=class e{_moduleNameTrie=new _J.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new zTt.Hook(null,{internals:!0},(t,n,r)=>{let o=VTt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return $Tt?new e:this._instance=this._instance??new e}};$F.RequireInTheMiddleSingleton=EJ;function VTt(e){return $Oe.sep!==_J.ModuleNameSeparator?e.split($Oe.sep).join(_J.ModuleNameSeparator):e}});var SJ=F(W_=>{"use strict";m();Object.defineProperty(W_,"__esModule",{value:!0});W_.isWrapped=W_.safeExecuteInTheMiddleAsync=W_.safeExecuteInTheMiddle=void 0;function qTt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}W_.safeExecuteInTheMiddle=qTt;async function YTt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}W_.safeExecuteInTheMiddleAsync=YTt;function KTt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}W_.isWrapped=KTt});var KOe=F(VF=>{"use strict";m();Object.defineProperty(VF,"__esModule",{value:!0});VF.InstrumentationBase=void 0;var pO=Ge("path"),qOe=Ge("util"),JTt=jOe(),yJ=AJ(),ZTt=HOe(),WTt=VOe(),XTt=tK(),fO=(je(),Me(We)),eIt=MS(),tIt=Ge("fs"),nIt=SJ(),TJ=class extends ZTt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=WTt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,nIt.isWrapped)(t[n])&&this._unwrap(t,n),qOe.types.isProxy(t)){let o=(0,yJ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,yJ.wrap)(t,n,r)};_unwrap=(t,n)=>qOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,yJ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ge.resolve(n);Ge.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,tIt.readFileSync)(pO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{fO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return YOe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=pO.normalize(r);return a.filter(g=>g.name===c).filter(g=>YOe(g.supportedVersions,i,t.includePrerelease)).reduce((g,h)=>(h.moduleExports=g,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(g,t.moduleVersion)):g),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&pO.isAbsolute(c)){let g=pO.parse(c);c=g.name,d=g.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=pO.isAbsolute(t.name)?new eIt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new XTt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};VF.InstrumentationBase=TJ;function YOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,JTt.satisfies)(t,r,{includePrerelease:n}))}});var JOe=F(qF=>{"use strict";m();Object.defineProperty(qF,"__esModule",{value:!0});qF.normalize=void 0;var rIt=Ge("path");Object.defineProperty(qF,"normalize",{enumerable:!0,get:function(){return rIt.normalize}})});var ZOe=F(zv=>{"use strict";m();Object.defineProperty(zv,"__esModule",{value:!0});zv.normalize=zv.InstrumentationBase=void 0;var oIt=KOe();Object.defineProperty(zv,"InstrumentationBase",{enumerable:!0,get:function(){return oIt.InstrumentationBase}});var iIt=JOe();Object.defineProperty(zv,"normalize",{enumerable:!0,get:function(){return iIt.normalize}})});var IJ=F($v=>{"use strict";m();Object.defineProperty($v,"__esModule",{value:!0});$v.normalize=$v.InstrumentationBase=void 0;var WOe=ZOe();Object.defineProperty($v,"InstrumentationBase",{enumerable:!0,get:function(){return WOe.InstrumentationBase}});Object.defineProperty($v,"normalize",{enumerable:!0,get:function(){return WOe.normalize}})});var XOe=F(YF=>{"use strict";m();Object.defineProperty(YF,"__esModule",{value:!0});YF.InstrumentationNodeModuleDefinition=void 0;var CJ=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};YF.InstrumentationNodeModuleDefinition=CJ});var ewe=F(KF=>{"use strict";m();Object.defineProperty(KF,"__esModule",{value:!0});KF.InstrumentationNodeModuleFile=void 0;var aIt=IJ(),bJ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,aIt.normalize)(t)}};KF.InstrumentationNodeModuleFile=bJ});var twe=F(yy=>{"use strict";m();Object.defineProperty(yy,"__esModule",{value:!0});yy.semconvStabilityFromStr=yy.SemconvStability=void 0;var JF;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(JF=yy.SemconvStability||(yy.SemconvStability={}));function sIt(e,t){let n=JF.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=JF.DUPLICATE;break}else o.toLowerCase()===e&&(n=JF.STABLE);return n}yy.semconvStabilityFromStr=sIt});var rwe=F(na=>{"use strict";m();Object.defineProperty(na,"__esModule",{value:!0});na.semconvStabilityFromStr=na.SemconvStability=na.safeExecuteInTheMiddleAsync=na.safeExecuteInTheMiddle=na.isWrapped=na.InstrumentationNodeModuleFile=na.InstrumentationNodeModuleDefinition=na.InstrumentationBase=na.registerInstrumentations=void 0;var uIt=wOe();Object.defineProperty(na,"registerInstrumentations",{enumerable:!0,get:function(){return uIt.registerInstrumentations}});var cIt=IJ();Object.defineProperty(na,"InstrumentationBase",{enumerable:!0,get:function(){return cIt.InstrumentationBase}});var lIt=XOe();Object.defineProperty(na,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return lIt.InstrumentationNodeModuleDefinition}});var dIt=ewe();Object.defineProperty(na,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return dIt.InstrumentationNodeModuleFile}});var vJ=SJ();Object.defineProperty(na,"isWrapped",{enumerable:!0,get:function(){return vJ.isWrapped}});Object.defineProperty(na,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return vJ.safeExecuteInTheMiddle}});Object.defineProperty(na,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return vJ.safeExecuteInTheMiddleAsync}});var nwe=twe();Object.defineProperty(na,"SemconvStability",{enumerable:!0,get:function(){return nwe.SemconvStability}});Object.defineProperty(na,"semconvStabilityFromStr",{enumerable:!0,get:function(){return nwe.semconvStabilityFromStr}})});function AIt(){let e=Vv[xJ];return e?.helper?e.helper:Vv[RJ]?.helper}function mIt(e){let t={helper:e};Vv[xJ]=t,Vv[RJ]=t}function gIt(){delete Vv[xJ],delete Vv[RJ]}function EIt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}function awe(e,t,n,r,o){if(swe(t.name,o))return;let i={attributes:t.attributes,kind:EIt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,a=>{r.set(t.id,a.spanContext().spanId),t.links&&a.addLinks(t.links.flatMap(d=>{let g=r.get(d);return g?{context:{spanId:g,traceId:a.spanContext().traceId,traceFlags:a.spanContext().traceFlags}}:[]}));let c=n.filter(d=>d.parentId===t.id);for(let d of c)awe(e,d,n,r,o);a.end(t.endTime)})}function owe(e,t){return yIt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function yIt(e){return e!=null&&typeof e.then=="function"}function swe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var ZF,pIt,fIt,RJ,xJ,Vv,hIt,_It,SIt,uwe,iwe,TIt,IIt,cwe,lwe=O(()=>{m();je();ZF=ie(rwe(),1);je();pIt={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},fIt=pIt.version.split(".")[0],RJ="PRISMA_INSTRUMENTATION",xJ=`V${fIt}_PRISMA_INSTRUMENTATION`,Vv=globalThis;hIt=process.env.PRISMA_SHOW_ALL_TRACES==="true",_It="00-10-10-00";SIt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Ht.getSpanContext(e??Ke.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:_It}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)awe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ke.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!hIt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(swe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return owe(i,t(i,r))}return n.startActiveSpan(o,e,i=>owe(i,t(i,r)))}};uwe={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},iwe=uwe.version,TIt=uwe.name,IIt="@prisma/client",cwe=class extends ZF.InstrumentationBase{tracerProvider;constructor(e={}){super(TIt,iwe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new ZF.InstrumentationNodeModuleDefinition(IIt,[iwe])]}enable(){let e=this._config;mIt(new SIt({tracerProvider:this.tracerProvider??Ht.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){gIt()}isEnabled(){return AIt()!==void 0}}});function CIt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function pwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function bIt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}var dwe,DJ,vIt,fwe,Awe=O(()=>{m();je();lwe();dt();mr();dwe="Prisma";DJ=class extends cwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=pwe();CIt(t)&&(t.createEngineSpan=n=>{let r=Ht.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Vo(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let a=bIt(i.kind),c=i.parent_span_id,d=i.span_id,g=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:Ks.SAMPLED}})),S=Ht.setSpanContext(Ke.active(),{traceId:g,spanId:c,traceFlags:Ks.SAMPLED});Ke.with(S,()=>{let y={generateTraceId:()=>g,generateSpanId:()=>d};r._idGenerator=y,r.startSpan(i.name,{kind:a,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};vIt=st(dwe,e=>new DJ(e)),fwe=e=>({name:dwe,setupOnce(){vIt(e)},setup(t){pwe()&&t.on("spanStart",n=>{let r=Ot(n);r.description?.startsWith("prisma:")&&n.setAttribute(kt,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var mwe=F(qv=>{"use strict";m();Object.defineProperty(qv,"__esModule",{value:!0});qv.PACKAGE_NAME=qv.PACKAGE_VERSION=void 0;qv.PACKAGE_VERSION="0.60.0";qv.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var BJ=F(PA=>{"use strict";m();Object.defineProperty(PA,"__esModule",{value:!0});PA.HapiLifecycleMethodNames=PA.HapiLayerType=PA.handlerPatched=PA.HapiComponentName=void 0;PA.HapiComponentName="@hapi/hapi";PA.handlerPatched=Symbol("hapi-handler-patched");PA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};PA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var gwe=F(WF=>{"use strict";m();Object.defineProperty(WF,"__esModule",{value:!0});WF.ATTR_HTTP_METHOD=void 0;WF.ATTR_HTTP_METHOD="http.method"});var NJ=F(AO=>{"use strict";m();Object.defineProperty(AO,"__esModule",{value:!0});AO.AttributeNames=void 0;var RIt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(RIt=AO.AttributeNames||(AO.AttributeNames={}))});var Ewe=F(ra=>{"use strict";m();Object.defineProperty(ra,"__esModule",{value:!0});ra.getPluginFromInput=ra.getExtMetadata=ra.getRouteMetadata=ra.isPatchableExtMethod=ra.isDirectExtInput=ra.isLifecycleExtEventObj=ra.isLifecycleExtType=ra.getPluginName=void 0;var hwe=(Zn(),Me(Ur)),xIt=gwe(),mO=BJ(),X_=NJ(),_we=rn();function DIt(e){return e.name?e.name:e.pkg.name}ra.getPluginName=DIt;var BIt=e=>typeof e=="string"&&mO.HapiLifecycleMethodNames.has(e);ra.isLifecycleExtType=BIt;var NIt=e=>{let t=e?.type;return t!==void 0&&(0,ra.isLifecycleExtType)(t)};ra.isLifecycleExtEventObj=NIt;var OIt=e=>Array.isArray(e)&&e.length<=3&&(0,ra.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ra.isDirectExtInput=OIt;var wIt=e=>!Array.isArray(e);ra.isPatchableExtMethod=wIt;var kIt=(e,t,n)=>{let r={[hwe.ATTR_HTTP_ROUTE]:e.path};t&_we.SemconvStability.OLD&&(r[xIt.ATTR_HTTP_METHOD]=e.method),t&_we.SemconvStability.STABLE&&(r[hwe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[X_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.PLUGIN,r[X_.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[X_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ra.getRouteMetadata=kIt;var MIt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[X_.AttributeNames.EXT_TYPE]:e,[X_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT,[X_.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[X_.AttributeNames.EXT_TYPE]:e,[X_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT},name:r}};ra.getExtMetadata=MIt;var PIt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ra.getPluginFromInput=PIt});var Twe=F(XF=>{"use strict";m();Object.defineProperty(XF,"__esModule",{value:!0});XF.HapiInstrumentation=void 0;var Ql=(je(),Me(We)),Swe=Tr(),gO=rn(),ywe=mwe(),hO=BJ(),Dg=Ewe(),OJ=class extends gO.InstrumentationBase{_semconvStability;constructor(t={}){super(ywe.PACKAGE_NAME,ywe.PACKAGE_VERSION,t),this._semconvStability=(0,gO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new gO.InstrumentationNodeModuleDefinition(hO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,gO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,gO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let a=t.apply(this,[i]);return r._wrap(a,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(a,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(a,"register",n._getServerRegisterPatch.bind(n)),a}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let a of o){let c=(0,Dg.getPluginFromInput)(a);n._wrapRegisterHandler(c)}else{let a=(0,Dg.getPluginFromInput)(o);n._wrapRegisterHandler(a)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let a=i[0];for(let c=0;c<a.length;c++){let d=a[c];if((0,Dg.isLifecycleExtType)(d.type)){let g=d,h=r._wrapExtMethods(g.method,d.type,n);g.method=h,a[c]=g}}return t.apply(this,i)}else if((0,Dg.isDirectExtInput)(i)){let a=i,c=a[1],d=r._wrapExtMethods(c,a[0],n);return t.apply(this,[a[0],d,a[2]])}else if((0,Dg.isLifecycleExtEventObj)(i[0])){let a=i[0],c=r._wrapExtMethods(a.method,a.type,n);return a.method=c,t.call(this,a)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let a=r._wrapRouteHandler.call(r,o[i],n);o[i]=a}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Dg.getPluginName)(t),o=t.register,i=this,a=function(c,d){return i._wrap(c,"route",g=>n._getServerRoutePatch.bind(n)(g,r)),i._wrap(c,"ext",g=>n._getServerExtPatch.bind(n)(g,r)),o.call(this,c,d)};t.register=a}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,Dg.isPatchableExtMethod)(t))return t[hO.handlerPatched]===!0?t:(t[hO.handlerPatched]=!0,async function(...a){if(Ql.trace.getSpan(Ql.context.active())===void 0)return await t.apply(this,a);let c=(0,Dg.getExtMetadata)(n,r,t.name),d=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Ql.context.with(Ql.trace.setSpan(Ql.context.active(),d),t,void 0,...a)}catch(g){throw d.recordException(g),d.setStatus({code:Ql.SpanStatusCode.ERROR,message:g.message}),g}finally{d.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[hO.handlerPatched]===!0)return t;t[hO.handlerPatched]=!0;let o=i=>async function(...a){if(Ql.trace.getSpan(Ql.context.active())===void 0)return await i.call(this,...a);let c=(0,Swe.getRPCMetadata)(Ql.context.active());c?.type===Swe.RPCType.HTTP&&(c.route=t.path);let d=(0,Dg.getRouteMetadata)(t,r._semconvStability,n),g=r.tracer.startSpan(d.name,{attributes:d.attributes});try{return await Ql.context.with(Ql.trace.setSpan(Ql.context.active(),g),()=>i.call(this,...a))}catch(h){throw g.recordException(h),g.setStatus({code:Ql.SpanStatusCode.ERROR,message:h.message}),h}finally{g.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=o(c.handler)),c}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};XF.HapiInstrumentation=OJ});var Iwe=F(Yv=>{"use strict";m();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.AttributeNames=Yv.HapiInstrumentation=void 0;var UIt=Twe();Object.defineProperty(Yv,"HapiInstrumentation",{enumerable:!0,get:function(){return UIt.HapiInstrumentation}});var LIt=NJ();Object.defineProperty(Yv,"AttributeNames",{enumerable:!0,get:function(){return LIt.AttributeNames}})});var Cwe,bwe,vwe,QIt,Rwe,xwe=O(()=>{m();Cwe=ie(Iwe(),1);mr();bwe="Hapi",vwe=st(bwe,()=>new Cwe.HapiInstrumentation),QIt=()=>({name:bwe,setupOnce(){vwe()}}),Rwe=QIt});var eE,_O,wJ=O(()=>{m();eE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},_O={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var t3,FIt,GIt,e3,Dwe=O(()=>{m();je();t3=ie(rn(),1);dt();wJ();FIt="@sentry/instrumentation-hono",GIt="0.0.1",e3=class extends t3.InstrumentationBase{constructor(t={}){super(FIt,GIt,t)}init(){return[new t3.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(a=>t._wrapHandler(a))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,a=n.tracer.startSpan(i);return Ke.with(Ht.setSpan(Ke.active(),a),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(Is(c))return c.then(d=>{let g=n._determineHandlerType(d);return a.setAttributes({[eE.HONO_TYPE]:g,[eE.HONO_NAME]:g===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),d});{let d=n._determineHandlerType(c);return a.setAttributes({[eE.HONO_TYPE]:d,[eE.HONO_NAME]:d===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),c}},()=>a.end(),c=>{n._handleError(a,c),a.end()}))}}_safeExecute(t,n,r){try{let o=t();return Is(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?_O.MIDDLEWARE:_O.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:ui.ERROR,message:n.message}),t.recordException(n))}}});function jIt(e){let t=Ot(e).data,n=t[eE.HONO_TYPE];if(t[Zt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.hono",[Zt]:`${n}.hono`});let r=t[eE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Cn()===kd()){ya&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[ng],i=t[BS];typeof o=="string"&&typeof i=="string"&&Cn().setTransactionName(`${i} ${o}`)}var Bwe,Nwe,HIt,Owe,wwe=O(()=>{m();Zn();dt();mr();ly();wJ();Dwe();Bwe="Hono";Nwe=st(Bwe,()=>new e3({responseHook:e=>{jIt(e)}})),HIt=()=>({name:Bwe,setupOnce(){Nwe()}}),Owe=HIt});var n3=F(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.KoaLayerType=void 0;var zIt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(zIt=EO.KoaLayerType||(EO.KoaLayerType={}))});var kwe=F(Kv=>{"use strict";m();Object.defineProperty(Kv,"__esModule",{value:!0});Kv.PACKAGE_NAME=Kv.PACKAGE_VERSION=void 0;Kv.PACKAGE_VERSION="0.62.0";Kv.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var kJ=F(SO=>{"use strict";m();Object.defineProperty(SO,"__esModule",{value:!0});SO.AttributeNames=void 0;var $It;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})($It=SO.AttributeNames||(SO.AttributeNames={}))});var Pwe=F(Jv=>{"use strict";m();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.isLayerIgnored=Jv.getMiddlewareMetadata=void 0;var Mwe=n3(),r3=kJ(),VIt=(Zn(),Me(Ur)),qIt=(e,t,n,r)=>n?{attributes:{[r3.AttributeNames.KOA_NAME]:r?.toString(),[r3.AttributeNames.KOA_TYPE]:Mwe.KoaLayerType.ROUTER,[VIt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[r3.AttributeNames.KOA_NAME]:t.name??"middleware",[r3.AttributeNames.KOA_TYPE]:Mwe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};Jv.getMiddlewareMetadata=qIt;var YIt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));Jv.isLayerIgnored=YIt});var Uwe=F(o3=>{"use strict";m();Object.defineProperty(o3,"__esModule",{value:!0});o3.kLayerPatched=void 0;o3.kLayerPatched=Symbol("koa-layer-patched")});var Hwe=F(i3=>{"use strict";m();Object.defineProperty(i3,"__esModule",{value:!0});i3.KoaInstrumentation=void 0;var UA=(je(),Me(We)),yO=rn(),Lwe=n3(),Qwe=kwe(),Fwe=Pwe(),Gwe=Tr(),jwe=Uwe(),MJ=class extends yO.InstrumentationBase{constructor(t={}){super(Qwe.PACKAGE_NAME,Qwe.PACKAGE_VERSION,t)}init(){return new yO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){UA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,a=o.stack;for(let c=0;c<a.length;c++){let d=a[c];a[c]=this._patchLayer(d,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Lwe.KoaLayerType.ROUTER:Lwe.KoaLayerType.MIDDLEWARE;return t[jwe.kLayerPatched]===!0||(0,Fwe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(UA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[jwe.kLayerPatched]=!0,UA.diag.debug("patching Koa middleware layer"),async(i,a)=>{if(UA.trace.getSpan(UA.context.active())===void 0)return t(i,a);let d=(0,Fwe.getMiddlewareMetadata)(i,t,n,r),g=this.tracer.startSpan(d.name,{attributes:d.attributes}),h=(0,Gwe.getRPCMetadata)(UA.context.active());h?.type===Gwe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:S}=this.getConfig();S&&(0,yO.safeExecuteInTheMiddle)(()=>S(g,{context:i,middlewareLayer:t,layerType:o}),C=>{C&&UA.diag.error("koa instrumentation: request hook failed",C)},!0);let y=UA.trace.setSpan(UA.context.active(),g);return UA.context.with(y,async()=>{try{return await t(i,a)}catch(C){throw g.recordException(C),C}finally{g.end()}})})}};i3.KoaInstrumentation=MJ});var zwe=F(tE=>{"use strict";m();Object.defineProperty(tE,"__esModule",{value:!0});tE.KoaLayerType=tE.AttributeNames=tE.KoaInstrumentation=void 0;var KIt=Hwe();Object.defineProperty(tE,"KoaInstrumentation",{enumerable:!0,get:function(){return KIt.KoaInstrumentation}});var JIt=kJ();Object.defineProperty(tE,"AttributeNames",{enumerable:!0,get:function(){return JIt.AttributeNames}});var ZIt=n3();Object.defineProperty(tE,"KoaLayerType",{enumerable:!0,get:function(){return ZIt.KoaLayerType}})});var $we,Vwe,qwe,WIt,Ywe,Kwe=O(()=>{m();$we=ie(zwe(),1);Zn();dt();mr();ly();Vwe="Koa",qwe=st(Vwe,$we.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Lr(t,"auto.http.otel.koa");let r=Ot(t).data,o=r["koa.type"];o&&t.setAttribute(Zt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),Cn()===kd()){ya&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let a=r[ng],c=n.context?.request?.method?.toUpperCase()||"GET";a&&Cn().setTransactionName(`${c} ${a}`)}})),WIt=(e={})=>({name:Vwe,setupOnce(){qwe(e)}}),Ywe=WIt});var PJ=F(lf=>{"use strict";m();Object.defineProperty(lf,"__esModule",{value:!0});lf.ConnectNames=lf.ConnectTypes=lf.AttributeNames=void 0;var XIt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(XIt=lf.AttributeNames||(lf.AttributeNames={}));var eCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(eCt=lf.ConnectTypes||(lf.ConnectTypes={}));var tCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(tCt=lf.ConnectNames||(lf.ConnectNames={}))});var Jwe=F(Zv=>{"use strict";m();Object.defineProperty(Zv,"__esModule",{value:!0});Zv.PACKAGE_NAME=Zv.PACKAGE_VERSION=void 0;Zv.PACKAGE_VERSION="0.57.0";Zv.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Zwe=F(a3=>{"use strict";m();Object.defineProperty(a3,"__esModule",{value:!0});a3._LAYERS_STORE_PROPERTY=void 0;a3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Wwe=F(rE=>{"use strict";m();Object.defineProperty(rE,"__esModule",{value:!0});rE.generateRoute=rE.replaceCurrentStackRoute=rE.addNewStackLayer=void 0;var nCt=(je(),Me(We)),nE=Zwe(),rCt=e=>{Array.isArray(e[nE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,nE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[nE._LAYERS_STORE_PROPERTY].push("/");let t=e[nE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[nE._LAYERS_STORE_PROPERTY].length?e[nE._LAYERS_STORE_PROPERTY].pop():nCt.diag.warn("Connect: Trying to pop the stack multiple time")}};rE.addNewStackLayer=rCt;var oCt=(e,t)=>{t&&e[nE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};rE.replaceCurrentStackRoute=oCt;var iCt=e=>e[nE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);rE.generateRoute=iCt});var tke=F(oE=>{"use strict";m();Object.defineProperty(oE,"__esModule",{value:!0});oE.ConnectInstrumentation=oE.ANONYMOUS_NAME=void 0;var aCt=(je(),Me(We)),Xwe=Tr(),Wv=PJ(),eke=Jwe(),s3=rn(),sCt=(Zn(),Me(Ur)),UJ=Wwe();oE.ANONYMOUS_NAME="anonymous";var LJ=class extends s3.InstrumentationBase{constructor(t={}){super(eke.PACKAGE_NAME,eke.PACKAGE_VERSION,t)}init(){return[new s3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,s3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,s3.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=Wv.ConnectTypes.REQUEST_HANDLER,i=Wv.ConnectNames.REQUEST_HANDLER,o=t):(r=Wv.ConnectTypes.MIDDLEWARE,i=Wv.ConnectNames.MIDDLEWARE,o=n.name||oE.ANONYMOUS_NAME);let a=`${i} - ${o}`,c={attributes:{[sCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[Wv.AttributeNames.CONNECT_TYPE]:r,[Wv.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(a,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[a,c,d]=o?[1,2,3]:[0,1,2],g=arguments[a],h=arguments[c],S=arguments[d];(0,UJ.replaceCurrentStackRoute)(g,t);let y=(0,Xwe.getRPCMetadata)(aCt.context.active());t&&y?.type===Xwe.RPCType.HTTP&&(y.route=(0,UJ.generateRoute)(g));let C="";t?C=`request handler - ${t}`:C=`middleware - ${n.name||oE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",C);let x=!1;function N(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",N)}return h.addListener("close",N),arguments[d]=r._patchNext(S,N),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],a=arguments[o],c=(0,UJ.addNewStackLayer)(i);return typeof a=="function"&&(arguments[o]=n._patchOut(a,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};oE.ConnectInstrumentation=LJ});var rke=F(Jd=>{"use strict";m();Object.defineProperty(Jd,"__esModule",{value:!0});Jd.ConnectTypes=Jd.ConnectNames=Jd.AttributeNames=Jd.ANONYMOUS_NAME=Jd.ConnectInstrumentation=void 0;var nke=tke();Object.defineProperty(Jd,"ConnectInstrumentation",{enumerable:!0,get:function(){return nke.ConnectInstrumentation}});Object.defineProperty(Jd,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return nke.ANONYMOUS_NAME}});var QJ=PJ();Object.defineProperty(Jd,"AttributeNames",{enumerable:!0,get:function(){return QJ.AttributeNames}});Object.defineProperty(Jd,"ConnectNames",{enumerable:!0,get:function(){return QJ.ConnectNames}});Object.defineProperty(Jd,"ConnectTypes",{enumerable:!0,get:function(){return QJ.ConnectTypes}})});var oke,ike,ake,uCt,ske,uke=O(()=>{m();oke=ie(rke(),1);mr();ike="Connect",ake=st(ike,()=>new oke.ConnectInstrumentation),uCt=()=>({name:ike,setupOnce(){ake()}}),ske=uCt});var cke=F(rs=>{"use strict";m();Object.defineProperty(rs,"__esModule",{value:!0});rs.DB_SYSTEM_VALUE_MSSQL=rs.ATTR_NET_PEER_PORT=rs.ATTR_NET_PEER_NAME=rs.ATTR_DB_USER=rs.ATTR_DB_SYSTEM=rs.ATTR_DB_STATEMENT=rs.ATTR_DB_SQL_TABLE=rs.ATTR_DB_NAME=void 0;rs.ATTR_DB_NAME="db.name";rs.ATTR_DB_SQL_TABLE="db.sql.table";rs.ATTR_DB_STATEMENT="db.statement";rs.ATTR_DB_SYSTEM="db.system";rs.ATTR_DB_USER="db.user";rs.ATTR_NET_PEER_NAME="net.peer.name";rs.ATTR_NET_PEER_PORT="net.peer.port";rs.DB_SYSTEM_VALUE_MSSQL="mssql"});var lke=F(Xv=>{"use strict";m();Object.defineProperty(Xv,"__esModule",{value:!0});Xv.once=Xv.getSpanName=void 0;function cCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}Xv.getSpanName=cCt;var lCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Xv.once=lCt});var dke=F(eR=>{"use strict";m();Object.defineProperty(eR,"__esModule",{value:!0});eR.PACKAGE_NAME=eR.PACKAGE_VERSION=void 0;eR.PACKAGE_VERSION="0.33.0";eR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var gke=F(aE=>{"use strict";m();Object.defineProperty(aE,"__esModule",{value:!0});aE.TediousInstrumentation=aE.INJECTED_CTX=void 0;var tR=(je(),Me(We)),dCt=Ge("events"),LA=rn(),Ty=(Zn(),Me(Ur)),iE=cke(),pke=lke(),fke=dke(),mke=Symbol("opentelemetry.instrumentation-tedious.current-database");aE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var Ake=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function u3(e){Object.defineProperty(this,mke,{value:e,writable:!0})}var FJ=class e extends LA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(fke.PACKAGE_NAME,fke.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,LA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,LA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new LA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of Ake)(0,LA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,LA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of Ake)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return u3.call(this,this.config?.options?.database),this.removeListener("databaseChange",u3),this.on("databaseChange",u3),this.once("end",()=>{this.removeListener("databaseChange",u3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||tR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",a=new n.Request(i,d=>{o()});Object.defineProperty(a,aE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");a.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(a)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(a){if(a?.[aE.INJECTED_CTX])return r.apply(this,arguments);if(!(a instanceof dCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,d=0,g=()=>d++,h=()=>c++,S=this[mke],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(a),C={};o._dbSemconvStability&LA.SemconvStability.OLD&&(C[iE.ATTR_DB_SYSTEM]=iE.DB_SYSTEM_VALUE_MSSQL,C[iE.ATTR_DB_NAME]=S,C[iE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,C[iE.ATTR_DB_STATEMENT]=y,C[iE.ATTR_DB_SQL_TABLE]=a.table),o._dbSemconvStability&LA.SemconvStability.STABLE&&(C[Ty.ATTR_DB_NAMESPACE]=S,C[Ty.ATTR_DB_SYSTEM_NAME]=Ty.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,C[Ty.ATTR_DB_QUERY_TEXT]=y,C[Ty.ATTR_DB_COLLECTION_NAME]=a.table),o._netSemconvStability&LA.SemconvStability.OLD&&(C[iE.ATTR_NET_PEER_NAME]=this.config?.server,C[iE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&LA.SemconvStability.STABLE&&(C[Ty.ATTR_SERVER_ADDRESS]=this.config?.server,C[Ty.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,pke.getSpanName)(t,S,y,a.table),{kind:tR.SpanKind.CLIENT,attributes:C}),x=(0,pke.once)(G=>{a.removeListener("done",g),a.removeListener("doneInProc",g),a.removeListener("doneProc",h),a.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",d),G&&v.setStatus({code:tR.SpanStatusCode.ERROR,message:G.message}),v.end()});a.on("done",g),a.on("doneInProc",g),a.on("doneProc",h),a.once("error",x),this.on("end",x),typeof a.callback=="function"?o._wrap(a,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let N=()=>tR.context.with(tR.trace.setSpan(tR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return N();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(N)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};aE.TediousInstrumentation=FJ});var hke=F(c3=>{"use strict";m();Object.defineProperty(c3,"__esModule",{value:!0});c3.TediousInstrumentation=void 0;var pCt=gke();Object.defineProperty(c3,"TediousInstrumentation",{enumerable:!0,get:function(){return pCt.TediousInstrumentation}})});var _ke,fCt,Eke,Ske,ACt,yke,Tke=O(()=>{m();_ke=ie(hke(),1);dt();mr();fCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),Eke="Tedious",Ske=st(Eke,()=>new _ke.TediousInstrumentation({})),ACt=()=>{let e;return{name:Eke,setupOnce(){let t=Ske();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Ot(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";fCt.has(i)&&n.setAttribute(kt,"auto.db.otel.tedious")}))}}},yke=ACt});var Ike=F(nR=>{"use strict";m();Object.defineProperty(nR,"__esModule",{value:!0});nR.PACKAGE_NAME=nR.PACKAGE_VERSION=void 0;nR.PACKAGE_VERSION="0.57.0";nR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var bke=F(l3=>{"use strict";m();Object.defineProperty(l3,"__esModule",{value:!0});l3.GenericPoolInstrumentation=void 0;var rR=(je(),Me(We)),Iy=rn(),Cke=Ike(),GJ="generic-pool",jJ=class extends Iy.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(Cke.PACKAGE_NAME,Cke.PACKAGE_VERSION,t)}init(){return[new Iy.InstrumentationNodeModuleDefinition(GJ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,Iy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Iy.InstrumentationNodeModuleDefinition(GJ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,Iy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Iy.InstrumentationNodeModuleDefinition(GJ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,Iy.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=rR.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return rR.context.with(rR.trace.setSpan(i,a),()=>t.call(this,...o).then(c=>(a.end(),c),c=>{throw a.recordException(c),a.end(),c}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let a=rR.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},a);return rR.context.with(rR.trace.setSpan(a,c),()=>{t.call(this,(d,g)=>{if(c.end(),o)return o(d,g)},i)})}}};l3.GenericPoolInstrumentation=jJ});var vke=F(d3=>{"use strict";m();Object.defineProperty(d3,"__esModule",{value:!0});d3.GenericPoolInstrumentation=void 0;var mCt=bke();Object.defineProperty(d3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return mCt.GenericPoolInstrumentation}})});var Rke,xke,Dke,gCt,Bke,Nke=O(()=>{m();Rke=ie(vke(),1);dt();mr();xke="GenericPool",Dke=st(xke,()=>new Rke.GenericPoolInstrumentation({})),gCt=()=>{let e;return{name:xke,setupOnce(){let t=Dke();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Ot(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(kt,"auto.db.otel.generic_pool")}))}}},Bke=gCt});var HJ=F(QA=>{"use strict";m();Object.defineProperty(QA,"__esModule",{value:!0});QA.ATTR_NET_PEER_PORT=QA.ATTR_NET_PEER_NAME=QA.ATTR_MESSAGING_SYSTEM=QA.ATTR_MESSAGING_OPERATION=void 0;QA.ATTR_MESSAGING_OPERATION="messaging.operation";QA.ATTR_MESSAGING_SYSTEM="messaging.system";QA.ATTR_NET_PEER_NAME="net.peer.name";QA.ATTR_NET_PEER_PORT="net.peer.port"});var zJ=F(fi=>{"use strict";m();Object.defineProperty(fi,"__esModule",{value:!0});fi.ATTR_MESSAGING_CONVERSATION_ID=fi.OLD_ATTR_MESSAGING_MESSAGE_ID=fi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=fi.ATTR_MESSAGING_URL=fi.ATTR_MESSAGING_PROTOCOL_VERSION=fi.ATTR_MESSAGING_PROTOCOL=fi.MESSAGING_OPERATION_VALUE_PROCESS=fi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=fi.ATTR_MESSAGING_DESTINATION_KIND=fi.ATTR_MESSAGING_DESTINATION=void 0;fi.ATTR_MESSAGING_DESTINATION="messaging.destination";fi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";fi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";fi.MESSAGING_OPERATION_VALUE_PROCESS="process";fi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";fi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";fi.ATTR_MESSAGING_URL="messaging.url";fi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";fi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";fi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var $J=F(Cy=>{"use strict";m();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.DEFAULT_CONFIG=Cy.EndOperation=void 0;var hCt;(function(e){e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout"})(hCt=Cy.EndOperation||(Cy.EndOperation={}));Cy.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var Mke=F(Ai=>{"use strict";m();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.isConfirmChannelTracing=Ai.unmarkConfirmChannelTracing=Ai.markConfirmChannelTracing=Ai.getConnectionAttributesFromUrl=Ai.getConnectionAttributesFromServer=Ai.normalizeExchange=Ai.CONNECTION_ATTRIBUTES=Ai.CHANNEL_CONSUME_TIMEOUT_TIMER=Ai.CHANNEL_SPANS_NOT_ENDED=Ai.MESSAGE_STORED_SPAN=void 0;var VJ=(je(),Me(We)),sE=rn(),p3=(Zn(),Me(Ur)),TO=HJ(),f3=zJ();Ai.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ai.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ai.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ai.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var qJ=(0,VJ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),_Ct=e=>e!==""?e:"<default>";Ai.normalizeExchange=_Ct;var ECt=e=>e.replace(/:[^:@/]*@/,":***@"),Oke=(e,t)=>e||(t==="AMQP"?5672:5671),wke=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},kke=e=>e||"localhost",FA=(e,t,n,r)=>n?{[t]:n}:(VJ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),SCt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[TO.ATTR_MESSAGING_SYSTEM]:t}:{}};Ai.getConnectionAttributesFromServer=SCt;var yCt=(e,t)=>{let n={[f3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=wke(r?.protocol);Object.assign(n,{...FA(e,f3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=kke(r?.hostname);t&sE.SemconvStability.OLD&&Object.assign(n,{...FA(e,TO.ATTR_NET_PEER_NAME,i,"hostname")}),t&sE.SemconvStability.STABLE&&Object.assign(n,{...FA(e,p3.ATTR_SERVER_ADDRESS,i,"hostname")});let a=Oke(r.port,o);t&sE.SemconvStability.OLD&&Object.assign(n,FA(e,TO.ATTR_NET_PEER_PORT,a,"port")),t&sE.SemconvStability.STABLE&&Object.assign(n,FA(e,p3.ATTR_SERVER_PORT,a,"port"))}else{let r=ECt(e);n[f3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=wke(o.protocol);Object.assign(n,{...FA(r,f3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let a=kke(o.hostname);t&sE.SemconvStability.OLD&&Object.assign(n,{...FA(r,TO.ATTR_NET_PEER_NAME,a,"hostname")}),t&sE.SemconvStability.STABLE&&Object.assign(n,{...FA(r,p3.ATTR_SERVER_ADDRESS,a,"hostname")});let c=Oke(o.port?parseInt(o.port):void 0,i);t&sE.SemconvStability.OLD&&Object.assign(n,FA(r,TO.ATTR_NET_PEER_PORT,c,"port")),t&sE.SemconvStability.STABLE&&Object.assign(n,FA(r,p3.ATTR_SERVER_PORT,c,"port"))}catch(o){VJ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ai.getConnectionAttributesFromUrl=yCt;var TCt=e=>e.setValue(qJ,!0);Ai.markConfirmChannelTracing=TCt;var ICt=e=>e.deleteValue(qJ);Ai.unmarkConfirmChannelTracing=ICt;var CCt=e=>e.getValue(qJ)===!0;Ai.isConfirmChannelTracing=CCt});var Pke=F(oR=>{"use strict";m();Object.defineProperty(oR,"__esModule",{value:!0});oR.PACKAGE_NAME=oR.PACKAGE_VERSION=void 0;oR.PACKAGE_VERSION="0.61.0";oR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Lke=F(g3=>{"use strict";m();Object.defineProperty(g3,"__esModule",{value:!0});g3.AmqplibInstrumentation=void 0;var Jo=(je(),Me(We)),A3=Tr(),Cr=rn(),bCt=HJ(),Fl=zJ(),Vu=$J(),mi=Mke(),Uke=Pke(),m3=[">=0.5.5 <1"],YJ=class extends Cr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(Uke.PACKAGE_NAME,Uke.PACKAGE_VERSION,{...Vu.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Cr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...Vu.DEFAULT_CONFIG,...t})}init(){let t=new Cr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",m3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Cr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",m3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Cr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",m3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Cr.InstrumentationNodeModuleDefinition("amqplib",m3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Cr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Cr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Cr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Cr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Cr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Vu.EndOperation.Ack)),(0,Cr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Vu.EndOperation.Nack)),(0,Cr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Vu.EndOperation.Reject)),(0,Cr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Vu.EndOperation.AckAll)),(0,Cr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Vu.EndOperation.NackAll)),(0,Cr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Cr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Cr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Cr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Cr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Cr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Cr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Cr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Cr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Cr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Cr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,a){return t.call(this,o,i,function(c,d){if(c==null){let g=(0,mi.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,mi.getConnectionAttributesFromServer)(d);d[mi.CONNECTION_ATTRIBUTES]={...g,...h}}a.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,Vu.EndOperation.ChannelClosed,void 0);let i=this[mi.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[mi.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,Vu.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(a){return o.endAllSpansOnChannel(this,t,n,a),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(a,c,d){let g=this,h=n===Vu.EndOperation.Reject?c:d,S=g[mi.CHANNEL_SPANS_NOT_ENDED]??[],y=S.findIndex(C=>C.msg===a);if(y<0)o.endConsumerSpan(a,t,n,h);else if(n!==Vu.EndOperation.Reject&&c){for(let C=0;C<=y;C++)o.endConsumerSpan(S[C].msg,t,n,h);S.splice(0,y+1)}else o.endConsumerSpan(a,t,n,h),S.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,a,c){let d=this;if(!Object.prototype.hasOwnProperty.call(d,mi.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let S=setInterval(()=>{r.checkConsumeTimeoutOnChannel(d)},h);S.unref(),d[mi.CHANNEL_CONSUME_TIMEOUT_TIMER]=S}d[mi.CHANNEL_SPANS_NOT_ENDED]=[]}let g=function(h){if(!h)return a.call(this,h);let S=h.properties.headers??{},y=Jo.propagation.extract(Jo.ROOT_CONTEXT,S),C=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=y?Jo.trace.getSpan(y)?.spanContext():void 0;y=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Jo.SpanKind.CONSUMER,attributes:{...d?.connection?.[mi.CONNECTION_ATTRIBUTES],[Fl.ATTR_MESSAGING_DESTINATION]:C,[Fl.ATTR_MESSAGING_DESTINATION_KIND]:Fl.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fl.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[bCt.ATTR_MESSAGING_OPERATION]:Fl.MESSAGING_OPERATION_VALUE_PROCESS,[Fl.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[Fl.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:N}=r.getConfig();N&&(0,Cr.safeExecuteInTheMiddle)(()=>N(x,{moduleVersion:t,msg:h}),Q=>{Q&&Jo.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(d[mi.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,A3.hrTime)()}),h[mi.MESSAGE_STORED_SPAN]=x);let k=y||Jo.ROOT_CONTEXT;Jo.context.with(Jo.trace.setSpan(k,x),()=>{a.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,Vu.EndOperation.AutoAck),x.end())};return arguments[1]=g,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,a,c,d,g){let h=this,{span:S,modifiedOptions:y}=r.createPublishSpan(r,i,a,h,d),{publishHook:C}=r.getConfig();C&&(0,Cr.safeExecuteInTheMiddle)(()=>C(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:y,isConfirmChannel:!0}),k=>{k&&Jo.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,Q){try{g?.call(this,k,Q)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Cr.safeExecuteInTheMiddle)(()=>j(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:d,isConfirmChannel:!0,confirmError:k}),G=>{G&&Jo.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&S.setStatus({code:Jo.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),S.end()}},x=(0,mi.markConfirmChannelTracing)(Jo.context.active()),N=[...arguments];return N[3]=y,N[4]=Jo.context.bind((0,mi.unmarkConfirmChannelTracing)(Jo.trace.setSpan(x,S)),v),Jo.context.with(x,n.bind(this,...N))}}getPublishPatch(t,n){let r=this;return function(i,a,c,d){if((0,mi.isConfirmChannelTracing)(Jo.context.active()))return n.apply(this,arguments);{let g=this,{span:h,modifiedOptions:S}=r.createPublishSpan(r,i,a,g,d),{publishHook:y}=r.getConfig();y&&(0,Cr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:S,isConfirmChannel:!1}),x=>{x&&Jo.diag.error("amqplib instrumentation: publishHook error",x)},!0);let C=[...arguments];C[3]=S;let v=n.apply(this,C);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let a=(0,mi.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${a}`,{kind:Jo.SpanKind.PRODUCER,attributes:{...o.connection[mi.CONNECTION_ATTRIBUTES],[Fl.ATTR_MESSAGING_DESTINATION]:n,[Fl.ATTR_MESSAGING_DESTINATION_KIND]:Fl.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fl.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[Fl.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[Fl.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),d=i??{};return d.headers=d.headers??{},Jo.propagation.inject(Jo.trace.setSpan(Jo.context.active(),c),d.headers),{span:c,modifiedOptions:d}}endConsumerSpan(t,n,r,o){let i=t[mi.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Jo.SpanStatusCode.ERROR,message:r!==Vu.EndOperation.ChannelClosed&&r!==Vu.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[mi.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[mi.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),t[mi.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Cr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),a=>{a&&Jo.diag.error("amqplib instrumentation: consumerEndHook error",a)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,A3.hrTime)(),r=t[mi.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let a=r[o],c=(0,A3.hrTimeDuration)(a.timeOfConsume,n);if((0,A3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,Vu.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};g3.AmqplibInstrumentation=YJ});var Fke=F(uE=>{"use strict";m();Object.defineProperty(uE,"__esModule",{value:!0});uE.EndOperation=uE.DEFAULT_CONFIG=uE.AmqplibInstrumentation=void 0;var vCt=Lke();Object.defineProperty(uE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return vCt.AmqplibInstrumentation}});var Qke=$J();Object.defineProperty(uE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Qke.DEFAULT_CONFIG}});Object.defineProperty(uE,"EndOperation",{enumerable:!0,get:function(){return Qke.EndOperation}})});var Gke,jke,RCt,Hke,xCt,zke,$ke=O(()=>{m();Gke=ie(Fke(),1);mr();jke="Amqplib",RCt={consumeEndHook:e=>{Lr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Lr(e,"auto.amqplib.otel.publisher")}},Hke=st(jke,()=>new Gke.AmqplibInstrumentation(RCt)),xCt=()=>({name:jke,setupOnce(){Hke()}}),zke=xCt});var IO,KJ=O(()=>{m();IO="VercelAI"});function BCt(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function NCt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(OCt(t.content),wCt(t.content))}function OCt(e){for(let t of e){if(!BCt(t))continue;let n=bq(t.toolCallId);n?xl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),tn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):xl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),tn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function wCt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&vq(t.toolCallId)}function kCt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var _3,DCt,Vke,h3,qke=O(()=>{m();_3=ie(rn(),1);dt();KJ();DCt=[">=3.0.0 <7"],Vke=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];h3=class e extends _3.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",Wn,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new _3.InstrumentationNodeModuleDefinition("ai",DCt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,a)=>{let c=a[0].experimental_telemetry||{},d=c.isEnabled,g=gt(),h=g?.getIntegrationByName(IO),S=h?.options,y=h?!!g?.getOptions().sendDefaultPii:!1,{recordInputs:C,recordOutputs:v}=kCt(S,c,d,y);return a[0].experimental_telemetry={...c,isEnabled:d!==void 0?d:!0,recordInputs:C,recordOutputs:v},rf(()=>Reflect.apply(o,i,a),x=>{x&&typeof x=="object"&&Ki(x,"_sentry_active_span",Nc())},()=>{},x=>{NCt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of Vke)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=Vke.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function MCt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var Yke,PCt,Kke,Jke=O(()=>{m();dt();mr();KJ();qke();Yke=st(IO,()=>new h3({}));PCt=(e={})=>{let t;return{name:IO,options:e,setupOnce(){t=Yke()},afterAllSetup(n){e.force??MCt(n)?IL(n):t?.callWhenPatched(()=>IL(n))}}},Kke=PCt});var S3,UCt,E3,Zke=O(()=>{m();S3=ie(rn(),1);dt();UCt=[">=4.0.0 <7"],E3=class extends S3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Wn,t)}init(){return new S3.InstrumentationNodeModuleDefinition("openai",UCt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...a){if(qS(O_))return Reflect.construct(r,a);let c=Reflect.construct(r,a);return vL(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var Wke,LCt,Xke,eMe=O(()=>{m();dt();mr();Zke();Wke=st(O_,e=>new E3(e)),LCt=(e={})=>({name:O_,setupOnce(){Wke(e)}}),Xke=LCt});var T3,QCt,y3,tMe=O(()=>{m();T3=ie(rn(),1);dt();QCt=[">=0.19.2 <1.0.0"],y3=class extends T3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Wn,t)}init(){return new T3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",QCt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(qS(w_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return RL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var nMe,FCt,rMe,oMe=O(()=>{m();dt();mr();tMe();nMe=st(w_,e=>new y3(e)),FCt=(e={})=>({name:w_,options:e,setupOnce(){nMe(e)}}),rMe=FCt});var iR,iMe,I3,aMe=O(()=>{m();iR=ie(rn(),1);dt();iMe=[">=0.10.0 <2"],I3=class extends iR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Wn,t)}init(){return new iR.InstrumentationNodeModuleDefinition("@google/genai",iMe,n=>this._patch(n),n=>n,[new iR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",iMe,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(qS(k_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return xL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}return nN(t,"GoogleGenAI",o),t}}});var sMe,GCt,uMe,cMe=O(()=>{m();dt();mr();aMe();sMe=st(k_,e=>new I3(e)),GCt=(e={})=>({name:k_,setupOnce(){sMe(e)}}),uMe=GCt});function jCt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function HCt(e,t,n){return new Proxy(e,{apply(r,o,i){let c=i[1];(!c||typeof c!="object"||Array.isArray(c))&&(c={},i[1]=c);let d=c.callbacks,g=jCt(d,t);return c.callbacks=g,Reflect.apply(r,o,i)}})}var cE,C3,b3,lMe=O(()=>{m();cE=ie(rn(),1);dt();C3=[">=0.1.0 <2.0.0"];b3=class extends cE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",Wn,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new cE.InstrumentationNodeModuleDefinition(r,C3,this._patch.bind(this),o=>o,[new cE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,C3,this._patch.bind(this),o=>o)]));return t.push(new cE.InstrumentationNodeModuleDefinition("langchain",C3,this._patch.bind(this),r=>r,[new cE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",C3,this._patch.bind(this),r=>r)])),t}_patch(t){jV([O_,w_,k_]);let n=OL(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(d=>typeof d=="function"&&r.includes(d.name));if(!i)return;let a=i.prototype;if(a.__sentry_patched__)return;a.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let d of c){let g=a[d];typeof g=="function"&&(a[d]=HCt(g,n))}}}});var dMe,zCt,pMe,fMe=O(()=>{m();dt();mr();lMe();dMe=st(DL,e=>new b3(e)),zCt=(e={})=>({name:DL,setupOnce(){dMe(e)}}),pMe=zCt});var aR,AMe,v3,mMe=O(()=>{m();aR=ie(rn(),1);dt();AMe=[">=0.0.0 <2.0.0"],v3=class extends aR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Wn,t)}init(){return new aR.InstrumentationNodeModuleDefinition("@langchain/langgraph",AMe,this._patch.bind(this),n=>n,[new aR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",AMe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&kL(t.StateGraph.prototype,this.getConfig()),t}}});var gMe,$Ct,hMe,_Me=O(()=>{m();dt();mr();mMe();gMe=st(wL,e=>new v3(e)),$Ct=(e={})=>({name:wL,setupOnce(){gMe(e)}}),hMe=$Ct});import*as SMe from"node:net";function yMe(e,t,n,r,o){let a=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(a=h=>{(0,Bg.safeExecuteInTheMiddle)(()=>c(h),S=>{S&&vl.error(S?.message)},!0)});let d=new Bg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>EMe(h,n,r,e,a)),g=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let h of g)d.files.push(new Bg.InstrumentationNodeModuleFile(h,t,S=>EMe(S,n,r,e,a),S=>TMe(S,r)));return d}function EMe(e,t,n,r,o){return TMe(e,n),t(e,"addDoc",VCt(r,o)),t(e,"getDocs",YCt(r,o)),t(e,"setDoc",KCt(r,o)),t(e,"deleteDoc",qCt(r,o)),e}function TMe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Bg.isWrapped)(e[n])&&t(e,n);return e}function VCt(e,t){return function(r){return function(o,i){let a=x3(e,"addDoc",o);return t(a),R3(a,()=>r(o,i))}}}function qCt(e,t){return function(r){return function(o){let i=x3(e,"deleteDoc",o.parent||o);return t(i),R3(i,()=>r(o))}}}function YCt(e,t){return function(r){return function(o){let i=x3(e,"getDocs",o);return t(i),R3(i,()=>r(o))}}}function KCt(e,t){return function(r){return function(o,i,a){let c=x3(e,"setDoc",o.parent||o);return t(c),R3(c,()=>typeof a<"u"?r(o,i,a):r(o,i))}}}function R3(e,t){return Ke.with(Ht.setSpan(Ke.active(),e),()=>(0,Bg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function x3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:oo.CLIENT});return ZCt(r,n),r.setAttribute(VC,t),r}function JCt(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(SMe.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function ZCt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},a={[p5]:t.path,[f5]:n.name,[DS]:"firebase.firestore","firebase.firestore.type":t.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:c,port:d}=JCt(i);c&&(a[y5]=c),d&&(a[T5]=d),e.setAttributes(a)}var Bg,IMe=O(()=>{m();je();Bg=ie(rn(),1);Zn()});function CMe(e,t,n,r,o){let i=()=>{},a=()=>{},c=o.functions?.errorHook,d=o.functions?.requestHook,g=o.functions?.responseHook;typeof g=="function"&&(a=(y,C)=>{(0,Ng.safeExecuteInTheMiddle)(()=>g(y,C),v=>{v&&vl.error(v?.message)},!0)}),typeof d=="function"&&(i=y=>{(0,Ng.safeExecuteInTheMiddle)(()=>d(y),C=>{C&&vl.error(C?.message)},!0)});let h=new Ng.InstrumentationNodeModuleDefinition("firebase-functions",t);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:y,triggerType:C})=>{h.files.push(new Ng.InstrumentationNodeModuleFile(y,t,v=>WCt(v,n,r,e,{requestHook:i,responseHook:a,errorHook:c},C),v=>bMe(v,r)))}),h}function qu(e,t,n){return function(o){return function(...i){let a=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!a)return o.call(this,...i);let d=async function(...g){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",S=e.startSpan(`firebase.function.${n}`,{kind:oo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),S.setAttributes(y),t?.requestHook?.(S),Ke.with(Ht.setSpan(Ke.active(),S),async()=>{let C,v;try{v=await a.apply(this,g)}catch(x){C=x}if(t?.responseHook?.(S,C),C&&S.recordException(C),S.end(),C)throw await t?.errorHook?.(S,C),C;return v})};return c?o.call(this,c,d):o.call(this,d)}}}function WCt(e,t,n,r,o,i){switch(bMe(e,n),i){case"function":t(e,"onRequest",qu(r,o,"http.request")),t(e,"onCall",qu(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",qu(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",qu(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",qu(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",qu(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",qu(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",qu(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",qu(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",qu(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",qu(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",qu(r,o,"storage.object.finalized")),t(e,"onObjectArchived",qu(r,o,"storage.object.archived")),t(e,"onObjectDeleted",qu(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",qu(r,o,"storage.object.metadataUpdated"));break}return e}function bMe(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ng.isWrapped)(e[r])&&t(e,r);return e}var Ng,vMe=O(()=>{m();je();Ng=ie(rn(),1)});var xMe,RMe,XCt,ebt,D3,DMe=O(()=>{m();xMe=ie(rn(),1);dt();IMe();vMe();RMe={},XCt=[">=3.0.0 <5"],ebt=[">=6.0.0 <7"],D3=class extends xMe.InstrumentationBase{constructor(t=RMe){super("@sentry/instrumentation-firebase",Wn,t)}setConfig(t={}){super.setConfig({...RMe,...t})}init(){let t=[];return t.push(yMe(this.tracer,XCt,this._wrap,this._unwrap,this.getConfig())),t.push(CMe(this.tracer,ebt,this._wrap,this._unwrap,this.getConfig())),t}}});var BMe,tbt,NMe,nbt,OMe,wMe=O(()=>{m();dt();mr();DMe();BMe="Firebase",tbt={firestoreSpanCreationHook:e=>{Lr(e,"auto.firebase.otel.firestore"),e.setAttribute(Zt,"db.query")},functions:{requestHook:e=>{Lr(e,"auto.firebase.otel.functions"),e.setAttribute(Zt,"http.request")},errorHook:async(e,t)=>{t&&(tn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Bb(2e3))}}},NMe=st(BMe,()=>new D3(tbt)),nbt=()=>({name:BMe,setupOnce(){NMe()}}),OMe=nbt});function kMe(){return[Uxe(),h1e(),z1e(),Owe(),NBe(),VBe(),oNe(),gNe(),YNe(),mOe(),fwe(),Rwe(),Ywe(),ske(),yke(),Bke(),sBe(),zke(),_Be(),pMe(),hMe(),Kke(),Xke(),rMe(),uMe(),EOe(),OMe()]}var MMe=O(()=>{m();$ke();oMe();uke();Lxe();S1e();wMe();Nke();cMe();V1e();xwe();wwe();uBe();Kwe();fMe();_Me();EBe();OBe();qBe();iNe();hNe();eMe();gOe();SOe();Awe();KNe();Tke();Jke()});function UMe(e,t={}){e.getOptions().debug&&rY();let[n,r]=rbt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function rbt(e,t={}){let n=new PMe.BasicTracerProvider({sampler:new FQ(e),resource:(0,B3.defaultResource)().merge((0,B3.resourceFromAttributes)({[I5]:"node",[d5]:"sentry",[C5]:Wn})),forceFlushTimeoutMillis:500,spanProcessors:[new QQ({timeout:obt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Ht.setGlobalTracerProvider(n),qp.setGlobalPropagator(new LQ);let r=new jQ;return Ke.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function obt(e){if(e!=null){if(e>JJ)return ya&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${JJ}`),JJ;if(e<=0||Number.isNaN(e)){ya&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var B3,PMe,JJ,LMe=O(()=>{m();je();B3=ie(g7(),1),PMe=ie(j7(),1);Zn();dt();mr();uv();ly();JJ=1e6});function QMe(){return KQ().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(fxe(),Txe())}function FMe(e){return[...QMe(),...xi(e)?kMe():[]]}function ZJ(e={}){return ibt(e,FMe)}function ibt(e={},t){YS(e,"node");let n=DY({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(UMe(n,{spanProcessors:e.openTelemetrySpanProcessors}),JQ()),n}var GMe=O(()=>{m();dt();mr();Axe();Ixe();MMe();LMe()});var sR=O(()=>{m();GMe();dt();mr()});function Ni(){return abt}function Yu(){return jMe}function HMe(){return sbt}var abt,jMe,sbt,Gl=O(()=>{"use strict";m();abt="prod",jMe="0.1.133",sbt=`@tanagram/lore/${jMe}`});function pbt(e=""){if(!lbt.test(e))return e!==e.toLowerCase()}function zMe(e,t){let n=t??dbt,r=[];if(!e||typeof e!="string")return r;let o="",i,a;for(let c of e){let d=n.includes(c);if(d===!0){r.push(o),o="",i=void 0;continue}let g=pbt(c);if(a===!1){if(i===!1&&g===!0){r.push(o),o=c,i=g;continue}if(i===!0&&g===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=g;continue}}o+=c,i=g,a=d}return r.push(o),r}function fbt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Abt(e){return e?e[0].toLowerCase()+e.slice(1):""}function mbt(e,t){return e?(Array.isArray(e)?e:zMe(e)).map(n=>fbt(t?.normalize?n.toLowerCase():n)).join(""):""}function bO(e,t){return Abt(mbt(e||"",t))}function N3(e,t){return e?(Array.isArray(e)?e:zMe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function $Me(e){return N3(e||"","_")}var lbt,dbt,VMe=O(()=>{m();lbt=/\d/,dbt=["-","_","/","."]});import{parseArgs as gbt}from"node:util";function M3(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function WJ(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
38
+ Mongoose Error Code: ${t.code}`:""}`})}function BK(e,t,n,r=void 0){n&&(0,KN.safeExecuteInTheMiddle)(()=>n(e,{moduleVersion:r,response:t}),o=>{o&&wBe.diag.error("mongoose instrumentation: responseHook error",o)},!0)}function bSt(e,t,n,r=void 0){return e instanceof Promise?e.then(o=>(BK(t,o,n,r),o)).catch(o=>{throw kBe(t,o),o}).finally(()=>t.end()):(BK(t,e,n,r),t.end(),e)}z_.handlePromiseResponse=bSt;function vSt(e,t,n,r,o,i,a=void 0){let c=0;return o.length===2?c=1:o.length===3&&(c=2),o[c]=(d,g)=>(d?kBe(r,d):BK(r,g,i,a),r.end(),e(d,g)),t.apply(n,o)}z_.handleCallbackResponse=vSt});var PBe=F(Bv=>{"use strict";m();Object.defineProperty(Bv,"__esModule",{value:!0});Bv.PACKAGE_NAME=Bv.PACKAGE_VERSION=void 0;Bv.PACKAGE_VERSION="0.60.0";Bv.PACKAGE_NAME="@opentelemetry/instrumentation-mongoose"});var GBe=F(Uc=>{"use strict";m();Object.defineProperty(Uc,"__esModule",{value:!0});Uc.MongooseInstrumentation=Uc._ALREADY_INSTRUMENTED=Uc._STORED_PARENT_SPAN=void 0;var Ia=(je(),Me(We)),RSt=Tr(),NK=MBe(),Ns=rn(),UBe=PBe(),$_=DK(),hy=(Zn(),Me(Ur)),nF=["deleteOne","deleteMany","find","findOne","estimatedDocumentCount","countDocuments","distinct","where","$where","findOneAndUpdate","findOneAndDelete","findOneAndReplace"],xSt=["remove","count","findOneAndRemove",...nF],DSt=["count","findOneAndRemove",...nF],BSt=[...nF];function LBe(e){return e?e.startsWith("6.")||e.startsWith("5.")?xSt:e.startsWith("7.")?DSt:BSt:nF}function QBe(e){return e&&(e.startsWith("5.")||e.startsWith("6."))||!1}function FBe(e){return!e||!e.startsWith("8.")?!1:parseInt(e.split(".")[1],10)>=21}Uc._STORED_PARENT_SPAN=Symbol("stored-parent-span");Uc._ALREADY_INSTRUMENTED=Symbol("already-instrumented");var OK=class extends Ns.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(UBe.PACKAGE_NAME,UBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Ns.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Ns.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new Ns.InstrumentationNodeModuleDefinition("mongoose",[">=5.9.7 <10"],this.patch.bind(this),this.unpatch.bind(this))}patch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t;return this._wrap(r.Model.prototype,"save",this.patchOnModelMethods("save",n)),r.Model.prototype.$save=r.Model.prototype.save,QBe(n)&&this._wrap(r.Model.prototype,"remove",this.patchOnModelMethods("remove",n)),FBe(n)&&(this._wrap(r.Model.prototype,"updateOne",this._patchDocumentUpdateMethods("updateOne",n)),this._wrap(r.Model.prototype,"deleteOne",this._patchDocumentUpdateMethods("deleteOne",n))),this._wrap(r.Query.prototype,"exec",this.patchQueryExec(n)),this._wrap(r.Aggregate.prototype,"exec",this.patchAggregateExec(n)),LBe(n).forEach(i=>{this._wrap(r.Query.prototype,i,this.patchAndCaptureSpanContext(i))}),this._wrap(r.Model,"aggregate",this.patchModelAggregate()),this._wrap(r.Model,"insertMany",this.patchModelStatic("insertMany",n)),this._wrap(r.Model,"bulkWrite",this.patchModelStatic("bulkWrite",n)),r}unpatch(t,n){let r=t[Symbol.toStringTag]==="Module"?t.default:t,o=LBe(n);this._unwrap(r.Model.prototype,"save"),r.Model.prototype.$save=r.Model.prototype.save,QBe(n)&&this._unwrap(r.Model.prototype,"remove"),FBe(n)&&(this._unwrap(r.Model.prototype,"updateOne"),this._unwrap(r.Model.prototype,"deleteOne")),this._unwrap(r.Query.prototype,"exec"),this._unwrap(r.Aggregate.prototype,"exec"),o.forEach(i=>{this._unwrap(r.Query.prototype,i)}),this._unwrap(r.Model,"aggregate"),this._unwrap(r.Model,"insertMany"),this._unwrap(r.Model,"bulkWrite")}patchAggregateExec(t){let n=this;return r=>function(i){if(n.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return r.apply(this,arguments);let a=this[Uc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d("aggregate",{options:this.options,aggregatePipeline:this._pipeline});n._dbSemconvStability&Ns.SemconvStability.OLD&&(c[$_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ns.SemconvStability.STABLE&&(c[hy.ATTR_DB_QUERY_TEXT]=h)}let g=n._startSpan(this._model.collection,this._model?.modelName,"aggregate",c,a);return n._handleResponse(g,r,this,arguments,i,t)}}patchQueryExec(t){let n=this;return r=>function(i){if(this[Uc._ALREADY_INSTRUMENTED])return r.apply(this,arguments);if(n.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return r.apply(this,arguments);let a=this[Uc._STORED_PARENT_SPAN],c={},{dbStatementSerializer:d}=n.getConfig();if(d){let h=d(this.op,{condition:this.getFilter?.()??this._conditions,updates:this._update,options:this.getOptions?.()??this.options,fields:this._fields});n._dbSemconvStability&Ns.SemconvStability.OLD&&(c[$_.ATTR_DB_STATEMENT]=h),n._dbSemconvStability&Ns.SemconvStability.STABLE&&(c[hy.ATTR_DB_QUERY_TEXT]=h)}let g=n._startSpan(this.mongooseCollection,this.model.modelName,this.op,c,a);return n._handleResponse(g,r,this,arguments,i,t)}}patchOnModelMethods(t,n){let r=this;return o=>function(a,c){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);let d={document:this};a&&!(a instanceof Function)&&(d.options=a);let g={},{dbStatementSerializer:h}=r.getConfig();if(h){let y=h(t,d);r._dbSemconvStability&Ns.SemconvStability.OLD&&(g[$_.ATTR_DB_STATEMENT]=y),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(g[hy.ATTR_DB_QUERY_TEXT]=y)}let S=r._startSpan(this.constructor.collection,this.constructor.modelName,t,g);return a instanceof Function&&(c=a,a=void 0),r._handleResponse(S,o,this,arguments,c,n)}}_patchDocumentUpdateMethods(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);let g=d,h=a,S=c;typeof a=="function"?(g=a,h=void 0,S=void 0):typeof c=="function"&&(g=c,S=void 0);let y={},C=r.getConfig().dbStatementSerializer;if(C){let N=C(t,{condition:{_id:this._id},updates:h,options:S});r._dbSemconvStability&Ns.SemconvStability.OLD&&(y[$_.ATTR_DB_STATEMENT]=N),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(y[hy.ATTR_DB_QUERY_TEXT]=N)}let v=r._startSpan(this.constructor.collection,this.constructor.modelName,t,y),x=r._handleResponse(v,o,this,arguments,g,n);return x&&typeof x=="object"&&(x[Uc._ALREADY_INSTRUMENTED]=!0),x}}patchModelStatic(t,n){let r=this;return o=>function(a,c,d){if(r.getConfig().requireParentSpan&&Ia.trace.getSpan(Ia.context.active())===void 0)return o.apply(this,arguments);typeof c=="function"&&(d=c,c=void 0);let g={};switch(t){case"insertMany":g.documents=a;break;case"bulkWrite":g.operations=a;break;default:g.document=a;break}c!==void 0&&(g.options=c);let h={},{dbStatementSerializer:S}=r.getConfig();if(S){let C=S(t,g);r._dbSemconvStability&Ns.SemconvStability.OLD&&(h[$_.ATTR_DB_STATEMENT]=C),r._dbSemconvStability&Ns.SemconvStability.STABLE&&(h[hy.ATTR_DB_QUERY_TEXT]=C)}let y=r._startSpan(this.collection,this.modelName,t,h);return r._handleResponse(y,o,this,arguments,d,n)}}patchModelAggregate(){let t=this;return n=>function(){let o=Ia.trace.getSpan(Ia.context.active()),i=t._callOriginalFunction(()=>n.apply(this,arguments));return i&&(i[Uc._STORED_PARENT_SPAN]=o),i}}patchAndCaptureSpanContext(t){let n=this;return r=>function(){return this[Uc._STORED_PARENT_SPAN]=Ia.trace.getSpan(Ia.context.active()),n._callOriginalFunction(()=>r.apply(this,arguments))}}_startSpan(t,n,r,o,i){let a={...o,...(0,NK.getAttributesFromCollection)(t,this._dbSemconvStability,this._netSemconvStability)};this._dbSemconvStability&Ns.SemconvStability.OLD&&(a[$_.ATTR_DB_OPERATION]=r,a[$_.ATTR_DB_SYSTEM]="mongoose"),this._dbSemconvStability&Ns.SemconvStability.STABLE&&(a[hy.ATTR_DB_OPERATION_NAME]=r,a[hy.ATTR_DB_SYSTEM_NAME]=$_.DB_SYSTEM_NAME_VALUE_MONGODB);let c=this._dbSemconvStability&Ns.SemconvStability.STABLE?`${r} ${t.name}`:`mongoose.${n}.${r}`;return this.tracer.startSpan(c,{kind:Ia.SpanKind.CLIENT,attributes:a},i?Ia.trace.setSpan(Ia.context.active(),i):void 0)}_handleResponse(t,n,r,o,i,a=void 0){let c=this;if(i instanceof Function)return c._callOriginalFunction(()=>(0,NK.handleCallbackResponse)(i,n,r,t,o,c.getConfig().responseHook,a));{let d=c._callOriginalFunction(()=>n.apply(r,o));return(0,NK.handlePromiseResponse)(d,t,c.getConfig().responseHook,a)}}_callOriginalFunction(t){return this.getConfig().suppressInternalInstrumentation?Ia.context.with((0,RSt.suppressTracing)(Ia.context.active()),t):t()}};Uc.MongooseInstrumentation=OK});var jBe=F(rF=>{"use strict";m();Object.defineProperty(rF,"__esModule",{value:!0});rF.MongooseInstrumentation=void 0;var NSt=GBe();Object.defineProperty(rF,"MongooseInstrumentation",{enumerable:!0,get:function(){return NSt.MongooseInstrumentation}})});var HBe,zBe,$Be,OSt,VBe,qBe=O(()=>{m();HBe=ie(jBe(),1);mr();zBe="Mongoose",$Be=st(zBe,()=>new HBe.MongooseInstrumentation({responseHook(e){Lr(e,"auto.db.otel.mongoose")}})),OSt=()=>({name:zBe,setupOnce(){$Be()}}),VBe=OSt});var YBe=F(ta=>{"use strict";m();Object.defineProperty(ta,"__esModule",{value:!0});ta.METRIC_DB_CLIENT_CONNECTIONS_USAGE=ta.DB_SYSTEM_VALUE_MYSQL=ta.ATTR_NET_PEER_PORT=ta.ATTR_NET_PEER_NAME=ta.ATTR_DB_USER=ta.ATTR_DB_SYSTEM=ta.ATTR_DB_STATEMENT=ta.ATTR_DB_NAME=ta.ATTR_DB_CONNECTION_STRING=void 0;ta.ATTR_DB_CONNECTION_STRING="db.connection_string";ta.ATTR_DB_NAME="db.name";ta.ATTR_DB_STATEMENT="db.statement";ta.ATTR_DB_SYSTEM="db.system";ta.ATTR_DB_USER="db.user";ta.ATTR_NET_PEER_NAME="net.peer.name";ta.ATTR_NET_PEER_PORT="net.peer.port";ta.DB_SYSTEM_VALUE_MYSQL="mysql";ta.METRIC_DB_CLIENT_CONNECTIONS_USAGE="db.client.connections.usage"});var KBe=F(JN=>{"use strict";m();Object.defineProperty(JN,"__esModule",{value:!0});JN.AttributeNames=void 0;var wSt;(function(e){e.MYSQL_VALUES="db.mysql.values"})(wSt=JN.AttributeNames||(JN.AttributeNames={}))});var JBe=F(iu=>{"use strict";m();Object.defineProperty(iu,"__esModule",{value:!0});iu.getPoolNameOld=iu.arrayStringifyHelper=iu.getSpanName=iu.getDbValues=iu.getDbQueryText=iu.getJDBCString=iu.getConfig=void 0;function kSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}iu.getConfig=kSt;function MSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}iu.getJDBCString=MSt;function PSt(e){return typeof e=="string"?e:e.sql}iu.getDbQueryText=PSt;function USt(e,t){return wK(typeof e=="string"?t:t||e.values)}iu.getDbValues=USt;function LSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}iu.getSpanName=LSt;function wK(e){return e?`[${e.toString()}]`:""}iu.arrayStringifyHelper=wK;function QSt(e){let t=e.config.connectionConfig,n="";return n+=t.host?`host: '${t.host}', `:"",n+=t.port?`port: ${t.port}, `:"",n+=t.database?`database: '${t.database}', `:"",n+=t.user?`user: '${t.user}'`:"",t.user||(n=n.substring(0,n.length-2)),n.trim()}iu.getPoolNameOld=QSt});var ZBe=F(Nv=>{"use strict";m();Object.defineProperty(Nv,"__esModule",{value:!0});Nv.PACKAGE_NAME=Nv.PACKAGE_VERSION=void 0;Nv.PACKAGE_VERSION="0.60.0";Nv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql"});var XBe=F(oF=>{"use strict";m();Object.defineProperty(oF,"__esModule",{value:!0});oF.MySQLInstrumentation=void 0;var Lc=(je(),Me(We)),$d=rn(),Ov=(Zn(),Me(Ur)),xg=YBe(),FSt=KBe(),_y=JBe(),WBe=ZBe(),kK=class extends $d.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(WBe.PACKAGE_NAME,WBe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,$d.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,$d.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._connectionsUsageOld=this.meter.createUpDownCounter(xg.METRIC_DB_CLIENT_CONNECTIONS_USAGE,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"})}_connCountAdd(t,n,r){this._connectionsUsageOld?.add(t,{state:r,name:n})}init(){return[new $d.InstrumentationNodeModuleDefinition("mysql",[">=2.0.0 <3"],t=>((0,$d.isWrapped)(t.createConnection)&&this._unwrap(t,"createConnection"),this._wrap(t,"createConnection",this._patchCreateConnection()),(0,$d.isWrapped)(t.createPool)&&this._unwrap(t,"createPool"),this._wrap(t,"createPool",this._patchCreatePool()),(0,$d.isWrapped)(t.createPoolCluster)&&this._unwrap(t,"createPoolCluster"),this._wrap(t,"createPoolCluster",this._patchCreatePoolCluster()),t),t=>{t!==void 0&&(this._unwrap(t,"createConnection"),this._unwrap(t,"createPool"),this._unwrap(t,"createPoolCluster"))})]}_patchCreateConnection(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),i}}}_patchCreatePool(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"query",n._patchQuery(i)),n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"end",n._patchPoolEnd(i)),n._setPoolCallbacks(i,""),i}}}_patchPoolEnd(t){return n=>{let r=this;return function(i){let a=t._allConnections.length,c=t._freeConnections.length,d=a-c,g=(0,_y.getPoolNameOld)(t);r._connCountAdd(-d,g,"used"),r._connCountAdd(-c,g,"idle"),n.apply(t,arguments)}}}_patchCreatePoolCluster(){return t=>{let n=this;return function(o){let i=t(...arguments);return n._wrap(i,"getConnection",n._patchGetConnection(i)),n._wrap(i,"add",n._patchAdd(i)),i}}}_patchAdd(t){return n=>{let r=this;return function(i,a){if(!r._enabled)return r._unwrap(t,"add"),n.apply(t,arguments);n.apply(t,arguments);let c=t._nodes;if(c){let d=typeof i=="object"?"CLUSTER::"+t._lastId:String(i),g=c[d].pool;r._setPoolCallbacks(g,i)}}}}_patchGetConnection(t){return n=>{let r=this;return function(i,a,c){if(!r._enabled)return r._unwrap(t,"getConnection"),n.apply(t,arguments);if(arguments.length===1&&typeof i=="function"){let d=r._getConnectionCallbackPatchFn(i);return n.call(t,d)}if(arguments.length===2&&typeof a=="function"){let d=r._getConnectionCallbackPatchFn(a);return n.call(t,i,d)}if(arguments.length===3&&typeof c=="function"){let d=r._getConnectionCallbackPatchFn(c);return n.call(t,i,a,d)}return n.apply(t,arguments)}}}_getConnectionCallbackPatchFn(t){let n=this,r=Lc.context.active();return function(o,i){i&&((0,$d.isWrapped)(i.query)||n._wrap(i,"query",n._patchQuery(i))),typeof t=="function"&&Lc.context.with(r,t,this,o,i)}}_patchQuery(t){return n=>{let r=this;return function(o,i,a){if(!r._enabled)return r._unwrap(t,"query"),n.apply(t,arguments);let c={},{host:d,port:g,database:h,user:S}=(0,_y.getConfig)(t.config),y=parseInt(g,10),C=(0,_y.getDbQueryText)(o);r._dbSemconvStability&$d.SemconvStability.OLD&&(c[xg.ATTR_DB_SYSTEM]=xg.DB_SYSTEM_VALUE_MYSQL,c[xg.ATTR_DB_CONNECTION_STRING]=(0,_y.getJDBCString)(d,g,h),c[xg.ATTR_DB_NAME]=h,c[xg.ATTR_DB_USER]=S,c[xg.ATTR_DB_STATEMENT]=C),r._dbSemconvStability&$d.SemconvStability.STABLE&&(c[Ov.ATTR_DB_SYSTEM_NAME]=Ov.DB_SYSTEM_NAME_VALUE_MYSQL,c[Ov.ATTR_DB_NAMESPACE]=h,c[Ov.ATTR_DB_QUERY_TEXT]=C),r._netSemconvStability&$d.SemconvStability.OLD&&(c[xg.ATTR_NET_PEER_NAME]=d,isNaN(y)||(c[xg.ATTR_NET_PEER_PORT]=y)),r._netSemconvStability&$d.SemconvStability.STABLE&&(c[Ov.ATTR_SERVER_ADDRESS]=d,isNaN(y)||(c[Ov.ATTR_SERVER_PORT]=y));let v=r.tracer.startSpan((0,_y.getSpanName)(o),{kind:Lc.SpanKind.CLIENT,attributes:c});if(r.getConfig().enhancedDatabaseReporting){let k;Array.isArray(i)?k=i:arguments[2]&&(k=[i]),v.setAttribute(FSt.AttributeNames.MYSQL_VALUES,(0,_y.getDbValues)(o,k))}let x=Array.from(arguments).findIndex(k=>typeof k=="function"),N=Lc.context.active();if(x===-1){let k=Lc.context.with(Lc.trace.setSpan(Lc.context.active(),v),()=>n.apply(t,arguments));return Lc.context.bind(N,k),k.on("error",Q=>v.setStatus({code:Lc.SpanStatusCode.ERROR,message:Q.message})).on("end",()=>{v.end()})}else return r._wrap(arguments,x,r._patchCallbackQuery(v,N)),Lc.context.with(Lc.trace.setSpan(Lc.context.active(),v),()=>n.apply(t,arguments))}}}_patchCallbackQuery(t,n){return r=>function(o,i,a){return o&&t.setStatus({code:Lc.SpanStatusCode.ERROR,message:o.message}),t.end(),Lc.context.with(n,()=>r(...arguments))}}_setPoolCallbacks(t,n){let r=n||(0,_y.getPoolNameOld)(t);t.on("connection",o=>{this._connCountAdd(1,r,"idle")}),t.on("acquire",o=>{this._connCountAdd(-1,r,"idle"),this._connCountAdd(1,r,"used")}),t.on("release",o=>{this._connCountAdd(1,r,"idle"),this._connCountAdd(-1,r,"used")})}};oF.MySQLInstrumentation=kK});var eNe=F(iF=>{"use strict";m();Object.defineProperty(iF,"__esModule",{value:!0});iF.MySQLInstrumentation=void 0;var GSt=XBe();Object.defineProperty(iF,"MySQLInstrumentation",{enumerable:!0,get:function(){return GSt.MySQLInstrumentation}})});var tNe,nNe,rNe,jSt,oNe,iNe=O(()=>{m();tNe=ie(eNe(),1);mr();nNe="Mysql",rNe=st(nNe,()=>new tNe.MySQLInstrumentation({})),jSt=()=>({name:nNe,setupOnce(){rNe()}}),oNe=jSt});var MK=F(ts=>{"use strict";m();Object.defineProperty(ts,"__esModule",{value:!0});ts.DB_SYSTEM_VALUE_MYSQL=ts.ATTR_NET_PEER_PORT=ts.ATTR_NET_PEER_NAME=ts.ATTR_DB_USER=ts.ATTR_DB_SYSTEM=ts.ATTR_DB_STATEMENT=ts.ATTR_DB_NAME=ts.ATTR_DB_CONNECTION_STRING=void 0;ts.ATTR_DB_CONNECTION_STRING="db.connection_string";ts.ATTR_DB_NAME="db.name";ts.ATTR_DB_STATEMENT="db.statement";ts.ATTR_DB_SYSTEM="db.system";ts.ATTR_DB_USER="db.user";ts.ATTR_NET_PEER_NAME="net.peer.name";ts.ATTR_NET_PEER_PORT="net.peer.port";ts.DB_SYSTEM_VALUE_MYSQL="mysql"});var UK=F(aF=>{"use strict";m();Object.defineProperty(aF,"__esModule",{value:!0});aF.addSqlCommenterComment=void 0;var PK=(je(),Me(We)),HSt=Tr();function zSt(e){let t=e.indexOf("--");if(t>=0)return!0;if(e.indexOf("/*")<0)return!1;let r=e.indexOf("*/");return t<r}function $St(e){return encodeURIComponent(e).replace(/[!'()*]/g,t=>`%${t.charCodeAt(0).toString(16).toUpperCase()}`)}function VSt(e,t){if(typeof t!="string"||t.length===0||zSt(t))return t;let n=new HSt.W3CTraceContextPropagator,r={};n.inject(PK.trace.setSpan(PK.ROOT_CONTEXT,e),r,PK.defaultTextMapSetter);let o=Object.keys(r).sort();if(o.length===0)return t;let i=o.map(a=>{let c=$St(r[a]);return`${a}='${c}'`}).join(",");return`${t} /*${i}*/`}aF.addSqlCommenterComment=VSt});var aNe=F(Vd=>{"use strict";m();Object.defineProperty(Vd,"__esModule",{value:!0});Vd.getConnectionPrototypeToInstrument=Vd.once=Vd.getSpanName=Vd.getQueryText=Vd.getConnectionAttributes=void 0;var ZN=MK(),sF=rn(),LK=(Zn(),Me(Ur));function qSt(e,t,n){let{host:r,port:o,database:i,user:a}=YSt(e),c={};t&sF.SemconvStability.OLD&&(c[ZN.ATTR_DB_CONNECTION_STRING]=KSt(r,o,i),c[ZN.ATTR_DB_NAME]=i,c[ZN.ATTR_DB_USER]=a),t&sF.SemconvStability.STABLE&&(c[LK.ATTR_DB_NAMESPACE]=i);let d=parseInt(o,10);return n&sF.SemconvStability.OLD&&(c[ZN.ATTR_NET_PEER_NAME]=r,isNaN(d)||(c[ZN.ATTR_NET_PEER_PORT]=d)),n&sF.SemconvStability.STABLE&&(c[LK.ATTR_SERVER_ADDRESS]=r,isNaN(d)||(c[LK.ATTR_SERVER_PORT]=d)),c}Vd.getConnectionAttributes=qSt;function YSt(e){let{host:t,port:n,database:r,user:o}=e&&e.connectionConfig||e||{};return{host:t,port:n,database:r,user:o}}function KSt(e,t,n){let r=`jdbc:mysql://${e||"localhost"}`;return typeof t=="number"&&(r+=`:${t}`),typeof n=="string"&&(r+=`/${n}`),r}function JSt(e,t,n,r=!1,o=ZSt){let[i,a]=typeof e=="string"?[e,n]:[e.sql,WSt(e)?n||e.values:n];try{return r?o(i):t&&a?t(i,a):i}catch{return"Could not determine the query due to an error in masking or formatting"}}Vd.getQueryText=JSt;function ZSt(e){return e.replace(/\b\d+\b/g,"?").replace(/(["'])(?:(?=(\\?))\2.)*?\1/g,"?")}function WSt(e){return"values"in e}function XSt(e){let t=typeof e=="object"?e.sql:e,n=t?.indexOf(" ");return typeof n=="number"&&n!==-1?t?.substring(0,n):t}Vd.getSpanName=XSt;var eyt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Vd.once=eyt;function tyt(e){let t=e.prototype,n=Object.getPrototypeOf(t);return typeof n?.query=="function"&&typeof n?.execute=="function"?n:t}Vd.getConnectionPrototypeToInstrument=tyt});var sNe=F(wv=>{"use strict";m();Object.defineProperty(wv,"__esModule",{value:!0});wv.PACKAGE_NAME=wv.PACKAGE_VERSION=void 0;wv.PACKAGE_VERSION="0.60.0";wv.PACKAGE_NAME="@opentelemetry/instrumentation-mysql2"});var dNe=F(uF=>{"use strict";m();Object.defineProperty(uF,"__esModule",{value:!0});uF.MySQL2Instrumentation=void 0;var uNe=(je(),Me(We)),uf=rn(),QK=MK(),cNe=UK(),kv=aNe(),lNe=sNe(),FK=(Zn(),Me(Ur)),GK=[">=1.4.2 <4"],jK=class extends uf.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(lNe.PACKAGE_NAME,lNe.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,uf.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,uf.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){let t;function n(i){!t&&i.format&&(t=i.format)}let r=i=>{(0,uf.isWrapped)(i.query)&&this._unwrap(i,"query"),this._wrap(i,"query",this._patchQuery(t,!1)),(0,uf.isWrapped)(i.execute)&&this._unwrap(i,"execute"),this._wrap(i,"execute",this._patchQuery(t,!0))},o=i=>{this._unwrap(i,"query"),this._unwrap(i,"execute")};return[new uf.InstrumentationNodeModuleDefinition("mysql2",GK,i=>(n(i),i),()=>{},[new uf.InstrumentationNodeModuleFile("mysql2/promise.js",GK,i=>(n(i),i),()=>{}),new uf.InstrumentationNodeModuleFile("mysql2/lib/connection.js",GK,i=>{let a=(0,kv.getConnectionPrototypeToInstrument)(i);return r(a),i},i=>{if(i===void 0)return;let a=(0,kv.getConnectionPrototypeToInstrument)(i);o(a)})])]}_patchQuery(t,n){return r=>{let o=this;return function(i,a,c){let d;Array.isArray(a)?d=a:arguments[2]&&(d=[a]);let{maskStatement:g,maskStatementHook:h,responseHook:S}=o.getConfig(),y=(0,kv.getConnectionAttributes)(this.config,o._dbSemconvStability,o._netSemconvStability),C=(0,kv.getQueryText)(i,t,d,g,h);o._dbSemconvStability&uf.SemconvStability.OLD&&(y[QK.ATTR_DB_SYSTEM]=QK.DB_SYSTEM_VALUE_MYSQL,y[QK.ATTR_DB_STATEMENT]=C),o._dbSemconvStability&uf.SemconvStability.STABLE&&(y[FK.ATTR_DB_SYSTEM_NAME]=FK.DB_SYSTEM_NAME_VALUE_MYSQL,y[FK.ATTR_DB_QUERY_TEXT]=C);let v=o.tracer.startSpan((0,kv.getSpanName)(i),{kind:uNe.SpanKind.CLIENT,attributes:y});!n&&o.getConfig().addSqlCommenterCommentToQueries&&(arguments[0]=i=typeof i=="string"?(0,cNe.addSqlCommenterComment)(v,i):Object.assign(i,{sql:(0,cNe.addSqlCommenterComment)(v,i.sql)}));let x=(0,kv.once)((N,k)=>{N?v.setStatus({code:uNe.SpanStatusCode.ERROR,message:N.message}):typeof S=="function"&&(0,uf.safeExecuteInTheMiddle)(()=>{S(v,{queryResults:k})},Q=>{Q&&o._diag.warn("Failed executing responseHook",Q)},!0),v.end()});if(arguments.length===1){typeof i.onResult=="function"&&o._wrap(i,"onResult",o._patchCallbackQuery(x));let N=r.apply(this,arguments);return N.once("error",k=>{x(k)}).once("result",k=>{x(void 0,k)}),N}return typeof arguments[1]=="function"?o._wrap(arguments,1,o._patchCallbackQuery(x)):typeof arguments[2]=="function"&&o._wrap(arguments,2,o._patchCallbackQuery(x)),r.apply(this,arguments)}}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r,o),n(...arguments)}}};uF.MySQL2Instrumentation=jK});var pNe=F(cF=>{"use strict";m();Object.defineProperty(cF,"__esModule",{value:!0});cF.MySQL2Instrumentation=void 0;var nyt=dNe();Object.defineProperty(cF,"MySQL2Instrumentation",{enumerable:!0,get:function(){return nyt.MySQL2Instrumentation}})});var fNe,ANe,mNe,ryt,gNe,hNe=O(()=>{m();fNe=ie(pNe(),1);mr();ANe="Mysql2",mNe=st(ANe,()=>new fNe.MySQL2Instrumentation({responseHook(e){Lr(e,"auto.db.otel.mysql2")}})),ryt=()=>({name:ANe,setupOnce(){mNe()}}),gNe=ryt});var _Ne=F(au=>{"use strict";m();Object.defineProperty(au,"__esModule",{value:!0});au.DB_SYSTEM_VALUE_REDIS=au.DB_SYSTEM_NAME_VALUE_REDIS=au.ATTR_NET_PEER_PORT=au.ATTR_NET_PEER_NAME=au.ATTR_DB_SYSTEM=au.ATTR_DB_STATEMENT=au.ATTR_DB_CONNECTION_STRING=void 0;au.ATTR_DB_CONNECTION_STRING="db.connection_string";au.ATTR_DB_STATEMENT="db.statement";au.ATTR_DB_SYSTEM="db.system";au.ATTR_NET_PEER_NAME="net.peer.name";au.ATTR_NET_PEER_PORT="net.peer.port";au.DB_SYSTEM_NAME_VALUE_REDIS="redis";au.DB_SYSTEM_VALUE_REDIS="redis"});var ENe=F(lF=>{"use strict";m();Object.defineProperty(lF,"__esModule",{value:!0});lF.endSpan=void 0;var oyt=(je(),Me(We)),iyt=(e,t)=>{t&&(e.recordException(t),e.setStatus({code:oyt.SpanStatusCode.ERROR,message:t.message})),e.end()};lF.endSpan=iyt});var pF=F(dF=>{"use strict";m();Object.defineProperty(dF,"__esModule",{value:!0});dF.defaultDbStatementSerializer=void 0;var ayt=[{regex:/^ECHO/i,args:0},{regex:/^(LPUSH|MSET|PFA|PUBLISH|RPUSH|SADD|SET|SPUBLISH|XADD|ZADD)/i,args:1},{regex:/^(HSET|HMSET|LSET|LINSERT)/i,args:2},{regex:/^(ACL|BIT|B[LRZ]|CLIENT|CLUSTER|CONFIG|COMMAND|DECR|DEL|EVAL|EX|FUNCTION|GEO|GET|HINCR|HMGET|HSCAN|INCR|L[TRLM]|MEMORY|P[EFISTU]|RPOP|S[CDIMORSU]|XACK|X[CDGILPRT]|Z[CDILMPRS])/i,args:-1}],syt=(e,t)=>{if(Array.isArray(t)&&t.length){let n=ayt.find(({regex:o})=>o.test(e))?.args??0,r=n>=0?t.slice(0,n):t;return t.length>r.length&&r.push(`[${t.length-n} other arguments]`),`${e} ${r.join(" ")}`}return e};dF.defaultDbStatementSerializer=syt});var SNe=F(Mv=>{"use strict";m();Object.defineProperty(Mv,"__esModule",{value:!0});Mv.PACKAGE_NAME=Mv.PACKAGE_VERSION=void 0;Mv.PACKAGE_VERSION="0.62.0";Mv.PACKAGE_NAME="@opentelemetry/instrumentation-ioredis"});var CNe=F(fF=>{"use strict";m();Object.defineProperty(fF,"__esModule",{value:!0});fF.IORedisInstrumentation=void 0;var V_=(je(),Me(We)),Qc=rn(),q_=(Zn(),Me(Ur)),Fc=_Ne(),yNe=rn(),WN=ENe(),uyt=pF(),TNe=SNe(),INe={requireParentSpan:!0},HK=class extends Qc.InstrumentationBase{_netSemconvStability;_dbSemconvStability;constructor(t={}){super(TNe.PACKAGE_NAME,TNe.PACKAGE_VERSION,{...INe,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Qc.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,Qc.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...INe,...t})}init(){return[new Qc.InstrumentationNodeModuleDefinition("ioredis",[">=2.0.0 <6"],(t,n)=>{let r=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,Qc.isWrapped)(r.prototype.sendCommand)&&this._unwrap(r.prototype,"sendCommand"),this._wrap(r.prototype,"sendCommand",this._patchSendCommand(n)),(0,Qc.isWrapped)(r.prototype.connect)&&this._unwrap(r.prototype,"connect"),this._wrap(r.prototype,"connect",this._patchConnection()),t},t=>{if(t===void 0)return;let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._unwrap(n.prototype,"sendCommand"),this._unwrap(n.prototype,"connect")})]}_patchSendCommand(t){return n=>this._traceSendCommand(n,t)}_patchConnection(){return t=>this._traceConnection(t)}_traceSendCommand(t,n){let r=this;return function(o){if(arguments.length<1||typeof o!="object")return t.apply(this,arguments);let i=r.getConfig(),a=i.dbStatementSerializer||uyt.defaultDbStatementSerializer,c=V_.trace.getSpan(V_.context.active())===void 0;if(i.requireParentSpan===!0&&c)return t.apply(this,arguments);let d={},{host:g,port:h}=this.options,S=a(o.name,o.args);r._dbSemconvStability&Qc.SemconvStability.OLD&&(d[Fc.ATTR_DB_SYSTEM]=Fc.DB_SYSTEM_VALUE_REDIS,d[Fc.ATTR_DB_STATEMENT]=S,d[Fc.ATTR_DB_CONNECTION_STRING]=`redis://${g}:${h}`),r._dbSemconvStability&Qc.SemconvStability.STABLE&&(d[q_.ATTR_DB_SYSTEM_NAME]=Fc.DB_SYSTEM_NAME_VALUE_REDIS,d[q_.ATTR_DB_QUERY_TEXT]=S),r._netSemconvStability&Qc.SemconvStability.OLD&&(d[Fc.ATTR_NET_PEER_NAME]=g,d[Fc.ATTR_NET_PEER_PORT]=h),r._netSemconvStability&Qc.SemconvStability.STABLE&&(d[q_.ATTR_SERVER_ADDRESS]=g,d[q_.ATTR_SERVER_PORT]=h);let y=r.tracer.startSpan(o.name,{kind:V_.SpanKind.CLIENT,attributes:d}),{requestHook:C}=i;C&&(0,yNe.safeExecuteInTheMiddle)(()=>C(y,{moduleVersion:n,cmdName:o.name,cmdArgs:o.args}),v=>{v&&V_.diag.error("ioredis instrumentation: request hook failed",v)},!0);try{let v=t.apply(this,arguments),x=o.resolve;o.resolve=function(k){(0,yNe.safeExecuteInTheMiddle)(()=>i.responseHook?.(y,o.name,o.args,k),Q=>{Q&&V_.diag.error("ioredis instrumentation: response hook failed",Q)},!0),(0,WN.endSpan)(y,null),x(k)};let N=o.reject;return o.reject=function(k){(0,WN.endSpan)(y,k),N(k)},v}catch(v){throw(0,WN.endSpan)(y,v),v}}}_traceConnection(t){let n=this;return function(){let r=V_.trace.getSpan(V_.context.active())===void 0;if(n.getConfig().requireParentSpan===!0&&r)return t.apply(this,arguments);let o={},{host:i,port:a}=this.options;n._dbSemconvStability&Qc.SemconvStability.OLD&&(o[Fc.ATTR_DB_SYSTEM]=Fc.DB_SYSTEM_VALUE_REDIS,o[Fc.ATTR_DB_STATEMENT]="connect",o[Fc.ATTR_DB_CONNECTION_STRING]=`redis://${i}:${a}`),n._dbSemconvStability&Qc.SemconvStability.STABLE&&(o[q_.ATTR_DB_SYSTEM_NAME]=Fc.DB_SYSTEM_NAME_VALUE_REDIS,o[q_.ATTR_DB_QUERY_TEXT]="connect"),n._netSemconvStability&Qc.SemconvStability.OLD&&(o[Fc.ATTR_NET_PEER_NAME]=i,o[Fc.ATTR_NET_PEER_PORT]=a),n._netSemconvStability&Qc.SemconvStability.STABLE&&(o[q_.ATTR_SERVER_ADDRESS]=i,o[q_.ATTR_SERVER_PORT]=a);let c=n.tracer.startSpan("connect",{kind:V_.SpanKind.CLIENT,attributes:o});try{let d=t.apply(this,arguments);return(0,WN.endSpan)(c,null),d}catch(d){throw(0,WN.endSpan)(c,d),d}}}};fF.IORedisInstrumentation=HK});var bNe=F(AF=>{"use strict";m();Object.defineProperty(AF,"__esModule",{value:!0});AF.IORedisInstrumentation=void 0;var cyt=CNe();Object.defineProperty(AF,"IORedisInstrumentation",{enumerable:!0,get:function(){return cyt.IORedisInstrumentation}})});var mF=F(Pv=>{"use strict";m();Object.defineProperty(Pv,"__esModule",{value:!0});Pv.PACKAGE_NAME=Pv.PACKAGE_VERSION=void 0;Pv.PACKAGE_VERSION="0.62.0";Pv.PACKAGE_NAME="@opentelemetry/instrumentation-redis"});var vNe=F(Y_=>{"use strict";m();Object.defineProperty(Y_,"__esModule",{value:!0});Y_.getTracedCreateStreamTrace=Y_.getTracedCreateClient=Y_.endSpan=void 0;var XN=(je(),Me(We)),lyt=(e,t)=>{t&&e.setStatus({code:XN.SpanStatusCode.ERROR,message:t.message}),e.end()};Y_.endSpan=lyt;var dyt=e=>function(){let n=e.apply(this,arguments);return XN.context.bind(XN.context.active(),n)};Y_.getTracedCreateClient=dyt;var pyt=e=>function(){return Object.prototype.hasOwnProperty.call(this,"stream")||Object.defineProperty(this,"stream",{get(){return this._patched_redis_stream},set(n){XN.context.bind(XN.context.active(),n),this._patched_redis_stream=n}}),e.apply(this,arguments)};Y_.getTracedCreateStreamTrace=pyt});var gF=F(su=>{"use strict";m();Object.defineProperty(su,"__esModule",{value:!0});su.DB_SYSTEM_VALUE_REDIS=su.DB_SYSTEM_NAME_VALUE_REDIS=su.ATTR_NET_PEER_PORT=su.ATTR_NET_PEER_NAME=su.ATTR_DB_SYSTEM=su.ATTR_DB_STATEMENT=su.ATTR_DB_CONNECTION_STRING=void 0;su.ATTR_DB_CONNECTION_STRING="db.connection_string";su.ATTR_DB_STATEMENT="db.statement";su.ATTR_DB_SYSTEM="db.system";su.ATTR_NET_PEER_NAME="net.peer.name";su.ATTR_NET_PEER_PORT="net.peer.port";su.DB_SYSTEM_NAME_VALUE_REDIS="redis";su.DB_SYSTEM_VALUE_REDIS="redis"});var xNe=F(_F=>{"use strict";m();Object.defineProperty(_F,"__esModule",{value:!0});_F.RedisInstrumentationV2_V3=void 0;var Ll=rn(),hF=vNe(),RNe=mF(),eO=(je(),Me(We)),tO=(Zn(),Me(Ur)),Ey=gF(),fyt=pF(),zK=class e extends Ll.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(RNe.PACKAGE_NAME,RNe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ll.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,Ll.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new Ll.InstrumentationNodeModuleDefinition("redis",[">=2.6.0 <4"],t=>((0,Ll.isWrapped)(t.RedisClient.prototype.internal_send_command)&&this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._wrap(t.RedisClient.prototype,"internal_send_command",this._getPatchInternalSendCommand()),(0,Ll.isWrapped)(t.RedisClient.prototype.create_stream)&&this._unwrap(t.RedisClient.prototype,"create_stream"),this._wrap(t.RedisClient.prototype,"create_stream",this._getPatchCreateStream()),(0,Ll.isWrapped)(t.createClient)&&this._unwrap(t,"createClient"),this._wrap(t,"createClient",this._getPatchCreateClient()),t),t=>{t!==void 0&&(this._unwrap(t.RedisClient.prototype,"internal_send_command"),this._unwrap(t.RedisClient.prototype,"create_stream"),this._unwrap(t,"createClient"))})]}_getPatchInternalSendCommand(){let t=this;return function(r){return function(i){if(arguments.length!==1||typeof i!="object")return r.apply(this,arguments);let a=t.getConfig(),c=eO.trace.getSpan(eO.context.active())===void 0;if(a.requireParentSpan===!0&&c)return r.apply(this,arguments);let d=a?.dbStatementSerializer||fyt.defaultDbStatementSerializer,g={};t._semconvStability&Ll.SemconvStability.OLD&&Object.assign(g,{[Ey.ATTR_DB_SYSTEM]:Ey.DB_SYSTEM_VALUE_REDIS,[Ey.ATTR_DB_STATEMENT]:d(i.command,i.args)}),t._semconvStability&Ll.SemconvStability.STABLE&&Object.assign(g,{[tO.ATTR_DB_SYSTEM_NAME]:Ey.DB_SYSTEM_NAME_VALUE_REDIS,[tO.ATTR_DB_OPERATION_NAME]:i.command,[tO.ATTR_DB_QUERY_TEXT]:d(i.command,i.args)});let h=t.tracer.startSpan(`${e.COMPONENT}-${i.command}`,{kind:eO.SpanKind.CLIENT,attributes:g});if(this.connection_options){let y={};t._semconvStability&Ll.SemconvStability.OLD&&Object.assign(y,{[Ey.ATTR_NET_PEER_NAME]:this.connection_options.host,[Ey.ATTR_NET_PEER_PORT]:this.connection_options.port}),t._semconvStability&Ll.SemconvStability.STABLE&&Object.assign(y,{[tO.ATTR_SERVER_ADDRESS]:this.connection_options.host,[tO.ATTR_SERVER_PORT]:this.connection_options.port}),h.setAttributes(y)}this.address&&t._semconvStability&Ll.SemconvStability.OLD&&h.setAttribute(Ey.ATTR_DB_CONNECTION_STRING,`redis://${this.address}`);let S=arguments[0].callback;if(S){let y=eO.context.active();arguments[0].callback=function(v,x){if(a?.responseHook){let N=a.responseHook;(0,Ll.safeExecuteInTheMiddle)(()=>{N(h,i.command,i.args,x)},k=>{k&&t._diag.error("Error executing responseHook",k)},!0)}return(0,hF.endSpan)(h,v),eO.context.with(y,S,this,...arguments)}}try{return r.apply(this,arguments)}catch(y){throw(0,hF.endSpan)(h,y),y}}}}_getPatchCreateClient(){return function(n){return(0,hF.getTracedCreateClient)(n)}}_getPatchCreateStream(){return function(n){return(0,hF.getTracedCreateStreamTrace)(n)}}};_F.RedisInstrumentationV2_V3=zK});var BNe=F(EF=>{"use strict";m();Object.defineProperty(EF,"__esModule",{value:!0});EF.getClientAttributes=void 0;var $K=(Zn(),Me(Ur)),Uv=gF(),DNe=rn();function Ayt(e,t,n){let r={};return n&DNe.SemconvStability.OLD&&Object.assign(r,{[Uv.ATTR_DB_SYSTEM]:Uv.DB_SYSTEM_VALUE_REDIS,[Uv.ATTR_NET_PEER_NAME]:t?.socket?.host,[Uv.ATTR_NET_PEER_PORT]:t?.socket?.port,[Uv.ATTR_DB_CONNECTION_STRING]:myt(e,t?.url)}),n&DNe.SemconvStability.STABLE&&Object.assign(r,{[$K.ATTR_DB_SYSTEM_NAME]:Uv.DB_SYSTEM_NAME_VALUE_REDIS,[$K.ATTR_SERVER_ADDRESS]:t?.socket?.host,[$K.ATTR_SERVER_PORT]:t?.socket?.port}),r}EF.getClientAttributes=Ayt;function myt(e,t){if(!(typeof t!="string"||!t))try{let n=new URL(t);return n.searchParams.delete("user_pwd"),n.username="",n.password="",n.href}catch(n){e.error("failed to sanitize redis connection url",n)}}});var kNe=F(SF=>{"use strict";m();Object.defineProperty(SF,"__esModule",{value:!0});SF.RedisInstrumentationV4_V5=void 0;var qd=(je(),Me(We)),So=rn(),NNe=BNe(),gyt=pF(),ONe=mF(),VK=(Zn(),Me(Ur)),hyt=gF(),nO=Symbol("opentelemetry.instrumentation.redis.open_spans"),wNe=Symbol("opentelemetry.instrumentation.redis.multi_command_options"),qK=class e extends So.InstrumentationBase{static COMPONENT="redis";_semconvStability;constructor(t={}){super(ONe.PACKAGE_NAME,ONe.PACKAGE_VERSION,t),this._semconvStability=t.semconvStability?t.semconvStability:(0,So.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig(t),this._semconvStability=t.semconvStability?t.semconvStability:(0,So.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[this._getInstrumentationNodeModuleDefinition("@redis/client"),this._getInstrumentationNodeModuleDefinition("@node-redis/client")]}_getInstrumentationNodeModuleDefinition(t){let n=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/commander.js`,["^1.0.0"],(i,a)=>{let c=i.transformCommandArguments;if(!c)return this._diag.error("internal instrumentation error, missing transformCommandArguments function"),i;let d=a?.startsWith("1.0.")?"extendWithCommands":"attachCommands";return(0,So.isWrapped)(i?.[d])&&this._unwrap(i,d),this._wrap(i,d,this._getPatchExtendWithCommands(c)),i},i=>{(0,So.isWrapped)(i?.extendWithCommands)&&this._unwrap(i,"extendWithCommands"),(0,So.isWrapped)(i?.attachCommands)&&this._unwrap(i,"attachCommands")}),r=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/client/multi-command.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return(0,So.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),this._wrap(a,"exec",this._getPatchMultiCommandsExec(!1)),(0,So.isWrapped)(a?.execAsPipeline)&&this._unwrap(a,"execAsPipeline"),this._wrap(a,"execAsPipeline",this._getPatchMultiCommandsExec(!0)),(0,So.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand"),this._wrap(a,"addCommand",this._getPatchMultiCommandsAddCommand()),i},i=>{let a=i?.default?.prototype;(0,So.isWrapped)(a?.exec)&&this._unwrap(a,"exec"),(0,So.isWrapped)(a?.addCommand)&&this._unwrap(a,"addCommand")}),o=new So.InstrumentationNodeModuleFile(`${t}/dist/lib/client/index.js`,["^1.0.0","^5.0.0"],i=>{let a=i?.default?.prototype;return a?.multi&&((0,So.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),this._wrap(a,"multi",this._getPatchRedisClientMulti())),a?.MULTI&&((0,So.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),this._wrap(a,"MULTI",this._getPatchRedisClientMulti())),(0,So.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand"),this._wrap(a,"sendCommand",this._getPatchRedisClientSendCommand()),this._wrap(a,"connect",this._getPatchedClientConnect()),i},i=>{let a=i?.default?.prototype;(0,So.isWrapped)(a?.multi)&&this._unwrap(a,"multi"),(0,So.isWrapped)(a?.MULTI)&&this._unwrap(a,"MULTI"),(0,So.isWrapped)(a?.sendCommand)&&this._unwrap(a,"sendCommand")});return new So.InstrumentationNodeModuleDefinition(t,["^1.0.0","^5.0.0"],i=>i,()=>{},[n,r,o])}_getPatchExtendWithCommands(t){let n=this;return function(o){return function(a){if(a?.BaseClass?.name!=="RedisClient")return o.apply(this,arguments);let c=a.executor;return a.executor=function(d,g){let h=t(d,g).args;return n._traceClientCommand(c,this,arguments,h)},o.apply(this,arguments)}}}_getPatchMultiCommandsExec(t){let n=this;return function(o){return function(){let a=o.apply(this,arguments);return typeof a?.then!="function"?(n._diag.error("non-promise result when patching exec/execAsPipeline"),a):a.then(c=>{let d=this[nO];return n._endSpansWithRedisReplies(d,c,t),c}).catch(c=>{let d=this[nO];if(!d)n._diag.error("cannot find open spans to end for multi/pipeline");else{let g=c.constructor.name==="MultiErrorReply"?c.replies:new Array(d.length).fill(c);n._endSpansWithRedisReplies(d,g,t)}return Promise.reject(c)})}}}_getPatchMultiCommandsAddCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchRedisClientMulti(){return function(n){return function(){let o=n.apply(this,arguments);return o[wNe]=this.options,o}}}_getPatchRedisClientSendCommand(){let t=this;return function(r){return function(i){return t._traceClientCommand(r,this,arguments,i)}}}_getPatchedClientConnect(){let t=this;return function(r){return function(){let i=this.options,a=(0,NNe.getClientAttributes)(t._diag,i,t._semconvStability),c=t.tracer.startSpan(`${e.COMPONENT}-connect`,{kind:qd.SpanKind.CLIENT,attributes:a});return qd.context.with(qd.trace.setSpan(qd.context.active(),c),()=>r.apply(this)).then(g=>(c.end(),g)).catch(g=>(c.recordException(g),c.setStatus({code:qd.SpanStatusCode.ERROR,message:g.message}),c.end(),Promise.reject(g)))}}}_traceClientCommand(t,n,r,o){if(qd.trace.getSpan(qd.context.active())===void 0&&this.getConfig().requireParentSpan)return t.apply(n,r);let a=n.options||n[wNe],c=o[0],d=o.slice(1),g=this.getConfig().dbStatementSerializer||gyt.defaultDbStatementSerializer,h=(0,NNe.getClientAttributes)(this._diag,a,this._semconvStability);this._semconvStability&So.SemconvStability.STABLE&&(h[VK.ATTR_DB_OPERATION_NAME]=c);try{let C=g(c,d);C!=null&&(this._semconvStability&So.SemconvStability.OLD&&(h[hyt.ATTR_DB_STATEMENT]=C),this._semconvStability&So.SemconvStability.STABLE&&(h[VK.ATTR_DB_QUERY_TEXT]=C))}catch(C){this._diag.error("dbStatementSerializer throw an exception",C,{commandName:c})}let S=this.tracer.startSpan(`${e.COMPONENT}-${c}`,{kind:qd.SpanKind.CLIENT,attributes:h}),y=qd.context.with(qd.trace.setSpan(qd.context.active(),S),()=>t.apply(n,r));if(typeof y?.then=="function")y.then(C=>{this._endSpanWithResponse(S,c,d,C,void 0)},C=>{this._endSpanWithResponse(S,c,d,null,C)});else{let C=y;C[nO]=C[nO]||[],C[nO].push({span:S,commandName:c,commandArgs:d})}return y}_endSpansWithRedisReplies(t,n,r=!1){if(!t)return this._diag.error("cannot find open spans to end for redis multi/pipeline");if(n.length!==t.length)return this._diag.error("number of multi command spans does not match response from redis");let o=t.map(c=>c.commandName),a=o.every(c=>c===o[0])?(r?"PIPELINE ":"MULTI ")+o[0]:r?"PIPELINE":"MULTI";for(let c=0;c<t.length;c++){let{span:d,commandArgs:g}=t[c],h=n[c],[S,y]=h instanceof Error?[null,h]:[h,void 0];this._semconvStability&So.SemconvStability.STABLE&&d.setAttribute(VK.ATTR_DB_OPERATION_NAME,a),this._endSpanWithResponse(d,o[c],g,S,y)}}_endSpanWithResponse(t,n,r,o,i){let{responseHook:a}=this.getConfig();if(!i&&a)try{a(t,n,r,o)}catch(c){this._diag.error("responseHook throw an exception",c)}i&&(t.recordException(i),t.setStatus({code:qd.SpanStatusCode.ERROR,message:i?.message})),t.end()}};SF.RedisInstrumentationV4_V5=qK});var UNe=F(yF=>{"use strict";m();Object.defineProperty(yF,"__esModule",{value:!0});yF.RedisInstrumentation=void 0;var _yt=rn(),MNe=mF(),Eyt=xNe(),Syt=kNe(),PNe={requireParentSpan:!1},YK=class extends _yt.InstrumentationBase{instrumentationV2_V3;instrumentationV4_V5;initialized=!1;constructor(t={}){let n={...PNe,...t};super(MNe.PACKAGE_NAME,MNe.PACKAGE_VERSION,n),this.instrumentationV2_V3=new Eyt.RedisInstrumentationV2_V3(this.getConfig()),this.instrumentationV4_V5=new Syt.RedisInstrumentationV4_V5(this.getConfig()),this.initialized=!0}setConfig(t={}){let n={...PNe,...t};super.setConfig(n),this.initialized&&(this.instrumentationV2_V3.setConfig(n),this.instrumentationV4_V5.setConfig(n))}init(){}getModuleDefinitions(){return[...this.instrumentationV2_V3.getModuleDefinitions(),...this.instrumentationV4_V5.getModuleDefinitions()]}setTracerProvider(t){super.setTracerProvider(t),this.initialized&&(this.instrumentationV2_V3.setTracerProvider(t),this.instrumentationV4_V5.setTracerProvider(t))}enable(){super.enable(),this.initialized&&(this.instrumentationV2_V3.enable(),this.instrumentationV4_V5.enable())}disable(){super.disable(),this.initialized&&(this.instrumentationV2_V3.disable(),this.instrumentationV4_V5.disable())}};yF.RedisInstrumentation=YK});var LNe=F(TF=>{"use strict";m();Object.defineProperty(TF,"__esModule",{value:!0});TF.RedisInstrumentation=void 0;var yyt=UNe();Object.defineProperty(TF,"RedisInstrumentation",{enumerable:!0,get:function(){return yyt.RedisInstrumentation}})});function rO(e,t){return e.includes(t.toLowerCase())}function JK(e){return rO(KK,e)?"cache.get":rO(Iyt,e)?"cache.put":void 0}function Cyt(e,t){return t.some(n=>e.startsWith(n))}function FNe(e,t){try{if(t.length===0)return;let n=o=>typeof o=="string"||typeof o=="number"||Buffer.isBuffer(o)?[o.toString()]:Array.isArray(o)?QNe(o.map(i=>n(i))):["<unknown>"],r=t[0];return rO(Tyt,e)&&r!=null?n(r):QNe(t.map(o=>n(o)))}catch{return}}function GNe(e,t,n){if(!JK(e))return!1;for(let r of t)if(Cyt(r,n))return!0;return!1}function jNe(e){let t=n=>{try{return Buffer.isBuffer(n)?n.byteLength:typeof n=="string"?n.length:typeof n=="number"?n.toString().length:n==null?0:JSON.stringify(n).length}catch{return}};return Array.isArray(e)?e.reduce((n,r)=>{let o=t(r);return typeof o=="number"?n!==void 0?n+o:o:n},0):t(e)}function QNe(e){let t=[],n=r=>{r.forEach(o=>{Array.isArray(o)?n(o):t.push(o)})};return n(e),t}var Tyt,KK,Iyt,HNe=O(()=>{m();Tyt=["get","set","setex"],KK=["get","mget"],Iyt=["set","setex"]});var zNe,$Ne,IF,oO,VNe,byt,vyt,qNe,Ryt,YNe,KNe=O(()=>{m();zNe=ie(bNe(),1),$Ne=ie(LNe(),1);dt();mr();HNe();IF="Redis",oO={},VNe=(e,t,n,r)=>{e.setAttribute(kt,"auto.db.otel.redis");let o=FNe(t,n),i=JK(t);if(!o||!i||!oO.cachePrefixes||!GNe(t,o,oO.cachePrefixes))return;let a=Ot(e).data["net.peer.name"],c=Ot(e).data["net.peer.port"];c&&a&&e.setAttributes({"network.peer.address":a,"network.peer.port":c});let d=jNe(r);d&&e.setAttribute(eV,d),rO(KK,t)&&d!==void 0&&e.setAttribute(W9,d>0),e.setAttributes({[Zt]:i,[X9]:o});let g=o.join(", ");e.updateName(oO.maxCacheKeyLength?c_(g,oO.maxCacheKeyLength):g)},byt=st(`${IF}.IORedis`,()=>new zNe.IORedisInstrumentation({responseHook:VNe})),vyt=st(`${IF}.Redis`,()=>new $Ne.RedisInstrumentation({responseHook:VNe})),qNe=Object.assign(()=>{byt(),vyt()},{id:IF}),Ryt=(e={})=>({name:IF,setupOnce(){oO=e,qNe()}}),YNe=Ryt});var JNe=F(CF=>{"use strict";m();Object.defineProperty(CF,"__esModule",{value:!0});CF.EVENT_LISTENERS_SET=void 0;CF.EVENT_LISTENERS_SET=Symbol("opentelemetry.instrumentation.pg.eventListenersSet")});var ZK=F(iO=>{"use strict";m();Object.defineProperty(iO,"__esModule",{value:!0});iO.AttributeNames=void 0;var xyt;(function(e){e.PG_VALUES="db.postgresql.values",e.PG_PLAN="db.postgresql.plan",e.IDLE_TIMEOUT_MILLIS="db.postgresql.idle.timeout.millis",e.MAX_CLIENT="db.postgresql.max.client"})(xyt=iO.AttributeNames||(iO.AttributeNames={}))});var WK=F(xr=>{"use strict";m();Object.defineProperty(xr,"__esModule",{value:!0});xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS=xr.METRIC_DB_CLIENT_CONNECTION_COUNT=xr.DB_SYSTEM_VALUE_POSTGRESQL=xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED=xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE=xr.ATTR_NET_PEER_PORT=xr.ATTR_NET_PEER_NAME=xr.ATTR_DB_USER=xr.ATTR_DB_SYSTEM=xr.ATTR_DB_STATEMENT=xr.ATTR_DB_NAME=xr.ATTR_DB_CONNECTION_STRING=xr.ATTR_DB_CLIENT_CONNECTION_STATE=xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME=void 0;xr.ATTR_DB_CLIENT_CONNECTION_POOL_NAME="db.client.connection.pool.name";xr.ATTR_DB_CLIENT_CONNECTION_STATE="db.client.connection.state";xr.ATTR_DB_CONNECTION_STRING="db.connection_string";xr.ATTR_DB_NAME="db.name";xr.ATTR_DB_STATEMENT="db.statement";xr.ATTR_DB_SYSTEM="db.system";xr.ATTR_DB_USER="db.user";xr.ATTR_NET_PEER_NAME="net.peer.name";xr.ATTR_NET_PEER_PORT="net.peer.port";xr.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE="idle";xr.DB_CLIENT_CONNECTION_STATE_VALUE_USED="used";xr.DB_SYSTEM_VALUE_POSTGRESQL="postgresql";xr.METRIC_DB_CLIENT_CONNECTION_COUNT="db.client.connection.count";xr.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS="db.client.connection.pending_requests"});var XK=F(aO=>{"use strict";m();Object.defineProperty(aO,"__esModule",{value:!0});aO.SpanNames=void 0;var Dyt;(function(e){e.QUERY_PREFIX="pg.query",e.CONNECT="pg.connect",e.POOL_CONNECT="pg-pool.connect"})(Dyt=aO.SpanNames||(aO.SpanNames={}))});var rOe=F(or=>{"use strict";m();Object.defineProperty(or,"__esModule",{value:!0});or.sanitizedErrorMessage=or.isObjectWithTextString=or.getErrorMessage=or.patchClientConnectCallback=or.patchCallbackPGPool=or.updateCounter=or.getPoolName=or.patchCallback=or.handleExecutionResult=or.handleConfigQuery=or.shouldSkipInstrumentation=or.getSemanticAttributesFromPoolConnection=or.getSemanticAttributesFromConnection=or.getConnectionString=or.parseAndMaskConnectionString=or.parseNormalizedOperationName=or.getQuerySpanName=void 0;var K_=(je(),Me(We)),bF=ZK(),Yd=(Zn(),Me(Ur)),pi=WK(),Sy=rn(),ZNe=XK();function WNe(e,t){if(!t)return ZNe.SpanNames.QUERY_PREFIX;let n=typeof t.name=="string"&&t.name?t.name:XNe(t.text);return`${ZNe.SpanNames.QUERY_PREFIX}:${n}${e?` ${e}`:""}`}or.getQuerySpanName=WNe;function XNe(e){let t=e.trim(),n=t.indexOf(" "),r=n===-1?t:t.slice(0,n);return r=r.toUpperCase(),r.endsWith(";")?r.slice(0,-1):r}or.parseNormalizedOperationName=XNe;function eOe(e){try{let t=new URL(e);return t.username="",t.password="",t.toString()}catch{return"postgresql://localhost:5432/"}}or.parseAndMaskConnectionString=eOe;function eJ(e){if("connectionString"in e&&e.connectionString)return eOe(e.connectionString);let t=e.host||"localhost",n=e.port||5432,r=e.database||"";return`postgresql://${t}:${n}/${r}`}or.getConnectionString=eJ;function vF(e){if(Number.isInteger(e))return e}function tOe(e,t){let n={};return t&Sy.SemconvStability.OLD&&(n={...n,[pi.ATTR_DB_SYSTEM]:pi.DB_SYSTEM_VALUE_POSTGRESQL,[pi.ATTR_DB_NAME]:e.database,[pi.ATTR_DB_CONNECTION_STRING]:eJ(e),[pi.ATTR_DB_USER]:e.user,[pi.ATTR_NET_PEER_NAME]:e.host,[pi.ATTR_NET_PEER_PORT]:vF(e.port)}),t&Sy.SemconvStability.STABLE&&(n={...n,[Yd.ATTR_DB_SYSTEM_NAME]:Yd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Yd.ATTR_DB_NAMESPACE]:e.namespace,[Yd.ATTR_SERVER_ADDRESS]:e.host,[Yd.ATTR_SERVER_PORT]:vF(e.port)}),n}or.getSemanticAttributesFromConnection=tOe;function Byt(e,t){let n;try{n=e.connectionString?new URL(e.connectionString):void 0}catch{n=void 0}let r={[bF.AttributeNames.IDLE_TIMEOUT_MILLIS]:e.idleTimeoutMillis,[bF.AttributeNames.MAX_CLIENT]:e.maxClient};return t&Sy.SemconvStability.OLD&&(r={...r,[pi.ATTR_DB_SYSTEM]:pi.DB_SYSTEM_VALUE_POSTGRESQL,[pi.ATTR_DB_NAME]:n?.pathname.slice(1)??e.database,[pi.ATTR_DB_CONNECTION_STRING]:eJ(e),[pi.ATTR_NET_PEER_NAME]:n?.hostname??e.host,[pi.ATTR_NET_PEER_PORT]:Number(n?.port)||vF(e.port),[pi.ATTR_DB_USER]:n?.username??e.user}),t&Sy.SemconvStability.STABLE&&(r={...r,[Yd.ATTR_DB_SYSTEM_NAME]:Yd.DB_SYSTEM_NAME_VALUE_POSTGRESQL,[Yd.ATTR_DB_NAMESPACE]:e.namespace,[Yd.ATTR_SERVER_ADDRESS]:n?.hostname??e.host,[Yd.ATTR_SERVER_PORT]:Number(n?.port)||vF(e.port)}),r}or.getSemanticAttributesFromPoolConnection=Byt;function Nyt(e){return e.requireParentSpan===!0&&K_.trace.getSpan(K_.context.active())===void 0}or.shouldSkipInstrumentation=Nyt;function Oyt(e,t,n,r){let{connectionParameters:o}=this,i=o.database,a=WNe(i,r),c=e.startSpan(a,{kind:K_.SpanKind.CLIENT,attributes:tOe(o,n)});if(!r)return c;if(r.text&&(n&Sy.SemconvStability.OLD&&c.setAttribute(pi.ATTR_DB_STATEMENT,r.text),n&Sy.SemconvStability.STABLE&&c.setAttribute(Yd.ATTR_DB_QUERY_TEXT,r.text)),t.enhancedDatabaseReporting&&Array.isArray(r.values))try{let d=r.values.map(g=>g==null?"null":g instanceof Buffer?g.toString():typeof g=="object"?typeof g.toPostgres=="function"?g.toPostgres():JSON.stringify(g):g.toString());c.setAttribute(bF.AttributeNames.PG_VALUES,d)}catch(d){K_.diag.error("failed to stringify ",r.values,d)}return typeof r.name=="string"&&c.setAttribute(bF.AttributeNames.PG_PLAN,r.name),c}or.handleConfigQuery=Oyt;function nOe(e,t,n){typeof e.responseHook=="function"&&(0,Sy.safeExecuteInTheMiddle)(()=>{e.responseHook(t,{data:n})},r=>{r&&K_.diag.error("Error running response hook",r)},!0)}or.handleExecutionResult=nOe;function wyt(e,t,n,r,o){return function(a,c){a?(Object.prototype.hasOwnProperty.call(a,"code")&&(r[Yd.ATTR_ERROR_TYPE]=a.code),a instanceof Error&&t.recordException(RF(a)),t.setStatus({code:K_.SpanStatusCode.ERROR,message:a.message})):nOe(e,t,c),o(),t.end(),n.call(this,a,c)}}or.patchCallback=wyt;function kyt(e){let t="";return t+=(e?.host?`${e.host}`:"unknown_host")+":",t+=(e?.port?`${e.port}`:"unknown_port")+"/",t+=e?.database?`${e.database}`:"unknown_database",t.trim()}or.getPoolName=kyt;function Myt(e,t,n,r,o){let i=t.totalCount,a=t.waitingCount,c=t.idleCount,d=i-c;return n.add(d-o.used,{[pi.ATTR_DB_CLIENT_CONNECTION_STATE]:pi.DB_CLIENT_CONNECTION_STATE_VALUE_USED,[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),n.add(c-o.idle,{[pi.ATTR_DB_CLIENT_CONNECTION_STATE]:pi.DB_CLIENT_CONNECTION_STATE_VALUE_IDLE,[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),r.add(a-o.pending,{[pi.ATTR_DB_CLIENT_CONNECTION_POOL_NAME]:e}),{used:d,idle:c,pending:a}}or.updateCounter=Myt;function Pyt(e,t){return function(r,o,i){r&&(r instanceof Error&&e.recordException(RF(r)),e.setStatus({code:K_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.call(this,r,o,i)}}or.patchCallbackPGPool=Pyt;function Uyt(e,t){return function(r){r&&(r instanceof Error&&e.recordException(RF(r)),e.setStatus({code:K_.SpanStatusCode.ERROR,message:r.message})),e.end(),t.apply(this,arguments)}}or.patchClientConnectCallback=Uyt;function Lyt(e){return typeof e=="object"&&e!==null&&"message"in e?String(e.message):void 0}or.getErrorMessage=Lyt;function Qyt(e){return typeof e=="object"&&typeof e?.text=="string"}or.isObjectWithTextString=Qyt;function RF(e){let t=e?.name??"PostgreSQLError",n=e?.code??"UNKNOWN";return`PostgreSQL error of type '${t}' occurred (code: ${n})`}or.sanitizedErrorMessage=RF});var oOe=F(Lv=>{"use strict";m();Object.defineProperty(Lv,"__esModule",{value:!0});Lv.PACKAGE_NAME=Lv.PACKAGE_VERSION=void 0;Lv.PACKAGE_VERSION="0.66.0";Lv.PACKAGE_NAME="@opentelemetry/instrumentation-pg"});var lOe=F(DF=>{"use strict";m();Object.defineProperty(DF,"__esModule",{value:!0});DF.PgInstrumentation=void 0;var Hu=rn(),Fr=(je(),Me(We)),iOe=JNe(),Ko=rOe(),aOe=UK(),sOe=oOe(),uOe=XK(),xF=Tr(),cf=(Zn(),Me(Ur)),sO=WK();function Qv(e){return e[Symbol.toStringTag]==="Module"?e.default:e}var tJ=class extends Hu.InstrumentationBase{_connectionsCounter={used:0,idle:0,pending:0};_semconvStability;constructor(t={}){super(sOe.PACKAGE_NAME,sOe.PACKAGE_VERSION,t),this._semconvStability=(0,Hu.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}_updateMetricInstruments(){this._operationDuration=this.meter.createHistogram(cf.METRIC_DB_CLIENT_OPERATION_DURATION,{description:"Duration of database client operations.",unit:"s",valueType:Fr.ValueType.DOUBLE,advice:{explicitBucketBoundaries:[.001,.005,.01,.05,.1,.5,1,5,10]}}),this._connectionsCounter={idle:0,pending:0,used:0},this._connectionsCount=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_COUNT,{description:"The number of connections that are currently in state described by the state attribute.",unit:"{connection}"}),this._connectionPendingRequests=this.meter.createUpDownCounter(sO.METRIC_DB_CLIENT_CONNECTION_PENDING_REQUESTS,{description:"The number of current pending requests for an open connection.",unit:"{connection}"})}init(){let t=[">=8.0.3 <9"],n=[">=2.0.0 <4"],r=new Hu.InstrumentationNodeModuleFile("pg/lib/native/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),o=new Hu.InstrumentationNodeModuleFile("pg/lib/client.js",t,this._patchPgClient.bind(this),this._unpatchPgClient.bind(this)),i=new Hu.InstrumentationNodeModuleDefinition("pg",t,c=>{let d=Qv(c);return this._patchPgClient(d.Client),c},c=>{let d=Qv(c);return this._unpatchPgClient(d.Client),c},[o,r]),a=new Hu.InstrumentationNodeModuleDefinition("pg-pool",n,c=>{let d=Qv(c);return(0,Hu.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect"),this._wrap(d.prototype,"connect",this._getPoolConnectPatch()),d},c=>{let d=Qv(c);(0,Hu.isWrapped)(d.prototype.connect)&&this._unwrap(d.prototype,"connect")});return[i,a]}_patchPgClient(t){if(!t)return;let n=Qv(t);return(0,Hu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Hu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),this._wrap(n.prototype,"query",this._getClientQueryPatch()),this._wrap(n.prototype,"connect",this._getClientConnectPatch()),t}_unpatchPgClient(t){let n=Qv(t);return(0,Hu.isWrapped)(n.prototype.query)&&this._unwrap(n.prototype,"query"),(0,Hu.isWrapped)(n.prototype.connect)&&this._unwrap(n.prototype,"connect"),t}_getClientConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Ko.shouldSkipInstrumentation(i)||i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(uOe.SpanNames.CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Ko.getSemanticAttributesFromConnection(this,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Ko.patchClientConnectCallback(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return cOe(a,c)}}recordOperationDuration(t,n){let r={},o=[cf.ATTR_DB_NAMESPACE,cf.ATTR_ERROR_TYPE,cf.ATTR_SERVER_PORT,cf.ATTR_SERVER_ADDRESS,cf.ATTR_DB_OPERATION_NAME];this._semconvStability&Hu.SemconvStability.OLD&&o.push(sO.ATTR_DB_SYSTEM),this._semconvStability&Hu.SemconvStability.STABLE&&o.push(cf.ATTR_DB_SYSTEM_NAME),o.forEach(a=>{a in t&&(r[a]=t[a])});let i=(0,xF.hrTimeToMilliseconds)((0,xF.hrTimeDuration)(n,(0,xF.hrTime)()))/1e3;this._operationDuration.record(i,r)}_getClientQueryPatch(){let t=this;return n=>(this._diag.debug("Patching pg.Client.prototype.query"),function(...o){if(Ko.shouldSkipInstrumentation(t.getConfig()))return n.apply(this,o);let i=(0,xF.hrTime)(),a=o[0],c=typeof a=="string",d=Ko.isObjectWithTextString(a),g=c?{text:a,values:Array.isArray(o[1])?o[1]:void 0}:d?{...a,name:a.name,text:a.text,values:a.values??(Array.isArray(o[1])?o[1]:void 0)}:void 0,h={[sO.ATTR_DB_SYSTEM]:sO.DB_SYSTEM_VALUE_POSTGRESQL,[cf.ATTR_DB_NAMESPACE]:this.database,[cf.ATTR_SERVER_PORT]:this.connectionParameters.port,[cf.ATTR_SERVER_ADDRESS]:this.connectionParameters.host};g?.text&&(h[cf.ATTR_DB_OPERATION_NAME]=Ko.parseNormalizedOperationName(g?.text));let S=()=>{t.recordOperationDuration(h,i)},y=t.getConfig(),C=Ko.handleConfigQuery.call(this,t.tracer,y,t._semconvStability,g);if(y.addSqlCommenterCommentToQueries&&(c?o[0]=(0,aOe.addSqlCommenterComment)(C,a):d&&!("name"in a)&&(o[0]={...a,text:(0,aOe.addSqlCommenterComment)(C,a.text)})),o.length>0){let N=Fr.trace.getSpan(Fr.context.active());if(typeof o[o.length-1]=="function")o[o.length-1]=Ko.patchCallback(y,C,o[o.length-1],h,S),N&&(o[o.length-1]=Fr.context.bind(Fr.context.active(),o[o.length-1]));else if(typeof g?.callback=="function"){let k=Ko.patchCallback(t.getConfig(),C,g.callback,h,S);N&&(k=Fr.context.bind(Fr.context.active(),k)),o[0].callback=k}}let{requestHook:v}=y;typeof v=="function"&&g&&(0,Hu.safeExecuteInTheMiddle)(()=>{let{database:N,host:k,port:Q,user:j}=this.connectionParameters;v(C,{connection:{database:N,host:k,port:Q,user:j},query:{text:g.text,values:g.values,name:g.name}})},N=>{N&&t._diag.error("Error running query hook",N)},!0);let x;try{x=n.apply(this,o)}catch(N){throw N instanceof Error&&C.recordException(Ko.sanitizedErrorMessage(N)),C.setStatus({code:Fr.SpanStatusCode.ERROR,message:Ko.getErrorMessage(N)}),C.end(),N}return x instanceof Promise?x.then(N=>new Promise(k=>{Ko.handleExecutionResult(t.getConfig(),C,N),S(),C.end(),k(N)})).catch(N=>new Promise((k,Q)=>{N instanceof Error&&C.recordException(Ko.sanitizedErrorMessage(N)),C.setStatus({code:Fr.SpanStatusCode.ERROR,message:N.message}),S(),C.end(),Q(N)})):x})}_setPoolConnectEventListeners(t){if(t[iOe.EVENT_LISTENERS_SET])return;let n=Ko.getPoolName(t.options);t.on("connect",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("acquire",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("remove",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t.on("release",()=>{this._connectionsCounter=Ko.updateCounter(n,t,this._connectionsCount,this._connectionPendingRequests,this._connectionsCounter)}),t[iOe.EVENT_LISTENERS_SET]=!0}_getPoolConnectPatch(){let t=this;return n=>function(o){let i=t.getConfig();if(Ko.shouldSkipInstrumentation(i))return n.call(this,o);if(t._setPoolConnectEventListeners(this),i.ignoreConnectSpans)return n.call(this,o);let a=t.tracer.startSpan(uOe.SpanNames.POOL_CONNECT,{kind:Fr.SpanKind.CLIENT,attributes:Ko.getSemanticAttributesFromPoolConnection(this.options,t._semconvStability)});if(o){let d=Fr.trace.getSpan(Fr.context.active());o=Ko.patchCallbackPGPool(a,o),d&&(o=Fr.context.bind(Fr.context.active(),o))}let c=Fr.context.with(Fr.trace.setSpan(Fr.context.active(),a),()=>n.call(this,o));return cOe(a,c)}}};DF.PgInstrumentation=tJ;function cOe(e,t){if(!(t instanceof Promise))return t;let n=t;return Fr.context.bind(Fr.context.active(),n.then(r=>(e.end(),r)).catch(r=>(r instanceof Error&&e.recordException(Ko.sanitizedErrorMessage(r)),e.setStatus({code:Fr.SpanStatusCode.ERROR,message:Ko.getErrorMessage(r)}),e.end(),Promise.reject(r))))}});var dOe=F(Fv=>{"use strict";m();Object.defineProperty(Fv,"__esModule",{value:!0});Fv.AttributeNames=Fv.PgInstrumentation=void 0;var Fyt=lOe();Object.defineProperty(Fv,"PgInstrumentation",{enumerable:!0,get:function(){return Fyt.PgInstrumentation}});var Gyt=ZK();Object.defineProperty(Fv,"AttributeNames",{enumerable:!0,get:function(){return Gyt.AttributeNames}})});var pOe,fOe,AOe,jyt,mOe,gOe=O(()=>{m();pOe=ie(dOe(),1);mr();fOe="Postgres",AOe=st(fOe,pOe.PgInstrumentation,e=>({requireParentSpan:!0,requestHook(t){Lr(t,"auto.db.otel.postgres")},ignoreConnectSpans:e?.ignoreConnectSpans??!1})),jyt=e=>({name:fOe,setupOnce(){AOe(e)}}),mOe=jyt});var J_,rJ,hOe,Hyt,zyt,_Oe,nJ,$yt,EOe,SOe=O(()=>{m();je();J_=ie(rn(),1);Zn();dt();mr();ly();rJ="PostgresJs",hOe=[">=3.0.0 <4"],Hyt=/^(SELECT|INSERT|UPDATE|DELETE|CREATE|DROP|ALTER)/i,zyt=Symbol.for("sentry.query.from.instrumented.sql"),_Oe=st(rJ,e=>new nJ({requireParentSpan:e?.requireParentSpan??!0,requestHook:e?.requestHook})),nJ=class extends J_.InstrumentationBase{constructor(t){super("sentry-postgres-js",Wn,t)}init(){let t=new J_.InstrumentationNodeModuleDefinition("postgres",hOe,n=>{try{return this._patchPostgres(n)}catch(r){return ya&&J.error("Failed to patch postgres module:",r),n}},n=>n);return["src","cf/src","cjs/src"].forEach(n=>{t.files.push(new J_.InstrumentationNodeModuleFile(`postgres/${n}/query.js`,hOe,this._patchQueryPrototype.bind(this),this._unpatchQueryPrototype.bind(this)))}),t}_patchPostgres(t){let n=typeof t=="function",r=n?t:t.default;if(typeof r!="function")return ya&&J.warn("postgres module does not export a function. Skipping instrumentation."),t;let o=this,i=function(...a){let c=Reflect.construct(r,a);if(!c||typeof c!="function")return ya&&J.warn("postgres() did not return a valid instance"),c;let d=o.getConfig();return nq(c,{requireParentSpan:d.requireParentSpan,requestHook:d.requestHook})};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}return n?i:(nN(t,"default",i),t)}_shouldCreateSpans(){let t=this.getConfig();return Ht.getSpan(Ke.active())!==void 0||!t.requireParentSpan}_setOperationName(t,n,r){if(r){t.setAttribute(VC,r);return}let o=n?.match(Hyt);o?.[1]&&t.setAttribute(VC,o[1].toUpperCase())}_reconstructQuery(t){if(t?.length)return t.length===1?t[0]||void 0:t.reduce((n,r,o)=>o===0?r:`${n}$${o}${r}`,"")}_sanitizeSqlQuery(t){return t?t.replace(/--.*$/gm,"").replace(/\/\*[\s\S]*?\*\//g,"").replace(/;\s*$/,"").replace(/\s+/g," ").trim().replace(/\bX'[0-9A-Fa-f]*'/gi,"?").replace(/\bB'[01]*'/gi,"?").replace(/'(?:[^']|'')*'/g,"?").replace(/\b0x[0-9A-Fa-f]+/gi,"?").replace(/\b(?:TRUE|FALSE)\b/gi,"?").replace(/-?\b\d+\.?\d*[eE][+-]?\d+\b/g,"?").replace(/-?\b\d+\.\d+\b/g,"?").replace(/-?\.\d+\b/g,"?").replace(/(?<!\$)-?\b\d+\b/g,"?").replace(/\bIN\b\s*\(\s*\?(?:\s*,\s*\?)*\s*\)/gi,"IN (?)").replace(/\bIN\b\s*\(\s*\$\d+(?:\s*,\s*\$\d+)*\s*\)/gi,"IN ($?)"):"Unknown SQL Query"}_patchQueryPrototype(t){let n=this,r=t.Query.prototype.handle;return t.Query.prototype.handle=async function(...o){if(this[zyt])return r.apply(this,o);if(!n._shouldCreateSpans())return r.apply(this,o);let i=n._reconstructQuery(this.strings),a=n._sanitizeSqlQuery(i);return Za({name:a||"postgresjs.query",op:"db"},c=>{Lr(c,"auto.db.postgresjs"),c.setAttributes({[DS]:"postgres",[A5]:a});let d=n.getConfig(),{requestHook:g}=d;g&&(0,J_.safeExecuteInTheMiddle)(()=>g(c,a,void 0),y=>{y&&(c.setAttribute("sentry.hook.error","requestHook failed"),ya&&J.error(`Error in requestHook for ${rJ} integration:`,y))},!0);let h=this.resolve;this.resolve=new Proxy(h,{apply:(y,C,v)=>{try{n._setOperationName(c,a,v?.[0]?.command),c.end()}catch(x){ya&&J.error("Error ending span in resolve callback:",x)}return Reflect.apply(y,C,v)}});let S=this.reject;this.reject=new Proxy(S,{apply:(y,C,v)=>{try{c.setStatus({code:2,message:v?.[0]?.message||"unknown_error"}),c.setAttribute(m5,v?.[0]?.code||"unknown"),c.setAttribute(g5,v?.[0]?.name||"unknown"),n._setOperationName(c,a),c.end()}catch(x){ya&&J.error("Error ending span in reject callback:",x)}return Reflect.apply(y,C,v)}});try{return r.apply(this,o)}catch(y){throw c.setStatus({code:2,message:y instanceof Error?y.message:"unknown_error"}),c.end(),y}})},t.Query.prototype.handle.__sentry_original__=r,t}_unpatchQueryPrototype(t){return t.Query.prototype.handle.__sentry_original__&&(t.Query.prototype.handle=t.Query.prototype.handle.__sentry_original__),t}},$yt=e=>({name:rJ,setupOnce(){_Oe(e)}}),EOe=$yt});var yOe=F(uO=>{"use strict";m();Object.defineProperty(uO,"__esModule",{value:!0});uO.SeverityNumber=void 0;var Vyt;(function(e){e[e.UNSPECIFIED=0]="UNSPECIFIED",e[e.TRACE=1]="TRACE",e[e.TRACE2=2]="TRACE2",e[e.TRACE3=3]="TRACE3",e[e.TRACE4=4]="TRACE4",e[e.DEBUG=5]="DEBUG",e[e.DEBUG2=6]="DEBUG2",e[e.DEBUG3=7]="DEBUG3",e[e.DEBUG4=8]="DEBUG4",e[e.INFO=9]="INFO",e[e.INFO2=10]="INFO2",e[e.INFO3=11]="INFO3",e[e.INFO4=12]="INFO4",e[e.WARN=13]="WARN",e[e.WARN2=14]="WARN2",e[e.WARN3=15]="WARN3",e[e.WARN4=16]="WARN4",e[e.ERROR=17]="ERROR",e[e.ERROR2=18]="ERROR2",e[e.ERROR3=19]="ERROR3",e[e.ERROR4=20]="ERROR4",e[e.FATAL=21]="FATAL",e[e.FATAL2=22]="FATAL2",e[e.FATAL3=23]="FATAL3",e[e.FATAL4=24]="FATAL4"})(Vyt=uO.SeverityNumber||(uO.SeverityNumber={}))});var NF=F(Gv=>{"use strict";m();Object.defineProperty(Gv,"__esModule",{value:!0});Gv.NOOP_LOGGER=Gv.NoopLogger=void 0;var BF=class{emit(t){}};Gv.NoopLogger=BF;Gv.NOOP_LOGGER=new BF});var wF=F(jv=>{"use strict";m();Object.defineProperty(jv,"__esModule",{value:!0});jv.NOOP_LOGGER_PROVIDER=jv.NoopLoggerProvider=void 0;var qyt=NF(),OF=class{getLogger(t,n,r){return new qyt.NoopLogger}};jv.NoopLoggerProvider=OF;jv.NOOP_LOGGER_PROVIDER=new OF});var iJ=F(kF=>{"use strict";m();Object.defineProperty(kF,"__esModule",{value:!0});kF.ProxyLogger=void 0;var Yyt=NF(),oJ=class{constructor(t,n,r,o){this._provider=t,this.name=n,this.version=r,this.options=o}emit(t){this._getLogger().emit(t)}_getLogger(){if(this._delegate)return this._delegate;let t=this._provider._getDelegateLogger(this.name,this.version,this.options);return t?(this._delegate=t,this._delegate):Yyt.NOOP_LOGGER}};kF.ProxyLogger=oJ});var sJ=F(MF=>{"use strict";m();Object.defineProperty(MF,"__esModule",{value:!0});MF.ProxyLoggerProvider=void 0;var Kyt=wF(),Jyt=iJ(),aJ=class{getLogger(t,n,r){var o;return(o=this._getDelegateLogger(t,n,r))!==null&&o!==void 0?o:new Jyt.ProxyLogger(this,t,n,r)}_getDelegate(){var t;return(t=this._delegate)!==null&&t!==void 0?t:Kyt.NOOP_LOGGER_PROVIDER}_setDelegate(t){this._delegate=t}_getDelegateLogger(t,n,r){var o;return(o=this._delegate)===null||o===void 0?void 0:o.getLogger(t,n,r)}};MF.ProxyLoggerProvider=aJ});var TOe=F(PF=>{"use strict";m();Object.defineProperty(PF,"__esModule",{value:!0});PF._globalThis=void 0;PF._globalThis=typeof globalThis=="object"?globalThis:global});var IOe=F(UF=>{"use strict";m();Object.defineProperty(UF,"__esModule",{value:!0});UF._globalThis=void 0;var Zyt=TOe();Object.defineProperty(UF,"_globalThis",{enumerable:!0,get:function(){return Zyt._globalThis}})});var COe=F(LF=>{"use strict";m();Object.defineProperty(LF,"__esModule",{value:!0});LF._globalThis=void 0;var Wyt=IOe();Object.defineProperty(LF,"_globalThis",{enumerable:!0,get:function(){return Wyt._globalThis}})});var bOe=F(MA=>{"use strict";m();Object.defineProperty(MA,"__esModule",{value:!0});MA.API_BACKWARDS_COMPATIBILITY_VERSION=MA.makeGetter=MA._global=MA.GLOBAL_LOGS_API_KEY=void 0;var Xyt=COe();MA.GLOBAL_LOGS_API_KEY=Symbol.for("io.opentelemetry.js.api.logs");MA._global=Xyt._globalThis;function eTt(e,t,n){return r=>r===e?t:n}MA.makeGetter=eTt;MA.API_BACKWARDS_COMPATIBILITY_VERSION=1});var ROe=F(QF=>{"use strict";m();Object.defineProperty(QF,"__esModule",{value:!0});QF.LogsAPI=void 0;var Kd=bOe(),tTt=wF(),vOe=sJ(),uJ=class e{constructor(){this._proxyLoggerProvider=new vOe.ProxyLoggerProvider}static getInstance(){return this._instance||(this._instance=new e),this._instance}setGlobalLoggerProvider(t){return Kd._global[Kd.GLOBAL_LOGS_API_KEY]?this.getLoggerProvider():(Kd._global[Kd.GLOBAL_LOGS_API_KEY]=(0,Kd.makeGetter)(Kd.API_BACKWARDS_COMPATIBILITY_VERSION,t,tTt.NOOP_LOGGER_PROVIDER),this._proxyLoggerProvider._setDelegate(t),t)}getLoggerProvider(){var t,n;return(n=(t=Kd._global[Kd.GLOBAL_LOGS_API_KEY])===null||t===void 0?void 0:t.call(Kd._global,Kd.API_BACKWARDS_COMPATIBILITY_VERSION))!==null&&n!==void 0?n:this._proxyLoggerProvider}getLogger(t,n,r){return this.getLoggerProvider().getLogger(t,n,r)}disable(){delete Kd._global[Kd.GLOBAL_LOGS_API_KEY],this._proxyLoggerProvider=new vOe.ProxyLoggerProvider}};QF.LogsAPI=uJ});var cJ=F(ns=>{"use strict";m();Object.defineProperty(ns,"__esModule",{value:!0});ns.logs=ns.ProxyLoggerProvider=ns.ProxyLogger=ns.NoopLoggerProvider=ns.NOOP_LOGGER_PROVIDER=ns.NoopLogger=ns.NOOP_LOGGER=ns.SeverityNumber=void 0;var nTt=yOe();Object.defineProperty(ns,"SeverityNumber",{enumerable:!0,get:function(){return nTt.SeverityNumber}});var xOe=NF();Object.defineProperty(ns,"NOOP_LOGGER",{enumerable:!0,get:function(){return xOe.NOOP_LOGGER}});Object.defineProperty(ns,"NoopLogger",{enumerable:!0,get:function(){return xOe.NoopLogger}});var DOe=wF();Object.defineProperty(ns,"NOOP_LOGGER_PROVIDER",{enumerable:!0,get:function(){return DOe.NOOP_LOGGER_PROVIDER}});Object.defineProperty(ns,"NoopLoggerProvider",{enumerable:!0,get:function(){return DOe.NoopLoggerProvider}});var rTt=iJ();Object.defineProperty(ns,"ProxyLogger",{enumerable:!0,get:function(){return rTt.ProxyLogger}});var oTt=sJ();Object.defineProperty(ns,"ProxyLoggerProvider",{enumerable:!0,get:function(){return oTt.ProxyLoggerProvider}});var iTt=ROe();ns.logs=iTt.LogsAPI.getInstance()});var BOe=F(Hv=>{"use strict";m();Object.defineProperty(Hv,"__esModule",{value:!0});Hv.disableInstrumentations=Hv.enableInstrumentations=void 0;function aTt(e,t,n,r){for(let o=0,i=e.length;o<i;o++){let a=e[o];t&&a.setTracerProvider(t),n&&a.setMeterProvider(n),r&&a.setLoggerProvider&&a.setLoggerProvider(r),a.getConfig().enabled||a.enable()}}Hv.enableInstrumentations=aTt;function sTt(e){e.forEach(t=>t.disable())}Hv.disableInstrumentations=sTt});var wOe=F(FF=>{"use strict";m();Object.defineProperty(FF,"__esModule",{value:!0});FF.registerInstrumentations=void 0;var NOe=(je(),Me(We)),uTt=cJ(),OOe=BOe();function cTt(e){let t=e.tracerProvider||NOe.trace.getTracerProvider(),n=e.meterProvider||NOe.metrics.getMeterProvider(),r=e.loggerProvider||uTt.logs.getLoggerProvider(),o=e.instrumentations?.flat()??[];return(0,OOe.enableInstrumentations)(o,t,n,r),()=>{(0,OOe.disableInstrumentations)(o)}}FF.registerInstrumentations=cTt});var jOe=F(GF=>{"use strict";m();Object.defineProperty(GF,"__esModule",{value:!0});GF.satisfies=void 0;var fJ=(je(),Me(We)),LOe=/^(?:v)?(?<version>(?<major>0|[1-9]\d*)\.(?<minor>0|[1-9]\d*)\.(?<patch>0|[1-9]\d*))(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,lTt=/^(?<op><|>|=|==|<=|>=|~|\^|~>)?\s*(?:v)?(?<version>(?<major>x|X|\*|0|[1-9]\d*)(?:\.(?<minor>x|X|\*|0|[1-9]\d*))?(?:\.(?<patch>x|X|\*|0|[1-9]\d*))?)(?:-(?<prerelease>(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*)(?:\.(?:0|[1-9]\d*|\d*[a-zA-Z-][0-9a-zA-Z-]*))*))?(?:\+(?<build>[0-9a-zA-Z-]+(?:\.[0-9a-zA-Z-]+)*))?$/,dTt={">":[1],">=":[0,1],"=":[0],"<=":[-1,0],"<":[-1],"!=":[-1,1]};function pTt(e,t,n){if(!fTt(e))return fJ.diag.error(`Invalid version: ${e}`),!1;if(!t)return!0;t=t.replace(/([<>=~^]+)\s+/g,"$1");let r=hTt(e);if(!r)return!1;let o=[],i=QOe(r,t,o,n);return i&&!n?.includePrerelease?mTt(r,o):i}GF.satisfies=pTt;function fTt(e){return typeof e=="string"&&LOe.test(e)}function QOe(e,t,n,r){if(t.includes("||")){let o=t.trim().split("||");for(let i of o)if(lJ(e,i,n,r))return!0;return!1}else if(t.includes(" - "))t=LTt(t,r);else if(t.includes(" ")){let o=t.trim().replace(/\s{2,}/g," ").split(" ");for(let i of o)if(!lJ(e,i,n,r))return!1;return!0}return lJ(e,t,n,r)}function lJ(e,t,n,r){if(t=gTt(t,r),t.includes(" "))return QOe(e,t,n,r);{let o=_Tt(t);return n.push(o),ATt(e,o)}}function ATt(e,t){if(t.invalid)return!1;if(!t.version||pJ(t.version))return!0;let n=MOe(e.versionSegments||[],t.versionSegments||[]);if(n===0){let r=e.prereleaseSegments||[],o=t.prereleaseSegments||[];!r.length&&!o.length?n=0:!r.length&&o.length?n=1:r.length&&!o.length?n=-1:n=MOe(r,o)}return dTt[t.op]?.includes(n)}function mTt(e,t){return e.prerelease?t.some(n=>n.prerelease&&n.version===e.version):!0}function gTt(e,t){return e=e.trim(),e=PTt(e,t),e=MTt(e),e=UTt(e,t),e=e.trim(),e}function zu(e){return!e||e.toLowerCase()==="x"||e==="*"}function hTt(e){let t=e.match(LOe);if(!t){fJ.diag.error(`Invalid version: ${e}`);return}let n=t.groups.version,r=t.groups.prerelease,o=t.groups.build,i=n.split("."),a=r?.split(".");return{op:void 0,version:n,versionSegments:i,versionSegmentCount:i.length,prerelease:r,prereleaseSegments:a,prereleaseSegmentCount:a?a.length:0,build:o}}function _Tt(e){if(!e)return{};let t=e.match(lTt);if(!t)return fJ.diag.error(`Invalid range: ${e}`),{invalid:!0};let n=t.groups.op,r=t.groups.version,o=t.groups.prerelease,i=t.groups.build,a=r.split("."),c=o?.split(".");return n==="=="&&(n="="),{op:n||"=",version:r,versionSegments:a,versionSegmentCount:a.length,prerelease:o,prereleaseSegments:c,prereleaseSegmentCount:c?c.length:0,build:i}}function pJ(e){return e==="*"||e==="x"||e==="X"}function kOe(e){let t=parseInt(e,10);return isNaN(t)?e:t}function ETt(e,t){if(typeof e==typeof t){if(typeof e=="number")return[e,t];if(typeof e=="string")return[e,t];throw new Error("Version segments can only be strings or numbers")}else return[String(e),String(t)]}function STt(e,t){if(pJ(e)||pJ(t))return 0;let[n,r]=ETt(kOe(e),kOe(t));return n>r?1:n<r?-1:0}function MOe(e,t){for(let n=0;n<Math.max(e.length,t.length);n++){let r=STt(e[n]||"0",t[n]||"0");if(r!==0)return r}return 0}var FOe="[a-zA-Z0-9-]",GOe="0|[1-9]\\d*",yTt=`\\d*[a-zA-Z-]${FOe}*`,TTt="((?:<|>)?=?)",POe=`(?:${GOe}|${yTt})`,ITt=`(?:-(${POe}(?:\\.${POe})*))`,UOe=`${FOe}+`,CTt=`(?:\\+(${UOe}(?:\\.${UOe})*))`,dJ=`${GOe}|x|X|\\*`,cO=`[v=\\s]*(${dJ})(?:\\.(${dJ})(?:\\.(${dJ})(?:${ITt})?${CTt}?)?)?`,bTt=`^${TTt}\\s*${cO}$`,vTt=new RegExp(bTt),RTt=`^\\s*(${cO})\\s+-\\s+(${cO})\\s*$`,xTt=new RegExp(RTt),DTt="(?:~>?)",BTt=`^${DTt}${cO}$`,NTt=new RegExp(BTt),OTt="(?:\\^)",wTt=`^${OTt}${cO}$`,kTt=new RegExp(wTt);function MTt(e){let t=NTt;return e.replace(t,(n,r,o,i,a)=>{let c;return zu(r)?c="":zu(o)?c=`>=${r}.0.0 <${+r+1}.0.0-0`:zu(i)?c=`>=${r}.${o}.0 <${r}.${+o+1}.0-0`:a?c=`>=${r}.${o}.${i}-${a} <${r}.${+o+1}.0-0`:c=`>=${r}.${o}.${i} <${r}.${+o+1}.0-0`,c})}function PTt(e,t){let n=kTt,r=t?.includePrerelease?"-0":"";return e.replace(n,(o,i,a,c,d)=>{let g;return zu(i)?g="":zu(a)?g=`>=${i}.0.0${r} <${+i+1}.0.0-0`:zu(c)?i==="0"?g=`>=${i}.${a}.0${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.0${r} <${+i+1}.0.0-0`:d?i==="0"?a==="0"?g=`>=${i}.${a}.${c}-${d} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}-${d} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c}-${d} <${+i+1}.0.0-0`:i==="0"?a==="0"?g=`>=${i}.${a}.${c}${r} <${i}.${a}.${+c+1}-0`:g=`>=${i}.${a}.${c}${r} <${i}.${+a+1}.0-0`:g=`>=${i}.${a}.${c} <${+i+1}.0.0-0`,g})}function UTt(e,t){let n=vTt;return e.replace(n,(r,o,i,a,c,d)=>{let g=zu(i),h=g||zu(a),S=h||zu(c),y=S;return o==="="&&y&&(o=""),d=t?.includePrerelease?"-0":"",g?o===">"||o==="<"?r="<0.0.0-0":r="*":o&&y?(h&&(a=0),c=0,o===">"?(o=">=",h?(i=+i+1,a=0,c=0):(a=+a+1,c=0)):o==="<="&&(o="<",h?i=+i+1:a=+a+1),o==="<"&&(d="-0"),r=`${o+i}.${a}.${c}${d}`):h?r=`>=${i}.0.0${d} <${+i+1}.0.0-0`:S&&(r=`>=${i}.${a}.0${d} <${i}.${+a+1}.0-0`),r})}function LTt(e,t){let n=xTt;return e.replace(n,(r,o,i,a,c,d,g,h,S,y,C,v)=>(zu(i)?o="":zu(a)?o=`>=${i}.0.0${t?.includePrerelease?"-0":""}`:zu(c)?o=`>=${i}.${a}.0${t?.includePrerelease?"-0":""}`:d?o=`>=${o}`:o=`>=${o}${t?.includePrerelease?"-0":""}`,zu(S)?h="":zu(y)?h=`<${+S+1}.0.0-0`:zu(C)?h=`<${S}.${+y+1}.0-0`:v?h=`<=${S}.${y}.${C}-${v}`:t?.includePrerelease?h=`<${S}.${y}.${+C+1}-0`:h=`<=${h}`,`${o} ${h}`.trim()))}});var AJ=F(Os=>{"use strict";m();Object.defineProperty(Os,"__esModule",{value:!0});Os.massUnwrap=Os.unwrap=Os.massWrap=Os.wrap=void 0;var $u=console.error.bind(console);function lO(e,t,n){let r=!!e[t]&&Object.prototype.propertyIsEnumerable.call(e,t);Object.defineProperty(e,t,{configurable:!0,enumerable:r,writable:!0,value:n})}var QTt=(e,t,n)=>{if(!e||!e[t]){$u("no original function "+String(t)+" to wrap");return}if(!n){$u("no wrapper function"),$u(new Error().stack);return}let r=e[t];if(typeof r!="function"||typeof n!="function"){$u("original object and wrapper must be functions");return}let o=n(r,t);return lO(o,"__original",r),lO(o,"__unwrap",()=>{e[t]===o&&lO(e,t,r)}),lO(o,"__wrapped",!0),lO(e,t,o),o};Os.wrap=QTt;var FTt=(e,t,n)=>{if(e)Array.isArray(e)||(e=[e]);else{$u("must provide one or more modules to patch"),$u(new Error().stack);return}if(!(t&&Array.isArray(t))){$u("must provide one or more functions to wrap on modules");return}e.forEach(r=>{t.forEach(o=>{(0,Os.wrap)(r,o,n)})})};Os.massWrap=FTt;var GTt=(e,t)=>{if(!e||!e[t]){$u("no function to unwrap."),$u(new Error().stack);return}let n=e[t];if(!n.__unwrap)$u("no original to unwrap to -- has "+String(t)+" already been unwrapped?");else{n.__unwrap();return}};Os.unwrap=GTt;var jTt=(e,t)=>{if(e)Array.isArray(e)||(e=[e]);else{$u("must provide one or more modules to patch"),$u(new Error().stack);return}if(!(t&&Array.isArray(t))){$u("must provide one or more functions to unwrap on modules");return}e.forEach(n=>{t.forEach(r=>{(0,Os.unwrap)(n,r)})})};Os.massUnwrap=jTt;function dO(e){e&&e.logger&&(typeof e.logger!="function"?$u("new logger isn't a function, not replacing"):$u=e.logger)}Os.default=dO;dO.wrap=Os.wrap;dO.massWrap=Os.massWrap;dO.unwrap=Os.unwrap;dO.massUnwrap=Os.massUnwrap});var HOe=F(HF=>{"use strict";m();Object.defineProperty(HF,"__esModule",{value:!0});HF.InstrumentationAbstract=void 0;var mJ=(je(),Me(We)),HTt=cJ(),jF=AJ(),gJ=class{instrumentationName;instrumentationVersion;_config={};_tracer;_meter;_logger;_diag;constructor(t,n,r){this.instrumentationName=t,this.instrumentationVersion=n,this.setConfig(r),this._diag=mJ.diag.createComponentLogger({namespace:t}),this._tracer=mJ.trace.getTracer(t,n),this._meter=mJ.metrics.getMeter(t,n),this._logger=HTt.logs.getLogger(t,n),this._updateMetricInstruments()}_wrap=jF.wrap;_unwrap=jF.unwrap;_massWrap=jF.massWrap;_massUnwrap=jF.massUnwrap;get meter(){return this._meter}setMeterProvider(t){this._meter=t.getMeter(this.instrumentationName,this.instrumentationVersion),this._updateMetricInstruments()}get logger(){return this._logger}setLoggerProvider(t){this._logger=t.getLogger(this.instrumentationName,this.instrumentationVersion)}getModuleDefinitions(){let t=this.init()??[];return Array.isArray(t)?t:[t]}_updateMetricInstruments(){}getConfig(){return this._config}setConfig(t){this._config={enabled:!0,...t}}setTracerProvider(t){this._tracer=t.getTracer(this.instrumentationName,this.instrumentationVersion)}get tracer(){return this._tracer}_runSpanCustomizationHook(t,n,r,o){if(t)try{t(r,o)}catch(i){this._diag.error("Error running span customization hook due to exception in handler",{triggerName:n},i)}}};HF.InstrumentationAbstract=gJ});var zOe=F(Z_=>{"use strict";m();Object.defineProperty(Z_,"__esModule",{value:!0});Z_.ModuleNameTrie=Z_.ModuleNameSeparator=void 0;Z_.ModuleNameSeparator="/";var zF=class{hooks=[];children=new Map},hJ=class{_trie=new zF;_counter=0;insert(t){let n=this._trie;for(let r of t.moduleName.split(Z_.ModuleNameSeparator)){let o=n.children.get(r);o||(o=new zF,n.children.set(r,o)),n=o}n.hooks.push({hook:t,insertedId:this._counter++})}search(t,{maintainInsertionOrder:n,fullOnly:r}={}){let o=this._trie,i=[],a=!0;for(let c of t.split(Z_.ModuleNameSeparator)){let d=o.children.get(c);if(!d){a=!1;break}r||i.push(...d.hooks),o=d}return r&&a&&i.push(...o.hooks),i.length===0?[]:i.length===1?[i[0].hook]:(n&&i.sort((c,d)=>c.insertedId-d.insertedId),i.map(({hook:c})=>c))}};Z_.ModuleNameTrie=hJ});var VOe=F($F=>{"use strict";m();Object.defineProperty($F,"__esModule",{value:!0});$F.RequireInTheMiddleSingleton=void 0;var zTt=MS(),$Oe=Ge("path"),_J=zOe(),$Tt=["afterEach","after","beforeEach","before","describe","it"].every(e=>typeof global[e]=="function"),EJ=class e{_moduleNameTrie=new _J.ModuleNameTrie;static _instance;constructor(){this._initialize()}_initialize(){new zTt.Hook(null,{internals:!0},(t,n,r)=>{let o=VTt(n),i=this._moduleNameTrie.search(o,{maintainInsertionOrder:!0,fullOnly:r===void 0});for(let{onRequire:a}of i)t=a(t,n,r);return t})}register(t,n){let r={moduleName:t,onRequire:n};return this._moduleNameTrie.insert(r),r}static getInstance(){return $Tt?new e:this._instance=this._instance??new e}};$F.RequireInTheMiddleSingleton=EJ;function VTt(e){return $Oe.sep!==_J.ModuleNameSeparator?e.split($Oe.sep).join(_J.ModuleNameSeparator):e}});var SJ=F(W_=>{"use strict";m();Object.defineProperty(W_,"__esModule",{value:!0});W_.isWrapped=W_.safeExecuteInTheMiddleAsync=W_.safeExecuteInTheMiddle=void 0;function qTt(e,t,n){let r,o;try{o=e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}W_.safeExecuteInTheMiddle=qTt;async function YTt(e,t,n){let r,o;try{o=await e()}catch(i){r=i}finally{if(t(r,o),r&&!n)throw r;return o}}W_.safeExecuteInTheMiddleAsync=YTt;function KTt(e){return typeof e=="function"&&typeof e.__original=="function"&&typeof e.__unwrap=="function"&&e.__wrapped===!0}W_.isWrapped=KTt});var KOe=F(VF=>{"use strict";m();Object.defineProperty(VF,"__esModule",{value:!0});VF.InstrumentationBase=void 0;var pO=Ge("path"),qOe=Ge("util"),JTt=jOe(),yJ=AJ(),ZTt=HOe(),WTt=VOe(),XTt=tK(),fO=(je(),Me(We)),eIt=MS(),tIt=Ge("fs"),nIt=SJ(),TJ=class extends ZTt.InstrumentationAbstract{_modules;_hooks=[];_requireInTheMiddleSingleton=WTt.RequireInTheMiddleSingleton.getInstance();_enabled=!1;constructor(t,n,r){super(t,n,r);let o=this.init();o&&!Array.isArray(o)&&(o=[o]),this._modules=o||[],this._config.enabled&&this.enable()}_wrap=(t,n,r)=>{if((0,nIt.isWrapped)(t[n])&&this._unwrap(t,n),qOe.types.isProxy(t)){let o=(0,yJ.wrap)(Object.assign({},t),n,r);return Object.defineProperty(t,n,{value:o}),o}else return(0,yJ.wrap)(t,n,r)};_unwrap=(t,n)=>qOe.types.isProxy(t)?Object.defineProperty(t,n,{value:t[n]}):(0,yJ.unwrap)(t,n);_massWrap=(t,n,r)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(o=>{n.forEach(i=>{this._wrap(o,i,r)})})};_massUnwrap=(t,n)=>{if(t)Array.isArray(t)||(t=[t]);else{fO.diag.error("must provide one or more modules to patch");return}if(!(n&&Array.isArray(n))){fO.diag.error("must provide one or more functions to wrap on modules");return}t.forEach(r=>{n.forEach(o=>{this._unwrap(r,o)})})};_warnOnPreloadedModules(){this._modules.forEach(t=>{let{name:n}=t;try{let r=Ge.resolve(n);Ge.cache[r]&&this._diag.warn(`Module ${n} has been loaded before ${this.instrumentationName} so it might not work, please initialize it before requiring ${n}`)}catch{}})}_extractPackageVersion(t){try{let n=(0,tIt.readFileSync)(pO.join(t,"package.json"),{encoding:"utf8"}),r=JSON.parse(n).version;return typeof r=="string"?r:void 0}catch{fO.diag.warn("Failed extracting version",t)}}_onRequire(t,n,r,o){if(!o)return typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for nodejs core module on require hook",{module:t.name}),t.patch(n)):n;let i=this._extractPackageVersion(o);if(t.moduleVersion=i,t.name===r)return YOe(t.supportedVersions,i,t.includePrerelease)&&typeof t.patch=="function"&&(t.moduleExports=n,this._enabled)?(this._diag.debug("Applying instrumentation patch for module on require hook",{module:t.name,version:t.moduleVersion,baseDir:o}),t.patch(n,t.moduleVersion)):n;let a=t.files??[],c=pO.normalize(r);return a.filter(g=>g.name===c).filter(g=>YOe(g.supportedVersions,i,t.includePrerelease)).reduce((g,h)=>(h.moduleExports=g,this._enabled?(this._diag.debug("Applying instrumentation patch for nodejs module file on require hook",{module:t.name,version:t.moduleVersion,fileName:h.name,baseDir:o}),h.patch(g,t.moduleVersion)):g),n)}enable(){if(!this._enabled){if(this._enabled=!0,this._hooks.length>0){for(let t of this._modules){typeof t.patch=="function"&&t.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module on instrumentation enabled",{module:t.name,version:t.moduleVersion}),t.patch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Applying instrumentation patch for nodejs module file on instrumentation enabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.patch(n.moduleExports,t.moduleVersion))}return}this._warnOnPreloadedModules();for(let t of this._modules){let n=(a,c,d)=>{if(!d&&pO.isAbsolute(c)){let g=pO.parse(c);c=g.name,d=g.dir}return this._onRequire(t,a,c,d)},r=(a,c,d)=>this._onRequire(t,a,c,d),o=pO.isAbsolute(t.name)?new eIt.Hook([t.name],{internals:!0},r):this._requireInTheMiddleSingleton.register(t.name,r);this._hooks.push(o);let i=new XTt.Hook([t.name],{internals:!1},n);this._hooks.push(i)}}}disable(){if(this._enabled){this._enabled=!1;for(let t of this._modules){typeof t.unpatch=="function"&&t.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module on instrumentation disabled",{module:t.name,version:t.moduleVersion}),t.unpatch(t.moduleExports,t.moduleVersion));for(let n of t.files)n.moduleExports&&(this._diag.debug("Removing instrumentation patch for nodejs module file on instrumentation disabled",{module:t.name,version:t.moduleVersion,fileName:n.name}),n.unpatch(n.moduleExports,t.moduleVersion))}}}isEnabled(){return this._enabled}};VF.InstrumentationBase=TJ;function YOe(e,t,n){return typeof t>"u"?e.includes("*"):e.some(r=>(0,JTt.satisfies)(t,r,{includePrerelease:n}))}});var JOe=F(qF=>{"use strict";m();Object.defineProperty(qF,"__esModule",{value:!0});qF.normalize=void 0;var rIt=Ge("path");Object.defineProperty(qF,"normalize",{enumerable:!0,get:function(){return rIt.normalize}})});var ZOe=F(zv=>{"use strict";m();Object.defineProperty(zv,"__esModule",{value:!0});zv.normalize=zv.InstrumentationBase=void 0;var oIt=KOe();Object.defineProperty(zv,"InstrumentationBase",{enumerable:!0,get:function(){return oIt.InstrumentationBase}});var iIt=JOe();Object.defineProperty(zv,"normalize",{enumerable:!0,get:function(){return iIt.normalize}})});var IJ=F($v=>{"use strict";m();Object.defineProperty($v,"__esModule",{value:!0});$v.normalize=$v.InstrumentationBase=void 0;var WOe=ZOe();Object.defineProperty($v,"InstrumentationBase",{enumerable:!0,get:function(){return WOe.InstrumentationBase}});Object.defineProperty($v,"normalize",{enumerable:!0,get:function(){return WOe.normalize}})});var XOe=F(YF=>{"use strict";m();Object.defineProperty(YF,"__esModule",{value:!0});YF.InstrumentationNodeModuleDefinition=void 0;var CJ=class{name;supportedVersions;patch;unpatch;files;constructor(t,n,r,o,i){this.name=t,this.supportedVersions=n,this.patch=r,this.unpatch=o,this.files=i||[]}};YF.InstrumentationNodeModuleDefinition=CJ});var ewe=F(KF=>{"use strict";m();Object.defineProperty(KF,"__esModule",{value:!0});KF.InstrumentationNodeModuleFile=void 0;var aIt=IJ(),bJ=class{supportedVersions;patch;unpatch;name;constructor(t,n,r,o){this.supportedVersions=n,this.patch=r,this.unpatch=o,this.name=(0,aIt.normalize)(t)}};KF.InstrumentationNodeModuleFile=bJ});var twe=F(yy=>{"use strict";m();Object.defineProperty(yy,"__esModule",{value:!0});yy.semconvStabilityFromStr=yy.SemconvStability=void 0;var JF;(function(e){e[e.STABLE=1]="STABLE",e[e.OLD=2]="OLD",e[e.DUPLICATE=3]="DUPLICATE"})(JF=yy.SemconvStability||(yy.SemconvStability={}));function sIt(e,t){let n=JF.OLD,r=t?.split(",").map(o=>o.trim()).filter(o=>o!=="");for(let o of r??[])if(o.toLowerCase()===e+"/dup"){n=JF.DUPLICATE;break}else o.toLowerCase()===e&&(n=JF.STABLE);return n}yy.semconvStabilityFromStr=sIt});var rwe=F(na=>{"use strict";m();Object.defineProperty(na,"__esModule",{value:!0});na.semconvStabilityFromStr=na.SemconvStability=na.safeExecuteInTheMiddleAsync=na.safeExecuteInTheMiddle=na.isWrapped=na.InstrumentationNodeModuleFile=na.InstrumentationNodeModuleDefinition=na.InstrumentationBase=na.registerInstrumentations=void 0;var uIt=wOe();Object.defineProperty(na,"registerInstrumentations",{enumerable:!0,get:function(){return uIt.registerInstrumentations}});var cIt=IJ();Object.defineProperty(na,"InstrumentationBase",{enumerable:!0,get:function(){return cIt.InstrumentationBase}});var lIt=XOe();Object.defineProperty(na,"InstrumentationNodeModuleDefinition",{enumerable:!0,get:function(){return lIt.InstrumentationNodeModuleDefinition}});var dIt=ewe();Object.defineProperty(na,"InstrumentationNodeModuleFile",{enumerable:!0,get:function(){return dIt.InstrumentationNodeModuleFile}});var vJ=SJ();Object.defineProperty(na,"isWrapped",{enumerable:!0,get:function(){return vJ.isWrapped}});Object.defineProperty(na,"safeExecuteInTheMiddle",{enumerable:!0,get:function(){return vJ.safeExecuteInTheMiddle}});Object.defineProperty(na,"safeExecuteInTheMiddleAsync",{enumerable:!0,get:function(){return vJ.safeExecuteInTheMiddleAsync}});var nwe=twe();Object.defineProperty(na,"SemconvStability",{enumerable:!0,get:function(){return nwe.SemconvStability}});Object.defineProperty(na,"semconvStabilityFromStr",{enumerable:!0,get:function(){return nwe.semconvStabilityFromStr}})});function AIt(){let e=Vv[xJ];return e?.helper?e.helper:Vv[RJ]?.helper}function mIt(e){let t={helper:e};Vv[xJ]=t,Vv[RJ]=t}function gIt(){delete Vv[xJ],delete Vv[RJ]}function EIt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}function awe(e,t,n,r,o){if(swe(t.name,o))return;let i={attributes:t.attributes,kind:EIt(t.kind),startTime:t.startTime};e.startActiveSpan(t.name,i,a=>{r.set(t.id,a.spanContext().spanId),t.links&&a.addLinks(t.links.flatMap(d=>{let g=r.get(d);return g?{context:{spanId:g,traceId:a.spanContext().traceId,traceFlags:a.spanContext().traceFlags}}:[]}));let c=n.filter(d=>d.parentId===t.id);for(let d of c)awe(e,d,n,r,o);a.end(t.endTime)})}function owe(e,t){return yIt(t)?t.then(n=>(e.end(),n),n=>{throw e.end(),n}):(e.end(),t)}function yIt(e){return e!=null&&typeof e.then=="function"}function swe(e,t){return t.some(n=>typeof n=="string"?n===e:n.test(e))}var ZF,pIt,fIt,RJ,xJ,Vv,hIt,_It,SIt,uwe,iwe,TIt,IIt,cwe,lwe=O(()=>{m();je();ZF=ie(rwe(),1);je();pIt={name:"@prisma/instrumentation-contract",version:"7.6.0",description:"Shared types and utilities for Prisma instrumentation",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.mts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation-contract"},bugs:"https://github.com/prisma/prisma/issues",scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},files:["dist"],sideEffects:!1,devDependencies:{"@opentelemetry/api":"1.9.0"},peerDependencies:{"@opentelemetry/api":"^1.8"}},fIt=pIt.version.split(".")[0],RJ="PRISMA_INSTRUMENTATION",xJ=`V${fIt}_PRISMA_INSTRUMENTATION`,Vv=globalThis;hIt=process.env.PRISMA_SHOW_ALL_TRACES==="true",_It="00-10-10-00";SIt=class{tracerProvider;ignoreSpanTypes;constructor({tracerProvider:e,ignoreSpanTypes:t}){this.tracerProvider=e,this.ignoreSpanTypes=t}isEnabled(){return!0}getTraceParent(e){let t=Ht.getSpanContext(e??Ke.active());return t?`00-${t.traceId}-${t.spanId}-0${t.traceFlags}`:_It}dispatchEngineSpans(e){let t=this.tracerProvider.getTracer("prisma"),n=new Map,r=e.filter(o=>o.parentId===null);for(let o of r)awe(t,o,e,n,this.ignoreSpanTypes)}getActiveContext(){return Ke.active()}runInChildSpan(e,t){if(typeof e=="string"&&(e={name:e}),e.internal&&!hIt)return t();let n=this.tracerProvider.getTracer("prisma"),r=e.context??this.getActiveContext(),o=`prisma:client:${e.name}`;if(swe(o,this.ignoreSpanTypes))return t();if(e.active===!1){let i=n.startSpan(o,e,r);return owe(i,t(i,r))}return n.startActiveSpan(o,e,i=>owe(i,t(i,r)))}};uwe={name:"@prisma/instrumentation",version:"7.6.0",description:"OpenTelemetry compliant instrumentation for Prisma Client",main:"dist/index.js",module:"dist/index.mjs",types:"dist/index.d.ts",exports:{".":{require:{types:"./dist/index.d.ts",default:"./dist/index.js"},import:{types:"./dist/index.d.ts",default:"./dist/index.mjs"}}},license:"Apache-2.0",homepage:"https://www.prisma.io",repository:{type:"git",url:"https://github.com/prisma/prisma.git",directory:"packages/instrumentation"},bugs:"https://github.com/prisma/prisma/issues",devDependencies:{"@opentelemetry/api":"1.9.0","@prisma/instrumentation-contract":"workspace:*","@types/node":"~20.19.24",typescript:"5.4.5"},dependencies:{"@opentelemetry/instrumentation":"^0.207.0"},peerDependencies:{"@opentelemetry/api":"^1.8"},files:["dist"],keywords:["prisma","instrumentation","opentelemetry","otel"],scripts:{dev:"DEV=true tsx helpers/build.ts",build:"tsx helpers/build.ts",prepublishOnly:"pnpm run build",test:"vitest run"},sideEffects:!1},iwe=uwe.version,TIt=uwe.name,IIt="@prisma/client",cwe=class extends ZF.InstrumentationBase{tracerProvider;constructor(e={}){super(TIt,iwe,e)}setTracerProvider(e){this.tracerProvider=e}init(){return[new ZF.InstrumentationNodeModuleDefinition(IIt,[iwe])]}enable(){let e=this._config;mIt(new SIt({tracerProvider:this.tracerProvider??Ht.getTracerProvider(),ignoreSpanTypes:e.ignoreSpanTypes??[]}))}disable(){gIt()}isEnabled(){return AIt()!==void 0}}});function CIt(e){return!!e&&typeof e=="object"&&"dispatchEngineSpans"in e}function pwe(){let e=globalThis.PRISMA_INSTRUMENTATION;return e&&typeof e=="object"&&"helper"in e?e.helper:void 0}function bIt(e){switch(e){case"client":return oo.CLIENT;case"internal":default:return oo.INTERNAL}}var dwe,DJ,vIt,fwe,Awe=O(()=>{m();je();lwe();dt();mr();dwe="Prisma";DJ=class extends cwe{constructor(t){super(t?.instrumentationConfig)}enable(){super.enable();let t=pwe();CIt(t)&&(t.createEngineSpan=n=>{let r=Ht.getTracer("prismaV5Compatibility"),o=r._idGenerator;if(!o){Vo(()=>{console.warn("[Sentry] Could not find _idGenerator on tracer, skipping Prisma v5 compatibility - some Prisma spans may be missing!")});return}try{n.spans.forEach(i=>{let a=bIt(i.kind),c=i.parent_span_id,d=i.span_id,g=i.trace_id,h=i.links?.map(y=>({context:{traceId:y.trace_id,spanId:y.span_id,traceFlags:Ks.SAMPLED}})),S=Ht.setSpanContext(Ke.active(),{traceId:g,spanId:c,traceFlags:Ks.SAMPLED});Ke.with(S,()=>{let y={generateTraceId:()=>g,generateSpanId:()=>d};r._idGenerator=y,r.startSpan(i.name,{kind:a,links:h,startTime:i.start_time,attributes:i.attributes}).end(i.end_time),r._idGenerator=o})})}finally{r._idGenerator=o}})}};vIt=st(dwe,e=>new DJ(e)),fwe=e=>({name:dwe,setupOnce(){vIt(e)},setup(t){pwe()&&t.on("spanStart",n=>{let r=Ot(n);r.description?.startsWith("prisma:")&&n.setAttribute(kt,"auto.db.otel.prisma"),r.description==="prisma:engine:db_query"&&r.data["db.query.text"]&&n.updateName(r.data["db.query.text"]),r.description==="prisma:engine:db_query"&&!r.data["db.system"]&&n.setAttribute("db.system","prisma")})}})});var mwe=F(qv=>{"use strict";m();Object.defineProperty(qv,"__esModule",{value:!0});qv.PACKAGE_NAME=qv.PACKAGE_VERSION=void 0;qv.PACKAGE_VERSION="0.60.0";qv.PACKAGE_NAME="@opentelemetry/instrumentation-hapi"});var BJ=F(PA=>{"use strict";m();Object.defineProperty(PA,"__esModule",{value:!0});PA.HapiLifecycleMethodNames=PA.HapiLayerType=PA.handlerPatched=PA.HapiComponentName=void 0;PA.HapiComponentName="@hapi/hapi";PA.handlerPatched=Symbol("hapi-handler-patched");PA.HapiLayerType={ROUTER:"router",PLUGIN:"plugin",EXT:"server.ext"};PA.HapiLifecycleMethodNames=new Set(["onPreAuth","onCredentials","onPostAuth","onPreHandler","onPostHandler","onPreResponse","onRequest"])});var gwe=F(WF=>{"use strict";m();Object.defineProperty(WF,"__esModule",{value:!0});WF.ATTR_HTTP_METHOD=void 0;WF.ATTR_HTTP_METHOD="http.method"});var NJ=F(AO=>{"use strict";m();Object.defineProperty(AO,"__esModule",{value:!0});AO.AttributeNames=void 0;var RIt;(function(e){e.HAPI_TYPE="hapi.type",e.PLUGIN_NAME="hapi.plugin.name",e.EXT_TYPE="server.ext.type"})(RIt=AO.AttributeNames||(AO.AttributeNames={}))});var Ewe=F(ra=>{"use strict";m();Object.defineProperty(ra,"__esModule",{value:!0});ra.getPluginFromInput=ra.getExtMetadata=ra.getRouteMetadata=ra.isPatchableExtMethod=ra.isDirectExtInput=ra.isLifecycleExtEventObj=ra.isLifecycleExtType=ra.getPluginName=void 0;var hwe=(Zn(),Me(Ur)),xIt=gwe(),mO=BJ(),X_=NJ(),_we=rn();function DIt(e){return e.name?e.name:e.pkg.name}ra.getPluginName=DIt;var BIt=e=>typeof e=="string"&&mO.HapiLifecycleMethodNames.has(e);ra.isLifecycleExtType=BIt;var NIt=e=>{let t=e?.type;return t!==void 0&&(0,ra.isLifecycleExtType)(t)};ra.isLifecycleExtEventObj=NIt;var OIt=e=>Array.isArray(e)&&e.length<=3&&(0,ra.isLifecycleExtType)(e[0])&&typeof e[1]=="function";ra.isDirectExtInput=OIt;var wIt=e=>!Array.isArray(e);ra.isPatchableExtMethod=wIt;var kIt=(e,t,n)=>{let r={[hwe.ATTR_HTTP_ROUTE]:e.path};t&_we.SemconvStability.OLD&&(r[xIt.ATTR_HTTP_METHOD]=e.method),t&_we.SemconvStability.STABLE&&(r[hwe.ATTR_HTTP_REQUEST_METHOD]=e.method);let o;return n?(r[X_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.PLUGIN,r[X_.AttributeNames.PLUGIN_NAME]=n,o=`${n}: route - ${e.path}`):(r[X_.AttributeNames.HAPI_TYPE]=mO.HapiLayerType.ROUTER,o=`route - ${e.path}`),{attributes:r,name:o}};ra.getRouteMetadata=kIt;var MIt=(e,t,n)=>{let r=`ext - ${e}`;return n&&n!=="method"&&(r=`ext - ${e} - ${n}`),t?{attributes:{[X_.AttributeNames.EXT_TYPE]:e,[X_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT,[X_.AttributeNames.PLUGIN_NAME]:t},name:`${t}: ${r}`}:{attributes:{[X_.AttributeNames.EXT_TYPE]:e,[X_.AttributeNames.HAPI_TYPE]:mO.HapiLayerType.EXT},name:r}};ra.getExtMetadata=MIt;var PIt=e=>"plugin"in e?"plugin"in e.plugin?e.plugin.plugin:e.plugin:e;ra.getPluginFromInput=PIt});var Twe=F(XF=>{"use strict";m();Object.defineProperty(XF,"__esModule",{value:!0});XF.HapiInstrumentation=void 0;var Ql=(je(),Me(We)),Swe=Tr(),gO=rn(),ywe=mwe(),hO=BJ(),Dg=Ewe(),OJ=class extends gO.InstrumentationBase{_semconvStability;constructor(t={}){super(ywe.PACKAGE_NAME,ywe.PACKAGE_VERSION,t),this._semconvStability=(0,gO.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return new gO.InstrumentationNodeModuleDefinition(hO.HapiComponentName,[">=17.0.0 <22"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return(0,gO.isWrapped)(n.server)||this._wrap(n,"server",this._getServerPatch.bind(this)),(0,gO.isWrapped)(n.Server)||this._wrap(n,"Server",this._getServerPatch.bind(this)),n},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;this._massUnwrap([n],["server","Server"])})}_getServerPatch(t){let n=this,r=this;return function(i){let a=t.apply(this,[i]);return r._wrap(a,"route",c=>n._getServerRoutePatch.bind(n)(c)),r._wrap(a,"ext",c=>n._getServerExtPatch.bind(n)(c)),r._wrap(a,"register",n._getServerRegisterPatch.bind(n)),a}}_getServerRegisterPatch(t){let n=this;return function(o,i){if(Array.isArray(o))for(let a of o){let c=(0,Dg.getPluginFromInput)(a);n._wrapRegisterHandler(c)}else{let a=(0,Dg.getPluginFromInput)(o);n._wrapRegisterHandler(a)}return t.apply(this,[o,i])}}_getServerExtPatch(t,n){let r=this;return function(...i){if(Array.isArray(i[0])){let a=i[0];for(let c=0;c<a.length;c++){let d=a[c];if((0,Dg.isLifecycleExtType)(d.type)){let g=d,h=r._wrapExtMethods(g.method,d.type,n);g.method=h,a[c]=g}}return t.apply(this,i)}else if((0,Dg.isDirectExtInput)(i)){let a=i,c=a[1],d=r._wrapExtMethods(c,a[0],n);return t.apply(this,[a[0],d,a[2]])}else if((0,Dg.isLifecycleExtEventObj)(i[0])){let a=i[0],c=r._wrapExtMethods(a.method,a.type,n);return a.method=c,t.call(this,a)}return t.apply(this,i)}}_getServerRoutePatch(t,n){let r=this;return function(o){if(Array.isArray(o))for(let i=0;i<o.length;i++){let a=r._wrapRouteHandler.call(r,o[i],n);o[i]=a}else o=r._wrapRouteHandler.call(r,o,n);return t.apply(this,[o])}}_wrapRegisterHandler(t){let n=this,r=(0,Dg.getPluginName)(t),o=t.register,i=this,a=function(c,d){return i._wrap(c,"route",g=>n._getServerRoutePatch.bind(n)(g,r)),i._wrap(c,"ext",g=>n._getServerExtPatch.bind(n)(g,r)),o.call(this,c,d)};t.register=a}_wrapExtMethods(t,n,r){let o=this;if(t instanceof Array){for(let i=0;i<t.length;i++)t[i]=o._wrapExtMethods(t[i],n);return t}else if((0,Dg.isPatchableExtMethod)(t))return t[hO.handlerPatched]===!0?t:(t[hO.handlerPatched]=!0,async function(...a){if(Ql.trace.getSpan(Ql.context.active())===void 0)return await t.apply(this,a);let c=(0,Dg.getExtMetadata)(n,r,t.name),d=o.tracer.startSpan(c.name,{attributes:c.attributes});try{return await Ql.context.with(Ql.trace.setSpan(Ql.context.active(),d),t,void 0,...a)}catch(g){throw d.recordException(g),d.setStatus({code:Ql.SpanStatusCode.ERROR,message:g.message}),g}finally{d.end()}});return t}_wrapRouteHandler(t,n){let r=this;if(t[hO.handlerPatched]===!0)return t;t[hO.handlerPatched]=!0;let o=i=>async function(...a){if(Ql.trace.getSpan(Ql.context.active())===void 0)return await i.call(this,...a);let c=(0,Swe.getRPCMetadata)(Ql.context.active());c?.type===Swe.RPCType.HTTP&&(c.route=t.path);let d=(0,Dg.getRouteMetadata)(t,r._semconvStability,n),g=r.tracer.startSpan(d.name,{attributes:d.attributes});try{return await Ql.context.with(Ql.trace.setSpan(Ql.context.active(),g),()=>i.call(this,...a))}catch(h){throw g.recordException(h),g.setStatus({code:Ql.SpanStatusCode.ERROR,message:h.message}),h}finally{g.end()}};if(typeof t.handler=="function")t.handler=o(t.handler);else if(typeof t.options=="function"){let i=t.options;t.options=function(a){let c=i(a);return typeof c.handler=="function"&&(c.handler=o(c.handler)),c}}else typeof t.options?.handler=="function"&&(t.options.handler=o(t.options.handler));return t}};XF.HapiInstrumentation=OJ});var Iwe=F(Yv=>{"use strict";m();Object.defineProperty(Yv,"__esModule",{value:!0});Yv.AttributeNames=Yv.HapiInstrumentation=void 0;var UIt=Twe();Object.defineProperty(Yv,"HapiInstrumentation",{enumerable:!0,get:function(){return UIt.HapiInstrumentation}});var LIt=NJ();Object.defineProperty(Yv,"AttributeNames",{enumerable:!0,get:function(){return LIt.AttributeNames}})});var Cwe,bwe,vwe,QIt,Rwe,xwe=O(()=>{m();Cwe=ie(Iwe(),1);mr();bwe="Hapi",vwe=st(bwe,()=>new Cwe.HapiInstrumentation),QIt=()=>({name:bwe,setupOnce(){vwe()}}),Rwe=QIt});var eE,_O,wJ=O(()=>{m();eE={HONO_TYPE:"hono.type",HONO_NAME:"hono.name"},_O={MIDDLEWARE:"middleware",REQUEST_HANDLER:"request_handler"}});var t3,FIt,GIt,e3,Dwe=O(()=>{m();je();t3=ie(rn(),1);dt();wJ();FIt="@sentry/instrumentation-hono",GIt="0.0.1",e3=class extends t3.InstrumentationBase{constructor(t={}){super(FIt,GIt,t)}init(){return[new t3.InstrumentationNodeModuleDefinition("hono",[">=4.0.0 <5"],t=>this._patch(t))]}_patch(t){let n=this;class r extends t.Hono{constructor(...i){super(...i),n._wrap(this,"get",n._patchHandler()),n._wrap(this,"post",n._patchHandler()),n._wrap(this,"put",n._patchHandler()),n._wrap(this,"delete",n._patchHandler()),n._wrap(this,"options",n._patchHandler()),n._wrap(this,"patch",n._patchHandler()),n._wrap(this,"all",n._patchHandler()),n._wrap(this,"on",n._patchOnHandler()),n._wrap(this,"use",n._patchMiddlewareHandler())}}try{t.Hono=r}catch{return{...t,Hono:r}}return t}_patchHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_patchOnHandler(){let t=this;return function(n){return function(...o){let i=o.slice(2);return n.apply(this,[...o.slice(0,2),...i.map(a=>t._wrapHandler(a))])}}}_patchMiddlewareHandler(){let t=this;return function(n){return function(...o){if(typeof o[0]=="string"){let i=o[0];if(o.length===1)return n.apply(this,[i]);let a=o.slice(1);return n.apply(this,[i,...a.map(c=>t._wrapHandler(c))])}return n.apply(this,o.map(i=>t._wrapHandler(i)))}}}_wrapHandler(t){let n=this;return function(r,o){if(!n.isEnabled())return t.apply(this,[r,o]);let i=r.req.path,a=n.tracer.startSpan(i);return Ke.with(Ht.setSpan(Ke.active(),a),()=>n._safeExecute(()=>{let c=t.apply(this,[r,o]);if(Is(c))return c.then(d=>{let g=n._determineHandlerType(d);return a.setAttributes({[eE.HONO_TYPE]:g,[eE.HONO_NAME]:g===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),d});{let d=n._determineHandlerType(c);return a.setAttributes({[eE.HONO_TYPE]:d,[eE.HONO_NAME]:d===_O.REQUEST_HANDLER?i:t.name||"anonymous"}),n.getConfig().responseHook?.(a),c}},()=>a.end(),c=>{n._handleError(a,c),a.end()}))}}_safeExecute(t,n,r){try{let o=t();return Is(o)?o.then(()=>n(),i=>r(i)):n(),o}catch(o){throw r(o),o}}_determineHandlerType(t){return t===void 0?_O.MIDDLEWARE:_O.REQUEST_HANDLER}_handleError(t,n){n instanceof Error&&(t.setStatus({code:ui.ERROR,message:n.message}),t.recordException(n))}}});function jIt(e){let t=Ot(e).data,n=t[eE.HONO_TYPE];if(t[Zt]||!n)return;e.setAttributes({[kt]:"auto.http.otel.hono",[Zt]:`${n}.hono`});let r=t[eE.HONO_NAME];if(typeof r=="string"&&e.updateName(r),Cn()===kd()){ya&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let o=t[ng],i=t[BS];typeof o=="string"&&typeof i=="string"&&Cn().setTransactionName(`${i} ${o}`)}var Bwe,Nwe,HIt,Owe,wwe=O(()=>{m();Zn();dt();mr();ly();wJ();Dwe();Bwe="Hono";Nwe=st(Bwe,()=>new e3({responseHook:e=>{jIt(e)}})),HIt=()=>({name:Bwe,setupOnce(){Nwe()}}),Owe=HIt});var n3=F(EO=>{"use strict";m();Object.defineProperty(EO,"__esModule",{value:!0});EO.KoaLayerType=void 0;var zIt;(function(e){e.ROUTER="router",e.MIDDLEWARE="middleware"})(zIt=EO.KoaLayerType||(EO.KoaLayerType={}))});var kwe=F(Kv=>{"use strict";m();Object.defineProperty(Kv,"__esModule",{value:!0});Kv.PACKAGE_NAME=Kv.PACKAGE_VERSION=void 0;Kv.PACKAGE_VERSION="0.62.0";Kv.PACKAGE_NAME="@opentelemetry/instrumentation-koa"});var kJ=F(SO=>{"use strict";m();Object.defineProperty(SO,"__esModule",{value:!0});SO.AttributeNames=void 0;var $It;(function(e){e.KOA_TYPE="koa.type",e.KOA_NAME="koa.name"})($It=SO.AttributeNames||(SO.AttributeNames={}))});var Pwe=F(Jv=>{"use strict";m();Object.defineProperty(Jv,"__esModule",{value:!0});Jv.isLayerIgnored=Jv.getMiddlewareMetadata=void 0;var Mwe=n3(),r3=kJ(),VIt=(Zn(),Me(Ur)),qIt=(e,t,n,r)=>n?{attributes:{[r3.AttributeNames.KOA_NAME]:r?.toString(),[r3.AttributeNames.KOA_TYPE]:Mwe.KoaLayerType.ROUTER,[VIt.ATTR_HTTP_ROUTE]:r?.toString()},name:e._matchedRouteName||`router - ${r}`}:{attributes:{[r3.AttributeNames.KOA_NAME]:t.name??"middleware",[r3.AttributeNames.KOA_TYPE]:Mwe.KoaLayerType.MIDDLEWARE},name:`middleware - ${t.name}`};Jv.getMiddlewareMetadata=qIt;var YIt=(e,t)=>!!(Array.isArray(t?.ignoreLayersType)&&t?.ignoreLayersType?.includes(e));Jv.isLayerIgnored=YIt});var Uwe=F(o3=>{"use strict";m();Object.defineProperty(o3,"__esModule",{value:!0});o3.kLayerPatched=void 0;o3.kLayerPatched=Symbol("koa-layer-patched")});var Hwe=F(i3=>{"use strict";m();Object.defineProperty(i3,"__esModule",{value:!0});i3.KoaInstrumentation=void 0;var UA=(je(),Me(We)),yO=rn(),Lwe=n3(),Qwe=kwe(),Fwe=Pwe(),Gwe=Tr(),jwe=Uwe(),MJ=class extends yO.InstrumentationBase{constructor(t={}){super(Qwe.PACKAGE_NAME,Qwe.PACKAGE_VERSION,t)}init(){return new yO.InstrumentationNodeModuleDefinition("koa",[">=2.0.0 <4"],t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;return n==null?n:((0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use"),this._wrap(n.prototype,"use",this._getKoaUsePatch.bind(this)),t)},t=>{let n=t[Symbol.toStringTag]==="Module"?t.default:t;(0,yO.isWrapped)(n.prototype.use)&&this._unwrap(n.prototype,"use")})}_getKoaUsePatch(t){let n=this;return function(o){let i;return o.router?i=n._patchRouterDispatch(o):i=n._patchLayer(o,!1),t.apply(this,[i])}}_patchRouterDispatch(t){UA.diag.debug("Patching @koa/router dispatch");let r=t.router?.stack??[];for(let o of r){let i=o.path,a=o.stack;for(let c=0;c<a.length;c++){let d=a[c];a[c]=this._patchLayer(d,!0,i)}}return t}_patchLayer(t,n,r){let o=n?Lwe.KoaLayerType.ROUTER:Lwe.KoaLayerType.MIDDLEWARE;return t[jwe.kLayerPatched]===!0||(0,Fwe.isLayerIgnored)(o,this.getConfig())?t:t.constructor.name==="GeneratorFunction"||t.constructor.name==="AsyncGeneratorFunction"?(UA.diag.debug("ignoring generator-based Koa middleware layer"),t):(t[jwe.kLayerPatched]=!0,UA.diag.debug("patching Koa middleware layer"),async(i,a)=>{if(UA.trace.getSpan(UA.context.active())===void 0)return t(i,a);let d=(0,Fwe.getMiddlewareMetadata)(i,t,n,r),g=this.tracer.startSpan(d.name,{attributes:d.attributes}),h=(0,Gwe.getRPCMetadata)(UA.context.active());h?.type===Gwe.RPCType.HTTP&&i._matchedRoute&&(h.route=i._matchedRoute.toString());let{requestHook:S}=this.getConfig();S&&(0,yO.safeExecuteInTheMiddle)(()=>S(g,{context:i,middlewareLayer:t,layerType:o}),C=>{C&&UA.diag.error("koa instrumentation: request hook failed",C)},!0);let y=UA.trace.setSpan(UA.context.active(),g);return UA.context.with(y,async()=>{try{return await t(i,a)}catch(C){throw g.recordException(C),C}finally{g.end()}})})}};i3.KoaInstrumentation=MJ});var zwe=F(tE=>{"use strict";m();Object.defineProperty(tE,"__esModule",{value:!0});tE.KoaLayerType=tE.AttributeNames=tE.KoaInstrumentation=void 0;var KIt=Hwe();Object.defineProperty(tE,"KoaInstrumentation",{enumerable:!0,get:function(){return KIt.KoaInstrumentation}});var JIt=kJ();Object.defineProperty(tE,"AttributeNames",{enumerable:!0,get:function(){return JIt.AttributeNames}});var ZIt=n3();Object.defineProperty(tE,"KoaLayerType",{enumerable:!0,get:function(){return ZIt.KoaLayerType}})});var $we,Vwe,qwe,WIt,Ywe,Kwe=O(()=>{m();$we=ie(zwe(),1);Zn();dt();mr();ly();Vwe="Koa",qwe=st(Vwe,$we.KoaInstrumentation,(e={})=>({ignoreLayersType:e.ignoreLayersType,requestHook(t,n){Lr(t,"auto.http.otel.koa");let r=Ot(t).data,o=r["koa.type"];o&&t.setAttribute(Zt,`${o}.koa`);let i=r["koa.name"];if(typeof i=="string"&&t.updateName(i||"< unknown >"),Cn()===kd()){ya&&J.warn("Isolation scope is default isolation scope - skipping setting transactionName");return}let a=r[ng],c=n.context?.request?.method?.toUpperCase()||"GET";a&&Cn().setTransactionName(`${c} ${a}`)}})),WIt=(e={})=>({name:Vwe,setupOnce(){qwe(e)}}),Ywe=WIt});var PJ=F(lf=>{"use strict";m();Object.defineProperty(lf,"__esModule",{value:!0});lf.ConnectNames=lf.ConnectTypes=lf.AttributeNames=void 0;var XIt;(function(e){e.CONNECT_TYPE="connect.type",e.CONNECT_NAME="connect.name"})(XIt=lf.AttributeNames||(lf.AttributeNames={}));var eCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request_handler"})(eCt=lf.ConnectTypes||(lf.ConnectTypes={}));var tCt;(function(e){e.MIDDLEWARE="middleware",e.REQUEST_HANDLER="request handler"})(tCt=lf.ConnectNames||(lf.ConnectNames={}))});var Jwe=F(Zv=>{"use strict";m();Object.defineProperty(Zv,"__esModule",{value:!0});Zv.PACKAGE_NAME=Zv.PACKAGE_VERSION=void 0;Zv.PACKAGE_VERSION="0.57.0";Zv.PACKAGE_NAME="@opentelemetry/instrumentation-connect"});var Zwe=F(a3=>{"use strict";m();Object.defineProperty(a3,"__esModule",{value:!0});a3._LAYERS_STORE_PROPERTY=void 0;a3._LAYERS_STORE_PROPERTY=Symbol("opentelemetry.instrumentation-connect.request-route-stack")});var Wwe=F(rE=>{"use strict";m();Object.defineProperty(rE,"__esModule",{value:!0});rE.generateRoute=rE.replaceCurrentStackRoute=rE.addNewStackLayer=void 0;var nCt=(je(),Me(We)),nE=Zwe(),rCt=e=>{Array.isArray(e[nE._LAYERS_STORE_PROPERTY])===!1&&Object.defineProperty(e,nE._LAYERS_STORE_PROPERTY,{enumerable:!1,value:[]}),e[nE._LAYERS_STORE_PROPERTY].push("/");let t=e[nE._LAYERS_STORE_PROPERTY].length;return()=>{t===e[nE._LAYERS_STORE_PROPERTY].length?e[nE._LAYERS_STORE_PROPERTY].pop():nCt.diag.warn("Connect: Trying to pop the stack multiple time")}};rE.addNewStackLayer=rCt;var oCt=(e,t)=>{t&&e[nE._LAYERS_STORE_PROPERTY].splice(-1,1,t)};rE.replaceCurrentStackRoute=oCt;var iCt=e=>e[nE._LAYERS_STORE_PROPERTY].reduce((t,n)=>t.replace(/\/+$/,"")+n);rE.generateRoute=iCt});var tke=F(oE=>{"use strict";m();Object.defineProperty(oE,"__esModule",{value:!0});oE.ConnectInstrumentation=oE.ANONYMOUS_NAME=void 0;var aCt=(je(),Me(We)),Xwe=Tr(),Wv=PJ(),eke=Jwe(),s3=rn(),sCt=(Zn(),Me(Ur)),UJ=Wwe();oE.ANONYMOUS_NAME="anonymous";var LJ=class extends s3.InstrumentationBase{constructor(t={}){super(eke.PACKAGE_NAME,eke.PACKAGE_VERSION,t)}init(){return[new s3.InstrumentationNodeModuleDefinition("connect",[">=3.0.0 <4"],t=>this._patchConstructor(t))]}_patchApp(t){(0,s3.isWrapped)(t.use)||this._wrap(t,"use",this._patchUse.bind(this)),(0,s3.isWrapped)(t.handle)||this._wrap(t,"handle",this._patchHandle.bind(this))}_patchConstructor(t){let n=this;return function(...r){let o=t.apply(this,r);return n._patchApp(o),o}}_patchNext(t,n){return function(o){let i=t.apply(this,[o]);return n(),i}}_startSpan(t,n){let r,o,i;t?(r=Wv.ConnectTypes.REQUEST_HANDLER,i=Wv.ConnectNames.REQUEST_HANDLER,o=t):(r=Wv.ConnectTypes.MIDDLEWARE,i=Wv.ConnectNames.MIDDLEWARE,o=n.name||oE.ANONYMOUS_NAME);let a=`${i} - ${o}`,c={attributes:{[sCt.ATTR_HTTP_ROUTE]:t.length>0?t:"/",[Wv.AttributeNames.CONNECT_TYPE]:r,[Wv.AttributeNames.CONNECT_NAME]:o}};return this.tracer.startSpan(a,c)}_patchMiddleware(t,n){let r=this,o=n.length===4;function i(){if(!r.isEnabled())return n.apply(this,arguments);let[a,c,d]=o?[1,2,3]:[0,1,2],g=arguments[a],h=arguments[c],S=arguments[d];(0,UJ.replaceCurrentStackRoute)(g,t);let y=(0,Xwe.getRPCMetadata)(aCt.context.active());t&&y?.type===Xwe.RPCType.HTTP&&(y.route=(0,UJ.generateRoute)(g));let C="";t?C=`request handler - ${t}`:C=`middleware - ${n.name||oE.ANONYMOUS_NAME}`;let v=r._startSpan(t,n);r._diag.debug("start span",C);let x=!1;function N(){x?r._diag.debug(`span ${v.name} - already finished`):(x=!0,r._diag.debug(`finishing span ${v.name}`),v.end()),h.removeListener("close",N)}return h.addListener("close",N),arguments[d]=r._patchNext(S,N),n.apply(this,arguments)}return Object.defineProperty(i,"length",{value:n.length,writable:!1,configurable:!0}),i}_patchUse(t){let n=this;return function(...r){let o=r[r.length-1],i=r[r.length-2]||"";return r[r.length-1]=n._patchMiddleware(i,o),t.apply(this,r)}}_patchHandle(t){let n=this;return function(){let[r,o]=[0,2],i=arguments[r],a=arguments[o],c=(0,UJ.addNewStackLayer)(i);return typeof a=="function"&&(arguments[o]=n._patchOut(a,c)),t.apply(this,arguments)}}_patchOut(t,n){return function(...o){return n(),Reflect.apply(t,this,o)}}};oE.ConnectInstrumentation=LJ});var rke=F(Jd=>{"use strict";m();Object.defineProperty(Jd,"__esModule",{value:!0});Jd.ConnectTypes=Jd.ConnectNames=Jd.AttributeNames=Jd.ANONYMOUS_NAME=Jd.ConnectInstrumentation=void 0;var nke=tke();Object.defineProperty(Jd,"ConnectInstrumentation",{enumerable:!0,get:function(){return nke.ConnectInstrumentation}});Object.defineProperty(Jd,"ANONYMOUS_NAME",{enumerable:!0,get:function(){return nke.ANONYMOUS_NAME}});var QJ=PJ();Object.defineProperty(Jd,"AttributeNames",{enumerable:!0,get:function(){return QJ.AttributeNames}});Object.defineProperty(Jd,"ConnectNames",{enumerable:!0,get:function(){return QJ.ConnectNames}});Object.defineProperty(Jd,"ConnectTypes",{enumerable:!0,get:function(){return QJ.ConnectTypes}})});var oke,ike,ake,uCt,ske,uke=O(()=>{m();oke=ie(rke(),1);mr();ike="Connect",ake=st(ike,()=>new oke.ConnectInstrumentation),uCt=()=>({name:ike,setupOnce(){ake()}}),ske=uCt});var cke=F(rs=>{"use strict";m();Object.defineProperty(rs,"__esModule",{value:!0});rs.DB_SYSTEM_VALUE_MSSQL=rs.ATTR_NET_PEER_PORT=rs.ATTR_NET_PEER_NAME=rs.ATTR_DB_USER=rs.ATTR_DB_SYSTEM=rs.ATTR_DB_STATEMENT=rs.ATTR_DB_SQL_TABLE=rs.ATTR_DB_NAME=void 0;rs.ATTR_DB_NAME="db.name";rs.ATTR_DB_SQL_TABLE="db.sql.table";rs.ATTR_DB_STATEMENT="db.statement";rs.ATTR_DB_SYSTEM="db.system";rs.ATTR_DB_USER="db.user";rs.ATTR_NET_PEER_NAME="net.peer.name";rs.ATTR_NET_PEER_PORT="net.peer.port";rs.DB_SYSTEM_VALUE_MSSQL="mssql"});var lke=F(Xv=>{"use strict";m();Object.defineProperty(Xv,"__esModule",{value:!0});Xv.once=Xv.getSpanName=void 0;function cCt(e,t,n,r){return e==="execBulkLoad"&&r&&t?`${e} ${r} ${t}`:e==="callProcedure"?t?`${e} ${n} ${t}`:`${e} ${n}`:t?`${e} ${t}`:`${e}`}Xv.getSpanName=cCt;var lCt=e=>{let t=!1;return(...n)=>{if(!t)return t=!0,e(...n)}};Xv.once=lCt});var dke=F(eR=>{"use strict";m();Object.defineProperty(eR,"__esModule",{value:!0});eR.PACKAGE_NAME=eR.PACKAGE_VERSION=void 0;eR.PACKAGE_VERSION="0.33.0";eR.PACKAGE_NAME="@opentelemetry/instrumentation-tedious"});var gke=F(aE=>{"use strict";m();Object.defineProperty(aE,"__esModule",{value:!0});aE.TediousInstrumentation=aE.INJECTED_CTX=void 0;var tR=(je(),Me(We)),dCt=Ge("events"),LA=rn(),Ty=(Zn(),Me(Ur)),iE=cke(),pke=lke(),fke=dke(),mke=Symbol("opentelemetry.instrumentation-tedious.current-database");aE.INJECTED_CTX=Symbol("opentelemetry.instrumentation-tedious.context-info-injected");var Ake=["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"];function u3(e){Object.defineProperty(this,mke,{value:e,writable:!0})}var FJ=class e extends LA.InstrumentationBase{static COMPONENT="tedious";_netSemconvStability;_dbSemconvStability;constructor(t={}){super(fke.PACKAGE_NAME,fke.PACKAGE_VERSION,t),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,LA.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN),this._dbSemconvStability=(0,LA.semconvStabilityFromStr)("database",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}init(){return[new LA.InstrumentationNodeModuleDefinition(e.COMPONENT,[">=1.11.0 <20"],t=>{let n=t.Connection.prototype;for(let r of Ake)(0,LA.isWrapped)(n[r])&&this._unwrap(n,r),this._wrap(n,r,this._patchQuery(r,t));return(0,LA.isWrapped)(n.connect)&&this._unwrap(n,"connect"),this._wrap(n,"connect",this._patchConnect),t},t=>{if(t===void 0)return;let n=t.Connection.prototype;for(let r of Ake)this._unwrap(n,r);this._unwrap(n,"connect")})]}_patchConnect(t){return function(){return u3.call(this,this.config?.options?.database),this.removeListener("databaseChange",u3),this.on("databaseChange",u3),this.once("end",()=>{this.removeListener("databaseChange",u3)}),t.apply(this,arguments)}}_buildTraceparent(t){let n=t.spanContext();return`00-${n.traceId}-${n.spanId}-0${Number(n.traceFlags||tR.TraceFlags.NONE).toString(16)}`}_injectContextInfo(t,n,r){return new Promise(o=>{try{let i="set context_info @opentelemetry_traceparent",a=new n.Request(i,d=>{o()});Object.defineProperty(a,aE.INJECTED_CTX,{value:!0});let c=Buffer.from(r,"utf8");a.addParameter("opentelemetry_traceparent",n.TYPES.VarBinary,c,{length:c.length}),t.execSql(a)}catch{o()}})}_shouldInjectFor(t){return t==="execSql"||t==="execSqlBatch"||t==="callProcedure"||t==="execute"}_patchQuery(t,n){return r=>{let o=this;function i(a){if(a?.[aE.INJECTED_CTX])return r.apply(this,arguments);if(!(a instanceof dCt.EventEmitter))return o._diag.warn(`Unexpected invocation of patched ${t} method. Span not recorded`),r.apply(this,arguments);let c=0,d=0,g=()=>d++,h=()=>c++,S=this[mke],y=(G=>G.sqlTextOrProcedure==="sp_prepare"&&G.parametersByName?.stmt?.value?G.parametersByName.stmt.value:G.sqlTextOrProcedure)(a),C={};o._dbSemconvStability&LA.SemconvStability.OLD&&(C[iE.ATTR_DB_SYSTEM]=iE.DB_SYSTEM_VALUE_MSSQL,C[iE.ATTR_DB_NAME]=S,C[iE.ATTR_DB_USER]=this.config?.userName??this.config?.authentication?.options?.userName,C[iE.ATTR_DB_STATEMENT]=y,C[iE.ATTR_DB_SQL_TABLE]=a.table),o._dbSemconvStability&LA.SemconvStability.STABLE&&(C[Ty.ATTR_DB_NAMESPACE]=S,C[Ty.ATTR_DB_SYSTEM_NAME]=Ty.DB_SYSTEM_NAME_VALUE_MICROSOFT_SQL_SERVER,C[Ty.ATTR_DB_QUERY_TEXT]=y,C[Ty.ATTR_DB_COLLECTION_NAME]=a.table),o._netSemconvStability&LA.SemconvStability.OLD&&(C[iE.ATTR_NET_PEER_NAME]=this.config?.server,C[iE.ATTR_NET_PEER_PORT]=this.config?.options?.port),o._netSemconvStability&LA.SemconvStability.STABLE&&(C[Ty.ATTR_SERVER_ADDRESS]=this.config?.server,C[Ty.ATTR_SERVER_PORT]=this.config?.options?.port);let v=o.tracer.startSpan((0,pke.getSpanName)(t,S,y,a.table),{kind:tR.SpanKind.CLIENT,attributes:C}),x=(0,pke.once)(G=>{a.removeListener("done",g),a.removeListener("doneInProc",g),a.removeListener("doneProc",h),a.removeListener("error",x),this.removeListener("end",x),v.setAttribute("tedious.procedure_count",c),v.setAttribute("tedious.statement_count",d),G&&v.setStatus({code:tR.SpanStatusCode.ERROR,message:G.message}),v.end()});a.on("done",g),a.on("doneInProc",g),a.on("doneProc",h),a.once("error",x),this.on("end",x),typeof a.callback=="function"?o._wrap(a,"callback",o._patchCallbackQuery(x)):o._diag.error("Expected request.callback to be a function");let N=()=>tR.context.with(tR.trace.setSpan(tR.context.active(),v),r,this,...arguments);if(!(o.getConfig().enableTraceContextPropagation&&o._shouldInjectFor(t)))return N();let j=o._buildTraceparent(v);o._injectContextInfo(this,n,j).finally(N)}return Object.defineProperty(i,"length",{value:r.length,writable:!1}),i}}_patchCallbackQuery(t){return n=>function(r,o,i){return t(r),n.apply(this,arguments)}}};aE.TediousInstrumentation=FJ});var hke=F(c3=>{"use strict";m();Object.defineProperty(c3,"__esModule",{value:!0});c3.TediousInstrumentation=void 0;var pCt=gke();Object.defineProperty(c3,"TediousInstrumentation",{enumerable:!0,get:function(){return pCt.TediousInstrumentation}})});var _ke,fCt,Eke,Ske,ACt,yke,Tke=O(()=>{m();_ke=ie(hke(),1);dt();mr();fCt=new Set(["callProcedure","execSql","execSqlBatch","execBulkLoad","prepare","execute"]),Eke="Tedious",Ske=st(Eke,()=>new _ke.TediousInstrumentation({})),ACt=()=>{let e;return{name:Eke,setupOnce(){let t=Ske();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let{description:r,data:o}=Ot(n);if(!r||o["db.system"]!=="mssql")return;let i=r.split(" ")[0]||"";fCt.has(i)&&n.setAttribute(kt,"auto.db.otel.tedious")}))}}},yke=ACt});var Ike=F(nR=>{"use strict";m();Object.defineProperty(nR,"__esModule",{value:!0});nR.PACKAGE_NAME=nR.PACKAGE_VERSION=void 0;nR.PACKAGE_VERSION="0.57.0";nR.PACKAGE_NAME="@opentelemetry/instrumentation-generic-pool"});var bke=F(l3=>{"use strict";m();Object.defineProperty(l3,"__esModule",{value:!0});l3.GenericPoolInstrumentation=void 0;var rR=(je(),Me(We)),Iy=rn(),Cke=Ike(),GJ="generic-pool",jJ=class extends Iy.InstrumentationBase{_isDisabled=!1;constructor(t={}){super(Cke.PACKAGE_NAME,Cke.PACKAGE_VERSION,t)}init(){return[new Iy.InstrumentationNodeModuleDefinition(GJ,[">=3.0.0 <4"],t=>{let n=t.Pool;return(0,Iy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquirePatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Iy.InstrumentationNodeModuleDefinition(GJ,[">=2.4.0 <3"],t=>{let n=t.Pool;return(0,Iy.isWrapped)(n.prototype.acquire)&&this._unwrap(n.prototype,"acquire"),this._wrap(n.prototype,"acquire",this._acquireWithCallbacksPatcher.bind(this)),t},t=>{let n=t.Pool;return this._unwrap(n.prototype,"acquire"),t}),new Iy.InstrumentationNodeModuleDefinition(GJ,[">=2.0.0 <2.4"],t=>(this._isDisabled=!1,(0,Iy.isWrapped)(t.Pool)&&this._unwrap(t,"Pool"),this._wrap(t,"Pool",this._poolWrapper.bind(this)),t),t=>(this._isDisabled=!0,t))]}_acquirePatcher(t){let n=this;return function(...o){let i=rR.context.active(),a=n.tracer.startSpan("generic-pool.acquire",{},i);return rR.context.with(rR.trace.setSpan(i,a),()=>t.call(this,...o).then(c=>(a.end(),c),c=>{throw a.recordException(c),a.end(),c}))}}_poolWrapper(t){let n=this;return function(){let o=t.apply(this,arguments);return n._wrap(o,"acquire",n._acquireWithCallbacksPatcher.bind(n)),o}}_acquireWithCallbacksPatcher(t){let n=this;return function(o,i){if(n._isDisabled)return t.call(this,o,i);let a=rR.context.active(),c=n.tracer.startSpan("generic-pool.acquire",{},a);return rR.context.with(rR.trace.setSpan(a,c),()=>{t.call(this,(d,g)=>{if(c.end(),o)return o(d,g)},i)})}}};l3.GenericPoolInstrumentation=jJ});var vke=F(d3=>{"use strict";m();Object.defineProperty(d3,"__esModule",{value:!0});d3.GenericPoolInstrumentation=void 0;var mCt=bke();Object.defineProperty(d3,"GenericPoolInstrumentation",{enumerable:!0,get:function(){return mCt.GenericPoolInstrumentation}})});var Rke,xke,Dke,gCt,Bke,Nke=O(()=>{m();Rke=ie(vke(),1);dt();mr();xke="GenericPool",Dke=st(xke,()=>new Rke.GenericPoolInstrumentation({})),gCt=()=>{let e;return{name:xke,setupOnce(){let t=Dke();e=oN(t)},setup(t){e?.(()=>t.on("spanStart",n=>{let o=Ot(n).description;(o==="generic-pool.aquire"||o==="generic-pool.acquire")&&n.setAttribute(kt,"auto.db.otel.generic_pool")}))}}},Bke=gCt});var HJ=F(QA=>{"use strict";m();Object.defineProperty(QA,"__esModule",{value:!0});QA.ATTR_NET_PEER_PORT=QA.ATTR_NET_PEER_NAME=QA.ATTR_MESSAGING_SYSTEM=QA.ATTR_MESSAGING_OPERATION=void 0;QA.ATTR_MESSAGING_OPERATION="messaging.operation";QA.ATTR_MESSAGING_SYSTEM="messaging.system";QA.ATTR_NET_PEER_NAME="net.peer.name";QA.ATTR_NET_PEER_PORT="net.peer.port"});var zJ=F(fi=>{"use strict";m();Object.defineProperty(fi,"__esModule",{value:!0});fi.ATTR_MESSAGING_CONVERSATION_ID=fi.OLD_ATTR_MESSAGING_MESSAGE_ID=fi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC=fi.ATTR_MESSAGING_URL=fi.ATTR_MESSAGING_PROTOCOL_VERSION=fi.ATTR_MESSAGING_PROTOCOL=fi.MESSAGING_OPERATION_VALUE_PROCESS=fi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY=fi.ATTR_MESSAGING_DESTINATION_KIND=fi.ATTR_MESSAGING_DESTINATION=void 0;fi.ATTR_MESSAGING_DESTINATION="messaging.destination";fi.ATTR_MESSAGING_DESTINATION_KIND="messaging.destination_kind";fi.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY="messaging.rabbitmq.routing_key";fi.MESSAGING_OPERATION_VALUE_PROCESS="process";fi.ATTR_MESSAGING_PROTOCOL="messaging.protocol";fi.ATTR_MESSAGING_PROTOCOL_VERSION="messaging.protocol_version";fi.ATTR_MESSAGING_URL="messaging.url";fi.MESSAGING_DESTINATION_KIND_VALUE_TOPIC="topic";fi.OLD_ATTR_MESSAGING_MESSAGE_ID="messaging.message_id";fi.ATTR_MESSAGING_CONVERSATION_ID="messaging.conversation_id"});var $J=F(Cy=>{"use strict";m();Object.defineProperty(Cy,"__esModule",{value:!0});Cy.DEFAULT_CONFIG=Cy.EndOperation=void 0;var hCt;(function(e){e.AutoAck="auto ack",e.Ack="ack",e.AckAll="ackAll",e.Reject="reject",e.Nack="nack",e.NackAll="nackAll",e.ChannelClosed="channel closed",e.ChannelError="channel error",e.InstrumentationTimeout="instrumentation timeout"})(hCt=Cy.EndOperation||(Cy.EndOperation={}));Cy.DEFAULT_CONFIG={consumeTimeoutMs:1e3*60,useLinksForConsume:!1}});var Mke=F(Ai=>{"use strict";m();Object.defineProperty(Ai,"__esModule",{value:!0});Ai.isConfirmChannelTracing=Ai.unmarkConfirmChannelTracing=Ai.markConfirmChannelTracing=Ai.getConnectionAttributesFromUrl=Ai.getConnectionAttributesFromServer=Ai.normalizeExchange=Ai.CONNECTION_ATTRIBUTES=Ai.CHANNEL_CONSUME_TIMEOUT_TIMER=Ai.CHANNEL_SPANS_NOT_ENDED=Ai.MESSAGE_STORED_SPAN=void 0;var VJ=(je(),Me(We)),sE=rn(),p3=(Zn(),Me(Ur)),TO=HJ(),f3=zJ();Ai.MESSAGE_STORED_SPAN=Symbol("opentelemetry.amqplib.message.stored-span");Ai.CHANNEL_SPANS_NOT_ENDED=Symbol("opentelemetry.amqplib.channel.spans-not-ended");Ai.CHANNEL_CONSUME_TIMEOUT_TIMER=Symbol("opentelemetry.amqplib.channel.consumer-timeout-timer");Ai.CONNECTION_ATTRIBUTES=Symbol("opentelemetry.amqplib.connection.attributes");var qJ=(0,VJ.createContextKey)("opentelemetry.amqplib.channel.is-confirm-channel"),_Ct=e=>e!==""?e:"<default>";Ai.normalizeExchange=_Ct;var ECt=e=>e.replace(/:[^:@/]*@/,":***@"),Oke=(e,t)=>e||(t==="AMQP"?5672:5671),wke=e=>{let t=e||"amqp";return(t.endsWith(":")?t.substring(0,t.length-1):t).toUpperCase()},kke=e=>e||"localhost",FA=(e,t,n,r)=>n?{[t]:n}:(VJ.diag.error(`amqplib instrumentation: could not extract connection attribute ${r} from user supplied url`,{url:e}),{}),SCt=e=>{let t=e.serverProperties.product?.toLowerCase?.();return t?{[TO.ATTR_MESSAGING_SYSTEM]:t}:{}};Ai.getConnectionAttributesFromServer=SCt;var yCt=(e,t)=>{let n={[f3.ATTR_MESSAGING_PROTOCOL_VERSION]:"0.9.1"};if(e=e||"amqp://localhost",typeof e=="object"){let r=e,o=wke(r?.protocol);Object.assign(n,{...FA(e,f3.ATTR_MESSAGING_PROTOCOL,o,"protocol")});let i=kke(r?.hostname);t&sE.SemconvStability.OLD&&Object.assign(n,{...FA(e,TO.ATTR_NET_PEER_NAME,i,"hostname")}),t&sE.SemconvStability.STABLE&&Object.assign(n,{...FA(e,p3.ATTR_SERVER_ADDRESS,i,"hostname")});let a=Oke(r.port,o);t&sE.SemconvStability.OLD&&Object.assign(n,FA(e,TO.ATTR_NET_PEER_PORT,a,"port")),t&sE.SemconvStability.STABLE&&Object.assign(n,FA(e,p3.ATTR_SERVER_PORT,a,"port"))}else{let r=ECt(e);n[f3.ATTR_MESSAGING_URL]=r;try{let o=new URL(r),i=wke(o.protocol);Object.assign(n,{...FA(r,f3.ATTR_MESSAGING_PROTOCOL,i,"protocol")});let a=kke(o.hostname);t&sE.SemconvStability.OLD&&Object.assign(n,{...FA(r,TO.ATTR_NET_PEER_NAME,a,"hostname")}),t&sE.SemconvStability.STABLE&&Object.assign(n,{...FA(r,p3.ATTR_SERVER_ADDRESS,a,"hostname")});let c=Oke(o.port?parseInt(o.port):void 0,i);t&sE.SemconvStability.OLD&&Object.assign(n,FA(r,TO.ATTR_NET_PEER_PORT,c,"port")),t&sE.SemconvStability.STABLE&&Object.assign(n,FA(r,p3.ATTR_SERVER_PORT,c,"port"))}catch(o){VJ.diag.error("amqplib instrumentation: error while extracting connection details from connection url",{censoredUrl:r,err:o})}}return n};Ai.getConnectionAttributesFromUrl=yCt;var TCt=e=>e.setValue(qJ,!0);Ai.markConfirmChannelTracing=TCt;var ICt=e=>e.deleteValue(qJ);Ai.unmarkConfirmChannelTracing=ICt;var CCt=e=>e.getValue(qJ)===!0;Ai.isConfirmChannelTracing=CCt});var Pke=F(oR=>{"use strict";m();Object.defineProperty(oR,"__esModule",{value:!0});oR.PACKAGE_NAME=oR.PACKAGE_VERSION=void 0;oR.PACKAGE_VERSION="0.61.0";oR.PACKAGE_NAME="@opentelemetry/instrumentation-amqplib"});var Lke=F(g3=>{"use strict";m();Object.defineProperty(g3,"__esModule",{value:!0});g3.AmqplibInstrumentation=void 0;var Jo=(je(),Me(We)),A3=Tr(),Cr=rn(),bCt=HJ(),Fl=zJ(),Vu=$J(),mi=Mke(),Uke=Pke(),m3=[">=0.5.5 <1"],YJ=class extends Cr.InstrumentationBase{_netSemconvStability;constructor(t={}){super(Uke.PACKAGE_NAME,Uke.PACKAGE_VERSION,{...Vu.DEFAULT_CONFIG,...t}),this._setSemconvStabilityFromEnv()}_setSemconvStabilityFromEnv(){this._netSemconvStability=(0,Cr.semconvStabilityFromStr)("http",process.env.OTEL_SEMCONV_STABILITY_OPT_IN)}setConfig(t={}){super.setConfig({...Vu.DEFAULT_CONFIG,...t})}init(){let t=new Cr.InstrumentationNodeModuleFile("amqplib/lib/channel_model.js",m3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),n=new Cr.InstrumentationNodeModuleFile("amqplib/lib/callback_model.js",m3,this.patchChannelModel.bind(this),this.unpatchChannelModel.bind(this)),r=new Cr.InstrumentationNodeModuleFile("amqplib/lib/connect.js",m3,this.patchConnect.bind(this),this.unpatchConnect.bind(this));return new Cr.InstrumentationNodeModuleDefinition("amqplib",m3,void 0,void 0,[t,r,n])}patchConnect(t){return t=this.unpatchConnect(t),(0,Cr.isWrapped)(t.connect)||this._wrap(t,"connect",this.getConnectPatch.bind(this)),t}unpatchConnect(t){return(0,Cr.isWrapped)(t.connect)&&this._unwrap(t,"connect"),t}patchChannelModel(t,n){return(0,Cr.isWrapped)(t.Channel.prototype.publish)||this._wrap(t.Channel.prototype,"publish",this.getPublishPatch.bind(this,n)),(0,Cr.isWrapped)(t.Channel.prototype.consume)||this._wrap(t.Channel.prototype,"consume",this.getConsumePatch.bind(this,n)),(0,Cr.isWrapped)(t.Channel.prototype.ack)||this._wrap(t.Channel.prototype,"ack",this.getAckPatch.bind(this,!1,Vu.EndOperation.Ack)),(0,Cr.isWrapped)(t.Channel.prototype.nack)||this._wrap(t.Channel.prototype,"nack",this.getAckPatch.bind(this,!0,Vu.EndOperation.Nack)),(0,Cr.isWrapped)(t.Channel.prototype.reject)||this._wrap(t.Channel.prototype,"reject",this.getAckPatch.bind(this,!0,Vu.EndOperation.Reject)),(0,Cr.isWrapped)(t.Channel.prototype.ackAll)||this._wrap(t.Channel.prototype,"ackAll",this.getAckAllPatch.bind(this,!1,Vu.EndOperation.AckAll)),(0,Cr.isWrapped)(t.Channel.prototype.nackAll)||this._wrap(t.Channel.prototype,"nackAll",this.getAckAllPatch.bind(this,!0,Vu.EndOperation.NackAll)),(0,Cr.isWrapped)(t.Channel.prototype.emit)||this._wrap(t.Channel.prototype,"emit",this.getChannelEmitPatch.bind(this)),(0,Cr.isWrapped)(t.ConfirmChannel.prototype.publish)||this._wrap(t.ConfirmChannel.prototype,"publish",this.getConfirmedPublishPatch.bind(this,n)),t}unpatchChannelModel(t){return(0,Cr.isWrapped)(t.Channel.prototype.publish)&&this._unwrap(t.Channel.prototype,"publish"),(0,Cr.isWrapped)(t.Channel.prototype.consume)&&this._unwrap(t.Channel.prototype,"consume"),(0,Cr.isWrapped)(t.Channel.prototype.ack)&&this._unwrap(t.Channel.prototype,"ack"),(0,Cr.isWrapped)(t.Channel.prototype.nack)&&this._unwrap(t.Channel.prototype,"nack"),(0,Cr.isWrapped)(t.Channel.prototype.reject)&&this._unwrap(t.Channel.prototype,"reject"),(0,Cr.isWrapped)(t.Channel.prototype.ackAll)&&this._unwrap(t.Channel.prototype,"ackAll"),(0,Cr.isWrapped)(t.Channel.prototype.nackAll)&&this._unwrap(t.Channel.prototype,"nackAll"),(0,Cr.isWrapped)(t.Channel.prototype.emit)&&this._unwrap(t.Channel.prototype,"emit"),(0,Cr.isWrapped)(t.ConfirmChannel.prototype.publish)&&this._unwrap(t.ConfirmChannel.prototype,"publish"),t}getConnectPatch(t){let n=this;return function(o,i,a){return t.call(this,o,i,function(c,d){if(c==null){let g=(0,mi.getConnectionAttributesFromUrl)(o,n._netSemconvStability),h=(0,mi.getConnectionAttributesFromServer)(d);d[mi.CONNECTION_ATTRIBUTES]={...g,...h}}a.apply(this,arguments)})}}getChannelEmitPatch(t){let n=this;return function(o){if(o==="close"){n.endAllSpansOnChannel(this,!0,Vu.EndOperation.ChannelClosed,void 0);let i=this[mi.CHANNEL_CONSUME_TIMEOUT_TIMER];i&&clearInterval(i),this[mi.CHANNEL_CONSUME_TIMEOUT_TIMER]=void 0}else o==="error"&&n.endAllSpansOnChannel(this,!0,Vu.EndOperation.ChannelError,void 0);return t.apply(this,arguments)}}getAckAllPatch(t,n,r){let o=this;return function(a){return o.endAllSpansOnChannel(this,t,n,a),r.apply(this,arguments)}}getAckPatch(t,n,r){let o=this;return function(a,c,d){let g=this,h=n===Vu.EndOperation.Reject?c:d,S=g[mi.CHANNEL_SPANS_NOT_ENDED]??[],y=S.findIndex(C=>C.msg===a);if(y<0)o.endConsumerSpan(a,t,n,h);else if(n!==Vu.EndOperation.Reject&&c){for(let C=0;C<=y;C++)o.endConsumerSpan(S[C].msg,t,n,h);S.splice(0,y+1)}else o.endConsumerSpan(a,t,n,h),S.splice(y,1);return r.apply(this,arguments)}}getConsumePatch(t,n){let r=this;return function(i,a,c){let d=this;if(!Object.prototype.hasOwnProperty.call(d,mi.CHANNEL_SPANS_NOT_ENDED)){let{consumeTimeoutMs:h}=r.getConfig();if(h){let S=setInterval(()=>{r.checkConsumeTimeoutOnChannel(d)},h);S.unref(),d[mi.CHANNEL_CONSUME_TIMEOUT_TIMER]=S}d[mi.CHANNEL_SPANS_NOT_ENDED]=[]}let g=function(h){if(!h)return a.call(this,h);let S=h.properties.headers??{},y=Jo.propagation.extract(Jo.ROOT_CONTEXT,S),C=h.fields?.exchange,v;if(r._config.useLinksForConsume){let Q=y?Jo.trace.getSpan(y)?.spanContext():void 0;y=void 0,Q&&(v=[{context:Q}])}let x=r.tracer.startSpan(`${i} process`,{kind:Jo.SpanKind.CONSUMER,attributes:{...d?.connection?.[mi.CONNECTION_ATTRIBUTES],[Fl.ATTR_MESSAGING_DESTINATION]:C,[Fl.ATTR_MESSAGING_DESTINATION_KIND]:Fl.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fl.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:h.fields?.routingKey,[bCt.ATTR_MESSAGING_OPERATION]:Fl.MESSAGING_OPERATION_VALUE_PROCESS,[Fl.OLD_ATTR_MESSAGING_MESSAGE_ID]:h?.properties.messageId,[Fl.ATTR_MESSAGING_CONVERSATION_ID]:h?.properties.correlationId},links:v},y),{consumeHook:N}=r.getConfig();N&&(0,Cr.safeExecuteInTheMiddle)(()=>N(x,{moduleVersion:t,msg:h}),Q=>{Q&&Jo.diag.error("amqplib instrumentation: consumerHook error",Q)},!0),c?.noAck||(d[mi.CHANNEL_SPANS_NOT_ENDED].push({msg:h,timeOfConsume:(0,A3.hrTime)()}),h[mi.MESSAGE_STORED_SPAN]=x);let k=y||Jo.ROOT_CONTEXT;Jo.context.with(Jo.trace.setSpan(k,x),()=>{a.call(this,h)}),c?.noAck&&(r.callConsumeEndHook(x,h,!1,Vu.EndOperation.AutoAck),x.end())};return arguments[1]=g,n.apply(this,arguments)}}getConfirmedPublishPatch(t,n){let r=this;return function(i,a,c,d,g){let h=this,{span:S,modifiedOptions:y}=r.createPublishSpan(r,i,a,h,d),{publishHook:C}=r.getConfig();C&&(0,Cr.safeExecuteInTheMiddle)(()=>C(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:y,isConfirmChannel:!0}),k=>{k&&Jo.diag.error("amqplib instrumentation: publishHook error",k)},!0);let v=function(k,Q){try{g?.call(this,k,Q)}finally{let{publishConfirmHook:j}=r.getConfig();j&&(0,Cr.safeExecuteInTheMiddle)(()=>j(S,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:d,isConfirmChannel:!0,confirmError:k}),G=>{G&&Jo.diag.error("amqplib instrumentation: publishConfirmHook error",G)},!0),k&&S.setStatus({code:Jo.SpanStatusCode.ERROR,message:"message confirmation has been nack'ed"}),S.end()}},x=(0,mi.markConfirmChannelTracing)(Jo.context.active()),N=[...arguments];return N[3]=y,N[4]=Jo.context.bind((0,mi.unmarkConfirmChannelTracing)(Jo.trace.setSpan(x,S)),v),Jo.context.with(x,n.bind(this,...N))}}getPublishPatch(t,n){let r=this;return function(i,a,c,d){if((0,mi.isConfirmChannelTracing)(Jo.context.active()))return n.apply(this,arguments);{let g=this,{span:h,modifiedOptions:S}=r.createPublishSpan(r,i,a,g,d),{publishHook:y}=r.getConfig();y&&(0,Cr.safeExecuteInTheMiddle)(()=>y(h,{moduleVersion:t,exchange:i,routingKey:a,content:c,options:S,isConfirmChannel:!1}),x=>{x&&Jo.diag.error("amqplib instrumentation: publishHook error",x)},!0);let C=[...arguments];C[3]=S;let v=n.apply(this,C);return h.end(),v}}}createPublishSpan(t,n,r,o,i){let a=(0,mi.normalizeExchange)(n),c=t.tracer.startSpan(`publish ${a}`,{kind:Jo.SpanKind.PRODUCER,attributes:{...o.connection[mi.CONNECTION_ATTRIBUTES],[Fl.ATTR_MESSAGING_DESTINATION]:n,[Fl.ATTR_MESSAGING_DESTINATION_KIND]:Fl.MESSAGING_DESTINATION_KIND_VALUE_TOPIC,[Fl.ATTR_MESSAGING_RABBITMQ_ROUTING_KEY]:r,[Fl.OLD_ATTR_MESSAGING_MESSAGE_ID]:i?.messageId,[Fl.ATTR_MESSAGING_CONVERSATION_ID]:i?.correlationId}}),d=i??{};return d.headers=d.headers??{},Jo.propagation.inject(Jo.trace.setSpan(Jo.context.active(),c),d.headers),{span:c,modifiedOptions:d}}endConsumerSpan(t,n,r,o){let i=t[mi.MESSAGE_STORED_SPAN];i&&(n!==!1&&i.setStatus({code:Jo.SpanStatusCode.ERROR,message:r!==Vu.EndOperation.ChannelClosed&&r!==Vu.EndOperation.ChannelError?`${r} called on message${o===!0?" with requeue":o===!1?" without requeue":""}`:r}),this.callConsumeEndHook(i,t,n,r),i.end(),t[mi.MESSAGE_STORED_SPAN]=void 0)}endAllSpansOnChannel(t,n,r,o){(t[mi.CHANNEL_SPANS_NOT_ENDED]??[]).forEach(a=>{this.endConsumerSpan(a.msg,n,r,o)}),t[mi.CHANNEL_SPANS_NOT_ENDED]=[]}callConsumeEndHook(t,n,r,o){let{consumeEndHook:i}=this.getConfig();i&&(0,Cr.safeExecuteInTheMiddle)(()=>i(t,{msg:n,rejected:r,endOperation:o}),a=>{a&&Jo.diag.error("amqplib instrumentation: consumerEndHook error",a)},!0)}checkConsumeTimeoutOnChannel(t){let n=(0,A3.hrTime)(),r=t[mi.CHANNEL_SPANS_NOT_ENDED]??[],o,{consumeTimeoutMs:i}=this.getConfig();for(o=0;o<r.length;o++){let a=r[o],c=(0,A3.hrTimeDuration)(a.timeOfConsume,n);if((0,A3.hrTimeToMilliseconds)(c)<i)break;this.endConsumerSpan(a.msg,null,Vu.EndOperation.InstrumentationTimeout,!0)}r.splice(0,o)}};g3.AmqplibInstrumentation=YJ});var Fke=F(uE=>{"use strict";m();Object.defineProperty(uE,"__esModule",{value:!0});uE.EndOperation=uE.DEFAULT_CONFIG=uE.AmqplibInstrumentation=void 0;var vCt=Lke();Object.defineProperty(uE,"AmqplibInstrumentation",{enumerable:!0,get:function(){return vCt.AmqplibInstrumentation}});var Qke=$J();Object.defineProperty(uE,"DEFAULT_CONFIG",{enumerable:!0,get:function(){return Qke.DEFAULT_CONFIG}});Object.defineProperty(uE,"EndOperation",{enumerable:!0,get:function(){return Qke.EndOperation}})});var Gke,jke,RCt,Hke,xCt,zke,$ke=O(()=>{m();Gke=ie(Fke(),1);mr();jke="Amqplib",RCt={consumeEndHook:e=>{Lr(e,"auto.amqplib.otel.consumer")},publishHook:e=>{Lr(e,"auto.amqplib.otel.publisher")}},Hke=st(jke,()=>new Gke.AmqplibInstrumentation(RCt)),xCt=()=>({name:jke,setupOnce(){Hke()}}),zke=xCt});var IO,KJ=O(()=>{m();IO="VercelAI"});function BCt(e){if(typeof e!="object"||e===null)return!1;let t=e;return"type"in t&&"error"in t&&"toolName"in t&&"toolCallId"in t&&t.type==="tool-error"&&t.error instanceof Error}function NCt(e){if(typeof e!="object"||e===null||!("content"in e))return;let t=e;Array.isArray(t.content)&&(OCt(t.content),wCt(t.content))}function OCt(e){for(let t of e){if(!BCt(t))continue;let n=bq(t.toolCallId);n?xl(r=>{r.setContext("trace",{trace_id:n.traceId,span_id:n.spanId}),r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),tn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})}):xl(r=>{r.setTag("vercel.ai.tool.name",t.toolName),r.setTag("vercel.ai.tool.callId",t.toolCallId),r.setLevel("error"),tn(t.error,{mechanism:{type:"auto.vercelai.otel",handled:!1}})})}}function wCt(e){for(let t of e)typeof t=="object"&&t!==null&&"toolCallId"in t&&typeof t.toolCallId=="string"&&vq(t.toolCallId)}function kCt(e,t,n,r){let o=e?.recordInputs!==void 0?e.recordInputs:t.recordInputs!==void 0?t.recordInputs:n===!0?!0:r,i=e?.recordOutputs!==void 0?e.recordOutputs:t.recordOutputs!==void 0?t.recordOutputs:n===!0?!0:r;return{recordInputs:o,recordOutputs:i}}var _3,DCt,Vke,h3,qke=O(()=>{m();_3=ie(rn(),1);dt();KJ();DCt=[">=3.0.0 <7"],Vke=["generateText","streamText","generateObject","streamObject","embed","embedMany","rerank"];h3=class e extends _3.InstrumentationBase{__init(){this._isPatched=!1}__init2(){this._callbacks=[]}constructor(t={}){super("@sentry/instrumentation-vercel-ai",Wn,t),e.prototype.__init.call(this),e.prototype.__init2.call(this)}init(){return new _3.InstrumentationNodeModuleDefinition("ai",DCt,this._patch.bind(this))}callWhenPatched(t){this._isPatched?t():this._callbacks.push(t)}_patch(t){this._isPatched=!0,this._callbacks.forEach(r=>r()),this._callbacks=[];let n=r=>new Proxy(r,{apply:(o,i,a)=>{let c=a[0].experimental_telemetry||{},d=c.isEnabled,g=gt(),h=g?.getIntegrationByName(IO),S=h?.options,y=h?!!g?.getOptions().sendDefaultPii:!1,{recordInputs:C,recordOutputs:v}=kCt(S,c,d,y);return a[0].experimental_telemetry={...c,isEnabled:d!==void 0?d:!0,recordInputs:C,recordOutputs:v},rf(()=>Reflect.apply(o,i,a),x=>{x&&typeof x=="object"&&Ki(x,"_sentry_active_span",Nc())},()=>{},x=>{NCt(x)})}});if(Object.prototype.toString.call(t)==="[object Module]"){for(let r of Vke)t[r]!=null&&(t[r]=n(t[r]));return t}else{let r=Vke.reduce((o,i)=>(t[i]!=null&&(o[i]=n(t[i])),o),{});return{...t,...r}}}}});function MCt(e){return!!e.getIntegrationByName("Modules")?.getModules?.()?.ai}var Yke,PCt,Kke,Jke=O(()=>{m();dt();mr();KJ();qke();Yke=st(IO,()=>new h3({}));PCt=(e={})=>{let t;return{name:IO,options:e,setupOnce(){t=Yke()},afterAllSetup(n){e.force??MCt(n)?IL(n):t?.callWhenPatched(()=>IL(n))}}},Kke=PCt});var S3,UCt,E3,Zke=O(()=>{m();S3=ie(rn(),1);dt();UCt=[">=4.0.0 <7"],E3=class extends S3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-openai",Wn,t)}init(){return new S3.InstrumentationNodeModuleDefinition("openai",UCt,this._patch.bind(this))}_patch(t){let n=t;return n=this._patchClient(n,"OpenAI"),n=this._patchClient(n,"AzureOpenAI"),n}_patchClient(t,n){let r=t[n];if(!r)return t;let o=this.getConfig(),i=function(...a){if(qS(O_))return Reflect.construct(r,a);let c=Reflect.construct(r,a);return vL(c,o)};Object.setPrototypeOf(i,r),Object.setPrototypeOf(i.prototype,r.prototype);for(let a of Object.getOwnPropertyNames(r))if(!["length","name","prototype"].includes(a)){let c=Object.getOwnPropertyDescriptor(r,a);c&&Object.defineProperty(i,a,c)}try{t[n]=i}catch{Object.defineProperty(t,n,{value:i,writable:!0,configurable:!0,enumerable:!0})}if(t.default===r)try{t.default=i}catch{Object.defineProperty(t,"default",{value:i,writable:!0,configurable:!0,enumerable:!0})}return t}}});var Wke,LCt,Xke,eMe=O(()=>{m();dt();mr();Zke();Wke=st(O_,e=>new E3(e)),LCt=(e={})=>({name:O_,setupOnce(){Wke(e)}}),Xke=LCt});var T3,QCt,y3,tMe=O(()=>{m();T3=ie(rn(),1);dt();QCt=[">=0.19.2 <1.0.0"],y3=class extends T3.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-anthropic-ai",Wn,t)}init(){return new T3.InstrumentationNodeModuleDefinition("@anthropic-ai/sdk",QCt,this._patch.bind(this))}_patch(t){let n=t.Anthropic,r=this.getConfig(),o=function(...i){if(qS(w_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return RL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}try{t.Anthropic=o}catch{Object.defineProperty(t,"Anthropic",{value:o,writable:!0,configurable:!0,enumerable:!0})}if(t.default===n)try{t.default=o}catch{Object.defineProperty(t,"default",{value:o,writable:!0,configurable:!0,enumerable:!0})}return t}}});var nMe,FCt,rMe,oMe=O(()=>{m();dt();mr();tMe();nMe=st(w_,e=>new y3(e)),FCt=(e={})=>({name:w_,options:e,setupOnce(){nMe(e)}}),rMe=FCt});var iR,iMe,I3,aMe=O(()=>{m();iR=ie(rn(),1);dt();iMe=[">=0.10.0 <2"],I3=class extends iR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-google-genai",Wn,t)}init(){return new iR.InstrumentationNodeModuleDefinition("@google/genai",iMe,n=>this._patch(n),n=>n,[new iR.InstrumentationNodeModuleFile("@google/genai/dist/node/index.cjs",iMe,n=>this._patch(n),n=>n)])}_patch(t){let n=t.GoogleGenAI,r=this.getConfig();if(typeof n!="function")return t;let o=function(...i){if(qS(k_))return Reflect.construct(n,i);let a=Reflect.construct(n,i);return xL(a,r)};Object.setPrototypeOf(o,n),Object.setPrototypeOf(o.prototype,n.prototype);for(let i of Object.getOwnPropertyNames(n))if(!["length","name","prototype"].includes(i)){let a=Object.getOwnPropertyDescriptor(n,i);a&&Object.defineProperty(o,i,a)}return nN(t,"GoogleGenAI",o),t}}});var sMe,GCt,uMe,cMe=O(()=>{m();dt();mr();aMe();sMe=st(k_,e=>new I3(e)),GCt=(e={})=>({name:k_,setupOnce(){sMe(e)}}),uMe=GCt});function jCt(e,t){return e?Array.isArray(e)?e.includes(t)?e:[...e,t]:typeof e=="object"?[e,t]:e:[t]}function HCt(e,t,n){return new Proxy(e,{apply(r,o,i){let c=i[1];(!c||typeof c!="object"||Array.isArray(c))&&(c={},i[1]=c);let d=c.callbacks,g=jCt(d,t);return c.callbacks=g,Reflect.apply(r,o,i)}})}var cE,C3,b3,lMe=O(()=>{m();cE=ie(rn(),1);dt();C3=[">=0.1.0 <2.0.0"];b3=class extends cE.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langchain",Wn,t)}init(){let t=[],n=["@langchain/anthropic","@langchain/openai","@langchain/google-genai","@langchain/mistralai","@langchain/google-vertexai","@langchain/groq"];for(let r of n)t.push(new cE.InstrumentationNodeModuleDefinition(r,C3,this._patch.bind(this),o=>o,[new cE.InstrumentationNodeModuleFile(`${r}/dist/index.cjs`,C3,this._patch.bind(this),o=>o)]));return t.push(new cE.InstrumentationNodeModuleDefinition("langchain",C3,this._patch.bind(this),r=>r,[new cE.InstrumentationNodeModuleFile("langchain/dist/chat_models/universal.cjs",C3,this._patch.bind(this),r=>r)])),t}_patch(t){jV([O_,w_,k_]);let n=OL(this.getConfig());return this._patchRunnableMethods(t,n),t}_patchRunnableMethods(t,n){let r=["ChatAnthropic","ChatOpenAI","ChatGoogleGenerativeAI","ChatMistralAI","ChatVertexAI","ChatGroq","ConfigurableModel"],o=t.universal_exports??t,i=Object.values(o).find(d=>typeof d=="function"&&r.includes(d.name));if(!i)return;let a=i.prototype;if(a.__sentry_patched__)return;a.__sentry_patched__=!0;let c=["invoke","stream","batch"];for(let d of c){let g=a[d];typeof g=="function"&&(a[d]=HCt(g,n))}}}});var dMe,zCt,pMe,fMe=O(()=>{m();dt();mr();lMe();dMe=st(DL,e=>new b3(e)),zCt=(e={})=>({name:DL,setupOnce(){dMe(e)}}),pMe=zCt});var aR,AMe,v3,mMe=O(()=>{m();aR=ie(rn(),1);dt();AMe=[">=0.0.0 <2.0.0"],v3=class extends aR.InstrumentationBase{constructor(t={}){super("@sentry/instrumentation-langgraph",Wn,t)}init(){return new aR.InstrumentationNodeModuleDefinition("@langchain/langgraph",AMe,this._patch.bind(this),n=>n,[new aR.InstrumentationNodeModuleFile("@langchain/langgraph/dist/index.cjs",AMe,this._patch.bind(this),n=>n)])}_patch(t){return t.StateGraph&&typeof t.StateGraph=="function"&&kL(t.StateGraph.prototype,this.getConfig()),t}}});var gMe,$Ct,hMe,_Me=O(()=>{m();dt();mr();mMe();gMe=st(wL,e=>new v3(e)),$Ct=(e={})=>({name:wL,setupOnce(){gMe(e)}}),hMe=$Ct});import*as SMe from"node:net";function yMe(e,t,n,r,o){let a=()=>{},c=o.firestoreSpanCreationHook;typeof c=="function"&&(a=h=>{(0,Bg.safeExecuteInTheMiddle)(()=>c(h),S=>{S&&vl.error(S?.message)},!0)});let d=new Bg.InstrumentationNodeModuleDefinition("@firebase/firestore",t,h=>EMe(h,n,r,e,a)),g=["@firebase/firestore/dist/lite/index.node.cjs.js","@firebase/firestore/dist/lite/index.node.mjs.js","@firebase/firestore/dist/lite/index.rn.esm2017.js","@firebase/firestore/dist/lite/index.cjs.js"];for(let h of g)d.files.push(new Bg.InstrumentationNodeModuleFile(h,t,S=>EMe(S,n,r,e,a),S=>TMe(S,r)));return d}function EMe(e,t,n,r,o){return TMe(e,n),t(e,"addDoc",VCt(r,o)),t(e,"getDocs",YCt(r,o)),t(e,"setDoc",KCt(r,o)),t(e,"deleteDoc",qCt(r,o)),e}function TMe(e,t){for(let n of["addDoc","getDocs","setDoc","deleteDoc"])(0,Bg.isWrapped)(e[n])&&t(e,n);return e}function VCt(e,t){return function(r){return function(o,i){let a=x3(e,"addDoc",o);return t(a),R3(a,()=>r(o,i))}}}function qCt(e,t){return function(r){return function(o){let i=x3(e,"deleteDoc",o.parent||o);return t(i),R3(i,()=>r(o))}}}function YCt(e,t){return function(r){return function(o){let i=x3(e,"getDocs",o);return t(i),R3(i,()=>r(o))}}}function KCt(e,t){return function(r){return function(o,i,a){let c=x3(e,"setDoc",o.parent||o);return t(c),R3(c,()=>typeof a<"u"?r(o,i,a):r(o,i))}}}function R3(e,t){return Ke.with(Ht.setSpan(Ke.active(),e),()=>(0,Bg.safeExecuteInTheMiddle)(()=>t(),n=>{n&&e.recordException(n),e.end()},!0))}function x3(e,t,n){let r=e.startSpan(`${t} ${n.path}`,{kind:oo.CLIENT});return ZCt(r,n),r.setAttribute(VC,t),r}function JCt(e){let t,n;if(typeof e.host=="string")if(e.host.startsWith("[")){if(e.host.endsWith("]"))t=e.host.replace(/^\[|\]$/g,"");else if(e.host.includes("]:")){let r=e.host.lastIndexOf(":");r!==-1&&(t=e.host.slice(1,r).replace(/^\[|\]$/g,""),n=e.host.slice(r+1))}}else if(SMe.isIPv6(e.host))t=e.host;else{let r=e.host.lastIndexOf(":");r!==-1?(t=e.host.slice(0,r),n=e.host.slice(r+1)):t=e.host}return{address:t,port:n?parseInt(n,10):void 0}}function ZCt(e,t){let n=t.firestore.app,r=n.options,i=(t.firestore.toJSON()||{}).settings||{},a={[p5]:t.path,[f5]:n.name,[DS]:"firebase.firestore","firebase.firestore.type":t.type,"firebase.firestore.options.projectId":r.projectId,"firebase.firestore.options.appId":r.appId,"firebase.firestore.options.messagingSenderId":r.messagingSenderId,"firebase.firestore.options.storageBucket":r.storageBucket},{address:c,port:d}=JCt(i);c&&(a[y5]=c),d&&(a[T5]=d),e.setAttributes(a)}var Bg,IMe=O(()=>{m();je();Bg=ie(rn(),1);Zn()});function CMe(e,t,n,r,o){let i=()=>{},a=()=>{},c=o.functions?.errorHook,d=o.functions?.requestHook,g=o.functions?.responseHook;typeof g=="function"&&(a=(y,C)=>{(0,Ng.safeExecuteInTheMiddle)(()=>g(y,C),v=>{v&&vl.error(v?.message)},!0)}),typeof d=="function"&&(i=y=>{(0,Ng.safeExecuteInTheMiddle)(()=>d(y),C=>{C&&vl.error(C?.message)},!0)});let h=new Ng.InstrumentationNodeModuleDefinition("firebase-functions",t);return[{name:"firebase-functions/lib/v2/providers/https.js",triggerType:"function"},{name:"firebase-functions/lib/v2/providers/firestore.js",triggerType:"firestore"},{name:"firebase-functions/lib/v2/providers/scheduler.js",triggerType:"scheduler"},{name:"firebase-functions/lib/v2/storage.js",triggerType:"storage"}].forEach(({name:y,triggerType:C})=>{h.files.push(new Ng.InstrumentationNodeModuleFile(y,t,v=>WCt(v,n,r,e,{requestHook:i,responseHook:a,errorHook:c},C),v=>bMe(v,r)))}),h}function qu(e,t,n){return function(o){return function(...i){let a=typeof i[0]=="function"?i[0]:i[1],c=typeof i[0]=="function"?void 0:i[0];if(!a)return o.call(this,...i);let d=async function(...g){let h=process.env.FUNCTION_TARGET||process.env.K_SERVICE||"unknown",S=e.startSpan(`firebase.function.${n}`,{kind:oo.SERVER}),y={"faas.name":h,"faas.trigger":n,"faas.provider":"firebase"};return process.env.GCLOUD_PROJECT&&(y["cloud.project_id"]=process.env.GCLOUD_PROJECT),process.env.EVENTARC_CLOUD_EVENT_SOURCE&&(y["cloud.event_source"]=process.env.EVENTARC_CLOUD_EVENT_SOURCE),S.setAttributes(y),t?.requestHook?.(S),Ke.with(Ht.setSpan(Ke.active(),S),async()=>{let C,v;try{v=await a.apply(this,g)}catch(x){C=x}if(t?.responseHook?.(S,C),C&&S.recordException(C),S.end(),C)throw await t?.errorHook?.(S,C),C;return v})};return c?o.call(this,c,d):o.call(this,d)}}}function WCt(e,t,n,r,o,i){switch(bMe(e,n),i){case"function":t(e,"onRequest",qu(r,o,"http.request")),t(e,"onCall",qu(r,o,"http.call"));break;case"firestore":t(e,"onDocumentCreated",qu(r,o,"firestore.document.created")),t(e,"onDocumentUpdated",qu(r,o,"firestore.document.updated")),t(e,"onDocumentDeleted",qu(r,o,"firestore.document.deleted")),t(e,"onDocumentWritten",qu(r,o,"firestore.document.written")),t(e,"onDocumentCreatedWithAuthContext",qu(r,o,"firestore.document.created")),t(e,"onDocumentUpdatedWithAuthContext",qu(r,o,"firestore.document.updated")),t(e,"onDocumentDeletedWithAuthContext",qu(r,o,"firestore.document.deleted")),t(e,"onDocumentWrittenWithAuthContext",qu(r,o,"firestore.document.written"));break;case"scheduler":t(e,"onSchedule",qu(r,o,"scheduler.scheduled"));break;case"storage":t(e,"onObjectFinalized",qu(r,o,"storage.object.finalized")),t(e,"onObjectArchived",qu(r,o,"storage.object.archived")),t(e,"onObjectDeleted",qu(r,o,"storage.object.deleted")),t(e,"onObjectMetadataUpdated",qu(r,o,"storage.object.metadataUpdated"));break}return e}function bMe(e,t){let n=["onSchedule","onRequest","onCall","onObjectFinalized","onObjectArchived","onObjectDeleted","onObjectMetadataUpdated","onDocumentCreated","onDocumentUpdated","onDocumentDeleted","onDocumentWritten","onDocumentCreatedWithAuthContext","onDocumentUpdatedWithAuthContext","onDocumentDeletedWithAuthContext","onDocumentWrittenWithAuthContext"];for(let r of n)(0,Ng.isWrapped)(e[r])&&t(e,r);return e}var Ng,vMe=O(()=>{m();je();Ng=ie(rn(),1)});var xMe,RMe,XCt,ebt,D3,DMe=O(()=>{m();xMe=ie(rn(),1);dt();IMe();vMe();RMe={},XCt=[">=3.0.0 <5"],ebt=[">=6.0.0 <7"],D3=class extends xMe.InstrumentationBase{constructor(t=RMe){super("@sentry/instrumentation-firebase",Wn,t)}setConfig(t={}){super.setConfig({...RMe,...t})}init(){let t=[];return t.push(yMe(this.tracer,XCt,this._wrap,this._unwrap,this.getConfig())),t.push(CMe(this.tracer,ebt,this._wrap,this._unwrap,this.getConfig())),t}}});var BMe,tbt,NMe,nbt,OMe,wMe=O(()=>{m();dt();mr();DMe();BMe="Firebase",tbt={firestoreSpanCreationHook:e=>{Lr(e,"auto.firebase.otel.firestore"),e.setAttribute(Zt,"db.query")},functions:{requestHook:e=>{Lr(e,"auto.firebase.otel.functions"),e.setAttribute(Zt,"http.request")},errorHook:async(e,t)=>{t&&(tn(t,{mechanism:{type:"auto.firebase.otel.functions",handled:!1}}),await Bb(2e3))}}},NMe=st(BMe,()=>new D3(tbt)),nbt=()=>({name:BMe,setupOnce(){NMe()}}),OMe=nbt});function kMe(){return[Uxe(),h1e(),z1e(),Owe(),NBe(),VBe(),oNe(),gNe(),YNe(),mOe(),fwe(),Rwe(),Ywe(),ske(),yke(),Bke(),sBe(),zke(),_Be(),pMe(),hMe(),Kke(),Xke(),rMe(),uMe(),EOe(),OMe()]}var MMe=O(()=>{m();$ke();oMe();uke();Lxe();S1e();wMe();Nke();cMe();V1e();xwe();wwe();uBe();Kwe();fMe();_Me();EBe();OBe();qBe();iNe();hNe();eMe();gOe();SOe();Awe();KNe();Tke();Jke()});function UMe(e,t={}){e.getOptions().debug&&rY();let[n,r]=rbt(e,t);e.traceProvider=n,e.asyncLocalStorageLookup=r}function rbt(e,t={}){let n=new PMe.BasicTracerProvider({sampler:new FQ(e),resource:(0,B3.defaultResource)().merge((0,B3.resourceFromAttributes)({[I5]:"node",[d5]:"sentry",[C5]:Wn})),forceFlushTimeoutMillis:500,spanProcessors:[new QQ({timeout:obt(e.getOptions().maxSpanWaitDuration)}),...t.spanProcessors||[]]});Ht.setGlobalTracerProvider(n),qp.setGlobalPropagator(new LQ);let r=new jQ;return Ke.setGlobalContextManager(r),[n,r.getAsyncLocalStorageLookup()]}function obt(e){if(e!=null){if(e>JJ)return ya&&J.warn(`\`maxSpanWaitDuration\` is too high, using the maximum value of ${JJ}`),JJ;if(e<=0||Number.isNaN(e)){ya&&J.warn("`maxSpanWaitDuration` must be a positive number, using default value instead.");return}return e}}var B3,PMe,JJ,LMe=O(()=>{m();je();B3=ie(g7(),1),PMe=ie(j7(),1);Zn();dt();mr();uv();ly();JJ=1e6});function QMe(){return KQ().filter(t=>t.name!=="Http"&&t.name!=="NodeFetch").concat(fxe(),Txe())}function FMe(e){return[...QMe(),...xi(e)?kMe():[]]}function ZJ(e={}){return ibt(e,FMe)}function ibt(e={},t){YS(e,"node");let n=DY({...e,defaultIntegrations:e.defaultIntegrations??t(e)});return n&&!e.skipOpenTelemetrySetup&&(UMe(n,{spanProcessors:e.openTelemetrySpanProcessors}),JQ()),n}var GMe=O(()=>{m();dt();mr();Axe();Ixe();MMe();LMe()});var sR=O(()=>{m();GMe();dt();mr()});function Ni(){return abt}function Yu(){return jMe}function HMe(){return sbt}var abt,jMe,sbt,Gl=O(()=>{"use strict";m();abt="prod",jMe="0.1.134",sbt=`@tanagram/lore/${jMe}`});function pbt(e=""){if(!lbt.test(e))return e!==e.toLowerCase()}function zMe(e,t){let n=t??dbt,r=[];if(!e||typeof e!="string")return r;let o="",i,a;for(let c of e){let d=n.includes(c);if(d===!0){r.push(o),o="",i=void 0;continue}let g=pbt(c);if(a===!1){if(i===!1&&g===!0){r.push(o),o=c,i=g;continue}if(i===!0&&g===!1&&o.length>1){let h=o.at(-1);r.push(o.slice(0,Math.max(0,o.length-1))),o=h+c,i=g;continue}}o+=c,i=g,a=d}return r.push(o),r}function fbt(e){return e?e[0].toUpperCase()+e.slice(1):""}function Abt(e){return e?e[0].toLowerCase()+e.slice(1):""}function mbt(e,t){return e?(Array.isArray(e)?e:zMe(e)).map(n=>fbt(t?.normalize?n.toLowerCase():n)).join(""):""}function bO(e,t){return Abt(mbt(e||"",t))}function N3(e,t){return e?(Array.isArray(e)?e:zMe(e)).map(n=>n.toLowerCase()).join(t??"-"):""}function $Me(e){return N3(e||"","_")}var lbt,dbt,VMe=O(()=>{m();lbt=/\d/,dbt=["-","_","/","."]});import{parseArgs as gbt}from"node:util";function M3(e){return Array.isArray(e)?e:e===void 0?[]:[e]}function WJ(e,t=""){let n=[];for(let r of e)for(let[o,i]of r.entries())n[o]=Math.max(n[o]||0,i.length);return e.map(r=>r.map((o,i)=>t+o[i===0?"padStart":"padEnd"](n[i])).join(" ")).join(`
39
39
  `)}function jl(e){return typeof e=="function"?e():e}function hbt(e=[],t={}){let n=new Set(t.boolean||[]),r=new Set(t.string||[]),o=t.alias||{},i=t.default||{},a=new Map,c=new Map;for(let[N,k]of Object.entries(o)){let Q=k;for(let j of Q)a.set(N,j),c.has(j)||c.set(j,[]),c.get(j).push(N),a.set(j,N),c.has(N)||c.set(N,[]),c.get(N).push(j)}let d={};function g(N){if(n.has(N))return"boolean";let k=c.get(N)||[];for(let Q of k)if(n.has(Q))return"boolean";return"string"}function h(N){if(r.has(N))return!0;let k=c.get(N)||[];for(let Q of k)if(r.has(Q))return!0;return!1}let S=new Set([...n,...r,...Object.keys(o),...Object.values(o).flat(),...Object.keys(i)]);for(let N of S)d[N]||(d[N]={type:g(N),default:i[N]});for(let[N,k]of a.entries())N.length===1&&d[k]&&!d[k].short&&(d[k].short=N);let y=[],C={};for(let N=0;N<e.length;N++){let k=e[N];if(k==="--"){y.push(...e.slice(N));break}if(k.startsWith("--no-")){let Q=k.slice(5);C[Q]=!0;continue}y.push(k)}let v;try{v=gbt({args:y,options:Object.keys(d).length>0?d:void 0,allowPositionals:!0,strict:!1})}catch{v={values:{},positionals:y}}let x={_:[]};x._=v.positionals;for(let[N,k]of Object.entries(v.values)){let Q=k;g(N)==="boolean"&&typeof k=="string"?Q=k!=="false":h(N)&&typeof k=="boolean"&&(Q=""),x[N]=Q}for(let[N]of Object.entries(C)){x[N]=!1;let k=a.get(N);k&&(x[k]=!1);let Q=c.get(N);if(Q)for(let j of Q)x[j]=!1}for(let[N,k]of a.entries())x[N]!==void 0&&x[k]===void 0&&(x[k]=x[N]),x[k]!==void 0&&x[N]===void 0&&(x[N]=x[k]),x[N]!==x[k]&&i[k]===x[k]&&(x[k]=x[N]);return x}function Ebt(e,t){let n={boolean:[],string:[],alias:{},default:{}},r=KMe(t);for(let c of r){if(c.type==="positional")continue;c.type==="string"||c.type==="enum"?n.string.push(c.name):c.type==="boolean"&&n.boolean.push(c.name),c.default!==void 0&&(n.default[c.name]=c.default),c.alias&&(n.alias[c.name]=c.alias);let d=bO(c.name),g=N3(c.name);if(d!==c.name||g!==c.name){let h=M3(n.alias[c.name]||[]);d!==c.name&&!h.includes(d)&&h.push(d),g!==c.name&&!h.includes(g)&&h.push(g),h.length>0&&(n.alias[c.name]=h)}}let o=hbt(e,n),[...i]=o._,a=new Proxy(o,{get(c,d){return c[d]??c[bO(d)]??c[N3(d)]}});for(let[,c]of r.entries())if(c.type==="positional"){let d=i.shift();if(d!==void 0)a[c.name]=d;else{if(c.default===void 0&&c.required!==!1)throw new by(`Missing required positional argument: ${c.name.toUpperCase()}`,"EARG");a[c.name]=c.default}}else if(c.type==="enum"){let d=a[c.name],g=c.options||[];if(d!==void 0&&g.length>0&&!g.includes(d))throw new by(`Invalid value for argument: ${df(`--${c.name}`)} (${df(d)}). Expected one of: ${g.map(h=>df(h)).join(", ")}.`,"EARG")}else if(c.required&&a[c.name]===void 0)throw new by(`Missing required argument: --${c.name}`,"EARG");return a}function KMe(e){let t=[];for(let[n,r]of Object.entries(e||{}))t.push({...r,name:n,alias:M3(r.alias)});return t}async function Sbt(e){return Promise.all(e.map(t=>jl(t)))}async function vy(e,t){let n=await jl(e.args||{}),r=Ebt(t.rawArgs,n),o={rawArgs:t.rawArgs,args:r,data:t.data,cmd:e},i=await Sbt(e.plugins??[]),a,c;try{for(let h of i)await h.setup?.(o);typeof e.setup=="function"&&await e.setup(o);let g=await jl(e.subCommands);if(g&&Object.keys(g).length>0){let h=ybt(t.rawArgs,n),S=t.rawArgs[h];if(S){let y=await qMe(g,S);if(!y)throw new by(`Unknown command ${df(S)}`,"E_UNKNOWN_COMMAND");await vy(y,{rawArgs:t.rawArgs.slice(h+1)})}else{let y=await jl(e.default);if(y){if(e.run)throw new by("Cannot specify both 'run' and 'default' on the same command.","E_DEFAULT_CONFLICT");let C=await qMe(g,y);if(!C)throw new by(`Default sub command ${df(y)} not found in subCommands.`,"E_UNKNOWN_COMMAND");await vy(C,{rawArgs:t.rawArgs})}else if(!e.run)throw new by("No command specified.","E_NO_COMMAND")}}typeof e.run=="function"&&(a=await e.run(o))}catch(g){c=g}let d=[];if(typeof e.cleanup=="function")try{await e.cleanup(o)}catch(g){d.push(g)}for(let g of[...i].reverse())try{await g.cleanup?.(o)}catch(h){d.push(h)}if(c)throw c;if(d.length===1)throw d[0];if(d.length>1)throw new Error("Multiple cleanup errors",{cause:d});return{result:a}}async function qMe(e,t){if(t in e)return jl(e[t]);for(let n of Object.values(e)){let r=await jl(n),o=await jl(r?.meta);if(o?.alias&&M3(o.alias).includes(t))return r}}function ybt(e,t){for(let n=0;n<e.length;n++){let r=e[n];if(r==="--")return-1;if(r.startsWith("-")){!r.includes("=")&&Tbt(r,t)&&n++;continue}return n}return-1}function Tbt(e,t){let n=e.replace(/^-{1,2}/,""),r=bO(n);for(let[o,i]of Object.entries(t))if(!(i.type!=="string"&&i.type!=="enum")&&(r===bO(o)||(Array.isArray(i.alias)?i.alias:i.alias?[i.alias]:[]).includes(n)))return!0;return!1}async function eZ(e,t){let n=await jl(e.meta||{}),r=KMe(await jl(e.args||{})),o=await jl(t?.meta||{}),i=`${o.name?`${o.name} `:""}`+(n.name||process.argv[1]),a=[],c=[],d=[],g=[];for(let C of r)if(C.type==="positional"){let v=C.name.toUpperCase(),x=C.required!==!1&&C.default===void 0;c.push([df(v+XJ(C)),YMe(C,x)]),g.push(x?`<${v}>`:`[${v}]`)}else{let v=C.required===!0&&C.default===void 0,x=[...(C.alias||[]).map(N=>`-${N}`),`--${C.name}`].join(", ")+XJ(C);if(a.push([df(x),YMe(C,v)]),C.type==="boolean"&&(C.default===!0||C.negativeDescription)&&!Ibt.test(C.name)){let N=[...(C.alias||[]).map(k=>`--no-${k}`),`--no-${C.name}`].join(", ");a.push([df(N),[C.negativeDescription,v?k3("(Required)"):""].filter(Boolean).join(" ")])}v&&g.push(`--${C.name}`+XJ(C))}if(e.subCommands){let C=[],v=await jl(e.subCommands);for(let[x,N]of Object.entries(v)){let k=await jl((await jl(N))?.meta);if(k?.hidden)continue;let Q=M3(k?.alias),j=[x,...Q].join(", ");d.push([df(j),k?.description||""]),C.push(x,...Q)}g.push(C.join("|"))}let h=[],S=n.version||o.version;h.push(k3(`${n.description} (${i+(S?` v${S}`:"")})`),"");let y=a.length>0||c.length>0;return h.push(`${w3(O3("USAGE"))} ${df(`${i}${y?" [OPTIONS]":""} ${g.join(" ")}`)}`,""),c.length>0&&(h.push(w3(O3("ARGUMENTS")),""),h.push(WJ(c," ")),h.push("")),a.length>0&&(h.push(w3(O3("OPTIONS")),""),h.push(WJ(a," ")),h.push("")),d.length>0&&(h.push(w3(O3("COMMANDS")),""),h.push(WJ(d," ")),h.push("",`Use ${df(`${i} <command> --help`)} for more information about a command.`)),h.filter(C=>typeof C=="string").join(`
40
40
  `)}function XJ(e){let t=e.valueHint?`=<${e.valueHint}>`:"",n=t||`=<${$Me(e.name)}>`;return!e.type||e.type==="positional"||e.type==="boolean"?t:e.type==="enum"&&e.options?.length?`=<${e.options.join("|")}>`:n}function YMe(e,t){let n=t?k3("(Required)"):"",r=e.default===void 0?"":k3(`(Default: ${e.default})`);return[e.description,n,r].filter(Boolean).join(" ")}var by,_bt,P3,O3,df,k3,w3,Ibt,tZ=O(()=>{m();VMe();by=class extends Error{code;constructor(e,t){super(e),this.name="CLIError",this.code=t}};_bt=(()=>{let e=globalThis.process?.env??{};return e.NO_COLOR==="1"||e.TERM==="dumb"||e.TEST||e.CI})(),P3=(e,t=39)=>n=>_bt?n:`\x1B[${e}m${n}\x1B[${t}m`,O3=P3(1,22),df=P3(36),k3=P3(90),w3=P3(4,24);Ibt=/^no[-A-Z]/});function bbt(e){XMe=e}function L3(){return XMe}function ut(e,t){let n=Q3({issueData:t,data:e.data,path:e.path,errorMaps:[e.common.contextualErrorMap,e.schemaErrorMap,L3(),vO].filter(r=>!!r)});e.common.issues.push(n)}function bn(e){if(!e)return{};let{errorMap:t,invalid_type_error:n,required_error:r,description:o}=e;if(t&&(n||r))throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);return t?{errorMap:t,description:o}:{errorMap:(a,c)=>a.code!=="invalid_type"?{message:c.defaultError}:typeof c.data>"u"?{message:r??c.defaultError}:{message:n??c.defaultError},description:o}}function Pbt(e,t){return!!((t==="v4"||!t)&&wbt.test(e)||(t==="v6"||!t)&&kbt.test(e))}function Ubt(e,t){let n=(e.toString().split(".")[1]||"").length,r=(t.toString().split(".")[1]||"").length,o=n>r?n:r,i=parseInt(e.toFixed(o).replace(".","")),a=parseInt(t.toFixed(o).replace(".",""));return i%a/Math.pow(10,o)}function uR(e){if(e instanceof lu){let t={};for(let n in e.shape){let r=e.shape[n];t[n]=pf.create(uR(r))}return new lu({...e._def,shape:()=>t})}else return e instanceof wg?new wg({...e._def,type:uR(e.element)}):e instanceof pf?pf.create(uR(e.unwrap())):e instanceof kg?kg.create(uR(e.unwrap())):e instanceof GA?GA.create(e.items.map(t=>uR(t))):e}function sZ(e,t){let n=lE(e),r=lE(t);if(e===t)return{valid:!0,data:e};if(n===at.object&&r===at.object){let o=_r.objectKeys(t),i=_r.objectKeys(e).filter(c=>o.indexOf(c)!==-1),a={...e,...t};for(let c of i){let d=sZ(e[c],t[c]);if(!d.valid)return{valid:!1};a[c]=d.data}return{valid:!0,data:a}}else if(n===at.array&&r===at.array){if(e.length!==t.length)return{valid:!1};let o=[];for(let i=0;i<e.length;i++){let a=e[i],c=t[i],d=sZ(a,c);if(!d.valid)return{valid:!1};o.push(d.data)}return{valid:!0,data:o}}else return n===at.date&&r===at.date&&+e==+t?{valid:!0,data:e}:{valid:!1}}function tPe(e,t){return new Uy({values:e,typeName:qt.ZodEnum,...bn(t)})}var _r,oZ,at,lE,Ve,Cbt,Gc,vO,XMe,Q3,vbt,cu,gn,ePe,Ku,iZ,aZ,RO,F3,Pt,Wd,JMe,vn,Rbt,xbt,Dbt,Bbt,Nbt,Obt,wbt,kbt,Mbt,dE,Ry,xy,Dy,By,cR,Ny,Oy,pE,Og,ff,lR,wg,lu,wy,U3,G3,ky,GA,j3,dR,pR,H3,My,Py,Uy,Ly,fE,Hl,pf,kg,Qy,fR,AR,Lbt,z3,xO,mR,nPe,Qbt,qt,Fbt,rPe,oPe,Gbt,jbt,iPe,Hbt,zbt,$bt,Vbt,qbt,Ybt,Kbt,Jbt,Zbt,Wbt,Xbt,evt,tvt,nvt,rvt,ovt,ivt,avt,svt,uvt,cvt,lvt,dvt,pvt,ZMe,fvt,Avt,mvt,gvt,hvt,_vt,Evt,Svt,yvt,uu,Tvt,nZ,Ivt,Zd,uZ,VCn,qCn,YCn,aPe,Cvt,bvt,vvt,Rvt,sPe,uPe,cPe,rZ,os,xvt,Dvt,Bvt,Nvt,cZ,lZ,dZ,Ovt,WMe,wvt,kvt,Mvt,Pvt,pZ,Af=O(()=>{m();(function(e){e.assertEqual=o=>o;function t(o){}e.assertIs=t;function n(o){throw new Error}e.assertNever=n,e.arrayToEnum=o=>{let i={};for(let a of o)i[a]=a;return i},e.getValidEnumValues=o=>{let i=e.objectKeys(o).filter(c=>typeof o[o[c]]!="number"),a={};for(let c of i)a[c]=o[c];return e.objectValues(a)},e.objectValues=o=>e.objectKeys(o).map(function(i){return o[i]}),e.objectKeys=typeof Object.keys=="function"?o=>Object.keys(o):o=>{let i=[];for(let a in o)Object.prototype.hasOwnProperty.call(o,a)&&i.push(a);return i},e.find=(o,i)=>{for(let a of o)if(i(a))return a},e.isInteger=typeof Number.isInteger=="function"?o=>Number.isInteger(o):o=>typeof o=="number"&&isFinite(o)&&Math.floor(o)===o;function r(o,i=" | "){return o.map(a=>typeof a=="string"?`'${a}'`:a).join(i)}e.joinValues=r,e.jsonStringifyReplacer=(o,i)=>typeof i=="bigint"?i.toString():i})(_r||(_r={}));(function(e){e.mergeShapes=(t,n)=>({...t,...n})})(oZ||(oZ={}));at=_r.arrayToEnum(["string","nan","number","integer","float","boolean","date","bigint","symbol","function","undefined","null","array","object","unknown","promise","void","never","map","set"]),lE=e=>{switch(typeof e){case"undefined":return at.undefined;case"string":return at.string;case"number":return isNaN(e)?at.nan:at.number;case"boolean":return at.boolean;case"function":return at.function;case"bigint":return at.bigint;case"symbol":return at.symbol;case"object":return Array.isArray(e)?at.array:e===null?at.null:e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?at.promise:typeof Map<"u"&&e instanceof Map?at.map:typeof Set<"u"&&e instanceof Set?at.set:typeof Date<"u"&&e instanceof Date?at.date:at.object;default:return at.unknown}},Ve=_r.arrayToEnum(["invalid_type","invalid_literal","custom","invalid_union","invalid_union_discriminator","invalid_enum_value","unrecognized_keys","invalid_arguments","invalid_return_type","invalid_date","invalid_string","too_small","too_big","invalid_intersection_types","not_multiple_of","not_finite"]),Cbt=e=>JSON.stringify(e,null,2).replace(/"([^"]+)":/g,"$1:"),Gc=class extends Error{constructor(t){super(),this.issues=[],this.addIssue=r=>{this.issues=[...this.issues,r]},this.addIssues=(r=[])=>{this.issues=[...this.issues,...r]};let n=new.target.prototype;Object.setPrototypeOf?Object.setPrototypeOf(this,n):this.__proto__=n,this.name="ZodError",this.issues=t}get errors(){return this.issues}format(t){let n=t||function(i){return i.message},r={_errors:[]},o=i=>{for(let a of i.issues)if(a.code==="invalid_union")a.unionErrors.map(o);else if(a.code==="invalid_return_type")o(a.returnTypeError);else if(a.code==="invalid_arguments")o(a.argumentsError);else if(a.path.length===0)r._errors.push(n(a));else{let c=r,d=0;for(;d<a.path.length;){let g=a.path[d];d===a.path.length-1?(c[g]=c[g]||{_errors:[]},c[g]._errors.push(n(a))):c[g]=c[g]||{_errors:[]},c=c[g],d++}}};return o(this),r}toString(){return this.message}get message(){return JSON.stringify(this.issues,_r.jsonStringifyReplacer,2)}get isEmpty(){return this.issues.length===0}flatten(t=n=>n.message){let n={},r=[];for(let o of this.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}get formErrors(){return this.flatten()}};Gc.create=e=>new Gc(e);vO=(e,t)=>{let n;switch(e.code){case Ve.invalid_type:e.received===at.undefined?n="Required":n=`Expected ${e.expected}, received ${e.received}`;break;case Ve.invalid_literal:n=`Invalid literal value, expected ${JSON.stringify(e.expected,_r.jsonStringifyReplacer)}`;break;case Ve.unrecognized_keys:n=`Unrecognized key(s) in object: ${_r.joinValues(e.keys,", ")}`;break;case Ve.invalid_union:n="Invalid input";break;case Ve.invalid_union_discriminator:n=`Invalid discriminator value. Expected ${_r.joinValues(e.options)}`;break;case Ve.invalid_enum_value:n=`Invalid enum value. Expected ${_r.joinValues(e.options)}, received '${e.received}'`;break;case Ve.invalid_arguments:n="Invalid function arguments";break;case Ve.invalid_return_type:n="Invalid function return type";break;case Ve.invalid_date:n="Invalid date";break;case Ve.invalid_string:typeof e.validation=="object"?"includes"in e.validation?(n=`Invalid input: must include "${e.validation.includes}"`,typeof e.validation.position=="number"&&(n=`${n} at one or more positions greater than or equal to ${e.validation.position}`)):"startsWith"in e.validation?n=`Invalid input: must start with "${e.validation.startsWith}"`:"endsWith"in e.validation?n=`Invalid input: must end with "${e.validation.endsWith}"`:_r.assertNever(e.validation):e.validation!=="regex"?n=`Invalid ${e.validation}`:n="Invalid";break;case Ve.too_small:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at least":"more than"} ${e.minimum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at least":"over"} ${e.minimum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${e.minimum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly equal to ":e.inclusive?"greater than or equal to ":"greater than "}${new Date(Number(e.minimum))}`:n="Invalid input";break;case Ve.too_big:e.type==="array"?n=`Array must contain ${e.exact?"exactly":e.inclusive?"at most":"less than"} ${e.maximum} element(s)`:e.type==="string"?n=`String must contain ${e.exact?"exactly":e.inclusive?"at most":"under"} ${e.maximum} character(s)`:e.type==="number"?n=`Number must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="bigint"?n=`BigInt must be ${e.exact?"exactly":e.inclusive?"less than or equal to":"less than"} ${e.maximum}`:e.type==="date"?n=`Date must be ${e.exact?"exactly":e.inclusive?"smaller than or equal to":"smaller than"} ${new Date(Number(e.maximum))}`:n="Invalid input";break;case Ve.custom:n="Invalid input";break;case Ve.invalid_intersection_types:n="Intersection results could not be merged";break;case Ve.not_multiple_of:n=`Number must be a multiple of ${e.multipleOf}`;break;case Ve.not_finite:n="Number must be finite";break;default:n=t.defaultError,_r.assertNever(e)}return{message:n}},XMe=vO;Q3=e=>{let{data:t,path:n,errorMaps:r,issueData:o}=e,i=[...n,...o.path||[]],a={...o,path:i},c="",d=r.filter(g=>!!g).slice().reverse();for(let g of d)c=g(a,{data:t,defaultError:c}).message;return{...o,path:i,message:o.message||c}},vbt=[];cu=class e{constructor(){this.value="valid"}dirty(){this.value==="valid"&&(this.value="dirty")}abort(){this.value!=="aborted"&&(this.value="aborted")}static mergeArray(t,n){let r=[];for(let o of n){if(o.status==="aborted")return gn;o.status==="dirty"&&t.dirty(),r.push(o.value)}return{status:t.value,value:r}}static async mergeObjectAsync(t,n){let r=[];for(let o of n)r.push({key:await o.key,value:await o.value});return e.mergeObjectSync(t,r)}static mergeObjectSync(t,n){let r={};for(let o of n){let{key:i,value:a}=o;if(i.status==="aborted"||a.status==="aborted")return gn;i.status==="dirty"&&t.dirty(),a.status==="dirty"&&t.dirty(),i.value!=="__proto__"&&(typeof a.value<"u"||o.alwaysSet)&&(r[i.value]=a.value)}return{status:t.value,value:r}}},gn=Object.freeze({status:"aborted"}),ePe=e=>({status:"dirty",value:e}),Ku=e=>({status:"valid",value:e}),iZ=e=>e.status==="aborted",aZ=e=>e.status==="dirty",RO=e=>e.status==="valid",F3=e=>typeof Promise<"u"&&e instanceof Promise;(function(e){e.errToObj=t=>typeof t=="string"?{message:t}:t||{},e.toString=t=>typeof t=="string"?t:t?.message})(Pt||(Pt={}));Wd=class{constructor(t,n,r,o){this._cachedPath=[],this.parent=t,this.data=n,this._path=r,this._key=o}get path(){return this._cachedPath.length||(this._key instanceof Array?this._cachedPath.push(...this._path,...this._key):this._cachedPath.push(...this._path,this._key)),this._cachedPath}},JMe=(e,t)=>{if(RO(t))return{success:!0,data:t.value};if(!e.common.issues.length)throw new Error("Validation failed but no issues detected.");return{success:!1,get error(){if(this._error)return this._error;let n=new Gc(e.common.issues);return this._error=n,this._error}}};vn=class{constructor(t){this.spa=this.safeParseAsync,this._def=t,this.parse=this.parse.bind(this),this.safeParse=this.safeParse.bind(this),this.parseAsync=this.parseAsync.bind(this),this.safeParseAsync=this.safeParseAsync.bind(this),this.spa=this.spa.bind(this),this.refine=this.refine.bind(this),this.refinement=this.refinement.bind(this),this.superRefine=this.superRefine.bind(this),this.optional=this.optional.bind(this),this.nullable=this.nullable.bind(this),this.nullish=this.nullish.bind(this),this.array=this.array.bind(this),this.promise=this.promise.bind(this),this.or=this.or.bind(this),this.and=this.and.bind(this),this.transform=this.transform.bind(this),this.brand=this.brand.bind(this),this.default=this.default.bind(this),this.catch=this.catch.bind(this),this.describe=this.describe.bind(this),this.pipe=this.pipe.bind(this),this.readonly=this.readonly.bind(this),this.isNullable=this.isNullable.bind(this),this.isOptional=this.isOptional.bind(this)}get description(){return this._def.description}_getType(t){return lE(t.data)}_getOrReturnCtx(t,n){return n||{common:t.parent.common,data:t.data,parsedType:lE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}_processInputParams(t){return{status:new cu,ctx:{common:t.parent.common,data:t.data,parsedType:lE(t.data),schemaErrorMap:this._def.errorMap,path:t.path,parent:t.parent}}}_parseSync(t){let n=this._parse(t);if(F3(n))throw new Error("Synchronous parse encountered promise.");return n}_parseAsync(t){let n=this._parse(t);return Promise.resolve(n)}parse(t,n){let r=this.safeParse(t,n);if(r.success)return r.data;throw r.error}safeParse(t,n){var r;let o={common:{issues:[],async:(r=n?.async)!==null&&r!==void 0?r:!1,contextualErrorMap:n?.errorMap},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:lE(t)},i=this._parseSync({data:t,path:o.path,parent:o});return JMe(o,i)}async parseAsync(t,n){let r=await this.safeParseAsync(t,n);if(r.success)return r.data;throw r.error}async safeParseAsync(t,n){let r={common:{issues:[],contextualErrorMap:n?.errorMap,async:!0},path:n?.path||[],schemaErrorMap:this._def.errorMap,parent:null,data:t,parsedType:lE(t)},o=this._parse({data:t,path:r.path,parent:r}),i=await(F3(o)?o:Promise.resolve(o));return JMe(r,i)}refine(t,n){let r=o=>typeof n=="string"||typeof n>"u"?{message:n}:typeof n=="function"?n(o):n;return this._refinement((o,i)=>{let a=t(o),c=()=>i.addIssue({code:Ve.custom,...r(o)});return typeof Promise<"u"&&a instanceof Promise?a.then(d=>d?!0:(c(),!1)):a?!0:(c(),!1)})}refinement(t,n){return this._refinement((r,o)=>t(r)?!0:(o.addIssue(typeof n=="function"?n(r,o):n),!1))}_refinement(t){return new Hl({schema:this,typeName:qt.ZodEffects,effect:{type:"refinement",refinement:t}})}superRefine(t){return this._refinement(t)}optional(){return pf.create(this,this._def)}nullable(){return kg.create(this,this._def)}nullish(){return this.nullable().optional()}array(){return wg.create(this,this._def)}promise(){return fE.create(this,this._def)}or(t){return wy.create([this,t],this._def)}and(t){return ky.create(this,t,this._def)}transform(t){return new Hl({...bn(this._def),schema:this,typeName:qt.ZodEffects,effect:{type:"transform",transform:t}})}default(t){let n=typeof t=="function"?t:()=>t;return new Qy({...bn(this._def),innerType:this,defaultValue:n,typeName:qt.ZodDefault})}brand(){return new z3({typeName:qt.ZodBranded,type:this,...bn(this._def)})}catch(t){let n=typeof t=="function"?t:()=>t;return new fR({...bn(this._def),innerType:this,catchValue:n,typeName:qt.ZodCatch})}describe(t){let n=this.constructor;return new n({...this._def,description:t})}pipe(t){return xO.create(this,t)}readonly(){return mR.create(this)}isOptional(){return this.safeParse(void 0).success}isNullable(){return this.safeParse(null).success}},Rbt=/^c[^\s-]{8,}$/i,xbt=/^[a-z][a-z0-9]*$/,Dbt=/[0-9A-HJKMNP-TV-Z]{26}/,Bbt=/^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i,Nbt=/^(?!\.)(?!.*\.\.)([A-Z0-9_+-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i,Obt=new RegExp("^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$","u"),wbt=/^(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))$/,kbt=/^(([a-f0-9]{1,4}:){7}|::([a-f0-9]{1,4}:){0,6}|([a-f0-9]{1,4}:){1}:([a-f0-9]{1,4}:){0,5}|([a-f0-9]{1,4}:){2}:([a-f0-9]{1,4}:){0,4}|([a-f0-9]{1,4}:){3}:([a-f0-9]{1,4}:){0,3}|([a-f0-9]{1,4}:){4}:([a-f0-9]{1,4}:){0,2}|([a-f0-9]{1,4}:){5}:([a-f0-9]{1,4}:){0,1})([a-f0-9]{1,4}|(((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2}))\.){3}((25[0-5])|(2[0-4][0-9])|(1[0-9]{2})|([0-9]{1,2})))$/,Mbt=e=>e.precision?e.offset?new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}(([+-]\\d{2}(:?\\d{2})?)|Z)$`):new RegExp(`^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}\\.\\d{${e.precision}}Z$`):e.precision===0?e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}Z$"):e.offset?new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?(([+-]\\d{2}(:?\\d{2})?)|Z)$"):new RegExp("^\\d{4}-\\d{2}-\\d{2}T\\d{2}:\\d{2}:\\d{2}(\\.\\d+)?Z$");dE=class e extends vn{constructor(){super(...arguments),this._regex=(t,n,r)=>this.refinement(o=>t.test(o),{validation:n,code:Ve.invalid_string,...Pt.errToObj(r)}),this.nonempty=t=>this.min(1,Pt.errToObj(t)),this.trim=()=>new e({...this._def,checks:[...this._def.checks,{kind:"trim"}]}),this.toLowerCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toLowerCase"}]}),this.toUpperCase=()=>new e({...this._def,checks:[...this._def.checks,{kind:"toUpperCase"}]})}_parse(t){if(this._def.coerce&&(t.data=String(t.data)),this._getType(t)!==at.string){let i=this._getOrReturnCtx(t);return ut(i,{code:Ve.invalid_type,expected:at.string,received:i.parsedType}),gn}let r=new cu,o;for(let i of this._def.checks)if(i.kind==="min")t.data.length<i.value&&(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="max")t.data.length>i.value&&(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!1,message:i.message}),r.dirty());else if(i.kind==="length"){let a=t.data.length>i.value,c=t.data.length<i.value;(a||c)&&(o=this._getOrReturnCtx(t,o),a?ut(o,{code:Ve.too_big,maximum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}):c&&ut(o,{code:Ve.too_small,minimum:i.value,type:"string",inclusive:!0,exact:!0,message:i.message}),r.dirty())}else if(i.kind==="email")Nbt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"email",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="emoji")Obt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"emoji",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="uuid")Bbt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"uuid",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid")Rbt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"cuid",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="cuid2")xbt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"cuid2",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="ulid")Dbt.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"ulid",code:Ve.invalid_string,message:i.message}),r.dirty());else if(i.kind==="url")try{new URL(t.data)}catch{o=this._getOrReturnCtx(t,o),ut(o,{validation:"url",code:Ve.invalid_string,message:i.message}),r.dirty()}else i.kind==="regex"?(i.regex.lastIndex=0,i.regex.test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"regex",code:Ve.invalid_string,message:i.message}),r.dirty())):i.kind==="trim"?t.data=t.data.trim():i.kind==="includes"?t.data.includes(i.value,i.position)||(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.invalid_string,validation:{includes:i.value,position:i.position},message:i.message}),r.dirty()):i.kind==="toLowerCase"?t.data=t.data.toLowerCase():i.kind==="toUpperCase"?t.data=t.data.toUpperCase():i.kind==="startsWith"?t.data.startsWith(i.value)||(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.invalid_string,validation:{startsWith:i.value},message:i.message}),r.dirty()):i.kind==="endsWith"?t.data.endsWith(i.value)||(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.invalid_string,validation:{endsWith:i.value},message:i.message}),r.dirty()):i.kind==="datetime"?Mbt(i).test(t.data)||(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.invalid_string,validation:"datetime",message:i.message}),r.dirty()):i.kind==="ip"?Pbt(t.data,i.version)||(o=this._getOrReturnCtx(t,o),ut(o,{validation:"ip",code:Ve.invalid_string,message:i.message}),r.dirty()):_r.assertNever(i);return{status:r.value,value:t.data}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}email(t){return this._addCheck({kind:"email",...Pt.errToObj(t)})}url(t){return this._addCheck({kind:"url",...Pt.errToObj(t)})}emoji(t){return this._addCheck({kind:"emoji",...Pt.errToObj(t)})}uuid(t){return this._addCheck({kind:"uuid",...Pt.errToObj(t)})}cuid(t){return this._addCheck({kind:"cuid",...Pt.errToObj(t)})}cuid2(t){return this._addCheck({kind:"cuid2",...Pt.errToObj(t)})}ulid(t){return this._addCheck({kind:"ulid",...Pt.errToObj(t)})}ip(t){return this._addCheck({kind:"ip",...Pt.errToObj(t)})}datetime(t){var n;return typeof t=="string"?this._addCheck({kind:"datetime",precision:null,offset:!1,message:t}):this._addCheck({kind:"datetime",precision:typeof t?.precision>"u"?null:t?.precision,offset:(n=t?.offset)!==null&&n!==void 0?n:!1,...Pt.errToObj(t?.message)})}regex(t,n){return this._addCheck({kind:"regex",regex:t,...Pt.errToObj(n)})}includes(t,n){return this._addCheck({kind:"includes",value:t,position:n?.position,...Pt.errToObj(n?.message)})}startsWith(t,n){return this._addCheck({kind:"startsWith",value:t,...Pt.errToObj(n)})}endsWith(t,n){return this._addCheck({kind:"endsWith",value:t,...Pt.errToObj(n)})}min(t,n){return this._addCheck({kind:"min",value:t,...Pt.errToObj(n)})}max(t,n){return this._addCheck({kind:"max",value:t,...Pt.errToObj(n)})}length(t,n){return this._addCheck({kind:"length",value:t,...Pt.errToObj(n)})}get isDatetime(){return!!this._def.checks.find(t=>t.kind==="datetime")}get isEmail(){return!!this._def.checks.find(t=>t.kind==="email")}get isURL(){return!!this._def.checks.find(t=>t.kind==="url")}get isEmoji(){return!!this._def.checks.find(t=>t.kind==="emoji")}get isUUID(){return!!this._def.checks.find(t=>t.kind==="uuid")}get isCUID(){return!!this._def.checks.find(t=>t.kind==="cuid")}get isCUID2(){return!!this._def.checks.find(t=>t.kind==="cuid2")}get isULID(){return!!this._def.checks.find(t=>t.kind==="ulid")}get isIP(){return!!this._def.checks.find(t=>t.kind==="ip")}get minLength(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxLength(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};dE.create=e=>{var t;return new dE({checks:[],typeName:qt.ZodString,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...bn(e)})};Ry=class e extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte,this.step=this.multipleOf}_parse(t){if(this._def.coerce&&(t.data=Number(t.data)),this._getType(t)!==at.number){let i=this._getOrReturnCtx(t);return ut(i,{code:Ve.invalid_type,expected:at.number,received:i.parsedType}),gn}let r,o=new cu;for(let i of this._def.checks)i.kind==="int"?_r.isInteger(t.data)||(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.invalid_type,expected:"integer",received:"float",message:i.message}),o.dirty()):i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.too_small,minimum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.too_big,maximum:i.value,type:"number",inclusive:i.inclusive,exact:!1,message:i.message}),o.dirty()):i.kind==="multipleOf"?Ubt(t.data,i.value)!==0&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):i.kind==="finite"?Number.isFinite(t.data)||(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.not_finite,message:i.message}),o.dirty()):_r.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Pt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Pt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Pt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Pt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Pt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}int(t){return this._addCheck({kind:"int",message:Pt.toString(t)})}positive(t){return this._addCheck({kind:"min",value:0,inclusive:!1,message:Pt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:0,inclusive:!1,message:Pt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:0,inclusive:!0,message:Pt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:0,inclusive:!0,message:Pt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Pt.toString(n)})}finite(t){return this._addCheck({kind:"finite",message:Pt.toString(t)})}safe(t){return this._addCheck({kind:"min",inclusive:!0,value:Number.MIN_SAFE_INTEGER,message:Pt.toString(t)})._addCheck({kind:"max",inclusive:!0,value:Number.MAX_SAFE_INTEGER,message:Pt.toString(t)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}get isInt(){return!!this._def.checks.find(t=>t.kind==="int"||t.kind==="multipleOf"&&_r.isInteger(t.value))}get isFinite(){let t=null,n=null;for(let r of this._def.checks){if(r.kind==="finite"||r.kind==="int"||r.kind==="multipleOf")return!0;r.kind==="min"?(n===null||r.value>n)&&(n=r.value):r.kind==="max"&&(t===null||r.value<t)&&(t=r.value)}return Number.isFinite(n)&&Number.isFinite(t)}};Ry.create=e=>new Ry({checks:[],typeName:qt.ZodNumber,coerce:e?.coerce||!1,...bn(e)});xy=class e extends vn{constructor(){super(...arguments),this.min=this.gte,this.max=this.lte}_parse(t){if(this._def.coerce&&(t.data=BigInt(t.data)),this._getType(t)!==at.bigint){let i=this._getOrReturnCtx(t);return ut(i,{code:Ve.invalid_type,expected:at.bigint,received:i.parsedType}),gn}let r,o=new cu;for(let i of this._def.checks)i.kind==="min"?(i.inclusive?t.data<i.value:t.data<=i.value)&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.too_small,type:"bigint",minimum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="max"?(i.inclusive?t.data>i.value:t.data>=i.value)&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.too_big,type:"bigint",maximum:i.value,inclusive:i.inclusive,message:i.message}),o.dirty()):i.kind==="multipleOf"?t.data%i.value!==BigInt(0)&&(r=this._getOrReturnCtx(t,r),ut(r,{code:Ve.not_multiple_of,multipleOf:i.value,message:i.message}),o.dirty()):_r.assertNever(i);return{status:o.value,value:t.data}}gte(t,n){return this.setLimit("min",t,!0,Pt.toString(n))}gt(t,n){return this.setLimit("min",t,!1,Pt.toString(n))}lte(t,n){return this.setLimit("max",t,!0,Pt.toString(n))}lt(t,n){return this.setLimit("max",t,!1,Pt.toString(n))}setLimit(t,n,r,o){return new e({...this._def,checks:[...this._def.checks,{kind:t,value:n,inclusive:r,message:Pt.toString(o)}]})}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}positive(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!1,message:Pt.toString(t)})}negative(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!1,message:Pt.toString(t)})}nonpositive(t){return this._addCheck({kind:"max",value:BigInt(0),inclusive:!0,message:Pt.toString(t)})}nonnegative(t){return this._addCheck({kind:"min",value:BigInt(0),inclusive:!0,message:Pt.toString(t)})}multipleOf(t,n){return this._addCheck({kind:"multipleOf",value:t,message:Pt.toString(n)})}get minValue(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t}get maxValue(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t}};xy.create=e=>{var t;return new xy({checks:[],typeName:qt.ZodBigInt,coerce:(t=e?.coerce)!==null&&t!==void 0?t:!1,...bn(e)})};Dy=class extends vn{_parse(t){if(this._def.coerce&&(t.data=!!t.data),this._getType(t)!==at.boolean){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.boolean,received:r.parsedType}),gn}return Ku(t.data)}};Dy.create=e=>new Dy({typeName:qt.ZodBoolean,coerce:e?.coerce||!1,...bn(e)});By=class e extends vn{_parse(t){if(this._def.coerce&&(t.data=new Date(t.data)),this._getType(t)!==at.date){let i=this._getOrReturnCtx(t);return ut(i,{code:Ve.invalid_type,expected:at.date,received:i.parsedType}),gn}if(isNaN(t.data.getTime())){let i=this._getOrReturnCtx(t);return ut(i,{code:Ve.invalid_date}),gn}let r=new cu,o;for(let i of this._def.checks)i.kind==="min"?t.data.getTime()<i.value&&(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.too_small,message:i.message,inclusive:!0,exact:!1,minimum:i.value,type:"date"}),r.dirty()):i.kind==="max"?t.data.getTime()>i.value&&(o=this._getOrReturnCtx(t,o),ut(o,{code:Ve.too_big,message:i.message,inclusive:!0,exact:!1,maximum:i.value,type:"date"}),r.dirty()):_r.assertNever(i);return{status:r.value,value:new Date(t.data.getTime())}}_addCheck(t){return new e({...this._def,checks:[...this._def.checks,t]})}min(t,n){return this._addCheck({kind:"min",value:t.getTime(),message:Pt.toString(n)})}max(t,n){return this._addCheck({kind:"max",value:t.getTime(),message:Pt.toString(n)})}get minDate(){let t=null;for(let n of this._def.checks)n.kind==="min"&&(t===null||n.value>t)&&(t=n.value);return t!=null?new Date(t):null}get maxDate(){let t=null;for(let n of this._def.checks)n.kind==="max"&&(t===null||n.value<t)&&(t=n.value);return t!=null?new Date(t):null}};By.create=e=>new By({checks:[],coerce:e?.coerce||!1,typeName:qt.ZodDate,...bn(e)});cR=class extends vn{_parse(t){if(this._getType(t)!==at.symbol){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.symbol,received:r.parsedType}),gn}return Ku(t.data)}};cR.create=e=>new cR({typeName:qt.ZodSymbol,...bn(e)});Ny=class extends vn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.undefined,received:r.parsedType}),gn}return Ku(t.data)}};Ny.create=e=>new Ny({typeName:qt.ZodUndefined,...bn(e)});Oy=class extends vn{_parse(t){if(this._getType(t)!==at.null){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.null,received:r.parsedType}),gn}return Ku(t.data)}};Oy.create=e=>new Oy({typeName:qt.ZodNull,...bn(e)});pE=class extends vn{constructor(){super(...arguments),this._any=!0}_parse(t){return Ku(t.data)}};pE.create=e=>new pE({typeName:qt.ZodAny,...bn(e)});Og=class extends vn{constructor(){super(...arguments),this._unknown=!0}_parse(t){return Ku(t.data)}};Og.create=e=>new Og({typeName:qt.ZodUnknown,...bn(e)});ff=class extends vn{_parse(t){let n=this._getOrReturnCtx(t);return ut(n,{code:Ve.invalid_type,expected:at.never,received:n.parsedType}),gn}};ff.create=e=>new ff({typeName:qt.ZodNever,...bn(e)});lR=class extends vn{_parse(t){if(this._getType(t)!==at.undefined){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.void,received:r.parsedType}),gn}return Ku(t.data)}};lR.create=e=>new lR({typeName:qt.ZodVoid,...bn(e)});wg=class e extends vn{_parse(t){let{ctx:n,status:r}=this._processInputParams(t),o=this._def;if(n.parsedType!==at.array)return ut(n,{code:Ve.invalid_type,expected:at.array,received:n.parsedType}),gn;if(o.exactLength!==null){let a=n.data.length>o.exactLength.value,c=n.data.length<o.exactLength.value;(a||c)&&(ut(n,{code:a?Ve.too_big:Ve.too_small,minimum:c?o.exactLength.value:void 0,maximum:a?o.exactLength.value:void 0,type:"array",inclusive:!0,exact:!0,message:o.exactLength.message}),r.dirty())}if(o.minLength!==null&&n.data.length<o.minLength.value&&(ut(n,{code:Ve.too_small,minimum:o.minLength.value,type:"array",inclusive:!0,exact:!1,message:o.minLength.message}),r.dirty()),o.maxLength!==null&&n.data.length>o.maxLength.value&&(ut(n,{code:Ve.too_big,maximum:o.maxLength.value,type:"array",inclusive:!0,exact:!1,message:o.maxLength.message}),r.dirty()),n.common.async)return Promise.all([...n.data].map((a,c)=>o.type._parseAsync(new Wd(n,a,n.path,c)))).then(a=>cu.mergeArray(r,a));let i=[...n.data].map((a,c)=>o.type._parseSync(new Wd(n,a,n.path,c)));return cu.mergeArray(r,i)}get element(){return this._def.type}min(t,n){return new e({...this._def,minLength:{value:t,message:Pt.toString(n)}})}max(t,n){return new e({...this._def,maxLength:{value:t,message:Pt.toString(n)}})}length(t,n){return new e({...this._def,exactLength:{value:t,message:Pt.toString(n)}})}nonempty(t){return this.min(1,t)}};wg.create=(e,t)=>new wg({type:e,minLength:null,maxLength:null,exactLength:null,typeName:qt.ZodArray,...bn(t)});lu=class e extends vn{constructor(){super(...arguments),this._cached=null,this.nonstrict=this.passthrough,this.augment=this.extend}_getCached(){if(this._cached!==null)return this._cached;let t=this._def.shape(),n=_r.objectKeys(t);return this._cached={shape:t,keys:n}}_parse(t){if(this._getType(t)!==at.object){let g=this._getOrReturnCtx(t);return ut(g,{code:Ve.invalid_type,expected:at.object,received:g.parsedType}),gn}let{status:r,ctx:o}=this._processInputParams(t),{shape:i,keys:a}=this._getCached(),c=[];if(!(this._def.catchall instanceof ff&&this._def.unknownKeys==="strip"))for(let g in o.data)a.includes(g)||c.push(g);let d=[];for(let g of a){let h=i[g],S=o.data[g];d.push({key:{status:"valid",value:g},value:h._parse(new Wd(o,S,o.path,g)),alwaysSet:g in o.data})}if(this._def.catchall instanceof ff){let g=this._def.unknownKeys;if(g==="passthrough")for(let h of c)d.push({key:{status:"valid",value:h},value:{status:"valid",value:o.data[h]}});else if(g==="strict")c.length>0&&(ut(o,{code:Ve.unrecognized_keys,keys:c}),r.dirty());else if(g!=="strip")throw new Error("Internal ZodObject error: invalid unknownKeys value.")}else{let g=this._def.catchall;for(let h of c){let S=o.data[h];d.push({key:{status:"valid",value:h},value:g._parse(new Wd(o,S,o.path,h)),alwaysSet:h in o.data})}}return o.common.async?Promise.resolve().then(async()=>{let g=[];for(let h of d){let S=await h.key;g.push({key:S,value:await h.value,alwaysSet:h.alwaysSet})}return g}).then(g=>cu.mergeObjectSync(r,g)):cu.mergeObjectSync(r,d)}get shape(){return this._def.shape()}strict(t){return Pt.errToObj,new e({...this._def,unknownKeys:"strict",...t!==void 0?{errorMap:(n,r)=>{var o,i,a,c;let d=(a=(i=(o=this._def).errorMap)===null||i===void 0?void 0:i.call(o,n,r).message)!==null&&a!==void 0?a:r.defaultError;return n.code==="unrecognized_keys"?{message:(c=Pt.errToObj(t).message)!==null&&c!==void 0?c:d}:{message:d}}}:{}})}strip(){return new e({...this._def,unknownKeys:"strip"})}passthrough(){return new e({...this._def,unknownKeys:"passthrough"})}extend(t){return new e({...this._def,shape:()=>({...this._def.shape(),...t})})}merge(t){return new e({unknownKeys:t._def.unknownKeys,catchall:t._def.catchall,shape:()=>({...this._def.shape(),...t._def.shape()}),typeName:qt.ZodObject})}setKey(t,n){return this.augment({[t]:n})}catchall(t){return new e({...this._def,catchall:t})}pick(t){let n={};return _r.objectKeys(t).forEach(r=>{t[r]&&this.shape[r]&&(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}omit(t){let n={};return _r.objectKeys(this.shape).forEach(r=>{t[r]||(n[r]=this.shape[r])}),new e({...this._def,shape:()=>n})}deepPartial(){return uR(this)}partial(t){let n={};return _r.objectKeys(this.shape).forEach(r=>{let o=this.shape[r];t&&!t[r]?n[r]=o:n[r]=o.optional()}),new e({...this._def,shape:()=>n})}required(t){let n={};return _r.objectKeys(this.shape).forEach(r=>{if(t&&!t[r])n[r]=this.shape[r];else{let i=this.shape[r];for(;i instanceof pf;)i=i._def.innerType;n[r]=i}}),new e({...this._def,shape:()=>n})}keyof(){return tPe(_r.objectKeys(this.shape))}};lu.create=(e,t)=>new lu({shape:()=>e,unknownKeys:"strip",catchall:ff.create(),typeName:qt.ZodObject,...bn(t)});lu.strictCreate=(e,t)=>new lu({shape:()=>e,unknownKeys:"strict",catchall:ff.create(),typeName:qt.ZodObject,...bn(t)});lu.lazycreate=(e,t)=>new lu({shape:e,unknownKeys:"strip",catchall:ff.create(),typeName:qt.ZodObject,...bn(t)});wy=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=this._def.options;function o(i){for(let c of i)if(c.result.status==="valid")return c.result;for(let c of i)if(c.result.status==="dirty")return n.common.issues.push(...c.ctx.common.issues),c.result;let a=i.map(c=>new Gc(c.ctx.common.issues));return ut(n,{code:Ve.invalid_union,unionErrors:a}),gn}if(n.common.async)return Promise.all(r.map(async i=>{let a={...n,common:{...n.common,issues:[]},parent:null};return{result:await i._parseAsync({data:n.data,path:n.path,parent:a}),ctx:a}})).then(o);{let i,a=[];for(let d of r){let g={...n,common:{...n.common,issues:[]},parent:null},h=d._parseSync({data:n.data,path:n.path,parent:g});if(h.status==="valid")return h;h.status==="dirty"&&!i&&(i={result:h,ctx:g}),g.common.issues.length&&a.push(g.common.issues)}if(i)return n.common.issues.push(...i.ctx.common.issues),i.result;let c=a.map(d=>new Gc(d));return ut(n,{code:Ve.invalid_union,unionErrors:c}),gn}}get options(){return this._def.options}};wy.create=(e,t)=>new wy({options:e,typeName:qt.ZodUnion,...bn(t)});U3=e=>e instanceof My?U3(e.schema):e instanceof Hl?U3(e.innerType()):e instanceof Py?[e.value]:e instanceof Uy?e.options:e instanceof Ly?Object.keys(e.enum):e instanceof Qy?U3(e._def.innerType):e instanceof Ny?[void 0]:e instanceof Oy?[null]:null,G3=class e extends vn{_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.object)return ut(n,{code:Ve.invalid_type,expected:at.object,received:n.parsedType}),gn;let r=this.discriminator,o=n.data[r],i=this.optionsMap.get(o);return i?n.common.async?i._parseAsync({data:n.data,path:n.path,parent:n}):i._parseSync({data:n.data,path:n.path,parent:n}):(ut(n,{code:Ve.invalid_union_discriminator,options:Array.from(this.optionsMap.keys()),path:[r]}),gn)}get discriminator(){return this._def.discriminator}get options(){return this._def.options}get optionsMap(){return this._def.optionsMap}static create(t,n,r){let o=new Map;for(let i of n){let a=U3(i.shape[t]);if(!a)throw new Error(`A discriminator value for key \`${t}\` could not be extracted from all schema options`);for(let c of a){if(o.has(c))throw new Error(`Discriminator property ${String(t)} has duplicate value ${String(c)}`);o.set(c,i)}}return new e({typeName:qt.ZodDiscriminatedUnion,discriminator:t,options:n,optionsMap:o,...bn(r)})}};ky=class extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=(i,a)=>{if(iZ(i)||iZ(a))return gn;let c=sZ(i.value,a.value);return c.valid?((aZ(i)||aZ(a))&&n.dirty(),{status:n.value,value:c.data}):(ut(r,{code:Ve.invalid_intersection_types}),gn)};return r.common.async?Promise.all([this._def.left._parseAsync({data:r.data,path:r.path,parent:r}),this._def.right._parseAsync({data:r.data,path:r.path,parent:r})]).then(([i,a])=>o(i,a)):o(this._def.left._parseSync({data:r.data,path:r.path,parent:r}),this._def.right._parseSync({data:r.data,path:r.path,parent:r}))}};ky.create=(e,t,n)=>new ky({left:e,right:t,typeName:qt.ZodIntersection,...bn(n)});GA=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.array)return ut(r,{code:Ve.invalid_type,expected:at.array,received:r.parsedType}),gn;if(r.data.length<this._def.items.length)return ut(r,{code:Ve.too_small,minimum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),gn;!this._def.rest&&r.data.length>this._def.items.length&&(ut(r,{code:Ve.too_big,maximum:this._def.items.length,inclusive:!0,exact:!1,type:"array"}),n.dirty());let i=[...r.data].map((a,c)=>{let d=this._def.items[c]||this._def.rest;return d?d._parse(new Wd(r,a,r.path,c)):null}).filter(a=>!!a);return r.common.async?Promise.all(i).then(a=>cu.mergeArray(n,a)):cu.mergeArray(n,i)}get items(){return this._def.items}rest(t){return new e({...this._def,rest:t})}};GA.create=(e,t)=>{if(!Array.isArray(e))throw new Error("You must pass an array of schemas to z.tuple([ ... ])");return new GA({items:e,typeName:qt.ZodTuple,rest:null,...bn(t)})};j3=class e extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.object)return ut(r,{code:Ve.invalid_type,expected:at.object,received:r.parsedType}),gn;let o=[],i=this._def.keyType,a=this._def.valueType;for(let c in r.data)o.push({key:i._parse(new Wd(r,c,r.path,c)),value:a._parse(new Wd(r,r.data[c],r.path,c))});return r.common.async?cu.mergeObjectAsync(n,o):cu.mergeObjectSync(n,o)}get element(){return this._def.valueType}static create(t,n,r){return n instanceof vn?new e({keyType:t,valueType:n,typeName:qt.ZodRecord,...bn(r)}):new e({keyType:dE.create(),valueType:t,typeName:qt.ZodRecord,...bn(n)})}},dR=class extends vn{get keySchema(){return this._def.keyType}get valueSchema(){return this._def.valueType}_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.map)return ut(r,{code:Ve.invalid_type,expected:at.map,received:r.parsedType}),gn;let o=this._def.keyType,i=this._def.valueType,a=[...r.data.entries()].map(([c,d],g)=>({key:o._parse(new Wd(r,c,r.path,[g,"key"])),value:i._parse(new Wd(r,d,r.path,[g,"value"]))}));if(r.common.async){let c=new Map;return Promise.resolve().then(async()=>{for(let d of a){let g=await d.key,h=await d.value;if(g.status==="aborted"||h.status==="aborted")return gn;(g.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(g.value,h.value)}return{status:n.value,value:c}})}else{let c=new Map;for(let d of a){let g=d.key,h=d.value;if(g.status==="aborted"||h.status==="aborted")return gn;(g.status==="dirty"||h.status==="dirty")&&n.dirty(),c.set(g.value,h.value)}return{status:n.value,value:c}}}};dR.create=(e,t,n)=>new dR({valueType:t,keyType:e,typeName:qt.ZodMap,...bn(n)});pR=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.parsedType!==at.set)return ut(r,{code:Ve.invalid_type,expected:at.set,received:r.parsedType}),gn;let o=this._def;o.minSize!==null&&r.data.size<o.minSize.value&&(ut(r,{code:Ve.too_small,minimum:o.minSize.value,type:"set",inclusive:!0,exact:!1,message:o.minSize.message}),n.dirty()),o.maxSize!==null&&r.data.size>o.maxSize.value&&(ut(r,{code:Ve.too_big,maximum:o.maxSize.value,type:"set",inclusive:!0,exact:!1,message:o.maxSize.message}),n.dirty());let i=this._def.valueType;function a(d){let g=new Set;for(let h of d){if(h.status==="aborted")return gn;h.status==="dirty"&&n.dirty(),g.add(h.value)}return{status:n.value,value:g}}let c=[...r.data.values()].map((d,g)=>i._parse(new Wd(r,d,r.path,g)));return r.common.async?Promise.all(c).then(d=>a(d)):a(c)}min(t,n){return new e({...this._def,minSize:{value:t,message:Pt.toString(n)}})}max(t,n){return new e({...this._def,maxSize:{value:t,message:Pt.toString(n)}})}size(t,n){return this.min(t,n).max(t,n)}nonempty(t){return this.min(1,t)}};pR.create=(e,t)=>new pR({valueType:e,minSize:null,maxSize:null,typeName:qt.ZodSet,...bn(t)});H3=class e extends vn{constructor(){super(...arguments),this.validate=this.implement}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.function)return ut(n,{code:Ve.invalid_type,expected:at.function,received:n.parsedType}),gn;function r(c,d){return Q3({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,L3(),vO].filter(g=>!!g),issueData:{code:Ve.invalid_arguments,argumentsError:d}})}function o(c,d){return Q3({data:c,path:n.path,errorMaps:[n.common.contextualErrorMap,n.schemaErrorMap,L3(),vO].filter(g=>!!g),issueData:{code:Ve.invalid_return_type,returnTypeError:d}})}let i={errorMap:n.common.contextualErrorMap},a=n.data;if(this._def.returns instanceof fE){let c=this;return Ku(async function(...d){let g=new Gc([]),h=await c._def.args.parseAsync(d,i).catch(C=>{throw g.addIssue(r(d,C)),g}),S=await Reflect.apply(a,this,h);return await c._def.returns._def.type.parseAsync(S,i).catch(C=>{throw g.addIssue(o(S,C)),g})})}else{let c=this;return Ku(function(...d){let g=c._def.args.safeParse(d,i);if(!g.success)throw new Gc([r(d,g.error)]);let h=Reflect.apply(a,this,g.data),S=c._def.returns.safeParse(h,i);if(!S.success)throw new Gc([o(h,S.error)]);return S.data})}}parameters(){return this._def.args}returnType(){return this._def.returns}args(...t){return new e({...this._def,args:GA.create(t).rest(Og.create())})}returns(t){return new e({...this._def,returns:t})}implement(t){return this.parse(t)}strictImplement(t){return this.parse(t)}static create(t,n,r){return new e({args:t||GA.create([]).rest(Og.create()),returns:n||Og.create(),typeName:qt.ZodFunction,...bn(r)})}},My=class extends vn{get schema(){return this._def.getter()}_parse(t){let{ctx:n}=this._processInputParams(t);return this._def.getter()._parse({data:n.data,path:n.path,parent:n})}};My.create=(e,t)=>new My({getter:e,typeName:qt.ZodLazy,...bn(t)});Py=class extends vn{_parse(t){if(t.data!==this._def.value){let n=this._getOrReturnCtx(t);return ut(n,{received:n.data,code:Ve.invalid_literal,expected:this._def.value}),gn}return{status:"valid",value:t.data}}get value(){return this._def.value}};Py.create=(e,t)=>new Py({value:e,typeName:qt.ZodLiteral,...bn(t)});Uy=class e extends vn{_parse(t){if(typeof t.data!="string"){let n=this._getOrReturnCtx(t),r=this._def.values;return ut(n,{expected:_r.joinValues(r),received:n.parsedType,code:Ve.invalid_type}),gn}if(this._def.values.indexOf(t.data)===-1){let n=this._getOrReturnCtx(t),r=this._def.values;return ut(n,{received:n.data,code:Ve.invalid_enum_value,options:r}),gn}return Ku(t.data)}get options(){return this._def.values}get enum(){let t={};for(let n of this._def.values)t[n]=n;return t}get Values(){let t={};for(let n of this._def.values)t[n]=n;return t}get Enum(){let t={};for(let n of this._def.values)t[n]=n;return t}extract(t){return e.create(t)}exclude(t){return e.create(this.options.filter(n=>!t.includes(n)))}};Uy.create=tPe;Ly=class extends vn{_parse(t){let n=_r.getValidEnumValues(this._def.values),r=this._getOrReturnCtx(t);if(r.parsedType!==at.string&&r.parsedType!==at.number){let o=_r.objectValues(n);return ut(r,{expected:_r.joinValues(o),received:r.parsedType,code:Ve.invalid_type}),gn}if(n.indexOf(t.data)===-1){let o=_r.objectValues(n);return ut(r,{received:r.data,code:Ve.invalid_enum_value,options:o}),gn}return Ku(t.data)}get enum(){return this._def.values}};Ly.create=(e,t)=>new Ly({values:e,typeName:qt.ZodNativeEnum,...bn(t)});fE=class extends vn{unwrap(){return this._def.type}_parse(t){let{ctx:n}=this._processInputParams(t);if(n.parsedType!==at.promise&&n.common.async===!1)return ut(n,{code:Ve.invalid_type,expected:at.promise,received:n.parsedType}),gn;let r=n.parsedType===at.promise?n.data:Promise.resolve(n.data);return Ku(r.then(o=>this._def.type.parseAsync(o,{path:n.path,errorMap:n.common.contextualErrorMap})))}};fE.create=(e,t)=>new fE({type:e,typeName:qt.ZodPromise,...bn(t)});Hl=class extends vn{innerType(){return this._def.schema}sourceType(){return this._def.schema._def.typeName===qt.ZodEffects?this._def.schema.sourceType():this._def.schema}_parse(t){let{status:n,ctx:r}=this._processInputParams(t),o=this._def.effect||null,i={addIssue:a=>{ut(r,a),a.fatal?n.abort():n.dirty()},get path(){return r.path}};if(i.addIssue=i.addIssue.bind(i),o.type==="preprocess"){let a=o.transform(r.data,i);return r.common.issues.length?{status:"dirty",value:r.data}:r.common.async?Promise.resolve(a).then(c=>this._def.schema._parseAsync({data:c,path:r.path,parent:r})):this._def.schema._parseSync({data:a,path:r.path,parent:r})}if(o.type==="refinement"){let a=c=>{let d=o.refinement(c,i);if(r.common.async)return Promise.resolve(d);if(d instanceof Promise)throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");return c};if(r.common.async===!1){let c=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});return c.status==="aborted"?gn:(c.status==="dirty"&&n.dirty(),a(c.value),{status:n.value,value:c.value})}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(c=>c.status==="aborted"?gn:(c.status==="dirty"&&n.dirty(),a(c.value).then(()=>({status:n.value,value:c.value}))))}if(o.type==="transform")if(r.common.async===!1){let a=this._def.schema._parseSync({data:r.data,path:r.path,parent:r});if(!RO(a))return a;let c=o.transform(a.value,i);if(c instanceof Promise)throw new Error("Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.");return{status:n.value,value:c}}else return this._def.schema._parseAsync({data:r.data,path:r.path,parent:r}).then(a=>RO(a)?Promise.resolve(o.transform(a.value,i)).then(c=>({status:n.value,value:c})):a);_r.assertNever(o)}};Hl.create=(e,t,n)=>new Hl({schema:e,typeName:qt.ZodEffects,effect:t,...bn(n)});Hl.createWithPreprocess=(e,t,n)=>new Hl({schema:t,effect:{type:"preprocess",transform:e},typeName:qt.ZodEffects,...bn(n)});pf=class extends vn{_parse(t){return this._getType(t)===at.undefined?Ku(void 0):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};pf.create=(e,t)=>new pf({innerType:e,typeName:qt.ZodOptional,...bn(t)});kg=class extends vn{_parse(t){return this._getType(t)===at.null?Ku(null):this._def.innerType._parse(t)}unwrap(){return this._def.innerType}};kg.create=(e,t)=>new kg({innerType:e,typeName:qt.ZodNullable,...bn(t)});Qy=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return n.parsedType===at.undefined&&(r=this._def.defaultValue()),this._def.innerType._parse({data:r,path:n.path,parent:n})}removeDefault(){return this._def.innerType}};Qy.create=(e,t)=>new Qy({innerType:e,typeName:qt.ZodDefault,defaultValue:typeof t.default=="function"?t.default:()=>t.default,...bn(t)});fR=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r={...n,common:{...n.common,issues:[]}},o=this._def.innerType._parse({data:r.data,path:r.path,parent:{...r}});return F3(o)?o.then(i=>({status:"valid",value:i.status==="valid"?i.value:this._def.catchValue({get error(){return new Gc(r.common.issues)},input:r.data})})):{status:"valid",value:o.status==="valid"?o.value:this._def.catchValue({get error(){return new Gc(r.common.issues)},input:r.data})}}removeCatch(){return this._def.innerType}};fR.create=(e,t)=>new fR({innerType:e,typeName:qt.ZodCatch,catchValue:typeof t.catch=="function"?t.catch:()=>t.catch,...bn(t)});AR=class extends vn{_parse(t){if(this._getType(t)!==at.nan){let r=this._getOrReturnCtx(t);return ut(r,{code:Ve.invalid_type,expected:at.nan,received:r.parsedType}),gn}return{status:"valid",value:t.data}}};AR.create=e=>new AR({typeName:qt.ZodNaN,...bn(e)});Lbt=Symbol("zod_brand"),z3=class extends vn{_parse(t){let{ctx:n}=this._processInputParams(t),r=n.data;return this._def.type._parse({data:r,path:n.path,parent:n})}unwrap(){return this._def.type}},xO=class e extends vn{_parse(t){let{status:n,ctx:r}=this._processInputParams(t);if(r.common.async)return(async()=>{let i=await this._def.in._parseAsync({data:r.data,path:r.path,parent:r});return i.status==="aborted"?gn:i.status==="dirty"?(n.dirty(),ePe(i.value)):this._def.out._parseAsync({data:i.value,path:r.path,parent:r})})();{let o=this._def.in._parseSync({data:r.data,path:r.path,parent:r});return o.status==="aborted"?gn:o.status==="dirty"?(n.dirty(),{status:"dirty",value:o.value}):this._def.out._parseSync({data:o.value,path:r.path,parent:r})}}static create(t,n){return new e({in:t,out:n,typeName:qt.ZodPipeline})}},mR=class extends vn{_parse(t){let n=this._def.innerType._parse(t);return RO(n)&&(n.value=Object.freeze(n.value)),n}};mR.create=(e,t)=>new mR({innerType:e,typeName:qt.ZodReadonly,...bn(t)});nPe=(e,t={},n)=>e?pE.create().superRefine((r,o)=>{var i,a;if(!e(r)){let c=typeof t=="function"?t(r):typeof t=="string"?{message:t}:t,d=(a=(i=c.fatal)!==null&&i!==void 0?i:n)!==null&&a!==void 0?a:!0,g=typeof c=="string"?{message:c}:c;o.addIssue({code:"custom",...g,fatal:d})}}):pE.create(),Qbt={object:lu.lazycreate};(function(e){e.ZodString="ZodString",e.ZodNumber="ZodNumber",e.ZodNaN="ZodNaN",e.ZodBigInt="ZodBigInt",e.ZodBoolean="ZodBoolean",e.ZodDate="ZodDate",e.ZodSymbol="ZodSymbol",e.ZodUndefined="ZodUndefined",e.ZodNull="ZodNull",e.ZodAny="ZodAny",e.ZodUnknown="ZodUnknown",e.ZodNever="ZodNever",e.ZodVoid="ZodVoid",e.ZodArray="ZodArray",e.ZodObject="ZodObject",e.ZodUnion="ZodUnion",e.ZodDiscriminatedUnion="ZodDiscriminatedUnion",e.ZodIntersection="ZodIntersection",e.ZodTuple="ZodTuple",e.ZodRecord="ZodRecord",e.ZodMap="ZodMap",e.ZodSet="ZodSet",e.ZodFunction="ZodFunction",e.ZodLazy="ZodLazy",e.ZodLiteral="ZodLiteral",e.ZodEnum="ZodEnum",e.ZodEffects="ZodEffects",e.ZodNativeEnum="ZodNativeEnum",e.ZodOptional="ZodOptional",e.ZodNullable="ZodNullable",e.ZodDefault="ZodDefault",e.ZodCatch="ZodCatch",e.ZodPromise="ZodPromise",e.ZodBranded="ZodBranded",e.ZodPipeline="ZodPipeline",e.ZodReadonly="ZodReadonly"})(qt||(qt={}));Fbt=(e,t={message:`Input not instance of ${e.name}`})=>nPe(n=>n instanceof e,t),rPe=dE.create,oPe=Ry.create,Gbt=AR.create,jbt=xy.create,iPe=Dy.create,Hbt=By.create,zbt=cR.create,$bt=Ny.create,Vbt=Oy.create,qbt=pE.create,Ybt=Og.create,Kbt=ff.create,Jbt=lR.create,Zbt=wg.create,Wbt=lu.create,Xbt=lu.strictCreate,evt=wy.create,tvt=G3.create,nvt=ky.create,rvt=GA.create,ovt=j3.create,ivt=dR.create,avt=pR.create,svt=H3.create,uvt=My.create,cvt=Py.create,lvt=Uy.create,dvt=Ly.create,pvt=fE.create,ZMe=Hl.create,fvt=pf.create,Avt=kg.create,mvt=Hl.createWithPreprocess,gvt=xO.create,hvt=()=>rPe().optional(),_vt=()=>oPe().optional(),Evt=()=>iPe().optional(),Svt={string:e=>dE.create({...e,coerce:!0}),number:e=>Ry.create({...e,coerce:!0}),boolean:e=>Dy.create({...e,coerce:!0}),bigint:e=>xy.create({...e,coerce:!0}),date:e=>By.create({...e,coerce:!0})},yvt=gn,uu=Object.freeze({__proto__:null,defaultErrorMap:vO,setErrorMap:bbt,getErrorMap:L3,makeIssue:Q3,EMPTY_PATH:vbt,addIssueToContext:ut,ParseStatus:cu,INVALID:gn,DIRTY:ePe,OK:Ku,isAborted:iZ,isDirty:aZ,isValid:RO,isAsync:F3,get util(){return _r},get objectUtil(){return oZ},ZodParsedType:at,getParsedType:lE,ZodType:vn,ZodString:dE,ZodNumber:Ry,ZodBigInt:xy,ZodBoolean:Dy,ZodDate:By,ZodSymbol:cR,ZodUndefined:Ny,ZodNull:Oy,ZodAny:pE,ZodUnknown:Og,ZodNever:ff,ZodVoid:lR,ZodArray:wg,ZodObject:lu,ZodUnion:wy,ZodDiscriminatedUnion:G3,ZodIntersection:ky,ZodTuple:GA,ZodRecord:j3,ZodMap:dR,ZodSet:pR,ZodFunction:H3,ZodLazy:My,ZodLiteral:Py,ZodEnum:Uy,ZodNativeEnum:Ly,ZodPromise:fE,ZodEffects:Hl,ZodTransformer:Hl,ZodOptional:pf,ZodNullable:kg,ZodDefault:Qy,ZodCatch:fR,ZodNaN:AR,BRAND:Lbt,ZodBranded:z3,ZodPipeline:xO,ZodReadonly:mR,custom:nPe,Schema:vn,ZodSchema:vn,late:Qbt,get ZodFirstPartyTypeKind(){return qt},coerce:Svt,any:qbt,array:Zbt,bigint:jbt,boolean:iPe,date:Hbt,discriminatedUnion:tvt,effect:ZMe,enum:lvt,function:svt,instanceof:Fbt,intersection:nvt,lazy:uvt,literal:cvt,map:ivt,nan:Gbt,nativeEnum:dvt,never:Kbt,null:Vbt,nullable:Avt,number:oPe,object:Wbt,oboolean:Evt,onumber:_vt,optional:fvt,ostring:hvt,pipeline:gvt,preprocess:mvt,promise:pvt,record:ovt,set:avt,strictObject:Xbt,string:rPe,symbol:zbt,transformer:ZMe,tuple:rvt,undefined:$bt,union:evt,unknown:Ybt,void:Jbt,NEVER:yvt,ZodIssueCode:Ve,quotelessJson:Cbt,ZodError:Gc}),Tvt=e=>typeof e?.safeParse=="function",nZ=e=>typeof e?.passthrough=="function",Ivt=(e,t)=>nZ(e)?nZ(t)?e.merge(t):e:nZ(t)?t:Object.assign({},e,t),Zd=uu.object({name:uu.literal("ZodError"),issues:uu.array(uu.object({path:uu.array(uu.union([uu.string(),uu.number()])),message:uu.string().optional(),code:uu.nativeEnum(uu.ZodIssueCode)}).catchall(uu.any()))}),uZ=class extends Error{constructor(t){let n=JSON.stringify(t,(r,o)=>typeof o=="bigint"?o.toString():o,2);super(n),this.name="ValidationError",this.issues=t}toString(){return this.message}},VCn=uu.object({message:uu.literal("Request validation failed"),pathParameterErrors:Zd.nullable(),headerErrors:Zd.nullable(),queryParameterErrors:Zd.nullable(),bodyErrors:Zd.nullable()}),qCn=uu.object({pathParameterErrors:Zd.nullable(),headerErrors:Zd.nullable(),queryParameterErrors:Zd.nullable(),bodyErrors:Zd.nullable()}),YCn=uu.object({paramsResult:Zd.nullable(),headersResult:Zd.nullable(),queryResult:Zd.nullable(),bodyResult:Zd.nullable()}),aPe="zod-ts-rest-polyfill",Cvt=e=>{if(!e)return!1;let t=e?.["~standard"];return t?t.version===1&&typeof t.validate=="function":!1},bvt=e=>Cvt(e)?e:Tvt(e)?(Object.assign(e,{"~standard":{vendor:aPe,version:1,validate:r=>{let o=e.safeParse(r);return o.success?{value:o.data}:{issues:o.error.issues}}}}),e):null,vvt=(e,t)=>e?t?e instanceof lu&&t instanceof lu?Ivt(e,t):{...e,...t}:e:t,Rvt=(e,t,{passThroughExtraKeys:n=!1}={})=>{let r=t["~standard"].validate(e);if(r instanceof Promise)throw new Error("Schema validation must be synchronous");return r.issues?t["~standard"].vendor===aPe?{error:new Gc(r.issues)}:{error:new uZ(r.issues)}:n&&typeof e=="object"&&r.value?{value:{...e,...r.value}}:{value:r.value}},sPe=Symbol("ContractNoBody"),uPe=e=>"method"in e&&"path"in e,cPe=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>{var o,i,a;return uPe(r)?[n,{...r,path:t?.pathPrefix?t.pathPrefix+r.path:r.path,headers:vvt(t?.baseHeaders,r.headers),strictStatusCodes:(o=r.strictStatusCodes)!==null&&o!==void 0?o:t?.strictStatusCodes,validateResponseOnClient:(i=r.validateResponseOnClient)!==null&&i!==void 0?i:t?.validateResponseOnClient,responses:{...t?.commonResponses,...r.responses},metadata:t?.metadata?{...t?.metadata,...(a=r.metadata)!==null&&a!==void 0?a:{}}:r.metadata}]:[n,cPe(r,t)]})),rZ=Symbol("ContractPlainType"),os=()=>({router:(e,t)=>cPe(e,t),query:e=>e,mutation:e=>e,responses:e=>e,response:()=>rZ,body:()=>rZ,type:()=>rZ,otherResponse:({contentType:e,body:t})=>({contentType:e,body:t}),noBody:()=>sPe}),xvt=({path:e,params:t})=>{let n=t;return e.replace(/\/?:([^/?]+)\??/g,(r,o)=>n[o]?`${r.startsWith("/")?"/":""}${n[o]}`:"")},Dvt=(e,t=!1)=>{let n=t?Bvt(e):Nvt(e);return n?.length>0?"?"+n:""},Bvt=e=>e?Object.entries(e).filter(([,t])=>t!==void 0).map(([t,n])=>{let r;return typeof n=="string"&&!["true","false","null"].includes(n.trim())&&isNaN(Number(n))?r=n:r=JSON.stringify(n),`${encodeURIComponent(t)}=${encodeURIComponent(r)}`}).join("&"):"",Nvt=e=>e?Object.keys(e).flatMap(t=>cZ(t,e[t])).map(([t,n])=>`${encodeURIComponent(t)}=${encodeURIComponent(n)}`).join("&"):"",cZ=(e,t)=>Array.isArray(t)?t.flatMap((n,r)=>cZ(`${e}[${r}]`,n)):t instanceof Date?[[`${e}`,t.toISOString()]]:t===null?[[`${e}`,""]]:t===void 0?[]:typeof t=="object"?Object.keys(t).flatMap(n=>cZ(`${e}[${n}]`,t[n])):[[`${e}`,`${t}`]],lZ=class extends Error{constructor(t,n){let r=n.join(",");super(`Server returned unexpected response. Expected one of: ${r} got: ${t.status}`),this.response=t}},dZ=async({route:e,path:t,method:n,headers:r,body:o,validateResponse:i,fetchOptions:a})=>{let c=await fetch(t,{...a,method:n,headers:r,body:o}),d=c.headers.get("content-type");if(d?.includes("application/")&&d?.includes("json")){let g=e.responses[c.status],h={status:c.status,body:g===sPe?void 0:await c.json(),headers:c.headers},S=bvt(g);if(S&&(i??e.validateResponseOnClient)){let y=Rvt(h.body,S);if(y.error)throw y.error;return{...h,body:y.value}}return h}return d?.includes("text/")?{status:c.status,body:await c.text(),headers:c.headers}:{status:c.status,body:await c.blob(),headers:c.headers}},Ovt=e=>{let t=new FormData,n=(r,o)=>{o instanceof File?t.append(r,o):t.append(r,JSON.stringify(o))};return Object.entries(e).forEach(([r,o])=>{if(Array.isArray(o))for(let i of o)n(r,i);else n(r,o)}),t},WMe=e=>Object.fromEntries(Object.entries(e).map(([t,n])=>[t.toLowerCase(),n])),wvt=e=>{let{path:t,clientArgs:n,route:r,body:o,query:i,extraInputArgs:a,headers:c,fetchOptions:d}=e,g=n.api||dZ,h=n.baseHeaders&&Object.fromEntries(Object.entries(n.baseHeaders).map(([C,v])=>typeof v=="function"?[C,v(e)]:[C,v])),S={...h&&WMe(h),...WMe(c)};Object.keys(S).forEach(C=>{S[C]===void 0&&delete S[C]});let y={route:r,path:t,method:r.method,headers:S,body:void 0,rawBody:o,rawQuery:i,contentType:void 0,validateResponse:n.validateResponse,fetchOptions:{...n.credentials&&{credentials:n.credentials},...d},...d?.signal&&{signal:d.signal},...d?.cache&&{cache:d.cache},...d&&"next"in d&&!!d?.next&&{next:d.next}};return r.method!=="GET"&&("contentType"in r&&r.contentType==="multipart/form-data"?y={...y,contentType:"multipart/form-data",body:o instanceof FormData?o:Ovt(o)}:"contentType"in r&&r.contentType==="application/x-www-form-urlencoded"?y={...y,contentType:"application/x-www-form-urlencoded",headers:{"content-type":"application/x-www-form-urlencoded",...y.headers},body:typeof o=="string"?o:new URLSearchParams(o)}:o!=null&&(y={...y,contentType:"application/json",headers:{"content-type":"application/json",...y.headers},body:JSON.stringify(o)})),g({...y,...a})},kvt=(e,t,n)=>{let{query:r,params:o,body:i,headers:a,extraHeaders:c,overrideClientOptions:d,fetchOptions:g,cache:h,next:S,...y}=n||{},C={...t,...d},v=typeof o=="object"?Object.fromEntries(Object.entries(o).map(([N,k])=>[N,String(k)])):{};return{path:Mvt(r,C.baseUrl,v,e,!!C.jsonQuery),clientArgs:C,route:e,body:i,query:r,extraInputArgs:y,fetchOptions:{...h&&{cache:h},...S&&{next:S},...g},headers:{...c,...a}}},Mvt=(e,t,n,r,o)=>{let i=xvt({path:r.path,params:n}),a=Dvt(e,o);return t.endsWith("/")&&i.startsWith("/")?`${t}${i.substring(1)}${a}`:`${t}${i}${a}`},Pvt=(e,t)=>{let n=Object.keys(e.responses);return async r=>{let o=kvt(e,t,r),i=await wvt(o);if(!t.throwOnUnknownStatus||n.includes(i.status.toString()))return i;throw new lZ(i,n)}},pZ=(e,t)=>Object.fromEntries(Object.entries(e).map(([n,r])=>uPe(r)?[n,Pvt(r,t)]:[n,pZ(r,t)]))});function ne(e,t,n){function r(c,d){if(c._zod||Object.defineProperty(c,"_zod",{value:{def:d,constr:a,traits:new Set},enumerable:!1}),c._zod.traits.has(e))return;c._zod.traits.add(e),t(c,d);let g=a.prototype,h=Object.keys(g);for(let S=0;S<h.length;S++){let y=h[S];y in c||(c[y]=g[y].bind(c))}}let o=n?.Parent??Object;class i extends o{}Object.defineProperty(i,"name",{value:e});function a(c){var d;let g=n?.Parent?new i:this;r(g,c),(d=g._zod).deferred??(d.deferred=[]);for(let h of g._zod.deferred)h();return g}return Object.defineProperty(a,"init",{value:r}),Object.defineProperty(a,Symbol.hasInstance,{value:c=>n?.Parent&&c instanceof n.Parent?!0:c?._zod?.traits?.has(e)}),Object.defineProperty(a,"name",{value:e}),a}function gi(e){return e&&Object.assign(Fy,e),Fy}var lPe,fZ,AZ,mf,AE,Fy,Gy=O(()=>{m();fZ=Object.freeze({status:"aborted"});AZ=Symbol("zod_brand"),mf=class extends Error{constructor(){super("Encountered Promise during synchronous parse. Use .parseAsync() instead.")}},AE=class extends Error{constructor(t){super(`Encountered unidirectional transform during encode: ${t}`),this.name="ZodEncodeError"}};(lPe=globalThis).__zod_globalConfig??(lPe.__zod_globalConfig={});Fy=globalThis.__zod_globalConfig});var Pe={};za(Pe,{BIGINT_FORMAT_RANGES:()=>CZ,Class:()=>gZ,NUMBER_FORMAT_RANGES:()=>IZ,aborted:()=>_E,allowsEval:()=>EZ,assert:()=>Gvt,assertEqual:()=>Uvt,assertIs:()=>Qvt,assertNever:()=>Fvt,assertNotEqual:()=>Lvt,assignProp:()=>gE,base64ToUint8Array:()=>pPe,base64urlToUint8Array:()=>oRt,cached:()=>hR,captureStackTrace:()=>V3,cleanEnum:()=>rRt,cleanRegex:()=>NO,clone:()=>Ju,cloneDef:()=>Hvt,createTransparentProxy:()=>Kvt,defineLazy:()=>Gn,esc:()=>$3,escapeRegex:()=>Xd,explicitlyAborted:()=>bZ,extend:()=>Wvt,finalizeIssue:()=>Zu,floatSafeRemainder:()=>hZ,getElementAtPath:()=>zvt,getEnumValues:()=>BO,getLengthableOrigin:()=>kO,getParsedType:()=>Yvt,getSizableOrigin:()=>wO,hexToUint8Array:()=>aRt,isObject:()=>jy,isPlainObject:()=>hE,issue:()=>_R,joinValues:()=>ue,jsonStringifyReplacer:()=>gR,merge:()=>eRt,mergeDefs:()=>Mg,normalizeParams:()=>ze,nullish:()=>mE,numKeys:()=>qvt,objectClone:()=>jvt,omit:()=>Zvt,optionalKeys:()=>TZ,parsedType:()=>we,partial:()=>tRt,pick:()=>Jvt,prefixIssues:()=>jc,primitiveTypes:()=>yZ,promiseAllObject:()=>$vt,propertyKeyTypes:()=>OO,randomString:()=>Vvt,required:()=>nRt,safeExtend:()=>Xvt,shallowClone:()=>SZ,slugify:()=>_Z,stringifyPrimitive:()=>Ne,uint8ArrayToBase64:()=>fPe,uint8ArrayToBase64url:()=>iRt,uint8ArrayToHex:()=>sRt,unwrapMessage:()=>DO});function Uvt(e){return e}function Lvt(e){return e}function Qvt(e){}function Fvt(e){throw new Error("Unexpected value in exhaustive check")}function Gvt(e){}function BO(e){let t=Object.values(e).filter(r=>typeof r=="number");return Object.entries(e).filter(([r,o])=>t.indexOf(+r)===-1).map(([r,o])=>o)}function ue(e,t="|"){return e.map(n=>Ne(n)).join(t)}function gR(e,t){return typeof t=="bigint"?t.toString():t}function hR(e){return{get value(){{let n=e();return Object.defineProperty(this,"value",{value:n}),n}throw new Error("cached value already set")}}}function mE(e){return e==null}function NO(e){let t=e.startsWith("^")?1:0,n=e.endsWith("$")?e.length-1:e.length;return e.slice(t,n)}function hZ(e,t){let n=e/t,r=Math.round(n),o=Number.EPSILON*Math.max(Math.abs(n),1);return Math.abs(n-r)<o?0:n-r}function Gn(e,t,n){let r;Object.defineProperty(e,t,{get(){if(r!==dPe)return r===void 0&&(r=dPe,r=n()),r},set(o){Object.defineProperty(e,t,{value:o})},configurable:!0})}function jvt(e){return Object.create(Object.getPrototypeOf(e),Object.getOwnPropertyDescriptors(e))}function gE(e,t,n){Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0})}function Mg(...e){let t={};for(let n of e){let r=Object.getOwnPropertyDescriptors(n);Object.assign(t,r)}return Object.defineProperties({},t)}function Hvt(e){return Mg(e._zod.def)}function zvt(e,t){return t?t.reduce((n,r)=>n?.[r],e):e}function $vt(e){let t=Object.keys(e),n=t.map(r=>e[r]);return Promise.all(n).then(r=>{let o={};for(let i=0;i<t.length;i++)o[t[i]]=r[i];return o})}function Vvt(e=10){let t="abcdefghijklmnopqrstuvwxyz",n="";for(let r=0;r<e;r++)n+=t[Math.floor(Math.random()*t.length)];return n}function $3(e){return JSON.stringify(e)}function _Z(e){return e.toLowerCase().trim().replace(/[^\w\s-]/g,"").replace(/[\s_-]+/g,"-").replace(/^-+|-+$/g,"")}function jy(e){return typeof e=="object"&&e!==null&&!Array.isArray(e)}function hE(e){if(jy(e)===!1)return!1;let t=e.constructor;if(t===void 0||typeof t!="function")return!0;let n=t.prototype;return!(jy(n)===!1||Object.prototype.hasOwnProperty.call(n,"isPrototypeOf")===!1)}function SZ(e){return hE(e)?{...e}:Array.isArray(e)?[...e]:e instanceof Map?new Map(e):e instanceof Set?new Set(e):e}function qvt(e){let t=0;for(let n in e)Object.prototype.hasOwnProperty.call(e,n)&&t++;return t}function Xd(e){return e.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")}function Ju(e,t,n){let r=new e._zod.constr(t??e._zod.def);return(!t||n?.parent)&&(r._zod.parent=e),r}function ze(e){let t=e;if(!t)return{};if(typeof t=="string")return{error:()=>t};if(t?.message!==void 0){if(t?.error!==void 0)throw new Error("Cannot specify both `message` and `error` params");t.error=t.message}return delete t.message,typeof t.error=="string"?{...t,error:()=>t.error}:t}function Kvt(e){let t;return new Proxy({},{get(n,r,o){return t??(t=e()),Reflect.get(t,r,o)},set(n,r,o,i){return t??(t=e()),Reflect.set(t,r,o,i)},has(n,r){return t??(t=e()),Reflect.has(t,r)},deleteProperty(n,r){return t??(t=e()),Reflect.deleteProperty(t,r)},ownKeys(n){return t??(t=e()),Reflect.ownKeys(t)},getOwnPropertyDescriptor(n,r){return t??(t=e()),Reflect.getOwnPropertyDescriptor(t,r)},defineProperty(n,r,o){return t??(t=e()),Reflect.defineProperty(t,r,o)}})}function Ne(e){return typeof e=="bigint"?e.toString()+"n":typeof e=="string"?`"${e}"`:`${e}`}function TZ(e){return Object.keys(e).filter(t=>e[t]._zod.optin==="optional"&&e[t]._zod.optout==="optional")}function Jvt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".pick() cannot be used on object schemas containing refinements");let i=Mg(e._zod.def,{get shape(){let a={};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&(a[c]=n.shape[c])}return gE(this,"shape",a),a},checks:[]});return Ju(e,i)}function Zvt(e,t){let n=e._zod.def,r=n.checks;if(r&&r.length>0)throw new Error(".omit() cannot be used on object schemas containing refinements");let i=Mg(e._zod.def,{get shape(){let a={...e._zod.def.shape};for(let c in t){if(!(c in n.shape))throw new Error(`Unrecognized key: "${c}"`);t[c]&&delete a[c]}return gE(this,"shape",a),a},checks:[]});return Ju(e,i)}function Wvt(e,t){if(!hE(t))throw new Error("Invalid input to extend: expected a plain object");let n=e._zod.def.checks;if(n&&n.length>0){let i=e._zod.def.shape;for(let a in t)if(Object.getOwnPropertyDescriptor(i,a)!==void 0)throw new Error("Cannot overwrite keys on object schemas containing refinements. Use `.safeExtend()` instead.")}let o=Mg(e._zod.def,{get shape(){let i={...e._zod.def.shape,...t};return gE(this,"shape",i),i}});return Ju(e,o)}function Xvt(e,t){if(!hE(t))throw new Error("Invalid input to safeExtend: expected a plain object");let n=Mg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t};return gE(this,"shape",r),r}});return Ju(e,n)}function eRt(e,t){if(e._zod.def.checks?.length)throw new Error(".merge() cannot be used on object schemas containing refinements. Use .safeExtend() instead.");let n=Mg(e._zod.def,{get shape(){let r={...e._zod.def.shape,...t._zod.def.shape};return gE(this,"shape",r),r},get catchall(){return t._zod.def.catchall},checks:t._zod.def.checks??[]});return Ju(e,n)}function tRt(e,t,n){let o=t._zod.def.checks;if(o&&o.length>0)throw new Error(".partial() cannot be used on object schemas containing refinements");let a=Mg(t._zod.def,{get shape(){let c=t._zod.def.shape,d={...c};if(n)for(let g in n){if(!(g in c))throw new Error(`Unrecognized key: "${g}"`);n[g]&&(d[g]=e?new e({type:"optional",innerType:c[g]}):c[g])}else for(let g in c)d[g]=e?new e({type:"optional",innerType:c[g]}):c[g];return gE(this,"shape",d),d},checks:[]});return Ju(t,a)}function nRt(e,t,n){let r=Mg(t._zod.def,{get shape(){let o=t._zod.def.shape,i={...o};if(n)for(let a in n){if(!(a in i))throw new Error(`Unrecognized key: "${a}"`);n[a]&&(i[a]=new e({type:"nonoptional",innerType:o[a]}))}else for(let a in o)i[a]=new e({type:"nonoptional",innerType:o[a]});return gE(this,"shape",i),i}});return Ju(t,r)}function _E(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue!==!0)return!0;return!1}function bZ(e,t=0){if(e.aborted===!0)return!0;for(let n=t;n<e.issues.length;n++)if(e.issues[n]?.continue===!1)return!0;return!1}function jc(e,t){return t.map(n=>{var r;return(r=n).path??(r.path=[]),n.path.unshift(e),n})}function DO(e){return typeof e=="string"?e:e?.message}function Zu(e,t,n){let r=e.message?e.message:DO(e.inst?._zod.def?.error?.(e))??DO(t?.error?.(e))??DO(n.customError?.(e))??DO(n.localeError?.(e))??"Invalid input",{inst:o,continue:i,input:a,...c}=e;return c.path??(c.path=[]),c.message=r,t?.reportInput&&(c.input=a),c}function wO(e){return e instanceof Set?"set":e instanceof Map?"map":e instanceof File?"file":"unknown"}function kO(e){return Array.isArray(e)?"array":typeof e=="string"?"string":"unknown"}function we(e){let t=typeof e;switch(t){case"number":return Number.isNaN(e)?"nan":"number";case"object":{if(e===null)return"null";if(Array.isArray(e))return"array";let n=e;if(n&&Object.getPrototypeOf(n)!==Object.prototype&&"constructor"in n&&n.constructor)return n.constructor.name}}return t}function _R(...e){let[t,n,r]=e;return typeof t=="string"?{message:t,code:"custom",input:n,inst:r}:{...t}}function rRt(e){return Object.entries(e).filter(([t,n])=>Number.isNaN(Number.parseInt(t,10))).map(t=>t[1])}function pPe(e){let t=atob(e),n=new Uint8Array(t.length);for(let r=0;r<t.length;r++)n[r]=t.charCodeAt(r);return n}function fPe(e){let t="";for(let n=0;n<e.length;n++)t+=String.fromCharCode(e[n]);return btoa(t)}function oRt(e){let t=e.replace(/-/g,"+").replace(/_/g,"/"),n="=".repeat((4-t.length%4)%4);return pPe(t+n)}function iRt(e){return fPe(e).replace(/\+/g,"-").replace(/\//g,"_").replace(/=/g,"")}function aRt(e){let t=e.replace(/^0x/,"");if(t.length%2!==0)throw new Error("Invalid hex string length");let n=new Uint8Array(t.length/2);for(let r=0;r<t.length;r+=2)n[r/2]=Number.parseInt(t.slice(r,r+2),16);return n}function sRt(e){return Array.from(e).map(t=>t.toString(16).padStart(2,"0")).join("")}var dPe,V3,EZ,Yvt,OO,yZ,IZ,CZ,gZ,Et=O(()=>{m();Gy();dPe=Symbol("evaluating");V3="captureStackTrace"in Error?Error.captureStackTrace:(...e)=>{};EZ=hR(()=>{if(Fy.jitless||typeof navigator<"u"&&navigator?.userAgent?.includes("Cloudflare"))return!1;try{let e=Function;return new e(""),!0}catch{return!1}});Yvt=e=>{let t=typeof e;switch(t){case"undefined":return"undefined";case"string":return"string";case"number":return Number.isNaN(e)?"nan":"number";case"boolean":return"boolean";case"function":return"function";case"bigint":return"bigint";case"symbol":return"symbol";case"object":return Array.isArray(e)?"array":e===null?"null":e.then&&typeof e.then=="function"&&e.catch&&typeof e.catch=="function"?"promise":typeof Map<"u"&&e instanceof Map?"map":typeof Set<"u"&&e instanceof Set?"set":typeof Date<"u"&&e instanceof Date?"date":typeof File<"u"&&e instanceof File?"file":"object";default:throw new Error(`Unknown data type: ${t}`)}},OO=new Set(["string","number","symbol"]),yZ=new Set(["string","number","bigint","boolean","symbol","undefined"]);IZ={safeint:[Number.MIN_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],int32:[-2147483648,2147483647],uint32:[0,4294967295],float32:[-34028234663852886e22,34028234663852886e22],float64:[-Number.MAX_VALUE,Number.MAX_VALUE]},CZ={int64:[BigInt("-9223372036854775808"),BigInt("9223372036854775807")],uint64:[BigInt(0),BigInt("18446744073709551615")]};gZ=class{constructor(...t){}}});function PO(e,t=n=>n.message){let n={},r=[];for(let o of e.issues)o.path.length>0?(n[o.path[0]]=n[o.path[0]]||[],n[o.path[0]].push(t(o))):r.push(t(o));return{formErrors:r,fieldErrors:n}}function UO(e,t=n=>n.message){let n={_errors:[]},r=(o,i=[])=>{for(let a of o.issues)if(a.code==="invalid_union"&&a.errors.length)a.errors.map(c=>r({issues:c},[...i,...a.path]));else if(a.code==="invalid_key")r({issues:a.issues},[...i,...a.path]);else if(a.code==="invalid_element")r({issues:a.issues},[...i,...a.path]);else{let c=[...i,...a.path];if(c.length===0)n._errors.push(t(a));else{let d=n,g=0;for(;g<c.length;){let h=c[g];g===c.length-1?(d[h]=d[h]||{_errors:[]},d[h]._errors.push(t(a))):d[h]=d[h]||{_errors:[]},d=d[h],g++}}}};return r(e),n}function vZ(e,t=n=>n.message){let n={errors:[]},r=(o,i=[])=>{var a,c;for(let d of o.issues)if(d.code==="invalid_union"&&d.errors.length)d.errors.map(g=>r({issues:g},[...i,...d.path]));else if(d.code==="invalid_key")r({issues:d.issues},[...i,...d.path]);else if(d.code==="invalid_element")r({issues:d.issues},[...i,...d.path]);else{let g=[...i,...d.path];if(g.length===0){n.errors.push(t(d));continue}let h=n,S=0;for(;S<g.length;){let y=g[S],C=S===g.length-1;typeof y=="string"?(h.properties??(h.properties={}),(a=h.properties)[y]??(a[y]={errors:[]}),h=h.properties[y]):(h.items??(h.items=[]),(c=h.items)[y]??(c[y]={errors:[]}),h=h.items[y]),C&&h.errors.push(t(d)),S++}}};return r(e),n}function mPe(e){let t=[],n=e.map(r=>typeof r=="object"?r.key:r);for(let r of n)typeof r=="number"?t.push(`[${r}]`):typeof r=="symbol"?t.push(`[${JSON.stringify(String(r))}]`):/[^\w$]/.test(r)?t.push(`[${JSON.stringify(r)}]`):(t.length&&t.push("."),t.push(r));return t.join("")}function RZ(e){let t=[],n=[...e.issues].sort((r,o)=>(r.path??[]).length-(o.path??[]).length);for(let r of n)t.push(`\u2716 ${r.message}`),r.path?.length&&t.push(` \u2192 at ${mPe(r.path)}`);return t.join(`
41
41
  `)}var APe,MO,Hc,xZ=O(()=>{m();Gy();Et();APe=(e,t)=>{e.name="$ZodError",Object.defineProperty(e,"_zod",{value:e._zod,enumerable:!1}),Object.defineProperty(e,"issues",{value:t,enumerable:!1}),e.message=JSON.stringify(t,gR,2),Object.defineProperty(e,"toString",{value:()=>e.message,enumerable:!1})},MO=ne("$ZodError",APe),Hc=ne("$ZodError",APe,{Parent:Error})});var ER,q3,SR,Y3,yR,DZ,TR,BZ,K3,cRt,J3,lRt,Z3,dRt,W3,pRt,X3,fRt,e6,ARt,t6,mRt,n6,gRt,NZ=O(()=>{m();Gy();xZ();Et();ER=e=>(t,n,r,o)=>{let i=r?{...r,async:!1}:{async:!1},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise)throw new mf;if(a.issues.length){let c=new(o?.Err??e)(a.issues.map(d=>Zu(d,i,gi())));throw V3(c,o?.callee),c}return a.value},q3=ER(Hc),SR=e=>async(t,n,r,o)=>{let i=r?{...r,async:!0}:{async:!0},a=t._zod.run({value:n,issues:[]},i);if(a instanceof Promise&&(a=await a),a.issues.length){let c=new(o?.Err??e)(a.issues.map(d=>Zu(d,i,gi())));throw V3(c,o?.callee),c}return a.value},Y3=SR(Hc),yR=e=>(t,n,r)=>{let o=r?{...r,async:!1}:{async:!1},i=t._zod.run({value:n,issues:[]},o);if(i instanceof Promise)throw new mf;return i.issues.length?{success:!1,error:new(e??MO)(i.issues.map(a=>Zu(a,o,gi())))}:{success:!0,data:i.value}},DZ=yR(Hc),TR=e=>async(t,n,r)=>{let o=r?{...r,async:!0}:{async:!0},i=t._zod.run({value:n,issues:[]},o);return i instanceof Promise&&(i=await i),i.issues.length?{success:!1,error:new e(i.issues.map(a=>Zu(a,o,gi())))}:{success:!0,data:i.value}},BZ=TR(Hc),K3=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return ER(e)(t,n,o)},cRt=K3(Hc),J3=e=>(t,n,r)=>ER(e)(t,n,r),lRt=J3(Hc),Z3=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return SR(e)(t,n,o)},dRt=Z3(Hc),W3=e=>async(t,n,r)=>SR(e)(t,n,r),pRt=W3(Hc),X3=e=>(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return yR(e)(t,n,o)},fRt=X3(Hc),e6=e=>(t,n,r)=>yR(e)(t,n,r),ARt=e6(Hc),t6=e=>async(t,n,r)=>{let o=r?{...r,direction:"backward"}:{direction:"backward"};return TR(e)(t,n,o)},mRt=t6(Hc),n6=e=>async(t,n,r)=>TR(e)(t,n,r),gRt=n6(Hc)});var zl={};za(zl,{base64:()=>qZ,base64url:()=>r6,bigint:()=>eW,boolean:()=>nW,browserEmail:()=>CRt,cidrv4:()=>$Z,cidrv6:()=>VZ,cuid:()=>OZ,cuid2:()=>wZ,date:()=>JZ,datetime:()=>WZ,domain:()=>RRt,duration:()=>LZ,e164:()=>KZ,email:()=>FZ,emoji:()=>GZ,extendedDuration:()=>hRt,guid:()=>QZ,hex:()=>xRt,hostname:()=>vRt,html5Email:()=>yRt,httpProtocol:()=>YZ,idnEmail:()=>IRt,integer:()=>tW,ipv4:()=>jZ,ipv6:()=>HZ,ksuid:()=>PZ,lowercase:()=>iW,mac:()=>zZ,md5_base64:()=>BRt,md5_base64url:()=>NRt,md5_hex:()=>DRt,nanoid:()=>UZ,null:()=>rW,number:()=>o6,rfc5322Email:()=>TRt,sha1_base64:()=>wRt,sha1_base64url:()=>kRt,sha1_hex:()=>ORt,sha256_base64:()=>PRt,sha256_base64url:()=>URt,sha256_hex:()=>MRt,sha384_base64:()=>QRt,sha384_base64url:()=>FRt,sha384_hex:()=>LRt,sha512_base64:()=>jRt,sha512_base64url:()=>HRt,sha512_hex:()=>GRt,string:()=>XZ,time:()=>ZZ,ulid:()=>kZ,undefined:()=>oW,unicodeEmail:()=>gPe,uppercase:()=>aW,uuid:()=>Hy,uuid4:()=>_Rt,uuid6:()=>ERt,uuid7:()=>SRt,xid:()=>MZ});function GZ(){return new RegExp(bRt,"u")}function _Pe(e){let t="(?:[01]\\d|2[0-3]):[0-5]\\d";return typeof e.precision=="number"?e.precision===-1?`${t}`:e.precision===0?`${t}:[0-5]\\d`:`${t}:[0-5]\\d\\.\\d{${e.precision}}`:`${t}(?::[0-5]\\d(?:\\.\\d+)?)?`}function ZZ(e){return new RegExp(`^${_Pe(e)}$`)}function WZ(e){let t=_Pe({precision:e.precision}),n=["Z"];e.local&&n.push(""),e.offset&&n.push("([+-](?:[01]\\d|2[0-3]):[0-5]\\d)");let r=`${t}(?:${n.join("|")})`;return new RegExp(`^${hPe}T(?:${r})$`)}function LO(e,t){return new RegExp(`^[A-Za-z0-9+/]{${e}}${t}$`)}function QO(e){return new RegExp(`^[A-Za-z0-9_-]{${e}}$`)}var OZ,wZ,kZ,MZ,PZ,UZ,LZ,hRt,QZ,Hy,_Rt,ERt,SRt,FZ,yRt,TRt,gPe,IRt,CRt,bRt,jZ,HZ,zZ,$Z,VZ,qZ,r6,vRt,RRt,YZ,KZ,hPe,JZ,XZ,eW,tW,o6,nW,rW,oW,iW,aW,xRt,DRt,BRt,NRt,ORt,wRt,kRt,MRt,PRt,URt,LRt,QRt,FRt,GRt,jRt,HRt,i6=O(()=>{m();Et();OZ=/^[cC][0-9a-z]{6,}$/,wZ=/^[0-9a-z]+$/,kZ=/^[0-9A-HJKMNP-TV-Za-hjkmnp-tv-z]{26}$/,MZ=/^[0-9a-vA-V]{20}$/,PZ=/^[A-Za-z0-9]{27}$/,UZ=/^[a-zA-Z0-9_-]{21}$/,LZ=/^P(?:(\d+W)|(?!.*W)(?=\d|T\d)(\d+Y)?(\d+M)?(\d+D)?(T(?=\d)(\d+H)?(\d+M)?(\d+([.,]\d+)?S)?)?)$/,hRt=/^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/,QZ=/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12})$/,Hy=e=>e?new RegExp(`^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-${e}[0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12})$`):/^([0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[1-8][0-9a-fA-F]{3}-[89abAB][0-9a-fA-F]{3}-[0-9a-fA-F]{12}|00000000-0000-0000-0000-000000000000|ffffffff-ffff-ffff-ffff-ffffffffffff)$/,_Rt=Hy(4),ERt=Hy(6),SRt=Hy(7),FZ=/^(?!\.)(?!.*\.\.)([A-Za-z0-9_'+\-\.]*)[A-Za-z0-9_+-]@([A-Za-z0-9][A-Za-z0-9\-]*\.)+[A-Za-z]{2,}$/,yRt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,TRt=/^(([^<>()\[\]\\.,;:\s@"]+(\.[^<>()\[\]\\.,;:\s@"]+)*)|(".+"))@((\[[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}])|(([a-zA-Z\-0-9]+\.)+[a-zA-Z]{2,}))$/,gPe=/^[^\s@"]{1,64}@[^\s@]{1,255}$/u,IRt=gPe,CRt=/^[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+@[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)*$/,bRt="^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$";jZ=/^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/,HZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:))$/,zZ=e=>{let t=Xd(e??":");return new RegExp(`^(?:[0-9A-F]{2}${t}){5}[0-9A-F]{2}$|^(?:[0-9a-f]{2}${t}){5}[0-9a-f]{2}$`)},$Z=/^((25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/([0-9]|[1-2][0-9]|3[0-2])$/,VZ=/^(([0-9a-fA-F]{1,4}:){7}[0-9a-fA-F]{1,4}|::|([0-9a-fA-F]{1,4})?::([0-9a-fA-F]{1,4}:?){0,6})\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/,qZ=/^$|^(?:[0-9a-zA-Z+/]{4})*(?:(?:[0-9a-zA-Z+/]{2}==)|(?:[0-9a-zA-Z+/]{3}=))?$/,r6=/^[A-Za-z0-9_-]*$/,vRt=/^(?=.{1,253}\.?$)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[-0-9a-zA-Z]{0,61}[0-9a-zA-Z])?)*\.?$/,RRt=/^([a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?\.)+[a-zA-Z]{2,}$/,YZ=/^https?$/,KZ=/^\+[1-9]\d{6,14}$/,hPe="(?:(?:\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-(?:(?:0[13578]|1[02])-(?:0[1-9]|[12]\\d|3[01])|(?:0[469]|11)-(?:0[1-9]|[12]\\d|30)|(?:02)-(?:0[1-9]|1\\d|2[0-8])))",JZ=new RegExp(`^${hPe}$`);XZ=e=>{let t=e?`[\\s\\S]{${e?.minimum??0},${e?.maximum??""}}`:"[\\s\\S]*";return new RegExp(`^${t}$`)},eW=/^-?\d+n?$/,tW=/^-?\d+$/,o6=/^-?\d+(?:\.\d+)?$/,nW=/^(?:true|false)$/i,rW=/^null$/i,oW=/^undefined$/i,iW=/^[^A-Z]*$/,aW=/^[^a-z]*$/,xRt=/^[0-9a-fA-F]*$/;DRt=/^[0-9a-fA-F]{32}$/,BRt=LO(22,"=="),NRt=QO(22),ORt=/^[0-9a-fA-F]{40}$/,wRt=LO(27,"="),kRt=QO(27),MRt=/^[0-9a-fA-F]{64}$/,PRt=LO(43,"="),URt=QO(43),LRt=/^[0-9a-fA-F]{96}$/,QRt=LO(64,""),FRt=QO(64),GRt=/^[0-9a-fA-F]{128}$/,jRt=LO(86,"=="),HRt=QO(86)});function EPe(e,t,n){e.issues.length&&t.issues.push(...jc(n,e.issues))}var qr,SPe,a6,s6,sW,uW,cW,lW,dW,pW,fW,AW,mW,IR,gW,hW,_W,EW,SW,yW,TW,IW,CW,u6=O(()=>{m();Gy();i6();Et();qr=ne("$ZodCheck",(e,t)=>{var n;e._zod??(e._zod={}),e._zod.def=t,(n=e._zod).onattach??(n.onattach=[])}),SPe={number:"number",bigint:"bigint",object:"date"},a6=ne("$ZodCheckLessThan",(e,t)=>{qr.init(e,t);let n=SPe[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.maximum:o.exclusiveMaximum)??Number.POSITIVE_INFINITY;t.value<i&&(t.inclusive?o.maximum=t.value:o.exclusiveMaximum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value<=t.value:r.value<t.value)||r.issues.push({origin:n,code:"too_big",maximum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),s6=ne("$ZodCheckGreaterThan",(e,t)=>{qr.init(e,t);let n=SPe[typeof t.value];e._zod.onattach.push(r=>{let o=r._zod.bag,i=(t.inclusive?o.minimum:o.exclusiveMinimum)??Number.NEGATIVE_INFINITY;t.value>i&&(t.inclusive?o.minimum=t.value:o.exclusiveMinimum=t.value)}),e._zod.check=r=>{(t.inclusive?r.value>=t.value:r.value>t.value)||r.issues.push({origin:n,code:"too_small",minimum:typeof t.value=="object"?t.value.getTime():t.value,input:r.value,inclusive:t.inclusive,inst:e,continue:!t.abort})}}),sW=ne("$ZodCheckMultipleOf",(e,t)=>{qr.init(e,t),e._zod.onattach.push(n=>{var r;(r=n._zod.bag).multipleOf??(r.multipleOf=t.value)}),e._zod.check=n=>{if(typeof n.value!=typeof t.value)throw new Error("Cannot mix number and bigint in multiple_of check.");(typeof n.value=="bigint"?n.value%t.value===BigInt(0):hZ(n.value,t.value)===0)||n.issues.push({origin:typeof n.value,code:"not_multiple_of",divisor:t.value,input:n.value,inst:e,continue:!t.abort})}}),uW=ne("$ZodCheckNumberFormat",(e,t)=>{qr.init(e,t),t.format=t.format||"float64";let n=t.format?.includes("int"),r=n?"int":"number",[o,i]=IZ[t.format];e._zod.onattach.push(a=>{let c=a._zod.bag;c.format=t.format,c.minimum=o,c.maximum=i,n&&(c.pattern=tW)}),e._zod.check=a=>{let c=a.value;if(n){if(!Number.isInteger(c)){a.issues.push({expected:r,format:t.format,code:"invalid_type",continue:!1,input:c,inst:e});return}if(!Number.isSafeInteger(c)){c>0?a.issues.push({input:c,code:"too_big",maximum:Number.MAX_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort}):a.issues.push({input:c,code:"too_small",minimum:Number.MIN_SAFE_INTEGER,note:"Integers must be within the safe integer range.",inst:e,origin:r,inclusive:!0,continue:!t.abort});return}}c<o&&a.issues.push({origin:"number",input:c,code:"too_small",minimum:o,inclusive:!0,inst:e,continue:!t.abort}),c>i&&a.issues.push({origin:"number",input:c,code:"too_big",maximum:i,inclusive:!0,inst:e,continue:!t.abort})}}),cW=ne("$ZodCheckBigIntFormat",(e,t)=>{qr.init(e,t);let[n,r]=CZ[t.format];e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,i.minimum=n,i.maximum=r}),e._zod.check=o=>{let i=o.value;i<n&&o.issues.push({origin:"bigint",input:i,code:"too_small",minimum:n,inclusive:!0,inst:e,continue:!t.abort}),i>r&&o.issues.push({origin:"bigint",input:i,code:"too_big",maximum:r,inclusive:!0,inst:e,continue:!t.abort})}}),lW=ne("$ZodCheckMaxSize",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;o.size<=t.maximum||r.issues.push({origin:wO(o),code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),dW=ne("$ZodCheckMinSize",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;o.size>=t.minimum||r.issues.push({origin:wO(o),code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),pW=ne("$ZodCheckSizeEquals",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.size!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.size,o.maximum=t.size,o.size=t.size}),e._zod.check=r=>{let o=r.value,i=o.size;if(i===t.size)return;let a=i>t.size;r.issues.push({origin:wO(o),...a?{code:"too_big",maximum:t.size}:{code:"too_small",minimum:t.size},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),fW=ne("$ZodCheckMaxLength",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.maximum??Number.POSITIVE_INFINITY;t.maximum<o&&(r._zod.bag.maximum=t.maximum)}),e._zod.check=r=>{let o=r.value;if(o.length<=t.maximum)return;let a=kO(o);r.issues.push({origin:a,code:"too_big",maximum:t.maximum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),AW=ne("$ZodCheckMinLength",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag.minimum??Number.NEGATIVE_INFINITY;t.minimum>o&&(r._zod.bag.minimum=t.minimum)}),e._zod.check=r=>{let o=r.value;if(o.length>=t.minimum)return;let a=kO(o);r.issues.push({origin:a,code:"too_small",minimum:t.minimum,inclusive:!0,input:o,inst:e,continue:!t.abort})}}),mW=ne("$ZodCheckLengthEquals",(e,t)=>{var n;qr.init(e,t),(n=e._zod.def).when??(n.when=r=>{let o=r.value;return!mE(o)&&o.length!==void 0}),e._zod.onattach.push(r=>{let o=r._zod.bag;o.minimum=t.length,o.maximum=t.length,o.length=t.length}),e._zod.check=r=>{let o=r.value,i=o.length;if(i===t.length)return;let a=kO(o),c=i>t.length;r.issues.push({origin:a,...c?{code:"too_big",maximum:t.length}:{code:"too_small",minimum:t.length},inclusive:!0,exact:!0,input:r.value,inst:e,continue:!t.abort})}}),IR=ne("$ZodCheckStringFormat",(e,t)=>{var n,r;qr.init(e,t),e._zod.onattach.push(o=>{let i=o._zod.bag;i.format=t.format,t.pattern&&(i.patterns??(i.patterns=new Set),i.patterns.add(t.pattern))}),t.pattern?(n=e._zod).check??(n.check=o=>{t.pattern.lastIndex=0,!t.pattern.test(o.value)&&o.issues.push({origin:"string",code:"invalid_format",format:t.format,input:o.value,...t.pattern?{pattern:t.pattern.toString()}:{},inst:e,continue:!t.abort})}):(r=e._zod).check??(r.check=()=>{})}),gW=ne("$ZodCheckRegex",(e,t)=>{IR.init(e,t),e._zod.check=n=>{t.pattern.lastIndex=0,!t.pattern.test(n.value)&&n.issues.push({origin:"string",code:"invalid_format",format:"regex",input:n.value,pattern:t.pattern.toString(),inst:e,continue:!t.abort})}}),hW=ne("$ZodCheckLowerCase",(e,t)=>{t.pattern??(t.pattern=iW),IR.init(e,t)}),_W=ne("$ZodCheckUpperCase",(e,t)=>{t.pattern??(t.pattern=aW),IR.init(e,t)}),EW=ne("$ZodCheckIncludes",(e,t)=>{qr.init(e,t);let n=Xd(t.includes),r=new RegExp(typeof t.position=="number"?`^.{${t.position}}${n}`:n);t.pattern=r,e._zod.onattach.push(o=>{let i=o._zod.bag;i.patterns??(i.patterns=new Set),i.patterns.add(r)}),e._zod.check=o=>{o.value.includes(t.includes,t.position)||o.issues.push({origin:"string",code:"invalid_format",format:"includes",includes:t.includes,input:o.value,inst:e,continue:!t.abort})}}),SW=ne("$ZodCheckStartsWith",(e,t)=>{qr.init(e,t);let n=new RegExp(`^${Xd(t.prefix)}.*`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.startsWith(t.prefix)||r.issues.push({origin:"string",code:"invalid_format",format:"starts_with",prefix:t.prefix,input:r.value,inst:e,continue:!t.abort})}}),yW=ne("$ZodCheckEndsWith",(e,t)=>{qr.init(e,t);let n=new RegExp(`.*${Xd(t.suffix)}$`);t.pattern??(t.pattern=n),e._zod.onattach.push(r=>{let o=r._zod.bag;o.patterns??(o.patterns=new Set),o.patterns.add(n)}),e._zod.check=r=>{r.value.endsWith(t.suffix)||r.issues.push({origin:"string",code:"invalid_format",format:"ends_with",suffix:t.suffix,input:r.value,inst:e,continue:!t.abort})}});TW=ne("$ZodCheckProperty",(e,t)=>{qr.init(e,t),e._zod.check=n=>{let r=t.schema._zod.run({value:n.value[t.property],issues:[]},{});if(r instanceof Promise)return r.then(o=>EPe(o,n,t.property));EPe(r,n,t.property)}}),IW=ne("$ZodCheckMimeType",(e,t)=>{qr.init(e,t);let n=new Set(t.mime);e._zod.onattach.push(r=>{r._zod.bag.mime=t.mime}),e._zod.check=r=>{n.has(r.value.type)||r.issues.push({code:"invalid_value",values:t.mime,input:r.value.type,inst:e,continue:!t.abort})}}),CW=ne("$ZodCheckOverwrite",(e,t)=>{qr.init(e,t),e._zod.check=n=>{n.value=t.tx(n.value)}})});var FO,bW=O(()=>{m();FO=class{constructor(t=[]){this.content=[],this.indent=0,this&&(this.args=t)}indented(t){this.indent+=1,t(this),this.indent-=1}write(t){if(typeof t=="function"){t(this,{execution:"sync"}),t(this,{execution:"async"});return}let r=t.split(`
@@ -486,7 +486,7 @@ exec ${iue(n)} ${iue(e)} "$@"
486
486
  Authorization expired. Please try again.
487
487
  `);return;case"login_failed":console.log(`
488
488
  Login failed: ${e.message}
489
- `);return}}});var C5e={};za(C5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>x9e,getOpenBrowserCommand:()=>M9e,loginCommand:()=>lue,openBrowser:()=>k9e,pollForTokens:()=>w9e,requestDeviceAuthorization:()=>O9e,runLogin:()=>P9e});import{spawn as aHt}from"node:child_process";function x9e(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function cHt(e){let n=await Wt({token:e}).whoAmI({headers:{}});n.status===200&&(y4e(`lore_${n.body.user.id}`),C4e(x9e(n.body)))}async function D9e(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function B9e(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}function N9e(e,t){return new URL(t,e).toString()}async function lHt(e){let t=await e.getCliAuthConfig();if(t.status!==200)throw new Error("WorkOS CLI Auth is not configured.");return t.body}async function O9e({clientId:e,workosApiOrigin:t}){let n=await fetch(N9e(t,"/user_management/authorize/device"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e})}),r=await D9e(n);if(!n.ok)throw new Error(B9e(r));return r}async function w9e({clientId:e,deviceCode:t,expiresIn:n,interval:r,timeoutMs:o,workosApiOrigin:i}){let a=AbortSignal.timeout(Math.min(o,n*1e3)),c=r;for(;;){let d;try{d=await fetch(N9e(i,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:uHt,device_code:t,client_id:e}),signal:a})}catch(S){throw S instanceof Error&&S.name==="TimeoutError"?new Error("authorization timed out"):S}let g=await D9e(d);if(d.ok)return g;let h=g;switch(h.error){case"authorization_pending":await R9e(c*1e3);break;case"slow_down":c+=1,await R9e(c*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(B9e(h))}}}async function k9e(e){let{command:t,args:n}=M9e(process.platform,e);await new Promise((r,o)=>{let i=aHt(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function M9e(e,t){return e==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",t]}:e==="darwin"?{command:"open",args:[t]}:{command:"xdg-open",args:[t]}}async function dHt(e){if(!await xn())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function pHt(e,t,n){if(t==="darwin")try{n({kind:"auto_enable_started"});let{plistPath:r,binaryPath:o}=await e();n({kind:"auto_enable_succeeded",plistPath:r,binaryPath:o,logFile:tp()})}catch(r){Ee.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function fHt(e){if(WR(e))return`Could not reach the Lore API at ${RE()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`;if(e instanceof Error&&e.message==="WorkOS CLI Auth is not configured.")return e.message}async function P9e({client:e=Wt(),enableLaunchAgent:t=Dz,openBrowser:n=k9e,platform:r=process.platform,pollForTokens:o=w9e,requestDeviceAuthorization:i=O9e,getCliAuthConfig:a=lHt,setAccessToken:c=ZR,setRefreshToken:d=ZG,cacheAnalyticsDistinctId:g=cHt,timeoutMs:h=sHt,progress:S=b9e}={}){if(await dHt(e)){S({kind:"already_logged_in"});return}try{let y=await a(e),C=await i({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin});S({kind:"device_authorized",userCode:C.user_code,verificationUri:C.verification_uri,verificationUriComplete:C.verification_uri_complete});try{await n(C.verification_uri_complete),S({kind:"browser_opened"})}catch(x){Ee.warn("open_browser_failed",{error:x instanceof Error?x.message:String(x)}),S({kind:"browser_open_failed"})}S({kind:"browser_url",url:C.verification_uri_complete}),S({kind:"waiting_for_authorization"});let v=await o({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin,deviceCode:C.device_code,expiresIn:C.expires_in,interval:C.interval,timeoutMs:h});c(v.access_token),v.refresh_token&&d(v.refresh_token),g(v.access_token).catch(x=>{Ee.warn("cache_analytics_distinct_id_failed",{error:x instanceof Error?x.message:String(x)})}),S({kind:"logged_in"}),await pHt(t,r,S)}catch(y){y instanceof Error&&y.message==="authorization timed out"?(S({kind:"authorization_timed_out"}),Cw()):y instanceof Error&&y.message==="Authorization denied"?(S({kind:"authorization_denied"}),Cw()):y instanceof Error&&y.message==="Authorization expired"&&(S({kind:"authorization_expired"}),Cw());let C=fHt(y);throw C&&(S({kind:"login_failed",message:C}),Cw()),y}}var sHt,uHt,R9e,lue,Fse=O(async()=>{"use strict";m();so();Jn();WG();wr();ki();xE();await Use();await I5e();Uk();nT();v9e();sHt=5*60*1e3,uHt="urn:ietf:params:oauth:grant-type:device_code";R9e=e=>new Promise(t=>setTimeout(t,e));lue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){Ee.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,pollForTokens:e?.pollForTokens,requestDeviceAuthorization:e?.requestDeviceAuthorization,getCliAuthConfig:e?.getCliAuthConfig,setAccessToken:e?.setAccessToken,setRefreshToken:e?.setRefreshToken,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(Au()&&!e?.progress){await T5e(t),await hz({skipIfAlreadyConfigured:!0});return}await P9e({...t,progress:e?.progress})}}});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="dfc5cb6c-3137-4939-9544-975c14cdaab2",e._sentryDebugIdIdentifier="sentry-dbid-dfc5cb6c-3137-4939-9544-975c14cdaab2")}catch{}})();m();m();m();function _le(e=process.versions.node){let t=Number.parseInt(e.split(".")[0]??"",10);return!Number.isFinite(t)||t<=0?{ok:!0,currentVersion:e,message:null}:t<20?{ok:!1,currentVersion:e,message:`requires Node.js >= 20.0.0 (found ${e})`}:{ok:!0,currentVersion:e,message:null}}var Ele=_le();Ele.ok||(process.stderr.write(`lore: ${Ele.message}.
489
+ `);return}}});var C5e={};za(C5e,{buildStoredAnalyticsPersonPropertiesFromWhoAmI:()=>x9e,getOpenBrowserCommand:()=>M9e,loginCommand:()=>lue,openBrowser:()=>k9e,pollForTokens:()=>w9e,requestDeviceAuthorization:()=>O9e,runLogin:()=>P9e});import{spawn as aHt}from"node:child_process";function x9e(e){return{email:e.emailAddress,name:e.name??e.user.display_name,display_name:e.user.display_name,handle:e.user.handle}}async function cHt(e){let n=await Wt({token:e}).whoAmI({headers:{}});n.status===200&&(y4e(`lore_${n.body.user.id}`),C4e(x9e(n.body)))}async function D9e(e){try{return await e.json()}catch{throw new Error(`WorkOS returned an invalid JSON response: HTTP ${e.status}`)}}function B9e(e){return[e.error_description,e.error].find(t=>typeof t=="string"&&t.length>0)??"Authorization failed"}function N9e(e,t){return new URL(t,e).toString()}async function lHt(e){let t=await e.getCliAuthConfig();if(t.status!==200)throw new Error("WorkOS CLI Auth is not configured.");return t.body}async function O9e({clientId:e,workosApiOrigin:t}){let n=await fetch(N9e(t,"/user_management/authorize/device"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({client_id:e})}),r=await D9e(n);if(!n.ok)throw new Error(B9e(r));return r}async function w9e({clientId:e,deviceCode:t,expiresIn:n,interval:r,timeoutMs:o,workosApiOrigin:i}){let a=AbortSignal.timeout(Math.min(o,n*1e3)),c=r;for(;;){let d;try{d=await fetch(N9e(i,"/user_management/authenticate"),{method:"POST",headers:{"Content-Type":"application/x-www-form-urlencoded"},body:new URLSearchParams({grant_type:uHt,device_code:t,client_id:e}),signal:a})}catch(S){throw S instanceof Error&&S.name==="TimeoutError"?new Error("authorization timed out"):S}let g=await D9e(d);if(d.ok)return g;let h=g;switch(h.error){case"authorization_pending":await R9e(c*1e3);break;case"slow_down":c+=1,await R9e(c*1e3);break;case"access_denied":throw new Error("Authorization denied");case"expired_token":throw new Error("Authorization expired");default:throw new Error(B9e(h))}}}async function k9e(e){let{command:t,args:n}=M9e(process.platform,e);await new Promise((r,o)=>{let i=aHt(t,n,{detached:!0,stdio:"ignore"});i.once("error",o),i.once("spawn",()=>{i.unref(),r()})})}function M9e(e,t){return e==="win32"?{command:"rundll32",args:["url.dll,FileProtocolHandler",t]}:e==="darwin"?{command:"open",args:[t]}:{command:"xdg-open",args:[t]}}async function dHt(e){if(!await xn())return!1;try{return(await e.whoAmI({headers:{}})).status===200}catch{return!1}}async function pHt(e,t,n){if(t==="darwin")try{n({kind:"auto_enable_started"});let{plistPath:r,binaryPath:o}=await e();n({kind:"auto_enable_succeeded",plistPath:r,binaryPath:o,logFile:tp()})}catch(r){Ee.warn("auto_enable_failed",{error:r instanceof Error?r.message:String(r)}),n({kind:"auto_enable_failed"})}}function fHt(e){if(WR(e))return`Could not reach the Lore API at ${RE()}. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared.`;if(e instanceof Error&&e.message==="WorkOS CLI Auth is not configured.")return e.message}async function P9e({client:e=Wt(),enableLaunchAgent:t=Dz,openBrowser:n=k9e,platform:r=process.platform,pollForTokens:o=w9e,requestDeviceAuthorization:i=O9e,getCliAuthConfig:a=lHt,setAccessToken:c=ZR,setRefreshToken:d=ZG,cacheAnalyticsDistinctId:g=cHt,timeoutMs:h=sHt,progress:S=b9e}={}){if(await dHt(e)){S({kind:"already_logged_in"});return}try{let y=await a(e),C=await i({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin});S({kind:"device_authorized",userCode:C.user_code,verificationUri:C.verification_uri,verificationUriComplete:C.verification_uri_complete});try{await n(C.verification_uri_complete),S({kind:"browser_opened"})}catch(x){Ee.warn("open_browser_failed",{error:x instanceof Error?x.message:String(x)}),S({kind:"browser_open_failed"})}S({kind:"browser_url",url:C.verification_uri_complete}),S({kind:"waiting_for_authorization"});let v=await o({clientId:y.workos_client_id,workosApiOrigin:y.workos_api_origin,deviceCode:C.device_code,expiresIn:C.expires_in,interval:C.interval,timeoutMs:h});c(v.access_token),v.refresh_token&&d(v.refresh_token),g(v.access_token).catch(x=>{Ee.warn("cache_analytics_distinct_id_failed",{error:x instanceof Error?x.message:String(x)})}),S({kind:"logged_in"}),await pHt(t,r,S)}catch(y){y instanceof Error&&y.message==="authorization timed out"?(S({kind:"authorization_timed_out"}),Cw()):y instanceof Error&&y.message==="Authorization denied"?(S({kind:"authorization_denied"}),Cw()):y instanceof Error&&y.message==="Authorization expired"&&(S({kind:"authorization_expired"}),Cw());let C=fHt(y);throw C&&(S({kind:"login_failed",message:C}),Cw()),y}}var sHt,uHt,R9e,lue,Fse=O(async()=>{"use strict";m();so();Jn();WG();wr();ki();xE();await Use();await I5e();Uk();nT();v9e();sHt=5*60*1e3,uHt="urn:ietf:params:oauth:grant-type:device_code";R9e=e=>new Promise(t=>setTimeout(t,e));lue={meta:{name:"login",description:"Authorize this CLI against your Lore workspace"},async run({data:e}){Ee.info("command_start",{command:"login"});let t={client:e?.client,enableLaunchAgent:e?.enableLaunchAgent,openBrowser:e?.openBrowser,platform:e?.platform,pollForTokens:e?.pollForTokens,requestDeviceAuthorization:e?.requestDeviceAuthorization,getCliAuthConfig:e?.getCliAuthConfig,setAccessToken:e?.setAccessToken,setRefreshToken:e?.setRefreshToken,cacheAnalyticsDistinctId:e?.cacheAnalyticsDistinctId,timeoutMs:e?.timeoutMs};if(Au()&&!e?.progress){await T5e(t),await hz({skipIfAlreadyConfigured:!0});return}await P9e({...t,progress:e?.progress})}}});m();m();(function(){try{var e=typeof window<"u"?window:typeof global<"u"?global:typeof globalThis<"u"?globalThis:typeof self<"u"?self:{},t=new e.Error().stack;t&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[t]="25ef11ec-f164-45a7-b247-ef71c60defcc",e._sentryDebugIdIdentifier="sentry-dbid-25ef11ec-f164-45a7-b247-ef71c60defcc")}catch{}})();m();m();m();function _le(e=process.versions.node){let t=Number.parseInt(e.split(".")[0]??"",10);return!Number.isFinite(t)||t<=0?{ok:!0,currentVersion:e,message:null}:t<20?{ok:!1,currentVersion:e,message:`requires Node.js >= 20.0.0 (found ${e})`}:{ok:!0,currentVersion:e,message:null}}var Ele=_le();Ele.ok||(process.stderr.write(`lore: ${Ele.message}.
490
490
  Upgrade Node (e.g. \`nvm install 20\`) and re-run.
491
491
  `),process.exit(1));m();sR();Gl();function ubt(){let e=process.env.SENTRY_SPOTLIGHT?.trim();return!e||e==="0"||e==="false"?!1:e==="1"||e==="true"?!0:e}var cbt=ubt();ZJ({dsn:"https://583674b382128b1b30b9fa1f0581daab@o4509017064472576.ingest.us.sentry.io/4511344717529088",environment:Ni(),release:Yu(),sendDefaultPii:!0,enableLogs:!0,spotlight:cbt,tracesSampleRate:1});YU("service_name","lore-cli");sR();tZ();import{realpathSync as Q8t}from"node:fs";import{fileURLToPath as F8t,pathToFileURL as Dqe}from"node:url";m();m();FG();so();Jn();wr();m();function bw(e){let t=e;return t._def??t.def??{}}function Mkt(e){let t=bw(e);return typeof t.typeName=="string"?t.typeName:typeof t.type=="string"?t.type:void 0}function Vc(e,t,n){let r=Mkt(e);return r===t||r===n}function H4e(e){let t=bw(e);if(t.element)return t.element;if(typeof t.type=="object"&&t.type!==null)return t.type}function Pkt(e){let t=e.options;if(Array.isArray(t))return[...t];let n=bw(e);return Array.isArray(n.values)?[...n.values]:n.entries&&typeof n.entries=="object"?Object.values(n.entries):[]}function pre(e){if(!e||!Vc(e,"ZodObject","object"))return;let t=e.shape;if(typeof t=="function")return t();if(t&&typeof t=="object")return t;let n=bw(e).shape;if(typeof n=="function")return n();if(n&&typeof n=="object")return n}function z4e(e){let t=e,n=!1,r,o=e.description;for(;;){o=t.description??o;let i=bw(t);if(Vc(t,"ZodOptional","optional"))n=!0,t=i.innerType;else if(Vc(t,"ZodNullable","nullable"))n=!0,t=i.innerType;else if(Vc(t,"ZodDefault","default"))r=typeof i.defaultValue=="function"?i.defaultValue():i.defaultValue,t=i.innerType;else if(Vc(t,"ZodEffects","effects"))t=i.schema;else if(Vc(t,"ZodPipeline","pipe"))t=i.in;else break}return{inner:t,optional:n,defaultValue:r,description:o}}function Ukt(e,t={}){let{inner:n,optional:r,defaultValue:o,description:i}=z4e(e),a=!1,c=n;Vc(c,"ZodArray","array")&&(a=!0,c=H4e(c)??c);let d=!r&&o===void 0;return t.positional?{arg:{type:"positional",description:i,required:d,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:a}:Vc(c,"ZodEnum","enum")?{arg:{type:"enum",description:i,options:Pkt(c),required:d,...o!==void 0?{default:String(o)}:{}},optional:r,isArray:a}:Vc(c,"ZodBoolean","boolean")?{arg:{type:"boolean",description:i,required:d,...typeof o=="boolean"?{default:o}:{}},optional:r,isArray:a}:{arg:{type:"string",description:a?`${i??""}${i?" ":""}(comma-separated)`.trim()||void 0:i,required:d,...o!==void 0?{default:String(o)}:{},...a?{valueHint:"a,b,c"}:{}},optional:r,isArray:a}}function fre(e,t={}){let n={},r={};for(let[o,i]of Object.entries(e)){let{arg:a,isArray:c}=Ukt(i,t);n[o]=a,r[o]={isArray:c,leafKind:Lkt(i)}}return{args:n,fields:r}}function Are(e,t={}){let n=pre(e);return n?fre(n,t):{args:{},fields:{}}}function Lkt(e){let{inner:t}=z4e(e),n=t;return Vc(n,"ZodArray","array")&&(n=H4e(n)??n),Vc(n,"ZodNumber","number")?"number":Vc(n,"ZodBoolean","boolean")?"boolean":Vc(n,"ZodEnum","enum")?"enum":Vc(n,"ZodString","string")?"string":"other"}function Qkt(e,t){let n=e;for(let r of t){if(n===null||typeof n!="object"||!(r in n))throw new Error(`cliRoutes path [${t.join(".")}] does not resolve in apiContract`);n=n[r]}if(n===null||typeof n!="object"||typeof n.method!="string")throw new Error(`cliRoutes path [${t.join(".")}] is not a leaf route (missing 'method')`);return n}function Fkt(e,t){let n=e;for(let r of t)n=n[r];if(typeof n!="function")throw new Error(`client method for [${t.join(".")}] is not callable`);return n}function mre(e,t){if(!(e==null||e==="")){if(t.isArray&&typeof e=="string"){let n=e.split(",").map(r=>r.trim()).filter(r=>r.length>0);return n.length>0?n:void 0}if(t.leafKind==="number"&&typeof e=="string"){let n=Number(e);return Number.isFinite(n)?n:e}return e}}function Gkt(e){if(typeof e!="string")return e;try{let n=new URL(e).pathname.split("/").filter(Boolean),r=n.findIndex(i=>i==="thread"||i==="threads"),o=r>=0?n[r+1]:void 0;return o&&o.length>0?o:e}catch{return e}}function jkt(e,t){let n=t.path.map(o=>String(o)).join(".");return` ${n?`${e}.${n}`:e}: ${t.message}`}function gre(e,t,n){if(!e)return[];let r=t??{},o=e.safeParse(r);return o.success?[]:(o.error.issues??[]).map(a=>jkt(n,a))}function Hkt(e,t,n){return e.resource==="threads"&&t==="id"?Gkt(n):n}function $4e(e){let t=Qkt(VG,e.path),n=pre(t.pathParams),r=e.positional??(n?Object.keys(n):[]),o=new Set(r),i=fre(n?Object.fromEntries(r.map(h=>[h,n[h]])):{},{positional:!0}),a=Are(t.query),c=t.method==="GET"||t.method==="DELETE"?{args:{},fields:{}}:Are(t.body);for(let h of Object.keys(c.args))if(a.args[h]!==void 0||o.has(h))throw new Error(`route [${e.path.join(".")}] has overlapping field "${h}" across path/query/body`);let d={...i.args,...a.args,...c.args},g=e.description??t.summary??`${t.method} ${t.path}`;return{meta:{name:e.op,description:g},args:d,async run({args:h,data:S}){Ee.info("command_start",{command:`${e.resource} ${e.op}`,route:e.path.join(".")});let y=S;if(!await(y?.getAccessToken??xn)())throw new Ue("not logged in \u2014 run 'lore login' first");let v={};for(let ge of r){let ye=h[ge],be=mre(ye,i.fields[ge])??ye;v[ge]=Hkt(e,ge,be)}let x={};for(let[ge,ye]of Object.entries(a.fields)){let be=mre(h[ge],ye);be!==void 0&&(x[ge]=be)}let N={};for(let[ge,ye]of Object.entries(c.fields)){let be=mre(h[ge],ye);be!==void 0&&(N[ge]=be)}let k=[...gre(t.pathParams,v,"path"),...gre(t.query,x,"query"),...t.method==="GET"||t.method==="DELETE"?[]:gre(t.body,N,"body")];if(k.length>0)throw new Ue(`Invalid request for \`lore ${e.resource} ${e.op}\`:
492
492
  ${k.join(`
@@ -504,7 +504,7 @@ ${k.join(`
504
504
  `)}m();Tz();async function TVe(e,t){let n=t.filter(i=>!i.startsWith("-")),r=e,o;for(let i of n){let a=await Ps(r.subCommands);if(!a||!(i in a))break;let c=await Ps(a[i]);if(!c)break;o=r,r=c}return[r,o]}m();Jn();wr();Gx();Yc();function WHt(e){return[...e.include.cwd.map(t=>({kind:"cwd",value:t,workspace:"user-scoped"})),...e.include.repo.map(t=>({kind:"repo",value:t,workspace:"user-scoped"}))].sort((t,n)=>t.kind!==n.kind?t.kind.localeCompare(n.kind):t.value.localeCompare(n.value))}async function Fz(){return await Zg(),ba()}function Iue(e){let t=qc(e);if(!t)throw new Ue("path must not be empty");return t}async function IVe(){let e=await Fz();return WHt(e)}function CVe(e){return e.length>0}function XHt(e){let t=Math.max(4,...e.map(r=>r.kind.length)),n=Math.max(8,...e.map(r=>r.value.length));console.log(`${"TYPE".padEnd(t)} ${"LOCATION".padEnd(n)} WORKSPACE`);for(let r of e)console.log(`${r.kind.padEnd(t)} ${r.value.padEnd(n)} ${r.workspace}`)}var ezt={meta:{name:"create",description:"Allowlist a directory for daemon auto-uploads."},args:{path:{type:"positional",description:"Directory path to upload from (supports ~ and relative paths).",required:!0}},async run({args:e}){Ee.info("command_start",{command:"listen create"});let t=await Fz(),n=Iue(String(e.path));await Jl({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),console.log(`uploading from ${n}`)}},tzt={meta:{name:"list",description:"Print the directories Lore is allowed to auto-upload from."},args:{json:{type:"boolean",description:"Output as JSON."}},async run({args:e}){Ee.info("command_start",{command:"listen list"});let t=await IVe();if(e.json){console.log(JSON.stringify({version:1,locations:t},null,2));return}if(!CVe(t)){console.log("no upload locations yet \u2014 run `lore configure` for the guided setup, or `lore listen create <path>` to add a directory directly.");return}XHt(t)}},nzt={meta:{name:"delete",description:"Stop auto-uploading sessions from a directory."},args:{path:{type:"positional",description:"Directory path to stop uploading from.",required:!0}},async run({args:e}){Ee.info("command_start",{command:"listen delete"});let t=await Fz(),n=Iue(String(e.path)),r=t.include.cwd.filter(o=>o!==n);if(r.length===t.include.cwd.length)throw new Ue(`no upload directory at ${n}`);await Jl({...t,include:{...t.include,cwd:r}}),console.log(`stopped uploading from ${n}`)}},rzt={meta:{name:"update",description:"Deprecated. Use delete/create to change the cwd allowlist."},args:{path:{type:"positional",description:"Directory path to update.",required:!0}},async run({args:e}){Ee.info("command_start",{command:"listen update"});let t=Iue(String(e.path));throw(await Fz()).include.cwd.includes(t)?new Ue("`lore listen update` is no longer supported because upload filters only store cwd allowlist entries. Use `lore listen delete <path>` and `lore listen create <path>` to change the cwd allowlist."):new Ue(`no upload directory at ${t}`)}},bVe={meta:{name:"listen",description:"Manage the directories Lore is allowed to auto-upload from."},subCommands:{create:ezt,list:tzt,update:rzt,delete:nzt},async run({rawArgs:e}){let t=new Set(["create","list","update","delete"]);if(e.some(r=>t.has(r)))return;Ee.info("command_start",{command:"listen"});let n=await IVe();if(console.log(`lore listen \u2014 locations Lore is allowed to auto-upload from
505
505
  `),!CVe(n))console.log(" currently uploading from: nothing yet \u2014 opt in to your first location below.");else{console.log(" currently uploading from:");let r=Math.max(8,...n.map(o=>o.value.length));for(let o of n){let i=o.kind==="cwd"?"dir":"repo";console.log(` ${i} ${o.value.padEnd(r)} \u2192 ${o.workspace}`)}}console.log(""),console.log(" For guided, interactive setup, run `lore configure`."),console.log(" These subcommands are the low-level CRUD for scripted edits:"),console.log(""),console.log(" lore listen create <path> start uploading from a directory"),console.log(" lore listen list [--json] print the upload list"),console.log(" lore listen delete <path> stop uploading from a directory"),console.log(""),console.log(" Example: lore listen create ~/code/projectA")}};m();Gx();m();Jn();ki();HE();Yc();import ozt from"node:fs/promises";async function izt(e){try{return await ozt.access(e),!0}catch(t){if(Yr(t,"ENOENT"))return!1;throw t}}async function azt({uploadFilterPath:e=Xy()}={}){if(!await izt(e))return;let t=await ba(e),n=[],r=[];for(let o of t.include.cwd){let i=await Ik(o);i?n.push(i):r.push(o)}n.length===0&&r.length===t.include.cwd.length||await Jl({...t,include:{...t.include,cwd:r.sort(),repo:Array.from(new Set([...t.include.repo,...n])).sort()}},e)}var vVe={id:"20260519000000-upload-filter-cwds-to-repos",run:azt};var szt=[Y$e,vVe];async function uzt(e=szt,t=console.log){t(`running ${e.length} migration${e.length===1?"":"s"}`);for(let n of e)t(`running migration ${n.id}`),await n.run(),t(`finished migration ${n.id}`);t("finished migrations")}var RVe={meta:{name:"postinstall:migrate",hidden:!0,skipAutoupdate:!0},async run(){await uzt()}};cre();Dk();m();so();Gl();wr();Hse();import{platform as czt,release as lzt}from"node:os";function dzt(e){return e.find(n=>!n.startsWith("-"))??"lore"}async function xVe(e){try{let t={command:dzt(e.rawArgs),rawArgs:[...e.rawArgs],cliVersion:Yu(),nodeVersion:process.version,platform:czt(),release:lzt()};(await B5e({error:e.error,context:t,logger:Ee,send:async r=>{let i=await Wt().createFeedback({body:r});switch(i.status){case 201:return{kind:"sent"};case 401:return{kind:"unauthorized"};case 429:return{kind:"rate-limited"};default:return{kind:"failed",error:new Error(`createFeedback returned HTTP ${i.status}`)}}}})).kind==="sent"&&Ee.info("error_report_sent")}catch(t){Ee.warn("error_report_unexpected_failure",{error:t instanceof Error?t.message:String(t)})}}m();m();so();Jn();var DVe={meta:{name:"approve",description:"Approve a proposed skill version and make it the latest accepted version."},args:{id:{type:"positional",required:!0,description:"Workspace skill ID, e.g. sk_01j..."},version:{type:"string",required:!0,description:"Proposed version timestamp to approve"}},async run({args:e}){if(!await xn())throw new Ue("skill approval requires login \u2014 run 'lore login' first");let t=Number(e.version);if(!Number.isInteger(t)||t<=0)throw new Ue("--version must be a positive integer timestamp");let n=await Wt().approveSkillVersion({params:{id:e.id,version:t},body:{}});if(n.status!==200){let r=n.body?.message??`approveSkillVersion returned ${n.status}`;throw new Ue(r)}console.log(`approved /${n.body.name} v${n.body.version} (${n.body.id})`)}};m();so();Jn();m();Jn();import pzt from"node:fs/promises";async function Cue(e){let t=await e.listSkillInstallationSync({});if(t.status!==200){let a=t.body?.message??`listSkillInstallationSync returned ${t.status}`;throw new Ue(a)}let n=0,r=0,o=new Map;for(let a of t.body.objects){o.set(a.skill_id,a);let c=await Wx(a.skill_id),d=c?.installPath??Qk(a.root_kind,a.name),g=await NVe(d),h=g===null?null:XE(g);if(g!==null&&!c){await pp(Szt(a,d)),r+=1;continue}if(c&&h!==null&&h!==c.lastInstalledHash&&h!==a.latest_content_hash&&a.latest_version!==c.lastInstalledVersion){await pp({...c,lastSyncStatus:"conflict"}),r+=1;continue}if(c&&h===a.latest_content_hash){a.installed_version!==a.latest_version&&await Gz(e,a.id,a.latest_version),await pp({...c,installationId:a.id,baseVersion:a.latest_version,baseContentHash:a.latest_content_hash,lastInstalledVersion:a.latest_version,lastInstalledHash:a.latest_content_hash,lastSyncStatus:"current"});continue}if(c?.lastSyncStatus==="proposed"&&h===c.lastInstalledHash)continue;if(c?.lastInstalledVersion===a.latest_version&&g!==null){a.installed_version!==a.latest_version&&(await Gz(e,a.id,a.latest_version),await pp({...c,installationId:a.id}));continue}let S=await Ezt(e,a.skill_id,a.latest_version);if(XE(S)!==a.latest_content_hash)throw new Ue(`downloaded SKILL.md hash did not match metadata for ${a.skill_id}`);let C=await wz(a.root_kind,a.name,S);await Gz(e,a.id,a.latest_version),await pp({installationId:a.id,skillId:a.skill_id,name:a.name,rootKind:a.root_kind,installPath:C,baseVersion:a.latest_version,baseContentHash:a.latest_content_hash,lastInstalledVersion:a.latest_version,lastInstalledHash:a.latest_content_hash,lastSyncStatus:"current"}),n+=1}let i=await gzt(e,o);return{installedUpdated:n,localEditsUploaded:i,conflicts:r}}async function BVe(e){if(e.signal?.aborted)return;let t=e.sleep??mzt,n=Promise.resolve(),r=async(a,c)=>{n=n.then(async()=>{if(e.signal?.aborted)return;let d=await Cue(e.client);await e.onSyncPass?.({reason:a,event:c,result:d})}),await n};await r("startup");let o=(async()=>{for await(let a of e.events??fzt()){if(e.signal?.aborted)return;Azt(a)&&await r(a.type==="stream.catchup_truncated"?"catchup_truncated":"event",a)}})(),i=(async()=>{if(e.pollIntervalMs!==void 0)for(;!e.signal?.aborted;){if(await t(e.pollIntervalMs,e.signal),e.signal?.aborted)return;await r("poll")}})();if(e.pollIntervalMs===void 0){await o;return}await Promise.race([o,i])}async function*fzt(){}function Azt(e){return e.type.startsWith("skill.version.")||e.type==="stream.catchup_truncated"}function mzt(e,t){return t?.aborted?Promise.resolve():new Promise(n=>{let r=setTimeout(n,e);r.unref?.(),t?.addEventListener("abort",()=>{clearTimeout(r),n()},{once:!0})})}async function gzt(e,t){let n=0,r;for(let o of await V9e()){if(o.lastSyncStatus==="conflict")continue;let i=await NVe(o.installPath);if(i===null||XE(i)===o.lastInstalledHash)continue;let c=t.get(o.skillId);if(c&&c.latest_version!==o.baseVersion){await pp({...o,lastSyncStatus:"conflict"});continue}r??=await hzt(e);let d=await _zt(e,o.skillId),g=d&&d===r?"owner_update":"subscriber_update",h=await Mz(e,{skillId:o.skillId,name:o.name,description:null,bodyMd:i,filePath:o.installPath,rootKind:o.rootKind},{syncAction:g,baseVersion:o.baseVersion});h.version_status==="accepted"?(await Gz(e,o.installationId,h.version),await pp({...o,baseVersion:h.version,baseContentHash:h.content_hash,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"current"})):h.version_status==="proposed"&&await pp({...o,lastInstalledVersion:h.version,lastInstalledHash:h.content_hash,lastSyncStatus:"proposed"}),n+=1}return n}async function Gz(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Ue(`wrote skill locally, but failed to record installed version: ${o}`)}}async function hzt(e){let t=await e.whoAmI({headers:{}});return t.status!==200?null:t.body.user.id}async function _zt(e,t){let n=await e.getSkillDetail({params:{id:t}});return n.status!==200?null:n.body.author?.id??null}async function Ezt(e,t,n){let r=await e.getSkillRaw({params:{id:t},query:{version:n}});if(r.status!==200){let o=r.body?.message??`getSkillRaw returned ${r.status}`;throw new Ue(o)}return typeof r.body=="string"?r.body:String(r.body)}function Szt(e,t){return{installationId:e.id,skillId:e.skill_id,name:e.name,rootKind:e.root_kind,installPath:t,baseVersion:e.installed_version??0,baseContentHash:"",lastInstalledVersion:e.installed_version??0,lastInstalledHash:"",lastSyncStatus:"conflict"}}async function NVe(e){try{return await pzt.readFile(e,"utf8")}catch{return null}}m();so();Jn();async function*wVe(e){if(e.organizationIds.length===0)throw new Ue("workspace skill sync daemon needs at least one workspace to subscribe to");let t=e.token??await(e.getAccessToken??xn)();if(!t)throw new Ue("workspace skill sync daemon requires login \u2014 run 'lore login' first");let n=new URL("/api/events/stream",e.apiBaseUrl??RE());for(let i of e.organizationIds)n.searchParams.append("subject",`org:${i}`);let r={accept:"text/event-stream",authorization:`Bearer ${t}`};e.lastEventId&&(r["Last-Event-ID"]=e.lastEventId);let o=await(e.fetch??fetch)(n,{headers:r,signal:e.signal});if(!o.ok)throw new Ue(`skill sync event stream returned ${o.status}`);if(!o.body)throw new Ue("skill sync event stream returned no response body");for await(let i of yzt(o.body)){let a=i.event??"message";!a.startsWith("skill.version.")&&a!=="stream.catchup_truncated"||(yield{id:i.id,type:a})}}async function*yzt(e){let t=new TextDecoder,n=e.getReader(),r="";try{for(;;){let{done:i,value:a}=await n.read();if(i)break;r+=t.decode(a,{stream:!0});let c=r.split(/\r?\n\r?\n/);r=c.pop()??"";for(let d of c){let g=OVe(d);g&&(yield g)}}r+=t.decode();let o=OVe(r);o&&(yield o)}finally{n.releaseLock()}}function OVe(e){let t={data:""};for(let n of e.split(/\r?\n/)){if(!n||n.startsWith(":"))continue;let r=n.indexOf(":"),o=r===-1?n:n.slice(0,r),i=r===-1?"":n.slice(r+1).replace(/^ /,"");o==="id"&&(t.id=i),o==="event"&&(t.event=i),o==="data"&&(t.data+=`${i}
506
506
  `)}return!t.id&&!t.event&&!t.data?null:(t.data.endsWith(`
507
- `)&&(t.data=t.data.slice(0,-1)),t)}var kVe={meta:{name:"daemon",description:"Run the workspace skill sync daemon.",hidden:!0,skipAutoupdate:!0},args:{"poll-interval-ms":{type:"string",description:"Fallback full-sync poll interval in milliseconds.",default:"300000"}},async run({args:e,data:t}){let n=t,o=await(n?.getAccessToken??xn)();if(!o)throw new Ue("workspace skill sync daemon requires login \u2014 run 'lore login' first");let i=n?.client??Wt({token:o}),a=await i.whoAmI({headers:{}});if(a.status!==200)throw new Ue(`whoAmI returned ${a.status}`);let c=a.body.organizations.map(h=>h.id),d=(n?.createEventStream??wVe)({organizationIds:c,token:o}),g=Number(e["poll-interval-ms"]);if(!Number.isFinite(g)||g<=0)throw new Ue("--poll-interval-ms must be a positive number");await(n?.runSkillSyncDaemon??BVe)({client:i,events:d,pollIntervalMs:g,onSyncPass:({reason:h,result:S})=>{console.log(`skill sync ${h}: ${S.installedUpdated} updated, ${S.localEditsUploaded} local edit${S.localEditsUploaded===1?"":"s"} uploaded, ${S.conflicts} conflict${S.conflicts===1?"":"s"}`)}})}};m();import bue from"node:fs/promises";import MVe from"node:path";so();Jn();var PVe={meta:{name:"install",description:"Pull a workspace skill from Lore and write it to ~/.claude/skills/<name>/SKILL.md."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Ue("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await xn())throw new Ue("workspace skill installs require login \u2014 run 'lore login' first");let n=Wt();await Tzt(n,t)}};async function Tzt(e,t){let n=await vzt(e,t);if(!Lk(n.name))throw new Ue(`refusing to install skill with invalid name: ${JSON.stringify(n.name)}`);let r=Qk(n.rootKind,n.name),o=await Rzt(r),i=await Wx(n.skillId),a=i?.installPath!=null&&MVe.resolve(i.installPath)===MVe.resolve(r);if(o!==null&&!a)throw new Ue(`refusing to overwrite ${r}; it already exists and is not managed by Lore`);let c=await wz(n.rootKind,n.name,n.bodyMd),d=await Izt(e,t,o,c),g=n.latestVersion,h={installationId:d.body.id,skillId:n.skillId,name:n.name,rootKind:n.rootKind,installPath:c,baseVersion:g,baseContentHash:n.contentHash,lastInstalledVersion:g,lastInstalledHash:n.contentHash,lastSyncStatus:"current"};try{await Czt(e,d.body.id,g)}catch(S){throw await pp({...h,lastSyncStatus:"error"}),S}await pp(h),o===n.bodyMd?console.log(`/${n.name} is already up to date at ${c}`):console.log(`installed /${n.name} (${n.skillId}) -> ${c}`)}async function Izt(e,t,n,r){try{let o=await e.installSkill({params:{id:t},body:{}});if(o.status!==200){let i=o.body?.message??`installSkill returned ${o.status}`;throw new Ue(i)}return o}catch(o){throw await bzt(r,n),o}}async function Czt(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Ue(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function bzt(e,t){if(t===null){await bue.rm(e,{force:!0});return}await bue.writeFile(e,t,"utf8")}async function vzt(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let a=n.body?.message??`getSkillDetail returned ${n.status}`;throw new Ue(a)}if(!n.body.content_hash)throw new Ue("No SKILL.md content has been captured for this skill yet.");let r=await e.getSkillRaw({params:{id:t}});if(r.status!==200){let a=r.body?.message??`getSkillRaw returned ${r.status}`;throw new Ue(a)}let o=typeof r.body=="string"?r.body:String(r.body);if(XE(o)!==n.body.content_hash)throw new Ue("downloaded SKILL.md hash did not match the skill metadata");return{skillId:n.body.id,name:n.body.name,rootKind:n.body.root_kind,latestVersion:n.body.latest_version,contentHash:n.body.content_hash,bodyMd:o}}async function Rzt(e){try{return await bue.readFile(e,"utf8")}catch{return null}}m();so();Jn();var UVe={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=await Wt().listSkills({});if(t.status!==200){let n=t.body?.message??`listSkills returned ${t.status}`;throw new Ue(n)}if(t.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of t.body.objects){let r=n.source?` [${n.source}]`:"",o=n.description?` \u2014 ${n.description}`:"";console.log(`/${n.name}${r}${o}`)}}};m();so();Jn();var LVe={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:e}){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=Wt(),n=await xzt(e);if(n.length===0)throw new Ue("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let i=typeof o=="string"?await H9e(o):o,a=typeof o=="string"?o:o.name;if(!i){console.error(`skip ${a}: no SKILL.md found locally`);continue}if(!await W9e(i)){r+=1,console.log(`unchanged /${a} from ${i.filePath}`);continue}let c=await Mz(t,i,{published:!0});await X9e(i),r+=1,console.log(`published /${a} (v${c.latest_version}, ${c.visibility}) from ${i.filePath}`)}if(r===0)throw new Ue("no skills were published \u2014 check the names and try again")}};async function xzt(e){if(e.all)return fue();let t=typeof e.name=="string"?e.name.trim():"";return t?[t]:[]}m();so();Jn();var QVe={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await xn())throw new Ue("workspace skill sync requires login \u2014 run 'lore login' first");let e=await Cue(Wt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};m();import FVe from"node:fs/promises";import Dzt from"node:path";so();Jn();var GVe={meta:{name:"uninstall",description:"Remove a Lore-managed skill by stable skill ID."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Ue("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await xn())throw new Ue("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Wt();await Bzt(n,t)}};async function Bzt(e,t){let n=await Wx(t);n&&(await FVe.rm(n.installPath,{force:!0}),await FVe.rmdir(Dzt.dirname(n.installPath)).catch(()=>{}));let r=await e.uninstallSkill({params:{id:t},body:{}});if(r.status!==200){let o=r.body?.message??`uninstallSkill returned ${r.status}`;throw new Ue(o)}if(await $9e(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var jVe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:LVe,install:PVe,uninstall:GVe,sync:QVe,daemon:kVe,approve:DVe,list:UVe}};m();m();so();Jn();var HVe={meta:{name:"channels",description:"List Slack channels the bot can see for your workspace."},async run(){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=await Wt().slack.listSlackChannels();if(t.status===200){for(let r of t.body.channels){let o=r.is_private?"(private)":"";console.log(`#${r.name} ${o}`.trim())}t.body.channels.length===0&&console.log("No channels found. Make sure the Lore bot is invited to at least one channel.");return}if(t.status===404)throw new Ue("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let n=t.body?.message??`unexpected status ${t.status}`;throw new Ue(n)}};m();so();Jn();var zVe={meta:{name:"post",description:"Post a Lore thread link to a Slack channel."},args:{channel:{type:"positional",required:!0,description:"Slack channel name (with or without #)"},"thread-id":{type:"string",required:!0,description:"The Lore thread ID to post (e.g. th_...)"}},async run({args:e}){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=(typeof e.channel=="string"?e.channel:"").replace(/^#/,""),n=e["thread-id"];if(!t)throw new Ue("channel name is required \u2014 e.g. `lore slack post general --thread-id th_...`");if(!n)throw new Ue("--thread-id is required \u2014 e.g. `lore slack post general --thread-id th_...`");let o=await Wt().slack.postToSlack({body:{channel_name:t,thread_id:n}});if(o.status===200){console.log(JSON.stringify({ok:!0,channel:t,ts:o.body.ts}));return}if(o.status===404)throw new Ue("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let i=o.body?.message??`unexpected status ${o.status}`;throw new Ue(i)}};var $Ve={meta:{name:"slack",description:"Slack integration commands."},subCommands:{channels:HVe,post:zVe}};xE();m();await uo();var Kz=ie(an(),1);Gl();await BT();m();await uo();var Vz=ie(an(),1);await am();m();await uo();var Xx=ie(an(),1);xa();var Zl=ie(Lt(),1);function eD({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[a,c]=(0,Xx.useState)(VVe(e,n)),d=(0,Xx.useRef)(a);return(0,Xx.useEffect)(()=>{let g=VVe(e,n);d.current=g,c(g)},[e,n]),gu((g,h)=>{if(e.length!==0){if(h.upArrow||g==="k"){let S=Nzt(e,d.current);d.current=S,c(S);return}if(h.downArrow||g==="j"){let S=qVe(e,d.current);d.current=S,c(S);return}if(h.return||g===" "){let S=e[d.current];S&&!S.disabled&&t(S)}}},{isActive:!r}),e.length===0?(0,Zl.jsx)(Ae,{color:ve.muted,children:"no actions available"}):(0,Zl.jsxs)(me,{flexDirection:"column",children:[e.map((g,h)=>{let S=h===a,y=g.disabled?ve.muted:S?ve.primary:ve.highlight;return(0,Zl.jsxs)(me,{children:[(0,Zl.jsx)(me,{width:2,flexShrink:0,children:(0,Zl.jsx)(Ae,{color:S?ve.primary:ve.muted,children:S?"\u203A":" "})}),(0,Zl.jsx)(me,{width:i,flexShrink:0,children:(0,Zl.jsx)(Ae,{color:y,bold:S&&!g.disabled,children:g.label})}),g.description?(0,Zl.jsx)(me,{flexGrow:1,flexShrink:1,children:(0,Zl.jsx)(Ae,{color:ve.muted,children:g.description})}):null]},g.id)}),o?(0,Zl.jsx)(me,{marginTop:1,children:(0,Zl.jsx)(Ae,{color:ve.muted,children:o})}):null]})}function VVe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?qVe(e,n-1):n}function qVe(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r]?.disabled)return r}return t}function Nzt(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r]?.disabled)return r}return t}await sm();await wT();await kT();xa();m();so();Gx();Uk();Yc();async function jz(e){if(!await(e.hasAccessToken??(async()=>!!await xn()))())return{state:"logged_out"};let n=e.client??Wt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:YVe(r.body,`whoAmI returned ${r.status}`)}:{state:"ready",userId:r.body.user.id,email:r.body.emailAddress,displayName:r.body.user.display_name,organizations:r.body.organizations,activeOrganizationId:r.body.organizationId,activeOrganizationName:r.body.org_name}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function Hz(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??Bz;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function zz(e){if(!await(e.hasAccessToken??(async()=>!!await xn()))())return{state:"logged_out"};let n=e.client??Wt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:YVe(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(a=>(a.source??"").trim()==="lore").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function $z(){try{await Zg();let e=await ba();return Ozt(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function Ozt(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function YVe(e,t){if(e&&typeof e=="object"&&"message"in e){let n=e.message;if(typeof n=="string"&&n.length>0)return n}return t}var Bt=ie(Lt(),1);function t0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Ca(),[i,a]=(0,Vz.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,Vz.useEffect)(()=>{if(t)return;let d=!1;return(async()=>{let[g,h,S,y]=await Promise.all([jz(n),Hz(n),zz(n),$z()]);d||a({identity:g,daemon:h,skills:S,uploadDirs:y})})(),()=>{d=!0}},[]),gu((d,g)=>{(d==="q"||g.ctrl&&d==="c"||g.escape)&&(r("quit"),o())});let c=Lzt(i);return(0,Bt.jsxs)(me,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Bt.jsx)(Da,{title:"lore",subtitle:kzt(i.identity),right:`v${e}`}),(0,Bt.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Bt.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Pn,{title:"Daemon",children:(0,Bt.jsx)(Mzt,{daemon:i.daemon})})}),(0,Bt.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Pn,{title:"Workspace",children:(0,Bt.jsx)(Pzt,{identity:i.identity,skills:i.skills})})})]}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsx)(Pn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,Bt.jsx)(wzt,{uploadDirs:i.uploadDirs})})}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsx)(Pn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Bt.jsx)(eD,{items:c,onSelect:d=>{r(d.id),o()}})})})]})}function wzt({uploadDirs:e}){return e.state==="loading"?(0,Bt.jsx)(Ms,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsxs)(Ae,{color:ve.muted,children:["Run ",(0,Bt.jsx)(Ae,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Bt.jsxs)(me,{flexDirection:"column",children:[e.cwd.map(t=>(0,Bt.jsx)(nn,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,Bt.jsx)(nn,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function kzt(e){switch(e.state){case"ready":{let t=e.activeOrganizationName??"";return t?`${e.email} \xB7 ${t}`:e.email}case"logged_out":return"not signed in";case"loading":return"loading\u2026";case"error":return"identity error"}}function Mzt({daemon:e}){if(e.state==="loading")return(0,Bt.jsx)(Ms,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(Ae,{color:ve.muted,children:"Background uploads are macOS-only today."}),(0,Bt.jsxs)(Ae,{color:ve.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:t.health,kind:n}),(0,Bt.jsx)(nn,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Heartbeat",value:KVe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Last upload",value:KVe(t.status?.last_success_at)}),t.status?.last_error?(0,Bt.jsx)(nn,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function Pzt({identity:e,skills:t}){return e.state==="loading"?(0,Bt.jsx)(Ms,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"signed out",kind:"warning"}),(0,Bt.jsx)(Ae,{color:ve.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]}):(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"User",value:e.email,kind:"success"}),(0,Bt.jsx)(nn,{label:"Display name",value:e.displayName}),(0,Bt.jsx)(nn,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Bt.jsx)(nn,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Bt.jsx)(nn,{label:"Skills",value:Uzt(t)})]})}function Uzt(e){return e.state==="loading"?"loading\u2026":e.state==="logged_out"?"\u2014":e.state==="error"?`error (${e.message})`:`${e.count} installed \xB7 ${e.published} published`}function Lzt(e){let t=e.identity.state==="ready",n=e.daemon.state==="ready"&&e.daemon.report.enabled,r=e.daemon.state!=="unsupported",o=[];return t&&(o.push({id:"share-codex",label:"Share Codex",description:"lore share-codex --session-file <path>"}),o.push({id:"share-cowork",label:"Share Cowork",description:"lore share-cowork"}),o.push({id:"export",label:"Export Claude",description:"lore export"})),r&&(n?(o.push({id:"status",label:"Daemon status",description:"lore status"}),o.push({id:"restart",label:"Restart daemon",description:"lore restart"}),o.push({id:"disable",label:"Disable daemon",description:"lore disable"})):o.push({id:"enable",label:"Enable daemon",description:"lore enable"})),t?(o.push({id:"configure",label:"Configure uploads",description:"lore configure"}),o.push({id:"listen-list",label:"Manage upload dirs",description:"lore listen list"}),o.push({id:"skills-list",label:"Skills",description:"lore skills list"}),o.push({id:"workspaces-list",label:"Workspaces",description:"lore workspaces list"}),o.push({id:"logout",label:"Sign out",description:"lore logout"})):o.push({id:"login",label:"Sign in",description:"lore login"}),o.push({id:"quit",label:"Quit",description:"exit the dashboard"}),o}function KVe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}m();await uo();await am();await sm();xa();var Xo=ie(Lt(),1),Qzt=[{id:"login",label:"Sign in with WorkOS",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function qz({cliVersion:e,onSelect:t}){let{exit:n}=Ca();return gu((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,Xo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Xo.jsx)(Da,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,Xo.jsx)(Pn,{title:"What is Lore?",children:(0,Xo.jsxs)(me,{flexDirection:"column",children:[(0,Xo.jsx)(Ae,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,Xo.jsxs)(me,{marginTop:1,flexDirection:"column",children:[(0,Xo.jsx)(Ae,{color:ve.muted,children:"You'll get:"}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,Xo.jsx)(me,{marginTop:1,children:(0,Xo.jsx)(Pn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Xo.jsx)(eD,{items:Qzt,onSelect:r=>{t(r.id),n()}})})}),(0,Xo.jsx)(me,{marginTop:1,children:(0,Xo.jsxs)(Ae,{color:ve.muted,children:["New to Lore? Run ",(0,Xo.jsx)(Ae,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var Yz=ie(Lt(),1),Fzt={login:["login"],logout:["logout"],enable:["enable"],disable:["disable"],status:["status"],restart:["restart"],"share-codex":["share-codex"],"share-cowork":["share-cowork"],export:["export"],"workspaces-list":["workspaces","list"],"skills-list":["skills","list"],"listen-list":["listen","list"],configure:["configure"],quit:[]};function Gzt({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,Kz.useState)(void 0),{exit:i}=Ca();return(0,Kz.useEffect)(()=>{let a=!1;return(async()=>{let[c,d,g,h]=await Promise.all([jz(t),Hz(t),zz(t),$z()]);a||o({identity:c,daemon:d,skills:g,uploadDirs:h})})(),()=>{a=!0}},[]),r?r.identity.state==="logged_out"?(0,Yz.jsx)(qz,{cliVersion:e,onSelect:a=>{n(a),i()}}):(0,Yz.jsx)(t0,{cliVersion:e,initialData:r,onSelect:n}):null}async function JVe(){let e="quit";return await Jc((0,Yz.jsx)(Gzt,{cliVersion:Yu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:Fzt[e]}}m();await BT();m();await uo();var Kk=ie(an(),1);await am();await sm();xa();m();await uo();await vse();await am();await OT();await sm();await Dse();m();await uo();xa();var tD=ie(Lt(),1),jzt="\u2588",Hzt="\u2591";function ZVe({value:e,width:t=24,label:n,color:r=ve.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),a=Math.max(0,t-i);return(0,tD.jsxs)(me,{children:[(0,tD.jsx)(Ae,{color:r,children:jzt.repeat(i)}),(0,tD.jsx)(Ae,{color:ve.muted,children:Hzt.repeat(a)}),n?(0,tD.jsxs)(Ae,{color:ve.muted,children:[" ",n]}):null]})}await wT();await kT();await Rse();await Mse();await Lse();m();await uo();await am();await OT();await sm();await wT();xa();var co=ie(Lt(),1),XVe=[{key:"resolving_session",label:"Resolving session"},{key:"uploading",label:"Uploading transcript"},{key:"parsing",label:"Parsing on server"},{key:"updating_visibility",label:"Updating visibility"},{key:"resolving_highlight",label:"Resolving highlight"}];function zk(){return{steps:XVe.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function Jz(e,t){return t.kind==="completed"?{...e,result:{url:t.url,reused:t.reused,visibility:t.visibility,clipboardCopied:t.clipboardCopied,sessionId:t.sessionId}}:t.kind==="error"?{...e,errorMessage:t.message,steps:e.steps.map(n=>n.status==="active"?{...n,status:"pending"}:n)}:t.step==="done"||t.step==="errored"?{...e,steps:e.steps.map(n=>({...n,status:n.status==="active"?"done":n.status}))}:{...e,steps:e.steps.map(n=>n.key===t.step?{...n,status:"active",label:t.label?`${WVe(n.key)} (${t.label})`:WVe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function WVe(e){return XVe.find(t=>t.key===e)?.label??e}function eh({title:e,subtitle:t,state:n}){return(0,co.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,co.jsx)(Da,{title:e,subtitle:t}),(0,co.jsx)(Pn,{title:"Pipeline",children:(0,co.jsx)(me,{flexDirection:"column",children:n.steps.map(r=>(0,co.jsx)(zzt,{step:r},r.key))})}),n.result?(0,co.jsx)(me,{marginTop:1,flexDirection:"column",children:(0,co.jsx)(Ba,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,co.jsxs)(me,{flexDirection:"column",children:[(0,co.jsx)(Ae,{children:n.result.url}),(0,co.jsx)(me,{marginTop:1,children:(0,co.jsxs)(Ae,{color:ve.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,co.jsx)(me,{marginTop:1,children:(0,co.jsx)(Ba,{kind:"error",title:"Failed",children:(0,co.jsx)(Ae,{children:n.errorMessage})})}):null]})}function zzt({step:e}){return e.status==="active"?(0,co.jsxs)(me,{children:[(0,co.jsx)(Ms,{}),(0,co.jsx)(Ae,{children:" "}),(0,co.jsx)(Ae,{color:ve.primary,children:e.label})]}):e.status==="done"?(0,co.jsxs)(me,{children:[(0,co.jsx)(Ae,{color:ve.success,children:"\u2713 "}),(0,co.jsx)(Ae,{color:ve.muted,children:e.label})]}):(0,co.jsxs)(me,{children:[(0,co.jsx)(Ae,{color:ve.muted,children:"\u25CB "}),(0,co.jsx)(Ae,{color:ve.muted,children:e.label})]})}xa();m();var $k=Date.parse("2026-05-16T12:00:00.000Z");function Vk(e){return new Date($k-e*6e4).toISOString()}var xf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},eqe=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:$k-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:$k-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:$k-3*60*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:$k-26*60*6e4}],$zt=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],nD={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:xf.plist,binary_path:xf.binary,status_path:xf.status,install_source_path:xf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:Vk(60),last_heartbeat_at:Vk(1),last_success_at:Vk(5),last_completed_at:Vk(5),last_thread_ids:["thr_01hx_story"]}},tqe={...nD,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...nD.status,state:"error",last_heartbeat_at:Vk(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Vzt={...nD,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},qzt={state:"ready",userId:"user_alex",email:"alex@tanagram.ai",displayName:"Alex Rivera",organizations:[{id:"org_tanagram",name:"Tanagram"},{id:"org_acme",name:"Acme"}],activeOrganizationId:"org_tanagram",activeOrganizationName:"Tanagram"},qk={identity:qzt,daemon:{state:"ready",report:nD},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:$zt,repo:[]}},nqe={...qk,uploadDirs:{state:"ready",cwd:[],repo:[]}},rqe={...qk,daemon:{state:"error",message:"launchctl print failed: service not found"}},oqe={...qk,daemon:{state:"unsupported",platform:"linux"}},iqe={identity:{state:"logged_out"},daemon:{state:"ready",report:Vzt},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},aqe=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var ht=ie(Lt(),1),Kr=()=>{};function n0(...e){return e.reduce(_z,xk())}function Yk(...e){return e.reduce(Jz,zk())}var pm=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,ht.jsx)(qz,{cliVersion:"0.1.0",onSelect:Kr})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,ht.jsx)(dp,{state:xk()})},{id:"onboarding/login/device-code",title:"Login / device code",path:["TUI","Screens","Onboarding","Login"],description:"User has a WorkOS code and browser URL.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"})})},{id:"onboarding/login/awaiting-authorization",title:"Login / awaiting authorization",path:["TUI","Screens","Onboarding","Login"],description:"Browser is open and polling is active.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"waiting_for_authorization"})})},{id:"onboarding/login/auto-enable",title:"Login / auto-enable in progress",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded and launchd install is running.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"})})},{id:"onboarding/login/success",title:"Login / success",path:["TUI","Screens","Onboarding","Login"],description:"Signed in and background uploads enabled.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_succeeded",plistPath:xf.plist,binaryPath:xf.binary,logFile:xf.logFile})})},{id:"onboarding/login/auto-enable-failed",title:"Login / auto-enable failed",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded but the daemon install needs a retry.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_failed"})})},{id:"onboarding/login/denied",title:"Login / denied",path:["TUI","Screens","Onboarding","Login"],description:"Terminal authorization failure state.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"authorization_denied"})})},{id:"onboarding/login/api-unreachable",title:"Login / API unreachable",path:["TUI","Screens","Onboarding","Login"],description:"Early failure before WorkOS device-code negotiation.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"login_failed",message:"Could not reach the Lore API at http://localhost:4000. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared."})})},{id:"onboarding/login/already-signed-in",title:"Login / already signed in",path:["TUI","Screens","Onboarding","Login"],description:"Short-circuit copy for authenticated callers.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"already_logged_in"})})},{id:"onboarding/configure-upload-repos/loading",title:"Configure upload repos / loading",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Recent Claude Code cwd discovery is in flight.",render:()=>(0,ht.jsx)(lm,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/choose",title:"Configure upload repos / choose",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Suggested git remotes with defaults checked.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:eqe,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/empty",title:"Configure upload repos / empty",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"No recent sessions, with add-custom affordance.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saved",title:"Configure upload repos / saved",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save for multiple repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/skipped",title:"Configure upload repos / skipped",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save with zero selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,ht.jsx)(lm,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:Kr,onSkip:Kr})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:qk,onSelect:Kr})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:nqe,onSelect:Kr})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:rqe,onSelect:Kr})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:oqe,onSelect:Kr})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:iqe,onSelect:Kr})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:zk()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading",label:"42%"})})},{id:"sharing/parsing",title:"Share flow / parsing",path:["TUI","Screens","Sharing"],description:"Server-side parsing is active.",render:()=>(0,ht.jsx)(eh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing",label:"queued"})})},{id:"sharing/shared",title:"Share flow / shared",path:["TUI","Screens","Sharing"],description:"New share completed and copied to clipboard.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing"},{kind:"step",step:"updating_visibility"},{kind:"step",step:"done"},{kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!1,visibility:"workspace",clipboardCopied:!0,sessionId:"thr_01hx_story"})})},{id:"sharing/already-shared",title:"Share flow / already shared",path:["TUI","Screens","Sharing"],description:"Deduped upload converges to an existing Lore thread.",render:()=>(0,ht.jsx)(eh,{title:"lore share-cowork",state:Yk({kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!0,visibility:"private",clipboardCopied:!1})})},{id:"sharing/error",title:"Share flow / error",path:["TUI","Screens","Sharing"],description:"Pipeline error callout.",render:()=>(0,ht.jsx)(eh,{title:"lore export",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"error",message:"presigned upload failed: HTTP 403"})})},{id:"daemon/run/enable-progress",title:"Daemon run / enable progress",path:["TUI","Screens","Daemon","Run"],description:"Enable command while launchd work is active.",render:()=>(0,ht.jsx)(e0,{mode:"enable",state:{phase:"in_progress"}})},{id:"daemon/run/enable-success",title:"Daemon run / enable success",path:["TUI","Screens","Daemon","Run"],description:"Enable success includes resolved paths.",render:()=>(0,ht.jsx)(e0,{mode:"enable",state:{phase:"finished",result:{plistPath:xf.plist,binaryPath:xf.binary,logFile:xf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,ht.jsx)(e0,{mode:"disable",state:{phase:"finished"}})},{id:"daemon/run/restart-success",title:"Daemon run / restart success",path:["TUI","Screens","Daemon","Run"],description:"Restart success copy.",render:()=>(0,ht.jsx)(e0,{mode:"restart",state:{phase:"finished"}})},{id:"daemon/run/error",title:"Daemon run / error",path:["TUI","Screens","Daemon","Run"],description:"Mode-independent daemon command error.",render:()=>(0,ht.jsx)(e0,{mode:"restart",state:{phase:"errored",errorMessage:"launchctl bootstrap failed"}})},{id:"daemon/status/healthy",title:"Daemon status / healthy",path:["TUI","Screens","Daemon","Status"],description:"Healthy daemon report.",render:()=>(0,ht.jsx)(Fk,{report:nD})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,ht.jsx)(Fk,{report:tqe})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,ht.jsx)(Da,{title:"lore",subtitle:"component primitive",right:"v0.1.0"})},{id:"components/primitives/panel",title:"Components / panel",path:["TUI","Components","Primitives"],description:"Bordered container with title, subtitle, and focus styling.",render:()=>(0,ht.jsx)(Pn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,ht.jsx)(Ae,{color:ve.muted,children:"Panels compose screen sections and callouts."})})},{id:"components/primitives/status-line",title:"Components / status line",path:["TUI","Components","Primitives"],description:"Key/value rows with severity dots.",render:()=>(0,ht.jsxs)(Pn,{title:"StatusLine",children:[(0,ht.jsx)(nn,{label:"Healthy",value:"yes",kind:"success"}),(0,ht.jsx)(nn,{label:"Warning",value:"needs attention",kind:"warning"}),(0,ht.jsx)(nn,{label:"Error",value:"launchctl failed",kind:"error"})]})},{id:"components/primitives/progress-bar",title:"Components / progress bar",path:["TUI","Components","Primitives"],description:"Plain unicode progress bar for deterministic terminal rendering.",render:()=>(0,ht.jsx)(Pn,{title:"ProgressBar",children:(0,ht.jsx)(ZVe,{value:.62,label:"62%"})})},{id:"components/primitives/message-box",title:"Components / message box",path:["TUI","Components","Primitives"],description:"Severity callout for success, info, warning, and error copy.",render:()=>(0,ht.jsxs)(me,{flexDirection:"column",children:[(0,ht.jsx)(Ba,{kind:"success",title:"Shared",children:(0,ht.jsx)(Ae,{children:"Copied the Lore URL to your clipboard."})}),(0,ht.jsx)(me,{marginTop:1,children:(0,ht.jsx)(Ba,{kind:"error",title:"Failed",children:(0,ht.jsx)(Ae,{color:ve.muted,children:"presigned upload failed: HTTP 403"})})})]})},{id:"components/primitives/spinner",title:"Components / spinner",path:["TUI","Components","Primitives"],description:"Unrefed animated spinner primitive.",render:()=>(0,ht.jsx)(Pn,{title:"Spinner",children:(0,ht.jsx)(Ms,{label:"working on a terminal-friendly task\u2026"})})},{id:"components/inputs/menu",title:"Components / menu",path:["TUI","Components","Inputs"],description:"Keyboard menu with enabled and disabled items.",render:()=>(0,ht.jsx)(Pn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,ht.jsx)(eD,{items:[{id:"share",label:"Share",description:"upload a session"},{id:"status",label:"Status",description:"inspect daemon"},{id:"disabled",label:"Disabled",description:"not available in this state",disabled:!0}],onSelect:Kr})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,ht.jsx)(Pn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,ht.jsx)(vk,{items:[{id:"repo",label:"/Users/alex/code/tanagram-lore",initialChecked:!0},{id:"demo",label:"/Users/alex/code/customer-demo"},{id:"add",label:"+ Add a custom path\u2026",action:!0}],onSubmit:Kr,onAction:Kr})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,ht.jsx)(Pn,{title:"TextInput",children:(0,ht.jsx)(fz,{initialValue:"~/code",onSubmit:Kr,onCancel:Kr})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,ht.jsx)(Pn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,ht.jsx)(Az,{initialValue:"/Users/alex/code",loadSuggestions:async()=>aqe,onSubmit:Kr,onCancel:Kr})})}];function sqe(e){return pm.find(t=>t.id===e)}function rD(e){return e.path.slice(1).join(" / ")}var kr=ie(Lt(),1);function cqe({initialStoryId:e}){let t=Math.max(0,pm.findIndex(g=>g.id===e)),[n,r]=(0,Kk.useState)(t),[o,i]=(0,Kk.useState)("sidebar"),a=(0,Kk.useRef)(o);a.current=o;let{exit:c}=Ca();gu((g,h)=>{if(h.ctrl&&g==="c"){c();return}if(a.current==="sidebar"&&g==="q"){c();return}if(h.escape){if(a.current==="preview"){a.current="sidebar",i("sidebar");return}c();return}if(a.current==="preview"&&h.tab&&h.shift){a.current="sidebar",i("sidebar");return}if(a.current==="sidebar"&&h.tab&&!h.shift){a.current="preview",i("preview");return}if(a.current==="sidebar"){if(h.upArrow||g==="k"){r(S=>uqe(S-1));return}(h.downArrow||g==="j")&&r(S=>uqe(S+1))}});let d=pm[n]??pm[0];return(0,kr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,kr.jsx)(Da,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${pm.length}`}),(0,kr.jsx)(me,{marginBottom:1,children:(0,kr.jsx)(Ae,{color:ve.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,kr.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,kr.jsx)(me,{width:36,flexShrink:0,children:(0,kr.jsx)(Pn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,kr.jsx)(Yzt,{stories:pm,selectedIndex:n,focused:o==="sidebar"})})}),(0,kr.jsx)(me,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,kr.jsx)(Pn,{title:d.title,focused:o==="preview",subtitle:o==="preview"?`${rD(d)} \xB7 focused`:rD(d),children:(0,kr.jsxs)(me,{flexDirection:"column",children:[(0,kr.jsx)(Ae,{color:ve.muted,children:d.description}),o==="sidebar"?(0,kr.jsxs)(Ae,{color:ve.muted,children:["Press ",(0,kr.jsx)(Ae,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,kr.jsx)(me,{marginTop:1,children:d.render()})]})})})]})]})}function Yzt({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,a)=>{let c=i.path.slice(1),d=Xzt(o,c);for(let g=d;g<c.length;g++)r.push((0,kr.jsx)(Kzt,{label:c[g]??"",level:g,marginTop:Wzt(c[g]??"",g,d),focused:n},`group:${c.slice(0,g+1).join("/")}`));r.push((0,kr.jsx)(Jzt,{story:i,selected:a===t,focused:n},i.id)),o=c}),(0,kr.jsx)(me,{flexDirection:"column",children:r})}function Kzt({label:e,level:t,marginTop:n,focused:r}){return(0,kr.jsx)(me,{marginLeft:lqe(t),marginTop:n,children:(0,kr.jsx)(Ae,{color:r?ve.primary:ve.muted,bold:r,wrap:"truncate-end",children:e})})}function Jzt({story:e,selected:t,focused:n}){let r=n?t?ve.accent:ve.highlight:ve.muted;return(0,kr.jsxs)(me,{marginLeft:lqe(e.path.slice(1).length),children:[(0,kr.jsx)(Ae,{color:n&&t?ve.accent:ve.muted,children:t?"\u203A ":" "}),(0,kr.jsx)(Ae,{color:r,bold:n&&t,wrap:"truncate-end",children:Zzt(e)})]})}function Zzt(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function lqe(e){return Math.min(e,4)}function Wzt(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Xzt(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function uqe(e){let t=pm.length;return(e%t+t)%t}function dqe({story:e}){let{exit:t}=Ca();return gu((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,kr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,kr.jsx)(Da,{title:e.title,subtitle:rD(e),right:"Esc to exit"}),(0,kr.jsx)(me,{marginBottom:1,children:(0,kr.jsx)(Ae,{color:ve.muted,children:e.description})}),e.render()]})}var vue=ie(Lt(),1),pqe={meta:{name:"tui:stories",description:"Open the terminal story runner for Ink TUI screens.",hidden:!0,skipAutoupdate:!0},args:{story:{type:"string",description:"Open a specific story id."},list:{type:"boolean",description:"Print story ids instead of opening the runner."}},async run({args:e}){if(e.list||!process.stdin.isTTY||!process.stdout.isTTY){e8t();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=sqe(e.story.trim());if(!n){console.error(`Unknown TUI story: ${e.story}`),console.error("Run `lore tui:stories --list` to see available ids."),process.exitCode=1;return}await Jc((0,vue.jsx)(dqe,{story:n})).waitUntilExit();return}await Jc((0,vue.jsx)(cqe,{})).waitUntilExit()}};function e8t(){for(let e of pm)console.log(`${e.id} ${rD(e)} ${e.title}`)}m();wr();xE();m();await uo();var Zz=ie(an(),1);await BT();var Rue=ie(Lt(),1);function t8t({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,a]=(0,Zz.useState)(zk),{exit:c}=Ca();return(0,Zz.useEffect)(()=>{let d=!1,g=h=>{d||a(S=>Jz(S,h))};return(async()=>{try{let h=await n(g);if(d)return;r(h),setTimeout(()=>c(),100)}catch(h){if(g({kind:"error",message:h instanceof Error?h.message:String(h)}),d)return;o(h),setTimeout(()=>c(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{d=!0}},[]),(0,Rue.jsx)(eh,{title:e,subtitle:t,state:i})}async function oD(e){let t,n,r=!1;if(await Jc((0,Rue.jsx)(t8t,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}m();sR();so();import s8t from"node:os";import mqe from"node:path";m();import{spawn as n8t}from"node:child_process";import r8t from"node:os";async function fqe(e,t={}){let n=t.timeoutMs??2e3,r=o8t();for(let o of r)if(await i8t(o,e,n))return!0;return!1}function o8t(){switch(r8t.platform()){case"darwin":return[{name:"pbcopy",args:[]}];case"linux":return[{name:"wl-copy",args:[]},{name:"xclip",args:["-selection","clipboard"]},{name:"xsel",args:["--clipboard","--input"]}];case"win32":return[{name:"clip.exe",args:[]}];default:return[]}}async function i8t(e,t,n){return new Promise(r=>{let o;try{o=n8t(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,a=d=>{i||(i=!0,r(d))},c=setTimeout(()=>{o.kill("SIGKILL"),a(!1)},n);o.on("error",()=>{clearTimeout(c),a(!1)}),o.on("close",d=>{clearTimeout(c),a(d===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}Jn();wr();wk();Dk();xT();lz();HE();m();var iD=()=>{};m();wr();ZE();async function a8t(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw tc(`resolve share highlight for thread ${t}`,r.status,r.body);return{url:r.body.url,matched:r.body.matched,start_block_id:r.body.start_block_id,end_block_id:r.body.end_block_id}}async function Wz(e,t,n){try{return await a8t(e,t,n)}catch(r){return Ee.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}m();Jn();ZE();function Aqe(e){if(e instanceof XR)return"billing_required";if(e instanceof kk)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof Ue)return"validation_failed";if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not logged in")||t.includes("unauthorized")||t.includes("unauthenticated")||t.includes("authentication failed")||t.includes("authentication required")||t.includes("auth required")||t.includes("bearer token"))return"auth_failed";if(t.includes("timed out waiting for thread")&&t.includes("parsing")||t.includes("parse timeout"))return"parsing_timeout";if(t.includes("parsing failed permanently"))return"parsing_failed";if(t.includes("econnrefused")||t.includes("econnreset")||t.includes("etimedout")||t.includes("enotfound")||t.includes("network"))return"network_failed"}return"unknown"}ZE();var u8t=new Set(["private","workspace","public"]);function c8t(e){let t=(e??"").trim();if(!t)return"";if(!u8t.has(t))throw new Ue(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function xue(e={}){let t=e.progress??iD,n=c8t(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",a=null;try{t({kind:"step",step:"resolving_session"});let c=await a5e({sessionId:o,project:r});i="auth",await A8t();let d=e.client??Wt();i="collecting_local_file",a=await l8t(c),t({kind:"step",step:"uploading",label:a.filename}),i="uploading";let{reused:g,file:h}=await d8t(d,a);Ee.info("export_upload_single_file_result",{filename:a.filename,reused:g,response:JSON.stringify(h)});let S=h.thread?.id?.trim();if(!S)throw Kn().setContext("upload_single_file_response",{filename:a.filename,reused:g,response:h}),new Error(`upload session response missing thread id for ${a.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await Kx(d,S);let y=h.thread?.visibility?.trim()??"",C=y;n&&n!==y&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),C=await p8t(d,S,n));let v=f8t(S),x,N=e.highlight?.trim();if(N){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let Q=await Wz(d,S,N);Q&&(v=Q.url,x={query:N,matched:Q.matched,start_block_id:Q.start_block_id,end_block_id:Q.end_block_id})}let k=await fqe(v);return t({kind:"completed",url:v,reused:g,visibility:C,clipboardCopied:k,sessionId:c.sessionId?.trim()??""}),t({kind:"step",step:"done"}),qE("lore.cli.thread_exported",{thread_id:S,harness:a.harness,visibility:C,reused:g}),{thread_id:S,url:v,session_id:c.sessionId?.trim()??"",project:c.project,reused:g,visibility:C,clipboard_copied:k,...x?{highlight:x}:{}}}catch(c){throw qE("lore.cli.upload_failed",{error_category:Aqe(c),error_message:Mi(c),step:i}),c}finally{a&&await jx(a.tempPath)}}async function l8t(e){let t=await s5e(e),n=await va(t.fullPath);if(!n.exists)throw new Ue(`session transcript not found at ${m8t(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await cp(e.project),o=await bf(t.fullPath);return{key:t.key,filename:t.relativeFilename,sourcePath:t.fullPath,repoOriginPath:r,tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:e.sessionId?.trim()??"",watchedState:n}}async function d8t(e,t){let n=await qx(e,[t]);if(n.thread_files.length!==1)throw new Error(`upload session returned ${n.thread_files.length} files for 1 local file`);let r=n.thread_files[0];if(!r)throw new Error("upload session response missing thread file");if(!r.presigned_url?.trim()){if(!r.thread?.id?.trim()){let a=r.error?.trim()?`: ${r.error.trim()}`:"";throw new Ue(`upload session for ${t.filename} returned no upload URL and no reusable thread${a}`)}return{reused:!0,file:r}}await JE(r.presigned_url,t.tempPath);let o=await Yx(e,n.id,[r]);if(o.thread_files.length!==1)throw new Error(`complete upload session returned ${o.thread_files.length} files for 1 local file`);let i=o.thread_files[0];if(!i?.thread?.id)throw new Error(`complete upload session response missing thread for ${t.filename}`);return{reused:!1,file:{...r,thread:i.thread}}}async function p8t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw tc(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function f8t(e){return`${KE().replace(/\/+$/,"")}/thread/${e}`}async function A8t(){let e=await xn();if(!e)throw new Ue("not logged in \u2014 run 'lore login' first");return e}function m8t(e){let t=s8t.homedir();if(!t)return e;let n=mqe.relative(t,e);return!n||n.startsWith("..")?e:mqe.join("~",n)}var gqe={meta:{name:"export",description:"Upload a single Claude Code session to Lore and print its URL"},args:{"session-id":{type:"string",description:"Claude Code session ID to export. Defaults to the most recent session for $PWD."},project:{type:"string",description:"Project path used to resolve a session when --session-id is not provided. Defaults to the current working directory."},visibility:{type:"string",description:"Set thread visibility: private, workspace, or public. Defaults to leaving the existing visibility untouched."},highlight:{type:"string",description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e,data:t}){Ee.info("command_start",{command:"export"});let n={sessionId:typeof e["session-id"]=="string"?e["session-id"]:void 0,project:typeof e.project=="string"?e.project:void 0,visibility:typeof e.visibility=="string"?e.visibility:void 0,highlight:typeof e.highlight=="string"?e.highlight:void 0,client:t?.client};if(Au()&&!t?.progress){await oD({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:o=>xue({...n,progress:o})});return}let r=await xue({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};m();m();nT();so();Gl();Jn();wr();Gx();Yc();var g8t=5,h8t=1e3;async function _qe(e={}){(e.environment??Ni())!=="dev"||!await _8t({fetchFn:e.fetchFn})||await E8t({client:e.client})}async function _8t(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return Ee.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??g8t,o=e.retryDelayMs??h8t,i=`${RE()}/api/cli-auth/dev-token`;for(let a=1;a<=r;a+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404){let g=await hqe(c);return Qg(),Ee.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:g,url:i}),!1}if(!c.ok){let g=await hqe(c);return Qg(),Ee.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:g}),!1}let d=await c.json();return d.access_token?(ZR(d.access_token),Ee.info("dev_preflight_token_minted",{email:t,expiresIn:d.expires_in}),!0):(Qg(),Ee.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(a===r)return Qg(),Ee.warn("dev_preflight_token_unreachable",{url:i,error:Mi(c)}),!1;await S8t(o)}return!1}async function E8t(e={}){await Zg();let t=await ba();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=qc(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Wt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){Ee.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){Ee.warn("dev_preflight_whoami_error",{error:Mi(o)});return}await Jl({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),Ee.info("dev_preflight_upload_dir_seeded",{path:n})}async function hqe(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function S8t(e){return new Promise(t=>{setTimeout(t,e)})}Pk();m();Jn();wr();Pk();import Eqe from"node:fs";import{watch as y8t}from"node:fs/promises";import Sqe from"node:path";import{setTimeout as Due}from"node:timers/promises";var T8t=2e3,I8t=3e4;function C8t(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Mk).map(n=>n.historyFilePath())}async function yqe(e={}){let t=e.debounceMs??T8t,n=e.pollIntervalMs??I8t,r=C8t(e),o=e.runUploadFn??Rz,i=e.signal?void 0:new AbortController,a=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let d=!1,g=!1,h=async x=>{if(d){g=!0;return}d=!0;try{do{if(g=!1,a.aborted)break;try{let N=await o(e.uploadOptions);Ee.info("watch_sync_complete",{reason:x,uploaded:N.length})}catch(N){Ee.error("watch_sync_failed",{reason:x,error:Mi(N)})}}while(g&&!a.aborted)}finally{d=!1}},S,y=x=>{S&&clearTimeout(S),S=setTimeout(()=>{S=void 0,h(x)},t),S.unref?.()};Ee.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let C=async x=>{for(;!a.aborted;)try{let N=Eqe.existsSync(x)&&Eqe.statSync(x).isDirectory(),k=N?x:Sqe.dirname(x),Q=N?void 0:Sqe.basename(x);for await(let j of y8t(k,{signal:a,recursive:N})){if(a.aborted)break;(Q===void 0||!j.filename||j.filename===Q)&&y("fs-event")}}catch(N){if(a.aborted||N?.name==="AbortError")break;Ee.warn("watch_fs_retry",{path:x,error:Mi(N)}),await Due(n,void 0,{signal:a}).catch(()=>{})}},v=async()=>{for(;!a.aborted;){try{await Due(n,void 0,{signal:a})}catch{break}if(a.aborted)break;h("poll")}};try{await Promise.all([...r.map(C),v()])}finally{for(S&&clearTimeout(S),i&&(process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c));d;)await Due(50).catch(()=>{});Ee.info("watch_stop",{})}}var Tqe={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await _qe(),await yqe({uploadOptions:n});return}let r=await Rz(n);console.log(JSON.stringify(r))}};m();xE();m();so();wk();xT();Pk();import{spawn as b8t}from"node:child_process";import Iqe from"node:path";ZE();async function Bue(e){let t=e.progress??iD;if(!await xn())throw new Jx;t({kind:"step",step:"resolving_session"});let r=Iqe.resolve(e.sessionFile),o=Iqe.basename(r),i=e.harnessInternalId?.trim()||B8t(o)||o,a=await va(r);if(!a.exists)throw new Error(`session file does not exist: ${r}`);let c=await bf(r),d={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:c.tempPath,md5:c.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:a},g=e.client??Wt();try{t({kind:"step",step:"uploading",label:o});let h=await qx(g,[d]),S=h.thread_files[0];if(!S)throw new Error("create upload session returned no thread files");let y=S.thread,C=!S.presigned_url?.trim()&&!!y?.id,v=y;if(!C){if(!S.presigned_url?.trim()){let be=S.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${be}`)}await JE(S.presigned_url,c.tempPath),v=(await v8t(g,h.id,S)).thread}let x=v?.id?.trim();if(!x)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await Kx(g,x);let N=v?.visibility?.trim()??"",k=N,Q=e.visibility;Q&&Q!==N&&(t({kind:"step",step:"updating_visibility"}),k=await R8t(g,x,Q));let j=`${KE().replace(/\/+$/,"")}/thread/${x}`,G,q=e.highlight?.trim();if(q){t({kind:"step",step:"resolving_highlight"});let ye=await Wz(g,x,q);ye&&(j=ye.url,G={query:q,matched:ye.matched,start_block_id:ye.start_block_id,end_block_id:ye.end_block_id})}let oe=await N8t(j),ge=D8t(k)?k:"private";return t({kind:"completed",url:j,reused:C,visibility:ge,clipboardCopied:oe,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:x,url:j,session_id:i,project:"",reused:C,visibility:ge,clipboard_copied:oe,...G?{highlight:G}:{}}}finally{await jx(c.tempPath)}}async function v8t(e,t,n){let o=(await Yx(e,t,[n])).thread_files[0];if(!o)throw new Error("complete upload session returned no thread files");return{thread:o.thread}}async function R8t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw tc(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var x8t=new Set(["private","workspace","public"]);function D8t(e){return x8t.has(e)}function B8t(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function N8t(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await O8t(n,r,e))return!0;return!1}function O8t(e,t,n){return new Promise(r=>{let o;try{o=b8t(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var Cqe=["private","workspace","public"],bqe={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=w8t(e.visibility);if(Au())await oD({title:"lore share-codex",subtitle:"sharing this Codex session",perform:r=>Bue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:r})});else{let r=await Bue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function w8t(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!Cqe.includes(e))throw new Error(`--visibility must be one of: ${Cqe.join(", ")}`);return e}}m();so();wr();wk();xE();Jse();Zse();m();import k8t from"node:crypto";ZE();var M8t=async(e,t)=>{let n={method:"PUT",body:typeof t=="string"?t:new Uint8Array(t)};return{status:(await fetch(e,n)).status}};async function Nue(e,t,n={}){let r=n.progress??iD,{contents:o,accountId:i,orgId:a,sessionId:c}=t,d=k8t.createHash("md5").update(o.transcript).digest("hex");r({kind:"step",step:"resolving_session",label:c});let g=await e.createUploadSession({headers:{},body:{thread_files:[{md5:d,harness:"cowork",harness_internal_id:c,filename:"audit.jsonl",file_type:"transcript",artifact_metadata:{uploads:o.uploads,outputs:o.outputs}}]}});if(g.status!==201)throw tc("createUploadSession",g.status,g.body);let h=g.body.thread_files[0];if(h.error&&h.thread)return{threadId:h.thread.id,duplicate:!0};if(!h.presigned_url)throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);r({kind:"step",step:"uploading"});let y=await(n.putBlob??M8t)(h.presigned_url,Buffer.from(o.transcript,"utf8"));if(y.status<200||y.status>=300)throw new Error(`presigned PUT failed: HTTP ${y.status}`);let C=await e.completeUploadSession({headers:{},params:{id:g.body.id},body:{thread_files:[{storage_url:h.storage_url}]}});if(C.status!==200)throw tc("completeUploadSession",C.status,C.body);let v=C.body.thread_files[0];if(!v?.thread)throw new Error(`completeUploadSession returned no thread: ${JSON.stringify(v)}`);return{threadId:v.thread.id,duplicate:!1}}var vqe={meta:{name:"share-cowork",description:"Share a Claude Cowork local-agent-mode session to Lore. Defaults to the current session when run from inside one (e.g. by the Cowork agent itself); otherwise shares the most recent local session."},args:{session:{type:"string",description:"Share a specific session by session-id (the bottom-level uuid)"},list:{type:"boolean",description:"List local Cowork sessions (newest first) and exit without sharing"}},async run({args:e,data:t}){Ee.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=Cz();if(e.list){let g=Vx(n);if(g.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of g)console.log(U8t(h));return}let r=P8t(n,typeof e.session=="string"?e.session:void 0);if(!r)throw console.error(`No Cowork session found. Tried CWD walk-up and the most recent under
507
+ `)&&(t.data=t.data.slice(0,-1)),t)}var kVe={meta:{name:"daemon",description:"Run the workspace skill sync daemon.",hidden:!0,skipAutoupdate:!0},args:{"poll-interval-ms":{type:"string",description:"Fallback full-sync poll interval in milliseconds.",default:"300000"}},async run({args:e,data:t}){let n=t,o=await(n?.getAccessToken??xn)();if(!o)throw new Ue("workspace skill sync daemon requires login \u2014 run 'lore login' first");let i=n?.client??Wt({token:o}),a=await i.whoAmI({headers:{}});if(a.status!==200)throw new Ue(`whoAmI returned ${a.status}`);let c=a.body.organizations.map(h=>h.id),d=(n?.createEventStream??wVe)({organizationIds:c,token:o}),g=Number(e["poll-interval-ms"]);if(!Number.isFinite(g)||g<=0)throw new Ue("--poll-interval-ms must be a positive number");await(n?.runSkillSyncDaemon??BVe)({client:i,events:d,pollIntervalMs:g,onSyncPass:({reason:h,result:S})=>{console.log(`skill sync ${h}: ${S.installedUpdated} updated, ${S.localEditsUploaded} local edit${S.localEditsUploaded===1?"":"s"} uploaded, ${S.conflicts} conflict${S.conflicts===1?"":"s"}`)}})}};m();import bue from"node:fs/promises";import MVe from"node:path";so();Jn();var PVe={meta:{name:"install",description:"Pull a workspace skill from Lore and write it to ~/.claude/skills/<name>/SKILL.md."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Ue("install needs a skill ID \u2014 e.g. `lore skills install sk_01j...`");if(!await xn())throw new Ue("workspace skill installs require login \u2014 run 'lore login' first");let n=Wt();await Tzt(n,t)}};async function Tzt(e,t){let n=await vzt(e,t);if(!Lk(n.name))throw new Ue(`refusing to install skill with invalid name: ${JSON.stringify(n.name)}`);let r=Qk(n.rootKind,n.name),o=await Rzt(r),i=await Wx(n.skillId),a=i?.installPath!=null&&MVe.resolve(i.installPath)===MVe.resolve(r);if(o!==null&&!a)throw new Ue(`refusing to overwrite ${r}; it already exists and is not managed by Lore`);let c=await wz(n.rootKind,n.name,n.bodyMd),d=await Izt(e,t,o,c),g=n.latestVersion,h={installationId:d.body.id,skillId:n.skillId,name:n.name,rootKind:n.rootKind,installPath:c,baseVersion:g,baseContentHash:n.contentHash,lastInstalledVersion:g,lastInstalledHash:n.contentHash,lastSyncStatus:"current"};try{await Czt(e,d.body.id,g)}catch(S){throw await pp({...h,lastSyncStatus:"error"}),S}await pp(h),o===n.bodyMd?console.log(`/${n.name} is already up to date at ${c}`):console.log(`installed /${n.name} (${n.skillId}) -> ${c}`)}async function Izt(e,t,n,r){try{let o=await e.installSkill({params:{id:t},body:{}});if(o.status!==200){let i=o.body?.message??`installSkill returned ${o.status}`;throw new Ue(i)}return o}catch(o){throw await bzt(r,n),o}}async function Czt(e,t,n){let r=await e.updateSkillInstallation({params:{id:t},body:{installed_version:n}});if(r.status!==200){let o=r.body?.message??`updateSkillInstallation returned ${r.status}`;throw new Ue(`installed ${t} locally, but failed to record installed version: ${o}`)}}async function bzt(e,t){if(t===null){await bue.rm(e,{force:!0});return}await bue.writeFile(e,t,"utf8")}async function vzt(e,t){let n=await e.getSkillDetail({params:{id:t}});if(n.status!==200){let a=n.body?.message??`getSkillDetail returned ${n.status}`;throw new Ue(a)}if(!n.body.content_hash)throw new Ue("No SKILL.md content has been captured for this skill yet.");let r=await e.getSkillRaw({params:{id:t}});if(r.status!==200){let a=r.body?.message??`getSkillRaw returned ${r.status}`;throw new Ue(a)}let o=typeof r.body=="string"?r.body:String(r.body);if(XE(o)!==n.body.content_hash)throw new Ue("downloaded SKILL.md hash did not match the skill metadata");return{skillId:n.body.id,name:n.body.name,rootKind:n.body.root_kind,latestVersion:n.body.latest_version,contentHash:n.body.content_hash,bodyMd:o}}async function Rzt(e){try{return await bue.readFile(e,"utf8")}catch{return null}}m();so();Jn();var UVe={meta:{name:"list",description:"List skills available in your workspace."},async run(){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=await Wt().listSkills({});if(t.status!==200){let n=t.body?.message??`listSkills returned ${t.status}`;throw new Ue(n)}if(t.body.objects.length===0){console.log("no skills in this workspace yet");return}for(let n of t.body.objects){let r=n.id??"observed",o=n.source?` [${n.source}]`:"",i=n.root_kind?` ${n.root_kind}`:"",a=n.description?` \u2014 ${n.description}`:"";console.log(`${r} /${n.name}${i}${o}${a}`)}}};m();so();Jn();var LVe={meta:{name:"publish",description:"Push a local SKILL.md to Lore so it can be downloaded and installed by your team. Pass --all to publish every skill in ~/.claude/skills/."},args:{name:{type:"positional",required:!1,description:"Skill directory name under ~/.claude/skills/<name>/SKILL.md or ./.claude/skills/<name>/SKILL.md"},all:{type:"boolean",required:!1,description:"Publish every locally installed skill in one go"}},async run({args:e}){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=Wt(),n=await xzt(e);if(n.length===0)throw new Ue("no skills to publish \u2014 pass a name like `lore skills publish feature` or `--all`");let r=0;for(let o of n){let i=typeof o=="string"?await H9e(o):o,a=typeof o=="string"?o:o.name;if(!i){console.error(`skip ${a}: no SKILL.md found locally`);continue}if(!await W9e(i)){r+=1,console.log(`unchanged /${a} from ${i.filePath}`);continue}let c=await Mz(t,i,{published:!0});await X9e(i),r+=1,console.log(`published /${a} (v${c.latest_version}, ${c.visibility}) from ${i.filePath}`)}if(r===0)throw new Ue("no skills were published \u2014 check the names and try again")}};async function xzt(e){if(e.all)return fue();let t=typeof e.name=="string"?e.name.trim():"";return t?[t]:[]}m();so();Jn();var QVe={meta:{name:"sync",description:"Sync installed Lore-managed skills to their latest accepted versions."},async run(){if(!await xn())throw new Ue("workspace skill sync requires login \u2014 run 'lore login' first");let e=await Cue(Wt());console.log(`skill sync complete: ${e.installedUpdated} updated, ${e.localEditsUploaded} local edit${e.localEditsUploaded===1?"":"s"} uploaded, ${e.conflicts} conflict${e.conflicts===1?"":"s"}`)}};m();import FVe from"node:fs/promises";import Dzt from"node:path";so();Jn();var GVe={meta:{name:"uninstall",description:"Remove a Lore-managed skill by stable skill ID."},args:{target:{type:"positional",required:!0,description:"Workspace skill ID"}},async run({args:e}){let t=typeof e.target=="string"?e.target.trim():"";if(!t)throw new Ue("uninstall needs a skill ID \u2014 e.g. `lore skills uninstall sk_01j...`");if(!await xn())throw new Ue("workspace skill uninstalls require login \u2014 run 'lore login' first");let n=Wt();await Bzt(n,t)}};async function Bzt(e,t){let n=await Wx(t);n&&(await FVe.rm(n.installPath,{force:!0}),await FVe.rmdir(Dzt.dirname(n.installPath)).catch(()=>{}));let r=await e.uninstallSkill({params:{id:t},body:{}});if(r.status!==200){let o=r.body?.message??`uninstallSkill returned ${r.status}`;throw new Ue(o)}if(await $9e(t),n){console.log(`uninstalled /${n.name} (${t}) from ${n.installPath}`);return}console.log(`uninstalled ${t}`)}var jVe={meta:{name:"skills",description:"Publish, install, and list skills shared via Lore."},subCommands:{publish:LVe,install:PVe,uninstall:GVe,sync:QVe,daemon:kVe,approve:DVe,list:UVe}};m();m();so();Jn();var HVe={meta:{name:"channels",description:"List Slack channels the bot can see for your workspace."},async run(){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=await Wt().slack.listSlackChannels();if(t.status===200){for(let r of t.body.channels){let o=r.is_private?"(private)":"";console.log(`#${r.name} ${o}`.trim())}t.body.channels.length===0&&console.log("No channels found. Make sure the Lore bot is invited to at least one channel.");return}if(t.status===404)throw new Ue("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let n=t.body?.message??`unexpected status ${t.status}`;throw new Ue(n)}};m();so();Jn();var zVe={meta:{name:"post",description:"Post a Lore thread link to a Slack channel."},args:{channel:{type:"positional",required:!0,description:"Slack channel name (with or without #)"},"thread-id":{type:"string",required:!0,description:"The Lore thread ID to post (e.g. th_...)"}},async run({args:e}){if(!await xn())throw new Ue("not logged in \u2014 run 'lore login' first");let t=(typeof e.channel=="string"?e.channel:"").replace(/^#/,""),n=e["thread-id"];if(!t)throw new Ue("channel name is required \u2014 e.g. `lore slack post general --thread-id th_...`");if(!n)throw new Ue("--thread-id is required \u2014 e.g. `lore slack post general --thread-id th_...`");let o=await Wt().slack.postToSlack({body:{channel_name:t,thread_id:n}});if(o.status===200){console.log(JSON.stringify({ok:!0,channel:t,ts:o.body.ts}));return}if(o.status===404)throw new Ue("No Slack installation found for your workspace. Connect Slack from Account Settings first.");let i=o.body?.message??`unexpected status ${o.status}`;throw new Ue(i)}};var $Ve={meta:{name:"slack",description:"Slack integration commands."},subCommands:{channels:HVe,post:zVe}};xE();m();await uo();var Kz=ie(an(),1);Gl();await BT();m();await uo();var Vz=ie(an(),1);await am();m();await uo();var Xx=ie(an(),1);xa();var Zl=ie(Lt(),1);function eD({items:e,onSelect:t,initialIndex:n=0,disabled:r=!1,hint:o,labelWidth:i=20}){let[a,c]=(0,Xx.useState)(VVe(e,n)),d=(0,Xx.useRef)(a);return(0,Xx.useEffect)(()=>{let g=VVe(e,n);d.current=g,c(g)},[e,n]),gu((g,h)=>{if(e.length!==0){if(h.upArrow||g==="k"){let S=Nzt(e,d.current);d.current=S,c(S);return}if(h.downArrow||g==="j"){let S=qVe(e,d.current);d.current=S,c(S);return}if(h.return||g===" "){let S=e[d.current];S&&!S.disabled&&t(S)}}},{isActive:!r}),e.length===0?(0,Zl.jsx)(Ae,{color:ve.muted,children:"no actions available"}):(0,Zl.jsxs)(me,{flexDirection:"column",children:[e.map((g,h)=>{let S=h===a,y=g.disabled?ve.muted:S?ve.primary:ve.highlight;return(0,Zl.jsxs)(me,{children:[(0,Zl.jsx)(me,{width:2,flexShrink:0,children:(0,Zl.jsx)(Ae,{color:S?ve.primary:ve.muted,children:S?"\u203A":" "})}),(0,Zl.jsx)(me,{width:i,flexShrink:0,children:(0,Zl.jsx)(Ae,{color:y,bold:S&&!g.disabled,children:g.label})}),g.description?(0,Zl.jsx)(me,{flexGrow:1,flexShrink:1,children:(0,Zl.jsx)(Ae,{color:ve.muted,children:g.description})}):null]},g.id)}),o?(0,Zl.jsx)(me,{marginTop:1,children:(0,Zl.jsx)(Ae,{color:ve.muted,children:o})}):null]})}function VVe(e,t){if(e.length===0)return 0;let n=Math.max(0,Math.min(t,e.length-1));return e[n]?.disabled?qVe(e,n-1):n}function qVe(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t+n)%e.length;if(!e[r]?.disabled)return r}return t}function Nzt(e,t){if(e.length===0)return 0;for(let n=1;n<=e.length;n++){let r=(t-n+e.length)%e.length;if(!e[r]?.disabled)return r}return t}await sm();await wT();await kT();xa();m();so();Gx();Uk();Yc();async function jz(e){if(!await(e.hasAccessToken??(async()=>!!await xn()))())return{state:"logged_out"};let n=e.client??Wt();try{let r=await n.whoAmI({headers:{}});return r.status!==200?{state:"error",message:YVe(r.body,`whoAmI returned ${r.status}`)}:{state:"ready",userId:r.body.user.id,email:r.body.emailAddress,displayName:r.body.user.display_name,organizations:r.body.organizations,activeOrganizationId:r.body.organizationId,activeOrganizationName:r.body.org_name}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function Hz(e){let t=e.platform??process.platform;if(t!=="darwin")return{state:"unsupported",platform:t};let n=e.getDaemonStatus??Bz;try{return{state:"ready",report:await n()}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function zz(e){if(!await(e.hasAccessToken??(async()=>!!await xn()))())return{state:"logged_out"};let n=e.client??Wt();try{let r=await n.listSkills({});if(r.status!==200)return{state:"error",message:YVe(r.body,`listSkills returned ${r.status}`)};let o=r.body.objects.length,i=r.body.objects.filter(a=>(a.source??"").trim()==="lore").length;return{state:"ready",count:o,published:i}}catch(r){return{state:"error",message:r instanceof Error?r.message:String(r)}}}async function $z(){try{await Zg();let e=await ba();return Ozt(e)}catch(e){return{state:"error",message:e instanceof Error?e.message:String(e)}}}function Ozt(e){return{state:"ready",cwd:e.include.cwd,repo:e.include.repo}}function YVe(e,t){if(e&&typeof e=="object"&&"message"in e){let n=e.message;if(typeof n=="string"&&n.length>0)return n}return t}var Bt=ie(Lt(),1);function t0({cliVersion:e,initialData:t,deps:n={},onSelect:r}){let{exit:o}=Ca(),[i,a]=(0,Vz.useState)(t??{identity:{state:"loading"},daemon:{state:"loading"},skills:{state:"loading"},uploadDirs:{state:"loading"}});(0,Vz.useEffect)(()=>{if(t)return;let d=!1;return(async()=>{let[g,h,S,y]=await Promise.all([jz(n),Hz(n),zz(n),$z()]);d||a({identity:g,daemon:h,skills:S,uploadDirs:y})})(),()=>{d=!0}},[]),gu((d,g)=>{(d==="q"||g.ctrl&&d==="c"||g.escape)&&(r("quit"),o())});let c=Lzt(i);return(0,Bt.jsxs)(me,{flexDirection:"column",paddingY:1,paddingX:1,children:[(0,Bt.jsx)(Da,{title:"lore",subtitle:kzt(i.identity),right:`v${e}`}),(0,Bt.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,Bt.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Pn,{title:"Daemon",children:(0,Bt.jsx)(Mzt,{daemon:i.daemon})})}),(0,Bt.jsx)(me,{flexDirection:"column",width:"50%",children:(0,Bt.jsx)(Pn,{title:"Workspace",children:(0,Bt.jsx)(Pzt,{identity:i.identity,skills:i.skills})})})]}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsx)(Pn,{title:"Upload filters",subtitle:i.uploadDirs.state==="ready"?`${i.uploadDirs.cwd.length+i.uploadDirs.repo.length} configured`:void 0,children:(0,Bt.jsx)(wzt,{uploadDirs:i.uploadDirs})})}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsx)(Pn,{title:"Quick actions",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Bt.jsx)(eD,{items:c,onSelect:d=>{r(d.id),o()}})})})]})}function wzt({uploadDirs:e}){return e.state==="loading"?(0,Bt.jsx)(Ms,{label:"reading ~/.lore/upload_filters.json\u2026"}):e.state==="error"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]}):e.cwd.length===0&&e.repo.length===0?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"none configured \u2014 the daemon won't auto-upload anything",kind:"warning"}),(0,Bt.jsx)(me,{marginTop:1,children:(0,Bt.jsxs)(Ae,{color:ve.muted,children:["Run ",(0,Bt.jsx)(Ae,{bold:!0,children:"lore configure"})," to pick directories interactively."]})})]}):(0,Bt.jsxs)(me,{flexDirection:"column",children:[e.cwd.map(t=>(0,Bt.jsx)(nn,{label:"cwd",value:t,kind:"success",labelWidth:16},`cwd:${t}`)),e.repo.map(t=>(0,Bt.jsx)(nn,{label:"repo",value:t,kind:"success",labelWidth:16},`repo:${t}`))]})}function kzt(e){switch(e.state){case"ready":{let t=e.activeOrganizationName??"";return t?`${e.email} \xB7 ${t}`:e.email}case"logged_out":return"not signed in";case"loading":return"loading\u2026";case"error":return"identity error"}}function Mzt({daemon:e}){if(e.state==="loading")return(0,Bt.jsx)(Ms,{label:"reading launchd state\u2026"});if(e.state==="unsupported")return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(Ae,{color:ve.muted,children:"Background uploads are macOS-only today."}),(0,Bt.jsxs)(Ae,{color:ve.muted,children:["Detected platform: ",e.platform]})]});if(e.state==="error")return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]});let t=e.report,n=t.healthy?"success":t.enabled?"warning":"idle";return(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:t.health,kind:n}),(0,Bt.jsx)(nn,{label:"Enabled",value:t.enabled?"yes":"no",kind:t.enabled?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Running",value:t.running?"yes":"no",kind:t.running?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Heartbeat",value:KVe(t.status?.last_heartbeat_at),kind:t.heartbeat_fresh?"success":"idle"}),(0,Bt.jsx)(nn,{label:"Last upload",value:KVe(t.status?.last_success_at)}),t.status?.last_error?(0,Bt.jsx)(nn,{label:"Last error",value:t.status.last_error,kind:"error"}):null]})}function Pzt({identity:e,skills:t}){return e.state==="loading"?(0,Bt.jsx)(Ms,{label:"loading your account\u2026"}):e.state==="logged_out"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"signed out",kind:"warning"}),(0,Bt.jsx)(Ae,{color:ve.muted,children:"Choose \u201CSign in\u201D below to authorise this CLI."})]}):e.state==="error"?(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"Status",value:"error",kind:"error"}),(0,Bt.jsx)(Ae,{color:ve.danger,children:e.message})]}):(0,Bt.jsxs)(me,{flexDirection:"column",children:[(0,Bt.jsx)(nn,{label:"User",value:e.email,kind:"success"}),(0,Bt.jsx)(nn,{label:"Display name",value:e.displayName}),(0,Bt.jsx)(nn,{label:"Workspace",value:e.activeOrganizationName??"\u2014",kind:e.activeOrganizationName?"info":"idle"}),(0,Bt.jsx)(nn,{label:"Other workspaces",value:Math.max(0,e.organizations.length-1)}),(0,Bt.jsx)(nn,{label:"Skills",value:Uzt(t)})]})}function Uzt(e){return e.state==="loading"?"loading\u2026":e.state==="logged_out"?"\u2014":e.state==="error"?`error (${e.message})`:`${e.count} installed \xB7 ${e.published} published`}function Lzt(e){let t=e.identity.state==="ready",n=e.daemon.state==="ready"&&e.daemon.report.enabled,r=e.daemon.state!=="unsupported",o=[];return t&&(o.push({id:"share-codex",label:"Share Codex",description:"lore share-codex --session-file <path>"}),o.push({id:"share-cowork",label:"Share Cowork",description:"lore share-cowork"}),o.push({id:"export",label:"Export Claude",description:"lore export"})),r&&(n?(o.push({id:"status",label:"Daemon status",description:"lore status"}),o.push({id:"restart",label:"Restart daemon",description:"lore restart"}),o.push({id:"disable",label:"Disable daemon",description:"lore disable"})):o.push({id:"enable",label:"Enable daemon",description:"lore enable"})),t?(o.push({id:"configure",label:"Configure uploads",description:"lore configure"}),o.push({id:"listen-list",label:"Manage upload dirs",description:"lore listen list"}),o.push({id:"skills-list",label:"Skills",description:"lore skills list"}),o.push({id:"workspaces-list",label:"Workspaces",description:"lore workspaces list"}),o.push({id:"logout",label:"Sign out",description:"lore logout"})):o.push({id:"login",label:"Sign in",description:"lore login"}),o.push({id:"quit",label:"Quit",description:"exit the dashboard"}),o}function KVe(e){if(!e)return"never";let t=Date.parse(e);if(Number.isNaN(t))return e;let n=Math.max(0,Math.floor((Date.now()-t)/1e3));return n<60?`${n}s ago`:n<3600?`${Math.floor(n/60)}m ago`:n<86400?`${Math.floor(n/3600)}h ago`:`${Math.floor(n/86400)}d ago`}m();await uo();await am();await sm();xa();var Xo=ie(Lt(),1),Qzt=[{id:"login",label:"Sign in with WorkOS",description:"opens your browser for a device-code flow"},{id:"quit",label:"Quit",description:"exit without signing in"}];function qz({cliVersion:e,onSelect:t}){let{exit:n}=Ca();return gu((r,o)=>{(r==="q"||o.ctrl&&r==="c"||o.escape)&&(t("quit"),n())}),(0,Xo.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,Xo.jsx)(Da,{title:"lore",subtitle:"welcome",right:`v${e}`}),(0,Xo.jsx)(Pn,{title:"What is Lore?",children:(0,Xo.jsxs)(me,{flexDirection:"column",children:[(0,Xo.jsx)(Ae,{children:"Lore captures your Claude Code, Codex, and Cowork sessions and shares them with your team \u2014 searchable, discussable, and remixable."}),(0,Xo.jsxs)(me,{marginTop:1,flexDirection:"column",children:[(0,Xo.jsx)(Ae,{color:ve.muted,children:"You'll get:"}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Background auto-upload of every Claude Code session"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," One-command share for Codex rollouts and Cowork sessions"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Skill publishing and discovery across your workspace"]}),(0,Xo.jsxs)(Ae,{children:[(0,Xo.jsx)(Ae,{color:ve.success,children:" \u2713"})," Thread search, dashboards, and discussion"]})]})]})}),(0,Xo.jsx)(me,{marginTop:1,children:(0,Xo.jsx)(Pn,{title:"Sign in to continue",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose \xB7 q to quit",children:(0,Xo.jsx)(eD,{items:Qzt,onSelect:r=>{t(r.id),n()}})})}),(0,Xo.jsx)(me,{marginTop:1,children:(0,Xo.jsxs)(Ae,{color:ve.muted,children:["New to Lore? Run ",(0,Xo.jsx)(Ae,{bold:!0,children:"lore --help"})," any time for the command reference."]})})]})}var Yz=ie(Lt(),1),Fzt={login:["login"],logout:["logout"],enable:["enable"],disable:["disable"],status:["status"],restart:["restart"],"share-codex":["share-codex"],"share-cowork":["share-cowork"],export:["export"],"workspaces-list":["workspaces","list"],"skills-list":["skills","list"],"listen-list":["listen","list"],configure:["configure"],quit:[]};function Gzt({cliVersion:e,deps:t,onSelect:n}){let[r,o]=(0,Kz.useState)(void 0),{exit:i}=Ca();return(0,Kz.useEffect)(()=>{let a=!1;return(async()=>{let[c,d,g,h]=await Promise.all([jz(t),Hz(t),zz(t),$z()]);a||o({identity:c,daemon:d,skills:g,uploadDirs:h})})(),()=>{a=!0}},[]),r?r.identity.state==="logged_out"?(0,Yz.jsx)(qz,{cliVersion:e,onSelect:a=>{n(a),i()}}):(0,Yz.jsx)(t0,{cliVersion:e,initialData:r,onSelect:n}):null}async function JVe(){let e="quit";return await Jc((0,Yz.jsx)(Gzt,{cliVersion:Yu(),deps:{},onSelect:n=>{e=n}})).waitUntilExit(),{action:e,rawArgs:Fzt[e]}}m();await BT();m();await uo();var Kk=ie(an(),1);await am();await sm();xa();m();await uo();await vse();await am();await OT();await sm();await Dse();m();await uo();xa();var tD=ie(Lt(),1),jzt="\u2588",Hzt="\u2591";function ZVe({value:e,width:t=24,label:n,color:r=ve.success}){let o=Number.isFinite(e)?Math.max(0,Math.min(1,e)):0,i=Math.round(o*t),a=Math.max(0,t-i);return(0,tD.jsxs)(me,{children:[(0,tD.jsx)(Ae,{color:r,children:jzt.repeat(i)}),(0,tD.jsx)(Ae,{color:ve.muted,children:Hzt.repeat(a)}),n?(0,tD.jsxs)(Ae,{color:ve.muted,children:[" ",n]}):null]})}await wT();await kT();await Rse();await Mse();await Lse();m();await uo();await am();await OT();await sm();await wT();xa();var co=ie(Lt(),1),XVe=[{key:"resolving_session",label:"Resolving session"},{key:"uploading",label:"Uploading transcript"},{key:"parsing",label:"Parsing on server"},{key:"updating_visibility",label:"Updating visibility"},{key:"resolving_highlight",label:"Resolving highlight"}];function zk(){return{steps:XVe.map(({key:e,label:t})=>({key:e,label:t,status:"pending"}))}}function Jz(e,t){return t.kind==="completed"?{...e,result:{url:t.url,reused:t.reused,visibility:t.visibility,clipboardCopied:t.clipboardCopied,sessionId:t.sessionId}}:t.kind==="error"?{...e,errorMessage:t.message,steps:e.steps.map(n=>n.status==="active"?{...n,status:"pending"}:n)}:t.step==="done"||t.step==="errored"?{...e,steps:e.steps.map(n=>({...n,status:n.status==="active"?"done":n.status}))}:{...e,steps:e.steps.map(n=>n.key===t.step?{...n,status:"active",label:t.label?`${WVe(n.key)} (${t.label})`:WVe(n.key)}:n.status==="active"?{...n,status:"done"}:n)}}function WVe(e){return XVe.find(t=>t.key===e)?.label??e}function eh({title:e,subtitle:t,state:n}){return(0,co.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,co.jsx)(Da,{title:e,subtitle:t}),(0,co.jsx)(Pn,{title:"Pipeline",children:(0,co.jsx)(me,{flexDirection:"column",children:n.steps.map(r=>(0,co.jsx)(zzt,{step:r},r.key))})}),n.result?(0,co.jsx)(me,{marginTop:1,flexDirection:"column",children:(0,co.jsx)(Ba,{kind:"success",title:n.result.reused?"Already on Lore":"Shared",children:(0,co.jsxs)(me,{flexDirection:"column",children:[(0,co.jsx)(Ae,{children:n.result.url}),(0,co.jsx)(me,{marginTop:1,children:(0,co.jsxs)(Ae,{color:ve.muted,children:[n.result.clipboardCopied?"Copied to clipboard. ":"",n.result.visibility?`Visibility: ${n.result.visibility}.`:""]})})]})})}):null,n.errorMessage?(0,co.jsx)(me,{marginTop:1,children:(0,co.jsx)(Ba,{kind:"error",title:"Failed",children:(0,co.jsx)(Ae,{children:n.errorMessage})})}):null]})}function zzt({step:e}){return e.status==="active"?(0,co.jsxs)(me,{children:[(0,co.jsx)(Ms,{}),(0,co.jsx)(Ae,{children:" "}),(0,co.jsx)(Ae,{color:ve.primary,children:e.label})]}):e.status==="done"?(0,co.jsxs)(me,{children:[(0,co.jsx)(Ae,{color:ve.success,children:"\u2713 "}),(0,co.jsx)(Ae,{color:ve.muted,children:e.label})]}):(0,co.jsxs)(me,{children:[(0,co.jsx)(Ae,{color:ve.muted,children:"\u25CB "}),(0,co.jsx)(Ae,{color:ve.muted,children:e.label})]})}xa();m();var $k=Date.parse("2026-05-16T12:00:00.000Z");function Vk(e){return new Date($k-e*6e4).toISOString()}var xf={plist:"/Users/alex/Library/LaunchAgents/ai.tanagram.lore.plist",binary:"/Users/alex/.lore/bin/lore-background",logFile:"/Users/alex/.lore/log.txt",status:"/Users/alex/.lore/status.json",installSource:"/opt/homebrew/bin/lore"},eqe=[{id:"tanagram/lore",label:"tanagram/lore",kind:"repo",sessionCount:18,lastUsedAtMs:$k-7*6e4},{id:"acme/customer-demo",label:"acme/customer-demo",kind:"repo",sessionCount:6,lastUsedAtMs:$k-42*6e4},{id:"acme/integration",label:"acme/integration",kind:"repo",sessionCount:3,lastUsedAtMs:$k-3*60*6e4},{id:"__custom_repo_path__:/Users/alex/notes",label:"/Users/alex/notes",kind:"dir",sessionCount:1,lastUsedAtMs:$k-26*60*6e4}],$zt=["/Users/alex/code/tanagram-lore","/Users/alex/work/acme-integration"],nD={label:"ai.tanagram.lore",enabled:!0,loaded:!0,running:!0,healthy:!0,health:"running",heartbeat_fresh:!0,plist_path:xf.plist,binary_path:xf.binary,status_path:xf.status,install_source_path:xf.installSource,status:{version:"0.1.0",pid:4242,state:"idle",auth:"logged_in",started_at:Vk(60),last_heartbeat_at:Vk(1),last_success_at:Vk(5),last_completed_at:Vk(5),last_thread_ids:["thr_01hx_story"]}},tqe={...nD,running:!1,healthy:!1,health:"stale heartbeat",heartbeat_fresh:!1,status:{...nD.status,state:"error",last_heartbeat_at:Vk(17),last_error:"upload failed: HTTP 503 from /api/upload-session"}},Vzt={...nD,enabled:!1,loaded:!1,running:!1,healthy:!1,health:"disabled",heartbeat_fresh:!1,status:void 0},qzt={state:"ready",userId:"user_alex",email:"alex@tanagram.ai",displayName:"Alex Rivera",organizations:[{id:"org_tanagram",name:"Tanagram"},{id:"org_acme",name:"Acme"}],activeOrganizationId:"org_tanagram",activeOrganizationName:"Tanagram"},qk={identity:qzt,daemon:{state:"ready",report:nD},skills:{state:"ready",count:9,published:4},uploadDirs:{state:"ready",cwd:$zt,repo:[]}},nqe={...qk,uploadDirs:{state:"ready",cwd:[],repo:[]}},rqe={...qk,daemon:{state:"error",message:"launchctl print failed: service not found"}},oqe={...qk,daemon:{state:"unsupported",platform:"linux"}},iqe={identity:{state:"logged_out"},daemon:{state:"ready",report:Vzt},skills:{state:"logged_out"},uploadDirs:{state:"ready",cwd:[],repo:[]}},aqe=["/Users/alex/code/tanagram-lore","/Users/alex/code/customer-demo","/Users/alex/code/internal-tools"];var ht=ie(Lt(),1),Kr=()=>{};function n0(...e){return e.reduce(_z,xk())}function Yk(...e){return e.reduce(Jz,zk())}var pm=[{id:"onboarding/welcome/default",title:"Welcome",path:["TUI","Screens","Onboarding","Welcome"],description:"First-run value prop and sign-in CTA.",render:()=>(0,ht.jsx)(qz,{cliVersion:"0.1.0",onSelect:Kr})},{id:"onboarding/login/initialising",title:"Login / initialising",path:["TUI","Screens","Onboarding","Login"],description:"Device-code request is in flight.",render:()=>(0,ht.jsx)(dp,{state:xk()})},{id:"onboarding/login/device-code",title:"Login / device code",path:["TUI","Screens","Onboarding","Login"],description:"User has a WorkOS code and browser URL.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"})})},{id:"onboarding/login/awaiting-authorization",title:"Login / awaiting authorization",path:["TUI","Screens","Onboarding","Login"],description:"Browser is open and polling is active.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"waiting_for_authorization"})})},{id:"onboarding/login/auto-enable",title:"Login / auto-enable in progress",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded and launchd install is running.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"})})},{id:"onboarding/login/success",title:"Login / success",path:["TUI","Screens","Onboarding","Login"],description:"Signed in and background uploads enabled.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"browser_opened"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_succeeded",plistPath:xf.plist,binaryPath:xf.binary,logFile:xf.logFile})})},{id:"onboarding/login/auto-enable-failed",title:"Login / auto-enable failed",path:["TUI","Screens","Onboarding","Login"],description:"Login succeeded but the daemon install needs a retry.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"logged_in"},{kind:"auto_enable_started"},{kind:"auto_enable_failed"})})},{id:"onboarding/login/denied",title:"Login / denied",path:["TUI","Screens","Onboarding","Login"],description:"Terminal authorization failure state.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"device_authorized",userCode:"ABCD-EFGH",verificationUri:"https://login.example.com/device",verificationUriComplete:"https://login.example.com/device?user_code=ABCD-EFGH"},{kind:"authorization_denied"})})},{id:"onboarding/login/api-unreachable",title:"Login / API unreachable",path:["TUI","Screens","Onboarding","Login"],description:"Early failure before WorkOS device-code negotiation.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"login_failed",message:"Could not reach the Lore API at http://localhost:4000. If you're running pnpm dev, start the local API server or set LORE_TARGET=dev-shared."})})},{id:"onboarding/login/already-signed-in",title:"Login / already signed in",path:["TUI","Screens","Onboarding","Login"],description:"Short-circuit copy for authenticated callers.",render:()=>(0,ht.jsx)(dp,{state:n0({kind:"already_logged_in"})})},{id:"onboarding/configure-upload-repos/loading",title:"Configure upload repos / loading",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Recent Claude Code cwd discovery is in flight.",render:()=>(0,ht.jsx)(lm,{state:{phase:"loading",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/choose",title:"Configure upload repos / choose",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Suggested git remotes with defaults checked.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:eqe,now:Date.parse("2026-05-16T12:00:00.000Z"),organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/empty",title:"Configure upload repos / empty",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"No recent sessions, with add-custom affordance.",render:()=>(0,ht.jsx)(lm,{state:{phase:"choose",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saving",title:"Configure upload repos / saving",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Persisting selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saving",suggestions:[],organizationName:"Tanagram"},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/saved",title:"Configure upload repos / saved",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save for multiple repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:3},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/skipped",title:"Configure upload repos / skipped",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Successful save with zero selected repos.",render:()=>(0,ht.jsx)(lm,{state:{phase:"saved",suggestions:[],savedCount:0},onSubmit:Kr,onSkip:Kr})},{id:"onboarding/configure-upload-repos/error",title:"Configure upload repos / error",path:["TUI","Screens","Onboarding","Configure upload repos"],description:"Failed persistence state.",render:()=>(0,ht.jsx)(lm,{state:{phase:"errored",suggestions:[],errorMessage:"EACCES: permission denied, open ~/.lore/upload_filters.json"},onSubmit:Kr,onSkip:Kr})},{id:"dashboard/healthy",title:"Dashboard / healthy",path:["TUI","Screens","Dashboard"],description:"Signed in, daemon healthy, upload repos configured.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:qk,onSelect:Kr})},{id:"dashboard/empty-upload-dirs",title:"Dashboard / empty upload repos",path:["TUI","Screens","Dashboard"],description:"Consent-first empty state for background uploads.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:nqe,onSelect:Kr})},{id:"dashboard/daemon-error",title:"Dashboard / daemon error",path:["TUI","Screens","Dashboard"],description:"Daemon panel surfaces a launchctl failure.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:rqe,onSelect:Kr})},{id:"dashboard/unsupported-platform",title:"Dashboard / unsupported platform",path:["TUI","Screens","Dashboard"],description:"Linux/Windows copy for macOS-only daemon features.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:oqe,onSelect:Kr})},{id:"dashboard/signed-out",title:"Dashboard / signed out",path:["TUI","Screens","Dashboard"],description:"Signed-out dashboard snapshot.",render:()=>(0,ht.jsx)(t0,{cliVersion:"0.1.0",initialData:iqe,onSelect:Kr})},{id:"sharing/initial",title:"Share flow / initial",path:["TUI","Screens","Sharing"],description:"All pipeline steps pending.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:zk()})},{id:"sharing/uploading",title:"Share flow / uploading",path:["TUI","Screens","Sharing"],description:"Upload step active with a progress label.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",subtitle:"sharing this Codex session",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading",label:"42%"})})},{id:"sharing/parsing",title:"Share flow / parsing",path:["TUI","Screens","Sharing"],description:"Server-side parsing is active.",render:()=>(0,ht.jsx)(eh,{title:"lore export",subtitle:"sharing your latest Claude Code session",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing",label:"queued"})})},{id:"sharing/shared",title:"Share flow / shared",path:["TUI","Screens","Sharing"],description:"New share completed and copied to clipboard.",render:()=>(0,ht.jsx)(eh,{title:"lore share-codex",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"step",step:"parsing"},{kind:"step",step:"updating_visibility"},{kind:"step",step:"done"},{kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!1,visibility:"workspace",clipboardCopied:!0,sessionId:"thr_01hx_story"})})},{id:"sharing/already-shared",title:"Share flow / already shared",path:["TUI","Screens","Sharing"],description:"Deduped upload converges to an existing Lore thread.",render:()=>(0,ht.jsx)(eh,{title:"lore share-cowork",state:Yk({kind:"completed",url:"https://lore.tanagram.ai/thread/thr_01hx_story",reused:!0,visibility:"private",clipboardCopied:!1})})},{id:"sharing/error",title:"Share flow / error",path:["TUI","Screens","Sharing"],description:"Pipeline error callout.",render:()=>(0,ht.jsx)(eh,{title:"lore export",state:Yk({kind:"step",step:"resolving_session"},{kind:"step",step:"uploading"},{kind:"error",message:"presigned upload failed: HTTP 403"})})},{id:"daemon/run/enable-progress",title:"Daemon run / enable progress",path:["TUI","Screens","Daemon","Run"],description:"Enable command while launchd work is active.",render:()=>(0,ht.jsx)(e0,{mode:"enable",state:{phase:"in_progress"}})},{id:"daemon/run/enable-success",title:"Daemon run / enable success",path:["TUI","Screens","Daemon","Run"],description:"Enable success includes resolved paths.",render:()=>(0,ht.jsx)(e0,{mode:"enable",state:{phase:"finished",result:{plistPath:xf.plist,binaryPath:xf.binary,logFile:xf.logFile}}})},{id:"daemon/run/disable-success",title:"Daemon run / disable success",path:["TUI","Screens","Daemon","Run"],description:"Disable success copy.",render:()=>(0,ht.jsx)(e0,{mode:"disable",state:{phase:"finished"}})},{id:"daemon/run/restart-success",title:"Daemon run / restart success",path:["TUI","Screens","Daemon","Run"],description:"Restart success copy.",render:()=>(0,ht.jsx)(e0,{mode:"restart",state:{phase:"finished"}})},{id:"daemon/run/error",title:"Daemon run / error",path:["TUI","Screens","Daemon","Run"],description:"Mode-independent daemon command error.",render:()=>(0,ht.jsx)(e0,{mode:"restart",state:{phase:"errored",errorMessage:"launchctl bootstrap failed"}})},{id:"daemon/status/healthy",title:"Daemon status / healthy",path:["TUI","Screens","Daemon","Status"],description:"Healthy daemon report.",render:()=>(0,ht.jsx)(Fk,{report:nD})},{id:"daemon/status/unhealthy",title:"Daemon status / unhealthy",path:["TUI","Screens","Daemon","Status"],description:"Unhealthy report with warning and last error.",render:()=>(0,ht.jsx)(Fk,{report:tqe})},{id:"components/primitives/header",title:"Components / header",path:["TUI","Components","Primitives"],description:"Top-level title row with optional subtitle and right cell.",render:()=>(0,ht.jsx)(Da,{title:"lore",subtitle:"component primitive",right:"v0.1.0"})},{id:"components/primitives/panel",title:"Components / panel",path:["TUI","Components","Primitives"],description:"Bordered container with title, subtitle, and focus styling.",render:()=>(0,ht.jsx)(Pn,{title:"Panel",subtitle:"focused",focused:!0,children:(0,ht.jsx)(Ae,{color:ve.muted,children:"Panels compose screen sections and callouts."})})},{id:"components/primitives/status-line",title:"Components / status line",path:["TUI","Components","Primitives"],description:"Key/value rows with severity dots.",render:()=>(0,ht.jsxs)(Pn,{title:"StatusLine",children:[(0,ht.jsx)(nn,{label:"Healthy",value:"yes",kind:"success"}),(0,ht.jsx)(nn,{label:"Warning",value:"needs attention",kind:"warning"}),(0,ht.jsx)(nn,{label:"Error",value:"launchctl failed",kind:"error"})]})},{id:"components/primitives/progress-bar",title:"Components / progress bar",path:["TUI","Components","Primitives"],description:"Plain unicode progress bar for deterministic terminal rendering.",render:()=>(0,ht.jsx)(Pn,{title:"ProgressBar",children:(0,ht.jsx)(ZVe,{value:.62,label:"62%"})})},{id:"components/primitives/message-box",title:"Components / message box",path:["TUI","Components","Primitives"],description:"Severity callout for success, info, warning, and error copy.",render:()=>(0,ht.jsxs)(me,{flexDirection:"column",children:[(0,ht.jsx)(Ba,{kind:"success",title:"Shared",children:(0,ht.jsx)(Ae,{children:"Copied the Lore URL to your clipboard."})}),(0,ht.jsx)(me,{marginTop:1,children:(0,ht.jsx)(Ba,{kind:"error",title:"Failed",children:(0,ht.jsx)(Ae,{color:ve.muted,children:"presigned upload failed: HTTP 403"})})})]})},{id:"components/primitives/spinner",title:"Components / spinner",path:["TUI","Components","Primitives"],description:"Unrefed animated spinner primitive.",render:()=>(0,ht.jsx)(Pn,{title:"Spinner",children:(0,ht.jsx)(Ms,{label:"working on a terminal-friendly task\u2026"})})},{id:"components/inputs/menu",title:"Components / menu",path:["TUI","Components","Inputs"],description:"Keyboard menu with enabled and disabled items.",render:()=>(0,ht.jsx)(Pn,{title:"Menu",subtitle:"\u2191/\u2193 or j/k \xB7 Enter to choose",children:(0,ht.jsx)(eD,{items:[{id:"share",label:"Share",description:"upload a session"},{id:"status",label:"Status",description:"inspect daemon"},{id:"disabled",label:"Disabled",description:"not available in this state",disabled:!0}],onSelect:Kr})})},{id:"components/inputs/checkbox-list",title:"Components / checkbox list",path:["TUI","Components","Inputs"],description:"Multi-select list with an action row.",render:()=>(0,ht.jsx)(Pn,{title:"CheckboxList",subtitle:"space to toggle \xB7 enter to save",children:(0,ht.jsx)(vk,{items:[{id:"repo",label:"/Users/alex/code/tanagram-lore",initialChecked:!0},{id:"demo",label:"/Users/alex/code/customer-demo"},{id:"add",label:"+ Add a custom path\u2026",action:!0}],onSubmit:Kr,onAction:Kr})})},{id:"components/inputs/text-input",title:"Components / text input",path:["TUI","Components","Inputs"],description:"Single-line input with cursor rendering.",render:()=>(0,ht.jsx)(Pn,{title:"TextInput",children:(0,ht.jsx)(fz,{initialValue:"~/code",onSubmit:Kr,onCancel:Kr})})},{id:"components/inputs/path-picker",title:"Components / path picker",path:["TUI","Components","Inputs"],description:"Directory picker with deterministic story suggestions.",render:()=>(0,ht.jsx)(Pn,{title:"PathPicker",subtitle:"suggestions are fixture-backed",children:(0,ht.jsx)(Az,{initialValue:"/Users/alex/code",loadSuggestions:async()=>aqe,onSubmit:Kr,onCancel:Kr})})}];function sqe(e){return pm.find(t=>t.id===e)}function rD(e){return e.path.slice(1).join(" / ")}var kr=ie(Lt(),1);function cqe({initialStoryId:e}){let t=Math.max(0,pm.findIndex(g=>g.id===e)),[n,r]=(0,Kk.useState)(t),[o,i]=(0,Kk.useState)("sidebar"),a=(0,Kk.useRef)(o);a.current=o;let{exit:c}=Ca();gu((g,h)=>{if(h.ctrl&&g==="c"){c();return}if(a.current==="sidebar"&&g==="q"){c();return}if(h.escape){if(a.current==="preview"){a.current="sidebar",i("sidebar");return}c();return}if(a.current==="preview"&&h.tab&&h.shift){a.current="sidebar",i("sidebar");return}if(a.current==="sidebar"&&h.tab&&!h.shift){a.current="preview",i("preview");return}if(a.current==="sidebar"){if(h.upArrow||g==="k"){r(S=>uqe(S-1));return}(h.downArrow||g==="j")&&r(S=>uqe(S+1))}});let d=pm[n]??pm[0];return(0,kr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,kr.jsx)(Da,{title:"lore TUI stories",subtitle:"terminal story runner",right:`${n+1}/${pm.length}`}),(0,kr.jsx)(me,{marginBottom:1,children:(0,kr.jsx)(Ae,{color:ve.muted,children:"\u2191/\u2193 or j/k select stories \xB7 Tab focuses preview \xB7 Shift+Tab/Esc returns \xB7 q exits from sidebar"})}),(0,kr.jsxs)(me,{flexDirection:"row",gap:2,children:[(0,kr.jsx)(me,{width:36,flexShrink:0,children:(0,kr.jsx)(Pn,{title:"Stories",subtitle:o==="sidebar"?"focused":void 0,focused:o==="sidebar",children:(0,kr.jsx)(Yzt,{stories:pm,selectedIndex:n,focused:o==="sidebar"})})}),(0,kr.jsx)(me,{flexDirection:"column",flexGrow:1,flexShrink:1,children:(0,kr.jsx)(Pn,{title:d.title,focused:o==="preview",subtitle:o==="preview"?`${rD(d)} \xB7 focused`:rD(d),children:(0,kr.jsxs)(me,{flexDirection:"column",children:[(0,kr.jsx)(Ae,{color:ve.muted,children:d.description}),o==="sidebar"?(0,kr.jsxs)(Ae,{color:ve.muted,children:["Press ",(0,kr.jsx)(Ae,{bold:!0,children:"Tab"})," to interact with this preview."]}):null,(0,kr.jsx)(me,{marginTop:1,children:d.render()})]})})})]})]})}function Yzt({stories:e,selectedIndex:t,focused:n}){let r=[],o=[];return e.forEach((i,a)=>{let c=i.path.slice(1),d=Xzt(o,c);for(let g=d;g<c.length;g++)r.push((0,kr.jsx)(Kzt,{label:c[g]??"",level:g,marginTop:Wzt(c[g]??"",g,d),focused:n},`group:${c.slice(0,g+1).join("/")}`));r.push((0,kr.jsx)(Jzt,{story:i,selected:a===t,focused:n},i.id)),o=c}),(0,kr.jsx)(me,{flexDirection:"column",children:r})}function Kzt({label:e,level:t,marginTop:n,focused:r}){return(0,kr.jsx)(me,{marginLeft:lqe(t),marginTop:n,children:(0,kr.jsx)(Ae,{color:r?ve.primary:ve.muted,bold:r,wrap:"truncate-end",children:e})})}function Jzt({story:e,selected:t,focused:n}){let r=n?t?ve.accent:ve.highlight:ve.muted;return(0,kr.jsxs)(me,{marginLeft:lqe(e.path.slice(1).length),children:[(0,kr.jsx)(Ae,{color:n&&t?ve.accent:ve.muted,children:t?"\u203A ":" "}),(0,kr.jsx)(Ae,{color:r,bold:n&&t,wrap:"truncate-end",children:Zzt(e)})]})}function Zzt(e){let t=e.title.split(" / ");return t.length>1?t.slice(1).join(" / "):e.path.at(-1)===e.title?"Default":e.title}function lqe(e){return Math.min(e,4)}function Wzt(e,t,n){return t===0?e==="Components"?1:0:t===1&&t===n?1:0}function Xzt(e,t){let n=Math.min(e.length,t.length);for(let r=0;r<n;r++)if(e[r]!==t[r])return r;return n}function uqe(e){let t=pm.length;return(e%t+t)%t}function dqe({story:e}){let{exit:t}=Ca();return gu((n,r)=>{(r.ctrl&&n==="c"||r.escape)&&t()}),(0,kr.jsxs)(me,{flexDirection:"column",paddingX:1,paddingY:1,children:[(0,kr.jsx)(Da,{title:e.title,subtitle:rD(e),right:"Esc to exit"}),(0,kr.jsx)(me,{marginBottom:1,children:(0,kr.jsx)(Ae,{color:ve.muted,children:e.description})}),e.render()]})}var vue=ie(Lt(),1),pqe={meta:{name:"tui:stories",description:"Open the terminal story runner for Ink TUI screens.",hidden:!0,skipAutoupdate:!0},args:{story:{type:"string",description:"Open a specific story id."},list:{type:"boolean",description:"Print story ids instead of opening the runner."}},async run({args:e}){if(e.list||!process.stdin.isTTY||!process.stdout.isTTY){e8t();return}if(typeof e.story=="string"&&e.story.trim().length>0){let n=sqe(e.story.trim());if(!n){console.error(`Unknown TUI story: ${e.story}`),console.error("Run `lore tui:stories --list` to see available ids."),process.exitCode=1;return}await Jc((0,vue.jsx)(dqe,{story:n})).waitUntilExit();return}await Jc((0,vue.jsx)(cqe,{})).waitUntilExit()}};function e8t(){for(let e of pm)console.log(`${e.id} ${rD(e)} ${e.title}`)}m();wr();xE();m();await uo();var Zz=ie(an(),1);await BT();var Rue=ie(Lt(),1);function t8t({title:e,subtitle:t,perform:n,onResolve:r,onReject:o}){let[i,a]=(0,Zz.useState)(zk),{exit:c}=Ca();return(0,Zz.useEffect)(()=>{let d=!1,g=h=>{d||a(S=>Jz(S,h))};return(async()=>{try{let h=await n(g);if(d)return;r(h),setTimeout(()=>c(),100)}catch(h){if(g({kind:"error",message:h instanceof Error?h.message:String(h)}),d)return;o(h),setTimeout(()=>c(h instanceof Error?h:new Error(String(h))),100)}})(),()=>{d=!0}},[]),(0,Rue.jsx)(eh,{title:e,subtitle:t,state:i})}async function oD(e){let t,n,r=!1;if(await Jc((0,Rue.jsx)(t8t,{title:e.title,subtitle:e.subtitle,perform:e.perform,onResolve:i=>{t=i,r=!0},onReject:i=>{n=i}})).waitUntilExit(),!r)throw n instanceof Error?n:new Error(String(n??"share flow failed"));return t}m();sR();so();import s8t from"node:os";import mqe from"node:path";m();import{spawn as n8t}from"node:child_process";import r8t from"node:os";async function fqe(e,t={}){let n=t.timeoutMs??2e3,r=o8t();for(let o of r)if(await i8t(o,e,n))return!0;return!1}function o8t(){switch(r8t.platform()){case"darwin":return[{name:"pbcopy",args:[]}];case"linux":return[{name:"wl-copy",args:[]},{name:"xclip",args:["-selection","clipboard"]},{name:"xsel",args:["--clipboard","--input"]}];case"win32":return[{name:"clip.exe",args:[]}];default:return[]}}async function i8t(e,t,n){return new Promise(r=>{let o;try{o=n8t(e.name,e.args,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}let i=!1,a=d=>{i||(i=!0,r(d))},c=setTimeout(()=>{o.kill("SIGKILL"),a(!1)},n);o.on("error",()=>{clearTimeout(c),a(!1)}),o.on("close",d=>{clearTimeout(c),a(d===0)}),o.stdin?.on("error",()=>{}),o.stdin?.end(t)})}Jn();wr();wk();Dk();xT();lz();HE();m();var iD=()=>{};m();wr();ZE();async function a8t(e,t,n){let r=await e.resolveThreadShareHighlight({params:{id:t},body:{query:n}});if(r.status!==200)throw tc(`resolve share highlight for thread ${t}`,r.status,r.body);return{url:r.body.url,matched:r.body.matched,start_block_id:r.body.start_block_id,end_block_id:r.body.end_block_id}}async function Wz(e,t,n){try{return await a8t(e,t,n)}catch(r){return Ee.warn("share_highlight_resolution_failed",{thread_id:t,error:r instanceof Error?r.message:String(r)}),null}}m();Jn();ZE();function Aqe(e){if(e instanceof XR)return"billing_required";if(e instanceof kk)return e.status>=500&&e.status<600?"server_5xx":e.status>=400&&e.status<500?"server_4xx":"s3_error";if(e instanceof Ue)return"validation_failed";if(e instanceof Error){let t=e.message.toLowerCase();if(t.includes("not logged in")||t.includes("unauthorized")||t.includes("unauthenticated")||t.includes("authentication failed")||t.includes("authentication required")||t.includes("auth required")||t.includes("bearer token"))return"auth_failed";if(t.includes("timed out waiting for thread")&&t.includes("parsing")||t.includes("parse timeout"))return"parsing_timeout";if(t.includes("parsing failed permanently"))return"parsing_failed";if(t.includes("econnrefused")||t.includes("econnreset")||t.includes("etimedout")||t.includes("enotfound")||t.includes("network"))return"network_failed"}return"unknown"}ZE();var u8t=new Set(["private","workspace","public"]);function c8t(e){let t=(e??"").trim();if(!t)return"";if(!u8t.has(t))throw new Ue(`invalid --visibility "${e}": use one of private, workspace, public`);return t}async function xue(e={}){let t=e.progress??iD,n=c8t(e.visibility),r=(e.project??process.cwd()).trim()||process.cwd(),o=(e.sessionId??"").trim(),i="resolving_session",a=null;try{t({kind:"step",step:"resolving_session"});let c=await a5e({sessionId:o,project:r});i="auth",await A8t();let d=e.client??Wt();i="collecting_local_file",a=await l8t(c),t({kind:"step",step:"uploading",label:a.filename}),i="uploading";let{reused:g,file:h}=await d8t(d,a);Ee.info("export_upload_single_file_result",{filename:a.filename,reused:g,response:JSON.stringify(h)});let S=h.thread?.id?.trim();if(!S)throw Kn().setContext("upload_single_file_response",{filename:a.filename,reused:g,response:h}),new Error(`upload session response missing thread id for ${a.filename}`);i="parsing",t({kind:"step",step:"parsing"}),await Kx(d,S);let y=h.thread?.visibility?.trim()??"",C=y;n&&n!==y&&(i="updating_visibility",t({kind:"step",step:"updating_visibility"}),C=await p8t(d,S,n));let v=f8t(S),x,N=e.highlight?.trim();if(N){i="resolving_highlight",t({kind:"step",step:"resolving_highlight"});let Q=await Wz(d,S,N);Q&&(v=Q.url,x={query:N,matched:Q.matched,start_block_id:Q.start_block_id,end_block_id:Q.end_block_id})}let k=await fqe(v);return t({kind:"completed",url:v,reused:g,visibility:C,clipboardCopied:k,sessionId:c.sessionId?.trim()??""}),t({kind:"step",step:"done"}),qE("lore.cli.thread_exported",{thread_id:S,harness:a.harness,visibility:C,reused:g}),{thread_id:S,url:v,session_id:c.sessionId?.trim()??"",project:c.project,reused:g,visibility:C,clipboard_copied:k,...x?{highlight:x}:{}}}catch(c){throw qE("lore.cli.upload_failed",{error_category:Aqe(c),error_message:Mi(c),step:i}),c}finally{a&&await jx(a.tempPath)}}async function l8t(e){let t=await s5e(e),n=await va(t.fullPath);if(!n.exists)throw new Ue(`session transcript not found at ${m8t(t.fullPath)} \u2014 the file may have been rotated or pruned`);let r=await cp(e.project),o=await bf(t.fullPath);return{key:t.key,filename:t.relativeFilename,sourcePath:t.fullPath,repoOriginPath:r,tempPath:o.tempPath,md5:o.md5,fileType:"transcript",harness:"claudeCode",harnessInternalId:e.sessionId?.trim()??"",watchedState:n}}async function d8t(e,t){let n=await qx(e,[t]);if(n.thread_files.length!==1)throw new Error(`upload session returned ${n.thread_files.length} files for 1 local file`);let r=n.thread_files[0];if(!r)throw new Error("upload session response missing thread file");if(!r.presigned_url?.trim()){if(!r.thread?.id?.trim()){let a=r.error?.trim()?`: ${r.error.trim()}`:"";throw new Ue(`upload session for ${t.filename} returned no upload URL and no reusable thread${a}`)}return{reused:!0,file:r}}await JE(r.presigned_url,t.tempPath);let o=await Yx(e,n.id,[r]);if(o.thread_files.length!==1)throw new Error(`complete upload session returned ${o.thread_files.length} files for 1 local file`);let i=o.thread_files[0];if(!i?.thread?.id)throw new Error(`complete upload session response missing thread for ${t.filename}`);return{reused:!1,file:{...r,thread:i.thread}}}async function p8t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw tc(`set thread ${t} visibility`,r.status,r.body);return r.body.visibility}function f8t(e){return`${KE().replace(/\/+$/,"")}/thread/${e}`}async function A8t(){let e=await xn();if(!e)throw new Ue("not logged in \u2014 run 'lore login' first");return e}function m8t(e){let t=s8t.homedir();if(!t)return e;let n=mqe.relative(t,e);return!n||n.startsWith("..")?e:mqe.join("~",n)}var gqe={meta:{name:"export",description:"Upload a single Claude Code session to Lore and print its URL"},args:{"session-id":{type:"string",description:"Claude Code session ID to export. Defaults to the most recent session for $PWD."},project:{type:"string",description:"Project path used to resolve a session when --session-id is not provided. Defaults to the current working directory."},visibility:{type:"string",description:"Set thread visibility: private, workspace, or public. Defaults to leaving the existing visibility untouched."},highlight:{type:"string",description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e,data:t}){Ee.info("command_start",{command:"export"});let n={sessionId:typeof e["session-id"]=="string"?e["session-id"]:void 0,project:typeof e.project=="string"?e.project:void 0,visibility:typeof e.visibility=="string"?e.visibility:void 0,highlight:typeof e.highlight=="string"?e.highlight:void 0,client:t?.client};if(Au()&&!t?.progress){await oD({title:"lore export",subtitle:"uploading the most recent Claude Code session",perform:o=>xue({...n,progress:o})});return}let r=await xue({...n,progress:t?.progress});console.log(JSON.stringify(r,null,2))}};m();m();nT();so();Gl();Jn();wr();Gx();Yc();var g8t=5,h8t=1e3;async function _qe(e={}){(e.environment??Ni())!=="dev"||!await _8t({fetchFn:e.fetchFn})||await E8t({client:e.client})}async function _8t(e={}){let t=process.env.LORE_DEV_CLI_USER_EMAIL?.trim();if(!t)return Ee.warn("dev_preflight_no_email",{hint:"set LORE_DEV_CLI_USER_EMAIL in .env.local (run `pnpm bootstrap`) to auto-authenticate the dev uploader"}),!1;let n=e.fetchFn??globalThis.fetch,r=e.attempts??g8t,o=e.retryDelayMs??h8t,i=`${RE()}/api/cli-auth/dev-token`;for(let a=1;a<=r;a+=1)try{let c=await n(i,{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({email:t})});if(c.status===404){let g=await hqe(c);return Qg(),Ee.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:g,url:i}),!1}if(!c.ok){let g=await hqe(c);return Qg(),Ee.warn("dev_preflight_token_rejected",{status:c.status,email:t,detail:g}),!1}let d=await c.json();return d.access_token?(ZR(d.access_token),Ee.info("dev_preflight_token_minted",{email:t,expiresIn:d.expires_in}),!0):(Qg(),Ee.warn("dev_preflight_token_malformed",{url:i}),!1)}catch(c){if(a===r)return Qg(),Ee.warn("dev_preflight_token_unreachable",{url:i,error:Mi(c)}),!1;await S8t(o)}return!1}async function E8t(e={}){await Zg();let t=await ba();if(t.include.cwd.length>0||t.include.repo.length>0)return;let n=qc(process.env.LORE_DEV_UPLOAD_DIR?.trim()||process.cwd()),r=e.client??Wt();try{let o=await r.whoAmI({headers:{}});if(o.status!==200){Ee.warn("dev_preflight_whoami_failed",{status:o.status});return}}catch(o){Ee.warn("dev_preflight_whoami_error",{error:Mi(o)});return}await Jl({...t,include:{...t.include,cwd:Array.from(new Set([...t.include.cwd,n])).sort()}}),Ee.info("dev_preflight_upload_dir_seeded",{path:n})}async function hqe(e){try{let t=await e.json(),n=t.message??t.error;return typeof n=="string"?n:`HTTP ${e.status}`}catch{return`HTTP ${e.status}`}}function S8t(e){return new Promise(t=>{setTimeout(t,e)})}Pk();m();Jn();wr();Pk();import Eqe from"node:fs";import{watch as y8t}from"node:fs/promises";import Sqe from"node:path";import{setTimeout as Due}from"node:timers/promises";var T8t=2e3,I8t=3e4;function C8t(e){return e.historyFilePath!==void 0?[e.historyFilePath]:e.watchPaths!==void 0?e.watchPaths:(e.uploadOptions?.adapters??Mk).map(n=>n.historyFilePath())}async function yqe(e={}){let t=e.debounceMs??T8t,n=e.pollIntervalMs??I8t,r=C8t(e),o=e.runUploadFn??Rz,i=e.signal?void 0:new AbortController,a=e.signal??i.signal,c=()=>i?.abort();i&&(process.once("SIGINT",c),process.once("SIGTERM",c));let d=!1,g=!1,h=async x=>{if(d){g=!0;return}d=!0;try{do{if(g=!1,a.aborted)break;try{let N=await o(e.uploadOptions);Ee.info("watch_sync_complete",{reason:x,uploaded:N.length})}catch(N){Ee.error("watch_sync_failed",{reason:x,error:Mi(N)})}}while(g&&!a.aborted)}finally{d=!1}},S,y=x=>{S&&clearTimeout(S),S=setTimeout(()=>{S=void 0,h(x)},t),S.unref?.()};Ee.info("watch_start",{watchPaths:r,debounceMs:t,pollIntervalMs:n}),h("startup");let C=async x=>{for(;!a.aborted;)try{let N=Eqe.existsSync(x)&&Eqe.statSync(x).isDirectory(),k=N?x:Sqe.dirname(x),Q=N?void 0:Sqe.basename(x);for await(let j of y8t(k,{signal:a,recursive:N})){if(a.aborted)break;(Q===void 0||!j.filename||j.filename===Q)&&y("fs-event")}}catch(N){if(a.aborted||N?.name==="AbortError")break;Ee.warn("watch_fs_retry",{path:x,error:Mi(N)}),await Due(n,void 0,{signal:a}).catch(()=>{})}},v=async()=>{for(;!a.aborted;){try{await Due(n,void 0,{signal:a})}catch{break}if(a.aborted)break;h("poll")}};try{await Promise.all([...r.map(C),v()])}finally{for(S&&clearTimeout(S),i&&(process.removeListener("SIGINT",c),process.removeListener("SIGTERM",c));d;)await Due(50).catch(()=>{});Ee.info("watch_stop",{})}}var Tqe={meta:{name:"_run_upload",hidden:!0,skipAutoupdate:!0},args:{watch:{type:"boolean",description:"Run continuously: watch the Claude history file and re-sync on every change. This is the launchd-free daemon `pnpm dev` runs locally.",default:!1}},async run({args:e,data:t}){let n={client:t?.client,...t?.adapters!==void 0?{adapters:t.adapters}:t?.adapter!==void 0?{adapter:t.adapter}:{},recorder:t?.recorder};if(e.watch){await _qe(),await yqe({uploadOptions:n});return}let r=await Rz(n);console.log(JSON.stringify(r))}};m();xE();m();so();wk();xT();Pk();import{spawn as b8t}from"node:child_process";import Iqe from"node:path";ZE();async function Bue(e){let t=e.progress??iD;if(!await xn())throw new Jx;t({kind:"step",step:"resolving_session"});let r=Iqe.resolve(e.sessionFile),o=Iqe.basename(r),i=e.harnessInternalId?.trim()||B8t(o)||o,a=await va(r);if(!a.exists)throw new Error(`session file does not exist: ${r}`);let c=await bf(r),d={key:o,filename:o,sourcePath:r,repoOriginPath:"",tempPath:c.tempPath,md5:c.md5,fileType:"transcript",harness:e.harness,harnessInternalId:i,watchedState:a},g=e.client??Wt();try{t({kind:"step",step:"uploading",label:o});let h=await qx(g,[d]),S=h.thread_files[0];if(!S)throw new Error("create upload session returned no thread files");let y=S.thread,C=!S.presigned_url?.trim()&&!!y?.id,v=y;if(!C){if(!S.presigned_url?.trim()){let be=S.error?.trim()??"upload session response missing presigned_url";throw new Error(`upload ${o} skipped: ${be}`)}await JE(S.presigned_url,c.tempPath),v=(await v8t(g,h.id,S)).thread}let x=v?.id?.trim();if(!x)throw new Error("upload session did not return a thread id");t({kind:"step",step:"parsing"}),await Kx(g,x);let N=v?.visibility?.trim()??"",k=N,Q=e.visibility;Q&&Q!==N&&(t({kind:"step",step:"updating_visibility"}),k=await R8t(g,x,Q));let j=`${KE().replace(/\/+$/,"")}/thread/${x}`,G,q=e.highlight?.trim();if(q){t({kind:"step",step:"resolving_highlight"});let ye=await Wz(g,x,q);ye&&(j=ye.url,G={query:q,matched:ye.matched,start_block_id:ye.start_block_id,end_block_id:ye.end_block_id})}let oe=await N8t(j),ge=D8t(k)?k:"private";return t({kind:"completed",url:j,reused:C,visibility:ge,clipboardCopied:oe,sessionId:i}),t({kind:"step",step:"done"}),{thread_id:x,url:j,session_id:i,project:"",reused:C,visibility:ge,clipboard_copied:oe,...G?{highlight:G}:{}}}finally{await jx(c.tempPath)}}async function v8t(e,t,n){let o=(await Yx(e,t,[n])).thread_files[0];if(!o)throw new Error("complete upload session returned no thread files");return{thread:o.thread}}async function R8t(e,t,n){let r=await e.updateThread({params:{id:t},body:{visibility:n}});if(r.status!==200)throw tc(`update thread ${t} visibility`,r.status,r.body);return r.body.visibility}var x8t=new Set(["private","workspace","public"]);function D8t(e){return x8t.has(e)}function B8t(e){let n=e.replace(/\.jsonl$/i,"").split("-").filter(o=>o.length>0);if(n.length===0)return"";let r=n.slice(-5);return r.length===5&&r.every(o=>/^[0-9a-fA-F]+$/.test(o))?r.join("-"):n[n.length-1]??""}async function N8t(e){let t=process.platform==="darwin"?[{command:"pbcopy",args:[]}]:process.platform==="win32"?[{command:"clip.exe",args:[]}]:[{command:"wl-copy",args:[]},{command:"xclip",args:["-selection","clipboard"]},{command:"xsel",args:["--clipboard","--input"]}];for(let{command:n,args:r}of t)if(await O8t(n,r,e))return!0;return!1}function O8t(e,t,n){return new Promise(r=>{let o;try{o=b8t(e,t,{stdio:["pipe","ignore","ignore"]})}catch{r(!1);return}o.on("error",()=>r(!1)),o.on("exit",i=>r(i===0)),o.stdin?.on("error",()=>r(!1)),o.stdin?.end(n)})}var Cqe=["private","workspace","public"],bqe={meta:{name:"share-codex",description:"Upload a Codex session rollout (.jsonl) to Lore and print a shareable URL."},args:{"session-file":{type:"string",required:!0,description:"Absolute path to a Codex rollout file (e.g. ~/.codex/sessions/YYYY/MM/DD/rollout-...jsonl)"},visibility:{type:"string",required:!1,description:"After upload, set thread visibility to one of: private, workspace, public"},highlight:{type:"string",required:!1,description:"Natural-language description of the block or block range to highlight in the returned /thread URL."}},async run({args:e}){let t=e["session-file"];if(typeof t!="string"||t.trim()==="")throw new Error("--session-file is required");let n=w8t(e.visibility);if(Au())await oD({title:"lore share-codex",subtitle:"sharing this Codex session",perform:r=>Bue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0,progress:r})});else{let r=await Bue({sessionFile:t,harness:"codex",visibility:n,highlight:typeof e.highlight=="string"?e.highlight:void 0});console.log(JSON.stringify(r))}}};function w8t(e){if(!(e==null||e==="")){if(typeof e!="string")throw new Error("--visibility must be a string");if(!Cqe.includes(e))throw new Error(`--visibility must be one of: ${Cqe.join(", ")}`);return e}}m();so();wr();wk();xE();Jse();Zse();m();import k8t from"node:crypto";ZE();var M8t=async(e,t)=>{let n={method:"PUT",body:typeof t=="string"?t:new Uint8Array(t)};return{status:(await fetch(e,n)).status}};async function Nue(e,t,n={}){let r=n.progress??iD,{contents:o,accountId:i,orgId:a,sessionId:c}=t,d=k8t.createHash("md5").update(o.transcript).digest("hex");r({kind:"step",step:"resolving_session",label:c});let g=await e.createUploadSession({headers:{},body:{thread_files:[{md5:d,harness:"cowork",harness_internal_id:c,filename:"audit.jsonl",file_type:"transcript",artifact_metadata:{uploads:o.uploads,outputs:o.outputs}}]}});if(g.status!==201)throw tc("createUploadSession",g.status,g.body);let h=g.body.thread_files[0];if(h.error&&h.thread)return{threadId:h.thread.id,duplicate:!0};if(!h.presigned_url)throw new Error(`createUploadSession returned no presigned_url and no existing thread: ${JSON.stringify(h)}`);r({kind:"step",step:"uploading"});let y=await(n.putBlob??M8t)(h.presigned_url,Buffer.from(o.transcript,"utf8"));if(y.status<200||y.status>=300)throw new Error(`presigned PUT failed: HTTP ${y.status}`);let C=await e.completeUploadSession({headers:{},params:{id:g.body.id},body:{thread_files:[{storage_url:h.storage_url}]}});if(C.status!==200)throw tc("completeUploadSession",C.status,C.body);let v=C.body.thread_files[0];if(!v?.thread)throw new Error(`completeUploadSession returned no thread: ${JSON.stringify(v)}`);return{threadId:v.thread.id,duplicate:!1}}var vqe={meta:{name:"share-cowork",description:"Share a Claude Cowork local-agent-mode session to Lore. Defaults to the current session when run from inside one (e.g. by the Cowork agent itself); otherwise shares the most recent local session."},args:{session:{type:"string",description:"Share a specific session by session-id (the bottom-level uuid)"},list:{type:"boolean",description:"List local Cowork sessions (newest first) and exit without sharing"}},async run({args:e,data:t}){Ee.info("command_start",{command:"share-cowork",list:!!e.list,session:e.session??null});let n=Cz();if(e.list){let g=Vx(n);if(g.length===0){console.error(`No Cowork sessions found under ${n}`);return}for(let h of g)console.log(U8t(h));return}let r=P8t(n,typeof e.session=="string"?e.session:void 0);if(!r)throw console.error(`No Cowork session found. Tried CWD walk-up and the most recent under
508
508
  ${n}
509
509
  Run with --list to see available sessions.`),new Error("no session resolved");let o=t?.client??Wt(),i=J5e(r.sessionDir),a=KE();if(Au()){await oD({title:"lore share-cowork",subtitle:`session ${r.sessionId}`,perform:async g=>{let h=await Nue(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i},{progress:g});return g({kind:"completed",url:`${a.replace(/\/+$/,"")}/thread/${h.threadId}`,reused:h.duplicate,clipboardCopied:!1,sessionId:r.sessionId}),g({kind:"step",step:"done"}),h}});return}console.log(`Sharing cowork session ${r.sessionId} (${i.transcript.length} bytes transcript)...`);let c=await Nue(o,{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,contents:i}),d=`${a.replace(/\/+$/,"")}/thread/${c.threadId}`;c.duplicate?console.log(`Already on Lore: ${d}`):console.log(`Shared: ${d}`)}};function P8t(e,t){if(t){let o=Vx(e).find(i=>i.sessionId===t);return o?{accountId:o.accountId,orgId:o.orgId,sessionId:o.sessionId,sessionDir:o.sessionDir,sessionsRoot:e}:null}let n=Z5e(process.cwd());if(n)return n;let r=W5e(e);return r?{accountId:r.accountId,orgId:r.orgId,sessionId:r.sessionId,sessionDir:r.sessionDir,sessionsRoot:e}:null}function U8t(e){let t=new Date(e.mtimeMs).toISOString();return`${e.sessionId} ${e.accountId} ${e.orgId} ${t}`}m();m();so();Jn();wr();var L8t=e=>{let t=Math.max(4,...e.map(r=>r.name.length));return[`${"Name".padEnd(t)} ID`,...e.map(r=>`${r.name.padEnd(t)} ${r.id}`)].join(`
510
510
  `)},Rqe={meta:{name:"list",description:"List workspaces you belong to."},async run({data:e}){Ee.info("command_start",{command:"workspaces list"});let t=e;if(!await(t?.getAccessToken??xn)())throw new Ue("not logged in \u2014 run 'lore login' first");let o=await(t?.client??Wt()).whoAmI({headers:{}});if(o.status!==200){let i=o.body?.message??`whoAmI returned ${o.status}`;throw new Ue(i)}console.log(L8t(o.body.organizations))}};var xqe={meta:{name:"workspaces",description:"List workspaces from your WorkOS AuthKit account. (Workspaces are organizations in the API contract.)"},subCommands:{list:Rqe}};var G8t=q4e(),Nqe={...G8t,health:rVe,feedback:nVe,enable:pVe,disable:Uz,restart:fVe,status:AVe,login:lue,logout:eVe,whoami:tVe,logs:iVe,version:_Ve,uninstall:hVe,export:gqe,configure:SVe,listen:bVe,workspaces:xqe,skills:jVe,slack:$Ve,"share-cowork":vqe,"share-codex":bqe,"tui:stories":pqe,_run_upload:Tqe,"postinstall:migrate":RVe,"postinstall:refresh-background-binary":aVe};function Xz(e){return e.find(t=>!t.startsWith("-"))??"lore"}var j8t={name:"cli-metrics",setup(e){e.data={...e.data,commandStartedAtMs:performance.now()}},async cleanup(e){let t=e.data?.commandStartedAtMs;if(typeof t!="number")return;let n=performance.now()-t,r=e.data?.captureCliCommandMetric??k5e,o=await w5e(r0,e.rawArgs);await r({...o,durationMs:n})}},r0={meta:{name:"lore",description:"Lore CLI"},plugins:[j8t],subCommands:Nqe};function Oue(e){return e instanceof Error&&e.name==="CLIError"}function H8t(e){return Oue(e)&&e.code==="E_UNKNOWN_COMMAND"}async function z8t(e){let t=J4e(e);return Nl({name:`lore ${Xz(t)}`,op:"cli.command",parentSpan:null,forceTransaction:!0,attributes:{"cli.command":Xz(t),"cli.raw_args":e.join(" "),"cli.args":t.join(" ")}},n=>N4e(n,()=>$8t(e,t)))}async function $8t(e,t){let n=V8t(t)?z5e():void 0,r=!1;try{if(t.includes("--help")||t.includes("-h")){let[o,i]=await TVe(r0,t),a=o===r0&&i===void 0?await Tue(r0):await eZ(o,i);return console.log(a),0}if(t.includes("--version")||t.includes("-v"))return console.log(Yu()),0;if(!t.some(o=>!o.startsWith("-"))){if(Au({rawArgs:e})){let{rawArgs:o}=await JVe();return o.length===0||await vy(r0,{rawArgs:[...o]}),0}return console.log(await Tue(r0)),0}return await vy(r0,{rawArgs:t}),0}catch(o){return H8t(o)?(console.error(`Unrecognized command: ${Xz(t)}`),console.error(await eZ(r0))):Oue(o)?o.message.length>0&&console.error(o.message):Ni()==="prod"&&o instanceof Error?console.error(o.message):console.error(o,`